unplugin-kubb 5.0.0 → 5.0.1
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/LICENSE +10 -17
- package/dist/astro.cjs +4 -5
- package/dist/astro.cjs.map +1 -1
- package/dist/astro.d.ts +3 -2
- package/dist/astro.js +2 -3
- package/dist/astro.js.map +1 -1
- package/dist/{chunk-DKWOrOAv.js → chunk--u3MIqq1.js} +1 -2
- package/dist/esbuild.cjs +3 -6
- package/dist/esbuild.cjs.map +1 -1
- package/dist/esbuild.d.ts +3 -2
- package/dist/esbuild.js +2 -3
- package/dist/esbuild.js.map +1 -1
- package/dist/farm.cjs +3 -6
- package/dist/farm.cjs.map +1 -1
- package/dist/farm.d.ts +3 -2
- package/dist/farm.js +2 -3
- package/dist/farm.js.map +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/dist/nuxt.cjs +4 -5
- package/dist/nuxt.cjs.map +1 -1
- package/dist/nuxt.d.ts +1 -1
- package/dist/nuxt.js +2 -3
- package/dist/nuxt.js.map +1 -1
- package/dist/rolldown.cjs +3 -6
- package/dist/rolldown.cjs.map +1 -1
- package/dist/rolldown.d.ts +3 -2
- package/dist/rolldown.js +2 -3
- package/dist/rolldown.js.map +1 -1
- package/dist/rollup.cjs +3 -6
- package/dist/rollup.cjs.map +1 -1
- package/dist/rollup.d.ts +3 -2
- package/dist/rollup.js +2 -3
- package/dist/rollup.js.map +1 -1
- package/dist/rspack.cjs +3 -6
- package/dist/rspack.cjs.map +1 -1
- package/dist/rspack.d.ts +3 -2
- package/dist/rspack.js +2 -3
- package/dist/rspack.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/unpluginFactory-0sYXb5x6.js +157 -0
- package/dist/unpluginFactory-0sYXb5x6.js.map +1 -0
- package/dist/unpluginFactory-BpZ2psBF.cjs +200 -0
- package/dist/unpluginFactory-BpZ2psBF.cjs.map +1 -0
- package/dist/unpluginFactory.cjs +3 -90
- package/dist/unpluginFactory.d.ts +1 -1
- package/dist/unpluginFactory.js +1 -88
- package/dist/vite.cjs +3 -6
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.d.ts +3 -2
- package/dist/vite.js +2 -3
- package/dist/vite.js.map +1 -1
- package/dist/webpack.cjs +3 -6
- package/dist/webpack.cjs.map +1 -1
- package/dist/webpack.d.ts +4 -3
- package/dist/webpack.js +2 -3
- package/dist/webpack.js.map +1 -1
- package/package.json +10 -8
- package/src/unpluginFactory.ts +1 -1
- package/dist/package-ClLHpgT2.js +0 -6
- package/dist/package-ClLHpgT2.js.map +0 -1
- package/dist/package-uutExRPO.cjs +0 -55
- package/dist/package-uutExRPO.cjs.map +0 -1
- package/dist/unpluginFactory.cjs.map +0 -1
- package/dist/unpluginFactory.js.map +0 -1
package/dist/webpack.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpack.cjs","names":["unpluginFactory"],"sources":["../src/webpack.ts"],"sourcesContent":["import type { UnpluginFactoryOutput } from 'unplugin'\nimport { createWebpackPlugin } from 'unplugin'\nimport type { WebpackPluginInstance } from 'webpack'\nimport type { Options } from './types.ts'\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createWebpackPlugin(unpluginFactory) as unknown as UnpluginFactoryOutput<Options, WebpackPluginInstance>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"webpack.cjs","names":["unpluginFactory"],"sources":["../src/webpack.ts"],"sourcesContent":["import type { UnpluginFactoryOutput } from 'unplugin'\nimport { createWebpackPlugin } from 'unplugin'\nimport type { WebpackPluginInstance } from 'webpack'\nimport type { Options } from './types.ts'\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createWebpackPlugin(unpluginFactory) as unknown as UnpluginFactoryOutput<Options, WebpackPluginInstance>\n"],"mappings":";;AAMA,IAAA,mBAAA,uBAAA,qBAAmCA,wBAAAA,gBAAgB"}
|
package/dist/webpack.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { t as __name } from "./chunk
|
|
1
|
+
import { t as __name } from "./chunk--u3MIqq1.js";
|
|
2
2
|
import { Options } from "./types.js";
|
|
3
3
|
import { UnpluginFactoryOutput } from "unplugin";
|
|
4
4
|
import { WebpackPluginInstance } from "webpack";
|
|
5
5
|
|
|
6
6
|
//#region src/webpack.d.ts
|
|
7
7
|
declare const _default: UnpluginFactoryOutput<Options, WebpackPluginInstance>;
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
//#endregion
|
|
9
|
+
export { _default as default };
|
|
10
|
+
//# sourceMappingURL=webpack.d.ts.map
|
package/dist/webpack.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { unpluginFactory } from "./unpluginFactory.js";
|
|
1
|
+
import { t as unpluginFactory } from "./unpluginFactory-0sYXb5x6.js";
|
|
2
2
|
import { createWebpackPlugin } from "unplugin";
|
|
3
|
-
|
|
4
3
|
//#region src/webpack.ts
|
|
5
4
|
var webpack_default = createWebpackPlugin(unpluginFactory);
|
|
6
|
-
|
|
7
5
|
//#endregion
|
|
8
6
|
export { webpack_default as default };
|
|
7
|
+
|
|
9
8
|
//# sourceMappingURL=webpack.js.map
|
package/dist/webpack.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpack.js","names":[],"sources":["../src/webpack.ts"],"sourcesContent":["import type { UnpluginFactoryOutput } from 'unplugin'\nimport { createWebpackPlugin } from 'unplugin'\nimport type { WebpackPluginInstance } from 'webpack'\nimport type { Options } from './types.ts'\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createWebpackPlugin(unpluginFactory) as unknown as UnpluginFactoryOutput<Options, WebpackPluginInstance>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"webpack.js","names":[],"sources":["../src/webpack.ts"],"sourcesContent":["import type { UnpluginFactoryOutput } from 'unplugin'\nimport { createWebpackPlugin } from 'unplugin'\nimport type { WebpackPluginInstance } from 'webpack'\nimport type { Options } from './types.ts'\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createWebpackPlugin(unpluginFactory) as unknown as UnpluginFactoryOutput<Options, WebpackPluginInstance>\n"],"mappings":";;;AAMA,IAAA,kBAAe,oBAAoB,gBAAgB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unplugin-kubb",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.1",
|
|
4
4
|
"description": "Universal build plugin for Kubb, integrating OpenAPI code generation into Vite, Webpack, Rollup, esbuild, Rspack, Nuxt, and Astro build processes.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"unplugin",
|
|
@@ -93,21 +93,23 @@
|
|
|
93
93
|
"src",
|
|
94
94
|
"dist",
|
|
95
95
|
"!/**/**.test.**",
|
|
96
|
-
"!/**/__tests__/**"
|
|
96
|
+
"!/**/__tests__/**",
|
|
97
|
+
"!/**/__snapshots__/**"
|
|
97
98
|
],
|
|
98
99
|
"dependencies": {
|
|
99
|
-
"unplugin": "^3.0.0"
|
|
100
|
+
"unplugin": "^3.0.0",
|
|
101
|
+
"@kubb/core": "4.33.4"
|
|
100
102
|
},
|
|
101
103
|
"devDependencies": {
|
|
102
104
|
"@farmfe/core": "^1.7.11",
|
|
103
|
-
"@nuxt/kit": "^4.
|
|
104
|
-
"@nuxt/schema": "^4.
|
|
105
|
+
"@nuxt/kit": "^4.4.2",
|
|
106
|
+
"@nuxt/schema": "^4.4.2",
|
|
105
107
|
"esbuild": "*",
|
|
106
|
-
"rolldown": "~1.0.0-rc.
|
|
108
|
+
"rolldown": "~1.0.0-rc.9",
|
|
107
109
|
"rollup": "^4.59.0",
|
|
108
110
|
"vite": "^7.3.1",
|
|
109
|
-
"webpack": "^5.105.
|
|
110
|
-
"@
|
|
111
|
+
"webpack": "^5.105.4",
|
|
112
|
+
"@internals/utils": "0.0.0"
|
|
111
113
|
},
|
|
112
114
|
"peerDependencies": {
|
|
113
115
|
"@farmfe/core": "^1.7.0",
|
package/src/unpluginFactory.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import process from 'node:process'
|
|
2
|
+
import { AsyncEventEmitter } from '@internals/utils'
|
|
2
3
|
import { type Config, type KubbEvents, safeBuild } from '@kubb/core'
|
|
3
|
-
import { AsyncEventEmitter } from '@kubb/core/utils'
|
|
4
4
|
import type { UnpluginFactory } from 'unplugin'
|
|
5
5
|
import { version as unpluginVersion } from '../package.json'
|
|
6
6
|
import type { Options } from './types.ts'
|
package/dist/package-ClLHpgT2.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"package-ClLHpgT2.js","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
//#region \0rolldown/runtime.js
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __name = (target, value) => __defProp(target, "name", {
|
|
5
|
-
value,
|
|
6
|
-
configurable: true
|
|
7
|
-
});
|
|
8
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
10
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
11
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
15
|
-
key = keys[i];
|
|
16
|
-
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
17
|
-
__defProp(to, key, {
|
|
18
|
-
get: ((k) => from[k]).bind(null, key),
|
|
19
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
27
|
-
value: mod,
|
|
28
|
-
enumerable: true
|
|
29
|
-
}) : target, mod));
|
|
30
|
-
|
|
31
|
-
//#endregion
|
|
32
|
-
|
|
33
|
-
//#region package.json
|
|
34
|
-
var version = "5.0.0";
|
|
35
|
-
|
|
36
|
-
//#endregion
|
|
37
|
-
Object.defineProperty(exports, '__name', {
|
|
38
|
-
enumerable: true,
|
|
39
|
-
get: function () {
|
|
40
|
-
return __name;
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
Object.defineProperty(exports, '__toESM', {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function () {
|
|
46
|
-
return __toESM;
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
Object.defineProperty(exports, 'version', {
|
|
50
|
-
enumerable: true,
|
|
51
|
-
get: function () {
|
|
52
|
-
return version;
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
//# sourceMappingURL=package-uutExRPO.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"package-uutExRPO.cjs","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unpluginFactory.cjs","names":["AsyncEventEmitter","process","unpluginVersion"],"sources":["../src/unpluginFactory.ts"],"sourcesContent":["import process from 'node:process'\nimport { type Config, type KubbEvents, safeBuild } from '@kubb/core'\nimport { AsyncEventEmitter } from '@kubb/core/utils'\nimport type { UnpluginFactory } from 'unplugin'\nimport { version as unpluginVersion } from '../package.json'\nimport type { Options } from './types.ts'\n\ntype RollupContext = {\n info?: (message: string) => void\n warn?: (message: string) => void\n error?: (message: string) => void\n}\n\nexport const unpluginFactory: UnpluginFactory<Options | undefined> = (options, meta) => {\n const name = 'unplugin-kubb' as const\n const events = new AsyncEventEmitter<KubbEvents>()\n const isVite = meta.framework === 'vite'\n const hrStart = process.hrtime()\n\n async function runBuild(ctx: RollupContext) {\n if (!options?.config) {\n if (ctx.error) {\n ctx.error?.(`[${name}] Config is not set`)\n } else {\n console.error(`[${name}] Config is not set`)\n }\n return\n }\n\n events.on('lifecycle:start', (version) => {\n console.log(`Kubb Unplugin ${version} 🧩`)\n })\n\n events.on('error', (error) => {\n console.error(`✗ ${error?.message || 'failed'}`)\n })\n\n events.on('warn', (message) => {\n console.warn(`⚠ ${message}`)\n })\n\n events.on('info', (message) => {\n console.info(`ℹ ${message}`)\n })\n\n events.on('success', (message) => {\n console.log(`✓ ${message}`)\n })\n\n events.on('plugin:end', (plugin, { duration }) => {\n const durationStr = duration >= 1000 ? `${(duration / 1000).toFixed(2)}s` : `${duration}ms`\n\n console.log(`✓ ${plugin.name} completed in ${durationStr}`)\n })\n\n events.on('files:processing:end', () => {\n const text = '✓ Files written successfully'\n\n console.log(text)\n })\n\n events.on('generation:end', (config) => {\n console.log(config.name ? `✓ Generation completed for ${config.name}` : '✓ Generation completed')\n })\n\n events.on('generation:summary', (config, { status, failedPlugins }) => {\n const pluginsCount = config.plugins?.length || 0\n const successCount = pluginsCount - failedPlugins.size\n\n console.log(\n status === 'success'\n ? `Kubb Summary: ✓ ${`${successCount} successful`}, ${pluginsCount} total`\n : `Kubb Summary: ✓ ${`${successCount} successful`}, ✗ ${`${failedPlugins.size} failed`}, ${pluginsCount} total`,\n )\n })\n\n await events.emit('lifecycle:start', unpluginVersion)\n\n const { root: _root, ...userConfig } = options.config as Config\n\n await events.emit('generation:start', options.config as Config)\n\n const { error, failedPlugins, pluginTimings, files, sources } = await safeBuild({\n config: {\n root: process.cwd(),\n ...userConfig,\n output: {\n write: true,\n ...userConfig.output,\n },\n },\n events,\n })\n\n const hasFailures = failedPlugins.size > 0 || error\n if (hasFailures) {\n // Collect all errors from failed plugins and general error\n const allErrors: Error[] = [\n error,\n ...Array.from(failedPlugins)\n .filter((it) => it.error)\n .map((it) => it.error),\n ].filter(Boolean)\n\n allErrors.forEach((err) => {\n events.emit('error', err)\n })\n }\n\n await events.emit('generation:end', options.config as Config, files, sources)\n await events.emit('generation:summary', options.config as Config, {\n failedPlugins,\n filesCreated: files.length,\n status: failedPlugins.size > 0 || error ? 'failed' : 'success',\n hrStart,\n pluginTimings,\n })\n\n await events.emit('lifecycle:end')\n }\n\n return {\n name,\n enforce: 'pre',\n apply: isVite ? 'build' : undefined,\n async buildStart() {\n await runBuild(this as unknown as RollupContext)\n },\n\n vite: {},\n }\n}\n"],"mappings":";;;;;;;;AAaA,MAAa,mBAAyD,SAAS,SAAS;CACtF,MAAM,OAAO;CACb,MAAM,SAAS,IAAIA,oCAA+B;CAClD,MAAM,SAAS,KAAK,cAAc;CAClC,MAAM,UAAUC,qBAAQ,QAAQ;CAEhC,eAAe,SAAS,KAAoB;AAC1C,MAAI,CAAC,SAAS,QAAQ;AACpB,OAAI,IAAI,MACN,KAAI,QAAQ,IAAI,KAAK,qBAAqB;OAE1C,SAAQ,MAAM,IAAI,KAAK,qBAAqB;AAE9C;;AAGF,SAAO,GAAG,oBAAoB,YAAY;AACxC,WAAQ,IAAI,iBAAiB,QAAQ,KAAK;IAC1C;AAEF,SAAO,GAAG,UAAU,UAAU;AAC5B,WAAQ,MAAM,KAAK,OAAO,WAAW,WAAW;IAChD;AAEF,SAAO,GAAG,SAAS,YAAY;AAC7B,WAAQ,KAAK,KAAK,UAAU;IAC5B;AAEF,SAAO,GAAG,SAAS,YAAY;AAC7B,WAAQ,KAAK,KAAK,UAAU;IAC5B;AAEF,SAAO,GAAG,YAAY,YAAY;AAChC,WAAQ,IAAI,KAAK,UAAU;IAC3B;AAEF,SAAO,GAAG,eAAe,QAAQ,EAAE,eAAe;GAChD,MAAM,cAAc,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ACpB,QAAQ,cAAc,OAAO,KAAK,QAAQ,WAAW;GACrD;GACA;GACD,CAAC;AAEF,QAAM,OAAO,KAAK,gBAAgB;;AAGpC,QAAO;EACL;EACA,SAAS;EACT,OAAO,SAAS,UAAU;EAC1B,MAAM,aAAa;AACjB,SAAM,SAAS,KAAiC;;EAGlD,MAAM,EAAE;EACT"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unpluginFactory.js","names":["unpluginVersion"],"sources":["../src/unpluginFactory.ts"],"sourcesContent":["import process from 'node:process'\nimport { type Config, type KubbEvents, safeBuild } from '@kubb/core'\nimport { AsyncEventEmitter } from '@kubb/core/utils'\nimport type { UnpluginFactory } from 'unplugin'\nimport { version as unpluginVersion } from '../package.json'\nimport type { Options } from './types.ts'\n\ntype RollupContext = {\n info?: (message: string) => void\n warn?: (message: string) => void\n error?: (message: string) => void\n}\n\nexport const unpluginFactory: UnpluginFactory<Options | undefined> = (options, meta) => {\n const name = 'unplugin-kubb' as const\n const events = new AsyncEventEmitter<KubbEvents>()\n const isVite = meta.framework === 'vite'\n const hrStart = process.hrtime()\n\n async function runBuild(ctx: RollupContext) {\n if (!options?.config) {\n if (ctx.error) {\n ctx.error?.(`[${name}] Config is not set`)\n } else {\n console.error(`[${name}] Config is not set`)\n }\n return\n }\n\n events.on('lifecycle:start', (version) => {\n console.log(`Kubb Unplugin ${version} 🧩`)\n })\n\n events.on('error', (error) => {\n console.error(`✗ ${error?.message || 'failed'}`)\n })\n\n events.on('warn', (message) => {\n console.warn(`⚠ ${message}`)\n })\n\n events.on('info', (message) => {\n console.info(`ℹ ${message}`)\n })\n\n events.on('success', (message) => {\n console.log(`✓ ${message}`)\n })\n\n events.on('plugin:end', (plugin, { duration }) => {\n const durationStr = duration >= 1000 ? `${(duration / 1000).toFixed(2)}s` : `${duration}ms`\n\n console.log(`✓ ${plugin.name} completed in ${durationStr}`)\n })\n\n events.on('files:processing:end', () => {\n const text = '✓ Files written successfully'\n\n console.log(text)\n })\n\n events.on('generation:end', (config) => {\n console.log(config.name ? `✓ Generation completed for ${config.name}` : '✓ Generation completed')\n })\n\n events.on('generation:summary', (config, { status, failedPlugins }) => {\n const pluginsCount = config.plugins?.length || 0\n const successCount = pluginsCount - failedPlugins.size\n\n console.log(\n status === 'success'\n ? `Kubb Summary: ✓ ${`${successCount} successful`}, ${pluginsCount} total`\n : `Kubb Summary: ✓ ${`${successCount} successful`}, ✗ ${`${failedPlugins.size} failed`}, ${pluginsCount} total`,\n )\n })\n\n await events.emit('lifecycle:start', unpluginVersion)\n\n const { root: _root, ...userConfig } = options.config as Config\n\n await events.emit('generation:start', options.config as Config)\n\n const { error, failedPlugins, pluginTimings, files, sources } = await safeBuild({\n config: {\n root: process.cwd(),\n ...userConfig,\n output: {\n write: true,\n ...userConfig.output,\n },\n },\n events,\n })\n\n const hasFailures = failedPlugins.size > 0 || error\n if (hasFailures) {\n // Collect all errors from failed plugins and general error\n const allErrors: Error[] = [\n error,\n ...Array.from(failedPlugins)\n .filter((it) => it.error)\n .map((it) => it.error),\n ].filter(Boolean)\n\n allErrors.forEach((err) => {\n events.emit('error', err)\n })\n }\n\n await events.emit('generation:end', options.config as Config, files, sources)\n await events.emit('generation:summary', options.config as Config, {\n failedPlugins,\n filesCreated: files.length,\n status: failedPlugins.size > 0 || error ? 'failed' : 'success',\n hrStart,\n pluginTimings,\n })\n\n await events.emit('lifecycle:end')\n }\n\n return {\n name,\n enforce: 'pre',\n apply: isVite ? 'build' : undefined,\n async buildStart() {\n await runBuild(this as unknown as RollupContext)\n },\n\n vite: {},\n }\n}\n"],"mappings":";;;;;;;AAaA,MAAa,mBAAyD,SAAS,SAAS;CACtF,MAAM,OAAO;CACb,MAAM,SAAS,IAAI,mBAA+B;CAClD,MAAM,SAAS,KAAK,cAAc;CAClC,MAAM,UAAU,QAAQ,QAAQ;CAEhC,eAAe,SAAS,KAAoB;AAC1C,MAAI,CAAC,SAAS,QAAQ;AACpB,OAAI,IAAI,MACN,KA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