// @svizzle/time_region_value v0.5.0 - © 2021 nestauk (https://www.nesta.org.uk/)
'use strict';

var format = require('./format-a62f401a.js');
var indicator = require('./indicator-34e8d898.js');

/* ../ui/src/icons/feather/Loader.svelte generated by Svelte v3.44.2 */

function create_fragment$1(ctx) {
	let line0;
	let line1;
	let line2;
	let line3;
	let line4;
	let line5;
	let line6;
	let line7;

	return {
		c() {
			line0 = format.svg_element("line");
			line1 = format.svg_element("line");
			line2 = format.svg_element("line");
			line3 = format.svg_element("line");
			line4 = format.svg_element("line");
			line5 = format.svg_element("line");
			line6 = format.svg_element("line");
			line7 = format.svg_element("line");
			format.attr(line0, "x1", "12");
			format.attr(line0, "y1", "2");
			format.attr(line0, "x2", "12");
			format.attr(line0, "y2", "6");
			format.attr(line1, "x1", "12");
			format.attr(line1, "y1", "18");
			format.attr(line1, "x2", "12");
			format.attr(line1, "y2", "22");
			format.attr(line2, "x1", "4.93");
			format.attr(line2, "y1", "4.93");
			format.attr(line2, "x2", "7.76");
			format.attr(line2, "y2", "7.76");
			format.attr(line3, "x1", "16.24");
			format.attr(line3, "y1", "16.24");
			format.attr(line3, "x2", "19.07");
			format.attr(line3, "y2", "19.07");
			format.attr(line4, "x1", "2");
			format.attr(line4, "y1", "12");
			format.attr(line4, "x2", "6");
			format.attr(line4, "y2", "12");
			format.attr(line5, "x1", "18");
			format.attr(line5, "y1", "12");
			format.attr(line5, "x2", "22");
			format.attr(line5, "y2", "12");
			format.attr(line6, "x1", "4.93");
			format.attr(line6, "y1", "19.07");
			format.attr(line6, "x2", "7.76");
			format.attr(line6, "y2", "16.24");
			format.attr(line7, "x1", "16.24");
			format.attr(line7, "y1", "7.76");
			format.attr(line7, "x2", "19.07");
			format.attr(line7, "y2", "4.93");
		},
		m(target, anchor) {
			format.insert(target, line0, anchor);
			format.insert(target, line1, anchor);
			format.insert(target, line2, anchor);
			format.insert(target, line3, anchor);
			format.insert(target, line4, anchor);
			format.insert(target, line5, anchor);
			format.insert(target, line6, anchor);
			format.insert(target, line7, anchor);
		},
		p: format.noop,
		i: format.noop,
		o: format.noop,
		d(detaching) {
			if (detaching) format.detach(line0);
			if (detaching) format.detach(line1);
			if (detaching) format.detach(line2);
			if (detaching) format.detach(line3);
			if (detaching) format.detach(line4);
			if (detaching) format.detach(line5);
			if (detaching) format.detach(line6);
			if (detaching) format.detach(line7);
		}
	};
}

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

var Loader$1 = Loader;

/* ../ui/src/LoadingView.svelte generated by Svelte v3.44.2 */

function add_css(target) {
	format.append_styles(target, "svelte-8do3d8", ".LoadingView.svelte-8do3d8{align-items:center;display:flex;flex-direction:column;height:100%;justify-content:center;width:100%}.spinner.svelte-8do3d8{animation:svelte-8do3d8-rotation 2s infinite linear}@keyframes svelte-8do3d8-rotation{from{transform:rotate(0deg)}to{transform:rotate(359deg)}}");
}

// (31:1) {#if message}
function create_if_block(ctx) {
	let div;
	let span;
	let t;

	return {
		c() {
			div = format.element("div");
			span = format.element("span");
			t = format.text(/*message*/ ctx[2]);
		},
		m(target, anchor) {
			format.insert(target, div, anchor);
			format.append(div, span);
			format.append(span, t);
		},
		p(ctx, dirty) {
			if (dirty & /*message*/ 4) format.set_data(t, /*message*/ ctx[2]);
		},
		d(detaching) {
			if (detaching) format.detach(div);
		}
	};
}

