PageSourceSearch

https://pdltiet-ocr-demo.hf.space/assets/Index-41ba1f3c.js

js pdltiet-ocr-demo.hf.space collected 2026-10-03 10:23:25 UTC 7,858 bytes, 260 lines download raw bytes

1import { M as Markdown } from './Index.svelte_svelte_type_style_lang-900e0c31.js';
2import { S as Static } from './Index-34f70ab5.js';
3import { B as Block } from './Button-20c14f3f.js';
4export { default as BaseExample } from './Example-2a6a37e1.js';
5export { M as MarkdownCode } from './Example.svelte_svelte_type_style_lang-0e22497a.js';
6import './utils-8f25e669.js';
7import './index-6d9f7a14.js';
8import './svelte/svelte.js';
9
10/* home/runner/work/gradio/gradio/js/markdown/Index.svelte generated by Svelte v4.2.2 */
11const {
12	SvelteComponent,
13	assign,
14	attr,
15	create_component,
16	destroy_component,
17	detach,
18	element,
19	get_spread_object,
20	get_spread_update,
21	init,
22	insert,
23	mount_component,
24	safe_not_equal,
25	space,
26	toggle_class,
27	transition_in,
28	transition_out
29} = window.__gradio__svelte__internal;
30function create_default_slot(ctx) {
31	let statustracker;
32	let t;
33	let div;
34	let markdown;
35	let current;
36
37	const statustracker_spread_levels = [
38		{ autoscroll: /*gradio*/ ctx[8].autoscroll },
39		{ i18n: /*gradio*/ ctx[8].i18n },
40		/*loading_status*/ ctx[4],
41		{ variant: "center" }
42	];
43
44	let statustracker_props = {};
45
46	for (let i = 0; i < statustracker_spread_levels.length; i += 1) {
47		statustracker_props = assign(statustracker_props, statustracker_spread_levels[i]);
48	}
49
50	statustracker = new Static({ props: statustracker_props });
51
52	markdown = new Markdown({
53			props: {
54				min_height: /*loading_status*/ ctx[4] && /*loading_status*/ ctx[4].status !== "complete",
55				value: /*value*/ ctx[3],
56				elem_classes: /*elem_classes*/ ctx[1],
57				visible: /*visible*/ ctx[2],
58				rtl: /*rtl*/ ctx[5],
59				latex_delimiters: /*latex_delimiters*/ ctx[9],
60				sanitize_html: /*sanitize_html*/ ctx[6],
61				line_breaks: /*line_breaks*/ ctx[7],
62				header_links: /*header_links*/ ctx[10]
63			}
64		});
65
66	markdown.$on("change", /*change_handler*/ ctx[12]);
67
68	return {
69		c() {
70			create_component(statustracker.$$.fragment);
71			t = space();
72			div = element("div");
73			create_component(markdown.$$.fragment);
74			attr(div, "class", "svelte-1ed2p3z");
75			toggle_class(div, "pending", /*loading_status*/ ctx[4]?.status === "pending");
76		},
77		m(target, anchor) {
78			mount_component(statustracker, target, anchor);
79			insert(target, t, anchor);
80			insert(target, div, anchor);
81			mount_component(markdown, div, null);
82			current = true;
83		},
84		p(ctx, dirty) {
85			const statustracker_changes = (dirty & /*gradio, loading_status*/ 272)
86			? get_spread_update(statustracker_spread_levels, [
87					dirty & /*gradio*/ 256 && { autoscroll: /*gradio*/ ctx[8].autoscroll },
88					dirty & /*gradio*/ 256 && { i18n: /*gradio*/ ctx[8].i18n },
89					dirty & /*loading_status*/ 16 && get_spread_object(/*loading_status*/ ctx[4]),
90					statustracker_spread_levels[3]
91				])
92			: {};
93
94			statustracker.$set(statustracker_changes);
95			const markdown_changes = {};
96			if (dirty & /*loading_status*/ 16) markdown_changes.min_height = /*loading_status*/ ctx[4] && /*loading_status*/ ctx[4].status !== "complete";
97			if (dirty & /*value*/ 8) markdown_changes.value = /*value*/ ctx[3];
98			if (dirty & /*elem_classes*/ 2) markdown_changes.elem_classes = /*elem_classes*/ ctx[1];
99			if (dirty & /*visible*/ 4) markdown_changes.visible = /*visible*/ ctx[2];
100			if (dirty & /*rtl*/ 32) markdown_changes.rtl = /*rtl*/ ctx[5];
101			if (dirty & /*latex_delimiters*/ 512) markdown_changes.latex_delimiters = /*latex_delimiters*/ ctx[9];
102			if (dirty & /*sanitize_html*/ 64) markdown_changes.sanitize_html = /*sanitize_html*/ ctx[6];
103			if (dirty & /*line_breaks*/ 128) markdown_changes.line_breaks = /*line_breaks*/ ctx[7];
104			if (dirty & /*header_links*/ 1024) markdown_changes.header_links = /*header_links*/ ctx[10];
105			markdown.$set(markdown_changes);
106
107			if (!current || dirty & /*loading_status*/ 16) {
108				toggle_class(div, "pending", /*loading_status*/ ctx[4]?.status === "pending");
109			}
110		},
111		i(local) {
112			if (current) return;
113			transition_in(statustracker.$$.fragment, local);
114			transition_in(markdown.$$.fragment, local);
115			current = true;
116		},
117		o(local) {
118			transition_out(statustracker.$$.fragment, local);
119			transition_out(markdown.$$.fragment, local);
120			current = false;
121		},
122		d(detaching) {
123			if (detaching) {
124				detach(t);
125				detach(div);
126			}
127
128			destroy_component(statustracker, detaching);
129			destroy_component(markdown);
130		}
131	};
132}
133
134function create_fragment(ctx) {
135	let block;
136	let current;
137
138	block = new Block({
139			props: {
140				visible: /*visible*/ ctx[2],
141				elem_id: /*elem_id*/ ctx[0],
142				elem_classes: /*elem_classes*/ ctx[1],
143				container: false,
144				allow_overflow: true,
145				$$slots: { default: [create_default_slot] },
146				$$scope: { ctx }
147			}
148		});
149
150	return {
151		c() {
152			create_component(block.$$.fragment);
153		},
154		m(target, anchor) {
155			mount_component(block, target, anchor);
156			current = true;
157		},
158		p(ctx, [dirty]) {
159			const block_changes = {};
160			if (dirty & /*visible*/ 4) block_changes.visible = /*visible*/ ctx[2];
161			if (dirty & /*elem_id*/ 1) block_changes.elem_id = /*elem_id*/ ctx[0];
162			if (dirty & /*elem_classes*/ 2) block_changes.elem_classes = /*elem_classes*/ ctx[1];
163
164			if (dirty & /*$$scope, loading_status, value, elem_classes, visible, rtl, latex_delimiters, sanitize_html, line_breaks, header_links, gradio*/ 10238) {
165				block_changes.$$scope = { dirty, ctx };
166			}
167
168			block.$set(block_changes);
169		},
170		i(local) {
171			if (current) return;
172			transition_in(block.$$.fragment, local);
173			current = true;
174		},
175		o(local) {
176			transition_out(block.$$.fragment, local);
177			current = false;
178		},
179		d(detaching) {
180			destroy_component(block, detaching);
181		}
182	};
183}
184
185function instance($$self, $$props, $$invalidate) {
186	let { label } = $$props;
187	let { elem_id = "" } = $$props;
188	let { elem_classes = [] } = $$props;
189	let { visible = true } = $$props;
190	let { value = "" } = $$props;
191	let { loading_status } = $$props;
192	let { rtl = false } = $$props;
193	let { sanitize_html = true } = $$props;
194	let { line_breaks = false } = $$props;
195	let { gradio } = $$props;
196	let { latex_delimiters } = $$props;
197	let { header_links = false } = $$props;
198	const change_handler = () => gradio.dispatch("change");
199
200	$$self.$$set = $$props => {
201		if ('label' in $$props) $$invalidate(11, label = $$props.label);
202		if ('elem_id' in $$props) $$invalidate(0, elem_id = $$props.elem_id);
203		if ('elem_classes' in $$props) $$invalidate(1, elem_classes = $$props.elem_classes);
204		if ('visible' in $$props) $$invalidate(2, visible = $$props.visible);
205		if ('value' in $$props) $$invalidate(3, value = $$props.value);
206		if ('loading_status' in $$props) $$invalidate(4, loading_status = $$props.loading_status);
207		if ('rtl' in $$props) $$invalidate(5, rtl = $$props.rtl);
208		if ('sanitize_html' in $$props) $$invalidate(6, sanitize_html = $$props.sanitize_html);
209		if ('line_breaks' in $$props) $$invalidate(7, line_breaks = $$props.line_breaks);
210		if ('gradio' in $$props) $$invalidate(8, gradio = $$props.gradio);
211		if ('latex_delimiters' in $$props) $$invalidate(9, latex_delimiters = $$props.latex_delimiters);
212		if ('header_links' in $$props) $$invalidate(10, header_links = $$props.header_links);
213	};
214
215	$$self.$$.update = () => {
216		if ($$self.$$.dirty & /*label, gradio*/ 2304) {
217			(gradio.dispatch("change"));
218		}
219	};
220
221	return [
222		elem_id,
223		elem_classes,
224		visible,
225		value,
226		loading_status,
227		rtl,
228		sanitize_html,
229		line_breaks,
230		gradio,
231		latex_delimiters,
232		header_links,
233		label,
234		change_handler
235	];
236}
237
238class Index extends SvelteComponent {
239	constructor(options) {
240		super();
241
242		init(this, options, instance, create_fragment, safe_not_equal, {
243			label: 11,
244			elem_id: 0,
245			elem_classes: 1,
246			visible: 2,
247			value: 3,
248			loading_status: 4,
249			rtl: 5,
250			sanitize_html: 6,
251			line_breaks: 7,
252			gradio: 8,
253			latex_delimiters: 9,
254			header_links: 10
255		});
256	}
257}
258
259export { Markdown as BaseMarkdown, Index as default };
260//# sourceMappingURL=Index-41ba1f3c.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.