PageSourceSearch

https://www.jared.com/scripts/left-navigation-bar.module-C37VYG3A.js

js jared.com collected 2026-09-25 20:43:13 UTC 10,183 bytes, 2 lines download raw bytes

1import{a as de}from"./chunk-FYFE7EGY.js";import{O as le,j as ae,k as re,l as se}from"./chunk-PLWO6N5B.js";import{a as C}from"./chunk-NYVODJB2.js";import{Qa as q}from"./chunk-JWTTV2TH.js";import"./chunk-HKNOB5YZ.js";import{A as ie,v as te,wa as ne,za as oe}from"./chunk-WFKL35DD.js";import"./chunk-2CBKXUP7.js";import{$c as ee,Aa as y,C as Q,Pa as Z,fa as X}from"./chunk-DM3NC7AB.js";import{$b as E,Ac as R,Ad as V,Bc as k,Cc as p,Dc as m,Ea as j,Ee as J,Fa as F,Hd as U,Ia as I,Id as G,Jb as s,K as T,Oe as K,Rc as h,Ub as P,Wb as l,X as g,a as D,ac as W,c as O,e as M,ed as b,fd as H,gd as $,o as c,uc as u,ve as Y,w as v,wc as S,x as B,y as A,yc as _,zc as x,zd as z}from"./chunk-WVBH4ZDA.js";import"./chunk-YDOXD4O3.js";var w=class{static buildState(t,e,n,o){if(t===void 0||e===void 0||n===void 0||o===void 0)return c(this.buildStateDefaults());let r=this.buildStateBuilderCombinedObservableStep1(t,e,n);return new O(f=>{r.pipe(A(a=>this.buildStateBuilderCombinedObservableStep2(e,o,a)),g(1)).subscribe({next:a=>{f.next({navNode:a.navNode,PageLabel:a.PageLabel,isAkronSite:a.isAkronSite,site:a.site,cmsNavigationBarData:{},isHeaderSticky:a.baseSiteData?.baseStore?.isHeaderSticky??!1,isLeftNavSticky:a.baseSiteData?.baseStore?.isLeftNavSticky??!1,baseStoreSiteData:a.baseSiteData??{},navBarIsHidden:a.isHidden}),f.complete()},error:a=>{throw new Error(a)}})})}static buildStateDefaults(){return{navNode:{},PageLabel:"",isAkronSite:!1,site:"",cmsNavigationBarData:{},isHeaderSticky:!1,isLeftNavSticky:!1,baseStoreSiteData:{},navBarIsHidden:!1}}static buildStateBuilderCombinedObservableStep1(t,e,n){return B([t,e.getActive(),n.getCurrentPage()]).pipe(v(o=>({cmsNavigationBarData:o[0],siteId:o[1],PageLabel:o[2]})))}static buildStateBuilderCombinedObservableStep2(t,e,n){let o=n.siteId==="kay"||n.siteId==="kayoutlet"||n.siteId==="jared";return B([e.getNavigationNode(c(n.cmsNavigationBarData)),c(n.PageLabel),c(o),c(n.siteId),t.get(n.siteId),c(n.cmsNavigationBarData?.Visible??!1)]).pipe(v(r=>({navNode:r[0],PageLabel:r[1]?.name??"",isAkronSite:r[2],site:r[3],baseSiteData:r[4],isHidden:r[5]})))}};var L=class i{constructor(t,e){this.rendererfactor=t;this.windowRef=e;this.leftNavigationStickyClass="left-navigation-sticky";this.StickyLeftNavClass="sticky-left-nav";this.leftNavigationStickyFloatRightClass="left-navigation-sticky-float-right";this.stickyNav={plpLeftNavId:"",contentLeftNavId:"",footer:"",headerHeight:0,topDisplacement:0,totalTopHeight:0,stickyBottomBannerHeight:"",leftNavHeight:""};this.renderer=t.createRenderer(null,null)}StickyLeftNav(t){this.isHeaderSticky=t,this.intializeVariable(this.stickyNav),this.calculateLeftNavTop(this.stickyNav),this.scrollLeftNav(this.stickyNav)}intializeVariable(t){if(t.plpLeftNavId=this.windowRef.document.querySelector(".sticky-left-nav"),t.contentLeftNavId=this.windowRef.document.querySelector(".categoryLanding")?.querySelector(".col-xs-12.col-md-9"),t.footer=this.windowRef.document.querySelector("footer"),t.headerHeight=this.windowRef.document.querySelector("header")?.getBoundingClientRect().height,window.innerWidth>=q.desktop){let e=t.plpLeftNavId.parentElement,n=e?.clientWidth?e.clientWidth/4:0;if(this.windowRef.document.querySelector("nav")?.querySelector(".content-left-nav")){let o=this.windowRef.document.querySelector(".content-left-nav");n=o?.clientWidth?Math.floor((o.clientWidth-1)/4):0}this.renderer.setStyle(t.plpLeftNavId,"width",n+"px")}}calculateLeftNavTop(t){let e=this.windowRef.document.querySelector(".inner-container"),n=this.windowRef.document.querySelectorAll(".inner-container .sticky-left-nav");if(e?.querySelector(".categoryLanding")&&n?.length>0){let o=this.windowRef.document.querySelector(".inner-container").offsetTop,r=t.plpLeftNavId.offsetTop;t.topDisplacement=r-o}}scrollLeftNav(t){let e=0;this.windowRef.document.querySelectorAll(".quiz-result-top-banner")?.length>0&&(e=this.windowRef.document.querySelector(".quiz-result-top-banner")?.getBoundingClientRect().height),window.addEventListener("scroll",()=>{let n=window.scrollY,o=t.plpLeftNavId.getBoundingClientRect(),r=this.windowRef.document.querySelectorAll(".sticky-left-nav").length;if(t.headerHeight=this.windowRef.document.querySelector("header")?.getBoundingClientRect().height,t.totalTopHeight=t.headerHeight+t.topDisplacement,window.innerWidth>q.screenSm){if(r>1&&(this.renderer.removeClass(this.windowRef.document.querySelector("nav"),this.StickyLeftNavClass),this.renderer.addClass(this.windowRef.document.querySelector("nav")?.closest(".column")?.querySelector(".col-md-3"),this.StickyLeftNavClass),t.plpLeftNavId=this.windowRef.document.querySelector(".col-md-3.sticky-left-nav")),this.isHeaderSticky&&this.windowRef.document.querySelectorAll("#bannerPlaceholder").length===1){t.stickyBottomBannerHeight=this.windowRef.document.querySelector(".stickyBottomBanner")?.getBoundingClientRect().height;let a=this.windowRef.document.querySelector("#bannerPlaceholder");this.renderer.setStyle(a,"height",t.stickyBottomBannerHeight+"px"),o=t.totalTopHeight-a.getBoundingClientRect().height}else o=o.top;if(n>=o+e){this.renderer.addClass(t.plpLeftNavId,this.leftNavigationStickyClass);let a=t.plpLeftNavId.parentElement;this.renderer.addClass(a.querySelector(".col-md-9"),this.leftNavigationStickyFloatRightClass),this.renderer.addClass(t.contentLeftNavId,this.leftNavigationStickyFloatRightClass),this.renderer.setStyle(t.plpLeftNavId,"bottom","");let d=this.windowRef.document.querySelector(".left-navigation-sticky");this.renderer.setStyle(d,"position","sticky"),this.renderer.setStyle(d,"top","10px"),this.renderer.setStyle(d,"max-height","600px"),this.renderer.setStyle(d,"height","auto"),this.renderer.setStyle(d,"overflow-y","auto")}t.totalTopHeight>n&&(this.renderer.removeClass(t.plpLeftNavId,this.leftNavigationStickyClass),this.renderer.setStyle(t.plpLeftNavId,"top",""),this.renderer.setStyle(t.plpLeftNavId,"overflow-y",""),this.renderer.setStyle(t.plpLeftNavId,"max-height",""),this.renderer.removeClass(t.plpLeftNavId.parentElement.querySelector(".col-md-9"),this.leftNavigationStickyFloatRightClass),this.renderer.setStyle(t.plpLeftNavId,"bottom",""));let f;if(!this.isHeaderSticky)if(window.screenY+window.innerWidth>t.footer.getBoundingClientRect().y)this.renderer.setStyle(t.plpLeftNavId,"margin","0px"),this.renderer.setStyle(t.plpLeftNavId,"top","0px"),this.renderer.setStyle(t.footer,"margin-top","0px"),this.renderer.setStyle(t.footer,"padding-top","0px"),f=this.windowRef.document.querySelector("footer")?.getBoundingClientRect().y,this.renderer.setStyle(t.plpLeftNavId,"max-height",f+"px");else{let a=parseInt(window.getComputedStyle(t.plpLeftNavId).marginTop),d=parseInt(window.getComputedStyle(t.plpLeftNavId).marginBottom);this.renderer.setStyle(t.plpLeftNavId,"max-height",window.outerHeight-a-d+"px")}}})}static{this.\u0275fac=function(e){return new(e||i)(I(P),I(y))}}static{this.\u0275prov=j({token:i,factory:i.\u0275fac,providedIn:"root"})}};var ve=i=>({"left-navigation--composable--hidden":i}),ue=()=>[];function Se(i,t){if(i&1&&(p(0,"div",1)(1,"h2"),b(2),m()()),i&2){let e=h();s(2),H((e==null?null:e.PageLabel)??"")}}function ge(i,t){if(i&1&&(p(0,"div",7)(1,"div",8)(2,"ul",9)(3,"li")(4,"cx-generic-link",10),b(5),m()()()()()),i&2){let e=t.$implicit;s(4),k("url",e.url??""),s(),H(e.title)}}function he(i,t){if(i&1&&(p(0,"div",6),b(1),x(2,ge,6,2,"div",7,_),m()),i&2){let e=h().$implicit;s(),$(" ",e.title," "),s(),R(e.children)}}function be(i,t){if(i&1&&u(0,he,4,1,"div",6),i&2){let e=t.$implicit;S(e.children&&e.children.length>0?0:-1)}}function ye(i,t){if(i&1&&(p(0,"div",5),x(1,be,1,1,null,null,_),m()),i&2){let e=h();s(),R((e==null||e.navNode==null?null:e.navNode.children)??z(0,ue))}}function Ce(i,t){if(i&1&&(p(0,"nav",0),u(1,Se,3,1,"div",1),p(2,"ul",2)(3,"li",3)(4,"div",4),u(5,ye,3,1,"div",5),m()()()()),i&2){let e=t;k("ngClass",V(3,ve,e==null||e.navBarIsHidden===!0)),s(),S(e!==null?1:-1),s(4),S(e!==null?5:-1)}}var N=class i{constructor(t,e,n,o,r,f,a,d){this.service=t;this.component=e;this.cmsService=n;this.siteService=o;this.stickyleftNavService=r;this.windowRef=f;this.loggerService=a;this.store=d;this.subscriptions$=new D;this.state$=new M(null)}get stateObs(){return this.state$.asObservable()}ngOnInit(){let t=this.store.select(le).subscribe({next:e=>{e!==void 0?this.state$.next(e):this.initState()},error:e=>{throw this.loggerService.error("Unable to get state from store",e),new Error(e)}});this.subscriptions$.add(t)}ngOnDestroy(){this.subscriptions$.unsubscribe()}ngAfterContentInit(){let t=this.state$.pipe(T(e=>e!==null),v(e=>e)).subscribe({next:e=>{e.isLeftNavSticky&&this.windowRef.isBrowser()&&this.stickyleftNavService.StickyLeftNav(e.isHeaderSticky)},error:e=>{throw this.loggerService.error("Unable to determine if left nav menu should be sticky",e),new Error(e)}});this.subscriptions$.add(t)}initState(){ae();let t=w.buildState(this.component.data$,this.siteService,this.cmsService,this.service).pipe(g(1)).subscribe({next:e=>{this.state$.next(e),this.store.dispatch(re({data:e}))},error:e=>{throw this.loggerService.error("Unable to build state for left nav bar",e),se({error:e}),new Error(e)}});this.subscriptions$.add(t)}static{this.\u0275fac=function(e){return new(e||i)(l(de),l(te),l(ee),l(Z),l(L),l(y),l(C),l(Q))}}static{this.\u0275cmp=E({type:i,selectors:[["app-left-navigation-bar"]],standalone:!1,decls:2,vars:3,consts:[["role","navigation","aria-label","PageLabel choices",1,"se-component","left-navigation","left-navigation--composable",3,"ngClass"],[1,"left-nav-header"],[1,"nav","nav-pills"],[1,"nav-link"],[1,"sub-menu"],[1,"row","se-component"],[1,"sub-navigation-section","text-left"],[1,"row"],[1,"sub-navigation-section-column"],[1,"sub-navigation-list"],[3,"url"]],template:function(e,n){if(e&1&&(u(0,Ce,6,5,"nav",0),U(1,"async")),e&2){let o;S((o=G(1,1,n.stateObs))?0:-1,o)}},dependencies:[Y,ne,J],styles:[`.left-navigation--composable--hidden{display:none}
2`],encapsulation:2})}};var pe=class i{static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275mod=W({type:i})}static{this.\u0275inj=F({providers:[C,X({cmsComponents:{LeftNavigationComponent:{component:N}}})],imports:[K,ie,oe]})}};export{pe as LeftNavigationBarModule};

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.