@faiwer/react 0.9.0 → 19.0.2

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 (182) hide show
  1. package/README.md +61 -10
  2. package/dist/core/actions/applyAction.d.ts.map +1 -1
  3. package/dist/core/actions/applyAction.js +4 -0
  4. package/dist/core/actions/applyAction.js.map +1 -1
  5. package/dist/core/actions/catchError.action.d.ts +10 -0
  6. package/dist/core/actions/catchError.action.d.ts.map +1 -0
  7. package/dist/core/actions/catchError.action.js +51 -0
  8. package/dist/core/actions/catchError.action.js.map +1 -0
  9. package/dist/core/actions/dom/value.d.ts +3 -2
  10. package/dist/core/actions/dom/value.d.ts.map +1 -1
  11. package/dist/core/actions/dom/value.js +20 -13
  12. package/dist/core/actions/dom/value.js.map +1 -1
  13. package/dist/core/actions/helpers.d.ts +6 -1
  14. package/dist/core/actions/helpers.d.ts.map +1 -1
  15. package/dist/core/actions/helpers.js +20 -3
  16. package/dist/core/actions/helpers.js.map +1 -1
  17. package/dist/core/actions/remove.action.d.ts.map +1 -1
  18. package/dist/core/actions/remove.action.js +4 -3
  19. package/dist/core/actions/remove.action.js.map +1 -1
  20. package/dist/core/actions/replace.action.d.ts.map +1 -1
  21. package/dist/core/actions/replace.action.js +4 -0
  22. package/dist/core/actions/replace.action.js.map +1 -1
  23. package/dist/core/actions/scheduleEffect.action.d.ts +7 -0
  24. package/dist/core/actions/scheduleEffect.action.d.ts.map +1 -0
  25. package/dist/core/actions/scheduleEffect.action.js +8 -0
  26. package/dist/core/actions/scheduleEffect.action.js.map +1 -0
  27. package/dist/core/actions/setAttr.action.d.ts.map +1 -1
  28. package/dist/core/actions/setAttr.action.js +2 -3
  29. package/dist/core/actions/setAttr.action.js.map +1 -1
  30. package/dist/core/actions/setRef.action.d.ts.map +1 -1
  31. package/dist/core/actions/setRef.action.js +1 -2
  32. package/dist/core/actions/setRef.action.js.map +1 -1
  33. package/dist/core/classComponent.d.ts +2 -1
  34. package/dist/core/classComponent.d.ts.map +1 -1
  35. package/dist/core/classComponent.js +17 -10
  36. package/dist/core/classComponent.js.map +1 -1
  37. package/dist/core/components.d.ts +5 -3
  38. package/dist/core/components.d.ts.map +1 -1
  39. package/dist/core/components.js +17 -4
  40. package/dist/core/components.js.map +1 -1
  41. package/dist/core/devTools/devTools.d.ts +2 -0
  42. package/dist/core/devTools/devTools.d.ts.map +1 -0
  43. package/dist/core/devTools/devTools.js +43 -0
  44. package/dist/core/devTools/devTools.js.map +1 -0
  45. package/dist/core/devTools/hmr.d.ts +6 -0
  46. package/dist/core/devTools/hmr.d.ts.map +1 -0
  47. package/dist/core/devTools/hmr.js +55 -0
  48. package/dist/core/devTools/hmr.js.map +1 -0
  49. package/dist/core/devTools/toRFiber.d.ts +7 -0
  50. package/dist/core/devTools/toRFiber.d.ts.map +1 -0
  51. package/dist/core/devTools/toRFiber.js +143 -0
  52. package/dist/core/devTools/toRFiber.js.map +1 -0
  53. package/dist/core/devTools/toRJsx.d.ts +10 -0
  54. package/dist/core/devTools/toRJsx.d.ts.map +1 -0
  55. package/dist/core/devTools/toRJsx.js +62 -0
  56. package/dist/core/devTools/toRJsx.js.map +1 -0
  57. package/dist/core/devTools/types.d.ts +157 -0
  58. package/dist/core/devTools/types.d.ts.map +1 -0
  59. package/dist/core/devTools/types.js +19 -0
  60. package/dist/core/devTools/types.js.map +1 -0
  61. package/dist/core/preact/connect.d.ts +3 -0
  62. package/dist/core/preact/connect.d.ts.map +1 -0
  63. package/dist/core/preact/connect.js +162 -0
  64. package/dist/core/preact/connect.js.map +1 -0
  65. package/dist/core/preact/helpers.d.ts +12 -0
  66. package/dist/core/preact/helpers.d.ts.map +1 -0
  67. package/dist/core/preact/helpers.js +52 -0
  68. package/dist/core/preact/helpers.js.map +1 -0
  69. package/dist/core/preact/inspect.d.ts +9 -0
  70. package/dist/core/preact/inspect.d.ts.map +1 -0
  71. package/dist/core/preact/inspect.js +169 -0
  72. package/dist/core/preact/inspect.js.map +1 -0
  73. package/dist/core/preact/toVNode.d.ts +11 -0
  74. package/dist/core/preact/toVNode.d.ts.map +1 -0
  75. package/dist/core/preact/toVNode.js +150 -0
  76. package/dist/core/preact/toVNode.js.map +1 -0
  77. package/dist/core/preact/types.d.ts +180 -0
  78. package/dist/core/preact/types.d.ts.map +1 -0
  79. package/dist/core/preact/types.js +29 -0
  80. package/dist/core/preact/types.js.map +1 -0
  81. package/dist/core/preact/update.d.ts +13 -0
  82. package/dist/core/preact/update.d.ts.map +1 -0
  83. package/dist/core/preact/update.js +40 -0
  84. package/dist/core/preact/update.js.map +1 -0
  85. package/dist/core/reactNodeToFiberNode.d.ts +3 -1
  86. package/dist/core/reactNodeToFiberNode.d.ts.map +1 -1
  87. package/dist/core/reactNodeToFiberNode.js +79 -16
  88. package/dist/core/reactNodeToFiberNode.js.map +1 -1
  89. package/dist/core/reconciliation/applyActions.d.ts.map +1 -1
  90. package/dist/core/reconciliation/applyActions.js +1 -0
  91. package/dist/core/reconciliation/applyActions.js.map +1 -1
  92. package/dist/core/reconciliation/collect/fromApp.d.ts +2 -1
  93. package/dist/core/reconciliation/collect/fromApp.d.ts.map +1 -1
  94. package/dist/core/reconciliation/collect/fromApp.js +15 -1
  95. package/dist/core/reconciliation/collect/fromApp.js.map +1 -1
  96. package/dist/core/reconciliation/collect/fromChildrenPair.d.ts +2 -1
  97. package/dist/core/reconciliation/collect/fromChildrenPair.d.ts.map +1 -1
  98. package/dist/core/reconciliation/collect/fromChildrenPair.js +26 -4
  99. package/dist/core/reconciliation/collect/fromChildrenPair.js.map +1 -1
  100. package/dist/core/reconciliation/collect/fromComponent.d.ts +2 -1
  101. package/dist/core/reconciliation/collect/fromComponent.d.ts.map +1 -1
  102. package/dist/core/reconciliation/collect/fromComponent.js +25 -3
  103. package/dist/core/reconciliation/collect/fromComponent.js.map +1 -1
  104. package/dist/core/reconciliation/collect/fromFiberPair.d.ts +2 -1
  105. package/dist/core/reconciliation/collect/fromFiberPair.d.ts.map +1 -1
  106. package/dist/core/reconciliation/collect/fromFiberPair.js +6 -1
  107. package/dist/core/reconciliation/collect/fromFiberPair.js.map +1 -1
  108. package/dist/core/reconciliation/compare/areFiberNodesEq.d.ts.map +1 -1
  109. package/dist/core/reconciliation/compare/areFiberNodesEq.js +4 -0
  110. package/dist/core/reconciliation/compare/areFiberNodesEq.js.map +1 -1
  111. package/dist/core/reconciliation/effects.d.ts +2 -2
  112. package/dist/core/reconciliation/effects.d.ts.map +1 -1
  113. package/dist/core/reconciliation/effects.js +53 -4
  114. package/dist/core/reconciliation/effects.js.map +1 -1
  115. package/dist/core/reconciliation/errors/ReactError.d.ts +8 -0
  116. package/dist/core/reconciliation/errors/ReactError.d.ts.map +1 -1
  117. package/dist/core/reconciliation/errors/ReactError.js +33 -0
  118. package/dist/core/reconciliation/errors/ReactError.js.map +1 -1
  119. package/dist/core/reconciliation/errors/stack.d.ts +1 -1
  120. package/dist/core/reconciliation/errors/stack.d.ts.map +1 -1
  121. package/dist/core/reconciliation/errors/stack.js +3 -3
  122. package/dist/core/reconciliation/errors/stack.js.map +1 -1
  123. package/dist/core/reconciliation/fibers.d.ts +12 -2
  124. package/dist/core/reconciliation/fibers.d.ts.map +1 -1
  125. package/dist/core/reconciliation/fibers.js +60 -1
  126. package/dist/core/reconciliation/fibers.js.map +1 -1
  127. package/dist/core/reconciliation/invalidateFiber.js +2 -2
  128. package/dist/core/reconciliation/invalidateFiber.js.map +1 -1
  129. package/dist/core/reconciliation/mount.d.ts.map +1 -1
  130. package/dist/core/reconciliation/mount.js +32 -2
  131. package/dist/core/reconciliation/mount.js.map +1 -1
  132. package/dist/core/reconciliation/postCommit.d.ts.map +1 -1
  133. package/dist/core/reconciliation/postCommit.js +1 -0
  134. package/dist/core/reconciliation/postCommit.js.map +1 -1
  135. package/dist/core/reconciliation/render.d.ts.map +1 -1
  136. package/dist/core/reconciliation/render.js +8 -2
  137. package/dist/core/reconciliation/render.js.map +1 -1
  138. package/dist/core/reconciliation/runFiberComponents.d.ts +3 -1
  139. package/dist/core/reconciliation/runFiberComponents.d.ts.map +1 -1
  140. package/dist/core/reconciliation/runFiberComponents.js +31 -4
  141. package/dist/core/reconciliation/runFiberComponents.js.map +1 -1
  142. package/dist/debug.d.ts +2 -0
  143. package/dist/debug.d.ts.map +1 -0
  144. package/dist/debug.js +2 -0
  145. package/dist/debug.js.map +1 -0
  146. package/dist/hooks/helpers.d.ts +2 -2
  147. package/dist/hooks/helpers.d.ts.map +1 -1
  148. package/dist/hooks/index.d.ts +1 -0
  149. package/dist/hooks/index.d.ts.map +1 -1
  150. package/dist/hooks/index.js +1 -0
  151. package/dist/hooks/index.js.map +1 -1
  152. package/dist/hooks/useEffect.d.ts.map +1 -1
  153. package/dist/hooks/useEffect.js +20 -6
  154. package/dist/hooks/useEffect.js.map +1 -1
  155. package/dist/hooks/useError.d.ts +5 -0
  156. package/dist/hooks/useError.d.ts.map +1 -0
  157. package/dist/hooks/useError.js +19 -0
  158. package/dist/hooks/useError.js.map +1 -0
  159. package/dist/hooks/useReducer.d.ts +7 -0
  160. package/dist/hooks/useReducer.d.ts.map +1 -0
  161. package/dist/hooks/useReducer.js +10 -0
  162. package/dist/hooks/useReducer.js.map +1 -0
  163. package/dist/hooks/useState.d.ts.map +1 -1
  164. package/dist/hooks/useState.js +0 -1
  165. package/dist/hooks/useState.js.map +1 -1
  166. package/dist/index.d.ts +40 -0
  167. package/dist/index.d.ts.map +1 -1
  168. package/dist/index.js +22 -0
  169. package/dist/index.js.map +1 -1
  170. package/dist/types/actions.d.ts +12 -1
  171. package/dist/types/actions.d.ts.map +1 -1
  172. package/dist/types/app.d.ts +14 -1
  173. package/dist/types/app.d.ts.map +1 -1
  174. package/dist/types/component.d.ts +8 -0
  175. package/dist/types/component.d.ts.map +1 -1
  176. package/dist/types/fiber.d.ts +1 -1
  177. package/dist/types/fiber.d.ts.map +1 -1
  178. package/dist/types/hooks.d.ts +12 -2
  179. package/dist/types/hooks.d.ts.map +1 -1
  180. package/dist/types/react.d.ts +0 -4
  181. package/dist/types/react.d.ts.map +1 -1
  182. package/package.json +14 -1
