PageSourceSearch

https://glimmarykarl-dragonbornv1.hf.space/assets/Example-d8ab1392.js

js glimmarykarl-dragonbornv1.hf.space collected 2026-10-03 16:54:10 UTC 2,151 bytes, 86 lines download raw bytes

1const Example_svelte_svelte_type_style_lang = '';
2
3/* home/runner/work/gradio/gradio/js/dropdown/Example.svelte generated by Svelte v4.2.2 */
4const {
5	SvelteComponent,
6	attr,
7	detach,
8	element,
9	init,
10	insert,
11	noop,
12	safe_not_equal,
13	toggle_class
14} = window.__gradio__svelte__internal;
15function create_fragment(ctx) {
16	let div;
17
18	return {
19		c() {
20			div = element("div");
21			div.textContent = `${/*names_string*/ ctx[2]}`;
22			attr(div, "class", "svelte-1ayixqk");
23			toggle_class(div, "table", /*type*/ ctx[0] === "table");
24			toggle_class(div, "gallery", /*type*/ ctx[0] === "gallery");
25			toggle_class(div, "selected", /*selected*/ ctx[1]);
26		},
27		m(target, anchor) {
28			insert(target, div, anchor);
29		},
30		p(ctx, [dirty]) {
31			if (dirty & /*type*/ 1) {
32				toggle_class(div, "table", /*type*/ ctx[0] === "table");
33			}
34
35			if (dirty & /*type*/ 1) {
36				toggle_class(div, "gallery", /*type*/ ctx[0] === "gallery");
37			}
38
39			if (dirty & /*selected*/ 2) {
40				toggle_class(div, "selected", /*selected*/ ctx[1]);
41			}
42		},
43		i: noop,
44		o: noop,
45		d(detaching) {
46			if (detaching) {
47				detach(div);
48			}
49		}
50	};
51}
52
53function instance($$self, $$props, $$invalidate) {
54	let { value } = $$props;
55	let { type } = $$props;
56	let { selected = false } = $$props;
57	let { choices } = $$props;
58	let value_array = Array.isArray(value) ? value : [value];
59	let names = value_array.map(val => choices.find(pair => pair[1] === val)?.[0]).filter(name => name !== undefined);
60	let names_string = names.join(", ");
61
62	$$self.$$set = $$props => {
63		if ('value' in $$props) $$invalidate(3, value = $$props.value);
64		if ('type' in $$props) $$invalidate(0, type = $$props.type);
65		if ('selected' in $$props) $$invalidate(1, selected = $$props.selected);
66		if ('choices' in $$props) $$invalidate(4, choices = $$props.choices);
67	};
68
69	return [type, selected, names_string, value, choices];
70}
71
72class Example extends SvelteComponent {
73	constructor(options) {
74		super();
75
76		init(this, options, instance, create_fragment, safe_not_equal, {
77			value: 3,
78			type: 0,
79			selected: 1,
80			choices: 4
81		});
82	}
83}
84
85export { Example as default };
86//# sourceMappingURL=Example-d8ab1392.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.