juxscript 1.1.231 → 1.1.233
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/index.d.ts +5 -3
- package/index.d.ts.map +1 -1
- package/index.js +4 -3
- package/lib/storage/DataFrame.d.ts +262 -37
- package/lib/storage/DataFrame.d.ts.map +1 -1
- package/lib/storage/DataFrame.js +919 -340
- package/lib/storage/DataFrame.ts +1031 -308
- package/lib/storage/DataFrameSource.d.ts +158 -0
- package/lib/storage/DataFrameSource.d.ts.map +1 -0
- package/lib/storage/DataFrameSource.js +409 -0
- package/lib/storage/DataFrameSource.ts +556 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -50,12 +50,14 @@ import { registry } from './lib/components/registry.js';
|
|
|
50
50
|
import { stateHistory } from './lib/components/history/StateHistory.js';
|
|
51
51
|
import { watcher } from './lib/components/watcher.js';
|
|
52
52
|
export { state, registry, stateHistory };
|
|
53
|
-
export { tabularDriver } from './lib/storage/TabularDriver.js';
|
|
54
|
-
export { DataFrame } from './lib/storage/DataFrame.js';
|
|
53
|
+
export { tabularDriver, TabularDriver } from './lib/storage/TabularDriver.js';
|
|
54
|
+
export { DataFrame, GroupedDataFrame } from './lib/storage/DataFrame.js';
|
|
55
|
+
export type { DataType, ColumnSchema, DataFrameOptions } from './lib/storage/DataFrame.js';
|
|
56
|
+
export { DataFrameSource, dataFrameSource } from './lib/storage/DataFrameSource.js';
|
|
57
|
+
export type { SourceOptions, APIOptions, StreamOptions, MultiSheetResult } from './lib/storage/DataFrameSource.js';
|
|
55
58
|
export { indexedDBDriver } from './lib/storage/IndexedDBDriver.js';
|
|
56
59
|
export { fileStorage } from './lib/storage/FileStorage.js';
|
|
57
60
|
export { dataframe } from './lib/components/dataframe.js';
|
|
58
|
-
export { DataFrameSource, dataFrameSource } from './lib/components/dataframe/DataFrameSource.js';
|
|
59
61
|
import { VStack, vstack } from './lib/components/stack/VStack.js';
|
|
60
62
|
import { HStack, hstack } from './lib/components/stack/HStack.js';
|
|
61
63
|
import { ZStack, zstack } from './lib/components/stack/ZStack.js';
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE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D,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAG1D,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAGlE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7E,YAAY,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAG3D;;GAEG;AACH,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4Df,CAAC;AAGF,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC"}
|
package/index.js
CHANGED
|
@@ -53,12 +53,13 @@ import { stateHistory } from './lib/components/history/StateHistory.js';
|
|
|
53
53
|
import { watcher } from './lib/components/watcher.js';
|
|
54
54
|
export { state, registry, stateHistory };
|
|
55
55
|
// Storage
|
|
56
|
-
export { tabularDriver } from './lib/storage/TabularDriver.js';
|
|
57
|
-
export { DataFrame } from './lib/storage/DataFrame.js';
|
|
56
|
+
export { tabularDriver, TabularDriver } from './lib/storage/TabularDriver.js';
|
|
57
|
+
export { DataFrame, GroupedDataFrame } from './lib/storage/DataFrame.js';
|
|
58
|
+
export { DataFrameSource, dataFrameSource } from './lib/storage/DataFrameSource.js';
|
|
58
59
|
export { indexedDBDriver } from './lib/storage/IndexedDBDriver.js';
|
|
59
60
|
export { fileStorage } from './lib/storage/FileStorage.js';
|
|
61
|
+
// DataFrame UI Component (separate from data layer)
|
|
60
62
|
export { dataframe } from './lib/components/dataframe.js';
|
|
61
|
-
export { DataFrameSource, dataFrameSource } from './lib/components/dataframe/DataFrameSource.js';
|
|
62
63
|
// Import Stack components (already added earlier)
|
|
63
64
|
import { VStack, vstack } from './lib/components/stack/VStack.js';
|
|
64
65
|
import { HStack, hstack } from './lib/components/stack/HStack.js';
|
|
@@ -1,59 +1,284 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* DataFrame - A pandas-like data manipulation class for JavaScript
|
|
3
|
+
*
|
|
4
|
+
* Core capabilities:
|
|
5
|
+
* - Column operations (select, drop, rename, reorder)
|
|
6
|
+
* - Row operations (filter, head, tail, sample, slice)
|
|
7
|
+
* - Data transformation (withColumn, apply, map)
|
|
8
|
+
* - Aggregation (groupBy, agg, pivot)
|
|
9
|
+
* - Joins (merge, concat, union)
|
|
10
|
+
* - Type inference and conversion
|
|
11
|
+
* - Sorting and indexing
|
|
12
|
+
* - Statistics and describe
|
|
13
|
+
* - Missing data handling
|
|
14
|
+
*/
|
|
15
|
+
export type DataType = 'string' | 'number' | 'boolean' | 'date' | 'null' | 'mixed';
|
|
16
|
+
export interface ColumnSchema {
|
|
3
17
|
name: string;
|
|
4
|
-
dtype:
|
|
5
|
-
|
|
18
|
+
dtype: DataType;
|
|
19
|
+
nullable: boolean;
|
|
20
|
+
unique?: number;
|
|
21
|
+
min?: any;
|
|
22
|
+
max?: any;
|
|
23
|
+
}
|
|
24
|
+
export interface DataFrameOptions {
|
|
25
|
+
inferTypes?: boolean;
|
|
26
|
+
columns?: string[];
|
|
6
27
|
}
|
|
7
28
|
export declare class DataFrame {
|
|
8
29
|
private _columns;
|
|
30
|
+
private _data;
|
|
9
31
|
private _height;
|
|
10
|
-
|
|
11
|
-
private
|
|
12
|
-
|
|
13
|
-
private
|
|
32
|
+
private _schema;
|
|
33
|
+
private _inferTypes;
|
|
34
|
+
constructor(data: Record<string, any>[] | Record<string, any[]> | DataFrame, options?: DataFrameOptions);
|
|
35
|
+
private _initFromRows;
|
|
36
|
+
private _initFromColumns;
|
|
37
|
+
private _inferSchema;
|
|
38
|
+
private _inferColumnSchema;
|
|
39
|
+
get columns(): string[];
|
|
14
40
|
get height(): number;
|
|
15
41
|
get width(): number;
|
|
16
|
-
get columns(): string[];
|
|
17
|
-
get dtypes(): Record<string, DType>;
|
|
18
42
|
get shape(): [number, number];
|
|
19
|
-
|
|
20
|
-
|
|
43
|
+
get dtypes(): Record<string, DataType>;
|
|
44
|
+
get schema(): ColumnSchema[];
|
|
45
|
+
get isEmpty(): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Get a column as an array
|
|
48
|
+
*/
|
|
21
49
|
col(name: string): any[];
|
|
50
|
+
/**
|
|
51
|
+
* Get column (alias for col)
|
|
52
|
+
*/
|
|
53
|
+
getColumn(name: string): any[];
|
|
54
|
+
/**
|
|
55
|
+
* Get a single row by index
|
|
56
|
+
*/
|
|
22
57
|
row(index: number): Record<string, any>;
|
|
58
|
+
/**
|
|
59
|
+
* Get value at specific row and column
|
|
60
|
+
*/
|
|
61
|
+
at(row: number, col: string): any;
|
|
62
|
+
/**
|
|
63
|
+
* Set value at specific row and column (mutates!)
|
|
64
|
+
*/
|
|
65
|
+
setAt(row: number, col: string, value: any): this;
|
|
66
|
+
/**
|
|
67
|
+
* Convert to array of row objects
|
|
68
|
+
*/
|
|
69
|
+
toRows(): Record<string, any>[];
|
|
70
|
+
/**
|
|
71
|
+
* Convert to column-oriented object
|
|
72
|
+
*/
|
|
73
|
+
toColumns(): Record<string, any[]>;
|
|
74
|
+
/**
|
|
75
|
+
* Get distinct/unique values in a column
|
|
76
|
+
*/
|
|
77
|
+
distinct(column: string): any[];
|
|
78
|
+
/**
|
|
79
|
+
* Alias for distinct
|
|
80
|
+
*/
|
|
81
|
+
unique(column: string): any[];
|
|
82
|
+
/**
|
|
83
|
+
* Count occurrences of each value in a column
|
|
84
|
+
*/
|
|
85
|
+
valueCounts(column: string): Record<any, number>;
|
|
86
|
+
/**
|
|
87
|
+
* Select specific columns
|
|
88
|
+
*/
|
|
89
|
+
select(...cols: string[]): DataFrame;
|
|
90
|
+
/**
|
|
91
|
+
* Drop columns
|
|
92
|
+
*/
|
|
93
|
+
drop(...cols: string[]): DataFrame;
|
|
94
|
+
/**
|
|
95
|
+
* Rename columns
|
|
96
|
+
*/
|
|
97
|
+
rename(mapping: Record<string, string>): DataFrame;
|
|
98
|
+
/**
|
|
99
|
+
* Reorder columns
|
|
100
|
+
*/
|
|
101
|
+
reorder(...cols: string[]): DataFrame;
|
|
102
|
+
/**
|
|
103
|
+
* Add or replace a column with computed values
|
|
104
|
+
*/
|
|
105
|
+
withColumn(name: string, fn: (row: Record<string, any>, index: number) => any): DataFrame;
|
|
106
|
+
/**
|
|
107
|
+
* Add multiple computed columns at once
|
|
108
|
+
*/
|
|
109
|
+
withColumns(columns: Record<string, (row: Record<string, any>, index: number) => any>): DataFrame;
|
|
110
|
+
/**
|
|
111
|
+
* Cast column to a specific type
|
|
112
|
+
*/
|
|
113
|
+
asType(column: string, dtype: 'string' | 'number' | 'boolean' | 'date'): DataFrame;
|
|
114
|
+
/**
|
|
115
|
+
* Filter rows by predicate
|
|
116
|
+
*/
|
|
117
|
+
filter(predicate: (row: Record<string, any>, index: number) => boolean): DataFrame;
|
|
118
|
+
/**
|
|
119
|
+
* Filter with SQL-like where clause
|
|
120
|
+
*/
|
|
121
|
+
where(col: string, op: '==' | '!=' | '>' | '<' | '>=' | '<=' | 'in' | 'not in' | 'contains' | 'startsWith' | 'endsWith' | 'isNull' | 'notNull', value?: any): DataFrame;
|
|
122
|
+
/**
|
|
123
|
+
* Get first N rows
|
|
124
|
+
*/
|
|
23
125
|
head(n?: number): DataFrame;
|
|
126
|
+
/**
|
|
127
|
+
* Get last N rows
|
|
128
|
+
*/
|
|
24
129
|
tail(n?: number): DataFrame;
|
|
130
|
+
/**
|
|
131
|
+
* Slice rows by index range
|
|
132
|
+
*/
|
|
25
133
|
slice(start: number, end?: number): DataFrame;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
134
|
+
/**
|
|
135
|
+
* Get random sample of rows
|
|
136
|
+
*/
|
|
137
|
+
sample(n: number, seed?: number): DataFrame;
|
|
138
|
+
/**
|
|
139
|
+
* Drop duplicate rows
|
|
140
|
+
*/
|
|
141
|
+
dropDuplicates(columns?: string[]): DataFrame;
|
|
142
|
+
/**
|
|
143
|
+
* Drop rows with null values
|
|
144
|
+
*/
|
|
145
|
+
dropna(columns?: string[]): DataFrame;
|
|
146
|
+
/**
|
|
147
|
+
* Fill null values
|
|
148
|
+
*/
|
|
149
|
+
fillna(value: any, columns?: string[]): DataFrame;
|
|
150
|
+
/**
|
|
151
|
+
* Sort by column(s)
|
|
152
|
+
*/
|
|
153
|
+
sort(column: string | string[], descending?: boolean | boolean[]): DataFrame;
|
|
154
|
+
/**
|
|
155
|
+
* Sort descending (shorthand)
|
|
156
|
+
*/
|
|
157
|
+
sortDesc(column: string): DataFrame;
|
|
158
|
+
/**
|
|
159
|
+
* Group by column(s) and aggregate
|
|
160
|
+
*/
|
|
161
|
+
groupBy(columns: string | string[]): GroupedDataFrame;
|
|
162
|
+
/**
|
|
163
|
+
* Aggregate entire DataFrame
|
|
164
|
+
*/
|
|
165
|
+
agg(aggregations: Record<string, 'sum' | 'mean' | 'min' | 'max' | 'count' | 'first' | 'last' | ((values: any[]) => any)>): DataFrame;
|
|
166
|
+
/**
|
|
167
|
+
* Count rows
|
|
168
|
+
*/
|
|
36
169
|
count(): number;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
170
|
+
/**
|
|
171
|
+
* Sum of numeric column
|
|
172
|
+
*/
|
|
173
|
+
sum(column: string): number;
|
|
174
|
+
/**
|
|
175
|
+
* Mean of numeric column
|
|
176
|
+
*/
|
|
177
|
+
mean(column: string): number;
|
|
178
|
+
/**
|
|
179
|
+
* Min of column
|
|
180
|
+
*/
|
|
181
|
+
min(column: string): any;
|
|
182
|
+
/**
|
|
183
|
+
* Max of column
|
|
184
|
+
*/
|
|
185
|
+
max(column: string): any;
|
|
186
|
+
/**
|
|
187
|
+
* Merge with another DataFrame (SQL-like join)
|
|
188
|
+
*/
|
|
189
|
+
merge(other: DataFrame, options?: {
|
|
190
|
+
on?: string | string[];
|
|
191
|
+
leftOn?: string | string[];
|
|
192
|
+
rightOn?: string | string[];
|
|
193
|
+
how?: 'inner' | 'left' | 'right' | 'outer';
|
|
194
|
+
suffixes?: [string, string];
|
|
195
|
+
}): DataFrame;
|
|
196
|
+
/**
|
|
197
|
+
* Concatenate DataFrames vertically (union)
|
|
198
|
+
*/
|
|
199
|
+
concat(other: DataFrame | DataFrame[], ignoreIndex?: boolean): DataFrame;
|
|
200
|
+
/**
|
|
201
|
+
* Union (alias for concat)
|
|
202
|
+
*/
|
|
203
|
+
union(other: DataFrame): DataFrame;
|
|
204
|
+
/**
|
|
205
|
+
* Apply function to each row
|
|
206
|
+
*/
|
|
207
|
+
apply(fn: (row: Record<string, any>, index: number) => Record<string, any>): DataFrame;
|
|
208
|
+
/**
|
|
209
|
+
* Map function over a column
|
|
210
|
+
*/
|
|
211
|
+
map(column: string, fn: (value: any, index: number) => any): DataFrame;
|
|
212
|
+
/**
|
|
213
|
+
* Pivot table
|
|
214
|
+
*/
|
|
215
|
+
pivot(index: string, columns: string, values: string, aggFunc?: 'sum' | 'mean' | 'count' | 'first'): DataFrame;
|
|
216
|
+
/**
|
|
217
|
+
* Melt (unpivot) wide format to long format
|
|
218
|
+
*/
|
|
219
|
+
melt(idVars: string[], valueVars?: string[], varName?: string, valueName?: string): DataFrame;
|
|
220
|
+
/**
|
|
221
|
+
* Describe numeric columns
|
|
222
|
+
*/
|
|
45
223
|
describe(): Record<string, any>;
|
|
46
|
-
|
|
47
|
-
|
|
224
|
+
/**
|
|
225
|
+
* Get info about DataFrame
|
|
226
|
+
*/
|
|
227
|
+
info(): {
|
|
228
|
+
rows: number;
|
|
229
|
+
columns: number;
|
|
230
|
+
dtypes: Record<string, DataType>;
|
|
231
|
+
nullCounts: Record<string, number>;
|
|
232
|
+
memoryEstimate: number;
|
|
233
|
+
};
|
|
234
|
+
/**
|
|
235
|
+
* Convert to CSV string
|
|
236
|
+
*/
|
|
48
237
|
toCSV(delimiter?: string): string;
|
|
49
|
-
|
|
238
|
+
/**
|
|
239
|
+
* Convert to JSON string
|
|
240
|
+
*/
|
|
241
|
+
toJSON(orient?: 'records' | 'columns' | 'split'): string;
|
|
242
|
+
/**
|
|
243
|
+
* Clone the DataFrame
|
|
244
|
+
*/
|
|
245
|
+
clone(): DataFrame;
|
|
246
|
+
/**
|
|
247
|
+
* Print preview (for debugging)
|
|
248
|
+
*/
|
|
249
|
+
print(n?: number): void;
|
|
50
250
|
}
|
|
251
|
+
/**
|
|
252
|
+
* GroupedDataFrame for group-by operations
|
|
253
|
+
*/
|
|
51
254
|
export declare class GroupedDataFrame {
|
|
255
|
+
private _df;
|
|
256
|
+
private _groupCols;
|
|
52
257
|
private _groups;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
258
|
+
constructor(df: DataFrame, groupCols: string[]);
|
|
259
|
+
/**
|
|
260
|
+
* Aggregate groups
|
|
261
|
+
*/
|
|
262
|
+
agg(aggregations: Record<string, 'sum' | 'mean' | 'min' | 'max' | 'count' | 'first' | 'last' | ((values: any[]) => any)>): DataFrame;
|
|
263
|
+
/**
|
|
264
|
+
* Count per group
|
|
265
|
+
*/
|
|
56
266
|
count(): DataFrame;
|
|
57
|
-
|
|
267
|
+
/**
|
|
268
|
+
* Sum per group
|
|
269
|
+
*/
|
|
270
|
+
sum(column: string): DataFrame;
|
|
271
|
+
/**
|
|
272
|
+
* Mean per group
|
|
273
|
+
*/
|
|
274
|
+
mean(column: string): DataFrame;
|
|
275
|
+
/**
|
|
276
|
+
* Get number of groups
|
|
277
|
+
*/
|
|
278
|
+
get ngroups(): number;
|
|
279
|
+
/**
|
|
280
|
+
* Get group keys
|
|
281
|
+
*/
|
|
282
|
+
get groups(): string[];
|
|
58
283
|
}
|
|
59
284
|
//# sourceMappingURL=DataFrame.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataFrame.d.ts","sourceRoot":"","sources":["DataFrame.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"DataFrame.d.ts","sourceRoot":"","sources":["DataFrame.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEnF,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,QAAQ,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,GAAG,CAAC,EAAE,GAAG,CAAC;CACb;AAED,MAAM,WAAW,gBAAgB;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,qBAAa,SAAS;IAClB,OAAO,CAAC,QAAQ,CAAY;IAC5B,OAAO,CAAC,KAAK,CAAsB;IACnC,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,OAAO,CAA4B;IAC3C,OAAO,CAAC,WAAW,CAAU;gBAGzB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,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