import{g as b,h as w,i as O,_ as M,C as k,a0 as I,r as g,o as l,c as S,j as _,e as d,w as p,n as L,a as u,x as m,G as x,b as C,k as F,d as P,t as H,I as B,m as R,F as A,E as j,p as V,f as z}from"./app.2934e07b.js";import{B as K}from"./breadcrumb.d66f3160.js";import{L as G}from"./location-staff-search.a79145d1.js";import"./anchor.6cf59b96.js";import"./vue-select.es.12d6cbe5.js";const q=b(()=>w(()=>O(()=>import("./vue-select.es.12d6cbe5.js"),["assets/vue-select.es.12d6cbe5.js","assets/app.2934e07b.js","assets/app.3901f893.css"]))),N={name:"search-filter-select",props:["config","internalState","placeholder","label","filterKey"],components:{CustomSvg:k,Heading:I,VueSelect:q}},U=["textContent"],Z={class:"filter-form"};function Y(e,t,i,s,r,o){const n=g("custom-svg"),f=g("vue-select");return i.config&&i.config.length?(l(),S("div",{key:0,class:m("filter filter-"+i.filterKey)},[i.internalState.value!==null||i.internalState.active?(l(),_(n,{key:0,type:"icon",name:"icon-close-thick",onClick:t[0]||(t[0]=h=>e.$emit("resetFilter",i.filterKey)),class:"icon-close-thick"})):d("",!0),p(u("label",{onClick:t[1]||(t[1]=h=>e.$emit("toggleFilterActive",i.filterKey,!0)),class:m(i.internalState.value!==null?"active":null),textContent:x(i.internalState.value!==null?i.internalState.value.name:i.label)},null,10,U),[[L,!i.internalState.active]]),p(u("div",Z,[C(f,{ref:"select",placeholder:i.placeholder,label:"name",options:i.config,clearable:!1,clearSearchOnBlur:()=>!0,"close-on-select":!0,"select-on-tab":!0,"onOption:selected":t[2]||(t[2]=h=>e.$emit("onSelectFilterSelected",i.filterKey,h))},{"open-indicator":F(()=>[C(n,{type:"icon",name:"icon-select-arrow",class:"select-arrow-icon"})]),"no-options":F(({search:h,searching:a,loading:c})=>[P(" No cities or ZIP Codes were found. Please refine your search and try again. ")]),_:1},8,["placeholder","options"])],512),[[L,i.internalState.active]])],2)):d("",!0)}const W=M(N,[["render",Y],["__scopeId","data-v-985df7c4"]]);const J=b(()=>w(()=>O(()=>import("./vue-select.es.12d6cbe5.js"),["assets/vue-select.es.12d6cbe5.js","assets/app.2934e07b.js","assets/app.3901f893.css"]))),Q={name:"search-filter-select-v2",props:["config","internalState","placeholder","label","filterKey"],components:{CustomSvg:k,Heading:I,VueSelect:J}},X={class:"arrow"},$={class:"filter-form"};function ee(e,t,i,s,r,o){const n=g("custom-svg"),f=g("vue-select");return i.config&&i.config.length?(l(),S("div",{key:0,class:m("filter filter-"+i.filterKey)},[i.internalState.value!==null||i.internalState.active?(l(),_(n,{key:0,type:"icon",name:"icon-close-thick",onClick:t[0]||(t[0]=h=>e.$emit("resetFilter",i.filterKey)),class:m(["icon-close-thick",i.internalState.value!==null?"active":null])},null,8,["class"])):d("",!0),p(u("label",{onClick:t[1]||(t[1]=h=>e.$emit("toggleFilterActive",i.filterKey,!0)),class:m(i.internalState.value!==null?"active":null)},[P(x(i.internalState.value!==null?i.internalState.value.name:i.label)+" ",1),u("span",X,[C(n,{type:"icon",name:"icon-select-arrow",class:"select-arrow-icon"})])],2),[[L,!i.internalState.active]]),p(u("div",$,[C(f,{ref:"select",placeholder:i.placeholder,label:"name",options:i.config,clearable:!1,clearSearchOnBlur:()=>!0,"close-on-select":!0,"select-on-tab":!0,"onOption:selected":t[2]||(t[2]=h=>e.$emit("onSelectFilterSelected",i.filterKey,h))},{"open-indicator":F(()=>[C(n,{type:"icon",name:"icon-select-arrow",class:"select-arrow-icon"})]),"no-options":F(({search:h,searching:a,loading:c})=>[P(" No cities or ZIP Codes were found. Please refine your search and try again. ")]),_:1},8,["placeholder","options"])],512),[[L,i.internalState.active]])],2)):d("",!0)}const te=M(Q,[["render",ee],["__scopeId","data-v-e03c3165"]]);const ie=b(()=>w(()=>O(()=>import("./map.baac1c41.js"),["assets/map.baac1c41.js","assets/index.273310ca.js","assets/app.2934e07b.js","assets/app.3901f893.css"]))),se=b(()=>w(()=>O(()=>import("./store-list.a07b0861.js"),["assets/store-list.a07b0861.js","assets/app.2934e07b.js","assets/app.3901f893.css","assets/store-item.5d1a2fbf.js","assets/store-item.f1177f2e.css","assets/store-list.65bca01d.css"]))),re=b(()=>w(()=>O(()=>import("./staff-store-list.b989ef98.js"),["assets/staff-store-list.b989ef98.js","assets/app.2934e07b.js","assets/app.3901f893.css","assets/staff-store-list.d5d31884.css"]))),oe=b(()=>w(()=>O(()=>import("./location-store-list.ac536580.js"),["assets/location-store-list.ac536580.js","assets/app.2934e07b.js","assets/app.3901f893.css","assets/location-store-list.c5800cc4.css"]))),ne=b(()=>w(()=>O(()=>import("./regional-pages-store-list.c6976567.js"),["assets/regional-pages-store-list.c6976567.js","assets/app.2934e07b.js","assets/app.3901f893.css","assets/regional-pages-store-list.ed71cc96.css"]))),ae={name:"location-and-staff-search-v2",components:{SearchFilterSelectV2:te,LocationStaffSearch:G,SearchFilterSelect:W,Breadcrumb:K,CustomPicture:H,Heading:I,CustomSvg:k,CustomMap:ie,StoreList:se,Intersect:B,StaffStoreList:re,LocationStoreList:oe,RegionalPagesStoreList:ne},props:{id:String,innerContentClasses:Array,backgroundColor:String,buttons:Array,componentStyles:Array,sectionClasses:Array,contentClasses:Array,containerClasses:Array,heading:Object,content:String,filterConfig:Object,initialFilters:Object,storeLocator:Object,regionalPages:Array,staffOptions:Array,topDoctors:Boolean,specialty:String||Boolean,hasSpecialty:Boolean,errorMessages:Object,type:String,removeFilterSection:Boolean},computed:{currentLocationStyle(){return this.$refs.location_search?{visibility:!Boolean(this.$refs.location_search.$refs.search)||!(Boolean(this.$refs.location_search.$refs.search.search.length!==0)&&Boolean(this.$refs.location_search.$refs.search.open))?"visible":"hidden"}:{}}},mounted(){if(this.hasSpecialty){let e=this.filterConfig.specialty.data.find(t=>t.name===this.specialty);e!==void 0&&this.onParameter("specialty",e)}window.addEventListener("onClearSearchClicked",this.clearSearch),window.addEventListener("click",this.onElementClicked)},beforeDestroy(){window.removeEventListener("onClearSearchClicked",this.clearSearch),window.removeEventListener("click",this.onElementClicked)},data(){return{storesByCategory:null,intersected:!1,window,google:null,services:{autocomplete:null,geocoder:null},geocodedPlaces:{},current:{nearbyCount:null,address:null,location:null,distance:null,practiceType:null,insuranceProvider:null},nearbyStores:this.storeLocator.stores,placeOptions:[],distanceLabel:null,enteredLocation:null,geocodedLocation:null,geolocationLocation:null,markerHoverTimeout:null,storeItemMouseEnterTimeout:null,searchError:!1,filters:null,initialized:!1,get_filters:[],hash:window.location.hash.substring(1),filterContentClass:window.location.pathname.includes("hormone-replacement-therapy")?"filter-content-hidden":"filter-content",filterContainerClass:window.location.pathname.includes("hormone-replacement-therapy")?"filter-container hidden":"filter-container"}},beforeMount(){this.filters={},Object.keys(this.filterConfig).forEach(e=>{this.filters[e]={value:this.filterConfig[e].data.find(t=>t.name===(this.initialFilters[e]||null))||null,active:!1}})},methods:{setHashValues(){let e,t;e=this.hash.split("&"),e.forEach(i=>{if(t=i.split("="),t[0]==="insurance"){let s=t[1].charAt(0).toLowerCase()+t[1].slice(1).replaceAll("-"," "),r=this.filterConfig.insurance.data.find(o=>o.name.toLowerCase()===s);r!==void 0&&this.onParameter("insurance",r)}if(t[0]==="specialty"){let s=t[1].charAt(0).toLowerCase()+t[1].slice(1).replaceAll("-"," "),r=this.filterConfig.specialty.data.find(o=>o.name.toLowerCase()===s);r!==void 0&&this.onParameter("specialty",r)}if(t[0]==="hospital_affiliation"){let s=t[1].charAt(0).toLowerCase()+t[1].slice(1).replaceAll("-"," "),r=this.filterConfig.hospital_affiliation.data.find(o=>o.name.toLowerCase()===s);r!==void 0&&this.onParameter("hospital_affiliation",r)}if(t[0]==="language"){let s=t[1].charAt(0).toLowerCase()+t[1].slice(1).replaceAll("-"," "),r=this.filterConfig.language.data.find(o=>o.name.toLowerCase()===s);r!==void 0&&this.onParameter("language",r)}if(t[0]==="gender"){let s=t[1].charAt(0).toLowerCase()+t[1].slice(1).replaceAll("-"," "),r=this.filterConfig.gender.data.find(o=>o.name.toLowerCase()===s);r!==void 0&&this.onParameter("gender",r)}t[0]==="distance"&&(this.current.distance=t[1],this.distanceLabel=t[1]+" miles",this.updateStores(!0))})},toggleFilterContainerDisabled(e){document.querySelector(".filter-container").classList.toggle("disabled",e)},isAnyFilterActive(){return this.filters!==null&&Object.values(this.filters).filter(e=>e.value!==null).length>0},async onParameter(e,t){this.filters[e].value!==t.name&&(this.toggleFilterContainerDisabled(!0),this.setFilterValue(e,t),await this.updateStores(!1),this.toggleFilterContainerDisabled(!1)),await this.toggleFilterActive(e,!1)},async onSelectFilterSelected(e,t){this.filters[e].value!==t.name&&(this.toggleFilterContainerDisabled(!0),this.setFilterValue(e,t),await this.updateStores(!0),this.toggleFilterContainerDisabled(!1)),this.updateHash(t.name.replaceAll(" ","-").toLowerCase(),e),await this.toggleFilterActive(e,!1)},setFilterValue(e,t){this.filters[e].value=t},async toggleFilterActive(e,t,i=!1){this.filters[e].active=t,Object.keys(this.filterConfig).forEach(s=>{s!==e&&this.filters[s].active&&!i&&this.toggleFilterActive(s,!1,!0)}),this.$refs["input_"+e][0].$refs.select!==void 0&&this.$refs["input_"+e][0].$refs.select.clearSelection(),t&&(await this.$nextTick,this.$refs["input_"+e][0].$refs.select.$refs.search.focus())},async resetFilter(e,t=!0){t&&this.toggleFilterContainerDisabled(!0),this.setFilterValue(e,null),await this.toggleFilterActive(e,!1),this.clearHash(e),t&&(await this.updateStores(),this.toggleFilterContainerDisabled(!1))},async resetFilterState(){this.toggleFilterContainerDisabled(!0),Object.keys(this.filterConfig).forEach(e=>{this.resetFilter(e,!1)}),await this.updateStores(),this.toggleFilterContainerDisabled(!1)},isMobile(){return this.window.outerWidth<=768},isMobileDevice(){return"maxTouchPoints"in navigator?navigator.maxTouchPoints>0:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},scrollToStoreItem(e){const t=this.$refs.storeList.itemRefs[e].$el;let i=null,s=null;if(this.isMobile())i=this.getElementPageOffset(t),s=window;else{const r=document.querySelector(".store-list");i=Math.min(r.scrollHeight,Math.max(0,t.getBoundingClientRect().y+t.closest(".store-list").scrollTop-t.closest(".store-list").getBoundingClientRect().y-document.querySelector("div.store-locator").offsetHeight/2+t.offsetHeight/2)),s=document.querySelector(".store-list")}s.scroll({top:i,left:0,behavior:"smooth"})},getElementPageOffset(e){return e.getBoundingClientRect().y+this.window.scrollY-document.querySelector("#app > header").offsetHeight},async scrollToMap(){this.isMobile()&&this.$refs.map&&this.$refs.map.$el&&(await this.$nextTick,this.window.scroll({top:this.getElementPageOffset(this.$refs.map.$el),left:0,behavior:"smooth"}))},async scrollToError(){this.isMobile()&&(await this.$nextTick,this.window.scroll({top:this.getElementPageOffset(document.querySelector(".filter-content-container .search-error")),left:0,behavior:"smooth"}))},onStoreItemMouseEnter(e){const t=this;this.storeItemMouseEnterTimeout!==null&&clearTimeout(this.storeItemMouseEnterTimeout),this.storeItemMouseEnterTimeout=setTimeout(()=>{t.scrollToMap(),t.$refs.map&&t.$refs.map.triggerMarkerHoverOver(e),t.storeItemMouseEnterTimeout=null},150)},onStoreItemMouseLeave(e){this.storeItemMouseEnterTimeout!==null&&clearTimeout(this.storeItemMouseEnterTimeout),this.scrollToMap(),this.$refs.map&&this.$refs.map.triggerMarkerHoverOut(e)},markerHoverOver(e){const t=this;this.markerHoverTimeout!==null&&clearTimeout(this.markerHoverTimeout),this.markerHoverTimeout=setTimeout(()=>{t.scrollToStoreItem(e),t.$refs.storeList.markerHoverOver(e),t.markerHoverTimeout=null},150)},markerHoverOut(e){this.markerHoverTimeout!==null&&clearTimeout(this.markerHoverTimeout),this.$refs.storeList.markerHoverOut(e)},toggleStores(e){},updateStores(e){let t=this.storeLocator.stores;Object.keys(this.filterConfig).forEach(a=>{this.filters[a].value!==null&&(t=t.filter(c=>this.filters[a].value.stores.includes(c.id)))});let i=t;if(this.current.distance===null||this.current.location===null){this.current.nearbyCount=t.length===this.storeLocator.stores.length?null:t.map(a=>a.uri).filter((a,c,v)=>v.indexOf(a)===c).length,this.current.location=null,t.length>0?(this.nearbyStores=t,this.clearSearchError()):(this.nearbyStores=this.storeLocator.stores,this.nearbyStores=this.nearbyStores.map(a=>(a.distance=null,a)),this.setSearchError(this.errorMessages.noFilters),this.resetFilterState()),this.toggleStores(!1),e&&this.scrollToMap();return}const s=this,r=parseInt(this.$refs.distance.max);let o=s.current.distance,n=10;[{coordinate:{lat:30.323654995062732,lng:-81.65701437221219},radiusToSearch:30,minimumDistanceOnSlider:20},{coordinate:{lat:26.715342,lng:-80.053375},radiusToSearch:15,minimumDistanceOnSlider:15},{coordinate:{lat:26.705621,lng:-80.03643},radiusToSearch:15,minimumDistanceOnSlider:15},{coordinate:{lat:26.616756,lng:-80.068448},radiusToSearch:15,minimumDistanceOnSlider:15}].every(a=>s.google.maps.geometry.spherical.computeDistanceBetween(new s.google.maps.LatLng(a.coordinate),new s.google.maps.LatLng(s.current.location))*621371e-9<a.radiusToSearch?(n=a.minimumDistanceOnSlider,!1):!0),t=t.map(a=>(a.distance=s.google.maps.geometry.spherical.computeDistanceBetween(new s.google.maps.LatLng(a.position),new s.google.maps.LatLng(s.current.location))*621371e-9,a)).sort((a,c)=>a.distance-c.distance),e&&t.length&&(o=Math.min(Math.max(Math.ceil(t[0].distance/5)*5,n),r).toString());let h=t;if(t=t.filter(a=>Math.ceil(a.distance)<=o),this.topDoctors||window.location.pathname.includes("hormone-replacement-therapy")){const a=h.map(c=>c.slug).filter((c,v,E)=>E.indexOf(c)===v);t.length<3&&(t=h.filter(function(c){return a.slice(0,3).indexOf(c.slug)>-1}))}t.length>0?(e&&(this.current.distance=this.$refs.distance.min=o,this.$nextTick(()=>{s.$refs.distance.value=o,s.updateDistanceLabel()})),this.current.nearbyCount=t.map(a=>a.uri).filter((a,c,v)=>v.indexOf(a)===c).length,this.nearbyStores=t,e&&this.initialized&&this.scrollToMap(),this.clearSearchError(),this.toggleStores(!0)):(this.current.nearbyCount=null,this.nearbyStores=this.storeLocator.stores,this.setSearchError(i.length===0?this.errorMessages.noFilters:this.errorMessages.noLocations),this.toggleStores(!1))},updateDistanceLabel(){const e=this.$refs.distance.value;this.distanceLabel=e+(e===this.$refs.distance.max?"+":"")+" miles"},onDistanceChanged(){this.current.distance=this.$refs.distance.value,this.current.distance===this.$refs.distance.max&&(this.current.distance=100),this.updateDistanceLabel(),this.updateStores(!1),this.updateHash(this.current.distance,"distance")},mapInitialized(e){this.google=e,this.services.autocomplete=new this.google.maps.places.AutocompleteService,this.services.geocoder=new this.google.maps.Geocoder,this.updateGeocodedLocation()},getPredictions(e,t){const i=this;return new Promise(function(s,r){i.services.autocomplete.getPlacePredictions({input:e,componentRestrictions:{country:"us"},types:[t],language:"en",fields:["address_components","geometry","name"]},function(o,n){return n!==i.google.maps.places.PlacesServiceStatus.OK||!o?r(new Error(n)):s(o)})})},setCurrentLocation(e,t){this.current.location=e,this.current.address=t,this.$refs.location_search&&(this.$refs.location_search.value=t),this.updateStores(!0)},setCurrentLocationFromGeocodeResult(e,t){this.setCurrentLocation({lat:e.geometry.location.lat(),lng:e.geometry.location.lng()},this.getLocationStringFromAddressComponents(e.address_components)),this.updateHash(e.geometry.location.lat(),"latitude"),this.updateHash(e.geometry.location.lng(),"longitude")},getLocationStringFromAddressComponents(e){let t=[];return e.forEach(i=>{i.types instanceof Array&&(i.types.indexOf("administrative_area_level_1")>-1||i.types.indexOf("locality")>-1)&&t.push(i.short_name)}),t.length===2?t.join(", "):null},toggleClearSelection(e){const t=document.querySelector(".vs__actions button.vs__clear");t&&t.classList.toggle("hidden",!e)},onSearchOptionSelected(e){if(e.type==="staff"){const t=new URL(e.url);t!==null&&R.Inertia.visit(t.href)}else{this.toggleClearSelection(!0);const t=e.prediction.place_id;this.geocodedPlaces.hasOwnProperty(t)?this.setCurrentLocationFromGeocodeResult(this.geocodedPlaces[t]):this.services.geocoder.geocode({placeId:t}).then(({results:i})=>{this.geocodedPlaces[t]=i[0],this.setCurrentLocationFromGeocodeResult(this.geocodedPlaces[t])})}},replaceUrlParam(e,t,i){i==null&&(i="");let s=new RegExp("\\b("+t+"=).*?(&|#|$)");return e.search(s)>=0?e.replace(s,"$1"+i+"$2"):(e=e.replace(/[?#]$/,""),e+"&"+t+"="+i)},removeURLParameter(e,t){let i=encodeURIComponent(t)+"=",s=e.split(/[&;]/g);for(let r=s.length;r-- >0;)s[r].lastIndexOf(i,0)!==-1&&s.splice(r,1);return s.length>0?"#"+s.join("&"):""},updateHash(e,t){},clearHash(e){this.hash=window.location.hash.substring(1),location.hash=this.removeURLParameter(this.hash,e)},clearSearchError(){this.setSearchError(null)},setSearchError(e){this.searchError=e,e!==null&&(this.scrollToError(),this.nearbyStores=this.nearbyStores.map(t=>(t.distance=null,t)))},updateCurrentLocation(){const e=this;this.geolocationLocation!==null?e.setCurrentLocationFromGeocodeResult(this.geolocationLocation):navigator.geolocation&&navigator.geolocation.getCurrentPosition(function(t){const i={lat:t.coords.latitude,lng:t.coords.longitude};e.services.geocoder.geocode({location:i}).then(s=>{s.results[0]?(e.clearSearchError(),e.setCurrentLocation(i,e.getLocationStringFromAddressComponents(s.results[0].address_components)),e.geocodedPlaces[s.results[0].place_id]=i,e.geolocationLocation=s.results[0]):e.updateGeocodedLocation()}).catch(s=>{e.updateGeocodedLocation()})},function(t){e.updateGeocodedLocation()})},updateGeocodedLocation(){const e=this;if(window.externalLocationStaffSearchData)window.externalLocationStaffSearchData.address&&externalLocationStaffSearchData.location&&(e.setCurrentLocation(window.externalLocationStaffSearchData.address,externalLocationStaffSearchData.location),e.initialized=!0,window.externalLocationStaffSearchData=null);else if(this.geocodedLocation!==null)e.setCurrentLocationFromGeocodeResult(this.geocodedLocation),e.initialized=!0;else if(this.hash.length!==0){let t=this.hash.split("&"),i,s,r;t.forEach(n=>{i=n.split("="),i[0]==="latitude"?s=i[1]:i[0]==="longitude"&&(r=i[1])});let o={lat:parseFloat(s),lng:parseFloat(r)};e.services.geocoder.geocode({location:o}).then(({results:n})=>{const f=n[0].place_id;this.geocodedLocation=e.geocodedPlaces[f]=n[0],e.setCurrentLocationFromGeocodeResult(e.geocodedPlaces[f]),e.initialized=!0}).catch(n=>{e.current.nearbyCount=null,e.current.location=null,e.setSearchError(this.errorMessages.generic),e.initialized=!0}),e.initialized=!0}else this.isMobileDevice()?(this.clearHash("latitude"),this.clearHash("longitude"),this.initialized=!1,this.nearbyStores=this.nearbyStores.map(t=>(t.distance=null,t)),this.initialized=!0,this.toggleClearSelection(!1)):axios.post(`https://www.googleapis.com/geolocation/v1/geolocate?key=${this.storeLocator.apiKey}`).then(t=>{t.data.location&&e.services.geocoder.geocode({location:t.data.location}).then(({results:i})=>{const s=i[0].place_id;this.geocodedLocation=e.geocodedPlaces[s]=i[0],e.setCurrentLocationFromGeocodeResult(e.geocodedPlaces[s]),e.initialized=!0}).catch(i=>{e.current.nearbyCount=null,e.current.location=null,e.setSearchError(this.errorMessages.generic),e.initialized=!0})})},onLocationClosed(){this.placeOptions=[]},onLocationSearchFocus(){this.$refs.location_search.$refs.search.$el.classList.add("focused")},onLocationSearchBlur(){this.$refs.location_search.$refs.search.$el.classList.remove("focused")},onElementClicked(e){e.target&&(e.target.tagName.toLowerCase()==="button"&&e.target.classList.contains("vs__clear")?this.clearSearch():e.target.closest("button.vs__clear")!==null&&this.clearSearch())},clearSearch(){this.clearHash("latitude"),this.clearHash("longitude"),this.initialized=!1,this.setCurrentLocation(null,null),this.nearbyStores=this.nearbyStores.map(e=>(e.distance=null,e)),this.initialized=!0,this.toggleClearSelection(!1)},onLocationSearch(e,t){if(e.length===0)return;const i=this;t(!0);let s=[],r=[];this.getPredictions(e,"(regions)").then(o=>{s=o.map(n=>{let f=n.description.split(", ").slice(0,-1).join(", ");if(n.types instanceof Array&&n.types.length){const h=n.types[0];if(h==="postal_code")f=n.structured_formatting.main_text+" (ZIP Code)";else if(h==="administrative_area_level_1")return null}return{type:"location",label:f,prediction:n}}).filter(n=>n!==null)}).catch(()=>{s=!1}).finally(()=>{this.getPredictions(e,"address").then(o=>{r=o.map(n=>({type:"location",label:n.description.split(", ").slice(0,-1).join(", "),prediction:n})).filter(n=>n!==null)}).catch(()=>{r=!1}).finally(()=>{s=s||[],r=r||[],i.placeOptions=s.concat(r).splice(0,5),t(!1)})})},async onIntersect(e){e.isIntersecting&&(this.intersected=!0,await this.$nextTick,this.current.distance=parseInt(this.$refs.distance.value),this.updateDistanceLabel())}}},le=e=>(V("data-v-1262d364"),e=e(),z(),e),ce=["id"],ue={key:0,class:"filter-content-container"},he={class:"main-content"},de=["innerHTML"],fe={key:0,class:"store-search"},ge=["innerHTML"],me={class:"range-control"},Se={key:0,class:"field-extra"},_e=["innerHTML"],ve=le(()=>u("p",{class:"filter-label"},"Filter by",-1)),ye={class:"filters"};function pe(e,t,i,s,r,o){const n=g("heading"),f=g("location-staff-search"),h=g("search-filter-select-v2"),a=g("intersect"),c=g("store-list"),v=g("custom-map"),E=g("staff-store-list"),D=g("regional-pages-store-list");return l(),S(A,null,[u("section",{class:m(i.sectionClasses),id:i.id},[u("div",{class:m(i.contentClasses)},[u("div",{class:m(i.containerClasses)},[this.removeFilterSection?d("",!0):(l(),S("div",ue,[u("div",{class:m(r.filterContentClass)},[u("div",he,[i.heading?(l(),_(n,{key:0,class:"filter-heading",config:i.heading},null,8,["config"])):d("",!0),i.content?(l(),S("div",{key:1,innerHTML:i.content},null,8,de)):d("",!0)]),r.intersected?(l(),S("div",fe,[p(u("p",{class:"search-error red",ref:"searchError",innerHTML:r.searchError},null,8,ge),[[L,r.searchError]]),u("form",null,[C(f,{ref:"location_search",wrapperClasses:["form"],staffOptions:i.staffOptions,placeOptions:r.placeOptions,onSearch:o.onLocationSearch,"onSearch:focus":o.onLocationSearchFocus,"onSearch:blur":o.onLocationSearchBlur,"onOption:selected":o.onSearchOptionSelected,onCurrentLocationClicked:o.updateCurrentLocation,currentLocationStyle:o.currentLocationStyle,onClearSearch:o.clearSearch,onClose:o.onLocationClosed,searchType:i.type},null,8,["staffOptions","placeOptions","onSearch","onSearch:focus","onSearch:blur","onOption:selected","onCurrentLocationClicked","currentLocationStyle","onClearSearch","onClose","searchType"]),p(u("div",me,[r.distanceLabel?(l(),S("span",Se,"Distance")):d("",!0),u("input",{name:"distance",type:"range",min:"10",max:"50",value:"50",step:"5",class:"slider",ref:"distance",onInput:t[0]||(t[0]=(...y)=>o.onDistanceChanged&&o.onDistanceChanged(...y))},null,544),r.distanceLabel?(l(),S("span",{key:1,innerHTML:r.distanceLabel},null,8,_e)):d("",!0)],512),[[L,Boolean(r.current.location)&&Boolean(this.$refs.distance.min!==this.$refs.distance.max)&&Boolean(r.current.nearbyCount)]])])])):d("",!0)],2),u("div",{class:m(r.filterContainerClass)},[ve,u("div",ye,[(l(!0),S(A,null,j(i.filterConfig,(y,T)=>(l(),_(h,{onToggleFilterActive:o.toggleFilterActive,onResetFilter:o.resetFilter,onOnSelectFilterSelected:o.onSelectFilterSelected,config:y.data,internalState:r.filters[T],placeholder:y.placeholder,label:y.label,filterKey:T,ref_for:!0,ref:"input_"+T},null,8,["onToggleFilterActive","onResetFilter","onOnSelectFilterSelected","config","internalState","placeholder","label","filterKey"]))),256))]),o.isAnyFilterActive()?(l(),S("p",{key:0,class:"clear-filters",onClick:t[1]||(t[1]=(...y)=>o.resetFilterState&&o.resetFilterState(...y))},"Clear all filters")):d("",!0)],2)]))],2)],2),u("div",{class:m(["content ntbp",i.type!=="providers"?"content-filters":"providers"])},[r.intersected?d("",!0):(l(),_(a,{key:0,onOnChange:o.onIntersect,ref:"intersectComponent"},null,8,["onOnChange"])),r.intersected?p((l(),S("div",{key:1,class:m(["store-locator",i.type&&i.type==="providers"?"providers":null]),ref:"store_locator"},[i.type&&i.type==="providers"?(l(),_(c,{key:0,classes:i.storeLocator.classes.list,current:r.current,onStoreItemMouseEnter:o.onStoreItemMouseEnter,onStoreItemMouseLeave:o.onStoreItemMouseLeave,stores:r.nearbyStores,allStoresText:i.storeLocator.strings.allStores,singularLabel:i.storeLocator.strings.singularLabel,ref:"storeList",type:i.type,component:"staff-card-item"},null,8,["classes","current","onStoreItemMouseEnter","onStoreItemMouseLeave","stores","allStoresText","singularLabel","type"])):(l(),_(c,{key:1,classes:i.storeLocator.classes.list,current:r.current,onStoreItemMouseEnter:o.onStoreItemMouseEnter,onStoreItemMouseLeave:o.onStoreItemMouseLeave,stores:r.nearbyStores,allStoresText:i.storeLocator.strings.allStores,singularLabel:i.storeLocator.strings.singularLabel,ref:"storeList",type:i.type,component:"location-staff-store-item"},null,8,["classes","current","onStoreItemMouseEnter","onStoreItemMouseLeave","stores","allStoresText","singularLabel","type"])),C(v,{ref:"map",apiKey:i.storeLocator.apiKey,classes:i.storeLocator.classes.map,config:i.storeLocator.mapConfig,iconConfig:i.storeLocator.iconConfig,stores:r.nearbyStores,onMarkerHoverOver:o.markerHoverOver,onMarkerHoverOut:o.markerHoverOut,onMapInitialized:o.mapInitialized},null,8,["apiKey","classes","config","iconConfig","stores","onMarkerHoverOver","onMarkerHoverOut","onMapInitialized"])],2)),[[L,r.initialized]]):d("",!0)],2)],10,ce),i.type&&i.type==="providers"?(l(),_(E,{key:0,stores:i.storeLocator.stores},null,8,["stores"])):i.regionalPages&&i.regionalPages.length>0?(l(),_(D,{key:1,regionalPages:i.regionalPages},null,8,["regionalPages"])):d("",!0)],64)}const Fe=M(ae,[["render",pe],["__scopeId","data-v-1262d364"]]);export{Fe as default};