@v-tilt/browser 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/all-external-dependencies.js.map +1 -1
  2. package/dist/array.full.js +1 -1
  3. package/dist/array.full.js.map +1 -1
  4. package/dist/array.js +1 -1
  5. package/dist/array.js.map +1 -1
  6. package/dist/array.no-external.js +1 -1
  7. package/dist/array.no-external.js.map +1 -1
  8. package/dist/chat.js +2 -0
  9. package/dist/chat.js.map +1 -0
  10. package/dist/entrypoints/chat.d.ts +22 -0
  11. package/dist/extensions/chat/chat-wrapper.d.ts +172 -0
  12. package/dist/extensions/chat/chat.d.ts +87 -0
  13. package/dist/extensions/chat/index.d.ts +10 -0
  14. package/dist/extensions/chat/types.d.ts +156 -0
  15. package/dist/external-scripts-loader.js.map +1 -1
  16. package/dist/main.js +1 -1
  17. package/dist/main.js.map +1 -1
  18. package/dist/module.d.ts +279 -2
  19. package/dist/module.js +1 -1
  20. package/dist/module.js.map +1 -1
  21. package/dist/module.no-external.d.ts +279 -2
  22. package/dist/module.no-external.js +1 -1
  23. package/dist/module.no-external.js.map +1 -1
  24. package/dist/recorder.js.map +1 -1
  25. package/dist/types.d.ts +27 -0
  26. package/dist/utils/globals.d.ts +111 -1
  27. package/dist/vtilt.d.ts +11 -1
  28. package/dist/web-vitals.js.map +1 -1
  29. package/lib/entrypoints/chat.d.ts +22 -0
  30. package/lib/entrypoints/chat.js +32 -0
  31. package/lib/extensions/chat/chat-wrapper.d.ts +172 -0
  32. package/lib/extensions/chat/chat-wrapper.js +497 -0
  33. package/lib/extensions/chat/chat.d.ts +87 -0
  34. package/lib/extensions/chat/chat.js +998 -0
  35. package/lib/extensions/chat/index.d.ts +10 -0
  36. package/lib/extensions/chat/index.js +27 -0
  37. package/lib/extensions/chat/types.d.ts +156 -0
  38. package/lib/extensions/chat/types.js +22 -0
  39. package/lib/types.d.ts +27 -0
  40. package/lib/utils/globals.d.ts +111 -1
  41. package/lib/vtilt.d.ts +11 -1
  42. package/lib/vtilt.js +42 -1
  43. package/package.json +66 -65
