@revrag-ai/embed-react-native 1.0.15 → 1.0.17

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 (76) hide show
  1. package/dist/commonjs/api/api.js +6 -5
  2. package/dist/commonjs/api/api.js.map +1 -1
  3. package/dist/commonjs/components/Embed/EmbedButton.js +140 -318
  4. package/dist/commonjs/components/Embed/EmbedButton.js.map +1 -1
  5. package/dist/commonjs/components/Embed/EmbedVoice.js +16 -4
  6. package/dist/commonjs/components/Embed/EmbedVoice.js.map +1 -1
  7. package/dist/commonjs/context/EmbedProvider.js +638 -0
  8. package/dist/commonjs/context/EmbedProvider.js.map +1 -0
  9. package/dist/commonjs/events/embed.event.js +141 -7
  10. package/dist/commonjs/events/embed.event.js.map +1 -1
  11. package/dist/commonjs/hooks/EmbedButton.animations.js +181 -0
  12. package/dist/commonjs/hooks/EmbedButton.animations.js.map +1 -0
  13. package/dist/commonjs/hooks/EmbedButton.helpers.js +90 -0
  14. package/dist/commonjs/hooks/EmbedButton.helpers.js.map +1 -0
  15. package/dist/commonjs/hooks/EmbedButton.hooks.js +165 -0
  16. package/dist/commonjs/hooks/EmbedButton.hooks.js.map +1 -0
  17. package/dist/commonjs/hooks/initialize.js +65 -25
  18. package/dist/commonjs/hooks/initialize.js.map +1 -1
  19. package/dist/commonjs/index.js +14 -0
  20. package/dist/commonjs/index.js.map +1 -1
  21. package/dist/commonjs/utils/constant.js +88 -0
  22. package/dist/commonjs/utils/constant.js.map +1 -0
  23. package/dist/commonjs/utils/reanimated.helper.js +2 -3
  24. package/dist/commonjs/utils/reanimated.helper.js.map +1 -1
  25. package/dist/module/api/api.js +6 -6
  26. package/dist/module/api/api.js.map +1 -1
  27. package/dist/module/components/Embed/EmbedButton.js +141 -320
  28. package/dist/module/components/Embed/EmbedButton.js.map +1 -1
  29. package/dist/module/components/Embed/EmbedVoice.js +16 -4
  30. package/dist/module/components/Embed/EmbedVoice.js.map +1 -1
  31. package/dist/module/context/EmbedProvider.js +626 -0
  32. package/dist/module/context/EmbedProvider.js.map +1 -0
  33. package/dist/module/events/embed.event.js +144 -5
  34. package/dist/module/events/embed.event.js.map +1 -1
  35. package/dist/module/hooks/EmbedButton.animations.js +172 -0
  36. package/dist/module/hooks/EmbedButton.animations.js.map +1 -0
  37. package/dist/module/hooks/EmbedButton.helpers.js +80 -0
  38. package/dist/module/hooks/EmbedButton.helpers.js.map +1 -0
  39. package/dist/module/hooks/EmbedButton.hooks.js +160 -0
  40. package/dist/module/hooks/EmbedButton.hooks.js.map +1 -0
  41. package/dist/module/hooks/initialize.js +66 -26
  42. package/dist/module/hooks/initialize.js.map +1 -1
  43. package/dist/module/index.js +3 -2
  44. package/dist/module/index.js.map +1 -1
  45. package/dist/module/utils/constant.js +82 -0
  46. package/dist/module/utils/constant.js.map +1 -0
  47. package/dist/module/utils/reanimated.helper.js +2 -3
  48. package/dist/module/utils/reanimated.helper.js.map +1 -1
  49. package/dist/typescript/src/api/api.d.ts +4 -3
  50. package/dist/typescript/src/api/api.d.ts.map +1 -1
  51. package/dist/typescript/src/api/types/embed.api.types.d.ts +1 -1
  52. package/dist/typescript/src/api/types/embed.api.types.d.ts.map +1 -1
  53. package/dist/typescript/src/components/Embed/EmbedButton.d.ts +5 -25
  54. package/dist/typescript/src/components/Embed/EmbedButton.d.ts.map +1 -1
  55. package/dist/typescript/src/components/Embed/EmbedVoice.d.ts.map +1 -1
  56. package/dist/typescript/src/context/EmbedProvider.d.ts +306 -0
  57. package/dist/typescript/src/context/EmbedProvider.d.ts.map +1 -0
  58. package/dist/typescript/src/events/embed.event.d.ts +79 -1
  59. package/dist/typescript/src/events/embed.event.d.ts.map +1 -1
  60. package/dist/typescript/src/hooks/EmbedButton.animations.d.ts +38 -0
  61. package/dist/typescript/src/hooks/EmbedButton.animations.d.ts.map +1 -0
  62. package/dist/typescript/src/hooks/EmbedButton.helpers.d.ts +49 -0
  63. package/dist/typescript/src/hooks/EmbedButton.helpers.d.ts.map +1 -0
  64. package/dist/typescript/src/hooks/EmbedButton.hooks.d.ts +49 -0
  65. package/dist/typescript/src/hooks/EmbedButton.hooks.d.ts.map +1 -0
  66. package/dist/typescript/src/hooks/initialize.d.ts.map +1 -1
  67. package/dist/typescript/src/hooks/types/initialize.types.d.ts +1 -1
  68. package/dist/typescript/src/hooks/types/initialize.types.d.ts.map +1 -1
  69. package/dist/typescript/src/index.d.ts +5 -3
  70. package/dist/typescript/src/index.d.ts.map +1 -1
  71. package/dist/typescript/src/index.types.d.ts +1 -1
  72. package/dist/typescript/src/index.types.d.ts.map +1 -1
  73. package/dist/typescript/src/utils/constant.d.ts +45 -0
  74. package/dist/typescript/src/utils/constant.d.ts.map +1 -0
  75. package/dist/typescript/src/utils/reanimated.helper.d.ts.map +1 -1
  76. package/package.json +6 -2
