File size: 3,847 Bytes
5f5d58c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
import './Button-ab11cb83.js';

/* home/runner/work/gradio/gradio/js/atoms/src/Empty.svelte generated by Svelte v4.2.2 */
const {
	SvelteComponent,
	append,
	attr,
	binding_callbacks,
	create_slot,
	detach,
	element,
	get_all_dirty_from_scope,
	get_slot_changes,
	init,
	insert,
	safe_not_equal,
	toggle_class,
	transition_in,
	transition_out,
	update_slot_base
} = window.__gradio__svelte__internal;
function create_fragment(ctx) {
	let div1;
	let div0;
	let current;
	const default_slot_template = /*#slots*/ ctx[5].default;
	const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[4], null);

	return {
		c() {
			div1 = element("div");
			div0 = element("div");
			if (default_slot) default_slot.c();
			attr(div0, "class", "icon svelte-1oiin9d");
			attr(div1, "class", "empty svelte-1oiin9d");
			attr(div1, "aria-label", "Empty value");
			toggle_class(div1, "small", /*size*/ ctx[0] === "small");
			toggle_class(div1, "large", /*size*/ ctx[0] === "large");
			toggle_class(div1, "unpadded_box", /*unpadded_box*/ ctx[1]);
			toggle_class(div1, "small_parent", /*parent_height*/ ctx[3]);
		},
		m(target, anchor) {
			insert(target, div1, anchor);
			append(div1, div0);

			if (default_slot) {
				default_slot.m(div0, null);
			}

			/*div1_binding*/ ctx[6](div1);
			current = true;
		},
		p(ctx, [dirty]) {
			if (default_slot) {
				if (default_slot.p && (!current || dirty & /*$$scope*/ 16)) {
					update_slot_base(
						default_slot,
						default_slot_template,
						ctx,
						/*$$scope*/ ctx[4],
						!current
						? get_all_dirty_from_scope(/*$$scope*/ ctx[4])
						: get_slot_changes(default_slot_template, /*$$scope*/ ctx[4], dirty, null),
						null
					);
				}
			}

			if (!current || dirty & /*size*/ 1) {
				toggle_class(div1, "small", /*size*/ ctx[0] === "small");
			}

			if (!current || dirty & /*size*/ 1) {
				toggle_class(div1, "large", /*size*/ ctx[0] === "large");
			}

			if (!current || dirty & /*unpadded_box*/ 2) {
				toggle_class(div1, "unpadded_box", /*unpadded_box*/ ctx[1]);
			}

			if (!current || dirty & /*parent_height*/ 8) {
				toggle_class(div1, "small_parent", /*parent_height*/ ctx[3]);
			}
		},
		i(local) {
			if (current) return;
			transition_in(default_slot, local);
			current = true;
		},
		o(local) {
			transition_out(default_slot, local);
			current = false;
		},
		d(detaching) {
			if (detaching) {
				detach(div1);
			}

			if (default_slot) default_slot.d(detaching);
			/*div1_binding*/ ctx[6](null);
		}
	};
}

function instance($$self, $$props, $$invalidate) {
	let parent_height;
	let { $$slots: slots = {}, $$scope } = $$props;
	let { size = "small" } = $$props;
	let { unpadded_box = false } = $$props;
	let el;

	function compare_el_to_parent(el) {
		if (!el) return false;
		const { height: el_height } = el.getBoundingClientRect();
		const { height: parent_height } = el.parentElement?.getBoundingClientRect() || { height: el_height };
		return el_height > parent_height + 2;
	}

	function div1_binding($$value) {
		binding_callbacks[$$value ? 'unshift' : 'push'](() => {
			el = $$value;
			$$invalidate(2, el);
		});
	}

	$$self.$$set = $$props => {
		if ('size' in $$props) $$invalidate(0, size = $$props.size);
		if ('unpadded_box' in $$props) $$invalidate(1, unpadded_box = $$props.unpadded_box);
		if ('$$scope' in $$props) $$invalidate(4, $$scope = $$props.$$scope);
	};

	$$self.$$.update = () => {
		if ($$self.$$.dirty & /*el*/ 4) {
			$$invalidate(3, parent_height = compare_el_to_parent(el));
		}
	};

	return [size, unpadded_box, el, parent_height, $$scope, slots, div1_binding];
}

class Empty extends SvelteComponent {
	constructor(options) {
		super();
		init(this, options, instance, create_fragment, safe_not_equal, { size: 0, unpadded_box: 1 });
	}
}

export { Empty as E };
//# sourceMappingURL=Empty-fef21b7d.js.map