@v-tilt/browser 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all-external-dependencies.js +2 -0
- package/dist/all-external-dependencies.js.map +1 -0
- package/dist/array.full.js +2 -0
- package/dist/array.full.js.map +1 -0
- package/dist/array.js +1 -1
- package/dist/array.js.map +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/array.no-external.js.map +1 -1
- package/dist/entrypoints/all-external-dependencies.d.ts +8 -0
- package/dist/entrypoints/array.full.d.ts +17 -0
- package/dist/entrypoints/web-vitals.d.ts +14 -0
- package/dist/external-scripts-loader.js +1 -1
- package/dist/external-scripts-loader.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/module.d.ts +34 -4
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/module.no-external.d.ts +34 -4
- package/dist/module.no-external.js +1 -1
- package/dist/module.no-external.js.map +1 -1
- package/dist/recorder.js.map +1 -1
- package/dist/types.d.ts +32 -2
- package/dist/utils/globals.d.ts +27 -0
- package/dist/web-vitals.d.ts +89 -5
- package/dist/web-vitals.js +2 -0
- package/dist/web-vitals.js.map +1 -0
- package/lib/config.js +5 -3
- package/lib/entrypoints/all-external-dependencies.d.ts +8 -0
- package/lib/entrypoints/all-external-dependencies.js +10 -0
- package/lib/entrypoints/array.full.d.ts +17 -0
- package/lib/entrypoints/array.full.js +19 -0
- package/lib/entrypoints/external-scripts-loader.js +1 -1
- package/lib/entrypoints/web-vitals.d.ts +14 -0
- package/lib/entrypoints/web-vitals.js +29 -0
- package/lib/types.d.ts +32 -2
- package/lib/types.js +16 -0
- package/lib/utils/globals.d.ts +27 -0
- package/lib/web-vitals.d.ts +89 -5
- package/lib/web-vitals.js +354 -46
- package/package.json +1 -1
|
@@ -59,8 +59,11 @@ interface VTiltConfig {
|
|
|
59
59
|
person_profiles?: PersonProfilesMode;
|
|
60
60
|
/** Enable autocapture */
|
|
61
61
|
autocapture?: boolean;
|
|
62
|
-
/**
|
|
63
|
-
|
|
62
|
+
/**
|
|
63
|
+
* Enable web vitals tracking.
|
|
64
|
+
* Can be a boolean or an object with detailed configuration.
|
|
65
|
+
*/
|
|
66
|
+
capture_performance?: boolean | CapturePerformanceConfig;
|
|
64
67
|
/** Enable page view tracking */
|
|
65
68
|
capture_pageview?: boolean | "auto";
|
|
66
69
|
/** Enable page leave tracking */
|
|
@@ -168,6 +171,29 @@ interface AliasEvent {
|
|
|
168
171
|
distinct_id: string;
|
|
169
172
|
original: string;
|
|
170
173
|
}
|
|
174
|
+
/** Supported Web Vitals metrics */
|
|
175
|
+
type SupportedWebVitalsMetric = "LCP" | "CLS" | "FCP" | "INP" | "TTFB";
|
|
176
|
+
/** All supported Web Vitals metrics */
|
|
177
|
+
declare const ALL_WEB_VITALS_METRICS: SupportedWebVitalsMetric[];
|
|
178
|
+
/** Default Web Vitals metrics (matches PostHog defaults) */
|
|
179
|
+
declare const DEFAULT_WEB_VITALS_METRICS: SupportedWebVitalsMetric[];
|
|
180
|
+
/**
|
|
181
|
+
* Web Vitals capture configuration
|
|
182
|
+
*/
|
|
183
|
+
interface CapturePerformanceConfig {
|
|
184
|
+
/** Enable or disable web vitals capture */
|
|
185
|
+
web_vitals?: boolean;
|
|
186
|
+
/** Which metrics to capture (default: LCP, CLS, FCP, INP) */
|
|
187
|
+
web_vitals_allowed_metrics?: SupportedWebVitalsMetric[];
|
|
188
|
+
/** Delay before flushing metrics in ms (default: 5000) */
|
|
189
|
+
web_vitals_delayed_flush_ms?: number;
|
|
190
|
+
/**
|
|
191
|
+
* Maximum allowed metric value in ms (default: 900000 = 15 minutes)
|
|
192
|
+
* Values above this are considered anomalies and ignored.
|
|
193
|
+
* Set to 0 to disable this check.
|
|
194
|
+
*/
|
|
195
|
+
__web_vitals_max_value?: number;
|
|
196
|
+
}
|
|
171
197
|
interface WebVitalMetric {
|
|
172
198
|
name: string;
|
|
173
199
|
value: number;
|
|
@@ -175,6 +201,10 @@ interface WebVitalMetric {
|
|
|
175
201
|
rating: "good" | "needs-improvement" | "poor";
|
|
176
202
|
id: string;
|
|
177
203
|
navigationType: string;
|
|
204
|
+
/** Timestamp when the metric was captured (added internally) */
|
|
205
|
+
timestamp?: number;
|
|
206
|
+
/** Attribution data from web-vitals library */
|
|
207
|
+
attribution?: Record<string, unknown>;
|
|
178
208
|
}
|
|
179
209
|
interface GeolocationData {
|
|
180
210
|
country?: string;
|
|
@@ -752,5 +782,5 @@ declare class VTilt {
|
|
|
752
782
|
|
|
753
783
|
declare const vt: VTilt;
|
|
754
784
|
|
|
755
|
-
export { VTilt, vt as default, vt };
|
|
756
|
-
export type { AliasEvent, CaptureOptions, CaptureResult, EventPayload, FeatureFlagsConfig, GeolocationData, GroupsConfig, PersistenceMethod, Properties, Property, PropertyOperations, RemoteConfig, RequestOptions, SessionData, SessionIdChangedCallback, SessionRecordingMaskInputOptions, SessionRecordingOptions, TrackingEvent, UserIdentity, UserProperties, VTiltConfig, WebVitalMetric };
|
|
785
|
+
export { ALL_WEB_VITALS_METRICS, DEFAULT_WEB_VITALS_METRICS, VTilt, vt as default, vt };
|
|
786
|
+
export type { AliasEvent, CaptureOptions, CapturePerformanceConfig, CaptureResult, EventPayload, FeatureFlagsConfig, GeolocationData, GroupsConfig, PersistenceMethod, Properties, Property, PropertyOperations, RemoteConfig, RequestOptions, SessionData, SessionIdChangedCallback, SessionRecordingMaskInputOptions, SessionRecordingOptions, SupportedWebVitalsMetric, TrackingEvent, UserIdentity, UserProperties, VTiltConfig, WebVitalMetric };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function e(e,t,i,r,a,n,s){try{var o=e[n](s),u=o.value}catch(e){return void i(e)}o.done?t(u):Promise.resolve(u).then(r,a)}function t(t){return function(){var i=this,r=arguments;return new Promise(function(a,n){var s=t.apply(i,r);function o(t){e(s,a,n,o,u,"next",t)}function u(t){e(s,a,n,o,u,"throw",t)}o(void 0)})}}function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)({}).hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},i.apply(null,arguments)}class r{constructor(e){void 0===e&&(e={}),this.config=this.parseConfigFromScript(e)}parseConfigFromScript(e){if(!document.currentScript)return i({token:e.token||""},e);var t=document.currentScript,r=i({token:""},e);if(r.api_host=t.getAttribute("data-api-host")||t.getAttribute("data-host")||e.api_host,r.script_host=t.getAttribute("data-script-host")||e.script_host,r.proxy=t.getAttribute("data-proxy")||e.proxy,r.proxyUrl=t.getAttribute("data-proxy-url")||e.proxyUrl,r.token=t.getAttribute("data-token")||e.token||"",r.projectId=t.getAttribute("data-project-id")||e.projectId||"",r.domain=t.getAttribute("data-domain")||e.domain,r.storage=t.getAttribute("data-storage")||e.storage,r.stringifyPayload="false"!==t.getAttribute("data-stringify-payload"),r.capture_performance="true"===t.getAttribute("data-capture-performance")||e.capture_performance,r.proxy&&r.proxyUrl)throw console.error("Error: Both data-proxy and data-proxy-url are specified. Please use only one of them."),new Error("Both data-proxy and data-proxy-url are specified. Please use only one of them.");for(var a of(r.globalAttributes=i({},e.globalAttributes),Array.from(t.attributes)))a.name.startsWith("data-vt-")&&(r.globalAttributes[a.name.slice(8).replace(/-/g,"_")]=a.value);return r}getConfig(){return i({},this.config)}updateConfig(e){this.config=i({},this.config,e)}}var a="__vt_session",n="__vt_window_id",s="__vt_primary_window",o="__vt_user_state",u="__vt_device_id",c="__vt_anonymous_id",l="__vt_distinct_id",d="__vt_user_properties",h="localStorage",g="localStorage+cookie",f="sessionStorage",v="memory",p="$initial_person_info",_={"Europe/Andorra":"AD","Asia/Dubai":"AE","Asia/Kabul":"AF","America/Antigua":"AG","America/Anguilla":"AI","Europe/Tirane":"AL","Asia/Yerevan":"AM","Africa/Luanda":"AO","Antarctica/Casey":"AQ","Antarctica/Davis":"AQ","Antarctica/DumontDUrville":"AQ","Antarctica/Mawson":"AQ","Antarctica/McMurdo":"AQ","Antarctica/Palmer":"AQ","Antarctica/Rothera":"AQ","Antarctica/Syowa":"AQ","Antarctica/Troll":"AQ","Antarctica/Vostok":"AQ","America/Argentina/Buenos_Aires":"AR","America/Argentina/Catamarca":"AR","America/Argentina/Cordoba":"AR","America/Argentina/Jujuy":"AR","America/Argentina/La_Rioja":"AR","America/Argentina/Mendoza":"AR","America/Argentina/Rio_Gallegos":"AR","America/Argentina/Salta":"AR","America/Argentina/San_Juan":"AR","America/Argentina/San_Luis":"AR","America/Argentina/Tucuman":"AR","America/Argentina/Ushuaia":"AR","Pacific/Pago_Pago":"AS","Europe/Vienna":"AT","Australia/Adelaide":"AU","Australia/Brisbane":"AU","Australia/Broken_Hill":"AU","Australia/Darwin":"AU","Australia/Eucla":"AU","Australia/Hobart":"AU","Australia/Lindeman":"AU","Australia/Lord_Howe":"AU","Australia/Melbourne":"AU","Australia/Perth":"AU","Australia/Sydney":"AU","America/Aruba":"AW","Europe/Mariehamn":"AX","Asia/Baku":"AZ","Europe/Sarajevo":"BA","America/Barbados":"BB","Asia/Dhaka":"BD","Europe/Brussels":"BE","Africa/Ouagadougou":"BF","Europe/Sofia":"BG","Asia/Bahrain":"BH","Africa/Bujumbura":"BI","Africa/Porto-Novo":"BJ","America/St_Barthelemy":"BL","Atlantic/Bermuda":"BM","Asia/Brunei":"BN","America/La_Paz":"BO","America/Kralendijk":"BQ","America/Araguaina":"BR","America/Bahia":"BR","America/Belem":"BR","America/Boa_Vista":"BR","America/Campo_Grande":"BR","America/Cuiaba":"BR","America/Eirunepe":"BR","America/Fortaleza":"BR","America/Maceio":"BR","America/Manaus":"BR","America/Noronha":"BR","America/Porto_Velho":"BR","America/Recife":"BR","America/Rio_Branco":"BR","America/Santarem":"BR","America/Sao_Paulo":"BR","America/Nassau":"BS","Asia/Thimphu":"BT","Africa/Gaborone":"BW","Europe/Minsk":"BY","America/Belize":"BZ","America/Atikokan":"CA","America/Blanc-Sablon":"CA","America/Cambridge_Bay":"CA","America/Creston":"CA","America/Dawson":"CA","America/Dawson_Creek":"CA","America/Edmonton":"CA","America/Fort_Nelson":"CA","America/Glace_Bay":"CA","America/Goose_Bay":"CA","America/Halifax":"CA","America/Inuvik":"CA","America/Iqaluit":"CA","America/Moncton":"CA","America/Nipigon":"CA","America/Pangnirtung":"CA","America/Rainy_River":"CA","America/Rankin_Inlet":"CA","America/Regina":"CA","America/Resolute":"CA","America/St_Johns":"CA","America/Swift_Current":"CA","America/Thunder_Bay":"CA","America/Toronto":"CA","America/Vancouver":"CA","America/Whitehorse":"CA","America/Winnipeg":"CA","America/Yellowknife":"CA","Indian/Cocos":"CC","Africa/Kinshasa":"CD","Africa/Lubumbashi":"CD","Africa/Bangui":"CF","Africa/Brazzaville":"CG","Europe/Zurich":"CH","Africa/Abidjan":"CI","Pacific/Rarotonga":"CK","America/Punta_Arenas":"CL","America/Santiago":"CL","Pacific/Easter":"CL","Africa/Douala":"CM","Asia/Shanghai":"CN","Asia/Urumqi":"CN","America/Bogota":"CO","America/Costa_Rica":"CR","America/Havana":"CU","Atlantic/Cape_Verde":"CV","America/Curacao":"CW","Indian/Christmas":"CX","Asia/Famagusta":"CY","Asia/Nicosia":"CY","Europe/Prague":"CZ","Europe/Berlin":"DE","Europe/Busingen":"DE","Africa/Djibouti":"DJ","Europe/Copenhagen":"DK","America/Dominica":"DM","America/Santo_Domingo":"DO","Africa/Algiers":"DZ","America/Guayaquil":"EC","Pacific/Galapagos":"EC","Europe/Tallinn":"EE","Africa/Cairo":"EG","Africa/El_Aaiun":"EH","Africa/Asmara":"ER","Africa/Ceuta":"ES","Atlantic/Canary":"ES","Europe/Madrid":"ES","Africa/Addis_Ababa":"ET","Europe/Helsinki":"FI","Pacific/Fiji":"FJ","Atlantic/Stanley":"FK","Pacific/Chuuk":"FM","Pacific/Kosrae":"FM","Pacific/Pohnpei":"FM","Atlantic/Faroe":"FO","Europe/Paris":"FR","Africa/Libreville":"GA","Europe/London":"GB","America/Grenada":"GD","Asia/Tbilisi":"GE","America/Cayenne":"GF","Europe/Guernsey":"GG","Africa/Accra":"GH","Europe/Gibraltar":"GI","America/Danmarkshavn":"GL","America/Nuuk":"GL","America/Scoresbysund":"GL","America/Thule":"GL","Africa/Banjul":"GM","Africa/Conakry":"GN","America/Guadeloupe":"GP","Africa/Malabo":"GQ","Europe/Athens":"GR","Atlantic/South_Georgia":"GS","America/Guatemala":"GT","Pacific/Guam":"GU","Africa/Bissau":"GW","America/Guyana":"GY","Asia/Hong_Kong":"HK","America/Tegucigalpa":"HN","Europe/Zagreb":"HR","America/Port-au-Prince":"HT","Europe/Budapest":"HU","Asia/Jakarta":"ID","Asia/Jayapura":"ID","Asia/Makassar":"ID","Asia/Pontianak":"ID","Europe/Dublin":"IE","Asia/Jerusalem":"IL","Europe/Isle_of_Man":"IM","Asia/Kolkata":"IN","Indian/Chagos":"IO","Asia/Baghdad":"IQ","Asia/Tehran":"IR","Atlantic/Reykjavik":"IS","Europe/Rome":"IT","Europe/Jersey":"JE","America/Jamaica":"JM","Asia/Amman":"JO","Asia/Tokyo":"JP","Africa/Nairobi":"KE","Asia/Bishkek":"KG","Asia/Phnom_Penh":"KH","Pacific/Enderbury":"KI","Pacific/Kiritimati":"KI","Pacific/Tarawa":"KI","Indian/Comoro":"KM","America/St_Kitts":"KN","Asia/Pyongyang":"KP","Asia/Seoul":"KR","Asia/Kuwait":"KW","America/Cayman":"KY","Asia/Almaty":"KZ","Asia/Aqtau":"KZ","Asia/Aqtobe":"KZ","Asia/Atyrau":"KZ","Asia/Oral":"KZ","Asia/Qostanay":"KZ","Asia/Qyzylorda":"KZ","Asia/Vientiane":"LA","Asia/Beirut":"LB","America/St_Lucia":"LC","Europe/Vaduz":"LI","Asia/Colombo":"LK","Africa/Monrovia":"LR","Africa/Maseru":"LS","Europe/Vilnius":"LT","Europe/Luxembourg":"LU","Europe/Riga":"LV","Africa/Tripoli":"LY","Africa/Casablanca":"MA","Europe/Monaco":"MC","Europe/Chisinau":"MD","Europe/Podgorica":"ME","America/Marigot":"MF","Indian/Antananarivo":"MG","Pacific/Kwajalein":"MH","Pacific/Majuro":"MH","Europe/Skopje":"MK","Africa/Bamako":"ML","Asia/Yangon":"MM","Asia/Choibalsan":"MN","Asia/Hovd":"MN","Asia/Ulaanbaatar":"MN","Asia/Macau":"MO","Pacific/Saipan":"MP","America/Martinique":"MQ","Africa/Nouakchott":"MR","America/Montserrat":"MS","Europe/Malta":"MT","Indian/Mauritius":"MU","Indian/Maldives":"MV","Africa/Blantyre":"MW","America/Bahia_Banderas":"MX","America/Cancun":"MX","America/Chihuahua":"MX","America/Hermosillo":"MX","America/Matamoros":"MX","America/Mazatlan":"MX","America/Merida":"MX","America/Mexico_City":"MX","America/Monterrey":"MX","America/Ojinaga":"MX","America/Tijuana":"MX","Asia/Kuala_Lumpur":"MY","Asia/Kuching":"MY","Africa/Maputo":"MZ","Africa/Windhoek":"NA","Pacific/Noumea":"NC","Africa/Niamey":"NE","Pacific/Norfolk":"NF","Africa/Lagos":"NG","America/Managua":"NI","Europe/Amsterdam":"NL","Europe/Oslo":"NO","Asia/Kathmandu":"NP","Pacific/Nauru":"NR","Pacific/Niue":"NU","Pacific/Auckland":"NZ","Pacific/Chatham":"NZ","Asia/Muscat":"OM","America/Panama":"PA","America/Lima":"PE","Pacific/Gambier":"PF","Pacific/Marquesas":"PF","Pacific/Tahiti":"PF","Pacific/Bougainville":"PG","Pacific/Port_Moresby":"PG","Asia/Manila":"PH","Asia/Karachi":"PK","Europe/Warsaw":"PL","America/Miquelon":"PM","Pacific/Pitcairn":"PN","America/Puerto_Rico":"PR","Asia/Gaza":"PS","Asia/Hebron":"PS","Atlantic/Azores":"PT","Atlantic/Madeira":"PT","Europe/Lisbon":"PT","Pacific/Palau":"PW","America/Asuncion":"PY","Asia/Qatar":"QA","Indian/Reunion":"RE","Europe/Bucharest":"RO","Europe/Belgrade":"RS","Asia/Anadyr":"RU","Asia/Barnaul":"RU","Asia/Chita":"RU","Asia/Irkutsk":"RU","Asia/Kamchatka":"RU","Asia/Khandyga":"RU","Asia/Krasnoyarsk":"RU","Asia/Magadan":"RU","Asia/Novokuznetsk":"RU","Asia/Novosibirsk":"RU","Asia/Omsk":"RU","Asia/Sakhalin":"RU","Asia/Srednekolymsk":"RU","Asia/Tomsk":"RU","Asia/Ust-Nera":"RU","Asia/Vladivostok":"RU","Asia/Yakutsk":"RU","Asia/Yekaterinburg":"RU","Europe/Astrakhan":"RU","Europe/Kaliningrad":"RU","Europe/Kirov":"RU","Europe/Moscow":"RU","Europe/Samara":"RU","Europe/Saratov":"RU","Europe/Ulyanovsk":"RU","Europe/Volgograd":"RU","Africa/Kigali":"RW","Asia/Riyadh":"SA","Pacific/Guadalcanal":"SB","Indian/Mahe":"SC","Africa/Khartoum":"SD","Europe/Stockholm":"SE","Asia/Singapore":"SG","Atlantic/St_Helena":"SH","Europe/Ljubljana":"SI","Arctic/Longyearbyen":"SJ","Europe/Bratislava":"SK","Africa/Freetown":"SL","Europe/San_Marino":"SM","Africa/Dakar":"SN","Africa/Mogadishu":"SO","America/Paramaribo":"SR","Africa/Juba":"SS","Africa/Sao_Tome":"ST","America/El_Salvador":"SV","America/Lower_Princes":"SX","Asia/Damascus":"SY","Africa/Mbabane":"SZ","America/Grand_Turk":"TC","Africa/Ndjamena":"TD","Indian/Kerguelen":"TF","Africa/Lome":"TG","Asia/Bangkok":"TH","Asia/Dushanbe":"TJ","Pacific/Fakaofo":"TK","Asia/Dili":"TL","Asia/Ashgabat":"TM","Africa/Tunis":"TN","Pacific/Tongatapu":"TO","Europe/Istanbul":"TR","America/Port_of_Spain":"TT","Pacific/Funafuti":"TV","Asia/Taipei":"TW","Africa/Dar_es_Salaam":"TZ","Europe/Kiev":"UA","Europe/Simferopol":"UA","Europe/Uzhgorod":"UA","Europe/Zaporozhye":"UA","Africa/Kampala":"UG","Pacific/Midway":"UM","Pacific/Wake":"UM","America/Adak":"US","America/Anchorage":"US","America/Boise":"US","America/Chicago":"US","America/Denver":"US","America/Detroit":"US","America/Indiana/Indianapolis":"US","America/Indiana/Knox":"US","America/Indiana/Marengo":"US","America/Indiana/Petersburg":"US","America/Indiana/Tell_City":"US","America/Indiana/Vevay":"US","America/Indiana/Vincennes":"US","America/Indiana/Winamac":"US","America/Juneau":"US","America/Kentucky/Louisville":"US","America/Kentucky/Monticello":"US","America/Los_Angeles":"US","America/Menominee":"US","America/Metlakatla":"US","America/New_York":"US","America/Nome":"US","America/North_Dakota/Beulah":"US","America/North_Dakota/Center":"US","America/North_Dakota/New_Salem":"US","America/Phoenix":"US","America/Sitka":"US","America/Yakutat":"US","Pacific/Honolulu":"US","America/Montevideo":"UY","Asia/Samarkand":"UZ","Asia/Tashkent":"UZ","Europe/Vatican":"VA","America/St_Vincent":"VC","America/Caracas":"VE","America/Tortola":"VG","America/St_Thomas":"VI","Asia/Ho_Chi_Minh":"VN","Pacific/Efate":"VU","Pacific/Wallis":"WF","Pacific/Apia":"WS","Asia/Aden":"YE","Indian/Mayotte":"YT","Africa/Johannesburg":"ZA","Africa/Lusaka":"ZM","Africa/Harare":"ZW"};function m(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(+e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+e/4).toString(16))}function A(e){return!(!e||"string"!=typeof e)&&!(e.length<2||e.length>10240)}function y(e,t,i){if(e)if(Array.isArray(e))e.forEach((e,r)=>{t.call(i,e,r)});else for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.call(i,e[r],r)}function S(e,t,i,r){var{capture:a=!1,passive:n=!0}=null!=r?r:{};null==e||e.addEventListener(t,i,{capture:a,passive:n})}function w(e,t){if(!t)return e;for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}function I(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];for(var a of i)for(var n of a)e.push(n);return e}var b="undefined"!=typeof window?window:void 0,M="undefined"!=typeof globalThis?globalThis:b,R=null==M?void 0:M.navigator,E=null==M?void 0:M.document,C=null==M?void 0:M.location,P=null==M?void 0:M.fetch,k=(null==M?void 0:M.XMLHttpRequest)&&"withCredentials"in new M.XMLHttpRequest?M.XMLHttpRequest:void 0;null==M||M.AbortController;var T=null==R?void 0:R.userAgent,U=null!=b?b:{},L=31536e3,B=["herokuapp.com","vercel.app","netlify.app"];function x(e){var t;if(!e)return"";if("undefined"==typeof document)return"";var i=null===(t=document.location)||void 0===t?void 0:t.hostname;if(!i)return"";var r=i.match(/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i);return r?"."+r[0]:""}class D{constructor(e){var t,i;this.memoryStorage=new Map,this.method=e.method,this.cross_subdomain=null!==(t=e.cross_subdomain)&&void 0!==t?t:function(){var e;if("undefined"==typeof document)return!1;var t=null===(e=document.location)||void 0===e?void 0:e.hostname;if(!t)return!1;var i=t.split(".").slice(-2).join(".");for(var r of B)if(i===r)return!1;return!0}(),this.sameSite=e.sameSite||"Lax",this.secure=null!==(i=e.secure)&&void 0!==i?i:"undefined"!=typeof location&&"https:"===location.protocol}get(e){var t;try{if(this.method===v)return null!==(t=this.memoryStorage.get(e))&&void 0!==t?t:null;if(this.usesLocalStorage()){var i=localStorage.getItem(e);return null!==i?i:this.method===g?this.getCookie(e):null}return this.usesSessionStorage()?sessionStorage.getItem(e):this.getCookie(e)}catch(t){return console.warn('[StorageManager] Failed to get "'+e+'":',t),null}}set(e,t,i){try{if(this.method===v)return void this.memoryStorage.set(e,t);if(this.usesLocalStorage())return localStorage.setItem(e,t),void(this.method===g&&this.setCookie(e,t,i||L));if(this.usesSessionStorage())return void sessionStorage.setItem(e,t);this.setCookie(e,t,i||L)}catch(t){console.warn('[StorageManager] Failed to set "'+e+'":',t)}}remove(e){try{if(this.method===v)return void this.memoryStorage.delete(e);if(this.usesLocalStorage())return localStorage.removeItem(e),void(this.method===g&&this.removeCookie(e));if(this.usesSessionStorage())return void sessionStorage.removeItem(e);this.removeCookie(e)}catch(t){console.warn('[StorageManager] Failed to remove "'+e+'":',t)}}getWithExpiry(e){var t=this.get(e);if(!t)return null;try{var i=JSON.parse(t);return i.expiry&&Date.now()>i.expiry?(this.remove(e),null):i.value}catch(e){return null}}setWithExpiry(e,t,r){var a=i({value:t},r?{expiry:Date.now()+r}:{});this.set(e,JSON.stringify(a))}getJSON(e){var t=this.get(e);if(!t)return null;try{return JSON.parse(t)}catch(e){return null}}setJSON(e,t,i){this.set(e,JSON.stringify(t),i)}getCookie(e){if("undefined"==typeof document)return null;var t=document.cookie.split(";");for(var i of t){var[r,...a]=i.trim().split("=");if(r===e){var n=a.join("=");try{return decodeURIComponent(n)}catch(e){return n}}}return null}setCookie(e,t,i){if("undefined"!=typeof document){var r=e+"="+encodeURIComponent(t);r+="; Max-Age="+i,r+="; path=/",r+="; SameSite="+this.sameSite,this.secure&&(r+="; Secure");var a=x(this.cross_subdomain);a&&(r+="; domain="+a),document.cookie=r}}removeCookie(e){if("undefined"!=typeof document){var t=x(this.cross_subdomain),i=e+"=; Max-Age=0; path=/";t&&(i+="; domain="+t),document.cookie=i,document.cookie=e+"=; Max-Age=0; path=/"}}usesLocalStorage(){return this.method===h||this.method===g}usesSessionStorage(){return this.method===f}canUseSessionStorage(){if(void 0===b||!(null==b?void 0:b.sessionStorage))return!1;try{var e="__vt_storage_test__";return b.sessionStorage.setItem(e,"test"),b.sessionStorage.removeItem(e),!0}catch(e){return!1}}getSessionStorage(){var e;return this.canUseSessionStorage()&&null!==(e=null==b?void 0:b.sessionStorage)&&void 0!==e?e:null}setMethod(e){this.method=e}getMethod(){return this.method}}class O{constructor(e,t){void 0===e&&(e="cookie"),this.storage=new D({method:e,cross_subdomain:t,sameSite:"Lax"}),this._windowId=void 0,this._initializeWindowId()}getSessionId(){var e=this._getSessionIdRaw();return e||(e=m(),this._storeSessionId(e)),e}setSessionId(){var e=this._getSessionIdRaw()||m();return this._storeSessionId(e),e}resetSessionId(){this._clearSessionId(),this.setSessionId(),this._setWindowId(m())}_getSessionIdRaw(){return this.storage.get(a)}_storeSessionId(e){this.storage.set(a,e,1800)}_clearSessionId(){this.storage.remove(a)}getWindowId(){if(this._windowId)return this._windowId;var e=this.storage.getSessionStorage();if(e){var t=e.getItem(n);if(t)return this._windowId=t,t}var i=m();return this._setWindowId(i),i}_setWindowId(e){if(e!==this._windowId){this._windowId=e;var t=this.storage.getSessionStorage();t&&t.setItem(n,e)}}_initializeWindowId(){var e=this.storage.getSessionStorage();if(e){var t=e.getItem(s),i=e.getItem(n);i&&!t?this._windowId=i:(i&&e.removeItem(n),this._setWindowId(m())),e.setItem(s,"true"),this._listenToUnload()}else this._windowId=m()}_listenToUnload(){var e=this.storage.getSessionStorage();b&&e&&S(b,"beforeunload",()=>{var e=this.storage.getSessionStorage();e&&e.removeItem(s)},{capture:!1})}updateStorageMethod(e,t){this.storage=new D({method:e,cross_subdomain:t,sameSite:"Lax"})}}function N(e){if(!E)return null;var t=E.createElement("a");return t.href=e,t}function q(e,t){for(var i=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<i.length;r++){var a=i[r].split("=");if(a[0]===t){if(a.length<2)return"";var n=a[1];try{n=decodeURIComponent(n)}catch(e){}return n.replace(/\+/g," ")}}return""}function $(e,t,i){if(!e||!t||!t.length)return e;for(var r=e.split("#"),a=r[0]||"",n=r[1],s=a.split("?"),o=s[1],u=s[0],c=(o||"").split("&"),l=[],d=0;d<c.length;d++){var h=c[d].split("="),g=h[0],f=h.slice(1).join("=");-1!==t.indexOf(g)?l.push(g+"="+i):g&&l.push(g+(f?"="+f:""))}var v=l.join("&");return u+(v?"?"+v:"")+(n?"#"+n:"")}function V(e){return"function"==typeof e}var K="Mobile",G="iOS",z="Android",j="Tablet",F=z+" "+j,W="iPad",H="Apple",J=H+" Watch",Q="Safari",Z="BlackBerry",X="Samsung",Y=X+"Browser",ee=X+" Internet",te="Chrome",ie=te+" OS",re=te+" "+G,ae="Internet Explorer",ne=ae+" "+K,se="Opera",oe=se+" Mini",ue="Edge",ce="Microsoft "+ue,le="Firefox",de=le+" "+G,he="Nintendo",ge="PlayStation",fe="Xbox",ve=z+" "+K,pe=K+" "+Q,_e="Windows",me=_e+" Phone",Ae="Nokia",ye="Ouya",Se="Generic",we=Se+" "+K.toLowerCase(),Ie=Se+" "+j.toLowerCase(),be="Konqueror",Me="(\\d+(\\.\\d+)?)",Re=new RegExp("Version/"+Me),Ee=new RegExp(fe,"i"),Ce=new RegExp(ge+" \\w+","i"),Pe=new RegExp(he+" \\w+","i"),ke=new RegExp(Z+"|PlayBook|BB10","i"),Te={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};function Ue(e,t){return e.toLowerCase().includes(t.toLowerCase())}var Le=(e,t)=>t&&Ue(t,H)||function(e){return Ue(e,Q)&&!Ue(e,te)&&!Ue(e,z)}(e),Be=function(e,t){return t=t||"",Ue(e," OPR/")&&Ue(e,"Mini")?oe:Ue(e," OPR/")?se:ke.test(e)?Z:Ue(e,"IE"+K)||Ue(e,"WPDesktop")?ne:Ue(e,Y)?ee:Ue(e,ue)||Ue(e,"Edg/")?ce:Ue(e,"FBIOS")?"Facebook "+K:Ue(e,"UCWEB")||Ue(e,"UCBrowser")?"UC Browser":Ue(e,"CriOS")?re:Ue(e,"CrMo")||Ue(e,te)?te:Ue(e,z)&&Ue(e,Q)?ve:Ue(e,"FxiOS")?de:Ue(e.toLowerCase(),be.toLowerCase())?be:Le(e,t)?Ue(e,K)?pe:Q:Ue(e,le)?le:Ue(e,"MSIE")||Ue(e,"Trident/")?ae:Ue(e,"Gecko")?le:""},xe={[ne]:[new RegExp("rv:"+Me)],[ce]:[new RegExp(ue+"?\\/"+Me)],[te]:[new RegExp("("+te+"|CrMo)\\/"+Me)],[re]:[new RegExp("CriOS\\/"+Me)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Me)],[Q]:[Re],[pe]:[Re],[se]:[new RegExp("(Opera|OPR)\\/"+Me)],[le]:[new RegExp(le+"\\/"+Me)],[de]:[new RegExp("FxiOS\\/"+Me)],[be]:[new RegExp("Konqueror[:/]?"+Me,"i")],[Z]:[new RegExp(Z+" "+Me),Re],[ve]:[new RegExp("android\\s"+Me,"i")],[ee]:[new RegExp(Y+"\\/"+Me)],[ae]:[new RegExp("(rv:|MSIE )"+Me)],Mozilla:[new RegExp("rv:"+Me)]},De=function(e,t){var i=Be(e,t),r=xe[i];if(void 0===r)return null;for(var a=0;a<r.length;a++){var n=r[a],s=e.match(n);if(s)return parseFloat(s[s.length-2])}return null},Oe=[[new RegExp(fe+"; "+fe+" (.*?)[);]","i"),e=>[fe,e&&e[1]||""]],[new RegExp(he,"i"),[he,""]],[new RegExp(ge,"i"),[ge,""]],[ke,[Z,""]],[new RegExp(_e,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[me,""];if(new RegExp(K).test(t)&&!/IEMobile\b/.test(t))return[_e+" "+K,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var r=i[1],a=Te[r]||"";return/arm/i.test(t)&&(a="RT"),[_e,a]}return[_e,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[G,t.join(".")]}return[G,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=void 0===e[2]?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+z+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+z+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[z,t.join(".")]}return[z,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var i=[e[1],e[2],e[3]||"0"];t[1]=i.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[ie,""]],[/Linux|debian/i,["Linux",""]]],Ne=function(e){return Pe.test(e)?he:Ce.test(e)?ge:Ee.test(e)?fe:new RegExp(ye,"i").test(e)?ye:new RegExp("("+me+"|WPDesktop)","i").test(e)?me:/iPad/.test(e)?W:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?J:ke.test(e)?Z:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Ae,"i").test(e)?Ae:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?!new RegExp(K).test(e)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)?/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?z:F:z:new RegExp("(pda|"+K+")","i").test(e)?we:new RegExp(j,"i").test(e)&&!new RegExp(j+" pc","i").test(e)?Ie:""},qe="https?://(.*)",$e=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Ve=I(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],$e),Ke="<masked>";function Ge(e){var t=function(e){return e?0===e.search(qe+"google.([^/?]*)")?"google":0===e.search(qe+"bing.com")?"bing":0===e.search(qe+"yahoo.com")?"yahoo":0===e.search(qe+"duckduckgo.com")?"duckduckgo":null:null}(e),i="yahoo"!==t?"q":"p",r={};if(null!==t){r.$search_engine=t;var a=E?q(E.referrer,i):"";a.length&&(r.ph_keyword=a)}return r}function ze(){if("undefined"!=typeof navigator)return navigator.language||navigator.userLanguage}function je(){return(null==E?void 0:E.referrer)||"$direct"}function Fe(){var e;return(null==E?void 0:E.referrer)&&(null===(e=N(E.referrer))||void 0===e?void 0:e.host)||"$direct"}function We(e){var t,{r:i,u:r}=e,a={$referrer:i,$referring_domain:null==i?void 0:"$direct"===i?"$direct":null===(t=N(i))||void 0===t?void 0:t.host};if(r){a.$current_url=r;var n=N(r);a.$host=null==n?void 0:n.host,a.$pathname=null==n?void 0:n.pathname;var s=function(e){var t=Ve.concat([]),i={};return y(t,function(t){var r=q(e,t);i[t]=r||null}),i}(r);w(a,s)}i&&w(a,Ge(i));return a}function He(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function Je(){try{return(new Date).getTimezoneOffset()}catch(e){return}}function Qe(e,t){if(!T)return{};var i,r,a,[n,s]=function(e){for(var t=0;t<Oe.length;t++){var[i,r]=Oe[t],a=i.exec(e),n=a&&(V(r)?r(a,e):r);if(n)return n}return["",""]}(T);return w(function(e){var t={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var r=e[i];null!=r&&""!==r&&(t[i]=r)}return t}({$os:n,$os_version:s,$browser:Be(T,navigator.vendor),$device:Ne(T),$device_type:(r=T,a=Ne(r),a===W||a===F||"Kobo"===a||"Kindle Fire"===a||a===Ie?j:a===he||a===fe||a===ge||a===ye?"Console":a===J?"Wearable":a?K:"Desktop"),$timezone:He(),$timezone_offset:Je()}),{$current_url:$(null==C?void 0:C.href,[],Ke),$host:null==C?void 0:C.host,$pathname:null==C?void 0:C.pathname,$raw_user_agent:T.length>1e3?T.substring(0,997)+"...":T,$browser_version:De(T,navigator.vendor),$browser_language:ze(),$browser_language_prefix:(i=ze(),"string"==typeof i?i.split("-")[0]:void 0),$screen_height:null==b?void 0:b.screen.height,$screen_width:null==b?void 0:b.screen.width,$viewport_height:null==b?void 0:b.innerHeight,$viewport_width:null==b?void 0:b.innerWidth,$lib:"web",$lib_version:"1.0.7",$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}class Ze{constructor(e,t){void 0===e&&(e="localStorage"),this._cachedPersonProperties=null,this.storage=new D({method:e,cross_subdomain:t,sameSite:"Lax"}),this.userIdentity=this.loadUserIdentity()}getUserIdentity(){return i({},this.userIdentity)}getDistinctId(){return this.userIdentity.distinct_id}getAnonymousId(){return this.userIdentity.anonymous_id||(this.userIdentity.anonymous_id=this.generateAnonymousId(),this.storage.set(c,this.userIdentity.anonymous_id,L)),this.userIdentity.anonymous_id}getUserProperties(){return i({},this.userIdentity.properties)}getEffectiveId(){return this.userIdentity.distinct_id||this.getAnonymousId()}getDeviceId(){return this.userIdentity.device_id}getUserState(){return this.userIdentity.user_state}identify(e,t,r){if("number"==typeof e&&(e=e.toString(),console.warn("The first argument to vTilt.identify was a number, but it should be a string. It has been converted to a string.")),e)if(this.isDistinctIdStringLike(e))console.error('The string "'+e+'" was set in vTilt.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if("COOKIELESS_SENTINEL_VALUE"!==e){var a=this.userIdentity.distinct_id;if(this.userIdentity.distinct_id=e,!this.userIdentity.device_id){var n=a||this.userIdentity.anonymous_id;this.userIdentity.device_id=n,this.userIdentity.properties=i({},this.userIdentity.properties,{$had_persisted_distinct_id:!0,$device_id:n})}e!==a&&(this.userIdentity.distinct_id=e);var s="anonymous"===this.userIdentity.user_state;e!==a&&s?(this.userIdentity.user_state="identified",t&&(this.userIdentity.properties=i({},this.userIdentity.properties,t)),r&&Object.keys(r).forEach(e=>{e in this.userIdentity.properties||(this.userIdentity.properties[e]=r[e])}),this.saveUserIdentity()):t||r?("anonymous"===this.userIdentity.user_state&&(this.userIdentity.user_state="identified"),t&&(this.userIdentity.properties=i({},this.userIdentity.properties,t)),r&&Object.keys(r).forEach(e=>{e in this.userIdentity.properties||(this.userIdentity.properties[e]=r[e])}),this.saveUserIdentity()):e!==a&&(this.userIdentity.user_state="identified",this.saveUserIdentity())}else console.error('The string "'+e+'" was set in vTilt.identify which indicates an error. This ID is only used as a sentinel value.');else console.error("Unique user id has not been set in vTilt.identify")}setUserProperties(e,t){if(!e&&!t)return!1;var r=this.userIdentity.distinct_id||this.userIdentity.anonymous_id,a=this.getPersonPropertiesHash(r,e,t);return this._cachedPersonProperties===a?(console.info("VTilt: A duplicate setUserProperties call was made with the same properties. It has been ignored."),!1):(e&&(this.userIdentity.properties=i({},this.userIdentity.properties,e)),t&&Object.keys(t).forEach(e=>{e in this.userIdentity.properties||(this.userIdentity.properties[e]=t[e])}),this.saveUserIdentity(),this._cachedPersonProperties=a,!0)}reset(e){var t=this.generateAnonymousId(),r=this.userIdentity.device_id,a=e?this.generateDeviceId():r;this.userIdentity={distinct_id:null,anonymous_id:t,device_id:a,properties:{},user_state:"anonymous"},this._cachedPersonProperties=null,this.saveUserIdentity(),this.userIdentity.properties=i({},this.userIdentity.properties,{$last_vtilt_reset:(new Date).toISOString()}),this.saveUserIdentity()}setDistinctId(e){this.userIdentity.distinct_id=e,this.saveUserIdentity()}setUserState(e){this.userIdentity.user_state=e,this.saveUserIdentity()}updateUserProperties(e,t){e&&(this.userIdentity.properties=i({},this.userIdentity.properties,e)),t&&Object.keys(t).forEach(e=>{e in this.userIdentity.properties||(this.userIdentity.properties[e]=t[e])}),this.saveUserIdentity()}ensureDeviceId(e){this.userIdentity.device_id||(this.userIdentity.device_id=e,this.userIdentity.properties=i({},this.userIdentity.properties,{$had_persisted_distinct_id:!0,$device_id:e}),this.saveUserIdentity())}createAlias(e,t){return this.isValidDistinctId(e)?(void 0===t&&(t=this.getDistinctId()||this.getAnonymousId()),this.isValidDistinctId(t)?e===t?(console.warn("alias matches current distinct_id - should use identify instead"),null):{distinct_id:e,original:t}:(console.warn("Invalid original distinct ID"),null)):(console.warn("Invalid alias provided"),null)}isDistinctIdStringLikePublic(e){return this.isDistinctIdStringLike(e)}set_initial_person_info(e,t){if(!this.getStoredUserProperties()[p]){var i=function(e,t){var i=e?I([],$e,t||[]):[],r=null==C?void 0:C.href.substring(0,1e3);return{r:je().substring(0,1e3),u:r?$(r,i,Ke):void 0}}(e,t);this.register_once({[p]:i},void 0)}}get_initial_props(){var e,t,i=this.getStoredUserProperties()[p];return i?(e=We(i),t={},y(e,function(e,i){var r;t["$initial_"+(r=String(i),r.startsWith("$")?r.substring(1):r)]=e}),t):{}}update_referrer_info(){var e={$referrer:je(),$referring_domain:Fe()};this.register_once(e,void 0)}loadUserIdentity(){var e=this.storage.get(c)||this.generateAnonymousId(),t=this.storage.get(l)||null,i=this.storage.get(u)||this.generateDeviceId(),r=this.getStoredUserProperties(),a=this.storage.get(o)||"anonymous";return{distinct_id:t,anonymous_id:e||this.generateAnonymousId(),device_id:i,properties:r,user_state:a}}saveUserIdentity(){this.storage.set(c,this.userIdentity.anonymous_id,L),this.storage.set(u,this.userIdentity.device_id,L),this.storage.set(o,this.userIdentity.user_state,L),this.userIdentity.distinct_id?this.storage.set(l,this.userIdentity.distinct_id,L):this.storage.remove(l),this.setStoredUserProperties(this.userIdentity.properties)}getStoredUserProperties(){return this.storage.getJSON(d)||{}}setStoredUserProperties(e){this.storage.setJSON(d,e,L)}register_once(e,t){var i=this.getStoredUserProperties(),r=!1;for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(a in i||(i[a]=e[a],r=!0));if(t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(n in i||(i[n]=t[n],r=!0));r&&this.setStoredUserProperties(i)}generateAnonymousId(){return"anon_"+m()}generateDeviceId(){return"device_"+m()}getPersonPropertiesHash(e,t,i){return JSON.stringify({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}isValidDistinctId(e){if(!e||"string"!=typeof e)return!1;var t=e.toLowerCase().trim();return!["null","undefined","false","true","anonymous","anon","user","test","guest","visitor","unknown","none"].includes(t)&&0!==e.trim().length}isDistinctIdStringLike(e){if(!e||"string"!=typeof e)return!1;var t=e.toLowerCase().trim();return["null","undefined","false","true","anonymous","anon","user","test","guest","visitor","unknown","none","demo","example","sample","placeholder"].includes(t)}updateStorageMethod(e,t){this.storage=new D({method:e,cross_subdomain:t,sameSite:"Lax"}),this.userIdentity=this.loadUserIdentity()}}class Xe{constructor(e,t){if(this.instance=t,e.capture_performance&&b)try{this.webVitals=require("web-vitals"),this.initializeWebVitals()}catch(e){console.warn("web-vitals library not found. Please install it to enable web vitals tracking.",e)}}initializeWebVitals(){if(this.webVitals){var e=e=>{try{if(!(b&&E&&R&&C))return;var{country:t,locale:i}=function(){var e,t;if(!R)return{country:e,locale:t};try{var i=Intl.DateTimeFormat().resolvedOptions().timeZone;e=_[i],t=R.languages&&R.languages.length?R.languages[0]:R.userLanguage||R.language||R.browserLanguage||"en"}catch(e){}return{country:e,locale:t}}();this.instance.capture("web_vital",{name:e.name,value:e.value,delta:e.delta,rating:e.rating,id:e.id,navigationType:e.navigationType,pathname:C.pathname,href:C.href,"user-agent":R.userAgent,locale:i,location:t,referrer:E.referrer})}catch(e){console.error("Error sending web vital:",e)}};this.webVitals.onCLS&&this.webVitals.onCLS(e),this.webVitals.onFCP&&this.webVitals.onFCP(e),this.webVitals.onLCP&&this.webVitals.onLCP(e),this.webVitals.onTTFB&&this.webVitals.onTTFB(e),this.webVitals.onINP&&this.webVitals.onINP(e)}}}function Ye(e,t,i){try{if(!(t in e))return()=>{};var r=e[t],a=i(r);return V(a)&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__vtilt_wrapped__:{enumerable:!1,value:!0}})),e[t]=a,()=>{e[t]=r}}catch(e){return()=>{}}}class et{constructor(e){var t;this._instance=e,this._lastPathname=(null===(t=null==b?void 0:b.location)||void 0===t?void 0:t.pathname)||""}get isEnabled(){return!0}startIfEnabled(){this.isEnabled&&this.monitorHistoryChanges()}stop(){this._popstateListener&&this._popstateListener(),this._popstateListener=void 0}monitorHistoryChanges(){var e,t;if(b&&C&&(this._lastPathname=C.pathname||"",b.history)){var i=this;(null===(e=b.history.pushState)||void 0===e?void 0:e.__vtilt_wrapped__)||Ye(b.history,"pushState",e=>function(t,r,a){e.call(this,t,r,a),i._capturePageview("pushState")}),(null===(t=b.history.replaceState)||void 0===t?void 0:t.__vtilt_wrapped__)||Ye(b.history,"replaceState",e=>function(t,r,a){e.call(this,t,r,a),i._capturePageview("replaceState")}),this._setupPopstateListener()}}_capturePageview(e){var t;try{var i=null===(t=null==b?void 0:b.location)||void 0===t?void 0:t.pathname;if(!i||!C||!E)return;if(i!==this._lastPathname&&this.isEnabled){var r={navigation_type:e};this._instance.capture("$pageview",r)}this._lastPathname=i}catch(t){console.error("Error capturing "+e+" pageview",t)}}_setupPopstateListener(){if(!this._popstateListener&&b){var e=()=>{this._capturePageview("popstate")};S(b,"popstate",e),this._popstateListener=()=>{b&&b.removeEventListener("popstate",e)}}}}var tt="[SessionRecording]";class it{constructor(e,t){void 0===t&&(t={}),this._instance=e,this._config=t}get started(){var e;return!!(null===(e=this._lazyLoadedRecording)||void 0===e?void 0:e.isStarted)}get status(){var e;return(null===(e=this._lazyLoadedRecording)||void 0===e?void 0:e.status)||"lazy_loading"}get sessionId(){var e;return(null===(e=this._lazyLoadedRecording)||void 0===e?void 0:e.sessionId)||""}startIfEnabledOrStop(e){var t;if(!this._isRecordingEnabled||!(null===(t=this._lazyLoadedRecording)||void 0===t?void 0:t.isStarted)){var i=void 0!==Object.assign&&void 0!==Array.from;this._isRecordingEnabled&&i?(this._lazyLoadAndStart(e),console.info(tt+" starting")):this.stopRecording()}}stopRecording(){var e;null===(e=this._lazyLoadedRecording)||void 0===e||e.stop()}log(e,t){var i;void 0===t&&(t="log"),(null===(i=this._lazyLoadedRecording)||void 0===i?void 0:i.log)?this._lazyLoadedRecording.log(e,t):console.warn(tt+" log called before recorder was ready")}updateConfig(e){var t;this._config=i({},this._config,e),null===(t=this._lazyLoadedRecording)||void 0===t||t.updateConfig(this._config)}get _isRecordingEnabled(){var e,t=this._instance.getConfig(),i=null!==(e=this._config.enabled)&&void 0!==e&&e,r=!t.disable_session_recording;return!!b&&i&&r}get _scriptName(){return"recorder"}_lazyLoadAndStart(e){var t,i,r,a;if(this._isRecordingEnabled)if((null===(i=null===(t=null==U?void 0:U.__VTiltExtensions__)||void 0===t?void 0:t.rrweb)||void 0===i?void 0:i.record)&&(null===(r=U.__VTiltExtensions__)||void 0===r?void 0:r.initSessionRecording))this._onScriptLoaded(e);else{var n=null===(a=U.__VTiltExtensions__)||void 0===a?void 0:a.loadExternalDependency;n?n(this._instance,this._scriptName,t=>{t?console.error(tt+" could not load recorder:",t):this._onScriptLoaded(e)}):console.error(tt+" loadExternalDependency not available. Session recording cannot start.")}}_onScriptLoaded(e){var t,i=null===(t=U.__VTiltExtensions__)||void 0===t?void 0:t.initSessionRecording;i?(this._lazyLoadedRecording||(this._lazyLoadedRecording=i(this._instance,this._config)),this._lazyLoadedRecording.start(e)):console.error(tt+" initSessionRecording not available after script load")}}var rt=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(rt||{}),at=Uint8Array,nt=Uint16Array,st=Int32Array,ot=new at([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ut=new at([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ct=new at([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),lt=function(e,t){for(var i=new nt(31),r=0;r<31;++r)i[r]=t+=1<<e[r-1];var a=new st(i[30]);for(r=1;r<30;++r)for(var n=i[r];n<i[r+1];++n)a[n]=n-i[r]<<5|r;return{b:i,r:a}},dt=lt(ot,2),ht=dt.b,gt=dt.r;ht[28]=258,gt[258]=28;for(var ft=lt(ut,0).r,vt=new nt(32768),pt=0;pt<32768;++pt){var _t=(43690&pt)>>1|(21845&pt)<<1;_t=(61680&(_t=(52428&_t)>>2|(13107&_t)<<2))>>4|(3855&_t)<<4,vt[pt]=((65280&_t)>>8|(255&_t)<<8)>>1}var mt=function(e,t,i){for(var r=e.length,a=0,n=new nt(t);a<r;++a)e[a]&&++n[e[a]-1];var s,o=new nt(t);for(a=1;a<t;++a)o[a]=o[a-1]+n[a-1]<<1;if(i){s=new nt(1<<t);var u=15-t;for(a=0;a<r;++a)if(e[a])for(var c=a<<4|e[a],l=t-e[a],d=o[e[a]-1]++<<l,h=d|(1<<l)-1;d<=h;++d)s[vt[d]>>u]=c}else for(s=new nt(r),a=0;a<r;++a)e[a]&&(s[a]=vt[o[e[a]-1]++]>>15-e[a]);return s},At=new at(288);for(pt=0;pt<144;++pt)At[pt]=8;for(pt=144;pt<256;++pt)At[pt]=9;for(pt=256;pt<280;++pt)At[pt]=7;for(pt=280;pt<288;++pt)At[pt]=8;var yt=new at(32);for(pt=0;pt<32;++pt)yt[pt]=5;var St=mt(At,9,0),wt=mt(yt,5,0),It=function(e){return(e+7)/8|0},bt=function(e,t,i){return(null==i||i>e.length)&&(i=e.length),new at(e.subarray(t,i))},Mt=function(e,t,i){i<<=7&t;var r=t/8|0;e[r]|=i,e[r+1]|=i>>8},Rt=function(e,t,i){i<<=7&t;var r=t/8|0;e[r]|=i,e[r+1]|=i>>8,e[r+2]|=i>>16},Et=function(e,t){for(var i=[],r=0;r<e.length;++r)e[r]&&i.push({s:r,f:e[r]});var a=i.length,n=i.slice();if(!a)return{t:Bt,l:0};if(1==a){var s=new at(i[0].s+1);return s[i[0].s]=1,{t:s,l:1}}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var o=i[0],u=i[1],c=0,l=1,d=2;for(i[0]={s:-1,f:o.f+u.f,l:o,r:u};l!=a-1;)o=i[i[c].f<i[d].f?c++:d++],u=i[c!=l&&i[c].f<i[d].f?c++:d++],i[l++]={s:-1,f:o.f+u.f,l:o,r:u};var h=n[0].s;for(r=1;r<a;++r)n[r].s>h&&(h=n[r].s);var g=new nt(h+1),f=Ct(i[l-1],g,0);if(f>t){r=0;var v=0,p=f-t,_=1<<p;for(n.sort(function(e,t){return g[t.s]-g[e.s]||e.f-t.f});r<a;++r){var m=n[r].s;if(!(g[m]>t))break;v+=_-(1<<f-g[m]),g[m]=t}for(v>>=p;v>0;){var A=n[r].s;g[A]<t?v-=1<<t-g[A]++-1:++r}for(;r>=0&&v;--r){var y=n[r].s;g[y]==t&&(--g[y],++v)}f=t}return{t:new at(g),l:f}},Ct=function(e,t,i){return-1==e.s?Math.max(Ct(e.l,t,i+1),Ct(e.r,t,i+1)):t[e.s]=i},Pt=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new nt(++t),r=0,a=e[0],n=1,s=function(e){i[r++]=e},o=1;o<=t;++o)if(e[o]==a&&o!=t)++n;else{if(!a&&n>2){for(;n>138;n-=138)s(32754);n>2&&(s(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(s(a),--n;n>6;n-=6)s(8304);n>2&&(s(n-3<<5|8208),n=0)}for(;n--;)s(a);n=1,a=e[o]}return{c:i.subarray(0,r),n:t}},kt=function(e,t){for(var i=0,r=0;r<t.length;++r)i+=e[r]*t[r];return i},Tt=function(e,t,i){var r=i.length,a=It(t+2);e[a]=255&r,e[a+1]=r>>8,e[a+2]=255^e[a],e[a+3]=255^e[a+1];for(var n=0;n<r;++n)e[a+n+4]=i[n];return 8*(a+4+r)},Ut=function(e,t,i,r,a,n,s,o,u,c,l){Mt(t,l++,i),++a[256];for(var d=Et(a,15),h=d.t,g=d.l,f=Et(n,15),v=f.t,p=f.l,_=Pt(h),m=_.c,A=_.n,y=Pt(v),S=y.c,w=y.n,I=new nt(19),b=0;b<m.length;++b)++I[31&m[b]];for(b=0;b<S.length;++b)++I[31&S[b]];for(var M=Et(I,7),R=M.t,E=M.l,C=19;C>4&&!R[ct[C-1]];--C);var P,k,T,U,L=c+5<<3,B=kt(a,At)+kt(n,yt)+s,x=kt(a,h)+kt(n,v)+s+14+3*C+kt(I,R)+2*I[16]+3*I[17]+7*I[18];if(u>=0&&L<=B&&L<=x)return Tt(t,l,e.subarray(u,u+c));if(Mt(t,l,1+(x<B)),l+=2,x<B){P=mt(h,g,0),k=h,T=mt(v,p,0),U=v;var D=mt(R,E,0);Mt(t,l,A-257),Mt(t,l+5,w-1),Mt(t,l+10,C-4),l+=14;for(b=0;b<C;++b)Mt(t,l+3*b,R[ct[b]]);l+=3*C;for(var O=[m,S],N=0;N<2;++N){var q=O[N];for(b=0;b<q.length;++b){var $=31&q[b];Mt(t,l,D[$]),l+=R[$],$>15&&(Mt(t,l,q[b]>>5&127),l+=q[b]>>12)}}}else P=St,k=At,T=wt,U=yt;for(b=0;b<o;++b){var V=r[b];if(V>255){Rt(t,l,P[($=V>>18&31)+257]),l+=k[$+257],$>7&&(Mt(t,l,V>>23&31),l+=ot[$]);var K=31&V;Rt(t,l,T[K]),l+=U[K],K>3&&(Rt(t,l,V>>5&8191),l+=ut[K])}else Rt(t,l,P[V]),l+=k[V]}return Rt(t,l,P[256]),l+k[256]},Lt=new st([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Bt=new at(0),xt=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var i=t,r=9;--r;)i=(1&i&&-306674912)^i>>>1;e[t]=i}return e}(),Dt=function(e,t,i,r,a){if(!a&&(a={l:1},t.dictionary)){var n=t.dictionary.subarray(-32768),s=new at(n.length+e.length);s.set(n),s.set(e,n.length),e=s,a.w=n.length}return function(e,t,i,r,a,n){var s=n.z||e.length,o=new at(r+s+5*(1+Math.ceil(s/7e3))+a),u=o.subarray(r,o.length-a),c=n.l,l=7&(n.r||0);if(t){l&&(u[0]=n.r>>3);for(var d=Lt[t-1],h=d>>13,g=8191&d,f=(1<<i)-1,v=n.p||new nt(32768),p=n.h||new nt(f+1),_=Math.ceil(i/3),m=2*_,A=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<m)&f},y=new st(25e3),S=new nt(288),w=new nt(32),I=0,b=0,M=n.i||0,R=0,E=n.w||0,C=0;M+2<s;++M){var P=A(M),k=32767&M,T=p[P];if(v[k]=T,p[P]=k,E<=M){var U=s-M;if((I>7e3||R>24576)&&(U>423||!c)){l=Ut(e,u,0,y,S,w,b,R,C,M-C,l),R=I=b=0,C=M;for(var L=0;L<286;++L)S[L]=0;for(L=0;L<30;++L)w[L]=0}var B=2,x=0,D=g,O=k-T&32767;if(U>2&&P==A(M-O))for(var N=Math.min(h,U)-1,q=Math.min(32767,M),$=Math.min(258,U);O<=q&&--D&&k!=T;){if(e[M+B]==e[M+B-O]){for(var V=0;V<$&&e[M+V]==e[M+V-O];++V);if(V>B){if(B=V,x=O,V>N)break;var K=Math.min(O,V-2),G=0;for(L=0;L<K;++L){var z=M-O+L&32767,j=z-v[z]&32767;j>G&&(G=j,T=z)}}}O+=(k=T)-(T=v[k])&32767}if(x){y[R++]=268435456|gt[B]<<18|ft[x];var F=31>[B],W=31&ft[x];b+=ot[F]+ut[W],++S[257+F],++w[W],E=M+B,++I}else y[R++]=e[M],++S[e[M]]}}for(M=Math.max(M,E);M<s;++M)y[R++]=e[M],++S[e[M]];l=Ut(e,u,c,y,S,w,b,R,C,M-C,l),c||(n.r=7&l|u[l/8|0]<<3,l-=7,n.h=p,n.p=v,n.i=M,n.w=E)}else{for(M=n.w||0;M<s+c;M+=65535){var H=M+65535;H>=s&&(u[l/8|0]=c,H=s),l=Tt(u,l+1,e.subarray(M,H))}n.i=s}return bt(o,0,r+It(l)+a)}(e,null==t.level?6:t.level,null==t.mem?a.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):20:12+t.mem,i,r,a)},Ot=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8};function Nt(e,t){t||(t={});var i=function(){var e=-1;return{p:function(t){for(var i=e,r=0;r<t.length;++r)i=xt[255&i^t[r]]^i>>>8;e=i},d:function(){return~e}}}(),r=e.length;i.p(e);var a,n=Dt(e,t,10+((a=t).filename?a.filename.length+1:0),8),s=n.length;return function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Ot(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var r=0;r<=i.length;++r)e[r+10]=i.charCodeAt(r)}}(n,t),Ot(n,s-8,i.d()),Ot(n,s-4,r),n}var qt="undefined"!=typeof TextEncoder&&new TextEncoder,$t="undefined"!=typeof TextDecoder&&new TextDecoder;try{$t.decode(Bt,{stream:!0})}catch(e){}rt.MouseMove,rt.MouseInteraction,rt.Scroll,rt.ViewportResize,rt.Input,rt.TouchMove,rt.MediaInteraction,rt.Drag;var Vt,Kt="text/plain";!function(e){e.GZipJS="gzip-js",e.None="none"}(Vt||(Vt={}));var Gt=e=>{var{data:t,compression:i}=e;if(t){var r=(e=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t))(t),a=new Blob([r]).size;if(i===Vt.GZipJS&&a>=1024)try{var n=Nt(function(e,t){if(qt)return qt.encode(e);for(var i=e.length,r=new at(e.length+(e.length>>1)),a=0,n=function(e){r[a++]=e},s=0;s<i;++s){if(a+5>r.length){var o=new at(a+8+(i-s<<1));o.set(r),r=o}var u=e.charCodeAt(s);u<128||t?n(u):u<2048?(n(192|u>>6),n(128|63&u)):u>55295&&u<57344?(n(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++s))>>18),n(128|u>>12&63),n(128|u>>6&63),n(128|63&u)):(n(224|u>>12),n(128|u>>6&63),n(128|63&u))}return bt(r,0,a)}(r),{mtime:0}),s=new Blob([n],{type:Kt});if(s.size<.95*a)return{contentType:Kt,body:s,estimatedSize:s.size}}catch(e){}return{contentType:"application/json",body:r,estimatedSize:a}}},zt=[{name:"fetch",available:"undefined"!=typeof fetch,method:e=>{var r=Gt(e);if(r){var{contentType:a,body:n,estimatedSize:s}=r,o=e.compression===Vt.GZipJS&&a===Kt?e.url+(e.url.includes("?")?"&":"?")+"compression=gzip-js":e.url,u=i({"Content-Type":a},e.headers||{}),c=new AbortController,l=e.timeout?setTimeout(()=>c.abort(),e.timeout):null;fetch(o,{method:e.method||"POST",headers:u,body:n,keepalive:s<52428.8,signal:c.signal}).then(function(){var i=t(function*(t){var i,r=yield t.text(),a={statusCode:t.status,text:r};if(200===t.status)try{a.json=JSON.parse(r)}catch(e){}null===(i=e.callback)||void 0===i||i.call(e,a)});return function(e){return i.apply(this,arguments)}}()).catch(()=>{var t;null===(t=e.callback)||void 0===t||t.call(e,{statusCode:0})}).finally(()=>{l&&clearTimeout(l)})}}},{name:"XHR",available:"undefined"!=typeof XMLHttpRequest,method:e=>{var t=Gt(e);if(t){var{contentType:i,body:r}=t,a=e.compression===Vt.GZipJS&&i===Kt?e.url+(e.url.includes("?")?"&":"?")+"compression=gzip-js":e.url,n=new XMLHttpRequest;n.open(e.method||"POST",a,!0),e.headers&&Object.entries(e.headers).forEach(e=>{var[t,i]=e;n.setRequestHeader(t,i)}),n.setRequestHeader("Content-Type",i),e.timeout&&(n.timeout=e.timeout),n.onreadystatechange=()=>{var t;if(4===n.readyState){var i={statusCode:n.status,text:n.responseText};if(200===n.status)try{i.json=JSON.parse(n.responseText)}catch(e){}null===(t=e.callback)||void 0===t||t.call(e,i)}},n.onerror=()=>{var t;null===(t=e.callback)||void 0===t||t.call(e,{statusCode:0})},n.send(r)}}},{name:"sendBeacon",available:"undefined"!=typeof navigator&&!!navigator.sendBeacon,method:e=>{var t=Gt(e);if(t){var{contentType:i,body:r}=t;try{var a="string"==typeof r?new Blob([r],{type:i}):r,n=e.compression===Vt.GZipJS&&i===Kt?e.url+(e.url.includes("?")?"&":"?")+"compression=gzip-js":e.url;navigator.sendBeacon(n,a)}catch(e){}}}}],jt=e=>{var t,i=e.transport||"fetch",r=zt.find(e=>e.name===i&&e.available)||zt.find(e=>e.available);if(!r)return console.error("vTilt: No available transport method"),void(null===(t=e.callback)||void 0===t||t.call(e,{statusCode:0}));r.method(e)};class Ft{constructor(e,t){var i,r,a,n;this._isPaused=!0,this._queue=[],this._flushTimeoutMs=(i=(null==t?void 0:t.flush_interval_ms)||3e3,r=250,a=5e3,n=3e3,"number"!=typeof i||isNaN(i)?n:Math.min(Math.max(i,r),a)),this._sendRequest=e}get length(){return this._queue.length}enqueue(e){this._queue.push(e),this._flushTimeout||this._setFlushTimeout()}unload(){if(this._clearFlushTimeout(),0!==this._queue.length){var e=this._formatQueue();for(var t in e){var r=e[t];this._sendRequest(i({},r,{transport:"sendBeacon"}))}}}enable(){this._isPaused=!1,this._setFlushTimeout()}pause(){this._isPaused=!0,this._clearFlushTimeout()}flush(){this._clearFlushTimeout(),this._flushNow(),this._setFlushTimeout()}_setFlushTimeout(){this._isPaused||(this._flushTimeout=setTimeout(()=>{this._clearFlushTimeout(),this._flushNow(),this._queue.length>0&&this._setFlushTimeout()},this._flushTimeoutMs))}_clearFlushTimeout(){this._flushTimeout&&(clearTimeout(this._flushTimeout),this._flushTimeout=void 0)}_flushNow(){if(0!==this._queue.length){var e=this._formatQueue(),t=Date.now();for(var i in e){var r=e[i];r.events.forEach(e=>{var i=new Date(e.timestamp).getTime();e.$offset=Math.abs(i-t)}),this._sendRequest(r)}}}_formatQueue(){var e={};return this._queue.forEach(t=>{var i=t.batchKey||t.url;e[i]||(e[i]={url:t.url,events:[],batchKey:t.batchKey}),e[i].events.push(t.event)}),this._queue=[],e}}class Wt{constructor(e){this._isPolling=!1,this._pollIntervalMs=3e3,this._queue=[],this._areWeOnline=!0,this._sendRequest=e.sendRequest,this._sendBeacon=e.sendBeacon,b&&void 0!==R&&"onLine"in R&&(this._areWeOnline=R.onLine,S(b,"online",()=>{this._areWeOnline=!0,this._flush()}),S(b,"offline",()=>{this._areWeOnline=!1}))}get length(){return this._queue.length}enqueue(e,t){if(void 0===t&&(t=0),t>=10)console.warn("VTilt: Request failed after 10 retries, giving up");else{var i=function(e){var t=3e3*Math.pow(2,e),i=t/2,r=Math.min(18e5,t),a=(Math.random()-.5)*(r-i);return Math.ceil(r+a)}(t),r=Date.now()+i;this._queue.push({retryAt:r,request:e,retriesPerformedSoFar:t+1});var a="VTilt: Enqueued failed request for retry in "+Math.round(i/1e3)+"s";this._areWeOnline||(a+=" (Browser is offline)"),console.warn(a),this._isPolling||(this._isPolling=!0,this._poll())}}retriableRequest(e){var i=this;return t(function*(){try{var t=yield i._sendRequest(e);200!==t.statusCode&&(t.statusCode<400||t.statusCode>=500)&&i.enqueue(e,0)}catch(t){i.enqueue(e,0)}})()}_poll(){this._poller&&clearTimeout(this._poller),this._poller=setTimeout(()=>{this._areWeOnline&&this._queue.length>0&&this._flush(),this._queue.length>0?this._poll():this._isPolling=!1},this._pollIntervalMs)}_flush(){var e=this,i=Date.now(),r=[],a=[];this._queue.forEach(e=>{e.retryAt<i?a.push(e):r.push(e)}),this._queue=r,a.forEach(function(){var i=t(function*(t){var{request:i,retriesPerformedSoFar:r}=t;try{var a=yield e._sendRequest(i);200!==a.statusCode&&(a.statusCode<400||a.statusCode>=500)&&e.enqueue(i,r)}catch(t){e.enqueue(i,r)}});return function(e){return i.apply(this,arguments)}}())}unload(){this._poller&&(clearTimeout(this._poller),this._poller=void 0),this._queue.forEach(e=>{var{request:t}=e;try{this._sendBeacon(t)}catch(e){console.error("VTilt: Failed to send beacon on unload",e)}}),this._queue=[]}}var Ht="vt_rate_limit";class Jt{constructor(e){var t,i;void 0===e&&(e={}),this.lastEventRateLimited=!1,this.eventsPerSecond=null!==(t=e.eventsPerSecond)&&void 0!==t?t:10,this.eventsBurstLimit=Math.max(null!==(i=e.eventsBurstLimit)&&void 0!==i?i:10*this.eventsPerSecond,this.eventsPerSecond),this.persistence=e.persistence,this.captureWarning=e.captureWarning,this.lastEventRateLimited=this.checkRateLimit(!0).isRateLimited}checkRateLimit(e){var t,i,r,a;void 0===e&&(e=!1);var n=Date.now(),s=null!==(i=null===(t=this.persistence)||void 0===t?void 0:t.get(Ht))&&void 0!==i?i:{tokens:this.eventsBurstLimit,last:n},o=(n-s.last)/1e3;s.tokens+=o*this.eventsPerSecond,s.last=n,s.tokens>this.eventsBurstLimit&&(s.tokens=this.eventsBurstLimit);var u=s.tokens<1;return u||e||(s.tokens=Math.max(0,s.tokens-1)),!u||this.lastEventRateLimited||e||null===(r=this.captureWarning)||void 0===r||r.call(this,"vTilt client rate limited. Config: "+this.eventsPerSecond+" events/second, "+this.eventsBurstLimit+" burst limit."),this.lastEventRateLimited=u,null===(a=this.persistence)||void 0===a||a.set(Ht,s),{isRateLimited:u,remainingTokens:s.tokens}}shouldAllowEvent(){return!this.checkRateLimit(!1).isRateLimited}getRemainingTokens(){return this.checkRateLimit(!0).remainingTokens}}class Qt{constructor(e){void 0===e&&(e={}),this.version="1.1.5",this.__loaded=!1,this._initial_pageview_captured=!1,this._visibility_state_listener=null,this.__request_queue=[],this._has_warned_about_config=!1,this._set_once_properties_sent=!1,this.configManager=new r(e);var t=this.configManager.getConfig();this.sessionManager=new O(t.storage||"cookie",t.cross_subdomain_cookie),this.userManager=new Ze(t.persistence||"localStorage",t.cross_subdomain_cookie),this.webVitalsManager=new Xe(t,this),this.rateLimiter=new Jt({eventsPerSecond:10,eventsBurstLimit:100,captureWarning:e=>{this._capture_internal("$$client_ingestion_warning",{$$client_ingestion_warning_message:e})}}),this.retryQueue=new Wt({sendRequest:e=>this._send_http_request(e),sendBeacon:e=>this._send_beacon_request(e)}),this.requestQueue=new Ft(e=>this._send_batched_request(e),{flush_interval_ms:3e3})}init(e,t,i){var r;if(i&&i!==Xt){var a=null!==(r=Zt[i])&&void 0!==r?r:new Qt;return a._init(e,t,i),Zt[i]=a,Zt[Xt][i]=a,a}return this._init(e,t,i)}_init(e,t,r){if(void 0===t&&(t={}),this.__loaded)return console.warn("vTilt: You have already initialized vTilt! Re-initializing is a no-op"),this;this.updateConfig(i({},t,{projectId:e||t.projectId,name:r})),this.__loaded=!0;var a=this.configManager.getConfig();return this.userManager.set_initial_person_info(a.mask_personal_data_properties,a.custom_personal_data_properties),this.historyAutocapture=new et(this),this.historyAutocapture.startIfEnabled(),this._initSessionRecording(),this._setup_unload_handler(),this._start_queue_if_opted_in(),!1!==a.capture_pageview&&this._capture_initial_pageview(),this}_start_queue_if_opted_in(){this.requestQueue.enable()}_setup_unload_handler(){if(b){var e=()=>{this.requestQueue.unload(),this.retryQueue.unload()};S(b,"beforeunload",e),S(b,"pagehide",e)}}toString(){var e,t=null!==(e=this.configManager.getConfig().name)&&void 0!==e?e:Xt;return t!==Xt&&(t=Xt+"."+t),t}getCurrentDomain(){if(!C)return"";var e=C.protocol,t=C.hostname,i=C.port;return e+"//"+t+(i?":"+i:"")}_is_configured(){var e=this.configManager.getConfig();return!(!e.projectId||!e.token)||(this._has_warned_about_config||(console.warn("VTilt: projectId and token are required for tracking. Events will be skipped until init() or updateConfig() is called with these fields."),this._has_warned_about_config=!0),!1)}buildUrl(){var e=this.configManager.getConfig(),{proxyUrl:t,proxy:i,api_host:r,token:a}=e;return t||(i?i+"/api/tracking?token="+a:r?r.replace(/\/+$/gm,"")+"/api/tracking?token="+a:"/api/tracking?token="+a)}sendRequest(e,t,i){if(this._is_configured()){if(i&&void 0!==b)if(b.__VTILT_ENQUEUE_REQUESTS)return void this.__request_queue.push({url:e,event:t});this.requestQueue.enqueue({url:e,event:t})}}_send_batched_request(e){var{transport:t}=e;"sendBeacon"!==t?this.retryQueue.retriableRequest(e):this._send_beacon_request(e)}_send_http_request(e){return new Promise(t=>{var{url:i,events:r}=e,a=1===r.length?r[0]:{events:r},n=this.configManager.getConfig().disable_compression?Vt.None:Vt.GZipJS;jt({url:i,data:a,method:"POST",transport:"XHR",compression:n,callback:e=>{t({statusCode:e.statusCode})}})})}_send_beacon_request(e){var{url:t,events:i}=e,r=1===i.length?i[0]:{events:i},a=this.configManager.getConfig().disable_compression?Vt.None:Vt.GZipJS;jt({url:t,data:r,method:"POST",transport:"sendBeacon",compression:a})}_send_retriable_request(e){this.sendRequest(e.url,e.event,!1)}capture(e,t,r){if(this.sessionManager.setSessionId(),R&&R.userAgent&&function(e){return!(e&&"string"==typeof e&&e.length>500)}(R.userAgent)&&((null==r?void 0:r.skip_client_rate_limiting)||this.rateLimiter.shouldAllowEvent())){var a=this.buildUrl(),n=Qe(),s=this.userManager.getUserProperties(),o=this.userManager.get_initial_props(),u=this.sessionManager.getSessionId(),c=this.sessionManager.getWindowId(),l=this.userManager.getAnonymousId(),d={};!this._set_once_properties_sent&&Object.keys(o).length>0&&Object.assign(d,o),t.$set_once&&Object.assign(d,t.$set_once);var h=i({},n,s,{$session_id:u,$window_id:c},l?{$anon_distinct_id:l}:{},Object.keys(d).length>0?{$set_once:d}:{},t.$set?{$set:t.$set}:{},t);!this._set_once_properties_sent&&Object.keys(o).length>0&&(this._set_once_properties_sent=!0),"$pageview"===e&&E&&(h.title=E.title);var g,f,v=this.configManager.getConfig();if(!1!==v.stringifyPayload){if(g=Object.assign({},h,v.globalAttributes),!A(g=JSON.stringify(g)))return}else if(g=Object.assign({},h,v.globalAttributes),!A(JSON.stringify(g)))return;f="$identify"===e?this.userManager.getAnonymousId():this.userManager.getDistinctId()||this.userManager.getAnonymousId();var p={timestamp:(new Date).toISOString(),event:e,project_id:v.projectId||"",payload:g,distinct_id:f,anonymous_id:l};this.sendRequest(a,p,!0)}}_capture_internal(e,t){this.capture(e,t,{skip_client_rate_limiting:!0})}trackEvent(e,t){void 0===t&&(t={}),this.capture(e,t)}identify(e,t,i){if("number"==typeof e&&(e=String(e),console.warn("The first argument to vTilt.identify was a number, but it should be a string. It has been converted to a string.")),e)if(this.userManager.isDistinctIdStringLikePublic(e))console.error('The string "'+e+'" was set in vTilt.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if("COOKIELESS_SENTINEL_VALUE"!==e){var r=this.userManager.getDistinctId(),a=this.userManager.getAnonymousId(),n=this.userManager.getDeviceId(),s="anonymous"===this.userManager.getUserState();if(!n){var o=r||a;this.userManager.ensureDeviceId(o)}e!==r&&s?(this.userManager.setUserState("identified"),this.userManager.updateUserProperties(t,i),this.capture("$identify",{distinct_id:e,$anon_distinct_id:a,$set:t||{},$set_once:i||{}}),this.userManager.setDistinctId(e)):t||i?(s&&this.userManager.setUserState("identified"),this.userManager.updateUserProperties(t,i),this.capture("$set",{$set:t||{},$set_once:i||{}})):e!==r&&(this.userManager.setUserState("identified"),this.userManager.setDistinctId(e))}else console.error('The string "'+e+'" was set in vTilt.identify which indicates an error. This ID is only used as a sentinel value.');else console.error("Unique user id has not been set in vTilt.identify")}setUserProperties(e,t){this.userManager.setUserProperties(e,t)&&this.capture("$set",{$set:e||{},$set_once:t||{}})}resetUser(e){this.sessionManager.resetSessionId(),this.userManager.reset(e)}getUserIdentity(){return this.userManager.getUserIdentity()}getDeviceId(){return this.userManager.getDeviceId()}getUserState(){return this.userManager.getUserState()}createAlias(e,t){var i=this.userManager.createAlias(e,t);i?this.capture("$alias",{$original_id:i.original,$alias_id:i.distinct_id}):e===(t||this.userManager.getDistinctId()||this.userManager.getAnonymousId())&&this.identify(e)}_capture_initial_pageview(){E&&("visible"===E.visibilityState?this._initial_pageview_captured||(this._initial_pageview_captured=!0,setTimeout(()=>{if(E&&C){this.capture("$pageview",{navigation_type:"initial_load"})}},300),this._visibility_state_listener&&(E.removeEventListener("visibilitychange",this._visibility_state_listener),this._visibility_state_listener=null)):this._visibility_state_listener||(this._visibility_state_listener=()=>{this._capture_initial_pageview()},S(E,"visibilitychange",this._visibility_state_listener)))}getConfig(){return this.configManager.getConfig()}getSessionId(){return this.sessionManager.getSessionId()}getDistinctId(){return this.userManager.getDistinctId()||this.userManager.getAnonymousId()}getAnonymousId(){return this.userManager.getAnonymousId()}updateConfig(e){this.configManager.updateConfig(e);var t=this.configManager.getConfig();this.sessionManager=new O(t.storage||"cookie",t.cross_subdomain_cookie),this.userManager=new Ze(t.persistence||"localStorage",t.cross_subdomain_cookie),this.webVitalsManager=new Xe(t,this),this.sessionRecording&&t.session_recording&&this.sessionRecording.updateConfig(this._buildSessionRecordingConfig(t))}_initSessionRecording(){var e=this.configManager.getConfig();if(!e.disable_session_recording){var t=this._buildSessionRecordingConfig(e);this.sessionRecording=new it(this,t),t.enabled&&this.sessionRecording.startIfEnabledOrStop("recording_initialized")}}_buildSessionRecordingConfig(e){var t,i,r,a=e.session_recording||{};return{enabled:null!==(t=a.enabled)&&void 0!==t&&t,sampleRate:a.sampleRate,minimumDurationMs:a.minimumDurationMs,sessionIdleThresholdMs:a.sessionIdleThresholdMs,fullSnapshotIntervalMs:a.fullSnapshotIntervalMs,captureConsole:null!==(i=a.captureConsole)&&void 0!==i&&i,captureNetwork:null!==(r=a.captureNetwork)&&void 0!==r&&r,captureCanvas:a.captureCanvas,blockClass:a.blockClass,blockSelector:a.blockSelector,ignoreClass:a.ignoreClass,maskTextClass:a.maskTextClass,maskTextSelector:a.maskTextSelector,maskAllInputs:a.maskAllInputs,maskInputOptions:a.maskInputOptions,masking:a.masking,recordHeaders:a.recordHeaders,recordBody:a.recordBody,compressEvents:a.compressEvents,__mutationThrottlerRefillRate:a.__mutationThrottlerRefillRate,__mutationThrottlerBucketSize:a.__mutationThrottlerBucketSize}}startSessionRecording(){if(!this.sessionRecording){var e=this.configManager.getConfig(),t=this._buildSessionRecordingConfig(e);t.enabled=!0,this.sessionRecording=new it(this,t)}this.sessionRecording.startIfEnabledOrStop("recording_initialized")}stopSessionRecording(){var e;null===(e=this.sessionRecording)||void 0===e||e.stopRecording()}isSessionRecordingActive(){var e;return"active"===(null===(e=this.sessionRecording)||void 0===e?void 0:e.status)}getSessionRecordingId(){var e;return(null===(e=this.sessionRecording)||void 0===e?void 0:e.sessionId)||null}_execute_array(e){Array.isArray(e)&&e.forEach(e=>{if(e&&Array.isArray(e)&&e.length>0){var t=e[0],i=e.slice(1);if("function"==typeof this[t])try{this[t](...i)}catch(e){console.error("vTilt: Error executing queued call "+t+":",e)}}})}_dom_loaded(){this.__request_queue.forEach(e=>{this._send_retriable_request(e)}),this.__request_queue=[],this._start_queue_if_opted_in()}}var Zt={},Xt="vt",Yt=!(void 0!==k||void 0!==P)&&-1===(null==T?void 0:T.indexOf("MSIE"))&&-1===(null==T?void 0:T.indexOf("Mozilla"));null!=b&&(b.__VTILT_ENQUEUE_REQUESTS=Yt);var ei,ti=(ei=Zt[Xt]=new Qt,function(){function e(){e.done||(e.done=!0,Yt=!1,null!=b&&(b.__VTILT_ENQUEUE_REQUESTS=!1),y(Zt,function(e){e._dom_loaded()}))}E&&"function"==typeof E.addEventListener?"complete"===E.readyState?e():S(E,"DOMContentLoaded",e,{capture:!1}):b&&console.error("Browser doesn't support `document.addEventListener` so vTilt couldn't be initialized")}(),ei);export{Qt as VTilt,ti as default,ti as vt};
|
|
1
|
+
function e(e,t,i,r,s,n,o){try{var a=e[n](o),u=a.value}catch(e){return void i(e)}a.done?t(u):Promise.resolve(u).then(r,s)}function t(t){return function(){var i=this,r=arguments;return new Promise(function(s,n){var o=t.apply(i,r);function a(t){e(o,s,n,a,u,"next",t)}function u(t){e(o,s,n,a,u,"throw",t)}a(void 0)})}}function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)({}).hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},i.apply(null,arguments)}class r{constructor(e){void 0===e&&(e={}),this.config=this.parseConfigFromScript(e)}parseConfigFromScript(e){if(!document.currentScript)return i({token:e.token||""},e);var t=document.currentScript,r=i({token:""},e);r.api_host=t.getAttribute("data-api-host")||t.getAttribute("data-host")||e.api_host,r.script_host=t.getAttribute("data-script-host")||e.script_host,r.proxy=t.getAttribute("data-proxy")||e.proxy,r.proxyUrl=t.getAttribute("data-proxy-url")||e.proxyUrl,r.token=t.getAttribute("data-token")||e.token||"",r.projectId=t.getAttribute("data-project-id")||e.projectId||"",r.domain=t.getAttribute("data-domain")||e.domain,r.storage=t.getAttribute("data-storage")||e.storage,r.stringifyPayload="false"!==t.getAttribute("data-stringify-payload");var s="true"===t.getAttribute("data-capture-performance");if(r.capture_performance=!!s||e.capture_performance,r.proxy&&r.proxyUrl)throw console.error("Error: Both data-proxy and data-proxy-url are specified. Please use only one of them."),new Error("Both data-proxy and data-proxy-url are specified. Please use only one of them.");for(var n of(r.globalAttributes=i({},e.globalAttributes),Array.from(t.attributes)))n.name.startsWith("data-vt-")&&(r.globalAttributes[n.name.slice(8).replace(/-/g,"_")]=n.value);return r}getConfig(){return i({},this.config)}updateConfig(e){this.config=i({},this.config,e)}}var s="__vt_session",n="__vt_window_id",o="__vt_primary_window",a="__vt_user_state",u="__vt_device_id",l="__vt_anonymous_id",d="__vt_distinct_id",h="__vt_user_properties",c="localStorage",g="localStorage+cookie",v="sessionStorage",f="memory",_="$initial_person_info";function p(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(+e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+e/4).toString(16))}function m(e){return!(!e||"string"!=typeof e)&&!(e.length<2||e.length>10240)}function y(e,t,i){if(e)if(Array.isArray(e))e.forEach((e,r)=>{t.call(i,e,r)});else for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.call(i,e[r],r)}function w(e,t,i,r){var{capture:s=!1,passive:n=!0}=null!=r?r:{};null==e||e.addEventListener(t,i,{capture:s,passive:n})}function b(e,t){if(!t)return e;for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}function S(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];for(var s of i)for(var n of s)e.push(n);return e}var I="undefined"!=typeof window?window:void 0,T="undefined"!=typeof globalThis?globalThis:I,M=null==T?void 0:T.navigator,E=null==T?void 0:T.document,R=null==T?void 0:T.location,C=null==T?void 0:T.fetch,k=(null==T?void 0:T.XMLHttpRequest)&&"withCredentials"in new T.XMLHttpRequest?T.XMLHttpRequest:void 0;null==T||T.AbortController;var x=null==M?void 0:M.userAgent,P=null!=I?I:{},L=31536e3,A=["herokuapp.com","vercel.app","netlify.app"];function O(e){var t;if(!e)return"";if("undefined"==typeof document)return"";var i=null===(t=document.location)||void 0===t?void 0:t.hostname;if(!i)return"";var r=i.match(/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i);return r?"."+r[0]:""}class ${constructor(e){var t,i;this.memoryStorage=new Map,this.method=e.method,this.cross_subdomain=null!==(t=e.cross_subdomain)&&void 0!==t?t:function(){var e;if("undefined"==typeof document)return!1;var t=null===(e=document.location)||void 0===e?void 0:e.hostname;if(!t)return!1;var i=t.split(".").slice(-2).join(".");for(var r of A)if(i===r)return!1;return!0}(),this.sameSite=e.sameSite||"Lax",this.secure=null!==(i=e.secure)&&void 0!==i?i:"undefined"!=typeof location&&"https:"===location.protocol}get(e){var t;try{if(this.method===f)return null!==(t=this.memoryStorage.get(e))&&void 0!==t?t:null;if(this.usesLocalStorage()){var i=localStorage.getItem(e);return null!==i?i:this.method===g?this.getCookie(e):null}return this.usesSessionStorage()?sessionStorage.getItem(e):this.getCookie(e)}catch(t){return console.warn('[StorageManager] Failed to get "'+e+'":',t),null}}set(e,t,i){try{if(this.method===f)return void this.memoryStorage.set(e,t);if(this.usesLocalStorage())return localStorage.setItem(e,t),void(this.method===g&&this.setCookie(e,t,i||L));if(this.usesSessionStorage())return void sessionStorage.setItem(e,t);this.setCookie(e,t,i||L)}catch(t){console.warn('[StorageManager] Failed to set "'+e+'":',t)}}remove(e){try{if(this.method===f)return void this.memoryStorage.delete(e);if(this.usesLocalStorage())return localStorage.removeItem(e),void(this.method===g&&this.removeCookie(e));if(this.usesSessionStorage())return void sessionStorage.removeItem(e);this.removeCookie(e)}catch(t){console.warn('[StorageManager] Failed to remove "'+e+'":',t)}}getWithExpiry(e){var t=this.get(e);if(!t)return null;try{var i=JSON.parse(t);return i.expiry&&Date.now()>i.expiry?(this.remove(e),null):i.value}catch(e){return null}}setWithExpiry(e,t,r){var s=i({value:t},r?{expiry:Date.now()+r}:{});this.set(e,JSON.stringify(s))}getJSON(e){var t=this.get(e);if(!t)return null;try{return JSON.parse(t)}catch(e){return null}}setJSON(e,t,i){this.set(e,JSON.stringify(t),i)}getCookie(e){if("undefined"==typeof document)return null;var t=document.cookie.split(";");for(var i of t){var[r,...s]=i.trim().split("=");if(r===e){var n=s.join("=");try{return decodeURIComponent(n)}catch(e){return n}}}return null}setCookie(e,t,i){if("undefined"!=typeof document){var r=e+"="+encodeURIComponent(t);r+="; Max-Age="+i,r+="; path=/",r+="; SameSite="+this.sameSite,this.secure&&(r+="; Secure");var s=O(this.cross_subdomain);s&&(r+="; domain="+s),document.cookie=r}}removeCookie(e){if("undefined"!=typeof document){var t=O(this.cross_subdomain),i=e+"=; Max-Age=0; path=/";t&&(i+="; domain="+t),document.cookie=i,document.cookie=e+"=; Max-Age=0; path=/"}}usesLocalStorage(){return this.method===c||this.method===g}usesSessionStorage(){return this.method===v}canUseSessionStorage(){if(void 0===I||!(null==I?void 0:I.sessionStorage))return!1;try{var e="__vt_storage_test__";return I.sessionStorage.setItem(e,"test"),I.sessionStorage.removeItem(e),!0}catch(e){return!1}}getSessionStorage(){var e;return this.canUseSessionStorage()&&null!==(e=null==I?void 0:I.sessionStorage)&&void 0!==e?e:null}setMethod(e){this.method=e}getMethod(){return this.method}}class q{constructor(e,t){void 0===e&&(e="cookie"),this.storage=new $({method:e,cross_subdomain:t,sameSite:"Lax"}),this._windowId=void 0,this._initializeWindowId()}getSessionId(){var e=this._getSessionIdRaw();return e||(e=p(),this._storeSessionId(e)),e}setSessionId(){var e=this._getSessionIdRaw()||p();return this._storeSessionId(e),e}resetSessionId(){this._clearSessionId(),this.setSessionId(),this._setWindowId(p())}_getSessionIdRaw(){return this.storage.get(s)}_storeSessionId(e){this.storage.set(s,e,1800)}_clearSessionId(){this.storage.remove(s)}getWindowId(){if(this._windowId)return this._windowId;var e=this.storage.getSessionStorage();if(e){var t=e.getItem(n);if(t)return this._windowId=t,t}var i=p();return this._setWindowId(i),i}_setWindowId(e){if(e!==this._windowId){this._windowId=e;var t=this.storage.getSessionStorage();t&&t.setItem(n,e)}}_initializeWindowId(){var e=this.storage.getSessionStorage();if(e){var t=e.getItem(o),i=e.getItem(n);i&&!t?this._windowId=i:(i&&e.removeItem(n),this._setWindowId(p())),e.setItem(o,"true"),this._listenToUnload()}else this._windowId=p()}_listenToUnload(){var e=this.storage.getSessionStorage();I&&e&&w(I,"beforeunload",()=>{var e=this.storage.getSessionStorage();e&&e.removeItem(o)},{capture:!1})}updateStorageMethod(e,t){this.storage=new $({method:e,cross_subdomain:t,sameSite:"Lax"})}}function U(e){if(!E)return null;var t=E.createElement("a");return t.href=e,t}function D(e,t){for(var i=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<i.length;r++){var s=i[r].split("=");if(s[0]===t){if(s.length<2)return"";var n=s[1];try{n=decodeURIComponent(n)}catch(e){}return n.replace(/\+/g," ")}}return""}function B(e,t,i){if(!e||!t||!t.length)return e;for(var r=e.split("#"),s=r[0]||"",n=r[1],o=s.split("?"),a=o[1],u=o[0],l=(a||"").split("&"),d=[],h=0;h<l.length;h++){var c=l[h].split("="),g=c[0],v=c.slice(1).join("=");-1!==t.indexOf(g)?d.push(g+"="+i):g&&d.push(g+(v?"="+v:""))}var f=d.join("&");return u+(f?"?"+f:"")+(n?"#"+n:"")}function z(e){return"function"==typeof e}var N="Mobile",j="iOS",W="Android",F="Tablet",V=W+" "+F,J="iPad",H="Apple",Q=H+" Watch",X="Safari",K="BlackBerry",G="Samsung",Z=G+"Browser",Y=G+" Internet",ee="Chrome",te=ee+" OS",ie=ee+" "+j,re="Internet Explorer",se=re+" "+N,ne="Opera",oe=ne+" Mini",ae="Edge",ue="Microsoft "+ae,le="Firefox",de=le+" "+j,he="Nintendo",ce="PlayStation",ge="Xbox",ve=W+" "+N,fe=N+" "+X,_e="Windows",pe=_e+" Phone",me="Nokia",ye="Ouya",we="Generic",be=we+" "+N.toLowerCase(),Se=we+" "+F.toLowerCase(),Ie="Konqueror",Te="(\\d+(\\.\\d+)?)",Me=new RegExp("Version/"+Te),Ee=new RegExp(ge,"i"),Re=new RegExp(ce+" \\w+","i"),Ce=new RegExp(he+" \\w+","i"),ke=new RegExp(K+"|PlayBook|BB10","i"),xe={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};function Pe(e,t){return e.toLowerCase().includes(t.toLowerCase())}var Le=(e,t)=>t&&Pe(t,H)||function(e){return Pe(e,X)&&!Pe(e,ee)&&!Pe(e,W)}(e),Ae=function(e,t){return t=t||"",Pe(e," OPR/")&&Pe(e,"Mini")?oe:Pe(e," OPR/")?ne:ke.test(e)?K:Pe(e,"IE"+N)||Pe(e,"WPDesktop")?se:Pe(e,Z)?Y:Pe(e,ae)||Pe(e,"Edg/")?ue:Pe(e,"FBIOS")?"Facebook "+N:Pe(e,"UCWEB")||Pe(e,"UCBrowser")?"UC Browser":Pe(e,"CriOS")?ie:Pe(e,"CrMo")||Pe(e,ee)?ee:Pe(e,W)&&Pe(e,X)?ve:Pe(e,"FxiOS")?de:Pe(e.toLowerCase(),Ie.toLowerCase())?Ie:Le(e,t)?Pe(e,N)?fe:X:Pe(e,le)?le:Pe(e,"MSIE")||Pe(e,"Trident/")?re:Pe(e,"Gecko")?le:""},Oe={[se]:[new RegExp("rv:"+Te)],[ue]:[new RegExp(ae+"?\\/"+Te)],[ee]:[new RegExp("("+ee+"|CrMo)\\/"+Te)],[ie]:[new RegExp("CriOS\\/"+Te)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Te)],[X]:[Me],[fe]:[Me],[ne]:[new RegExp("(Opera|OPR)\\/"+Te)],[le]:[new RegExp(le+"\\/"+Te)],[de]:[new RegExp("FxiOS\\/"+Te)],[Ie]:[new RegExp("Konqueror[:/]?"+Te,"i")],[K]:[new RegExp(K+" "+Te),Me],[ve]:[new RegExp("android\\s"+Te,"i")],[Y]:[new RegExp(Z+"\\/"+Te)],[re]:[new RegExp("(rv:|MSIE )"+Te)],Mozilla:[new RegExp("rv:"+Te)]},$e=function(e,t){var i=Ae(e,t),r=Oe[i];if(void 0===r)return null;for(var s=0;s<r.length;s++){var n=r[s],o=e.match(n);if(o)return parseFloat(o[o.length-2])}return null},qe=[[new RegExp(ge+"; "+ge+" (.*?)[);]","i"),e=>[ge,e&&e[1]||""]],[new RegExp(he,"i"),[he,""]],[new RegExp(ce,"i"),[ce,""]],[ke,[K,""]],[new RegExp(_e,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[pe,""];if(new RegExp(N).test(t)&&!/IEMobile\b/.test(t))return[_e+" "+N,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var r=i[1],s=xe[r]||"";return/arm/i.test(t)&&(s="RT"),[_e,s]}return[_e,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[j,t.join(".")]}return[j,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=void 0===e[2]?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+W+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+W+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[W,t.join(".")]}return[W,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var i=[e[1],e[2],e[3]||"0"];t[1]=i.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[te,""]],[/Linux|debian/i,["Linux",""]]],Ue=function(e){return Ce.test(e)?he:Re.test(e)?ce:Ee.test(e)?ge:new RegExp(ye,"i").test(e)?ye:new RegExp("("+pe+"|WPDesktop)","i").test(e)?pe:/iPad/.test(e)?J:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Q:ke.test(e)?K:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(me,"i").test(e)?me:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?!new RegExp(N).test(e)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)?/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?W:V:W:new RegExp("(pda|"+N+")","i").test(e)?be:new RegExp(F,"i").test(e)&&!new RegExp(F+" pc","i").test(e)?Se:""},De="https?://(.*)",Be=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],ze=S(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Be),Ne="<masked>";function je(e){var t=function(e){return e?0===e.search(De+"google.([^/?]*)")?"google":0===e.search(De+"bing.com")?"bing":0===e.search(De+"yahoo.com")?"yahoo":0===e.search(De+"duckduckgo.com")?"duckduckgo":null:null}(e),i="yahoo"!==t?"q":"p",r={};if(null!==t){r.$search_engine=t;var s=E?D(E.referrer,i):"";s.length&&(r.ph_keyword=s)}return r}function We(){if("undefined"!=typeof navigator)return navigator.language||navigator.userLanguage}function Fe(){return(null==E?void 0:E.referrer)||"$direct"}function Ve(){var e;return(null==E?void 0:E.referrer)&&(null===(e=U(E.referrer))||void 0===e?void 0:e.host)||"$direct"}function Je(e){var t,{r:i,u:r}=e,s={$referrer:i,$referring_domain:null==i?void 0:"$direct"===i?"$direct":null===(t=U(i))||void 0===t?void 0:t.host};if(r){s.$current_url=r;var n=U(r);s.$host=null==n?void 0:n.host,s.$pathname=null==n?void 0:n.pathname;var o=function(e){var t=ze.concat([]),i={};return y(t,function(t){var r=D(e,t);i[t]=r||null}),i}(r);b(s,o)}i&&b(s,je(i));return s}function He(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function Qe(){try{return(new Date).getTimezoneOffset()}catch(e){return}}function Xe(e,t){if(!x)return{};var i,r,s,[n,o]=function(e){for(var t=0;t<qe.length;t++){var[i,r]=qe[t],s=i.exec(e),n=s&&(z(r)?r(s,e):r);if(n)return n}return["",""]}(x);return b(function(e){var t={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var r=e[i];null!=r&&""!==r&&(t[i]=r)}return t}({$os:n,$os_version:o,$browser:Ae(x,navigator.vendor),$device:Ue(x),$device_type:(r=x,s=Ue(r),s===J||s===V||"Kobo"===s||"Kindle Fire"===s||s===Se?F:s===he||s===ge||s===ce||s===ye?"Console":s===Q?"Wearable":s?N:"Desktop"),$timezone:He(),$timezone_offset:Qe()}),{$current_url:B(null==R?void 0:R.href,[],Ne),$host:null==R?void 0:R.host,$pathname:null==R?void 0:R.pathname,$raw_user_agent:x.length>1e3?x.substring(0,997)+"...":x,$browser_version:$e(x,navigator.vendor),$browser_language:We(),$browser_language_prefix:(i=We(),"string"==typeof i?i.split("-")[0]:void 0),$screen_height:null==I?void 0:I.screen.height,$screen_width:null==I?void 0:I.screen.width,$viewport_height:null==I?void 0:I.innerHeight,$viewport_width:null==I?void 0:I.innerWidth,$lib:"web",$lib_version:"1.0.7",$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}class Ke{constructor(e,t){void 0===e&&(e="localStorage"),this._cachedPersonProperties=null,this.storage=new $({method:e,cross_subdomain:t,sameSite:"Lax"}),this.userIdentity=this.loadUserIdentity()}getUserIdentity(){return i({},this.userIdentity)}getDistinctId(){return this.userIdentity.distinct_id}getAnonymousId(){return this.userIdentity.anonymous_id||(this.userIdentity.anonymous_id=this.generateAnonymousId(),this.storage.set(l,this.userIdentity.anonymous_id,L)),this.userIdentity.anonymous_id}getUserProperties(){return i({},this.userIdentity.properties)}getEffectiveId(){return this.userIdentity.distinct_id||this.getAnonymousId()}getDeviceId(){return this.userIdentity.device_id}getUserState(){return this.userIdentity.user_state}identify(e,t,r){if("number"==typeof e&&(e=e.toString(),console.warn("The first argument to vTilt.identify was a number, but it should be a string. It has been converted to a string.")),e)if(this.isDistinctIdStringLike(e))console.error('The string "'+e+'" was set in vTilt.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if("COOKIELESS_SENTINEL_VALUE"!==e){var s=this.userIdentity.distinct_id;if(this.userIdentity.distinct_id=e,!this.userIdentity.device_id){var n=s||this.userIdentity.anonymous_id;this.userIdentity.device_id=n,this.userIdentity.properties=i({},this.userIdentity.properties,{$had_persisted_distinct_id:!0,$device_id:n})}e!==s&&(this.userIdentity.distinct_id=e);var o="anonymous"===this.userIdentity.user_state;e!==s&&o?(this.userIdentity.user_state="identified",t&&(this.userIdentity.properties=i({},this.userIdentity.properties,t)),r&&Object.keys(r).forEach(e=>{e in this.userIdentity.properties||(this.userIdentity.properties[e]=r[e])}),this.saveUserIdentity()):t||r?("anonymous"===this.userIdentity.user_state&&(this.userIdentity.user_state="identified"),t&&(this.userIdentity.properties=i({},this.userIdentity.properties,t)),r&&Object.keys(r).forEach(e=>{e in this.userIdentity.properties||(this.userIdentity.properties[e]=r[e])}),this.saveUserIdentity()):e!==s&&(this.userIdentity.user_state="identified",this.saveUserIdentity())}else console.error('The string "'+e+'" was set in vTilt.identify which indicates an error. This ID is only used as a sentinel value.');else console.error("Unique user id has not been set in vTilt.identify")}setUserProperties(e,t){if(!e&&!t)return!1;var r=this.userIdentity.distinct_id||this.userIdentity.anonymous_id,s=this.getPersonPropertiesHash(r,e,t);return this._cachedPersonProperties===s?(console.info("VTilt: A duplicate setUserProperties call was made with the same properties. It has been ignored."),!1):(e&&(this.userIdentity.properties=i({},this.userIdentity.properties,e)),t&&Object.keys(t).forEach(e=>{e in this.userIdentity.properties||(this.userIdentity.properties[e]=t[e])}),this.saveUserIdentity(),this._cachedPersonProperties=s,!0)}reset(e){var t=this.generateAnonymousId(),r=this.userIdentity.device_id,s=e?this.generateDeviceId():r;this.userIdentity={distinct_id:null,anonymous_id:t,device_id:s,properties:{},user_state:"anonymous"},this._cachedPersonProperties=null,this.saveUserIdentity(),this.userIdentity.properties=i({},this.userIdentity.properties,{$last_vtilt_reset:(new Date).toISOString()}),this.saveUserIdentity()}setDistinctId(e){this.userIdentity.distinct_id=e,this.saveUserIdentity()}setUserState(e){this.userIdentity.user_state=e,this.saveUserIdentity()}updateUserProperties(e,t){e&&(this.userIdentity.properties=i({},this.userIdentity.properties,e)),t&&Object.keys(t).forEach(e=>{e in this.userIdentity.properties||(this.userIdentity.properties[e]=t[e])}),this.saveUserIdentity()}ensureDeviceId(e){this.userIdentity.device_id||(this.userIdentity.device_id=e,this.userIdentity.properties=i({},this.userIdentity.properties,{$had_persisted_distinct_id:!0,$device_id:e}),this.saveUserIdentity())}createAlias(e,t){return this.isValidDistinctId(e)?(void 0===t&&(t=this.getDistinctId()||this.getAnonymousId()),this.isValidDistinctId(t)?e===t?(console.warn("alias matches current distinct_id - should use identify instead"),null):{distinct_id:e,original:t}:(console.warn("Invalid original distinct ID"),null)):(console.warn("Invalid alias provided"),null)}isDistinctIdStringLikePublic(e){return this.isDistinctIdStringLike(e)}set_initial_person_info(e,t){if(!this.getStoredUserProperties()[_]){var i=function(e,t){var i=e?S([],Be,t||[]):[],r=null==R?void 0:R.href.substring(0,1e3);return{r:Fe().substring(0,1e3),u:r?B(r,i,Ne):void 0}}(e,t);this.register_once({[_]:i},void 0)}}get_initial_props(){var e,t,i=this.getStoredUserProperties()[_];return i?(e=Je(i),t={},y(e,function(e,i){var r;t["$initial_"+(r=String(i),r.startsWith("$")?r.substring(1):r)]=e}),t):{}}update_referrer_info(){var e={$referrer:Fe(),$referring_domain:Ve()};this.register_once(e,void 0)}loadUserIdentity(){var e=this.storage.get(l)||this.generateAnonymousId(),t=this.storage.get(d)||null,i=this.storage.get(u)||this.generateDeviceId(),r=this.getStoredUserProperties(),s=this.storage.get(a)||"anonymous";return{distinct_id:t,anonymous_id:e||this.generateAnonymousId(),device_id:i,properties:r,user_state:s}}saveUserIdentity(){this.storage.set(l,this.userIdentity.anonymous_id,L),this.storage.set(u,this.userIdentity.device_id,L),this.storage.set(a,this.userIdentity.user_state,L),this.userIdentity.distinct_id?this.storage.set(d,this.userIdentity.distinct_id,L):this.storage.remove(d),this.setStoredUserProperties(this.userIdentity.properties)}getStoredUserProperties(){return this.storage.getJSON(h)||{}}setStoredUserProperties(e){this.storage.setJSON(h,e,L)}register_once(e,t){var i=this.getStoredUserProperties(),r=!1;for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(s in i||(i[s]=e[s],r=!0));if(t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(n in i||(i[n]=t[n],r=!0));r&&this.setStoredUserProperties(i)}generateAnonymousId(){return"anon_"+p()}generateDeviceId(){return"device_"+p()}getPersonPropertiesHash(e,t,i){return JSON.stringify({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}isValidDistinctId(e){if(!e||"string"!=typeof e)return!1;var t=e.toLowerCase().trim();return!["null","undefined","false","true","anonymous","anon","user","test","guest","visitor","unknown","none"].includes(t)&&0!==e.trim().length}isDistinctIdStringLike(e){if(!e||"string"!=typeof e)return!1;var t=e.toLowerCase().trim();return["null","undefined","false","true","anonymous","anon","user","test","guest","visitor","unknown","none","demo","example","sample","placeholder"].includes(t)}updateStorageMethod(e,t){this.storage=new $({method:e,cross_subdomain:t,sameSite:"Lax"}),this.userIdentity=this.loadUserIdentity()}}var Ge=["LCP","CLS","FCP","INP","TTFB"],Ze=["LCP","CLS","FCP","INP"],Ye=9e5,et="[WebVitals]";class tt{constructor(e,t){this.initialized=!1,this.instance=t,this.buffer=this.createEmptyBuffer(),this.config=this.parseConfig(e.capture_performance),this.isEnabled&&I&&this.startIfEnabled()}parseConfig(e){return"boolean"==typeof e?{web_vitals:e}:"object"==typeof e&&null!==e?e:{web_vitals:!1}}get isEnabled(){var e=null==R?void 0:R.protocol;return("http:"===e||"https:"===e)&&!1!==this.config.web_vitals}get allowedMetrics(){return this.config.web_vitals_allowed_metrics||Ze}get flushTimeoutMs(){return this.config.web_vitals_delayed_flush_ms||5e3}get maxAllowedValue(){var e=this.config.__web_vitals_max_value;return void 0===e?Ye:0===e?0:e<6e4?Ye:e}createEmptyBuffer(){return{url:void 0,pathname:void 0,metrics:[],firstMetricTimestamp:void 0}}getWebVitalsCallbacks(){var e;return null===(e=P.__VTiltExtensions__)||void 0===e?void 0:e.webVitalsCallbacks}startIfEnabled(){if(this.isEnabled&&!this.initialized){var e=this.getWebVitalsCallbacks();e?this.startCapturing(e):this.loadWebVitals()}}loadWebVitals(){var e,t=null===(e=P.__VTiltExtensions__)||void 0===e?void 0:e.loadExternalDependency;t?t(this.instance,"web-vitals",e=>{if(e)console.error(et+" Failed to load web-vitals:",e);else{var t=this.getWebVitalsCallbacks();t?this.startCapturing(t):console.error(et+" web-vitals loaded but callbacks not registered")}}):console.warn(et+" External dependency loader not available. Include web-vitals.ts entrypoint or use array.full.js bundle.")}startCapturing(e){if(!this.initialized){var t=this.allowedMetrics,i=this.addToBuffer.bind(this);t.includes("LCP")&&e.onLCP&&e.onLCP(i),t.includes("CLS")&&e.onCLS&&e.onCLS(i,{reportAllChanges:!0}),t.includes("FCP")&&e.onFCP&&e.onFCP(i),t.includes("INP")&&e.onINP&&e.onINP(i),t.includes("TTFB")&&e.onTTFB&&e.onTTFB(i),this.initialized=!0}}getCurrentUrl(){var e;return null===(e=null==I?void 0:I.location)||void 0===e?void 0:e.href}getCurrentPathname(){return null==R?void 0:R.pathname}addToBuffer(e){try{if(!I||!E||!R)return;if(!(null==e?void 0:e.name)||void 0===(null==e?void 0:e.value))return void console.warn(et+" Invalid metric received",e);if(this.maxAllowedValue>0&&e.value>=this.maxAllowedValue&&"CLS"!==e.name)return void console.warn(et+" Ignoring "+e.name+" with value >= "+this.maxAllowedValue+"ms");var t=this.getCurrentUrl(),r=this.getCurrentPathname();if(!t)return void console.warn(et+" Could not determine current URL");this.buffer.url&&this.buffer.url!==t&&this.flush(),this.buffer.url||(this.buffer.url=t,this.buffer.pathname=r),this.buffer.firstMetricTimestamp||(this.buffer.firstMetricTimestamp=Date.now());var s=this.cleanAttribution(e.attribution),n=this.instance.getSessionId(),o=this.getWindowId(),a=i({},e,{attribution:s,timestamp:Date.now(),$current_url:t,$session_id:n,$window_id:o}),u=this.buffer.metrics.findIndex(t=>t.name===e.name);u>=0?this.buffer.metrics[u]=a:this.buffer.metrics.push(a),this.scheduleFlush(),this.buffer.metrics.length>=this.allowedMetrics.length&&this.flush()}catch(e){console.error(et+" Error adding metric to buffer:",e)}}cleanAttribution(e){if(e){var t=i({},e);return"interactionTargetElement"in t&&delete t.interactionTargetElement,t}}getWindowId(){var e;try{return(null===(e=this.instance.sessionManager)||void 0===e?void 0:e.getWindowId())||null}catch(e){return null}}scheduleFlush(){this.flushTimer&&clearTimeout(this.flushTimer),this.flushTimer=setTimeout(()=>{this.flush()},this.flushTimeoutMs)}flush(){if(this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=void 0),0!==this.buffer.metrics.length){try{var e={$pathname:this.buffer.pathname,$current_url:this.buffer.url};for(var t of this.buffer.metrics)e["$web_vitals_"+t.name+"_value"]=t.value,e["$web_vitals_"+t.name+"_event"]={name:t.name,value:t.value,delta:t.delta,rating:t.rating,id:t.id,navigationType:t.navigationType,attribution:t.attribution,$session_id:t.$session_id,$window_id:t.$window_id};this.instance.capture("$web_vitals",e)}catch(e){console.error(et+" Error flushing metrics:",e)}this.buffer=this.createEmptyBuffer()}}}function it(e,t,i){try{if(!(t in e))return()=>{};var r=e[t],s=i(r);return z(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__vtilt_wrapped__:{enumerable:!1,value:!0}})),e[t]=s,()=>{e[t]=r}}catch(e){return()=>{}}}class rt{constructor(e){var t;this._instance=e,this._lastPathname=(null===(t=null==I?void 0:I.location)||void 0===t?void 0:t.pathname)||""}get isEnabled(){return!0}startIfEnabled(){this.isEnabled&&this.monitorHistoryChanges()}stop(){this._popstateListener&&this._popstateListener(),this._popstateListener=void 0}monitorHistoryChanges(){var e,t;if(I&&R&&(this._lastPathname=R.pathname||"",I.history)){var i=this;(null===(e=I.history.pushState)||void 0===e?void 0:e.__vtilt_wrapped__)||it(I.history,"pushState",e=>function(t,r,s){e.call(this,t,r,s),i._capturePageview("pushState")}),(null===(t=I.history.replaceState)||void 0===t?void 0:t.__vtilt_wrapped__)||it(I.history,"replaceState",e=>function(t,r,s){e.call(this,t,r,s),i._capturePageview("replaceState")}),this._setupPopstateListener()}}_capturePageview(e){var t;try{var i=null===(t=null==I?void 0:I.location)||void 0===t?void 0:t.pathname;if(!i||!R||!E)return;if(i!==this._lastPathname&&this.isEnabled){var r={navigation_type:e};this._instance.capture("$pageview",r)}this._lastPathname=i}catch(t){console.error("Error capturing "+e+" pageview",t)}}_setupPopstateListener(){if(!this._popstateListener&&I){var e=()=>{this._capturePageview("popstate")};w(I,"popstate",e),this._popstateListener=()=>{I&&I.removeEventListener("popstate",e)}}}}var st="[SessionRecording]";class nt{constructor(e,t){void 0===t&&(t={}),this._instance=e,this._config=t}get started(){var e;return!!(null===(e=this._lazyLoadedRecording)||void 0===e?void 0:e.isStarted)}get status(){var e;return(null===(e=this._lazyLoadedRecording)||void 0===e?void 0:e.status)||"lazy_loading"}get sessionId(){var e;return(null===(e=this._lazyLoadedRecording)||void 0===e?void 0:e.sessionId)||""}startIfEnabledOrStop(e){var t;if(!this._isRecordingEnabled||!(null===(t=this._lazyLoadedRecording)||void 0===t?void 0:t.isStarted)){var i=void 0!==Object.assign&&void 0!==Array.from;this._isRecordingEnabled&&i?(this._lazyLoadAndStart(e),console.info(st+" starting")):this.stopRecording()}}stopRecording(){var e;null===(e=this._lazyLoadedRecording)||void 0===e||e.stop()}log(e,t){var i;void 0===t&&(t="log"),(null===(i=this._lazyLoadedRecording)||void 0===i?void 0:i.log)?this._lazyLoadedRecording.log(e,t):console.warn(st+" log called before recorder was ready")}updateConfig(e){var t;this._config=i({},this._config,e),null===(t=this._lazyLoadedRecording)||void 0===t||t.updateConfig(this._config)}get _isRecordingEnabled(){var e,t=this._instance.getConfig(),i=null!==(e=this._config.enabled)&&void 0!==e&&e,r=!t.disable_session_recording;return!!I&&i&&r}get _scriptName(){return"recorder"}_lazyLoadAndStart(e){var t,i,r,s;if(this._isRecordingEnabled)if((null===(i=null===(t=null==P?void 0:P.__VTiltExtensions__)||void 0===t?void 0:t.rrweb)||void 0===i?void 0:i.record)&&(null===(r=P.__VTiltExtensions__)||void 0===r?void 0:r.initSessionRecording))this._onScriptLoaded(e);else{var n=null===(s=P.__VTiltExtensions__)||void 0===s?void 0:s.loadExternalDependency;n?n(this._instance,this._scriptName,t=>{t?console.error(st+" could not load recorder:",t):this._onScriptLoaded(e)}):console.error(st+" loadExternalDependency not available. Session recording cannot start.")}}_onScriptLoaded(e){var t,i=null===(t=P.__VTiltExtensions__)||void 0===t?void 0:t.initSessionRecording;i?(this._lazyLoadedRecording||(this._lazyLoadedRecording=i(this._instance,this._config)),this._lazyLoadedRecording.start(e)):console.error(st+" initSessionRecording not available after script load")}}var ot=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(ot||{}),at=Uint8Array,ut=Uint16Array,lt=Int32Array,dt=new at([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ht=new at([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ct=new at([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),gt=function(e,t){for(var i=new ut(31),r=0;r<31;++r)i[r]=t+=1<<e[r-1];var s=new lt(i[30]);for(r=1;r<30;++r)for(var n=i[r];n<i[r+1];++n)s[n]=n-i[r]<<5|r;return{b:i,r:s}},vt=gt(dt,2),ft=vt.b,_t=vt.r;ft[28]=258,_t[258]=28;for(var pt=gt(ht,0).r,mt=new ut(32768),yt=0;yt<32768;++yt){var wt=(43690&yt)>>1|(21845&yt)<<1;wt=(61680&(wt=(52428&wt)>>2|(13107&wt)<<2))>>4|(3855&wt)<<4,mt[yt]=((65280&wt)>>8|(255&wt)<<8)>>1}var bt=function(e,t,i){for(var r=e.length,s=0,n=new ut(t);s<r;++s)e[s]&&++n[e[s]-1];var o,a=new ut(t);for(s=1;s<t;++s)a[s]=a[s-1]+n[s-1]<<1;if(i){o=new ut(1<<t);var u=15-t;for(s=0;s<r;++s)if(e[s])for(var l=s<<4|e[s],d=t-e[s],h=a[e[s]-1]++<<d,c=h|(1<<d)-1;h<=c;++h)o[mt[h]>>u]=l}else for(o=new ut(r),s=0;s<r;++s)e[s]&&(o[s]=mt[a[e[s]-1]++]>>15-e[s]);return o},St=new at(288);for(yt=0;yt<144;++yt)St[yt]=8;for(yt=144;yt<256;++yt)St[yt]=9;for(yt=256;yt<280;++yt)St[yt]=7;for(yt=280;yt<288;++yt)St[yt]=8;var It=new at(32);for(yt=0;yt<32;++yt)It[yt]=5;var Tt=bt(St,9,0),Mt=bt(It,5,0),Et=function(e){return(e+7)/8|0},Rt=function(e,t,i){return(null==i||i>e.length)&&(i=e.length),new at(e.subarray(t,i))},Ct=function(e,t,i){i<<=7&t;var r=t/8|0;e[r]|=i,e[r+1]|=i>>8},kt=function(e,t,i){i<<=7&t;var r=t/8|0;e[r]|=i,e[r+1]|=i>>8,e[r+2]|=i>>16},xt=function(e,t){for(var i=[],r=0;r<e.length;++r)e[r]&&i.push({s:r,f:e[r]});var s=i.length,n=i.slice();if(!s)return{t:Ut,l:0};if(1==s){var o=new at(i[0].s+1);return o[i[0].s]=1,{t:o,l:1}}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var a=i[0],u=i[1],l=0,d=1,h=2;for(i[0]={s:-1,f:a.f+u.f,l:a,r:u};d!=s-1;)a=i[i[l].f<i[h].f?l++:h++],u=i[l!=d&&i[l].f<i[h].f?l++:h++],i[d++]={s:-1,f:a.f+u.f,l:a,r:u};var c=n[0].s;for(r=1;r<s;++r)n[r].s>c&&(c=n[r].s);var g=new ut(c+1),v=Pt(i[d-1],g,0);if(v>t){r=0;var f=0,_=v-t,p=1<<_;for(n.sort(function(e,t){return g[t.s]-g[e.s]||e.f-t.f});r<s;++r){var m=n[r].s;if(!(g[m]>t))break;f+=p-(1<<v-g[m]),g[m]=t}for(f>>=_;f>0;){var y=n[r].s;g[y]<t?f-=1<<t-g[y]++-1:++r}for(;r>=0&&f;--r){var w=n[r].s;g[w]==t&&(--g[w],++f)}v=t}return{t:new at(g),l:v}},Pt=function(e,t,i){return-1==e.s?Math.max(Pt(e.l,t,i+1),Pt(e.r,t,i+1)):t[e.s]=i},Lt=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new ut(++t),r=0,s=e[0],n=1,o=function(e){i[r++]=e},a=1;a<=t;++a)if(e[a]==s&&a!=t)++n;else{if(!s&&n>2){for(;n>138;n-=138)o(32754);n>2&&(o(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(o(s),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(s);n=1,s=e[a]}return{c:i.subarray(0,r),n:t}},At=function(e,t){for(var i=0,r=0;r<t.length;++r)i+=e[r]*t[r];return i},Ot=function(e,t,i){var r=i.length,s=Et(t+2);e[s]=255&r,e[s+1]=r>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var n=0;n<r;++n)e[s+n+4]=i[n];return 8*(s+4+r)},$t=function(e,t,i,r,s,n,o,a,u,l,d){Ct(t,d++,i),++s[256];for(var h=xt(s,15),c=h.t,g=h.l,v=xt(n,15),f=v.t,_=v.l,p=Lt(c),m=p.c,y=p.n,w=Lt(f),b=w.c,S=w.n,I=new ut(19),T=0;T<m.length;++T)++I[31&m[T]];for(T=0;T<b.length;++T)++I[31&b[T]];for(var M=xt(I,7),E=M.t,R=M.l,C=19;C>4&&!E[ct[C-1]];--C);var k,x,P,L,A=l+5<<3,O=At(s,St)+At(n,It)+o,$=At(s,c)+At(n,f)+o+14+3*C+At(I,E)+2*I[16]+3*I[17]+7*I[18];if(u>=0&&A<=O&&A<=$)return Ot(t,d,e.subarray(u,u+l));if(Ct(t,d,1+($<O)),d+=2,$<O){k=bt(c,g,0),x=c,P=bt(f,_,0),L=f;var q=bt(E,R,0);Ct(t,d,y-257),Ct(t,d+5,S-1),Ct(t,d+10,C-4),d+=14;for(T=0;T<C;++T)Ct(t,d+3*T,E[ct[T]]);d+=3*C;for(var U=[m,b],D=0;D<2;++D){var B=U[D];for(T=0;T<B.length;++T){var z=31&B[T];Ct(t,d,q[z]),d+=E[z],z>15&&(Ct(t,d,B[T]>>5&127),d+=B[T]>>12)}}}else k=Tt,x=St,P=Mt,L=It;for(T=0;T<a;++T){var N=r[T];if(N>255){kt(t,d,k[(z=N>>18&31)+257]),d+=x[z+257],z>7&&(Ct(t,d,N>>23&31),d+=dt[z]);var j=31&N;kt(t,d,P[j]),d+=L[j],j>3&&(kt(t,d,N>>5&8191),d+=ht[j])}else kt(t,d,k[N]),d+=x[N]}return kt(t,d,k[256]),d+x[256]},qt=new lt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ut=new at(0),Dt=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var i=t,r=9;--r;)i=(1&i&&-306674912)^i>>>1;e[t]=i}return e}(),Bt=function(e,t,i,r,s){if(!s&&(s={l:1},t.dictionary)){var n=t.dictionary.subarray(-32768),o=new at(n.length+e.length);o.set(n),o.set(e,n.length),e=o,s.w=n.length}return function(e,t,i,r,s,n){var o=n.z||e.length,a=new at(r+o+5*(1+Math.ceil(o/7e3))+s),u=a.subarray(r,a.length-s),l=n.l,d=7&(n.r||0);if(t){d&&(u[0]=n.r>>3);for(var h=qt[t-1],c=h>>13,g=8191&h,v=(1<<i)-1,f=n.p||new ut(32768),_=n.h||new ut(v+1),p=Math.ceil(i/3),m=2*p,y=function(t){return(e[t]^e[t+1]<<p^e[t+2]<<m)&v},w=new lt(25e3),b=new ut(288),S=new ut(32),I=0,T=0,M=n.i||0,E=0,R=n.w||0,C=0;M+2<o;++M){var k=y(M),x=32767&M,P=_[k];if(f[x]=P,_[k]=x,R<=M){var L=o-M;if((I>7e3||E>24576)&&(L>423||!l)){d=$t(e,u,0,w,b,S,T,E,C,M-C,d),E=I=T=0,C=M;for(var A=0;A<286;++A)b[A]=0;for(A=0;A<30;++A)S[A]=0}var O=2,$=0,q=g,U=x-P&32767;if(L>2&&k==y(M-U))for(var D=Math.min(c,L)-1,B=Math.min(32767,M),z=Math.min(258,L);U<=B&&--q&&x!=P;){if(e[M+O]==e[M+O-U]){for(var N=0;N<z&&e[M+N]==e[M+N-U];++N);if(N>O){if(O=N,$=U,N>D)break;var j=Math.min(U,N-2),W=0;for(A=0;A<j;++A){var F=M-U+A&32767,V=F-f[F]&32767;V>W&&(W=V,P=F)}}}U+=(x=P)-(P=f[x])&32767}if($){w[E++]=268435456|_t[O]<<18|pt[$];var J=31&_t[O],H=31&pt[$];T+=dt[J]+ht[H],++b[257+J],++S[H],R=M+O,++I}else w[E++]=e[M],++b[e[M]]}}for(M=Math.max(M,R);M<o;++M)w[E++]=e[M],++b[e[M]];d=$t(e,u,l,w,b,S,T,E,C,M-C,d),l||(n.r=7&d|u[d/8|0]<<3,d-=7,n.h=_,n.p=f,n.i=M,n.w=R)}else{for(M=n.w||0;M<o+l;M+=65535){var Q=M+65535;Q>=o&&(u[d/8|0]=l,Q=o),d=Ot(u,d+1,e.subarray(M,Q))}n.i=o}return Rt(a,0,r+Et(d)+s)}(e,null==t.level?6:t.level,null==t.mem?s.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):20:12+t.mem,i,r,s)},zt=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8};function Nt(e,t){t||(t={});var i=function(){var e=-1;return{p:function(t){for(var i=e,r=0;r<t.length;++r)i=Dt[255&i^t[r]]^i>>>8;e=i},d:function(){return~e}}}(),r=e.length;i.p(e);var s,n=Bt(e,t,10+((s=t).filename?s.filename.length+1:0),8),o=n.length;return function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&zt(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var r=0;r<=i.length;++r)e[r+10]=i.charCodeAt(r)}}(n,t),zt(n,o-8,i.d()),zt(n,o-4,r),n}var jt="undefined"!=typeof TextEncoder&&new TextEncoder,Wt="undefined"!=typeof TextDecoder&&new TextDecoder;try{Wt.decode(Ut,{stream:!0})}catch(e){}ot.MouseMove,ot.MouseInteraction,ot.Scroll,ot.ViewportResize,ot.Input,ot.TouchMove,ot.MediaInteraction,ot.Drag;var Ft,Vt="text/plain";!function(e){e.GZipJS="gzip-js",e.None="none"}(Ft||(Ft={}));var Jt=e=>{var{data:t,compression:i}=e;if(t){var r=(e=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t))(t),s=new Blob([r]).size;if(i===Ft.GZipJS&&s>=1024)try{var n=Nt(function(e,t){if(jt)return jt.encode(e);for(var i=e.length,r=new at(e.length+(e.length>>1)),s=0,n=function(e){r[s++]=e},o=0;o<i;++o){if(s+5>r.length){var a=new at(s+8+(i-o<<1));a.set(r),r=a}var u=e.charCodeAt(o);u<128||t?n(u):u<2048?(n(192|u>>6),n(128|63&u)):u>55295&&u<57344?(n(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++o))>>18),n(128|u>>12&63),n(128|u>>6&63),n(128|63&u)):(n(224|u>>12),n(128|u>>6&63),n(128|63&u))}return Rt(r,0,s)}(r),{mtime:0}),o=new Blob([n],{type:Vt});if(o.size<.95*s)return{contentType:Vt,body:o,estimatedSize:o.size}}catch(e){}return{contentType:"application/json",body:r,estimatedSize:s}}},Ht=[{name:"fetch",available:"undefined"!=typeof fetch,method:e=>{var r=Jt(e);if(r){var{contentType:s,body:n,estimatedSize:o}=r,a=e.compression===Ft.GZipJS&&s===Vt?e.url+(e.url.includes("?")?"&":"?")+"compression=gzip-js":e.url,u=i({"Content-Type":s},e.headers||{}),l=new AbortController,d=e.timeout?setTimeout(()=>l.abort(),e.timeout):null;fetch(a,{method:e.method||"POST",headers:u,body:n,keepalive:o<52428.8,signal:l.signal}).then(function(){var i=t(function*(t){var i,r=yield t.text(),s={statusCode:t.status,text:r};if(200===t.status)try{s.json=JSON.parse(r)}catch(e){}null===(i=e.callback)||void 0===i||i.call(e,s)});return function(e){return i.apply(this,arguments)}}()).catch(()=>{var t;null===(t=e.callback)||void 0===t||t.call(e,{statusCode:0})}).finally(()=>{d&&clearTimeout(d)})}}},{name:"XHR",available:"undefined"!=typeof XMLHttpRequest,method:e=>{var t=Jt(e);if(t){var{contentType:i,body:r}=t,s=e.compression===Ft.GZipJS&&i===Vt?e.url+(e.url.includes("?")?"&":"?")+"compression=gzip-js":e.url,n=new XMLHttpRequest;n.open(e.method||"POST",s,!0),e.headers&&Object.entries(e.headers).forEach(e=>{var[t,i]=e;n.setRequestHeader(t,i)}),n.setRequestHeader("Content-Type",i),e.timeout&&(n.timeout=e.timeout),n.onreadystatechange=()=>{var t;if(4===n.readyState){var i={statusCode:n.status,text:n.responseText};if(200===n.status)try{i.json=JSON.parse(n.responseText)}catch(e){}null===(t=e.callback)||void 0===t||t.call(e,i)}},n.onerror=()=>{var t;null===(t=e.callback)||void 0===t||t.call(e,{statusCode:0})},n.send(r)}}},{name:"sendBeacon",available:"undefined"!=typeof navigator&&!!navigator.sendBeacon,method:e=>{var t=Jt(e);if(t){var{contentType:i,body:r}=t;try{var s="string"==typeof r?new Blob([r],{type:i}):r,n=e.compression===Ft.GZipJS&&i===Vt?e.url+(e.url.includes("?")?"&":"?")+"compression=gzip-js":e.url;navigator.sendBeacon(n,s)}catch(e){}}}}],Qt=e=>{var t,i=e.transport||"fetch",r=Ht.find(e=>e.name===i&&e.available)||Ht.find(e=>e.available);if(!r)return console.error("vTilt: No available transport method"),void(null===(t=e.callback)||void 0===t||t.call(e,{statusCode:0}));r.method(e)};class Xt{constructor(e,t){var i,r,s,n;this._isPaused=!0,this._queue=[],this._flushTimeoutMs=(i=(null==t?void 0:t.flush_interval_ms)||3e3,r=250,s=5e3,n=3e3,"number"!=typeof i||isNaN(i)?n:Math.min(Math.max(i,r),s)),this._sendRequest=e}get length(){return this._queue.length}enqueue(e){this._queue.push(e),this._flushTimeout||this._setFlushTimeout()}unload(){if(this._clearFlushTimeout(),0!==this._queue.length){var e=this._formatQueue();for(var t in e){var r=e[t];this._sendRequest(i({},r,{transport:"sendBeacon"}))}}}enable(){this._isPaused=!1,this._setFlushTimeout()}pause(){this._isPaused=!0,this._clearFlushTimeout()}flush(){this._clearFlushTimeout(),this._flushNow(),this._setFlushTimeout()}_setFlushTimeout(){this._isPaused||(this._flushTimeout=setTimeout(()=>{this._clearFlushTimeout(),this._flushNow(),this._queue.length>0&&this._setFlushTimeout()},this._flushTimeoutMs))}_clearFlushTimeout(){this._flushTimeout&&(clearTimeout(this._flushTimeout),this._flushTimeout=void 0)}_flushNow(){if(0!==this._queue.length){var e=this._formatQueue(),t=Date.now();for(var i in e){var r=e[i];r.events.forEach(e=>{var i=new Date(e.timestamp).getTime();e.$offset=Math.abs(i-t)}),this._sendRequest(r)}}}_formatQueue(){var e={};return this._queue.forEach(t=>{var i=t.batchKey||t.url;e[i]||(e[i]={url:t.url,events:[],batchKey:t.batchKey}),e[i].events.push(t.event)}),this._queue=[],e}}class Kt{constructor(e){this._isPolling=!1,this._pollIntervalMs=3e3,this._queue=[],this._areWeOnline=!0,this._sendRequest=e.sendRequest,this._sendBeacon=e.sendBeacon,I&&void 0!==M&&"onLine"in M&&(this._areWeOnline=M.onLine,w(I,"online",()=>{this._areWeOnline=!0,this._flush()}),w(I,"offline",()=>{this._areWeOnline=!1}))}get length(){return this._queue.length}enqueue(e,t){if(void 0===t&&(t=0),t>=10)console.warn("VTilt: Request failed after 10 retries, giving up");else{var i=function(e){var t=3e3*Math.pow(2,e),i=t/2,r=Math.min(18e5,t),s=(Math.random()-.5)*(r-i);return Math.ceil(r+s)}(t),r=Date.now()+i;this._queue.push({retryAt:r,request:e,retriesPerformedSoFar:t+1});var s="VTilt: Enqueued failed request for retry in "+Math.round(i/1e3)+"s";this._areWeOnline||(s+=" (Browser is offline)"),console.warn(s),this._isPolling||(this._isPolling=!0,this._poll())}}retriableRequest(e){var i=this;return t(function*(){try{var t=yield i._sendRequest(e);200!==t.statusCode&&(t.statusCode<400||t.statusCode>=500)&&i.enqueue(e,0)}catch(t){i.enqueue(e,0)}})()}_poll(){this._poller&&clearTimeout(this._poller),this._poller=setTimeout(()=>{this._areWeOnline&&this._queue.length>0&&this._flush(),this._queue.length>0?this._poll():this._isPolling=!1},this._pollIntervalMs)}_flush(){var e=this,i=Date.now(),r=[],s=[];this._queue.forEach(e=>{e.retryAt<i?s.push(e):r.push(e)}),this._queue=r,s.forEach(function(){var i=t(function*(t){var{request:i,retriesPerformedSoFar:r}=t;try{var s=yield e._sendRequest(i);200!==s.statusCode&&(s.statusCode<400||s.statusCode>=500)&&e.enqueue(i,r)}catch(t){e.enqueue(i,r)}});return function(e){return i.apply(this,arguments)}}())}unload(){this._poller&&(clearTimeout(this._poller),this._poller=void 0),this._queue.forEach(e=>{var{request:t}=e;try{this._sendBeacon(t)}catch(e){console.error("VTilt: Failed to send beacon on unload",e)}}),this._queue=[]}}var Gt="vt_rate_limit";class Zt{constructor(e){var t,i;void 0===e&&(e={}),this.lastEventRateLimited=!1,this.eventsPerSecond=null!==(t=e.eventsPerSecond)&&void 0!==t?t:10,this.eventsBurstLimit=Math.max(null!==(i=e.eventsBurstLimit)&&void 0!==i?i:10*this.eventsPerSecond,this.eventsPerSecond),this.persistence=e.persistence,this.captureWarning=e.captureWarning,this.lastEventRateLimited=this.checkRateLimit(!0).isRateLimited}checkRateLimit(e){var t,i,r,s;void 0===e&&(e=!1);var n=Date.now(),o=null!==(i=null===(t=this.persistence)||void 0===t?void 0:t.get(Gt))&&void 0!==i?i:{tokens:this.eventsBurstLimit,last:n},a=(n-o.last)/1e3;o.tokens+=a*this.eventsPerSecond,o.last=n,o.tokens>this.eventsBurstLimit&&(o.tokens=this.eventsBurstLimit);var u=o.tokens<1;return u||e||(o.tokens=Math.max(0,o.tokens-1)),!u||this.lastEventRateLimited||e||null===(r=this.captureWarning)||void 0===r||r.call(this,"vTilt client rate limited. Config: "+this.eventsPerSecond+" events/second, "+this.eventsBurstLimit+" burst limit."),this.lastEventRateLimited=u,null===(s=this.persistence)||void 0===s||s.set(Gt,o),{isRateLimited:u,remainingTokens:o.tokens}}shouldAllowEvent(){return!this.checkRateLimit(!1).isRateLimited}getRemainingTokens(){return this.checkRateLimit(!0).remainingTokens}}class Yt{constructor(e){void 0===e&&(e={}),this.version="1.1.5",this.__loaded=!1,this._initial_pageview_captured=!1,this._visibility_state_listener=null,this.__request_queue=[],this._has_warned_about_config=!1,this._set_once_properties_sent=!1,this.configManager=new r(e);var t=this.configManager.getConfig();this.sessionManager=new q(t.storage||"cookie",t.cross_subdomain_cookie),this.userManager=new Ke(t.persistence||"localStorage",t.cross_subdomain_cookie),this.webVitalsManager=new tt(t,this),this.rateLimiter=new Zt({eventsPerSecond:10,eventsBurstLimit:100,captureWarning:e=>{this._capture_internal("$$client_ingestion_warning",{$$client_ingestion_warning_message:e})}}),this.retryQueue=new Kt({sendRequest:e=>this._send_http_request(e),sendBeacon:e=>this._send_beacon_request(e)}),this.requestQueue=new Xt(e=>this._send_batched_request(e),{flush_interval_ms:3e3})}init(e,t,i){var r;if(i&&i!==ti){var s=null!==(r=ei[i])&&void 0!==r?r:new Yt;return s._init(e,t,i),ei[i]=s,ei[ti][i]=s,s}return this._init(e,t,i)}_init(e,t,r){if(void 0===t&&(t={}),this.__loaded)return console.warn("vTilt: You have already initialized vTilt! Re-initializing is a no-op"),this;this.updateConfig(i({},t,{projectId:e||t.projectId,name:r})),this.__loaded=!0;var s=this.configManager.getConfig();return this.userManager.set_initial_person_info(s.mask_personal_data_properties,s.custom_personal_data_properties),this.historyAutocapture=new rt(this),this.historyAutocapture.startIfEnabled(),this._initSessionRecording(),this._setup_unload_handler(),this._start_queue_if_opted_in(),!1!==s.capture_pageview&&this._capture_initial_pageview(),this}_start_queue_if_opted_in(){this.requestQueue.enable()}_setup_unload_handler(){if(I){var e=()=>{this.requestQueue.unload(),this.retryQueue.unload()};w(I,"beforeunload",e),w(I,"pagehide",e)}}toString(){var e,t=null!==(e=this.configManager.getConfig().name)&&void 0!==e?e:ti;return t!==ti&&(t=ti+"."+t),t}getCurrentDomain(){if(!R)return"";var e=R.protocol,t=R.hostname,i=R.port;return e+"//"+t+(i?":"+i:"")}_is_configured(){var e=this.configManager.getConfig();return!(!e.projectId||!e.token)||(this._has_warned_about_config||(console.warn("VTilt: projectId and token are required for tracking. Events will be skipped until init() or updateConfig() is called with these fields."),this._has_warned_about_config=!0),!1)}buildUrl(){var e=this.configManager.getConfig(),{proxyUrl:t,proxy:i,api_host:r,token:s}=e;return t||(i?i+"/api/tracking?token="+s:r?r.replace(/\/+$/gm,"")+"/api/tracking?token="+s:"/api/tracking?token="+s)}sendRequest(e,t,i){if(this._is_configured()){if(i&&void 0!==I)if(I.__VTILT_ENQUEUE_REQUESTS)return void this.__request_queue.push({url:e,event:t});this.requestQueue.enqueue({url:e,event:t})}}_send_batched_request(e){var{transport:t}=e;"sendBeacon"!==t?this.retryQueue.retriableRequest(e):this._send_beacon_request(e)}_send_http_request(e){return new Promise(t=>{var{url:i,events:r}=e,s=1===r.length?r[0]:{events:r},n=this.configManager.getConfig().disable_compression?Ft.None:Ft.GZipJS;Qt({url:i,data:s,method:"POST",transport:"XHR",compression:n,callback:e=>{t({statusCode:e.statusCode})}})})}_send_beacon_request(e){var{url:t,events:i}=e,r=1===i.length?i[0]:{events:i},s=this.configManager.getConfig().disable_compression?Ft.None:Ft.GZipJS;Qt({url:t,data:r,method:"POST",transport:"sendBeacon",compression:s})}_send_retriable_request(e){this.sendRequest(e.url,e.event,!1)}capture(e,t,r){if(this.sessionManager.setSessionId(),M&&M.userAgent&&function(e){return!(e&&"string"==typeof e&&e.length>500)}(M.userAgent)&&((null==r?void 0:r.skip_client_rate_limiting)||this.rateLimiter.shouldAllowEvent())){var s=this.buildUrl(),n=Xe(),o=this.userManager.getUserProperties(),a=this.userManager.get_initial_props(),u=this.sessionManager.getSessionId(),l=this.sessionManager.getWindowId(),d=this.userManager.getAnonymousId(),h={};!this._set_once_properties_sent&&Object.keys(a).length>0&&Object.assign(h,a),t.$set_once&&Object.assign(h,t.$set_once);var c=i({},n,o,{$session_id:u,$window_id:l},d?{$anon_distinct_id:d}:{},Object.keys(h).length>0?{$set_once:h}:{},t.$set?{$set:t.$set}:{},t);!this._set_once_properties_sent&&Object.keys(a).length>0&&(this._set_once_properties_sent=!0),"$pageview"===e&&E&&(c.title=E.title);var g,v,f=this.configManager.getConfig();if(!1!==f.stringifyPayload){if(g=Object.assign({},c,f.globalAttributes),!m(g=JSON.stringify(g)))return}else if(g=Object.assign({},c,f.globalAttributes),!m(JSON.stringify(g)))return;v="$identify"===e?this.userManager.getAnonymousId():this.userManager.getDistinctId()||this.userManager.getAnonymousId();var _={timestamp:(new Date).toISOString(),event:e,project_id:f.projectId||"",payload:g,distinct_id:v,anonymous_id:d};this.sendRequest(s,_,!0)}}_capture_internal(e,t){this.capture(e,t,{skip_client_rate_limiting:!0})}trackEvent(e,t){void 0===t&&(t={}),this.capture(e,t)}identify(e,t,i){if("number"==typeof e&&(e=String(e),console.warn("The first argument to vTilt.identify was a number, but it should be a string. It has been converted to a string.")),e)if(this.userManager.isDistinctIdStringLikePublic(e))console.error('The string "'+e+'" was set in vTilt.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if("COOKIELESS_SENTINEL_VALUE"!==e){var r=this.userManager.getDistinctId(),s=this.userManager.getAnonymousId(),n=this.userManager.getDeviceId(),o="anonymous"===this.userManager.getUserState();if(!n){var a=r||s;this.userManager.ensureDeviceId(a)}e!==r&&o?(this.userManager.setUserState("identified"),this.userManager.updateUserProperties(t,i),this.capture("$identify",{distinct_id:e,$anon_distinct_id:s,$set:t||{},$set_once:i||{}}),this.userManager.setDistinctId(e)):t||i?(o&&this.userManager.setUserState("identified"),this.userManager.updateUserProperties(t,i),this.capture("$set",{$set:t||{},$set_once:i||{}})):e!==r&&(this.userManager.setUserState("identified"),this.userManager.setDistinctId(e))}else console.error('The string "'+e+'" was set in vTilt.identify which indicates an error. This ID is only used as a sentinel value.');else console.error("Unique user id has not been set in vTilt.identify")}setUserProperties(e,t){this.userManager.setUserProperties(e,t)&&this.capture("$set",{$set:e||{},$set_once:t||{}})}resetUser(e){this.sessionManager.resetSessionId(),this.userManager.reset(e)}getUserIdentity(){return this.userManager.getUserIdentity()}getDeviceId(){return this.userManager.getDeviceId()}getUserState(){return this.userManager.getUserState()}createAlias(e,t){var i=this.userManager.createAlias(e,t);i?this.capture("$alias",{$original_id:i.original,$alias_id:i.distinct_id}):e===(t||this.userManager.getDistinctId()||this.userManager.getAnonymousId())&&this.identify(e)}_capture_initial_pageview(){E&&("visible"===E.visibilityState?this._initial_pageview_captured||(this._initial_pageview_captured=!0,setTimeout(()=>{if(E&&R){this.capture("$pageview",{navigation_type:"initial_load"})}},300),this._visibility_state_listener&&(E.removeEventListener("visibilitychange",this._visibility_state_listener),this._visibility_state_listener=null)):this._visibility_state_listener||(this._visibility_state_listener=()=>{this._capture_initial_pageview()},w(E,"visibilitychange",this._visibility_state_listener)))}getConfig(){return this.configManager.getConfig()}getSessionId(){return this.sessionManager.getSessionId()}getDistinctId(){return this.userManager.getDistinctId()||this.userManager.getAnonymousId()}getAnonymousId(){return this.userManager.getAnonymousId()}updateConfig(e){this.configManager.updateConfig(e);var t=this.configManager.getConfig();this.sessionManager=new q(t.storage||"cookie",t.cross_subdomain_cookie),this.userManager=new Ke(t.persistence||"localStorage",t.cross_subdomain_cookie),this.webVitalsManager=new tt(t,this),this.sessionRecording&&t.session_recording&&this.sessionRecording.updateConfig(this._buildSessionRecordingConfig(t))}_initSessionRecording(){var e=this.configManager.getConfig();if(!e.disable_session_recording){var t=this._buildSessionRecordingConfig(e);this.sessionRecording=new nt(this,t),t.enabled&&this.sessionRecording.startIfEnabledOrStop("recording_initialized")}}_buildSessionRecordingConfig(e){var t,i,r,s=e.session_recording||{};return{enabled:null!==(t=s.enabled)&&void 0!==t&&t,sampleRate:s.sampleRate,minimumDurationMs:s.minimumDurationMs,sessionIdleThresholdMs:s.sessionIdleThresholdMs,fullSnapshotIntervalMs:s.fullSnapshotIntervalMs,captureConsole:null!==(i=s.captureConsole)&&void 0!==i&&i,captureNetwork:null!==(r=s.captureNetwork)&&void 0!==r&&r,captureCanvas:s.captureCanvas,blockClass:s.blockClass,blockSelector:s.blockSelector,ignoreClass:s.ignoreClass,maskTextClass:s.maskTextClass,maskTextSelector:s.maskTextSelector,maskAllInputs:s.maskAllInputs,maskInputOptions:s.maskInputOptions,masking:s.masking,recordHeaders:s.recordHeaders,recordBody:s.recordBody,compressEvents:s.compressEvents,__mutationThrottlerRefillRate:s.__mutationThrottlerRefillRate,__mutationThrottlerBucketSize:s.__mutationThrottlerBucketSize}}startSessionRecording(){if(!this.sessionRecording){var e=this.configManager.getConfig(),t=this._buildSessionRecordingConfig(e);t.enabled=!0,this.sessionRecording=new nt(this,t)}this.sessionRecording.startIfEnabledOrStop("recording_initialized")}stopSessionRecording(){var e;null===(e=this.sessionRecording)||void 0===e||e.stopRecording()}isSessionRecordingActive(){var e;return"active"===(null===(e=this.sessionRecording)||void 0===e?void 0:e.status)}getSessionRecordingId(){var e;return(null===(e=this.sessionRecording)||void 0===e?void 0:e.sessionId)||null}_execute_array(e){Array.isArray(e)&&e.forEach(e=>{if(e&&Array.isArray(e)&&e.length>0){var t=e[0],i=e.slice(1);if("function"==typeof this[t])try{this[t](...i)}catch(e){console.error("vTilt: Error executing queued call "+t+":",e)}}})}_dom_loaded(){this.__request_queue.forEach(e=>{this._send_retriable_request(e)}),this.__request_queue=[],this._start_queue_if_opted_in()}}var ei={},ti="vt",ii=!(void 0!==k||void 0!==C)&&-1===(null==x?void 0:x.indexOf("MSIE"))&&-1===(null==x?void 0:x.indexOf("Mozilla"));null!=I&&(I.__VTILT_ENQUEUE_REQUESTS=ii);var ri,si=(ri=ei[ti]=new Yt,function(){function e(){e.done||(e.done=!0,ii=!1,null!=I&&(I.__VTILT_ENQUEUE_REQUESTS=!1),y(ei,function(e){e._dom_loaded()}))}E&&"function"==typeof E.addEventListener?"complete"===E.readyState?e():w(E,"DOMContentLoaded",e,{capture:!1}):I&&console.error("Browser doesn't support `document.addEventListener` so vTilt couldn't be initialized")}(),ri);export{Ge as ALL_WEB_VITALS_METRICS,Ze as DEFAULT_WEB_VITALS_METRICS,Yt as VTilt,si as default,si as vt};
|
|
2
2
|
//# sourceMappingURL=module.no-external.js.map
|