function noop() {} function assign(tar, src) { // @ts-ignore for (const k in src) tar[k] = src[k] return tar } 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 create_slot(definition, ctx, fn) { if (definition) { const slot_ctx = get_slot_context(definition, ctx, fn) return definition[0](slot_ctx) } } function get_slot_context(definition, ctx, fn) { return definition[1] ? assign({}, assign(ctx.$$scope.ctx, definition[1](fn ? fn(ctx) : {}))) : ctx.$$scope.ctx } function get_slot_changes(definition, ctx, changed, fn) { return definition[1] ? assign( {}, assign(ctx.$$scope.changed || {}, definition[1](fn ? fn(changed) : {})) ) : ctx.$$scope.changed || {} } 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_data(text, data) { data = "" + data if (text.data !== data) text.data = data } 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) } let current_component function set_current_component(component) { current_component = 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) } } 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 } } /* src\Button.svelte generated by Svelte v3.12.1 */ function add_css() { var style = element("style") style.id = "svelte-1q8lga0-style" style.textContent = ".default.svelte-1q8lga0{font-family:inherit;font-size:inherit;padding:0.4em;margin:0 0 0.5em 0;box-sizing:border-box;border:1px solid #ccc;border-radius:2px;color:#333;background-color:#f4f4f4;outline:none}.default.svelte-1q8lga0:active{background-color:#ddd}.default.svelte-1q8lga0:focus{border-color:#666}" append(document.head, style) } // (30:4) {:else} function create_else_block(ctx) { var current const default_slot_template = ctx.$$slots.default const default_slot = create_slot(default_slot_template, ctx, null) return { c() { if (default_slot) default_slot.c() }, l(nodes) { if (default_slot) default_slot.l(nodes) }, m(target, anchor) { if (default_slot) { default_slot.m(target, anchor) } current = true }, p(changed, ctx) { if (default_slot && default_slot.p && changed.$$scope) { default_slot.p( get_slot_changes(default_slot_template, ctx, changed, null), get_slot_context(default_slot_template, ctx, null) ) } }, i(local) { if (current) return transition_in(default_slot, local) current = true }, o(local) { transition_out(default_slot, local) current = false }, d(detaching) { if (default_slot) default_slot.d(detaching) }, } } // (28:26) function create_if_block_1(ctx) { var t return { c() { t = text(ctx.contentText) }, l(nodes) { t = claim_text(nodes, ctx.contentText) }, m(target, anchor) { insert(target, t, anchor) }, p(changed, ctx) { if (changed.contentText) { set_data(t, ctx.contentText) } }, i: noop, o: noop, d(detaching) { if (detaching) { detach(t) } }, } } // (25:4) {#if contentComponent && contentComponent._component} function create_if_block(ctx) { var div return { c() { div = element("div") }, l(nodes) { div = claim_element(nodes, "DIV", {}, false) var div_nodes = children(div) div_nodes.forEach(detach) }, m(target, anchor) { insert(target, div, anchor) ctx.div_binding(div) }, p: noop, i: noop, o: noop, d(detaching) { if (detaching) { detach(div) } ctx.div_binding(null) }, } } function create_fragment(ctx) { var button, current_block_type_index, if_block, button_class_value, current, dispose var if_block_creators = [ create_if_block, create_if_block_1, create_else_block, ] var if_blocks = [] function select_block_type(changed, ctx) { if (ctx.contentComponent && ctx.contentComponent._component) return 0 if (ctx.contentText) return 1 return 2 } current_block_type_index = select_block_type(null, ctx) if_block = if_blocks[current_block_type_index] = if_block_creators[ current_block_type_index ](ctx) return { c() { button = element("button") if_block.c() this.h() }, l(nodes) { button = claim_element( nodes, "BUTTON", { class: true, disabled: true }, false ) var button_nodes = children(button) if_block.l(button_nodes) button_nodes.forEach(detach) this.h() }, h() { attr( button, "class", (button_class_value = "" + null_to_empty(ctx.className) + " svelte-1q8lga0") ) button.disabled = ctx.disabled dispose = listen(button, "click", ctx.clickHandler) }, m(target, anchor) { insert(target, button, anchor) if_blocks[current_block_type_index].m(button, null) current = true }, p(changed, ctx) { var previous_block_index = current_block_type_index current_block_type_index = select_block_type(changed, ctx) if (current_block_type_index === previous_block_index) { if_blocks[current_block_type_index].p(changed, ctx) } else { group_outros() transition_out(if_blocks[previous_block_index], 1, 1, () => { if_blocks[previous_block_index] = null }) check_outros() if_block = if_blocks[current_block_type_index] if (!if_block) { if_block = if_blocks[current_block_type_index] = if_block_creators[ current_block_type_index ](ctx) if_block.c() } transition_in(if_block, 1) if_block.m(button, null) } if ( (!current || changed.className) && button_class_value !== (button_class_value = "" + null_to_empty(ctx.className) + " svelte-1q8lga0") ) { attr(button, "class", button_class_value) } if (!current || changed.disabled) { button.disabled = ctx.disabled } }, i(local) { if (current) return transition_in(if_block) current = true }, o(local) { transition_out(if_block) current = false }, d(detaching) { if (detaching) { detach(button) } if_blocks[current_block_type_index].d() dispose() }, } } function instance($$self, $$props, $$invalidate) { let { className = "default", disabled = false, contentText, contentComponent, onClick = () => {}, } = $$props let { _bb } = $$props let contentComponentContainer const clickHandler = () => { if (onClick) onClick() } let { $$slots = {}, $$scope } = $$props function div_binding($$value) { binding_callbacks[$$value ? "unshift" : "push"](() => { $$invalidate( "contentComponentContainer", (contentComponentContainer = $$value) ) }) } $$self.$set = $$props => { if ("className" in $$props) $$invalidate("className", (className = $$props.className)) if ("disabled" in $$props) $$invalidate("disabled", (disabled = $$props.disabled)) if ("contentText" in $$props) $$invalidate("contentText", (contentText = $$props.contentText)) if ("contentComponent" in $$props) $$invalidate( "contentComponent", (contentComponent = $$props.contentComponent) ) if ("onClick" in $$props) $$invalidate("onClick", (onClick = $$props.onClick)) if ("_bb" in $$props) $$invalidate("_bb", (_bb = $$props._bb)) if ("$$scope" in $$props) $$invalidate("$$scope", ($$scope = $$props.$$scope)) } $$self.$$.update = ( $$dirty = { _bb: 1, contentComponentContainer: 1, contentComponent: 1 } ) => { if ( $$dirty._bb || $$dirty.contentComponentContainer || $$dirty.contentComponent ) { { if (_bb && contentComponentContainer && contentComponent._component) _bb.hydrateComponent(contentComponent, contentComponentContainer) } } } return { className, disabled, contentText, contentComponent, onClick, _bb, contentComponentContainer, clickHandler, div_binding, $$slots, $$scope, } } class Button extends SvelteComponent { constructor(options) { super() if (!document.getElementById("svelte-1q8lga0-style")) add_css() init(this, options, instance, create_fragment, safe_not_equal, [ "className", "disabled", "contentText", "contentComponent", "onClick", "_bb", ]) } } /* src\Textbox.svelte generated by Svelte v3.12.1 */ function add_css$1() { var style = element("style") style.id = "svelte-1ec4wqj-style" style.textContent = ".default.svelte-1ec4wqj{width:100%;font-family:inherit;font-size:inherit;padding:0.4em;margin:0 0 0.5em 0;box-sizing:border-box;border:1px solid #ccc;border-radius:2px;width:100%}.default.svelte-1ec4wqj:disabled{color:#ccc}" append(document.head, style) } // (32:0) {:else} function create_else_block$1(ctx) { var input, input_class_value return { c() { input = element("input") this.h() }, l(nodes) { input = claim_element( nodes, "INPUT", { class: true, type: true, value: true }, false ) var input_nodes = children(input) input_nodes.forEach(detach) this.h() }, h() { attr( input, "class", (input_class_value = "" + null_to_empty(ctx.className) + " svelte-1ec4wqj") ) attr(input, "type", "text") input.value = ctx.actualValue }, m(target, anchor) { insert(target, input, anchor) }, p(changed, ctx) { if ( changed.className && input_class_value !== (input_class_value = "" + null_to_empty(ctx.className) + " svelte-1ec4wqj") ) { attr(input, "class", input_class_value) } if (changed.actualValue) { input.value = ctx.actualValue } }, d(detaching) { if (detaching) { detach(input) } }, } } // (28:0) {#if hideValue} function create_if_block$1(ctx) { var input, input_class_value, dispose return { c() { input = element("input") this.h() }, l(nodes) { input = claim_element( nodes, "INPUT", { class: true, type: true, value: true }, false ) var input_nodes = children(input) input_nodes.forEach(detach) this.h() }, h() { attr( input, "class", (input_class_value = "" + null_to_empty(ctx.className) + " svelte-1ec4wqj") ) attr(input, "type", "password") input.value = ctx.actualValue dispose = listen(input, "change", ctx.change_handler) }, m(target, anchor) { insert(target, input, anchor) }, p(changed, ctx) { if ( changed.className && input_class_value !== (input_class_value = "" + null_to_empty(ctx.className) + " svelte-1ec4wqj") ) { attr(input, "class", input_class_value) } if (changed.actualValue) { input.value = ctx.actualValue } }, d(detaching) { if (detaching) { detach(input) } dispose() }, } } function create_fragment$1(ctx) { var if_block_anchor function select_block_type(changed, ctx) { if (ctx.hideValue) return create_if_block$1 return create_else_block$1 } var current_block_type = select_block_type(null, ctx) var if_block = current_block_type(ctx) return { c() { if_block.c() if_block_anchor = empty() }, l(nodes) { if_block.l(nodes) if_block_anchor = empty() }, m(target, anchor) { if_block.m(target, anchor) insert(target, if_block_anchor, anchor) }, p(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(detaching) { if_block.d(detaching) if (detaching) { detach(if_block_anchor) } }, } } function instance$1($$self, $$props, $$invalidate) { let { value = "", hideValue = false, className = "default", _bb } = $$props let actualValue = "" 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.$$.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 SvelteComponent { constructor(options) { super() if (!document.getElementById("svelte-1ec4wqj-style")) add_css$1() init(this, options, instance$1, create_fragment$1, safe_not_equal, [ "value", "hideValue", "className", "_bb", ]) } } /* src\Form.svelte generated by Svelte v3.12.1 */ function add_css$2() { var style = element("style") style.id = "svelte-m9d6ue-style" style.textContent = ".form-root.svelte-m9d6ue{display:grid;grid-template-columns:[label] auto [control] 1fr}.label.svelte-m9d6ue{grid-column-start:label;padding:5px 10px;vertical-align:middle}.control.svelte-m9d6ue{grid-column-start:control;padding:5px 10px}.overflow.svelte-m9d6ue{grid-column-start:overflow}.full-width.svelte-m9d6ue{width:100%}" append(document.head, style) } 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) return { c() { div0 = element("div") t0 = text(t0_value) t1 = space() div1 = element("div") this.h() }, l(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) t1 = claim_space(nodes) div1 = claim_element(nodes, "DIV", { class: true }, false) var div1_nodes = children(div1) div1_nodes.forEach(detach) this.h() }, h() { attr(div0, "class", "label svelte-m9d6ue") attr(div1, "class", "control svelte-m9d6ue") }, m(target, anchor) { insert(target, div0, anchor) append(div0, t0) insert(target, t1, anchor) insert(target, div1, anchor) assign_div1() }, p(changed, new_ctx) { ctx = new_ctx if ( changed.labels && t0_value !== (t0_value = ctx.labels[ctx.index] + "") ) { set_data(t0, t0_value) } if (index !== ctx.index) { unassign_div1() index = ctx.index assign_div1() } }, d(detaching) { if (detaching) { detach(div0) detach(t1) detach(div1) } unassign_div1() }, } } function create_fragment$2(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)) } return { c() { div = element("div") for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c() } this.h() }, l(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) this.h() }, h() { attr( div, "class", (div_class_value = "form-root " + ctx.containerClass + " svelte-m9d6ue") ) }, m(target, anchor) { insert(target, div, anchor) for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].m(div, null) } }, p(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(div, "class", div_class_value) } }, i: noop, o: noop, d(detaching) { if (detaching) { detach(div) } destroy_each(each_blocks, detaching) }, } } function instance$2($$self, $$props, $$invalidate) { let { containerClass = "", formControls = [], _bb } = $$props let htmlElements = {} let labels = {} 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.$$.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.hydrateComponent(formControls[el].control, htmlElements[el]) } } } } } return { containerClass, formControls, _bb, htmlElements, labels, div1_binding, } } class Form extends SvelteComponent { constructor(options) { super() if (!document.getElementById("svelte-m9d6ue-style")) add_css$2() init(this, options, instance$2, create_fragment$2, safe_not_equal, [ "containerClass", "formControls", "_bb", ]) } } /* src\Login.svelte generated by Svelte v3.12.1 */ function add_css$3() { var style = element("style") style.id = "svelte-crnq0a-style" style.textContent = ".root.svelte-crnq0a{height:100%;display:grid;grid-template-columns:[left] 1fr [middle] auto [right] 1fr;grid-template-rows:[top] 1fr [center] auto [bottom] 1fr}.content.svelte-crnq0a{grid-column-start:middle;grid-row-start:center;width:400px}.logo-container.svelte-crnq0a{margin-bottom:20px\n}.logo-container.svelte-crnq0a>img.svelte-crnq0a{max-width:100%}.login-button-container.svelte-crnq0a{text-align:right;margin-top:20px}.incorrect-details-panel.svelte-crnq0a{margin-top:30px;padding:10px;border-style:solid;border-width:1px;border-color:maroon;border-radius:1px;text-align:center;color:maroon;background-color:mistyrose}.form-root.svelte-crnq0a{display:grid;grid-template-columns:[label] auto [control] 1fr}.label.svelte-crnq0a{grid-column-start:label;padding:5px 10px;vertical-align:middle}.control.svelte-crnq0a{grid-column-start:control;padding:5px 10px}.default-input.svelte-crnq0a{font-family:inherit;font-size:inherit;padding:0.4em;margin:0 0 0.5em 0;box-sizing:border-box;border:1px solid #ccc;border-radius:2px;width:100%}.default-button.svelte-crnq0a{font-family:inherit;font-size:inherit;padding:0.4em;margin:0 0 0.5em 0;box-sizing:border-box;border:1px solid #ccc;border-radius:2px;color:#333;background-color:#f4f4f4;outline:none}.default-button.svelte-crnq0a:active{background-color:#ddd}.default-button.svelte-crnq0a:focus{border-color:#666}" append(document.head, style) } // (57:8) {#if _logo} function create_if_block_1$1(ctx) { var div, img return { c() { div = element("div") img = element("img") this.h() }, l(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) div_nodes.forEach(detach) this.h() }, h() { attr(img, "src", ctx._logo) attr(img, "alt", "logo") attr(img, "class", "svelte-crnq0a") attr(div, "class", "logo-container svelte-crnq0a") }, m(target, anchor) { insert(target, div, anchor) append(div, img) }, p(changed, ctx) { if (changed._logo) { attr(img, "src", ctx._logo) } }, d(detaching) { if (detaching) { detach(div) } }, } } // (86:8) {#if incorrect} function create_if_block$2(ctx) { var div, t return { c() { div = element("div") t = text("Incorrect username or password") this.h() }, l(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) this.h() }, h() { attr(div, "class", "incorrect-details-panel svelte-crnq0a") }, m(target, anchor) { insert(target, div, anchor) append(div, t) }, d(detaching) { if (detaching) { detach(div) } }, } } function create_fragment$3(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$1(ctx) var if_block1 = ctx.incorrect && create_if_block$2() return { c() { 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(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) 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) div1_nodes.forEach(detach) 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) 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) div3_nodes.forEach(detach) div4_nodes.forEach(detach) 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) div5_nodes.forEach(detach) t8 = claim_space(div6_nodes) if (if_block1) if_block1.l(div6_nodes) div6_nodes.forEach(detach) div7_nodes.forEach(detach) this.h() }, h() { attr(div0, "class", "label svelte-crnq0a") attr(input0, "type", "text") attr( input0, "class", (input0_class_value = "" + null_to_empty(ctx._inputClass) + " svelte-crnq0a") ) attr(div1, "class", "control svelte-crnq0a") attr(div2, "class", "label svelte-crnq0a") attr(input1, "type", "password") attr( input1, "class", (input1_class_value = "" + null_to_empty(ctx._inputClass) + " svelte-crnq0a") ) attr(div3, "class", "control svelte-crnq0a") attr(div4, "class", "form-root svelte-crnq0a") button.disabled = ctx.busy attr( button, "class", (button_class_value = "" + null_to_empty(ctx._buttonClass) + " svelte-crnq0a") ) attr(div5, "class", "login-button-container svelte-crnq0a") attr(div6, "class", "content svelte-crnq0a") attr(div7, "class", "root svelte-crnq0a") dispose = [ listen(input0, "input", ctx.input0_input_handler), listen(input1, "input", ctx.input1_input_handler), listen(button, "click", ctx.login), ] }, m(target, anchor) { insert(target, div7, anchor) append(div7, div6) if (if_block0) if_block0.m(div6, null) append(div6, t0) append(div6, div4) append(div4, div0) append(div0, t1) append(div4, t2) append(div4, div1) append(div1, input0) set_input_value(input0, ctx.username) append(div4, t3) append(div4, div2) append(div2, t4) append(div4, t5) append(div4, div3) append(div3, input1) set_input_value(input1, ctx.password) append(div6, t6) append(div6, div5) append(div5, button) append(button, t7) append(div6, t8) if (if_block1) if_block1.m(div6, null) }, p(changed, ctx) { if (ctx._logo) { if (if_block0) { if_block0.p(changed, ctx) } else { if_block0 = create_if_block_1$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(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(input0, "class", input0_class_value) } if (changed.passwordLabel) { set_data(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(input1, "class", input1_class_value) } if (changed.loginButtonLabel) { set_data(t7, ctx.loginButtonLabel) } if (changed.busy) { button.disabled = ctx.busy } if ( changed._buttonClass && button_class_value !== (button_class_value = "" + null_to_empty(ctx._buttonClass) + " svelte-crnq0a") ) { attr(button, "class", button_class_value) } if (ctx.incorrect) { if (!if_block1) { if_block1 = create_if_block$2() if_block1.c() if_block1.m(div6, null) } } else if (if_block1) { if_block1.d(1) if_block1 = null } }, i: noop, o: noop, d(detaching) { if (detaching) { detach(div7) } if (if_block0) if_block0.d() if (if_block1) if_block1.d() run_all(dispose) }, } } function instance$3($$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() } }) } 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.$$.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 SvelteComponent { constructor(options) { super() if (!document.getElementById("svelte-crnq0a-style")) add_css$3() init(this, options, instance$3, create_fragment$3, safe_not_equal, [ "usernameLabel", "passwordLabel", "loginButtonLabel", "loginRedirect", "logo", "buttonClass", "inputClass", "_bb", ]) } } 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 */ function add_css$4() { var style = element("style") style.id = "svelte-10kw8to-style" style.textContent = ".root.svelte-10kw8to{display:grid}" append(document.head, style) } 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) return { c() { div = element("div") this.h() }, l(nodes) { div = claim_element(nodes, "DIV", { class: true, style: true }, false) var div_nodes = children(div) div_nodes.forEach(detach) this.h() }, h() { attr( div, "class", (div_class_value = "" + null_to_empty(ctx.itemContainerClass) + " svelte-10kw8to") ) attr(div, "style", (div_style_value = ctx.childStyle(ctx.child))) }, m(target, anchor) { insert(target, div, anchor) assign_div() }, p(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(div, "class", div_class_value) } if ( changed.children && div_style_value !== (div_style_value = ctx.childStyle(ctx.child)) ) { attr(div, "style", div_style_value) } }, d(detaching) { if (detaching) { detach(div) } unassign_div() }, } } function create_fragment$4(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)) } return { c() { div = element("div") for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c() } this.h() }, l(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) this.h() }, h() { attr( 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) }, m(target, anchor) { insert(target, div, anchor) for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].m(div, null) } }, p(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(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(detaching) { if (detaching) { detach(div) } destroy_each(each_blocks, detaching) }, } } function instance$4($$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, }) 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.$$.update = ($$dirty = { _bb: 1, htmlElements: 1, children: 1 }) => { if ($$dirty._bb || $$dirty.htmlElements || $$dirty.children) { { if (_bb && htmlElements) { for (let el in htmlElements) { _bb.hydrateComponent(children[el].control, htmlElements[el]) } } } } } return { gridTemplateRows, gridTemplateColumns, children, width, height, containerClass, itemContainerClass, _bb, htmlElements, childStyle, div_binding, } } class Grid extends SvelteComponent { constructor(options) { super() if (!document.getElementById("svelte-10kw8to-style")) add_css$4() init(this, options, instance$4, create_fragment$4, safe_not_equal, [ "gridTemplateRows", "gridTemplateColumns", "children", "width", "height", "containerClass", "itemContainerClass", "_bb", ]) } } /* src\StackPanel.svelte generated by Svelte v3.12.1 */ const { Object: Object_1 } = globals function add_css$5() { var style = element("style") style.id = "svelte-osi0db-style" style.textContent = ".horizontal.svelte-osi0db{display:inline-block}.vertical.svelte-osi0db{display:block}" append(document.head, style) } function get_each_context$2(ctx, list, i) { const child_ctx = Object_1.create(ctx) child_ctx.child = list[i] child_ctx.index = i return child_ctx } function get_each_context_1(ctx, list, i) { const child_ctx = Object_1.create(ctx) child_ctx.child = list[i] child_ctx.index = i return child_ctx } // (76:4) {#each children as child, index} function create_each_block_1(ctx) { var div1, div0, index = ctx.index, div0_class_value, div1_class_value const assign_div0 = () => ctx.div0_binding(div0, index) const unassign_div0 = () => ctx.div0_binding(null, index) return { c() { div1 = element("div") div0 = element("div") this.h() }, l(nodes) { div1 = claim_element(nodes, "DIV", { class: true }, false) var div1_nodes = children(div1) div0 = claim_element(div1_nodes, "DIV", { class: true }, false) var div0_nodes = children(div0) div0_nodes.forEach(detach) div1_nodes.forEach(detach) this.h() }, h() { attr( div0, "class", (div0_class_value = "" + null_to_empty(ctx.itemContainerClass) + " svelte-osi0db") ) attr( div1, "class", (div1_class_value = "" + null_to_empty(ctx.direction) + " svelte-osi0db") ) }, m(target, anchor) { insert(target, div1, anchor) append(div1, div0) assign_div0() }, p(changed, new_ctx) { ctx = new_ctx if (index !== ctx.index) { unassign_div0() index = ctx.index assign_div0() } if ( changed.itemContainerClass && div0_class_value !== (div0_class_value = "" + null_to_empty(ctx.itemContainerClass) + " svelte-osi0db") ) { attr(div0, "class", div0_class_value) } if ( changed.direction && div1_class_value !== (div1_class_value = "" + null_to_empty(ctx.direction) + " svelte-osi0db") ) { attr(div1, "class", div1_class_value) } }, d(detaching) { if (detaching) { detach(div1) } unassign_div0() }, } } // (83:4) {#each data as child, index} function create_each_block$2(ctx) { var div1, div0, index = ctx.index, div0_class_value, t, div1_class_value const assign_div0 = () => ctx.div0_binding_1(div0, index) const unassign_div0 = () => ctx.div0_binding_1(null, index) return { c() { div1 = element("div") div0 = element("div") t = space() this.h() }, l(nodes) { div1 = claim_element(nodes, "DIV", { class: true }, false) var div1_nodes = children(div1) div0 = claim_element(div1_nodes, "DIV", { class: true }, false) var div0_nodes = children(div0) div0_nodes.forEach(detach) t = claim_space(div1_nodes) div1_nodes.forEach(detach) this.h() }, h() { attr( div0, "class", (div0_class_value = "" + null_to_empty(ctx.itemContainerClass) + " svelte-osi0db") ) attr( div1, "class", (div1_class_value = "" + null_to_empty(ctx.direction) + " svelte-osi0db") ) }, m(target, anchor) { insert(target, div1, anchor) append(div1, div0) assign_div0() append(div1, t) }, p(changed, new_ctx) { ctx = new_ctx if (index !== ctx.index) { unassign_div0() index = ctx.index assign_div0() } if ( changed.itemContainerClass && div0_class_value !== (div0_class_value = "" + null_to_empty(ctx.itemContainerClass) + " svelte-osi0db") ) { attr(div0, "class", div0_class_value) } if ( changed.direction && div1_class_value !== (div1_class_value = "" + null_to_empty(ctx.direction) + " svelte-osi0db") ) { attr(div1, "class", div1_class_value) } }, d(detaching) { if (detaching) { detach(div1) } unassign_div0() }, } } function create_fragment$5(ctx) { var div, t, div_class_value let each_value_1 = ctx.children let each_blocks_1 = [] for (let i = 0; i < each_value_1.length; i += 1) { each_blocks_1[i] = create_each_block_1( get_each_context_1(ctx, each_value_1, i) ) } let each_value = ctx.data 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)) } return { c() { div = element("div") for (let i = 0; i < each_blocks_1.length; i += 1) { each_blocks_1[i].c() } t = space() for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c() } this.h() }, l(nodes) { div = claim_element(nodes, "DIV", { class: true, style: true }, false) var div_nodes = children(div) for (let i = 0; i < each_blocks_1.length; i += 1) { each_blocks_1[i].l(div_nodes) } t = claim_space(div_nodes) for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].l(div_nodes) } div_nodes.forEach(detach) this.h() }, h() { attr( div, "class", (div_class_value = "root " + ctx.containerClass + " svelte-osi0db") ) set_style(div, "width", ctx.width) set_style(div, "height", ctx.height) }, m(target, anchor) { insert(target, div, anchor) for (let i = 0; i < each_blocks_1.length; i += 1) { each_blocks_1[i].m(div, null) } append(div, t) for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].m(div, null) } }, p(changed, ctx) { if ( changed.direction || changed.itemContainerClass || changed.staticHtmlElements || changed.children ) { each_value_1 = ctx.children let i for (i = 0; i < each_value_1.length; i += 1) { const child_ctx = get_each_context_1(ctx, each_value_1, i) if (each_blocks_1[i]) { each_blocks_1[i].p(changed, child_ctx) } else { each_blocks_1[i] = create_each_block_1(child_ctx) each_blocks_1[i].c() each_blocks_1[i].m(div, t) } } for (; i < each_blocks_1.length; i += 1) { each_blocks_1[i].d(1) } each_blocks_1.length = each_value_1.length } if ( changed.direction || changed.itemContainerClass || changed.dataBoundElements || changed.data ) { each_value = ctx.data 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(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-osi0db") ) { attr(div, "class", div_class_value) } if (changed.width) { set_style(div, "width", ctx.width) } if (changed.height) { set_style(div, "height", ctx.height) } }, i: noop, o: noop, d(detaching) { if (detaching) { detach(div) } destroy_each(each_blocks_1, detaching) destroy_each(each_blocks, detaching) }, } } function instance$5($$self, $$props, $$invalidate) { let { direction = "horizontal", children = [], width = "auto", height = "auto", containerClass = "", itemContainerClass = "", onLoad, data = [], dataItemComponent, _bb, } = $$props let staticHtmlElements = {} let staticComponents = {} let dataBoundElements = {} let dataBoundComponents = {} const hasDataBoundComponents = () => Object.getOwnPropertyNames(dataBoundComponents).length === 0 const hasData = () => Array.isArray(data) && data.length > 0 const hasStaticComponents = () => { return Object.getOwnPropertyNames(staticComponents).length === 0 } function div0_binding($$value, index) { if (staticHtmlElements[index] === $$value) return binding_callbacks[$$value ? "unshift" : "push"](() => { staticHtmlElements[index] = $$value $$invalidate("staticHtmlElements", staticHtmlElements) }) } function div0_binding_1($$value, index) { if (dataBoundElements[index] === $$value) return binding_callbacks[$$value ? "unshift" : "push"](() => { dataBoundElements[index] = $$value $$invalidate("dataBoundElements", dataBoundElements) }) } $$self.$set = $$props => { if ("direction" in $$props) $$invalidate("direction", (direction = $$props.direction)) 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 ("onLoad" in $$props) $$invalidate("onLoad", (onLoad = $$props.onLoad)) if ("data" in $$props) $$invalidate("data", (data = $$props.data)) if ("dataItemComponent" in $$props) $$invalidate( "dataItemComponent", (dataItemComponent = $$props.dataItemComponent) ) if ("_bb" in $$props) $$invalidate("_bb", (_bb = $$props._bb)) } $$self.$$.update = ( $$dirty = { staticHtmlElements: 1, staticComponents: 1, _bb: 1, children: 1, dataBoundComponents: 1, dataBoundElements: 1, dataItemComponent: 1, data: 1, } ) => { if ( $$dirty.staticHtmlElements || $$dirty.staticComponents || $$dirty._bb || $$dirty.children || $$dirty.dataBoundComponents || $$dirty.dataBoundElements || $$dirty.dataItemComponent || $$dirty.data ) { { if (staticHtmlElements) { if (hasStaticComponents()) { for (let c in staticComponents) { staticComponents[c].$destroy() } $$invalidate("staticComponents", (staticComponents = {})) } for (let el in staticHtmlElements) { $$invalidate( "staticComponents", (staticComponents[el] = _bb.hydrateComponent( children[el].control, staticHtmlElements[el] )), staticComponents ) } } if (hasDataBoundComponents()) { for (let c in dataBoundComponents) { dataBoundComponents[c].$destroy() } $$invalidate("dataBoundComponents", (dataBoundComponents = {})) } if (hasData()) { for (let d in dataBoundElements) { _bb.hydrateComponent( dataItemComponent, dataBoundElements[d], data[parseInt(d)] ) } } } } } return { direction, children, width, height, containerClass, itemContainerClass, onLoad, data, dataItemComponent, _bb, staticHtmlElements, dataBoundElements, div0_binding, div0_binding_1, } } class StackPanel extends SvelteComponent { constructor(options) { super() if (!document.getElementById("svelte-osi0db-style")) add_css$5() init(this, options, instance$5, create_fragment$5, safe_not_equal, [ "direction", "children", "width", "height", "containerClass", "itemContainerClass", "onLoad", "data", "dataItemComponent", "_bb", ]) } } // 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 */ function add_css$6() { var style = element("style") style.id = "svelte-aihwli-style" style.textContent = ".root.svelte-aihwli{height:100%;width:100%;grid-template-columns:[navbar] auto [content] 1fr;display:grid}.navbar.svelte-aihwli{grid-column:navbar;background:var(--navBarBackground);border:var(--navBarBorder);color:var(--navBarColor)}.navitem.svelte-aihwli{padding:10px 17px;cursor:pointer}.navitem.svelte-aihwli:hover{background:var(--itemHoverBackground);color:var(--itemHoverColor)}.navitem.selected.svelte-aihwli{background:var(--selectedItemBackground);border:var(--selectedItemBorder);color:var(--selectedItemColor)}.content.svelte-aihwli{grid-column:content}" append(document.head, style) } function get_each_context$3(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$3(ctx) { var div, t0_value = ctx.navItem.title + "", t0, t1, dispose return { c() { div = element("div") t0 = text(t0_value) t1 = space() this.h() }, l(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) this.h() }, h() { attr(div, "class", "navitem svelte-aihwli") toggle_class(div, "selected", ctx.selectedIndex === ctx.index) dispose = listen(div, "click", ctx.onSelectItem(ctx.index)) }, m(target, anchor) { insert(target, div, anchor) append(div, t0) append(div, t1) }, p(changed, new_ctx) { ctx = new_ctx if (changed.items && t0_value !== (t0_value = ctx.navItem.title + "")) { set_data(t0, t0_value) } if (changed.selectedIndex) { toggle_class(div, "selected", ctx.selectedIndex === ctx.index) } }, d(detaching) { if (detaching) { detach(div) } dispose() }, } } function create_fragment$6(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$3(get_each_context$3(ctx, each_value, i)) } return { c() { 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(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) t = claim_space(div2_nodes) div1 = claim_element(div2_nodes, "DIV", { class: true }, false) var div1_nodes = children(div1) div1_nodes.forEach(detach) div2_nodes.forEach(detach) this.h() }, h() { attr(div0, "class", "navbar svelte-aihwli") attr(div1, "class", "content svelte-aihwli") attr(div2, "class", "root svelte-aihwli") }, m(target, anchor) { insert(target, div2, anchor) append(div2, div0) for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].m(div0, null) } append(div2, t) append(div2, div1) ctx.div1_binding(div1) cssVars_action = cssVars.call(null, div2, ctx.styleVars) || {} }, p(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$3(ctx, each_value, i) if (each_blocks[i]) { each_blocks[i].p(changed, child_ctx) } else { each_blocks[i] = create_each_block$3(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(detaching) { if (detaching) { detach(div2) } destroy_each(each_blocks, detaching) ctx.div1_binding(null) if (cssVars_action && typeof cssVars_action.destroy === "function") cssVars_action.destroy() }, } } function instance$6($$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.hydrateComponent(items[index].component, contentElement) } function div1_binding($$value) { binding_callbacks[$$value ? "unshift" : "push"](() => { $$invalidate("contentElement", (contentElement = $$value)) }) } $$self.$set = $$props => { if ("navBarBackground" in $$props) $$invalidate( "navBarBackground", (navBarBackground = $$props.navBarBackground) ) if ("navBarBorder" in $$props) $$invalidate("navBarBorder", (navBarBorder = $$props.navBarBorder)) if ("navBarColor" in $$props) $$invalidate("navBarColor", (navBarColor = $$props.navBarColor)) if ("selectedItemBackground" in $$props) $$invalidate( "selectedItemBackground", (selectedItemBackground = $$props.selectedItemBackground) ) if ("selectedItemColor" in $$props) $$invalidate( "selectedItemColor", (selectedItemColor = $$props.selectedItemColor) ) if ("selectedItemBorder" in $$props) $$invalidate( "selectedItemBorder", (selectedItemBorder = $$props.selectedItemBorder) ) if ("itemHoverBackground" in $$props) $$invalidate( "itemHoverBackground", (itemHoverBackground = $$props.itemHoverBackground) ) if ("itemHoverColor" in $$props) $$invalidate("itemHoverColor", (itemHoverColor = $$props.itemHoverColor)) if ("items" in $$props) $$invalidate("items", (items = $$props.items)) if ("_bb" in $$props) $$invalidate("_bb", (_bb = $$props._bb)) } let styleVars $$self.$$.update = ( $$dirty = { navBarBackground: 1, navBarBorder: 1, navBarColor: 1, selectedItemBackground: 1, selectedItemColor: 1, selectedItemBorder: 1, itemHoverBackground: 1, itemHoverColor: 1, } ) => { if ( $$dirty.navBarBackground || $$dirty.navBarBorder || $$dirty.navBarColor || $$dirty.selectedItemBackground || $$dirty.selectedItemColor || $$dirty.selectedItemBorder || $$dirty.itemHoverBackground || $$dirty.itemHoverColor ) { $$invalidate( "styleVars", (styleVars = { navBarBackground, navBarBorder, navBarColor, selectedItemBackground, selectedItemColor, selectedItemBorder, itemHoverBackground, itemHoverColor, }) ) } } return { navBarBackground, navBarBorder, navBarColor, selectedItemBackground, selectedItemColor, selectedItemBorder, itemHoverBackground, itemHoverColor, items, _bb, selectedIndex, contentElement, onSelectItem, styleVars, div1_binding, } } class Nav extends SvelteComponent { constructor(options) { super() if (!document.getElementById("svelte-aihwli-style")) add_css$6() init(this, options, instance$6, create_fragment$6, safe_not_equal, [ "navBarBackground", "navBarBorder", "navBarColor", "selectedItemBackground", "selectedItemColor", "selectedItemBorder", "itemHoverBackground", "itemHoverColor", "items", "_bb", ]) } } /* src\Panel.svelte generated by Svelte v3.12.1 */ function add_css$7() { var style = element("style") style.id = "svelte-b2rjlq-style" style.textContent = ".panel.svelte-b2rjlq:hover{background:var(--hoverBackground);color:var(--hoverColor)}" append(document.head, style) } function create_fragment$7(ctx) { var div, t_value = ctx.component ? "" : ctx.text + "", t, div_class_value, cssVars_action, dispose return { c() { div = element("div") t = text(t_value) this.h() }, l(nodes) { div = claim_element( nodes, "DIV", { class: true, style: true, "this:bind": true }, false ) var div_nodes = children(div) t = claim_text(div_nodes, t_value) div_nodes.forEach(detach) this.h() }, h() { attr( div, "class", (div_class_value = "" + ctx.containerClass + " panel" + " svelte-b2rjlq") ) attr(div, "style", ctx.style) attr(div, "this:bind", ctx.componentElement) dispose = listen(div, "click", ctx.click_handler) }, m(target, anchor) { insert(target, div, anchor) append(div, t) cssVars_action = cssVars.call(null, div, ctx.styleVars) || {} }, p(changed, ctx) { if ( (changed.component || changed.text) && t_value !== (t_value = ctx.component ? "" : ctx.text + "") ) { set_data(t, t_value) } if ( changed.containerClass && div_class_value !== (div_class_value = "" + ctx.containerClass + " panel" + " svelte-b2rjlq") ) { attr(div, "class", div_class_value) } if (changed.style) { attr(div, "style", ctx.style) } if (typeof cssVars_action.update === "function" && changed.styleVars) { cssVars_action.update.call(null, ctx.styleVars) } }, i: noop, o: noop, d(detaching) { if (detaching) { detach(div) } if (cssVars_action && typeof cssVars_action.destroy === "function") cssVars_action.destroy() dispose() }, } } function instance$7($$self, $$props, $$invalidate) { let { component = "", text = "", containerClass = "", background = "", border = "", borderRadius = "", font = "", display = "", textAlign = "", color = "", padding = "", margin = "", hoverBackground = "", hoverColor = "", onClick, height, width, _bb, } = $$props let styleVars let style = "" let componentElement const click_handler = () => (onClick ? onClick() : undefined) $$self.$set = $$props => { if ("component" in $$props) $$invalidate("component", (component = $$props.component)) if ("text" in $$props) $$invalidate("text", (text = $$props.text)) if ("containerClass" in $$props) $$invalidate("containerClass", (containerClass = $$props.containerClass)) if ("background" in $$props) $$invalidate("background", (background = $$props.background)) if ("border" in $$props) $$invalidate("border", (border = $$props.border)) if ("borderRadius" in $$props) $$invalidate("borderRadius", (borderRadius = $$props.borderRadius)) if ("font" in $$props) $$invalidate("font", (font = $$props.font)) if ("display" in $$props) $$invalidate("display", (display = $$props.display)) if ("textAlign" in $$props) $$invalidate("textAlign", (textAlign = $$props.textAlign)) if ("color" in $$props) $$invalidate("color", (color = $$props.color)) if ("padding" in $$props) $$invalidate("padding", (padding = $$props.padding)) if ("margin" in $$props) $$invalidate("margin", (margin = $$props.margin)) if ("hoverBackground" in $$props) $$invalidate( "hoverBackground", (hoverBackground = $$props.hoverBackground) ) if ("hoverColor" in $$props) $$invalidate("hoverColor", (hoverColor = $$props.hoverColor)) if ("onClick" in $$props) $$invalidate("onClick", (onClick = $$props.onClick)) if ("height" in $$props) $$invalidate("height", (height = $$props.height)) if ("width" in $$props) $$invalidate("width", (width = $$props.width)) if ("_bb" in $$props) $$invalidate("_bb", (_bb = $$props._bb)) } $$self.$$.update = ( $$dirty = { border: 1, background: 1, font: 1, margin: 1, padding: 1, display: 1, color: 1, height: 1, width: 1, textAlign: 1, borderRadius: 1, _bb: 1, component: 1, componentElement: 1, hoverBackground: 1, hoverColor: 1, onClick: 1, } ) => { if ( $$dirty.border || $$dirty.background || $$dirty.font || $$dirty.margin || $$dirty.padding || $$dirty.display || $$dirty.color || $$dirty.height || $$dirty.width || $$dirty.textAlign || $$dirty.borderRadius || $$dirty._bb || $$dirty.component || $$dirty.componentElement || $$dirty.hoverBackground || $$dirty.hoverColor || $$dirty.onClick ) { { $$invalidate( "style", (style = buildStyle({ border, background, font, margin, padding, display, color, height, width, "text-align": textAlign, "border-radius": borderRadius, })) ) if (_bb && component) { _bb.hydrateComponent(component, componentElement) } $$invalidate( "styleVars", (styleVars = { hoverBackground: hoverBackground || background, hoverColor: hoverColor || color, pointer: onClick ? "cursor" : "none", }) ) } } } return { component, text, containerClass, background, border, borderRadius, font, display, textAlign, color, padding, margin, hoverBackground, hoverColor, onClick, height, width, _bb, styleVars, style, componentElement, click_handler, } } class Panel extends SvelteComponent { constructor(options) { super() if (!document.getElementById("svelte-b2rjlq-style")) add_css$7() init(this, options, instance$7, create_fragment$7, safe_not_equal, [ "component", "text", "containerClass", "background", "border", "borderRadius", "font", "display", "textAlign", "color", "padding", "margin", "hoverBackground", "hoverColor", "onClick", "height", "width", "_bb", ]) } } /* src\Text.svelte generated by Svelte v3.12.1 */ function create_fragment$8(ctx) { var div, t return { c() { div = element("div") t = text(ctx.value) this.h() }, l(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) this.h() }, h() { attr(div, "class", ctx.containerClass) attr(div, "style", ctx.style) }, m(target, anchor) { insert(target, div, anchor) append(div, t) }, p(changed, ctx) { if (changed.value) { set_data(t, ctx.value) } if (changed.containerClass) { attr(div, "class", ctx.containerClass) } if (changed.style) { attr(div, "style", ctx.style) } }, i: noop, o: noop, d(detaching) { if (detaching) { detach(div) } }, } } function instance$8($$self, $$props, $$invalidate) { let { value = "", containerClass = "", font = "", textAlign = "", verticalAlign = "", color = "", display = "", _bb, } = $$props let style = "" $$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.$$.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 SvelteComponent { constructor(options) { super() init(this, options, instance$8, create_fragment$8, safe_not_equal, [ "value", "containerClass", "font", "textAlign", "verticalAlign", "color", "display", "_bb", ]) } } export { Button as button, Form as form, Grid as grid, Login as login, Nav as nav, Panel as panel, Stack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1xuICAgIGxldCBydW5uaW5nID0gdHJ1ZTtcbiAgICBsZXQgc3RhcnRlZCA9IGZhbHNlO1xuICAgIGxldCBuYW1lO1xuICAgIGZ1bmN0aW9uIHN0YXJ0KCkge1xuICAgICAgICBpZiAoY3NzKSB7XG4gICAgICAgICAgICBuYW1lID0gY3JlYXRlX3J1bGUobm9kZSwgMCwgMSwgZHVyYXRpb24sIGRlbGF5LCBlYXNpbmcsIGNzcyk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFkZWxheSkge1xuICAgICAgICAgICAgc3RhcnRlZCA9IHRydWU7XG4gICAgICAgIH1cbiAgICB9XG4gICAgZnVuY3Rpb24gc3RvcCgpIHtcbiAgICAgICAgaWYgKGNzcylcbiAgICAgICAgICAgIGRlbGV0ZV9ydWxlKG5vZGUsIG5hbWUpO1xuICAgICAgICBydW5uaW5nID0gZmFsc2U7XG4gICAgfVxuICAgIGxvb3Aobm93ID0+IHtcbiAgICAgICAgaWYgKCFzdGFydGVkICYmIG5vdyA+PSBzdGFydF90aW1lKSB7XG4gICAgICAgICAgICBzdGFydGVkID0gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoc3RhcnRlZCAmJiBub3cgPj0gZW5kKSB7XG4gICAgICAgICAgICB0aWNrKDEsIDApO1xuICAgICAgICAgICAgc3RvcCgpO1xuICAgICAgICB9XG4gICAgICAgIGlmICghcnVubmluZykge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIGlmIChzdGFydGVkKSB7XG4gICAgICAgICAgICBjb25zdCBwID0gbm93IC0gc3RhcnRfdGltZTtcbiAgICAgICAgICAgIGNvbnN0IHQgPSAwICsgMSAqIGVhc2luZyhwIC8gZHVyYXRpb24pO1xuICAgICAgICAgICAgdGljayh0LCAxIC0gdCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfSk7XG4gICAgc3RhcnQoKTtcbiAgICB0aWNrKDA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kge1xuICAgICAgICBjb25zdCB7IGRlbGF5ID0gMCwgZHVyYXRpb24gPSAzMDAsIGVhc2luZyA9IGlkZW50aXR5LCB0aWNrID0gbm9vcCwgY3NzIH0gPSBjb25maWcgfHwgbnVsbF90cmFuc2l0aW9uO1xuICAgICAgICBpZiAoY3NzKVxuICAgICAgICAgICAgYW5pbWF0aW9uX25hbWUgPSBjcmVhdGVfcnVsZShub2RlLCAwLCAxLCBkdXJhdGlvbiwgZGVsYXksIGVhc2luZywgY3NzLCB1aWQrKyk7XG4gICAgICAgIHRpY2soMCwgMSk7XG4gICAgICAgIGNvbnN0IHN0YXJ0X3RpbWUgPSBub3coKSArIGRlbGF5O1xuICAgICAgICBjb25zdCBlbmRfdGltZSA9IHN0YXJ0X3RpbWUgKyBkdXJhdGlvbjtcbiAgICAgICAgaWYgKHRhc2spXG4gICAgICAgICAgICB0YXNrLmFib3J0KCk7XG4gICAgICAgIHJ1bm5pbmcgPSB0cnVlO1xuICAgICAgICBhZGRfcmVuZGVyX2NhbGxiYWNrKCgpID0+IGRpc3BhdGNoKG5vZGUsIHRydWUsICdzdGFydCcpKTtcbiAgICAgICAgdGFzayA9IGxvb3Aobm93ID0+IHtcbiAgICAgICAgICAgIGlmIChydW5uaW5nKSB7XG4gICAgICAgICAgICAgICAgaWYgKG5vdyA+PSBlbmRfdGltZSkge1xuICAgICAgICAgICAgICAgICAgICB0aWNrKDEsIDApO1xuICAgICAgICAgICAgICAgICAgICBkaXNwYXRjaChub2RlLCB0cnVlLCAnZW5kJyk7XG4gICAgICAgICAgICAgICAgICAgIGNsZWFudXAoKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJ1bm5pbmcgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKG5vdyA+PSBzdGFydF90aW1lKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHQgPSBlYXNpbmcoKG5vdyAtIHN0YXJ0X3RpbWUpIC8gZHVyYXRpb24pO1xuICAgICAgICAgICAgICAgICAgICB0aWNrKHQsIDEgLSB0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcnVubmluZztcbiAgICAgICAgfSk7XG4gICAgfVxuICAgIGxldCBzdGFydGVkID0gZmFsc2U7XG4gICAgcmV0dXJuIHtcbiAgICAgICAgc3RhcnQoKSB7XG4gICAgICAgICAgICBpZiAoc3RhcnRlZClcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICBkZWxldGVfcnVsZShub2RlKTtcbiAgICAgICAgICAgIGlmIChpc19mdW5jdGlvbihjb25maWcpKSB7XG4gICAgICAgICAgICAgICAgY29uZmlnID0gY29uZmlnKCk7XG4gICAgICAgICAgICAgICAgd2FpdCgpLnRoZW4oZ28pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgZ28oKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgaW52YWxpZGF0ZSgpIHtcbiAgICAgICAgICAgIHN0YXJ0ZWQgPSBmYWxzZTtcbiAgICAgICAgfSxcbiAgICAgICAgZW5kKCkge1xuICAgICAgICAgICAgaWYgKHJ1bm5pbmcpIHtcbiAgICAgICAgICAgICAgICBjbGVhbnVwKCk7XG4gICAgICAgICAgICAgICAgcnVubmluZyA9IGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfTtcbn1cbmZ1bmN0aW9uIGNyZWF0ZV9vdXRfdHJhbnNpdGlvbihub2RlLCBmbiwgcGFyYW1zKSB7XG4gICAgbGV0IGNvbmZpZyA9IGZuKG5vZGUsIHBhcmFtcyk7XG4gICAgbGV0IHJ1bm5pbmcgPSB0cnVlO1xuICAgIGxldCBhbmltYXRpb25fbmFtZTtcbiAgICBjb25zdCBncm91cCA9IG91dHJvcztcbiAgICBncm91cC5yICs9IDE7XG4gICAgZnVuY3Rpb24gZ28oKSB7XG4gICAgICAgIGNvbnN0IHsgZGVsYXkgPSAwLCBkdXJhdGlvbiA9IDMwMCwgZWFzaW5nID0gaWRlbnRpdHksIHRpY2sgPSBub29wLCBjc3MgfSA9IGNvbmZpZyB8fCBudWxsX3RyYW5zaXRpb247XG4gICAgICAgIGlmIChjc3MpXG4gICAgICAgICAgICBhbmltYXRpb25fbmFtZSA9IGNyZWF0ZV9ydWxlKG5vZGUsIDEsIDAsIGR1cmF0aW9uLCBkZWxheSwgZWFzaW5nLCBjc3MpO1xuICAgICAgICBjb25zdCBzdGFydF90aW1lID0gbm93KCkgKyBkZWxheTtcbiAgICAgICAgY29uc3QgZW5kX3RpbWUgPSBzdGFydF90aW1lICsgZHVyYXRpb247XG4gICAgICAgIGFkZF9yZW5kZXJfY2FsbGJhY2soKCkgPT4gZGlzcGF0Y2gobm9kZSwgZmFsc2UsICdzdGFydCcpKTtcbiAgICAgICAgbG9vcChub3cgPT4ge1xuICAgICAgICAgICAgaWYgKHJ1bm5pbmcpIHtcbiAgICAgICAgICAgICAgICBpZiAobm93ID49IGVuZF90aW1lKSB7XG4gICAgICAgICAgICAgICAgICAgIHRpY2soMCwgMSk7XG4gICAgICAgICAgICAgICAgICAgIGRpc3BhdGNoKG5vZGUsIGZhbHNlLCAnZW5kJyk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghLS1ncm91cC5yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGlzIHdpbGwgcmVzdWx0IGluIGBlbmQoKWAgYmVpbmcgY2FsbGVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gc28gd2UgZG9uJ3QgbmVlZCB0byBjbGVhbiB1cCBoZXJlXG4gICAgICAgICAgICAgICAgICAgICAgICBydW5fYWxsKGdyb3VwLmMpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKG5vdyA+PSBzdGFydF90aW1lKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHQgPSBlYXNpbmcoKG5vdyAtIHN0YXJ0X3RpbWUpIC8gZHVyYXRpb24pO1xuICAgICAgICAgICAgICAgICAgICB0aWNrKDEgLSB0LCB0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcnVubmluZztcbiAgICAgICAgfSk7XG4gICAgfVxuICAgIGlmIChpc19mdW5jdGlvbihjb25maWcpKSB7XG4gICAgICAgIHdhaXQoKS50aGVuKCgpID0+IHtcbiAgICAgICAgICAgIC8vIEB0cy1pZ25vcmVcbiAgICAgICAgICAgIGNvbmZpZyA9IGNvbmZpZygpO1xuICAgICAgICAgICAgZ28oKTtcbiAgICAgICAgfSk7XG4gICAgfVxuICAgIGVsc2Uge1xuICAgICAgICBnbygpO1xuICAgIH1cbiAgICByZXR1cm4ge1xuICAgICAgICBlbmQocmVzZXQpIHtcbiAgICAgICAgICAgIGlmIChyZXNldCAmJiBjb25maWcudGljaykge1xuICAgICAgICAgICAgICAgIGNvbmZpZy50aWNrKDEsIDApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHJ1bm5pbmcpIHtcbiAgICAgICAgICAgICAgICBpZiAoYW5pbWF0aW9uX25hbWUpXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZV9ydWxlKG5vZGUsIGFuaW1hdGlvbl9uYW1lKTtcbiAgICAgICAgICAgICAgICBydW5uaW5nID0gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xufVxuZnVuY3Rpb24gY3JlYXRlX2JpZGlyZWN0aW9uYWxfdHJhbnNpdGlvbihub2RlLCBmbiwgcGFyYW1zLCBpbnRybykge1xuICAgIGxldCBjb25maWcgPSBmbihub2RlLCBwYXJhbXMpO1xuICAgIGxldCB0ID0gaW50cm8gPyAwIDogMTtcbiAgICBsZXQgcnVubmluZ19wcm9ncmFtID0gbnVsbDtcbiAgICBsZXQgcGVuZGluZ19wcm9ncmFtID0gbnVsbDtcbiAgICBsZXQgYW5pbWF0aW9uX25hbWUgPSBudWxsO1xuICAgIGZ1bmN0aW9uIGNsZWFyX2FuaW1hdGlvbigpIHtcbiAgICAgICAgaWYgKGFuaW1hdGlvbl9uYW1lKVxuICAgICAgICAgICAgZGVsZXRlX3J1bGUobm9kZSwgYW5pbWF0aW9uX25hbWUpO1xuICAgIH1cbiAgICBmdW5jdGlvbiBpbml0KHByb2dyYW0sIGR1cmF0aW9uKSB7XG4gICAgICAgIGNvbnN0IGQgPSBwcm9ncmFtLmIgLSB0O1xuICAgICAgICBkdXJhdGlvbiAqPSBNYXRoLmFicyhkKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIGE6IHQsXG4gICAgICAgICAgICBiOiBwcm9ncmFtLmIsXG4gICAgICAgICAgICBkLFxuICAgICAgICAgICAgZHVyYXRpb24sXG4gICAgICAgICAgICBzdGFydDogcHJvZ3JhbS5zdGFydCxcbiAgICAgICAgICAgIGVuZDogcHJvZ3JhbS5zdGFydCArIGR1cmF0aW9uLFxuICAgICAgICAgICAgZ3JvdXA6IHByb2dyYW0uZ3JvdXBcbiAgICAgICAgfTtcbiAgICB9XG4gICAgZnVuY3Rpb24gZ28oYikge1xuICAgICAgICBjb25zdCB7IGRlbGF5ID0gMCwgZHVyYXRpb24gPSAzMDAsIGVhc2luZyA9IGlkZW50aXR5LCB0aWNrID0gbm9vcCwgY3NzIH0gPSBjb25maWcgfHwgbnVsbF90cmFuc2l0aW9uO1xuICAgICAgICBjb25zdCBwcm9ncmFtID0ge1xuICAgICAgICAgICAgc3RhcnQ6IG5vdygpICsgZGVsYXksXG4gICAgICAgICAgICBiXG4gICAgICAgIH07XG4gICAgICAgIGlmICghYikge1xuICAgICAgICAgICAgLy8gQHRzLWlnbm9yZSB0b2RvOiBpbXByb3ZlIHR5cGluZ3NcbiAgICAgICAgICAgIHByb2dyYW0uZ3JvdXAgPSBvdXRyb3M7XG4gICAgICAgICAgICBvdXRyb3MuciArPSAxO1xuICAgICAgICB9XG4gICAgICAgIGlmIChydW5uaW5nX3Byb2dyYW0pIHtcbiAgICAgICAgICAgIHBlbmRpbmdfcHJvZ3JhbSA9IHByb2dyYW07XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAvLyBpZiB0aGlzIGlzIGFuIGludHJvLCBhbmQgdGhlcmUncyBhIGRlbGF5LCB3ZSBuZWVkIHRvIGRvXG4gICAgICAgICAgICAvLyBhbiBpbml0aWFsIHRpY2sgYW5kL29yIGFwcGx5IENTUyBhbmltYXRpb24gaW1tZWRpYXRlbHlcbiAgICAgICAgICAgIGlmIChjc3MpIHtcbiAgICAgICAgICAgICAgICBjbGVhcl9hbmltYXRpb24oKTtcbiAgICAgICAgICAgICAgICBhbmltYXRpb25fbmFtZSA9IGNyZWF0ZV9ydWxlKG5vZGUsIHQsIGIsIGR1cmF0aW9uLCBkZWxheSwgZWFzaW5nLCBjc3MpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGIpXG4gICAgICAgICAgICAgICAgdGljaygwLCAxKTtcbiAgICAgICAgICAgIHJ1bm5pbmdfcHJvZ3JhbSA9IGluaXQocHJvZ3JhbSwgZHVyYXRpb24pO1xuICAgICAgICAgICAgYWRkX3JlbmRlcl9jYWxsYmFjaygoKSA9PiBkaXNwYXRjaChub2RlLCBiLCAnc3RhcnQnKSk7XG4gICAgICAgICAgICBsb29wKG5vdyA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKHBlbmRpbmdfcHJvZ3JhbSAmJiBub3cgPiBwZW5kaW5nX3Byb2dyYW0uc3RhcnQpIHtcbiAgICAgICAgICAgICAgICAgICAgcnVubmluZ19wcm9ncmFtID0gaW5pdChwZW5kaW5nX3Byb2dyYW0sIGR1cmF0aW9uKTtcbiAgICAgICAgICAgICAgICAgICAgcGVuZGluZ19wcm9ncmFtID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgZGlzcGF0Y2gobm9kZSwgcnVubmluZ19wcm9ncmFtLmIsICdzdGFydCcpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY3NzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhcl9hbmltYXRpb24oKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbl9uYW1lID0gY3JlYXRlX3J1bGUobm9kZSwgdCwgcnVubmluZ19wcm9ncmFtLmIsIHJ1bm5pbmdfcHJvZ3JhbS5kdXJhdGlvbiwgMCwgZWFzaW5nLCBjb25maWcuY3NzKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAocnVubmluZ19wcm9ncmFtKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChub3cgPj0gcnVubmluZ19wcm9ncmFtLmVuZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGljayh0ID0gcnVubmluZ19wcm9ncmFtLmIsIDEgLSB0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BhdGNoKG5vZGUsIHJ1bm5pbmdfcHJvZ3JhbS5iLCAnZW5kJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXBlbmRpbmdfcHJvZ3JhbSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdlJ3JlIGRvbmVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocnVubmluZ19wcm9ncmFtLmIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaW50cm8g4oCUIHdlIGNhbiB0aWR5IHVwIGltbWVkaWF0ZWx5XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyX2FuaW1hdGlvbigpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gb3V0cm8g4oCUIG5lZWRzIHRvIGJlIGNvb3JkaW5hdGVkXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghLS1ydW5uaW5nX3Byb2dyYW0uZ3JvdXAucilcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bl9hbGwocnVubmluZ19wcm9ncmFtLmdyb3VwLmMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHJ1bm5pbmdfcHJvZ3JhbSA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAobm93ID49IHJ1bm5pbmdfcHJvZ3JhbS5zdGFydCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgcCA9IG5vdyAtIHJ1bm5pbmdfcHJvZ3JhbS5zdGFydDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHQgPSBydW5uaW5nX3Byb2dyYW0uYSArIHJ1bm5pbmdfcHJvZ3JhbS5kICogZWFzaW5nKHAgLyBydW5uaW5nX3Byb2dyYW0uZHVyYXRpb24pO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGljayh0LCAxIC0gdCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuICEhKHJ1bm5pbmdfcHJvZ3JhbSB8fCBwZW5kaW5nX3Byb2dyYW0pO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIHtcbiAgICAgICAgcnVuKGIpIHtcbiAgICAgICAgICAgIGlmIChpc19mdW5jdGlvbihjb25maWcpKSB7XG4gICAgICAgICAgICAgICAgd2FpdCgpLnRoZW4oKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAvLyBAdHMtaWdub3JlXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZyA9IGNvbmZpZygpO1xuICAgICAgICAgICAgICAgICAgICBnbyhiKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGdvKGIpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBlbmQoKSB7XG4gICAgICAgICAgICBjbGVhcl9hbmltYXRpb24oKTtcbiAgICAgICAgICAgIHJ1bm5pbmdfcHJvZ3JhbSA9IHBlbmRpbmdfcHJvZ3JhbSA9IG51bGw7XG4gICAgICAgIH1cbiAgICB9O1xufVxuXG5mdW5jdGlvbiBoYW5kbGVfcHJvbWlzZShwcm9taXNlLCBpbmZvKSB7XG4gICAgY29uc3QgdG9rZW4gPSBpbmZvLnRva2VuID0ge307XG4gICAgZnVuY3Rpb24gdXBkYXRlKHR5cGUsIGluZGV4LCBrZXksIHZhbHVlKSB7XG4gICAgICAgIGlmIChpbmZvLnRva2VuICE9PSB0b2tlbilcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgaW5mby5yZXNvbHZlZCA9IGtleSAmJiB7IFtrZXldOiB2YWx1ZSB9O1xuICAgICAgICBjb25zdCBjaGlsZF9jdHggPSBhc3NpZ24oYXNzaWduKHt9LCBpbmZvLmN0eCksIGluZm8ucmVzb2x2ZWQpO1xuICAgICAgICBjb25zdCBibG9jayA9IHR5cGUgJiYgKGluZm8uY3VycmVudCA9IHR5cGUpKGNoaWxkX2N0eCk7XG4gICAgICAgIGlmIChpbmZvLmJsb2NrKSB7XG4gICAgICAgICAgICBpZiAoaW5mby5ibG9ja3MpIHtcbiAgICAgICAgICAgICAgICBpbmZvLmJsb2Nrcy5mb3JFYWNoKChibG9jaywgaSkgPT4ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoaSAhPT0gaW5kZXggJiYgYmxvY2spIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGdyb3VwX291dHJvcygpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvbl9vdXQoYmxvY2ssIDEsIDEsICgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmZvLmJsb2Nrc1tpXSA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNoZWNrX291dHJvcygpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBpbmZvLmJsb2NrLmQoMSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBibG9jay5jKCk7XG4gICAgICAgICAgICB0cmFuc2l0aW9uX2luKGJsb2NrLCAxKTtcbiAgICAgICAgICAgIGJsb2NrLm0oaW5mby5tb3VudCgpLCBpbmZvLmFuY2hvcik7XG4gICAgICAgICAgICBmbHVzaCgpO1xuICAgICAgICB9XG4gICAgICAgIGluZm8uYmxvY2sgPSBibG9jaztcbiAgICAgICAgaWYgKGluZm8uYmxvY2tzKVxuICAgICAgICAgICAgaW5mby5ibG9ja3NbaW5kZXhdID0gYmxvY2s7XG4gICAgfVxuICAgIGlmIChpc19wcm9taXNlKHByb21pc2UpKSB7XG4gICAgICAgIGNvbnN0IGN1cnJlbnRfY29tcG9uZW50ID0gZ2V0X2N1cnJlbnRfY29tcG9uZW50KCk7XG4gICAgICAgIHByb21pc2UudGhlbih2YWx1ZSA9PiB7XG4gICAgICAgICAgICBzZXRfY3VycmVudF9jb21wb25lbnQoY3VycmVudF9jb21wb25lbnQpO1xuICAgICAgICAgICAgdXBkYXRlKGluZm8udGhlbiwgMSwgaW5mby52YWx1ZSwgdmFsdWUpO1xuICAgICAgICAgICAgc2V0X2N1cnJlbnRfY29tcG9uZW50KG51bGwpO1xuICAgICAgICB9LCBlcnJvciA9PiB7XG4gICAgICAgICAgICBzZXRfY3VycmVudF9jb21wb25lbnQoY3VycmVudF9jb21wb25lbnQpO1xuICAgICAgICAgICAgdXBkYXRlKGluZm8uY2F0Y2gsIDIsIGluZm8uZXJyb3IsIGVycm9yKTtcbiAgICAgICAgICAgIHNldF9jdXJyZW50X2NvbXBvbmVudChudWxsKTtcbiAgICAgICAgfSk7XG4gICAgICAgIC8vIGlmIHdlIHByZXZpb3VzbHkgaGFkIGEgdGhlbi9jYXRjaCBibG9jaywgZGVzdHJveSBpdFxuICAgICAgICBpZiAoaW5mby5jdXJyZW50ICE9PSBpbmZvLnBlbmRpbmcpIHtcbiAgICAgICAgICAgIHVwZGF0ZShpbmZvLnBlbmRpbmcsIDApO1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cbiAgICB9XG4gICAgZWxzZSB7XG4gICAgICAgIGlmIChpbmZvLmN1cnJlbnQgIT09IGluZm8udGhlbikge1xuICAgICAgICAgICAgdXBkYXRlKGluZm8udGhlbiwgMSwgaW5mby52YWx1ZSwgcHJvbWlzZSk7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICBpbmZvLnJlc29sdmVkID0geyBbaW5mby52YWx1ZV06IHByb21pc2UgfTtcbiAgICB9XG59XG5cbmNvbnN0IGdsb2JhbHMgPSAodHlwZW9mIHdpbmRvdyAhPT0gJ3VuZGVmaW5lZCcgPyB3aW5kb3cgOiBnbG9iYWwpO1xuXG5mdW5jdGlvbiBkZXN0cm95X2Jsb2NrKGJsb2NrLCBsb29rdXApIHtcbiAgICBibG9jay5kKDEpO1xuICAgIGxvb2t1cC5kZWxldGUoYmxvY2sua2V5KTtcbn1cbmZ1bmN0aW9uIG91dHJvX2FuZF9kZXN0cm95X2Jsb2NrKGJsb2NrLCBsb29rdXApIHtcbiAgICB0cmFuc2l0aW9uX291dChibG9jaywgMSwgMSwgKCkgPT4ge1xuICAgICAgICBsb29rdX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cbiAgICAgICAgICAgIC8vIGRvIG5vdGhpbmdcbiAgICAgICAgICAgIG5leHQgPSBuZXdfYmxvY2suZmlyc3Q7XG4gICAgICAgICAgICBvLS07XG4gICAgICAgICAgICBuLS07XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoIW5ld19sb29rdXAuaGFzKG9sZF9rZXkpKSB7XG4gICAgICAgICAgICAvLyByZW1vdmUgb2xkIGJsb2NrXG4gICAgICAgICAgICBkZXN0cm95KG9sZF9ibG9jaywgbG9va3VwKTtcbiAgICAgICAgICAgIG8tLTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmICghbG9va3VwLmhhcyhuZXdfa2V5KSB8fCB3aWxsX21vdmUuaGFzKG5ld19rZXkpKSB7XG4gICAgICAgICAgICBpbnNlcnQobmV3X2Jsb2NrKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChkaWRfbW92ZS5oYXMob2xkX2tleSkpIHtcbiAgICAgICAgICAgIG8tLTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChkZWx0YXMuZ2V0KG5ld19rZXkpID4gZGVsdGFzLmdldChvbGRfa2V5KSkge1xuICAgICAgICAgICAgZGlkX21vdmUuYWRkKG5ld19rZXkpO1xuICAgICAgICAgICAgaW5zZXJ0KG5ld19ibG9jayk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB3aWxsX21vdmUuYWRkKG9sZF9rZXkpO1xuICAgICAgICAgICAgby0tO1xuICAgICAgICB9XG4gICAgfVxuICAgIHdoaWxlIChvLS0pIHtcbiAgICAgICAgY29uc3Qgb2xkX2Jsb2NrID0gb2xkX2Jsb2Nrc1tvXTtcbiAgICAgICAgaWYgKCFuZXdfbG9va3VwLmhhcyhvbGRfYmxvY2sua2V5KSlcbiAgICAgICAgICAgIGRlc3Ryb3kob2xkX2Jsb2NrLCBsb29rdXApO1xuICAgIH1cbiAgICB3aGlsZSAobilcbiAgICAgICAgaW5zZXJ0KG5ld19ibG9ja3NbbiAtIDFdKTtcbiAgICByZXR1cm4gbmV3X2Jsb2Nrcztcbn1cbmZ1bmN0aW9uIG1lYXN1cmUoYmxvY2tzKSB7XG4gICAgY29uc3QgcmVjdHMgPSB7fTtcbiAgICBsZXQgaSA9IGJsb2Nrcy5sZW5ndGg7XG4gICAgd2hpbGUgKGktLSlcbiAgICAgICAgcmVjdHNbYmxvY2tzW2ldLmtleV0gPSBibG9ja3NbaV0ubm9kZS5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKTtcbiAgICByZXR1cm4gcmVjdHM7XG59XG5cbmZ1bmN0aW9uIGdldF9zcHJlYWRfdXBkYXRlKGxldmVscywgdXBkYXRlcykge1xuICAgIGNvbnN0IHVwZGF0ZSA9IHt9O1xuICAgIGNvbnN0IHRvX251bGxfb3V0ID0ge307XG4gICAgY29uc3QgYWNjb3VudGVkX2ZvciA9IHsgJCRzY29wZTogMSB9O1xuICAgIGxldCBpID0gbGV2ZWxzLmxlbmd0aDtcbiAgICB3aGlsZSAoaS0tKSB7XG4gICAgICAgIGNvbnN0IG8gPSBsZXZlbHNbaV07XG4gICAgICAgIGNvbnN0IG4gPSB1cGRhdGVzW2ldO1xuICAgICAgICBpZiAobikge1xuICAgICAgICAgICAgZm9yIChjb25zdCBrZXkgaW4gbykge1xuICAgICAgICAgICAgICAgIGlmICghKGtleSBpbiBuKSlcbiAgICAgICAgICAgICAgICAgICAgdG9fbnVsbF9vdXRba2V5XSA9IDE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmb3IgKGNvbnN0IGtleSBpbiBuKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFhY2NvdW50ZWRfZm9yW2tleV0pIHtcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlW2tleV0gPSBuW2tleV07XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRlZF9mb3Jba2V5XSA9IDE7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAg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bmFtZXMpIHtcbiAgICBjb25zdCBwYXJlbnRfY29tcG9uZW50ID0gY3VycmVudF9jb21wb25lbnQ7XG4gICAgc2V0X2N1cnJlbnRfY29tcG9uZW50KGNvbXBvbmVudCk7XG4gICAgY29uc3QgcHJvcHMgPSBvcHRpb25zLnByb3BzIHx8IHt9O1xuICAgIGNvbnN0ICQkID0gY29tcG9uZW50LiQkID0ge1xuICAgICAgICBmcmFnbWVudDogbnVsbCxcbiAgICAgICAgY3R4OiBudWxsLFxuICAgICAgICAvLyBzdGF0ZVxuICAgICAgICBwcm9wczogcHJvcF9uYW1lcyxcbiAgICAgICAgdXBkYXRlOiBub29wLFxuICAgICAgICBub3RfZXF1YWwsXG4gICAgICAgIGJvdW5kOiBibGFua19vYmplY3QoKSxcbiAgICAgICAgLy8gbGlmZWN5Y2xlXG4gICAgICAgIG9uX21vdW50OiBbXSxcbiAgICAgICAgb25fZGVzdHJveTogW10sXG4gICAgICAgIGJlZm9yZV91cGRhdGU6IFtdLFxuICAgICAgICBhZnRlcl91cGRhdGU6IFtdLFxuICAgICAgICBjb250ZXh0OiBuZXcgTWFwKHBhcmVudF9jb21wb25lbnQgPyBwYXJlbnRfY29tcG9uZW50LiQkLmNvbnRleHQgOiBbXSksXG4gICAgICAgIC8vIGV2ZXJ5dGhpbmcgZWxzZVxuICAgICAgICBjYWxsYmFja3M6IGJsYW5rX29iamVjdCgpLFxuICAgICAgICBkaXJ0eTogbnVsbFxuICAgIH07XG4gICAgbGV0IHJlYWR5ID0gZmFsc2U7XG4gICAgJCQuY3R4ID0gaW5zdGFuY2VcbiAgICAgICAgPyBpbnN0YW5jZShjb21wb25lbnQsIHByb3BzLCAoa2V5LCByZXQsIHZhbHVlID0gcmV0KSA9PiB7XG4gICAgICAgICAgICBpZiAoJCQuY3R4ICYmIG5vdF9lcXVhbCgkJC5jdHhba2V5XSwgJCQuY3R4W2tleV0gPSB2YWx1ZSkpIHtcbiAgICAgICAgICAgICAgICBpZiAoJCQuYm91bmRba2V5XSlcbiAgICAgICAgICAgICAgICAgICAgJCQuYm91bmRba2V5XSh2YWx1ZSk7XG4gICAgICAgICAgICAgICAgaWYgKHJlYWR5KVxuICAgICAgICAgICAgICAgICAgICBtYWtlX2RpcnR5KGNvbXBvbmVudCwga2V5KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiByZXQ7XG4gICAgICAgIH0pXG4gICAgICAgIDogcHJvcHM7XG4gICAgJCQudXBkYXRlKCk7XG4gICAgcmVhZHkgPSB0cnVlO1xuICAgIHJ1bl9hbGwoJCQuYmVmb3JlX3VwZGF0ZSk7XG4gICAgJCQuZnJhZ21lbnQgPSBjcmVhdGVfZnJhZ21lbnQoJCQuY3R4KTtcbiAgICBpZiAob3B0aW9ucy50YXJnZXQpIHtcbiAgICAgICAgaWYgKG9wdGlvbnMuaHlkcmF0ZSkge1xuICAgICAgICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9uby1ub24tbnVsbC1hc3NlcnRpb25cbiAgICAgICAgICAgICQkLmZyYWdtZW50LmwoY2hpbGRyZW4ob3B0aW9ucy50YXJnZXQpKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tbm9uLW51bGwtYXNzZXJ0aW9uXG4gICAgICAgICAgICAkJC5mcmFnbWVudC5jKCk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG9wdGlvbnMuaW50cm8pXG4gICAgICAgICAgICB0cmFuc2l0aW9uX2luKGNvbXBvbmVudC4kJC5mcmFnbWVudCk7XG4gICAgICAgIG1vdW50X2NvbXBvbmVudChjb21wb25lbnQsIG9wdGlvbnMudGFyZ2V0LCBvcHRpb25zLmFuY2hvcik7XG4gICAgICAgIGZsdXNoKCk7XG4gICAgfVxuICAgIHNldF9jdXJyZW50X2N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4gICAgICAgICAgICBjb25zdCBjYWxsYmFja3MgPSAodGhpcy4kJC5jYWxsYmFja3NbdHlwZV0gfHwgKHRoaXMuJCQuY2FsbGJhY2tzW3R5cGVdID0gW10pKTtcbiAgICAgICAgICAgIGNhbGxiYWNrcy5wdXNoKGNhbGxiYWNrKTtcbiAgICAgICAgICAgIHJldHVybiAoKSA9PiB7XG4gICAgICAgICAgICAgICAgY29uc3QgaW5kZXggPSBjYWxsYmFja3MuaW5kZXhPZihjYWxsYmFjayk7XG4gICAgICAgICAgICAgICAgaWYgKGluZGV4ICE9PSAtMSlcbiAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2tzLnNwbGljZShpbmRleCwgMSk7XG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgICRzZXQoKSB7XG4gICAgICAgICAgICAvLyBvdmVycmlkZGVuIGJ5IGluc3RhbmNlLCBpZiBpdCBoYXMgcHJvcHNcbiAgICAgICAgfVxuICAgIH07XG59XG5jbGFzcyBTdmVsdGVDb21wb25lbnQge1xuICAgICRkZXN0cm95KCkge1xuICAgICAgICBkZXN0cm95X2NvbXBvbmVudCh0aGlzLCAxKTtcbiAgICAgICAgdGhpcy4kZGVzdHJveSA9IG5vb3A7XG4gICAgfVxuICAgICRvbih0eXBlLCBjYWxsYmFjaykge1xuICAgICAgICBjb25zdCBjYWxsYmFja3MgPSAodGhpcy4kJC5jYWxsYmFja3NbdHlwZV0gfHwgKHRoaXMuJCQuY2FsbGJhY2tzW3R5cGVdID0gW10pKTtcbiAgICAgICAgY2FsbGJhY2tzLnB1c2goY2FsbGJhY2spO1xuICAgICAgICByZXR1cm4gKCkgPT4ge1xuICAgICAgICAgICAgY29uc3QgaW5kZXggPSBjYWxsYmFja3MuaW5kZXhPZihjYWxsYmFjayk7XG4gICAgICAgICAgICBpZiAoaW5kZXggIT09IC0xKVxuICAgICAgICAgICAgICAgIGNhbGxiYWNrcy5zcGxpY2UoaW5kZXgsIDEpO1xuICAgICAgICB9O1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KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGluY29ycmVjdCA9IHRydWU7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICB9KVxuICAgIC50aGVuKHVzZXIgPT4ge1xuICAgICAgICBpZih1c2VyKSB7XG4gICAgICAgICAgICBsb2NhbFN0b3JhZ2Uuc2V0SXRlbShcImJ1ZGliYXNlOnVzZXJcIiwgdXNlcik7XG4gICAgICAgICAgICBsb2NhdGlvbi5yZWxvYWQoKTtcbiAgICAgICAgfVxuICAgIH0pXG59XG5cbjwvc2NyaXB0PlxuXG48ZGl2IGNsYXNzPVwicm9vdFwiPlxuXG4gICAgPGRpdiBjbGFzcz1cImNvbnRlbnRcIj5cblxuICAgICAgICB7I2lmIF9sb2dvfVxuICAgICAgICA8ZGl2IGNsYXNzPVwibG9nby1jb250YWluZXJcIj5cbiAgICAgICAgICAgIDxpbWcgc3JjPXtfbG9nb30gYWx0PVwibG9nb1wiLz5cbiAgICAgICAgPC9kaXY+XG4gICAgICAgIHsvaWZ9XG5cbiAgICAgICAgPGRpdiBjbGFzcz1cImZvcm0tcm9vdFwiPlxuICAgICAgICAgICAgPGRpdiBjbGFzcz1cImxhYmVsXCI+XG4gICAgICAgICAgICAgICAge3VzZXJuYW1lTGFiZWx9XG4gICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJjb250cm9sXCI+XG4gICAgICAgICAgICAgICAgPGlucHV0IGJpbmQ6dmFsdWU9e3VzZXJuYW1lfSB0eXBlPVwidGV4dFwiIGNsYXNzPXtfaW5wdXRDbGFzc30vPlxuICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICA8ZGl2IGNsYXNzPVwibGFiZWxcIj5cbiAgICAgICAgICAgICAgICB7cGFzc3dvcmRMYWJlbH1cbiAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgPGRpdiBjbGFzcz1cImNvbnRyb2xcIj5cbiAgICAg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NvbXBvbmVudHMpIHtcbiAgICAgICAgICAgICAgICBzdGF0aWNDb21wb25lbnRzW2NdLiRkZXN0cm95KCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBzdGF0aWNDb21wb25lbnRzID0ge307XG4gICAgICAgIH1cblxuICAgICAgICBmb3IobGV0IGVsIGluIHN0YXRpY0h0bWxFbGVtZW50cykge1xuICAgICAgICAgICAgc3RhdGljQ29tcG9uZW50c1tlbF0gPSBfYmIuaW5pdGlhbGlzZUNvbXBvbmVudChcbiAgICAgICAgICAgICAgICBjaGlsZHJlbltlbF0uY29udHJvbCxcbiAgICAgICAgICAgICAgICBzdGF0aWNIdG1sRWxlbWVudHNbZWxdXG4gICAgICAgICAgICApO1xuICAgICAgICB9XG4gICAgfVxuICAgIFxuXG4gICAgaWYoaGFzRGF0YUJvdW5kQ29tcG9uZW50cygpKSB7XG4gICAgICAgIGZvcihsZXQgYyBpbiBkYXRhQm91bmRDb21wb25lbnRzKSB7XG4gICAgICAgICAgICBkYXRhQm91bmRDb21wb25lbnRzW2NdLiRkZXN0cm95KCk7XG4gICAgICAgIH1cbiAgICAgICAgZGF0YUJvdW5kQ29tcG9uZW50cyA9IHt9O1xuICAgIH1cblxuICAgIGlmKGhhc0RhdGEoKSkge1xuICAgICAgICBsZXQgaW5kZXggPSAwO1xuICAgICAgICBmb3IobGV0IGQgaW4gZGF0YUJvdW5kRWxlbWVudHMpIHtcbiAgICAgICAgICAgIF9iYi5pbml0aWFsaXNlQ29tcG9uZW50KFxuICAgICAgICAgICAgICAgIGRhdGFJdGVtQ29tcG9uZW50LFxuICAgICAgICAgICAgICAgIGRhdGFCb3VuZEVsZW1lbnRzW2RdLFxuICAgICAgICAgICAgICAgIGRhdGFbcGFyc2VJbnQoZCldXG4gICAgICAgICAgICApO1xuICAgICAgICB9XG4gICAgfVxufVxuXG5cbjwvc2NyaXB0PlxuXG48ZGl2IGNsYXNzPVwicm9vdCB7Y29udGFpbmVyQ2xhc3N9XCJcbiA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