@univerjs-pro/docs-code 1.0.0-alpha.2 → 1.0.0-alpha.4

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.
@@ -0,0 +1,48 @@
1
+ import type { IDocumentBlockRange, IDocumentBody, IDocumentData } from '@univerjs/core';
2
+ import type { IDocsCodeActionBuildResult, IDocsCodeConfig, IDocsCodeMetadataResource } from './type';
3
+ export declare class InvalidInsertRangeError extends Error {
4
+ constructor(message?: string);
5
+ }
6
+ export interface IInsertCodeActionParams {
7
+ documentData: IDocumentData;
8
+ metadata?: IDocsCodeMetadataResource;
9
+ blockId: string;
10
+ startOffset?: number;
11
+ endOffset?: number;
12
+ insertionMode?: 'convert-paragraph' | 'insert-new';
13
+ config?: Partial<IDocsCodeConfig>;
14
+ }
15
+ export interface IUpdateCodeActionParams {
16
+ documentData: IDocumentData;
17
+ metadata?: IDocsCodeMetadataResource;
18
+ blockId: string;
19
+ config: Partial<IDocsCodeConfig>;
20
+ }
21
+ export interface IExitCodeActionParams {
22
+ documentData: IDocumentData;
23
+ metadata?: IDocsCodeMetadataResource;
24
+ blockId: string;
25
+ }
26
+ export interface IRemoveCodeActionParams {
27
+ documentData: IDocumentData;
28
+ metadata?: IDocsCodeMetadataResource;
29
+ blockId: string;
30
+ }
31
+ export interface ICancelEmptyCodeParagraphActionParams {
32
+ documentData: IDocumentData;
33
+ cursorOffset: number;
34
+ paragraphStartIndex?: number;
35
+ }
36
+ export interface ICodeBoundaryDeleteParams {
37
+ documentData: IDocumentData;
38
+ cursorOffset: number;
39
+ direction: 'left' | 'right';
40
+ }
41
+ export declare function buildInsertCodeActions(params: IInsertCodeActionParams): IDocsCodeActionBuildResult;
42
+ export declare function buildUpdateCodeActions(params: IUpdateCodeActionParams): IDocsCodeActionBuildResult;
43
+ export declare function buildExitCodeActions(params: IExitCodeActionParams): IDocsCodeActionBuildResult | null;
44
+ export declare function buildRemoveCodeActions(params: IRemoveCodeActionParams): IDocsCodeActionBuildResult | null;
45
+ export declare function buildCancelEmptyCodeParagraphActions(params: ICancelEmptyCodeParagraphActionParams): IDocsCodeActionBuildResult | null;
46
+ export declare function findCodeRangeAtOffset(body: IDocumentBody | undefined, offset: number): IDocumentBlockRange | undefined;
47
+ export declare function findCodeRangeById(body: IDocumentBody | undefined, blockId: string): IDocumentBlockRange | undefined;
48
+ export declare function isCodeBoundaryDelete(params: ICodeBoundaryDeleteParams): boolean;
@@ -0,0 +1 @@
1
+ export declare const DOCS_CODE_PLUGIN = "DOC_CODE_PLUGIN";
@@ -0,0 +1,6 @@
1
+ import type { IDocsCodeConfig, IDocsCodeMetadataResource } from './type';
2
+ export declare const DEFAULT_CODE_CONFIG: IDocsCodeConfig;
3
+ export declare function normalizeDocsCodeConfig(config?: Partial<IDocsCodeConfig> | null): IDocsCodeConfig;
4
+ export declare function normalizeDocsCodeMetadataResource(resource?: Partial<IDocsCodeMetadataResource> | null): IDocsCodeMetadataResource;
5
+ export declare function setCodeConfigInMetadata(resource: IDocsCodeMetadataResource | undefined, blockId: string, config: Partial<IDocsCodeConfig>): IDocsCodeMetadataResource;
6
+ export declare function removeCodeConfigFromMetadata(resource: IDocsCodeMetadataResource | undefined, blockId: string): IDocsCodeMetadataResource;
@@ -0,0 +1,15 @@
1
+ import type { IDocumentData } from '@univerjs/core';
2
+ export interface IDocsCodeConfig {
3
+ language: string;
4
+ showLineNumbers: boolean;
5
+ tabSize: number;
6
+ wrap: boolean;
7
+ }
8
+ export interface IDocsCodeMetadataResource {
9
+ codes: Record<string, IDocsCodeConfig>;
10
+ }
11
+ export interface IDocsCodeActionBuildResult {
12
+ nextDocumentData: IDocumentData;
13
+ nextMetadata?: IDocsCodeMetadataResource;
14
+ cursorOffset: number;
15
+ }
@@ -0,0 +1,5 @@
1
+ export declare const DOCS_CODE_PLUGIN_CONFIG_KEY = "docs-code.config";
2
+ export declare const configSymbol: unique symbol;
3
+ export interface IUniverDocsCodeConfig {
4
+ }
5
+ export declare const defaultPluginConfig: IUniverDocsCodeConfig;
@@ -0,0 +1,8 @@
1
+ import { Disposable, IResourceManagerService } from '@univerjs/core';
2
+ import { DocsCodeModel } from '../models/docs-code-model';
3
+ export declare class DocsCodeResourceController extends Disposable {
4
+ private readonly _resourceManagerService;
5
+ private readonly _docsCodeModel;
6
+ constructor(_resourceManagerService: IResourceManagerService, _docsCodeModel: DocsCodeModel);
7
+ private _initResource;
8
+ }
@@ -0,0 +1,150 @@
1
+ import type { IDocsCodeConfig } from '@univerjs-pro/docs-code';
2
+ import type { FDocument } from '@univerjs/docs/facade';
3
+ import type { IDocsCodeInfo, IDocsCodeRange, IDocsCodeUpdateFacadeOptions } from './types';
4
+ import { Injector } from '@univerjs/core';
5
+ /**
6
+ * Facade object for a single docs code block.
7
+ * @example
8
+ * ```ts
9
+ * const fDocument = univerAPI.getActiveDocument();
10
+ * const codes = fDocument.getCodes();
11
+ * console.log(codes);
12
+ *
13
+ * const code = fDocument.findCodeByText('function');
14
+ * console.log(code?.getText());
15
+ * console.log(code?.getConfig());
16
+ *
17
+ * code?.updateConfig({ language: 'javascript', lineNumbers: true });
18
+ * console.log(code?.describe());
19
+ *
20
+ * code?.unwrap();
21
+ * code?.remove();
22
+ * ```
23
+ */
24
+ export declare class FDocumentCode {
25
+ private _document;
26
+ private _blockId;
27
+ protected readonly _injector: Injector;
28
+ private readonly _unitId;
29
+ constructor(_document: FDocument, _blockId: string, _injector: Injector);
30
+ /**
31
+ * Returns the code block id.
32
+ * @returns {string} The code block range id.
33
+ * @example
34
+ * const fDocument = univerAPI.getActiveDocument();
35
+ * const codes = fDocument.getCodes();
36
+ *
37
+ * // Get the id of the first code block.
38
+ * if (codes.length > 0) {
39
+ * const code = codes[0];
40
+ * console.log(code.getId());
41
+ * }
42
+ * ```
43
+ */
44
+ getId(): string;
45
+ /**
46
+ * Returns the code block range in the document data stream.
47
+ * @returns {IDocsCodeRange | null} The code range, or `null` if it no longer exists.
48
+ * @example
49
+ * const fDocument = univerAPI.getActiveDocument();
50
+ * const codes = fDocument.getCodes();
51
+ *
52
+ * // Get the range of the first code block.
53
+ * if (codes.length > 0) {
54
+ * const code = codes[0];
55
+ * console.log(code.getRange());
56
+ * }
57
+ * ```
58
+ */
59
+ getRange(): IDocsCodeRange | null;
60
+ /**
61
+ * Returns plain text inside the code.
62
+ * @returns {string} The code text with block tokens removed.
63
+ * @example
64
+ * const fDocument = univerAPI.getActiveDocument();
65
+ * const code = fDocument.findCodeByText('function');
66
+ *
67
+ * if (code) {
68
+ * console.log(code.getText());
69
+ * }
70
+ * ```
71
+ */
72
+ getText(): string;
73
+ /**
74
+ * Returns an agent-friendly description of the code.
75
+ * @returns {IDocsCodeInfo | null} The code id, range, and text, or `null` if it no longer exists.
76
+ * @example
77
+ * ```ts
78
+ * const fDocument = univerAPI.getActiveDocument();
79
+ * const code = fDocument.findCodeByText('function');
80
+ *
81
+ * if (code) {
82
+ * console.log(code.describe());
83
+ * }
84
+ * ```
85
+ */
86
+ describe(): IDocsCodeInfo | null;
87
+ /**
88
+ * Returns the code block configuration.
89
+ * @returns {IDocsCodeConfig} Language, wrapping, line number, and tab-size settings.
90
+ * @example
91
+ * ```ts
92
+ * const fDocument = univerAPI.getActiveDocument();
93
+ * const code = fDocument.findCodeByText('function');
94
+ *
95
+ * if (code) {
96
+ * console.log(code.getConfig());
97
+ * }
98
+ * ```
99
+ */
100
+ getConfig(): IDocsCodeConfig;
101
+ /**
102
+ * Updates the code block configuration.
103
+ * @param {IDocsCodeUpdateFacadeOptions} options Code block configuration patch.
104
+ * @returns {boolean} Whether the update command succeeded.
105
+ * @example
106
+ * ```ts
107
+ * const fDocument = univerAPI.getActiveDocument();
108
+ * const code = fDocument.findCodeByText('function');
109
+ *
110
+ * if (code) {
111
+ * code.updateConfig({ config: { language: 'typescript' } });
112
+ * }
113
+ * ```
114
+ * ```
115
+ */
116
+ updateConfig(options: IDocsCodeUpdateFacadeOptions): boolean;
117
+ /**
118
+ * Unwraps this code block by removing only the code block formatting.
119
+ * @returns {boolean} Whether the code block formatting was removed.
120
+ * @example
121
+ * ```ts
122
+ * const fDocument = univerAPI.getActiveDocument();
123
+ * const code = fDocument.findCodeByText('function');
124
+ *
125
+ * if (code) {
126
+ * // Remove code block formatting from this block.
127
+ * const success = code.unwrap();
128
+ * console.log(success);
129
+ * }
130
+ * ```
131
+ */
132
+ unwrap(): boolean;
133
+ /**
134
+ * Removes this code block and its content.
135
+ * @returns {boolean} Whether the code block was removed.
136
+ * @example
137
+ * ```ts
138
+ * const fDocument = univerAPI.getActiveDocument();
139
+ * const code = fDocument.findCodeByText('function');
140
+ *
141
+ * if (code) {
142
+ * const success = code.remove();
143
+ * console.log(success);
144
+ * }
145
+ * ```
146
+ */
147
+ remove(): boolean;
148
+ private _getBlockRange;
149
+ private _getDocumentData;
150
+ }
@@ -0,0 +1,132 @@
1
+ import type { FDocumentParagraph } from '@univerjs/docs/facade';
2
+ import type { IDocsCodeFindQuery, IDocsCodeInsertFacadeOptions, IDocsCodeInsertParagraphFacadeOptions } from './types';
3
+ import { FDocument } from '@univerjs/docs/facade';
4
+ import { FDocumentCode } from './f-document-code';
5
+ export interface IFDocumentCodeMixin {
6
+ /**
7
+ * Returns all code block ranges in this document.
8
+ * @returns {FDocumentCode[]} An array of FDocumentCode instances, or an empty array if no code block ranges exist in the document.
9
+ * @example
10
+ * ```ts
11
+ * const fDocument = univerAPI.getActiveDocument();
12
+ * const codes = fDocument.getCodes();
13
+ * console.log(codes);
14
+ * ```
15
+ */
16
+ getCodes(): FDocumentCode[];
17
+ /**
18
+ * Returns a code block range by its block id.
19
+ * @param {string} blockId The code block range id.
20
+ * @returns {FDocumentCode | null} The FDocumentCode instance, or `null` if no code block range with the id exists in the document.
21
+ * @example
22
+ * ```ts
23
+ * const fDocument = univerAPI.getActiveDocument();
24
+ * const code = fDocument.getCode('block-id-123');
25
+ * console.log(code);
26
+ * ```
27
+ */
28
+ getCode(blockId: string): FDocumentCode | null;
29
+ /**
30
+ * Returns the code that contains a document data stream offset.
31
+ * @param {number} offset The document data stream offset.
32
+ * @returns {FDocumentCode | null} The FDocumentCode instance, or `null` if no code block range contains the offset.
33
+ * @example
34
+ * ```ts
35
+ * const fDocument = univerAPI.getActiveDocument();
36
+ * const code = fDocument.getCodeAt(150);
37
+ * console.log(code);
38
+ * ```
39
+ */
40
+ getCodeAt(offset: number): FDocumentCode | null;
41
+ /**
42
+ * Finds the first code whose text contains the given string.
43
+ * @param {string} text Text to search inside code content.
44
+ * @returns {FDocumentCode | null} The first matching FDocumentCode instance, or `null` if no match is found.
45
+ * @example
46
+ * ```ts
47
+ * const fDocument = univerAPI.getActiveDocument();
48
+ * const code = fDocument.findCodeByText('function');
49
+ * console.log(code);
50
+ * ```
51
+ */
52
+ findCodeByText(text: string): FDocumentCode | null;
53
+ /**
54
+ * Finds codes by text or block id.
55
+ * @param {string | IDocsCodeFindQuery} query A plain text query or a structured code query.
56
+ * @returns {FDocumentCode[]} An array of matching FDocumentCode instances, or an empty array if no match is found.
57
+ * @example
58
+ * ```ts
59
+ * const fDocument = univerAPI.getActiveDocument();
60
+ * const codesWithText = fDocument.findCodes('function');
61
+ * const codesWithId = fDocument.findCodes({ blockId: 'block-id-123' });
62
+ * console.log(codesWithText, codesWithId);
63
+ * ```
64
+ */
65
+ findCodes(query: string | IDocsCodeFindQuery): FDocumentCode[];
66
+ /**
67
+ * Inserts a code block around a paragraph element.
68
+ * The paragraph wrapper is resolved by persisted `paragraphId` before the command runs, so facade edits
69
+ * inserted before the paragraph do not require recalculating offsets.
70
+ * @param {FDocumentParagraph} paragraph The paragraph to convert to a code block.
71
+ * @param {IDocsCodeInsertParagraphFacadeOptions} [options] Optional block id and code config.
72
+ * @returns {FDocumentCode | null} The newly inserted FDocumentCode instance, or `null` if the insert code failed.
73
+ * @example
74
+ * ```ts
75
+ * const fDocument = univerAPI.getActiveDocument();
76
+ *
77
+ * // Insert a code block around a paragraph with TypeScript language config.
78
+ * const paragraph = fDocument.appendParagraph('const total = rows.length;');
79
+ * const code = fDocument.insertCode(paragraph, {
80
+ * config: { language: 'typescript' },
81
+ * });
82
+ * console.log(code?.getConfig()?.language);
83
+ * ```
84
+ */
85
+ insertCode(paragraph: FDocumentParagraph, options?: IDocsCodeInsertParagraphFacadeOptions): FDocumentCode | null;
86
+ /**
87
+ * Inserts a code around a document range, or inserts an empty code when the range is collapsed.
88
+ * Prefer the paragraph overload for agent-authored code.
89
+ * @param {IDocsCodeInsertFacadeOptions} [options] Optional block id and start/end offsets.
90
+ * @returns {FDocumentCode | null} The newly inserted FDocumentCode instance, or `null` if the insert code failed.
91
+ * @example
92
+ * ```ts
93
+ * const fDocument = univerAPI.getActiveDocument();
94
+ *
95
+ * // Insert a code block around the text "Snippet" in a table cell with TypeScript language config.
96
+ * const table = fDocument.findTableByText('Snippet');
97
+ * const range = table?.getCell(1, 0)?.getContentRange();
98
+ * const code = range ? fDocument.insertCode({ ...range, config: { language: 'typescript' } }) : null;
99
+ * console.log(code);
100
+ *
101
+ * // Insert a code block around the text "const" and the next three paragraphs with TypeScript language config.
102
+ * // const cell = {
103
+ * // width: 960,
104
+ * // blocks: ['code', 'callout', 'quote']
105
+ * // };
106
+ * const paragraph = fDocument.findParagraphByText('const');
107
+ * if (paragraph) {
108
+ * const paragraphs = fDocument.getParagraphs();
109
+ * const { paragraphIndex, startOffset } = paragraph.getInfo();
110
+ * const { endOffset } = paragraphs[paragraphIndex + 3].getInfo();
111
+ * const code2 = fDocument.insertCode({ startOffset, endOffset, config: { language: 'typescript' } });
112
+ * console.log(code2);
113
+ * }
114
+ * ```
115
+ */
116
+ insertCode(options?: IDocsCodeInsertFacadeOptions): FDocumentCode | null;
117
+ }
118
+ export declare class FDocumentCodeMixin extends FDocument implements IFDocumentCodeMixin {
119
+ getCodes(): FDocumentCode[];
120
+ getCode(blockId: string): FDocumentCode | null;
121
+ getCodeAt(offset: number): FDocumentCode | null;
122
+ findCodeByText(text: string): FDocumentCode | null;
123
+ findCodes(query: string | IDocsCodeFindQuery): FDocumentCode[];
124
+ insertCode(paragraph: FDocumentParagraph, options?: IDocsCodeInsertParagraphFacadeOptions): FDocumentCode | null;
125
+ insertCode(options?: IDocsCodeInsertFacadeOptions): FDocumentCode | null;
126
+ private _getBlockRanges;
127
+ private _createFDocumentCode;
128
+ }
129
+ declare module '@univerjs/docs/facade' {
130
+ interface FDocument extends IFDocumentCodeMixin {
131
+ }
132
+ }
@@ -0,0 +1,3 @@
1
+ import './f-document';
2
+ export { FDocumentCode } from './f-document-code';
3
+ export * from './types';
@@ -0,0 +1,26 @@
1
+ import type { IDocsCodeConfig } from '@univerjs-pro/docs-code';
2
+ import type { DocumentBlockRangeType } from '@univerjs/core';
3
+ export interface IDocsCodeInsertFacadeOptions {
4
+ blockId?: string;
5
+ startOffset?: number;
6
+ endOffset?: number;
7
+ config?: Partial<IDocsCodeConfig>;
8
+ }
9
+ export type IDocsCodeInsertParagraphFacadeOptions = Omit<IDocsCodeInsertFacadeOptions, 'startOffset' | 'endOffset'>;
10
+ export interface IDocsCodeUpdateFacadeOptions {
11
+ config: Partial<IDocsCodeConfig>;
12
+ }
13
+ export interface IDocsCodeFindQuery {
14
+ blockId?: string;
15
+ text?: string;
16
+ }
17
+ export interface IDocsCodeRange {
18
+ blockId: string;
19
+ startIndex: number;
20
+ endIndex: number;
21
+ }
22
+ export interface IDocsCodeInfo extends IDocsCodeRange {
23
+ config?: IDocsCodeConfig;
24
+ type: DocumentBlockRangeType.CODE;
25
+ text: string;
26
+ }
@@ -0,0 +1,8 @@
1
+ export { DocsCodeCancelEmptyParagraphCommand, DocsCodeConsumeBoundaryDeleteCommand, DocsCodeInsertBelowCommand, DocsCodeInsertCommand, DocsCodeRemoveCommand, DocsCodeUnwrapCommand, DocsCodeUpdateCommand, } from './commands/code.command';
2
+ export type { IDocsCodeInsertCommandParams, IDocsCodeRemoveCommandParams, IDocsCodeUnwrapCommandParams, IDocsCodeUpdateCommandParams, } from './commands/code.command';
3
+ export { buildCancelEmptyCodeParagraphActions, isCodeBoundaryDelete, } from './common/actions';
4
+ export { DOCS_CODE_PLUGIN } from './common/const';
5
+ export { normalizeDocsCodeConfig } from './common/metadata';
6
+ export type { IDocsCodeConfig } from './common/type';
7
+ export { DocsCodeModel } from './models/docs-code-model';
8
+ export { UniverDocsCodePlugin } from './plugin';
@@ -0,0 +1,18 @@
1
+ import type { IDocsCodeConfig, IDocsCodeMetadataResource } from '../common/type';
2
+ import { Disposable } from '@univerjs/core';
3
+ export declare class DocsCodeModel extends Disposable {
4
+ private readonly _resources;
5
+ private readonly _change$;
6
+ readonly change$: import("rxjs").Observable<{
7
+ unitId: string;
8
+ blockId?: string;
9
+ }>;
10
+ getCodeConfig(unitId: string, blockId: string): IDocsCodeConfig | undefined;
11
+ setCodeConfig(unitId: string, blockId: string, config: Partial<IDocsCodeConfig>): void;
12
+ removeCode(unitId: string, blockId: string): void;
13
+ serialize(unitId: string): IDocsCodeMetadataResource;
14
+ deserialize(unitId: string, resource: IDocsCodeMetadataResource): void;
15
+ removeUnit(unitId: string): void;
16
+ dispose(): void;
17
+ private _setResource;
18
+ }
@@ -0,0 +1,14 @@
1
+ import type { IUniverDocsCodeConfig } from './config/config';
2
+ import { ICommandService, IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
3
+ export declare class UniverDocsCodePlugin extends Plugin {
4
+ private readonly _config;
5
+ readonly _injector: Injector;
6
+ private readonly _commandService;
7
+ private readonly _configService;
8
+ static pluginName: string;
9
+ static packageName: string;
10
+ static version: string;
11
+ static type: UniverInstanceType;
12
+ constructor(_config: IUniverDocsCodeConfig | undefined, _injector: Injector, _commandService: ICommandService, _configService: IConfigService);
13
+ onStarting(): void;
14
+ }
package/lib/umd/facade.js CHANGED
@@ -1 +1 @@
1
- function _0x40fe(_0x31a7be,_0xa8a1fb){_0x31a7be=_0x31a7be-0xd2;var _0x4b8e71=_0x4b8e();var _0x40fe53=_0x4b8e71[_0x31a7be];return _0x40fe53;}(function(_0xcf6637,_0x1f20f6){var _0xec8620=_0x40fe,_0x6dd1ed=_0xcf6637();while(!![]){try{var _0x371a11=-parseInt(_0xec8620(0x126))/0x1+parseInt(_0xec8620(0x122))/0x2*(-parseInt(_0xec8620(0x112))/0x3)+parseInt(_0xec8620(0xe0))/0x4*(-parseInt(_0xec8620(0xe9))/0x5)+parseInt(_0xec8620(0x107))/0x6*(parseInt(_0xec8620(0xe2))/0x7)+parseInt(_0xec8620(0x11a))/0x8+parseInt(_0xec8620(0xeb))/0x9+-parseInt(_0xec8620(0x10d))/0xa*(-parseInt(_0xec8620(0xd9))/0xb);if(_0x371a11===_0x1f20f6)break;else _0x6dd1ed['push'](_0x6dd1ed['shift']());}catch(_0x460236){_0x6dd1ed['push'](_0x6dd1ed['shift']());}}}(_0x4b8e,0x6aa4f),function(_0x5deb3d,_0x1b69c3){var _0xa01e70=_0x40fe;typeof exports==_0xa01e70(0x125)&&typeof module<'u'?_0x1b69c3(exports,require('@univerjs-pro/docs-code'),require('@univerjs/core'),require('@univerjs/docs/facade')):typeof define==_0xa01e70(0x115)&&define[_0xa01e70(0x11b)]?define(['exports',_0xa01e70(0xf5),_0xa01e70(0xfb),'@univerjs/docs/facade'],_0x1b69c3):(_0x5deb3d=typeof globalThis<'u'?globalThis:_0x5deb3d||self,_0x1b69c3(_0x5deb3d[_0xa01e70(0xdf)]={},_0x5deb3d[_0xa01e70(0x10a)],_0x5deb3d[_0xa01e70(0x119)],_0x5deb3d[_0xa01e70(0x129)]));}(this,function(_0x19d192,_0x4f669a,_0x527875,_0xa8265){var _0x301038=_0x40fe;Object['defineProperty'](_0x19d192,Symbol[_0x301038(0xf9)],{'value':_0x301038(0xdd)});function _0x15cd94(_0x4498fc){'@babel/helpers - typeof';var _0x3f40aa=_0x301038;return _0x15cd94=typeof Symbol=='function'&&typeof Symbol[_0x3f40aa(0xe7)]==_0x3f40aa(0x102)?function(_0x10cf33){return typeof _0x10cf33;}:function(_0x1fc013){var _0x30b1ca=_0x3f40aa;return _0x1fc013&&typeof Symbol==_0x30b1ca(0x115)&&_0x1fc013['constructor']===Symbol&&_0x1fc013!==Symbol['prototype']?_0x30b1ca(0x102):typeof _0x1fc013;},_0x15cd94(_0x4498fc);}function _0x29fc15(_0x5e4d5a,_0x1873ec){var _0x26f84f=_0x301038;if(_0x15cd94(_0x5e4d5a)!=_0x26f84f(0x125)||!_0x5e4d5a)return _0x5e4d5a;var _0x585512=_0x5e4d5a[Symbol[_0x26f84f(0x11c)]];if(_0x585512!==void 0x0){var _0x17dab2=_0x585512[_0x26f84f(0xe4)](_0x5e4d5a,_0x1873ec||_0x26f84f(0xfe));if(_0x15cd94(_0x17dab2)!='object')return _0x17dab2;throw TypeError('@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.');}return(_0x1873ec===_0x26f84f(0x111)?String:Number)(_0x5e4d5a);}function _0x4ff01e(_0x16dea8){var _0x595cfa=_0x301038,_0x353cf7=_0x29fc15(_0x16dea8,_0x595cfa(0x111));return _0x15cd94(_0x353cf7)==_0x595cfa(0x102)?_0x353cf7:_0x353cf7+'';}function _0x117428(_0x26f437,_0x40e998,_0x49a092){var _0x1cfddc=_0x301038;return(_0x40e998=_0x4ff01e(_0x40e998))in _0x26f437?Object[_0x1cfddc(0x10c)](_0x26f437,_0x40e998,{'value':_0x49a092,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x26f437[_0x40e998]=_0x49a092,_0x26f437;}function _0x2cdf04(_0x11a40d,_0x76f55b){return function(_0x545a48,_0x443c36){_0x76f55b(_0x545a48,_0x443c36,_0x11a40d);};}function _0x32c3f7(_0x2cafc0,_0x1c3c3e,_0x583f07,_0x40d7f8){var _0x357976=_0x301038,_0x46d473=arguments[_0x357976(0xf8)],_0x35cf91=_0x46d473<0x3?_0x1c3c3e:_0x40d7f8===null?_0x40d7f8=Object[_0x357976(0xd8)](_0x1c3c3e,_0x583f07):_0x40d7f8,_0x12ade6;if(typeof Reflect==_0x357976(0x125)&&typeof Reflect[_0x357976(0x10f)]==_0x357976(0x115))_0x35cf91=Reflect[_0x357976(0x10f)](_0x2cafc0,_0x1c3c3e,_0x583f07,_0x40d7f8);else{for(var _0x3c2be1=_0x2cafc0['length']-0x1;_0x3c2be1>=0x0;_0x3c2be1--)(_0x12ade6=_0x2cafc0[_0x3c2be1])&&(_0x35cf91=(_0x46d473<0x3?_0x12ade6(_0x35cf91):_0x46d473>0x3?_0x12ade6(_0x1c3c3e,_0x583f07,_0x35cf91):_0x12ade6(_0x1c3c3e,_0x583f07))||_0x35cf91);}return _0x46d473>0x3&&_0x35cf91&&Object[_0x357976(0x10c)](_0x1c3c3e,_0x583f07,_0x35cf91),_0x35cf91;}let _0x34672e=class{constructor(_0x5e4a8d,_0x48587e,_0x503a35){var _0x5db257=_0x301038;this['_document']=_0x5e4a8d,this['_blockId']=_0x48587e,this[_0x5db257(0x110)]=_0x503a35,_0x117428(this,'_unitId',void 0x0),this[_0x5db257(0xd3)]=this[_0x5db257(0x116)]['getId']();}[_0x301038(0xf2)](){var _0x54fcaf=_0x301038;return this[_0x54fcaf(0xe1)];}['getRange'](){var _0x4e4de5=_0x301038;let _0x4d252f=this[_0x4e4de5(0xde)]();return _0x4d252f?{'blockId':_0x4d252f[_0x4e4de5(0xd4)],'endIndex':_0x4d252f[_0x4e4de5(0xdb)],'startIndex':_0x4d252f[_0x4e4de5(0x128)]}:null;}[_0x301038(0x120)](){var _0xb0dc58=_0x301038,_0x3dfa3d;let _0x3f80b9=this[_0xb0dc58(0xde)](),_0x3b091f=(_0x3dfa3d=this[_0xb0dc58(0x100)]()[_0xb0dc58(0xe6)])==null?void 0x0:_0x3dfa3d[_0xb0dc58(0xd5)];return!_0x3f80b9||!_0x3b091f?'':_0x5a500e(_0x3b091f['slice'](_0x3f80b9['startIndex']+0x1,_0x3f80b9['endIndex']));}[_0x301038(0xf7)](){var _0x444af8=_0x301038;let _0x1b1c19=this[_0x444af8(0xd2)]();return _0x1b1c19?{..._0x1b1c19,'config':this[_0x444af8(0x105)](),'text':this[_0x444af8(0x120)](),'type':_0x527875['DocumentBlockRangeType'][_0x444af8(0xd6)]}:null;}[_0x301038(0x105)](){var _0x423cee=_0x301038;return(0x0,_0x4f669a[_0x423cee(0xec)])(this[_0x423cee(0x110)][_0x423cee(0x127)](_0x4f669a[_0x423cee(0x108)])[_0x423cee(0x123)](this[_0x423cee(0xd3)],this['_blockId']));}['updateConfig'](_0x558549){var _0x4e8b27=_0x301038;return this[_0x4e8b27(0x110)][_0x4e8b27(0x127)](_0x527875[_0x4e8b27(0x11d)])[_0x4e8b27(0xfd)](_0x4f669a[_0x4e8b27(0x109)]['id'],{'blockId':this['_blockId'],'config':_0x558549[_0x4e8b27(0x104)],'unitId':this[_0x4e8b27(0xd3)]});}[_0x301038(0xf6)](){var _0x25d2e2=_0x301038;return this['_injector']['get'](_0x527875[_0x25d2e2(0x11d)])[_0x25d2e2(0xfd)](_0x4f669a[_0x25d2e2(0xea)]['id'],{'blockId':this[_0x25d2e2(0xe1)],'unitId':this['_unitId']});}['remove'](){var _0x51d435=_0x301038;return this[_0x51d435(0x110)][_0x51d435(0x127)](_0x527875[_0x51d435(0x11d)])[_0x51d435(0xfd)](_0x4f669a[_0x51d435(0xf1)]['id'],{'blockId':this[_0x51d435(0xe1)],'unitId':this[_0x51d435(0xd3)]});}[_0x301038(0xde)](){var _0x2e3216=_0x301038,_0x458b6c;let _0x4b8a59=(_0x458b6c=this[_0x2e3216(0x100)]()['body'])==null||(_0x458b6c=_0x458b6c[_0x2e3216(0xe3)])==null?void 0x0:_0x458b6c[_0x2e3216(0x103)](_0x242f29=>_0x242f29['blockId']===this[_0x2e3216(0xe1)]&&_0x242f29[_0x2e3216(0xf4)]===_0x527875['DocumentBlockRangeType'][_0x2e3216(0xd6)]);return _0x4b8a59==null?null:_0x4b8a59;}[_0x301038(0x100)](){var _0x30a6aa=_0x301038;return this[_0x30a6aa(0x116)][_0x30a6aa(0x11e)]();}};_0x34672e=_0x32c3f7([_0x2cdf04(0x2,(0x0,_0x527875[_0x301038(0x10e)])(_0x527875['Injector']))],_0x34672e);function _0x5a500e(_0x15a1f7){var _0x45f2ea=_0x301038;return Array[_0x45f2ea(0xfc)](_0x15a1f7)[_0x45f2ea(0xff)](_0x61f782=>_0x61f782===_0x527875[_0x45f2ea(0x10b)][_0x45f2ea(0x121)]?'\x0a':_0x61f782)['filter'](_0x4be2e8=>_0x4be2e8!==_0x527875['DataStreamTreeTokenType']['BLOCK_START']&&_0x4be2e8!==_0x527875['DataStreamTreeTokenType'][_0x45f2ea(0xe8)]&&_0x4be2e8!==_0x527875['DataStreamTreeTokenType'][_0x45f2ea(0xfa)])[_0x45f2ea(0x117)]('')['replace'](/\n$/,'');}var _0x4e72bf=class extends _0xa8265[_0x301038(0xd7)]{[_0x301038(0x114)](){var _0xf93c86=_0x301038;return this[_0xf93c86(0xe5)]()['filter'](_0x1fc64b=>_0x1fc64b[_0xf93c86(0xf4)]===_0x527875['DocumentBlockRangeType'][_0xf93c86(0xd6)])[_0xf93c86(0xff)](_0x39e3e0=>this[_0xf93c86(0x118)](_0x39e3e0[_0xf93c86(0xd4)]));}[_0x301038(0x113)](_0xaa03b2){var _0x4deb20=_0x301038;return this[_0x4deb20(0xe5)]()['some'](_0x28fca4=>_0x28fca4[_0x4deb20(0xd4)]===_0xaa03b2&&_0x28fca4['blockType']===_0x527875[_0x4deb20(0x11f)][_0x4deb20(0xd6)])?this['_createFDocumentCode'](_0xaa03b2):null;}[_0x301038(0xed)](_0x2a35a7){var _0x3ba045=_0x301038;let _0x204388=this['_getBlockRanges']()[_0x3ba045(0x103)](_0x32f4c9=>_0x32f4c9[_0x3ba045(0xf4)]===_0x527875['DocumentBlockRangeType']['CODE']&&_0x32f4c9[_0x3ba045(0x128)]<=_0x2a35a7&&_0x2a35a7<=_0x32f4c9[_0x3ba045(0xdb)]);return _0x204388?this['_createFDocumentCode'](_0x204388['blockId']):null;}['findCodeByText'](_0x4f0e9e){var _0x528de4=_0x301038,_0x49f191;return(_0x49f191=this[_0x528de4(0xdc)](_0x4f0e9e)[0x0])==null?null:_0x49f191;}[_0x301038(0xdc)](_0x16fb30){var _0x577aa8=_0x301038;let _0x29058a=typeof _0x16fb30==_0x577aa8(0x111)?{'text':_0x16fb30}:_0x16fb30;return this[_0x577aa8(0x114)]()[_0x577aa8(0xda)](_0x408c9b=>!(_0x29058a['blockId']&&_0x408c9b[_0x577aa8(0xf2)]()!==_0x29058a[_0x577aa8(0xd4)]||_0x29058a[_0x577aa8(0x124)]&&!_0x408c9b[_0x577aa8(0x120)]()[_0x577aa8(0xef)](_0x29058a[_0x577aa8(0x124)])));}[_0x301038(0xee)](_0x197846={},_0x395326={}){var _0x66585=_0x301038,_0x596b71;let _0x3a4b16=this[_0x66585(0x110)]['get'](_0x527875[_0x66585(0x11d)]),_0x29789c=(0x0,_0xa8265['isParagraphFacade'])(_0x197846)?{..._0x395326,..._0x197846['getRange']()}:_0x197846,_0x2829ff=(_0x596b71=_0x29789c[_0x66585(0xd4)])==null?(0x0,_0x527875[_0x66585(0xf3)])(0x6):_0x596b71;return _0x3a4b16[_0x66585(0xfd)](_0x4f669a[_0x66585(0x101)]['id'],{..._0x29789c,'blockId':_0x2829ff,'unitId':this[_0x66585(0xf2)]()})?this['getCode'](_0x2829ff):null;}[_0x301038(0xe5)](){var _0x129703=_0x301038,_0x58ebef,_0x16402d;return(_0x58ebef=(_0x16402d=this['save']()['body'])==null?void 0x0:_0x16402d[_0x129703(0xe3)])==null?[]:_0x58ebef;}[_0x301038(0x118)](_0x33f411){var _0x3d2ffe=_0x301038;return this[_0x3d2ffe(0x110)][_0x3d2ffe(0x106)](_0x34672e,this,_0x33f411);}};_0xa8265['FDocument']['extend'](_0x4e72bf),Object['defineProperty'](_0x19d192,_0x301038(0xf0),{'enumerable':!0x0,'get':function(){return _0x34672e;}});}));function _0x4b8e(){var _0x100aec=['getRange','_unitId','blockId','dataStream','CODE','FDocument','getOwnPropertyDescriptor','5687NndxVE','filter','endIndex','findCodes','Module','_getBlockRange','UniverProDocsCodeFacade','168452sbYHpA','_blockId','289744tJMqSH','blockRanges','call','_getBlockRanges','body','iterator','BLOCK_END','95PrOPVV','DocsCodeUnwrapCommand','2890305PMyYiE','normalizeDocsCodeConfig','getCodeAt','insertCode','includes','FDocumentCode','DocsCodeRemoveCommand','getId','generateRandomId','blockType','@univerjs-pro/docs-code','unwrap','describe','length','toStringTag','SECTION_BREAK','@univerjs/core','from','syncExecuteCommand','default','map','_getDocumentData','DocsCodeInsertCommand','symbol','find','config','getConfig','createInstance','114syptmA','DocsCodeModel','DocsCodeUpdateCommand','UniverProDocsCode','DataStreamTreeTokenType','defineProperty','12910URzptL','Inject','decorate','_injector','string','3UfqtqK','getCode','getCodes','function','_document','join','_createFDocumentCode','UniverCore','2960248bvZSpH','amd','toPrimitive','ICommandService','save','DocumentBlockRangeType','getText','PARAGRAPH','1031404uXgPri','getCodeConfig','text','object','392407wzdHYk','get','startIndex','UniverDocsFacade'];_0x4b8e=function(){return _0x100aec;};return _0x4b8e();}
1
+ (function(_0x370ad3,_0x415ece){var _0x569778=_0x56a2,_0x568398=_0x370ad3();while(!![]){try{var _0x1ea8d3=parseInt(_0x569778(0x1c1))/0x1+parseInt(_0x569778(0x1e7))/0x2*(-parseInt(_0x569778(0x1c6))/0x3)+-parseInt(_0x569778(0x1be))/0x4*(parseInt(_0x569778(0x1c0))/0x5)+parseInt(_0x569778(0x1d4))/0x6+-parseInt(_0x569778(0x201))/0x7+-parseInt(_0x569778(0x1f5))/0x8*(-parseInt(_0x569778(0x1f2))/0x9)+parseInt(_0x569778(0x1dc))/0xa;if(_0x1ea8d3===_0x415ece)break;else _0x568398['push'](_0x568398['shift']());}catch(_0x11e204){_0x568398['push'](_0x568398['shift']());}}}(_0x4446,0xd1b37),function(_0x39246d,_0x5e947c){var _0x2c2443=_0x56a2;typeof exports==_0x2c2443(0x1c3)&&typeof module<'u'?_0x5e947c(exports,require('@univerjs-pro/docs-code'),require('@univerjs/core'),require('@univerjs/docs/facade')):typeof define=='function'&&define['amd']?define([_0x2c2443(0x1b2),_0x2c2443(0x1ce),_0x2c2443(0x1ca),_0x2c2443(0x1e4)],_0x5e947c):(_0x39246d=typeof globalThis<'u'?globalThis:_0x39246d||self,_0x5e947c(_0x39246d[_0x2c2443(0x1b8)]={},_0x39246d[_0x2c2443(0x1d2)],_0x39246d[_0x2c2443(0x1d6)],_0x39246d[_0x2c2443(0x1d0)]));}(this,function(_0x3baac2,_0x3fd2e6,_0x4e3d2d,_0x27b515){var _0xe655f0=_0x56a2;Object[_0xe655f0(0x1cd)](_0x3baac2,Symbol[_0xe655f0(0x1cb)],{'value':'Module'});function _0x424828(_0x52df07){'@babel/helpers - typeof';var _0xaec91a=_0xe655f0;return _0x424828=typeof Symbol==_0xaec91a(0x1b0)&&typeof Symbol[_0xaec91a(0x1b3)]==_0xaec91a(0x1e1)?function(_0x279c2d){return typeof _0x279c2d;}:function(_0x1bed4f){var _0x4faf0d=_0xaec91a;return _0x1bed4f&&typeof Symbol==_0x4faf0d(0x1b0)&&_0x1bed4f[_0x4faf0d(0x1bd)]===Symbol&&_0x1bed4f!==Symbol[_0x4faf0d(0x1b1)]?_0x4faf0d(0x1e1):typeof _0x1bed4f;},_0x424828(_0x52df07);}function _0x23cdc8(_0x5dce1d,_0x431a3e){var _0x1429cc=_0xe655f0;if(_0x424828(_0x5dce1d)!=_0x1429cc(0x1c3)||!_0x5dce1d)return _0x5dce1d;var _0x371edc=_0x5dce1d[Symbol[_0x1429cc(0x1e0)]];if(_0x371edc!==void 0x0){var _0x39358f=_0x371edc[_0x1429cc(0x1b5)](_0x5dce1d,_0x431a3e||_0x1429cc(0x202));if(_0x424828(_0x39358f)!=_0x1429cc(0x1c3))return _0x39358f;throw TypeError(_0x1429cc(0x1c5));}return(_0x431a3e===_0x1429cc(0x1fd)?String:Number)(_0x5dce1d);}function _0x3e8dcd(_0x436cc1){var _0x11ef32=_0xe655f0,_0x14fe72=_0x23cdc8(_0x436cc1,_0x11ef32(0x1fd));return _0x424828(_0x14fe72)==_0x11ef32(0x1e1)?_0x14fe72:_0x14fe72+'';}function _0x277864(_0x5e62ee,_0x3ed502,_0x5c2780){var _0x169969=_0xe655f0;return(_0x3ed502=_0x3e8dcd(_0x3ed502))in _0x5e62ee?Object[_0x169969(0x1cd)](_0x5e62ee,_0x3ed502,{'value':_0x5c2780,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x5e62ee[_0x3ed502]=_0x5c2780,_0x5e62ee;}function _0x32dcc5(_0x51b424,_0x4b98bb){return function(_0x58eeec,_0x395302){_0x4b98bb(_0x58eeec,_0x395302,_0x51b424);};}function _0x2fc362(_0x4ef41a,_0x2164bd,_0x30a6f3,_0x3844ff){var _0x5db8b4=_0xe655f0,_0x182e73=arguments['length'],_0xae079f=_0x182e73<0x3?_0x2164bd:_0x3844ff===null?_0x3844ff=Object['getOwnPropertyDescriptor'](_0x2164bd,_0x30a6f3):_0x3844ff,_0x198598;if(typeof Reflect==_0x5db8b4(0x1c3)&&typeof Reflect['decorate']==_0x5db8b4(0x1b0))_0xae079f=Reflect[_0x5db8b4(0x1f8)](_0x4ef41a,_0x2164bd,_0x30a6f3,_0x3844ff);else{for(var _0x143e4c=_0x4ef41a[_0x5db8b4(0x1f0)]-0x1;_0x143e4c>=0x0;_0x143e4c--)(_0x198598=_0x4ef41a[_0x143e4c])&&(_0xae079f=(_0x182e73<0x3?_0x198598(_0xae079f):_0x182e73>0x3?_0x198598(_0x2164bd,_0x30a6f3,_0xae079f):_0x198598(_0x2164bd,_0x30a6f3))||_0xae079f);}return _0x182e73>0x3&&_0xae079f&&Object[_0x5db8b4(0x1cd)](_0x2164bd,_0x30a6f3,_0xae079f),_0xae079f;}let _0x2d24c9=class{constructor(_0x45fffa,_0x418328,_0x37b797){var _0x289b19=_0xe655f0;this[_0x289b19(0x1bc)]=_0x45fffa,this['_blockId']=_0x418328,this['_injector']=_0x37b797,_0x277864(this,_0x289b19(0x1e3),void 0x0),this['_unitId']=this[_0x289b19(0x1bc)][_0x289b19(0x1c8)]();}[_0xe655f0(0x1c8)](){var _0x4299ac=_0xe655f0;return this[_0x4299ac(0x1e6)];}[_0xe655f0(0x1cf)](){var _0x28fe97=_0xe655f0;let _0x317a0f=this[_0x28fe97(0x1c9)]();return _0x317a0f?{'blockId':_0x317a0f['blockId'],'endIndex':_0x317a0f[_0x28fe97(0x1cc)],'startIndex':_0x317a0f[_0x28fe97(0x1ba)]}:null;}['getText'](){var _0x5215e6=_0xe655f0,_0x5dd773;let _0x396dfc=this[_0x5215e6(0x1c9)](),_0x51d5da=(_0x5dd773=this[_0x5215e6(0x1d1)]()[_0x5215e6(0x1f7)])==null?void 0x0:_0x5dd773[_0x5215e6(0x1f4)];return!_0x396dfc||!_0x51d5da?'':_0x2768d5(_0x51d5da[_0x5215e6(0x1f9)](_0x396dfc['startIndex']+0x1,_0x396dfc[_0x5215e6(0x1cc)]));}[_0xe655f0(0x1ed)](){var _0x2c7bb4=_0xe655f0;let _0x69973=this[_0x2c7bb4(0x1cf)]();return _0x69973?{..._0x69973,'config':this[_0x2c7bb4(0x1bb)](),'text':this[_0x2c7bb4(0x1b7)](),'type':_0x4e3d2d[_0x2c7bb4(0x1fb)]['CODE']}:null;}['getConfig'](){var _0x3f20a4=_0xe655f0;return(0x0,_0x3fd2e6['normalizeDocsCodeConfig'])(this['_injector'][_0x3f20a4(0x1df)](_0x3fd2e6['DocsCodeModel'])[_0x3f20a4(0x1f1)](this[_0x3f20a4(0x1e3)],this['_blockId']));}['updateConfig'](_0xdf48df){var _0x22c74b=_0xe655f0;return this['_injector'][_0x22c74b(0x1df)](_0x4e3d2d[_0x22c74b(0x1ef)])['syncExecuteCommand'](_0x3fd2e6[_0x22c74b(0x1d5)]['id'],{'blockId':this['_blockId'],'config':_0xdf48df['config'],'unitId':this['_unitId']});}['unwrap'](){var _0x2be413=_0xe655f0;return this[_0x2be413(0x1de)][_0x2be413(0x1df)](_0x4e3d2d[_0x2be413(0x1ef)])[_0x2be413(0x1eb)](_0x3fd2e6[_0x2be413(0x1f6)]['id'],{'blockId':this[_0x2be413(0x1e6)],'unitId':this[_0x2be413(0x1e3)]});}[_0xe655f0(0x1d9)](){var _0x38e50e=_0xe655f0;return this[_0x38e50e(0x1de)][_0x38e50e(0x1df)](_0x4e3d2d[_0x38e50e(0x1ef)])['syncExecuteCommand'](_0x3fd2e6['DocsCodeRemoveCommand']['id'],{'blockId':this[_0x38e50e(0x1e6)],'unitId':this['_unitId']});}['_getBlockRange'](){var _0x1c7934=_0xe655f0,_0x5396dc;let _0x376293=(_0x5396dc=this[_0x1c7934(0x1d1)]()[_0x1c7934(0x1f7)])==null||(_0x5396dc=_0x5396dc[_0x1c7934(0x1b4)])==null?void 0x0:_0x5396dc[_0x1c7934(0x1b9)](_0xd43973=>_0xd43973[_0x1c7934(0x1d8)]===this[_0x1c7934(0x1e6)]&&_0xd43973[_0x1c7934(0x1c4)]===_0x4e3d2d[_0x1c7934(0x1fb)]['CODE']);return _0x376293==null?null:_0x376293;}[_0xe655f0(0x1d1)](){var _0x5853d8=_0xe655f0;return this[_0x5853d8(0x1bc)][_0x5853d8(0x1e5)]();}};_0x2d24c9=_0x2fc362([_0x32dcc5(0x2,(0x0,_0x4e3d2d[_0xe655f0(0x1fe)])(_0x4e3d2d['Injector']))],_0x2d24c9);function _0x2768d5(_0x3c994a){var _0x12b130=_0xe655f0;return Array[_0x12b130(0x1db)](_0x3c994a)['map'](_0x6ec4e=>_0x6ec4e===_0x4e3d2d[_0x12b130(0x1ae)][_0x12b130(0x1d7)]?'\x0a':_0x6ec4e)[_0x12b130(0x1af)](_0xf95dde=>_0xf95dde!==_0x4e3d2d[_0x12b130(0x1ae)][_0x12b130(0x1ea)]&&_0xf95dde!==_0x4e3d2d[_0x12b130(0x1ae)][_0x12b130(0x1c7)]&&_0xf95dde!==_0x4e3d2d['DataStreamTreeTokenType'][_0x12b130(0x1bf)])['join']('')[_0x12b130(0x1e8)](/\n$/,'');}var _0x28f46a=class extends _0x27b515['FDocument']{[_0xe655f0(0x1e2)](){var _0x13d59a=_0xe655f0;return this[_0x13d59a(0x200)]()['filter'](_0x28ee59=>_0x28ee59[_0x13d59a(0x1c4)]===_0x4e3d2d[_0x13d59a(0x1fb)][_0x13d59a(0x1fa)])['map'](_0x4ce675=>this[_0x13d59a(0x1dd)](_0x4ce675['blockId']));}['getCode'](_0x5c69c7){var _0x4b62b0=_0xe655f0;return this[_0x4b62b0(0x200)]()[_0x4b62b0(0x1e9)](_0x2c5bbe=>_0x2c5bbe[_0x4b62b0(0x1d8)]===_0x5c69c7&&_0x2c5bbe[_0x4b62b0(0x1c4)]===_0x4e3d2d[_0x4b62b0(0x1fb)]['CODE'])?this[_0x4b62b0(0x1dd)](_0x5c69c7):null;}['getCodeAt'](_0x1f8330){var _0x3631ab=_0xe655f0;let _0x52820e=this['_getBlockRanges']()[_0x3631ab(0x1b9)](_0x3d4155=>_0x3d4155[_0x3631ab(0x1c4)]===_0x4e3d2d['DocumentBlockRangeType'][_0x3631ab(0x1fa)]&&_0x3d4155[_0x3631ab(0x1ba)]<=_0x1f8330&&_0x1f8330<=_0x3d4155[_0x3631ab(0x1cc)]);return _0x52820e?this[_0x3631ab(0x1dd)](_0x52820e['blockId']):null;}['findCodeByText'](_0x3e8806){var _0x57095b=_0xe655f0,_0x4c4d63;return(_0x4c4d63=this[_0x57095b(0x1f3)](_0x3e8806)[0x0])==null?null:_0x4c4d63;}[_0xe655f0(0x1f3)](_0x214e5d){var _0x1f7242=_0xe655f0;let _0x17ed9b=typeof _0x214e5d=='string'?{'text':_0x214e5d}:_0x214e5d;return this[_0x1f7242(0x1e2)]()[_0x1f7242(0x1af)](_0x1b4260=>!(_0x17ed9b['blockId']&&_0x1b4260[_0x1f7242(0x1c8)]()!==_0x17ed9b[_0x1f7242(0x1d8)]||_0x17ed9b[_0x1f7242(0x1d3)]&&!_0x1b4260['getText']()['includes'](_0x17ed9b['text'])));}[_0xe655f0(0x1b6)](_0x3adba5={},_0x2ca52d={}){var _0x441eaa=_0xe655f0,_0x2c039f;let _0x3c98eb=this['_injector'][_0x441eaa(0x1df)](_0x4e3d2d['ICommandService']),_0x2106de=(0x0,_0x27b515[_0x441eaa(0x1fc)])(_0x3adba5)?{..._0x2ca52d,..._0x3adba5[_0x441eaa(0x1cf)]()}:_0x3adba5,_0x2e1053=(_0x2c039f=_0x2106de['blockId'])==null?(0x0,_0x4e3d2d['generateRandomId'])(0x6):_0x2c039f;return _0x3c98eb[_0x441eaa(0x1eb)](_0x3fd2e6[_0x441eaa(0x1c2)]['id'],{..._0x2106de,'blockId':_0x2e1053,'unitId':this[_0x441eaa(0x1c8)]()})?this[_0x441eaa(0x1ee)](_0x2e1053):null;}[_0xe655f0(0x200)](){var _0x13de86=_0xe655f0,_0x22ea6f,_0x58cd6f;return(_0x22ea6f=(_0x58cd6f=this['save']()['body'])==null?void 0x0:_0x58cd6f[_0x13de86(0x1b4)])==null?[]:_0x22ea6f;}[_0xe655f0(0x1dd)](_0x1b0802){var _0x235cdc=_0xe655f0;return this['_injector'][_0x235cdc(0x1ff)](_0x2d24c9,this,_0x1b0802);}};_0x27b515[_0xe655f0(0x1da)][_0xe655f0(0x1ec)](_0x28f46a),Object[_0xe655f0(0x1cd)](_0x3baac2,'FDocumentCode',{'enumerable':!0x0,'get':function(){return _0x2d24c9;}});}));function _0x56a2(_0x396019,_0x473ca5){_0x396019=_0x396019-0x1ae;var _0x444699=_0x4446();var _0x56a2ca=_0x444699[_0x396019];return _0x56a2ca;}function _0x4446(){var _0x1ec85e=['8xoepiF','DocsCodeUnwrapCommand','body','decorate','slice','CODE','DocumentBlockRangeType','isParagraphFacade','string','Inject','createInstance','_getBlockRanges','5469093QqRuJq','default','DataStreamTreeTokenType','filter','function','prototype','exports','iterator','blockRanges','call','insertCode','getText','UniverProDocsCodeFacade','find','startIndex','getConfig','_document','constructor','4nsBPMm','SECTION_BREAK','713365IELRRv','232310cDahPg','DocsCodeInsertCommand','object','blockType','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','3auzjsB','BLOCK_END','getId','_getBlockRange','@univerjs/core','toStringTag','endIndex','defineProperty','@univerjs-pro/docs-code','getRange','UniverDocsFacade','_getDocumentData','UniverProDocsCode','text','5398290EwLTwO','DocsCodeUpdateCommand','UniverCore','PARAGRAPH','blockId','remove','FDocument','from','1415250AQhoRl','_createFDocumentCode','_injector','get','toPrimitive','symbol','getCodes','_unitId','@univerjs/docs/facade','save','_blockId','3218TJKeLJ','replace','some','BLOCK_START','syncExecuteCommand','extend','describe','getCode','ICommandService','length','getCodeConfig','4598694EPYGis','findCodes','dataStream'];_0x4446=function(){return _0x1ec85e;};return _0x4446();}