PageSourceSearch

https://iamhariraj-rickchatbot.hf.space/assets/Index-b1b07f9e.js

js iamhariraj-rickchatbot.hf.space collected 2026-10-03 16:58:21 UTC 15,870 bytes, 641 lines download raw bytes

1import { T as Textbox } from './Textbox-4b7f8a69.js';
2import { B as Block } from './Button-bd009e9a.js';
3import { S as Static } from './Index-7fdff9d2.js';
4export { default as BaseExample } from './Example-e0df15d4.js';
5import './BlockTitle-16231197.js';
6import './Info-47f6c44f.js';
7import './Check-f7edb5d9.js';
8import './Copy-a69620a8.js';
9import './index-10ead756.js';
10import './svelte/svelte.js';
11/* empty css                                                */
12/* home/runner/work/gradio/gradio/js/textbox/Index.svelte generated by Svelte v4.2.2 */
13const {
14	SvelteComponent,
15	add_flush_callback,
16	assign,
17	bind,
18	binding_callbacks,
19	check_outros,
20	create_component,
21	destroy_component,
22	detach,
23	flush,
24	get_spread_object,
25	get_spread_update,
26	group_outros,
27	init,
28	insert,
29	mount_component,
30	safe_not_equal,
31	space,
32	transition_in,
33	transition_out
34} = window.__gradio__svelte__internal;
35function create_if_block(ctx) {
36	let statustracker;
37	let current;
38
39	const statustracker_spread_levels = [
40		{ autoscroll: /*gradio*/ ctx[2].autoscroll },
41		{ i18n: /*gradio*/ ctx[2].i18n },
42		/*loading_status*/ ctx[17]
43	];
44
45	let statustracker_props = {};
46
47	for (let i = 0; i < statustracker_spread_levels.length; i += 1) {
48		statustracker_props = assign(statustracker_props, statustracker_spread_levels[i]);
49	}
50
51	statustracker = new Static({ props: statustracker_props });
52
53	return {
54		c() {
55			create_component(statustracker.$$.fragment);
56		},
57		m(target, anchor) {
58			mount_component(statustracker, target, anchor);
59			current = true;
60		},
61		p(ctx, dirty) {
62			const statustracker_changes = (dirty[0] & /*gradio, loading_status*/ 131076)
63			? get_spread_update(statustracker_spread_levels, [
64					dirty[0] & /*gradio*/ 4 && { autoscroll: /*gradio*/ ctx[2].autoscroll },
65					dirty[0] & /*gradio*/ 4 && { i18n: /*gradio*/ ctx[2].i18n },
66					dirty[0] & /*loading_status*/ 131072 && get_spread_object(/*loading_status*/ ctx[17])
67				])
68			: {};
69
70			statustracker.$set(statustracker_changes);
71		},
72		i(local) {
73			if (current) return;
74			transition_in(statustracker.$$.fragment, local);
75			current = true;
76		},
77		o(local) {
78			transition_out(statustracker.$$.fragment, local);
79			current = false;
80		},
81		d(detaching) {
82			destroy_component(statustracker, detaching);
83		}
84	};
85}
86
87// (35:0) <Block  {visible}  {elem_id}  {elem_classes}  {scale}  {min_width}  allow_overflow={false}  padding={container} >
88function create_default_slot(ctx) {
89	let t;
90	let textbox;
91	let updating_value;
92	let updating_value_is_output;
93	let current;
94	let if_block = /*loading_status*/ ctx[17] && create_if_block(ctx);
95
96	function textbox_value_binding(value) {
97		/*textbox_value_binding*/ ctx[23](value);
98	}
99
100	function textbox_value_is_output_binding(value) {
101		/*textbox_value_is_output_binding*/ ctx[24](value);
102	}
103
104	let textbox_props = {
105		label: /*label*/ ctx[3],
106		info: /*info*/ ctx[4],
107		show_label: /*show_label*/ ctx[10],
108		lines: /*lines*/ ctx[8],
109		type: /*type*/ ctx[12],
110		rtl: /*rtl*/ ctx[18],
111		text_align: /*text_align*/ ctx[19],
112		max_lines: !/*max_lines*/ ctx[11]
113		? /*lines*/ ctx[8] + 1
114		: /*max_lines*/ ctx[11],
115		placeholder: /*placeholder*/ ctx[9],
116		show_copy_button: /*show_copy_button*/ ctx[16],
117		autofocus: /*autofocus*/ ctx[20],
118		container: /*container*/ ctx[13],
119		autoscroll: /*autoscroll*/ ctx[21],
120		disabled: !/*interactive*/ ctx[22]
121	};
122
123	if (/*value*/ ctx[0] !== void 0) {
124		textbox_props.value = /*value*/ ctx[0];
125	}
126
127	if (/*value_is_output*/ ctx[1] !== void 0) {
128		textbox_props.value_is_output = /*value_is_output*/ ctx[1];
129	}
130
131	textbox = new Textbox({ props: textbox_props });
132	binding_callbacks.push(() => bind(textbox, 'value', textbox_value_binding));
133	binding_callbacks.push(() => bind(textbox, 'value_is_output', textbox_value_is_output_binding));
134	textbox.$on("change", /*change_handler*/ ctx[25]);
135	textbox.$on("input", /*input_handler*/ ctx[26]);
136	textbox.$on("submit", /*submit_handler*/ ctx[27]);
137	textbox.$on("blur", /*blur_handler*/ ctx[28]);
138	textbox.$on("select", /*select_handler*/ ctx[29]);
139	textbox.$on("focus", /*focus_handler*/ ctx[30]);
140
141	return {
142		c() {
143			if (if_block) if_block.c();
144			t = space();
145			create_component(textbox.$$.fragment);
146		},
147		m(target, anchor) {
148			if (if_block) if_block.m(target, anchor);
149			insert(target, t, anchor);
150			mount_component(textbox, target, anchor);
151			current = true;
152		},
153		p(ctx, dirty) {
154			if (/*loading_status*/ ctx[17]) {
155				if (if_block) {
156					if_block.p(ctx, dirty);
157
158					if (dirty[0] & /*loading_status*/ 131072) {
159						transition_in(if_block, 1);
160					}
161				} else {
162					if_block = create_if_block(ctx);
163					if_block.c();
164					transition_in(if_block, 1);
165					if_block.m(t.parentNode, t);
166				}
167			} else if (if_block) {
168				group_outros();
169
170				transition_out(if_block, 1, 1, () => {
171					if_block = null;
172				});
173
174				check_outros();
175			}
176
177			const textbox_changes = {};
178			if (dirty[0] & /*label*/ 8) textbox_changes.label = /*label*/ ctx[3];
179			if (dirty[0] & /*info*/ 16) textbox_changes.info = /*info*/ ctx[4];
180			if (dirty[0] & /*show_label*/ 1024) textbox_changes.show_label = /*show_label*/ ctx[10];
181			if (dirty[0] & /*lines*/ 256) textbox_changes.lines = /*lines*/ ctx[8];
182			if (dirty[0] & /*type*/ 4096) textbox_changes.type = /*type*/ ctx[12];
183			if (dirty[0] & /*rtl*/ 262144) textbox_changes.rtl = /*rtl*/ ctx[18];
184			if (dirty[0] & /*text_align*/ 524288) textbox_changes.text_align = /*text_align*/ ctx[19];
185
186			if (dirty[0] & /*max_lines, lines*/ 2304) textbox_changes.max_lines = !/*max_lines*/ ctx[11]
187			? /*lines*/ ctx[8] + 1
188			: /*max_lines*/ ctx[11];
189
190			if (dirty[0] & /*placeholder*/ 512) textbox_changes.placeholder = /*placeholder*/ ctx[9];
191			if (dirty[0] & /*show_copy_button*/ 65536) textbox_changes.show_copy_button = /*show_copy_button*/ ctx[16];
192			if (dirty[0] & /*autofocus*/ 1048576) textbox_changes.autofocus = /*autofocus*/ ctx[20];
193			if (dirty[0] & /*container*/ 8192) textbox_changes.container = /*container*/ ctx[13];
194			if (dirty[0] & /*autoscroll*/ 2097152) textbox_changes.autoscroll = /*autoscroll*/ ctx[21];
195			if (dirty[0] & /*interactive*/ 4194304) textbox_changes.disabled = !/*interactive*/ ctx[22];
196
197			if (!updating_value && dirty[0] & /*value*/ 1) {
198				updating_value = true;
199				textbox_changes.value = /*value*/ ctx[0];
200				add_flush_callback(() => updating_value = false);
201			}
202
203			if (!updating_value_is_output && dirty[0] & /*value_is_output*/ 2) {
204				updating_value_is_output = true;
205				textbox_changes.value_is_output = /*value_is_output*/ ctx[1];
206				add_flush_callback(() => updating_value_is_output = false);
207			}
208
209			textbox.$set(textbox_changes);
210		},
211		i(local) {
212			if (current) return;
213			transition_in(if_block);
214			transition_in(textbox.$$.fragment, local);
215			current = true;
216		},
217		o(local) {
218			transition_out(if_block);
219			transition_out(textbox.$$.fragment, local);
220			current = false;
221		},
222		d(detaching) {
223			if (detaching) {
224				detach(t);
225			}
226
227			if (if_block) if_block.d(detaching);
228			destroy_component(textbox, detaching);
229		}
230	};
231}
232
233function create_fragment(ctx) {
234	let block;
235	let current;
236
237	block = new Block({
238			props: {
239				visible: /*visible*/ ctx[7],
240				elem_id: /*elem_id*/ ctx[5],
241				elem_classes: /*elem_classes*/ ctx[6],
242				scale: /*scale*/ ctx[14],
243				min_width: /*min_width*/ ctx[15],
244				allow_overflow: false,
245				padding: /*container*/ ctx[13],
246				$$slots: { default: [create_default_slot] },
247				$$scope: { ctx }
248			}
249		});
250
251	return {
252		c() {
253			create_component(block.$$.fragment);
254		},
255		m(target, anchor) {
256			mount_component(block, target, anchor);
257			current = true;
258		},
259		p(ctx, dirty) {
260			const block_changes = {};
261			if (dirty[0] & /*visible*/ 128) block_changes.visible = /*visible*/ ctx[7];
262			if (dirty[0] & /*elem_id*/ 32) block_changes.elem_id = /*elem_id*/ ctx[5];
263			if (dirty[0] & /*elem_classes*/ 64) block_changes.elem_classes = /*elem_classes*/ ctx[6];
264			if (dirty[0] & /*scale*/ 16384) block_changes.scale = /*scale*/ ctx[14];
265			if (dirty[0] & /*min_width*/ 32768) block_changes.min_width = /*min_width*/ ctx[15];
266			if (dirty[0] & /*container*/ 8192) block_changes.padding = /*container*/ ctx[13];
267
268			if (dirty[0] & /*label, info, show_label, lines, type, rtl, text_align, max_lines, placeholder, show_copy_button, autofocus, container, autoscroll, interactive, value, value_is_output, gradio, loading_status*/ 8339231 | dirty[1] & /*$$scope*/ 1) {
269				block_changes.$$scope = { dirty, ctx };
270			}
271
272			block.$set(block_changes);
273		},
274		i(local) {
275			if (current) return;
276			transition_in(block.$$.fragment, local);
277			current = true;
278		},
279		o(local) {
280			transition_out(block.$$.fragment, local);
281			current = false;
282		},
283		d(detaching) {
284			destroy_component(block, detaching);
285		}
286	};
287}
288
289function instance($$self, $$props, $$invalidate) {
290	let { gradio } = $$props;
291	let { label = "Textbox" } = $$props;
292	let { info = undefined } = $$props;
293	let { elem_id = "" } = $$props;
294	let { elem_classes = [] } = $$props;
295	let { visible = true } = $$props;
296	let { value = "" } = $$props;
297	let { lines } = $$props;
298	let { placeholder = "" } = $$props;
299	let { show_label } = $$props;
300	let { max_lines } = $$props;
301	let { type = "text" } = $$props;
302	let { container = true } = $$props;
303	let { scale = null } = $$props;
304	let { min_width = undefined } = $$props;
305	let { show_copy_button = false } = $$props;
306	let { loading_status = undefined } = $$props;
307	let { value_is_output = false } = $$props;
308	let { rtl = false } = $$props;
309	let { text_align = undefined } = $$props;
310	let { autofocus = false } = $$props;
311	let { autoscroll = true } = $$props;
312	let { interactive } = $$props;
313
314	function textbox_value_binding(value$1) {
315		value = value$1;
316		$$invalidate(0, value);
317	}
318
319	function textbox_value_is_output_binding(value) {
320		value_is_output = value;
321		$$invalidate(1, value_is_output);
322	}
323
324	const change_handler = () => gradio.dispatch("change", value);
325	const input_handler = () => gradio.dispatch("input");
326	const submit_handler = () => gradio.dispatch("submit");
327	const blur_handler = () => gradio.dispatch("blur");
328	const select_handler = e => gradio.dispatch("select", e.detail);
329	const focus_handler = () => gradio.dispatch("focus");
330
331	$$self.$$set = $$props => {
332		if ('gradio' in $$props) $$invalidate(2, gradio = $$props.gradio);
333		if ('label' in $$props) $$invalidate(3, label = $$props.label);
334		if ('info' in $$props) $$invalidate(4, info = $$props.info);
335		if ('elem_id' in $$props) $$invalidate(5, elem_id = $$props.elem_id);
336		if ('elem_classes' in $$props) $$invalidate(6, elem_classes = $$props.elem_classes);
337		if ('visible' in $$props) $$invalidate(7, visible = $$props.visible);
338		if ('value' in $$props) $$invalidate(0, value = $$props.value);
339		if ('lines' in $$props) $$invalidate(8, lines = $$props.lines);
340		if ('placeholder' in $$props) $$invalidate(9, placeholder = $$props.placeholder);
341		if ('show_label' in $$props) $$invalidate(10, show_label = $$props.show_label);
342		if ('max_lines' in $$props) $$invalidate(11, max_lines = $$props.max_lines);
343		if ('type' in $$props) $$invalidate(12, type = $$props.type);
344		if ('container' in $$props) $$invalidate(13, container = $$props.container);
345		if ('scale' in $$props) $$invalidate(14, scale = $$props.scale);
346		if ('min_width' in $$props) $$invali
346date(15, min_width = $$props.min_width);
347		if ('show_copy_button' in $$props) $$invalidate(16, show_copy_button = $$props.show_copy_button);
348		if ('loading_status' in $$props) $$invalidate(17, loading_status = $$props.loading_status);
349		if ('value_is_output' in $$props) $$invalidate(1, value_is_output = $$props.value_is_output);
350		if ('rtl' in $$props) $$invalidate(18, rtl = $$props.rtl);
351		if ('text_align' in $$props) $$invalidate(19, text_align = $$props.text_align);
352		if ('autofocus' in $$props) $$invalidate(20, autofocus = $$props.autofocus);
353		if ('autoscroll' in $$props) $$invalidate(21, autoscroll = $$props.autoscroll);
354		if ('interactive' in $$props) $$invalidate(22, interactive = $$props.interactive);
355	};
356
357	return [
358		value,
359		value_is_output,
360		gradio,
361		label,
362		info,
363		elem_id,
364		elem_classes,
365		visible,
366		lines,
367		placeholder,
368		show_label,
369		max_lines,
370		type,
371		container,
372		scale,
373		min_width,
374		show_copy_button,
375		loading_status,
376		rtl,
377		text_align,
378		autofocus,
379		autoscroll,
380		interactive,
381		textbox_value_binding,
382		textbox_value_is_output_binding,
383		change_handler,
384		input_handler,
385		submit_handler,
386		blur_handler,
387		select_handler,
388		focus_handler
389	];
390}
391
392class Index extends SvelteComponent {
393	constructor(options) {
394		super();
395
396		init(
397			this,
398			options,
399			instance,
400			create_fragment,
401			safe_not_equal,
402			{
403				gradio: 2,
404				label: 3,
405				info: 4,
406				elem_id: 5,
407				elem_classes: 6,
408				visible: 7,
409				value: 0,
410				lines: 8,
411				placeholder: 9,
412				show_label: 10,
413				max_lines: 11,
414				type: 12,
415				container: 13,
416				scale: 14,
417				min_width: 15,
418				show_copy_button: 16,
419				loading_status: 17,
420				value_is_output: 1,
421				rtl: 18,
422				text_align: 19,
423				autofocus: 20,
424				autoscroll: 21,
425				interactive: 22
426			},
427			null,
428			[-1, -1]
429		);
430	}
431
432	get gradio() {
433		return this.$$.ctx[2];
434	}
435
436	set gradio(gradio) {
437		this.$$set({ gradio });
438		flush();
439	}
440
441	get label() {
442		return this.$$.ctx[3];
443	}
444
445	set label(label) {
446		this.$$set({ label });
447		flush();
448	}
449
450	get info() {
451		return this.$$.ctx[4];
452	}
453
454	set info(info) {
455		this.$$set({ info });
456		flush();
457	}
458
459	get elem_id() {
460		return this.$$.ctx[5];
461	}
462
463	set elem_id(elem_id) {
464		this.$$set({ elem_id });
465		flush();
466	}
467
468	get elem_classes() {
469		return this.$$.ctx[6];
470	}
471
472	set elem_classes(elem_classes) {
473		this.$$set({ elem_classes });
474		flush();
475	}
476
477	get visible() {
478		return this.$$.ctx[7];
479	}
480
481	set visible(visible) {
482		this.$$set({ visible });
483		flush();
484	}
485
486	get value() {
487		return this.$$.ctx[0];
488	}
489
490	set value(value) {
491		this.$$set({ value });
492		flush();
493	}
494
495	get lines() {
496		return this.$$.ctx[8];
497	}
498
499	set lines(lines) {
500		this.$$set({ lines });
501		flush();
502	}
503
504	get placeholder() {
505		return this.$$.ctx[9];
506	}
507
508	set placeholder(placeholder) {
509		this.$$set({ placeholder });
510		flush();
511	}
512
513	get show_label() {
514		return this.$$.ctx[10];
515	}
516
517	set show_label(show_label) {
518		this.$$set({ show_label });
519		flush();
520	}
521
522	get max_lines() {
523		return this.$$.ctx[11];
524	}
525
526	set max_lines(max_lines) {
527		this.$$set({ max_lines });
528		flush();
529	}
530
531	get type() {
532		return this.$$.ctx[12];
533	}
534
535	set type(type) {
536		this.$$set({ type });
537		flush();
538	}
539
540	get container() {
541		return this.$$.ctx[13];
542	}
543
544	set container(container) {
545		this.$$set({ container });
546		flush();
547	}
548
549	get scale() {
550		return this.$$.ctx[14];
551	}
552
553	set scale(scale) {
554		this.$$set({ scale });
555		flush();
556	}
557
558	get min_width() {
559		return this.$$.ctx[15];
560	}
561
562	set min_width(min_width) {
563		this.$$set({ min_width });
564		flush();
565	}
566
567	get show_copy_button() {
568		return this.$$.ctx[16];
569	}
570
571	set show_copy_button(show_copy_button) {
572		this.$$set({ show_copy_button });
573		flush();
574	}
575
576	get loading_status() {
577		return this.$$.ctx[17];
578	}
579
580	set loading_status(loading_status) {
581		this.$$set({ loading_status });
582		flush();
583	}
584
585	get value_is_output() {
586		return this.$$.ctx[1];
587	}
588
589	set value_is_output(value_is_output) {
590		this.$$set({ value_is_output });
591		flush();
592	}
593
594	get rtl() {
595		return this.$$.ctx[18];
596	}
597
598	set rtl(rtl) {
599		this.$$set({ rtl });
600		flush();
601	}
602
603	get text_align() {
604		return this.$$.ctx[19];
605	}
606
607	set text_align(text_align) {
608		this.$$set({ text_align });
609		flush();
610	}
611
612	get autofocus() {
613		return this.$$.ctx[20];
614	}
615
616	set autofocus(autofocus) {
617		this.$$set({ autofocus });
618		flush();
619	}
620
621	get autoscroll() {
622		return this.$$.ctx[21];
623	}
624
625	set autoscroll(autoscroll) {
626		this.$$set({ autoscroll });
627		flush();
628	}
629
630	get interactive() {
631		return this.$$.ctx[22];
632	}
633
634	set interactive(interactive) {
635		this.$$set({ interactive });
636		flush();
637	}
638}
639
640export { Textbox as BaseTextbox, Index as default };
641//# sourceMappingURL=Index-b1b07f9e.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.