PageSourceSearch

https://media.consumeraffairs.com/static/js/ca_sg_header.f30d5ec0f558.js

js consumeraffairs.com collected 2026-09-24 06:23:19 UTC 23,398 bytes, 1 lines download raw bytes

1(()=>{"use strict";(()=>{class e{static get SCROLL_BROADCASTER_EVENT(){return"com.consumeraffairs.styleguide.userScroll"}constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;this._window=e,this.boundariesElms=[],this._window.ScrollThrottledBroadcaster=!0,this._removeCalculatedBoundaries=this._removeCalculatedBoundaries.bind(this),this._scrollHandler=this._scrollHandler.bind(this),this._bindEvents()}register(e){const{boundariesEl:s,callback:t,condition:i="inside",boundary:n="",offsetTop:a=0,offsetBottom:_=0}=e;let o=this.boundariesElms.findIndex(e=>e.boundariesEl===s);o<0&&(this.boundariesElms.push({boundariesEl:s,condition:i,boundary:n,offsetTop:a,offsetBottom:_,isInside:!1,callbacks:[]}),o=this.boundariesElms.length-1),"function"==typeof t&&this.boundariesElms[o].callbacks.push(t)}_bindEvents(){this._window.addEventListener(e.SCROLL_BROADCASTER_EVENT,this._scrollHandler),this._window.addEventListener("resize",this._removeCalculatedBoundaries);new MutationObserver(this._removeCalculatedBoundaries).observe(document.body,{childList:!0,attributes:!0,subtree:!0})}_calculateBoundaries(e){const s=e.getBoundingClientRect();return{top:s.top+this._window.pageYOffset,bottom:s.bottom+this._window.pageYOffset}}_scrollHandler(e){this.boundariesElms.forEach(s=>{s.boundaries=s.boundaries||this._calculateBoundaries(s.boundariesEl);const t=this._getBoundaryCondition(e,s);!s.isInside&&t?(s.isInside=!0,this._publish(s)):s.isInside&&!t&&(s.isInside=!1,this._publish(s))})}_getBoundaryCondition(e,s){const{scrollTop:t}=e.detail,{condition:i,boundary:n,offsetTop:a,offsetBottom:_}=s,{top:o,bottom:r}=s.boundaries,h=o+a,c=r+_,l={inside:t>h&&t<c,above:{top:t<h,bottom:t<c},below:{top:t>h,bottom:t>c}};return"inside"===i?l[i]:l[i][n]}_removeCalculatedBoundaries(){Object.keys(this.boundariesElms).forEach(e=>{this.boundariesElms[e].boundaries=null})}_publish(e){e.callbacks.forEach(s=>{s(e.isInside)})}}const s="down",t="com.consumeraffairs.styleguide.search.loaded",i=".js-srch-wrapper",n="search_interaction",a="com.consumeraffairs.styleguide.loadOnDemand",_={HEADER_SELECTOR:".js-ca-hdr",WRAPPER_SELECTOR:".js-wrpr",VIEW_ALL_SELECTOR:".js-view-all",SEARCH_BUTTON_SELECTOR:".js-ca-hdr-open-srch-btn",CLOSE_BUTTON_SELECTOR:".js-ca-hdr-close-srch-btn",MENU_BUTTON_SELECTOR:".js-ca-hdr-menu-btn",PROFILE_BUTTON_SELECTOR:".js-ca-hdr-prf-btn",PROFILE_WARN_MESSAGES_SELECTOR:".js-prf-wrn",MENU_ITEM_SELECTOR:".js-menu-item",SUBMENU_BUTTON_SELECTOR:".js-submenu-btn",SEARCH_BOX_SELECTOR:".js-srch-box",SEARCH_INPUT_SELECTOR_CLASS:".js-ca-srch__inp",SUBMENU_SELECTOR:".js-sub-menu",DISCLOSURE_SELECTOR:".js-ad-discl",STICKY_CTAS_SELECTOR:".js-sticky-ctas",SEARCH_OVERLAY_SELECTOR:".js-srch-ovrly",OVERLAY_SEARCH_INPUT_SELECTOR:".js-srch-inpt",DESKTOP_SEARCH_BREAKPOINT:1200,ACTIVE_MENU_ITEM_CLASS:"is-active",OPEN_SEARCH_OVERLAY_CLASS:"ca-hdr--open-srch-ovrly",OPEN_SEARCH_CLASS:"ca-hdr--open-srch",HIDE_NAV_ITEM_CLASS:"ca-hdr__nav-item-a--hd",HIDE_SUBMENU_CLASS:"ca-hdr__sub-menu--hd",LEVEL_ONE_MENU_ITEM_CLASSES:{link:"ca-hdr__nav-item-a",level:"ca-hdr__nav-item-a--lvl-1",button:"ca-hdr__nav-item-btn",shadow:"ca-hdr__nav-item-a-shdw"},LEVEL_ONE_MENU_ITEM_CLASS:"ca-hdr__nav-item--lvl-1",LOAD_SEARCH_CLASS:"ca-hdr--load-srch",OPEN_DROPDOWN_MENU_CLASS:"js-menu-open",OPEN_HEADER_CLASS:"ca-hdr--open",OPEN_PROFILE_CLASS:"ca-hdr--open-prf",OPEN_SUBMENU_CLASS:"ca-hdr--open-submn",HEADER_SCROLL_CLASS:"js-header-scrolling-down",STICKY_CTA_CLASS:"sticky-hdr--scroll-in-cnt",TOGGLE_SCROLL_DESCRIPTION_CLASS:"sticky-hdr--description",ACTIVE_MENU_ITEM_DESKTOP_CLASS:"ca-hdr__nav-item-prt--active",USERDB_ELEMENT_NAMES:{accountDropdown:"header_dropdown"},DROPDOWN_ELEMENTS:{account:"profile",submenu:"submenu"},SEARCH_EVENTS:{CLOSE:"com.consumeraffairs.frontend.header.search.close",INNER_CLOSE:"com.consumeraffairs.frontend.header.search.innerClose",OPEN:"com.consumeraffairs.frontend.header.search.open"},UAPI_CUSTOM_EVENT:"com.consumeraffairs.uapi",DISCLOSURE_EVENTS:{SHOW:"com.consumeraffairs.styleguide.showDisclosure",HIDE:"com.consumeraffairs.styleguide.hideDisclosure"},MENU_EVENTS:{CLOSE_MENU:"com.consumeraffairs.styleguide.closeMenu",MENU_HANDLER:"com.consumeraffairs.styleguide.menuHandler",TOGGLE_WRAPPER_FOOTER:"com.consumeraffairs.styleguide.toggleWrapperFooter"},SCROLL_EVENTS:{USER_SCROLL:"com.consumeraffairs.styleguide.userScroll",LOCK_SCROLL:"com.consumeraffairs.styleguide.lockScroll",UNLOCK_SCROLL:"com.consumeraffairs.styleguide.unlockScroll"},HIDE_DISCLOSURE_ATTRIBUTE:"data-hide-disclosure",MEDIA_CHANGE_EVENT:"com.consumeraffairs.styleguide.mediaChange",ENABLE_SEARCH_OVERLAY_ATTRIBUTE:"data-enable-search-overlay",MEDIA_SIZE:{EXTRA_SMALL:"xs",SMALL:"sm"}};class o{constructor(e,s,t){this._setInitialVariables(e,s,t),this._setElements(),this._bindMethods(),this._bindEvents()}
1_setInitialVariables(e,s,t){this._header=e,this._searchWrapper=s,this._iOS=t}_setElements(){this._searchButtons=this._header.querySelectorAll(_.SEARCH_BUTTON_SELECTOR),this._searchEl=this._searchWrapper.querySelector(_.SEARCH_INPUT_SELECTOR_CLASS),this._closeButton=this._searchWrapper.querySelector(_.CLOSE_BUTTON_SELECTOR),this._searchBox=document.querySelector(_.SEARCH_BOX_SELECTOR),this._searchOverlay=document.querySelector(_.SEARCH_OVERLAY_SELECTOR)}_bindMethods(){this._closeButtonClickHandler=this._closeButtonClickHandler.bind(this),this._searchButtonClickHandler=this._searchButtonClickHandler.bind(this),this._onSearchResultsTouchStart=this._onSearchResultsTouchStart.bind(this),this._onInputFocus=this._onInputFocus.bind(this),this._onInputBlur=this._onInputBlur.bind(this),this.restart=this.restart.bind(this)}_bindEvents(){this._searchButtons.forEach(e=>{e.addEventListener("click",()=>{window.hj&&!this._hasHJEventBeenDispatched&&this._isOverlayEnabled()&&(window.hj("event",n),this._hasHJEventBeenDispatched=!0),this._searchButtonClickHandler()})}),window.addEventListener("pageshow",this._windowPageshowEventHandler.bind(this)),window.CALoadScriptsOnDemand&&window.addEventListener(t,this._handleLoadedSearch.bind(this)),this._searchEl&&this._searchEl.addEventListener("addItem",this.restart),this._closeButton&&this._closeButton.addEventListener("click",this._closeButtonClickHandler),this._searchOverlay&&(this._searchOverlay.addEventListener("click",this._closeButtonClickHandler),window.addEventListener("keydown",e=>{["Escape","Esc"].includes(e.key)&&this._closeButtonClickHandler(e)}))}_setChoicesCustomTabIndex(){if(this._searchEl&&this._searchEl.parentNode&&this._searchEl.parentNode.parentNode){const e=this._searchEl.parentNode.parentNode;e&&e.classList.contains("choices")&&e.setAttribute("tabindex","-1")}}_closeButtonClickHandler(e){e.stopImmediatePropagation(),this._dispatchHeaderEvent(_.SCROLL_EVENTS.UNLOCK_SCROLL),this.closeSearch(),this._dispatchHeaderEvent(_.DISCLOSURE_EVENTS.SHOW);const s=new CustomEvent(_.SEARCH_EVENTS.CLOSE);document.dispatchEvent(s)}_onInputFocus(){this._searchEl.search.choices.choiceList.addEventListener("scroll",this._onSearchResultsTouchStart)}_onInputBlur(){this.restart()}_onSearchResultsTouchStart(){this._searchEl&&this._searchEl.search&&(document.activeElement===this._searchEl.search.choices.input&&this._searchEl.search.choices.input.blur(),this._searchEl.search.choices.choiceList.removeEventListener("scroll",this._onSearchResultsTouchStart))}_windowPageshowEventHandler(e){e.persisted&&this.restart()}_dispatchHeaderEvent(e){const s=new CustomEvent(e);this._header.dispatchEvent(s)}_searchButtonClickHandler(){this._isOverlayEnabled()&&this._header.classList.add(_.OPEN_SEARCH_OVERLAY_CLASS),window.CALoadScriptsOnDemand&&!this._isSearchInitialized?(this._searchButtonClicked=!0,this._dispatchOnDemandEvent()):this._handleOpenSearch()}_handleOpenSearch(){this._dispatchHeaderEvent(_.SCROLL_EVENTS.LOCK_SCROLL),this._dispatchHeaderEvent(_.MENU_EVENTS.CLOSE_MENU),this._dispatchHeaderEvent(_.DISCLOSURE_EVENTS.HIDE);const e=new CustomEvent(_.SEARCH_EVENTS.OPEN);document.dispatchEvent(e),this._openSearch(),this._dispatchHeaderEvent(_.MENU_EVENTS.MENU_HANDLER),this._setChoicesCustomTabIndex()}_handleLoadedSearch(){this._isSearchInitialized=!0,this._header.classList.contains(_.LOAD_SEARCH_CLASS)&&this._header.classList.remove(_.LOAD_SEARCH_CLASS),this._searchButtonClicked&&this._handleOpenSearch(),this._isOverlayEnabled()&&this._bindDesktopNavInputSync()}_bindDesktopNavInputSync(){if(this._desktopNavInputSyncBound)return;const e=this._header.querySelector(_.SEARCH_BUTTON_SELECTOR),s=this._getOverlayPanelInput();if(!e||!s||e===s)return;const t=()=>{this._header.classList.contains(_.OPEN_SEARCH_OVERLAY_CLASS)&&window.matchMedia(`(min-width: ${_.DESKTOP_SEARCH_BREAKPOINT}px)`).matches&&(s.value=e.value,s.dispatchEvent(new Event("input",{bubbles:!0})))};e.addEventListener("input",t),this._desktopNavInputSyncBound=!0,e.value&&this._header.classList.contains(_.OPEN_SEARCH_OVERLAY_CLASS)&&window.matchMedia(`(min-width: ${_.DESKTOP_SEARCH_BREAKPOINT}px)`).matches&&t()}_getOverlayPanelInput(){const e=document.querySelectorAll(_.SEARCH_BOX_SELECTOR),s=(this._searchOverlay?this._searchOverlay.querySelector(_.SEARCH_BOX_SELECTOR):null)||(e.length>1?[...e].find(e=>
1e!==this._searchBox):null);return s?s.querySelector(_.OVERLAY_SEARCH_INPUT_SELECTOR):null}_dispatchOnDemandEvent(){const e=this._getSearchScript(),s=new CustomEvent(a,{detail:{required_scripts:[e]}});window.dispatchEvent(s),this._isOverlayEnabled()||this._header.classList.add(_.LOAD_SEARCH_CLASS)}_getSearchScript(){return this._isOverlayEnabled()?"ca_sg_search_overlay":"ca_sg_search_v2"}_isOverlayEnabled(){return this._searchBox.hasAttribute(_.ENABLE_SEARCH_OVERLAY_ATTRIBUTE)}_openSearch(){this._searchEl&&!this._isOverlayEnabled()&&(this._header.classList.add(_.OPEN_SEARCH_CLASS),this._iOS&&this._searchEl&&this._searchEl.search&&this._searchEl.search.choices&&this._searchEl.search.choices.input&&this._searchEl.search.choices.input.addEventListener("focus",this._onInputFocus),window.requestAnimationFrame(()=>{const e=this._searchEl&&this._searchEl.search,s=e&&e.choices;if(!s)return;s.showDropdown();const{input:t}=s;t&&(t.element&&t.element.addEventListener("blur",this._onInputBlur),t.focus())}))}restart(){this._dispatchHeaderEvent(_.SCROLL_EVENTS.UNLOCK_SCROLL),this._dispatchHeaderEvent(_.DISCLOSURE_EVENTS.SHOW),this.closeSearch()}closeSearch(){this._searchBox&&(window.requestAnimationFrame(()=>{this._header.classList.remove(_.OPEN_SEARCH_CLASS),this._header.classList.remove(_.OPEN_SEARCH_OVERLAY_CLASS)}),this._searchBox.classList.remove(_.SEARCH_BOX_TOP_CLASS),this._searchEl&&this._searchEl.search&&(this._searchEl.search.restart(),this._searchEl.search.choices.hideDropdown()))}}
1class r{constructor(e){this._setInitialVariables(e),this._setElements(),this._bindMethods(),this._bindEvents()}_setInitialVariables(e){window.MediaSizeBroadcaster=!0,this._header=e,this._viewAll=document.querySelectorAll(_.VIEW_ALL_SELECTOR),this._isMenuOpen=!1,this._hasWindowClickHandler=!1,this._menuWasOpened=!1,this._isMobile=!1,this._cachedScrollActiveButton=null}_setElements(){this._menuItems=this._header.querySelectorAll(_.MENU_ITEM_SELECTOR),this._submenuButtons=this._header.querySelectorAll(_.SUBMENU_BUTTON_SELECTOR)}_bindMethods(){this._menuButtonMobileClickHandler=this._menuButtonMobileClickHandler.bind(this),this._menuItemMobileClickHandler=this._menuItemMobileClickHandler.bind(this),this._menuItemClickHandler=this._menuItemClickHandler.bind(this),this._windowClickEventHandler=this._windowClickEventHandler.bind(this),this._profileButtonClickHandler=this._profileButtonClickHandler.bind(this),this._onMediaChangeHandler=this._onMediaChangeHandler.bind(this),this.closeMenuMobile=this.closeMenuMobile.bind(this),this._menuHandler=this._menuHandler.bind(this),this._shouldCloseMenuOnClick=this._shouldCloseMenuOnClick.bind(this),this._closeMenuBasedOnDevice=this._closeMenuBasedOnDevice.bind(this),this._submenuScrollHandler=this._submenuScrollHandler.bind(this)}_bindEvents(){const e=this._header.querySelector(_.PROFILE_BUTTON_SELECTOR),s=this._header.querySelector(_.MENU_BUTTON_SELECTOR);s&&s.addEventListener("click",this._menuButtonMobileClickHandler),e&&e.addEventListener("click",this._profileButtonClickHandler),this._addOrRemoveMenuItemsClickHandler({useMobileMethod:!1,action:"add"}),window.addEventListener(_.MEDIA_CHANGE_EVENT,this._onMediaChangeHandler),this._header.addEventListener("scroll",this._submenuScrollHandler,!0),this._addEscListener()}_submenuScrollHandler(e){const s=e.target,t=_.LEVEL_ONE_MENU_ITEM_CLASSES.shadow,i=this._cachedScrollActiveButton?.closest(_.MENU_ITEM_SELECTOR);if(!this._cachedScrollActiveButton||!i?.classList.contains(_.ACTIVE_MENU_ITEM_CLASS)){const e=this._header.querySelector(`${_.MENU_ITEM_SELECTOR}.${_.ACTIVE_MENU_ITEM_CLASS}`);if(!e)return void(this._cachedScrollActiveButton=null);const s=e.querySelector(_.SUBMENU_BUTTON_SELECTOR);if(!s)return void(this._cachedScrollActiveButton=null);this._cachedScrollActiveButton=s}const n=this._cachedScrollActiveButton,{scrollTop:a}=s;a>0?n.classList.add(t):n.classList.remove(t)}_removeSubmenuButtonShadow(){const e=_.LEVEL_ONE_MENU_ITEM_CLASSES.shadow;this._header.querySelectorAll(`.${e}`).forEach(s=>{s.classList.remove(e)})}_addOrRemoveMenuItemsClickHandler(e){let{useMobileMethod:s,action:t}=e;const i=s?this._menuItemMobileClickHandler:this._menuItemClickHandler,n="add"===t?"addEventListener":"removeEventListener";this._menuItems.forEach(e=>{e[n]("click",i),e.dataset.isMobile=s}),this._submenuButtons.forEach(e=>{e[n]("click",i)})}_menuButtonMobileClickHandler(){if(this._dispatchHeaderEvent(_.SEARCH_EVENTS.INNER_CLOSE),this._menuWasOpened||(this._addOrRemoveMenuItemsClickHandler({useMobileMethod:!1,action:"remove"}),this._addOrRemoveMenuItemsClickHandler({useMobileMethod:!0,action:"add"}),this._menuWasOpened=!0),this._isMenuOpen)return this._dispatchHeaderEvent(_.SCROLL_EVENTS.UNLOCK_SCROLL),this.closeMenuMobile(),this._dispatchHeaderEvent(_.DISCLOSURE_EVENTS.SHOW),void this._toggleViewAll(this._isMenuOpen);this._dispatchHeaderEvent(_.SCROLL_EVENTS.LOCK_SCROLL),this._openMenuMobile(),this._dispatchHeaderEvent(_.DISCLOSURE_EVENTS.HIDE),this._toggleMenu(_.OPEN_PROFILE_CLASS,!0),this._toggleViewAll(this._isMenuOpen)}_onMediaChangeHandler(e){const{media:s}=e.detail,t=[_.MEDIA_SIZE.SMALL,_.MEDIA_SIZE.EXTRA_SMALL];if(this._isMobile=t.includes(s),this._isMenuOpen){if(this._isMobile)return void this._toggleViewAll(!0);this._toggleViewAll(!1)}}_closeHeaderOnDesktop(){this._closeHeaderMenuOnDesktop(),this._hasWindowClickHandler=!1,window.removeEventListener("click",this._windowClickEventHandler),this._header.classList.remove(_.OPEN_PROFILE_CLASS)}_toggleViewAll(e){e?this._viewAll.forEach(e=>{e.removeAttribute("role")}):this._viewAll.forEach(e=>{e.setAttribute("role","menuitem")})}_dispatchHeaderEvent(e){const s=new CustomEvent(e);this._header.dispatchEvent(s)}_profileButtonClickHandler(e){this._menuHandler(_.DROPDOWN_ELEMENTS.account,e.target),this.closeMenuMobile(),this._removeActiveMenus(),this._dispatchHeaderEvent(_.SEARCH_EVENTS.INNER_CLOSE),this._dispatchHeaderEvent(_.DISCLOSURE_EVENTS.SHOW),this._dispatchHeaderEvent(_.SCROLL_EVENTS.UNLOCK_SCROLL)}_menuHandler(e,s){const t=e!==_.DROPDOWN_ELEMENTS.account,i=e!==_.DROPDOWN_ELEMENTS.submenu;this._toggleMenu(_.OPEN_PROFILE_CLASS,t),s&&this._toggleMenu(_.OPEN_SUBMENU_CLASS,i,s.dataset.customUapiEvent,s)}_menuItemClickHandler(e){e.stopImmediatePropagation();const s=e.target.closest(_.SUBMENU_BUTTON_SELECTOR);if(!s)return;const t=s.classList;if(!(t.contains(_.LEVEL_ONE_MENU_ITEM_CLASSES.link)&&t.contains(_.LEVEL_ONE_MENU_ITEM_CLASSES.level)&&t.contains(_.LEVEL_ONE_MENU_ITEM_CLASSES.button)))return;const i=s.closest(_.MENU_ITEM_SELECTOR);if(!i)return;const n=this._header.classList.contains(_.OPEN_SUBMENU_CLASS),a=i.classList.contains(_.ACTIVE_MENU_ITEM_DESKTOP_CLASS);return this._header.classList.remove(_.OPEN_PROFILE_CLASS),this._dispatchHeaderEvent(_.SEARCH_EVENTS.INNER_CLOSE),n&&a?(this._closeHeaderMenuOnDesktop(),void this._submenuCloseEventHandler(i.dataset.customUapiEvent)):n&&!a?(this._removeActiveMenus(),i.classList.add(_.ACTIVE_MENU_ITEM_DESKTOP_CLASS),void s.classList.add(_.ACTIVE_MENU_ITEM_DESKTOP_CLASS)):(this._header.classList.add(_.OPEN_SUBMENU_CLASS),i.classList.add(_.ACTIVE_MENU_ITEM_DESKTOP_CLASS),s.classList.add(_.ACTIVE_MENU_ITEM_DESKTOP_CLASS),void(this._hasWindowClickHandler||(window.addEventListener("click",this._windowClickEventHandler),this._hasWindowClickHandler=!0)))}_closeHeaderMenuOnDesktop(){this._header.classList.remove(_.OPEN_SUBMENU_CLASS),this._removeActiveMenus()}_menuItemMobileClickHandler(e){e.stopImmediatePropagation();const s=e.target.closest(_.MENU_ITEM_SELECTOR);if(!s)return;s.classList.contains(_.LEVEL_ONE_MENU_ITEM_CLASS)&&this._menuHandler(_.DROPDOWN_ELEMENTS.submenu,s)}_openMenuMobile(){this._isMenuOpen=!0,this._header.classList.add(_.OPEN_HEADER_CLASS)}closeMenuMobile(){this._isMenuOpen=!1,this._header.classList.remove(_.OPEN_HEADER_CLASS),this._removeHideClass(),this._removeSubmenuButtonShadow(),this._closeHeaderMenuOnDesktop(),this._toggleMenu(_.OPEN_SUBMENU_CLASS,!0,"",this._header)}_removeHideClass(){const e=this._header.querySelector(`.${_.HIDE_NAV_ITEM_CLASS}`);e&&e.classList.remove(_.HIDE_NAV_ITEM_CLASS)}handleMenuAndState(){this._removeHideClass(),this._menuHandler(null,this._header)}_toggleMenu(e,s,t,i){this._header.classList.contains(e)?(this._header.classList.remove(e),this._removeActiveMenus(),e===_.OPEN_SUBMENU_CLASS&&this._removeSubmenuButtonShadow(),this._hasWindowClickHandler&&(this._hasWindowClickHandler=!1,window.removeEventListener("click",this._windowClickEventHandler)),this._submenuCloseEventHandler(t)):s||(this._header.classList.add(e),i&&(i.classList.add(_.ACTIVE_MENU_ITEM_CLASS),this._cachedScrollActiveButton=null),this._hasWindowClickHandler||(this._hasWindowClickHandler=!0,window.addEventListener("click",this._windowClickEventHandler)))}_shouldCloseMenuOnClick(e){if(!e.closest(_.HEADER_SELECTOR))return!0;return![_.MENU_BUTTON_SELECTOR,_.PROFILE_BUTTON_SELECTOR,_.MENU_ITEM_SELECTOR,_.SUBMENU_SELECTOR].some(s=>e.closest(s))}_closeMenuBasedOnDevice(){this._isMobile?this._menuHandler():this._closeHeaderOnDesktop()}_windowClickEventHandler(e){let{target:s}=e;this._shouldCloseMenuOnClick(s)&&this._closeMenuBasedOnDevice()}_removeActiveMenus(){this._cachedScrollActiveButton=null,this._menuItems.forEac
1h(e=>{e.classList.remove(_.ACTIVE_MENU_ITEM_CLASS),e.classList.remove(_.ACTIVE_MENU_ITEM_DESKTOP_CLASS)}),this._submenuButtons.forEach(e=>{e.classList.remove(_.ACTIVE_MENU_ITEM_DESKTOP_CLASS)})}_submenuCloseEventHandler(){const e={name:"dropdown",data:{element:arguments.length>0&&void 0!==arguments[0]?arguments[0]:_.USERDB_ELEMENT_NAMES.accountDropdown,selection:"none"}};this._dispatchUapiEvent(e)}_dispatchUapiEvent(e){const s=new CustomEvent(_.UAPI_CUSTOM_EVENT,{detail:e});window.dispatchEvent(s)}_addEscListener(){document.addEventListener("keydown",e=>{["Escape","Esc"].includes(e.key)&&this._closeMenuBasedOnDevice()})}}new class{constructor(){this._setElements(),this._header&&(this._setInitialVariables(),this._bindMethods(),this._bindEvents(),this._initializeInstances())}_setElements(){this._header=document.querySelector(_.HEADER_SELECTOR),this._header&&(this._searchWrappers=this._header.querySelectorAll(i)),this._profileWarnMessages=document.querySelector(_.PROFILE_WARN_MESSAGES_SELECTOR),this._disclosure=document.querySelector(_.DISCLOSURE_SELECTOR),this._stickyCtas=document.querySelector(_.STICKY_CTAS_SELECTOR)}_setInitialVariables(){window.ScrollThrottledBroadcaster=!0;const e=window.navigator?.userAgentData?.platform||window.navigator?.platform||"unknown";this._iOS=/ipad|iphone|ipod/.test(e.toLowerCase()),this._scrollPosition=0,this._searchInstances=[]}_bindMethods(){this._scrollEventHandler=this._scrollEventHandler.bind(this),this._lockScroll=this._lockScroll.bind(this),this._unlockScroll=this._unlockScroll.bind(this),this._toggleDisclosure=this._toggleDisclosure.bind(this),this._handleMenuAndState=this._handleMenuAndState.bind(this),this._closeMenu=this._closeMenu.bind(this),this._closeSearch=this._closeSearch.bind(this)}_bindEvents(){window.addEventListener(_.SCROLL_EVENTS.USER_SCROLL,this._scrollEventHandler),this._header.addEventListener(_.SCROLL_EVENTS.LOCK_SCROLL,this._lockScroll),this._header.addEventListener(_.SCROLL_EVENTS.UNLOCK_SCROLL,this._unlockScroll),this._header.addEventListener(_.MENU_EVENTS.CLOSE_MENU,this._closeMenu),this._header.addEventListener(_.MENU_EVENTS.MENU_HANDLER,this._handleMenuAndState),this._header.addEventListener(_.DISCLOSURE_EVENTS.SHOW,()=>this._toggleDisclosure()),this._header.addEventListener(_.DISCLOSURE_EVENTS.HIDE,()=>this._toggleDisclosure(!0)),this._header.addEventListener(_.SEARCH_EVENTS.INNER_CLOSE,this._closeSearch)}_initializeInstances(){this._searchWrappers.forEach(e=>{this._searchInstances.push(new o(this._header,e,this._iOS))}),this._menuInstance=new r(this._header)}_toggleDisclosure(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];window.requestAnimationFrame(()=>{this._disclosure&&(e?this._disclosure.setAttribute(_.HIDE_DISCLOSURE_ATTRIBUTE,"true"):this._disclosure.removeAttribute(_.HIDE_DISCLOSURE_ATTRIBUTE))})}_lockScroll(){this._iOS&&(document.documentElement.classList.contains(_.OPEN_DROPDOWN_MENU_CLASS)||(this._scrollPosition=window.pageYOffset||window.document.documentElement.scrollTop),document.documentElement.classList.add(_.OPEN_DROPDOWN_MENU_CLASS)),document.body.classList.add(_.OPEN_DROPDOWN_MENU_CLASS)}_unlockScroll(){document.body.classList.remove(_.OPEN_DROPDOWN_MENU_CLASS),this._iOS&&(document.documentElement.classList.remove(_.OPEN_DROPDOWN_MENU_CLASS),this._scrollPosition&&window.scrollTo(0,this._scrollPosition))}_closeMenu(){this._menuInstance.closeMenuMobile()}_closeSearch(){this._searchInstances.forEach(e=>{e.closeSearch()})}_handleMenuAndState(){this._menuInstance.handleMenuAndState()}_scrollEventHandler(e){this._header.classList.contains(_.TOGGLE_SCROLL_DESCRIPTION_CLASS)&&(e&&e.detail.direction===s?this._addOrRemoveHeaderScrollClasses({shouldAdd:!0}):this._addOrRemoveHeaderScrollClasses({shouldAdd:!1}))}_addOrRemoveHeaderScrollClasses(e){let{shouldAdd:s}=e;const t=s?"add":"remove";this._header.classList[t](_.HEADER_SCROLL_CLASS),this._stickyCtas&&this._header.classList[t](_.STICKY_CTA_CLASS),this._profileWarnMessages&&this._profileWarnMessages.classList[t](_.HEADER_SCROLL_CLASS)}};const h=new e;new class{constructor(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;if(!e)throw new Error("[CAError] A ScrollBoundariesObserver instance is required");this._document=s.document,this._scrollBoundariesObserver=e,this._onChangedStatus=this._onChangedStatus.bind(this)}init(e){const{boundariesElSelector:s,elSelector:t,toggleClass:i,condition:n,boundary:a,offsetTop:_,offsetBottom:o,callback:r}=e,h=this._document.querySelector(s);this._callback=r,this.element=this._document.querySelector(t),this.toggleClass=i,h&&this.element&&i&&this._scrollBoundariesObserver.register({boundariesEl:h,callback:this._onChangedStatus,condition:n,boundary:a,offsetTop:_,offsetBottom:o})}_onChangedStatus(e){const s=e?"add":"remove";this.element.classList[s](this.toggleClass),this._callback&&this._callback(e)}}
1(h).init({boundariesElSelector:".js-wrpr",elSelector:".js-ca-hdr:not(.ca-hdr--wth-ovrly)",toggleClass:"elevation-2"})})()})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.