@andre1502/react-utilities 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +340 -0
- package/dist/Config/Config.d.ts +28 -0
- package/dist/Config/Config.js +200 -0
- package/dist/Config/Config.js.map +1 -0
- package/dist/Config/GoogleAuth.d.ts +15 -0
- package/dist/Config/GoogleAuth.js +71 -0
- package/dist/Config/GoogleAuth.js.map +1 -0
- package/dist/Config/Locales.d.ts +18 -0
- package/dist/Config/Locales.js +62 -0
- package/dist/Config/Locales.js.map +1 -0
- package/dist/Config/Output.d.ts +10 -0
- package/dist/Config/Output.js +28 -0
- package/dist/Config/Output.js.map +1 -0
- package/dist/Config/Sitemap.d.ts +13 -0
- package/dist/Config/Sitemap.js +73 -0
- package/dist/Config/Sitemap.js.map +1 -0
- package/dist/Format/NumberFormat.d.ts +6 -0
- package/dist/Format/NumberFormat.js +77 -0
- package/dist/Format/NumberFormat.js.map +1 -0
- package/dist/Format/NumberParser.d.ts +9 -0
- package/dist/Format/NumberParser.js +51 -0
- package/dist/Format/NumberParser.js.map +1 -0
- package/dist/React-BaJ1KfGF.js +87 -0
- package/dist/React-BaJ1KfGF.js.map +1 -0
- package/dist/React-qUl0CBmE.js +109 -0
- package/dist/React-qUl0CBmE.js.map +1 -0
- package/dist/ReactNative-CqUrY2ZJ.js +3856 -0
- package/dist/ReactNative-CqUrY2ZJ.js.map +1 -0
- package/dist/ReactNative-mNnws-b5.js +3834 -0
- package/dist/ReactNative-mNnws-b5.js.map +1 -0
- package/dist/Sentry/Build.d.ts +9 -0
- package/dist/Sentry/Build.js +88 -0
- package/dist/Sentry/Build.js.map +1 -0
- package/dist/Sentry/React.d.ts +18 -0
- package/dist/Sentry/React.js +104 -0
- package/dist/Sentry/React.js.map +1 -0
- package/dist/Sentry/ReactNative.d.ts +18 -0
- package/dist/Sentry/ReactNative.js +114 -0
- package/dist/Sentry/ReactNative.js.map +1 -0
- package/dist/Sentry/Utils.d.ts +2 -0
- package/dist/Sentry/Utils.js +24 -0
- package/dist/Sentry/Utils.js.map +1 -0
- package/dist/Utils/Files.d.ts +7 -0
- package/dist/Utils/Files.js +52 -0
- package/dist/Utils/Files.js.map +1 -0
- package/dist/Utils-Cq948gfa.js +20 -0
- package/dist/Utils-Cq948gfa.js.map +1 -0
- package/dist/Utils-Dilye04y.js +22 -0
- package/dist/Utils-Dilye04y.js.map +1 -0
- package/dist/config-cli.cjs +471 -0
- package/dist/config-cli.cjs.map +1 -0
- package/dist/config-cli.d.ts +34 -0
- package/dist/config-cli.js +220 -0
- package/dist/config-cli.js.map +1 -0
- package/dist/config-cli.mjs +443 -0
- package/dist/config-cli.mjs.map +1 -0
- package/dist/enums/CurrencySymbolEnum.d.ts +5 -0
- package/dist/enums/CurrencySymbolEnum.js +13 -0
- package/dist/enums/CurrencySymbolEnum.js.map +1 -0
- package/dist/format.cjs +122 -0
- package/dist/format.cjs.map +1 -0
- package/dist/format.d.ts +3 -0
- package/dist/format.js +55 -0
- package/dist/format.js.map +1 -0
- package/dist/format.mjs +117 -0
- package/dist/format.mjs.map +1 -0
- package/dist/index-cli.cjs +24 -0
- package/dist/index-cli.cjs.map +1 -0
- package/dist/index-cli.d.ts +2 -0
- package/dist/index-cli.js +28 -0
- package/dist/index-cli.js.map +1 -0
- package/dist/index-cli.mjs +12 -0
- package/dist/index-cli.mjs.map +1 -0
- package/dist/index-fmt.cjs +16 -0
- package/dist/index-fmt.cjs.map +1 -0
- package/dist/index-fmt.d.ts +1 -0
- package/dist/index-fmt.js +17 -0
- package/dist/index-fmt.js.map +1 -0
- package/dist/index-fmt.mjs +3 -0
- package/dist/index-fmt.mjs.map +1 -0
- package/dist/index-rn.cjs +21 -0
- package/dist/index-rn.cjs.map +1 -0
- package/dist/index-rn.d.ts +2 -0
- package/dist/index-rn.js +28 -0
- package/dist/index-rn.js.map +1 -0
- package/dist/index-rn.mjs +6 -0
- package/dist/index-rn.mjs.map +1 -0
- package/dist/index.cjs +21 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +6 -0
- package/dist/index.mjs.map +1 -0
- package/dist/interfaces/Config/ConfigOptions.d.ts +8 -0
- package/dist/interfaces/Config/ConfigOptions.js +6 -0
- package/dist/interfaces/Config/ConfigOptions.js.map +1 -0
- package/dist/interfaces/Config/OutputMap.d.ts +3 -0
- package/dist/interfaces/Config/OutputMap.js +6 -0
- package/dist/interfaces/Config/OutputMap.js.map +1 -0
- package/dist/interfaces/Config/OutputOptions.d.ts +7 -0
- package/dist/interfaces/Config/OutputOptions.js +6 -0
- package/dist/interfaces/Config/OutputOptions.js.map +1 -0
- package/dist/interfaces/Config/SitemapMap.d.ts +5 -0
- package/dist/interfaces/Config/SitemapMap.js +6 -0
- package/dist/interfaces/Config/SitemapMap.js.map +1 -0
- package/dist/interfaces/Config/StringMap.d.ts +3 -0
- package/dist/interfaces/Config/StringMap.js +6 -0
- package/dist/interfaces/Config/StringMap.js.map +1 -0
- package/dist/interfaces/Format/FormatOptions.d.ts +14 -0
- package/dist/interfaces/Format/FormatOptions.js +6 -0
- package/dist/interfaces/Format/FormatOptions.js.map +1 -0
- package/dist/interfaces/Sentry/InitOptions.d.ts +20 -0
- package/dist/interfaces/Sentry/InitOptions.js +6 -0
- package/dist/interfaces/Sentry/InitOptions.js.map +1 -0
- package/dist/interfaces/Sentry/InitOptionsRN.d.ts +4 -0
- package/dist/interfaces/Sentry/InitOptionsRN.js +6 -0
- package/dist/interfaces/Sentry/InitOptionsRN.js.map +1 -0
- package/dist/interfaces/Sentry/SourceMapOptions.d.ts +7 -0
- package/dist/interfaces/Sentry/SourceMapOptions.js +6 -0
- package/dist/interfaces/Sentry/SourceMapOptions.js.map +1 -0
- package/dist/sentry-cli.cjs +119 -0
- package/dist/sentry-cli.cjs.map +1 -0
- package/dist/sentry-cli.d.ts +9 -0
- package/dist/sentry-cli.js +50 -0
- package/dist/sentry-cli.js.map +1 -0
- package/dist/sentry-cli.mjs +98 -0
- package/dist/sentry-cli.mjs.map +1 -0
- package/dist/sentry-rn.cjs +11 -0
- package/dist/sentry-rn.cjs.map +1 -0
- package/dist/sentry-rn.d.ts +2 -0
- package/dist/sentry-rn.js +28 -0
- package/dist/sentry-rn.js.map +1 -0
- package/dist/sentry-rn.mjs +4 -0
- package/dist/sentry-rn.mjs.map +1 -0
- package/dist/sentry.cjs +11 -0
- package/dist/sentry.cjs.map +1 -0
- package/dist/sentry.d.ts +2 -0
- package/dist/sentry.js +28 -0
- package/dist/sentry.js.map +1 -0
- package/dist/sentry.mjs +4 -0
- package/dist/sentry.mjs.map +1 -0
- package/dist/types/Config/OptionType.d.ts +2 -0
- package/dist/types/Config/OptionType.js +6 -0
- package/dist/types/Config/OptionType.js.map +1 -0
- package/dist/types/Format/OptionType.d.ts +3 -0
- package/dist/types/Format/OptionType.js +6 -0
- package/dist/types/Format/OptionType.js.map +1 -0
- package/dist/types/Sentry/OptionType.d.ts +1 -0
- package/dist/types/Sentry/OptionType.js +6 -0
- package/dist/types/Sentry/OptionType.js.map +1 -0
- package/package.json +139 -0
- package/src/Config/Config.ts +258 -0
- package/src/Config/GoogleAuth.ts +54 -0
- package/src/Config/Locales.ts +72 -0
- package/src/Config/Output.ts +29 -0
- package/src/Config/Sitemap.ts +67 -0
- package/src/Format/NumberFormat.ts +96 -0
- package/src/Format/NumberParser.ts +42 -0
- package/src/Sentry/Build.ts +67 -0
- package/src/Sentry/React.ts +127 -0
- package/src/Sentry/ReactNative.ts +133 -0
- package/src/Sentry/Utils.ts +26 -0
- package/src/Utils/Files.ts +51 -0
- package/src/config-cli.ts +152 -0
- package/src/enums/CurrencySymbolEnum.ts +5 -0
- package/src/format.ts +39 -0
- package/src/index-cli.ts +2 -0
- package/src/index-fmt.ts +1 -0
- package/src/index-rn.ts +2 -0
- package/src/index.ts +2 -0
- package/src/interfaces/Config/ConfigOptions.ts +9 -0
- package/src/interfaces/Config/OutputMap.ts +3 -0
- package/src/interfaces/Config/OutputOptions.ts +8 -0
- package/src/interfaces/Config/SitemapMap.ts +5 -0
- package/src/interfaces/Config/StringMap.ts +3 -0
- package/src/interfaces/Format/FormatOptions.ts +19 -0
- package/src/interfaces/Sentry/InitOptions.ts +23 -0
- package/src/interfaces/Sentry/InitOptionsRN.ts +5 -0
- package/src/interfaces/Sentry/SourceMapOptions.ts +7 -0
- package/src/sentry-cli.ts +16 -0
- package/src/sentry-rn.ts +2 -0
- package/src/sentry.ts +2 -0
- package/src/types/Config/OptionType.ts +2 -0
- package/src/types/Format/OptionType.ts +15 -0
- package/src/types/Sentry/OptionType.ts +1 -0
@@ -0,0 +1,87 @@
|
|
1
|
+
import * as Sentry from '@sentry/react';
|
2
|
+
import { r as recordSentryHttp } from './Utils-Cq948gfa.js';
|
3
|
+
|
4
|
+
/**
|
5
|
+
* Initialize Sentry for React.
|
6
|
+
*
|
7
|
+
* @param {InitOptions} options
|
8
|
+
* @return {void}
|
9
|
+
*/
|
10
|
+
const initSentry = options => {
|
11
|
+
let shouldSendToSentry = options?.requiredEnvForSendToSentry?.includes(options.env);
|
12
|
+
let ignoreErrors = [/antd:/, /is deprecated in StrictMode/, /React Intl/];
|
13
|
+
if (options?.ignoreErrorsOptions) {
|
14
|
+
ignoreErrors = ignoreErrors.concat(options.ignoreErrorsOptions);
|
15
|
+
}
|
16
|
+
if (options?.options?.ignoreErrors) {
|
17
|
+
ignoreErrors = ignoreErrors.concat(options.options.ignoreErrors);
|
18
|
+
delete options.options.ignoreErrors;
|
19
|
+
}
|
20
|
+
let integrations = [];
|
21
|
+
if (options?.httpClientIntegrationOptions?.failedRequestStatusCodes && options?.httpClientIntegrationOptions?.failedRequestTargets) {
|
22
|
+
integrations.push(Sentry.httpClientIntegration({
|
23
|
+
failedRequestStatusCodes: options.httpClientIntegrationOptions.failedRequestStatusCodes,
|
24
|
+
failedRequestTargets: options.httpClientIntegrationOptions.failedRequestTargets
|
25
|
+
}));
|
26
|
+
}
|
27
|
+
if (options?.captureConsoleIntegrationOptions?.levels) {
|
28
|
+
integrations.push(Sentry.captureConsoleIntegration({
|
29
|
+
levels: options.captureConsoleIntegrationOptions.levels
|
30
|
+
}));
|
31
|
+
}
|
32
|
+
if (options?.options?.hasOwnProperty('integrations')) {
|
33
|
+
options.options.integrations = [...options.options.integrations, ...integrations];
|
34
|
+
} else {
|
35
|
+
options.options = options.options || {};
|
36
|
+
options.options.integrations = integrations;
|
37
|
+
}
|
38
|
+
let sentryOptions = {
|
39
|
+
dsn: options.dsn,
|
40
|
+
debug: options.debug,
|
41
|
+
release: options.release,
|
42
|
+
environment: options.env,
|
43
|
+
ignoreErrors: ignoreErrors,
|
44
|
+
sampleRate: 1.0,
|
45
|
+
maxBreadcrumbs: 50,
|
46
|
+
attachStacktrace: true,
|
47
|
+
autoSessionTracking: true,
|
48
|
+
sendClientReports: true,
|
49
|
+
enableTracing: true,
|
50
|
+
// Performance Monitoring
|
51
|
+
tracesSampleRate: 1.0,
|
52
|
+
// Capture 100% of the transactions
|
53
|
+
// Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
|
54
|
+
tracePropagationTargets: ['localhost'],
|
55
|
+
sendDefaultPii: true,
|
56
|
+
beforeSend: event => {
|
57
|
+
if (event?.message?.includes('antd:') || event?.message?.includes('is deprecated in StrictMode') || event?.message?.includes('React Intl') || !shouldSendToSentry) {
|
58
|
+
return null;
|
59
|
+
}
|
60
|
+
return event;
|
61
|
+
}
|
62
|
+
};
|
63
|
+
if (options?.beforeSend) {
|
64
|
+
sentryOptions.beforeSend = options.beforeSend;
|
65
|
+
}
|
66
|
+
if (options?.options) {
|
67
|
+
sentryOptions = {
|
68
|
+
...sentryOptions,
|
69
|
+
...options.options
|
70
|
+
};
|
71
|
+
}
|
72
|
+
Sentry.init(sentryOptions);
|
73
|
+
};
|
74
|
+
/**
|
75
|
+
* Record additional http data for Sentry.
|
76
|
+
*
|
77
|
+
* @param {any | null} config
|
78
|
+
* @param {any | null} request
|
79
|
+
* @param {any | null} response
|
80
|
+
* @return {void}
|
81
|
+
*/
|
82
|
+
const recordAdditionalSentryHttp = (config, request, response) => {
|
83
|
+
recordSentryHttp(Sentry, config, request, response);
|
84
|
+
};
|
85
|
+
|
86
|
+
export { initSentry as i, recordAdditionalSentryHttp as r };
|
87
|
+
//# sourceMappingURL=React-BaJ1KfGF.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"React-BaJ1KfGF.js","sources":["../src/Sentry/React.ts"],"sourcesContent":[null],"names":["initSentry","options","shouldSendToSentry","requiredEnvForSendToSentry","includes","env","ignoreErrors","ignoreErrorsOptions","concat","integrations","httpClientIntegrationOptions","failedRequestStatusCodes","failedRequestTargets","push","Sentry","httpClientIntegration","captureConsoleIntegrationOptions","levels","captureConsoleIntegration","hasOwnProperty","sentryOptions","dsn","debug","release","environment","sampleRate","maxBreadcrumbs","attachStacktrace","autoSessionTracking","sendClientReports","enableTracing","tracesSampleRate","tracePropagationTargets","sendDefaultPii","beforeSend","event","message","init","recordAdditionalSentryHttp","config","request","response","recordSentryHttp"],"mappings":";;;AAKA;;;;;AAKG;AACGA,MAAAA,UAAU,GAAIC,OAAoB,IAAU;EAChD,IAAIC,kBAAkB,GAAGD,OAAO,EAAEE,0BAA0B,EAAEC,QAAQ,CACpEH,OAAO,CAACI,GAAG,CACZ,CAAA;EAED,IAAIC,YAAY,GAAmB,CACjC,OAAO,EACP,6BAA6B,EAC7B,YAAY,CACb,CAAA;EAED,IAAIL,OAAO,EAAEM,mBAAmB,EAAE;IAChCD,YAAY,GAAGA,YAAY,CAACE,MAAM,CAACP,OAAO,CAACM,mBAAmB,CAAC,CAAA;AACjE,GAAA;AAEA,EAAA,IAAIN,OAAO,EAAEA,OAAO,EAAEK,YAAY,EAAE;IAClCA,YAAY,GAAGA,YAAY,CAACE,MAAM,CAACP,OAAO,CAACA,OAAO,CAACK,YAAY,CAAC,CAAA;AAChE,IAAA,OAAOL,OAAO,CAACA,OAAO,CAACK,YAAY,CAAA;AACrC,GAAA;EAEA,IA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('@sentry/react');
|
4
|
+
var Utils = require('./Utils-Dilye04y.js');
|
5
|
+
|
6
|
+
function _interopNamespaceDefault(e) {
|
7
|
+
var n = Object.create(null);
|
8
|
+
if (e) {
|
9
|
+
Object.keys(e).forEach(function (k) {
|
10
|
+
if (k !== 'default') {
|
11
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
12
|
+
Object.defineProperty(n, k, d.get ? d : {
|
13
|
+
enumerable: true,
|
14
|
+
get: function () { return e[k]; }
|
15
|
+
});
|
16
|
+
}
|
17
|
+
});
|
18
|
+
}
|
19
|
+
n.default = e;
|
20
|
+
return Object.freeze(n);
|
21
|
+
}
|
22
|
+
|
23
|
+
var Sentry__namespace = /*#__PURE__*/_interopNamespaceDefault(Sentry);
|
24
|
+
|
25
|
+
/**
|
26
|
+
* Initialize Sentry for React.
|
27
|
+
*
|
28
|
+
* @param {InitOptions} options
|
29
|
+
* @return {void}
|
30
|
+
*/
|
31
|
+
const initSentry = options => {
|
32
|
+
let shouldSendToSentry = options?.requiredEnvForSendToSentry?.includes(options.env);
|
33
|
+
let ignoreErrors = [/antd:/, /is deprecated in StrictMode/, /React Intl/];
|
34
|
+
if (options?.ignoreErrorsOptions) {
|
35
|
+
ignoreErrors = ignoreErrors.concat(options.ignoreErrorsOptions);
|
36
|
+
}
|
37
|
+
if (options?.options?.ignoreErrors) {
|
38
|
+
ignoreErrors = ignoreErrors.concat(options.options.ignoreErrors);
|
39
|
+
delete options.options.ignoreErrors;
|
40
|
+
}
|
41
|
+
let integrations = [];
|
42
|
+
if (options?.httpClientIntegrationOptions?.failedRequestStatusCodes && options?.httpClientIntegrationOptions?.failedRequestTargets) {
|
43
|
+
integrations.push(Sentry__namespace.httpClientIntegration({
|
44
|
+
failedRequestStatusCodes: options.httpClientIntegrationOptions.failedRequestStatusCodes,
|
45
|
+
failedRequestTargets: options.httpClientIntegrationOptions.failedRequestTargets
|
46
|
+
}));
|
47
|
+
}
|
48
|
+
if (options?.captureConsoleIntegrationOptions?.levels) {
|
49
|
+
integrations.push(Sentry__namespace.captureConsoleIntegration({
|
50
|
+
levels: options.captureConsoleIntegrationOptions.levels
|
51
|
+
}));
|
52
|
+
}
|
53
|
+
if (options?.options?.hasOwnProperty('integrations')) {
|
54
|
+
options.options.integrations = [...options.options.integrations, ...integrations];
|
55
|
+
} else {
|
56
|
+
options.options = options.options || {};
|
57
|
+
options.options.integrations = integrations;
|
58
|
+
}
|
59
|
+
let sentryOptions = {
|
60
|
+
dsn: options.dsn,
|
61
|
+
debug: options.debug,
|
62
|
+
release: options.release,
|
63
|
+
environment: options.env,
|
64
|
+
ignoreErrors: ignoreErrors,
|
65
|
+
sampleRate: 1.0,
|
66
|
+
maxBreadcrumbs: 50,
|
67
|
+
attachStacktrace: true,
|
68
|
+
autoSessionTracking: true,
|
69
|
+
sendClientReports: true,
|
70
|
+
enableTracing: true,
|
71
|
+
// Performance Monitoring
|
72
|
+
tracesSampleRate: 1.0,
|
73
|
+
// Capture 100% of the transactions
|
74
|
+
// Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
|
75
|
+
tracePropagationTargets: ['localhost'],
|
76
|
+
sendDefaultPii: true,
|
77
|
+
beforeSend: event => {
|
78
|
+
if (event?.message?.includes('antd:') || event?.message?.includes('is deprecated in StrictMode') || event?.message?.includes('React Intl') || !shouldSendToSentry) {
|
79
|
+
return null;
|
80
|
+
}
|
81
|
+
return event;
|
82
|
+
}
|
83
|
+
};
|
84
|
+
if (options?.beforeSend) {
|
85
|
+
sentryOptions.beforeSend = options.beforeSend;
|
86
|
+
}
|
87
|
+
if (options?.options) {
|
88
|
+
sentryOptions = {
|
89
|
+
...sentryOptions,
|
90
|
+
...options.options
|
91
|
+
};
|
92
|
+
}
|
93
|
+
Sentry__namespace.init(sentryOptions);
|
94
|
+
};
|
95
|
+
/**
|
96
|
+
* Record additional http data for Sentry.
|
97
|
+
*
|
98
|
+
* @param {any | null} config
|
99
|
+
* @param {any | null} request
|
100
|
+
* @param {any | null} response
|
101
|
+
* @return {void}
|
102
|
+
*/
|
103
|
+
const recordAdditionalSentryHttp = (config, request, response) => {
|
104
|
+
Utils.recordSentryHttp(Sentry__namespace, config, request, response);
|
105
|
+
};
|
106
|
+
|
107
|
+
exports.initSentry = initSentry;
|
108
|
+
exports.recordAdditionalSentryHttp = recordAdditionalSentryHttp;
|
109
|
+
//# sourceMappingURL=React-qUl0CBmE.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"React-qUl0CBmE.js","sources":["../src/Sentry/React.ts"],"sourcesContent":[null],"names":["initSentry","options","shouldSendToSentry","requiredEnvForSendToSentry","includes","env","ignoreErrors","ignoreErrorsOptions","concat","integrations","httpClientIntegrationOptions","failedRequestStatusCodes","failedRequestTargets","push","Sentry","httpClientIntegration","captureConsoleIntegrationOptions","levels","captureConsoleIntegration","hasOwnProperty","sentryOptions","dsn","debug","release","environment","sampleRate","maxBreadcrumbs","attachStacktrace","autoSessionTracking","sendClientReports","enableTracing","tracesSampleRate","tracePropagationTargets","sendDefaultPii","beforeSend","event","message","init","recordAdditionalSentryHttp","config","request","response","recordSentryHttp"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAKA;;;;;AAKG;AACGA,MAAAA,UAAU,GAAIC,OAAoB,IAAU;EAChD,IAAIC,kBAAkB,GAAGD,OAAO,EAAEE,0BAA0B,EAAEC,QAAQ,CACpEH,OAAO,CAACI,GAAG,CACZ,CAAA;EAED,IAAIC,YAAY,GAAmB,CACjC,OAAO,EACP,6BAA6B,EAC7B,YAAY,CACb,CAAA;EAED,IAAIL,OAAO,EAAEM,mBAAmB,EAAE;IAChCD,YAAY,GAAGA,YAAY,CAACE,MAAM,CAACP,OAAO,CAACM,mBAAmB,CAAC,CAAA;AACjE,GAAA;AAEA,EAAA,IAAIN,OAAO,EAAEA,OAAO,EAAEK,YAAY,EAAE;IAClCA,YAAY,GAAGA,YAAY,CAACE,MAAM,CAACP,OAAO,CAACA,OAAO,CAACK,YAAY,CAAC,C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