@react-text-game/core 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.
- package/README.md +744 -0
- package/dist/baseGameObject.d.ts +90 -0
- package/dist/baseGameObject.d.ts.map +1 -0
- package/dist/baseGameObject.js +109 -0
- package/dist/baseGameObject.js.map +1 -0
- package/dist/constants.d.ts +12 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +12 -0
- package/dist/constants.js.map +1 -0
- package/dist/game.d.ts +294 -0
- package/dist/game.d.ts.map +1 -0
- package/dist/game.js +489 -0
- package/dist/game.js.map +1 -0
- package/dist/helpers.d.ts +2 -0
- package/dist/helpers.d.ts.map +1 -0
- package/dist/helpers.js +6 -0
- package/dist/helpers.js.map +1 -0
- package/dist/hooks/index.d.ts +4 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +4 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/useCurrentPassage.d.ts +10 -0
- package/dist/hooks/useCurrentPassage.d.ts.map +1 -0
- package/dist/hooks/useCurrentPassage.js +17 -0
- package/dist/hooks/useCurrentPassage.js.map +1 -0
- package/dist/hooks/useGameEntity.d.ts +21 -0
- package/dist/hooks/useGameEntity.d.ts.map +1 -0
- package/dist/hooks/useGameEntity.js +70 -0
- package/dist/hooks/useGameEntity.js.map +1 -0
- package/dist/hooks/useGameIsStarted.d.ts +12 -0
- package/dist/hooks/useGameIsStarted.d.ts.map +1 -0
- package/dist/hooks/useGameIsStarted.js +18 -0
- package/dist/hooks/useGameIsStarted.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/logger.d.ts +8 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +36 -0
- package/dist/logger.js.map +1 -0
- package/dist/options.d.ts +13 -0
- package/dist/options.d.ts.map +1 -0
- package/dist/options.js +15 -0
- package/dist/options.js.map +1 -0
- package/dist/passages/interactiveMap/fabric.d.ts +4 -0
- package/dist/passages/interactiveMap/fabric.d.ts.map +1 -0
- package/dist/passages/interactiveMap/fabric.js +3 -0
- package/dist/passages/interactiveMap/fabric.js.map +1 -0
- package/dist/passages/interactiveMap/index.d.ts +4 -0
- package/dist/passages/interactiveMap/index.d.ts.map +1 -0
- package/dist/passages/interactiveMap/index.js +4 -0
- package/dist/passages/interactiveMap/index.js.map +1 -0
- package/dist/passages/interactiveMap/interactiveMap.d.ts +89 -0
- package/dist/passages/interactiveMap/interactiveMap.d.ts.map +1 -0
- package/dist/passages/interactiveMap/interactiveMap.js +103 -0
- package/dist/passages/interactiveMap/interactiveMap.js.map +1 -0
- package/dist/passages/interactiveMap/types.d.ts +822 -0
- package/dist/passages/interactiveMap/types.d.ts.map +1 -0
- package/dist/passages/interactiveMap/types.js +2 -0
- package/dist/passages/interactiveMap/types.js.map +1 -0
- package/dist/passages/passage.d.ts +57 -0
- package/dist/passages/passage.d.ts.map +1 -0
- package/dist/passages/passage.js +64 -0
- package/dist/passages/passage.js.map +1 -0
- package/dist/passages/story/fabric.d.ts +4 -0
- package/dist/passages/story/fabric.d.ts.map +1 -0
- package/dist/passages/story/fabric.js +3 -0
- package/dist/passages/story/fabric.js.map +1 -0
- package/dist/passages/story/index.d.ts +5 -0
- package/dist/passages/story/index.d.ts.map +1 -0
- package/dist/passages/story/index.js +5 -0
- package/dist/passages/story/index.js.map +1 -0
- package/dist/passages/story/start.d.ts +14 -0
- package/dist/passages/story/start.d.ts.map +1 -0
- package/dist/passages/story/start.js +22 -0
- package/dist/passages/story/start.js.map +1 -0
- package/dist/passages/story/story.d.ts +84 -0
- package/dist/passages/story/story.d.ts.map +1 -0
- package/dist/passages/story/story.js +88 -0
- package/dist/passages/story/story.js.map +1 -0
- package/dist/passages/story/types.d.ts +911 -0
- package/dist/passages/story/types.d.ts.map +1 -0
- package/dist/passages/story/types.js +2 -0
- package/dist/passages/story/types.js.map +1 -0
- package/dist/passages/types/index.d.ts +3 -0
- package/dist/passages/types/index.d.ts.map +1 -0
- package/dist/passages/types/index.js +2 -0
- package/dist/passages/types/index.js.map +1 -0
- package/dist/passages/widget.d.ts +62 -0
- package/dist/passages/widget.d.ts.map +1 -0
- package/dist/passages/widget.js +66 -0
- package/dist/passages/widget.js.map +1 -0
- package/dist/saves/constants.d.ts +17 -0
- package/dist/saves/constants.d.ts.map +1 -0
- package/dist/saves/constants.js +17 -0
- package/dist/saves/constants.js.map +1 -0
- package/dist/saves/db.d.ts +119 -0
- package/dist/saves/db.d.ts.map +1 -0
- package/dist/saves/db.js +231 -0
- package/dist/saves/db.js.map +1 -0
- package/dist/saves/helpers.d.ts +28 -0
- package/dist/saves/helpers.d.ts.map +1 -0
- package/dist/saves/helpers.js +84 -0
- package/dist/saves/helpers.js.map +1 -0
- package/dist/saves/hooks/index.d.ts +10 -0
- package/dist/saves/hooks/index.d.ts.map +1 -0
- package/dist/saves/hooks/index.js +10 -0
- package/dist/saves/hooks/index.js.map +1 -0
- package/dist/saves/hooks/useDeleteAllSlots.d.ts +18 -0
- package/dist/saves/hooks/useDeleteAllSlots.d.ts.map +1 -0
- package/dist/saves/hooks/useDeleteAllSlots.js +18 -0
- package/dist/saves/hooks/useDeleteAllSlots.js.map +1 -0
- package/dist/saves/hooks/useDeleteGame.d.ts +22 -0
- package/dist/saves/hooks/useDeleteGame.d.ts.map +1 -0
- package/dist/saves/hooks/useDeleteGame.js +33 -0
- package/dist/saves/hooks/useDeleteGame.js.map +1 -0
- package/dist/saves/hooks/useExportSaves.d.ts +27 -0
- package/dist/saves/hooks/useExportSaves.d.ts.map +1 -0
- package/dist/saves/hooks/useExportSaves.js +54 -0
- package/dist/saves/hooks/useExportSaves.js.map +1 -0
- package/dist/saves/hooks/useImportSaves.d.ts +29 -0
- package/dist/saves/hooks/useImportSaves.d.ts.map +1 -0
- package/dist/saves/hooks/useImportSaves.js +108 -0
- package/dist/saves/hooks/useImportSaves.js.map +1 -0
- package/dist/saves/hooks/useLastLoadGame.d.ts +39 -0
- package/dist/saves/hooks/useLastLoadGame.d.ts.map +1 -0
- package/dist/saves/hooks/useLastLoadGame.js +72 -0
- package/dist/saves/hooks/useLastLoadGame.js.map +1 -0
- package/dist/saves/hooks/useLoadGame.d.ts +22 -0
- package/dist/saves/hooks/useLoadGame.d.ts.map +1 -0
- package/dist/saves/hooks/useLoadGame.js +40 -0
- package/dist/saves/hooks/useLoadGame.js.map +1 -0
- package/dist/saves/hooks/useRestartGame.d.ts +20 -0
- package/dist/saves/hooks/useRestartGame.d.ts.map +1 -0
- package/dist/saves/hooks/useRestartGame.js +29 -0
- package/dist/saves/hooks/useRestartGame.js.map +1 -0
- package/dist/saves/hooks/useSaveGame.d.ts +22 -0
- package/dist/saves/hooks/useSaveGame.d.ts.map +1 -0
- package/dist/saves/hooks/useSaveGame.js +34 -0
- package/dist/saves/hooks/useSaveGame.js.map +1 -0
- package/dist/saves/hooks/useSaveSlots.d.ts +45 -0
- package/dist/saves/hooks/useSaveSlots.d.ts.map +1 -0
- package/dist/saves/hooks/useSaveSlots.js +42 -0
- package/dist/saves/hooks/useSaveSlots.js.map +1 -0
- package/dist/saves/index.d.ts +4 -0
- package/dist/saves/index.d.ts.map +1 -0
- package/dist/saves/index.js +3 -0
- package/dist/saves/index.js.map +1 -0
- package/dist/saves/types.d.ts +52 -0
- package/dist/saves/types.d.ts.map +1 -0
- package/dist/saves/types.js +2 -0
- package/dist/saves/types.js.map +1 -0
- package/dist/storage.d.ts +124 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +229 -0
- package/dist/storage.js.map +1 -0
- package/dist/tests/game.test.d.ts +2 -0
- package/dist/tests/game.test.d.ts.map +1 -0
- package/dist/tests/game.test.js +602 -0
- package/dist/tests/game.test.js.map +1 -0
- package/dist/tests/interactiveMap.test.d.ts +2 -0
- package/dist/tests/interactiveMap.test.d.ts.map +1 -0
- package/dist/tests/interactiveMap.test.js +1003 -0
- package/dist/tests/interactiveMap.test.js.map +1 -0
- package/dist/tests/storage.test.d.ts +2 -0
- package/dist/tests/storage.test.d.ts.map +1 -0
- package/dist/tests/storage.test.js +328 -0
- package/dist/tests/storage.test.js.map +1 -0
- package/dist/tests/story.test.d.ts +2 -0
- package/dist/tests/story.test.d.ts.map +1 -0
- package/dist/tests/story.test.js +698 -0
- package/dist/tests/story.test.js.map +1 -0
- package/dist/types.d.ts +19 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +60 -0
package/dist/storage.js
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { JSONPath } from "jsonpath-plus";
|
|
2
|
+
import { STORAGE_SYSTEM_PATH } from "./constants";
|
|
3
|
+
const storage = {};
|
|
4
|
+
/**
|
|
5
|
+
* JSONPath-based storage system for game state persistence.
|
|
6
|
+
*
|
|
7
|
+
* The Storage class provides a flexible way to store and retrieve game state using
|
|
8
|
+
* JSONPath queries. It supports nested data structures and protects system paths
|
|
9
|
+
* from accidental modification.
|
|
10
|
+
*
|
|
11
|
+
* @see https://www.npmjs.com/package/jsonpath-plus - JSONPath Plus library documentation
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* // Set values
|
|
16
|
+
* Storage.setValue('$.player.health', 100);
|
|
17
|
+
* Storage.setValue('$.inventory.items', ['sword', 'shield']);
|
|
18
|
+
*
|
|
19
|
+
* // Get values
|
|
20
|
+
* const health = Storage.getValue<number>('$.player.health');
|
|
21
|
+
* const items = Storage.getValue<string[]>('$.inventory.items');
|
|
22
|
+
*
|
|
23
|
+
* // Full state
|
|
24
|
+
* const state = Storage.getState();
|
|
25
|
+
* Storage.setState(state);
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export class Storage {
|
|
29
|
+
/**
|
|
30
|
+
* Retrieves values from storage using a JSONPath query.
|
|
31
|
+
*
|
|
32
|
+
* Returns an array of matching values. If no matches are found, returns an empty array.
|
|
33
|
+
* The JSONPath Plus library supports complex queries including wildcards, filters, and deep scanning.
|
|
34
|
+
*
|
|
35
|
+
* @template T - The expected type of values to retrieve
|
|
36
|
+
* @param jsonPath - The JSONPath query string (e.g., '$.player.health', '$.inventory.items[*]')
|
|
37
|
+
* @returns Array of values matching the JSONPath query
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```typescript
|
|
41
|
+
* // Get a single value (returns array with one element)
|
|
42
|
+
* const health = Storage.getValue<number>('$.player.health');
|
|
43
|
+
* if (health.length > 0) {
|
|
44
|
+
* console.log(health[0]); // 100
|
|
45
|
+
* }
|
|
46
|
+
*
|
|
47
|
+
* // Get multiple values with wildcard
|
|
48
|
+
* const allItems = Storage.getValue<string>('$.inventory.*.name');
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
static getValue(jsonPath) {
|
|
52
|
+
return JSONPath({ path: jsonPath, json: storage });
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Sets a value in storage at the specified JSONPath.
|
|
56
|
+
*
|
|
57
|
+
* If the path exists, updates the value. If the path doesn't exist, creates it.
|
|
58
|
+
* System paths (prefixed with STORAGE_SYSTEM_PATH) are protected from external modification.
|
|
59
|
+
*
|
|
60
|
+
* @template T - The type of value to set
|
|
61
|
+
* @param jsonPath - The JSONPath where the value should be set
|
|
62
|
+
* @param value - The value to set at the specified JSONPath
|
|
63
|
+
* @param _isSystem - Internal flag to allow system path modification (default: false)
|
|
64
|
+
* @throws Error if attempting to modify a system path without _isSystem flag
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```typescript
|
|
68
|
+
* // Set a simple value
|
|
69
|
+
* Storage.setValue('$.player.health', 75);
|
|
70
|
+
*
|
|
71
|
+
* // Set a complex object
|
|
72
|
+
* Storage.setValue('$.player.stats', { str: 10, dex: 8 });
|
|
73
|
+
*
|
|
74
|
+
* // System paths are protected
|
|
75
|
+
* Storage.setValue('$._system.game', {}); // Throws error
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
static setValue(jsonPath, value, _isSystem = false) {
|
|
79
|
+
if (jsonPath.includes(STORAGE_SYSTEM_PATH) && !_isSystem) {
|
|
80
|
+
throw new Error(`Cannot set value at system path: ${jsonPath}`);
|
|
81
|
+
}
|
|
82
|
+
// Check if the path exists
|
|
83
|
+
const existingValues = JSONPath({
|
|
84
|
+
path: jsonPath,
|
|
85
|
+
json: storage,
|
|
86
|
+
});
|
|
87
|
+
if (existingValues.length > 0) {
|
|
88
|
+
// Path exists, update it
|
|
89
|
+
const parents = JSONPath({
|
|
90
|
+
path: jsonPath,
|
|
91
|
+
json: storage,
|
|
92
|
+
resultType: "parent",
|
|
93
|
+
});
|
|
94
|
+
const properties = JSONPath({
|
|
95
|
+
path: jsonPath,
|
|
96
|
+
json: storage,
|
|
97
|
+
resultType: "parentProperty",
|
|
98
|
+
});
|
|
99
|
+
// Update all matching paths
|
|
100
|
+
for (let i = 0; i < parents.length; i++) {
|
|
101
|
+
parents[i][properties[i]] = value;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
// Path doesn't exist, create it
|
|
106
|
+
this.createPath(storage, jsonPath, value);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Retrieves the entire storage state as a plain object.
|
|
111
|
+
*
|
|
112
|
+
* @returns The complete storage state, ready for serialization
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* ```typescript
|
|
116
|
+
* const state = Storage.getState();
|
|
117
|
+
* localStorage.setItem('save', JSON.stringify(state));
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
static getState() {
|
|
121
|
+
return storage;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Replaces the entire storage state with a new state object.
|
|
125
|
+
*
|
|
126
|
+
* Clears all existing storage data and replaces it with the provided state.
|
|
127
|
+
* Useful for loading saved games or resetting to a specific state.
|
|
128
|
+
*
|
|
129
|
+
* @param state - The new state to set for the storage
|
|
130
|
+
* @throws Error if state is not a valid object
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* ```typescript
|
|
134
|
+
* const savedState = JSON.parse(localStorage.getItem('save'));
|
|
135
|
+
* Storage.setState(savedState);
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
static setState(state) {
|
|
139
|
+
if (typeof state !== "object" || state === null) {
|
|
140
|
+
throw new Error("Invalid state provided. Expected an object.");
|
|
141
|
+
}
|
|
142
|
+
// Clear the current storage
|
|
143
|
+
for (const key in storage) {
|
|
144
|
+
delete storage[key];
|
|
145
|
+
}
|
|
146
|
+
// Set the new state
|
|
147
|
+
Object.assign(storage, state);
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Creates a nested path in storage and assigns a value.
|
|
151
|
+
*
|
|
152
|
+
* Parses the JSONPath and creates all necessary intermediate objects/arrays
|
|
153
|
+
* to build the path if it doesn't exist. Supports both object properties and array indices.
|
|
154
|
+
*
|
|
155
|
+
* @private - Used internally by setValue when creating new paths
|
|
156
|
+
* @template T - The type of value to set at the path
|
|
157
|
+
* @param obj - The target object where the path will be created
|
|
158
|
+
* @param jsonPath - The JSONPath string specifying the location
|
|
159
|
+
* @param value - The value to set at the specified location
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* ```typescript
|
|
163
|
+
* // Creates $.player.inventory.items[0] = 'sword'
|
|
164
|
+
* // Will create player object, inventory object, items array automatically
|
|
165
|
+
* Storage.createPath(storage, '$.player.inventory.items[0]', 'sword');
|
|
166
|
+
* ```
|
|
167
|
+
*/
|
|
168
|
+
static createPath(obj, jsonPath, value) {
|
|
169
|
+
// Parse the JSONPath to get the path components
|
|
170
|
+
// toPathArray converts '$.a.b[0]' to ['$', 'a', 'b', '0']
|
|
171
|
+
const pathComponents = JSONPath.toPathArray(jsonPath);
|
|
172
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
173
|
+
let current = obj;
|
|
174
|
+
// Iterate through path components, skipping the root ($)
|
|
175
|
+
for (let i = 1; i < pathComponents.length; i++) {
|
|
176
|
+
const component = pathComponents[i];
|
|
177
|
+
if (!component) {
|
|
178
|
+
throw new Error(`Invalid path component at index ${i} in path: ${jsonPath}`);
|
|
179
|
+
}
|
|
180
|
+
const isLast = i === pathComponents.length - 1;
|
|
181
|
+
// Check if the component is a numeric array index
|
|
182
|
+
const isNumeric = /^\d+$/.test(component);
|
|
183
|
+
if (isNumeric) {
|
|
184
|
+
// Array index like [0] or [1]
|
|
185
|
+
const index = parseInt(component);
|
|
186
|
+
if (isLast) {
|
|
187
|
+
// Ensure current is an array
|
|
188
|
+
if (!Array.isArray(current)) {
|
|
189
|
+
throw new Error(`Cannot set array index on non-array at path: ${jsonPath}`);
|
|
190
|
+
}
|
|
191
|
+
current[index] = value;
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
// Create array if it doesn't exist or extend it if needed
|
|
195
|
+
if (!Array.isArray(current)) {
|
|
196
|
+
throw new Error(`Cannot access array index on non-array at path: ${jsonPath}`);
|
|
197
|
+
}
|
|
198
|
+
if (!current[index]) {
|
|
199
|
+
// Look ahead to see if next component is numeric
|
|
200
|
+
const nextComponent = pathComponents[i + 1];
|
|
201
|
+
const nextIsNumeric = nextComponent && /^\d+$/.test(nextComponent);
|
|
202
|
+
current[index] = nextIsNumeric ? [] : {};
|
|
203
|
+
}
|
|
204
|
+
current = current[index];
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
// Property access like .hello or .user
|
|
209
|
+
const key = component;
|
|
210
|
+
if (isLast) {
|
|
211
|
+
current[key] = value;
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
// Create object or array if it doesn't exist
|
|
215
|
+
if (!(key in current) ||
|
|
216
|
+
typeof current[key] !== "object" ||
|
|
217
|
+
current[key] === null) {
|
|
218
|
+
// Look ahead to see if next component is numeric (array index)
|
|
219
|
+
const nextComponent = pathComponents[i + 1];
|
|
220
|
+
const nextIsNumeric = nextComponent && /^\d+$/.test(nextComponent);
|
|
221
|
+
current[key] = nextIsNumeric ? [] : {};
|
|
222
|
+
}
|
|
223
|
+
current = current[key];
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
//# sourceMappingURL=storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../src/storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAGjD,MAAM,OAAO,GAAG,EAAE,CAAC;AAEnB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,OAAO,OAAO;IAChB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,QAAQ,CAAI,QAAkB;QACjC,OAAO,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAa,CAAC;IACnE,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,MAAM,CAAC,QAAQ,CACX,QAAkB,EAClB,KAAQ,EACR,YAAqB,KAAK;QAE1B,IAAI,QAAQ,CAAC,QAAQ,CAAC,mBAAmB,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;YACvD,MAAM,IAAI,KAAK,CAAC,oCAAoC,QAAQ,EAAE,CAAC,CAAC;QACpE,CAAC;QAED,2BAA2B;QAC3B,MAAM,cAAc,GAAG,QAAQ,CAAC;YAC5B,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,OAAO;SAChB,CAAC,CAAC;QAEH,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC5B,yBAAyB;YACzB,MAAM,OAAO,GAAG,QA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