1(self.webpackChunk_verndale_toolkit=self.webpackChunk_verndale_toolkit||[]).push([[2674],{73373:function(te){function E(s){var e=new Error("Cannot find module '"+s+"'");throw e.code="MODULE_NOT_FOUND",e}E.keys=function(){return[]},E.resolve=E,E.id=73373,te.exports=E},63345:function(te,E,s){"use strict";s.d(E,{dM:function(){return S},of:function(){return M}});var e=s(87491);const N=b=>(b.body?.results.forEach(V=>V),b),_=b=>b,$=b=>b,W=(b,V)=>{if(s.g.preProcessRequest&&V==="searchApiFetch"&&b.body){const Q=s.g.preProcessRequest(b.body.toString());b.body=Q}return b},M=({organizationId:b,accessToken:V,searchHub:Q,pipeline:J})=>(0,e.us)({configuration:{organizationId:b,accessToken:V,search:{searchHub:Q,pipeline:J,preprocessSearchResponseMiddleware:N,preprocessFacetSearchResponseMiddleware:_,preprocessQuerySuggestResponseMiddleware:$},analytics:{originLevel3:document.referrer?document.referrer:"no-referrer"},preprocessRequest:W}}),c=document.querySelector(".coveo-common-engine-configurator"),u={};let S=null;c&&(u.organizationId=c.dataset.coveoOrganizationId,u.accessToken=c.dataset.coveoAccessToken,u.searchHub=c.dataset.coveoSearchHub,u.pipeline=c.dataset.coveoPipeline,S=(0,e.us)({configuration:{organizationId:u.organizationId,accessToken:u.accessToken,search:{searchHub:u.searchHub,pipeline:u.pipeline,preprocessSearchResponseMiddleware:N,preprocessFacetSearchResponseMiddleware:_,preprocessQuerySuggestResponseMiddleware:$},analytics:{originLevel3:document.referrer?document.referrer:"no-referrer"},preprocessRequest:W}}));let U=null},36453:function(te,E,s){"use strict";s.d(E,{Ad:function(){return T},Bw:function(){return S},G8:function(){return J},Hl:function(){return M},Jz:function(){return W},Kp:function(){return u},Y_:function(){return U},dN:function(){return c},eY:function(){return O},ki:function(){return R}});var e=s(36808),N=s.n(e),_=s(87491);const $="ssl-location-data",W=t=>{const n=localStorage.getItem($);return n?JSON.parse(n):null},M=t=>{Object.keys(t).forEach(r=>{t[r]=="null"&&(t[r]=null)});const n=W()||{};Object.keys(n).forEach(r=>{n[r]=="null"&&(n[r]=null)});const a={...n,...t};localStorage.setItem($,JSON.stringify(a))},c=(t,n)=>n==="mi"?(t*621371e-9).toFixed(2):(t*.001).toFixed(2),u=({linkToAnchor:t=null,linkWholeCard:n=!0,result:a,showDistance:r=!0,imageDomain:h="",unit:p="mi",unitLabelCard:A="mi",underlineTitle:I=!1})=>{const k=a.raw.ssl_thumbnailimage||a.raw.ssl_mainimagedesktop?`<img src="${h}${a.raw.ssl_thumbnailimage?a.raw.ssl_thumbnailimage:a.raw.ssl_mainimagedesktop}">`:"",L=a.raw.ssl_communityname?`<h4 class="map-info-window__header map-info-window__title">${a.raw.ssl_communityname?a.raw.ssl_communityname:a.raw.title}</h4>`:"";return`${n?`<a href='${t||a.raw.uri}' class="map-info-window ${I?"map-info-window__underline-title":""}"' target="_blank">`:""}<div class="map-info-window__info-window"> 2 <div class="map-info-window__image-container"> 3 ${k} 4 </div> 5 <div class="map-info-window__text"> 6 ${L} ${r?`<div class="map-info-window__distance">${a.raw.distance_search} ${A}</div>`:""} 7 </div> 8 </div> ${n?"</a>":""}`},S=t=>{const{module:n,distance:a,ssl_latitude_d:r,ssl_longitude_d:h,ssl_communityname:p,ssl_thumbnailimage:A,ssl_pricingandavailabilityphone:I,ssl_residentsandfamilyphone:k,ssl_communityid:L,uri:B,ssl_mainimagedesktop:x}=t.raw,D={ssl_latitude:r,ssl_longitude:h,ssl_communityname:p,ssl_thumbnailimage:A||x,ssl_pricingandavailabilityphone:I,ssl_residentsandfamilyphone:k,ssl_communityid:L,ssl_communitylink:B,ssl_distance:a},f=JSON.stringify(D);N().set("current_community",f)},U=t=>{const n=/^(https?|ftp|file|mailto|tel|sip):/i.test(t),a=/^(\/|\.\/|\.\.\/)/.test(t);return n||a?t:""},b=(t,n)=>[{fieldName:"@distance",function:`dist(@ssl_latitude_d,@ssl_longitude_d, ${parseFloat(t)}, ${parseFloat(n)})`},{fieldName:"@distanceInMiles",function:"@distance*0.000621371"}],V=(t,n)=>{const a=window;a.preProcessRequest=r=>{const h=JSON.parse(r.toString());return h.queryFunctions=b(t,n),JSON.stringify(h)}},Q=({source:t,radiusInMiles:n=50,careType:a=null,state:r=null,contextLanguage:h="en",hiddenCommunitiesArray:p=[]})=>({aq:`(@source=="${t}") ${r===null&&n?`(@distanceInMiles<=${n})`:""} ${a?`(@ssl_levelsofcare=="${a}")`:""} (@ssl_contextlanguage==${h}) ${r?`(@ssl_stateabbreviation=="${r}")`:""} (@ssl_pagetype=='community_pagetype') ${p.length>0?p.map(A=>`(NOT @ssl_communityid=="${A}")`).join(" "):""}`}),J=()=>["distance","uri","ssl_latitude_d","ssl_longitude_d","ssl_thumbnailimage","ssl_mainimagedesktop","ssl_communityid","ssl_communityname","ssl_heading","ssl_contextlanguage","ssl_state","ssl_city","ssl_zipcode","ssl_stateabbreviation","ssl_levelsofcare","ssl_pricingandavailabilityphone","ssl_residentsandfamilyphone","ssl_communityprice","ssl_commnunitystatus","ssl_mainimagedesktop_405x548"],Y=({engine:t,pipeline:n="default"})=>{const{logInterfaceLoad:a}=w(t),{executeSearch:r}=y(t);t.dispatch(r(a()))},O=({engine:t,latitude:n,longitude:a,source:r,advancedUrlQuery:h=null,radiusInMiles:p,state:A=null,language:I,pipeline:k="default",hiddenCommunitiesArray:L=[],previousLoad:B=!1})=>{if(B)return;const{registerSortCriterion:x}=(0,_.In)(t),{setPipeline:D}=(0,_.hM)(t),{logInterfaceLoad:f,logSearchFromLink:i}=(0,_.bK)(t),{executeSearch:g}=(0,_.wP)(t);V(n,a);const P=(0,_.vP)(t);let C;h?C={aq:`(@source=="${r}") (@ssl_contextlanguage==${I}) (@ssl_pagetype=='community_pagetype') ${h}`}:C=Q({source:r,state:A,radiusInMiles:p?parseFloat(p):null,contextLanguage:I,hiddenCommunitiesArray:L}
8),t.dispatch(x((0,_.rE)("distance","ascending"))),t.dispatch(D(k)),t.dispatch(P.registerAdvancedSearchQueries(C)),h?t.dispatch(g(i())):t.dispatch(g(f()))},R=({engine:t,latitude:n,longitude:a,advancedUrlQuery:r,source:h="Production US - English",radiusInMiles:p=50,careType:A=null,state:I=null,language:k="en",pipeline:L="default",hiddenCommunitiesArray:B=[]})=>{const{registerSortCriterion:x}=(0,_.In)(t),{setPipeline:D}=(0,_.hM)(t),{logSearchboxSubmit:f}=(0,_.bK)(t),{executeSearch:i}=(0,_.wP)(t);V(n,a);const g=(0,_.vP)(t);let P;r?P={hq:`(@source=="${h}") (@ssl_contextlanguage==${k}) (@ssl_pagetype=='community_pagetype') ${r}`}:P=Q({source:h,state:I,careType:A,radiusInMiles:p?parseFloat(p):null,contextLanguage:k,hiddenCommunitiesArray:B}),t.dispatch(x((0,_.rE)("distance","ascending"))),t.dispatch(D(L)),t.dispatch(g.registerAdvancedSearchQueries(P)),t.dispatch(i(f()))},j=()=>{const t=window.location.hash.slice(1);return new URLSearchParams(t).get("aq")||null},ne=()=>{const t=window.location.hash.slice(1);return new URLSearchParams(t).get("hq")||null},G=()=>{const t=window.location.hash.split("&").filter(n=>!n.includes("f")).join("&");window.location.hash=t},H=t=>{const n=localStorage.getItem("ssl-modules-cache"),a=n?JSON.parse(n):null;return t?a?a[t]:null:a},z=(t,n,a)=>{const r={...H()||{},[t]:{value:n,locationInfo:a}};localStorage.setItem("ssl-modules-cache",JSON.stringify(r))},Z=(t,n)=>!t||!n?!1:t.Latitude===n.Latitude&&t.Longitude===n.Longitude,T=t=>t?t.sort((n,a)=>{if(n.raw.distance===a.raw.distance)return 0;if(n.raw.distance>a.raw.distance)return 1;if(n.raw.distance<a.raw.distance)return-1}):[]},66817:function(te,E,s){"use strict";s.r(E);var e=s(67294),N=s(24702),_=s(58234),$=s(63345),W=s(87491),M=s(30894),c=s(13003),u=s(36453);const S=({locationCookieName:U,coveoOrganizationId:b,coveoAccessToken:V,coveoSearchHub:Q,module:J,coveoPipeline:Y,coveoSource:O="Production US - English",coveoContextLanguage:R="en",coveoSearchRadiusInMiles:j,coveoAutocompleteFields:ne,mapApiKey:G,latitude:H=0,longitude:z=0,searchButtonLabel:Z="Search",hiddenCommunities:T,debug:t,locationSelectorOptions:n,noResultsMessage:a="No results found"})=>{const[r,h]=(0,e.useState)(!0),[p,A]=(0,e.useState)({Latitude:H,Longitude:z,Zipcode:""}),[I,k]=(0,e.useState)([]),L=(0,e.useRef)(!1),B=(0,e.useRef)(JSON.parse(n).find(C=>C.defaultValue==="true").source||O),x=e.useMemo(()=>JSON.parse(T.replace(/'/g,'"'))),D=(0,e.useMemo)(()=>(0,$.of)({organizationId:b,accessToken:V,searchHub:Q,pipeline:Y}),[]),f=(0,e.useMemo)(()=>(0,W.q)(D,{options:{fieldsToInclude:(0,u.G8)()}}),[]),i=()=>{let C=(0,u.Jz)(U);C&&(A(C),(0,u.ki)({engine:D,latitude:C.Latitude,longitude:C.Longitude,source:B.current,radiusInMiles:parseFloat(j),state:C.State,language:R,pipeline:Y,hiddenCommunitiesArray:x})),h(!1)};(0,_.Z)("geolocation-received",({payload:C})=>{if(C.Module===J)i();else return},[]);const g=C=>{B.current=JSON.parse(n).find(X=>X.value===C.value).source},P=(C,X,oe,F)=>{L.current=!0,(0,_.W)({type:"get-zip-geolocation",payload:{value:C,country:`${X.value==="us"?"USA":"CANADA"}`,moduleName:J}}),h(!0)};return(0,e.useEffect)(()=>{f.subscribe(()=>{k(f.state.results)}),(0,u.eY)({engine:D,latitude:H,longitude:z,source:B.current,radiusInMiles:parseFloat(j),language:R,pipeline:Y,hiddenCommunitiesArray:x}),h(!1)},[]),e.createElement(M.Z.Provider,{value:{resultsListController:f,waitingForGeolocation:r,geolocationData:p}},D&&e.createElement("div",{className:"location-selector-headless location-selector-headless--no-padding"},e.createElement(N.Z,{locationCookieName:U,coveoAutocompleteFields:ne,coveoEngine:D,countryOptions:n,searchButtonLabel:Z,onCountryChange:g,externalSubmitHandler:P})),e.createElement("div",{className:"clustered-communities-map-row__map"},I.length>0?e.createElement(c.Z,{linkToAnchor:"#Contact-Us",apiKey:G,center:{lat:parseFloat(p.Latitude),lng:parseFloat(p.Longitude)},zoom:10,radiusInMiles:p.State===null?0:parseFloat(j),zoomControl:!0}):e.createElement("div",{className:"coveo-no-results-message"},a)))};E.default=S},13003:function(te,E,s){"use strict";var e=s(67294),N=s(30894),_=s(37054),$=s(36453),W=s(8262);const M={width:"100%",height:"100%",minHeight:"600px"},c=({linkToAnchor:u=null,center:S,radiusInMiles:U,zoomControl:b=!1,zoomPosition:V,zoom:Q,streetViewControl:J=!1,mapTypeControl:Y=!1,scaleControl:O=!1,fullscreenControl:R=!1,disableDoubleClickZoom:j=!1,draggable:ne=!0,circleDebug:G=!1,apiKey:H,showInfoWindows:z=!0,showMarkerLabel:Z=!1})=>{const[T,t]=(0,e.useState)(null),[n,a]=(0,e.useState)(Q),[r,h]=(0,e.useState)(null),[p,A]=(0,e.useState)(null),[I,k]=(0,e.useState)(null),[L,B]=(0,e.useState)(null),[x,D]=(0,e.useState)(null),[f,i]=(0,e.useState)([]),[g,P]=(0,e.useState)(S),{resultsListController:C,waitingForGeolocation:X,hoveredResult:oe=null,onMarkerClick:F=null}=(0,e.useContext)(N.Z),[se,ie]=(0,e.useState)(C.state);(0,e.useEffect)(()=>{C.subscribe(()=>{ie(C.state)})},[]);const{isLoaded:ue}=(0,_.Ji)({id:"google-map-script",googleMapsApiKey:H}),ae=l=>{if(p&&l.length>0){const d=new window.google.maps.LatLngBounds;l.forEach(v=>{v.raw.ssl_latitude_d&&v.raw.ssl_longitude_d&&d.extend({lat:v.raw.ssl_latitude_d,lng:v.raw.ssl_longitude_d})}),l.length>0?p.fitBounds(d):P(d.getCenter())}},re=()=>{r&&p&&U>0&&p.fitBounds(r.getBounds(),{top:0,right:0,left:0,bottom:0})},ce=l=>{l!==T&&t(l)};(0,e.useEffect)(()=>{const l=se.results.map(d=>{if(d={...d},d.raw.distance&&(d={...d,raw:{...d.raw,distance:(d.raw.distance/1610).toFixed(2)}}),d.raw.ssl_latitude_d&&d.raw.ssl_longitude_d){if(d.raw.distance_search||d.raw.distance){const _e=d.raw.distance_search?d.raw.distance_search:d.raw.distance,m=(0,$.dN)(_e,"mi");d={...d,raw:{...d.raw,distance_search:m}}}const v=(0,$.Kp)({linkToAnchor:u,linkWholeCard:!0,showDistance:!1,underlineTitle:!0,result:d});d={...d,infoWindowContentString:v},d={...d,icon:L}}return d});t(null),i(l),se.results.length>0,ae(l)},[se,L]),(0,e.useEffect)(()=>(r&&p&&p.addListener("click",()=>{t(null)}),()=>{r&&p&&window.google.maps.event.clearInstanceListeners(p)}),[r,p,g]);const de=e.useCallback(l=>{h(l)},[]),me=e.useCallback(l=>{k({path:window.google.maps.SymbolPath.CIRCLE,fillColor:"white",fillOpacity:1,strokeWeight:0,scale:10,anchor:new window.google.maps.Point(0,3)}),B({path:"M20 0A20.271 20.271 0 0 0 0 20.405c0 16.077 18.615 31.712 19.481 32.418A1.214 1.214 0 0 0 20 53a1.214 1.214 0 0 0 .519-.177C21.3 52.205 40 36.482 40 20.405A20.271 20.271 0 0 0 20 0Z",fillColor:"#037eab",strokeColor:"white",fillOpacity:1,scale:1,anchor:new window.google.maps.Point(20,53)}),D({path:"M20 0A20.271 20.271 0 0 0 0 20.405c0 16.077 18.615 31.712 19.481 32.418A1.214 1.214 0 0 0 20 53a1.214 1.214 0 0 0 .519-.177C21.3 52.205 40 36.482 40 20.405A20.271 20.271 0 0 0 20 0Z",fillColor:"#f46b16",strokeColor:"white",fillOpacity:1,scale:1,anchor:new window.google.maps.Point(20,53)}),A(l)},[]),pe=e.useCallback(l=>{A(null)},[]);return(0,e.useEffect)(()=>{const l=[];f.map(d=>{d.raw.ssl_communityid===oe?.raw.ssl_communityid?d.icon=x:d.icon=L,l.push(d)}),i(l)},[oe]),(0,e.useEffect)(()=>{const l=()=>{re(),ae(f)};return window.addEventListener("resize",l),()=>{window.removeEventListener("resize",l)}}),X?e.createElement("div",{className:"headless-loader"},e.createElement("div",{className:"headless-loader__inner"})):ue?e.createElement(_.b6,{mapContainerStyle:M,center:g,zoom:n,options:{zoomControl:b,zoomControlOptions:{position:window.google?.maps.ControlPosition[V||"TOP_LEFT"]},streetViewControl:J,mapTypeControl:Y,scaleControl:O,fullscreenControl:R,disableDoubleClickZoom:j,draggable:ne,styles:W.sm},onLoad:me,onUnmount:pe},e.createElement(_.Cd,{onLoad:de,center:g,radius:U*1610,options:{fillColor:"coral",fillOpacity:.3,strokeWeight:2,strokeColor:"coral",clickable:!1,editable:!0,zIndex:1,visible:G}}),p&&r&&I&&L&&x&&f.map((l,d)=>e.createElement(e.Fragment,{key:l.raw.ssl_communityid},l.raw.ssl_latitude_d&&l.raw.ssl_longitude_d&&e.createElement(_.Jx,{position:{lat:l.raw.ssl_latitude_d,lng:l.raw.ssl_longitude_d},icon:l.icon&&{...l.icon},onMouseOver:()=>{F||i(f.map(v=>(l.raw.ssl_communityid===v.raw.ssl_communityid&&(v.icon=x),v)))},onMouseOut:()=>{F||i(f.map(v=>(l.raw.ssl_communityid===v.raw.ssl_communityid&&(v.icon=L),v)))},onClick:()=>{F&&F(l),z&&ce(l.raw.ssl_communityid)}},T===l.raw.ssl_communityid?e.createElement(_.nx,{onCloseClick:()=>{t(null)}},e.createElement("div",{onClick:()=>{(0,$.Bw)(l)},dangerouslySetInnerHTML:{__html:l.infoWindowContentString}})):null),l.raw.ssl_latitude_d&&l.raw.ssl_longitude_d&&e.createElement(_.Jx,{key:l.raw.ssl_communityid,position:{lat:l.raw.ssl_latitude_d,lng:l.raw.ssl_longitude_d},label:Z?{text:`${d+1}`,color:"#000000"}:null,icon:l.icon&&{...I},onClick:()=>{F&&F(l),z&&ce(l.raw.ssl_communityid)},onMouseOver:()=>{F||i(f.map(v=>(l.raw.ssl_communityid===v.raw.ssl_communityid&&(v.icon=x),v)))},onMouseOut:()=>{F||i(f.map(v=>(l.raw.ssl_communityid===v.raw.ssl_communityid&&(v.icon=L),v)))}})))):e.createElement("div",{className:"headless-loader"},e.createElement("div",{className:"headless-loader__inner"}))};E.Z=e.memo(c)},24702:function(te,E,s){"use strict";s.d(E,{Z:function(){return Q}});var e=s(67294),N=s(63345),_=s(87491),$=s(17946),W=s(55877),c=({label:J,placeholder:Y="Dropdown",selectedOption:O=null,options:R=[{value:"us",label:"US",placeholder:"Enter City, State or Zip",source:"Production US - English"},{value:"ca",label:"CA",default:"true",placeholder:"Enter City, Province or Postal Code",source:"Production CA"}],onChange:j=()=>{},disabled:ne=!1,compareAttr:G="value",innerLabel:H,addPlaceholderOption:z=!1,style:Z})=>{const[T,t]=(0,e.useState)(!1),[n,a]=(0,e.useState)(null),r=(0,e.useRef)((0,W.v4)()),h=(0,e.useRef)((0,W.v4)()),p=(0,e.useRef)(null),A=(0,e.useRef)(null),I=(0,e.useRef)(null),k=(0,e.useRef)(null);(0,e.useEffect)(()=>{const i=g=>{const P=A.current;P&&P!==g.target&&!P.contains(g.target)&&t(!1)};return document.addEventListener("click",i),()=>{document.removeEventListener("click",i)}},[]),(0,e.useEffect)(()=>{T&&k.current.focus()},[T]),(0,e.useEffect)(()=>
8{if(O){const i=R.findIndex(g=>g[G]===O[G]);a(i)}else a(null)},[G,R,O]);const L=i=>{(0,$.h4)()||t(!T)},B=i=>{if(i===null){a(null),j(null),t(!1);return}j(i),t(!1)},x=i=>{const g=R.find(P=>P.value===i.target.value);j(g),t(!1)},D=i=>{switch(i.keyCode){case 38:i.preventDefault(),a(n?n-1:R.length-1);break;case 40:i.preventDefault(),n!==null&&n<R.length-1?a(n+1):a(0);break;case 27:i.preventDefault(),t(!1),I.current.focus();break;case 13:i.preventDefault(),n!==null&&j(R[n]),t(!1),I.current.focus();break;case 9:t(!1);break}},f=()=>O?H?`${O.image?`<img class="dropdown-image" src='${O.image}'>`:""}${H} ${O.label}`:`${O.image?`<img class="dropdown-image" src='${O.image}'>`:""}${O.label}`:Y||null;return e.createElement("div",{className:"form-group form-group--dropdown form-group--dropdown-outlined"},e.createElement("label",{htmlFor:r.current,className:"form-label"},J),e.createElement("div",{className:`dropdown${(0,$.h4)()?" dropdown--native":""}${Z?` dropdown--${Z}`:""}`,ref:A},e.createElement("select",{id:r.current,onChange:x,value:O?O.Value:"",tabIndex:"-1","aria-label":`${J||""} ${f()}`,ref:p},n!==null&&z&&e.createElement("option",{value:"",disabled:!0},Y),R.map((i,g)=>e.createElement("option",{key:g,value:i.value},typeof i=="object"?i.label:i))),e.createElement("button",{className:"dropdown__trigger field__select",role:"combobox","aria-label":`${J||""} ${f()}`,"aria-haspopup":"listbox","aria-expanded":T,"aria-controls":h.current,onClick:L,disabled:ne,ref:I},e.createElement("div",{style:{display:"flex",alignItems:"center"},dangerouslySetInnerHTML:{__html:f()}})),e.createElement("ul",{role:"listbox",id:h.current,"aria-activedescendant":n!==null?`${r.current}-${n}`:null,tabIndex:"-1",className:"dropdown__list",ref:k,onKeyDown:D},n!==null&&z&&e.createElement("button",{className:"dropdown__item field__select",role:"option","aria-selected":n===-1,onClick:()=>B(null)},Y),R.map((i,g)=>e.createElement("button",{role:"option",key:g,id:`${r.current}-${g}`,onClick:()=>B(i),className:"dropdown__item field__select","aria-selected":n===g},i.image&&e.createElement("img",{className:"dropdown-image",src:i.image}),typeof i=="object"?i.label:i)))))},u=s(58234),S=s(36453),U=s(81323);const b="AIzaSyBSYmfUjKpOk-N4c6V__k0tEs5yq5F42BU";var Q=J=>{const{locationCookieName:Y,coveoOrganizationId:O,coveoAccessToken:R,coveoSearchHub:j,coveoPipeline:ne,coveoAutocompleteFields:G,coveoEngine:H=null,countryOptions:z=[],careTypeOptions:Z=[],distanceOptions:T=[],searchWithInfoRedirect:t,searchNoInfoRedirect:n,urlUsa:a="https://www.sunriseseniorliving.com",urlCanada:r="https://www.sunriseseniorliving.ca",careTypePlaceholder:h,distancePlaceholder:p,searchButtonLabel:A,searchBoxPlaceholder:I="Enter a zip code",externalSubmitHandler:k=null,onCountryChange:L=null,onCareTypeChange:B=null,onDistanceChange:x=null,allowEmptySearch:D=!1,module:f}=J,[,i]=(0,e.useState)(null),[g,P]=(0,e.useState)(""),[,C]=(0,e.useState)(null),[X,oe]=(0,e.useState)(z.length>0?JSON.parse(z).find(m=>m.defaultValue==="true"):null),[F,se]=(0,e.useState)(Z.length>0?JSON.parse(Z).find(m=>m.defaultValue==="true"):null),[ie,ue]=(0,e.useState)(T.length>0?JSON.parse(T).find(m=>m.defaultValue==="true"):null);let ae=document.querySelector(".share-communities-headless-results")?.getAttribute("data-country-label");ae||(ae=document.querySelector(".nearby-communities-row-headless")?.getAttribute("data-country-label"));let re;H===null&&O&&R?re=(0,e.useMemo)(()=>(0,N.of)({organizationId:O,accessToken:R,searchHub:j,pipeline:ne}),[]):H!==null&&(re=(0,e.useMemo)(()=>H,[H]));const ce=({onPlaceSelect:m})=>{const[o,K]=(0,e.useState)(null),q=(0,e.useRef)(null),ee=(0,U.kY)("places");(0,e.useEffect)(()=>{if(!ee||!q.current)return;const le={fields:["geometry","name","formatted_address"],types:["(regions)"],componentRestrictions:{country:[X.value]}};K(new ee.Autocomplete(q.current,le))},[ee]),(0,e.useEffect)(()=>{!o||o.addListener("place_changed",()=>{m(o.getPlace()),P(o.getPlace().formatted_address)})},[m,o]);const ge=le=>{le&&P("")},he=()=>{q.current.value="",P("")};return e.createElement("div",{className:"autocomplete-container"},e.createElement("input",{defaultValue:g,onChange:le=>ge(le),onBlur:le=>he(),ref:q,placeholder:X?.placeholder||I}))};let de=[];G&&G.split("|").forEach(m=>{const o=(0,_.tL)(re,{options:{facet:{field:m,facetId:`${m}-facet`,facetSearch:{numberOfValues:1}}}});de.push(o)}),(0,u.Z)("geolocation-received",({payload:m})=>
8{if(m.Module!=f||k!==null&&t===null&&n===null)return;let o=(0,S.Jz)(Y);o&&i(o);const K=o.Country==="USA"?a:r,q=`?value=${o.value}&country=${o.country}&State=${o.State}&LastSearchValue=${o.LastSearchValue}&ssl_levelsofcare_01=${o.ssl_levelsofcare_01}&Longitude=${o.Longitude}&Latitude=${o.Latitude}#f-ssl_levelsofcare_01=${o.ssl_levelsofcare_01}`;let ee="";o.State?ee=`${K}${t}/${o.State.toLowerCase()}${q}`:o.Latitude&&o.Longitude&&o.LastSearchValue.length>0?ee=`${K}${t}${q}`:ee=`${K}${n}`,window.location.href=ee},[]);const me=(m,o,K,q)=>{(0,u.W)({type:"get-zip-geolocation",payload:{value:m,country:`${o.value==="us"?"USA":"CANADA"}`,moduleName:f}});const ee={value:m,country:o?o.value:null,ssl_levelsofcare_01:K?K.value:null,distance:q?q.value:null};return(0,S.Hl)(ee),null},pe=()=>{if(g){const m=F?F.label:"";_e(g,m),k!==null?k(g,X,F,ie):me(g,X,F,ie)}},l=m=>{let o;m!==null&&(o=JSON.parse(z).find(K=>K.label==m.target.value)),L&&L(o),oe(o),P("")},d=m=>{let o=null;m!==null&&(o=JSON.parse(Z).find(K=>K.value===m.value)),se(o),(0,S.Hl)(JSON.parse('{"ssl_levelsofcare_01": "'+o.value+'"}')),B&&B(o)},v=m=>{let o=null;m!==null&&(o=JSON.parse(T).find(K=>K.value===m.value)),ue(o),x&&x(o)},_e=(m,o)=>{const K={event:"search",detailed_event:"Search",event_data:{identifier:"community_search",name:"community_search",corrected_term:m,search_term:m,search_type:o}};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event_data:null}),window.dataLayer.push(K)};return e.createElement(e.Fragment,null,z&&z.length>0&&e.createElement("div",{className:"location-selector-headless__countries"},ae&&e.createElement("p",{className:"location-selector-headless__countries-label"},ae),JSON.parse(z).map((m,o)=>e.createElement("label",{className:"location-selector-headless__checkbox",key:o},e.createElement("input",{type:"radio",className:"location-selector-headless__country",name:"location-selector-headless__country",value:m.label,checked:m.label==X.label,onChange:l}),m.title))),e.createElement("div",{className:`location-selector-headless__container ${Z.length>0&&T.length>0?"location-selector-headless__container--three-dropdowns":"location-selector-headless__container--two-dropdowns"}`},e.createElement("div",{className:"location-selector-headless__location-container"},e.createElement("div",{className:"location-selector-headless__input"},e.createElement(U.un,{apiKey:b},e.createElement(U.D5,{style:{width:"100%",visibility:"hidden"},defaultCenter:{lat:22.54992,lng:0},defaultZoom:3,disableDefaultUI:!0}),e.createElement(U.ZM,{position:U._D.TOP_LEFT},e.createElement("div",{className:"autocomplete-control"},e.createElement(ce,{onPlaceSelect:C})))))),Z.length>0&&e.createElement("div",{className:"location-selector-headless__dropdown location-selector-headless__care-type"},e.createElement("div",{className:"field dropdown-module"},e.createElement("div",{className:"field__input-label-wrapper"},e.createElement("div",{className:"field__select-arrow-wrapper"},e.createElement(c,{addPlaceholderOption:!0,selectedOption:F,placeholder:h,options:JSON.parse(Z),onChange:d}),e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 15 15",width:"10",height:"10"},e.createElement("path",{d:"M8.306 10.992l6.675-5.747L13.332 3.3 7.481 8.338 1.63 3.3-.019 5.245l6.675 5.747.825.708z",fill:"currentcolor",fillRule:"nonzero"})))))),T.length>0&&e.createElement("div",{className:"location-selector-headless__dropdown location-selector-headless__distance"},e.createElement("div",{className:"field dropdown-module"},e.createElement("div",{className:"field__input-label-wrapper"},e.createElement("div",{className:"field__select-arrow-wrapper"},e.createElement(c,{addPlaceholderOption:!0,selectedOption:ie,placeholder:p,options:JSON.parse(T),onChange:v}),e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 15 15",width:"10",height:"10"},e.createElement("path",{d:"M8.306 10.992l6.675-5.747L13.332 3.3 7.481 8.338 1.63 3.3-.019 5.245l6.675 5.747.825.708z",fill:"currentcolor",fillRule:"nonzero"})))))),e.createElement("button",{className:"btn btn--submit location-selector-headless__search-button",onClick:pe,disabled:!g&&(!D||D&&D==="false")},e.createElement("span",{className:"btn__label"},A),e.createElement("svg",{width:"11",height:"18",role:"presentation"},e.createElement("use",{xlinkHref:"#arrow-right"})))))}},30894:function(te,E,s){"use strict";var e=s(67294);const N=(0,e.createContext)();E.Z=N},17946:function(te,E,s){"use strict";s.d(E,{h4:function(){return e},qs:function(){return $}});const e=()=>{const c=navigator.userAgent||navigator.vendor||window.opera;return!!(/windows phone/i.test(c)||/android/i.test(c)||/iPad|iPhone|iPod/.test(c)&&!window.MSStream)},N=c=>{if(c.textContent.trim()==="")return!0},_=c=>{const u=c.getBoundingClientRect();return u.top>=0&&u.left>=0&&u.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&u.right<=(window.innerWidth||document.documentElement.clientWidth)},$=(c,u)=>{if(c)return!String(c).includes(u)},W=()=>window.location.hostname==="localhost"?{lat:42.3612,lng:-71.0519,countryState:"MA",zipCode:"02108"}:{},M=()=>{const c=window.location.pathname,u=c.split("/")[1];return u==="en"||u==="fr"?c.replace(`/${u}`,""):c}},58234:function(te,E,s){"use strict";s.d(E,{W:function(){return $}});var e=s(67294);let N=[];const _=(M,c)=>{if(M!=null&&c!=null)return N=[...N,[M,c]],()=>{N=N.filter(u=>u[1]!==c)}},$=M=>{let{type:c}=M;
8typeof M=="string"&&(c=M);const u=[];typeof M=="string"?u.push({type:c}):u.push(M),N.forEach(([S,U])=>{typeof S=="string"&&S!==c||Array.isArray(S)&&!S.includes(c)||S instanceof RegExp&&!S.test(c)||typeof S=="function"&&!S(...u)||U(...u)})},W=(M,c,u=[])=>((0,e.useEffect)(()=>_(M,c),u),$);E.Z=W}}]); 9 10//# sourceMappingURL=2674.e9f76cb2b81c07429714.bundle.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.