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' : ''); } 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; } function onMount(fn) { get_current_component().$$.on_mount.push(fn); } // 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 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.initialiseComponent(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.initialiseComponent( 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.initialiseComponent( 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 */ 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.create(ctx); child_ctx.child = list[i]; child_ctx.index = i; return child_ctx; } // (32:4) {#each children 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(div0, index); const unassign_div0 = () => ctx.div0_binding(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, 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$2(get_each_context$2(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-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.length; i += 1) { each_blocks[i].m(div, null); } }, p(changed, ctx) { if (changed.direction || changed.itemContainerClass || changed.htmlElements || changed.children) { each_value = ctx.children; 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, detaching); } }; } function instance$5($$self, $$props, $$invalidate) { let { direction = "horizontal", children = [], width = "auto", height = "auto", containerClass="", itemContainerClass="", _bb } = $$props; let htmlElements = {}; onMount(() => { if(_bb && htmlElements) { for(let el in htmlElements) { _bb.initialiseComponent( children[el].control, htmlElements[el] ); } } }); function div0_binding($$value, index) { if (htmlElements[index] === $$value) return; binding_callbacks[$$value ? 'unshift' : 'push'](() => { htmlElements[index] = $$value; $$invalidate('htmlElements', htmlElements); }); } $$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 ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb); }; return { direction, children, width, height, containerClass, itemContainerClass, _bb, htmlElements, div0_binding }; } 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", "_bb"]); } } export { Button as button, Form as form, Grid as grid, Login as login, StackPanel as stackpanel, Textbox as textbox }; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzIjpbIi4uL25vZGVfbW9kdWxlcy9zdmVsdGUvaW50ZXJuYWwvaW5kZXgubWpzIiwiLi4vc3JjL0J1dHRvbi5zdmVsdGUiLCIuLi9zcmMvVGV4dGJveC5zdmVsdGUiLCIuLi9zcmMvRm9ybS5zdmVsdGUiLCIuLi9zcmMvTG9naW4uc3ZlbHRlIiwiLi4vc3JjL2J1aWxkU3R5bGUuanMiLCIuLi9zcmMvR3JpZC5zdmVsdGUiLCIuLi9zcmMvU3RhY2tQYW5lbC5zd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7XG59XG5mdW5jdGlvbiBkaXNwYXRjaChub2RlLCBkaXJlY3Rpb24sIGtpbmQpIHtcbiAgICBub2RlLmRpc3BhdGNoRXZlbnQoY3VzdG9tX2V2ZW50KGAke2RpcmVjdGlvbiA/ICdpbnRybycgOiAnb3V0cm8nfSR7a2luZH1gKSk7XG59XG5jb25zdCBvdXRyb2luZyA9IG5ldyBTZXQoKTtcbmxldCBvdXRyb3M7XG5mdW5jdGlvbiBncm91cF9vdXRyb3MoKSB7XG4gICAgb3V0cm9zID0ge1xuICAgICAgICByOiAwLFxuICAgICAgICBjOiBbXSxcbiAgICAgICAgcDogb3V0cm9zIC8vIHBhcmVudCBncm91cFxuICAgIH07XG59XG5mdW5jdGlvbiBjaGVja19vdXRyb3MoKSB7XG4gICAgaWYgKCFvdXRyb3Mucikge1xuICAgICAgICBydW5fYWxsKG91dHJvcy5jKTtcbiAgICB9XG4gICAgb3V0cm9zID0gb3V0cm9zLnA7XG59XG5mdW5jdGlvbiB0cmFuc2l0aW9uX2luKGJsb2NrLCBsb2NhbCkge1xuICAgIGlmIChibG9jayAmJiBibG9jay5pKSB7XG4gICAgICAgIG91dHJvaW5nLmRlbGV0ZShibG9jayk7XG4gICAgICAgIGJsb2NrLmkobG9jYWwpO1xuICAgIH1cbn1cbmZ1bmN0aW9uIHRyYW5zaXRpb25fb3V0KGJsb2NrLCBsb2NhbCwgZGV0YWNoLCBjYWxsYmFjaykge1xuICAgIGlmIChibG9jayAmJiBibG9jay5vKSB7XG4gICAgICAgIGlmIChvdXRyb2luZy5oYXMoYmxvY2spKVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICBvdXRyb2luZy5hZGQoYmxvY2spO1xuICAgICAgICBvdXRyb3MuYy5wdXNoKCgpID0+IHtcbiAgICAgICAgICAgIG91dHJvaW5nLmRlbGV0ZShibG9jayk7XG4gICAgICAgICAgICBpZiAoY2FsbGJhY2spIHtcbiAgICAgICAgICAgICAgICBpZiAoZGV0YWNoKVxuICAgICA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1xuICAgICAgICBydW5uaW5nID0gdHJ1ZTtcbiAgICAgICAgYWRkX3JlbmRlcl9jYWxsYmFjaygoKSA9PiBkaXNwYXRjaChub2RlLCB0cnVlLCAnc3RhcnQnKSk7XG4gICAgICAgIHRhc2sgPSBsb29wKG5vdyA9PiB7XG4gICAgICAgICAgICBpZiAocnVubmluZykge1xuICAgICAgICAgICAgICAgIGlmIChub3cgPj0gZW5kX3RpbWUpIHtcbiAgICAgICAgICAgICAgICAgICAgdGljaygxLCAwKTtcbiAgICAgICAgICAgICAgICAgICAgZGlzcGF0Y2gobm9kZSwgdHJ1ZSwgJ2VuZCcpO1xuICAgICAgICAgICAgICAgICAgICBjbGVhbnVwKCk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBydW5uaW5nID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChub3cgPj0gc3RhcnRfdGltZSkge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCB0ID0gZWFzaW5nKChub3cgLSBzdGFydF90aW1lKSAvIGR1cmF0aW9uKTtcbiAgICAgICAgICAgICAgICAgICAgdGljayh0LCAxIC0gdCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHJ1bm5pbmc7XG4gICAgICAgIH0pO1xuICAgIH1cbiAgICBsZXQgc3RhcnRlZCA9IGZhbHNlO1xuICAgIHJldHVybiB7XG4gICAgICAgIHN0YXJ0KCkge1xuICAgICAgICAgICAgaWYgKHN0YXJ0ZWQpXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgZGVsZXRlX3J1bGUobm9kZSk7XG4gICAgICAgICAgICBpZiAoaXNfZnVuY3Rpb24oY29uZmlnKSkge1xuICAgICAgICAgICAgICAgIGNvbmZpZyA9IGNvbmZpZygpO1xuICAgICAgICAgICAgICAgIHdhaXQoKS50aGVuKGdvKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGdvKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGludmFsaWRhdGUoKSB7XG4gICAgICAgICAgICBzdGFydGVkID0gZmFsc2U7XG4gICAgICAgIH0sXG4gICAgICAgIGVuZCgpIHtcbiAgICAgICAgICAgIGlmIChydW5uaW5nKSB7XG4gICAgICAgICAgICAgICAgY2xlYW51cCgpO1xuICAgICAgICAgICAgICAgIHJ1bm5pbmcgPSBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH07XG59XG5mdW5jdGlvbiBjcmVhdGVfb3V0X3RyYW5zaXRpb24obm9kZSwgZm4sIHBhcmFtcykge1xuICAgIGxldCBjb25maWcgPSBmbihub2RlLCBwYXJhbXMpO1xuICAgIGxldCBydW5uaW5nID0gdHJ1ZTtcbiAgICBsZXQgYW5pbWF0aW9uX25hbWU7XG4gICAgY29uc3QgZ3JvdXAgPSBvdXRyb3M7XG4gICAgZ3JvdXAuciArPSAxO1xuICAgIGZ1bmN0aW9uIGdvKCkge1xuICAgICAgICBjb25zdCB7IGRlbGF5ID0gMCwgZHVyYXRpb24gPSAzMDAsIGVhc2luZyA9IGlkZW50aXR5LCB0aWNrID0gbm9vcCwgY3NzIH0gPSBjb25maWcgfHwgbnVsbF90cmFuc2l0aW9uO1xuICAgICAgICBpZiAoY3NzKVxuICAgICAgICAgICAgYW5pbWF0aW9uX25hbWUgPSBjcmVhdGVfcnVsZShub2RlLCAxLCAwLCBkdXJhdGlvbiwgZGVsYXksIGVhc2luZywgY3NzKTtcbiAgICAgICAgY29uc3Qgc3RhcnRfdGltZSA9IG5vdygpICsgZGVsYXk7XG4gICAgICAgIGNvbnN0IGVuZF90aW1lID0gc3RhcnRfdGltZSArIGR1cmF0aW9uO1xuICAgICAgICBhZGRfcmVuZGVyX2NhbGxiYWNrKCgpID0+IGRpc3BhdGNoKG5vZGUsIGZhbHNlLCAnc3RhcnQnKSk7XG4gICAgICAgIGxvb3Aobm93ID0+IHtcbiAgICAgICAgICAgIGlmIChydW5uaW5nKSB7XG4gICAgICAgICAgICAgICAgaWYgKG5vdyA+PSBlbmRfdGltZSkge1xuICAgICAgICAgICAgICAgICAgICB0aWNrKDAsIDEpO1xuICAgICAgICAgICAgICAgICAgICBkaXNwYXRjaChub2RlLCBmYWxzZSwgJ2VuZCcpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIS0tZ3JvdXAucikge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gdGhpcyB3aWxsIHJlc3VsdCBpbiBgZW5kKClgIGJlaW5nIGNhbGxlZCxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNvIHdlIGRvbid0IG5lZWQgdG8gY2xlYW4gdXAgaGVyZVxuICAgICAgICAgICAgICAgICAgICAgICAgcnVuX2FsbChncm91cC5jKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChub3cgPj0gc3RhcnRfdGltZSkge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCB0ID0gZWFzaW5nKChub3cgLSBzdGFydF90aW1lKSAvIGR1cmF0aW9uKTtcbiAgICAgICAgICAgICAgICAgICAgdGljaygxIC0gdCwgdCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHJ1bm5pbmc7XG4gICAgICAgIH0pO1xuICAgIH1cbiAgICBpZiAoaXNfZnVuY3Rpb24oY29uZmlnKSkge1xuICAgICAgICB3YWl0KCkudGhlbigoKSA9PiB7XG4gICAgICAgICAgICAvLyBAdHMtaWdub3JlXG4gICAgICAgICAgICBjb25maWcgPSBjb25maWcoKTtcbiAgICAgICAgICAgIGdvKCk7XG4gICAgICAgIH0pO1xuICAgIH1cbiAgICBlbHNlIHtcbiAgICAgICAgZ28oKTtcbiAgICB9XG4gICAgcmV0dXJuIHtcbiAgICAgICAgZW5kKHJlc2V0KSB7XG4gICAgICAgICAgICBpZiAocmVzZXQgJiYgY29uZmlnLnRpY2spIHtcbiAgICAgICAgICAgICAgICBjb25maWcudGljaygxLCAwKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChydW5uaW5nKSB7XG4gICAgICAgICAgICAgICAgaWYgKGFuaW1hdGlvbl9uYW1lKVxuICAgICAgICAgICAgICAgICAgICBkZWxldGVfcnVsZShub2RlLCBhbmltYXRpb25fbmFtZSk7XG4gICAgICAgICAgICAgICAgcnVubmluZyA9IGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfTtcbn1cbmZ1bmN0aW9uIGNyZWF0ZV9iaWRpcmVjdGlvbmFsX3RyYW5zaXRpb24obm9kZSwgZm4sIHBhcmFtcywgaW50cm8pIHtcbiAgICBsZXQgY29uZmlnID0gZm4obm9kZSwgcGFyYW1zKTtcbiAgICBsZXQgdCA9IGludHJvID8gMCA6IDE7XG4gICAgbGV0IHJ1bm5pbmdfcHJvZ3JhbSA9IG51bGw7XG4gICAgbGV0IHBlbmRpbmdfcHJvZ3JhbSA9IG51bGw7XG4gICAgbGV0IGFuaW1hdGlvbl9uYW1lID0gbnVsbDtcbiAgICBmdW5jdGlvbiBjbGVhcl9hbmltYXRpb24oKSB7XG4gICAgICAgIGlmIChhbmltYXRpb25fbmFtZSlcbiAgICAgICAgICAgIGRlbGV0ZV9ydWxlKG5vZGUsIGFuaW1hdGlvbl9uYW1lKTtcbiAgICB9XG4gICAgZnVuY3Rpb24gaW5pdChwcm9ncmFtLCBkdXJhdGlvbikge1xuICAgICAgICBjb25zdCBkID0gcHJvZ3JhbS5iIC0gdDtcbiAgICAgICAgZHVyYXRpb24gKj0gTWF0aC5hYnMoZCk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBhOiB0LFxuICAgICAgICAgICAgYjogcHJvZ3JhbS5iLFxuICAgICAgICAgICAgZCxcbiAgICAgICAgICAgIGR1cmF0aW9uLFxuICAgICAgICAgICAgc3RhcnQ6IHByb2dyYW0uc3RhcnQsXG4gICAgICAgICAgICBlbmQ6IHByb2dyYW0uc3RhcnQgKyBkdXJhdGlvbixcbiAgICAgICAgICAgIGdyb3VwOiBwcm9ncmFtLmdyb3VwXG4gICAgICAgIH07XG4gICAgfVxuICAgIGZ1bmN0aW9uIGdvKGIpIHtcbiAgICAgICAgY29uc3QgeyBkZWxheSA9IDAsIGR1cmF0aW9uID0gMzAwLCBlYXNpbmcgPSBpZGVudGl0eSwgdGljayA9IG5vb3AsIGNzcyB9ID0gY29uZmlnIHx8IG51bGxfdHJhbnNpdGlvbjtcbiAgICAgICAgY29uc3QgcHJvZ3JhbSA9IHtcbiAgICAgICAgICAgIHN0YXJ0OiBub3coKSArIGRlbGF5LFxuICAgICAgICAgICAgYlxuICAgICAgICB9O1xuICAgICAgICBpZiAoIWIpIHtcbiAgICAgICAgICAgIC8vIEB0cy1pZ25vcmUgdG9kbzogaW1wcm92ZSB0eXBpbmdzXG4gICAgICAgICAgICBwcm9ncmFtLmdyb3VwID0gb3V0cm9zO1xuICAgICAgICAgICAgb3V0cm9zLnIgKz0gMTtcbiAgICAgICAgfVxuICAgICAgICBpZiAocnVubmluZ19wcm9ncmFtKSB7XG4gICAgICAgICAgICBwZW5kaW5nX3Byb2dyYW0gPSBwcm9ncmFtO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgLy8gaWYgdGhpcyBpcyBhbiBpbnRybywgYW5kIHRoZXJlJ3MgYSBkZWxheSwgd2UgbmVlZCB0byBkb1xuICAgICAgICAgICAgLy8gYW4gaW5pdGlhbCB0aWNrIGFuZC9vciBhcHBseSBDU1MgYW5pbWF0aW9uIGltbWVkaWF0ZWx5XG4gICAgICAgICAgICBpZiAoY3NzKSB7XG4gICAgICAgICAgICAgICAgY2xlYXJfYW5pbWF0aW9uKCk7XG4gICAgICAgICAgICAgICAgYW5pbWF0aW9uX25hbWUgPSBjcmVhdGVfcnVsZShub2RlLCB0LCBiLCBkdXJhdGlvbiwgZGVsYXksIGVhc2luZywgY3NzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChiKVxuICAgICAgICAgICAgICAgIHRpY2soMCwgMSk7XG4gICAgICAgICAgICBydW5uaW5nX3Byb2dyYW0gPSBpbml0KHByb2dyYW0sIGR1cmF0aW9uKTtcbiAgICAgICAgICAgIGFkZF9yZW5kZXJfY2FsbGJhY2soKCkgPT4gZGlzcGF0Y2gobm9kZSwgYiwgJ3N0YXJ0JykpO1xuICAgICAgICAgICAgbG9vcChub3cgPT4ge1xuICAgICAgICAgICAgICAgIGlmIChwZW5kaW5nX3Byb2dyYW0gJiYgbm93ID4gcGVuZGluZ19wcm9ncmFtLnN0YXJ0KSB7XG4gICAgICAgICAgICAgICAgICAgIHJ1bm5pbmdfcHJvZ3JhbSA9IGluaXQocGVuZGluZ19wcm9ncmFtLCBkdXJhdGlvbik7XG4gICAgICAgICAgICAgICAgICAgIHBlbmRpbmdfcHJvZ3JhbSA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIGRpc3BhdGNoKG5vZGUsIHJ1bm5pbmdfcHJvZ3JhbS5iLCAnc3RhcnQnKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNzcykge1xuICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJfYW5pbWF0aW9uKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb25fbmFtZSA9IGNyZWF0ZV9ydWxlKG5vZGUsIHQsIHJ1bm5pbmdfcHJvZ3JhbS5iLCBydW5uaW5nX3Byb2dyYW0uZHVyYXRpb24sIDAsIGVhc2luZywgY29uZmlnLmNzcyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHJ1bm5pbmdfcHJvZ3JhbSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAobm93ID49IHJ1bm5pbmdfcHJvZ3JhbS5lbmQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpY2sodCA9IHJ1bm5pbmdfcHJvZ3JhbS5iLCAxIC0gdCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBkaXNwYXRjaChub2RlLCBydW5uaW5nX3Byb2dyYW0uYiwgJ2VuZCcpO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFwZW5kaW5nX3Byb2dyYW0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB3ZSdyZSBkb25lXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJ1bm5pbmdfcHJvZ3JhbS5iKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGludHJvIOKAlCB3ZSBjYW4gdGlkeSB1cCBpbW1lZGlhdGVseVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhcl9hbmltYXRpb24oKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG91dHJvIOKAlCBuZWVkcyB0byBiZSBjb29yZGluYXRlZFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIS0tcnVubmluZ19wcm9ncmFtLmdyb3VwLnIpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBydW5fYWxsKHJ1bm5pbmdfcHJvZ3JhbS5ncm91cC5jKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBydW5uaW5nX3Byb2dyYW0gPSBudWxsO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKG5vdyA+PSBydW5uaW5nX3Byb2dyYW0uc3RhcnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHAgPSBub3cgLSBydW5uaW5nX3Byb2dyYW0uc3RhcnQ7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ID0gcnVubmluZ19wcm9ncmFtLmEgKyBydW5uaW5nX3Byb2dyYW0uZCAqIGVhc2luZyhwIC8gcnVubmluZ19wcm9ncmFtLmR1cmF0aW9uKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpY2sodCwgMSAtIHQpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiAhIShydW5uaW5nX3Byb2dyYW0gfHwgcGVuZGluZ19wcm9ncmFtKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgfVxuICAgIHJldHVybiB7XG4gICAgICAgIHJ1bihiKSB7XG4gICAgICAgICAgICBpZiAoaXNfZnVuY3Rpb24oY29uZmlnKSkge1xuICAgICAgICAgICAgICAgIHdhaXQoKS50aGVuKCgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgLy8gQHRzLWlnbm9yZVxuICAgICAgICAgICAgICAgICAgICBjb25maWcgPSBjb25maWcoKTtcbiAgICAgICAgICAgICAgICAgICAgZ28oYik7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBnbyhiKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgZW5kKCkge1xuICAgICAgICAgICAgY2xlYXJfYW5pbWF0aW9uKCk7XG4gICAgICAgICAgICBydW5uaW5nX3Byb2dyYW0gPSBwZW5kaW5nX3Byb2dyYW0gPSBudWxsO1xuICAgICAgICB9XG4gICAgfTtcbn1cblxuZnVuY3Rpb24gaGFuZGxlX3Byb21pc2UocHJvbWlzZSwgaW5mbykge1xuICAgIGNvbnN0IHRva2VuID0gaW5mby50b2tlbiA9IHt9O1xuICAgIGZ1bmN0aW9uIHVwZGF0ZSh0eXBlLCBpbmRleCwga2V5LCB2YWx1ZSkge1xuICAgICAgICBpZiAoaW5mby50b2tlbiAhPT0gdG9rZW4pXG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIGluZm8ucmVzb2x2ZWQgPSBrZXkgJiYgeyBba2V5XTogdmFsdWUgfTtcbiAgICAgICAgY29uc3QgY2hpbGRfY3R4ID0gYXNzaWduKGFzc2lnbih7fSwgaW5mby5jdHgpLCBpbmZvLnJlc29sdmVkKTtcbiAgICAgICAgY29uc3QgYmxvY2sgPSB0eXBlICYmIChpbmZvLmN1cnJlbnQgPSB0eXBlKShjaGlsZF9jdHgpO1xuICAgICAgICBpZiAoaW5mby5ibG9jaykge1xuICAgICAgICAgICAgaWYgKGluZm8uYmxvY2tzKSB7XG4gICAgICAgICAgICAgICAgaW5mby5ibG9ja3MuZm9yRWFjaCgoYmxvY2ssIGkpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGkgIT09IGluZGV4ICYmIGJsb2NrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBncm91cF9vdXRyb3MoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25fb3V0KGJsb2NrLCAxLCAxLCAoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5mby5ibG9ja3NbaV0gPSBudWxsO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBjaGVja19vdXRyb3MoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgaW5mby5ibG9jay5kKDEpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYmxvY2suYygpO1xuICAgICAgICAgICAgdHJhbnNpdGlvbl9pbihibG9jaywgMSk7XG4gICAgICAgICAgICBibG9jay5tKGluZm8ubW91bnQoKSwgaW5mby5hbmNob3IpO1xuICAgICAgICAgICAgZmx1c2goKTtcbiAgICAgICAgfVxuICAgICAgICBpbmZvLmJsb2NrID0gYmxvY2s7XG4gICAgICAgIGlmIChpbmZvLmJsb2NrcylcbiAgICAgICAgICAgIGluZm8uYmxvY2tzW2luZGV4XSA9IGJsb2NrO1xuICAgIH1cbiAgICBpZiAoaXNfcHJvbWlzZShwcm9taXNlKSkge1xuICAgICAgICBjb25zdCBjdXJyZW50X2NvbXBvbmVudCA9IGdldF9jdXJyZW50X2NvbXBvbmVudCgpO1xuICAgICAgICBwcm9taXNlLnRoZW4odmFsdWUgPT4ge1xuICAgICAgICAgICAgc2V0X2N1cnJlbnRfY29tcG9uZW50KGN1cnJlbnRfY29tcG9uZW50KTtcbiAgICAgICAgICAgIHVwZGF0ZShpbmZvLnRoZW4sIDEsIGluZm8udmFsdWUsIHZhbHVlKTtcbiAgICAgICAgICAgIHNldF9jdXJyZW50X2NvbXBvbmVudChudWxsKTtcbiAgICAgICAgfSwgZXJyb3IgPT4ge1xuICAgICAgICAgICAgc2V0X2N1cnJlbnRfY29tcG9uZW50KGN1cnJlbnRfY29tcG9uZW50KTtcbiAgICAgICAgICAgIHVwZGF0ZShpbmZvLmNhdGNoLCAyLCBpbmZvLmVycm9yLCBlcnJvcik7XG4gICAgICAgICAgICBzZXRfY3VycmVudF9jb21wb25lbnQobnVsbCk7XG4gICAgICAgIH0pO1xuICAgICAgICAvLyBpZiB3ZSBwcmV2aW91c2x5IGhhZCBhIHRoZW4vY2F0Y2ggYmxvY2ssIGRlc3Ryb3kgaXRcbiAgICAgICAgaWYgKGluZm8uY3VycmVudCAhPT0gaW5mby5wZW5kaW5nKSB7XG4gICAgICAgICAgICB1cGRhdGUoaW5mby5wZW5kaW5nLCAwKTtcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9XG4gICAgfVxuICAgIGVsc2Uge1xuICAg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ICQkc2NvcGU6IDEgfTtcbiAgICBsZXQgaSA9IGxldmVscy5sZW5ndGg7XG4gICAgd2hpbGUgKGktLSkge1xuICAgICAgICBjb25zdCBvID0gbGV2ZWxzW2ldO1xuICAgICAgICBjb25zdCBuID0gdXBkYXRlc1tpXTtcbiAgICAgICAgaWYgKG4pIHtcbiAgICAgICAgICAgIGZvciAoY29uc3Qga2V5IGluIG8pIHtcbiAgICAgICAgICAgICAgICBpZiAoIShrZXkgaW4gbikpXG4gICAgICAgICAgICAgICAgICAgIHRvX251bGxfb3V0W2tleV0gPSAxO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZm9yIChjb25zdCBrZXkgaW4gbikge1xuICAgICAgICAgICAgICAgIGlmICghYWNjb3VudGVkX2ZvcltrZXldKSB7XG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZVtrZXldID0gbltrZXldO1xuICAgICAgICAgICAgICAgICAgICBhY2NvdW50ZWRfZm9yW2tleV0gPSAxO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldmVsc1tpXSA9IG47XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBmb3IgKGNvbnN0IGtleSBpbiBvKSB7XG4gICAgICAgICAgICAgICAgYWNjb3VudGVkX2ZvcltrZXldID0gMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbiAgICBmb3IgKGNvbnN0IGtleSBpbiB0b19udWxsX291dCkge1xuICAgICAgICBpZiAoIShrZXkgaW4gdXBkYXRlKSlcbiAgICAgICAgICAgIHVwZGF0ZVtrZXldID0gdW5kZWZpbmVkO1xuICAgIH1cbiAgICByZXR1cm4gdXBkYXRlO1xufVxuZnVuY3Rpb24gZ2V0X3NwcmVhZF9vYmplY3Qoc3ByZWFkX3Byb3BzKSB7XG4gICAgcmV0dXJuIHR5cGVvZiBzcHJlYWRfcHJvcHMgPT09ICdvYmplY3QnICYmIHNwcmVh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cm95LFxuICAgICAgICAgICAgY29udGV4dDogbmV3IE1hcChwYXJlbnRfY29tcG9uZW50ID8gcGFyZW50X2NvbXBvbmVudC4kJC5jb250ZXh0IDogW10pLFxuICAgICAgICAgICAgLy8gdGhlc2Ugd2lsbCBiZSBpbW1lZGlhdGVseSBkaXNjYXJkZWRcbiAgICAgICAgICAgIG9uX21vdW50OiBbXSxcbiAgICAgICAgICAgIGJlZm9yZV91cGRhdGU6IFtdLFxuICAgICAgICAgICAgYWZ0ZXJfdXBkYXRlOiBbXSxcbiAgICAgICAgICAgIGNhbGxiYWNrczogYmxhbmtfb2JqZWN0KClcbiAgICAgICAgfTtcbiAgICAgICAgc2V0X2N1cnJlbnRfY29tcG9uZW50KHsgJCQgfSk7XG4gICAgICAgIGNvbnN0IGh0bWwgPSBmbihyZXN1bHQsIHByb3BzLCBiaW5kaW5ncywgc2xvdHMpO1xuICAgICAgICBzZXRfY3VycmVudF9jb21wb25lbnQocGFyZW50X2NvbXBvbmVudCk7XG4gICAgICAgIHJldHVybiBodG1sO1xuICAgIH1cbiAgICByZXR1cm4ge1xuICAgICAgICByZW5kZXI6IChwcm9wcyA9IHt9LCBvcHRpb25zID0ge30pID0+IHtcbiAgICAgICAgICAgIG9uX2Rlc3Ryb3kgPSBbXTtcbiAgICAgICAgICAgIGNvbnN0IHJlc3VsdCA9IHsgaGVhZDogJycsIGNzczogbmV3IFNldCgpIH07XG4gICAgICAgICAgICBjb25zdCBodG1sID0gJCRyZW5kZXIocmVzdWx0LCBwcm9wcywge30sIG9wdGlvbnMpO1xuICAgICAgICAgICAgcnVuX2FsbChvbl9kZXN0cm95KTtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgaHRtbCxcbiAgICAgICAgICAgICAgICBjc3M6IHtcbiAgICAgICAgICAgICAgICAgICAgY29kZTogQXJyYXkuZnJvbShyZXN1bHQuY3NzKS5tYXAoY3NzID0+IGNzcy5jb2RlKS5qb2luKCdcXG4nKSxcbiAg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vcmVfdXBkYXRlOiBbXSxcbiAgICAgICAgYWZ0ZXJfdXBkYXRlOiBbXSxcbiAgICAgICAgY29udGV4dDogbmV3IE1hcChwYXJlbnRfY29tcG9uZW50ID8gcGFyZW50X2NvbXBvbmVudC4kJC5jb250ZXh0IDogW10pLFxuICAgICAgICAvLyBldmVyeXRoaW5nIGVsc2VcbiAgICAgICAgY2FsbGJhY2tzOiBibGFua19vYmplY3QoKSxcbiAgICAgICAgZGlydHk6IG51bGxcbiAgICB9O1xuICAgIGxldCByZWFkeSA9IGZhbHNlO1xuICAgICQkLmN0eCA9IGluc3RhbmNlXG4gICAgICAgID8gaW5zdGFuY2UoY29tcG9uZW50LCBwcm9wcywgKGtleSwgcmV0LCB2YWx1ZSA9IHJldCkgPT4ge1xuICAgICAgICAgICAgaWYgKCQkLmN0eCAmJiBub3RfZXF1YWwoJCQuY3R4W2tleV0sICQkLmN0eFtrZXldID0gdmFsdWUpKSB7XG4gICAgICAgICAgICAgICAgaWYgKCQkLmJvdW5kW2tleV0pXG4gICAgICAgICAgICAgICAgICAgICQkLmJvdW5kW2tleV0odmFsdWUpO1xuICAgICAgICAgICAgICAgIGlmIChyZWFkeSlcbiAgICAgICAgICAgICAgICAgICAgbWFrZV9kaXJ0eShjb21wb25lbnQsIGtleSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcmV0O1xuICAgICAgICB9KVxuICAgICAgICA6IHByb3BzO1xuICAgICQkLnVwZGF0ZSgpO1xuICAgIHJlYWR5ID0gdHJ1ZTtcbiAgICBydW5fYWxsKCQkLmJlZm9yZV91cGRhdGUpO1xuICAgICQkLmZyYWdtZW50ID0gY3JlYXRlX2ZyYWdtZW50KCQkLmN0eCk7XG4gICAgaWYgKG9wdGlvbnMudGFyZ2V0KSB7XG4gICAgICAgIGlmIChvcHRpb25zLmh5ZHJhdGUpIHtcbiAgICAgICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlw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86IGltcHJvdmUgdHlwaW5nc1xuICAgICAgICAgICAgICAgIHRoaXMuYXBwZW5kQ2hpbGQodGhpcy4kJC5zbG90dGVkW2tleV0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGF0dHJpYnV0ZUNoYW5nZWRDYWxsYmFjayhhdHRyLCBfb2xkVmFsdWUsIG5ld1ZhbHVlKSB7XG4gICAgICAgICAgICB0aGlzW2F0dHJdID0gbmV3VmFsdWU7XG4gICAgICAgIH1cbiAgICAgICAgJGRlc3Ryb3koKSB7XG4gICAgICAgICAgICBkZXN0cm95X2NvbXBvbmVudCh0aGlzLCAxKTtcbiAgICAgICAgICAgIHRoaXMuJGRlc3Ryb3kgPSBub29wO1xuICAgICAgICB9XG4gICAgICAgICRvbih0eXBlLCBjYWxsYmFjaykge1xuICAgICAgICAgICAgLy8gVE9ETyBzaG91bGQgdGhpcyBkZWxlZ2F0ZSB0byBhZGRFdmVudExpc3RlbmVyP1xuICAgICAgICAgICAgY29uc3QgY2FsbGJhY2tzID0gKHRoaXMuJCQuY2FsbGJhY2tzW3R5cGVdIHx8ICh0aGlzLiQkLmNhbGxiYWNrc1t0eXBlXSA9IFtdKSk7XG4gICAgICAgICAgICBjYWxsYmFja3MucHVzaChjYWxsYmFjayk7XG4gICAgICAgICAgICByZXR1cm4gKCkgPT4ge1xuICAgICAgICAgICAgICAgIGNvbnN0IGluZGV4ID0gY2FsbGJhY2tzLmluZGV4T2YoY2FsbGJhY2spO1xuICAgICAgICAgICAgICAgIGlmIChpbmRleCAhPT0gLTEpXG4gICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrcy5zcGxpY2UoaW5kZXgsIDEpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICAkc2V0KCkge1xuICAgICAgICAgICAgLy8gb3ZlcnJpZGRlbiBieSBpbnN0YW5jZSwgaWYgaXQgaGFzIHByb3BzXG4gICAgICAgIH1cbiAgICB9O1xufVxuY2xhc3MgU3Z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ImxvZ28tY29udGFpbmVyXCI+XG4gICAgICAgICAgICA8aW1nIHNyYz17X2xvZ299IGFsdD1cImxvZ29cIi8+XG4gICAgICAgIDwvZGl2PlxuICAgICAgICB7L2lmfVxuXG4gICAgICAgIDxkaXYgY2xhc3M9XCJmb3JtLXJvb3RcIj5cbiAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJsYWJlbFwiPlxuICAgICAgICAgICAgICAgIHt1c2VybmFtZUxhYmVsfVxuICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICA8ZGl2IGNsYXNzPVwiY29udHJvbFwiPlxuICAgICAgICAgICAgICAgIDxpbnB1dCBiaW5kOnZhbHVlPXt1c2VybmFtZX0gdHlwZT1cInRleHRcIiBjbGFzcz17X2lucHV0Q2xhc3N9Lz5cbiAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgPGRpdiBjbGFzcz1cImxhYmVsXCI+XG4gICAgICAgICAgICAgICAge3Bhc3N3b3JkTGFiZWx9XG4gICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJjb250cm9sXCI+XG4gICAgICAgICAgICAgICAgPGlucHV0IGJpbmQ6dmFsdWU9e3Bhc3N3b3JkfSB0eXBlPVwicGFzc3dvcmRcIiBjbGFzcz17X2lucHV0Q2xhc3N9Lz5cbiAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICA8L2Rpdj5cblxuICAgICAgICA8ZGl2IGNsYXNzPVwibG9naW4tYnV0dG9uLWNvbnRhaW5lclwiPlxuICAgICAgICAgICAgPGJ1dHRvbiBkaXNhYmxlZD17YnVzeX0gXG4gICAgICAgICAgICAgICAgICAgIG9uOmNsaWNrPXtsb2dpbn1cbiAgICAgICAgICAgICAgICAgICAgY2xhc3M9e19idXR0b25DbGFzc30+XG4gICAgICAgICAgICAgICAgICAgIHtsb2dpbkJ1dHRvbkxhYmVsfVxuICAgICAgICAgICAgPC9idXR0b24+XG4gICAgICAgIDwvZGl2P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