window.post_hog_initialize_once = window.post_hog_initialize_once || (function() { console.log("PostHog script is running"); const TOKEN = 'phc_wFtCihhsuSYb9seDWlaSZzN5e6rSR3wPPZF2gU5c0qb'; const DISABLE_ALL_ANALYTICS = false; const ENDPOINT_MAP = {"honeycolony.com": "https://panopticon-qq5x.onrender.com/1syADT6BPFMEWLpT", "www.honeycolony.com": "https://panopticon-qq5x.onrender.com/1syADT6BPFMEWLpT_www", "dev.honeycolony.com": "https://panopticon-qq5x.onrender.com/1syADT6BPFMEWLpT_dev"}; function is_debug_in_url_param() { const queryParams = new URLSearchParams(window.location.search); return queryParams.get('debug') === 'true'; } function disabled_by_url_param() { const queryParams = new URLSearchParams(window.location.search); const isDisabled = queryParams.get('opt_out_capturing_by_posthog') === 'true'; if (isDisabled) { localStorage.setItem('disableAnalytics', 'true'); console.log('opt_out_capturing_by_posthog:', isDisabled); } // Check in localStorage as well return isDisabled || localStorage.getItem('disableAnalytics') === 'true'; } function get_api_host() { let api_host = null; // length of endpoint endpoint_map, which is a dictionary. if (Object.keys(ENDPOINT_MAP).length === 1) { api_host = ENDPOINT_MAP[Object.keys(ENDPOINT_MAP)[0]]; } else if (window.location.hostname.includes('localhost') || window.location.hostname.includes('127.0.0.1')) { for (let key in ENDPOINT_MAP) { if (key.startsWith('www')) { api_host = ENDPOINT_MAP[key]; break; } } } else { api_host = ENDPOINT_MAP.hasOwnProperty(window.location.hostname) ? ENDPOINT_MAP[window.location.hostname] : null; } if (api_host === null) { console.error("API host not found for domain: " + window.location.hostname); return null; } return api_host; } function getConfig() { // Check for URL parameter and adjust API_HOST accordingly let api_host = get_api_host(); if (api_host === null) { console.error("API host not found for domain: " + window.location.hostname); return null; } if (DISABLE_ALL_ANALYTICS || disabled_by_url_param()) { return { disable_session_recording: true, disable_cookie: true, api_host: api_host, autocapture: false, } } const config = { api_host: api_host, ui_host: 'app.posthog.com', featureFlags: { "request-test": true }, }; return config; } if (is_debug_in_url_param()) { console.log("Debug mode is enabled"); debugger; } const config = getConfig(); if (config === null) { return; } !function (t, e) { var o, n, p, r; e.__SV || (window.posthog = e, e._i = [], e.init = function (i, s, a) { function g(t, e) { var o = e.split("."); 2 == o.length && (t = t[o[0]], e = o[1]), t[e] = function () { t.push([e].concat(Array.prototype.slice.call(arguments, 0))) } } (p = t.createElement("script")).type = "text/javascript", p.async = !0, p.src = s.api_host + "/static/array.js", (r = t.getElementsByTagName("script")[0]).parentNode.insertBefore(p, r); var u = e; for (void 0 !== a ? u = e[a] = [] : a = "posthog", u.people = u.people || [], u.toString = function (t) { var e = "posthog"; return "posthog" !== a && (e += "." + a), t || (e += " (stub)"), e }, u.people.toString = function () { return u.toString(1) + ".people (stub)" }, o = "capture identify alias people.set people.set_once set_config register register_once unregister opt_out_capturing has_opted_out_capturing opt_in_capturing reset isFeatureEnabled onFeatureFlags getFeatureFlag getFeatureFlagPayload reloadFeatureFlags group updateEarlyAccessFeatureEnrollment getEarlyAccessFeatures getActiveMatchingSurveys getSurveys onSessionId".split(" "), n = 0; n < o.length; n++)g(u, o[n]); e._i.push([i, s, a]) }, e.__SV = 1) }(document, window.posthog || []); posthog.init(TOKEN, config); console.log("PostHog script has been initialized"); })();