package/dist/types.d.ts CHANGED
@@ -78,6 +78,10 @@ export interface VTiltConfig {
78
78
  session_recording?: SessionRecordingOptions;
79
79
  /** Disable session recording (convenience flag) */
80
80
  disable_session_recording?: boolean;
81
+ /** Chat widget configuration */
82
+ chat?: ChatWidgetConfig;
83
+ /** Disable chat (convenience flag) */
84
+ disable_chat?: boolean;
81
85
  /** Global attributes added to all events */
82
86
  globalAttributes?: Record<string, string>;
83
87
  /** Bootstrap data for initialization */
@@ -289,6 +293,29 @@ export interface SessionRecordingOptions {
289
293
  /** Internal: Mutation throttler bucket size */
290
294
  __mutationThrottlerBucketSize?: number;
291
295
  }
296
+ /** Chat widget configuration */
297
+ export interface ChatWidgetConfig {
298
+ /** Enable/disable chat widget (default: auto from dashboard) */
299
+ enabled?: boolean;
300
+ /** Auto-fetch settings from dashboard (default: true) */
301
+ autoConfig?: boolean;
302
+ /** Widget position (default: 'bottom-right') */
303
+ position?: "bottom-right" | "bottom-left";
304
+ /** Widget header/greeting message */
305
+ greeting?: string;
306
+ /** Widget primary color */
307
+ color?: string;
308
+ /** Start in AI mode (default: true) */
309
+ aiMode?: boolean;
310
+ /** AI greeting message (first message from AI) */
311
+ aiGreeting?: string;
312
+ /** Preload widget script on idle vs on-demand */
313
+ preload?: boolean;
314
+ /** Offline message shown when business is unavailable */
315
+ offlineMessage?: string;
316
+ /** Collect email when offline */
317
+ collectEmailOffline?: boolean;
318
+ }
292
319
  export interface RemoteConfig {
293
320
  /** Default to identified_only mode */
294
321
  defaultIdentifiedOnly?: boolean;
@@ -2,7 +2,7 @@ declare const win: (Window & typeof globalThis) | undefined;
2
2
  /**
3
3
  * Extension kinds that can be lazy loaded
4
4
  */
5
- export type VTiltExtensionKind = "recorder" | "web-vitals";
5
+ export type VTiltExtensionKind = "recorder" | "web-vitals" | "chat";
6
6
  /**
7
7
  * Interface for lazy-loaded session recording (set by recorder.ts)
8
8
  * Matches LazyLoadedSessionRecordingInterface in session-recording-wrapper.ts
@@ -42,6 +42,114 @@ export interface WebVitalsCallbacks {
42
42
  onINP: WebVitalsCallbackFn;
43
43
  onTTFB?: WebVitalsCallbackFn;
44
44
  }
45
+ /**
46
+ * Chat message structure (matches PostgreSQL chat_messages table)
47
+ * Note: Read status is determined by cursor comparison, not per-message
48
+ */
49
+ export interface ChatMessage {
50
+ id: string;
51
+ channel_id: string;
52
+ sender_type: "user" | "agent" | "ai" | "system";
53
+ sender_id: string | null;
54
+ sender_name: string | null;
55
+ sender_avatar_url: string | null;
56
+ content: string;
57
+ content_type: "text" | "html" | "attachment";
58
+ metadata: Record<string, unknown>;
59
+ created_at: string;
60
+ }
61
+ /**
62
+ * Chat channel structure (maps 1:1 to Ably channel)
63
+ */
64
+ export interface ChatChannel {
65
+ id: string;
66
+ project_id: string;
67
+ person_id: string;
68
+ distinct_id: string;
69
+ status: "open" | "closed" | "snoozed";
70
+ ai_mode: boolean;
71
+ unread_count: number;
72
+ last_message_at: string | null;
73
+ last_message_preview: string | null;
74
+ last_message_sender: "user" | "agent" | "ai" | "system" | null;
75
+ user_last_read_at: string | null;
76
+ agent_last_read_at: string | null;
77
+ created_at: string;
78
+ }
79
+ /**
80
+ * Chat widget configuration
81
+ *
82
+ * Settings can come from two sources:
83
+ * 1. Dashboard (fetched from /api/chat/settings) - "snippet-only" mode
84
+ * 2. Code config (passed to vt.init) - overrides dashboard settings
85
+ *
86
+ * This enables Intercom-like flexibility: just add snippet OR customize with code.
87
+ */
88
+ export interface ChatConfig {
89
+ /**
90
+ * Enable/disable chat widget.
91
+ * - undefined: Use dashboard setting (auto-fetch)
92
+ * - true: Enable (override dashboard)
93
+ * - false: Disable entirely
94
+ */
95
+ enabled?: boolean;
96
+ /**
97
+ * Auto-fetch settings from dashboard (default: true)
98
+ * When true, SDK fetches /api/chat/settings and uses those as base config.
99
+ * Code config always overrides fetched settings.
100
+ */
101
+ autoConfig?: boolean;
102
+ /** Widget position (default: 'bottom-right') */
103
+ position?: "bottom-right" | "bottom-left";
104
+ /** Widget header/greeting message */
105
+ greeting?: string;
106
+ /** Widget primary color */
107
+ color?: string;
108
+ /** Start in AI mode (default: true) */
109
+ aiMode?: boolean;
110
+ /** AI greeting message (first message from AI) */
111
+ aiGreeting?: string;
112
+ /** Preload widget script on idle vs on-demand */
113
+ preload?: boolean;
114
+ /** Custom theme */
115
+ theme?: ChatTheme;
116
+ /** Offline message shown when business is unavailable */
117
+ offlineMessage?: string;
118
+ /** Collect email when offline */
119
+ collectEmailOffline?: boolean;
120
+ }
121
+ /**
122
+ * Chat theme customization
123
+ */
124
+ export interface ChatTheme {
125
+ primaryColor?: string;
126
+ fontFamily?: string;
127
+ borderRadius?: string;
128
+ headerBgColor?: string;
129
+ userBubbleColor?: string;
130
+ agentBubbleColor?: string;
131
+ }
132
+ /**
133
+ * Interface for lazy-loaded chat widget (set by chat.ts entrypoint)
134
+ */
135
+ export interface LazyLoadedChatInterface {
136
+ readonly isOpen: boolean;
137
+ readonly isConnected: boolean;
138
+ readonly isLoading: boolean;
139
+ readonly unreadCount: number;
140
+ readonly channel: ChatChannel | null;
141
+ open(): void;
142
+ close(): void;
143
+ toggle(): void;
144
+ show(): void;
145
+ hide(): void;
146
+ sendMessage(content: string): Promise<void>;
147
+ markAsRead(): void;
148
+ onMessage(callback: (message: ChatMessage) => void): () => void;
149
+ onTyping(callback: (isTyping: boolean, senderType: string) => void): () => void;
150
+ onConnectionChange(callback: (connected: boolean) => void): () => void;
151
+ destroy(): void;
152
+ }
45
153
  /**
46
154
  * VTilt Extensions interface for dynamically loaded modules
47
155
  * This is the contract between lazily loaded extensions and the SDK
@@ -64,6 +172,8 @@ export interface VTiltExtensions {
64
172
  initSessionRecording?: (instance: any, config?: any) => LazyLoadedSessionRecordingInterface;
65
173
  /** Web Vitals callbacks (set by web-vitals.ts entrypoint) */
66
174
  webVitalsCallbacks?: WebVitalsCallbacks;
175
+ /** Factory to create LazyLoadedChat (set by chat.ts entrypoint) */
176
+ initChat?: (instance: any, config?: ChatConfig) => LazyLoadedChatInterface;
67
177
  }
68
178
  export type AssignableWindow = Window & typeof globalThis & {
69
179
  /** Main VTilt instance */
package/dist/vtilt.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { VTiltConfig, EventPayload } from "./types";
2
2
  import { HistoryAutocapture } from "./extensions/history-autocapture";
3
3
  import { SessionRecordingWrapper } from "./extensions/replay";
4
+ import { ChatWrapper } from "./extensions/chat/chat-wrapper";
4
5
  import { type QueuedRequest } from "./request-queue";
5
6
  export declare class VTilt {
6
7
  readonly version = "1.1.5";
@@ -13,6 +14,7 @@ export declare class VTilt {
13
14
  private rateLimiter;
14
15
  historyAutocapture?: HistoryAutocapture;
15
16
  sessionRecording?: SessionRecordingWrapper;
17
+ chat?: ChatWrapper;
16
18
  __loaded: boolean;
17
19
  private _initial_pageview_captured;
18
20
  private _visibility_state_listener;
@@ -271,11 +273,19 @@ export declare class VTilt {
271
273
  /**
272
274
  * Check if session recording is active
273
275
  */
274
- isSessionRecordingActive(): boolean;
276
+ isRecordingActive(): boolean;
275
277
  /**
276
278
  * Get session recording ID
277
279
  */
278
280
  getSessionRecordingId(): string | null;
281
+ /**
282
+ * Initialize chat widget
283
+ */
284
+ private _initChat;
285
+ /**
286
+ * Build chat config from VTiltConfig
287
+ */
288
+ private _buildChatConfig;
279
289
  /**
280
290
  * _execute_array() deals with processing any vTilt function
281
291
  * calls that were called before the vTilt library was loaded
@@ -1 +1 @@
1
- {"version":3,"file":"web-vitals.js","sources":["../../../../node_modules/.pnpm/web-vitals@3.5.2/node_modules/web-vitals/dist/web-vitals.js","../src/utils/globals.ts","../src/entrypoints/web-vitals.ts"],"sourcesContent":["var e,n,t,i,r,a=-1,o=function(e){addEventListener(\"pageshow\",(function(n){n.persisted&&(a=n.timeStamp,e(n))}),!0)},c=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType(\"navigation\")[0]},u=function(){var e=c();return e&&e.activationStart||0},f=function(e,n){var t=c(),i=\"navigate\";a>=0?i=\"back-forward-cache\":t&&(document.prerendering||u()>0?i=\"prerender\":document.wasDiscarded?i=\"restore\":t.type&&(i=t.type.replace(/_/g,\"-\")));return{name:e,value:void 0===n?-1:n,rating:\"good\",delta:0,entries:[],id:\"v3-\".concat(Date.now(),\"-\").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},s=function(e,n,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((function(e){Promise.resolve().then((function(){n(e.getEntries())}))}));return i.observe(Object.assign({type:e,buffered:!0},t||{})),i}}catch(e){}},d=function(e,n,t,i){var r,a;return function(o){n.value>=0&&(o||i)&&((a=n.value-(r||0))||void 0===r)&&(r=n.value,n.delta=a,n.rating=function(e,n){return e>n[1]?\"poor\":e>n[0]?\"needs-improvement\":\"good\"}(n.value,t),e(n))}},l=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},p=function(e){var n=function(n){\"pagehide\"!==n.type&&\"hidden\"!==document.visibilityState||e(n)};addEventListener(\"visibilitychange\",n,!0),addEventListener(\"pagehide\",n,!0)},v=function(e){var n=!1;return function(t){n||(e(t),n=!0)}},m=-1,h=function(){return\"hidden\"!==document.visibilityState||document.prerendering?1/0:0},g=function(e){\"hidden\"===document.visibilityState&&m>-1&&(m=\"visibilitychange\"===e.type?e.timeStamp:0,T())},y=function(){addEventListener(\"visibilitychange\",g,!0),addEventListener(\"prerenderingchange\",g,!0)},T=function(){removeEventListener(\"visibilitychange\",g,!0),removeEventListener(\"prerenderingchange\",g,!0)},E=function(){return m<0&&(m=h(),y(),o((function(){setTimeout((function(){m=h(),y()}),0)}))),{get firstHiddenTime(){return m}}},C=function(e){document.prerendering?addEventListener(\"prerenderingchange\",(function(){return e()}),!0):e()},L=[1800,3e3],w=function(e,n){n=n||{},C((function(){var t,i=E(),r=f(\"FCP\"),a=s(\"paint\",(function(e){e.forEach((function(e){\"first-contentful-paint\"===e.name&&(a.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-u(),0),r.entries.push(e),t(!0)))}))}));a&&(t=d(e,r,L,n.reportAllChanges),o((function(i){r=f(\"FCP\"),t=d(e,r,L,n.reportAllChanges),l((function(){r.value=performance.now()-i.timeStamp,t(!0)}))})))}))},b=[.1,.25],S=function(e,n){n=n||{},w(v((function(){var t,i=f(\"CLS\",0),r=0,a=[],c=function(e){e.forEach((function(e){if(!e.hadRecentInput){var n=a[0],t=a[a.length-1];r&&e.startTime-t.startTime<1e3&&e.startTime-n.startTime<5e3?(r+=e.value,a.push(e)):(r=e.value,a=[e])}})),r>i.value&&(i.value=r,i.entries=a,t())},u=s(\"layout-shift\",c);u&&(t=d(e,i,b,n.reportAllChanges),p((function(){c(u.takeRecords()),t(!0)})),o((function(){r=0,i=f(\"CLS\",0),t=d(e,i,b,n.reportAllChanges),l((function(){return t()}))})),setTimeout(t,0))})))},A={passive:!0,capture:!0},I=new Date,P=function(i,r){e||(e=r,n=i,t=new Date,k(removeEventListener),F())},F=function(){if(n>=0&&n<t-I){var r={entryType:\"first-input\",name:e.type,target:e.target,cancelable:e.cancelable,startTime:e.timeStamp,processingStart:e.timeStamp+n};i.forEach((function(e){e(r)})),i=[]}},M=function(e){if(e.cancelable){var n=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;\"pointerdown\"==e.type?function(e,n){var t=function(){P(e,n),r()},i=function(){r()},r=function(){removeEventListener(\"pointerup\",t,A),removeEventListener(\"pointercancel\",i,A)};addEventListener(\"pointerup\",t,A),addEventListener(\"pointercancel\",i,A)}(n,e):P(n,e)}},k=function(e){[\"mousedown\",\"keydown\",\"touchstart\",\"pointerdown\"].forEach((function(n){return e(n,M,A)}))},D=[100,300],x=function(t,r){r=r||{},C((function(){var a,c=E(),u=f(\"FID\"),l=function(e){e.startTime<c.firstHiddenTime&&(u.value=e.processingStart-e.startTime,u.entries.push(e),a(!0))},m=function(e){e.forEach(l)},h=s(\"first-input\",m);a=d(t,u,D,r.reportAllChanges),h&&p(v((function(){m(h.takeRecords()),h.disconnect()}))),h&&o((function(){var o;u=f(\"FID\"),a=d(t,u,D,r.reportAllChanges),i=[],n=-1,e=null,k(addEventListener),o=l,i.push(o),F()}))}))},B=0,R=1/0,H=0,N=function(e){e.forEach((function(e){e.interactionId&&(R=Math.min(R,e.interactionId),H=Math.max(H,e.interactionId),B=H?(H-R)/7+1:0)}))},O=function(){return r?B:performance.interactionCount||0},q=function(){\"interactionCount\"in performance||r||(r=s(\"event\",N,{type:\"event\",buffered:!0,durationThreshold:0}))},j=[200,500],_=0,z=function(){return O()-_},G=[],J={},K=function(e){var n=G[G.length-1],t=J[e.interactionId];if(t||G.length<10||e.duration>n.latency){if(t)t.entries.push(e),t.latency=Math.max(t.latency,e.duration);else{var i={id:e.interactionId,latency:e.duration,entries:[e]};J[i.id]=i,G.push(i)}G.sort((function(e,n){return n.latency-e.latency})),G.splice(10).forEach((function(e){delete J[e.id]}))}},Q=function(e,n){n=n||{},C((function(){var t;q();var i,r=f(\"INP\"),a=function(e){e.forEach((function(e){(e.interactionId&&K(e),\"first-input\"===e.entryType)&&(!G.some((function(n){return n.entries.some((function(n){return e.duration===n.duration&&e.startTime===n.startTime}))}))&&K(e))}));var n,t=(n=Math.min(G.length-1,Math.floor(z()/50)),G[n]);t&&t.latency!==r.value&&(r.value=t.latency,r.entries=t.entries,i())},c=s(\"event\",a,{durationThreshold:null!==(t=n.durationThreshold)&&void 0!==t?t:40});i=d(e,r,j,n.reportAllChanges),c&&(\"PerformanceEventTiming\"in window&&\"interactionId\"in PerformanceEventTiming.prototype&&c.observe({type:\"first-input\",buffered:!0}),p((function(){a(c.takeRecords()),r.value<0&&z()>0&&(r.value=0,r.entries=[]),i(!0)})),o((function(){G=[],_=O(),r=f(\"INP\"),i=d(e,r,j,n.reportAllChanges)})))}))},U=[2500,4e3],V={},W=function(e,n){n=n||{},C((function(){var t,i=E(),r=f(\"LCP\"),a=function(e){var n=e[e.length-1];n&&n.startTime<i.firstHiddenTime&&(r.value=Math.max(n.startTime-u(),0),r.entries=[n],t())},c=s(\"largest-contentful-paint\",a);if(c){t=d(e,r,U,n.reportAllChanges);var m=v((function(){V[r.id]||(a(c.takeRecords()),c.disconnect(),V[r.id]=!0,t(!0))}));[\"keydown\",\"click\"].forEach((function(e){addEventListener(e,(function(){return setTimeout(m,0)}),!0)})),p(m),o((function(i){r=f(\"LCP\"),t=d(e,r,U,n.reportAllChanges),l((function(){r.value=performance.now()-i.timeStamp,V[r.id]=!0,t(!0)}))}))}}))},X=[800,1800],Y=function e(n){document.prerendering?C((function(){return e(n)})):\"complete\"!==document.readyState?addEventListener(\"load\",(function(){return e(n)}),!0):setTimeout(n,0)},Z=function(e,n){n=n||{};var t=f(\"TTFB\"),i=d(e,t,X,n.reportAllChanges);Y((function(){var r=c();if(r){var a=r.responseStart;if(a<=0||a>performance.now())return;t.value=Math.max(a-u(),0),t.entries=[r],i(!0),o((function(){t=f(\"TTFB\",0),(i=d(e,t,X,n.reportAllChanges))(!0)}))}}))};export{b as CLSThresholds,L as FCPThresholds,D as FIDThresholds,j as INPThresholds,U as LCPThresholds,X as TTFBThresholds,S as getCLS,w as getFCP,x as getFID,Q as getINP,W as getLCP,Z as getTTFB,S as onCLS,w as onFCP,x as onFID,Q as onINP,W as onLCP,Z as onTTFB};\n",null,null],"names":["r","a","o","e","addEventListener","n","persisted","timeStamp","c","window","performance","getEntriesByType","u","activationStart","f","t","i","document","prerendering","wasDiscarded","type","replace","name","value","rating","delta","entries","id","concat","Date","now","Math","floor","random","navigationType","s","PerformanceObserver","supportedEntryTypes","includes","Promise","resolve","then","getEntries","observe","Object","assign","buffered","d","l","requestAnimationFrame","p","visibilityState","v","m","h","g","T","y","removeEventListener","E","setTimeout","firstHiddenTime","C","L","w","forEach","disconnect","startTime","max","push","reportAllChanges","b","B","R","H","N","interactionId","min","O","interactionCount","q","durationThreshold","j","_","z","G","J","K","length","duration","latency","sort","splice","U","V","X","Y","readyState","win","undefined","global","globalThis","navigator","location","fetch","XMLHttpRequest","AbortController","userAgent","assignableWindow","vtiltWebVitalsCallbacks","takeRecords","hadRecentInput","onFCP","entryType","some","PerformanceEventTiming","prototype","onTTFB","responseStart","__VTiltExtensions__","webVitalsCallbacks"],"mappings":"yBAAA,IAAYA,EAAEC,GAAE,EAAGC,EAAE,SAASC,GAAGC,iBAAiB,WAAY,SAASC,GAAGA,EAAEC,YAAYL,EAAEI,EAAEE,UAAUJ,EAAEE,GAAG,GAAG,EAAG,EAAEG,EAAE,WAAW,OAAOC,OAAOC,aAAaA,YAAYC,kBAAkBD,YAAYC,iBAAiB,cAAc,EAAE,EAAEC,EAAE,WAAW,IAAIT,EAAEK,IAAI,OAAOL,GAAGA,EAAEU,iBAAiB,CAAC,EAAEC,EAAE,SAASX,EAAEE,GAAG,IAAIU,EAAEP,IAAIQ,EAAE,WAA8J,OAAnJf,GAAG,EAAEe,EAAE,qBAAqBD,IAAIE,SAASC,cAAcN,IAAI,EAAEI,EAAE,YAAYC,SAASE,aAAaH,EAAE,UAAUD,EAAEK,OAAOJ,EAAED,EAAEK,KAAKC,QAAQ,KAAK,OAAa,CAACC,KAAKnB,EAAEoB,WAAM,IAASlB,GAAE,EAAGA,EAAEmB,OAAO,OAAOC,MAAM,EAAEC,QAAQ,GAAGC,GAAG,MAAMC,OAAOC,KAAKC,MAAM,KAAKF,OAAOG,KAAKC,MAAM,cAAcD,KAAKE,UAAU,MAAMC,eAAelB,EAAE,EAAEmB,EAAE,SAAShC,EAAEE,EAAEU,GAAG,IAAI,GAAGqB,oBAAoBC,oBAAoBC,SAASnC,GAAG,CAAC,IAAIa,EAAE,IAAIoB,oBAAqB,SAASjC,GAAGoC,QAAQC,UAAUC,KAAM,WAAWpC,EAAEF,EAAEuC,aAAa,EAAG,GAAI,OAAO1B,EAAE2B,QAAQC,OAAOC,OAAO,CAACzB,KAAKjB,EAAE2C,UAAS,GAAI/B,GAAG,K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AAO,IAAIE,EAAE+B,EAAE5C,EAAEY,EAAEgF,EAAE1F,EAAEiE,oBAAmB,EAAG,EAAG,CAAC,EAAG,GEwB1tNsC,EAAiBW,oBACfX,EAAiBW,qBAAuB,CAAA,EAG1CX,EAAiBW,oBAAoBC,mBACnCX","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"web-vitals.js","sources":["../../../../node_modules/.pnpm/web-vitals@3.5.2/node_modules/web-vitals/dist/web-vitals.js","../src/utils/globals.ts","../src/entrypoints/web-vitals.ts"],"sourcesContent":["var e,n,t,i,r,a=-1,o=function(e){addEventListener(\"pageshow\",(function(n){n.persisted&&(a=n.timeStamp,e(n))}),!0)},c=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType(\"navigation\")[0]},u=function(){var e=c();return e&&e.activationStart||0},f=function(e,n){var t=c(),i=\"navigate\";a>=0?i=\"back-forward-cache\":t&&(document.prerendering||u()>0?i=\"prerender\":document.wasDiscarded?i=\"restore\":t.type&&(i=t.type.replace(/_/g,\"-\")));return{name:e,value:void 0===n?-1:n,rating:\"good\",delta:0,entries:[],id:\"v3-\".concat(Date.now(),\"-\").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},s=function(e,n,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((function(e){Promise.resolve().then((function(){n(e.getEntries())}))}));return i.observe(Object.assign({type:e,buffered:!0},t||{})),i}}catch(e){}},d=function(e,n,t,i){var r,a;return function(o){n.value>=0&&(o||i)&&((a=n.value-(r||0))||void 0===r)&&(r=n.value,n.delta=a,n.rating=function(e,n){return e>n[1]?\"poor\":e>n[0]?\"needs-improvement\":\"good\"}(n.value,t),e(n))}},l=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},p=function(e){var n=function(n){\"pagehide\"!==n.type&&\"hidden\"!==document.visibilityState||e(n)};addEventListener(\"visibilitychange\",n,!0),addEventListener(\"pagehide\",n,!0)},v=function(e){var n=!1;return function(t){n||(e(t),n=!0)}},m=-1,h=function(){return\"hidden\"!==document.visibilityState||document.prerendering?1/0:0},g=function(e){\"hidden\"===document.visibilityState&&m>-1&&(m=\"visibilitychange\"===e.type?e.timeStamp:0,T())},y=function(){addEventListener(\"visibilitychange\",g,!0),addEventListener(\"prerenderingchange\",g,!0)},T=function(){removeEventListener(\"visibilitychange\",g,!0),removeEventListener(\"prerenderingchange\",g,!0)},E=function(){return m<0&&(m=h(),y(),o((function(){setTimeout((function(){m=h(),y()}),0)}))),{get firstHiddenTime(){return m}}},C=function(e){document.prerendering?addEventListener(\"prerenderingchange\",(function(){return e()}),!0):e()},L=[1800,3e3],w=function(e,n){n=n||{},C((function(){var t,i=E(),r=f(\"FCP\"),a=s(\"paint\",(function(e){e.forEach((function(e){\"first-contentful-paint\"===e.name&&(a.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-u(),0),r.entries.push(e),t(!0)))}))}));a&&(t=d(e,r,L,n.reportAllChanges),o((function(i){r=f(\"FCP\"),t=d(e,r,L,n.reportAllChanges),l((function(){r.value=performance.now()-i.timeStamp,t(!0)}))})))}))},b=[.1,.25],S=function(e,n){n=n||{},w(v((function(){var t,i=f(\"CLS\",0),r=0,a=[],c=function(e){e.forEach((function(e){if(!e.hadRecentInput){var n=a[0],t=a[a.length-1];r&&e.startTime-t.startTime<1e3&&e.startTime-n.startTime<5e3?(r+=e.value,a.push(e)):(r=e.value,a=[e])}})),r>i.value&&(i.value=r,i.entries=a,t())},u=s(\"layout-shift\",c);u&&(t=d(e,i,b,n.reportAllChanges),p((function(){c(u.takeRecords()),t(!0)})),o((function(){r=0,i=f(\"CLS\",0),t=d(e,i,b,n.reportAllChanges),l((function(){return t()}))})),setTimeout(t,0))})))},A={passive:!0,capture:!0},I=new Date,P=function(i,r){e||(e=r,n=i,t=new Date,k(removeEventListener),F())},F=function(){if(n>=0&&n<t-I){var r={entryType:\"first-input\",name:e.type,target:e.target,cancelable:e.cancelable,startTime:e.timeStamp,processingStart:e.timeStamp+n};i.forEach((function(e){e(r)})),i=[]}},M=function(e){if(e.cancelable){var n=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;\"pointerdown\"==e.type?function(e,n){var t=function(){P(e,n),r()},i=function(){r()},r=function(){removeEventListener(\"pointerup\",t,A),removeEventListener(\"pointercancel\",i,A)};addEventListener(\"pointerup\",t,A),addEventListener(\"pointercancel\",i,A)}(n,e):P(n,e)}},k=function(e){[\"mousedown\",\"keydown\",\"touchstart\",\"pointerdown\"].forEach((function(n){return e(n,M,A)}))},D=[100,300],x=function(t,r){r=r||{},C((function(){var a,c=E(),u=f(\"FID\"),l=function(e){e.startTime<c.firstHiddenTime&&(u.value=e.processingStart-e.startTime,u.entries.push(e),a(!0))},m=function(e){e.forEach(l)},h=s(\"first-input\",m);a=d(t,u,D,r.reportAllChanges),h&&p(v((function(){m(h.takeRecords()),h.disconnect()}))),h&&o((function(){var o;u=f(\"FID\"),a=d(t,u,D,r.reportAllChanges),i=[],n=-1,e=null,k(addEventListener),o=l,i.push(o),F()}))}))},B=0,R=1/0,H=0,N=function(e){e.forEach((function(e){e.interactionId&&(R=Math.min(R,e.interactionId),H=Math.max(H,e.interactionId),B=H?(H-R)/7+1:0)}))},O=function(){return r?B:performance.interactionCount||0},q=function(){\"interactionCount\"in performance||r||(r=s(\"event\",N,{type:\"event\",buffered:!0,durationThreshold:0}))},j=[200,500],_=0,z=function(){return O()-_},G=[],J={},K=function(e){var n=G[G.length-1],t=J[e.interactionId];if(t||G.length<10||e.duration>n.latency){if(t)t.entries.push(e),t.latency=Math.max(t.latency,e.duration);else{var i={id:e.interactionId,latency:e.duration,entries:[e]};J[i.id]=i,G.push(i)}G.sort((function(e,n){return n.latency-e.latency})),G.splice(10).forEach((function(e){delete J[e.id]}))}},Q=function(e,n){n=n||{},C((function(){var t;q();var i,r=f(\"INP\"),a=function(e){e.forEach((function(e){(e.interactionId&&K(e),\"first-input\"===e.entryType)&&(!G.some((function(n){return n.entries.some((function(n){return e.duration===n.duration&&e.startTime===n.startTime}))}))&&K(e))}));var n,t=(n=Math.min(G.length-1,Math.floor(z()/50)),G[n]);t&&t.latency!==r.value&&(r.value=t.latency,r.entries=t.entries,i())},c=s(\"event\",a,{durationThreshold:null!==(t=n.durationThreshold)&&void 0!==t?t:40});i=d(e,r,j,n.reportAllChanges),c&&(\"PerformanceEventTiming\"in window&&\"interactionId\"in PerformanceEventTiming.prototype&&c.observe({type:\"first-input\",buffered:!0}),p((function(){a(c.takeRecords()),r.value<0&&z()>0&&(r.value=0,r.entries=[]),i(!0)})),o((function(){G=[],_=O(),r=f(\"INP\"),i=d(e,r,j,n.reportAllChanges)})))}))},U=[2500,4e3],V={},W=function(e,n){n=n||{},C((function(){var t,i=E(),r=f(\"LCP\"),a=function(e){var n=e[e.length-1];n&&n.startTime<i.firstHiddenTime&&(r.value=Math.max(n.startTime-u(),0),r.entries=[n],t())},c=s(\"largest-contentful-paint\",a);if(c){t=d(e,r,U,n.reportAllChanges);var m=v((function(){V[r.id]||(a(c.takeRecords()),c.disconnect(),V[r.id]=!0,t(!0))}));[\"keydown\",\"click\"].forEach((function(e){addEventListener(e,(function(){return setTimeout(m,0)}),!0)})),p(m),o((function(i){r=f(\"LCP\"),t=d(e,r,U,n.reportAllChanges),l((function(){r.value=performance.now()-i.timeStamp,V[r.id]=!0,t(!0)}))}))}}))},X=[800,1800],Y=function e(n){document.prerendering?C((function(){return e(n)})):\"complete\"!==document.readyState?addEventListener(\"load\",(function(){return e(n)}),!0):setTimeout(n,0)},Z=function(e,n){n=n||{};var t=f(\"TTFB\"),i=d(e,t,X,n.reportAllChanges);Y((function(){var r=c();if(r){var a=r.responseStart;if(a<=0||a>performance.now())return;t.value=Math.max(a-u(),0),t.entries=[r],i(!0),o((function(){t=f(\"TTFB\",0),(i=d(e,t,X,n.reportAllChanges))(!0)}))}}))};export{b as CLSThresholds,L as FCPThresholds,D as FIDThresholds,j as INPThresholds,U as LCPThresholds,X as TTFBThresholds,S as getCLS,w as getFCP,x as getFID,Q as getINP,W as getLCP,Z as getTTFB,S as onCLS,w as onFCP,x as onFID,Q as onINP,W as onLCP,Z as onTTFB};\n",null,null],"names":["r","a","o","e","addEventListener","n","persisted","timeStamp","c","window","performance","getEntriesByType","u","activationStart","f","t","i","document","prerendering","wasDiscarded","type","replace","name","value","rating","delta","entries","id","concat","Date","now","Math","floor","random","navigationType","s","PerformanceObserver","supportedEntryTypes","includes","Promise","resolve","then","getEntries","observe","Object","assign","buffered","d","l","requestAnimationFrame","p","visibilityState","v","m","h","g","T","y","removeEventListener","E","setTimeout","firstHiddenTime","C","L","w","forEach","disconnect","startTime","max","push","reportAllChanges","b","B","R","H","N","interactionId","min","O","interactionCount","q","durationThreshold","j","_","z","G","J","K","length","duration","latency","sort","splice","U","V","X","Y","readyState","win","undefined","global","globalThis","navigator","location","fetch","XMLHttpRequest","AbortController","userAgent","assignableWindow","vtiltWebVitalsCallbacks","takeRecords","hadRecentInput","onFCP","entryType","some","PerformanceEventTiming","prototype","onTTFB","responseStart","__VTiltExtensions__","webVitalsCallbacks"],"mappings":"yBAAA,IAAYA,EAAEC,GAAE,EAAGC,EAAE,SAASC,GAAGC,iBAAiB,WAAY,SAASC,GAAGA,EAAEC,YAAYL,EAAEI,EAAEE,UAAUJ,EAAEE,GAAG,GAAG,EAAG,EAAEG,EAAE,WAAW,OAAOC,OAAOC,aAAaA,YAAYC,kBAAkBD,YAAYC,iBAAiB,cAAc,EAAE,EAAEC,EAAE,WAAW,IAAIT,EAAEK,IAAI,OAAOL,GAAGA,EAAEU,iBAAiB,CAAC,EAAEC,EAAE,SAASX,EAAEE,GAAG,IAAIU,EAAEP,IAAIQ,EAAE,WAA8J,OAAnJf,GAAG,EAAEe,EAAE,qBAAqBD,IAAIE,SAASC,cAAcN,IAAI,EAAEI,EAAE,YAAYC,SAASE,aAAaH,EAAE,UAAUD,EAAEK,OAAOJ,EAAED,EAAEK,KAAKC,QAAQ,KAAK,OAAa,CAACC,KAAKnB,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B,EAAE5C,EAAEH,EAAEkF,EAAE7E,EAAEiE,iBAAiB,GAAI,EAAG,EEoBhrL+C,OFpBw8M,SAASlH,EAAEE,GAAGA,EAAEA,GAAG,CAAA,EAAG,IAAIU,EAAED,EAAE,QAAQE,EAAE+B,EAAE5C,EAAEY,EAAEgF,EAAE1F,EAAEiE,kBAAkB0B,EAAG,WAAW,IAAIhG,EAAEQ,IAAI,GAAGR,EAAE,CAAC,IAAIC,EAAED,EAAEsH,cAAc,GAAGrH,GAAG,GAAGA,EAAES,YAAYoB,MAAM,OAAOf,EAAEQ,MAAMQ,KAAKqC,IAAInE,EAAEW,IAAI,GAAGG,EAAEW,QAAQ,CAAC1B,GAAGgB,GAAE,GAAId,EAAG,WAAWa,EAAED,EAAE,OAAO,IAAIE,EAAE+B,EAAE5C,EAAEY,EAAEgF,EAAE1F,EAAEiE,oBAAmB,EAAG,EAAG,CAAC,EAAG,GEwB1tNsC,EAAiBW,oBACfX,EAAiBW,qBAAuB,CAAA,EAG1CX,EAAiBW,oBAAoBC,mBACnCX","x_google_ignoreList":[0]}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Chat Entrypoint
3
+ *
4
+ * This file is built as a separate bundle (chat.js) that can be
5
+ * lazy-loaded when chat is enabled.
6
+ *
7
+ * Uses Ably for real-time messaging (imported directly in chat.ts).
8
+ *
9
+ * It exports:
10
+ * - initChat: Factory function to create LazyLoadedChat
11
+ */
12
+ import { type ChatConfig, type LazyLoadedChatInterface } from "../utils/globals";
13
+ import { LazyLoadedChat } from "../extensions/chat/chat";
14
+ import type { VTilt } from "../vtilt";
15
+ /**
16
+ * Factory function to create a LazyLoadedChat instance
17
+ *
18
+ * Called by ChatWrapper after the chat script is loaded
19
+ */
20
+ declare function initChat(instance: VTilt, config?: ChatConfig): LazyLoadedChatInterface;
21
+ export { initChat, LazyLoadedChat };
22
+ export default initChat;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ /**
3
+ * Chat Entrypoint
4
+ *
5
+ * This file is built as a separate bundle (chat.js) that can be
6
+ * lazy-loaded when chat is enabled.
7
+ *
8
+ * Uses Ably for real-time messaging (imported directly in chat.ts).
9
+ *
10
+ * It exports:
11
+ * - initChat: Factory function to create LazyLoadedChat
12
+ */
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.LazyLoadedChat = void 0;
15
+ exports.initChat = initChat;
16
+ const globals_1 = require("../utils/globals");
17
+ const chat_1 = require("../extensions/chat/chat");
18
+ Object.defineProperty(exports, "LazyLoadedChat", { enumerable: true, get: function () { return chat_1.LazyLoadedChat; } });
19
+ // Initialize extensions object
20
+ globals_1.assignableWindow.__VTiltExtensions__ =
21
+ globals_1.assignableWindow.__VTiltExtensions__ || {};
22
+ /**
23
+ * Factory function to create a LazyLoadedChat instance
24
+ *
25
+ * Called by ChatWrapper after the chat script is loaded
26
+ */
27
+ function initChat(instance, config) {
28
+ return new chat_1.LazyLoadedChat(instance, config);
29
+ }
30
+ // Register the factory function
31
+ globals_1.assignableWindow.__VTiltExtensions__.initChat = initChat;
32
+ exports.default = initChat;
@@ -0,0 +1,172 @@
1
+ /**
2
+ * Chat Wrapper
3
+ *
4
+ * Lightweight wrapper that handles the decision of WHEN to load the chat widget.
5
+ * The actual chat logic is in LazyLoadedChat which is loaded on demand.
6
+ *
7
+ * This follows the same pattern as SessionRecordingWrapper.
8
+ *
9
+ * ## Initialization Modes (Intercom-like flexibility)
10
+ *
11
+ * 1. **Snippet-only (dashboard configured)**:
12
+ * Just add the vTilt snippet - widget auto-configures from project settings.
13
+ * ```js
14
+ * vt.init('token', { api_host: '...' })
15
+ * // Chat widget appears based on dashboard settings
16
+ * ```
17
+ *
18
+ * 2. **Code-configured (optional overrides)**:
19
+ * Override dashboard settings with code for advanced customization.
20
+ * ```js
21
+ * vt.init('token', {
22
+ * api_host: '...',
23
+ * chat: {
24
+ * enabled: true,
25
+ * position: 'bottom-left',
26
+ * greeting: 'Custom greeting!'
27
+ * }
28
+ * })
29
+ * ```
30
+ *
31
+ * Code config always takes precedence over dashboard settings.
32
+ */
33
+ import type { VTilt } from "../../vtilt";
34
+ import type { ChatConfig } from "../../utils/globals";
35
+ import type { MessageCallback, TypingCallback, ConnectionCallback, Unsubscribe } from "./types";
36
+ /** Status when lazy loading is in progress */
37
+ export declare const CHAT_LOADING: "loading";
38
+ /**
39
+ * Chat Wrapper
40
+ *
41
+ * This is the lightweight class that lives in the main bundle.
42
+ * It handles:
43
+ * - Auto-fetching settings from dashboard (Intercom-like)
44
+ * - Merging server settings with code config
45
+ * - Deciding if chat should be enabled
46
+ * - Lazy loading the actual chat widget code
47
+ * - Delegating to LazyLoadedChat
48
+ * - Queuing messages/callbacks before widget loads
49
+ */
50
+ export declare class ChatWrapper {
51
+ private readonly _instance;
52
+ private _lazyLoadedChat;
53
+ private _config;
54
+ private _serverConfig;
55
+ private _configFetched;
56
+ private _isLoading;
57
+ private _loadError;
58
+ private _pendingMessages;
59
+ private _pendingCallbacks;
60
+ private _messageCallbacks;
61
+ private _typingCallbacks;
62
+ private _connectionCallbacks;
63
+ constructor(_instance: VTilt, config?: ChatConfig);
64
+ /**
65
+ * Whether the chat widget is open
66
+ */
67
+ get isOpen(): boolean;
68
+ /**
69
+ * Whether connected to realtime service
70
+ */
71
+ get isConnected(): boolean;
72
+ /**
73
+ * Whether the widget is loading
74
+ */
75
+ get isLoading(): boolean;
76
+ /**
77
+ * Number of unread messages
78
+ */
79
+ get unreadCount(): number;
80
+ /**
81
+ * Current channel (if any)
82
+ */
83
+ get channel(): import("./types").ChatChannel | null;
84
+ /**
85
+ * Open the chat widget
86
+ */
87
+ open(): void;
88
+ /**
89
+ * Close the chat widget
90
+ */
91
+ close(): void;
92
+ /**
93
+ * Toggle the chat widget open/closed
94
+ */
95
+ toggle(): void;
96
+ /**
97
+ * Show the chat widget (make visible but not necessarily open)
98
+ */
99
+ show(): void;
100
+ /**
101
+ * Hide the chat widget
102
+ */
103
+ hide(): void;
104
+ /**
105
+ * Send a message
106
+ */
107
+ sendMessage(content: string): void;
108
+ /**
109
+ * Mark messages as read
110
+ */
111
+ markAsRead(): void;
112
+ /**
113
+ * Subscribe to new messages
114
+ */
115
+ onMessage(callback: MessageCallback): Unsubscribe;
116
+ /**
117
+ * Subscribe to typing indicators
118
+ */
119
+ onTyping(callback: TypingCallback): Unsubscribe;
120
+ /**
121
+ * Subscribe to connection changes
122
+ */
123
+ onConnectionChange(callback: ConnectionCallback): Unsubscribe;
124
+ /**
125
+ * Start chat if enabled, called by VTilt after init
126
+ *
127
+ * This method supports two modes (Intercom-like):
128
+ * 1. Auto-config: Fetch settings from /api/chat/settings (default)
129
+ * 2. Code-only: Use only code config (autoConfig: false)
130
+ */
131
+ startIfEnabled(): Promise<void>;
132
+ /**
133
+ * Update configuration
134
+ */
135
+ updateConfig(config: Partial<ChatConfig>): void;
136
+ /**
137
+ * Get the merged configuration (server + code, code takes precedence)
138
+ */
139
+ getMergedConfig(): ChatConfig;
140
+ /**
141
+ * Destroy the chat widget
142
+ */
143
+ destroy(): void;
144
+ private get _isChatEnabled();
145
+ /**
146
+ * Fetch chat settings from the server
147
+ * This enables "snippet-only" installation where widget configures from dashboard
148
+ */
149
+ private _fetchServerSettings;
150
+ /**
151
+ * Show the chat bubble (launcher button) without fully loading the widget
152
+ * This creates a lightweight bubble that loads the full widget on click
153
+ */
154
+ private _showBubble;
155
+ private get _scriptName();
156
+ /**
157
+ * Schedule preload on idle
158
+ */
159
+ private _schedulePreload;
160
+ /**
161
+ * Lazy load and then execute callback
162
+ */
163
+ private _lazyLoadAndThen;
164
+ /**
165
+ * Lazy load the chat script
166
+ */
167
+ private _lazyLoad;
168
+ /**
169
+ * Called after the chat script is loaded
170
+ */
171
+ private _onScriptLoaded;
172
+ }