scb-wc 0.1.21 → 0.1.22

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.
@@ -43,7 +43,7 @@ import"../../vendor/vendor-material.js";import{_ as k,b as C,g as T,h as d,m as
43
43
  );
44
44
  }
45
45
  }
46
- `,document.head.appendChild(b);const e=i=>{const r=String(i??"").trim();if(r)return/^\d+$/.test(r)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(r,10)))})`:r},s=i=>{const r=String(i??"").trim();if(!r)return!1;try{const u=JSON.parse(r);return Array.isArray(u)&&u.length>0}catch{return!1}},t=i=>{for(const r of Array.from(i.children)){const u=r.tagName.toLowerCase();if(u==="scb-header-tab"||u==="scb-dropdown")return!0}return!1},a=i=>{t(i)||s(i.getAttribute("tabs"))?i.setAttribute("data-pre-has-tabs",""):i.removeAttribute("data-pre-has-tabs");const r=e(i.getAttribute("spacing")),u=e(i.getAttribute("spacing-top"))??r,h=e(i.getAttribute("spacing-bottom"))??r;u?i.style.setProperty("--scb-header-spacing-block-start",u):i.style.removeProperty("--scb-header-spacing-block-start"),h?i.style.setProperty("--scb-header-spacing-block-end",h):i.style.removeProperty("--scb-header-spacing-block-end");const p=(i.getAttribute("logo-width")??"").trim();p?i.style.setProperty("--scb-header-pre-logo-w",p):i.style.removeProperty("--scb-header-pre-logo-w");const v=(i.getAttribute("logo-height")??"").trim();v?i.style.setProperty("--scb-header-pre-logo-img-h",v):i.style.removeProperty("--scb-header-pre-logo-img-h");const f=(i.getAttribute("search-height")??"").trim();f?i.style.setProperty("--scb-header-pre-control-size",f):i.style.removeProperty("--scb-header-pre-control-size")};document.querySelectorAll("scb-header").forEach(a);const o=new MutationObserver(i=>{for(const r of i){if(r.type==="attributes"){const u=r.target;u instanceof HTMLElement&&u.tagName.toLowerCase()==="scb-header"&&a(u);continue}if(r.type==="childList"){const u=[...Array.from(r.addedNodes),...Array.from(r.removedNodes)];for(const h of u){if(!(h instanceof HTMLElement))continue;if(h.tagName.toLowerCase()==="scb-header"){a(h);continue}const p=h.closest?.("scb-header");p&&a(p)}}}});o.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabs","spacing","spacing-top","spacing-bottom","logo-width","logo-height","logo-aspect-ratio","search-height"]}),customElements.whenDefined("scb-header").then(()=>{o.disconnect()})};E();var x={fromAttribute:b=>b==null?!0:!/^(false|0|off|no)$/i.test(b),toAttribute:b=>String(!!b)},S={fromAttribute:b=>b==null?!1:!/^(false|0|off|no)$/i.test(b),toAttribute:b=>String(!!b)},M={fromAttribute:b=>b==="small"||b==="large"?b:"medium",toAttribute:b=>{const e=String(b??"");return e==="small"||e==="large"?e:null}},l=(_=class extends k{constructor(){super(),this.maxWidth="1440px",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.size="medium",this.logoText="",this.logoHref="/",this.logoSrc="",this.logoWidth="",this.logoHeight="",this.logoAspectRatio="",this.logoInvertDm=!1,this.banner=!1,this.tabs=[],this.activeTab=null,this.reserveTabs=!1,this.utilityItems=[],this.showDrawer=!0,this.showSearch=!0,this.includeUtilityInMenu=!1,this.drawerOverlay=!0,this.searchText="",this._drawerId="main-drawer",this._menuExpanded=!1,this._searchId="header-search",this._slotNavItems=[],this._slotUtils=[],this._slotMenu=[],this._measureScheduled=!1,this._scheduleMeasure=()=>{this._measureScheduled||(this._measureScheduled=!0,requestAnimationFrame(()=>{this._measureScheduled=!1,this._measure()}))},this._onWindowResize=()=>{this._scheduleMeasure()},this._onMenuSelect=s=>{const t=s.detail;this.dispatchEvent(new CustomEvent("scb-menu-select",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbmenuselect",{detail:t,bubbles:!0,composed:!0}));const a=t?.item,n=typeof t?.href=="string"?t.href:typeof t?.itemHref=="string"?t.itemHref:typeof t?.item_href=="string"?t.item_href:"",o=a?a.getAttribute("item-href")??a.getAttribute("href")??"":"";String(n||o||"").trim()&&this._closeDrawerNow()},this._collapsed=!1,this._unlockAtWidth=0,this._hideLogoText=!1,this._logoTextUnlockAt=0,this._slotWatchers=[],this._harvestPending=!1,this._harvest=()=>{const s=Array.from(this.children),t=[],a=[],n=[];let o=-1;const i=r=>({label:r.getAttribute("label")??"",href:r.getAttribute("href")??void 0,icon:r.getAttribute("icon")??void 0});for(const r of s){const u=r.tagName.toLowerCase();if(u==="scb-header-tab"){const h=r.getAttribute("label")??"",p=r.getAttribute("href"),v=p&&p.trim()!==""?p:void 0;(r.hasAttribute("selected")||r.getAttribute("selected")==="true"||r.getAttribute("active")==="true"||r.getAttribute("aria-current")==="page")&&o===-1&&(o=t.length),t.push({kind:"tab",label:h,href:v});continue}if(u==="scb-badge"){const h=r.querySelector("scb-dropdown");if(h){const p=h.getAttribute("label")??"";(h.hasAttribute("selected")||h.getAttribute("selected")==="true"||h.getAttribute("active")==="true"||h.getAttribute("aria-current")==="page")&&o===-1&&(o=t.length);const v=`scb-header-tab-${t.length}`;r.getAttribute("slot")!==v&&r.setAttribute("slot",v),h.hasAttribute("slot")&&h.removeAttribute("slot"),h.hasAttribute("as-tab")||h.setAttribute("as-tab",""),t.push({kind:"dropdown",slotName:v,label:p});continue}}if(u==="scb-dropdown"){const h=r.getAttribute("label")??"";(r.hasAttribute("selected")||r.getAttribute("selected")==="true"||r.getAttribute("active")==="true"||r.getAttribute("aria-current")==="page")&&o===-1&&(o=t.length);const p=`scb-header-tab-${t.length}`;r.getAttribute("slot")!==p&&r.setAttribute("slot",p),r.hasAttribute("as-tab")||r.setAttribute("as-tab",""),t.push({kind:"dropdown",slotName:p,label:h});continue}if(u==="scb-header-utility"){a.push({label:r.getAttribute("label")??"",href:r.getAttribute("href")??"#",target:r.getAttribute("target")??void 0});continue}if(u==="scb-header-menu-group"){const h={label:r.getAttribute("label")??"",icon:r.getAttribute("icon")??void 0,children:[]};r.querySelectorAll("scb-header-menu-item").forEach(p=>h.children.push(i(p))),n.push(h);continue}u==="scb-header-menu-item"&&n.push(i(r))}this._slotNavItems=t,this._slotUtils=a,this._slotMenu=n,!this.hasAttribute("active-tab")&&o>=0&&(this.activeTab=o),queueMicrotask(()=>{this.updateComplete.then(()=>{this._scheduleMeasure()})})},this._measure=()=>{const s=this._top,t=this._logoGroup;if(!s||!t)return;const a=window.innerWidth,n=s.clientWidth,o=this._overflows(this._util),i=this._tabsOverflows(),r=a<this.BP_MD||o||i;this._collapsed?!r&&n>=this._unlockAtWidth&&this._setCollapsed(!1):r&&(this._unlockAtWidth=n+this._HYST,this._setCollapsed(!0));let u=!1;if(this.showSearch&&a>=this.BP_SM&&a<this.BP_MD&&this._searchWrap){const p=getComputedStyle(this._searchWrap),v=Math.max(this._num(p.minWidth,this._tokenPx("--scb-header-search-min",320)),this._tokenPx("--scb-header-search-min",320)),f=this._num(getComputedStyle(s).gap,this._tokenPx("--spacing-7",24)),A=this.showDrawer&&(a<this.BP_MD||this._collapsed)?this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-extra-extra-large",48):0;u=t.getBoundingClientRect().width+f+v+f+A+8>n+.5}this._setHideSearch(u);let h=!1;if(this.showDrawer&&(a<this.BP_MD||this._collapsed)&&!this._visible(this._util)&&!this._visible(this._searchWrap)){const p=this._num(getComputedStyle(s).gap,this._tokenPx("--spacing-7",24)),v=this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-extra-extra-large",48),f=(this._logoGroup?.getBoundingClientRect().width||0)+p+v;this._hideLogoText?h=!(n>=this._logoTextUnlockAt):f>n+.5&&(h=!0,this._logoTextUnlockAt=n+this._HYST)}else h=!1,this._logoTextUnlockAt=0;this._setHideLogoText(h)},this._onDrawerOpened=()=>{this._menuExpanded=!0,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent("drawer-open",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("draweropen",{bubbles:!0,composed:!0}))},this._onDrawerClosed=()=>{this._menuExpanded=!1,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent("drawer-close",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("drawerclose",{bubbles:!0,composed:!0}))},this._onMenuClick=s=>{this.showDrawer&&(this.dispatchEvent(new CustomEvent("menu-click",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("menuclick",{bubbles:!0,composed:!0})))},this._onSearchClick=s=>{const t=this._searchEl;if(t?.submit&&typeof t.submit=="function"){t.submit();return}const a=t?.value??"";this.searchText=a,this.dispatchEvent(new CustomEvent("search-click",{detail:{value:a},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchclick",{detail:{value:a},bubbles:!0,composed:!0})),t?.focus?.()},this._onTabClick=s=>{const t=s.currentTarget;if(!t)return;const a=t.tagName.toLowerCase()==="a";if(a&&(s.defaultPrevented||s.button!==0||s.metaKey||s.ctrlKey||s.shiftKey||s.altKey))return;const n=t.getAttribute("data-index"),o=n!=null?Number(n):0,i=this._getNavItems()[o];if(i?.kind==="dropdown")return;this.activeTab=o;const r=i?.kind==="tab"?i.href??"":"",u=new CustomEvent("tab-change",{detail:{index:o,href:r},bubbles:!0,composed:!0,cancelable:!0}),h=new CustomEvent("tabchange",{detail:{index:o,href:r},bubbles:!0,composed:!0,cancelable:!0});!(this.dispatchEvent(u)&&this.dispatchEvent(h))&&a&&s.preventDefault()},this._onDropdownTabActivate=s=>{const t=s.detail?.dataIndex,a=typeof t=="number"?t:typeof t=="string"?Number(t):this._readTabIndexFromEvent(s);if(a==null||!Number.isFinite(a))return;const n=this._getNavItems();a<0||a>=n.length||n[a]?.kind==="dropdown"&&(this.activeTab=a,this.dispatchEvent(new CustomEvent("tab-change",{detail:{index:a,href:""},bubbles:!0,composed:!0,cancelable:!0})),this.dispatchEvent(new CustomEvent("tabchange",{detail:{index:a,href:""},bubbles:!0,composed:!0,cancelable:!0})))},this._onTabsKeydown=s=>{const t=s.key;if(t!=="ArrowLeft"&&t!=="ArrowRight"&&t!=="Home"&&t!=="End")return;const a=this._getNavItems();if(!a.length)return;const n=this._readTabIndexFromEvent(s);if(n==null)return;let o=Math.max(0,Math.min(a.length-1,n));t==="ArrowRight"?o=(o+1)%a.length:t==="ArrowLeft"?o=(o-1+a.length)%a.length:t==="Home"?o=0:t==="End"&&(o=a.length-1),s.preventDefault(),this._focusTabAtIndex(o)},this._onSearchInput=s=>{this.searchText=s.detail?.value??"",this.dispatchEvent(new CustomEvent("search-input",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchinput",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("search-text-change",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchtextchange",{detail:{value:this.searchText},bubbles:!0,composed:!0}))},this._onSearchSubmit=s=>{this.searchText=s.detail?.value??"",this.dispatchEvent(new CustomEvent("search-change",{detail:{value:this.searchText,active:s.detail?.active},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchchange",{detail:{value:this.searchText,active:s.detail?.active},bubbles:!0,composed:!0}))},this._onSearchClear=()=>{this.searchText="",this.dispatchEvent(new CustomEvent("search-text-change",{detail:{value:""},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchtextchange",{detail:{value:""},bubbles:!0,composed:!0}))};const e=++$;this._drawerId=`scb-header-drawer-${e}`,this._searchId=`scb-header-search-${e}`}get _HYST(){return this._tokenPx("--spacing-11",64)}get BP_SM(){return this._tokenPx("--bp-sm",w.BP_SM_DEFAULT)}get BP_MD(){return this._tokenPx("--bp-md",w.BP_MD_DEFAULT)}_scheduleHarvest(){this._harvestPending||(this._harvestPending=!0,queueMicrotask(()=>{this._harvestPending=!1,this._harvest()}))}get _top(){return this.renderRoot.querySelector(".top-row")}get _util(){return this.renderRoot.querySelector(".utility")}get _logoGroup(){return this.renderRoot.querySelector(".logo-wrap")||this.renderRoot.querySelector(".logo-group")}get _searchWrap(){return this.renderRoot.querySelector(".search")}get _menuBtn(){return this.renderRoot.querySelector(".menu-trigger")}get _searchEl(){return this.renderRoot.querySelector(`#${this._searchId}`)}get _tabsNav(){return this.renderRoot.querySelector(".tabs-nav")}_attachSlotObservers(){this._slotMo?.disconnect(),this._slotWatchers.forEach(n=>n.disconnect()),this._slotWatchers=[];const e=["label","href","icon","target","selected","aria-current","active"],s=n=>{const o=new MutationObserver(i=>{this._scheduleHarvest()});this._slotWatchers.push(o),o.observe(n,{attributes:!0,attributeFilter:e})},t=()=>{this._slotWatchers.forEach(o=>o.disconnect()),this._slotWatchers=[];const n=Array.from(this.children);for(const o of n){const i=o.tagName.toLowerCase();if((i==="scb-header-tab"||i==="scb-dropdown"||i==="scb-header-utility"||i==="scb-header-menu-item"||i==="scb-header-menu-group"||i==="scb-badge")&&s(o),i==="scb-badge"){const r=o,u=new MutationObserver(p=>{t(),this._scheduleHarvest()});this._slotWatchers.push(u),u.observe(r,{childList:!0});const h=r.querySelector("scb-dropdown");h&&s(h);continue}if(i==="scb-header-menu-group"){const r=o,u=new MutationObserver(h=>{t(),this._scheduleHarvest()});this._slotWatchers.push(u),u.observe(r,{childList:!0,subtree:!0}),r.querySelectorAll("scb-header-menu-item").forEach(h=>s(h))}}},a=new MutationObserver(n=>{let o=!1;for(const i of n)if(i.type==="childList"){o=!0;break}o&&t(),this._scheduleHarvest()});this._slotMo=a,a.observe(this,{childList:!0}),t()}_setCollapsed(e){this._collapsed!==e&&(this._collapsed=e,e?this.setAttribute("data-collapsed",""):this.removeAttribute("data-collapsed"))}_setHideSearch(e){e?this.setAttribute("data-hide-search",""):this.removeAttribute("data-hide-search")}_setHideLogoText(e){this._hideLogoText!==e&&(this._hideLogoText=e,e?this.setAttribute("data-hide-logo-text",""):this.removeAttribute("data-hide-logo-text"))}_num(e,s){const t=Number.parseFloat(String(e??"").trim());return Number.isFinite(t)?t:s}_tokenPx(e,s){const t=getComputedStyle(this);return this._num(t.getPropertyValue(e),s)}_visible(e){return e?getComputedStyle(e).display!=="none":!1}_overflows(e){return!e||!this._visible(e)?!1:e.scrollWidth>e.clientWidth+1}_tabsOverflows(){const e=this._tabsNav;if(!e||!this._visible(e))return!1;const s=Array.from(e.querySelectorAll(".tab-wrap"));if(s.length===0)return!1;const t=e.getBoundingClientRect();let a=t.left;for(const n of s){const o=n.getBoundingClientRect();o.width<=0||o.right>a&&(a=o.right)}return a-t.left>t.width+1}firstUpdated(){this.updateComplete.then(()=>{this._harvest(),this._attachSlotObservers(),this._syncDropdownTabs()});const e=this._top;e&&(this._ro=new ResizeObserver(()=>this._scheduleMeasure()),this._ro.observe(e)),window.addEventListener("resize",this._onWindowResize,{passive:!0})}updated(e){e.has("searchMax")&&this.style.setProperty("--scb-header-search-max",this.searchMax??"480px"),e.has("searchMin")&&this.style.setProperty("--scb-header-search-min",this.searchMin??"320px"),e.has("searchHeight")&&(this.searchHeight&&this.searchHeight.trim()?this.style.setProperty("--scb-search-height",this.searchHeight.trim()):this.style.removeProperty("--scb-search-height")),(e.has("logoWidth")||e.has("logoHeight")||e.has("logoAspectRatio"))&&this._applyLogoSizing(),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom"))&&this._applySpacing(),(e.has("utilityItems")||e.has("tabs")||e.has("logoText")||e.has("logoSrc")||e.has("logoWidth")||e.has("logoHeight")||e.has("logoAspectRatio")||e.has("activeTab")||e.has("_slotNavItems")||e.has("_slotUtils")||e.has("_slotMenu")||e.has("showDrawer")||e.has("showSearch")||e.has("searchMax")||e.has("searchMin")||e.has("size"))&&this.updateComplete.then(()=>{this._scheduleMeasure()}),(e.has("activeTab")||e.has("_slotNavItems")||e.has("tabs")||e.has("size"))&&this.updateComplete.then(()=>{this._syncDropdownTabs()})}disconnectedCallback(){this._ro?.disconnect(),this._slotMo?.disconnect(),this._slotWatchers.forEach(e=>e.disconnect()),this._slotWatchers=[],window.removeEventListener("resize",this._onWindowResize),super.disconnectedCallback()}_mapSpacingToken(e){if(!e)return;const s=String(e).trim();if(s)return/^\d+$/.test(s)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(s,10)))})`:s}_applySpacing(){const e=this._mapSpacingToken(this.spacing),s=this._mapSpacingToken(this.spacingTop)??e,t=this._mapSpacingToken(this.spacingBottom)??e;s?this.style.setProperty("--scb-header-spacing-block-start",s):this.style.removeProperty("--scb-header-spacing-block-start"),t?this.style.setProperty("--scb-header-spacing-block-end",t):this.style.removeProperty("--scb-header-spacing-block-end")}_applyLogoSizing(){const e=(this.logoWidth??"").trim(),s=(this.logoHeight??"").trim(),t=(this.logoAspectRatio??"").trim();e?this.style.setProperty("--scb-header-logo-img-w",e):this.style.removeProperty("--scb-header-logo-img-w"),s?this.style.setProperty("--scb-header-logo-img-h",s):e?this.style.setProperty("--scb-header-logo-img-h","auto"):this.style.removeProperty("--scb-header-logo-img-h"),t?this.style.setProperty("--scb-header-logo-img-aspect-ratio",t):this.style.removeProperty("--scb-header-logo-img-aspect-ratio")}_closeDrawerNow(){const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!1)}_syncMenuBtnAria(){const e=this.renderRoot.querySelector(".menu-trigger");e&&e.setAttribute("aria-expanded",String(this._menuExpanded))}_getNavItems(){return this._slotNavItems.length?this._slotNavItems:(this.tabs??[]).map(e=>({kind:"tab",...e}))}_getDropdownForSlot(e){const s=this.querySelector(`[slot="${e}"]`);return s?s.tagName.toLowerCase()==="scb-dropdown"?s:s.querySelector("scb-dropdown"):null}_syncDropdownTabs(){this._getNavItems().forEach((e,s)=>{if(e.kind!=="dropdown")return;const t=this._getDropdownForSlot(e.slotName);if(!t)return;const a=String(s);t.getAttribute("data-index")!==a&&t.setAttribute("data-index",a),t.hasAttribute("as-tab")||t.setAttribute("as-tab","");const n=this.size,o=t;o?.size!==n&&(o.size=n),s===this.activeTab?t.getAttribute("aria-current")!=="page"&&t.setAttribute("aria-current","page"):t.hasAttribute("aria-current")&&t.removeAttribute("aria-current")})}_readTabIndexFromEvent(e){const s=e.composedPath?e.composedPath():[];for(const t of s){if(!(t instanceof HTMLElement))continue;const a=t.getAttribute("data-index");if(a==null)continue;const n=Number(a);if(Number.isFinite(n))return n}return null}_focusTabAtIndex(e){const s=this._getNavItems()[e];if(s){if(s.kind==="dropdown"){this._getDropdownForSlot(s.slotName)?.focus?.();return}this.renderRoot.querySelector(`.tab-link[data-index="${e}"]`)?.focus?.()}}_renderMenuNodes(e){return!e||e.length===0?m``:m`${e.map(s=>this._renderMenuNode(s))}`}_renderMenuNode(e){const s=Array.isArray(e.children)&&e.children.length>0,t=(e.href??"").trim(),a=(e.icon??"").trim();return m`
46
+ `,document.head.appendChild(b);const e=i=>{const r=String(i??"").trim();if(r)return/^\d+$/.test(r)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(r,10)))})`:r},s=i=>{const r=String(i??"").trim();if(!r)return!1;try{const u=JSON.parse(r);return Array.isArray(u)&&u.length>0}catch{return!1}},t=i=>{for(const r of Array.from(i.children)){const u=r.tagName.toLowerCase();if(u==="scb-header-tab"||u==="scb-dropdown")return!0}return!1},a=i=>{t(i)||s(i.getAttribute("tabs"))?i.setAttribute("data-pre-has-tabs",""):i.removeAttribute("data-pre-has-tabs");const r=e(i.getAttribute("spacing")),u=e(i.getAttribute("spacing-top"))??r,h=e(i.getAttribute("spacing-bottom"))??r;u?i.style.setProperty("--scb-header-spacing-block-start",u):i.style.removeProperty("--scb-header-spacing-block-start"),h?i.style.setProperty("--scb-header-spacing-block-end",h):i.style.removeProperty("--scb-header-spacing-block-end");const p=(i.getAttribute("logo-width")??"").trim();p?i.style.setProperty("--scb-header-pre-logo-w",p):i.style.removeProperty("--scb-header-pre-logo-w");const v=(i.getAttribute("logo-height")??"").trim();v?i.style.setProperty("--scb-header-pre-logo-img-h",v):i.style.removeProperty("--scb-header-pre-logo-img-h");const f=(i.getAttribute("search-height")??"").trim();f?i.style.setProperty("--scb-header-pre-control-size",f):i.style.removeProperty("--scb-header-pre-control-size")};document.querySelectorAll("scb-header").forEach(a);const o=new MutationObserver(i=>{for(const r of i){if(r.type==="attributes"){const u=r.target;u instanceof HTMLElement&&u.tagName.toLowerCase()==="scb-header"&&a(u);continue}if(r.type==="childList"){const u=[...Array.from(r.addedNodes),...Array.from(r.removedNodes)];for(const h of u){if(!(h instanceof HTMLElement))continue;if(h.tagName.toLowerCase()==="scb-header"){a(h);continue}const p=h.closest?.("scb-header");p&&a(p)}}}});o.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabs","spacing","spacing-top","spacing-bottom","logo-width","logo-height","logo-aspect-ratio","search-height"]}),customElements.whenDefined("scb-header").then(()=>{o.disconnect()})};E();var S={fromAttribute:b=>b==null?!0:!/^(false|0|off|no)$/i.test(b),toAttribute:b=>String(!!b)},x={fromAttribute:b=>b==null?!1:!/^(false|0|off|no)$/i.test(b),toAttribute:b=>b?"":null},M={fromAttribute:b=>b==="small"||b==="large"?b:"medium",toAttribute:b=>{const e=String(b??"");return e==="small"||e==="large"?e:null}},l=(_=class extends k{constructor(){super(),this.maxWidth="1440px",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.size="medium",this.logoText="",this.logoHref="/",this.logoSrc="",this.logoWidth="",this.logoHeight="",this.logoAspectRatio="",this.logoInvertDm=!1,this.banner=!1,this.tabs=[],this.activeTab=null,this.reserveTabs=!1,this.utilityItems=[],this.showDrawer=!0,this.alwaysShowMenuButton=!1,this.showSearch=!0,this.includeUtilityInMenu=!1,this.drawerOverlay=!0,this.searchText="",this._drawerId="main-drawer",this._menuExpanded=!1,this._searchId="header-search",this._slotNavItems=[],this._slotUtils=[],this._slotMenu=[],this._measureScheduled=!1,this._scheduleMeasure=()=>{this._measureScheduled||(this._measureScheduled=!0,requestAnimationFrame(()=>{this._measureScheduled=!1,this._measure()}))},this._onWindowResize=()=>{this._scheduleMeasure()},this._onMenuSelect=s=>{const t=s.detail;this.dispatchEvent(new CustomEvent("scb-menu-select",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbmenuselect",{detail:t,bubbles:!0,composed:!0}));const a=t?.item,n=typeof t?.href=="string"?t.href:typeof t?.itemHref=="string"?t.itemHref:typeof t?.item_href=="string"?t.item_href:"",o=a?a.getAttribute("item-href")??a.getAttribute("href")??"":"";String(n||o||"").trim()&&this._closeDrawerNow()},this._collapsed=!1,this._unlockAtWidth=0,this._hideLogoText=!1,this._logoTextUnlockAt=0,this._slotWatchers=[],this._harvestPending=!1,this._harvest=()=>{const s=Array.from(this.children),t=[],a=[],n=[];let o=-1;const i=r=>({label:r.getAttribute("label")??"",href:r.getAttribute("href")??void 0,icon:r.getAttribute("icon")??void 0});for(const r of s){const u=r.tagName.toLowerCase();if(u==="scb-header-tab"){const h=r.getAttribute("label")??"",p=r.getAttribute("href"),v=p&&p.trim()!==""?p:void 0;(r.hasAttribute("selected")||r.getAttribute("selected")==="true"||r.getAttribute("active")==="true"||r.getAttribute("aria-current")==="page")&&o===-1&&(o=t.length),t.push({kind:"tab",label:h,href:v});continue}if(u==="scb-badge"){const h=r.querySelector("scb-dropdown");if(h){const p=h.getAttribute("label")??"";(h.hasAttribute("selected")||h.getAttribute("selected")==="true"||h.getAttribute("active")==="true"||h.getAttribute("aria-current")==="page")&&o===-1&&(o=t.length);const v=`scb-header-tab-${t.length}`;r.getAttribute("slot")!==v&&r.setAttribute("slot",v),h.hasAttribute("slot")&&h.removeAttribute("slot"),h.hasAttribute("as-tab")||h.setAttribute("as-tab",""),t.push({kind:"dropdown",slotName:v,label:p});continue}}if(u==="scb-dropdown"){const h=r.getAttribute("label")??"";(r.hasAttribute("selected")||r.getAttribute("selected")==="true"||r.getAttribute("active")==="true"||r.getAttribute("aria-current")==="page")&&o===-1&&(o=t.length);const p=`scb-header-tab-${t.length}`;r.getAttribute("slot")!==p&&r.setAttribute("slot",p),r.hasAttribute("as-tab")||r.setAttribute("as-tab",""),t.push({kind:"dropdown",slotName:p,label:h});continue}if(u==="scb-header-utility"){a.push({label:r.getAttribute("label")??"",href:r.getAttribute("href")??"#",target:r.getAttribute("target")??void 0});continue}if(u==="scb-header-menu-group"){const h={label:r.getAttribute("label")??"",icon:r.getAttribute("icon")??void 0,children:[]};r.querySelectorAll("scb-header-menu-item").forEach(p=>h.children.push(i(p))),n.push(h);continue}u==="scb-header-menu-item"&&n.push(i(r))}this._slotNavItems=t,this._slotUtils=a,this._slotMenu=n,!this.hasAttribute("active-tab")&&o>=0&&(this.activeTab=o),queueMicrotask(()=>{this.updateComplete.then(()=>{this._scheduleMeasure()})})},this._measure=()=>{const s=this._top,t=this._logoGroup;if(!s||!t)return;const a=window.innerWidth,n=s.clientWidth,o=this._overflows(this._util),i=this._tabsOverflows(),r=a<this.BP_MD||o||i;this._collapsed?!r&&n>=this._unlockAtWidth&&this._setCollapsed(!1):r&&(this._unlockAtWidth=n+this._HYST,this._setCollapsed(!0));let u=!1;if(this.showSearch&&a>=this.BP_SM&&a<this.BP_MD&&this._searchWrap){const p=getComputedStyle(this._searchWrap),v=Math.max(this._num(p.minWidth,this._tokenPx("--scb-header-search-min",320)),this._tokenPx("--scb-header-search-min",320)),f=this._num(getComputedStyle(s).gap,this._tokenPx("--spacing-7",24)),A=this.showDrawer&&(this.alwaysShowMenuButton||a<this.BP_MD||this._collapsed)?this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-extra-extra-large",48):0;u=t.getBoundingClientRect().width+f+v+f+A+8>n+.5}this._setHideSearch(u);let h=!1;if(this.showDrawer&&(this.alwaysShowMenuButton||a<this.BP_MD||this._collapsed)&&!this._visible(this._util)&&!this._visible(this._searchWrap)){const p=this._num(getComputedStyle(s).gap,this._tokenPx("--spacing-7",24)),v=this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-extra-extra-large",48),f=(this._logoGroup?.getBoundingClientRect().width||0)+p+v;this._hideLogoText?h=!(n>=this._logoTextUnlockAt):f>n+.5&&(h=!0,this._logoTextUnlockAt=n+this._HYST)}else h=!1,this._logoTextUnlockAt=0;this._setHideLogoText(h)},this._onDrawerOpened=()=>{this._menuExpanded=!0,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent("drawer-open",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("draweropen",{bubbles:!0,composed:!0}))},this._onDrawerClosed=()=>{this._menuExpanded=!1,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent("drawer-close",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("drawerclose",{bubbles:!0,composed:!0}))},this._onMenuClick=s=>{this.showDrawer&&(this.dispatchEvent(new CustomEvent("menu-click",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("menuclick",{bubbles:!0,composed:!0})))},this._onSearchClick=s=>{const t=this._searchEl;if(t?.submit&&typeof t.submit=="function"){t.submit();return}const a=t?.value??"";this.searchText=a,this.dispatchEvent(new CustomEvent("search-click",{detail:{value:a},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchclick",{detail:{value:a},bubbles:!0,composed:!0})),t?.focus?.()},this._onTabClick=s=>{const t=s.currentTarget;if(!t)return;const a=t.tagName.toLowerCase()==="a";if(a&&(s.defaultPrevented||s.button!==0||s.metaKey||s.ctrlKey||s.shiftKey||s.altKey))return;const n=t.getAttribute("data-index"),o=n!=null?Number(n):0,i=this._getNavItems()[o];if(i?.kind==="dropdown")return;this.activeTab=o;const r=i?.kind==="tab"?i.href??"":"",u=new CustomEvent("tab-change",{detail:{index:o,href:r},bubbles:!0,composed:!0,cancelable:!0}),h=new CustomEvent("tabchange",{detail:{index:o,href:r},bubbles:!0,composed:!0,cancelable:!0});!(this.dispatchEvent(u)&&this.dispatchEvent(h))&&a&&s.preventDefault()},this._onDropdownTabActivate=s=>{const t=s.detail?.dataIndex,a=typeof t=="number"?t:typeof t=="string"?Number(t):this._readTabIndexFromEvent(s);if(a==null||!Number.isFinite(a))return;const n=this._getNavItems();a<0||a>=n.length||n[a]?.kind==="dropdown"&&(this.activeTab=a,this.dispatchEvent(new CustomEvent("tab-change",{detail:{index:a,href:""},bubbles:!0,composed:!0,cancelable:!0})),this.dispatchEvent(new CustomEvent("tabchange",{detail:{index:a,href:""},bubbles:!0,composed:!0,cancelable:!0})))},this._onTabsKeydown=s=>{const t=s.key;if(t!=="ArrowLeft"&&t!=="ArrowRight"&&t!=="Home"&&t!=="End")return;const a=this._getNavItems();if(!a.length)return;const n=this._readTabIndexFromEvent(s);if(n==null)return;let o=Math.max(0,Math.min(a.length-1,n));t==="ArrowRight"?o=(o+1)%a.length:t==="ArrowLeft"?o=(o-1+a.length)%a.length:t==="Home"?o=0:t==="End"&&(o=a.length-1),s.preventDefault(),this._focusTabAtIndex(o)},this._onSearchInput=s=>{this.searchText=s.detail?.value??"",this.dispatchEvent(new CustomEvent("search-input",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchinput",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("search-text-change",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchtextchange",{detail:{value:this.searchText},bubbles:!0,composed:!0}))},this._onSearchSubmit=s=>{this.searchText=s.detail?.value??"",this.dispatchEvent(new CustomEvent("search-change",{detail:{value:this.searchText,active:s.detail?.active},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchchange",{detail:{value:this.searchText,active:s.detail?.active},bubbles:!0,composed:!0}))},this._onSearchClear=()=>{this.searchText="",this.dispatchEvent(new CustomEvent("search-text-change",{detail:{value:""},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchtextchange",{detail:{value:""},bubbles:!0,composed:!0}))};const e=++$;this._drawerId=`scb-header-drawer-${e}`,this._searchId=`scb-header-search-${e}`}get _HYST(){return this._tokenPx("--spacing-11",64)}get BP_SM(){return this._tokenPx("--bp-sm",w.BP_SM_DEFAULT)}get BP_MD(){return this._tokenPx("--bp-md",w.BP_MD_DEFAULT)}_scheduleHarvest(){this._harvestPending||(this._harvestPending=!0,queueMicrotask(()=>{this._harvestPending=!1,this._harvest()}))}get _top(){return this.renderRoot.querySelector(".top-row")}get _util(){return this.renderRoot.querySelector(".utility")}get _logoGroup(){return this.renderRoot.querySelector(".logo-wrap")||this.renderRoot.querySelector(".logo-group")}get _searchWrap(){return this.renderRoot.querySelector(".search")}get _menuBtn(){return this.renderRoot.querySelector(".menu-trigger")}get _searchEl(){return this.renderRoot.querySelector(`#${this._searchId}`)}get _tabsNav(){return this.renderRoot.querySelector(".tabs-nav")}_attachSlotObservers(){this._slotMo?.disconnect(),this._slotWatchers.forEach(n=>n.disconnect()),this._slotWatchers=[];const e=["label","href","icon","target","selected","aria-current","active"],s=n=>{const o=new MutationObserver(i=>{this._scheduleHarvest()});this._slotWatchers.push(o),o.observe(n,{attributes:!0,attributeFilter:e})},t=()=>{this._slotWatchers.forEach(o=>o.disconnect()),this._slotWatchers=[];const n=Array.from(this.children);for(const o of n){const i=o.tagName.toLowerCase();if((i==="scb-header-tab"||i==="scb-dropdown"||i==="scb-header-utility"||i==="scb-header-menu-item"||i==="scb-header-menu-group"||i==="scb-badge")&&s(o),i==="scb-badge"){const r=o,u=new MutationObserver(p=>{t(),this._scheduleHarvest()});this._slotWatchers.push(u),u.observe(r,{childList:!0});const h=r.querySelector("scb-dropdown");h&&s(h);continue}if(i==="scb-header-menu-group"){const r=o,u=new MutationObserver(h=>{t(),this._scheduleHarvest()});this._slotWatchers.push(u),u.observe(r,{childList:!0,subtree:!0}),r.querySelectorAll("scb-header-menu-item").forEach(h=>s(h))}}},a=new MutationObserver(n=>{let o=!1;for(const i of n)if(i.type==="childList"){o=!0;break}o&&t(),this._scheduleHarvest()});this._slotMo=a,a.observe(this,{childList:!0}),t()}_setCollapsed(e){this._collapsed!==e&&(this._collapsed=e,e?this.setAttribute("data-collapsed",""):this.removeAttribute("data-collapsed"))}_setHideSearch(e){e?this.setAttribute("data-hide-search",""):this.removeAttribute("data-hide-search")}_setHideLogoText(e){this._hideLogoText!==e&&(this._hideLogoText=e,e?this.setAttribute("data-hide-logo-text",""):this.removeAttribute("data-hide-logo-text"))}_num(e,s){const t=Number.parseFloat(String(e??"").trim());return Number.isFinite(t)?t:s}_tokenPx(e,s){const t=getComputedStyle(this);return this._num(t.getPropertyValue(e),s)}_visible(e){return e?getComputedStyle(e).display!=="none":!1}_overflows(e){return!e||!this._visible(e)?!1:e.scrollWidth>e.clientWidth+1}_tabsOverflows(){const e=this._tabsNav;if(!e||!this._visible(e))return!1;const s=Array.from(e.querySelectorAll(".tab-wrap"));if(s.length===0)return!1;const t=e.getBoundingClientRect();let a=t.left;for(const n of s){const o=n.getBoundingClientRect();o.width<=0||o.right>a&&(a=o.right)}return a-t.left>t.width+1}firstUpdated(){this.updateComplete.then(()=>{this._harvest(),this._attachSlotObservers(),this._syncDropdownTabs()});const e=this._top;e&&(this._ro=new ResizeObserver(()=>this._scheduleMeasure()),this._ro.observe(e)),window.addEventListener("resize",this._onWindowResize,{passive:!0})}updated(e){e.has("searchMax")&&this.style.setProperty("--scb-header-search-max",this.searchMax??"480px"),e.has("searchMin")&&this.style.setProperty("--scb-header-search-min",this.searchMin??"320px"),e.has("searchHeight")&&(this.searchHeight&&this.searchHeight.trim()?this.style.setProperty("--scb-search-height",this.searchHeight.trim()):this.style.removeProperty("--scb-search-height")),(e.has("logoWidth")||e.has("logoHeight")||e.has("logoAspectRatio"))&&this._applyLogoSizing(),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom"))&&this._applySpacing(),(e.has("utilityItems")||e.has("tabs")||e.has("logoText")||e.has("logoSrc")||e.has("logoWidth")||e.has("logoHeight")||e.has("logoAspectRatio")||e.has("activeTab")||e.has("_slotNavItems")||e.has("_slotUtils")||e.has("_slotMenu")||e.has("showDrawer")||e.has("alwaysShowMenuButton")||e.has("showSearch")||e.has("searchMax")||e.has("searchMin")||e.has("size"))&&this.updateComplete.then(()=>{this._scheduleMeasure()}),(e.has("activeTab")||e.has("_slotNavItems")||e.has("tabs")||e.has("size"))&&this.updateComplete.then(()=>{this._syncDropdownTabs()})}disconnectedCallback(){this._ro?.disconnect(),this._slotMo?.disconnect(),this._slotWatchers.forEach(e=>e.disconnect()),this._slotWatchers=[],window.removeEventListener("resize",this._onWindowResize),super.disconnectedCallback()}_mapSpacingToken(e){if(!e)return;const s=String(e).trim();if(s)return/^\d+$/.test(s)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(s,10)))})`:s}_applySpacing(){const e=this._mapSpacingToken(this.spacing),s=this._mapSpacingToken(this.spacingTop)??e,t=this._mapSpacingToken(this.spacingBottom)??e;s?this.style.setProperty("--scb-header-spacing-block-start",s):this.style.removeProperty("--scb-header-spacing-block-start"),t?this.style.setProperty("--scb-header-spacing-block-end",t):this.style.removeProperty("--scb-header-spacing-block-end")}_applyLogoSizing(){const e=(this.logoWidth??"").trim(),s=(this.logoHeight??"").trim(),t=(this.logoAspectRatio??"").trim();e?this.style.setProperty("--scb-header-logo-img-w",e):this.style.removeProperty("--scb-header-logo-img-w"),s?this.style.setProperty("--scb-header-logo-img-h",s):e?this.style.setProperty("--scb-header-logo-img-h","auto"):this.style.removeProperty("--scb-header-logo-img-h"),t?this.style.setProperty("--scb-header-logo-img-aspect-ratio",t):this.style.removeProperty("--scb-header-logo-img-aspect-ratio")}_closeDrawerNow(){const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!1)}_syncMenuBtnAria(){const e=this.renderRoot.querySelector(".menu-trigger");e&&e.setAttribute("aria-expanded",String(this._menuExpanded))}_getNavItems(){return this._slotNavItems.length?this._slotNavItems:(this.tabs??[]).map(e=>({kind:"tab",...e}))}_getDropdownForSlot(e){const s=this.querySelector(`[slot="${e}"]`);return s?s.tagName.toLowerCase()==="scb-dropdown"?s:s.querySelector("scb-dropdown"):null}_syncDropdownTabs(){this._getNavItems().forEach((e,s)=>{if(e.kind!=="dropdown")return;const t=this._getDropdownForSlot(e.slotName);if(!t)return;const a=String(s);t.getAttribute("data-index")!==a&&t.setAttribute("data-index",a),t.hasAttribute("as-tab")||t.setAttribute("as-tab","");const n=this.size,o=t;o?.size!==n&&(o.size=n),s===this.activeTab?t.getAttribute("aria-current")!=="page"&&t.setAttribute("aria-current","page"):t.hasAttribute("aria-current")&&t.removeAttribute("aria-current")})}_readTabIndexFromEvent(e){const s=e.composedPath?e.composedPath():[];for(const t of s){if(!(t instanceof HTMLElement))continue;const a=t.getAttribute("data-index");if(a==null)continue;const n=Number(a);if(Number.isFinite(n))return n}return null}_focusTabAtIndex(e){const s=this._getNavItems()[e];if(s){if(s.kind==="dropdown"){this._getDropdownForSlot(s.slotName)?.focus?.();return}this.renderRoot.querySelector(`.tab-link[data-index="${e}"]`)?.focus?.()}}_renderMenuNodes(e){return!e||e.length===0?m``:m`${e.map(s=>this._renderMenuNode(s))}`}_renderMenuNode(e){const s=Array.isArray(e.children)&&e.children.length>0,t=(e.href??"").trim(),a=(e.icon??"").trim();return m`
47
47
  <scb-menu-item
48
48
  label=${e.label}
49
49
  ?selected=${!1}
@@ -527,6 +527,9 @@ import"../../vendor/vendor-material.js";import{_ as k,b as C,g as T,h as d,m as
527
527
  display: inline-flex;
528
528
  }
529
529
  }
