@v-tilt/browser 1.10.2 → 1.10.4
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/array.full.js +1 -1
- package/dist/array.full.js.map +1 -1
- 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/extensions/vtd-overlay.d.ts +73 -0
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/module.d.ts +74 -0
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/module.no-external.d.ts +74 -0
- package/dist/module.no-external.js +1 -1
- package/dist/module.no-external.js.map +1 -1
- package/dist/vtilt.d.ts +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VTD Overlay Feature
|
|
3
|
+
*
|
|
4
|
+
* Displays destination content in a fullscreen iframe overlay when vtd= URL parameter is present.
|
|
5
|
+
* Used for tracking links that redirect to specific content (video, page, etc.).
|
|
6
|
+
*
|
|
7
|
+
* Example: https://example.com/?vt=person_id&vtd=https://youtube.com/watch?v=abc123
|
|
8
|
+
*
|
|
9
|
+
* @see docs/architecture/proposals/vt-vtd-tracking-links.md
|
|
10
|
+
*/
|
|
11
|
+
import type { VTilt } from "../vtilt";
|
|
12
|
+
import type { VTiltConfig } from "../types";
|
|
13
|
+
import type { Feature } from "../feature";
|
|
14
|
+
export interface VtdOverlayConfig {
|
|
15
|
+
/** Whether the overlay feature is enabled */
|
|
16
|
+
enabled?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare class VtdOverlay implements Feature {
|
|
19
|
+
readonly name = "VtdOverlay";
|
|
20
|
+
private _instance;
|
|
21
|
+
private _config;
|
|
22
|
+
private _isStarted;
|
|
23
|
+
private _destinationUrl;
|
|
24
|
+
private _originalUrl;
|
|
25
|
+
private _isLoading;
|
|
26
|
+
private _container;
|
|
27
|
+
private _iframe;
|
|
28
|
+
private _loadingEl;
|
|
29
|
+
constructor(instance: VTilt, config?: VtdOverlayConfig);
|
|
30
|
+
static extractConfig(config: VTiltConfig): VtdOverlayConfig;
|
|
31
|
+
get isEnabled(): boolean;
|
|
32
|
+
get isStarted(): boolean;
|
|
33
|
+
startIfEnabled(): void;
|
|
34
|
+
stop(): void;
|
|
35
|
+
onConfigUpdate(config: VTiltConfig): void;
|
|
36
|
+
/**
|
|
37
|
+
* Set the destination URL and show the overlay.
|
|
38
|
+
* Called by vtilt.ts when vtd= parameter is detected.
|
|
39
|
+
*
|
|
40
|
+
* @param url - The destination URL (can be URL-encoded)
|
|
41
|
+
*/
|
|
42
|
+
setDestinationUrl(url: string): void;
|
|
43
|
+
/**
|
|
44
|
+
* Get the current destination URL.
|
|
45
|
+
*/
|
|
46
|
+
getDestinationUrl(): string | null;
|
|
47
|
+
/**
|
|
48
|
+
* Close the overlay with animation.
|
|
49
|
+
*/
|
|
50
|
+
close(): void;
|
|
51
|
+
private _isValidUrl;
|
|
52
|
+
/**
|
|
53
|
+
* Transform URLs to embeddable format for known platforms.
|
|
54
|
+
* Many sites block iframe embedding but provide dedicated embed URLs.
|
|
55
|
+
*/
|
|
56
|
+
private _toEmbedUrl;
|
|
57
|
+
private _getHostname;
|
|
58
|
+
private _getFaviconUrl;
|
|
59
|
+
private _showOverlay;
|
|
60
|
+
private _destroyOverlay;
|
|
61
|
+
private _attachEventListeners;
|
|
62
|
+
private _getBackdropStyles;
|
|
63
|
+
private _getModalStyles;
|
|
64
|
+
private _getHeaderStyles;
|
|
65
|
+
private _getHeaderHTML;
|
|
66
|
+
private _getIframeWrapperStyles;
|
|
67
|
+
private _getLoadingStyles;
|
|
68
|
+
private _getLoadingHTML;
|
|
69
|
+
private _getIframeStyles;
|
|
70
|
+
private _getGlobalStyles;
|
|
71
|
+
private _truncateUrl;
|
|
72
|
+
private _escapeHtml;
|
|
73
|
+
}
|
package/dist/main.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function t(t,i,e,r,n,s,o){try{var a=t[s](o),l=a.value}catch(t){return void e(t)}a.done?i(l):Promise.resolve(l).then(r,n)}function i(i){return function(){var e=this,r=arguments;return new Promise(function(n,s){var o=i.apply(e,r);function a(i){t(o,n,s,a,l,"next",i)}function l(i){t(o,n,s,a,l,"throw",i)}a(void 0)})}}function e(){return e=Object.assign?Object.assign.bind():function(t){for(var i=1;i<arguments.length;i++){var e=arguments[i];for(var r in e)({}).hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},e.apply(null,arguments)}Object.defineProperty(exports,"__esModule",{value:!0});var r="1.10.2",n="__vt_session",s="__vt_window_id",o="__vt_primary_window",a="__vt_user_state",l="__vt_device_id",u="__vt_anonymous_id",h="__vt_remote_config",d="__vt_distinct_id",v="__vt_user_properties",c="localStorage",f="localStorage+cookie",p="sessionStorage",g="memory",_="$initial_person_info";class m{constructor(t){void 0===t&&(t={}),this.config=this.parseConfigFromScript(t)}parseConfigFromScript(t){if(!document.currentScript)return e({token:t.token||""},t);var i=document.currentScript,r=e({token:""},t);r.api_host=i.getAttribute("data-api-host")||i.getAttribute("data-host")||t.api_host,r.script_host=i.getAttribute("data-script-host")||t.script_host,r.proxy=i.getAttribute("data-proxy")||t.proxy,r.proxyUrl=i.getAttribute("data-proxy-url")||t.proxyUrl,r.token=i.getAttribute("data-token")||t.token||"",r.projectId=i.getAttribute("data-project-id")||t.projectId||"",r.domain=i.getAttribute("data-domain")||t.domain,r.storage=i.getAttribute("data-storage")||t.storage,r.stringifyPayload="false"!==i.getAttribute("data-stringify-payload");var n="true"===i.getAttribute("data-capture-performance");if(r.capture_performance=!!n||t.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 s of(r.globalAttributes=e({},t.globalAttributes),Array.from(i.attributes)))s.name.startsWith("data-vt-")&&(r.globalAttributes[s.name.slice(8).replace(/-/g,"_")]=s.value);return r}getConfig(){return e({},this.config)}updateConfig(t){this.config=e({},this.config,t)}}function b(t,i){try{return t()}catch(t){return i}}class w{constructor(){this.o=new Map,this.m=new Map}on(t,i){return this.o.has(t)||this.o.set(t,new Set),this.o.get(t).add(i),()=>{var e;null===(e=this.o.get(t))||void 0===e||e.delete(i)}}once(t,i){return this.m.has(t)||this.m.set(t,new Set),this.m.get(t).add(i),()=>{var e;null===(e=this.m.get(t))||void 0===e||e.delete(i)}}emit(t,i){var e,r;null===(e=this.o.get(t))||void 0===e||e.forEach(e=>{try{e(i)}catch(i){console.error('[vTilt] Error in event listener for "'+t+'":',i)}});var n=this.m.get(t);n&&(n.forEach(e=>{try{e(i)}catch(i){console.error('[vTilt] Error in once listener for "'+t+'":',i)}}),this.m.delete(t)),null===(r=this.o.get("*"))||void 0===r||r.forEach(e=>{try{e({event:t,payload:i})}catch(t){console.error("[vTilt] Error in wildcard listener:",t)}})}off(t){t?(this.o.delete(t),this.m.delete(t)):(this.o.clear(),this.m.clear())}listenerCount(t){var i,e,r,n;return(null!==(e=null===(i=this.o.get(t))||void 0===i?void 0:i.size)&&void 0!==e?e:0)+(null!==(n=null===(r=this.m.get(t))||void 0===r?void 0:r.size)&&void 0!==n?n:0)}hasListeners(t){return this.listenerCount(t)>0}}var y="sdk:initialized",S="sdk:config_updated",x="sdk:remote_config_loaded",k="feature:started",C="feature:stopped",E="event:captured",T="recording:started",I="recording:stopped";function M(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,t=>(+t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+t/4).toString(16))}function R(t){return!(!t||"string"!=typeof t)&&!(t.length<2||t.length>10240)}function A(t,i,e){if(t)if(Array.isArray(t))t.forEach((t,r)=>{i.call(e,t,r)});else for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&i.call(e,t[r],r)}function O(t,i,e,r){var{capture:n=!1,passive:s=!0}=null!=r?r:{};null==t||t.addEventListener(i,e,{capture:n,passive:s})}function P(t,i){if(!i)return t;for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e]);return t}function L(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),r=1;r<i;r++)e[r-1]=arguments[r];for(var n of e)for(var s of n)t.push(s);return t}var U="undefined"!=typeof window?window:void 0,D="undefined"!=typeof globalThis?globalThis:U,j=null==D?void 0:D.navigator,B=null==D?void 0:D.document,N=null==D?void 0:D.location,z=null==D?void 0:D.fetch,F=(null==D?void 0:D.XMLHttpRequest)&&"withCredentials"in new D.XMLHttpRequest?D.XMLHttpRequest:void 0;null==D||D.AbortController;var q=null==j?void 0:j.userAgent,V=null!=U?U:{},W=[u,l,d,a],J=31536e3,H=["herokuapp.com","vercel.app","netlify.app"];function X(t){var i;if(!t||"undefined"==typeof document)return"";var e=null===(i=document.location)||void 0===i?void 0:i.hostname;if(!e)return"";var r=e.match(/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i);return r?"."+r[0]:""}class K{constructor(t){var i,e,r;this.memoryStorage=new Map,this.S=null,this.method=t.method,this.cross_subdomain=null!==(i=t.cross_subdomain)&&void 0!==i?i:function(){var t;if("undefined"==typeof document)return!1;var i=null===(t=document.location)||void 0===t?void 0:t.hostname;if(!i)return!1;var e=i.split(".").slice(-2).join(".");return!H.includes(e)}(),this.sameSite=null!==(e=t.sameSite)&&void 0!==e?e:"Lax",this.secure=null!==(r=t.secure)&&void 0!==r?r:"undefined"!=typeof location&&"https:"===location.protocol}isLocalStorageSupported(){if(null!==this.S)return this.S;if(void 0===U||!U.localStorage)return this.S=!1,!1;try{var t="__vt_ls_test__";U.localStorage.setItem(t,"1");var i="1"===U.localStorage.getItem(t);return U.localStorage.removeItem(t),this.S=i,i||console.warn("[vTilt] localStorage unavailable, using cookies"),i}catch(t){return this.S=!1,console.warn("[vTilt] localStorage unavailable, using cookies"),!1}}isCriticalProperty(t){return W.includes(t)}get(t){var i;try{switch(this.method){case g:return null!==(i=this.memoryStorage.get(t))&&void 0!==i?i:null;case f:return this.getLocalStoragePlusCookie(t);case c:return this.getLocalStorage(t);case p:return this.readFromSessionStorage(t);default:return this.getCookie(t)}}catch(i){return console.warn('[vTilt] Storage get error for "'+t+'":',i),null}}set(t,i,e){try{switch(this.method){case g:this.memoryStorage.set(t,i);break;case f:this.setLocalStoragePlusCookie(t,i,e);break;case c:this.setLocalStorage(t,i);break;case p:this.writeToSessionStorage(t,i);break;default:this.setCookie(t,i,null!=e?e:J)}}catch(i){console.warn('[vTilt] Storage set error for "'+t+'":',i)}}remove(t){try{switch(this.method){case g:this.memoryStorage.delete(t);break;case f:this.removeLocalStoragePlusCookie(t);break;case c:this.removeLocalStorage(t);break;case p:this.removeFromSessionStorage(t);break;default:this.removeCookie(t)}}catch(i){console.warn('[vTilt] Storage remove error for "'+t+'":',i)}}getLocalStoragePlusCookie(t){if(this.isCriticalProperty(t)){var i=this.getCookie(t),e=this.getLocalStorage(t);if(null!==i){if(e!==i&&this.isLocalStorageSupported())try{null==U||U.localStorage.setItem(t,i)}catch(t){}return i}return e}return this.getLocalStorage(t)}setLocalStoragePlusCookie(t,i,e){this.setLocalStorage(t,i),this.isCriticalProperty(t)&&this.setCookie(t,i,null!=e?e:J)}removeLocalStoragePlusCookie(t){this.removeLocalStorage(t),this.isCriticalProperty(t)&&this.removeCookie(t)}getLocalStorage(t){var i;if(!this.isLocalStorageSupported())return null;try{return null!==(i=null==U?void 0:U.localStorage.getItem(t))&&void 0!==i?i:null}catch(t){return null}}setLocalStorage(t,i){if(this.isLocalStorageSupported())try{null==U||U.localStorage.setItem(t,i)}catch(t){console.warn("[vTilt] localStorage write error:",t)}}removeLocalStorage(t){if(this.isLocalStorageSupported())try{null==U||U.localStorage.removeItem(t)}catch(t){}}readFromSessionStorage(t){var i;try{return null!==(i=null==U?void 0:U.sessionStorage.getItem(t))&&void 0!==i?i:null}catch(t){return null}}writeToSessionStorage(t,i){try{null==U||U.sessionStorage.setItem(t,i)}catch(t){console.warn("[vTilt] sessionStorage write error:",t)}}removeFromSessionStorage(t){try{null==U||U.sessionStorage.removeItem(t)}catch(t){}}getCookie(t){if("undefined"==typeof document)return null;var i=t+"=";for(var e of document.cookie.split(";")){var r=e.trim();if(r.startsWith(i))try{return decodeURIComponent(r.slice(i.length))}catch(t){return r.slice(i.length)}}return null}setCookie(t,i,e){if("undefined"!=typeof document){var r=X(this.cross_subdomain),n=t+"="+encodeURIComponent(i)+"; Max-Age="+e+"; path=/; SameSite="+this.sameSite;this.secure&&(n+="; Secure"),r&&(n+="; domain="+r),document.cookie=n}}removeCookie(t){if("undefined"!=typeof document){var i=X(this.cross_subdomain);document.cookie=t+"=; Max-Age=0; path=/"+(i?"; domain="+i:""),document.cookie=t+"=; Max-Age=0; path=/"}}getWithExpiry(t){var i=this.get(t);if(!i)return null;try{var e=JSON.parse(i);return e.expiry&&Date.now()>e.expiry?(this.remove(t),null):e.value}catch(t){return null}}setWithExpiry(t,i,r){var n=e({value:i},r?{expiry:Date.now()+r}:{});this.set(t,JSON.stringify(n))}getJSON(t){var i=this.get(t);if(!i)return null;try{return JSON.parse(i)}catch(t){return null}}setJSON(t,i,e){this.set(t,JSON.stringify(i),e)}canUseSessionStorage(){if(void 0===U||!(null==U?void 0:U.sessionStorage))return!1;try{var t="__vt_ss_test__";return U.sessionStorage.setItem(t,"1"),U.sessionStorage.removeItem(t),!0}catch(t){return!1}}getSessionStorage(){var t;return this.canUseSessionStorage()&&null!==(t=null==U?void 0:U.sessionStorage)&&void 0!==t?t:null}setMethod(t){this.method=t}getMethod(){return this.method}}class G{constructor(t,i){void 0===t&&(t="cookie"),this.storage=new K({method:t,cross_subdomain:i,sameSite:"Lax"}),this.k=void 0,this.C()}getSessionId(){var t=this.T();return t||(t=M(),this.I(t)),t}setSessionId(){var t=this.T()||M();return this.I(t),t}resetSessionId(){this.$(),this.setSessionId(),this.M(M())}T(){return this.storage.get(n)}I(t){this.storage.set(n,t,1800)}$(){this.storage.remove(n)}getWindowId(){if(this.k)return this.k;var t=this.storage.getSessionStorage();if(t){var i=t.getItem(s);if(i)return this.k=i,i}var e=M();return this.M(e),e}M(t){if(t!==this.k){this.k=t;var i=this.storage.getSessionStorage();i&&i.setItem(s,t)}}C(){var t=this.storage.getSessionStorage();if(t){var i=t.getItem(o),e=t.getItem(s);e&&!i?this.k=e:(e&&t.removeItem(s),this.M(M())),t.setItem(o,"true"),this.R()}else this.k=M()}R(){var t=this.storage.getSessionStorage();U&&t&&O(U,"beforeunload",()=>{var t=this.storage.getSessionStorage();t&&t.removeItem(o)},{capture:!1})}updateStorageMethod(t,i){this.storage=new K({method:t,cross_subdomain:i,sameSite:"Lax"})}}function Q(t){if(!B)return null;var i=B.createElement("a");return i.href=t,i}function Z(t,i){for(var e=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<e.length;r++){var n=e[r].split("=");if(n[0]===i){if(n.length<2)return"";var s=n[1];try{s=decodeURIComponent(s)}catch(t){}return s.replace(/\+/g," ")}}return""}function Y(t,i,e){if(!t||!i||!i.length)return t;for(var r=t.split("#"),n=r[0]||"",s=r[1],o=n.split("?"),a=o[1],l=o[0],u=(a||"").split("&"),h=[],d=0;d<u.length;d++){var v=u[d].split("="),c=v[0],f=v.slice(1).join("=");-1!==i.indexOf(c)?h.push(c+"="+e):c&&h.push(c+(f?"="+f:""))}var p=h.join("&");return l+(p?"?"+p:"")+(s?"#"+s:"")}function tt(t){return"function"==typeof t}var it="Mobile",et="iOS",rt="Android",nt="Tablet",st=rt+" "+nt,ot="iPad",at="Apple",lt=at+" Watch",ut="Safari",ht="BlackBerry",dt="Samsung",vt=dt+"Browser",ct=dt+" Internet",ft="Chrome",pt=ft+" OS",gt=ft+" "+et,_t="Internet Explorer",mt=_t+" "+it,bt="Opera",wt=bt+" Mini",yt="Edge",St="Microsoft "+yt,xt="Firefox",kt=xt+" "+et,Ct="Nintendo",Et="PlayStation",Tt="Xbox",It=rt+" "+it,$t=it+" "+ut,Mt="Windows",Rt=Mt+" Phone",At="Nokia",Ot="Ouya",Pt="Generic",Lt=Pt+" "+it.toLowerCase(),Ut=Pt+" "+nt.toLowerCase(),Dt="Konqueror",jt="(\\d+(\\.\\d+)?)",Bt=new RegExp("Version/"+jt),Nt=new RegExp(Tt,"i"),zt=new RegExp(Et+" \\w+","i"),Ft=new RegExp(Ct+" \\w+","i"),qt=new RegExp(ht+"|PlayBook|BB10","i"),Vt={"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 Wt(t,i){return t.toLowerCase().includes(i.toLowerCase())}var Jt=(t,i)=>i&&Wt(i,at)||function(t){return Wt(t,ut)&&!Wt(t,ft)&&!Wt(t,rt)}(t),Ht=function(t,i){return i=i||"",Wt(t," OPR/")&&Wt(t,"Mini")?wt:Wt(t," OPR/")?bt:qt.test(t)?ht:Wt(t,"IE"+it)||Wt(t,"WPDesktop")?mt:Wt(t,vt)?ct:Wt(t,yt)||Wt(t,"Edg/")?St:Wt(t,"FBIOS")?"Facebook "+it:Wt(t,"UCWEB")||Wt(t,"UCBrowser")?"UC Browser":Wt(t,"CriOS")?gt:Wt(t,"CrMo")||Wt(t,ft)?ft:Wt(t,rt)&&Wt(t,ut)?It:Wt(t,"FxiOS")?kt:Wt(t.toLowerCase(),Dt.toLowerCase())?Dt:Jt(t,i)?Wt(t,it)?$t:ut:Wt(t,xt)?xt:Wt(t,"MSIE")||Wt(t,"Trident/")?_t:Wt(t,"Gecko")?xt:""},Xt={[mt]:[new RegExp("rv:"+jt)],[St]:[new RegExp(yt+"?\\/"+jt)],[ft]:[new RegExp("("+ft+"|CrMo)\\/"+jt)],[gt]:[new RegExp("CriOS\\/"+jt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+jt)],[ut]:[Bt],[$t]:[Bt],[bt]:[new RegExp("(Opera|OPR)\\/"+jt)],[xt]:[new RegExp(xt+"\\/"+jt)],[kt]:[new RegExp("FxiOS\\/"+jt)],[Dt]:[new RegExp("Konqueror[:/]?"+jt,"i")],[ht]:[new RegExp(ht+" "+jt),Bt],[It]:[new RegExp("android\\s"+jt,"i")],[ct]:[new RegExp(vt+"\\/"+jt)],[_t]:[new RegExp("(rv:|MSIE )"+jt)],Mozilla:[new RegExp("rv:"+jt)]},Kt=function(t,i){var e=Ht(t,i),r=Xt[e];if(void 0===r)return null;for(var n=0;n<r.length;n++){var s=r[n],o=t.match(s);if(o)return parseFloat(o[o.length-2])}return null},Gt=[[new RegExp(Tt+"; "+Tt+" (.*?)[);]","i"),t=>[Tt,t&&t[1]||""]],[new RegExp(Ct,"i"),[Ct,""]],[new RegExp(Et,"i"),[Et,""]],[qt,[ht,""]],[new RegExp(Mt,"i"),(t,i)=>{if(/Phone/.test(i)||/WPDesktop/.test(i))return[Rt,""];if(new RegExp(it).test(i)&&!/IEMobile\b/.test(i))return[Mt+" "+it,""];var e=/Windows NT ([0-9.]+)/i.exec(i);if(e&&e[1]){var r=e[1],n=Vt[r]||"";return/arm/i.test(i)&&(n="RT"),[Mt,n]}return[Mt,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var i=[t[3],t[4],t[5]||"0"];return[et,i.join(".")]}return[et,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var i="";return t&&t.length>=3&&(i=void 0===t[2]?t[3]:t[2]),["watchOS",i]}],[new RegExp("("+rt+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+rt+")","i"),t=>{if(t&&t[2]){var i=[t[2],t[3],t[4]||"0"];return[rt,i.join(".")]}return[rt,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var i=["Mac OS X",""];if(t&&t[1]){var e=[t[1],t[2],t[3]||"0"];i[1]=e.join(".")}return i}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[pt,""]],[/Linux|debian/i,["Linux",""]]],Qt=function(t){return Ft.test(t)?Ct:zt.test(t)?Et:Nt.test(t)?Tt:new RegExp(Ot,"i").test(t)?Ot:new RegExp("("+Rt+"|WPDesktop)","i").test(t)?Rt:/iPad/.test(t)?ot:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?lt:qt.test(t)?ht:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(At,"i").test(t)?At:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?!new RegExp(it).test(t)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)?/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?rt:st:rt:new RegExp("(pda|"+it+")","i").test(t)?Lt:new RegExp(nt,"i").test(t)&&!new RegExp(nt+" pc","i").test(t)?Ut:""},Zt="https?://(.*)",Yt=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],ti=L(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Yt),ii="<masked>";function ei(t){var i=function(t){return t?0===t.search(Zt+"google.([^/?]*)")?"google":0===t.search(Zt+"bing.com")?"bing":0===t.search(Zt+"yahoo.com")?"yahoo":0===t.search(Zt+"duckduckgo.com")?"duckduckgo":null:null}(t),e="yahoo"!==i?"q":"p",r={};if(null!==i){r.$search_engine=i;var n=B?Z(B.referrer,e):"";n.length&&(r.ph_keyword=n)}return r}function ri(){if("undefined"!=typeof navigator)return navigator.language||navigator.userLanguage}function ni(){return(null==B?void 0:B.referrer)||"$direct"}function si(){var t;return(null==B?void 0:B.referrer)&&(null===(t=Q(B.referrer))||void 0===t?void 0:t.host)||"$direct"}function oi(t){var i,{r:e,u:r}=t,n={$referrer:e,$referring_domain:null==e?void 0:"$direct"===e?"$direct":null===(i=Q(e))||void 0===i?void 0:i.host};if(r){n.$current_url=r;var s=Q(r);n.$host=null==s?void 0:s.host,n.$pathname=null==s?void 0:s.pathname;var o=function(t){var i=ti.concat([]),e={};return A(i,function(i){var r=Z(t,i);e[i]=r||null}),e}(r);P(n,o)}e&&P(n,ei(e));return n}function ai(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function li(){try{return(new Date).getTimezoneOffset()}catch(t){return}}function ui(t,i){if(!q)return{};var e,n,s,[o,a]=function(t){for(var i=0;i<Gt.length;i++){var[e,r]=Gt[i],n=e.exec(t),s=n&&(tt(r)?r(n,t):r);if(s)return s}return["",""]}(q);return P(function(t){var i={};for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var r=t[e];null!=r&&""!==r&&(i[e]=r)}return i}({$os:o,$os_version:a,$browser:Ht(q,navigator.vendor),$device:Qt(q),$device_type:(n=q,s=Qt(n),s===ot||s===st||"Kobo"===s||"Kindle Fire"===s||s===Ut?nt:s===Ct||s===Tt||s===Et||s===Ot?"Console":s===lt?"Wearable":s?it:"Desktop"),$timezone:ai(),$timezone_offset:li()}),{$current_url:Y(null==N?void 0:N.href,[],ii),$host:null==N?void 0:N.host,$pathname:null==N?void 0:N.pathname,$raw_user_agent:q.length>1e3?q.substring(0,997)+"...":q,$browser_version:Kt(q,navigator.vendor),$browser_language:ri(),$browser_language_prefix:(e=ri(),"string"==typeof e?e.split("-")[0]:void 0),$screen_height:null==U?void 0:U.screen.height,$screen_width:null==U?void 0:U.screen.width,$viewport_height:null==U?void 0:U.innerHeight,$viewport_width:null==U?void 0:U.innerWidth,$lib:"web",$lib_version:r,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}class hi{constructor(t,i){void 0===t&&(t="localStorage"),this.A=null,this.storage=new K({method:t,cross_subdomain:i,sameSite:"Lax"}),this.userIdentity=this.loadUserIdentity()}getUserIdentity(){return e({},this.userIdentity)}getDistinctId(){return this.userIdentity.distinct_id}getAnonymousId(){return this.userIdentity.anonymous_id||(this.userIdentity.anonymous_id=this.generateAnonymousId(),this.storage.set(u,this.userIdentity.anonymous_id,J)),this.userIdentity.anonymous_id}getUserProperties(){return e({},this.userIdentity.properties)}getEffectiveId(){return this.userIdentity.distinct_id||this.getAnonymousId()}getDeviceId(){return this.userIdentity.device_id}getUserState(){return this.userIdentity.user_state}identify(t,i,r){if("number"==typeof t&&(t=t.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.")),t)if(this.isDistinctIdStringLike(t))console.error('The string "'+t+'" 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"!==t){var n=this.userIdentity.distinct_id;if(this.userIdentity.distinct_id=t,!this.userIdentity.device_id){var s=n||this.userIdentity.anonymous_id;this.userIdentity.device_id=s,this.userIdentity.properties=e({},this.userIdentity.properties,{$had_persisted_distinct_id:!0,$device_id:s})}t!==n&&(this.userIdentity.distinct_id=t);var o="anonymous"===this.userIdentity.user_state;t!==n&&o?(this.userIdentity.user_state="identified",i&&(this.userIdentity.properties=e({},this.userIdentity.properties,i)),r&&Object.keys(r).forEach(t=>{t in this.userIdentity.properties||(this.userIdentity.properties[t]=r[t])}),this.saveUserIdentity()):i||r?("anonymous"===this.userIdentity.user_state&&(this.userIdentity.user_state="identified"),i&&(this.userIdentity.properties=e({},this.userIdentity.properties,i)),r&&Object.keys(r).forEach(t=>{t in this.userIdentity.properties||(this.userIdentity.properties[t]=r[t])}),this.saveUserIdentity()):t!==n&&(this.userIdentity.user_state="identified",this.saveUserIdentity())}else console.error('The string "'+t+'" 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(t,i){if(!t&&!i)return!1;var r=this.userIdentity.distinct_id||this.userIdentity.anonymous_id,n=this.getPersonPropertiesHash(r,t,i);return this.A===n?(console.info("VTilt: A duplicate setUserProperties call was made with the same properties. It has been ignored."),!1):(t&&(this.userIdentity.properties=e({},this.userIdentity.properties,t)),i&&Object.keys(i).forEach(t=>{t in this.userIdentity.properties||(this.userIdentity.properties[t]=i[t])}),this.saveUserIdentity(),this.A=n,!0)}reset(t){var i=this.generateAnonymousId(),r=this.userIdentity.device_id,n=t?this.generateDeviceId():r;this.userIdentity={distinct_id:null,anonymous_id:i,device_id:n,properties:{},user_state:"anonymous"},this.A=null,this.saveUserIdentity(),this.userIdentity.properties=e({},this.userIdentity.properties,{$last_vtilt_reset:(new Date).toISOString()}),this.saveUserIdentity()}setDistinctId(t){this.userIdentity.distinct_id=t,this.saveUserIdentity()}setUserState(t){this.userIdentity.user_state=t,this.saveUserIdentity()}updateUserProperties(t,i){t&&(this.userIdentity.properties=e({},this.userIdentity.properties,t)),i&&Object.keys(i).forEach(t=>{t in this.userIdentity.properties||(this.userIdentity.properties[t]=i[t])}),this.saveUserIdentity()}ensureDeviceId(t){this.userIdentity.device_id||(this.userIdentity.device_id=t,this.userIdentity.properties=e({},this.userIdentity.properties,{$had_persisted_distinct_id:!0,$device_id:t}),this.saveUserIdentity())}createAlias(t,i){return this.isValidDistinctId(t)?(void 0===i&&(i=this.getDistinctId()||this.getAnonymousId()),this.isValidDistinctId(i)?t===i?(console.warn("alias matches current distinct_id - should use identify instead"),null):{distinct_id:t,original:i}:(console.warn("Invalid original distinct ID"),null)):(console.warn("Invalid alias provided"),null)}isDistinctIdStringLikePublic(t){return this.isDistinctIdStringLike(t)}set_initial_person_info(t,i){if(!this.getStoredUserProperties()[_]){var e=function(t,i){var e=t?L([],Yt,i||[]):[],r=null==N?void 0:N.href.substring(0,1e3);return{r:ni().substring(0,1e3),u:r?Y(r,e,ii):void 0}}(t,i);this.register_once({[_]:e},void 0)}}get_initial_props(){var t,i,e=this.getStoredUserProperties()[_];return e?(t=oi(e),i={},A(t,function(t,e){var r;i["$initial_"+(r=String(e),r.startsWith("$")?r.substring(1):r)]=t}),i):{}}update_referrer_info(){var t={$referrer:ni(),$referring_domain:si()};this.register_once(t,void 0)}loadUserIdentity(){var t=this.storage.get(u),i=this.storage.get(l),e=this.storage.get(d),r=this.storage.get(a),n=this.getStoredUserProperties(),s=t||this.generateAnonymousId(),o=i||this.generateDeviceId(),h=e||null,v=r||"anonymous",c=s||this.generateAnonymousId();return t||this.storage.set(u,c,J),i||this.storage.set(l,o,J),r||this.storage.set(a,v,J),{distinct_id:h,anonymous_id:c,device_id:o,properties:n,user_state:v}}saveUserIdentity(){this.storage.set(u,this.userIdentity.anonymous_id,J),this.storage.set(l,this.userIdentity.device_id,J),this.storage.set(a,this.userIdentity.user_state,J),this.userIdentity.distinct_id?this.storage.set(d,this.userIdentity.distinct_id,J):this.storage.remove(d),this.setStoredUserProperties(this.userIdentity.properties)}getStoredUserProperties(){return this.storage.getJSON(v)||{}}setStoredUserProperties(t){this.storage.setJSON(v,t,J)}register_once(t,i){var e=this.getStoredUserProperties(),r=!1;for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(n in e||(e[n]=t[n],r=!0));if(i)for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(s in e||(e[s]=i[s],r=!0));r&&this.setStoredUserProperties(e)}generateAnonymousId(){return"anon_"+M()}generateDeviceId(){return"device_"+M()}getPersonPropertiesHash(t,i,e){return JSON.stringify({distinct_id:t,userPropertiesToSet:i,userPropertiesToSetOnce:e})}isValidDistinctId(t){if(!t||"string"!=typeof t)return!1;var i=t.toLowerCase().trim();return!["null","undefined","false","true","anonymous","anon","user","test","guest","visitor","unknown","none"].includes(i)&&0!==t.trim().length}isDistinctIdStringLike(t){if(!t||"string"!=typeof t)return!1;var i=t.toLowerCase().trim();return["null","undefined","false","true","anonymous","anon","user","test","guest","visitor","unknown","none","demo","example","sample","placeholder"].includes(i)}updateStorageMethod(t,i){this.storage=new K({method:t,cross_subdomain:i,sameSite:"Lax"}),this.userIdentity=this.loadUserIdentity()}}var di=["LCP","CLS","FCP","INP"],vi=9e5,ci="[WebVitals]";class fi{static extractConfig(t){var i=t.capture_performance;return"boolean"==typeof i?{web_vitals:i}:"object"==typeof i&&null!==i?i:{web_vitals:!1}}constructor(t){this.name="WebVitals",this.O=!1,this._instance=t,this.P=this.L(),this.U=fi.extractConfig(t.getConfig())}get isEnabled(){var t=null==N?void 0:N.protocol;return("http:"===t||"https:"===t)&&!0===this.U.web_vitals}get isStarted(){return this.O}startIfEnabled(){if(this.isEnabled&&!this.O&&U){var t=this.D();t?this.j(t):this.B()}}stop(){this.O&&(this.N(),this.F&&(clearTimeout(this.F),this.F=void 0),this.O=!1)}onConfigUpdate(t){var i=fi.extractConfig(t),e=this.isEnabled;this.U=i,e||!this.isEnabled||this.O?e&&!this.isEnabled&&this.O&&this.stop():this.startIfEnabled()}get allowedMetrics(){return this.U.web_vitals_allowed_metrics||di}get flushTimeoutMs(){return this.U.web_vitals_delayed_flush_ms||5e3}get maxAllowedValue(){var t=this.U.__web_vitals_max_value;return void 0===t?vi:0===t?0:t<6e4?vi:t}L(){return{url:void 0,pathname:void 0,metrics:[],firstMetricTimestamp:void 0}}D(){var t;return null===(t=V.__VTiltExtensions__)||void 0===t?void 0:t.webVitalsCallbacks}B(){var t,i=null===(t=V.__VTiltExtensions__)||void 0===t?void 0:t.loadExternalDependency;i?i(this._instance,"web-vitals",t=>{if(t)console.error(ci+" Failed to load web-vitals:",t);else{var i=this.D();i?this.j(i):console.error(ci+" web-vitals loaded but callbacks not registered")}}):console.warn(ci+" External dependency loader not available. Include web-vitals.ts entrypoint or use array.full.js bundle.")}j(t){if(!this.O){var i=this.allowedMetrics,e=this.q.bind(this);i.includes("LCP")&&t.onLCP&&t.onLCP(e),i.includes("CLS")&&t.onCLS&&t.onCLS(e,{reportAllChanges:!0}),i.includes("FCP")&&t.onFCP&&t.onFCP(e),i.includes("INP")&&t.onINP&&t.onINP(e),i.includes("TTFB")&&t.onTTFB&&t.onTTFB(e),this.O=!0}}V(){var t;return null===(t=null==U?void 0:U.location)||void 0===t?void 0:t.href}W(){return null==N?void 0:N.pathname}q(t){try{if(!U||!B||!N)return;if(!(null==t?void 0:t.name)||void 0===(null==t?void 0:t.value))return void console.warn(ci+" Invalid metric received",t);if(this.maxAllowedValue>0&&t.value>=this.maxAllowedValue&&"CLS"!==t.name)return void console.warn(ci+" Ignoring "+t.name+" with value >= "+this.maxAllowedValue+"ms");var i=this.V(),r=this.W();if(!i)return void console.warn(ci+" Could not determine current URL");this.P.url&&this.P.url!==i&&this.N(),this.P.url||(this.P.url=i,this.P.pathname=r),this.P.firstMetricTimestamp||(this.P.firstMetricTimestamp=Date.now());var n=this.J(t.attribution),s=this._instance.getSessionId(),o=this.H(),a=e({},t,{attribution:n,timestamp:Date.now(),$current_url:i,$session_id:s,$window_id:o}),l=this.P.metrics.findIndex(i=>i.name===t.name);l>=0?this.P.metrics[l]=a:this.P.metrics.push(a),this.X(),this.P.metrics.length>=this.allowedMetrics.length&&this.N()}catch(t){console.error(ci+" Error adding metric to buffer:",t)}}J(t){if(t){var i=e({},t);return"interactionTargetElement"in i&&delete i.interactionTargetElement,i}}H(){var t;try{return(null===(t=this._instance.sessionManager)||void 0===t?void 0:t.getWindowId())||null}catch(t){return null}}X(){this.F&&clearTimeout(this.F),this.F=setTimeout(()=>{this.N()},this.flushTimeoutMs)}N(){if(this.F&&(clearTimeout(this.F),this.F=void 0),0!==this.P.metrics.length){try{var t={$pathname:this.P.pathname,$current_url:this.P.url};for(var i of this.P.metrics)t["$web_vitals_"+i.name+"_value"]=i.value,t["$web_vitals_"+i.name+"_event"]={name:i.name,value:i.value,delta:i.delta,rating:i.rating,id:i.id,navigationType:i.navigationType,attribution:i.attribution,$session_id:i.$session_id,$window_id:i.$window_id};this._instance.capture("$web_vitals",t)}catch(t){console.error(ci+" Error flushing metrics:",t)}this.P=this.L()}}}function pi(t,i,e){try{if(!(i in t))return()=>{};var r=t[i],n=e(r);return tt(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__vtilt_wrapped__:{enumerable:!1,value:!0}})),t[i]=n,()=>{t[i]=r}}catch(t){return()=>{}}}class gi{constructor(t,i){var e;this.name="HistoryAutocapture",this.O=!1,this._instance=t,this.U=i||gi.extractConfig(t.getConfig()),this.K=(null===(e=null==U?void 0:U.location)||void 0===e?void 0:e.pathname)||""}static extractConfig(t){return{enabled:!1!==t.capture_pageview}}get isEnabled(){return!1!==this.U.enabled&&!1!==this._instance.getConfig().capture_pageview}get isStarted(){return this.O}startIfEnabled(){this.isEnabled&&!this.O&&this.G()}stop(){this.O&&(this.Z&&(this.Z(),this.Z=void 0),this.O=!1)}onConfigUpdate(t){this.U=gi.extractConfig(t),this.isEnabled&&!this.O?this.G():!this.isEnabled&&this.O&&this.stop()}G(){U&&N&&(this.K=N.pathname||"",this.Y(),this.tt(),this.O=!0)}Y(){var t,i;if(null==U?void 0:U.history){var e=this;(null===(t=U.history.pushState)||void 0===t?void 0:t.__vtilt_wrapped__)||pi(U.history,"pushState",t=>function(i,r,n){t.call(this,i,r,n),e.it("pushState")}),(null===(i=U.history.replaceState)||void 0===i?void 0:i.__vtilt_wrapped__)||pi(U.history,"replaceState",t=>function(i,r,n){t.call(this,i,r,n),e.it("replaceState")})}}tt(){if(!this.Z&&U){var t=()=>{this.it("popstate")};O(U,"popstate",t),this.Z=()=>{null==U||U.removeEventListener("popstate",t)}}}it(t){this.isEnabled&&this.O&&b(()=>{var i,e=null===(i=null==U?void 0:U.location)||void 0===i?void 0:i.pathname;if(e&&N&&B){if(e!==this.K){var r={navigation_type:t};this._instance.capture("$pageview",r)}this.K=e}})}}var _i=["a","button","form","input","select","textarea","label"],mi="$copy_autocapture";function bi(t){return null==t}function wi(t){return"string"==typeof t}function yi(t){return void 0===t}function Si(t){return t.replace(/^\s+|\s+$/g,"")}function xi(t,i){return t.indexOf(i)>-1}function ki(t){return 1===(null==t?void 0:t.nodeType)}function Ci(t){return 3===(null==t?void 0:t.nodeType)}function Ei(t,i){var e;return(null===(e=null==t?void 0:t.tagName)||void 0===e?void 0:e.toLowerCase())===i}function Ti(t){return 11===(null==t?void 0:t.nodeType)}function Ii(t){return t?Si(t).split(/\s+/):[]}function $i(t){var i="";switch(typeof t.className){case"string":i=t.className;break;case"object":i=(t.className&&"baseVal"in t.className&&"string"==typeof t.className.baseVal?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:i=""}return Ii(i)}function Mi(t){return bi(t)?null:Si(t).split(/(\s+)/).filter(t=>qi(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Ri(t){var i,e="";if(Wi(t)&&!Ji(t)&&t.childNodes&&t.childNodes.length)for(var r=0;r<t.childNodes.length;r++){var n=t.childNodes[r];Ci(n)&&n.textContent&&(e+=null!==(i=Mi(n.textContent))&&void 0!==i?i:"")}return Si(e)}function Ai(t){var i,e="";if(t&&t.childNodes&&t.childNodes.length)for(var r=0;r<t.childNodes.length;r++){var n=t.childNodes[r];if(n&&"span"===(null===(i=n.tagName)||void 0===i?void 0:i.toLowerCase()))try{e=(e+" "+Ri(n)).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+Ai(n)).trim())}catch(t){}}return e}function Oi(t){var i=Ri(t);return qi(i=(i+" "+Ai(t)).trim())?i:""}function Pi(t){if(t.previousElementSibling)return t.previousElementSibling;var i=t;do{i=i.previousSibling}while(i&&!ki(i));return i}function Li(t){var i=t.parentNode;return!(!i||!ki(i))&&i}function Ui(t){var i=null==U?void 0:U.location.href;return!!(i&&t&&t.some(t=>i.match(t)))}var Di="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",ji=new RegExp("^(?:"+Di+")$"),Bi=new RegExp(Di),Ni="\\d{3}-?\\d{2}-?\\d{4}",zi=new RegExp("^("+Ni+")$"),Fi=new RegExp("("+Ni+")");function qi(t,i){if(void 0===i&&(i=!0),bi(t))return!1;if(wi(t)){if(t=Si(t),(i?ji:Bi).test((t||"").replace(/[- ]/g,"")))return!1;if((i?zi:Fi).test(t))return!1}return!0}function Vi(t){return!!wi(t)&&("_ngcontent"===t.substring(0,10)||"_nghost"===t.substring(0,7))}function Wi(t){for(var i=t;i&&i.parentNode&&!Ei(i,"body");i=i.parentNode){var e=$i(i);if(xi(e,"vt-sensitive")||xi(e,"vt-no-capture"))return!1}if(xi($i(t),"vt-include"))return!0;var r=t.type||"";if(wi(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";if(wi(n)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Ji(t){return!!(Ei(t,"input")&&!["button","checkbox","submit","reset","radio"].includes(t.type)||Ei(t,"textarea")||"true"===t.getAttribute("contenteditable"))}function Hi(t){if(!Wi(t))return null;if(Ei(t,"input")){var i=t,e=(i.type||"text").toLowerCase();if("password"===e||"hidden"===e)return null;if("checkbox"===e||"radio"===e){var r={$el_value:i.checked?"true":"false"},n=function(t){var i=t.closest("label");if(i){var e=Si(i.textContent||"");if(e&&qi(e))return Mi(e)||null}if(t.id)try{var r=null===document||void 0===document?void 0:document.querySelector('label[for="'+t.id+'"]');if(r){var n=Si(r.textContent||"");if(n&&qi(n))return Mi(n)||null}}catch(t){}return null}(i);return n?r.$selected_text=n:i.value&&qi(i.value)&&(r.$selected_text=i.value),r}var s=i.value;if(s&&qi(s)){var o=Mi(s);if(o)return{$el_value:o}}return null}if(Ei(t,"select")){var a=t,l=a.selectedIndex;if(l>=0&&a.options[l]){var u=a.options[l],h={};u.value&&qi(u.value)&&(h.$el_value=u.value);var d=u.text;if(d&&qi(d)){var v=Mi(d);v&&(h.$selected_text=v)}if(h.$el_value||h.$selected_text)return h}return null}return Ei(t,"textarea"),null}function Xi(t,i,e,r,n){if(void 0===e&&(e=void 0),!U||!t||Ei(t,"html")||!ki(t))return!1;if((null==e?void 0:e.url_allowlist)&&!Ui(e.url_allowlist))return!1;if((null==e?void 0:e.url_ignorelist)&&Ui(e.url_ignorelist))return!1;if(null==e?void 0:e.dom_event_allowlist){var s=e.dom_event_allowlist;if(s&&!s.some(t=>i.type===t))return!1}for(var o=!1,a=[t],l=!0,u=t;u.parentNode&&!Ei(u,"body");)if(Ti(u.parentNode))a.push(u.parentNode.host),u=u.parentNode.host;else{if(!(l=Li(u)))break;if(r||_i.indexOf(l.tagName.toLowerCase())>-1)o=!0;else{var h=U.getComputedStyle(l);h&&"pointer"===h.getPropertyValue("cursor")&&(o=!0)}a.push(l),u=l}if(!function(t,i){var e=null==i?void 0:i.element_allowlist;if(yi(e))return!0;var r,n=function(t){if(e.some(i=>t.tagName.toLowerCase()===i))return{v:!0}};for(var s of t)if(r=n(s))return r.v;return!1}(a,e))return!1;if(!function(t,i){var e=null==i?void 0:i.css_selector_allowlist;if(yi(e))return!0;var r,n=function(t){if(e.some(i=>t.matches(i)))return{v:!0}};for(var s of t)if(r=n(s))return r.v;return!1}(a,e))return!1;var d=U.getComputedStyle(t);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===i.type)return!0;var v=t.tagName.toLowerCase();switch(v){case"html":return!1;case"form":return(n||["submit"]).indexOf(i.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(i.type)>=0;default:return o?(n||["click"]).indexOf(i.type)>=0:(n||["click"]).indexOf(i.type)>=0&&(_i.indexOf(v)>-1||"true"===t.getAttribute("contenteditable"))}}function Ki(t,i){return i.length>t?i.slice(0,t)+"...":i}function Gi(t,i,e,r){var n=t.tagName.toLowerCase(),s={tag_name:n};_i.indexOf(n)>-1&&!e&&(s.$el_text=Ki(1024,"a"===n||"button"===n?Oi(t):Ri(t)));var o=$i(t);o.length>0&&(s.classes=o.filter(t=>""!==t));for(var a=0;a<t.attributes.length;a++){var l=t.attributes[a];if((!Ji(t)||-1!==["name","id","class","aria-label"].indexOf(l.name))&&(!(null==r?void 0:r.includes(l.name))&&!i&&qi(l.value)&&!Vi(l.name))){var u=l.value;"class"===l.name&&(u=Ii(u).join(" ")),s["attr__"+l.name]=Ki(1024,u)}}for(var h=1,d=1,v=t;v=Pi(v);)h++,v.tagName===t.tagName&&d++;return s.nth_child=h,s.nth_of_type=d,s}function Qi(t){if(!Wi(t))return{};for(var i={},e=0;e<t.attributes.length;e++){var r=t.attributes[e];if(r.name&&0===r.name.indexOf("data-vt-capture-attribute")){var n=r.name.replace("data-vt-capture-attribute-",""),s=r.value;n&&s&&qi(s)&&(i[n]=s)}}return i}function Zi(t){return t.replace(/"|\\"/g,'\\"')}function Yi(t){var i,e=t.attr__class;return e?(i=e,Array.isArray(i)?e:Ii(e)):void 0}function te(t){return function(t){var i=t.map(t=>{var i,r,n="";if(t.tag_name&&(n+=t.tag_name),t.attr_class)for(var s of(t.attr_class.sort(),t.attr_class))n+="."+s.replace(/"/g,"");var o=e({},t.text?{text:t.text}:{},{"nth-child":null!==(i=t.nth_child)&&void 0!==i?i:0,"nth-of-type":null!==(r=t.nth_of_type)&&void 0!==r?r:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),a={};return Object.entries(o).sort((t,i)=>{var[e]=t,[r]=i;return e.localeCompare(r)}).forEach(t=>{var[i,e]=t;return a[Zi(i.toString())]=Zi(String(e))}),(n+=":")+Object.entries(a).map(t=>{var[i,e]=t;return i+'="'+e+'"'}).join("")});return i.join(";")}(function(t){return t.map(t=>{var i,e,r={text:null===(i=t.$el_text)||void 0===i?void 0:i.slice(0,400),tag_name:t.tag_name,href:null===(e=t.attr__href)||void 0===e?void 0:e.slice(0,2048),attr_class:Yi(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Object.entries(t).filter(t=>{var[i]=t;return 0===i.indexOf("attr__")}).forEach(t=>{var[i,e]=t;return r.attributes[i]=e}),r})}(t))}function ie(t,i){return t.indexOf(i)>-1}class ee{constructor(){this.clicks=[],this.RAGE_CLICK_THRESHOLD_PX=30,this.RAGE_CLICK_TIMEOUT_MS=1e3,this.RAGE_CLICK_CLICK_COUNT=3}isRageClick(t,i,e){if(this.clicks=this.clicks.filter(t=>e-t.timestamp<this.RAGE_CLICK_TIMEOUT_MS),this.clicks.length>0){var r=this.clicks[this.clicks.length-1];Math.sqrt(Math.pow(t-r.x,2)+Math.pow(i-r.y,2))>this.RAGE_CLICK_THRESHOLD_PX&&(this.clicks=[])}return this.clicks.push({x:t,y:i,timestamp:e}),this.clicks.length>=this.RAGE_CLICK_CLICK_COUNT}}function re(t,i){for(var e,r,n,s,{e:o,maskAllElementAttributes:a,maskAllText:l,elementAttributeIgnoreList:u,elementsChainAsString:h,captureElementValues:d}=i,v=[t],c=t;c.parentNode&&!Ei(c,"body");)Ti(c.parentNode)?(v.push(c.parentNode.host),c=c.parentNode.host):(v.push(c.parentNode),c=c.parentNode);var f,p=[],g={},_=!1,m=!1;for(var b of v){var w=Wi(b);if("a"===b.tagName.toLowerCase()){var y=b.getAttribute("href");_=!!(w&&y&&qi(y))&&y}ie($i(b),"vt-no-capture")&&(m=!0),p.push(Gi(b,a,l,u));var S=Qi(b);Object.assign(g,S)}if(m)return{props:{},explicitNoCapture:m};if(l||("a"===t.tagName.toLowerCase()||"button"===t.tagName.toLowerCase()?p[0].$el_text=Oi(t):p[0].$el_text=Ri(t)),"change"===o.type&&d){var x=Hi(t);x&&(x.$el_value&&(p[0].$el_value=x.$el_value),x.$selected_text&&(p[0].$selected_text=x.$selected_text))}if(_){p[0].attr__href=_;var k=null===(e=Q(_))||void 0===e?void 0:e.host,C=null===(r=null==U?void 0:U.location)||void 0===r?void 0:r.host;k&&C&&k!==C&&(f=_)}var E=function(){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];return Object.assign({},...i)}({$event_type:o.type,$ce_version:1},h?{}:{$elements:p},{$elements_chain:te(p)},(null===(n=p[0])||void 0===n?void 0:n.$el_text)?{$el_text:null===(s=p[0])||void 0===s?void 0:s.$el_text}:{},f&&"click"===o.type?{$external_click_url:f}:{},g);return{props:E}}class ne{constructor(t){this.name="Autocapture",this.et=!1,this.rt=null,this.nt=null,this.st=new ee,this.ot=!1,this._instance=t}get U(){var t,i=this._instance.getConfig(),e="object"!=typeof(t=i.autocapture)||null===t||Array.isArray(t)?{}:i.autocapture;return e.url_allowlist&&(e.url_allowlist=e.url_allowlist.map(t=>"string"==typeof t?new RegExp(t):t)),e.url_ignorelist&&(e.url_ignorelist=e.url_ignorelist.map(t=>"string"==typeof t?new RegExp(t):t)),e}get isEnabled(){var t,i=null!==(t=this.rt)&&void 0!==t&&t;return!!this._instance.getConfig().autocapture&&!i}get isStarted(){return this.et}startIfEnabled(){this.isEnabled&&!this.et&&(this.lt(),this.et=!0)}stop(){this.et=!1}onConfigUpdate(t){this.isEnabled&&!this.et&&this.startIfEnabled()}onRemoteConfig(t){t.elementsChainAsString&&(this.ot=t.elementsChainAsString),this.rt=!!t.autocapture_opt_out,this.startIfEnabled()}updateConfig(t){void 0!==t.enabled&&t.enabled&&(this.rt=!1)}setElementSelectors(t){this.nt=t}getElementSelectors(t){var i,e=[];return null===(i=this.nt)||void 0===i||i.forEach(i=>{var r=null==B?void 0:B.querySelectorAll(i);null==r||r.forEach(r=>{t===r&&e.push(i)})}),e}lt(){if(this.ut()&&U&&B){var t=t=>{t=t||(null==U?void 0:U.event);try{this.ht(t)}catch(t){}};if(O(B,"submit",t,{capture:!0}),O(B,"change",t,{capture:!0}),O(B,"click",t,{capture:!0}),this.U.capture_copied_text){var i=t=>{t=t||(null==U?void 0:U.event),this.ht(t,mi)};O(B,"copy",i,{capture:!0}),O(B,"cut",i,{capture:!0})}}}ht(t,i){var e,r,n,s,o;if(void 0===i&&(i="$autocapture"),this.isEnabled){var a=function(t){var i;return yi(t.target)?t.srcElement||null:(null===(i=t.target)||void 0===i?void 0:i.shadowRoot)?t.composedPath()[0]||null:t.target||null}(t);if(Ci(a)&&(a=a.parentNode||null),"$autocapture"===i&&"click"===t.type&&t instanceof MouseEvent)this._instance.getConfig().rageclick&&(null===(e=this.st)||void 0===e?void 0:e.isRageClick(t.clientX,t.clientY,(new Date).getTime()))&&this.ht(t,"$rageclick");var l=i===mi;if(a&&Xi(a,t,this.U,l,l?["copy","cut"]:void 0)){var u=this._instance.getConfig(),{props:h,explicitNoCapture:d}=re(a,{e:t,maskAllElementAttributes:null!==(r=u.mask_all_element_attributes)&&void 0!==r&&r,maskAllText:null!==(n=u.mask_all_text)&&void 0!==n&&n,elementAttributeIgnoreList:this.U.element_attribute_ignorelist,elementsChainAsString:this.ot,captureElementValues:null!==(s=this.U.capture_element_values)&&void 0!==s&&s});if(d)return!1;var v=this.getElementSelectors(a);if(v&&v.length>0&&(h.$element_selectors=v),i===mi){var c=Mi(null===(o=null==U?void 0:U.getSelection())||void 0===o?void 0:o.toString()),f=t.type||"clipboard";if(!c)return!1;h.$selected_content=c,h.$copy_type=f}return this._instance.capture(i,h),!0}}}ut(){return"function"==typeof(null==B?void 0:B.querySelectorAll)}}var se="[SessionRecording]";class oe{constructor(t,i){this._instance=t,this.name="SessionRecording",this.O=!1,this.U=i||oe.extractConfig(t.getConfig())}static extractConfig(t){var i,e,r,n=t.session_recording||{};return{enabled:null!==(i=n.enabled)&&void 0!==i&&i,sampleRate:n.sampleRate,minimumDurationMs:n.minimumDurationMs,sessionIdleThresholdMs:n.sessionIdleThresholdMs,fullSnapshotIntervalMs:n.fullSnapshotIntervalMs,captureConsole:null!==(e=n.captureConsole)&&void 0!==e&&e,captureNetwork:null!==(r=n.captureNetwork)&&void 0!==r&&r,captureCanvas:n.captureCanvas,blockClass:n.blockClass,blockSelector:n.blockSelector,ignoreClass:n.ignoreClass,maskTextClass:n.maskTextClass,maskTextSelector:n.maskTextSelector,maskAllInputs:n.maskAllInputs,maskInputOptions:n.maskInputOptions,masking:n.masking,recordHeaders:n.recordHeaders,recordBody:n.recordBody,compressEvents:n.compressEvents,__mutationThrottlerRefillRate:n.__mutationThrottlerRefillRate,__mutationThrottlerBucketSize:n.__mutationThrottlerBucketSize}}get isEnabled(){var t,i=this._instance.getConfig(),e=null!==(t=this.U.enabled)&&void 0!==t&&t,r=!i.disable_session_recording;return!!U&&e&&r}get isStarted(){var t;return this.O&&!!(null===(t=this.dt)||void 0===t?void 0:t.isStarted)}startIfEnabled(){this.startIfEnabledOrStop("recording_initialized")}startIfEnabledOrStop(t){var i;if(!this.isEnabled||!(null===(i=this.dt)||void 0===i?void 0:i.isStarted)){var e=void 0!==Object.assign&&void 0!==Array.from;this.isEnabled&&e?(this.ct(t),this.O=!0,console.info(se+" starting")):this.stop()}}stop(){b(()=>{var t;null===(t=this.dt)||void 0===t||t.stop(),this.O=!1})}onConfigUpdate(t){var i;this.U=oe.extractConfig(t),null===(i=this.dt)||void 0===i||i.updateConfig(this.U),this.startIfEnabledOrStop("config_updated")}onRemoteConfig(t){var i,r,n,s,o,a,l;if(t.sessionRecording){var u=t.sessionRecording;this.U=e({},this.U,{enabled:null!==(i=this.U.enabled)&&void 0!==i?i:u.enabled,sampleRate:null!==(r=this.U.sampleRate)&&void 0!==r?r:u.sampleRate,minimumDurationMs:null!==(n=this.U.minimumDurationMs)&&void 0!==n?n:u.minimumDurationMs,fullSnapshotIntervalMs:null!==(s=this.U.fullSnapshotIntervalMs)&&void 0!==s?s:u.fullSnapshotIntervalMs,maskAllInputs:null!==(o=this.U.maskAllInputs)&&void 0!==o?o:u.maskAllInputs,captureConsole:null!==(a=this.U.captureConsole)&&void 0!==a?a:u.captureConsole,captureCanvas:null!==(l=this.U.captureCanvas)&&void 0!==l?l:u.captureCanvas}),this.startIfEnabledOrStop("remote_config")}}get started(){return this.isStarted}get status(){var t;return(null===(t=this.dt)||void 0===t?void 0:t.status)||"lazy_loading"}get sessionId(){var t;return(null===(t=this.dt)||void 0===t?void 0:t.sessionId)||""}stopRecording(){this.stop()}log(t,i){var e;void 0===i&&(i="log"),(null===(e=this.dt)||void 0===e?void 0:e.log)?this.dt.log(t,i):console.warn(se+" log called before recorder was ready")}updateConfig(t){var i;this.U=e({},this.U,t),null===(i=this.dt)||void 0===i||i.updateConfig(this.U)}get ft(){return"recorder"}ct(t){var i,e,r,n;if(this.isEnabled)if((null===(e=null===(i=null==V?void 0:V.__VTiltExtensions__)||void 0===i?void 0:i.rrweb)||void 0===e?void 0:e.record)&&(null===(r=V.__VTiltExtensions__)||void 0===r?void 0:r.initSessionRecording))this.gt(t);else{var s=null===(n=V.__VTiltExtensions__)||void 0===n?void 0:n.loadExternalDependency;s?s(this._instance,this.ft,i=>{i?console.error(se+" could not load recorder:",i):this.gt(t)}):console.error(se+" loadExternalDependency not available. Session recording cannot start.")}}gt(t){var i,e=null===(i=V.__VTiltExtensions__)||void 0===i?void 0:i.initSessionRecording;e?(this.dt||(this.dt=e(this._instance,this.U)),this.dt.start(t)):console.error(se+" initSessionRecording not available after script load")}}var ae=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(ae||{}),le=Uint8Array,ue=Uint16Array,he=Int32Array,de=new le([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]),ve=new le([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]),ce=new le([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),fe=function(t,i){for(var e=new ue(31),r=0;r<31;++r)e[r]=i+=1<<t[r-1];var n=new he(e[30]);for(r=1;r<30;++r)for(var s=e[r];s<e[r+1];++s)n[s]=s-e[r]<<5|r;return{b:e,r:n}},pe=fe(de,2),ge=pe.b,_e=pe.r;ge[28]=258,_e[258]=28;for(var me=fe(ve,0).r,be=new ue(32768),we=0;we<32768;++we){var ye=(43690&we)>>1|(21845&we)<<1;ye=(61680&(ye=(52428&ye)>>2|(13107&ye)<<2))>>4|(3855&ye)<<4,be[we]=((65280&ye)>>8|(255&ye)<<8)>>1}var Se=function(t,i,e){for(var r=t.length,n=0,s=new ue(i);n<r;++n)t[n]&&++s[t[n]-1];var o,a=new ue(i);for(n=1;n<i;++n)a[n]=a[n-1]+s[n-1]<<1;if(e){o=new ue(1<<i);var l=15-i;for(n=0;n<r;++n)if(t[n])for(var u=n<<4|t[n],h=i-t[n],d=a[t[n]-1]++<<h,v=d|(1<<h)-1;d<=v;++d)o[be[d]>>l]=u}else for(o=new ue(r),n=0;n<r;++n)t[n]&&(o[n]=be[a[t[n]-1]++]>>15-t[n]);return o},xe=new le(288);for(we=0;we<144;++we)xe[we]=8;for(we=144;we<256;++we)xe[we]=9;for(we=256;we<280;++we)xe[we]=7;for(we=280;we<288;++we)xe[we]=8;var ke=new le(32);for(we=0;we<32;++we)ke[we]=5;var Ce=Se(xe,9,0),Ee=Se(ke,5,0),Te=function(t){return(t+7)/8|0},Ie=function(t,i,e){return(null==e||e>t.length)&&(e=t.length),new le(t.subarray(i,e))},$e=function(t,i,e){e<<=7&i;var r=i/8|0;t[r]|=e,t[r+1]|=e>>8},Me=function(t,i,e){e<<=7&i;var r=i/8|0;t[r]|=e,t[r+1]|=e>>8,t[r+2]|=e>>16},Re=function(t,i){for(var e=[],r=0;r<t.length;++r)t[r]&&e.push({s:r,f:t[r]});var n=e.length,s=e.slice();if(!n)return{t:je,l:0};if(1==n){var o=new le(e[0].s+1);return o[e[0].s]=1,{t:o,l:1}}e.sort(function(t,i){return t.f-i.f}),e.push({s:-1,f:25001});var a=e[0],l=e[1],u=0,h=1,d=2;for(e[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=n-1;)a=e[e[u].f<e[d].f?u++:d++],l=e[u!=h&&e[u].f<e[d].f?u++:d++],e[h++]={s:-1,f:a.f+l.f,l:a,r:l};var v=s[0].s;for(r=1;r<n;++r)s[r].s>v&&(v=s[r].s);var c=new ue(v+1),f=Ae(e[h-1],c,0);if(f>i){r=0;var p=0,g=f-i,_=1<<g;for(s.sort(function(t,i){return c[i.s]-c[t.s]||t.f-i.f});r<n;++r){var m=s[r].s;if(!(c[m]>i))break;p+=_-(1<<f-c[m]),c[m]=i}for(p>>=g;p>0;){var b=s[r].s;c[b]<i?p-=1<<i-c[b]++-1:++r}for(;r>=0&&p;--r){var w=s[r].s;c[w]==i&&(--c[w],++p)}f=i}return{t:new le(c),l:f}},Ae=function(t,i,e){return-1==t.s?Math.max(Ae(t.l,i,e+1),Ae(t.r,i,e+1)):i[t.s]=e},Oe=function(t){for(var i=t.length;i&&!t[--i];);for(var e=new ue(++i),r=0,n=t[0],s=1,o=function(t){e[r++]=t},a=1;a<=i;++a)if(t[a]==n&&a!=i)++s;else{if(!n&&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(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=t[a]}return{c:e.subarray(0,r),n:i}},Pe=function(t,i){for(var e=0,r=0;r<i.length;++r)e+=t[r]*i[r];return e},Le=function(t,i,e){var r=e.length,n=Te(i+2);t[n]=255&r,t[n+1]=r>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;s<r;++s)t[n+s+4]=e[s];return 8*(n+4+r)},Ue=function(t,i,e,r,n,s,o,a,l,u,h){$e(i,h++,e),++n[256];for(var d=Re(n,15),v=d.t,c=d.l,f=Re(s,15),p=f.t,g=f.l,_=Oe(v),m=_.c,b=_.n,w=Oe(p),y=w.c,S=w.n,x=new ue(19),k=0;k<m.length;++k)++x[31&m[k]];for(k=0;k<y.length;++k)++x[31&y[k]];for(var C=Re(x,7),E=C.t,T=C.l,I=19;I>4&&!E[ce[I-1]];--I);var M,R,A,O,P=u+5<<3,L=Pe(n,xe)+Pe(s,ke)+o,U=Pe(n,v)+Pe(s,p)+o+14+3*I+Pe(x,E)+2*x[16]+3*x[17]+7*x[18];if(l>=0&&P<=L&&P<=U)return Le(i,h,t.subarray(l,l+u));if($e(i,h,1+(U<L)),h+=2,U<L){M=Se(v,c,0),R=v,A=Se(p,g,0),O=p;var D=Se(E,T,0);$e(i,h,b-257),$e(i,h+5,S-1),$e(i,h+10,I-4),h+=14;for(k=0;k<I;++k)$e(i,h+3*k,E[ce[k]]);h+=3*I;for(var j=[m,y],B=0;B<2;++B){var N=j[B];for(k=0;k<N.length;++k){var z=31&N[k];$e(i,h,D[z]),h+=E[z],z>15&&($e(i,h,N[k]>>5&127),h+=N[k]>>12)}}}else M=Ce,R=xe,A=Ee,O=ke;for(k=0;k<a;++k){var F=r[k];if(F>255){Me(i,h,M[(z=F>>18&31)+257]),h+=R[z+257],z>7&&($e(i,h,F>>23&31),h+=de[z]);var q=31&F;Me(i,h,A[q]),h+=O[q],q>3&&(Me(i,h,F>>5&8191),h+=ve[q])}else Me(i,h,M[F]),h+=R[F]}return Me(i,h,M[256]),h+R[256]},De=new he([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),je=new le(0),Be=function(){for(var t=new Int32Array(256),i=0;i<256;++i){for(var e=i,r=9;--r;)e=(1&e&&-306674912)^e>>>1;t[i]=e}return t}(),Ne=function(t,i,e,r,n){if(!n&&(n={l:1},i.dictionary)){var s=i.dictionary.subarray(-32768),o=new le(s.length+t.length);o.set(s),o.set(t,s.length),t=o,n.w=s.length}return function(t,i,e,r,n,s){var o=s.z||t.length,a=new le(r+o+5*(1+Math.ceil(o/7e3))+n),l=a.subarray(r,a.length-n),u=s.l,h=7&(s.r||0);if(i){h&&(l[0]=s.r>>3);for(var d=De[i-1],v=d>>13,c=8191&d,f=(1<<e)-1,p=s.p||new ue(32768),g=s.h||new ue(f+1),_=Math.ceil(e/3),m=2*_,b=function(i){return(t[i]^t[i+1]<<_^t[i+2]<<m)&f},w=new he(25e3),y=new ue(288),S=new ue(32),x=0,k=0,C=s.i||0,E=0,T=s.w||0,I=0;C+2<o;++C){var M=b(C),R=32767&C,A=g[M];if(p[R]=A,g[M]=R,T<=C){var O=o-C;if((x>7e3||E>24576)&&(O>423||!u)){h=Ue(t,l,0,w,y,S,k,E,I,C-I,h),E=x=k=0,I=C;for(var P=0;P<286;++P)y[P]=0;for(P=0;P<30;++P)S[P]=0}var L=2,U=0,D=c,j=R-A&32767;if(O>2&&M==b(C-j))for(var B=Math.min(v,O)-1,N=Math.min(32767,C),z=Math.min(258,O);j<=N&&--D&&R!=A;){if(t[C+L]==t[C+L-j]){for(var F=0;F<z&&t[C+F]==t[C+F-j];++F);if(F>L){if(L=F,U=j,F>B)break;var q=Math.min(j,F-2),V=0;for(P=0;P<q;++P){var W=C-j+P&32767,J=W-p[W]&32767;J>V&&(V=J,A=W)}}}j+=(R=A)-(A=p[R])&32767}if(U){w[E++]=268435456|_e[L]<<18|me[U];var H=31&_e[L],X=31&me[U];k+=de[H]+ve[X],++y[257+H],++S[X],T=C+L,++x}else w[E++]=t[C],++y[t[C]]}}for(C=Math.max(C,T);C<o;++C)w[E++]=t[C],++y[t[C]];h=Ue(t,l,u,w,y,S,k,E,I,C-I,h),u||(s.r=7&h|l[h/8|0]<<3,h-=7,s.h=g,s.p=p,s.i=C,s.w=T)}else{for(C=s.w||0;C<o+u;C+=65535){var K=C+65535;K>=o&&(l[h/8|0]=u,K=o),h=Le(l,h+1,t.subarray(C,K))}s.i=o}return Ie(a,0,r+Te(h)+n)}(t,null==i.level?6:i.level,null==i.mem?n.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):20:12+i.mem,e,r,n)},ze=function(t,i,e){for(;e;++i)t[i]=e,e>>>=8};function Fe(t,i){i||(i={});var e=function(){var t=-1;return{p:function(i){for(var e=t,r=0;r<i.length;++r)e=Be[255&e^i[r]]^e>>>8;t=e},d:function(){return~t}}}(),r=t.length;e.p(t);var n,s=Ne(t,i,10+((n=i).filename?n.filename.length+1:0),8),o=s.length;return function(t,i){var e=i.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=i.level<2?4:9==i.level?2:0,t[9]=3,0!=i.mtime&&ze(t,4,Math.floor(new Date(i.mtime||Date.now())/1e3)),e){t[3]=8;for(var r=0;r<=e.length;++r)t[r+10]=e.charCodeAt(r)}}(s,i),ze(s,o-8,e.d()),ze(s,o-4,r),s}var qe="undefined"!=typeof TextEncoder&&new TextEncoder,Ve="undefined"!=typeof TextDecoder&&new TextDecoder;try{Ve.decode(je,{stream:!0})}catch(t){}ae.MouseMove,ae.MouseInteraction,ae.Scroll,ae.ViewportResize,ae.Input,ae.TouchMove,ae.MediaInteraction,ae.Drag;var We="[Chat]";class Je{constructor(t,i){this._instance=t,this.name="Chat",this._t=null,this.bt=!1,this.wt=!1,this.O=!1,this.yt=null,this.St=[],this.xt=[],this.kt=[],this.Ct=[],this.Et=[],this.U=i||Je.extractConfig(t.getConfig())}static extractConfig(t){var i,e=t.chat||{};return{enabled:e.enabled,autoConfig:null===(i=e.autoConfig)||void 0===i||i,position:e.position,greeting:e.greeting,color:e.color,aiMode:e.aiMode,aiGreeting:e.aiGreeting,preload:e.preload,offlineMessage:e.offlineMessage,collectEmailOffline:e.collectEmailOffline}}get isEnabled(){var t;return!1!==this.U.enabled&&(!0===this.U.enabled||!this._instance.getConfig().disable_chat&&!0===(null===(t=this._t)||void 0===t?void 0:t.enabled))}get isStarted(){return this.O}startIfEnabled(){this.Tt().catch(t=>{console.error(We+" Error starting:",t)})}stop(){this.destroy(),this.O=!1}onConfigUpdate(t){var i,e;this.U=Je.extractConfig(t),this.It&&(null===(e=(i=this.It).updateConfig)||void 0===e||e.call(i,this.getMergedConfig()))}onRemoteConfig(t){var i,r,n,s,o,a,l,u,h;t.chat&&(this._t=e({},this._t,{enabled:null!==(n=null!==(i=t.chat.enabled)&&void 0!==i?i:null===(r=this._t)||void 0===r?void 0:r.enabled)&&void 0!==n&&n,position:null!==(a=null!==(s=t.chat.widgetPosition)&&void 0!==s?s:null===(o=this._t)||void 0===o?void 0:o.position)&&void 0!==a?a:"bottom-right",color:null!==(h=null!==(l=t.chat.widgetColor)&&void 0!==l?l:null===(u=this._t)||void 0===u?void 0:u.color)&&void 0!==h?h:"#6366f1"}),this.isEnabled&&!this.O&&this.startIfEnabled())}Tt(){var t=this;return i(function*(){var i,e,r,n;!1!==t.U.enabled?t._instance.getConfig().disable_chat?console.info(We+" disabled by disable_chat config"):(!1!==t.U.autoConfig&&(yield t.$t()),t.isEnabled?(t.O=!0,null!==(r=null!==(i=t.U.preload)&&void 0!==i?i:null===(e=t._t)||void 0===e?void 0:e.enabled)&&void 0!==r&&r&&t.Mt(),(null===(n=t._t)||void 0===n?void 0:n.enabled)&&t.Rt(),console.info(We+" ready (lazy-load on demand)")):console.info(We+" not enabled (check dashboard settings)")):console.info(We+" disabled by code config")})()}get isOpen(){var t,i;return null!==(i=null===(t=this.It)||void 0===t?void 0:t.isOpen)&&void 0!==i&&i}get isConnected(){var t,i;return null!==(i=null===(t=this.It)||void 0===t?void 0:t.isConnected)&&void 0!==i&&i}get isLoading(){var t,i;return this.wt||null!==(i=null===(t=this.It)||void 0===t?void 0:t.isLoading)&&void 0!==i&&i}get unreadCount(){var t,i;return null!==(i=null===(t=this.It)||void 0===t?void 0:t.unreadCount)&&void 0!==i?i:0}get channel(){var t,i;return null!==(i=null===(t=this.It)||void 0===t?void 0:t.channel)&&void 0!==i?i:null}get channels(){var t,i;return null!==(i=null===(t=this.It)||void 0===t?void 0:t.channels)&&void 0!==i?i:[]}get currentView(){var t,i;return null!==(i=null===(t=this.It)||void 0===t?void 0:t.currentView)&&void 0!==i?i:"list"}open(){this.At(()=>{var t;return null===(t=this.It)||void 0===t?void 0:t.open()})}close(){var t;null===(t=this.It)||void 0===t||t.close()}toggle(){this.It?this.It.toggle():this.open()}show(){this.At(()=>{var t;return null===(t=this.It)||void 0===t?void 0:t.show()})}hide(){var t;null===(t=this.It)||void 0===t||t.hide()}getChannels(){this.At(()=>{var t;return null===(t=this.It)||void 0===t?void 0:t.getChannels()})}selectChannel(t){this.At(()=>{var i;return null===(i=this.It)||void 0===i?void 0:i.selectChannel(t)})}createChannel(){this.At(()=>{var t;return null===(t=this.It)||void 0===t?void 0:t.createChannel()})}goToChannelList(){var t;null===(t=this.It)||void 0===t||t.goToChannelList()}sendMessage(t){this.It?this.It.sendMessage(t):(this.St.push(t),this.At(()=>{this.St.forEach(t=>{var i;return null===(i=this.It)||void 0===i?void 0:i.sendMessage(t)}),this.St=[]}))}markAsRead(){var t;null===(t=this.It)||void 0===t||t.markAsRead()}onMessage(t){return this.kt.push(t),this.It?this.It.onMessage(t):()=>{var i=this.kt.indexOf(t);i>-1&&this.kt.splice(i,1)}}onTyping(t){return this.Ct.push(t),this.It?this.It.onTyping(t):()=>{var i=this.Ct.indexOf(t);i>-1&&this.Ct.splice(i,1)}}onConnectionChange(t){return this.Et.push(t),this.It?this.It.onConnectionChange(t):()=>{var i=this.Et.indexOf(t);i>-1&&this.Et.splice(i,1)}}updateConfig(t){this.U=e({},this.U,t)}getMergedConfig(){var t,i,e,r,n,s,o,a,l,u,h,d,v,c,f,p,g,_,m=this._t,b=this.U;return{enabled:null!==(i=null!==(t=b.enabled)&&void 0!==t?t:null==m?void 0:m.enabled)&&void 0!==i&&i,autoConfig:null===(e=b.autoConfig)||void 0===e||e,position:null!==(n=null!==(r=b.position)&&void 0!==r?r:null==m?void 0:m.position)&&void 0!==n?n:"bottom-right",greeting:null!==(s=b.greeting)&&void 0!==s?s:null==m?void 0:m.greeting,color:null!==(a=null!==(o=b.color)&&void 0!==o?o:null==m?void 0:m.color)&&void 0!==a?a:"#6366f1",aiMode:null===(u=null!==(l=b.aiMode)&&void 0!==l?l:null==m?void 0:m.ai_enabled)||void 0===u||u,aiGreeting:null!==(h=b.aiGreeting)&&void 0!==h?h:null==m?void 0:m.ai_greeting,preload:null!==(d=b.preload)&&void 0!==d&&d,theme:null!==(v=b.theme)&&void 0!==v?v:{primaryColor:null!==(f=null!==(c=b.color)&&void 0!==c?c:null==m?void 0:m.color)&&void 0!==f?f:"#6366f1"},offlineMessage:null!==(p=b.offlineMessage)&&void 0!==p?p:null==m?void 0:m.offline_message,collectEmailOffline:null===(_=null!==(g=b.collectEmailOffline)&&void 0!==g?g:null==m?void 0:m.collect_email_offline)||void 0===_||_}}destroy(){b(()=>{var t,i;null===(t=this.It)||void 0===t||t.destroy(),this.It=void 0,this.St=[],this.xt=[],this.kt=[],this.Ct=[],this.Et=[];var e=null===(i=null==U?void 0:U.document)||void 0===i?void 0:i.getElementById("vtilt-chat-bubble");e&&e.remove()})}$t(){var t=this;return i(function*(){if(!t.bt){var i=t._instance.getConfig(),e=i.token,r=i.api_host;if(!e||!r)return console.warn(We+" Cannot fetch settings: missing token or api_host"),void(t.bt=!0);try{var n=r+"/api/chat/settings?token="+encodeURIComponent(e),s=yield fetch(n);if(!s.ok)return console.warn(We+" Failed to fetch settings: "+s.status),void(t.bt=!0);t._t=yield s.json(),t.bt=!0,console.info(We+" Loaded settings from dashboard")}catch(i){console.warn(We+" Error fetching settings:",i),t.bt=!0}}})()}Rt(){if((null==U?void 0:U.document)&&!document.getElementById("vtilt-chat-bubble")){var t=this.getMergedConfig(),i=t.position||"bottom-right",e=t.color||"#6366f1",r=document.createElement("div");r.id="vtilt-chat-bubble",r.setAttribute("style",("\n position: fixed;\n bottom: 20px;\n "+("bottom-right"===i?"right: 20px;":"left: 20px;")+"\n width: 60px;\n height: 60px;\n border-radius: 50%;\n background: "+e+";\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()),r.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 ',r.addEventListener("mouseenter",()=>{r.style.transform="scale(1.05)",r.style.boxShadow="0 6px 16px rgba(0, 0, 0, 0.2)"}),r.addEventListener("mouseleave",()=>{r.style.transform="scale(1)",r.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"}),r.addEventListener("click",()=>{this.open()}),document.body.appendChild(r)}}get ft(){return"chat"}Mt(){"undefined"!=typeof requestIdleCallback?requestIdleCallback(()=>this.Ot(),{timeout:5e3}):setTimeout(()=>this.Ot(),3e3)}At(t){this.It?t():(this.xt.push(t),this.Ot())}Ot(){var t,i;if(!(this.wt||this.It||this.yt))if(null===(t=V.__VTiltExtensions__)||void 0===t?void 0:t.initChat)this.gt();else{this.wt=!0;var e=null===(i=V.__VTiltExtensions__)||void 0===i?void 0:i.loadExternalDependency;if(!e)return console.error(We+" loadExternalDependency not available. Chat cannot start."),this.wt=!1,void(this.yt="loadExternalDependency not available");e(this._instance,this.ft,t=>{if(this.wt=!1,t)return console.error(We+" Failed to load:",t),void(this.yt=String(t));this.gt()})}}gt(){var t,i=null===(t=V.__VTiltExtensions__)||void 0===t?void 0:t.initChat;if(!i)return console.error(We+" initChat not available after script load"),void(this.yt="initChat not available");if(!this.It){var e=this.getMergedConfig();this.It=i(this._instance,e),this.kt.forEach(t=>{var i;return null===(i=this.It)||void 0===i?void 0:i.onMessage(t)}),this.Ct.forEach(t=>{var i;return null===(i=this.It)||void 0===i?void 0:i.onTyping(t)}),this.Et.forEach(t=>{var i;return null===(i=this.It)||void 0===i?void 0:i.onConnectionChange(t)});var r=null===document||void 0===document?void 0:document.getElementById("vtilt-chat-bubble");r&&r.remove()}this.xt.forEach(t=>t()),this.xt=[],console.info(We+" loaded and ready")}}var He,Xe="text/plain";!function(t){t.GZipJS="gzip-js",t.None="none"}(He||(He={}));var Ke=t=>{var{data:i,compression:e}=t;if(i){var r=(t=>JSON.stringify(t,(t,i)=>"bigint"==typeof i?i.toString():i))(i),n=new Blob([r]).size;if(e===He.GZipJS&&n>=1024)try{var s=Fe(function(t,i){if(qe)return qe.encode(t);for(var e=t.length,r=new le(t.length+(t.length>>1)),n=0,s=function(t){r[n++]=t},o=0;o<e;++o){if(n+5>r.length){var a=new le(n+8+(e-o<<1));a.set(r),r=a}var l=t.charCodeAt(o);l<128||i?s(l):l<2048?(s(192|l>>6),s(128|63&l)):l>55295&&l<57344?(s(240|(l=65536+(1047552&l)|1023&t.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 Ie(r,0,n)}(r),{mtime:0}),o=new Blob([s],{type:Xe});if(o.size<.95*n)return{contentType:Xe,body:o,estimatedSize:o.size}}catch(t){}return{contentType:"application/json",body:r,estimatedSize:n}}},Ge=[{name:"fetch",available:"undefined"!=typeof fetch,method:t=>{var r=Ke(t);if(r){var{contentType:n,body:s,estimatedSize:o}=r,a=t.compression===He.GZipJS&&n===Xe?t.url+(t.url.includes("?")?"&":"?")+"compression=gzip-js":t.url,l=e({"Content-Type":n},t.headers||{}),u=new AbortController,h=t.timeout?setTimeout(()=>u.abort(),t.timeout):null;fetch(a,{method:t.method||"POST",headers:l,body:s,keepalive:o<52428.8,signal:u.signal}).then(function(){var e=i(function*(i){var e,r=yield i.text(),n={statusCode:i.status,text:r};if(200===i.status)try{n.json=JSON.parse(r)}catch(t){}null===(e=t.callback)||void 0===e||e.call(t,n)});return function(t){return e.apply(this,arguments)}}()).catch(()=>{var i;null===(i=t.callback)||void 0===i||i.call(t,{statusCode:0})}).finally(()=>{h&&clearTimeout(h)})}}},{name:"XHR",available:"undefined"!=typeof XMLHttpRequest,method:t=>{var i=Ke(t);if(i){var{contentType:e,body:r}=i,n=t.compression===He.GZipJS&&e===Xe?t.url+(t.url.includes("?")?"&":"?")+"compression=gzip-js":t.url,s=new XMLHttpRequest;s.open(t.method||"POST",n,!0),t.headers&&Object.entries(t.headers).forEach(t=>{var[i,e]=t;s.setRequestHeader(i,e)}),s.setRequestHeader("Content-Type",e),t.timeout&&(s.timeout=t.timeout),s.onreadystatechange=()=>{var i;if(4===s.readyState){var e={statusCode:s.status,text:s.responseText};if(200===s.status)try{e.json=JSON.parse(s.responseText)}catch(t){}null===(i=t.callback)||void 0===i||i.call(t,e)}},s.onerror=()=>{var i;null===(i=t.callback)||void 0===i||i.call(t,{statusCode:0})},s.send(r)}}},{name:"sendBeacon",available:"undefined"!=typeof navigator&&!!navigator.sendBeacon,method:t=>{var i=Ke(t);if(i){var{contentType:e,body:r}=i;try{var n="string"==typeof r?new Blob([r],{type:e}):r,s=t.compression===He.GZipJS&&e===Xe?t.url+(t.url.includes("?")?"&":"?")+"compression=gzip-js":t.url;navigator.sendBeacon(s,n)}catch(t){}}}}],Qe=t=>{var i,e=t.transport||"fetch",r=Ge.find(t=>t.name===e&&t.available)||Ge.find(t=>t.available);if(!r)return console.error("vTilt: No available transport method"),void(null===(i=t.callback)||void 0===i||i.call(t,{statusCode:0}));r.method(t)};class Ze{constructor(t,i){var e,r,n,s;this.Pt=!0,this.Lt=[],this.Ut=(e=(null==i?void 0:i.flush_interval_ms)||3e3,r=250,n=5e3,s=3e3,"number"!=typeof e||isNaN(e)?s:Math.min(Math.max(e,r),n)),this.Dt=t}get length(){return this.Lt.length}enqueue(t){this.Lt.push(t),this.jt||this.Bt()}unload(){if(this.Nt(),0!==this.Lt.length){var t=this.zt();for(var i in t){var r=t[i];this.Dt(e({},r,{transport:"sendBeacon"}))}}}enable(){this.Pt=!1,this.Bt()}pause(){this.Pt=!0,this.Nt()}flush(){this.Nt(),this.Ft(),this.Bt()}Bt(){this.Pt||(this.jt=setTimeout(()=>{this.Nt(),this.Ft(),this.Lt.length>0&&this.Bt()},this.Ut))}Nt(){this.jt&&(clearTimeout(this.jt),this.jt=void 0)}Ft(){if(0!==this.Lt.length){var t=this.zt(),i=Date.now();for(var e in t){var r=t[e];r.events.forEach(t=>{var e=new Date(t.timestamp).getTime();t.$offset=Math.abs(e-i)}),this.Dt(r)}}}zt(){var t={};return this.Lt.forEach(i=>{var e=i.batchKey||i.url;t[e]||(t[e]={url:i.url,events:[],batchKey:i.batchKey}),t[e].events.push(i.event)}),this.Lt=[],t}}class Ye{constructor(t){this.qt=!1,this.Vt=3e3,this.Lt=[],this.Wt=!0,this.Dt=t.sendRequest,this.Jt=t.sendBeacon,U&&void 0!==j&&"onLine"in j&&(this.Wt=j.onLine,O(U,"online",()=>{this.Wt=!0,this.N()}),O(U,"offline",()=>{this.Wt=!1}))}get length(){return this.Lt.length}enqueue(t,i){if(void 0===i&&(i=0),i>=10)console.warn("VTilt: Request failed after 10 retries, giving up");else{var e=function(t){var i=3e3*Math.pow(2,t),e=i/2,r=Math.min(18e5,i),n=(Math.random()-.5)*(r-e);return Math.ceil(r+n)}(i),r=Date.now()+e;this.Lt.push({retryAt:r,request:t,retriesPerformedSoFar:i+1});var n="VTilt: Enqueued failed request for retry in "+Math.round(e/1e3)+"s";this.Wt||(n+=" (Browser is offline)"),console.warn(n),this.qt||(this.qt=!0,this.Ht())}}retriableRequest(t){var e=this;return i(function*(){try{var i=yield e.Dt(t);200!==i.statusCode&&(i.statusCode<400||i.statusCode>=500)&&e.enqueue(t,0)}catch(i){e.enqueue(t,0)}})()}Ht(){this.Xt&&clearTimeout(this.Xt),this.Xt=setTimeout(()=>{this.Wt&&this.Lt.length>0&&this.N(),this.Lt.length>0?this.Ht():this.qt=!1},this.Vt)}N(){var t=this,e=Date.now(),r=[],n=[];this.Lt.forEach(t=>{t.retryAt<e?n.push(t):r.push(t)}),this.Lt=r,n.forEach(function(){var e=i(function*(i){var{request:e,retriesPerformedSoFar:r}=i;try{var n=yield t.Dt(e);200!==n.statusCode&&(n.statusCode<400||n.statusCode>=500)&&t.enqueue(e,r)}catch(i){t.enqueue(e,r)}});return function(t){return e.apply(this,arguments)}}())}unload(){this.Xt&&(clearTimeout(this.Xt),this.Xt=void 0),this.Lt.forEach(t=>{var{request:i}=t;try{this.Jt(i)}catch(t){console.error("VTilt: Failed to send beacon on unload",t)}}),this.Lt=[]}}var tr="vt_rate_limit";class ir{constructor(t){var i,e;void 0===t&&(t={}),this.lastEventRateLimited=!1,this.eventsPerSecond=null!==(i=t.eventsPerSecond)&&void 0!==i?i:10,this.eventsBurstLimit=Math.max(null!==(e=t.eventsBurstLimit)&&void 0!==e?e:10*this.eventsPerSecond,this.eventsPerSecond),this.persistence=t.persistence,this.captureWarning=t.captureWarning,this.lastEventRateLimited=this.checkRateLimit(!0).isRateLimited}checkRateLimit(t){var i,e,r,n;void 0===t&&(t=!1);var s=Date.now(),o=null!==(e=null===(i=this.persistence)||void 0===i?void 0:i.get(tr))&&void 0!==e?e:{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||t||(o.tokens=Math.max(0,o.tokens-1)),!l||this.lastEventRateLimited||t||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=l,null===(n=this.persistence)||void 0===n||n.set(tr,o),{isRateLimited:l,remainingTokens:o.tokens}}shouldAllowEvent(){return!this.checkRateLimit(!1).isRateLimited}getRemainingTokens(){return this.checkRateLimit(!0).remainingTokens}}class er{constructor(t){this.Kt=null,this.Gt=t}get config(){return this.Kt}onApply(t){this.Qt=t}onLoad(t){this.Zt=t}load(){var t,i=this.Gt.getConfig();if(i.projectId){if(null===(t=i.bootstrap)||void 0===t?void 0:t.remoteConfig)return this.Kt=i.bootstrap.remoteConfig,this.Yt(this.Kt),void this.ti();var e=b(()=>U.__VTILT_BOOTSTRAP__);if(null==e?void 0:e.remoteConfig)return this.Kt=e.remoteConfig,this.Yt(this.Kt),void this.ti();b(()=>{var t=localStorage.getItem(h+"_"+i.projectId);t&&(this.Kt=JSON.parse(t),this.Yt(this.Kt))}),this.ti()}}ti(){var t=this.Gt.getConfig();if(t.projectId&&t.api_host){var i=t.api_host+"/api/projects/"+t.projectId+"/decide",e=new AbortController,r=setTimeout(()=>e.abort(),3e3);(z||fetch)(i,{method:"GET",signal:e.signal,headers:{Accept:"application/json"}}).then(t=>t.json()).then(i=>{var e;clearTimeout(r),this.Kt=i,b(()=>{localStorage.setItem(h+"_"+t.projectId,JSON.stringify(i))}),this.Yt(i),null===(e=this.Zt)||void 0===e||e.call(this,i)}).catch(()=>{clearTimeout(r)})}}Yt(t){var i,e,r,n,s,o,a,l,u,h=this.Gt.getConfig(),d={},v=!1,c=!1,f=!1;t.sessionRecording&&void 0===h.session_recording&&(d.session_recording={enabled:t.sessionRecording.enabled,sampleRate:t.sessionRecording.sampleRate,minimumDurationMs:t.sessionRecording.minimumDurationMs,fullSnapshotIntervalMs:t.sessionRecording.fullSnapshotIntervalMs,maskAllInputs:t.sessionRecording.maskAllInputs,captureConsole:t.sessionRecording.captureConsole,captureCanvas:t.sessionRecording.captureCanvas},t.sessionRecording.enabled&&(v=!0)),(null===(i=t.chat)||void 0===i?void 0:i.enabled)&&void 0===h.chat&&(d.chat={enabled:t.chat.enabled,position:t.chat.widgetPosition,color:t.chat.widgetColor},c=!0),t.analytics&&(void 0!==t.analytics.capturePageview&&void 0===h.capture_pageview&&(d.capture_pageview=t.analytics.capturePageview),void 0!==t.analytics.capturePageleave&&void 0===h.capture_pageleave&&(d.capture_pageleave=!!t.analytics.capturePageleave),void 0!==t.analytics.capturePerformance&&void 0===h.capture_performance&&(d.capture_performance=t.analytics.capturePerformance),void 0!==t.analytics.autocapture&&void 0===h.autocapture&&(d.autocapture=t.analytics.autocapture,t.analytics.autocapture&&(f=!0))),void 0!==(null===(e=t.privacy)||void 0===e?void 0:e.respectDnt)&&void 0===h.respect_dnt&&(d.respect_dnt=t.privacy.respectDnt),Object.keys(d).length>0&&this.Gt.updateConfig(d),null===(r=this.Qt)||void 0===r||r.call(this,t),this.Gt.__loaded&&(v&&(null===(s=(n=this.Gt).startSessionRecording)||void 0===s||s.call(n)),c&&(null===(a=(o=this.Gt).ii)||void 0===a||a.call(o)),f&&(null===(u=(l=this.Gt).startAutocapture)||void 0===u||u.call(l)))}}class rr{constructor(t){this.ei=!1,this.ri=!1,this.ni=null,this.si=null,this.Gt=t}setVtPersonUuid(t){this.si=t}capture(t,i,r){var n;if(this.Gt.sessionManager.setSessionId(),(null==j?void 0:j.userAgent)&&function(t){return!(t&&"string"==typeof t&&t.length>500)}(j.userAgent)&&((null==r?void 0:r.skip_client_rate_limiting)||this.Gt.rateLimiter.shouldAllowEvent())){var s,o=this.Gt.buildUrl(),a=this.Gt.getConfig(),l=this.oi(t,i);if(!1!==a.stringifyPayload){if(!R(s=JSON.stringify(e({},l,a.globalAttributes))))return}else if(s=e({},l,a.globalAttributes),!R(JSON.stringify(s)))return;var u="$identify"===t?this.Gt.userManager.getAnonymousId():null!==(n=this.Gt.userManager.getDistinctId())&&void 0!==n?n:this.Gt.userManager.getAnonymousId(),h={timestamp:(new Date).toISOString(),event:t,project_id:a.projectId||"",payload:s,distinct_id:u,anonymous_id:this.Gt.userManager.getAnonymousId()};this.Gt.sendRequest(o,h,!0)}}captureInternal(t,i){this.capture(t,i,{skip_client_rate_limiting:!0})}trackEvent(t,i){void 0===i&&(i={}),this.capture(t,i)}captureInitialPageview(){B&&("visible"===B.visibilityState?this.ri||(this.ri=!0,setTimeout(()=>{B&&N&&this.capture("$pageview",{navigation_type:"initial_load"})},300),this.ni&&(B.removeEventListener("visibilitychange",this.ni),this.ni=null)):this.ni||(this.ni=()=>this.captureInitialPageview(),O(B,"visibilitychange",this.ni)))}oi(t,i){var r=ui(),n=this.Gt.userManager.getUserProperties(),s=this.Gt.userManager.get_initial_props(),o=this.Gt.sessionManager.getSessionId(),a=this.Gt.sessionManager.getWindowId(),l=this.Gt.userManager.getAnonymousId(),u={};!this.ei&&Object.keys(s).length>0&&Object.assign(u,s),i.$set_once&&Object.assign(u,i.$set_once);var h=e({},r,n,{$session_id:o,$window_id:a},l?{$anon_distinct_id:l}:{},this.si?{$vt:this.si}:{},Object.keys(u).length>0?{$set_once:u}:{},i.$set?{$set:i.$set}:{},i);return!this.ei&&Object.keys(s).length>0&&(this.ei=!0),"$pageview"===t&&B&&(h.title=B.title),h}}class nr{constructor(t){this.Gt=t}identify(t,i,e){var r;if("number"==typeof t&&(t=String(t),console.warn("identify: first argument should be a string, not a number")),t)if(this.Gt.userManager.isDistinctIdStringLikePublic(t))console.error('identify: "'+t+'" appears to be a hardcoded string');else if("COOKIELESS_SENTINEL_VALUE"!==t){var n=this.Gt.userManager.getDistinctId(),s=this.Gt.userManager.getAnonymousId(),o=this.Gt.userManager.getDeviceId(),a="anonymous"===this.Gt.userManager.getUserState();o||this.Gt.userManager.ensureDeviceId(n||s),t!==n&&a?(this.Gt.userManager.setUserState("identified"),this.Gt.userManager.updateUserProperties(i,e),this.Gt.capture("$identify",{distinct_id:t,$anon_distinct_id:s,$set:i||{},$set_once:e||{}}),this.Gt.userManager.setDistinctId(t),null===(r=this.Gt.ai)||void 0===r||r.emit("user:identified",{distinctId:t})):i||e?(a&&this.Gt.userManager.setUserState("identified"),this.Gt.userManager.updateUserProperties(i,e),this.Gt.capture("$set",{$set:i||{},$set_once:e||{}})):t!==n&&(this.Gt.userManager.setUserState("identified"),this.Gt.userManager.setDistinctId(t))}else console.error("identify: cannot use sentinel value as distinct_id");else console.error("identify: unique user id is required")}setUserProperties(t,i){var e;this.Gt.userManager.setUserProperties(t,i)&&(this.Gt.capture("$set",{$set:t||{},$set_once:i||{}}),null===(e=this.Gt.ai)||void 0===e||e.emit("user:properties_set",{properties:t}))}resetUser(t){var i;this.Gt.sessionManager.resetSessionId(),this.Gt.userManager.reset(t),null===(i=this.Gt.ai)||void 0===i||i.emit("user:reset")}createAlias(t,i){var e=this.Gt.userManager.createAlias(t,i);e?this.Gt.capture("$alias",{$original_id:e.original,$alias_id:e.distinct_id}):t===(i||this.Gt.userManager.getDistinctId()||this.Gt.userManager.getAnonymousId())&&this.identify(t)}getUserIdentity(){return this.Gt.userManager.getUserIdentity()}getDeviceId(){return this.Gt.userManager.getDeviceId()}getUserState(){return this.Gt.userManager.getUserState()}getDistinctId(){var t;return null!==(t=this.Gt.userManager.getDistinctId())&&void 0!==t?t:this.Gt.userManager.getAnonymousId()}getAnonymousId(){return this.Gt.userManager.getAnonymousId()}}class sr{constructor(t){this.li=new Map,this.Gt=t}onFeatureStarted(t){this.ui=t}onFeatureStopped(t){this.hi=t}register(t){this.li.set(t.name,t)}get(t){var i;return null===(i=this.li.get(t))||void 0===i?void 0:i.instance}initAll(){this.li.forEach(t=>{this.di(t)})}init(t){var i=this.li.get(t);if(i)return this.di(i),i.instance}start(t){var i,e=this.li.get(t);if(e&&(e.instance||this.di(e),e.instance)){if(e.instance.onConfigUpdate){var r=this.Gt.getConfig();e.instance.onConfigUpdate(r)}e.instance.startIfEnabled(),null===(i=this.ui)||void 0===i||i.call(this,t)}}stop(t){var i,e=this.li.get(t);(null==e?void 0:e.instance)&&(e.instance.stop(),null===(i=this.hi)||void 0===i||i.call(this,t))}isActive(t){var i,e,r;return null!==(r=null===(e=null===(i=this.li.get(t))||void 0===i?void 0:i.instance)||void 0===e?void 0:e.isStarted)&&void 0!==r&&r}notifyConfigUpdate(t){this.li.forEach(i=>{var e;(null===(e=i.instance)||void 0===e?void 0:e.onConfigUpdate)&&b(()=>i.instance.onConfigUpdate(t))})}notifyRemoteConfig(t){this.li.forEach(i=>{var e;(null===(e=i.instance)||void 0===e?void 0:e.onRemoteConfig)&&b(()=>i.instance.onRemoteConfig(t))})}getAll(){var t=[];return this.li.forEach(i=>{i.instance&&t.push(i.instance)}),t}di(t){if(!t.instance){var i=this.Gt.getConfig();t.disableKey&&i[t.disableKey]||t.enableKey&&!1===i[t.enableKey]||b(()=>{var i;t.instance=new t.FeatureClass(this.Gt),t.instance.startIfEnabled(),t.instance.isStarted&&(null===(i=this.ui)||void 0===i||i.call(this,t.name))})}}}var or="vt",ar=Array.isArray;class lr{constructor(t){void 0===t&&(t={}),this.version=r,this.__loaded=!1,this.__request_queue=[],this.ci=!1,this.ai=new w,this.configManager=new m(t);var i=this.configManager.getConfig();this.sessionManager=new G(i.storage||"cookie",i.cross_subdomain_cookie),this.userManager=new hi(i.persistence||"localStorage+cookie",i.cross_subdomain_cookie),this.rateLimiter=new ir({eventsPerSecond:10,eventsBurstLimit:100,captureWarning:t=>{this.fi.captureInternal("$$client_ingestion_warning",{$$client_ingestion_warning_message:t})}}),this.retryQueue=new Ye({sendRequest:t=>this.pi(t),sendBeacon:t=>this.gi(t)}),this.requestQueue=new Ze(t=>this.mi(t),{flush_interval_ms:3e3}),this.fi=new rr(this),this.bi=new nr(this),this.wi=new er(this),this.yi=new sr(this),this.wi.onApply(t=>{this.yi.notifyRemoteConfig(t)}),this.wi.onLoad(t=>{this.ai.emit(x,{config:t})}),this.yi.onFeatureStarted(t=>{this.ai.emit(k,{feature:t})}),this.yi.onFeatureStopped(t=>{this.ai.emit(C,{feature:t})})}init(t,i,e){var r;if(e&&e!==or){var n=null!==(r=ur[e])&&void 0!==r?r:new lr;return n._init(t,i,e),ur[e]=n,ur[or][e]=n,n}return this._init(t,i,e)}_init(t,i,r){if(void 0===i&&(i={}),this.__loaded)return console.warn("vTilt: Already initialized! Re-initializing is a no-op"),this;this.updateConfig(e({},i,{projectId:t||i.projectId,name:r})),this.__loaded=!0,this.Si(),this.wi.load();var n=this.configManager.getConfig();return this.userManager.set_initial_person_info(n.mask_personal_data_properties,n.custom_personal_data_properties),this.xi(),this.ki(),this.Ci(),!1!==n.capture_pageview&&this.fi.captureInitialPageview(),this.ai.emit(y,{config:n}),this}xi(){this.Ei(),this.Ti(),this.Ii(),this.$i(),this.ii()}Ei(){this.historyAutocapture||(this.historyAutocapture=new gi(this),this.historyAutocapture.startIfEnabled())}Ti(){this.autocapture||!1!==this.configManager.getConfig().autocapture&&(this.autocapture=new ne(this),this.autocapture.startIfEnabled())}Ii(){this.webVitals||(this.webVitals=new fi(this),this.webVitals.startIfEnabled())}$i(){this.sessionRecording||(this.configManager.getConfig().disable_session_recording||(this.sessionRecording=new oe(this),this.sessionRecording.isEnabled&&(this.sessionRecording.startIfEnabledOrStop("recording_initialized"),this.ai.emit(T))))}ii(){this.chat||(this.configManager.getConfig().disable_chat||(this.chat=new Je(this),this.chat.startIfEnabled()))}startAutocapture(){this.autocapture||(this.autocapture=new ne(this)),this.autocapture.updateConfig({enabled:!0}),this.autocapture.startIfEnabled()}stopAutocapture(){var t;null===(t=this.autocapture)||void 0===t||t.stop()}isAutocaptureActive(){var t,i;return null!==(i=null===(t=this.autocapture)||void 0===t?void 0:t.isStarted)&&void 0!==i&&i}startSessionRecording(){this.sessionRecording||(this.sessionRecording=new oe(this)),this.sessionRecording.updateConfig({enabled:!0}),this.sessionRecording.startIfEnabledOrStop("recording_initialized"),this.ai.emit(T)}stopSessionRecording(){var t;null===(t=this.sessionRecording)||void 0===t||t.stop(),this.ai.emit(I)}isRecordingActive(){var t;return"active"===(null===(t=this.sessionRecording)||void 0===t?void 0:t.status)}getSessionRecordingId(){var t;return(null===(t=this.sessionRecording)||void 0===t?void 0:t.sessionId)||null}capture(t,i,e){this.fi.capture(t,i,e),this.ai.emit(E,{event:t,payload:i})}trackEvent(t,i){void 0===i&&(i={}),this.fi.trackEvent(t,i)}identify(t,i,e){this.bi.identify(t,i,e)}setUserProperties(t,i){this.bi.setUserProperties(t,i)}resetUser(t){this.bi.resetUser(t)}createAlias(t,i){this.bi.createAlias(t,i)}getUserIdentity(){return this.bi.getUserIdentity()}getDeviceId(){return this.bi.getDeviceId()}getUserState(){return this.bi.getUserState()}getConfig(){return this.configManager.getConfig()}getSessionId(){return this.sessionManager.getSessionId()}getDistinctId(){return this.bi.getDistinctId()}getAnonymousId(){return this.bi.getAnonymousId()}toString(){var t,i=null!==(t=this.configManager.getConfig().name)&&void 0!==t?t:or;return i!==or&&(i="vt."+i),i}updateConfig(t){this.configManager.updateConfig(t);var i=this.configManager.getConfig();this.sessionManager=new G(i.storage||"cookie",i.cross_subdomain_cookie),this.userManager=new hi(i.persistence||"localStorage+cookie",i.cross_subdomain_cookie),this.Mi(i),this.ai.emit(S,{config:i})}Mi(t){[this.historyAutocapture,this.autocapture,this.webVitals,this.sessionRecording,this.chat].forEach(i=>{(null==i?void 0:i.onConfigUpdate)&&b(()=>i.onConfigUpdate(t))})}buildUrl(){var t=this.configManager.getConfig(),{proxyUrl:i,proxy:e,api_host:r,token:n}=t;return i||(e?e+"/api/tracking?token="+n:r?r.replace(/\/+$/gm,"")+"/api/tracking?token="+n:"/api/tracking?token="+n)}sendRequest(t,i,e){if(this.Ri()){if(e&&void 0!==U)if(U.__VTILT_ENQUEUE_REQUESTS)return void this.__request_queue.push({url:t,event:i});this.requestQueue.enqueue({url:t,event:i})}}Ri(){var t=this.configManager.getConfig();return!(!t.projectId||!t.token)||(this.ci||(console.warn("VTilt: projectId and token are required for tracking"),this.ci=!0),!1)}mi(t){"sendBeacon"!==t.transport?this.retryQueue.retriableRequest(t):this.gi(t)}pi(t){return new Promise(i=>{var{url:e,events:r}=t,n=1===r.length?r[0]:{events:r},s=this.configManager.getConfig().disable_compression?He.None:He.GZipJS;Qe({url:e,data:n,method:"POST",transport:"XHR",compression:s,callback:t=>i({statusCode:t.statusCode})})})}gi(t){var{url:i,events:e}=t,r=1===e.length?e[0]:{events:e},n=this.configManager.getConfig().disable_compression?He.None:He.GZipJS;Qe({url:i,data:r,method:"POST",transport:"sendBeacon",compression:n})}Ai(t){this.sendRequest(t.url,t.event,!1)}ki(){if(U){var t=()=>{this.requestQueue.unload(),this.retryQueue.unload()};O(U,"beforeunload",t),O(U,"pagehide",t)}}Ci(){this.requestQueue.enable()}Si(){b(()=>{var t,i;if(void 0!==N&&N.search){var e=new URL(N.href),r=e.searchParams.get("vt");if(null==r?void 0:r.trim()){this.fi.setVtPersonUuid(r.trim()),e.searchParams.delete("vt");var n=e.pathname+(e.search||"")+e.hash;null===(i=null===(t=null==U?void 0:U.history)||void 0===t?void 0:t.replaceState)||void 0===i||i.call(t,{},"",n)}}})}_execute_array(t){Array.isArray(t)&&t.forEach(t=>{if(t&&Array.isArray(t)&&t.length>0){var i=t[0],e=t.slice(1);"function"==typeof this[i]&&b(()=>this[i](...e))}})}_dom_loaded(){this.__request_queue.forEach(t=>this.Ai(t)),this.__request_queue=[],this.Ci()}}var ur={},hr=!(void 0!==F||void 0!==z)&&-1===(null==q?void 0:q.indexOf("MSIE"))&&-1===(null==q?void 0:q.indexOf("Mozilla"));null!=U&&(U.__VTILT_ENQUEUE_REQUESTS=hr);var dr,vr,cr=function(){function t(){t.done||(t.done=!0,hr=!1,null!=U&&(U.__VTILT_ENQUEUE_REQUESTS=!1),A(ur,t=>t._dom_loaded()))}B&&"function"==typeof B.addEventListener?"complete"===B.readyState?t():O(B,"DOMContentLoaded",t,{capture:!1}):U&&console.error("Browser doesn't support document.addEventListener")};"undefined"!=typeof window&&window.vt&&Array.isArray(window.vt)&&(dr=ur[or]=new lr,(vr=V.vt)&&A(vr._i,function(t){if(t&&ar(t)){var i=dr.init(t[0],t[1],t[2]),e=vr[t[2]||"vt"]||vr;i&&i._execute_array(e)}}),V.vt=dr,cr());var fr=function(){var t=ur[or]=new lr;return cr(),t}();exports.ALL_WEB_VITALS_METRICS=["LCP","CLS","FCP","INP","TTFB"],exports.DEFAULT_WEB_VITALS_METRICS=di,exports.VTilt=lr,exports.default=fr,exports.vt=fr;
|
|
1
|
+
"use strict";function t(t,i,e,n,r,s,o){try{var a=t[s](o),l=a.value}catch(t){return void e(t)}a.done?i(l):Promise.resolve(l).then(n,r)}function i(i){return function(){var e=this,n=arguments;return new Promise(function(r,s){var o=i.apply(e,n);function a(i){t(o,r,s,a,l,"next",i)}function l(i){t(o,r,s,a,l,"throw",i)}a(void 0)})}}function e(){return e=Object.assign?Object.assign.bind():function(t){for(var i=1;i<arguments.length;i++){var e=arguments[i];for(var n in e)({}).hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},e.apply(null,arguments)}Object.defineProperty(exports,"__esModule",{value:!0});var n="1.10.4",r="__vt_session",s="__vt_window_id",o="__vt_primary_window",a="__vt_user_state",l="__vt_device_id",h="__vt_anonymous_id",u="__vt_remote_config",d="__vt_distinct_id",v="__vt_user_properties",c="localStorage",f="localStorage+cookie",p="sessionStorage",g="memory",m="$initial_person_info";class b{constructor(t){void 0===t&&(t={}),this.config=this.parseConfigFromScript(t)}parseConfigFromScript(t){if(!document.currentScript)return e({token:t.token||""},t);var i=document.currentScript,n=e({token:""},t);n.api_host=i.getAttribute("data-api-host")||i.getAttribute("data-host")||t.api_host,n.script_host=i.getAttribute("data-script-host")||t.script_host,n.proxy=i.getAttribute("data-proxy")||t.proxy,n.proxyUrl=i.getAttribute("data-proxy-url")||t.proxyUrl,n.token=i.getAttribute("data-token")||t.token||"",n.projectId=i.getAttribute("data-project-id")||t.projectId||"",n.domain=i.getAttribute("data-domain")||t.domain,n.storage=i.getAttribute("data-storage")||t.storage,n.stringifyPayload="false"!==i.getAttribute("data-stringify-payload");var r="true"===i.getAttribute("data-capture-performance");if(n.capture_performance=!!r||t.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=e({},t.globalAttributes),Array.from(i.attributes)))s.name.startsWith("data-vt-")&&(n.globalAttributes[s.name.slice(8).replace(/-/g,"_")]=s.value);return n}getConfig(){return e({},this.config)}updateConfig(t){this.config=e({},this.config,t)}}function y(t,i){try{return t()}catch(t){return i}}class w{constructor(){this.o=new Map,this.m=new Map}on(t,i){return this.o.has(t)||this.o.set(t,new Set),this.o.get(t).add(i),()=>{var e;null===(e=this.o.get(t))||void 0===e||e.delete(i)}}once(t,i){return this.m.has(t)||this.m.set(t,new Set),this.m.get(t).add(i),()=>{var e;null===(e=this.m.get(t))||void 0===e||e.delete(i)}}emit(t,i){var e,n;null===(e=this.o.get(t))||void 0===e||e.forEach(e=>{try{e(i)}catch(i){console.error('[vTilt] Error in event listener for "'+t+'":',i)}});var r=this.m.get(t);r&&(r.forEach(e=>{try{e(i)}catch(i){console.error('[vTilt] Error in once listener for "'+t+'":',i)}}),this.m.delete(t)),null===(n=this.o.get("*"))||void 0===n||n.forEach(e=>{try{e({event:t,payload:i})}catch(t){console.error("[vTilt] Error in wildcard listener:",t)}})}off(t){t?(this.o.delete(t),this.m.delete(t)):(this.o.clear(),this.m.clear())}listenerCount(t){var i,e,n,r;return(null!==(e=null===(i=this.o.get(t))||void 0===i?void 0:i.size)&&void 0!==e?e:0)+(null!==(r=null===(n=this.m.get(t))||void 0===n?void 0:n.size)&&void 0!==r?r:0)}hasListeners(t){return this.listenerCount(t)>0}}var _="sdk:initialized",x="sdk:config_updated",S="sdk:remote_config_loaded",k="feature:started",C="feature:stopped",E="event:captured",T="recording:started",I="recording:stopped";function M(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,t=>(+t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+t/4).toString(16))}function R(t){return!(!t||"string"!=typeof t)&&!(t.length<2||t.length>10240)}function A(t,i,e){if(t)if(Array.isArray(t))t.forEach((t,n)=>{i.call(e,t,n)});else for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&i.call(e,t[n],n)}function O(t,i,e,n){var{capture:r=!1,passive:s=!0}=null!=n?n:{};null==t||t.addEventListener(i,e,{capture:r,passive:s})}function P(t,i){if(!i)return t;for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e]);return t}function L(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];for(var r of e)for(var s of r)t.push(s);return t}var U="undefined"!=typeof window?window:void 0,D="undefined"!=typeof globalThis?globalThis:U,z=null==D?void 0:D.navigator,j=null==D?void 0:D.document,B=null==D?void 0:D.location,N=null==D?void 0:D.fetch,F=(null==D?void 0:D.XMLHttpRequest)&&"withCredentials"in new D.XMLHttpRequest?D.XMLHttpRequest:void 0;null==D||D.AbortController;var q=null==z?void 0:z.userAgent,V=null!=U?U:{},W=[h,l,d,a],H=31536e3,J=["herokuapp.com","vercel.app","netlify.app"];function X(t){var i;if(!t||"undefined"==typeof document)return"";var e=null===(i=document.location)||void 0===i?void 0:i.hostname;if(!e)return"";var n=e.match(/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i);return n?"."+n[0]:""}class K{constructor(t){var i,e,n;this.memoryStorage=new Map,this.S=null,this.method=t.method,this.cross_subdomain=null!==(i=t.cross_subdomain)&&void 0!==i?i:function(){var t;if("undefined"==typeof document)return!1;var i=null===(t=document.location)||void 0===t?void 0:t.hostname;if(!i)return!1;var e=i.split(".").slice(-2).join(".");return!J.includes(e)}(),this.sameSite=null!==(e=t.sameSite)&&void 0!==e?e:"Lax",this.secure=null!==(n=t.secure)&&void 0!==n?n:"undefined"!=typeof location&&"https:"===location.protocol}isLocalStorageSupported(){if(null!==this.S)return this.S;if(void 0===U||!U.localStorage)return this.S=!1,!1;try{var t="__vt_ls_test__";U.localStorage.setItem(t,"1");var i="1"===U.localStorage.getItem(t);return U.localStorage.removeItem(t),this.S=i,i||console.warn("[vTilt] localStorage unavailable, using cookies"),i}catch(t){return this.S=!1,console.warn("[vTilt] localStorage unavailable, using cookies"),!1}}isCriticalProperty(t){return W.includes(t)}get(t){var i;try{switch(this.method){case g:return null!==(i=this.memoryStorage.get(t))&&void 0!==i?i:null;case f:return this.getLocalStoragePlusCookie(t);case c:return this.getLocalStorage(t);case p:return this.readFromSessionStorage(t);default:return this.getCookie(t)}}catch(i){return console.warn('[vTilt] Storage get error for "'+t+'":',i),null}}set(t,i,e){try{switch(this.method){case g:this.memoryStorage.set(t,i);break;case f:this.setLocalStoragePlusCookie(t,i,e);break;case c:this.setLocalStorage(t,i);break;case p:this.writeToSessionStorage(t,i);break;default:this.setCookie(t,i,null!=e?e:H)}}catch(i){console.warn('[vTilt] Storage set error for "'+t+'":',i)}}remove(t){try{switch(this.method){case g:this.memoryStorage.delete(t);break;case f:this.removeLocalStoragePlusCookie(t);break;case c:this.removeLocalStorage(t);break;case p:this.removeFromSessionStorage(t);break;default:this.removeCookie(t)}}catch(i){console.warn('[vTilt] Storage remove error for "'+t+'":',i)}}getLocalStoragePlusCookie(t){if(this.isCriticalProperty(t)){var i=this.getCookie(t),e=this.getLocalStorage(t);if(null!==i){if(e!==i&&this.isLocalStorageSupported())try{null==U||U.localStorage.setItem(t,i)}catch(t){}return i}return e}return this.getLocalStorage(t)}setLocalStoragePlusCookie(t,i,e){this.setLocalStorage(t,i),this.isCriticalProperty(t)&&this.setCookie(t,i,null!=e?e:H)}removeLocalStoragePlusCookie(t){this.removeLocalStorage(t),this.isCriticalProperty(t)&&this.removeCookie(t)}getLocalStorage(t){var i;if(!this.isLocalStorageSupported())return null;try{return null!==(i=null==U?void 0:U.localStorage.getItem(t))&&void 0!==i?i:null}catch(t){return null}}setLocalStorage(t,i){if(this.isLocalStorageSupported())try{null==U||U.localStorage.setItem(t,i)}catch(t){console.warn("[vTilt] localStorage write error:",t)}}removeLocalStorage(t){if(this.isLocalStorageSupported())try{null==U||U.localStorage.removeItem(t)}catch(t){}}readFromSessionStorage(t){var i;try{return null!==(i=null==U?void 0:U.sessionStorage.getItem(t))&&void 0!==i?i:null}catch(t){return null}}writeToSessionStorage(t,i){try{null==U||U.sessionStorage.setItem(t,i)}catch(t){console.warn("[vTilt] sessionStorage write error:",t)}}removeFromSessionStorage(t){try{null==U||U.sessionStorage.removeItem(t)}catch(t){}}getCookie(t){if("undefined"==typeof document)return null;var i=t+"=";for(var e of document.cookie.split(";")){var n=e.trim();if(n.startsWith(i))try{return decodeURIComponent(n.slice(i.length))}catch(t){return n.slice(i.length)}}return null}setCookie(t,i,e){if("undefined"!=typeof document){var n=X(this.cross_subdomain),r=t+"="+encodeURIComponent(i)+"; Max-Age="+e+"; path=/; SameSite="+this.sameSite;this.secure&&(r+="; Secure"),n&&(r+="; domain="+n),document.cookie=r}}removeCookie(t){if("undefined"!=typeof document){var i=X(this.cross_subdomain);document.cookie=t+"=; Max-Age=0; path=/"+(i?"; domain="+i:""),document.cookie=t+"=; Max-Age=0; path=/"}}getWithExpiry(t){var i=this.get(t);if(!i)return null;try{var e=JSON.parse(i);return e.expiry&&Date.now()>e.expiry?(this.remove(t),null):e.value}catch(t){return null}}setWithExpiry(t,i,n){var r=e({value:i},n?{expiry:Date.now()+n}:{});this.set(t,JSON.stringify(r))}getJSON(t){var i=this.get(t);if(!i)return null;try{return JSON.parse(i)}catch(t){return null}}setJSON(t,i,e){this.set(t,JSON.stringify(i),e)}canUseSessionStorage(){if(void 0===U||!(null==U?void 0:U.sessionStorage))return!1;try{var t="__vt_ss_test__";return U.sessionStorage.setItem(t,"1"),U.sessionStorage.removeItem(t),!0}catch(t){return!1}}getSessionStorage(){var t;return this.canUseSessionStorage()&&null!==(t=null==U?void 0:U.sessionStorage)&&void 0!==t?t:null}setMethod(t){this.method=t}getMethod(){return this.method}}class G{constructor(t,i){void 0===t&&(t="cookie"),this.storage=new K({method:t,cross_subdomain:i,sameSite:"Lax"}),this.k=void 0,this.C()}getSessionId(){var t=this.T();return t||(t=M(),this.I(t)),t}setSessionId(){var t=this.T()||M();return this.I(t),t}resetSessionId(){this.$(),this.setSessionId(),this.M(M())}T(){return this.storage.get(r)}I(t){this.storage.set(r,t,1800)}$(){this.storage.remove(r)}getWindowId(){if(this.k)return this.k;var t=this.storage.getSessionStorage();if(t){var i=t.getItem(s);if(i)return this.k=i,i}var e=M();return this.M(e),e}M(t){if(t!==this.k){this.k=t;var i=this.storage.getSessionStorage();i&&i.setItem(s,t)}}C(){var t=this.storage.getSessionStorage();if(t){var i=t.getItem(o),e=t.getItem(s);e&&!i?this.k=e:(e&&t.removeItem(s),this.M(M())),t.setItem(o,"true"),this.R()}else this.k=M()}R(){var t=this.storage.getSessionStorage();U&&t&&O(U,"beforeunload",()=>{var t=this.storage.getSessionStorage();t&&t.removeItem(o)},{capture:!1})}updateStorageMethod(t,i){this.storage=new K({method:t,cross_subdomain:i,sameSite:"Lax"})}}function Z(t){if(!j)return null;var i=j.createElement("a");return i.href=t,i}function Q(t,i){for(var e=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;n<e.length;n++){var r=e[n].split("=");if(r[0]===i){if(r.length<2)return"";var s=r[1];try{s=decodeURIComponent(s)}catch(t){}return s.replace(/\+/g," ")}}return""}function Y(t,i,e){if(!t||!i||!i.length)return t;for(var n=t.split("#"),r=n[0]||"",s=n[1],o=r.split("?"),a=o[1],l=o[0],h=(a||"").split("&"),u=[],d=0;d<h.length;d++){var v=h[d].split("="),c=v[0],f=v.slice(1).join("=");-1!==i.indexOf(c)?u.push(c+"="+e):c&&u.push(c+(f?"="+f:""))}var p=u.join("&");return l+(p?"?"+p:"")+(s?"#"+s:"")}function tt(t){return"function"==typeof t}var it="Mobile",et="iOS",nt="Android",rt="Tablet",st=nt+" "+rt,ot="iPad",at="Apple",lt=at+" Watch",ht="Safari",ut="BlackBerry",dt="Samsung",vt=dt+"Browser",ct=dt+" Internet",ft="Chrome",pt=ft+" OS",gt=ft+" "+et,mt="Internet Explorer",bt=mt+" "+it,yt="Opera",wt=yt+" Mini",_t="Edge",xt="Microsoft "+_t,St="Firefox",kt=St+" "+et,Ct="Nintendo",Et="PlayStation",Tt="Xbox",It=nt+" "+it,$t=it+" "+ht,Mt="Windows",Rt=Mt+" Phone",At="Nokia",Ot="Ouya",Pt="Generic",Lt=Pt+" "+it.toLowerCase(),Ut=Pt+" "+rt.toLowerCase(),Dt="Konqueror",zt="(\\d+(\\.\\d+)?)",jt=new RegExp("Version/"+zt),Bt=new RegExp(Tt,"i"),Nt=new RegExp(Et+" \\w+","i"),Ft=new RegExp(Ct+" \\w+","i"),qt=new RegExp(ut+"|PlayBook|BB10","i"),Vt={"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 Wt(t,i){return t.toLowerCase().includes(i.toLowerCase())}var Ht=(t,i)=>i&&Wt(i,at)||function(t){return Wt(t,ht)&&!Wt(t,ft)&&!Wt(t,nt)}(t),Jt=function(t,i){return i=i||"",Wt(t," OPR/")&&Wt(t,"Mini")?wt:Wt(t," OPR/")?yt:qt.test(t)?ut:Wt(t,"IE"+it)||Wt(t,"WPDesktop")?bt:Wt(t,vt)?ct:Wt(t,_t)||Wt(t,"Edg/")?xt:Wt(t,"FBIOS")?"Facebook "+it:Wt(t,"UCWEB")||Wt(t,"UCBrowser")?"UC Browser":Wt(t,"CriOS")?gt:Wt(t,"CrMo")||Wt(t,ft)?ft:Wt(t,nt)&&Wt(t,ht)?It:Wt(t,"FxiOS")?kt:Wt(t.toLowerCase(),Dt.toLowerCase())?Dt:Ht(t,i)?Wt(t,it)?$t:ht:Wt(t,St)?St:Wt(t,"MSIE")||Wt(t,"Trident/")?mt:Wt(t,"Gecko")?St:""},Xt={[bt]:[new RegExp("rv:"+zt)],[xt]:[new RegExp(_t+"?\\/"+zt)],[ft]:[new RegExp("("+ft+"|CrMo)\\/"+zt)],[gt]:[new RegExp("CriOS\\/"+zt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+zt)],[ht]:[jt],[$t]:[jt],[yt]:[new RegExp("(Opera|OPR)\\/"+zt)],[St]:[new RegExp(St+"\\/"+zt)],[kt]:[new RegExp("FxiOS\\/"+zt)],[Dt]:[new RegExp("Konqueror[:/]?"+zt,"i")],[ut]:[new RegExp(ut+" "+zt),jt],[It]:[new RegExp("android\\s"+zt,"i")],[ct]:[new RegExp(vt+"\\/"+zt)],[mt]:[new RegExp("(rv:|MSIE )"+zt)],Mozilla:[new RegExp("rv:"+zt)]},Kt=function(t,i){var e=Jt(t,i),n=Xt[e];if(void 0===n)return null;for(var r=0;r<n.length;r++){var s=n[r],o=t.match(s);if(o)return parseFloat(o[o.length-2])}return null},Gt=[[new RegExp(Tt+"; "+Tt+" (.*?)[);]","i"),t=>[Tt,t&&t[1]||""]],[new RegExp(Ct,"i"),[Ct,""]],[new RegExp(Et,"i"),[Et,""]],[qt,[ut,""]],[new RegExp(Mt,"i"),(t,i)=>{if(/Phone/.test(i)||/WPDesktop/.test(i))return[Rt,""];if(new RegExp(it).test(i)&&!/IEMobile\b/.test(i))return[Mt+" "+it,""];var e=/Windows NT ([0-9.]+)/i.exec(i);if(e&&e[1]){var n=e[1],r=Vt[n]||"";return/arm/i.test(i)&&(r="RT"),[Mt,r]}return[Mt,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var i=[t[3],t[4],t[5]||"0"];return[et,i.join(".")]}return[et,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var i="";return t&&t.length>=3&&(i=void 0===t[2]?t[3]:t[2]),["watchOS",i]}],[new RegExp("("+nt+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+nt+")","i"),t=>{if(t&&t[2]){var i=[t[2],t[3],t[4]||"0"];return[nt,i.join(".")]}return[nt,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var i=["Mac OS X",""];if(t&&t[1]){var e=[t[1],t[2],t[3]||"0"];i[1]=e.join(".")}return i}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[pt,""]],[/Linux|debian/i,["Linux",""]]],Zt=function(t){return Ft.test(t)?Ct:Nt.test(t)?Et:Bt.test(t)?Tt:new RegExp(Ot,"i").test(t)?Ot:new RegExp("("+Rt+"|WPDesktop)","i").test(t)?Rt:/iPad/.test(t)?ot:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?lt:qt.test(t)?ut:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(At,"i").test(t)?At:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?!new RegExp(it).test(t)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)?/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?nt:st:nt:new RegExp("(pda|"+it+")","i").test(t)?Lt:new RegExp(rt,"i").test(t)&&!new RegExp(rt+" pc","i").test(t)?Ut:""},Qt="https?://(.*)",Yt=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],ti=L(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Yt),ii="<masked>";function ei(t){var i=function(t){return t?0===t.search(Qt+"google.([^/?]*)")?"google":0===t.search(Qt+"bing.com")?"bing":0===t.search(Qt+"yahoo.com")?"yahoo":0===t.search(Qt+"duckduckgo.com")?"duckduckgo":null:null}(t),e="yahoo"!==i?"q":"p",n={};if(null!==i){n.$search_engine=i;var r=j?Q(j.referrer,e):"";r.length&&(n.ph_keyword=r)}return n}function ni(){if("undefined"!=typeof navigator)return navigator.language||navigator.userLanguage}function ri(){return(null==j?void 0:j.referrer)||"$direct"}function si(){var t;return(null==j?void 0:j.referrer)&&(null===(t=Z(j.referrer))||void 0===t?void 0:t.host)||"$direct"}function oi(t){var i,{r:e,u:n}=t,r={$referrer:e,$referring_domain:null==e?void 0:"$direct"===e?"$direct":null===(i=Z(e))||void 0===i?void 0:i.host};if(n){r.$current_url=n;var s=Z(n);r.$host=null==s?void 0:s.host,r.$pathname=null==s?void 0:s.pathname;var o=function(t){var i=ti.concat([]),e={};return A(i,function(i){var n=Q(t,i);e[i]=n||null}),e}(n);P(r,o)}e&&P(r,ei(e));return r}function ai(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function li(){try{return(new Date).getTimezoneOffset()}catch(t){return}}function hi(t,i){if(!q)return{};var e,r,s,[o,a]=function(t){for(var i=0;i<Gt.length;i++){var[e,n]=Gt[i],r=e.exec(t),s=r&&(tt(n)?n(r,t):n);if(s)return s}return["",""]}(q);return P(function(t){var i={};for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var n=t[e];null!=n&&""!==n&&(i[e]=n)}return i}({$os:o,$os_version:a,$browser:Jt(q,navigator.vendor),$device:Zt(q),$device_type:(r=q,s=Zt(r),s===ot||s===st||"Kobo"===s||"Kindle Fire"===s||s===Ut?rt:s===Ct||s===Tt||s===Et||s===Ot?"Console":s===lt?"Wearable":s?it:"Desktop"),$timezone:ai(),$timezone_offset:li()}),{$current_url:Y(null==B?void 0:B.href,[],ii),$host:null==B?void 0:B.host,$pathname:null==B?void 0:B.pathname,$raw_user_agent:q.length>1e3?q.substring(0,997)+"...":q,$browser_version:Kt(q,navigator.vendor),$browser_language:ni(),$browser_language_prefix:(e=ni(),"string"==typeof e?e.split("-")[0]:void 0),$screen_height:null==U?void 0:U.screen.height,$screen_width:null==U?void 0:U.screen.width,$viewport_height:null==U?void 0:U.innerHeight,$viewport_width:null==U?void 0:U.innerWidth,$lib:"web",$lib_version:n,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}class ui{constructor(t,i){void 0===t&&(t="localStorage"),this.A=null,this.storage=new K({method:t,cross_subdomain:i,sameSite:"Lax"}),this.userIdentity=this.loadUserIdentity()}getUserIdentity(){return e({},this.userIdentity)}getDistinctId(){return this.userIdentity.distinct_id}getAnonymousId(){return this.userIdentity.anonymous_id||(this.userIdentity.anonymous_id=this.generateAnonymousId(),this.storage.set(h,this.userIdentity.anonymous_id,H)),this.userIdentity.anonymous_id}getUserProperties(){return e({},this.userIdentity.properties)}getEffectiveId(){return this.userIdentity.distinct_id||this.getAnonymousId()}getDeviceId(){return this.userIdentity.device_id}getUserState(){return this.userIdentity.user_state}identify(t,i,n){if("number"==typeof t&&(t=t.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.")),t)if(this.isDistinctIdStringLike(t))console.error('The string "'+t+'" 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"!==t){var r=this.userIdentity.distinct_id;if(this.userIdentity.distinct_id=t,!this.userIdentity.device_id){var s=r||this.userIdentity.anonymous_id;this.userIdentity.device_id=s,this.userIdentity.properties=e({},this.userIdentity.properties,{$had_persisted_distinct_id:!0,$device_id:s})}t!==r&&(this.userIdentity.distinct_id=t);var o="anonymous"===this.userIdentity.user_state;t!==r&&o?(this.userIdentity.user_state="identified",i&&(this.userIdentity.properties=e({},this.userIdentity.properties,i)),n&&Object.keys(n).forEach(t=>{t in this.userIdentity.properties||(this.userIdentity.properties[t]=n[t])}),this.saveUserIdentity()):i||n?("anonymous"===this.userIdentity.user_state&&(this.userIdentity.user_state="identified"),i&&(this.userIdentity.properties=e({},this.userIdentity.properties,i)),n&&Object.keys(n).forEach(t=>{t in this.userIdentity.properties||(this.userIdentity.properties[t]=n[t])}),this.saveUserIdentity()):t!==r&&(this.userIdentity.user_state="identified",this.saveUserIdentity())}else console.error('The string "'+t+'" 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(t,i){if(!t&&!i)return!1;var n=this.userIdentity.distinct_id||this.userIdentity.anonymous_id,r=this.getPersonPropertiesHash(n,t,i);return this.A===r?(console.info("VTilt: A duplicate setUserProperties call was made with the same properties. It has been ignored."),!1):(t&&(this.userIdentity.properties=e({},this.userIdentity.properties,t)),i&&Object.keys(i).forEach(t=>{t in this.userIdentity.properties||(this.userIdentity.properties[t]=i[t])}),this.saveUserIdentity(),this.A=r,!0)}reset(t){var i=this.generateAnonymousId(),n=this.userIdentity.device_id,r=t?this.generateDeviceId():n;this.userIdentity={distinct_id:null,anonymous_id:i,device_id:r,properties:{},user_state:"anonymous"},this.A=null,this.saveUserIdentity(),this.userIdentity.properties=e({},this.userIdentity.properties,{$last_vtilt_reset:(new Date).toISOString()}),this.saveUserIdentity()}setDistinctId(t){this.userIdentity.distinct_id=t,this.saveUserIdentity()}setUserState(t){this.userIdentity.user_state=t,this.saveUserIdentity()}updateUserProperties(t,i){t&&(this.userIdentity.properties=e({},this.userIdentity.properties,t)),i&&Object.keys(i).forEach(t=>{t in this.userIdentity.properties||(this.userIdentity.properties[t]=i[t])}),this.saveUserIdentity()}ensureDeviceId(t){this.userIdentity.device_id||(this.userIdentity.device_id=t,this.userIdentity.properties=e({},this.userIdentity.properties,{$had_persisted_distinct_id:!0,$device_id:t}),this.saveUserIdentity())}createAlias(t,i){return this.isValidDistinctId(t)?(void 0===i&&(i=this.getDistinctId()||this.getAnonymousId()),this.isValidDistinctId(i)?t===i?(console.warn("alias matches current distinct_id - should use identify instead"),null):{distinct_id:t,original:i}:(console.warn("Invalid original distinct ID"),null)):(console.warn("Invalid alias provided"),null)}isDistinctIdStringLikePublic(t){return this.isDistinctIdStringLike(t)}set_initial_person_info(t,i){if(!this.getStoredUserProperties()[m]){var e=function(t,i){var e=t?L([],Yt,i||[]):[],n=null==B?void 0:B.href.substring(0,1e3);return{r:ri().substring(0,1e3),u:n?Y(n,e,ii):void 0}}(t,i);this.register_once({[m]:e},void 0)}}get_initial_props(){var t,i,e=this.getStoredUserProperties()[m];return e?(t=oi(e),i={},A(t,function(t,e){var n;i["$initial_"+(n=String(e),n.startsWith("$")?n.substring(1):n)]=t}),i):{}}update_referrer_info(){var t={$referrer:ri(),$referring_domain:si()};this.register_once(t,void 0)}loadUserIdentity(){var t=this.storage.get(h),i=this.storage.get(l),e=this.storage.get(d),n=this.storage.get(a),r=this.getStoredUserProperties(),s=t||this.generateAnonymousId(),o=i||this.generateDeviceId(),u=e||null,v=n||"anonymous",c=s||this.generateAnonymousId();return t||this.storage.set(h,c,H),i||this.storage.set(l,o,H),n||this.storage.set(a,v,H),{distinct_id:u,anonymous_id:c,device_id:o,properties:r,user_state:v}}saveUserIdentity(){this.storage.set(h,this.userIdentity.anonymous_id,H),this.storage.set(l,this.userIdentity.device_id,H),this.storage.set(a,this.userIdentity.user_state,H),this.userIdentity.distinct_id?this.storage.set(d,this.userIdentity.distinct_id,H):this.storage.remove(d),this.setStoredUserProperties(this.userIdentity.properties)}getStoredUserProperties(){return this.storage.getJSON(v)||{}}setStoredUserProperties(t){this.storage.setJSON(v,t,H)}register_once(t,i){var e=this.getStoredUserProperties(),n=!1;for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(r in e||(e[r]=t[r],n=!0));if(i)for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(s in e||(e[s]=i[s],n=!0));n&&this.setStoredUserProperties(e)}generateAnonymousId(){return"anon_"+M()}generateDeviceId(){return"device_"+M()}getPersonPropertiesHash(t,i,e){return JSON.stringify({distinct_id:t,userPropertiesToSet:i,userPropertiesToSetOnce:e})}isValidDistinctId(t){if(!t||"string"!=typeof t)return!1;var i=t.toLowerCase().trim();return!["null","undefined","false","true","anonymous","anon","user","test","guest","visitor","unknown","none"].includes(i)&&0!==t.trim().length}isDistinctIdStringLike(t){if(!t||"string"!=typeof t)return!1;var i=t.toLowerCase().trim();return["null","undefined","false","true","anonymous","anon","user","test","guest","visitor","unknown","none","demo","example","sample","placeholder"].includes(i)}updateStorageMethod(t,i){this.storage=new K({method:t,cross_subdomain:i,sameSite:"Lax"}),this.userIdentity=this.loadUserIdentity()}}var di=["LCP","CLS","FCP","INP"],vi=9e5,ci="[WebVitals]";class fi{static extractConfig(t){var i=t.capture_performance;return"boolean"==typeof i?{web_vitals:i}:"object"==typeof i&&null!==i?i:{web_vitals:!1}}constructor(t){this.name="WebVitals",this.O=!1,this._instance=t,this.P=this.L(),this.U=fi.extractConfig(t.getConfig())}get isEnabled(){var t=null==B?void 0:B.protocol;return("http:"===t||"https:"===t)&&!0===this.U.web_vitals}get isStarted(){return this.O}startIfEnabled(){if(this.isEnabled&&!this.O&&U){var t=this.D();t?this.j(t):this.B()}}stop(){this.O&&(this.N(),this.F&&(clearTimeout(this.F),this.F=void 0),this.O=!1)}onConfigUpdate(t){var i=fi.extractConfig(t),e=this.isEnabled;this.U=i,e||!this.isEnabled||this.O?e&&!this.isEnabled&&this.O&&this.stop():this.startIfEnabled()}get allowedMetrics(){return this.U.web_vitals_allowed_metrics||di}get flushTimeoutMs(){return this.U.web_vitals_delayed_flush_ms||5e3}get maxAllowedValue(){var t=this.U.__web_vitals_max_value;return void 0===t?vi:0===t?0:t<6e4?vi:t}L(){return{url:void 0,pathname:void 0,metrics:[],firstMetricTimestamp:void 0}}D(){var t;return null===(t=V.__VTiltExtensions__)||void 0===t?void 0:t.webVitalsCallbacks}B(){var t,i=null===(t=V.__VTiltExtensions__)||void 0===t?void 0:t.loadExternalDependency;i?i(this._instance,"web-vitals",t=>{if(t)console.error(ci+" Failed to load web-vitals:",t);else{var i=this.D();i?this.j(i):console.error(ci+" web-vitals loaded but callbacks not registered")}}):console.warn(ci+" External dependency loader not available. Include web-vitals.ts entrypoint or use array.full.js bundle.")}j(t){if(!this.O){var i=this.allowedMetrics,e=this.q.bind(this);i.includes("LCP")&&t.onLCP&&t.onLCP(e),i.includes("CLS")&&t.onCLS&&t.onCLS(e,{reportAllChanges:!0}),i.includes("FCP")&&t.onFCP&&t.onFCP(e),i.includes("INP")&&t.onINP&&t.onINP(e),i.includes("TTFB")&&t.onTTFB&&t.onTTFB(e),this.O=!0}}V(){var t;return null===(t=null==U?void 0:U.location)||void 0===t?void 0:t.href}W(){return null==B?void 0:B.pathname}q(t){try{if(!U||!j||!B)return;if(!(null==t?void 0:t.name)||void 0===(null==t?void 0:t.value))return void console.warn(ci+" Invalid metric received",t);if(this.maxAllowedValue>0&&t.value>=this.maxAllowedValue&&"CLS"!==t.name)return void console.warn(ci+" Ignoring "+t.name+" with value >= "+this.maxAllowedValue+"ms");var i=this.V(),n=this.W();if(!i)return void console.warn(ci+" Could not determine current URL");this.P.url&&this.P.url!==i&&this.N(),this.P.url||(this.P.url=i,this.P.pathname=n),this.P.firstMetricTimestamp||(this.P.firstMetricTimestamp=Date.now());var r=this.H(t.attribution),s=this._instance.getSessionId(),o=this.J(),a=e({},t,{attribution:r,timestamp:Date.now(),$current_url:i,$session_id:s,$window_id:o}),l=this.P.metrics.findIndex(i=>i.name===t.name);l>=0?this.P.metrics[l]=a:this.P.metrics.push(a),this.X(),this.P.metrics.length>=this.allowedMetrics.length&&this.N()}catch(t){console.error(ci+" Error adding metric to buffer:",t)}}H(t){if(t){var i=e({},t);return"interactionTargetElement"in i&&delete i.interactionTargetElement,i}}J(){var t;try{return(null===(t=this._instance.sessionManager)||void 0===t?void 0:t.getWindowId())||null}catch(t){return null}}X(){this.F&&clearTimeout(this.F),this.F=setTimeout(()=>{this.N()},this.flushTimeoutMs)}N(){if(this.F&&(clearTimeout(this.F),this.F=void 0),0!==this.P.metrics.length){try{var t={$pathname:this.P.pathname,$current_url:this.P.url};for(var i of this.P.metrics)t["$web_vitals_"+i.name+"_value"]=i.value,t["$web_vitals_"+i.name+"_event"]={name:i.name,value:i.value,delta:i.delta,rating:i.rating,id:i.id,navigationType:i.navigationType,attribution:i.attribution,$session_id:i.$session_id,$window_id:i.$window_id};this._instance.capture("$web_vitals",t)}catch(t){console.error(ci+" Error flushing metrics:",t)}this.P=this.L()}}}function pi(t,i,e){try{if(!(i in t))return()=>{};var n=t[i],r=e(n);return tt(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__vtilt_wrapped__:{enumerable:!1,value:!0}})),t[i]=r,()=>{t[i]=n}}catch(t){return()=>{}}}class gi{constructor(t,i){var e;this.name="HistoryAutocapture",this.O=!1,this._instance=t,this.U=i||gi.extractConfig(t.getConfig()),this.K=(null===(e=null==U?void 0:U.location)||void 0===e?void 0:e.pathname)||""}static extractConfig(t){return{enabled:!1!==t.capture_pageview}}get isEnabled(){return!1!==this.U.enabled&&!1!==this._instance.getConfig().capture_pageview}get isStarted(){return this.O}startIfEnabled(){this.isEnabled&&!this.O&&this.G()}stop(){this.O&&(this.Z&&(this.Z(),this.Z=void 0),this.O=!1)}onConfigUpdate(t){this.U=gi.extractConfig(t),this.isEnabled&&!this.O?this.G():!this.isEnabled&&this.O&&this.stop()}G(){U&&B&&(this.K=B.pathname||"",this.Y(),this.tt(),this.O=!0)}Y(){var t,i;if(null==U?void 0:U.history){var e=this;(null===(t=U.history.pushState)||void 0===t?void 0:t.__vtilt_wrapped__)||pi(U.history,"pushState",t=>function(i,n,r){t.call(this,i,n,r),e.it("pushState")}),(null===(i=U.history.replaceState)||void 0===i?void 0:i.__vtilt_wrapped__)||pi(U.history,"replaceState",t=>function(i,n,r){t.call(this,i,n,r),e.it("replaceState")})}}tt(){if(!this.Z&&U){var t=()=>{this.it("popstate")};O(U,"popstate",t),this.Z=()=>{null==U||U.removeEventListener("popstate",t)}}}it(t){this.isEnabled&&this.O&&y(()=>{var i,e=null===(i=null==U?void 0:U.location)||void 0===i?void 0:i.pathname;if(e&&B&&j){if(e!==this.K){var n={navigation_type:t};this._instance.capture("$pageview",n)}this.K=e}})}}var mi=["a","button","form","input","select","textarea","label"],bi="$copy_autocapture";function yi(t){return null==t}function wi(t){return"string"==typeof t}function _i(t){return void 0===t}function xi(t){return t.replace(/^\s+|\s+$/g,"")}function Si(t,i){return t.indexOf(i)>-1}function ki(t){return 1===(null==t?void 0:t.nodeType)}function Ci(t){return 3===(null==t?void 0:t.nodeType)}function Ei(t,i){var e;return(null===(e=null==t?void 0:t.tagName)||void 0===e?void 0:e.toLowerCase())===i}function Ti(t){return 11===(null==t?void 0:t.nodeType)}function Ii(t){return t?xi(t).split(/\s+/):[]}function $i(t){var i="";switch(typeof t.className){case"string":i=t.className;break;case"object":i=(t.className&&"baseVal"in t.className&&"string"==typeof t.className.baseVal?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:i=""}return Ii(i)}function Mi(t){return yi(t)?null:xi(t).split(/(\s+)/).filter(t=>qi(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Ri(t){var i,e="";if(Wi(t)&&!Hi(t)&&t.childNodes&&t.childNodes.length)for(var n=0;n<t.childNodes.length;n++){var r=t.childNodes[n];Ci(r)&&r.textContent&&(e+=null!==(i=Mi(r.textContent))&&void 0!==i?i:"")}return xi(e)}function Ai(t){var i,e="";if(t&&t.childNodes&&t.childNodes.length)for(var n=0;n<t.childNodes.length;n++){var r=t.childNodes[n];if(r&&"span"===(null===(i=r.tagName)||void 0===i?void 0:i.toLowerCase()))try{e=(e+" "+Ri(r)).trim(),r.childNodes&&r.childNodes.length&&(e=(e+" "+Ai(r)).trim())}catch(t){}}return e}function Oi(t){var i=Ri(t);return qi(i=(i+" "+Ai(t)).trim())?i:""}function Pi(t){if(t.previousElementSibling)return t.previousElementSibling;var i=t;do{i=i.previousSibling}while(i&&!ki(i));return i}function Li(t){var i=t.parentNode;return!(!i||!ki(i))&&i}function Ui(t){var i=null==U?void 0:U.location.href;return!!(i&&t&&t.some(t=>i.match(t)))}var Di="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",zi=new RegExp("^(?:"+Di+")$"),ji=new RegExp(Di),Bi="\\d{3}-?\\d{2}-?\\d{4}",Ni=new RegExp("^("+Bi+")$"),Fi=new RegExp("("+Bi+")");function qi(t,i){if(void 0===i&&(i=!0),yi(t))return!1;if(wi(t)){if(t=xi(t),(i?zi:ji).test((t||"").replace(/[- ]/g,"")))return!1;if((i?Ni:Fi).test(t))return!1}return!0}function Vi(t){return!!wi(t)&&("_ngcontent"===t.substring(0,10)||"_nghost"===t.substring(0,7))}function Wi(t){for(var i=t;i&&i.parentNode&&!Ei(i,"body");i=i.parentNode){var e=$i(i);if(Si(e,"vt-sensitive")||Si(e,"vt-no-capture"))return!1}if(Si($i(t),"vt-include"))return!0;var n=t.type||"";if(wi(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var r=t.name||t.id||"";if(wi(r)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Hi(t){return!!(Ei(t,"input")&&!["button","checkbox","submit","reset","radio"].includes(t.type)||Ei(t,"textarea")||"true"===t.getAttribute("contenteditable"))}function Ji(t){if(!Wi(t))return null;if(Ei(t,"input")){var i=t,e=(i.type||"text").toLowerCase();if("password"===e||"hidden"===e)return null;if("checkbox"===e||"radio"===e){var n={$el_value:i.checked?"true":"false"},r=function(t){var i=t.closest("label");if(i){var e=xi(i.textContent||"");if(e&&qi(e))return Mi(e)||null}if(t.id)try{var n=null===document||void 0===document?void 0:document.querySelector('label[for="'+t.id+'"]');if(n){var r=xi(n.textContent||"");if(r&&qi(r))return Mi(r)||null}}catch(t){}return null}(i);return r?n.$selected_text=r:i.value&&qi(i.value)&&(n.$selected_text=i.value),n}var s=i.value;if(s&&qi(s)){var o=Mi(s);if(o)return{$el_value:o}}return null}if(Ei(t,"select")){var a=t,l=a.selectedIndex;if(l>=0&&a.options[l]){var h=a.options[l],u={};h.value&&qi(h.value)&&(u.$el_value=h.value);var d=h.text;if(d&&qi(d)){var v=Mi(d);v&&(u.$selected_text=v)}if(u.$el_value||u.$selected_text)return u}return null}return Ei(t,"textarea"),null}function Xi(t,i,e,n,r){if(void 0===e&&(e=void 0),!U||!t||Ei(t,"html")||!ki(t))return!1;if((null==e?void 0:e.url_allowlist)&&!Ui(e.url_allowlist))return!1;if((null==e?void 0:e.url_ignorelist)&&Ui(e.url_ignorelist))return!1;if(null==e?void 0:e.dom_event_allowlist){var s=e.dom_event_allowlist;if(s&&!s.some(t=>i.type===t))return!1}for(var o=!1,a=[t],l=!0,h=t;h.parentNode&&!Ei(h,"body");)if(Ti(h.parentNode))a.push(h.parentNode.host),h=h.parentNode.host;else{if(!(l=Li(h)))break;if(n||mi.indexOf(l.tagName.toLowerCase())>-1)o=!0;else{var u=U.getComputedStyle(l);u&&"pointer"===u.getPropertyValue("cursor")&&(o=!0)}a.push(l),h=l}if(!function(t,i){var e=null==i?void 0:i.element_allowlist;if(_i(e))return!0;var n,r=function(t){if(e.some(i=>t.tagName.toLowerCase()===i))return{v:!0}};for(var s of t)if(n=r(s))return n.v;return!1}(a,e))return!1;if(!function(t,i){var e=null==i?void 0:i.css_selector_allowlist;if(_i(e))return!0;var n,r=function(t){if(e.some(i=>t.matches(i)))return{v:!0}};for(var s of t)if(n=r(s))return n.v;return!1}(a,e))return!1;var d=U.getComputedStyle(t);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===i.type)return!0;var v=t.tagName.toLowerCase();switch(v){case"html":return!1;case"form":return(r||["submit"]).indexOf(i.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(i.type)>=0;default:return o?(r||["click"]).indexOf(i.type)>=0:(r||["click"]).indexOf(i.type)>=0&&(mi.indexOf(v)>-1||"true"===t.getAttribute("contenteditable"))}}function Ki(t,i){return i.length>t?i.slice(0,t)+"...":i}function Gi(t,i,e,n){var r=t.tagName.toLowerCase(),s={tag_name:r};mi.indexOf(r)>-1&&!e&&(s.$el_text=Ki(1024,"a"===r||"button"===r?Oi(t):Ri(t)));var o=$i(t);o.length>0&&(s.classes=o.filter(t=>""!==t));for(var a=0;a<t.attributes.length;a++){var l=t.attributes[a];if((!Hi(t)||-1!==["name","id","class","aria-label"].indexOf(l.name))&&(!(null==n?void 0:n.includes(l.name))&&!i&&qi(l.value)&&!Vi(l.name))){var h=l.value;"class"===l.name&&(h=Ii(h).join(" ")),s["attr__"+l.name]=Ki(1024,h)}}for(var u=1,d=1,v=t;v=Pi(v);)u++,v.tagName===t.tagName&&d++;return s.nth_child=u,s.nth_of_type=d,s}function Zi(t){if(!Wi(t))return{};for(var i={},e=0;e<t.attributes.length;e++){var n=t.attributes[e];if(n.name&&0===n.name.indexOf("data-vt-capture-attribute")){var r=n.name.replace("data-vt-capture-attribute-",""),s=n.value;r&&s&&qi(s)&&(i[r]=s)}}return i}function Qi(t){return t.replace(/"|\\"/g,'\\"')}function Yi(t){var i,e=t.attr__class;return e?(i=e,Array.isArray(i)?e:Ii(e)):void 0}function te(t){return function(t){var i=t.map(t=>{var i,n,r="";if(t.tag_name&&(r+=t.tag_name),t.attr_class)for(var s of(t.attr_class.sort(),t.attr_class))r+="."+s.replace(/"/g,"");var o=e({},t.text?{text:t.text}:{},{"nth-child":null!==(i=t.nth_child)&&void 0!==i?i:0,"nth-of-type":null!==(n=t.nth_of_type)&&void 0!==n?n:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),a={};return Object.entries(o).sort((t,i)=>{var[e]=t,[n]=i;return e.localeCompare(n)}).forEach(t=>{var[i,e]=t;return a[Qi(i.toString())]=Qi(String(e))}),(r+=":")+Object.entries(a).map(t=>{var[i,e]=t;return i+'="'+e+'"'}).join("")});return i.join(";")}(function(t){return t.map(t=>{var i,e,n={text:null===(i=t.$el_text)||void 0===i?void 0:i.slice(0,400),tag_name:t.tag_name,href:null===(e=t.attr__href)||void 0===e?void 0:e.slice(0,2048),attr_class:Yi(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Object.entries(t).filter(t=>{var[i]=t;return 0===i.indexOf("attr__")}).forEach(t=>{var[i,e]=t;return n.attributes[i]=e}),n})}(t))}function ie(t,i){return t.indexOf(i)>-1}class ee{constructor(){this.clicks=[],this.RAGE_CLICK_THRESHOLD_PX=30,this.RAGE_CLICK_TIMEOUT_MS=1e3,this.RAGE_CLICK_CLICK_COUNT=3}isRageClick(t,i,e){if(this.clicks=this.clicks.filter(t=>e-t.timestamp<this.RAGE_CLICK_TIMEOUT_MS),this.clicks.length>0){var n=this.clicks[this.clicks.length-1];Math.sqrt(Math.pow(t-n.x,2)+Math.pow(i-n.y,2))>this.RAGE_CLICK_THRESHOLD_PX&&(this.clicks=[])}return this.clicks.push({x:t,y:i,timestamp:e}),this.clicks.length>=this.RAGE_CLICK_CLICK_COUNT}}function ne(t,i){for(var e,n,r,s,{e:o,maskAllElementAttributes:a,maskAllText:l,elementAttributeIgnoreList:h,elementsChainAsString:u,captureElementValues:d}=i,v=[t],c=t;c.parentNode&&!Ei(c,"body");)Ti(c.parentNode)?(v.push(c.parentNode.host),c=c.parentNode.host):(v.push(c.parentNode),c=c.parentNode);var f,p=[],g={},m=!1,b=!1;for(var y of v){var w=Wi(y);if("a"===y.tagName.toLowerCase()){var _=y.getAttribute("href");m=!!(w&&_&&qi(_))&&_}ie($i(y),"vt-no-capture")&&(b=!0),p.push(Gi(y,a,l,h));var x=Zi(y);Object.assign(g,x)}if(b)return{props:{},explicitNoCapture:b};if(l||("a"===t.tagName.toLowerCase()||"button"===t.tagName.toLowerCase()?p[0].$el_text=Oi(t):p[0].$el_text=Ri(t)),"change"===o.type&&d){var S=Ji(t);S&&(S.$el_value&&(p[0].$el_value=S.$el_value),S.$selected_text&&(p[0].$selected_text=S.$selected_text))}if(m){p[0].attr__href=m;var k=null===(e=Z(m))||void 0===e?void 0:e.host,C=null===(n=null==U?void 0:U.location)||void 0===n?void 0:n.host;k&&C&&k!==C&&(f=m)}var E=function(){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];return Object.assign({},...i)}({$event_type:o.type,$ce_version:1},u?{}:{$elements:p},{$elements_chain:te(p)},(null===(r=p[0])||void 0===r?void 0:r.$el_text)?{$el_text:null===(s=p[0])||void 0===s?void 0:s.$el_text}:{},f&&"click"===o.type?{$external_click_url:f}:{},g);return{props:E}}class re{constructor(t){this.name="Autocapture",this.et=!1,this.nt=null,this.rt=null,this.st=new ee,this.ot=!1,this._instance=t}get U(){var t,i=this._instance.getConfig(),e="object"!=typeof(t=i.autocapture)||null===t||Array.isArray(t)?{}:i.autocapture;return e.url_allowlist&&(e.url_allowlist=e.url_allowlist.map(t=>"string"==typeof t?new RegExp(t):t)),e.url_ignorelist&&(e.url_ignorelist=e.url_ignorelist.map(t=>"string"==typeof t?new RegExp(t):t)),e}get isEnabled(){var t,i=null!==(t=this.nt)&&void 0!==t&&t;return!!this._instance.getConfig().autocapture&&!i}get isStarted(){return this.et}startIfEnabled(){this.isEnabled&&!this.et&&(this.lt(),this.et=!0)}stop(){this.et=!1}onConfigUpdate(t){this.isEnabled&&!this.et&&this.startIfEnabled()}onRemoteConfig(t){t.elementsChainAsString&&(this.ot=t.elementsChainAsString),this.nt=!!t.autocapture_opt_out,this.startIfEnabled()}updateConfig(t){void 0!==t.enabled&&t.enabled&&(this.nt=!1)}setElementSelectors(t){this.rt=t}getElementSelectors(t){var i,e=[];return null===(i=this.rt)||void 0===i||i.forEach(i=>{var n=null==j?void 0:j.querySelectorAll(i);null==n||n.forEach(n=>{t===n&&e.push(i)})}),e}lt(){if(this.ht()&&U&&j){var t=t=>{t=t||(null==U?void 0:U.event);try{this.ut(t)}catch(t){}};if(O(j,"submit",t,{capture:!0}),O(j,"change",t,{capture:!0}),O(j,"click",t,{capture:!0}),this.U.capture_copied_text){var i=t=>{t=t||(null==U?void 0:U.event),this.ut(t,bi)};O(j,"copy",i,{capture:!0}),O(j,"cut",i,{capture:!0})}}}ut(t,i){var e,n,r,s,o;if(void 0===i&&(i="$autocapture"),this.isEnabled){var a=function(t){var i;return _i(t.target)?t.srcElement||null:(null===(i=t.target)||void 0===i?void 0:i.shadowRoot)?t.composedPath()[0]||null:t.target||null}(t);if(Ci(a)&&(a=a.parentNode||null),"$autocapture"===i&&"click"===t.type&&t instanceof MouseEvent)this._instance.getConfig().rageclick&&(null===(e=this.st)||void 0===e?void 0:e.isRageClick(t.clientX,t.clientY,(new Date).getTime()))&&this.ut(t,"$rageclick");var l=i===bi;if(a&&Xi(a,t,this.U,l,l?["copy","cut"]:void 0)){var h=this._instance.getConfig(),{props:u,explicitNoCapture:d}=ne(a,{e:t,maskAllElementAttributes:null!==(n=h.mask_all_element_attributes)&&void 0!==n&&n,maskAllText:null!==(r=h.mask_all_text)&&void 0!==r&&r,elementAttributeIgnoreList:this.U.element_attribute_ignorelist,elementsChainAsString:this.ot,captureElementValues:null!==(s=this.U.capture_element_values)&&void 0!==s&&s});if(d)return!1;var v=this.getElementSelectors(a);if(v&&v.length>0&&(u.$element_selectors=v),i===bi){var c=Mi(null===(o=null==U?void 0:U.getSelection())||void 0===o?void 0:o.toString()),f=t.type||"clipboard";if(!c)return!1;u.$selected_content=c,u.$copy_type=f}return this._instance.capture(i,u),!0}}}ht(){return"function"==typeof(null==j?void 0:j.querySelectorAll)}}var se="[SessionRecording]";class oe{constructor(t,i){this._instance=t,this.name="SessionRecording",this.O=!1,this.U=i||oe.extractConfig(t.getConfig())}static extractConfig(t){var i,e,n,r=t.session_recording||{};return{enabled:null!==(i=r.enabled)&&void 0!==i&&i,sampleRate:r.sampleRate,minimumDurationMs:r.minimumDurationMs,sessionIdleThresholdMs:r.sessionIdleThresholdMs,fullSnapshotIntervalMs:r.fullSnapshotIntervalMs,captureConsole:null!==(e=r.captureConsole)&&void 0!==e&&e,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}}get isEnabled(){var t,i=this._instance.getConfig(),e=null!==(t=this.U.enabled)&&void 0!==t&&t,n=!i.disable_session_recording;return!!U&&e&&n}get isStarted(){var t;return this.O&&!!(null===(t=this.dt)||void 0===t?void 0:t.isStarted)}startIfEnabled(){this.startIfEnabledOrStop("recording_initialized")}startIfEnabledOrStop(t){var i;if(!this.isEnabled||!(null===(i=this.dt)||void 0===i?void 0:i.isStarted)){var e=void 0!==Object.assign&&void 0!==Array.from;this.isEnabled&&e?(this.ct(t),this.O=!0,console.info(se+" starting")):this.stop()}}stop(){y(()=>{var t;null===(t=this.dt)||void 0===t||t.stop(),this.O=!1})}onConfigUpdate(t){var i;this.U=oe.extractConfig(t),null===(i=this.dt)||void 0===i||i.updateConfig(this.U),this.startIfEnabledOrStop("config_updated")}onRemoteConfig(t){var i,n,r,s,o,a,l;if(t.sessionRecording){var h=t.sessionRecording;this.U=e({},this.U,{enabled:null!==(i=this.U.enabled)&&void 0!==i?i:h.enabled,sampleRate:null!==(n=this.U.sampleRate)&&void 0!==n?n:h.sampleRate,minimumDurationMs:null!==(r=this.U.minimumDurationMs)&&void 0!==r?r:h.minimumDurationMs,fullSnapshotIntervalMs:null!==(s=this.U.fullSnapshotIntervalMs)&&void 0!==s?s:h.fullSnapshotIntervalMs,maskAllInputs:null!==(o=this.U.maskAllInputs)&&void 0!==o?o:h.maskAllInputs,captureConsole:null!==(a=this.U.captureConsole)&&void 0!==a?a:h.captureConsole,captureCanvas:null!==(l=this.U.captureCanvas)&&void 0!==l?l:h.captureCanvas}),this.startIfEnabledOrStop("remote_config")}}get started(){return this.isStarted}get status(){var t;return(null===(t=this.dt)||void 0===t?void 0:t.status)||"lazy_loading"}get sessionId(){var t;return(null===(t=this.dt)||void 0===t?void 0:t.sessionId)||""}stopRecording(){this.stop()}log(t,i){var e;void 0===i&&(i="log"),(null===(e=this.dt)||void 0===e?void 0:e.log)?this.dt.log(t,i):console.warn(se+" log called before recorder was ready")}updateConfig(t){var i;this.U=e({},this.U,t),null===(i=this.dt)||void 0===i||i.updateConfig(this.U)}get ft(){return"recorder"}ct(t){var i,e,n,r;if(this.isEnabled)if((null===(e=null===(i=null==V?void 0:V.__VTiltExtensions__)||void 0===i?void 0:i.rrweb)||void 0===e?void 0:e.record)&&(null===(n=V.__VTiltExtensions__)||void 0===n?void 0:n.initSessionRecording))this.gt(t);else{var s=null===(r=V.__VTiltExtensions__)||void 0===r?void 0:r.loadExternalDependency;s?s(this._instance,this.ft,i=>{i?console.error(se+" could not load recorder:",i):this.gt(t)}):console.error(se+" loadExternalDependency not available. Session recording cannot start.")}}gt(t){var i,e=null===(i=V.__VTiltExtensions__)||void 0===i?void 0:i.initSessionRecording;e?(this.dt||(this.dt=e(this._instance,this.U)),this.dt.start(t)):console.error(se+" initSessionRecording not available after script load")}}var ae=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(ae||{}),le=Uint8Array,he=Uint16Array,ue=Int32Array,de=new le([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]),ve=new le([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]),ce=new le([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),fe=function(t,i){for(var e=new he(31),n=0;n<31;++n)e[n]=i+=1<<t[n-1];var r=new ue(e[30]);for(n=1;n<30;++n)for(var s=e[n];s<e[n+1];++s)r[s]=s-e[n]<<5|n;return{b:e,r:r}},pe=fe(de,2),ge=pe.b,me=pe.r;ge[28]=258,me[258]=28;for(var be=fe(ve,0).r,ye=new he(32768),we=0;we<32768;++we){var _e=(43690&we)>>1|(21845&we)<<1;_e=(61680&(_e=(52428&_e)>>2|(13107&_e)<<2))>>4|(3855&_e)<<4,ye[we]=((65280&_e)>>8|(255&_e)<<8)>>1}var xe=function(t,i,e){for(var n=t.length,r=0,s=new he(i);r<n;++r)t[r]&&++s[t[r]-1];var o,a=new he(i);for(r=1;r<i;++r)a[r]=a[r-1]+s[r-1]<<1;if(e){o=new he(1<<i);var l=15-i;for(r=0;r<n;++r)if(t[r])for(var h=r<<4|t[r],u=i-t[r],d=a[t[r]-1]++<<u,v=d|(1<<u)-1;d<=v;++d)o[ye[d]>>l]=h}else for(o=new he(n),r=0;r<n;++r)t[r]&&(o[r]=ye[a[t[r]-1]++]>>15-t[r]);return o},Se=new le(288);for(we=0;we<144;++we)Se[we]=8;for(we=144;we<256;++we)Se[we]=9;for(we=256;we<280;++we)Se[we]=7;for(we=280;we<288;++we)Se[we]=8;var ke=new le(32);for(we=0;we<32;++we)ke[we]=5;var Ce=xe(Se,9,0),Ee=xe(ke,5,0),Te=function(t){return(t+7)/8|0},Ie=function(t,i,e){return(null==e||e>t.length)&&(e=t.length),new le(t.subarray(i,e))},$e=function(t,i,e){e<<=7&i;var n=i/8|0;t[n]|=e,t[n+1]|=e>>8},Me=function(t,i,e){e<<=7&i;var n=i/8|0;t[n]|=e,t[n+1]|=e>>8,t[n+2]|=e>>16},Re=function(t,i){for(var e=[],n=0;n<t.length;++n)t[n]&&e.push({s:n,f:t[n]});var r=e.length,s=e.slice();if(!r)return{t:ze,l:0};if(1==r){var o=new le(e[0].s+1);return o[e[0].s]=1,{t:o,l:1}}e.sort(function(t,i){return t.f-i.f}),e.push({s:-1,f:25001});var a=e[0],l=e[1],h=0,u=1,d=2;for(e[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=r-1;)a=e[e[h].f<e[d].f?h++:d++],l=e[h!=u&&e[h].f<e[d].f?h++:d++],e[u++]={s:-1,f:a.f+l.f,l:a,r:l};var v=s[0].s;for(n=1;n<r;++n)s[n].s>v&&(v=s[n].s);var c=new he(v+1),f=Ae(e[u-1],c,0);if(f>i){n=0;var p=0,g=f-i,m=1<<g;for(s.sort(function(t,i){return c[i.s]-c[t.s]||t.f-i.f});n<r;++n){var b=s[n].s;if(!(c[b]>i))break;p+=m-(1<<f-c[b]),c[b]=i}for(p>>=g;p>0;){var y=s[n].s;c[y]<i?p-=1<<i-c[y]++-1:++n}for(;n>=0&&p;--n){var w=s[n].s;c[w]==i&&(--c[w],++p)}f=i}return{t:new le(c),l:f}},Ae=function(t,i,e){return-1==t.s?Math.max(Ae(t.l,i,e+1),Ae(t.r,i,e+1)):i[t.s]=e},Oe=function(t){for(var i=t.length;i&&!t[--i];);for(var e=new he(++i),n=0,r=t[0],s=1,o=function(t){e[n++]=t},a=1;a<=i;++a)if(t[a]==r&&a!=i)++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=t[a]}return{c:e.subarray(0,n),n:i}},Pe=function(t,i){for(var e=0,n=0;n<i.length;++n)e+=t[n]*i[n];return e},Le=function(t,i,e){var n=e.length,r=Te(i+2);t[r]=255&n,t[r+1]=n>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var s=0;s<n;++s)t[r+s+4]=e[s];return 8*(r+4+n)},Ue=function(t,i,e,n,r,s,o,a,l,h,u){$e(i,u++,e),++r[256];for(var d=Re(r,15),v=d.t,c=d.l,f=Re(s,15),p=f.t,g=f.l,m=Oe(v),b=m.c,y=m.n,w=Oe(p),_=w.c,x=w.n,S=new he(19),k=0;k<b.length;++k)++S[31&b[k]];for(k=0;k<_.length;++k)++S[31&_[k]];for(var C=Re(S,7),E=C.t,T=C.l,I=19;I>4&&!E[ce[I-1]];--I);var M,R,A,O,P=h+5<<3,L=Pe(r,Se)+Pe(s,ke)+o,U=Pe(r,v)+Pe(s,p)+o+14+3*I+Pe(S,E)+2*S[16]+3*S[17]+7*S[18];if(l>=0&&P<=L&&P<=U)return Le(i,u,t.subarray(l,l+h));if($e(i,u,1+(U<L)),u+=2,U<L){M=xe(v,c,0),R=v,A=xe(p,g,0),O=p;var D=xe(E,T,0);$e(i,u,y-257),$e(i,u+5,x-1),$e(i,u+10,I-4),u+=14;for(k=0;k<I;++k)$e(i,u+3*k,E[ce[k]]);u+=3*I;for(var z=[b,_],j=0;j<2;++j){var B=z[j];for(k=0;k<B.length;++k){var N=31&B[k];$e(i,u,D[N]),u+=E[N],N>15&&($e(i,u,B[k]>>5&127),u+=B[k]>>12)}}}else M=Ce,R=Se,A=Ee,O=ke;for(k=0;k<a;++k){var F=n[k];if(F>255){Me(i,u,M[(N=F>>18&31)+257]),u+=R[N+257],N>7&&($e(i,u,F>>23&31),u+=de[N]);var q=31&F;Me(i,u,A[q]),u+=O[q],q>3&&(Me(i,u,F>>5&8191),u+=ve[q])}else Me(i,u,M[F]),u+=R[F]}return Me(i,u,M[256]),u+R[256]},De=new ue([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ze=new le(0),je=function(){for(var t=new Int32Array(256),i=0;i<256;++i){for(var e=i,n=9;--n;)e=(1&e&&-306674912)^e>>>1;t[i]=e}return t}(),Be=function(t,i,e,n,r){if(!r&&(r={l:1},i.dictionary)){var s=i.dictionary.subarray(-32768),o=new le(s.length+t.length);o.set(s),o.set(t,s.length),t=o,r.w=s.length}return function(t,i,e,n,r,s){var o=s.z||t.length,a=new le(n+o+5*(1+Math.ceil(o/7e3))+r),l=a.subarray(n,a.length-r),h=s.l,u=7&(s.r||0);if(i){u&&(l[0]=s.r>>3);for(var d=De[i-1],v=d>>13,c=8191&d,f=(1<<e)-1,p=s.p||new he(32768),g=s.h||new he(f+1),m=Math.ceil(e/3),b=2*m,y=function(i){return(t[i]^t[i+1]<<m^t[i+2]<<b)&f},w=new ue(25e3),_=new he(288),x=new he(32),S=0,k=0,C=s.i||0,E=0,T=s.w||0,I=0;C+2<o;++C){var M=y(C),R=32767&C,A=g[M];if(p[R]=A,g[M]=R,T<=C){var O=o-C;if((S>7e3||E>24576)&&(O>423||!h)){u=Ue(t,l,0,w,_,x,k,E,I,C-I,u),E=S=k=0,I=C;for(var P=0;P<286;++P)_[P]=0;for(P=0;P<30;++P)x[P]=0}var L=2,U=0,D=c,z=R-A&32767;if(O>2&&M==y(C-z))for(var j=Math.min(v,O)-1,B=Math.min(32767,C),N=Math.min(258,O);z<=B&&--D&&R!=A;){if(t[C+L]==t[C+L-z]){for(var F=0;F<N&&t[C+F]==t[C+F-z];++F);if(F>L){if(L=F,U=z,F>j)break;var q=Math.min(z,F-2),V=0;for(P=0;P<q;++P){var W=C-z+P&32767,H=W-p[W]&32767;H>V&&(V=H,A=W)}}}z+=(R=A)-(A=p[R])&32767}if(U){w[E++]=268435456|me[L]<<18|be[U];var J=31&me[L],X=31&be[U];k+=de[J]+ve[X],++_[257+J],++x[X],T=C+L,++S}else w[E++]=t[C],++_[t[C]]}}for(C=Math.max(C,T);C<o;++C)w[E++]=t[C],++_[t[C]];u=Ue(t,l,h,w,_,x,k,E,I,C-I,u),h||(s.r=7&u|l[u/8|0]<<3,u-=7,s.h=g,s.p=p,s.i=C,s.w=T)}else{for(C=s.w||0;C<o+h;C+=65535){var K=C+65535;K>=o&&(l[u/8|0]=h,K=o),u=Le(l,u+1,t.subarray(C,K))}s.i=o}return Ie(a,0,n+Te(u)+r)}(t,null==i.level?6:i.level,null==i.mem?r.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):20:12+i.mem,e,n,r)},Ne=function(t,i,e){for(;e;++i)t[i]=e,e>>>=8};function Fe(t,i){i||(i={});var e=function(){var t=-1;return{p:function(i){for(var e=t,n=0;n<i.length;++n)e=je[255&e^i[n]]^e>>>8;t=e},d:function(){return~t}}}(),n=t.length;e.p(t);var r,s=Be(t,i,10+((r=i).filename?r.filename.length+1:0),8),o=s.length;return function(t,i){var e=i.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=i.level<2?4:9==i.level?2:0,t[9]=3,0!=i.mtime&&Ne(t,4,Math.floor(new Date(i.mtime||Date.now())/1e3)),e){t[3]=8;for(var n=0;n<=e.length;++n)t[n+10]=e.charCodeAt(n)}}(s,i),Ne(s,o-8,e.d()),Ne(s,o-4,n),s}var qe="undefined"!=typeof TextEncoder&&new TextEncoder,Ve="undefined"!=typeof TextDecoder&&new TextDecoder;try{Ve.decode(ze,{stream:!0})}catch(t){}ae.MouseMove,ae.MouseInteraction,ae.Scroll,ae.ViewportResize,ae.Input,ae.TouchMove,ae.MediaInteraction,ae.Drag;var We="[Chat]";class He{constructor(t,i){this._instance=t,this.name="Chat",this.bt=null,this.yt=!1,this.wt=!1,this.O=!1,this._t=null,this.xt=[],this.St=[],this.kt=[],this.Ct=[],this.Et=[],this.U=i||He.extractConfig(t.getConfig())}static extractConfig(t){var i,e=t.chat||{};return{enabled:e.enabled,autoConfig:null===(i=e.autoConfig)||void 0===i||i,position:e.position,greeting:e.greeting,color:e.color,aiMode:e.aiMode,aiGreeting:e.aiGreeting,preload:e.preload,offlineMessage:e.offlineMessage,collectEmailOffline:e.collectEmailOffline}}get isEnabled(){var t;return!1!==this.U.enabled&&(!0===this.U.enabled||!this._instance.getConfig().disable_chat&&!0===(null===(t=this.bt)||void 0===t?void 0:t.enabled))}get isStarted(){return this.O}startIfEnabled(){this.Tt().catch(t=>{console.error(We+" Error starting:",t)})}stop(){this.destroy(),this.O=!1}onConfigUpdate(t){var i,e;this.U=He.extractConfig(t),this.It&&(null===(e=(i=this.It).updateConfig)||void 0===e||e.call(i,this.getMergedConfig()))}onRemoteConfig(t){var i,n,r,s,o,a,l,h,u;t.chat&&(this.bt=e({},this.bt,{enabled:null!==(r=null!==(i=t.chat.enabled)&&void 0!==i?i:null===(n=this.bt)||void 0===n?void 0:n.enabled)&&void 0!==r&&r,position:null!==(a=null!==(s=t.chat.widgetPosition)&&void 0!==s?s:null===(o=this.bt)||void 0===o?void 0:o.position)&&void 0!==a?a:"bottom-right",color:null!==(u=null!==(l=t.chat.widgetColor)&&void 0!==l?l:null===(h=this.bt)||void 0===h?void 0:h.color)&&void 0!==u?u:"#6366f1"}),this.isEnabled&&!this.O&&this.startIfEnabled())}Tt(){var t=this;return i(function*(){var i,e,n,r;!1!==t.U.enabled?t._instance.getConfig().disable_chat?console.info(We+" disabled by disable_chat config"):(!1!==t.U.autoConfig&&(yield t.$t()),t.isEnabled?(t.O=!0,null!==(n=null!==(i=t.U.preload)&&void 0!==i?i:null===(e=t.bt)||void 0===e?void 0:e.enabled)&&void 0!==n&&n&&t.Mt(),(null===(r=t.bt)||void 0===r?void 0:r.enabled)&&t.Rt(),console.info(We+" ready (lazy-load on demand)")):console.info(We+" not enabled (check dashboard settings)")):console.info(We+" disabled by code config")})()}get isOpen(){var t,i;return null!==(i=null===(t=this.It)||void 0===t?void 0:t.isOpen)&&void 0!==i&&i}get isConnected(){var t,i;return null!==(i=null===(t=this.It)||void 0===t?void 0:t.isConnected)&&void 0!==i&&i}get isLoading(){var t,i;return this.wt||null!==(i=null===(t=this.It)||void 0===t?void 0:t.isLoading)&&void 0!==i&&i}get unreadCount(){var t,i;return null!==(i=null===(t=this.It)||void 0===t?void 0:t.unreadCount)&&void 0!==i?i:0}get channel(){var t,i;return null!==(i=null===(t=this.It)||void 0===t?void 0:t.channel)&&void 0!==i?i:null}get channels(){var t,i;return null!==(i=null===(t=this.It)||void 0===t?void 0:t.channels)&&void 0!==i?i:[]}get currentView(){var t,i;return null!==(i=null===(t=this.It)||void 0===t?void 0:t.currentView)&&void 0!==i?i:"list"}open(){this.At(()=>{var t;return null===(t=this.It)||void 0===t?void 0:t.open()})}close(){var t;null===(t=this.It)||void 0===t||t.close()}toggle(){this.It?this.It.toggle():this.open()}show(){this.At(()=>{var t;return null===(t=this.It)||void 0===t?void 0:t.show()})}hide(){var t;null===(t=this.It)||void 0===t||t.hide()}getChannels(){this.At(()=>{var t;return null===(t=this.It)||void 0===t?void 0:t.getChannels()})}selectChannel(t){this.At(()=>{var i;return null===(i=this.It)||void 0===i?void 0:i.selectChannel(t)})}createChannel(){this.At(()=>{var t;return null===(t=this.It)||void 0===t?void 0:t.createChannel()})}goToChannelList(){var t;null===(t=this.It)||void 0===t||t.goToChannelList()}sendMessage(t){this.It?this.It.sendMessage(t):(this.xt.push(t),this.At(()=>{this.xt.forEach(t=>{var i;return null===(i=this.It)||void 0===i?void 0:i.sendMessage(t)}),this.xt=[]}))}markAsRead(){var t;null===(t=this.It)||void 0===t||t.markAsRead()}onMessage(t){return this.kt.push(t),this.It?this.It.onMessage(t):()=>{var i=this.kt.indexOf(t);i>-1&&this.kt.splice(i,1)}}onTyping(t){return this.Ct.push(t),this.It?this.It.onTyping(t):()=>{var i=this.Ct.indexOf(t);i>-1&&this.Ct.splice(i,1)}}onConnectionChange(t){return this.Et.push(t),this.It?this.It.onConnectionChange(t):()=>{var i=this.Et.indexOf(t);i>-1&&this.Et.splice(i,1)}}updateConfig(t){this.U=e({},this.U,t)}getMergedConfig(){var t,i,e,n,r,s,o,a,l,h,u,d,v,c,f,p,g,m,b=this.bt,y=this.U;return{enabled:null!==(i=null!==(t=y.enabled)&&void 0!==t?t:null==b?void 0:b.enabled)&&void 0!==i&&i,autoConfig:null===(e=y.autoConfig)||void 0===e||e,position:null!==(r=null!==(n=y.position)&&void 0!==n?n:null==b?void 0:b.position)&&void 0!==r?r:"bottom-right",greeting:null!==(s=y.greeting)&&void 0!==s?s:null==b?void 0:b.greeting,color:null!==(a=null!==(o=y.color)&&void 0!==o?o:null==b?void 0:b.color)&&void 0!==a?a:"#6366f1",aiMode:null===(h=null!==(l=y.aiMode)&&void 0!==l?l:null==b?void 0:b.ai_enabled)||void 0===h||h,aiGreeting:null!==(u=y.aiGreeting)&&void 0!==u?u:null==b?void 0:b.ai_greeting,preload:null!==(d=y.preload)&&void 0!==d&&d,theme:null!==(v=y.theme)&&void 0!==v?v:{primaryColor:null!==(f=null!==(c=y.color)&&void 0!==c?c:null==b?void 0:b.color)&&void 0!==f?f:"#6366f1"},offlineMessage:null!==(p=y.offlineMessage)&&void 0!==p?p:null==b?void 0:b.offline_message,collectEmailOffline:null===(m=null!==(g=y.collectEmailOffline)&&void 0!==g?g:null==b?void 0:b.collect_email_offline)||void 0===m||m}}destroy(){y(()=>{var t,i;null===(t=this.It)||void 0===t||t.destroy(),this.It=void 0,this.xt=[],this.St=[],this.kt=[],this.Ct=[],this.Et=[];var e=null===(i=null==U?void 0:U.document)||void 0===i?void 0:i.getElementById("vtilt-chat-bubble");e&&e.remove()})}$t(){var t=this;return i(function*(){if(!t.yt){var i=t._instance.getConfig(),e=i.token,n=i.api_host;if(!e||!n)return console.warn(We+" Cannot fetch settings: missing token or api_host"),void(t.yt=!0);try{var r=n+"/api/chat/settings?token="+encodeURIComponent(e),s=yield fetch(r);if(!s.ok)return console.warn(We+" Failed to fetch settings: "+s.status),void(t.yt=!0);t.bt=yield s.json(),t.yt=!0,console.info(We+" Loaded settings from dashboard")}catch(i){console.warn(We+" Error fetching settings:",i),t.yt=!0}}})()}Rt(){if((null==U?void 0:U.document)&&!document.getElementById("vtilt-chat-bubble")){var t=this.getMergedConfig(),i=t.position||"bottom-right",e=t.color||"#6366f1",n=document.createElement("div");n.id="vtilt-chat-bubble",n.setAttribute("style",("\n position: fixed;\n bottom: 20px;\n "+("bottom-right"===i?"right: 20px;":"left: 20px;")+"\n width: 60px;\n height: 60px;\n border-radius: 50%;\n background: "+e+";\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 ft(){return"chat"}Mt(){"undefined"!=typeof requestIdleCallback?requestIdleCallback(()=>this.Ot(),{timeout:5e3}):setTimeout(()=>this.Ot(),3e3)}At(t){this.It?t():(this.St.push(t),this.Ot())}Ot(){var t,i;if(!(this.wt||this.It||this._t))if(null===(t=V.__VTiltExtensions__)||void 0===t?void 0:t.initChat)this.gt();else{this.wt=!0;var e=null===(i=V.__VTiltExtensions__)||void 0===i?void 0:i.loadExternalDependency;if(!e)return console.error(We+" loadExternalDependency not available. Chat cannot start."),this.wt=!1,void(this._t="loadExternalDependency not available");e(this._instance,this.ft,t=>{if(this.wt=!1,t)return console.error(We+" Failed to load:",t),void(this._t=String(t));this.gt()})}}gt(){var t,i=null===(t=V.__VTiltExtensions__)||void 0===t?void 0:t.initChat;if(!i)return console.error(We+" initChat not available after script load"),void(this._t="initChat not available");if(!this.It){var e=this.getMergedConfig();this.It=i(this._instance,e),this.kt.forEach(t=>{var i;return null===(i=this.It)||void 0===i?void 0:i.onMessage(t)}),this.Ct.forEach(t=>{var i;return null===(i=this.It)||void 0===i?void 0:i.onTyping(t)}),this.Et.forEach(t=>{var i;return null===(i=this.It)||void 0===i?void 0:i.onConnectionChange(t)});var n=null===document||void 0===document?void 0:document.getElementById("vtilt-chat-bubble");n&&n.remove()}this.St.forEach(t=>t()),this.St=[],console.info(We+" loaded and ready")}}var Je="[VtdOverlay]";class Xe{constructor(t,i){this.name="VtdOverlay",this.O=!1,this.Pt=null,this.Lt=null,this.wt=!0,this.Ut=null,this.Dt=null,this.zt=null,this._instance=t,this.U=i||Xe.extractConfig(t.getConfig())}static extractConfig(t){return{enabled:!1!==t.vtd_overlay}}get isEnabled(){return!1!==this.U.enabled}get isStarted(){return this.O}startIfEnabled(){}stop(){this.O&&y(()=>{this.jt(),this.O=!1})}onConfigUpdate(t){this.U=Xe.extractConfig(t),!this.isEnabled&&this.O&&this.stop()}setDestinationUrl(t){var i;if(this.isEnabled)if(null==t?void 0:t.trim()){var e=t;try{e=decodeURIComponent(t)}catch(i){e=t}if(this.Bt(e)){var n=this.Nt(e);this.Lt=e,this.Pt=n,this.wt=!0,this.Ft(),this.O=!0,this._instance.capture("$vtd_view",{$vtd_url:e,$vtd_embed_url:n!==e?n:void 0,$current_url:null===(i=null==U?void 0:U.location)||void 0===i?void 0:i.href})}else console.warn(Je+" Invalid URL: "+e)}else console.warn(Je+" Empty URL provided");else console.warn(Je+" Feature is disabled")}getDestinationUrl(){return this.Pt}close(){this._instance.capture("$vtd_close",{$vtd_url:this.Lt}),this.Ut?(this.Ut.classList.add("vtilt-vtd-closing"),setTimeout(()=>{this.jt(),this.O=!1,this.Pt=null,this.Lt=null},200)):(this.jt(),this.O=!1,this.Pt=null,this.Lt=null)}Bt(t){try{var i=new URL(t);return"http:"===i.protocol||"https:"===i.protocol}catch(t){return!1}}Nt(t){try{var i=new URL(t),e=i.hostname.toLowerCase();if("youtube.com"===e||"www.youtube.com"===e||"m.youtube.com"===e){var n=i.searchParams.get("v");if(n){var r=i.searchParams.get("t"),s="https://www.youtube.com/embed/"+n+"?autoplay=1";return r&&(s+="&start="+r.replace("s","")),s}}if("youtu.be"===e){var o=i.pathname.slice(1);if(o){var a=i.searchParams.get("t"),l="https://www.youtube.com/embed/"+o+"?autoplay=1";return a&&(l+="&start="+a.replace("s","")),l}}if("vimeo.com"===e||"www.vimeo.com"===e){var h=i.pathname.match(/^\/(\d+)/);if(h)return"https://player.vimeo.com/video/"+h[1]+"?autoplay=1"}if("loom.com"===e||"www.loom.com"===e){var u=i.pathname.match(/^\/share\/([a-zA-Z0-9]+)/);if(u)return"https://www.loom.com/embed/"+u[1]+"?autoplay=1"}if(e.endsWith("wistia.com")){var d=i.pathname.match(/^\/medias\/([a-zA-Z0-9]+)/);if(d)return"https://fast.wistia.net/embed/iframe/"+d[1]+"?autoplay=1"}if("dailymotion.com"===e||"www.dailymotion.com"===e){var v=i.pathname.match(/^\/video\/([a-zA-Z0-9]+)/);if(v)return"https://www.dailymotion.com/embed/video/"+v[1]+"?autoplay=1"}if("open.spotify.com"===e){var c=i.pathname.match(/^\/(track|album|playlist|episode|show)\/([a-zA-Z0-9]+)/);if(c)return"https://open.spotify.com/embed/"+c[1]+"/"+c[2]}return"drive.google.com"===e&&i.pathname.includes("/view")?t.replace("/view","/preview"):t}catch(i){return t}}qt(t){try{return new URL(t).hostname}catch(i){return t}}Vt(t){try{return"https://www.google.com/s2/favicons?domain="+new URL(t).hostname+"&sz=32"}catch(t){return""}}Ft(){if(j&&this.Pt){this.jt(),this.Ut=j.createElement("div"),this.Ut.id="vtilt-vtd-overlay",this.Ut.className="vtilt-vtd-opening",this.Ut.setAttribute("style",this.Wt());var t=j.createElement("div");t.className="vtilt-vtd-modal",t.setAttribute("style",this.Ht());var i=j.createElement("div");i.className="vtilt-vtd-header",i.setAttribute("style",this.Jt()),i.innerHTML=this.Xt(),t.appendChild(i);var e=j.createElement("div");e.className="vtilt-vtd-iframe-wrapper",e.setAttribute("style",this.Kt()),this.zt=j.createElement("div"),this.zt.className="vtilt-vtd-loading",this.zt.setAttribute("style",this.Gt()),this.zt.innerHTML=this.Zt(),e.appendChild(this.zt),this.Dt=j.createElement("iframe"),this.Dt.id="vtilt-vtd-iframe",this.Dt.className="vtilt-vtd-iframe",this.Dt.setAttribute("style",this.Qt()),this.Dt.setAttribute("frameborder","0"),this.Dt.setAttribute("allowfullscreen","true"),this.Dt.setAttribute("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share");var n=()=>{this.wt=!1,this.zt&&(this.zt.style.opacity="0",setTimeout(()=>{var t;(null===(t=this.zt)||void 0===t?void 0:t.parentNode)&&(this.zt.style.display="none")},300)),this.Dt&&(this.Dt.style.opacity="1")};this.Dt.onload=n,this.Dt.onerror=n,setTimeout(()=>{this.wt&&n()},5e3),e.appendChild(this.Dt),this.Dt.src=this.Pt,t.appendChild(e),this.Ut.appendChild(t);var r=j.createElement("style");r.id="vtilt-vtd-styles",r.textContent=this.Yt(),j.head.appendChild(r),j.body.appendChild(this.Ut),this.ti(),j.body.style.overflow="hidden"}}jt(){var t;(null===(t=this.Ut)||void 0===t?void 0:t.parentNode)&&(this.Ut.parentNode.removeChild(this.Ut),this.Ut=null,this.Dt=null,this.zt=null);var i=null==j?void 0:j.getElementById("vtilt-vtd-styles");(null==i?void 0:i.parentNode)&&i.parentNode.removeChild(i),(null==j?void 0:j.body)&&(j.body.style.overflow="")}ti(){var t,i,e,n=null===(t=this.Ut)||void 0===t?void 0:t.querySelector(".vtilt-vtd-close");null==n||n.addEventListener("click",()=>this.close());var r=null===(i=this.Ut)||void 0===i?void 0:i.querySelector(".vtilt-vtd-open");null==r||r.addEventListener("click",()=>{this.Lt&&(null==U||U.open(this.Lt,"_blank"))}),null===(e=this.Ut)||void 0===e||e.addEventListener("click",t=>{t.target===this.Ut&&this.close()});var s=t=>{"Escape"===t.key&&(this.close(),null==j||j.removeEventListener("keydown",s))};null==j||j.addEventListener("keydown",s)}Wt(){return'\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 2147483647;\n background: rgba(0, 0, 0, 0.85);\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n '}Ht(){return"\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n background: #0a0a0a;\n overflow: hidden;\n "}Jt(){return"\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 16px;\n height: 56px;\n background: linear-gradient(180deg, rgba(20, 20, 20, 1) 0%, rgba(15, 15, 15, 1) 100%);\n border-bottom: 1px solid rgba(255, 255, 255, 0.08);\n flex-shrink: 0;\n gap: 16px;\n "}Xt(){var t=this.Lt||this.Pt,i=t?this.qt(t):"";return'\n <div style="display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0;">\n <img \n src="'+(t?this.Vt(t):"")+'" \n alt="" \n style="width: 20px; height: 20px; border-radius: 4px; flex-shrink: 0;"\n onerror="this.style.display=\'none\'"\n />\n <div style="\n display: flex;\n flex-direction: column;\n min-width: 0;\n gap: 2px;\n ">\n <div style="\n color: rgba(255, 255, 255, 0.95);\n font-size: 14px;\n font-weight: 500;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n line-height: 1.2;\n ">'+this.ii(i)+'</div>\n <div style="\n color: rgba(255, 255, 255, 0.45);\n font-size: 12px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n line-height: 1.2;\n ">'+this.ii(this.ei(t||"",50))+'</div>\n </div>\n </div>\n <div style="display: flex; align-items: center; gap: 8px; flex-shrink: 0;">\n <button class="vtilt-vtd-open vtilt-vtd-btn" title="Open in new tab">\n <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path>\n <polyline points="15 3 21 3 21 9"></polyline>\n <line x1="10" y1="14" x2="21" y2="3"></line>\n </svg>\n <span class="vtilt-vtd-btn-text">Open</span>\n </button>\n <button class="vtilt-vtd-close vtilt-vtd-btn vtilt-vtd-btn-primary" title="Close (Esc)">\n <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <line x1="18" y1="6" x2="6" y2="18"></line>\n <line x1="6" y1="6" x2="18" y2="18"></line>\n </svg>\n <span class="vtilt-vtd-btn-text">Close</span>\n </button>\n </div>\n '}Kt(){return"\n flex: 1;\n position: relative;\n background: #000;\n overflow: hidden;\n "}Gt(){return"\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n background: #0a0a0a;\n z-index: 1;\n transition: opacity 0.3s ease;\n "}Zt(){var t=this.Lt||this.Pt,i=t?this.qt(t):"";return'\n <div class="vtilt-vtd-spinner"></div>\n <div style="\n margin-top: 20px;\n color: rgba(255, 255, 255, 0.7);\n font-size: 14px;\n font-weight: 500;\n ">Loading '+this.ii(i)+'...</div>\n <div style="\n margin-top: 8px;\n color: rgba(255, 255, 255, 0.35);\n font-size: 12px;\n ">Press <kbd style="\n display: inline-block;\n padding: 2px 6px;\n background: rgba(255, 255, 255, 0.1);\n border-radius: 4px;\n font-family: inherit;\n font-size: 11px;\n ">Esc</kbd> to close</div>\n '}Qt(){return"\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border: none;\n background: white;\n opacity: 0;\n transition: opacity 0.3s ease;\n "}Yt(){return"\n /* Animations */\n @keyframes vtilt-vtd-fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n \n @keyframes vtilt-vtd-fade-out {\n from { opacity: 1; }\n to { opacity: 0; }\n }\n \n @keyframes vtilt-vtd-scale-in {\n from { opacity: 0; transform: scale(0.96); }\n to { opacity: 1; transform: scale(1); }\n }\n \n @keyframes vtilt-vtd-spin {\n to { transform: rotate(360deg); }\n }\n \n /* Container animations */\n #vtilt-vtd-overlay.vtilt-vtd-opening {\n animation: vtilt-vtd-fade-in 0.2s ease-out forwards;\n }\n \n #vtilt-vtd-overlay.vtilt-vtd-opening .vtilt-vtd-modal {\n animation: vtilt-vtd-scale-in 0.25s ease-out forwards;\n }\n \n #vtilt-vtd-overlay.vtilt-vtd-closing {\n animation: vtilt-vtd-fade-out 0.2s ease-in forwards;\n }\n \n /* Loading spinner */\n .vtilt-vtd-spinner {\n width: 40px;\n height: 40px;\n border: 3px solid rgba(255, 255, 255, 0.1);\n border-top-color: rgba(255, 255, 255, 0.8);\n border-radius: 50%;\n animation: vtilt-vtd-spin 0.8s linear infinite;\n }\n \n /* Button base styles */\n .vtilt-vtd-btn {\n background: rgba(255, 255, 255, 0.08);\n border: 1px solid rgba(255, 255, 255, 0.1);\n color: rgba(255, 255, 255, 0.9);\n padding: 8px 14px;\n border-radius: 8px;\n cursor: pointer;\n font-size: 13px;\n font-weight: 500;\n display: flex;\n align-items: center;\n gap: 6px;\n transition: all 0.15s ease;\n -webkit-tap-highlight-color: transparent;\n outline: none;\n }\n \n .vtilt-vtd-btn:hover {\n background: rgba(255, 255, 255, 0.14);\n border-color: rgba(255, 255, 255, 0.18);\n }\n \n .vtilt-vtd-btn:active {\n background: rgba(255, 255, 255, 0.18);\n transform: scale(0.98);\n }\n \n .vtilt-vtd-btn:focus-visible {\n box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);\n }\n \n /* Primary button variant */\n .vtilt-vtd-btn-primary {\n background: rgba(255, 255, 255, 0.95);\n border-color: transparent;\n color: #0a0a0a;\n }\n \n .vtilt-vtd-btn-primary:hover {\n background: rgba(255, 255, 255, 1);\n border-color: transparent;\n }\n \n .vtilt-vtd-btn-primary:active {\n background: rgba(255, 255, 255, 0.85);\n }\n \n /* Desktop responsive - modal with margin */\n @media (min-width: 768px) {\n #vtilt-vtd-overlay {\n padding: 32px;\n }\n \n .vtilt-vtd-modal {\n max-width: 1200px;\n max-height: 90vh;\n width: 100%;\n height: auto;\n min-height: 500px;\n border-radius: 16px;\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);\n }\n \n .vtilt-vtd-header {\n border-radius: 16px 16px 0 0;\n }\n \n .vtilt-vtd-iframe-wrapper {\n border-radius: 0 0 16px 16px;\n min-height: 400px;\n }\n }\n \n /* Large desktop - bigger modal */\n @media (min-width: 1400px) {\n #vtilt-vtd-overlay {\n padding: 48px;\n }\n \n .vtilt-vtd-modal {\n max-width: 1400px;\n max-height: 85vh;\n }\n }\n \n /* Tablet */\n @media (min-width: 768px) and (max-width: 1024px) {\n #vtilt-vtd-overlay {\n padding: 24px;\n }\n \n .vtilt-vtd-modal {\n max-width: 95%;\n max-height: 90vh;\n }\n }\n \n /* Mobile - fullscreen */\n @media (max-width: 767px) {\n #vtilt-vtd-overlay {\n padding: 0 !important;\n background: #0a0a0a !important;\n }\n \n .vtilt-vtd-modal {\n width: 100% !important;\n height: 100% !important;\n max-width: none !important;\n max-height: none !important;\n border-radius: 0 !important;\n }\n \n .vtilt-vtd-header {\n border-radius: 0 !important;\n padding: 0 12px !important;\n height: 52px !important;\n }\n \n .vtilt-vtd-btn {\n padding: 8px 10px !important;\n }\n \n .vtilt-vtd-btn-text {\n display: none !important;\n }\n \n .vtilt-vtd-iframe-wrapper {\n border-radius: 0 !important;\n }\n }\n \n /* Reduced motion */\n @media (prefers-reduced-motion: reduce) {\n #vtilt-vtd-overlay,\n #vtilt-vtd-overlay *,\n .vtilt-vtd-spinner {\n animation-duration: 0.01ms !important;\n transition-duration: 0.01ms !important;\n }\n }\n "}ei(t,i){return t.length<=i?t:t.substring(0,i-3)+"..."}ii(t){if(void 0===j)return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");var i=j.createElement("div");return i.textContent=t,i.innerHTML}}var Ke,Ge="text/plain";!function(t){t.GZipJS="gzip-js",t.None="none"}(Ke||(Ke={}));var Ze=t=>{var{data:i,compression:e}=t;if(i){var n=(t=>JSON.stringify(t,(t,i)=>"bigint"==typeof i?i.toString():i))(i),r=new Blob([n]).size;if(e===Ke.GZipJS&&r>=1024)try{var s=Fe(function(t,i){if(qe)return qe.encode(t);for(var e=t.length,n=new le(t.length+(t.length>>1)),r=0,s=function(t){n[r++]=t},o=0;o<e;++o){if(r+5>n.length){var a=new le(r+8+(e-o<<1));a.set(n),n=a}var l=t.charCodeAt(o);l<128||i?s(l):l<2048?(s(192|l>>6),s(128|63&l)):l>55295&&l<57344?(s(240|(l=65536+(1047552&l)|1023&t.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 Ie(n,0,r)}(n),{mtime:0}),o=new Blob([s],{type:Ge});if(o.size<.95*r)return{contentType:Ge,body:o,estimatedSize:o.size}}catch(t){}return{contentType:"application/json",body:n,estimatedSize:r}}},Qe=[{name:"fetch",available:"undefined"!=typeof fetch,method:t=>{var n=Ze(t);if(n){var{contentType:r,body:s,estimatedSize:o}=n,a=t.compression===Ke.GZipJS&&r===Ge?t.url+(t.url.includes("?")?"&":"?")+"compression=gzip-js":t.url,l=e({"Content-Type":r},t.headers||{}),h=new AbortController,u=t.timeout?setTimeout(()=>h.abort(),t.timeout):null;fetch(a,{method:t.method||"POST",headers:l,body:s,keepalive:o<52428.8,signal:h.signal}).then(function(){var e=i(function*(i){var e,n=yield i.text(),r={statusCode:i.status,text:n};if(200===i.status)try{r.json=JSON.parse(n)}catch(t){}null===(e=t.callback)||void 0===e||e.call(t,r)});return function(t){return e.apply(this,arguments)}}()).catch(()=>{var i;null===(i=t.callback)||void 0===i||i.call(t,{statusCode:0})}).finally(()=>{u&&clearTimeout(u)})}}},{name:"XHR",available:"undefined"!=typeof XMLHttpRequest,method:t=>{var i=Ze(t);if(i){var{contentType:e,body:n}=i,r=t.compression===Ke.GZipJS&&e===Ge?t.url+(t.url.includes("?")?"&":"?")+"compression=gzip-js":t.url,s=new XMLHttpRequest;s.open(t.method||"POST",r,!0),t.headers&&Object.entries(t.headers).forEach(t=>{var[i,e]=t;s.setRequestHeader(i,e)}),s.setRequestHeader("Content-Type",e),t.timeout&&(s.timeout=t.timeout),s.onreadystatechange=()=>{var i;if(4===s.readyState){var e={statusCode:s.status,text:s.responseText};if(200===s.status)try{e.json=JSON.parse(s.responseText)}catch(t){}null===(i=t.callback)||void 0===i||i.call(t,e)}},s.onerror=()=>{var i;null===(i=t.callback)||void 0===i||i.call(t,{statusCode:0})},s.send(n)}}},{name:"sendBeacon",available:"undefined"!=typeof navigator&&!!navigator.sendBeacon,method:t=>{var i=Ze(t);if(i){var{contentType:e,body:n}=i;try{var r="string"==typeof n?new Blob([n],{type:e}):n,s=t.compression===Ke.GZipJS&&e===Ge?t.url+(t.url.includes("?")?"&":"?")+"compression=gzip-js":t.url;navigator.sendBeacon(s,r)}catch(t){}}}}],Ye=t=>{var i,e=t.transport||"fetch",n=Qe.find(t=>t.name===e&&t.available)||Qe.find(t=>t.available);if(!n)return console.error("vTilt: No available transport method"),void(null===(i=t.callback)||void 0===i||i.call(t,{statusCode:0}));n.method(t)};class tn{constructor(t,i){var e,n,r,s;this.ni=!0,this.ri=[],this.si=(e=(null==i?void 0:i.flush_interval_ms)||3e3,n=250,r=5e3,s=3e3,"number"!=typeof e||isNaN(e)?s:Math.min(Math.max(e,n),r)),this.oi=t}get length(){return this.ri.length}enqueue(t){this.ri.push(t),this.ai||this.li()}unload(){if(this.hi(),0!==this.ri.length){var t=this.ui();for(var i in t){var n=t[i];this.oi(e({},n,{transport:"sendBeacon"}))}}}enable(){this.ni=!1,this.li()}pause(){this.ni=!0,this.hi()}flush(){this.hi(),this.di(),this.li()}li(){this.ni||(this.ai=setTimeout(()=>{this.hi(),this.di(),this.ri.length>0&&this.li()},this.si))}hi(){this.ai&&(clearTimeout(this.ai),this.ai=void 0)}di(){if(0!==this.ri.length){var t=this.ui(),i=Date.now();for(var e in t){var n=t[e];n.events.forEach(t=>{var e=new Date(t.timestamp).getTime();t.$offset=Math.abs(e-i)}),this.oi(n)}}}ui(){var t={};return this.ri.forEach(i=>{var e=i.batchKey||i.url;t[e]||(t[e]={url:i.url,events:[],batchKey:i.batchKey}),t[e].events.push(i.event)}),this.ri=[],t}}class en{constructor(t){this.ci=!1,this.fi=3e3,this.ri=[],this.pi=!0,this.oi=t.sendRequest,this.gi=t.sendBeacon,U&&void 0!==z&&"onLine"in z&&(this.pi=z.onLine,O(U,"online",()=>{this.pi=!0,this.N()}),O(U,"offline",()=>{this.pi=!1}))}get length(){return this.ri.length}enqueue(t,i){if(void 0===i&&(i=0),i>=10)console.warn("VTilt: Request failed after 10 retries, giving up");else{var e=function(t){var i=3e3*Math.pow(2,t),e=i/2,n=Math.min(18e5,i),r=(Math.random()-.5)*(n-e);return Math.ceil(n+r)}(i),n=Date.now()+e;this.ri.push({retryAt:n,request:t,retriesPerformedSoFar:i+1});var r="VTilt: Enqueued failed request for retry in "+Math.round(e/1e3)+"s";this.pi||(r+=" (Browser is offline)"),console.warn(r),this.ci||(this.ci=!0,this.mi())}}retriableRequest(t){var e=this;return i(function*(){try{var i=yield e.oi(t);200!==i.statusCode&&(i.statusCode<400||i.statusCode>=500)&&e.enqueue(t,0)}catch(i){e.enqueue(t,0)}})()}mi(){this.bi&&clearTimeout(this.bi),this.bi=setTimeout(()=>{this.pi&&this.ri.length>0&&this.N(),this.ri.length>0?this.mi():this.ci=!1},this.fi)}N(){var t=this,e=Date.now(),n=[],r=[];this.ri.forEach(t=>{t.retryAt<e?r.push(t):n.push(t)}),this.ri=n,r.forEach(function(){var e=i(function*(i){var{request:e,retriesPerformedSoFar:n}=i;try{var r=yield t.oi(e);200!==r.statusCode&&(r.statusCode<400||r.statusCode>=500)&&t.enqueue(e,n)}catch(i){t.enqueue(e,n)}});return function(t){return e.apply(this,arguments)}}())}unload(){this.bi&&(clearTimeout(this.bi),this.bi=void 0),this.ri.forEach(t=>{var{request:i}=t;try{this.gi(i)}catch(t){console.error("VTilt: Failed to send beacon on unload",t)}}),this.ri=[]}}var nn="vt_rate_limit";class rn{constructor(t){var i,e;void 0===t&&(t={}),this.lastEventRateLimited=!1,this.eventsPerSecond=null!==(i=t.eventsPerSecond)&&void 0!==i?i:10,this.eventsBurstLimit=Math.max(null!==(e=t.eventsBurstLimit)&&void 0!==e?e:10*this.eventsPerSecond,this.eventsPerSecond),this.persistence=t.persistence,this.captureWarning=t.captureWarning,this.lastEventRateLimited=this.checkRateLimit(!0).isRateLimited}checkRateLimit(t){var i,e,n,r;void 0===t&&(t=!1);var s=Date.now(),o=null!==(e=null===(i=this.persistence)||void 0===i?void 0:i.get(nn))&&void 0!==e?e:{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||t||(o.tokens=Math.max(0,o.tokens-1)),!l||this.lastEventRateLimited||t||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(nn,o),{isRateLimited:l,remainingTokens:o.tokens}}shouldAllowEvent(){return!this.checkRateLimit(!1).isRateLimited}getRemainingTokens(){return this.checkRateLimit(!0).remainingTokens}}class sn{constructor(t){this.yi=null,this.wi=t}get config(){return this.yi}onApply(t){this.xi=t}onLoad(t){this.Si=t}load(){var t,i=this.wi.getConfig();if(i.projectId){if(null===(t=i.bootstrap)||void 0===t?void 0:t.remoteConfig)return this.yi=i.bootstrap.remoteConfig,this.ki(this.yi),void this.Ci();var e=y(()=>U.__VTILT_BOOTSTRAP__);if(null==e?void 0:e.remoteConfig)return this.yi=e.remoteConfig,this.ki(this.yi),void this.Ci();y(()=>{var t=localStorage.getItem(u+"_"+i.projectId);t&&(this.yi=JSON.parse(t),this.ki(this.yi))}),this.Ci()}}Ci(){var t=this.wi.getConfig();if(t.projectId&&t.api_host){var i=t.api_host+"/api/projects/"+t.projectId+"/decide",e=new AbortController,n=setTimeout(()=>e.abort(),3e3);(N||fetch)(i,{method:"GET",signal:e.signal,headers:{Accept:"application/json"}}).then(t=>t.json()).then(i=>{var e;clearTimeout(n),this.yi=i,y(()=>{localStorage.setItem(u+"_"+t.projectId,JSON.stringify(i))}),this.ki(i),null===(e=this.Si)||void 0===e||e.call(this,i)}).catch(()=>{clearTimeout(n)})}}ki(t){var i,e,n,r,s,o,a,l,h,u=this.wi.getConfig(),d={},v=!1,c=!1,f=!1;t.sessionRecording&&void 0===u.session_recording&&(d.session_recording={enabled:t.sessionRecording.enabled,sampleRate:t.sessionRecording.sampleRate,minimumDurationMs:t.sessionRecording.minimumDurationMs,fullSnapshotIntervalMs:t.sessionRecording.fullSnapshotIntervalMs,maskAllInputs:t.sessionRecording.maskAllInputs,captureConsole:t.sessionRecording.captureConsole,captureCanvas:t.sessionRecording.captureCanvas},t.sessionRecording.enabled&&(v=!0)),(null===(i=t.chat)||void 0===i?void 0:i.enabled)&&void 0===u.chat&&(d.chat={enabled:t.chat.enabled,position:t.chat.widgetPosition,color:t.chat.widgetColor},c=!0),t.analytics&&(void 0!==t.analytics.capturePageview&&void 0===u.capture_pageview&&(d.capture_pageview=t.analytics.capturePageview),void 0!==t.analytics.capturePageleave&&void 0===u.capture_pageleave&&(d.capture_pageleave=!!t.analytics.capturePageleave),void 0!==t.analytics.capturePerformance&&void 0===u.capture_performance&&(d.capture_performance=t.analytics.capturePerformance),void 0!==t.analytics.autocapture&&void 0===u.autocapture&&(d.autocapture=t.analytics.autocapture,t.analytics.autocapture&&(f=!0))),void 0!==(null===(e=t.privacy)||void 0===e?void 0:e.respectDnt)&&void 0===u.respect_dnt&&(d.respect_dnt=t.privacy.respectDnt),Object.keys(d).length>0&&this.wi.updateConfig(d),null===(n=this.xi)||void 0===n||n.call(this,t),this.wi.__loaded&&(v&&(null===(s=(r=this.wi).startSessionRecording)||void 0===s||s.call(r)),c&&(null===(a=(o=this.wi).Ei)||void 0===a||a.call(o)),f&&(null===(h=(l=this.wi).startAutocapture)||void 0===h||h.call(l)))}}class on{constructor(t){this.Ti=!1,this.Ii=!1,this.$i=null,this.Mi=null,this.wi=t}setVtPersonUuid(t){this.Mi=t}capture(t,i,n){var r;if(this.wi.sessionManager.setSessionId(),(null==z?void 0:z.userAgent)&&function(t){return!(t&&"string"==typeof t&&t.length>500)}(z.userAgent)&&((null==n?void 0:n.skip_client_rate_limiting)||this.wi.rateLimiter.shouldAllowEvent())){var s,o=this.wi.buildUrl(),a=this.wi.getConfig(),l=this.Ri(t,i);if(!1!==a.stringifyPayload){if(!R(s=JSON.stringify(e({},l,a.globalAttributes))))return}else if(s=e({},l,a.globalAttributes),!R(JSON.stringify(s)))return;var h="$identify"===t?this.wi.userManager.getAnonymousId():null!==(r=this.wi.userManager.getDistinctId())&&void 0!==r?r:this.wi.userManager.getAnonymousId(),u={timestamp:(new Date).toISOString(),event:t,project_id:a.projectId||"",payload:s,distinct_id:h,anonymous_id:this.wi.userManager.getAnonymousId()};this.wi.sendRequest(o,u,!0)}}captureInternal(t,i){this.capture(t,i,{skip_client_rate_limiting:!0})}trackEvent(t,i){void 0===i&&(i={}),this.capture(t,i)}captureInitialPageview(){j&&("visible"===j.visibilityState?this.Ii||(this.Ii=!0,setTimeout(()=>{j&&B&&this.capture("$pageview",{navigation_type:"initial_load"})},300),this.$i&&(j.removeEventListener("visibilitychange",this.$i),this.$i=null)):this.$i||(this.$i=()=>this.captureInitialPageview(),O(j,"visibilitychange",this.$i)))}Ri(t,i){var n=hi(),r=this.wi.userManager.getUserProperties(),s=this.wi.userManager.get_initial_props(),o=this.wi.sessionManager.getSessionId(),a=this.wi.sessionManager.getWindowId(),l=this.wi.userManager.getAnonymousId(),h={};!this.Ti&&Object.keys(s).length>0&&Object.assign(h,s),i.$set_once&&Object.assign(h,i.$set_once);var u=e({},n,r,{$session_id:o,$window_id:a},l?{$anon_distinct_id:l}:{},this.Mi?{$vt:this.Mi}:{},Object.keys(h).length>0?{$set_once:h}:{},i.$set?{$set:i.$set}:{},i);return!this.Ti&&Object.keys(s).length>0&&(this.Ti=!0),"$pageview"===t&&j&&(u.title=j.title),u}}class an{constructor(t){this.wi=t}identify(t,i,e){var n;if("number"==typeof t&&(t=String(t),console.warn("identify: first argument should be a string, not a number")),t)if(this.wi.userManager.isDistinctIdStringLikePublic(t))console.error('identify: "'+t+'" appears to be a hardcoded string');else if("COOKIELESS_SENTINEL_VALUE"!==t){var r=this.wi.userManager.getDistinctId(),s=this.wi.userManager.getAnonymousId(),o=this.wi.userManager.getDeviceId(),a="anonymous"===this.wi.userManager.getUserState();o||this.wi.userManager.ensureDeviceId(r||s),t!==r&&a?(this.wi.userManager.setUserState("identified"),this.wi.userManager.updateUserProperties(i,e),this.wi.capture("$identify",{distinct_id:t,$anon_distinct_id:s,$set:i||{},$set_once:e||{}}),this.wi.userManager.setDistinctId(t),null===(n=this.wi.Ai)||void 0===n||n.emit("user:identified",{distinctId:t})):i||e?(a&&this.wi.userManager.setUserState("identified"),this.wi.userManager.updateUserProperties(i,e),this.wi.capture("$set",{$set:i||{},$set_once:e||{}})):t!==r&&(this.wi.userManager.setUserState("identified"),this.wi.userManager.setDistinctId(t))}else console.error("identify: cannot use sentinel value as distinct_id");else console.error("identify: unique user id is required")}setUserProperties(t,i){var e;this.wi.userManager.setUserProperties(t,i)&&(this.wi.capture("$set",{$set:t||{},$set_once:i||{}}),null===(e=this.wi.Ai)||void 0===e||e.emit("user:properties_set",{properties:t}))}resetUser(t){var i;this.wi.sessionManager.resetSessionId(),this.wi.userManager.reset(t),null===(i=this.wi.Ai)||void 0===i||i.emit("user:reset")}createAlias(t,i){var e=this.wi.userManager.createAlias(t,i);e?this.wi.capture("$alias",{$original_id:e.original,$alias_id:e.distinct_id}):t===(i||this.wi.userManager.getDistinctId()||this.wi.userManager.getAnonymousId())&&this.identify(t)}getUserIdentity(){return this.wi.userManager.getUserIdentity()}getDeviceId(){return this.wi.userManager.getDeviceId()}getUserState(){return this.wi.userManager.getUserState()}getDistinctId(){var t;return null!==(t=this.wi.userManager.getDistinctId())&&void 0!==t?t:this.wi.userManager.getAnonymousId()}getAnonymousId(){return this.wi.userManager.getAnonymousId()}}class ln{constructor(t){this.Oi=new Map,this.wi=t}onFeatureStarted(t){this.Pi=t}onFeatureStopped(t){this.Li=t}register(t){this.Oi.set(t.name,t)}get(t){var i;return null===(i=this.Oi.get(t))||void 0===i?void 0:i.instance}initAll(){this.Oi.forEach(t=>{this.Ui(t)})}init(t){var i=this.Oi.get(t);if(i)return this.Ui(i),i.instance}start(t){var i,e=this.Oi.get(t);if(e&&(e.instance||this.Ui(e),e.instance)){if(e.instance.onConfigUpdate){var n=this.wi.getConfig();e.instance.onConfigUpdate(n)}e.instance.startIfEnabled(),null===(i=this.Pi)||void 0===i||i.call(this,t)}}stop(t){var i,e=this.Oi.get(t);(null==e?void 0:e.instance)&&(e.instance.stop(),null===(i=this.Li)||void 0===i||i.call(this,t))}isActive(t){var i,e,n;return null!==(n=null===(e=null===(i=this.Oi.get(t))||void 0===i?void 0:i.instance)||void 0===e?void 0:e.isStarted)&&void 0!==n&&n}notifyConfigUpdate(t){this.Oi.forEach(i=>{var e;(null===(e=i.instance)||void 0===e?void 0:e.onConfigUpdate)&&y(()=>i.instance.onConfigUpdate(t))})}notifyRemoteConfig(t){this.Oi.forEach(i=>{var e;(null===(e=i.instance)||void 0===e?void 0:e.onRemoteConfig)&&y(()=>i.instance.onRemoteConfig(t))})}getAll(){var t=[];return this.Oi.forEach(i=>{i.instance&&t.push(i.instance)}),t}Ui(t){if(!t.instance){var i=this.wi.getConfig();t.disableKey&&i[t.disableKey]||t.enableKey&&!1===i[t.enableKey]||y(()=>{var i;t.instance=new t.FeatureClass(this.wi),t.instance.startIfEnabled(),t.instance.isStarted&&(null===(i=this.Pi)||void 0===i||i.call(this,t.name))})}}}var hn="vt",un=Array.isArray;class dn{constructor(t){void 0===t&&(t={}),this.version=n,this.__loaded=!1,this.__request_queue=[],this.Di=!1,this.Ai=new w,this.configManager=new b(t);var i=this.configManager.getConfig();this.sessionManager=new G(i.storage||"cookie",i.cross_subdomain_cookie),this.userManager=new ui(i.persistence||"localStorage+cookie",i.cross_subdomain_cookie),this.rateLimiter=new rn({eventsPerSecond:10,eventsBurstLimit:100,captureWarning:t=>{this.zi.captureInternal("$$client_ingestion_warning",{$$client_ingestion_warning_message:t})}}),this.retryQueue=new en({sendRequest:t=>this.ji(t),sendBeacon:t=>this.Bi(t)}),this.requestQueue=new tn(t=>this.Ni(t),{flush_interval_ms:3e3}),this.zi=new on(this),this.Fi=new an(this),this.qi=new sn(this),this.Vi=new ln(this),this.qi.onApply(t=>{this.Vi.notifyRemoteConfig(t)}),this.qi.onLoad(t=>{this.Ai.emit(S,{config:t})}),this.Vi.onFeatureStarted(t=>{this.Ai.emit(k,{feature:t})}),this.Vi.onFeatureStopped(t=>{this.Ai.emit(C,{feature:t})})}init(t,i,e){var n;if(e&&e!==hn){var r=null!==(n=vn[e])&&void 0!==n?n:new dn;return r._init(t,i,e),vn[e]=r,vn[hn][e]=r,r}return this._init(t,i,e)}_init(t,i,n){if(void 0===i&&(i={}),this.__loaded)return console.warn("vTilt: Already initialized! Re-initializing is a no-op"),this;this.updateConfig(e({},i,{projectId:t||i.projectId,name:n})),this.__loaded=!0,this.Wi(),this.qi.load();var r=this.configManager.getConfig();return this.userManager.set_initial_person_info(r.mask_personal_data_properties,r.custom_personal_data_properties),this.Hi(),this.Ji(),this.Xi(),!1!==r.capture_pageview&&this.zi.captureInitialPageview(),this.Ai.emit(_,{config:r}),this}Hi(){this.Ki(),this.Gi(),this.Zi(),this.Qi(),this.Ei()}Ki(){this.historyAutocapture||(this.historyAutocapture=new gi(this),this.historyAutocapture.startIfEnabled())}Gi(){this.autocapture||!1!==this.configManager.getConfig().autocapture&&(this.autocapture=new re(this),this.autocapture.startIfEnabled())}Zi(){this.webVitals||(this.webVitals=new fi(this),this.webVitals.startIfEnabled())}Qi(){this.sessionRecording||(this.configManager.getConfig().disable_session_recording||(this.sessionRecording=new oe(this),this.sessionRecording.isEnabled&&(this.sessionRecording.startIfEnabledOrStop("recording_initialized"),this.Ai.emit(T))))}Ei(){this.chat||(this.configManager.getConfig().disable_chat||(this.chat=new He(this),this.chat.startIfEnabled()))}startAutocapture(){this.autocapture||(this.autocapture=new re(this)),this.autocapture.updateConfig({enabled:!0}),this.autocapture.startIfEnabled()}stopAutocapture(){var t;null===(t=this.autocapture)||void 0===t||t.stop()}isAutocaptureActive(){var t,i;return null!==(i=null===(t=this.autocapture)||void 0===t?void 0:t.isStarted)&&void 0!==i&&i}startSessionRecording(){this.sessionRecording||(this.sessionRecording=new oe(this)),this.sessionRecording.updateConfig({enabled:!0}),this.sessionRecording.startIfEnabledOrStop("recording_initialized"),this.Ai.emit(T)}stopSessionRecording(){var t;null===(t=this.sessionRecording)||void 0===t||t.stop(),this.Ai.emit(I)}isRecordingActive(){var t;return"active"===(null===(t=this.sessionRecording)||void 0===t?void 0:t.status)}getSessionRecordingId(){var t;return(null===(t=this.sessionRecording)||void 0===t?void 0:t.sessionId)||null}capture(t,i,e){this.zi.capture(t,i,e),this.Ai.emit(E,{event:t,payload:i})}trackEvent(t,i){void 0===i&&(i={}),this.zi.trackEvent(t,i)}identify(t,i,e){this.Fi.identify(t,i,e)}setUserProperties(t,i){this.Fi.setUserProperties(t,i)}resetUser(t){this.Fi.resetUser(t)}createAlias(t,i){this.Fi.createAlias(t,i)}getUserIdentity(){return this.Fi.getUserIdentity()}getDeviceId(){return this.Fi.getDeviceId()}getUserState(){return this.Fi.getUserState()}getConfig(){return this.configManager.getConfig()}getSessionId(){return this.sessionManager.getSessionId()}getDistinctId(){return this.Fi.getDistinctId()}getAnonymousId(){return this.Fi.getAnonymousId()}toString(){var t,i=null!==(t=this.configManager.getConfig().name)&&void 0!==t?t:hn;return i!==hn&&(i="vt."+i),i}updateConfig(t){this.configManager.updateConfig(t);var i=this.configManager.getConfig();this.sessionManager=new G(i.storage||"cookie",i.cross_subdomain_cookie),this.userManager=new ui(i.persistence||"localStorage+cookie",i.cross_subdomain_cookie),this.Yi(i),this.Ai.emit(x,{config:i})}Yi(t){[this.historyAutocapture,this.autocapture,this.webVitals,this.sessionRecording,this.chat,this.vtdOverlay].forEach(i=>{(null==i?void 0:i.onConfigUpdate)&&y(()=>i.onConfigUpdate(t))})}buildUrl(){var t=this.configManager.getConfig(),{proxyUrl:i,proxy:e,api_host:n,token:r}=t;return i||(e?e+"/api/tracking?token="+r:n?n.replace(/\/+$/gm,"")+"/api/tracking?token="+r:"/api/tracking?token="+r)}sendRequest(t,i,e){if(this.te()){if(e&&void 0!==U)if(U.__VTILT_ENQUEUE_REQUESTS)return void this.__request_queue.push({url:t,event:i});this.requestQueue.enqueue({url:t,event:i})}}te(){var t=this.configManager.getConfig();return!(!t.projectId||!t.token)||(this.Di||(console.warn("VTilt: projectId and token are required for tracking"),this.Di=!0),!1)}Ni(t){"sendBeacon"!==t.transport?this.retryQueue.retriableRequest(t):this.Bi(t)}ji(t){return new Promise(i=>{var{url:e,events:n}=t,r=1===n.length?n[0]:{events:n},s=this.configManager.getConfig().disable_compression?Ke.None:Ke.GZipJS;Ye({url:e,data:r,method:"POST",transport:"XHR",compression:s,callback:t=>i({statusCode:t.statusCode})})})}Bi(t){var{url:i,events:e}=t,n=1===e.length?e[0]:{events:e},r=this.configManager.getConfig().disable_compression?Ke.None:Ke.GZipJS;Ye({url:i,data:n,method:"POST",transport:"sendBeacon",compression:r})}ie(t){this.sendRequest(t.url,t.event,!1)}Ji(){if(U){var t=()=>{this.requestQueue.unload(),this.retryQueue.unload()};O(U,"beforeunload",t),O(U,"pagehide",t)}}Xi(){this.requestQueue.enable()}Wi(){y(()=>{var t,i;if(void 0!==B&&B.search){var e=new URL(B.href),n=e.searchParams.get("vt"),r=e.searchParams.get("vtd");if((null==n?void 0:n.trim())&&(this.zi.setVtPersonUuid(n.trim()),e.searchParams.delete("vt")),(null==r?void 0:r.trim())&&(this.ee(r.trim()),e.searchParams.delete("vtd")),(null==n?void 0:n.trim())||(null==r?void 0:r.trim())){var s=e.pathname+(e.search||"")+e.hash;null===(i=null===(t=null==U?void 0:U.history)||void 0===t?void 0:t.replaceState)||void 0===i||i.call(t,{},"",s)}}})}ee(t){this.vtdOverlay||(this.vtdOverlay=new Xe(this),this.vtdOverlay.setDestinationUrl(t))}_execute_array(t){Array.isArray(t)&&t.forEach(t=>{if(t&&Array.isArray(t)&&t.length>0){var i=t[0],e=t.slice(1);"function"==typeof this[i]&&y(()=>this[i](...e))}})}_dom_loaded(){this.__request_queue.forEach(t=>this.ie(t)),this.__request_queue=[],this.Xi()}}var vn={},cn=!(void 0!==F||void 0!==N)&&-1===(null==q?void 0:q.indexOf("MSIE"))&&-1===(null==q?void 0:q.indexOf("Mozilla"));null!=U&&(U.__VTILT_ENQUEUE_REQUESTS=cn);var fn,pn,gn=function(){function t(){t.done||(t.done=!0,cn=!1,null!=U&&(U.__VTILT_ENQUEUE_REQUESTS=!1),A(vn,t=>t._dom_loaded()))}j&&"function"==typeof j.addEventListener?"complete"===j.readyState?t():O(j,"DOMContentLoaded",t,{capture:!1}):U&&console.error("Browser doesn't support document.addEventListener")};"undefined"!=typeof window&&window.vt&&Array.isArray(window.vt)&&(fn=vn[hn]=new dn,(pn=V.vt)&&A(pn._i,function(t){if(t&&un(t)){var i=fn.init(t[0],t[1],t[2]),e=pn[t[2]||"vt"]||pn;i&&i._execute_array(e)}}),V.vt=fn,gn());var mn=function(){var t=vn[hn]=new dn;return gn(),t}();exports.ALL_WEB_VITALS_METRICS=["LCP","CLS","FCP","INP","TTFB"],exports.DEFAULT_WEB_VITALS_METRICS=di,exports.VTilt=dn,exports.default=mn,exports.vt=mn;
|
|
2
2
|
//# sourceMappingURL=main.js.map
|