@expo/metro-config 58.0.14 → 58.0.16

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.
Files changed (50) hide show
  1. package/build/babel-transformer.js +4 -2
  2. package/build/babel-transformer.js.map +1 -1
  3. package/build/transform-worker/asset-transformer.d.ts +12 -5
  4. package/build/transform-worker/asset-transformer.js +38 -56
  5. package/build/transform-worker/asset-transformer.js.map +1 -1
  6. package/build/transform-worker/metro-transform-worker.js +42 -4
  7. package/build/transform-worker/metro-transform-worker.js.map +1 -1
  8. package/build/transform-worker/noxcturnal/metro-transform-worker.js +0 -3
  9. package/build/transform-worker/noxcturnal/metro-transform-worker.js.map +1 -1
  10. package/build/transform-worker/noxcturnal/noxcturnal-transformer.d.ts +14 -14
  11. package/build/transform-worker/noxcturnal/noxcturnal-transformer.js +84 -83
  12. package/build/transform-worker/noxcturnal/noxcturnal-transformer.js.map +1 -1
  13. package/build/transform-worker/noxcturnal/plugins/client-server-directive-boundary.js +7 -0
  14. package/build/transform-worker/noxcturnal/plugins/client-server-directive-boundary.js.map +1 -1
  15. package/build/transform-worker/noxcturnal/plugins/client-server-reference-proxy.js +2 -2
  16. package/build/transform-worker/noxcturnal/plugins/client-server-reference-proxy.js.map +1 -1
  17. package/build/transform-worker/noxcturnal/plugins/environment-restricted-react-apis.js +7 -2
  18. package/build/transform-worker/noxcturnal/plugins/environment-restricted-react-apis.js.map +1 -1
  19. package/build/transform-worker/noxcturnal/plugins/expo-dom-component.js +9 -3
  20. package/build/transform-worker/noxcturnal/plugins/expo-dom-component.js.map +1 -1
  21. package/build/transform-worker/noxcturnal/plugins/expo-router-server-exports.js +3 -3
  22. package/build/transform-worker/noxcturnal/plugins/expo-router-server-exports.js.map +1 -1
  23. package/build/transform-worker/noxcturnal/plugins/import-meta.js +8 -0
  24. package/build/transform-worker/noxcturnal/plugins/import-meta.js.map +1 -1
  25. package/build/transform-worker/noxcturnal/plugins/inline-requires.js +7 -0
  26. package/build/transform-worker/noxcturnal/plugins/inline-requires.js.map +1 -1
  27. package/build/transform-worker/noxcturnal/plugins/metro-live-bindings.js +10 -0
  28. package/build/transform-worker/noxcturnal/plugins/metro-live-bindings.js.map +1 -1
  29. package/build/transform-worker/noxcturnal/plugins/platform-select.js +7 -0
  30. package/build/transform-worker/noxcturnal/plugins/platform-select.js.map +1 -1
  31. package/build/transform-worker/noxcturnal/plugins/process-env.js +2 -2
  32. package/build/transform-worker/noxcturnal/plugins/process-env.js.map +1 -1
  33. package/build/transform-worker/noxcturnal/plugins/react-display-name.js +7 -0
  34. package/build/transform-worker/noxcturnal/plugins/react-display-name.js.map +1 -1
  35. package/build/transform-worker/noxcturnal/plugins/react-server-client-proxy.js +2 -2
  36. package/build/transform-worker/noxcturnal/plugins/react-server-client-proxy.js.map +1 -1
  37. package/build/transform-worker/noxcturnal/plugins/react-server-directive-boundary.js +7 -0
  38. package/build/transform-worker/noxcturnal/plugins/react-server-directive-boundary.js.map +1 -1
  39. package/build/transform-worker/noxcturnal/plugins/react-server-module-actions.js +33 -4
  40. package/build/transform-worker/noxcturnal/plugins/react-server-module-actions.js.map +1 -1
  41. package/package.json +5 -5
  42. package/build/transform-worker/noxcturnal/plugins/fix-hermes-v1-async-arrow-non-simple-params.d.ts +0 -3
  43. package/build/transform-worker/noxcturnal/plugins/fix-hermes-v1-async-arrow-non-simple-params.js +0 -122
  44. package/build/transform-worker/noxcturnal/plugins/fix-hermes-v1-async-arrow-non-simple-params.js.map +0 -1
  45. package/build/transform-worker/noxcturnal/plugins/fix-hermes-v1-class-in-finally.d.ts +0 -3
  46. package/build/transform-worker/noxcturnal/plugins/fix-hermes-v1-class-in-finally.js +0 -81
  47. package/build/transform-worker/noxcturnal/plugins/fix-hermes-v1-class-in-finally.js.map +0 -1
  48. package/build/transform-worker/noxcturnal/plugins/fix-hermes-v1-super-in-object-accessor.d.ts +0 -3
  49. package/build/transform-worker/noxcturnal/plugins/fix-hermes-v1-super-in-object-accessor.js +0 -78
  50. package/build/transform-worker/noxcturnal/plugins/fix-hermes-v1-super-in-object-accessor.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/metro-config",
