@vxrn/react-native-prebuilt 1.1.386 → 1.1.388
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/index.cjs +34 -10
- package/dist/cjs/index.js +50 -12
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.native.js +43 -12
- package/dist/cjs/index.native.js.map +2 -2
- package/dist/esm/index.js +50 -12
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +34 -10
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +43 -12
- package/dist/esm/index.native.js.map +2 -2
- package/package.json +11 -7
- package/src/index.ts +59 -14
- package/types/index.d.ts +2 -1
- package/types/index.d.ts.map +1 -1
- package/vendor/rn-react-19-support/ReactFabric-dev.js +16750 -0
- package/vendor/rn-react-19-support/ReactFabric-prod.js +10506 -0
- package/vendor/rn-react-19-support/ReactNativeRenderer-dev.js +17031 -0
- package/vendor/rn-react-19-support/ReactNativeRenderer-prod.js +17031 -0
package/dist/esm/index.native.js
CHANGED
|
@@ -33,13 +33,18 @@ async function buildReactJSX() {
|
|
|
33
33
|
var bundled = await readFile(options.outfile, "utf-8"), outCode = `
|
|
34
34
|
const run = () => {
|
|
35
35
|
${mustReplace(bundled, [
|
|
36
|
-
isProd ?
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
...isProd ? [
|
|
37
|
+
{
|
|
38
|
+
// react 18 and 19 (18 has _min)
|
|
39
|
+
find: /module\.exports = require_react_jsx_runtime_production([a-z_]*)\(\);/,
|
|
40
|
+
replace: "return require_react_jsx_runtime_production$1();"
|
|
41
|
+
}
|
|
42
|
+
] : [
|
|
43
|
+
{
|
|
44
|
+
find: "module.exports = require_react_jsx_dev_runtime_development();",
|
|
45
|
+
replace: "return require_react_jsx_dev_runtime_development();"
|
|
46
|
+
}
|
|
47
|
+
],
|
|
43
48
|
{
|
|
44
49
|
find: "process.env.VXRN_REACT_19",
|
|
45
50
|
replace: "false",
|
|
@@ -93,10 +98,10 @@ async function buildReact() {
|
|
|
93
98
|
const run = () => {
|
|
94
99
|
${mustReplace(bundled, [
|
|
95
100
|
isProd ? {
|
|
96
|
-
find: /module\.exports =
|
|
97
|
-
replace: "return
|
|
101
|
+
find: /module\.exports = require_react_production([a-z_]*)\(\);/,
|
|
102
|
+
replace: "return require_react_production$1();"
|
|
98
103
|
} : {
|
|
99
|
-
find: /module\.exports = require_react_development(
|
|
104
|
+
find: /module\.exports = require_react_development([a-z_]*)\(\);/,
|
|
100
105
|
replace: "return require_react_development$1();"
|
|
101
106
|
},
|
|
102
107
|
{
|
|
@@ -122,7 +127,7 @@ async function buildReact() {
|
|
|
122
127
|
});
|
|
123
128
|
}
|
|
124
129
|
async function buildReactNative() {
|
|
125
|
-
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, { platform } = arguments.length > 1 ? arguments[1] : void 0;
|
|
130
|
+
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, { platform, enableExperimentalReactNativeWithReact19Support = !1 } = arguments.length > 1 ? arguments[1] : void 0;
|
|
126
131
|
return build({
|
|
127
132
|
bundle: !0,
|
|
128
133
|
entryPoints: [
|
|
@@ -177,6 +182,22 @@ async function buildReactNative() {
|
|
|
177
182
|
filter: /.*\.js$/
|
|
178
183
|
}, async function(input) {
|
|
179
184
|
if (!(!input.path.includes("react-native") && !input.path.includes("vite-native-hmr"))) {
|
|
185
|
+
if (enableExperimentalReactNativeWithReact19Support) {
|
|
186
|
+
if (input.path.includes("Libraries/Renderer/implementations/ReactFabric")) {
|
|
187
|
+
var reactFabricRendererPath = requireResolve(`@vxrn/react-native-prebuilt/vendor/rn-react-19-support/ReactFabric-${input.path.endsWith("-dev.js") ? "dev" : "prod"}.js`);
|
|
188
|
+
return {
|
|
189
|
+
contents: await readFile(reactFabricRendererPath, "utf-8"),
|
|
190
|
+
loader: "js"
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
if (input.path.includes("Libraries/Renderer/implementations/ReactNativeRenderer")) {
|
|
194
|
+
var reactNativeRendererPath = requireResolve(`@vxrn/react-native-prebuilt/vendor/rn-react-19-support/ReactNativeRenderer-${input.path.endsWith("-dev.js") ? "dev" : "prod"}.js`);
|
|
195
|
+
return {
|
|
196
|
+
contents: await readFile(reactNativeRendererPath, "utf-8"),
|
|
197
|
+
loader: "js"
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
}
|
|
180
201
|
var code = await readFile(input.path, "utf-8"), outagain = await transformFlow(code, {
|
|
181
202
|
development: !0
|
|
182
203
|
});
|
|
@@ -348,6 +369,9 @@ var esbuildCommonJSFunction = `var __commonJS = (cb, mod) => function __require(
|
|
|
348
369
|
"StrictMode",
|
|
349
370
|
"Suspense",
|
|
350
371
|
"__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED",
|
|
372
|
+
// For React 18
|
|
373
|
+
"__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE",
|
|
374
|
+
// For React 19
|
|
351
375
|
"cloneElement",
|
|
352
376
|
"createContext",
|
|
353
377
|
"createElement",
|
|
@@ -374,7 +398,14 @@ var esbuildCommonJSFunction = `var __commonJS = (cb, mod) => function __require(
|
|
|
374
398
|
"useState",
|
|
375
399
|
"useSyncExternalStore",
|
|
376
400
|
"useTransition",
|
|
377
|
-
"version"
|
|
401
|
+
"version",
|
|
402
|
+
// Added in React 19
|
|
403
|
+
"act",
|
|
404
|
+
"cache",
|
|
405
|
+
"unstable_useCacheRefresh",
|
|
406
|
+
"use",
|
|
407
|
+
"useActionState",
|
|
408
|
+
"useOptimistic"
|
|
378
409
|
];
|
|
379
410
|
export {
|
|
380
411
|
buildReact,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Users/n8/one/packages/react-native-prebuilt/src/index.ts"],
|
|
4
|
-
"mappings": "AAAA,SAASA,gBAAgB;AACzB,SAASC,mBAAmB;AAC5B,SAASC,qBAAqB;AAC9B,SAASC,aAAgC;AACzC,OAAOC,aAAa;AAEpB,SAASC,qBAAqB;AAE9B,IAAMC,iBACJ,SAAS,cAAcD,cAAc,YAAYE,GAAG,EAAEC,UAAUC,QAAQD,SAEpEE,WAAW;EAAC;EAAS;EAAqB;;AAEhD,eAAsBC,gBAAAA;MAAcC,UAAAA,UAAAA,SAAAA,KAAAA,UAAAA,CAAAA,MAAAA,SAAAA,UAAAA,CAAAA,IAAwB,CAAC,GAC5CA,iBAATC,WAASD,kBAAAA,QAAQE,YAAM,QAAdF,oBAAAA,SAAAA,SAAAA,gBAAiB,aAAe;AAE/C,SAAOT,MAAM;IACXY,QAAQ;IACRC,aAAa;MAACV,eAAe,uBAAA;;IAC7BW,QAAQ;IACRC,QAAQ;IACRC,KAAK;IACLC,YAAY;IACZC,gBAAgB;IAChBC,UAAU;IACVR,QAAQ;MACNS,SAAS;MACT,wBAAwB;IAC1B;IACAb;IACAc,UAAU;IACV,GAAGZ;EACL,CAAA,EAAGa,KAAK,iBAAA;AAEN,QAAMC,UAAU,MAAM1B,SAASY,QAAQe,SAAU,OAAA,
|
|
5
|
-
"names": ["readFile", "mustReplace", "transformFlow", "build", "FSExtra", "createRequire", "requireResolve", "url", "resolve", "require", "external", "buildReactJSX", "options", "isProd", "define", "bundle", "entryPoints", "format", "target", "jsx", "jsxFactory", "allowOverwrite", "platform", "__DEV__", "logLevel", "then", "bundled", "outfile", "outCode", "find", "replace", "optional", "map", "n", "join", "writeFile", "buildReact", "RExports", "buildReactNative", "loader", "resolveExtensions", "plugins", "name", "setup", "onResolve", "filter", "input", "path", "possibleEsmPath", "pathExistsSync", "onLoad", "includes", "
|
|
4
|
+
"mappings": "AAAA,SAASA,gBAAgB;AACzB,SAASC,mBAAmB;AAC5B,SAASC,qBAAqB;AAC9B,SAASC,aAAgC;A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ACLJ,UAAUG;gBACVlB,QAAQ;cACV;;UACF,CAAA;QAEJ;MACF;;EAEJ,CAAA,EAAGf,KAAK,iBAAA;AAEN,QAAMC,UAAU,MAAM1B,SAASY,QAAQe,SAAU,OAAA,GAC3CC,UAAU;;QAEZ3B,YAAYyB,SAAS;MACrB;QACEG,MAAM+B;QACN9B,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA+BX;MACA;QACED,MAAM;QACNC,SAAS;MACX;;MAEA;QACED,MAAM;QACNC,SAAS;UACP;UACA;UACA;;UACA;;UACA;UACAI,KAAK;CAAA;MACT;KACD,CAAA;;;;;MAKD2B,cAAc7B,IAAI,SAACC,GAAAA;aAAM,gBAAgBA,CAAAA,SAAUA,CAAAA;OAAKC,KAAK;CAAA,CAAA;;;AAG/D,UAAM9B,QAAQ+B,UAAUvB,QAAQe,SAAUC,OAAAA;EAC5C,CAAA;AACF;AAEA,IAAMgC,0BAA0B;;KAI1BC,gBAAgB;EACpB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;GAGIxB,WAAW;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EACA;;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;EACA;;",
|
|
5
|
+
"names": ["readFile", "mustReplace", "transformFlow", "build", "FSExtra", "createRequire", "requireResolve", "url", "resolve", "require", "external", "buildReactJSX", "options", "isProd", "define", "bundle", "entryPoints", "format", "target", "jsx", "jsxFactory", "allowOverwrite", "platform", "__DEV__", "logLevel", "then", "bundled", "outfile", "outCode", "find", "replace", "optional", "map", "n", "join", "writeFile", "buildReact", "RExports", "buildReactNative", "enableExperimentalReactNativeWithReact19Support", "loader", "resolveExtensions", "plugins", "name", "setup", "onResolve", "filter", "input", "path", "possibleEsmPath", "pathExistsSync", "onLoad", "includes", "reactFabricRendererPath", "endsWith", "contents", "reactNativeRendererPath", "code", "outagain", "development", "esbuildCommonJSFunction", "RNExportNames"]
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vxrn/react-native-prebuilt",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.388",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -12,7 +12,11 @@
|
|
|
12
12
|
},
|
|
13
13
|
"./vendor/react-native-0.74.1": "./vendor/react-native-0.74.1/index.js",
|
|
14
14
|
"./vendor/react-18.3.1": "./vendor/react-18.3.1/index.js",
|
|
15
|
-
"./vendor/react-jsx-runtime-18.3.1": "./vendor/react-jsx-runtime-18.3.1/index.js"
|
|
15
|
+
"./vendor/react-jsx-runtime-18.3.1": "./vendor/react-jsx-runtime-18.3.1/index.js",
|
|
16
|
+
"./vendor/rn-react-19-support/ReactFabric-dev.js": "./vendor/rn-react-19-support/ReactFabric-dev.js",
|
|
17
|
+
"./vendor/rn-react-19-support/ReactFabric-prod.js": "./vendor/rn-react-19-support/ReactFabric-prod.js",
|
|
18
|
+
"./vendor/rn-react-19-support/ReactNativeRenderer-dev.js": "./vendor/rn-react-19-support/ReactNativeRenderer-dev.js",
|
|
19
|
+
"./vendor/rn-react-19-support/ReactNativeRenderer-prod.js": "./vendor/rn-react-19-support/ReactNativeRenderer-prod.js"
|
|
16
20
|
},
|
|
17
21
|
"main": "dist/cjs",
|
|
18
22
|
"module": "dist/esm",
|
|
@@ -31,17 +35,17 @@
|
|
|
31
35
|
"watch": "tamagui-build --watch"
|
|
32
36
|
},
|
|
33
37
|
"dependencies": {
|
|
34
|
-
"@vxrn/utils": "1.1.
|
|
35
|
-
"@vxrn/vite-flow": "1.1.
|
|
36
|
-
"@vxrn/vite-native-hmr": "1.1.
|
|
38
|
+
"@vxrn/utils": "1.1.388",
|
|
39
|
+
"@vxrn/vite-flow": "1.1.388",
|
|
40
|
+
"@vxrn/vite-native-hmr": "1.1.388",
|
|
37
41
|
"esbuild": "0.24.0",
|
|
38
42
|
"fs-extra": "^11.2.0",
|
|
39
43
|
"import-meta-resolve": "^4.1.0"
|
|
40
44
|
},
|
|
41
45
|
"devDependencies": {
|
|
42
46
|
"@tamagui/build": "^1.121.6",
|
|
43
|
-
"react": "^18.3.1",
|
|
44
|
-
"react-dom": "^18.3.1",
|
|
47
|
+
"react": "^18.3.1 || ^19.0.0",
|
|
48
|
+
"react-dom": "^18.3.1 || ^19.0.0",
|
|
45
49
|
"react-native": "^0.76.5"
|
|
46
50
|
},
|
|
47
51
|
"peerDependencies": {
|
package/src/index.ts
CHANGED
|
@@ -33,18 +33,24 @@ export async function buildReactJSX(options: BuildOptions = {}) {
|
|
|
33
33
|
}).then(async () => {
|
|
34
34
|
// manual force exports
|
|
35
35
|
const bundled = await readFile(options.outfile!, 'utf-8')
|
|
36
|
+
|
|
36
37
|
const outCode = `
|
|
37
38
|
const run = () => {
|
|
38
39
|
${mustReplace(bundled, [
|
|
39
|
-
isProd
|
|
40
|
-
?
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
40
|
+
...(isProd
|
|
41
|
+
? [
|
|
42
|
+
{
|
|
43
|
+
// react 18 and 19 (18 has _min)
|
|
44
|
+
find: /module\.exports = require_react_jsx_runtime_production([a-z_]*)\(\);/,
|
|
45
|
+
replace: `return require_react_jsx_runtime_production$1();`,
|
|
46
|
+
},
|
|
47
|
+
]
|
|
48
|
+
: [
|
|
49
|
+
{
|
|
50
|
+
find: `module.exports = require_react_jsx_dev_runtime_development();`,
|
|
51
|
+
replace: `return require_react_jsx_dev_runtime_development();`,
|
|
52
|
+
},
|
|
53
|
+
]),
|
|
48
54
|
{ find: `process.env.VXRN_REACT_19`, replace: 'false', optional: true },
|
|
49
55
|
{
|
|
50
56
|
find: `Object.assign(exports, eval("require('@vxrn/vendor/react-jsx-19')"));`,
|
|
@@ -101,11 +107,11 @@ export async function buildReact(options: BuildOptions = {}) {
|
|
|
101
107
|
${mustReplace(bundled, [
|
|
102
108
|
isProd
|
|
103
109
|
? {
|
|
104
|
-
find: /module\.exports =
|
|
105
|
-
replace: 'return
|
|
110
|
+
find: /module\.exports = require_react_production([a-z_]*)\(\);/,
|
|
111
|
+
replace: 'return require_react_production$1();',
|
|
106
112
|
}
|
|
107
113
|
: {
|
|
108
|
-
find: /module\.exports = require_react_development(
|
|
114
|
+
find: /module\.exports = require_react_development([a-z_]*)\(\);/,
|
|
109
115
|
replace: 'return require_react_development$1();',
|
|
110
116
|
},
|
|
111
117
|
{
|
|
@@ -130,7 +136,13 @@ export async function buildReact(options: BuildOptions = {}) {
|
|
|
130
136
|
|
|
131
137
|
export async function buildReactNative(
|
|
132
138
|
options: BuildOptions = {},
|
|
133
|
-
{
|
|
139
|
+
{
|
|
140
|
+
platform,
|
|
141
|
+
enableExperimentalReactNativeWithReact19Support = false,
|
|
142
|
+
}: {
|
|
143
|
+
platform: 'ios' | 'android'
|
|
144
|
+
enableExperimentalReactNativeWithReact19Support?: boolean
|
|
145
|
+
}
|
|
134
146
|
) {
|
|
135
147
|
return build({
|
|
136
148
|
bundle: true,
|
|
@@ -196,6 +208,31 @@ export async function buildReactNative(
|
|
|
196
208
|
return
|
|
197
209
|
}
|
|
198
210
|
|
|
211
|
+
if (enableExperimentalReactNativeWithReact19Support) {
|
|
212
|
+
// Patch React Native to support React 19 during prebuild
|
|
213
|
+
if (input.path.includes('Libraries/Renderer/implementations/ReactFabric')) {
|
|
214
|
+
const reactFabricRendererPath = requireResolve(
|
|
215
|
+
`@vxrn/react-native-prebuilt/vendor/rn-react-19-support/ReactFabric-${input.path.endsWith('-dev.js') ? 'dev' : 'prod'}.js`
|
|
216
|
+
)
|
|
217
|
+
|
|
218
|
+
return {
|
|
219
|
+
contents: await readFile(reactFabricRendererPath, 'utf-8'),
|
|
220
|
+
loader: 'js',
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
if (input.path.includes('Libraries/Renderer/implementations/ReactNativeRenderer')) {
|
|
225
|
+
const reactNativeRendererPath = requireResolve(
|
|
226
|
+
`@vxrn/react-native-prebuilt/vendor/rn-react-19-support/ReactNativeRenderer-${input.path.endsWith('-dev.js') ? 'dev' : 'prod'}.js`
|
|
227
|
+
)
|
|
228
|
+
|
|
229
|
+
return {
|
|
230
|
+
contents: await readFile(reactNativeRendererPath, 'utf-8'),
|
|
231
|
+
loader: 'js',
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
199
236
|
const code = await readFile(input.path, 'utf-8')
|
|
200
237
|
|
|
201
238
|
// omg so ugly but no class support?
|
|
@@ -369,7 +406,8 @@ const RExports = [
|
|
|
369
406
|
'PureComponent',
|
|
370
407
|
'StrictMode',
|
|
371
408
|
'Suspense',
|
|
372
|
-
'__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED',
|
|
409
|
+
'__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED', // For React 18
|
|
410
|
+
'__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE', // For React 19
|
|
373
411
|
'cloneElement',
|
|
374
412
|
'createContext',
|
|
375
413
|
'createElement',
|
|
@@ -397,4 +435,11 @@ const RExports = [
|
|
|
397
435
|
'useSyncExternalStore',
|
|
398
436
|
'useTransition',
|
|
399
437
|
'version',
|
|
438
|
+
// Added in React 19
|
|
439
|
+
'act',
|
|
440
|
+
'cache',
|
|
441
|
+
'unstable_useCacheRefresh',
|
|
442
|
+
'use',
|
|
443
|
+
'useActionState',
|
|
444
|
+
'useOptimistic',
|
|
400
445
|
]
|
package/types/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type BuildOptions } from 'esbuild';
|
|
2
2
|
export declare function buildReactJSX(options?: BuildOptions): Promise<void>;
|
|
3
3
|
export declare function buildReact(options?: BuildOptions): Promise<void>;
|
|
4
|
-
export declare function buildReactNative(options: BuildOptions | undefined, { platform }: {
|
|
4
|
+
export declare function buildReactNative(options: BuildOptions | undefined, { platform, enableExperimentalReactNativeWithReact19Support, }: {
|
|
5
5
|
platform: 'ios' | 'android';
|
|
6
|
+
enableExperimentalReactNativeWithReact19Support?: boolean;
|
|
6
7
|
}): Promise<void>;
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAS,KAAK,YAAY,EAAE,MAAM,SAAS,CAAA;AAUlD,wBAAsB,aAAa,CAAC,OAAO,GAAE,YAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAS,KAAK,YAAY,EAAE,MAAM,SAAS,CAAA;AAUlD,wBAAsB,aAAa,CAAC,OAAO,GAAE,YAAiB,iBAmE7D;AAED,wBAAsB,UAAU,CAAC,OAAO,GAAE,YAAiB,iBAoD1D;AAED,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,YAAY,YAAK,EAC1B,EACE,QAAQ,EACR,+CAAuD,GACxD,EAAE;IACD,QAAQ,EAAE,KAAK,GAAG,SAAS,CAAA;IAC3B,+CAA+C,CAAC,EAAE,OAAO,CAAA;CAC1D,iBA0KF"}
|