"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[85107],{5057:(e,t,a)=>{a.d(t,{T:()=>u,_:()=>d});var o=a(29747),n=a(14232),i=a(46605),l=a(82562),r=a(36307);let s=(0,r.q6)();function u(e){let{children:t}=e,a=function(){let[e,t]=(0,n.useState)(""),[a,o]=(0,n.useState)(!1),[r,s]=(0,n.useState)(!1),u=(0,n.useRef)(e),d=(0,n.useCallback)(()=>{o(!1)},[]),c=(0,n.useCallback)(()=>{t("")},[]),E=(0,n.useCallback)(()=>{s(!0)},[]),m=(0,n.useCallback)(()=>{!u.current&&e&&o(!0),u.current=e,s(!1)},[e]),v=(0,n.useCallback)(()=>{r&&(window.scrollTo(0,0),setTimeout(()=>{m()},i.E.MS300))},[r,m]);return(0,n.useEffect)(()=>(l.o.routeChangeComplete.on(v),r||m(),()=>{l.o.routeChangeComplete.off(v)}),[m,r,v]),{globalToastMessage:e,handleClearGlobalToastMessage:c,handleGlobalToastDismiss:d,handleShowToastOnNextPage:E,isGlobalToastOpen:a,setGlobalToastMessage:t}}();return(0,o.Y)(s.Provider,{value:a,"data-element":"unknown","data-component":"GlobalToastContextProvider",children:t})}let d=(e,t)=>(0,r.i7)(s,e,t)},13932:(e,t,a)=>{a.d(t,{Gs:()=>v,p0:()=>p});var o=a(29747),n=a(14e3),i=a(14232),l=a(87115),r=a(26779),s=a(79478),u=a(82562),d=a(36307),c=a(91066);let E=(0,d.q6)(),m=[s.ph[s.bw.CHECKOUT_SHIPPING],s.ph[s.bw.CHECKOUT_SERVICES],s.ph[s.bw.CHECKOUT_PAYMENT]];function v(e){let{children:t}=e,a=function(){let e=(0,r.A)(),t=(0,n.usePathname)(),[a,o]=(0,i.useState)(!(0,c.f5)(t)),[s,d]=(0,i.useState)(!1),[E,v]=(0,i.useState)(""),[p,S]=(0,i.useState)(""),[T,I]=(0,i.useState)(l.o.DEFAULT);(0,i.useEffect)(()=>{let e=e=>{let{isVisible:t}=e;(0,i.startTransition)(()=>{o(t)})};return u.o.setNavVisibility.on(e),()=>{u.o.setNavVisibility.off(e)}},[]);let _=(0,i.useCallback)(a=>{t!==m[a]&&e.push(m[a])},[e,t]),g=(0,i.useCallback)(e=>()=>{v(t=>{let a=t;t||(a=l.T.BROWSE_TIRES);let o=t===l.T.LEARN;return S(o?l.T.LEARN:e),o&&(a=l.T.LEARN),a})},[]),f=(0,i.useCallback)(e=>"target"in e?()=>{e&&(null==e?void 0:e.target)===l.T.BROWSE_TIRES&&S("Brand"),d(!0),v(e.target)}:void 0,[]),C=(0,i.useCallback)(()=>{S(e=>""!==e?"":e),v(e=>""!==e?"":e)},[]),R=(0,i.useCallback)(()=>{v(e=>""!==e?"":e)},[]),w=(0,i.useCallback)(()=>{d(!1)},[]);return{activeCategory:p,activeLink:E,createSelectCategoryHandler:g,createSelectLinkHandler:f,handleClearCategory:C,handleClearLink:R,handleCloseSubNav:w,isSubNavOpen:s,isVisible:a,navigateToStep:_,setActiveLink:v,setIsVisible:o,setNavTheme:(0,i.useCallback)(e=>{I(t=>t!==e?e:t)},[]),theme:T,toggleSubNav:(0,i.useCallback)(()=>{d(e=>!e)},[])}}();return(0,o.Y)(E.Provider,{value:a,"data-element":"unknown","data-component":"NavContextProvider",children:t})}let p=(e,t)=>(0,d.i7)(E,e,t)},42330:(e,t,a)=>{var o;a.d(t,{l:()=>n}),a(99742);let n={DEFAULT_ZOOM_LEVEL:13,GOOGLE_API_KEY:(o="AIzaSyBvMeJJOTIcPWeZiaLjnf0bTfo4Se7koFY",void 0!==o)?o:"",MARKER_ICON_PATH:"/static/assets/pdp/marker.png",MARKER_SMALL_ICON_PATH:"/static/assets/pdp/marker-small.png",MAX_ZOOM_LEVEL:21,MIN_ZOOM_LEVEL:1}},42507:(e,t,a)=>{a.d(t,{S:()=>o});let o=e=>{var t;return null===(t=e.find(e=>e.types.includes("postal_code")))||void 0===t?void 0:t.long_name}},49478:(e,t,a)=>{a.d(t,{HU:()=>r,IC:()=>s});var o=a(29747),n=a(14232),i=a(36307);let l=(0,i.q6)();function r(e){let{children:t}=e,a=function(){let[e,t]=(0,n.useState)(!1),a=(0,n.useCallback)(()=>{new window.google.maps.Geocoder,t(!0)},[]);return(0,n.useEffect)(()=>{window.initGoogleMap=a},[a]),{isGoogleMapScriptLoaded:e}}();return(0,o.Y)(l.Provider,{value:a,"data-element":"unknown","data-component":"GoogleMapScriptContextProvider",children:t})}let s=(e,t)=>(0,i.i7)(l,e,t)},49801:(e,t,a)=>{a.d(t,{FU:()=>i,rH:()=>s,wg:()=>l});var o=a(42507),n=a(42330);let i={SCRIPT_SRC:"https://maps.googleapis.com/maps/api/js?key=".concat(n.l.GOOGLE_API_KEY,"&loading=async&callback=initGoogleMap&libraries=places"),SCRIPT_ID:"google-maps-apis"},l=e=>{let{latitude:t,longitude:a}=e;return new Promise((e,n)=>{var i,l,r;(null===(r=window)||void 0===r?void 0:null===(l=r.google)||void 0===l?void 0:null===(i=l.maps)||void 0===i?void 0:i.Geocoder)||n(null),new window.google.maps.Geocoder().geocode({location:{lat:t,lng:a}},(t,a)=>{if(a===window.google.maps.GeocoderStatus.OK&&(null==t?void 0:t.length)){let a=t[0]&&t[0].address_components.length?(0,o.S)(t[0].address_components):null;return a?e({id:t[0].place_id,main:a}):n(null)}})})},r=e=>new Promise((t,a)=>{var o,n,i;(null===(i=window)||void 0===i?void 0:null===(n=i.google)||void 0===n?void 0:null===(o=n.maps)||void 0===o?void 0:o.Geocoder)||a(null),new window.google.maps.Geocoder().geocode({address:e},(e,o)=>{o===window.google.maps.GeocoderStatus.OK&&e?t(e):a("Geocode failed: ".concat(o))})}),s=e=>r("".concat(e," us zipcode"))},50220:(e,t,a)=>{a.d(t,{ts:()=>h,CN:()=>y});var o=a(29747),n=a(89617),i=a.n(n),l=a(14e3),r=a(14232),s=a(98123),u=a(80912),d=a(3297),c=a(52980),E=a(49801),m=a(78096),v=a(83962),p=a(25838),S=a(70266);let T=(e,t)=>{(0,S.X)(p.g.LOCATION_POPUP,{Allow:e,"Dont Allow":t})},I=e=>(0,v.c)(new Date(e.timestamp),new Date)>90,_=()=>new Promise((e,t)=>{if(!navigator.geolocation)return;let a=i().get(u.W[u.y.BROWSER_LOCATION_PERMISSION]),o=new Date,n={miliseconds:o.getTime(),timeAsString:o.toUTCString()},l={allow:()=>({formattedTimestamp:n.timeAsString,response:"allow",timestamp:n.miliseconds}),declined:e=>({formattedTimestamp:e?new Date(e).toUTCString():n.timeAsString,response:"denied",timestamp:e||n.miliseconds,isExpired:!1})};navigator.geolocation.getCurrentPosition(function(t){let{coords:{latitude:o,longitude:n}}=t;T(!0,!1);let r={latitude:o,longitude:n};if(i().set(u.W[u.y.BROWSER_LOCATION_DATA],r),c.A.addToDataLayer({event:"isGeolocation",lat:o,lng:n}),a){e(r);return}i().set(u.W[u.y.BROWSER_LOCATION_PERMISSION],l.allow()),e(r)},function(e){if(1==e.code){let o=a&&I(a)?{...a,isExpired:!0}:l.declined(a?a.timestamp:null);T(!1,!0),i().remove(u.W[u.y.BROWSER_LOCATION_DATA]),i().set(u.W[u.y.BROWSER_LOCATION_PERMISSION],o),t({errorCode:e.code,isDenied:!0})}else t({errorCode:e.code,isDenied:!0})})});var g=a(32384),f=a(36307),C=a(91066),R=a(20721),w=a(84859),A=a(49478),L=a(88772);let O={VEHICLE_METADATA_KEY:u.W[u.y.VEHICLE_METADATA],USER_LOCATION_ZIP_KEY:u.W[u.y.USER_LOCATION_ZIP]},P=(0,f.q6)();function h(e){let{children:t}=e,a=function(){let e=(0,w._)(e=>e.userIp),t=(0,A.IC)(e=>e.isGoogleMapScriptLoaded),a=(0,L.J)(e=>e.updateLocation),o=(0,l.usePathname)(),n=(0,C.Z4)(o),[v,p]=(0,r.useState)(!1),[S,T]=(0,r.useState)(!1),f=(0,r.useRef)(!1),P=(0,w._)(e=>1===Number(e.isSimpleShop)),h=(0,r.useCallback)(async()=>{try{g._v.removeItem(d.v[d.y.BROWSER_LOCATION_REQUEST_DISABLED]),f.current=!0;let t=await _();if(t)if(t.isDenied)1===t.errorCode?e&&e!==s.Ch&&(a({userLocationGooglePlacesId:"",userLocationZip:"",userIp:e}),i().set(u.W[u.y.ZIP_SET_BY],"ip"),c.A.addToDataLayer({event:"isServerlocation",zip:e,source:"userIp"})):(2===t.errorCode&&T(!0),p(!0));else try{let e=await (0,E.wg)(t);e&&a({userLocationGooglePlacesId:e.id,userLocationZip:e.main})}catch(e){m.A.error("updateUserZipFromLatLng",e)}}catch(e){m.A.error("updateLocationFromBrowser",e)}},[e,a]);return(0,r.useEffect)(()=>{var e;if((0,R.M8)()||P||(null!==(e=i().get(O.USER_LOCATION_ZIP_KEY))&&void 0!==e?e:null))return;let a=i().get(u.W[u.y.BROWSER_LOCATION_PERMISSION]);(!a||I(a))&&t&&!f.current&&(n?g._v.setItem(d.v[d.y.BROWSER_LOCATION_REQUEST_DISABLED],"true"):h())},[t,h,n,P]),{browserLocationFailed:S,hideUseCurrentLocation:v,setBrowserLocationFailed:T}}();return(0,o.Y)(P.Provider,{value:a,"data-element":"unknown","data-component":"UserLocationContextProvider",children:t})}let y=(e,t)=>(0,f.i7)(P,e,t)},64673:(e,t,a)=>{a.d(t,{OF:()=>E,Qz:()=>m});var o=a(29747),n=a(14232),i=a(84859),l=a(75482),r=a(3297),s=a(32384),u=a(36307),d=a(30903);let c=(0,u.q6)();function E(e){let{children:t}=e,a=function(){let{isSimpleShop:e}=(0,i._)(e=>({isSimpleShop:Number(e.isSimpleShop)})),[t,a]=(0,n.useState)(),o=(0,n.useCallback)(async()=>{let e=await (0,l.s)({query:{identifier:"simpleshop",subDomain:(0,d.tm)()?window.location.origin:"https://steer-simpleshop-opt-2482-alt-simpletire.vercel.app"}});e.isSuccess&&(s._v.setItem(r.v[r.y.WIDGET_SOURCE_ID],String(e.data.id)),a(e.data))},[]);return(0,n.useEffect)(()=>{e&&o()},[e,o]),{widgetAppConfig:t}}();return(0,o.Y)(c.Provider,{value:a,"data-element":"unknown","data-component":"WidgetConfigProvider",children:t})}let m=(e,t)=>(0,u.i7)(c,e,t)},72370:(e,t,a)=>{a.d(t,{I4:()=>R,FF:()=>w});var o=a(29747),n=a(14232),i=a(6833),l=a(84859),r=a(88772),s=a(52986),u=a(84991),d=a(45738),c=a(79478),E=a(3297),m=a(78096),v=a(32384),p=a(36307),S=a(91066),T=a(76709),I=a(34251),_=a(9012),g=a(96920);function f(e){return e.map(e=>{var t,a,o,n;return{address:{addressLine1:e.addressLine1,addressLine2:e.addressLine2,city:e.city,distance:e.distance,geolocation:e.geolocation,state:e.state,zip:e.zip},dataComponent:"area-installer-shop",id:e.installerId,logoSrc:e.logo.src,name:e.company,numberOfPeople:e.installationHistoryCount,price:e.priceList.length?e.priceList[0]:void 0,review:{numberOfReviewer:(null===(t=e.rating)||void 0===t?void 0:t.quantity)?e.rating.quantity:0,rate:(null===(a=e.rating)||void 0===a?void 0:a.value)?e.rating.value:0,type:null===(o=e.rating)||void 0===o?void 0:o.type,url:null===(n=e.rating)||void 0===n?void 0:n.url},...e}})}let C=(0,p.q6)();function R(e){let{children:t}=e,a=function(){let e=(0,l._)(e=>1===Number(e.isSimpleShop)),t=v._v.getItem(E.v.INSTALLER_IDS),a=v._v.getItem(E.v.INSTALLER_ID_SELECTED),o=a&&(null==t?void 0:t.includes(a)),p=v._v.getItem(E.v.PRE_SELECTED_INSTALLER_TYPE),C=v._v.getItem(E.v.IS_MOBILE_INSTALL),R=(0,r.J)(e=>{var t,a;return null===(a=e.userPersonalizationData)||void 0===a?void 0:null===(t=a.userLocation)||void 0===t?void 0:t.zip}),w=(0,I.W)(e=>e.selectedTab),[A,L]=(0,n.useState)(!1),[O,P]=(0,n.useState)(""),[h,y]=(0,n.useState)(),[b,N]=(0,n.useState)(!1),{setSelectedInstaller:M,selectedInstaller:k}=(0,T.uF)(e=>({selectedInstaller:e.selectedInstaller,setSelectedInstaller:e.setSelectedInstaller})),D=(0,_.Hq)(e=>e.setSelectedShopOnCatalog),[H,U]=(0,n.useState)(!1),[G,W]=(0,n.useState)(!1),Y=(0,s.M)(R,!0),B=(0,n.useMemo)(()=>e?null===a?C||"false":o&&C||"false":Y?"false":w==i.Si.MOBILE||"true"===p?"true":"false",[C,o,e,a,p,w,Y]),q=(0,n.useMemo)(()=>{let e=h&&(null==h?void 0:h.find(e=>e.id===(a||(null==t?void 0:t.split(",")[0]))));return e||h&&(null==h?void 0:h.find(t=>t.id===e))},[a,t,h]),V=(0,n.useMemo)(()=>q&&h?[q,...h.filter(e=>e.id!==q.id)]:h,[q,h]),F=(0,n.useMemo)(()=>k||a||t,[k,a,t]),K=(0,n.useCallback)(async()=>{N(!0);try{let o=window.location.pathname,n=new URLSearchParams(window.location.hash),i=o===c.ph[c.bw.HOME],l=(0,S.E8)(o,c.ro),r=(0,S.E8)(o,c.G5)||(0,S.E8)(o,c.Mu)&&n.has("tireSize"),s=(0,S.f5)(o),m={query:{}},p={mobileInstall:B,installerIds:t||""};if(l)p.dominantSubType=v._v.getItem(E.v.DOMINANT_SUBTYPE)||"",p.source=g.u.CATALOG;else if(i)p.source=g.u.HOME;else if(r){var e,a;p.brand=null!==(e=n.get("brand"))&&void 0!==e?e:"",p.frontQuantity="",p.itemId=null!==(a=n.get("itemid"))&&void 0!==a?a:"",p.productQuantity="",p.productSubType="",p.rearQuantity="",p.source=g.u.PDP,m.includeUserTime=!0}else s||(p.source=g.u.TIRE_SHOPS);if(m.query=p,l){let e=await (0,u.M)(m);e.isSuccess&&(e.data.installers.siteInstallers.siteInstallerList&&y(f(e.data.installers.siteInstallers.siteInstallerList)),N(!1))}else if(i||r||!s){let e=await (0,d.R)(m);e.isSuccess&&(e.data.siteInstallers.siteInstallerList&&y(f(e.data.siteInstallers.siteInstallerList)),N(!1))}}catch(e){m.A.error(e)}finally{N(!1)}},[B,t]),Q=(0,n.useCallback)(async e=>{v._v.setItem(E.v[E.y.INSTALLER_ID_SELECTED],e),M(e),W(!1)},[W,M]);return(0,n.useEffect)(()=>{q?(v._v.setItem(E.v.INSTALLER_ID_SELECTED,null==q?void 0:q.id),M(null==q?void 0:q.id),D(q)):(M(""),D(void 0))},[q,M,D]),(0,n.useEffect)(()=>{F&&R&&K()},[K,F,R]),{defaultSelectedInstaller:q,isAllInstallationShopsModalOpen:G,isInstallationShopDetailsModalOpen:H,isLoading:b,isLocationModalOpen:A,onSelectInstaller:Q,setInstallationShopDetailsModalOpen:U,setIsAllInstallationShopsModalOpen:W,setIsLocationModalOpen:L,setShopIdOfDetailsModal:P,shopIdOfDetailsModal:O,sortedShopsList:V}}();return(0,o.Y)(C.Provider,{value:a,"data-element":"unknown","data-component":"SelectedInstallerContextProvider",children:t})}let w=(e,t)=>(0,p.i7)(C,e,t)},72480:(e,t,a)=>{a.d(t,{a:()=>f,n:()=>C});var o=a(29747),n=a(89617),i=a.n(n),l=a(14232),r=a(72747),s=a(80912),u=a(79478),d=a(46605),c=a(82562);let E={LINK:"LINK",META:"META"},m={HREF:"href"},v={CHARSET:"charset",HTTP_EQUIV:"http-equiv",NAME:"name",PROPERTY:"property"},p={[m.HREF]:"link",[v.CHARSET]:"meta",[v.HTTP_EQUIV]:"meta",[v.NAME]:"meta",[v.PROPERTY]:"meta"};function S(e,t){return e&&e.getAttribute(t)&&e.getAttribute(t)||""}let T=()=>{let e={},t=(document.querySelector("head")?Array.from(document.querySelector("head").children):[]).filter(e=>e.nodeName===E.META||e.nodeName===E.LINK);t.length&&(t.forEach(t=>{let a=t.nodeName===E.META,o=t.nodeName===E.LINK;a&&S(t,v.CHARSET)&&!e[S(t,v.CHARSET)]?e[S(t,v.CHARSET)]=v.CHARSET:a&&S(t,v.HTTP_EQUIV)&&!e[S(t,v.HTTP_EQUIV)]?e[S(t,v.HTTP_EQUIV)]=v.HTTP_EQUIV:a&&S(t,v.PROPERTY)&&!e[S(t,v.PROPERTY)]?e[S(t,v.PROPERTY)]=v.PROPERTY:a&&S(t,v.NAME)&&!e[S(t,v.NAME)]?e[S(t,v.NAME)]=v.NAME:o&&S(t,m.HREF)&&!e[S(t,m.HREF)]&&(e[S(t,m.HREF)]=m.HREF)}),Object.keys(e).forEach(t=>{let a="".concat(p["".concat(e[t])],"[").concat(e[t],'="').concat(t,'"]'),o=document.querySelectorAll(a);o&&o.length>1&&o[1].remove()}))};var I=a(36307),_=a(91066);let g=(0,I.q6)();function f(e){let{children:t}=e,a=function(){var e;let t=null!==(e=(0,r.A)())&&void 0!==e?e:"",a=(0,l.useRef)(null),[o,n]=(0,l.useState)(!0),[E,m]=(0,l.useState)(u.ph[u.bw.HOME]),[v,p]=(0,l.useState)(u.ph[u.bw.HOME]),[S,I]=(0,l.useState)(!1),[g,f]=(0,l.useState)(!1),[C,R]=(0,l.useState)(!1),w=C&&t!==u.ph[u.bw.PRODUCT_DETAIL],A=(0,l.useCallback)(e=>{let{urlStr:a}=e,l="".concat(window.location.pathname).concat(window.location.search);if(f(!0),c.o.setNavVisibility.emit({isVisible:!1}),t===u.ph[u.bw.PRODUCT_DETAIL]&&window.location.href.replace("?","#")===a&&R(!0),a===l){setTimeout(()=>{c.o.routeChangeComplete.emit(e)},d.E.MS200);return}i().set(s.W[s.y.PREV_URL_FOR_ERROR_PAGE],a),m(l),p(t),o&&n(!1)},[t,o]),L=(0,l.useCallback)(e=>{let{urlStr:t}=e;if(f(!1),(0,_.f5)(t)||c.o.setNavVisibility.emit({isVisible:!0}),R(!1),!w){var o;null==a||null===(o=a.current)||void 0===o||o.focus()}T(),window&&window.Gladly&&window.Gladly.navigate&&window.Gladly.navigate()},[w]),O=(0,l.useCallback)(()=>R(!0),[]);return(0,l.useEffect)(()=>(c.o.routeChangeStart.on(A),()=>{c.o.routeChangeStart.off(A)}),[A]),(0,l.useEffect)(()=>(c.o.routeChangeComplete.on(L),()=>{c.o.routeChangeComplete.off(L)}),[L]),(0,l.useEffect)(()=>(c.o.newCatalogSearchQuery.on(O),c.o.skipPageTransition.on(O),()=>{c.o.newCatalogSearchQuery.off(O),c.o.skipPageTransition.off(O)}),[O]),{containerRef:a,isErrorPage:S,isFirstLoadedPage:o,isInRouteTransition:g&&!C,isRouteLoading:g,prevRoute:v,prevUrl:E,setIsErrorPage:I,skipPageTransition:C}}();return(0,o.Y)(g.Provider,{value:a,"data-element":"unknown","data-component":"RouterContextProvider",children:t})}let C=(e,t)=>(0,I.i7)(g,e,t)},75482:(e,t,a)=>{a.d(t,{s:()=>n});var o=a(86089);async function n(e){let{query:t}=e;return await (0,o.q$)({endpoint:"/widget-app-config",method:"get",query:t})}},84991:(e,t,a)=>{a.d(t,{M:()=>n});var o=a(86089);async function n(e){let{query:t}=e;return await (0,o.q$)({endpoint:"/installers-by-location",includeAuthorizationForAPIRoute:!0,includeUserRegion:!0,includeUserZip:!0,method:"get",query:t})}},98123:(e,t,a)=>{a.d(t,{Ch:()=>s,DB:()=>r,DY:()=>n,dy:()=>o,h_:()=>l,oT:()=>i});let o=a(46605).E.MS400,n=["/vehicles/[make]/[model]/[year]","/tire-sizes/[size]"],i=["skipGroups"],l=["category","subtype"],r="idMeCallback?",s="127.0.0.1"}}]);