1import{c as f}from"./LoggerFactory.client-D_LxOIC-.js";import{u as g}from"./use-effect-once-CMJ_AoXr.js";import{a as l}from"./CwpUserAttributesCookie-B_EtGqYd.js";import{f as d}from"./on-server-first-CfZ8Sm3g.js";import"./index-BqkNX_XC.js";import"./jsx-runtime-BgjmLhhW.js";import"./preload-helper-ByLHwKVr.js";import"./load-as-async-chunk-C14ZsfZh.js";import"./index-xEZyAjtC.js";import"./context-biATSuT9.js";import"./is-url-in-draft-mode-C0UvV7cD.js";const i=f("GeoLocationLoader"),p="CwpGeoLocation";function L({setGeoLocationSettings:t,setIsMarketingCookiesAccepted:r}){return g(()=>{const o=l(p);if(o)try{const e=JSON.parse(decodeURIComponent(o));t(e),m(e,r)}catch(e){i.error({error:e},"There was an error with the geo location cookie parsing, retrieving the data from API endpoint"),s(t,r)}else s(t,r)}),null}function m(t,r){t.analyticsRegime==="US"&&t.usState!=="CA"&&!l("OptanonAlertBoxClosed")&&r({allowAnalytics:!0,loadTealium:!0})}function s(t,r){const o={analyticsRegime:"NON_US"};d().then(e=>{if(e)try{const a=e.geoLocation.akamaiEdgeScape.split(","),c=a.find(n=>n.startsWith("country_code="))?.split("=")[1];if(o.possibleBot=e.possibleBot,c){if(c==="US"){const n=a.find(u=>u.startsWith("region_code="))?.split("=")[1];o.analyticsRegime="US",o.usState=n}document.cookie=`${p}=${encodeURIComponent(JSON.stringify(o))}; Secure; SameSite=Strict; Path=/`}else i.error({akamaiEdgeScapeProperties:a},"No country found in the geo location API response, setting default geo location value")}catch(a){i.error({error:a},"There was an error parsing the geo location API response, setting default value")}t(o),m(o,r)}).catch(e=>{i.error({error:e},"There was an error retrieving the data from geo location API endpoint, setting default value"),t(o)})}export{L as default};
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.