@@ -0,0 +1,306 @@
1
+ /**
2
+ * @file EmbedProvider.tsx
3
+ * @description Core provider component for the Embed React Native library.
4
+ *
5
+ * This provider:
6
+ * - Tracks navigation state and screen changes
7
+ * - Conditionally renders the EmbedButton based on current screen
8
+ * - Provides utilities for extracting navigation hierarchy information
9
+ * - Manages event tracking integration with the Embed system
10
+ *
11
+ * @module EmbedProvider
12
+ */
13
+ import type { NavigationContainerRef } from '@react-navigation/native';
14
+ import React from 'react';
15
+ /**
16
+ * Props for the EmbedProvider component
17
+ * @interface EmbedProviderProps
18
+ */
19
+ interface EmbedProviderProps {
20
+ /** Child components to render within the provider */
21
+ children: React.ReactNode;
22
+ /** Optional navigation ref for tracking navigation state */
23
+ navigationRef?: React.RefObject<NavigationContainerRef<any>>;
24
+ /**
25
+ * Optional list of screen names where the EmbedButton SHOULD be displayed.
26
+ * If provided, the button is rendered only on these screens.
27
+ * If omitted/empty, the button is shown on all screens (subject to backend config).
28
+ * @example ['Home', 'Profile']
29
+ */
30
+ includeScreens?: string[];
31
+ /**
32
+ * Optional app version information from the host app
33
+ * Pass this to include accurate version tracking in analytics
34
+ * @example
35
+ * ```typescript
36
+ * import packageJson from './package.json';
37
+ * <EmbedProvider appVersion={packageJson.version}>
38
+ * ```
39
+ */
40
+ appVersion: string;
41
+ }
42
+ /**
43
+ * Represents the complete hierarchical structure of the current navigation state
44
+ * @interface RouteHierarchy
45
+ */
46
+ export interface RouteHierarchy {
47
+ /** The active/deepest screen name (leaf node in the navigation tree) */
48
+ currentScreen: string;
49
+ /** Complete navigation path (e.g., "Root > Tab > Screen") */
50
+ fullPath: string;
51
+ /** Array of route names from root to current [Level0, Level1, Level2, ...] */
52
+ allRoutes: string[];
53
+ /** Navigation depth (number of levels in the tree) */
54
+ depth: number;
55
+ /** Map of route names by level: { 0: "RootScreen", 1: "TabScreen", 2: "InnerScreen" } */
56
+ routesByLevel: Record<number, string>;
57
+ /** The immediate parent route (one level up from current) */
58
+ parentRoute?: string;
59
+ /** Parameters of the current/active route */
60
+ routeParams?: Record<string, any>;
61
+ }
62
+ /**
63
+ * Represents a node in the navigation tree structure
64
+ * @interface NavigationTreeNode
65
+ */
66
+ export interface NavigationTreeNode {
67
+ /** Route name */
68
+ name: string;
69
+ /** Navigation level/depth (0 = root) */
70
+ level: number;
71
+ /** Route parameters, if any */
72
+ params?: Record<string, any>;
73
+ /** Child routes (nested navigators) */
74
+ children?: NavigationTreeNode[];
75
+ }
76
+ /**
77
+ * Extracts complete route hierarchy information from navigation state
78
+ *
79
+ * This function traverses the navigation state tree recursively to build
80
+ * a comprehensive hierarchy object containing the current screen, full path,
81
+ * depth, and route information at each level.
82
+ *
83
+ * @param {any} state - Navigation state from navigationRef.current?.getRootState()
84
+ * @returns {RouteHierarchy | null} Complete route hierarchy or null if state is invalid
85
+ *
86
+ * @example
87
+ * ```typescript
88
+ * const routeInfo = getRouteHierarchy(navigationRef.current?.getRootState());
89
+ * console.log(routeInfo);
90
+ * // {
91
+ * // currentScreen: "Product",
92
+ * // fullPath: "MainApp > Home > Product",
93
+ * // allRoutes: ["MainApp", "Home", "Product"],
94
+ * // depth: 3,
95
+ * // routesByLevel: { 0: "MainApp", 1: "Home", 2: "Product" },
96
+ * // parentRoute: "Home",
97
+ * // routeParams: { id: "123" }
98
+ * // }
99
+ * ```
100
+ */
101
+ export declare const getRouteHierarchy: (state: any) => RouteHierarchy | null;
102
+ /**
103
+ * Extracts ALL available routes (both mounted and defined) from navigation state
104
+ *
105
+ * This function traverses the navigation state and returns a flat array of:
106
+ * 1. Currently MOUNTED routes (routes that are rendered in the navigation tree)
107
+ * 2. DEFINED routes (from routeNames - routes that exist but may not be rendered yet)
108
+ *
109
+ * This is particularly useful because nested navigators (like tab navigators)
110
+ * won't appear in the state until you navigate to them, but their route names
111
+ * are still defined in the navigator configuration.
112
+ *
113
+ * @param {any} state - Navigation state from navigationRef.current?.getRootState()
114
+ * @returns {string[]} Array of unique route names
115
+ *
116
+ * @example
117
+ * ```typescript
118
+ * const allRoutes = getAllRoutes(navigationRef.current?.getRootState());
119
+ * console.log(allRoutes);
120
+ * // ["Splash", "Welcome", "MainApp", "Home", "Transactions", "Profile"]
121
+ *
122
+ * // Check if a specific route is available
123
+ * const hasProfileScreen = allRoutes.includes("Profile");
124
+ * ```
125
+ */
126
+ export declare const getAllRoutes: (state: any) => string[];
127
+ /**
128
+ * Builds a complete navigation tree structure showing all routes and their relationships
129
+ *
130
+ * This function creates a hierarchical tree structure representing the entire
131
+ * navigation state, including all routes at all levels (not just the active path).
132
+ * Useful for visualizing or debugging your navigation structure.
133
+ *
134
+ * @param {any} state - Navigation state from navigationRef.current?.getRootState()
135
+ * @returns {NavigationTreeNode[]} Array of NavigationTreeNode representing the complete tree
136
+ *
137
+ * @example
138
+ * ```typescript
139
+ * const tree = getNavigationTree(navigationRef.current?.getRootState());
140
+ * console.log(JSON.stringify(tree, null, 2));
141
+ *
142
+ * // Example output:
143
+ * // [
144
+ * // {
145
+ * // "name": "MainApp",
146
+ * // "level": 0,
147
+ * // "children": [
148
+ * // {
149
+ * // "name": "Home",
150
+ * // "level": 1,
151
+ * // "children": [
152
+ * // { "name": "HomeMain", "level": 2 },
153
+ * // { "name": "Product", "level": 2, "params": { "id": "123" } }
154
+ * // ]
155
+ * // },
156
+ * // { "name": "Profile", "level": 1 }
157
+ * // ]
158
+ * // }
159
+ * // ]
160
+ * ```
161
+ */
162
+ export declare const getNavigationTree: (state: any) => NavigationTreeNode[];
163
+ /**
164
+ * Legacy alias for getAllRoutes()
165
+ * @deprecated Use getAllRoutes() instead
166
+ *
167
+ * Note: React Navigation limitation - nested navigator routes (like tabs inside a stack)
168
+ * only appear in the state AFTER they're mounted/rendered.
169
+ *
170
+ * @param {any} state - Navigation state
171
+ * @returns {string[]} Array of route names
172
+ */
173
+ export declare const getAllDefinedRoutes: (state: any) => string[];
174
+ /**
175
+ * Interface for app version information
176
+ * @interface AppVersionInfo
177
+ */
178
+ export interface AppVersionInfo {
179
+ /** App version name/string (e.g., "1.2.3") */
180
+ version: string;
181
+ /** App build number (iOS: CFBundleVersion, Android: versionCode) */
182
+ buildNumber: string;
183
+ /** Platform (iOS or Android) */
184
+ platform: string;
185
+ /** Full version string combining version and build */
186
+ fullVersion: string;
187
+ }
188
+ /**
189
+ * Track custom events with the Embed system
190
+ *
191
+ * This function provides a simple interface to send custom event data
192
+ * to the Embed analytics system. All errors are caught and handled silently
193
+ * to prevent analytics issues from affecting app functionality.
194
+ *
195
+ * @param {string} eventName - Name of the event to track
196
+ * @param {Record<string, any>} properties - Event properties/metadata (optional)
197
+ *
198
+ * @example
199
+ * ```typescript
200
+ * // Track a button click
201
+ * trackEmbedEvent('button_clicked', {
202
+ * buttonId: 'submit_form',
203
+ * screenName: 'Profile',
204
+ * });
205
+ *
206
+ * // Track a purchase
207
+ * trackEmbedEvent('purchase_completed', {
208
+ * amount: 99.99,
209
+ * currency: 'USD',
210
+ * items: ['item1', 'item2'],
211
+ * });
212
+ * ```
213
+ */
214
+ export declare const trackEmbedEvent: (eventName: string, properties?: Record<string, any>) => void;
215
+ /**
216
+ * Track rage clicks (repeated rapid clicks indicating user frustration)
217
+ *
218
+ * Rage clicks are detected when a user clicks the same element multiple times
219
+ * in rapid succession, which can indicate frustration with unresponsive UI.
220
+ * This data helps identify problem areas in the user experience.
221
+ *
222
+ * @param {string} elementId - Unique identifier of the clicked element
223
+ * @param {string} elementType - Type of element (e.g., 'button', 'link', 'text')
224
+ * @param {{ x: number; y: number }} coordinates - Screen coordinates of the clicks
225
+ * @param {number} clickCount - Number of rapid clicks detected
226
+ *
227
+ * @example
228
+ * ```typescript
229
+ * trackRageClick('submit_button', 'button', { x: 100, y: 200 }, 5);
230
+ * ```
231
+ */
232
+ export declare const trackRageClick: (elementId: string, elementType: string, coordinates: {
233
+ x: number;
234
+ y: number;
235
+ }, clickCount: number) => void;
236
+ /**
237
+ * Track form-related events (changes, submissions, errors)
238
+ *
239
+ * This function tracks various form interactions to help understand
240
+ * user behavior and identify potential issues in form flows.
241
+ *
242
+ * @param {string} formId - Unique identifier of the form
243
+ * @param {'form_change' | 'form_submit' | 'form_error'} eventType - Type of form event
244
+ * @param {Record<string, any>} formData - Form data/metadata (optional)
245
+ *
246
+ * @example
247
+ * ```typescript
248
+ * // Track form field change
249
+ * trackFormEvent('signup_form', 'form_change', {
250
+ * field: 'email',
251
+ * value: 'user@example.com',
252
+ * });
253
+ *
254
+ * // Track form submission
255
+ * trackFormEvent('signup_form', 'form_submit', {
256
+ * success: true,
257
+ * userId: '12345',
258
+ * });
259
+ *
260
+ * // Track form error
261
+ * trackFormEvent('signup_form', 'form_error', {
262
+ * field: 'password',
263
+ * error: 'Password too short',
264
+ * });
265
+ * ```
266
+ */
267
+ export declare const trackFormEvent: (formId: string, eventType: "form_change" | "form_submit" | "form_error", formData?: Record<string, any>) => void;
268
+ /**
269
+ * EmbedProvider Component
270
+ *
271
+ * Core provider component that wraps your application to enable Embed functionality.
272
+ * This provider:
273
+ * - Monitors navigation state changes
274
+ * - Automatically shows/hides the EmbedButton based on current screen
275
+ * - Tracks screen views and navigation hierarchy
276
+ * - Integrates with the Embed analytics system
277
+ *
278
+ * @param {EmbedProviderProps} props - Component props
279
+ * @returns {JSX.Element} Provider component with children and conditional EmbedButton
280
+ *
281
+ * @example
282
+ * ```typescript
283
+ * import { NavigationContainer } from '@react-navigation/native';
284
+ * import { EmbedProvider } from '@revrag/embed-react-native';
285
+ * import { useRef } from 'react';
286
+ *
287
+ * function App() {
288
+ * const navigationRef = useRef<NavigationContainerRef<any>>(null);
289
+ *
290
+ * return (
291
+ * // IMPORTANT: EmbedProvider must WRAP NavigationContainer
292
+ * <EmbedProvider
293
+ * navigationRef={navigationRef}
294
+ * includeScreens={['Home', 'Profile', 'Dashboard']}
295
+ * >
296
+ * <NavigationContainer ref={navigationRef}>
297
+ * {/* Your navigation stack *\/}
298
+ * </NavigationContainer>
299
+ * </EmbedProvider>
300
+ * );
301
+ * }
302
+ * ```
303
+ */
304
+ export declare const EmbedProvider: React.FC<EmbedProviderProps>;
305
+ export default EmbedProvider;
306
+ //# sourceMappingURL=EmbedProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmbedProvider.d.ts","sourceRoot":"","sources":["../../../../src/context/EmbedProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,KAMN,MAAM,OAAO,CAAC;AAQf;;;GAGG;AACH,UAAU,kBAAkB;IAC1B,qDAAqD;IACrD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,4DAA4D;IAC5D,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7D;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B;;;;;;;;OAQG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,wEAAwE;IACxE,aAAa,EAAE,MAAM,CAAC;IACtB,6DAA6D;IAC7D,QAAQ,E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,WAAW,EAAE,MAAM,CAAC;CACrB;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,eAAe,GAC1B,WAAW,MAAM,EACjB,aAAY,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,KACnC,IAYF,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,cAAc,GACzB,WAAW,MAAM,EACjB,aAAa,MAAM,EACnB,aAAa;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EACrC,YAAY,MAAM,KACjB,IAeF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,cAAc,GACzB,QAAQ,MAAM,EACd,WAAW,aAAa,GAAG,aAAa,GAAG,YAAY,EACvD,WAAU,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,KACjC,IAaF,CAAC;AAMF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAoKtD,CAAC;AAOF,eAAe,aAAa,CAAC"}
@@ -2,12 +2,90 @@ type EventCallback = (data: any) => void;
2
2
  export declare enum EventKeys {
3
3
  USER_DATA = "user_data",
4
4
  SCREEN_STATE = "screen_state",
5
- OFFER_STATE = "offer_state"
5
+ OFFER_STATE = "offer_state",
6
+ CUSTOM_EVENT = "custom_event",
7
+ FORM_STATE = "form_state",
8
+ ACTION_STATE = "action_state",
9
+ ERROR_STATE = "error_state",
10
+ SUCCESS_STATE = "success_state",
11
+ WARNING_STATE = "warning_state",
12
+ INFO_STATE = "info_state",
13
+ DEBUG_STATE = "debug_state"
14
+ }
15
+ export declare enum AgentEvent {
16
+ AGENT_CONNECTED = "agent_connected",
17
+ AGENT_DISCONNECTED = "agent_disconnected",
18
+ POPUP_MESSAGE_VISIBLE = "popup_message_visible"
19
+ }
20
+ export interface AgentConnectedData {
21
+ timestamp: string;
22
+ metadata?: Record<string, any>;
23
+ }
24
+ export interface AgentDisconnectedData {
25
+ timestamp: string;
26
+ metadata?: Record<string, any>;
27
+ }
28
+ export interface PopupMessageVisibleData {
29
+ value: boolean;
30
+ metadata?: {
31
+ trigger?: string;
32
+ [key: string]: any;
33
+ };
34
+ }
35
+ /**
36
+ * Agent Event Emitter
37
+ * Handles listening to agent state changes (connection, disconnection, popup visibility)
38
+ * Also sends agent events to the backend API
39
+ */
40
+ declare class AgentEventEmitter {
41
+ private agentListeners;
42
+ /**
43
+ * Add an event listener for agent events
44
+ * @param eventKey - The agent event to listen for
45
+ * @param callback - Callback function to execute when event fires
46
+ */
47
+ on(eventKey: AgentEvent, callback: EventCallback): void;
48
+ /**
49
+ * Remove an event listener for agent events
50
+ * @param eventKey - The agent event to stop listening to
51
+ * @param callback - The callback function to remove
52
+ */
53
+ off(eventKey: AgentEvent, callback: EventCallback): void;
54
+ /**
55
+ * Emit an agent event to all registered listeners AND send to backend
56
+ * @param eventKey - The agent event to emit
57
+ * @param data - Data to pass to listeners
58
+ * @internal - Used internally by the library
59
+ */
60
+ emit(eventKey: AgentEvent, data: any): Promise<void>;
61
+ /**
62
+ * Send agent event data to backend API
63
+ * @param eventKey - The agent event type
64
+ * @param data - Event data
65
+ * @private
66
+ */
67
+ private sendToBackend;
68
+ /**
69
+ * Remove all listeners for a specific event
70
+ * @param eventKey - The agent event to clear listeners for
71
+ */
72
+ removeAllListeners(eventKey?: AgentEvent): void;
6
73
  }
