Your IP : 52.14.121.12


Current Path : /var/www/www-root/data/www/monolith-realty.ru/bitrix/js/ui/bbcode/model/dist/
Upload File :
Current File : /var/www/www-root/data/www/monolith-realty.ru/bitrix/js/ui/bbcode/model/dist/model.bundle.js.map

{"version":3,"file":"model.bundle.js","sources":["../../shared/src/get-by-index.js","../src/nodes/node.js","../src/nodes/element-node.js","../src/nodes/root-node.js","../src/nodes/fragment-node.js","../src/nodes/text-node.js","../src/nodes/new-line-node.js","../src/nodes/tab-node.js","../src/scheme/node-schemes/node-scheme.js","../src/scheme/node-schemes/tag-scheme.js","../src/scheme/bbcode-scheme.js","../src/scheme/node-schemes/text-scheme.js","../src/scheme/node-schemes/new-line-scheme.js","../src/scheme/node-schemes/tab-scheme.js","../src/scheme/default-bbcode-scheme.js"],"sourcesContent":["import { Type } from 'main.core';\n\nexport function getByIndex<T>(array: Array<T>, index: number): ?T\n{\n\tif (!Type.isArray(array))\n\t{\n\t\tthrow new TypeError('array is not a array');\n\t}\n\n\tif (!Type.isInteger(index))\n\t{\n\t\tthrow new TypeError('index is not a integer');\n\t}\n\n\tconst preparedIndex = index < 0 ? array.length + index : index;\n\n\treturn array[preparedIndex];\n};\n","import { Type } from 'main.core';\nimport type { BBCodeEncoder } from 'ui.bbcode.encoder';\nimport { getByIndex } from '../../../shared';\nimport { typeof BBCodeElementNode } from './element-node';\nimport { typeof BBCodeTextNode } from './text-node';\nimport { typeof BBCodeNewLineNode } from './new-line-node';\nimport { typeof BBCodeTabNode } from './tab-node';\nimport { typeof BBCodeRootNode } from './root-node';\nimport { typeof BBCodeFragmentNode } from './fragment-node';\nimport { typeof BBCodeScheme } from '../scheme/bbcode-scheme';\nimport { type BBCodeNodeScheme } from '../scheme/node-schemes/node-scheme';\n\nexport type BBCodeSpecialCharNode = BBCodeNewLineNode | BBCodeTabNode;\nexport type BBCodeContentNode = BBCodeElementNode | BBCodeTextNode | BBCodeSpecialCharNode;\nexport type BBCodeParentNode = BBCodeRootNode | BBCodeElementNode | BBCodeFragmentNode;\n\nexport type BBCodeNodeOptions = {\n\tname?: string,\n\tparent?: BBCodeParentNode | null,\n\tchildren?: Array<BBCodeContentNode | BBCodeFragmentNode>,\n\tscheme: BBCodeScheme,\n};\n\nexport type SerializedBBCodeNode = {\n\tname: string,\n\tchildren: Array<SerializedBBCodeNode>,\n};\n\ntype PrivateMapKey = BBCodeNode | BBCodeContentNode | BBCodeRootNode | BBCodeFragmentNode;\ntype PrivateStorage = {[key: string]: any};\n\nexport const privateMap: WeakMap<PrivateMapKey, PrivateStorage> = new WeakMap();\nexport const nameSymbol: Symbol = Symbol('name');\n\nexport class BBCodeNode\n{\n\t[nameSymbol]: string = '#unknown';\n\tchildren: Array<BBCodeContentNode | BBCodeFragmentNode> = [];\n\n\tconstructor(options: BBCodeNodeOptions = {})\n\t{\n\t\tprivateMap.set(this, {\n\t\t\tdelayedChildren: [],\n\t\t});\n\n\t\tthis.setName(options.name);\n\t\tprivateMap.get(this).scheme = options.scheme;\n\t\tthis.setParent(options.parent);\n\t\tthis.setChildren(options.children);\n\t}\n\n\tstatic get ELEMENT_NODE(): number\n\t{\n\t\treturn 1;\n\t}\n\n\tstatic get TEXT_NODE(): number\n\t{\n\t\treturn 2;\n\t}\n\n\tstatic get ROOT_NODE(): number\n\t{\n\t\treturn 3;\n\t}\n\n\tstatic get FRAGMENT_NODE(): number\n\t{\n\t\treturn 4;\n\t}\n\n\tstatic freezeProperty(node: BBCodeNode, property: string, value: any, enumerable: boolean = true)\n\t{\n\t\tObject.defineProperty(node, property, {\n\t\t\tvalue,\n\t\t\twritable: false,\n\t\t\tconfigurable: false,\n\t\t\tenumerable,\n\t\t});\n\t}\n\n\tstatic makeNonEnumerableProperty(node: BBCodeNode, property: string)\n\t{\n\t\tObject.defineProperty(node, property, {\n\t\t\twritable: false,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: false,\n\t\t});\n\t}\n\n\tstatic flattenChildren(children: Array<BBCodeContentNode | BBCodeFragmentNode>): Array<BBCodeContentNode>\n\t{\n\t\tif (Type.isArrayFilled(children))\n\t\t{\n\t\t\treturn children.flatMap((node: BBCodeContentNode | BBCodeFragmentNode) => {\n\t\t\t\tif (node.getType() === BBCodeNode.FRAGMENT_NODE)\n\t\t\t\t{\n\t\t\t\t\treturn node.getChildren();\n\t\t\t\t}\n\n\t\t\t\treturn node;\n\t\t\t});\n\t\t}\n\n\t\treturn [];\n\t}\n\n\tsetScheme(scheme: BBCodeScheme, onUnknown: (node: BBCodeContentNode) => any)\n\t{\n\t\tprivateMap.get(this).scheme = scheme;\n\t}\n\n\tgetScheme(): BBCodeScheme\n\t{\n\t\treturn privateMap.get(this).scheme;\n\t}\n\n\tgetTagScheme(): BBCodeNodeScheme\n\t{\n\t\treturn this.getScheme().getTagScheme(this.getName());\n\t}\n\n\tgetEncoder(): BBCodeEncoder\n\t{\n\t\treturn this.getScheme().getEncoder();\n\t}\n\n\tprepareCase(value: string): string\n\t{\n\t\tconst scheme: BBCodeScheme = this.getScheme();\n\t\tconst currentCase = scheme.getOutputTagCase();\n\t\tif (currentCase === 'upper')\n\t\t{\n\t\t\treturn value.toUpperCase();\n\t\t}\n\n\t\treturn value.toLowerCase();\n\t}\n\n\tsetName(name: string)\n\t{\n\t\tif (Type.isString(name))\n\t\t{\n\t\t\tthis[nameSymbol] = name.toLowerCase();\n\t\t}\n\t}\n\n\tgetName(): string\n\t{\n\t\treturn this[nameSymbol];\n\t}\n\n\tgetDisplayedName(): string\n\t{\n\t\treturn this.prepareCase(this.getName());\n\t}\n\n\tsetParent(parent: BBCodeParentNode | null = null)\n\t{\n\t\tconst mounted = !this.hasParent() && parent;\n\t\tprivateMap.get(this).parent = parent;\n\n\t\tif (mounted)\n\t\t{\n\t\t\tthis.onNodeDidMount();\n\t\t}\n\t}\n\n\tgetParent(): BBCodeParentNode | null\n\t{\n\t\treturn privateMap.get(this).parent;\n\t}\n\n\tgetType(): number\n\t{\n\t\treturn privateMap.get(this).type;\n\t}\n\n\thasParent(): boolean\n\t{\n\t\treturn Boolean(privateMap.get(this).parent);\n\t}\n\n\tremove()\n\t{\n\t\tif (this.hasParent())\n\t\t{\n\t\t\tthis.getParent().removeChild(this);\n\t\t}\n\t}\n\n\tsetChildren(children: Array<BBCodeContentNode | BBCodeFragmentNode>)\n\t{\n\t\tif (Type.isArray(children))\n\t\t{\n\t\t\tthis.children = [];\n\t\t\tthis.appendChild(...children);\n\t\t}\n\t}\n\n\tgetChildren(): Array<BBCodeContentNode>\n\t{\n\t\treturn [...this.children];\n\t}\n\n\tgetLastChild(): ?BBCodeContentNode\n\t{\n\t\treturn getByIndex(this.getChildren(), -1);\n\t}\n\n\tgetLastChildOfType(type: number): ?BBCodeContentNode\n\t{\n\t\treturn this.getChildren().reverse().find((node: BBCodeContentNode) => {\n\t\t\treturn node.getType() === type;\n\t\t});\n\t}\n\n\tgetLastChildOfName(name: string): ?BBCodeContentNode\n\t{\n\t\treturn this.getChildren().reverse().find((node: BBCodeContentNode) => {\n\t\t\treturn node.getType() === BBCodeNode.ELEMENT_NODE && node.getName() === name;\n\t\t});\n\t}\n\n\tgetFirstChild(): ?BBCodeContentNode\n\t{\n\t\treturn getByIndex(this.getChildren(), 0);\n\t}\n\n\tgetFirstChildOfType(type: number): ?BBCodeContentNode\n\t{\n\t\treturn this.getChildren().find((node: BBCodeContentNode) => {\n\t\t\treturn node.getType() === type;\n\t\t});\n\t}\n\n\tgetFirstChildOfName(name: string): ?BBCodeContentNode\n\t{\n\t\treturn this.getChildren().find((node: BBCodeContentNode) => {\n\t\t\treturn node.getType() === BBCodeNode.ELEMENT_NODE && node.getName() === name;\n\t\t});\n\t}\n\n\tgetPreviewsSibling(): ?BBCodeContentNode\n\t{\n\t\tif (this.hasParent())\n\t\t{\n\t\t\tconst parentChildren: Array<BBCodeContentNode> = this.getParent().getChildren();\n\t\t\tconst currentIndex: number = parentChildren.indexOf(this);\n\t\t\tif (currentIndex > 0)\n\t\t\t{\n\t\t\t\treturn getByIndex(parentChildren, currentIndex - 1);\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tgetPreviewsSiblings(): ?Array<BBCodeContentNode>\n\t{\n\t\tif (this.hasParent())\n\t\t{\n\t\t\tconst parentChildren: Array<BBCodeContentNode> = this.getParent().getChildren();\n\t\t\tconst currentIndex: number = parentChildren.indexOf(this);\n\n\t\t\treturn parentChildren.filter((child: BBCodeContentNode, index) => {\n\t\t\t\treturn index < currentIndex;\n\t\t\t});\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tgetNextSibling(): ?BBCodeContentNode\n\t{\n\t\tif (this.hasParent())\n\t\t{\n\t\t\tconst parentChildren: Array<BBCodeContentNode> = this.getParent().getChildren();\n\t\t\tconst currentIndex: number = parentChildren.indexOf(this);\n\t\t\tif (currentIndex !== -1 && currentIndex !== parentChildren.length)\n\t\t\t{\n\t\t\t\treturn getByIndex(parentChildren, currentIndex + 1);\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tgetNextSiblings(): ?Array<BBCodeContentNode>\n\t{\n\t\tif (this.hasParent())\n\t\t{\n\t\t\tconst parentChildren: Array<BBCodeContentNode> = this.getParent().getChildren();\n\t\t\tconst currentIndex: number = parentChildren.indexOf(this);\n\n\t\t\treturn parentChildren.filter((child: BBCodeContentNode, index) => {\n\t\t\t\treturn index > currentIndex;\n\t\t\t});\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tgetChildrenCount(): number\n\t{\n\t\treturn this.children.length;\n\t}\n\n\thasChildren(): boolean\n\t{\n\t\treturn this.getChildrenCount() > 0;\n\t}\n\n\tisEmpty(): boolean\n\t{\n\t\treturn this.getChildrenCount() === 0;\n\t}\n\n\tadjustChildren()\n\t{\n\t\tthis.setChildren(this.getChildren());\n\t}\n\n\tsetDelayedChildren(children: Array<BBCodeContentNode>)\n\t{\n\t\tif (Type.isArray(children))\n\t\t{\n\t\t\tprivateMap.get(this).delayedChildren = children;\n\t\t}\n\t}\n\n\taddDelayedChildren(children: Array<BBCodeContentNode>)\n\t{\n\t\tif (Type.isArrayFilled(children))\n\t\t{\n\t\t\tthis.setDelayedChildren([\n\t\t\t\t...this.getDelayedChildren(),\n\t\t\t\t...children,\n\t\t\t]);\n\t\t}\n\t}\n\n\thasDelayedChildren(): boolean\n\t{\n\t\treturn privateMap.get(this).delayedChildren.length > 0;\n\t}\n\n\tgetDelayedChildren(): Array<BBCodeContentNode>\n\t{\n\t\treturn [...privateMap.get(this).delayedChildren];\n\t}\n\n\tappendChild(...children: Array<BBCodeContentNode | BBCodeFragmentNode>)\n\t{\n\t\tconst flattenedChildren: Array<BBCodeContentNode> = BBCodeNode.flattenChildren(children);\n\n\t\tflattenedChildren.forEach((node: BBCodeContentNode) => {\n\t\t\tnode.remove();\n\t\t\tnode.setParent(this);\n\t\t\tthis.children.push(node);\n\t\t});\n\t}\n\n\tprependChild(...children: Array<BBCodeContentNode | BBCodeFragmentNode>)\n\t{\n\t\tconst flattenedChildren: Array<BBCodeContentNode> = BBCodeNode.flattenChildren(children);\n\n\t\tflattenedChildren.forEach((node: BBCodeContentNode) => {\n\t\t\tnode.remove();\n\t\t\tnode.setParent(this);\n\t\t\tthis.children.unshift(node);\n\t\t});\n\t}\n\n\tinsertBefore(...nodes: Array<BBCodeContentNode>)\n\t{\n\t\tif (this.hasParent() && Type.isArrayFilled(nodes))\n\t\t{\n\t\t\tconst parent: BBCodeContentNode = this.getParent();\n\t\t\tconst parentChildren: Array<BBCodeContentNode> = parent.getChildren();\n\t\t\tconst currentNodeIndex: number = parentChildren.indexOf(this);\n\n\t\t\tconst deleteCount: number = 0;\n\t\t\tparentChildren.splice(currentNodeIndex, deleteCount, ...nodes);\n\n\t\t\tparent.setChildren(parentChildren);\n\t\t}\n\t}\n\n\tinsertAfter(...nodes: Array<BBCodeContentNode>)\n\t{\n\t\tif (this.hasParent() && Type.isArrayFilled(nodes))\n\t\t{\n\t\t\tconst parent: BBCodeContentNode = this.getParent();\n\t\t\tconst parentChildren: Array<BBCodeContentNode> = parent.getChildren();\n\t\t\tconst currentNodeIndex: number = parentChildren.indexOf(this);\n\n\t\t\tconst startIndex: number = currentNodeIndex + 1;\n\t\t\tconst deleteCount: number = 0;\n\t\t\tparentChildren.splice(startIndex, deleteCount, ...nodes);\n\n\t\t\tparent.setChildren(parentChildren);\n\t\t}\n\t}\n\n\tpropagateChild(...children: Array<BBCodeContentNode>)\n\t{\n\t\tif (this.hasParent())\n\t\t{\n\t\t\tthis.insertBefore(\n\t\t\t\t...children.filter((child: BBCodeContentNode) => {\n\t\t\t\t\treturn !['#linebreak', '#tab'].includes(child.getName());\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.addDelayedChildren(children);\n\t\t}\n\t}\n\n\tonNodeDidMount()\n\t{\n\t\tconst delayedChildren = this.getDelayedChildren();\n\t\tif (Type.isArrayFilled(delayedChildren))\n\t\t{\n\t\t\tthis.propagateChild(...delayedChildren);\n\t\t\tthis.setDelayedChildren([]);\n\t\t}\n\t}\n\n\tremoveChild(...children: Array<BBCodeContentNode>)\n\t{\n\t\tthis.children = this.children.reduce((acc: Array<BBCodeContentNode>, node: BBCodeContentNode) => {\n\t\t\tif (children.includes(node))\n\t\t\t{\n\t\t\t\tnode.setParent(null);\n\n\t\t\t\treturn acc;\n\t\t\t}\n\n\t\t\treturn [...acc, node];\n\t\t}, []);\n\t}\n\n\treplaceChild(targetNode: BBCodeContentNode, ...children: Array<BBCodeContentNode | BBCodeFragmentNode>)\n\t{\n\t\tthis.children = this.children.flatMap((node: BBCodeContentNode) => {\n\t\t\tif (node === targetNode)\n\t\t\t{\n\t\t\t\tnode.setParent(null);\n\n\t\t\t\tconst flattenedChildren: Array<BBCodeContentNode> = BBCodeNode.flattenChildren(children);\n\n\t\t\t\treturn flattenedChildren.map((child: BBCodeContentNode) => {\n\t\t\t\t\tchild.remove();\n\t\t\t\t\tchild.setParent(this);\n\n\t\t\t\t\treturn child;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn node;\n\t\t});\n\t}\n\n\treplace(...children: Array<BBCodeContentNode | BBCodeFragmentNode>)\n\t{\n\t\tif (this.hasParent())\n\t\t{\n\t\t\tconst parent = this.getParent();\n\t\t\tparent.replaceChild(this, ...children);\n\t\t}\n\t}\n\n\tclone(options: { deep: boolean } = {}): BBCodeNode\n\t{\n\t\tconst children = (() => {\n\t\t\tif (options.deep)\n\t\t\t{\n\t\t\t\treturn this.getChildren().map((child) => {\n\t\t\t\t\treturn child.clone(options);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn [];\n\t\t})();\n\n\t\treturn this.getScheme().createNode({\n\t\t\tname: this.getName(),\n\t\t\tparent: this.getParent(),\n\t\t\tchildren,\n\t\t});\n\t}\n\n\ttoPlainText(): string\n\t{\n\t\treturn this.getChildren().map((child) => {\n\t\t\treturn child.toPlainText();\n\t\t}).join('');\n\t}\n\n\tgetTextContent(): string\n\t{\n\t\treturn this.toPlainText();\n\t}\n\n\tgetPlainTextLength(): number\n\t{\n\t\treturn this.toPlainText().length;\n\t}\n\n\tremovePreviewsSiblings()\n\t{\n\t\tconst removePreviewsSiblings = (node: BBCodeContentNode) => {\n\t\t\tconst previewsSiblings = node.getPreviewsSiblings();\n\t\t\tif (Type.isArray(previewsSiblings))\n\t\t\t{\n\t\t\t\tpreviewsSiblings.forEach((sibling: BBCodeContentNode) => {\n\t\t\t\t\tsibling.remove();\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst parent = node.getParent();\n\t\t\tif (parent)\n\t\t\t{\n\t\t\t\tremovePreviewsSiblings(parent);\n\t\t\t}\n\t\t};\n\n\t\tremovePreviewsSiblings(this);\n\t}\n\n\tremoveNextSiblings()\n\t{\n\t\tconst removeNextSiblings = (node: BBCodeContentNode) => {\n\t\t\tconst nextSiblings = node.getNextSiblings();\n\t\t\tif (Type.isArray(nextSiblings))\n\t\t\t{\n\t\t\t\tnextSiblings.forEach((sibling: BBCodeContentNode) => {\n\t\t\t\t\tsibling.remove();\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst parent = node.getParent();\n\t\t\tif (parent)\n\t\t\t{\n\t\t\t\tremoveNextSiblings(parent);\n\t\t\t}\n\t\t};\n\n\t\tremoveNextSiblings(this);\n\t}\n\n\tfindByTextIndex(index: number): ?{ node: BBCodeTextNode, startIndex: number, endIndex: number }\n\t{\n\t\tlet currentIndex = 0;\n\t\tlet startIndex = 0;\n\t\tlet endIndex = 0;\n\n\t\tconst node = BBCodeNode.flattenAst(this).find((child: BBCodeContentNode) => {\n\t\t\tif (\n\t\t\t\tchild.getName() === '#text'\n\t\t\t\t|| child.getName() === '#linebreak'\n\t\t\t\t|| child.getName() === '#tab'\n\t\t\t)\n\t\t\t{\n\t\t\t\tstartIndex = currentIndex;\n\t\t\t\tendIndex = startIndex + child.getLength();\n\t\t\t\tcurrentIndex = endIndex;\n\n\t\t\t\treturn index >= startIndex && endIndex >= index;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t});\n\n\t\tif (node)\n\t\t{\n\t\t\treturn { node, startIndex, endIndex };\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tsplit(options: { offset: number, byWord?: boolean}): Array<BBCodeContentNode>\n\t{\n\t\tconst { offset, byWord = false } = options;\n\t\tconst plainTextLength = this.getPlainTextLength();\n\n\t\tconst leftTree = (() => {\n\t\t\tif (plainTextLength === offset)\n\t\t\t{\n\t\t\t\treturn this.clone({ deep: true });\n\t\t\t}\n\n\t\t\tif (offset <= 0 || offset > plainTextLength)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst tree = this.clone({ deep: true });\n\t\t\tconst { node, startIndex } = tree.findByTextIndex(offset);\n\t\t\tconst [leftNode, rightNode] = node.split({ offset: offset - startIndex, byWord });\n\t\t\tif (leftNode)\n\t\t\t{\n\t\t\t\tnode.replace(leftNode);\n\t\t\t\tleftNode.removeNextSiblings();\n\t\t\t}\n\t\t\telse if (rightNode)\n\t\t\t{\n\t\t\t\trightNode.removeNextSiblings();\n\t\t\t\trightNode.remove();\n\t\t\t}\n\n\t\t\treturn tree;\n\t\t})();\n\n\t\tconst rightTree = (() => {\n\t\t\tif (plainTextLength === offset)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (offset === 0)\n\t\t\t{\n\t\t\t\treturn this.clone({ deep: true });\n\t\t\t}\n\n\t\t\tconst tree = this.clone({ deep: true });\n\t\t\tconst { node, startIndex } = tree.findByTextIndex(offset);\n\t\t\tconst [leftNode, rightNode] = node.split({ offset: offset - startIndex, byWord });\n\t\t\tif (rightNode)\n\t\t\t{\n\t\t\t\tnode.replace(rightNode);\n\t\t\t\trightNode.removePreviewsSiblings();\n\t\t\t}\n\t\t\telse if (leftNode)\n\t\t\t{\n\t\t\t\tleftNode.removePreviewsSiblings();\n\t\t\t\tif (leftNode.hasParent())\n\t\t\t\t{\n\t\t\t\t\tconst parent = leftNode.getParent();\n\t\t\t\t\tleftNode.remove();\n\t\t\t\t\tif (parent.getChildrenCount() === 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tparent.remove();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn tree;\n\t\t})();\n\n\t\treturn [leftTree, rightTree];\n\t}\n\n\tstatic flattenAst(ast): Array<any>\n\t{\n\t\tconst flat = [];\n\n\t\tconst traverse = (node: BBCodeContentNode) => {\n\t\t\tflat.push(node);\n\t\t\tif (node.hasChildren())\n\t\t\t{\n\t\t\t\tnode.getChildren().forEach((child: BBCodeContentNode) => {\n\t\t\t\t\ttraverse(child);\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\tif (ast.hasChildren())\n\t\t{\n\t\t\tast.getChildren().forEach((child: BBCodeContentNode) => {\n\t\t\t\ttraverse(child);\n\t\t\t});\n\t\t}\n\n\t\treturn flat;\n\t}\n\n\ttoJSON(): SerializedBBCodeNode\n\t{\n\t\treturn {\n\t\t\tname: this.getName(),\n\t\t\tchildren: this.getChildren().map((child: BBCodeContentNode) => {\n\t\t\t\treturn child.toJSON();\n\t\t\t}),\n\t\t};\n\t}\n}\n","import { Type, type JsonObject, type JsonValue } from 'main.core';\nimport { BBCodeNode, type BBCodeNodeOptions, type BBCodeContentNode, type SerializedBBCodeNode, privateMap } from './node';\nimport { typeof BBCodeFragmentNode } from './fragment-node';\nimport { type BBCodeNodeStringifier } from '../scheme/node-schemes/node-scheme';\nimport { typeof BBCodeTagScheme } from '../scheme/node-schemes/tag-scheme';\nimport { typeof BBCodeScheme } from '../scheme/bbcode-scheme';\n\nexport type BBCodeElementNodeValue = string | number | boolean;\n\nexport type BBCodeElementNodeOptions = BBCodeNodeOptions & {\n\tattributes?: JsonObject,\n\tvalue?: BBCodeElementNodeValue,\n};\n\nexport type SerializedBBCodeElementNode = SerializedBBCodeNode & {\n\tattributes: JsonObject,\n\tvalue: BBCodeElementNodeValue,\n};\n\nexport type FilteredChildren = {\n\tresolved: Array<BBCodeContentNode>,\n\tunresolved: Array<BBCodeContentNode>,\n};\n\nconst voidSymbol: Symbol = Symbol('void');\n\nexport class BBCodeElementNode extends BBCodeNode\n{\n\tattributes: JsonObject = {};\n\tvalue: JsonValue = '';\n\t[voidSymbol]: boolean = false;\n\n\tconstructor(options: BBCodeElementNodeOptions = {})\n\t{\n\t\tsuper(options);\n\t\tprivateMap.get(this).type = BBCodeNode.ELEMENT_NODE;\n\n\t\tconst tagScheme: BBCodeTagScheme = this.getTagScheme();\n\n\t\tthis[voidSymbol] = tagScheme.isVoid();\n\n\t\tthis.setValue(options.value);\n\t\tthis.setAttributes(options.attributes);\n\t}\n\n\tsetScheme(scheme: BBCodeScheme, onUnknown: (node: BBCodeContentNode) => any)\n\t{\n\t\tthis.getChildren().forEach((node: BBCodeContentNode) => {\n\t\t\tnode.setScheme(scheme, onUnknown);\n\t\t});\n\n\t\tif (scheme.isAllowedTag(this.getName()))\n\t\t{\n\t\t\tsuper.setScheme(scheme);\n\n\t\t\tconst tagScheme: BBCodeTagScheme = this.getTagScheme();\n\t\t\tthis[voidSymbol] = tagScheme.isVoid();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tsuper.setScheme(scheme);\n\t\t\tonUnknown(this, scheme);\n\t\t}\n\t}\n\n\tfilterChildren(children: Array<BBCodeContentNode>): FilteredChildren\n\t{\n\t\tconst filteredChildren: FilteredChildren = {\n\t\t\tresolved: [],\n\t\t\tunresolved: [],\n\t\t};\n\t\tconst scheme: BBCodeScheme = this.getScheme();\n\n\t\tchildren.forEach((child: BBCodeContentNode) => {\n\t\t\tif (scheme.isChildAllowed(this, child))\n\t\t\t{\n\t\t\t\tfilteredChildren.resolved.push(child);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfilteredChildren.unresolved.push(child);\n\t\t\t}\n\t\t});\n\n\t\treturn filteredChildren;\n\t}\n\n\tconvertChildren(children: Array<BBCodeContentNode>): Array<BBCodeContentNode>\n\t{\n\t\tconst tagScheme: BBCodeTagScheme = this.getTagScheme();\n\t\tconst childConverter = tagScheme.getChildConverter();\n\t\tif (childConverter)\n\t\t{\n\t\t\tconst scheme: BBCodeScheme = this.getScheme();\n\n\t\t\treturn children.map((child: BBCodeNode) => {\n\t\t\t\treturn childConverter(child, scheme);\n\t\t\t});\n\t\t}\n\n\t\treturn children;\n\t}\n\n\tsetValue(value: BBCodeElementNodeValue)\n\t{\n\t\tif (Type.isString(value) || Type.isNumber(value) || Type.isBoolean(value))\n\t\t{\n\t\t\tthis.value = value;\n\t\t}\n\t}\n\n\tgetValue(): BBCodeElementNodeValue\n\t{\n\t\treturn this.value;\n\t}\n\n\tisVoid(): boolean\n\t{\n\t\treturn this[voidSymbol];\n\t}\n\n\tcanBeEmpty(): boolean\n\t{\n\t\treturn this.getTagScheme().canBeEmpty();\n\t}\n\n\thasGroup(groupName: string): boolean\n\t{\n\t\treturn this.getTagScheme().hasGroup(groupName);\n\t}\n\n\tsetAttributes(attributes: JsonObject)\n\t{\n\t\tif (Type.isPlainObject(attributes))\n\t\t{\n\t\t\tconst entries = Object.entries(attributes).map(([key, value]) => {\n\t\t\t\treturn [key.toLowerCase(), value];\n\t\t\t});\n\n\t\t\tthis.attributes = Object.fromEntries(entries);\n\t\t}\n\t}\n\n\tsetAttribute(name: string, value: any)\n\t{\n\t\tif (Type.isStringFilled(name))\n\t\t{\n\t\t\tconst preparedName: string = name.toLowerCase();\n\t\t\tif (Type.isNil(value))\n\t\t\t{\n\t\t\t\tdelete this.attributes[preparedName];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.attributes[preparedName] = value;\n\t\t\t}\n\t\t}\n\t}\n\n\tgetAttribute(name: string): string | number | null\n\t{\n\t\tif (Type.isString(name))\n\t\t{\n\t\t\treturn this.attributes[name.toLowerCase()];\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tgetAttributes(): JsonObject\n\t{\n\t\treturn { ...this.attributes };\n\t}\n\n\tappendChild(...children: Array<BBCodeContentNode | BBCodeFragmentNode>)\n\t{\n\t\tconst flattenedChildren: Array<BBCodeContentNode> = BBCodeNode.flattenChildren(children);\n\t\tconst filteredChildren: FilteredChildren = this.filterChildren(flattenedChildren);\n\t\tconst convertedChildren: Array<BBCodeContentNode> = this.convertChildren(filteredChildren.resolved);\n\n\t\tconvertedChildren.forEach((node: BBCodeContentNode) => {\n\t\t\tnode.remove();\n\t\t\tnode.setParent(this);\n\t\t\tthis.children.push(node);\n\t\t});\n\n\t\tif (Type.isArrayFilled(filteredChildren.unresolved))\n\t\t{\n\t\t\tif (this.getScheme().isAllowedUnresolvedNodesHoisting())\n\t\t\t{\n\t\t\t\tthis.propagateChild(...filteredChildren.unresolved);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfilteredChildren.unresolved.forEach((node: BBCodeContentNode) => {\n\t\t\t\t\tnode.remove();\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tprependChild(...children: Array<BBCodeContentNode | BBCodeFragmentNode>)\n\t{\n\t\tconst flattenedChildren: Array<BBCodeContentNode> = BBCodeNode.flattenChildren(children);\n\t\tconst filteredChildren: FilteredChildren = this.filterChildren(flattenedChildren);\n\t\tconst convertedChildren: Array<BBCodeContentNode> = this.convertChildren(filteredChildren.resolved);\n\n\t\tconvertedChildren.forEach((node: BBCodeContentNode) => {\n\t\t\tnode.remove();\n\t\t\tnode.setParent(this);\n\t\t\tthis.children.unshift(node);\n\t\t});\n\n\t\tif (Type.isArrayFilled(filteredChildren.unresolved))\n\t\t{\n\t\t\tif (this.getScheme().isAllowedUnresolvedNodesHoisting())\n\t\t\t{\n\t\t\t\tthis.propagateChild(...filteredChildren.unresolved);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfilteredChildren.unresolved.forEach((node: BBCodeContentNode) => {\n\t\t\t\t\tnode.remove();\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\treplaceChild(targetNode: BBCodeContentNode, ...children: Array<BBCodeContentNode | BBCodeFragmentNode>)\n\t{\n\t\tthis.children = this.children.flatMap((node: BBCodeContentNode) => {\n\t\t\tif (node === targetNode)\n\t\t\t{\n\t\t\t\tnode.setParent(null);\n\n\t\t\t\tconst flattenedChildren: Array<BBCodeContentNode> = BBCodeNode.flattenChildren(children);\n\t\t\t\tconst filteredChildren: FilteredChildren = this.filterChildren(flattenedChildren);\n\t\t\t\tconst convertedChildren: Array<BBCodeContentNode> = this.convertChildren(filteredChildren.resolved);\n\n\t\t\t\treturn convertedChildren.map((child: BBCodeContentNode) => {\n\t\t\t\t\tchild.remove();\n\t\t\t\t\tchild.setParent(this);\n\n\t\t\t\t\treturn child;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn node;\n\t\t});\n\t}\n\n\ttoStringValue(): string\n\t{\n\t\tconst value: BBCodeElementNodeValue = this.getValue();\n\t\tconst encodedValue: string = this.getEncoder().encodeAttribute(value);\n\n\t\treturn value ? `=${encodedValue}` : '';\n\t}\n\n\ttoStringAttributes(): string\n\t{\n\t\treturn Object\n\t\t\t.entries(this.getAttributes())\n\t\t\t.map(([key: string, attrValue: string]) => {\n\t\t\t\tconst preparedKey: string = this.prepareCase(key);\n\t\t\t\tconst encodedValue: string = this.getEncoder().encodeAttribute(attrValue);\n\n\t\t\t\treturn attrValue ? `${preparedKey}=${encodedValue}` : preparedKey;\n\t\t\t})\n\t\t\t.join(' ');\n\t}\n\n\tgetContent(): string\n\t{\n\t\treturn this.getChildren()\n\t\t\t.map((child: BBCodeContentNode) => {\n\t\t\t\treturn child.toString();\n\t\t\t})\n\t\t\t.join('');\n\t}\n\n\tgetOpeningTag(): string\n\t{\n\t\tconst displayedName: string = this.getDisplayedName();\n\t\tconst tagValue: BBCodeElementNodeValue = this.toStringValue();\n\t\tconst attributes: JsonObject = this.toStringAttributes();\n\t\tconst formattedAttributes: string = Type.isStringFilled(attributes) ? ` ${attributes}` : '';\n\n\t\treturn `[${displayedName}${tagValue}${formattedAttributes}]`;\n\t}\n\n\tgetClosingTag(): string\n\t{\n\t\treturn `[/${this.getDisplayedName()}]`;\n\t}\n\n\tclone(options: { deep: boolean } = {}): BBCodeElementNode\n\t{\n\t\tconst children = (() => {\n\t\t\tif (options.deep)\n\t\t\t{\n\t\t\t\treturn this.getChildren().map((child) => {\n\t\t\t\t\treturn child.clone(options);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn [];\n\t\t})();\n\n\t\treturn this.getScheme().createElement({\n\t\t\tname: this.getName(),\n\t\t\tvoid: this.isVoid(),\n\t\t\tvalue: this.getValue(),\n\t\t\tattributes: { ...this.getAttributes() },\n\t\t\tchildren,\n\t\t});\n\t}\n\n\tsplitByChildIndex(index: number): Array<BBCodeElementNode | null>\n\t{\n\t\tif (!Type.isNumber(index))\n\t\t{\n\t\t\tthrow new TypeError('index is not a number');\n\t\t}\n\n\t\tconst childrenCount = this.getChildrenCount();\n\t\tif (index < 0 || index > childrenCount)\n\t\t{\n\t\t\tthrow new TypeError(`index '${index}' is out of range ${0}-${childrenCount}`);\n\t\t}\n\n\t\tconst leftNode = (() => {\n\t\t\tif (index === childrenCount)\n\t\t\t{\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tif (index === 0)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst leftChildren = this.getChildren().filter((child, childIndex) => {\n\t\t\t\treturn childIndex < index;\n\t\t\t});\n\n\t\t\tconst node = this.clone();\n\t\t\tnode.setChildren(leftChildren);\n\n\t\t\treturn node;\n\t\t})();\n\n\t\tconst rightNode = (() => {\n\t\t\tif (index === 0)\n\t\t\t{\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tif (index === childrenCount)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst rightChildren = this.getChildren();\n\t\t\tconst node = this.clone();\n\t\t\tnode.setChildren(rightChildren);\n\n\t\t\treturn node;\n\t\t})();\n\n\t\tif (leftNode && rightNode)\n\t\t{\n\t\t\tthis.replace(leftNode, rightNode);\n\t\t}\n\n\t\treturn [leftNode, rightNode];\n\t}\n\n\tgetTagScheme(): BBCodeTagScheme\n\t{\n\t\treturn super.getTagScheme();\n\t}\n\n\ttoString(): string\n\t{\n\t\tconst tagScheme: BBCodeTagScheme = this.getTagScheme();\n\t\tconst stringifier: BBCodeNodeStringifier = tagScheme.getStringifier();\n\t\tif (Type.isFunction(stringifier))\n\t\t{\n\t\t\tconst scheme: BBCodeScheme = this.getScheme();\n\n\t\t\treturn stringifier(this, scheme);\n\t\t}\n\n\t\tconst openingTag: string = this.getOpeningTag();\n\t\tconst content: string = this.getContent();\n\n\t\tif (this.isVoid())\n\t\t{\n\t\t\treturn `${openingTag}${content}`;\n\t\t}\n\n\t\tconst closingTag: string = this.getClosingTag();\n\n\t\treturn `${openingTag}${content}${closingTag}`;\n\t}\n\n\ttoJSON(): SerializedBBCodeElementNode\n\t{\n\t\treturn {\n\t\t\t...super.toJSON(),\n\t\t\tvalue: this.getValue(),\n\t\t\tattributes: this.getAttributes(),\n\t\t\tvoid: this.isVoid(),\n\t\t};\n\t}\n}\n","import { BBCodeNode, privateMap, nameSymbol, type BBCodeContentNode } from './node';\nimport { BBCodeElementNode } from './element-node';\nimport { typeof BBCodeScheme } from '../scheme/bbcode-scheme';\n\nexport type RootNodeOptions = {\n\tchildren: Array<BBCodeNode>,\n};\n\nexport class BBCodeRootNode extends BBCodeElementNode\n{\n\tconstructor(options: RootNodeOptions)\n\t{\n\t\tsuper({ ...options, name: '#root' });\n\t\tprivateMap.get(this).type = BBCodeNode.ROOT_NODE;\n\t\tBBCodeRootNode.makeNonEnumerableProperty(this, 'value');\n\t\tBBCodeRootNode.makeNonEnumerableProperty(this, 'attributes');\n\t\tBBCodeRootNode.freezeProperty(this, nameSymbol, '#root');\n\t}\n\n\tsetScheme(scheme: BBCodeScheme, onUnknown: (node: BBCodeContentNode) => any)\n\t{\n\t\tBBCodeNode.flattenAst(this).forEach((node: BBCodeContentNode) => {\n\t\t\tnode.setScheme(scheme, onUnknown);\n\t\t});\n\n\t\tsuper.setScheme(scheme);\n\n\t\tBBCodeNode.flattenAst(this).forEach((node: BBCodeContentNode) => {\n\t\t\tnode.adjustChildren();\n\t\t});\n\t}\n\n\tgetParent(): null\n\t{\n\t\treturn null;\n\t}\n\n\tclone(options: { deep: boolean } = {}): BBCodeRootNode\n\t{\n\t\tconst children = (() => {\n\t\t\tif (options.deep)\n\t\t\t{\n\t\t\t\treturn this.getChildren().map((child) => {\n\t\t\t\t\treturn child.clone(options);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn [];\n\t\t})();\n\n\t\treturn this.getScheme().createRoot({\n\t\t\tchildren,\n\t\t});\n\t}\n\n\ttoString(): string\n\t{\n\t\treturn this.getChildren()\n\t\t\t.map((child: BBCodeContentNode) => {\n\t\t\t\treturn child.toString();\n\t\t\t})\n\t\t\t.join('');\n\t}\n\n\ttoJSON(): any\n\t{\n\t\treturn this.getChildren().map((node: BBCodeNode) => {\n\t\t\treturn node.toJSON();\n\t\t});\n\t}\n}\n","import { BBCodeNode, nameSymbol, privateMap } from './node';\nimport { BBCodeElementNode } from './element-node';\n\nexport type FragmentNodeOptions = {\n\tchildren: Array<BBCodeNode>,\n};\n\nexport class BBCodeFragmentNode extends BBCodeElementNode\n{\n\tconstructor(options: FragmentNodeOptions)\n\t{\n\t\tsuper({ ...options, name: '#fragment' });\n\t\tprivateMap.get(this).type = BBCodeNode.FRAGMENT_NODE;\n\t\tBBCodeFragmentNode.makeNonEnumerableProperty(this, 'value');\n\t\tBBCodeFragmentNode.makeNonEnumerableProperty(this, 'attributes');\n\t\tBBCodeFragmentNode.freezeProperty(this, nameSymbol, '#fragment');\n\t}\n\n\tclone(options: { deep: boolean } = {}): BBCodeFragmentNode\n\t{\n\t\tconst children = (() => {\n\t\t\tif (options.deep)\n\t\t\t{\n\t\t\t\treturn this.getChildren().map((child) => {\n\t\t\t\t\treturn child.clone(options);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn [];\n\t\t})();\n\n\t\treturn this.getScheme().createFragment({\n\t\t\tchildren,\n\t\t});\n\t}\n}\n","import { Type } from 'main.core';\nimport { BBCodeNode, privateMap, nameSymbol, type BBCodeNodeOptions } from './node';\n\nexport const contentSymbol = Symbol('content');\n\nexport type BBCodeTextNodeContent = string | number;\n\nexport type BBCodeTextNodeOptions = BBCodeTextNodeContent | BBCodeNodeOptions & {\n\tcontent?: string,\n};\n\nexport type BBCodeSerializedTextNode = {\n\tname: string,\n\tcontent: BBCodeTextNodeContent,\n};\n\nexport class BBCodeTextNode extends BBCodeNode\n{\n\t[nameSymbol]: string = '#text';\n\t[contentSymbol]: string = '';\n\n\tconstructor(options: BBCodeTextNodeOptions = {})\n\t{\n\t\tconst nodeOptions: BBCodeTextNodeOptions = Type.isString(options) ? { content: options } : options;\n\t\tsuper(nodeOptions);\n\t\tprivateMap.get(this).type = BBCodeNode.TEXT_NODE;\n\t\tthis.setContent(nodeOptions.content);\n\t\tBBCodeNode.makeNonEnumerableProperty(this, 'children');\n\t}\n\n\tstatic isTextNodeContent(value: any): boolean\n\t{\n\t\treturn Type.isString(value) || Type.isNumber(value);\n\t}\n\n\tsetName(name: string)\n\t{}\n\n\tsetContent(content: BBCodeTextNodeContent)\n\t{\n\t\tif (BBCodeTextNode.isTextNodeContent(content))\n\t\t{\n\t\t\tthis[contentSymbol] = content;\n\t\t}\n\t}\n\n\tgetContent(): BBCodeTextNodeContent\n\t{\n\t\treturn this[contentSymbol];\n\t}\n\n\tadjustChildren()\n\t{}\n\n\tgetLength(): number\n\t{\n\t\treturn String(this[contentSymbol]).length;\n\t}\n\n\tisEmpty(): boolean\n\t{\n\t\treturn this.getLength() === 0;\n\t}\n\n\tclone(options): BBCodeTextNode\n\t{\n\t\treturn this.getScheme().createText({\n\t\t\tcontent: this.getContent(),\n\t\t});\n\t}\n\n\tsplit(options: { offset: number, byWord?: boolean}): Array<BBCodeTextNode | null>\n\t{\n\t\tconst { offset: sourceOffset, byWord = false } = options;\n\n\t\tif (!Type.isNumber(sourceOffset))\n\t\t{\n\t\t\tthrow new TypeError('offset is not a number');\n\t\t}\n\n\t\tconst contentLength = this.getLength();\n\t\tif (sourceOffset < 0 || sourceOffset > contentLength)\n\t\t{\n\t\t\tthrow new TypeError(`offset '${sourceOffset}' is out of range ${0}-${contentLength}`);\n\t\t}\n\n\t\tconst content = this.getContent();\n\n\t\tconst offset = (() => {\n\t\t\tif (byWord && sourceOffset !== contentLength)\n\t\t\t{\n\t\t\t\tconst lastIndex = content.lastIndexOf(' ', sourceOffset);\n\t\t\t\tif (lastIndex !== -1)\n\t\t\t\t{\n\t\t\t\t\tif (sourceOffset > lastIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn lastIndex + 1;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn lastIndex;\n\t\t\t\t}\n\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\treturn sourceOffset;\n\t\t})();\n\n\t\tconst leftNode = (() => {\n\t\t\tif (offset === contentLength)\n\t\t\t{\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tif (offset === 0)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst node = this.clone();\n\t\t\tnode.setContent(content.slice(0, offset));\n\n\t\t\treturn node;\n\t\t})();\n\n\t\tconst rightNode = (() => {\n\t\t\tif (offset === 0)\n\t\t\t{\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tif (offset === contentLength)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst node = this.clone();\n\t\t\tnode.setContent(content.slice(offset, contentLength));\n\n\t\t\treturn node;\n\t\t})();\n\n\t\treturn [leftNode, rightNode];\n\t}\n\n\ttoString(): string\n\t{\n\t\treturn this.getEncoder().encodeText(this.getContent());\n\t}\n\n\ttoPlainText(): string\n\t{\n\t\treturn this.toString();\n\t}\n\n\ttoJSON(): BBCodeSerializedTextNode\n\t{\n\t\treturn {\n\t\t\tname: this.getName(),\n\t\t\tcontent: this.toString(),\n\t\t};\n\t}\n}\n","import { nameSymbol } from './node';\nimport { BBCodeTextNode, contentSymbol, type BBCodeTextNodeContent, type BBCodeTextNodeOptions } from './text-node';\n\nexport class BBCodeNewLineNode extends BBCodeTextNode\n{\n\t[nameSymbol]: string = '#linebreak';\n\t[contentSymbol]: string = '\\n';\n\n\tconstructor(options: BBCodeTextNodeOptions = {})\n\t{\n\t\tsuper(options);\n\t}\n\n\tsetContent(options: BBCodeTextNodeContent)\n\t{}\n\n\tclone(options): BBCodeNewLineNode\n\t{\n\t\treturn this.getScheme().createNewLine();\n\t}\n}\n","import { nameSymbol } from './node';\nimport { BBCodeTextNode, contentSymbol, type BBCodeTextNodeContent, type BBCodeTextNodeOptions } from './text-node';\n\nexport class BBCodeTabNode extends BBCodeTextNode\n{\n\t[nameSymbol]: string = '#tab';\n\t[contentSymbol]: string = '\\t';\n\n\tconstructor(options: BBCodeTextNodeOptions = {})\n\t{\n\t\tsuper(options);\n\t}\n\n\tsetContent(options: BBCodeTextNodeContent)\n\t{}\n\n\tclone(options): BBCodeTabNode\n\t{\n\t\treturn this.getScheme().createTab();\n\t}\n}\n","import { Type } from 'main.core';\nimport type { BBCodeContentNode } from '../../nodes/node';\nimport { typeof BBCodeScheme } from '../bbcode-scheme';\n\nexport type BBCodeNodeConverter = (node: BBCodeContentNode, scheme: BBCodeScheme) => BBCodeContentNode | Array<BBCodeContentNode> | null;\nexport type BBCodeNodeStringifier = (node: BBCodeContentNode, scheme: BBCodeScheme) => string;\nexport type BBCodeNodeSerializer = (node: BBCodeContentNode, scheme: BBCodeScheme) => any;\nexport type BBCodeNodeName = string;\nexport type BBCodeGroupName = string;\n\nexport type BBCodeNodeSchemeOptions = {\n\tname: BBCodeNodeName | Array<BBCodeNodeName>,\n\tgroup: BBCodeGroupName | Array<BBCodeGroupName>,\n\tstringify?: BBCodeNodeStringifier,\n\tserialize?: BBCodeNodeSerializer,\n\tallowedIn?: Array<BBCodeNodeName>,\n};\n\nexport class BBCodeNodeScheme\n{\n\tname: Array<BBCodeNodeName> = [];\n\tgroup: Array<BBCodeGroupName> = [];\n\tstringifier: BBCodeNodeStringifier | null = null;\n\tserializer: BBCodeNodeSerializer | null = null;\n\tallowedIn: Array<BBCodeNodeName> = [];\n\n\tconstructor(options: BBCodeNodeSchemeOptions)\n\t{\n\t\tif (!Type.isPlainObject(options))\n\t\t{\n\t\t\tthrow new TypeError('options is not a object');\n\t\t}\n\n\t\tif (\n\t\t\t!Type.isArrayFilled(this.name)\n\t\t\t&& !Type.isArrayFilled(options.name)\n\t\t\t&& !Type.isStringFilled(options.name)\n\t\t)\n\t\t{\n\t\t\tthrow new TypeError('options.name is not specified');\n\t\t}\n\n\t\tthis.setGroup(options.group);\n\t\tthis.setName(options.name);\n\t\tthis.setAllowedIn(options.allowedIn);\n\t\tthis.setStringifier(options.stringify);\n\t\tthis.setSerializer(options.serialize);\n\t}\n\n\tsetName(name: BBCodeNodeSchemeOptions['name'])\n\t{\n\t\tif (Type.isStringFilled(name))\n\t\t{\n\t\t\tthis.name = [name];\n\t\t}\n\n\t\tif (Type.isArrayFilled(name))\n\t\t{\n\t\t\tthis.name = name;\n\t\t}\n\t}\n\n\tgetName(): Array<string>\n\t{\n\t\treturn [...this.name];\n\t}\n\n\tremoveName(...names: Array<BBCodeNodeName>)\n\t{\n\t\tthis.setName(\n\t\t\tthis.getName().filter((name: BBCodeNodeName) => {\n\t\t\t\treturn !names.includes(name);\n\t\t\t}),\n\t\t);\n\t}\n\n\tsetGroup(name: BBCodeNodeSchemeOptions['group'])\n\t{\n\t\tif (Type.isStringFilled(name))\n\t\t{\n\t\t\tthis.group = [name];\n\t\t}\n\n\t\tif (Type.isArrayFilled(name))\n\t\t{\n\t\t\tthis.group = name;\n\t\t}\n\t}\n\n\tremoveGroup(...groups: Array<BBCodeGroupName>)\n\t{\n\t\tthis.setGroup(\n\t\t\tthis.getGroup().filter((group: BBCodeGroupName) => {\n\t\t\t\treturn !groups.includes(group);\n\t\t\t}),\n\t\t);\n\t}\n\n\tgetGroup(): Array<BBCodeGroupName>\n\t{\n\t\treturn [...this.group];\n\t}\n\n\thasGroup(groupName: string): boolean\n\t{\n\t\treturn this.getGroup().includes(groupName);\n\t}\n\n\tsetStringifier(stringifier: BBCodeNodeStringifier | null)\n\t{\n\t\tif (Type.isFunction(stringifier) || Type.isNull(stringifier))\n\t\t{\n\t\t\tthis.stringifier = stringifier;\n\t\t}\n\t}\n\n\tgetStringifier(): BBCodeNodeStringifier | null\n\t{\n\t\treturn this.stringifier;\n\t}\n\n\tsetSerializer(serializer: BBCodeNodeSerializer | null)\n\t{\n\t\tif (Type.isFunction(serializer) || Type.isNull(serializer))\n\t\t{\n\t\t\tthis.serializer = serializer;\n\t\t}\n\t}\n\n\tgetSerializer(): BBCodeNodeSerializer | null\n\t{\n\t\treturn this.serializer;\n\t}\n\n\tsetAllowedIn(allowedParents: Array<BBCodeNodeName>)\n\t{\n\t\tif (Type.isArray(allowedParents))\n\t\t{\n\t\t\tthis.allowedIn = [...allowedParents];\n\t\t}\n\t}\n\n\tgetAllowedIn(): Array<BBCodeNodeName>\n\t{\n\t\treturn [...this.allowedIn];\n\t}\n\n\tisAllowedIn(tagName: string): boolean\n\t{\n\t\tconst allowedIn: Array<BBCodeNodeName> = this.getAllowedIn();\n\n\t\treturn (\n\t\t\t!Type.isArrayFilled(allowedIn)\n\t\t\t|| (\n\t\t\t\tType.isArrayFilled(allowedIn)\n\t\t\t\t&& allowedIn.includes(tagName)\n\t\t\t)\n\t\t);\n\t}\n}\n","import { Type } from 'main.core';\nimport {\n\tBBCodeNodeScheme,\n\ttype BBCodeNodeSchemeOptions,\n\ttype BBCodeNodeConverter,\n\ttype BBCodeNodeName,\n} from './node-scheme';\nimport { typeof BBCodeElementNode } from '../../nodes/element-node';\nimport { BBCodeNode, type BBCodeContentNode } from '../../nodes/node';\n\nexport type BBCodeTagSchemeOptions = BBCodeNodeSchemeOptions & {\n\tvoid?: boolean,\n\tcanBeEmpty?: boolean,\n\tconvertChild?: BBCodeNodeConverter,\n\tallowedChildren?: Array<BBCodeNodeName>,\n};\n\nconst canBeEmptySymbol = Symbol('@canBeEmpty');\nconst voidSymbol = Symbol('@void');\n\nexport class BBCodeTagScheme extends BBCodeNodeScheme\n{\n\t[voidSymbol]: boolean = false;\n\t[canBeEmptySymbol]: boolean = true;\n\tchildConverter: BBCodeNodeConverter | null = null;\n\tallowedChildren: Array<BBCodeNodeName> = [];\n\n\tconstructor(options: BBCodeTagSchemeOptions)\n\t{\n\t\tsuper(options);\n\t\tthis.setVoid(options.void);\n\t\tthis.setCanBeEmpty(options.canBeEmpty);\n\t\tthis.setChildConverter(options.convertChild);\n\t\tthis.setAllowedChildren(options.allowedChildren);\n\t}\n\n\tstatic defaultBlockStringifier(node: BBCodeElementNode): string\n\t{\n\t\tconst isAllowNewlineBeforeOpeningTag: boolean = (() => {\n\t\t\tconst previewsSibling: ?BBCodeContentNode = node.getPreviewsSibling();\n\n\t\t\treturn previewsSibling && previewsSibling.getName() !== '#linebreak';\n\t\t})();\n\t\tconst isAllowNewlineAfterOpeningTag: boolean = (() => {\n\t\t\tconst firstChild: ?BBCodeContentNode = node.getFirstChild();\n\n\t\t\treturn firstChild && firstChild.getName() !== '#linebreak';\n\t\t})();\n\t\tconst isAllowNewlineBeforeClosingTag: boolean = (() => {\n\t\t\tconst lastChild: ?BBCodeContentNode = node.getLastChild();\n\n\t\t\treturn lastChild && lastChild.getName() !== '#linebreak';\n\t\t})();\n\t\tconst isAllowNewlineAfterClosingTag: boolean = (() => {\n\t\t\tconst nextSibling: ?BBCodeContentNode = node.getNextSibling();\n\n\t\t\treturn (\n\t\t\t\tnextSibling\n\t\t\t\t&& nextSibling.getName() !== '#linebreak'\n\t\t\t\t&& !(\n\t\t\t\t\tnextSibling.getType() === BBCodeNode.ELEMENT_NODE\n\t\t\t\t\t&& !nextSibling.getTagScheme().getGroup().includes('#inline')\n\t\t\t\t)\n\t\t\t);\n\t\t})();\n\n\t\tconst openingTag: string = node.getOpeningTag();\n\t\tconst content: string = node.getContent();\n\t\tconst closingTag: string = node.getClosingTag();\n\n\t\treturn [\n\t\t\tisAllowNewlineBeforeOpeningTag ? '\\n' : '',\n\t\t\topeningTag,\n\t\t\tisAllowNewlineAfterOpeningTag ? '\\n' : '',\n\t\t\tcontent,\n\t\t\tisAllowNewlineBeforeClosingTag ? '\\n' : '',\n\t\t\tclosingTag,\n\t\t\tisAllowNewlineAfterClosingTag ? '\\n' : '',\n\t\t].join('');\n\t}\n\n\tsetName(name: Array<BBCodeNodeName>)\n\t{\n\t\tsuper.setName(name);\n\t}\n\n\tsetVoid(value: boolean)\n\t{\n\t\tif (Type.isBoolean(value))\n\t\t{\n\t\t\tthis[voidSymbol] = value;\n\t\t}\n\t}\n\n\tisVoid(): boolean\n\t{\n\t\treturn this[voidSymbol];\n\t}\n\n\tsetCanBeEmpty(value: boolean)\n\t{\n\t\tif (Type.isBoolean(value))\n\t\t{\n\t\t\tthis[canBeEmptySymbol] = value;\n\t\t}\n\t}\n\n\tcanBeEmpty(): boolean\n\t{\n\t\treturn this[canBeEmptySymbol];\n\t}\n\n\tsetChildConverter(converter: BBCodeNodeConverter | null)\n\t{\n\t\tif (Type.isFunction(converter) || Type.isNull(converter))\n\t\t{\n\t\t\tthis.childConverter = converter;\n\t\t}\n\t}\n\n\tgetChildConverter(): BBCodeNodeConverter | null\n\t{\n\t\treturn this.childConverter;\n\t}\n\n\tsetAllowedChildren(allowedChildren: Array<BBCodeNodeName>)\n\t{\n\t\tif (Type.isArray(allowedChildren))\n\t\t{\n\t\t\tthis.allowedChildren = allowedChildren;\n\t\t}\n\t}\n\n\tgetAllowedChildren(): Array<BBCodeNodeName>\n\t{\n\t\treturn this.allowedChildren;\n\t}\n\n\tisChildAllowed(tagName: string): boolean\n\t{\n\t\tconst allowedChildren: Array<BBCodeNodeName> = this.getAllowedChildren();\n\n\t\treturn (\n\t\t\t!Type.isArrayFilled(allowedChildren)\n\t\t\t|| (\n\t\t\t\tType.isArrayFilled(allowedChildren)\n\t\t\t\t&& allowedChildren.includes(tagName)\n\t\t\t)\n\t\t);\n\t}\n}\n","import { Type } from 'main.core';\nimport { BBCodeEncoder } from 'ui.bbcode.encoder';\nimport { BBCodeTagScheme } from './node-schemes/tag-scheme';\nimport { BBCodeNode, type BBCodeNodeOptions } from '../nodes/node';\nimport { BBCodeRootNode, type RootNodeOptions } from '../nodes/root-node';\nimport { BBCodeFragmentNode, type FragmentNodeOptions } from '../nodes/fragment-node';\nimport { BBCodeElementNode, type BBCodeElementNodeOptions } from '../nodes/element-node';\nimport { BBCodeTextNode, type BBCodeTextNodeOptions } from '../nodes/text-node';\nimport { BBCodeNewLineNode } from '../nodes/new-line-node';\nimport { BBCodeTabNode } from '../nodes/tab-node';\nimport { BBCodeNodeScheme } from './node-schemes/node-scheme';\nimport type { BBCodeGroupName, BBCodeNodeName } from './node-schemes/node-scheme';\n\nexport type OutputTagCases = $Values<BBCodeScheme.Case>;\n\nexport type ParentChildMap = Map<\n\tBBCodeNodeName | BBCodeGroupName,\n\t{\n\t\tallowedChildren: Array<BBCodeNodeName | BBCodeGroupName>,\n\t\tallowedIn: Array<BBCodeNodeName | BBCodeGroupName>,\n\t\taliases: Array<BBCodeNodeName | BBCodeGroupName>,\n\t},\n>;\n\nexport type BBCodeSchemeOptions = {\n\ttagSchemes: Array<BBCodeTagScheme>,\n\toutputTagCase?: OutputTagCases,\n\tunresolvedNodesHoisting?: boolean,\n\tencoder?: BBCodeEncoder,\n};\n\nexport class BBCodeScheme\n{\n\tstatic Case: {[key: string]: string} = {\n\t\tLOWER: 'lower',\n\t\tUPPER: 'upper',\n\t};\n\n\ttagSchemes: Array<BBCodeTagScheme> = [];\n\toutputTagCase: OutputTagCases = BBCodeScheme.Case.LOWER;\n\tunresolvedNodesHoisting: boolean = true;\n\tencoder: BBCodeEncoder = new BBCodeEncoder();\n\n\tstatic isNodeScheme(value: any): boolean\n\t{\n\t\treturn value instanceof BBCodeNodeScheme;\n\t}\n\n\tstatic getTagName(node: string | BBCodeNode): string | null\n\t{\n\t\tif (Type.isString(node))\n\t\t{\n\t\t\treturn node;\n\t\t}\n\n\t\tif (Type.isObject(node) && node instanceof BBCodeNode)\n\t\t{\n\t\t\treturn node.getName();\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tconstructor(options: BBCodeSchemeOptions = {})\n\t{\n\t\tif (!Type.isPlainObject(options))\n\t\t{\n\t\t\tthrow new TypeError('options is not a object');\n\t\t}\n\n\t\tthis.setTagSchemes(options.tagSchemes);\n\t\tthis.setOutputTagCase(options.outputTagCase);\n\t\tthis.setUnresolvedNodesHoisting(options.unresolvedNodesHoisting);\n\t\tthis.setEncoder(options.encoder);\n\t}\n\n\tsetTagSchemes(tagSchemes: Array<BBCodeTagScheme>)\n\t{\n\t\tif (Type.isArray(tagSchemes))\n\t\t{\n\t\t\tconst invalidSchemeIndex: number = tagSchemes.findIndex((scheme: BBCodeTagScheme): boolean => {\n\t\t\t\treturn !BBCodeScheme.isNodeScheme(scheme);\n\t\t\t});\n\n\t\t\tif (invalidSchemeIndex > -1)\n\t\t\t{\n\t\t\t\tthrow new TypeError(`tagScheme #${invalidSchemeIndex} is not TagScheme instance`);\n\t\t\t}\n\n\t\t\tthis.tagSchemes = [...tagSchemes];\n\t\t}\n\t}\n\n\tsetTagScheme(...tagSchemes: Array<BBCodeTagScheme>)\n\t{\n\t\tconst invalidSchemeIndex: number = tagSchemes.findIndex((scheme: BBCodeTagScheme): boolean => {\n\t\t\treturn !BBCodeScheme.isNodeScheme(scheme);\n\t\t});\n\n\t\tif (invalidSchemeIndex > -1)\n\t\t{\n\t\t\tthrow new TypeError(`tagScheme #${invalidSchemeIndex} is not TagScheme instance`);\n\t\t}\n\n\t\tconst newTagSchemesNames: Array<string> = tagSchemes.flatMap((scheme: BBCodeTagScheme) => {\n\t\t\treturn scheme.getName();\n\t\t});\n\n\t\tconst currentTagSchemes: Array<BBCodeTagScheme> = this.getTagSchemes();\n\t\tcurrentTagSchemes.forEach((scheme: BBCodeTagScheme) => {\n\t\t\tscheme.removeName(...newTagSchemesNames);\n\t\t});\n\n\t\tconst filteredCurrentTagSchemes: Array<BBCodeTagScheme> = currentTagSchemes.filter((scheme: BBCodeTagScheme) => {\n\t\t\treturn Type.isArrayFilled(scheme.getName());\n\t\t});\n\n\t\tthis.setTagSchemes([\n\t\t\t...filteredCurrentTagSchemes,\n\t\t\t...tagSchemes,\n\t\t]);\n\t}\n\n\tgetTagSchemes(): Array<BBCodeTagScheme>\n\t{\n\t\treturn [...this.tagSchemes];\n\t}\n\n\tgetTagScheme(node: string | BBCodeNode): ?BBCodeTagScheme\n\t{\n\t\tconst tagName: ?string = BBCodeScheme.getTagName(node);\n\t\tif (Type.isString(tagName))\n\t\t{\n\t\t\treturn this.getTagSchemes().find((scheme: BBCodeTagScheme): boolean => {\n\t\t\t\treturn scheme.getName().includes(tagName.toLowerCase());\n\t\t\t});\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tsetOutputTagCase(tagCase: $Values<BBCodeScheme.Case>)\n\t{\n\t\tif (!Type.isNil(tagCase))\n\t\t{\n\t\t\tconst allowedCases = Object.values(BBCodeScheme.Case);\n\t\t\tif (allowedCases.includes(tagCase))\n\t\t\t{\n\t\t\t\tthis.outputTagCase = tagCase;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new TypeError(`'${tagCase}' is not allowed`);\n\t\t\t}\n\t\t}\n\t}\n\n\tgetOutputTagCase(): $Values<BBCodeScheme.Case>\n\t{\n\t\treturn this.outputTagCase;\n\t}\n\n\tsetUnresolvedNodesHoisting(value: boolean)\n\t{\n\t\tif (!Type.isNil(value))\n\t\t{\n\t\t\tif (Type.isBoolean(value))\n\t\t\t{\n\t\t\t\tthis.unresolvedNodesHoisting = value;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new TypeError(`'${value}' is not allowed value`);\n\t\t\t}\n\t\t}\n\t}\n\n\tisAllowedUnresolvedNodesHoisting(): boolean\n\t{\n\t\treturn this.unresolvedNodesHoisting;\n\t}\n\n\tsetEncoder(encoder: BBCodeEncoder)\n\t{\n\t\tif (encoder instanceof BBCodeEncoder)\n\t\t{\n\t\t\tthis.encoder = encoder;\n\t\t}\n\t}\n\n\tgetEncoder(): BBCodeEncoder\n\t{\n\t\treturn this.encoder;\n\t}\n\n\tgetAllowedTags(): Array<string>\n\t{\n\t\treturn this.getTagSchemes().flatMap((tagScheme: BBCodeTagScheme) => {\n\t\t\treturn tagScheme.getName();\n\t\t});\n\t}\n\n\tisAllowedTag(node: string | BBCodeNode): boolean\n\t{\n\t\tconst allowedTags: Array<string> = this.getAllowedTags();\n\t\tconst tagName: ?string = BBCodeScheme.getTagName(node);\n\n\t\treturn allowedTags.includes(String(tagName).toLowerCase());\n\t}\n\n\tisVoid(node: string | BBCodeNode): boolean\n\t{\n\t\tconst tagScheme: ?BBCodeTagScheme = this.getTagScheme(node);\n\t\tif (tagScheme)\n\t\t{\n\t\t\treturn tagScheme.isVoid();\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tisElement(node: BBCodeNode): boolean\n\t{\n\t\treturn node && node.getType() === BBCodeNode.ELEMENT_NODE;\n\t}\n\n\tisRoot(node: BBCodeNode): boolean\n\t{\n\t\treturn node && node.getName() === '#root';\n\t}\n\n\tisFragment(node: BBCodeNode): boolean\n\t{\n\t\treturn node && node.getName() === '#fragment';\n\t}\n\n\tisAnyText(node: BBCodeNode): boolean\n\t{\n\t\treturn node && node.getType() === BBCodeNode.TEXT_NODE;\n\t}\n\n\tisText(node: BBCodeNode): boolean\n\t{\n\t\treturn node && node.getName() === '#text';\n\t}\n\n\tisNewLine(node: BBCodeNode): boolean\n\t{\n\t\treturn node && node.getName() === '#linebreak';\n\t}\n\n\tisTab(node: BBCodeNode): boolean\n\t{\n\t\treturn node && node.getName() === '#tab';\n\t}\n\n\tgetParentChildMap(): ParentChildMap\n\t{\n\t\tconst tagSchemes: Array<BBCodeTagScheme> = this.getTagSchemes();\n\t\tconst map = new Map();\n\n\t\ttagSchemes.forEach((tagScheme: BBCodeTagScheme) => {\n\t\t\tconst groups: Array<BBCodeGroupName> = tagScheme.getGroup();\n\t\t\tconst schemeNames: Array<string> = [\n\t\t\t\t...tagScheme.getName(),\n\t\t\t\t...groups,\n\t\t\t\t...(tagScheme.isVoid() ? ['#void'] : []),\n\t\t\t];\n\n\t\t\tconst allowedChildren = tagScheme.getAllowedChildren();\n\t\t\tconst allowedIn = tagScheme.getAllowedIn();\n\n\t\t\tschemeNames.forEach((name) => {\n\t\t\t\tif (!map.has(name))\n\t\t\t\t{\n\t\t\t\t\tmap.set(\n\t\t\t\t\t\tname,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tallowedChildren: new Set(),\n\t\t\t\t\t\t\tallowedIn: new Set(),\n\t\t\t\t\t\t\taliases: new Set(),\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst entry: {\n\t\t\t\t\tallowedChildren: Set,\n\t\t\t\t\tallowedIn: Set,\n\t\t\t\t\taliases: Set,\n\t\t\t\t} = map.get(name);\n\n\t\t\t\tconst newEntry = {\n\t\t\t\t\tallowedChildren: new Set([...entry.allowedChildren, ...allowedChildren]),\n\t\t\t\t\tallowedIn: new Set([...entry.allowedIn, ...allowedIn]),\n\t\t\t\t\taliases: new Set([name, ...groups, ...(tagScheme.isVoid() ? ['#void'] : [])]),\n\t\t\t\t};\n\n\t\t\t\tmap.set(name, newEntry);\n\t\t\t});\n\t\t});\n\n\t\treturn map;\n\t}\n\n\tisChildAllowed(parent: string | BBCodeNode, child: string | BBCodeNode): boolean\n\t{\n\t\tconst parentName: ?string = BBCodeScheme.getTagName(parent);\n\t\tconst childName: ?string = BBCodeScheme.getTagName(child);\n\n\t\tif (\n\t\t\tType.isStringFilled(parentName)\n\t\t\t&& Type.isStringFilled(childName)\n\t\t)\n\t\t{\n\t\t\tif (parentName === '#fragment')\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tconst parentChildMap = this.getParentChildMap();\n\t\t\tconst parentMap = parentChildMap.get(parentName);\n\t\t\tconst childMap = parentChildMap.get(childName);\n\n\t\t\tif (\n\t\t\t\tType.isPlainObject(parentMap)\n\t\t\t\t&& Type.isPlainObject(childMap)\n\t\t\t)\n\t\t\t{\n\t\t\t\treturn (\n\t\t\t\t\t(\n\t\t\t\t\t\tparentMap.allowedChildren.size === 0\n\t\t\t\t\t\t|| [...childMap.aliases].some((name) => {\n\t\t\t\t\t\t\treturn parentMap.allowedChildren.has(name);\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t\t&& (\n\t\t\t\t\t\tchildMap.allowedIn.size === 0\n\t\t\t\t\t\t|| [...parentMap.aliases].some((name) => {\n\t\t\t\t\t\t\treturn childMap.allowedIn.has(name);\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tcreateRoot(options: RootNodeOptions = {}): BBCodeRootNode\n\t{\n\t\treturn new BBCodeRootNode({\n\t\t\t...options,\n\t\t\tscheme: this,\n\t\t});\n\t}\n\n\tcreateNode(options: BBCodeNodeOptions): BBCodeNode\n\t{\n\t\tif (!Type.isPlainObject(options))\n\t\t{\n\t\t\tthrow new TypeError('options is not a object');\n\t\t}\n\n\t\tif (!Type.isStringFilled(options.name))\n\t\t{\n\t\t\tthrow new TypeError('options.name is required');\n\t\t}\n\n\t\tif (!this.isAllowedTag(options.name))\n\t\t{\n\t\t\tthrow new TypeError(`Scheme for \"${options.name}\" tag is not specified.`);\n\t\t}\n\n\t\treturn new BBCodeNode({\n\t\t\t...options,\n\t\t\tscheme: this,\n\t\t});\n\t}\n\n\tcreateElement(options: BBCodeElementNodeOptions = {}): BBCodeElementNode\n\t{\n\t\tif (!Type.isPlainObject(options))\n\t\t{\n\t\t\tthrow new TypeError('options is not a object');\n\t\t}\n\n\t\tif (!Type.isStringFilled(options.name))\n\t\t{\n\t\t\tthrow new TypeError('options.name is required');\n\t\t}\n\n\t\tif (!this.isAllowedTag(options.name))\n\t\t{\n\t\t\tthrow new TypeError(`Scheme for \"${options.name}\" tag is not specified.`);\n\t\t}\n\n\t\treturn new BBCodeElementNode({\n\t\t\t...options,\n\t\t\tscheme: this,\n\t\t});\n\t}\n\n\tcreateText(options: BBCodeTextNodeOptions = {}): BBCodeTextNode\n\t{\n\t\tconst preparedOptions = Type.isPlainObject(options) ? options : { content: options };\n\n\t\treturn new BBCodeTextNode({\n\t\t\t...preparedOptions,\n\t\t\tscheme: this,\n\t\t});\n\t}\n\n\tcreateNewLine(options: BBCodeTextNodeOptions = {}): BBCodeNewLineNode\n\t{\n\t\tconst preparedOptions = Type.isPlainObject(options) ? options : { content: options };\n\n\t\treturn new BBCodeNewLineNode({\n\t\t\t...preparedOptions,\n\t\t\tscheme: this,\n\t\t});\n\t}\n\n\tcreateTab(options: BBCodeTextNodeOptions = {}): BBCodeTabNode\n\t{\n\t\tconst preparedOptions = Type.isPlainObject(options) ? options : { content: options };\n\n\t\treturn new BBCodeTabNode({\n\t\t\t...preparedOptions,\n\t\t\tscheme: this,\n\t\t});\n\t}\n\n\tcreateFragment(options: FragmentNodeOptions = {}): BBCodeFragmentNode\n\t{\n\t\treturn new BBCodeFragmentNode({\n\t\t\t...options,\n\t\t\tscheme: this,\n\t\t});\n\t}\n}\n","import { BBCodeNodeScheme } from './node-scheme';\n\nexport class BBCodeTextScheme extends BBCodeNodeScheme\n{\n\tconstructor(options)\n\t{\n\t\tsuper({ ...options, name: ['#text'] });\n\t}\n}\n","import { BBCodeNodeScheme } from './node-scheme';\n\nexport class BBCodeNewLineScheme extends BBCodeNodeScheme\n{\n\tconstructor(options = {})\n\t{\n\t\tsuper({ ...options, name: ['#linebreak'] });\n\t}\n}\n","import { BBCodeNodeScheme } from './node-scheme';\n\nexport class BBCodeTabScheme extends BBCodeNodeScheme\n{\n\tconstructor(options)\n\t{\n\t\tsuper({ ...options, name: ['#tab'] });\n\t}\n}\n","import { Type } from 'main.core';\nimport { BBCodeScheme } from './bbcode-scheme';\nimport { BBCodeTagScheme } from './node-schemes/tag-scheme';\nimport { typeof BBCodeElementNode } from '../nodes/element-node';\nimport type { BBCodeSchemeOptions } from './bbcode-scheme';\n\nexport type DefaultBBCodeSchemeOptions = BBCodeSchemeOptions & {\n\tfileTag: 'disk' | 'file' | 'none',\n};\n\nexport class DefaultBBCodeScheme extends BBCodeScheme\n{\n\tconstructor(options: DefaultBBCodeSchemeOptions = {})\n\t{\n\t\tconst tagSchemes = [\n\t\t\tnew BBCodeTagScheme({\n\t\t\t\tname: ['b', 'u', 'i', 's'],\n\t\t\t\tgroup: ['#inline', '#format'],\n\t\t\t\tallowedChildren: ['#text', '#linebreak', '#inline'],\n\t\t\t\tcanBeEmpty: false,\n\t\t\t}),\n\t\t\tnew BBCodeTagScheme({\n\t\t\t\tname: ['span'],\n\t\t\t\tgroup: ['#inline'],\n\t\t\t\tallowedChildren: ['#text', '#linebreak', '#inline'],\n\t\t\t\tcanBeEmpty: false,\n\t\t\t}),\n\t\t\tnew BBCodeTagScheme({\n\t\t\t\tname: ['img'],\n\t\t\t\tgroup: ['#inlineBlock'],\n\t\t\t\tallowedChildren: ['#text'],\n\t\t\t\tcanBeEmpty: false,\n\t\t\t}),\n\t\t\tnew BBCodeTagScheme({\n\t\t\t\tname: ['url'],\n\t\t\t\tgroup: ['#inline'],\n\t\t\t\tallowedChildren: ['#text', '#format', 'img'],\n\t\t\t\tcanBeEmpty: false,\n\t\t\t}),\n\t\t\tnew BBCodeTagScheme({\n\t\t\t\tname: 'p',\n\t\t\t\tgroup: ['#block'],\n\t\t\t\tallowedChildren: ['#text', '#linebreak', '#inline', '#inlineBlock'],\n\t\t\t\tstringify: BBCodeTagScheme.defaultBlockStringifier,\n\t\t\t\tallowedIn: ['#root', '#shadowRoot'],\n\t\t\t}),\n\t\t\tnew BBCodeTagScheme({\n\t\t\t\tname: 'list',\n\t\t\t\tgroup: ['#block'],\n\t\t\t\tallowedChildren: ['*'],\n\t\t\t\tstringify: BBCodeTagScheme.defaultBlockStringifier,\n\t\t\t\tallowedIn: ['#root', '#shadowRoot'],\n\t\t\t\tcanBeEmpty: false,\n\t\t\t}),\n\t\t\tnew BBCodeTagScheme({\n\t\t\t\tname: ['*'],\n\t\t\t\tallowedChildren: ['#text', '#linebreak', '#inline', '#inlineBlock'],\n\t\t\t\tstringify: (node: BBCodeElementNode) => {\n\t\t\t\t\tconst openingTag: string = node.getOpeningTag();\n\t\t\t\t\tconst content: string = node.getContent().trim();\n\n\t\t\t\t\treturn `${openingTag}${content}`;\n\t\t\t\t},\n\t\t\t\tallowedIn: ['list'],\n\t\t\t}),\n\t\t\tnew BBCodeTagScheme({\n\t\t\t\tname: 'table',\n\t\t\t\tgroup: ['#block'],\n\t\t\t\tallowedChildren: ['tr'],\n\t\t\t\tstringify: BBCodeTagScheme.defaultBlockStringifier,\n\t\t\t\tallowedIn: ['#root', 'quote', 'spoiler'],\n\t\t\t\tcanBeEmpty: false,\n\t\t\t}),\n\t\t\tnew BBCodeTagScheme({\n\t\t\t\tname: 'tr',\n\t\t\t\tallowedChildren: ['th', 'td'],\n\t\t\t\tallowedIn: ['table'],\n\t\t\t\tcanBeEmpty: false,\n\t\t\t}),\n\t\t\tnew BBCodeTagScheme({\n\t\t\t\tname: ['th', 'td'],\n\t\t\t\tgroup: ['#shadowRoot'],\n\t\t\t\tallowedChildren: ['#text', '#linebreak', '#inline', '#inlineBlock', '#block'],\n\t\t\t\tallowedIn: ['tr'],\n\t\t\t}),\n\t\t\tnew BBCodeTagScheme({\n\t\t\t\tname: 'quote',\n\t\t\t\tgroup: ['#block', '#shadowRoot'],\n\t\t\t\tallowedChildren: ['#text', '#linebreak', '#inline', '#inlineBlock', '#block'],\n\t\t\t\tallowedIn: ['#root', '#shadowRoot'],\n\t\t\t}),\n\t\t\tnew BBCodeTagScheme({\n\t\t\t\tname: 'code',\n\t\t\t\tgroup: ['#block'],\n\t\t\t\tstringify: BBCodeTagScheme.defaultBlockStringifier,\n\t\t\t\tallowedChildren: ['#text', '#linebreak', '#tab'],\n\t\t\t\tallowedIn: ['#root', '#shadowRoot'],\n\t\t\t}),\n\t\t\tnew BBCodeTagScheme({\n\t\t\t\tname: 'video',\n\t\t\t\tgroup: ['#inlineBlock'],\n\t\t\t\tallowedChildren: ['#text'],\n\t\t\t\tallowedIn: ['#root', '#shadowRoot', 'p'],\n\t\t\t\tcanBeEmpty: false,\n\t\t\t}),\n\t\t\tnew BBCodeTagScheme({\n\t\t\t\tname: 'spoiler',\n\t\t\t\tgroup: ['#block', '#shadowRoot'],\n\t\t\t\tallowedChildren: ['#text', '#linebreak', '#inline', '#inlineBlock', '#block'],\n\t\t\t\tallowedIn: ['#root', '#shadowRoot'],\n\t\t\t}),\n\t\t\tnew BBCodeTagScheme({\n\t\t\t\tname: ['user', 'project', 'department'],\n\t\t\t\tgroup: ['#inline', '#mention'],\n\t\t\t\tallowedChildren: ['#text', '#format'],\n\t\t\t\tcanBeEmpty: false,\n\t\t\t}),\n\t\t\tnew BBCodeTagScheme({\n\t\t\t\tname: ['#root'],\n\t\t\t}),\n\t\t\tnew BBCodeTagScheme({\n\t\t\t\tname: ['#fragment'],\n\t\t\t}),\n\t\t\tnew BBCodeTagScheme({\n\t\t\t\tname: ['#text'],\n\t\t\t}),\n\t\t\tnew BBCodeTagScheme({\n\t\t\t\tname: ['#linebreak'],\n\t\t\t}),\n\t\t\tnew BBCodeTagScheme({\n\t\t\t\tname: ['#tab'],\n\t\t\t\tstringify: () => {\n\t\t\t\t\treturn '';\n\t\t\t\t},\n\t\t\t}),\n\t\t];\n\n\t\tif (options?.fileTag !== 'none')\n\t\t{\n\t\t\ttagSchemes.push(\n\t\t\t\tnew BBCodeTagScheme({\n\t\t\t\t\tname: options?.fileTag === 'file' ? 'file' : 'disk',\n\t\t\t\t\tgroup: ['#inline'],\n\t\t\t\t\tvoid: true,\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\n\t\tsuper({\n\t\t\ttagSchemes,\n\t\t\toutputTagCase: BBCodeScheme.Case.LOWER,\n\t\t\tunresolvedNodesHoisting: true,\n\t\t});\n\n\t\tif (Type.isPlainObject(options))\n\t\t{\n\t\t\tthis.setTagSchemes(options.tagSchemes);\n\t\t\tthis.setOutputTagCase(options.outputTagCase);\n\t\t\tthis.setUnresolvedNodesHoisting(options.unresolvedNodesHoisting);\n\t\t}\n\t}\n}\n"],"names":["getByIndex","array","index","Type","isArray","TypeError","isInteger","preparedIndex","length","privateMap","WeakMap","nameSymbol","Symbol","BBCodeNode","constructor","options","children","set","delayedChildren","setName","name","get","scheme","setParent","parent","setChildren","ELEMENT_NODE","TEXT_NODE","ROOT_NODE","FRAGMENT_NODE","freezeProperty","node","property","value","enumerable","Object","defineProperty","writable","configurable","makeNonEnumerableProperty","flattenChildren","isArrayFilled","flatMap","getType","getChildren","setScheme","onUnknown","getScheme","getTagScheme","getName","getEncoder","prepareCase","currentCase","getOutputTagCase","toUpperCase","toLowerCase","isString","getDisplayedName","mounted","hasParent","onNodeDidMount","getParent","type","Boolean","remove","removeChild","appendChild","getLastChild","getLastChildOfType","reverse","find","getLastChildOfName","getFirstChild","getFirstChildOfType","getFirstChildOfName","getPreviewsSibling","parentChildren","currentIndex","indexOf","getPreviewsSiblings","filter","child","getNextSibling","getNextSiblings","getChildrenCount","hasChildren","isEmpty","adjustChildren","setDelayedChildren","addDelayedChildren","getDelayedChildren","hasDelayedChildren","flattenedChildren","forEach","push","prependChild","unshift","insertBefore","nodes","currentNodeIndex","deleteCount","splice","insertAfter","startIndex","propagateChild","includes","reduce","acc","replaceChild","targetNode","map","replace","clone","deep","createNode","toPlainText","join","getTextContent","getPlainTextLength","removePreviewsSiblings","previewsSiblings","sibling","removeNextSiblings","nextSiblings","findByTextIndex","endIndex","flattenAst","getLength","split","offset","byWord","plainTextLength","leftTree","tree","leftNode","rightNode","rightTree","ast","flat","traverse","toJSON","voidSymbol","BBCodeElementNode","attributes","tagScheme","isVoid","setValue","setAttributes","isAllowedTag","filterChildren","filteredChildren","resolved","unresolved","isChildAllowed","convertChildren","childConverter","getChildConverter","isNumber","isBoolean","getValue","canBeEmpty","hasGroup","groupName","isPlainObject","entries","key","fromEntries","setAttribute","isStringFilled","preparedName","isNil","getAttribute","getAttributes","convertedChildren","isAllowedUnresolvedNodesHoisting","toStringValue","encodedValue","encodeAttribute","toStringAttributes","attrValue","preparedKey","getContent","toString","getOpeningTag","displayedName","tagValue","formattedAttributes","getClosingTag","createElement","void","splitByChildIndex","childrenCount","leftChildren","childIndex","rightChildren","stringifier","getStringifier","isFunction","openingTag","content","closingTag","BBCodeRootNode","createRoot","BBCodeFragmentNode","createFragment","contentSymbol","BBCodeTextNode","nodeOptions","setContent","isTextNodeContent","String","createText","sourceOffset","contentLength","lastIndex","lastIndexOf","slice","encodeText","BBCodeNewLineNode","createNewLine","BBCodeTabNode","createTab","BBCodeNodeScheme","group","serializer","allowedIn","setGroup","setAllowedIn","setStringifier","stringify","setSerializer","serialize","removeName","names","removeGroup","groups","getGroup","isNull","getSerializer","allowedParents","getAllowedIn","isAllowedIn","tagName","canBeEmptySymbol","BBCodeTagScheme","allowedChildren","setVoid","setCanBeEmpty","setChildConverter","convertChild","setAllowedChildren","defaultBlockStringifier","isAllowNewlineBeforeOpeningTag","previewsSibling","isAllowNewlineAfterOpeningTag","firstChild","isAllowNewlineBeforeClosingTag","lastChild","isAllowNewlineAfterClosingTag","nextSibling","converter","getAllowedChildren","BBCodeScheme","isNodeScheme","getTagName","isObject","tagSchemes","outputTagCase","Case","LOWER","unresolvedNodesHoisting","encoder","BBCodeEncoder","setTagSchemes","setOutputTagCase","setUnresolvedNodesHoisting","setEncoder","invalidSchemeIndex","findIndex","setTagScheme","newTagSchemesNames","currentTagSchemes","getTagSchemes","filteredCurrentTagSchemes","tagCase","allowedCases","values","getAllowedTags","allowedTags","isElement","isRoot","isFragment","isAnyText","isText","isNewLine","isTab","getParentChildMap","Map","schemeNames","has","Set","aliases","entry","newEntry","parentName","childName","parentChildMap","parentMap","childMap","size","some","preparedOptions","UPPER","BBCodeTextScheme","BBCodeNewLineScheme","BBCodeTabScheme","DefaultBBCodeScheme","trim","fileTag"],"mappings":";;;;;;CAEO,SAASA,UAAU,CAAIC,KAAe,EAAEC,KAAa,EAC5D;GACC,IAAI,CAACC,cAAI,CAACC,OAAO,CAACH,KAAK,CAAC,EACxB;KACC,MAAM,IAAII,SAAS,CAAC,sBAAsB,CAAC;;GAG5C,IAAI,CAACF,cAAI,CAACG,SAAS,CAACJ,KAAK,CAAC,EAC1B;KACC,MAAM,IAAIG,SAAS,CAAC,wBAAwB,CAAC;;GAG9C,MAAME,aAAa,GAAGL,KAAK,GAAG,CAAC,GAAGD,KAAK,CAACO,MAAM,GAAGN,KAAK,GAAGA,KAAK;GAE9D,OAAOD,KAAK,CAACM,aAAa,CAAC;CAC5B;;CCcO,MAAME,UAAkD,GAAG,IAAIC,OAAO,EAAE;AAC/E,CAAO,MAAMC,UAAkB,GAAGC,MAAM,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