@@ -0,0 +1,150 @@
1
+ import { PreactVNodeFields as F, PreactFragmentComponent, } from './types';
2
+ import { isRootFiber } from '../reconciliation/fibers';
3
+ const vnodesCache = new WeakMap();
4
+ /**
5
+ * Converts the given fiber node to a Preact VNode.
6
+ */
7
+ export const fiberToVNode = (fiber,
8
+ /** Position of the node within its parent container. */
9
+ idx,
10
+ /** Provide true to skip the cache. */
11
+ skipCache) => {
12
+ let cached = !skipCache && vnodesCache.get(fiber);
13
+ if (cached) {
14
+ updateVNode(fiber, cached, idx);
15
+ return cached;
16
+ }
17
+ else {
18
+ const vnode = createVNode(fiber, idx);
19
+ vnodesCache.set(fiber, vnode);
20
+ return vnode;
21
+ }
22
+ };
23
+ /**
24
+ * Created a node Preact VNode from scratch based on the given fiber node.
25
+ */
26
+ const createVNode = (fiber, idx) => {
27
+ const props = getPreactProps(fiber);
28
+ const component = getComponent(fiber);
29
+ return {
30
+ constructor: undefined,
31
+ ref: undefined,
32
+ key: fiber.key ?? undefined,
33
+ props,
34
+ type: component ?? fiber.tag,
35
+ [F.parent]: null, // Filled in `./connect.ts`
36
+ [F.diffIndicator]: 0, // Not used.
37
+ [F.compContext]: component ? getCompContext(fiber, component, props) : null,
38
+ [F.element]: fiber.role === 'portal'
39
+ ? fiber.data
40
+ : fiber.element instanceof Element || fiber.element instanceof Text
41
+ ? fiber.element
42
+ : // Comments are not supported
43
+ undefined,
44
+ [F.index]: isRootFiber(fiber) ? -1 : idx,
45
+ [F.children]: [], // Filled in `./connect.ts`
46
+ __o: null, // Not used.
47
+ [F.flags]: 0, // Not used.
48
+ [F.id]: fiber.id,
49
+ __source: fiber.source ?? undefined,
50
+ registered: false,
51
+ };
52
+ };
53
+ const compCtxCache = new WeakMap();
54
+ /**
55
+ * Generates a __c object. It's not unique per component, but unique per fiber.
56
+ * I.e., different versions of the same fiber node should have exactly the same
57
+ * __c node.
58
+ */
59
+ const getCompContext = (fiber, component, props) => {
60
+ let [fiberId, compCtx] = compCtxCache.get(fiber) ?? [];
61
+ if (!compCtx || fiberId !== fiber.id) {
62
+ compCtx = {
63
+ render: component,
64
+ props,
65
+ context: {},
66
+ constructor: component,
67
+ };
68
+ compCtxCache.set(fiber, [fiber.id, compCtx]);
69
+ }
70
+ else {
71
+ compCtx.props = props;
72
+ }
73
+ return compCtx;
74
+ };
75
+ const updateVNode = (fiber, vnode, idx) => {
76
+ vnode.props = getPreactProps(fiber);
77
+ vnode[F.index] = idx;
78
+ const compCtx = vnode[F.compContext];
79
+ if (compCtx) {
80
+ compCtx.props = getPreactProps(fiber);
81
+ }
82
+ };
83
+ /**
84
+ * Return `PreactVNode.type`. It has to be either a string (a tag name) or a
85
+ * function. We generate pseudo component functions for portal and context nodes
86
+ * because in such a case it's better visualized in the UI.
87
+ */
88
+ const getComponent = (fiber) => {
89
+ if (fiber.role === 'portal') {
90
+ // Generate a unique portal-component. Preact renders its own kind of
91
+ // portals as separate root nodes named "Z". Not very handy, TBH. So this
92
+ // tradeoff seems to be reasonable.
93
+ return getPortalComp(fiber);
94
+ }
95
+ if (fiber.role === 'context') {
96
+ // Generate a unique (per context kind) context-component.
97
+ return getContextComp(fiber.data.ctx);
98
+ }
99
+ if (isRootFiber(fiber) || fiber.type === 'fragment') {
100
+ // Critical: Preact DevTools expect here ONLY the fragment component.
101
+ return PreactFragmentComponent;
102
+ }
103
+ return fiber.component ?? null;
104
+ };
105
+ /**
106
+ * Returns `PreactVNode.props` + `__c.props`.
107
+ */
108
+ export const getPreactProps = (fiber) => {
109
+ if (fiber.role === 'context' || fiber.type === 'component') {
110
+ return { ...fiber.props };
111
+ }
112
+ if (fiber.role === 'portal') {
113
+ const domNode = fiber.data;
114
+ const tagName = domNode.tagName.toLowerCase();
115
+ const classes = domNode.classList.length
116
+ ? '.' + [...domNode.classList].join('.')
117
+ : '';
118
+ return {
119
+ // Preact DevTools will show it as "<div/>"
120
+ target: {
121
+ [F.element]: fiber.data,
122
+ type: tagName,
123
+ },
124
+ selector: `${tagName}${domNode.id ? `#${domNode.id}` : ''}${classes}`,
125
+ };
126
+ }
127
+ // tag, null, fragment, text nodes. None of them is shown in the UI.
128
+ return {};
129
+ };
130
+ const ctxCache = new WeakMap();
131
+ const getContextComp = (ctx) => {
132
+ let component = ctxCache.get(ctx);
133
+ if (!component) {
134
+ component = function FragmentDummy() { return null; }; // prettier-ignore
135
+ component.displayName = (ctx.displayName || 'Provider') + '.Provider';
136
+ ctxCache.set(ctx, component);
137
+ }
138
+ return component;
139
+ };
140
+ const portalCache = new WeakMap();
141
+ const getPortalComp = (fiber) => {
142
+ let component = portalCache.get(fiber);
143
+ if (!component) {
144
+ component = function PortalDummy() { return null; }; // prettier-ignore
145
+ component.displayName = `Portal`;
146
+ portalCache.set(fiber, component);
147
+ }
148
+ return component;
149
+ };
150
+ //# sourceMappingURL=toVNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toVNode.js","sourceRoot":"","sources":["../../../src/core/preact/toVNode.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,iBAAiB,IAAI,CAAC,EACtB,uBAAuB,GAGxB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,MAAM,WAAW,GAAG,IAAI,OAAO,EAA0B,CAAC;AAC1D;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,KAAgB;AAChB,wDAAwD;AACxD,GAAW;AACX,sCAAsC;AACtC,SAAkB,EACL,EAAE,CAAC;IAChB,IAAI,MAAM,GAAG,CAAC,SAAS,IAAI,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAClD,IAAI,MAAM,EAAE,CAAC;QACX,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;QAChC,OAAO,MAAM,CAAC;IAChB,CAAC;SAAM,CAAC;QACN,MAAM,KAAK,GAAG,WAAW,CAAC,KAA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CAAC,CAAC;IACpC,CAAC;IAED,OAAO,SAAS,CAAC;AAAA,CAClB,CAAC"}
@@ -0,0 +1,180 @@
1
+ import type { FiberNode, ReactComponent, ReactContext, UnknownProps } from '../../types';
2
+ export declare const PreactVNodeFields: {
3
+ readonly parent: "__";
4
+ readonly element: "__e";
5
+ readonly children: "__k";
6
+ readonly id: "__v";
7
+ readonly compContext: "__c";
8
+ readonly diffIndicator: "__b";
9
+ readonly flags: "__u";
10
+ readonly index: "__i";
11
+ };
12
+ declare const F: {
13
+ readonly parent: "__";
14
+ readonly element: "__e";
15
+ readonly children: "__k";
16
+ readonly id: "__v";
17
+ readonly compContext: "__c";
18
+ readonly diffIndicator: "__b";
19
+ readonly flags: "__u";
20
+ readonly index: "__i";
21
+ };
22
+ export declare function PreactFragmentComponent({ children }: {
23
+ children: JSX.Element;
24
+ }): import("../../index.js").JsxElement;
25
+ export type PreactCompContext = {
26
+ constructor: AnyReactComponent;
27
+ render: AnyReactComponent;
28
+ props: UnknownProps;
29
+ context: object;
30
+ base?: Element | Comment;
31
+ state?: object;
32
+ };
33
+ export type PreactVNode = {
34
+ constructor: unknown | undefined;
35
+ key: string | number | undefined;
36
+ props: UnknownProps | string | number;
37
+ ref: unknown | undefined;
38
+ /** Component function or a tag name */
39
+ type: string | AnyReactComponent | ReactContext<any> | null;
40
+ /** A parent VNode. */
41
+ [F.parent]: PreactVNode | null;
42
+ /** Diff/patch flag/counter. */
43
+ [F.diffIndicator]: number;
44
+ /** An object describing the component and its state. */
45
+ [F.compContext]: PreactCompContext | null;
46
+ /** A DOM node. Refers to the 1st real child DOM element if doesn't have its own. */
47
+ [F.element]: Element | Text | undefined;
48
+ /** Index within the parent's children array. -1 for the root node. */
49
+ [F.index]: number;
50
+ /** Internal children list. */
51
+ [F.children]: Array<PreactVNode | null>;
52
+ /** Not used by dev tools. */
53
+ __o: null;
54
+ /** Hook state counter. */
55
+ [F.flags]: number;
56
+ /** VNode unique ID. */
57
+ [F.id]: number;
58
+ __self?: object;
59
+ __source?: {
60
+ columnNumber: number;
61
+ fileName: string;
62
+ lineNumber: number;
63
+ };
64
+ /** Our fields. */
65
+ registered: boolean;
66
+ };
67
+ /**
68
+ * A special object that:
69
+ * - A preact app creates it on its start up
70
+ * - And then the Preact Dev Tools injected script fills this object with extra
71
+ * API hooks that must be called during the render cycle.
72
+ */
73
+ export type PreactOptions = {
74
+ /** Should be called once on app mount. vNode is `app.root.children[0].
75
+ * `Element` is the DOM node where the app is mounted. */
76
+ _root: (vNode: unknown, element: Element) => void;
77
+ /** Called when a new VNode is created. */
78
+ vnode: (vNode: unknown) => void;
79
+ /** Called at the end of each render. */
80
+ _commit: (vNode: PreactVNode, commitQueue: unknown[]) => void;
81
+ /** Called before Preact handles a node. */
82
+ _diff: (vNode: PreactVNode) => void;
83
+ /** Called after Preact handled a node. */
84
+ diffed: (vnode: PreactVNode) => void;
85
+ /** Called when Preact render engine handle children of a container like node. */
86
+ _render: (vNode: PreactVNode, parent?: PreactVNode) => void;
87
+ /** Called when Preact removes a node. */
88
+ unmount: (vnode: PreactVNode) => void;
89
+ };
90
+ export type PreactRendererConfig = {
91
+ Fragment: typeof PreactFragmentComponent;
92
+ };
93
+ /** Preact DevTools support was build based on this Preact codebase version. */
94
+ export declare const PREACT_VERSION = "10.28.0";
95
+ /** window.__PREACT_DEVTOOLS__ */
96
+ export type PreactDevTools = {
97
+ renderers: Map<number, PreactRenderer>;
98
+ /** A hook that should be called once per app. Automatically created a new
99
+ * Preact-renderer and registers it. */
100
+ attachPreact: (version: typeof PREACT_VERSION, options: PreactOptions, rendererConfig: PreactRendererConfig) => number;
101
+ };
102
+ export type PreactRenderer = {
103
+ getVNodeById: (id: number) => PreactVNode | null;
104
+ /** Called on a tree node selection. */
105
+ inspect: (id: number) => PreactInspection;
106
+ /** Called on manual props/context/state changes for the selected tree node. */
107
+ update: (id: number, type: string, path: string[], value: unknown) => void;
108
+ };
109
+ /** A hook representation. Or sub-value of a hook value. */
110
+ export interface PreactHookInspection {
111
+ /** Unique ID. */
112
+ id: string;
113
+ /** IDs of subhooks. */
114
+ children: string[];
115
+ /** The hierarhcy level. */
116
+ depth: number;
117
+ /** Hook name to display. */
118
+ name: unknown;
119
+ /** When `true` the `.value` can be temporarily edited. */
120
+ editable: boolean;
121
+ /**
122
+ * - `typeof` is it's a field of a hook's value.
123
+ * - `undefined` for regular hooks.
124
+ * - `object` for the root pseudo-hook
125
+ */
126
+ type: string;
127
+ meta: null | {
128
+ index: number;
129
+ type: string;
130
+ };
131
+ /** An order within the parent hook or the component. */
132
+ index?: number;
133
+ /** The value of the hook. May be null. */
134
+ value: unknown;
135
+ }
136
+ /**
137
+ * A component representation for the selected tree node.
138
+ */
139
+ export interface PreactInspection {
140
+ context: null;
141
+ canSuspend: boolean;
142
+ key: FiberNode['key'] | null;
143
+ hooks: PreactHookInspection[];
144
+ /** Long DevTools' ID, not VNode.id */
145
+ id: number;
146
+ name: string;
147
+ props: UnknownProps;
148
+ state: null;
149
+ signals: null;
150
+ type: number;
151
+ suspended: boolean;
152
+ version: typeof PREACT_VERSION;
153
+ }
154
+ export declare enum PreactVNodeType {
155
+ FN_COMPONENT = 3
156
+ }
157
+ /**
158
+ * App['preact']
159
+ */
160
+ export type PreactAdapter = {
161
+ /** A middleware layer over the Preact DevTools API. */
162
+ api: PreactAPI;
163
+ /** window.__PREACT_DEVTOOLS__ */
164
+ global: PreactDevTools;
165
+ /** Fiber IDs of nodes invalidated within the last render. */
166
+ invalidated: Set<number>;
167
+ /** createRoot().render(_this_). */
168
+ userRootVNode: PreactVNode | null;
169
+ /** A banch of helper methods on the page side created by the Preact DevTools
170
+ * extension */
171
+ renderer: PreactRenderer;
172
+ };
173
+ /** A middleware layer over the Preact DevTools API. */
174
+ export type PreactAPI = {
175
+ afterRender: () => void;
176
+ unmount: (fiber: FiberNode) => void;
177
+ };
178
+ type AnyReactComponent = ReactComponent<any>;
179
+ export {};
180
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@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KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,IAAI,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,GAAG,EAAE,SAAS,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;IAC7B,KAAK,EAAE,oBAAoB,EAAE,CAAC;IAC9B,sCAAsC;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,YAAY,CAAC;IACpB,KAAK,EAAE,IAAI,CAAC;IACZ,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,cAAc,CAAC;CAChC;AAED,oBAAY,eAAe;IACzB,YAAY,IAAI;CAOjB;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,uDAAuD;IACvD,GAAG,EAAE,SAAS,CAAC;IACf,iCAAiC;IACjC,MAAM,EAAE,cAAc,CAAC;IACvB,6DAA6D;IAC7D,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACzB,mCAAmC;IACnC,aAAa,EAAE,WAAW,GAAG,IAAI,CAAC;IAClC;mBACe;IACf,QAAQ,EAAE,cAAc,CAAC;CAC1B,CAAC;AAEF,uDAAuD;AACvD,MAAM,MAAM,SAAS,GAAG;IACtB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,OAAO,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;CACrC,CAAC;AAEF,KAAK,iBAAiB,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC"}
@@ -0,0 +1,29 @@
1
+ export const PreactVNodeFields = {
2
+ parent: '__',
3
+ element: '__e',
4
+ children: '__k',
5
+ id: '__v',
6
+ compContext: '__c',
7
+ diffIndicator: '__b',
8
+ flags: '__u',
9
+ index: '__i',
10
+ };
11
+ const F = PreactVNodeFields;
12
+ // prettier-ignore
13
+ export function PreactFragmentComponent({ children }) {
14
+ return children;
15
+ }
16
+ /** Preact DevTools support was build based on this Preact codebase version. */
17
+ export const PREACT_VERSION = '10.28.0';
18
+ export { PreactVNodeType };
19
+ var PreactVNodeType;
20
+ (function (PreactVNodeType) {
21
+ PreactVNodeType[PreactVNodeType["FN_COMPONENT"] = 3] = "FN_COMPONENT";
22
+ // Since we don't use them it's better to comment them
23
+ // MEMO = 5,
24
+ // FORWARD_REF = 4,
25
+ // SUSPENCE = 6,
26
+ // PORTAL = 9,
27
+ // ELEMENT = 1,
28
+ })(PreactVNodeType || (PreactVNodeType = {}));
29
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/preact/types.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,MAAM,EAAE,IAAI;IACZ,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE,KAAK;IACf,EAAE,EAAE,KAAK;IACT,WAAW,EAAE,KAAK;IAClB,aAAa,EAAE,KAAK;IACpB,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,KAAK;CACJ,CAAC;AACX,MAAM,CAAC,GAAG,iBAAiB,CAAC;AAE5B,kBAAkB;AAClB,MAAM,UAAU,uBAAuB,CAAC,EAAE,QAAQ,EAA8B,EAAE;IAChF,OAAO,QAAQ,CAAC;AAAA,CACjB;AAyED,+EAA+E;AAC/E,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,CAAC;SAkE5B,eAAe;AAA3B,IAAY,eAQX;AARD,WAAY,eAAe;IACzB,qEAAgB,CAAA;IAChB,sDAAsD;IACtD,YAAY;IACZ,mBAAmB;IACnB,gBAAgB;IAChB,cAAc;IACd,eAAe;AANE,CACnB,EAFY,eAAe,KAAf,eAAe,QAQ1B"}
@@ -0,0 +1,13 @@
1
+ import type { App } from '../../types';
2
+ import type { PreactRenderer } from './types';
3
+ /**
4
+ * Custom implementation for PreactRenderer.update. It's simpler to intercept
5
+ * update messages at the top level, than to support it via `__c.forceUpdate()`.
6
+ * Internally PreactDev Tools patches `vnode.__c.props` and calls
7
+ * `forceUpdate()`. `__c.props` are not real props. We prettify them for
8
+ * dev-tools. E.g. we convert children JSX nodes into Preact VNodes. So we
9
+ * cannot rely in the default behavior, it'll break components due to wrong type
10
+ * of children JSX elements.
11
+ */
12
+ export declare function patchedPreactRendererUpdate(app: App, renderer: PreactRenderer, devToolsNodeId: number, type: string, path: string[], value: unknown): void;
13
+ //# sourceMappingURL=update.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/core/preact/update.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,GAAG,EAIJ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAM9C;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,cAAc,EACxB,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EAAE,EACd,KAAK,EAAE,OAAO,GACb,IAAI,CA+BN"}
@@ -0,0 +1,40 @@
1
+ import { nullthrows } from '../../utils';
2
+ import { findFiberById } from '../actions/helpers';
3
+ import { invalidateFiber } from '../reconciliation/invalidateFiber';
4
+ import { ReactError } from '../reconciliation/errors/ReactError';
5
+ /**
6
+ * Custom implementation for PreactRenderer.update. It's simpler to intercept
7
+ * update messages at the top level, than to support it via `__c.forceUpdate()`.
8
+ * Internally PreactDev Tools patches `vnode.__c.props` and calls
9
+ * `forceUpdate()`. `__c.props` are not real props. We prettify them for
10
+ * dev-tools. E.g. we convert children JSX nodes into Preact VNodes. So we
11
+ * cannot rely in the default behavior, it'll break components due to wrong type
12
+ * of children JSX elements.
13
+ */
14
+ export function patchedPreactRendererUpdate(app, renderer, devToolsNodeId, type, path, value) {
15
+ const vnode = nullthrows(renderer.getVNodeById(devToolsNodeId));
16
+ // prettier-ignore
17
+ const fiber = nullthrows(findFiberById(app.root, vnode.__v));
18
+ if (fiber.type === 'tag') {
19
+ throw new ReactError(fiber, `Updating portal props is not supported`);
20
+ }
21
+ if (type !== 'props') {
22
+ // - `state` & `context`: only for class components, which are not directly
23
+ // supported. Instead they are presented as fn-component hooks.
24
+ // - `signal`: signals are not supported.
25
+ throw new ReactError(fiber, `Updating ${type} is not yet implemented`);
26
+ }
27
+ let root = fiber.props;
28
+ for (const k of path.slice(0, -1))
29
+ root = root[k];
30
+ root[path.at(-1)] = value;
31
+ if (fiber.type === 'component') {
32
+ invalidateFiber(fiber);
33
+ }
34
+ else {
35
+ for (const consumer of fiber.data.consumers) {
36
+ invalidateFiber(consumer);
37
+ }
38
+ }
39
+ }
40
+ //# sourceMappingURL=update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/core/preact/update.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAEjE;;;;;;;;GAQG;AACH,MAAM,UAAU,2BAA2B,CACzC,GAAQ,EACR,QAAwB,EACxB,cAAsB,EACtB,IAAY,EACZ,IAAc,EACd,KAAc,EACR;IACN,MAAM,KAAK,GAAG,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,CAAC;IAChE,kBAAkB;IAClB,MAAM,KAAK,GAAG,UAAU,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAIxC,CAAC;IAEpB,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;QACzB,MAAM,IAAI,UAAU,CAAC,KAAK,EAAE,wCAAwC,CAAC,CAAC;IACxE,CAAC;IAED,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;QACrB,2EAA2E;QAC3E,kEAAkE;QAClE,yCAAyC;QACzC,MAAM,IAAI,UAAU,CAAC,KAAK,EAAE,YAAY,IAAI,yBAAyB,CAAC,CAAC;IACzE,CAAC;IAED,IAAI,IAAI,GAAG,KAAK,CAAC,KAAqB,CAAC;IACvC,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAAE,IAAI,GAAG,IAAI,CAAC,CAAC,CAAiB,CAAC;IAClE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAE,CAAC,GAAG,KAAK,CAAC;IAE3B,IAAI,KAAK,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;QAC/B,eAAe,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;SAAM,CAAC;QACN,KAAK,MAAM,QAAQ,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;YAC5C,eAAe,CAAC,QAAQ,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;AAAA,CACF"}
@@ -1,8 +1,10 @@
1
+ import type { Action } from '../types/actions';
1
2
  import { type FiberNode } from '../types';
