@tamagui/generate-themes 2.0.0-rc.8 → 2.0.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/dist/cjs/generate-themes.cjs +100 -57
- package/dist/cjs/generate-themes.native.js +118 -74
- package/dist/cjs/generate-themes.native.js.map +1 -1
- package/dist/cjs/index.cjs +7 -5
- package/dist/cjs/index.native.js +7 -5
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/write-generate-themes.cjs +32 -24
- package/dist/cjs/write-generate-themes.native.js +39 -33
- package/dist/cjs/write-generate-themes.native.js.map +1 -1
- package/dist/esm/generate-themes.mjs +88 -47
- package/dist/esm/generate-themes.mjs.map +1 -1
- package/dist/esm/generate-themes.native.js +105 -63
- package/dist/esm/generate-themes.native.js.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -6
- package/dist/esm/write-generate-themes.mjs +8 -2
- package/dist/esm/write-generate-themes.mjs.map +1 -1
- package/dist/esm/write-generate-themes.native.js +15 -11
- package/dist/esm/write-generate-themes.native.js.map +1 -1
- package/package.json +8 -11
- package/src/generate-themes.ts +3 -3
- package/dist/cjs/generate-themes.js +0 -130
- package/dist/cjs/generate-themes.js.map +0 -6
- package/dist/cjs/index.js +0 -16
- package/dist/cjs/index.js.map +0 -6
- package/dist/cjs/write-generate-themes.js +0 -37
- package/dist/cjs/write-generate-themes.js.map +0 -6
- package/dist/esm/generate-themes.js +0 -114
- package/dist/esm/generate-themes.js.map +0 -6
- package/dist/esm/write-generate-themes.js +0 -13
- package/dist/esm/write-generate-themes.js.map +0 -6
|
@@ -2,33 +2,35 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf
|
|
6
|
-
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
16
|
get: () => from[key],
|
|
16
17
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
18
|
});
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
20
22
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
+
value: mod,
|
|
29
|
+
enumerable: true
|
|
30
|
+
}) : target, mod));
|
|
31
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
32
|
+
value: true
|
|
33
|
+
}), mod);
|
|
32
34
|
var write_generate_themes_exports = {};
|
|
33
35
|
__export(write_generate_themes_exports, {
|
|
34
36
|
writeGeneratedThemes: () => writeGeneratedThemes
|
|
@@ -40,8 +42,14 @@ async function writeGeneratedThemes(tamaguiDotDir, outPath, generatedOutput) {
|
|
|
40
42
|
const {
|
|
41
43
|
generated
|
|
42
44
|
} = generatedOutput;
|
|
43
|
-
process.env.DEBUG === "tamagui"
|
|
45
|
+
if (process.env.DEBUG === "tamagui") {
|
|
46
|
+
console.info(`Generated themes:`, JSON.stringify(generatedOutput, null, 2));
|
|
47
|
+
}
|
|
44
48
|
const newContent = `// @ts-nocheck
|
|
45
49
|
` + generated;
|
|
46
|
-
|
|
50
|
+
const existingContent = await fs.readFile(outPath, "utf-8").catch(() => null);
|
|
51
|
+
if (existingContent === newContent) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
await fs.writeFile(outPath, newContent);
|
|
47
55
|
}
|
|
@@ -4,33 +4,35 @@ var __create = Object.create;
|
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf
|
|
8
|
-
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
9
|
var __export = (target, all) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: true
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
18
|
get: () => from[key],
|
|
18
19
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
20
|
});
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
22
24
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
30
|
+
value: mod,
|
|
31
|
+
enumerable: true
|
|
32
|
+
}) : target, mod));
|
|
33
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
34
|
+
value: true
|
|
35
|
+
}), mod);
|
|
34
36
|
var write_generate_themes_exports = {};
|
|
35
37
|
__export(write_generate_themes_exports, {
|
|
36
38
|
writeGeneratedThemes: () => writeGeneratedThemes
|
|
@@ -38,17 +40,21 @@ __export(write_generate_themes_exports, {
|
|
|
38
40
|
module.exports = __toCommonJS(write_generate_themes_exports);
|
|
39
41
|
var fs = __toESM(require("fs-extra"), 1);
|
|
40
42
|
async function writeGeneratedThemes(tamaguiDotDir, outPath, generatedOutput) {
|
|
41
|
-
if (generatedOutput)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
43
|
+
if (!generatedOutput) return;
|
|
44
|
+
var {
|
|
45
|
+
generated
|
|
46
|
+
} = generatedOutput;
|
|
47
|
+
if (process.env.DEBUG === "tamagui") {
|
|
48
|
+
console.info(`Generated themes:`, JSON.stringify(generatedOutput, null, 2));
|
|
49
|
+
}
|
|
50
|
+
var newContent = `// @ts-nocheck
|
|
51
|
+
` + generated;
|
|
52
|
+
var existingContent = await fs.readFile(outPath, "utf-8").catch(function () {
|
|
53
|
+
return null;
|
|
54
|
+
});
|
|
55
|
+
if (existingContent === newContent) {
|
|
56
|
+
return;
|
|
52
57
|
}
|
|
58
|
+
await fs.writeFile(outPath, newContent);
|
|
53
59
|
}
|
|
54
60
|
//# sourceMappingURL=write-generate-themes.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","write_generate_themes_exports","__export","writeGeneratedThemes","module","exports","fs","__toESM","require","tamaguiDotDir","outPath","generatedOutput","generated","process","env","DEBUG","console","info","JSON","stringify","newContent","existingContent","readFile","catch"],"sources":["../../src/write-generate-themes.ts"],"sourcesContent":[null],"mappings":"
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","write_generate_themes_exports","__export","writeGeneratedThemes","module","exports","fs","__toESM","require","tamaguiDotDir","outPath","generatedOutput","generated","process","env","DEBUG","console","info","JSON","stringify","newContent","existingContent","readFile","catch"],"sources":["../../src/write-generate-themes.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,6BAAA;AAAAC,QAAA,CAAAD,6BAAA;EAAAE,oBAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAoB,GAAAT,YAAA,CAAAK,6BAAA;AAIpB,IAAAK,EAAA,GAAAC,OAAsB,CAAAC,OAAA,YACpB;AAIA,eAAKL,oBAAiBA,CAAAM,aAAA,EAAAC,OAAA,EAAAC,eAAA;EAEtB,KAAAA,eAAkB,EAAI;EAEtB,IAAI;IAAAC;EAAY,IAAAD,eAAU;EACxB,IAAAE,OAAQ,CAAAC,GAAK,CAAAC,KAAA,gBAAqB;IACpCC,OAAA,CAAAC,IAAA,sBAAAC,IAAA,CAAAC,SAAA,CAAAR,eAAA;EAEA;EAAmB,IAAqBS,UAAA;AAGxC,IAAAR,SAAM;EACN,IAAIS,eAAA,SAAoBf,EAAA,CAAAgB,QAAY,CAAAZ,OAAA,WAAAa,KAAA;IAClC;EACF;EAEA,IAAAF,eAAmB,KAAAD,UAAS;IAC9B","ignoreList":[]}
|
|
@@ -1,29 +1,36 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
|
-
let didRegisterOnce =
|
|
2
|
+
let didRegisterOnce = false;
|
|
3
3
|
async function generateThemes(inputFile) {
|
|
4
4
|
const inputFilePath = inputFile[0] === "." ? join(process.cwd(), inputFile) : inputFile;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
if (!didRegisterOnce) {
|
|
6
|
+
didRegisterOnce = true;
|
|
7
|
+
require("esbuild-register/dist/node").register({
|
|
8
|
+
hookIgnoreNodeModules: false
|
|
9
|
+
});
|
|
10
|
+
} else {
|
|
11
|
+
purgeCache(inputFilePath);
|
|
12
|
+
}
|
|
8
13
|
let og = process.env.TAMAGUI_KEEP_THEMES;
|
|
9
|
-
process.env.TAMAGUI_KEEP_THEMES = "1"
|
|
14
|
+
process.env.TAMAGUI_KEEP_THEMES = "1";
|
|
15
|
+
process.env.TAMAGUI_RUN_THEMEBUILDER = "1";
|
|
10
16
|
try {
|
|
11
|
-
const requiredThemes = require(inputFilePath)
|
|
12
|
-
|
|
17
|
+
const requiredThemes = require(inputFilePath);
|
|
18
|
+
const themes = requiredThemes["default"] || requiredThemes["themes"] || requiredThemes[Object.keys(requiredThemes)[0]];
|
|
19
|
+
const generatedThemes = generatedThemesToTypescript(themes);
|
|
13
20
|
return {
|
|
14
|
-
generated:
|
|
21
|
+
generated: generatedThemes
|
|
15
22
|
};
|
|
16
23
|
} catch (err) {
|
|
17
24
|
console.warn(` \u26A0\uFE0F Error running theme builder:
|
|
18
|
-
`, err?.stack || err);
|
|
25
|
+
`, err?.["stack"] || err);
|
|
19
26
|
} finally {
|
|
20
27
|
process.env.TAMAGUI_KEEP_THEMES = og;
|
|
21
28
|
}
|
|
22
29
|
}
|
|
23
30
|
const dedupedTokens = /* @__PURE__ */new Map();
|
|
24
31
|
function generatedThemesToTypescript(themes) {
|
|
25
|
-
const dedupedThemes = /* @__PURE__ */new Map()
|
|
26
|
-
|
|
32
|
+
const dedupedThemes = /* @__PURE__ */new Map();
|
|
33
|
+
const dedupedThemeToNames = /* @__PURE__ */new Map();
|
|
27
34
|
let i = 0;
|
|
28
35
|
for (const name in themes) {
|
|
29
36
|
i++;
|
|
@@ -32,17 +39,29 @@ function generatedThemesToTypescript(themes) {
|
|
|
32
39
|
for (const [key2, value] of Object.entries(theme)) {
|
|
33
40
|
i++;
|
|
34
41
|
const uniqueKey = `t${i}${j}`;
|
|
35
|
-
dedupedTokens.has(value)
|
|
42
|
+
if (!dedupedTokens.has(value)) {
|
|
43
|
+
dedupedTokens.set(value, uniqueKey);
|
|
44
|
+
}
|
|
36
45
|
}
|
|
37
46
|
const key = JSON.stringify(theme);
|
|
38
|
-
dedupedThemes.has(key)
|
|
47
|
+
if (dedupedThemes.has(key)) {
|
|
48
|
+
dedupedThemeToNames.set(key, [...dedupedThemeToNames.get(key), name]);
|
|
49
|
+
} else {
|
|
50
|
+
dedupedThemes.set(key, theme);
|
|
51
|
+
dedupedThemeToNames.set(key, [name]);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (!themes) {
|
|
55
|
+
throw new Error(`Didn't find any themes exported or returned`);
|
|
39
56
|
}
|
|
40
|
-
if (!themes) throw new Error("Didn't find any themes exported or returned");
|
|
41
57
|
const baseKeys = Object.entries(themes.light || themes[Object.keys(themes)[0]]);
|
|
42
|
-
|
|
43
|
-
${baseKeys.map(([k]) =>
|
|
44
|
-
`
|
|
45
|
-
|
|
58
|
+
const baseTypeString = `export type Theme = {
|
|
59
|
+
${baseKeys.map(([k]) => {
|
|
60
|
+
return ` ${k}: string;
|
|
61
|
+
`;
|
|
62
|
+
}).join("")}
|
|
63
|
+
}`;
|
|
64
|
+
let out = `${baseTypeString}
|
|
46
65
|
`;
|
|
47
66
|
out += `
|
|
48
67
|
function t(a: [number, number][]) {
|
|
@@ -52,50 +71,61 @@ function t(a: [number, number][]) {
|
|
|
52
71
|
}
|
|
53
72
|
return res as Theme
|
|
54
73
|
}
|
|
55
|
-
|
|
74
|
+
`;
|
|
75
|
+
out += `export const colors = [
|
|
56
76
|
`;
|
|
57
77
|
let index = 0;
|
|
58
78
|
const valueToIndex = {};
|
|
59
79
|
dedupedTokens.forEach((name, value) => {
|
|
60
|
-
valueToIndex[value] = index
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
80
|
+
valueToIndex[value] = index;
|
|
81
|
+
index++;
|
|
82
|
+
out += ` '${value}',
|
|
64
83
|
`;
|
|
84
|
+
});
|
|
85
|
+
out += "]\n\n";
|
|
65
86
|
const keys = baseKeys.map(([k]) => k);
|
|
66
87
|
out += `const ks = [
|
|
67
|
-
|
|
68
|
-
|
|
88
|
+
`;
|
|
89
|
+
out += keys.map(k => `'${k}'`).join(",\n");
|
|
90
|
+
out += `]
|
|
69
91
|
|
|
70
92
|
`;
|
|
71
|
-
let nameI = 0
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
93
|
+
let nameI = 0;
|
|
94
|
+
let themeTypes = `export type ThemeNames =`;
|
|
95
|
+
let exported = `export type Themes = Record<ThemeNames, Theme>
|
|
96
|
+
|
|
97
|
+
export const themes: Themes = {`;
|
|
98
|
+
dedupedThemes.forEach(theme => {
|
|
75
99
|
nameI++;
|
|
76
|
-
const key = JSON.stringify(theme)
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
100
|
+
const key = JSON.stringify(theme);
|
|
101
|
+
const names = dedupedThemeToNames.get(key);
|
|
102
|
+
const name = `n${nameI}`;
|
|
103
|
+
const baseTheme = `const ${name} = ${objectToJsString(theme, keys, valueToIndex)}`;
|
|
80
104
|
out += `
|
|
81
|
-
${baseTheme}
|
|
105
|
+
${baseTheme}`;
|
|
106
|
+
names.forEach(n => {
|
|
82
107
|
exported += `
|
|
83
|
-
${n}: ${name}
|
|
84
|
-
|
|
108
|
+
${n}: ${name},`;
|
|
109
|
+
if (n.toLowerCase() === n) {
|
|
110
|
+
themeTypes += `
|
|
111
|
+
| '${n}'`;
|
|
112
|
+
}
|
|
85
113
|
});
|
|
86
|
-
})
|
|
114
|
+
});
|
|
115
|
+
out += `
|
|
87
116
|
|
|
88
117
|
${themeTypes}
|
|
89
118
|
|
|
90
119
|
${exported}
|
|
91
120
|
}
|
|
92
|
-
|
|
121
|
+
`;
|
|
122
|
+
return out;
|
|
93
123
|
}
|
|
94
124
|
function objectToJsString(obj, keys, valueToIndex) {
|
|
95
125
|
let arrItems = [];
|
|
96
126
|
for (const key in obj) {
|
|
97
|
-
const ki = keys.indexOf(key)
|
|
98
|
-
|
|
127
|
+
const ki = keys.indexOf(key);
|
|
128
|
+
const vi = valueToIndex[obj[key]];
|
|
99
129
|
arrItems.push(`[${ki}, ${vi}]`);
|
|
100
130
|
}
|
|
101
131
|
return `t([${arrItems.join(",")}])`;
|
|
@@ -103,17 +133,28 @@ function objectToJsString(obj, keys, valueToIndex) {
|
|
|
103
133
|
function purgeCache(moduleName) {
|
|
104
134
|
searchCache(moduleName, mod => {
|
|
105
135
|
delete require.cache[mod.id];
|
|
106
|
-
})
|
|
107
|
-
|
|
136
|
+
});
|
|
137
|
+
if (!module.constructor || !module.constructor._pathCache) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
Object.keys(module.constructor._pathCache).forEach(cacheKey => {
|
|
141
|
+
if (cacheKey.indexOf(moduleName) > 0) {
|
|
142
|
+
delete module.constructor._pathCache[cacheKey];
|
|
143
|
+
}
|
|
108
144
|
});
|
|
109
145
|
}
|
|
110
146
|
function searchCache(moduleName, callback) {
|
|
111
147
|
let mod = require.resolve(moduleName);
|
|
112
|
-
mod && (mod = require.cache[mod]) !== void 0
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
148
|
+
if (mod && (mod = require.cache[mod]) !== void 0) {
|
|
149
|
+
;
|
|
150
|
+
(function traverse(mod2, depth = 0) {
|
|
151
|
+
if (depth > 10) return;
|
|
152
|
+
mod2.children.forEach(child => {
|
|
153
|
+
traverse(child, depth + 1);
|
|
154
|
+
});
|
|
155
|
+
callback(mod2);
|
|
156
|
+
})(mod);
|
|
157
|
+
}
|
|
117
158
|
}
|
|
118
159
|
export { generateThemes };
|
|
119
160
|
//# sourceMappingURL=generate-themes.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["join","didRegisterOnce","generateThemes","inputFile","inputFilePath","process","cwd","
|
|
1
|
+
{"version":3,"names":["join","didRegisterOnce","generateThemes","inputFile","inputFilePath","process","cwd","require","register","hookIgnoreNodeModules","purgeCache","og","env","TAMAGUI_KEEP_THEMES","TAMAGUI_RUN_THEMEBUILDER","requiredThemes","themes","Object","keys","generatedThemes","generatedThemesToTypescript","generated","err","console","warn","dedupedTokens","Map","dedupedThemes","dedupedThemeToNames","i","name","theme","j","key2","value","entries","uniqueKey","has","set","key","JSON","stringify","get","Error","baseKeys","light","baseTypeString","map","k","out","index","valueToIndex","forEach","nameI","themeTypes","exported","names","baseTheme","objectToJsString","n","toLowerCase","obj","arrItems","ki","indexOf","vi","push","moduleName","searchCache","mod","cache","id","module","constructor","_pathCache","cacheKey","callback","resolve","traverse","mod2","depth","children","child"],"sources":["../../src/generate-themes.ts"],"sourcesContent":[null],"mappings":"AACA,SAASA,IAAA,QAAY;AAMrB,IAAIC,eAAA,GAAkB;AAEtB,eAAsBC,eAAeC,SAAA,EAAmB;EACtD,MAAMC,aAAA,GAAgBD,SAAA,CAAU,CAAC,MAAM,M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