@nanoporetech-digital/components 8.19.0 → 8.20.0
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/cjs/nano-global-nav.cjs.entry.js +36 -22
- package/dist/collection/components/breadcrumb/breadcrumb.js +1 -1
- package/dist/collection/components/global-nav/global-nav.js +41 -27
- package/dist/components/nano-global-nav.js +36 -22
- package/dist/esm/nano-global-nav.entry.js +36 -22
- package/dist/nano-components/nano-global-nav.entry.js +1 -1
- package/dist/types/components/global-nav/global-nav.d.ts +3 -3
- package/dist/types/components.d.ts +6 -6
- package/docs-json.json +15 -9
- package/docs-vscode.json +1 -1
- package/hydrate/index.js +37 -23
- package/hydrate/index.mjs +37 -23
- package/package.json +2 -2
- /package/dist/types/builds/{7a-7ssxC → x6knoJK1}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/generate-vue-component.d.ts +0 -0
- /package/dist/types/builds/{7a-7ssxC → x6knoJK1}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/index.d.ts +0 -0
- /package/dist/types/builds/{7a-7ssxC → x6knoJK1}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/output-vue.d.ts +0 -0
- /package/dist/types/builds/{7a-7ssxC → x6knoJK1}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/plugin.d.ts +0 -0
- /package/dist/types/builds/{7a-7ssxC → x6knoJK1}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/types.d.ts +0 -0
- /package/dist/types/builds/{7a-7ssxC → x6knoJK1}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/utils.d.ts +0 -0
- /package/dist/types/builds/{7a-7ssxC → x6knoJK1}/0/Digital/nano-components/packages/components/.stencil/stencil.config.d.ts +0 -0
- /package/dist/types/builds/{7a-7ssxC → x6knoJK1}/0/Digital/nano-components/packages/components/.stencil/stencil.config.prod.d.ts +0 -0
- /package/dist/types/builds/{7a-7ssxC → x6knoJK1}/0/Digital/nano-components/packages/components/.stencil/testing/mocks/intersection-observer.d.ts +0 -0
- /package/dist/types/builds/{7a-7ssxC → x6knoJK1}/0/Digital/nano-components/packages/components/.stencil/wdio.conf.d.ts +0 -0
|
@@ -28,7 +28,7 @@ const GlobalNav = class {
|
|
|
28
28
|
/** Url to the Nanopore contact page */
|
|
29
29
|
contactUrl = 'https://nanoporetech.com/contact';
|
|
30
30
|
_sessionRedirect = window.location.href;
|
|
31
|
-
/** A url to take the user after login
|
|
31
|
+
/** A url to take the user after login or logout. Defaults to current URL. Is automatically URI encoded */
|
|
32
32
|
get sessionRedirect() {
|
|
33
33
|
return encodeURIComponent(this._sessionRedirect);
|
|
34
34
|
}
|
|
@@ -87,15 +87,22 @@ const GlobalNav = class {
|
|
|
87
87
|
return this.myAccountData?.user?.uuid ? this.myAccountData.user : null;
|
|
88
88
|
}
|
|
89
89
|
processUserData() {
|
|
90
|
-
if (!this.myAccountUser)
|
|
90
|
+
if (!this.myAccountUser) {
|
|
91
|
+
this.isLoggedIn = false;
|
|
92
|
+
this.userLinks = [];
|
|
93
|
+
this.msgUrl = '';
|
|
94
|
+
this.msgCount = 0;
|
|
95
|
+
this.nanoUserData.emit(null);
|
|
91
96
|
return;
|
|
92
|
-
|
|
93
|
-
this.
|
|
94
|
-
|
|
95
|
-
this.
|
|
96
|
-
this.
|
|
97
|
-
this.
|
|
98
|
-
this.
|
|
97
|
+
}
|
|
98
|
+
this.userLinks =
|
|
99
|
+
this.myAccountData?.links?.filter((link) => link.area === 'profile-panel-list') || [];
|
|
100
|
+
this.loginUrl = this.loginUrl || this.myAccountData.urls?.login;
|
|
101
|
+
this.logoutUrl = this.logoutUrl || this.myAccountData.urls?.logout;
|
|
102
|
+
this.msgUrl = this.msgUrl || this.myAccountData.urls?.messages;
|
|
103
|
+
this.msgCount = this.msgCount || this.myAccountData.notifications?.count;
|
|
104
|
+
this.cartUrl = this.cartUrl || this.myAccountData.urls?.cart;
|
|
105
|
+
this.cartCount = this.cartCount || this.myAccountData.cart?.count;
|
|
99
106
|
this.isLoggedIn = true;
|
|
100
107
|
this.nanoUserData.emit(this.myAccountUser);
|
|
101
108
|
}
|
|
@@ -437,14 +444,18 @@ const GlobalNav = class {
|
|
|
437
444
|
return;
|
|
438
445
|
return (h("div", { part: "user-panel", class: `gn__user-panel nano-theme-dark` }, h("div", { class: "gn__user-panel-head", slot: "label" }, h("nano-avatar", { initials: this.myAccountUser.first_name?.charAt(0) +
|
|
439
446
|
this.myAccountUser.last_name?.charAt(0) }, this.myAccountUser.small_avatar_url &&
|
|
440
|
-
!this.myAccountUser.small_avatar_url.includes('generic') && (h("img", { src: this.myAccountUser.small_avatar_url, alt: "User Avatar", height: 40, width: 40 }))), h("div", null, this.myAccountUser.name, h("br", null), this.myAccountUser.job_title
|
|
447
|
+
!this.myAccountUser.small_avatar_url.includes('generic') && (h("img", { src: this.myAccountUser.small_avatar_url, alt: "User Avatar", height: 40, width: 40 }))), h("div", null, this.myAccountUser.name, h("br", null), this.myAccountUser.job_title && this.myAccountUser?.company
|
|
448
|
+
? `${this.myAccountUser.job_title}, ${this.myAccountUser.company}`
|
|
449
|
+
: this.myAccountUser.job_title ||
|
|
450
|
+
this.myAccountUser.company ||
|
|
451
|
+
'')), h("div", { class: "gn__user-panel-body" }, this.userLinks.map((link) => (h("a", { href: link.address, target: link.target || undefined }, link.title, (link.title === 'Messages' ||
|
|
441
452
|
link.address.includes(this.msgUrl) ||
|
|
442
453
|
this.msgUrl.includes(link.address)) &&
|
|
443
|
-
this.msgCount > 0 && (h("nano-badge", { theme: "danger", strength: "2" }, this.msgCount)))))), h("div", { class: "gn__user-panel-foot" }, h("nano-cta", { secondary: true, size: "small", icon: "false", class: "gn__login-cta" }, h("a", { href: this.formatLoginLink(this.logoutUrl) }, "Logout")))));
|
|
454
|
+
this.msgCount > 0 && (h("nano-badge", { theme: "danger", strength: "2" }, this.msgCount)))))), h("div", { class: "gn__user-panel-foot" }, h("nano-cta", { secondary: true, size: "small", icon: "false", class: "gn__login-cta" }, typeof this.logoutUrl === 'string' ? (h("a", { href: this.formatLoginLink(this.logoutUrl) }, "Logout")) : (h("button", { onClick: this.logoutUrl }, "Logout"))))));
|
|
444
455
|
}
|
|
445
456
|
bpPartials = {
|
|
446
457
|
contact: {
|
|
447
|
-
tpl: () => h("a", { href: this.contactUrl }, "Contact"),
|
|
458
|
+
tpl: () => this.contactUrl && h("a", { href: this.contactUrl }, "Contact"),
|
|
448
459
|
breakpoint: 0,
|
|
449
460
|
},
|
|
450
461
|
mainMenu: {
|
|
@@ -482,21 +493,21 @@ const GlobalNav = class {
|
|
|
482
493
|
}
|
|
483
494
|
render() {
|
|
484
495
|
const bpps = this.bpPartials;
|
|
485
|
-
return (h(Host, { key: '
|
|
496
|
+
return (h(Host, { key: '6f3ecd6fac6825f4b137592e1becb86046278542', class: {
|
|
486
497
|
'overflow-menu': this.breakpoint > bpps.mainMenu.breakpoint,
|
|
487
498
|
'bar-menu': this.breakpoint <= bpps.mainMenu.breakpoint,
|
|
488
499
|
'nano-global-nav': true,
|
|
489
|
-
} }, h("div", { key: '
|
|
500
|
+
} }, h("div", { key: '8ecbd0ecc9ac93f1a1dd5defa8f119874f623daf', class: {
|
|
490
501
|
gn: true,
|
|
491
502
|
'gn__search-open': this.searchBarShown,
|
|
492
|
-
} }, h("nano-drawer", { key: '
|
|
503
|
+
} }, h("nano-drawer", { key: '728b760496d041fc5f1d78905081e7fe59b7047c', ref: (el) => (this.overflowMenu = el), label: "Main menu", part: "drawer", class: "gn__drawer nano-theme-dark", placement: "start", open: this.overflowOpen, onNanoAfterHide: () => (this.overflowOpen = false), onNanoAfterShow: () => (this.overflowOpen = true) }, h("div", { key: 'd1b99ae15e00511594abf476a06f8374d4fad508', class: "gn__drawer-header", part: "overflow-header", slot: "label" }, "Main menu"), h("nav", { key: '97debdda75a0d7d9f2a6e23306fa93bd2d73de06', class: "gn__drawer-menu", part: "overflow-menu" }, this.breakpoint > bpps.mainMenu.breakpoint
|
|
493
504
|
? bpps.mainMenu.tpl()
|
|
494
|
-
: '', h("slot", { key: '
|
|
505
|
+
: '', h("slot", { key: 'd500a55cb220088df7af00b356f902a3d80fb47d', name: "overflow" }))), h("div", { key: 'c1454d4666561a77a850d9328d13795d5f989d89', class: "gn__menu-bar-wrapper" }, h("div", { key: 'f32f9a8302ad3501ae3d9e8afdf2ed7d59297335', class: "gn__menu-bar", part: "menu-bar", ref: (el) => (this.mainMenuBar = el) }, h("nav", { key: '8605e4bf473e4b34e3890ddaf69c555abc397716', "aria-label": "Global navigation", class: `gn__main-menu ${this.shouldResize ? 'resizing' : ''}`, part: "main-menu", ref: (el) => (this.mainMenu = el) }, this.breakpoint > bpps.mainMenu.breakpoint && (h("nano-icon-button", { key: '04aaa626447c7377fadcd8d374fa9120ef5fea62', class: "gn__overflow-button", iconName: "light/bars", label: "Open Menu", onClick: () => this.overflowMenu.show() })), h("slot", { key: '3f858438db16a112c2dee67ee8b865afba9180fe', name: "logo" }, h("a", { key: 'ddc758422fb964b2644e825c98ec0aec832895db', href: this.logoUrl, class: "gn__logo-link", part: "logo-link" }, this.breakpoint <= bpps.logo.breakpoint ? (h("img", { src: getAssetPath('../nano-assets/ont-logo.svg'), alt: `Oxford Nanopore Technologies logo. Features a stylised representation of a nanopore,
|
|
495
506
|
(a tiny protein channel embedded in a membrane) through which DNA or RNA molecules are passed in for sequencing.`, class: "gn__logo gn__logo--large", width: "152", height: "36", part: "logo logo--large" })) : (h("img", { src: getAssetPath('../nano-assets/ont-wheel.svg'), alt: `Oxford Nanopore Technologies logo. A stylised representation of a nanopore,
|
|
496
|
-
(a tiny protein channel embedded in a membrane) through which DNA or RNA molecules are passed in for sequencing.`, class: "gn__logo gn__logo--small", width: "36", height: "36", part: "logo logo--small" })))), this.breakpoint <= bpps.mainMenu.breakpoint && (h("div", { key: '
|
|
497
|
-
(!!this.searchIndices.length && (h("nano-dropdown", { key: '
|
|
507
|
+
(a tiny protein channel embedded in a membrane) through which DNA or RNA molecules are passed in for sequencing.`, class: "gn__logo gn__logo--small", width: "36", height: "36", part: "logo logo--small" })))), this.breakpoint <= bpps.mainMenu.breakpoint && (h("div", { key: 'c48d4d74b18f876cffee723a8da0bd4d82300b7b', class: "gn__main-menu-links" }, bpps.mainMenu.tpl())), h("div", { key: 'e433743c122dc9e4427de3f0fdd7067bcd52f558', class: "gn__main-menu-actions" }, !this.myAccountData ||
|
|
508
|
+
(!!this.searchIndices.length && (h("nano-dropdown", { key: 'e6c5655701e5a91409f5fad4f45efd868cbd1a50', dialogTitle: "Search Oxford Nanopore Technologies", placement: "bottom", class: "gn__search-dropdown", skidding: -30, distance: 25, open: this.searchBarShown, onNanoAfterShow: this.handleSearchOpenEvent, onNanoAfterHide: this.handleSearchCloseEvent, autoOpen: !!this.searchIndices.length }, h("nano-icon-button", { key: '8de3fb7f465103bda3063e96876345701d942a01', class: "gn__search-button", slot: "trigger", iconName: "light/magnifying-glass", label: "Search" }), h("form", { key: '18fca7445c9471089e013cea8d83aa749e655aab', ref: (form) => (this.searchForm = form), class: "gn__search-form", part: "search-form", onSubmit: this.onSearchSubmit }, this.searchIndices.length > 1 && (h("nano-select", { key: '7b37f759f2a24d8686d46a3ebbcb3afaa54cbbee', part: "search-select", label: "Which site do you wish to search in?", mask: true, hideLabel: true, value: this.activeIndex?.index, onNanoChange: this.handleSearchIndexChangeEvent }, this.searchIndices.map((index) => (h("nano-option", { selected: index.name === this.searchIndex, value: index.index }, index.name || index.index))))), h("nano-input", { key: '93838bee803808b06f56c14886975cd3fc8ab827', ref: (ele) => (this.searchInput = ele), part: "search-input", label: "Search Oxford Nanopore Technologies", placeholder: "Search Oxford Nanopore...", hideLabel: true, clearable: true, showInlineError: false, onNanoChange: (e) => {
|
|
498
509
|
this.handleSearchTermChangeEvent(e.detail.value);
|
|
499
|
-
}, onNanoInput: this.handleSearchTermInputEvent, debounce: 500, value: this._searchValue }, h("nano-icon", { key: '
|
|
510
|
+
}, onNanoInput: this.handleSearchTermInputEvent, debounce: 500, value: this._searchValue }, h("nano-icon", { key: 'd39203dd3727a34b60c5c71fc6b9a14c23ef2465', slot: "end", name: "light/magnifying-glass" }), h("nano-datalist", { key: '9826082e21b53f54254c8f2490b3b42c215edacb', class: "gn__search-results", onNanoSelect: (e) => e.preventDefault(), dropDownConfig: { tetherTo: this.searchForm }, disableFilter: true }, this.searchLoading && (h("div", { key: '65f17640b43bce0f44e59f092b7c8ef562f02e19', slot: "no-result", class: "gn__search-loading" }, h("nano-spinner", { key: 'f0162dd8c60aae95e35d9e02770a9398bede0828' }, "Searching..."))), this.noResultPartial(), !!this.autocompleteResults?.hits.length && [
|
|
500
511
|
this.autocompleteResults.hits.map((hit, i) => (h("nano-option", { href: hit.url, class: "gn__search-result", onClick: () => {
|
|
501
512
|
searchInsight.sendClick({
|
|
502
513
|
index: this.activeIndex.index,
|
|
@@ -506,10 +517,13 @@ const GlobalNav = class {
|
|
|
506
517
|
positions: [i + 1],
|
|
507
518
|
});
|
|
508
519
|
} }, h("span", { innerHTML: this.autocompleteSnippet(hit) })))),
|
|
509
|
-
h("nano-option", { key: '
|
|
510
|
-
])))))), h("div", { key: '
|
|
520
|
+
h("nano-option", { key: 'ddf176669705bb04a45575ee1bf8897d46ae9704', class: "gn__search-viewall", onNanoSelect: this.onSearchSubmit }, "View all results"),
|
|
521
|
+
])))))), h("div", { key: 'f84317012affbf6aa952810f627ca318f042dd0b', class: "gn__cart" }, this.cartUrl && [
|
|
522
|
+
h("nano-icon-button", { key: 'c656b17e3ee2462900fc855c8128b2e92e3ad4cb', iconName: "light/cart-shopping", label: "View your cart", href: this.cartUrl }),
|
|
523
|
+
this.cartCount && (h("nano-badge", { key: '878066adbf28890694e65f651031e35912b30f06', theme: "danger", strength: "2" }, this.cartCount > 9 ? '9+' : this.cartCount)),
|
|
524
|
+
]), this.breakpoint <= bpps.contact.breakpoint
|
|
511
525
|
? bpps.contact.tpl()
|
|
512
|
-
: '', this.isLoggedIn ? (h("nano-dropdown", { dialogTitle: "User menu", class: "gn__user-dropdown", distance: 10, placement: "bottom-end" }, h("button", { slot: "trigger", class: "gn__user-dropdown-trigger" }, h("nano-icon", { name: "light/user" }), h("nano-icon", { name: "light/chevron-down", class: "gn__user-dropdown-chevron" }), !!this.msgCount && (h("nano-badge", { theme: "danger", strength: "2" }, this.msgCount > 9 ? '9+' : this.msgCount))), this.loggedInPanel())) : (h("nano-cta", { secondary: true, size: "small", icon: "false", class: "gn__login-cta" }, h("a", { href: this.formatLoginLink(this.loginUrl) }, "Login"))))))), h("nano-global-search-results", { key: '
|
|
526
|
+
: '', this.isLoggedIn ? (h("nano-dropdown", { dialogTitle: "User menu", class: "gn__user-dropdown", distance: 10, placement: "bottom-end" }, h("button", { slot: "trigger", class: "gn__user-dropdown-trigger" }, h("nano-icon", { name: "light/user" }), h("nano-icon", { name: "light/chevron-down", class: "gn__user-dropdown-chevron" }), !!this.msgCount && (h("nano-badge", { theme: "danger", strength: "2" }, this.msgCount > 9 ? '9+' : this.msgCount))), this.loggedInPanel())) : (h("nano-cta", { secondary: true, size: "small", icon: "false", class: "gn__login-cta" }, typeof this.loginUrl === 'string' ? (h("a", { href: this.formatLoginLink(this.loginUrl) }, "Login")) : (h("button", { onClick: this.loginUrl }, "Login")))))))), h("nano-global-search-results", { key: 'afb40b7671b51b72cc58ce006b6ed163fb1d1e78', part: "site-search-results" }, h("div", { key: '660f6ad6fb20ca8c88118b44bdb2b44b3a06f19b', class: "gn__site", part: "site-wrapper" }, h("slot", { key: 'fcd45d11fb7fcdcf986940f8a4bda1287635856a' }))))));
|
|
513
527
|
}
|
|
514
528
|
static get assetsDirs() { return ["assets"]; }
|
|
515
529
|
static get watchers() { return {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Custom elements for Nanopore-Digital Web applications
|
|
3
3
|
*/
|
|
4
|
-
import{g as n,r as e,c as a,a as o,k as t}from"./index-BM3Om9WE.js";import{a as i}from"./algoliasearch-lite.esm.browser-BTIloVU8.js";import{h as r}from"./renderer-DpNDfhNy.js";import{d as s}from"./throttle-C93FMm2Z.js";import{a as l}from"./style-Ds52s5za.js";import{s as c}from"./search-insights-8OL2oeQN.js";const h=class{get host(){return n(this)}overflowMenu;overflowOpen=!1;logoUrl=location.protocol+"//"+location.host;cartUrl="";msgUrl="";loginUrl="";logoutUrl="";contactUrl="https://nanoporetech.com/contact";_sessionRedirect=window.location.href;get sessionRedirect(){return encodeURIComponent(this._sessionRedirect)}set sessionRedirect(n){this._sessionRedirect=n}cartCount=0;msgCount=0;async openOverflowMenu(){this.overflowOpen=!0}async closeOverflowMenu(){this.overflowOpen=!1}myAccountUrl;async handleMyAccountUrl(){this.myAccountUrl&&("local-logged-in"!==this.myAccountUrl?"local-logged-out"!==this.myAccountUrl?fetch(this.myAccountUrl+"/nav_bar_data.json").then((n=>n.json())).then((n=>{this.myAccountData=n})).catch((n=>{console.error("Error fetching MyAccount data",n)})):this.myAccountData=await import("./local-logged-out-BuucpKxf.js"):this.myAccountData=await import("./local-logged-in-B3A7tw10.js"))}myAccountData;nanoUserData;userLinks=[];isLoggedIn=!1;get myAccountUser(){return this.myAccountData?.user?.uuid?this.myAccountData.user:null}processUserData(){this.myAccountUser&&(this.userLinks=this.myAccountData?.links.filter((n=>"profile-panel-list"===n.area)),this.loginUrl=this.loginUrl||this.myAccountData.urls.login,this.logoutUrl=this.logoutUrl||this.myAccountData.urls.logout,this.msgUrl=this.msgUrl||this.myAccountData.urls.messages,this.msgCount=this.msgCount||this.myAccountData.notifications.count,this.cartUrl=this.cartUrl||this.myAccountData.urls.cart,this.cartCount=this.cartCount||this.myAccountData.cart.count,this.isLoggedIn=!0,this.nanoUserData.emit(this.myAccountUser))}formatLoginLink(n){return n?this.sessionRedirect?n.endsWith("=")?n+this.sessionRedirect:n.includes("?")?n+"&ReplayState="+this.sessionRedirect:n+"?ReplayState="+this.sessionRedirect:n:""}resizeObserver;cachedWidth;mainMenu;_mainMenuBar;get mainMenuBar(){return this._mainMenuBar}set mainMenuBar(n){this._mainMenuBar!==n&&(this._mainMenuBar=n,this.addMainmenuRo())}async triggerResize(){this.shouldResize=!0,this.breakpoint=0}shouldResize=!0;breakpoint=0;breakpointChanged(){this.breakpoint<this.bpPartials.mainMenu.breakpoint&&!1===this.shouldResize&&(this.overflowOpen=!1)}debounceResetResize=s((()=>{this.shouldResize=!1}),300);addMainmenuRo(){this.removeMainmenuRo(),(this.resizeObserver=new ResizeObserver((()=>{this.shouldResize||this.mainMenuBar.clientWidth>=this.cachedWidth&&0===this.breakpoint||this.mainMenuBar.clientWidth<=this.cachedWidth&&this.mainMenuBar.clientWidth>=this.mainMenu.scrollWidth||(this.shouldResize=!0,this.breakpoint=0)}))).observe(this.mainMenuBar)}removeMainmenuRo(){this.resizeObserver&&(this.mainMenuBar?this.resizeObserver.unobserve(this.mainMenuBar):this.resizeObserver.disconnect())}handleResize=()=>{this.shouldResize&&(this.breakpoint<4&&this.mainMenu.scrollWidth>this.mainMenuBar.clientWidth?this.breakpoint++:(this.cachedWidth=this.mainMenuBar.clientWidth,this.debounceResetResize()))};algoliaClient;searchResults;searchInput;activeIndex;autocompleteResults;searchForm;searchIndices=[];searchBarShown=!1;searchLoading=!1;_searchValue="";nanoSearchResult;nanoSearchError;nanoSearchReset;searchIndex="All";get searchValue(){return this._searchValue}set searchValue(n){n&&this.host.componentOnReady().then((()=>{this.searchBarShown=!0,this.handleSearchTermChangeEvent(n)}))}async submitSearch(){this.onSearchSubmit()}handleSearchIndex(){if(this.searchIndices?.length){if(this.searchIndex)return this.activeIndex=this.searchIndices.find((n=>n.name===this.searchIndex))||this.searchIndices[0],this.activeIndex;this.activeIndex=this.searchIndices[0]}}initSearch(){if(!this.myAccountData)return;const{search:n}=this.myAccountData;n?.app_id&&n?.api_key&&(this.algoliaClient=i(n.app_id,n.api_key),c.init(n.app_id,n.api_key).then((()=>{this.myAccountUser&&c.setUser(this.myAccountUser.uuid)})),this.searchIndices=this.myAccountData.search.indeces,this.searchIndices.forEach((n=>{n.algoliaIndex=this.algoliaClient.initIndex(n.index)})),this.searchIndex||(this.searchIndex=this.searchIndices[0].name))}onSearchSubmit=async n=>{if(n&&n.preventDefault(),!this.activeIndex||!this.myAccountData||this._searchValue?.length<3)return;this.searchResults||await this.doAlgoliaSearch();const{search:e}=this.myAccountData,a=this.searchResults?.results.find((n=>this.activeIndex.index===n.index)),{index:o,domain:t,filters:i,query:r,replicas:s}=a;this.searchBarShown=!1,this.nanoSearchResult.emit({meta:{indexTitle:a.indexName,index:o,domain:t,filters:i,query:r,replicas:s},client:{apiKey:e.api_key,appId:e.app_id}})};async doAlgoliaSearch(){if(this.searchResults=null,!this.algoliaClient)return;const n=this.searchIndices.map((n=>{const e={clickAnalytics:!0,attributesToSnippet:["body:5","title:8"],indexName:n.index,query:this._searchValue,facets:n.filters,hitsPerPage:5,filters:""};return"Community"===n.name&&(e.filters="created > "+Math.floor((Date.now()-631152e5)/1e3)),e}));try{this.searchLoading=!0,this.searchResults=this.processSearchResults(await this.algoliaClient.search(n))}catch(n){console.error(n),this.nanoSearchError.emit(n)}return this.searchLoading=!1,this.searchResults}processSearchResults(n){const e=n,a=n;return e?.results?(e.results.forEach(((n,a)=>{n={...n,indexName:this.searchIndices[a].name,selected:this.activeIndex.name===this.searchIndices[a].name,domain:this.activeIndex.domain||null,domains:this.myAccountData.domains||null,allGroup:!!this.searchIndices[a].allGroup,filters:this.searchIndices[a].filters,replicas:this.activeIndex.replicas},e.results[a]=this.processSearchResults(n)})),e):(a.hits.map((n=>{n.url&&!n.url.match(/^http/)&&(n.url=location.protocol+"//"+this.domainFor(n.origin)+n.url)})),a)}domainFor(n){if(!this.myAccountData)return"";const e=this.myAccountData.domains.find((e=>e.origin===n));return e?e.domain:""}async setAutocompleteResults(){this.autocompleteResults=null,this._searchValue.length<3?this._searchValue.length||this.nanoSearchReset.emit():this.autocompleteResults=(await this.doAlgoliaSearch())?.results.find((n=>n.selected))}autocompleteSnippet(n){return n._snippetResult?.title?.value||n.title}handleSearchOpenEvent=n=>{n.target.classList.contains("gn__search-dropdown")&&this.searchInput&&(this.searchInput.setFocus(),this.searchBarShown=!0)};handleSearchCloseEvent=n=>{n.target.classList.contains("gn__search-dropdown")&&requestAnimationFrame((()=>this.searchBarShown=!1))};handleSearchTermInputEvent=n=>{"input"===n.detail.type&&this.searchInput.value.length>=3&&(this.autocompleteResults=null,this.searchLoading=!0)};handleSearchTermChangeEvent=n=>{this._searchValue!==n&&(this._searchValue=n,this.setAutocompleteResults())};handleSearchIndexChangeEvent=n=>{if(!n.detail?.value?.length)return;const e=n.detail.value;if(this.activeIndex.index===e)return;const a=this.searchIndices.find((n=>n.index===e));a&&a.algoliaIndex&&(this.searchIndex=a.name,this._searchValue.length>=3&&(this.searchInput.setFocus(),this.searchBarShown=!0,this.setAutocompleteResults()))};constructor(n){e(this,n),this.nanoUserData=a(this,"nanoUserData",7),this.nanoSearchResult=a(this,"nanoSearchResult",7),this.nanoSearchError=a(this,"nanoSearchError",7),this.nanoSearchReset=a(this,"nanoSearchReset",7),this.handleResize=s(this.handleResize,75)}componentWillLoad(){this.handleMyAccountUrl(),this.initSearch(),this.processUserData(),l(this.host.shadowRoot)}componentDidRender(){this.handleResize()}loggedInPanel(){if(this.isLoggedIn&&this.myAccountUser)return r("div",{part:"user-panel",class:"gn__user-panel nano-theme-dark"},r("div",{class:"gn__user-panel-head",slot:"label"},r("nano-avatar",{initials:this.myAccountUser.first_name?.charAt(0)+this.myAccountUser.last_name?.charAt(0)},this.myAccountUser.small_avatar_url&&!this.myAccountUser.small_avatar_url.includes("generic")&&r("img",{src:this.myAccountUser.small_avatar_url,alt:"User Avatar",height:40,width:40})),r("div",null,this.myAccountUser.name,r("br",null),this.myAccountUser.job_title,", ",this.myAccountUser.company)),r("div",{class:"gn__user-panel-body"},this.userLinks.map((n=>r("a",{href:n.address,target:n.target||void 0},n.title,("Messages"===n.title||n.address.includes(this.msgUrl)||this.msgUrl.includes(n.address))&&this.msgCount>0&&r("nano-badge",{theme:"danger",strength:"2"},this.msgCount))))),r("div",{class:"gn__user-panel-foot"},r("nano-cta",{secondary:!0,size:"small",icon:"false",class:"gn__login-cta"},r("a",{href:this.formatLoginLink(this.logoutUrl)},"Logout"))))}bpPartials={contact:{tpl:()=>r("a",{href:this.contactUrl},"Contact"),breakpoint:0},mainMenu:{tpl:()=>r("slot",{name:"menu"}),breakpoint:1},logo:{tpl:()=>{},breakpoint:2}};noResultPartial(){if(this.searchLoading||this.autocompleteResults?.hits.length||this._searchValue.length<3)return;const n=[];return"All"===this.searchIndex?(n.push(r("div",{slot:"no-result",class:"gn__search-no-results"},'No results matching for "',r("strong",null,this._searchValue),'" Try another phrase')),n):(this.searchResults?.results.forEach((e=>{e.hits.length&&n.push(r("nano-option",{class:"gn__search-result",onNanoSelect:n=>{n.preventDefault(),this.searchIndex=e.indexName,this.onSearchSubmit(n)}},'Show results for "',r("strong",null,this._searchValue),'" in ',r("strong",null,e.indexName)))})),n.unshift(r("div",{slot:n.length?"list-top":"no-result",class:"gn__search-no-results"},'No results matching for "',r("strong",null,this._searchValue),'" in'," ",r("strong",null,this.searchIndex),". Try another phrase")),n)}render(){const n=this.bpPartials;return r(o,{key:"3964e8a3aab86d4252876816ca934c69e75da22b",class:{"overflow-menu":this.breakpoint>n.mainMenu.breakpoint,"bar-menu":this.breakpoint<=n.mainMenu.breakpoint,"nano-global-nav":!0}},r("div",{key:"fc2f728b3c4412913ffc2d18c07d057bf6e0bf87",class:{gn:!0,"gn__search-open":this.searchBarShown}},r("nano-drawer",{key:"9a2c9109327ff9cd4eb2553df7e93571a29aa237",ref:n=>this.overflowMenu=n,label:"Main menu",part:"drawer",class:"gn__drawer nano-theme-dark",placement:"start",open:this.overflowOpen,onNanoAfterHide:()=>this.overflowOpen=!1,onNanoAfterShow:()=>this.overflowOpen=!0},r("div",{key:"649c672f237ce2145eda6c8988744f6709835615",class:"gn__drawer-header",part:"overflow-header",slot:"label"},"Main menu"),r("nav",{key:"d002c07a9eb1cdcc4e188e5b146ce8a11257ab98",class:"gn__drawer-menu",part:"overflow-menu"},this.breakpoint>n.mainMenu.breakpoint?n.mainMenu.tpl():"",r("slot",{key:"b6bf65e8ed92636f1eba4b376ecb2fd617bcd67f",name:"overflow"}))),r("div",{key:"b7a5e9d074b63f1841d3946d0166389c73161f25",class:"gn__menu-bar-wrapper"},r("div",{key:"6b4d27a83ed4cbf3a62c0b924b08c887e415904a",class:"gn__menu-bar",part:"menu-bar",ref:n=>this.mainMenuBar=n},r("nav",{key:"bf3736fc4eb98e53a04357e30cd49fab8bf9ef7d","aria-label":"Global navigation",class:"gn__main-menu "+(this.shouldResize?"resizing":""),part:"main-menu",ref:n=>this.mainMenu=n},this.breakpoint>n.mainMenu.breakpoint&&r("nano-icon-button",{key:"fb90f7ea03281cd5543b7723df27ac704367e43f",class:"gn__overflow-button",iconName:"light/bars",label:"Open Menu",onClick:()=>this.overflowMenu.show()}),r("slot",{key:"94e0abe01ad7562fb72abde08ebad80e95d11042",name:"logo"},r("a",{key:"1b01613c642f2bfd1df9df3d35517c6261f40b41",href:this.logoUrl,class:"gn__logo-link",part:"logo-link"},r("img",this.breakpoint<=n.logo.breakpoint?{src:t("../nano-assets/ont-logo.svg"),alt:"Oxford Nanopore Technologies logo. Features a stylised representation of a nanopore,\n (a tiny protein channel embedded in a membrane) through which DNA or RNA molecules are passed in for sequencing.",class:"gn__logo gn__logo--large",width:"152",height:"36",part:"logo logo--large"}:{src:t("../nano-assets/ont-wheel.svg"),alt:"Oxford Nanopore Technologies logo. A stylised representation of a nanopore,\n (a tiny protein channel embedded in a membrane) through which DNA or RNA molecules are passed in for sequencing.",class:"gn__logo gn__logo--small",width:"36",height:"36",part:"logo logo--small"}))),this.breakpoint<=n.mainMenu.breakpoint&&r("div",{key:"6b303f5b2de6b26a5ec9480e08a0269fcf2f6857",class:"gn__main-menu-links"},n.mainMenu.tpl()),r("div",{key:"c2a63e53e7d72e5fabf40190d78d780d25f34c99",class:"gn__main-menu-actions"},!this.myAccountData||!!this.searchIndices.length&&r("nano-dropdown",{key:"1ec162b4ecbfc8360d152780cb29a6274cca3d7d",dialogTitle:"Search Oxford Nanopore Technologies",placement:"bottom",class:"gn__search-dropdown",skidding:-30,distance:25,open:this.searchBarShown,onNanoAfterShow:this.handleSearchOpenEvent,onNanoAfterHide:this.handleSearchCloseEvent,autoOpen:!!this.searchIndices.length},r("nano-icon-button",{key:"978738e596466f583580e48b330a96bac0b14fdc",class:"gn__search-button",slot:"trigger",iconName:"light/magnifying-glass",label:"Search"}),r("form",{key:"6227358213b66c38888cce78218291144c33ca71",ref:n=>this.searchForm=n,class:"gn__search-form",part:"search-form",onSubmit:this.onSearchSubmit},this.searchIndices.length>1&&r("nano-select",{key:"36c4fe6caebc5e38702987ae9e3ba05d79e7ae28",part:"search-select",label:"Which site do you wish to search in?",mask:!0,hideLabel:!0,value:this.activeIndex?.index,onNanoChange:this.handleSearchIndexChangeEvent},this.searchIndices.map((n=>r("nano-option",{selected:n.name===this.searchIndex,value:n.index},n.name||n.index)))),r("nano-input",{key:"d10bf62d983978ab9a3c20f0cd1f64e543dea593",ref:n=>this.searchInput=n,part:"search-input",label:"Search Oxford Nanopore Technologies",placeholder:"Search Oxford Nanopore...",hideLabel:!0,clearable:!0,showInlineError:!1,onNanoChange:n=>{this.handleSearchTermChangeEvent(n.detail.value)},onNanoInput:this.handleSearchTermInputEvent,debounce:500,value:this._searchValue},r("nano-icon",{key:"f5d7f79ac22c414adb0d02219a215618ccd89a7b",slot:"end",name:"light/magnifying-glass"}),r("nano-datalist",{key:"a80c13a3d9382c730408d80f7f2058ca886678d2",class:"gn__search-results",onNanoSelect:n=>n.preventDefault(),dropDownConfig:{tetherTo:this.searchForm},disableFilter:!0},this.searchLoading&&r("div",{key:"1671b2988094fbefc0f3a7dfc09dd03688141e12",slot:"no-result",class:"gn__search-loading"},r("nano-spinner",{key:"dd88116ffa3881fe272673d57686f12159f056e4"},"Searching...")),this.noResultPartial(),!!this.autocompleteResults?.hits.length&&[this.autocompleteResults.hits.map(((n,e)=>r("nano-option",{href:n.url,class:"gn__search-result",onClick:()=>{c.sendClick({index:this.activeIndex.index,eventName:"Global nav quick search - search result clicked",queryID:this.autocompleteResults.queryID,objectIDs:[n.objectID],positions:[e+1]})}},r("span",{innerHTML:this.autocompleteSnippet(n)})))),r("nano-option",{key:"acbff4930245aabfbfe3d94cccbf0916a6419509",class:"gn__search-viewall",onNanoSelect:this.onSearchSubmit},"View all results")])))),r("div",{key:"91cdf552cbf807a5f307da6381ff16fbba419bbe",class:"gn__cart"},r("nano-icon-button",{key:"19c225ced356309ee741c74bc07fa7238e7bc9ff",iconName:"light/cart-shopping",label:"View your cart",href:this.cartUrl}),!!this.cartCount&&r("nano-badge",{key:"6c7d8a2da3276c017cb67f58b48a7358db22b428",theme:"danger",strength:"2"},this.cartCount>9?"9+":this.cartCount)),this.breakpoint<=n.contact.breakpoint?n.contact.tpl():"",this.isLoggedIn?r("nano-dropdown",{dialogTitle:"User menu",class:"gn__user-dropdown",distance:10,placement:"bottom-end"},r("button",{slot:"trigger",class:"gn__user-dropdown-trigger"},r("nano-icon",{name:"light/user"}),r("nano-icon",{name:"light/chevron-down",class:"gn__user-dropdown-chevron"}),!!this.msgCount&&r("nano-badge",{theme:"danger",strength:"2"},this.msgCount>9?"9+":this.msgCount)),this.loggedInPanel()):r("nano-cta",{secondary:!0,size:"small",icon:"false",class:"gn__login-cta"},r("a",{href:this.formatLoginLink(this.loginUrl)},"Login")))))),r("nano-global-search-results",{key:"7a58924f37e6f4517bec274b3a878a6e3d3e2553",part:"site-search-results"},r("div",{key:"062c09847198b236c0731d6653584115ddd46e71",class:"gn__site",part:"site-wrapper"},r("slot",{key:"971633747f2ec2a6a4dbee587a5a5ccfaaedc088"})))))}static get assetsDirs(){return["assets"]}static get watchers(){return{myAccountUrl:["handleMyAccountUrl"],myAccountData:["processUserData","initSearch"],shouldResize:["breakpointChanged"],breakpoint:["breakpointChanged"],searchIndices:["handleSearchIndex"],searchIndex:["handleSearchIndex"]}}};h.style=':host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{--main-menu-bar-bg-color:var(--nano-color-base-0);--main-menu-text-color:var(--nano-color-base-1000);--main-menu-hover-text-color:var(--nano-color-primary-1000);--main-menu-active-text-color:var(--nano-color-primary-1200);--main-menu-active-border-color:var(--nano-color-primary-1000);--overflow-bg-color:var(--nano-color-grey-mono-1600);--overflow-text-color:var(--nano-color-basic-white);--overflow-hover-text-color:var(--nano-color-blue-cerulean-700);--overflow-active-text-color:var(--nano-color-blue-cerulean-300);display:block;color:var(--main-menu-text-color)}img{max-inline-size:none;display:block;block-size:revert-layer}::slotted(a),:host::slotted(a),a{text-decoration:none}a:has(img){display:inline-block}a:focus{outline:var(--nano-focus-ring);outline-offset:var(--nano-focus-ring-offset)}nano-drawer:not(:defined){display:none}nano-badge{position:absolute;font-size:0.5625rem;pointer-events:none}.gn__cart{position:relative}.gn__cart nano-badge{inset-block-start:-0.35rem;inset-inline-end:-0.4rem}.gn__login-cta{--bg:transparent;--font-size:var(--nano-font-size-2xs);--padding-v:0.5em}.gn__menu-bar-wrapper{z-index:calc(var(--nano-z-index-menubar) + 1);position:relative}.gn__menu-bar-wrapper::after{content:"";position:absolute;block-size:1px;inline-size:100%;inset-inline:0;inset-block-end:-1px;z-index:-3;background-color:var(--nano-color-neutral-200)}.gn__menu-bar{inline-size:100%;overflow:clip;background-color:var(--main-menu-bar-bg-color)}.gn__menu-bar a{color:var(--main-menu-text-color)}.gn__menu-bar a:hover{color:var(--main-menu-hover-text-color)}.gn__menu-bar a:active{color:var(--main-menu-active-text-color)}.gn__main-menu{display:inline-flex;align-items:center;min-inline-size:100%;padding:var(--nano-spacing-md);transition:opacity var(--nano-transition-x-fast) ease;opacity:1}.gn__main-menu.resizing{transition:none;opacity:0}.gn__main-menu>*{margin-inline-end:var(--nano-spacing-xl)}.gn__main-menu>*:is(slot,slot-fb){display:flex}.gn__main-menu>*:last-child{margin-inline-end:0}.gn__overflow-button{--padding:0.5rem 0.875rem 0.5rem 0;margin-inline-end:0.875rem;font-size:1.125rem;position:relative}.gn__overflow-button::after{content:"";position:absolute;inline-size:1px;block-size:100%;inset-inline-end:0;background-color:var(--nano-color-neutral-300);opacity:0.7;inset-block-start:0}.gn__main-menu-links,.gn__main-menu-actions{display:inline-flex;align-items:center}.gn__main-menu-links .nano-icon,.gn__main-menu-links .nano-icon-button,.gn__main-menu-actions .nano-icon,.gn__main-menu-actions .nano-icon-button{--active-color:var(--main-menu-active-text-color);--hover-color:var(--main-menu-hover-text-color);font-size:1rem}.gn__main-menu-links .nano-icon-button:hover,.gn__main-menu-actions .nano-icon-button:hover{color:var(--main-menu-hover-text-color)}.gn__main-menu-links{gap:var(--nano-spacing-xl)}.gn__main-menu-links ::slotted(a),.gn__main-menu-links::slotted(a){color:var(--main-menu-text-color)}.gn__main-menu-links ::slotted(a:hover){color:var(--main-menu-hover-text-color)}.gn__main-menu-links ::slotted(*:active){color:var(--main-menu-active-text-color)}.gn__main-menu-actions{margin-inline-start:auto;font-size:0.9375rem;gap:var(--nano-spacing-md)}.gn__search-dropdown{--overflow:visible;--padding:0;--background:transparent}.gn__search-dropdown .nano-icon-button{position:relative}.gn__search-dropdown .nano-icon-button::before{content:"";position:absolute;background-color:var(--main-menu-active-border-color);block-size:4px;inset-inline:5px 2px;inset-block-end:-1.5625rem;transform:translateZ(0) scaleX(0);transform-origin:0 center;transition:transform var(--nano-transition-x-fast) ease-in-out}.gn__search-open .gn__search-dropdown .nano-icon-button::before{transform:translateZ(0) scaleX(1)}.gn__search-form{display:inline-flex;max-inline-size:100vw;inline-size:30.625rem}.gn__search-form .nano-select{--input-bg-color:var(--nano-color-neutral-200);flex:0}.gn__search-form .nano-select:focus-within{z-index:1}.gn__search-form .nano-select .form-ctrl__input{border-inline-end:none}.gn__search-form .nano-input{flex:1}.gn__search-results{--padding-start:var(--nano-spacing-md);--padding-top:var(--nano-spacing-sm);--padding-bottom:var(--nano-spacing-sm);font-size:var(--nano-font-size-2xs)}.gn__search-loading{display:flex;justify-content:center}.gn__search-result{--padding-start:0.3125rem;--padding-top:var(--nano-spacing-sm);--padding-bottom:var(--nano-spacing-sm);--bg-focus:var(--nano-color-primary-300);--color-focus:var(--nano-color-neutral-1400);--color:var(--nano-color-neutral-1400);font-size:var(--nano-font-size-2xs)}.gn__search-result .search__highlight{font-style:normal;background:var(--nano-color-highlight)}.gn__search-viewall{--bg-focus:var(--nano-color-primary-300);--color-focus:var(--nano-color-neutral-1400);--color:var(--nano-color-primary-1200)}.gn__search-viewall::part(label){justify-content:flex-end;text-decoration:underline}.gn__user-dropdown-trigger{all:unset;cursor:pointer;color:var(--nano-color-primary-1200);display:flex;white-space:nowrap;gap:var(--nano-spacing-xs);align-items:center;position:relative;padding-inline-start:var(--nano-spacing-md)}.gn__user-dropdown-trigger:hover{color:var(--main-menu-hover-text-color)}.gn__user-dropdown-trigger:active{color:var(--main-menu-active-text-color)}.gn__user-dropdown-trigger:focus-visible{outline:var(--nano-focus-ring);outline-offset:var(--nano-focus-ring-offset)}.gn__user-dropdown-trigger::before{content:"";position:absolute;inline-size:1px;block-size:100%;inset-inline-start:0;background-color:var(--nano-color-neutral-300);opacity:0.7;inset-block-start:0}.gn__user-dropdown-trigger .gn__user-dropdown-chevron{transition:rotate var(--nano-transition-x-fast) linear}[open] .gn__user-dropdown-trigger .gn__user-dropdown-chevron{rotate:180deg}.gn__user-dropdown-trigger nano-badge{inset-block-start:-0.7rem;inset-inline-end:-0.7rem}.gn__user-dropdown{--background:var(--overflow-bg-color);--padding:0;--overflow:visible}.gn__user-panel{inline-size:21.25rem;max-inline-size:21.25rem;color:var(--overflow-text-color);padding:var(--nano-spacing-md)}.gn__user-panel a{color:var(--overflow-text-color)}.gn__user-panel a:hover{text-decoration:underline;color:var(--overflow-hover-text-color)}.gn__user-panel-head{font-size:var(--nano-font-size-xs);line-height:var(--nano-line-height-normal);letter-spacing:var(--nano-letter-spacing-loose);padding-block-end:var(--nano-spacing-md);display:flex;align-items:center;gap:var(--nano-spacing-sm);font-size:var(--nano-font-size-xs)}.gn__user-panel-head .gn__user-avatar nano-icon{font-size:2.5rem}.gn__user-panel-body{display:flex;flex-direction:column}.gn__user-panel-body a{position:relative;border-block-end:1px solid rgb(var(--nano-color-base-rgb-1000)/10%);padding-block:var(--nano-spacing-md)}.gn__user-panel-body a:first-child{border-block-start:1px solid rgb(var(--nano-color-base-rgb-1000)/10%)}.gn__user-panel-foot{padding-block-start:var(--nano-spacing-md);display:flex;align-items:center;justify-content:space-between;gap:var(--nano-spacing-md)}.gn__drawer{--panel-background:var(--overflow-bg-color);--header-button-color:var(--overflow-text-color);--body-spacing:0;--header-spacing:var(--nano-spacing-md) 0;--footer-spacing:var(--nano-spacing-md)}.gn__drawer::part(title){display:flex;justify-content:flex-end}.gn__drawer::part(header-actions){order:-1}.gn__drawer-header{clip-path:inset(50%);block-size:1px;overflow:hidden;position:absolute;white-space:nowrap;inline-size:1px}.gn__drawer-menu{display:flex;flex-direction:column;margin:0 var(--nano-spacing-md);padding-block-end:var(--nano-spacing-md);color:var(--overflow-text-color);border-block-start:1px solid rgb(var(--nano-color-base-rgb-1000)/10%);position:relative}.gn__drawer-menu ::slotted(a),.gn__drawer-menu::slotted(a){padding:var(--nano-spacing-md) 0}.gn__drawer-menu ::slotted(a),.gn__drawer-menu ::slotted(.nano-nav-item),.gn__drawer-menu::slotted(a),.gn__drawer-menu::slotted(.nano-nav-item){--padding:var(--nano-spacing-md) 0;display:block;color:inherit !important;border-block-end:1px solid rgb(var(--nano-color-base-rgb-1000)/10%)}.gn__drawer-menu ::slotted(a:hover),.gn__drawer-menu ::slotted(.nano-nav-item:hover){text-decoration:underline;color:var(--overflow-hover-text-color) !important}';export{h as nano_global_nav}
|
|
4
|
+
import{g as n,r as e,c as a,a as t,k as o}from"./index-BM3Om9WE.js";import{a as i}from"./algoliasearch-lite.esm.browser-BTIloVU8.js";import{h as r}from"./renderer-DpNDfhNy.js";import{d as s}from"./throttle-C93FMm2Z.js";import{a as l}from"./style-Ds52s5za.js";import{s as c}from"./search-insights-8OL2oeQN.js";const h=class{get host(){return n(this)}overflowMenu;overflowOpen=!1;logoUrl=location.protocol+"//"+location.host;cartUrl="";msgUrl="";loginUrl="";logoutUrl="";contactUrl="https://nanoporetech.com/contact";_sessionRedirect=window.location.href;get sessionRedirect(){return encodeURIComponent(this._sessionRedirect)}set sessionRedirect(n){this._sessionRedirect=n}cartCount=0;msgCount=0;async openOverflowMenu(){this.overflowOpen=!0}async closeOverflowMenu(){this.overflowOpen=!1}myAccountUrl;async handleMyAccountUrl(){this.myAccountUrl&&("local-logged-in"!==this.myAccountUrl?"local-logged-out"!==this.myAccountUrl?fetch(this.myAccountUrl+"/nav_bar_data.json").then((n=>n.json())).then((n=>{this.myAccountData=n})).catch((n=>{console.error("Error fetching MyAccount data",n)})):this.myAccountData=await import("./local-logged-out-BuucpKxf.js"):this.myAccountData=await import("./local-logged-in-B3A7tw10.js"))}myAccountData;nanoUserData;userLinks=[];isLoggedIn=!1;get myAccountUser(){return this.myAccountData?.user?.uuid?this.myAccountData.user:null}processUserData(){if(!this.myAccountUser)return this.isLoggedIn=!1,this.userLinks=[],this.msgUrl="",this.msgCount=0,void this.nanoUserData.emit(null);this.userLinks=this.myAccountData?.links?.filter((n=>"profile-panel-list"===n.area))||[],this.loginUrl=this.loginUrl||this.myAccountData.urls?.login,this.logoutUrl=this.logoutUrl||this.myAccountData.urls?.logout,this.msgUrl=this.msgUrl||this.myAccountData.urls?.messages,this.msgCount=this.msgCount||this.myAccountData.notifications?.count,this.cartUrl=this.cartUrl||this.myAccountData.urls?.cart,this.cartCount=this.cartCount||this.myAccountData.cart?.count,this.isLoggedIn=!0,this.nanoUserData.emit(this.myAccountUser)}formatLoginLink(n){return n?this.sessionRedirect?n.endsWith("=")?n+this.sessionRedirect:n.includes("?")?n+"&ReplayState="+this.sessionRedirect:n+"?ReplayState="+this.sessionRedirect:n:""}resizeObserver;cachedWidth;mainMenu;_mainMenuBar;get mainMenuBar(){return this._mainMenuBar}set mainMenuBar(n){this._mainMenuBar!==n&&(this._mainMenuBar=n,this.addMainmenuRo())}async triggerResize(){this.shouldResize=!0,this.breakpoint=0}shouldResize=!0;breakpoint=0;breakpointChanged(){this.breakpoint<this.bpPartials.mainMenu.breakpoint&&!1===this.shouldResize&&(this.overflowOpen=!1)}debounceResetResize=s((()=>{this.shouldResize=!1}),300);addMainmenuRo(){this.removeMainmenuRo(),(this.resizeObserver=new ResizeObserver((()=>{this.shouldResize||this.mainMenuBar.clientWidth>=this.cachedWidth&&0===this.breakpoint||this.mainMenuBar.clientWidth<=this.cachedWidth&&this.mainMenuBar.clientWidth>=this.mainMenu.scrollWidth||(this.shouldResize=!0,this.breakpoint=0)}))).observe(this.mainMenuBar)}removeMainmenuRo(){this.resizeObserver&&(this.mainMenuBar?this.resizeObserver.unobserve(this.mainMenuBar):this.resizeObserver.disconnect())}handleResize=()=>{this.shouldResize&&(this.breakpoint<4&&this.mainMenu.scrollWidth>this.mainMenuBar.clientWidth?this.breakpoint++:(this.cachedWidth=this.mainMenuBar.clientWidth,this.debounceResetResize()))};algoliaClient;searchResults;searchInput;activeIndex;autocompleteResults;searchForm;searchIndices=[];searchBarShown=!1;searchLoading=!1;_searchValue="";nanoSearchResult;nanoSearchError;nanoSearchReset;searchIndex="All";get searchValue(){return this._searchValue}set searchValue(n){n&&this.host.componentOnReady().then((()=>{this.searchBarShown=!0,this.handleSearchTermChangeEvent(n)}))}async submitSearch(){this.onSearchSubmit()}handleSearchIndex(){if(this.searchIndices?.length){if(this.searchIndex)return this.activeIndex=this.searchIndices.find((n=>n.name===this.searchIndex))||this.searchIndices[0],this.activeIndex;this.activeIndex=this.searchIndices[0]}}initSearch(){if(!this.myAccountData)return;const{search:n}=this.myAccountData;n?.app_id&&n?.api_key&&(this.algoliaClient=i(n.app_id,n.api_key),c.init(n.app_id,n.api_key).then((()=>{this.myAccountUser&&c.setUser(this.myAccountUser.uuid)})),this.searchIndices=this.myAccountData.search.indeces,this.searchIndices.forEach((n=>{n.algoliaIndex=this.algoliaClient.initIndex(n.index)})),this.searchIndex||(this.searchIndex=this.searchIndices[0].name))}onSearchSubmit=async n=>{if(n&&n.preventDefault(),!this.activeIndex||!this.myAccountData||this._searchValue?.length<3)return;this.searchResults||await this.doAlgoliaSearch();const{search:e}=this.myAccountData,a=this.searchResults?.results.find((n=>this.activeIndex.index===n.index)),{index:t,domain:o,filters:i,query:r,replicas:s}=a;this.searchBarShown=!1,this.nanoSearchResult.emit({meta:{indexTitle:a.indexName,index:t,domain:o,filters:i,query:r,replicas:s},client:{apiKey:e.api_key,appId:e.app_id}})};async doAlgoliaSearch(){if(this.searchResults=null,!this.algoliaClient)return;const n=this.searchIndices.map((n=>{const e={clickAnalytics:!0,attributesToSnippet:["body:5","title:8"],indexName:n.index,query:this._searchValue,facets:n.filters,hitsPerPage:5,filters:""};return"Community"===n.name&&(e.filters="created > "+Math.floor((Date.now()-631152e5)/1e3)),e}));try{this.searchLoading=!0,this.searchResults=this.processSearchResults(await this.algoliaClient.search(n))}catch(n){console.error(n),this.nanoSearchError.emit(n)}return this.searchLoading=!1,this.searchResults}processSearchResults(n){const e=n,a=n;return e?.results?(e.results.forEach(((n,a)=>{n={...n,indexName:this.searchIndices[a].name,selected:this.activeIndex.name===this.searchIndices[a].name,domain:this.activeIndex.domain||null,domains:this.myAccountData.domains||null,allGroup:!!this.searchIndices[a].allGroup,filters:this.searchIndices[a].filters,replicas:this.activeIndex.replicas},e.results[a]=this.processSearchResults(n)})),e):(a.hits.map((n=>{n.url&&!n.url.match(/^http/)&&(n.url=location.protocol+"//"+this.domainFor(n.origin)+n.url)})),a)}domainFor(n){if(!this.myAccountData)return"";const e=this.myAccountData.domains.find((e=>e.origin===n));return e?e.domain:""}async setAutocompleteResults(){this.autocompleteResults=null,this._searchValue.length<3?this._searchValue.length||this.nanoSearchReset.emit():this.autocompleteResults=(await this.doAlgoliaSearch())?.results.find((n=>n.selected))}autocompleteSnippet(n){return n._snippetResult?.title?.value||n.title}handleSearchOpenEvent=n=>{n.target.classList.contains("gn__search-dropdown")&&this.searchInput&&(this.searchInput.setFocus(),this.searchBarShown=!0)};handleSearchCloseEvent=n=>{n.target.classList.contains("gn__search-dropdown")&&requestAnimationFrame((()=>this.searchBarShown=!1))};handleSearchTermInputEvent=n=>{"input"===n.detail.type&&this.searchInput.value.length>=3&&(this.autocompleteResults=null,this.searchLoading=!0)};handleSearchTermChangeEvent=n=>{this._searchValue!==n&&(this._searchValue=n,this.setAutocompleteResults())};handleSearchIndexChangeEvent=n=>{if(!n.detail?.value?.length)return;const e=n.detail.value;if(this.activeIndex.index===e)return;const a=this.searchIndices.find((n=>n.index===e));a&&a.algoliaIndex&&(this.searchIndex=a.name,this._searchValue.length>=3&&(this.searchInput.setFocus(),this.searchBarShown=!0,this.setAutocompleteResults()))};constructor(n){e(this,n),this.nanoUserData=a(this,"nanoUserData",7),this.nanoSearchResult=a(this,"nanoSearchResult",7),this.nanoSearchError=a(this,"nanoSearchError",7),this.nanoSearchReset=a(this,"nanoSearchReset",7),this.handleResize=s(this.handleResize,75)}componentWillLoad(){this.handleMyAccountUrl(),this.initSearch(),this.processUserData(),l(this.host.shadowRoot)}componentDidRender(){this.handleResize()}loggedInPanel(){if(this.isLoggedIn&&this.myAccountUser)return r("div",{part:"user-panel",class:"gn__user-panel nano-theme-dark"},r("div",{class:"gn__user-panel-head",slot:"label"},r("nano-avatar",{initials:this.myAccountUser.first_name?.charAt(0)+this.myAccountUser.last_name?.charAt(0)},this.myAccountUser.small_avatar_url&&!this.myAccountUser.small_avatar_url.includes("generic")&&r("img",{src:this.myAccountUser.small_avatar_url,alt:"User Avatar",height:40,width:40})),r("div",null,this.myAccountUser.name,r("br",null),this.myAccountUser.job_title&&this.myAccountUser?.company?`${this.myAccountUser.job_title}, ${this.myAccountUser.company}`:this.myAccountUser.job_title||this.myAccountUser.company||"")),r("div",{class:"gn__user-panel-body"},this.userLinks.map((n=>r("a",{href:n.address,target:n.target||void 0},n.title,("Messages"===n.title||n.address.includes(this.msgUrl)||this.msgUrl.includes(n.address))&&this.msgCount>0&&r("nano-badge",{theme:"danger",strength:"2"},this.msgCount))))),r("div",{class:"gn__user-panel-foot"},r("nano-cta",{secondary:!0,size:"small",icon:"false",class:"gn__login-cta"},"string"==typeof this.logoutUrl?r("a",{href:this.formatLoginLink(this.logoutUrl)},"Logout"):r("button",{onClick:this.logoutUrl},"Logout"))))}bpPartials={contact:{tpl:()=>this.contactUrl&&r("a",{href:this.contactUrl},"Contact"),breakpoint:0},mainMenu:{tpl:()=>r("slot",{name:"menu"}),breakpoint:1},logo:{tpl:()=>{},breakpoint:2}};noResultPartial(){if(this.searchLoading||this.autocompleteResults?.hits.length||this._searchValue.length<3)return;const n=[];return"All"===this.searchIndex?(n.push(r("div",{slot:"no-result",class:"gn__search-no-results"},'No results matching for "',r("strong",null,this._searchValue),'" Try another phrase')),n):(this.searchResults?.results.forEach((e=>{e.hits.length&&n.push(r("nano-option",{class:"gn__search-result",onNanoSelect:n=>{n.preventDefault(),this.searchIndex=e.indexName,this.onSearchSubmit(n)}},'Show results for "',r("strong",null,this._searchValue),'" in ',r("strong",null,e.indexName)))})),n.unshift(r("div",{slot:n.length?"list-top":"no-result",class:"gn__search-no-results"},'No results matching for "',r("strong",null,this._searchValue),'" in'," ",r("strong",null,this.searchIndex),". Try another phrase")),n)}render(){const n=this.bpPartials;return r(t,{key:"6f3ecd6fac6825f4b137592e1becb86046278542",class:{"overflow-menu":this.breakpoint>n.mainMenu.breakpoint,"bar-menu":this.breakpoint<=n.mainMenu.breakpoint,"nano-global-nav":!0}},r("div",{key:"8ecbd0ecc9ac93f1a1dd5defa8f119874f623daf",class:{gn:!0,"gn__search-open":this.searchBarShown}},r("nano-drawer",{key:"728b760496d041fc5f1d78905081e7fe59b7047c",ref:n=>this.overflowMenu=n,label:"Main menu",part:"drawer",class:"gn__drawer nano-theme-dark",placement:"start",open:this.overflowOpen,onNanoAfterHide:()=>this.overflowOpen=!1,onNanoAfterShow:()=>this.overflowOpen=!0},r("div",{key:"d1b99ae15e00511594abf476a06f8374d4fad508",class:"gn__drawer-header",part:"overflow-header",slot:"label"},"Main menu"),r("nav",{key:"97debdda75a0d7d9f2a6e23306fa93bd2d73de06",class:"gn__drawer-menu",part:"overflow-menu"},this.breakpoint>n.mainMenu.breakpoint?n.mainMenu.tpl():"",r("slot",{key:"d500a55cb220088df7af00b356f902a3d80fb47d",name:"overflow"}))),r("div",{key:"c1454d4666561a77a850d9328d13795d5f989d89",class:"gn__menu-bar-wrapper"},r("div",{key:"f32f9a8302ad3501ae3d9e8afdf2ed7d59297335",class:"gn__menu-bar",part:"menu-bar",ref:n=>this.mainMenuBar=n},r("nav",{key:"8605e4bf473e4b34e3890ddaf69c555abc397716","aria-label":"Global navigation",class:"gn__main-menu "+(this.shouldResize?"resizing":""),part:"main-menu",ref:n=>this.mainMenu=n},this.breakpoint>n.mainMenu.breakpoint&&r("nano-icon-button",{key:"04aaa626447c7377fadcd8d374fa9120ef5fea62",class:"gn__overflow-button",iconName:"light/bars",label:"Open Menu",onClick:()=>this.overflowMenu.show()}),r("slot",{key:"3f858438db16a112c2dee67ee8b865afba9180fe",name:"logo"},r("a",{key:"ddc758422fb964b2644e825c98ec0aec832895db",href:this.logoUrl,class:"gn__logo-link",part:"logo-link"},r("img",this.breakpoint<=n.logo.breakpoint?{src:o("../nano-assets/ont-logo.svg"),alt:"Oxford Nanopore Technologies logo. Features a stylised representation of a nanopore,\n (a tiny protein channel embedded in a membrane) through which DNA or RNA molecules are passed in for sequencing.",class:"gn__logo gn__logo--large",width:"152",height:"36",part:"logo logo--large"}:{src:o("../nano-assets/ont-wheel.svg"),alt:"Oxford Nanopore Technologies logo. A stylised representation of a nanopore,\n (a tiny protein channel embedded in a membrane) through which DNA or RNA molecules are passed in for sequencing.",class:"gn__logo gn__logo--small",width:"36",height:"36",part:"logo logo--small"}))),this.breakpoint<=n.mainMenu.breakpoint&&r("div",{key:"c48d4d74b18f876cffee723a8da0bd4d82300b7b",class:"gn__main-menu-links"},n.mainMenu.tpl()),r("div",{key:"e433743c122dc9e4427de3f0fdd7067bcd52f558",class:"gn__main-menu-actions"},!this.myAccountData||!!this.searchIndices.length&&r("nano-dropdown",{key:"e6c5655701e5a91409f5fad4f45efd868cbd1a50",dialogTitle:"Search Oxford Nanopore Technologies",placement:"bottom",class:"gn__search-dropdown",skidding:-30,distance:25,open:this.searchBarShown,onNanoAfterShow:this.handleSearchOpenEvent,onNanoAfterHide:this.handleSearchCloseEvent,autoOpen:!!this.searchIndices.length},r("nano-icon-button",{key:"8de3fb7f465103bda3063e96876345701d942a01",class:"gn__search-button",slot:"trigger",iconName:"light/magnifying-glass",label:"Search"}),r("form",{key:"18fca7445c9471089e013cea8d83aa749e655aab",ref:n=>this.searchForm=n,class:"gn__search-form",part:"search-form",onSubmit:this.onSearchSubmit},this.searchIndices.length>1&&r("nano-select",{key:"7b37f759f2a24d8686d46a3ebbcb3afaa54cbbee",part:"search-select",label:"Which site do you wish to search in?",mask:!0,hideLabel:!0,value:this.activeIndex?.index,onNanoChange:this.handleSearchIndexChangeEvent},this.searchIndices.map((n=>r("nano-option",{selected:n.name===this.searchIndex,value:n.index},n.name||n.index)))),r("nano-input",{key:"93838bee803808b06f56c14886975cd3fc8ab827",ref:n=>this.searchInput=n,part:"search-input",label:"Search Oxford Nanopore Technologies",placeholder:"Search Oxford Nanopore...",hideLabel:!0,clearable:!0,showInlineError:!1,onNanoChange:n=>{this.handleSearchTermChangeEvent(n.detail.value)},onNanoInput:this.handleSearchTermInputEvent,debounce:500,value:this._searchValue},r("nano-icon",{key:"d39203dd3727a34b60c5c71fc6b9a14c23ef2465",slot:"end",name:"light/magnifying-glass"}),r("nano-datalist",{key:"9826082e21b53f54254c8f2490b3b42c215edacb",class:"gn__search-results",onNanoSelect:n=>n.preventDefault(),dropDownConfig:{tetherTo:this.searchForm},disableFilter:!0},this.searchLoading&&r("div",{key:"65f17640b43bce0f44e59f092b7c8ef562f02e19",slot:"no-result",class:"gn__search-loading"},r("nano-spinner",{key:"f0162dd8c60aae95e35d9e02770a9398bede0828"},"Searching...")),this.noResultPartial(),!!this.autocompleteResults?.hits.length&&[this.autocompleteResults.hits.map(((n,e)=>r("nano-option",{href:n.url,class:"gn__search-result",onClick:()=>{c.sendClick({index:this.activeIndex.index,eventName:"Global nav quick search - search result clicked",queryID:this.autocompleteResults.queryID,objectIDs:[n.objectID],positions:[e+1]})}},r("span",{innerHTML:this.autocompleteSnippet(n)})))),r("nano-option",{key:"ddf176669705bb04a45575ee1bf8897d46ae9704",class:"gn__search-viewall",onNanoSelect:this.onSearchSubmit},"View all results")])))),r("div",{key:"f84317012affbf6aa952810f627ca318f042dd0b",class:"gn__cart"},this.cartUrl&&[r("nano-icon-button",{key:"c656b17e3ee2462900fc855c8128b2e92e3ad4cb",iconName:"light/cart-shopping",label:"View your cart",href:this.cartUrl}),this.cartCount&&r("nano-badge",{key:"878066adbf28890694e65f651031e35912b30f06",theme:"danger",strength:"2"},this.cartCount>9?"9+":this.cartCount)]),this.breakpoint<=n.contact.breakpoint?n.contact.tpl():"",this.isLoggedIn?r("nano-dropdown",{dialogTitle:"User menu",class:"gn__user-dropdown",distance:10,placement:"bottom-end"},r("button",{slot:"trigger",class:"gn__user-dropdown-trigger"},r("nano-icon",{name:"light/user"}),r("nano-icon",{name:"light/chevron-down",class:"gn__user-dropdown-chevron"}),!!this.msgCount&&r("nano-badge",{theme:"danger",strength:"2"},this.msgCount>9?"9+":this.msgCount)),this.loggedInPanel()):r("nano-cta",{secondary:!0,size:"small",icon:"false",class:"gn__login-cta"},"string"==typeof this.loginUrl?r("a",{href:this.formatLoginLink(this.loginUrl)},"Login"):r("button",{onClick:this.loginUrl},"Login")))))),r("nano-global-search-results",{key:"afb40b7671b51b72cc58ce006b6ed163fb1d1e78",part:"site-search-results"},r("div",{key:"660f6ad6fb20ca8c88118b44bdb2b44b3a06f19b",class:"gn__site",part:"site-wrapper"},r("slot",{key:"fcd45d11fb7fcdcf986940f8a4bda1287635856a"})))))}static get assetsDirs(){return["assets"]}static get watchers(){return{myAccountUrl:["handleMyAccountUrl"],myAccountData:["processUserData","initSearch"],shouldResize:["breakpointChanged"],breakpoint:["breakpointChanged"],searchIndices:["handleSearchIndex"],searchIndex:["handleSearchIndex"]}}};h.style=':host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{--main-menu-bar-bg-color:var(--nano-color-base-0);--main-menu-text-color:var(--nano-color-base-1000);--main-menu-hover-text-color:var(--nano-color-primary-1000);--main-menu-active-text-color:var(--nano-color-primary-1200);--main-menu-active-border-color:var(--nano-color-primary-1000);--overflow-bg-color:var(--nano-color-grey-mono-1600);--overflow-text-color:var(--nano-color-basic-white);--overflow-hover-text-color:var(--nano-color-blue-cerulean-700);--overflow-active-text-color:var(--nano-color-blue-cerulean-300);display:block;color:var(--main-menu-text-color)}img{max-inline-size:none;display:block;block-size:revert-layer}::slotted(a),:host::slotted(a),a{text-decoration:none}a:has(img){display:inline-block}a:focus{outline:var(--nano-focus-ring);outline-offset:var(--nano-focus-ring-offset)}nano-drawer:not(:defined){display:none}nano-badge{position:absolute;font-size:0.5625rem;pointer-events:none}.gn__cart{position:relative}.gn__cart nano-badge{inset-block-start:-0.35rem;inset-inline-end:-0.4rem}.gn__login-cta{--bg:transparent;--font-size:var(--nano-font-size-2xs);--padding-v:0.5em}.gn__menu-bar-wrapper{z-index:calc(var(--nano-z-index-menubar) + 1);position:relative}.gn__menu-bar-wrapper::after{content:"";position:absolute;block-size:1px;inline-size:100%;inset-inline:0;inset-block-end:-1px;z-index:-3;background-color:var(--nano-color-neutral-200)}.gn__menu-bar{inline-size:100%;overflow:clip;background-color:var(--main-menu-bar-bg-color)}.gn__menu-bar a{color:var(--main-menu-text-color)}.gn__menu-bar a:hover{color:var(--main-menu-hover-text-color)}.gn__menu-bar a:active{color:var(--main-menu-active-text-color)}.gn__main-menu{display:inline-flex;align-items:center;min-inline-size:100%;padding:var(--nano-spacing-md);transition:opacity var(--nano-transition-x-fast) ease;opacity:1}.gn__main-menu.resizing{transition:none;opacity:0}.gn__main-menu>*{margin-inline-end:var(--nano-spacing-xl)}.gn__main-menu>*:is(slot,slot-fb){display:flex}.gn__main-menu>*:last-child{margin-inline-end:0}.gn__overflow-button{--padding:0.5rem 0.875rem 0.5rem 0;margin-inline-end:0.875rem;font-size:1.125rem;position:relative}.gn__overflow-button::after{content:"";position:absolute;inline-size:1px;block-size:100%;inset-inline-end:0;background-color:var(--nano-color-neutral-300);opacity:0.7;inset-block-start:0}.gn__main-menu-links,.gn__main-menu-actions{display:inline-flex;align-items:center}.gn__main-menu-links .nano-icon,.gn__main-menu-links .nano-icon-button,.gn__main-menu-actions .nano-icon,.gn__main-menu-actions .nano-icon-button{--active-color:var(--main-menu-active-text-color);--hover-color:var(--main-menu-hover-text-color);font-size:1rem}.gn__main-menu-links .nano-icon-button:hover,.gn__main-menu-actions .nano-icon-button:hover{color:var(--main-menu-hover-text-color)}.gn__main-menu-links{gap:var(--nano-spacing-xl)}.gn__main-menu-links ::slotted(a),.gn__main-menu-links::slotted(a){color:var(--main-menu-text-color)}.gn__main-menu-links ::slotted(a:hover){color:var(--main-menu-hover-text-color)}.gn__main-menu-links ::slotted(*:active){color:var(--main-menu-active-text-color)}.gn__main-menu-actions{margin-inline-start:auto;font-size:0.9375rem;gap:var(--nano-spacing-md)}.gn__search-dropdown{--overflow:visible;--padding:0;--background:transparent}.gn__search-dropdown .nano-icon-button{position:relative}.gn__search-dropdown .nano-icon-button::before{content:"";position:absolute;background-color:var(--main-menu-active-border-color);block-size:4px;inset-inline:5px 2px;inset-block-end:-1.5625rem;transform:translateZ(0) scaleX(0);transform-origin:0 center;transition:transform var(--nano-transition-x-fast) ease-in-out}.gn__search-open .gn__search-dropdown .nano-icon-button::before{transform:translateZ(0) scaleX(1)}.gn__search-form{display:inline-flex;max-inline-size:100vw;inline-size:30.625rem}.gn__search-form .nano-select{--input-bg-color:var(--nano-color-neutral-200);flex:0}.gn__search-form .nano-select:focus-within{z-index:1}.gn__search-form .nano-select .form-ctrl__input{border-inline-end:none}.gn__search-form .nano-input{flex:1}.gn__search-results{--padding-start:var(--nano-spacing-md);--padding-top:var(--nano-spacing-sm);--padding-bottom:var(--nano-spacing-sm);font-size:var(--nano-font-size-2xs)}.gn__search-loading{display:flex;justify-content:center}.gn__search-result{--padding-start:0.3125rem;--padding-top:var(--nano-spacing-sm);--padding-bottom:var(--nano-spacing-sm);--bg-focus:var(--nano-color-primary-300);--color-focus:var(--nano-color-neutral-1400);--color:var(--nano-color-neutral-1400);font-size:var(--nano-font-size-2xs)}.gn__search-result .search__highlight{font-style:normal;background:var(--nano-color-highlight)}.gn__search-viewall{--bg-focus:var(--nano-color-primary-300);--color-focus:var(--nano-color-neutral-1400);--color:var(--nano-color-primary-1200)}.gn__search-viewall::part(label){justify-content:flex-end;text-decoration:underline}.gn__user-dropdown-trigger{all:unset;cursor:pointer;color:var(--nano-color-primary-1200);display:flex;white-space:nowrap;gap:var(--nano-spacing-xs);align-items:center;position:relative;padding-inline-start:var(--nano-spacing-md)}.gn__user-dropdown-trigger:hover{color:var(--main-menu-hover-text-color)}.gn__user-dropdown-trigger:active{color:var(--main-menu-active-text-color)}.gn__user-dropdown-trigger:focus-visible{outline:var(--nano-focus-ring);outline-offset:var(--nano-focus-ring-offset)}.gn__user-dropdown-trigger::before{content:"";position:absolute;inline-size:1px;block-size:100%;inset-inline-start:0;background-color:var(--nano-color-neutral-300);opacity:0.7;inset-block-start:0}.gn__user-dropdown-trigger .gn__user-dropdown-chevron{transition:rotate var(--nano-transition-x-fast) linear}[open] .gn__user-dropdown-trigger .gn__user-dropdown-chevron{rotate:180deg}.gn__user-dropdown-trigger nano-badge{inset-block-start:-0.7rem;inset-inline-end:-0.7rem}.gn__user-dropdown{--background:var(--overflow-bg-color);--padding:0;--overflow:visible}.gn__user-panel{inline-size:21.25rem;max-inline-size:21.25rem;color:var(--overflow-text-color);padding:var(--nano-spacing-md)}.gn__user-panel a{color:var(--overflow-text-color)}.gn__user-panel a:hover{text-decoration:underline;color:var(--overflow-hover-text-color)}.gn__user-panel-head{font-size:var(--nano-font-size-xs);line-height:var(--nano-line-height-normal);letter-spacing:var(--nano-letter-spacing-loose);padding-block-end:var(--nano-spacing-md);display:flex;align-items:center;gap:var(--nano-spacing-sm);font-size:var(--nano-font-size-xs)}.gn__user-panel-head .gn__user-avatar nano-icon{font-size:2.5rem}.gn__user-panel-body{display:flex;flex-direction:column}.gn__user-panel-body a{position:relative;border-block-end:1px solid rgb(var(--nano-color-base-rgb-1000)/10%);padding-block:var(--nano-spacing-md)}.gn__user-panel-body a:first-child{border-block-start:1px solid rgb(var(--nano-color-base-rgb-1000)/10%)}.gn__user-panel-foot{padding-block-start:var(--nano-spacing-md);display:flex;align-items:center;justify-content:space-between;gap:var(--nano-spacing-md)}.gn__drawer{--panel-background:var(--overflow-bg-color);--header-button-color:var(--overflow-text-color);--body-spacing:0;--header-spacing:var(--nano-spacing-md) 0;--footer-spacing:var(--nano-spacing-md)}.gn__drawer::part(title){display:flex;justify-content:flex-end}.gn__drawer::part(header-actions){order:-1}.gn__drawer-header{clip-path:inset(50%);block-size:1px;overflow:hidden;position:absolute;white-space:nowrap;inline-size:1px}.gn__drawer-menu{display:flex;flex-direction:column;margin:0 var(--nano-spacing-md);padding-block-end:var(--nano-spacing-md);color:var(--overflow-text-color);border-block-start:1px solid rgb(var(--nano-color-base-rgb-1000)/10%);position:relative}.gn__drawer-menu ::slotted(a),.gn__drawer-menu::slotted(a){padding:var(--nano-spacing-md) 0}.gn__drawer-menu ::slotted(a),.gn__drawer-menu ::slotted(.nano-nav-item),.gn__drawer-menu::slotted(a),.gn__drawer-menu::slotted(.nano-nav-item){--padding:var(--nano-spacing-md) 0;display:block;color:inherit !important;border-block-end:1px solid rgb(var(--nano-color-base-rgb-1000)/10%)}.gn__drawer-menu ::slotted(a:hover),.gn__drawer-menu ::slotted(.nano-nav-item:hover){text-decoration:underline;color:var(--overflow-hover-text-color) !important}';export{h as nano_global_nav}
|
|
@@ -36,13 +36,13 @@ export declare class GlobalNav implements ComponentInterface {
|
|
|
36
36
|
/** Url to the Nanopore message center. Will default to the url supplied by MyAccount */
|
|
37
37
|
msgUrl: string;
|
|
38
38
|
/** Url to the Nanopore login page. Will default to the url supplied by MyAccount */
|
|
39
|
-
loginUrl: string;
|
|
39
|
+
loginUrl: string | (() => void);
|
|
40
40
|
/** Url to the Nanopore login page. Will default to the url supplied by MyAccount */
|
|
41
|
-
logoutUrl: string;
|
|
41
|
+
logoutUrl: string | (() => void);
|
|
42
42
|
/** Url to the Nanopore contact page */
|
|
43
43
|
contactUrl: string;
|
|
44
44
|
private _sessionRedirect;
|
|
45
|
-
/** A url to take the user after login
|
|
45
|
+
/** A url to take the user after login or logout. Defaults to current URL. Is automatically URI encoded */
|
|
46
46
|
get sessionRedirect(): string;
|
|
47
47
|
set sessionRedirect(val: string);
|
|
48
48
|
/** MyAccount store cart count.*/
|
|
@@ -1571,7 +1571,7 @@ export namespace Components {
|
|
|
1571
1571
|
* Url to the Nanopore login page. Will default to the url supplied by MyAccount
|
|
1572
1572
|
* @default ''
|
|
1573
1573
|
*/
|
|
1574
|
-
"loginUrl": string;
|
|
1574
|
+
"loginUrl": string | (() => void);
|
|
1575
1575
|
/**
|
|
1576
1576
|
* The link to put on the logo
|
|
1577
1577
|
* @default location.protocol + '//' + location.host
|
|
@@ -1581,7 +1581,7 @@ export namespace Components {
|
|
|
1581
1581
|
* Url to the Nanopore login page. Will default to the url supplied by MyAccount
|
|
1582
1582
|
* @default ''
|
|
1583
1583
|
*/
|
|
1584
|
-
"logoutUrl": string;
|
|
1584
|
+
"logoutUrl": string | (() => void);
|
|
1585
1585
|
/**
|
|
1586
1586
|
* MyAccount un-read message count.
|
|
1587
1587
|
* @default 0
|
|
@@ -1620,7 +1620,7 @@ export namespace Components {
|
|
|
1620
1620
|
*/
|
|
1621
1621
|
"searchValue": string;
|
|
1622
1622
|
/**
|
|
1623
|
-
* A url to take the user after login
|
|
1623
|
+
* A url to take the user after login or logout. Defaults to current URL. Is automatically URI encoded
|
|
1624
1624
|
*/
|
|
1625
1625
|
"sessionRedirect": string;
|
|
1626
1626
|
/**
|
|
@@ -6742,7 +6742,7 @@ declare namespace LocalJSX {
|
|
|
6742
6742
|
* Url to the Nanopore login page. Will default to the url supplied by MyAccount
|
|
6743
6743
|
* @default ''
|
|
6744
6744
|
*/
|
|
6745
|
-
"loginUrl"?: string;
|
|
6745
|
+
"loginUrl"?: string | (() => void);
|
|
6746
6746
|
/**
|
|
6747
6747
|
* The link to put on the logo
|
|
6748
6748
|
* @default location.protocol + '//' + location.host
|
|
@@ -6752,7 +6752,7 @@ declare namespace LocalJSX {
|
|
|
6752
6752
|
* Url to the Nanopore login page. Will default to the url supplied by MyAccount
|
|
6753
6753
|
* @default ''
|
|
6754
6754
|
*/
|
|
6755
|
-
"logoutUrl"?: string;
|
|
6755
|
+
"logoutUrl"?: string | (() => void);
|
|
6756
6756
|
/**
|
|
6757
6757
|
* MyAccount un-read message count.
|
|
6758
6758
|
* @default 0
|
|
@@ -6803,7 +6803,7 @@ declare namespace LocalJSX {
|
|
|
6803
6803
|
*/
|
|
6804
6804
|
"searchValue"?: string;
|
|
6805
6805
|
/**
|
|
6806
|
-
* A url to take the user after login
|
|
6806
|
+
* A url to take the user after login or logout. Defaults to current URL. Is automatically URI encoded
|
|
6807
6807
|
*/
|
|
6808
6808
|
"sessionRedirect"?: string;
|
|
6809
6809
|
}
|
package/docs-json.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2026-
|
|
2
|
+
"timestamp": "2026-02-19T14:46:32",
|
|
3
3
|
"compiler": {
|
|
4
4
|
"name": "@stencil/core",
|
|
5
5
|
"version": "4.36.1",
|
|
@@ -3369,7 +3369,7 @@
|
|
|
3369
3369
|
"references": {
|
|
3370
3370
|
"Breadcrumb": {
|
|
3371
3371
|
"location": "local",
|
|
3372
|
-
"path": "/builds/
|
|
3372
|
+
"path": "/builds/x6knoJK1/0/Digital/nano-components/packages/components/src/components/breadcrumb/breadcrumb.tsx",
|
|
3373
3373
|
"id": "src/components/breadcrumb/breadcrumb.tsx::Breadcrumb"
|
|
3374
3374
|
}
|
|
3375
3375
|
}
|
|
@@ -13017,10 +13017,10 @@
|
|
|
13017
13017
|
},
|
|
13018
13018
|
{
|
|
13019
13019
|
"name": "loginUrl",
|
|
13020
|
-
"type": "string",
|
|
13020
|
+
"type": "(() => void) | string",
|
|
13021
13021
|
"complexType": {
|
|
13022
|
-
"original": "string",
|
|
13023
|
-
"resolved": "string",
|
|
13022
|
+
"original": "string | (() => void)",
|
|
13023
|
+
"resolved": "(() => void) | string",
|
|
13024
13024
|
"references": {}
|
|
13025
13025
|
},
|
|
13026
13026
|
"mutable": true,
|
|
@@ -13035,6 +13035,9 @@
|
|
|
13035
13035
|
],
|
|
13036
13036
|
"default": "''",
|
|
13037
13037
|
"values": [
|
|
13038
|
+
{
|
|
13039
|
+
"type": "(() => void)"
|
|
13040
|
+
},
|
|
13038
13041
|
{
|
|
13039
13042
|
"type": "string"
|
|
13040
13043
|
}
|
|
@@ -13075,10 +13078,10 @@
|
|
|
13075
13078
|
},
|
|
13076
13079
|
{
|
|
13077
13080
|
"name": "logoutUrl",
|
|
13078
|
-
"type": "string",
|
|
13081
|
+
"type": "(() => void) | string",
|
|
13079
13082
|
"complexType": {
|
|
13080
|
-
"original": "string",
|
|
13081
|
-
"resolved": "string",
|
|
13083
|
+
"original": "string | (() => void)",
|
|
13084
|
+
"resolved": "(() => void) | string",
|
|
13082
13085
|
"references": {}
|
|
13083
13086
|
},
|
|
13084
13087
|
"mutable": true,
|
|
@@ -13093,6 +13096,9 @@
|
|
|
13093
13096
|
],
|
|
13094
13097
|
"default": "''",
|
|
13095
13098
|
"values": [
|
|
13099
|
+
{
|
|
13100
|
+
"type": "(() => void)"
|
|
13101
|
+
},
|
|
13096
13102
|
{
|
|
13097
13103
|
"type": "string"
|
|
13098
13104
|
}
|
|
@@ -13315,7 +13321,7 @@
|
|
|
13315
13321
|
"mutable": false,
|
|
13316
13322
|
"attr": "session-redirect",
|
|
13317
13323
|
"reflectToAttr": false,
|
|
13318
|
-
"docs": "A url to take the user after login
|
|
13324
|
+
"docs": "A url to take the user after login or logout. Defaults to current URL. Is automatically URI encoded",
|
|
13319
13325
|
"docsTags": [],
|
|
13320
13326
|
"values": [
|
|
13321
13327
|
{
|
package/docs-vscode.json
CHANGED
|
@@ -2051,7 +2051,7 @@
|
|
|
2051
2051
|
},
|
|
2052
2052
|
{
|
|
2053
2053
|
"name": "session-redirect",
|
|
2054
|
-
"description": "A url to take the user after login
|
|
2054
|
+
"description": "A url to take the user after login or logout. Defaults to current URL. Is automatically URI encoded"
|
|
2055
2055
|
}
|
|
2056
2056
|
]
|
|
2057
2057
|
},
|
package/hydrate/index.js
CHANGED
|
@@ -14780,7 +14780,7 @@ class GlobalNav {
|
|
|
14780
14780
|
/** Url to the Nanopore contact page */
|
|
14781
14781
|
contactUrl = 'https://nanoporetech.com/contact';
|
|
14782
14782
|
_sessionRedirect = window.location.href;
|
|
14783
|
-
/** A url to take the user after login
|
|
14783
|
+
/** A url to take the user after login or logout. Defaults to current URL. Is automatically URI encoded */
|
|
14784
14784
|
get sessionRedirect() {
|
|
14785
14785
|
return encodeURIComponent(this._sessionRedirect);
|
|
14786
14786
|
}
|
|
@@ -14839,15 +14839,22 @@ class GlobalNav {
|
|
|
14839
14839
|
return this.myAccountData?.user?.uuid ? this.myAccountData.user : null;
|
|
14840
14840
|
}
|
|
14841
14841
|
processUserData() {
|
|
14842
|
-
if (!this.myAccountUser)
|
|
14843
|
-
|
|
14844
|
-
|
|
14845
|
-
|
|
14846
|
-
|
|
14847
|
-
|
|
14848
|
-
|
|
14849
|
-
|
|
14850
|
-
this.
|
|
14842
|
+
if (!this.myAccountUser) {
|
|
14843
|
+
this.isLoggedIn = false;
|
|
14844
|
+
this.userLinks = [];
|
|
14845
|
+
this.msgUrl = '';
|
|
14846
|
+
this.msgCount = 0;
|
|
14847
|
+
this.nanoUserData.emit(null);
|
|
14848
|
+
return;
|
|
14849
|
+
}
|
|
14850
|
+
this.userLinks =
|
|
14851
|
+
this.myAccountData?.links?.filter((link) => link.area === 'profile-panel-list') || [];
|
|
14852
|
+
this.loginUrl = this.loginUrl || this.myAccountData.urls?.login;
|
|
14853
|
+
this.logoutUrl = this.logoutUrl || this.myAccountData.urls?.logout;
|
|
14854
|
+
this.msgUrl = this.msgUrl || this.myAccountData.urls?.messages;
|
|
14855
|
+
this.msgCount = this.msgCount || this.myAccountData.notifications?.count;
|
|
14856
|
+
this.cartUrl = this.cartUrl || this.myAccountData.urls?.cart;
|
|
14857
|
+
this.cartCount = this.cartCount || this.myAccountData.cart?.count;
|
|
14851
14858
|
this.isLoggedIn = true;
|
|
14852
14859
|
this.nanoUserData.emit(this.myAccountUser);
|
|
14853
14860
|
}
|
|
@@ -15188,14 +15195,18 @@ class GlobalNav {
|
|
|
15188
15195
|
return;
|
|
15189
15196
|
return (h("div", { part: "user-panel", class: `gn__user-panel nano-theme-dark` }, h("div", { class: "gn__user-panel-head", slot: "label" }, h("nano-avatar", { initials: this.myAccountUser.first_name?.charAt(0) +
|
|
15190
15197
|
this.myAccountUser.last_name?.charAt(0) }, this.myAccountUser.small_avatar_url &&
|
|
15191
|
-
!this.myAccountUser.small_avatar_url.includes('generic') && (h("img", { src: this.myAccountUser.small_avatar_url, alt: "User Avatar", height: 40, width: 40 }))), h("div", null, this.myAccountUser.name, h("br", null), this.myAccountUser.job_title
|
|
15198
|
+
!this.myAccountUser.small_avatar_url.includes('generic') && (h("img", { src: this.myAccountUser.small_avatar_url, alt: "User Avatar", height: 40, width: 40 }))), h("div", null, this.myAccountUser.name, h("br", null), this.myAccountUser.job_title && this.myAccountUser?.company
|
|
15199
|
+
? `${this.myAccountUser.job_title}, ${this.myAccountUser.company}`
|
|
15200
|
+
: this.myAccountUser.job_title ||
|
|
15201
|
+
this.myAccountUser.company ||
|
|
15202
|
+
'')), h("div", { class: "gn__user-panel-body" }, this.userLinks.map((link) => (h("a", { href: link.address, target: link.target || undefined }, link.title, (link.title === 'Messages' ||
|
|
15192
15203
|
link.address.includes(this.msgUrl) ||
|
|
15193
15204
|
this.msgUrl.includes(link.address)) &&
|
|
15194
|
-
this.msgCount > 0 && (h("nano-badge", { theme: "danger", strength: "2" }, this.msgCount)))))), h("div", { class: "gn__user-panel-foot" }, h("nano-cta", { secondary: true, size: "small", icon: "false", class: "gn__login-cta" }, h("a", { href: this.formatLoginLink(this.logoutUrl) }, "Logout")))));
|
|
15205
|
+
this.msgCount > 0 && (h("nano-badge", { theme: "danger", strength: "2" }, this.msgCount)))))), h("div", { class: "gn__user-panel-foot" }, h("nano-cta", { secondary: true, size: "small", icon: "false", class: "gn__login-cta" }, typeof this.logoutUrl === 'string' ? (h("a", { href: this.formatLoginLink(this.logoutUrl) }, "Logout")) : (h("button", { onClick: this.logoutUrl }, "Logout"))))));
|
|
15195
15206
|
}
|
|
15196
15207
|
bpPartials = {
|
|
15197
15208
|
contact: {
|
|
15198
|
-
tpl: () => h("a", { href: this.contactUrl }, "Contact"),
|
|
15209
|
+
tpl: () => this.contactUrl && h("a", { href: this.contactUrl }, "Contact"),
|
|
15199
15210
|
breakpoint: 0,
|
|
15200
15211
|
},
|
|
15201
15212
|
mainMenu: {
|
|
@@ -15233,21 +15244,21 @@ class GlobalNav {
|
|
|
15233
15244
|
}
|
|
15234
15245
|
render() {
|
|
15235
15246
|
const bpps = this.bpPartials;
|
|
15236
|
-
return (h(Host, { key: '
|
|
15247
|
+
return (h(Host, { key: '6f3ecd6fac6825f4b137592e1becb86046278542', class: {
|
|
15237
15248
|
'overflow-menu': this.breakpoint > bpps.mainMenu.breakpoint,
|
|
15238
15249
|
'bar-menu': this.breakpoint <= bpps.mainMenu.breakpoint,
|
|
15239
15250
|
'nano-global-nav': true,
|
|
15240
|
-
} }, h("div", { key: '
|
|
15251
|
+
} }, h("div", { key: '8ecbd0ecc9ac93f1a1dd5defa8f119874f623daf', class: {
|
|
15241
15252
|
gn: true,
|
|
15242
15253
|
'gn__search-open': this.searchBarShown,
|
|
15243
|
-
} }, h("nano-drawer", { key: '
|
|
15254
|
+
} }, h("nano-drawer", { key: '728b760496d041fc5f1d78905081e7fe59b7047c', ref: (el) => (this.overflowMenu = el), label: "Main menu", part: "drawer", class: "gn__drawer nano-theme-dark", placement: "start", open: this.overflowOpen, onNanoAfterHide: () => (this.overflowOpen = false), onNanoAfterShow: () => (this.overflowOpen = true) }, h("div", { key: 'd1b99ae15e00511594abf476a06f8374d4fad508', class: "gn__drawer-header", part: "overflow-header", slot: "label" }, "Main menu"), h("nav", { key: '97debdda75a0d7d9f2a6e23306fa93bd2d73de06', class: "gn__drawer-menu", part: "overflow-menu" }, this.breakpoint > bpps.mainMenu.breakpoint
|
|
15244
15255
|
? bpps.mainMenu.tpl()
|
|
15245
|
-
: '', h("slot", { key: '
|
|
15256
|
+
: '', h("slot", { key: 'd500a55cb220088df7af00b356f902a3d80fb47d', name: "overflow" }))), h("div", { key: 'c1454d4666561a77a850d9328d13795d5f989d89', class: "gn__menu-bar-wrapper" }, h("div", { key: 'f32f9a8302ad3501ae3d9e8afdf2ed7d59297335', class: "gn__menu-bar", part: "menu-bar", ref: (el) => (this.mainMenuBar = el) }, h("nav", { key: '8605e4bf473e4b34e3890ddaf69c555abc397716', "aria-label": "Global navigation", class: `gn__main-menu ${this.shouldResize ? 'resizing' : ''}`, part: "main-menu", ref: (el) => (this.mainMenu = el) }, this.breakpoint > bpps.mainMenu.breakpoint && (h("nano-icon-button", { key: '04aaa626447c7377fadcd8d374fa9120ef5fea62', class: "gn__overflow-button", iconName: "light/bars", label: "Open Menu", onClick: () => this.overflowMenu.show() })), h("slot", { key: '3f858438db16a112c2dee67ee8b865afba9180fe', name: "logo" }, h("a", { key: 'ddc758422fb964b2644e825c98ec0aec832895db', href: this.logoUrl, class: "gn__logo-link", part: "logo-link" }, this.breakpoint <= bpps.logo.breakpoint ? (h("img", { src: getAssetPath('../nano-assets/ont-logo.svg'), alt: `Oxford Nanopore Technologies logo. Features a stylised representation of a nanopore,
|
|
15246
15257
|
(a tiny protein channel embedded in a membrane) through which DNA or RNA molecules are passed in for sequencing.`, class: "gn__logo gn__logo--large", width: "152", height: "36", part: "logo logo--large" })) : (h("img", { src: getAssetPath('../nano-assets/ont-wheel.svg'), alt: `Oxford Nanopore Technologies logo. A stylised representation of a nanopore,
|
|
15247
|
-
(a tiny protein channel embedded in a membrane) through which DNA or RNA molecules are passed in for sequencing.`, class: "gn__logo gn__logo--small", width: "36", height: "36", part: "logo logo--small" })))), this.breakpoint <= bpps.mainMenu.breakpoint && (h("div", { key: '
|
|
15248
|
-
(!!this.searchIndices.length && (h("nano-dropdown", { key: '
|
|
15258
|
+
(a tiny protein channel embedded in a membrane) through which DNA or RNA molecules are passed in for sequencing.`, class: "gn__logo gn__logo--small", width: "36", height: "36", part: "logo logo--small" })))), this.breakpoint <= bpps.mainMenu.breakpoint && (h("div", { key: 'c48d4d74b18f876cffee723a8da0bd4d82300b7b', class: "gn__main-menu-links" }, bpps.mainMenu.tpl())), h("div", { key: 'e433743c122dc9e4427de3f0fdd7067bcd52f558', class: "gn__main-menu-actions" }, !this.myAccountData ||
|
|
15259
|
+
(!!this.searchIndices.length && (h("nano-dropdown", { key: 'e6c5655701e5a91409f5fad4f45efd868cbd1a50', dialogTitle: "Search Oxford Nanopore Technologies", placement: "bottom", class: "gn__search-dropdown", skidding: -30, distance: 25, open: this.searchBarShown, onNanoAfterShow: this.handleSearchOpenEvent, onNanoAfterHide: this.handleSearchCloseEvent, autoOpen: !!this.searchIndices.length }, h("nano-icon-button", { key: '8de3fb7f465103bda3063e96876345701d942a01', class: "gn__search-button", slot: "trigger", iconName: "light/magnifying-glass", label: "Search" }), h("form", { key: '18fca7445c9471089e013cea8d83aa749e655aab', ref: (form) => (this.searchForm = form), class: "gn__search-form", part: "search-form", onSubmit: this.onSearchSubmit }, this.searchIndices.length > 1 && (h("nano-select", { key: '7b37f759f2a24d8686d46a3ebbcb3afaa54cbbee', part: "search-select", label: "Which site do you wish to search in?", mask: true, hideLabel: true, value: this.activeIndex?.index, onNanoChange: this.handleSearchIndexChangeEvent }, this.searchIndices.map((index) => (h("nano-option", { selected: index.name === this.searchIndex, value: index.index }, index.name || index.index))))), h("nano-input", { key: '93838bee803808b06f56c14886975cd3fc8ab827', ref: (ele) => (this.searchInput = ele), part: "search-input", label: "Search Oxford Nanopore Technologies", placeholder: "Search Oxford Nanopore...", hideLabel: true, clearable: true, showInlineError: false, onNanoChange: (e) => {
|
|
15249
15260
|
this.handleSearchTermChangeEvent(e.detail.value);
|
|
15250
|
-
}, onNanoInput: this.handleSearchTermInputEvent, debounce: 500, value: this._searchValue }, h("nano-icon", { key: '
|
|
15261
|
+
}, onNanoInput: this.handleSearchTermInputEvent, debounce: 500, value: this._searchValue }, h("nano-icon", { key: 'd39203dd3727a34b60c5c71fc6b9a14c23ef2465', slot: "end", name: "light/magnifying-glass" }), h("nano-datalist", { key: '9826082e21b53f54254c8f2490b3b42c215edacb', class: "gn__search-results", onNanoSelect: (e) => e.preventDefault(), dropDownConfig: { tetherTo: this.searchForm }, disableFilter: true }, this.searchLoading && (h("div", { key: '65f17640b43bce0f44e59f092b7c8ef562f02e19', slot: "no-result", class: "gn__search-loading" }, h("nano-spinner", { key: 'f0162dd8c60aae95e35d9e02770a9398bede0828' }, "Searching..."))), this.noResultPartial(), !!this.autocompleteResults?.hits.length && [
|
|
15251
15262
|
this.autocompleteResults.hits.map((hit, i) => (h("nano-option", { href: hit.url, class: "gn__search-result", onClick: () => {
|
|
15252
15263
|
searchInsight.sendClick({
|
|
15253
15264
|
index: this.activeIndex.index,
|
|
@@ -15257,10 +15268,13 @@ class GlobalNav {
|
|
|
15257
15268
|
positions: [i + 1],
|
|
15258
15269
|
});
|
|
15259
15270
|
} }, h("span", { innerHTML: this.autocompleteSnippet(hit) })))),
|
|
15260
|
-
h("nano-option", { key: '
|
|
15261
|
-
])))))), h("div", { key: '
|
|
15271
|
+
h("nano-option", { key: 'ddf176669705bb04a45575ee1bf8897d46ae9704', class: "gn__search-viewall", onNanoSelect: this.onSearchSubmit }, "View all results"),
|
|
15272
|
+
])))))), h("div", { key: 'f84317012affbf6aa952810f627ca318f042dd0b', class: "gn__cart" }, this.cartUrl && [
|
|
15273
|
+
h("nano-icon-button", { key: 'c656b17e3ee2462900fc855c8128b2e92e3ad4cb', iconName: "light/cart-shopping", label: "View your cart", href: this.cartUrl }),
|
|
15274
|
+
this.cartCount && (h("nano-badge", { key: '878066adbf28890694e65f651031e35912b30f06', theme: "danger", strength: "2" }, this.cartCount > 9 ? '9+' : this.cartCount)),
|
|
15275
|
+
]), this.breakpoint <= bpps.contact.breakpoint
|
|
15262
15276
|
? bpps.contact.tpl()
|
|
15263
|
-
: '', this.isLoggedIn ? (h("nano-dropdown", { dialogTitle: "User menu", class: "gn__user-dropdown", distance: 10, placement: "bottom-end" }, h("button", { slot: "trigger", class: "gn__user-dropdown-trigger" }, h("nano-icon", { name: "light/user" }), h("nano-icon", { name: "light/chevron-down", class: "gn__user-dropdown-chevron" }), !!this.msgCount && (h("nano-badge", { theme: "danger", strength: "2" }, this.msgCount > 9 ? '9+' : this.msgCount))), this.loggedInPanel())) : (h("nano-cta", { secondary: true, size: "small", icon: "false", class: "gn__login-cta" }, h("a", { href: this.formatLoginLink(this.loginUrl) }, "Login"))))))), h("nano-global-search-results", { key: '
|
|
15277
|
+
: '', this.isLoggedIn ? (h("nano-dropdown", { dialogTitle: "User menu", class: "gn__user-dropdown", distance: 10, placement: "bottom-end" }, h("button", { slot: "trigger", class: "gn__user-dropdown-trigger" }, h("nano-icon", { name: "light/user" }), h("nano-icon", { name: "light/chevron-down", class: "gn__user-dropdown-chevron" }), !!this.msgCount && (h("nano-badge", { theme: "danger", strength: "2" }, this.msgCount > 9 ? '9+' : this.msgCount))), this.loggedInPanel())) : (h("nano-cta", { secondary: true, size: "small", icon: "false", class: "gn__login-cta" }, typeof this.loginUrl === 'string' ? (h("a", { href: this.formatLoginLink(this.loginUrl) }, "Login")) : (h("button", { onClick: this.loginUrl }, "Login")))))))), h("nano-global-search-results", { key: 'afb40b7671b51b72cc58ce006b6ed163fb1d1e78', part: "site-search-results" }, h("div", { key: '660f6ad6fb20ca8c88118b44bdb2b44b3a06f19b', class: "gn__site", part: "site-wrapper" }, h("slot", { key: 'fcd45d11fb7fcdcf986940f8a4bda1287635856a' }))))));
|
|
15264
15278
|
}
|
|
15265
15279
|
static get assetsDirs() { return ["assets"]; }
|
|
15266
15280
|
static get watchers() { return {
|