530
+ :host([always-show-menu-button]) .menu-trigger {
531
+ display: inline-flex;
532
+ }
530
533
  :host([data-collapsed]) .menu-trigger {
531
534
  display: inline-flex;
532
535
  }
@@ -678,4 +681,4 @@ import"../../vendor/vendor-material.js";import{_ as k,b as C,g as T,h as d,m as
678
681
  :host([data-hide-logo-text]) .logo-text {
679
682
  display: none;
680
683
  }
681
- `,_);c([d({type:String,attribute:"max-width"})],l.prototype,"maxWidth",void 0);c([d({type:String,reflect:!0})],l.prototype,"spacing",void 0);c([d({type:String,attribute:"spacing-top",reflect:!0})],l.prototype,"spacingTop",void 0);c([d({type:String,attribute:"spacing-bottom",reflect:!0})],l.prototype,"spacingBottom",void 0);c([d({type:String,reflect:!0,converter:M})],l.prototype,"size",void 0);c([d({type:String,attribute:"logo-text"})],l.prototype,"logoText",void 0);c([d({type:String,attribute:"logo-href"})],l.prototype,"logoHref",void 0);c([d({type:String,attribute:"logo-src"})],l.prototype,"logoSrc",void 0);c([d({type:String,attribute:"logo-width"})],l.prototype,"logoWidth",void 0);c([d({type:String,attribute:"logo-height"})],l.prototype,"logoHeight",void 0);c([d({type:String,attribute:"logo-aspect-ratio"})],l.prototype,"logoAspectRatio",void 0);c([d({type:Boolean,attribute:"logo-invert-dm",reflect:!0,converter:S})],l.prototype,"logoInvertDm",void 0);c([d({type:Boolean,reflect:!0})],l.prototype,"banner",void 0);c([d({type:String,attribute:"banner-label"})],l.prototype,"bannerLabel",void 0);c([d({type:Array,attribute:"tabs",converter:l._JSON_ARRAY})],l.prototype,"tabs",void 0);c([d({type:Number,attribute:"active-tab"})],l.prototype,"activeTab",void 0);c([d({type:Boolean,attribute:"reserve-tabs",reflect:!0,converter:S})],l.prototype,"reserveTabs",void 0);c([d({type:Number,attribute:"reserve-tabs-count"})],l.prototype,"reserveTabsCount",void 0);c([d({type:String,attribute:"reserve-tabs-widths"})],l.prototype,"reserveTabsWidths",void 0);c([d({type:Array,attribute:"utility-items",converter:l._JSON_ARRAY})],l.prototype,"utilityItems",void 0);c([d({type:String,attribute:"search-placeholder"})],l.prototype,"searchPlaceholder",void 0);c([d({type:String,attribute:"menu-label"})],l.prototype,"menuLabel",void 0);c([d({type:String,attribute:"menu-sub-label"})],l.prototype,"menuSubLabel",void 0);c([d({type:String,attribute:"menu-section-label"})],l.prototype,"menuSectionLabel",void 0);c([d({type:String,attribute:"menu-search-placeholder"})],l.prototype,"menuSearchPlaceholder",void 0);c([d({type:Array,attribute:"menu-data",converter:l._JSON_ARRAY})],l.prototype,"menuData",void 0);c([d({type:Boolean,attribute:"show-drawer",reflect:!0,converter:x})],l.prototype,"showDrawer",void 0);c([d({type:Boolean,attribute:"show-search",reflect:!0,converter:x})],l.prototype,"showSearch",void 0);c([d({type:Boolean,attribute:"include-utility-in-menu",reflect:!0,converter:S})],l.prototype,"includeUtilityInMenu",void 0);c([d({type:Boolean,attribute:"drawer-overlay",reflect:!0,converter:x})],l.prototype,"drawerOverlay",void 0);c([d({type:String,attribute:"search-max"})],l.prototype,"searchMax",void 0);c([d({type:String,attribute:"search-min"})],l.prototype,"searchMin",void 0);c([d({type:String,attribute:"search-height"})],l.prototype,"searchHeight",void 0);c([d({type:String,attribute:"search-text",reflect:!0})],l.prototype,"searchText",void 0);c([y()],l.prototype,"_drawerId",void 0);c([y()],l.prototype,"_menuExpanded",void 0);c([y()],l.prototype,"_searchId",void 0);c([y()],l.prototype,"_slotNavItems",void 0);c([y()],l.prototype,"_slotUtils",void 0);c([y()],l.prototype,"_slotMenu",void 0);c([y()],l.prototype,"_collapsed",void 0);c([y()],l.prototype,"_hideLogoText",void 0);l=w=c([T("scb-header")],l);
684
+ `,_);c([d({type:String,attribute:"max-width"})],l.prototype,"maxWidth",void 0);c([d({type:String,reflect:!0})],l.prototype,"spacing",void 0);c([d({type:String,attribute:"spacing-top",reflect:!0})],l.prototype,"spacingTop",void 0);c([d({type:String,attribute:"spacing-bottom",reflect:!0})],l.prototype,"spacingBottom",void 0);c([d({type:String,reflect:!0,converter:M})],l.prototype,"size",void 0);c([d({type:String,attribute:"logo-text"})],l.prototype,"logoText",void 0);c([d({type:String,attribute:"logo-href"})],l.prototype,"logoHref",void 0);c([d({type:String,attribute:"logo-src"})],l.prototype,"logoSrc",void 0);c([d({type:String,attribute:"logo-width"})],l.prototype,"logoWidth",void 0);c([d({type:String,attribute:"logo-height"})],l.prototype,"logoHeight",void 0);c([d({type:String,attribute:"logo-aspect-ratio"})],l.prototype,"logoAspectRatio",void 0);c([d({type:Boolean,attribute:"logo-invert-dm",reflect:!0,converter:x})],l.prototype,"logoInvertDm",void 0);c([d({type:Boolean,reflect:!0})],l.prototype,"banner",void 0);c([d({type:String,attribute:"banner-label"})],l.prototype,"bannerLabel",void 0);c([d({type:Array,attribute:"tabs",converter:l._JSON_ARRAY})],l.prototype,"tabs",void 0);c([d({type:Number,attribute:"active-tab"})],l.prototype,"activeTab",void 0);c([d({type:Boolean,attribute:"reserve-tabs",reflect:!0,converter:x})],l.prototype,"reserveTabs",void 0);c([d({type:Number,attribute:"reserve-tabs-count"})],l.prototype,"reserveTabsCount",void 0);c([d({type:String,attribute:"reserve-tabs-widths"})],l.prototype,"reserveTabsWidths",void 0);c([d({type:Array,attribute:"utility-items",converter:l._JSON_ARRAY})],l.prototype,"utilityItems",void 0);c([d({type:String,attribute:"search-placeholder"})],l.prototype,"searchPlaceholder",void 0);c([d({type:String,attribute:"menu-label"})],l.prototype,"menuLabel",void 0);c([d({type:String,attribute:"menu-sub-label"})],l.prototype,"menuSubLabel",void 0);c([d({type:String,attribute:"menu-section-label"})],l.prototype,"menuSectionLabel",void 0);c([d({type:String,attribute:"menu-search-placeholder"})],l.prototype,"menuSearchPlaceholder",void 0);c([d({type:Array,attribute:"menu-data",converter:l._JSON_ARRAY})],l.prototype,"menuData",void 0);c([d({type:Boolean,attribute:"show-drawer",reflect:!0,converter:S})],l.prototype,"showDrawer",void 0);c([d({type:Boolean,attribute:"always-show-menu-button",reflect:!0,converter:x})],l.prototype,"alwaysShowMenuButton",void 0);c([d({type:Boolean,attribute:"show-search",reflect:!0,converter:S})],l.prototype,"showSearch",void 0);c([d({type:Boolean,attribute:"include-utility-in-menu",reflect:!0,converter:x})],l.prototype,"includeUtilityInMenu",void 0);c([d({type:Boolean,attribute:"drawer-overlay",reflect:!0,converter:S})],l.prototype,"drawerOverlay",void 0);c([d({type:String,attribute:"search-max"})],l.prototype,"searchMax",void 0);c([d({type:String,attribute:"search-min"})],l.prototype,"searchMin",void 0);c([d({type:String,attribute:"search-height"})],l.prototype,"searchHeight",void 0);c([d({type:String,attribute:"search-text",reflect:!0})],l.prototype,"searchText",void 0);c([y()],l.prototype,"_drawerId",void 0);c([y()],l.prototype,"_menuExpanded",void 0);c([y()],l.prototype,"_searchId",void 0);c([y()],l.prototype,"_slotNavItems",void 0);c([y()],l.prototype,"_slotUtils",void 0);c([y()],l.prototype,"_slotMenu",void 0);c([y()],l.prototype,"_collapsed",void 0);c([y()],l.prototype,"_hideLogoText",void 0);l=w=c([T("scb-header")],l);
package/mvc/scb-logo.svg CHANGED
@@ -1,21 +1,21 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <svg viewBox="-0.0002 -0.0066 1344.9076 377.9532" xmlns="http://www.w3.org/2000/svg">
3
- <defs>
4
- <style type="text/css">
5
- g {
6
- fill: #100f0d;
7
- }
8
- g:target {
9
- fill: #fff;
10
- }
11
- </style>
12
- </defs>
13
- <g transform="matrix(1.3333330154418945, 0, 0, -1.3333330154418945, 0, 377.9466552734375)" id="g10">
14
- <g transform="scale(0.1)" id="inverted">
15
- <path id="path14" d="m 1346.6,2515.59 c 0,48.24 -39.11,87.31 -87.4,87.31 -48.29,0 -87.4,-39.07 -87.4,-87.31 V 312.898 c 0,-48.339 39.11,-87.5 87.4,-87.5 48.29,0 87.4,39.161 87.4,87.5 V 1106.8 c 0,5.77 4.79,10.45 10.51,10.45 h 287.22 c 5.76,0 10.5,-4.68 10.5,-10.45 V 305.969 C 1654.83,137.02 1477.67,0 1259.2,0 1040.63,0 863.523,137.02 863.523,305.969 V 2528.77 c 0,168.86 177.107,305.88 395.677,305.88 218.47,0 395.63,-137.02 395.63,-305.88 V 1738.1 c 0,-5.86 -4.74,-10.45 -10.5,-10.45 h -287.22 c -5.72,0 -10.51,4.59 -10.51,10.45 v 777.49"/>
16
- <path id="path16" d="M 10.4414,2265.38 C -8.01563,2136.85 -1.52734,1926.1 26.1172,1807.73 56.4922,1678.71 231.645,1417.96 310.555,1296.86 389.566,1175.85 494.949,1049.49 493.375,880.922 V 477.18 c 0,-48.25 -39.109,-87.41 -87.406,-87.41 -48.145,0 -87.254,39.16 -87.254,87.41 v 618.79 c 0,5.76 -4.785,10.55 -10.645,10.55 H 20.9453 c -5.8711,0 -10.5039,-4.79 -10.5039,-10.55 V 458.719 c 0,-168.957 177.1056,-305.969 395.5276,-305.969 218.574,0 395.683,137.012 395.683,305.969 v 422.203 c -1.324,289.568 -80.332,331.748 -182.867,505.398 -73.445,124.71 -254.121,381.95 -284.398,510.97 -27.735,118.36 -26.516,255.39 -15.672,379.9 0,48.25 39.109,87.41 87.254,87.41 48.297,0 87.406,-39.16 87.406,-87.41 v -550.32 c 0,-5.77 4.746,-10.45 10.645,-10.45 h 287.085 c 5.911,0 10.547,4.68 10.547,10.45 v 538.51 c 0,169.06 -177.109,305.97 -395.683,305.97 -218.422,0 -395.5276,-136.91 -395.5276,-305.97"/>
17
- <path id="path18" d="m 1726.57,2547.82 h 440.8 c 182.04,0 329.61,-147.57 329.61,-329.52 v -462.24 c 0,-129.59 -84.97,-238.98 -202.16,-276.48 v -6.24 c 117.19,-37.4 202.16,-146.89 202.16,-276.58 V 491.148 c 0,-160.367 -130.2,-290.457 -290.45,-290.457 l -479.96,-0.293 c -5.91,0 -10.6,4.793 -10.6,10.454 V 2537.37 c 0,5.66 4.69,10.45 10.6,10.45 m 308.27,-229.22 c -5.97,0 -10.65,-4.78 -10.65,-10.55 v -729.33 c 0,-5.97 4.68,-10.65 10.65,-10.65 h 43.36 c 58.01,0 105.08,47.16 105.08,105.18 v 540.18 c 0,58 -47.07,105.17 -105.08,105.17 z m 0,-982.29 c -5.97,0 -10.65,-4.69 -10.65,-10.45 V 430.59 c 0,-5.86 4.68,-10.649 10.65,-10.649 h 51.85 c 58.12,0 105.09,47.18 105.09,105.188 v 706.011 c 0,58.19 -46.97,105.17 -105.09,105.17 h -51.85"/>
18
- </g>
19
- </g>
20
- <text style="fill: rgb(1, 1, 1); font-family: Roboto; font-size: 139.2px; font-weight: 500; stroke: rgb(0, 0, 0); white-space: pre;" x="455.182" y="234.25">Designsystem</text>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <svg viewBox="-0.0002 -0.0066 1344.9076 377.9532" xmlns="http://www.w3.org/2000/svg">
3
+ <defs>
4
+ <style type="text/css">
5
+ g {
6
+ fill: #100f0d;
7
+ }
8
+ g:target {
9
+ fill: #fff;
10
+ }
11
+ </style>
12
+ </defs>
13
+ <g transform="matrix(1.3333330154418945, 0, 0, -1.3333330154418945, 0, 377.9466552734375)" id="g10">
14
+ <g transform="scale(0.1)" id="inverted">
15
+ <path id="path14" d="m 1346.6,2515.59 c 0,48.24 -39.11,87.31 -87.4,87.31 -48.29,0 -87.4,-39.07 -87.4,-87.31 V 312.898 c 0,-48.339 39.11,-87.5 87.4,-87.5 48.29,0 87.4,39.161 87.4,87.5 V 1106.8 c 0,5.77 4.79,10.45 10.51,10.45 h 287.22 c 5.76,0 10.5,-4.68 10.5,-10.45 V 305.969 C 1654.83,137.02 1477.67,0 1259.2,0 1040.63,0 863.523,137.02 863.523,305.969 V 2528.77 c 0,168.86 177.107,305.88 395.677,305.88 218.47,0 395.63,-137.02 395.63,-305.88 V 1738.1 c 0,-5.86 -4.74,-10.45 -10.5,-10.45 h -287.22 c -5.72,0 -10.51,4.59 -10.51,10.45 v 777.49"/>
16
+ <path id="path16" d="M 10.4414,2265.38 C -8.01563,2136.85 -1.52734,1926.1 26.1172,1807.73 56.4922,1678.71 231.645,1417.96 310.555,1296.86 389.566,1175.85 494.949,1049.49 493.375,880.922 V 477.18 c 0,-48.25 -39.109,-87.41 -87.406,-87.41 -48.145,0 -87.254,39.16 -87.254,87.41 v 618.79 c 0,5.76 -4.785,10.55 -10.645,10.55 H 20.9453 c -5.8711,0 -10.5039,-4.79 -10.5039,-10.55 V 458.719 c 0,-168.957 177.1056,-305.969 395.5276,-305.969 218.574,0 395.683,137.012 395.683,305.969 v 422.203 c -1.324,289.568 -80.332,331.748 -182.867,505.398 -73.445,124.71 -254.121,381.95 -284.398,510.97 -27.735,118.36 -26.516,255.39 -15.672,379.9 0,48.25 39.109,87.41 87.254,87.41 48.297,0 87.406,-39.16 87.406,-87.41 v -550.32 c 0,-5.77 4.746,-10.45 10.645,-10.45 h 287.085 c 5.911,0 10.547,4.68 10.547,10.45 v 538.51 c 0,169.06 -177.109,305.97 -395.683,305.97 -218.422,0 -395.5276,-136.91 -395.5276,-305.97"/>
17
+ <path id="path18" d="m 1726.57,2547.82 h 440.8 c 182.04,0 329.61,-147.57 329.61,-329.52 v -462.24 c 0,-129.59 -84.97,-238.98 -202.16,-276.48 v -6.24 c 117.19,-37.4 202.16,-146.89 202.16,-276.58 V 491.148 c 0,-160.367 -130.2,-290.457 -290.45,-290.457 l -479.96,-0.293 c -5.91,0 -10.6,4.793 -10.6,10.454 V 2537.37 c 0,5.66 4.69,10.45 10.6,10.45 m 308.27,-229.22 c -5.97,0 -10.65,-4.78 -10.65,-10.55 v -729.33 c 0,-5.97 4.68,-10.65 10.65,-10.65 h 43.36 c 58.01,0 105.08,47.16 105.08,105.18 v 540.18 c 0,58 -47.07,105.17 -105.08,105.17 z m 0,-982.29 c -5.97,0 -10.65,-4.69 -10.65,-10.45 V 430.59 c 0,-5.86 4.68,-10.649 10.65,-10.649 h 51.85 c 58.12,0 105.09,47.18 105.09,105.188 v 706.011 c 0,58.19 -46.97,105.17 -105.09,105.17 h -51.85"/>
18
+ </g>
19
+ </g>
20
+ <text style="fill: rgb(1, 1, 1); font-family: Roboto; font-size: 139.2px; font-weight: 500; stroke: rgb(0, 0, 0); white-space: pre;" x="455.182" y="234.25">Designsystem</text>
21
21
  </svg>