7
74
  declare class Embed {
8
75
  private events;
76
+ event: AgentEventEmitter;
77
+ constructor();
9
78
  private ensureDefaultListener;
79
+ /**
80
+ * Send an event to the AI agent
81
+ * @param eventKey - The event type to send
82
+ * @param data - Event data payload
83
+ */
10
84
  Event(eventKey: string, data: any): Promise<void>;
85
+ /**
86
+ * Add listener for data events (legacy support)
87
+ * @deprecated Use event.on() for agent events instead
88
+ */
11
89
  on(eventKey: EventKeys, callback: EventCallback): void;
12
90
  }
13
91
  declare const embed: Embed;
@@ -1 +1 @@
1
- {"version":3,"file":"embed.event.d.ts","sourceRoot":"","sources":["../../../../src/events/embed.event.ts"],"names":[],"mappings":"AAGA,KAAK,aAAa,GAAG,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;AAGzC,oBAAY,SAAS;IACnB,SAAS,cAAc;IACvB,YAAY,iBAAiB;IAC7B,WAAW,gBAAgB;CAC5B;AAED,cAAM,KAAK;IACT,OAAO,CAAC,MAAM,CAAgD;IAG9D,OAAO,CAAC,qBAAqB;IAWvB,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG;IA4CvC,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa;CAMhD;AAED,QAAA,MAAM,KAAK,OAAc,CAAC;AAC1B,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"embed.event.d.ts","sourceRoot":"","sources":["../../../../src/events/embed.event.ts"],"names":[],"mappings":"AAIA,KAAK,aAAa,GAAG,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;AAGzC,oBAAY,SAAS;IACnB,SAAS,cAAc;IACvB,YAAY,iBAAiB;IAC7B,WAAW,gBAAgB;IAC3B,YAAY,iBAAiB;IAC7B,UAAU,eAAe;IACzB,YAAY,iBAAiB;IAC7B,WAAW,gBAAgB;IAC3B,aAAa,kBAAkB;IAC/B,aAAa,kBAAkB;IAC/B,UAAU,eAAe;IACzB,WAAW,gBAAgB;CAC5B;AAGD,oBAAY,UAAU;IACpB,eAAe,oBAAoB;IACnC,kBAAkB,uBAAuB;IACzC,qBAAqB,0BAA0B;CAChD;AAGD,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE;QACT,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;CACH;AAED;;;;GAIG;AACH,cAAM,iBAAiB;IACrB,OAAO,CAAC,cAAc,CAAiD;IAEvE;;;;OAIG;IACH,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,GAAG,IAAI;IAOvD;;;;OAIG;IACH,GAAG,CAAC,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,GAAG,IAAI;IASxD;;;;;OAKG;IACG,IAAI,CAAC,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAc1D;;;;;OAKG;YACW,aAAa;IAuC3B;;;OAGG;IACH,kBAAkB,CAAC,QAAQ,CAAC,EAAE,UAAU,GAAG,IAAI;CAOhD;AAED,cAAM,KAAK;IACT,OAAO,CAAC,MAAM,CAAgD;IAGvD,KAAK,EAAE,iBAAiB,CAAC;;IAOhC,OAAO,CAAC,qBAAqB;IAW7B;;;;OAIG;IACG,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG;IA2CvC;;;OAGG;IACH,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa;CAMhD;AAED,QAAA,MAAM,KAAK,OAAc,CAAC;AAC1B,eAAe,KAAK,CAAC"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * @file EmbedButton.animations.ts
3
+ * @description Animation logic and hooks for the EmbedButton component
4
+ */
5
+ declare const Animated: any;
6
+ export { Animated };
7
+ /**
8
+ * Hook to initialize and manage all animation shared values
9
+ */
10
+ export declare const useAnimationValues: () => {
11
+ isPressed: any;
12
+ offset: any;
13
+ start: any;
14
+ menuAnimation: any;
15
+ buttonWidth: any;
16
+ buttonScale: any;
17
+ };
18
+ /**
19
+ * Hook to handle button expand/collapse animations
20
+ */
21
+ export declare const useButtonAnimations: (isOpen: boolean, menuAnimation: any, buttonWidth: any) => void;
22
+ /**
23
+ * Hook to handle breathing animation when auto-popup is shown
24
+ */
25
+ export declare const useBreathingAnimation: (isOpen: boolean, isAutoOpen: boolean, buttonScale: any) => void;
26
+ /**
27
+ * Hook to create animated styles for the button
28
+ */
29
+ export declare const useButtonAnimatedStyles: (isOpen: boolean, offset: any, buttonWidth: any, isPressed: any, buttonScale: any) => any;
30
+ /**
31
+ * Hook to create animated styles for the popup text
32
+ */
33
+ export declare const usePopupAnimatedStyles: (offset: any, isPressed: any) => any;
34
+ /**
35
+ * Create pan gesture for drag functionality
36
+ */
37
+ export declare const createPanGesture: (isPressed: any, offset: any, start: any, isOpen: boolean, setIsAutoOpen: (value: boolean) => void) => import("react-native-gesture-handler/lib/typescript/handlers/gestures/panGesture").PanGesture;
38
+ //# sourceMappingURL=EmbedButton.animations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmbedButton.animations.d.ts","sourceRoot":"","sources":["../../../../src/hooks/EmbedButton.animations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAkBH,QAAA,MASE,QAAQ,KAEY,CAAC;AAQvB,OAAO,EAAE,QAAQ,EAAE,CAAC;AAGpB;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;CAgB9B,CAAC;AAGF;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAC9B,QAAQ,OAAO,EACf,eAAe,GAAG,EAClB,aAAa,GAAG,SAUjB,CAAC;AAGF;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAChC,QAAQ,OAAO,EACf,YAAY,OAAO,EACnB,aAAa,GAAG,SAwBjB,CAAC;AAGF;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAClC,QAAQ,OAAO,EACf,QAAQ,GAAG,EACX,aAAa,GAAG,EAChB,WAAW,GAAG,EACd,aAAa,GAAG,QAkBjB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,GAAI,QAAQ,GAAG,EAAE,WAAW,GAAG,QAajE,CAAC;AAGF;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAC3B,WAAW,GAAG,EACd,QAAQ,GAAG,EACX,OAAO,GAAG,EACV,QAAQ,OAAO,EACf,eAAe,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,kGA2BxC,CAAC"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * @file EmbedButton.helpers.ts
3
+ * @description Helper functions and utilities for the EmbedButton component
4
+ */
5
+ export declare const SCREEN_WIDTH: number, SCREEN_HEIGHT: number;
6
+ export declare const BUTTON_DIMENSIONS: {
7
+ readonly WIDTH: 60;
8
+ readonly HEIGHT: 60;
9
+ readonly EXPANDED_WIDTH: number;
10
+ };
11
+ export declare const ICON_URLS: {
12
+ readonly MIC_ON: "https://revrag-dev.s3.ap-south-1.amazonaws.com/Avatars/Mute+button.png";
13
+ readonly MIC_OFF: "https://revrag-dev.s3.ap-south-1.amazonaws.com/Avatars/unmute.png";
14
+ readonly END_CALL: "https://revrag-dev.s3.ap-south-1.amazonaws.com/Avatars/end+button.png";
15
+ readonly AMPLIFY_ANIMATION: "https://revrag-dev.s3.ap-south-1.amazonaws.com/Avatars/amplify.json";
16
+ };
17
+ export declare const DEFAULT_GRADIENT_COLORS: string[];
18
+ export declare const DEFAULT_POPUP_DELAY_MS = 15000;
19
+ export interface ConfigData {
20
+ inactivity_behaviour?: 'show_popup' | 'auto_trigger' | 'none';
21
+ popup_delay_ms?: number | string;
22
+ popup_description?: string;
23
+ icon_animation?: string;
24
+ gradient?: string[];
25
+ agent_name?: string;
26
+ agent_type?: string;
27
+ connect_button_title?: string;
28
+ }
29
+ /**
30
+ * Safely parse delay value to ensure it's a valid number
31
+ */
32
+ export declare const parseDelayMs: (delay: number | string | undefined) => number;
33
+ /**
34
+ * Format seconds to MM:SS format
35
+ */
36
+ export declare const formatDuration: (seconds: number) => string;
37
+ /**
38
+ * Calculate the max X position for button drag constraints
39
+ */
40
+ export declare const calculateMaxX: (isOpen: boolean) => number;
41
+ /**
42
+ * Calculate the max Y position for button drag constraints
43
+ */
44
+ export declare const calculateMaxY: () => number;
45
+ /**
46
+ * Clamp a value between a min and max
47
+ */
48
+ export declare const clamp: (value: number, min: number, max: number) => number;
49
+ //# sourceMappingURL=EmbedButton.helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmbedButton.helpers.d.ts","sourceRoot":"","sources":["../../../../src/hooks/EmbedButton.helpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,eAAO,MAAe,YAAY,UAAU,aAAa,QAC/B,CAAC;AAE3B,eAAO,MAAM,iBAAiB;;;;CAIpB,CAAC;AAEX,eAAO,MAAM,SAAS;;;;;CAQZ,CAAC;AAEX,eAAO,MAAM,uBAAuB,UAAyB,CAAC;AAE9D,eAAO,MAAM,sBAAsB,QAAQ,CAAC;AAG5C,MAAM,WAAW,UAAU;IACzB,oBAAoB,CAAC,EAAE,YAAY,GAAG,cAAc,GAAG,MAAM,CAAC;IAC9D,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAID;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,GAAG,MAAM,GAAG,SAAS,KAAG,MAOjE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,SAAS,MAAM,KAAG,MAMhD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,OAAO,KAAG,MAM/C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,QAAO,MAGhC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,KAAK,GAAI,OAAO,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,KAAG,MAG/D,CAAC"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * @file EmbedButton.hooks.ts
3
+ * @description Custom hooks for the EmbedButton component
4
+ */
5
+ import type { ConfigData } from './EmbedButton.helpers';
6
+ /**
7
+ * Hook to fetch and manage agent configuration data
8
+ */
9
+ export declare const useConfigData: () => ConfigData | null;
10
+ /**
11
+ * Hook to track call duration when connected
12
+ */
13
+ export declare const useCallDuration: (connectionState: string) => {
14
+ callDuration: number;
15
+ resetDuration: () => void;
16
+ };
17
+ /**
18
+ * Hook to handle inactivity behavior (show_popup or auto_trigger)
19
+ */
20
+ interface UseInactivityBehaviorParams {
21
+ configData: ConfigData | null;
22
+ isOpen: boolean;
23
+ isLoading: boolean;
24
+ hasActiveToken: boolean;
25
+ onStartCall: () => Promise<void>;
26
+ }
27
+ export declare const useInactivityBehavior: ({ configData, isOpen, isLoading, hasActiveToken, onStartCall, }: UseInactivityBehaviorParams) => {
28
+ isAutoOpen: boolean;
29
+ setIsAutoOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
30
+ };
31
+ /**
32
+ * Hook to manage call lifecycle (start, end, mute)
33
+ */
34
+ interface UseCallManagementParams {
35
+ initializeVoiceAgent: () => Promise<void>;
36
+ endCall: () => Promise<void>;
37
+ muteMic: () => void;
38
+ unmuteMic: () => void;
39
+ isMicMuted: boolean;
40
+ resetDuration: () => void;
41
+ setIsOpen: (open: boolean) => void;
42
+ }
43
+ export declare const useCallManagement: ({ initializeVoiceAgent, endCall, muteMic, unmuteMic, isMicMuted, resetDuration, setIsOpen, }: UseCallManagementParams) => {
44
+ handleStartCall: () => Promise<void>;
45
+ handleEndCall: () => Promise<void>;
46
+ handleMicToggle: () => void;
47
+ };
48
+ export {};
49
+ //# sourceMappingURL=EmbedButton.hooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmbedButton.hooks.d.ts","sourceRoot":"","sources":["../../../../src/hooks/EmbedButton.hooks.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAIxD;;GAEG;AACH,eAAO,MAAM,aAAa,yBAiBzB,CAAC;AAGF;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,iBAAiB,MAAM;;;CAiCtD,CAAC;AAGF;;GAEG;AACH,UAAU,2BAA2B;IACnC,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IAC9B,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,OAAO,CAAC;IACxB,WAAW,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAClC;AAED,eAAO,MAAM,qBAAqB,GAAI,iEAMnC,2BAA2B;;;CAkD7B,CAAC;AAGF;;GAEG;AACH,UAAU,uBAAuB;IAC/B,oBAAoB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,SAAS,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACpC;AAED,eAAO,MAAM,iBAAiB,GAAI,8FAQ/B,uBAAuB;;;;CA0BzB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../../../../src/hooks/initialize.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,0BAA0B,CAAC;AAElC,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,QAAQ,GACT,EAAE,kBAAkB,GAAG,mBAAmB,CA0D1C"}
1
+ {"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../../../../src/hooks/initialize.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,0BAA0B,CAAC;AAMlC,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,QAAQ,GACT,EAAE,kBAAkB,GAAG,mBAAmB,CAgG1C"}
@@ -1,6 +1,6 @@
1
1
  export type UseInitializeProps = {
2
2
  apiKey: string;
3
- embedUrl: string;
3
+ embedUrl?: string;
4
4
  };
5
5
  export type UseInitializeReturn = {
6
6
  isInitialized: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"initialize.types.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/types/initialize.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,aAAa,EAAE,OAAO,CAAC;IACvB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,CAAC"}
1
+ {"version":3,"file":"initialize.types.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/types/initialize.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,aAAa,EAAE,OAAO,CAAC;IACvB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,CAAC"}
@@ -1,6 +1,7 @@
1
+ import EmbedProvider from './context/EmbedProvider';
1
2
  import { EmbedButton } from './components/Embed/EmbedButton';
2
3
  import { useInitialize } from './hooks/initialize';
3
- import Embed, { EventKeys } from './events/embed.event';
4
+ import Embed, { EventKeys, AgentEvent } from './events/embed.event';
4
5
  import type { RegisterRequest } from './api/types/embed.api.types';
5
6
  import type { UpdateDataRequest } from './api/types/embed.api.types';
6
7
  import type { TokenDetails } from './api/types/embed.api.types';
@@ -8,6 +9,7 @@ import type { UseInitializeProps } from './hooks/types/initialize.types';
8
9
  import type { UseVoiceAgentReturn } from './hooks/types/voiceAgent.types';
9
10
  import type { ApiResponse } from './api/types/embed.api.types';
10
11
  import { checkPermissions } from './utils/permision';
11
- export { EmbedButton, useInitialize, Embed, EventKeys as EmbedEventKeys, checkPermissions, };
12
- export type { UseInitializeProps, UseVoiceAgentReturn, ApiResponse, RegisterRequest, TokenDetails, UpdateDataRequest, };
12
+ import type { AgentConnectedData, AgentDisconnectedData, PopupMessageVisibleData } from './events/embed.event';
13
+ export { EmbedButton, EmbedProvider, useInitialize, Embed, EventKeys as EmbedEventKeys, AgentEvent, checkPermissions, };
14
+ export type { UseInitializeProps, UseVoiceAgentReturn, ApiResponse, RegisterRequest, TokenDetails, UpdateDataRequest, AgentConnectedData, AgentDisconnectedData, PopupMessageVisibleData, };
13
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,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,EACb,KAAK,EACL,SAAS,IAAI,cAAc,EAC3B,UAAU,EACV,gBAAgB,GACjB,CAAC;AAEF,YAAY,EACV,kBAAkB,EAClB,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,uBAAuB,GACxB,CAAC"}
@@ -36,7 +36,7 @@ export interface ApiResponse<T> {
36
36
  }
37
37
  export interface RegisterRequest {
38
38
  apiKey: string;
39
- embedUrl: string;
39
+ embedUrl?: string;
40
40
  }
41
41
  export interface TokenDetails {
42
42
  token: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.types.d.ts","sourceRoot":"","sources":["../../../src/index.types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,MAAM,CAAC,OAAO,UAAU,WAAW,IAAI,GAAG,CAAC,OAAO,CAAC;AAGnD,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,OAAO,CAAC;IACvB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC,oBAAoB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IAClC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EA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