import { S as SvelteComponent, i as init, s as safe_not_equal, V as create_slot, f as element, b as attr, t as toggle_class, c as insert, Q as update_slot_base, R as get_all_dirty_from_scope, T as get_slot_changes, v as transition_in, w as transition_out, e as detach } from './index.628f101f.js';

/* Users/aliabid/projects/gradio/ui/packages/atoms/src/BlockTitle.svelte generated by Svelte v3.49.0 */

function create_fragment(ctx) {
	let span;
	let current;
	const default_slot_template = /*#slots*/ ctx[2].default;
	const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[1], null);

	return {
		c() {
			span = element("span");
			if (default_slot) default_slot.c();
			attr(span, "class", "text-gray-500 text-[0.855rem] mb-2 block dark:text-gray-200 relative z-40");
			toggle_class(span, "sr-only", !/*show_label*/ ctx[0]);
			toggle_class(span, "h-0", !/*show_label*/ ctx[0]);
			toggle_class(span, "!m-0", !/*show_label*/ ctx[0]);
		},
		m(target, anchor) {
			insert(target, span, anchor);

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

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

			if (dirty & /*show_label*/ 1) {
				toggle_class(span, "sr-only", !/*show_label*/ ctx[0]);
			}

			if (dirty & /*show_label*/ 1) {
				toggle_class(span, "h-0", !/*show_label*/ ctx[0]);
			}

			if (dirty & /*show_label*/ 1) {
				toggle_class(span, "!m-0", !/*show_label*/ ctx[0]);
			}
		},
		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(span);
			if (default_slot) default_slot.d(detaching);
		}
	};
}

function instance($$self, $$props, $$invalidate) {
	let { $$slots: slots = {}, $$scope } = $$props;
	let { show_label = true } = $$props;

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

	return [show_label, $$scope, slots];
}

class BlockTitle extends SvelteComponent {
	constructor(options) {
		super();
		init(this, options, instance, create_fragment, safe_not_equal, { show_label: 0 });
	}
}

export { BlockTitle as B };