package/mvc/scb.svg CHANGED
@@ -1,14 +1,14 @@
1
- <svg
2
- xmlns="http://www.w3.org/2000/svg"
3
- xmlns:xlink="http://www.w3.org/1999/xlink"
4
- aria-hidden="true"
5
- role="img"
6
- width="48"
7
- height="48"
8
- preserveAspectRatio="xMidYMid meet"
9
- viewBox="0 0 1300 1300"
10
- >
11
- <path d="M539.3,128.2c0-19.3-15.7-35-35-35c-19.3,0-35,15.6-35,35v882.1c0,19.4,15.7,35,35,35c19.3,0,35-15.7,35-35V692.4 c0-2.3,1.9-4.2,4.2-4.2h115c2.3,0,4.2,1.9,4.2,4.2v320.7c0,67.7-71,122.5-158.4,122.5c-87.5,0-158.5-54.9-158.5-122.5V122.9 c0-67.6,70.9-122.5,158.5-122.5c87.5,0,158.4,54.9,158.4,122.5v316.6c0,2.3-1.9,4.2-4.2,4.2h-115c-2.3,0-4.2-1.8-4.2-4.2V128.2z" />
12
- <path d="M4.2,228.4c-7.4,51.5-4.8,135.9,6.3,183.3c12.2,51.7,82.3,156.1,113.9,204.6c31.6,48.5,73.8,99.1,73.2,166.6v161.7 c0,19.3-15.7,35-35,35c-19.3,0-34.9-15.7-34.9-35V696.7c0-2.3-1.9-4.2-4.3-4.2H8.4c-2.4,0-4.2,1.9-4.2,4.2v255.2 c0,67.7,70.9,122.5,158.4,122.5c87.5,0,158.5-54.9,158.5-122.5V782.8c-0.5-116-32.2-132.9-73.2-202.4 c-29.4-49.9-101.8-153-113.9-204.6c-11.1-47.4-10.6-102.3-6.3-152.1c0-19.3,15.7-35,34.9-35c19.3,0,35,15.7,35,35V444 c0,2.3,1.9,4.2,4.3,4.2h115c2.4,0,4.2-1.9,4.2-4.2V228.4c0-67.7-70.9-122.5-158.5-122.5C75.1,105.8,4.2,160.7,4.2,228.4" />
13
- <path d="M814.9,600.4c-2.4,0-4.3,1.9-4.3,4.2v358.5c0,2.3,1.9,4.3,4.3,4.3h20.8c23.3,0,42.1-18.9,42.1-42.1V642.6 c0-23.3-18.8-42.1-42.1-42.1H814.9z M814.9,207.1c-2.4,0-4.3,1.9-4.3,4.2v292.1c0,2.4,1.9,4.3,4.3,4.3h17.4 c23.2,0,42.1-18.9,42.1-42.1V249.2c0-23.2-18.9-42.1-42.1-42.1H814.9z M691.5,115.3H868c72.9,0,132,59.1,132,132v185.1 c0,51.9-34,95.7-81,110.7v2.5c46.9,15,81,58.8,81,110.8v282.6c0,64.2-52.1,116.3-116.3,116.3l-192.2,0.1c-2.4,0-4.2-1.9-4.2-4.2 V119.4C687.2,117.2,689.1,115.3,691.5,115.3" />
1
+ <svg
2
+ xmlns="http://www.w3.org/2000/svg"
3
+ xmlns:xlink="http://www.w3.org/1999/xlink"
4
+ aria-hidden="true"
5
+ role="img"
6
+ width="48"
7
+ height="48"
8
+ preserveAspectRatio="xMidYMid meet"
9
+ viewBox="0 0 1300 1300"
10
+ >
11
+ <path d="M539.3,128.2c0-19.3-15.7-35-35-35c-19.3,0-35,15.6-35,35v882.1c0,19.4,15.7,35,35,35c19.3,0,35-15.7,35-35V692.4 c0-2.3,1.9-4.2,4.2-4.2h115c2.3,0,4.2,1.9,4.2,4.2v320.7c0,67.7-71,122.5-158.4,122.5c-87.5,0-158.5-54.9-158.5-122.5V122.9 c0-67.6,70.9-122.5,158.5-122.5c87.5,0,158.4,54.9,158.4,122.5v316.6c0,2.3-1.9,4.2-4.2,4.2h-115c-2.3,0-4.2-1.8-4.2-4.2V128.2z" />
12
+ <path d="M4.2,228.4c-7.4,51.5-4.8,135.9,6.3,183.3c12.2,51.7,82.3,156.1,113.9,204.6c31.6,48.5,73.8,99.1,73.2,166.6v161.7 c0,19.3-15.7,35-35,35c-19.3,0-34.9-15.7-34.9-35V696.7c0-2.3-1.9-4.2-4.3-4.2H8.4c-2.4,0-4.2,1.9-4.2,4.2v255.2 c0,67.7,70.9,122.5,158.4,122.5c87.5,0,158.5-54.9,158.5-122.5V782.8c-0.5-116-32.2-132.9-73.2-202.4 c-29.4-49.9-101.8-153-113.9-204.6c-11.1-47.4-10.6-102.3-6.3-152.1c0-19.3,15.7-35,34.9-35c19.3,0,35,15.7,35,35V444 c0,2.3,1.9,4.2,4.3,4.2h115c2.4,0,4.2-1.9,4.2-4.2V228.4c0-67.7-70.9-122.5-158.5-122.5C75.1,105.8,4.2,160.7,4.2,228.4" />
13
+ <path d="M814.9,600.4c-2.4,0-4.3,1.9-4.3,4.2v358.5c0,2.3,1.9,4.3,4.3,4.3h20.8c23.3,0,42.1-18.9,42.1-42.1V642.6 c0-23.3-18.8-42.1-42.1-42.1H814.9z M814.9,207.1c-2.4,0-4.3,1.9-4.3,4.2v292.1c0,2.4,1.9,4.3,4.3,4.3h17.4 c23.2,0,42.1-18.9,42.1-42.1V249.2c0-23.2-18.9-42.1-42.1-42.1H814.9z M691.5,115.3H868c72.9,0,132,59.1,132,132v185.1 c0,51.9-34,95.7-81,110.7v2.5c46.9,15,81,58.8,81,110.8v282.6c0,64.2-52.1,116.3-116.3,116.3l-192.2,0.1c-2.4,0-4.2-1.9-4.2-4.2 V119.4C687.2,117.2,689.1,115.3,691.5,115.3" />
14
14
  </svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scb-wc",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -417,5 +417,5 @@
