@v-tilt/browser 1.2.0 → 1.4.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/chat.js +2 -0
- package/dist/chat.js.map +1 -0
- package/dist/entrypoints/all-external-dependencies.d.ts +8 -0
- package/dist/entrypoints/array.full.d.ts +17 -0
- package/dist/entrypoints/chat.d.ts +22 -0
- package/dist/entrypoints/web-vitals.d.ts +14 -0
- package/dist/extensions/chat/chat-wrapper.d.ts +172 -0
- package/dist/extensions/chat/chat.d.ts +87 -0
- package/dist/extensions/chat/index.d.ts +10 -0
- package/dist/extensions/chat/types.d.ts +156 -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 +312 -5
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/module.no-external.d.ts +312 -5
- 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 +59 -2
- package/dist/utils/globals.d.ts +138 -1
- package/dist/vtilt.d.ts +11 -1
- 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/chat.d.ts +22 -0
- package/lib/entrypoints/chat.js +32 -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/extensions/chat/chat-wrapper.d.ts +172 -0
- package/lib/extensions/chat/chat-wrapper.js +497 -0
- package/lib/extensions/chat/chat.d.ts +87 -0
- package/lib/extensions/chat/chat.js +998 -0
- package/lib/extensions/chat/index.d.ts +10 -0
- package/lib/extensions/chat/index.js +27 -0
- package/lib/extensions/chat/types.d.ts +156 -0
- package/lib/extensions/chat/types.js +22 -0
- package/lib/types.d.ts +59 -2
- package/lib/types.js +16 -0
- package/lib/utils/globals.d.ts +138 -1
- package/lib/vtilt.d.ts +11 -1
- package/lib/vtilt.js +42 -1
- package/lib/web-vitals.d.ts +89 -5
- package/lib/web-vitals.js +354 -46
- package/package.json +66 -65
|
@@ -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,n,r,s,o){try{var a=e[s](o),l=a.value}catch(e){return void i(e)}a.done?t(l):Promise.resolve(l).then(n,r)}function t(t){return function(){var i=this,n=arguments;return new Promise(function(r,s){var o=t.apply(i,n);function a(t){e(o,r,s,a,l,"next",t)}function l(t){e(o,r,s,a,l,"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 n in i)({}).hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},i.apply(null,arguments)}class n{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,n=i({token:""},e);n.api_host=t.getAttribute("data-api-host")||t.getAttribute("data-host")||e.api_host,n.script_host=t.getAttribute("data-script-host")||e.script_host,n.proxy=t.getAttribute("data-proxy")||e.proxy,n.proxyUrl=t.getAttribute("data-proxy-url")||e.proxyUrl,n.token=t.getAttribute("data-token")||e.token||"",n.projectId=t.getAttribute("data-project-id")||e.projectId||"",n.domain=t.getAttribute("data-domain")||e.domain,n.storage=t.getAttribute("data-storage")||e.storage,n.stringifyPayload="false"!==t.getAttribute("data-stringify-payload");var r="true"===t.getAttribute("data-capture-performance");if(n.capture_performance=!!r||e.capture_performance,n.proxy&&n.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 s of(n.globalAttributes=i({},e.globalAttributes),Array.from(t.attributes)))s.name.startsWith("data-vt-")&&(n.globalAttributes[s.name.slice(8).replace(/-/g,"_")]=s.value);return n}getConfig(){return i({},this.config)}updateConfig(e){this.config=i({},this.config,e)}}var r="__vt_session",s="__vt_window_id",o="__vt_primary_window",a="__vt_user_state",l="__vt_device_id",d="__vt_anonymous_id",u="__vt_distinct_id",h="__vt_user_properties",c="localStorage",g="localStorage+cookie",v="sessionStorage",_="memory",f="$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,n)=>{t.call(i,e,n)});else for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.call(i,e[n],n)}function b(e,t,i,n){var{capture:r=!1,passive:s=!0}=null!=n?n:{};null==e||e.addEventListener(t,i,{capture:r,passive:s})}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 S(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];for(var r of i)for(var s of r)e.push(s);return e}var I="undefined"!=typeof window?window:void 0,C="undefined"!=typeof globalThis?globalThis:I,M=null==C?void 0:C.navigator,E=null==C?void 0:C.document,T=null==C?void 0:C.location,k=null==C?void 0:C.fetch,L=(null==C?void 0:C.XMLHttpRequest)&&"withCredentials"in new C.XMLHttpRequest?C.XMLHttpRequest:void 0;null==C||C.AbortController;var x=null==M?void 0:M.userAgent,R=null!=I?I:{},P=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 n=i.match(/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i);return n?"."+n[0]:""}class z{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 n of A)if(i===n)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===_)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===_)return void this.memoryStorage.set(e,t);if(this.usesLocalStorage())return localStorage.setItem(e,t),void(this.method===g&&this.setCookie(e,t,i||P));if(this.usesSessionStorage())return void sessionStorage.setItem(e,t);this.setCookie(e,t,i||P)}catch(t){console.warn('[StorageManager] Failed to set "'+e+'":',t)}}remove(e){try{if(this.method===_)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,n){var r=i({value:t},n?{expiry:Date.now()+n}:{});this.set(e,JSON.stringify(r))}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[n,...r]=i.trim().split("=");if(n===e){var s=r.join("=");try{return decodeURIComponent(s)}catch(e){return s}}}return null}setCookie(e,t,i){if("undefined"!=typeof document){var n=e+"="+encodeURIComponent(t);n+="; Max-Age="+i,n+="; path=/",n+="; SameSite="+this.sameSite,this.secure&&(n+="; Secure");var r=O(this.cross_subdomain);r&&(n+="; domain="+r),document.cookie=n}}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 ${constructor(e,t){void 0===e&&(e="cookie"),this.storage=new z({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(r)}_storeSessionId(e){this.storage.set(r,e,1800)}_clearSessionId(){this.storage.remove(r)}getWindowId(){if(this._windowId)return this._windowId;var e=this.storage.getSessionStorage();if(e){var t=e.getItem(s);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(s,e)}}_initializeWindowId(){var e=this.storage.getSessionStorage();if(e){var t=e.getItem(o),i=e.getItem(s);i&&!t?this._windowId=i:(i&&e.removeItem(s),this._setWindowId(p())),e.setItem(o,"true"),this._listenToUnload()}else this._windowId=p()}_listenToUnload(){var e=this.storage.getSessionStorage();I&&e&&b(I,"beforeunload",()=>{var e=this.storage.getSessionStorage();e&&e.removeItem(o)},{capture:!1})}updateStorageMethod(e,t){this.storage=new z({method:e,cross_subdomain:t,sameSite:"Lax"})}}function q(e){if(!E)return null;var t=E.createElement("a");return t.href=e,t}function U(e,t){for(var i=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;n<i.length;n++){var r=i[n].split("=");if(r[0]===t){if(r.length<2)return"";var s=r[1];try{s=decodeURIComponent(s)}catch(e){}return s.replace(/\+/g," ")}}return""}function D(e,t,i){if(!e||!t||!t.length)return e;for(var n=e.split("#"),r=n[0]||"",s=n[1],o=r.split("?"),a=o[1],l=o[0],d=(a||"").split("&"),u=[],h=0;h<d.length;h++){var c=d[h].split("="),g=c[0],v=c.slice(1).join("=");-1!==t.indexOf(g)?u.push(g+"="+i):g&&u.push(g+(v?"="+v:""))}var _=u.join("&");return l+(_?"?"+_:"")+(s?"#"+s:"")}function B(e){return"function"==typeof e}var F="Mobile",N="iOS",j="Android",V="Tablet",W=j+" "+V,J="iPad",H="Apple",Q=H+" Watch",G="Safari",X="BlackBerry",K="Samsung",Z=K+"Browser",Y=K+" Internet",ee="Chrome",te=ee+" OS",ie=ee+" "+N,ne="Internet Explorer",re=ne+" "+F,se="Opera",oe=se+" Mini",ae="Edge",le="Microsoft "+ae,de="Firefox",ue=de+" "+N,he="Nintendo",ce="PlayStation",ge="Xbox",ve=j+" "+F,_e=F+" "+G,fe="Windows",pe=fe+" Phone",me="Nokia",ye="Ouya",be="Generic",we=be+" "+F.toLowerCase(),Se=be+" "+V.toLowerCase(),Ie="Konqueror",Ce="(\\d+(\\.\\d+)?)",Me=new RegExp("Version/"+Ce),Ee=new RegExp(ge,"i"),Te=new RegExp(ce+" \\w+","i"),ke=new RegExp(he+" \\w+","i"),Le=new RegExp(X+"|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 Re(e,t){return e.toLowerCase().includes(t.toLowerCase())}var Pe=(e,t)=>t&&Re(t,H)||function(e){return Re(e,G)&&!Re(e,ee)&&!Re(e,j)}(e),Ae=function(e,t){return t=t||"",Re(e," OPR/")&&Re(e,"Mini")?oe:Re(e," OPR/")?se:Le.test(e)?X:Re(e,"IE"+F)||Re(e,"WPDesktop")?re:Re(e,Z)?Y:Re(e,ae)||Re(e,"Edg/")?le:Re(e,"FBIOS")?"Facebook "+F:Re(e,"UCWEB")||Re(e,"UCBrowser")?"UC Browser":Re(e,"CriOS")?ie:Re(e,"CrMo")||Re(e,ee)?ee:Re(e,j)&&Re(e,G)?ve:Re(e,"FxiOS")?ue:Re(e.toLowerCase(),Ie.toLowerCase())?Ie:Pe(e,t)?Re(e,F)?_e:G:Re(e,de)?de:Re(e,"MSIE")||Re(e,"Trident/")?ne:Re(e,"Gecko")?de:""},Oe={[re]:[new RegExp("rv:"+Ce)],[le]:[new RegExp(ae+"?\\/"+Ce)],[ee]:[new RegExp("("+ee+"|CrMo)\\/"+Ce)],[ie]:[new RegExp("CriOS\\/"+Ce)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ce)],[G]:[Me],[_e]:[Me],[se]:[new RegExp("(Opera|OPR)\\/"+Ce)],[de]:[new RegExp(de+"\\/"+Ce)],[ue]:[new RegExp("FxiOS\\/"+Ce)],[Ie]:[new RegExp("Konqueror[:/]?"+Ce,"i")],[X]:[new RegExp(X+" "+Ce),Me],[ve]:[new RegExp("android\\s"+Ce,"i")],[Y]:[new RegExp(Z+"\\/"+Ce)],[ne]:[new RegExp("(rv:|MSIE )"+Ce)],Mozilla:[new RegExp("rv:"+Ce)]},ze=function(e,t){var i=Ae(e,t),n=Oe[i];if(void 0===n)return null;for(var r=0;r<n.length;r++){var s=n[r],o=e.match(s);if(o)return parseFloat(o[o.length-2])}return null},$e=[[new RegExp(ge+"; "+ge+" (.*?)[);]","i"),e=>[ge,e&&e[1]||""]],[new RegExp(he,"i"),[he,""]],[new RegExp(ce,"i"),[ce,""]],[Le,[X,""]],[new RegExp(fe,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[pe,""];if(new RegExp(F).test(t)&&!/IEMobile\b/.test(t))return[fe+" "+F,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var n=i[1],r=xe[n]||"";return/arm/i.test(t)&&(r="RT"),[fe,r]}return[fe,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[N,t.join(".")]}return[N,""]}],[/(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("("+j+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+j+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[j,t.join(".")]}return[j,""]}],[/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",""]]],qe=function(e){return ke.test(e)?he:Te.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:Le.test(e)?X:/(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(F).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)?j:W:j:new RegExp("(pda|"+F+")","i").test(e)?we:new RegExp(V,"i").test(e)&&!new RegExp(V+" pc","i").test(e)?Se:""},Ue="https?://(.*)",De=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Be=S(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],De),Fe="<masked>";function Ne(e){var t=function(e){return e?0===e.search(Ue+"google.([^/?]*)")?"google":0===e.search(Ue+"bing.com")?"bing":0===e.search(Ue+"yahoo.com")?"yahoo":0===e.search(Ue+"duckduckgo.com")?"duckduckgo":null:null}(e),i="yahoo"!==t?"q":"p",n={};if(null!==t){n.$search_engine=t;var r=E?U(E.referrer,i):"";r.length&&(n.ph_keyword=r)}return n}function je(){if("undefined"!=typeof navigator)return navigator.language||navigator.userLanguage}function Ve(){return(null==E?void 0:E.referrer)||"$direct"}function We(){var e;return(null==E?void 0:E.referrer)&&(null===(e=q(E.referrer))||void 0===e?void 0:e.host)||"$direct"}function Je(e){var t,{r:i,u:n}=e,r={$referrer:i,$referring_domain:null==i?void 0:"$direct"===i?"$direct":null===(t=q(i))||void 0===t?void 0:t.host};if(n){r.$current_url=n;var s=q(n);r.$host=null==s?void 0:s.host,r.$pathname=null==s?void 0:s.pathname;var o=function(e){var t=Be.concat([]),i={};return y(t,function(t){var n=U(e,t);i[t]=n||null}),i}(n);w(r,o)}i&&w(r,Ne(i));return r}function He(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function Qe(){try{return(new Date).getTimezoneOffset()}catch(e){return}}function Ge(e,t){if(!x)return{};var i,n,r,[s,o]=function(e){for(var t=0;t<$e.length;t++){var[i,n]=$e[t],r=i.exec(e),s=r&&(B(n)?n(r,e):n);if(s)return s}return["",""]}(x);return w(function(e){var t={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var n=e[i];null!=n&&""!==n&&(t[i]=n)}return t}({$os:s,$os_version:o,$browser:Ae(x,navigator.vendor),$device:qe(x),$device_type:(n=x,r=qe(n),r===J||r===W||"Kobo"===r||"Kindle Fire"===r||r===Se?V:r===he||r===ge||r===ce||r===ye?"Console":r===Q?"Wearable":r?F:"Desktop"),$timezone:He(),$timezone_offset:Qe()}),{$current_url:D(null==T?void 0:T.href,[],Fe),$host:null==T?void 0:T.host,$pathname:null==T?void 0:T.pathname,$raw_user_agent:x.length>1e3?x.substring(0,997)+"...":x,$browser_version:ze(x,navigator.vendor),$browser_language:je(),$browser_language_prefix:(i=je(),"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 Xe{constructor(e,t){void 0===e&&(e="localStorage"),this._cachedPersonProperties=null,this.storage=new z({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(d,this.userIdentity.anonymous_id,P)),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,n){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 r=this.userIdentity.distinct_id;if(this.userIdentity.distinct_id=e,!this.userIdentity.device_id){var s=r||this.userIdentity.anonymous_id;this.userIdentity.device_id=s,this.userIdentity.properties=i({},this.userIdentity.properties,{$had_persisted_distinct_id:!0,$device_id:s})}e!==r&&(this.userIdentity.distinct_id=e);var o="anonymous"===this.userIdentity.user_state;e!==r&&o?(this.userIdentity.user_state="identified",t&&(this.userIdentity.properties=i({},this.userIdentity.properties,t)),n&&Object.keys(n).forEach(e=>{e in this.userIdentity.properties||(this.userIdentity.properties[e]=n[e])}),this.saveUserIdentity()):t||n?("anonymous"===this.userIdentity.user_state&&(this.userIdentity.user_state="identified"),t&&(this.userIdentity.properties=i({},this.userIdentity.properties,t)),n&&Object.keys(n).forEach(e=>{e in this.userIdentity.properties||(this.userIdentity.properties[e]=n[e])}),this.saveUserIdentity()):e!==r&&(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 n=this.userIdentity.distinct_id||this.userIdentity.anonymous_id,r=this.getPersonPropertiesHash(n,e,t);return this._cachedPersonProperties===r?(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=r,!0)}reset(e){var t=this.generateAnonymousId(),n=this.userIdentity.device_id,r=e?this.generateDeviceId():n;this.userIdentity={distinct_id:null,anonymous_id:t,device_id:r,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()[f]){var i=function(e,t){var i=e?S([],De,t||[]):[],n=null==T?void 0:T.href.substring(0,1e3);return{r:Ve().substring(0,1e3),u:n?D(n,i,Fe):void 0}}(e,t);this.register_once({[f]:i},void 0)}}get_initial_props(){var e,t,i=this.getStoredUserProperties()[f];return i?(e=Je(i),t={},y(e,function(e,i){var n;t["$initial_"+(n=String(i),n.startsWith("$")?n.substring(1):n)]=e}),t):{}}update_referrer_info(){var e={$referrer:Ve(),$referring_domain:We()};this.register_once(e,void 0)}loadUserIdentity(){var e=this.storage.get(d)||this.generateAnonymousId(),t=this.storage.get(u)||null,i=this.storage.get(l)||this.generateDeviceId(),n=this.getStoredUserProperties(),r=this.storage.get(a)||"anonymous";return{distinct_id:t,anonymous_id:e||this.generateAnonymousId(),device_id:i,properties:n,user_state:r}}saveUserIdentity(){this.storage.set(d,this.userIdentity.anonymous_id,P),this.storage.set(l,this.userIdentity.device_id,P),this.storage.set(a,this.userIdentity.user_state,P),this.userIdentity.distinct_id?this.storage.set(u,this.userIdentity.distinct_id,P):this.storage.remove(u),this.setStoredUserProperties(this.userIdentity.properties)}getStoredUserProperties(){return this.storage.getJSON(h)||{}}setStoredUserProperties(e){this.storage.setJSON(h,e,P)}register_once(e,t){var i=this.getStoredUserProperties(),n=!1;for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(r in i||(i[r]=e[r],n=!0));if(t)for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(s in i||(i[s]=t[s],n=!0));n&&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 z({method:e,cross_subdomain:t,sameSite:"Lax"}),this.userIdentity=this.loadUserIdentity()}}var Ke=["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==T?void 0:T.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=R.__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=R.__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==T?void 0:T.pathname}addToBuffer(e){try{if(!I||!E||!T)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(),n=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=n),this.buffer.firstMetricTimestamp||(this.buffer.firstMetricTimestamp=Date.now());var r=this.cleanAttribution(e.attribution),s=this.instance.getSessionId(),o=this.getWindowId(),a=i({},e,{attribution:r,timestamp:Date.now(),$current_url:t,$session_id:s,$window_id:o}),l=this.buffer.metrics.findIndex(t=>t.name===e.name);l>=0?this.buffer.metrics[l]=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 n=e[t],r=i(n);return B(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__vtilt_wrapped__:{enumerable:!1,value:!0}})),e[t]=r,()=>{e[t]=n}}catch(e){return()=>{}}}class nt{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&&T&&(this._lastPathname=T.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,n,r){e.call(this,t,n,r),i._capturePageview("pushState")}),(null===(t=I.history.replaceState)||void 0===t?void 0:t.__vtilt_wrapped__)||it(I.history,"replaceState",e=>function(t,n,r){e.call(this,t,n,r),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||!T||!E)return;if(i!==this._lastPathname&&this.isEnabled){var n={navigation_type:e};this._instance.capture("$pageview",n)}this._lastPathname=i}catch(t){console.error("Error capturing "+e+" pageview",t)}}_setupPopstateListener(){if(!this._popstateListener&&I){var e=()=>{this._capturePageview("popstate")};b(I,"popstate",e),this._popstateListener=()=>{I&&I.removeEventListener("popstate",e)}}}}var rt="[SessionRecording]";class st{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(rt+" 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(rt+" 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,n=!t.disable_session_recording;return!!I&&i&&n}get _scriptName(){return"recorder"}_lazyLoadAndStart(e){var t,i,n,r;if(this._isRecordingEnabled)if((null===(i=null===(t=null==R?void 0:R.__VTiltExtensions__)||void 0===t?void 0:t.rrweb)||void 0===i?void 0:i.record)&&(null===(n=R.__VTiltExtensions__)||void 0===n?void 0:n.initSessionRecording))this._onScriptLoaded(e);else{var s=null===(r=R.__VTiltExtensions__)||void 0===r?void 0:r.loadExternalDependency;s?s(this._instance,this._scriptName,t=>{t?console.error(rt+" could not load recorder:",t):this._onScriptLoaded(e)}):console.error(rt+" loadExternalDependency not available. Session recording cannot start.")}}_onScriptLoaded(e){var t,i=null===(t=R.__VTiltExtensions__)||void 0===t?void 0:t.initSessionRecording;i?(this._lazyLoadedRecording||(this._lazyLoadedRecording=i(this._instance,this._config)),this._lazyLoadedRecording.start(e)):console.error(rt+" 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,lt=Uint16Array,dt=Int32Array,ut=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 lt(31),n=0;n<31;++n)i[n]=t+=1<<e[n-1];var r=new dt(i[30]);for(n=1;n<30;++n)for(var s=i[n];s<i[n+1];++s)r[s]=s-i[n]<<5|n;return{b:i,r:r}},vt=gt(ut,2),_t=vt.b,ft=vt.r;_t[28]=258,ft[258]=28;for(var pt=gt(ht,0).r,mt=new lt(32768),yt=0;yt<32768;++yt){var bt=(43690&yt)>>1|(21845&yt)<<1;bt=(61680&(bt=(52428&bt)>>2|(13107&bt)<<2))>>4|(3855&bt)<<4,mt[yt]=((65280&bt)>>8|(255&bt)<<8)>>1}var wt=function(e,t,i){for(var n=e.length,r=0,s=new lt(t);r<n;++r)e[r]&&++s[e[r]-1];var o,a=new lt(t);for(r=1;r<t;++r)a[r]=a[r-1]+s[r-1]<<1;if(i){o=new lt(1<<t);var l=15-t;for(r=0;r<n;++r)if(e[r])for(var d=r<<4|e[r],u=t-e[r],h=a[e[r]-1]++<<u,c=h|(1<<u)-1;h<=c;++h)o[mt[h]>>l]=d}else for(o=new lt(n),r=0;r<n;++r)e[r]&&(o[r]=mt[a[e[r]-1]++]>>15-e[r]);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 Ct=wt(St,9,0),Mt=wt(It,5,0),Et=function(e){return(e+7)/8|0},Tt=function(e,t,i){return(null==i||i>e.length)&&(i=e.length),new at(e.subarray(t,i))},kt=function(e,t,i){i<<=7&t;var n=t/8|0;e[n]|=i,e[n+1]|=i>>8},Lt=function(e,t,i){i<<=7&t;var n=t/8|0;e[n]|=i,e[n+1]|=i>>8,e[n+2]|=i>>16},xt=function(e,t){for(var i=[],n=0;n<e.length;++n)e[n]&&i.push({s:n,f:e[n]});var r=i.length,s=i.slice();if(!r)return{t:qt,l:0};if(1==r){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],l=i[1],d=0,u=1,h=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=r-1;)a=i[i[d].f<i[h].f?d++:h++],l=i[d!=u&&i[d].f<i[h].f?d++:h++],i[u++]={s:-1,f:a.f+l.f,l:a,r:l};var c=s[0].s;for(n=1;n<r;++n)s[n].s>c&&(c=s[n].s);var g=new lt(c+1),v=Rt(i[u-1],g,0);if(v>t){n=0;var _=0,f=v-t,p=1<<f;for(s.sort(function(e,t){return g[t.s]-g[e.s]||e.f-t.f});n<r;++n){var m=s[n].s;if(!(g[m]>t))break;_+=p-(1<<v-g[m]),g[m]=t}for(_>>=f;_>0;){var y=s[n].s;g[y]<t?_-=1<<t-g[y]++-1:++n}for(;n>=0&&_;--n){var b=s[n].s;g[b]==t&&(--g[b],++_)}v=t}return{t:new at(g),l:v}},Rt=function(e,t,i){return-1==e.s?Math.max(Rt(e.l,t,i+1),Rt(e.r,t,i+1)):t[e.s]=i},Pt=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new lt(++t),n=0,r=e[0],s=1,o=function(e){i[n++]=e},a=1;a<=t;++a)if(e[a]==r&&a!=t)++s;else{if(!r&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(r),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(r);s=1,r=e[a]}return{c:i.subarray(0,n),n:t}},At=function(e,t){for(var i=0,n=0;n<t.length;++n)i+=e[n]*t[n];return i},Ot=function(e,t,i){var n=i.length,r=Et(t+2);e[r]=255&n,e[r+1]=n>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var s=0;s<n;++s)e[r+s+4]=i[s];return 8*(r+4+n)},zt=function(e,t,i,n,r,s,o,a,l,d,u){kt(t,u++,i),++r[256];for(var h=xt(r,15),c=h.t,g=h.l,v=xt(s,15),_=v.t,f=v.l,p=Pt(c),m=p.c,y=p.n,b=Pt(_),w=b.c,S=b.n,I=new lt(19),C=0;C<m.length;++C)++I[31&m[C]];for(C=0;C<w.length;++C)++I[31&w[C]];for(var M=xt(I,7),E=M.t,T=M.l,k=19;k>4&&!E[ct[k-1]];--k);var L,x,R,P,A=d+5<<3,O=At(r,St)+At(s,It)+o,z=At(r,c)+At(s,_)+o+14+3*k+At(I,E)+2*I[16]+3*I[17]+7*I[18];if(l>=0&&A<=O&&A<=z)return Ot(t,u,e.subarray(l,l+d));if(kt(t,u,1+(z<O)),u+=2,z<O){L=wt(c,g,0),x=c,R=wt(_,f,0),P=_;var $=wt(E,T,0);kt(t,u,y-257),kt(t,u+5,S-1),kt(t,u+10,k-4),u+=14;for(C=0;C<k;++C)kt(t,u+3*C,E[ct[C]]);u+=3*k;for(var q=[m,w],U=0;U<2;++U){var D=q[U];for(C=0;C<D.length;++C){var B=31&D[C];kt(t,u,$[B]),u+=E[B],B>15&&(kt(t,u,D[C]>>5&127),u+=D[C]>>12)}}}else L=Ct,x=St,R=Mt,P=It;for(C=0;C<a;++C){var F=n[C];if(F>255){Lt(t,u,L[(B=F>>18&31)+257]),u+=x[B+257],B>7&&(kt(t,u,F>>23&31),u+=ut[B]);var N=31&F;Lt(t,u,R[N]),u+=P[N],N>3&&(Lt(t,u,F>>5&8191),u+=ht[N])}else Lt(t,u,L[F]),u+=x[F]}return Lt(t,u,L[256]),u+x[256]},$t=new dt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),qt=new at(0),Ut=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var i=t,n=9;--n;)i=(1&i&&-306674912)^i>>>1;e[t]=i}return e}(),Dt=function(e,t,i,n,r){if(!r&&(r={l:1},t.dictionary)){var s=t.dictionary.subarray(-32768),o=new at(s.length+e.length);o.set(s),o.set(e,s.length),e=o,r.w=s.length}return function(e,t,i,n,r,s){var o=s.z||e.length,a=new at(n+o+5*(1+Math.ceil(o/7e3))+r),l=a.subarray(n,a.length-r),d=s.l,u=7&(s.r||0);if(t){u&&(l[0]=s.r>>3);for(var h=$t[t-1],c=h>>13,g=8191&h,v=(1<<i)-1,_=s.p||new lt(32768),f=s.h||new lt(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},b=new dt(25e3),w=new lt(288),S=new lt(32),I=0,C=0,M=s.i||0,E=0,T=s.w||0,k=0;M+2<o;++M){var L=y(M),x=32767&M,R=f[L];if(_[x]=R,f[L]=x,T<=M){var P=o-M;if((I>7e3||E>24576)&&(P>423||!d)){u=zt(e,l,0,b,w,S,C,E,k,M-k,u),E=I=C=0,k=M;for(var A=0;A<286;++A)w[A]=0;for(A=0;A<30;++A)S[A]=0}var O=2,z=0,$=g,q=x-R&32767;if(P>2&&L==y(M-q))for(var U=Math.min(c,P)-1,D=Math.min(32767,M),B=Math.min(258,P);q<=D&&--$&&x!=R;){if(e[M+O]==e[M+O-q]){for(var F=0;F<B&&e[M+F]==e[M+F-q];++F);if(F>O){if(O=F,z=q,F>U)break;var N=Math.min(q,F-2),j=0;for(A=0;A<N;++A){var V=M-q+A&32767,W=V-_[V]&32767;W>j&&(j=W,R=V)}}}q+=(x=R)-(R=_[x])&32767}if(z){b[E++]=268435456|ft[O]<<18|pt[z];var J=31&ft[O],H=31&pt[z];C+=ut[J]+ht[H],++w[257+J],++S[H],T=M+O,++I}else b[E++]=e[M],++w[e[M]]}}for(M=Math.max(M,T);M<o;++M)b[E++]=e[M],++w[e[M]];u=zt(e,l,d,b,w,S,C,E,k,M-k,u),d||(s.r=7&u|l[u/8|0]<<3,u-=7,s.h=f,s.p=_,s.i=M,s.w=T)}else{for(M=s.w||0;M<o+d;M+=65535){var Q=M+65535;Q>=o&&(l[u/8|0]=d,Q=o),u=Ot(l,u+1,e.subarray(M,Q))}s.i=o}return Tt(a,0,n+Et(u)+r)}(e,null==t.level?6:t.level,null==t.mem?r.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):20:12+t.mem,i,n,r)},Bt=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8};function Ft(e,t){t||(t={});var i=function(){var e=-1;return{p:function(t){for(var i=e,n=0;n<t.length;++n)i=Ut[255&i^t[n]]^i>>>8;e=i},d:function(){return~e}}}(),n=e.length;i.p(e);var r,s=Dt(e,t,10+((r=t).filename?r.filename.length+1:0),8),o=s.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&&Bt(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var n=0;n<=i.length;++n)e[n+10]=i.charCodeAt(n)}}(s,t),Bt(s,o-8,i.d()),Bt(s,o-4,n),s}var Nt="undefined"!=typeof TextEncoder&&new TextEncoder,jt="undefined"!=typeof TextDecoder&&new TextDecoder;try{jt.decode(qt,{stream:!0})}catch(e){}ot.MouseMove,ot.MouseInteraction,ot.Scroll,ot.ViewportResize,ot.Input,ot.TouchMove,ot.MediaInteraction,ot.Drag;var Vt="[Chat]";class Wt{constructor(e,t){void 0===t&&(t={}),this._instance=e,this._serverConfig=null,this._configFetched=!1,this._isLoading=!1,this._loadError=null,this._pendingMessages=[],this._pendingCallbacks=[],this._messageCallbacks=[],this._typingCallbacks=[],this._connectionCallbacks=[],this._config=t}get isOpen(){var e,t;return null!==(t=null===(e=this._lazyLoadedChat)||void 0===e?void 0:e.isOpen)&&void 0!==t&&t}get isConnected(){var e,t;return null!==(t=null===(e=this._lazyLoadedChat)||void 0===e?void 0:e.isConnected)&&void 0!==t&&t}get isLoading(){var e,t;return this._isLoading||null!==(t=null===(e=this._lazyLoadedChat)||void 0===e?void 0:e.isLoading)&&void 0!==t&&t}get unreadCount(){var e,t;return null!==(t=null===(e=this._lazyLoadedChat)||void 0===e?void 0:e.unreadCount)&&void 0!==t?t:0}get channel(){var e,t;return null!==(t=null===(e=this._lazyLoadedChat)||void 0===e?void 0:e.channel)&&void 0!==t?t:null}open(){this._lazyLoadAndThen(()=>{var e;return null===(e=this._lazyLoadedChat)||void 0===e?void 0:e.open()})}close(){var e;null===(e=this._lazyLoadedChat)||void 0===e||e.close()}toggle(){this._lazyLoadedChat?this._lazyLoadedChat.toggle():this.open()}show(){this._lazyLoadAndThen(()=>{var e;return null===(e=this._lazyLoadedChat)||void 0===e?void 0:e.show()})}hide(){var e;null===(e=this._lazyLoadedChat)||void 0===e||e.hide()}sendMessage(e){this._lazyLoadedChat?this._lazyLoadedChat.sendMessage(e):(this._pendingMessages.push(e),this._lazyLoadAndThen(()=>{this._pendingMessages.forEach(e=>{var t;return null===(t=this._lazyLoadedChat)||void 0===t?void 0:t.sendMessage(e)}),this._pendingMessages=[]}))}markAsRead(){var e;null===(e=this._lazyLoadedChat)||void 0===e||e.markAsRead()}onMessage(e){return this._messageCallbacks.push(e),this._lazyLoadedChat?this._lazyLoadedChat.onMessage(e):()=>{var t=this._messageCallbacks.indexOf(e);t>-1&&this._messageCallbacks.splice(t,1)}}onTyping(e){return this._typingCallbacks.push(e),this._lazyLoadedChat?this._lazyLoadedChat.onTyping(e):()=>{var t=this._typingCallbacks.indexOf(e);t>-1&&this._typingCallbacks.splice(t,1)}}onConnectionChange(e){return this._connectionCallbacks.push(e),this._lazyLoadedChat?this._lazyLoadedChat.onConnectionChange(e):()=>{var t=this._connectionCallbacks.indexOf(e);t>-1&&this._connectionCallbacks.splice(t,1)}}startIfEnabled(){var e=this;return t(function*(){var t,i,n,r;!1!==e._config.enabled?e._instance.getConfig().disable_chat?console.info(Vt+" disabled by disable_chat config"):(!1!==e._config.autoConfig&&(yield e._fetchServerSettings()),e._isChatEnabled?(null!==(n=null!==(t=e._config.preload)&&void 0!==t?t:null===(i=e._serverConfig)||void 0===i?void 0:i.enabled)&&void 0!==n&&n&&e._schedulePreload(),(null===(r=e._serverConfig)||void 0===r?void 0:r.enabled)&&e._showBubble(),console.info(Vt+" ready (lazy-load on demand)")):console.info(Vt+" not enabled (check dashboard settings)")):console.info(Vt+" disabled by code config")})()}updateConfig(e){this._config=i({},this._config,e)}getMergedConfig(){var e,t,i,n,r,s,o,a,l,d,u,h,c,g,v,_,f,p,m=this._serverConfig,y=this._config;return{enabled:null!==(t=null!==(e=y.enabled)&&void 0!==e?e:null==m?void 0:m.enabled)&&void 0!==t&&t,autoConfig:null===(i=y.autoConfig)||void 0===i||i,position:null!==(r=null!==(n=y.position)&&void 0!==n?n:null==m?void 0:m.position)&&void 0!==r?r:"bottom-right",greeting:null!==(s=y.greeting)&&void 0!==s?s:null==m?void 0:m.greeting,color:null!==(a=null!==(o=y.color)&&void 0!==o?o:null==m?void 0:m.color)&&void 0!==a?a:"#6366f1",aiMode:null===(d=null!==(l=y.aiMode)&&void 0!==l?l:null==m?void 0:m.ai_enabled)||void 0===d||d,aiGreeting:null!==(u=y.aiGreeting)&&void 0!==u?u:null==m?void 0:m.ai_greeting,preload:null!==(h=y.preload)&&void 0!==h&&h,theme:null!==(c=y.theme)&&void 0!==c?c:{primaryColor:null!==(v=null!==(g=y.color)&&void 0!==g?g:null==m?void 0:m.color)&&void 0!==v?v:"#6366f1"},offlineMessage:null!==(_=y.offlineMessage)&&void 0!==_?_:null==m?void 0:m.offline_message,collectEmailOffline:null===(p=null!==(f=y.collectEmailOffline)&&void 0!==f?f:null==m?void 0:m.collect_email_offline)||void 0===p||p}}destroy(){var e;null===(e=this._lazyLoadedChat)||void 0===e||e.destroy(),this._lazyLoadedChat=void 0,this._pendingMessages=[],this._pendingCallbacks=[],this._messageCallbacks=[],this._typingCallbacks=[],this._connectionCallbacks=[]}get _isChatEnabled(){var e;return!1!==this._config.enabled&&(!0===this._config.enabled||!0===(null===(e=this._serverConfig)||void 0===e?void 0:e.enabled))}_fetchServerSettings(){var e=this;return t(function*(){if(!e._configFetched){var t=e._instance.getConfig(),i=t.token,n=t.api_host;if(!i||!n)return console.warn(Vt+" Cannot fetch settings: missing token or api_host"),void(e._configFetched=!0);try{var r=n+"/api/chat/settings?token="+encodeURIComponent(i),s=yield fetch(r);if(!s.ok)return console.warn(Vt+" Failed to fetch settings: "+s.status),void(e._configFetched=!0);e._serverConfig=yield s.json(),e._configFetched=!0,console.info(Vt+" Loaded settings from dashboard")}catch(t){console.warn(Vt+" Error fetching settings:",t),e._configFetched=!0}}})()}_showBubble(){if((null==I?void 0:I.document)&&!document.getElementById("vtilt-chat-bubble")){var e=this.getMergedConfig(),t=e.position||"bottom-right",i=e.color||"#6366f1",n=document.createElement("div");n.id="vtilt-chat-bubble",n.setAttribute("style",("\n position: fixed;\n bottom: 20px;\n "+("bottom-right"===t?"right: 20px;":"left: 20px;")+"\n width: 60px;\n height: 60px;\n border-radius: 50%;\n background: "+i+";\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n transition: transform 0.2s, box-shadow 0.2s;\n z-index: 999999;\n ").trim()),n.innerHTML='\n <svg width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2">\n <path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path>\n </svg>\n ',n.addEventListener("mouseenter",()=>{n.style.transform="scale(1.05)",n.style.boxShadow="0 6px 16px rgba(0, 0, 0, 0.2)"}),n.addEventListener("mouseleave",()=>{n.style.transform="scale(1)",n.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"}),n.addEventListener("click",()=>{this.open()}),document.body.appendChild(n)}}get _scriptName(){return"chat"}_schedulePreload(){"undefined"!=typeof requestIdleCallback?requestIdleCallback(()=>this._lazyLoad(),{timeout:5e3}):setTimeout(()=>this._lazyLoad(),3e3)}_lazyLoadAndThen(e){this._lazyLoadedChat?e():(this._pendingCallbacks.push(e),this._lazyLoad())}_lazyLoad(){var e,t;if(!(this._isLoading||this._lazyLoadedChat||this._loadError))if(null===(e=R.__VTiltExtensions__)||void 0===e?void 0:e.initChat)this._onScriptLoaded();else{this._isLoading=!0;var i=null===(t=R.__VTiltExtensions__)||void 0===t?void 0:t.loadExternalDependency;if(!i)return console.error(Vt+" loadExternalDependency not available. Chat cannot start."),this._isLoading=!1,void(this._loadError="loadExternalDependency not available");i(this._instance,this._scriptName,e=>{if(this._isLoading=!1,e)return console.error(Vt+" Failed to load:",e),void(this._loadError=String(e));this._onScriptLoaded()})}}_onScriptLoaded(){var e,t=null===(e=R.__VTiltExtensions__)||void 0===e?void 0:e.initChat;if(!t)return console.error(Vt+" initChat not available after script load"),void(this._loadError="initChat not available");if(!this._lazyLoadedChat){var i=this.getMergedConfig();this._lazyLoadedChat=t(this._instance,i),this._messageCallbacks.forEach(e=>{var t;return null===(t=this._lazyLoadedChat)||void 0===t?void 0:t.onMessage(e)}),this._typingCallbacks.forEach(e=>{var t;return null===(t=this._lazyLoadedChat)||void 0===t?void 0:t.onTyping(e)}),this._connectionCallbacks.forEach(e=>{var t;return null===(t=this._lazyLoadedChat)||void 0===t?void 0:t.onConnectionChange(e)});var n=null===document||void 0===document?void 0:document.getElementById("vtilt-chat-bubble");n&&n.remove()}this._pendingCallbacks.forEach(e=>e()),this._pendingCallbacks=[],console.info(Vt+" loaded and ready")}}var Jt,Ht="text/plain";!function(e){e.GZipJS="gzip-js",e.None="none"}(Jt||(Jt={}));var Qt=e=>{var{data:t,compression:i}=e;if(t){var n=(e=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t))(t),r=new Blob([n]).size;if(i===Jt.GZipJS&&r>=1024)try{var s=Ft(function(e,t){if(Nt)return Nt.encode(e);for(var i=e.length,n=new at(e.length+(e.length>>1)),r=0,s=function(e){n[r++]=e},o=0;o<i;++o){if(r+5>n.length){var a=new at(r+8+(i-o<<1));a.set(n),n=a}var l=e.charCodeAt(o);l<128||t?s(l):l<2048?(s(192|l>>6),s(128|63&l)):l>55295&&l<57344?(s(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++o))>>18),s(128|l>>12&63),s(128|l>>6&63),s(128|63&l)):(s(224|l>>12),s(128|l>>6&63),s(128|63&l))}return Tt(n,0,r)}(n),{mtime:0}),o=new Blob([s],{type:Ht});if(o.size<.95*r)return{contentType:Ht,body:o,estimatedSize:o.size}}catch(e){}return{contentType:"application/json",body:n,estimatedSize:r}}},Gt=[{name:"fetch",available:"undefined"!=typeof fetch,method:e=>{var n=Qt(e);if(n){var{contentType:r,body:s,estimatedSize:o}=n,a=e.compression===Jt.GZipJS&&r===Ht?e.url+(e.url.includes("?")?"&":"?")+"compression=gzip-js":e.url,l=i({"Content-Type":r},e.headers||{}),d=new AbortController,u=e.timeout?setTimeout(()=>d.abort(),e.timeout):null;fetch(a,{method:e.method||"POST",headers:l,body:s,keepalive:o<52428.8,signal:d.signal}).then(function(){var i=t(function*(t){var i,n=yield t.text(),r={statusCode:t.status,text:n};if(200===t.status)try{r.json=JSON.parse(n)}catch(e){}null===(i=e.callback)||void 0===i||i.call(e,r)});return function(e){return i.apply(this,arguments)}}()).catch(()=>{var t;null===(t=e.callback)||void 0===t||t.call(e,{statusCode:0})}).finally(()=>{u&&clearTimeout(u)})}}},{name:"XHR",available:"undefined"!=typeof XMLHttpRequest,method:e=>{var t=Qt(e);if(t){var{contentType:i,body:n}=t,r=e.compression===Jt.GZipJS&&i===Ht?e.url+(e.url.includes("?")?"&":"?")+"compression=gzip-js":e.url,s=new XMLHttpRequest;s.open(e.method||"POST",r,!0),e.headers&&Object.entries(e.headers).forEach(e=>{var[t,i]=e;s.setRequestHeader(t,i)}),s.setRequestHeader("Content-Type",i),e.timeout&&(s.timeout=e.timeout),s.onreadystatechange=()=>{var t;if(4===s.readyState){var i={statusCode:s.status,text:s.responseText};if(200===s.status)try{i.json=JSON.parse(s.responseText)}catch(e){}null===(t=e.callback)||void 0===t||t.call(e,i)}},s.onerror=()=>{var t;null===(t=e.callback)||void 0===t||t.call(e,{statusCode:0})},s.send(n)}}},{name:"sendBeacon",available:"undefined"!=typeof navigator&&!!navigator.sendBeacon,method:e=>{var t=Qt(e);if(t){var{contentType:i,body:n}=t;try{var r="string"==typeof n?new Blob([n],{type:i}):n,s=e.compression===Jt.GZipJS&&i===Ht?e.url+(e.url.includes("?")?"&":"?")+"compression=gzip-js":e.url;navigator.sendBeacon(s,r)}catch(e){}}}}],Xt=e=>{var t,i=e.transport||"fetch",n=Gt.find(e=>e.name===i&&e.available)||Gt.find(e=>e.available);if(!n)return console.error("vTilt: No available transport method"),void(null===(t=e.callback)||void 0===t||t.call(e,{statusCode:0}));n.method(e)};class Kt{constructor(e,t){var i,n,r,s;this._isPaused=!0,this._queue=[],this._flushTimeoutMs=(i=(null==t?void 0:t.flush_interval_ms)||3e3,n=250,r=5e3,s=3e3,"number"!=typeof i||isNaN(i)?s:Math.min(Math.max(i,n),r)),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 n=e[t];this._sendRequest(i({},n,{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 n=e[i];n.events.forEach(e=>{var i=new Date(e.timestamp).getTime();e.$offset=Math.abs(i-t)}),this._sendRequest(n)}}}_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 Zt{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,b(I,"online",()=>{this._areWeOnline=!0,this._flush()}),b(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,n=Math.min(18e5,t),r=(Math.random()-.5)*(n-i);return Math.ceil(n+r)}(t),n=Date.now()+i;this._queue.push({retryAt:n,request:e,retriesPerformedSoFar:t+1});var r="VTilt: Enqueued failed request for retry in "+Math.round(i/1e3)+"s";this._areWeOnline||(r+=" (Browser is offline)"),console.warn(r),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(),n=[],r=[];this._queue.forEach(e=>{e.retryAt<i?r.push(e):n.push(e)}),this._queue=n,r.forEach(function(){var i=t(function*(t){var{request:i,retriesPerformedSoFar:n}=t;try{var r=yield e._sendRequest(i);200!==r.statusCode&&(r.statusCode<400||r.statusCode>=500)&&e.enqueue(i,n)}catch(t){e.enqueue(i,n)}});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 Yt="vt_rate_limit";class ei{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,n,r;void 0===e&&(e=!1);var s=Date.now(),o=null!==(i=null===(t=this.persistence)||void 0===t?void 0:t.get(Yt))&&void 0!==i?i:{tokens:this.eventsBurstLimit,last:s},a=(s-o.last)/1e3;o.tokens+=a*this.eventsPerSecond,o.last=s,o.tokens>this.eventsBurstLimit&&(o.tokens=this.eventsBurstLimit);var l=o.tokens<1;return l||e||(o.tokens=Math.max(0,o.tokens-1)),!l||this.lastEventRateLimited||e||null===(n=this.captureWarning)||void 0===n||n.call(this,"vTilt client rate limited. Config: "+this.eventsPerSecond+" events/second, "+this.eventsBurstLimit+" burst limit."),this.lastEventRateLimited=l,null===(r=this.persistence)||void 0===r||r.set(Yt,o),{isRateLimited:l,remainingTokens:o.tokens}}shouldAllowEvent(){return!this.checkRateLimit(!1).isRateLimited}getRemainingTokens(){return this.checkRateLimit(!0).remainingTokens}}class ti{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 n(e);var t=this.configManager.getConfig();this.sessionManager=new $(t.storage||"cookie",t.cross_subdomain_cookie),this.userManager=new Xe(t.persistence||"localStorage",t.cross_subdomain_cookie),this.webVitalsManager=new tt(t,this),this.rateLimiter=new ei({eventsPerSecond:10,eventsBurstLimit:100,captureWarning:e=>{this._capture_internal("$$client_ingestion_warning",{$$client_ingestion_warning_message:e})}}),this.retryQueue=new Zt({sendRequest:e=>this._send_http_request(e),sendBeacon:e=>this._send_beacon_request(e)}),this.requestQueue=new Kt(e=>this._send_batched_request(e),{flush_interval_ms:3e3})}init(e,t,i){var n;if(i&&i!==ni){var r=null!==(n=ii[i])&&void 0!==n?n:new ti;return r._init(e,t,i),ii[i]=r,ii[ni][i]=r,r}return this._init(e,t,i)}_init(e,t,n){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:n})),this.__loaded=!0;var r=this.configManager.getConfig();return this.userManager.set_initial_person_info(r.mask_personal_data_properties,r.custom_personal_data_properties),this.historyAutocapture=new nt(this),this.historyAutocapture.startIfEnabled(),this._initSessionRecording(),this._initChat(),this._setup_unload_handler(),this._start_queue_if_opted_in(),!1!==r.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()};b(I,"beforeunload",e),b(I,"pagehide",e)}}toString(){var e,t=null!==(e=this.configManager.getConfig().name)&&void 0!==e?e:ni;return t!==ni&&(t=ni+"."+t),t}getCurrentDomain(){if(!T)return"";var e=T.protocol,t=T.hostname,i=T.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:n,token:r}=e;return t||(i?i+"/api/tracking?token="+r:n?n.replace(/\/+$/gm,"")+"/api/tracking?token="+r:"/api/tracking?token="+r)}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:n}=e,r=1===n.length?n[0]:{events:n},s=this.configManager.getConfig().disable_compression?Jt.None:Jt.GZipJS;Xt({url:i,data:r,method:"POST",transport:"XHR",compression:s,callback:e=>{t({statusCode:e.statusCode})}})})}_send_beacon_request(e){var{url:t,events:i}=e,n=1===i.length?i[0]:{events:i},r=this.configManager.getConfig().disable_compression?Jt.None:Jt.GZipJS;Xt({url:t,data:n,method:"POST",transport:"sendBeacon",compression:r})}_send_retriable_request(e){this.sendRequest(e.url,e.event,!1)}capture(e,t,n){if(this.sessionManager.setSessionId(),M&&M.userAgent&&function(e){return!(e&&"string"==typeof e&&e.length>500)}(M.userAgent)&&((null==n?void 0:n.skip_client_rate_limiting)||this.rateLimiter.shouldAllowEvent())){var r=this.buildUrl(),s=Ge(),o=this.userManager.getUserProperties(),a=this.userManager.get_initial_props(),l=this.sessionManager.getSessionId(),d=this.sessionManager.getWindowId(),u=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({},s,o,{$session_id:l,$window_id:d},u?{$anon_distinct_id:u}:{},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,_=this.configManager.getConfig();if(!1!==_.stringifyPayload){if(g=Object.assign({},c,_.globalAttributes),!m(g=JSON.stringify(g)))return}else if(g=Object.assign({},c,_.globalAttributes),!m(JSON.stringify(g)))return;v="$identify"===e?this.userManager.getAnonymousId():this.userManager.getDistinctId()||this.userManager.getAnonymousId();var f={timestamp:(new Date).toISOString(),event:e,project_id:_.projectId||"",payload:g,distinct_id:v,anonymous_id:u};this.sendRequest(r,f,!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 n=this.userManager.getDistinctId(),r=this.userManager.getAnonymousId(),s=this.userManager.getDeviceId(),o="anonymous"===this.userManager.getUserState();if(!s){var a=n||r;this.userManager.ensureDeviceId(a)}e!==n&&o?(this.userManager.setUserState("identified"),this.userManager.updateUserProperties(t,i),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r,$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!==n&&(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&&T){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()},b(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 $(t.storage||"cookie",t.cross_subdomain_cookie),this.userManager=new Xe(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 st(this,t),t.enabled&&this.sessionRecording.startIfEnabledOrStop("recording_initialized")}}_buildSessionRecordingConfig(e){var t,i,n,r=e.session_recording||{};return{enabled:null!==(t=r.enabled)&&void 0!==t&&t,sampleRate:r.sampleRate,minimumDurationMs:r.minimumDurationMs,sessionIdleThresholdMs:r.sessionIdleThresholdMs,fullSnapshotIntervalMs:r.fullSnapshotIntervalMs,captureConsole:null!==(i=r.captureConsole)&&void 0!==i&&i,captureNetwork:null!==(n=r.captureNetwork)&&void 0!==n&&n,captureCanvas:r.captureCanvas,blockClass:r.blockClass,blockSelector:r.blockSelector,ignoreClass:r.ignoreClass,maskTextClass:r.maskTextClass,maskTextSelector:r.maskTextSelector,maskAllInputs:r.maskAllInputs,maskInputOptions:r.maskInputOptions,masking:r.masking,recordHeaders:r.recordHeaders,recordBody:r.recordBody,compressEvents:r.compressEvents,__mutationThrottlerRefillRate:r.__mutationThrottlerRefillRate,__mutationThrottlerBucketSize:r.__mutationThrottlerBucketSize}}startSessionRecording(){if(!this.sessionRecording){var e=this.configManager.getConfig(),t=this._buildSessionRecordingConfig(e);t.enabled=!0,this.sessionRecording=new st(this,t)}this.sessionRecording.startIfEnabledOrStop("recording_initialized")}stopSessionRecording(){var e;null===(e=this.sessionRecording)||void 0===e||e.stopRecording()}isRecordingActive(){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}_initChat(){var e=this.configManager.getConfig();if(!e.disable_chat){var t=this._buildChatConfig(e);this.chat=new Wt(this,t),this.chat.startIfEnabled()}}_buildChatConfig(e){var t,i=e.chat||{};return{enabled:i.enabled,autoConfig:null===(t=i.autoConfig)||void 0===t||t,position:i.position,greeting:i.greeting,color:i.color,aiMode:i.aiMode,aiGreeting:i.aiGreeting,preload:i.preload,offlineMessage:i.offlineMessage,collectEmailOffline:i.collectEmailOffline}}_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 ii={},ni="vt",ri=!(void 0!==L||void 0!==k)&&-1===(null==x?void 0:x.indexOf("MSIE"))&&-1===(null==x?void 0:x.indexOf("Mozilla"));null!=I&&(I.__VTILT_ENQUEUE_REQUESTS=ri);var si,oi=(si=ii[ni]=new ti,function(){function e(){e.done||(e.done=!0,ri=!1,null!=I&&(I.__VTILT_ENQUEUE_REQUESTS=!1),y(ii,function(e){e._dom_loaded()}))}E&&"function"==typeof E.addEventListener?"complete"===E.readyState?e():b(E,"DOMContentLoaded",e,{capture:!1}):I&&console.error("Browser doesn't support `document.addEventListener` so vTilt couldn't be initialized")}(),si);export{Ke as ALL_WEB_VITALS_METRICS,Ze as DEFAULT_WEB_VITALS_METRICS,ti as VTilt,oi as default,oi as vt};
|
|
2
2
|
//# sourceMappingURL=module.no-external.js.map
|