import './Index-f62c49f9.js';
import './Button-723db480.js';

/* home/runner/work/gradio/gradio/js/icons/src/Upload.svelte generated by Svelte v4.2.2 */
const {
	SvelteComponent: SvelteComponent$1,
	append: append$1,
	attr: attr$1,
	detach: detach$1,
	init: init$1,
	insert: insert$1,
	noop,
	safe_not_equal: safe_not_equal$1,
	svg_element
} = window.__gradio__svelte__internal;
function create_fragment$1(ctx) {
	let svg;
	let path;
	let polyline;
	let line;

	return {
		c() {
			svg = svg_element("svg");
			path = svg_element("path");
			polyline = svg_element("polyline");
			line = svg_element("line");
			attr$1(path, "d", "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4");
			attr$1(polyline, "points", "17 8 12 3 7 8");
			attr$1(line, "x1", "12");
			attr$1(line, "y1", "3");
			attr$1(line, "x2", "12");
			attr$1(line, "y2", "15");
			attr$1(svg, "xmlns", "http://www.w3.org/2000/svg");
			attr$1(svg, "width", "90%");
			attr$1(svg, "height", "90%");
			attr$1(svg, "viewBox", "0 0 24 24");
			attr$1(svg, "fill", "none");
			attr$1(svg, "stroke", "currentColor");
			attr$1(svg, "stroke-width", "2");
			attr$1(svg, "stroke-linecap", "round");
			attr$1(svg, "stroke-linejoin", "round");
			attr$1(svg, "class", "feather feather-upload");
		},
		m(target, anchor) {
			insert$1(target, svg, anchor);
			append$1(svg, path);
			append$1(svg, polyline);
			append$1(svg, line);
		},
		p: noop,
		i: noop,
		o: noop,
		d(detaching) {
			if (detaching) {
				detach$1(svg);
			}
		}
	};
}

class Upload extends SvelteComponent$1 {
	constructor(options) {
		super();
		init$1(this, options, null, create_fragment$1, safe_not_equal$1, {});
	}
}

/* home/runner/work/gradio/gradio/js/atoms/src/UploadText.svelte generated by Svelte v4.2.2 */
const {
	SvelteComponent,
	append,
	attr,
	create_component,
	destroy_component,
	detach,
	element,
	init,
	insert,
	mount_component,
	safe_not_equal,
	set_data,
	space,
	text,
	toggle_class,
	transition_in,
	transition_out
} = window.__gradio__svelte__internal;
function create_if_block(ctx) {
	let span;
	let t0;
	let t1_value = /*i18n*/ ctx[1]("common.or") + "";
	let t1;
	let t2;
	let t3;
	let t4_value = (/*message*/ ctx[2] || /*i18n*/ ctx[1]("upload_text.click_to_upload")) + "";
	let t4;

	return {
		c() {
			span = element("span");
			t0 = text("- ");
			t1 = text(t1_value);
			t2 = text(" -");
			t3 = space();
			t4 = text(t4_value);
			attr(span, "class", "or svelte-b0hvie");
		},
		m(target, anchor) {
			insert(target, span, anchor);
			append(span, t0);
			append(span, t1);
			append(span, t2);
			insert(target, t3, anchor);
			insert(target, t4, anchor);
		},
		p(ctx, dirty) {
			if (dirty & /*i18n*/ 2 && t1_value !== (t1_value = /*i18n*/ ctx[1]("common.or") + "")) set_data(t1, t1_value);
			if (dirty & /*message, i18n*/ 6 && t4_value !== (t4_value = (/*message*/ ctx[2] || /*i18n*/ ctx[1]("upload_text.click_to_upload")) + "")) set_data(t4, t4_value);
		},
		d(detaching) {
			if (detaching) {
				detach(span);
				detach(t3);
				detach(t4);
			}
		}
	};
}

function create_fragment(ctx) {
	let div;
	let span;
	let uploadicon;
	let t0;
	let t1_value = /*i18n*/ ctx[1](/*defs*/ ctx[5][/*type*/ ctx[0]] || /*defs*/ ctx[5].file) + "";
	let t1;
	let t2;
	let current;
	uploadicon = new Upload({});
	let if_block = /*mode*/ ctx[3] !== "short" && create_if_block(ctx);

	return {
		c() {
			div = element("div");
			span = element("span");
			create_component(uploadicon.$$.fragment);
			t0 = space();
			t1 = text(t1_value);
			t2 = space();
			if (if_block) if_block.c();
			attr(span, "class", "icon-wrap svelte-b0hvie");
			toggle_class(span, "hovered", /*hovered*/ ctx[4]);
			attr(div, "class", "wrap svelte-b0hvie");
		},
		m(target, anchor) {
			insert(target, div, anchor);
			append(div, span);
			mount_component(uploadicon, span, null);
			append(div, t0);
			append(div, t1);
			append(div, t2);
			if (if_block) if_block.m(div, null);
			current = true;
		},
		p(ctx, [dirty]) {
			if (!current || dirty & /*hovered*/ 16) {
				toggle_class(span, "hovered", /*hovered*/ ctx[4]);
			}

			if ((!current || dirty & /*i18n, type*/ 3) && t1_value !== (t1_value = /*i18n*/ ctx[1](/*defs*/ ctx[5][/*type*/ ctx[0]] || /*defs*/ ctx[5].file) + "")) set_data(t1, t1_value);

			if (/*mode*/ ctx[3] !== "short") {
				if (if_block) {
					if_block.p(ctx, dirty);
				} else {
					if_block = create_if_block(ctx);
					if_block.c();
					if_block.m(div, null);
				}
			} else if (if_block) {
				if_block.d(1);
				if_block = null;
			}
		},
		i(local) {
			if (current) return;
			transition_in(uploadicon.$$.fragment, local);
			current = true;
		},
		o(local) {
			transition_out(uploadicon.$$.fragment, local);
			current = false;
		},
		d(detaching) {
			if (detaching) {
				detach(div);
			}

			destroy_component(uploadicon);
			if (if_block) if_block.d();
		}
	};
}

function instance($$self, $$props, $$invalidate) {
	let { type = "file" } = $$props;
	let { i18n } = $$props;
	let { message = undefined } = $$props;
	let { mode = "full" } = $$props;
	let { hovered = false } = $$props;

	const defs = {
		image: "upload_text.drop_image",
		video: "upload_text.drop_video",
		audio: "upload_text.drop_audio",
		file: "upload_text.drop_file",
		csv: "upload_text.drop_csv"
	};

	$$self.$$set = $$props => {
		if ('type' in $$props) $$invalidate(0, type = $$props.type);
		if ('i18n' in $$props) $$invalidate(1, i18n = $$props.i18n);
		if ('message' in $$props) $$invalidate(2, message = $$props.message);
		if ('mode' in $$props) $$invalidate(3, mode = $$props.mode);
		if ('hovered' in $$props) $$invalidate(4, hovered = $$props.hovered);
	};

	return [type, i18n, message, mode, hovered, defs];
}

class UploadText extends SvelteComponent {
	constructor(options) {
		super();

		init(this, options, instance, create_fragment, safe_not_equal, {
			type: 0,
			i18n: 1,
			message: 2,
			mode: 3,
			hovered: 4
		});
	}
}

export { UploadText as U, Upload as a };
//# sourceMappingURL=UploadText-3896a06d.js.map
