1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6281],{1799:(e,t,a)=>{"use strict";a.d(t,{GasStationComingSoonMessage:()=>c});var o=a(95155),i=a(27966),r=a(12158),l=a(24880),n=a(20115),s=a(40703),d=a(94571);let u="GasStationComingSoonMessage",c=({gasStationOnlyTitle:e,gasStationComingSoonLabel:t,warehouseData:a,messageDays:c,invokeSalesLocationsAPI:p,"data-testid":h})=>{let g=(0,d.N0)(a,p);if(g!==d.IZ.GAS_COMING_SOON)return console.warn(`${u}: Expected locationOpeningState '${d.IZ.GAS_COMING_SOON}' but received '${g}'. Component will not render.`),null;let f=(0,d.aG)(a,p),x=c.replace("xx",String(f));return(0,o.jsxs)(i.default,{sx:{display:"flex",flexDirection:"column",gap:l.iAn,margin:0},"data-testid":h??"gas-station-coming-soon-message",children:[(0,o.jsx)(i.default,{"data-testid":"gas-station-coming-soon-message-badge",children:(0,o.jsx)(s.GasStationBadge,{label:e})}),(0,o.jsxs)(i.default,{sx:{display:"flex",gap:l.iAn,alignItems:"center"},"data-testid":"gas-station-coming-soon-message-label",children:[(0,o.jsx)(n.J,{sx:{height:"20px",width:"20px",flexShrink:0,aspectRatio:"1/1",color:l.JHH},"data-testid":"gas-station-coming-soon-message-icon","aria-hidden":"true",focusable:"false"}),(0,o.jsxs)(i.default,{sx:{display:"flex",flexDirection:"column",gap:"2px"},children:[(0,o.jsx)(r.Text,{variant:"b2",sx:{color:l.JHH,lineHeight:"1.2",margin:0},children:t}),(0,o.jsx)(r.Text,{variant:"b2",sx:{color:l.JHH,lineHeight:"1.2",margin:0},children:x})]})]})]})};c.displayName=u},18573:(e,t,a)=>{"use strict";a.d(t,{default:()=>i});var o=a(12115);function i(){let[,e]=o.useState({});return o.useCallback(()=>{e({})},[])}},19841:(e,t,a)=>{"use strict";a.d(t,{z:()=>s});var o=a(7569),i=a(66775),r=a(12115),l=a(71706);let n=async(e,t,a)=>{let o=await e.getGeoServiceLocation(t);return o[0]?{latitude:o[0].latitude,longitude:o[0].longitude}:(a&&a(!0),null)},s=(e,t,a,s,d,u)=>{let c,{bdDeliveryLocation:p,thirdPartyInfo:h,userLocation:g}=(0,l.B)(),{stwPostalCode:f}=(0,i.P)(),{agent:x}=(0,o.useAgent)(),[m,v]=(0,r.useState)(void 0),b=(0,r.useRef)(!1);if(u)c=u;else if(s){let e=(null==g?void 0:g.zip)||h.akamaiZipCode||"";c=f||e}else c=(null==g?void 0:g.zip)||(null==p?void 0:p.zipCode)||((null==h?void 0:h.akamaiZipCode)&&((e,t)=>{try{return t.parse({zipCode:e}),!0}catch{return!1}})(h.akamaiZipCode,a)?h.akamaiZipCode:"")||"";return(0,r.useEffect)(()=>{let a=async a=>{if(!x)return;b.current=!0;let o={latitude:e,longitude:t};if(a)try{let e=await n(x,a,d);e&&(o=e)}catch(e){}v(e=>e&&e.latitude===o.latitude&&e.longitude===o.longitude?e:o),b.current=!1};b.current||a(c)},[x,e,t,c,d]),m}},22665:(e,t,a)=>{"use strict";a.d(t,{F:()=>r});var o=a(46759),i=a(92437);let r=({invokeSalesLocationsAPI:e=!1,warehouseData:t,warehousesPageBaseUrl:a})=>{var r,l;let n,s;if(!a||!(null==t?void 0:t.warehouseId))return null;let d=a.replace(/\/$/,""),u=(0,i.k)(t,{useSalesLocationsApi:e}),c=t.warehouseId,{city:p,territoryOrCountry:h}=(n=(null==(l=null==(r=t.address)?void 0:r.city)?void 0:l.toLowerCase().replace(/\s+/g,"-").replace(/\./g,""))||"-",{city:n,territoryOrCountry:(null==(s=(null==r?void 0:r.territory)||(null==r?void 0:r.countryName))?void 0:s.toLowerCase().replace(/\s+/g,"-"))||"-"}),g=`${d}/${h}/${p}`;return u===o.aN.BUSINESS_CENTER?`${g}/bd/${c}`:u===o.aN.SHOWROOM?`${g}/showroom/${c}`:u===o.aN.GAS_STATION_ONLY?`${d}/gas-station/${h}/${p}/${c}`:`${g}/${c}`}},25087:(e,t,a)=>{"use strict";a.d(t,{WarehouseComingSoonMessage:()=>d});var o=a(95155),i=a(27966),r=a(12158),l=a(24880),n=a(96736),s=a(94571);let d=({warehouseData:e,messageTitle:t,messageDays:a})=>{let d=(0,s.Af)(e.openingDate),u=a.replace("xx",String(d));return(0,o.jsxs)(i.default,{sx:{display:"flex",alignItems:"flex-start",gap:l.iAn,backgroundColor:l.DJJ},"data-testid":"warehouse-coming-soon-message",children:[(0,o.jsx)(n.Y,{sx:{height:"20px",width:"20px",color:l.JHH,flexShrink:0},"data-testid":"warehouse-coming-soon-message-icon","aria-hidden":"true",focusable:"false"}),(0,o.jsxs)(i.default,{sx:{display:"flex",flexDirection:"column",gap:"0px",margin:0},"data-testid":"warehouse-coming-soon-message-text-container",children:[(0,o.jsx)(r.Text,{variant:"b2",sx:{color:l.JHH,lineHeight:"1.2",margin:0},children:t}),(0,o.jsx)(r.Text,{variant:"b2",sx:{color:l.JHH,lineHeight:"1.2",margin:0},children:u})]})]})};d.displayName="WarehouseComingSoonMessage"},35138:(e,t,a)=>{"use strict";a.d(t,{BL:()=>h,DO:()=>p,Il:()=>f,Iq:()=>x,_H:()=>g,j8:()=>v,lG:()=>c,sd:()=>l,w3:()=>r,xg:()=>m});
1var o=a(22665),i=a(24880);function r(e,t,a,i){if(!e.length)return{warehouses:[],midpoint:null};let r=e.map(e=>{var t,r;let l=null;return a&&(l=(0,o.F)({invokeSalesLocationsAPI:i??!1,warehouseData:e,warehousesPageBaseUrl:a})),{warehouseId:e.warehouseId,name:(null==(r=null==(t=e.name)?void 0:t[0])?void 0:r.value)||"",coordinates:[e.address.latitude,e.address.longitude],city:e.address.city,state:e.address.territory,distance:e.distance,distanceUnit:e.distanceUnit,href:l}});if(t&&r.length>0&&r[0].warehouseId===t||1===r.length)return{warehouses:r,midpoint:r[0].coordinates};let l=r.map(e=>e.coordinates);return{warehouses:r,midpoint:function(e){if(!e.length)return null;let t=0,a=0,o=0;e.forEach(([e,i])=>{let r=e*Math.PI/180,l=i*Math.PI/180;t+=Math.cos(r)*Math.cos(l),a+=Math.cos(r)*Math.sin(l),o+=Math.sin(r)});let i=e.length;t/=i,a/=i,o/=i;let r=180/Math.PI*Math.atan2(a,t);return[180/Math.PI*Math.atan2(o,Math.sqrt(t*t+a*a)),r]}(l)}}function l(e,t){let a=window.Microsoft,o=t.entities.get(e-1);if(!o)return void console.warn(`Pushpin at index ${e} does not exist.`);try{null==a||a.Maps.Events.invoke(o,"click",{target:o})}catch(e){console.error("Failed to invoke click event on pushpin:",e)}}let n={warehouse:`<div class="Infobox "> 2 <div class="Infobox-body"> 3 <div class="Infobox-header"> 4 <div class="Infobox-title-content"> 5 <span> 6 <a href="{{href}}" data-automation-id="mapPopUpSelectedWarehouseName"> 7 {{locationName}} 8 </a> 9 ({{distance}} {{measure}}) 10 </span> 11 </div> 12 <button type="button" class="Infobox-close" aria-label="close" onclick="window.BingMapNamespace?.closeInfobox?.()" data-automation-id="mapPopUpCloseIconLink"> 13 <span class="co-close" aria-hidden="true"> 14 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="15px" height="15px" role="presentation" focusable="false" aria-hidden="true" color="#777"> 15 <path fill-rule="evenodd" clip-rule="evenodd" d="M21.799 19.932 13.866 12l7.932-7.932c.258-.258.27-.663.028-.905l-.989-.99c-.242-.24-.648-.229-.906.03L12 10.133 4.068 2.202c-.259-.258-.664-.27-.907-.029l-.988.99c-.243.242-.23.648.027.905L10.133 12l-7.93 7.932c-.259.258-.27.663-.029.905l.989.988c.241.244.648.23.904-.026L12 13.866l7.932 7.932c.258.258.663.27.905.027l.988-.988c.243-.242.232-.648-.026-.905Z" fill="currentColor"></path> 16 </svg> 17 </span> 18 </button> 19 </div> 20 </div> 21 </div>`},s={warehouse:`<svg width="21.37" height="30" xmlns="http://www.w3.org/2000/svg"><path id="warehouse-pin" fill="${i.iCb}" d="M9,0A8.9,8.9,0,0,0,1.9,14.2l5.7,9.9v0.2h0a1.6,1.6,0,0,0,2.5.1h0.1l0.2-.4,5.6-9.7A8.9,8.9,0,0,0,9,0ZM8.9,13.4A4.4,4.4,0,1,1,13.3,9,4.4,4.4,0,0,1,8.9,13.4Z"/></svg>`,locator:`<svg aria-hidden="true" focusable="false" width="21.37" height="30" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"><title>Pin</title><g><path d="m10.69,0a10.69,10.69 0 0 0 -8.56,17.08l6.85,11.92a1.93,1.93 0 0 0 0.13,0.22l0,0l0,0a1.92,1.92 0 0 0 3,0.12l0,0l0.07,-0.12a1.93,1.93 0 0 0 0.25,-0.44l6.72,-11.63a10.69,10.69 0 0 0 -8.46,-17.15z" fill="${i.iCb}"/><text xml:space="preserve" text-anchor="middle" font-weight="{{weight}}" font-family="Costco Sans Web, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, sans-serif" font-size="16" y="18" x="10.684998" stroke-width="0" fill="white">{{number}}</text></g></svg>`};function d(e,t){return e.replace(/\{\{(\w+)\}\}/g,(e,a)=>String(t[a]||""))}function u(e){return d(n.warehouse,{locationName:e.locationName,distance:e.distance,measure:e.measure||"mi",href:e.href||"#"})}let c=(e,t,a,o,i,r,l)=>{if(e.current&&window.Microsoft){let n=new window.Microsoft.Maps.Map(e.current,{credentials:t,center:new window.Microsoft.Maps.Location(a[0],a[1]),zoom:o,enableHighDpi:!0,liteMode:!0,navigationBarMode:window.Microsoft.Maps.NavigationBarMode.minified,mapTypeId:i||window.Microsoft.Maps.MapTypeId.road,showTrafficButton:!1});r(n),l&&l(n)}},p=(e,t)=>{if(e&&window.Microsoft){let a=new window.Microsoft.Maps.Location(t[0],t[1]);e.setView({center:a})}},h=(e,t,a)=>{if(!e||!window.Microsoft||!t.length)return;let o=window.Microsoft;if(1===t.length){let i=new o.Maps.Location(t[0].coordinates[0],t[0].coordinates[1]);e.setView({center:i,zoom:a});return}let i=t.map(e=>new o.Maps.Location(e.coordinates[0],e.coordinates[1])),r=o.Maps.LocationRect.fromLocations(i);e.setView({center:e.getCenter(),bounds:r,padding:48})},g=(e,t,a,o)=>
21{if(e&&window.Microsoft){if(t&&t.length>0&&(t.forEach(t=>{try{e.entities.remove(t)}catch{}}),a([])),o)try{o.setOptions({visible:!1})}catch{}try{let t=new window.Microsoft.Maps.Location(37.0902,-95.7129);e.setView({center:t,zoom:3})}catch{}}},f=(e,t)=>()=>{t.current.forEach(e=>{var t;(null==(t=e.metadata)?void 0:t.infobox)&&e.metadata.infobox.setOptions({visible:!1})}),e(null)},x=(e,t,a,o,i,r,l,n)=>{if(!e||!window.Microsoft||!i.length)return;let c=window.Microsoft;t.length>0&&t.forEach(t=>e.entities.remove(t));let p="tmpl_warehouse_pin"===o?v():null,h=i.length>1,g=i.map((e,t)=>{var a,o;let i=new c.Maps.Location(e.coordinates[0],e.coordinates[1]),g=p||(o={number:t+1,weight:300},d(s.locator,{number:o.number,weight:o.weight||300})),f=new window.Microsoft.Maps.Pushpin(i,{icon:g,anchor:new window.Microsoft.Maps.Point(10.5185,30)}),x=e.href||"#";return f.metadata={infobox:n,location:i,index:t+1,locationId:e.warehouseId,locationName:e.name,coordinates:e.coordinates,city:e.city,state:e.state,distance:e.distance,distanceUnit:e.distanceUnit,href:x},h&&(null==(a=window.Microsoft)||a.Maps.Events.addHandler(f,"click",e=>{let t=(e.target||f).metadata;r&&r({...e,pinMetadata:t}),n&&t&&(n.setOptions({location:t.location,htmlContent:u({locationName:t.locationName||"Unknown",distance:(t.distance||0).toFixed(2),measure:t.distanceUnit||"mi",href:t.href||"#"}),visible:!0}),l&&l(n))})),f});a(g),g.forEach(t=>e.entities.push(t))},m=u,v=function(e){return(null==e?void 0:e.number)!==void 0?d(s.locator,{number:e.number,weight:e.weight||300}):s.warehouse}},36377:(e,t,a)=>{"use strict";a.d(t,{EA:()=>o,Jt:()=>f,Mn:()=>x,PD:()=>m,Rk:()=>h,_Y:()=>s,_w:()=>u,aq:()=>l,bi:()=>n,dE:()=>d,iF:()=>p,if:()=>g,ld:()=>i,mY:()=>c,oR:()=>r});let o="StockStatus",i="instock",r="lowstock",l="outofstock",n="itemnotsold",s="shipstowarehouse",d="forpickup",u="atwarehouse",c="ready",p="within",h="fourhours",g="tomorrow",f="buyinwarehouse",x="optionscolorsandsizesmayvary",m="warehouseunavailable"},40703:(e,t,a)=>{"use strict";a.d(t,{GasStationBadge:()=>s});var o=a(95155),i=a(27966),r=a(12158),l=a(24880),n=a(89786);let s=({label:e})=>(0,o.jsxs)(i.default,{sx:{display:"flex",alignItems:"center",gap:l.iAn,backgroundColor:l.pbd,borderRadius:"4px",padding:"3px 8px",width:"fit-content",margin:0},"data-testid":"gas-station-badge",children:[(0,o.jsx)(n.q,{sx:{height:"13px",width:"13px",color:l.S6v,flexShrink:0},"data-testid":"gas-station-badge-icon","aria-hidden":"true",focusable:"false"}),(0,o.jsx)(r.Text,{bold:!0,variant:"b3",sx:{color:l.S6v,margin:0},children:e})]});s.displayName="GasStationBadge"},45127:(e,t,a)=>{"use strict";a.d(t,{k:()=>i});let o=e=>"fr-ca"===e?{format:"fr-ca",display:null}:"en-ca"===e?{format:"en-ca",display:null}:{format:"en-us",dollars:null,fraction:null},i=(e,t="en-us")=>{if(!e||"string"!=typeof e)return o(t);let a=e.trim().replace(/[$\u00a2\s,]/g,"");if(!a||!(!((a.match(/\./g)||[]).length>1)&&/^[\d.]+$/.test(a)))return o(t);let i=parseFloat(a);if(isNaN(i)||i<0)return o(t);if("en-ca"===t||"fr-ca"===t)return{format:t,display:((e,t)=>{let[a,o]=e.toFixed(3).split(".");return"fr-ca"===t?`${a},${o}\xa0$`:`$${a}.${o}`})(i,t)};let[r,l]=i.toFixed(3).split(".");return{format:"en-us",dollars:parseFloat(`${r}.${null==l?void 0:l.slice(0,2)}`).toFixed(2),fraction:(null==l?void 0:l.slice(2,3))||"0"}}},47370:function(e){e.exports=function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(a,o,i){var r,l=function(e,a,o){void 0===o&&(o={});var i,r,l,n,s=new Date(e);return(void 0===(i=o)&&(i={}),(n=t[l=a+"|"+(r=i.timeZoneName||"short")])||(n=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:a,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:r}),t[l]=n),n).formatToParts(s)},n=function(t,a){for(var o=l(t,a),r=[],n=0;n<o.length;n+=1){var s=o[n],d=s.type,u=s.value,c=e[d];c>=0&&(r[c]=parseInt(u,10))}var p=r[3],h=r[0]+"-"+r[1]+"-"+r[2]+" "+(24===p?0:p)+":"+r[4]+":"+r[5]+":000",g=+t;return(i.utc(h).valueOf()-(g-=g%1e3))/6e4},s=o.prototype;s.tz=function(e,t){void 0===e&&(e=r);
21var a,o=this.utcOffset(),l=this.toDate(),n=l.toLocaleString("en-US",{timeZone:e}),s=Math.round((l-new Date(n))/1e3/60),d=-(15*Math.round(l.getTimezoneOffset()/15))-s;if(Number(d)){if(a=i(n,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(d,!0),t){var u=a.utcOffset();a=a.add(o-u,"minute")}}else a=this.utcOffset(0,t);return a.$x.$timezone=e,a},s.offsetName=function(e){var t=this.$x.$timezone||i.tz.guess(),a=l(this.valueOf(),t,{timeZoneName:e}).find(function(e){return"timezonename"===e.type.toLowerCase()});return a&&a.value};var d=s.startOf;s.startOf=function(e,t){if(!this.$x||!this.$x.$timezone)return d.call(this,e,t);var a=i(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return d.call(a,e,t).tz(this.$x.$timezone,!0)},i.tz=function(e,t,a){var o=a&&t,l=a||t||r,s=n(+i(),l);if("string"!=typeof e)return i(e).tz(l);var d=function(e,t,a){var o=e-60*t*1e3,i=n(o,a);if(t===i)return[o,t];var r=n(o-=60*(i-t)*1e3,a);return i===r?[o,i]:[e-60*Math.min(i,r)*1e3,Math.max(i,r)]}(i.utc(e,o).valueOf(),s,l),u=d[0],c=d[1],p=i(u).utcOffset(c);return p.$x.$timezone=l,p},i.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},i.tz.setDefault=function(e){r=e}}}()},47751:(e,t,a)=>{"use strict";a.d(t,{default:()=>i});var o=a(12115);let i=function(e){let t=o.useRef({});return o.useEffect(()=>{t.current=e}),t.current}},48463:(e,t,a)=>{"use strict";a.d(t,{U:()=>n,WarehousesProvider:()=>l});var o=a(95155),i=a(12115);let r=(0,i.createContext)(null),l=({children:e})=>{let[t,a]=(0,i.useState)([]);return(0,o.jsx)(r.Provider,{value:{warehouses:t,setWarehouses:a},children:e})},n=()=>{let e=(0,i.useContext)(r);if(!e)throw Error("useWarehouses must be used within a WarehousesProvider");return e};l.displayName="WarehousesProvider"},53401:function(e){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,a=/([+-]|\d\d)/g;return function(o,i,r){var l=i.prototype;r.utc=function(e){var t={date:e,utc:!0,args:arguments};return new i(t)},l.utc=function(t){var a=r(this.toDate(),{locale:this.$L,utc:!0});return t?a.add(this.utcOffset(),e):a},l.local=function(){return r(this.toDate(),{locale:this.$L,utc:!1})};var n=l.parse;l.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),n.call(this,e)};var s=l.init;l.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else s.call(this)};var d=l.utcOffset;l.utcOffset=function(o,i){var r=this.$utils().u;if(r(o))return this.$u?0:r(this.$offset)?d.call(this):this.$offset;if("string"==typeof o&&null===(o=function(e){void 0===e&&(e="");var o=e.match(t);if(!o)return null;var i=(""+o[0]).match(a)||["-",0,0],r=i[0],l=60*i[1]+ +i[2];return 0===l?0:"+"===r?l:-l}(o)))return this;var l=16>=Math.abs(o)?60*o:o;if(0===l)return this.utc(i);var n=this.clone();if(i)return n.$offset=l,n.$u=!1,n;var s=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(n=this.local().add(l+s,e)).$offset=l,n.$x.$localOffset=s,n};var u=l.format;l.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return u.call(this,t)},l.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},l.isUTC=function(){return!!this.$u},l.toISOString=function(){return this.toDate().toISOString()},l.toString=function(){return this.toDate().toUTCString()};var c=l.toDate;l.toDate=function(e){return"s"===e&&this.$offset?r(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():c.call(this)};var p=l.diff;l.diff=function(e,t,a){if(e&&this.$u===e.$u)return p.call(this,e,t,a);var o=this.local(),i=r(e).local();return p.call(o,i,t,a)}}}()},65030:(e,t,a)=>{"use strict";a.d(t,{EarlyGasStationMessage:()=>d});var o=a(95155),i=a(27966),r=a(12158),l=a(24880),n=a(89786),s=a(16002);let d=({gasStationOpenTitle:e,gasStationOpenUntilLabel:t,gasClosingTime:a,locale:d="en-us"})=>{let u=(0,s.fU)(a,d,!0,!0),c=`${t} ${u}`;return(0,o.jsxs)(i.default,{sx:{display:"flex",flexDirection:"column",gap:l.iAn,margin:0},"data-testid":"early-gas-station-message",children:[(0,o.jsxs)(i.default,{sx:{display:"flex",alignItems:"center",gap:l.iAn,backgroundColor:l.pbd,borderRadius:"4px",padding:"3px 8px",width:"fit-content",margin:0},"data-testid":"early-gas-station-message-badge",children:[(0,o.jsx)(n.q,{sx:{height:"13px",width:"13px",color:l.S6v,flexShrink:0},"data-testid":"early-gas-station-message-icon","aria-hidden":"true",focusable:"false"}),(0,o.jsx)(r.Text,{bold:!0,variant:"b3",sx:{color:l.S6v,lineHeight:"1.2",margin:0},"data-testid":"early-gas-station-message-badge-text",children:e})]}
21),(0,o.jsx)(r.Text,{variant:"b2",sx:{color:l.Kl5,lineHeight:"1.2",margin:0},"data-testid":"early-gas-station-message-hours",children:c})]})};d.displayName="EarlyGasStationMessage"},66149:(e,t,a)=>{"use strict";a.d(t,{A:()=>A});var o=a(12115),i=a(29722),r=a(97335),l=a(43439),n=a(95155);let s=(0,l.A)((0,n.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");var d=a(95386),u=a(75092),c=a(14137),p=a(86670),h=a(53083),g=a(44074),f=a(16377),x=a(32764),m=a(24885),v=a(34449);function b(e){return(0,v.Ay)("MuiChip",e)}let y=(0,m.A)("MuiChip",["root","sizeSmall","sizeMedium","colorDefault","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","deletable","outlined","filled","avatar","icon","label","deleteIcon","focusVisible"]);var w=a(15645),I=a(68033);let S=(0,p.default)("div",{name:"MuiChip",slot:"Root",shouldForwardProp:e=>(0,x.A)(e)&&"focusableWhenDisabled"!==e&&"skipFocusWhenDisabled"!==e,overridesResolver:(e,t)=>{let{ownerState:a}=e,{color:o,clickable:i,onDelete:r,size:l,variant:n}=a;return[{[`& .${y.avatar}`]:t.avatar},{[`& .${y.icon}`]:t.icon},{[`& .${y.deleteIcon}`]:t.deleteIcon},t.root,t[`size${(0,u.A)(l)}`],t[`color${(0,u.A)(o)}`],i&&t.clickable,r&&t.deletable,t[n]]}})((0,h.A)(({theme:e})=>{let t="light"===e.palette.mode?e.palette.grey[700]:e.palette.grey[300];return{maxWidth:"100%",fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,lineHeight:1.5,color:(e.vars||e).palette.text.primary,backgroundColor:(e.vars||e).palette.action.selected,borderRadius:16,whiteSpace:"nowrap",...(0,I.yP)(e,["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${y.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${y.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:t,fontSize:e.typography.pxToRem(12)},[`& .${y.icon}`]:{marginLeft:5,marginRight:-6},[`& .${y.deleteIcon}`]:{WebkitTapHighlightColor:"transparent",color:e.alpha((e.vars||e).palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:e.alpha((e.vars||e).palette.text.primary,.4)}},variants:[{props:{color:"primary"},style:{[`& .${y.avatar}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark}}},{props:{color:"secondary"},style:{[`& .${y.avatar}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark}}},{props:{size:"small"},style:{height:24,[`& .${y.avatar}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${y.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${y.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(e.palette).filter((0,g.A)(["contrastText"])).map(([t])=>({props:{color:t},style:{backgroundColor:(e.vars||e).palette[t].main,color:(e.vars||e).palette[t].contrastText,[`& .${y.deleteIcon}`]:{color:e.alpha((e.vars||e).palette[t].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[t].contrastText}}}})),{props:e=>e.iconColor===e.color,style:{[`& .${y.icon}`]:{color:e.vars?e.vars.palette.Chip.defaultIconColor:t}}},{props:e=>e.iconColor===e.color&&"default"!==e.color,style:{[`& .${y.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:!e.focusVisible&&{[`&.${y.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}}},...Object.entries(e.palette).filter((0,g.A)(["dark"])).map(([t])=>({props:{color:t,onDelete:!0},style:!e.focusVisible&&{[`&.${y.focusVisible}`]:{background:(e.vars||e).palette[t].dark}}})),{props:{clickable:!0},style:{userSelect:"none",WebkitTapHighlightColor:"transparent",curs
21or:"pointer","&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`)},...!e.focusVisible&&{[`&.${y.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}},"&:active":{boxShadow:(e.vars||e).shadows[1]}}},...Object.entries(e.palette).filter((0,g.A)(["dark"])).map(([t])=>({props:{color:t,clickable:!0},style:{"&:hover":{backgroundColor:(e.vars||e).palette[t].dark},...!e.focusVisible&&{[`&.${y.focusVisible}`]:{backgroundColor:(e.vars||e).palette[t].dark}}}})),{props:{variant:"outlined"},style:{backgroundColor:"transparent",border:e.vars?`1px solid ${e.vars.palette.Chip.defaultBorder}`:`1px solid ${"light"===e.palette.mode?e.palette.grey[400]:e.palette.grey[700]}`,[`&.${y.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},...!e.focusVisible&&{[`&.${y.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus}},[`& .${y.avatar}`]:{marginLeft:4},[`& .${y.icon}`]:{marginLeft:4},[`& .${y.deleteIcon}`]:{marginRight:5}}},{props:{size:"small",variant:"outlined"},style:{[`& .${y.avatar}`]:{marginLeft:2},[`& .${y.icon}`]:{marginLeft:2},[`& .${y.deleteIcon}`]:{marginRight:3}}},...Object.entries(e.palette).filter((0,g.A)()).map(([t])=>({props:{variant:"outlined",color:t},style:{color:(e.vars||e).palette[t].main,border:`1px solid ${e.alpha((e.vars||e).palette[t].main,.7)}`,[`&.${y.clickable}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)},...!e.focusVisible&&{[`&.${y.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.focusOpacity)}},[`& .${y.deleteIcon}`]:{color:e.alpha((e.vars||e).palette[t].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[t].main}}}}))]}})),k=(0,p.default)("span",{name:"MuiChip",slot:"Label"})({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap",variants:[{props:{variant:"outlined"},style:{paddingLeft:11,paddingRight:11}},{props:{size:"small"},style:{paddingLeft:8,paddingRight:8}},{props:{size:"small",variant:"outlined"},style:{paddingLeft:7,paddingRight:7}}]});function $(e){return"Backspace"===e.key||"Delete"===e.key}let A=o.forwardRef(function(e,t){let a=(0,f.b)({props:e,name:"MuiChip"}),{avatar:l,className:p,clickable:h,color:g="default",component:x,deleteIcon:m,disabled:v=!1,icon:y,label:I,onClick:A,onDelete:C,onKeyDown:M,onKeyUp:T,size:j="medium",variant:L="filled",tabIndex:_,skipFocusWhenDisabled:O=!1,slots:W={},slotProps:D={},...E}=a,{nativeButton:P,...H}=E,F=o.useRef(null),N=(0,d.A)(F,t),R=e=>{e.stopPropagation(),C(e)},B=!1!==h&&!!A||h,V=B||C?c.A:x||"div",z={...a,component:V,disabled:v,size:j,color:g,iconColor:o.isValidElement(y)&&y.props.color||g,onDelete:!!C,clickable:B,variant:L},K=(e=>{let{classes:t,disabled:a,size:o,color:i,onDelete:l,clickable:n,variant:s}=e,d={root:["root",s,a&&"disabled",`size${(0,u.A)(o)}`,`color${(0,u.A)(i)}`,n&&"clickable",l&&"deletable"],label:["label"],avatar:["avatar"],icon:["icon"],deleteIcon:["deleteIcon"]};return(0,r.A)(d,b,t)})(z),U=V===c.A?{component:x||"div",internalNativeButton:!1,focusVisibleClassName:K.focusVisible,...C&&{disableRipple:!0},...void 0!==P&&{nativeButton:P}}:{},q=null;C&&(q=m&&o.isValidElement(m)?o.cloneElement(m,{className:(0,i.A)(m.props.className,K.deleteIcon),onClick:R}):(0,n.jsx)(s,{className:K.deleteIcon,onClick:R}));let G=null;l&&o.isValidElement(l)&&(G=o.cloneElement(l,{className:(0,i.A)(K.avatar,l.props.className)}));let J=null;y&&o.isValidElement(y)&&(J=o.cloneElement(y,{className:(0,i.A)(K.icon,y.props.className)}));let Z={slots:W,slotProps:D},[Y,Q]=(0,w.A)("root",{elementType:S,externalForwardedProps:{...Z,...H},ownerState:z,shouldForwardComponentProp:!0,ref:N,className:(0,i.A)(K.root,p),additionalProps:{disabled:!!B&&!!v||void 0,tabIndex:O&&v?-1:_,...U},getSlotProps:e=>({...e,onClick:t=>{e.onClick?.(t),A?.(t)},onKeyDown:t=>{e.onKeyDown?.(t),t.currentTarget===t.target&&$(t)&&t.preventDefault(),M&&M(t)},onKeyUp:t=>{e.onKeyUp?.(t),t.currentTarget===t.target&&C&&$(t)&&C(t),T&&T(t)}})}),[X,ee]=(0,w.A)("label",{elementType:k,externalForwardedProps:Z,ownerState:z,className:K.label});return(0,n.jsxs)(Y,{as:V,...Q,children:[G||J,(0,n.jsx)(X,{...ee,children:I}),q]})})},66535:(e,t,a)=>{"use strict";a.d(t,{WarehouseOpenGasComingMessage:()=>s});var o=a(95155),i=a(27966),r=a(12158),l=a(24880),n=a(20115);let s=({gasStationComingSoonLabel:e})=>(0,o.jsxs)(i.default,{sx:{display:"flex",gap:"8px",alignItems:"center"},"data-testid":"warehouse-open-gas-coming-message",children:[(0,o.jsx)(n.J,{sx:{height:"20px",width:"20px",flexShrink:0,aspectRatio:"1/1",color:l.JHH},"data-testid":"warehouse-open-gas-coming-message-icon","aria-hidden":"true",focusable:"false"}),(0,o.jsx)(i.default,{component:"span",sx:{color:l.JHH,margin:0},"data-testid":"warehouse-open-gas-coming-message-label",children:(0,o.jsx)(r.Text,{variant:"b2",sx:{color:l.JHH,margin:0},children:e})})]});s.displayName="WarehouseOpenGasComingMessage"},66775:(e,t,a)=>{"use strict";a.d(t,{P:()=>r});var o=a(12115),i=a(81e3);let r=()=>{let e=(0,o.useContext)(i.I);if(!e)throw Error("`useStwContext` must be used within a `StwInfoContextProvider`");return e}},69758:(e,t,a)=>{"use strict";a.d(t,{A:()=>el});var o,i,r=a(12115),l=a(97335),n=a(18573),s=a(78865),d=a(71253),u=a(38765),c=a(3271),p=a(62429),h=a(1757),g=a(47751);function f({array1:e,array2:t,parser:a=e=>e}){return e&&t&&e.length===t.length&&e.every((e,o)=>a(e)===a(t[o]))}function x(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}let m=function(e={}){let{ignoreAccents:t=!0,ignoreCase:a=!0,limit:o,matchFrom:i="any",stringify:r,trim:l=!1}=e;return(e,{inputValue:n,getOptionLabel:s})=>{let d=l?n.trim():n;a&&(d=d.toLowerCase()),t&&(d=x(d));let u=d?e.filter(e=>{let o=(r||s)(e);return a&&(o=o.toLowerCase()),t&&(o=x(o)),"start"===i?o.startsWith(d):o.includes(d)}):e;return"number"==typeof o?u.slice(0,o):u}}(),v=e=>null!==e.current&&(0,d.A)(e.current.parentElement,document.activeElement),b=(e,t)=>e===t,y=[];function w(e,t,a,o){if(t||null==e||o)return"";let i=a(e);return"string"==typeof i?i:""}let I=function(e){let{unstable_isActiveElementInListbox:t=v,unstable_classNamePrefix:a="Mui",autoComplete:o=!1,autoHighlight:i=!1,autoSelect:l=!1,blurOnSelect:n=!1,clearOnBlur:s=!e.freeSolo,clearOnEscape:x=!1,componentName:I="useAutocomplete",defaultValue:S=e.multiple?y:null,disableClearable:k=!1,disableCloseOnSelect:$=!1,disabled:A,disabledItemsFocusable:C=!1,disableListWrap:M=!1,filterOptions:T=m,f
21ilterSelectedOptions:j=!1,freeSolo:L=!1,getOptionDisabled:_,getOptionKey:O,getOptionLabel:W=e=>e.label??e,groupBy:D,handleHomeEndKeys:E=!e.freeSolo,id:P,includeInputInList:H=!1,inputValue:F,isOptionEqualToValue:N=b,multiple:R=!1,onChange:B,onClose:V,onHighlightChange:z,onInputChange:K,onOpen:U,open:q,openOnFocus:G=!1,options:J,readOnly:Z=!1,renderValue:Y,resetHighlightOnMouseLeave:Q=!1,selectOnFocus:X=!e.freeSolo,value:ee}=e,et=(0,h.default)(P),ea=W;ea=e=>{let t=W(e);return"string"!=typeof t?String(t):t};let eo=r.useRef(!1),ei=r.useRef(!0),er=r.useRef(null),el=r.useRef(null),en=r.useRef(!1),es=r.useRef(!1),[ed,eu]=r.useState(null),[ec,ep]=r.useState(-1),eh=i?0:-1,eg=r.useRef(eh),ef=r.useRef(null),ex=r.useRef(!1),em=r.useRef(!1),ev=r.useRef(w(S??ee,R,ea)).current,[eb,ey]=(0,p.default)({controlled:ee,default:S,name:I}),[ew,eI]=(0,p.default)({controlled:F,default:ev,name:I,state:"inputValue"}),[eS,ek]=r.useState(!1),e$=r.useCallback((e,t,a)=>{let o=R?eb.length<t.length:null!==t,i="reset"===a&&L&&!R&&null===t;if(!o&&!s&&!i)return;let r=w(t,R,ea,Y);ew!==r&&(eI(r),K&&K(e,r,a))},[ea,ew,R,K,eI,s,L,eb,Y]),[eA,eC]=(0,p.default)({controlled:q,default:!1,name:I,state:"open"}),[eM,eT]=r.useState(!0),ej=!R&&null!=eb&&ew===ea(eb),eL=eA&&!Z,e_=r.useMemo(()=>R?eb:null!=eb?[eb]:[],[R,eb]),eO=r.useMemo(()=>N!==b||0===e_.length?null:new Set(e_),[N,e_]),eW=r.useCallback(e=>eO?eO.has(e):e_.some(t=>null!=t&&N(e,t)),[N,e_,eO]),eD=eL?T(J.filter(e=>!(j&&eW(e))),{inputValue:ej&&eM?"":ew,getOptionLabel:ea}):[],eE=(0,g.default)({filteredOptions:eD,value:eb,inputValue:ew});r.useEffect(()=>{let e=eb!==eE.value;eS&&!e||L&&(!e||null==eb&&void 0===eE.value)||e$(null,eb,"reset")},[eb,e$,eS,eE.value,L]);let eP=eA&&eD.length>0&&!Z,eH=(0,c.default)(e=>{-1===e?er.current.focus():ed.querySelector(`[data-item-index="${e}"]`).focus()});r.useEffect(()=>{R&&ec>eb.length-1&&(ep(-1),eH(-1))},[eb,R,ec,eH]);let eF=(0,c.default)(({index:e,reason:t,preserveScroll:o=!1})=>{if(null==er.current&&null==el.current||(-1===e?er.current.removeAttribute("aria-activedescendant"):er.current.setAttribute("aria-activedescendant",`${et}-option-${e}`),!el.current))return;let i=el.current.querySelector(`[role="option"].${a}-focused`);i&&(i.classList.remove(`${a}-focused`),i.classList.remove(`${a}-focusVisible`));let r=el.current;if("listbox"!==el.current.getAttribute("role")&&(r=el.current.parentElement.querySelector('[role="listbox"]')),!r)return;if(-1===e){o||(r.scrollTop=0);return}let l=el.current.querySelector(`[data-option-index="${e}"]`);if(l&&(l.classList.add(`${a}-focused`),"keyboard"===t&&l.classList.add(`${a}-focusVisible`),r.scrollHeight>r.clientHeight&&"mouse"!==t&&"touch"!==t)){let e=r.clientHeight+r.scrollTop,t=l.offsetTop+l.offsetHeight;t>e?r.scrollTop=t-r.clientHeight:l.offsetTop-l.offsetHeight*(1.3*!!D)<r.scrollTop&&(r.scrollTop=l.offsetTop-l.offsetHeight*(1.3*!!D))}}),eN=(0,c.default)(({event:e,index:t,reason:a,preserveScroll:o=!1})=>{eg.current=t,ef.current=a??null,z&&["mouse","keyboard","touch"].includes(a)&&z(e,-1===t?null:eD[t],a),eF({index:t,reason:a,preserveScroll:o})}),eR=(0,c.default)(({index:e})=>{eg.current=e,eF({index:e,reason:ef.current})}),eB=(0,c.default)(({event:e,diff:t,direction:a="next",reason:i,preserveScroll:r})=>{if(!eL)return;"keyboard"===i&&(ex.current=!1,em.current=!1);let l=function(e,t){if(!el.current||e<0||e>=eD.length)return -1;let a=e;for(;;){let o=el.current.querySelector(`[data-option-index="${a}"]`),i=!C&&(!o||o.disabled||"true"===o.getAttribute("aria-disabled"));if(o&&o.hasAttribute("tabindex")&&!i)return a;if((a="next"===t?(a+1)%eD.length:(a-1+eD.length)%eD.length)===e)return -1}}((()=>{let e=eD.length-1;if("reset"===t)return eh;if("start"===t)return 0;if("end"===t)return e;let a=eg.current+t;return a<0?-1===a&&H?-1:M&&-1!==eg.current||Math.abs(t)>1?0:e:a>e?a===e+1&&H?-1:M||Math.abs(t)>1?e:0:a})(),a);if(eN({index:l,reason:i,event:e,preserveScroll:r}),o&&"reset"!==t)if(-1===l)er.current.value=ew;else{let e=ea(eD[l]);er.current.value=e,0===e.toLowerCase().indexOf(ew.toLowerCase())&&ew.length>0&&er.current.setSelectionRange(ew.length,e.length)}}),eV=!f({array1:eE.filteredOptions,array2:eD,parser:ea}),ez=r.useCallback(()=>
21{if(!eL)return;let e=(()=>{var e;if(-1!==eg.current&&!f({array1:eE.filteredOptions,array2:eD,parser:ea})&&eE.inputValue===ew&&(R?eb.length===eE.value.length&&eE.value.every((e,t)=>ea(eb[t])===ea(e)):(e=eE.value,(e?ea(e):"")===(eb?ea(eb):"")))){let e=eE.filteredOptions[eg.current];if(e)return eD.findIndex(t=>ea(t)===ea(e))}return -1})();if(-1!==e)return void eR({index:e});let t=R?eb[0]:eb;if(0===eD.length||null==t)return void eB({diff:"reset",preserveScroll:eV&&eE.inputValue===ew&&eE.filteredOptions?.length>0&&eD.length>eE.filteredOptions.length&&eE.filteredOptions.every((e,t)=>ea(e)===ea(eD[t]))});if(el.current){if(null!=t){let e=eD[eg.current];if(R&&e&&-1!==eb.findIndex(t=>N(e,t))&&eE.filteredOptions?.length>0)return void eR({index:eg.current});let a=eD.findIndex(e=>N(e,t));return void(-1===a?eB({diff:"reset"}):eN({index:a}))}if(eg.current>=eD.length-1)return void eN({index:eD.length-1});eN({index:eg.current})}},[eD.length,!R&&eb,eB,eN,eR,eL,ew,R]),eK=(0,c.default)(e=>{(0,u.A)(el,e),e&&ez()});r.useEffect(()=>{(eV||eL&&!$)&&ez()},[ez,eV,eL,$]),r.useEffect(()=>{if("u"<typeof window)return;let e=()=>{es.current=!0};return window.addEventListener("blur",e),()=>{window.removeEventListener("blur",e)}},[]);let eU=e=>{!eA&&(eC(!0),eT(!0),em.current=!1,U&&U(e))},eq=(e,t)=>{eA&&(eC(!1),ex.current=!1,ef.current=null,V&&V(e,t))},eG=(e,t,a,o)=>{if(R){if(eb.length===t.length&&eb.every((e,a)=>e===t[a]))return}else if(eb===t)return;B&&B(e,t,a,o),ey(t)},eJ=(e,t,a="selectOption",o="options")=>{let i=a,r=t;if(R){let e=(r=Array.isArray(eb)?eb.slice():[]).findIndex(e=>N(t,e));-1===e?r.push(t):"freeSolo"!==o&&(r.splice(e,1),i="removeOption")}e$(e,r,i),eG(e,r,i,{option:t}),$||e&&(e.ctrlKey||e.metaKey)||eq(e,i),(!0===n||"touch"===n&&em.current||"mouse"===n&&!em.current)&&er.current.blur()},eZ=(e,t)=>{if(!R)return;""===ew&&eq(e,"toggleInput");let a=ec;-1===ec&&"previous"===t?(a=eb.length-1,L&&""!==ew&&(eI(""),K&&K(e,"","reset"))):((a+="next"===t?1:-1)<0&&(a=0),a===eb.length&&(a=-1)),ep(a=function(e,t){if(-1===e)return -1;let a=e;for(;;){if("next"===t&&a===eb.length||"previous"===t&&-1===a)return -1;let e=ed.querySelector(`[data-item-index="${a}"]`);if(e&&e.hasAttribute("tabindex")&&!e.disabled&&"true"!==e.getAttribute("aria-disabled"))return a;a+="next"===t?1:-1}}(a,t)),eH(a)},eY=e=>{eI(""),K&&K(e,"","clear"),eG(e,R?[]:null,"clear")},eQ=e=>{if(ek(!0),-1!==ec&&(ep(-1),eH(-1)),es.current){es.current=!1;return}G&&!eo.current&&eU(e)},eX=e=>{t(el)?er.current.focus():(ek(!1),ei.current=!0,eo.current=!1,l&&-1!==eg.current&&eL&&"mouse"!==ef.current&&"touch"!==ef.current?eJ(e,eD[eg.current],"blur"):l&&L&&""!==ew?eJ(e,ew,"blur","freeSolo"):s&&e$(e,eb,"blur"),eq(e,"blur"))},e0=e=>{let t=e.target.value,a=ew!==t;a&&(eI(t),ex.current=!1,K&&K(e,t,"input")),""===t?k||R||Y||eG(e,null,"clear"):eU(e),a&&eT(!1)},e1=e=>{let t=Number(e.currentTarget.getAttribute("data-option-index"));eg.current!==t?eN({event:e,index:t,reason:"mouse"}):ef.current="mouse",em.current||(ex.current=!1)},e2=e=>{ex.current=!1,eN({event:e,index:Number(e.currentTarget.getAttribute("data-option-index")),reason:"touch"}),em.current=!0},e5=e=>{let t=Number(e.currentTarget.getAttribute("data-option-index"));eJ(e,eD[t],"selectOption"),em.current=!1},e6=e=>{eG(e,null,"removeOption",{option:eb})},e3=e=>{eA?eq(e,"toggleInput"):eU(e)},e7=e=>{!(0,d.A)(e.currentTarget,e.target)||(!ed||(0,d.A)(ed,e.target))&&e.target.getAttribute("id")!==et&&e.preventDefault()},e4=e=>{!(0,d.A)(e.currentTarget,e.target)||(!ed||(0,d.A)(ed,e.target))&&(er.current.focus(),X&&ei.current&&er.current.selectionEnd-er.current.selectionStart==0&&er.current.select(),ei.current=!1)},e8=e=>{A||""!==ew&&eA||0!==e.button||e3(e)},e9=L&&ew.length>0;e9=e9||(R?eb.length>0:null!==eb);let te=eD;return D&&(te=eD.reduce((e,t,a)=>{let o=D(t);return e.length>0&&e[e.length-1].group===o?e[e.length-1].options.push(t):e.push({key:a,index:a,group:o,options:[t]}),e},[])),A&&eS&&eX(),{getRootProps:(e={})=>({...e,onKeyDown:t=>{if(e.onKeyDown&&e.onKeyDown(t),!t.defaultMuiPrevented&&(-1===ec||["ArrowLeft","ArrowRight"].includes(t.key)||(ep(-1),eH(-1)),229!==t.which))switch(t.key){case"Home":eL&&E&&(t.preventDefault(),eB({diff:"start",direction:"next",reason:"keyboard",event:t}));break;case"End":eL&&E&&(t.preventDefault(),eB({diff:"end",direction:"previous",reason:"keyboard",event:t}));break;case"PageUp":t.preventDefault(),eB({diff:-5,direction:"previous",reason:"keyboard",event:t}),eU(t);break;case"PageDown":t.preventDefault(),eB({diff:5,direction:"next",reason:"keyboard",event:t}),eU(t);break;case"ArrowDown":t.preventDefault(),eB({diff:1,direction:"next",reason:"keyboard",event:t}),eU(t);break;case"ArrowUp":t.preventDefault(),eB({diff:-1,direction:"previous",reason:"keyboard",event:t}),eU(t);break;case"ArrowLeft":{let e=er.current;if(!(e&&0===e.selectionStart&&0===e.selectionEnd))return;
21!R&&Y&&null!=eb?(L&&""!==ew&&(eI(""),K&&K(t,"","reset")),ep(0),eH(0)):eZ(t,"previous");break}case"ArrowRight":!R&&Y?(ep(-1),eH(-1)):eZ(t,"next");break;case"Enter":{let e=eL&&-1!==eg.current&&null===ef.current,a=L&&!eM&&e,i=!L||eM||!e,r=a&&!ex.current;if(-1!==eg.current&&eL&&i&&!ex.current){let e=eD[eg.current],a=!!_&&_(e);if(t.preventDefault(),a)return;eJ(t,e,"selectOption"),o&&er.current.setSelectionRange(er.current.value.length,er.current.value.length)}else L&&""!==ew&&!1===ej?((R||r)&&t.preventDefault(),eJ(t,ew,"createOption","freeSolo")):eL&&ex.current&&(t.preventDefault(),eq(t,"escape"));break}case"Escape":eL?(t.preventDefault(),t.stopPropagation(),eq(t,"escape")):x&&(""!==ew||R&&eb.length>0||Y)&&(t.preventDefault(),t.stopPropagation(),eY(t));break;case"Backspace":if(en.current){en.current=!1;break}if(R&&!Z&&""===ew&&eb.length>0){let e=-1===ec?eb.length-1:ec,a=eb.slice();a.splice(e,1),eG(t,a,"removeOption",{option:eb[e]}),-1!==ec&&(en.current=!0,setTimeout(()=>{en.current&&(en.current=!1)},0))}R||!Y||Z||""!==ew||eG(t,null,"removeOption",{option:eb});break;case"Delete":if(R&&!Z&&""===ew&&eb.length>0&&-1!==ec){let e=eb.slice();e.splice(ec,1),eG(t,e,"removeOption",{option:eb[ec]})}R||!Y||Z||""!==ew||eG(t,null,"removeOption",{option:eb})}},onMouseDown:e7,onClick:e4}),getInputLabelProps:()=>({id:`${et}-label`,htmlFor:et}),getInputProps:()=>({id:et,value:ew,onBlur:eX,onFocus:eQ,onChange:e0,onMouseDown:e8,"aria-activedescendant":eL?"":null,"aria-autocomplete":o?"both":"list","aria-controls":eP?`${et}-listbox`:void 0,"aria-expanded":eP,autoComplete:"off",ref:er,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:A}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:e=>{eo.current=!0,eY(e)}}),getItemProps:({index:e=0}={})=>({...R&&{key:e},"data-item-index":e,tabIndex:-1,onFocus:()=>{ec!==e&&ep(e)},...!Z&&{onDelete:R?t=>{let a=eb.slice();a.splice(e,1),eG(t,a,"removeOption",{option:eb[e]})}:e6}}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:e3}),getListboxProps:(e={})=>({...e,role:"listbox",id:`${et}-listbox`,"aria-labelledby":`${et}-label`,"aria-multiselectable":R||void 0,ref:eK,onMouseDown:t=>{e.onMouseDown?.(t),t.defaultMuiPrevented||t.preventDefault()},onScroll:t=>{e.onScroll?.(t),!t.defaultMuiPrevented&&em.current&&(ex.current=!0)},onMouseLeave:t=>{(e.onMouseLeave?.(t),!t.defaultMuiPrevented)&&Q&&-1!==eg.current&&"mouse"===ef.current&&!em.current&&eN({event:t,index:-1,reason:"mouse",preserveScroll:!0})}}),getOptionProps:({index:e,option:t})=>{let a=eW(t),o=!!_&&_(t);return{key:O?.(t)??ea(t),tabIndex:-1,role:"option",id:`${et}-option-${e}`,onMouseMove:e1,onClick:e5,onTouchStart:e2,"data-option-index":e,"aria-disabled":o,"aria-selected":a}},id:et,inputValue:ew,value:eb,dirty:e9,expanded:eL&&ed,popupOpen:eL,focused:eS||-1!==ec,anchorEl:ed,setAnchorEl:eu,focusedItem:ec,groupedOptions:te}};var S=a(55207),k=a(29722),$=a(86670),A=a(53083),C=a(16377),M=a(75092),T=a(24885),j=a(34449);function L(e){return(0,j.Ay)("MuiListSubheader",e)}(0,T.A)("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);var _=a(95155);let O=(0,$.default)("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:a}=e;return[t.root,"default"!==a.color&&t[`color${(0,M.A)(a.color)}`],!a.disableGutters&&t.gutters,a.inset&&t.inset,!a.disableSticky&&t.sticky]}})((0,A.A)(({theme:e})=>({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(e.vars||e).palette.text.secondary,fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(14),variants:[{props:{color:"primary"},style:{color:(e.vars||e).palette.primary.main}},{props:{color:"inherit"},style:{color:"inherit"}},{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.inset,style:{paddingLeft:72}},{props:({ownerState:e})=>!e.disableSticky,style:{position:"sticky",top:0,zIndex:1,backgroundColor:(e.vars||e).palette.background.paper}}]}))),W=r.forwardRef(function(e,t){let a=(0,C.b)({props:e,name:"MuiListSubheader"}),{className:o,color:i="default",component:r="li",disableGutters:n=!1,disableSticky:s=!1,inset:d=!1,...u}=a,c={...a,color:i,component:r,disableGutters:n,disableSticky:s,inset:d},p=(e=>{let{classes:t,color:a,disableGutters:o,inset:i,disableSticky:r}=e,n={root:["root","default"!==a&&`color${(0,M.A)(a)}`,!o&&"gutters",i&&"inset",!r&&"sticky"]};return(0,l.A)(n,L,t)})(c);return(0,_.jsx)(O,{as:r,className:(0,k.A)(p.root,o),ref:t,ownerState:c,...u})});var D=a(82755),E=a(94771),P=a(66149),H=a(97611),F=a(45967),N=a(48535),R=a(71159);let B=(0,a(43439).A)((0,_.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");var V=a(6300);function z(e){return(0,j.Ay)("MuiAutocomplete",e)}let K=(0,T.A)("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","
21input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","status","option","groupLabel","groupUl"]);var U=a(22657),q=a(15645);let G=(0,$.default)("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:a}=e,{fullWidth:o,hasClearIcon:i,hasPopupIcon:r,inputFocused:l,size:n}=a;return[{[`& .${K.tag}`]:t.tag},{[`& .${K.tag}`]:t[`tagSize${(0,M.A)(n)}`]},{[`& .${K.inputRoot}`]:t.inputRoot},{[`& .${K.input}`]:t.input},{[`& .${K.input}`]:l&&t.inputFocused},t.root,o&&t.fullWidth,r&&t.hasPopupIcon,i&&t.hasClearIcon]}})({[`&.${K.focused} .${K.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${K.clearIndicator}`]:{visibility:"visible"}},[`& .${K.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${K.inputRoot}`]:{[`.${K.hasPopupIcon}&, .${K.hasClearIcon}&`]:{paddingRight:30},[`.${K.hasPopupIcon}.${K.hasClearIcon}&`]:{paddingRight:56},[`& .${K.input}`]:{width:0,minWidth:30}},[`& .${H.A.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${H.A.root}.${F.A.sizeSmall}`]:{[`& .${H.A.input}`]:{padding:"2px 4px 3px 0"}},[`& .${N.A.root}`]:{padding:9,[`.${K.hasPopupIcon}&, .${K.hasClearIcon}&`]:{paddingRight:39},[`.${K.hasPopupIcon}.${K.hasClearIcon}&`]:{paddingRight:65},[`& .${K.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${K.endAdornment}`]:{right:9}},[`& .${N.A.root}.${F.A.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${K.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${R.A.root}`]:{paddingTop:19,paddingLeft:8,[`.${K.hasPopupIcon}&, .${K.hasClearIcon}&`]:{paddingRight:39},[`.${K.hasPopupIcon}.${K.hasClearIcon}&`]:{paddingRight:65},[`& .${R.A.input}`]:{padding:"7px 4px"},[`& .${K.endAdornment}`]:{right:9}},[`& .${R.A.root}.${F.A.sizeSmall}`]:{paddingBottom:1,[`& .${R.A.input}`]:{padding:"2.5px 4px"}},[`& .${F.A.hiddenLabel}`]:{paddingTop:8},[`& .${R.A.root}.${F.A.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${K.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${R.A.root}.${F.A.hiddenLabel}.${F.A.sizeSmall}`]:{[`& .${K.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${K.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0}
21,variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${K.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${K.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${K.inputRoot}`]:{flexWrap:"wrap"}}}]}),J=(0,$.default)("div",{name:"MuiAutocomplete",slot:"EndAdornment"})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),Z=(0,$.default)(E.A,{name:"MuiAutocomplete",slot:"ClearIndicator"})({marginRight:-2,padding:4,visibility:"hidden"}),Y=(0,$.default)(E.A,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:(e,t)=>{let{ownerState:a}=e;return[t.popupIndicator,a.popupOpen&&t.popupIndicatorOpen]}})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),Q=(0,$.default)(S.A,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(e,t)=>{let{ownerState:a}=e;return[{[`& .${K.option}`]:t.option},t.popper,a.disablePortal&&t.popperDisablePortal]}})((0,A.A)(({theme:e})=>({zIndex:(e.vars||e).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]}))),X=(0,$.default)(D.default,{name:"MuiAutocomplete",slot:"Paper"})((0,A.A)(({theme:e})=>({...e.typography.body1,overflow:"auto"}))),ee=(0,$.default)("div",{name:"MuiAutocomplete",slot:"Loading"})((0,A.A)(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),et=(0,$.default)("div",{name:"MuiAutocomplete",slot:"Status"})({}),ea=(0,$.default)("div",{name:"MuiAutocomplete",slot:"NoOptions"})((0,A.A)(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),eo=(0,$.default)("ul",{name:"MuiAutocomplete",slot:"Listbox"})((0,A.A)(({theme:e})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",isolation:"isolate",position:"relative",[`& .${K.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[e.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${K.focused}`]:{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${K.focusVisible}`]:e.focusVisible?{...(0,U.eB)(1),...e.focusVisible}:{backgroundColor:(e.vars||e).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${K.focused}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:(e.vars||e).palette.action.selected}},...!e.focusVisible&&{[`&.${K.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}}}}}))),ei=(0,$.default)(W,{name:"MuiAutocomplete",slot:"GroupLabel"})((0,A.A)(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,top:-8}))),er=(0,$.default)("ul",{name:"MuiAutocomplete",slot:"GroupUl"})({padding:0,[`& .${K.option}`]:{paddingLeft:24}}),el=r.forwardRef(function(e,t){let a,d=(0,C.b)({props:e,name:"MuiAutocomplete"}),{autoComplete:u=!1,autoHighlight:c=!1,autoSelect:p=!1,blurOnSelect:h=!1,className:g,clearIcon:f=o||(o=(0,_.jsx)(B,{fontSize:"small"})),clearOnBlur:x=!d.freeSolo,clearOnEscape:m=!1,clearText:v="Clear",closeText:b="Close",defaultValue:y=d.multiple?[]:null,disableClearable:w=!1,disableCloseOnSelect:k=!1,disabled:$=!1,disabledItemsFocusable:A=!1,disableListWrap:T=!1,disablePortal:j=!1,filterOptions:L,filterSelectedOptions:O=!1,forcePopupIcon:W="auto",freeSolo:E=!1,fullWidth:H=!1,getLimitTagsText:F=e=>`+${e}`,getOptionDisabled:N,getOptionKey:R,getOptionLabel:K,isOptionEqualToValue:U,groupBy:el,handleHomeEndKeys:en=!d.freeSolo,id:es,includeInputInList:ed=!1,inputValue:eu,limitTags:ec=-1,loading:ep=!1,loadingText:eh="Loading…",multiple:eg=!1,noOptionsText:ef="No options",onChange:ex,onClose:em,onHighlightChange:ev,onInputChange:eb,onOpen:ey,open:ew,openOnFocus:eI=!1,openText:eS="Open",options:ek,popupIcon:e$=i||(i=(0,_.jsx)(V.A,{})),readOnly:eA=!1,renderGroup:eC,renderInput:eM,renderOption:eT,renderValue:ej,resetHighlightOnMouseLeave:eL=!1,selectOnFocus:e_=!d.freeSolo,size:eO="medium",slots:eW={},slotProps:eD={},value:eE,...eP}=d,{getRootProps:eH,getInputProps:eF,getInputLabelProps:eN,getPopupIndicatorProps:eR,getClearProps:eB,getItemProps:eV,getListboxProps:ez,getOptionProps:eK,value:eU,dirty:eq,expanded:eG,id:eJ,popupOpen:eZ,focused:eY,focusedItem:eQ,anchorEl:eX,setAnchorEl:e0,inputValue:e1,groupedOptions:e2}=I({...d,componentName:"Autocomplete"}),e5=(0,n.default)();r.useEffect(()=>{if(!eZ||!eX||"u"<typeof ResizeObserver)return;let e=eX.clientWidth,t=new ResizeObserver(()=>{let t=eX.clientWidth;e!==t&&(e=t,e5())});return t.observe(eX),()=>{t.disconnect()}},[eZ,eX,e5]);let e6=r.useRef([]),e3=r.useRef(!1),e7=eZ?e2:e6.current;(0,s.default)(()=>{eZ&&!e3.current&&(e6.current=[]),e3.current=eZ,eZ&&e2.length>0&&(e6.current=e2)},[eZ,e2]);let e4=!w&&!$&&eq&&!eA,e8=(!E||!0===W)&&!1!==W,{onMouseDown:e9}=eF(),te=K||(e=>e.label??e),tt={...d,disablePortal:j,expanded:eG,focused:eY,fullWidth:H,getOptionLabel:te,hasClearIcon:e4,hasPopupIcon:e8,inputFocused:-1===eQ,popupOpen:eZ,size:eO},ta=(e=>{let{classes:t,disablePortal:a,expanded:o,focused:i,fullWidth:r,hasClearIcon:n,hasPopupIcon:s,inputFocused:d,popupOpen:u,size:c}=e,p={root:["root",o&&"expanded",i&&"focused",r&&"fullWidth",n&&"hasClearIcon",s&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",d&&"inputFocused"],tag:["tag",`tagSize${(0,M.A)(c)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",u&&"popupIndicatorOpen"],popper:["popper",a&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],status:["status"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return(0,l.A)(p,z,t)})(tt),to={slots:eW,slotProps:eD},[ti,tr]=(0,q.A)("root",{ref:t,className:[ta.root,g],elementType:G,externalForwardedProps:{...to,...eP},getSlotProps:eH,ownerState:tt}),[tl,tn]=(0,q.A)("listbox",{elementType:eo,externalForwardedProps:to,ownerState:tt,className:ta.listbox,getSlotProps:ez}),[ts,td]=(0,q.A)("paper",{elementType:D.default,externalForwardedProps:to,ownerState:tt,className:ta.paper}),[tu,tc]=(0,q.A)("status",{elementType:et,externalForwardedProps:to,ownerState:tt,className:ta.status,additionalProps:{role:"status","aria-live":"polite","aria-atomic":"true"}}),[tp,th]=(0,q.A)("popper",{elementType:S.A,externalForwardedProps:to,ownerState:tt,className:ta.popper,additionalProps:{disablePortal:j,style:{width:eX?eX.clientWidth:null,pointerEvents:eZ?void 0:"none"},role:"presentation",anchorEl:eX,open:eZ}}),tg=e7.length>0||ep||!E||!0===th.keepMounted,[tf,tx]=(0,q.A)("clearIndicator",{elementType:Z,externalForwardedProps:to,ownerState:tt,className:ta.clearIndicator,shouldForwardComponentProp:!0,additionalProps:{...eB(),"aria-label":v,title:v}}),[tm,tv]=(0,q.A)("popupIndicator",{elementType:Y,externalForwardedProps:to,ownerState:tt,className:ta.popupIndicator,shouldForwardComponentProp:!0,additionalProps:{...eR(),disabled:$,"aria-label":eZ?b:eS,title:eZ?b:eS}}),tb=e=>({className:ta.tag,disabled:$,...eV(e)});if(eg?eU.length>0&&(a=ej?ej(eU,tb,tt):eU.map((e,t)=>{let{key:a,...o}=tb({index:t});return(0,_.jsx)(P.A,{label:te(e),size:eO,...o,...to.slotProps.chip},a)})):ej&&null!=eU&&(a=ej(eU,tb,tt)),ec>-1&&Array.isArray(a)){let e=a.length-ec;!eY&&e>0&&(a=a.splice(0,ec)).push((0,_.jsx)("span",{className:ta.tag,children:F(e)},a.length))}
21let ty=eC||(e=>(0,_.jsxs)("li",{children:[(0,_.jsx)(ei,{className:ta.groupLabel,ownerState:tt,component:"div",children:e.group}),(0,_.jsx)(er,{className:ta.groupUl,ownerState:tt,children:e.children})]},e.key)),tw=eT||((e,t)=>{let{key:a,...o}=e;return(0,_.jsx)("li",{...o,children:te(t)},a)}),tI=(e,t)=>{let a=eK({option:e,index:t});return tw({...a,className:ta.option},e,{selected:a["aria-selected"],index:t,inputValue:e1},tt)};return(0,_.jsxs)(r.Fragment,{children:[(0,_.jsx)(ti,{...tr,children:eM({id:eJ,disabled:$,fullWidth:d.fullWidth??!0,size:"small"===eO?"small":void 0,slotProps:{inputLabel:eN(),input:{ref:e0,className:ta.inputRoot,startAdornment:a,onMouseDown:e=>{e.target===e.currentTarget&&e9(e)},...(e4||e8)&&{endAdornment:(0,_.jsxs)(J,{className:ta.endAdornment,ownerState:tt,children:[e4?(0,_.jsx)(tf,{...tx,children:f}):null,e8?(0,_.jsx)(tm,{...tv,children:e$}):null]})}},htmlInput:{className:ta.input,disabled:$,readOnly:eA,...eF()}}})}),eX&&tg?(0,_.jsx)(Q,{as:tp,...th,children:(0,_.jsxs)(X,{as:ts,...td,children:[(0,_.jsxs)(tu,{...tc,children:[ep&&0===e7.length?(0,_.jsx)(ee,{className:ta.loading,ownerState:tt,children:eh}):null,0!==e7.length||E||ep?null:(0,_.jsx)(ea,{className:ta.noOptions,ownerState:tt,onMouseDown:e=>{e.preventDefault()},children:ef})]}),e7.length>0?(0,_.jsx)(tl,{...tn,children:e7.map((e,t)=>el?ty({key:e.key,group:e.group,children:e.options.map((t,a)=>tI(t,e.index+a))}):tI(e,t))}):null]})}):null]})})},70985:(e,t,a)=>{"use strict";a.d(t,{K:()=>tw});var o=a(95155),i=a(64657),r=a(7569),l=a(3783),n=a(34462),s=a(66775),d=a(48463),u=a(11854),c=a(97403),p=a(12115),h=a(71706),g=a(71620),f=a(80105),x=a(27966),m=a(12158),v=a(2377),b=a(10874),y=a(80061),w=a(65778),I=a(42138),S=a(13677),k=a(24880),$=a(13869),A=a(90830),C=a(46759),M=a(79402),T=a(92437),j=a(22665),L=a(16002),_=a(3187),O=a(43922),W=a(88394),D=a(90162),E=a(856),P=a(89786),H=a(3228),F=a(24386),N=a(70039),R=a(11964),B=a(81724),V=a(6776),z=a(83049),K=a(84864),U=a(65030),q=a(45127),G=a(86670);let J=(0,G.default)("div")` 22 display: flex; 23 flex: 0 0 auto; 24 flex-direction: column; 25 align-items: flex-start; 26`,Z=(0,G.default)("dd")` 27 margin: 0; 28`,Y=(0,G.default)("span")` 29 font-size: ${k.Z8F}; 30 font-weight: ${k.Pqj}; 31 line-height: 24px; 32 letter-spacing: 0px; 33 margin: 0; 34 white-space: nowrap; 35`,Q=(0,G.default)("sup")` 36 font-size: 8px; 37 font-weight: ${k.Pqj}; 38 line-height: 16px; 39 margin-left: 1px; 40 padding-top: 2px; 41 position: relative; 42 top: 0.2em; 43`,X=(0,G.default)("dt")` 44 font-size: 12px; 45 font-weight: ${k.awq}; 46 letter-spacing: 0%; 47 line-height: 16px; 48 text-align: left; 49 margin: 0; 50 overflow-wrap: break-word; 51`,ee=({price:e,label:t,locale:a})=>{if(!e||!t)return null;let i=(0,q.k)(e,a);if("en-ca"===i.format||"fr-ca"===i.format)return i.display?(0,o.jsxs)(J,{children:[(0,o.jsx)(Z,{children:(0,o.jsx)(Y,{children:i.display})}),(0,o.jsx)(X,{children:t})]}):null;if("en-us"!==i.format)return null;let{dollars:r,fraction:l}=i;return r?(0,o.jsxs)(J,{children:[(0,o.jsxs)(Z,{children:[(0,o.jsx)(Y,{children:`$${r}`}),"0"!==l&&(0,o.jsx)(Q,{children:l})]}),(0,o.jsx)(X,{children:t})]}):null};var et=a(40703),ea=a(1799),eo=a(25087),ei=a(66535),er=a(27866),el=a(47370),en=a(53401),es=a(36377),ed=a(94571);er.extend(el),er.extend(en);let eu=(e,t,a)=>!1===a?e.WIONOTENABLED:t in e?e[t]:e.ITEMNOTSOLD,ec=e=>!!(null==e?void 0:e.hours)&&!!(null==e?void 0:e.openingDate)&&(0,ed.MP)(e.openingDate);var ep=a(35138),eh=a(82038),eg=a(53236),ef=a(33423),ex=a(52647),em=a(44815),ev=a(72876);let eb=(0,p.memo)(({warehouseData:e,locale:t,onSetWarehouse:a,defaultDetailsExpanded:i,moduleSettings:r,isPreferredWarehouse:n,productFlags:s,featureFlags:d,showSetWarehouseButton:u,showPhoneNumber:c,isFullPage:h,warehouseNameRef:v,pinIndex:y,shouldFocusMyWarehouse:w,setShouldFocusMyWarehouse:S,invokeSalesLocationsAPI:$=!1,renderActionButton:q,onWarehouseSelected:G,customActionAnalyticsLabel:J})=>{var Z,Y,Q,X,el,en,eb,ey,ew,eI,eS,ek,e$,eA,eC,eM;let eT,{trackEvent:ej}=(0,ef.z)(),eL=(0,p.useMemo)(()=>new l.n({composable_window:null==r?void 0:r.composable_window,key_value:null==r?void 0:r.key_value}),[null==r?void 0:r.composable_window,null==r?void 0:r.key_value]),e_=null==(Z=null==r?void 0:r.properties[0])?void 0:Z.hideScheduledHours,eO=(0,p.useMemo)(()=>({showWarehouseDetails:eL.getKeyValueItem(em.vV),hideWarehouseDetails:eL.getKeyValueItem(em.Wc),enablePinSelection:eL.getKeyValueItem(em.zt)||!0,services:eL.getKeyValueItem(em.Bg),gasPrices:eL.getKeyValueItem(em.pI),gasPriceRegular:eL.getKeyValueItem(em.VU),gasPricePremium:eL.getKeyValueItem(em.uc),gasPriceDiesel:eL.getKeyValueItem(em.Hr),gasPriceZeroEthanol:eL.getKeyValueItem(em.HF),hours:eL.getKeyValueItem(em.Al),getDirectionsLabel:eL.getKeyValueItem(em.EQ),viewStorePage:eL.getKeyValueItem(em.K_),setWarehouseButtonLabel:eL.getKeyValueItem(em.Fg),myWarehouse:eL.getComposableWindowItem(em.rw),gasStation:eL.getKeyValueItem(em.h8),tireCenter:eL.getKeyValueItem(em.FC),foodCourt:eL.getKeyValueItem(em.Jc),businessCenter:eL.getKeyValueItem(em.FW),hearingAids:eL.getKeyValueItem(em.Z1),optical:eL.getKeyValueItem(em.lL),pharmacy:eL.getKeyValueItem(em.yI),carWash:eL.getKeyValueItem(em.$9),warehousesPageUrl:eL.getKeyValueItem(C.GK),openHolidayLabel:eL.getKeyValueItem(em.VN),closedHolidayLabel:eL.getKeyValueItem(em.Hs),businessHoursLabel:eL.getKeyValueItem(em.Ch),executiveMemberLabel:eL.getKeyValueItem(em.vj),executiveMemberHoursLabel:eL.getComposableWindowItem(em.ft),serviceErrorMessage:eL.getComposableWindowItem(em.XH),businessCenterLabel:eL.getKeyValueItem(em.iw),warehouseComingSoonTitle:eL.getKeyValueItem(em._E),warehouseComingSoonDays:eL.getKeyValueItem(em.iz),gasStationOpenTitle:eL.getKeyValueItem(em.mz),gasStationOpenUntilLabel:eL.getKeyValueItem(em.xW),gasStationOnlyTitle:eL.getKeyValueItem(em.Ij),gasStationComingSoonLabel:eL.getKeyValueItem(em.H9),gasStationOnlyEarlyGasLabel:eL.getKeyValueItem(em.Em)}),[eL]),eW=(0,p.useRef)(null);(0,p.useEffect)(()=>{w&&eW.current&&setTimeout(()=>{var e;null==(e=eW.current)||e.focus(),null==S||S(!1)},0)},[w,S]);
51let{selectWarehouse:eD,expandedWarehouseId:eE,setExpandedWarehouseId:eP}=(0,eh.i)(),eH=null==(Q=null==(Y=null==e?void 0:e.name)?void 0:Y[0])?void 0:Q.value,eF=(0,p.useMemo)(()=>(0,M.B)({businessCenterLabel:eO.businessCenterLabel,name:eH}),[eO.businessCenterLabel,eH]),eN=(0,p.useMemo)(()=>(0,j.F)({invokeSalesLocationsAPI:$,warehouseData:e,warehousesPageBaseUrl:eO.warehousesPageUrl}),[$,e,eO.warehousesPageUrl]),[eR,eB]=(0,p.useState)(!1),eV=eE===(null==e?void 0:e.warehouseId),ez=(0,p.useRef)(!1);(0,p.useEffect)(()=>{!ez.current&&i&&(null==e?void 0:e.warehouseId)&&(eP(e.warehouseId),ez.current=!0)},[i,null==e?void 0:e.warehouseId,eP]);let[eK,eU]=(0,p.useOptimistic)(n),[eq,eG]=(0,p.useTransition)(),{isMobile:eJ}=(0,eg.G)(),eZ=(0,p.useCallback)(()=>{eG(async()=>{try{eU(!0),await a(),eB(!1),null==S||S(!0)}catch(e){eB(!0)}})},[a,S,eU,eG]),eY=(0,p.useCallback)(()=>{eP(eV?null:(null==e?void 0:e.warehouseId)??null)},[eV,null==e?void 0:e.warehouseId,eP]),eQ=(0,p.useCallback)(e=>{e.stopPropagation(),ej({component:{trackedData:[eV?eO.hideWarehouseDetails:eO.showWarehouseDetails]}})},[ej,eV,eO.hideWarehouseDetails,eO.showWarehouseDetails]),eX=(0,p.useCallback)(()=>{eO.enablePinSelection&&(null==e?void 0:e.warehouseId)&&eD(e.warehouseId)},[eO.enablePinSelection,eD,null==e?void 0:e.warehouseId]),e0=(0,ed.JP)(e),e1=(0,p.useMemo)(()=>{var t,a,o,i;return e?(0,ed.$J)(e,$)?(null==(a=null==(t=e.hours)?void 0:t[0])?void 0:a.close)||null:(null==(i=null==(o=null==e0?void 0:e0.hours)?void 0:o[0])?void 0:i.close)||null:null},[e0,e,$]),e2=e?(0,ed.N0)(e,$):ed.IZ.WAREHOUSE_ONLY;return(0,o.jsxs)(ev.mO,{isPreferredWarehouse:n,onClick:eX,children:[eK&&(0,o.jsxs)(ev.yZ,{"data-testid":"warehousetile-mywarehouse",children:[(0,o.jsx)(D.w,{sx:{height:"20px",marginRight:k.D3H,width:"20px"},"data-testid":em.P2}),(0,o.jsx)(m.Text,{bold:!0,color:"success",component:h?"h3":"h4",uniqueId:em.ZS,variant:"t5",ref:eW,tabIndex:-1,"aria-live":"polite",children:eO.myWarehouse})]}),(0,o.jsxs)(ev.Sl,{"data-testid":"warehousetile-nameanddistanceandlocation",children:[(0,o.jsx)(ev.gi,{children:void 0!==y?(0,o.jsx)("div",{dangerouslySetInnerHTML:{__html:(0,ep.j8)({number:y+1,weight:300})},"data-testid":"warehousetile-location-pin"}):(0,o.jsx)(F.a,{sx:{height:"20px",width:"20px"},"data-testid":"warehousetile-location-icon"})}),(0,o.jsxs)(ev.EV,{"data-testid":"warehousetile-nameanddistance",children:[(0,o.jsx)(_.Link,{href:eN,ref:v,children:(0,o.jsx)(m.Text,{sx:{display:"inline"},component:n&&!h?"h5":"h4",bold:!0,underline:!0,uniqueId:"warehousetile-nameanddistance-name",variant:"t5",children:eF})}),(null==e?void 0:e.distance)&&(null==e?void 0:e.distanceUnit)&&(0,o.jsxs)(ev.KR,{component:"span",uniqueId:"warehousetile-nameanddistance-distance",variant:"t6",children:["(",null==(X=null==e?void 0:e.distance)?void 0:X.toFixed(2)," ",null==e?void 0:e.distanceUnit,")"]})]})]}),(null==e?void 0:e.stockStatus)&&(0,T.k)(e,{useSalesLocationsApi:$})!==C.aN.GAS_STATION_ONLY&&(0,o.jsx)(K.V,{containerSx:{marginLeft:k.pMV},...((e,t,a,o,i,r)=>{var l,n;let s,d,u={INSTOCK:{color:k.Kl5,status:e.getKeyValueItem(es.ld)},LOWSTOCK:{color:k.oBd,status:e.getKeyValueItem(es.oR)},ITEMNOTSOLD:{color:k.BO,status:e.getKeyValueItem(es.bi)},NOSTOCK:{color:k.oBd,status:e.getKeyValueItem(es.aq)},WIONOTENABLED:{color:k.BO,status:e.getKeyValueItem(es.PD)}},{isVariantProduct:c,isShipToWarehouse:p}=o||{},{buyable:h,useWarehouseInventoryAvailability:g,availability:f,showWHSMolecule:x}=t||{},m=eu(u,g||f||"",x),v=x?(l=!!h,n=!!c,s=e.getKeyValueItem(es.dE),d=e.getKeyValueItem(es._w),!n&&l?s:d):"",b=((e,t,a,o,i)=>{let{buyable:r,orderPickup:l,orderCutOff:n,availability:s}=a||{},d=eu(e,s&&s in e?s:"ITEMNOTSOLD"),u="",c=i?er.tz(l,i):er(l),p=i?er.tz(n,i):er(n),h=er(),g=er(l).startOf("day").diff(h.startOf("day"),"day"),f=t.getKeyValueItem(es.mY),x=t.getKeyValueItem(es.if),m=t.getKeyValueItem(es.iF),v=t.getKeyValueItem(es.Rk),b=t.getKeyValueItem(es.Mn),y=t.getKeyValueItem(es.Jt),w=t.getKeyValueItem(es.ld),I=t.getKeyValueItem(es.oR),S=t.getKeyValueItem(es.aq),k=t.getKeyValueItem(es.bi);return!o&&r?(h.isSame(c)||h.isAfter(c))&&h.isBefore(p)?u=`${f} ${m} ${v}`:g<=1?u=`${f} ${x}`:g>1&&(u=`${f} ${c.format("MM/DD/YYYY")}`):o&&((null==d?void 0:d.status)===w||(null==d?void 0:d.status)===I)?u=b:o||r||(null==d?void 0:d.status)===S||(null==d?void 0:d.status)===k||(u=y),u})(u,e,t,!!c,r);if(!h&&x&&!a&&((null==i?void 0:i.bopiwOrStw_feature_on)??!0)&&p){let a=e.getKeyValueItem(es._Y),o=e.getKeyValueItem(es.dE);return{statusText:a,statusTextSx:{color:k.Kl5,fontWeight:k.Pqj},suffixText:o,textBlocks:[{suffixText:v,text:m.status,textSx:{color:m.color,fontWeight:k.Pqj},textVariant:"t7",uniqueId:"secondaryText"}],uniqueId:`warehousetile_${null==t?void 0:t.fulfillmentCenter}-stw-stockstatus`}}return{statusText:m.status,statusTextSx:{color:m.color,fontWeight:x?k.Pqj:k.awq},suffixText:v,textBlocks:[{text:b,textVariant:"t7",uniqueId:"secondaryText"}],uniqueId:`warehousetile_${null==t?void 0:t.fulfillmentCenter}-stockstatus`}})(eL,e.stockStatus,(0,ed.jQ)(e),s,d,null==e?void 0:e.timeZone)}),$&&((e,t,a,o,i)=>{if(!t||!e)return!1;let r=(0,ed.N0)(e,t)===ed.IZ.WAREHOUSE_COMING_SOON,l=0===(0,ed.zQ)(e);return r&&l&&!!(a&&o)&&null!==i})(e,$,eO.gasStationOpenTitle,eO.gasStationOpenUntilLabel,e1)&&(0,o.jsx)(x.default,{sx:{marginLeft:k.pMV},children:(0,o.jsx)(U.EarlyGasStationMessage,{gasStationOpenTitle:eO.gasStationOpenTitle,gasStationOpenUntilLabel:eO.gasStationOpenUntilLabel,gasClosingTime:e1,locale:t})}),(eT=((e,t,a,o)=>
51{if(!t||!e)return;let i=(0,ed.N0)(e,t);return i===ed.IZ.GAS_ONLY?(null==o?void 0:o.trim())||void 0:i===ed.IZ.GAS_OPEN_WAREHOUSE_COMING&&(null==a?void 0:a.trim())||void 0})(e,$,eO.gasStationOnlyEarlyGasLabel,eO.gasStationOnlyTitle))&&(0,o.jsx)(x.default,{sx:{marginLeft:k.pMV},"data-testid":"warehousetile-gas-station-open-badge",children:(0,o.jsx)(et.GasStationBadge,{label:eT})}),ec(e)&&(0,o.jsx)(z.K,{messages:(null==r?void 0:r.composable_window)||[],holidays:null==e?void 0:e.holidays,hours:null==e?void 0:e.hours,locale:t,sx:{marginLeft:k.pMV},timeZone:null==e?void 0:e.timeZone,variant:"bodyCopy"}),(({warehouseData:e,locationOpeningState:t})=>{if(!(null==e?void 0:e.services)||!Array.isArray(e.services)||!t)return!1;let a=(0,ed.JP)(e);return!ec(e)&&t===ed.IZ.GAS_OPEN_WAREHOUSE_COMING&&null!=a&&!!a.hours})({warehouseData:e,locationOpeningState:e2})&&(null==e0?void 0:e0.hours)&&(0,o.jsx)(z.K,{messages:(null==r?void 0:r.composable_window)||[],holidays:null==e?void 0:e.holidays,hours:null==e0?void 0:e0.hours,locale:t,sx:{marginLeft:k.pMV},timeZone:null==e?void 0:e.timeZone,variant:"bodyCopy"}),$&&((e,t,a,o)=>{if(!e||!t)return!1;let i=(0,ed.N0)(e,t);return i!==ed.IZ.GAS_ONLY&&i!==ed.IZ.GAS_COMING_SOON&&!!(0,ed.wQ)(e)&&!!(a&&o)})(e,$,eO.warehouseComingSoonTitle,eO.warehouseComingSoonDays)&&(0,o.jsx)(x.default,{sx:{marginLeft:k.pMV},children:(0,o.jsx)(eo.WarehouseComingSoonMessage,{warehouseData:e,messageTitle:eO.warehouseComingSoonTitle,messageDays:eO.warehouseComingSoonDays,"data-testid":"warehousetile-warehouse-coming-soon-message"})}),$&&(ew=e,eI=$,eS=eO.gasStationOnlyTitle,ek=eO.gasStationComingSoonLabel,e$=eO.warehouseComingSoonDays,!!eI&&!!ew&&(0,ed.N0)(ew,eI)===ed.IZ.GAS_COMING_SOON&&!!(eS&&ek&&e$))&&(0,o.jsx)(x.default,{sx:{marginLeft:k.pMV},children:(0,o.jsx)(ea.GasStationComingSoonMessage,{gasStationOnlyTitle:eO.gasStationOnlyTitle,gasStationComingSoonLabel:eO.gasStationComingSoonLabel,warehouseData:e,messageDays:eO.warehouseComingSoonDays,invokeSalesLocationsAPI:$,"data-testid":"warehousetile-gas-station-coming-soon-message"})}),(0,o.jsxs)(ev.Pi,{"data-testid":"warehousetile-seewarehousedetails",disableGutters:!0,expanded:eV,isPreferredWarehouse:n,onChange:eY,slotProps:{heading:{component:eK&&!h?"h6":"h5"}},children:[(0,o.jsx)(g.default,{"aria-label":eV?`${eO.hideWarehouseDetails} ${eF}`:`${eO.showWarehouseDetails} ${eF}`,component:"button","data-testid":"warehousetile-seewarehousedetails-icon-chevron-down",expandIcon:(0,o.jsx)(ev.ho,{}),onClick:eQ,sx:ev.cQ,children:eV?(0,o.jsx)(m.Text,{uniqueId:"warehousetile-seewarehousedetails-hidden",children:eO.hideWarehouseDetails}):(0,o.jsx)(m.Text,{uniqueId:"warehousetile-seewarehousedetails-show",children:eO.showWarehouseDetails})}),(0,o.jsxs)(f.default,{"data-testid":"warehousetile-seewarehousedetails-details",sx:{padding:k.iAn,paddingBottom:"0px"},children:[(0,o.jsxs)(x.default,{children:[(0,o.jsx)(m.Text,{uniqueId:"warehousetile-seewarehousedetails-address-line1",children:null==e?void 0:e.address.line1}),(0,o.jsxs)(m.Text,{uniqueId:"warehousetile-seewarehousedetails-address-line2",children:[(0,L.Zr)(null==e?void 0:e.address.city),", ",null==e?void 0:e.address.territory," ",null==e?void 0:e.address.postalCode]}),c&&((0,L.ic)(e,$)||ec(e)||e2===ed.IZ.GAS_COMING_SOON||e2===ed.IZ.WAREHOUSE_COMING_SOON||e2===ed.IZ.WAREHOUSE_ONLY||e2===ed.IZ.GAS_ONLY)&&(eJ?(0,o.jsx)(_.Link,{href:`tel:${null==e?void 0:e.phone}`,uniqueId:"warehousetile-seewarehousedetails-phone-link",children:(0,o.jsx)(m.Text,{uniqueId:em.ar,children:null==e?void 0:e.phone})}):(0,o.jsx)(m.Text,{uniqueId:em.ar,children:null==e?void 0:e.phone})),(0,L.ic)(e,$)&&(null==e?void 0:e.gasPrices)&&((0,ed.$J)(e,$)?(0,ed.MP)(e.openingDate):!(null==e0?void 0:e0.openingDate)||(0,ed.MP)(e0.openingDate))&&!(0,ed.mX)(e,$)&&((0,L.Hu)(e)||(0,L.O3)(e)||(0,L.$i)(e)||(0,L.Gb)(e))&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(ev.aG,{color:"light",uniqueId:"warehousetile-seewarehousedetails-gasprices",variant:"t7",children:eO.gasPrices}),(0,o.jsxs)(ev.g2,{children:[(0,L.Hu)(e)&&(0,o.jsx)(ee,{price:null==(el=null==e?void 0:e.gasPrices)?void 0:el.regular,label:eO.gasPriceRegular,locale:t}),(0,L.O3)(e)&&(0,o.jsx)(ee,{price:null==(en=null==e?void 0:e.gasPrices)?void 0:en.premium,label:eO.gasPricePremium,locale:t}),(0,L.$i)(e)&&(0,o.jsx)(ee,{price:null==(eb=null==e?void 0:e.gasPrices)?void 0:eb.diesel,label:eO.gasPriceDiesel,locale:t}),(0,L.Gb)(e)&&(0,o.jsx)(ee,{price:null==(ey=null==e?void 0:e.gasPrices)?void 0:ey.clear,label:eO.gasPriceZeroEthanol,locale:t})]})]}),ec(e)&&!e_&&(0,o.jsx)(ex.R,{businessHoursLabel:eO.businessHoursLabel,closedHolidayLabel:eO.closedHolidayLabel,executiveMemberLabel:eO.executiveMemberLabel,executiveMemberHoursLabel:eO.executiveMemberHoursLabel,hoursLabel:eO.hours,locale:t,openHolidayLabel:eO.openHolidayLabel,warehouseData:e,sxHoursLabel:{lineHeight:k.MlV}}),$&&(eA=e,eC=$,eM=eO.gasStationComingSoonLabel,!!eC&&!!eA&&(0,ed.N0)(eA,eC)===ed.IZ.WAREHOUSE_OPEN_GAS_COMING&&!!eM)&&(0,o.jsx)(x.default,{sx:{marginTop:k.Mzk,marginBottom:k.Mzk},children:(0,o.jsx)(ei.WarehouseOpenGasComingMessage,{gasStationComingSoonLabel:eO.gasStationComingSoonLabel,"data-testid":"warehousetile-warehouse-open-gas-coming-message"})}),ec(e)&&(0,L.R1)(e)&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(ev.aG,{color:"light",uniqueId:"warehousetile-seewarehousedetails-services",variant:"t7",children:eO.services}),(0,o.jsxs)(ev.FI,{"data-testid":"warehousetile-seewarehousedetails-services-icons",variant:"SimpleList",children:[(0,L.ic)(e,$)&&(0,o.jsx)(O.c,{sx:ev.Qd,uniqueId:"gasitem",children:(0,o.jsx)(P.q,{titleAccess:eO.gasStation,sx:ev.Ig,"data-testid":"gas"})}),(0,L.Oc)(e)&&(0,o.jsx)(O.c,{sx:ev.Qd,uniqueId:"carwashitem",children:(0,o.jsx)(W.K,{titleAccess:eO.carWash,sx:ev.Ig,"data-testid":"carwash"})}),(0,L.kQ)(e)&&(0,o.jsx)(O.c,{sx:ev.Qd,uniqueId:"tiresitem",children:(0,o.jsx)(B.U,{titleAccess:eO.tireCenter,sx:ev.Ig,"data-testid":"tires"})}),(0,L.XL)(e)&&(0,o.jsx)(O.c,{sx:ev.Qd,uniqueId:"businesscenteritem",children:(0,o.jsx)(V.e,{titleAccess:eO.businessCenter,sx:ev.Ig,"data-testid":"businesscenter"})}),(0,L.d9)(e)&&(0,o.jsx)(O.c,{sx:ev.Qd,uniqueId:"foodcourtitem",children:(0,o.jsx)(E.e,{titleAccess:eO.foodCourt,sx:ev.Ig,"data-testid":"foodcourt"})}),(0,L.r$)(e)&&(0,o.jsx)(O.c,{sx:ev.Qd,uniqueId:"hearingaidsitem",children:(0,o.jsx)(H.u,{titleAccess:eO.hearingAids,sx:ev.Ig,"data-testid":"hearingaids"})}),(0,L.Bs)(e)&&(0,o.jsx)(O.c,{sx:ev.Qd,uniqueId:"opticalitem",children:(0,o.jsx)(N.l,{titleAccess:eO.optical,sx:ev.Ig,"data-testid":"optical"})}),(0,L.cU)(e)&&(0,o.jsx)(O.c,{sx:ev.Qd,uniqueId:"parmacyitem",children:(0,o.jsx)(R.E,{titleAccess:eO.pharmacy,sx:ev.Ig,"data-testid":"pharmacy"})})]})]})]}),(0,o.jsxs)(x.default,{sx:{display:"flex",rowGap:"fr-ca"===t?k.iAn:0,columnGap:k.Mzk,marginTop:k.Mzk,flexDirection:"fr-ca"!==t?"row":"column"},children:[(0,o.jsx)(A.Analytics,{analyticData:{component:{trackedData:[eO.getDirectionsLabel,eF]}},children:(0,o.jsx)(m.Text,{children:(0,o.jsx)(_.Link,{"aria-label":`${eO.getDirectionsLabel} ${eF}
51`,color:k.S6v,href:(0,L.FQ)(e),underline:"always",uniqueId:"warehousetile-seewarehousedetails-getdirections",target:"_blank",children:eO.getDirectionsLabel})})}),(0,o.jsx)(A.Analytics,{analyticData:{component:{trackedData:[eO.viewStorePage,eF]}},children:(0,o.jsx)(m.Text,{children:(0,o.jsx)(_.Link,{"aria-label":`${eO.viewStorePage} ${eF}`,color:k.S6v,href:eN,underline:"always",uniqueId:"warehousetile-seewarehousedetails-viewstorepage",children:eO.viewStorePage})})})]})]})]}),q&&G?(0,o.jsx)(A.Analytics,{analyticData:{component:{trackedData:[J,eF]}},children:(0,o.jsx)(x.default,{sx:{marginLeft:k.pMV,marginTop:k.iAn},children:q(e,G)})}):u&&e&&(0,ed.AJ)(e)&&(0,o.jsxs)(A.Analytics,{analyticData:{component:{trackedData:[eO.setWarehouseButtonLabel,eF]}},children:[(0,o.jsx)(b.Button,{sx:{marginLeft:k.pMV,marginTop:k.iAn},"aria-label":`${eO.setWarehouseButtonLabel} ${eF}`,disabled:eq,onClick:eZ,uniqueId:"warehousetile-setwarehouse-as-preferred",children:eO.setWarehouseButtonLabel}),eR&&(0,o.jsx)(I.Notification,{message:eO.serviceErrorMessage,severity:"alert",sx:{marginLeft:k.pMV,marginTop:k.m72}})]})]})});eb.displayName="WarehouseTile";var ey=a(54309),ew=a(34971),eI=a(25719);let eS=()=>(0,o.jsxs)(eI.CostcoBox,{sx:{borderBottom:`${k.RYE} solid ${k.XgP}`,display:"flex",flexDirection:"column",padding:k.Mzk,rowGap:k.iAn},"data-testid":"warehousetile_skeleton",children:[(0,o.jsx)(eI.CostcoBox,{sx:ey.A,children:"Loading"}),(0,o.jsxs)(eI.CostcoBox,{sx:{alignItems:"center",display:"flex",gap:k.D3H},"data-testid":"skeleton_content_1",children:[(0,o.jsx)(ew.Skeleton,{"data-testid":"skeleton_locationicon",height:20,hiddenText:"",variant:"circular",width:20}),(0,o.jsx)(ew.Skeleton,{"data-testid":"skeleton_nameanddistance",hiddenText:"",variant:"textHeader",width:220})]}),(0,o.jsx)(eI.CostcoBox,{sx:{alignItems:"flex-start",display:"flex",flexdirection:"column",paddingLeft:k.pMV},"data-testid":"skeleton_content_2",children:(0,o.jsx)(ew.Skeleton,{"data-testid":"skeleton_stockstatus",hiddenText:"",variant:"textHeader",width:170})}),(0,o.jsx)(eI.CostcoBox,{sx:{alignItems:"flex-start",display:"flex",flexdirection:"column",paddingLeft:k.pMV},"data-testid":"skeleton_content_3",children:(0,o.jsx)(ew.Skeleton,{"data-testid":"skeleton_openinghours",hiddenText:"",variant:"textHeader",width:120})}),(0,o.jsxs)(eI.CostcoBox,{sx:{alignItems:"flex-start",display:"flex",flexdirection:"column",gap:k.iAn,paddingLeft:k.pMV},"data-testid":"skeleton_content_4",children:[(0,o.jsx)(ew.Skeleton,{"data-testid":"skeleton_seewarehousedetails",hiddenText:"",variant:"textHeader",width:155}),(0,o.jsx)(ew.Skeleton,{"data-testid":"skeleton_acccordionicon",height:24,hiddenText:"",variant:"rectangular",width:20})]}),(0,o.jsx)(eI.CostcoBox,{sx:{alignItems:"flex-start",display:"flex",flexdirection:"column",paddingLeft:k.pMV,paddingTop:k.iAn},"data-testid":"skeleton_content_5",children:(0,o.jsx)(ew.Skeleton,{"data-testid":"skeleton_button",height:40,hiddenText:"",variant:"button",width:236})})]}),ek="WarehouseDrawer";var e$=a(49820);let eA=({moduleSettings:e,onSearch:t,defaultFiltersVisible:a,getAutosuggest:o,drawerType:r,syncWithUrl:n=!1,analyticsEventTemplate:s,onWarehouseNumberSearch:d,persistedSearchText:h})=>{let{trackEvent:g}=(0,ef.z)(),{queryParams:f}=(0,i.useQueryParams)(),[x,m]=(0,p.useState)(!1),[v,b]=(0,p.useState)(a??!1),[y,w]=(0,p.useState)([]),[I,S]=(0,p.useState)(null),k=f.get(c.hS),$=(0,p.useMemo)(()=>new l.n({composable_window:e.composable_window,key_value:e.key_value}),[e]),A=n&&k?k:h??"",C=(0,p.useMemo)(()=>({filters:n?(0,u.hi)(e,f):(0,u.s_)(e),searchText:A}),[e,A,n,f]),M=(0,e$.Wx)({enableReinitialize:n||void 0!==h,initialValues:C,onSubmit:e=>{var a;if((null==(a=e.searchText)?void 0:a.startsWith("#"))&&d){d(e.searchText.replace("#","")),S(e.searchText);return}g({...{identifier:"whSearchTerm",location:`${"FMW"===r?"find a warehouse":"check nearby warehouses"} flyout`,trackType:"search"},...s,keyword:e.searchText,trackType:(null==s?void 0:s.trackType)??"search"}),t(e),S(e.searchText)},validate:t=>(0,u.l)(e,t)}),T=(0,p.useCallback)(async e=>{var t;if(e.startsWith("#"))return void w([]);try{let a=await (null==o?void 0:o(e)),i=(null==(t=null==a?void 0:a.resourceSets[0].resources[0].value)?void 0:t.filter(e=>{var t;return!!(null==(t=null==e?void 0:e.address)?void 0:t.formattedAddress)}).map(e=>({address:e.address.formattedAddress,locality:e.address.locality,postalCode:e.address.postalCode})))||[];w((0,ed.Sv)(i))}catch{w([])}},[o]),j=(0,p.useCallback)(e=>{e.preventDefault(),M.handleSubmit()},[M]),L=(0,p.useCallback)((e,t,a)=>{if(!e&&!t)return null;e&&"reset"===a?x||j(e):(null==e?void 0:e.code)!=="Enter"&&(null==e?void 0:e.code)!=="NumpadEnter"&&(M.setFieldValue("searchText",t),t.length>0?T(t):w([]))},[T,M,j,x]),_=(0,p.useCallback)(()=>{y.length>0&&M.setFieldValue("searchText",y[0].address)},[y,M]);return{formik:M,options:y,labels:(0,p.useMemo)(()=>({searchFieldLabel:$.getKeyValueItem(c.$o),filters:{showWarehouseFiltersBtnText:$.getKeyValueItem(c.KP),hideWarehouseFiltersBtnText:$.getKeyValueItem(c.xx),warehouseFiltersLegend:$.getKeyValueItem(c.jX)}
51,aria:{panelAriaLabel:$.getKeyValueItem(c.zH),listBoxAriaLabel:$.getKeyValueItem(c.Up)}}),[$]),isFiltersOpen:v,isAutocompleteDropdownOpen:x,locationSearchParam:I||k,actions:{setIsFiltersOpen:b,setIsAutocompleteDropdownOpen:m,setOptions:w,selectFirstOption:_,getOptionLabel:ed.Oi},handlers:{handleSubmit:j,onInputChange:L,fetchSuggestions:T}}},eC=async(e,t,a,o="",i)=>{let{endpoint:r="",method:l="POST",required_request_headers:n,connection_timeout:s,timeout:d}=i,{client_identifier:u,content_type:c}=n||{},p=u[String("en-us"===e?"USBC":"CABC").toLowerCase()]||"",{env:h="",service:g=""}=n.costco,f={body:JSON.stringify({distributionCenters:a,itemNumbers:t,selectedWarehouse:o}),headers:{"client-identifier":p,"content-type":c,"costco.env":h,"costco.service":g},method:l,signal:s?AbortSignal.timeout(s):null,timeout:d};try{let e=await fetch(r,f),{status:a,statusText:o}=e,i=await e.json();return e.ok||console.error(`PDPBI Child Ids: ${t} Status: ${a} Status Text: ${o} Response: - ${JSON.stringify(i)}`),{batchInfo:i,status:a}}catch(e){throw console.error(`PDPBI Child Ids: ${t} failed with PBI Error: ${e}`),e}};var eM=a(51563);let eT=e=>(null==e?void 0:e.map(e=>({...e,isInStock:!1,stockStatus:{showWHSMolecule:!1}})))||[],ej=async(e,t,a)=>{let o,i=e=>{var t;return(null==(t=e.stockStatus)?void 0:t.showWHSMolecule)===!0};return t?1===(o=e.filter(e=>{var t,o;return e.warehouseId===a||!0===(t=e).isInStock||(null==(o=t.stockStatus)?void 0:o.useWarehouseInventoryAvailability)&&["INSTOCK","LOWSTOCK"].includes(t.stockStatus.useWarehouseInventoryAvailability)})).length?[{...o[0],isEnabled:e.filter(i).length>=2,isNotification:!0}]:o:1===(o=e.filter(e=>e.warehouseId===a||i(e))).length?[{...o[0],isEnabled:!1,isNotification:!0}]:e},eL=({warehouses:e,preferredWarehouse:t,locale:a,childItemNumber:o,batchSize:i,productFlags:r,configs:l,isLoading:n,pageName:s})=>{var d,u;let c=!("PDP"===s&&(null==r?void 0:r.isShipToWarehouse)&&((null==(u=null==(d=l.featureConfigs)?void 0:d.custom)?void 0:u.bopiwOrStw_feature_on)??!0)),[h,g]=(0,p.useState)({warehouseList:[],isBatchLoading:!1,isLoadingEnabledWH:!1,isProductUnavailable:!1,enabledWHList:[],disabledWHList:[],checked:c}),f=(0,p.useRef)([]),x=(0,p.useRef)(0),m=(0,p.useRef)(null),v=(0,p.useRef)(null),b=a.split("-")[1],{enabledWHListLucid:y,enabledWHListBopiw:w,enabledWHListWio:I}=(0,p.useMemo)(()=>{var e,t,a,o,i,r;return{enabledWHListLucid:new Set((null==(t=null==(e=l.enabledWarehouseListConfigs)?void 0:e.enabledWhListLucid)?void 0:t.custom.enabledWarehousesList[b])||[]),enabledWHListBopiw:new Set((null==(o=null==(a=l.enabledWarehouseListConfigs)?void 0:a.enabledWhListBopiw)?void 0:o.custom.enabledWarehousesList[b])||[]),enabledWHListWio:new Set((null==(r=null==(i=l.enabledWarehouseListConfigs)?void 0:i.enabledWhListWio)?void 0:r.custom.enabledWarehousesList[b])||[])}},[l,b]),S=(0,p.useCallback)(async(e,a)=>{let o=(0,ed.$r)(e,t),r=await ej(o,h.checked,t),l=(0,eM.uJ)(a)?x.current:0;x.current=l+i,f.current=o,g(e=>({...e,warehouseList:r}))},[i,h.checked,t]),k=(0,p.useCallback)(async(t,i=[])=>{if(null==e?void 0:e.length){if(!(null==t?void 0:t.length))return void S(eT(e),i);g(e=>({...e,isBatchLoading:!0}));try{let{inWarehouse:r,useWarehouseInventory:n}=(await eC(a,[o],t,"",l.batchServiceConfig)).batchInfo[0].programTypes,s=e.filter(e=>t.includes(`${null==e?void 0:e.warehouseId}${C.Kc}`)).map(e=>{let t,a,o,i,l,{isInStock:s,stockStatus:d}=(t=`${null==e?void 0:e.warehouseId}${C.Kc}`,o=(a=(null==r?void 0:r.find(e=>(null==e?void 0:e.fulfillmentCenter)===t))??{})&&((null==a?void 0:a.availability)==="INSTOCK"||(null==a?void 0:a.availability)==="LOWSTOCK"),i=(null==n?void 0:n.find(e=>(null==e?void 0:e.fulfillmentCenter)===t))??{},l=null==i?void 0:i.availability,{isInStock:o,stockStatus:{showWHSMolecule:!0,...a,...i,useWarehouseInventoryAvailability:l}});return{...e,isInStock:s,stockStatus:d}}),d=(0,eM.uJ)(i)?[...f.current,...s]:[...s,...0===i.length?[]:e.filter(e=>i.includes(`${null==e?void 0:e.warehouseId}${C.Kc}`)).map(e=>({...e,isInStock:!1,stockStatus:{showWHSMolecule:!1}}))];S(d,i)}catch{g(e=>({...e,isProductUnavailable:!1})),S(eT(e),i)}finally{g(e=>({...e,isBatchLoading:!1}))}}},[l.batchServiceConfig,o,a,e,S]),$=(0,p.useCallback)(async()=>{var t;if(null==e?void 0:e.length){g(e=>({...e,isLoadingEnabledWH:!0}));try{let a=e.map(e=>`${null==e?void 0:e.warehouseId}${C.Kc}`);
51if(!a.length||!l.featureConfigs||!(null==y?void 0:y.size)||((null==r?void 0:r.isBopiwProduct)&&(null==r?void 0:r.isWioProduct)?!(null==w?void 0:w.size)&&!(null==I?void 0:I.size):(null==r?void 0:r.isBopiwProduct)&&!(null==w?void 0:w.size)||(null==r?void 0:r.isWioProduct)&&!(null==I?void 0:I.size)))throw Error("WarehouseDrawer: Missing required parameters for determining enabled warehouses. Check feature configs and enabled warehouse lists.");let o=((e,t,a,o,i,r)=>{let{isBopiwProduct:l,isWioProduct:n}=r||{},{warehouseChannel_feature_on:s=!0,bopiwOrStw_feature_on:d=!0,wio_feature_on:u=!0}=(null==t?void 0:t.custom)||{};return e.map(e=>{let t=(null==a?void 0:a.has(e))&&(null==i?void 0:i.has(e)),r=(null==a?void 0:a.has(e))&&(null==o?void 0:o.has(e)),c=s&&u&&t,p=s&&d&&r;return l&&n&&(p||c)||n&&c?{fulfillmentCenter:e,showWHSMolecule:"true"}:l&&p?{fulfillmentCenter:e,showWHSMolecule:"true"}:{fulfillmentCenter:e,showWHSMolecule:"false"}})})(a,l.featureConfigs,y,w,I,r);if(null==o?void 0:o.length){let e,a,n=!!((null==(t=l.featureConfigs)?void 0:t.custom.bopiwOrStw_feature_on)&&(null==r?void 0:r.isShipToWarehouse)),{enabledWarehouses:s,disabledWarehouses:d}=(e=[],a=[],o.forEach(({fulfillmentCenter:t,showWHSMolecule:o})=>{n||"true"===o?e.push(t):a.push(t)}),{disabledWarehouses:a,enabledWarehouses:e});g(e=>({...e,enabledWHList:s,disabledWHList:d})),k(s.slice(0,i),d)}else if((0,eM.uJ)(o)&&!h.checked){let t=eT(e);g(e=>({...e,warehouseList:t,isProductUnavailable:!0}))}}catch{g(e=>({...e,isProductUnavailable:!0}))}finally{g(e=>({...e,isLoadingEnabledWH:!1}))}}},[i,h.checked,e,k,y,w,I,r,l.featureConfigs]),A=(0,p.useCallback)(async()=>{if(h.isBatchLoading||!h.enabledWHList.length||!f.current.length)return;let e=h.enabledWHList.slice(x.current,x.current+i)||[];(0,eM.uJ)(e)||k(e)},[h.enabledWHList,h.isBatchLoading,k,i]),M=(0,p.useCallback)(e=>{m.current&&m.current.disconnect(),n||h.isBatchLoading||h.isLoadingEnabledWH||(m.current=(0,eM.rX)(e=>{e[0].isIntersecting&&A()},{root:v.current,threshold:.35}),e&&m.current.observe(e))},[n,h.isBatchLoading,h.isLoadingEnabledWH,v,A]),T=(0,p.useMemo)(()=>h.disabledWHList.length+h.enabledWHList.length!==f.current.length,[h.disabledWHList.length,h.enabledWHList.length,f.current.length]),j=(0,p.useCallback)(()=>{x.current=0,f.current=[],g(e=>({...e,warehouseList:[],enabledWHList:[],disabledWHList:[],isProductUnavailable:!1}))},[]),L=(0,p.useCallback)(()=>{g(e=>({...e,checked:c}))},[c]),_=(0,p.useCallback)(()=>e=>{g(t=>({...t,checked:e.target.checked})),e.target.removeAttribute("checked")},[]);return(0,p.useEffect)(()=>{(async()=>{var e;if(h.warehouseList.length>0){let a=await ej(null==f?void 0:f.current,h.checked,t);g(e=>({...e,warehouseList:a})),null==(e=null==v?void 0:v.current)||e.scroll({behavior:"smooth",top:0})}})()},[h.checked]),(0,p.useEffect)(()=>{h.isLoadingEnabledWH||(j(),$())},[e,j]),{state:h,resetCheckboxState:L,showSentinel:T,sentinelRef:M,rootRef:v,allWHList:f,handleFilterCheckbox:_}};var e_=a(1051),eO=a(46295),eW=a(69758),eD=a(98935),eE=a(54506),eP=a(86293),eH=a(13400);let eF=(0,G.default)(x.default)` 52 display: flex; 53 flex-direction: column; 54 align-items: flex-start; 55 align-self: stretch; 56 gap: ${k.Mzk}; 57`,eN=(0,G.default)(x.default)` 58 display: flex; 59 align-items: flex-start; 60 align-self: stretch; 61 gap: ${k.Mzk}; 62`,eR={alignItems:"center",display:"flex",flexDirection:"column",justifyContent:"center",width:"72px"},eB={WebkitBoxOrient:"vertical",WebkitLineClamp:3,display:"-webkit-box",flex:"1 0 0",overflow:"hidden",textOverflow:"ellipsis"},eV=(0,G.default)("form")` 63 display: flex; 64 flex-direction: column; 65 align-items: flex-start; 66 align-self: stretch; 67 gap: ${k.Mzk}; 68`,ez=(0,G.default)(eW.A)` 69 width: 100%; 70 & .MuiOutlinedInput-root.MuiInputBase-sizeSmall { 71 padding: 0px; 72 &. MuiAutocomplete-input { 73 padding-right: ${k.Mzk}; 74 } 75 } 76 & .MuiAutocomplete-inputFocused { 77 box-sizing: border-box; 78 height: 40px; 79 } 80`,eK=(0,G.default)(eD.A)` 81 width: 100%; 82 height: auto; 83 84 label { 85 background: none; 86 color: ${k.sLX}; 87 max-width: 185px; 88 } 89 90 label.MuiFormLabel-filled { 91 padding-right: ${k.iAn}; 92 padding-left: ${k.m72}; 93 margin-left: 0px; 94 margin-right: 0px; 95 background: ${k.DJJ}; 96 } 97 98 label.Mui-focused { 99 background: ${k.DJJ}; 100 color: ${k.tjF}; 101 margin-left: 0px; 102 padding-right: ${k.iAn}; 103 padding-left: ${k.m72}; 104 } 105 106 label.Mui-error { 107 color: ${k.Tao}; 108 } 109 110 & .MuiOutlinedInput-root { 111 background-color: ${k.DJJ}; 112 gap: 0px; 113 border-radius: ${k.oOK}; 114 padding-right: ${k.Mzk}; 115 padding-left: 20px; 116 117 .MuiInputAdornment-positionEnd { 118 button { 119 margin-right: -${k.D3H}; 120 } 121 } 122 123 input { 124 padding-right: ${k.Mzk}; 125 padding-left: 0px; 126 font-weight: ${k.awq}; 127 line-height: ${k.MlV}; 128 word-wrap: break-word; 129 color: ${k.S6v}; 130 } 131 132 button { 133 border-top-left-radius: 0px; 134 border-bottom-left-radius: 0px; 135 } 136 } 137 138 & .MuiOutlinedInput-root.Mui-focused > .MuiOutlinedInput-notchedOutline { 139 border-color: ${k.tjF}; 140 } 141 142 & .MuiOutlinedInput-root.Mui-error > .MuiOutlinedInput-notchedOutline { 143 border-color: ${k.Tao}; 144 border-width: 2px; 145 } 146 147 & 148 .MuiOutlinedInput-root.Mui-focused.Mui-error 149 > .MuiOutlinedInput-notchedOutline { 150 border-color: ${k.Tao}; 151 border-width: 2px; 152 } 153 154 & .MuiInputAdornment-positionStart { 155 padding-right: ${k.iAn}; 156 margin-right: 0px; 157 } 158 159 & .MuiInputAdornment-positionEnd { 160 padding-left: ${k.iAn}; 161 margin-left: 0px; 162 } 163 164 & .MuiInputBase-multiline { 165 width: 100%; 166 height: auto; 167 } 168 169 & .MuiOutlinedInput-notchedOutline { 170 border-width: ${k.RYE}; 171 border-color: ${k.BO}; 172 173 legend { 174 padding-right: 0px; 175 padding-left: 0px; 176 177 & span { 178 padding-right: 0px; 179 padding-left: 0px; 180 } 181 } 182 } 183 184 & .MuiFormHelperText-root { 185 margin-right: ${k.D3H}; 186 margin-left: ${k.D3H}; 187 } 188`,eU=(0,G.default)(eE.default)` 189 &.MuiAutocomplete-option.Mui-focused { 190 background-color: ${k.KLo}; 191 } 192`,eq=(0,G.default)(eP.default)` 193 &::before { 194 display: none; 195 } 196 background-color: ${k.DJJ}; 197 border: none; 198 box-shadow: none; 199`,eG={"& .MuiAccordionSummary-content":{margin:0},"&.MuiButtonBase-root.MuiAccordionSummary-root.Mui-focusVisible":{backgroundColor:"transparent",outline:"2px auto -webkit-focus-ring-color",outlineoffset:"2px"},alignItems:"center",display:"flex",gap:k.m72,minHeight:"18px",padding:0},eJ=(0,G.default)(eH.y)` 200 color: ${k.S6v}; 201 height: 18px; 202 width: 18px; 203`,eZ=(0,G.default)(x.default)` 204 background-color: white; 205 display: flex; 206 flex: 1 1 auto; 207 flex-direction: column; 208 overflow: auto; 209 padding: ${k.Mzk}; 210 height: 100%; 211`,eY=(0,G.default)("legend")(()=>({...ey.A})),eQ=(0,G.default)(x.default)` 212 display: flex; 213 justify-content: center;
214 align-items: flex-start; 215 align-self: stretch; 216 padding-top: ${k.i_v}; 217`,eX=(0,p.memo)(({moduleSettings:e,preferredWarehouse:t,onClose:a,onUpdatePreferredWarehouse:i,onSelectWarehouse:r,warehouse:l,locale:n,drawerType:d,pageName:u,productFlags:c,featureFlags:h,invokeSalesLocationsAPI:g=!1})=>{let{updateStwInfo:f}=(0,s.P)(),x="CMW"===d,m=(0,p.useCallback)(()=>{var e,t,o,n,s;let p=null==(t=null==(e=null==l?void 0:l.name)?void 0:e[0])?void 0:t.value,h=null==(o=null==l?void 0:l.address)?void 0:o.countryName,g=null==(n=null==l?void 0:l.address)?void 0:n.postalCode,m=null==(s=null==l?void 0:l.address)?void 0:s.territory,v=null==l?void 0:l.warehouseId;x&&f({stwMyWarehouse:v,stwPostalCode:g.split("-")[0]});try{i({city:p,countryCode:h,postalCode:g,territory:m,warehouseId:v,warehouseDrawer:d,...x&&{itemType:(null==c?void 0:c.isShipToWarehouse)?"STW":"BOPIW",pageName:u??"PDP",orderItemId:""}}),null==r||r(v),a()}catch(e){throw console.error("Failed to update preferred warehouse:",e),e}},[l,x,f,i,d,null==c?void 0:c.isShipToWarehouse,u,r,a]),v=l.warehouseId===t,b=((e,t,a,o,i=!1)=>{var r,l;let n=(0,T.k)(t,{useSalesLocationsApi:i});return n!==C.aN.BUSINESS_CENTER&&n!==C.aN.SHOWROOM&&n!==C.aN.GAS_STATION_ONLY&&(null==e?void 0:e.includes(null==(r=null==t?void 0:t.address)?void 0:r.countryName.toLowerCase()))&&("CMW"===a?"stockStatus"in t&&(null==(l=null==t?void 0:t.stockStatus)?void 0:l.showWHSMolecule)===!0:"FMW"!==a||!o)})(n,l,d,v,g);return(0,o.jsx)(eb,{isPreferredWarehouse:v,locale:n,moduleSettings:e,onSetWarehouse:m,warehouseData:l,productFlags:c,featureFlags:h,showSetWarehouseButton:b,invokeSalesLocationsAPI:g},l.warehouseId)});eX.displayName="WrappedWarehouseTile";let e0=({isFMW:e,isCMW:t,productImageData:a,handlers:i,labels:r,actions:l,bodyText:n,formik:s,drawerFindBtnLabel:d,warehouseFiltersLegend:u,options:c,drawerOptionsDetails:p,isFiltersOpen:h,state:y,handleFilterCheckbox:w,wioEnabledPricingText:I,announcement:S,analyticsIdentifier:$})=>(0,o.jsxs)(eF,{children:[e&&(0,o.jsx)(m.Text,{uniqueId:"warehousedrawer-header-bodytext",variant:"t6",children:n}),t&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(eN,{children:[(0,o.jsx)(eO.X,{srcFallback:(null==a?void 0:a.srcFallback)??"",titleFallback:(null==a?void 0:a.titleFallback)??"",ariaHidden:!0,src:(null==a?void 0:a.src)??"",sx:eR,title:(null==a?void 0:a.title)??"",uniqueId:"warehousedrawer-header-productimage"}),(0,o.jsx)(m.Text,{sx:eB,uniqueId:"warehousedrawer-header-productdescription",variant:"t6",component:"h3",children:null==a?void 0:a.description})]}),(0,o.jsx)(v.Divider,{})]}),(0,o.jsxs)(eV,{onSubmit:i.handleSubmit,children:[(0,o.jsx)(ez,{slotProps:{listbox:{"aria-label":r.aria.listBoxAriaLabel}},onClose:()=>l.setIsAutocompleteDropdownOpen(!1),onKeyDown:e=>{"Enter"===e.key&&(l.selectFirstOption(),l.setOptions([]),i.handleSubmit(e))},onOpen:()=>l.setIsAutocompleteDropdownOpen(!0),renderInput:e=>(0,o.jsx)(eK,{"data-testid":"warehousedrawer-textfield",...e,slotProps:{...e.slotProps,input:{...e.slotProps.input,endAdornment:(0,o.jsx)(b.Button,{onClick:e=>{l.selectFirstOption(),i.handleSubmit(e)},sx:{backgroundColor:k.H4y},uniqueId:"warehousedrawer-submit",variant:"primary",children:d})},htmlInput:{...e.slotProps.htmlInput,maxLength:50,name:r.searchFieldLabel}},label:r.searchFieldLabel,size:"small",variant:"outlined"}),renderOption:({key:e,...t},a)=>(0,o.jsxs)(eU,{...t,children:[a.locality,(0,o.jsx)("br",{}),a.address]},a.address),freeSolo:!0,getOptionLabel:l.getOptionLabel,inputValue:s.values.searchText,onInputChange:i.onInputChange,options:c}),e&&(0,o.jsxs)(eq,{"data-testid":"warehousedrawer-warehousefilter",disableGutters:!0,slotProps:{transition:{timeout:175}},expanded:h,onChange:()=>{l.setIsFiltersOpen(!h)},children:[(0,o.jsx)(A.Analytics,{analyticData:{component:{trackedData:[h?r.filters.hideWarehouseFiltersBtnText:r.filters.showWarehouseFiltersBtnText]}},children:(0,o.jsx)(g.default,{"aria-label":h?r.filters.hideWarehouseFiltersBtnText:r.filters.showWarehouseFiltersBtnText,component:"button","data-testid":"warehousedrawer-warehousefilter-icon-chevron-down",expandIcon:(0,o.jsx)(eJ,{}),sx:eG,children:h?(0,o.jsx)(m.Text,{variant:"t6",uniqueId:"warehousedrawer-warehousefilter-hidden",children:r.filters.hideWarehouseFiltersBtnText}):(0,o.jsx)(m.Text,{variant:"t6",uniqueId:"warehousedrawer-warehousefilter-show",children:r.filters.showWarehouseFiltersBtnText})})}),(0,o.jsx)(f.default,{"data-testid":"warehousedrawer-warehousefilter-details",sx:{padding:0,paddingTop:k.Mzk},children:(0,o.jsxs)(x.default,{sx:{border:"none",display:"flex",flexDirection:"column",gap:k.Mzk,margin:0,padding:0},component:"fieldset",children:[(0,o.jsx)(eY,{children:u}),p.map(e=>(0,o.jsx)(e_.k,{isChecked:!!s.values.filters[e.id],onChange:t=>{s.setFieldValue("filters",{...s.values.filters,[e.id]:t.target.checked})},option:e,uniqueId:`warehousedrawer-${e.label}`},e.id))]})})]}),t&&(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)(x.default,{children:[p.map(e=>(0,o.jsx)(A.Analytics,{analyticData:{component:{identifier:$||"My Warehouse",trackedData:["Check Nearby Warehouses Modal",y.checked?"Uncheck In-Stock Nearby":"Check In-Stock Nearby"],type:"ui"},trackType:"navigation"}
217,children:(0,o.jsx)(e_.k,{isChecked:y.checked,onChange:w(),option:e,uniqueId:`warehousedrawer-${e.label}`},e.id)})),(0,o.jsx)(m.Text,{sx:{alignItems:"center",alignSelf:"stretch",display:"flex",paddingLeft:k.pMV},color:"light",uniqueId:"warehousedrawer-wioenabledtext",variant:"t7",children:I})]})}),(0,o.jsx)("div",{style:{left:"-9999px",position:"absolute"},"aria-live":"polite",role:"status",children:S})]})]}),e1=({onUpdatePreferredWarehouse:e,onSelectWarehouse:t,onClose:a,isLoading:i,warehouses:r,locale:l,moduleSettings:n,preferredWarehouse:s,isFMW:d,isCMW:u,rootRef:c,sentinelRef:p,displayedWarehouses:h,drawerType:g,showSentinel:f,notificationAlert:m,pageName:v,productFlags:b,featureFlags:S,invokeSalesLocationsAPI:C=!1})=>(0,o.jsx)(A.Analytics,{analyticData:{component:{identifier:`${d?"find a warehouse":"check nearby warehouses"} flyout`,type:"ui"},trackType:"navigation"},children:(0,o.jsxs)(x.default,{sx:{height:"100%",...i&&(!h||0===h.length)?{backgroundColor:k.DJJ,opacity:.6}:{}},children:[i&&(!h||0===h.length)&&(0,o.jsx)(eQ,{"data-testid":"warehousedrawer-spinner",children:(0,o.jsx)(y.y,{size:w.HU.Medium,hasBackdrop:!1,label:"loading-warehouses"})}),(!i||h&&h.length>0)&&(0,o.jsxs)(x.default,{sx:{display:"flex",flex:"1 1 auto",flexDirection:"column",height:"100%",gap:r&&(null==r?void 0:r.length)<=1?"initial":k.iAn,...u?{overflowY:"auto"}:{}},ref:c,children:[h&&h.length>0&&h.map(i=>(0,o.jsx)(eX,{onUpdatePreferredWarehouse:e,onSelectWarehouse:t,locale:l,moduleSettings:n,onClose:a,preferredWarehouse:s,warehouse:i,drawerType:g,pageName:v,productFlags:b,featureFlags:S,invokeSalesLocationsAPI:C},i.warehouseId)),u&&f&&(0,o.jsx)(x.default,{ref:p,sx:{marginTop:k.iAn},children:(0,o.jsx)(eS,{})}),m&&(0,o.jsx)(eZ,{children:(0,o.jsx)(I.Notification,{icon:(0,o.jsx)($.A,{}),message:m.message,severity:m.severity,uniqueId:`warehousedrawer-${m.uniqueId}`})})]})]})}),e2=({announcement:e,defaultFiltersVisible:t,getAutosuggest:a,isLoading:i,isOpen:r,moduleSettings:n,onClose:s,onSearch:d,onUpdatePreferredWarehouse:h,onSelectWarehouse:g,preferredWarehouse:f,warehouses:x,locale:m,isInline:v,drawerType:b,batchServiceConfig:y,childItemNumber:w,productImageData:I,stwErrorMessage:$,featureConfigs:A,enabledWarehouseListConfigs:C,pageName:M,productFlags:T,analyticsIdentifier:j,invokeSalesLocationsAPI:L=!1,useChangeWarehouseTitle:_=!1,...O})=>{let W="CMW"===b,D="FMW"===b,E=D?O.onWarehouseNumberSearch:void 0,P=(0,p.useMemo)(()=>new l.n({composable_window:n.composable_window,key_value:n.key_value,properties:n.properties}),[n]),H=P.getKeyValueItem(_?c.kU:c.vP),F=P.getKeyValueItem(c.zD),N=P.getKeyValueItem(c.mM),R=P.getKeyValueItem(c.yj),B=P.getKeyValueItem(c.Ry),V=P.getKeyValueItem(c.jX),z=P.getPropertiesItem(c.jE)??3,K=(0,p.useMemo)(()=>(0,u.UO)(n,!1),[n]),{formik:U,options:q,labels:G,isFiltersOpen:J,actions:Z,handlers:Y}=eA({moduleSettings:n,onSearch:d,defaultFiltersVisible:t,getAutosuggest:a,drawerType:b,onWarehouseNumberSearch:E}),{state:Q,resetCheckboxState:X,showSentinel:ee,sentinelRef:et,rootRef:ea,allWHList:eo,handleFilterCheckbox:ei}=eL({warehouses:x,preferredWarehouse:f,locale:m,childItemNumber:w,batchSize:z,configs:{batchServiceConfig:y,featureConfigs:A,enabledWarehouseListConfigs:C},productFlags:T,pageName:M,isLoading:i}),er=(0,p.useCallback)(()=>{s(),U.setFieldValue("searchText",""),Z.setOptions([]),X()},[s,X]),el=(0,p.useMemo)(()=>(({preferredWarehouse:e,warehouses:t,allWHList:a,displayedWarehouses:o,stwErrorMessage:i,isLoading:r,isBatchLoading:l,isProductUnavailable:n,checked:s,msStore:d,drawerType:u})=>{var p,h,g,f,x;if(!r){let r=d.getKeyValueItem(c.WX),m=d.getKeyValueItem(c.DS),v=d.getKeyValueItem(c.zr),b=d.getKeyValueItem(c.SH),y=!(null==t?void 0:t.length)||(null==t?void 0:t.length)===1&&t[0].warehouseId===e;if(y&&!i)return{message:r,severity:"alert",uniqueId:"searchFailureAlertText"};if(y&&i||(null==(p=null==o?void 0:o[0])?void 0:p.isNotification)===!0&&(null==(h=null==o?void 0:o[0])?void 0:h.isEnabled)===!1)return{message:m,severity:"alert",uniqueId:"unableToDetermineAvailabilityAlertText"};if((null==(g=null==o?void 0:o[0])?void 0:g.isNotification)===!0&&(null==(f=null==o?void 0:o[0])?void 0:f.isEnabled)===!0)return{message:v,severity:"alert",uniqueId:"outOfStockAlertText"};if("CMW"===u&&(null==t?void 0:t.length)&&t.length>1&&!l&&n&&!(null==(x=null==a?void 0:a.current)?void 0:x.length)&&s)return{message:b,severity:"alert",uniqueId:"productUnavailableAlertText"}}return null})({preferredWarehouse:f,warehouses:x,allWHList:eo,displayedWarehouses:Q.warehouseList,stwErrorMessage:!!$,isLoading:i,isBatchLoading:Q.isBatchLoading,isProductUnavailable:Q.isProductUnavailable,checked:Q.checked,msStore:P,drawerType:b}),[f,x,eo,Q.warehouseList,$,i,Q.isBatchLoading,Q.isProductUnavailable,Q.checked,P,b]),en=(0,p.useMemo)(()=>W?Q.warehouseList:x,[W,Q.warehouseList,x]);return n&&(!W||y&&A&&C)?v?(0,o.jsxs)("div",{style:{textAlign:"start"},children:[(0,o.jsx)(e0,{handlers:Y,actions:Z,warehouseFiltersLegend:V,drawerOptionsDetails:K,announcement:e,formik:U,isFMW:D,isCMW:W,productImageData:I,labels:G,bodyText:F,altBodyText:P.key_value.altbody,drawerFindBtnLabel:N,options:q,isFiltersOpen:J,state:Q,handleFilterCheckbox:ei,wioEnabledPricingText:R,analyticsIdentifier:j}),(0,o.jsx)(e1,{onUpdatePreferredWarehouse:h,onSelectWarehouse:g,onClose:er,isLoading:i,warehouses:x,locale:m,moduleSettings:n,preferredWarehouse:f,isFMW:D,isCMW:W,rootRef:ea,sentinelRef:et,displayedWarehouses:en,drawerType:b,showSentinel:ee,notificationAlert:el,pageName:M,productFlags:T,featureFlags:null==A?void 0:A.custom,invokeSalesLocationsAPI:L})]}):(0,o.jsx)(S.m,{"aria-label":G.aria.panelAriaLabel,slotProps:{paper:{"data-testid":ek}},bodySx:{backgroundColor:(null==x?void 0:x.length)&&(1!==x.length||x[0].warehouseId!==f)?k.GFZ:k.DJJ,margin:0,padding:0,...W?{overflow:"hidden"}:{}},headerProps:{children:(0,o.jsx)(e0,{handlers:Y,actions:Z,warehouseFiltersLegend:V,drawerOptionsDetails:K,announcement:e,formik:U,isFMW:D,isCMW:W,productImageData:I,labels:G,bodyText:F,altBodyText:P.key_value.altbody,drawerFindBtnLabel:N,options:q,isFiltersOpen:J,state:Q,handleFilterCheckbox:ei,wioEnabledPricingText:R,analyticsIdentifier:j}),closeButtonAriaLabel:B,onClose:er,title:H,uniqueId:"warehousedrawer"},anchor:D?"left":"right",open:r,scrollArea:"body",children:(0,o.jsx)(e1,{onUpdatePreferredWarehouse:h,onSelectWarehouse:g,onClose:er,isLoading:i,warehouses:x,locale:m,moduleSettings:n,preferredWarehouse:f,isFMW:D,isCMW:W,rootRef:ea,sentinelRef:et,displayedWarehouses:en,drawerType:b,showSentinel:ee,notificationAlert:el,pageName:M,productFlags:T,featureFlags:null==A?void 0:A.custom,invokeSalesLocationsAPI:L})}):null};e2.displayName=ek;var e5=a(90058),e6=a(28683),e3=a(84102),e7=a(85570),e4=a(92262),e8=a(74662);let e9=(0,G.default)(x.default)` 218 display: flex; 219 flex-direction: column; 220 align-items: flex-start;
221 align-self: stretch; 222 gap: ${k.Mzk}; 223`,te=(0,G.default)(x.default)` 224 display: flex; 225 align-items: flex-start; 226 align-self: stretch; 227 gap: ${k.Mzk}; 228`,tt={alignItems:"center",display:"flex",flexDirection:"column",justifyContent:"center",width:"72px"},ta={WebkitBoxOrient:"vertical",WebkitLineClamp:3,display:"-webkit-box",flex:"1 0 0",overflow:"hidden",textOverflow:"ellipsis"},to=(0,G.default)("form")` 229 display: flex; 230 flex-direction: column; 231 align-items: flex-start; 232 align-self: stretch; 233 gap: ${k.Mzk}; 234`,ti=(0,G.default)(eW.A)` 235 width: 100%; 236 & .MuiOutlinedInput-root.MuiInputBase-sizeSmall { 237 padding: 0px; 238 &. MuiAutocomplete-input { 239 padding-right: ${k.Mzk}; 240 } 241 } 242 & .MuiAutocomplete-inputFocused { 243 box-sizing: border-box; 244 height: 40px; 245 } 246`,tr=(0,G.default)(eD.A)` 247 width: 100%; 248 height: auto; 249 250 label { 251 background: none; 252 color: ${k.sLX}; 253 max-width: 185px; 254 } 255 256 label.MuiFormLabel-filled { 257 padding-right: ${k.iAn}; 258 padding-left: ${k.m72}; 259 margin-left: 0px; 260 margin-right: 0px; 261 background: ${k.DJJ}; 262 } 263 264 label.Mui-focused { 265 background: ${k.DJJ}; 266 color: ${k.tjF}; 267 margin-left: 0px; 268 padding-right: ${k.iAn}; 269 padding-left: ${k.m72}; 270 } 271 272 label.Mui-error { 273 color: ${k.Tao}; 274 } 275 276 & .MuiOutlinedInput-root { 277 background-color: ${k.DJJ}; 278 gap: 0px; 279 border-radius: ${k.oOK}; 280 padding-right: ${k.Mzk}; 281 padding-left: 20px; 282 283 .MuiInputAdornment-positionEnd { 284 button { 285 margin-right: -${k.D3H}; 286 } 287 } 288 289 input { 290 padding-right: ${k.Mzk}; 291 padding-left: 0px; 292 font-weight: ${k.awq}; 293 line-height: ${k.MlV}; 294 word-wrap: break-word; 295 color: ${k.S6v}; 296 } 297 298 button { 299 border-top-left-radius: 0px; 300 border-bottom-left-radius: 0px; 301 } 302 } 303 304 & .MuiOutlinedInput-root.Mui-focused > .MuiOutlinedInput-notchedOutline { 305 border-color: ${k.tjF}; 306 } 307 308 & .MuiOutlinedInput-root.Mui-error > .MuiOutlinedInput-notchedOutline { 309 border-color: ${k.Tao}; 310 border-width: 2px; 311 } 312 313 & 314 .MuiOutlinedInput-root.Mui-focused.Mui-error 315 > .MuiOutlinedInput-notchedOutline { 316 border-color: ${k.Tao}; 317 border-width: 2px; 318 } 319 320 & .MuiInputAdornment-positionStart { 321 padding-right: ${k.iAn}; 322 margin-right: 0px; 323 } 324 325 & .MuiInputAdornment-positionEnd { 326 padding-left: ${k.iAn}; 327 margin-left: 0px; 328 } 329 330 & .MuiInputBase-multiline { 331 width: 100%; 332 height: auto; 333 } 334 335 & .MuiOutlinedInput-notchedOutline { 336 border-width: ${k.RYE}; 337 border-color: ${k.BO}; 338 339 legend { 340 padding-right: 0px; 341 padding-left: 0px; 342 343 & span { 344 padding-right: 0px; 345 padding-left: 0px; 346 } 347 } 348 } 349 350 & .MuiFormHelperText-root { 351 margin-right: ${k.D3H}; 352 margin-left: ${k.D3H}; 353 } 354`,tl=(0,G.default)(eE.default)` 355 &.MuiAutocomplete-option.Mui-focused { 356 background-color: ${k.KLo}; 357 } 358`,tn=(0,G.default)(eP.default)` 359 &::before { 360 display: none; 361 } 362 background-color: ${k.DJJ}; 363 border: none; 364 box-shadow: none; 365 width: 100%; 366 margin-bottom: ${k.Mzk}; 367`,ts={"& .MuiAccordionSummary-content":{margin:0},"&.MuiButtonBase-root.MuiAccordionSummary-root.Mui-focusVisible":{backgroundColor:"transparent",outline:"2px auto -webkit-focus-ring-color",outlineoffset:"2px"},alignItems:"center",display:"flex",gap:k.m72,minHeight:"18px",padding:0},td=(0,G.default)(eH.y)` 368 color: ${k.S6v}; 369 height: 18px; 370 width: 18px; 371`,tu=(0,G.default)(x.default)` 372 background-color: white; 373 display: flex; 374 flex: 1 1 auto; 375 flex-direction: column; 376 overflow: auto; 377 padding: ${k.Mzk}; 378 height: 100%; 379`,tc=(0,G.default)("legend")(()=>({...ey.A})),tp=(0,G.default)(x.default)` 380 display: flex; 381 justify-content: center;
382 align-items: flex-start; 383 align-self: stretch; 384 padding-top: ${k.i_v}; 385`,th=(0,p.memo)(({moduleSettings:e,preferredWarehouse:t,onClose:a,onUpdatePreferredWarehouse:i,onSelectWarehouse:r,warehouse:l,locale:n,drawerType:d,isFullPage:u=!1,warehouseNameRef:c,pinIndex:h,shouldFocusMyWarehouse:g,setShouldFocusMyWarehouse:f,invokeSalesLocationsAPI:x=!1,renderActionButton:m,onWarehouseSelected:v,customActionAnalyticsLabel:b})=>{let y=(0,s.P)(),w="CMW"===d,I=(0,p.useCallback)(()=>{null==v||v(l)},[v,l]),S=(0,p.useCallback)(async()=>{var e,t,o,n,s;let u=null==(t=null==(e=null==l?void 0:l.name)?void 0:e[0])?void 0:t.value,c=null==(o=null==l?void 0:l.address)?void 0:o.countryName,p=null==(n=null==l?void 0:l.address)?void 0:n.postalCode,h=null==(s=null==l?void 0:l.address)?void 0:s.territory,g=null==l?void 0:l.warehouseId;w&&y.updateStwInfo({stwMyWarehouse:g,stwPostalCode:p.split("-")[0]});try{await i({city:u,countryCode:c,postalCode:p,territory:h,warehouseId:g,warehouseDrawer:d,...w&&{itemType:"BOPIW",pageName:"PDP",orderItemId:""}}),null==r||r(g),w&&a()}catch(e){throw console.error("Failed to update preferred warehouse:",e),e}},[l,w,y,i,d,r,a]),k=l.warehouseId===t,$=((e,t,a,o,i=!1)=>{var r,l;if((0,e8.T6)())return!1;let n=(0,T.k)(t,{useSalesLocationsApi:i});return n!==C.aN.BUSINESS_CENTER&&n!==C.aN.SHOWROOM&&n!==C.aN.GAS_STATION_ONLY&&(null==e?void 0:e.includes(null==(r=null==t?void 0:t.address)?void 0:r.countryName.toLowerCase()))&&("CMW"===a?"stockStatus"in t&&(null==(l=null==t?void 0:t.stockStatus)?void 0:l.showWHSMolecule)===!0:"FMW"!==a||!o)})(n,l,d,k,x);return(0,o.jsx)(eb,{isPreferredWarehouse:k,locale:n,moduleSettings:e,onSetWarehouse:S,warehouseData:l,showSetWarehouseButton:$,showPhoneNumber:"FMW"===d,isFullPage:u,warehouseNameRef:c,pinIndex:h,shouldFocusMyWarehouse:g,setShouldFocusMyWarehouse:f,invokeSalesLocationsAPI:x,...m?{renderActionButton:m,onWarehouseSelected:I,customActionAnalyticsLabel:b}:{}},l.warehouseId)});th.displayName="WrappedWarehouseTile";let tg=({announcement:e,defaultFiltersVisible:t,getAutosuggest:a,isLoading:i,isSearchTextEmpty:r,isWarehouseNumberSearch:n,moduleSettings:s,onClose:d,syncWithUrl:h,persistedSearchText:w,onSearch:S,onUpdatePreferredWarehouse:C,onSelectWarehouse:M,preferredWarehouse:T,warehouses:j,locale:L,listType:_,batchServiceConfig:O,childItemNumber:W,productImageData:D,stwErrorMessage:E,featureConfigs:P,enabledWarehouseListConfigs:H,heightOverride:F,enableInfiniteList:N=!1,infiniteListBatchSize:R=10,isFullPage:B=!1,onDisplayedWarehousesChange:V,setAnnouncement:z,shouldFocusMyWarehouse:K,setShouldFocusMyWarehouse:U,invokeSalesLocationsAPI:q=!1,renderActionButton:G,onWarehouseSelected:J,customActionAnalyticsLabel:Z})=>{let Y="CMW"===_,Q="FMW"===_,X=Q&&N?"warehouse locator page":Q?"find a warehouse flyout":"check nearby warehouse flyout",ee=(0,e6.default)(),et=(0,e5.A)(ee.breakpoints.between("xs","md")),ea=(0,e5.A)(ee.breakpoints.between("md","lg")),eo=(0,e5.A)(ee.breakpoints.up("lg")),ei=(0,p.useMemo)(()=>new l.n({composable_window:s.composable_window,key_value:s.key_value,properties:s.properties}),[s]),er=ei.getKeyValueItem(e4.vP),el=ei.getKeyValueItem(e4.gD),en=ei.getKeyValueItem(c.mM),es=ei.getKeyValueItem(c.yj),ed=ei.getKeyValueItem(c.jX),eu=ei.getKeyValueItem(e4.bQ),ec=ei.getPropertiesItem(c.jE)??3,ep=(0,p.useMemo)(()=>(0,u.UO)(s,!Y),[s,Y]),{formik:eg,options:ef,labels:ex,isFiltersOpen:em,actions:ev,handlers:eb}=eA({moduleSettings:s,onSearch:S,defaultFiltersVisible:t,getAutosuggest:a,drawerType:_,syncWithUrl:h,persistedSearchText:w,analyticsEventTemplate:{location:X}}),{state:ey,showSentinel:ew,sentinelRef:eI,rootRef:ek,allWHList:e$,handleFilterCheckbox:eC}=eL({warehouses:j,preferredWarehouse:T,locale:L,childItemNumber:W,batchSize:ec,configs:{batchServiceConfig:O,featureConfigs:P,enabledWarehouseListConfigs:H},isLoading:i,productFlags:void 0,pageName:void 0}),{selectedWarehouseId:eM}=(0,eh.i)(),eT=(0,p.useMemo)(()=>(({preferredWarehouse:e,warehouses:t,allWHList:a,displayedWarehouses:o,stwErrorMessage:i,isLoading:r,isBatchLoading:l,isProductUnavailable:n,isSearchTextEmpty:s,isWarehouse
385NumberSearch:d,checked:u,msStore:c,drawerType:p})=>{var h,g,f,x,m;if(!r){let r=c.getKeyValueItem("searchtextemptyalert"),v=c.getKeyValueItem("searchfailurecontent"),b=c.getKeyValueItem("unabletodetermineavailabilityalert"),y=c.getKeyValueItem("outofstockalert"),w=c.getKeyValueItem("productunavailablealert"),I=!(null==t?void 0:t.length)||(null==t?void 0:t.length)===1&&t[0].warehouseId===e,S=d&&!(null==t?void 0:t.length);if(I&&!i&&s)return{message:r,severity:"alert",uniqueId:"searchTextEmptyAlertText"};if(S||!d&&I&&!i)return{message:v,severity:"alert",uniqueId:"searchFailureAlertText"};if(I&&i||(null==(h=null==o?void 0:o[0])?void 0:h.isNotification)===!0&&(null==(g=null==o?void 0:o[0])?void 0:g.isEnabled)===!1)return{message:b,severity:"alert",uniqueId:"unableToDetermineAvailabilityAlertText"};if((null==(f=null==o?void 0:o[0])?void 0:f.isNotification)===!0&&(null==(x=null==o?void 0:o[0])?void 0:x.isEnabled)===!0)return{message:y,severity:"alert",uniqueId:"outOfStockAlertText"};if("CMW"===p&&(null==t?void 0:t.length)&&t.length>1&&!l&&n&&!(null==(m=null==a?void 0:a.current)?void 0:m.length)&&u)return{message:w,severity:"alert",uniqueId:"productUnavailableAlertText"}}return null})({preferredWarehouse:T,warehouses:j,allWHList:e$,displayedWarehouses:ey.warehouseList,stwErrorMessage:!!E,isLoading:i,isBatchLoading:ey.isBatchLoading,isProductUnavailable:ey.isProductUnavailable,checked:ey.checked,msStore:ei,drawerType:_,isSearchTextEmpty:r,isWarehouseNumberSearch:n}),[T,j,e$,ey.warehouseList,E,i,ey.isBatchLoading,ey.isProductUnavailable,ey.checked,ei,_,r,n]),ej=(0,p.useMemo)(()=>Y?ey.warehouseList:j,[Y,ey.warehouseList,j]),eW=(0,p.useRef)(),eD=(0,p.useMemo)(()=>{if(!ej||!(Q&&N)||!T)return ej;let e=ej.findIndex(e=>e.warehouseId===T);if(-1===e)return ej;let t=ej[e],a=ej.filter(e=>e.warehouseId!==T);if(0===a.length)return ej;let o=a.slice(0,2*R);if(0===o.length)return ej;let i=o[0].address.latitude,r=o[0].address.latitude,l=o[0].address.longitude,n=o[0].address.longitude;for(let e=1;e<o.length;e+=1){let t=o[e].address.latitude,a=o[e].address.longitude;t<i&&(i=t),t>r&&(r=t),a<l&&(l=a),a>n&&(n=a)}let s=i-.72,d=r+.72,u=l-.72,c=n+.72,p=t.address.latitude,h=t.address.longitude,g=p<s||p>d||h<u||h>c?a:ej;if(eW.current&&eW.current.map(e=>e.warehouseId).join(",")===g.map(e=>e.warehouseId).join(","))return eW.current;return eW.current=g,g},[ej,Q,N,T,R]),[eE,eP]=(0,p.useState)(()=>N?Math.min(R,(null==eD?void 0:eD.length)||0):(null==eD?void 0:eD.length)||0),eH=(0,p.useRef)(0);(0,p.useEffect)(()=>{N?eP(Math.min(R,(null==eD?void 0:eD.length)||0)):eP((null==eD?void 0:eD.length)||0)},[N,eD,R]);let eF=(0,p.useMemo)(()=>N&&eD?eD.slice(0,eE):eD,[N,eD,eE]);(0,p.useEffect)(()=>{let e;if(Q&&eM&&ek.current&&eF){let t=eF.length,a=eH.current;if(eH.current=t,t>a&&a>0)return;e=setTimeout(()=>{let e=eF.findIndex(e=>e.warehouseId===eM);if(-1!==e&&ek.current){let t=ek.current.querySelectorAll("[data-warehouse-id]")[e],a=ek.current;if(t&&a){let e=a.getBoundingClientRect(),o=t.getBoundingClientRect().top-e.top;a.scrollTo({top:a.scrollTop+o,behavior:"smooth"})}}},50)}return()=>{e&&clearTimeout(e)}},[Q,eM,eF,ek]);let eN=(0,p.useRef)(null),eR=eE-R;(0,p.useEffect)(()=>{N&&!(eE<=R)&&eN.current&&eN.current.focus()},[eE,N,R]);let eB=(0,p.useMemo)(()=>eD&&eE<eD.length,[eD,eE]);return((0,p.useEffect)(()=>{Q&&eF&&V&&V(eF)},[Q,eF,V]),s&&(!Y||O&&P&&H))?(0,o.jsxs)("div",{style:{textAlign:"start"},children:[(0,o.jsxs)(e9,{children:[(0,o.jsx)(m.Text,{bold:!0,component:B?"h1":"h2",uniqueId:"warehouselocations-title",variant:"t4",children:er}),Q&&(0,o.jsx)(m.Text,{uniqueId:"warehousedrawer-header-bodytext",variant:"t6",children:(0,o.jsx)(e3.T,{overrides:{p:{component:m.Text}},markdown:el})}),Y&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(te,{children:[(0,o.jsx)(eO.X,{srcFallback:(null==D?void 0:D.srcFallback)??"",titleFallback:(null==D?void 0:D.titleFallback)??"",ariaHidden:!0,src:(null==D?void 0:D.src)??"",sx:tt,title:(null==D?void 0:D.title)??"",uniqueId:"warehousedrawer-header-productimage"}),(0,o.jsx)(m.Text,{sx:ta,uniqueId:"warehousedrawer-header-productdescription",variant:"t6",children:null==D?void 0:D.description})]}),(0,o.jsx)(v.Divider,{})]}),(0,o.jsxs)(to,{onSubmit:eb.handleSubmit,children:[(0,o.jsx)(ti,{slotProps:{listbox:{"aria-label":ex.aria.listBoxAri
385aLabel}},onClose:()=>ev.setIsAutocompleteDropdownOpen(!1),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),ev.selectFirstOption(),ev.setOptions([]),eg.handleSubmit())},onOpen:()=>ev.setIsAutocompleteDropdownOpen(!0),renderInput:e=>(0,o.jsx)(tr,{"data-testid":"warehousedrawer-textfield",...e,slotProps:{...e.slotProps,input:{...e.slotProps.input,endAdornment:(0,o.jsx)(b.Button,{onClick:()=>{ev.selectFirstOption(),eg.handleSubmit()},sx:{backgroundColor:k.H4y},uniqueId:"warehousedrawer-submit",variant:"primary",children:en})},htmlInput:{...e.slotProps.htmlInput,maxLength:50,name:ex.searchFieldLabel}},label:ex.searchFieldLabel,size:"small",variant:"outlined"}),renderOption:({key:e,...t},a)=>(0,o.jsxs)(tl,{...t,children:[a.locality,(0,o.jsx)("br",{}),a.address]},a.address),freeSolo:!0,getOptionLabel:ev.getOptionLabel,inputValue:eg.values.searchText,onInputChange:eb.onInputChange,options:ef}),Q&&(0,o.jsxs)(tn,{"data-testid":"warehousedrawer-warehousefilter",disableGutters:!0,slotProps:{transition:{timeout:175},heading:{component:B?"h2":"h3"}},expanded:em,onChange:()=>{ev.setIsFiltersOpen(!em)},children:[(0,o.jsx)(A.Analytics,{analyticData:{component:{trackedData:[em?ex.filters.hideWarehouseFiltersBtnText:ex.filters.showWarehouseFiltersBtnText]}},children:(0,o.jsx)(g.default,{"aria-label":em?ex.filters.hideWarehouseFiltersBtnText:ex.filters.showWarehouseFiltersBtnText,component:"button","data-testid":"warehousedrawer-warehousefilter-icon-chevron-down",expandIcon:(0,o.jsx)(td,{}),sx:ts,children:em?(0,o.jsx)(m.Text,{variant:"t6",uniqueId:"warehousedrawer-warehousefilter-hidden",children:ex.filters.hideWarehouseFiltersBtnText}):(0,o.jsx)(m.Text,{variant:"t6",uniqueId:"warehousedrawer-warehousefilter-show",children:ex.filters.showWarehouseFiltersBtnText})})}),(0,o.jsx)(f.default,{"data-testid":"warehousedrawer-warehousefilter-details",sx:{padding:0,paddingTop:k.Mzk},children:(0,o.jsxs)(x.default,{sx:{border:"none",display:"flex",flexDirection:"row",gap:k.Mzk,margin:0,padding:0,width:"100%"},component:"fieldset",children:[(0,o.jsx)(tc,{children:ed}),(0,o.jsx)(x.default,{sx:{display:"flex",flexDirection:"column",gap:k.iAn,flex:"1 1 50%",minWidth:"50%"},children:ep.slice(0,4).map(e=>(0,o.jsx)(e_.k,{isChecked:!!eg.values.filters[e.id],onChange:t=>{eg.setFieldValue("filters",{...eg.values.filters,[e.id]:t.target.checked})},option:e,uniqueId:`warehousedrawer-${e.label}`},e.id))}),(0,o.jsx)(x.default,{sx:{display:"flex",flexDirection:"column",gap:k.iAn,flex:"1 1 50%",minWidth:"50%"},children:ep.slice(4).map(e=>(0,o.jsx)(e_.k,{isChecked:!!eg.values.filters[e.id],onChange:t=>{eg.setFieldValue("filters",{...eg.values.filters,[e.id]:t.target.checked})},option:e,uniqueId:`warehousedrawer-${e.label}`},e.id))})]})})]}),Y&&(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)(x.default,{children:[ep.map(e=>(0,o.jsx)(e_.k,{isChecked:ey.checked,onChange:eC(),option:e,uniqueId:`warehousedrawer-${e.label}`},e.id)),ey.enabledWHList.length>1&&(0,o.jsx)(m.Text,{sx:{alignItems:"center",alignSelf:"stretch",display:"flex",paddingLeft:k.pMV},color:"light",uniqueId:"warehousedrawer-wioenabledtext",variant:"t7",children:es})]})}),(0,o.jsx)(e7.z,{announcerText:e,announcerTime:5e3,callback:z})]})]}),(0,o.jsx)(A.Analytics,{analyticData:{component:{identifier:`${Q?"find a warehouse":"check nearby warehouses"} flyout`,type:"ui"},trackType:"navigation"},children:(0,o.jsxs)(x.default,{"data-testid":"warehouse-list-container",sx:{height:F&&0!==F.length?et&&F[0]?F[0]:ea&&F[1]?F[1]:eo&&F[2]?F[2]:F[0]||"100%":"100%",...i&&(!ej||0===ej.length)?{backgroundColor:k.DJJ,opacity:.6}:{}},children:[i&&(!ej||0===ej.length)&&(0,o.jsx)(tp,{"data-testid":"warehousedrawer-spinner",children:(0,o.jsx)(y.y,{size:"medium",hasBackdrop:!1,label:"loading-warehouses"})}),(!i||ej&&ej.length>0)&&(0,o.jsxs)(x.default,{sx:{display:"flex",flex:"1 1 auto",flexDirection:"column",height:"100%",gap:j&&(null==j?void 0:j.length)<=1?"initial":k.iAn,overflowY:"auto"},ref:ek,children:[eF&&eF.length>0&&eF.map((e,t)=>(0,o.jsx)("div",{"data-warehouse-id":Q?e.warehouseId:void 0,children:(0,o.jsx)(th,{onUpdatePreferredWarehouse:C,onSelectWarehouse:M,locale:L,moduleSettings:s,onClose:d,preferredWarehouse:T,warehouse:e,drawerType:_,isFullPage:B,warehouseNameRef:t===eR?eN:null,pinIndex:t,shouldFocusMyWarehouse:K,setShouldFocusMyWarehouse:U,invokeSalesLocationsAPI:q,...G&&J&&Z?{renderActionButton:G,onWarehouseSelected:J,customActionAnalyticsLabel:Z}:{}})},e.warehouseId)),N&&eB&&(0,o.jsx)(x.default,{sx:{textAlign:"center",padding:k.Mzk},children:(0,o.jsx)(b.Button,{onClick:()=>{eP(e=>e+R)},variant:"secondary",uniqueId:"warehouse-list-view-more",children:eu})}),Y&&ew&&(0,o.jsx)(x.default,{ref:eI,sx:{marginTop:k.iAn},children:(0,o.jsx)(eS,{})}),eT&&(0,o.jsx)(tu,{children:(0,o.jsx)(I.Notification,{icon:(0,o.jsx)($.A,{}),message:eT.message,severity:eT.severity,uniqueId:`warehousedrawer-${eT.uniqueId}`})})]})]})})]}):null};function tf(e,t="warehouse operation"){let a="unknown",o=`Unexpected error during ${t}`;return e instanceof TypeError&&e.message.includes("network")?(a="network",console.error(o=`Network error during ${t}`,e)):e instanceof Error&&e.message.includes("timeout")?(a="timeout",console.error(o=`Timeout error during ${t}`,e)):console.error(o,e),{type:a,message:o,originalError:e}}
385tg.displayName=ek;var tx=a(40336),tm=a(19841),tv=a(89871);let tb={preferredWarehouse:void 0,preferredWarehouseData:void 0,isSearchTextEmpty:!0,isWarehouseNumberSearch:!1,actionHistory:[]};function ty(e,t){let a=[...e.actionHistory.slice(-19),{action:t,timestamp:Date.now()}];switch(t.type){case"SYNC_FROM_CONTEXT":case"DRAWER_OPENED":return{...e,preferredWarehouse:t.payload.preferredWarehouse,lastAction:t,actionHistory:a};case"USER_SELECTED_WAREHOUSE":return{...e,preferredWarehouse:t.payload.warehouseId,lastAction:t,actionHistory:a};case"SET_PREFERRED_WAREHOUSE_DATA":return{...e,preferredWarehouseData:t.payload.data,lastAction:t,actionHistory:a};case"UPDATE_SEARCH_STATE":return{...e,isSearchTextEmpty:t.payload.isSearchTextEmpty,isWarehouseNumberSearch:t.payload.isWarehouseNumberSearch,lastAction:t,actionHistory:a};case"CLEAR_PREFERRED_WAREHOUSE":return{...e,preferredWarehouse:void 0,preferredWarehouseData:void 0,lastAction:t,actionHistory:a};case"DEBUG_ACTION":return{...e,lastAction:t,actionHistory:a};default:return e}}let tw=e=>{let{variant:t,locale:a,moduleSettings:g,onClose:f,listType:x,setWarehouses:m,isOpen:v,syncWithUrl:b=!1,isGasPricesEnabled:y=!1,heightOverride:w,zipCodeOverride:I,persistedSearchText:S,onLocationSearchSubmitted:k,enableInfiniteList:$=!1,infiniteListBatchSize:A=10,invokeSalesLocationsAPI:C=!1,renderActionButton:M,onWarehouseSelected:T,customActionAnalyticsLabel:j,useChangeWarehouseTitle:L,batchServiceConfig:_,productImageData:O,productFlags:W,childItemNumber:D,featureConfigs:E,enabledWarehouseListConfigs:P,analyticsIdentifier:H,defaultFiltersVisible:F,...N}=e,R="list"===t,B="drawer"===t;(0,p.useEffect)(()=>{},[M,T,j]);let{warehouse:V}=(0,h.B)(),z=(0,s.P)(),{agent:K}=(0,r.useAgent)(),{getToken:U}=(0,tx.A)(),q=(0,tv.p)(),{setWarehouses:G}=R?(0,d.U)():{setWarehouses:()=>{}},{clearSelection:J,selectLocation:Z}=R?(0,eh.w)():{clearSelection:()=>{},selectLocation:()=>{}},{queryParams:Y}=R?(0,i.useQueryParams)():{queryParams:new URLSearchParams},Q=R?Y.get(c.hS):null,[X,ee]=(0,p.useReducer)(ty,tb,e=>({...e,preferredWarehouse:B?(0,ed.vS)(V.nearestWarehouse):void 0})),[et,ea]=(0,p.useState)(!1),[eo,ei]=(0,p.useState)(!1),er=(0,p.useRef)(X.preferredWarehouseData);er.current=X.preferredWarehouseData;let el=new l.n({composable_window:g.composable_window,key_value:g.key_value}),en=(0,u.UO)(g,R),es=el.getKeyValueItem(c.Dl),eu=g.properties[0],ec=(0,ed.tH)(a),ep=(0,tm.z)(eu.defaultLocation.latitude,eu.defaultLocation.longitude,ec,!!((null==z?void 0:z.stwPostalCode)&&"CMW"===x),ea,I),eg=e=>{ee({type:"SET_PREFERRED_WAREHOUSE_DATA",payload:{data:e}})},ef=async e=>{try{if(q(e),ee({type:"USER_SELECTED_WAREHOUSE",payload:{warehouseId:e.warehouseId}}),ey&&ey.length>0){let t=(0,ed.q8)(ey,e.warehouseId);R?G(t):B&&m&&m(t)}let t=e.warehouseId;(async()=>{try{let e=await U(!0);if(!e||!await (0,ed.QG)(K,e,t))return;(0,ed.D9)({whExpiresAt:new Date(Date.now()+(0,ed.jA)(K)).toISOString()})}catch(e){n.v.error(e,"Error saving preferred warehouse to profile:")}})()}catch(e){throw e}},{processWarehouses:ex}=(({preferredWarehouseDataRef:e,preferredWarehouseId:t,onPreferredWarehouseUpdate:a})=>({processWarehouses:(0,p.useCallback)(o=>{var i;let r=[...o],l=(0,ed.vS)(t),n=o.find(e=>e.warehouseId===l);return n&&!(0,eM.uJ)(n)&&l?(r=(0,ed.q8)(o,l),(null==(i=e.current)?void 0:i.warehouseId)!==n.warehouseId&&a(n)):e.current&&(o.some(t=>{var a;return t.warehouseId===(null==(a=e.current)?void 0:a.warehouseId)})||(r=[e.current,...o])),r},[t,e,a])}))({preferredWarehouseDataRef:er,preferredWarehouseId:V.nearestWarehouse,onPreferredWarehouseUpdate:eg}),em=R&&"FMW"!==x?G:B?m:void 0,{loadWarehouses:ev,isLoading:eb,warehouses:ey,announcement:ew,setLoa
385ding:eI,setWarehousesState:eS,setAnnouncement:ek}=(({agent:e,locale:t,warehouseNearestWarehouse:a,drawerOptionsDetails:o,resultsAnnouncement:i,enableGasPrices:r=!1,listType:l,allowCarryover:n=!0,locationSearchParam:s,processWarehouses:d,onWarehousesUpdate:c,onPreferredWarehouseUpdate:h,preferredWarehouseDataRef:g,invokeSalesLocationsAPI:f=!1})=>{let[x,m]=(0,p.useState)({isLoading:!0,warehouses:[],announcement:""}),v=(0,p.useCallback)(async({filters:p,location:x})=>{if(m(e=>({...e,isLoading:!0})),!e){m({isLoading:!1,warehouses:[],announcement:""}),null==c||c([]);return}if(!x.latitude||!x.longitude){let e=(null==d?void 0:d([]))||[];m({isLoading:!1,warehouses:e,announcement:""}),null==c||c(e);return}try{let v,b,y=(0,ed.vS)(a),w=p?(0,u.yz)(o,p,"warehouseLocatorMobileApi"):void 0;try{v=await (0,ed.o4)({agent:e,filters:w,locale:t,location:{latitude:x.latitude,longitude:x.longitude},preferredWarehouse:y,invokeSalesLocationsAPI:f})}catch(e){tf(e,"fetching warehouse data"),v=[]}let I=v;if(r&&v.length>0?(I=await (0,ed.CH)({agent:e,sortedWarehouses:v}),I=(0,ed.Hn)(I,t)):r||(I=v.map(e=>{if(!e.gasPrices)return e;let{gasPrices:t,...a}=e;return a})),!n&&d){let e=!!p&&Object.values(p).some(Boolean);if("FMW"===l&&(s||e)){let e=I.find(e=>e.warehouseId===y);e&&(null==g?void 0:g.current)!==e&&(null==h||h(e)),b=I}else b=d(I)}else b=d?d(I):I;m({isLoading:!1,warehouses:b,announcement:i}),null==c||c(b)}catch(t){tf(t,"loading warehouses");let e=(null==d?void 0:d([]))||[];m({isLoading:!1,warehouses:e,announcement:""}),null==c||c(e)}},[e,t,a,o,i,r,l,n,s,d,c,h,g,f]),b=(0,p.useCallback)(e=>{m(t=>({...t,isLoading:e}))},[]),y=(0,p.useCallback)((e,t)=>{m(a=>({...a,warehouses:e,announcement:t,isLoading:!1})),null==c||c(e)},[c]),w=(0,p.useCallback)(e=>{m(t=>({...t,announcement:e}))},[]);return{loadWarehouses:v,isLoading:x.isLoading,warehouses:x.warehouses,announcement:x.announcement,setLoading:b,setWarehousesState:y,setAnnouncement:w}})({agent:K,locale:a,warehouseNearestWarehouse:V.nearestWarehouse,drawerOptionsDetails:en,resultsAnnouncement:es,enableGasPrices:y,invokeSalesLocationsAPI:C,listType:R?x:void 0,locationSearchParam:R?Q:void 0,processWarehouses:ex,onWarehousesUpdate:em,onPreferredWarehouseUpdate:R?eg:void 0,preferredWarehouseDataRef:R?er:void 0}),{loadSingleWarehouse:e$}=R||B&&"FMW"===x?(({agent:e,locale:t,resultsAnnouncement:a,enableGasPrices:o=!1,onLoadingChange:i,onWarehousesChange:r,invokeSalesLocationsAPI:l=!1})=>({loadSingleWarehouse:(0,p.useCallback)(async n=>{if(!e){i(!1),r([],"");return}i(!0);try{let s;if(!/^\d+$/.test(n))throw console.error("Invalid warehouse ID:",n),Error("Warehouse ID must contain only numbers.");let d=!1;try{let a;s=(a=l&&e.getSalesLocation?await e.getSalesLocation(t,n):await e.getWarehouse(t,n)).warehouse?[a.warehouse]:[]}catch(e){tf(e,"fetching single warehouse data"),s=[],d=!0}let u=s;o&&s.length>0&&(u=await (0,ed.CH)({agent:e,sortedWarehouses:s})),i(!1),r(u,d?"":a)}catch(e){tf(e,"loading single warehouse"),i(!1),r([],"")}},[e,i,r,o,a,l,t])}))({agent:K,locale:a,resultsAnnouncement:es,enableGasPrices:y,onLoadingChange:eI,onWarehousesChange:(e,t)=>
385{eS(e,t),B&&m&&m(e)},invokeSalesLocationsAPI:C}):{loadSingleWarehouse:()=>{}},eA=(0,p.useRef)(ev);eA.current=ev;let eC=(0,p.useRef)(ex);eC.current=ex;let eT=(0,p.useRef)(e$);eT.current=e$;let ej=e=>{R&&ee({type:"UPDATE_SEARCH_STATE",payload:{isSearchTextEmpty:!1,isWarehouseNumberSearch:!0}}),eT.current(e)},eL=async e=>{R&&(J(),null==k||k(e.searchText??""));let t=async e=>{if(!e&&R){ee({type:"UPDATE_SEARCH_STATE",payload:{isSearchTextEmpty:!0,isWarehouseNumberSearch:!1}}),eS([],"");return}if(R&&(ek(""),eI(!0),ee({type:"UPDATE_SEARCH_STATE",payload:{isSearchTextEmpty:!1,isWarehouseNumberSearch:X.isWarehouseNumberSearch}})),!K){R&&eS(eC.current([]),"");return}try{let{resources:t}=(await K.getBingLocation(e)).resourceSets[0],a=t.find(e=>"High"===e.confidence);return{latitude:null==a?void 0:a.point.coordinates[0],longitude:null==a?void 0:a.point.coordinates[1]}}catch{return}},a=R&&e.searchText.startsWith("#");if(a)ej(e.searchText.replace("#",""));else{R&&ee({type:"UPDATE_SEARCH_STATE",payload:{isSearchTextEmpty:X.isSearchTextEmpty,isWarehouseNumberSearch:a}});let o=await t(e.searchText||"");(e=>{if(!e||!R)return;let t=new URL(window.location.href);t.searchParams.set(c.hS,e),window.history.pushState({},"",t)})(e.searchText);let i=o?{...o}:{};eA.current({filters:e.filters,location:i})}},e_=async e=>{let t=R&&e.startsWith("#");if(!K||t)return;let o=ep?`${ep.latitude},${ep.longitude}`:"",i=(0,ed.TN)(a);return null==K?void 0:K.getBingAutosuggest(e,o,i)};if((0,p.useEffect)(()=>{B&&v&&ep&&eA.current({location:ep})},[B,v,ep]),(0,p.useEffect)(()=>{R&&(ek(""),eI(!0),Q?eL({searchText:Q,filters:(0,u.hi)(g,Y)}):ep&&eA.current({location:ep,filters:(0,u.hi)(g,Y)}))},[R,Q,g,ep]),(0,p.useEffect)(()=>{if(B){let e=(0,ed.vS)(V.nearestWarehouse);X.preferredWarehouse!==e&&(v?ee({type:"DRAWER_OPENED",payload:{preferredWarehouse:e}}):ee({type:"SYNC_FROM_CONTEXT",payload:{preferredWarehouse:e}}))}},[B,V.nearestWarehouse,v]),B){let e={announcement:ew,getAutosuggest:e_,isLoading:eb,isOpen:!!v,locale:a,moduleSettings:g,onClose:f||(()=>{}),onSearch:eL,onUpdatePreferredWarehouse:ef,onSelectWarehouse:Z,preferredWarehouse:X.preferredWarehouse,warehouses:ey,invokeSalesLocationsAPI:C,...N};return"CMW"===x?(0,o.jsx)(e2,{...e,drawerType:"CMW",useChangeWarehouseTitle:L,batchServiceConfig:_,productImageData:O,productFlags:W,childItemNumber:D,featureConfigs:E,enabledWarehouseListConfigs:P,analyticsIdentifier:H,stwErrorMessage:et}):(0,o.jsx)(e2,{...e,drawerType:"FMW",defaultFiltersVisible:F,onWarehouseNumberSearch:ej})}let eO={announcement:ew,setAnnouncement:ek,getAutosuggest:e_,isLoading:eb,isSearchTextEmpty:X.isSearchTextEmpty||!1,isWarehouseNumberSearch:X.isWarehouseNumberSearch||!1,locale:a,moduleSettings:g,onClose:f||(()=>{}),onSearch:eL,onUpdatePreferredWarehouse:ef,onSelectWarehouse:Z,preferredWarehouse:(0,ed.vS)(V.nearestWarehouse),syncWithUrl:b,persistedSearchText:S,warehouses:ey,heightOverride:w,enableInfiniteList:$,infiniteListBatchSize:A,isFullPage:"FMW"===x,onDisplayedWarehousesChange:e=>{R&&G(e)},shouldFocusMyWarehouse:eo,setShouldFocusMyWarehouse:ei,invokeSalesLocationsAPI:C,...M&&void 0!==T&&void 0!==j?{renderActionButton:M,onWarehouseSelected:T,customActionAnalyticsLabel:j}:{},...N};return"CMW"===x?(0,o.jsx)(tg,{...eO,listType:"CMW",batchServiceConfig:_,productImageData:O,childItemNumber:D,featureConfigs:E,enabledWarehouseListConfigs:P,stwErrorMessage:et}):(0,o.jsx)(tg,{...eO,listType:"FMW",defaultFiltersVisible:F})};tw.displayName="WarehouseSelectorBase"},79402:(e,t,a)=>{"use strict";a.d(t,{B:()=>o});let o=({businessCenterLabel:e,name:t})=>t&&e?t.replace(RegExp("Bus Ctr","gi"),e):t},80129:(e,t,a)=>{"use strict";a.d(t,{ProgramCardUI:()=>W});var o=a(95155),i=a(92475),r=a(78951),l=a(3187),n=a(24880),s=a(90830),d=a(40131),u=a(87900),c=a(12004);let p={full_1:100,half_2:50,one_fourth_4:25,one_third_3:33.33},h=(e,t,a,o,i)=>e?o?p[`${null==t?void 0:t.small_viewport}`]:i?p[`${null==t?void 0:t.medium_viewport}`]:p[`${null==t?void 0:t.large_viewport}`]:p[`${a}`];var g=a(25719),f=a(53236),x=a(86670);let m=(0,x.default)(g.CostcoBox)` 386 border: 1px solid ${n.GFZ}; 387 border-radius: 10px; 388`,v=(0,x.default)(g.CostcoBox,{shouldForwardProp:e=>"bottomStrip"!==e})(({bottomStrip:e})=>{var t;return{background:(0,u.g)(null==(t=null==e?void 0:e.bottom_strip_text)?void 0:t.color),borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",display:"flex",justifyContent:null==e?void 0:e.alignment,padding:`${n.iAn} ${n.i_v}`}}),b={height:"auto",width:"100%"},y=({imagePlacement:e,headerConfig:t,headerContent:a})=>{let i=[];return(0,o.jsx)(g.CostcoBox,{sx:{display:"flex",flexBasis:`calc(${100-e}% - 56px)`,flexGrow:1,flexWrap:"wrap",textAlign:t.content_alignment},children:a.map((e,r)=>{var l,s,u,p,h,f;if(e.markdown_text){let x=[];for(let e=r+1;e<a.length;
388e++)if(a[e].inline_image)x.push(a[e]),i.push(e);else break;return(0,o.jsxs)(g.CostcoBox,{sx:{display:"flex",flexBasis:"100%",flexWrap:"wrap",justifyContent:t.content_alignment,marginBottom:r!==a.length-1&&n.iAn},children:[(0,o.jsx)(d.MarketingTypography,{sx:{color:null==(u=null==(s=null==(l=null==e?void 0:e.markdown_text)?void 0:l.color)?void 0:s.text_color)?void 0:u.hex},component:null==(p=null==e?void 0:e.markdown_text)?void 0:p.select_semantics_type,isMarkdown:!0,uniqueId:`programcard_header_markdown_${r}`,variant:null==(h=null==e?void 0:e.markdown_text)?void 0:h.select_text_type,children:null==(f=null==e?void 0:e.markdown_text)?void 0:f.markdown_text},`markdown_text_${r}`),x.map((e,t)=>{let{image:a,image_adobe:i,image_alt_text:r}=(null==e?void 0:e.inline_image)||{};return(0,o.jsx)(g.CostcoBox,{children:(0,o.jsx)(c.default,{brandFolderAssets:a,adobeAssets:i,imageAltText:r,sx:{paddingLeft:n.m72,...b}})},`markdown_inline_image_${t}`)})]},`header_content_${r}`)}if(!i.includes(r)&&e.inline_image){let{image:t,image_adobe:a,image_alt_text:i}=e.inline_image||{};return(0,o.jsx)(g.CostcoBox,{sx:{width:"max-content"},children:(0,o.jsx)(c.default,{brandFolderAssets:t,adobeAssets:a,imageAltText:i,sx:b})},`header_content_${r}`)}})})},w=(0,x.default)(g.CostcoBox)(({backgroundColor:e})=>({background:e,borderRadius:"10px",display:"flex",alignItems:"flex-start",flexWrap:"wrap",padding:n.rQK,rowGap:n.i_v})),I={height:"auto",verticalAlign:"bottom",width:"100%"},S={...I,overflow:"hidden"},k={...I,display:"block"},$={...I,display:"none"},A=({entryData:e,sx:t,locale:a})=>{let{isMobile:i,isTablet:r}=(0,f.G)(),{header_content:l,header_image:s,header_config:d}=e,{image_placement:p,image:x,image_adobe:m,use_mobile_image_variant:v,image_alt_text:b,mobile_image_variant:I}=s,{mobile_image:A,use_mobile_image_alt_text:C,mobile_image_alt_text:M,mobile_image_adobe:T}=I,j=h(null==s?void 0:s.enable_dynamic_row_config,null==s?void 0:s.dynamic_row_config,null==s?void 0:s.image_type,i,r),L=(0,u.g)(null==d?void 0:d.background_color),_={...t,...k},O={...t,...$},W=[...Array.isArray(t)?t:[t],...Array.isArray(S)?S:[S]].filter(e=>null!=e);return(0,o.jsxs)(w,{backgroundColor:L,children:["leading"===p&&(0,o.jsx)(g.CostcoBox,{sx:{display:"flex",flexBasis:`calc(${j}% - 56px)`,flexDirection:"column",flexGrow:"1",paddingRight:100!==j?n.i_v:void 0},children:(0,o.jsx)(g.CostcoBox,{sx:{borderRadius:"10px",overflow:"hidden","&:empty":{display:"none"}},children:(0,o.jsx)(c.default,{enableMobileImageVariation:v,brandFolderAssets:x,adobeAssets:m,brandFolderMobileAssets:A,adobeMobileAssets:T,imageAltText:b,imageSx:_,locale:a,mobileImageAltText:M,mobileImageSx:O,sx:W,useMobileImageAltText:C})})}),(0,o.jsx)(y,{headerConfig:d,headerContent:l,imagePlacement:j}),"trailing"===p&&(0,o.jsx)(g.CostcoBox,{sx:{display:"flex",flexBasis:`calc(${j}% - 56px)`,flexDirection:"column",flexGrow:"1",paddingLeft:100!==j?n.i_v:void 0},children:(0,o.jsx)(g.CostcoBox,{sx:{borderRadius:"10px",overflow:"hidden","&:empty":{display:"none"}},children:(0,o.jsx)(c.default,{enableMobileImageVariation:v,brandFolderAssets:x,adobeAssets:m,brandFolderMobileAssets:A,adobeMobileAssets:T,imageAltText:b,imageSx:_,locale:a,mobileImageAltText:M,mobileImageSx:O,sx:W,useMobileImageAltText:C})})})]})},C=({entryData:e,sx:t,locale:a="en-us"})=>{let{externalLinkProps:d}=(0,i.N)(),{program_card_link:u,title:c,privacy_toggle:p}=e,{target:h}=(0,r.f)(null==u?void 0:u.external_site,null==u?void 0:u.same_tab_domain);return(0,o.jsx)(o.Fragment,{children:(null==u?void 0:u.url)?(0,o.jsx)(s.Analytics,{analyticData:{adItem:{isExternal:(null==u?void 0:u.external_site)||!1,title:(null==u?void 0:u.title)||"",url:(null==u?void 0:u.url)||""},title:c},children:(0,o.jsx)(l.Link,{dataPrivate:null==p?void 0:p.disable_third_party_tracking,color:n.d1D,hasExternalLinkWarning:null==u?void 0:u.external_site,href:null==u?void 0:u.url,underline:"none",uniqueId:`programcard_${e.uid}`,target:h,...d??{},children:(0,o.jsx)(A,{entryData:e,locale:a,sx:t})})}):(0,o.jsx)(A,{entryData:e,locale:a,sx:t})})};var M=a(12158);let T=(0,x.default)(g.CostcoBox,{shouldForwardProp:e=>"headerAlignment"!==e&&"roundedFirstTile"!==e&&"roundedLastTile"!==e}
388)(({backgroundColor:e,headerAlignment:t,roundedFirstTile:a,roundedLastTile:o})=>({alignItems:"center",background:e,borderTopLeftRadius:a?"10px":0,borderTopRightRadius:o?"10px":0,display:"flex",height:"4.65rem",justifyContent:t,padding:n.iAn,position:"relative",sx:{textAlign:t}})),j=(0,x.default)(g.CostcoBox)` 389 border-radius: 50%; 390 left: ${n.iAn}; 391 overflow: hidden; 392 position: absolute; 393 top: 50%; 394 transform: translateY(-50%); 395`,L=(0,x.default)(M.Text)(({backgroundColor:e,color:t,footerAlignment:a})=>({background:e,color:t,justifyContent:a,padding:"6px 16px"})),_=({locale:e,entryId:t,hasBottomStrip:a,programCardConfig:i,roundedFirstTile:r,roundedLastTile:l,tile:s,tileCounter:p})=>{var h,f,x,m,v,y,w,I;let{tile_header:{header_text:S,header_badge:k,header_badge_adobe:$,header_badge_alt_text:A},tile_body:{background_color:C,image_alt_text:M,image:_,image_adobe:O},tile_footer:{tile_text:W}}=s;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(T,{color:(null==(f=null==(h=null==S?void 0:S.color)?void 0:h.text_color)?void 0:f.hex)?null==(m=null==(x=null==S?void 0:S.color)?void 0:x.text_color)?void 0:m.hex:n.d1D,backgroundColor:(0,u.g)(S.color),headerAlignment:null==i?void 0:i.tile_header_alignment,roundedFirstTile:r,roundedLastTile:l,sx:{minHeight:{lg:"90px"},"&:has(> *:first-child:not(:empty))":(null==i?void 0:i.tile_header_alignment)==="left"?{"& > *:last-child":{marginLeft:{lg:"92px",md:"82px",xs:"70px"}}}:{}},children:[(0,o.jsx)(j,{sx:{height:{lg:"80px",md:"70px",xs:"58px"},width:{lg:"80px",md:"70px",xs:"58px"},"&:empty":{display:"none"}},children:(0,o.jsx)(c.default,{imageAltText:A,brandFolderAssets:k,adobeAssets:$,sx:b})}),(0,o.jsx)(g.CostcoBox,{sx:{marginLeft:n.D3H},children:(0,o.jsx)(d.MarketingTypography,{sx:{color:null==(y=null==(v=null==S?void 0:S.color)?void 0:v.text_color)?void 0:y.hex},component:null==S?void 0:S.select_semantics_type,isMarkdown:!0,uniqueId:`programcardtile_header_${t}_${p}`,variant:null==S?void 0:S.select_text_type,children:null==S?void 0:S.markdown_text})})]}),(0,o.jsx)(g.CostcoBox,{sx:{background:(0,u.g)(C),borderBottomLeftRadius:a&&0===p?"10px":"0px","&:empty":{display:"none"},"&:empty + *":{paddingTop:{lg:n.i_v,xs:n.D3H}}},children:(0,o.jsx)(c.default,{imageAltText:M,imageSx:{paddingTop:{lg:n.Mzk,xs:n.D3H}},locale:e,brandFolderAssets:_,adobeAssets:O})}),(null==W?void 0:W.markdown_text)&&(0,o.jsx)(L,{backgroundColor:(0,u.g)(null==W?void 0:W.color),footerAlignment:null==i?void 0:i.tile_footer_alignment,children:(0,o.jsx)(d.MarketingTypography,{sx:{color:null==(I=null==(w=null==W?void 0:W.color)?void 0:w.text_color)?void 0:I.hex,textAlign:null==i?void 0:i.tile_footer_alignment},component:null==W?void 0:W.select_semantics_type,isMarkdown:!0,uniqueId:`programcardtile_footer_${t}_${p}`,variant:null==W?void 0:W.select_text_type,children:null==W?void 0:W.markdown_text})})]})},O=({locale:e="en-us",disableThirdPartyTracking:t,entryId:a,hasBottomStrip:n,programCardConfig:d,programCardLink:u,programCardTitle:c,roundedFirstTile:p,roundedLastTile:x,tile:m,tileCounter:v})=>{let{externalLinkProps:b}=(0,i.N)(),{isSmMobile:y,isMobile:w,isTablet:I}=(0,f.G)(),{tile_link:S}=m,k=h(null==d?void 0:d.enable_dynamic_row_config,null==d?void 0:d.dynamic_row_config,null==d?void 0:d.image_type,w,I),$=(null==S?void 0:S.url)?S.url:null==u?void 0:u.url,{target:A}=(0,r.f)(null==S?void 0:S.external_site,null==S?void 0:S.same_tab_domain);return(0,o.jsx)(g.CostcoBox,{sx:{borderRadius:"10px",flexBasis:y?"100%":`${k}%`,flexGrow:1},children:$?(0,o.jsx)(s.Analytics,{analyticData:{adItem:{isExternal:(null==S?void 0:S.external_site)||(null==u?void 0:u.external_site)||!1,title:(null==S?void 0:S.title)||"",url:$||""},title:c},children:(0,o.jsx)(l.Link,{dataPrivate:t,hasExternalLinkWarning:null==S?void 0:S.external_site,href:$,underline:"none",uniqueId:`programcardtile_${a}_${v}`,target:A,...b??{},children:(0,o.jsx)(_,{locale:e,entryId:a,hasBottomStrip:n,programCardConfig:d,roundedFirstTile:p,roundedLastTile:x,tile:m,tileCounter:v})})}):(0,o.jsx)(_,{locale:e,entryId:a,hasBottomStrip:n,programCardConfig:d,roundedFirstTile:p,roundedLastTile:x,tile:m,tileCounter:v})})},W=({data:e,sx:t={},locale:a="en-us"})=>{var u,c,p,h;let{externalLinkProps:f}=(0,i.N)(),{enable_header_section:x,bottom_strip:b,tile_block:y,program_card_config:w,privacy_toggle:I,program_card_link:S,uid:k,title:$}=e,{bottom_strip_text:A}=b,{target:M}=(0,r.f)(null==S?void 0:S.external_site,null==S?void 0:S.same_tab_domain);return(0,o.jsxs)(m,{sx:t,children:[x&&(0,o.jsx)(C,{entryData:e,sx:t,locale:a}),(0,o.jsx)(g.CostcoBox,{sx:{display:"flex",flexWrap:"wrap"},children:y.map((e,t)=>(0,o.jsx)(O,{locale:a,disableThirdPartyTracking:null==I?void 0:I.disable_third_party_tracking,roundedLastTile:!x&&(null==y?void 0:y.length)-1===t,entryId:k,hasBottomStrip:!!A,programCardConfig:w,programCardLink:S,programCardTitle:$,roundedFirstTile:!x&&0===t,tile:e,tileCounter:t},`program_tile_${t}`))}),(null==A?void 0:A.markdown_text)&&((null==S?void 0:S.url)?(0,o.jsx)(s.Analytics,{analyticData:{adItem:{isExternal:(null==S?void 0:S.external_site)||!1,title:(null==S?void 0:S.title)||"",url:(null==S?void 0:S.url)||""},title:$},children:(0,o.jsx)(l.Link,{dataPrivate:null==I?void 0:I.disable_third_party_tracking,color:n.d1D,hasExternalLinkWarning:null==S?void 0:S.external_site,href:null==S?void 0:S.url,target:M,underline:"none",uniqueId:`programcard_${e.uid}`,...f??{},children:(0,o.jsx)(g.CostcoBox,{sx:{paddingTop:(null==y?void 0:y.length)<1?{md:n.i_v,xs:n.Mzk}:void 0},children:(0,o.jsx)(v,{bottomStrip:b,sx:{textAlign:b.alignment},children:(0,o.jsx)(d.MarketingTypography,{color:null==(c=null==(u=null==A?void 0:A.color)?void 0:u.text_color)?void 0:c.hex,variant:null==A?void 0:A.select_text_type,component:null==A?void 0:A.select_semantics_type,isMarkdown:!0,id:`programcard_bottom_strip_${k}`,children:null==A?void 0:A.markdown_text})})})})}):(0,o.jsx)(g.CostcoBox,{sx:{paddingTop:(null==y?void 0:y.length)<0?{md:n.i_v,xs:n.Mzk}:void 0},children:(0,o.jsx)(v,{bottomStrip:b,sx:{textAlign:b.alignment},children:(0,o.jsx)(d.MarketingTypography,{color:null==(h=null==(p=null==A?void 0:A.color)?void 0:p.text_color)?void 0:h.hex,component:null==A?void 0:A.select_semantics_type,id:`programcard_bottom_strip_${k}`,isMarkdown:!0,variant:null==A?void 0:A.select_text_type,children:null==A?void 0:A.markdown_text})})}))]})};W.displayName="ProgramCardUI"},81e3:(e,t,a)=>{"use strict";a.d(t,{I:()=>l,StwInfoContextProvider:()=>s});var o=a(95155),i=a(12115),r=a(3974);let l=(0,i.createContext)(null),n={stwMyWarehouse:"",stwPostalCode:""},s=({children:e,initialValues:t=n})=>{let[a,s]=(0,i.useState)(t),[d,u]=(0,r.M)("stwMyWarehouse",void 0),[c,p]=(0,r.M)("stwPostalCode",void 0),h=(0,i.useCallback)((e,t={})=>{let a={updateState:!0,updateStorage:!0,...t};if(a.updateStorage&&("stwMyWarehouse"in e&&u(e.stwMyWarehouse),"stwPostalCode"in e&&p(e.stwPostalCode)),a.updateState){let t={};"stwMyWarehouse"in e&&(t.stwMyWarehouse=e.stwMyWarehouse??""),"stwPostalCode"in e&&(t.stwPostalCode=e.stwPostalCode??""),s(e=>({...e,...t}))}},[u,p]),g=(0,i.useMemo)(()=>({...a,stwMyWarehouseLocalStorage:d,stwPostalCodeLocalStorage:c,updateStwInfo:h}),[a,d,c,h]);return(0,o.jsx)(l.Provider,{value:g,children:e})};s.displayName="StwInfoProvider"},82038:(e,t,a)=>{"use strict";a.d(t,{i:()=>d,w:()=>s});var o=a(12115),i=Object.defineProperty,r=(e,t,a)=>{let o;return(o="symbol"!=typeof t?t+"":t)in e?i(e,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[o]=a};class l{constructor(){r(this,"selectedLocationId",null),r(this,"expandedLocationId",null),r(this,"snapshot",{selectedLocationId:null,expandedLocationId:null}),r(this,"listeners",new Set),r(this,"subscribe",e=>(this.listeners.add(e),()=>{this.listeners.delete(e)})),r(this,"getSnapshot",()=>this.snapshot),r(this,"getServerSnapshot",()=>({selectedLocationId:null,expandedLocationId:null})),r(this,"notify",()=>{this.snapshot={selectedLocationId:this.selectedLocationId,expandedLocationId:this.expandedLocationId}
395,this.listeners.forEach(e=>e())}),r(this,"selectLocation",e=>{this.selectedLocationId=e,this.expandedLocationId=e,this.notify()}),r(this,"clearSelection",()=>{this.selectedLocationId=null,this.expandedLocationId=null,this.notify()}),r(this,"setExpandedLocationId",e=>{this.expandedLocationId=e,this.notify()})}}let n=new l,s=()=>{let e=(0,o.useSyncExternalStore)(n.subscribe,n.getSnapshot,n.getServerSnapshot);return{selectedLocationId:e.selectedLocationId,expandedLocationId:e.expandedLocationId,selectLocation:n.selectLocation,clearSelection:n.clearSelection,setExpandedLocationId:n.setExpandedLocationId}},d=()=>{let{selectedLocationId:e,expandedLocationId:t,selectLocation:a,clearSelection:o,setExpandedLocationId:i}=s();return{selectedWarehouseId:e,expandedWarehouseId:t,selectWarehouse:a,clearSelection:o,setExpandedWarehouseId:i}}},83049:(e,t,a)=>{"use strict";a.d(t,{K:()=>S});var o=a(95155),i=a(51563),r=a(16002),l=a(27966),n=a(12158);let s="{reason}",d="openForGoldAt",u="{openingTime}",c="warehouse-openinghours";function p(e,t){return new Date(e.toLocaleString("en-US",{timeZone:t}))}let h=(e,t="en-us")=>{let a=null==e?void 0:e.getHours(),o=null==e?void 0:e.getMinutes();if("fr-ca"===t.toLowerCase())return new Intl.DateTimeFormat("fr-ca",{hour:"numeric",hour12:!1,minute:0!==o?"2-digit":void 0}).format(e);let i="";return i+=a%12||12,o>0&&(i+=`:${o}`),i+=a>=12?"PM":"AM"},g=e=>e.toString().padStart(2,"0"),f=(e,t)=>{let a=new Date(e),o=t.split(":");return a.setHours(Number(o[0])),a.setMinutes(Number(o[1])),a},x=(e,t,a)=>{let o=f(t,a);return e.getTime()<o.getTime()},m=(e,t,a,o,i=[])=>{var r,l,n,s,d,u;let c=o||0,p=[...i],h=new Date(e);h.setDate(h.getDate()+c);let f=`${h.getFullYear()}-${g(h.getMonth()+1)}-${g(h.getDate())}`,v=null==a?void 0:a.find(e=>e.holidayDate===f);if((null==(r=null==v?void 0:v.holidayHoursType)?void 0:r.code)==="hours-change"&&v.hour&&x(e,h,null==(l=v.hour)?void 0:l.close))return{close:v.hour.close,date:h,open:v.hour.open,hasSpecialHours:c<=1,skippedHolidays:p};if(v&&"closed"===v.holidayHoursType.code||(null==(n=null==v?void 0:v.holidayHoursType)?void 0:n.code)==="hours-change")(null==(s=null==v?void 0:v.holidayHoursType)?void 0:s.code)==="hours-change"||p.push({date:h,reason:(null==(u=null==(d=null==v?void 0:v.name)?void 0:d[0])?void 0:u.value)||"closed"});else{let a=t.find(e=>e.weekDays.includes(h.getDay()+1)&&"open"===e.hoursType.code);if(a&&x(e,h,a.close))return{close:a.close,date:h,open:a.open,hasSpecialHours:!1,skippedHolidays:p}}if(c<7)return m(e,t,a,c+1,p)},v=(e,t,a)=>{var o;let i={date:null,isOpen:!1,hasSpecialHours:!1,closedForHolidayToday:{closedForHoliday:!1,reason:""}};if(e.length){let r=p(new Date,t),l=m(r,e,a||[]);if(l){let e=f(l.date,l.open),t=f(l.date,l.close);i.hasSpecialHours=l.hasSpecialHours;let a=r.getTime(),n=e.getTime(),s=t.getTime();if((null==(o=l.skippedHolidays)?void 0:o.length)!==0){let e=l.skippedHolidays.find(e=>e.date.getDate()===r.getDate());i.closedForHolidayToday={closedForHoliday:!!e,reason:(null==e?void 0:e.reason)||""}}a<n?(i.isOpen=!1,i.date=e):a>=n&&a<s&&(i.isOpen=!0,i.date=t)}}return i};var b=a(24880);let y={textWrap:"wrap",color:b.sLX},w={...y,color:b.JBU},I={...y,color:b.JHH},S=({hours:e,holidays:t,timeZone:a,messages:g,locale:f="en-us",variant:x="t6",sx:m})=>{var b,S,k,$,A,C,M,T;let j,L,_=(0,i.Wc)({messages:g,hours:e,timeZone:a});if((null==_?void 0:_.length)>0)return console.error(`Missing props: ${_}}`),null;let O={};g.forEach(e=>O[e.text_only.development_field_key]=e.text_only.body);let W=((e,t,a)=>{let o={isOpenForAll:!1,openForAllDate:null,isOpenForExecutive:!1,openForExecutiveDate:null,hasSpecialHours:!1,closedForHolidayToday:{closedForHoliday:!1,reason:""}},i=[],r=[];if(e.forEach(e=>{var t,a,o;(null==(o=null==(a=null==(t=null==e?void 0:e.title)?void 0:t[0])?void 0:a.value)?void 0:o.includes("Business"))?i.push(e):r.push(e)}),i.length){let e=v(i,t,a);o.isOpenForExecutive=e.isOpen,o.openForExecutiveDate=e.date}if(r.length){let e=v(r,t,a);
395o.isOpenForAll=e.isOpen,o.openForAllDate=e.date,o.hasSpecialHours=e.hasSpecialHours,o.closedForHolidayToday=e.closedForHolidayToday}return o})(e,a,t);if(!(W.openForAllDate||W.openForExecutiveDate))return null;let D=W.openForAllDate?new Date(W.openForAllDate).getTime():null,E=W.openForExecutiveDate?new Date(W.openForExecutiveDate).getTime():null,P=p(new Date,a).getTime(),H=D&&E?Math.min(D,E):D||E||P,F="",N="";W.openForAllDate&&(F=h(W.openForAllDate,f)),W.openForExecutiveDate&&(N=h(W.openForExecutiveDate,f));let R={...y};switch(!0){case W.isOpenForAll:j=F&&(null==(b=O.openUntil)?void 0:b.replace("{closingTime}",F)),R=w;break;case W.closedForHolidayToday.closedForHoliday:j=W.closedForHolidayToday.reason.toUpperCase().includes("EMERGENCY")?null==(S=O.closedForEmergency)?void 0:S.replace(s,W.closedForHolidayToday.reason):null==(k=O.closedForHoliday)?void 0:k.replace(s,W.closedForHolidayToday.reason),R=I;break;case!W.isOpenForExecutive&&!W.isOpenForAll&&H-P>432e5:j=O.closed,R=I;break;case(!W.openForExecutiveDate||W.openForExecutiveDate&&D===E)&&H-P<432e5&&!W.isOpenForAll:j=F&&(null==(A=null==($=O.closedUntil)?void 0:$.replace(u,F))?void 0:A.replace("{openingDay}",W.openForAllDate?(0,r.Zr)(W.openForAllDate.toLocaleDateString(f,{weekday:"long"})):"")),R=I;break;case W.openForExecutiveDate&&D!==E&&!W.isOpenForExecutive&&!W.isOpenForAll&&H-P<432e5:j=N&&(null==(C=O.openForExecutiveAt)?void 0:C.replace(u,N)),L=F&&(null==(M=O[d])?void 0:M.replace(u,F));break;case W.openForExecutiveDate&&W.isOpenForExecutive&&!W.isOpenForAll:{let e=O.openForExecutive;j=N&&e?e:void 0,L=F&&(null==(T=O[d])?void 0:T.replace(u,F));break}default:return null}return(0,o.jsxs)(l.default,{sx:{display:"flex",flex:1,flexDirection:"column",flexWrap:"wrap"},children:[j&&(0,o.jsx)(n.Text,{sx:{...R,...m},uniqueId:c,variant:x,children:j}),L&&(0,o.jsx)(n.Text,{sx:{...R,...m},uniqueId:`${c}_1`,variant:x,children:L})]})}},84864:(e,t,a)=>{"use strict";a.d(t,{V:()=>c});var o=a(95155),i=a(51563),r=a(54309),l=a(12158),n=a(24880),s=a(25719),d=a(36377);let u=({text:e,textSx:t={},textVariant:a="t6",suffixText:d,suffixVariant:u=a,suffixTextSx:c={},uniqueId:p})=>{let h=(0,i.Wc)({text:e,uniqueId:p});return(null==h?void 0:h.length)>0?(console.error(`Missing props: ${h}}`),null):(0,o.jsxs)(s.CostcoBox,{component:"span",sx:{alignItems:"center",display:"inline-flex",gap:n.m72},children:[e&&(0,o.jsx)(l.Text,{component:"span",sx:t,uniqueId:p,variant:a,children:e}),d&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(s.CostcoBox,{component:"span",sx:r.A,children:"\xa0"}),(0,o.jsx)(l.Text,{component:"span",sx:c,uniqueId:`${p}_suffix`,variant:u,children:d})]})]})},c=({Adornment:e,containerSx:t={},statusText:a,statusTextSx:l={},suffixText:c,suffixTextSx:p={},textVariant:h="t6",suffixVariant:g=h,visuallyHiddenText:f,uniqueId:x,textBlocks:m=[]})=>{let v=(0,i.Wc)({statusText:a,uniqueId:x});return(null==v?void 0:v.length)>0?(console.error(`Missing props: ${v}}`),null):(0,o.jsxs)(s.CostcoBox,{sx:{alignItems:"flex-start",display:"flex",flexDirection:"column",...t},component:"span","data-testid":`${d.EA}_${x}`,children:[(0,o.jsxs)(s.CostcoBox,{sx:{alignItems:"center",display:"inline-flex",gap:n.m72},component:"span",children:[(0,o.jsx)(u,{suffixText:c,suffixTextSx:p,suffixVariant:g,text:a,textSx:l,textVariant:h,uniqueId:"stockStatusText"}),f&&(0,o.jsxs)(s.CostcoBox,{component:"span",sx:r.A,children:[f,"\xa0"]}),e&&(0,o.jsx)(o.Fragment,{children:e})]}),m.length>0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(s.CostcoBox,{component:"span",sx:r.A,children:"\xa0"}),m.map((e,t)=>(0,o.jsx)(u,{suffixText:null==e?void 0:e.suffixText,suffixTextSx:null==e?void 0:e.suffixTextSx,suffixVariant:null==e?void 0:e.suffixVariant,text:null==e?void 0:e.text,textSx:null==e?void 0:e.textSx,textVariant:null==e?void 0:e.textVariant,uniqueId:null==e?void 0:e.uniqueId},t))]})]})}},87900:(e,t,a)=>{"use strict";a.d(t,{g:()=>o});let o=e=>{var t,a,o,i,r;return"linear"===e.background_gradient_style?`linear-gradient(${null==(t=e.background_gradient_color.color1)?void 0:t.hex},${null==(a=e.background_gradient_color.color2)?void 0:a.hex})`:"radial"===e.background_gradient_style?`radial-gradient(${null==(o=e.background_gradient_color.color1)?void 0:o.hex},${null==(i=e.background_gradient_color.color2)?void 0:i.hex})`:null==(r=e.background_color)?void 0:r.hex}},89871:(e,t,a)=>{"use strict";a.d(t,{p:()=>c});var o=a(5233),i=a(7569),r=a(51563),l=a(46759),n=a(12115),s=a(71706),d=a(94571),u=a(3974);let c=()=>{let{userLocation:e,warehouse:t,preferredTerritory:a}=(0,s.B)(),{agent:c}=(0,i.useAgent)(),p=(0,n.useRef)(e),h=(0,n.useRef)(t),g=(0,n.useRef)(!1),[,f]=(0,u.M)(o.ce,void 0);return(0,n.useEffect)(()=>{g.current?(p.current=e,h.current=t):g.current=!0},[e,t]),(0,n.useCallback)(async({city:e,countryCode:t,postalCode:o,territory:i,warehouseId:n,warehouseDrawer:s,itemType:u,pageName:g,orderItemId:x,shouldUpdateCookies:m})=>
395{if(c)try{c.getCheckoutWarehouse(n,s,u||null,g||null,x||null)}catch(e){return console.warn("Failed to update warehouse via API:",e instanceof Error?e.message:e),!1}if("FMW"===s||m){let t=`${n}${l.Kc}`,a=h.current.nearestWarehouse?{...h.current}:{nearestWarehouse:{catalog:t}},i=p.current.city&&p.current.zip?{...p.current}:{city:e,zip:o};i.zip=o,i.city=e,a.nearestWarehouse||(a.nearestWarehouse={}),a.nearestWarehouse.catalog=t,f((0,d.SM)(t,o));let s=(0,r.ZC)(a),u=(0,r.ZC)(i);h.current.updateWarehouse(s),p.current.updateUserLocation(u)}if(t&&i&&(null==a?void 0:a.updatePreferredTerritory)){let e=`${t}${i}`;a.updatePreferredTerritory(e)}return!0},[c,a,f])}}}]);
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.