@abi-software/mapintegratedvuer 1.3.4-beta.4 → 1.3.4-beta.5
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-v2XE-wpb.js → ContentMixin-CUpLoykV.js} +1 -1
- package/dist/{Flatmap-CIV4v_eO.js → Flatmap-D4Yn48p4.js} +3 -3
- package/dist/{Iframe-BEN0xhvg.js → Iframe-DP0tJ9dA.js} +2 -2
- package/dist/{MultiFlatmap-viJLOlim.js → MultiFlatmap-CITmXpgg.js} +3 -3
- package/dist/{Plot-3ibOkRaS.js → Plot-DcHgPVml.js} +2 -2
- package/dist/{Scaffold-CrlXw6AR.js → Scaffold-Dm9N-5_F.js} +2 -2
- package/dist/{Simulation-BasUCxtH.js → Simulation-BtnHnexU.js} +2 -2
- package/dist/{index-7AwO7LC4.js → index-BbVlbhv9.js} +4 -4
- package/dist/mapintegratedvuer.js +1 -1
- package/dist/mapintegratedvuer.umd.cjs +1 -1
- package/dist/{style-CbkWycj2.js → style-CkPtTE3H.js} +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/App.vue +8 -4
- package/src/components/MapContent.vue +7 -2
@@ -934,7 +934,7 @@ usage: app.provide(ID_INJECTION_KEY, {
|
|
934
934
|
</g>
|
935
935
|
</svg>`,Lwe=(e,t,r,n)=>{const i=["title","desc","defs","style"],o=["width","height"],s=n||[];let l=document.createElement("div");l.innerHTML=e,i.map(u=>{const d=l.querySelector(u);d&&d.remove()}),o.map(u=>{l.querySelector("svg").removeAttribute(u)}),n&&s.map(u=>{Object.values(l.querySelectorAll(`[${u}]`)).map(d=>{d.removeAttribute(u)})});const c=l.innerHTML;return l=null,c},Swe=e=>[[/<\?xml[\s\S]*?>/gi,""],[/<!doctype[\s\S]*?>/gi,""],[/<!--.*-->/gi,""],[/\<([A-Za-z]+)([^\>]*)\/\>/g,"<$1$2></$1>"],[/\s+/g," "],[/\> \</g,"><"]].reduce((t,r)=>"".replace.apply(t,r),e).trim(),MGt=!0,EGt=!0,AGt=["fill"],kwe=Object.assign({"/assets/icons/2horpanel.svg":W_e,"/assets/icons/2vertpanel.svg":q_e,"/assets/icons/3panel.svg":Z_e,"/assets/icons/4panel.svg":X_e,"/assets/icons/5panel.svg":K_e,"/assets/icons/6panel.svg":Y_e,"/assets/icons/6panelVertical.svg":J_e,"/assets/icons/changeBckgd.svg":$_e,"/assets/icons/close-no-bk.svg":ewe,"/assets/icons/close.svg":twe,"/assets/icons/closeFullScreen.svg":rwe,"/assets/icons/comment.svg":nwe,"/assets/icons/connection.svg":iwe,"/assets/icons/dock.svg":owe,"/assets/icons/drawLine.svg":awe,"/assets/icons/drawPoint.svg":swe,"/assets/icons/drawPolygon.svg":lwe,"/assets/icons/drawTrash.svg":cwe,"/assets/icons/fitWindow.svg":uwe,"/assets/icons/fullScreen.svg":dwe,"/assets/icons/help.svg":hwe,"/assets/icons/magnifyingGlass.svg":pwe,"/assets/icons/noun-filter.svg":fwe,"/assets/icons/openMap.svg":mwe,"/assets/icons/pause.svg":gwe,"/assets/icons/permalink.svg":ywe,"/assets/icons/play.svg":Twe,"/assets/icons/resetZoom.svg":vwe,"/assets/icons/singlepanel.svg":bwe,"/assets/icons/tooltips.svg":Qwe,"/assets/icons/undock.svg":xwe,"/assets/icons/zoomIn.svg":_we,"/assets/icons/zoomOut.svg":wwe});Object.keys(kwe).map(e=>{const t=Lwe(kwe[e],MGt,EGt,AGt),r=e.replace(/^.+\/(\w+).svg$/,"$1");return Swe(t).replace("<svg",`<symbol id="${r}"`).replace("svg>","symbol>")}).join(`
|
936
936
|
`);const zte=Object.assign({"/assets/icons/2horpanel.svg":W_e,"/assets/icons/2vertpanel.svg":q_e,"/assets/icons/3panel.svg":Z_e,"/assets/icons/4panel.svg":X_e,"/assets/icons/5panel.svg":K_e,"/assets/icons/6panel.svg":Y_e,"/assets/icons/6panelVertical.svg":J_e,"/assets/icons/changeBckgd.svg":$_e,"/assets/icons/close-no-bk.svg":ewe,"/assets/icons/close.svg":twe,"/assets/icons/closeFullScreen.svg":rwe,"/assets/icons/comment.svg":nwe,"/assets/icons/connection.svg":iwe,"/assets/icons/dock.svg":owe,"/assets/icons/drawLine.svg":awe,"/assets/icons/drawPoint.svg":swe,"/assets/icons/drawPolygon.svg":lwe,"/assets/icons/drawTrash.svg":cwe,"/assets/icons/fitWindow.svg":uwe,"/assets/icons/fullScreen.svg":dwe,"/assets/icons/help.svg":hwe,"/assets/icons/magnifyingGlass.svg":pwe,"/assets/icons/noun-filter.svg":fwe,"/assets/icons/openMap.svg":mwe,"/assets/icons/pause.svg":gwe,"/assets/icons/permalink.svg":ywe,"/assets/icons/play.svg":Twe,"/assets/icons/resetZoom.svg":vwe,"/assets/icons/singlepanel.svg":bwe,"/assets/icons/tooltips.svg":Qwe,"/assets/icons/undock.svg":xwe,"/assets/icons/zoomIn.svg":_we,"/assets/icons/zoomOut.svg":wwe}),OGt=Object.keys(zte).map(e=>{const t=Lwe(zte[e]),r=e.replace(/^.+\/(\w+).svg$/,"$1");return Swe(t).replace("<svg",`<symbol id="${r}"`).replace("svg>","symbol>")}),IGt={name:"MapSvgSpriteColor",svgContext:zte,svgSprite:OGt.join(`
|
937
|
-
`)},PGt=["innerHTML"];function VGt(e,t,r,n,i,o){return a.openBlock(),a.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:e.$options.svgSprite},null,8,PGt)}const HGt=G_e(IGt,[["render",VGt]]);var Cwe={exports:{}};/*! algoliasearch.umd.js | 4.23.2 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */(function(e,t){(function(r,n){e.exports=n()})(rIt,function(){function r(Ae,We,st){return We in Ae?Object.defineProperty(Ae,We,{value:st,enumerable:!0,configurable:!0,writable:!0}):Ae[We]=st,Ae}function n(Ae,We){var st=Object.keys(Ae);if(Object.getOwnPropertySymbols){var vt=Object.getOwnPropertySymbols(Ae);We&&(vt=vt.filter(function(Ft){return Object.getOwnPropertyDescriptor(Ae,Ft).enumerable})),st.push.apply(st,vt)}return st}function i(Ae){for(var We=1;We<arguments.length;We++){var st=arguments[We]!=null?arguments[We]:{};We%2?n(Object(st),!0).forEach(function(vt){r(Ae,vt,st[vt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Ae,Object.getOwnPropertyDescriptors(st)):n(Object(st)).forEach(function(vt){Object.defineProperty(Ae,vt,Object.getOwnPropertyDescriptor(st,vt))})}return Ae}function o(Ae,We){if(Ae==null)return{};var st,vt,Ft=function(mr,Tr){if(mr==null)return{};var Rr,Mr,zr={},xr=Object.keys(mr);for(Mr=0;Mr<xr.length;Mr++)Rr=xr[Mr],Tr.indexOf(Rr)>=0||(zr[Rr]=mr[Rr]);return zr}(Ae,We);if(Object.getOwnPropertySymbols){var ur=Object.getOwnPropertySymbols(Ae);for(vt=0;vt<ur.length;vt++)st=ur[vt],We.indexOf(st)>=0||Object.prototype.propertyIsEnumerable.call(Ae,st)&&(Ft[st]=Ae[st])}return Ft}function s(Ae,We){return function(st){if(Array.isArray(st))return st}(Ae)||function(st,vt){if(Symbol.iterator in Object(st)||Object.prototype.toString.call(st)==="[object Arguments]"){var Ft=[],ur=!0,mr=!1,Tr=void 0;try{for(var Rr,Mr=st[Symbol.iterator]();!(ur=(Rr=Mr.next()).done)&&(Ft.push(Rr.value),!vt||Ft.length!==vt);ur=!0);}catch(zr){mr=!0,Tr=zr}finally{try{ur||Mr.return==null||Mr.return()}finally{if(mr)throw Tr}}return Ft}}(Ae,We)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function l(Ae){return function(We){if(Array.isArray(We)){for(var st=0,vt=new Array(We.length);st<We.length;st++)vt[st]=We[st];return vt}}(Ae)||function(We){if(Symbol.iterator in Object(We)||Object.prototype.toString.call(We)==="[object Arguments]")return Array.from(We)}(Ae)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function c(Ae){var We,st="algoliasearch-client-js-".concat(Ae.key),vt=function(){return We===void 0&&(We=Ae.localStorage||window.localStorage),We},Ft=function(){return JSON.parse(vt().getItem(st)||"{}")},ur=function(Tr){vt().setItem(st,JSON.stringify(Tr))},mr=function(){var Tr=Ae.timeToLive?1e3*Ae.timeToLive:null,Rr=Ft(),Mr=Object.fromEntries(Object.entries(Rr).filter(function(xr){return s(xr,2)[1].timestamp!==void 0}));if(ur(Mr),Tr){var zr=Object.fromEntries(Object.entries(Mr).filter(function(xr){var Hr=s(xr,2)[1],Hn=new Date().getTime();return!(Hr.timestamp+Tr<Hn)}));ur(zr)}};return{get:function(Tr,Rr){var Mr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){mr();var zr=JSON.stringify(Tr);return Ft()[zr]}).then(function(zr){return Promise.all([zr?zr.value:Rr(),zr!==void 0])}).then(function(zr){var xr=s(zr,2),Hr=xr[0],Hn=xr[1];return Promise.all([Hr,Hn||Mr.miss(Hr)])}).then(function(zr){return s(zr,1)[0]})},set:function(Tr,Rr){return Promise.resolve().then(function(){var Mr=Ft();return Mr[JSON.stringify(Tr)]={timestamp:new Date().getTime(),value:Rr},vt().setItem(st,JSON.stringify(Mr)),Rr})},delete:function(Tr){return Promise.resolve().then(function(){var Rr=Ft();delete Rr[JSON.stringify(Tr)],vt().setItem(st,JSON.stringify(Rr))})},clear:function(){return Promise.resolve().then(function(){vt().removeItem(st)})}}}function u(Ae){var We=l(Ae.caches),st=We.shift();return st===void 0?{get:function(vt,Ft){var ur=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},mr=Ft();return mr.then(function(Tr){return Promise.all([Tr,ur.miss(Tr)])}).then(function(Tr){return s(Tr,1)[0]})},set:function(vt,Ft){return Promise.resolve(Ft)},delete:function(vt){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(vt,Ft){var ur=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return st.get(vt,Ft,ur).catch(function(){return u({caches:We}).get(vt,Ft,ur)})},set:function(vt,Ft){return st.set(vt,Ft).catch(function(){return u({caches:We}).set(vt,Ft)})},delete:function(vt){return st.delete(vt).catch(function(){return u({caches:We}).delete(vt)})},clear:function(){return st.clear().catch(function(){return u({caches:We}).clear()})}}}function d(){var Ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{serializable:!0},We={};return{get:function(st,vt){var Ft=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},ur=JSON.stringify(st);if(ur in We)return Promise.resolve(Ae.serializable?JSON.parse(We[ur]):We[ur]);var mr=vt(),Tr=Ft&&Ft.miss||function(){return Promise.resolve()};return mr.then(function(Rr){return Tr(Rr)}).then(function(){return mr})},set:function(st,vt){return We[JSON.stringify(st)]=Ae.serializable?JSON.stringify(vt):vt,Promise.resolve(vt)},delete:function(st){return delete We[JSON.stringify(st)],Promise.resolve()},clear:function(){return We={},Promise.resolve()}}}function h(Ae,We,st){var vt={"x-algolia-api-key":st,"x-algolia-application-id":We};return{headers:function(){return Ae===y.WithinHeaders?vt:{}},queryParameters:function(){return Ae===y.WithinQueryParameters?vt:{}}}}function p(Ae){var We=0;return Ae(function st(){return We++,new Promise(function(vt){setTimeout(function(){vt(Ae(st))},Math.min(100*We,1e3))})})}function f(Ae){var We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(st,vt){return Promise.resolve()};return Object.assign(Ae,{wait:function(st){return f(Ae.then(function(vt){return Promise.all([We(vt,st),vt])}).then(function(vt){return vt[1]}))}})}function m(Ae){for(var We=Ae.length-1;We>0;We--){var st=Math.floor(Math.random()*(We+1)),vt=Ae[We];Ae[We]=Ae[st],Ae[st]=vt}return Ae}function g(Ae,We){return We&&Object.keys(We).forEach(function(st){Ae[st]=We[st](Ae)}),Ae}function T(Ae){for(var We=arguments.length,st=new Array(We>1?We-1:0),vt=1;vt<We;vt++)st[vt-1]=arguments[vt];var Ft=0;return Ae.replace(/%s/g,function(){return encodeURIComponent(st[Ft++])})}var y={WithinQueryParameters:0,WithinHeaders:1};function v(Ae,We){var st=Ae||{},vt=st.data||{};return Object.keys(st).forEach(function(Ft){["timeout","headers","queryParameters","data","cacheable"].indexOf(Ft)===-1&&(vt[Ft]=st[Ft])}),{data:Object.entries(vt).length>0?vt:void 0,timeout:st.timeout||We,headers:st.headers||{},queryParameters:st.queryParameters||{},cacheable:st.cacheable}}var Q={Read:1,Write:2,Any:3},_=1,L=2,w=3;function S(Ae){var We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_;return i(i({},Ae),{},{status:We,lastUpdate:Date.now()})}function C(Ae){return typeof Ae=="string"?{protocol:"https",url:Ae,accept:Q.Any}:{protocol:Ae.protocol||"https",url:Ae.url,accept:Ae.accept||Q.Any}}var E="DELETE",O="GET",I="POST",R="PUT";function B(Ae,We){return Promise.all(We.map(function(st){return Ae.get(st,function(){return Promise.resolve(S(st))})})).then(function(st){var vt=st.filter(function(mr){return function(Tr){return Tr.status===_||Date.now()-Tr.lastUpdate>12e4}(mr)}),Ft=st.filter(function(mr){return function(Tr){return Tr.status===w&&Date.now()-Tr.lastUpdate<=12e4}(mr)}),ur=[].concat(l(vt),l(Ft));return{getTimeout:function(mr,Tr){return(Ft.length===0&&mr===0?1:Ft.length+3+mr)*Tr},statelessHosts:ur.length>0?ur.map(function(mr){return C(mr)}):We}})}function D(Ae,We,st,vt){var Ft=[],ur=function(Hr,Hn){if(!(Hr.method===O||Hr.data===void 0&&Hn.data===void 0)){var Wn=Array.isArray(Hr.data)?Hr.data:i(i({},Hr.data),Hn.data);return JSON.stringify(Wn)}}(st,vt),mr=function(Hr,Hn){var Wn=i(i({},Hr.headers),Hn.headers),ei={};return Object.keys(Wn).forEach(function(uo){var _a=Wn[uo];ei[uo.toLowerCase()]=_a}),ei}(Ae,vt),Tr=st.method,Rr=st.method!==O?{}:i(i({},st.data),vt.data),Mr=i(i(i({"x-algolia-agent":Ae.userAgent.value},Ae.queryParameters),Rr),vt.queryParameters),zr=0,xr=function Hr(Hn,Wn){var ei=Hn.pop();if(ei===void 0)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:G(Ft)};var uo={data:ur,headers:mr,method:Tr,url:V(ei,st.path,Mr),connectTimeout:Wn(zr,Ae.timeouts.connect),responseTimeout:Wn(zr,vt.timeout)},_a=function(ds){var wa={request:uo,response:ds,host:ei,triesLeft:Hn.length};return Ft.push(wa),wa},ho={onSuccess:function(ds){return function(wa){try{return JSON.parse(wa.content)}catch(_s){throw function(zl,Bc){return{name:"DeserializationError",message:zl,response:Bc}}(_s.message,wa)}}(ds)},onRetry:function(ds){var wa=_a(ds);return ds.isTimedOut&&zr++,Promise.all([Ae.logger.info("Retryable failure",X(wa)),Ae.hostsCache.set(ei,S(ei,ds.isTimedOut?w:L))]).then(function(){return Hr(Hn,Wn)})},onFail:function(ds){throw _a(ds),function(wa,_s){var zl=wa.content,Bc=wa.status,dc=zl;try{dc=JSON.parse(zl).message}catch{}return function(qu,ou,Rs){return{name:"ApiError",message:qu,status:ou,transporterStackTrace:Rs}}(dc,Bc,_s)}(ds,G(Ft))}};return Ae.requester.send(uo).then(function(ds){return function(wa,_s){return function(zl){var Bc=zl.status;return zl.isTimedOut||function(dc){var qu=dc.isTimedOut,ou=dc.status;return!qu&&~~ou==0}(zl)||~~(Bc/100)!=2&&~~(Bc/100)!=4}(wa)?_s.onRetry(wa):~~(wa.status/100)==2?_s.onSuccess(wa):_s.onFail(wa)}(ds,ho)})};return B(Ae.hostsCache,We).then(function(Hr){return xr(l(Hr.statelessHosts).reverse(),Hr.getTimeout)})}function j(Ae){var We=Ae.hostsCache,st=Ae.logger,vt=Ae.requester,Ft=Ae.requestsCache,ur=Ae.responsesCache,mr=Ae.timeouts,Tr=Ae.userAgent,Rr=Ae.hosts,Mr=Ae.queryParameters,zr={hostsCache:We,logger:st,requester:vt,requestsCache:Ft,responsesCache:ur,timeouts:mr,userAgent:Tr,headers:Ae.headers,queryParameters:Mr,hosts:Rr.map(function(xr){return C(xr)}),read:function(xr,Hr){var Hn=v(Hr,zr.timeouts.read),Wn=function(){return D(zr,zr.hosts.filter(function(uo){return(uo.accept&Q.Read)!=0}),xr,Hn)};if((Hn.cacheable!==void 0?Hn.cacheable:xr.cacheable)!==!0)return Wn();var ei={request:xr,mappedRequestOptions:Hn,transporter:{queryParameters:zr.queryParameters,headers:zr.headers}};return zr.responsesCache.get(ei,function(){return zr.requestsCache.get(ei,function(){return zr.requestsCache.set(ei,Wn()).then(function(uo){return Promise.all([zr.requestsCache.delete(ei),uo])},function(uo){return Promise.all([zr.requestsCache.delete(ei),Promise.reject(uo)])}).then(function(uo){var _a=s(uo,2);return _a[0],_a[1]})})},{miss:function(uo){return zr.responsesCache.set(ei,uo)}})},write:function(xr,Hr){return D(zr,zr.hosts.filter(function(Hn){return(Hn.accept&Q.Write)!=0}),xr,v(Hr,zr.timeouts.write))}};return zr}function N(Ae){var We={value:"Algolia for JavaScript (".concat(Ae,")"),add:function(st){var vt="; ".concat(st.segment).concat(st.version!==void 0?" (".concat(st.version,")"):"");return We.value.indexOf(vt)===-1&&(We.value="".concat(We.value).concat(vt)),We}};return We}function V(Ae,We,st){var vt=W(st),Ft="".concat(Ae.protocol,"://").concat(Ae.url,"/").concat(We.charAt(0)==="/"?We.substr(1):We);return vt.length&&(Ft+="?".concat(vt)),Ft}function W(Ae){return Object.keys(Ae).map(function(We){return T("%s=%s",We,(st=Ae[We],Object.prototype.toString.call(st)==="[object Object]"||Object.prototype.toString.call(st)==="[object Array]"?JSON.stringify(Ae[We]):Ae[We]));var st}).join("&")}function G(Ae){return Ae.map(function(We){return X(We)})}function X(Ae){var We=Ae.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return i(i({},Ae),{},{request:i(i({},Ae.request),{},{headers:i(i({},Ae.request.headers),We)})})}var $=function(Ae){return function(We,st){return Ae.transporter.write({method:I,path:"2/abtests",data:We},st)}},te=function(Ae){return function(We,st){return Ae.transporter.write({method:E,path:T("2/abtests/%s",We)},st)}},ce=function(Ae){return function(We,st){return Ae.transporter.read({method:O,path:T("2/abtests/%s",We)},st)}},Qe=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"2/abtests"},We)}},me=function(Ae){return function(We,st){return Ae.transporter.write({method:I,path:T("2/abtests/%s/stop",We)},st)}},ne=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"1/strategies/personalization"},We)}},le=function(Ae){return function(We,st){return Ae.transporter.write({method:I,path:"1/strategies/personalization",data:We},st)}};function ee(Ae){return function We(st){return Ae.request(st).then(function(vt){if(Ae.batch!==void 0&&Ae.batch(vt.hits),!Ae.shouldStop(vt))return vt.cursor?We({cursor:vt.cursor}):We({page:(st.page||0)+1})})}({})}var oe=function(Ae){return function(We,st){var vt=st||{},Ft=vt.queryParameters,ur=o(vt,["queryParameters"]),mr=i({acl:We},Ft!==void 0?{queryParameters:Ft}:{});return f(Ae.transporter.write({method:I,path:"1/keys",data:mr},ur),function(Tr,Rr){return p(function(Mr){return rt(Ae)(Tr.key,Rr).catch(function(zr){if(zr.status!==404)throw zr;return Mr()})})})}},ie=function(Ae){return function(We,st,vt){var Ft=v(vt);return Ft.queryParameters["X-Algolia-User-ID"]=We,Ae.transporter.write({method:I,path:"1/clusters/mapping",data:{cluster:st}},Ft)}},he=function(Ae){return function(We,st,vt){return Ae.transporter.write({method:I,path:"1/clusters/mapping/batch",data:{users:We,cluster:st}},vt)}},we=function(Ae){return function(We,st){return f(Ae.transporter.write({method:I,path:T("/1/dictionaries/%s/batch",We),data:{clearExistingDictionaryEntries:!0,requests:{action:"addEntry",body:[]}}},st),function(vt,Ft){return Ye(Ae)(vt.taskID,Ft)})}},Pe=function(Ae){return function(We,st,vt){return f(Ae.transporter.write({method:I,path:T("1/indexes/%s/operation",We),data:{operation:"copy",destination:st}},vt),function(Ft,ur){return ft(Ae)(We,{methods:{waitTask:ci}}).waitTask(Ft.taskID,ur)})}},pe=function(Ae){return function(We,st,vt){return Pe(Ae)(We,st,i(i({},vt),{},{scope:[xa.Rules]}))}},Ce=function(Ae){return function(We,st,vt){return Pe(Ae)(We,st,i(i({},vt),{},{scope:[xa.Settings]}))}},Le=function(Ae){return function(We,st,vt){return Pe(Ae)(We,st,i(i({},vt),{},{scope:[xa.Synonyms]}))}},Oe=function(Ae){return function(We,st){return We.method===O?Ae.transporter.read(We,st):Ae.transporter.write(We,st)}},De=function(Ae){return function(We,st){return f(Ae.transporter.write({method:E,path:T("1/keys/%s",We)},st),function(vt,Ft){return p(function(ur){return rt(Ae)(We,Ft).then(ur).catch(function(mr){if(mr.status!==404)throw mr})})})}},ot=function(Ae){return function(We,st,vt){var Ft=st.map(function(ur){return{action:"deleteEntry",body:{objectID:ur}}});return f(Ae.transporter.write({method:I,path:T("/1/dictionaries/%s/batch",We),data:{clearExistingDictionaryEntries:!1,requests:Ft}},vt),function(ur,mr){return Ye(Ae)(ur.taskID,mr)})}},rt=function(Ae){return function(We,st){return Ae.transporter.read({method:O,path:T("1/keys/%s",We)},st)}},dt=function(Ae){return function(We,st){return Ae.transporter.read({method:O,path:T("1/task/%s",We.toString())},st)}},wt=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"/1/dictionaries/*/settings"},We)}},yt=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"1/logs"},We)}},ge=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"1/clusters/mapping/top"},We)}},Xe=function(Ae){return function(We,st){return Ae.transporter.read({method:O,path:T("1/clusters/mapping/%s",We)},st)}},pt=function(Ae){return function(We){var st=We||{},vt=st.retrieveMappings,Ft=o(st,["retrieveMappings"]);return vt===!0&&(Ft.getClusters=!0),Ae.transporter.read({method:O,path:"1/clusters/mapping/pending"},Ft)}},ft=function(Ae){return function(We){var st=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},vt={transporter:Ae.transporter,appId:Ae.appId,indexName:We};return g(vt,st.methods)}},_t=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"1/keys"},We)}},Pt=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"1/clusters"},We)}},Vt=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"1/indexes"},We)}},qt=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"1/clusters/mapping"},We)}},Zt=function(Ae){return function(We,st,vt){return f(Ae.transporter.write({method:I,path:T("1/indexes/%s/operation",We),data:{operation:"move",destination:st}},vt),function(Ft,ur){return ft(Ae)(We,{methods:{waitTask:ci}}).waitTask(Ft.taskID,ur)})}},ht=function(Ae){return function(We,st){return f(Ae.transporter.write({method:I,path:"1/indexes/*/batch",data:{requests:We}},st),function(vt,Ft){return Promise.all(Object.keys(vt.taskID).map(function(ur){return ft(Ae)(ur,{methods:{waitTask:ci}}).waitTask(vt.taskID[ur],Ft)}))})}},kt=function(Ae){return function(We,st){return Ae.transporter.read({method:I,path:"1/indexes/*/objects",data:{requests:We}},st)}},Ht=function(Ae){return function(We,st){var vt=We.map(function(Ft){return i(i({},Ft),{},{params:W(Ft.params||{})})});return Ae.transporter.read({method:I,path:"1/indexes/*/queries",data:{requests:vt},cacheable:!0},st)}},Gt=function(Ae){return function(We,st){return Promise.all(We.map(function(vt){var Ft=vt.params,ur=Ft.facetName,mr=Ft.facetQuery,Tr=o(Ft,["facetName","facetQuery"]);return ft(Ae)(vt.indexName,{methods:{searchForFacetValues:Gn}}).searchForFacetValues(ur,mr,i(i({},st),Tr))}))}},fr=function(Ae){return function(We,st){var vt=v(st);return vt.queryParameters["X-Algolia-User-ID"]=We,Ae.transporter.write({method:E,path:"1/clusters/mapping"},vt)}},tr=function(Ae){return function(We,st,vt){var Ft=st.map(function(ur){return{action:"addEntry",body:ur}});return f(Ae.transporter.write({method:I,path:T("/1/dictionaries/%s/batch",We),data:{clearExistingDictionaryEntries:!0,requests:Ft}},vt),function(ur,mr){return Ye(Ae)(ur.taskID,mr)})}},_r=function(Ae){return function(We,st){return f(Ae.transporter.write({method:I,path:T("1/keys/%s/restore",We)},st),function(vt,Ft){return p(function(ur){return rt(Ae)(We,Ft).catch(function(mr){if(mr.status!==404)throw mr;return ur()})})})}},Jt=function(Ae){return function(We,st,vt){var Ft=st.map(function(ur){return{action:"addEntry",body:ur}});return f(Ae.transporter.write({method:I,path:T("/1/dictionaries/%s/batch",We),data:{clearExistingDictionaryEntries:!1,requests:Ft}},vt),function(ur,mr){return Ye(Ae)(ur.taskID,mr)})}},Qr=function(Ae){return function(We,st,vt){return Ae.transporter.read({method:I,path:T("/1/dictionaries/%s/search",We),data:{query:st},cacheable:!0},vt)}},He=function(Ae){return function(We,st){return Ae.transporter.read({method:I,path:"1/clusters/mapping/search",data:{query:We}},st)}},Re=function(Ae){return function(We,st){return f(Ae.transporter.write({method:R,path:"/1/dictionaries/*/settings",data:We},st),function(vt,Ft){return Ye(Ae)(vt.taskID,Ft)})}},Fe=function(Ae){return function(We,st){var vt=Object.assign({},st),Ft=st||{},ur=Ft.queryParameters,mr=o(Ft,["queryParameters"]),Tr=ur?{queryParameters:ur}:{},Rr=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return f(Ae.transporter.write({method:R,path:T("1/keys/%s",We),data:Tr},mr),function(Mr,zr){return p(function(xr){return rt(Ae)(We,zr).then(function(Hr){return function(Hn){return Object.keys(vt).filter(function(Wn){return Rr.indexOf(Wn)!==-1}).every(function(Wn){if(Array.isArray(Hn[Wn])&&Array.isArray(vt[Wn])){var ei=Hn[Wn];return ei.length===vt[Wn].length&&ei.every(function(uo,_a){return uo===vt[Wn][_a]})}return Hn[Wn]===vt[Wn]})}(Hr)?Promise.resolve():xr()})})})}},Ye=function(Ae){return function(We,st){return p(function(vt){return dt(Ae)(We,st).then(function(Ft){return Ft.status!=="published"?vt():void 0})})}},at=function(Ae){return function(We,st){return f(Ae.transporter.write({method:I,path:T("1/indexes/%s/batch",Ae.indexName),data:{requests:We}},st),function(vt,Ft){return ci(Ae)(vt.taskID,Ft)})}},Lt=function(Ae){return function(We){return ee(i(i({shouldStop:function(st){return st.cursor===void 0}},We),{},{request:function(st){return Ae.transporter.read({method:I,path:T("1/indexes/%s/browse",Ae.indexName),data:st},We)}}))}},Se=function(Ae){return function(We){var st=i({hitsPerPage:1e3},We);return ee(i(i({shouldStop:function(vt){return vt.hits.length<st.hitsPerPage}},st),{},{request:function(vt){return _i(Ae)("",i(i({},st),vt)).then(function(Ft){return i(i({},Ft),{},{hits:Ft.hits.map(function(ur){return delete ur._highlightResult,ur})})})}}))}},Ze=function(Ae){return function(We){var st=i({hitsPerPage:1e3},We);return ee(i(i({shouldStop:function(vt){return vt.hits.length<st.hitsPerPage}},st),{},{request:function(vt){return Qo(Ae)("",i(i({},st),vt)).then(function(Ft){return i(i({},Ft),{},{hits:Ft.hits.map(function(ur){return delete ur._highlightResult,ur})})})}}))}},ze=function(Ae){return function(We,st,vt){var Ft=vt||{},ur=Ft.batchSize,mr=o(Ft,["batchSize"]),Tr={taskIDs:[],objectIDs:[]};return f(function Rr(){var Mr,zr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,xr=[];for(Mr=zr;Mr<We.length&&(xr.push(We[Mr]),xr.length!==(ur||1e3));Mr++);return xr.length===0?Promise.resolve(Tr):at(Ae)(xr.map(function(Hr){return{action:st,body:Hr}}),mr).then(function(Hr){return Tr.objectIDs=Tr.objectIDs.concat(Hr.objectIDs),Tr.taskIDs.push(Hr.taskID),Mr++,Rr(Mr)})}(),function(Rr,Mr){return Promise.all(Rr.taskIDs.map(function(zr){return ci(Ae)(zr,Mr)}))})}},Je=function(Ae){return function(We){return f(Ae.transporter.write({method:I,path:T("1/indexes/%s/clear",Ae.indexName)},We),function(st,vt){return ci(Ae)(st.taskID,vt)})}},Be=function(Ae){return function(We){var st=We||{},vt=st.forwardToReplicas,Ft=v(o(st,["forwardToReplicas"]));return vt&&(Ft.queryParameters.forwardToReplicas=1),f(Ae.transporter.write({method:I,path:T("1/indexes/%s/rules/clear",Ae.indexName)},Ft),function(ur,mr){return ci(Ae)(ur.taskID,mr)})}},$e=function(Ae){return function(We){var st=We||{},vt=st.forwardToReplicas,Ft=v(o(st,["forwardToReplicas"]));return vt&&(Ft.queryParameters.forwardToReplicas=1),f(Ae.transporter.write({method:I,path:T("1/indexes/%s/synonyms/clear",Ae.indexName)},Ft),function(ur,mr){return ci(Ae)(ur.taskID,mr)})}},ut=function(Ae){return function(We,st){return f(Ae.transporter.write({method:I,path:T("1/indexes/%s/deleteByQuery",Ae.indexName),data:We},st),function(vt,Ft){return ci(Ae)(vt.taskID,Ft)})}},ke=function(Ae){return function(We){return f(Ae.transporter.write({method:E,path:T("1/indexes/%s",Ae.indexName)},We),function(st,vt){return ci(Ae)(st.taskID,vt)})}},Te=function(Ae){return function(We,st){return f(Ee(Ae)([We],st).then(function(vt){return{taskID:vt.taskIDs[0]}}),function(vt,Ft){return ci(Ae)(vt.taskID,Ft)})}},Ee=function(Ae){return function(We,st){var vt=We.map(function(Ft){return{objectID:Ft}});return ze(Ae)(vt,co.DeleteObject,st)}},Ge=function(Ae){return function(We,st){var vt=st||{},Ft=vt.forwardToReplicas,ur=v(o(vt,["forwardToReplicas"]));return Ft&&(ur.queryParameters.forwardToReplicas=1),f(Ae.transporter.write({method:E,path:T("1/indexes/%s/rules/%s",Ae.indexName,We)},ur),function(mr,Tr){return ci(Ae)(mr.taskID,Tr)})}},Qt=function(Ae){return function(We,st){var vt=st||{},Ft=vt.forwardToReplicas,ur=v(o(vt,["forwardToReplicas"]));return Ft&&(ur.queryParameters.forwardToReplicas=1),f(Ae.transporter.write({method:E,path:T("1/indexes/%s/synonyms/%s",Ae.indexName,We)},ur),function(mr,Tr){return ci(Ae)(mr.taskID,Tr)})}},jt=function(Ae){return function(We){return Or(Ae)(We).then(function(){return!0}).catch(function(st){if(st.status!==404)throw st;return!1})}},or=function(Ae){return function(We,st,vt){return Ae.transporter.read({method:I,path:T("1/answers/%s/prediction",Ae.indexName),data:{query:We,queryLanguages:st},cacheable:!0},vt)}},yr=function(Ae){return function(We,st){var vt=st||{},Ft=vt.query,ur=vt.paginate,mr=o(vt,["query","paginate"]),Tr=0;return function Rr(){return Fn(Ae)(Ft||"",i(i({},mr),{},{page:Tr})).then(function(Mr){for(var zr=0,xr=Object.entries(Mr.hits);zr<xr.length;zr++){var Hr=s(xr[zr],2),Hn=Hr[0],Wn=Hr[1];if(We(Wn))return{object:Wn,position:parseInt(Hn,10),page:Tr}}if(Tr++,ur===!1||Tr>=Mr.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return Rr()})}()}},rr=function(Ae){return function(We,st){return Ae.transporter.read({method:O,path:T("1/indexes/%s/%s",Ae.indexName,We)},st)}},br=function(){return function(Ae,We){for(var st=0,vt=Object.entries(Ae.hits);st<vt.length;st++){var Ft=s(vt[st],2),ur=Ft[0];if(Ft[1].objectID===We)return parseInt(ur,10)}return-1}},Wr=function(Ae){return function(We,st){var vt=st||{},Ft=vt.attributesToRetrieve,ur=o(vt,["attributesToRetrieve"]),mr=We.map(function(Tr){return i({indexName:Ae.indexName,objectID:Tr},Ft?{attributesToRetrieve:Ft}:{})});return Ae.transporter.read({method:I,path:"1/indexes/*/objects",data:{requests:mr}},ur)}},Fr=function(Ae){return function(We,st){return Ae.transporter.read({method:O,path:T("1/indexes/%s/rules/%s",Ae.indexName,We)},st)}},Or=function(Ae){return function(We){return Ae.transporter.read({method:O,path:T("1/indexes/%s/settings",Ae.indexName),data:{getVersion:2}},We)}},Ur=function(Ae){return function(We,st){return Ae.transporter.read({method:O,path:T("1/indexes/%s/synonyms/%s",Ae.indexName,We)},st)}},En=function(Ae){return function(We,st){return f(rn(Ae)([We],st).then(function(vt){return{objectID:vt.objectIDs[0],taskID:vt.taskIDs[0]}}),function(vt,Ft){return ci(Ae)(vt.taskID,Ft)})}},rn=function(Ae){return function(We,st){var vt=st||{},Ft=vt.createIfNotExists,ur=o(vt,["createIfNotExists"]),mr=Ft?co.PartialUpdateObject:co.PartialUpdateObjectNoCreate;return ze(Ae)(We,mr,ur)}},Vr=function(Ae){return function(We,st){var vt=st||{},Ft=vt.safe,ur=vt.autoGenerateObjectIDIfNotExist,mr=vt.batchSize,Tr=o(vt,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),Rr=function(Wn,ei,uo,_a){return f(Ae.transporter.write({method:I,path:T("1/indexes/%s/operation",Wn),data:{operation:uo,destination:ei}},_a),function(ho,ds){return ci(Ae)(ho.taskID,ds)})},Mr=Math.random().toString(36).substring(7),zr="".concat(Ae.indexName,"_tmp_").concat(Mr),xr=On({appId:Ae.appId,transporter:Ae.transporter,indexName:zr}),Hr=[],Hn=Rr(Ae.indexName,zr,"copy",i(i({},Tr),{},{scope:["settings","synonyms","rules"]}));return Hr.push(Hn),f((Ft?Hn.wait(Tr):Hn).then(function(){var Wn=xr(We,i(i({},Tr),{},{autoGenerateObjectIDIfNotExist:ur,batchSize:mr}));return Hr.push(Wn),Ft?Wn.wait(Tr):Wn}).then(function(){var Wn=Rr(zr,Ae.indexName,"move",Tr);return Hr.push(Wn),Ft?Wn.wait(Tr):Wn}).then(function(){return Promise.all(Hr)}).then(function(Wn){var ei=s(Wn,3),uo=ei[0],_a=ei[1],ho=ei[2];return{objectIDs:_a.objectIDs,taskIDs:[uo.taskID].concat(l(_a.taskIDs),[ho.taskID])}}),function(Wn,ei){return Promise.all(Hr.map(function(uo){return uo.wait(ei)}))})}},Dr=function(Ae){return function(We,st){return pn(Ae)(We,i(i({},st),{},{clearExistingRules:!0}))}},Kr=function(Ae){return function(We,st){return zi(Ae)(We,i(i({},st),{},{clearExistingSynonyms:!0}))}},Xr=function(Ae){return function(We,st){return f(On(Ae)([We],st).then(function(vt){return{objectID:vt.objectIDs[0],taskID:vt.taskIDs[0]}}),function(vt,Ft){return ci(Ae)(vt.taskID,Ft)})}},On=function(Ae){return function(We,st){var vt=st||{},Ft=vt.autoGenerateObjectIDIfNotExist,ur=o(vt,["autoGenerateObjectIDIfNotExist"]),mr=Ft?co.AddObject:co.UpdateObject;if(mr===co.UpdateObject){var Tr=!0,Rr=!1,Mr=void 0;try{for(var zr,xr=We[Symbol.iterator]();!(Tr=(zr=xr.next()).done);Tr=!0)if(zr.value.objectID===void 0)return f(Promise.reject({name:"MissingObjectIDError",message:"All objects must have an unique objectID (like a primary key) to be valid. Algolia is also able to generate objectIDs automatically but *it's not recommended*. To do it, use the `{'autoGenerateObjectIDIfNotExist': true}` option."}))}catch(Hr){Rr=!0,Mr=Hr}finally{try{Tr||xr.return==null||xr.return()}finally{if(Rr)throw Mr}}}return ze(Ae)(We,mr,ur)}},$r=function(Ae){return function(We,st){return pn(Ae)([We],st)}},pn=function(Ae){return function(We,st){var vt=st||{},Ft=vt.forwardToReplicas,ur=vt.clearExistingRules,mr=v(o(vt,["forwardToReplicas","clearExistingRules"]));return Ft&&(mr.queryParameters.forwardToReplicas=1),ur&&(mr.queryParameters.clearExistingRules=1),f(Ae.transporter.write({method:I,path:T("1/indexes/%s/rules/batch",Ae.indexName),data:We},mr),function(Tr,Rr){return ci(Ae)(Tr.taskID,Rr)})}},on=function(Ae){return function(We,st){return zi(Ae)([We],st)}},zi=function(Ae){return function(We,st){var vt=st||{},Ft=vt.forwardToReplicas,ur=vt.clearExistingSynonyms,mr=vt.replaceExistingSynonyms,Tr=v(o(vt,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return Ft&&(Tr.queryParameters.forwardToReplicas=1),(mr||ur)&&(Tr.queryParameters.replaceExistingSynonyms=1),f(Ae.transporter.write({method:I,path:T("1/indexes/%s/synonyms/batch",Ae.indexName),data:We},Tr),function(Rr,Mr){return ci(Ae)(Rr.taskID,Mr)})}},Fn=function(Ae){return function(We,st){return Ae.transporter.read({method:I,path:T("1/indexes/%s/query",Ae.indexName),data:{query:We},cacheable:!0},st)}},Gn=function(Ae){return function(We,st,vt){return Ae.transporter.read({method:I,path:T("1/indexes/%s/facets/%s/query",Ae.indexName,We),data:{facetQuery:st},cacheable:!0},vt)}},_i=function(Ae){return function(We,st){return Ae.transporter.read({method:I,path:T("1/indexes/%s/rules/search",Ae.indexName),data:{query:We}},st)}},Qo=function(Ae){return function(We,st){return Ae.transporter.read({method:I,path:T("1/indexes/%s/synonyms/search",Ae.indexName),data:{query:We}},st)}},vi=function(Ae){return function(We,st){var vt=st||{},Ft=vt.forwardToReplicas,ur=v(o(vt,["forwardToReplicas"]));return Ft&&(ur.queryParameters.forwardToReplicas=1),f(Ae.transporter.write({method:R,path:T("1/indexes/%s/settings",Ae.indexName),data:We},ur),function(mr,Tr){return ci(Ae)(mr.taskID,Tr)})}},ci=function(Ae){return function(We,st){return p(function(vt){return function(Ft){return function(ur,mr){return Ft.transporter.read({method:O,path:T("1/indexes/%s/task/%s",Ft.indexName,ur.toString())},mr)}}(Ae)(We,st).then(function(Ft){return Ft.status!=="published"?vt():void 0})})}},co={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},xa={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},qi=1,Vo=2,xs=3,ui=function(Ae){return function(We,st){var vt=We.map(function(Ft){return i(i({},Ft),{},{threshold:Ft.threshold||0})});return Ae.transporter.read({method:I,path:"1/indexes/*/recommendations",data:{requests:vt},cacheable:!0},st)}},bi=function(Ae){return function(We,st){return ui(Ae)(We.map(function(vt){return i(i({},vt),{},{fallbackParameters:{},model:"bought-together"})}),st)}},Jo=function(Ae){return function(We,st){return ui(Ae)(We.map(function(vt){return i(i({},vt),{},{model:"related-products"})}),st)}},se=function(Ae){return function(We,st){var vt=We.map(function(Ft){return i(i({},Ft),{},{model:"trending-facets",threshold:Ft.threshold||0})});return Ae.transporter.read({method:I,path:"1/indexes/*/recommendations",data:{requests:vt},cacheable:!0},st)}},Ve=function(Ae){return function(We,st){var vt=We.map(function(Ft){return i(i({},Ft),{},{model:"trending-items",threshold:Ft.threshold||0})});return Ae.transporter.read({method:I,path:"1/indexes/*/recommendations",data:{requests:vt},cacheable:!0},st)}},_e=function(Ae){return function(We,st){return ui(Ae)(We.map(function(vt){return i(i({},vt),{},{model:"looking-similar"})}),st)}},qe=function(Ae){return function(We,st){var vt=We.map(function(Ft){return i(i({},Ft),{},{model:"recommended-for-you",threshold:Ft.threshold||0})});return Ae.transporter.read({method:I,path:"1/indexes/*/recommendations",data:{requests:vt},cacheable:!0},st)}};function ct(Ae,We,st){var vt,Ft={appId:Ae,apiKey:We,timeouts:{connect:1,read:2,write:30},requester:{send:function(Tr){return new Promise(function(Rr){var Mr=new XMLHttpRequest;Mr.open(Tr.method,Tr.url,!0),Object.keys(Tr.headers).forEach(function(Hn){return Mr.setRequestHeader(Hn,Tr.headers[Hn])});var zr,xr=function(Hn,Wn){return setTimeout(function(){Mr.abort(),Rr({status:0,content:Wn,isTimedOut:!0})},1e3*Hn)},Hr=xr(Tr.connectTimeout,"Connection timeout");Mr.onreadystatechange=function(){Mr.readyState>Mr.OPENED&&zr===void 0&&(clearTimeout(Hr),zr=xr(Tr.responseTimeout,"Socket timeout"))},Mr.onerror=function(){Mr.status===0&&(clearTimeout(Hr),clearTimeout(zr),Rr({content:Mr.responseText||"Network request failed",status:Mr.status,isTimedOut:!1}))},Mr.onload=function(){clearTimeout(Hr),clearTimeout(zr),Rr({content:Mr.responseText,status:Mr.status,isTimedOut:!1})},Mr.send(Tr.data)})}},logger:(vt=xs,{debug:function(Tr,Rr){return qi>=vt&&console.debug(Tr,Rr),Promise.resolve()},info:function(Tr,Rr){return Vo>=vt&&console.info(Tr,Rr),Promise.resolve()},error:function(Tr,Rr){return console.error(Tr,Rr),Promise.resolve()}}),responsesCache:d(),requestsCache:d({serializable:!1}),hostsCache:u({caches:[c({key:"".concat("4.23.2","-").concat(Ae)}),d()]}),userAgent:N("4.23.2").add({segment:"Browser"})},ur=i(i({},Ft),st),mr=function(){return function(Tr){return function(Rr){var Mr=Rr.region||"us",zr=h(y.WithinHeaders,Rr.appId,Rr.apiKey),xr=j(i(i({hosts:[{url:"personalization.".concat(Mr,".algolia.com")}]},Rr),{},{headers:i(i(i({},zr.headers()),{"content-type":"application/json"}),Rr.headers),queryParameters:i(i({},zr.queryParameters()),Rr.queryParameters)}));return g({appId:Rr.appId,transporter:xr},Rr.methods)}(i(i(i({},Ft),Tr),{},{methods:{getPersonalizationStrategy:ne,setPersonalizationStrategy:le}}))}};return function(Tr){var Rr=Tr.appId,Mr=h(Tr.authMode!==void 0?Tr.authMode:y.WithinHeaders,Rr,Tr.apiKey),zr=j(i(i({hosts:[{url:"".concat(Rr,"-dsn.algolia.net"),accept:Q.Read},{url:"".concat(Rr,".algolia.net"),accept:Q.Write}].concat(m([{url:"".concat(Rr,"-1.algolianet.com")},{url:"".concat(Rr,"-2.algolianet.com")},{url:"".concat(Rr,"-3.algolianet.com")}]))},Tr),{},{headers:i(i(i({},Mr.headers()),{"content-type":"application/x-www-form-urlencoded"}),Tr.headers),queryParameters:i(i({},Mr.queryParameters()),Tr.queryParameters)}));return g({transporter:zr,appId:Rr,addAlgoliaAgent:function(xr,Hr){zr.userAgent.add({segment:xr,version:Hr})},clearCache:function(){return Promise.all([zr.requestsCache.clear(),zr.responsesCache.clear()]).then(function(){})}},Tr.methods)}(i(i({},ur),{},{methods:{search:Ht,searchForFacetValues:Gt,multipleBatch:ht,multipleGetObjects:kt,multipleQueries:Ht,copyIndex:Pe,copySettings:Ce,copySynonyms:Le,copyRules:pe,moveIndex:Zt,listIndices:Vt,getLogs:yt,listClusters:Pt,multipleSearchForFacetValues:Gt,getApiKey:rt,addApiKey:oe,listApiKeys:_t,updateApiKey:Fe,deleteApiKey:De,restoreApiKey:_r,assignUserID:ie,assignUserIDs:he,getUserID:Xe,searchUserIDs:He,listUserIDs:qt,getTopUserIDs:ge,removeUserID:fr,hasPendingMappings:pt,clearDictionaryEntries:we,deleteDictionaryEntries:ot,getDictionarySettings:wt,getAppTask:dt,replaceDictionaryEntries:tr,saveDictionaryEntries:Jt,searchDictionaryEntries:Qr,setDictionarySettings:Re,waitAppTask:Ye,customRequest:Oe,initIndex:function(Tr){return function(Rr){return ft(Tr)(Rr,{methods:{batch:at,delete:ke,findAnswers:or,getObject:rr,getObjects:Wr,saveObject:Xr,saveObjects:On,search:Fn,searchForFacetValues:Gn,waitTask:ci,setSettings:vi,getSettings:Or,partialUpdateObject:En,partialUpdateObjects:rn,deleteObject:Te,deleteObjects:Ee,deleteBy:ut,clearObjects:Je,browseObjects:Lt,getObjectPosition:br,findObject:yr,exists:jt,saveSynonym:on,saveSynonyms:zi,getSynonym:Ur,searchSynonyms:Qo,browseSynonyms:Ze,deleteSynonym:Qt,clearSynonyms:$e,replaceAllObjects:Vr,replaceAllSynonyms:Kr,searchRules:_i,getRule:Fr,deleteRule:Ge,saveRule:$r,saveRules:pn,replaceAllRules:Dr,browseRules:Se,clearRules:Be}})}},initAnalytics:function(){return function(Tr){return function(Rr){var Mr=Rr.region||"us",zr=h(y.WithinHeaders,Rr.appId,Rr.apiKey),xr=j(i(i({hosts:[{url:"analytics.".concat(Mr,".algolia.com")}]},Rr),{},{headers:i(i(i({},zr.headers()),{"content-type":"application/json"}),Rr.headers),queryParameters:i(i({},zr.queryParameters()),Rr.queryParameters)}));return g({appId:Rr.appId,transporter:xr},Rr.methods)}(i(i(i({},Ft),Tr),{},{methods:{addABTest:$,getABTest:ce,getABTests:Qe,stopABTest:me,deleteABTest:te}}))}},initPersonalization:mr,initRecommendation:function(){return function(Tr){return ur.logger.info("The `initRecommendation` method is deprecated. Use `initPersonalization` instead."),mr()(Tr)}},getRecommendations:ui,getFrequentlyBoughtTogether:bi,getLookingSimilar:_e,getRecommendedForYou:qe,getRelatedProducts:Jo,getTrendingFacets:se,getTrendingItems:Ve}}))}return ct.version="4.23.2",ct})})(Cwe);var RGt=Cwe.exports;const NGt=nIt(RGt);let Mwe=class{constructor(t,r,n="https://api.pennsieve.io"){this.client=NGt(t,r),this.PENNSIEVE_API_LOCATION=n,this.anatomyFacetLabels=[]}initIndex(t){this.index=this.client.initIndex(t)}getAlgoliaFacets(t){const r=t.map(s=>s.facetPropPath),n=t.map(s=>s.facetSubpropPath);let i=[],o=0;return this.index.search("",{sortFacetValuesBy:"alpha",facets:r.concat(n)}).then(s=>(r.map(l=>{const c=t.find(f=>f.facetPropPath==l);var u=[];const d=s.facets;if(d===void 0)return;const h=d[l]==null?{}:d[l],p=c&&d[c.facetSubpropPath]?Object.keys(d[c.facetSubpropPath]):[];Object.keys(h).map(f=>{const m=p.reduce((T,y)=>{const v=y.split(".");return v.length!==2||f===v[0]&&T.push({label:v[1],id:o++,facetPropPath:`${c?c.facetSubpropPath:void 0}`}),T},[]);let g={label:f,id:o++,facetPropPath:l};m.length>0&&(g.children=m),u.push(g)}),u.length>0&&i.push({label:c?c.label:"",id:o++,children:u,key:l})}),i))}_discoverAllDois(t,r="https://api.pennsieve.io"){return new Promise(n=>{fetch(`${r}/discover/datasets/${t}/versions`).then(i=>i.json()).then(i=>{n(i.map(o=>o.doi))})})}_expandDois(t,r="https://api.pennsieve.io"){return new Promise(n=>{let i=t.map(o=>this._discoverAllDois(o,r));Promise.all(i).then(o=>{n(o.flat())})})}_processResultsForCards(t){let r=[],n={};for(let i of t)n={...i},n={anatomy:i.anatomy?i.anatomy.organ.map(o=>o.curie):void 0,doi:i.item.curie.split(":")[1],name:i.item.name,description:i.item.description,updated:i.pennsieve?i.pennsieve.updatedAt:void 0,publishDate:i.pennsieve?i.pennsieve.publishDate:void 0,datasetId:i.objectID,detailsReady:!1},r.push(n);return r}_processAnatomy(t){let r=[],n=[],i=[],o=[];return t.forEach(s=>{s.item&&s.item.keywords&&s.item.keywords.forEach(l=>{let c=l.keyword.toUpperCase();(c.includes("UBERON")||c.includes("ILX"))&&r.push(this._processUberonURL(c))}),s.anatomy&&s.anatomy.organ&&s.anatomy.organ.forEach(l=>{l.curie&&(r.push(l.curie),n.push(l.name))})}),o=[...new Set(r)],i=[...new Set(n)],this.anatomyFacetLabels=i,o}_processUberonURL(t){return t.split("/").pop().replace("_",":")}search(t,r="",n=10,i=1){return new Promise(o=>{this.index.search(r,{facets:["*"],hitsPerPage:n,page:i-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["pennsieve.publishDate","pennsieve.updatedAt","item.curie","item.name","item.description","objectID","anatomy.organ.curie"]}).then(s=>{let l={items:this._processResultsForCards(s.hits),total:s.nbHits,discoverIds:s.hits.map(c=>c.pennsieve?c.pennsieve.identifier:c.objectID),dois:s.hits.map(c=>c.item.curie.split(":")[1])};o(l)})})}anatomyInSearch(t,r="",n=999999,i=1){return new Promise(o=>{this.index.search(r,{facets:["*"],hitsPerPage:n,page:i-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["objectID","item.keywords.keyword","anatomy.organ.name","anatomy.organ.curie"]}).then(s=>{o({forFlatmap:this.processResultsForFlatmap(s.hits),forScaffold:this.processResultsForScaffold(s.hits)})})})}processResultsForFlatmap(t){return t.map(r=>({id:r.objectID,terms:r.anatomy?r.anatomy.organ.map(n=>n.curie):[]}))}processResultsForScaffold(t){let r={};return t.forEach(n=>{n.anatomy&&n.anatomy.organ&&n.anatomy.organ.forEach(i=>{i.name&&(r[i.name]?r[i.name]++:r[i.name]=1)})}),r}};const jte=[{label:"Data Type",id:"item.types",facetPropPath:"item.types.name",facetSubpropPath:"item.types.subcategory.name"},{label:"Anatomical Structure",id:"anatomy.organ.category",facetPropPath:"anatomy.organ.category.name",facetSubpropPath:"anatomy.organ.subcategory.name",facetFilterPath:"anatomy.organ.name"},{label:"Species",id:"organisms.primary.species",facetPropPath:"organisms.primary.species.name",facetSubpropPath:"organisms.primary.species.subcategory.name"},{label:"Experimental Approach",id:"item.modalities",facetPropPath:"item.modalities.keyword",facetSubpropPath:"item.modalities.subcategory.name"},{label:"Sex",id:"attributes.subject.sex",facetPropPath:"attributes.subject.sex.value",facetSubpropPath:"attributes.subject.sex.subcategory.name"},{label:"Age Categories",id:"attributes.subject.ageCategory",facetPropPath:"attributes.subject.ageCategory.value",facetSubpropPath:"attributes.subject.ageCategory.subcategory.name"}];function Ewe(e=void 0){if(e===void 0)return"NOT item.published.status:embargo";e.forEach(n=>n.label=n.facet);let t=BGt(e),r="NOT item.published.status:embargo";return r=`(${r}) AND `,jte.map(n=>n.facetPropPath).map(n=>{let i=t.filter(l=>l.facetPropPath==n),o="",s="";i.map(l=>{let c=l.facetSubPropPath?l.facetSubPropPath:n;l.AND?s+=`AND "${c}":"${l.label}"`:o+=`"${c}":"${l.label}" OR `}),!(o==""&&s=="")&&(o=`(${o.substring(0,o.lastIndexOf(" OR "))})`,r+=`${o+s} AND `,r=r.split("()AND ").join(""))}),r.substring(0,r.lastIndexOf(" AND "))}function BGt(e){return e.filter(t=>t.label!=="Show all")}const TN=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},Ute=function(e){const t=e.toLowerCase();return yN[t]?TN(yN[t]):TN(t)},FGt={name:"SearchFilters",components:{MapSvgIcon:CGt,MapSvgSpriteColor:HGt,Option:LR,Select:Sk,Popover:Cee,Cascader:Pbe},props:{entry:Object,envVars:{type:Object,default:()=>{}}},data:function(){return{cascaderIsReady:!1,previousShowAllChecked:{species:!1,gender:!1,organ:!1,datasets:!1},showFilters:!0,showFiltersText:!0,cascadeSelected:[],cascadeSelectedWithBoolean:[],numberShown:10,filters:[],facets:["Species","Gender","Organ","Datasets"],numberDatasetsShown:["10","20","50"],props:{multiple:!0},options:[{value:"Species",label:"Species",children:[{}]}],presentTags:[]}},setup(){const e=a.markRaw({}),t=a.markRaw({term:new Set,facet:new Set,facet2:new Set});return{cascaderTags:e,correctnessCheck:t}},computed:{numberOfResultsText:function(){return`${this.entry.numberOfHits} results | Showing`}},methods:{createCascaderItemValue:function(e,t=void 0,r=void 0){let n=e;return t&&(n=`${e}>${t}`),t&&r&&(n=`${e}>${t}>${r}`),!t&&r&&console.warn(`Warning: ${r} provided without its parent, this will not be shown in the cascader`),n},populateCascader:function(){return new Promise(e=>{this.algoliaClient.getAlgoliaFacets(jte).then(t=>{this.facets=t,Lc.emit("available-facets",t),this.options=t,this.options.forEach((r,n)=>{this.options[n].total=this.countTotalFacet(r),this.options[n].label=Ute(r.label),this.options[n].value=this.createCascaderItemValue(r.key,void 0),this.options[n].children.unshift({value:this.createCascaderItemValue("Show all"),label:"Show all"}),this.options[n].children.forEach((i,o)=>{this.options[n].children[o].label=Ute(i.label),this.options[n].children[o].value=this.createCascaderItemValue(r.label,i.label),this.options[n].children[o].children&&this.options[n].children[o].children.length>0&&this.options[n].children[o].children.forEach((s,l)=>{this.options[n].children[o].children[l].label=Ute(s.label),this.options[n].children[o].children[l].value=this.createCascaderItemValue(r.label,i.label,s.label)})})})}).finally(()=>{e()})})},cascadeTagClose:function(e){let t=[];Object.entries(this.cascaderTags).map(r=>{const n=r[0],i=r[1],o=this.options.filter(l=>l.label==n)[0],s=o.key;for(let l=0;l<o.children.length;l++){const c=o.children[l],u=c.label,d=c.value;if(Array.isArray(i))if(i.length===0&&u.toLowerCase()==="show all"){t.push([s,d]);break}else u!==e&&i.includes(u)&&t.push([s,d]);else Object.entries(i).map(h=>{const p=h[0],f=h[1];p===u&&c.children.map(m=>{const g=m.label,T=m.value;g!==e&&f.includes(g)&&t.push([s,T])})})}}),this.cascadeEvent(t)},tagsChangedCallback:function(e){this.correctnessCheck.term&&this.correctnessCheck.facet&&this.correctnessCheck.facet2&&this.options.map(t=>{this.correctnessCheck.term.add(t.label),t.children.map(r=>{this.correctnessCheck.facet.add(r.label),t.label==="Anatomical structure"&&r.label!=="Show all"&&r.children.map(n=>{this.correctnessCheck.facet2.add(n.label)})})}),this.cascaderTags={},this.presentTags=[],e.map(t=>{const{facet:r,facet2:n,term:i}=t;this.correctnessCheck.term.has(i)&&this.correctnessCheck.facet.has(r)&&(n?this.correctnessCheck.facet2.has(n)&&(i in this.cascaderTags?r in this.cascaderTags[i]?this.cascaderTags[i][r].push(n):this.cascaderTags[i][r]=[n]:(this.cascaderTags[i]={},this.cascaderTags[i][r]=[n])):i in this.cascaderTags&&i!=="Anatomical structure"?this.cascaderTags[i].push(r):r.toLowerCase()!=="show all"?this.cascaderTags[i]=[r]:this.cascaderTags[i]=[])}),Object.values(this.cascaderTags).map(t=>{const r=Array.isArray(t)?t:Object.values(t).flat(1);this.presentTags=[...this.presentTags,...r]}),this.presentTags=[...new Set(this.presentTags)],this.presentTags.length>0?this.showFiltersText=!1:this.showFiltersText=!0},countTotalFacet:function(e){return["anatomy.organ.category.name"].includes(e.key)?e.children.reduce((t,r)=>(t=typeof t=="number"?t:t.children.length,t+r.children.length)):e.children.length},showAllEventModifierForAutoCheckAll:function(e){const t={};return e.map(r=>{const n=r[0];n in t?t[n]+=1:t[n]=1}),this.options.map(r=>{const n=r.key,i=r.children.filter(s=>s.label==="Show all")[0].value,o=r.total;t[n]===o&&(e=e.filter(s=>s[0]!==r.key),delete t[n]),n in t||e.unshift([n,i])}),e},cascadeEvent:function(e){let t=[...e];if(t){if(t=this.showAllEventModifier(t),t=this.showAllEventModifierForAutoCheckAll(t),this.__expandItem__){let i=0;this.__expandItem__.length>1&&(i=1);const o=t.filter(l=>l[i]==this.__expandItem__[i]),s=t.filter(l=>l[i]!==this.__expandItem__[i]);t=[...o,...s]}let r=t.filter(i=>i!==void 0).map(i=>{let{hString:o,bString:s}=this.findHierarachyStringAndBooleanString(i),{facet:l,facet2:c,term:u}=this.getFacetsFromHierarchyString(o);return{facetPropPath:i[0],facet:l,facet2:c,term:u,AND:s}}),n=t.filter(i=>i!==void 0).map(i=>{let o,s=i[0].includes("duplicate")?i[0].split("duplicate")[0]:i[0],{hString:l,bString:c}=this.findHierarachyStringAndBooleanString(i),{facet:u,facet2:d,term:h}=this.getFacetsFromHierarchyString(l);return d&&(u=d,o="anatomy.organ.name"),{facetPropPath:s,facet:u,term:h,AND:c,facetSubPropPath:o}});this.$emit("loading",!0),this.$emit("filterResults",n),this.setCascader(r),this.cssMods()}},findHierarachyStringAndBooleanString(e){let t,r;return e.length>=3?e[2]&&(typeof e[2]=="string"||e[2]instanceof String)&&e[2].split(">").length>2?(t=e[2],r=e.length==4?e[3]:void 0):(t=e[1],r=e[2]):(t=e[1],r=void 0),{hString:t,bString:r}},getFacetsFromHierarchyString(e){let t,r,n,i=e.split(">");return i.length==3?(n=i[2],t=i[1],r=i[0]):(t=i[1],r=i[0]),{facet:t,facet2:n,term:r}},showAllEventModifier:function(e){if(e.map(t=>t?t[1].toLowerCase().includes("show all"):!1).includes(!0)){let t=[],r={};for(const n in e)r[e[n][0]]===void 0&&(r[e[n][0]]=[]),r[e[n][0]].push(e[n]);for(const n in r){let i;for(let o=r[n].length-1;o>=0;o--)if(r[n][o][1].toLowerCase().includes("show all")){i=r[n].splice(o,1)[0];break}i?this.previousShowAllChecked[n]&&r[n].length>0?t.push(...r[n]):t.push(i):t.push(...r[n])}return t.sort((n,i)=>this.__expandItem__?n[0]==this.__expandItem__?i[0]==this.__expandItem__?0:-1:i[0]==this.__expandItem__?n[0]==this.__expandItem__?0:1:0:0)}return e},cascadeExpandChange:function(e){this.__expandItem__=e,this.cssMods()},numberShownChanged:function(e){this.$emit("numberPerPage",parseInt(e))},updatePreviousShowAllChecked:function(e){for(const t in this.previousShowAllChecked)this.previousShowAllChecked[t]=!1;e.forEach(t=>{t[1].toLowerCase().includes("show all")&&(this.previousShowAllChecked[t[0]]=!0)})},setCascader:function(e){if(this.cascaderIsReady&&e&&e.length!=0){const t=r=>{let n=[r.facetPropPath,this.createCascaderItemValue(TN(r.term),r.facet)];return r.facet2&&n.push(this.createCascaderItemValue(TN(r.term),r.facet,r.facet2)),n};this.cascadeSelected=e.map(r=>t(r)),this.cascadeSelectedWithBoolean=e.map(r=>{let n=t(r);return n.push(r.AND),n}),this.updatePreviousShowAllChecked(this.cascadeSelected)}this.tagsChangedCallback(e)},addFilter:function(e){if(this.cascaderIsReady&&e){let t=this.validateAndConvertFilterToHierarchical(e);if(t)return this.cascadeSelected.filter(r=>r.term!=t.term),this.cascadeSelected.push([t.facetPropPath,this.createCascaderItemValue(t.term,t.facet),this.createCascaderItemValue(t.term,t.facet,t.facet2)]),this.cascadeSelectedWithBoolean.push([t.facetPropPath,this.createCascaderItemValue(t.term,t.facet),this.createCascaderItemValue(t.term,t.facet,t.facet2),t.AND]),!0}},initiateSearch:function(){this.cascadeEvent(this.cascadeSelectedWithBoolean)},checkShowAllBoxes:function(){this.setCascader(this.options.map(e=>({facetPropPath:e.value,term:e.label,facet:"Show all"})))},makeCascadeLabelsClickable:function(){this.$nextTick(()=>{document.querySelectorAll(".sidebar-cascader-popper .el-cascader-node__label").forEach(e=>{e.onclick=function(){const t=this.previousElementSibling;t&&(t.parentElement.attributes["aria-owns"]||this.previousElementSibling.click())}})})},cssMods:function(){this.makeCascadeLabelsClickable(),this.removeTopLevelCascaderCheckboxes()},removeTopLevelCascaderCheckboxes:function(){this.$nextTick(()=>{document.querySelectorAll(".sidebar-cascader-popper .el-cascader-menu__list")[0].querySelectorAll(".el-checkbox__input").forEach(e=>e.style.display="none")})},validateAndConvertFilterToHierarchical:function(e){if(e&&e.facet&&e.term){if(e.facet2)return e;for(const t of this.options)if(t.value===e.facetPropPath)for(const r of t.children){if(r.label===e.facet)return e;if(r.children&&r.children.length>0){for(const n of r.children)if(n.label===e.facet)return e.facet2=n.label,e.facet=r.label,e}}}return!1},getHierarchicalValidatedFilters:function(e){if(e)if(this.cascaderIsReady){const t=[];return e.forEach(r=>{const n=this.validateAndConvertFilterToHierarchical(r);n&&t.push(n)}),t}else return e;return[]}},mounted:function(){this.algoliaClient=new Mwe(this.envVars.ALGOLIA_ID,this.envVars.ALGOLIA_KEY,this.envVars.PENNSIEVE_API_LOCATION),this.algoliaClient.initIndex(this.envVars.ALGOLIA_INDEX),this.populateCascader().then(()=>{this.cascaderIsReady=!0,this.checkShowAllBoxes(),this.setCascader(this.entry.filterFacets),this.cssMods(),this.$emit("cascaderReady")})}},DGt=e=>(a.pushScopeId("data-v-307e97be"),e=e(),a.popScopeId(),e),zGt={class:"filters"},jGt={key:0,class:"cascader-tag"},UGt={class:"el-tags-container"},GGt={class:"el-tags-container"},WGt={class:"search-filters transition-box"},qGt={key:0,class:"filter-default-value"},ZGt=DGt(()=>a.createElementVNode("div",null,[a.createElementVNode("strong",null,"Within categories:"),a.createTextVNode(" OR "),a.createElementVNode("br"),a.createTextVNode(" example: 'heart' OR 'colon' "),a.createElementVNode("br"),a.createElementVNode("br"),a.createElementVNode("strong",null,"Between categories:"),a.createTextVNode(" AND "),a.createElementVNode("br"),a.createTextVNode(" example: 'rat' AND 'lung' ")],-1)),XGt={class:"dataset-shown"},KGt={class:"dataset-results-feedback"};function YGt(e,t,r,n,i,o){const s=a.resolveComponent("MapSvgSpriteColor"),l=Bb,c=Cee,u=Pbe,d=a.resolveComponent("MapSvgIcon"),h=LR,p=Sk,f=CR;return a.openBlock(),a.createElementBlock("div",zGt,[a.createVNode(s),e.presentTags.length>0?(a.openBlock(),a.createElementBlock("div",jGt,[a.createVNode(l,{class:"ml-2",type:"info",closable:"",onClose:t[0]||(t[0]=m=>o.cascadeTagClose(e.presentTags[0]))},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(e.presentTags[0]),1)]),_:1}),e.presentTags.length>1?(a.openBlock(),a.createBlock(c,{key:0,placement:"bottom-start",width:200,trigger:"hover"},{default:a.withCtx(()=>[a.createElementVNode("div",UGt,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.presentTags.slice(1),(m,g)=>(a.openBlock(),a.createBlock(l,{key:g,class:"ml-2",type:"info",closable:"",onClose:T=>o.cascadeTagClose(m)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(m),1)]),_:2},1032,["onClose"]))),128))])]),reference:a.withCtx(()=>[a.createElementVNode("div",GGt,[e.presentTags.length>1?(a.openBlock(),a.createBlock(l,{key:0,class:"ml-2",type:"info"},{default:a.withCtx(()=>[a.createTextVNode(" +"+a.toDisplayString(e.presentTags.length-1),1)]),_:1})):a.createCommentVNode("",!0)])]),_:1})):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),a.createVNode(a.Transition,{name:"el-zoom-in-top"},{default:a.withCtx(()=>[a.withDirectives((a.openBlock(),a.createElementBlock("span",WGt,[a.createVNode(u,{class:"cascader",ref:"cascader",modelValue:e.cascadeSelected,"onUpdate:modelValue":t[1]||(t[1]=m=>e.cascadeSelected=m),size:"large",placeholder:" ","collapse-tags":!0,"collapse-tags-tooltip":"",options:e.options,props:e.props,onChange:t[2]||(t[2]=m=>o.cascadeEvent(m)),onExpandChange:o.cascadeExpandChange,"show-all-levels":!0,"popper-class":"sidebar-cascader-popper"},null,8,["modelValue","options","props","onExpandChange"]),e.showFiltersText?(a.openBlock(),a.createElementBlock("div",qGt,"Filters")):a.createCommentVNode("",!0),a.createVNode(c,{title:"How do filters work?",width:"250",trigger:"hover","append-to-body":!1,"popper-class":"popover"},{reference:a.withCtx(()=>[a.createVNode(d,{icon:"help",class:"help"})]),default:a.withCtx(()=>[ZGt]),_:1})])),[[a.vShow,e.showFilters],[f,!e.cascaderIsReady]])]),_:1}),a.createElementVNode("div",XGt,[a.createElementVNode("span",KGt,a.toDisplayString(o.numberOfResultsText),1),a.createVNode(p,{class:"number-shown-select",modelValue:e.numberShown,"onUpdate:modelValue":t[3]||(t[3]=m=>e.numberShown=m),placeholder:"10",onChange:t[4]||(t[4]=m=>o.numberShownChanged(m))},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.numberDatasetsShown,m=>(a.openBlock(),a.createBlock(h,{key:m,label:m,value:m},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])])}const Awe=W3(FGt,[["render",YGt],["__scopeId","data-v-307e97be"]]);var JGt=async function(e){if(!e.ok){let t=await e.json();throw t?new Error(t.message):new Error(e)}return e},$Gt={searchInput:"",lastSearch:"",results:[],numberOfHits:0,filter:[],loadingCards:!1,numberPerPage:10,page:1,pageModel:1,start:0,hasSearched:!1,contextCardEnabled:!1};const eWt={components:{SearchFilters:Awe,DatasetCard:z_e,SearchHistory:U_e,Button:np,Card:vbe,Drawer:wee,Icon:ms,Input:wk,Pagination:Ube},name:"SideBarContent",props:{visible:{type:Boolean,default:!1},isDrawer:{type:Boolean,default:!0},entry:{type:Object,default:()=>$Gt},envVars:{type:Object,default:()=>{}}},data:function(){return{...this.entry,bodyStyle:{flex:"1 1 auto","flex-flow":"column",display:"flex"},cascaderIsReady:!1}},computed:{filterEntry:function(){return{numberOfHits:this.numberOfHits,filterFacets:this.filter}}},methods:{hoverChanged:function(e){this.$emit("hover-changed",e)},resetSearch:function(){this.numberOfHits=0,this.discoverIds=[],this._dois=[],this.results=[],this.loadingCards=!1},openSearch:function(e,t=""){this.searchInput=t,this.resetPageNavigation(),this.cascaderIsReady?(this.filter=this.$refs.filtersRef.getHierarchicalValidatedFilters(e),e&&e.length>0&&this.filter&&this.filter.length===0?(this.$refs.filtersRef.checkShowAllBoxes(),this.resetSearch()):this.filter&&(this.searchAlgolia(this.filter,t),this.$refs.filtersRef.setCascader(this.filter))):(this.filter=e,(!e||e.length==0)&&this.searchAlgolia(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.resetPageNavigation(),this.searchAlgolia(this.filters,this.searchInput),this.$refs.searchHistory.selectValue="Full search history"},searchEvent:function(e=!1){(e.keyCode===13||e instanceof MouseEvent)&&(this.resetPageNavigation(),this.searchAlgolia(this.filters,this.searchInput),this.$refs.searchHistory.selectValue="Full search history",this.$refs.searchHistory.addSearchToHistory(this.filters,this.searchInput))},filterUpdate:function(e){this.filters=[...e],this.resetPageNavigation(),this.searchAlgolia(e,this.searchInput),this.$emit("search-changed",{value:e,type:"filter-update"})},searchAlgolia(e,t=""){this.loadingCards=!0,this.algoliaClient.anatomyInSearch(Ewe(e),t).then(r=>{Lc.emit("anatomy-in-datasets",r.forFlatmap),Lc.emit("number-of-datasets-for-anatomies",r.forScaffold)}),this.algoliaClient.search(Ewe(e),t,this.numberPerPage,this.page).then(r=>{this.numberOfHits=r.total,this.discoverIds=r.discoverIds,this._dois=r.dois,this.results=r.items,this.loadingCards=!1,this.scrollToTop(),this.$emit("search-changed",{value:this.searchInput,type:"query-update"}),this._abortController&&this._abortController.abort(),this._abortController=new AbortController;const n=this._abortController.signal;this.perItemSearch(n,{count:0})})},filtersLoading:function(e){this.loadingCards=e},numberPerPageUpdate:function(e){this.numberPerPage=e,this.pageChange(1)},pageChange:function(e){this.start=(e-1)*this.numberPerPage,this.page=e,this.searchAlgolia(this.filters,this.searchInput,this.numberPerPage,this.page)},handleMissingData:function(e){let t=this.results.findIndex(r=>r.doi===e);this.results[t]&&(this.results[t].detailsReady=!0)},perItemSearch:function(e,t){if(10>t.count){const r=this._dois.shift();r&&(t.count++,this.callSciCrunch(this.envVars.API_LOCATION,{dois:[r]},e).then(n=>{n.numberOfHits===0?this.handleMissingData(r):this.resultsProcessing(n),this.$refs.content.style["overflow-y"]="scroll",t.count--,this.perItemSearch(e,t)}).catch(n=>{n.name!=="AbortError"&&(this.handleMissingData(r),t.count--,this.perItemSearch(e,t))}),this.perItemSearch(e,t))}},scrollToTop:function(){this.$refs.content&&this.$refs.content.scroll({top:0,behavior:"smooth"})},resetPageNavigation:function(){this.start=0,this.page=1},resultsProcessing:function(e){this.lastSearch=this.searchInput,e.results.length!==0&&e.results.forEach(t=>{let r=this.results.findIndex(n=>t.doi?t.doi.includes(n.doi):!1);Object.assign(this.results[r],t),Object.assign(this.results[r],{numberSamples:t.sampleSize?parseInt(t.sampleSize):0,numberSubjects:t.subjectSize?parseInt(t.subjectSize):0,updated:(t.updated&&t.updated.length)>0?t.updated[0].timestamp.split("T")[0]:"",url:t.uri[0],datasetId:t.dataset_identifier,datasetRevision:t.dataset_revision,datasetVersion:t.dataset_version,organs:t.organs&&t.organs.length>0?[...new Set(t.organs.map(n=>n.name))]:void 0,species:t.organisms&&t.organisms[0].species?[...new Set(t.organisms.map(n=>n.species?n.species.name:null))]:void 0,scaffolds:t["abi-scaffold-metadata-file"],thumbnails:t["abi-thumbnail"]?t["abi-thumbnail"]:t["abi-scaffold-thumbnail"],scaffoldViews:t["abi-scaffold-view-file"],videos:t.video,plots:t["abi-plot"],images:t["common-images"],contextualInformation:t["abi-contextual-information"].length>0?t["abi-contextual-information"]:void 0,segmentation:t["mbf-segmentation"],simulation:t["abi-simulation-file"],additionalLinks:t.additionalLinks,detailsReady:!0}),this.results[r]=this.results[r]})},createfilterParams:function(e){let t=new URLSearchParams;for(const r in e)Array.isArray(e[r])?e[r].forEach(n=>{t.append(r,n)}):t.append(r,e[r]);return t.toString()},callSciCrunch:function(e,t={},r){return new Promise((n,i)=>{let o=this.envVars.API_LOCATION+this.searchEndpoint+"?"+this.createfilterParams(t);fetch(o,{signal:r}).then(JGt).then(s=>s.json()).then(s=>n(s)).catch(s=>i(s))})},getAlgoliaFacets:async function(){return await this.algoliaClient.getAlgoliaFacets(jte)},searchHistorySearch:function(e){this.searchInput=e.search,this.filters=e.filters,this.openSearch(e.filters,e.search)}},mounted:function(){this.algoliaClient=new Mwe(this.envVars.ALGOLIA_ID,this.envVars.ALGOLIA_KEY,this.envVars.PENNSIEVE_API_LOCATION),this.algoliaClient.initIndex(this.envVars.ALGOLIA_INDEX),this.openSearch(this.filter,this.searchInput)},created:function(){this.searchEndpoint="dataset_info/using_multiple_dois/"}},tWt={class:"header"},rWt={class:"content scrollbar",ref:"content"},nWt={key:0,class:"error-feedback"};function iWt(e,t,r,n,i,o){const s=wk,l=np,c=Awe,u=U_e,d=z_e,h=Ube,p=vbe,f=CR;return a.openBlock(),a.createBlock(p,{"body-style":e.bodyStyle,class:"content-card"},{header:a.withCtx(()=>[a.createElementVNode("div",tWt,[a.createVNode(s,{class:"search-input",placeholder:"Search",modelValue:e.searchInput,"onUpdate:modelValue":t[0]||(t[0]=m=>e.searchInput=m),onKeyup:o.searchEvent,clearable:"",onClear:o.clearSearchClicked},null,8,["modelValue","onKeyup","onClear"]),a.createVNode(l,{type:"primary",class:"button",onClick:o.searchEvent,size:"large"},{default:a.withCtx(()=>[a.createTextVNode(" Search ")]),_:1},8,["onClick"])])]),default:a.withCtx(()=>[a.createVNode(c,{class:"filters",ref:"filtersRef",entry:o.filterEntry,envVars:r.envVars,onFilterResults:o.filterUpdate,onNumberPerPage:o.numberPerPageUpdate,onLoading:o.filtersLoading,onCascaderReady:o.cascaderReady},null,8,["entry","envVars","onFilterResults","onNumberPerPage","onLoading","onCascaderReady"]),a.createVNode(u,{ref:"searchHistory",onSearch:o.searchHistorySearch},null,8,["onSearch"]),a.withDirectives((a.openBlock(),a.createElementBlock("div",rWt,[e.results.length===0&&!e.loadingCards?(a.openBlock(),a.createElementBlock("div",nWt," No results found - Please change your search / filter criteria. ")):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.results,m=>(a.openBlock(),a.createElementBlock("div",{key:m.doi,class:"step-item"},[a.createVNode(d,{class:"dataset-card",entry:m,envVars:r.envVars,onMouseenter:g=>o.hoverChanged(m),onMouseleave:t[1]||(t[1]=g=>o.hoverChanged(void 0))},null,8,["entry","envVars","onMouseenter"])]))),128)),a.createVNode(h,{class:"pagination","current-page":e.page,"onUpdate:currentPage":t[2]||(t[2]=m=>e.page=m),"hide-on-single-page":"",large:"",layout:"prev, pager, next","page-size":e.numberPerPage,total:e.numberOfHits,onCurrentChange:o.pageChange},null,8,["current-page","page-size","total","onCurrentChange"])])),[[f,e.loadingCards]])]),_:1},8,["body-style"])}const Owe=W3(eWt,[["render",iWt],["__scopeId","data-v-aeb7c099"]]),oWt={name:"ExternalResourceCard",components:{Button:np},props:{resources:{type:Array,default:()=>[]}},data:function(){return{pubmeds:[],pubmedIds:[],ElIconNotebook:a.shallowRef(uMt)}},methods:{capitalise:function(e){return e.charAt(0).toUpperCase()+e.slice(1)},openUrl:function(e){Lc.emit("open-pubmed-url",e),window.open(e,"_blank")}}},aWt={class:"resource-container"};function sWt(e,t,r,n,i,o){const s=np;return a.openBlock(),a.createElementBlock("div",aWt,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.resources,l=>(a.openBlock(),a.createElementBlock("div",{key:l.id,class:"resource"},[l.id==="pubmed"?(a.openBlock(),a.createBlock(s,{key:0,class:"button",id:"open-pubmed-button",icon:e.ElIconNotebook,onClick:c=>o.openUrl(l.url)},{default:a.withCtx(()=>[a.createTextVNode(" Open publications in PubMed ")]),_:2},1032,["icon","onClick"])):a.createCommentVNode("",!0)]))),128))])}const Iwe=W3(oWt,[["render",sWt],["__scopeId","data-v-e726c314"]]),lWt=e=>e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()),cWt=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""},uWt={name:"ConnectivityInfo",components:{Button:np,Container:MPt,Icon:ms,ElIconArrowUp:qCt,ElIconArrowDown:N$,ElIconWarning:YTe,ExternalResourceCard:Iwe},props:{entry:{type:Object,default:()=>({destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0})},availableAnatomyFacets:{type:Array,default:()=>[]}},data:function(){return{controller:void 0,activeSpecies:void 0,pubmedSearchUrl:"",loading:!1,facetList:[],showToolip:!1,showDetails:!1,originDescriptions:{motor:"is the location of the initial cell body of the circuit",sensory:"is the location of the initial cell body in the PNS circuit"},componentsWithDatasets:[],uberons:[{id:void 0,name:void 0}]}},watch:{availableAnatomyFacets:{handler:function(e){this.convertFacetsToList(e)},immediate:!0,deep:!0}},computed:{resources:function(){let e=[];return this.entry&&this.entry.hyperlinks&&(e=this.entry.hyperlinks),e},featuresAlert(){},originDescription:function(){return this.entry&&this.entry.title&&this.entry.title.toLowerCase().includes("motor")?this.originDescriptions.motor:this.originDescriptions.sensory},provSpeciesDescription:function(){let e="Studied in";return this.entry.provenanceTaxonomyLabel.forEach(t=>{e+=` ${t},`}),e=e.slice(0,-1),e+=" species",e}},methods:{titleCase:function(e){return lWt(e)},capitalise:function(e){return cWt(e)},openUrl:function(e){window.open(e,"_blank")},openAll:function(){Lc.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.componentsWithDatasets.map(e=>e.name.toLowerCase())})},openAxons:function(){Lc.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.destinationsWithDatasets.map(e=>e.name.toLowerCase())})},shouldShowExploreButton:function(e){for(let t=0;t<e.length;t++)if(this.facetList.includes(e[t].name.toLowerCase()))return!0;return!1},convertFacetsToList:function(e){e.forEach(t=>{t.children?this.convertFacetsToList(t.children):this.facetList.push(t.label.toLowerCase())})},openDendrites:function(){Lc.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.originsWithDatasets.map(e=>e.name.toLowerCase())})},pubmedSearchUrlUpdate:function(e){this.pubmedSearchUrl=e},showConnectivity:function(e){const t=e.featureId||[];this.$emit("show-connectivity",t)}}},H9=e=>(a.pushScopeId("data-v-f1c50620"),e=e(),a.popScopeId(),e),dWt={key:0,class:"main"},hWt={class:"connectivity-info-title"},pWt={key:0,class:"block"},fWt={class:"title"},mWt={key:0,class:"subtitle"},gWt={key:1,class:"block"},yWt={class:"title"},TWt=H9(()=>a.createElementVNode("span",null," Show connectivity on map ",-1)),vWt={key:0,class:"attribute-title-container"},bWt=H9(()=>a.createElementVNode("span",{class:"attribute-title"},"Alert",-1)),QWt={style:{"word-break":"keep-all"}},xWt={class:"content-container scrollbar"},_Wt={key:0,class:"block"},wWt={class:"attribute-title-container"},LWt=H9(()=>a.createElementVNode("span",{class:"attribute-title"},"Origin",-1)),SWt={style:{"word-break":"keep-all"}},kWt=H9(()=>a.createElementVNode("i",null,"Origin",-1)),CWt=["origin-item-label"],MWt={key:0,class:"seperator"},EWt={key:1,class:"block"},AWt=H9(()=>a.createElementVNode("div",{class:"attribute-title-container"},[a.createElementVNode("div",{class:"attribute-title"},"Components")],-1)),OWt=["component-item-label"],IWt={key:0,class:"seperator"},PWt={key:2,class:"block"},VWt={class:"attribute-title-container"},HWt=H9(()=>a.createElementVNode("span",{class:"attribute-title"},"Destination",-1)),RWt=H9(()=>a.createElementVNode("span",{style:{"word-break":"keep-all"}},[a.createElementVNode("i",null,"Destination"),a.createTextVNode(" is where the axons terminate ")],-1)),NWt=["destination-item-label"],BWt={key:0,class:"seperator"};function FWt(e,t,r,n,i,o){const s=Iwe,l=sMt,c=ms,u=np,d=Cee,h=YTe,p=CR;return r.entry?a.withDirectives((a.openBlock(),a.createElementBlock("div",dWt,[a.createElementVNode("div",hWt,[a.createElementVNode("div",null,[r.entry.title?(a.openBlock(),a.createElementBlock("div",pWt,[a.createElementVNode("div",fWt,a.toDisplayString(o.capitalise(r.entry.title)),1),r.entry.provenanceTaxonomyLabel&&r.entry.provenanceTaxonomyLabel.length>0?(a.openBlock(),a.createElementBlock("div",mWt,a.toDisplayString(o.provSpeciesDescription),1)):a.createCommentVNode("",!0)])):(a.openBlock(),a.createElementBlock("div",gWt,[a.createElementVNode("div",yWt,a.toDisplayString(r.entry.featureId),1)])),a.createVNode(s,{resources:o.resources},null,8,["resources"])]),a.createElementVNode("div",null,[a.createVNode(d,{width:"200",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:a.withCtx(()=>[a.createVNode(u,{class:"button-circle",circle:"",onClick:t[0]||(t[0]=f=>o.showConnectivity(r.entry))},{default:a.withCtx(()=>[a.createVNode(c,{color:"white"},{default:a.withCtx(()=>[a.createVNode(l)]),_:1})]),_:1})]),default:a.withCtx(()=>[TWt]),_:1})])]),o.featuresAlert?(a.openBlock(),a.createElementBlock("div",vWt,[bWt,a.createVNode(d,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:a.withCtx(()=>[a.createVNode(c,{class:"info"},{default:a.withCtx(()=>[a.createVNode(h)]),_:1})]),default:a.withCtx(()=>[a.createElementVNode("span",QWt,a.toDisplayString(o.featuresAlert),1)]),_:1})])):a.createCommentVNode("",!0),a.createElementVNode("div",xWt,[a.createTextVNode(a.toDisplayString(r.entry.paths)+" ",1),r.entry.origins&&r.entry.origins.length>0?(a.openBlock(),a.createElementBlock("div",_Wt,[a.createElementVNode("div",wWt,[LWt,a.createVNode(d,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:a.withCtx(()=>[a.createVNode(c,{class:"info"},{default:a.withCtx(()=>[a.createVNode(h)]),_:1})]),default:a.withCtx(()=>[a.createElementVNode("span",SWt,[kWt,a.createTextVNode(" "+a.toDisplayString(o.originDescription),1)])]),_:1})]),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.entry.origins,(f,m)=>(a.openBlock(),a.createElementBlock("div",{class:"attribute-content","origin-item-label":f,key:f},[a.createTextVNode(a.toDisplayString(o.capitalise(f))+" ",1),m!=r.entry.origins.length-1?(a.openBlock(),a.createElementBlock("div",MWt)):a.createCommentVNode("",!0)],8,CWt))),128)),a.withDirectives(a.createVNode(u,{class:"button",id:"open-dendrites-button",onClick:o.openDendrites},{default:a.withCtx(()=>[a.createTextVNode(" Explore origin data ")]),_:1},8,["onClick"]),[[a.vShow,r.entry.originsWithDatasets&&r.entry.originsWithDatasets.length>0&&o.shouldShowExploreButton(r.entry.originsWithDatasets)]])])):a.createCommentVNode("",!0),r.entry.components&&r.entry.components.length>0?(a.openBlock(),a.createElementBlock("div",EWt,[AWt,(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.entry.components,(f,m)=>(a.openBlock(),a.createElementBlock("div",{class:"attribute-content","component-item-label":f,key:f},[a.createTextVNode(a.toDisplayString(o.capitalise(f))+" ",1),m!=r.entry.components.length-1?(a.openBlock(),a.createElementBlock("div",IWt)):a.createCommentVNode("",!0)],8,OWt))),128))])):a.createCommentVNode("",!0),r.entry.destinations&&r.entry.destinations.length>0?(a.openBlock(),a.createElementBlock("div",PWt,[a.createElementVNode("div",VWt,[HWt,a.createVNode(d,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:a.withCtx(()=>[a.createVNode(c,{class:"info"},{default:a.withCtx(()=>[a.createVNode(h)]),_:1})]),default:a.withCtx(()=>[RWt]),_:1})]),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.entry.destinations,(f,m)=>(a.openBlock(),a.createElementBlock("div",{class:"attribute-content","destination-item-label":f,key:f},[a.createTextVNode(a.toDisplayString(o.capitalise(f))+" ",1),m!=r.entry.destinations.length-1?(a.openBlock(),a.createElementBlock("div",BWt)):a.createCommentVNode("",!0)],8,NWt))),128)),a.withDirectives(a.createVNode(u,{class:"button",onClick:o.openAxons},{default:a.withCtx(()=>[a.createTextVNode(" Explore destination data ")]),_:1},8,["onClick"]),[[a.vShow,r.entry.destinationsWithDatasets&&r.entry.destinationsWithDatasets.length>0&&o.shouldShowExploreButton(r.entry.destinationsWithDatasets)]])])):a.createCommentVNode("",!0),a.withDirectives(a.createVNode(u,{class:"button",onClick:o.openAll},{default:a.withCtx(()=>[a.createTextVNode(" Search for data on components ")]),_:1},8,["onClick"]),[[a.vShow,r.entry.componentsWithDatasets&&r.entry.componentsWithDatasets.length>0&&o.shouldShowExploreButton(r.entry.componentsWithDatasets)]])])])),[[p,e.loading]]):a.createCommentVNode("",!0)}const Pwe=W3(uWt,[["render",FWt],["__scopeId","data-v-f1c50620"]]),DWt={name:"Tabs",props:{tabTitles:{type:Array,default:()=>[]},activeId:{type:Number,default:1}},methods:{titleClicked:function(e,t){this.$emit("titleClicked",{id:e,type:t})},tabClose:function(e){this.$emit("tab-close",e)}}},zWt=e=>(a.pushScopeId("data-v-a569bcfd"),e=e(),a.popScopeId(),e),jWt={class:"tab-container"},UWt=["onClick"],GWt={class:"title-text"},WWt=zWt(()=>a.createElementVNode("span",{class:"visually-hidden"},"Close",-1));function qWt(e,t,r,n,i,o){const s=np;return a.openBlock(),a.createElementBlock("div",jWt,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.tabTitles,l=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["title",{"active-tab":l.id==r.activeId}]),key:l.id},[a.createElementVNode("div",{class:a.normalizeClass(["title-text-table",{highlightText:l.id==r.activeId}]),onClick:c=>o.titleClicked(l.id,l.type)},[a.createElementVNode("div",GWt,a.toDisplayString(l.title),1)],10,UWt),l.id===2?(a.openBlock(),a.createBlock(s,{key:0,onClick:c=>o.tabClose(l.id),class:"button-tab-close","aria-label":"Close"},{default:a.withCtx(()=>[a.createTextVNode(" × "),WWt]),_:2},1032,["onClick"])):a.createCommentVNode("",!0)],2))),128))])}const Vwe=W3(DWt,[["render",qWt],["__scopeId","data-v-a569bcfd"]]),ZWt={components:{SidebarContent:Owe,Tabs:Vwe,ElIconArrowLeft:B$,ElIconArrowRight:eR,Drawer:wee,Icon:ms,ConnectivityInfo:Pwe},name:"SideBar",props:{visible:{type:Boolean,default:!1},envVars:{type:Object,default:()=>{}},tabs:{type:Array,default:()=>[{id:1,title:"Search",type:"search"},{id:2,title:"Connectivity",type:"connectivity"}]},activeTabId:{type:Number,default:1},openAtStart:{type:Boolean,default:!1},connectivityInfo:{type:Object,default:null}},data:function(){return{drawerOpen:!1,availableAnatomyFacets:[]}},methods:{hoverChanged:function(e){this.$emit("hover-changed",e)},showConnectivity:function(e){this.$emit("show-connectivity",e)},searchChanged:function(e,t){this.$emit("search-changed",{...t,id:e})},close:function(){this.drawerOpen=!1},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},openSearch:function(e,t){this.drawerOpen=!0,this.$nextTick(()=>{this.getSearchTabRefById(1).openSearch(e,t)})},getTabByIdAndType:function(e,t){const r=e||this.activeTabId,n=t||"search",i=this.tabs.find(s=>s.id===r&&s.type===n),o=this.tabs[0];return i||o},getTabRefId:function(e,t){let r="searchTab_";t==="connectivity"&&(r="connectivityTab_");const n=this.getTabByIdAndType(e,t);return r+n.id},getSearchTabRefById:function(e){const t=e||1,r=this.getTabRefId(t,"search");return this.$refs[r][0]},addFilter:function(e){this.drawerOpen=!0,e.AND=!0,this.$nextTick(()=>{this.getSearchTabRefById(1).addFilter(e)})},openNeuronSearch:function(e){this.drawerOpen=!0,this.$nextTick(()=>{this.getSearchTabRefById(1).openSearch("",void 0,"scicrunch-query-string/",{field:"*organ.curie",curie:e})})},getAlgoliaFacets:async function(){return await this.getSearchTabRefById(1).getAlgoliaFacets()},setDrawerOpen:function(e=!0){this.drawerOpen=e},tabClicked:function({id:e,type:t}){this.$emit("tabClicked",{id:e,type:t})},tabClose:function(e){this.$emit("connectivity-info-close")}},created:function(){this.drawerOpen=this.openAtStart},mounted:function(){Lc.on("PopoverActionClick",e=>{this.$emit("actionClick",e)}),Lc.on("number-of-datasets-for-anatomies",e=>{this.$emit("number-of-datasets-for-anatomies",e)}),Lc.on("anatomy-in-datasets",e=>{this.$emit("anatomy-in-datasets",e)}),Lc.on("contextUpdate",e=>{this.$emit("contextUpdate",e)}),Lc.on("datalink-clicked",e=>{this.$emit("datalink-clicked",e)}),Lc.on("onConnectivityActionClick",e=>{this.tabClicked({id:1,type:"search"}),this.$emit("actionClick",e)}),Lc.on("available-facets",e=>{this.availableAnatomyFacets=e.find(t=>t.label==="Anatomical Structure").children})}},XWt={ref:"container"},KWt={class:"box-card"},YWt={class:"sidebar-container"};function JWt(e,t,r,n,i,o){const s=B$,l=ms,c=eR,u=Vwe,d=Pwe,h=Owe,p=wee;return a.openBlock(),a.createElementBlock("div",XWt,[e.drawerOpen?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",{key:0,onClick:t[0]||(t[0]=(...f)=>o.toggleDrawer&&o.toggleDrawer(...f)),class:"open-tab"},[a.createVNode(l,null,{default:a.withCtx(()=>[a.createVNode(s)]),_:1})])),a.createVNode(p,{class:"side-bar my-drawer",modelValue:e.drawerOpen,"onUpdate:modelValue":t[3]||(t[3]=f=>e.drawerOpen=f),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:a.withCtx(()=>[a.createElementVNode("div",KWt,[e.drawerOpen?(a.openBlock(),a.createElementBlock("div",{key:0,onClick:t[1]||(t[1]=(...f)=>o.close&&o.close(...f)),class:"close-tab"},[a.createVNode(l,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1})])):a.createCommentVNode("",!0),a.createElementVNode("div",YWt,[r.tabs.length>1&&r.connectivityInfo?(a.openBlock(),a.createBlock(u,{key:0,tabTitles:r.tabs,activeId:r.activeTabId,onTitleClicked:o.tabClicked,onTabClose:o.tabClose},null,8,["tabTitles","activeId","onTitleClicked","onTabClose"])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.tabs,f=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:"tab.id"},[f.type==="connectivity"?a.withDirectives((a.openBlock(),a.createBlock(d,{key:0,entry:r.connectivityInfo,availableAnatomyFacets:e.availableAnatomyFacets,ref_for:!0,ref:"connectivityTab_"+f.id,onShowConnectivity:o.showConnectivity},null,8,["entry","availableAnatomyFacets","onShowConnectivity"])),[[a.vShow,f.id===r.activeTabId]]):a.withDirectives((a.openBlock(),a.createBlock(h,{key:1,class:"sidebar-content-container",contextCardEntry:f.contextCard,envVars:r.envVars,ref_for:!0,ref:"searchTab_"+f.id,onSearchChanged:m=>o.searchChanged(f.id,m),onHoverChanged:t[2]||(t[2]=m=>o.hoverChanged(m))},null,8,["contextCardEntry","envVars","onSearchChanged"])),[[a.vShow,f.id===r.activeTabId]])],64))),128))])])]),_:1},8,["modelValue"])],512)}const $Wt={name:"SplitFlow",components:{Container:Ige,Header:Pge,Main:Vge,DialogToolbarContent:bye,SplitDialog:Tye,SideBar:W3(ZWt,[["render",JWt],["__scopeId","data-v-4d616bd4"]])},props:{state:{type:Object,default:void 0}},data:function(){return{sideBarVisibility:!0,startUp:!0,search:"",activeDockedId:1,filterTriggered:!1,availableFacets:[],connectivityInfo:null}},watch:{state:{handler:function(e){e&&(this._externalStateSet||this.setState(e),this._externalStateSet=!0)},immediate:!0}},methods:{actionClick:function(e){if(e)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";V1.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){this.closeConnectivityInfo(),this.$refs.sideBar.addFilter(e);const{facet:t}=e;V1.sendEvent({event:"interaction_event",event_name:"portal_maps_action_filter",category:t||"filter",location:"map_location_pin"}),this.filterTriggered=!0}}else if(e.type=="Facets"){const t=[];if(this.settingsStore.facets.species.forEach(r=>{t.push({facet:sye(r),term:"Species",facetPropPath:"organisms.primary.species.name"})}),t.length==0&&t.push({facet:"Show All",term:"Species",facetPropPath:"organisms.primary.species.name"}),t.push(...e.labels.map(r=>({facet:sye(r),term:"Anatomical structure",facetPropPath:"anatomy.organ.category.name"}))),this.$refs.sideBar){this.closeConnectivityInfo(),this.$refs.sideBar.openSearch(t,"");const n=ext(this.availableFacets,e.labels).join(", ");V1.sendEvent({event:"interaction_event",event_name:"portal_maps_action_filter",category:n||"filter",location:"map_popup_button"})}}else this.trackGalleryClick(e),this.createNewEntry(e)},trackGalleryClick:function(e){const t=[],{label:r,type:n,datasetId:i,discoverId:o,resource:s}=e;let l="",c=i||o;r&&t.push(r),n&&t.push(n),i&&t.push("("+c+")"),s&&(n==="Plot"?l=s.dataSource.url:l=typeof s=="string"?s:s.share_link),V1.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){let t=!1,r=this.$refs.splitdialog;r&&r.getActiveContents().forEach(i=>{i.search(e.term)&&(t=!0)}),this.$refs.dialogToolbar.setFailedSearch(t?void 0:e.term),V1.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(o=>o.searchSuggestions(e.data.term,t));const i=new Set(t);t.length=0;for(const o of i)t.push({value:'"'+o+'"'});e.data.cb(t)},onShowConnectivity:function(e){const t=this.splitFlowStore.getState(),r=(t==null?void 0:t.activeView)||"";Li.emit("show-connectivity",{featureIds:e,offset:r==="singlepanel"||r==="2horpanel"})},hoverChanged:function(e){const t=e&&e.anatomy?e.anatomy:[],r=e&&e.organs?e.organs:[];this.settingsStore.updateHoverFeatures(t,r),Li.emit("hoverUpdate")},searchChanged:function(e){if(e&&e.type=="query-update"&&(this.search=e.value,this.search&&!this.filterTriggered&&V1.sendEvent({event:"interaction_event",event_name:"portal_maps_action_search",category:this.search,location:"map_sidebar_search"}),this.filterTriggered=!1),e&&e.type=="filter-update"){if(this.settingsStore.updateFacets(e.value),!this.filterTriggered){const{value:t}=e,n=t.filter(i=>i.facet&&i.facet.toLowerCase()!=="show all").map(i=>i.facet).join(", ");V1.sendEvent({event:"interaction_event",event_name:"portal_maps_action_filter",category:n||"filter",location:"map_sidebar_filter"})}this.filterTriggered=!1}},updateMarkers:function(e){this.settingsStore.updateMarkers(e),Li.emit("markerUpdate")},updateScaffoldMarkers:function(e){this.settingsStore.updateNumberOfDatasetsForFacets(e)},getNewEntryId:function(){return this.entries.length?this.entries[this.entries.length-1].id+1:1},activateSyncMap:function(e){let t={};return Object.assign(t,e),t.mode="normal",t.id=this.getNewEntryId(),t.state=void 0,t.type="Scaffold",t.discoverId=e.discoverId,t.rotation="free",e.layout=="2vertpanel"?t.rotation="horizontal":e.layout=="2horpanel"&&(t.rotation="vertical"),this.entriesStore.addNewEntry(t),this.splitFlowStore.setSyncMode({flag:!0,newId:t.id,layout:e.layout}),t.id},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.splitFlowStore.syncMode&&this.splitFlowStore.setSyncMode({flag:!1}),this.$refs.sideBar&&this.$refs.sideBar.setDrawerOpen(!1),t.id},openNewMap:async function(e){const t=await KQt(e,this.settingsStore.sparcApi);this.createNewEntry(t),t.contextCard&&Li.emit("contextUpdate",t.contextCard)},openSearch:function(e,t){this.search=t,this._facets=e,this.$refs&&this.$refs.sideBar&&(this.closeConnectivityInfo(),this.$refs.sideBar.openSearch(e,t)),this.startUp=!1},closeConnectivityInfo:function(){this.$el.querySelectorAll(".maplibregl-popup-close-button").forEach(t=>{t.click()})},onFullscreen:function(e){this.$emit("onFullscreen",e)},resetApp:function(){this.setState(a$())},setIdToPrimaryPane:function(e){this.splitFlowStore.setIdToPrimaryPane(e)},setState:function(e){this.entriesStore.setAll(e.entries),e.splitFlow?this.splitFlowStore.setState(e.splitFlow):this.entries.forEach(t=>this.splitFlowStore.setIdToPrimaryPane(t.id))},getState:function(){let e=JSON.parse(JSON.stringify(this.entriesStore.$state)),r=this.$refs.splitdialog.getContentsState();if(e.entries.length===r.length)for(let n=0;n<r.length;n++){const i=e.entries[n];i.state=r[n],i.type==="Scaffold"&&"viewUrl"in i&&delete i.viewUrl,i.type==="MultiFlatmap"&&"uberonId"in i&&delete i.uberonId}return e.splitFlow=this.splitFlowStore.getState(),e},removeEntry:function(e){let t=this.entriesStore.findIndexOfId(e);this.entriesStore.destroyEntry(t)},resourceSelected:function(e){this.$emit("resource-selected",e),this.splitFlowStore.globalCallback&&this.$refs.splitdialog.sendSynchronisedEvent(e)},tabClicked:function({id:e,type:t}){this.activeDockedId=e},toggleSyncMode:function(e){e&&(e.flag?e.action&&this.activateSyncMap(e.action):this.splitFlowStore.syncMode&&this.splitFlowStore.setSyncMode({flag:!1}))},contextUpdate:function(e){Li.emit("contextUpdate",e)},datalinkClicked:function(e){const t=e||"",r="datasets/",i=t.substring(t.indexOf(r)+r.length,t.indexOf("?type=dataset"));V1.sendEvent({event:"interaction_event",event_name:"portal_maps_gallery_click",category:t,location:"map_sidebar_gallery",dataset_id:i||""})},onConnectivityInfoClose:function(){Li.emit("connectivity-info-close")},resetActivePathways:function(){const t=this.$el.querySelector(".maplibregl-canvas");t&&t.click()}},created:function(){this._facets=[],this._externalStateSet=!1},mounted:function(){Li.on("RemoveEntryRequest",e=>{this.removeEntry(e)}),Li.on("SyncModeRequest",e=>{this.toggleSyncMode(e)}),Li.on("PopoverActionClick",e=>{this.actionClick(e)}),Li.on("connectivity-info-open",e=>{this.connectivityInfo=e,this.$refs.sideBar&&(this.tabClicked({id:2,type:"connectivity"}),this.$refs.sideBar.setDrawerOpen(!0))}),Li.on("connectivity-info-close",e=>{this.tabClicked({id:1,type:"search"}),this.connectivityInfo=null,this.resetActivePathways()}),Li.on("OpenNewMap",e=>{this.openNewMap(e)}),Li.on("startHelp",()=>{this.$refs.sideBar&&this.$refs.sideBar.close()}),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:{...Qc.mapStores(HH,Qb,Nm),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}},entries:function(){return this.entriesStore.entries}}},eqt={style:{width:"100%",height:"100%",position:"relative",overflow:"hidden"}};function tqt(e,t,r,n,i,o){const s=bye,l=Pge,c=a.resolveComponent("SideBar"),u=Tye,d=Vge,h=Ige;return a.openBlock(),a.createBlock(h,{style:{height:"100%",background:"white"}},{default:a.withCtx(()=>[a.createVNode(l,{ref:"header",style:{"text-align":"left","font-size":"14px",padding:"0"},height:"32px",class:"dialog-header"},{default:a.withCtx(()=>[a.createVNode(s,{numberOfEntries:o.entries.length,onOnFullscreen:o.onFullscreen,onLocalSearch:o.onDisplaySearch,onFetchSuggestions:o.fetchSuggestions,ref:"dialogToolbar"},null,8,["numberOfEntries","onOnFullscreen","onLocalSearch","onFetchSuggestions"])]),_:1},512),a.createVNode(d,{class:"dialog-main"},{default:a.withCtx(()=>[a.createElementVNode("div",eqt,[a.createVNode(c,{ref:"sideBar",envVars:o.envVars,visible:e.sideBarVisibility,class:a.normalizeClass(["side-bar",{"start-up":e.startUp}]),activeTabId:e.activeDockedId,"open-at-start":e.startUp,connectivityInfo:e.connectivityInfo,onConnectivityInfoClose:o.onConnectivityInfoClose,onActionClick:o.actionClick,onTabClicked:o.tabClicked,onSearchChanged:t[0]||(t[0]=p=>o.searchChanged(p)),onAnatomyInDatasets:t[1]||(t[1]=p=>o.updateMarkers(p)),onNumberOfDatasetsForAnatomies:t[2]||(t[2]=p=>o.updateScaffoldMarkers(p)),onHoverChanged:t[3]||(t[3]=p=>o.hoverChanged(p)),onContextUpdate:t[4]||(t[4]=p=>o.contextUpdate(p)),onDatalinkClicked:t[5]||(t[5]=p=>o.datalinkClicked(p)),onShowConnectivity:o.onShowConnectivity},null,8,["envVars","visible","class","activeTabId","open-at-start","connectivityInfo","onConnectivityInfoClose","onActionClick","onTabClicked","onShowConnectivity"]),a.createVNode(u,{entries:o.entries,ref:"splitdialog",onResourceSelected:o.resourceSelected},null,8,["entries","onResourceSelected"])])]),_:1})]),_:1})}const Hwe=Zc($Wt,[["render",tqt],["__scopeId","data-v-7c28698d"]]),rqt={name:"MapContent",components:{MapSvgSpriteColor:VH,Loading:Gge,SplitFlow:Hwe},mixins:[{methods:{retrieveContextCardFromUrl:async function(e){const[t,r,n,i]=this.splitInfoFromUrl(e),o=await this.getContextFileFromScicrunch(t,n);if(!o.success)return{};const s=r+o.contextFile+i;return{s3uri:o.s3uri,contextCardUrl:s}},splitInfoFromUrl:function(e){let t=e.split("s3-resource")[1],r=e.split("files/")[0]+"files/",n=e.split("files/")[1].split("?")[0],i="?"+e.split("?")[1];const o=t.split("/");return o.shift(),[o[0],r,n,i]},getContextFileFromScicrunch:async function(e,t){return await fetch(`${this.settingsStore.sparcApi}/dataset_info/using_multiple_discoverIds/?discoverIds=${e}`).then(n=>n.json()).then(n=>{if(n.numberOfHits===1){const i=n.results[0]["abi-contextual-information"];if(i&&i.length===1)return{success:!0,contextFile:i[0],s3uri:n.results[0].s3uri};if(i&&i.length>1){let o=this.findContextInforForFilePath(n.results[0]["abi-context-file"],t);if(o)return{success:!0,contextFile:o,s3uri:n.results[0].s3uri}}}return{success:!1}}).catch(n=>(console.error("Error:",n),{success:!1}))},findContextInforForFilePath:function(e,t){var n;let r=e.find(i=>i.datacite.isDerivedFrom.path.includes(t));return(n=r==null?void 0:r.dataset)==null?void 0:n.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}},data:function(){return{isReady:!1,initialState:void 0}},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(){this.isFullscreen()&&(document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen())},goFullscreen:function(){let e=this.$refs.MapApp;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():parent.msRequestFullscreen&&e.msRequestFullscreen()},setState:function(e){return this.$refs.flow.setState(e)},getState:function(){return this.$refs.flow.getState()},setCurrentEntry:async function(e){if(e&&e.type){if(e.type==="Scaffold"&&e.url){let t={type:e.type,label:e.label,region:e.region,resource:e.url,state:e.state,viewUrl:e.viewUrl};const r=await this.retrieveContextCardFromUrl(e.url);t={...t,...r},this.$refs.flow.createNewEntry(t)}else if(e.type==="MultiFlatmap"){const t=JQt(e);if(t){const r=this.getState();if(r&&r.entries)for(let n=0;n<r.entries.length;n++){const i=r.entries[n];if(i.type==="MultiFlatmap"){i.resource=t,i.state={species:t},(e.organ||e.uuid)&&(i.state.state={searchTerm:e.organ,uuid:e.uuid},e.uuid&&(i.state.state.entry=e.taxo)),this.$refs.flow.setState(r),this.$refs.flow.setIdToPrimaryPane(i.id);break}}}}else if(e.type==="Flatmap"){const t={type:e.type,resource:e.resource,state:e.state,label:e.label};this.$refs.flow.createNewEntry(t)}}},openSearch:function(e,t){return this.$refs.flow.openSearch(e,t)},flowMounted:function(){this._flowMounted=!0,V1.sendEvent({event:"interaction_event",event_name:"portal_maps_page_view",category:this.startingMap})},changeViewingMode:function(e){Li.emit("changeViewingMode",e)}},computed:{...Qc.mapStores(Qb,Nm),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)),(e=this.splitFlowStore)==null||e.reset(),(t=this.splitFlowStore)==null||t.getAvailableTerms(this.settingsStore.sparcApi)},mounted:async function(){Li.on("updateShareLinkRequested",()=>{this.$emit("updateShareLinkRequested")}),Li.on("trackEvent",e=>{this.$emit("trackEvent",e)}),this.state||(this.initialState=await YQt(this.startingMap,this.options.sparcApi)),Li.on("mapReady",()=>{this._flowMounted&&this.$emit("isReady")}),this.isReady=!0,this.settingsStore.updateUseHelpModeDialog(this.useHelpModeDialog),this.settingsStore.updateConnectivityInfoSidebar(this.connectivityInfoSidebar)}},nqt={ref:"MapApp",class:"mapcontent","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"};function iqt(e,t,r,n,i,o){const s=a.resolveComponent("map-svg-sprite-color"),l=Hwe,c=bb;return a.withDirectives((a.openBlock(),a.createElementBlock("div",nqt,[a.createVNode(s),e.isReady?(a.openBlock(),a.createBlock(l,{key:0,onOnFullscreen:o.onFullscreen,state:o.stateToSet,ref:"flow",onVnodeMounted:o.flowMounted},null,8,["onOnFullscreen","state","onVnodeMounted"])):a.createCommentVNode("",!0)])),[[c,!e.isReady]])}const oqt=Zc(rqt,[["render",iqt],["__scopeId","data-v-d67889d6"]]);let Gte=7,$3=5;const aqt=[{id:"UBERON:0000948",name:"heart",showAtZoom:1},{id:"UBERON:0001759",name:"vagus nerve",showAtZoom:1},{id:"UBERON:0001155",name:"colon",showAtZoom:1},{id:"UBERON:0000945",name:"stomach",showAtZoom:1},{id:"UBERON:0001013",name:"adipose tissue",showAtZoom:1},{id:"UBERON:0001255",name:"urinary bladder",showAtZoom:1},{id:"UBERON:0001348",name:"brown adipose tissue",showAtZoom:6},{id:"UBERON:0002008",name:"cardiac nerve plexus",showAtZoom:1},{id:"UBERON:0002240",name:"spinal cord",showAtZoom:1},{id:"UBERON:0002005",name:"Enteric Nervous System",showAtZoom:4},{id:"UBERON:0013702",name:"body proper",showAtZoom:1},{id:"UBERON:0002298",name:"brainstem",showAtZoom:1},{id:"UBERON:0002439",name:"myenteric nerve plexus",showAtZoom:6},{id:"UBERON:0000010",name:"peripheral nervous system",showAtZoom:6},{id:"UBERON:0002048",name:"lung",showAtZoom:1},{id:"UBERON:0002410",name:"autonomic nervous system",showAtZoom:6},{id:"UBERON:0002441",name:"cervicothoracic ganglion",showAtZoom:6},{id:"UBERON:0005363",name:"inferior vagus X ganglion",showAtZoom:6},{id:"UBERON:0001264",name:"pancreas",showAtZoom:1},{id:"UBERON:0001884",name:"phrenic nerve",showAtZoom:6},{id:"UBERON:0002059",name:"submandibular ganglion",showAtZoom:7},{id:"UBERON:0001347",name:"white adipose tissue",showAtZoom:6},{id:"UBERON:0001556",name:"lower urinary tract",showAtZoom:1},{id:"UBERON:0002262",name:"celiac ganglion",showAtZoom:5},{id:"UBERON:0000955",name:"Brain",showAtZoom:1},{id:"UBERON:0000160",name:"intestine",showAtZoom:1},{id:"UBERON:0001322",name:"sciatic nerve",showAtZoom:1},{id:"UBERON:0001649",name:"glossopharyngeal nerve",showAtZoom:6},{id:"UBERON:0002063",name:"sinus venosus",showAtZoom:6},{id:"UBERON:0002107",name:"liver",showAtZoom:1},{id:"UBERON:0002113",name:"kidney",showAtZoom:1},{id:"UBERON:0002481",name:"bone tissue",showAtZoom:1},{id:"UBERON:0004907",name:"lower digestive tract",showAtZoom:4},{id:"UBERON:0000044",name:"Dorsal root ganglion",showAtZoom:5},{id:"UBERON:0001736",name:"Submandibular gland",showAtZoom:Gte,keyword:!0},{id:"UBERON:0001103",name:"Diaphragm",showAtZoom:$3,keyword:!0},{id:"UBERON:0001160",name:"Fundus of stomach",showAtZoom:$3,keyword:!0},{id:"UBERON:0000955",name:"Brain",showAtZoom:$3,keyword:!0},{id:"UBERON:0003708",name:"Carotid sinus",showAtZoom:Gte,keyword:!0},{id:"UBERON:0002079",name:"Left cardiac atrium",showAtZoom:$3,keyword:!0},{id:"ILX:0485722",name:"Nodose ganglion",showAtZoom:Gte,keyword:!0},{id:"UBERON:0002078",name:"Right cardiac atrium",showAtZoom:$3,keyword:!0},{id:"UBERON:0002084",name:"Heart left ventricle",showAtZoom:$3,keyword:!0},{id:"UBERON:0002080",name:"Heart right ventricle",showAtZoom:$3,keyword:!0},{id:"UBERON:0001508",name:"Arch of Aorta",showAtZoom:$3,keyword:!0},{id:"UBERON:0001738",name:"Thyroid cartilage",showAtZoom:$3,keyword:!0},{id:"UBERON:0000388",name:"Epiglottis",showAtZoom:$3,keyword:!0}];function sqt(e){return e[0].toUpperCase()+e.substring(1)}const rQ={emits:["flatmap-provenance-ready","resource-selected","species-changed"],props:{entry:Object,visible:{type:Boolean,default:!0},mouseHovered:{type:Boolean,default:!1}},computed:{...Qc.mapStores(Qb,Nm),idNamePair(){return this.splitFlowStore.idNamePair},syncMode(){return this.splitFlowStore.syncMode},useHelpModeDialog(){return this.settingsStore.useHelpModeDialog},connectivityInfoSidebar(){return this.settingsStore.connectivityInfoSidebar}},mounted:function(){Li.on("startHelp",()=>{this.startHelp()}),this.multiflatmapRef=this.$refs.multiflatmap,this.flatmapRef=this.$refs.flatmap,this.scaffoldRef=this.$refs.scaffold},methods:{toggleSyncMode:function(){},getState:function(){},openMap:function(e){e==="SYNC"?(this.toggleSyncMode(),this.trackOpenMap("toggle_map_sync_mode")):(Li.emit("OpenNewMap",e),this.trackOpenMap(`open_new_${e}_map`)),this.onConnectivityInfoClose()},trackOpenMap:function(e){V1.sendEvent({event:"interaction_event",event_name:"portal_maps_open_map",category:e,location:"open_new_map"})},updateWithViewUrl:function(){},search:function(){return!1},searchSuggestions:function(){},resourceSelected:function(e,t,r){var l,c,u;if(this.resourceHasAction(t)){Li.emit("PopoverActionClick",t);return}let n,i="none",o=!1;const s={paneIndex:this.entry.id,type:e,resource:t,internalName:void 0,eventType:void 0};if(e=="MultiFlatmap"||e=="Flatmap")if(s.internalName=this.idNamePair[t.feature.models],t.eventType=="click")if(s.eventType="selected",t.feature.type=="marker"){let d=this.idNamePair[t.feature.models],h=aqt.filter(p=>p.id===t.feature.models);this.settingsStore.isFeaturedMarkerIdentifier(t.feature.id)?n={type:"Search",term:this.settingsStore.featuredMarkerDoi(t.feature.id),featuredDataset:!0}:h.filter(p=>p.keyword).length>0?n={type:"Search",term:"http://purl.obolibrary.org/obo/"+t.feature.models.replace(":","_")}:n={type:"Facet",facet:d,facetPropPath:"anatomy.organ.category.name",term:"Anatomical structure"},o=!0,e=="MultiFlatmap"&&this.$refs.multiflatmap.getCurrentFlatmap().mapImp.clearSearchResults()}else t.feature.type=="feature"&&(this.syncMode?o=!0:i="scaffold");else t.eventType=="mouseenter"&&(s.eventType="highlighted",o=!0);else e=="Scaffold"&&(t&&t[0]&&((((l=t[0].data)==null?void 0:l.id)===void 0||((c=t[0].data)==null?void 0:c.id)==="")&&(t[0].data.id=(u=t[0].data)==null?void 0:u.group),s.internalName=t[0].data.id,t[0].data.lastActionOnMarker===!0&&(n={type:"Facet",facet:sqt(t[0].data.id),facetPropPath:"anatomy.organ.category.name",term:"Anatomical structure"})),s.eventType="selected",o=!0,i="search");n===void 0&&r&&(n=cxt(s,i)),n&&Li.emit("PopoverActionClick",n),o&&this.$emit("resource-selected",s)},resourceHasAction:function(e){return 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},displayTooltip:function(){},getNameAndIdFromSyncData:async function(e){let t=e.internalName;t===void 0&&e.resource&&(t=e.resource.label);let r;if(e.resource&&e.resource.resource&&(r=e.resource.resource[0]),this.entry.type==="Scaffold"){if(this.$refs.scaffold.findObjectsWithGroupName(t).length===0){if(e.resource&&e.resource.feature){const o=uye(e.resource.feature.models);if(o.length>0)return o}let i=lxt(t);if(i)return i;if(r&&e.eventType==="selected")return fetch(`${this.apiLocation}get-related-terms/${r}`).then(o=>o.json()).then(o=>{if(o.uberon.array.length>0)return t=o.uberon.array[0].name.charAt(0).toUpperCase()+o.uberon.array[0].name.slice(1),r=o.uberon.array[0].id.toUpperCase(),{id:r,name:t}})}}else if(this.entry.type==="MultiFlatmap")if(t==="Bladder")t="Urinary Bladder";else{const n=uye(t);n.length>0&&(t=n[0])}return{id:r,name:t}},getDatasetAnatomyInfo:function(e){fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${e}`).then(t=>t.json()).then(t=>{const r=t.result[0];let n;try{n=r.anatomy.organ[0].curie}catch{n=void 0}let i;try{i=r.item.curie}catch{i=void 0}let o;try{let s=0,l=!1;for(;!l&&s<r.organisms.subject.length;){const c=r.organisms.subject[s];c.species&&(o=c.species.name,l=!0),s+=1}}catch{o=void 0}this.settingsStore.updateFeaturedMarker({identifier:e,marker:n,doi:i,species:o})})},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(r=>r.id)},getFeaturedDatasets:async function(){let e=[],t=await this.oldFeaturedDatasetApiHasInfo();if(t)e=t;else{let r=await this.newFeaturedDatasetApiHasInfo();r&&(e=r)}this.settingsStore.updateFeatured(e),e.forEach(r=>{this.getDatasetAnatomyInfo(r)})},zoomToFeatures:function(){},handleSyncMouseEvent:async function(e){let t=await this.getNameAndIdFromSyncData(e);e.eventType==="highlighted"?this.highlightFeatures(t):e.eventType==="selected"&&this.displayTooltip(t)},handleSyncPanZoomEvent:function(){},highlightFeatures:function(){},receiveSynchronisedEvent:async function(e){if(e.paneIndex!==this.entry.id)e.eventType=="panZoom"||this.handleSyncMouseEvent(e);else if(e.eventType=="selected"){let t=await this.getNameAndIdFromSyncData(e);this.zoomToFeatures(t,!1)}},requestSynchronisedEvent:function(){},flatmapMarkerUpdate(){},onResize:function(){},startHelp:function(){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()},mapHoverHighlight:function(e){if(this.visible){const t=this.settingsStore.hoverAnatomies,r=this.settingsStore.hoverOrgans;t.length||r.length?(clearTimeout(this.hoverDelay),this.multiflatmapRef||this.flatmapRef?e==null||e.zoomToFeatures(t,{noZoomIn:!0}):this.scaffoldRef&&(e==null||e.changeHighlightedByName(r,"",!1))):this.hoverDelay=setTimeout(()=>{this.multiflatmapRef||this.flatmapRef?e==null||e.clearSearchResults():this.scaffoldRef&&(e==null||e.changeHighlightedByName(r,"",!1))},500)}},onConnectivityInfoOpen:function(e){Li.emit("connectivity-info-open",e)},onConnectivityInfoClose:function(){Li.emit("connectivity-info-close")}},data:function(){return{apiLocation:void 0,activeSpecies:"Rat",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,hoverDelay:void 0}},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)},watch:{helpMode:function(e){e||(this.helpModeActiveItem=0)}}},lqt=function(e){return e?[...new Set(e.map(t=>JSON.stringify(t)))].map(t=>JSON.parse(t)):[]},Rwe={computed:{...Qc.mapStores(Qb)},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 r=this.settingsStore.markers;r=lqt(r);let n=this.removeMarkersNotOnFlatmap(t,r);t.clearMarkers(),t.clearDatasetMarkers(),t.addDatasetMarkers(n),this.entry.type==="MultiFlatmap"&&this.restoreFeaturedMarkers(t)}},removeMarkersNotOnFlatmap(e,t){let r=e.anatomicalIdentifiers,n=[];for(let i=0;i<t.length;i++){let o=t[i],s={id:o.id,terms:[]};for(let l=0;l<o.terms.length;l++)r.includes(o.terms[l])&&s.terms.push(o.terms[l]);n.push(s)}return n},flatmapReadyForMarkerUpdates:function(e){if(e){e.enablePanZoomEvents(!0),this.flatmapReady=!0;const t=e.mapImp;this.flatmapMarkerUpdate(t)}}}},m6=(e,t,{checkForDefaultPrevented:r=!0}={})=>n=>{const i=e==null?void 0:e(n);if(r===!1||!i)return t==null?void 0:t(n)};var Nwe;const Al=typeof window<"u",cqt=e=>typeof e=="string",Bwe=()=>{},uqt=Al&&((Nwe=window==null?void 0:window.navigator)==null?void 0:Nwe.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Fwe(e){return typeof e=="function"?e():a.unref(e)}function dqt(e){return e}function vN(e){return a.getCurrentScope()?(a.onScopeDispose(e),!0):!1}function hqt(e,t=!0){a.getCurrentInstance()?a.onMounted(e):t?e():a.nextTick(e)}function g6(e){var t;const r=Fwe(e);return(t=r==null?void 0:r.$el)!=null?t:r}const bN=Al?window:void 0;function t8(...e){let t,r,n,i;if(cqt(e[0])||Array.isArray(e[0])?([r,n,i]=e,t=bN):[t,r,n,i]=e,!t)return Bwe;Array.isArray(r)||(r=[r]),Array.isArray(n)||(n=[n]);const o=[],s=()=>{o.forEach(d=>d()),o.length=0},l=(d,h,p,f)=>(d.addEventListener(h,p,f),()=>d.removeEventListener(h,p,f)),c=a.watch(()=>[g6(t),Fwe(i)],([d,h])=>{s(),d&&o.push(...r.flatMap(p=>n.map(f=>l(d,p,f,h))))},{immediate:!0,flush:"post"}),u=()=>{c(),s()};return vN(u),u}let Dwe=!1;function pqt(e,t,r={}){const{window:n=bN,ignore:i=[],capture:o=!0,detectIframe:s=!1}=r;if(!n)return;uqt&&!Dwe&&(Dwe=!0,Array.from(n.document.body.children).forEach(d=>d.addEventListener("click",Bwe)));let l=!0;const c=d=>i.some(h=>{if(typeof h=="string")return Array.from(n.document.querySelectorAll(h)).some(p=>p===d.target||d.composedPath().includes(p));{const p=g6(h);return p&&(d.target===p||d.composedPath().includes(p))}}),u=[t8(n,"click",d=>{const h=g6(e);if(!(!h||h===d.target||d.composedPath().includes(h))){if(d.detail===0&&(l=!c(d)),!l){l=!0;return}t(d)}},{passive:!0,capture:o}),t8(n,"pointerdown",d=>{const h=g6(e);h&&(l=!d.composedPath().includes(h)&&!c(d))},{passive:!0}),s&&t8(n,"blur",d=>{var h;const p=g6(e);((h=n.document.activeElement)==null?void 0:h.tagName)==="IFRAME"&&!(p!=null&&p.contains(n.document.activeElement))&&t(d)})].filter(Boolean);return()=>u.forEach(d=>d())}function zwe(e,t=!1){const r=a.ref(),n=()=>r.value=!!e();return n(),hqt(n,t),r}const jwe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Uwe="__vueuse_ssr_handlers__";jwe[Uwe]=jwe[Uwe]||{};var Gwe=Object.getOwnPropertySymbols,fqt=Object.prototype.hasOwnProperty,mqt=Object.prototype.propertyIsEnumerable,gqt=(e,t)=>{var r={};for(var n in e)fqt.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Gwe)for(var n of Gwe(e))t.indexOf(n)<0&&mqt.call(e,n)&&(r[n]=e[n]);return r};function y6(e,t,r={}){const n=r,{window:i=bN}=n,o=gqt(n,["window"]);let s;const l=zwe(()=>i&&"ResizeObserver"in i),c=()=>{s&&(s.disconnect(),s=void 0)},u=a.watch(()=>g6(e),h=>{c(),l.value&&i&&h&&(s=new ResizeObserver(t),s.observe(h,o))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return vN(d),{isSupported:l,stop:d}}var Wwe=Object.getOwnPropertySymbols,yqt=Object.prototype.hasOwnProperty,Tqt=Object.prototype.propertyIsEnumerable,vqt=(e,t)=>{var r={};for(var n in e)yqt.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Wwe)for(var n of Wwe(e))t.indexOf(n)<0&&Tqt.call(e,n)&&(r[n]=e[n]);return r};function bqt(e,t,r={}){const n=r,{window:i=bN}=n,o=vqt(n,["window"]);let s;const l=zwe(()=>i&&"MutationObserver"in i),c=()=>{s&&(s.disconnect(),s=void 0)},u=a.watch(()=>g6(e),h=>{c(),l.value&&i&&h&&(s=new MutationObserver(t),s.observe(h,o))},{immediate:!0}),d=()=>{c(),u()};return vN(d),{isSupported:l,stop:d}}var qwe;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(qwe||(qwe={}));var Qqt=Object.defineProperty,Zwe=Object.getOwnPropertySymbols,xqt=Object.prototype.hasOwnProperty,_qt=Object.prototype.propertyIsEnumerable,Xwe=(e,t,r)=>t in e?Qqt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wqt=(e,t)=>{for(var r in t||(t={}))xqt.call(t,r)&&Xwe(e,r,t[r]);if(Zwe)for(var r of Zwe(t))_qt.call(t,r)&&Xwe(e,r,t[r]);return e};wqt({linear:dqt},{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 Lqt=()=>Al&&/firefox/i.test(window.navigator.userAgent),Wte=e=>{let t,r;return e.type==="touchend"?(r=e.changedTouches[0].clientY,t=e.changedTouches[0].clientX):e.type.startsWith("touch")?(r=e.touches[0].clientY,t=e.touches[0].clientX):(r=e.clientY,t=e.clientX),{clientX:t,clientY:r}};/**
|
937
|
+
`)},PGt=["innerHTML"];function VGt(e,t,r,n,i,o){return a.openBlock(),a.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:e.$options.svgSprite},null,8,PGt)}const HGt=G_e(IGt,[["render",VGt]]);var Cwe={exports:{}};/*! algoliasearch.umd.js | 4.23.2 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */(function(e,t){(function(r,n){e.exports=n()})(rIt,function(){function r(Ae,We,st){return We in Ae?Object.defineProperty(Ae,We,{value:st,enumerable:!0,configurable:!0,writable:!0}):Ae[We]=st,Ae}function n(Ae,We){var st=Object.keys(Ae);if(Object.getOwnPropertySymbols){var vt=Object.getOwnPropertySymbols(Ae);We&&(vt=vt.filter(function(Ft){return Object.getOwnPropertyDescriptor(Ae,Ft).enumerable})),st.push.apply(st,vt)}return st}function i(Ae){for(var We=1;We<arguments.length;We++){var st=arguments[We]!=null?arguments[We]:{};We%2?n(Object(st),!0).forEach(function(vt){r(Ae,vt,st[vt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Ae,Object.getOwnPropertyDescriptors(st)):n(Object(st)).forEach(function(vt){Object.defineProperty(Ae,vt,Object.getOwnPropertyDescriptor(st,vt))})}return Ae}function o(Ae,We){if(Ae==null)return{};var st,vt,Ft=function(mr,Tr){if(mr==null)return{};var Rr,Mr,zr={},xr=Object.keys(mr);for(Mr=0;Mr<xr.length;Mr++)Rr=xr[Mr],Tr.indexOf(Rr)>=0||(zr[Rr]=mr[Rr]);return zr}(Ae,We);if(Object.getOwnPropertySymbols){var ur=Object.getOwnPropertySymbols(Ae);for(vt=0;vt<ur.length;vt++)st=ur[vt],We.indexOf(st)>=0||Object.prototype.propertyIsEnumerable.call(Ae,st)&&(Ft[st]=Ae[st])}return Ft}function s(Ae,We){return function(st){if(Array.isArray(st))return st}(Ae)||function(st,vt){if(Symbol.iterator in Object(st)||Object.prototype.toString.call(st)==="[object Arguments]"){var Ft=[],ur=!0,mr=!1,Tr=void 0;try{for(var Rr,Mr=st[Symbol.iterator]();!(ur=(Rr=Mr.next()).done)&&(Ft.push(Rr.value),!vt||Ft.length!==vt);ur=!0);}catch(zr){mr=!0,Tr=zr}finally{try{ur||Mr.return==null||Mr.return()}finally{if(mr)throw Tr}}return Ft}}(Ae,We)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function l(Ae){return function(We){if(Array.isArray(We)){for(var st=0,vt=new Array(We.length);st<We.length;st++)vt[st]=We[st];return vt}}(Ae)||function(We){if(Symbol.iterator in Object(We)||Object.prototype.toString.call(We)==="[object Arguments]")return Array.from(We)}(Ae)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function c(Ae){var We,st="algoliasearch-client-js-".concat(Ae.key),vt=function(){return We===void 0&&(We=Ae.localStorage||window.localStorage),We},Ft=function(){return JSON.parse(vt().getItem(st)||"{}")},ur=function(Tr){vt().setItem(st,JSON.stringify(Tr))},mr=function(){var Tr=Ae.timeToLive?1e3*Ae.timeToLive:null,Rr=Ft(),Mr=Object.fromEntries(Object.entries(Rr).filter(function(xr){return s(xr,2)[1].timestamp!==void 0}));if(ur(Mr),Tr){var zr=Object.fromEntries(Object.entries(Mr).filter(function(xr){var Hr=s(xr,2)[1],Hn=new Date().getTime();return!(Hr.timestamp+Tr<Hn)}));ur(zr)}};return{get:function(Tr,Rr){var Mr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){mr();var zr=JSON.stringify(Tr);return Ft()[zr]}).then(function(zr){return Promise.all([zr?zr.value:Rr(),zr!==void 0])}).then(function(zr){var xr=s(zr,2),Hr=xr[0],Hn=xr[1];return Promise.all([Hr,Hn||Mr.miss(Hr)])}).then(function(zr){return s(zr,1)[0]})},set:function(Tr,Rr){return Promise.resolve().then(function(){var Mr=Ft();return Mr[JSON.stringify(Tr)]={timestamp:new Date().getTime(),value:Rr},vt().setItem(st,JSON.stringify(Mr)),Rr})},delete:function(Tr){return Promise.resolve().then(function(){var Rr=Ft();delete Rr[JSON.stringify(Tr)],vt().setItem(st,JSON.stringify(Rr))})},clear:function(){return Promise.resolve().then(function(){vt().removeItem(st)})}}}function u(Ae){var We=l(Ae.caches),st=We.shift();return st===void 0?{get:function(vt,Ft){var ur=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},mr=Ft();return mr.then(function(Tr){return Promise.all([Tr,ur.miss(Tr)])}).then(function(Tr){return s(Tr,1)[0]})},set:function(vt,Ft){return Promise.resolve(Ft)},delete:function(vt){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(vt,Ft){var ur=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return st.get(vt,Ft,ur).catch(function(){return u({caches:We}).get(vt,Ft,ur)})},set:function(vt,Ft){return st.set(vt,Ft).catch(function(){return u({caches:We}).set(vt,Ft)})},delete:function(vt){return st.delete(vt).catch(function(){return u({caches:We}).delete(vt)})},clear:function(){return st.clear().catch(function(){return u({caches:We}).clear()})}}}function d(){var Ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{serializable:!0},We={};return{get:function(st,vt){var Ft=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},ur=JSON.stringify(st);if(ur in We)return Promise.resolve(Ae.serializable?JSON.parse(We[ur]):We[ur]);var mr=vt(),Tr=Ft&&Ft.miss||function(){return Promise.resolve()};return mr.then(function(Rr){return Tr(Rr)}).then(function(){return mr})},set:function(st,vt){return We[JSON.stringify(st)]=Ae.serializable?JSON.stringify(vt):vt,Promise.resolve(vt)},delete:function(st){return delete We[JSON.stringify(st)],Promise.resolve()},clear:function(){return We={},Promise.resolve()}}}function h(Ae,We,st){var vt={"x-algolia-api-key":st,"x-algolia-application-id":We};return{headers:function(){return Ae===y.WithinHeaders?vt:{}},queryParameters:function(){return Ae===y.WithinQueryParameters?vt:{}}}}function p(Ae){var We=0;return Ae(function st(){return We++,new Promise(function(vt){setTimeout(function(){vt(Ae(st))},Math.min(100*We,1e3))})})}function f(Ae){var We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(st,vt){return Promise.resolve()};return Object.assign(Ae,{wait:function(st){return f(Ae.then(function(vt){return Promise.all([We(vt,st),vt])}).then(function(vt){return vt[1]}))}})}function m(Ae){for(var We=Ae.length-1;We>0;We--){var st=Math.floor(Math.random()*(We+1)),vt=Ae[We];Ae[We]=Ae[st],Ae[st]=vt}return Ae}function g(Ae,We){return We&&Object.keys(We).forEach(function(st){Ae[st]=We[st](Ae)}),Ae}function T(Ae){for(var We=arguments.length,st=new Array(We>1?We-1:0),vt=1;vt<We;vt++)st[vt-1]=arguments[vt];var Ft=0;return Ae.replace(/%s/g,function(){return encodeURIComponent(st[Ft++])})}var y={WithinQueryParameters:0,WithinHeaders:1};function v(Ae,We){var st=Ae||{},vt=st.data||{};return Object.keys(st).forEach(function(Ft){["timeout","headers","queryParameters","data","cacheable"].indexOf(Ft)===-1&&(vt[Ft]=st[Ft])}),{data:Object.entries(vt).length>0?vt:void 0,timeout:st.timeout||We,headers:st.headers||{},queryParameters:st.queryParameters||{},cacheable:st.cacheable}}var Q={Read:1,Write:2,Any:3},_=1,L=2,w=3;function S(Ae){var We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_;return i(i({},Ae),{},{status:We,lastUpdate:Date.now()})}function C(Ae){return typeof Ae=="string"?{protocol:"https",url:Ae,accept:Q.Any}:{protocol:Ae.protocol||"https",url:Ae.url,accept:Ae.accept||Q.Any}}var E="DELETE",O="GET",I="POST",R="PUT";function B(Ae,We){return Promise.all(We.map(function(st){return Ae.get(st,function(){return Promise.resolve(S(st))})})).then(function(st){var vt=st.filter(function(mr){return function(Tr){return Tr.status===_||Date.now()-Tr.lastUpdate>12e4}(mr)}),Ft=st.filter(function(mr){return function(Tr){return Tr.status===w&&Date.now()-Tr.lastUpdate<=12e4}(mr)}),ur=[].concat(l(vt),l(Ft));return{getTimeout:function(mr,Tr){return(Ft.length===0&&mr===0?1:Ft.length+3+mr)*Tr},statelessHosts:ur.length>0?ur.map(function(mr){return C(mr)}):We}})}function D(Ae,We,st,vt){var Ft=[],ur=function(Hr,Hn){if(!(Hr.method===O||Hr.data===void 0&&Hn.data===void 0)){var Wn=Array.isArray(Hr.data)?Hr.data:i(i({},Hr.data),Hn.data);return JSON.stringify(Wn)}}(st,vt),mr=function(Hr,Hn){var Wn=i(i({},Hr.headers),Hn.headers),ei={};return Object.keys(Wn).forEach(function(uo){var _a=Wn[uo];ei[uo.toLowerCase()]=_a}),ei}(Ae,vt),Tr=st.method,Rr=st.method!==O?{}:i(i({},st.data),vt.data),Mr=i(i(i({"x-algolia-agent":Ae.userAgent.value},Ae.queryParameters),Rr),vt.queryParameters),zr=0,xr=function Hr(Hn,Wn){var ei=Hn.pop();if(ei===void 0)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:G(Ft)};var uo={data:ur,headers:mr,method:Tr,url:V(ei,st.path,Mr),connectTimeout:Wn(zr,Ae.timeouts.connect),responseTimeout:Wn(zr,vt.timeout)},_a=function(ds){var wa={request:uo,response:ds,host:ei,triesLeft:Hn.length};return Ft.push(wa),wa},ho={onSuccess:function(ds){return function(wa){try{return JSON.parse(wa.content)}catch(_s){throw function(zl,Bc){return{name:"DeserializationError",message:zl,response:Bc}}(_s.message,wa)}}(ds)},onRetry:function(ds){var wa=_a(ds);return ds.isTimedOut&&zr++,Promise.all([Ae.logger.info("Retryable failure",X(wa)),Ae.hostsCache.set(ei,S(ei,ds.isTimedOut?w:L))]).then(function(){return Hr(Hn,Wn)})},onFail:function(ds){throw _a(ds),function(wa,_s){var zl=wa.content,Bc=wa.status,dc=zl;try{dc=JSON.parse(zl).message}catch{}return function(qu,ou,Rs){return{name:"ApiError",message:qu,status:ou,transporterStackTrace:Rs}}(dc,Bc,_s)}(ds,G(Ft))}};return Ae.requester.send(uo).then(function(ds){return function(wa,_s){return function(zl){var Bc=zl.status;return zl.isTimedOut||function(dc){var qu=dc.isTimedOut,ou=dc.status;return!qu&&~~ou==0}(zl)||~~(Bc/100)!=2&&~~(Bc/100)!=4}(wa)?_s.onRetry(wa):~~(wa.status/100)==2?_s.onSuccess(wa):_s.onFail(wa)}(ds,ho)})};return B(Ae.hostsCache,We).then(function(Hr){return xr(l(Hr.statelessHosts).reverse(),Hr.getTimeout)})}function j(Ae){var We=Ae.hostsCache,st=Ae.logger,vt=Ae.requester,Ft=Ae.requestsCache,ur=Ae.responsesCache,mr=Ae.timeouts,Tr=Ae.userAgent,Rr=Ae.hosts,Mr=Ae.queryParameters,zr={hostsCache:We,logger:st,requester:vt,requestsCache:Ft,responsesCache:ur,timeouts:mr,userAgent:Tr,headers:Ae.headers,queryParameters:Mr,hosts:Rr.map(function(xr){return C(xr)}),read:function(xr,Hr){var Hn=v(Hr,zr.timeouts.read),Wn=function(){return D(zr,zr.hosts.filter(function(uo){return(uo.accept&Q.Read)!=0}),xr,Hn)};if((Hn.cacheable!==void 0?Hn.cacheable:xr.cacheable)!==!0)return Wn();var ei={request:xr,mappedRequestOptions:Hn,transporter:{queryParameters:zr.queryParameters,headers:zr.headers}};return zr.responsesCache.get(ei,function(){return zr.requestsCache.get(ei,function(){return zr.requestsCache.set(ei,Wn()).then(function(uo){return Promise.all([zr.requestsCache.delete(ei),uo])},function(uo){return Promise.all([zr.requestsCache.delete(ei),Promise.reject(uo)])}).then(function(uo){var _a=s(uo,2);return _a[0],_a[1]})})},{miss:function(uo){return zr.responsesCache.set(ei,uo)}})},write:function(xr,Hr){return D(zr,zr.hosts.filter(function(Hn){return(Hn.accept&Q.Write)!=0}),xr,v(Hr,zr.timeouts.write))}};return zr}function N(Ae){var We={value:"Algolia for JavaScript (".concat(Ae,")"),add:function(st){var vt="; ".concat(st.segment).concat(st.version!==void 0?" (".concat(st.version,")"):"");return We.value.indexOf(vt)===-1&&(We.value="".concat(We.value).concat(vt)),We}};return We}function V(Ae,We,st){var vt=W(st),Ft="".concat(Ae.protocol,"://").concat(Ae.url,"/").concat(We.charAt(0)==="/"?We.substr(1):We);return vt.length&&(Ft+="?".concat(vt)),Ft}function W(Ae){return Object.keys(Ae).map(function(We){return T("%s=%s",We,(st=Ae[We],Object.prototype.toString.call(st)==="[object Object]"||Object.prototype.toString.call(st)==="[object Array]"?JSON.stringify(Ae[We]):Ae[We]));var st}).join("&")}function G(Ae){return Ae.map(function(We){return X(We)})}function X(Ae){var We=Ae.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return i(i({},Ae),{},{request:i(i({},Ae.request),{},{headers:i(i({},Ae.request.headers),We)})})}var $=function(Ae){return function(We,st){return Ae.transporter.write({method:I,path:"2/abtests",data:We},st)}},te=function(Ae){return function(We,st){return Ae.transporter.write({method:E,path:T("2/abtests/%s",We)},st)}},ce=function(Ae){return function(We,st){return Ae.transporter.read({method:O,path:T("2/abtests/%s",We)},st)}},Qe=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"2/abtests"},We)}},me=function(Ae){return function(We,st){return Ae.transporter.write({method:I,path:T("2/abtests/%s/stop",We)},st)}},ne=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"1/strategies/personalization"},We)}},le=function(Ae){return function(We,st){return Ae.transporter.write({method:I,path:"1/strategies/personalization",data:We},st)}};function ee(Ae){return function We(st){return Ae.request(st).then(function(vt){if(Ae.batch!==void 0&&Ae.batch(vt.hits),!Ae.shouldStop(vt))return vt.cursor?We({cursor:vt.cursor}):We({page:(st.page||0)+1})})}({})}var oe=function(Ae){return function(We,st){var vt=st||{},Ft=vt.queryParameters,ur=o(vt,["queryParameters"]),mr=i({acl:We},Ft!==void 0?{queryParameters:Ft}:{});return f(Ae.transporter.write({method:I,path:"1/keys",data:mr},ur),function(Tr,Rr){return p(function(Mr){return rt(Ae)(Tr.key,Rr).catch(function(zr){if(zr.status!==404)throw zr;return Mr()})})})}},ie=function(Ae){return function(We,st,vt){var Ft=v(vt);return Ft.queryParameters["X-Algolia-User-ID"]=We,Ae.transporter.write({method:I,path:"1/clusters/mapping",data:{cluster:st}},Ft)}},he=function(Ae){return function(We,st,vt){return Ae.transporter.write({method:I,path:"1/clusters/mapping/batch",data:{users:We,cluster:st}},vt)}},we=function(Ae){return function(We,st){return f(Ae.transporter.write({method:I,path:T("/1/dictionaries/%s/batch",We),data:{clearExistingDictionaryEntries:!0,requests:{action:"addEntry",body:[]}}},st),function(vt,Ft){return Ye(Ae)(vt.taskID,Ft)})}},Pe=function(Ae){return function(We,st,vt){return f(Ae.transporter.write({method:I,path:T("1/indexes/%s/operation",We),data:{operation:"copy",destination:st}},vt),function(Ft,ur){return ft(Ae)(We,{methods:{waitTask:ci}}).waitTask(Ft.taskID,ur)})}},pe=function(Ae){return function(We,st,vt){return Pe(Ae)(We,st,i(i({},vt),{},{scope:[xa.Rules]}))}},Ce=function(Ae){return function(We,st,vt){return Pe(Ae)(We,st,i(i({},vt),{},{scope:[xa.Settings]}))}},Le=function(Ae){return function(We,st,vt){return Pe(Ae)(We,st,i(i({},vt),{},{scope:[xa.Synonyms]}))}},Oe=function(Ae){return function(We,st){return We.method===O?Ae.transporter.read(We,st):Ae.transporter.write(We,st)}},De=function(Ae){return function(We,st){return f(Ae.transporter.write({method:E,path:T("1/keys/%s",We)},st),function(vt,Ft){return p(function(ur){return rt(Ae)(We,Ft).then(ur).catch(function(mr){if(mr.status!==404)throw mr})})})}},ot=function(Ae){return function(We,st,vt){var Ft=st.map(function(ur){return{action:"deleteEntry",body:{objectID:ur}}});return f(Ae.transporter.write({method:I,path:T("/1/dictionaries/%s/batch",We),data:{clearExistingDictionaryEntries:!1,requests:Ft}},vt),function(ur,mr){return Ye(Ae)(ur.taskID,mr)})}},rt=function(Ae){return function(We,st){return Ae.transporter.read({method:O,path:T("1/keys/%s",We)},st)}},dt=function(Ae){return function(We,st){return Ae.transporter.read({method:O,path:T("1/task/%s",We.toString())},st)}},wt=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"/1/dictionaries/*/settings"},We)}},yt=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"1/logs"},We)}},ge=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"1/clusters/mapping/top"},We)}},Xe=function(Ae){return function(We,st){return Ae.transporter.read({method:O,path:T("1/clusters/mapping/%s",We)},st)}},pt=function(Ae){return function(We){var st=We||{},vt=st.retrieveMappings,Ft=o(st,["retrieveMappings"]);return vt===!0&&(Ft.getClusters=!0),Ae.transporter.read({method:O,path:"1/clusters/mapping/pending"},Ft)}},ft=function(Ae){return function(We){var st=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},vt={transporter:Ae.transporter,appId:Ae.appId,indexName:We};return g(vt,st.methods)}},_t=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"1/keys"},We)}},Pt=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"1/clusters"},We)}},Vt=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"1/indexes"},We)}},qt=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"1/clusters/mapping"},We)}},Zt=function(Ae){return function(We,st,vt){return f(Ae.transporter.write({method:I,path:T("1/indexes/%s/operation",We),data:{operation:"move",destination:st}},vt),function(Ft,ur){return ft(Ae)(We,{methods:{waitTask:ci}}).waitTask(Ft.taskID,ur)})}},ht=function(Ae){return function(We,st){return f(Ae.transporter.write({method:I,path:"1/indexes/*/batch",data:{requests:We}},st),function(vt,Ft){return Promise.all(Object.keys(vt.taskID).map(function(ur){return ft(Ae)(ur,{methods:{waitTask:ci}}).waitTask(vt.taskID[ur],Ft)}))})}},kt=function(Ae){return function(We,st){return Ae.transporter.read({method:I,path:"1/indexes/*/objects",data:{requests:We}},st)}},Ht=function(Ae){return function(We,st){var vt=We.map(function(Ft){return i(i({},Ft),{},{params:W(Ft.params||{})})});return Ae.transporter.read({method:I,path:"1/indexes/*/queries",data:{requests:vt},cacheable:!0},st)}},Gt=function(Ae){return function(We,st){return Promise.all(We.map(function(vt){var Ft=vt.params,ur=Ft.facetName,mr=Ft.facetQuery,Tr=o(Ft,["facetName","facetQuery"]);return ft(Ae)(vt.indexName,{methods:{searchForFacetValues:Gn}}).searchForFacetValues(ur,mr,i(i({},st),Tr))}))}},fr=function(Ae){return function(We,st){var vt=v(st);return vt.queryParameters["X-Algolia-User-ID"]=We,Ae.transporter.write({method:E,path:"1/clusters/mapping"},vt)}},tr=function(Ae){return function(We,st,vt){var Ft=st.map(function(ur){return{action:"addEntry",body:ur}});return f(Ae.transporter.write({method:I,path:T("/1/dictionaries/%s/batch",We),data:{clearExistingDictionaryEntries:!0,requests:Ft}},vt),function(ur,mr){return Ye(Ae)(ur.taskID,mr)})}},_r=function(Ae){return function(We,st){return f(Ae.transporter.write({method:I,path:T("1/keys/%s/restore",We)},st),function(vt,Ft){return p(function(ur){return rt(Ae)(We,Ft).catch(function(mr){if(mr.status!==404)throw mr;return ur()})})})}},Jt=function(Ae){return function(We,st,vt){var Ft=st.map(function(ur){return{action:"addEntry",body:ur}});return f(Ae.transporter.write({method:I,path:T("/1/dictionaries/%s/batch",We),data:{clearExistingDictionaryEntries:!1,requests:Ft}},vt),function(ur,mr){return Ye(Ae)(ur.taskID,mr)})}},Qr=function(Ae){return function(We,st,vt){return Ae.transporter.read({method:I,path:T("/1/dictionaries/%s/search",We),data:{query:st},cacheable:!0},vt)}},He=function(Ae){return function(We,st){return Ae.transporter.read({method:I,path:"1/clusters/mapping/search",data:{query:We}},st)}},Re=function(Ae){return function(We,st){return f(Ae.transporter.write({method:R,path:"/1/dictionaries/*/settings",data:We},st),function(vt,Ft){return Ye(Ae)(vt.taskID,Ft)})}},Fe=function(Ae){return function(We,st){var vt=Object.assign({},st),Ft=st||{},ur=Ft.queryParameters,mr=o(Ft,["queryParameters"]),Tr=ur?{queryParameters:ur}:{},Rr=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return f(Ae.transporter.write({method:R,path:T("1/keys/%s",We),data:Tr},mr),function(Mr,zr){return p(function(xr){return rt(Ae)(We,zr).then(function(Hr){return function(Hn){return Object.keys(vt).filter(function(Wn){return Rr.indexOf(Wn)!==-1}).every(function(Wn){if(Array.isArray(Hn[Wn])&&Array.isArray(vt[Wn])){var ei=Hn[Wn];return ei.length===vt[Wn].length&&ei.every(function(uo,_a){return uo===vt[Wn][_a]})}return Hn[Wn]===vt[Wn]})}(Hr)?Promise.resolve():xr()})})})}},Ye=function(Ae){return function(We,st){return p(function(vt){return dt(Ae)(We,st).then(function(Ft){return Ft.status!=="published"?vt():void 0})})}},at=function(Ae){return function(We,st){return f(Ae.transporter.write({method:I,path:T("1/indexes/%s/batch",Ae.indexName),data:{requests:We}},st),function(vt,Ft){return ci(Ae)(vt.taskID,Ft)})}},Lt=function(Ae){return function(We){return ee(i(i({shouldStop:function(st){return st.cursor===void 0}},We),{},{request:function(st){return Ae.transporter.read({method:I,path:T("1/indexes/%s/browse",Ae.indexName),data:st},We)}}))}},Se=function(Ae){return function(We){var st=i({hitsPerPage:1e3},We);return ee(i(i({shouldStop:function(vt){return vt.hits.length<st.hitsPerPage}},st),{},{request:function(vt){return _i(Ae)("",i(i({},st),vt)).then(function(Ft){return i(i({},Ft),{},{hits:Ft.hits.map(function(ur){return delete ur._highlightResult,ur})})})}}))}},Ze=function(Ae){return function(We){var st=i({hitsPerPage:1e3},We);return ee(i(i({shouldStop:function(vt){return vt.hits.length<st.hitsPerPage}},st),{},{request:function(vt){return Qo(Ae)("",i(i({},st),vt)).then(function(Ft){return i(i({},Ft),{},{hits:Ft.hits.map(function(ur){return delete ur._highlightResult,ur})})})}}))}},ze=function(Ae){return function(We,st,vt){var Ft=vt||{},ur=Ft.batchSize,mr=o(Ft,["batchSize"]),Tr={taskIDs:[],objectIDs:[]};return f(function Rr(){var Mr,zr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,xr=[];for(Mr=zr;Mr<We.length&&(xr.push(We[Mr]),xr.length!==(ur||1e3));Mr++);return xr.length===0?Promise.resolve(Tr):at(Ae)(xr.map(function(Hr){return{action:st,body:Hr}}),mr).then(function(Hr){return Tr.objectIDs=Tr.objectIDs.concat(Hr.objectIDs),Tr.taskIDs.push(Hr.taskID),Mr++,Rr(Mr)})}(),function(Rr,Mr){return Promise.all(Rr.taskIDs.map(function(zr){return ci(Ae)(zr,Mr)}))})}},Je=function(Ae){return function(We){return f(Ae.transporter.write({method:I,path:T("1/indexes/%s/clear",Ae.indexName)},We),function(st,vt){return ci(Ae)(st.taskID,vt)})}},Be=function(Ae){return function(We){var st=We||{},vt=st.forwardToReplicas,Ft=v(o(st,["forwardToReplicas"]));return vt&&(Ft.queryParameters.forwardToReplicas=1),f(Ae.transporter.write({method:I,path:T("1/indexes/%s/rules/clear",Ae.indexName)},Ft),function(ur,mr){return ci(Ae)(ur.taskID,mr)})}},$e=function(Ae){return function(We){var st=We||{},vt=st.forwardToReplicas,Ft=v(o(st,["forwardToReplicas"]));return vt&&(Ft.queryParameters.forwardToReplicas=1),f(Ae.transporter.write({method:I,path:T("1/indexes/%s/synonyms/clear",Ae.indexName)},Ft),function(ur,mr){return ci(Ae)(ur.taskID,mr)})}},ut=function(Ae){return function(We,st){return f(Ae.transporter.write({method:I,path:T("1/indexes/%s/deleteByQuery",Ae.indexName),data:We},st),function(vt,Ft){return ci(Ae)(vt.taskID,Ft)})}},ke=function(Ae){return function(We){return f(Ae.transporter.write({method:E,path:T("1/indexes/%s",Ae.indexName)},We),function(st,vt){return ci(Ae)(st.taskID,vt)})}},Te=function(Ae){return function(We,st){return f(Ee(Ae)([We],st).then(function(vt){return{taskID:vt.taskIDs[0]}}),function(vt,Ft){return ci(Ae)(vt.taskID,Ft)})}},Ee=function(Ae){return function(We,st){var vt=We.map(function(Ft){return{objectID:Ft}});return ze(Ae)(vt,co.DeleteObject,st)}},Ge=function(Ae){return function(We,st){var vt=st||{},Ft=vt.forwardToReplicas,ur=v(o(vt,["forwardToReplicas"]));return Ft&&(ur.queryParameters.forwardToReplicas=1),f(Ae.transporter.write({method:E,path:T("1/indexes/%s/rules/%s",Ae.indexName,We)},ur),function(mr,Tr){return ci(Ae)(mr.taskID,Tr)})}},Qt=function(Ae){return function(We,st){var vt=st||{},Ft=vt.forwardToReplicas,ur=v(o(vt,["forwardToReplicas"]));return Ft&&(ur.queryParameters.forwardToReplicas=1),f(Ae.transporter.write({method:E,path:T("1/indexes/%s/synonyms/%s",Ae.indexName,We)},ur),function(mr,Tr){return ci(Ae)(mr.taskID,Tr)})}},jt=function(Ae){return function(We){return Or(Ae)(We).then(function(){return!0}).catch(function(st){if(st.status!==404)throw st;return!1})}},or=function(Ae){return function(We,st,vt){return Ae.transporter.read({method:I,path:T("1/answers/%s/prediction",Ae.indexName),data:{query:We,queryLanguages:st},cacheable:!0},vt)}},yr=function(Ae){return function(We,st){var vt=st||{},Ft=vt.query,ur=vt.paginate,mr=o(vt,["query","paginate"]),Tr=0;return function Rr(){return Fn(Ae)(Ft||"",i(i({},mr),{},{page:Tr})).then(function(Mr){for(var zr=0,xr=Object.entries(Mr.hits);zr<xr.length;zr++){var Hr=s(xr[zr],2),Hn=Hr[0],Wn=Hr[1];if(We(Wn))return{object:Wn,position:parseInt(Hn,10),page:Tr}}if(Tr++,ur===!1||Tr>=Mr.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return Rr()})}()}},rr=function(Ae){return function(We,st){return Ae.transporter.read({method:O,path:T("1/indexes/%s/%s",Ae.indexName,We)},st)}},br=function(){return function(Ae,We){for(var st=0,vt=Object.entries(Ae.hits);st<vt.length;st++){var Ft=s(vt[st],2),ur=Ft[0];if(Ft[1].objectID===We)return parseInt(ur,10)}return-1}},Wr=function(Ae){return function(We,st){var vt=st||{},Ft=vt.attributesToRetrieve,ur=o(vt,["attributesToRetrieve"]),mr=We.map(function(Tr){return i({indexName:Ae.indexName,objectID:Tr},Ft?{attributesToRetrieve:Ft}:{})});return Ae.transporter.read({method:I,path:"1/indexes/*/objects",data:{requests:mr}},ur)}},Fr=function(Ae){return function(We,st){return Ae.transporter.read({method:O,path:T("1/indexes/%s/rules/%s",Ae.indexName,We)},st)}},Or=function(Ae){return function(We){return Ae.transporter.read({method:O,path:T("1/indexes/%s/settings",Ae.indexName),data:{getVersion:2}},We)}},Ur=function(Ae){return function(We,st){return Ae.transporter.read({method:O,path:T("1/indexes/%s/synonyms/%s",Ae.indexName,We)},st)}},En=function(Ae){return function(We,st){return f(rn(Ae)([We],st).then(function(vt){return{objectID:vt.objectIDs[0],taskID:vt.taskIDs[0]}}),function(vt,Ft){return ci(Ae)(vt.taskID,Ft)})}},rn=function(Ae){return function(We,st){var vt=st||{},Ft=vt.createIfNotExists,ur=o(vt,["createIfNotExists"]),mr=Ft?co.PartialUpdateObject:co.PartialUpdateObjectNoCreate;return ze(Ae)(We,mr,ur)}},Vr=function(Ae){return function(We,st){var vt=st||{},Ft=vt.safe,ur=vt.autoGenerateObjectIDIfNotExist,mr=vt.batchSize,Tr=o(vt,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),Rr=function(Wn,ei,uo,_a){return f(Ae.transporter.write({method:I,path:T("1/indexes/%s/operation",Wn),data:{operation:uo,destination:ei}},_a),function(ho,ds){return ci(Ae)(ho.taskID,ds)})},Mr=Math.random().toString(36).substring(7),zr="".concat(Ae.indexName,"_tmp_").concat(Mr),xr=On({appId:Ae.appId,transporter:Ae.transporter,indexName:zr}),Hr=[],Hn=Rr(Ae.indexName,zr,"copy",i(i({},Tr),{},{scope:["settings","synonyms","rules"]}));return Hr.push(Hn),f((Ft?Hn.wait(Tr):Hn).then(function(){var Wn=xr(We,i(i({},Tr),{},{autoGenerateObjectIDIfNotExist:ur,batchSize:mr}));return Hr.push(Wn),Ft?Wn.wait(Tr):Wn}).then(function(){var Wn=Rr(zr,Ae.indexName,"move",Tr);return Hr.push(Wn),Ft?Wn.wait(Tr):Wn}).then(function(){return Promise.all(Hr)}).then(function(Wn){var ei=s(Wn,3),uo=ei[0],_a=ei[1],ho=ei[2];return{objectIDs:_a.objectIDs,taskIDs:[uo.taskID].concat(l(_a.taskIDs),[ho.taskID])}}),function(Wn,ei){return Promise.all(Hr.map(function(uo){return uo.wait(ei)}))})}},Dr=function(Ae){return function(We,st){return pn(Ae)(We,i(i({},st),{},{clearExistingRules:!0}))}},Kr=function(Ae){return function(We,st){return zi(Ae)(We,i(i({},st),{},{clearExistingSynonyms:!0}))}},Xr=function(Ae){return function(We,st){return f(On(Ae)([We],st).then(function(vt){return{objectID:vt.objectIDs[0],taskID:vt.taskIDs[0]}}),function(vt,Ft){return ci(Ae)(vt.taskID,Ft)})}},On=function(Ae){return function(We,st){var vt=st||{},Ft=vt.autoGenerateObjectIDIfNotExist,ur=o(vt,["autoGenerateObjectIDIfNotExist"]),mr=Ft?co.AddObject:co.UpdateObject;if(mr===co.UpdateObject){var Tr=!0,Rr=!1,Mr=void 0;try{for(var zr,xr=We[Symbol.iterator]();!(Tr=(zr=xr.next()).done);Tr=!0)if(zr.value.objectID===void 0)return f(Promise.reject({name:"MissingObjectIDError",message:"All objects must have an unique objectID (like a primary key) to be valid. Algolia is also able to generate objectIDs automatically but *it's not recommended*. To do it, use the `{'autoGenerateObjectIDIfNotExist': true}` option."}))}catch(Hr){Rr=!0,Mr=Hr}finally{try{Tr||xr.return==null||xr.return()}finally{if(Rr)throw Mr}}}return ze(Ae)(We,mr,ur)}},$r=function(Ae){return function(We,st){return pn(Ae)([We],st)}},pn=function(Ae){return function(We,st){var vt=st||{},Ft=vt.forwardToReplicas,ur=vt.clearExistingRules,mr=v(o(vt,["forwardToReplicas","clearExistingRules"]));return Ft&&(mr.queryParameters.forwardToReplicas=1),ur&&(mr.queryParameters.clearExistingRules=1),f(Ae.transporter.write({method:I,path:T("1/indexes/%s/rules/batch",Ae.indexName),data:We},mr),function(Tr,Rr){return ci(Ae)(Tr.taskID,Rr)})}},on=function(Ae){return function(We,st){return zi(Ae)([We],st)}},zi=function(Ae){return function(We,st){var vt=st||{},Ft=vt.forwardToReplicas,ur=vt.clearExistingSynonyms,mr=vt.replaceExistingSynonyms,Tr=v(o(vt,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return Ft&&(Tr.queryParameters.forwardToReplicas=1),(mr||ur)&&(Tr.queryParameters.replaceExistingSynonyms=1),f(Ae.transporter.write({method:I,path:T("1/indexes/%s/synonyms/batch",Ae.indexName),data:We},Tr),function(Rr,Mr){return ci(Ae)(Rr.taskID,Mr)})}},Fn=function(Ae){return function(We,st){return Ae.transporter.read({method:I,path:T("1/indexes/%s/query",Ae.indexName),data:{query:We},cacheable:!0},st)}},Gn=function(Ae){return function(We,st,vt){return Ae.transporter.read({method:I,path:T("1/indexes/%s/facets/%s/query",Ae.indexName,We),data:{facetQuery:st},cacheable:!0},vt)}},_i=function(Ae){return function(We,st){return Ae.transporter.read({method:I,path:T("1/indexes/%s/rules/search",Ae.indexName),data:{query:We}},st)}},Qo=function(Ae){return function(We,st){return Ae.transporter.read({method:I,path:T("1/indexes/%s/synonyms/search",Ae.indexName),data:{query:We}},st)}},vi=function(Ae){return function(We,st){var vt=st||{},Ft=vt.forwardToReplicas,ur=v(o(vt,["forwardToReplicas"]));return Ft&&(ur.queryParameters.forwardToReplicas=1),f(Ae.transporter.write({method:R,path:T("1/indexes/%s/settings",Ae.indexName),data:We},ur),function(mr,Tr){return ci(Ae)(mr.taskID,Tr)})}},ci=function(Ae){return function(We,st){return p(function(vt){return function(Ft){return function(ur,mr){return Ft.transporter.read({method:O,path:T("1/indexes/%s/task/%s",Ft.indexName,ur.toString())},mr)}}(Ae)(We,st).then(function(Ft){return Ft.status!=="published"?vt():void 0})})}},co={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},xa={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},qi=1,Vo=2,xs=3,ui=function(Ae){return function(We,st){var vt=We.map(function(Ft){return i(i({},Ft),{},{threshold:Ft.threshold||0})});return Ae.transporter.read({method:I,path:"1/indexes/*/recommendations",data:{requests:vt},cacheable:!0},st)}},bi=function(Ae){return function(We,st){return ui(Ae)(We.map(function(vt){return i(i({},vt),{},{fallbackParameters:{},model:"bought-together"})}),st)}},Jo=function(Ae){return function(We,st){return ui(Ae)(We.map(function(vt){return i(i({},vt),{},{model:"related-products"})}),st)}},se=function(Ae){return function(We,st){var vt=We.map(function(Ft){return i(i({},Ft),{},{model:"trending-facets",threshold:Ft.threshold||0})});return Ae.transporter.read({method:I,path:"1/indexes/*/recommendations",data:{requests:vt},cacheable:!0},st)}},Ve=function(Ae){return function(We,st){var vt=We.map(function(Ft){return i(i({},Ft),{},{model:"trending-items",threshold:Ft.threshold||0})});return Ae.transporter.read({method:I,path:"1/indexes/*/recommendations",data:{requests:vt},cacheable:!0},st)}},_e=function(Ae){return function(We,st){return ui(Ae)(We.map(function(vt){return i(i({},vt),{},{model:"looking-similar"})}),st)}},qe=function(Ae){return function(We,st){var vt=We.map(function(Ft){return i(i({},Ft),{},{model:"recommended-for-you",threshold:Ft.threshold||0})});return Ae.transporter.read({method:I,path:"1/indexes/*/recommendations",data:{requests:vt},cacheable:!0},st)}};function ct(Ae,We,st){var vt,Ft={appId:Ae,apiKey:We,timeouts:{connect:1,read:2,write:30},requester:{send:function(Tr){return new Promise(function(Rr){var Mr=new XMLHttpRequest;Mr.open(Tr.method,Tr.url,!0),Object.keys(Tr.headers).forEach(function(Hn){return Mr.setRequestHeader(Hn,Tr.headers[Hn])});var zr,xr=function(Hn,Wn){return setTimeout(function(){Mr.abort(),Rr({status:0,content:Wn,isTimedOut:!0})},1e3*Hn)},Hr=xr(Tr.connectTimeout,"Connection timeout");Mr.onreadystatechange=function(){Mr.readyState>Mr.OPENED&&zr===void 0&&(clearTimeout(Hr),zr=xr(Tr.responseTimeout,"Socket timeout"))},Mr.onerror=function(){Mr.status===0&&(clearTimeout(Hr),clearTimeout(zr),Rr({content:Mr.responseText||"Network request failed",status:Mr.status,isTimedOut:!1}))},Mr.onload=function(){clearTimeout(Hr),clearTimeout(zr),Rr({content:Mr.responseText,status:Mr.status,isTimedOut:!1})},Mr.send(Tr.data)})}},logger:(vt=xs,{debug:function(Tr,Rr){return qi>=vt&&console.debug(Tr,Rr),Promise.resolve()},info:function(Tr,Rr){return Vo>=vt&&console.info(Tr,Rr),Promise.resolve()},error:function(Tr,Rr){return console.error(Tr,Rr),Promise.resolve()}}),responsesCache:d(),requestsCache:d({serializable:!1}),hostsCache:u({caches:[c({key:"".concat("4.23.2","-").concat(Ae)}),d()]}),userAgent:N("4.23.2").add({segment:"Browser"})},ur=i(i({},Ft),st),mr=function(){return function(Tr){return function(Rr){var Mr=Rr.region||"us",zr=h(y.WithinHeaders,Rr.appId,Rr.apiKey),xr=j(i(i({hosts:[{url:"personalization.".concat(Mr,".algolia.com")}]},Rr),{},{headers:i(i(i({},zr.headers()),{"content-type":"application/json"}),Rr.headers),queryParameters:i(i({},zr.queryParameters()),Rr.queryParameters)}));return g({appId:Rr.appId,transporter:xr},Rr.methods)}(i(i(i({},Ft),Tr),{},{methods:{getPersonalizationStrategy:ne,setPersonalizationStrategy:le}}))}};return function(Tr){var Rr=Tr.appId,Mr=h(Tr.authMode!==void 0?Tr.authMode:y.WithinHeaders,Rr,Tr.apiKey),zr=j(i(i({hosts:[{url:"".concat(Rr,"-dsn.algolia.net"),accept:Q.Read},{url:"".concat(Rr,".algolia.net"),accept:Q.Write}].concat(m([{url:"".concat(Rr,"-1.algolianet.com")},{url:"".concat(Rr,"-2.algolianet.com")},{url:"".concat(Rr,"-3.algolianet.com")}]))},Tr),{},{headers:i(i(i({},Mr.headers()),{"content-type":"application/x-www-form-urlencoded"}),Tr.headers),queryParameters:i(i({},Mr.queryParameters()),Tr.queryParameters)}));return g({transporter:zr,appId:Rr,addAlgoliaAgent:function(xr,Hr){zr.userAgent.add({segment:xr,version:Hr})},clearCache:function(){return Promise.all([zr.requestsCache.clear(),zr.responsesCache.clear()]).then(function(){})}},Tr.methods)}(i(i({},ur),{},{methods:{search:Ht,searchForFacetValues:Gt,multipleBatch:ht,multipleGetObjects:kt,multipleQueries:Ht,copyIndex:Pe,copySettings:Ce,copySynonyms:Le,copyRules:pe,moveIndex:Zt,listIndices:Vt,getLogs:yt,listClusters:Pt,multipleSearchForFacetValues:Gt,getApiKey:rt,addApiKey:oe,listApiKeys:_t,updateApiKey:Fe,deleteApiKey:De,restoreApiKey:_r,assignUserID:ie,assignUserIDs:he,getUserID:Xe,searchUserIDs:He,listUserIDs:qt,getTopUserIDs:ge,removeUserID:fr,hasPendingMappings:pt,clearDictionaryEntries:we,deleteDictionaryEntries:ot,getDictionarySettings:wt,getAppTask:dt,replaceDictionaryEntries:tr,saveDictionaryEntries:Jt,searchDictionaryEntries:Qr,setDictionarySettings:Re,waitAppTask:Ye,customRequest:Oe,initIndex:function(Tr){return function(Rr){return ft(Tr)(Rr,{methods:{batch:at,delete:ke,findAnswers:or,getObject:rr,getObjects:Wr,saveObject:Xr,saveObjects:On,search:Fn,searchForFacetValues:Gn,waitTask:ci,setSettings:vi,getSettings:Or,partialUpdateObject:En,partialUpdateObjects:rn,deleteObject:Te,deleteObjects:Ee,deleteBy:ut,clearObjects:Je,browseObjects:Lt,getObjectPosition:br,findObject:yr,exists:jt,saveSynonym:on,saveSynonyms:zi,getSynonym:Ur,searchSynonyms:Qo,browseSynonyms:Ze,deleteSynonym:Qt,clearSynonyms:$e,replaceAllObjects:Vr,replaceAllSynonyms:Kr,searchRules:_i,getRule:Fr,deleteRule:Ge,saveRule:$r,saveRules:pn,replaceAllRules:Dr,browseRules:Se,clearRules:Be}})}},initAnalytics:function(){return function(Tr){return function(Rr){var Mr=Rr.region||"us",zr=h(y.WithinHeaders,Rr.appId,Rr.apiKey),xr=j(i(i({hosts:[{url:"analytics.".concat(Mr,".algolia.com")}]},Rr),{},{headers:i(i(i({},zr.headers()),{"content-type":"application/json"}),Rr.headers),queryParameters:i(i({},zr.queryParameters()),Rr.queryParameters)}));return g({appId:Rr.appId,transporter:xr},Rr.methods)}(i(i(i({},Ft),Tr),{},{methods:{addABTest:$,getABTest:ce,getABTests:Qe,stopABTest:me,deleteABTest:te}}))}},initPersonalization:mr,initRecommendation:function(){return function(Tr){return ur.logger.info("The `initRecommendation` method is deprecated. Use `initPersonalization` instead."),mr()(Tr)}},getRecommendations:ui,getFrequentlyBoughtTogether:bi,getLookingSimilar:_e,getRecommendedForYou:qe,getRelatedProducts:Jo,getTrendingFacets:se,getTrendingItems:Ve}}))}return ct.version="4.23.2",ct})})(Cwe);var RGt=Cwe.exports;const NGt=nIt(RGt);let Mwe=class{constructor(t,r,n="https://api.pennsieve.io"){this.client=NGt(t,r),this.PENNSIEVE_API_LOCATION=n,this.anatomyFacetLabels=[]}initIndex(t){this.index=this.client.initIndex(t)}getAlgoliaFacets(t){const r=t.map(s=>s.facetPropPath),n=t.map(s=>s.facetSubpropPath);let i=[],o=0;return this.index.search("",{sortFacetValuesBy:"alpha",facets:r.concat(n)}).then(s=>(r.map(l=>{const c=t.find(f=>f.facetPropPath==l);var u=[];const d=s.facets;if(d===void 0)return;const h=d[l]==null?{}:d[l],p=c&&d[c.facetSubpropPath]?Object.keys(d[c.facetSubpropPath]):[];Object.keys(h).map(f=>{const m=p.reduce((T,y)=>{const v=y.split(".");return v.length!==2||f===v[0]&&T.push({label:v[1],id:o++,facetPropPath:`${c?c.facetSubpropPath:void 0}`}),T},[]);let g={label:f,id:o++,facetPropPath:l};m.length>0&&(g.children=m),u.push(g)}),u.length>0&&i.push({label:c?c.label:"",id:o++,children:u,key:l})}),i))}_discoverAllDois(t,r="https://api.pennsieve.io"){return new Promise(n=>{fetch(`${r}/discover/datasets/${t}/versions`).then(i=>i.json()).then(i=>{n(i.map(o=>o.doi))})})}_expandDois(t,r="https://api.pennsieve.io"){return new Promise(n=>{let i=t.map(o=>this._discoverAllDois(o,r));Promise.all(i).then(o=>{n(o.flat())})})}_processResultsForCards(t){let r=[],n={};for(let i of t)n={...i},n={anatomy:i.anatomy?i.anatomy.organ.map(o=>o.curie):void 0,doi:i.item.curie.split(":")[1],name:i.item.name,description:i.item.description,updated:i.pennsieve?i.pennsieve.updatedAt:void 0,publishDate:i.pennsieve?i.pennsieve.publishDate:void 0,datasetId:i.objectID,detailsReady:!1},r.push(n);return r}_processAnatomy(t){let r=[],n=[],i=[],o=[];return t.forEach(s=>{s.item&&s.item.keywords&&s.item.keywords.forEach(l=>{let c=l.keyword.toUpperCase();(c.includes("UBERON")||c.includes("ILX"))&&r.push(this._processUberonURL(c))}),s.anatomy&&s.anatomy.organ&&s.anatomy.organ.forEach(l=>{l.curie&&(r.push(l.curie),n.push(l.name))})}),o=[...new Set(r)],i=[...new Set(n)],this.anatomyFacetLabels=i,o}_processUberonURL(t){return t.split("/").pop().replace("_",":")}search(t,r="",n=10,i=1){return new Promise(o=>{this.index.search(r,{facets:["*"],hitsPerPage:n,page:i-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["pennsieve.publishDate","pennsieve.updatedAt","item.curie","item.name","item.description","objectID","anatomy.organ.curie"]}).then(s=>{let l={items:this._processResultsForCards(s.hits),total:s.nbHits,discoverIds:s.hits.map(c=>c.pennsieve?c.pennsieve.identifier:c.objectID),dois:s.hits.map(c=>c.item.curie.split(":")[1])};o(l)})})}anatomyInSearch(t,r="",n=999999,i=1){return new Promise(o=>{this.index.search(r,{facets:["*"],hitsPerPage:n,page:i-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["objectID","item.keywords.keyword","anatomy.organ.name","anatomy.organ.curie"]}).then(s=>{o({forFlatmap:this.processResultsForFlatmap(s.hits),forScaffold:this.processResultsForScaffold(s.hits)})})})}processResultsForFlatmap(t){return t.map(r=>({id:r.objectID,terms:r.anatomy?r.anatomy.organ.map(n=>n.curie):[]}))}processResultsForScaffold(t){let r={};return t.forEach(n=>{n.anatomy&&n.anatomy.organ&&n.anatomy.organ.forEach(i=>{i.name&&(r[i.name]?r[i.name]++:r[i.name]=1)})}),r}};const jte=[{label:"Data Type",id:"item.types",facetPropPath:"item.types.name",facetSubpropPath:"item.types.subcategory.name"},{label:"Anatomical Structure",id:"anatomy.organ.category",facetPropPath:"anatomy.organ.category.name",facetSubpropPath:"anatomy.organ.subcategory.name",facetFilterPath:"anatomy.organ.name"},{label:"Species",id:"organisms.primary.species",facetPropPath:"organisms.primary.species.name",facetSubpropPath:"organisms.primary.species.subcategory.name"},{label:"Experimental Approach",id:"item.modalities",facetPropPath:"item.modalities.keyword",facetSubpropPath:"item.modalities.subcategory.name"},{label:"Sex",id:"attributes.subject.sex",facetPropPath:"attributes.subject.sex.value",facetSubpropPath:"attributes.subject.sex.subcategory.name"},{label:"Age Categories",id:"attributes.subject.ageCategory",facetPropPath:"attributes.subject.ageCategory.value",facetSubpropPath:"attributes.subject.ageCategory.subcategory.name"}];function Ewe(e=void 0){if(e===void 0)return"NOT item.published.status:embargo";e.forEach(n=>n.label=n.facet);let t=BGt(e),r="NOT item.published.status:embargo";return r=`(${r}) AND `,jte.map(n=>n.facetPropPath).map(n=>{let i=t.filter(l=>l.facetPropPath==n),o="",s="";i.map(l=>{let c=l.facetSubPropPath?l.facetSubPropPath:n;l.AND?s+=`AND "${c}":"${l.label}"`:o+=`"${c}":"${l.label}" OR `}),!(o==""&&s=="")&&(o=`(${o.substring(0,o.lastIndexOf(" OR "))})`,r+=`${o+s} AND `,r=r.split("()AND ").join(""))}),r.substring(0,r.lastIndexOf(" AND "))}function BGt(e){return e.filter(t=>t.label!=="Show all")}const TN=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},Ute=function(e){const t=e.toLowerCase();return yN[t]?TN(yN[t]):TN(t)},FGt={name:"SearchFilters",components:{MapSvgIcon:CGt,MapSvgSpriteColor:HGt,Option:LR,Select:Sk,Popover:Cee,Cascader:Pbe},props:{entry:Object,envVars:{type:Object,default:()=>{}}},data:function(){return{cascaderIsReady:!1,previousShowAllChecked:{species:!1,gender:!1,organ:!1,datasets:!1},showFilters:!0,showFiltersText:!0,cascadeSelected:[],cascadeSelectedWithBoolean:[],numberShown:10,filters:[],facets:["Species","Gender","Organ","Datasets"],numberDatasetsShown:["10","20","50"],props:{multiple:!0},options:[{value:"Species",label:"Species",children:[{}]}],presentTags:[]}},setup(){const e=a.markRaw({}),t=a.markRaw({term:new Set,facet:new Set,facet2:new Set});return{cascaderTags:e,correctnessCheck:t}},computed:{numberOfResultsText:function(){return`${this.entry.numberOfHits} results | Showing`}},methods:{createCascaderItemValue:function(e,t=void 0,r=void 0){let n=e;return t&&(n=`${e}>${t}`),t&&r&&(n=`${e}>${t}>${r}`),!t&&r&&console.warn(`Warning: ${r} provided without its parent, this will not be shown in the cascader`),n},populateCascader:function(){return new Promise(e=>{this.algoliaClient.getAlgoliaFacets(jte).then(t=>{this.facets=t,Lc.emit("available-facets",t),this.options=t,this.options.forEach((r,n)=>{this.options[n].total=this.countTotalFacet(r),this.options[n].label=Ute(r.label),this.options[n].value=this.createCascaderItemValue(r.key,void 0),this.options[n].children.unshift({value:this.createCascaderItemValue("Show all"),label:"Show all"}),this.options[n].children.forEach((i,o)=>{this.options[n].children[o].label=Ute(i.label),this.options[n].children[o].value=this.createCascaderItemValue(r.label,i.label),this.options[n].children[o].children&&this.options[n].children[o].children.length>0&&this.options[n].children[o].children.forEach((s,l)=>{this.options[n].children[o].children[l].label=Ute(s.label),this.options[n].children[o].children[l].value=this.createCascaderItemValue(r.label,i.label,s.label)})})})}).finally(()=>{e()})})},cascadeTagClose:function(e){let t=[];Object.entries(this.cascaderTags).map(r=>{const n=r[0],i=r[1],o=this.options.filter(l=>l.label==n)[0],s=o.key;for(let l=0;l<o.children.length;l++){const c=o.children[l],u=c.label,d=c.value;if(Array.isArray(i))if(i.length===0&&u.toLowerCase()==="show all"){t.push([s,d]);break}else u!==e&&i.includes(u)&&t.push([s,d]);else Object.entries(i).map(h=>{const p=h[0],f=h[1];p===u&&c.children.map(m=>{const g=m.label,T=m.value;g!==e&&f.includes(g)&&t.push([s,T])})})}}),this.cascadeEvent(t)},tagsChangedCallback:function(e){this.correctnessCheck.term&&this.correctnessCheck.facet&&this.correctnessCheck.facet2&&this.options.map(t=>{this.correctnessCheck.term.add(t.label),t.children.map(r=>{this.correctnessCheck.facet.add(r.label),t.label==="Anatomical structure"&&r.label!=="Show all"&&r.children.map(n=>{this.correctnessCheck.facet2.add(n.label)})})}),this.cascaderTags={},this.presentTags=[],e.map(t=>{const{facet:r,facet2:n,term:i}=t;this.correctnessCheck.term.has(i)&&this.correctnessCheck.facet.has(r)&&(n?this.correctnessCheck.facet2.has(n)&&(i in this.cascaderTags?r in this.cascaderTags[i]?this.cascaderTags[i][r].push(n):this.cascaderTags[i][r]=[n]:(this.cascaderTags[i]={},this.cascaderTags[i][r]=[n])):i in this.cascaderTags&&i!=="Anatomical structure"?this.cascaderTags[i].push(r):r.toLowerCase()!=="show all"?this.cascaderTags[i]=[r]:this.cascaderTags[i]=[])}),Object.values(this.cascaderTags).map(t=>{const r=Array.isArray(t)?t:Object.values(t).flat(1);this.presentTags=[...this.presentTags,...r]}),this.presentTags=[...new Set(this.presentTags)],this.presentTags.length>0?this.showFiltersText=!1:this.showFiltersText=!0},countTotalFacet:function(e){return["anatomy.organ.category.name"].includes(e.key)?e.children.reduce((t,r)=>(t=typeof t=="number"?t:t.children.length,t+r.children.length)):e.children.length},showAllEventModifierForAutoCheckAll:function(e){const t={};return e.map(r=>{const n=r[0];n in t?t[n]+=1:t[n]=1}),this.options.map(r=>{const n=r.key,i=r.children.filter(s=>s.label==="Show all")[0].value,o=r.total;t[n]===o&&(e=e.filter(s=>s[0]!==r.key),delete t[n]),n in t||e.unshift([n,i])}),e},cascadeEvent:function(e){let t=[...e];if(t){if(t=this.showAllEventModifier(t),t=this.showAllEventModifierForAutoCheckAll(t),this.__expandItem__){let i=0;this.__expandItem__.length>1&&(i=1);const o=t.filter(l=>l[i]==this.__expandItem__[i]),s=t.filter(l=>l[i]!==this.__expandItem__[i]);t=[...o,...s]}let r=t.filter(i=>i!==void 0).map(i=>{let{hString:o,bString:s}=this.findHierarachyStringAndBooleanString(i),{facet:l,facet2:c,term:u}=this.getFacetsFromHierarchyString(o);return{facetPropPath:i[0],facet:l,facet2:c,term:u,AND:s}}),n=t.filter(i=>i!==void 0).map(i=>{let o,s=i[0].includes("duplicate")?i[0].split("duplicate")[0]:i[0],{hString:l,bString:c}=this.findHierarachyStringAndBooleanString(i),{facet:u,facet2:d,term:h}=this.getFacetsFromHierarchyString(l);return d&&(u=d,o="anatomy.organ.name"),{facetPropPath:s,facet:u,term:h,AND:c,facetSubPropPath:o}});this.$emit("loading",!0),this.$emit("filterResults",n),this.setCascader(r),this.cssMods()}},findHierarachyStringAndBooleanString(e){let t,r;return e.length>=3?e[2]&&(typeof e[2]=="string"||e[2]instanceof String)&&e[2].split(">").length>2?(t=e[2],r=e.length==4?e[3]:void 0):(t=e[1],r=e[2]):(t=e[1],r=void 0),{hString:t,bString:r}},getFacetsFromHierarchyString(e){let t,r,n,i=e.split(">");return i.length==3?(n=i[2],t=i[1],r=i[0]):(t=i[1],r=i[0]),{facet:t,facet2:n,term:r}},showAllEventModifier:function(e){if(e.map(t=>t?t[1].toLowerCase().includes("show all"):!1).includes(!0)){let t=[],r={};for(const n in e)r[e[n][0]]===void 0&&(r[e[n][0]]=[]),r[e[n][0]].push(e[n]);for(const n in r){let i;for(let o=r[n].length-1;o>=0;o--)if(r[n][o][1].toLowerCase().includes("show all")){i=r[n].splice(o,1)[0];break}i?this.previousShowAllChecked[n]&&r[n].length>0?t.push(...r[n]):t.push(i):t.push(...r[n])}return t.sort((n,i)=>this.__expandItem__?n[0]==this.__expandItem__?i[0]==this.__expandItem__?0:-1:i[0]==this.__expandItem__?n[0]==this.__expandItem__?0:1:0:0)}return e},cascadeExpandChange:function(e){this.__expandItem__=e,this.cssMods()},numberShownChanged:function(e){this.$emit("numberPerPage",parseInt(e))},updatePreviousShowAllChecked:function(e){for(const t in this.previousShowAllChecked)this.previousShowAllChecked[t]=!1;e.forEach(t=>{t[1].toLowerCase().includes("show all")&&(this.previousShowAllChecked[t[0]]=!0)})},setCascader:function(e){if(this.cascaderIsReady&&e&&e.length!=0){const t=r=>{let n=[r.facetPropPath,this.createCascaderItemValue(TN(r.term),r.facet)];return r.facet2&&n.push(this.createCascaderItemValue(TN(r.term),r.facet,r.facet2)),n};this.cascadeSelected=e.map(r=>t(r)),this.cascadeSelectedWithBoolean=e.map(r=>{let n=t(r);return n.push(r.AND),n}),this.updatePreviousShowAllChecked(this.cascadeSelected)}this.tagsChangedCallback(e)},addFilter:function(e){if(this.cascaderIsReady&&e){let t=this.validateAndConvertFilterToHierarchical(e);if(t)return this.cascadeSelected.filter(r=>r.term!=t.term),this.cascadeSelected.push([t.facetPropPath,this.createCascaderItemValue(t.term,t.facet),this.createCascaderItemValue(t.term,t.facet,t.facet2)]),this.cascadeSelectedWithBoolean.push([t.facetPropPath,this.createCascaderItemValue(t.term,t.facet),this.createCascaderItemValue(t.term,t.facet,t.facet2),t.AND]),!0}},initiateSearch:function(){this.cascadeEvent(this.cascadeSelectedWithBoolean)},checkShowAllBoxes:function(){this.setCascader(this.options.map(e=>({facetPropPath:e.value,term:e.label,facet:"Show all"})))},makeCascadeLabelsClickable:function(){this.$nextTick(()=>{document.querySelectorAll(".sidebar-cascader-popper .el-cascader-node__label").forEach(e=>{e.onclick=function(){const t=this.previousElementSibling;t&&(t.parentElement.attributes["aria-owns"]||this.previousElementSibling.click())}})})},cssMods:function(){this.makeCascadeLabelsClickable(),this.removeTopLevelCascaderCheckboxes()},removeTopLevelCascaderCheckboxes:function(){this.$nextTick(()=>{document.querySelectorAll(".sidebar-cascader-popper .el-cascader-menu__list")[0].querySelectorAll(".el-checkbox__input").forEach(e=>e.style.display="none")})},validateAndConvertFilterToHierarchical:function(e){if(e&&e.facet&&e.term){if(e.facet2)return e;for(const t of this.options)if(t.value===e.facetPropPath)for(const r of t.children){if(r.label===e.facet)return e;if(r.children&&r.children.length>0){for(const n of r.children)if(n.label===e.facet)return e.facet2=n.label,e.facet=r.label,e}}}return!1},getHierarchicalValidatedFilters:function(e){if(e)if(this.cascaderIsReady){const t=[];return e.forEach(r=>{const n=this.validateAndConvertFilterToHierarchical(r);n&&t.push(n)}),t}else return e;return[]}},mounted:function(){this.algoliaClient=new Mwe(this.envVars.ALGOLIA_ID,this.envVars.ALGOLIA_KEY,this.envVars.PENNSIEVE_API_LOCATION),this.algoliaClient.initIndex(this.envVars.ALGOLIA_INDEX),this.populateCascader().then(()=>{this.cascaderIsReady=!0,this.checkShowAllBoxes(),this.setCascader(this.entry.filterFacets),this.cssMods(),this.$emit("cascaderReady")})}},DGt=e=>(a.pushScopeId("data-v-307e97be"),e=e(),a.popScopeId(),e),zGt={class:"filters"},jGt={key:0,class:"cascader-tag"},UGt={class:"el-tags-container"},GGt={class:"el-tags-container"},WGt={class:"search-filters transition-box"},qGt={key:0,class:"filter-default-value"},ZGt=DGt(()=>a.createElementVNode("div",null,[a.createElementVNode("strong",null,"Within categories:"),a.createTextVNode(" OR "),a.createElementVNode("br"),a.createTextVNode(" example: 'heart' OR 'colon' "),a.createElementVNode("br"),a.createElementVNode("br"),a.createElementVNode("strong",null,"Between categories:"),a.createTextVNode(" AND "),a.createElementVNode("br"),a.createTextVNode(" example: 'rat' AND 'lung' ")],-1)),XGt={class:"dataset-shown"},KGt={class:"dataset-results-feedback"};function YGt(e,t,r,n,i,o){const s=a.resolveComponent("MapSvgSpriteColor"),l=Bb,c=Cee,u=Pbe,d=a.resolveComponent("MapSvgIcon"),h=LR,p=Sk,f=CR;return a.openBlock(),a.createElementBlock("div",zGt,[a.createVNode(s),e.presentTags.length>0?(a.openBlock(),a.createElementBlock("div",jGt,[a.createVNode(l,{class:"ml-2",type:"info",closable:"",onClose:t[0]||(t[0]=m=>o.cascadeTagClose(e.presentTags[0]))},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(e.presentTags[0]),1)]),_:1}),e.presentTags.length>1?(a.openBlock(),a.createBlock(c,{key:0,placement:"bottom-start",width:200,trigger:"hover"},{default:a.withCtx(()=>[a.createElementVNode("div",UGt,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.presentTags.slice(1),(m,g)=>(a.openBlock(),a.createBlock(l,{key:g,class:"ml-2",type:"info",closable:"",onClose:T=>o.cascadeTagClose(m)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(m),1)]),_:2},1032,["onClose"]))),128))])]),reference:a.withCtx(()=>[a.createElementVNode("div",GGt,[e.presentTags.length>1?(a.openBlock(),a.createBlock(l,{key:0,class:"ml-2",type:"info"},{default:a.withCtx(()=>[a.createTextVNode(" +"+a.toDisplayString(e.presentTags.length-1),1)]),_:1})):a.createCommentVNode("",!0)])]),_:1})):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),a.createVNode(a.Transition,{name:"el-zoom-in-top"},{default:a.withCtx(()=>[a.withDirectives((a.openBlock(),a.createElementBlock("span",WGt,[a.createVNode(u,{class:"cascader",ref:"cascader",modelValue:e.cascadeSelected,"onUpdate:modelValue":t[1]||(t[1]=m=>e.cascadeSelected=m),size:"large",placeholder:" ","collapse-tags":!0,"collapse-tags-tooltip":"",options:e.options,props:e.props,onChange:t[2]||(t[2]=m=>o.cascadeEvent(m)),onExpandChange:o.cascadeExpandChange,"show-all-levels":!0,"popper-class":"sidebar-cascader-popper"},null,8,["modelValue","options","props","onExpandChange"]),e.showFiltersText?(a.openBlock(),a.createElementBlock("div",qGt,"Filters")):a.createCommentVNode("",!0),a.createVNode(c,{title:"How do filters work?",width:"250",trigger:"hover","append-to-body":!1,"popper-class":"popover"},{reference:a.withCtx(()=>[a.createVNode(d,{icon:"help",class:"help"})]),default:a.withCtx(()=>[ZGt]),_:1})])),[[a.vShow,e.showFilters],[f,!e.cascaderIsReady]])]),_:1}),a.createElementVNode("div",XGt,[a.createElementVNode("span",KGt,a.toDisplayString(o.numberOfResultsText),1),a.createVNode(p,{class:"number-shown-select",modelValue:e.numberShown,"onUpdate:modelValue":t[3]||(t[3]=m=>e.numberShown=m),placeholder:"10",onChange:t[4]||(t[4]=m=>o.numberShownChanged(m))},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.numberDatasetsShown,m=>(a.openBlock(),a.createBlock(h,{key:m,label:m,value:m},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])])}const Awe=W3(FGt,[["render",YGt],["__scopeId","data-v-307e97be"]]);var JGt=async function(e){if(!e.ok){let t=await e.json();throw t?new Error(t.message):new Error(e)}return e},$Gt={searchInput:"",lastSearch:"",results:[],numberOfHits:0,filter:[],loadingCards:!1,numberPerPage:10,page:1,pageModel:1,start:0,hasSearched:!1,contextCardEnabled:!1};const eWt={components:{SearchFilters:Awe,DatasetCard:z_e,SearchHistory:U_e,Button:np,Card:vbe,Drawer:wee,Icon:ms,Input:wk,Pagination:Ube},name:"SideBarContent",props:{visible:{type:Boolean,default:!1},isDrawer:{type:Boolean,default:!0},entry:{type:Object,default:()=>$Gt},envVars:{type:Object,default:()=>{}}},data:function(){return{...this.entry,bodyStyle:{flex:"1 1 auto","flex-flow":"column",display:"flex"},cascaderIsReady:!1}},computed:{filterEntry:function(){return{numberOfHits:this.numberOfHits,filterFacets:this.filter}}},methods:{hoverChanged:function(e){this.$emit("hover-changed",e)},resetSearch:function(){this.numberOfHits=0,this.discoverIds=[],this._dois=[],this.results=[],this.loadingCards=!1},openSearch:function(e,t=""){this.searchInput=t,this.resetPageNavigation(),this.cascaderIsReady?(this.filter=this.$refs.filtersRef.getHierarchicalValidatedFilters(e),e&&e.length>0&&this.filter&&this.filter.length===0?(this.$refs.filtersRef.checkShowAllBoxes(),this.resetSearch()):this.filter&&(this.searchAlgolia(this.filter,t),this.$refs.filtersRef.setCascader(this.filter))):(this.filter=e,(!e||e.length==0)&&this.searchAlgolia(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.resetPageNavigation(),this.searchAlgolia(this.filters,this.searchInput),this.$refs.searchHistory.selectValue="Full search history"},searchEvent:function(e=!1){(e.keyCode===13||e instanceof MouseEvent)&&(this.resetPageNavigation(),this.searchAlgolia(this.filters,this.searchInput),this.$refs.searchHistory.selectValue="Full search history",this.$refs.searchHistory.addSearchToHistory(this.filters,this.searchInput))},filterUpdate:function(e){this.filters=[...e],this.resetPageNavigation(),this.searchAlgolia(e,this.searchInput),this.$emit("search-changed",{value:e,type:"filter-update"})},searchAlgolia(e,t=""){this.loadingCards=!0,this.algoliaClient.anatomyInSearch(Ewe(e),t).then(r=>{Lc.emit("anatomy-in-datasets",r.forFlatmap),Lc.emit("number-of-datasets-for-anatomies",r.forScaffold)}),this.algoliaClient.search(Ewe(e),t,this.numberPerPage,this.page).then(r=>{this.numberOfHits=r.total,this.discoverIds=r.discoverIds,this._dois=r.dois,this.results=r.items,this.loadingCards=!1,this.scrollToTop(),this.$emit("search-changed",{value:this.searchInput,type:"query-update"}),this._abortController&&this._abortController.abort(),this._abortController=new AbortController;const n=this._abortController.signal;this.perItemSearch(n,{count:0})})},filtersLoading:function(e){this.loadingCards=e},numberPerPageUpdate:function(e){this.numberPerPage=e,this.pageChange(1)},pageChange:function(e){this.start=(e-1)*this.numberPerPage,this.page=e,this.searchAlgolia(this.filters,this.searchInput,this.numberPerPage,this.page)},handleMissingData:function(e){let t=this.results.findIndex(r=>r.doi===e);this.results[t]&&(this.results[t].detailsReady=!0)},perItemSearch:function(e,t){if(10>t.count){const r=this._dois.shift();r&&(t.count++,this.callSciCrunch(this.envVars.API_LOCATION,{dois:[r]},e).then(n=>{n.numberOfHits===0?this.handleMissingData(r):this.resultsProcessing(n),this.$refs.content.style["overflow-y"]="scroll",t.count--,this.perItemSearch(e,t)}).catch(n=>{n.name!=="AbortError"&&(this.handleMissingData(r),t.count--,this.perItemSearch(e,t))}),this.perItemSearch(e,t))}},scrollToTop:function(){this.$refs.content&&this.$refs.content.scroll({top:0,behavior:"smooth"})},resetPageNavigation:function(){this.start=0,this.page=1},resultsProcessing:function(e){this.lastSearch=this.searchInput,e.results.length!==0&&e.results.forEach(t=>{let r=this.results.findIndex(n=>t.doi?t.doi.includes(n.doi):!1);Object.assign(this.results[r],t),Object.assign(this.results[r],{numberSamples:t.sampleSize?parseInt(t.sampleSize):0,numberSubjects:t.subjectSize?parseInt(t.subjectSize):0,updated:(t.updated&&t.updated.length)>0?t.updated[0].timestamp.split("T")[0]:"",url:t.uri[0],datasetId:t.dataset_identifier,datasetRevision:t.dataset_revision,datasetVersion:t.dataset_version,organs:t.organs&&t.organs.length>0?[...new Set(t.organs.map(n=>n.name))]:void 0,species:t.organisms&&t.organisms[0].species?[...new Set(t.organisms.map(n=>n.species?n.species.name:null))]:void 0,scaffolds:t["abi-scaffold-metadata-file"],thumbnails:t["abi-thumbnail"]?t["abi-thumbnail"]:t["abi-scaffold-thumbnail"],scaffoldViews:t["abi-scaffold-view-file"],videos:t.video,plots:t["abi-plot"],images:t["common-images"],contextualInformation:t["abi-contextual-information"].length>0?t["abi-contextual-information"]:void 0,segmentation:t["mbf-segmentation"],simulation:t["abi-simulation-file"],additionalLinks:t.additionalLinks,detailsReady:!0}),this.results[r]=this.results[r]})},createfilterParams:function(e){let t=new URLSearchParams;for(const r in e)Array.isArray(e[r])?e[r].forEach(n=>{t.append(r,n)}):t.append(r,e[r]);return t.toString()},callSciCrunch:function(e,t={},r){return new Promise((n,i)=>{let o=this.envVars.API_LOCATION+this.searchEndpoint+"?"+this.createfilterParams(t);fetch(o,{signal:r}).then(JGt).then(s=>s.json()).then(s=>n(s)).catch(s=>i(s))})},getAlgoliaFacets:async function(){return await this.algoliaClient.getAlgoliaFacets(jte)},searchHistorySearch:function(e){this.searchInput=e.search,this.filters=e.filters,this.openSearch(e.filters,e.search)}},mounted:function(){this.algoliaClient=new Mwe(this.envVars.ALGOLIA_ID,this.envVars.ALGOLIA_KEY,this.envVars.PENNSIEVE_API_LOCATION),this.algoliaClient.initIndex(this.envVars.ALGOLIA_INDEX),this.openSearch(this.filter,this.searchInput)},created:function(){this.searchEndpoint="dataset_info/using_multiple_dois/"}},tWt={class:"header"},rWt={class:"content scrollbar",ref:"content"},nWt={key:0,class:"error-feedback"};function iWt(e,t,r,n,i,o){const s=wk,l=np,c=Awe,u=U_e,d=z_e,h=Ube,p=vbe,f=CR;return a.openBlock(),a.createBlock(p,{"body-style":e.bodyStyle,class:"content-card"},{header:a.withCtx(()=>[a.createElementVNode("div",tWt,[a.createVNode(s,{class:"search-input",placeholder:"Search",modelValue:e.searchInput,"onUpdate:modelValue":t[0]||(t[0]=m=>e.searchInput=m),onKeyup:o.searchEvent,clearable:"",onClear:o.clearSearchClicked},null,8,["modelValue","onKeyup","onClear"]),a.createVNode(l,{type:"primary",class:"button",onClick:o.searchEvent,size:"large"},{default:a.withCtx(()=>[a.createTextVNode(" Search ")]),_:1},8,["onClick"])])]),default:a.withCtx(()=>[a.createVNode(c,{class:"filters",ref:"filtersRef",entry:o.filterEntry,envVars:r.envVars,onFilterResults:o.filterUpdate,onNumberPerPage:o.numberPerPageUpdate,onLoading:o.filtersLoading,onCascaderReady:o.cascaderReady},null,8,["entry","envVars","onFilterResults","onNumberPerPage","onLoading","onCascaderReady"]),a.createVNode(u,{ref:"searchHistory",onSearch:o.searchHistorySearch},null,8,["onSearch"]),a.withDirectives((a.openBlock(),a.createElementBlock("div",rWt,[e.results.length===0&&!e.loadingCards?(a.openBlock(),a.createElementBlock("div",nWt," No results found - Please change your search / filter criteria. ")):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.results,m=>(a.openBlock(),a.createElementBlock("div",{key:m.doi,class:"step-item"},[a.createVNode(d,{class:"dataset-card",entry:m,envVars:r.envVars,onMouseenter:g=>o.hoverChanged(m),onMouseleave:t[1]||(t[1]=g=>o.hoverChanged(void 0))},null,8,["entry","envVars","onMouseenter"])]))),128)),a.createVNode(h,{class:"pagination","current-page":e.page,"onUpdate:currentPage":t[2]||(t[2]=m=>e.page=m),"hide-on-single-page":"",large:"",layout:"prev, pager, next","page-size":e.numberPerPage,total:e.numberOfHits,onCurrentChange:o.pageChange},null,8,["current-page","page-size","total","onCurrentChange"])])),[[f,e.loadingCards]])]),_:1},8,["body-style"])}const Owe=W3(eWt,[["render",iWt],["__scopeId","data-v-aeb7c099"]]),oWt={name:"ExternalResourceCard",components:{Button:np},props:{resources:{type:Array,default:()=>[]}},data:function(){return{pubmeds:[],pubmedIds:[],ElIconNotebook:a.shallowRef(uMt)}},methods:{capitalise:function(e){return e.charAt(0).toUpperCase()+e.slice(1)},openUrl:function(e){Lc.emit("open-pubmed-url",e),window.open(e,"_blank")}}},aWt={class:"resource-container"};function sWt(e,t,r,n,i,o){const s=np;return a.openBlock(),a.createElementBlock("div",aWt,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.resources,l=>(a.openBlock(),a.createElementBlock("div",{key:l.id,class:"resource"},[l.id==="pubmed"?(a.openBlock(),a.createBlock(s,{key:0,class:"button",id:"open-pubmed-button",icon:e.ElIconNotebook,onClick:c=>o.openUrl(l.url)},{default:a.withCtx(()=>[a.createTextVNode(" Open publications in PubMed ")]),_:2},1032,["icon","onClick"])):a.createCommentVNode("",!0)]))),128))])}const Iwe=W3(oWt,[["render",sWt],["__scopeId","data-v-e726c314"]]),lWt=e=>e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()),cWt=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""},uWt={name:"ConnectivityInfo",components:{Button:np,Container:MPt,Icon:ms,ElIconArrowUp:qCt,ElIconArrowDown:N$,ElIconWarning:YTe,ExternalResourceCard:Iwe},props:{entry:{type:Object,default:()=>({destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0})},availableAnatomyFacets:{type:Array,default:()=>[]}},data:function(){return{controller:void 0,activeSpecies:void 0,pubmedSearchUrl:"",loading:!1,facetList:[],showToolip:!1,showDetails:!1,originDescriptions:{motor:"is the location of the initial cell body of the circuit",sensory:"is the location of the initial cell body in the PNS circuit"},componentsWithDatasets:[],uberons:[{id:void 0,name:void 0}]}},watch:{availableAnatomyFacets:{handler:function(e){this.convertFacetsToList(e)},immediate:!0,deep:!0}},computed:{resources:function(){let e=[];return this.entry&&this.entry.hyperlinks&&(e=this.entry.hyperlinks),e},featuresAlert(){},originDescription:function(){return this.entry&&this.entry.title&&this.entry.title.toLowerCase().includes("motor")?this.originDescriptions.motor:this.originDescriptions.sensory},provSpeciesDescription:function(){let e="Studied in";return this.entry.provenanceTaxonomyLabel.forEach(t=>{e+=` ${t},`}),e=e.slice(0,-1),e+=" species",e}},methods:{titleCase:function(e){return lWt(e)},capitalise:function(e){return cWt(e)},openUrl:function(e){window.open(e,"_blank")},openAll:function(){Lc.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.componentsWithDatasets.map(e=>e.name.toLowerCase())})},openAxons:function(){Lc.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.destinationsWithDatasets.map(e=>e.name.toLowerCase())})},shouldShowExploreButton:function(e){for(let t=0;t<e.length;t++)if(this.facetList.includes(e[t].name.toLowerCase()))return!0;return!1},convertFacetsToList:function(e){e.forEach(t=>{t.children?this.convertFacetsToList(t.children):this.facetList.push(t.label.toLowerCase())})},openDendrites:function(){Lc.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.originsWithDatasets.map(e=>e.name.toLowerCase())})},pubmedSearchUrlUpdate:function(e){this.pubmedSearchUrl=e},showConnectivity:function(e){const t=e.featureId||[];this.$emit("show-connectivity",t)}}},H9=e=>(a.pushScopeId("data-v-f1c50620"),e=e(),a.popScopeId(),e),dWt={key:0,class:"main"},hWt={class:"connectivity-info-title"},pWt={key:0,class:"block"},fWt={class:"title"},mWt={key:0,class:"subtitle"},gWt={key:1,class:"block"},yWt={class:"title"},TWt=H9(()=>a.createElementVNode("span",null," Show connectivity on map ",-1)),vWt={key:0,class:"attribute-title-container"},bWt=H9(()=>a.createElementVNode("span",{class:"attribute-title"},"Alert",-1)),QWt={style:{"word-break":"keep-all"}},xWt={class:"content-container scrollbar"},_Wt={key:0,class:"block"},wWt={class:"attribute-title-container"},LWt=H9(()=>a.createElementVNode("span",{class:"attribute-title"},"Origin",-1)),SWt={style:{"word-break":"keep-all"}},kWt=H9(()=>a.createElementVNode("i",null,"Origin",-1)),CWt=["origin-item-label"],MWt={key:0,class:"seperator"},EWt={key:1,class:"block"},AWt=H9(()=>a.createElementVNode("div",{class:"attribute-title-container"},[a.createElementVNode("div",{class:"attribute-title"},"Components")],-1)),OWt=["component-item-label"],IWt={key:0,class:"seperator"},PWt={key:2,class:"block"},VWt={class:"attribute-title-container"},HWt=H9(()=>a.createElementVNode("span",{class:"attribute-title"},"Destination",-1)),RWt=H9(()=>a.createElementVNode("span",{style:{"word-break":"keep-all"}},[a.createElementVNode("i",null,"Destination"),a.createTextVNode(" is where the axons terminate ")],-1)),NWt=["destination-item-label"],BWt={key:0,class:"seperator"};function FWt(e,t,r,n,i,o){const s=Iwe,l=sMt,c=ms,u=np,d=Cee,h=YTe,p=CR;return r.entry?a.withDirectives((a.openBlock(),a.createElementBlock("div",dWt,[a.createElementVNode("div",hWt,[a.createElementVNode("div",null,[r.entry.title?(a.openBlock(),a.createElementBlock("div",pWt,[a.createElementVNode("div",fWt,a.toDisplayString(o.capitalise(r.entry.title)),1),r.entry.provenanceTaxonomyLabel&&r.entry.provenanceTaxonomyLabel.length>0?(a.openBlock(),a.createElementBlock("div",mWt,a.toDisplayString(o.provSpeciesDescription),1)):a.createCommentVNode("",!0)])):(a.openBlock(),a.createElementBlock("div",gWt,[a.createElementVNode("div",yWt,a.toDisplayString(r.entry.featureId),1)])),a.createVNode(s,{resources:o.resources},null,8,["resources"])]),a.createElementVNode("div",null,[a.createVNode(d,{width:"200",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:a.withCtx(()=>[a.createVNode(u,{class:"button-circle",circle:"",onClick:t[0]||(t[0]=f=>o.showConnectivity(r.entry))},{default:a.withCtx(()=>[a.createVNode(c,{color:"white"},{default:a.withCtx(()=>[a.createVNode(l)]),_:1})]),_:1})]),default:a.withCtx(()=>[TWt]),_:1})])]),o.featuresAlert?(a.openBlock(),a.createElementBlock("div",vWt,[bWt,a.createVNode(d,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:a.withCtx(()=>[a.createVNode(c,{class:"info"},{default:a.withCtx(()=>[a.createVNode(h)]),_:1})]),default:a.withCtx(()=>[a.createElementVNode("span",QWt,a.toDisplayString(o.featuresAlert),1)]),_:1})])):a.createCommentVNode("",!0),a.createElementVNode("div",xWt,[a.createTextVNode(a.toDisplayString(r.entry.paths)+" ",1),r.entry.origins&&r.entry.origins.length>0?(a.openBlock(),a.createElementBlock("div",_Wt,[a.createElementVNode("div",wWt,[LWt,a.createVNode(d,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:a.withCtx(()=>[a.createVNode(c,{class:"info"},{default:a.withCtx(()=>[a.createVNode(h)]),_:1})]),default:a.withCtx(()=>[a.createElementVNode("span",SWt,[kWt,a.createTextVNode(" "+a.toDisplayString(o.originDescription),1)])]),_:1})]),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.entry.origins,(f,m)=>(a.openBlock(),a.createElementBlock("div",{class:"attribute-content","origin-item-label":f,key:f},[a.createTextVNode(a.toDisplayString(o.capitalise(f))+" ",1),m!=r.entry.origins.length-1?(a.openBlock(),a.createElementBlock("div",MWt)):a.createCommentVNode("",!0)],8,CWt))),128)),a.withDirectives(a.createVNode(u,{class:"button",id:"open-dendrites-button",onClick:o.openDendrites},{default:a.withCtx(()=>[a.createTextVNode(" Explore origin data ")]),_:1},8,["onClick"]),[[a.vShow,r.entry.originsWithDatasets&&r.entry.originsWithDatasets.length>0&&o.shouldShowExploreButton(r.entry.originsWithDatasets)]])])):a.createCommentVNode("",!0),r.entry.components&&r.entry.components.length>0?(a.openBlock(),a.createElementBlock("div",EWt,[AWt,(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.entry.components,(f,m)=>(a.openBlock(),a.createElementBlock("div",{class:"attribute-content","component-item-label":f,key:f},[a.createTextVNode(a.toDisplayString(o.capitalise(f))+" ",1),m!=r.entry.components.length-1?(a.openBlock(),a.createElementBlock("div",IWt)):a.createCommentVNode("",!0)],8,OWt))),128))])):a.createCommentVNode("",!0),r.entry.destinations&&r.entry.destinations.length>0?(a.openBlock(),a.createElementBlock("div",PWt,[a.createElementVNode("div",VWt,[HWt,a.createVNode(d,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:a.withCtx(()=>[a.createVNode(c,{class:"info"},{default:a.withCtx(()=>[a.createVNode(h)]),_:1})]),default:a.withCtx(()=>[RWt]),_:1})]),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.entry.destinations,(f,m)=>(a.openBlock(),a.createElementBlock("div",{class:"attribute-content","destination-item-label":f,key:f},[a.createTextVNode(a.toDisplayString(o.capitalise(f))+" ",1),m!=r.entry.destinations.length-1?(a.openBlock(),a.createElementBlock("div",BWt)):a.createCommentVNode("",!0)],8,NWt))),128)),a.withDirectives(a.createVNode(u,{class:"button",onClick:o.openAxons},{default:a.withCtx(()=>[a.createTextVNode(" Explore destination data ")]),_:1},8,["onClick"]),[[a.vShow,r.entry.destinationsWithDatasets&&r.entry.destinationsWithDatasets.length>0&&o.shouldShowExploreButton(r.entry.destinationsWithDatasets)]])])):a.createCommentVNode("",!0),a.withDirectives(a.createVNode(u,{class:"button",onClick:o.openAll},{default:a.withCtx(()=>[a.createTextVNode(" Search for data on components ")]),_:1},8,["onClick"]),[[a.vShow,r.entry.componentsWithDatasets&&r.entry.componentsWithDatasets.length>0&&o.shouldShowExploreButton(r.entry.componentsWithDatasets)]])])])),[[p,e.loading]]):a.createCommentVNode("",!0)}const Pwe=W3(uWt,[["render",FWt],["__scopeId","data-v-f1c50620"]]),DWt={name:"Tabs",props:{tabTitles:{type:Array,default:()=>[]},activeId:{type:Number,default:1}},methods:{titleClicked:function(e,t){this.$emit("titleClicked",{id:e,type:t})},tabClose:function(e){this.$emit("tab-close",e)}}},zWt=e=>(a.pushScopeId("data-v-a569bcfd"),e=e(),a.popScopeId(),e),jWt={class:"tab-container"},UWt=["onClick"],GWt={class:"title-text"},WWt=zWt(()=>a.createElementVNode("span",{class:"visually-hidden"},"Close",-1));function qWt(e,t,r,n,i,o){const s=np;return a.openBlock(),a.createElementBlock("div",jWt,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.tabTitles,l=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["title",{"active-tab":l.id==r.activeId}]),key:l.id},[a.createElementVNode("div",{class:a.normalizeClass(["title-text-table",{highlightText:l.id==r.activeId}]),onClick:c=>o.titleClicked(l.id,l.type)},[a.createElementVNode("div",GWt,a.toDisplayString(l.title),1)],10,UWt),l.id===2?(a.openBlock(),a.createBlock(s,{key:0,onClick:c=>o.tabClose(l.id),class:"button-tab-close","aria-label":"Close"},{default:a.withCtx(()=>[a.createTextVNode(" × "),WWt]),_:2},1032,["onClick"])):a.createCommentVNode("",!0)],2))),128))])}const Vwe=W3(DWt,[["render",qWt],["__scopeId","data-v-a569bcfd"]]),ZWt={components:{SidebarContent:Owe,Tabs:Vwe,ElIconArrowLeft:B$,ElIconArrowRight:eR,Drawer:wee,Icon:ms,ConnectivityInfo:Pwe},name:"SideBar",props:{visible:{type:Boolean,default:!1},envVars:{type:Object,default:()=>{}},tabs:{type:Array,default:()=>[{id:1,title:"Search",type:"search"},{id:2,title:"Connectivity",type:"connectivity"}]},activeTabId:{type:Number,default:1},openAtStart:{type:Boolean,default:!1},connectivityInfo:{type:Object,default:null}},data:function(){return{drawerOpen:!1,availableAnatomyFacets:[]}},methods:{hoverChanged:function(e){this.$emit("hover-changed",e)},showConnectivity:function(e){this.$emit("show-connectivity",e)},searchChanged:function(e,t){this.$emit("search-changed",{...t,id:e})},close:function(){this.drawerOpen=!1},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},openSearch:function(e,t){this.drawerOpen=!0,this.$nextTick(()=>{this.getSearchTabRefById(1).openSearch(e,t)})},getTabByIdAndType:function(e,t){const r=e||this.activeTabId,n=t||"search",i=this.tabs.find(s=>s.id===r&&s.type===n),o=this.tabs[0];return i||o},getTabRefId:function(e,t){let r="searchTab_";t==="connectivity"&&(r="connectivityTab_");const n=this.getTabByIdAndType(e,t);return r+n.id},getSearchTabRefById:function(e){const t=e||1,r=this.getTabRefId(t,"search");return this.$refs[r][0]},addFilter:function(e){this.drawerOpen=!0,e.AND=!0,this.$nextTick(()=>{this.getSearchTabRefById(1).addFilter(e)})},openNeuronSearch:function(e){this.drawerOpen=!0,this.$nextTick(()=>{this.getSearchTabRefById(1).openSearch("",void 0,"scicrunch-query-string/",{field:"*organ.curie",curie:e})})},getAlgoliaFacets:async function(){return await this.getSearchTabRefById(1).getAlgoliaFacets()},setDrawerOpen:function(e=!0){this.drawerOpen=e},tabClicked:function({id:e,type:t}){this.$emit("tabClicked",{id:e,type:t})},tabClose:function(e){this.$emit("connectivity-info-close")}},created:function(){this.drawerOpen=this.openAtStart},mounted:function(){Lc.on("PopoverActionClick",e=>{this.$emit("actionClick",e)}),Lc.on("number-of-datasets-for-anatomies",e=>{this.$emit("number-of-datasets-for-anatomies",e)}),Lc.on("anatomy-in-datasets",e=>{this.$emit("anatomy-in-datasets",e)}),Lc.on("contextUpdate",e=>{this.$emit("contextUpdate",e)}),Lc.on("datalink-clicked",e=>{this.$emit("datalink-clicked",e)}),Lc.on("onConnectivityActionClick",e=>{this.tabClicked({id:1,type:"search"}),this.$emit("actionClick",e)}),Lc.on("available-facets",e=>{this.availableAnatomyFacets=e.find(t=>t.label==="Anatomical Structure").children})}},XWt={ref:"container"},KWt={class:"box-card"},YWt={class:"sidebar-container"};function JWt(e,t,r,n,i,o){const s=B$,l=ms,c=eR,u=Vwe,d=Pwe,h=Owe,p=wee;return a.openBlock(),a.createElementBlock("div",XWt,[e.drawerOpen?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",{key:0,onClick:t[0]||(t[0]=(...f)=>o.toggleDrawer&&o.toggleDrawer(...f)),class:"open-tab"},[a.createVNode(l,null,{default:a.withCtx(()=>[a.createVNode(s)]),_:1})])),a.createVNode(p,{class:"side-bar my-drawer",modelValue:e.drawerOpen,"onUpdate:modelValue":t[3]||(t[3]=f=>e.drawerOpen=f),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:a.withCtx(()=>[a.createElementVNode("div",KWt,[e.drawerOpen?(a.openBlock(),a.createElementBlock("div",{key:0,onClick:t[1]||(t[1]=(...f)=>o.close&&o.close(...f)),class:"close-tab"},[a.createVNode(l,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1})])):a.createCommentVNode("",!0),a.createElementVNode("div",YWt,[r.tabs.length>1&&r.connectivityInfo?(a.openBlock(),a.createBlock(u,{key:0,tabTitles:r.tabs,activeId:r.activeTabId,onTitleClicked:o.tabClicked,onTabClose:o.tabClose},null,8,["tabTitles","activeId","onTitleClicked","onTabClose"])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.tabs,f=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:"tab.id"},[f.type==="connectivity"?a.withDirectives((a.openBlock(),a.createBlock(d,{key:0,entry:r.connectivityInfo,availableAnatomyFacets:e.availableAnatomyFacets,ref_for:!0,ref:"connectivityTab_"+f.id,onShowConnectivity:o.showConnectivity},null,8,["entry","availableAnatomyFacets","onShowConnectivity"])),[[a.vShow,f.id===r.activeTabId]]):a.withDirectives((a.openBlock(),a.createBlock(h,{key:1,class:"sidebar-content-container",contextCardEntry:f.contextCard,envVars:r.envVars,ref_for:!0,ref:"searchTab_"+f.id,onSearchChanged:m=>o.searchChanged(f.id,m),onHoverChanged:t[2]||(t[2]=m=>o.hoverChanged(m))},null,8,["contextCardEntry","envVars","onSearchChanged"])),[[a.vShow,f.id===r.activeTabId]])],64))),128))])])]),_:1},8,["modelValue"])],512)}const $Wt={name:"SplitFlow",components:{Container:Ige,Header:Pge,Main:Vge,DialogToolbarContent:bye,SplitDialog:Tye,SideBar:W3(ZWt,[["render",JWt],["__scopeId","data-v-4d616bd4"]])},props:{state:{type:Object,default:void 0}},data:function(){return{sideBarVisibility:!0,startUp:!0,search:"",activeDockedId:1,filterTriggered:!1,availableFacets:[],connectivityInfo:null}},watch:{state:{handler:function(e){e&&(this._externalStateSet||this.setState(e),this._externalStateSet=!0)},immediate:!0}},methods:{actionClick:function(e){if(e)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";V1.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){this.closeConnectivityInfo(),this.$refs.sideBar.addFilter(e);const{facet:t}=e;V1.sendEvent({event:"interaction_event",event_name:"portal_maps_action_filter",category:t||"filter",location:"map_location_pin"}),this.filterTriggered=!0}}else if(e.type=="Facets"){const t=[];if(this.settingsStore.facets.species.forEach(r=>{t.push({facet:sye(r),term:"Species",facetPropPath:"organisms.primary.species.name"})}),t.length==0&&t.push({facet:"Show All",term:"Species",facetPropPath:"organisms.primary.species.name"}),t.push(...e.labels.map(r=>({facet:sye(r),term:"Anatomical structure",facetPropPath:"anatomy.organ.category.name"}))),this.$refs.sideBar){this.closeConnectivityInfo(),this.$refs.sideBar.openSearch(t,"");const n=ext(this.availableFacets,e.labels).join(", ");V1.sendEvent({event:"interaction_event",event_name:"portal_maps_action_filter",category:n||"filter",location:"map_popup_button"})}}else this.trackGalleryClick(e),this.createNewEntry(e)},trackGalleryClick:function(e){const t=[],{label:r,type:n,datasetId:i,discoverId:o,resource:s}=e;let l="",c=i||o;r&&t.push(r),n&&t.push(n),i&&t.push("("+c+")"),s&&(n==="Plot"?l=s.dataSource.url:l=typeof s=="string"?s:s.share_link),V1.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){let t=!1,r=this.$refs.splitdialog;r&&r.getActiveContents().forEach(i=>{i.search(e.term)&&(t=!0)}),this.$refs.dialogToolbar.setFailedSearch(t?void 0:e.term),V1.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(o=>o.searchSuggestions(e.data.term,t));const i=new Set(t);t.length=0;for(const o of i)t.push({value:'"'+o+'"'});e.data.cb(t)},onShowConnectivity:function(e){const t=this.splitFlowStore.getState(),r=(t==null?void 0:t.activeView)||"";Li.emit("show-connectivity",{featureIds:e,offset:r==="singlepanel"||r==="2horpanel"})},hoverChanged:function(e){const t=e&&e.anatomy?e.anatomy:[],r=e&&e.organs?e.organs:[];this.settingsStore.updateHoverFeatures(t,r),Li.emit("hoverUpdate")},searchChanged:function(e){if(e&&e.type=="query-update"&&(this.search=e.value,this.search&&!this.filterTriggered&&V1.sendEvent({event:"interaction_event",event_name:"portal_maps_action_search",category:this.search,location:"map_sidebar_search"}),this.filterTriggered=!1),e&&e.type=="filter-update"){if(this.settingsStore.updateFacets(e.value),!this.filterTriggered){const{value:t}=e,n=t.filter(i=>i.facet&&i.facet.toLowerCase()!=="show all").map(i=>i.facet).join(", ");V1.sendEvent({event:"interaction_event",event_name:"portal_maps_action_filter",category:n||"filter",location:"map_sidebar_filter"})}this.filterTriggered=!1}},updateMarkers:function(e){this.settingsStore.updateMarkers(e),Li.emit("markerUpdate")},updateScaffoldMarkers:function(e){this.settingsStore.updateNumberOfDatasetsForFacets(e)},getNewEntryId:function(){return this.entries.length?this.entries[this.entries.length-1].id+1:1},activateSyncMap:function(e){let t={};return Object.assign(t,e),t.mode="normal",t.id=this.getNewEntryId(),t.state=void 0,t.type="Scaffold",t.discoverId=e.discoverId,t.rotation="free",e.layout=="2vertpanel"?t.rotation="horizontal":e.layout=="2horpanel"&&(t.rotation="vertical"),this.entriesStore.addNewEntry(t),this.splitFlowStore.setSyncMode({flag:!0,newId:t.id,layout:e.layout}),t.id},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.splitFlowStore.syncMode&&this.splitFlowStore.setSyncMode({flag:!1}),this.$refs.sideBar&&this.$refs.sideBar.setDrawerOpen(!1),t.id},openNewMap:async function(e){const t=await KQt(e,this.settingsStore.sparcApi);this.createNewEntry(t),t.contextCard&&Li.emit("contextUpdate",t.contextCard)},openSearch:function(e,t){this.search=t,this._facets=e,this.$refs&&this.$refs.sideBar&&(this.closeConnectivityInfo(),this.$refs.sideBar.openSearch(e,t)),this.startUp=!1},closeConnectivityInfo:function(){this.$el.querySelectorAll(".maplibregl-popup-close-button").forEach(t=>{t.click()})},onFullscreen:function(e){this.$emit("onFullscreen",e)},resetApp:function(){this.setState(a$())},setIdToPrimaryPane:function(e){this.splitFlowStore.setIdToPrimaryPane(e)},setState:function(e){this.entriesStore.setAll(e.entries),e.splitFlow?this.splitFlowStore.setState(e.splitFlow):this.entries.forEach(t=>this.splitFlowStore.setIdToPrimaryPane(t.id))},getState:function(){let e=JSON.parse(JSON.stringify(this.entriesStore.$state)),r=this.$refs.splitdialog.getContentsState();if(e.entries.length===r.length)for(let n=0;n<r.length;n++){const i=e.entries[n];i.state=r[n],i.type==="Scaffold"&&"viewUrl"in i&&delete i.viewUrl,i.type==="MultiFlatmap"&&"uberonId"in i&&delete i.uberonId}return e.splitFlow=this.splitFlowStore.getState(),e},removeEntry:function(e){let t=this.entriesStore.findIndexOfId(e);this.entriesStore.destroyEntry(t)},resourceSelected:function(e){this.$emit("resource-selected",e),this.splitFlowStore.globalCallback&&this.$refs.splitdialog.sendSynchronisedEvent(e)},tabClicked:function({id:e,type:t}){this.activeDockedId=e},toggleSyncMode:function(e){e&&(e.flag?e.action&&this.activateSyncMap(e.action):this.splitFlowStore.syncMode&&this.splitFlowStore.setSyncMode({flag:!1}))},contextUpdate:function(e){Li.emit("contextUpdate",e)},datalinkClicked:function(e){const t=e||"",r="datasets/",i=t.substring(t.indexOf(r)+r.length,t.indexOf("?type=dataset"));V1.sendEvent({event:"interaction_event",event_name:"portal_maps_gallery_click",category:t,location:"map_sidebar_gallery",dataset_id:i||""})},onConnectivityInfoClose:function(){Li.emit("connectivity-info-close")},resetActivePathways:function(){const t=this.$el.querySelector(".maplibregl-canvas");t&&t.click()}},created:function(){this._facets=[],this._externalStateSet=!1},mounted:function(){Li.on("RemoveEntryRequest",e=>{this.removeEntry(e)}),Li.on("SyncModeRequest",e=>{this.toggleSyncMode(e)}),Li.on("PopoverActionClick",e=>{this.actionClick(e)}),Li.on("connectivity-info-open",e=>{this.connectivityInfo=e,this.$refs.sideBar&&(this.tabClicked({id:2,type:"connectivity"}),this.$refs.sideBar.setDrawerOpen(!0))}),Li.on("connectivity-info-close",e=>{this.tabClicked({id:1,type:"search"}),this.connectivityInfo=null,this.resetActivePathways()}),Li.on("OpenNewMap",e=>{this.openNewMap(e)}),Li.on("startHelp",()=>{this.$refs.sideBar&&this.$refs.sideBar.close()}),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:{...Qc.mapStores(HH,Qb,Nm),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}},entries:function(){return this.entriesStore.entries}}},eqt={style:{width:"100%",height:"100%",position:"relative",overflow:"hidden"}};function tqt(e,t,r,n,i,o){const s=bye,l=Pge,c=a.resolveComponent("SideBar"),u=Tye,d=Vge,h=Ige;return a.openBlock(),a.createBlock(h,{style:{height:"100%",background:"white"}},{default:a.withCtx(()=>[a.createVNode(l,{ref:"header",style:{"text-align":"left","font-size":"14px",padding:"0"},height:"32px",class:"dialog-header"},{default:a.withCtx(()=>[a.createVNode(s,{numberOfEntries:o.entries.length,onOnFullscreen:o.onFullscreen,onLocalSearch:o.onDisplaySearch,onFetchSuggestions:o.fetchSuggestions,ref:"dialogToolbar"},null,8,["numberOfEntries","onOnFullscreen","onLocalSearch","onFetchSuggestions"])]),_:1},512),a.createVNode(d,{class:"dialog-main"},{default:a.withCtx(()=>[a.createElementVNode("div",eqt,[a.createVNode(c,{ref:"sideBar",envVars:o.envVars,visible:e.sideBarVisibility,class:a.normalizeClass(["side-bar",{"start-up":e.startUp}]),activeTabId:e.activeDockedId,"open-at-start":e.startUp,connectivityInfo:e.connectivityInfo,onConnectivityInfoClose:o.onConnectivityInfoClose,onActionClick:o.actionClick,onTabClicked:o.tabClicked,onSearchChanged:t[0]||(t[0]=p=>o.searchChanged(p)),onAnatomyInDatasets:t[1]||(t[1]=p=>o.updateMarkers(p)),onNumberOfDatasetsForAnatomies:t[2]||(t[2]=p=>o.updateScaffoldMarkers(p)),onHoverChanged:t[3]||(t[3]=p=>o.hoverChanged(p)),onContextUpdate:t[4]||(t[4]=p=>o.contextUpdate(p)),onDatalinkClicked:t[5]||(t[5]=p=>o.datalinkClicked(p)),onShowConnectivity:o.onShowConnectivity},null,8,["envVars","visible","class","activeTabId","open-at-start","connectivityInfo","onConnectivityInfoClose","onActionClick","onTabClicked","onShowConnectivity"]),a.createVNode(u,{entries:o.entries,ref:"splitdialog",onResourceSelected:o.resourceSelected},null,8,["entries","onResourceSelected"])])]),_:1})]),_:1})}const Hwe=Zc($Wt,[["render",tqt],["__scopeId","data-v-7c28698d"]]),rqt={name:"MapContent",components:{MapSvgSpriteColor:VH,Loading:Gge,SplitFlow:Hwe},mixins:[{methods:{retrieveContextCardFromUrl:async function(e){const[t,r,n,i]=this.splitInfoFromUrl(e),o=await this.getContextFileFromScicrunch(t,n);if(!o.success)return{};const s=r+o.contextFile+i;return{s3uri:o.s3uri,contextCardUrl:s}},splitInfoFromUrl:function(e){let t=e.split("s3-resource")[1],r=e.split("files/")[0]+"files/",n=e.split("files/")[1].split("?")[0],i="?"+e.split("?")[1];const o=t.split("/");return o.shift(),[o[0],r,n,i]},getContextFileFromScicrunch:async function(e,t){return await fetch(`${this.settingsStore.sparcApi}/dataset_info/using_multiple_discoverIds/?discoverIds=${e}`).then(n=>n.json()).then(n=>{if(n.numberOfHits===1){const i=n.results[0]["abi-contextual-information"];if(i&&i.length===1)return{success:!0,contextFile:i[0],s3uri:n.results[0].s3uri};if(i&&i.length>1){let o=this.findContextInforForFilePath(n.results[0]["abi-context-file"],t);if(o)return{success:!0,contextFile:o,s3uri:n.results[0].s3uri}}}return{success:!1}}).catch(n=>(console.error("Error:",n),{success:!1}))},findContextInforForFilePath:function(e,t){var n;let r=e.find(i=>i.datacite.isDerivedFrom.path.includes(t));return(n=r==null?void 0:r.dataset)==null?void 0:n.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}},data:function(){return{isReady:!1,initialState:void 0}},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(){this.isFullscreen()&&(document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen())},goFullscreen:function(){let e=this.$refs.MapApp;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():parent.msRequestFullscreen&&e.msRequestFullscreen()},setState:function(e){return this.$refs.flow.setState(e)},getState:function(){return this.$refs.flow.getState()},setCurrentEntry:async function(e){if(e&&e.type){if(e.type==="Scaffold"&&e.url){let t={type:e.type,label:e.label,region:e.region,resource:e.url,state:e.state,viewUrl:e.viewUrl};const r=await this.retrieveContextCardFromUrl(e.url);t={...t,...r},this.$refs.flow.createNewEntry(t)}else if(e.type==="MultiFlatmap"){const t=JQt(e);if(t){const r=this.getState();if(r&&r.entries)for(let n=0;n<r.entries.length;n++){const i=r.entries[n];if(i.type==="MultiFlatmap"){i.resource=t,i.state={species:t},(e.organ||e.uuid)&&(i.state.state={searchTerm:e.organ,uuid:e.uuid},e.uuid&&(i.state.state.entry=e.taxo)),this.$refs.flow.setState(r),this.$refs.flow.setIdToPrimaryPane(i.id);break}}}}else if(e.type==="Flatmap"){const t={type:e.type,resource:e.resource,state:e.state,label:e.label};this.$refs.flow.createNewEntry(t)}}},openSearch:function(e,t){return this.$refs.flow.openSearch(e,t)},flowMounted:function(){this._flowMounted=!0,this.$emit("isReady"),V1.sendEvent({event:"interaction_event",event_name:"portal_maps_page_view",category:this.startingMap})},changeViewingMode:function(e){Li.emit("changeViewingMode",e)}},computed:{...Qc.mapStores(Qb,Nm),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)),(e=this.splitFlowStore)==null||e.reset(),(t=this.splitFlowStore)==null||t.getAvailableTerms(this.settingsStore.sparcApi)},mounted:async function(){Li.on("updateShareLinkRequested",()=>{this.$emit("updateShareLinkRequested")}),Li.on("trackEvent",e=>{this.$emit("trackEvent",e)}),this.state||(this.initialState=await YQt(this.startingMap,this.options.sparcApi)),Li.on("mapReady",()=>{this._flowMounted&&this.$emit("isLoaded")}),this.isReady=!0,this.settingsStore.updateUseHelpModeDialog(this.useHelpModeDialog),this.settingsStore.updateConnectivityInfoSidebar(this.connectivityInfoSidebar)}},nqt={ref:"MapApp",class:"mapcontent","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"};function iqt(e,t,r,n,i,o){const s=a.resolveComponent("map-svg-sprite-color"),l=Hwe,c=bb;return a.withDirectives((a.openBlock(),a.createElementBlock("div",nqt,[a.createVNode(s),e.isReady?(a.openBlock(),a.createBlock(l,{key:0,onOnFullscreen:o.onFullscreen,state:o.stateToSet,ref:"flow",onVnodeMounted:o.flowMounted},null,8,["onOnFullscreen","state","onVnodeMounted"])):a.createCommentVNode("",!0)])),[[c,!e.isReady]])}const oqt=Zc(rqt,[["render",iqt],["__scopeId","data-v-871312dd"]]);let Gte=7,$3=5;const aqt=[{id:"UBERON:0000948",name:"heart",showAtZoom:1},{id:"UBERON:0001759",name:"vagus nerve",showAtZoom:1},{id:"UBERON:0001155",name:"colon",showAtZoom:1},{id:"UBERON:0000945",name:"stomach",showAtZoom:1},{id:"UBERON:0001013",name:"adipose tissue",showAtZoom:1},{id:"UBERON:0001255",name:"urinary bladder",showAtZoom:1},{id:"UBERON:0001348",name:"brown adipose tissue",showAtZoom:6},{id:"UBERON:0002008",name:"cardiac nerve plexus",showAtZoom:1},{id:"UBERON:0002240",name:"spinal cord",showAtZoom:1},{id:"UBERON:0002005",name:"Enteric Nervous System",showAtZoom:4},{id:"UBERON:0013702",name:"body proper",showAtZoom:1},{id:"UBERON:0002298",name:"brainstem",showAtZoom:1},{id:"UBERON:0002439",name:"myenteric nerve plexus",showAtZoom:6},{id:"UBERON:0000010",name:"peripheral nervous system",showAtZoom:6},{id:"UBERON:0002048",name:"lung",showAtZoom:1},{id:"UBERON:0002410",name:"autonomic nervous system",showAtZoom:6},{id:"UBERON:0002441",name:"cervicothoracic ganglion",showAtZoom:6},{id:"UBERON:0005363",name:"inferior vagus X ganglion",showAtZoom:6},{id:"UBERON:0001264",name:"pancreas",showAtZoom:1},{id:"UBERON:0001884",name:"phrenic nerve",showAtZoom:6},{id:"UBERON:0002059",name:"submandibular ganglion",showAtZoom:7},{id:"UBERON:0001347",name:"white adipose tissue",showAtZoom:6},{id:"UBERON:0001556",name:"lower urinary tract",showAtZoom:1},{id:"UBERON:0002262",name:"celiac ganglion",showAtZoom:5},{id:"UBERON:0000955",name:"Brain",showAtZoom:1},{id:"UBERON:0000160",name:"intestine",showAtZoom:1},{id:"UBERON:0001322",name:"sciatic nerve",showAtZoom:1},{id:"UBERON:0001649",name:"glossopharyngeal nerve",showAtZoom:6},{id:"UBERON:0002063",name:"sinus venosus",showAtZoom:6},{id:"UBERON:0002107",name:"liver",showAtZoom:1},{id:"UBERON:0002113",name:"kidney",showAtZoom:1},{id:"UBERON:0002481",name:"bone tissue",showAtZoom:1},{id:"UBERON:0004907",name:"lower digestive tract",showAtZoom:4},{id:"UBERON:0000044",name:"Dorsal root ganglion",showAtZoom:5},{id:"UBERON:0001736",name:"Submandibular gland",showAtZoom:Gte,keyword:!0},{id:"UBERON:0001103",name:"Diaphragm",showAtZoom:$3,keyword:!0},{id:"UBERON:0001160",name:"Fundus of stomach",showAtZoom:$3,keyword:!0},{id:"UBERON:0000955",name:"Brain",showAtZoom:$3,keyword:!0},{id:"UBERON:0003708",name:"Carotid sinus",showAtZoom:Gte,keyword:!0},{id:"UBERON:0002079",name:"Left cardiac atrium",showAtZoom:$3,keyword:!0},{id:"ILX:0485722",name:"Nodose ganglion",showAtZoom:Gte,keyword:!0},{id:"UBERON:0002078",name:"Right cardiac atrium",showAtZoom:$3,keyword:!0},{id:"UBERON:0002084",name:"Heart left ventricle",showAtZoom:$3,keyword:!0},{id:"UBERON:0002080",name:"Heart right ventricle",showAtZoom:$3,keyword:!0},{id:"UBERON:0001508",name:"Arch of Aorta",showAtZoom:$3,keyword:!0},{id:"UBERON:0001738",name:"Thyroid cartilage",showAtZoom:$3,keyword:!0},{id:"UBERON:0000388",name:"Epiglottis",showAtZoom:$3,keyword:!0}];function sqt(e){return e[0].toUpperCase()+e.substring(1)}const rQ={emits:["flatmap-provenance-ready","resource-selected","species-changed"],props:{entry:Object,visible:{type:Boolean,default:!0},mouseHovered:{type:Boolean,default:!1}},computed:{...Qc.mapStores(Qb,Nm),idNamePair(){return this.splitFlowStore.idNamePair},syncMode(){return this.splitFlowStore.syncMode},useHelpModeDialog(){return this.settingsStore.useHelpModeDialog},connectivityInfoSidebar(){return this.settingsStore.connectivityInfoSidebar}},mounted:function(){Li.on("startHelp",()=>{this.startHelp()}),this.multiflatmapRef=this.$refs.multiflatmap,this.flatmapRef=this.$refs.flatmap,this.scaffoldRef=this.$refs.scaffold},methods:{toggleSyncMode:function(){},getState:function(){},openMap:function(e){e==="SYNC"?(this.toggleSyncMode(),this.trackOpenMap("toggle_map_sync_mode")):(Li.emit("OpenNewMap",e),this.trackOpenMap(`open_new_${e}_map`)),this.onConnectivityInfoClose()},trackOpenMap:function(e){V1.sendEvent({event:"interaction_event",event_name:"portal_maps_open_map",category:e,location:"open_new_map"})},updateWithViewUrl:function(){},search:function(){return!1},searchSuggestions:function(){},resourceSelected:function(e,t,r){var l,c,u;if(this.resourceHasAction(t)){Li.emit("PopoverActionClick",t);return}let n,i="none",o=!1;const s={paneIndex:this.entry.id,type:e,resource:t,internalName:void 0,eventType:void 0};if(e=="MultiFlatmap"||e=="Flatmap")if(s.internalName=this.idNamePair[t.feature.models],t.eventType=="click")if(s.eventType="selected",t.feature.type=="marker"){let d=this.idNamePair[t.feature.models],h=aqt.filter(p=>p.id===t.feature.models);this.settingsStore.isFeaturedMarkerIdentifier(t.feature.id)?n={type:"Search",term:this.settingsStore.featuredMarkerDoi(t.feature.id),featuredDataset:!0}:h.filter(p=>p.keyword).length>0?n={type:"Search",term:"http://purl.obolibrary.org/obo/"+t.feature.models.replace(":","_")}:n={type:"Facet",facet:d,facetPropPath:"anatomy.organ.category.name",term:"Anatomical structure"},o=!0,e=="MultiFlatmap"&&this.$refs.multiflatmap.getCurrentFlatmap().mapImp.clearSearchResults()}else t.feature.type=="feature"&&(this.syncMode?o=!0:i="scaffold");else t.eventType=="mouseenter"&&(s.eventType="highlighted",o=!0);else e=="Scaffold"&&(t&&t[0]&&((((l=t[0].data)==null?void 0:l.id)===void 0||((c=t[0].data)==null?void 0:c.id)==="")&&(t[0].data.id=(u=t[0].data)==null?void 0:u.group),s.internalName=t[0].data.id,t[0].data.lastActionOnMarker===!0&&(n={type:"Facet",facet:sqt(t[0].data.id),facetPropPath:"anatomy.organ.category.name",term:"Anatomical structure"})),s.eventType="selected",o=!0,i="search");n===void 0&&r&&(n=cxt(s,i)),n&&Li.emit("PopoverActionClick",n),o&&this.$emit("resource-selected",s)},resourceHasAction:function(e){return 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},displayTooltip:function(){},getNameAndIdFromSyncData:async function(e){let t=e.internalName;t===void 0&&e.resource&&(t=e.resource.label);let r;if(e.resource&&e.resource.resource&&(r=e.resource.resource[0]),this.entry.type==="Scaffold"){if(this.$refs.scaffold.findObjectsWithGroupName(t).length===0){if(e.resource&&e.resource.feature){const o=uye(e.resource.feature.models);if(o.length>0)return o}let i=lxt(t);if(i)return i;if(r&&e.eventType==="selected")return fetch(`${this.apiLocation}get-related-terms/${r}`).then(o=>o.json()).then(o=>{if(o.uberon.array.length>0)return t=o.uberon.array[0].name.charAt(0).toUpperCase()+o.uberon.array[0].name.slice(1),r=o.uberon.array[0].id.toUpperCase(),{id:r,name:t}})}}else if(this.entry.type==="MultiFlatmap")if(t==="Bladder")t="Urinary Bladder";else{const n=uye(t);n.length>0&&(t=n[0])}return{id:r,name:t}},getDatasetAnatomyInfo:function(e){fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${e}`).then(t=>t.json()).then(t=>{const r=t.result[0];let n;try{n=r.anatomy.organ[0].curie}catch{n=void 0}let i;try{i=r.item.curie}catch{i=void 0}let o;try{let s=0,l=!1;for(;!l&&s<r.organisms.subject.length;){const c=r.organisms.subject[s];c.species&&(o=c.species.name,l=!0),s+=1}}catch{o=void 0}this.settingsStore.updateFeaturedMarker({identifier:e,marker:n,doi:i,species:o})})},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(r=>r.id)},getFeaturedDatasets:async function(){let e=[],t=await this.oldFeaturedDatasetApiHasInfo();if(t)e=t;else{let r=await this.newFeaturedDatasetApiHasInfo();r&&(e=r)}this.settingsStore.updateFeatured(e),e.forEach(r=>{this.getDatasetAnatomyInfo(r)})},zoomToFeatures:function(){},handleSyncMouseEvent:async function(e){let t=await this.getNameAndIdFromSyncData(e);e.eventType==="highlighted"?this.highlightFeatures(t):e.eventType==="selected"&&this.displayTooltip(t)},handleSyncPanZoomEvent:function(){},highlightFeatures:function(){},receiveSynchronisedEvent:async function(e){if(e.paneIndex!==this.entry.id)e.eventType=="panZoom"||this.handleSyncMouseEvent(e);else if(e.eventType=="selected"){let t=await this.getNameAndIdFromSyncData(e);this.zoomToFeatures(t,!1)}},requestSynchronisedEvent:function(){},flatmapMarkerUpdate(){},onResize:function(){},startHelp:function(){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()},mapHoverHighlight:function(e){if(this.visible){const t=this.settingsStore.hoverAnatomies,r=this.settingsStore.hoverOrgans;t.length||r.length?(clearTimeout(this.hoverDelay),this.multiflatmapRef||this.flatmapRef?e==null||e.zoomToFeatures(t,{noZoomIn:!0}):this.scaffoldRef&&(e==null||e.changeHighlightedByName(r,"",!1))):this.hoverDelay=setTimeout(()=>{this.multiflatmapRef||this.flatmapRef?e==null||e.clearSearchResults():this.scaffoldRef&&(e==null||e.changeHighlightedByName(r,"",!1))},500)}},onConnectivityInfoOpen:function(e){Li.emit("connectivity-info-open",e)},onConnectivityInfoClose:function(){Li.emit("connectivity-info-close")}},data:function(){return{apiLocation:void 0,activeSpecies:"Rat",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,hoverDelay:void 0}},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)},watch:{helpMode:function(e){e||(this.helpModeActiveItem=0)}}},lqt=function(e){return e?[...new Set(e.map(t=>JSON.stringify(t)))].map(t=>JSON.parse(t)):[]},Rwe={computed:{...Qc.mapStores(Qb)},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 r=this.settingsStore.markers;r=lqt(r);let n=this.removeMarkersNotOnFlatmap(t,r);t.clearMarkers(),t.clearDatasetMarkers(),t.addDatasetMarkers(n),this.entry.type==="MultiFlatmap"&&this.restoreFeaturedMarkers(t)}},removeMarkersNotOnFlatmap(e,t){let r=e.anatomicalIdentifiers,n=[];for(let i=0;i<t.length;i++){let o=t[i],s={id:o.id,terms:[]};for(let l=0;l<o.terms.length;l++)r.includes(o.terms[l])&&s.terms.push(o.terms[l]);n.push(s)}return n},flatmapReadyForMarkerUpdates:function(e){if(e){e.enablePanZoomEvents(!0),this.flatmapReady=!0;const t=e.mapImp;this.flatmapMarkerUpdate(t)}}}},m6=(e,t,{checkForDefaultPrevented:r=!0}={})=>n=>{const i=e==null?void 0:e(n);if(r===!1||!i)return t==null?void 0:t(n)};var Nwe;const Al=typeof window<"u",cqt=e=>typeof e=="string",Bwe=()=>{},uqt=Al&&((Nwe=window==null?void 0:window.navigator)==null?void 0:Nwe.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Fwe(e){return typeof e=="function"?e():a.unref(e)}function dqt(e){return e}function vN(e){return a.getCurrentScope()?(a.onScopeDispose(e),!0):!1}function hqt(e,t=!0){a.getCurrentInstance()?a.onMounted(e):t?e():a.nextTick(e)}function g6(e){var t;const r=Fwe(e);return(t=r==null?void 0:r.$el)!=null?t:r}const bN=Al?window:void 0;function t8(...e){let t,r,n,i;if(cqt(e[0])||Array.isArray(e[0])?([r,n,i]=e,t=bN):[t,r,n,i]=e,!t)return Bwe;Array.isArray(r)||(r=[r]),Array.isArray(n)||(n=[n]);const o=[],s=()=>{o.forEach(d=>d()),o.length=0},l=(d,h,p,f)=>(d.addEventListener(h,p,f),()=>d.removeEventListener(h,p,f)),c=a.watch(()=>[g6(t),Fwe(i)],([d,h])=>{s(),d&&o.push(...r.flatMap(p=>n.map(f=>l(d,p,f,h))))},{immediate:!0,flush:"post"}),u=()=>{c(),s()};return vN(u),u}let Dwe=!1;function pqt(e,t,r={}){const{window:n=bN,ignore:i=[],capture:o=!0,detectIframe:s=!1}=r;if(!n)return;uqt&&!Dwe&&(Dwe=!0,Array.from(n.document.body.children).forEach(d=>d.addEventListener("click",Bwe)));let l=!0;const c=d=>i.some(h=>{if(typeof h=="string")return Array.from(n.document.querySelectorAll(h)).some(p=>p===d.target||d.composedPath().includes(p));{const p=g6(h);return p&&(d.target===p||d.composedPath().includes(p))}}),u=[t8(n,"click",d=>{const h=g6(e);if(!(!h||h===d.target||d.composedPath().includes(h))){if(d.detail===0&&(l=!c(d)),!l){l=!0;return}t(d)}},{passive:!0,capture:o}),t8(n,"pointerdown",d=>{const h=g6(e);h&&(l=!d.composedPath().includes(h)&&!c(d))},{passive:!0}),s&&t8(n,"blur",d=>{var h;const p=g6(e);((h=n.document.activeElement)==null?void 0:h.tagName)==="IFRAME"&&!(p!=null&&p.contains(n.document.activeElement))&&t(d)})].filter(Boolean);return()=>u.forEach(d=>d())}function zwe(e,t=!1){const r=a.ref(),n=()=>r.value=!!e();return n(),hqt(n,t),r}const jwe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Uwe="__vueuse_ssr_handlers__";jwe[Uwe]=jwe[Uwe]||{};var Gwe=Object.getOwnPropertySymbols,fqt=Object.prototype.hasOwnProperty,mqt=Object.prototype.propertyIsEnumerable,gqt=(e,t)=>{var r={};for(var n in e)fqt.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Gwe)for(var n of Gwe(e))t.indexOf(n)<0&&mqt.call(e,n)&&(r[n]=e[n]);return r};function y6(e,t,r={}){const n=r,{window:i=bN}=n,o=gqt(n,["window"]);let s;const l=zwe(()=>i&&"ResizeObserver"in i),c=()=>{s&&(s.disconnect(),s=void 0)},u=a.watch(()=>g6(e),h=>{c(),l.value&&i&&h&&(s=new ResizeObserver(t),s.observe(h,o))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return vN(d),{isSupported:l,stop:d}}var Wwe=Object.getOwnPropertySymbols,yqt=Object.prototype.hasOwnProperty,Tqt=Object.prototype.propertyIsEnumerable,vqt=(e,t)=>{var r={};for(var n in e)yqt.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Wwe)for(var n of Wwe(e))t.indexOf(n)<0&&Tqt.call(e,n)&&(r[n]=e[n]);return r};function bqt(e,t,r={}){const n=r,{window:i=bN}=n,o=vqt(n,["window"]);let s;const l=zwe(()=>i&&"MutationObserver"in i),c=()=>{s&&(s.disconnect(),s=void 0)},u=a.watch(()=>g6(e),h=>{c(),l.value&&i&&h&&(s=new MutationObserver(t),s.observe(h,o))},{immediate:!0}),d=()=>{c(),u()};return vN(d),{isSupported:l,stop:d}}var qwe;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(qwe||(qwe={}));var Qqt=Object.defineProperty,Zwe=Object.getOwnPropertySymbols,xqt=Object.prototype.hasOwnProperty,_qt=Object.prototype.propertyIsEnumerable,Xwe=(e,t,r)=>t in e?Qqt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wqt=(e,t)=>{for(var r in t||(t={}))xqt.call(t,r)&&Xwe(e,r,t[r]);if(Zwe)for(var r of Zwe(t))_qt.call(t,r)&&Xwe(e,r,t[r]);return e};wqt({linear:dqt},{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 Lqt=()=>Al&&/firefox/i.test(window.navigator.userAgent),Wte=e=>{let t,r;return e.type==="touchend"?(r=e.changedTouches[0].clientY,t=e.changedTouches[0].clientX):e.type.startsWith("touch")?(r=e.touches[0].clientY,t=e.touches[0].clientX):(r=e.clientY,t=e.clientX),{clientX:t,clientY:r}};/**
|
938
938
|
* @vue/shared v3.4.27
|
939
939
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
940
940
|
* @license MIT
|