1var t = 0; 2var h = 0; 3var ct = 0; 4var b = 0; 5var header, 6 headerContainer, 7 headerSearchCart, 8 topBar, 9 body, 10 headerHeight, 11 LastScrollVal, 12 headerVal, 13 contactInfo, 14 socialIconInnerParent, 15 socialIconParent, 16 headerSearchCartPositionResponsive, 17 headerSearchCartPositionNonResponsive, 18 topbBarInfoPosition, 19 menuParent, 20 portal, 21 brandingInfo, 22 portalResponsive, 23 portalNonResponsive, 24 mobileHeaderStyle; 25var scrollTopVal, 26 headercontainerHeight, 27 bannerLi, 28 bannerBaseHeader, 29 bannerArrowClass, 30 darkHeader, 31 responsiveSearchCartContainer, 32 bannerThemecontainer, 33 themeContentContainer, 34 themeHeaderSixRes, 35 themeHeaderSixResHeight, 36 themeLogo, 37 themeLogoHeight, 38 themeLogoWidth, 39 themeLogoHeightSlice, 40 themeLogoWidthSlice, 41 themeCurrencyList, 42 themeCurrencyRes, 43 themeCurrencyNonRes, 44 themeSidebarContent, 45 themeSidebarContentContainer, 46 themeSidebarMobileContentContainer, 47 hasHeaderSeven, 48 langContainer, 49 langNonResContainer, 50 langResContainer, 51 displayMode, 52 pageContainer, 53 searchCartScrollPosition; 54 55function removeClass(element, className) { 56 element && 57 (element.className = element.className.replace( 58 new RegExp(className, "g"), 59 "" 60 )); 61} 62 63function addClass(element, className) { 64 element && element.classList.add(className); 65} 66 67function VariableInit() { 68 headerSearchCartPositionResponsive = document.querySelectorAll('[data-search-cart-position-responsive="zptheme-search-cart-position-responsive"]')[0]; 69 headerSearchCart = document.querySelectorAll('[data-theme-search-cart-group="zptheme-search-cart-group"]')[0]; 70 headerSearchCartPositionNonResponsive = document.querySelectorAll('[data-search-cart-position-non-responsive="zptheme-search-cart-position-non-responsive"]')[0]; 71 topbBarInfoPosition = document.querySelectorAll('[data-topbarinfo-position="zptheme-topbarinfo-position"]')[0]; 72 contactInfo = document.querySelectorAll('[data-contact-info="zptheme-contact-info"]')[0]; 73 menuParent = document.querySelectorAll('[data-non-res-menu="zptheme-menu-non-res"]')[0]; 74 socialIconParent = document.querySelectorAll('[data-socialicon-parent="zptheme-socialicon-parent"]')[0]; 75 socialIconInnerParent = document.querySelectorAll('[data-socialicon-inner-parent="zptheme-socialicon-inner-parent"]')[0]; 76 portal = document.querySelectorAll('[data-theme-portal="zptheme-portal"]')[0]; 77 topBar = document.querySelectorAll('[data-theme-topbar="zptheme-topbar"]')[0]; 78 if(topBar) { 79 showTopBar = topBar.getAttribute('data-theme-show-topbar'); 80 } 81 brandingInfo = document.querySelectorAll('[data-theme-branding-info="zptheme-branding-info"]')[0]; 82 header =document.querySelectorAll('[data-header="zptheme-data-header"]')[0] || document.querySelectorAll('[data-header="zptheme-data-header-transparent"]')[0] || document.querySelectorAll('[data-header="none"]')[0]; 83 headerContainer = document.querySelectorAll('[data-headercontainer="zptheme-data-headercontainer"]')[0]; 84 portal = document.querySelectorAll('[data-theme-portal="zptheme-portal"]')[0]; 85 portalResponsive = document.querySelectorAll('[data-theme-portal-responsive="zptheme-portal-responsive"]')[0]; 86 portalNonResponsive = document.querySelectorAll('[data-theme-portal-non-responsive="zptheme-portal-non-responsive"]')[0]; 87 verticalMmenu = document.querySelectorAll('[data-theme-vertical-menu="zptheme-vertical-menu"]')[0]; 88 89 themeCurrencyList = document.querySelectorAll("[data-theme-currency-list-container]")[0]; 90 themeCurrencyRes = document.querySelectorAll("[data-theme-currency-placeholder-res]")[0]; 91 themeCurrencyNonRes = document.querySelectorAll("[data-theme-currency-placeholder-non-res]")[0]; 92 93 langContainer = $D.get("[data-theme-lang-container]"); 94 langNonResContainer = $D.get("[data-theme-lang-container-non-res]"); 95 langResContainer = $D.get("[data-theme-lang-container-res]"); 96 97 body = document.getElementsByTagName("body")[0]; 98 header = document.querySelectorAll('[data-header="zptheme-data-header"]')[0] || document.querySelectorAll('[data-header="zptheme-data-header-transparent"]')[0] || document.querySelectorAll('[data-header="none"]')[0]; 99 if (!header) { 100 return; 101 } 102 headerVal = header.getAttribute("data-header").trim(); 103 headerHeight = header.clientHeight; 104 headerContainer = document.querySelectorAll('[data-headercontainer="zptheme-data-headercontainer"]')[0]; 105 if (!headerContainer) { 106 return; 107 } 108 headercontainerHeight = headerContainer.clientHeight; 109 scrollTopVal = headercontainerHeight - headerHeight; 110 111 // VARIABLE FOR BANNER BASE HEADER TEXT COLOR 112 113 bannerBaseHeader = document.querySelectorAll('[data-banner-base-header="theme-banner-base-header"]'); 114 bannerLi = document.querySelectorAll('[data-element-type="heroslide"]'); 115 hero = document.querySelector(".zphero"); 116 117 // VARIABLE FOR BANNER BASE HEADER TEXT COLOR END 118 119 responsiveSearchCartContainer = document.querySelectorAll("[data-theme-responsive-search-cart]")[0]; 120 responsiveSearchCartTopbar = document.querySelectorAll("[data-theme-responsive-search-cart-topbar]")[0]; 121 122 searchCartScrollPosition = document.querySelectorAll('[data-search-cart-scrollposition-non-responsive="zptheme-search-cart-scrollposition-non-responsive"]')[0]; 123 124 bannerThemecontainer = document.querySelectorAll('[data-themebanner="zptheme-banner"]')[0]; 125 126 themeContentContainer = document.querySelectorAll('[data-theme-content-container="theme-content-container"]')[0]; 127 128 themeHeaderSixRes = document.querySelectorAll('[data-theme-header-six-res="theme-header-six-res"]')[0]; 129 130 if (themeHeaderSixRes) { 131 themeHeaderSixResHeight = themeHeaderSixRes.clientHeight; 132 } 133 134 themeLogo = document.querySelectorAll("[data-zs-logo]")[0]; 135 if (themeLogo) { 136 themeLogoHeight = themeLogo.style.height; 137 themeLogoHeightSlice = Number(themeLogoHeight.slice(0, -2)); 138 themeLogoWidth = themeLogo.style.width; 139 themeLogoWidthSlice = Number(themeLogoWidth.slice(0, -2)); 140 } 141 142 // HEADER STYLE 07 143 144 hasHeaderSeven = headerContainer.classList.contains("zpheader-style-07"); 145 146 // SIDEBAR VARIABLES 147 148 themeSidebarContent = $D.get("[data-theme-sidebar-content]"); 149 themeSidebarContentContainer = $D.get("[data-theme-sidebar-content-container]"); 150 themeSidebarMobileContentContainer = $D.get("[data-theme-sidebar-mobile-content-container]"); 151 152 mobileHeaderStyle = $D.get("[data-zs-mobile-headerstyle]"); 153 if (mobileHeaderStyle) { 154 mobileHeaderStyle = mobileHeaderStyle.getAttribute("data-zs-mobile-headerstyle"); 155 } 156 157 pageContainer = document.querySelector('.page-container'); 158} 159 160// ONSCROLL HEADER EFFECT 161function responsivechanges() { 162 if (!body) { 163 VariableInit(); 164 } 165 if (!headerContainer) { 166 return; 167 } 168 var offsetValLoad = window.pageYOffset; 169 170 if (document.documentElement.clientWidth > 992) { 171 if (topBar) { 172 topBar.removeAttribute("style"); 173 } 174 if (hasHeaderSeven && topBar && portal && headerSearchCart) { 175 if (portal.classList.contains("theme-portal-icon-enabled")) { 176 headerSearchCart.prepend(portal); 177 } 178 } 179 if (headerSearchCartPositionResponsive) { 180 headerSearchCartPositionResponsive.innerHTML = ""; 181 } 182 if (menuParent && menuParent.parentNode == contactInfo) { 183 menuParent.removeChild(contactInfo); 184 } 185 if (contactInfo && contactInfo.parentNode == socialIconInnerParent) { 186 contactInfo.removeChild(socialIconInnerParent); 187 } 188 if (socialIconParent) { 189 socialIconParent.appendChild(socialIconInnerParent); 190 var socialIconMoreBtn = document.querySelectorAll( 191 "[data-more-socialicon-parent]" 192 )[0]; 193 if (socialIconMoreBtn) { 194 $D.append(socialIconParent, socialIconMoreBtn); 195 } 196 } 197 if (headerSearchCart && headerSearchCartPositionNonResponsive) { 198 headerSearchCartPositionNonResponsive.appendChild(headerSearchCart); 199 } 200 if (responsiveSearchCartContainer && headerSearchCart) { 201 responsiveSearchCartContainer.innerHTML = ""; 202 } 203 if (searchCartScrollPosition) { 204 if ( 205 offsetValLoad < scrollTopVal && 206 headerSearchCart && 207 headerSearchCartPositionNonResponsive 208 ) { 209 headerSearchCartPositionNonResponsive.appendChild(headerSearchCart); 210 } else if ( 211 menuParent && 212 offsetValLoad > scrollTopVal && 213 headerSearchCart && 214 searchCartScrollPosition && 215 (headerContainer.className.indexOf("theme-header-fixed") > -1 || 216 header.className.indexOf("theme-header-animate") > -1 || 217 headerContainer.className.indexOf("theme-header-animate") > -1) 218 ) { 219 searchCartScrollPosition.appendChild(headerSearchCart); 220 } 221 } 222 if (contactInfo || (contactInfo && !menuParent)) { 223 topbBarInfoPosition.appendChild(contactInfo); 224 } 225 if ( 226 topBar && 227 headerContainer.className.indexOf("zpheader-style-05") == -1 228 ) { 229 addClass(topBar, "theme-topbar-not-in-header-05"); 230 }
231 if (portal && portalResponsive) { 232 portalResponsive.innerHTML = ""; 233 } 234 if (portalNonResponsive) { 235 portalNonResponsive.appendChild(portal); 236 } 237 if (!menuParent && !brandingInfo && headerSearchCart) { 238 header.setAttribute("style", "display:flex"); 239 } 240 if (bannerThemecontainer) { 241 bannerThemecontainer.style.marginTop = "0px"; 242 } 243 if (themeContentContainer) { 244 themeContentContainer.style.marginTop = "0px"; 245 } 246 if (menuParent) { 247 menuParent.style.maxHeight = "none"; 248 } 249 if (themeCurrencyList && themeCurrencyNonRes) { 250 themeCurrencyNonRes.appendChild(themeCurrencyList); 251 } 252 if (themeSidebarContent && themeSidebarMobileContentContainer) { 253 themeSidebarContentContainer.appendChild(themeSidebarContent); 254 } 255 removeClass(body, "theme-body-overflowhidden"); 256 } else { 257 if (topBar && !headerSearchCart && !portal && !showTopBar) { 258 topBar.setAttribute("style", "display:none"); 259 } 260 if (hasHeaderSeven && topBar && portal) { 261 if ( 262 topBar.querySelector(".zpcontainer") && 263 portal.classList.contains("theme-portal-icon-enabled") 264 ) { 265 topBar.querySelector(".zpcontainer").appendChild(portal); 266 } 267 } 268 if ( 269 (topBar && 270 headerSearchCart && 271 headerSearchCartPositionResponsive && 272 headerSearchCart.parentElement !== 273 headerSearchCartPositionResponsive) || 274 (headerSearchCart && 275 verticalMmenu && 276 headerSearchCartPositionResponsive && 277 headerSearchCart.parentElement !== 278 headerSearchCartPositionResponsive) || 279 (hasHeaderSeven && 280 headerSearchCart && 281 headerSearchCartPositionResponsive && 282 headerSearchCart.parentElement !== headerSearchCartPositionResponsive) 283 ) { 284 headerSearchCartPositionResponsive.appendChild(headerSearchCart); 285 } 286 if ( 287 responsiveSearchCartContainer && 288 headerSearchCart && 289 !topBar && 290 headerSearchCart.parentElement !== responsiveSearchCartContainer 291 ) { 292 responsiveSearchCartContainer.appendChild(headerSearchCart); 293 } 294 if (responsiveSearchCartContainer && headerSearchCart && topBar) { 295 addClass(responsiveSearchCartTopbar, "theme-hide-responsive-topbar"); 296 } else if (responsiveSearchCartContainer && headerSearchCart && !topBar) { 297 removeClass(responsiveSearchCartTopbar, "theme-hide-responsive-topbar"); 298 } 299 if (contactInfo && menuParent) { 300 menuParent.appendChild(contactInfo); 301 } 302 if (contactInfo && socialIconInnerParent && menuParent) { 303 contactInfo.appendChild(socialIconInnerParent); 304 } else if (!contactInfo && socialIconInnerParent && menuParent) { 305 menuParent.appendChild(socialIconInnerParent); 306 } 307 if ( 308 ((headerSearchCartPositionResponsive && 309 headerSearchCartPositionNonResponsive && 310 topBar) || 311 (headerSearchCartPositionNonResponsive && verticalMmenu)) && 312 (!headerSearchCart || 313 !headerSearchCartPositionNonResponsive.contains(headerSearchCart)) 314 ) { 315 headerSearchCartPositionNonResponsive.innerHTML = ""; 316 } 317 if ( 318 !menuParent && 319 !brandingInfo && 320 headerSearchCart && 321 mobileHeaderStyle != "02" 322 ) { 323 header.setAttribute("style", "display:none"); 324 } 325 if (portal && portalResponsive) { 326 portalResponsive.appendChild(portal); 327 } 328 if (themeCurrencyList && themeCurrencyRes) { 329 themeCurrencyRes.appendChild(themeCurrencyList); 330 } 331 if (themeSidebarContent && themeSidebarMobileContentContainer) { 332 themeSidebarMobileContentContainer.appendChild(themeSidebarContent); 333 } 334 var deviceWidth = document.documentElement.clientWidth / 2; 335 var deviceHeight = document.documentElement.clientHeight / 2; 336 if ( 337 (themeLogo && themeLogoHeightSlice >= deviceHeight) || 338 (themeLogo && themeLogoWidthSlice >= deviceWidth) 339 ) { 340 addClass(themeLogo, "mobileLogoAuto"); 341 } 342 if (menuParent) { 343 menuParent.style.maxHeight = ""; 344 } 345 } 346} 347 348function fullBannerHeaderColor() { 349 if (hero) { 350 bannerBaseHeaderLength = bannerBaseHeader.length; 351 bannerLiLength = bannerLi.length; 352 var hasHeaderSix = headerContainer.classList.contains("zpheader-style-06"); 353 var hasHeaderTwo = headerContainer.classList.contains("zpheader-style-02"); 354 var arrowContainer = document.getElementsByClassName( 355 "zsslider-arrows-container" 356 ); 357 if ( 358 headerContainer.className.indexOf("theme-header-fixed") > 0 && 359 hasHeaderSix == false && 360 document.documentElement.clientWidth > 992 361 ) { 362 for (bl = 0; bl < bannerLiLength; bl++) { 363 if ( 364 bannerLi[bl].className.indexOf("zpdark-section") > -1 && 365 bannerLi[bl].className.indexOf("curslide") > -1 366 ) { 367 for (bh = 0; bh < bannerBaseHeaderLength; bh++) { 368 addClass(bannerBaseHeader[bh], "zpdark-header-portion"); 369 } 370 if (topBar) { 371 addClass(topBar, "zpdark-header-portion"); 372 } 373 } else if ( 374 (bannerLi[bl].className.indexOf("zpdefault-section") > -1 && 375 bannerLi[bl].className.indexOf("curslide") > -1) || 376 (bannerLi[bl].className.indexOf("zplight-section") > -1 && 377 bannerLi[bl].className.indexOf("curslide") > -1) 378 ) { 379 for (bh = 0; bh < bannerBaseHeaderLength; bh++) { 380 removeClass(bannerBaseHeader[bh], "zpdark-header-portion"); 381 } 382 if ( 383 topBar && 384 topBar.className.indexOf("zpdark-header-portion") > -1 385 ) { 386 removeClass(topBar, "zpdark-header-portion"); 387 } 388 } 389 } 390 } 391
392 for (ac = 0; ac < arrowContainer.length; ac++) { 393 var arrowSvg = arrowContainer[ac].getElementsByTagName("svg"); 394 for (asv = 0; asv < arrowSvg.length; asv++) { 395 for (blsvg = 0; blsvg < bannerLiLength; blsvg++) { 396 if ( 397 (bannerLi[blsvg].className.indexOf("zpdefault-section") > -1 && 398 bannerLi[blsvg].className.indexOf("curslide") > -1) || 399 (bannerLi[blsvg].className.indexOf("zplight-section") > -1 && 400 bannerLi[blsvg].className.indexOf("curslide") > -1) 401 ) { 402 arrowSvg[asv].style.fill = "#404040"; 403 } 404 if ( 405 bannerLi[blsvg].className.indexOf("zpdark-section") > -1 && 406 bannerLi[blsvg].className.indexOf("curslide") > -1 407 ) { 408 arrowSvg[asv].style.fill = "#fff"; 409 } 410 } 411 } 412 } 413 } 414} 415 416document.addEventListener("DOMContentLoaded", function (event) { 417 displayMode = displayMode(); 418 if (displayMode.isWebView) { 419 document.body.setAttribute("data-zs-display-mode", "webview"); 420 } 421 responsivechanges(); 422 if (!headerContainer) { 423 return; 424 } 425 426 fullBannerHeaderColor(); 427 428 // MENU EVENT LISTENER 429 430 var menu = document.querySelector("[data-zp-theme-menu]"); 431 if (menu) { 432 menu.addEventListener("zsMenu:burgerIcon:open", onMobileMenuOpen); 433 menu.addEventListener("zsMenu:orientationchange", onMobileMenuOpen); 434 function onMobileMenuOpen() { 435 var currencyListClick = document.querySelector( 436 "[data-theme-currency-list-container]" 437 ); 438 var headercontainerHeightplus = headerContainer.clientHeight + 20; 439 var viewheight = document.documentElement.clientHeight; 440 var maxHeight = viewheight - headercontainerHeightplus; 441 if (themeHeaderSixRes) { 442 var themeHeaderSixResHeightPlus = themeHeaderSixRes.clientHeight + 20; 443 var maxHeight = viewheight - themeHeaderSixResHeightPlus; 444 } 445 body.setAttribute("data-theme-menu-max-height", maxHeight); 446 addClass(body, "theme-body-overflowhidden"); 447 var menucloseid = document.getElementById("themeMenuAnimateEnd"); 448 if (menucloseid) { 449 menucloseid.parentElement.removeChild(menucloseid); 450 } 451 452 var menuAnimateStyle = document.createElement("style"); 453 menuAnimateStyle.id = "themeMenuAnimate"; 454 menuAnimateStyle.type = "text/css"; 455 var cssText = document.createTextNode( 456 ".theme-responsive-menu-area.theme-navigation-and-icons .theme-menu-area .theme-menu.theme-toggle-animate{max-height: " + 457 maxHeight + 458 "px;-webkit-animation: toggleAnimate 0.2s linear 1; -moz-animation: toggleAnimate 0.2s linear 1; -ms-animation: toggleAnimate 0.2s linear 1; -o-animation: toggleAnimate 0.2s linear 1; animation: toggleAnimate 0.2s linear 1;} @-webkit-keyframes toggleAnimate { from { max-height: 0px; } } @-moz-keyframes toggleAnimate { from { max-height: 0px; } } @-ms-keyframes toggleAnimate { from { max-height: 0px; } } @-o-keyframes toggleAnimate { from { max-height: 0px; } } @keyframes toggleAnimate { from { max-height: 0px; } }" 459 ); 460 menuAnimateStyle.appendChild(cssText); 461 document.getElementsByTagName("head")[0].appendChild(menuAnimateStyle); 462 if (currencyListClick) { 463 currencyListClick.removeEventListener("click", openCurrency); 464 currencyListClick.addEventListener("click", openCurrency); 465 } 466 } 467 468 menu.addEventListener( 469 "zsMenu:burgerIcon:close", 470 function onMobileMenuClose() { 471 removeClass(body, "theme-body-overflowhidden"); 472 var maxHeight = body.getAttribute("data-theme-menu-max-height"); 473 var menuAnimateEndStyle = document.createElement("style"); 474 menuAnimateEndStyle.id = "themeMenuAnimateEnd"; 475 menuAnimateEndStyle.type = "text/css"; 476 var cssText = document.createTextNode( 477 ".theme-responsive-menu-area.theme-navigation-and-icons .theme-menu-area .theme-menu.theme-toggle-animate-end{max-height:0px;-webkit-animation: toggleAnimateEnd 0.2s linear 1; -moz-animation: toggleAnimateEnd 0.2s linear 1; -ms-animation: toggleAnimateEnd 0.2s linear 1; -o-animation: toggleAnimateEnd 0.2s linear 1; animation: toggleAnimateEnd 0.2s linear 1;} @-webkit-keyframes toggleAnimateEnd { from { max-height: " + 478 maxHeight + 479 "px; visibility: visible; } } @-moz-keyframes toggleAnimateEnd { from { max-height: " + 480 maxHeight + 481 "px; visibility: visible; } } @-ms-keyframes toggleAnimateEnd { from { max-height: " + 482 maxHeight + 483 "px; visibility: visible; } } @-o-keyframes toggleAnimateEnd { from { max-height: " + 484 maxHeight + 485 "px; visibility: visible; } } @keyframes toggleAnimateEnd { from { max-height: " + 486 maxHeight + 487 "px; visibility: visible; } }" 488 ); 489 menuAnimateEndStyle.appendChild(cssText); 490 document 491 .getElementsByTagName("head")[0] 492 .appendChild(menuAnimateEndStyle); 493 494 var menuopenid = document.getElementById("themeMenuAnimate"); 495 if (menuopenid) { 496 menuopenid.parentElement.removeChild(menuopenid); 497 } 498 } 499 ); 500 } 501 502 // BANNER BASED HEADER TEXT COLOR STARTS 503 504 if (hero) { 505 hero.addEventListener("sliderActive:changed", function (e) { 506 var data = e.detail; 507 var slide = data.slide; 508 var bannerLi = hero.querySelectorAll('[data-element-type="heroslide"]'); 509 var bannerBaseHeader = document.querySelectorAll( 510 '[data-banner-base-header="theme-banner-base-header"]' 511 ); 512 bannerBaseHeaderLength = bannerBaseHeader.length; 513 bannerLiLength = bannerLi.length; 514 var hasHeaderSix = 515 headerContainer.classList.contains("zpheader-style-06"); 516 headercontainerHeight = headerContainer.clientHeight; 517 offsetVal = window.pageYOffset; 518 if ( 519 headerContainer.className.indexOf("theme-header-fixed") > 0 && 520 hasHeaderSix == false && 521 offsetVal <= headercontainerHeight && 522 document.documentElement.clientWidth > 992 523 ) { 524 for (bhl = 0; bhl < bannerBaseHeaderLength; bhl++) { 525 if ( 526 bannerBaseHeader[bhl].className.indexOf("zpdark-header-portion") > 527 -1 528 ) { 529 removeClass(bannerBaseHeader[bhl], "zpdark-header-portion"); 530 } 531 } 532 if (topBar && topBar.className.indexOf("zpdark-header-portion") > -1) { 533 removeClass(topBar, "zpdark-header-portion"); 534 } 535 if (slide.className.indexOf("zpdark-section") > -1) { 536 for (bhl = 0; bhl < bannerBaseHeaderLength; bhl++) { 537 addClass(bannerBaseHeader[bhl], "zpdark-header-portion"); 538 } 539 if (topBar) { 540 addClass(topBar, "zpdark-header-portion"); 541 } 542 } 543 } 544 545 if ( 546 slide.className.indexOf("zplight-section") > -1 || 547 slide.className.indexOf("zpdefault-section") > -1 548 ) { 549 var arrowContainer = document.getElementsByClassName( 550 "zsslider-arrows-container" 551 );
552 for (ac = 0; ac < arrowContainer.length; ac++) { 553 var arrowSvg = arrowContainer[ac].getElementsByTagName("svg"); 554 for (asv = 0; asv < arrowSvg.length; asv++) { 555 arrowSvg[asv].style.fill = "#404040"; 556 } 557 } 558 } else { 559 var arrowContainer = document.getElementsByClassName( 560 "zsslider-arrows-container" 561 ); 562 for (ac = 0; ac < arrowContainer.length; ac++) { 563 var arrowSvg = arrowContainer[ac].getElementsByTagName("svg"); 564 for (asv = 0; asv < arrowSvg.length; asv++) { 565 arrowSvg[asv].style.fill = "#fff"; 566 } 567 } 568 } 569 }); 570 } 571 572 // BANNER BASED HEADER TEXT COLOR END 573 574 // ADDING ID TO pageContainer FOR SKIP to main CONTENT 575 576 if(pageContainer){ 577 pageContainer.setAttribute('id','main-content'); 578 pageContainer.setAttribute('role','main'); 579 } 580 581 // EVENT DISPATCH FOR DOM CONTENT LOADED 582 583 var event = new Event("zs:header:dom", {}); 584 document.dispatchEvent(event); 585 mobileheader(); 586}); 587 588window.addEventListener("resize", function (event) { 589 responsivechanges(); 590 bannerLiScroll = document.querySelectorAll('[data-element-type="heroslide"]'); 591 bannerLiScrollLength = bannerLiScroll.length; 592 bannerBaseHeaderScrl = document.querySelectorAll( 593 '[data-banner-base-header="theme-banner-base-header"]' 594 ); 595 bannerBaseHeaderScrlLength = bannerBaseHeaderScrl.length; 596 headerContainer = document.querySelectorAll( 597 '[data-headercontainer="zptheme-data-headercontainer"]' 598 )[0]; 599 if (!headerContainer) { 600 return; 601 } 602 var hasHeaderSix = headerContainer.classList.contains("zpheader-style-06"); 603 if (topBar) { 604 var darkTopbar = topBar.getAttribute("data-dark-part-applied").trim(); 605 } 606 if (hasHeaderSix == false) { 607 for (bhscrl = 0; bhscrl < bannerBaseHeaderScrlLength; bhscrl++) { 608 var darkHeader = bannerBaseHeaderScrl[bhscrl] 609 .getAttribute("data-dark-part-applied") 610 .trim(); 611 } 612 } 613 headerContainerChildren = headerContainer.children; 614 if (document.documentElement.clientWidth < 992) { 615 headerContainer.style.top = "0px"; 616 if (topBar) { 617 topBar.style.opacity = "1"; 618 } 619 } 620 for (bnrScrl = 0; bnrScrl < bannerLiScrollLength; bnrScrl++) { 621 var bannerDark = 622 bannerLiScroll[bnrScrl].classList.contains("zpdark-section"); 623 var hasHeaderSix = headerContainer.classList.contains("zpheader-style-06"); 624 if ( 625 headerContainer.className.indexOf("theme-header-fixed") > 0 && 626 bannerLiScroll[bnrScrl].className.indexOf("zpdark-section") > -1 && 627 bannerLiScroll[bnrScrl].className.indexOf("curslide") > -1 && 628 hasHeaderSix == false && 629 document.documentElement.clientWidth > 768 && 630 document.documentElement.clientWidth < 1028 631 ) { 632 for (bhscrl = 0; bhscrl < bannerBaseHeaderScrlLength; bhscrl++) { 633 addClass(bannerBaseHeaderScrl[bhscrl], "zpdark-header-portion"); 634 } 635 if (topBar) { 636 addClass(topBar, "zpdark-header-portion"); 637 } 638 } 639 if ( 640 headerContainer.className.indexOf("theme-header-fixed") > 0 && 641 hasHeaderSix == false && 642 bannerDark == false && 643 bannerLiScroll[bnrScrl].className.indexOf("curslide") > -1 && 644 document.documentElement.clientWidth > 768 && 645 document.documentElement.clientWidth < 1028 646 ) { 647 for (bhscrl = 0; bhscrl < bannerBaseHeaderScrlLength; bhscrl++) { 648 removeClass(bannerBaseHeaderScrl[bhscrl], "zpdark-header-portion"); 649 } 650 if (topBar && topBar.className.indexOf("zpdark-header-portion") > -1) { 651 removeClass(topBar, "zpdark-header-portion"); 652 } 653 } 654 if ( 655 headerContainer.className.indexOf("theme-header-fixed") > 0 && 656 document.documentElement.clientWidth < 992 657 ) { 658 if (hasHeaderSix == false) { 659 for (bhscrl = 0; bhscrl < bannerBaseHeaderScrlLength; bhscrl++) { 660 var darkHeader = bannerBaseHeaderScrl[bhscrl] 661 .getAttribute("data-dark-part-applied") 662 .trim(); 663 if (darkHeader == "true") { 664 addClass(bannerBaseHeaderScrl[bhscrl], "zpdark-header-portion"); 665 } 666 if ( 667 darkHeader == "false" && 668 bannerBaseHeaderScrl[bhscrl].className.indexOf( 669 "zpdark-header-portion" 670 ) > -1 671 ) { 672 removeClass(bannerBaseHeaderScrl[bhscrl], "zpdark-header-portion"); 673 } 674 } 675 } 676 if (topBar && darkTopbar == "true") { 677 addClass(topBar, "zpdark-header-portion"); 678 } 679 if ( 680 topBar && 681 darkTopbar == "false" && 682 topBar.className.indexOf("zpdark-header-portion") > -1 683 ) { 684 removeClass(topBar, "zpdark-header-portion"); 685 } 686 } 687 } 688 689 // CURRENCY RESIZE 690 691 var currencyListContainer = document.querySelector( 692 "[data-theme-currency-list-ul]" 693 ); 694 if (currencyListContainer) { 695 var currencyListClick = document.querySelector( 696 "[data-theme-currency-list-container]" 697 ); 698 var currencyContainerHeight = document.querySelector( 699 "[data-theme-currency-list-container]" 700 ); 701 var currencyPlaceHeight = document.querySelector( 702 "[data-theme-currency-placeholder-non-res]" 703 ); 704 var curHeight = currencyListContainer.firstChild.clientHeight; 705 if (window.innerWidth > 992) { 706 if (curHeight != 0) { 707 currencyPlaceHeight.style.height = curHeight + "px"; 708 currencyContainerHeight.style.height = curHeight + "px"; 709 } 710 } else { 711 currencyPlaceHeight.style.height = "auto"; 712 currencyContainerHeight.style.height = "auto"; 713 } 714 if (window.innerWidth < 992) { 715 currencyListContainer.addEventListener("click", function () { 716 currencyListClick.removeEventListener("click", openCurrency); 717 }); 718 } else { 719 currencyListContainer.addEventListener("click", function () { 720 currencyListClick.removeEventListener("click", openCurrency); 721 currencyListClick.addEventListener("click", openCurrency); 722 }); 723 } 724 } 725 726 // CURRENCY RESIZE END 727 728 // EVENT DISPATCH FOR RESIZING 729 730 var event = new Event("zs:header:resize", {}); 731 document.dispatchEvent(event); 732 drawerPlugin(); 733 fullBannerHeaderColor(); 734 hideLang(); 735 mobileheader(); 736}); 737 738window.addEventListener("scroll", function (event) { 739 if (!body) { 740 VariableInit(); 741 } 742 if (!headerContainer) { 743 return; 744 } 745 if (!header) { 746 return; 747 } 748 headerHeight = header.clientHeight; 749 headercontainerHeight = headerContainer.clientHeight; 750 var hasHeaderSix = headerContainer.classList.contains("zpheader-style-06"); 751 headerContainerChildren = headerContainer.children; 752 headerContainerChildrenLength = headerContainerChildren.length; 753 offsetVal = window.pageYOffset; 754 755 bannerLiScroll = document.querySelectorAll('[data-element-type="heroslide"]'); 756 bannerLiScrollLength = bannerLiScroll.length; 757 bannerBaseHeaderScrl = document.querySelectorAll( 758 '[data-banner-base-header="theme-banner-base-header"]' 759 ); 760 bannerBaseHeaderScrlLength = bannerBaseHeaderScrl.length; 761 762 var menu = document.querySelector("[data-zp-theme-menu]"); 763 764 if (hasHeaderSix == false) { 765 for (bhscrl = 0; bhscrl < bannerBaseHeaderScrlLength; bhscrl++) { 766 var darkHeader = bannerBaseHeaderScrl[bhscrl] 767 .getAttribute("data-dark-part-applied") 768 .trim(); 769 } 770 } 771 772 // HEADER STATIC TO FIXED ANIMATION STARTS 773 774 if (offsetVal > headercontainerHeight) { 775 if (headerContainer.className.indexOf("theme-header-fixed") == -1) { 776 if (headerVal == "zptheme-data-header") { 777 if (header.className.indexOf("theme-header-animate") == -1) { 778 header.className += " theme-header-animate"; 779 } 780 } 781 if (headerVal == "zptheme-data-header-transparent") { 782 if (header.className.indexOf("theme-header-animate") == -1) { 783 header.className += " theme-header-animate"; 784 } 785 if (header.className.indexOf("theme-header-transparent") == -1) { 786 header.className += " theme-header-transparent";
787 } 788 } 789 header.setAttribute( 790 "style", 791 "animation:headerStart 0.8s linear 1 alternate" 792 ); 793 if ( 794 (headerVal == "zptheme-data-header" && window.innerWidth > 992) || 795 (headerVal == "zptheme-data-header-transparent" && 796 window.innerWidth > 992) 797 ) { 798 body.style.paddingTop = headerHeight + "px"; 799 } 800 } 801 if (topBar && window.innerWidth > 992) { 802 topBar.style.opacity = "0"; 803 } 804 if ( 805 menuParent && 806 searchCartScrollPosition && 807 headerSearchCart && 808 window.innerWidth > 992 && 809 (headerContainer.className.indexOf("theme-header-fixed") > -1 || 810 header.className.indexOf("theme-header-animate") > -1 || 811 headerContainer.className.indexOf("theme-header-animate") > -1) 812 ) { 813 searchCartScrollPosition.appendChild(headerSearchCart); 814 } 815 if ( 816 menuParent && 817 headerSearchCartPositionNonResponsive && 818 searchCartScrollPosition && 819 window.innerWidth > 992 820 ) { 821 menu && templateUti.dispatchEvent(menu, "zsMenu:rewrap"); 822 } 823 if (menuParent && searchCartScrollPosition && window.innerWidth > 992) { 824 addClass(menuParent, "theme-menu-align-left"); 825 } 826 } else { 827 if (headerVal == "zptheme-data-header") { 828 header.className = header.className.replace("theme-header-animate", ""); 829 } 830 if (headerVal == "zptheme-data-header-transparent") { 831 header.className = header.className.replace("theme-header-animate", ""); 832 header.className = header.className.replace( 833 "theme-header-transparent", 834 "" 835 ); 836 } 837 header.setAttribute( 838 "style", 839 "animation:noTopBarAni 0.8s linear 1 alternate;" 840 ); 841 body.style.paddingTop = "0px"; 842 if (topBar && window.innerWidth > 992) { 843 topBar.style.opacity = "1"; 844 } 845 if ( 846 menuParent && 847 headerSearchCartPositionNonResponsive && 848 searchCartScrollPosition && 849 window.innerWidth > 992 850 ) { 851 headerSearchCartPositionNonResponsive.appendChild(headerSearchCart); 852 menu && templateUti.dispatchEvent(menu, "zsMenu:rewrap"); 853 } 854 if (menuParent && searchCartScrollPosition && window.innerWidth > 992) { 855 removeClass(menuParent, "theme-menu-align-left"); 856 } 857 } 858 859 // HEADER STATIC TO FIXED ANIMATION END 860 861 // FULL WIDTH BANNER HEADER FIXED START 862 863 if (headerContainer.className.indexOf("theme-header-fixed") > 0) { 864 scrollTopVal = headercontainerHeight - headerHeight; 865 if (window.innerWidth > 992) { 866 headerContainer.setAttribute( 867 "style", 868 "top:" + -offsetVal + "px;transition:none;" 869 ); 870 } 871 if (offsetVal >= headercontainerHeight) { 872 headerContainer.className = headerContainer.className.replace( 873 "theme-header-animate", 874 "" 875 ); 876 if (headerVal == "zptheme-data-header") { 877 headerContainer.className += " theme-header-animate"; 878 for (bnrScrl = 0; bnrScrl < bannerLiScrollLength; bnrScrl++) { 879 if ( 880 window.innerWidth > 992 && 881 darkHeader == "true" && 882 hasHeaderSix == false 883 ) { 884 for (bhscrl = 0; bhscrl < bannerBaseHeaderScrlLength; bhscrl++) { 885 addClass(bannerBaseHeaderScrl[bhscrl], "zpdark-header-portion"); 886 } 887 if ( 888 topBar && 889 topBar.className.indexOf("zpdark-header-portion") > -1 890 ) { 891 topBar.className = topBar.className.replace( 892 "zpdark-header-portion", 893 "" 894 ); 895 } 896 } 897 if ( 898 window.innerWidth > 992 && 899 darkHeader == "false" && 900 hasHeaderSix == false 901 ) { 902 for (bhscrl = 0; bhscrl < bannerBaseHeaderScrlLength; bhscrl++) { 903 removeClass( 904 bannerBaseHeaderScrl[bhscrl], 905 "zpdark-header-portion" 906 ); 907 } 908 } 909 } 910 if (window.innerWidth > 992) { 911 headerContainer.setAttribute( 912 "style", 913 "top:" + -scrollTopVal + "px;transition:0.3s linear;" 914 ); 915 } 916 } 917 header.className = header.className.replace( 918 "theme-header-transparent", 919 "" 920 ); 921 if (headerVal == "zptheme-data-header-transparent") { 922 headerContainer.className += " theme-header-animate"; 923 header.className += " theme-header-transparent";
924 925 for (bnrScrl = 0; bnrScrl < bannerLiScrollLength; bnrScrl++) { 926 if ( 927 window.innerWidth > 992 && 928 darkHeader == "true" && 929 hasHeaderSix == false 930 ) { 931 for (bhscrl = 0; bhscrl < bannerBaseHeaderScrlLength; bhscrl++) { 932 addClass(bannerBaseHeaderScrl[bhscrl], "zpdark-header-portion"); 933 } 934 if ( 935 topBar && 936 topBar.className.indexOf("zpdark-header-portion") > -1 937 ) { 938 topBar.className = topBar.className.replace( 939 "zpdark-header-portion", 940 "" 941 ); 942 } 943 } 944 if ( 945 window.innerWidth > 992 && 946 darkHeader == "false" && 947 hasHeaderSix == false 948 ) { 949 for (bhscrl = 0; bhscrl < bannerBaseHeaderScrlLength; bhscrl++) { 950 removeClass( 951 bannerBaseHeaderScrl[bhscrl], 952 "zpdark-header-portion" 953 ); 954 } 955 } 956 } 957 if (window.innerWidth > 992) { 958 headerContainer.setAttribute( 959 "style", 960 "top:" + -scrollTopVal + "px;transition:0.3s linear;" 961 ); 962 } 963 } 964 if (headerVal == "") { 965 if (window.innerWidth > 992) { 966 headerContainer.setAttribute("style", "top:" + -offsetVal + "px;"); 967 } 968 } 969 } 970 if (offsetVal < LastScrollVal) { 971 if (offsetVal < headercontainerHeight) { 972 if (headerVal == "") { 973 if (window.innerWidth > 992) { 974 headerContainer.setAttribute( 975 "style", 976 "top:" + -offsetVal + "px;transition:0s linear;" 977 ); 978 } 979 } else { 980 if (window.innerWidth > 992) { 981 headerContainer.setAttribute( 982 "style", 983 "top:" + -offsetVal + "px;transition:0.3s linear;" 984 ); 985 } 986 } 987 headerContainer.className = headerContainer.className.replace( 988 "theme-header-animate", 989 "" 990 ); 991 headerContainer.className = headerContainer.className.replace( 992 "theme-header-transparent", 993 "" 994 ); 995 for (bnrScrl = 0; bnrScrl < bannerLiScrollLength; bnrScrl++) { 996 var bannerDark = 997 bannerLiScroll[bnrScrl].classList.contains("zpdark-section"); 998 if ( 999 bannerLiScroll[bnrScrl].className.indexOf("zpdark-section") > -1 && 1000 hasHeaderSix == false && 1001 bannerLiScroll[bnrScrl].className.indexOf("curslide") > -1 && 1002 window.innerWidth > 992 1003 ) { 1004 for (bhscrl = 0; bhscrl < bannerBaseHeaderScrlLength; bhscrl++) { 1005 addClass(bannerBaseHeaderScrl[bhscrl], "zpdark-header-portion"); 1006 } 1007 if (topBar) { 1008 addClass(topBar, "zpdark-header-portion"); 1009 } 1010 } else if ( 1011 bannerDark == false && 1012 hasHeaderSix == false && 1013 bannerLiScroll[bnrScrl].className.indexOf("curslide") > -1 && 1014 window.innerWidth > 992 1015 ) { 1016 for (bhscrl = 0; bhscrl < bannerBaseHeaderScrlLength; bhscrl++) { 1017 removeClass( 1018 bannerBaseHeaderScrl[bhscrl], 1019 "zpdark-header-portion" 1020 ); 1021 } 1022 if ( 1023 topBar && 1024 topBar.className.indexOf("zpdark-header-portion") > -1 1025 ) { 1026 removeClass(topBar, "zpdark-header-portion"); 1027 } 1028 } 1029 } 1030 } 1031 } 1032 } 1033 1034 // FULL WIDTH BANNER HEADER FIXED END 1035 1036 LastScrollVal = offsetVal; 1037 1038 // EVENT DISPATCH FOR SCROLL 1039 1040 var event = new Event("zs:header:scroll", {}); 1041 document.dispatchEvent(event); 1042}); 1043 1044// ONSCROLL HEADER EFFECT END 1045 1046function toggleSearch(e) { 1047 elem = e || window.event; 1048 var elemParent = elem.closest("[data-zs-search-container]"); 1049 var searchcont = elemParent.querySelector( 1050 '[data-search="zptheme-search-container"]' 1051 ); 1052 var searchInput = elemParent.querySelector( 1053 '[data-search-input="zptheme-search-input"]' 1054 ); 1055 var searchHideOverlay = elemParent.querySelector( 1056 '[data-theme-search-overlay="theme-search-overlay"]' 1057 ); 1058 searchcont.style.display = "block"; 1059 searchHideOverlay.style.display = "block"; 1060 searchInput.focus(); 1061 searchHideOverlay.addEventListener("click", function () { 1062 searchcont.style.display = "none"; 1063 searchHideOverlay.style.display = "none"; 1064 searchInput.value = ""; 1065 }); 1066} 1067 1068function toggleMenu(){ 1069 let menuContainer = document.querySelector('[data-megamenu-content-container'); 1070 if(menuContainer){ 1071 menuContainer.classList.toggle('theme-open-menu'); // No I18N 1072 } 1073} 1074 1075var templateUti = { 1076 dispatchEvent: function (ctx, customEventType, details, capture) { 1077 function createCustomEvent(details) { 1078 var ev = null; 1079 1080 if (typeof CustomEvent === "function") { 1081 ev = new CustomEvent(customEventType, { 1082 detail: details, 1083 bubbles: true, 1084 capture: !!capture, 1085 }); 1086 } else { 1087 ev = document.createEvent("CustomEvent"); 1088 1089 ev.initCustomEvent(customEventType, true, true, details); 1090 } 1091 1092 return ev; 1093 } 1094 1095 if (typeof ctx === "string") { 1096 capture = details; 1097 details = customEventType; 1098 customEventType = ctx; 1099 ctx = document.body; 1100 } 1101 1102 var evt = createCustomEvent(details); 1103 1104 ctx.dispatchEvent(evt); 1105 }, 1106}; 1107function mobileheader() { 1108 if (document.documentElement.clientWidth < 992) { 1109 if ( 1110 mobileHeaderStyle == "03" || 1111 mobileHeaderStyle == "04" || 1112 mobileHeaderStyle == "05" 1113 ) { 1114 var mobileHeaderSearchInput = document.querySelector( 1115 "[data-zs-mobile-header-search] [data-zs-search-input]" 1116 ), 1117 mobileHeaderSearchIcon = document.querySelector( 1118 "[data-zs-mobile-header-search-icon]" 1119 ), 1120 mobileHeaderSearchBackButton = document.querySelector( 1121 "[data-zs-mobile-header-search-back]" 1122 ), 1123 mobileHeaderSearchClearButton = document.querySelector( 1124 "[data-zs-mobile-header-search-clear]" 1125 ), 1126 mobileHeaderClearSearchInput = ""; 1127 if (window.location.href.indexOf("search-products") > -1) { 1128 var mobileHeaderSearch = document.querySelector( 1129 "[data-zs-mobile-header-search]" 1130 ); 1131 if (mobileHeaderSearch) { 1132 mobileHeaderSearch.classList.add("theme-mobile-header-search-open"); 1133 } 1134 if (mobileHeaderSearchBackButton) { 1135 mobileHeaderSearchBackButton.addEventListener("click", function () { 1136 history.go(-1); 1137 }); 1138 } 1139 } 1140 if (mobileHeaderSearchInput) { 1141 mobileHeaderSearchInput.addEventListener("keyup", function () { 1142 if (this.value) { 1143 this.closest("[data-zs-mobile-header-search]").querySelector( 1144 "[data-zs-mobile-header-search-clear]" 1145 ).style.display = "block"; 1146 } else { 1147 this.closest("[data-zs-mobile-header-search]").querySelector( 1148 "[data-zs-mobile-header-search-clear]" 1149 ).style.display = "none"; 1150 } 1151 }); 1152 } 1153 if (mobileHeaderSearchIcon) { 1154 mobileHeaderSearchIcon.addEventListener("click", function () { 1155 this.closest("[data-zs-mobile-header-search]").classList.add( 1156 "theme-mobile-header-search-open" 1157 ); 1158 this.closest("[data-zs-mobile-header-search]") 1159 .querySelector("[data-zs-search-input]") 1160 .focus(); 1161 this.closest("[data-zs-mobile-header-search]").querySelector("[data-zs-search-input]").value = "";// No I18N 1162 }); 1163 } 1164 if (mobileHeaderSearchBackButton) { 1165 mobileHeaderSearchBackButton.addEventListener("click", function () { 1166 this.closest("[data-zs-mobile-header-search]").classList.remove( 1167 "theme-mobile-header-search-open" 1168 ); 1169 }); 1170 } 1171 if (mobileHeaderSearchClearButton) { 1172 mobileHeaderSearchClearButton.addEventListener("click", function () { 1173 mobileHeaderClearSearchInput = this.closest( 1174 "[data-zs-mobile-header-search]" 1175 ).querySelector("[data-zs-search-input]"); 1176 mobileHeaderClearSearchInput.value = ""; 1177 mobileHeaderClearSearchInput.focus(); 1178 this.style.display = "none"; 1179 }); 1180 } 1181 var portalUserName = document.querySelector("[data-portal-profile]"), 1182 portalLogoutParent = document.querySelector("[data-portal-logout]"); 1183 if ( 1184 portalUserName && 1185 portalLogoutParent && 1186 portalLogoutParent.parentNode 1187 ) {
1188 portalUserName.appendChild(portalLogoutParent.parentNode); 1189 } 1190 drawerPlugin(); 1191 } else if (mobileHeaderStyle == "02") { 1192 var mobileHeaderOpenSearchInput = document.querySelector( 1193 "[data-zs-mobile-openstyle-searchbox] [data-zs-search-input]" 1194 ); 1195 if (mobileHeaderOpenSearchInput) { 1196 mobileHeaderOpenSearchInput.blur(); 1197 } 1198 var menuclose = document.querySelector("[data-zp-theme-burger-icon]"); 1199 if (menuclose && menuclose.classList.contains("theme-close-icon")) { 1200 menuclose.click(); 1201 } 1202 var standalone = 1203 window.navigator.standalone || 1204 window.matchMedia("(display-mode: standalone)").matches, 1205 userAgent = window.navigator.userAgent.toLowerCase(), 1206 safari = /safari/.test(userAgent), 1207 ios = /iphone|ipod|ipad/.test(userAgent); 1208 if (ios && !standalone && !safari) { 1209 //iOS webview check 1210 var ishome = window.location.pathname === "/" ? true : false; 1211 var mobileHeaderResponsiveGoBack = document.querySelector( 1212 "[data-zs-mobile-header-responsive-goback]" 1213 ), 1214 mobileHeaderBranding = document.querySelector("[data-zs-branding]"), 1215 mobileHeaderResponsiveMenuArea = document.querySelector( 1216 "[data-zs-responsive-menu-area]" 1217 ); 1218 if (ishome) { 1219 if (mobileHeaderResponsiveGoBack) { 1220 mobileHeaderResponsiveGoBack.style.display = "none"; 1221 } 1222 if (mobileHeaderBranding) { 1223 mobileHeaderBranding.style.display = "flex"; 1224 } 1225 if (mobileHeaderResponsiveMenuArea) { 1226 mobileHeaderResponsiveMenuArea.style.flex = ""; 1227 } 1228 } else { 1229 if (mobileHeaderResponsiveGoBack) { 1230 mobileHeaderResponsiveGoBack.style.display = "flex"; 1231 } 1232 if (mobileHeaderBranding) { 1233 mobileHeaderBranding.style.display = "none"; 1234 } 1235 if (mobileHeaderResponsiveMenuArea) { 1236 mobileHeaderResponsiveMenuArea.style.flex = "1 1 auto"; 1237 } 1238 } 1239 } 1240 } 1241 } 1242} 1243 1244function drawerPlugin() { 1245 var drawerPlugin = {}; 1246 drawerPlugin.init = function () { 1247 drawerPlugin.drawerWrapper = document.querySelector("[data-zs-drawer]"); 1248 drawerPlugin.drawerOpenButton = document.querySelectorAll( 1249 "[data-zs-drawer-open-button]" 1250 ); 1251 drawerPlugin.drawerCloseButton = document.querySelector( 1252 "[data-zs-drawer-close-button]" 1253 ); 1254 1255 if (drawerPlugin.drawerOpenButton) { 1256 drawerPlugin.drawerOpenButton.forEach(function (drawerOpenButton) { 1257 drawerOpenButton.addEventListener("click", function () { 1258 drawerPlugin.open(this.getAttribute("data-zs-drawer-open-button")); 1259 }); 1260 }); 1261 } 1262 if (drawerPlugin.drawerCloseButton) { 1263 drawerPlugin.drawerCloseButton.addEventListener("click", function () { 1264 drawerPlugin.close(); 1265 }); 1266 } 1267 }; 1268 drawerPlugin.open = function (targetContentSelector) { 1269 var targetContent = document.querySelector( 1270 "[data-zs-drawer-content=" + targetContentSelector + "]" 1271 ); 1272 if (targetContent && drawerPlugin.drawerWrapper) { 1273 drawerPlugin.drawerWrapper.classList.add("active"); 1274 targetContent.classList.add("active"); 1275 } 1276 document 1277 .getElementsByTagName("body")[0] 1278 .classList.add("theme-body-overflowhidden"); 1279 }; 1280 drawerPlugin.close = function () { 1281 var activeDrawerContent = document.querySelector( 1282 "[data-zs-drawer-content].active" 1283 ); 1284 if (activeDrawerContent && drawerPlugin.drawerWrapper) { 1285 drawerPlugin.drawerWrapper.classList.remove("active"); 1286 activeDrawerContent.classList.remove("active"); 1287 } 1288 document 1289 .getElementsByTagName("body")[0] 1290 .classList.remove("theme-body-overflowhidden"); 1291 }; 1292 drawerPlugin.init(); 1293} 1294 1295function displayMode() { 1296 var standalone = 1297 window.navigator.standalone || 1298 window.matchMedia("(display-mode: standalone)").matches, 1299 userAgent = window.navigator.userAgent.toLowerCase(), 1300 android = /android/.test(userAgent); 1301 (safari = /safari/.test(userAgent)), 1302 (ios = 1303 /iphone|ipod|ipad/.test(userAgent) || 1304 (navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1)), 1305 (webview = 1306 (android && /; wv\)/.test(userAgent)) || (ios && !standalone && !safari)), 1307 (displayMode = { 1308 standalone: standalone, 1309 isWebView: webview, 1310 platform: ios ? "ios" : android ? "android" : "other", 1311 });
1312 return displayMode; 1313} 1314function handleMenuKeydown(event) { 1315 const trigger = event.currentTarget; 1316 const submenuId = trigger.getAttribute('aria-controls'); 1317 const submenu = document.getElementById(submenuId); 1318 1319 if (submenu && (event.key === 'Enter' || event.key === ' ')) { 1320 event.preventDefault(); 1321 1322 let isExpanded = trigger.getAttribute('aria-expanded') === 'true'; 1323 submenu.style.display = isExpanded ? 'none' : 'block'; 1324 trigger.setAttribute('aria-expanded', String(!isExpanded)); 1325 } 1326} 1327document.addEventListener('focusin', (event) => { 1328 let menuContainer = document.querySelector('[data-zs-menu-container]'); 1329 if(menuContainer) { 1330 const openTriggers = menuContainer.querySelectorAll('[aria-haspopup="true"][aria-expanded="true"]'); 1331 openTriggers.forEach(trigger => { 1332 const submenuId = trigger.getAttribute('aria-controls'); 1333 const submenu = document.getElementById(submenuId); 1334 if (!trigger.contains(event.target) && !submenu.contains(event.target)) { 1335 trigger.setAttribute('aria-expanded', 'false'); 1336 submenu.style.display = 'none'; 1337 } 1338 }); 1339 } 1340 1341});
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.