3
+ import { ReactError } from './reconciliation/errors/ReactError';
2
4
  /**
3
5
  * Converts any possible JSX.Element to a FiberNode, that is used by the engine
4
6
  * everywhere. We don't use JSX.Elements outside of this function.
5
7
  * <div/> -> FiberNode.
6
8
  */
7
- export declare const jsxElementToFiberNode: (jsxElement: import("../index.js").JsxElement, parent: FiberNode, unwrapComponents: boolean) => FiberNode;
9
+ export declare const jsxElementToFiberNode: (jsxElement: import("../index.js").JsxElement, parent: FiberNode, unwrapComponents: boolean) => ReactError | [FiberNode, Action[]];
8
10
  //# sourceMappingURL=reactNodeToFiberNode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reactNodeToFiberNode.d.ts","sourceRoot":"","sources":["../../src/core/reactNodeToFiberNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,SAAS,EAUf,MAAM,UAAU,CAAC;AASlB;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,4GAoIjC,CAAC"}
1
+ {"version":3,"file":"reactNodeToFiberNode.d.ts","sourceRoot":"","sources":["../../src/core/reactNodeToFiberNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAGL,KAAK,SAAS,EAUf,MAAM,UAAU,CAAC;AAQlB,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAGhE;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,qIA4LjC,CAAC"}
@@ -1,6 +1,8 @@
1
1
  import { runComponent } from './components';
2
2
  import { createFiberNode, FRAGMENT_TAG, toFiberChildren, } from './reconciliation/fibers';
3
3
  import { isContextProvider } from './reconciliation/typeGuards';
4
+ import { ReactError } from './reconciliation/errors/ReactError';
5
+ import { isErrorBoundary } from '../hooks/useError';
4
6
  /**
5
7
  * Converts any possible JSX.Element to a FiberNode, that is used by the engine
6
8
  * everywhere. We don't use JSX.Elements outside of this function.
@@ -30,7 +32,7 @@ unwrapComponents) => {
30
32
  parent,
31
33
  props: null,
32
34
  };
33
- return nullFiber;
35
+ return [nullFiber, NO_ACTIONS];
34
36
  }
35
37
  // A text node (string, number or boolean).
36
38
  if (typeof jsxElement !== 'object') {
@@ -40,7 +42,7 @@ unwrapComponents) => {
40
42
  parent,
41
43
  props: { text: String(jsxElement) },
42
44
  };
43
- return textFiber;
45
+ return [textFiber, NO_ACTIONS];
44
46
  }
45
47
  const { key = null } = jsxElement;
46
48
  const { ref = null, ...props } = jsxElement.props;
@@ -54,8 +56,13 @@ unwrapComponents) => {
54
56
  role: 'portal',
55
57
  data: jsxElement.type,
56
58
  };
57
- portalFiber.children = jsxElement.children.map((n) => jsxElementToFiberNode(n, portalFiber, unwrapComponents));
58
- return portalFiber;
59
+ const childrenX = childrenToNodes(portalFiber, jsxElement.children, unwrapComponents);
60
+ // Portals cannot be error boundaries. Pass through.
61
+ if (childrenX instanceof ReactError)
62
+ return childrenX;
63
+ const [children, childrenActions] = childrenX;
64
+ portalFiber.children = children;
65
+ return [portalFiber, childrenActions];
59
66
  }
60
67
  // <ctx.Provider value=?/>
61
68
  if (isContextProvider(jsxElement.type)) {
@@ -69,8 +76,13 @@ unwrapComponents) => {
69
76
  data: { ctx: jsxElement.type.__ctx, consumers: new Set() },
70
77
  source: jsxElement.source,
71
78
  };
72
- contextFiber.children = jsxElement.children.map((n) => jsxElementToFiberNode(n, contextFiber, unwrapComponents));
73
- return contextFiber;
79
+ const childrenX = childrenToNodes(contextFiber, jsxElement.children, unwrapComponents);
80
+ // Context providers cannot be error boundaries. Pass through.
81
+ if (childrenX instanceof ReactError)
82
+ return childrenX;
83
+ const [children, childrenActions] = childrenX;
84
+ contextFiber.children = children;
85
+ return [contextFiber, childrenActions];
74
86
  }
75
87
  // [], </> or <Fragment/>.
76
88
  if (jsxElement.type === FRAGMENT_TAG) {
@@ -80,26 +92,59 @@ unwrapComponents) => {
80
92
  key,
81
93
  source: jsxElement.source,
82
94
  };
83
- fragmentFiber.children = jsxElement.children.map((n) => jsxElementToFiberNode(n, fragmentFiber, unwrapComponents));
84
- return fragmentFiber;
95
+ const childrenX = childrenToNodes(fragmentFiber, jsxElement.children, unwrapComponents);
96
+ // Fragments cannot be error boundaries. Pass through.
97
+ if (childrenX instanceof ReactError)
98
+ return childrenX;
99
+ const [children, childrenActions] = childrenX;
100
+ fragmentFiber.children = children;
101
+ return [fragmentFiber, childrenActions];
85
102
  }
86
103
  // A component node (<Message/>):
87
104
  if (typeof jsxElement.type === 'function') {
105
+ const actions = [];
88
106
  const fiber = {
89
107
  ...createFiberNode(parent),
90
108
  type: 'component',
91
109
  component: jsxElement.type,
92
110
  key,
93
111
  props: jsxElement.props,
94
- data: { hooks: null },
112
+ data: {
113
+ hooks: null,
114
+ actions: [],
115
+ isErrorBoundary: false,
116
+ remount: false,
117
+ },
95
118
  source: jsxElement.source,
96
119
  };
97
120
  if (unwrapComponents) {
98
- const content = runComponent(fiber, null);
99
- const child = jsxElementToFiberNode(content, fiber, unwrapComponents);
121
+ const compX = runComponent(fiber, null);
122
+ // Component can't be its own error boundary, thus pass it through.
123
+ if (compX instanceof ReactError)
124
+ return compX;
125
+ const [content, compActions] = compX;
126
+ let childrenX = jsxElementToFiberNode(content, fiber, unwrapComponents);
127
+ if (childrenX instanceof ReactError) {
128
+ if (isErrorBoundary(fiber)) {
129
+ // Since it's a brand new fiber we don't have any DOM nodes yet. But
130
+ // it must have one. Create a new null nodes to make it an anchor for
131
+ // the error boundary.
132
+ const nullFiber = {
133
+ ...createFiberNode(fiber),
134
+ type: 'null',
135
+ parent: fiber,
136
+ props: null,
137
+ };
138
+ childrenX = [nullFiber, [childrenX.genCatchAction()]];
139
+ }
140
+ else
141
+ return childrenX;
142
+ }
143
+ const [child, childrenActions] = childrenX;
100
144
  fiber.children = toFiberChildren(child);
145
+ actions.push(...compActions, ...childrenActions);
101
146
  }
102
- return fiber;
147
+ return [fiber, actions];
103
148
  }
104
149
  if (typeof jsxElement.type === 'string') {
105
150
  validateRef(ref);
@@ -113,13 +158,30 @@ unwrapComponents) => {
113
158
  data: { events: {}, styles: null },
114
159
  source: jsxElement.source,
115
160
  };
116
- tagFiber.children = jsxElement.children
117
- .map((n) => jsxElementToFiberNode(n, tagFiber, unwrapComponents))
118
- .flat();
119
- return tagFiber;
161
+ const childrenX = childrenToNodes(tagFiber, jsxElement.children, unwrapComponents);
162
+ // Tags cannot be error boundaries. Pass through.
163
+ if (childrenX instanceof ReactError)
164
+ return childrenX;
165
+ const [children, childrenActions] = childrenX;
166
+ tagFiber.children = children;
167
+ return [tagFiber, childrenActions];
120
168
  }
121
169
  throw new Error(`Unknown format of JSX.Element (${jsxElement.type})`);
122
170
  };
171
+ const childrenToNodes = (fiber, elements, unwrapComponents) => {
172
+ const children = [];
173
+ const actions = [];
174
+ for (const childEl of elements) {
175
+ const childX = jsxElementToFiberNode(childEl, fiber, unwrapComponents);
176
+ // `fiber` can't be a component here, thus it can't be an error boundary.
177
+ if (childX instanceof ReactError)
178
+ return childX;
179
+ const [node, childrenActions] = childX;
180
+ children.push(node);
181
+ actions.push(...childrenActions);
182
+ }
183
+ return [children, actions];
184
+ };
123
185
  function validateContextProviderProps(props) {
124
186
  if (!('value' in props)) {
125
187
  throw new Error(`Context provider value is not provided`);
@@ -134,4 +196,5 @@ function validateRef(src) {
134
196
  }
135
197
  throw new Error(`Unsupported format of a ref or a ref handler`);
136
198
  }
199
+ const NO_ACTIONS = [];
137
200
  //# sourceMappingURL=reactNodeToFiberNode.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"reactNodeToFiberNode.js","sourceRoot":"","sources":["../../src/core/reactNodeToFiberNode.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EACL,eAAe,EACf,YAAY,EACZ,eAAe,GAChB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,UAAuB;AACvB,sEAAsE;AACtE,MAAiB;AACjB;uEACuE;AACvE,gBAAyB,EACd,EAAE,CAAC;IACd,qDAAqD;IACrD,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QAC9B,UAAU,GAAG;YACX,IAAI,EAAE,YAAY;YAClB,KAAK,EAAE,EAAE;YACT,GAAG,EAAE,IAAI;YACT,QAAQ,EAAE,UAAU;YACpB,MAAM,EAAE,IAAI;SACb,CAAC;IACJ,CAAC;IAED,oEAAo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