417
417
  },
418
418
  "./mvc/*": "./mvc/*"
419
419
  },
420
- "buildHash": "D08CB841707ED2FAA4A02BCADF9305F5ED42A2633E9DC12D7E1B956767B43D75"
420
+ "buildHash": "1C2FD3C82A2A0417188B26F3E64B7998E9020E815A5C1F339CB871DB73CA24A6"
421
421
  }
@@ -45,6 +45,7 @@ export declare class ScbHeader extends LitElement {
45
45
  menuSearchPlaceholder?: string;
46
46
  menuData?: MenuNode[];
47
47
  showDrawer: boolean;
48
+ alwaysShowMenuButton: boolean;
48
49
  showSearch: boolean;
49
50
  includeUtilityInMenu: boolean;
50
51
  drawerOverlay: boolean;
@@ -91,7 +91,7 @@ var u = {
91
91
  toAttribute: (e) => String(!!e)
92
92
  }, d = {
93
93
  fromAttribute: (e) => e == null ? !1 : !/^(false|0|off|no)$/i.test(e),
94
- toAttribute: (e) => String(!!e)
94
+ toAttribute: (e) => e ? "" : null
95
95
  }, f = {
96
96
  fromAttribute: (e) => e === "small" || e === "large" ? e : "medium",
97
97
  toAttribute: (e) => {
@@ -103,7 +103,7 @@ var u = {
103
103
  c = this;
104
104
  }
105
105
  constructor() {
106
- super(), this.maxWidth = "1440px", this.spacing = void 0, this.spacingTop = void 0, this.spacingBottom = void 0, this.size = "medium", this.logoText = "", this.logoHref = "/", this.logoSrc = "", this.logoWidth = "", this.logoHeight = "", this.logoAspectRatio = "", this.logoInvertDm = !1, this.banner = !1, this.tabs = [], this.activeTab = null, this.reserveTabs = !1, this.utilityItems = [], this.showDrawer = !0, this.showSearch = !0, this.includeUtilityInMenu = !1, this.drawerOverlay = !0, this.searchText = "", this._drawerId = "main-drawer", this._menuExpanded = !1, this._searchId = "header-search", this._slotNavItems = [], this._slotUtils = [], this._slotMenu = [], this._measureScheduled = !1, this._scheduleMeasure = () => {
106
+ super(), this.maxWidth = "1440px", this.spacing = void 0, this.spacingTop = void 0, this.spacingBottom = void 0, this.size = "medium", this.logoText = "", this.logoHref = "/", this.logoSrc = "", this.logoWidth = "", this.logoHeight = "", this.logoAspectRatio = "", this.logoInvertDm = !1, this.banner = !1, this.tabs = [], this.activeTab = null, this.reserveTabs = !1, this.utilityItems = [], this.showDrawer = !0, this.alwaysShowMenuButton = !1, this.showSearch = !0, this.includeUtilityInMenu = !1, this.drawerOverlay = !0, this.searchText = "", this._drawerId = "main-drawer", this._menuExpanded = !1, this._searchId = "header-search", this._slotNavItems = [], this._slotUtils = [], this._slotMenu = [], this._measureScheduled = !1, this._scheduleMeasure = () => {
107
107
  this._measureScheduled || (this._measureScheduled = !0, requestAnimationFrame(() => {
108
108
  this._measureScheduled = !1, this._measure();
109
109
  }));
@@ -195,12 +195,12 @@ var u = {
195
195
  this._collapsed ? !o && r >= this._unlockAtWidth && this._setCollapsed(!1) : o && (this._unlockAtWidth = r + this._HYST, this._setCollapsed(!0));
196
196
  let s = !1;
197
197
  if (this.showSearch && n >= this.BP_SM && n < this.BP_MD && this._searchWrap) {
198
- let i = getComputedStyle(this._searchWrap), a = Math.max(this._num(i.minWidth, this._tokenPx("--scb-header-search-min", 320)), this._tokenPx("--scb-header-search-min", 320)), o = this._num(getComputedStyle(e).gap, this._tokenPx("--spacing-7", 24)), c = this.showDrawer && (n < this.BP_MD || this._collapsed) ? this._menuBtn?.getBoundingClientRect().width || this._tokenPx("--icon-size-extra-extra-large", 48) : 0;
198
+ let i = getComputedStyle(this._searchWrap), a = Math.max(this._num(i.minWidth, this._tokenPx("--scb-header-search-min", 320)), this._tokenPx("--scb-header-search-min", 320)), o = this._num(getComputedStyle(e).gap, this._tokenPx("--spacing-7", 24)), c = this.showDrawer && (this.alwaysShowMenuButton || n < this.BP_MD || this._collapsed) ? this._menuBtn?.getBoundingClientRect().width || this._tokenPx("--icon-size-extra-extra-large", 48) : 0;
199
199
  s = t.getBoundingClientRect().width + o + a + o + c + 8 > r + .5;
200
200
  }
201
201
  this._setHideSearch(s);
202
202
  let c = !1;
203
- if (this.showDrawer && (n < this.BP_MD || this._collapsed) && !this._visible(this._util) && !this._visible(this._searchWrap)) {
203
+ if (this.showDrawer && (this.alwaysShowMenuButton || n < this.BP_MD || this._collapsed) && !this._visible(this._util) && !this._visible(this._searchWrap)) {
204
204
  let t = this._num(getComputedStyle(e).gap, this._tokenPx("--spacing-7", 24)), n = this._menuBtn?.getBoundingClientRect().width || this._tokenPx("--icon-size-extra-extra-large", 48), i = (this._logoGroup?.getBoundingClientRect().width || 0) + t + n;
205
205
  this._hideLogoText ? c = !(r >= this._logoTextUnlockAt) : i > r + .5 && (c = !0, this._logoTextUnlockAt = r + this._HYST);
206
206
  } else c = !1, this._logoTextUnlockAt = 0;
@@ -629,6 +629,9 @@ var u = {
629
629
  display: inline-flex;
630
630
  }
631
631
  }
632
+ :host([always-show-menu-button]) .menu-trigger {
633
+ display: inline-flex;
634
+ }
632
635
  :host([data-collapsed]) .menu-trigger {
633
636
  display: inline-flex;
634
637
  }
@@ -898,7 +901,7 @@ var u = {
898
901
  e && (this._ro = new ResizeObserver(() => this._scheduleMeasure()), this._ro.observe(e)), window.addEventListener("resize", this._onWindowResize, { passive: !0 });
899
902
  }
900
903
  updated(e) {
901
- e.has("searchMax") && this.style.setProperty("--scb-header-search-max", this.searchMax ?? "480px"), e.has("searchMin") && this.style.setProperty("--scb-header-search-min", this.searchMin ?? "320px"), e.has("searchHeight") && (this.searchHeight && this.searchHeight.trim() ? this.style.setProperty("--scb-search-height", this.searchHeight.trim()) : this.style.removeProperty("--scb-search-height")), (e.has("logoWidth") || e.has("logoHeight") || e.has("logoAspectRatio")) && this._applyLogoSizing(), (e.has("spacing") || e.has("spacingTop") || e.has("spacingBottom")) && this._applySpacing(), (e.has("utilityItems") || e.has("tabs") || e.has("logoText") || e.has("logoSrc") || e.has("logoWidth") || e.has("logoHeight") || e.has("logoAspectRatio") || e.has("activeTab") || e.has("_slotNavItems") || e.has("_slotUtils") || e.has("_slotMenu") || e.has("showDrawer") || e.has("showSearch") || e.has("searchMax") || e.has("searchMin") || e.has("size")) && this.updateComplete.then(() => {
904
+ e.has("searchMax") && this.style.setProperty("--scb-header-search-max", this.searchMax ?? "480px"), e.has("searchMin") && this.style.setProperty("--scb-header-search-min", this.searchMin ?? "320px"), e.has("searchHeight") && (this.searchHeight && this.searchHeight.trim() ? this.style.setProperty("--scb-search-height", this.searchHeight.trim()) : this.style.removeProperty("--scb-search-height")), (e.has("logoWidth") || e.has("logoHeight") || e.has("logoAspectRatio")) && this._applyLogoSizing(), (e.has("spacing") || e.has("spacingTop") || e.has("spacingBottom")) && this._applySpacing(), (e.has("utilityItems") || e.has("tabs") || e.has("logoText") || e.has("logoSrc") || e.has("logoWidth") || e.has("logoHeight") || e.has("logoAspectRatio") || e.has("activeTab") || e.has("_slotNavItems") || e.has("_slotUtils") || e.has("_slotMenu") || e.has("showDrawer") || e.has("alwaysShowMenuButton") || e.has("showSearch") || e.has("searchMax") || e.has("searchMin") || e.has("size")) && this.updateComplete.then(() => {
902
905
  this._scheduleMeasure();
903
906
  }), (e.has("activeTab") || e.has("_slotNavItems") || e.has("tabs") || e.has("size")) && this.updateComplete.then(() => {
904
907
  this._syncDropdownTabs();
@@ -1335,6 +1338,11 @@ e([o({
1335
1338
  reflect: !0,
1336
1339
  converter: u
1337
1340
  })], p.prototype, "showDrawer", void 0), e([o({
1341
+ type: Boolean,
1342
+ attribute: "always-show-menu-button",
1343
+ reflect: !0,
1344
+ converter: d
1345
+ })], p.prototype, "alwaysShowMenuButton", void 0), e([o({
1338
1346
  type: Boolean,
1339
1347
  attribute: "show-search",
1340
1348
  reflect: !0,
package/scb-wc.bundle.js CHANGED
@@ -8774,7 +8774,7 @@
8774
8774
  );
8775
8775
  }
8776
8776
  }
8777
- `,document.head.appendChild(e);let t=e=>{let t=String(e??``).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t},n=e=>{let t=String(e??``).trim();if(!t)return!1;try{let e=JSON.parse(t);return Array.isArray(e)&&e.length>0}catch{return!1}},r=e=>{for(let t of Array.from(e.children)){let e=t.tagName.toLowerCase();if(e===`scb-header-tab`||e===`scb-dropdown`)return!0}return!1},i=e=>{r(e)||n(e.getAttribute(`tabs`))?e.setAttribute(`data-pre-has-tabs`,``):e.removeAttribute(`data-pre-has-tabs`);let i=t(e.getAttribute(`spacing`)),a=t(e.getAttribute(`spacing-top`))??i,o=t(e.getAttribute(`spacing-bottom`))??i;a?e.style.setProperty(`--scb-header-spacing-block-start`,a):e.style.removeProperty(`--scb-header-spacing-block-start`),o?e.style.setProperty(`--scb-header-spacing-block-end`,o):e.style.removeProperty(`--scb-header-spacing-block-end`);let s=(e.getAttribute(`logo-width`)??``).trim();s?e.style.setProperty(`--scb-header-pre-logo-w`,s):e.style.removeProperty(`--scb-header-pre-logo-w`);let c=(e.getAttribute(`logo-height`)??``).trim();c?e.style.setProperty(`--scb-header-pre-logo-img-h`,c):e.style.removeProperty(`--scb-header-pre-logo-img-h`);let l=(e.getAttribute(`search-height`)??``).trim();l?e.style.setProperty(`--scb-header-pre-control-size`,l):e.style.removeProperty(`--scb-header-pre-control-size`)};document.querySelectorAll(`scb-header`).forEach(i);let a=new MutationObserver(e=>{for(let t of e){if(t.type===`attributes`){let e=t.target;e instanceof HTMLElement&&e.tagName.toLowerCase()===`scb-header`&&i(e);continue}if(t.type===`childList`){let e=[...Array.from(t.addedNodes),...Array.from(t.removedNodes)];for(let t of e){if(!(t instanceof HTMLElement))continue;if(t.tagName.toLowerCase()===`scb-header`){i(t);continue}let e=t.closest?.(`scb-header`);e&&i(e)}}}});a.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`tabs`,`spacing`,`spacing-top`,`spacing-bottom`,`logo-width`,`logo-height`,`logo-aspect-ratio`,`search-height`]}),customElements.whenDefined(`scb-header`).then(()=>{a.disconnect()})})();var lu={fromAttribute:e=>e==null?!0:!/^(false|0|off|no)$/i.test(e),toAttribute:e=>String(!!e)},uu={fromAttribute:e=>e==null?!1:!/^(false|0|off|no)$/i.test(e),toAttribute:e=>String(!!e)},du={fromAttribute:e=>e===`small`||e===`large`?e:`medium`,toAttribute:e=>{let t=String(e??``);return t===`small`||t===`large`?t:null}},Y=class extends S{static{su=this}constructor(){super(),this.maxWidth=`1440px`,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.size=`medium`,this.logoText=``,this.logoHref=`/`,this.logoSrc=``,this.logoWidth=``,this.logoHeight=``,this.logoAspectRatio=``,this.logoInvertDm=!1,this.banner=!1,this.tabs=[],this.activeTab=null,this.reserveTabs=!1,this.utilityItems=[],this.showDrawer=!0,this.showSearch=!0,this.includeUtilityInMenu=!1,this.drawerOverlay=!0,this.searchText=``,this._drawerId=`main-drawer`,this._menuExpanded=!1,this._searchId=`header-search`,this._slotNavItems=[],this._slotUtils=[],this._slotMenu=[],this._measureScheduled=!1,this._scheduleMeasure=()=>{this._measureScheduled||(this._measureScheduled=!0,requestAnimationFrame(()=>{this._measureScheduled=!1,this._measure()}))},this._onWindowResize=()=>{this._scheduleMeasure()},this._onMenuSelect=e=>{let t=e.detail;this.dispatchEvent(new CustomEvent(`scb-menu-select`,{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`scbmenuselect`,{detail:t,bubbles:!0,composed:!0}));let n=t?.item,r=typeof t?.href==`string`?t.href:typeof t?.itemHref==`string`?t.itemHref:typeof t?.item_href==`string`?t.item_href:``,i=n?n.getAttribute(`item-href`)??n.getAttribute(`href`)??``:``;String(r||i||``).trim()&&this._closeDrawerNow()},this._collapsed=!1,this._unlockAtWidth=0,this._hideLogoText=!1,this._logoTextUnlockAt=0,this._slotWatchers=[],this._harvestPending=!1,this._harvest=()=>{let e=Array.from(this.children),t=[],n=[],r=[],i=-1,a=e=>({label:e.getAttribute(`label`)??``,href:e.getAttribute(`href`)??void 0,icon:e.getAttribute(`icon`)??void 0});for(let o of e){let e=o.tagName.toLowerCase();if(e===`scb-header-tab`){let e=o.getAttribute(`label`)??``,n=o.getAttribute(`href`),r=n&&n.trim()!==``?n:void 0;(o.hasAttribute(`selected`)||o.getAttribute(`selected`)===`true`||o.getAttribute(`active`)===`true`||o.getAttribute(`aria-current`)===`page`)&&i===-1&&(i=t.length),t.push({kind:`tab`,label:e,href:r});continue}if(e===`scb-badge`){let e=o.querySelector(`scb-dropdown`);if(e){let n=e.getAttribute(`label`)??``;(e.hasAttribute(`selected`)||e.getAttribute(`selected`)===`true`||e.getAttribute(`active`)===`true`||e.getAttribute(`aria-current`)===`page`)&&i===-1&&(i=t.length);let r=`scb-header-tab-${t.length}`;o.getAttribute(`slot`)!==r&&o.setAttribute(`slot`,r),e.hasAttribute(`slot`)&&e.removeAttribute(`slot`),e.hasAttribute(`as-tab`)||e.setAttribute(`as-tab`,``),t.push({kind:`dropdown`,slotName:r,label:n});continue}}if(e===`scb-dropdown`){let e=o.getAttribute(`label`)??``;(o.hasAttribute(`selected`)||o.getAttribute(`selected`)===`true`||o.getAttribute(`active`)===`true`||o.getAttribute(`aria-current`)===`page`)&&i===-1&&(i=t.length);let n=`scb-header-tab-${t.length}`;o.getAttribute(`slot`)!==n&&o.setAttribute(`slot`,n),o.hasAttribute(`as-tab`)||o.setAttribute(`as-tab`,``),t.push({kind:`dropdown`,slotName:n,label:e});continue}if(e===`scb-header-utility`){n.push({label:o.getAttribute(`label`)??``,href:o.getAttribute(`href`)??`#`,target:o.getAttribute(`target`)??void 0});continue}if(e===`scb-header-menu-group`){let e={label:o.getAttribute(`label`)??``,icon:o.getAttribute(`icon`)??void 0,children:[]};o.querySelectorAll(`scb-header-menu-item`).forEach(t=>e.children.push(a(t))),r.push(e);continue}e===`scb-header-menu-item`&&r.push(a(o))}this._slotNavItems=t,this._slotUtils=n,this._slotMenu=r,!this.hasAttribute(`active-tab`)&&i>=0&&(this.activeTab=i),queueMicrotask(()=>{this.updateComplete.then(()=>{this._scheduleMeasure()})})},this._measure=()=>{let e=this._top,t=this._logoGroup;if(!e||!t)return;let n=window.innerWidth,r=e.clientWidth,i=this._overflows(this._util),a=this._tabsOverflows(),o=n<this.BP_MD||i||a;this._collapsed?!o&&r>=this._unlockAtWidth&&this._setCollapsed(!1):o&&(this._unlockAtWidth=r+this._HYST,this._setCollapsed(!0));let s=!1;if(this.showSearch&&n>=this.BP_SM&&n<this.BP_MD&&this._searchWrap){let i=getComputedStyle(this._searchWrap),a=Math.max(this._num(i.minWidth,this._tokenPx(`--scb-header-search-min`,320)),this._tokenPx(`--scb-header-search-min`,320)),o=this._num(getComputedStyle(e).gap,this._tokenPx(`--spacing-7`,24)),c=this.showDrawer&&(n<this.BP_MD||this._collapsed)?this._menuBtn?.getBoundingClientRect().width||this._tokenPx(`--icon-size-extra-extra-large`,48):0;s=t.getBoundingClientRect().width+o+a+o+c+8>r+.5}this._setHideSearch(s);let c=!1;if(this.showDrawer&&(n<this.BP_MD||this._collapsed)&&!this._visible(this._util)&&!this._visible(this._searchWrap)){let t=this._num(getComputedStyle(e).gap,this._tokenPx(`--spacing-7`,24)),n=this._menuBtn?.getBoundingClientRect().width||this._tokenPx(`--icon-size-extra-extra-large`,48),i=(this._logoGroup?.getBoundingClientRect().width||0)+t+n;this._hideLogoText?c=!(r>=this._logoTextUnlockAt):i>r+.5&&(c=!0,this._logoTextUnlockAt=r+this._HYST)}else c=!1,this._logoTextUnlockAt=0;this._setHideLogoText(c)},this._onDrawerOpened=()=>{this._menuExpanded=!0,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent(`drawer-open`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`draweropen`,{bubbles:!0,composed:!0}))},this._onDrawerClosed=()=>{this._menuExpanded=!1,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent(`drawer-close`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`drawerclose`,{bubbles:!0,composed:!0}))},this._onMenuClick=e=>{this.showDrawer&&(this.dispatchEvent(new CustomEvent(`menu-click`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`menuclick`,{bubbles:!0,composed:!0})))},this._onSearchClick=e=>{let t=this._searchEl;if(t?.submit&&typeof t.submit==`function`){t.submit();return}let n=t?.value??``;this.searchText=n,this.dispatchEvent(new CustomEvent(`search-click`,{detail:{value:n},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`searchclick`,{detail:{value:n},bubbles:!0,composed:!0})),t?.focus?.()},this._onTabClick=e=>{let t=e.currentTarget;if(!t)return;let n=t.tagName.toLowerCase()===`a`;if(n&&(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey))return;let r=t.getAttribute(`data-index`),i=r==null?0:Number(r),a=this._getNavItems()[i];if(a?.kind===`dropdown`)return;this.activeTab=i;let o=a?.kind===`tab`?a.href??``:``,s=new CustomEvent(`tab-change`,{detail:{index:i,href:o},bubbles:!0,composed:!0,cancelable:!0}),c=new CustomEvent(`tabchange`,{detail:{index:i,href:o},bubbles:!0,composed:!0,cancelable:!0});!(this.dispatchEvent(s)&&this.dispatchEvent(c))&&n&&e.preventDefault()},this._onDropdownTabActivate=e=>{let t=e.detail?.dataIndex,n=typeof t==`number`?t:typeof t==`string`?Number(t):this._readTabIndexFromEvent(e);if(n==null||!Number.isFinite(n))return;let r=this._getNavItems();n<0||n>=r.length||r[n]?.kind===`dropdown`&&(this.activeTab=n,this.dispatchEvent(new CustomEvent(`tab-change`,{detail:{index:n,href:``},bubbles:!0,composed:!0,cancelable:!0})),this.dispatchEvent(new CustomEvent(`tabchange`,{detail:{index:n,href:``},bubbles:!0,composed:!0,cancelable:!0})))},this._onTabsKeydown=e=>{let t=e.key;if(t!==`ArrowLeft`&&t!==`ArrowRight`&&t!==`Home`&&t!==`End`)return;let n=this._getNavItems();if(!n.length)return;let r=this._readTabIndexFromEvent(e);if(r==null)return;let i=Math.max(0,Math.min(n.length-1,r));t===`ArrowRight`?i=(i+1)%n.length:t===`ArrowLeft`?i=(i-1+n.length)%n.length:t===`Home`?i=0:t===`End`&&(i=n.length-1),e.preventDefault(),this._focusTabAtIndex(i)},this._onSearchInput=e=>{this.searchText=e.detail?.value??``,this.dispatchEvent(new CustomEvent(`search-input`,{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`searchinput`,{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`search-text-change`,{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`searchtextchange`,{detail:{value:this.searchText},bubbles:!0,composed:!0}))},this._onSearchSubmit=e=>{this.searchText=e.detail?.value??``,this.dispatchEvent(new CustomEvent(`search-change`,{detail:{value:this.searchText,active:e.detail?.active},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`searchchange`,{detail:{value:this.searchText,active:e.detail?.active},bubbles:!0,composed:!0}))},this._onSearchClear=()=>{this.searchText=``,this.dispatchEvent(new CustomEvent(`search-text-change`,{detail:{value:``},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`searchtextchange`,{detail:{value:``},bubbles:!0,composed:!0}))};let e=++cu;this._drawerId=`scb-header-drawer-${e}`,this._searchId=`scb-header-search-${e}`}static{this._JSON_ARRAY={fromAttribute:e=>{if(e==null||e===``)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}},toAttribute:e=>e==null?null:JSON.stringify(e)}}static{this.BP_SM_DEFAULT=600}static{this.BP_MD_DEFAULT=840}get _HYST(){return this._tokenPx(`--spacing-11`,64)}get BP_SM(){return this._tokenPx(`--bp-sm`,su.BP_SM_DEFAULT)}get BP_MD(){return this._tokenPx(`--bp-md`,su.BP_MD_DEFAULT)}_scheduleHarvest(){this._harvestPending||(this._harvestPending=!0,queueMicrotask(()=>{this._harvestPending=!1,this._harvest()}))}static{this.styles=p`
8777
+ `,document.head.appendChild(e);let t=e=>{let t=String(e??``).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t},n=e=>{let t=String(e??``).trim();if(!t)return!1;try{let e=JSON.parse(t);return Array.isArray(e)&&e.length>0}catch{return!1}},r=e=>{for(let t of Array.from(e.children)){let e=t.tagName.toLowerCase();if(e===`scb-header-tab`||e===`scb-dropdown`)return!0}return!1},i=e=>{r(e)||n(e.getAttribute(`tabs`))?e.setAttribute(`data-pre-has-tabs`,``):e.removeAttribute(`data-pre-has-tabs`);let i=t(e.getAttribute(`spacing`)),a=t(e.getAttribute(`spacing-top`))??i,o=t(e.getAttribute(`spacing-bottom`))??i;a?e.style.setProperty(`--scb-header-spacing-block-start`,a):e.style.removeProperty(`--scb-header-spacing-block-start`),o?e.style.setProperty(`--scb-header-spacing-block-end`,o):e.style.removeProperty(`--scb-header-spacing-block-end`);let s=(e.getAttribute(`logo-width`)??``).trim();s?e.style.setProperty(`--scb-header-pre-logo-w`,s):e.style.removeProperty(`--scb-header-pre-logo-w`);let c=(e.getAttribute(`logo-height`)??``).trim();c?e.style.setProperty(`--scb-header-pre-logo-img-h`,c):e.style.removeProperty(`--scb-header-pre-logo-img-h`);let l=(e.getAttribute(`search-height`)??``).trim();l?e.style.setProperty(`--scb-header-pre-control-size`,l):e.style.removeProperty(`--scb-header-pre-control-size`)};document.querySelectorAll(`scb-header`).forEach(i);let a=new MutationObserver(e=>{for(let t of e){if(t.type===`attributes`){let e=t.target;e instanceof HTMLElement&&e.tagName.toLowerCase()===`scb-header`&&i(e);continue}if(t.type===`childList`){let e=[...Array.from(t.addedNodes),...Array.from(t.removedNodes)];for(let t of e){if(!(t instanceof HTMLElement))continue;if(t.tagName.toLowerCase()===`scb-header`){i(t);continue}let e=t.closest?.(`scb-header`);e&&i(e)}}}});a.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`tabs`,`spacing`,`spacing-top`,`spacing-bottom`,`logo-width`,`logo-height`,`logo-aspect-ratio`,`search-height`]}),customElements.whenDefined(`scb-header`).then(()=>{a.disconnect()})})();var lu={fromAttribute:e=>e==null?!0:!/^(false|0|off|no)$/i.test(e),toAttribute:e=>String(!!e)},uu={fromAttribute:e=>e==null?!1:!/^(false|0|off|no)$/i.test(e),toAttribute:e=>e?``:null},du={fromAttribute:e=>e===`small`||e===`large`?e:`medium`,toAttribute:e=>{let t=String(e??``);return t===`small`||t===`large`?t:null}},Y=class extends S{static{su=this}constructor(){super(),this.maxWidth=`1440px`,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.size=`medium`,this.logoText=``,this.logoHref=`/`,this.logoSrc=``,this.logoWidth=``,this.logoHeight=``,this.logoAspectRatio=``,this.logoInvertDm=!1,this.banner=!1,this.tabs=[],this.activeTab=null,this.reserveTabs=!1,this.utilityItems=[],this.showDrawer=!0,this.alwaysShowMenuButton=!1,this.showSearch=!0,this.includeUtilityInMenu=!1,this.drawerOverlay=!0,this.searchText=``,this._drawerId=`main-drawer`,this._menuExpanded=!1,this._searchId=`header-search`,this._slotNavItems=[],this._slotUtils=[],this._slotMenu=[],this._measureScheduled=!1,this._scheduleMeasure=()=>{this._measureScheduled||(this._measureScheduled=!0,requestAnimationFrame(()=>{this._measureScheduled=!1,this._measure()}))},this._onWindowResize=()=>{this._scheduleMeasure()},this._onMenuSelect=e=>{let t=e.detail;this.dispatchEvent(new CustomEvent(`scb-menu-select`,{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`scbmenuselect`,{detail:t,bubbles:!0,composed:!0}));let n=t?.item,r=typeof t?.href==`string`?t.href:typeof t?.itemHref==`string`?t.itemHref:typeof t?.item_href==`string`?t.item_href:``,i=n?n.getAttribute(`item-href`)??n.getAttribute(`href`)??``:``;String(r||i||``).trim()&&this._closeDrawerNow()},this._collapsed=!1,this._unlockAtWidth=0,this._hideLogoText=!1,this._logoTextUnlockAt=0,this._slotWatchers=[],this._harvestPending=!1,this._harvest=()=>{let e=Array.from(this.children),t=[],n=[],r=[],i=-1,a=e=>({label:e.getAttribute(`label`)??``,href:e.getAttribute(`href`)??void 0,icon:e.getAttribute(`icon`)??void 0});for(let o of e){let e=o.tagName.toLowerCase();if(e===`scb-header-tab`){let e=o.getAttribute(`label`)??``,n=o.getAttribute(`href`),r=n&&n.trim()!==``?n:void 0;(o.hasAttribute(`selected`)||o.getAttribute(`selected`)===`true`||o.getAttribute(`active`)===`true`||o.getAttribute(`aria-current`)===`page`)&&i===-1&&(i=t.length),t.push({kind:`tab`,label:e,href:r});continue}if(e===`scb-badge`){let e=o.querySelector(`scb-dropdown`);if(e){let n=e.getAttribute(`label`)??``;(e.hasAttribute(`selected`)||e.getAttribute(`selected`)===`true`||e.getAttribute(`active`)===`true`||e.getAttribute(`aria-current`)===`page`)&&i===-1&&(i=t.length);let r=`scb-header-tab-${t.length}`;o.getAttribute(`slot`)!==r&&o.setAttribute(`slot`,r),e.hasAttribute(`slot`)&&e.removeAttribute(`slot`),e.hasAttribute(`as-tab`)||e.setAttribute(`as-tab`,``),t.push({kind:`dropdown`,slotName:r,label:n});continue}}if(e===`scb-dropdown`){let e=o.getAttribute(`label`)??``;(o.hasAttribute(`selected`)||o.getAttribute(`selected`)===`true`||o.getAttribute(`active`)===`true`||o.getAttribute(`aria-current`)===`page`)&&i===-1&&(i=t.length);let n=`scb-header-tab-${t.length}`;o.getAttribute(`slot`)!==n&&o.setAttribute(`slot`,n),o.hasAttribute(`as-tab`)||o.setAttribute(`as-tab`,``),t.push({kind:`dropdown`,slotName:n,label:e});continue}if(e===`scb-header-utility`){n.push({label:o.getAttribute(`label`)??``,href:o.getAttribute(`href`)??`#`,target:o.getAttribute(`target`)??void 0});continue}if(e===`scb-header-menu-group`){let e={label:o.getAttribute(`label`)??``,icon:o.getAttribute(`icon`)??void 0,children:[]};o.querySelectorAll(`scb-header-menu-item`).forEach(t=>e.children.push(a(t))),r.push(e);continue}e===`scb-header-menu-item`&&r.push(a(o))}this._slotNavItems=t,this._slotUtils=n,this._slotMenu=r,!this.hasAttribute(`active-tab`)&&i>=0&&(this.activeTab=i),queueMicrotask(()=>{this.updateComplete.then(()=>{this._scheduleMeasure()})})},this._measure=()=>{let e=this._top,t=this._logoGroup;if(!e||!t)return;let n=window.innerWidth,r=e.clientWidth,i=this._overflows(this._util),a=this._tabsOverflows(),o=n<this.BP_MD||i||a;this._collapsed?!o&&r>=this._unlockAtWidth&&this._setCollapsed(!1):o&&(this._unlockAtWidth=r+this._HYST,this._setCollapsed(!0));let s=!1;if(this.showSearch&&n>=this.BP_SM&&n<this.BP_MD&&this._searchWrap){let i=getComputedStyle(this._searchWrap),a=Math.max(this._num(i.minWidth,this._tokenPx(`--scb-header-search-min`,320)),this._tokenPx(`--scb-header-search-min`,320)),o=this._num(getComputedStyle(e).gap,this._tokenPx(`--spacing-7`,24)),c=this.showDrawer&&(this.alwaysShowMenuButton||n<this.BP_MD||this._collapsed)?this._menuBtn?.getBoundingClientRect().width||this._tokenPx(`--icon-size-extra-extra-large`,48):0;s=t.getBoundingClientRect().width+o+a+o+c+8>r+.5}this._setHideSearch(s);let c=!1;if(this.showDrawer&&(this.alwaysShowMenuButton||n<this.BP_MD||this._collapsed)&&!this._visible(this._util)&&!this._visible(this._searchWrap)){let t=this._num(getComputedStyle(e).gap,this._tokenPx(`--spacing-7`,24)),n=this._menuBtn?.getBoundingClientRect().width||this._tokenPx(`--icon-size-extra-extra-large`,48),i=(this._logoGroup?.getBoundingClientRect().width||0)+t+n;this._hideLogoText?c=!(r>=this._logoTextUnlockAt):i>r+.5&&(c=!0,this._logoTextUnlockAt=r+this._HYST)}else c=!1,this._logoTextUnlockAt=0;this._setHideLogoText(c)},this._onDrawerOpened=()=>{this._menuExpanded=!0,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent(`drawer-open`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`draweropen`,{bubbles:!0,composed:!0}))},this._onDrawerClosed=()=>{this._menuExpanded=!1,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent(`drawer-close`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`drawerclose`,{bubbles:!0,composed:!0}))},this._onMenuClick=e=>{this.showDrawer&&(this.dispatchEvent(new CustomEvent(`menu-click`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`menuclick`,{bubbles:!0,composed:!0})))},this._onSearchClick=e=>{let t=this._searchEl;if(t?.submit&&typeof t.submit==`function`){t.submit();return}let n=t?.value??``;this.searchText=n,this.dispatchEvent(new CustomEvent(`search-click`,{detail:{value:n},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`searchclick`,{detail:{value:n},bubbles:!0,composed:!0})),t?.focus?.()},this._onTabClick=e=>{let t=e.currentTarget;if(!t)return;let n=t.tagName.toLowerCase()===`a`;if(n&&(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey))return;let r=t.getAttribute(`data-index`),i=r==null?0:Number(r),a=this._getNavItems()[i];if(a?.kind===`dropdown`)return;this.activeTab=i;let o=a?.kind===`tab`?a.href??``:``,s=new CustomEvent(`tab-change`,{detail:{index:i,href:o},bubbles:!0,composed:!0,cancelable:!0}),c=new CustomEvent(`tabchange`,{detail:{index:i,href:o},bubbles:!0,composed:!0,cancelable:!0});!(this.dispatchEvent(s)&&this.dispatchEvent(c))&&n&&e.preventDefault()},this._onDropdownTabActivate=e=>{let t=e.detail?.dataIndex,n=typeof t==`number`?t:typeof t==`string`?Number(t):this._readTabIndexFromEvent(e);if(n==null||!Number.isFinite(n))return;let r=this._getNavItems();n<0||n>=r.length||r[n]?.kind===`dropdown`&&(this.activeTab=n,this.dispatchEvent(new CustomEvent(`tab-change`,{detail:{index:n,href:``},bubbles:!0,composed:!0,cancelable:!0})),this.dispatchEvent(new CustomEvent(`tabchange`,{detail:{index:n,href:``},bubbles:!0,composed:!0,cancelable:!0})))},this._onTabsKeydown=e=>{let t=e.key;if(t!==`ArrowLeft`&&t!==`ArrowRight`&&t!==`Home`&&t!==`End`)return;let n=this._getNavItems();if(!n.length)return;let r=this._readTabIndexFromEvent(e);if(r==null)return;let i=Math.max(0,Math.min(n.length-1,r));t===`ArrowRight`?i=(i+1)%n.length:t===`ArrowLeft`?i=(i-1+n.length)%n.length:t===`Home`?i=0:t===`End`&&(i=n.length-1),e.preventDefault(),this._focusTabAtIndex(i)},this._onSearchInput=e=>{this.searchText=e.detail?.value??``,this.dispatchEvent(new CustomEvent(`search-input`,{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`searchinput`,{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`search-text-change`,{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`searchtextchange`,{detail:{value:this.searchText},bubbles:!0,composed:!0}))},this._onSearchSubmit=e=>{this.searchText=e.detail?.value??``,this.dispatchEvent(new CustomEvent(`search-change`,{detail:{value:this.searchText,active:e.detail?.active},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`searchchange`,{detail:{value:this.searchText,active:e.detail?.active},bubbles:!0,composed:!0}))},this._onSearchClear=()=>{this.searchText=``,this.dispatchEvent(new CustomEvent(`search-text-change`,{detail:{value:``},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`searchtextchange`,{detail:{value:``},bubbles:!0,composed:!0}))};let e=++cu;this._drawerId=`scb-header-drawer-${e}`,this._searchId=`scb-header-search-${e}`}static{this._JSON_ARRAY={fromAttribute:e=>{if(e==null||e===``)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}},toAttribute:e=>e==null?null:JSON.stringify(e)}}static{this.BP_SM_DEFAULT=600}static{this.BP_MD_DEFAULT=840}get _HYST(){return this._tokenPx(`--spacing-11`,64)}get BP_SM(){return this._tokenPx(`--bp-sm`,su.BP_SM_DEFAULT)}get BP_MD(){return this._tokenPx(`--bp-md`,su.BP_MD_DEFAULT)}_scheduleHarvest(){this._harvestPending||(this._harvestPending=!0,queueMicrotask(()=>{this._harvestPending=!1,this._harvest()}))}static{this.styles=p`
8778
8778
  :host {
8779
8779
  display: block;
8780
8780
  margin-block-start: var(--scb-header-spacing-block-start, 0);
@@ -9019,6 +9019,9 @@
9019
9019
  display: inline-flex;
9020
9020
  }
9021
9021
  }
9022
+ :host([always-show-menu-button]) .menu-trigger {
9023
+ display: inline-flex;
9024
+ }
9022
9025
  :host([data-collapsed]) .menu-trigger {
9023
9026
  display: inline-flex;
9024
9027
  }
@@ -9170,7 +9173,7 @@
9170
9173
  :host([data-hide-logo-text]) .logo-text {
9171
9174
  display: none;
9172
9175
  }
9173
- `}get _top(){return this.renderRoot.querySelector(`.top-row`)}get _util(){return this.renderRoot.querySelector(`.utility`)}get _logoGroup(){return this.renderRoot.querySelector(`.logo-wrap`)||this.renderRoot.querySelector(`.logo-group`)}get _searchWrap(){return this.renderRoot.querySelector(`.search`)}get _menuBtn(){return this.renderRoot.querySelector(`.menu-trigger`)}get _searchEl(){return this.renderRoot.querySelector(`#${this._searchId}`)}get _tabsNav(){return this.renderRoot.querySelector(`.tabs-nav`)}_attachSlotObservers(){this._slotMo?.disconnect(),this._slotWatchers.forEach(e=>e.disconnect()),this._slotWatchers=[];let e=[`label`,`href`,`icon`,`target`,`selected`,`aria-current`,`active`],t=t=>{let n=new MutationObserver(e=>{this._scheduleHarvest()});this._slotWatchers.push(n),n.observe(t,{attributes:!0,attributeFilter:e})},n=()=>{this._slotWatchers.forEach(e=>e.disconnect()),this._slotWatchers=[];let e=Array.from(this.children);for(let r of e){let e=r.tagName.toLowerCase();if((e===`scb-header-tab`||e===`scb-dropdown`||e===`scb-header-utility`||e===`scb-header-menu-item`||e===`scb-header-menu-group`||e===`scb-badge`)&&t(r),e===`scb-badge`){let e=r,i=new MutationObserver(e=>{n(),this._scheduleHarvest()});this._slotWatchers.push(i),i.observe(e,{childList:!0});let a=e.querySelector(`scb-dropdown`);a&&t(a);continue}if(e===`scb-header-menu-group`){let e=r,i=new MutationObserver(e=>{n(),this._scheduleHarvest()});this._slotWatchers.push(i),i.observe(e,{childList:!0,subtree:!0}),e.querySelectorAll(`scb-header-menu-item`).forEach(e=>t(e))}}},r=new MutationObserver(e=>{let t=!1;for(let n of e)if(n.type===`childList`){t=!0;break}t&&n(),this._scheduleHarvest()});this._slotMo=r,r.observe(this,{childList:!0}),n()}_setCollapsed(e){this._collapsed!==e&&(this._collapsed=e,e?this.setAttribute(`data-collapsed`,``):this.removeAttribute(`data-collapsed`))}_setHideSearch(e){e?this.setAttribute(`data-hide-search`,``):this.removeAttribute(`data-hide-search`)}_setHideLogoText(e){this._hideLogoText!==e&&(this._hideLogoText=e,e?this.setAttribute(`data-hide-logo-text`,``):this.removeAttribute(`data-hide-logo-text`))}_num(e,t){let n=Number.parseFloat(String(e??``).trim());return Number.isFinite(n)?n:t}_tokenPx(e,t){let n=getComputedStyle(this);return this._num(n.getPropertyValue(e),t)}_visible(e){return e?getComputedStyle(e).display!==`none`:!1}_overflows(e){return!e||!this._visible(e)?!1:e.scrollWidth>e.clientWidth+1}_tabsOverflows(){let e=this._tabsNav;if(!e||!this._visible(e))return!1;let t=Array.from(e.querySelectorAll(`.tab-wrap`));if(t.length===0)return!1;let n=e.getBoundingClientRect(),r=n.left;for(let e of t){let t=e.getBoundingClientRect();t.width<=0||t.right>r&&(r=t.right)}return r-n.left>n.width+1}firstUpdated(){this.updateComplete.then(()=>{this._harvest(),this._attachSlotObservers(),this._syncDropdownTabs()});let e=this._top;e&&(this._ro=new ResizeObserver(()=>this._scheduleMeasure()),this._ro.observe(e)),window.addEventListener(`resize`,this._onWindowResize,{passive:!0})}updated(e){e.has(`searchMax`)&&this.style.setProperty(`--scb-header-search-max`,this.searchMax??`480px`),e.has(`searchMin`)&&this.style.setProperty(`--scb-header-search-min`,this.searchMin??`320px`),e.has(`searchHeight`)&&(this.searchHeight&&this.searchHeight.trim()?this.style.setProperty(`--scb-search-height`,this.searchHeight.trim()):this.style.removeProperty(`--scb-search-height`)),(e.has(`logoWidth`)||e.has(`logoHeight`)||e.has(`logoAspectRatio`))&&this._applyLogoSizing(),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`))&&this._applySpacing(),(e.has(`utilityItems`)||e.has(`tabs`)||e.has(`logoText`)||e.has(`logoSrc`)||e.has(`logoWidth`)||e.has(`logoHeight`)||e.has(`logoAspectRatio`)||e.has(`activeTab`)||e.has(`_slotNavItems`)||e.has(`_slotUtils`)||e.has(`_slotMenu`)||e.has(`showDrawer`)||e.has(`showSearch`)||e.has(`searchMax`)||e.has(`searchMin`)||e.has(`size`))&&this.updateComplete.then(()=>{this._scheduleMeasure()}),(e.has(`activeTab`)||e.has(`_slotNavItems`)||e.has(`tabs`)||e.has(`size`))&&this.updateComplete.then(()=>{this._syncDropdownTabs()})}disconnectedCallback(){this._ro?.disconnect(),this._slotMo?.disconnect(),this._slotWatchers.forEach(e=>e.disconnect()),this._slotWatchers=[],window.removeEventListener(`resize`,this._onWindowResize),super.disconnectedCallback()}_mapSpacingToken(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}_applySpacing(){let e=this._mapSpacingToken(this.spacing),t=this._mapSpacingToken(this.spacingTop)??e,n=this._mapSpacingToken(this.spacingBottom)??e;t?this.style.setProperty(`--scb-header-spacing-block-start`,t):this.style.removeProperty(`--scb-header-spacing-block-start`),n?this.style.setProperty(`--scb-header-spacing-block-end`,n):this.style.removeProperty(`--scb-header-spacing-block-end`)}_applyLogoSizing(){let e=(this.logoWidth??``).trim(),t=(this.logoHeight??``).trim(),n=(this.logoAspectRatio??``).trim();e?this.style.setProperty(`--scb-header-logo-img-w`,e):this.style.removeProperty(`--scb-header-logo-img-w`),t?this.style.setProperty(`--scb-header-logo-img-h`,t):e?this.style.setProperty(`--scb-header-logo-img-h`,`auto`):this.style.removeProperty(`--scb-header-logo-img-h`),n?this.style.setProperty(`--scb-header-logo-img-aspect-ratio`,n):this.style.removeProperty(`--scb-header-logo-img-aspect-ratio`)}_closeDrawerNow(){let e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!1)}_syncMenuBtnAria(){let e=this.renderRoot.querySelector(`.menu-trigger`);e&&e.setAttribute(`aria-expanded`,String(this._menuExpanded))}_getNavItems(){return this._slotNavItems.length?this._slotNavItems:(this.tabs??[]).map(e=>({kind:`tab`,...e}))}_getDropdownForSlot(e){let t=this.querySelector(`[slot="${e}"]`);return t?t.tagName.toLowerCase()===`scb-dropdown`?t:t.querySelector(`scb-dropdown`):null}_syncDropdownTabs(){this._getNavItems().forEach((e,t)=>{if(e.kind!==`dropdown`)return;let n=this._getDropdownForSlot(e.slotName);if(!n)return;let r=String(t);n.getAttribute(`data-index`)!==r&&n.setAttribute(`data-index`,r),n.hasAttribute(`as-tab`)||n.setAttribute(`as-tab`,``);let i=this.size,a=n;a?.size!==i&&(a.size=i),t===this.activeTab?n.getAttribute(`aria-current`)!==`page`&&n.setAttribute(`aria-current`,`page`):n.hasAttribute(`aria-current`)&&n.removeAttribute(`aria-current`)})}_readTabIndexFromEvent(e){let t=e.composedPath?e.composedPath():[];for(let e of t){if(!(e instanceof HTMLElement))continue;let t=e.getAttribute(`data-index`);if(t==null)continue;let n=Number(t);if(Number.isFinite(n))return n}return null}_focusTabAtIndex(e){let t=this._getNavItems()[e];if(t){if(t.kind===`dropdown`){this._getDropdownForSlot(t.slotName)?.focus?.();return}this.renderRoot.querySelector(`.tab-link[data-index="${e}"]`)?.focus?.()}}_renderMenuNodes(e){return!e||e.length===0?b``:b`${e.map(e=>this._renderMenuNode(e))}`}_renderMenuNode(e){let t=Array.isArray(e.children)&&e.children.length>0,n=(e.href??``).trim(),r=(e.icon??``).trim();return b`
9176
+ `}get _top(){return this.renderRoot.querySelector(`.top-row`)}get _util(){return this.renderRoot.querySelector(`.utility`)}get _logoGroup(){return this.renderRoot.querySelector(`.logo-wrap`)||this.renderRoot.querySelector(`.logo-group`)}get _searchWrap(){return this.renderRoot.querySelector(`.search`)}get _menuBtn(){return this.renderRoot.querySelector(`.menu-trigger`)}get _searchEl(){return this.renderRoot.querySelector(`#${this._searchId}`)}get _tabsNav(){return this.renderRoot.querySelector(`.tabs-nav`)}_attachSlotObservers(){this._slotMo?.disconnect(),this._slotWatchers.forEach(e=>e.disconnect()),this._slotWatchers=[];let e=[`label`,`href`,`icon`,`target`,`selected`,`aria-current`,`active`],t=t=>{let n=new MutationObserver(e=>{this._scheduleHarvest()});this._slotWatchers.push(n),n.observe(t,{attributes:!0,attributeFilter:e})},n=()=>{this._slotWatchers.forEach(e=>e.disconnect()),this._slotWatchers=[];let e=Array.from(this.children);for(let r of e){let e=r.tagName.toLowerCase();if((e===`scb-header-tab`||e===`scb-dropdown`||e===`scb-header-utility`||e===`scb-header-menu-item`||e===`scb-header-menu-group`||e===`scb-badge`)&&t(r),e===`scb-badge`){let e=r,i=new MutationObserver(e=>{n(),this._scheduleHarvest()});this._slotWatchers.push(i),i.observe(e,{childList:!0});let a=e.querySelector(`scb-dropdown`);a&&t(a);continue}if(e===`scb-header-menu-group`){let e=r,i=new MutationObserver(e=>{n(),this._scheduleHarvest()});this._slotWatchers.push(i),i.observe(e,{childList:!0,subtree:!0}),e.querySelectorAll(`scb-header-menu-item`).forEach(e=>t(e))}}},r=new MutationObserver(e=>{let t=!1;for(let n of e)if(n.type===`childList`){t=!0;break}t&&n(),this._scheduleHarvest()});this._slotMo=r,r.observe(this,{childList:!0}),n()}_setCollapsed(e){this._collapsed!==e&&(this._collapsed=e,e?this.setAttribute(`data-collapsed`,``):this.removeAttribute(`data-collapsed`))}_setHideSearch(e){e?this.setAttribute(`data-hide-search`,``):this.removeAttribute(`data-hide-search`)}_setHideLogoText(e){this._hideLogoText!==e&&(this._hideLogoText=e,e?this.setAttribute(`data-hide-logo-text`,``):this.removeAttribute(`data-hide-logo-text`))}_num(e,t){let n=Number.parseFloat(String(e??``).trim());return Number.isFinite(n)?n:t}_tokenPx(e,t){let n=getComputedStyle(this);return this._num(n.getPropertyValue(e),t)}_visible(e){return e?getComputedStyle(e).display!==`none`:!1}_overflows(e){return!e||!this._visible(e)?!1:e.scrollWidth>e.clientWidth+1}_tabsOverflows(){let e=this._tabsNav;if(!e||!this._visible(e))return!1;let t=Array.from(e.querySelectorAll(`.tab-wrap`));if(t.length===0)return!1;let n=e.getBoundingClientRect(),r=n.left;for(let e of t){let t=e.getBoundingClientRect();t.width<=0||t.right>r&&(r=t.right)}return r-n.left>n.width+1}firstUpdated(){this.updateComplete.then(()=>{this._harvest(),this._attachSlotObservers(),this._syncDropdownTabs()});let e=this._top;e&&(this._ro=new ResizeObserver(()=>this._scheduleMeasure()),this._ro.observe(e)),window.addEventListener(`resize`,this._onWindowResize,{passive:!0})}updated(e){e.has(`searchMax`)&&this.style.setProperty(`--scb-header-search-max`,this.searchMax??`480px`),e.has(`searchMin`)&&this.style.setProperty(`--scb-header-search-min`,this.searchMin??`320px`),e.has(`searchHeight`)&&(this.searchHeight&&this.searchHeight.trim()?this.style.setProperty(`--scb-search-height`,this.searchHeight.trim()):this.style.removeProperty(`--scb-search-height`)),(e.has(`logoWidth`)||e.has(`logoHeight`)||e.has(`logoAspectRatio`))&&this._applyLogoSizing(),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`))&&this._applySpacing(),(e.has(`utilityItems`)||e.has(`tabs`)||e.has(`logoText`)||e.has(`logoSrc`)||e.has(`logoWidth`)||e.has(`logoHeight`)||e.has(`logoAspectRatio`)||e.has(`activeTab`)||e.has(`_slotNavItems`)||e.has(`_slotUtils`)||e.has(`_slotMenu`)||e.has(`showDrawer`)||e.has(`alwaysShowMenuButton`)||e.has(`showSearch`)||e.has(`searchMax`)||e.has(`searchMin`)||e.has(`size`))&&this.updateComplete.then(()=>{this._scheduleMeasure()}),(e.has(`activeTab`)||e.has(`_slotNavItems`)||e.has(`tabs`)||e.has(`size`))&&this.updateComplete.then(()=>{this._syncDropdownTabs()})}disconnectedCallback(){this._ro?.disconnect(),this._slotMo?.disconnect(),this._slotWatchers.forEach(e=>e.disconnect()),this._slotWatchers=[],window.removeEventListener(`resize`,this._onWindowResize),super.disconnectedCallback()}_mapSpacingToken(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}_applySpacing(){let e=this._mapSpacingToken(this.spacing),t=this._mapSpacingToken(this.spacingTop)??e,n=this._mapSpacingToken(this.spacingBottom)??e;t?this.style.setProperty(`--scb-header-spacing-block-start`,t):this.style.removeProperty(`--scb-header-spacing-block-start`),n?this.style.setProperty(`--scb-header-spacing-block-end`,n):this.style.removeProperty(`--scb-header-spacing-block-end`)}_applyLogoSizing(){let e=(this.logoWidth??``).trim(),t=(this.logoHeight??``).trim(),n=(this.logoAspectRatio??``).trim();e?this.style.setProperty(`--scb-header-logo-img-w`,e):this.style.removeProperty(`--scb-header-logo-img-w`),t?this.style.setProperty(`--scb-header-logo-img-h`,t):e?this.style.setProperty(`--scb-header-logo-img-h`,`auto`):this.style.removeProperty(`--scb-header-logo-img-h`),n?this.style.setProperty(`--scb-header-logo-img-aspect-ratio`,n):this.style.removeProperty(`--scb-header-logo-img-aspect-ratio`)}_closeDrawerNow(){let e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!1)}_syncMenuBtnAria(){let e=this.renderRoot.querySelector(`.menu-trigger`);e&&e.setAttribute(`aria-expanded`,String(this._menuExpanded))}_getNavItems(){return this._slotNavItems.length?this._slotNavItems:(this.tabs??[]).map(e=>({kind:`tab`,...e}))}_getDropdownForSlot(e){let t=this.querySelector(`[slot="${e}"]`);return t?t.tagName.toLowerCase()===`scb-dropdown`?t:t.querySelector(`scb-dropdown`):null}_syncDropdownTabs(){this._getNavItems().forEach((e,t)=>{if(e.kind!==`dropdown`)return;let n=this._getDropdownForSlot(e.slotName);if(!n)return;let r=String(t);n.getAttribute(`data-index`)!==r&&n.setAttribute(`data-index`,r),n.hasAttribute(`as-tab`)||n.setAttribute(`as-tab`,``);let i=this.size,a=n;a?.size!==i&&(a.size=i),t===this.activeTab?n.getAttribute(`aria-current`)!==`page`&&n.setAttribute(`aria-current`,`page`):n.hasAttribute(`aria-current`)&&n.removeAttribute(`aria-current`)})}_readTabIndexFromEvent(e){let t=e.composedPath?e.composedPath():[];for(let e of t){if(!(e instanceof HTMLElement))continue;let t=e.getAttribute(`data-index`);if(t==null)continue;let n=Number(t);if(Number.isFinite(n))return n}return null}_focusTabAtIndex(e){let t=this._getNavItems()[e];if(t){if(t.kind===`dropdown`){this._getDropdownForSlot(t.slotName)?.focus?.();return}this.renderRoot.querySelector(`.tab-link[data-index="${e}"]`)?.focus?.()}}_renderMenuNodes(e){return!e||e.length===0?b``:b`${e.map(e=>this._renderMenuNode(e))}`}_renderMenuNode(e){let t=Array.isArray(e.children)&&e.children.length>0,n=(e.href??``).trim(),r=(e.icon??``).trim();return b`
9174
9177
  <scb-menu-item
9175
9178
  label=${e.label}
9176
9179
  ?selected=${!1}
@@ -9409,7 +9412,7 @@
9409
9412
  </clipPath>
9410
9413
  </defs>
9411
9414
  </svg>
9412
- `}};P([g({type:String,attribute:`max-width`})],Y.prototype,`maxWidth`,void 0),P([g({type:String,reflect:!0})],Y.prototype,`spacing`,void 0),P([g({type:String,attribute:`spacing-top`,reflect:!0})],Y.prototype,`spacingTop`,void 0),P([g({type:String,attribute:`spacing-bottom`,reflect:!0})],Y.prototype,`spacingBottom`,void 0),P([g({type:String,reflect:!0,converter:du})],Y.prototype,`size`,void 0),P([g({type:String,attribute:`logo-text`})],Y.prototype,`logoText`,void 0),P([g({type:String,attribute:`logo-href`})],Y.prototype,`logoHref`,void 0),P([g({type:String,attribute:`logo-src`})],Y.prototype,`logoSrc`,void 0),P([g({type:String,attribute:`logo-width`})],Y.prototype,`logoWidth`,void 0),P([g({type:String,attribute:`logo-height`})],Y.prototype,`logoHeight`,void 0),P([g({type:String,attribute:`logo-aspect-ratio`})],Y.prototype,`logoAspectRatio`,void 0),P([g({type:Boolean,attribute:`logo-invert-dm`,reflect:!0,converter:uu})],Y.prototype,`logoInvertDm`,void 0),P([g({type:Boolean,reflect:!0})],Y.prototype,`banner`,void 0),P([g({type:String,attribute:`banner-label`})],Y.prototype,`bannerLabel`,void 0),P([g({type:Array,attribute:`tabs`,converter:Y._JSON_ARRAY})],Y.prototype,`tabs`,void 0),P([g({type:Number,attribute:`active-tab`})],Y.prototype,`activeTab`,void 0),P([g({type:Boolean,attribute:`reserve-tabs`,reflect:!0,converter:uu})],Y.prototype,`reserveTabs`,void 0),P([g({type:Number,attribute:`reserve-tabs-count`})],Y.prototype,`reserveTabsCount`,void 0),P([g({type:String,attribute:`reserve-tabs-widths`})],Y.prototype,`reserveTabsWidths`,void 0),P([g({type:Array,attribute:`utility-items`,converter:Y._JSON_ARRAY})],Y.prototype,`utilityItems`,void 0),P([g({type:String,attribute:`search-placeholder`})],Y.prototype,`searchPlaceholder`,void 0),P([g({type:String,attribute:`menu-label`})],Y.prototype,`menuLabel`,void 0),P([g({type:String,attribute:`menu-sub-label`})],Y.prototype,`menuSubLabel`,void 0),P([g({type:String,attribute:`menu-section-label`})],Y.prototype,`menuSectionLabel`,void 0),P([g({type:String,attribute:`menu-search-placeholder`})],Y.prototype,`menuSearchPlaceholder`,void 0),P([g({type:Array,attribute:`menu-data`,converter:Y._JSON_ARRAY})],Y.prototype,`menuData`,void 0),P([g({type:Boolean,attribute:`show-drawer`,reflect:!0,converter:lu})],Y.prototype,`showDrawer`,void 0),P([g({type:Boolean,attribute:`show-search`,reflect:!0,converter:lu})],Y.prototype,`showSearch`,void 0),P([g({type:Boolean,attribute:`include-utility-in-menu`,reflect:!0,converter:uu})],Y.prototype,`includeUtilityInMenu`,void 0),P([g({type:Boolean,attribute:`drawer-overlay`,reflect:!0,converter:lu})],Y.prototype,`drawerOverlay`,void 0),P([g({type:String,attribute:`search-max`})],Y.prototype,`searchMax`,void 0),P([g({type:String,attribute:`search-min`})],Y.prototype,`searchMin`,void 0),P([g({type:String,attribute:`search-height`})],Y.prototype,`searchHeight`,void 0),P([g({type:String,attribute:`search-text`,reflect:!0})],Y.prototype,`searchText`,void 0),P([_()],Y.prototype,`_drawerId`,void 0),P([_()],Y.prototype,`_menuExpanded`,void 0),P([_()],Y.prototype,`_searchId`,void 0),P([_()],Y.prototype,`_slotNavItems`,void 0),P([_()],Y.prototype,`_slotUtils`,void 0),P([_()],Y.prototype,`_slotMenu`,void 0),P([_()],Y.prototype,`_collapsed`,void 0),P([_()],Y.prototype,`_hideLogoText`,void 0),Y=su=P([a(`scb-header`)],Y),C(),y(),w(),F();var fu,pu={fromAttribute:e=>e??``,toAttribute:e=>typeof e==`string`?e.trim()===``?null:e:null},X=class extends S{static{fu=this}constructor(...e){super(...e),this.keyfigure=0,this.subtitle=``,this.supportingText=``,this.cardHref=``,this.href=``,this.icon=``,this.size=`large`,this.unit=``,this.width=``,this.maxWidth=``,this.height=``,this.maxHeight=``,this.sizing=``,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.__onKeyDown=e=>{let t=this.__effectiveHref;(e.key===`Enter`||e.key===` `)&&t&&(e.preventDefault(),this.__navigate(t,e))},this.__handleHrefNavigation=e=>{let t=this.__effectiveHref;t&&(e.target.closest(`a`)||this.__navigate(t,e))}}static{this.__iconLoaded=!1}static{this.__rippleLoaded=!1}static{this.styles=p`
9415
+ `}};P([g({type:String,attribute:`max-width`})],Y.prototype,`maxWidth`,void 0),P([g({type:String,reflect:!0})],Y.prototype,`spacing`,void 0),P([g({type:String,attribute:`spacing-top`,reflect:!0})],Y.prototype,`spacingTop`,void 0),P([g({type:String,attribute:`spacing-bottom`,reflect:!0})],Y.prototype,`spacingBottom`,void 0),P([g({type:String,reflect:!0,converter:du})],Y.prototype,`size`,void 0),P([g({type:String,attribute:`logo-text`})],Y.prototype,`logoText`,void 0),P([g({type:String,attribute:`logo-href`})],Y.prototype,`logoHref`,void 0),P([g({type:String,attribute:`logo-src`})],Y.prototype,`logoSrc`,void 0),P([g({type:String,attribute:`logo-width`})],Y.prototype,`logoWidth`,void 0),P([g({type:String,attribute:`logo-height`})],Y.prototype,`logoHeight`,void 0),P([g({type:String,attribute:`logo-aspect-ratio`})],Y.prototype,`logoAspectRatio`,void 0),P([g({type:Boolean,attribute:`logo-invert-dm`,reflect:!0,converter:uu})],Y.prototype,`logoInvertDm`,void 0),P([g({type:Boolean,reflect:!0})],Y.prototype,`banner`,void 0),P([g({type:String,attribute:`banner-label`})],Y.prototype,`bannerLabel`,void 0),P([g({type:Array,attribute:`tabs`,converter:Y._JSON_ARRAY})],Y.prototype,`tabs`,void 0),P([g({type:Number,attribute:`active-tab`})],Y.prototype,`activeTab`,void 0),P([g({type:Boolean,attribute:`reserve-tabs`,reflect:!0,converter:uu})],Y.prototype,`reserveTabs`,void 0),P([g({type:Number,attribute:`reserve-tabs-count`})],Y.prototype,`reserveTabsCount`,void 0),P([g({type:String,attribute:`reserve-tabs-widths`})],Y.prototype,`reserveTabsWidths`,void 0),P([g({type:Array,attribute:`utility-items`,converter:Y._JSON_ARRAY})],Y.prototype,`utilityItems`,void 0),P([g({type:String,attribute:`search-placeholder`})],Y.prototype,`searchPlaceholder`,void 0),P([g({type:String,attribute:`menu-label`})],Y.prototype,`menuLabel`,void 0),P([g({type:String,attribute:`menu-sub-label`})],Y.prototype,`menuSubLabel`,void 0),P([g({type:String,attribute:`menu-section-label`})],Y.prototype,`menuSectionLabel`,void 0),P([g({type:String,attribute:`menu-search-placeholder`})],Y.prototype,`menuSearchPlaceholder`,void 0),P([g({type:Array,attribute:`menu-data`,converter:Y._JSON_ARRAY})],Y.prototype,`menuData`,void 0),P([g({type:Boolean,attribute:`show-drawer`,reflect:!0,converter:lu})],Y.prototype,`showDrawer`,void 0),P([g({type:Boolean,attribute:`always-show-menu-button`,reflect:!0,converter:uu})],Y.prototype,`alwaysShowMenuButton`,void 0),P([g({type:Boolean,attribute:`show-search`,reflect:!0,converter:lu})],Y.prototype,`showSearch`,void 0),P([g({type:Boolean,attribute:`include-utility-in-menu`,reflect:!0,converter:uu})],Y.prototype,`includeUtilityInMenu`,void 0),P([g({type:Boolean,attribute:`drawer-overlay`,reflect:!0,converter:lu})],Y.prototype,`drawerOverlay`,void 0),P([g({type:String,attribute:`search-max`})],Y.prototype,`searchMax`,void 0),P([g({type:String,attribute:`search-min`})],Y.prototype,`searchMin`,void 0),P([g({type:String,attribute:`search-height`})],Y.prototype,`searchHeight`,void 0),P([g({type:String,attribute:`search-text`,reflect:!0})],Y.prototype,`searchText`,void 0),P([_()],Y.prototype,`_drawerId`,void 0),P([_()],Y.prototype,`_menuExpanded`,void 0),P([_()],Y.prototype,`_searchId`,void 0),P([_()],Y.prototype,`_slotNavItems`,void 0),P([_()],Y.prototype,`_slotUtils`,void 0),P([_()],Y.prototype,`_slotMenu`,void 0),P([_()],Y.prototype,`_collapsed`,void 0),P([_()],Y.prototype,`_hideLogoText`,void 0),Y=su=P([a(`scb-header`)],Y),C(),y(),w(),F();var fu,pu={fromAttribute:e=>e??``,toAttribute:e=>typeof e==`string`?e.trim()===``?null:e:null},X=class extends S{static{fu=this}constructor(...e){super(...e),this.keyfigure=0,this.subtitle=``,this.supportingText=``,this.cardHref=``,this.href=``,this.icon=``,this.size=`large`,this.unit=``,this.width=``,this.maxWidth=``,this.height=``,this.maxHeight=``,this.sizing=``,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.__onKeyDown=e=>{let t=this.__effectiveHref;(e.key===`Enter`||e.key===` `)&&t&&(e.preventDefault(),this.__navigate(t,e))},this.__handleHrefNavigation=e=>{let t=this.__effectiveHref;t&&(e.target.closest(`a`)||this.__navigate(t,e))}}static{this.__iconLoaded=!1}static{this.__rippleLoaded=!1}static{this.styles=p`
9413
9416
  :host {
9414
9417
  display: block;
9415
9418
  box-sizing: border-box;