@arcadiasol/game-sdk 1.0.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,636 @@
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
+ typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ArcadiaGameSDK = {}));
5
+ })(this, (function (exports) { 'use strict';
6
+
7
+ /**
8
+ * Message types for postMessage communication
9
+ */
10
+ var MessageType;
11
+ (function (MessageType) {
12
+ // SDK → Parent
13
+ MessageType["INIT_REQUEST"] = "INIT_REQUEST";
14
+ MessageType["GET_WALLET_ADDRESS"] = "GET_WALLET_ADDRESS";
15
+ MessageType["PAYMENT_REQUEST"] = "PAYMENT_REQUEST";
16
+ MessageType["GAME_READY"] = "GAME_READY";
17
+ // Parent → SDK
18
+ MessageType["INIT"] = "INIT";
19
+ MessageType["WALLET_ADDRESS_RESPONSE"] = "WALLET_ADDRESS_RESPONSE";
20
+ MessageType["WALLET_UPDATE"] = "WALLET_UPDATE";
21
+ MessageType["PAYMENT_RESPONSE"] = "PAYMENT_RESPONSE";
22
+ })(MessageType || (MessageType = {}));
23
+
24
+ /**
25
+ * Base error class for all SDK errors
26
+ */
27
+ class ArcadiaSDKError extends Error {
28
+ constructor(message, code) {
29
+ super(message);
30
+ this.code = code;
31
+ this.name = 'ArcadiaSDKError';
32
+ Object.setPrototypeOf(this, ArcadiaSDKError.prototype);
33
+ }
34
+ }
35
+ /**
36
+ * Error thrown when wallet is not connected
37
+ */
38
+ class WalletNotConnectedError extends ArcadiaSDKError {
39
+ constructor(message = 'Wallet is not connected. Please connect your wallet in Arcadia.') {
40
+ super(message, 'WALLET_NOT_CONNECTED');
41
+ this.name = 'WalletNotConnectedError';
42
+ Object.setPrototypeOf(this, WalletNotConnectedError.prototype);
43
+ }
44
+ }
45
+ /**
46
+ * Error thrown when payment fails
47
+ */
48
+ class PaymentFailedError extends ArcadiaSDKError {
49
+ constructor(message = 'Payment failed', txSignature) {
50
+ super(message, 'PAYMENT_FAILED');
51
+ this.txSignature = txSignature;
52
+ this.name = 'PaymentFailedError';
53
+ Object.setPrototypeOf(this, PaymentFailedError.prototype);
54
+ }
55
+ }
56
+ /**
57
+ * Error thrown when request times out
58
+ */
59
+ class TimeoutError extends ArcadiaSDKError {
60
+ constructor(message = 'Request timed out. Please try again.') {
61
+ super(message, 'TIMEOUT');
62
+ this.name = 'TimeoutError';
63
+ Object.setPrototypeOf(this, TimeoutError.prototype);
64
+ }
65
+ }
66
+ /**
67
+ * Error thrown when SDK configuration is invalid
68
+ */
69
+ class InvalidConfigError extends ArcadiaSDKError {
70
+ constructor(message = 'Invalid SDK configuration') {
71
+ super(message, 'INVALID_CONFIG');
72
+ this.name = 'InvalidConfigError';
73
+ Object.setPrototypeOf(this, InvalidConfigError.prototype);
74
+ }
75
+ }
76
+ /**
77
+ * Error thrown when SDK is not running in iframe
78
+ */
79
+ class NotInIframeError extends ArcadiaSDKError {
80
+ constructor(message = 'This function only works when the game is running in an Arcadia iframe') {
81
+ super(message, 'NOT_IN_IFRAME');
82
+ this.name = 'NotInIframeError';
83
+ Object.setPrototypeOf(this, NotInIframeError.prototype);
84
+ }
85
+ }
86
+ /**
87
+ * Error thrown when invalid amount is provided
88
+ */
89
+ class InvalidAmountError extends ArcadiaSDKError {
90
+ constructor(message = 'Invalid payment amount. Amount must be greater than 0.') {
91
+ super(message, 'INVALID_AMOUNT');
92
+ this.name = 'InvalidAmountError';
93
+ Object.setPrototypeOf(this, InvalidAmountError.prototype);
94
+ }
95
+ }
96
+ /**
97
+ * Error thrown when invalid token is provided
98
+ */
99
+ class InvalidTokenError extends ArcadiaSDKError {
100
+ constructor(message = "Invalid token. Must be 'SOL' or 'USDC'.") {
101
+ super(message, 'INVALID_TOKEN');
102
+ this.name = 'InvalidTokenError';
103
+ Object.setPrototypeOf(this, InvalidTokenError.prototype);
104
+ }
105
+ }
106
+
107
+ /**
108
+ * Handles postMessage communication with parent window
109
+ */
110
+ class MessageHandler {
111
+ constructor(parentOrigin = '*', timeout = 30000) {
112
+ this.messageId = 0;
113
+ this.pendingRequests = new Map();
114
+ this.messageListener = null;
115
+ this.parentOrigin = parentOrigin;
116
+ this.timeout = timeout;
117
+ }
118
+ /**
119
+ * Initialize message listener
120
+ */
121
+ init() {
122
+ if (this.messageListener) {
123
+ return; // Already initialized
124
+ }
125
+ this.messageListener = (event) => {
126
+ this.handleMessage(event);
127
+ };
128
+ window.addEventListener('message', this.messageListener);
129
+ }
130
+ /**
131
+ * Cleanup message listener
132
+ */
133
+ destroy() {
134
+ if (this.messageListener) {
135
+ window.removeEventListener('message', this.messageListener);
136
+ this.messageListener = null;
137
+ }
138
+ // Clear all pending requests
139
+ this.pendingRequests.forEach((request) => {
140
+ clearTimeout(request.timeout);
141
+ request.reject(new Error('Message handler destroyed'));
142
+ });
143
+ this.pendingRequests.clear();
144
+ }
145
+ /**
146
+ * Send message to parent window and wait for response
147
+ */
148
+ sendMessage(type, payload) {
149
+ return new Promise((resolve, reject) => {
150
+ const id = ++this.messageId;
151
+ // Set up timeout
152
+ const timeout = setTimeout(() => {
153
+ this.pendingRequests.delete(id);
154
+ reject(new TimeoutError(`Request ${type} timed out after ${this.timeout}ms`));
155
+ }, this.timeout);
156
+ // Store request
157
+ this.pendingRequests.set(id, {
158
+ resolve: (value) => {
159
+ clearTimeout(timeout);
160
+ resolve(value);
161
+ },
162
+ reject: (error) => {
163
+ clearTimeout(timeout);
164
+ reject(error);
165
+ },
166
+ timeout,
167
+ });
168
+ // Send message to parent
169
+ const message = {
170
+ type,
171
+ id,
172
+ payload,
173
+ };
174
+ if (window.parent) {
175
+ window.parent.postMessage(message, this.parentOrigin);
176
+ }
177
+ else {
178
+ clearTimeout(timeout);
179
+ this.pendingRequests.delete(id);
180
+ reject(new Error('No parent window found'));
181
+ }
182
+ });
183
+ }
184
+ /**
185
+ * Handle incoming messages from parent
186
+ */
187
+ handleMessage(event) {
188
+ // Validate origin if specified
189
+ if (this.parentOrigin !== '*' && event.origin !== this.parentOrigin) {
190
+ return; // Ignore messages from unauthorized origins
191
+ }
192
+ const message = event.data;
193
+ // Handle response messages (have ID)
194
+ if (message.id !== undefined) {
195
+ const request = this.pendingRequests.get(message.id);
196
+ if (request) {
197
+ this.pendingRequests.delete(message.id);
198
+ if (message.type === MessageType.PAYMENT_RESPONSE) {
199
+ const response = message.payload;
200
+ if (response.success) {
201
+ request.resolve(response);
202
+ }
203
+ else {
204
+ request.reject(new Error(response.error || 'Payment failed'));
205
+ }
206
+ }
207
+ else if (message.type === MessageType.WALLET_ADDRESS_RESPONSE) {
208
+ request.resolve(message.payload);
209
+ }
210
+ else if (message.type === MessageType.INIT) {
211
+ request.resolve(message.payload);
212
+ }
213
+ else {
214
+ // Generic response - resolve with payload
215
+ request.resolve(message.payload);
216
+ }
217
+ }
218
+ }
219
+ }
220
+ /**
221
+ * Send one-way message (no response expected)
222
+ */
223
+ sendOneWay(type, payload) {
224
+ const message = {
225
+ type,
226
+ payload,
227
+ };
228
+ if (window.parent) {
229
+ window.parent.postMessage(message, this.parentOrigin);
230
+ }
231
+ }
232
+ }
233
+
234
+ /**
235
+ * Wallet address management
236
+ */
237
+ class WalletManager {
238
+ constructor(messageHandler, isIframe) {
239
+ this.walletAddress = null;
240
+ this.walletConnected = false;
241
+ this.walletChangeCallbacks = [];
242
+ this.messageHandler = messageHandler;
243
+ this.isIframe = isIframe;
244
+ }
245
+ /**
246
+ * Get wallet address from parent window
247
+ */
248
+ async getWalletAddress() {
249
+ if (!this.isIframe) {
250
+ throw new NotInIframeError();
251
+ }
252
+ try {
253
+ const response = await this.messageHandler.sendMessage(MessageType.GET_WALLET_ADDRESS);
254
+ this.walletAddress = response.walletAddress;
255
+ this.walletConnected = response.connected;
256
+ return this.walletAddress;
257
+ }
258
+ catch (error) {
259
+ // If request fails, assume wallet not connected
260
+ this.walletAddress = null;
261
+ this.walletConnected = false;
262
+ return null;
263
+ }
264
+ }
265
+ /**
266
+ * Check if wallet is connected
267
+ */
268
+ async isWalletConnected() {
269
+ if (!this.isIframe) {
270
+ return false;
271
+ }
272
+ // If we have cached address, return true
273
+ if (this.walletAddress) {
274
+ return true;
275
+ }
276
+ // Otherwise, fetch from parent
277
+ const address = await this.getWalletAddress();
278
+ return address !== null;
279
+ }
280
+ /**
281
+ * Listen for wallet connection changes
282
+ */
283
+ onWalletChange(callback) {
284
+ this.walletChangeCallbacks.push(callback);
285
+ }
286
+ /**
287
+ * Remove wallet change listener
288
+ */
289
+ offWalletChange(callback) {
290
+ const index = this.walletChangeCallbacks.indexOf(callback);
291
+ if (index > -1) {
292
+ this.walletChangeCallbacks.splice(index, 1);
293
+ }
294
+ }
295
+ /**
296
+ * Update wallet status (called by SDK when receiving WALLET_UPDATE message)
297
+ */
298
+ updateWalletStatus(walletInfo) {
299
+ const oldAddress = this.walletAddress;
300
+ const oldConnected = this.walletConnected;
301
+ this.walletAddress = walletInfo.address;
302
+ this.walletConnected = walletInfo.connected;
303
+ // Notify callbacks if status changed
304
+ if (oldAddress !== this.walletAddress || oldConnected !== this.walletConnected) {
305
+ this.walletChangeCallbacks.forEach((callback) => {
306
+ try {
307
+ callback(this.walletConnected, this.walletAddress);
308
+ }
309
+ catch (error) {
310
+ console.error('Error in wallet change callback:', error);
311
+ }
312
+ });
313
+ }
314
+ }
315
+ /**
316
+ * Get current cached wallet address (without fetching)
317
+ */
318
+ getCachedWalletAddress() {
319
+ return this.walletAddress;
320
+ }
321
+ /**
322
+ * Get current cached connection status (without fetching)
323
+ */
324
+ getCachedConnectionStatus() {
325
+ return this.walletConnected;
326
+ }
327
+ /**
328
+ * Clear cached wallet data
329
+ */
330
+ clearCache() {
331
+ this.walletAddress = null;
332
+ this.walletConnected = false;
333
+ }
334
+ }
335
+
336
+ /**
337
+ * Payment processing
338
+ */
339
+ class PaymentManager {
340
+ constructor(gameId, isIframe, messageHandler, walletManager) {
341
+ this.gameId = gameId;
342
+ this.isIframe = isIframe;
343
+ this.messageHandler = messageHandler;
344
+ this.walletManager = walletManager;
345
+ }
346
+ /**
347
+ * Pay to play - one-time payment to access game
348
+ */
349
+ async payToPlay(amount, token) {
350
+ this.validatePaymentParams(amount, token);
351
+ if (!this.isIframe) {
352
+ throw new NotInIframeError('payToPlay only works when the game is running in an Arcadia iframe');
353
+ }
354
+ // Check wallet connection
355
+ const isConnected = await this.walletManager.isWalletConnected();
356
+ if (!isConnected) {
357
+ throw new WalletNotConnectedError();
358
+ }
359
+ const request = {
360
+ amount,
361
+ token,
362
+ type: 'pay_to_play',
363
+ gameId: this.gameId,
364
+ };
365
+ try {
366
+ const response = await this.messageHandler.sendMessage(MessageType.PAYMENT_REQUEST, request);
367
+ if (!response.success) {
368
+ throw new PaymentFailedError(response.error || 'Payment failed', response.txSignature);
369
+ }
370
+ if (!response.txSignature) {
371
+ throw new PaymentFailedError('Payment succeeded but no transaction signature received');
372
+ }
373
+ if (!response.amount || !response.token || !response.timestamp) {
374
+ throw new PaymentFailedError('Payment succeeded but incomplete payment details received');
375
+ }
376
+ return {
377
+ success: true,
378
+ txSignature: response.txSignature,
379
+ amount: response.amount,
380
+ token: response.token,
381
+ timestamp: response.timestamp,
382
+ purchaseId: response.purchaseId,
383
+ platformFee: response.platformFee,
384
+ developerAmount: response.developerAmount,
385
+ };
386
+ }
387
+ catch (error) {
388
+ if (error instanceof PaymentFailedError || error instanceof WalletNotConnectedError) {
389
+ throw error;
390
+ }
391
+ throw new PaymentFailedError(error instanceof Error ? error.message : 'Payment failed');
392
+ }
393
+ }
394
+ /**
395
+ * Purchase in-game item
396
+ */
397
+ async purchaseItem(itemId, amount, token) {
398
+ this.validatePaymentParams(amount, token);
399
+ if (!itemId || typeof itemId !== 'string' || itemId.trim().length === 0) {
400
+ throw new Error('Item ID is required and must be a non-empty string');
401
+ }
402
+ if (!this.isIframe) {
403
+ throw new NotInIframeError('purchaseItem only works when the game is running in an Arcadia iframe');
404
+ }
405
+ // Check wallet connection
406
+ const isConnected = await this.walletManager.isWalletConnected();
407
+ if (!isConnected) {
408
+ throw new WalletNotConnectedError();
409
+ }
410
+ const request = {
411
+ amount,
412
+ token,
413
+ type: 'in_game_purchase',
414
+ gameId: this.gameId,
415
+ itemId: itemId.trim(),
416
+ };
417
+ try {
418
+ const response = await this.messageHandler.sendMessage(MessageType.PAYMENT_REQUEST, request);
419
+ if (!response.success) {
420
+ throw new PaymentFailedError(response.error || 'Purchase failed', response.txSignature);
421
+ }
422
+ if (!response.txSignature) {
423
+ throw new PaymentFailedError('Purchase succeeded but no transaction signature received');
424
+ }
425
+ if (!response.amount || !response.token || !response.timestamp) {
426
+ throw new PaymentFailedError('Purchase succeeded but incomplete payment details received');
427
+ }
428
+ return {
429
+ success: true,
430
+ txSignature: response.txSignature,
431
+ amount: response.amount,
432
+ token: response.token,
433
+ timestamp: response.timestamp,
434
+ purchaseId: response.purchaseId,
435
+ platformFee: response.platformFee,
436
+ developerAmount: response.developerAmount,
437
+ };
438
+ }
439
+ catch (error) {
440
+ if (error instanceof PaymentFailedError || error instanceof WalletNotConnectedError) {
441
+ throw error;
442
+ }
443
+ throw new PaymentFailedError(error instanceof Error ? error.message : 'Purchase failed');
444
+ }
445
+ }
446
+ /**
447
+ * Validate payment parameters
448
+ */
449
+ validatePaymentParams(amount, token) {
450
+ if (typeof amount !== 'number' || isNaN(amount) || amount <= 0) {
451
+ throw new InvalidAmountError();
452
+ }
453
+ if (token !== 'SOL' && token !== 'USDC') {
454
+ throw new InvalidTokenError();
455
+ }
456
+ }
457
+ }
458
+
459
+ /**
460
+ * Main Arcadia Game SDK class
461
+ */
462
+ class ArcadiaSDK {
463
+ /**
464
+ * Create new SDK instance
465
+ */
466
+ constructor(config) {
467
+ this.initialized = false;
468
+ // Validate config
469
+ if (!config || !config.gameId || typeof config.gameId !== 'string' || config.gameId.trim().length === 0) {
470
+ throw new InvalidConfigError('gameId is required and must be a non-empty string');
471
+ }
472
+ this.config = {
473
+ gameId: config.gameId.trim(),
474
+ parentOrigin: config.parentOrigin || '*',
475
+ timeout: config.timeout || 30000,
476
+ };
477
+ // Detect iframe environment
478
+ this.isIframe = typeof window !== 'undefined' && window.self !== window.top;
479
+ // Initialize message handler
480
+ this.messageHandler = new MessageHandler(this.config.parentOrigin, this.config.timeout);
481
+ // Initialize managers
482
+ this.walletManager = new WalletManager(this.messageHandler, this.isIframe);
483
+ this.paymentManager = new PaymentManager(this.config.gameId, this.isIframe, this.messageHandler, this.walletManager);
484
+ // Set up message listener if in iframe
485
+ if (this.isIframe) {
486
+ this.messageHandler.init();
487
+ this.setupMessageListener();
488
+ }
489
+ }
490
+ /**
491
+ * Initialize SDK and request initialization data from parent
492
+ */
493
+ async init() {
494
+ if (this.initialized) {
495
+ return; // Already initialized
496
+ }
497
+ if (!this.isIframe) {
498
+ // Not in iframe - can't initialize
499
+ this.initialized = true;
500
+ return;
501
+ }
502
+ try {
503
+ // Request initialization from parent
504
+ const initData = await this.messageHandler.sendMessage(MessageType.INIT_REQUEST);
505
+ // Update wallet status from init data
506
+ if (initData.wallet) {
507
+ this.walletManager.updateWalletStatus(initData.wallet);
508
+ }
509
+ // Notify parent that game is ready
510
+ this.messageHandler.sendOneWay(MessageType.GAME_READY);
511
+ this.initialized = true;
512
+ }
513
+ catch (error) {
514
+ // Initialization failed, but SDK can still be used
515
+ // Wallet functions will fetch on demand
516
+ this.initialized = true;
517
+ console.warn('SDK initialization failed:', error);
518
+ }
519
+ }
520
+ /**
521
+ * Get wallet address - use this as user identifier
522
+ * Games should link all save data to this wallet address
523
+ * Returns null if wallet not connected
524
+ */
525
+ async getWalletAddress() {
526
+ return this.walletManager.getWalletAddress();
527
+ }
528
+ /**
529
+ * Check if wallet is connected
530
+ */
531
+ async isWalletConnected() {
532
+ return this.walletManager.isWalletConnected();
533
+ }
534
+ /**
535
+ * Listen for wallet connection changes
536
+ */
537
+ onWalletChange(callback) {
538
+ this.walletManager.onWalletChange(callback);
539
+ }
540
+ /**
541
+ * Remove wallet change listener
542
+ */
543
+ offWalletChange(callback) {
544
+ this.walletManager.offWalletChange(callback);
545
+ }
546
+ /**
547
+ * Payment methods
548
+ */
549
+ get payment() {
550
+ return {
551
+ /**
552
+ * Pay to play - one-time payment to start/access game
553
+ */
554
+ payToPlay: (amount, token) => {
555
+ return this.paymentManager.payToPlay(amount, token);
556
+ },
557
+ /**
558
+ * In-game purchase - buy items, upgrades, etc.
559
+ */
560
+ purchaseItem: (itemId, amount, token) => {
561
+ return this.paymentManager.purchaseItem(itemId, amount, token);
562
+ },
563
+ };
564
+ }
565
+ /**
566
+ * Get SDK configuration
567
+ */
568
+ getConfig() {
569
+ return { ...this.config };
570
+ }
571
+ /**
572
+ * Check if SDK is running in iframe
573
+ */
574
+ isInIframe() {
575
+ return this.isIframe;
576
+ }
577
+ /**
578
+ * Check if SDK is initialized
579
+ */
580
+ isInitialized() {
581
+ return this.initialized;
582
+ }
583
+ /**
584
+ * Cleanup SDK resources
585
+ */
586
+ destroy() {
587
+ this.messageHandler.destroy();
588
+ this.walletManager.clearCache();
589
+ this.initialized = false;
590
+ }
591
+ /**
592
+ * Set up message listener for wallet updates
593
+ */
594
+ setupMessageListener() {
595
+ // Additional listener for wallet updates (not request/response)
596
+ const listener = (event) => {
597
+ // Validate origin if specified
598
+ if (this.config.parentOrigin !== '*' && event.origin !== this.config.parentOrigin) {
599
+ return;
600
+ }
601
+ const message = event.data;
602
+ // Handle wallet update messages
603
+ if (message.type === MessageType.WALLET_UPDATE && message.payload) {
604
+ const walletInfo = message.payload;
605
+ this.walletManager.updateWalletStatus(walletInfo);
606
+ }
607
+ };
608
+ window.addEventListener('message', listener);
609
+ // Store listener for cleanup (though SDK doesn't typically need cleanup)
610
+ // This is handled by messageHandler.destroy()
611
+ }
612
+ }
613
+
614
+ /**
615
+ * Arcadia Game SDK
616
+ *
617
+ * SDK for integrating Arcadia wallet and payment features into Web3 games.
618
+ * Works in iframe environments by communicating with parent window via postMessage.
619
+ */
620
+ // Main SDK class
621
+
622
+ exports.ArcadiaSDK = ArcadiaSDK;
623
+ exports.ArcadiaSDKError = ArcadiaSDKError;
624
+ exports.InvalidAmountError = InvalidAmountError;
625
+ exports.InvalidConfigError = InvalidConfigError;
626
+ exports.InvalidTokenError = InvalidTokenError;
627
+ exports.NotInIframeError = NotInIframeError;
628
+ exports.PaymentFailedError = PaymentFailedError;
629
+ exports.TimeoutError = TimeoutError;
630
+ exports.WalletNotConnectedError = WalletNotConnectedError;
631
+ exports.default = ArcadiaSDK;
632
+
633
+ Object.defineProperty(exports, '__esModule', { value: true });
634
+
635
+ }));
636
+ //# sourceMappingURL=arcadia-game-sdk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arcadia-game-sdk.js","sources":["../../src/types.ts","../../src/errors.ts","../../src/messaging.ts","../../src/wallet.ts","../../src/payment.ts","../../src/sdk.ts","../../src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null],"names":[],"mappings":";;;;;;IA8CA;;IAEG;IACH,IAAY,WAYX;IAZD,CAAA,UAAY,WAAW,EAAA;;IAErB,IAAA,WAAA,CAAA,cAAA,CAAA,GAAA,cAA6B;IAC7B,IAAA,WAAA,CAAA,oBAAA,CAAA,GAAA,oBAAyC;IACzC,IAAA,WAAA,CAAA,iBAAA,CAAA,GAAA,iBAAmC;IACnC,IAAA,WAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;;IAGzB,IAAA,WAAA,CAAA,MAAA,CAAA,GAAA,MAAa;IACb,IAAA,WAAA,CAAA,yBAAA,CAAA,GAAA,yBAAmD;IACnD,IAAA,WAAA,CAAA,eAAA,CAAA,GAAA,eAA+B;IAC/B,IAAA,WAAA,CAAA,kBAAA,CAAA,GAAA,kBAAqC;IACvC,CAAC,EAZW,WAAW,KAAX,WAAW,GAAA,EAAA,CAAA,CAAA;;ICjDvB;;IAEG;IACG,MAAO,eAAgB,SAAQ,KAAK,CAAA;QACxC,WAAA,CAAY,OAAe,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