function create_fragment(ctx) {
	let div1;
	let div0;
	let icon;
	let t;
	let current;

	icon = new indicator.Icon({
			props: {
				fill: /*fill*/ ctx[0],
				glyph: /*glyph*/ ctx[1],
				size: /*size*/ ctx[3],
				stroke: /*stroke*/ ctx[4],
				strokeWidth: /*strokeWidth*/ ctx[5]
			}
		});

	let if_block = /*message*/ ctx[2] && create_if_block(ctx);

	return {
		c() {
			div1 = format.element("div");
			div0 = format.element("div");
			format.create_component(icon.$$.fragment);
			t = format.space();
			if (if_block) if_block.c();
			format.attr(div0, "class", "spinner svelte-8do3d8");
			format.attr(div1, "class", "LoadingView svelte-8do3d8");
		},
		m(target, anchor) {
			format.insert(target, div1, anchor);
			format.append(div1, div0);
			format.mount_component(icon, div0, null);
			format.append(div1, t);
			if (if_block) if_block.m(div1, null);
			current = true;
		},
		p(ctx, [dirty]) {
			const icon_changes = {};
			if (dirty & /*fill*/ 1) icon_changes.fill = /*fill*/ ctx[0];
			if (dirty & /*glyph*/ 2) icon_changes.glyph = /*glyph*/ ctx[1];
			if (dirty & /*size*/ 8) icon_changes.size = /*size*/ ctx[3];
			if (dirty & /*stroke*/ 16) icon_changes.stroke = /*stroke*/ ctx[4];
			if (dirty & /*strokeWidth*/ 32) icon_changes.strokeWidth = /*strokeWidth*/ ctx[5];
			icon.$set(icon_changes);

			if (/*message*/ ctx[2]) {
				if (if_block) {
					if_block.p(ctx, dirty);
				} else {
					if_block = create_if_block(ctx);
					if_block.c();
					if_block.m(div1, null);
				}
			} else if (if_block) {
				if_block.d(1);
				if_block = null;
			}
		},
		i(local) {
			if (current) return;
			format.transition_in(icon.$$.fragment, local);
			current = true;
		},
		o(local) {
			format.transition_out(icon.$$.fragment, local);
			current = false;
		},
		d(detaching) {
			if (detaching) format.detach(div1);
			format.destroy_component(icon);
			if (if_block) if_block.d();
		}
	};
}

function instance($$self, $$props, $$invalidate) {
	let { fill = null } = $$props;
	let { glyph = Loader$1 } = $$props;
	let { message = null } = $$props;
	let { size = 50 } = $$props;
	let { stroke = null } = $$props;
	let { strokeWidth = 0.75 } = $$props;

	$$self.$$set = $$props => {
		if ('fill' in $$props) $$invalidate(0, fill = $$props.fill);
		if ('glyph' in $$props) $$invalidate(1, glyph = $$props.glyph);
		if ('message' in $$props) $$invalidate(2, message = $$props.message);
		if ('size' in $$props) $$invalidate(3, size = $$props.size);
		if ('stroke' in $$props) $$invalidate(4, stroke = $$props.stroke);
		if ('strokeWidth' in $$props) $$invalidate(5, strokeWidth = $$props.strokeWidth);
	};

	$$self.$$.update = () => {
		if ($$self.$$.dirty & /*fill*/ 1) {
			// FIXME https://github.com/sveltejs/svelte/issues/4442
			$$invalidate(0, fill = fill || null);
		}

		if ($$self.$$.dirty & /*glyph*/ 2) {
			$$invalidate(1, glyph = glyph || Loader$1);
		}

		if ($$self.$$.dirty & /*message*/ 4) {
			$$invalidate(2, message = message || null);
		}

		if ($$self.$$.dirty & /*size*/ 8) {
			$$invalidate(3, size = size || 50);
		}

		if ($$self.$$.dirty & /*stroke*/ 16) {
			$$invalidate(4, stroke = stroke || null);
		}

		if ($$self.$$.dirty & /*strokeWidth*/ 32) {
			$$invalidate(5, strokeWidth = strokeWidth || 0.75);
		}
	};

	return [fill, glyph, message, size, stroke, strokeWidth];
}

class LoadingView extends format.SvelteComponent {
	constructor(options) {
		super();

		format.init(
			this,
			options,
			instance,
			create_fragment,
			format.safe_not_equal,
			{
				fill: 0,
				glyph: 1,
				message: 2,
				size: 3,
				stroke: 4,
				strokeWidth: 5
			},
			add_css
		);
	}
}

var LoadingView$1 = LoadingView;

const _POIs = format.writable([]);

exports.LoadingView = LoadingView$1;
exports._POIs = _POIs;