3
- "version": "58.0.14",
3
+ "version": "58.0.16",
4
4
  "description": "A Metro config for running React Native projects with the Metro bundler",
5
5
  "keywords": [
6
6
  "expo",
@@ -65,8 +65,8 @@
65
65
  "@babel/code-frame": "^7.20.0",
66
66
  "@babel/core": "^7.20.0",
67
67
  "@babel/generator": "^7.20.5",
68
- "@expo/config": "~58.0.6",
69
- "@expo/env": "~2.5.2",
68
+ "@expo/config": "~58.0.7",
69
+ "@expo/env": "~2.5.3",
70
70
  "@expo/json-file": "~11.2.1",
71
71
  "@expo/metro": "~58.0.0",
72
72
  "@expo/platforms": "^58.0.1",
@@ -85,7 +85,7 @@
85
85
  "hermes-parser": "^0.36.0",
86
86
  "jsc-safe-url": "^0.2.4",
87
87
  "lightningcss": "^1.30.1",
88
- "noxcturnal": "^0.1.0",
88
+ "noxcturnal": "^0.1.8",
89
89
  "picomatch": "^4.0.4",
90
90
  "postcss": "^8.5.23",
91
91
  "resolve-from": "^5.0.0"
@@ -94,7 +94,7 @@
94
94
  "@babel/plugin-transform-explicit-resource-management": "^7.28.6",
95
95
  "@babel/plugin-transform-exponentiation-operator": "^7.28.6",
96
96
  "@babel/plugin-transform-sticky-regex": "^7.27.1",
97
- "@expo/internal-scripts": "58.0.3",
97
+ "@expo/internal-scripts": "58.0.4",
98
98
  "@types/babel__code-frame": "^7.0.1",
99
99
  "@types/babel__core": "^7.20.5",
100
100
  "@types/babel__generator": "^7.27.0",
@@ -1,3 +0,0 @@
1
- import type { DefinedNativePlugin } from 'noxcturnal';
2
- import type { Noxcturnal } from '../noxcturnal-transformer';
3
- export declare function createFixHermesV1AsyncArrowNonSimpleParamsPlugin(nox: Noxcturnal): DefinedNativePlugin;
@@ -1,122 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "createFixHermesV1AsyncArrowNonSimpleParamsPlugin", {
6
- enumerable: true,
7
- get: function() {
8
- return createFixHermesV1AsyncArrowNonSimpleParamsPlugin;
9
- }
10
- });
11
- function createFixHermesV1AsyncArrowNonSimpleParamsPlugin(nox) {
12
- return nox.defineNativePlugin({
13
- name: 'expo-fix-hermes-v1-async-arrow-non-simple-params',
14
- visitors: [
15
- nox.defineVisitor('ArrowFunctionExpression', {
16
- fields: [
17
- 'async',
18
- 'expression',
19
- 'parameterCount'
20
- ],
21
- scope: true,
22
- children: {
23
- params: {
24
- route: 'FormalParameter|FormalParameterRest|BindingRestElement',
25
- children: {
26
- pattern: {
27
- route: 'Identifier|ObjectPattern|ArrayPattern'
28
- },
29
- default: {
30
- route: 'Expression'
31
- }
32
- }
33
- },
34
- body: {
35
- route: 'FunctionBody'
36
- }
37
- }
38
- }, (arrow)=>{
39
- if (!arrow.node.async) return;
40
- const params = arrow.getChildList('params');
41
- if (params.length === 0) return;
42
- if (params.every((parameter)=>{
43
- if (parameter.node.type !== 'FormalParameter') return false;
44
- return parameter.getChild('pattern')?.node.type === 'Identifier' && !parameter.getChild('default');
45
- })) return;
46
- const body = arrow.getChild('body');
47
- if (!body) arrow.unsupported('missing-async-arrow-body');
48
- const bodySource = body.getSource();
49
- // Hermes rejects every rest-parameter async arrow. Keep its original
50
- // parameter binding in a synchronous closure and invoke a zero-argument
51
- // async arrow inside it, matching Expo's maintained Babel transform.
52
- if (params.some((parameter)=>parameter.node.type === 'FormalParameterRest' || parameter.node.type === 'BindingRestElement')) {
53
- const arrowSource = arrow.getSource();
54
- arrow.replaceWith({
55
- kind: 'composite',
56
- parts: [
57
- arrow.context.sourceSlice(arrowSource.start + 5, bodySource.start),
58
- '(async () => ',
59
- ...arrow.node.expression ? [
60
- '{ return ',
61
- bodySource,
62
- '; }'
63
- ] : [
64
- bodySource
65
- ],
66
- ')()'
67
- ]
68
- });
69
- return;
70
- }
71
- const initializerParts = [];
72
- const replacements = [];
73
- for(let index = 0; index < params.length; index++){
74
- const parameter = params[index];
75
- const pattern = parameter.getChild('pattern');
76
- const initializer = parameter.getChild('default');
77
- if (pattern?.node.type === 'Identifier' && !initializer) continue;
78
- if (!pattern) {
79
- arrow.unsupported('missing-async-arrow-parameter-pattern');
80
- return;
81
- }
82
- const temporary = arrow.scope.generateUid('p');
83
- replacements.push({
84
- path: parameter,
85
- temporary
86
- });
87
- if (initializer) {
88
- initializerParts.push('var ', pattern.getSource(), ` = ${temporary} === undefined ? `, initializer.getSource(), ` : ${temporary}; `);
89
- } else {
90
- initializerParts.push('var ', pattern.getSource(), ` = ${temporary}; `);
91
- }
92
- }
93
- const replacementBodyParts = arrow.node.expression ? [
94
- '{ ',
95
- ...initializerParts,
96
- 'return ',
97
- bodySource,
98
- '; }'
99
- ] : [
100
- arrow.context.sourceSlice(bodySource.start, bodySource.start + 1),
101
- ...initializerParts,
102
- arrow.context.sourceSlice(bodySource.start + 1, bodySource.end)
103
- ];
104
- const arrowSource = arrow.getSource();
105
- const replacementParts = [];
106
- let cursor = arrowSource.start;
107
- for (const replacement of replacements){
108
- const source = replacement.path.getSource();
109
- replacementParts.push(arrow.context.sourceSlice(cursor, source.start), replacement.temporary);
110
- cursor = source.end;
111
- }
112
- replacementParts.push(arrow.context.sourceSlice(cursor, bodySource.start), ...replacementBodyParts);
113
- arrow.replaceWith({
114
- kind: 'composite',
115
- parts: replacementParts
116
- });
117
- })
118
- ]
119
- });
120
- }
121
-
122
- //# sourceMappingURL=fix-hermes-v1-async-arrow-non-simple-params.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["transform-worker/noxcturnal/plugins/fix-hermes-v1-async-arrow-non-simple-params.ts"],"sourcesContent":[null],"names":["createFixHermesV1AsyncArrowNonSimpleParamsPlugin","nox","defineNativePlugin","name","visitors","defineVisitor","fields","scope","children","params","route","pattern","default","body","arrow","node","async","getChildList","length","every","parameter","type","getChild","unsupported","bodySource","getSource","some","arrowSource","replaceWith","kind","parts","context","sourceSlice","start","expression","initializerParts","replacements","index","initializer","temporary","generateUid","push","path","replacementBodyParts","end","replacementParts","cursor","replacement","source"],"mappings":";;;;+BAIgBA;;;eAAAA;;;AAAT,SAASA,iDACdC,GAAe;IAEf,OAAOA,IAAIC,kBAAkB,CAAC;QAC5BC,MAAM;QACNC,UAAU;YACRH,IAAII,aAAa,CACf,2BACA;gBACEC,QAAQ;oBAAC;oBAAS;oBAAc;iBAAiB;gBACjDC,OAAO;gBACPC,UAAU;oBACRC,QAAQ;wBACNC,OAAO;wBACPF,UAAU;4BACRG,SAAS;gCAAED,OAAO;4BAAwC;4BAC1DE,SAAS;gCAAEF,OAAO;4BAAa;wBACjC;oBACF;oBACAG,MAAM;wBAAEH,OAAO;oBAAe;gBAChC;YACF,GACA,CAACI;gBACC,IAAI,CAACA,MAAMC,IAAI,CAACC,KAAK,EAAE;gBACvB,MAAMP,SAASK,MAAMG,YAAY,CAAC;gBAClC,IAAIR,OAAOS,MAAM,KAAK,GAAG;gBACzB,IACET,OAAOU,KAAK,CAAC,CAACC;oBACZ,IAAIA,UAAUL,IAAI,CAACM,IAAI,KAAK,mBAAmB,OAAO;oBACtD,OACED,UAAUE,QAAQ,CAAC,YAAYP,KAAKM,SAAS,gBAC7C,CAACD,UAAUE,QAAQ,CAAC;gBAExB,IAEA;gBAEF,MAAMT,OAAOC,MAAMQ,QAAQ,CAAC;gBAC5B,IAAI,CAACT,MAAMC,MAAMS,WAAW,CAAC;gBAC7B,MAAMC,aAAaX,KAAMY,SAAS;gBAClC,qEAAqE;gBACrE,wEAAwE;gBACxE,qEAAqE;gBACrE,IACEhB,OAAOiB,IAAI,CACT,CAACN,YACCA,UAAUL,IAAI,CAACM,IAAI,KAAK,yBACxBD,UAAUL,IAAI,CAACM,IAAI,KAAK,uBAE5B;oBACA,MAAMM,cAAcb,MAAMW,SAAS;oBACnCX,MAAMc,WAAW,CAAC;wBAChBC,MAAM;wBACNC,OAAO;4BACLhB,M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AACR,WAAWS,KAAK,GAAG,GAAGT,WAAWoB,GAAG;iBAC/D;gBACL,MAAMjB,cAAcb,MAAMW,SAAS;gBACnC,MAAMoB,mBAAyD,EAAE;gBACjE,IAAIC,SAASnB,YAAYM,KAAK;gBAC9B,KAAK,MAAMc,eAAeX,aAAc;oBACtC,MAAMY,SAASD,YAAYL,IAAI,CAACjB,SAAS;oBACzCoB,iBAAiBJ,IAAI,CACnB3B,MAAMiB,OAAO,CAACC,WAAW,CAACc,QAAQE,OAAOf,KAAK,GAC9Cc,YAAYR,SAAS;oBAEvBO,SAASE,OAAOJ,GAAG;gBACrB;gBACAC,iBAAiBJ,IAAI,CACnB3B,MAAMiB,OAAO,CAACC,WAAW,CAACc,QAAQtB,WAAWS,KAAK,MAC/CU;gBAEL7B,MAAMc,WAAW,CAAC;oBAAEC,MAAM;oBAAaC,OAAOe;gBAAiB;YACjE;SAEH;IACH;AACF"}
@@ -1,3 +0,0 @@
1
- import type { DefinedNativePlugin } from 'noxcturnal';
2
- import type { Noxcturnal } from '../noxcturnal-transformer';
3
- export declare function createFixHermesV1ClassInFinallyPlugin(nox: Noxcturnal): DefinedNativePlugin<Set<number>>;
@@ -1,81 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "createFixHermesV1ClassInFinallyPlugin", {
6
- enumerable: true,
7
- get: function() {
8
- return createFixHermesV1ClassInFinallyPlugin;
9
- }
10
- });
11
- function _noxcturnal() {
12
- const data = require("noxcturnal");
13
- _noxcturnal = function() {
14
- return data;
15
- };
16
- return data;
17
- }
18
- function createFixHermesV1ClassInFinallyPlugin(nox) {
19
- return nox.defineNativePlugin({
20
- name: 'expo-fix-hermes-v1-class-in-finally',
21
- createState: ()=>new Set(),
22
- visitors: [
23
- nox.defineVisitor('TryStatement', {
24
- controlFlow: [
25
- 'nested-traverse'
26
- ],
27
- nested: [
28
- nox.defineVisitor('Class', {
29
- fields: [
30
- 'nodeKind',
31
- 'name'
32
- ],
33
- ancestry: {
34
- mode: 'findParent'
35
- }
36
- }, ()=>{})
37
- ],
38
- children: {
39
- finalizer: {
40
- route: 'BlockStatement'
41
- }
42
- }
43
- }, (statement, rewritten)=>{
44
- const finalizer = statement.getChild('finalizer');
45
- if (!finalizer) return;
46
- finalizer.traverse([
47
- nox.defineVisitor('Class', {
48
- fields: [
49
- 'nodeKind',
50
- 'name'
51
- ],
52
- ancestry: {
53
- mode: 'findParent'
54
- }
55
- }, (classPath)=>{
56
- if (rewritten.has(classPath.id)) return;
57
- let parent = classPath.parentPath;
58
- while(parent && parent.id !== finalizer.id){
59
- if ((0, _noxcturnal().isFunctionType)(parent.node.type) || parent.node.type === 'ObjectProperty' || parent.node.type === 'MethodDefinition' || parent.node.type === 'StaticBlock' || parent.node.type === 'Class') {
60
- return;
61
- }
62
- parent = parent.parentPath;
63
- }
64
- if (!parent) return;
65
- rewritten.add(classPath.id);
66
- const source = classPath.getSource();
67
- if (classPath.node.nodeKind === 'ClassDeclaration') {
68
- const name = classPath.node.name;
69
- if (!name) return;
70
- classPath.replaceWith(classPath.context.code.template`var ${name} = (() => { ${source} return ${name}; })();`);
71
- } else {
72
- classPath.replaceWith(classPath.context.code.template`(() => ${source})()`);
73
- }
74
- })
75
- ]);
76
- })
77
- ]
78
- });
79
- }
80
-
81
- //# sourceMappingURL=fix-hermes-v1-class-in-finally.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["transform-worker/noxcturnal/plugins/fix-hermes-v1-class-in-finally.ts"],"sourcesContent":[null],"names":["createFixHermesV1ClassInFinallyPlugin","nox","defineNativePlugin","name","createState","Set","visitors","defineVisitor","controlFlow","nested","fields","ancestry","mode","children","finalizer","route","statement","rewritten","getChild","traverse","classPath","has","id","parent","parentPath","isFunctionType","node","type","add","source","getSource","nodeKind","replaceWith","context","code","template"],"mappings":";;;;+BAKgBA;;;eAAAA;;;;yBAJe;;;;;;AAIxB,SAASA,sCACdC,GAAe;IAEf,OAAO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,MAAM;4BACXiB,UAAUY,WAAW,CACnBZ,UAAUa,OAAO,CAACC,IAAI,CACnBC,QAAQ,CAAC,IAAI,EAAEhC,KAAK,YAAY,EAAE0B,OAAO,QAAQ,EAAE1B,KAAK,OAAO,CAAC;wBAEvE,OAAO;4BACLiB,UAAUY,WAAW,CAACZ,UAAUa,OAAO,CAACC,IAAI,CAACC,QAAQ,CAAC,OAAO,EAAEN,OAAO,GAAG,CAAC;wBAC5E;oBACF;iBAEH;YACH;SAEH;IACH;AACF"}
@@ -1,3 +0,0 @@
1
- import type { DefinedNativePlugin } from 'noxcturnal';
2
- import type { Noxcturnal } from '../noxcturnal-transformer';
3
- export declare function createFixHermesV1SuperInObjectAccessorPlugin(nox: Noxcturnal): DefinedNativePlugin<Set<number>>;
@@ -1,78 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "createFixHermesV1SuperInObjectAccessorPlugin", {
6
- enumerable: true,
7
- get: function() {
8
- return createFixHermesV1SuperInObjectAccessorPlugin;
9
- }
10
- });
11
- function createFixHermesV1SuperInObjectAccessorPlugin(nox) {
12
- const superAncestry = {
13
- ancestry: {
14
- mode: 'findParent',
15
- routes: {
16
- 'StaticMemberExpression|ComputedMemberExpression': {
17
- children: {
18
- object: {
19
- route: 'Expression|Super'
20
- }
21
- }
22
- }
23
- }
24
- }
25
- };
26
- return nox.defineNativePlugin({
27
- name: 'expo-fix-hermes-v1-super-in-object-accessor',
28
- createState: ()=>new Set(),
29
- visitors: [
30
- nox.defineVisitor('ObjectProperty', {
31
- fields: [
32
- 'kind',
33
- 'computed',
34
- 'key'
35
- ],
36
- controlFlow: [
37
- 'nested-traverse'
38
- ],
39
- nested: [
40
- nox.defineVisitor('Super', superAncestry, ()=>{})
41
- ],
42
- children: {
43
- key: {
44
- route: 'Expression'
45
- }
46
- }
47
- }, (accessor, rewritten)=>{
48
- if (accessor.node.computed || accessor.node.kind !== 'get' && accessor.node.kind !== 'set' || typeof accessor.node.key !== 'string') {
49
- return;
50
- }
51
- const key = accessor.getChild('key');
52
- if (!key || key.node.type !== 'Identifier' && key.node.type !== 'StringLiteral') {
53
- return;
54
- }
55
- accessor.traverse([
56
- nox.defineVisitor('Super', superAncestry, (superPath)=>{
57
- const member = superPath.parentPath;
58
- if (!member || member.node.type !== 'StaticMemberExpression' && member.node.type !== 'ComputedMemberExpression' || member.getChild('object')?.id !== superPath.id) {
59
- return;
60
- }
61
- let parent = member.parentPath;
62
- while(parent && parent.id !== accessor.id){
63
- if (parent.node.type === 'Class' || parent.node.type === 'MethodDefinition' || parent.node.type === 'Function' && parent.parentPath?.id !== accessor.id || parent.node.type === 'StaticBlock' || parent.node.type === 'PropertyDefinition' || parent.node.type === 'AccessorProperty' || parent.node.type === 'ObjectProperty') {
64
- return;
65
- }
66
- parent = parent.parentPath;
67
- }
68
- if (!parent || rewritten.has(accessor.id)) return;
69
- rewritten.add(accessor.id);
70
- key.replaceWith(`[${JSON.stringify(accessor.node.key)}]`);
71
- })
72
- ]);
73
- })
74
- ]
75
- });
76
- }
77
-
78
- //# sourceMappingURL=fix-hermes-v1-super-in-object-accessor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["transform-worker/noxcturnal/plugins/fix-hermes-v1-super-in-object-accessor.ts"],"sourcesContent":[null],"names":["createFixHermesV1SuperInObjectAccessorPlugin","nox","superAncestry","ancestry","mode","routes","children","object","route","defineNativePlugin","name","createState","Set","visitors","defineVisitor","fields","controlFlow","nested","key","accessor","rewritten","node","computed","kind","getChild","type","traverse","superPath","member","parentPath","id","parent","has","add","replaceWith","JSON","stringify"],"mappings":";;;;+BAIgBA;;;eAAAA;;;AAAT,SAASA,6CACdC,GAAe;IAEf,MAAMC,gBAAgB;QACpBC,UAAU;YACRC,MAAM;YACNC,QAAQ;gBACN,mDAAmD;oBACjDC,UAAU;wBAAEC,QAAQ;4BAAEC,OAAO;wBAAmB;oBAAE;gBACpD;YACF;QACF;IACF;I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