(function(l, i, v, e) { v = l.createElement(i); v.async = 1; v.src = '//' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; e = l.getElementsByTagName(i)[0]; e.parentNode.insertBefore(v, e)})(document, 'script'); var app = (function () { 'use strict'; function noop() { } function assign(tar, src) { // @ts-ignore for (const k in src) tar[k] = src[k]; return tar; } function is_promise(value) { return value && typeof value === 'object' && typeof value.then === 'function'; } function add_location(element, file, line, column, char) { element.__svelte_meta = { loc: { file, line, column, char } }; } function run(fn) { return fn(); } function blank_object() { return Object.create(null); } function run_all(fns) { fns.forEach(run); } function is_function(thing) { return typeof thing === 'function'; } function safe_not_equal(a, b) { return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function'); } function null_to_empty(value) { return value == null ? '' : value; } function append(target, node) { target.appendChild(node); } function insert(target, node, anchor) { target.insertBefore(node, anchor || null); } function detach(node) { node.parentNode.removeChild(node); } function destroy_each(iterations, detaching) { for (let i = 0; i < iterations.length; i += 1) { if (iterations[i]) iterations[i].d(detaching); } } function element(name) { return document.createElement(name); } function svg_element(name) { return document.createElementNS('http://www.w3.org/2000/svg', name); } function text(data) { return document.createTextNode(data); } function space() { return text(' '); } function empty() { return text(''); } function listen(node, event, handler, options) { node.addEventListener(event, handler, options); return () => node.removeEventListener(event, handler, options); } function attr(node, attribute, value) { if (value == null) node.removeAttribute(attribute); else node.setAttribute(attribute, value); } function children(element) { return Array.from(element.childNodes); } function claim_element(nodes, name, attributes, svg) { for (let i = 0; i < nodes.length; i += 1) { const node = nodes[i]; if (node.nodeName === name) { for (let j = 0; j < node.attributes.length; j += 1) { const attribute = node.attributes[j]; if (!attributes[attribute.name]) node.removeAttribute(attribute.name); } return nodes.splice(i, 1)[0]; // TODO strip unwanted attributes } } return svg ? svg_element(name) : element(name); } function claim_text(nodes, data) { for (let i = 0; i < nodes.length; i += 1) { const node = nodes[i]; if (node.nodeType === 3) { node.data = '' + data; return nodes.splice(i, 1)[0]; } } return text(data); } function claim_space(nodes) { return claim_text(nodes, ' '); } function set_input_value(input, value) { if (value != null || input.value) { input.value = value; } } function set_style(node, key, value, important) { node.style.setProperty(key, value, important ? 'important' : ''); } function toggle_class(element, name, toggle) { element.classList[toggle ? 'add' : 'remove'](name); } function custom_event(type, detail) { const e = document.createEvent('CustomEvent'); e.initCustomEvent(type, false, false, detail); return e; } let current_component; function set_current_component(component) { current_component = component; } function get_current_component() { if (!current_component) throw new Error(`Function called outside component initialization`); return current_component; } // TODO figure out if we still want to support // shorthand events, or if we want to implement // a real bubbling mechanism function bubble(component, event) { const callbacks = component.$$.callbacks[event.type]; if (callbacks) { callbacks.slice().forEach(fn => fn(event)); } } const dirty_components = []; const binding_callbacks = []; const render_callbacks = []; const flush_callbacks = []; const resolved_promise = Promise.resolve(); let update_scheduled = false; function schedule_update() { if (!update_scheduled) { update_scheduled = true; resolved_promise.then(flush); } } function add_render_callback(fn) { render_callbacks.push(fn); } function flush() { const seen_callbacks = new Set(); do { // first, call beforeUpdate functions // and update components while (dirty_components.length) { const component = dirty_components.shift(); set_current_component(component); update(component.$$); } while (binding_callbacks.length) binding_callbacks.pop()(); // then, once components are updated, call // afterUpdate functions. This may cause // subsequent updates... for (let i = 0; i < render_callbacks.length; i += 1) { const callback = render_callbacks[i]; if (!seen_callbacks.has(callback)) { callback(); // ...so guard against infinite loops seen_callbacks.add(callback); } } render_callbacks.length = 0; } while (dirty_components.length); while (flush_callbacks.length) { flush_callbacks.pop()(); } update_scheduled = false; } function update($$) { if ($$.fragment) { $$.update($$.dirty); run_all($$.before_update); $$.fragment.p($$.dirty, $$.ctx); $$.dirty = null; $$.after_update.forEach(add_render_callback); } } const outroing = new Set(); let outros; function group_outros() { outros = { r: 0, c: [], p: outros // parent group }; } function check_outros() { if (!outros.r) { run_all(outros.c); } outros = outros.p; } function transition_in(block, local) { if (block && block.i) { outroing.delete(block); block.i(local); } } function transition_out(block, local, detach, callback) { if (block && block.o) { if (outroing.has(block)) return; outroing.add(block); outros.c.push(() => { outroing.delete(block); if (callback) { if (detach) block.d(1); callback(); } }); block.o(local); } } function handle_promise(promise, info) { const token = info.token = {}; function update(type, index, key, value) { if (info.token !== token) return; info.resolved = key && { [key]: value }; const child_ctx = assign(assign({}, info.ctx), info.resolved); const block = type && (info.current = type)(child_ctx); if (info.block) { if (info.blocks) { info.blocks.forEach((block, i) => { if (i !== index && block) { group_outros(); transition_out(block, 1, 1, () => { info.blocks[i] = null; }); check_outros(); } }); } else { info.block.d(1); } block.c(); transition_in(block, 1); block.m(info.mount(), info.anchor); flush(); } info.block = block; if (info.blocks) info.blocks[index] = block; } if (is_promise(promise)) { const current_component = get_current_component(); promise.then(value => { set_current_component(current_component); update(info.then, 1, info.value, value); set_current_component(null); }, error => { set_current_component(current_component); update(info.catch, 2, info.error, error); set_current_component(null); }); // if we previously had a then/catch block, destroy it if (info.current !== info.pending) { update(info.pending, 0); return true; } } else { if (info.current !== info.then) { update(info.then, 1, info.value, promise); return true; } info.resolved = { [info.value]: promise }; } } const globals = (typeof window !== 'undefined' ? window : global); function mount_component(component, target, anchor) { const { fragment, on_mount, on_destroy, after_update } = component.$$; fragment.m(target, anchor); // onMount happens before the initial afterUpdate add_render_callback(() => { const new_on_destroy = on_mount.map(run).filter(is_function); if (on_destroy) { on_destroy.push(...new_on_destroy); } else { // Edge case - component was destroyed immediately, // most likely as a result of a binding initialising run_all(new_on_destroy); } component.$$.on_mount = []; }); after_update.forEach(add_render_callback); } function destroy_component(component, detaching) { if (component.$$.fragment) { run_all(component.$$.on_destroy); component.$$.fragment.d(detaching); // TODO null out other refs, including component.$$ (but need to // preserve final state?) component.$$.on_destroy = component.$$.fragment = null; component.$$.ctx = {}; } } function make_dirty(component, key) { if (!component.$$.dirty) { dirty_components.push(component); schedule_update(); component.$$.dirty = blank_object(); } component.$$.dirty[key] = true; } function init(component, options, instance, create_fragment, not_equal, prop_names) { const parent_component = current_component; set_current_component(component); const props = options.props || {}; const $$ = component.$$ = { fragment: null, ctx: null, // state props: prop_names, update: noop, not_equal, bound: blank_object(), // lifecycle on_mount: [], on_destroy: [], before_update: [], after_update: [], context: new Map(parent_component ? parent_component.$$.context : []), // everything else callbacks: blank_object(), dirty: null }; let ready = false; $$.ctx = instance ? instance(component, props, (key, ret, value = ret) => { if ($$.ctx && not_equal($$.ctx[key], $$.ctx[key] = value)) { if ($$.bound[key]) $$.bound[key](value); if (ready) make_dirty(component, key); } return ret; }) : props; $$.update(); ready = true; run_all($$.before_update); $$.fragment = create_fragment($$.ctx); if (options.target) { if (options.hydrate) { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion $$.fragment.l(children(options.target)); } else { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion $$.fragment.c(); } if (options.intro) transition_in(component.$$.fragment); mount_component(component, options.target, options.anchor); flush(); } set_current_component(parent_component); } let SvelteElement; if (typeof HTMLElement !== 'undefined') { SvelteElement = class extends HTMLElement { constructor() { super(); this.attachShadow({ mode: 'open' }); } connectedCallback() { // @ts-ignore todo: improve typings for (const key in this.$$.slotted) { // @ts-ignore todo: improve typings this.appendChild(this.$$.slotted[key]); } } attributeChangedCallback(attr, _oldValue, newValue) { this[attr] = newValue; } $destroy() { destroy_component(this, 1); this.$destroy = noop; } $on(type, callback) { // TODO should this delegate to addEventListener? const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = [])); callbacks.push(callback); return () => { const index = callbacks.indexOf(callback); if (index !== -1) callbacks.splice(index, 1); }; } $set() { // overridden by instance, if it has props } }; } class SvelteComponent { $destroy() { destroy_component(this, 1); this.$destroy = noop; } $on(type, callback) { const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = [])); callbacks.push(callback); return () => { const index = callbacks.indexOf(callback); if (index !== -1) callbacks.splice(index, 1); }; } $set() { // overridden by instance, if it has props } } function dispatch_dev(type, detail) { document.dispatchEvent(custom_event(type, detail)); } function append_dev(target, node) { dispatch_dev("SvelteDOMInsert", { target, node }); append(target, node); } function insert_dev(target, node, anchor) { dispatch_dev("SvelteDOMInsert", { target, node, anchor }); insert(target, node, anchor); } function detach_dev(node) { dispatch_dev("SvelteDOMRemove", { node }); detach(node); } function listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation) { const modifiers = options === true ? ["capture"] : options ? Array.from(Object.keys(options)) : []; if (has_prevent_default) modifiers.push('preventDefault'); if (has_stop_propagation) modifiers.push('stopPropagation'); dispatch_dev("SvelteDOMAddEventListener", { node, event, handler, modifiers }); const dispose = listen(node, event, handler, options); return () => { dispatch_dev("SvelteDOMRemoveEventListener", { node, event, handler, modifiers }); dispose(); }; } function attr_dev(node, attribute, value) { attr(node, attribute, value); if (value == null) dispatch_dev("SvelteDOMRemoveAttribute", { node, attribute }); else dispatch_dev("SvelteDOMSetAttribute", { node, attribute, value }); } function prop_dev(node, property, value) { node[property] = value; dispatch_dev("SvelteDOMSetProperty", { node, property, value }); } function set_data_dev(text, data) { data = '' + data; if (text.data === data) return; dispatch_dev("SvelteDOMSetData", { node: text, data }); text.data = data; } class SvelteComponentDev extends SvelteComponent { constructor(options) { if (!options || (!options.target && !options.$$inline)) { throw new Error(`'target' is a required option`); } super(); } $destroy() { super.$destroy(); this.$destroy = () => { console.warn(`Component was already destroyed`); // eslint-disable-line no-console }; } } const subscriber_queue = []; /** * Create a `Writable` store that allows both updating and reading by subscription. * @param {*=}value initial value * @param {StartStopNotifier=}start start and stop notifications for subscriptions */ function writable(value, start = noop) { let stop; const subscribers = []; function set(new_value) { if (safe_not_equal(value, new_value)) { value = new_value; if (stop) { // store is ready const run_queue = !subscriber_queue.length; for (let i = 0; i < subscribers.length; i += 1) { const s = subscribers[i]; s[1](); subscriber_queue.push(s, value); } if (run_queue) { for (let i = 0; i < subscriber_queue.length; i += 2) { subscriber_queue[i][0](subscriber_queue[i + 1]); } subscriber_queue.length = 0; } } } } function update(fn) { set(fn(value)); } function subscribe(run, invalidate = noop) { const subscriber = [run, invalidate]; subscribers.push(subscriber); if (subscribers.length === 1) { stop = start(set) || noop; } run(value); return () => { const index = subscribers.indexOf(subscriber); if (index !== -1) { subscribers.splice(index, 1); } if (subscribers.length === 0) { stop(); stop = null; } }; } return { set, update, subscribe }; } /* src\Textbox.svelte generated by Svelte v3.12.1 */ const file = "src\\Textbox.svelte"; // (32:0) {:else} function create_else_block(ctx) { var input, input_class_value; const block = { c: function create() { input = element("input"); this.h(); }, l: function claim(nodes) { input = claim_element(nodes, "INPUT", { class: true, type: true, value: true }, false); var input_nodes = children(input); input_nodes.forEach(detach_dev); this.h(); }, h: function hydrate() { attr_dev(input, "class", input_class_value = "" + null_to_empty(ctx.className) + " svelte-1ec4wqj"); attr_dev(input, "type", "text"); input.value = ctx.actualValue; add_location(input, file, 32, 0, 546); }, m: function mount(target, anchor) { insert_dev(target, input, anchor); }, p: function update(changed, ctx) { if ((changed.className) && input_class_value !== (input_class_value = "" + null_to_empty(ctx.className) + " svelte-1ec4wqj")) { attr_dev(input, "class", input_class_value); } if (changed.actualValue) { prop_dev(input, "value", ctx.actualValue); } }, d: function destroy(detaching) { if (detaching) { detach_dev(input); } } }; dispatch_dev("SvelteRegisterBlock", { block, id: create_else_block.name, type: "else", source: "(32:0) {:else}", ctx }); return block; } // (28:0) {#if hideValue} function create_if_block(ctx) { var input, input_class_value, dispose; const block = { c: function create() { input = element("input"); this.h(); }, l: function claim(nodes) { input = claim_element(nodes, "INPUT", { class: true, type: true, value: true }, false); var input_nodes = children(input); input_nodes.forEach(detach_dev); this.h(); }, h: function hydrate() { attr_dev(input, "class", input_class_value = "" + null_to_empty(ctx.className) + " svelte-1ec4wqj"); attr_dev(input, "type", "password"); input.value = ctx.actualValue; add_location(input, file, 28, 0, 455); dispose = listen_dev(input, "change", ctx.change_handler); }, m: function mount(target, anchor) { insert_dev(target, input, anchor); }, p: function update(changed, ctx) { if ((changed.className) && input_class_value !== (input_class_value = "" + null_to_empty(ctx.className) + " svelte-1ec4wqj")) { attr_dev(input, "class", input_class_value); } if (changed.actualValue) { prop_dev(input, "value", ctx.actualValue); } }, d: function destroy(detaching) { if (detaching) { detach_dev(input); } dispose(); } }; dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block.name, type: "if", source: "(28:0) {#if hideValue}", ctx }); return block; } function create_fragment(ctx) { var if_block_anchor; function select_block_type(changed, ctx) { if (ctx.hideValue) return create_if_block; return create_else_block; } var current_block_type = select_block_type(null, ctx); var if_block = current_block_type(ctx); const block = { c: function create() { if_block.c(); if_block_anchor = empty(); }, l: function claim(nodes) { if_block.l(nodes); if_block_anchor = empty(); }, m: function mount(target, anchor) { if_block.m(target, anchor); insert_dev(target, if_block_anchor, anchor); }, p: function update(changed, ctx) { if (current_block_type === (current_block_type = select_block_type(changed, ctx)) && if_block) { if_block.p(changed, ctx); } else { if_block.d(1); if_block = current_block_type(ctx); if (if_block) { if_block.c(); if_block.m(if_block_anchor.parentNode, if_block_anchor); } } }, i: noop, o: noop, d: function destroy(detaching) { if_block.d(detaching); if (detaching) { detach_dev(if_block_anchor); } } }; dispatch_dev("SvelteRegisterBlock", { block, id: create_fragment.name, type: "component", source: "", ctx }); return block; } function instance($$self, $$props, $$invalidate) { let { value="", hideValue = false, className = "default", _bb } = $$props; let actualValue = ""; const writable_props = ['value', 'hideValue', 'className', '_bb']; Object.keys($$props).forEach(key => { if (!writable_props.includes(key) && !key.startsWith('$$')) console.warn(` was created with unknown prop '${key}'`); }); function change_handler(event) { bubble($$self, event); } $$self.$set = $$props => { if ('value' in $$props) $$invalidate('value', value = $$props.value); if ('hideValue' in $$props) $$invalidate('hideValue', hideValue = $$props.hideValue); if ('className' in $$props) $$invalidate('className', className = $$props.className); if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb); }; $$self.$capture_state = () => { return { value, hideValue, className, _bb, actualValue }; }; $$self.$inject_state = $$props => { if ('value' in $$props) $$invalidate('value', value = $$props.value); if ('hideValue' in $$props) $$invalidate('hideValue', hideValue = $$props.hideValue); if ('className' in $$props) $$invalidate('className', className = $$props.className); if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb); if ('actualValue' in $$props) $$invalidate('actualValue', actualValue = $$props.actualValue); }; $$self.$$.update = ($$dirty = { _bb: 1, value: 1 }) => { if ($$dirty._bb || $$dirty.value) { { if(_bb && value._isstate) { _bb.store.subscribe(s => { $$invalidate('actualValue', actualValue = _bb.store.getValue(s, value)); }); } } } }; return { value, hideValue, className, _bb, actualValue, change_handler }; } class Textbox extends SvelteComponentDev { constructor(options) { super(options); init(this, options, instance, create_fragment, safe_not_equal, ["value", "hideValue", "className", "_bb"]); dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "Textbox", options, id: create_fragment.name }); const { ctx } = this.$$; const props = options.props || {}; if (ctx._bb === undefined && !('_bb' in props)) { console.warn(" was created without expected prop '_bb'"); } } get value() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set value(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } get hideValue() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set hideValue(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } get className() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set className(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } get _bb() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set _bb(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } } /* src\Form.svelte generated by Svelte v3.12.1 */ const file$1 = "src\\Form.svelte"; function get_each_context(ctx, list, i) { const child_ctx = Object.create(ctx); child_ctx.child = list[i]; child_ctx.index = i; return child_ctx; } // (30:4) {#each formControls as child, index} function create_each_block(ctx) { var div0, t0_value = ctx.labels[ctx.index] + "", t0, t1, div1, index = ctx.index; const assign_div1 = () => ctx.div1_binding(div1, index); const unassign_div1 = () => ctx.div1_binding(null, index); const block = { c: function create() { div0 = element("div"); t0 = text(t0_value); t1 = space(); div1 = element("div"); this.h(); }, l: function claim(nodes) { div0 = claim_element(nodes, "DIV", { class: true }, false); var div0_nodes = children(div0); t0 = claim_text(div0_nodes, t0_value); div0_nodes.forEach(detach_dev); t1 = claim_space(nodes); div1 = claim_element(nodes, "DIV", { class: true }, false); var div1_nodes = children(div1); div1_nodes.forEach(detach_dev); this.h(); }, h: function hydrate() { attr_dev(div0, "class", "label svelte-m9d6ue"); add_location(div0, file$1, 30, 4, 559); attr_dev(div1, "class", "control svelte-m9d6ue"); add_location(div1, file$1, 31, 4, 604); }, m: function mount(target, anchor) { insert_dev(target, div0, anchor); append_dev(div0, t0); insert_dev(target, t1, anchor); insert_dev(target, div1, anchor); assign_div1(); }, p: function update(changed, new_ctx) { ctx = new_ctx; if ((changed.labels) && t0_value !== (t0_value = ctx.labels[ctx.index] + "")) { set_data_dev(t0, t0_value); } if (index !== ctx.index) { unassign_div1(); index = ctx.index; assign_div1(); } }, d: function destroy(detaching) { if (detaching) { detach_dev(div0); detach_dev(t1); detach_dev(div1); } unassign_div1(); } }; dispatch_dev("SvelteRegisterBlock", { block, id: create_each_block.name, type: "each", source: "(30:4) {#each formControls as child, index}", ctx }); return block; } function create_fragment$1(ctx) { var div, div_class_value; let each_value = ctx.formControls; let each_blocks = []; for (let i = 0; i < each_value.length; i += 1) { each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i)); } const block = { c: function create() { div = element("div"); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } this.h(); }, l: function claim(nodes) { div = claim_element(nodes, "DIV", { class: true }, false); var div_nodes = children(div); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].l(div_nodes); } div_nodes.forEach(detach_dev); this.h(); }, h: function hydrate() { attr_dev(div, "class", div_class_value = "form-root " + ctx.containerClass + " svelte-m9d6ue"); add_location(div, file$1, 28, 0, 473); }, m: function mount(target, anchor) { insert_dev(target, div, anchor); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].m(div, null); } }, p: function update(changed, ctx) { if (changed.htmlElements || changed.labels || changed.formControls) { each_value = ctx.formControls; let i; for (i = 0; i < each_value.length; i += 1) { const child_ctx = get_each_context(ctx, each_value, i); if (each_blocks[i]) { each_blocks[i].p(changed, child_ctx); } else { each_blocks[i] = create_each_block(child_ctx); each_blocks[i].c(); each_blocks[i].m(div, null); } } for (; i < each_blocks.length; i += 1) { each_blocks[i].d(1); } each_blocks.length = each_value.length; } if ((changed.containerClass) && div_class_value !== (div_class_value = "form-root " + ctx.containerClass + " svelte-m9d6ue")) { attr_dev(div, "class", div_class_value); } }, i: noop, o: noop, d: function destroy(detaching) { if (detaching) { detach_dev(div); } destroy_each(each_blocks, detaching); } }; dispatch_dev("SvelteRegisterBlock", { block, id: create_fragment$1.name, type: "component", source: "", ctx }); return block; } function instance$1($$self, $$props, $$invalidate) { let { containerClass = "", formControls = [], _bb } = $$props; let htmlElements = {}; let labels = {}; const writable_props = ['containerClass', 'formControls', '_bb']; Object.keys($$props).forEach(key => { if (!writable_props.includes(key) && !key.startsWith('$$')) console.warn(`
was created with unknown prop '${key}'`); }); function div1_binding($$value, index) { if (htmlElements[index] === $$value) return; binding_callbacks[$$value ? 'unshift' : 'push'](() => { htmlElements[index] = $$value; $$invalidate('htmlElements', htmlElements); }); } $$self.$set = $$props => { if ('containerClass' in $$props) $$invalidate('containerClass', containerClass = $$props.containerClass); if ('formControls' in $$props) $$invalidate('formControls', formControls = $$props.formControls); if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb); }; $$self.$capture_state = () => { return { containerClass, formControls, _bb, htmlElements, labels }; }; $$self.$inject_state = $$props => { if ('containerClass' in $$props) $$invalidate('containerClass', containerClass = $$props.containerClass); if ('formControls' in $$props) $$invalidate('formControls', formControls = $$props.formControls); if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb); if ('htmlElements' in $$props) $$invalidate('htmlElements', htmlElements = $$props.htmlElements); if ('labels' in $$props) $$invalidate('labels', labels = $$props.labels); }; $$self.$$.update = ($$dirty = { formControls: 1, _bb: 1, htmlElements: 1 }) => { if ($$dirty.formControls || $$dirty._bb || $$dirty.htmlElements) { { let cIndex = 0; for(let c of formControls) { $$invalidate('labels', labels[cIndex] = c.label, labels); cIndex++; } if(_bb && htmlElements) { for(let el in htmlElements) { _bb.initialiseComponent( formControls[el].control, htmlElements[el] ); } } } } }; return { containerClass, formControls, _bb, htmlElements, labels, div1_binding }; } class Form extends SvelteComponentDev { constructor(options) { super(options); init(this, options, instance$1, create_fragment$1, safe_not_equal, ["containerClass", "formControls", "_bb"]); dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "Form", options, id: create_fragment$1.name }); const { ctx } = this.$$; const props = options.props || {}; if (ctx._bb === undefined && !('_bb' in props)) { console.warn(" was created without expected prop '_bb'"); } } get containerClass() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set containerClass(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } get formControls() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set formControls(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } get _bb() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set _bb(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } } /* src\Login.svelte generated by Svelte v3.12.1 */ const file$2 = "src\\Login.svelte"; // (57:8) {#if _logo} function create_if_block_1(ctx) { var div, img; const block = { c: function create() { div = element("div"); img = element("img"); this.h(); }, l: function claim(nodes) { div = claim_element(nodes, "DIV", { class: true }, false); var div_nodes = children(div); img = claim_element(div_nodes, "IMG", { src: true, alt: true, class: true }, false); var img_nodes = children(img); img_nodes.forEach(detach_dev); div_nodes.forEach(detach_dev); this.h(); }, h: function hydrate() { attr_dev(img, "src", ctx._logo); attr_dev(img, "alt", "logo"); attr_dev(img, "class", "svelte-crnq0a"); add_location(img, file$2, 58, 12, 1206); attr_dev(div, "class", "logo-container svelte-crnq0a"); add_location(div, file$2, 57, 8, 1165); }, m: function mount(target, anchor) { insert_dev(target, div, anchor); append_dev(div, img); }, p: function update(changed, ctx) { if (changed._logo) { attr_dev(img, "src", ctx._logo); } }, d: function destroy(detaching) { if (detaching) { detach_dev(div); } } }; dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block_1.name, type: "if", source: "(57:8) {#if _logo}", ctx }); return block; } // (86:8) {#if incorrect} function create_if_block$1(ctx) { var div, t; const block = { c: function create() { div = element("div"); t = text("Incorrect username or password"); this.h(); }, l: function claim(nodes) { div = claim_element(nodes, "DIV", { class: true }, false); var div_nodes = children(div); t = claim_text(div_nodes, "Incorrect username or password"); div_nodes.forEach(detach_dev); this.h(); }, h: function hydrate() { attr_dev(div, "class", "incorrect-details-panel svelte-crnq0a"); add_location(div, file$2, 86, 8, 2018); }, m: function mount(target, anchor) { insert_dev(target, div, anchor); append_dev(div, t); }, d: function destroy(detaching) { if (detaching) { detach_dev(div); } } }; dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block$1.name, type: "if", source: "(86:8) {#if incorrect}", ctx }); return block; } function create_fragment$2(ctx) { var div7, div6, t0, div4, div0, t1, t2, div1, input0, input0_class_value, t3, div2, t4, t5, div3, input1, input1_class_value, t6, div5, button, t7, button_class_value, t8, dispose; var if_block0 = (ctx._logo) && create_if_block_1(ctx); var if_block1 = (ctx.incorrect) && create_if_block$1(ctx); const block = { c: function create() { div7 = element("div"); div6 = element("div"); if (if_block0) if_block0.c(); t0 = space(); div4 = element("div"); div0 = element("div"); t1 = text(ctx.usernameLabel); t2 = space(); div1 = element("div"); input0 = element("input"); t3 = space(); div2 = element("div"); t4 = text(ctx.passwordLabel); t5 = space(); div3 = element("div"); input1 = element("input"); t6 = space(); div5 = element("div"); button = element("button"); t7 = text(ctx.loginButtonLabel); t8 = space(); if (if_block1) if_block1.c(); this.h(); }, l: function claim(nodes) { div7 = claim_element(nodes, "DIV", { class: true }, false); var div7_nodes = children(div7); div6 = claim_element(div7_nodes, "DIV", { class: true }, false); var div6_nodes = children(div6); if (if_block0) if_block0.l(div6_nodes); t0 = claim_space(div6_nodes); div4 = claim_element(div6_nodes, "DIV", { class: true }, false); var div4_nodes = children(div4); div0 = claim_element(div4_nodes, "DIV", { class: true }, false); var div0_nodes = children(div0); t1 = claim_text(div0_nodes, ctx.usernameLabel); div0_nodes.forEach(detach_dev); t2 = claim_space(div4_nodes); div1 = claim_element(div4_nodes, "DIV", { class: true }, false); var div1_nodes = children(div1); input0 = claim_element(div1_nodes, "INPUT", { type: true, class: true }, false); var input0_nodes = children(input0); input0_nodes.forEach(detach_dev); div1_nodes.forEach(detach_dev); t3 = claim_space(div4_nodes); div2 = claim_element(div4_nodes, "DIV", { class: true }, false); var div2_nodes = children(div2); t4 = claim_text(div2_nodes, ctx.passwordLabel); div2_nodes.forEach(detach_dev); t5 = claim_space(div4_nodes); div3 = claim_element(div4_nodes, "DIV", { class: true }, false); var div3_nodes = children(div3); input1 = claim_element(div3_nodes, "INPUT", { type: true, class: true }, false); var input1_nodes = children(input1); input1_nodes.forEach(detach_dev); div3_nodes.forEach(detach_dev); div4_nodes.forEach(detach_dev); t6 = claim_space(div6_nodes); div5 = claim_element(div6_nodes, "DIV", { class: true }, false); var div5_nodes = children(div5); button = claim_element(div5_nodes, "BUTTON", { disabled: true, class: true }, false); var button_nodes = children(button); t7 = claim_text(button_nodes, ctx.loginButtonLabel); button_nodes.forEach(detach_dev); div5_nodes.forEach(detach_dev); t8 = claim_space(div6_nodes); if (if_block1) if_block1.l(div6_nodes); div6_nodes.forEach(detach_dev); div7_nodes.forEach(detach_dev); this.h(); }, h: function hydrate() { attr_dev(div0, "class", "label svelte-crnq0a"); add_location(div0, file$2, 63, 12, 1310); attr_dev(input0, "type", "text"); attr_dev(input0, "class", input0_class_value = "" + null_to_empty(ctx._inputClass) + " svelte-crnq0a"); add_location(input0, file$2, 67, 16, 1431); attr_dev(div1, "class", "control svelte-crnq0a"); add_location(div1, file$2, 66, 12, 1393); attr_dev(div2, "class", "label svelte-crnq0a"); add_location(div2, file$2, 69, 12, 1525); attr_dev(input1, "type", "password"); attr_dev(input1, "class", input1_class_value = "" + null_to_empty(ctx._inputClass) + " svelte-crnq0a"); add_location(input1, file$2, 73, 16, 1646); attr_dev(div3, "class", "control svelte-crnq0a"); add_location(div3, file$2, 72, 12, 1608); attr_dev(div4, "class", "form-root svelte-crnq0a"); add_location(div4, file$2, 62, 8, 1274); button.disabled = ctx.busy; attr_dev(button, "class", button_class_value = "" + null_to_empty(ctx._buttonClass) + " svelte-crnq0a"); add_location(button, file$2, 78, 12, 1805); attr_dev(div5, "class", "login-button-container svelte-crnq0a"); add_location(div5, file$2, 77, 8, 1756); attr_dev(div6, "class", "content svelte-crnq0a"); add_location(div6, file$2, 54, 4, 1114); attr_dev(div7, "class", "root svelte-crnq0a"); add_location(div7, file$2, 52, 0, 1090); dispose = [ listen_dev(input0, "input", ctx.input0_input_handler), listen_dev(input1, "input", ctx.input1_input_handler), listen_dev(button, "click", ctx.login) ]; }, m: function mount(target, anchor) { insert_dev(target, div7, anchor); append_dev(div7, div6); if (if_block0) if_block0.m(div6, null); append_dev(div6, t0); append_dev(div6, div4); append_dev(div4, div0); append_dev(div0, t1); append_dev(div4, t2); append_dev(div4, div1); append_dev(div1, input0); set_input_value(input0, ctx.username); append_dev(div4, t3); append_dev(div4, div2); append_dev(div2, t4); append_dev(div4, t5); append_dev(div4, div3); append_dev(div3, input1); set_input_value(input1, ctx.password); append_dev(div6, t6); append_dev(div6, div5); append_dev(div5, button); append_dev(button, t7); append_dev(div6, t8); if (if_block1) if_block1.m(div6, null); }, p: function update(changed, ctx) { if (ctx._logo) { if (if_block0) { if_block0.p(changed, ctx); } else { if_block0 = create_if_block_1(ctx); if_block0.c(); if_block0.m(div6, t0); } } else if (if_block0) { if_block0.d(1); if_block0 = null; } if (changed.usernameLabel) { set_data_dev(t1, ctx.usernameLabel); } if (changed.username && (input0.value !== ctx.username)) set_input_value(input0, ctx.username); if ((changed._inputClass) && input0_class_value !== (input0_class_value = "" + null_to_empty(ctx._inputClass) + " svelte-crnq0a")) { attr_dev(input0, "class", input0_class_value); } if (changed.passwordLabel) { set_data_dev(t4, ctx.passwordLabel); } if (changed.password && (input1.value !== ctx.password)) set_input_value(input1, ctx.password); if ((changed._inputClass) && input1_class_value !== (input1_class_value = "" + null_to_empty(ctx._inputClass) + " svelte-crnq0a")) { attr_dev(input1, "class", input1_class_value); } if (changed.loginButtonLabel) { set_data_dev(t7, ctx.loginButtonLabel); } if (changed.busy) { prop_dev(button, "disabled", ctx.busy); } if ((changed._buttonClass) && button_class_value !== (button_class_value = "" + null_to_empty(ctx._buttonClass) + " svelte-crnq0a")) { attr_dev(button, "class", button_class_value); } if (ctx.incorrect) { if (!if_block1) { if_block1 = create_if_block$1(ctx); if_block1.c(); if_block1.m(div6, null); } } else if (if_block1) { if_block1.d(1); if_block1 = null; } }, i: noop, o: noop, d: function destroy(detaching) { if (detaching) { detach_dev(div7); } if (if_block0) if_block0.d(); if (if_block1) if_block1.d(); run_all(dispose); } }; dispatch_dev("SvelteRegisterBlock", { block, id: create_fragment$2.name, type: "component", source: "", ctx }); return block; } function instance$2($$self, $$props, $$invalidate) { let { usernameLabel = "Username", passwordLabel = "Password", loginButtonLabel = "Login", loginRedirect = "", logo = "", buttonClass = "", inputClass="", _bb } = $$props; let username = ""; let password = ""; let busy = false; let incorrect = false; let _logo = ""; let _buttonClass = ""; let _inputClass = ""; const login = () => { $$invalidate('busy', busy = true); _bb.api.post("/api/authenticate", {username, password}) .then(r => { $$invalidate('busy', busy = false); if(r.status === 200) { return r.json(); } else { $$invalidate('incorrect', incorrect = true); return; } }) .then(user => { if(user) { localStorage.setItem("budibase:user", user); location.reload(); } }); }; const writable_props = ['usernameLabel', 'passwordLabel', 'loginButtonLabel', 'loginRedirect', 'logo', 'buttonClass', 'inputClass', '_bb']; Object.keys($$props).forEach(key => { if (!writable_props.includes(key) && !key.startsWith('$$')) console.warn(` was created with unknown prop '${key}'`); }); function input0_input_handler() { username = this.value; $$invalidate('username', username); } function input1_input_handler() { password = this.value; $$invalidate('password', password); } $$self.$set = $$props => { if ('usernameLabel' in $$props) $$invalidate('usernameLabel', usernameLabel = $$props.usernameLabel); if ('passwordLabel' in $$props) $$invalidate('passwordLabel', passwordLabel = $$props.passwordLabel); if ('loginButtonLabel' in $$props) $$invalidate('loginButtonLabel', loginButtonLabel = $$props.loginButtonLabel); if ('loginRedirect' in $$props) $$invalidate('loginRedirect', loginRedirect = $$props.loginRedirect); if ('logo' in $$props) $$invalidate('logo', logo = $$props.logo); if ('buttonClass' in $$props) $$invalidate('buttonClass', buttonClass = $$props.buttonClass); if ('inputClass' in $$props) $$invalidate('inputClass', inputClass = $$props.inputClass); if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb); }; $$self.$capture_state = () => { return { usernameLabel, passwordLabel, loginButtonLabel, loginRedirect, logo, buttonClass, inputClass, _bb, username, password, busy, incorrect, _logo, _buttonClass, _inputClass }; }; $$self.$inject_state = $$props => { if ('usernameLabel' in $$props) $$invalidate('usernameLabel', usernameLabel = $$props.usernameLabel); if ('passwordLabel' in $$props) $$invalidate('passwordLabel', passwordLabel = $$props.passwordLabel); if ('loginButtonLabel' in $$props) $$invalidate('loginButtonLabel', loginButtonLabel = $$props.loginButtonLabel); if ('loginRedirect' in $$props) $$invalidate('loginRedirect', loginRedirect = $$props.loginRedirect); if ('logo' in $$props) $$invalidate('logo', logo = $$props.logo); if ('buttonClass' in $$props) $$invalidate('buttonClass', buttonClass = $$props.buttonClass); if ('inputClass' in $$props) $$invalidate('inputClass', inputClass = $$props.inputClass); if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb); if ('username' in $$props) $$invalidate('username', username = $$props.username); if ('password' in $$props) $$invalidate('password', password = $$props.password); if ('busy' in $$props) $$invalidate('busy', busy = $$props.busy); if ('incorrect' in $$props) $$invalidate('incorrect', incorrect = $$props.incorrect); if ('_logo' in $$props) $$invalidate('_logo', _logo = $$props._logo); if ('_buttonClass' in $$props) $$invalidate('_buttonClass', _buttonClass = $$props._buttonClass); if ('_inputClass' in $$props) $$invalidate('_inputClass', _inputClass = $$props._inputClass); }; $$self.$$.update = ($$dirty = { _bb: 1, logo: 1, buttonClass: 1, inputClass: 1 }) => { if ($$dirty._bb || $$dirty.logo || $$dirty.buttonClass || $$dirty.inputClass) { { $$invalidate('_logo', _logo = _bb.relativeUrl(logo)); $$invalidate('_buttonClass', _buttonClass = buttonClass || "default-button"); $$invalidate('_inputClass', _inputClass = inputClass || "default-input"); } } }; return { usernameLabel, passwordLabel, loginButtonLabel, loginRedirect, logo, buttonClass, inputClass, _bb, username, password, busy, incorrect, _logo, _buttonClass, _inputClass, login, input0_input_handler, input1_input_handler }; } class Login extends SvelteComponentDev { constructor(options) { super(options); init(this, options, instance$2, create_fragment$2, safe_not_equal, ["usernameLabel", "passwordLabel", "loginButtonLabel", "loginRedirect", "logo", "buttonClass", "inputClass", "_bb"]); dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "Login", options, id: create_fragment$2.name }); const { ctx } = this.$$; const props = options.props || {}; if (ctx._bb === undefined && !('_bb' in props)) { console.warn(" was created without expected prop '_bb'"); } } get usernameLabel() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set usernameLabel(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } get passwordLabel() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set passwordLabel(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } get loginButtonLabel() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set loginButtonLabel(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } get loginRedirect() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set loginRedirect(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } get logo() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set logo(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } get buttonClass() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set buttonClass(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } get inputClass() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set inputClass(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } get _bb() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set _bb(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } } const buildStyle = (styles) => { let str = ""; for(let s in styles) { if(styles[s]) { str += `${s}: ${styles[s]}; `; } } return str; }; /* src\Grid.svelte generated by Svelte v3.12.1 */ const file$3 = "src\\Grid.svelte"; function get_each_context$1(ctx, list, i) { const child_ctx = Object.create(ctx); child_ctx.child = list[i]; child_ctx.index = i; return child_ctx; } // (49:4) {#each children as child, index} function create_each_block$1(ctx) { var div, index = ctx.index, div_class_value, div_style_value; const assign_div = () => ctx.div_binding(div, index); const unassign_div = () => ctx.div_binding(null, index); const block = { c: function create() { div = element("div"); this.h(); }, l: function claim(nodes) { div = claim_element(nodes, "DIV", { class: true, style: true }, false); var div_nodes = children(div); div_nodes.forEach(detach_dev); this.h(); }, h: function hydrate() { attr_dev(div, "class", div_class_value = "" + null_to_empty(ctx.itemContainerClass) + " svelte-10kw8to"); attr_dev(div, "style", div_style_value = ctx.childStyle(ctx.child)); add_location(div, file$3, 49, 4, 1268); }, m: function mount(target, anchor) { insert_dev(target, div, anchor); assign_div(); }, p: function update(changed, new_ctx) { ctx = new_ctx; if (index !== ctx.index) { unassign_div(); index = ctx.index; assign_div(); } if ((changed.itemContainerClass) && div_class_value !== (div_class_value = "" + null_to_empty(ctx.itemContainerClass) + " svelte-10kw8to")) { attr_dev(div, "class", div_class_value); } if ((changed.children) && div_style_value !== (div_style_value = ctx.childStyle(ctx.child))) { attr_dev(div, "style", div_style_value); } }, d: function destroy(detaching) { if (detaching) { detach_dev(div); } unassign_div(); } }; dispatch_dev("SvelteRegisterBlock", { block, id: create_each_block$1.name, type: "each", source: "(49:4) {#each children as child, index}", ctx }); return block; } function create_fragment$3(ctx) { var div, div_class_value; let each_value = ctx.children; let each_blocks = []; for (let i = 0; i < each_value.length; i += 1) { each_blocks[i] = create_each_block$1(get_each_context$1(ctx, each_value, i)); } const block = { c: function create() { div = element("div"); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } this.h(); }, l: function claim(nodes) { div = claim_element(nodes, "DIV", { class: true, style: true }, false); var div_nodes = children(div); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].l(div_nodes); } div_nodes.forEach(detach_dev); this.h(); }, h: function hydrate() { attr_dev(div, "class", div_class_value = "root " + ctx.containerClass + " svelte-10kw8to"); set_style(div, "width", ctx.width); set_style(div, "height", ctx.height); set_style(div, "grid-template-columns", ctx.gridTemplateColumns); set_style(div, "grid-template-rows", ctx.gridTemplateRows); add_location(div, file$3, 46, 0, 1055); }, m: function mount(target, anchor) { insert_dev(target, div, anchor); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].m(div, null); } }, p: function update(changed, ctx) { if (changed.itemContainerClass || changed.childStyle || changed.children || changed.htmlElements) { each_value = ctx.children; let i; for (i = 0; i < each_value.length; i += 1) { const child_ctx = get_each_context$1(ctx, each_value, i); if (each_blocks[i]) { each_blocks[i].p(changed, child_ctx); } else { each_blocks[i] = create_each_block$1(child_ctx); each_blocks[i].c(); each_blocks[i].m(div, null); } } for (; i < each_blocks.length; i += 1) { each_blocks[i].d(1); } each_blocks.length = each_value.length; } if ((changed.containerClass) && div_class_value !== (div_class_value = "root " + ctx.containerClass + " svelte-10kw8to")) { attr_dev(div, "class", div_class_value); } if (changed.width) { set_style(div, "width", ctx.width); } if (changed.height) { set_style(div, "height", ctx.height); } if (changed.gridTemplateColumns) { set_style(div, "grid-template-columns", ctx.gridTemplateColumns); } if (changed.gridTemplateRows) { set_style(div, "grid-template-rows", ctx.gridTemplateRows); } }, i: noop, o: noop, d: function destroy(detaching) { if (detaching) { detach_dev(div); } destroy_each(each_blocks, detaching); } }; dispatch_dev("SvelteRegisterBlock", { block, id: create_fragment$3.name, type: "component", source: "", ctx }); return block; } let style=""; function instance$3($$self, $$props, $$invalidate) { let { gridTemplateRows ="", gridTemplateColumns ="", children = [], width = "auto", height = "auto", containerClass="", itemContainerClass="", _bb } = $$props; let htmlElements = {}; const childStyle = child => buildStyle({ "grid-column-start": child.gridColumnStart, "grid-column-end": child.gridColumnEnd, "grid-column": child.gridColumn, "grid-row-start": child.gridRowStart, "grid-row-end": child.gridRowStart, "grid-row": child.gridRow, }); const writable_props = ['gridTemplateRows', 'gridTemplateColumns', 'children', 'width', 'height', 'containerClass', 'itemContainerClass', '_bb']; Object.keys($$props).forEach(key => { if (!writable_props.includes(key) && !key.startsWith('$$')) console.warn(` was created with unknown prop '${key}'`); }); function div_binding($$value, index) { if (htmlElements[index] === $$value) return; binding_callbacks[$$value ? 'unshift' : 'push'](() => { htmlElements[index] = $$value; $$invalidate('htmlElements', htmlElements); }); } $$self.$set = $$props => { if ('gridTemplateRows' in $$props) $$invalidate('gridTemplateRows', gridTemplateRows = $$props.gridTemplateRows); if ('gridTemplateColumns' in $$props) $$invalidate('gridTemplateColumns', gridTemplateColumns = $$props.gridTemplateColumns); if ('children' in $$props) $$invalidate('children', children = $$props.children); if ('width' in $$props) $$invalidate('width', width = $$props.width); if ('height' in $$props) $$invalidate('height', height = $$props.height); if ('containerClass' in $$props) $$invalidate('containerClass', containerClass = $$props.containerClass); if ('itemContainerClass' in $$props) $$invalidate('itemContainerClass', itemContainerClass = $$props.itemContainerClass); if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb); }; $$self.$capture_state = () => { return { gridTemplateRows, gridTemplateColumns, children, width, height, containerClass, itemContainerClass, _bb, style, htmlElements }; }; $$self.$inject_state = $$props => { if ('gridTemplateRows' in $$props) $$invalidate('gridTemplateRows', gridTemplateRows = $$props.gridTemplateRows); if ('gridTemplateColumns' in $$props) $$invalidate('gridTemplateColumns', gridTemplateColumns = $$props.gridTemplateColumns); if ('children' in $$props) $$invalidate('children', children = $$props.children); if ('width' in $$props) $$invalidate('width', width = $$props.width); if ('height' in $$props) $$invalidate('height', height = $$props.height); if ('containerClass' in $$props) $$invalidate('containerClass', containerClass = $$props.containerClass); if ('itemContainerClass' in $$props) $$invalidate('itemContainerClass', itemContainerClass = $$props.itemContainerClass); if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb); if ('style' in $$props) style = $$props.style; if ('htmlElements' in $$props) $$invalidate('htmlElements', htmlElements = $$props.htmlElements); }; $$self.$$.update = ($$dirty = { _bb: 1, htmlElements: 1, children: 1 }) => { if ($$dirty._bb || $$dirty.htmlElements || $$dirty.children) { { if(_bb && htmlElements) { for(let el in htmlElements) { _bb.initialiseComponent( children[el].control, htmlElements[el] ); } } } } }; return { gridTemplateRows, gridTemplateColumns, children, width, height, containerClass, itemContainerClass, _bb, htmlElements, childStyle, div_binding }; } class Grid extends SvelteComponentDev { constructor(options) { super(options); init(this, options, instance$3, create_fragment$3, safe_not_equal, ["gridTemplateRows", "gridTemplateColumns", "children", "width", "height", "containerClass", "itemContainerClass", "_bb"]); dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "Grid", options, id: create_fragment$3.name }); const { ctx } = this.$$; const props = options.props || {}; if (ctx._bb === undefined && !('_bb' in props)) { console.warn(" was created without expected prop '_bb'"); } } get gridTemplateRows() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set gridTemplateRows(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } get gridTemplateColumns() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set gridTemplateColumns(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } get children() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set children(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } get width() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set width(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } get height() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set height(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } get containerClass() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set containerClass(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } get itemContainerClass() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set itemContainerClass(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } get _bb() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set _bb(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } } /* src\Text.svelte generated by Svelte v3.12.1 */ const file$4 = "src\\Text.svelte"; function create_fragment$4(ctx) { var div, t; const block = { c: function create() { div = element("div"); t = text(ctx.value); this.h(); }, l: function claim(nodes) { div = claim_element(nodes, "DIV", { class: true, style: true }, false); var div_nodes = children(div); t = claim_text(div_nodes, ctx.value); div_nodes.forEach(detach_dev); this.h(); }, h: function hydrate() { attr_dev(div, "class", ctx.containerClass); attr_dev(div, "style", ctx.style); add_location(div, file$4, 27, 0, 442); }, m: function mount(target, anchor) { insert_dev(target, div, anchor); append_dev(div, t); }, p: function update(changed, ctx) { if (changed.value) { set_data_dev(t, ctx.value); } if (changed.containerClass) { attr_dev(div, "class", ctx.containerClass); } if (changed.style) { attr_dev(div, "style", ctx.style); } }, i: noop, o: noop, d: function destroy(detaching) { if (detaching) { detach_dev(div); } } }; dispatch_dev("SvelteRegisterBlock", { block, id: create_fragment$4.name, type: "component", source: "", ctx }); return block; } function instance$4($$self, $$props, $$invalidate) { let { value="", containerClass="", font="", textAlign="", verticalAlign="", color="", display="", _bb } = $$props; let style=""; const writable_props = ['value', 'containerClass', 'font', 'textAlign', 'verticalAlign', 'color', 'display', '_bb']; Object.keys($$props).forEach(key => { if (!writable_props.includes(key) && !key.startsWith('$$')) console.warn(` was created with unknown prop '${key}'`); }); $$self.$set = $$props => { if ('value' in $$props) $$invalidate('value', value = $$props.value); if ('containerClass' in $$props) $$invalidate('containerClass', containerClass = $$props.containerClass); if ('font' in $$props) $$invalidate('font', font = $$props.font); if ('textAlign' in $$props) $$invalidate('textAlign', textAlign = $$props.textAlign); if ('verticalAlign' in $$props) $$invalidate('verticalAlign', verticalAlign = $$props.verticalAlign); if ('color' in $$props) $$invalidate('color', color = $$props.color); if ('display' in $$props) $$invalidate('display', display = $$props.display); if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb); }; $$self.$capture_state = () => { return { value, containerClass, font, textAlign, verticalAlign, color, display, _bb, style }; }; $$self.$inject_state = $$props => { if ('value' in $$props) $$invalidate('value', value = $$props.value); if ('containerClass' in $$props) $$invalidate('containerClass', containerClass = $$props.containerClass); if ('font' in $$props) $$invalidate('font', font = $$props.font); if ('textAlign' in $$props) $$invalidate('textAlign', textAlign = $$props.textAlign); if ('verticalAlign' in $$props) $$invalidate('verticalAlign', verticalAlign = $$props.verticalAlign); if ('color' in $$props) $$invalidate('color', color = $$props.color); if ('display' in $$props) $$invalidate('display', display = $$props.display); if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb); if ('style' in $$props) $$invalidate('style', style = $$props.style); }; $$self.$$.update = ($$dirty = { font: 1, verticalAlign: 1, color: 1, textAlign: 1 }) => { if ($$dirty.font || $$dirty.verticalAlign || $$dirty.color || $$dirty.textAlign) { { $$invalidate('style', style=buildStyle({ font, verticalAlign, color, "text-align": textAlign, "vertical-align": verticalAlign })); } } }; return { value, containerClass, font, textAlign, verticalAlign, color, display, _bb, style }; } class Text extends SvelteComponentDev { constructor(options) { super(options); init(this, options, instance$4, create_fragment$4, safe_not_equal, ["value", "containerClass", "font", "textAlign", "verticalAlign", "color", "display", "_bb"]); dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "Text", options, id: create_fragment$4.name }); const { ctx } = this.$$; const props = options.props || {}; if (ctx._bb === undefined && !('_bb' in props)) { console.warn(" was created without expected prop '_bb'"); } } get value() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set value(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } get containerClass() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set containerClass(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } get font() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set font(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } get textAlign() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set textAlign(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } get verticalAlign() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set verticalAlign(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } get color() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set color(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } get display() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set display(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } get _bb() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set _bb(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } } // https://github.com/kaisermann/svelte-css-vars var cssVars = (node, props) => { Object.entries(props).forEach(([key, value]) => { node.style.setProperty(`--${key}`, value); }); return { update(new_props) { Object.entries(new_props).forEach(([key, value]) => { node.style.setProperty(`--${key}`, value); delete props[key]; }); Object.keys(props).forEach(name => node.style.removeProperty(`--${name}`), ); props = new_props; }, }; }; /* src\Nav.svelte generated by Svelte v3.12.1 */ const file$5 = "src\\Nav.svelte"; function get_each_context$2(ctx, list, i) { const child_ctx = Object.create(ctx); child_ctx.navItem = list[i]; child_ctx.index = i; return child_ctx; } // (36:8) {#each items as navItem, index} function create_each_block$2(ctx) { var div, t0_value = ctx.navItem.title + "", t0, t1, dispose; const block = { c: function create() { div = element("div"); t0 = text(t0_value); t1 = space(); this.h(); }, l: function claim(nodes) { div = claim_element(nodes, "DIV", { class: true }, false); var div_nodes = children(div); t0 = claim_text(div_nodes, t0_value); t1 = claim_space(div_nodes); div_nodes.forEach(detach_dev); this.h(); }, h: function hydrate() { attr_dev(div, "class", "navitem svelte-aihwli"); toggle_class(div, "selected", ctx.selectedIndex === ctx.index); add_location(div, file$5, 36, 8, 865); dispose = listen_dev(div, "click", ctx.onSelectItem(ctx.index)); }, m: function mount(target, anchor) { insert_dev(target, div, anchor); append_dev(div, t0); append_dev(div, t1); }, p: function update(changed, new_ctx) { ctx = new_ctx; if ((changed.items) && t0_value !== (t0_value = ctx.navItem.title + "")) { set_data_dev(t0, t0_value); } if (changed.selectedIndex) { toggle_class(div, "selected", ctx.selectedIndex === ctx.index); } }, d: function destroy(detaching) { if (detaching) { detach_dev(div); } dispose(); } }; dispatch_dev("SvelteRegisterBlock", { block, id: create_each_block$2.name, type: "each", source: "(36:8) {#each items as navItem, index}", ctx }); return block; } function create_fragment$5(ctx) { var div2, div0, t, div1, cssVars_action; let each_value = ctx.items; let each_blocks = []; for (let i = 0; i < each_value.length; i += 1) { each_blocks[i] = create_each_block$2(get_each_context$2(ctx, each_value, i)); } const block = { c: function create() { div2 = element("div"); div0 = element("div"); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } t = space(); div1 = element("div"); this.h(); }, l: function claim(nodes) { div2 = claim_element(nodes, "DIV", { class: true }, false); var div2_nodes = children(div2); div0 = claim_element(div2_nodes, "DIV", { class: true }, false); var div0_nodes = children(div0); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].l(div0_nodes); } div0_nodes.forEach(detach_dev); t = claim_space(div2_nodes); div1 = claim_element(div2_nodes, "DIV", { class: true }, false); var div1_nodes = children(div1); div1_nodes.forEach(detach_dev); div2_nodes.forEach(detach_dev); this.h(); }, h: function hydrate() { attr_dev(div0, "class", "navbar svelte-aihwli"); add_location(div0, file$5, 34, 4, 794); attr_dev(div1, "class", "content svelte-aihwli"); add_location(div1, file$5, 43, 4, 1066); attr_dev(div2, "class", "root svelte-aihwli"); add_location(div2, file$5, 33, 0, 746); }, m: function mount(target, anchor) { insert_dev(target, div2, anchor); append_dev(div2, div0); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].m(div0, null); } append_dev(div2, t); append_dev(div2, div1); ctx.div1_binding(div1); cssVars_action = cssVars.call(null, div2, ctx.styleVars) || {}; }, p: function update(changed, ctx) { if (changed.selectedIndex || changed.items) { each_value = ctx.items; let i; for (i = 0; i < each_value.length; i += 1) { const child_ctx = get_each_context$2(ctx, each_value, i); if (each_blocks[i]) { each_blocks[i].p(changed, child_ctx); } else { each_blocks[i] = create_each_block$2(child_ctx); each_blocks[i].c(); each_blocks[i].m(div0, null); } } for (; i < each_blocks.length; i += 1) { each_blocks[i].d(1); } each_blocks.length = each_value.length; } if (typeof cssVars_action.update === 'function' && changed.styleVars) { cssVars_action.update.call(null, ctx.styleVars); } }, i: noop, o: noop, d: function destroy(detaching) { if (detaching) { detach_dev(div2); } destroy_each(each_blocks, detaching); ctx.div1_binding(null); if (cssVars_action && typeof cssVars_action.destroy === 'function') cssVars_action.destroy(); } }; dispatch_dev("SvelteRegisterBlock", { block, id: create_fragment$5.name, type: "component", source: "", ctx }); return block; } function instance$5($$self, $$props, $$invalidate) { let { navBarBackground = "", navBarBorder="", navBarColor="", selectedItemBackground="", selectedItemColor="", selectedItemBorder="", itemHoverBackground="", itemHoverColor="", items = [], _bb } = $$props; let selectedIndex; let contentElement; const onSelectItem = (index) => () => { $$invalidate('selectedIndex', selectedIndex = index); _bb.initialiseComponent(items[index].component, contentElement); }; const writable_props = ['navBarBackground', 'navBarBorder', 'navBarColor', 'selectedItemBackground', 'selectedItemColor', 'selectedItemBorder', 'itemHoverBackground', 'itemHoverColor', 'items', '_bb']; Object.keys($$props).forEach(key => { if (!writable_props.includes(key) && !key.startsWith('$$')) console.warn(`