1import{r,j as u}from"./vendors.BAJps33Q.chunk.js";import{o as c,Jh as We,Ji as qe,Jj as ze,Qf as Pe,cf as R,Qg as fe,dE as Ye,n as Ze,Qh as Xe,Hc as Ge,c8 as Ke,cd as et,f as S,Qi as tt,a4 as st,aU as rt,a7 as at,Ha as ct,Hb as nt,Qj as ot,Gz as it,ad as lt,a5 as ut,pq as mt,X as dt,ey as bt,fJ as kt,JY as pt,s as Se,bc as gt,sV as ht,bm as a,a6 as Lt,Qk as Pt,Ql as ft,Qm as St,Qn as Bt,Qo as yt,Qp as Ct,Qq as Be,Qr as ye,bD as se,Qs as Et,Df as Tt,Qt as Ft,Qu as Ce,sc as Dt,Qv as Rt,Qw as It,nD as vt,P as z,Qx as Ee,al as Te,b6 as wt,bB as Vt}from"./main.BhSogTmc.js";import{u as Qt}from"./useSchemaInHead.hook.LvP3lhtW.chunk.js";import{i as jt}from"./isTireFinderRecommendationComparisonPage.LyHjGJMX.chunk.js";const xt=()=>{const I=c(We),B=c(qe),y=c(ze),m=window.location.pathname;return r.useMemo(()=>{const[t]=m.split(Pe),k=[I,B,y].filter(Boolean);return k.map((L,C)=>{const p=k.length-C-R.ONE,Y=t.split(fe),g=Y.slice(0,Y.length-p).join(fe)+Pe;return{name:L,link:g}})},[I,B,y,m])},Nt=({...I})=>{const{currentPageName:B,currentPageLink:y,parentPages:m}=I,t=Ye(),k=Ze(),L=c(Xe),C=c(Ge),p=xt(),g=new URLSearchParams(window.location.search).get("isBuyNow")==="true",re=c(Ke),ae=r.useMemo(()=>new et,[]);r.useEffect(()=>{const e=[];S(m)&&(m.forEach(s=>{const{name:n="",link:l=""}=s;e.push({label:n,url:l})}),k(tt(e)))},[m,k]);const Fe=c(st),v=c(rt),De=c(at),w=c(ct),ce=nt(),ne=r.useMemo(()=>ot(w.tireFinderLink,w.resultsLink),[w.resultsLink,w.tireFinderLink]),{facets:E,saleItem:V,sortBy:T,inStockAtMyStore:Q,breadcrumbList:j,clearUrl:oe}=c(it),ie=lt(Fe),Z=c(ut),F=c(mt),X=t===a.packageLanding,[G,Re]=r.useState([]),[h,Ie]=r.useState([]),[le,K]=r.useState(!1),{breadcrumb:x={},globalLinks:ve={},accessibility:we,buyNow:Ve={},tireFinder:Qe={},featureFlag:je={}}=c(dt),xe=c(bt),Ne=c(kt),ue=c(pt),me=Se.getItem(gt)??"",ee=ht(),{enableBreadcrumbListSchemaInHead:N}=je,{backLabel:A,homeLabel:d,homeLink:M,backToLabel:de,backToSearchResults:U,displayProductName:O,backToResults:be,searchResultsLabel:H,backToCartLabel:ke}=x,{cartPageLink:pe}=ve,{backToProductLabel:ge}=Ve,he=r.useMemo(()=>({name:g&&a.checkout?ge:ke,link:g&&a.checkout?me:pe}),[ke,ge,pe,g,me]),_=c(Lt),[Ae,Me]=r.useState(null);r.useEffect(()=>{let e=null;if(_.length&&!Array.isArray(_[R.ZERO])){const s=_[R.ZERO].autoAttributes;s&&(e=s)}Me(e)},[_]);const P=Ae,i=r.useCallback((e,s)=>{const n=t===a.store?L:B,b={backLabel:A,backToResults:be,backToSearchResults:U,backToLabel:de,currentPageName:n,currentPageLink:y,homePageItem:{name:d,link:M},displayProductName:O,searchResultsLabel:H,isBackToSearchResults:s,backToCartItem:he},q={...b,breadcrumb:[...e,...p]},f={...b,breadcrumb:[...e,...p.slice(R.MINUS_ONE)]};Ie(Pt(q)),Re(ft(f))},[t,L,B,d,M,A,be,U,de,y,O,H,he,p]),$=r.useCallback(e=>St(e,ne,ce),[ce,ne]),o=r.useRef(R.ZERO),Ue=xe||Object.keys(Ne).length>0;r.useEffect(()=>{if(o.current===0&&t===a.pdpPage&&F.breadcrumbList&&d){const e=F.breadcrumbList.map(s=>({name:s.label,link:s.url}));K(!O),i(e),o.current=1}},[t,F,i,O,d]),r.useEffect(()=>{if(o.current===0&&t===a.plp&&S(j)){const e=$(j.filter(s=>s.type===Bt).map(s=>({name:s.value,link:s.url})));i(e),o.current=1}},[t,j,i,$]),r.useEffect(()=>{const e=E||T||V||Q;t===a.searchPage&&e&&(o.current=0)},[t,E,T,V,Q]),r.useEffect(()=>{if(o.current===0&&t===a.searchPage&&S(E)&&S(T)){const e=yt(E)||Ct(T)||Be(V)||Be(Q),s=[{name:H,link:M},{name:U,link:oe}];e&&K(!0),i(s,e),o.current=1}},[t,j,Q,U,oe,E,M,V,H,T,i]),r.useEffect(()=>{t===a.checkout&&K(!0)},[t]);const J=r.useCallback(e=>{const{name:s}=e,l=[P?.year,P?.make,P?.model,P&&s].join(" "),b=ye(l,""),f=ye((te=>te===null?"":[`${te.selectedDiameterValue}"`,`${Dt(te)}`,s].join(" "))(Z),"");switch(!0){case C:return e;case(ie&&!ue&&Z&&!X):return f;case(P&&!C):return b;default:return e}},[Z,P,ie,X,C,ue]),Oe=e=>{const s=Ce(e,x);return N||!s?null:u.jsx(Vt,{stringContent:`${s}`,children:n=>u.jsx("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:n}})})};r.useEffect(()=>{const e=a.categoryPages.includes(t)||t===a.tireFinder;if(o.current===0&&e&&se(v)&&d){const s=$(v.map(n=>({name:n.label,link:n.url})));i(s),o.current=1}},[t,v,i,d,$]),r.useEffect(()=>{o.current===0&&t===a.store&&L&&d&&(i(m),o.current=1)},[t,m,d,i,L]),r.useEffect(()=>{o.current===0&&Et()&&t!==a.tireFinder&&d&&(i(m),o.current=1)},[t,m,d,i]);const W=a.categoryPages.includes(t)&&se(v)&&De||X,He=t===a.pdpPage||t===a.plp||t===a.tireFinder,_e=Tt(),Le=jt()?Qe?.resultsLink?.link:void 0,D=r.useMemo(()=>
1{if(!S(G)||!S(h))return null;const[e={}]=h.slice(-1),s=W?J(e):e,n=Rt(t),[l,b]=Ft(n,G,h,s,A,p.length,Le);return{isBackUrl:n,fullMobileBreadcrumbsLinks:l,fullDesktopBreadcrumbsLinks:b}},[G,h,W,J,t,A,p,Le]),$e=r.useMemo(()=>!N||!D?null:Ce(D.fullDesktopBreadcrumbsLinks,x)||null,[D,x,N]);Qt($e,!!N,"BreadcrumbList"),r.useEffect(()=>{if(t===a.brandLandingPage||t===a.brandListingPage&&ee.length>0){const e=h[h.length-1],s=W?J(e):e,n={...F,brand:{label:s?.name??"",url:""}},l={userProfileData:re,schemaIds:ee,dispatch:k,categoryIdData:void 0,productData:n};ae.fetchTargetProductRecommendationData(l)}},[re,ee,t,h,W,J,F,ae,k]);const Je=()=>{const e=we?.a11yBreadcrumbLabel,s=g?Te.eventParameters.location.buyNowCheckoutBackToProduct:"",n=g?Te.event.buNowBackToProduct:"",l=!!RegExp(It).exec(window.location.href)||se(Se.getItem(vt.backToResultLink))&&t===a.pdpPage;if(D){const{isBackUrl:b,fullMobileBreadcrumbsLinks:q,fullDesktopBreadcrumbsLinks:f}=D;return u.jsxs(u.Fragment,{children:[_e?null:u.jsx("div",{className:`${z}-md-none`,children:u.jsx(Ee,{links:q,isLastElementInteractive:He?le:!0,showPipeIcon:l,breadCrumbLabel:e,analyticsLabel:s,analyticsValue:n})}),u.jsx("div",{className:`${z}-xs-none ${z}-md-block`,children:u.jsx(Ee,{links:f,isLastElementInteractive:b?!0:le,showPipeIcon:l,breadCrumbLabel:e,analyticsLabel:s,analyticsValue:n})}),Oe(f)]})}else return u.jsx(wt,{skeletonClass:`${z}-breadcrumbs__skeleton`,dataTestId:"breadcrumbSkeleton"})};return Ue?null:u.jsx(u.Fragment,{children:Je()})},_t={Breadcrumb:Nt};export{_t as default}; 2//# sourceMappingURL=breadcrumb.zRlDNGz0.chunk.js.map
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.