@svadmin/ai-elements 0.7.4 → 0.9.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/README.md +31 -4
- package/THIRD_PARTY_NOTICES.md +67 -6
- package/dist/ai-workspace-contract.d.ts +14 -0
- package/dist/ai-workspace-contract.js +14 -0
- package/dist/ai.css +2 -5
- package/dist/ai.theme.css +1 -0
- package/dist/class-properties.generated.d.ts +1 -0
- package/dist/class-properties.generated.js +2 -0
- package/dist/classnames.d.ts +8 -0
- package/dist/classnames.js +26 -0
- package/dist/components/Response.svelte +2 -2
- package/dist/components/Response.svelte.d.ts +1 -1
- package/dist/components/code/index.d.ts +9 -18
- package/dist/components/code/index.js +8 -11
- package/dist/components/code-block/highlight.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/utilities.css +3172 -0
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/package.json +36 -11
- package/vendor/streamdown/AnimatedText.svelte +93 -0
- package/vendor/streamdown/AnimatedText.svelte.d.ts +6 -0
- package/vendor/streamdown/Block.svelte +96 -0
- package/vendor/streamdown/Block.svelte.d.ts +11 -0
- package/vendor/streamdown/Elements/Alert.svelte +69 -0
- package/vendor/streamdown/Elements/Alert.svelte.d.ts +10 -0
- package/vendor/streamdown/Elements/Citation.svelte +260 -0
- package/vendor/streamdown/Elements/Citation.svelte.d.ts +7 -0
- package/vendor/streamdown/Elements/Code.svelte +226 -0
- package/vendor/streamdown/Elements/Code.svelte.d.ts +9 -0
- package/vendor/streamdown/Elements/Element.svelte +574 -0
- package/vendor/streamdown/Elements/Element.svelte.d.ts +10 -0
- package/vendor/streamdown/Elements/FootnoteRef.svelte +30 -0
- package/vendor/streamdown/Elements/FootnoteRef.svelte.d.ts +7 -0
- package/vendor/streamdown/Elements/Footnotes.svelte +54 -0
- package/vendor/streamdown/Elements/Footnotes.svelte.d.ts +7 -0
- package/vendor/streamdown/Elements/Image.svelte +200 -0
- package/vendor/streamdown/Elements/Image.svelte.d.ts +10 -0
- package/vendor/streamdown/Elements/Link.svelte +220 -0
- package/vendor/streamdown/Elements/Link.svelte.d.ts +10 -0
- package/vendor/streamdown/Elements/LinkSafetyModal.svelte +121 -0
- package/vendor/streamdown/Elements/LinkSafetyModal.svelte.d.ts +4 -0
- package/vendor/streamdown/Elements/Math.svelte +100 -0
- package/vendor/streamdown/Elements/Math.svelte.d.ts +9 -0
- package/vendor/streamdown/Elements/Mermaid.svelte +455 -0
- package/vendor/streamdown/Elements/Mermaid.svelte.d.ts +9 -0
- package/vendor/streamdown/Elements/MermaidDownload.svelte +145 -0
- package/vendor/streamdown/Elements/MermaidDownload.svelte.d.ts +8 -0
- package/vendor/streamdown/Elements/Slot.svelte +23 -0
- package/vendor/streamdown/Elements/Slot.svelte.d.ts +10 -0
- package/vendor/streamdown/Elements/Table.svelte +195 -0
- package/vendor/streamdown/Elements/Table.svelte.d.ts +9 -0
- package/vendor/streamdown/Elements/TableDownload.svelte +221 -0
- package/vendor/streamdown/Elements/TableDownload.svelte.d.ts +8 -0
- package/vendor/streamdown/Elements/fallbacks/CodeFallback.svelte +41 -0
- package/vendor/streamdown/Elements/fallbacks/CodeFallback.svelte.d.ts +9 -0
- package/vendor/streamdown/Elements/fallbacks/MathFallback.svelte +35 -0
- package/vendor/streamdown/Elements/fallbacks/MathFallback.svelte.d.ts +8 -0
- package/vendor/streamdown/Elements/fallbacks/MermaidFallback.svelte +36 -0
- package/vendor/streamdown/Elements/fallbacks/MermaidFallback.svelte.d.ts +9 -0
- package/vendor/streamdown/Elements/fallbacks/index.d.ts +3 -0
- package/vendor/streamdown/Elements/fallbacks/index.js +3 -0
- package/vendor/streamdown/Elements/icons.d.ts +31 -0
- package/vendor/streamdown/Elements/icons.js +200 -0
- package/vendor/streamdown/Elements/index.d.ts +8 -0
- package/vendor/streamdown/Elements/index.js +8 -0
- package/vendor/streamdown/Elements/popover.svelte.d.ts +8 -0
- package/vendor/streamdown/Elements/popover.svelte.js +45 -0
- package/vendor/streamdown/Elements/stepperState.svelte.d.ts +36 -0
- package/vendor/streamdown/Elements/stepperState.svelte.js +92 -0
- package/vendor/streamdown/IconProvider.svelte +11 -0
- package/vendor/streamdown/IconProvider.svelte.d.ts +30 -0
- package/vendor/streamdown/LICENSE +202 -0
- package/vendor/streamdown/PluginProvider.svelte +11 -0
- package/vendor/streamdown/PluginProvider.svelte.d.ts +30 -0
- package/vendor/streamdown/README.svadmin.md +5 -0
- package/vendor/streamdown/Streamdown.svelte +447 -0
- package/vendor/streamdown/Streamdown.svelte.d.ts +25 -0
- package/vendor/streamdown/block/BlockTokens.svelte +45 -0
- package/vendor/streamdown/block/BlockTokens.svelte.d.ts +9 -0
- package/vendor/streamdown/block/html.d.ts +14 -0
- package/vendor/streamdown/block/html.js +27 -0
- package/vendor/streamdown/block/text.d.ts +10 -0
- package/vendor/streamdown/block/text.js +31 -0
- package/vendor/streamdown/context-key.d.ts +1 -0
- package/vendor/streamdown/context-key.js +1 -0
- package/vendor/streamdown/context.svelte.d.ts +24 -0
- package/vendor/streamdown/context.svelte.js +75 -0
- package/vendor/streamdown/contracts/plugins.d.ts +26 -0
- package/vendor/streamdown/contracts/plugins.js +1 -0
- package/vendor/streamdown/contracts/streamdown.d.ts +374 -0
- package/vendor/streamdown/contracts/streamdown.js +29 -0
- package/vendor/streamdown/detect-direction.d.ts +1 -0
- package/vendor/streamdown/detect-direction.js +1 -0
- package/vendor/streamdown/icon-context.d.ts +36 -0
- package/vendor/streamdown/icon-context.js +52 -0
- package/vendor/streamdown/incomplete-code.d.ts +6 -0
- package/vendor/streamdown/incomplete-code.js +23 -0
- package/vendor/streamdown/index.d.ts +22 -0
- package/vendor/streamdown/index.js +20 -0
- package/vendor/streamdown/markdown-parse-cache.d.ts +37 -0
- package/vendor/streamdown/markdown-parse-cache.js +109 -0
- package/vendor/streamdown/markdown.d.ts +21 -0
- package/vendor/streamdown/markdown.js +214 -0
- package/vendor/streamdown/marked/index.d.ts +44 -0
- package/vendor/streamdown/marked/index.js +228 -0
- package/vendor/streamdown/marked/marked-alert.d.ts +13 -0
- package/vendor/streamdown/marked/marked-alert.js +47 -0
- package/vendor/streamdown/marked/marked-align.d.ts +10 -0
- package/vendor/streamdown/marked/marked-align.js +45 -0
- package/vendor/streamdown/marked/marked-br.d.ts +6 -0
- package/vendor/streamdown/marked/marked-br.js +15 -0
- package/vendor/streamdown/marked/marked-citations.d.ts +8 -0
- package/vendor/streamdown/marked/marked-citations.js +53 -0
- package/vendor/streamdown/marked/marked-cjk.d.ts +2 -0
- package/vendor/streamdown/marked/marked-cjk.js +165 -0
- package/vendor/streamdown/marked/marked-dl.d.ts +23 -0
- package/vendor/streamdown/marked/marked-dl.js +44 -0
- package/vendor/streamdown/marked/marked-footnotes.d.ts +26 -0
- package/vendor/streamdown/marked/marked-footnotes.js +101 -0
- package/vendor/streamdown/marked/marked-hr.d.ts +6 -0
- package/vendor/streamdown/marked/marked-hr.js +18 -0
- package/vendor/streamdown/marked/marked-list.d.ts +31 -0
- package/vendor/streamdown/marked/marked-list.js +330 -0
- package/vendor/streamdown/marked/marked-math.d.ts +13 -0
- package/vendor/streamdown/marked/marked-math.js +129 -0
- package/vendor/streamdown/marked/marked-mdx.d.ts +12 -0
- package/vendor/streamdown/marked/marked-mdx.js +124 -0
- package/vendor/streamdown/marked/marked-subsup.d.ts +22 -0
- package/vendor/streamdown/marked/marked-subsup.js +40 -0
- package/vendor/streamdown/marked/marked-table.d.ts +80 -0
- package/vendor/streamdown/marked/marked-table.js +527 -0
- package/vendor/streamdown/plugin-context.d.ts +19 -0
- package/vendor/streamdown/plugin-context.js +40 -0
- package/vendor/streamdown/plugins/cjk-shared.d.ts +1 -0
- package/vendor/streamdown/plugins/cjk-shared.js +1 -0
- package/vendor/streamdown/plugins.d.ts +19 -0
- package/vendor/streamdown/plugins.js +107 -0
- package/vendor/streamdown/provenance.json +229 -0
- package/vendor/streamdown/remend.d.ts +2 -0
- package/vendor/streamdown/remend.js +1 -0
- package/vendor/streamdown/security/html.d.ts +19 -0
- package/vendor/streamdown/security/html.js +329 -0
- package/vendor/streamdown/security/preprocess-custom-tags.d.ts +1 -0
- package/vendor/streamdown/security/preprocess-custom-tags.js +20 -0
- package/vendor/streamdown/security/preprocess-literal-tag-content.d.ts +1 -0
- package/vendor/streamdown/security/preprocess-literal-tag-content.js +16 -0
- package/vendor/streamdown/security/types.d.ts +1 -0
- package/vendor/streamdown/security/types.js +1 -0
- package/vendor/streamdown/site/SiteHeader.svelte +94 -0
- package/vendor/streamdown/site/SiteHeader.svelte.d.ts +6 -0
- package/vendor/streamdown/site/home/HomeDemo.svelte +122 -0
- package/vendor/streamdown/site/home/HomeDemo.svelte.d.ts +3 -0
- package/vendor/streamdown/site/home/HomePage.svelte +293 -0
- package/vendor/streamdown/site/home/HomePage.svelte.d.ts +3 -0
- package/vendor/streamdown/site/home/content.d.ts +69 -0
- package/vendor/streamdown/site/home/content.js +144 -0
- package/vendor/streamdown/site/metadata.d.ts +4 -0
- package/vendor/streamdown/site/metadata.js +4 -0
- package/vendor/streamdown/site/navigation.d.ts +6 -0
- package/vendor/streamdown/site/navigation.js +22 -0
- package/vendor/streamdown/streamdown/config.d.ts +41 -0
- package/vendor/streamdown/streamdown/config.js +125 -0
- package/vendor/streamdown/streamdown/context.d.ts +12 -0
- package/vendor/streamdown/streamdown/context.js +2 -0
- package/vendor/streamdown/streamdown/incomplete-markdown.d.ts +5 -0
- package/vendor/streamdown/streamdown/incomplete-markdown.js +79 -0
- package/vendor/streamdown/streamdown/pipeline.d.ts +95 -0
- package/vendor/streamdown/streamdown/pipeline.js +138 -0
- package/vendor/streamdown/streamdown/runtime.d.ts +59 -0
- package/vendor/streamdown/streamdown/runtime.js +112 -0
- package/vendor/streamdown/streaming.d.ts +5 -0
- package/vendor/streamdown/streaming.js +5 -0
- package/vendor/streamdown/theme.d.ts +486 -0
- package/vendor/streamdown/theme.js +370 -0
- package/vendor/streamdown/translations.d.ts +43 -0
- package/vendor/streamdown/translations.js +54 -0
- package/vendor/streamdown/url-policy.d.ts +1 -0
- package/vendor/streamdown/url-policy.js +1 -0
- package/vendor/streamdown/utils/bind.d.ts +8 -0
- package/vendor/streamdown/utils/bind.js +26 -0
- package/vendor/streamdown/utils/bundledLanguages.d.ts +1 -0
- package/vendor/streamdown/utils/bundledLanguages.js +1 -0
- package/vendor/streamdown/utils/code-block.d.ts +8 -0
- package/vendor/streamdown/utils/code-block.js +38 -0
- package/vendor/streamdown/utils/copy.svelte.d.ts +7 -0
- package/vendor/streamdown/utils/copy.svelte.js +38 -0
- package/vendor/streamdown/utils/darkMode.svelte.d.ts +3 -0
- package/vendor/streamdown/utils/darkMode.svelte.js +49 -0
- package/vendor/streamdown/utils/detectDirection.d.ts +1 -0
- package/vendor/streamdown/utils/detectDirection.js +19 -0
- package/vendor/streamdown/utils/get.d.ts +1 -0
- package/vendor/streamdown/utils/get.js +25 -0
- package/vendor/streamdown/utils/hightlighter.svelte.d.ts +30 -0
- package/vendor/streamdown/utils/hightlighter.svelte.js +524 -0
- package/vendor/streamdown/utils/index.d.ts +3 -0
- package/vendor/streamdown/utils/index.js +3 -0
- package/vendor/streamdown/utils/mermaid.d.ts +13 -0
- package/vendor/streamdown/utils/mermaid.js +49 -0
- package/vendor/streamdown/utils/panzoom.svelte.d.ts +35 -0
- package/vendor/streamdown/utils/panzoom.svelte.js +556 -0
- package/vendor/streamdown/utils/parse-incomplete-markdown.d.ts +2 -0
- package/vendor/streamdown/utils/parse-incomplete-markdown.js +2 -0
- package/vendor/streamdown/utils/runtime-env.d.ts +1 -0
- package/vendor/streamdown/utils/runtime-env.js +13 -0
- package/vendor/streamdown/utils/save.d.ts +1 -0
- package/vendor/streamdown/utils/save.js +14 -0
- package/vendor/streamdown/utils/scroll-lock.d.ts +2 -0
- package/vendor/streamdown/utils/scroll-lock.js +35 -0
- package/vendor/streamdown/utils/table.d.ts +8 -0
- package/vendor/streamdown/utils/table.js +176 -0
- package/vendor/streamdown/utils/url.d.ts +22 -0
- package/vendor/streamdown/utils/url.js +98 -0
- package/vendor/streamdown/utils/useClickOutside.svelte.d.ts +8 -0
- package/vendor/streamdown/utils/useClickOutside.svelte.js +41 -0
- package/vendor/streamdown/utils/useKeyDown.svelte.d.ts +5 -0
- package/vendor/streamdown/utils/useKeyDown.svelte.js +23 -0
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
import { harden } from 'rehype-harden';
|
|
2
|
+
import rehypeRaw from 'rehype-raw';
|
|
3
|
+
import rehypeSanitize, { defaultSchema } from 'rehype-sanitize';
|
|
4
|
+
import rehypeStringify from 'rehype-stringify';
|
|
5
|
+
import remarkGfm from 'remark-gfm';
|
|
6
|
+
import remarkParse from 'remark-parse';
|
|
7
|
+
import remarkRehype from 'remark-rehype';
|
|
8
|
+
import { Lexer } from 'marked';
|
|
9
|
+
import { unified } from 'unified';
|
|
10
|
+
import { applyMarkdownUrlTransform, createMarkdownElement } from '../markdown.js';
|
|
11
|
+
import { isPathRelativeUrl, parseAllowedUrlPrefixes, transformParsedUrl } from '../utils/url.js';
|
|
12
|
+
const HTML_BLOCK_ELEMENT_START_PATTERN = /^[ \t]{0,3}<([A-Za-z][\w:-]*)(?=[\s>/])/;
|
|
13
|
+
const HTML_INDENTED_TAG_LINE_PATTERN = /^[ \t]{4,}(?=<[\w!/?-])/;
|
|
14
|
+
const HTML_TAG_PATTERN = /<\/?([A-Za-z][\w:-]*)(?=[\s/>])[^>]*>/g;
|
|
15
|
+
const HTML_VOID_ELEMENTS = new Set([
|
|
16
|
+
'area',
|
|
17
|
+
'base',
|
|
18
|
+
'br',
|
|
19
|
+
'col',
|
|
20
|
+
'embed',
|
|
21
|
+
'hr',
|
|
22
|
+
'img',
|
|
23
|
+
'input',
|
|
24
|
+
'link',
|
|
25
|
+
'meta',
|
|
26
|
+
'param',
|
|
27
|
+
'source',
|
|
28
|
+
'track',
|
|
29
|
+
'wbr'
|
|
30
|
+
]);
|
|
31
|
+
const HTML_LITERAL_CONTENT_TAGS = new Set([
|
|
32
|
+
'code',
|
|
33
|
+
'plaintext',
|
|
34
|
+
'pre',
|
|
35
|
+
'script',
|
|
36
|
+
'style',
|
|
37
|
+
'textarea',
|
|
38
|
+
'title',
|
|
39
|
+
'xmp'
|
|
40
|
+
]);
|
|
41
|
+
const defaultSanitizeSchema = {
|
|
42
|
+
...defaultSchema,
|
|
43
|
+
protocols: {
|
|
44
|
+
...defaultSchema.protocols,
|
|
45
|
+
href: [...(defaultSchema.protocols?.href ?? []), 'tel']
|
|
46
|
+
},
|
|
47
|
+
attributes: {
|
|
48
|
+
...defaultSchema.attributes,
|
|
49
|
+
code: [...(defaultSchema.attributes?.code ?? []), 'metastring']
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
const URL_ATTRIBUTE_KEYS = new Set(['href', 'src']);
|
|
53
|
+
const FALLBACK_HARDEN_ORIGIN = 'https://streamdown.invalid';
|
|
54
|
+
const WILDCARD_PREFIX = ['*'];
|
|
55
|
+
const sanitizeSchemaCache = new WeakMap();
|
|
56
|
+
const PARSED_WILDCARD_PREFIX = [{ type: 'wildcard' }];
|
|
57
|
+
const visitRehypeTree = (node, visitor) => {
|
|
58
|
+
visitor(node);
|
|
59
|
+
if (Array.isArray(node.children)) {
|
|
60
|
+
for (const child of node.children) {
|
|
61
|
+
visitRehypeTree(child, visitor);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
function rehypeTransformUrls({ urlTransform } = {}) {
|
|
66
|
+
return (tree) => {
|
|
67
|
+
if (!urlTransform) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
visitRehypeTree(tree, (node) => {
|
|
71
|
+
if (node.type !== 'element' || typeof node.tagName !== 'string' || !node.properties) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const element = createMarkdownElement(node.tagName, node.properties);
|
|
75
|
+
for (const [key, value] of Object.entries(node.properties)) {
|
|
76
|
+
if (!URL_ATTRIBUTE_KEYS.has(key) || value == null || Array.isArray(value)) {
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
const transformedValue = urlTransform(String(value), key, element);
|
|
80
|
+
if (transformedValue == null) {
|
|
81
|
+
delete node.properties[key];
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
node.properties[key] = transformedValue;
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
function resolveHardenDefaultOrigin(defaultOrigin, rawAllowedLinkPrefixes, rawAllowedImagePrefixes, allowedLinkPrefixes, allowedImagePrefixes) {
|
|
90
|
+
if (defaultOrigin) {
|
|
91
|
+
return defaultOrigin;
|
|
92
|
+
}
|
|
93
|
+
for (const prefix of [...allowedLinkPrefixes, ...allowedImagePrefixes]) {
|
|
94
|
+
if (prefix.type === 'url') {
|
|
95
|
+
return prefix.url.origin;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if ([...rawAllowedLinkPrefixes, ...rawAllowedImagePrefixes].some((prefix) => prefix !== '*')) {
|
|
99
|
+
return FALLBACK_HARDEN_ORIGIN;
|
|
100
|
+
}
|
|
101
|
+
return '';
|
|
102
|
+
}
|
|
103
|
+
export const escapeHtml = (value) => value
|
|
104
|
+
.replaceAll('&', '&')
|
|
105
|
+
.replaceAll('<', '<')
|
|
106
|
+
.replaceAll('>', '>')
|
|
107
|
+
.replaceAll('"', '"')
|
|
108
|
+
.replaceAll("'", ''');
|
|
109
|
+
function createSanitizeSchema(allowedTags) {
|
|
110
|
+
if (!allowedTags || Object.keys(allowedTags).length === 0) {
|
|
111
|
+
return defaultSanitizeSchema;
|
|
112
|
+
}
|
|
113
|
+
const cachedSchema = sanitizeSchemaCache.get(allowedTags);
|
|
114
|
+
if (cachedSchema) {
|
|
115
|
+
return cachedSchema;
|
|
116
|
+
}
|
|
117
|
+
const schema = {
|
|
118
|
+
...defaultSanitizeSchema,
|
|
119
|
+
tagNames: [
|
|
120
|
+
...new Set([...(defaultSanitizeSchema.tagNames ?? []), ...Object.keys(allowedTags)])
|
|
121
|
+
],
|
|
122
|
+
attributes: {
|
|
123
|
+
...defaultSanitizeSchema.attributes,
|
|
124
|
+
...allowedTags
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
sanitizeSchemaCache.set(allowedTags, schema);
|
|
128
|
+
return schema;
|
|
129
|
+
}
|
|
130
|
+
function hasProtocolOnlyPrefix(allowedPrefixes) {
|
|
131
|
+
return allowedPrefixes.some((prefix) => prefix.type === 'protocol');
|
|
132
|
+
}
|
|
133
|
+
const createMarkdownSecurityProcessor = ({ allowedImagePrefixes, allowedLinkPrefixes, allowedTags, defaultOrigin, urlTransform }) => {
|
|
134
|
+
const parsedAllowedLinkPrefixes = parseAllowedUrlPrefixes(allowedLinkPrefixes, defaultOrigin);
|
|
135
|
+
const parsedAllowedImagePrefixes = parseAllowedUrlPrefixes(allowedImagePrefixes, defaultOrigin);
|
|
136
|
+
const shouldDelegateLinkPrefixChecks = hasProtocolOnlyPrefix(parsedAllowedLinkPrefixes);
|
|
137
|
+
const shouldDelegateImagePrefixChecks = hasProtocolOnlyPrefix(parsedAllowedImagePrefixes);
|
|
138
|
+
const hardenAllowedLinkPrefixes = shouldDelegateLinkPrefixChecks
|
|
139
|
+
? WILDCARD_PREFIX
|
|
140
|
+
: allowedLinkPrefixes;
|
|
141
|
+
const hardenAllowedImagePrefixes = shouldDelegateImagePrefixChecks
|
|
142
|
+
? WILDCARD_PREFIX
|
|
143
|
+
: allowedImagePrefixes;
|
|
144
|
+
const hardenDefaultOrigin = resolveHardenDefaultOrigin(defaultOrigin, hardenAllowedLinkPrefixes, hardenAllowedImagePrefixes, shouldDelegateLinkPrefixChecks
|
|
145
|
+
? PARSED_WILDCARD_PREFIX
|
|
146
|
+
: parseAllowedUrlPrefixes(hardenAllowedLinkPrefixes, defaultOrigin), shouldDelegateImagePrefixChecks
|
|
147
|
+
? PARSED_WILDCARD_PREFIX
|
|
148
|
+
: parseAllowedUrlPrefixes(hardenAllowedImagePrefixes, defaultOrigin));
|
|
149
|
+
const securityUrlTransform = createSecurityUrlTransform({
|
|
150
|
+
allowedImagePrefixes: parsedAllowedImagePrefixes,
|
|
151
|
+
allowedLinkPrefixes: parsedAllowedLinkPrefixes,
|
|
152
|
+
shouldDelegateImagePrefixChecks,
|
|
153
|
+
shouldDelegateLinkPrefixChecks,
|
|
154
|
+
defaultOrigin,
|
|
155
|
+
urlTransform
|
|
156
|
+
});
|
|
157
|
+
return unified()
|
|
158
|
+
.use(remarkParse)
|
|
159
|
+
.use(remarkGfm)
|
|
160
|
+
.use(remarkRehype, { allowDangerousHtml: true })
|
|
161
|
+
.use(rehypeRaw)
|
|
162
|
+
.use(rehypeSanitize, createSanitizeSchema(allowedTags))
|
|
163
|
+
.use(rehypeTransformUrls, { urlTransform: securityUrlTransform })
|
|
164
|
+
.use(harden, {
|
|
165
|
+
allowedImagePrefixes: hardenAllowedImagePrefixes === WILDCARD_PREFIX
|
|
166
|
+
? WILDCARD_PREFIX
|
|
167
|
+
: [...hardenAllowedImagePrefixes],
|
|
168
|
+
allowedLinkPrefixes: hardenAllowedLinkPrefixes === WILDCARD_PREFIX
|
|
169
|
+
? WILDCARD_PREFIX
|
|
170
|
+
: [...hardenAllowedLinkPrefixes],
|
|
171
|
+
allowedProtocols: WILDCARD_PREFIX,
|
|
172
|
+
defaultOrigin: hardenDefaultOrigin,
|
|
173
|
+
allowDataImages: true
|
|
174
|
+
})
|
|
175
|
+
.use(rehypeStringify);
|
|
176
|
+
};
|
|
177
|
+
const hasOnlyWildcardPrefix = (prefixes) => prefixes.length === 1 && prefixes[0] === '*';
|
|
178
|
+
const defaultMarkdownSecurityProcessor = createMarkdownSecurityProcessor({
|
|
179
|
+
allowedImagePrefixes: WILDCARD_PREFIX,
|
|
180
|
+
allowedLinkPrefixes: WILDCARD_PREFIX
|
|
181
|
+
});
|
|
182
|
+
function createSecurityUrlTransform({ allowedImagePrefixes, allowedLinkPrefixes, shouldDelegateImagePrefixChecks, shouldDelegateLinkPrefixChecks, defaultOrigin, urlTransform }) {
|
|
183
|
+
return (url, key, node) => {
|
|
184
|
+
const transformedUrl = applyMarkdownUrlTransform(url, key, node, urlTransform);
|
|
185
|
+
if (typeof transformedUrl !== 'string') {
|
|
186
|
+
return transformedUrl;
|
|
187
|
+
}
|
|
188
|
+
if (node.tagName === 'a' && key === 'href') {
|
|
189
|
+
if (!shouldDelegateLinkPrefixChecks || isPathRelativeUrl(transformedUrl)) {
|
|
190
|
+
return transformedUrl;
|
|
191
|
+
}
|
|
192
|
+
return transformParsedUrl(transformedUrl, allowedLinkPrefixes, defaultOrigin, {
|
|
193
|
+
kind: 'link'
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
if (node.tagName === 'img' && key === 'src') {
|
|
197
|
+
if (!shouldDelegateImagePrefixChecks || isPathRelativeUrl(transformedUrl)) {
|
|
198
|
+
return transformedUrl;
|
|
199
|
+
}
|
|
200
|
+
return transformParsedUrl(transformedUrl, allowedImagePrefixes, defaultOrigin, {
|
|
201
|
+
kind: 'image'
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
return transformedUrl;
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
export function normalizeHtmlIndentation(content) {
|
|
208
|
+
if (typeof content !== 'string' || content.length === 0) {
|
|
209
|
+
return content;
|
|
210
|
+
}
|
|
211
|
+
if (!content.includes('<')) {
|
|
212
|
+
return content;
|
|
213
|
+
}
|
|
214
|
+
const lineBreak = content.includes('\r\n') ? '\r\n' : '\n';
|
|
215
|
+
const lines = content.split(/\r?\n/);
|
|
216
|
+
let changed = false;
|
|
217
|
+
for (let lineIndex = 0; lineIndex < lines.length; lineIndex += 1) {
|
|
218
|
+
const blockEndIndex = findHtmlBlockEnd(lines, lineIndex);
|
|
219
|
+
if (blockEndIndex == null) {
|
|
220
|
+
continue;
|
|
221
|
+
}
|
|
222
|
+
const normalizedBlockLines = normalizeHtmlBlockLines(lines.slice(lineIndex, blockEndIndex + 1));
|
|
223
|
+
if (!normalizedBlockLines) {
|
|
224
|
+
lineIndex = blockEndIndex;
|
|
225
|
+
continue;
|
|
226
|
+
}
|
|
227
|
+
lines.splice(lineIndex, normalizedBlockLines.length, ...normalizedBlockLines);
|
|
228
|
+
changed = true;
|
|
229
|
+
lineIndex = blockEndIndex;
|
|
230
|
+
}
|
|
231
|
+
return changed ? lines.join(lineBreak) : content;
|
|
232
|
+
}
|
|
233
|
+
function normalizeHtmlBlockLines(blockLines) {
|
|
234
|
+
let changed = false;
|
|
235
|
+
const normalizedLines = blockLines.map((line, index) => {
|
|
236
|
+
if (index === 0 || !line || !HTML_INDENTED_TAG_LINE_PATTERN.test(line)) {
|
|
237
|
+
return line;
|
|
238
|
+
}
|
|
239
|
+
changed = true;
|
|
240
|
+
return line.replace(HTML_INDENTED_TAG_LINE_PATTERN, '');
|
|
241
|
+
});
|
|
242
|
+
if (!changed) {
|
|
243
|
+
return null;
|
|
244
|
+
}
|
|
245
|
+
return isSafeNormalizedHtmlBlock(normalizedLines.join('\n')) ? normalizedLines : null;
|
|
246
|
+
}
|
|
247
|
+
function findHtmlBlockEnd(lines, startIndex) {
|
|
248
|
+
const startLine = lines[startIndex];
|
|
249
|
+
const startTagMatch = startLine?.match(HTML_BLOCK_ELEMENT_START_PATTERN);
|
|
250
|
+
if (!startTagMatch) {
|
|
251
|
+
return null;
|
|
252
|
+
}
|
|
253
|
+
const rootTagName = startTagMatch[1].toLowerCase();
|
|
254
|
+
if (HTML_LITERAL_CONTENT_TAGS.has(rootTagName)) {
|
|
255
|
+
return null;
|
|
256
|
+
}
|
|
257
|
+
const tagStack = collectOpenHtmlTags(startLine);
|
|
258
|
+
if (tagStack.length === 0) {
|
|
259
|
+
return startIndex;
|
|
260
|
+
}
|
|
261
|
+
for (let lineIndex = startIndex + 1; lineIndex < lines.length; lineIndex += 1) {
|
|
262
|
+
updateHtmlTagStack(tagStack, lines[lineIndex] ?? '');
|
|
263
|
+
if (tagStack.length === 0) {
|
|
264
|
+
return lineIndex;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
return null;
|
|
268
|
+
}
|
|
269
|
+
function collectOpenHtmlTags(line) {
|
|
270
|
+
const tagStack = [];
|
|
271
|
+
updateHtmlTagStack(tagStack, line);
|
|
272
|
+
return tagStack;
|
|
273
|
+
}
|
|
274
|
+
function updateHtmlTagStack(tagStack, line) {
|
|
275
|
+
for (const match of line.matchAll(HTML_TAG_PATTERN)) {
|
|
276
|
+
const rawTag = match[0];
|
|
277
|
+
const tagName = match[1]?.toLowerCase();
|
|
278
|
+
if (!tagName) {
|
|
279
|
+
continue;
|
|
280
|
+
}
|
|
281
|
+
if (rawTag.startsWith('</')) {
|
|
282
|
+
const lastMatchingIndex = tagStack.lastIndexOf(tagName);
|
|
283
|
+
if (lastMatchingIndex !== -1) {
|
|
284
|
+
tagStack.length = lastMatchingIndex;
|
|
285
|
+
}
|
|
286
|
+
continue;
|
|
287
|
+
}
|
|
288
|
+
if (HTML_VOID_ELEMENTS.has(tagName) || rawTag.trimEnd().endsWith('/>')) {
|
|
289
|
+
continue;
|
|
290
|
+
}
|
|
291
|
+
tagStack.push(tagName);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
function isSafeNormalizedHtmlBlock(block) {
|
|
295
|
+
const tokens = Lexer.lex(block, { gfm: true }).filter((token) => token.type !== 'space');
|
|
296
|
+
return (tokens.length > 0 &&
|
|
297
|
+
tokens.every((token) => token.type === 'html' && 'block' in token && token.block === true));
|
|
298
|
+
}
|
|
299
|
+
export function renderMarkdownFragment(source, { allowedImagePrefixes = ['*'], allowedLinkPrefixes = ['*'], allowedTags, defaultOrigin, urlTransform } = {}) {
|
|
300
|
+
try {
|
|
301
|
+
if (!allowedTags &&
|
|
302
|
+
!defaultOrigin &&
|
|
303
|
+
!urlTransform &&
|
|
304
|
+
hasOnlyWildcardPrefix(allowedLinkPrefixes) &&
|
|
305
|
+
hasOnlyWildcardPrefix(allowedImagePrefixes)) {
|
|
306
|
+
return String(defaultMarkdownSecurityProcessor.processSync(source));
|
|
307
|
+
}
|
|
308
|
+
return String(createMarkdownSecurityProcessor({
|
|
309
|
+
allowedImagePrefixes,
|
|
310
|
+
allowedLinkPrefixes,
|
|
311
|
+
allowedTags,
|
|
312
|
+
defaultOrigin,
|
|
313
|
+
urlTransform
|
|
314
|
+
}).processSync(source));
|
|
315
|
+
}
|
|
316
|
+
catch {
|
|
317
|
+
return escapeHtml(source);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
export function renderHtmlToken(token, { renderHtml, ...options } = {}) {
|
|
321
|
+
if (options.skipHtml) {
|
|
322
|
+
return '';
|
|
323
|
+
}
|
|
324
|
+
const source = typeof renderHtml === 'function' ? renderHtml(token) : token.raw;
|
|
325
|
+
if (renderHtml === false) {
|
|
326
|
+
return escapeHtml(source);
|
|
327
|
+
}
|
|
328
|
+
return renderMarkdownFragment(source, options);
|
|
329
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const preprocessCustomTags: (markdown: string, tagNames: string[]) => string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const preprocessCustomTags = (markdown, tagNames) => {
|
|
2
|
+
if (!tagNames.length) {
|
|
3
|
+
return markdown;
|
|
4
|
+
}
|
|
5
|
+
let result = markdown;
|
|
6
|
+
for (const tagName of tagNames) {
|
|
7
|
+
const pattern = new RegExp(`(<${tagName}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${tagName}\\s*>)`, 'gi');
|
|
8
|
+
result = result.replace(pattern, (_match, open, content, close) => {
|
|
9
|
+
if (!content.includes('\n\n')) {
|
|
10
|
+
return open + content + close;
|
|
11
|
+
}
|
|
12
|
+
const fixedContent = content.replace(/\n\n/g, '\n<!---->\n');
|
|
13
|
+
const paddedContent = (fixedContent.startsWith('\n') ? '' : '\n') +
|
|
14
|
+
fixedContent +
|
|
15
|
+
(fixedContent.endsWith('\n') ? '' : '\n');
|
|
16
|
+
return `${open}${paddedContent}${close}\n\n`;
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const preprocessLiteralTagContent: (markdown: string, tagNames: string[]) => string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const MARKDOWN_ESCAPE_RE = /([\\`*_~[\]|])/g;
|
|
2
|
+
const escapeMarkdown = (text) => text.replace(MARKDOWN_ESCAPE_RE, '\\$1');
|
|
3
|
+
export const preprocessLiteralTagContent = (markdown, tagNames) => {
|
|
4
|
+
if (!tagNames.length) {
|
|
5
|
+
return markdown;
|
|
6
|
+
}
|
|
7
|
+
let result = markdown;
|
|
8
|
+
for (const tagName of tagNames) {
|
|
9
|
+
const pattern = new RegExp(`(<${tagName}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${tagName}\\s*>)`, 'gi');
|
|
10
|
+
result = result.replace(pattern, (_match, open, content, close) => {
|
|
11
|
+
const escaped = escapeMarkdown(content).replace(/\n\n/g, ' ');
|
|
12
|
+
return open + escaped + close;
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return result;
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type AllowedTags = Record<string, string[]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { page } from '$app/state';
|
|
3
|
+
import { onMount } from 'svelte';
|
|
4
|
+
import { useTheme } from 'svelte-themes';
|
|
5
|
+
import { REPO_URL } from './metadata.js';
|
|
6
|
+
import { siteNavItems } from './navigation.js';
|
|
7
|
+
|
|
8
|
+
type Props = {
|
|
9
|
+
fullWidth?: boolean;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
let { fullWidth = false }: Props = $props();
|
|
13
|
+
|
|
14
|
+
const theme = useTheme();
|
|
15
|
+
let currentHash = $state('');
|
|
16
|
+
|
|
17
|
+
const containerClass = $derived(
|
|
18
|
+
fullWidth
|
|
19
|
+
? 'mx-auto flex h-[4.35rem] w-full items-center gap-4 px-4 md:px-6 xl:px-8'
|
|
20
|
+
: 'mx-auto flex h-[4.35rem] w-full items-center gap-4 px-4 md:px-6 xl:px-8'
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
function syncHash() {
|
|
24
|
+
if (typeof window === 'undefined') {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
currentHash = window.location.hash;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function isActive(href: string) {
|
|
32
|
+
return siteNavItems.find((item) => item.href === href)?.match(page.url.pathname, currentHash) ?? false;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function toggleTheme() {
|
|
36
|
+
theme.theme = theme.resolvedTheme === 'dark' ? 'light' : 'dark';
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
onMount(() => {
|
|
40
|
+
syncHash();
|
|
41
|
+
window.addEventListener('hashchange', syncHash);
|
|
42
|
+
|
|
43
|
+
return () => {
|
|
44
|
+
window.removeEventListener('hashchange', syncHash);
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<header class="sticky top-0 z-30 w-full border-b border-border bg-sidebar/90 backdrop-blur">
|
|
50
|
+
<div class={containerClass}>
|
|
51
|
+
<a
|
|
52
|
+
class="font-brand-sans flex shrink-0 items-center gap-3 text-[1.05rem] font-semibold tracking-[-0.035em] text-foreground md:text-[1.25rem]"
|
|
53
|
+
href="/"
|
|
54
|
+
>
|
|
55
|
+
<img alt="Streamdown-Svelte" class="size-7 md:size-8" src="/favicon.svg" />
|
|
56
|
+
<span>Streamdown-Svelte</span>
|
|
57
|
+
</a>
|
|
58
|
+
|
|
59
|
+
<nav class="min-w-0 flex-1 overflow-x-auto">
|
|
60
|
+
<div class="flex min-w-max items-center gap-1.5 rounded-xl p-1">
|
|
61
|
+
{#each siteNavItems as item}
|
|
62
|
+
<a
|
|
63
|
+
class={`font-brand-sans rounded-lg px-4 py-2 text-[0.95rem] font-medium tracking-[-0.02em] transition-colors md:text-[1rem] ${
|
|
64
|
+
isActive(item.href)
|
|
65
|
+
? 'bg-background text-foreground shadow-sm'
|
|
66
|
+
: 'text-muted-foreground hover:bg-background/70 hover:text-foreground'
|
|
67
|
+
}`}
|
|
68
|
+
href={item.href}
|
|
69
|
+
>
|
|
70
|
+
{item.label}
|
|
71
|
+
</a>
|
|
72
|
+
{/each}
|
|
73
|
+
</div>
|
|
74
|
+
</nav>
|
|
75
|
+
|
|
76
|
+
<div class="flex shrink-0 items-center gap-2">
|
|
77
|
+
<a
|
|
78
|
+
class="font-brand-sans hidden rounded-lg px-4 py-2 text-[0.95rem] font-medium tracking-[-0.02em] text-muted-foreground transition-colors hover:bg-background/70 hover:text-foreground sm:inline-flex"
|
|
79
|
+
href={REPO_URL}
|
|
80
|
+
target="_blank"
|
|
81
|
+
rel="noreferrer"
|
|
82
|
+
>
|
|
83
|
+
GitHub
|
|
84
|
+
</a>
|
|
85
|
+
<button
|
|
86
|
+
class="font-brand-sans rounded-lg border border-border px-4 py-2 text-[0.95rem] font-medium tracking-[-0.02em] transition-colors hover:bg-background/70 md:text-[1rem]"
|
|
87
|
+
type="button"
|
|
88
|
+
onclick={toggleTheme}
|
|
89
|
+
>
|
|
90
|
+
{theme.resolvedTheme === 'dark' ? 'Light' : 'Dark'}
|
|
91
|
+
</button>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
</header>
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { BROWSER } from 'esm-env';
|
|
3
|
+
import { onDestroy, onMount } from 'svelte';
|
|
4
|
+
import Streamdown from '../../Streamdown.svelte';
|
|
5
|
+
import { code, type PluginConfig } from '../../plugins.js';
|
|
6
|
+
import { demoMarkdown } from './content.js';
|
|
7
|
+
|
|
8
|
+
const speed = 100;
|
|
9
|
+
const tokens = demoMarkdown.split(' ').map((token) => `${token} `);
|
|
10
|
+
|
|
11
|
+
let content = $state('');
|
|
12
|
+
let isAnimating = $state(false);
|
|
13
|
+
let host = $state<HTMLDivElement | null>(null);
|
|
14
|
+
let timer: ReturnType<typeof setInterval> | null = null;
|
|
15
|
+
let plugins = $state<PluginConfig>({ code });
|
|
16
|
+
|
|
17
|
+
const loadInteractivePlugins = async (): Promise<PluginConfig | null> => {
|
|
18
|
+
if (!BROWSER) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const [{ cjk }, { math, mermaid }] = await Promise.all([
|
|
23
|
+
import('../../plugins/cjk-shared.js'),
|
|
24
|
+
import('../../plugins.js')
|
|
25
|
+
]);
|
|
26
|
+
|
|
27
|
+
return { code, cjk, math, mermaid };
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
function stopDemo() {
|
|
31
|
+
if (timer) {
|
|
32
|
+
clearInterval(timer);
|
|
33
|
+
timer = null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
isAnimating = false;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function startDemo() {
|
|
40
|
+
stopDemo();
|
|
41
|
+
content = '';
|
|
42
|
+
isAnimating = true;
|
|
43
|
+
|
|
44
|
+
let current = '';
|
|
45
|
+
let index = 0;
|
|
46
|
+
|
|
47
|
+
timer = setInterval(() => {
|
|
48
|
+
if (index >= tokens.length) {
|
|
49
|
+
stopDemo();
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
current += tokens[index] ?? '';
|
|
54
|
+
content = current;
|
|
55
|
+
index += 1;
|
|
56
|
+
}, speed);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
onMount(() => {
|
|
60
|
+
void loadInteractivePlugins().then((loadedPlugins) => {
|
|
61
|
+
if (loadedPlugins) {
|
|
62
|
+
plugins = loadedPlugins;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
if (!host) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const observer = new IntersectionObserver(
|
|
71
|
+
(entries) => {
|
|
72
|
+
if (!entries[0]?.isIntersecting) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
startDemo();
|
|
77
|
+
observer.disconnect();
|
|
78
|
+
},
|
|
79
|
+
{ rootMargin: '-100px' }
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
observer.observe(host);
|
|
83
|
+
|
|
84
|
+
return () => {
|
|
85
|
+
observer.disconnect();
|
|
86
|
+
stopDemo();
|
|
87
|
+
};
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
onDestroy(() => {
|
|
91
|
+
stopDemo();
|
|
92
|
+
});
|
|
93
|
+
</script>
|
|
94
|
+
|
|
95
|
+
<div class="mx-auto w-full max-w-4xl">
|
|
96
|
+
<div class="overflow-hidden rounded-sm border bg-background shadow-sm">
|
|
97
|
+
<div
|
|
98
|
+
class="flex items-center justify-between border-b bg-sidebar px-4 py-2 text-sm text-muted-foreground"
|
|
99
|
+
>
|
|
100
|
+
<span>Live demo</span>
|
|
101
|
+
<button
|
|
102
|
+
class="rounded-md px-2 py-1 font-medium text-foreground transition-colors hover:bg-accent"
|
|
103
|
+
type="button"
|
|
104
|
+
onclick={startDemo}
|
|
105
|
+
>
|
|
106
|
+
Replay
|
|
107
|
+
</button>
|
|
108
|
+
</div>
|
|
109
|
+
<div class="h-[600px] overflow-y-auto">
|
|
110
|
+
<div class="mx-auto w-full max-w-prose p-6 sm:p-12" bind:this={host}>
|
|
111
|
+
<Streamdown
|
|
112
|
+
content={content}
|
|
113
|
+
animated
|
|
114
|
+
baseTheme="shadcn"
|
|
115
|
+
caret="block"
|
|
116
|
+
isAnimating={isAnimating}
|
|
117
|
+
{plugins}
|
|
118
|
+
/>
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|