@weave-apps/sdk 0.1.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.
@@ -0,0 +1,229 @@
1
+ /**
2
+ * Weave Base App
3
+ *
4
+ * Base class for all Weave apps. Provides common functionality and lifecycle methods.
5
+ * Third-party developers should extend this class instead of HTMLElement directly.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * // Define your settings and state types
10
+ * interface MyAppSettings {
11
+ * apiKey: string;
12
+ * endpoint: string;
13
+ * autoSave?: boolean;
14
+ * }
15
+ *
16
+ * interface MyAppState {
17
+ * count: number;
18
+ * isLoading: boolean;
19
+ * data: any[];
20
+ * }
21
+ *
22
+ * class MyApp extends WeaveBaseApp<MyAppSettings, MyAppState> {
23
+ * constructor() {
24
+ * super({
25
+ * id: 'my-app',
26
+ * name: 'My App',
27
+ * version: '1.0.0',
28
+ * category: 'utility',
29
+ * description: 'My custom app',
30
+ * author: 'Your Name',
31
+ * tags: ['custom']
32
+ * });
33
+ *
34
+ * // Settings are now type-safe!
35
+ * const apiKey = this.appSettings?.apiKey; // ✅ TypeScript knows this exists
36
+ *
37
+ * // Initialize state with proper typing
38
+ * this.state = {
39
+ * count: 0,
40
+ * isLoading: false,
41
+ * data: []
42
+ * };
43
+ * }
44
+ *
45
+ * render() {
46
+ * return `<div>My App Content</div>`;
47
+ * }
48
+ *
49
+ * setupEventListeners() {
50
+ * // setState is also type-safe
51
+ * this.setState({ count: this.state.count + 1 }); // ✅ Type-safe
52
+ * }
53
+ * }
54
+ *
55
+ * customElements.define('my-app', MyApp);
56
+ * ```
57
+ */
58
+ /**
59
+ * Base class for Weave apps
60
+ * @template TSettings - Type for app settings, defaults to an empty object
61
+ * @template TState - Type for app state, defaults to an empty object
62
+ */
63
+ export class WeaveBaseApp extends HTMLElement {
64
+ /**
65
+ * Creates a new Weave app
66
+ * @param appInfo - App metadata configuration
67
+ */
68
+ constructor(appInfo) {
69
+ super();
70
+ /** App-specific state (override in subclass) */
71
+ this.state = {};
72
+ // Validate required fields
73
+ if (!appInfo.id || !appInfo.name || !appInfo.version) {
74
+ throw new Error('WeaveBaseApp: id, name, and version are required');
75
+ }
76
+ this.appInfo = appInfo;
77
+ // Create shadow DOM for style isolation and store reference
78
+ this._shadowRoot = this.attachShadow({ mode: 'open' });
79
+ // Read UUID and settings from global registry (set by BackgroundAppManager before element creation)
80
+ // This allows the constructor to access both UUID and settings immediately
81
+ const registry = window.__weaveAppRegistry;
82
+ const tagName = this.tagName.toLowerCase();
83
+ const registryData = registry?.[tagName];
84
+ // Set app settings if available in registry
85
+ if (registryData?.settings) {
86
+ this.appSettings = registryData.settings;
87
+ }
88
+ // Set app UUID on the global API client so it's included in all requests
89
+ // This allows background services to make API calls without the app being open
90
+ if (window.weaveAPI) {
91
+ const appUuid = registryData?.uuid;
92
+ if (appUuid) {
93
+ // Create a new API client instance for THIS app
94
+ this.weaveAPI = new window.WeaveAPIClient();
95
+ this.weaveAPI.setAppId(appUuid);
96
+ }
97
+ else {
98
+ console.warn('⚠️ App UUID not found in registry - API calls may fail. App:', appInfo.id);
99
+ // Fallback to global API client (will have wrong app ID, but better than nothing)
100
+ this.weaveAPI = window.weaveAPI;
101
+ }
102
+ }
103
+ }
104
+ /**
105
+ * Get shadow root (override native property)
106
+ */
107
+ get shadowRoot() {
108
+ return this._shadowRoot;
109
+ }
110
+ /**
111
+ * Render method - must be implemented by subclass
112
+ * Should return HTML string or directly manipulate shadowRoot
113
+ */
114
+ render() {
115
+ // Default implementation - subclasses should override
116
+ }
117
+ /**
118
+ * Setup event listeners - optional override in subclass
119
+ */
120
+ setupEventListeners() {
121
+ // Default implementation - subclasses can override
122
+ }
123
+ /**
124
+ * Initialize background service
125
+ * Called by BackgroundAppManager after instantiation
126
+ */
127
+ initializeBackgroundService() {
128
+ if (this.onBackgroundService) {
129
+ this.onBackgroundService();
130
+ }
131
+ }
132
+ /**
133
+ * Handle URL change
134
+ * Called by BackgroundAppManager when URL changes
135
+ */
136
+ handleUrlChange(url) {
137
+ if (this.onUrlChange) {
138
+ this.onUrlChange(url);
139
+ }
140
+ }
141
+ /**
142
+ * Lifecycle: Called when element is added to DOM
143
+ * This happens when user opens the app in the drawer
144
+ */
145
+ connectedCallback() {
146
+ // Render the app UI
147
+ this.render();
148
+ // Setup event listeners for UI
149
+ this.setupEventListeners();
150
+ // Notify Weave Platform that app UI is ready
151
+ this.dispatchEvent(new CustomEvent('weave-app-ready', {
152
+ detail: {
153
+ appInfo: this.appInfo,
154
+ timestamp: new Date().toISOString()
155
+ },
156
+ bubbles: true,
157
+ composed: true
158
+ }));
159
+ }
160
+ /**
161
+ * Lifecycle: Called when element is removed from DOM
162
+ */
163
+ disconnectedCallback() {
164
+ this.cleanup();
165
+ }
166
+ /**
167
+ * Cleanup method - optional override in subclass
168
+ * Called when app is disconnected from DOM
169
+ */
170
+ cleanup() {
171
+ // Default implementation - subclasses can override
172
+ }
173
+ /**
174
+ * Get app configuration (for Weave Platform)
175
+ */
176
+ getAppInfo() {
177
+ return this.appInfo;
178
+ }
179
+ /**
180
+ * Get current app state (for Weave Platform)
181
+ */
182
+ getAppState() {
183
+ return {
184
+ ...this.state,
185
+ lastUpdated: new Date().toISOString()
186
+ };
187
+ }
188
+ /**
189
+ * Set app configuration (for Weave Platform)
190
+ * Override this method to handle configuration updates
191
+ */
192
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
193
+ setAppConfig(_config) {
194
+ // Default implementation - subclasses can override
195
+ }
196
+ /**
197
+ * Helper: Update app state
198
+ */
199
+ setState(updates) {
200
+ this.state = { ...this.state, ...updates };
201
+ }
202
+ /**
203
+ * Helper: Render HTML into shadow root
204
+ */
205
+ renderHTML(html) {
206
+ if (this._shadowRoot) {
207
+ this._shadowRoot.innerHTML = html;
208
+ }
209
+ else {
210
+ console.error('❌ No shadow root available!');
211
+ }
212
+ }
213
+ /**
214
+ * Helper: Query element in shadow root
215
+ */
216
+ query(selector) {
217
+ return this._shadowRoot?.querySelector(selector) || null;
218
+ }
219
+ /**
220
+ * Helper: Query all elements in shadow root
221
+ */
222
+ queryAll(selector) {
223
+ return this._shadowRoot?.querySelectorAll(selector) || [];
224
+ }
225
+ }
226
+ // Export for global usage
227
+ if (typeof window !== 'undefined') {
228
+ window.WeaveBaseApp = WeaveBaseApp;
229
+ }
@@ -0,0 +1,433 @@
1
+ /**
2
+ * Weave DOM API
3
+ *
4
+ * Client-side API for iframe apps to interact with the parent page DOM
5
+ * through the secure DOM Bridge in the content script.
6
+ */
7
+ /**
8
+ * Insert position for HTML insertion
9
+ */
10
+ export type InsertPosition = 'beforebegin' | 'afterbegin' | 'beforeend' | 'afterend';
11
+ /**
12
+ * Serialized element snapshot from parent page
13
+ *
14
+ * IMPORTANT: This interface must be kept in sync with:
15
+ * /frontends/browser-extensions/chrome/src/content/modules/DOMBridge.types.ts
16
+ *
17
+ * We cannot import directly due to different build contexts (browser extension vs iframe bundle).
18
+ * Any changes to ElementSnapshot in DOMBridge.types.ts MUST be reflected here.
19
+ */
20
+ export interface ElementSnapshot {
21
+ tagName: string;
22
+ id: string;
23
+ className: string;
24
+ textContent: string;
25
+ outerHTML: string;
26
+ attributes: Record<string, string>;
27
+ value?: string;
28
+ exists: boolean;
29
+ }
30
+ /**
31
+ * Form field data
32
+ */
33
+ export interface FormFieldData {
34
+ name: string;
35
+ id: string;
36
+ type: string;
37
+ value: string | string[];
38
+ label: string;
39
+ placeholder: string;
40
+ required: boolean;
41
+ disabled: boolean;
42
+ readonly: boolean;
43
+ pattern: string;
44
+ min: string;
45
+ max: string;
46
+ minLength: number;
47
+ maxLength: number;
48
+ checked?: boolean;
49
+ options?: Array<{
50
+ value: string;
51
+ text: string;
52
+ selected: boolean;
53
+ }>;
54
+ }
55
+ /**
56
+ * Complete form data
57
+ */
58
+ export interface FormData {
59
+ formId: string;
60
+ formName: string;
61
+ formAction: string;
62
+ formMethod: string;
63
+ fields: FormFieldData[];
64
+ }
65
+ /**
66
+ * Form click event callback
67
+ */
68
+ export type FormClickCallback = (data: {
69
+ formData: FormData;
70
+ clickedElement: {
71
+ tagName: string;
72
+ name: string;
73
+ id: string;
74
+ type: string;
75
+ };
76
+ }) => void;
77
+ /**
78
+ * Workflow saved event callback
79
+ */
80
+ export type WorkflowSavedCallback = (workflow: {
81
+ name: string;
82
+ startUrl: string;
83
+ actions: any[];
84
+ }) => void;
85
+ /**
86
+ * Trigger saved event callback
87
+ */
88
+ export type TriggerSavedCallback = (trigger: {
89
+ name: string;
90
+ url: string;
91
+ events: any[];
92
+ dataCapture: any;
93
+ }) => void;
94
+ /**
95
+ * Element click event callback (for injected elements)
96
+ */
97
+ export type ElementClickCallback = (data: {
98
+ elementId: string;
99
+ event: {
100
+ clientX: number;
101
+ clientY: number;
102
+ target: {
103
+ tagName: string;
104
+ id: string;
105
+ className: string;
106
+ };
107
+ };
108
+ }) => void;
109
+ /**
110
+ * Element selector click event callback (for element click listeners)
111
+ */
112
+ export type ElementSelectorClickCallback = (data: {
113
+ element: ElementSnapshot;
114
+ event: {
115
+ clientX: number;
116
+ clientY: number;
117
+ timestamp: number;
118
+ };
119
+ }) => void;
120
+ /**
121
+ * Element change event callback (for element watchers)
122
+ */
123
+ export type ElementChangeCallback = (data: {
124
+ changeType: 'attribute' | 'removed' | 'childList';
125
+ element: ElementSnapshot;
126
+ attributeName?: string;
127
+ attributeValue?: string;
128
+ }) => void;
129
+ /**
130
+ * Weave DOM API
131
+ * Provides methods for iframe apps to interact with parent page DOM
132
+ */
133
+ export declare class WeaveDOMAPI {
134
+ private pendingRequests;
135
+ private messageListener;
136
+ private requestCounter;
137
+ private timeout;
138
+ private formClickCallback;
139
+ private workflowSavedCallback;
140
+ private triggerSavedCallback;
141
+ private elementClickCallbacks;
142
+ private elementSelectorClickCallbacks;
143
+ private elementChangeCallbacks;
144
+ private elementIdCounter;
145
+ private watcherIdCounter;
146
+ constructor();
147
+ /**
148
+ * Initialize the API and start listening for responses
149
+ */
150
+ private initialize;
151
+ /**
152
+ * Cleanup
153
+ */
154
+ destroy(): void;
155
+ /**
156
+ * Handle response from content script
157
+ */
158
+ private handleResponse;
159
+ /**
160
+ * Send request to content script
161
+ */
162
+ private sendRequest;
163
+ /**
164
+ * Query a single element from parent page
165
+ */
166
+ query(selector: string): Promise<ElementSnapshot>;
167
+ /**
168
+ * Query all matching elements from parent page
169
+ */
170
+ queryAll(selector: string): Promise<ElementSnapshot[]>;
171
+ /**
172
+ * Get text content of an element
173
+ */
174
+ getText(selector: string): Promise<string>;
175
+ /**
176
+ * Get attribute value of an element
177
+ */
178
+ getAttribute(selector: string, attribute: string): Promise<string | null>;
179
+ /**
180
+ * Get value of an input element
181
+ */
182
+ getValue(selector: string): Promise<string>;
183
+ /**
184
+ * Check if element has a class
185
+ */
186
+ hasClass(selector: string, className: string): Promise<boolean>;
187
+ /**
188
+ * Get the current page URL
189
+ * Returns the parent page URL (not the iframe URL)
190
+ * @returns Promise with the current page URL
191
+ */
192
+ getPageUrl(): Promise<string>;
193
+ /**
194
+ * Set text content of an element
195
+ */
196
+ setText(selector: string, text: string): Promise<void>;
197
+ /**
198
+ * Set attribute value of an element
199
+ */
200
+ setAttribute(selector: string, attribute: string, value: string): Promise<void>;
201
+ /**
202
+ * Set value of an input element
203
+ */
204
+ setValue(selector: string, value: string): Promise<void>;
205
+ /**
206
+ * Add a class to an element
207
+ */
208
+ addClass(selector: string, className: string): Promise<void>;
209
+ /**
210
+ * Remove a class from an element
211
+ */
212
+ removeClass(selector: string, className: string): Promise<void>;
213
+ /**
214
+ * Toggle a class on an element
215
+ */
216
+ toggleClass(selector: string, className: string): Promise<boolean>;
217
+ /**
218
+ * Set a CSS style property on an element
219
+ */
220
+ setStyle(selector: string, property: string, value: string): Promise<void>;
221
+ /**
222
+ * Insert HTML relative to an element
223
+ */
224
+ insertHTML(selector: string, position: InsertPosition, html: string): Promise<void>;
225
+ /**
226
+ * Remove an element from the DOM
227
+ */
228
+ removeElement(selector: string): Promise<void>;
229
+ /**
230
+ * Click an element on the parent page
231
+ *
232
+ * @param selector - CSS selector for the element to click
233
+ * @returns Promise that resolves when the click is complete
234
+ *
235
+ * @example
236
+ * // Click a button
237
+ * await weaveDOM.clickElement('button#submit');
238
+ *
239
+ * // Click a link
240
+ * await weaveDOM.clickElement('a.nav-item[href="/dashboard"]');
241
+ */
242
+ clickElement(selector: string): Promise<void>;
243
+ /**
244
+ * Get form data from a form or an element inside a form
245
+ * @param selector - CSS selector for the form or an element inside the form
246
+ * @returns Promise with complete form data including all fields
247
+ */
248
+ getFormData(selector: string): Promise<FormData>;
249
+ /**
250
+ * Start listening for clicks on form elements
251
+ * When a form element is clicked, the callback will be invoked with the form data
252
+ * @param callback - Function to call when a form element is clicked
253
+ */
254
+ startFormClickListener(callback: FormClickCallback): Promise<void>;
255
+ /**
256
+ * Stop listening for clicks on form elements
257
+ */
258
+ stopFormClickListener(): Promise<void>;
259
+ /**
260
+ * Start listening for clicks on elements matching a CSS selector
261
+ * When an element is clicked, the callback will be invoked with element data
262
+ *
263
+ * @param selector - CSS selector for elements to listen to (e.g., 'div.sortable-item[role="button"]')
264
+ * @param callback - Function to call when a matching element is clicked
265
+ * @param options - Optional configuration
266
+ * @param options.listenerId - Unique ID for this listener (auto-generated if not provided)
267
+ * @returns Promise<string> - The listener ID (for cleanup with stopElementClickListener)
268
+ *
269
+ * @example
270
+ * // Listen to tab buttons
271
+ * const listenerId = await weaveDOM.startElementClickListener(
272
+ * 'div.sortable-item[role="button"]',
273
+ * (data) => {
274
+ * console.log('Tab clicked:', data.element.textContent);
275
+ * console.log('Element:', data.element);
276
+ * }
277
+ * );
278
+ *
279
+ * // Later, stop listening
280
+ * await weaveDOM.stopElementClickListener(listenerId);
281
+ */
282
+ startElementClickListener(selector: string, callback: ElementSelectorClickCallback, options?: {
283
+ listenerId?: string;
284
+ }): Promise<string>;
285
+ /**
286
+ * Stop listening for clicks on elements
287
+ *
288
+ * @param listenerId - The ID of the listener to stop (returned from startElementClickListener)
289
+ *
290
+ * @example
291
+ * const listenerId = await weaveDOM.startElementClickListener('button', callback);
292
+ * // ... later ...
293
+ * await weaveDOM.stopElementClickListener(listenerId);
294
+ */
295
+ stopElementClickListener(listenerId: string): Promise<void>;
296
+ /**
297
+ * Set the value of a form field
298
+ * Handles all input types (text, checkbox, radio, select, textarea, etc.)
299
+ * Automatically triggers validation events
300
+ *
301
+ * @param selector - CSS selector for the form field
302
+ * @param value - Value to set (string for text inputs, boolean for checkboxes, array for multi-selects)
303
+ * @param scrollIntoView - Optional: if true, scrolls element to center of viewport before setting value (default: false)
304
+ *
305
+ * @example
306
+ * // Text input
307
+ * await weaveDOM.setFormFieldValue('input[name="email"]', 'user@example.com');
308
+ *
309
+ * // Checkbox with scroll
310
+ * await weaveDOM.setFormFieldValue('input[name="terms"]', true, true);
311
+ *
312
+ * // Radio button (set to the value of the radio to select)
313
+ * await weaveDOM.setFormFieldValue('input[name="gender"][value="female"]', 'female');
314
+ *
315
+ * // Select
316
+ * await weaveDOM.setFormFieldValue('select[name="country"]', 'US');
317
+ *
318
+ * // Multi-select with scroll to make it visible
319
+ * await weaveDOM.setFormFieldValue('select[name="interests"]', ['sports', 'music'], true);
320
+ */
321
+ setFormFieldValue(selector: string, value: string | string[] | boolean, scrollIntoView?: boolean): Promise<void>;
322
+ /**
323
+ * Register a callback for when a workflow is saved
324
+ * @param callback - Function to call when a workflow is saved from the content script
325
+ */
326
+ onWorkflowSaved(callback: WorkflowSavedCallback): void;
327
+ /**
328
+ * Remove the workflow saved callback
329
+ */
330
+ offWorkflowSaved(): void;
331
+ /**
332
+ * Register a callback for when a trigger is saved
333
+ * @param callback - Function to call when a trigger is saved from the content script
334
+ */
335
+ onTriggerSaved(callback: TriggerSavedCallback): void;
336
+ /**
337
+ * Remove the trigger saved callback
338
+ */
339
+ offTriggerSaved(): void;
340
+ /**
341
+ * Inject an element onto the parent page with optional click event listener
342
+ *
343
+ * @param targetSelector - CSS selector for the element to inject relative to
344
+ * @param position - Position relative to target ('beforebegin', 'afterbegin', 'beforeend', 'afterend')
345
+ * @param html - HTML string to inject (will be sanitized)
346
+ * @param options - Optional configuration
347
+ * @param options.onClick - Callback function to invoke when element is clicked
348
+ * @param options.elementId - Custom element ID (auto-generated if not provided)
349
+ * @returns Promise with the element ID
350
+ *
351
+ * @example
352
+ * // Inject a button with click handler
353
+ * const elementId = await weaveDOM.injectElement(
354
+ * 'body',
355
+ * 'beforeend',
356
+ * '<button class="my-button">Click Me</button>',
357
+ * {
358
+ * onClick: (data) => {
359
+ * console.log('Button clicked!', data);
360
+ * }
361
+ * }
362
+ * );
363
+ *
364
+ * // Later, remove the element
365
+ * await weaveDOM.removeInjectedElement(elementId);
366
+ */
367
+ injectElement(targetSelector: string, position: InsertPosition, html: string, options?: {
368
+ onClick?: ElementClickCallback;
369
+ elementId?: string;
370
+ }): Promise<string>;
371
+ /**
372
+ * Remove an injected element from the parent page
373
+ *
374
+ * @param elementId - ID of the element to remove (returned from injectElement)
375
+ *
376
+ * @example
377
+ * await weaveDOM.removeInjectedElement('weave-injected-1');
378
+ */
379
+ removeInjectedElement(elementId: string): Promise<void>;
380
+ /**
381
+ * Watch an element for changes (attributes, removal, children)
382
+ *
383
+ * Sets up MutationObservers to monitor:
384
+ * - Attribute changes on the element
385
+ * - Element removal from DOM
386
+ * - Child node changes (optional)
387
+ *
388
+ * @param selector - CSS selector for the element to watch
389
+ * @param callback - Function to call when element changes
390
+ * @param options - Optional configuration
391
+ * @param options.watchAttributes - Watch for attribute changes (default: true)
392
+ * @param options.watchChildren - Watch for child node changes (default: false)
393
+ * @param options.attributeFilter - Optional array of specific attributes to watch
394
+ * @returns Promise with the watcher ID (use to stop watching)
395
+ *
396
+ * @example
397
+ * // Watch for attribute changes
398
+ * const watcherId = await weaveDOM.watchElement(
399
+ * '#my-element',
400
+ * (data) => {
401
+ * if (data.changeType === 'attribute') {
402
+ * console.log(`Attribute ${data.attributeName} changed to: ${data.attributeValue}`);
403
+ * } else if (data.changeType === 'removed') {
404
+ * console.log('Element was removed from DOM');
405
+ * }
406
+ * },
407
+ * {
408
+ * watchAttributes: true,
409
+ * attributeFilter: ['class', 'data-status'] // Only watch specific attributes
410
+ * }
411
+ * );
412
+ *
413
+ * // Later, stop watching
414
+ * await weaveDOM.unwatchElement(watcherId);
415
+ */
416
+ watchElement(selector: string, callback: ElementChangeCallback, options?: {
417
+ watchAttributes?: boolean;
418
+ watchChildren?: boolean;
419
+ attributeFilter?: string[];
420
+ }): Promise<string>;
421
+ /**
422
+ * Stop watching an element
423
+ *
424
+ * @param watcherId - ID of the watcher to stop (returned from watchElement)
425
+ *
426
+ * @example
427
+ * await weaveDOM.unwatchElement('weave-watcher-1');
428
+ */
429
+ unwatchElement(watcherId: string): Promise<void>;
430
+ }
431
+ declare const _default: WeaveDOMAPI;
432
+ export default _default;
433
+ //# sourceMappingURL=WeaveDOMAPI.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WeaveDOMAPI.d.ts","sourceRoot":"","sources":["../src/WeaveDOMAPI.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAkDH;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,YAAY,GAAG,WAAW,GAAG,UAAU,CAAC;AAErF;;;;;;;;GAQG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,GAAG,MAAM,EA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