@podlite/editor-react 0.0.31 → 0.0.32

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/CHANGELOG.md CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  ## Upcoming
4
4
 
5
+ ## 0.0.32
6
+
7
+ - add `Wrapper` component to decorate editor
8
+ - refactor styles
9
+ - adjust autocomplete
10
+ - upgrade base editor library
11
+ - add themes support
12
+ - upgrade syntax highlighting code
13
+ - speed up podite mode for editor
14
+ - added initial support for "Focus Write" mode
15
+
5
16
  ## 0.0.31
6
17
 
7
18
  - fix `=table` caption position
package/README.md CHANGED
@@ -36,13 +36,13 @@ Podlite aims to provide users with a means for creativity and expressing ideas i
36
36
  <div align="center">
37
37
 
38
38
  ##### implementation
39
+
39
40
  </div>
40
41
 
41
42
  - [Source](https://github.com/podlite/podlite)
42
43
  - [Changelog](https://github.com/podlite/podlite/releases)
43
44
  - [Issues](https://github.com/podlite/podlite/issues)
44
45
 
45
-
46
46
  </td><td valign=top><div align="center">
47
47
 
48
48
  ##### publishing system
@@ -75,11 +75,11 @@ Podlite aims to provide users with a means for creativity and expressing ideas i
75
75
  - [pod6.in](https://pod6.in/)
76
76
  - [github.com/podlite](https://github.com/podlite/)
77
77
  - [Podlite project updates](https://podlite.org/contents)
78
+ - [Funding the ongoing development](https://opencollective.com/podlite)
78
79
 
79
80
  </td></tr></table>
80
81
  </div>
81
82
 
82
-
83
83
  ## AUTHOR
84
84
 
85
85
  Copyright (c) 2021-2025 Aliaksandr Zahatski
package/lib/Editor.css ADDED
@@ -0,0 +1,55 @@
1
+ [data-color-mode*='dark'] .podlite-editor {
2
+ --color-border-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 0 0 rgba(255, 255, 255, 0), 0 1px 1px rgba(255, 255, 255, 0.2);
3
+ }
4
+ [data-color-mode*='light'] .podlite-editor {
5
+ --color-border-shadow: 0 0 0 1px rgba(16, 22, 26, 0.1), 0 0 0 rgba(16, 22, 26, 0), 0 1px 1px rgba(16, 22, 26, 0.2);
6
+ }
7
+ .podlite-editor {
8
+ color: var(--color-fg-default);
9
+ box-shadow: var(--color-border-shadow);
10
+ text-align: left;
11
+ border-radius: 3px;
12
+ position: relative;
13
+ display: flex;
14
+ flex-direction: column;
15
+ background-color: var(--color-canvas-subtle);
16
+ }
17
+ .podlite-editor-content {
18
+ position: relative;
19
+ flex: 1;
20
+ overflow: auto;
21
+ }
22
+ .podlite-editor-fullscreen .podlite-editor {
23
+ border-radius: 0;
24
+ }
25
+ .podlite-editor-fullscreen {
26
+ z-index: 999;
27
+ position: fixed;
28
+ top: 0;
29
+ bottom: 0;
30
+ left: 0;
31
+ right: 0;
32
+ }
33
+ .podlite-editor-fullscreen .podlite-editor-toolbar {
34
+ border-radius: 0;
35
+ }
36
+ .podlite-editor-preview {
37
+ padding: 20px;
38
+ width: 0%;
39
+ overflow: hidden;
40
+ border-left: 0;
41
+ position: absolute;
42
+ right: 0;
43
+ top: 0;
44
+ bottom: 0;
45
+ box-sizing: border-box;
46
+ background-color: var(--color-canvas-default);
47
+ }
48
+ .podlite-editor h1 a,
49
+ .podlite-editor h2 a,
50
+ .podlite-editor h3 a,
51
+ .podlite-editor h4 a,
52
+ .podlite-editor h5 a,
53
+ .podlite-editor h6 a {
54
+ display: none;
55
+ }
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import { ViewUpdate, ReactCodeMirrorProps, ReactCodeMirrorRef } from '@uiw/react-codemirror';
3
+ export interface ConverterResult {
4
+ errors?: any;
5
+ result: JSX.Element | string;
6
+ }
7
+ export interface IPodliteEditor extends ReactCodeMirrorProps {
8
+ value?: string;
9
+ /** Preview expanded width @default `50%` */
10
+ previewWidth?: string;
11
+ /** Whether to enable preview function @default `true` */
12
+ enablePreview?: boolean;
13
+ /** Whether to enable scrolling */
14
+ enableScroll?: boolean;
15
+ /** Edit mode and preview mode switching event */
16
+ onPreviewMode?: (isHide: boolean) => void;
17
+ /** Setfull screen */
18
+ isFullscreen?: boolean;
19
+ onChange?: (value: string, viewUpdate: ViewUpdate) => void;
20
+ makePreviewComponent?: (source: string) => ConverterResult;
21
+ }
22
+ export interface PodliteEditorRef {
23
+ editor: React.RefObject<ReactCodeMirrorRef>;
24
+ preview: React.RefObject<HTMLDivElement> | null;
25
+ }
26
+ declare const PodliteEditor: PodliteEditorComponent;
27
+ declare type PodliteEditorComponent = React.FC<React.PropsWithRef<IPodliteEditor>>;
28
+ export default PodliteEditor;
package/lib/Editor.js ADDED
@@ -0,0 +1,404 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const react_1 = (0, tslib_1.__importStar)(require("react"));
5
+ const react_codemirror_1 = (0, tslib_1.__importDefault)(require("@uiw/react-codemirror"));
6
+ const to_jsx_1 = (0, tslib_1.__importDefault)(require("@podlite/to-jsx"));
7
+ const podlite_1 = require("podlite");
8
+ const events = (0, tslib_1.__importStar)(require("@uiw/codemirror-extensions-events"));
9
+ const podlite_2 = require("./podlite");
10
+ const theme_1 = require("./theme");
11
+ const view_1 = require("@codemirror/view");
12
+ const commands_1 = require("@codemirror/commands");
13
+ const react_is_1 = require("react-is");
14
+ const autocomplete_1 = require("@codemirror/autocomplete");
15
+ const dict_1 = (0, tslib_1.__importDefault)(require("./dict"));
16
+ function useDebouncedEffect(fn, deps, time) {
17
+ const dependencies = [...deps, time];
18
+ (0, react_1.useEffect)(() => {
19
+ const timeout = setTimeout(fn, time);
20
+ return () => {
21
+ clearTimeout(timeout);
22
+ };
23
+ }, dependencies);
24
+ }
25
+ const PodliteEditor = react_1.default.forwardRef(PodliteEditorInternal);
26
+ exports.default = PodliteEditor;
27
+ function PodliteEditorInternal(props, ref) {
28
+ const isBrowser = typeof window !== 'undefined';
29
+ if (!isBrowser)
30
+ return null;
31
+ const { onChange, enableScroll = true, enablePreview = true, extensions = [], previewWidth = '50%', onPreviewMode, isFullscreen, makePreviewComponent, ...codemirrorProps } = props;
32
+ const [value, setValue] = (0, react_1.useState)(props.value || '');
33
+ const [text1, setText] = (0, react_1.useState)(props.value || '');
34
+ const codeMirror = (0, react_1.useRef)(null);
35
+ const container = (0, react_1.useRef)(null);
36
+ const containerEditor = (0, react_1.useRef)(null);
37
+ const preview = (0, react_1.useRef)(null);
38
+ const active = (0, react_1.useRef)('editor');
39
+ const topLine = (0, react_1.useRef)(1);
40
+ const $viewHeight = (0, react_1.useRef)(0);
41
+ (0, react_1.useImperativeHandle)(ref, () => ({
42
+ editor: codeMirror,
43
+ preview: preview,
44
+ }), [codeMirror]);
45
+ const height = isFullscreen
46
+ ? '100%'
47
+ : typeof codemirrorProps.height === 'number'
48
+ ? `${codemirrorProps.height}px`
49
+ : codemirrorProps.height;
50
+ const preValue = props.value;
51
+ (0, react_1.useEffect)(() => setValue(preValue ?? ''), [preValue]);
52
+ (0, react_1.useEffect)(() => setText(preValue ?? ''), [preValue]);
53
+ const fullRef = (0, react_1.useRef)(isFullscreen);
54
+ (0, react_1.useEffect)(() => {
55
+ fullRef.current = isFullscreen;
56
+ }, [isFullscreen]);
57
+ const onAnyUpdateEditorSize = () => {
58
+ const clientHeight = containerEditor?.current?.parentElement?.clientHeight;
59
+ if (clientHeight && codeMirror?.current?.view?.dom) {
60
+ if (fullRef.current) {
61
+ codeMirror.current.view.dom.style.height = `${clientHeight}px`;
62
+ $viewHeight.current = clientHeight;
63
+ }
64
+ else {
65
+ codeMirror.current.view.dom.removeAttribute('style');
66
+ }
67
+ }
68
+ };
69
+ const getScrollMap = (el) => {
70
+ const res = [...preview.current.querySelectorAll('.line-src')].map(n => {
71
+ const line = parseInt(n.getAttribute('data-line'), 10);
72
+ const offsetTop = n.offsetTop;
73
+ return { line, offsetTop };
74
+ });
75
+ if (res.length === 0) {
76
+ console.warn(`[podlite-editor] can't get line for offset. Forget add .line-src ?`);
77
+ }
78
+ return res;
79
+ };
80
+ const getNearestMapForLine = (scrollMap, line) => {
81
+ const res = scrollMap.findIndex(i => i.line > line);
82
+ if (res === -1) {
83
+ return scrollMap[scrollMap.length - 1];
84
+ }
85
+ return scrollMap[res];
86
+ };
87
+ const getNearestMapForLineReverse = (scrollMap, line) => {
88
+ const res = scrollMap.reverse().findIndex(i => i.line < line);
89
+ if (res === -1) {
90
+ return scrollMap[0];
91
+ }
92
+ return scrollMap[res];
93
+ };
94
+ const getNearestMapForOffset = (scrollMap, offset) => {
95
+ const res = scrollMap.findIndex(i => i.offsetTop > offset);
96
+ if (res === -1) {
97
+ return scrollMap[scrollMap.length - 1];
98
+ }
99
+ return scrollMap[res];
100
+ };
101
+ // we tray to get the line number of the preview
102
+ (0, react_1.useEffect)(() => {
103
+ if (!preview.current)
104
+ return;
105
+ const listener = e => {
106
+ if (!enableScroll)
107
+ return;
108
+ if (active.current === 'editor')
109
+ return;
110
+ let element = e.target;
111
+ const line = getNearestMapForOffset(getScrollMap(preview.current), element.scrollTop).line;
112
+ // get pos from
113
+ const pos = codeMirror.current.view.state.doc.line(line).from + 0;
114
+ // Set the cursor selection to the position
115
+ codeMirror.current.view.dispatch({
116
+ selection: { anchor: pos },
117
+ scrollIntoView: true,
118
+ });
119
+ const linePos = codeMirror.current.view.coordsAtPos(codeMirror.current.view.state.doc.line(line).from);
120
+ // Calculate to try to center the line in the editor
121
+ if (linePos) {
122
+ const editorRect = codeMirror.current.view.dom.getBoundingClientRect();
123
+ const offset = linePos.top - editorRect.top - editorRect.height / 4; // 2 for middle of screen
124
+ codeMirror.current.view.scrollDOM.scrollTop += offset;
125
+ }
126
+ return true;
127
+ };
128
+ preview?.current?.addEventListener('scroll', listener);
129
+ return () => {
130
+ preview?.current?.removeEventListener('scroll', listener);
131
+ };
132
+ }, [preview, enableScroll, enablePreview, value]);
133
+ const previewScrollHandle = (0, react_1.useCallback)((event) => {
134
+ if (!enableScroll)
135
+ return;
136
+ onAnyUpdateEditorSize();
137
+ if (codeMirror?.current?.view) {
138
+ const rect = codeMirror.current.view.dom.getBoundingClientRect();
139
+ const topVisibleLineBlock = codeMirror.current.view.lineBlockAtHeight(rect.top - codeMirror.current.view.documentTop);
140
+ const tLine = codeMirror.current.view.state.doc.lineAt(topVisibleLineBlock.from).number;
141
+ // set current editor visible top line
142
+ topLine.current = tLine;
143
+ }
144
+ if (active.current === 'editor' && preview.current) {
145
+ if (preview) {
146
+ let scrollToElement = preview.current.querySelector(`#line-${topLine.current}`);
147
+ if (!scrollToElement) {
148
+ const map = getNearestMapForLineReverse(getScrollMap(preview.current), topLine.current);
149
+ scrollToElement = preview.current.querySelector(`#line-${map?.line || 1}`);
150
+ }
151
+ if (scrollToElement) {
152
+ preview.current.scrollTo({
153
+ top: scrollToElement.offsetTop,
154
+ left: 0,
155
+ behavior: 'auto',
156
+ // behavior: 'smooth',
157
+ });
158
+ }
159
+ else {
160
+ console.log('scrollToElement not found' + `#line-${topLine.current}`);
161
+ }
162
+ }
163
+ }
164
+ }, [enableScroll]);
165
+ const mouseoverHandle = () => {
166
+ active.current = 'preview';
167
+ onAnyUpdateEditorSize();
168
+ };
169
+ const mouseleaveHandle = () => {
170
+ active.current = 'editor';
171
+ onAnyUpdateEditorSize();
172
+ };
173
+ (0, react_1.useEffect)(() => {
174
+ const $preview = preview.current;
175
+ if ($preview && enableScroll) {
176
+ $preview.addEventListener('mouseover', mouseoverHandle, false);
177
+ $preview.addEventListener('mouseleave', mouseleaveHandle, false);
178
+ $preview.addEventListener('scroll', previewScrollHandle, false);
179
+ }
180
+ return () => {
181
+ if ($preview && enableScroll) {
182
+ $preview.removeEventListener('mouseover', mouseoverHandle);
183
+ $preview.removeEventListener('mouseleave', mouseoverHandle);
184
+ $preview.removeEventListener('scroll', previewScrollHandle, false);
185
+ }
186
+ };
187
+ }, [preview, enableScroll, previewScrollHandle, enablePreview]);
188
+ const scrollExtensions = events.scroll({
189
+ scroll: previewScrollHandle,
190
+ });
191
+ // Create custom keymap that prevents the toggle comment shortcut
192
+ const preventToggleComment = view_1.keymap.of([
193
+ {
194
+ key: 'Ctrl-/',
195
+ run: () => true,
196
+ preventDefault: true,
197
+ },
198
+ {
199
+ key: 'Cmd-/',
200
+ run: () => true,
201
+ preventDefault: false,
202
+ },
203
+ ...commands_1.defaultKeymap,
204
+ ]);
205
+ let extensionsData = [(0, podlite_2.podliteLang)(), view_1.EditorView.lineWrapping, preventToggleComment];
206
+ if (enableScroll) {
207
+ extensionsData.push(scrollExtensions);
208
+ }
209
+ const makeApply = (text) => (editor, completion, from, to) => {
210
+ return (0, autocomplete_1.snippet)(text)(editor, completion, from - 1, to);
211
+ };
212
+ const langDict = dict_1.default.filter(({ lang = 'pod6' }) => lang === 'pod6');
213
+ const completions = langDict.map(({ displayText, text }) => {
214
+ function cleanBraces(text) {
215
+ return text.replace(/\#\{[^\}]*\}/g, '');
216
+ }
217
+ return {
218
+ label: displayText,
219
+ type: 'keyword',
220
+ apply: makeApply(text),
221
+ info: cleanBraces(text),
222
+ };
223
+ });
224
+ function myCompletions(context) {
225
+ let before = context.matchBefore(/^\s*=\w*/);
226
+ console.log({ before });
227
+ // If completion wasn't explicitly started and there
228
+ // is no word before the cursor, don't open completions.
229
+ if (!context.explicit && !before)
230
+ return null;
231
+ return {
232
+ from: before ? before.from + before.text.indexOf('=') + 1 : context.pos,
233
+ options: completions,
234
+ validFor: /^=\w*$/,
235
+ };
236
+ }
237
+ extensionsData.push((0, autocomplete_1.autocompletion)({ override: [myCompletions] }));
238
+ useDebouncedEffect(() => {
239
+ setValue(text1);
240
+ }, [text1], 50);
241
+ useDebouncedEffect(() => {
242
+ if (preview.current) {
243
+ const map = getNearestMapForLine(getScrollMap(preview.current), topLine.current);
244
+ const scrollToElement = preview.current.querySelector(`#line-${map?.line || 1}`);
245
+ if (scrollToElement) {
246
+ preview.current.scrollTo({
247
+ top: scrollToElement.offsetTop,
248
+ left: 0,
249
+ behavior: 'auto',
250
+ });
251
+ }
252
+ else {
253
+ console.log('scrollToElement not found' + `#line-${map?.line || 1}`);
254
+ }
255
+ }
256
+ }, [enablePreview, previewWidth], 1);
257
+ const handleChange = (value, viewUpdate) => {
258
+ setText(value);
259
+ onChange && onChange(value, viewUpdate);
260
+ };
261
+ (0, react_1.useEffect)(() => {
262
+ if (preview.current) {
263
+ const $preview = preview.current;
264
+ if (preview) {
265
+ $preview.style.borderBottomRightRadius = '3px';
266
+ }
267
+ //@ts-ignore
268
+ if ($preview && (previewWidth !== '0' || previewWidth !== '0%')) {
269
+ $preview.style.width = previewWidth;
270
+ $preview.style.overflow = 'auto';
271
+ if (previewWidth !== '100%') {
272
+ $preview.style.borderLeft = '1px solid var(--color-border-muted)';
273
+ }
274
+ $preview.style.padding = '20px';
275
+ if (containerEditor.current) {
276
+ if (previewWidth == '100%') {
277
+ containerEditor.current.style.width = '100%';
278
+ containerEditor.current.style.visibility = 'hidden';
279
+ containerEditor.current.style.opacity = '0';
280
+ }
281
+ else {
282
+ containerEditor.current.style.width = previewWidth !== '100%' ? `calc(100% - ${previewWidth})` : '0%';
283
+ containerEditor.current.style.visibility = 'visible';
284
+ containerEditor.current.style.opacity = '1';
285
+ }
286
+ }
287
+ }
288
+ else if ($preview) {
289
+ $preview.style.width = '0%';
290
+ $preview.style.overflow = 'hidden';
291
+ $preview.style.borderLeft = '0px';
292
+ $preview.style.padding = '0';
293
+ if (containerEditor.current) {
294
+ containerEditor.current.style.width = '100%';
295
+ containerEditor.current.style.visibility = 'visible';
296
+ containerEditor.current.style.opacity = '1';
297
+ }
298
+ }
299
+ }
300
+ else {
301
+ if (containerEditor.current) {
302
+ containerEditor.current.style.width = '100%';
303
+ containerEditor.current.style.visibility = 'visible';
304
+ containerEditor.current.style.opacity = '1';
305
+ if (codeMirror?.current?.view) {
306
+ console.log('set focus');
307
+ codeMirror.current.view.focus();
308
+ }
309
+ }
310
+ }
311
+ }, [containerEditor, preview, previewWidth]);
312
+ const full_preview = previewWidth === '100%';
313
+ const $height = (0, react_1.useRef)(0);
314
+ const entriesHandle = (entries) => {
315
+ for (const entry of entries) {
316
+ if (codeMirror?.current?.view?.dom) {
317
+ if (fullRef.current) {
318
+ codeMirror.current.view.dom.style.height = `${entry.target.clientHeight}px`;
319
+ $viewHeight.current = entry.target.clientHeight;
320
+ }
321
+ else {
322
+ codeMirror.current.view.dom.removeAttribute('style');
323
+ }
324
+ }
325
+ }
326
+ robserver?.current?.disconnect();
327
+ if (robserver !== null) {
328
+ robserver.current = undefined;
329
+ }
330
+ };
331
+ const robserver = (0, react_1.useRef)(new ResizeObserver(entriesHandle));
332
+ (0, react_1.useEffect)(() => {
333
+ if (!robserver.current) {
334
+ robserver.current = new ResizeObserver(entriesHandle);
335
+ }
336
+ if (containerEditor?.current?.parentElement && robserver.current) {
337
+ const parentElement = containerEditor.current.parentElement;
338
+ robserver.current.observe(parentElement);
339
+ }
340
+ return () => {
341
+ if (robserver.current) {
342
+ robserver.current.disconnect();
343
+ robserver.current = undefined;
344
+ }
345
+ };
346
+ }, [containerEditor, entriesHandle, codeMirror, isFullscreen, robserver]);
347
+ (0, react_1.useEffect)(() => {
348
+ if (!document)
349
+ return;
350
+ const containerEl = container.current;
351
+ document.body.style.overflow = isFullscreen ? 'hidden' : 'initial';
352
+ isFullscreen
353
+ ? document.body.classList.add(`podlite-editor-fullscreen`)
354
+ : document.body.classList.remove(`podlite-editor-fullscreen`);
355
+ if (containerEl && isFullscreen) {
356
+ containerEl.style.zIndex = '999';
357
+ containerEl.style.position = 'fixed';
358
+ containerEl.style.top = '0px';
359
+ containerEl.style.bottom = '0px';
360
+ containerEl.style.left = '0px';
361
+ containerEl.style.right = '0px';
362
+ }
363
+ }, [isFullscreen, container]);
364
+ const clsPreview = 'podlite-editor-preview Editorright layoutPreview';
365
+ const cls = ['podlite-editor', 'podlite-var'].filter(Boolean).join(' ');
366
+ const getTree = (value) => {
367
+ let podlite = (0, podlite_1.podlite)({ importPlugins: true });
368
+ let tree = podlite.parse(value);
369
+ const asAst = podlite.toAstResult(tree);
370
+ return asAst;
371
+ };
372
+ // wrap all elements and add line link info
373
+ const wrapFunction = (node, children) => {
374
+ if (node?.location?.start?.line) {
375
+ const line = node.location.start.line;
376
+ return (react_1.default.createElement("div", { key: line, className: "line-src", "data-line": line, id: `line-${line}` }, children));
377
+ }
378
+ else {
379
+ return children;
380
+ }
381
+ };
382
+ const wrapFunctionNoLines = (node, children) => children;
383
+ const defaultPreview = (source) => {
384
+ const result = react_1.default.createElement(to_jsx_1.default, { wrapElement: wrapFunction, tree: getTree(source) });
385
+ return { result };
386
+ };
387
+ const previewContent = () => {
388
+ if (!enablePreview)
389
+ return null;
390
+ const preview = makePreviewComponent ? makePreviewComponent(value) : defaultPreview(value);
391
+ if (preview) {
392
+ return (0, react_is_1.isElement)(preview.result) ? (react_1.default.createElement("div", { className: "content" }, preview.result)) : (react_1.default.createElement("div", { dangerouslySetInnerHTML: { __html: preview.result }, className: "content" }));
393
+ }
394
+ return null;
395
+ };
396
+ const conentView = (react_1.default.createElement("div", { className: `podlite-editor-content`, style: { height: codemirrorProps?.height } },
397
+ react_1.default.createElement("div", { className: `podlite-editor-content-editor`, ref: containerEditor },
398
+ react_1.default.createElement(react_codemirror_1.default, { theme: theme_1.defaultTheme, ...{ ...codemirrorProps, ...{ basicSetup: { defaultKeymap: false } } }, className: `podlite-editor-inner`, extensions: extensionsData, height: height, ref: codeMirror, onChange: handleChange })),
399
+ enablePreview && (react_1.default.createElement("div", { className: clsPreview, style: { overflow: full_preview ? 'visible' : 'hidden' }, ref: preview }, previewContent()))));
400
+ return (react_1.default.createElement("div", null,
401
+ react_1.default.createElement("div", { className: cls, ref: container }, conentView),
402
+ react_1.default.createElement("div", { style: { minWidth: '80rem', display: 'flex' } }, " ")));
403
+ }
404
+ //# sourceMappingURL=Editor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Editor.js","sourceRoot":"","sources":["../src/Editor.tsx"],"names":[],"mappings":";;;AAAA,4DAA4F;AAC5F,0FAAwG;AACxG,0EAAqC;AACrC,qCAAiD;AACjD,uFAA2D;AAC3D,uCAAuC;AACvC,mCAAsC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