PageSourceSearch

https://flourish.studio/js/analytics-fullstory.js?d07185febd95098d325e9271e5c17098

js flourish.studio collected 2026-09-24 06:03:23 UTC 5,735 bytes, 156 lines download raw bytes

1(function () {
2	'use strict';
3
4	const flourishConfig = JSON.parse(document.getElementById('flourish-config').textContent);
5	const FULLSTORY_CONFIG = flourishConfig.fullstory;
6
7	const BLOCKED_PATHS = FULLSTORY_CONFIG.blockedPaths || [];
8	const ALLOWED_PATHS = FULLSTORY_CONFIG.allowedPaths || [];
9
10	function isDomainAllowed() {
11		return window.location.hostname === FULLSTORY_CONFIG.allowedDomain;
12	}
13
14	function isPageBlocked() {
15		const currentPath = window.location.pathname.toLowerCase();
16		return BLOCKED_PATHS.some(blockedPath =>
17			currentPath.includes(blockedPath)
18		);
19	}
20
21	function isPageAllowed() {
22		if (!ALLOWED_PATHS || ALLOWED_PATHS.length === 0) return true;
23
24		const currentPath = window.location.pathname.toLowerCase();
25		return ALLOWED_PATHS.some(allowedPath =>
26			currentPath.includes(allowedPath.toLowerCase())
27		);
28	}
29
30	function getCohort(identifier, maxRange) {
31		let hash = 0;
32		for (let i = 0; i < identifier.length; i++) {
33			const char = identifier.charCodeAt(i);
34			hash = ((hash << 5) - hash) + char;
35			hash = hash & hash;
36		}
37		return Math.abs(hash) % maxRange;
38	}
39
40	function getDeviceIdentifier() {
41		let deviceId = localStorage.getItem('device_id');
42
43		if (!deviceId) {
44			deviceId = [
45				navigator.userAgent,
46				navigator.language,
47				screen.width + 'x' + screen.height,
48				new Date().getTimezoneOffset()
49			].join('|');
50
51			localStorage.setItem('device_id', deviceId);
52		}
53
54		return deviceId;
55	}
56
57	function shouldSampleSession() {
58		const sessionDecision = sessionStorage.getItem('fs_sample_decision');
59		if (sessionDecision !== null) {
60			return sessionDecision === 'true';
61		}
62
63		const deviceId = getDeviceIdentifier();
64		if (!deviceId) {
65			return false;
66		}
67
68		const samplesPerMillion = FULLSTORY_CONFIG.samplingRate * 1_000_000;
69		const cohortValue = getCohort(`interaction-recorder-${deviceId}`, 1_000_000);
70		const shouldSample = cohortValue < samplesPerMillion;
71
72		sessionStorage.setItem('fs_sample_decision', shouldSample.toString());
73
74		return shouldSample;
75	}
76
77	function checkOneTrustConsent() {
78		if (flourishConfig.disableCookieConsent) {
79			return true;
80		}
81		if (window.OnetrustActiveGroups && typeof window.OnetrustActiveGroups === 'string') {
82			return window.OnetrustActiveGroups.includes('C0002');
83		}
84		return false;
85	}
86
87	function initializeFullstory() {
88		window['_fs_host'] = 'fullstory.com';
89		window['_fs_script'] = 'edge.fullstory.com/s/fs.js';
90		window['_fs_org'] = FULLSTORY_CONFIG.orgId;
91		window['_fs_namespace'] = 'FS';
92
93		!function(m,n,e,t,l,o,g,y){var s,f,a=function(h){
94		return!(h in m)||(m.console&&m.console.log&&m.console.log('FullStory namespace conflict. Please set window["_fs_namespace"].'),!1)}(e)
95		;function p(b){var h,d=[];function j(){h&&(d.forEach((function(b){var d;try{d=b[h[0]]&&b[h[0]](h[1])}catch(h){return void(b[3]&&b[3](h))}
96		d&&d.then?d.then(b[2],b[3]):b[2]&&b[2](d)})),d.length=0)}function r(b){return function(d){h||(h=[b,d],j())}}return b(r(0),r(1)),{
97		then:function(b,h){return p((function(r,i){d.push([b,h,r,i]),j()}))}}}a&&(g=m[e]=function(){var b=function(b,d,j,r){function i(i,c){
98		h(b,d,j,i,c,r)}r=r||2;var c,u=/Async$/;return u.test(b)?(b=b.replace(u,""),"function"==typeof Promise?new Promise(i):p(i)):h(b,d,j,c,c,r)}
99		;function h(h,d,j,r,i,c){return b._api?b._api(h,d,j,r,i,c):(b.q&&b.q.push([h,d,j,r,i,c]),null)}return b.q=[],b}(),y=function(b){function h(h){
100		"function"==typeof h[4]&&h[4](new Error(b))}var d=g.q;if(d){for(var j=0;j<d.length;j++)h(d[j]);d.length=0,d.push=h}},function(){
101		(o=n.createElement(t)).async=!0,o.crossOrigin="anonymous",o.src="https://"+l,o.onerror=function(){y("Error loading "+l)}
102		;var b=n.getElementsByTagName(t)[0];b&&b.parentNode?b.parentNode.insertBefore(o,b):n.head.appendChild(o)}(),function(){function b(){}
103		function h(b,h,d){g(b,h,d,1)}function d(b,d,j){h("setProperties",{type:b,properties:d},j)}function j(b,h){d("user",b,h)}function r(b,h,d){j({
104		uid:b},d),h&&j(h,d)}g.identify=r,g.setUserVars=j,g.identifyAccount=b,g.clearUserCookie=b,g.setVars=d,g.event=function(b,d,j){h("trackEvent",{
105		name:b,properties:d},j)},g.anonymize=function(){r(!1)},g.shutdown=function(){h("shutdown")},g.restart=function(){h("restart")},
106		g.log=function(b,d){h("log",{level:b,msg:d})},g.consent=function(b){h("setIdentity",{consent:!arguments.length||b})}}(),s="fetch",
107		f="XMLHttpRequest",g._w={},g._w[f]=m[f],g._w[s]=m[s],m[s]&&(m[s]=function(){return g._w[s].apply(this,arguments)}),g._v="2.0.0")
108		}(window,document,window._fs_namespace,"script",window._fs_script);
109
110		setTimeout(function () {
111			if (window.FS) {
112				window.FS.setVars('page', {
113					team: FULLSTORY_CONFIG.teamSpace,
114					domain: window.location.hostname,
115					source: 'flourish-website'
116				});
117
118				window.FS.setUserVars({
119					team_space: FULLSTORY_CONFIG.teamSpace,
120					product: 'flourish',
121					domain: window.location.hostname
122				});
123			}
124		}, 500);
125	}
126
127	function attemptFullstoryLoad() {
128		if (!isDomainAllowed()) return;
129		if (isPageBlocked()) return;
130		if (!isPageAllowed()) return;
131		if (!checkOneTrustConsent()) return;
132		if (!shouldSampleSession()) return;
133
134		initializeFullstory();
135	}
136
137	function handleConsentChange() {
138		if (checkOneTrustConsent() && !window.FS) {
139			attemptFullstoryLoad();
140		} else if (!checkOneTrustConsent() && window.FS) {
141			window.FS.shutdown();
142		}
143	}
144
145	window.addEventListener('onetrustloaded', handleConsentChange);
146	window.addEventListener('onetrustconsentchanged', handleConsentChange);
147	document.addEventListener('OneTrustGroupsUpdated', handleConsentChange);
148
149	if (document.readyState === 'loading') {
150		document.addEventListener('DOMContentLoaded', function () {
151			setTimeout(attemptFullstoryLoad, 1000);
152		});
153	} else {
154		setTimeout(attemptFullstoryLoad, 1000);
155	}
156})();

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.