@digi-frontend/dgate-api-documentation 1.1.12 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +13 -0
- package/.prettierignore +8 -0
- package/.prettierrc +15 -0
- package/dist/_virtual/index4.js +1 -1
- package/dist/_virtual/index5.js +1 -1
- package/dist/_virtual/index6.js +1 -1
- package/dist/_virtual/index7.js +1 -1
- package/dist/node_modules/@popperjs/core/lib/createPopper.js +1 -1
- package/dist/node_modules/@popperjs/core/lib/createPopper.js.map +1 -1
- package/dist/node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js +1 -1
- package/dist/node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js.map +1 -1
- package/dist/node_modules/@popperjs/core/lib/enums.js +1 -1
- package/dist/node_modules/@popperjs/core/lib/enums.js.map +1 -1
- package/dist/node_modules/@popperjs/core/lib/modifiers/applyStyles.js +1 -1
- package/dist/node_modules/@popperjs/core/lib/modifiers/applyStyles.js.map +1 -1
- package/dist/node_modules/@popperjs/core/lib/modifiers/eventListeners.js +1 -1
- package/dist/node_modules/@popperjs/core/lib/modifiers/eventListeners.js.map +1 -1
- package/dist/node_modules/@popperjs/core/lib/modifiers/flip.js +1 -1
- package/dist/node_modules/@popperjs/core/lib/modifiers/flip.js.map +1 -1
- package/dist/node_modules/@popperjs/core/lib/modifiers/hide.js +1 -1
- package/dist/node_modules/@popperjs/core/lib/modifiers/hide.js.map +1 -1
- package/dist/node_modules/@popperjs/core/lib/modifiers/offset.js +1 -1
- package/dist/node_modules/@popperjs/core/lib/modifiers/offset.js.map +1 -1
- package/dist/node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js +1 -1
- package/dist/node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js.map +1 -1
- package/dist/node_modules/@popperjs/core/lib/utils/debounce.js +1 -1
- package/dist/node_modules/@popperjs/core/lib/utils/debounce.js.map +1 -1
- package/dist/node_modules/@popperjs/core/lib/utils/detectOverflow.js +1 -1
- package/dist/node_modules/@popperjs/core/lib/utils/detectOverflow.js.map +1 -1
- package/dist/node_modules/@popperjs/core/lib/utils/expandToHashMap.js +1 -1
- package/dist/node_modules/@popperjs/core/lib/utils/expandToHashMap.js.map +1 -1
- package/dist/node_modules/@popperjs/core/lib/utils/getOppositePlacement.js +1 -1
- package/dist/node_modules/@popperjs/core/lib/utils/getOppositePlacement.js.map +1 -1
- package/dist/node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js +1 -1
- package/dist/node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js.map +1 -1
- package/dist/node_modules/@popperjs/core/lib/utils/mergeByName.js +1 -1
- package/dist/node_modules/@popperjs/core/lib/utils/mergeByName.js.map +1 -1
- package/dist/node_modules/@popperjs/core/lib/utils/orderModifiers.js +1 -1
- package/dist/node_modules/@popperjs/core/lib/utils/orderModifiers.js.map +1 -1
- package/dist/node_modules/@popperjs/core/lib/utils/userAgent.js +1 -1
- package/dist/node_modules/@popperjs/core/lib/utils/userAgent.js.map +1 -1
- package/dist/node_modules/@tippyjs/react/dist/tippy-react.esm.js +1 -1
- package/dist/node_modules/@tippyjs/react/dist/tippy-react.esm.js.map +1 -1
- package/dist/node_modules/digitinary-ui/dist/index.js +1 -1
- package/dist/node_modules/digitinary-ui/dist/index.js.map +1 -1
- package/dist/node_modules/dom-serializer/lib/foreignNames.js +1 -1
- package/dist/node_modules/dom-serializer/lib/foreignNames.js.map +1 -1
- package/dist/node_modules/dom-serializer/lib/index.js +1 -1
- package/dist/node_modules/dom-serializer/lib/index.js.map +1 -1
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/decode.js +1 -1
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/decode.js.map +1 -1
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-html.js +1 -1
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-html.js.map +1 -1
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-xml.js +1 -1
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-xml.js.map +1 -1
- package/dist/node_modules/domhandler/lib/node.js +1 -1
- package/dist/node_modules/domhandler/lib/node.js.map +1 -1
- package/dist/node_modules/domutils/lib/feeds.js +1 -1
- package/dist/node_modules/domutils/lib/feeds.js.map +1 -1
- package/dist/node_modules/domutils/lib/helpers.js +1 -1
- package/dist/node_modules/domutils/lib/helpers.js.map +1 -1
- package/dist/node_modules/domutils/lib/legacy.js +1 -1
- package/dist/node_modules/domutils/lib/legacy.js.map +1 -1
- package/dist/node_modules/domutils/lib/querying.js +1 -1
- package/dist/node_modules/domutils/lib/querying.js.map +1 -1
- package/dist/node_modules/domutils/lib/stringify.js +1 -1
- package/dist/node_modules/domutils/lib/stringify.js.map +1 -1
- package/dist/node_modules/entities/dist/commonjs/decode.js +1 -1
- package/dist/node_modules/entities/dist/commonjs/decode.js.map +1 -1
- package/dist/node_modules/entities/dist/commonjs/generated/decode-data-html.js +1 -1
- package/dist/node_modules/entities/dist/commonjs/generated/decode-data-html.js.map +1 -1
- package/dist/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +1 -1
- package/dist/node_modules/entities/dist/commonjs/generated/decode-data-xml.js.map +1 -1
- package/dist/node_modules/formik/dist/formik.esm.js +1 -1
- package/dist/node_modules/formik/dist/formik.esm.js.map +1 -1
- package/dist/node_modules/formik/node_modules/deepmerge/dist/es.js +1 -1
- package/dist/node_modules/formik/node_modules/deepmerge/dist/es.js.map +1 -1
- package/dist/node_modules/highlight.js/lib/core.js +1 -1
- package/dist/node_modules/highlight.js/lib/core.js.map +1 -1
- package/dist/node_modules/highlight.js/lib/languages/json.js +1 -1
- package/dist/node_modules/highlight.js/lib/languages/json.js.map +1 -1
- package/dist/node_modules/html-react-parser/lib/utilities.js.map +1 -1
- package/dist/node_modules/htmlparser2/dist/commonjs/Tokenizer.js +1 -1
- package/dist/node_modules/htmlparser2/dist/commonjs/Tokenizer.js.map +1 -1
- package/dist/node_modules/htmlparser2/dist/commonjs/index.js +1 -1
- package/dist/node_modules/htmlparser2/dist/commonjs/index.js.map +1 -1
- package/dist/node_modules/js-yaml/dist/js-yaml.mjs.js +1 -1
- package/dist/node_modules/js-yaml/dist/js-yaml.mjs.js.map +1 -1
- package/dist/node_modules/lodash-es/_baseClone.js +1 -1
- package/dist/node_modules/lodash-es/_baseClone.js.map +1 -1
- package/dist/node_modules/lodash-es/_getSymbols.js +1 -1
- package/dist/node_modules/lodash-es/_getSymbols.js.map +1 -1
- package/dist/node_modules/lodash-es/_memoizeCapped.js +1 -1
- package/dist/node_modules/lodash-es/_memoizeCapped.js.map +1 -1
- package/dist/node_modules/lodash-es/_stringToPath.js +1 -1
- package/dist/node_modules/lodash-es/_stringToPath.js.map +1 -1
- package/dist/node_modules/property-expr/index.js +1 -1
- package/dist/node_modules/property-expr/index.js.map +1 -1
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.js +1 -1
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.js.map +1 -1
- package/dist/node_modules/react-property/lib/index.js +1 -1
- package/dist/node_modules/react-property/lib/index.js.map +1 -1
- package/dist/node_modules/react-syntax-highlighter/dist/esm/create-element.js +1 -1
- package/dist/node_modules/react-syntax-highlighter/dist/esm/create-element.js.map +1 -1
- package/dist/node_modules/react-syntax-highlighter/dist/esm/highlight.js +1 -1
- package/dist/node_modules/react-syntax-highlighter/dist/esm/highlight.js.map +1 -1
- package/dist/node_modules/react-toastify/dist/index.mjs.js +1 -1
- package/dist/node_modules/react-toastify/dist/index.mjs.js.map +1 -1
- package/dist/node_modules/style-to-js/cjs/index.js +1 -1
- package/dist/node_modules/style-to-js/cjs/index.js.map +1 -1
- package/dist/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/node_modules/style-to-object/cjs/index.js.map +1 -1
- package/dist/node_modules/tiny-case/index.js +1 -1
- package/dist/node_modules/tiny-case/index.js.map +1 -1
- package/dist/node_modules/tippy.js/dist/tippy.esm.js +1 -1
- package/dist/node_modules/tippy.js/dist/tippy.esm.js.map +1 -1
- package/dist/node_modules/toposort/index.js +1 -1
- package/dist/node_modules/toposort/index.js.map +1 -1
- package/dist/node_modules/tslib/tslib.es6.js +1 -1
- package/dist/node_modules/tslib/tslib.es6.js.map +1 -1
- package/dist/node_modules/yup/index.esm.js +1 -1
- package/dist/node_modules/yup/index.esm.js.map +1 -1
- package/dist/src/components/InfoForm/InfoForm.js +1 -1
- package/dist/src/components/InfoForm/InfoForm.js.map +1 -1
- package/dist/src/components/JsonInput/JsonInput.js +1 -1
- package/dist/src/components/JsonInput/JsonInput.js.map +1 -1
- package/dist/src/components/LivePreview/LivePreview.js +1 -1
- package/dist/src/components/LivePreview/LivePreview.js.map +1 -1
- package/dist/src/components/MethodAccordion/MethodAccordion.js +1 -1
- package/dist/src/components/MethodAccordion/MethodAccordion.js.map +1 -1
- package/dist/src/components/SVGLoader/SVGLoader.js +1 -1
- package/dist/src/components/SVGLoader/SVGLoader.js.map +1 -1
- package/dist/src/components/Tooltip/Tooltip.js +1 -1
- package/dist/src/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/src/components/table/table.js +1 -1
- package/dist/src/components/table/table.js.map +1 -1
- package/dist/src/components/table/tags-table.js +1 -1
- package/dist/src/components/table/tags-table.js.map +1 -1
- package/dist/src/constants/methods.constant.js +1 -1
- package/dist/src/constants/methods.constant.js.map +1 -1
- package/dist/src/context/SectionToggleContext.js +1 -1
- package/dist/src/context/SectionToggleContext.js.map +1 -1
- package/dist/src/helpers/docs.helper.js +1 -1
- package/dist/src/helpers/docs.helper.js.map +1 -1
- package/dist/src/helpers/layout.helper.js +1 -1
- package/dist/src/helpers/layout.helper.js.map +1 -1
- package/dist/src/layout/docsComponents/DocsAside/DocsAside.js +1 -1
- package/dist/src/layout/docsComponents/DocsAside/DocsAside.js.map +1 -1
- package/dist/src/layout/docsComponents/DocsContent/DocsContent.js +1 -1
- package/dist/src/layout/docsComponents/DocsContent/DocsContent.js.map +1 -1
- package/dist/src/layout/docsComponents/DocsContent/EndpointPage/index.js +1 -1
- package/dist/src/layout/docsComponents/DocsContent/EndpointPage/index.js.map +1 -1
- package/dist/src/layout/docsComponents/DocsContent/OverviewPage/index.js +1 -1
- package/dist/src/layout/docsComponents/DocsContent/OverviewPage/index.js.map +1 -1
- package/dist/src/layout/docsComponents/DocsHeader/DocsHeader.js +1 -1
- package/dist/src/layout/docsComponents/DocsHeader/DocsHeader.js.map +1 -1
- package/dist/src/layout/docsComponents/DocsSideMenuTree/DocsSideMenuTree.js +1 -1
- package/dist/src/layout/docsComponents/DocsSideMenuTree/DocsSideMenuTree.js.map +1 -1
- package/dist/src/layout/docsLayout.js +1 -1
- package/dist/src/layout/docsLayout.js.map +1 -1
- package/dist/src/layout/layout.js +1 -1
- package/dist/src/layout/layout.js.map +1 -1
- package/dist/src/utils/index.js +1 -1
- package/dist/src/utils/index.js.map +1 -1
- package/dist/src/validator/form.scheme.js +1 -1
- package/dist/src/validator/form.scheme.js.map +1 -1
- package/dist/styles.css +773 -773
- package/index.ts +2 -0
- package/package.json +4 -9
- package/rollup.config.js +37 -0
- package/src/assets/icons/AddRow.svg +3 -0
- package/src/assets/icons/ApiIcon.svg +12 -0
- package/src/assets/icons/ArrowBack.svg +3 -0
- package/src/assets/icons/BookIcon.svg +6 -0
- package/src/assets/icons/CheckMarkSquare.svg +5 -0
- package/src/assets/icons/CloseIcon.svg +4 -0
- package/src/assets/icons/CopySticker.svg +6 -0
- package/src/assets/icons/DeleteIcon.svg +3 -0
- package/src/assets/icons/DownArrow.svg +3 -0
- package/src/assets/icons/EditIcon.svg +3 -0
- package/src/assets/icons/FilterIcon.svg +4 -0
- package/src/assets/icons/Plus.svg +5 -0
- package/src/assets/icons/PlusSquare.svg +3 -0
- package/src/assets/icons/RequestOption.svg +5 -0
- package/src/assets/icons/UpArrow.svg +3 -0
- package/src/assets/icons/arrow-down.svg +3 -0
- package/src/assets/icons/arrow-up.svg +10 -0
- package/src/assets/icons/arrowDownGray.svg +3 -0
- package/src/assets/icons/arrowRightGray.svg +3 -0
- package/src/assets/icons/close-circle.svg +5 -0
- package/src/assets/icons/copy.svg +4 -0
- package/src/assets/icons/deleteOutlinedIcon.svg +8 -0
- package/src/assets/icons/document.svg +6 -0
- package/src/assets/icons/eye.svg +4 -0
- package/src/assets/icons/index.ts +27 -0
- package/src/assets/icons/infoIcon.svg +5 -0
- package/src/assets/icons/newCopyIcon.svg +4 -0
- package/src/assets/icons/searchIcon.svg +4 -0
- package/src/components/Chips/Chips.tsx +87 -0
- package/src/components/InfoForm/InfoForm.tsx +432 -0
- package/src/components/JsonInput/JsonInput.tsx +149 -0
- package/src/components/LivePreview/LivePreview.tsx +224 -0
- package/src/components/MethodAccordion/MethodAccordion.tsx +1070 -0
- package/src/components/SVGLoader/SVGLoader.tsx +96 -0
- package/src/components/SectionHead/SectionHead.tsx +22 -0
- package/src/components/SimpleLabelValue/SimpleLabelValue.tsx +31 -0
- package/src/components/SimpleLabelValue/index.ts +1 -0
- package/src/components/Tooltip/Tooltip.tsx +85 -0
- package/src/components/dialog/dialog.ts +61 -0
- package/src/components/dialog/index.tsx +88 -0
- package/src/components/table/table.tsx +508 -0
- package/src/components/table/tags-table.tsx +348 -0
- package/src/constants/index.ts +95 -0
- package/src/constants/methods.constant.ts +26 -0
- package/src/constants/regex.ts +7 -0
- package/src/context/SectionToggleContext.tsx +121 -0
- package/src/global.d.ts +13 -0
- package/src/helpers/docs.helper.ts +42 -0
- package/src/helpers/layout.helper.ts +290 -0
- package/src/helpers/methodAccordion.helper.ts +20 -0
- package/src/index.ts +2 -0
- package/src/layout/docsComponents/Codebox/Codebox.tsx +61 -0
- package/src/layout/docsComponents/DocsAside/DocsAside.tsx +112 -0
- package/src/layout/docsComponents/DocsContent/DocsContent.tsx +51 -0
- package/src/layout/docsComponents/DocsContent/EndpointPage/index.tsx +307 -0
- package/src/layout/docsComponents/DocsContent/OverviewPage/index.tsx +223 -0
- package/src/layout/docsComponents/DocsHeader/DocsHeader.tsx +188 -0
- package/src/layout/docsComponents/DocsSideMenuTree/DocsSideMenuTree.tsx +229 -0
- package/src/layout/docsComponents/index.tsx +28 -0
- package/src/layout/docsLayout.tsx +123 -0
- package/src/layout/layout.module.css +65 -0
- package/src/layout/layout.tsx +177 -0
- package/src/types/docsLayout.type.ts +7 -0
- package/src/types/index.ts +28 -0
- package/src/types/layout.type.ts +32 -0
- package/src/types/openApi.ts +109 -0
- package/src/types/transformedOpenApi.ts +52 -0
- package/src/utils/index.ts +15 -0
- package/src/validator/form.scheme.ts +96 -0
- package/tsconfig.json +33 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.js","sources":["../../../../node_modules/html-react-parser/lib/utilities.js"],"sourcesContent":["\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.returnFirstArg = exports.canTextBeChildOfNode = exports.ELEMENTS_WITH_NO_TEXT_CHILDREN = exports.PRESERVE_CUSTOM_ATTRIBUTES = void 0;\nexports.isCustomComponent = isCustomComponent;\nexports.setStyleProp = setStyleProp;\nvar react_1 = require(\"react\");\nvar style_to_js_1 = __importDefault(require(\"style-to-js\"));\nvar RESERVED_SVG_MATHML_ELEMENTS = new Set([\n 'annotation-xml',\n 'color-profile',\n 'font-face',\n 'font-face-src',\n 'font-face-uri',\n 'font-face-format',\n 'font-face-name',\n 'missing-glyph',\n]);\n/**\n * Check if a tag is a custom component.\n *\n * @see {@link https://github.com/facebook/react/blob/v16.6.3/packages/react-dom/src/shared/isCustomComponent.js}\n *\n * @param tagName - Tag name.\n * @param props - Props passed to the element.\n * @returns - Whether the tag is custom component.\n */\nfunction isCustomComponent(tagName, props) {\n if (!tagName.includes('-')) {\n return Boolean(props && typeof props.is === 'string');\n }\n // These are reserved SVG and MathML elements.\n // We don't mind this whitelist too much because we expect it to never grow.\n // The alternative is to track the namespace in a few places which is convoluted.\n // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts\n if (RESERVED_SVG_MATHML_ELEMENTS.has(tagName)) {\n return false;\n }\n return true;\n}\nvar styleOptions = {\n reactCompat: true,\n};\n/**\n * Sets style prop.\n *\n * @param style - Inline style.\n * @param props - Props object.\n */\nfunction setStyleProp(style, props) {\n if (typeof style !== 'string') {\n return;\n }\n if (!style.trim()) {\n props.style = {};\n return;\n }\n try {\n props.style = (0, style_to_js_1.default)(style, styleOptions);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n }\n catch (error) {\n props.style = {};\n }\n}\n/**\n * @see https://reactjs.org/blog/2017/09/08/dom-attributes-in-react-16.html\n */\nexports.PRESERVE_CUSTOM_ATTRIBUTES = Number(react_1.version.split('.')[0]) >= 16;\n/**\n * @see https://github.com/facebook/react/blob/cae635054e17a6f107a39d328649137b83f25972/packages/react-dom/src/client/validateDOMNesting.js#L213\n */\nexports.ELEMENTS_WITH_NO_TEXT_CHILDREN = new Set([\n 'tr',\n 'tbody',\n 'thead',\n 'tfoot',\n 'colgroup',\n 'table',\n 'head',\n 'html',\n 'frameset',\n]);\n/**\n * Checks if the given node can contain text nodes\n *\n * @param node - Element node.\n * @returns - Whether the node can contain text nodes.\n */\nvar canTextBeChildOfNode = function (node) {\n return !exports.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(node.name);\n};\nexports.canTextBeChildOfNode = canTextBeChildOfNode;\n/**\n * Returns the first argument as is.\n *\n * @param arg - The argument to be returned.\n * @returns - The input argument `arg`.\n */\nvar returnFirstArg = function (arg) { return arg; }
|
|
1
|
+
{"version":3,"file":"utilities.js","sources":["../../../../node_modules/html-react-parser/lib/utilities.js"],"sourcesContent":["\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.returnFirstArg = exports.canTextBeChildOfNode = exports.ELEMENTS_WITH_NO_TEXT_CHILDREN = exports.PRESERVE_CUSTOM_ATTRIBUTES = void 0;\nexports.isCustomComponent = isCustomComponent;\nexports.setStyleProp = setStyleProp;\nvar react_1 = require(\"react\");\nvar style_to_js_1 = __importDefault(require(\"style-to-js\"));\nvar RESERVED_SVG_MATHML_ELEMENTS = new Set([\n 'annotation-xml',\n 'color-profile',\n 'font-face',\n 'font-face-src',\n 'font-face-uri',\n 'font-face-format',\n 'font-face-name',\n 'missing-glyph',\n]);\n/**\n * Check if a tag is a custom component.\n *\n * @see {@link https://github.com/facebook/react/blob/v16.6.3/packages/react-dom/src/shared/isCustomComponent.js}\n *\n * @param tagName - Tag name.\n * @param props - Props passed to the element.\n * @returns - Whether the tag is custom component.\n */\nfunction isCustomComponent(tagName, props) {\n if (!tagName.includes('-')) {\n return Boolean(props && typeof props.is === 'string');\n }\n // These are reserved SVG and MathML elements.\n // We don't mind this whitelist too much because we expect it to never grow.\n // The alternative is to track the namespace in a few places which is convoluted.\n // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts\n if (RESERVED_SVG_MATHML_ELEMENTS.has(tagName)) {\n return false;\n }\n return true;\n}\nvar styleOptions = {\n reactCompat: true,\n};\n/**\n * Sets style prop.\n *\n * @param style - Inline style.\n * @param props - Props object.\n */\nfunction setStyleProp(style, props) {\n if (typeof style !== 'string') {\n return;\n }\n if (!style.trim()) {\n props.style = {};\n return;\n }\n try {\n props.style = (0, style_to_js_1.default)(style, styleOptions);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n }\n catch (error) {\n props.style = {};\n }\n}\n/**\n * @see https://reactjs.org/blog/2017/09/08/dom-attributes-in-react-16.html\n */\nexports.PRESERVE_CUSTOM_ATTRIBUTES = Number(react_1.version.split('.')[0]) >= 16;\n/**\n * @see https://github.com/facebook/react/blob/cae635054e17a6f107a39d328649137b83f25972/packages/react-dom/src/client/validateDOMNesting.js#L213\n */\nexports.ELEMENTS_WITH_NO_TEXT_CHILDREN = new Set([\n 'tr',\n 'tbody',\n 'thead',\n 'tfoot',\n 'colgroup',\n 'table',\n 'head',\n 'html',\n 'frameset',\n]);\n/**\n * Checks if the given node can contain text nodes\n *\n * @param node - Element node.\n * @returns - Whether the node can contain text nodes.\n */\nvar canTextBeChildOfNode = function (node) {\n return !exports.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(node.name);\n};\nexports.canTextBeChildOfNode = canTextBeChildOfNode;\n/**\n * Returns the first argument as is.\n *\n * @param arg - The argument to be returned.\n * @returns - The input argument `arg`.\n */\nvar returnFirstArg = function (arg) { return arg; }; // eslint-disable-line @typescript-eslint/no-explicit-any\nexports.returnFirstArg = returnFirstArg;\n//# sourceMappingURL=utilities.js.map"],"names":["__importDefault","this","mod","__esModule","default","Object","defineProperty","exports","value","returnFirstArg","canTextBeChildOfNode","ELEMENTS_WITH_NO_TEXT_CHILDREN","PRESERVE_CUSTOM_ATTRIBUTES","isCustomComponent","tagName","props","includes","Boolean","is","RESERVED_SVG_MATHML_ELEMENTS","has","setStyleProp","style","trim","style_to_js_1","styleOptions","error","react_1","require$$0","require$$1","Set","reactCompat","Number","version","split","node","name","arg"],"mappings":"yLACA,IAAIA,EAAmBC,GAAQA,EAAKD,iBAAoB,SAAUE,GAC9D,OAAQA,GAAOA,EAAIC,WAAcD,EAAM,CAAEE,QAAWF,IAExDG,OAAOC,eAAcC,EAAU,aAAc,CAAEC,OAAO,IACtDD,EAAAE,eAAyBF,EAA+BG,qBAAAH,EAAAI,+BAAyCJ,EAAqCK,gCAAA,EACtIL,EAAAM,kBAuBA,SAA2BC,EAASC,GAChC,IAAKD,EAAQE,SAAS,KAClB,OAAOC,QAAQF,GAA6B,iBAAbA,EAAMG,IAMzC,GAAIC,EAA6BC,IAAIN,GACjC,OAAO,EAEX,OAAO,CACX,EAlCAP,EAAAc,aA4CA,SAAsBC,EAAOP,GACzB,GAAqB,iBAAVO,EACP,OAEJ,IAAKA,EAAMC,OAEP,YADAR,EAAMO,MAAQ,IAGlB,IACIP,EAAMO,OAAQ,EAAIE,EAAcpB,SAASkB,EAAOG,EAExD,CACI,MAAOC,GACHX,EAAMO,MAAQ,EACtB,CACA,EA1DA,IAAIK,EAAUC,EACVJ,EAAgBxB,EAAgB6B,KAChCV,EAA+B,IAAIW,IAAI,CACvC,iBACA,gBACA,YACA,gBACA,gBACA,mBACA,iBACA,kBAwBJ,IAAIL,EAAe,CACfM,aAAa,GA2BjBxB,EAAAK,2BAAqCoB,OAAOL,EAAQM,QAAQC,MAAM,KAAK,KAAO,GAI9E3B,EAAyCI,+BAAA,IAAImB,IAAI,CAC7C,KACA,QACA,QACA,QACA,WACA,QACA,OACA,OACA,aAWJvB,EAAAG,qBAH2B,SAAUyB,GACjC,OAAQ5B,EAAQI,+BAA+BS,IAAIe,EAAKC,OAU5D7B,EAAAE,eADqB,SAAU4B,GAAO,OAAOA,CAAI"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__exports as t}from"../../../../_virtual/Tokenizer.js";import{__require as e}from"../../../entities/dist/commonjs/decode.js";var i;function s(){if(i)return t;i=1,Object.defineProperty(t,"__esModule",{value:!0}),t.QuoteType=void 0;const s=e();var a,n,r;function h(t){return t===a.Space||t===a.NewLine||t===a.Tab||t===a.FormFeed||t===a.CarriageReturn}function o(t){return t===a.Slash||t===a.Gt||h(t)}!function(t){t[t.Tab=9]="Tab",t[t.NewLine=10]="NewLine",t[t.FormFeed=12]="FormFeed",t[t.CarriageReturn=13]="CarriageReturn",t[t.Space=32]="Space",t[t.ExclamationMark=33]="ExclamationMark",t[t.Number=35]="Number",t[t.Amp=38]="Amp",t[t.SingleQuote=39]="SingleQuote",t[t.DoubleQuote=34]="DoubleQuote",t[t.Dash=45]="Dash",t[t.Slash=47]="Slash",t[t.Zero=48]="Zero",t[t.Nine=57]="Nine",t[t.Semi=59]="Semi",t[t.Lt=60]="Lt",t[t.Eq=61]="Eq",t[t.Gt=62]="Gt",t[t.Questionmark=63]="Questionmark",t[t.UpperA=65]="UpperA",t[t.LowerA=97]="LowerA",t[t.UpperF=70]="UpperF",t[t.LowerF=102]="LowerF",t[t.UpperZ=90]="UpperZ",t[t.LowerZ=122]="LowerZ",t[t.LowerX=120]="LowerX",t[t.OpeningSquareBracket=91]="OpeningSquareBracket"}(a||(a={})),function(t){t[t.Text=1]="Text",t[t.BeforeTagName=2]="BeforeTagName",t[t.InTagName=3]="InTagName",t[t.InSelfClosingTag=4]="InSelfClosingTag",t[t.BeforeClosingTagName=5]="BeforeClosingTagName",t[t.InClosingTagName=6]="InClosingTagName",t[t.AfterClosingTagName=7]="AfterClosingTagName",t[t.BeforeAttributeName=8]="BeforeAttributeName",t[t.InAttributeName=9]="InAttributeName",t[t.AfterAttributeName=10]="AfterAttributeName",t[t.BeforeAttributeValue=11]="BeforeAttributeValue",t[t.InAttributeValueDq=12]="InAttributeValueDq",t[t.InAttributeValueSq=13]="InAttributeValueSq",t[t.InAttributeValueNq=14]="InAttributeValueNq",t[t.BeforeDeclaration=15]="BeforeDeclaration",t[t.InDeclaration=16]="InDeclaration",t[t.InProcessingInstruction=17]="InProcessingInstruction",t[t.BeforeComment=18]="BeforeComment",t[t.CDATASequence=19]="CDATASequence",t[t.InSpecialComment=20]="InSpecialComment",t[t.InCommentLike=21]="InCommentLike",t[t.BeforeSpecialS=22]="BeforeSpecialS",t[t.BeforeSpecialT=23]="BeforeSpecialT",t[t.SpecialStartSequence=24]="SpecialStartSequence",t[t.InSpecialTag=25]="InSpecialTag",t[t.InEntity=26]="InEntity"}(n||(n={})),function(t){t[t.NoValue=0]="NoValue",t[t.Unquoted=1]="Unquoted",t[t.Single=2]="Single",t[t.Double=3]="Double"}(r||(t.QuoteType=r={}));const c={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97]),XmpEnd:new Uint8Array([60,47,120,109,112])};return t.default=class{constructor({xmlMode:t=!1,decodeEntities:e=!0},i){this.cbs=i,this.state=n.Text,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=n.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.currentSequence=void 0,this.sequenceIndex=0,this.xmlMode=t,this.decodeEntities=e,this.entityDecoder=new s.EntityDecoder(t?s.xmlDecodeTree:s.htmlDecodeTree,((t,e)=>this.emitCodePoint(t,e)))}reset(){this.state=n.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=n.Text,this.currentSequence=void 0,this.running=!0,this.offset=0}write(t){this.offset+=this.buffer.length,this.buffer=t,this.parse()}end(){this.running&&this.finish()}pause(){this.running=!1}resume(){this.running=!0,this.index<this.buffer.length+this.offset&&this.parse()}stateText(t){t===a.Lt||!this.decodeEntities&&this.fastForwardTo(a.Lt)?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=n.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&t===a.Amp&&this.startEntity()}stateSpecialStartSequence(t){const e=this.sequenceIndex===this.currentSequence.length;if(e?o(t):(32|t)===this.currentSequence[this.sequenceIndex]){if(!e)return void this.sequenceIndex++}else this.isSpecial=!1;this.sequenceIndex=0,this.state=n.InTagName,this.stateInTagName(t)}stateInSpecialTag(t){if(this.sequenceIndex===this.currentSequence.length){if(t===a.Gt||h(t)){const e=this.index-this.currentSequence.length;if(this.sectionStart<e){const t=this.index;this.index=e,this.cbs.ontext(this.sectionStart,e),this.index=t}return this.isSpecial=!1,this.sectionStart=e+2,void this.stateInClosingTagName(t)}this.sequenceIndex=0}(32|t)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:0===this.sequenceIndex?this.currentSequence===c.TitleEnd?this.decodeEntities&&t===a.Amp&&this.startEntity():this.fastForwardTo(a.Lt)&&(this.sequenceIndex=1):this.sequenceIndex=Number(t===a.Lt)}stateCDATASequence(t){t===c.Cdata[this.sequenceIndex]?++this.sequenceIndex===c.Cdata.length&&(this.state=n.InCommentLike,this.currentSequence=c.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=n.InDeclaration,this.stateInDeclaration(t))}fastForwardTo(t){for(;++this.index<this.buffer.length+this.offset;)if(this.buffer.charCodeAt(this.index-this.offset)===t)return!0;return this.index=this.buffer.length+this.offset-1,!1}stateInCommentLike(t){t===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===c.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index,2):this.cbs.oncomment(this.sectionStart,this.index,2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=n.Text):0===this.sequenceIndex?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):t!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}isTagStartChar(t){return this.xmlMode?!o(t):function(t){return t>=a.LowerA&&t<=a.LowerZ||t>=a.UpperA&&t<=a.UpperZ}(t)}startSpecial(t,e){this.isSpecial=!0,this.currentSequence=t,this.sequenceIndex=e,this.state=n.SpecialStartSequence}stateBeforeTagName(t){if(t===a.ExclamationMark)this.state=n.BeforeDeclaration,this.sectionStart=this.index+1;else if(t===a.Questionmark)this.state=n.InProcessingInstruction,this.sectionStart=this.index+1;else if(this.isTagStartChar(t)){const e=32|t;this.sectionStart=this.index,this.xmlMode?this.state=n.InTagName:e===c.ScriptEnd[2]?this.state=n.BeforeSpecialS:e===c.TitleEnd[2]||e===c.XmpEnd[2]?this.state=n.BeforeSpecialT:this.state=n.InTagName}else t===a.Slash?this.state=n.BeforeClosingTagName:(this.state=n.Text,this.stateText(t))}stateInTagName(t){o(t)&&(this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=n.BeforeAttributeName,this.stateBeforeAttributeName(t))}stateBeforeClosingTagName(t){h(t)||(t===a.Gt?this.state=n.Text:(this.state=this.isTagStartChar(t)?n.InClosingTagName:n.InSpecialComment,this.sectionStart=this.index))}stateInClosingTagName(t){(t===a.Gt||h(t))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=n.AfterClosingTagName,this.stateAfterClosingTagName(t))}stateAfterClosingTagName(t){(t===a.Gt||this.fastForwardTo(a.Gt))&&(this.state=n.Text,this.sectionStart=this.index+1)}stateBeforeAttributeName(t){t===a.Gt?(this.cbs.onopentagend(this.index),this.isSpecial?(this.state=n.InSpecialTag,this.sequenceIndex=0):this.state=n.Text,this.sectionStart=this.index+1):t===a.Slash?this.state=n.InSelfClosingTag:h(t)||(this.state=n.InAttributeName,this.sectionStart=this.index)}stateInSelfClosingTag(t){t===a.Gt?(this.cbs.onselfclosingtag(this.index),this.state=n.Text,this.sectionStart=this.index+1,this.isSpecial=!1):h(t)||(this.state=n.BeforeAttributeName,this.stateBeforeAttributeName(t))}stateInAttributeName(t){(t===a.Eq||o(t))&&(this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=this.index,this.state=n.AfterAttributeName,this.stateAfterAttributeName(t))}stateAfterAttributeName(t){t===a.Eq?this.state=n.BeforeAttributeValue:t===a.Slash||t===a.Gt?(this.cbs.onattribend(r.NoValue,this.sectionStart),this.sectionStart=-1,this.state=n.BeforeAttributeName,this.stateBeforeAttributeName(t)):h(t)||(this.cbs.onattribend(r.NoValue,this.sectionStart),this.state=n.InAttributeName,this.sectionStart=this.index)}stateBeforeAttributeValue(t){t===a.DoubleQuote?(this.state=n.InAttributeValueDq,this.sectionStart=this.index+1):t===a.SingleQuote?(this.state=n.InAttributeValueSq,this.sectionStart=this.index+1):h(t)||(this.sectionStart=this.index,this.state=n.InAttributeValueNq,this.stateInAttributeValueNoQuotes(t))}handleInAttributeValue(t,e){t===e||!this.decodeEntities&&this.fastForwardTo(e)?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(e===a.DoubleQuote?r.Double:r.Single,this.index+1),this.state=n.BeforeAttributeName):this.decodeEntities&&t===a.Amp&&this.startEntity()}stateInAttributeValueDoubleQuotes(t){this.handleInAttributeValue(t,a.DoubleQuote)}stateInAttributeValueSingleQuotes(t){this.handleInAttributeValue(t,a.SingleQuote)}stateInAttributeValueNoQuotes(t){h(t)||t===a.Gt?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(r.Unquoted,this.index),this.state=n.BeforeAttributeName,this.stateBeforeAttributeName(t)):this.decodeEntities&&t===a.Amp&&this.startEntity()}stateBeforeDeclaration(t){t===a.OpeningSquareBracket?(this.state=n.CDATASequence,this.sequenceIndex=0):this.state=t===a.Dash?n.BeforeComment:n.InDeclaration}stateInDeclaration(t){(t===a.Gt||this.fastForwardTo(a.Gt))&&(this.cbs.ondeclaration(this.sectionStart,this.index),this.state=n.Text,this.sectionStart=this.index+1)}stateInProcessingInstruction(t){(t===a.Gt||this.fastForwardTo(a.Gt))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=n.Text,this.sectionStart=this.index+1)}stateBeforeComment(t){t===a.Dash?(this.state=n.InCommentLike,this.currentSequence=c.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=n.InDeclaration}stateInSpecialComment(t){(t===a.Gt||this.fastForwardTo(a.Gt))&&(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=n.Text,this.sectionStart=this.index+1)}stateBeforeSpecialS(t){const e=32|t;e===c.ScriptEnd[3]?this.startSpecial(c.ScriptEnd,4):e===c.StyleEnd[3]?this.startSpecial(c.StyleEnd,4):(this.state=n.InTagName,this.stateInTagName(t))}stateBeforeSpecialT(t){switch(32|t){case c.TitleEnd[3]:this.startSpecial(c.TitleEnd,4);break;case c.TextareaEnd[3]:this.startSpecial(c.TextareaEnd,4);break;case c.XmpEnd[3]:this.startSpecial(c.XmpEnd,4);break;default:this.state=n.InTagName,this.stateInTagName(t)}}startEntity(){this.baseState=this.state,this.state=n.InEntity,this.entityStart=this.index,this.entityDecoder.startEntity(this.xmlMode?s.DecodingMode.Strict:this.baseState===n.Text||this.baseState===n.InSpecialTag?s.DecodingMode.Legacy:s.DecodingMode.Attribute)}stateInEntity(){const t=this.entityDecoder.write(this.buffer,this.index-this.offset);t>=0?(this.state=this.baseState,0===t&&(this.index=this.entityStart)):this.index=this.offset+this.buffer.length-1}cleanup(){this.running&&this.sectionStart!==this.index&&(this.state===n.Text||this.state===n.InSpecialTag&&0===this.sequenceIndex?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):this.state!==n.InAttributeValueDq&&this.state!==n.InAttributeValueSq&&this.state!==n.InAttributeValueNq||(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}shouldContinue(){return this.index<this.buffer.length+this.offset&&this.running}parse(){for(;this.shouldContinue();){const t=this.buffer.charCodeAt(this.index-this.offset);switch(this.state){case n.Text:this.stateText(t);break;case n.SpecialStartSequence:this.stateSpecialStartSequence(t);break;case n.InSpecialTag:this.stateInSpecialTag(t);break;case n.CDATASequence:this.stateCDATASequence(t);break;case n.InAttributeValueDq:this.stateInAttributeValueDoubleQuotes(t);break;case n.InAttributeName:this.stateInAttributeName(t);break;case n.InCommentLike:this.stateInCommentLike(t);break;case n.InSpecialComment:this.stateInSpecialComment(t);break;case n.BeforeAttributeName:this.stateBeforeAttributeName(t);break;case n.InTagName:this.stateInTagName(t);break;case n.InClosingTagName:this.stateInClosingTagName(t);break;case n.BeforeTagName:this.stateBeforeTagName(t);break;case n.AfterAttributeName:this.stateAfterAttributeName(t);break;case n.InAttributeValueSq:this.stateInAttributeValueSingleQuotes(t);break;case n.BeforeAttributeValue:this.stateBeforeAttributeValue(t);break;case n.BeforeClosingTagName:this.stateBeforeClosingTagName(t);break;case n.AfterClosingTagName:this.stateAfterClosingTagName(t);break;case n.BeforeSpecialS:this.stateBeforeSpecialS(t);break;case n.BeforeSpecialT:this.stateBeforeSpecialT(t);break;case n.InAttributeValueNq:this.stateInAttributeValueNoQuotes(t);break;case n.InSelfClosingTag:this.stateInSelfClosingTag(t);break;case n.InDeclaration:this.stateInDeclaration(t);break;case n.BeforeDeclaration:this.stateBeforeDeclaration(t);break;case n.BeforeComment:this.stateBeforeComment(t);break;case n.InProcessingInstruction:this.stateInProcessingInstruction(t);break;case n.InEntity:this.stateInEntity()}this.index++}this.cleanup()}finish(){this.state===n.InEntity&&(this.entityDecoder.end(),this.state=this.baseState),this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){const t=this.buffer.length+this.offset;this.sectionStart>=t||(this.state===n.InCommentLike?this.currentSequence===c.CdataEnd?this.cbs.oncdata(this.sectionStart,t,0):this.cbs.oncomment(this.sectionStart,t,0):this.state===n.InTagName||this.state===n.BeforeAttributeName||this.state===n.BeforeAttributeValue||this.state===n.AfterAttributeName||this.state===n.InAttributeName||this.state===n.InAttributeValueSq||this.state===n.InAttributeValueDq||this.state===n.InAttributeValueNq||this.state===n.InClosingTagName||this.cbs.ontext(this.sectionStart,t))}emitCodePoint(t,e){this.baseState!==n.Text&&this.baseState!==n.InSpecialTag?(this.sectionStart<this.entityStart&&this.cbs.onattribdata(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+e,this.index=this.sectionStart-1,this.cbs.onattribentity(t)):(this.sectionStart<this.entityStart&&this.cbs.ontext(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+e,this.index=this.sectionStart-1,this.cbs.ontextentity(t,this.sectionStart))}},t}export{s as __require};
|
|
1
|
+
import{__exports as t}from"../../../../_virtual/Tokenizer.js";import{__require as e}from"../../../entities/dist/commonjs/decode.js";var i;function s(){if(i)return t;i=1,Object.defineProperty(t,"__esModule",{value:!0}),t.QuoteType=void 0;const s=e();var a,n,r;function h(t){return t===a.Space||t===a.NewLine||t===a.Tab||t===a.FormFeed||t===a.CarriageReturn}function o(t){return t===a.Slash||t===a.Gt||h(t)}!function(t){t[t.Tab=9]="Tab",t[t.NewLine=10]="NewLine",t[t.FormFeed=12]="FormFeed",t[t.CarriageReturn=13]="CarriageReturn",t[t.Space=32]="Space",t[t.ExclamationMark=33]="ExclamationMark",t[t.Number=35]="Number",t[t.Amp=38]="Amp",t[t.SingleQuote=39]="SingleQuote",t[t.DoubleQuote=34]="DoubleQuote",t[t.Dash=45]="Dash",t[t.Slash=47]="Slash",t[t.Zero=48]="Zero",t[t.Nine=57]="Nine",t[t.Semi=59]="Semi",t[t.Lt=60]="Lt",t[t.Eq=61]="Eq",t[t.Gt=62]="Gt",t[t.Questionmark=63]="Questionmark",t[t.UpperA=65]="UpperA",t[t.LowerA=97]="LowerA",t[t.UpperF=70]="UpperF",t[t.LowerF=102]="LowerF",t[t.UpperZ=90]="UpperZ",t[t.LowerZ=122]="LowerZ",t[t.LowerX=120]="LowerX",t[t.OpeningSquareBracket=91]="OpeningSquareBracket"}(a||(a={})),function(t){t[t.Text=1]="Text",t[t.BeforeTagName=2]="BeforeTagName",t[t.InTagName=3]="InTagName",t[t.InSelfClosingTag=4]="InSelfClosingTag",t[t.BeforeClosingTagName=5]="BeforeClosingTagName",t[t.InClosingTagName=6]="InClosingTagName",t[t.AfterClosingTagName=7]="AfterClosingTagName",t[t.BeforeAttributeName=8]="BeforeAttributeName",t[t.InAttributeName=9]="InAttributeName",t[t.AfterAttributeName=10]="AfterAttributeName",t[t.BeforeAttributeValue=11]="BeforeAttributeValue",t[t.InAttributeValueDq=12]="InAttributeValueDq",t[t.InAttributeValueSq=13]="InAttributeValueSq",t[t.InAttributeValueNq=14]="InAttributeValueNq",t[t.BeforeDeclaration=15]="BeforeDeclaration",t[t.InDeclaration=16]="InDeclaration",t[t.InProcessingInstruction=17]="InProcessingInstruction",t[t.BeforeComment=18]="BeforeComment",t[t.CDATASequence=19]="CDATASequence",t[t.InSpecialComment=20]="InSpecialComment",t[t.InCommentLike=21]="InCommentLike",t[t.BeforeSpecialS=22]="BeforeSpecialS",t[t.BeforeSpecialT=23]="BeforeSpecialT",t[t.SpecialStartSequence=24]="SpecialStartSequence",t[t.InSpecialTag=25]="InSpecialTag",t[t.InEntity=26]="InEntity"}(n||(n={})),function(t){t[t.NoValue=0]="NoValue",t[t.Unquoted=1]="Unquoted",t[t.Single=2]="Single",t[t.Double=3]="Double"}(r||(t.QuoteType=r={}));const c={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97]),XmpEnd:new Uint8Array([60,47,120,109,112])};return t.default=class{constructor({xmlMode:t=!1,decodeEntities:e=!0},i){this.cbs=i,this.state=n.Text,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=n.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.currentSequence=void 0,this.sequenceIndex=0,this.xmlMode=t,this.decodeEntities=e,this.entityDecoder=new s.EntityDecoder(t?s.xmlDecodeTree:s.htmlDecodeTree,(t,e)=>this.emitCodePoint(t,e))}reset(){this.state=n.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=n.Text,this.currentSequence=void 0,this.running=!0,this.offset=0}write(t){this.offset+=this.buffer.length,this.buffer=t,this.parse()}end(){this.running&&this.finish()}pause(){this.running=!1}resume(){this.running=!0,this.index<this.buffer.length+this.offset&&this.parse()}stateText(t){t===a.Lt||!this.decodeEntities&&this.fastForwardTo(a.Lt)?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=n.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&t===a.Amp&&this.startEntity()}stateSpecialStartSequence(t){const e=this.sequenceIndex===this.currentSequence.length;if(e?o(t):(32|t)===this.currentSequence[this.sequenceIndex]){if(!e)return void this.sequenceIndex++}else this.isSpecial=!1;this.sequenceIndex=0,this.state=n.InTagName,this.stateInTagName(t)}stateInSpecialTag(t){if(this.sequenceIndex===this.currentSequence.length){if(t===a.Gt||h(t)){const e=this.index-this.currentSequence.length;if(this.sectionStart<e){const t=this.index;this.index=e,this.cbs.ontext(this.sectionStart,e),this.index=t}return this.isSpecial=!1,this.sectionStart=e+2,void this.stateInClosingTagName(t)}this.sequenceIndex=0}(32|t)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:0===this.sequenceIndex?this.currentSequence===c.TitleEnd?this.decodeEntities&&t===a.Amp&&this.startEntity():this.fastForwardTo(a.Lt)&&(this.sequenceIndex=1):this.sequenceIndex=Number(t===a.Lt)}stateCDATASequence(t){t===c.Cdata[this.sequenceIndex]?++this.sequenceIndex===c.Cdata.length&&(this.state=n.InCommentLike,this.currentSequence=c.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=n.InDeclaration,this.stateInDeclaration(t))}fastForwardTo(t){for(;++this.index<this.buffer.length+this.offset;)if(this.buffer.charCodeAt(this.index-this.offset)===t)return!0;return this.index=this.buffer.length+this.offset-1,!1}stateInCommentLike(t){t===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===c.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index,2):this.cbs.oncomment(this.sectionStart,this.index,2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=n.Text):0===this.sequenceIndex?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):t!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}isTagStartChar(t){return this.xmlMode?!o(t):function(t){return t>=a.LowerA&&t<=a.LowerZ||t>=a.UpperA&&t<=a.UpperZ}(t)}startSpecial(t,e){this.isSpecial=!0,this.currentSequence=t,this.sequenceIndex=e,this.state=n.SpecialStartSequence}stateBeforeTagName(t){if(t===a.ExclamationMark)this.state=n.BeforeDeclaration,this.sectionStart=this.index+1;else if(t===a.Questionmark)this.state=n.InProcessingInstruction,this.sectionStart=this.index+1;else if(this.isTagStartChar(t)){const e=32|t;this.sectionStart=this.index,this.xmlMode?this.state=n.InTagName:e===c.ScriptEnd[2]?this.state=n.BeforeSpecialS:e===c.TitleEnd[2]||e===c.XmpEnd[2]?this.state=n.BeforeSpecialT:this.state=n.InTagName}else t===a.Slash?this.state=n.BeforeClosingTagName:(this.state=n.Text,this.stateText(t))}stateInTagName(t){o(t)&&(this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=n.BeforeAttributeName,this.stateBeforeAttributeName(t))}stateBeforeClosingTagName(t){h(t)||(t===a.Gt?this.state=n.Text:(this.state=this.isTagStartChar(t)?n.InClosingTagName:n.InSpecialComment,this.sectionStart=this.index))}stateInClosingTagName(t){(t===a.Gt||h(t))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=n.AfterClosingTagName,this.stateAfterClosingTagName(t))}stateAfterClosingTagName(t){(t===a.Gt||this.fastForwardTo(a.Gt))&&(this.state=n.Text,this.sectionStart=this.index+1)}stateBeforeAttributeName(t){t===a.Gt?(this.cbs.onopentagend(this.index),this.isSpecial?(this.state=n.InSpecialTag,this.sequenceIndex=0):this.state=n.Text,this.sectionStart=this.index+1):t===a.Slash?this.state=n.InSelfClosingTag:h(t)||(this.state=n.InAttributeName,this.sectionStart=this.index)}stateInSelfClosingTag(t){t===a.Gt?(this.cbs.onselfclosingtag(this.index),this.state=n.Text,this.sectionStart=this.index+1,this.isSpecial=!1):h(t)||(this.state=n.BeforeAttributeName,this.stateBeforeAttributeName(t))}stateInAttributeName(t){(t===a.Eq||o(t))&&(this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=this.index,this.state=n.AfterAttributeName,this.stateAfterAttributeName(t))}stateAfterAttributeName(t){t===a.Eq?this.state=n.BeforeAttributeValue:t===a.Slash||t===a.Gt?(this.cbs.onattribend(r.NoValue,this.sectionStart),this.sectionStart=-1,this.state=n.BeforeAttributeName,this.stateBeforeAttributeName(t)):h(t)||(this.cbs.onattribend(r.NoValue,this.sectionStart),this.state=n.InAttributeName,this.sectionStart=this.index)}stateBeforeAttributeValue(t){t===a.DoubleQuote?(this.state=n.InAttributeValueDq,this.sectionStart=this.index+1):t===a.SingleQuote?(this.state=n.InAttributeValueSq,this.sectionStart=this.index+1):h(t)||(this.sectionStart=this.index,this.state=n.InAttributeValueNq,this.stateInAttributeValueNoQuotes(t))}handleInAttributeValue(t,e){t===e||!this.decodeEntities&&this.fastForwardTo(e)?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(e===a.DoubleQuote?r.Double:r.Single,this.index+1),this.state=n.BeforeAttributeName):this.decodeEntities&&t===a.Amp&&this.startEntity()}stateInAttributeValueDoubleQuotes(t){this.handleInAttributeValue(t,a.DoubleQuote)}stateInAttributeValueSingleQuotes(t){this.handleInAttributeValue(t,a.SingleQuote)}stateInAttributeValueNoQuotes(t){h(t)||t===a.Gt?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(r.Unquoted,this.index),this.state=n.BeforeAttributeName,this.stateBeforeAttributeName(t)):this.decodeEntities&&t===a.Amp&&this.startEntity()}stateBeforeDeclaration(t){t===a.OpeningSquareBracket?(this.state=n.CDATASequence,this.sequenceIndex=0):this.state=t===a.Dash?n.BeforeComment:n.InDeclaration}stateInDeclaration(t){(t===a.Gt||this.fastForwardTo(a.Gt))&&(this.cbs.ondeclaration(this.sectionStart,this.index),this.state=n.Text,this.sectionStart=this.index+1)}stateInProcessingInstruction(t){(t===a.Gt||this.fastForwardTo(a.Gt))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=n.Text,this.sectionStart=this.index+1)}stateBeforeComment(t){t===a.Dash?(this.state=n.InCommentLike,this.currentSequence=c.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=n.InDeclaration}stateInSpecialComment(t){(t===a.Gt||this.fastForwardTo(a.Gt))&&(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=n.Text,this.sectionStart=this.index+1)}stateBeforeSpecialS(t){const e=32|t;e===c.ScriptEnd[3]?this.startSpecial(c.ScriptEnd,4):e===c.StyleEnd[3]?this.startSpecial(c.StyleEnd,4):(this.state=n.InTagName,this.stateInTagName(t))}stateBeforeSpecialT(t){switch(32|t){case c.TitleEnd[3]:this.startSpecial(c.TitleEnd,4);break;case c.TextareaEnd[3]:this.startSpecial(c.TextareaEnd,4);break;case c.XmpEnd[3]:this.startSpecial(c.XmpEnd,4);break;default:this.state=n.InTagName,this.stateInTagName(t)}}startEntity(){this.baseState=this.state,this.state=n.InEntity,this.entityStart=this.index,this.entityDecoder.startEntity(this.xmlMode?s.DecodingMode.Strict:this.baseState===n.Text||this.baseState===n.InSpecialTag?s.DecodingMode.Legacy:s.DecodingMode.Attribute)}stateInEntity(){const t=this.entityDecoder.write(this.buffer,this.index-this.offset);t>=0?(this.state=this.baseState,0===t&&(this.index=this.entityStart)):this.index=this.offset+this.buffer.length-1}cleanup(){this.running&&this.sectionStart!==this.index&&(this.state===n.Text||this.state===n.InSpecialTag&&0===this.sequenceIndex?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):this.state!==n.InAttributeValueDq&&this.state!==n.InAttributeValueSq&&this.state!==n.InAttributeValueNq||(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}shouldContinue(){return this.index<this.buffer.length+this.offset&&this.running}parse(){for(;this.shouldContinue();){const t=this.buffer.charCodeAt(this.index-this.offset);switch(this.state){case n.Text:this.stateText(t);break;case n.SpecialStartSequence:this.stateSpecialStartSequence(t);break;case n.InSpecialTag:this.stateInSpecialTag(t);break;case n.CDATASequence:this.stateCDATASequence(t);break;case n.InAttributeValueDq:this.stateInAttributeValueDoubleQuotes(t);break;case n.InAttributeName:this.stateInAttributeName(t);break;case n.InCommentLike:this.stateInCommentLike(t);break;case n.InSpecialComment:this.stateInSpecialComment(t);break;case n.BeforeAttributeName:this.stateBeforeAttributeName(t);break;case n.InTagName:this.stateInTagName(t);break;case n.InClosingTagName:this.stateInClosingTagName(t);break;case n.BeforeTagName:this.stateBeforeTagName(t);break;case n.AfterAttributeName:this.stateAfterAttributeName(t);break;case n.InAttributeValueSq:this.stateInAttributeValueSingleQuotes(t);break;case n.BeforeAttributeValue:this.stateBeforeAttributeValue(t);break;case n.BeforeClosingTagName:this.stateBeforeClosingTagName(t);break;case n.AfterClosingTagName:this.stateAfterClosingTagName(t);break;case n.BeforeSpecialS:this.stateBeforeSpecialS(t);break;case n.BeforeSpecialT:this.stateBeforeSpecialT(t);break;case n.InAttributeValueNq:this.stateInAttributeValueNoQuotes(t);break;case n.InSelfClosingTag:this.stateInSelfClosingTag(t);break;case n.InDeclaration:this.stateInDeclaration(t);break;case n.BeforeDeclaration:this.stateBeforeDeclaration(t);break;case n.BeforeComment:this.stateBeforeComment(t);break;case n.InProcessingInstruction:this.stateInProcessingInstruction(t);break;case n.InEntity:this.stateInEntity()}this.index++}this.cleanup()}finish(){this.state===n.InEntity&&(this.entityDecoder.end(),this.state=this.baseState),this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){const t=this.buffer.length+this.offset;this.sectionStart>=t||(this.state===n.InCommentLike?this.currentSequence===c.CdataEnd?this.cbs.oncdata(this.sectionStart,t,0):this.cbs.oncomment(this.sectionStart,t,0):this.state===n.InTagName||this.state===n.BeforeAttributeName||this.state===n.BeforeAttributeValue||this.state===n.AfterAttributeName||this.state===n.InAttributeName||this.state===n.InAttributeValueSq||this.state===n.InAttributeValueDq||this.state===n.InAttributeValueNq||this.state===n.InClosingTagName||this.cbs.ontext(this.sectionStart,t))}emitCodePoint(t,e){this.baseState!==n.Text&&this.baseState!==n.InSpecialTag?(this.sectionStart<this.entityStart&&this.cbs.onattribdata(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+e,this.index=this.sectionStart-1,this.cbs.onattribentity(t)):(this.sectionStart<this.entityStart&&this.cbs.ontext(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+e,this.index=this.sectionStart-1,this.cbs.ontextentity(t,this.sectionStart))}},t}export{s as __require};
|
|
2
2
|
//# sourceMappingURL=Tokenizer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tokenizer.js","sources":["../../../../../node_modules/htmlparser2/dist/commonjs/Tokenizer.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.QuoteType = void 0;\nconst decode_1 = require(\"entities/decode\");\nvar CharCodes;\n(function (CharCodes) {\n CharCodes[CharCodes[\"Tab\"] = 9] = \"Tab\";\n CharCodes[CharCodes[\"NewLine\"] = 10] = \"NewLine\";\n CharCodes[CharCodes[\"FormFeed\"] = 12] = \"FormFeed\";\n CharCodes[CharCodes[\"CarriageReturn\"] = 13] = \"CarriageReturn\";\n CharCodes[CharCodes[\"Space\"] = 32] = \"Space\";\n CharCodes[CharCodes[\"ExclamationMark\"] = 33] = \"ExclamationMark\";\n CharCodes[CharCodes[\"Number\"] = 35] = \"Number\";\n CharCodes[CharCodes[\"Amp\"] = 38] = \"Amp\";\n CharCodes[CharCodes[\"SingleQuote\"] = 39] = \"SingleQuote\";\n CharCodes[CharCodes[\"DoubleQuote\"] = 34] = \"DoubleQuote\";\n CharCodes[CharCodes[\"Dash\"] = 45] = \"Dash\";\n CharCodes[CharCodes[\"Slash\"] = 47] = \"Slash\";\n CharCodes[CharCodes[\"Zero\"] = 48] = \"Zero\";\n CharCodes[CharCodes[\"Nine\"] = 57] = \"Nine\";\n CharCodes[CharCodes[\"Semi\"] = 59] = \"Semi\";\n CharCodes[CharCodes[\"Lt\"] = 60] = \"Lt\";\n CharCodes[CharCodes[\"Eq\"] = 61] = \"Eq\";\n CharCodes[CharCodes[\"Gt\"] = 62] = \"Gt\";\n CharCodes[CharCodes[\"Questionmark\"] = 63] = \"Questionmark\";\n CharCodes[CharCodes[\"UpperA\"] = 65] = \"UpperA\";\n CharCodes[CharCodes[\"LowerA\"] = 97] = \"LowerA\";\n CharCodes[CharCodes[\"UpperF\"] = 70] = \"UpperF\";\n CharCodes[CharCodes[\"LowerF\"] = 102] = \"LowerF\";\n CharCodes[CharCodes[\"UpperZ\"] = 90] = \"UpperZ\";\n CharCodes[CharCodes[\"LowerZ\"] = 122] = \"LowerZ\";\n CharCodes[CharCodes[\"LowerX\"] = 120] = \"LowerX\";\n CharCodes[CharCodes[\"OpeningSquareBracket\"] = 91] = \"OpeningSquareBracket\";\n})(CharCodes || (CharCodes = {}));\n/** All the states the tokenizer can be in. */\nvar State;\n(function (State) {\n State[State[\"Text\"] = 1] = \"Text\";\n State[State[\"BeforeTagName\"] = 2] = \"BeforeTagName\";\n State[State[\"InTagName\"] = 3] = \"InTagName\";\n State[State[\"InSelfClosingTag\"] = 4] = \"InSelfClosingTag\";\n State[State[\"BeforeClosingTagName\"] = 5] = \"BeforeClosingTagName\";\n State[State[\"InClosingTagName\"] = 6] = \"InClosingTagName\";\n State[State[\"AfterClosingTagName\"] = 7] = \"AfterClosingTagName\";\n // Attributes\n State[State[\"BeforeAttributeName\"] = 8] = \"BeforeAttributeName\";\n State[State[\"InAttributeName\"] = 9] = \"InAttributeName\";\n State[State[\"AfterAttributeName\"] = 10] = \"AfterAttributeName\";\n State[State[\"BeforeAttributeValue\"] = 11] = \"BeforeAttributeValue\";\n State[State[\"InAttributeValueDq\"] = 12] = \"InAttributeValueDq\";\n State[State[\"InAttributeValueSq\"] = 13] = \"InAttributeValueSq\";\n State[State[\"InAttributeValueNq\"] = 14] = \"InAttributeValueNq\";\n // Declarations\n State[State[\"BeforeDeclaration\"] = 15] = \"BeforeDeclaration\";\n State[State[\"InDeclaration\"] = 16] = \"InDeclaration\";\n // Processing instructions\n State[State[\"InProcessingInstruction\"] = 17] = \"InProcessingInstruction\";\n // Comments & CDATA\n State[State[\"BeforeComment\"] = 18] = \"BeforeComment\";\n State[State[\"CDATASequence\"] = 19] = \"CDATASequence\";\n State[State[\"InSpecialComment\"] = 20] = \"InSpecialComment\";\n State[State[\"InCommentLike\"] = 21] = \"InCommentLike\";\n // Special tags\n State[State[\"BeforeSpecialS\"] = 22] = \"BeforeSpecialS\";\n State[State[\"BeforeSpecialT\"] = 23] = \"BeforeSpecialT\";\n State[State[\"SpecialStartSequence\"] = 24] = \"SpecialStartSequence\";\n State[State[\"InSpecialTag\"] = 25] = \"InSpecialTag\";\n State[State[\"InEntity\"] = 26] = \"InEntity\";\n})(State || (State = {}));\nfunction isWhitespace(c) {\n return (c === CharCodes.Space ||\n c === CharCodes.NewLine ||\n c === CharCodes.Tab ||\n c === CharCodes.FormFeed ||\n c === CharCodes.CarriageReturn);\n}\nfunction isEndOfTagSection(c) {\n return c === CharCodes.Slash || c === CharCodes.Gt || isWhitespace(c);\n}\nfunction isASCIIAlpha(c) {\n return ((c >= CharCodes.LowerA && c <= CharCodes.LowerZ) ||\n (c >= CharCodes.UpperA && c <= CharCodes.UpperZ));\n}\nvar QuoteType;\n(function (QuoteType) {\n QuoteType[QuoteType[\"NoValue\"] = 0] = \"NoValue\";\n QuoteType[QuoteType[\"Unquoted\"] = 1] = \"Unquoted\";\n QuoteType[QuoteType[\"Single\"] = 2] = \"Single\";\n QuoteType[QuoteType[\"Double\"] = 3] = \"Double\";\n})(QuoteType || (exports.QuoteType = QuoteType = {}));\n/**\n * Sequences used to match longer strings.\n *\n * We don't have `Script`, `Style`, or `Title` here. Instead, we re-use the *End\n * sequences with an increased offset.\n */\nconst Sequences = {\n Cdata: new Uint8Array([0x43, 0x44, 0x41, 0x54, 0x41, 0x5b]), // CDATA[\n CdataEnd: new Uint8Array([0x5d, 0x5d, 0x3e]), // ]]>\n CommentEnd: new Uint8Array([0x2d, 0x2d, 0x3e]), // `-->`\n ScriptEnd: new Uint8Array([0x3c, 0x2f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74]), // `</script`\n StyleEnd: new Uint8Array([0x3c, 0x2f, 0x73, 0x74, 0x79, 0x6c, 0x65]), // `</style`\n TitleEnd: new Uint8Array([0x3c, 0x2f, 0x74, 0x69, 0x74, 0x6c, 0x65]), // `</title`\n TextareaEnd: new Uint8Array([\n 0x3c, 0x2f, 0x74, 0x65, 0x78, 0x74, 0x61, 0x72, 0x65, 0x61,\n ]), // `</textarea`\n XmpEnd: new Uint8Array([0x3c, 0x2f, 0x78, 0x6d, 0x70]), // `</xmp`\n};\nclass Tokenizer {\n constructor({ xmlMode = false, decodeEntities = true, }, cbs) {\n this.cbs = cbs;\n /** The current state the tokenizer is in. */\n this.state = State.Text;\n /** The read buffer. */\n this.buffer = \"\";\n /** The beginning of the section that is currently being read. */\n this.sectionStart = 0;\n /** The index within the buffer that we are currently looking at. */\n this.index = 0;\n /** The start of the last entity. */\n this.entityStart = 0;\n /** Some behavior, eg. when decoding entities, is done while we are in another state. This keeps track of the other state type. */\n this.baseState = State.Text;\n /** For special parsing behavior inside of script and style tags. */\n this.isSpecial = false;\n /** Indicates whether the tokenizer has been paused. */\n this.running = true;\n /** The offset of the current buffer. */\n this.offset = 0;\n this.currentSequence = undefined;\n this.sequenceIndex = 0;\n this.xmlMode = xmlMode;\n this.decodeEntities = decodeEntities;\n this.entityDecoder = new decode_1.EntityDecoder(xmlMode ? decode_1.xmlDecodeTree : decode_1.htmlDecodeTree, (cp, consumed) => this.emitCodePoint(cp, consumed));\n }\n reset() {\n this.state = State.Text;\n this.buffer = \"\";\n this.sectionStart = 0;\n this.index = 0;\n this.baseState = State.Text;\n this.currentSequence = undefined;\n this.running = true;\n this.offset = 0;\n }\n write(chunk) {\n this.offset += this.buffer.length;\n this.buffer = chunk;\n this.parse();\n }\n end() {\n if (this.running)\n this.finish();\n }\n pause() {\n this.running = false;\n }\n resume() {\n this.running = true;\n if (this.index < this.buffer.length + this.offset) {\n this.parse();\n }\n }\n stateText(c) {\n if (c === CharCodes.Lt ||\n (!this.decodeEntities && this.fastForwardTo(CharCodes.Lt))) {\n if (this.index > this.sectionStart) {\n this.cbs.ontext(this.sectionStart, this.index);\n }\n this.state = State.BeforeTagName;\n this.sectionStart = this.index;\n }\n else if (this.decodeEntities && c === CharCodes.Amp) {\n this.startEntity();\n }\n }\n stateSpecialStartSequence(c) {\n const isEnd = this.sequenceIndex === this.currentSequence.length;\n const isMatch = isEnd\n ? // If we are at the end of the sequence, make sure the tag name has ended\n isEndOfTagSection(c)\n : // Otherwise, do a case-insensitive comparison\n (c | 0x20) === this.currentSequence[this.sequenceIndex];\n if (!isMatch) {\n this.isSpecial = false;\n }\n else if (!isEnd) {\n this.sequenceIndex++;\n return;\n }\n this.sequenceIndex = 0;\n this.state = State.InTagName;\n this.stateInTagName(c);\n }\n /** Look for an end tag. For <title> tags, also decode entities. */\n stateInSpecialTag(c) {\n if (this.sequenceIndex === this.currentSequence.length) {\n if (c === CharCodes.Gt || isWhitespace(c)) {\n const endOfText = this.index - this.currentSequence.length;\n if (this.sectionStart < endOfText) {\n // Spoof the index so that reported locations match up.\n const actualIndex = this.index;\n this.index = endOfText;\n this.cbs.ontext(this.sectionStart, endOfText);\n this.index = actualIndex;\n }\n this.isSpecial = false;\n this.sectionStart = endOfText + 2; // Skip over the `</`\n this.stateInClosingTagName(c);\n return; // We are done; skip the rest of the function.\n }\n this.sequenceIndex = 0;\n }\n if ((c | 0x20) === this.currentSequence[this.sequenceIndex]) {\n this.sequenceIndex += 1;\n }\n else if (this.sequenceIndex === 0) {\n if (this.currentSequence === Sequences.TitleEnd) {\n // We have to parse entities in <title> tags.\n if (this.decodeEntities && c === CharCodes.Amp) {\n this.startEntity();\n }\n }\n else if (this.fastForwardTo(CharCodes.Lt)) {\n // Outside of <title> tags, we can fast-forward.\n this.sequenceIndex = 1;\n }\n }\n else {\n // If we see a `<`, set the sequence index to 1; useful for eg. `<</script>`.\n this.sequenceIndex = Number(c === CharCodes.Lt);\n }\n }\n stateCDATASequence(c) {\n if (c === Sequences.Cdata[this.sequenceIndex]) {\n if (++this.sequenceIndex === Sequences.Cdata.length) {\n this.state = State.InCommentLike;\n this.currentSequence = Sequences.CdataEnd;\n this.sequenceIndex = 0;\n this.sectionStart = this.index + 1;\n }\n }\n else {\n this.sequenceIndex = 0;\n this.state = State.InDeclaration;\n this.stateInDeclaration(c); // Reconsume the character\n }\n }\n /**\n * When we wait for one specific character, we can speed things up\n * by skipping through the buffer until we find it.\n *\n * @returns Whether the character was found.\n */\n fastForwardTo(c) {\n while (++this.index < this.buffer.length + this.offset) {\n if (this.buffer.charCodeAt(this.index - this.offset) === c) {\n return true;\n }\n }\n /*\n * We increment the index at the end of the `parse` loop,\n * so set it to `buffer.length - 1` here.\n *\n * TODO: Refactor `parse` to increment index before calling states.\n */\n this.index = this.buffer.length + this.offset - 1;\n return false;\n }\n /**\n * Comments and CDATA end with `-->` and `]]>`.\n *\n * Their common qualities are:\n * - Their end sequences have a distinct character they start with.\n * - That character is then repeated, so we have to check multiple repeats.\n * - All characters but the start character of the sequence can be skipped.\n */\n stateInCommentLike(c) {\n if (c === this.currentSequence[this.sequenceIndex]) {\n if (++this.sequenceIndex === this.currentSequence.length) {\n if (this.currentSequence === Sequences.CdataEnd) {\n this.cbs.oncdata(this.sectionStart, this.index, 2);\n }\n else {\n this.cbs.oncomment(this.sectionStart, this.index, 2);\n }\n this.sequenceIndex = 0;\n this.sectionStart = this.index + 1;\n this.state = State.Text;\n }\n }\n else if (this.sequenceIndex === 0) {\n // Fast-forward to the first character of the sequence\n if (this.fastForwardTo(this.currentSequence[0])) {\n this.sequenceIndex = 1;\n }\n }\n else if (c !== this.currentSequence[this.sequenceIndex - 1]) {\n // Allow long sequences, eg. --->, ]]]>\n this.sequenceIndex = 0;\n }\n }\n /**\n * HTML only allows ASCII alpha characters (a-z and A-Z) at the beginning of a tag name.\n *\n * XML allows a lot more characters here (@see https://www.w3.org/TR/REC-xml/#NT-NameStartChar).\n * We allow anything that wouldn't end the tag.\n */\n isTagStartChar(c) {\n return this.xmlMode ? !isEndOfTagSection(c) : isASCIIAlpha(c);\n }\n startSpecial(sequence, offset) {\n this.isSpecial = true;\n this.currentSequence = sequence;\n this.sequenceIndex = offset;\n this.state = State.SpecialStartSequence;\n }\n stateBeforeTagName(c) {\n if (c === CharCodes.ExclamationMark) {\n this.state = State.BeforeDeclaration;\n this.sectionStart = this.index + 1;\n }\n else if (c === CharCodes.Questionmark) {\n this.state = State.InProcessingInstruction;\n this.sectionStart = this.index + 1;\n }\n else if (this.isTagStartChar(c)) {\n const lower = c | 0x20;\n this.sectionStart = this.index;\n if (this.xmlMode) {\n this.state = State.InTagName;\n }\n else if (lower === Sequences.ScriptEnd[2]) {\n this.state = State.BeforeSpecialS;\n }\n else if (lower === Sequences.TitleEnd[2] ||\n lower === Sequences.XmpEnd[2]) {\n this.state = State.BeforeSpecialT;\n }\n else {\n this.state = State.InTagName;\n }\n }\n else if (c === CharCodes.Slash) {\n this.state = State.BeforeClosingTagName;\n }\n else {\n this.state = State.Text;\n this.stateText(c);\n }\n }\n stateInTagName(c) {\n if (isEndOfTagSection(c)) {\n this.cbs.onopentagname(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n }\n stateBeforeClosingTagName(c) {\n if (isWhitespace(c)) {\n // Ignore\n }\n else if (c === CharCodes.Gt) {\n this.state = State.Text;\n }\n else {\n this.state = this.isTagStartChar(c)\n ? State.InClosingTagName\n : State.InSpecialComment;\n this.sectionStart = this.index;\n }\n }\n stateInClosingTagName(c) {\n if (c === CharCodes.Gt || isWhitespace(c)) {\n this.cbs.onclosetag(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.state = State.AfterClosingTagName;\n this.stateAfterClosingTagName(c);\n }\n }\n stateAfterClosingTagName(c) {\n // Skip everything until \">\"\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n }\n stateBeforeAttributeName(c) {\n if (c === CharCodes.Gt) {\n this.cbs.onopentagend(this.index);\n if (this.isSpecial) {\n this.state = State.InSpecialTag;\n this.sequenceIndex = 0;\n }\n else {\n this.state = State.Text;\n }\n this.sectionStart = this.index + 1;\n }\n else if (c === CharCodes.Slash) {\n this.state = State.InSelfClosingTag;\n }\n else if (!isWhitespace(c)) {\n this.state = State.InAttributeName;\n this.sectionStart = this.index;\n }\n }\n stateInSelfClosingTag(c) {\n if (c === CharCodes.Gt) {\n this.cbs.onselfclosingtag(this.index);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n this.isSpecial = false; // Reset special state, in case of self-closing special tags\n }\n else if (!isWhitespace(c)) {\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n }\n stateInAttributeName(c) {\n if (c === CharCodes.Eq || isEndOfTagSection(c)) {\n this.cbs.onattribname(this.sectionStart, this.index);\n this.sectionStart = this.index;\n this.state = State.AfterAttributeName;\n this.stateAfterAttributeName(c);\n }\n }\n stateAfterAttributeName(c) {\n if (c === CharCodes.Eq) {\n this.state = State.BeforeAttributeValue;\n }\n else if (c === CharCodes.Slash || c === CharCodes.Gt) {\n this.cbs.onattribend(QuoteType.NoValue, this.sectionStart);\n this.sectionStart = -1;\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n else if (!isWhitespace(c)) {\n this.cbs.onattribend(QuoteType.NoValue, this.sectionStart);\n this.state = State.InAttributeName;\n this.sectionStart = this.index;\n }\n }\n stateBeforeAttributeValue(c) {\n if (c === CharCodes.DoubleQuote) {\n this.state = State.InAttributeValueDq;\n this.sectionStart = this.index + 1;\n }\n else if (c === CharCodes.SingleQuote) {\n this.state = State.InAttributeValueSq;\n this.sectionStart = this.index + 1;\n }\n else if (!isWhitespace(c)) {\n this.sectionStart = this.index;\n this.state = State.InAttributeValueNq;\n this.stateInAttributeValueNoQuotes(c); // Reconsume token\n }\n }\n handleInAttributeValue(c, quote) {\n if (c === quote ||\n (!this.decodeEntities && this.fastForwardTo(quote))) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.cbs.onattribend(quote === CharCodes.DoubleQuote\n ? QuoteType.Double\n : QuoteType.Single, this.index + 1);\n this.state = State.BeforeAttributeName;\n }\n else if (this.decodeEntities && c === CharCodes.Amp) {\n this.startEntity();\n }\n }\n stateInAttributeValueDoubleQuotes(c) {\n this.handleInAttributeValue(c, CharCodes.DoubleQuote);\n }\n stateInAttributeValueSingleQuotes(c) {\n this.handleInAttributeValue(c, CharCodes.SingleQuote);\n }\n stateInAttributeValueNoQuotes(c) {\n if (isWhitespace(c) || c === CharCodes.Gt) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.cbs.onattribend(QuoteType.Unquoted, this.index);\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n else if (this.decodeEntities && c === CharCodes.Amp) {\n this.startEntity();\n }\n }\n stateBeforeDeclaration(c) {\n if (c === CharCodes.OpeningSquareBracket) {\n this.state = State.CDATASequence;\n this.sequenceIndex = 0;\n }\n else {\n this.state =\n c === CharCodes.Dash\n ? State.BeforeComment\n : State.InDeclaration;\n }\n }\n stateInDeclaration(c) {\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.cbs.ondeclaration(this.sectionStart, this.index);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n }\n stateInProcessingInstruction(c) {\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.cbs.onprocessinginstruction(this.sectionStart, this.index);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n }\n stateBeforeComment(c) {\n if (c === CharCodes.Dash) {\n this.state = State.InCommentLike;\n this.currentSequence = Sequences.CommentEnd;\n // Allow short comments (eg. <!-->)\n this.sequenceIndex = 2;\n this.sectionStart = this.index + 1;\n }\n else {\n this.state = State.InDeclaration;\n }\n }\n stateInSpecialComment(c) {\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.cbs.oncomment(this.sectionStart, this.index, 0);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n }\n stateBeforeSpecialS(c) {\n const lower = c | 0x20;\n if (lower === Sequences.ScriptEnd[3]) {\n this.startSpecial(Sequences.ScriptEnd, 4);\n }\n else if (lower === Sequences.StyleEnd[3]) {\n this.startSpecial(Sequences.StyleEnd, 4);\n }\n else {\n this.state = State.InTagName;\n this.stateInTagName(c); // Consume the token again\n }\n }\n stateBeforeSpecialT(c) {\n const lower = c | 0x20;\n switch (lower) {\n case Sequences.TitleEnd[3]: {\n this.startSpecial(Sequences.TitleEnd, 4);\n break;\n }\n case Sequences.TextareaEnd[3]: {\n this.startSpecial(Sequences.TextareaEnd, 4);\n break;\n }\n case Sequences.XmpEnd[3]: {\n this.startSpecial(Sequences.XmpEnd, 4);\n break;\n }\n default: {\n this.state = State.InTagName;\n this.stateInTagName(c); // Consume the token again\n }\n }\n }\n startEntity() {\n this.baseState = this.state;\n this.state = State.InEntity;\n this.entityStart = this.index;\n this.entityDecoder.startEntity(this.xmlMode\n ? decode_1.DecodingMode.Strict\n : this.baseState === State.Text ||\n this.baseState === State.InSpecialTag\n ? decode_1.DecodingMode.Legacy\n : decode_1.DecodingMode.Attribute);\n }\n stateInEntity() {\n const length = this.entityDecoder.write(this.buffer, this.index - this.offset);\n // If `length` is positive, we are done with the entity.\n if (length >= 0) {\n this.state = this.baseState;\n if (length === 0) {\n this.index = this.entityStart;\n }\n }\n else {\n // Mark buffer as consumed.\n this.index = this.offset + this.buffer.length - 1;\n }\n }\n /**\n * Remove data that has already been consumed from the buffer.\n */\n cleanup() {\n // If we are inside of text or attributes, emit what we already have.\n if (this.running && this.sectionStart !== this.index) {\n if (this.state === State.Text ||\n (this.state === State.InSpecialTag && this.sequenceIndex === 0)) {\n this.cbs.ontext(this.sectionStart, this.index);\n this.sectionStart = this.index;\n }\n else if (this.state === State.InAttributeValueDq ||\n this.state === State.InAttributeValueSq ||\n this.state === State.InAttributeValueNq) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = this.index;\n }\n }\n }\n shouldContinue() {\n return this.index < this.buffer.length + this.offset && this.running;\n }\n /**\n * Iterates through the buffer, calling the function corresponding to the current state.\n *\n * States that are more likely to be hit are higher up, as a performance improvement.\n */\n parse() {\n while (this.shouldContinue()) {\n const c = this.buffer.charCodeAt(this.index - this.offset);\n switch (this.state) {\n case State.Text: {\n this.stateText(c);\n break;\n }\n case State.SpecialStartSequence: {\n this.stateSpecialStartSequence(c);\n break;\n }\n case State.InSpecialTag: {\n this.stateInSpecialTag(c);\n break;\n }\n case State.CDATASequence: {\n this.stateCDATASequence(c);\n break;\n }\n case State.InAttributeValueDq: {\n this.stateInAttributeValueDoubleQuotes(c);\n break;\n }\n case State.InAttributeName: {\n this.stateInAttributeName(c);\n break;\n }\n case State.InCommentLike: {\n this.stateInCommentLike(c);\n break;\n }\n case State.InSpecialComment: {\n this.stateInSpecialComment(c);\n break;\n }\n case State.BeforeAttributeName: {\n this.stateBeforeAttributeName(c);\n break;\n }\n case State.InTagName: {\n this.stateInTagName(c);\n break;\n }\n case State.InClosingTagName: {\n this.stateInClosingTagName(c);\n break;\n }\n case State.BeforeTagName: {\n this.stateBeforeTagName(c);\n break;\n }\n case State.AfterAttributeName: {\n this.stateAfterAttributeName(c);\n break;\n }\n case State.InAttributeValueSq: {\n this.stateInAttributeValueSingleQuotes(c);\n break;\n }\n case State.BeforeAttributeValue: {\n this.stateBeforeAttributeValue(c);\n break;\n }\n case State.BeforeClosingTagName: {\n this.stateBeforeClosingTagName(c);\n break;\n }\n case State.AfterClosingTagName: {\n this.stateAfterClosingTagName(c);\n break;\n }\n case State.BeforeSpecialS: {\n this.stateBeforeSpecialS(c);\n break;\n }\n case State.BeforeSpecialT: {\n this.stateBeforeSpecialT(c);\n break;\n }\n case State.InAttributeValueNq: {\n this.stateInAttributeValueNoQuotes(c);\n break;\n }\n case State.InSelfClosingTag: {\n this.stateInSelfClosingTag(c);\n break;\n }\n case State.InDeclaration: {\n this.stateInDeclaration(c);\n break;\n }\n case State.BeforeDeclaration: {\n this.stateBeforeDeclaration(c);\n break;\n }\n case State.BeforeComment: {\n this.stateBeforeComment(c);\n break;\n }\n case State.InProcessingInstruction: {\n this.stateInProcessingInstruction(c);\n break;\n }\n case State.InEntity: {\n this.stateInEntity();\n break;\n }\n }\n this.index++;\n }\n this.cleanup();\n }\n finish() {\n if (this.state === State.InEntity) {\n this.entityDecoder.end();\n this.state = this.baseState;\n }\n this.handleTrailingData();\n this.cbs.onend();\n }\n /** Handle any trailing data. */\n handleTrailingData() {\n const endIndex = this.buffer.length + this.offset;\n // If there is no remaining data, we are done.\n if (this.sectionStart >= endIndex) {\n return;\n }\n if (this.state === State.InCommentLike) {\n if (this.currentSequence === Sequences.CdataEnd) {\n this.cbs.oncdata(this.sectionStart, endIndex, 0);\n }\n else {\n this.cbs.oncomment(this.sectionStart, endIndex, 0);\n }\n }\n else if (this.state === State.InTagName ||\n this.state === State.BeforeAttributeName ||\n this.state === State.BeforeAttributeValue ||\n this.state === State.AfterAttributeName ||\n this.state === State.InAttributeName ||\n this.state === State.InAttributeValueSq ||\n this.state === State.InAttributeValueDq ||\n this.state === State.InAttributeValueNq ||\n this.state === State.InClosingTagName) {\n /*\n * If we are currently in an opening or closing tag, us not calling the\n * respective callback signals that the tag should be ignored.\n */\n }\n else {\n this.cbs.ontext(this.sectionStart, endIndex);\n }\n }\n emitCodePoint(cp, consumed) {\n if (this.baseState !== State.Text &&\n this.baseState !== State.InSpecialTag) {\n if (this.sectionStart < this.entityStart) {\n this.cbs.onattribdata(this.sectionStart, this.entityStart);\n }\n this.sectionStart = this.entityStart + consumed;\n this.index = this.sectionStart - 1;\n this.cbs.onattribentity(cp);\n }\n else {\n if (this.sectionStart < this.entityStart) {\n this.cbs.ontext(this.sectionStart, this.entityStart);\n }\n this.sectionStart = this.entityStart + consumed;\n this.index = this.sectionStart - 1;\n this.cbs.ontextentity(cp, this.sectionStart);\n }\n }\n}\nexports.default = Tokenizer;\n//# sourceMappingURL=Tokenizer.js.map"],"names":["Object","defineProperty","Tokenizer_1","value","QuoteType","decode_1","require$$0","CharCodes","State","isWhitespace","c","Space","NewLine","Tab","FormFeed","CarriageReturn","isEndOfTagSection","Slash","Gt","Sequences","Cdata","Uint8Array","CdataEnd","CommentEnd","ScriptEnd","StyleEnd","TitleEnd","TextareaEnd","XmpEnd","default","constructor","xmlMode","decodeEntities","cbs","this","state","Text","buffer","sectionStart","index","entityStart","baseState","isSpecial","running","offset","currentSequence","undefined","sequenceIndex","entityDecoder","EntityDecoder","xmlDecodeTree","htmlDecodeTree","cp","consumed","emitCodePoint","reset","write","chunk","length","parse","end","finish","pause","resume","stateText","Lt","fastForwardTo","ontext","BeforeTagName","Amp","startEntity","stateSpecialStartSequence","isEnd","InTagName","stateInTagName","stateInSpecialTag","endOfText","actualIndex","stateInClosingTagName","Number","stateCDATASequence","InCommentLike","InDeclaration","stateInDeclaration","charCodeAt","stateInCommentLike","oncdata","oncomment","isTagStartChar","LowerA","LowerZ","UpperA","UpperZ","isASCIIAlpha","startSpecial","sequence","SpecialStartSequence","stateBeforeTagName","ExclamationMark","BeforeDeclaration","Questionmark","InProcessingInstruction","lower","BeforeSpecialS","BeforeSpecialT","BeforeClosingTagName","onopentagname","BeforeAttributeName","stateBeforeAttributeName","stateBeforeClosingTagName","InClosingTagName","InSpecialComment","onclosetag","AfterClosingTagName","stateAfterClosingTagName","onopentagend","InSpecialTag","InSelfClosingTag","InAttributeName","stateInSelfClosingTag","onselfclosingtag","stateInAttributeName","Eq","onattribname","AfterAttributeName","stateAfterAttributeName","BeforeAttributeValue","onattribend","NoValue","stateBeforeAttributeValue","DoubleQuote","InAttributeValueDq","SingleQuote","InAttributeValueSq","InAttributeValueNq","stateInAttributeValueNoQuotes","handleInAttributeValue","quote","onattribdata","Double","Single","stateInAttributeValueDoubleQuotes","stateInAttributeValueSingleQuotes","Unquoted","stateBeforeDeclaration","OpeningSquareBracket","CDATASequence","Dash","BeforeComment","ondeclaration","stateInProcessingInstruction","onprocessinginstruction","stateBeforeComment","stateInSpecialComment","stateBeforeSpecialS","stateBeforeSpecialT","InEntity","DecodingMode","Strict","Legacy","Attribute","stateInEntity","cleanup","shouldContinue","handleTrailingData","onend","endIndex","onattribentity","ontextentity"],"mappings":"yKACAA,OAAOC,eAAeC,EAAS,aAAc,CAAEC,OAAO,IACrCD,EAAAE,eAAG,EACpB,MAAMC,EAAqCC,IAC3C,IAAIC,EA+BAC,EAgDAJ,EAdJ,SAASK,EAAaC,GAClB,OAAQA,IAAMH,EAAUI,OACpBD,IAAMH,EAAUK,SAChBF,IAAMH,EAAUM,KAChBH,IAAMH,EAAUO,UAChBJ,IAAMH,EAAUQ,cACxB,CACA,SAASC,EAAkBN,GACvB,OAAOA,IAAMH,EAAUU,OAASP,IAAMH,EAAUW,IAAMT,EAAaC,EACvE,EAzEA,SAAWH,GACPA,EAAUA,EAAe,IAAI,GAAK,MAClCA,EAAUA,EAAmB,QAAI,IAAM,UACvCA,EAAUA,EAAoB,SAAI,IAAM,WACxCA,EAAUA,EAA0B,eAAI,IAAM,iBAC9CA,EAAUA,EAAiB,MAAI,IAAM,QACrCA,EAAUA,EAA2B,gBAAI,IAAM,kBAC/CA,EAAUA,EAAkB,OAAI,IAAM,SACtCA,EAAUA,EAAe,IAAI,IAAM,MACnCA,EAAUA,EAAuB,YAAI,IAAM,cAC3CA,EAAUA,EAAuB,YAAI,IAAM,cAC3CA,EAAUA,EAAgB,KAAI,IAAM,OACpCA,EAAUA,EAAiB,MAAI,IAAM,QACrCA,EAAUA,EAAgB,KAAI,IAAM,OACpCA,EAAUA,EAAgB,KAAI,IAAM,OACpCA,EAAUA,EAAgB,KAAI,IAAM,OACpCA,EAAUA,EAAc,GAAI,IAAM,KAClCA,EAAUA,EAAc,GAAI,IAAM,KAClCA,EAAUA,EAAc,GAAI,IAAM,KAClCA,EAAUA,EAAwB,aAAI,IAAM,eAC5CA,EAAUA,EAAkB,OAAI,IAAM,SACtCA,EAAUA,EAAkB,OAAI,IAAM,SACtCA,EAAUA,EAAkB,OA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GACVnB,KAAKO,YAAcjC,EAAM4B,MACzBF,KAAKO,YAAcjC,EAAM4G,cACrBlF,KAAKI,aAAeJ,KAAKM,aACzBN,KAAKD,IAAIyG,aAAaxG,KAAKI,aAAcJ,KAAKM,aAElDN,KAAKI,aAAeJ,KAAKM,YAAca,EACvCnB,KAAKK,MAAQL,KAAKI,aAAe,EACjCJ,KAAKD,IAAIsI,eAAenH,KAGpBlB,KAAKI,aAAeJ,KAAKM,aACzBN,KAAKD,IAAIkC,OAAOjC,KAAKI,aAAcJ,KAAKM,aAE5CN,KAAKI,aAAeJ,KAAKM,YAAca,EACvCnB,KAAKK,MAAQL,KAAKI,aAAe,EACjCJ,KAAKD,IAAIuI,aAAapH,EAAIlB,KAAKI,cAE3C"}
|
|
1
|
+
{"version":3,"file":"Tokenizer.js","sources":["../../../../../node_modules/htmlparser2/dist/commonjs/Tokenizer.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.QuoteType = void 0;\nconst decode_1 = require(\"entities/decode\");\nvar CharCodes;\n(function (CharCodes) {\n CharCodes[CharCodes[\"Tab\"] = 9] = \"Tab\";\n CharCodes[CharCodes[\"NewLine\"] = 10] = \"NewLine\";\n CharCodes[CharCodes[\"FormFeed\"] = 12] = \"FormFeed\";\n CharCodes[CharCodes[\"CarriageReturn\"] = 13] = \"CarriageReturn\";\n CharCodes[CharCodes[\"Space\"] = 32] = \"Space\";\n CharCodes[CharCodes[\"ExclamationMark\"] = 33] = \"ExclamationMark\";\n CharCodes[CharCodes[\"Number\"] = 35] = \"Number\";\n CharCodes[CharCodes[\"Amp\"] = 38] = \"Amp\";\n CharCodes[CharCodes[\"SingleQuote\"] = 39] = \"SingleQuote\";\n CharCodes[CharCodes[\"DoubleQuote\"] = 34] = \"DoubleQuote\";\n CharCodes[CharCodes[\"Dash\"] = 45] = \"Dash\";\n CharCodes[CharCodes[\"Slash\"] = 47] = \"Slash\";\n CharCodes[CharCodes[\"Zero\"] = 48] = \"Zero\";\n CharCodes[CharCodes[\"Nine\"] = 57] = \"Nine\";\n CharCodes[CharCodes[\"Semi\"] = 59] = \"Semi\";\n CharCodes[CharCodes[\"Lt\"] = 60] = \"Lt\";\n CharCodes[CharCodes[\"Eq\"] = 61] = \"Eq\";\n CharCodes[CharCodes[\"Gt\"] = 62] = \"Gt\";\n CharCodes[CharCodes[\"Questionmark\"] = 63] = \"Questionmark\";\n CharCodes[CharCodes[\"UpperA\"] = 65] = \"UpperA\";\n CharCodes[CharCodes[\"LowerA\"] = 97] = \"LowerA\";\n CharCodes[CharCodes[\"UpperF\"] = 70] = \"UpperF\";\n CharCodes[CharCodes[\"LowerF\"] = 102] = \"LowerF\";\n CharCodes[CharCodes[\"UpperZ\"] = 90] = \"UpperZ\";\n CharCodes[CharCodes[\"LowerZ\"] = 122] = \"LowerZ\";\n CharCodes[CharCodes[\"LowerX\"] = 120] = \"LowerX\";\n CharCodes[CharCodes[\"OpeningSquareBracket\"] = 91] = \"OpeningSquareBracket\";\n})(CharCodes || (CharCodes = {}));\n/** All the states the tokenizer can be in. */\nvar State;\n(function (State) {\n State[State[\"Text\"] = 1] = \"Text\";\n State[State[\"BeforeTagName\"] = 2] = \"BeforeTagName\";\n State[State[\"InTagName\"] = 3] = \"InTagName\";\n State[State[\"InSelfClosingTag\"] = 4] = \"InSelfClosingTag\";\n State[State[\"BeforeClosingTagName\"] = 5] = \"BeforeClosingTagName\";\n State[State[\"InClosingTagName\"] = 6] = \"InClosingTagName\";\n State[State[\"AfterClosingTagName\"] = 7] = \"AfterClosingTagName\";\n // Attributes\n State[State[\"BeforeAttributeName\"] = 8] = \"BeforeAttributeName\";\n State[State[\"InAttributeName\"] = 9] = \"InAttributeName\";\n State[State[\"AfterAttributeName\"] = 10] = \"AfterAttributeName\";\n State[State[\"BeforeAttributeValue\"] = 11] = \"BeforeAttributeValue\";\n State[State[\"InAttributeValueDq\"] = 12] = \"InAttributeValueDq\";\n State[State[\"InAttributeValueSq\"] = 13] = \"InAttributeValueSq\";\n State[State[\"InAttributeValueNq\"] = 14] = \"InAttributeValueNq\";\n // Declarations\n State[State[\"BeforeDeclaration\"] = 15] = \"BeforeDeclaration\";\n State[State[\"InDeclaration\"] = 16] = \"InDeclaration\";\n // Processing instructions\n State[State[\"InProcessingInstruction\"] = 17] = \"InProcessingInstruction\";\n // Comments & CDATA\n State[State[\"BeforeComment\"] = 18] = \"BeforeComment\";\n State[State[\"CDATASequence\"] = 19] = \"CDATASequence\";\n State[State[\"InSpecialComment\"] = 20] = \"InSpecialComment\";\n State[State[\"InCommentLike\"] = 21] = \"InCommentLike\";\n // Special tags\n State[State[\"BeforeSpecialS\"] = 22] = \"BeforeSpecialS\";\n State[State[\"BeforeSpecialT\"] = 23] = \"BeforeSpecialT\";\n State[State[\"SpecialStartSequence\"] = 24] = \"SpecialStartSequence\";\n State[State[\"InSpecialTag\"] = 25] = \"InSpecialTag\";\n State[State[\"InEntity\"] = 26] = \"InEntity\";\n})(State || (State = {}));\nfunction isWhitespace(c) {\n return (c === CharCodes.Space ||\n c === CharCodes.NewLine ||\n c === CharCodes.Tab ||\n c === CharCodes.FormFeed ||\n c === CharCodes.CarriageReturn);\n}\nfunction isEndOfTagSection(c) {\n return c === CharCodes.Slash || c === CharCodes.Gt || isWhitespace(c);\n}\nfunction isASCIIAlpha(c) {\n return ((c >= CharCodes.LowerA && c <= CharCodes.LowerZ) ||\n (c >= CharCodes.UpperA && c <= CharCodes.UpperZ));\n}\nvar QuoteType;\n(function (QuoteType) {\n QuoteType[QuoteType[\"NoValue\"] = 0] = \"NoValue\";\n QuoteType[QuoteType[\"Unquoted\"] = 1] = \"Unquoted\";\n QuoteType[QuoteType[\"Single\"] = 2] = \"Single\";\n QuoteType[QuoteType[\"Double\"] = 3] = \"Double\";\n})(QuoteType || (exports.QuoteType = QuoteType = {}));\n/**\n * Sequences used to match longer strings.\n *\n * We don't have `Script`, `Style`, or `Title` here. Instead, we re-use the *End\n * sequences with an increased offset.\n */\nconst Sequences = {\n Cdata: new Uint8Array([0x43, 0x44, 0x41, 0x54, 0x41, 0x5b]), // CDATA[\n CdataEnd: new Uint8Array([0x5d, 0x5d, 0x3e]), // ]]>\n CommentEnd: new Uint8Array([0x2d, 0x2d, 0x3e]), // `-->`\n ScriptEnd: new Uint8Array([0x3c, 0x2f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74]), // `</script`\n StyleEnd: new Uint8Array([0x3c, 0x2f, 0x73, 0x74, 0x79, 0x6c, 0x65]), // `</style`\n TitleEnd: new Uint8Array([0x3c, 0x2f, 0x74, 0x69, 0x74, 0x6c, 0x65]), // `</title`\n TextareaEnd: new Uint8Array([\n 0x3c, 0x2f, 0x74, 0x65, 0x78, 0x74, 0x61, 0x72, 0x65, 0x61,\n ]), // `</textarea`\n XmpEnd: new Uint8Array([0x3c, 0x2f, 0x78, 0x6d, 0x70]), // `</xmp`\n};\nclass Tokenizer {\n constructor({ xmlMode = false, decodeEntities = true, }, cbs) {\n this.cbs = cbs;\n /** The current state the tokenizer is in. */\n this.state = State.Text;\n /** The read buffer. */\n this.buffer = \"\";\n /** The beginning of the section that is currently being read. */\n this.sectionStart = 0;\n /** The index within the buffer that we are currently looking at. */\n this.index = 0;\n /** The start of the last entity. */\n this.entityStart = 0;\n /** Some behavior, eg. when decoding entities, is done while we are in another state. This keeps track of the other state type. */\n this.baseState = State.Text;\n /** For special parsing behavior inside of script and style tags. */\n this.isSpecial = false;\n /** Indicates whether the tokenizer has been paused. */\n this.running = true;\n /** The offset of the current buffer. */\n this.offset = 0;\n this.currentSequence = undefined;\n this.sequenceIndex = 0;\n this.xmlMode = xmlMode;\n this.decodeEntities = decodeEntities;\n this.entityDecoder = new decode_1.EntityDecoder(xmlMode ? decode_1.xmlDecodeTree : decode_1.htmlDecodeTree, (cp, consumed) => this.emitCodePoint(cp, consumed));\n }\n reset() {\n this.state = State.Text;\n this.buffer = \"\";\n this.sectionStart = 0;\n this.index = 0;\n this.baseState = State.Text;\n this.currentSequence = undefined;\n this.running = true;\n this.offset = 0;\n }\n write(chunk) {\n this.offset += this.buffer.length;\n this.buffer = chunk;\n this.parse();\n }\n end() {\n if (this.running)\n this.finish();\n }\n pause() {\n this.running = false;\n }\n resume() {\n this.running = true;\n if (this.index < this.buffer.length + this.offset) {\n this.parse();\n }\n }\n stateText(c) {\n if (c === CharCodes.Lt ||\n (!this.decodeEntities && this.fastForwardTo(CharCodes.Lt))) {\n if (this.index > this.sectionStart) {\n this.cbs.ontext(this.sectionStart, this.index);\n }\n this.state = State.BeforeTagName;\n this.sectionStart = this.index;\n }\n else if (this.decodeEntities && c === CharCodes.Amp) {\n this.startEntity();\n }\n }\n stateSpecialStartSequence(c) {\n const isEnd = this.sequenceIndex === this.currentSequence.length;\n const isMatch = isEnd\n ? // If we are at the end of the sequence, make sure the tag name has ended\n isEndOfTagSection(c)\n : // Otherwise, do a case-insensitive comparison\n (c | 0x20) === this.currentSequence[this.sequenceIndex];\n if (!isMatch) {\n this.isSpecial = false;\n }\n else if (!isEnd) {\n this.sequenceIndex++;\n return;\n }\n this.sequenceIndex = 0;\n this.state = State.InTagName;\n this.stateInTagName(c);\n }\n /** Look for an end tag. For <title> tags, also decode entities. */\n stateInSpecialTag(c) {\n if (this.sequenceIndex === this.currentSequence.length) {\n if (c === CharCodes.Gt || isWhitespace(c)) {\n const endOfText = this.index - this.currentSequence.length;\n if (this.sectionStart < endOfText) {\n // Spoof the index so that reported locations match up.\n const actualIndex = this.index;\n this.index = endOfText;\n this.cbs.ontext(this.sectionStart, endOfText);\n this.index = actualIndex;\n }\n this.isSpecial = false;\n this.sectionStart = endOfText + 2; // Skip over the `</`\n this.stateInClosingTagName(c);\n return; // We are done; skip the rest of the function.\n }\n this.sequenceIndex = 0;\n }\n if ((c | 0x20) === this.currentSequence[this.sequenceIndex]) {\n this.sequenceIndex += 1;\n }\n else if (this.sequenceIndex === 0) {\n if (this.currentSequence === Sequences.TitleEnd) {\n // We have to parse entities in <title> tags.\n if (this.decodeEntities && c === CharCodes.Amp) {\n this.startEntity();\n }\n }\n else if (this.fastForwardTo(CharCodes.Lt)) {\n // Outside of <title> tags, we can fast-forward.\n this.sequenceIndex = 1;\n }\n }\n else {\n // If we see a `<`, set the sequence index to 1; useful for eg. `<</script>`.\n this.sequenceIndex = Number(c === CharCodes.Lt);\n }\n }\n stateCDATASequence(c) {\n if (c === Sequences.Cdata[this.sequenceIndex]) {\n if (++this.sequenceIndex === Sequences.Cdata.length) {\n this.state = State.InCommentLike;\n this.currentSequence = Sequences.CdataEnd;\n this.sequenceIndex = 0;\n this.sectionStart = this.index + 1;\n }\n }\n else {\n this.sequenceIndex = 0;\n this.state = State.InDeclaration;\n this.stateInDeclaration(c); // Reconsume the character\n }\n }\n /**\n * When we wait for one specific character, we can speed things up\n * by skipping through the buffer until we find it.\n *\n * @returns Whether the character was found.\n */\n fastForwardTo(c) {\n while (++this.index < this.buffer.length + this.offset) {\n if (this.buffer.charCodeAt(this.index - this.offset) === c) {\n return true;\n }\n }\n /*\n * We increment the index at the end of the `parse` loop,\n * so set it to `buffer.length - 1` here.\n *\n * TODO: Refactor `parse` to increment index before calling states.\n */\n this.index = this.buffer.length + this.offset - 1;\n return false;\n }\n /**\n * Comments and CDATA end with `-->` and `]]>`.\n *\n * Their common qualities are:\n * - Their end sequences have a distinct character they start with.\n * - That character is then repeated, so we have to check multiple repeats.\n * - All characters but the start character of the sequence can be skipped.\n */\n stateInCommentLike(c) {\n if (c === this.currentSequence[this.sequenceIndex]) {\n if (++this.sequenceIndex === this.currentSequence.length) {\n if (this.currentSequence === Sequences.CdataEnd) {\n this.cbs.oncdata(this.sectionStart, this.index, 2);\n }\n else {\n this.cbs.oncomment(this.sectionStart, this.index, 2);\n }\n this.sequenceIndex = 0;\n this.sectionStart = this.index + 1;\n this.state = State.Text;\n }\n }\n else if (this.sequenceIndex === 0) {\n // Fast-forward to the first character of the sequence\n if (this.fastForwardTo(this.currentSequence[0])) {\n this.sequenceIndex = 1;\n }\n }\n else if (c !== this.currentSequence[this.sequenceIndex - 1]) {\n // Allow long sequences, eg. --->, ]]]>\n this.sequenceIndex = 0;\n }\n }\n /**\n * HTML only allows ASCII alpha characters (a-z and A-Z) at the beginning of a tag name.\n *\n * XML allows a lot more characters here (@see https://www.w3.org/TR/REC-xml/#NT-NameStartChar).\n * We allow anything that wouldn't end the tag.\n */\n isTagStartChar(c) {\n return this.xmlMode ? !isEndOfTagSection(c) : isASCIIAlpha(c);\n }\n startSpecial(sequence, offset) {\n this.isSpecial = true;\n this.currentSequence = sequence;\n this.sequenceIndex = offset;\n this.state = State.SpecialStartSequence;\n }\n stateBeforeTagName(c) {\n if (c === CharCodes.ExclamationMark) {\n this.state = State.BeforeDeclaration;\n this.sectionStart = this.index + 1;\n }\n else if (c === CharCodes.Questionmark) {\n this.state = State.InProcessingInstruction;\n this.sectionStart = this.index + 1;\n }\n else if (this.isTagStartChar(c)) {\n const lower = c | 0x20;\n this.sectionStart = this.index;\n if (this.xmlMode) {\n this.state = State.InTagName;\n }\n else if (lower === Sequences.ScriptEnd[2]) {\n this.state = State.BeforeSpecialS;\n }\n else if (lower === Sequences.TitleEnd[2] ||\n lower === Sequences.XmpEnd[2]) {\n this.state = State.BeforeSpecialT;\n }\n else {\n this.state = State.InTagName;\n }\n }\n else if (c === CharCodes.Slash) {\n this.state = State.BeforeClosingTagName;\n }\n else {\n this.state = State.Text;\n this.stateText(c);\n }\n }\n stateInTagName(c) {\n if (isEndOfTagSection(c)) {\n this.cbs.onopentagname(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n }\n stateBeforeClosingTagName(c) {\n if (isWhitespace(c)) {\n // Ignore\n }\n else if (c === CharCodes.Gt) {\n this.state = State.Text;\n }\n else {\n this.state = this.isTagStartChar(c)\n ? State.InClosingTagName\n : State.InSpecialComment;\n this.sectionStart = this.index;\n }\n }\n stateInClosingTagName(c) {\n if (c === CharCodes.Gt || isWhitespace(c)) {\n this.cbs.onclosetag(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.state = State.AfterClosingTagName;\n this.stateAfterClosingTagName(c);\n }\n }\n stateAfterClosingTagName(c) {\n // Skip everything until \">\"\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n }\n stateBeforeAttributeName(c) {\n if (c === CharCodes.Gt) {\n this.cbs.onopentagend(this.index);\n if (this.isSpecial) {\n this.state = State.InSpecialTag;\n this.sequenceIndex = 0;\n }\n else {\n this.state = State.Text;\n }\n this.sectionStart = this.index + 1;\n }\n else if (c === CharCodes.Slash) {\n this.state = State.InSelfClosingTag;\n }\n else if (!isWhitespace(c)) {\n this.state = State.InAttributeName;\n this.sectionStart = this.index;\n }\n }\n stateInSelfClosingTag(c) {\n if (c === CharCodes.Gt) {\n this.cbs.onselfclosingtag(this.index);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n this.isSpecial = false; // Reset special state, in case of self-closing special tags\n }\n else if (!isWhitespace(c)) {\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n }\n stateInAttributeName(c) {\n if (c === CharCodes.Eq || isEndOfTagSection(c)) {\n this.cbs.onattribname(this.sectionStart, this.index);\n this.sectionStart = this.index;\n this.state = State.AfterAttributeName;\n this.stateAfterAttributeName(c);\n }\n }\n stateAfterAttributeName(c) {\n if (c === CharCodes.Eq) {\n this.state = State.BeforeAttributeValue;\n }\n else if (c === CharCodes.Slash || c === CharCodes.Gt) {\n this.cbs.onattribend(QuoteType.NoValue, this.sectionStart);\n this.sectionStart = -1;\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n else if (!isWhitespace(c)) {\n this.cbs.onattribend(QuoteType.NoValue, this.sectionStart);\n this.state = State.InAttributeName;\n this.sectionStart = this.index;\n }\n }\n stateBeforeAttributeValue(c) {\n if (c === CharCodes.DoubleQuote) {\n this.state = State.InAttributeValueDq;\n this.sectionStart = this.index + 1;\n }\n else if (c === CharCodes.SingleQuote) {\n this.state = State.InAttributeValueSq;\n this.sectionStart = this.index + 1;\n }\n else if (!isWhitespace(c)) {\n this.sectionStart = this.index;\n this.state = State.InAttributeValueNq;\n this.stateInAttributeValueNoQuotes(c); // Reconsume token\n }\n }\n handleInAttributeValue(c, quote) {\n if (c === quote ||\n (!this.decodeEntities && this.fastForwardTo(quote))) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.cbs.onattribend(quote === CharCodes.DoubleQuote\n ? QuoteType.Double\n : QuoteType.Single, this.index + 1);\n this.state = State.BeforeAttributeName;\n }\n else if (this.decodeEntities && c === CharCodes.Amp) {\n this.startEntity();\n }\n }\n stateInAttributeValueDoubleQuotes(c) {\n this.handleInAttributeValue(c, CharCodes.DoubleQuote);\n }\n stateInAttributeValueSingleQuotes(c) {\n this.handleInAttributeValue(c, CharCodes.SingleQuote);\n }\n stateInAttributeValueNoQuotes(c) {\n if (isWhitespace(c) || c === CharCodes.Gt) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.cbs.onattribend(QuoteType.Unquoted, this.index);\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n else if (this.decodeEntities && c === CharCodes.Amp) {\n this.startEntity();\n }\n }\n stateBeforeDeclaration(c) {\n if (c === CharCodes.OpeningSquareBracket) {\n this.state = State.CDATASequence;\n this.sequenceIndex = 0;\n }\n else {\n this.state =\n c === CharCodes.Dash\n ? State.BeforeComment\n : State.InDeclaration;\n }\n }\n stateInDeclaration(c) {\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.cbs.ondeclaration(this.sectionStart, this.index);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n }\n stateInProcessingInstruction(c) {\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.cbs.onprocessinginstruction(this.sectionStart, this.index);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n }\n stateBeforeComment(c) {\n if (c === CharCodes.Dash) {\n this.state = State.InCommentLike;\n this.currentSequence = Sequences.CommentEnd;\n // Allow short comments (eg. <!-->)\n this.sequenceIndex = 2;\n this.sectionStart = this.index + 1;\n }\n else {\n this.state = State.InDeclaration;\n }\n }\n stateInSpecialComment(c) {\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.cbs.oncomment(this.sectionStart, this.index, 0);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n }\n stateBeforeSpecialS(c) {\n const lower = c | 0x20;\n if (lower === Sequences.ScriptEnd[3]) {\n this.startSpecial(Sequences.ScriptEnd, 4);\n }\n else if (lower === Sequences.StyleEnd[3]) {\n this.startSpecial(Sequences.StyleEnd, 4);\n }\n else {\n this.state = State.InTagName;\n this.stateInTagName(c); // Consume the token again\n }\n }\n stateBeforeSpecialT(c) {\n const lower = c | 0x20;\n switch (lower) {\n case Sequences.TitleEnd[3]: {\n this.startSpecial(Sequences.TitleEnd, 4);\n break;\n }\n case Sequences.TextareaEnd[3]: {\n this.startSpecial(Sequences.TextareaEnd, 4);\n break;\n }\n case Sequences.XmpEnd[3]: {\n this.startSpecial(Sequences.XmpEnd, 4);\n break;\n }\n default: {\n this.state = State.InTagName;\n this.stateInTagName(c); // Consume the token again\n }\n }\n }\n startEntity() {\n this.baseState = this.state;\n this.state = State.InEntity;\n this.entityStart = this.index;\n this.entityDecoder.startEntity(this.xmlMode\n ? decode_1.DecodingMode.Strict\n : this.baseState === State.Text ||\n this.baseState === State.InSpecialTag\n ? decode_1.DecodingMode.Legacy\n : decode_1.DecodingMode.Attribute);\n }\n stateInEntity() {\n const length = this.entityDecoder.write(this.buffer, this.index - this.offset);\n // If `length` is positive, we are done with the entity.\n if (length >= 0) {\n this.state = this.baseState;\n if (length === 0) {\n this.index = this.entityStart;\n }\n }\n else {\n // Mark buffer as consumed.\n this.index = this.offset + this.buffer.length - 1;\n }\n }\n /**\n * Remove data that has already been consumed from the buffer.\n */\n cleanup() {\n // If we are inside of text or attributes, emit what we already have.\n if (this.running && this.sectionStart !== this.index) {\n if (this.state === State.Text ||\n (this.state === State.InSpecialTag && this.sequenceIndex === 0)) {\n this.cbs.ontext(this.sectionStart, this.index);\n this.sectionStart = this.index;\n }\n else if (this.state === State.InAttributeValueDq ||\n this.state === State.InAttributeValueSq ||\n this.state === State.InAttributeValueNq) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = this.index;\n }\n }\n }\n shouldContinue() {\n return this.index < this.buffer.length + this.offset && this.running;\n }\n /**\n * Iterates through the buffer, calling the function corresponding to the current state.\n *\n * States that are more likely to be hit are higher up, as a performance improvement.\n */\n parse() {\n while (this.shouldContinue()) {\n const c = this.buffer.charCodeAt(this.index - this.offset);\n switch (this.state) {\n case State.Text: {\n this.stateText(c);\n break;\n }\n case State.SpecialStartSequence: {\n this.stateSpecialStartSequence(c);\n break;\n }\n case State.InSpecialTag: {\n this.stateInSpecialTag(c);\n break;\n }\n case State.CDATASequence: {\n this.stateCDATASequence(c);\n break;\n }\n case State.InAttributeValueDq: {\n this.stateInAttributeValueDoubleQuotes(c);\n break;\n }\n case State.InAttributeName: {\n this.stateInAttributeName(c);\n break;\n }\n case State.InCommentLike: {\n this.stateInCommentLike(c);\n break;\n }\n case State.InSpecialComment: {\n this.stateInSpecialComment(c);\n break;\n }\n case State.BeforeAttributeName: {\n this.stateBeforeAttributeName(c);\n break;\n }\n case State.InTagName: {\n this.stateInTagName(c);\n break;\n }\n case State.InClosingTagName: {\n this.stateInClosingTagName(c);\n break;\n }\n case State.BeforeTagName: {\n this.stateBeforeTagName(c);\n break;\n }\n case State.AfterAttributeName: {\n this.stateAfterAttributeName(c);\n break;\n }\n case State.InAttributeValueSq: {\n this.stateInAttributeValueSingleQuotes(c);\n break;\n }\n case State.BeforeAttributeValue: {\n this.stateBeforeAttributeValue(c);\n break;\n }\n case State.BeforeClosingTagName: {\n this.stateBeforeClosingTagName(c);\n break;\n }\n case State.AfterClosingTagName: {\n this.stateAfterClosingTagName(c);\n break;\n }\n case State.BeforeSpecialS: {\n this.stateBeforeSpecialS(c);\n break;\n }\n case State.BeforeSpecialT: {\n this.stateBeforeSpecialT(c);\n break;\n }\n case State.InAttributeValueNq: {\n this.stateInAttributeValueNoQuotes(c);\n break;\n }\n case State.InSelfClosingTag: {\n this.stateInSelfClosingTag(c);\n break;\n }\n case State.InDeclaration: {\n this.stateInDeclaration(c);\n break;\n }\n case State.BeforeDeclaration: {\n this.stateBeforeDeclaration(c);\n break;\n }\n case State.BeforeComment: {\n this.stateBeforeComment(c);\n break;\n }\n case State.InProcessingInstruction: {\n this.stateInProcessingInstruction(c);\n break;\n }\n case State.InEntity: {\n this.stateInEntity();\n break;\n }\n }\n this.index++;\n }\n this.cleanup();\n }\n finish() {\n if (this.state === State.InEntity) {\n this.entityDecoder.end();\n this.state = this.baseState;\n }\n this.handleTrailingData();\n this.cbs.onend();\n }\n /** Handle any trailing data. */\n handleTrailingData() {\n const endIndex = this.buffer.length + this.offset;\n // If there is no remaining data, we are done.\n if (this.sectionStart >= endIndex) {\n return;\n }\n if (this.state === State.InCommentLike) {\n if (this.currentSequence === Sequences.CdataEnd) {\n this.cbs.oncdata(this.sectionStart, endIndex, 0);\n }\n else {\n this.cbs.oncomment(this.sectionStart, endIndex, 0);\n }\n }\n else if (this.state === State.InTagName ||\n this.state === State.BeforeAttributeName ||\n this.state === State.BeforeAttributeValue ||\n this.state === State.AfterAttributeName ||\n this.state === State.InAttributeName ||\n this.state === State.InAttributeValueSq ||\n this.state === State.InAttributeValueDq ||\n this.state === State.InAttributeValueNq ||\n this.state === State.InClosingTagName) {\n /*\n * If we are currently in an opening or closing tag, us not calling the\n * respective callback signals that the tag should be ignored.\n */\n }\n else {\n this.cbs.ontext(this.sectionStart, endIndex);\n }\n }\n emitCodePoint(cp, consumed) {\n if (this.baseState !== State.Text &&\n this.baseState !== State.InSpecialTag) {\n if (this.sectionStart < this.entityStart) {\n this.cbs.onattribdata(this.sectionStart, this.entityStart);\n }\n this.sectionStart = this.entityStart + consumed;\n this.index = this.sectionStart - 1;\n this.cbs.onattribentity(cp);\n }\n else {\n if (this.sectionStart < this.entityStart) {\n this.cbs.ontext(this.sectionStart, this.entityStart);\n }\n this.sectionStart = this.entityStart + consumed;\n this.index = this.sectionStart - 1;\n this.cbs.ontextentity(cp, this.sectionStart);\n }\n }\n}\nexports.default = Tokenizer;\n//# sourceMappingURL=Tokenizer.js.map"],"names":["Object","defineProperty","Tokenizer_1","value","QuoteType","decode_1","require$$0","CharCodes","State","isWhitespace","c","Space","NewLine","Tab","FormFeed","CarriageReturn","isEndOfTagSection","Slash","Gt","Sequences","Cdata","Uint8Array","CdataEnd","CommentEnd","ScriptEnd","StyleEnd","TitleEnd","TextareaEnd","XmpEnd","default","constructor","xmlMode","decodeEntities","cbs","this","state","Text","buffer","sectionStart","index","entityStart","baseState","isSpecial","running","offset","currentSequence","undefined","sequenceIndex","entityDecoder","EntityDecoder","xmlDecodeTree","htmlDecodeTree","cp","consumed","emitCodePoint","reset","write","chunk","length","parse","end","finish","pause","resume","stateText","Lt","fastForwardTo","ontext","BeforeTagName","Amp","startEntity","stateSpecialStartSequence","isEnd","InTagName","stateInTagName","stateInSpecialTag","endOfText","actualIndex","stateInClosingTagName","Number","stateCDATASequence","InCommentLike","InDeclaration","stateInDeclaration","charCodeAt","stateInCommentLike","oncdata","oncomment","isTagStartChar","LowerA","LowerZ","UpperA","UpperZ","isASCIIAlpha","startSpecial","sequence","SpecialStartSequence","stateBeforeTagName","ExclamationMark","BeforeDeclaration","Questionmark","InProcessingInstruction","lower","BeforeSpecialS","BeforeSpecialT","BeforeClosingTagName","onopentagname","BeforeAttributeName","stateBeforeAttributeName","stateBeforeClosingTagName","InClosingTagName","InSpecialComment","onclosetag","AfterClosingTagName","stateAfterClosingTagName","onopentagend","InSpecialTag","InSelfClosingTag","InAttributeName","stateInSelfClosingTag","onselfclosingtag","stateInAttributeName","Eq","onattribname","AfterAttributeName","stateAfterAttributeName","BeforeAttributeValue","onattribend","NoValue","stateBeforeAttributeValue","DoubleQuote","InAttributeValueDq","SingleQuote","InAttributeValueSq","InAttributeValueNq","stateInAttributeValueNoQuotes","handleInAttributeValue","quote","onattribdata","Double","Single","stateInAttributeValueDoubleQuotes","stateInAttributeValueSingleQuotes","Unquoted","stateBeforeDeclaration","OpeningSquareBracket","CDATASequence","Dash","BeforeComment","ondeclaration","stateInProcessingInstruction","onprocessinginstruction","stateBeforeComment","stateInSpecialComment","stateBeforeSpecialS","stateBeforeSpecialT","InEntity","DecodingMode","Strict","Legacy","Attribute","stateInEntity","cleanup","shouldContinue","handleTrailingData","onend","endIndex","onattribentity","ontextentity"],"mappings":"yKACAA,OAAOC,eAAeC,EAAS,aAAc,CAAEC,OAAO,IACrCD,EAAAE,eAAG,EACpB,MAAMC,EAAqCC,IAC3C,IAAIC,EA+BAC,EAgDAJ,EAdJ,SAASK,EAAaC,GAClB,OAAQA,IAAMH,EAAUI,OACpBD,IAAMH,EAAUK,SAChBF,IAAMH,EAAUM,KAChBH,IAAMH,EAAUO,UAChBJ,IAAMH,EAAUQ,cACxB,CACA,SAASC,EAAkBN,GACvB,OAAOA,IAAMH,EAAUU,OAASP,IAAMH,EAAUW,IAAMT,EAAaC,EACvE,EAzEA,SAAWH,GACPA,EAAUA,EAAe,IAAI,GAAK,MAClCA,EAAUA,EAAmB,QAAI,IAAM,UACvCA,EAAUA,EAAoB,SAAI,IAAM,WACxCA,EAAUA,EAA0B,eAAI,IAAM,iBAC9CA,EAAUA,EAAiB,MAAI,IAAM,QACrCA,EAAUA,EAA2B,gBAAI,IAAM,kBAC/CA,EAAUA,EAAkB,OAAI,IAAM,SACtCA,EAAUA,EAAe,IAAI,IAAM,MACnCA,EAAUA,EAAuB,YAAI,IAAM,cAC3CA,EAAUA,EAAuB,YAAI,IAAM,cAC3CA,EAAUA,EAAgB,KAAI,IAAM,OACpCA,EAAUA,EAAiB,MAAI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,EAAMmG,qBACrBzE,KAAKC,QAAU3B,EAAMsH,sBACrB5F,KAAKC,QAAU3B,EAAMoH,oBACrB1F,KAAKC,QAAU3B,EAAM8G,iBACrBpF,KAAKC,QAAU3B,EAAM6H,oBACrBnG,KAAKC,QAAU3B,EAAM2H,oBACrBjG,KAAKC,QAAU3B,EAAM8H,oBACrBpG,KAAKC,QAAU3B,EAAMsG,kBAOrB5E,KAAKD,IAAIkC,OAAOjC,KAAKI,aAAcgI,GAE/C,CACI,aAAAhH,CAAcF,EAAIC,GACVnB,KAAKO,YAAcjC,EAAM4B,MACzBF,KAAKO,YAAcjC,EAAM4G,cACrBlF,KAAKI,aAAeJ,KAAKM,aACzBN,KAAKD,IAAIyG,aAAaxG,KAAKI,aAAcJ,KAAKM,aAElDN,KAAKI,aAAeJ,KAAKM,YAAca,EACvCnB,KAAKK,MAAQL,KAAKI,aAAe,EACjCJ,KAAKD,IAAIsI,eAAenH,KAGpBlB,KAAKI,aAAeJ,KAAKM,aACzBN,KAAKD,IAAIkC,OAAOjC,KAAKI,aAAcJ,KAAKM,aAE5CN,KAAKI,aAAeJ,KAAKM,YAAca,EACvCnB,KAAKK,MAAQL,KAAKI,aAAe,EACjCJ,KAAKD,IAAIuI,aAAapH,EAAIlB,KAAKI,cAE3C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__exports as e}from"../../../../_virtual/index16.js";import{__require as r}from"./Parser.js";import{__require as t}from"../../../domhandler/lib/index.js";import{__require as n}from"./Tokenizer.js";import{__require as o}from"../../../domelementtype/lib/index.js";import{__require as u}from"../../../domutils/lib/index.js";var i;function a(){return i||(i=1,function(i){var a,c=e&&e.__createBinding||(Object.create?function(e,r,t,n){void 0===n&&(n=t);var o=Object.getOwnPropertyDescriptor(r,t);o&&!("get"in o?!r.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,n,o)}:function(e,r,t,n){void 0===n&&(n=t),e[n]=r[t]}),l=e&&e.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),f=e&&e.__importStar||(a=function(e){return a=Object.getOwnPropertyNames||function(e){var r=[];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r},a(e)},function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t=a(e),n=0;n<t.length;n++)"default"!==t[n]&&c(r,e,t[n]);return l(r,e),r}),d=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomUtils=i.getFeed=i.ElementType=i.QuoteType=i.Tokenizer=i.DefaultHandler=i.DomHandler=i.Parser=void 0,i.parseDocument=b,i.parseDOM=j,i.createDocumentStream=function(e,r,t){const n=new p.DomHandler(
|
|
1
|
+
import{__exports as e}from"../../../../_virtual/index16.js";import{__require as r}from"./Parser.js";import{__require as t}from"../../../domhandler/lib/index.js";import{__require as n}from"./Tokenizer.js";import{__require as o}from"../../../domelementtype/lib/index.js";import{__require as u}from"../../../domutils/lib/index.js";var i;function a(){return i||(i=1,function(i){var a,c=e&&e.__createBinding||(Object.create?function(e,r,t,n){void 0===n&&(n=t);var o=Object.getOwnPropertyDescriptor(r,t);o&&!("get"in o?!r.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,n,o)}:function(e,r,t,n){void 0===n&&(n=t),e[n]=r[t]}),l=e&&e.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),f=e&&e.__importStar||(a=function(e){return a=Object.getOwnPropertyNames||function(e){var r=[];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[r.length]=t);return r},a(e)},function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t=a(e),n=0;n<t.length;n++)"default"!==t[n]&&c(r,e,t[n]);return l(r,e),r}),d=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomUtils=i.getFeed=i.ElementType=i.QuoteType=i.Tokenizer=i.DefaultHandler=i.DomHandler=i.Parser=void 0,i.parseDocument=b,i.parseDOM=j,i.createDocumentStream=function(e,r,t){const n=new p.DomHandler(r=>e(r,n.root),r,t);return new m.Parser(n,r)},i.createDomStream=function(e,r,t){const n=new p.DomHandler(e,r,t);return new m.Parser(n,r)},i.parseFeed=function(e,r=v){return(0,P.getFeed)(j(e,r))};const m=r();var s=r();Object.defineProperty(i,"Parser",{enumerable:!0,get:function(){return s.Parser}});const p=t();var _=t();function b(e,r){const t=new p.DomHandler(void 0,r);return new m.Parser(t,r).end(e),t.root}function j(e,r){return b(e,r).children}Object.defineProperty(i,"DomHandler",{enumerable:!0,get:function(){return _.DomHandler}}),Object.defineProperty(i,"DefaultHandler",{enumerable:!0,get:function(){return _.DomHandler}});var y=n();Object.defineProperty(i,"Tokenizer",{enumerable:!0,get:function(){return d(y).default}}),Object.defineProperty(i,"QuoteType",{enumerable:!0,get:function(){return y.QuoteType}}),i.ElementType=f(o());const P=u();var g=u();Object.defineProperty(i,"getFeed",{enumerable:!0,get:function(){return g.getFeed}});const v={xmlMode:!0};i.DomUtils=f(u())}(e)),e}export{a as __require};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../node_modules/htmlparser2/dist/commonjs/index.js"],"sourcesContent":["\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DomUtils = exports.getFeed = exports.ElementType = exports.QuoteType = exports.Tokenizer = exports.DefaultHandler = exports.DomHandler = exports.Parser = void 0;\nexports.parseDocument = parseDocument;\nexports.parseDOM = parseDOM;\nexports.createDocumentStream = createDocumentStream;\nexports.createDomStream = createDomStream;\nexports.parseFeed = parseFeed;\nconst Parser_js_1 = require(\"./Parser.js\");\nvar Parser_js_2 = require(\"./Parser.js\");\nObject.defineProperty(exports, \"Parser\", { enumerable: true, get: function () { return Parser_js_2.Parser; } });\nconst domhandler_1 = require(\"domhandler\");\nvar domhandler_2 = require(\"domhandler\");\nObject.defineProperty(exports, \"DomHandler\", { enumerable: true, get: function () { return domhandler_2.DomHandler; } });\n// Old name for DomHandler\nObject.defineProperty(exports, \"DefaultHandler\", { enumerable: true, get: function () { return domhandler_2.DomHandler; } });\n// Helper methods\n/**\n * Parses the data, returns the resulting document.\n *\n * @param data The data that should be parsed.\n * @param options Optional options for the parser and DOM handler.\n */\nfunction parseDocument(data, options) {\n const handler = new domhandler_1.DomHandler(undefined, options);\n new Parser_js_1.Parser(handler, options).end(data);\n return handler.root;\n}\n/**\n * Parses data, returns an array of the root nodes.\n *\n * Note that the root nodes still have a `Document` node as their parent.\n * Use `parseDocument` to get the `Document` node instead.\n *\n * @param data The data that should be parsed.\n * @param options Optional options for the parser and DOM handler.\n * @deprecated Use `parseDocument` instead.\n */\nfunction parseDOM(data, options) {\n return parseDocument(data, options).children;\n}\n/**\n * Creates a parser instance, with an attached DOM handler.\n *\n * @param callback A callback that will be called once parsing has been completed, with the resulting document.\n * @param options Optional options for the parser and DOM handler.\n * @param elementCallback An optional callback that will be called every time a tag has been completed inside of the DOM.\n */\nfunction createDocumentStream(callback, options, elementCallback) {\n const handler = new domhandler_1.DomHandler((error) => callback(error, handler.root), options, elementCallback);\n return new Parser_js_1.Parser(handler, options);\n}\n/**\n * Creates a parser instance, with an attached DOM handler.\n *\n * @param callback A callback that will be called once parsing has been completed, with an array of root nodes.\n * @param options Optional options for the parser and DOM handler.\n * @param elementCallback An optional callback that will be called every time a tag has been completed inside of the DOM.\n * @deprecated Use `createDocumentStream` instead.\n */\nfunction createDomStream(callback, options, elementCallback) {\n const handler = new domhandler_1.DomHandler(callback, options, elementCallback);\n return new Parser_js_1.Parser(handler, options);\n}\nvar Tokenizer_js_1 = require(\"./Tokenizer.js\");\nObject.defineProperty(exports, \"Tokenizer\", { enumerable: true, get: function () { return __importDefault(Tokenizer_js_1).default; } });\nObject.defineProperty(exports, \"QuoteType\", { enumerable: true, get: function () { return Tokenizer_js_1.QuoteType; } });\n/*\n * All of the following exports exist for backwards-compatibility.\n * They should probably be removed eventually.\n */\nexports.ElementType = __importStar(require(\"domelementtype\"));\nconst domutils_1 = require(\"domutils\");\nvar domutils_2 = require(\"domutils\");\nObject.defineProperty(exports, \"getFeed\", { enumerable: true, get: function () { return domutils_2.getFeed; } });\nconst parseFeedDefaultOptions = { xmlMode: true };\n/**\n * Parse a feed.\n *\n * @param feed The feed that should be parsed, as a string.\n * @param options Optionally, options for parsing. When using this, you should set `xmlMode` to `true`.\n */\nfunction parseFeed(feed, options = parseFeedDefaultOptions) {\n return (0, domutils_1.getFeed)(parseDOM(feed, options));\n}\nexports.DomUtils = __importStar(require(\"domutils\"));\n//# sourceMappingURL=index.js.map"],"names":["ownKeys","__createBinding","this","Object","create","o","m","k","k2","undefined","desc","getOwnPropertyDescriptor","__esModule","writable","configurable","enumerable","get","defineProperty","__setModuleDefault","v","value","__importStar","getOwnPropertyNames","ar","prototype","hasOwnProperty","call","length","mod","result","i","__importDefault","default","exports","DomUtils","getFeed","QuoteType","Tokenizer","DomHandler","Parser","parseDocument","parseDOM","createDocumentStream","callback","options","elementCallback","handler","domhandler_1","error","root","Parser_js_1","createDomStream","parseFeed","feed","parseFeedDefaultOptions","domutils_1","require$$0","Parser_js_2","require$$1","domhandler_2","data","end","children","Tokenizer_js_1","require$$2","ElementType","require$$3","require$$4","domutils_2","xmlMode"],"mappings":"sXACA,IAiBQA,EAjBJC,EAAmBC,GAAQA,EAAKD,kBAAqBE,OAAOC,OAAM,SAAaC,EAAGC,EAAGC,EAAGC,QAC7EC,IAAPD,IAAkBA,EAAKD,GAC3B,IAAIG,EAAOP,OAAOQ,yBAAyBL,EAAGC,GACzCG,KAAS,QAASA,GAAQJ,EAAEM,WAAaF,EAAKG,UAAYH,EAAKI,gBAClEJ,EAAO,CAAEK,YAAY,EAAMC,IAAK,WAAa,OAAOV,EAAEC,EAAG,IAE3DJ,OAAOc,eAAeZ,EAAGG,EAAIE,EAChC,EAAA,SAAcL,EAAGC,EAAGC,EAAGC,QACTC,IAAPD,IAAkBA,EAAKD,GAC3BF,EAAEG,GAAMF,EAAEC,EACb,GACGW,EAAsBhB,GAAQA,EAAKgB,qBAAwBf,OAAOC,OAAM,SAAaC,EAAGc,GACxFhB,OAAOc,eAAeZ,EAAG,UAAW,CAAEU,YAAY,EAAMK,MAAOD,GAClE,EAAI,SAASd,EAAGc,GACbd,EAAW,QAAIc,CACnB,GACIE,EAAgBnB,GAAQA,EAAKmB,eACzBrB,EAAU,SAASK,GAMnB,OALAL,EAAUG,OAAOmB,qBAAuB,SAAUjB,GAC9C,IAAIkB,EAAK,GACT,IAAK,IAAIhB,KAAKF,EAAOF,OAAOqB,UAAUC,eAAeC,KAAKrB,EAAGE,KAAIgB,EAAGA,EAAGI,QAAUpB,GACjF,OAAOgB,GAEJvB,EAAQK,IAEZ,SAAUuB,GACb,GAAIA,GAAOA,EAAIhB,WAAY,OAAOgB,EAClC,IAAIC,EAAS,CAAA,EACb,GAAW,MAAPD,EAAa,IAAK,IAAIrB,EAAIP,EAAQ4B,GAAME,EAAI,EAAGA,EAAIvB,EAAEoB,OAAQG,IAAkB,YAATvB,EAAEuB,IAAkB7B,EAAgB4B,EAAQD,EAAKrB,EAAEuB,IAE7H,OADAZ,EAAmBW,EAAQD,GACpBC,IAGXE,EAAmB7B,GAAQA,EAAK6B,iBAAoB,SAAUH,GAC9D,OAAQA,GAAOA,EAAIhB,WAAcgB,EAAM,CAAEI,QAAWJ,IAExDzB,OAAOc,eAAcgB,EAAU,aAAc,CAAEb,OAAO,IACtDa,EAAmBC,SAAAD,EAAAE,QAAkBF,cAAsBA,EAAoBG,UAAAH,EAAAI,UAAoBJ,iBAAyBA,EAAqBK,WAAAL,EAAAM,YAAiB,EAClKN,EAAAO,cAAwBA,EACxBP,EAAAQ,SAAmBA,EACnBR,EAAAS,qBA2CA,SAA8BC,EAAUC,EAASC,GAC7C,MAAMC,EAAU,IAAIC,EAAaT,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../node_modules/htmlparser2/dist/commonjs/index.js"],"sourcesContent":["\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DomUtils = exports.getFeed = exports.ElementType = exports.QuoteType = exports.Tokenizer = exports.DefaultHandler = exports.DomHandler = exports.Parser = void 0;\nexports.parseDocument = parseDocument;\nexports.parseDOM = parseDOM;\nexports.createDocumentStream = createDocumentStream;\nexports.createDomStream = createDomStream;\nexports.parseFeed = parseFeed;\nconst Parser_js_1 = require(\"./Parser.js\");\nvar Parser_js_2 = require(\"./Parser.js\");\nObject.defineProperty(exports, \"Parser\", { enumerable: true, get: function () { return Parser_js_2.Parser; } });\nconst domhandler_1 = require(\"domhandler\");\nvar domhandler_2 = require(\"domhandler\");\nObject.defineProperty(exports, \"DomHandler\", { enumerable: true, get: function () { return domhandler_2.DomHandler; } });\n// Old name for DomHandler\nObject.defineProperty(exports, \"DefaultHandler\", { enumerable: true, get: function () { return domhandler_2.DomHandler; } });\n// Helper methods\n/**\n * Parses the data, returns the resulting document.\n *\n * @param data The data that should be parsed.\n * @param options Optional options for the parser and DOM handler.\n */\nfunction parseDocument(data, options) {\n const handler = new domhandler_1.DomHandler(undefined, options);\n new Parser_js_1.Parser(handler, options).end(data);\n return handler.root;\n}\n/**\n * Parses data, returns an array of the root nodes.\n *\n * Note that the root nodes still have a `Document` node as their parent.\n * Use `parseDocument` to get the `Document` node instead.\n *\n * @param data The data that should be parsed.\n * @param options Optional options for the parser and DOM handler.\n * @deprecated Use `parseDocument` instead.\n */\nfunction parseDOM(data, options) {\n return parseDocument(data, options).children;\n}\n/**\n * Creates a parser instance, with an attached DOM handler.\n *\n * @param callback A callback that will be called once parsing has been completed, with the resulting document.\n * @param options Optional options for the parser and DOM handler.\n * @param elementCallback An optional callback that will be called every time a tag has been completed inside of the DOM.\n */\nfunction createDocumentStream(callback, options, elementCallback) {\n const handler = new domhandler_1.DomHandler((error) => callback(error, handler.root), options, elementCallback);\n return new Parser_js_1.Parser(handler, options);\n}\n/**\n * Creates a parser instance, with an attached DOM handler.\n *\n * @param callback A callback that will be called once parsing has been completed, with an array of root nodes.\n * @param options Optional options for the parser and DOM handler.\n * @param elementCallback An optional callback that will be called every time a tag has been completed inside of the DOM.\n * @deprecated Use `createDocumentStream` instead.\n */\nfunction createDomStream(callback, options, elementCallback) {\n const handler = new domhandler_1.DomHandler(callback, options, elementCallback);\n return new Parser_js_1.Parser(handler, options);\n}\nvar Tokenizer_js_1 = require(\"./Tokenizer.js\");\nObject.defineProperty(exports, \"Tokenizer\", { enumerable: true, get: function () { return __importDefault(Tokenizer_js_1).default; } });\nObject.defineProperty(exports, \"QuoteType\", { enumerable: true, get: function () { return Tokenizer_js_1.QuoteType; } });\n/*\n * All of the following exports exist for backwards-compatibility.\n * They should probably be removed eventually.\n */\nexports.ElementType = __importStar(require(\"domelementtype\"));\nconst domutils_1 = require(\"domutils\");\nvar domutils_2 = require(\"domutils\");\nObject.defineProperty(exports, \"getFeed\", { enumerable: true, get: function () { return domutils_2.getFeed; } });\nconst parseFeedDefaultOptions = { xmlMode: true };\n/**\n * Parse a feed.\n *\n * @param feed The feed that should be parsed, as a string.\n * @param options Optionally, options for parsing. When using this, you should set `xmlMode` to `true`.\n */\nfunction parseFeed(feed, options = parseFeedDefaultOptions) {\n return (0, domutils_1.getFeed)(parseDOM(feed, options));\n}\nexports.DomUtils = __importStar(require(\"domutils\"));\n//# sourceMappingURL=index.js.map"],"names":["ownKeys","__createBinding","this","Object","create","o","m","k","k2","undefined","desc","getOwnPropertyDescriptor","__esModule","writable","configurable","enumerable","get","defineProperty","__setModuleDefault","v","value","__importStar","getOwnPropertyNames","ar","prototype","hasOwnProperty","call","length","mod","result","i","__importDefault","default","exports","DomUtils","getFeed","QuoteType","Tokenizer","DomHandler","Parser","parseDocument","parseDOM","createDocumentStream","callback","options","elementCallback","handler","domhandler_1","error","root","Parser_js_1","createDomStream","parseFeed","feed","parseFeedDefaultOptions","domutils_1","require$$0","Parser_js_2","require$$1","domhandler_2","data","end","children","Tokenizer_js_1","require$$2","ElementType","require$$3","require$$4","domutils_2","xmlMode"],"mappings":"sXACA,IAiBQA,EAjBJC,EAAmBC,GAAQA,EAAKD,kBAAqBE,OAAOC,OAAM,SAAaC,EAAGC,EAAGC,EAAGC,QAC7EC,IAAPD,IAAkBA,EAAKD,GAC3B,IAAIG,EAAOP,OAAOQ,yBAAyBL,EAAGC,GACzCG,KAAS,QAASA,GAAQJ,EAAEM,WAAaF,EAAKG,UAAYH,EAAKI,gBAClEJ,EAAO,CAAEK,YAAY,EAAMC,IAAK,WAAa,OAAOV,EAAEC,EAAG,IAE3DJ,OAAOc,eAAeZ,EAAGG,EAAIE,EAChC,EAAA,SAAcL,EAAGC,EAAGC,EAAGC,QACTC,IAAPD,IAAkBA,EAAKD,GAC3BF,EAAEG,GAAMF,EAAEC,EACb,GACGW,EAAsBhB,GAAQA,EAAKgB,qBAAwBf,OAAOC,OAAM,SAAaC,EAAGc,GACxFhB,OAAOc,eAAeZ,EAAG,UAAW,CAAEU,YAAY,EAAMK,MAAOD,GAClE,EAAI,SAASd,EAAGc,GACbd,EAAW,QAAIc,CACnB,GACIE,EAAgBnB,GAAQA,EAAKmB,eACzBrB,EAAU,SAASK,GAMnB,OALAL,E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