PageSourceSearch

https://prithivmlmods-ltx-2-loras-camera-control-dolly.hf.space/assets/Index-DnoopRVS.js

js prithivmlmods-ltx-2-loras-camera-control-dolly.hf.space collected 2026-10-03 17:15:22 UTC 9,135 bytes, 420 lines download raw bytes

1import { p as prop, i as if_block, g as spread_props, r as rest_props } from './i18n-CGlVUOvE.js';
2import { M as push, af as onDestroy, Z as get, O as pop, a2 as user_derived, $ as set, ab as state, N as first_child, a as append, S as sibling, R as from_html, ac as proxy, ad as user_effect } from './index-Bq2njFOY.js';
3import { G as Gradio } from './utils.svelte-Bi9ASwv9.js';
4import { S as Static } from './index-1GCmrSlD.js';
5import './StreamingBar.svelte_svelte_type_style_lang-DWGn5tT_.js';
6import { C as Code$1 } from './Code-DQLc8-1z.js';
7import { C as Check } from './Check-BKMHx_DF.js';
8import { C as Copy } from './Copy-BQlJe6-D.js';
9import { I as IconButton } from './ScrollFade.svelte_svelte_type_style_lang-D0JPkGar.js';
10import './MarkdownCode.svelte_svelte_type_style_lang-B29zDiob.js';
11import { D as Download } from './Download-D5ZNT7uE.js';
12import { D as DownloadLink } from './DownloadLink-D6EYxQxh.js';
13import { I as IconButtonWrapper } from './IconButtonWrapper-DAsvkfJg.js';
14import { B as Block } from './Block-DNK-JdLJ.js';
15import { B as BlockLabel } from './BlockLabel-VpI11pHf.js';
16import { E as Empty } from './Empty-BrRNpJ3n.js';
17import { C as Code } from './Code-CxRgOnU2.js';
18export { default as BaseExample } from './Example-BYnu_U1h.js';
19import './Clear-C8Tfa7QP.js';
20import './html-Bwif0JPw.js';
21import './snippet-BG7qkY_1.js';
22import './prism-python-NrKIQnfs.js';
23/* empty css                                               */
24
25function Copy_1($$anchor, $$props) {
26	push($$props, true);
27
28	let copied = state(false);
29	let timer;
30
31	function copy_feedback() {
32		set(copied, true);
33
34		if (timer) clearTimeout(timer);
35
36		timer = setTimeout(
37			() => {
38				set(copied, false);
39			},
40			2000
41		);
42	}
43
44	async function handle_copy() {
45		if ("clipboard" in navigator) {
46			await navigator.clipboard.writeText($$props.value);
47			copy_feedback();
48		}
49	}
50
51	onDestroy(() => {
52		if (timer) clearTimeout(timer);
53	});
54
55	{
56		let $0 = user_derived(() => get(copied) ? Check : Copy);
57
58		IconButton($$anchor, {
59			get Icon() {
60				return get($0);
61			},
62			onclick: handle_copy
63		});
64	}
65
66	pop();
67}
68
69function Download_1($$anchor, $$props) {
70	push($$props, true);
71
72	let ext = user_derived(() => get_ext_for_type($$props.language));
73
74	function get_ext_for_type(type) {
75		const exts = {
76			py: "py",
77			python: "py",
78			md: "md",
79			markdown: "md",
80			json: "json",
81			html: "html",
82			css: "css",
83			js: "js",
84			javascript: "js",
85			ts: "ts",
86			typescript: "ts",
87			yaml: "yaml",
88			yml: "yml",
89			dockerfile: "dockerfile",
90			sh: "sh",
91			shell: "sh",
92			r: "r",
93			c: "c",
94			cpp: "cpp",
95			latex: "tex"
96		};
97
98		return exts[type] || "txt";
99	}
100
101	let copied = state(false);
102	let timer;
103
104	function copy_feedback() {
105		set(copied, true);
106
107		if (timer) clearTimeout(timer);
108
109		timer = setTimeout(
110			() => {
111				set(copied, false);
112			},
113			2000
114		);
115	}
116
117	let download_value = user_derived(() => URL.createObjectURL(new Blob([$$props.value])));
118
119	onDestroy(() => {
120		if (timer) clearTimeout(timer);
121	});
122
123	DownloadLink($$anchor, {
124		get download() {
125			return `file.${get(ext) ?? ''}`;
126		},
127
128		get href() {
129			return get(download_value);
130		},
131		onclick: copy_feedback,
132		children: ($$anchor, $$slotProps) => {
133			{
134				let $0 = user_derived(() => get(copied) ? Check : Download);
135
136				IconButton($$anchor, {
137					get Icon() {
138						return get($0);
139					}
140				});
141			}
142		},
143		$$slots: { default: true }
144	});
145
146	pop();
147}
148
149var root_1$1 = from_html(`<!> <!>`, 1);
150
151function Widgets($$anchor, $$props) {
152	push($$props, true);
153
154	let buttons = prop($$props, 'buttons', 3, null),
155		on_custom_button_click = prop($$props, 'on_custom_button_click', 3, null);
156
157	IconButtonWrapper($$anchor, {
158		get buttons() {
159			return buttons();
160		},
161
162		get on_custom_button_click() {
163			return on_custom_button_click();
164		},
165
166		children: ($$anchor, $$slotProps) => {
167			var fragment_1 = root_1$1();
168			var node = first_child(fragment_1);
169
170			{
171				var consequent = ($$anchor) => {
172					Download_1($$anchor, {
173						get value() {
174							return $$props.value;
175						},
176
177						get language() {
178							return $$props.language;
179						}
180					});
181				};
182
183				if_block(node, ($$render) => {
184					if (buttons()?.some((btn) => typeof btn === "string" && btn === "download")) $$render(consequent);
185				});
186			}
187
188			var node_1 = sibling(node, 2);
189
190			{
191				var consequent_1 = ($$anchor) => {
192					Copy_1($$anchor, {
193						get value() {
194							return $$props.value;
195						}
196					});
197				};
198
199				if_block(node_1, ($$render) => {
200					if (buttons()?.some((btn) => typeof btn === "string" && btn === "copy")) $$render(consequent_1);
201				});
202			}
203
204			append($$anchor, fragment_1);
205		},
206		$$slots: { default: true }
207	});
208
209	pop();
210}
211
212var root_5 = from_html(`<!> <!>`, 1);
213var root_1 = from_html(`<!> <!> <!>`, 1);
214
215function Index($$anchor, $$props) {
216	push($$props, true);
217
218	const props = rest_props($$props, ['$$slots', '$$events', '$$legacy']);
219	const gradio = new Gradio(props);
220	let dark_mode = gradio.shared.theme === "dark";
221	let label = user_derived(() => gradio.shared.label || gradio.i18n("code.code"));
222	let old_value = state(proxy(gradio.props.value));
223	let first_change = true;
224
225	user_effect(() => {
226		if (first_change) {
227			first_change = false;
228
229			return;
230		}
231
232		if (get(old_value) != gradio.props.value) {
233			set(old_value, gradio.props.value, true);
234			gradio.dispatch("change");
235		}
236	});
237
238	{
239		let $0 = user_derived(() => gradio.props.max_lines && "fit-content");
240
241		Block($$anchor, {
242			get height() {
243				return get($0);
244			},
245			variant: "solid",
246			padding: false,
247			get elem_id() {
248				return gradio.shared.elem_id;
249			},
250
251			get elem_classes() {
252				return gradio.shared.elem_classes;
253			},
254
255			get visible() {
256				return gradio.shared.visible;
257			},
258
259			get scale() {
260				return gradio.shared.scale;
261			},
262
263			get min_width() {
264				return gradio.shared.min_width;
265			},
266
267			children: ($$anchor, $$slotProps) => {
268				var fragment_1 = root_1();
269				var node = first_child(fragment_1);
270
271				Static(node, spread_props(
272					{
273						get autoscroll() {
274							return gradio.shared.autoscroll;
275						},
276
277						get i18n() {
278							return gradio.i18n;
279						}
280					},
281					() => gradio.shared.loading_status,
282					{
283						on_clear_status: () => gradio.dispatch("clear_status", gradio.shared.loading_status)
284					}
285				));
286
287				var node_1 = sibling(node, 2);
288
289				{
290					var consequent = ($$anchor) => {
291						BlockLabel($$anchor, {
292							get Icon() {
293								return Code;
294							},
295
296							get show_label() {
297								return gradio.shared.show_label;
298							},
299
300							get label() {
301								return get(label);
302							},
303							float: false
304						});
305					};
306
307					if_block(node_1, ($$render) => {
308						if (gradio.shared.show_label) $$render(consequent);
309					});
310				}
311
312				var node_2 = sibling(node_1, 2);
313
314				{
315					var consequent_1 = ($$anchor) => {
316						Empty($$anchor, {
317							unpadded_box: true,
318							size: 'large',
319							children: ($$anchor, $$slotProps) => {
320								Code($$anchor);
321							},
322							$$slots: { default: true }
323						});
324					};
325
326					var alternate = ($$anchor) => {
327						var fragment_5 = root_5();
328						var node_3 = first_child(fragment_5);
329
330						{
331							let $0 = user_derived(() => gradio.props.buttons ?? ["copy", "download"]);
332
333							Widgets(node_3, {
334								get language() {
335									return gradio.props.language;
336								},
337
338								get value() {
339									return gradio.props.value;
340								},
341
342								get buttons() {
343									return get($0);
344								},
345
346								on_custom_button_click: (id) => {
347									gradio.dispatch("custom_button_click", { id });
348								}
349							});
350						}
351
352						var node_4 = sibling(node_3, 2);
353
354						{
355							let $0 = user_derived(() => !gradio.shared.interactive);
356
357							Code$1(node_4, {
358								get language() {
359									return gradio.props.language;
360								},
361
362								get lines() {
363									return gradio.props.lines;
364								},
365
366								get max_lines() {
367									return gradio.props.max_lines;
368								},
369
370								get dark_mode() {
371									return dark_mode;
372								},
373
374								get wrap_lines() {
375									return gradio.props.wrap_lines;
376								},
377
378								get show_line_numbers() {
379									return gradio.props.show_line_numbers;
380								},
381
382								get autocomplete() {
383									return gradio.props.autocomplete;
384								},
385
386								get readonly() {
387									return get($0);
388								},
389								onblur: () => gradio.dispatch("blur"),
390								onfocus: () => gradio.dispatch("focus"),
391								oninput: () => gradio.dispatch("input"),
392								get value() {
393									return gradio.props.value;
394								},
395
396								set value($$value) {
397									gradio.props.value = $$value;
398								}
399							});
400						}
401
402						append($$anchor, fragment_5);
403					};
404
405					if_block(node_2, ($$render) => {
406						if (!gradio.props.value && !gradio.shared.interactive) $$render(consequent_1); else $$render(alternate, false);
407					});
408				}
409
410				append($$anchor, fragment_1);
411			},
412			$$slots: { default: true }
413		});
414	}
415
416	pop();
417}
418
419export { Code$1 as BaseCode, Copy_1 as BaseCopy, Download_1 as BaseDownload, Widgets as BaseWidget, Index as default };
420//# sourceMappingURL=Index-DnoopRVS.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.