@noctuatech/uswds 1.4.4 → 1.4.5
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/package.json +6 -6
- package/src/lib/file-input/file-input.element.test.ts +128 -0
- package/src/lib/file-input/file-input.element.ts +39 -3
- package/target/lib/file-input/file-input.element.js +33 -3
- package/target/lib/file-input/file-input.element.js.map +1 -1
- package/target/lib/file-input/file-input.element.test.js +87 -0
- package/target/lib/file-input/file-input.element.test.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noctuatech/uswds",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"workspaces": [
|
|
6
6
|
"packages/**"
|
|
@@ -112,14 +112,14 @@
|
|
|
112
112
|
},
|
|
113
113
|
"devDependencies": {
|
|
114
114
|
"@11ty/eleventy": "^3.0.0",
|
|
115
|
-
"@chromatic-com/storybook": "^4.
|
|
115
|
+
"@chromatic-com/storybook": "^4.1.2",
|
|
116
116
|
"@open-wc/testing": "^4.0.0",
|
|
117
|
-
"@storybook/addon-docs": "^
|
|
118
|
-
"@storybook/web-components-vite": "^
|
|
117
|
+
"@storybook/addon-docs": "^10.0.7",
|
|
118
|
+
"@storybook/web-components-vite": "^10.0.7",
|
|
119
119
|
"@testing-library/dom": "^10.4.0",
|
|
120
120
|
"@testing-library/user-event": "^14.6.1",
|
|
121
121
|
"@types/mocha": "^10.0.7",
|
|
122
|
-
"@types/node": "^
|
|
122
|
+
"@types/node": "^24.0.0",
|
|
123
123
|
"@uswds/uswds": "^3.10.0",
|
|
124
124
|
"@web/dev-server-import-maps": "^0.2.1",
|
|
125
125
|
"@web/test-runner": "^0.20.0",
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
"mocha": "^11.0.0",
|
|
132
132
|
"plop": "^4.0.1",
|
|
133
133
|
"prettier": "^3.5.3",
|
|
134
|
-
"storybook": "^
|
|
134
|
+
"storybook": "^10.0.7",
|
|
135
135
|
"typescript": "^5.8.0",
|
|
136
136
|
"wireit": "^0.14.9"
|
|
137
137
|
},
|
|
@@ -69,4 +69,132 @@ describe('usa-file-input', () => {
|
|
|
69
69
|
assert.equal(fileInput.files?.length, 1);
|
|
70
70
|
assert.equal(fileInput.files?.[0].name, 'test.txt');
|
|
71
71
|
});
|
|
72
|
+
|
|
73
|
+
it('should fire input event when a file is dragged and dropped', async () => {
|
|
74
|
+
const fileInput = await fixture<USAFileInputElement>(html`
|
|
75
|
+
<usa-file-input> Input accepts a single file </usa-file-input>
|
|
76
|
+
`);
|
|
77
|
+
|
|
78
|
+
const nativeInput = fileInput.shadowRoot?.querySelector('input');
|
|
79
|
+
|
|
80
|
+
assert.isOk(nativeInput);
|
|
81
|
+
|
|
82
|
+
// Create a spy to track input events
|
|
83
|
+
let inputEventFired = false;
|
|
84
|
+
fileInput.addEventListener('input', () => {
|
|
85
|
+
inputEventFired = true;
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
// Simulate drag and drop with a file
|
|
89
|
+
const data = new DataTransfer();
|
|
90
|
+
data.items.add(new File([], 'test.txt'));
|
|
91
|
+
|
|
92
|
+
const dropEvent = new DragEvent('drop', {
|
|
93
|
+
dataTransfer: data,
|
|
94
|
+
bubbles: true,
|
|
95
|
+
cancelable: true,
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
nativeInput.dispatchEvent(dropEvent);
|
|
99
|
+
|
|
100
|
+
// Wait for effects to resolve
|
|
101
|
+
await Promise.resolve();
|
|
102
|
+
|
|
103
|
+
// Verify that the input event was fired
|
|
104
|
+
assert.isTrue(inputEventFired);
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it('should filter dropped files based on accept MIME type', async () => {
|
|
108
|
+
const fileInput = await fixture<USAFileInputElement>(html`
|
|
109
|
+
<usa-file-input accept="image/*"> Input accepts only images </usa-file-input>
|
|
110
|
+
`);
|
|
111
|
+
|
|
112
|
+
const nativeInput = fileInput.shadowRoot?.querySelector('input');
|
|
113
|
+
|
|
114
|
+
assert.isOk(nativeInput);
|
|
115
|
+
|
|
116
|
+
// Simulate drag and drop with mixed file types
|
|
117
|
+
const data = new DataTransfer();
|
|
118
|
+
data.items.add(new File([], 'image.png', { type: 'image/png' }));
|
|
119
|
+
data.items.add(new File([], 'document.txt', { type: 'text/plain' }));
|
|
120
|
+
data.items.add(new File([], 'photo.jpg', { type: 'image/jpeg' }));
|
|
121
|
+
|
|
122
|
+
const dropEvent = new DragEvent('drop', {
|
|
123
|
+
dataTransfer: data,
|
|
124
|
+
bubbles: true,
|
|
125
|
+
cancelable: true,
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
nativeInput.dispatchEvent(dropEvent);
|
|
129
|
+
|
|
130
|
+
// Wait for effects to resolve
|
|
131
|
+
await Promise.resolve();
|
|
132
|
+
|
|
133
|
+
// Verify that only image files were accepted
|
|
134
|
+
assert.equal(fileInput.files?.length, 2);
|
|
135
|
+
assert.equal(fileInput.files?.[0].name, 'image.png');
|
|
136
|
+
assert.equal(fileInput.files?.[1].name, 'photo.jpg');
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
it('should filter dropped files based on accept file extension', async () => {
|
|
140
|
+
const fileInput = await fixture<USAFileInputElement>(html`
|
|
141
|
+
<usa-file-input accept=".txt,.pdf"> Input accepts text and PDF files </usa-file-input>
|
|
142
|
+
`);
|
|
143
|
+
|
|
144
|
+
const nativeInput = fileInput.shadowRoot?.querySelector('input');
|
|
145
|
+
|
|
146
|
+
assert.isOk(nativeInput);
|
|
147
|
+
|
|
148
|
+
// Simulate drag and drop with mixed file types
|
|
149
|
+
const data = new DataTransfer();
|
|
150
|
+
data.items.add(new File([], 'document.txt'));
|
|
151
|
+
data.items.add(new File([], 'image.png'));
|
|
152
|
+
data.items.add(new File([], 'report.pdf'));
|
|
153
|
+
|
|
154
|
+
const dropEvent = new DragEvent('drop', {
|
|
155
|
+
dataTransfer: data,
|
|
156
|
+
bubbles: true,
|
|
157
|
+
cancelable: true,
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
nativeInput.dispatchEvent(dropEvent);
|
|
161
|
+
|
|
162
|
+
// Wait for effects to resolve
|
|
163
|
+
await Promise.resolve();
|
|
164
|
+
|
|
165
|
+
// Verify that only .txt and .pdf files were accepted
|
|
166
|
+
assert.equal(fileInput.files?.length, 2);
|
|
167
|
+
assert.equal(fileInput.files?.[0].name, 'document.txt');
|
|
168
|
+
assert.equal(fileInput.files?.[1].name, 'report.pdf');
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
it('should accept all dropped files when accept property is not set', async () => {
|
|
172
|
+
const fileInput = await fixture<USAFileInputElement>(html`
|
|
173
|
+
<usa-file-input> Input accepts all files </usa-file-input>
|
|
174
|
+
`);
|
|
175
|
+
|
|
176
|
+
const nativeInput = fileInput.shadowRoot?.querySelector('input');
|
|
177
|
+
|
|
178
|
+
assert.isOk(nativeInput);
|
|
179
|
+
|
|
180
|
+
// Simulate drag and drop with mixed file types
|
|
181
|
+
const data = new DataTransfer();
|
|
182
|
+
data.items.add(new File([], 'document.txt'));
|
|
183
|
+
data.items.add(new File([], 'image.png'));
|
|
184
|
+
data.items.add(new File([], 'report.pdf'));
|
|
185
|
+
|
|
186
|
+
const dropEvent = new DragEvent('drop', {
|
|
187
|
+
dataTransfer: data,
|
|
188
|
+
bubbles: true,
|
|
189
|
+
cancelable: true,
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
nativeInput.dispatchEvent(dropEvent);
|
|
193
|
+
|
|
194
|
+
// Wait for effects to resolve
|
|
195
|
+
await Promise.resolve();
|
|
196
|
+
|
|
197
|
+
// Verify that all files were accepted
|
|
198
|
+
assert.equal(fileInput.files?.length, 3);
|
|
199
|
+
});
|
|
72
200
|
});
|
|
@@ -163,9 +163,11 @@ export class USAFileInputElement extends HTMLElement {
|
|
|
163
163
|
|
|
164
164
|
const input = this.#input();
|
|
165
165
|
|
|
166
|
-
|
|
166
|
+
if (input.files) {
|
|
167
|
+
this.files = input.files;
|
|
167
168
|
|
|
168
|
-
|
|
169
|
+
this.dispatchEvent(new Event('input', { bubbles: true }));
|
|
170
|
+
}
|
|
169
171
|
}
|
|
170
172
|
|
|
171
173
|
@listen('dragenter')
|
|
@@ -191,13 +193,47 @@ export class USAFileInputElement extends HTMLElement {
|
|
|
191
193
|
if (item.kind === 'file') {
|
|
192
194
|
const file = item.getAsFile();
|
|
193
195
|
|
|
194
|
-
if (file) {
|
|
196
|
+
if (file && this.#isFileAccepted(file)) {
|
|
195
197
|
data.items.add(file);
|
|
196
198
|
}
|
|
197
199
|
}
|
|
198
200
|
}
|
|
199
201
|
|
|
200
202
|
this.files = data.files;
|
|
203
|
+
|
|
204
|
+
this.dispatchEvent(new Event('input', { bubbles: true }));
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
#isFileAccepted(file: File): boolean {
|
|
209
|
+
// If no accept property is set, accept all files
|
|
210
|
+
if (!this.accept) {
|
|
211
|
+
return true;
|
|
201
212
|
}
|
|
213
|
+
|
|
214
|
+
// Split the accept string by comma and trim whitespace
|
|
215
|
+
const acceptedTypes = this.accept.split(',').map((type) => type.trim());
|
|
216
|
+
|
|
217
|
+
for (const acceptType of acceptedTypes) {
|
|
218
|
+
if (acceptType.endsWith('/*')) {
|
|
219
|
+
// Handle wildcard types like "image/*" or "audio/*"
|
|
220
|
+
|
|
221
|
+
const mainType = acceptType.split('/')[0];
|
|
222
|
+
if (file.type.startsWith(mainType + '/')) {
|
|
223
|
+
return true;
|
|
224
|
+
}
|
|
225
|
+
} else if (acceptType.startsWith('.')) {
|
|
226
|
+
if (file.name.toLowerCase().endsWith(acceptType.toLowerCase())) {
|
|
227
|
+
return true;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// Handle exact MIME type match
|
|
232
|
+
if (file.type === acceptType) {
|
|
233
|
+
return true;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
return false;
|
|
202
238
|
}
|
|
203
239
|
}
|
|
@@ -105,8 +105,10 @@ let USAFileInputElement = (() => {
|
|
|
105
105
|
onInputChange(e) {
|
|
106
106
|
e.stopPropagation();
|
|
107
107
|
const input = this.#input();
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
if (input.files) {
|
|
109
|
+
this.files = input.files;
|
|
110
|
+
this.dispatchEvent(new Event('input', { bubbles: true }));
|
|
111
|
+
}
|
|
110
112
|
}
|
|
111
113
|
onDragEnter() {
|
|
112
114
|
this.classList.add('dragenter');
|
|
@@ -122,13 +124,41 @@ let USAFileInputElement = (() => {
|
|
|
122
124
|
for (const item of e.dataTransfer.items) {
|
|
123
125
|
if (item.kind === 'file') {
|
|
124
126
|
const file = item.getAsFile();
|
|
125
|
-
if (file) {
|
|
127
|
+
if (file && this.#isFileAccepted(file)) {
|
|
126
128
|
data.items.add(file);
|
|
127
129
|
}
|
|
128
130
|
}
|
|
129
131
|
}
|
|
130
132
|
this.files = data.files;
|
|
133
|
+
this.dispatchEvent(new Event('input', { bubbles: true }));
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
#isFileAccepted(file) {
|
|
137
|
+
// If no accept property is set, accept all files
|
|
138
|
+
if (!this.accept) {
|
|
139
|
+
return true;
|
|
140
|
+
}
|
|
141
|
+
// Split the accept string by comma and trim whitespace
|
|
142
|
+
const acceptedTypes = this.accept.split(',').map((type) => type.trim());
|
|
143
|
+
for (const acceptType of acceptedTypes) {
|
|
144
|
+
if (acceptType.endsWith('/*')) {
|
|
145
|
+
// Handle wildcard types like "image/*" or "audio/*"
|
|
146
|
+
const mainType = acceptType.split('/')[0];
|
|
147
|
+
if (file.type.startsWith(mainType + '/')) {
|
|
148
|
+
return true;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
else if (acceptType.startsWith('.')) {
|
|
152
|
+
if (file.name.toLowerCase().endsWith(acceptType.toLowerCase())) {
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
// Handle exact MIME type match
|
|
157
|
+
if (file.type === acceptType) {
|
|
158
|
+
return true;
|
|
159
|
+
}
|
|
131
160
|
}
|
|
161
|
+
return false;
|
|
132
162
|
}
|
|
133
163
|
static {
|
|
134
164
|
__runInitializers(_classThis, _classExtraInitializers);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-input.element.js","sourceRoot":"","sources":["../../../src/lib/file-input/file-input.element.ts"],"names":[],"mappings":";AAAA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;IAuG5B,mBAAmB;4BA/F/B,OAAO,CAAC;YACP,OAAO,EAAE,gBAAgB;YACzB,SAAS,EAAE;gBACT,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8DF;gBACD,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;KA0BH;aACF;SACF,CAAC;;;;sBACuC,WAAW;;;;;;;;;;;;;;;;;;;;;;mCAAnB,SAAQ,WAAW;;;;gCAGjD,IAAI,EAAE,EACN,IAAI,EAAE;oCAGN,IAAI,EAAE,EACN,IAAI,EAAE;kCAGN,IAAI,EAAE,EACN,IAAI,EAAE;oCAGN,IAAI,EAAE,EACN,IAAI,EAAE;iCAGN,IAAI,EAAE;0CAUN,MAAM,EAAE;yCAuBR,MAAM,CAAC,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"file-input.element.js","sourceRoot":"","sources":["../../../src/lib/file-input/file-input.element.ts"],"names":[],"mappings":";AAAA,OAAO,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}
|
|
@@ -38,5 +38,92 @@ describe('usa-file-input', () => {
|
|
|
38
38
|
assert.equal(fileInput.files?.length, 1);
|
|
39
39
|
assert.equal(fileInput.files?.[0].name, 'test.txt');
|
|
40
40
|
});
|
|
41
|
+
it('should fire input event when a file is dragged and dropped', async () => {
|
|
42
|
+
const fileInput = await fixture(html `<usa-file-input>Input accepts a single file</usa-file-input>`);
|
|
43
|
+
const nativeInput = fileInput.shadowRoot?.querySelector('input');
|
|
44
|
+
assert.isOk(nativeInput);
|
|
45
|
+
// Create a spy to track input events
|
|
46
|
+
let inputEventFired = false;
|
|
47
|
+
fileInput.addEventListener('input', () => {
|
|
48
|
+
inputEventFired = true;
|
|
49
|
+
});
|
|
50
|
+
// Simulate drag and drop with a file
|
|
51
|
+
const data = new DataTransfer();
|
|
52
|
+
data.items.add(new File([], 'test.txt'));
|
|
53
|
+
const dropEvent = new DragEvent('drop', {
|
|
54
|
+
dataTransfer: data,
|
|
55
|
+
bubbles: true,
|
|
56
|
+
cancelable: true,
|
|
57
|
+
});
|
|
58
|
+
nativeInput.dispatchEvent(dropEvent);
|
|
59
|
+
// Wait for effects to resolve
|
|
60
|
+
await Promise.resolve();
|
|
61
|
+
// Verify that the input event was fired
|
|
62
|
+
assert.isTrue(inputEventFired);
|
|
63
|
+
});
|
|
64
|
+
it('should filter dropped files based on accept MIME type', async () => {
|
|
65
|
+
const fileInput = await fixture(html `<usa-file-input accept="image/*">Input accepts only images</usa-file-input>`);
|
|
66
|
+
const nativeInput = fileInput.shadowRoot?.querySelector('input');
|
|
67
|
+
assert.isOk(nativeInput);
|
|
68
|
+
// Simulate drag and drop with mixed file types
|
|
69
|
+
const data = new DataTransfer();
|
|
70
|
+
data.items.add(new File([], 'image.png', { type: 'image/png' }));
|
|
71
|
+
data.items.add(new File([], 'document.txt', { type: 'text/plain' }));
|
|
72
|
+
data.items.add(new File([], 'photo.jpg', { type: 'image/jpeg' }));
|
|
73
|
+
const dropEvent = new DragEvent('drop', {
|
|
74
|
+
dataTransfer: data,
|
|
75
|
+
bubbles: true,
|
|
76
|
+
cancelable: true,
|
|
77
|
+
});
|
|
78
|
+
nativeInput.dispatchEvent(dropEvent);
|
|
79
|
+
// Wait for effects to resolve
|
|
80
|
+
await Promise.resolve();
|
|
81
|
+
// Verify that only image files were accepted
|
|
82
|
+
assert.equal(fileInput.files?.length, 2);
|
|
83
|
+
assert.equal(fileInput.files?.[0].name, 'image.png');
|
|
84
|
+
assert.equal(fileInput.files?.[1].name, 'photo.jpg');
|
|
85
|
+
});
|
|
86
|
+
it('should filter dropped files based on accept file extension', async () => {
|
|
87
|
+
const fileInput = await fixture(html `<usa-file-input accept=".txt,.pdf">Input accepts text and PDF files</usa-file-input>`);
|
|
88
|
+
const nativeInput = fileInput.shadowRoot?.querySelector('input');
|
|
89
|
+
assert.isOk(nativeInput);
|
|
90
|
+
// Simulate drag and drop with mixed file types
|
|
91
|
+
const data = new DataTransfer();
|
|
92
|
+
data.items.add(new File([], 'document.txt'));
|
|
93
|
+
data.items.add(new File([], 'image.png'));
|
|
94
|
+
data.items.add(new File([], 'report.pdf'));
|
|
95
|
+
const dropEvent = new DragEvent('drop', {
|
|
96
|
+
dataTransfer: data,
|
|
97
|
+
bubbles: true,
|
|
98
|
+
cancelable: true,
|
|
99
|
+
});
|
|
100
|
+
nativeInput.dispatchEvent(dropEvent);
|
|
101
|
+
// Wait for effects to resolve
|
|
102
|
+
await Promise.resolve();
|
|
103
|
+
// Verify that only .txt and .pdf files were accepted
|
|
104
|
+
assert.equal(fileInput.files?.length, 2);
|
|
105
|
+
assert.equal(fileInput.files?.[0].name, 'document.txt');
|
|
106
|
+
assert.equal(fileInput.files?.[1].name, 'report.pdf');
|
|
107
|
+
});
|
|
108
|
+
it('should accept all dropped files when accept property is not set', async () => {
|
|
109
|
+
const fileInput = await fixture(html `<usa-file-input>Input accepts all files</usa-file-input>`);
|
|
110
|
+
const nativeInput = fileInput.shadowRoot?.querySelector('input');
|
|
111
|
+
assert.isOk(nativeInput);
|
|
112
|
+
// Simulate drag and drop with mixed file types
|
|
113
|
+
const data = new DataTransfer();
|
|
114
|
+
data.items.add(new File([], 'document.txt'));
|
|
115
|
+
data.items.add(new File([], 'image.png'));
|
|
116
|
+
data.items.add(new File([], 'report.pdf'));
|
|
117
|
+
const dropEvent = new DragEvent('drop', {
|
|
118
|
+
dataTransfer: data,
|
|
119
|
+
bubbles: true,
|
|
120
|
+
cancelable: true,
|
|
121
|
+
});
|
|
122
|
+
nativeInput.dispatchEvent(dropEvent);
|
|
123
|
+
// Wait for effects to resolve
|
|
124
|
+
await Promise.resolve();
|
|
125
|
+
// Verify that all files were accepted
|
|
126
|
+
assert.equal(fileInput.files?.length, 3);
|
|
127
|
+
});
|
|
41
128
|
});
|
|
42
129
|
//# sourceMappingURL=file-input.element.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-input.element.test.js","sourceRoot":"","sources":["../../../src/lib/file-input/file-input.element.test.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAIzD,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,SAAS,GAAG,MAAM,OAAO,CAAsB,IAAI,CAAA,gDAAgD,CAAC,CAAC;QAE3G,OAAO,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mCAAmC,EAAE,KAAK,IAAI,EAAE;QACjD,MAAM,IAAI,GAAG,IAAI,YAAY,EAAE,CAAC;QAChC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC,CAAC;QAC1C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,IAAI,CA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