emit classes

pull/1359/head
Rich Harris 8 years ago
parent c84bd85167
commit 45b43e4828

@ -2,7 +2,7 @@ import MagicString from 'magic-string';
import isReference from 'is-reference'; import isReference from 'is-reference';
import { parseExpressionAt } from 'acorn'; import { parseExpressionAt } from 'acorn';
import annotateWithScopes from '../../utils/annotateWithScopes'; import annotateWithScopes from '../../utils/annotateWithScopes';
import { walk } from 'estree-walker'; import { walk, childKeys } from 'estree-walker';
import deindent from '../../utils/deindent'; import deindent from '../../utils/deindent';
import { stringify, escape } from '../../utils/stringify'; import { stringify, escape } from '../../utils/stringify';
import CodeBuilder from '../../utils/CodeBuilder'; import CodeBuilder from '../../utils/CodeBuilder';
@ -136,7 +136,7 @@ export default function dom(
let prototypeBase = `${name}.prototype`; let prototypeBase = `${name}.prototype`;
const proto = sharedPath const proto = sharedPath
? `@proto` ? `@Component.prototype`
: deindent` : deindent`
{ {
${['destroy', 'get', 'fire', 'on', 'set', '_set', '_mount', '_unmount', '_differs'] ${['destroy', 'get', 'fire', 'on', 'set', '_set', '_mount', '_unmount', '_differs']
@ -174,7 +174,6 @@ export default function dom(
${options.dev && `this._debugName = '${debugName}';`} ${options.dev && `this._debugName = '${debugName}';`}
${options.dev && !generator.customElement && ${options.dev && !generator.customElement &&
`if (!options || (!options.target && !options.root)) throw new Error("'target' is a required option");`} `if (!options || (!options.target && !options.root)) throw new Error("'target' is a required option");`}
@init(this, options);
${templateProperties.store && `this.store = %store();`} ${templateProperties.store && `this.store = %store();`}
${generator.usesRefs && `this.refs = {};`} ${generator.usesRefs && `this.refs = {};`}
this._state = ${initialState.reduce((state, piece) => `@assign(${state}, ${piece})`)}; this._state = ${initialState.reduce((state, piece) => `@assign(${state}, ${piece})`)};
@ -332,13 +331,16 @@ export default function dom(
}); });
`); `);
} else { } else {
// TODO put methods in class body
builder.addBlock(deindent` builder.addBlock(deindent`
function ${name}(options) { class ${name} extends @Component {
${constructorBody} constructor(options) {
super(options);
${constructorBody}
}
} }
@assign(${prototypeBase}, ${proto}); ${templateProperties.methods && `@assign(${name}.prototype, %methods);`}
${templateProperties.methods && `@assign(${prototypeBase}, %methods);`}
`); `);
} }
@ -402,6 +404,10 @@ export default function dom(
} else { } else {
let inlineHelpers = ''; let inlineHelpers = '';
// super gross hack to ensure Component isn't declared before its superclass
usedHelpers.delete('Component');
usedHelpers.add('Thing').add('Component');
usedHelpers.forEach(key => { usedHelpers.forEach(key => {
const str = shared[key]; const str = shared[key];
const code = new MagicString(str); const code = new MagicString(str);
@ -424,8 +430,9 @@ export default function dom(
usedHelpers.add(dependency); usedHelpers.add(dependency);
const alias = generator.alias(dependency); const alias = generator.alias(dependency);
if (alias !== node.name) if (alias !== node.name) {
code.overwrite(node.start, node.end, alias); code.overwrite(node.start, node.end, alias);
}
} }
} }
}, },
@ -439,17 +446,17 @@ export default function dom(
// special case // special case
const global = `_svelteTransitionManager`; const global = `_svelteTransitionManager`;
inlineHelpers += `\n\nvar ${generator.alias('transitionManager')} = window.${global} || (window.${global} = ${code});\n\n`; inlineHelpers += `var ${generator.alias('transitionManager')} = window.${global} || (window.${global} = ${code});\n\n`;
} else { } else {
const alias = generator.alias(expression.id.name); const alias = generator.alias(expression.id.name);
if (alias !== expression.id.name) if (alias !== expression.id.name)
code.overwrite(expression.id.start, expression.id.end, alias); code.overwrite(expression.id.start, expression.id.end, alias);
inlineHelpers += `\n\n${code}`; inlineHelpers += `${code}\n\n`;
} }
}); });
result += inlineHelpers; result = inlineHelpers + result;
} }
const filename = options.filename && ( const filename = options.filename && (

@ -10,128 +10,139 @@ export function blankObject() {
return Object.create(null); return Object.create(null);
} }
export function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; export class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
export function destroyDev(detach) { fire(eventName, data) {
destroy.call(this, detach); const handlers = eventName in this._handlers && this._handlers[eventName].slice();
this.destroy = function() { if (!handlers) return;
console.warn('Component was already destroyed');
};
}
export function _differs(a, b) { for (let i = 0; i < handlers.length; i += 1) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function'); const handler = handlers[i];
}
export function _differsImmutable(a, b) { if (!handler.__calling) {
return a != a ? b == b : a !== b; handler.__calling = true;
} handler.call(this, data);
handler.__calling = false;
}
}
}
get() {
return this._state;
}
export function fire(eventName, data) { on(eventName, handler) {
var handlers = const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
eventName in this._handlers && this._handlers[eventName].slice(); handlers.push(handler);
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) { return {
var handler = handlers[i]; cancel: function() {
const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
if (!handler.__calling) { _differs(a, b) {
handler.__calling = true; return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
handler.call(this, data);
handler.__calling = false;
}
} }
} }
export function get() { export class Component extends Thing {
return this._state; constructor(options) {
} super();
this._bind = options._bind;
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
}
export function init(component, options) { destroy(detach) {
component._handlers = blankObject(); this.destroy = noop;
component._bind = options._bind; this.fire('destroy');
this.set = this.get = noop;
component.options = options; if (detach !== false) this._fragment.u();
component.root = options.root || component; this._fragment.d();
component.store = component.root.store || options.store; this._fragment = this._state = null;
} }
set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
export function on(eventName, handler) { _set(newState) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); const previous = this._state;
handlers.push(handler); const changed = {};
let dirty = false;
return { for (var key in newState) {
cancel: function() { if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
} }
};
}
export function run(fn) { if (!dirty) return;
fn();
}
export function set(newState) { this._state = assign(assign({}, previous), newState);
this._set(assign({}, newState)); this._recompute(changed, this._state);
if (this.root._lock) return; if (this._bind) this._bind(changed, this._state);
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
export function _set(newState) { if (this._fragment) {
var oldState = this._state, this.fire("state", { changed, current: this._state, previous });
changed = {}, this._fragment.p(changed, this._state);
dirty = false; this.fire("update", { changed, current: this._state, previous });
}
}
for (var key in newState) { _mount(target, anchor) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _recompute() {}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) { _unmount() {
this.fire("state", { changed: changed, current: this._state, previous: oldState }); if (this._fragment) this._fragment.u();
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
} }
} }
export function setDev(newState) { export class ComponentDev extends Component {
if (typeof newState !== 'object') { destroy(detach) {
throw new Error( super.destroy(detach);
this._debugName + '.set was called without an object of data key-values to update.' this.destroy = () => {
); console.warn('Component was already destroyed');
};
} }
this._checkReadOnly(newState); set(newState) {
set.call(this, newState); if (typeof newState !== 'object') {
throw new Error(`${this._debugName}.set was called without an object of data key-values to update.`);
}
this._checkReadOnly(newState);
super.set(newState);
}
} }
export function callAll(fns) { export function _differsImmutable(a, b) {
while (fns && fns.length) fns.shift()(); return a != a ? b == b : a !== b;
} }
export function _mount(target, anchor) { export function run(fn) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); fn();
} }
export function _unmount() { export function callAll(fns) {
if (this._fragment) this._fragment.u(); while (fns && fns.length) fns.shift()();
} }
export function isPromise(value) { export function isPromise(value) {
@ -145,29 +156,3 @@ export var FAILURE = {};
export function removeFromStore() { export function removeFromStore() {
this.store._remove(this); this.store._remove(this);
} }
export var proto = {
destroy,
get,
fire,
on,
set,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
export var protoDev = {
destroy: destroyDev,
get,
fire,
on,
set: setDev,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};

@ -1,81 +1,24 @@
import { import {
Thing,
assign, assign,
blankObject, blankObject,
_differs, _differsImmutable
_differsImmutable,
get,
on,
fire
} from './shared.js'; } from './shared.js';
function Store(state, options) { class Store extends Thing {
this._handlers = {}; constructor(state, options) {
this._dependents = []; super();
this._computed = blankObject(); this._dependents = [];
this._sortedComputedProperties = [];
this._state = assign({}, state); this._computed = blankObject();
this._differs = options && options.immutable ? _differsImmutable : _differs; this._sortedComputedProperties = [];
}
assign(Store.prototype, {
_add: function(component, props) {
this._dependents.push({
component: component,
props: props
});
},
_init: function(props) {
var state = {};
for (var i = 0; i < props.length; i += 1) {
var prop = props[i];
state['$' + prop] = this._state[prop];
}
return state;
},
_remove: function(component) {
var i = this._dependents.length;
while (i--) {
if (this._dependents[i].component === component) {
this._dependents.splice(i, 1);
return;
}
}
},
_sortComputedProperties: function() {
var computed = this._computed;
var sorted = this._sortedComputedProperties = [];
var cycles;
var visited = blankObject();
function visit(key) { this._state = assign({}, state);
if (cycles[key]) { if (options && options.immutable) this._differs = _differsImmutable;
throw new Error('Cyclical dependency detected'); }
}
if (visited[key]) return;
visited[key] = true;
var c = computed[key];
if (c) {
cycles[key] = true;
c.deps.forEach(visit);
sorted.push(c);
}
}
for (var key in this._computed) {
cycles = blankObject();
visit(key);
}
},
compute: function(key, deps, fn) { compute(key, deps, fn) {
var store = this; var store = this;
var value; var value;
@ -102,15 +45,9 @@ assign(Store.prototype, {
this._computed[key] = c; this._computed[key] = c;
this._sortComputedProperties(); this._sortComputedProperties();
}, }
fire: fire,
get: get,
on: on,
set: function(newState) { set(newState) {
var oldState = this._state, var oldState = this._state,
changed = this._changed = {}, changed = this._changed = {},
dirty = false; dirty = false;
@ -156,6 +93,61 @@ assign(Store.prototype, {
previous: oldState previous: oldState
}); });
} }
});
_add(component, props) {
this._dependents.push({
component: component,
props: props
});
}
_init(props) {
var state = {};
for (var i = 0; i < props.length; i += 1) {
var prop = props[i];
state['$' + prop] = this._state[prop];
}
return state;
}
_remove(component) {
var i = this._dependents.length;
while (i--) {
if (this._dependents[i].component === component) {
this._dependents.splice(i, 1);
return;
}
}
}
_sortComputedProperties() {
var computed = this._computed;
var sorted = this._sortedComputedProperties = [];
var cycles;
var visited = blankObject();
function visit(key) {
if (cycles[key]) {
throw new Error('Cyclical dependency detected');
}
if (visited[key]) return;
visited[key] = true;
var c = computed[key];
if (c) {
cycles[key] = true;
c.deps.forEach(visit);
sorted.push(c);
}
}
for (var key in this._computed) {
cycles = blankObject();
visit(key);
}
}
}
export { Store }; export { Store };

@ -21,116 +21,118 @@ function blankObject() {
return Object.create(null); return Object.create(null);
} }
function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function fire(eventName, data) { fire(eventName, data) {
var handlers = const handlers = eventName in this._handlers && this._handlers[eventName].slice();
eventName in this._handlers && this._handlers[eventName].slice(); if (!handlers) return;
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) { for (let i = 0; i < handlers.length; i += 1) {
var handler = handlers[i]; const handler = handlers[i];
if (!handler.__calling) { if (!handler.__calling) {
handler.__calling = true; handler.__calling = true;
handler.call(this, data); handler.call(this, data);
handler.__calling = false; handler.__calling = false;
}
} }
} }
}
function get() { get() {
return this._state; return this._state;
} }
function init(component, options) { on(eventName, handler) {
component._handlers = blankObject(); const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
component._bind = options._bind; handlers.push(handler);
return {
cancel: function() {
const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
component.options = options; _differs(a, b) {
component.root = options.root || component; return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
component.store = component.root.store || options.store; }
} }
function on(eventName, handler) { class Component extends Thing {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); constructor(options) {
handlers.push(handler); super();
this._bind = options._bind;
return { this.options = options;
cancel: function() { this.root = options.root || this;
var index = handlers.indexOf(handler); this.store = this.root.store || options.store;
if (~index) handlers.splice(index, 1); }
}
};
}
function set(newState) { destroy(detach) {
this._set(assign({}, newState)); this.destroy = noop;
if (this.root._lock) return; this.fire('destroy');
this.root._lock = true; this.set = this.get = noop;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) { if (detach !== false) this._fragment.u();
var oldState = this._state, this._fragment.d();
changed = {}, this._fragment = this._state = null;
dirty = false; }
for (var key in newState) { set(newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _set(newState) {
this._recompute(changed, this._state); const previous = this._state;
if (this._bind) this._bind(changed, this._state); const changed = {};
let dirty = false;
if (this._fragment) { for (var key in newState) {
this.fire("state", { changed: changed, current: this._state, previous: oldState }); if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
this._fragment.p(changed, this._state); }
this.fire("update", { changed: changed, current: this._state, previous: oldState });
if (!dirty) return;
this._state = assign(assign({}, previous), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed, current: this._state, previous });
this._fragment.p(changed, this._state);
this.fire("update", { changed, current: this._state, previous });
}
} }
}
function callAll(fns) { _mount(target, anchor) {
while (fns && fns.length) fns.shift()(); this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
} }
_recompute() {}
function _mount(target, anchor) { _unmount() {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); if (this._fragment) this._fragment.u();
}
} }
function _unmount() { function _differsImmutable(a, b) {
if (this._fragment) this._fragment.u(); return a != a ? b == b : a !== b;
} }
var proto = { function callAll(fns) {
destroy, while (fns && fns.length) fns.shift()();
get, }
fire,
on,
set,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
@ -174,24 +176,24 @@ function create_main_fragment(component, state) {
detachNode(a); detachNode(a);
}, },
d: function destroy$$1() { d: function destroy() {
if (typeof link_action.destroy === 'function') link_action.destroy.call(component); if (typeof link_action.destroy === 'function') link_action.destroy.call(component);
} }
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insertNode, noop, proto } from "svelte/shared.js"; import { Component, assign, createElement, detachNode, insertNode, noop } from "svelte/shared.js";
function link(node) { function link(node) {
@ -48,17 +48,17 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -29,116 +29,118 @@ function blankObject() {
return Object.create(null); return Object.create(null);
} }
function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function fire(eventName, data) { fire(eventName, data) {
var handlers = const handlers = eventName in this._handlers && this._handlers[eventName].slice();
eventName in this._handlers && this._handlers[eventName].slice(); if (!handlers) return;
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) { for (let i = 0; i < handlers.length; i += 1) {
var handler = handlers[i]; const handler = handlers[i];
if (!handler.__calling) { if (!handler.__calling) {
handler.__calling = true; handler.__calling = true;
handler.call(this, data); handler.call(this, data);
handler.__calling = false; handler.__calling = false;
}
} }
} }
}
function get() { get() {
return this._state; return this._state;
} }
on(eventName, handler) {
const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
function init(component, options) { return {
component._handlers = blankObject(); cancel: function() {
component._bind = options._bind; const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
component.options = options; _differs(a, b) {
component.root = options.root || component; return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
component.store = component.root.store || options.store; }
} }
function on(eventName, handler) { class Component extends Thing {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); constructor(options) {
handlers.push(handler); super();
this._bind = options._bind;
return { this.options = options;
cancel: function() { this.root = options.root || this;
var index = handlers.indexOf(handler); this.store = this.root.store || options.store;
if (~index) handlers.splice(index, 1); }
}
};
}
function set(newState) { destroy(detach) {
this._set(assign({}, newState)); this.destroy = noop;
if (this.root._lock) return; this.fire('destroy');
this.root._lock = true; this.set = this.get = noop;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) { if (detach !== false) this._fragment.u();
var oldState = this._state, this._fragment.d();
changed = {}, this._fragment = this._state = null;
dirty = false; }
for (var key in newState) { set(newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _set(newState) {
this._recompute(changed, this._state); const previous = this._state;
if (this._bind) this._bind(changed, this._state); const changed = {};
let dirty = false;
for (var key in newState) {
if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
}
if (!dirty) return;
this._state = assign(assign({}, previous), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) { if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState }); this.fire("state", { changed, current: this._state, previous });
this._fragment.p(changed, this._state); this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState }); this.fire("update", { changed, current: this._state, previous });
}
} }
}
function callAll(fns) { _mount(target, anchor) {
while (fns && fns.length) fns.shift()(); this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
} }
_recompute() {}
function _mount(target, anchor) { _unmount() {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); if (this._fragment) this._fragment.u();
}
} }
function _unmount() { function _differsImmutable(a, b) {
if (this._fragment) this._fragment.u(); return a != a ? b == b : a !== b;
} }
var proto = { function callAll(fns) {
destroy, while (fns && fns.length) fns.shift()();
get, }
fire,
on,
set,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
@ -185,20 +187,20 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign(data(), options.data); super(options);
this._state = assign(data(), options.data);
if (!document.getElementById("svelte-1a7i8ec-style")) add_css(); if (!document.getElementById("svelte-1a7i8ec-style")) add_css();
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { appendNode, assign, createElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js"; import { Component, appendNode, assign, createElement, createText, detachNode, insertNode, noop } from "svelte/shared.js";
function data() { function data() {
return { foo: 42 } return { foo: 42 }
@ -45,19 +45,19 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign(data(), options.data); super(options);
this._state = assign(data(), options.data);
if (!document.getElementById("svelte-1a7i8ec-style")) add_css(); if (!document.getElementById("svelte-1a7i8ec-style")) add_css();
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -9,120 +9,118 @@ function blankObject() {
return Object.create(null); return Object.create(null);
} }
function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function _differs(a, b) { fire(eventName, data) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function'); const handlers = eventName in this._handlers && this._handlers[eventName].slice();
} if (!handlers) return;
function _differsImmutable(a, b) { for (let i = 0; i < handlers.length; i += 1) {
return a != a ? b == b : a !== b; const handler = handlers[i];
}
function fire(eventName, data) { if (!handler.__calling) {
var handlers = handler.__calling = true;
eventName in this._handlers && this._handlers[eventName].slice(); handler.call(this, data);
if (!handlers) return; handler.__calling = false;
}
}
}
for (var i = 0; i < handlers.length; i += 1) { get() {
var handler = handlers[i]; return this._state;
}
if (!handler.__calling) { on(eventName, handler) {
handler.__calling = true; const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handler.call(this, data); handlers.push(handler);
handler.__calling = false;
} return {
cancel: function() {
const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
} }
}
function get() { _differs(a, b) {
return this._state; return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
}
} }
function init(component, options) { class Component extends Thing {
component._handlers = blankObject(); constructor(options) {
component._bind = options._bind; super();
this._bind = options._bind;
component.options = options; this.options = options;
component.root = options.root || component; this.root = options.root || this;
component.store = component.root.store || options.store; this.store = this.root.store || options.store;
} }
function on(eventName, handler) { destroy(detach) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); this.destroy = noop;
handlers.push(handler); this.fire('destroy');
this.set = this.get = noop;
return { if (detach !== false) this._fragment.u();
cancel: function() { this._fragment.d();
var index = handlers.indexOf(handler); this._fragment = this._state = null;
if (~index) handlers.splice(index, 1); }
set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
_set(newState) {
const previous = this._state;
const changed = {};
let dirty = false;
for (var key in newState) {
if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
} }
};
}
function set(newState) { if (!dirty) return;
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) { this._state = assign(assign({}, previous), newState);
var oldState = this._state, this._recompute(changed, this._state);
changed = {}, if (this._bind) this._bind(changed, this._state);
dirty = false;
for (var key in newState) { if (this._fragment) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this.fire("state", { changed, current: this._state, previous });
this._fragment.p(changed, this._state);
this.fire("update", { changed, current: this._state, previous });
}
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _mount(target, anchor) {
this._recompute(changed, this._state); this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
} }
}
function callAll(fns) { _recompute() {}
while (fns && fns.length) fns.shift()();
}
function _mount(target, anchor) { _unmount() {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); if (this._fragment) this._fragment.u();
}
} }
function _unmount() { function _differsImmutable(a, b) {
if (this._fragment) this._fragment.u(); return a != a ? b == b : a !== b;
} }
var proto = { function callAll(fns) {
destroy, while (fns && fns.length) fns.shift()();
get, }
fire,
on,
set,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
@ -151,38 +149,38 @@ function create_main_fragment(component, state) {
nested._unmount(); nested._unmount();
}, },
d: function destroy$$1() { d: function destroy() {
nested.destroy(false); nested.destroy(false);
} }
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
if (!options.root) { if (!options.root) {
this._oncreate = []; this._oncreate = [];
this._beforecreate = []; this._beforecreate = [];
this._aftercreate = []; this._aftercreate = [];
} }
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
this._lock = true; this._lock = true;
callAll(this._beforecreate); callAll(this._beforecreate);
callAll(this._oncreate); callAll(this._oncreate);
callAll(this._aftercreate); callAll(this._aftercreate);
this._lock = false; this._lock = false;
}
} }
} }
assign(SvelteComponent.prototype, proto);
SvelteComponent.prototype._differs = _differsImmutable; SvelteComponent.prototype._differs = _differsImmutable;
export default SvelteComponent; export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { _differsImmutable, assign, callAll, init, noop, proto } from "svelte/shared.js"; import { Component, _differsImmutable, assign, callAll, noop } from "svelte/shared.js";
var Nested = window.Nested; var Nested = window.Nested;
@ -32,31 +32,31 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
if (!options.root) { if (!options.root) {
this._oncreate = []; this._oncreate = [];
this._beforecreate = []; this._beforecreate = [];
this._aftercreate = []; this._aftercreate = [];
} }
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
this._lock = true; this._lock = true;
callAll(this._beforecreate); callAll(this._beforecreate);
callAll(this._oncreate); callAll(this._oncreate);
callAll(this._aftercreate); callAll(this._aftercreate);
this._lock = false; this._lock = false;
}
} }
} }
assign(SvelteComponent.prototype, proto);
SvelteComponent.prototype._differs = _differsImmutable; SvelteComponent.prototype._differs = _differsImmutable;
export default SvelteComponent; export default SvelteComponent;

@ -9,120 +9,118 @@ function blankObject() {
return Object.create(null); return Object.create(null);
} }
function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function _differs(a, b) { fire(eventName, data) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function'); const handlers = eventName in this._handlers && this._handlers[eventName].slice();
} if (!handlers) return;
function _differsImmutable(a, b) { for (let i = 0; i < handlers.length; i += 1) {
return a != a ? b == b : a !== b; const handler = handlers[i];
}
function fire(eventName, data) { if (!handler.__calling) {
var handlers = handler.__calling = true;
eventName in this._handlers && this._handlers[eventName].slice(); handler.call(this, data);
if (!handlers) return; handler.__calling = false;
}
}
}
for (var i = 0; i < handlers.length; i += 1) { get() {
var handler = handlers[i]; return this._state;
}
if (!handler.__calling) { on(eventName, handler) {
handler.__calling = true; const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handler.call(this, data); handlers.push(handler);
handler.__calling = false;
} return {
cancel: function() {
const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
} }
}
function get() { _differs(a, b) {
return this._state; return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
}
} }
function init(component, options) { class Component extends Thing {
component._handlers = blankObject(); constructor(options) {
component._bind = options._bind; super();
this._bind = options._bind;
component.options = options; this.options = options;
component.root = options.root || component; this.root = options.root || this;
component.store = component.root.store || options.store; this.store = this.root.store || options.store;
} }
function on(eventName, handler) { destroy(detach) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); this.destroy = noop;
handlers.push(handler); this.fire('destroy');
this.set = this.get = noop;
return { if (detach !== false) this._fragment.u();
cancel: function() { this._fragment.d();
var index = handlers.indexOf(handler); this._fragment = this._state = null;
if (~index) handlers.splice(index, 1); }
set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
_set(newState) {
const previous = this._state;
const changed = {};
let dirty = false;
for (var key in newState) {
if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
} }
};
}
function set(newState) { if (!dirty) return;
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) { this._state = assign(assign({}, previous), newState);
var oldState = this._state, this._recompute(changed, this._state);
changed = {}, if (this._bind) this._bind(changed, this._state);
dirty = false;
for (var key in newState) { if (this._fragment) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this.fire("state", { changed, current: this._state, previous });
this._fragment.p(changed, this._state);
this.fire("update", { changed, current: this._state, previous });
}
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _mount(target, anchor) {
this._recompute(changed, this._state); this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
} }
}
function callAll(fns) { _recompute() {}
while (fns && fns.length) fns.shift()();
}
function _mount(target, anchor) { _unmount() {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); if (this._fragment) this._fragment.u();
}
} }
function _unmount() { function _differsImmutable(a, b) {
if (this._fragment) this._fragment.u(); return a != a ? b == b : a !== b;
} }
var proto = { function callAll(fns) {
destroy, while (fns && fns.length) fns.shift()();
get, }
fire,
on,
set,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
@ -151,38 +149,38 @@ function create_main_fragment(component, state) {
nested._unmount(); nested._unmount();
}, },
d: function destroy$$1() { d: function destroy() {
nested.destroy(false); nested.destroy(false);
} }
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
if (!options.root) { if (!options.root) {
this._oncreate = []; this._oncreate = [];
this._beforecreate = []; this._beforecreate = [];
this._aftercreate = []; this._aftercreate = [];
} }
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
this._lock = true; this._lock = true;
callAll(this._beforecreate); callAll(this._beforecreate);
callAll(this._oncreate); callAll(this._oncreate);
callAll(this._aftercreate); callAll(this._aftercreate);
this._lock = false; this._lock = false;
}
} }
} }
assign(SvelteComponent.prototype, proto);
SvelteComponent.prototype._differs = _differsImmutable; SvelteComponent.prototype._differs = _differsImmutable;
export default SvelteComponent; export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { _differsImmutable, assign, callAll, init, noop, proto } from "svelte/shared.js"; import { Component, _differsImmutable, assign, callAll, noop } from "svelte/shared.js";
var Nested = window.Nested; var Nested = window.Nested;
@ -32,31 +32,31 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
if (!options.root) { if (!options.root) {
this._oncreate = []; this._oncreate = [];
this._beforecreate = []; this._beforecreate = [];
this._aftercreate = []; this._aftercreate = [];
} }
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
this._lock = true; this._lock = true;
callAll(this._beforecreate); callAll(this._beforecreate);
callAll(this._oncreate); callAll(this._oncreate);
callAll(this._aftercreate); callAll(this._aftercreate);
this._lock = false; this._lock = false;
}
} }
} }
assign(SvelteComponent.prototype, proto);
SvelteComponent.prototype._differs = _differsImmutable; SvelteComponent.prototype._differs = _differsImmutable;
export default SvelteComponent; export default SvelteComponent;

@ -9,116 +9,118 @@ function blankObject() {
return Object.create(null); return Object.create(null);
} }
function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function fire(eventName, data) { fire(eventName, data) {
var handlers = const handlers = eventName in this._handlers && this._handlers[eventName].slice();
eventName in this._handlers && this._handlers[eventName].slice(); if (!handlers) return;
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) { for (let i = 0; i < handlers.length; i += 1) {
var handler = handlers[i]; const handler = handlers[i];
if (!handler.__calling) { if (!handler.__calling) {
handler.__calling = true; handler.__calling = true;
handler.call(this, data); handler.call(this, data);
handler.__calling = false; handler.__calling = false;
}
} }
} }
}
function get() { get() {
return this._state; return this._state;
} }
function init(component, options) { on(eventName, handler) {
component._handlers = blankObject(); const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
component._bind = options._bind; handlers.push(handler);
return {
cancel: function() {
const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
component.options = options; _differs(a, b) {
component.root = options.root || component; return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
component.store = component.root.store || options.store; }
} }
function on(eventName, handler) { class Component extends Thing {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); constructor(options) {
handlers.push(handler); super();
this._bind = options._bind;
return { this.options = options;
cancel: function() { this.root = options.root || this;
var index = handlers.indexOf(handler); this.store = this.root.store || options.store;
if (~index) handlers.splice(index, 1); }
}
};
}
function set(newState) { destroy(detach) {
this._set(assign({}, newState)); this.destroy = noop;
if (this.root._lock) return; this.fire('destroy');
this.root._lock = true; this.set = this.get = noop;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) { if (detach !== false) this._fragment.u();
var oldState = this._state, this._fragment.d();
changed = {}, this._fragment = this._state = null;
dirty = false; }
for (var key in newState) { set(newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _set(newState) {
this._recompute(changed, this._state); const previous = this._state;
if (this._bind) this._bind(changed, this._state); const changed = {};
let dirty = false;
for (var key in newState) {
if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
}
if (!dirty) return;
this._state = assign(assign({}, previous), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) { if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState }); this.fire("state", { changed, current: this._state, previous });
this._fragment.p(changed, this._state); this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState }); this.fire("update", { changed, current: this._state, previous });
}
} }
}
function callAll(fns) { _mount(target, anchor) {
while (fns && fns.length) fns.shift()(); this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
} }
function _mount(target, anchor) { _recompute() {}
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
_unmount() {
if (this._fragment) this._fragment.u();
}
} }
function _unmount() { function _differsImmutable(a, b) {
if (this._fragment) this._fragment.u(); return a != a ? b == b : a !== b;
} }
var proto = { function callAll(fns) {
destroy, while (fns && fns.length) fns.shift()();
get, }
fire,
on,
set,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
@ -147,36 +149,36 @@ function create_main_fragment(component, state) {
nested._unmount(); nested._unmount();
}, },
d: function destroy$$1() { d: function destroy() {
nested.destroy(false); nested.destroy(false);
} }
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
if (!options.root) { if (!options.root) {
this._oncreate = []; this._oncreate = [];
this._beforecreate = []; this._beforecreate = [];
this._aftercreate = []; this._aftercreate = [];
} }
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
this._lock = true; this._lock = true;
callAll(this._beforecreate); callAll(this._beforecreate);
callAll(this._oncreate); callAll(this._oncreate);
callAll(this._aftercreate); callAll(this._aftercreate);
this._lock = false; this._lock = false;
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { assign, callAll, init, noop, proto } from "svelte/shared.js"; import { Component, assign, callAll, noop } from "svelte/shared.js";
var Nested = window.Nested; var Nested = window.Nested;
@ -32,29 +32,29 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
if (!options.root) { if (!options.root) {
this._oncreate = []; this._oncreate = [];
this._beforecreate = []; this._beforecreate = [];
this._aftercreate = []; this._aftercreate = [];
} }
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
this._lock = true; this._lock = true;
callAll(this._beforecreate); callAll(this._beforecreate);
callAll(this._oncreate); callAll(this._oncreate);
callAll(this._aftercreate); callAll(this._aftercreate);
this._lock = false; this._lock = false;
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -9,116 +9,118 @@ function blankObject() {
return Object.create(null); return Object.create(null);
} }
function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function fire(eventName, data) { fire(eventName, data) {
var handlers = const handlers = eventName in this._handlers && this._handlers[eventName].slice();
eventName in this._handlers && this._handlers[eventName].slice(); if (!handlers) return;
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) { for (let i = 0; i < handlers.length; i += 1) {
var handler = handlers[i]; const handler = handlers[i];
if (!handler.__calling) { if (!handler.__calling) {
handler.__calling = true; handler.__calling = true;
handler.call(this, data); handler.call(this, data);
handler.__calling = false; handler.__calling = false;
}
} }
} }
}
function get() { get() {
return this._state; return this._state;
} }
function init(component, options) { on(eventName, handler) {
component._handlers = blankObject(); const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
component._bind = options._bind; handlers.push(handler);
return {
cancel: function() {
const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
component.options = options; _differs(a, b) {
component.root = options.root || component; return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
component.store = component.root.store || options.store; }
} }
function on(eventName, handler) { class Component extends Thing {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); constructor(options) {
handlers.push(handler); super();
this._bind = options._bind;
return { this.options = options;
cancel: function() { this.root = options.root || this;
var index = handlers.indexOf(handler); this.store = this.root.store || options.store;
if (~index) handlers.splice(index, 1); }
}
};
}
function set(newState) { destroy(detach) {
this._set(assign({}, newState)); this.destroy = noop;
if (this.root._lock) return; this.fire('destroy');
this.root._lock = true; this.set = this.get = noop;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) { if (detach !== false) this._fragment.u();
var oldState = this._state, this._fragment.d();
changed = {}, this._fragment = this._state = null;
dirty = false; }
for (var key in newState) { set(newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _set(newState) {
this._recompute(changed, this._state); const previous = this._state;
if (this._bind) this._bind(changed, this._state); const changed = {};
let dirty = false;
if (this._fragment) { for (var key in newState) {
this.fire("state", { changed: changed, current: this._state, previous: oldState }); if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
this._fragment.p(changed, this._state); }
this.fire("update", { changed: changed, current: this._state, previous: oldState });
if (!dirty) return;
this._state = assign(assign({}, previous), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed, current: this._state, previous });
this._fragment.p(changed, this._state);
this.fire("update", { changed, current: this._state, previous });
}
} }
}
function callAll(fns) { _mount(target, anchor) {
while (fns && fns.length) fns.shift()(); this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
} }
function _mount(target, anchor) { _recompute() {}
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
_unmount() {
if (this._fragment) this._fragment.u();
}
} }
function _unmount() { function _differsImmutable(a, b) {
if (this._fragment) this._fragment.u(); return a != a ? b == b : a !== b;
} }
var proto = { function callAll(fns) {
destroy, while (fns && fns.length) fns.shift()();
get, }
fire,
on,
set,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
@ -145,21 +147,21 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._recompute({ x: 1 }, this._state); this._state = assign({}, options.data);
this._recompute({ x: 1 }, this._state);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
SvelteComponent.prototype._recompute = function _recompute(changed, state) { SvelteComponent.prototype._recompute = function _recompute(changed, state) {
if (changed.x) { if (changed.x) {
if (this._differs(state.a, (state.a = a(state)))) changed.a = true; if (this._differs(state.a, (state.a = a(state)))) changed.a = true;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { assign, init, noop, proto } from "svelte/shared.js"; import { Component, assign, noop } from "svelte/shared.js";
function a({ x }) { function a({ x }) {
return x * 2; return x * 2;
@ -24,21 +24,21 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._recompute({ x: 1 }, this._state); this._state = assign({}, options.data);
this._recompute({ x: 1 }, this._state);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
SvelteComponent.prototype._recompute = function _recompute(changed, state) { SvelteComponent.prototype._recompute = function _recompute(changed, state) {
if (changed.x) { if (changed.x) {
if (this._differs(state.a, (state.a = a(state)))) changed.a = true; if (this._differs(state.a, (state.a = a(state)))) changed.a = true;

@ -25,116 +25,118 @@ function blankObject() {
return Object.create(null); return Object.create(null);
} }
function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function fire(eventName, data) { fire(eventName, data) {
var handlers = const handlers = eventName in this._handlers && this._handlers[eventName].slice();
eventName in this._handlers && this._handlers[eventName].slice(); if (!handlers) return;
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) { for (let i = 0; i < handlers.length; i += 1) {
var handler = handlers[i]; const handler = handlers[i];
if (!handler.__calling) { if (!handler.__calling) {
handler.__calling = true; handler.__calling = true;
handler.call(this, data); handler.call(this, data);
handler.__calling = false; handler.__calling = false;
}
} }
} }
}
function get() { get() {
return this._state; return this._state;
} }
function init(component, options) { on(eventName, handler) {
component._handlers = blankObject(); const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
component._bind = options._bind; handlers.push(handler);
return {
cancel: function() {
const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
component.options = options; _differs(a, b) {
component.root = options.root || component; return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
component.store = component.root.store || options.store; }
} }
function on(eventName, handler) { class Component extends Thing {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); constructor(options) {
handlers.push(handler); super();
this._bind = options._bind;
return { this.options = options;
cancel: function() { this.root = options.root || this;
var index = handlers.indexOf(handler); this.store = this.root.store || options.store;
if (~index) handlers.splice(index, 1); }
}
};
}
function set(newState) { destroy(detach) {
this._set(assign({}, newState)); this.destroy = noop;
if (this.root._lock) return; this.fire('destroy');
this.root._lock = true; this.set = this.get = noop;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) { if (detach !== false) this._fragment.u();
var oldState = this._state, this._fragment.d();
changed = {}, this._fragment = this._state = null;
dirty = false; }
for (var key in newState) { set(newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _set(newState) {
this._recompute(changed, this._state); const previous = this._state;
if (this._bind) this._bind(changed, this._state); const changed = {};
let dirty = false;
if (this._fragment) { for (var key in newState) {
this.fire("state", { changed: changed, current: this._state, previous: oldState }); if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
this._fragment.p(changed, this._state); }
this.fire("update", { changed: changed, current: this._state, previous: oldState });
if (!dirty) return;
this._state = assign(assign({}, previous), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed, current: this._state, previous });
this._fragment.p(changed, this._state);
this.fire("update", { changed, current: this._state, previous });
}
} }
}
function callAll(fns) { _mount(target, anchor) {
while (fns && fns.length) fns.shift()(); this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
} }
_recompute() {}
function _mount(target, anchor) { _unmount() {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); if (this._fragment) this._fragment.u();
}
} }
function _unmount() { function _differsImmutable(a, b) {
if (this._fragment) this._fragment.u(); return a != a ? b == b : a !== b;
} }
var proto = { function callAll(fns) {
destroy, while (fns && fns.length) fns.shift()();
get, }
fire,
on,
set,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
@ -172,20 +174,20 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
if (!document.getElementById("svelte-1slhpfn-style")) add_css(); if (!document.getElementById("svelte-1slhpfn-style")) add_css();
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { appendNode, assign, createElement, detachNode, init, insertNode, noop, proto } from "svelte/shared.js"; import { Component, appendNode, assign, createElement, detachNode, insertNode, noop } from "svelte/shared.js";
function add_css() { function add_css() {
var style = createElement("style"); var style = createElement("style");
@ -35,19 +35,19 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
if (!document.getElementById("svelte-1slhpfn-style")) add_css(); if (!document.getElementById("svelte-1slhpfn-style")) add_css();
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -21,116 +21,118 @@ function blankObject() {
return Object.create(null); return Object.create(null);
} }
function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function fire(eventName, data) { fire(eventName, data) {
var handlers = const handlers = eventName in this._handlers && this._handlers[eventName].slice();
eventName in this._handlers && this._handlers[eventName].slice(); if (!handlers) return;
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) { for (let i = 0; i < handlers.length; i += 1) {
var handler = handlers[i]; const handler = handlers[i];
if (!handler.__calling) { if (!handler.__calling) {
handler.__calling = true; handler.__calling = true;
handler.call(this, data); handler.call(this, data);
handler.__calling = false; handler.__calling = false;
}
} }
} }
}
function get() { get() {
return this._state; return this._state;
} }
function init(component, options) { on(eventName, handler) {
component._handlers = blankObject(); const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
component._bind = options._bind; handlers.push(handler);
return {
cancel: function() {
const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
component.options = options; _differs(a, b) {
component.root = options.root || component; return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
component.store = component.root.store || options.store; }
} }
function on(eventName, handler) { class Component extends Thing {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); constructor(options) {
handlers.push(handler); super();
this._bind = options._bind;
return { this.options = options;
cancel: function() { this.root = options.root || this;
var index = handlers.indexOf(handler); this.store = this.root.store || options.store;
if (~index) handlers.splice(index, 1); }
}
};
}
function set(newState) { destroy(detach) {
this._set(assign({}, newState)); this.destroy = noop;
if (this.root._lock) return; this.fire('destroy');
this.root._lock = true; this.set = this.get = noop;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) { if (detach !== false) this._fragment.u();
var oldState = this._state, this._fragment.d();
changed = {}, this._fragment = this._state = null;
dirty = false; }
for (var key in newState) { set(newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _set(newState) {
this._recompute(changed, this._state); const previous = this._state;
if (this._bind) this._bind(changed, this._state); const changed = {};
let dirty = false;
if (this._fragment) { for (var key in newState) {
this.fire("state", { changed: changed, current: this._state, previous: oldState }); if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
this._fragment.p(changed, this._state); }
this.fire("update", { changed: changed, current: this._state, previous: oldState });
if (!dirty) return;
this._state = assign(assign({}, previous), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed, current: this._state, previous });
this._fragment.p(changed, this._state);
this.fire("update", { changed, current: this._state, previous });
}
} }
}
function callAll(fns) { _mount(target, anchor) {
while (fns && fns.length) fns.shift()(); this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
} }
function _mount(target, anchor) { _recompute() {}
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
_unmount() {
if (this._fragment) this._fragment.u();
}
} }
function _unmount() { function _differsImmutable(a, b) {
if (this._fragment) this._fragment.u(); return a != a ? b == b : a !== b;
} }
var proto = { function callAll(fns) {
destroy, while (fns && fns.length) fns.shift()();
get, }
fire,
on,
set,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
@ -161,7 +163,6 @@ function create_main_fragment(component, state) {
class SvelteComponent extends HTMLElement { class SvelteComponent extends HTMLElement {
constructor(options = {}) { constructor(options = {}) {
super(); super();
init(this, options);
this._state = assign({}, options.data); this._state = assign({}, options.data);
this.attachShadow({ mode: 'open' }); this.attachShadow({ mode: 'open' });
@ -185,7 +186,7 @@ class SvelteComponent extends HTMLElement {
} }
customElements.define("custom-element", SvelteComponent); customElements.define("custom-element", SvelteComponent);
assign(assign(SvelteComponent.prototype, proto), { assign(assign(SvelteComponent.prototype, Component.prototype), {
_mount(target, anchor) { _mount(target, anchor) {
target.insertBefore(this, anchor); target.insertBefore(this, anchor);
}, },

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insertNode, noop, proto } from "svelte/shared.js"; import { Component, assign, createElement, detachNode, insertNode, noop } from "svelte/shared.js";
function create_main_fragment(component, state) { function create_main_fragment(component, state) {
var div; var div;
@ -28,7 +28,6 @@ function create_main_fragment(component, state) {
class SvelteComponent extends HTMLElement { class SvelteComponent extends HTMLElement {
constructor(options = {}) { constructor(options = {}) {
super(); super();
init(this, options);
this._state = assign({}, options.data); this._state = assign({}, options.data);
this.attachShadow({ mode: 'open' }); this.attachShadow({ mode: 'open' });
@ -52,7 +51,7 @@ class SvelteComponent extends HTMLElement {
} }
customElements.define("custom-element", SvelteComponent); customElements.define("custom-element", SvelteComponent);
assign(assign(SvelteComponent.prototype, proto), { assign(assign(SvelteComponent.prototype, Component.prototype), {
_mount(target, anchor) { _mount(target, anchor) {
target.insertBefore(this, anchor); target.insertBefore(this, anchor);
}, },

@ -39,116 +39,118 @@ function blankObject() {
return Object.create(null); return Object.create(null);
} }
function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function fire(eventName, data) { fire(eventName, data) {
var handlers = const handlers = eventName in this._handlers && this._handlers[eventName].slice();
eventName in this._handlers && this._handlers[eventName].slice(); if (!handlers) return;
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) { for (let i = 0; i < handlers.length; i += 1) {
var handler = handlers[i]; const handler = handlers[i];
if (!handler.__calling) { if (!handler.__calling) {
handler.__calling = true; handler.__calling = true;
handler.call(this, data); handler.call(this, data);
handler.__calling = false; handler.__calling = false;
}
} }
} }
}
function get() { get() {
return this._state; return this._state;
} }
on(eventName, handler) {
const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
function init(component, options) { return {
component._handlers = blankObject(); cancel: function() {
component._bind = options._bind; const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
component.options = options; _differs(a, b) {
component.root = options.root || component; return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
component.store = component.root.store || options.store; }
} }
function on(eventName, handler) { class Component extends Thing {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); constructor(options) {
handlers.push(handler); super();
this._bind = options._bind;
return { this.options = options;
cancel: function() { this.root = options.root || this;
var index = handlers.indexOf(handler); this.store = this.root.store || options.store;
if (~index) handlers.splice(index, 1); }
}
};
}
function set(newState) { destroy(detach) {
this._set(assign({}, newState)); this.destroy = noop;
if (this.root._lock) return; this.fire('destroy');
this.root._lock = true; this.set = this.get = noop;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) { if (detach !== false) this._fragment.u();
var oldState = this._state, this._fragment.d();
changed = {}, this._fragment = this._state = null;
dirty = false; }
for (var key in newState) { set(newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _set(newState) {
this._recompute(changed, this._state); const previous = this._state;
if (this._bind) this._bind(changed, this._state); const changed = {};
let dirty = false;
for (var key in newState) {
if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
}
if (!dirty) return;
this._state = assign(assign({}, previous), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) { if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState }); this.fire("state", { changed, current: this._state, previous });
this._fragment.p(changed, this._state); this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState }); this.fire("update", { changed, current: this._state, previous });
}
} }
}
function callAll(fns) { _mount(target, anchor) {
while (fns && fns.length) fns.shift()(); this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
} }
_recompute() {}
function _mount(target, anchor) { _unmount() {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); if (this._fragment) this._fragment.u();
}
} }
function _unmount() { function _differsImmutable(a, b) {
if (this._fragment) this._fragment.u(); return a != a ? b == b : a !== b;
} }
var proto = { function callAll(fns) {
destroy, while (fns && fns.length) fns.shift()();
get, }
fire,
on,
set,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
@ -220,7 +222,7 @@ function create_main_fragment(component, state) {
detachNode(each_anchor); detachNode(each_anchor);
}, },
d: function destroy$$1() { d: function destroy() {
destroyEach(each_blocks); destroyEach(each_blocks);
} }
}; };
@ -259,18 +261,18 @@ function create_each_block(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -0,0 +1,124 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createComment, createElement, createText, destroyEach, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
function create_main_fragment(component, state) {
var each_anchor;
var each_value = state.createElement;
var each_blocks = [];
for (var i = 0; i < each_value.length; i += 1) {
each_blocks[i] = create_each_block(component, assign(assign({}, state), {
each_value: each_value,
node: each_value[i],
node_index: i
}));
}
return {
c: function create() {
for (var i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].c();
}
each_anchor = createComment();
},
m: function mount(target, anchor) {
for (var i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(target, anchor);
}
insertNode(each_anchor, target, anchor);
},
p: function update(changed, state) {
var each_value = state.createElement;
if (changed.createElement) {
for (var i = 0; i < each_value.length; i += 1) {
var each_context = assign(assign({}, state), {
each_value: each_value,
node: each_value[i],
node_index: i
});
if (each_blocks[i]) {
each_blocks[i].p(changed, each_context);
} else {
each_blocks[i] = create_each_block(component, each_context);
each_blocks[i].c();
each_blocks[i].m(each_anchor.parentNode, each_anchor);
}
}
for (; i < each_blocks.length; i += 1) {
each_blocks[i].u();
each_blocks[i].d();
}
each_blocks.length = each_value.length;
}
},
u: function unmount() {
for (var i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].u();
}
detachNode(each_anchor);
},
d: function destroy() {
destroyEach(each_blocks);
}
};
}
// (1:0) {#each createElement as node}
function create_each_block(component, state) {
var node = state.node, each_value = state.each_value, node_index = state.node_index;
var span, text_value = node, text;
return {
c: function create() {
span = createElement("span");
text = createText(text_value);
},
m: function mount(target, anchor) {
insertNode(span, target, anchor);
appendNode(text, span);
},
p: function update(changed, state) {
node = state.node;
each_value = state.each_value;
node_index = state.node_index;
if ((changed.createElement) && text_value !== (text_value = node)) {
text.data = text_value;
}
},
u: function unmount() {
detachNode(span);
},
d: noop
};
}
function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { appendNode, assign, createComment, createElement, createText, destroyEach, detachNode, init, insertNode, noop, proto } from "svelte/shared.js"; import { Component, appendNode, assign, createComment, createElement, createText, destroyEach, detachNode, insertNode, noop } from "svelte/shared.js";
function create_main_fragment(component, state) { function create_main_fragment(component, state) {
var each_anchor; var each_anchor;
@ -108,17 +108,17 @@ function create_each_block(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -9,116 +9,118 @@ function blankObject() {
return Object.create(null); return Object.create(null);
} }
function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function fire(eventName, data) { fire(eventName, data) {
var handlers = const handlers = eventName in this._handlers && this._handlers[eventName].slice();
eventName in this._handlers && this._handlers[eventName].slice(); if (!handlers) return;
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) { for (let i = 0; i < handlers.length; i += 1) {
var handler = handlers[i]; const handler = handlers[i];
if (!handler.__calling) { if (!handler.__calling) {
handler.__calling = true; handler.__calling = true;
handler.call(this, data); handler.call(this, data);
handler.__calling = false; handler.__calling = false;
}
} }
} }
}
function get() { get() {
return this._state; return this._state;
} }
function init(component, options) { on(eventName, handler) {
component._handlers = blankObject(); const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
component._bind = options._bind; handlers.push(handler);
component.options = options; return {
component.root = options.root || component; cancel: function() {
component.store = component.root.store || options.store; const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
_differs(a, b) {
return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
}
} }
function on(eventName, handler) { class Component extends Thing {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); constructor(options) {
handlers.push(handler); super();
this._bind = options._bind;
return { this.options = options;
cancel: function() { this.root = options.root || this;
var index = handlers.indexOf(handler); this.store = this.root.store || options.store;
if (~index) handlers.splice(index, 1); }
}
};
}
function set(newState) { destroy(detach) {
this._set(assign({}, newState)); this.destroy = noop;
if (this.root._lock) return; this.fire('destroy');
this.root._lock = true; this.set = this.get = noop;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) { if (detach !== false) this._fragment.u();
var oldState = this._state, this._fragment.d();
changed = {}, this._fragment = this._state = null;
dirty = false; }
for (var key in newState) { set(newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _set(newState) {
this._recompute(changed, this._state); const previous = this._state;
if (this._bind) this._bind(changed, this._state); const changed = {};
let dirty = false;
for (var key in newState) {
if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
}
if (!dirty) return;
this._state = assign(assign({}, previous), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) { if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState }); this.fire("state", { changed, current: this._state, previous });
this._fragment.p(changed, this._state); this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState }); this.fire("update", { changed, current: this._state, previous });
}
} }
}
function callAll(fns) { _mount(target, anchor) {
while (fns && fns.length) fns.shift()(); this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
} }
function _mount(target, anchor) { _recompute() {}
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
_unmount() {
if (this._fragment) this._fragment.u();
}
} }
function _unmount() { function _differsImmutable(a, b) {
if (this._fragment) this._fragment.u(); return a != a ? b == b : a !== b;
} }
var proto = { function callAll(fns) {
destroy, while (fns && fns.length) fns.shift()();
get, }
fire,
on,
set,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
@ -146,33 +148,33 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign(data_1(), options.data); super(options);
this._state = assign(data_1(), options.data);
var self = this; var self = this;
var _oncreate = function() { var _oncreate = function() {
var changed = { }; var changed = { };
oncreate.call(self); oncreate.call(self);
self.fire("update", { changed: changed, current: self._state }); self.fire("update", { changed: changed, current: self._state });
}; };
if (!options.root) { if (!options.root) {
this._oncreate = []; this._oncreate = [];
} }
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
this.root._oncreate.push(_oncreate); this.root._oncreate.push(_oncreate);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
callAll(this._oncreate); callAll(this._oncreate);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { assign, callAll, init, noop, proto } from "svelte/shared.js"; import { Component, assign, callAll, noop } from "svelte/shared.js";
function data_1() { function data_1() {
return { return {
@ -26,32 +26,32 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign(data_1(), options.data); super(options);
this._state = assign(data_1(), options.data);
var self = this; var self = this;
var _oncreate = function() { var _oncreate = function() {
var changed = { }; var changed = { };
oncreate.call(self); oncreate.call(self);
self.fire("update", { changed: changed, current: self._state }); self.fire("update", { changed: changed, current: self._state });
}; };
if (!options.root) { if (!options.root) {
this._oncreate = []; this._oncreate = [];
} }
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
this.root._oncreate.push(_oncreate); this.root._oncreate.push(_oncreate);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
callAll(this._oncreate); callAll(this._oncreate);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -29,135 +29,137 @@ function blankObject() {
return Object.create(null); return Object.create(null);
} }
function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function destroyDev(detach) { fire(eventName, data) {
destroy.call(this, detach); const handlers = eventName in this._handlers && this._handlers[eventName].slice();
this.destroy = function() { if (!handlers) return;
console.warn('Component was already destroyed');
};
}
function _differs(a, b) { for (let i = 0; i < handlers.length; i += 1) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function'); const handler = handlers[i];
}
function fire(eventName, data) { if (!handler.__calling) {
var handlers = handler.__calling = true;
eventName in this._handlers && this._handlers[eventName].slice(); handler.call(this, data);
if (!handlers) return; handler.__calling = false;
}
}
}
for (var i = 0; i < handlers.length; i += 1) { get() {
var handler = handlers[i]; return this._state;
}
if (!handler.__calling) { on(eventName, handler) {
handler.__calling = true; const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handler.call(this, data); handlers.push(handler);
handler.__calling = false;
} return {
cancel: function() {
const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
} }
}
function get() { _differs(a, b) {
return this._state; return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
}
} }
function init(component, options) { class Component extends Thing {
component._handlers = blankObject(); constructor(options) {
component._bind = options._bind; super();
this._bind = options._bind;
component.options = options; this.options = options;
component.root = options.root || component; this.root = options.root || this;
component.store = component.root.store || options.store; this.store = this.root.store || options.store;
} }
function on(eventName, handler) { destroy(detach) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); this.destroy = noop;
handlers.push(handler); this.fire('destroy');
this.set = this.get = noop;
return { if (detach !== false) this._fragment.u();
cancel: function() { this._fragment.d();
var index = handlers.indexOf(handler); this._fragment = this._state = null;
if (~index) handlers.splice(index, 1); }
set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
_set(newState) {
const previous = this._state;
const changed = {};
let dirty = false;
for (var key in newState) {
if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
} }
};
}
function set(newState) { if (!dirty) return;
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) { this._state = assign(assign({}, previous), newState);
var oldState = this._state, this._recompute(changed, this._state);
changed = {}, if (this._bind) this._bind(changed, this._state);
dirty = false;
for (var key in newState) { if (this._fragment) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this.fire("state", { changed, current: this._state, previous });
this._fragment.p(changed, this._state);
this.fire("update", { changed, current: this._state, previous });
}
}
_mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _recompute() {}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) { _unmount() {
this.fire("state", { changed: changed, current: this._state, previous: oldState }); if (this._fragment) this._fragment.u();
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
} }
} }
function setDev(newState) { class ComponentDev extends Component {
if (typeof newState !== 'object') { destroy(detach) {
throw new Error( super.destroy(detach);
this._debugName + '.set was called without an object of data key-values to update.' this.destroy = () => {
); console.warn('Component was already destroyed');
};
} }
this._checkReadOnly(newState); set(newState) {
set.call(this, newState); if (typeof newState !== 'object') {
} throw new Error(`${this._debugName}.set was called without an object of data key-values to update.`);
}
function callAll(fns) { this._checkReadOnly(newState);
while (fns && fns.length) fns.shift()(); super.set(newState);
}
} }
function _mount(target, anchor) { function _differsImmutable(a, b) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); return a != a ? b == b : a !== b;
} }
function _unmount() { function callAll(fns) {
if (this._fragment) this._fragment.u(); while (fns && fns.length) fns.shift()();
} }
var protoDev = {
destroy: destroyDev,
get,
fire,
on,
set: setDev,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
function bar({ foo }) { function bar({ foo }) {
@ -200,25 +202,25 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends ComponentDev {
this._debugName = '<SvelteComponent>'; constructor(options) {
if (!options || (!options.target && !options.root)) throw new Error("'target' is a required option"); super(options);
init(this, options); this._debugName = '<SvelteComponent>';
this._state = assign({ Math : Math }, options.data); if (!options || (!options.target && !options.root)) throw new Error("'target' is a required option");
this._recompute({ foo: 1 }, this._state); this._state = assign({ Math : Math }, options.data);
if (!('foo' in this._state)) console.warn("<SvelteComponent> was created without expected data property 'foo'"); this._recompute({ foo: 1 }, this._state);
if (!('foo' in this._state)) console.warn("<SvelteComponent> was created without expected data property 'foo'");
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
if (options.hydrate) throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); if (options.hydrate) throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, protoDev);
SvelteComponent.prototype._checkReadOnly = function _checkReadOnly(newState) { SvelteComponent.prototype._checkReadOnly = function _checkReadOnly(newState) {
if ('bar' in newState && !this._updatingReadonlyProperty) throw new Error("<SvelteComponent>: Cannot set read-only property 'bar'"); if ('bar' in newState && !this._updatingReadonlyProperty) throw new Error("<SvelteComponent>: Cannot set read-only property 'bar'");
}; };

@ -0,0 +1,72 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createElement, createText, detachNode, init, insertNode, noop, protoDev } from "svelte/shared.js";
function bar({ foo }) {
return foo * 2;
}
function create_main_fragment(component, state) {
var p, text_value = state.Math.max(0, state.foo), text, text_1, text_2;
return {
c: function create() {
p = createElement("p");
text = createText(text_value);
text_1 = createText("\n\t");
text_2 = createText(state.bar);
},
m: function mount(target, anchor) {
insertNode(p, target, anchor);
appendNode(text, p);
appendNode(text_1, p);
appendNode(text_2, p);
},
p: function update(changed, state) {
if ((changed.Math || changed.foo) && text_value !== (text_value = state.Math.max(0, state.foo))) {
text.data = text_value;
}
if (changed.bar) {
text_2.data = state.bar;
}
},
u: function unmount() {
detachNode(p);
},
d: noop
};
}
function SvelteComponent(options) {
this._debugName = '<SvelteComponent>';
if (!options || (!options.target && !options.root)) throw new Error("'target' is a required option");
init(this, options);
this._state = assign({ Math : Math }, options.data);
this._recompute({ foo: 1 }, this._state);
if (!('foo' in this._state)) console.warn("<SvelteComponent> was created without expected data property 'foo'");
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
if (options.hydrate) throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(SvelteComponent.prototype, protoDev);
SvelteComponent.prototype._checkReadOnly = function _checkReadOnly(newState) {
if ('bar' in newState && !this._updatingReadonlyProperty) throw new Error("<SvelteComponent>: Cannot set read-only property 'bar'");
};
SvelteComponent.prototype._recompute = function _recompute(changed, state) {
if (changed.foo) {
if (this._differs(state.bar, (state.bar = bar(state)))) changed.bar = true;
}
}
export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { appendNode, assign, createElement, createText, detachNode, init, insertNode, noop, protoDev } from "svelte/shared.js"; import { ComponentDev, appendNode, assign, createElement, createText, detachNode, insertNode, noop } from "svelte/shared.js";
function bar({ foo }) { function bar({ foo }) {
return foo * 2; return foo * 2;
@ -41,25 +41,25 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends ComponentDev {
this._debugName = '<SvelteComponent>'; constructor(options) {
if (!options || (!options.target && !options.root)) throw new Error("'target' is a required option"); super(options);
init(this, options); this._debugName = '<SvelteComponent>';
this._state = assign({ Math : Math }, options.data); if (!options || (!options.target && !options.root)) throw new Error("'target' is a required option");
this._recompute({ foo: 1 }, this._state); this._state = assign({ Math : Math }, options.data);
if (!('foo' in this._state)) console.warn("<SvelteComponent> was created without expected data property 'foo'"); this._recompute({ foo: 1 }, this._state);
if (!('foo' in this._state)) console.warn("<SvelteComponent> was created without expected data property 'foo'");
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
if (options.hydrate) throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); if (options.hydrate) throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, protoDev);
SvelteComponent.prototype._checkReadOnly = function _checkReadOnly(newState) { SvelteComponent.prototype._checkReadOnly = function _checkReadOnly(newState) {
if ('bar' in newState && !this._updatingReadonlyProperty) throw new Error("<SvelteComponent>: Cannot set read-only property 'bar'"); if ('bar' in newState && !this._updatingReadonlyProperty) throw new Error("<SvelteComponent>: Cannot set read-only property 'bar'");
}; };

@ -25,116 +25,118 @@ function blankObject() {
return Object.create(null); return Object.create(null);
} }
function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function fire(eventName, data) { fire(eventName, data) {
var handlers = const handlers = eventName in this._handlers && this._handlers[eventName].slice();
eventName in this._handlers && this._handlers[eventName].slice(); if (!handlers) return;
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) { for (let i = 0; i < handlers.length; i += 1) {
var handler = handlers[i]; const handler = handlers[i];
if (!handler.__calling) { if (!handler.__calling) {
handler.__calling = true; handler.__calling = true;
handler.call(this, data); handler.call(this, data);
handler.__calling = false; handler.__calling = false;
}
} }
} }
}
function get() { get() {
return this._state; return this._state;
} }
on(eventName, handler) {
const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
function init(component, options) { return {
component._handlers = blankObject(); cancel: function() {
component._bind = options._bind; const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
component.options = options; _differs(a, b) {
component.root = options.root || component; return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
component.store = component.root.store || options.store; }
} }
function on(eventName, handler) { class Component extends Thing {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); constructor(options) {
handlers.push(handler); super();
this._bind = options._bind;
return { this.options = options;
cancel: function() { this.root = options.root || this;
var index = handlers.indexOf(handler); this.store = this.root.store || options.store;
if (~index) handlers.splice(index, 1); }
}
};
}
function set(newState) { destroy(detach) {
this._set(assign({}, newState)); this.destroy = noop;
if (this.root._lock) return; this.fire('destroy');
this.root._lock = true; this.set = this.get = noop;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) { if (detach !== false) this._fragment.u();
var oldState = this._state, this._fragment.d();
changed = {}, this._fragment = this._state = null;
dirty = false; }
for (var key in newState) { set(newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _set(newState) {
this._recompute(changed, this._state); const previous = this._state;
if (this._bind) this._bind(changed, this._state); const changed = {};
let dirty = false;
for (var key in newState) {
if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
}
if (!dirty) return;
this._state = assign(assign({}, previous), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) { if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState }); this.fire("state", { changed, current: this._state, previous });
this._fragment.p(changed, this._state); this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState }); this.fire("update", { changed, current: this._state, previous });
}
} }
}
function callAll(fns) { _mount(target, anchor) {
while (fns && fns.length) fns.shift()(); this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
} }
_recompute() {}
function _mount(target, anchor) { _unmount() {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); if (this._fragment) this._fragment.u();
}
} }
function _unmount() { function _differsImmutable(a, b) {
if (this._fragment) this._fragment.u(); return a != a ? b == b : a !== b;
} }
var proto = { function callAll(fns) {
destroy, while (fns && fns.length) fns.shift()();
get, }
fire,
on,
set,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
@ -176,18 +178,18 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -0,0 +1,55 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
function create_main_fragment(component, state) {
var div, text, div_1;
return {
c: function create() {
div = createElement("div");
text = createText("\n");
div_1 = createElement("div");
this.h();
},
h: function hydrate() {
div.dataset.foo = "bar";
div_1.dataset.foo = state.bar;
},
m: function mount(target, anchor) {
insertNode(div, target, anchor);
insertNode(text, target, anchor);
insertNode(div_1, target, anchor);
},
p: function update(changed, state) {
if (changed.bar) {
div_1.dataset.foo = state.bar;
}
},
u: function unmount() {
detachNode(div);
detachNode(text);
detachNode(div_1);
},
d: noop
};
}
function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { assign, createElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js"; import { Component, assign, createElement, createText, detachNode, insertNode, noop } from "svelte/shared.js";
function create_main_fragment(component, state) { function create_main_fragment(component, state) {
var div, text, div_1; var div, text, div_1;
@ -39,17 +39,17 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -29,116 +29,118 @@ function blankObject() {
return Object.create(null); return Object.create(null);
} }
function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function fire(eventName, data) { fire(eventName, data) {
var handlers = const handlers = eventName in this._handlers && this._handlers[eventName].slice();
eventName in this._handlers && this._handlers[eventName].slice(); if (!handlers) return;
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) { for (let i = 0; i < handlers.length; i += 1) {
var handler = handlers[i]; const handler = handlers[i];
if (!handler.__calling) { if (!handler.__calling) {
handler.__calling = true; handler.__calling = true;
handler.call(this, data); handler.call(this, data);
handler.__calling = false; handler.__calling = false;
}
} }
} }
}
function get() { get() {
return this._state; return this._state;
} }
on(eventName, handler) {
const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
function init(component, options) { return {
component._handlers = blankObject(); cancel: function() {
component._bind = options._bind; const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
component.options = options; _differs(a, b) {
component.root = options.root || component; return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
component.store = component.root.store || options.store; }
} }
function on(eventName, handler) { class Component extends Thing {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); constructor(options) {
handlers.push(handler); super();
this._bind = options._bind;
return { this.options = options;
cancel: function() { this.root = options.root || this;
var index = handlers.indexOf(handler); this.store = this.root.store || options.store;
if (~index) handlers.splice(index, 1); }
}
};
}
function set(newState) { destroy(detach) {
this._set(assign({}, newState)); this.destroy = noop;
if (this.root._lock) return; this.fire('destroy');
this.root._lock = true; this.set = this.get = noop;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) { if (detach !== false) this._fragment.u();
var oldState = this._state, this._fragment.d();
changed = {}, this._fragment = this._state = null;
dirty = false; }
for (var key in newState) { set(newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _set(newState) {
this._recompute(changed, this._state); const previous = this._state;
if (this._bind) this._bind(changed, this._state); const changed = {};
let dirty = false;
for (var key in newState) {
if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
}
if (!dirty) return;
this._state = assign(assign({}, previous), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) { if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState }); this.fire("state", { changed, current: this._state, previous });
this._fragment.p(changed, this._state); this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState }); this.fire("update", { changed, current: this._state, previous });
}
} }
}
function callAll(fns) { _mount(target, anchor) {
while (fns && fns.length) fns.shift()(); this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
} }
_recompute() {}
function _mount(target, anchor) { _unmount() {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); if (this._fragment) this._fragment.u();
}
} }
function _unmount() { function _differsImmutable(a, b) {
if (this._fragment) this._fragment.u(); return a != a ? b == b : a !== b;
} }
var proto = { function callAll(fns) {
destroy, while (fns && fns.length) fns.shift()();
get, }
fire,
on,
set,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
@ -180,18 +182,18 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -0,0 +1,55 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, createText, detachNode, init, insertNode, noop, proto, setAttribute } from "svelte/shared.js";
function create_main_fragment(component, state) {
var div, text, div_1;
return {
c: function create() {
div = createElement("div");
text = createText("\n");
div_1 = createElement("div");
this.h();
},
h: function hydrate() {
setAttribute(div, "data-foo", "bar");
setAttribute(div_1, "data-foo", state.bar);
},
m: function mount(target, anchor) {
insertNode(div, target, anchor);
insertNode(text, target, anchor);
insertNode(div_1, target, anchor);
},
p: function update(changed, state) {
if (changed.bar) {
setAttribute(div_1, "data-foo", state.bar);
}
},
u: function unmount() {
detachNode(div);
detachNode(text);
detachNode(div_1);
},
d: noop
};
}
function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { assign, createElement, createText, detachNode, init, insertNode, noop, proto, setAttribute } from "svelte/shared.js"; import { Component, assign, createElement, createText, detachNode, insertNode, noop, setAttribute } from "svelte/shared.js";
function create_main_fragment(component, state) { function create_main_fragment(component, state) {
var div, text, div_1; var div, text, div_1;
@ -39,17 +39,17 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -29,116 +29,118 @@ function blankObject() {
return Object.create(null); return Object.create(null);
} }
function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function fire(eventName, data) { fire(eventName, data) {
var handlers = const handlers = eventName in this._handlers && this._handlers[eventName].slice();
eventName in this._handlers && this._handlers[eventName].slice(); if (!handlers) return;
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) { for (let i = 0; i < handlers.length; i += 1) {
var handler = handlers[i]; const handler = handlers[i];
if (!handler.__calling) { if (!handler.__calling) {
handler.__calling = true; handler.__calling = true;
handler.call(this, data); handler.call(this, data);
handler.__calling = false; handler.__calling = false;
}
} }
} }
}
function get() { get() {
return this._state; return this._state;
} }
on(eventName, handler) {
const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
function init(component, options) { return {
component._handlers = blankObject(); cancel: function() {
component._bind = options._bind; const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
component.options = options; _differs(a, b) {
component.root = options.root || component; return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
component.store = component.root.store || options.store; }
} }
function on(eventName, handler) { class Component extends Thing {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); constructor(options) {
handlers.push(handler); super();
this._bind = options._bind;
return { this.options = options;
cancel: function() { this.root = options.root || this;
var index = handlers.indexOf(handler); this.store = this.root.store || options.store;
if (~index) handlers.splice(index, 1); }
}
};
}
function set(newState) { destroy(detach) {
this._set(assign({}, newState)); this.destroy = noop;
if (this.root._lock) return; this.fire('destroy');
this.root._lock = true; this.set = this.get = noop;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) { if (detach !== false) this._fragment.u();
var oldState = this._state, this._fragment.d();
changed = {}, this._fragment = this._state = null;
dirty = false; }
for (var key in newState) { set(newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _set(newState) {
this._recompute(changed, this._state); const previous = this._state;
if (this._bind) this._bind(changed, this._state); const changed = {};
let dirty = false;
for (var key in newState) {
if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
}
if (!dirty) return;
this._state = assign(assign({}, previous), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) { if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState }); this.fire("state", { changed, current: this._state, previous });
this._fragment.p(changed, this._state); this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState }); this.fire("update", { changed, current: this._state, previous });
}
} }
}
function callAll(fns) { _mount(target, anchor) {
while (fns && fns.length) fns.shift()(); this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
} }
_recompute() {}
function _mount(target, anchor) { _unmount() {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); if (this._fragment) this._fragment.u();
}
} }
function _unmount() { function _differsImmutable(a, b) {
if (this._fragment) this._fragment.u(); return a != a ? b == b : a !== b;
} }
var proto = { function callAll(fns) {
destroy, while (fns && fns.length) fns.shift()();
get, }
fire,
on,
set,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
@ -178,18 +180,18 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -0,0 +1,53 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createSvgElement, detachNode, init, insertNode, noop, proto, setAttribute } from "svelte/shared.js";
function create_main_fragment(component, state) {
var svg, g, g_1;
return {
c: function create() {
svg = createSvgElement("svg");
g = createSvgElement("g");
g_1 = createSvgElement("g");
this.h();
},
h: function hydrate() {
setAttribute(g, "data-foo", "bar");
setAttribute(g_1, "data-foo", state.bar);
},
m: function mount(target, anchor) {
insertNode(svg, target, anchor);
appendNode(g, svg);
appendNode(g_1, svg);
},
p: function update(changed, state) {
if (changed.bar) {
setAttribute(g_1, "data-foo", state.bar);
}
},
u: function unmount() {
detachNode(svg);
},
d: noop
};
}
function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { appendNode, assign, createSvgElement, detachNode, init, insertNode, noop, proto, setAttribute } from "svelte/shared.js"; import { Component, appendNode, assign, createSvgElement, detachNode, insertNode, noop, setAttribute } from "svelte/shared.js";
function create_main_fragment(component, state) { function create_main_fragment(component, state) {
var svg, g, g_1; var svg, g, g_1;
@ -37,17 +37,17 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -41,116 +41,118 @@ function blankObject() {
return Object.create(null); return Object.create(null);
} }
function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function fire(eventName, data) { fire(eventName, data) {
var handlers = const handlers = eventName in this._handlers && this._handlers[eventName].slice();
eventName in this._handlers && this._handlers[eventName].slice(); if (!handlers) return;
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) { for (let i = 0; i < handlers.length; i += 1) {
var handler = handlers[i]; const handler = handlers[i];
if (!handler.__calling) { if (!handler.__calling) {
handler.__calling = true; handler.__calling = true;
handler.call(this, data); handler.call(this, data);
handler.__calling = false; handler.__calling = false;
}
} }
} }
}
function get() { get() {
return this._state; return this._state;
} }
on(eventName, handler) {
const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
function init(component, options) { return {
component._handlers = blankObject(); cancel: function() {
component._bind = options._bind; const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
component.options = options; _differs(a, b) {
component.root = options.root || component; return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
component.store = component.root.store || options.store; }
} }
function on(eventName, handler) { class Component extends Thing {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); constructor(options) {
handlers.push(handler); super();
this._bind = options._bind;
return { this.options = options;
cancel: function() { this.root = options.root || this;
var index = handlers.indexOf(handler); this.store = this.root.store || options.store;
if (~index) handlers.splice(index, 1); }
}
};
}
function set(newState) { destroy(detach) {
this._set(assign({}, newState)); this.destroy = noop;
if (this.root._lock) return; this.fire('destroy');
this.root._lock = true; this.set = this.get = noop;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) { if (detach !== false) this._fragment.u();
var oldState = this._state, this._fragment.d();
changed = {}, this._fragment = this._state = null;
dirty = false; }
for (var key in newState) { set(newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _set(newState) {
this._recompute(changed, this._state); const previous = this._state;
if (this._bind) this._bind(changed, this._state); const changed = {};
let dirty = false;
for (var key in newState) {
if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
}
if (!dirty) return;
this._state = assign(assign({}, previous), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) { if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState }); this.fire("state", { changed, current: this._state, previous });
this._fragment.p(changed, this._state); this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState }); this.fire("update", { changed, current: this._state, previous });
}
} }
}
function callAll(fns) { _mount(target, anchor) {
while (fns && fns.length) fns.shift()(); this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
} }
_recompute() {}
function _mount(target, anchor) { _unmount() {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); if (this._fragment) this._fragment.u();
}
} }
function _unmount() { function _differsImmutable(a, b) {
if (this._fragment) this._fragment.u(); return a != a ? b == b : a !== b;
} }
var proto = { function callAll(fns) {
destroy, while (fns && fns.length) fns.shift()();
get, }
fire,
on,
set,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
@ -231,7 +233,7 @@ function create_main_fragment(component, state) {
detachNode(p); detachNode(p);
}, },
d: function destroy$$1() { d: function destroy() {
destroyEach(each_blocks); destroyEach(each_blocks);
} }
}; };
@ -306,18 +308,18 @@ function create_each_block(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -0,0 +1,169 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createElement, createText, destroyEach, detachAfter, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
function create_main_fragment(component, state) {
var text, p, text_1;
var each_value = state.comments;
var each_blocks = [];
for (var i = 0; i < each_value.length; i += 1) {
each_blocks[i] = create_each_block(component, assign(assign({}, state), {
each_value: each_value,
comment: each_value[i],
i: i
}));
}
return {
c: function create() {
for (var i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].c();
}
text = createText("\n\n");
p = createElement("p");
text_1 = createText(state.foo);
},
m: function mount(target, anchor) {
for (var i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(target, anchor);
}
insertNode(text, target, anchor);
insertNode(p, target, anchor);
appendNode(text_1, p);
},
p: function update(changed, state) {
var each_value = state.comments;
if (changed.comments || changed.elapsed || changed.time) {
for (var i = 0; i < each_value.length; i += 1) {
var each_context = assign(assign({}, state), {
each_value: each_value,
comment: each_value[i],
i: i
});
if (each_blocks[i]) {
each_blocks[i].p(changed, each_context);
} else {
each_blocks[i] = create_each_block(component, each_context);
each_blocks[i].c();
each_blocks[i].m(text.parentNode, text);
}
}
for (; i < each_blocks.length; i += 1) {
each_blocks[i].u();
each_blocks[i].d();
}
each_blocks.length = each_value.length;
}
if (changed.foo) {
text_1.data = state.foo;
}
},
u: function unmount() {
for (var i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].u();
}
detachNode(text);
detachNode(p);
},
d: function destroy() {
destroyEach(each_blocks);
}
};
}
// (1:0) {#each comments as comment, i}
function create_each_block(component, state) {
var comment = state.comment, each_value = state.each_value, i = state.i;
var div, strong, text, text_1, span, text_2_value = comment.author, text_2, text_3, text_4_value = state.elapsed(comment.time, state.time), text_4, text_5, text_6, raw_value = comment.html, raw_before;
return {
c: function create() {
div = createElement("div");
strong = createElement("strong");
text = createText(i);
text_1 = createText("\n\n\t\t");
span = createElement("span");
text_2 = createText(text_2_value);
text_3 = createText(" wrote ");
text_4 = createText(text_4_value);
text_5 = createText(" ago:");
text_6 = createText("\n\n\t\t");
raw_before = createElement('noscript');
this.h();
},
h: function hydrate() {
span.className = "meta";
div.className = "comment";
},
m: function mount(target, anchor) {
insertNode(div, target, anchor);
appendNode(strong, div);
appendNode(text, strong);
appendNode(text_1, div);
appendNode(span, div);
appendNode(text_2, span);
appendNode(text_3, span);
appendNode(text_4, span);
appendNode(text_5, span);
appendNode(text_6, div);
appendNode(raw_before, div);
raw_before.insertAdjacentHTML("afterend", raw_value);
},
p: function update(changed, state) {
comment = state.comment;
each_value = state.each_value;
i = state.i;
if ((changed.comments) && text_2_value !== (text_2_value = comment.author)) {
text_2.data = text_2_value;
}
if ((changed.elapsed || changed.comments || changed.time) && text_4_value !== (text_4_value = state.elapsed(comment.time, state.time))) {
text_4.data = text_4_value;
}
if ((changed.comments) && raw_value !== (raw_value = comment.html)) {
detachAfter(raw_before);
raw_before.insertAdjacentHTML("afterend", raw_value);
}
},
u: function unmount() {
detachAfter(raw_before);
detachNode(div);
},
d: noop
};
}
function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { appendNode, assign, createElement, createText, destroyEach, detachAfter, detachNode, init, insertNode, noop, proto } from "svelte/shared.js"; import { Component, appendNode, assign, createElement, createText, destroyEach, detachAfter, detachNode, insertNode, noop } from "svelte/shared.js";
function create_main_fragment(component, state) { function create_main_fragment(component, state) {
var text, p, text_1; var text, p, text_1;
@ -153,17 +153,17 @@ function create_each_block(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -21,116 +21,118 @@ function blankObject() {
return Object.create(null); return Object.create(null);
} }
function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function fire(eventName, data) { fire(eventName, data) {
var handlers = const handlers = eventName in this._handlers && this._handlers[eventName].slice();
eventName in this._handlers && this._handlers[eventName].slice(); if (!handlers) return;
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) { for (let i = 0; i < handlers.length; i += 1) {
var handler = handlers[i]; const handler = handlers[i];
if (!handler.__calling) { if (!handler.__calling) {
handler.__calling = true; handler.__calling = true;
handler.call(this, data); handler.call(this, data);
handler.__calling = false; handler.__calling = false;
}
} }
} }
}
function get() { get() {
return this._state; return this._state;
} }
function init(component, options) { on(eventName, handler) {
component._handlers = blankObject(); const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
component._bind = options._bind; handlers.push(handler);
return {
cancel: function() {
const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
component.options = options; _differs(a, b) {
component.root = options.root || component; return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
component.store = component.root.store || options.store; }
} }
function on(eventName, handler) { class Component extends Thing {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); constructor(options) {
handlers.push(handler); super();
this._bind = options._bind;
return { this.options = options;
cancel: function() { this.root = options.root || this;
var index = handlers.indexOf(handler); this.store = this.root.store || options.store;
if (~index) handlers.splice(index, 1); }
}
};
}
function set(newState) { destroy(detach) {
this._set(assign({}, newState)); this.destroy = noop;
if (this.root._lock) return; this.fire('destroy');
this.root._lock = true; this.set = this.get = noop;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) { if (detach !== false) this._fragment.u();
var oldState = this._state, this._fragment.d();
changed = {}, this._fragment = this._state = null;
dirty = false; }
for (var key in newState) { set(newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _set(newState) {
this._recompute(changed, this._state); const previous = this._state;
if (this._bind) this._bind(changed, this._state); const changed = {};
let dirty = false;
if (this._fragment) { for (var key in newState) {
this.fire("state", { changed: changed, current: this._state, previous: oldState }); if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
this._fragment.p(changed, this._state); }
this.fire("update", { changed: changed, current: this._state, previous: oldState });
if (!dirty) return;
this._state = assign(assign({}, previous), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed, current: this._state, previous });
this._fragment.p(changed, this._state);
this.fire("update", { changed, current: this._state, previous });
}
} }
}
function callAll(fns) { _mount(target, anchor) {
while (fns && fns.length) fns.shift()(); this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
} }
_recompute() {}
function _mount(target, anchor) { _unmount() {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); if (this._fragment) this._fragment.u();
}
} }
function _unmount() { function _differsImmutable(a, b) {
if (this._fragment) this._fragment.u(); return a != a ? b == b : a !== b;
} }
var proto = { function callAll(fns) {
destroy, while (fns && fns.length) fns.shift()();
get, }
fire,
on,
set,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
@ -170,25 +172,26 @@ function create_main_fragment(component, state) {
detachNode(button); detachNode(button);
}, },
d: function destroy$$1() { d: function destroy() {
foo_handler.destroy(); foo_handler.destroy();
} }
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
assign(SvelteComponent.prototype, methods); assign(SvelteComponent.prototype, methods);
export default SvelteComponent; export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insertNode, noop, proto } from "svelte/shared.js"; import { Component, assign, createElement, detachNode, insertNode, noop } from "svelte/shared.js";
function foo( node, callback ) { function foo( node, callback ) {
// code goes here // code goes here
@ -44,18 +44,19 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
assign(SvelteComponent.prototype, methods); assign(SvelteComponent.prototype, methods);
export default SvelteComponent; export default SvelteComponent;

@ -21,116 +21,118 @@ function blankObject() {
return Object.create(null); return Object.create(null);
} }
function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function fire(eventName, data) { fire(eventName, data) {
var handlers = const handlers = eventName in this._handlers && this._handlers[eventName].slice();
eventName in this._handlers && this._handlers[eventName].slice(); if (!handlers) return;
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) { for (let i = 0; i < handlers.length; i += 1) {
var handler = handlers[i]; const handler = handlers[i];
if (!handler.__calling) { if (!handler.__calling) {
handler.__calling = true; handler.__calling = true;
handler.call(this, data); handler.call(this, data);
handler.__calling = false; handler.__calling = false;
}
} }
} }
}
function get() { get() {
return this._state; return this._state;
} }
function init(component, options) { on(eventName, handler) {
component._handlers = blankObject(); const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
component._bind = options._bind; handlers.push(handler);
return {
cancel: function() {
const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
component.options = options; _differs(a, b) {
component.root = options.root || component; return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
component.store = component.root.store || options.store; }
} }
function on(eventName, handler) { class Component extends Thing {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); constructor(options) {
handlers.push(handler); super();
this._bind = options._bind;
return { this.options = options;
cancel: function() { this.root = options.root || this;
var index = handlers.indexOf(handler); this.store = this.root.store || options.store;
if (~index) handlers.splice(index, 1); }
}
};
}
function set(newState) { destroy(detach) {
this._set(assign({}, newState)); this.destroy = noop;
if (this.root._lock) return; this.fire('destroy');
this.root._lock = true; this.set = this.get = noop;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) { if (detach !== false) this._fragment.u();
var oldState = this._state, this._fragment.d();
changed = {}, this._fragment = this._state = null;
dirty = false; }
for (var key in newState) { set(newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _set(newState) {
this._recompute(changed, this._state); const previous = this._state;
if (this._bind) this._bind(changed, this._state); const changed = {};
let dirty = false;
if (this._fragment) { for (var key in newState) {
this.fire("state", { changed: changed, current: this._state, previous: oldState }); if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
this._fragment.p(changed, this._state); }
this.fire("update", { changed: changed, current: this._state, previous: oldState });
if (!dirty) return;
this._state = assign(assign({}, previous), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed, current: this._state, previous });
this._fragment.p(changed, this._state);
this.fire("update", { changed, current: this._state, previous });
}
} }
}
function callAll(fns) { _mount(target, anchor) {
while (fns && fns.length) fns.shift()(); this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
} }
_recompute() {}
function _mount(target, anchor) { _unmount() {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); if (this._fragment) this._fragment.u();
}
} }
function _unmount() { function _differsImmutable(a, b) {
if (this._fragment) this._fragment.u(); return a != a ? b == b : a !== b;
} }
var proto = { function callAll(fns) {
destroy, while (fns && fns.length) fns.shift()();
get, }
fire,
on,
set,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
@ -167,18 +169,18 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -0,0 +1,50 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createElement, detachNode, init, noop, proto } from "svelte/shared.js";
function create_main_fragment(component, state) {
var meta, meta_1;
return {
c: function create() {
meta = createElement("meta");
meta_1 = createElement("meta");
this.h();
},
h: function hydrate() {
meta.name = "twitter:creator";
meta.content = "@sveltejs";
meta_1.name = "twitter:title";
meta_1.content = "Svelte";
},
m: function mount(target, anchor) {
appendNode(meta, document.head);
appendNode(meta_1, document.head);
},
p: noop,
u: function unmount() {
detachNode(meta);
detachNode(meta_1);
},
d: noop
};
}
function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { appendNode, assign, createElement, detachNode, init, noop, proto } from "svelte/shared.js"; import { Component, appendNode, assign, createElement, detachNode, noop } from "svelte/shared.js";
function create_main_fragment(component, state) { function create_main_fragment(component, state) {
var meta, meta_1; var meta, meta_1;
@ -34,17 +34,17 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -25,116 +25,118 @@ function blankObject() {
return Object.create(null); return Object.create(null);
} }
function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function fire(eventName, data) { fire(eventName, data) {
var handlers = const handlers = eventName in this._handlers && this._handlers[eventName].slice();
eventName in this._handlers && this._handlers[eventName].slice(); if (!handlers) return;
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) { for (let i = 0; i < handlers.length; i += 1) {
var handler = handlers[i]; const handler = handlers[i];
if (!handler.__calling) { if (!handler.__calling) {
handler.__calling = true; handler.__calling = true;
handler.call(this, data); handler.call(this, data);
handler.__calling = false; handler.__calling = false;
}
} }
} }
}
function get() { get() {
return this._state; return this._state;
} }
on(eventName, handler) {
const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
function init(component, options) { return {
component._handlers = blankObject(); cancel: function() {
component._bind = options._bind; const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
component.options = options; _differs(a, b) {
component.root = options.root || component; return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
component.store = component.root.store || options.store; }
} }
function on(eventName, handler) { class Component extends Thing {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); constructor(options) {
handlers.push(handler); super();
this._bind = options._bind;
return { this.options = options;
cancel: function() { this.root = options.root || this;
var index = handlers.indexOf(handler); this.store = this.root.store || options.store;
if (~index) handlers.splice(index, 1); }
}
};
}
function set(newState) { destroy(detach) {
this._set(assign({}, newState)); this.destroy = noop;
if (this.root._lock) return; this.fire('destroy');
this.root._lock = true; this.set = this.get = noop;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) { if (detach !== false) this._fragment.u();
var oldState = this._state, this._fragment.d();
changed = {}, this._fragment = this._state = null;
dirty = false; }
for (var key in newState) { set(newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _set(newState) {
this._recompute(changed, this._state); const previous = this._state;
if (this._bind) this._bind(changed, this._state); const changed = {};
let dirty = false;
for (var key in newState) {
if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
}
if (!dirty) return;
this._state = assign(assign({}, previous), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) { if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState }); this.fire("state", { changed, current: this._state, previous });
this._fragment.p(changed, this._state); this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState }); this.fire("update", { changed, current: this._state, previous });
}
} }
}
function callAll(fns) { _mount(target, anchor) {
while (fns && fns.length) fns.shift()(); this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
} }
_recompute() {}
function _mount(target, anchor) { _unmount() {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); if (this._fragment) this._fragment.u();
}
} }
function _unmount() { function _differsImmutable(a, b) {
if (this._fragment) this._fragment.u(); return a != a ? b == b : a !== b;
} }
var proto = { function callAll(fns) {
destroy, while (fns && fns.length) fns.shift()();
get, }
fire,
on,
set,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
@ -175,7 +177,7 @@ function create_main_fragment(component, state) {
detachNode(if_block_anchor); detachNode(if_block_anchor);
}, },
d: function destroy$$1() { d: function destroy() {
if_block.d(); if_block.d();
} }
}; };
@ -225,18 +227,18 @@ function create_if_block_1(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -0,0 +1,104 @@
/* generated by Svelte vX.Y.Z */
import { assign, createComment, createElement, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
function create_main_fragment(component, state) {
var if_block_anchor;
function select_block_type(state) {
if (state.foo) return create_if_block;
return create_if_block_1;
}
var current_block_type = select_block_type(state);
var if_block = current_block_type(component, state);
return {
c: function create() {
if_block.c();
if_block_anchor = createComment();
},
m: function mount(target, anchor) {
if_block.m(target, anchor);
insertNode(if_block_anchor, target, anchor);
},
p: function update(changed, state) {
if (current_block_type !== (current_block_type = select_block_type(state))) {
if_block.u();
if_block.d();
if_block = current_block_type(component, state);
if_block.c();
if_block.m(if_block_anchor.parentNode, if_block_anchor);
}
},
u: function unmount() {
if_block.u();
detachNode(if_block_anchor);
},
d: function destroy() {
if_block.d();
}
};
}
// (1:0) {#if foo}
function create_if_block(component, state) {
var p;
return {
c: function create() {
p = createElement("p");
p.textContent = "foo!";
},
m: function mount(target, anchor) {
insertNode(p, target, anchor);
},
u: function unmount() {
detachNode(p);
},
d: noop
};
}
// (3:0) {:else}
function create_if_block_1(component, state) {
var p;
return {
c: function create() {
p = createElement("p");
p.textContent = "not foo!";
},
m: function mount(target, anchor) {
insertNode(p, target, anchor);
},
u: function unmount() {
detachNode(p);
},
d: noop
};
}
function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { assign, createComment, createElement, detachNode, init, insertNode, noop, proto } from "svelte/shared.js"; import { Component, assign, createComment, createElement, detachNode, insertNode, noop } from "svelte/shared.js";
function create_main_fragment(component, state) { function create_main_fragment(component, state) {
var if_block_anchor; var if_block_anchor;
@ -88,17 +88,17 @@ function create_if_block_1(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -25,116 +25,118 @@ function blankObject() {
return Object.create(null); return Object.create(null);
} }
function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function fire(eventName, data) { fire(eventName, data) {
var handlers = const handlers = eventName in this._handlers && this._handlers[eventName].slice();
eventName in this._handlers && this._handlers[eventName].slice(); if (!handlers) return;
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) { for (let i = 0; i < handlers.length; i += 1) {
var handler = handlers[i]; const handler = handlers[i];
if (!handler.__calling) { if (!handler.__calling) {
handler.__calling = true; handler.__calling = true;
handler.call(this, data); handler.call(this, data);
handler.__calling = false; handler.__calling = false;
}
} }
} }
}
function get() { get() {
return this._state; return this._state;
} }
on(eventName, handler) {
const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
function init(component, options) { return {
component._handlers = blankObject(); cancel: function() {
component._bind = options._bind; const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
component.options = options; _differs(a, b) {
component.root = options.root || component; return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
component.store = component.root.store || options.store; }
} }
function on(eventName, handler) { class Component extends Thing {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); constructor(options) {
handlers.push(handler); super();
this._bind = options._bind;
return { this.options = options;
cancel: function() { this.root = options.root || this;
var index = handlers.indexOf(handler); this.store = this.root.store || options.store;
if (~index) handlers.splice(index, 1); }
}
};
}
function set(newState) { destroy(detach) {
this._set(assign({}, newState)); this.destroy = noop;
if (this.root._lock) return; this.fire('destroy');
this.root._lock = true; this.set = this.get = noop;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) { if (detach !== false) this._fragment.u();
var oldState = this._state, this._fragment.d();
changed = {}, this._fragment = this._state = null;
dirty = false; }
for (var key in newState) { set(newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _set(newState) {
this._recompute(changed, this._state); const previous = this._state;
if (this._bind) this._bind(changed, this._state); const changed = {};
let dirty = false;
for (var key in newState) {
if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
}
if (!dirty) return;
this._state = assign(assign({}, previous), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) { if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState }); this.fire("state", { changed, current: this._state, previous });
this._fragment.p(changed, this._state); this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState }); this.fire("update", { changed, current: this._state, previous });
}
} }
}
function callAll(fns) { _mount(target, anchor) {
while (fns && fns.length) fns.shift()(); this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
} }
_recompute() {}
function _mount(target, anchor) { _unmount() {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); if (this._fragment) this._fragment.u();
}
} }
function _unmount() { function _differsImmutable(a, b) {
if (this._fragment) this._fragment.u(); return a != a ? b == b : a !== b;
} }
var proto = { function callAll(fns) {
destroy, while (fns && fns.length) fns.shift()();
get, }
fire,
on,
set,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
@ -173,7 +175,7 @@ function create_main_fragment(component, state) {
detachNode(if_block_anchor); detachNode(if_block_anchor);
}, },
d: function destroy$$1() { d: function destroy() {
if (if_block) if_block.d(); if (if_block) if_block.d();
} }
}; };
@ -201,18 +203,18 @@ function create_if_block(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -0,0 +1,80 @@
/* generated by Svelte vX.Y.Z */
import { assign, createComment, createElement, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
function create_main_fragment(component, state) {
var if_block_anchor;
var if_block = (state.foo) && create_if_block(component, state);
return {
c: function create() {
if (if_block) if_block.c();
if_block_anchor = createComment();
},
m: function mount(target, anchor) {
if (if_block) if_block.m(target, anchor);
insertNode(if_block_anchor, target, anchor);
},
p: function update(changed, state) {
if (state.foo) {
if (!if_block) {
if_block = create_if_block(component, state);
if_block.c();
if_block.m(if_block_anchor.parentNode, if_block_anchor);
}
} else if (if_block) {
if_block.u();
if_block.d();
if_block = null;
}
},
u: function unmount() {
if (if_block) if_block.u();
detachNode(if_block_anchor);
},
d: function destroy() {
if (if_block) if_block.d();
}
};
}
// (1:0) {#if foo}
function create_if_block(component, state) {
var p;
return {
c: function create() {
p = createElement("p");
p.textContent = "foo!";
},
m: function mount(target, anchor) {
insertNode(p, target, anchor);
},
u: function unmount() {
detachNode(p);
},
d: noop
};
}
function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { assign, createComment, createElement, detachNode, init, insertNode, noop, proto } from "svelte/shared.js"; import { Component, assign, createComment, createElement, detachNode, insertNode, noop } from "svelte/shared.js";
function create_main_fragment(component, state) { function create_main_fragment(component, state) {
var if_block_anchor; var if_block_anchor;
@ -64,17 +64,17 @@ function create_if_block(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -25,116 +25,118 @@ function blankObject() {
return Object.create(null); return Object.create(null);
} }
function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function fire(eventName, data) { fire(eventName, data) {
var handlers = const handlers = eventName in this._handlers && this._handlers[eventName].slice();
eventName in this._handlers && this._handlers[eventName].slice(); if (!handlers) return;
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) { for (let i = 0; i < handlers.length; i += 1) {
var handler = handlers[i]; const handler = handlers[i];
if (!handler.__calling) { if (!handler.__calling) {
handler.__calling = true; handler.__calling = true;
handler.call(this, data); handler.call(this, data);
handler.__calling = false; handler.__calling = false;
}
} }
} }
}
function get() { get() {
return this._state; return this._state;
} }
on(eventName, handler) {
const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
function init(component, options) { return {
component._handlers = blankObject(); cancel: function() {
component._bind = options._bind; const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
component.options = options; _differs(a, b) {
component.root = options.root || component; return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
component.store = component.root.store || options.store; }
} }
function on(eventName, handler) { class Component extends Thing {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); constructor(options) {
handlers.push(handler); super();
this._bind = options._bind;
return { this.options = options;
cancel: function() { this.root = options.root || this;
var index = handlers.indexOf(handler); this.store = this.root.store || options.store;
if (~index) handlers.splice(index, 1); }
}
};
}
function set(newState) { destroy(detach) {
this._set(assign({}, newState)); this.destroy = noop;
if (this.root._lock) return; this.fire('destroy');
this.root._lock = true; this.set = this.get = noop;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) { if (detach !== false) this._fragment.u();
var oldState = this._state, this._fragment.d();
changed = {}, this._fragment = this._state = null;
dirty = false; }
for (var key in newState) { set(newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _set(newState) {
this._recompute(changed, this._state); const previous = this._state;
if (this._bind) this._bind(changed, this._state); const changed = {};
let dirty = false;
for (var key in newState) {
if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
}
if (!dirty) return;
this._state = assign(assign({}, previous), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) { if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState }); this.fire("state", { changed, current: this._state, previous });
this._fragment.p(changed, this._state); this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState }); this.fire("update", { changed, current: this._state, previous });
}
} }
}
function callAll(fns) { _mount(target, anchor) {
while (fns && fns.length) fns.shift()(); this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
} }
_recompute() {}
function _mount(target, anchor) { _unmount() {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); if (this._fragment) this._fragment.u();
}
} }
function _unmount() { function _differsImmutable(a, b) {
if (this._fragment) this._fragment.u(); return a != a ? b == b : a !== b;
} }
var proto = { function callAll(fns) {
destroy, while (fns && fns.length) fns.shift()();
get, }
fire,
on,
set,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
@ -174,18 +176,18 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -0,0 +1,53 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insertNode, noop, proto, setStyle } from "svelte/shared.js";
function create_main_fragment(component, state) {
var div;
return {
c: function create() {
div = createElement("div");
this.h();
},
h: function hydrate() {
setStyle(div, "color", state.color);
setStyle(div, "transform", "translate(" + state.x + "px," + state.y + "px)");
},
m: function mount(target, anchor) {
insertNode(div, target, anchor);
},
p: function update(changed, state) {
if (changed.color) {
setStyle(div, "color", state.color);
}
if (changed.x || changed.y) {
setStyle(div, "transform", "translate(" + state.x + "px," + state.y + "px)");
}
},
u: function unmount() {
detachNode(div);
},
d: noop
};
}
function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insertNode, noop, proto, setStyle } from "svelte/shared.js"; import { Component, assign, createElement, detachNode, insertNode, noop, setStyle } from "svelte/shared.js";
function create_main_fragment(component, state) { function create_main_fragment(component, state) {
var div; var div;
@ -37,17 +37,17 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -25,116 +25,118 @@ function blankObject() {
return Object.create(null); return Object.create(null);
} }
function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function fire(eventName, data) { fire(eventName, data) {
var handlers = const handlers = eventName in this._handlers && this._handlers[eventName].slice();
eventName in this._handlers && this._handlers[eventName].slice(); if (!handlers) return;
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) { for (let i = 0; i < handlers.length; i += 1) {
var handler = handlers[i]; const handler = handlers[i];
if (!handler.__calling) { if (!handler.__calling) {
handler.__calling = true; handler.__calling = true;
handler.call(this, data); handler.call(this, data);
handler.__calling = false; handler.__calling = false;
}
} }
} }
}
function get() { get() {
return this._state; return this._state;
} }
on(eventName, handler) {
const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
function init(component, options) { return {
component._handlers = blankObject(); cancel: function() {
component._bind = options._bind; const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
component.options = options; _differs(a, b) {
component.root = options.root || component; return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
component.store = component.root.store || options.store; }
} }
function on(eventName, handler) { class Component extends Thing {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); constructor(options) {
handlers.push(handler); super();
this._bind = options._bind;
return { this.options = options;
cancel: function() { this.root = options.root || this;
var index = handlers.indexOf(handler); this.store = this.root.store || options.store;
if (~index) handlers.splice(index, 1); }
}
};
}
function set(newState) { destroy(detach) {
this._set(assign({}, newState)); this.destroy = noop;
if (this.root._lock) return; this.fire('destroy');
this.root._lock = true; this.set = this.get = noop;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) { if (detach !== false) this._fragment.u();
var oldState = this._state, this._fragment.d();
changed = {}, this._fragment = this._state = null;
dirty = false; }
for (var key in newState) { set(newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _set(newState) {
this._recompute(changed, this._state); const previous = this._state;
if (this._bind) this._bind(changed, this._state); const changed = {};
let dirty = false;
for (var key in newState) {
if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
}
if (!dirty) return;
this._state = assign(assign({}, previous), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) { if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState }); this.fire("state", { changed, current: this._state, previous });
this._fragment.p(changed, this._state); this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState }); this.fire("update", { changed, current: this._state, previous });
}
} }
}
function callAll(fns) { _mount(target, anchor) {
while (fns && fns.length) fns.shift()(); this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
} }
_recompute() {}
function _mount(target, anchor) { _unmount() {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); if (this._fragment) this._fragment.u();
}
} }
function _unmount() { function _differsImmutable(a, b) {
if (this._fragment) this._fragment.u(); return a != a ? b == b : a !== b;
} }
var proto = { function callAll(fns) {
destroy, while (fns && fns.length) fns.shift()();
get, }
fire,
on,
set,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
@ -169,18 +171,18 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -0,0 +1,48 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insertNode, noop, proto, setStyle } from "svelte/shared.js";
function create_main_fragment(component, state) {
var div;
return {
c: function create() {
div = createElement("div");
this.h();
},
h: function hydrate() {
setStyle(div, "background", "url(data:image/png;base64," + state.data + ")");
},
m: function mount(target, anchor) {
insertNode(div, target, anchor);
},
p: function update(changed, state) {
if (changed.data) {
setStyle(div, "background", "url(data:image/png;base64," + state.data + ")");
}
},
u: function unmount() {
detachNode(div);
},
d: noop
};
}
function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insertNode, noop, proto, setStyle } from "svelte/shared.js"; import { Component, assign, createElement, detachNode, insertNode, noop, setStyle } from "svelte/shared.js";
function create_main_fragment(component, state) { function create_main_fragment(component, state) {
var div; var div;
@ -32,17 +32,17 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -25,116 +25,118 @@ function blankObject() {
return Object.create(null); return Object.create(null);
} }
function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function fire(eventName, data) { fire(eventName, data) {
var handlers = const handlers = eventName in this._handlers && this._handlers[eventName].slice();
eventName in this._handlers && this._handlers[eventName].slice(); if (!handlers) return;
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) { for (let i = 0; i < handlers.length; i += 1) {
var handler = handlers[i]; const handler = handlers[i];
if (!handler.__calling) { if (!handler.__calling) {
handler.__calling = true; handler.__calling = true;
handler.call(this, data); handler.call(this, data);
handler.__calling = false; handler.__calling = false;
}
} }
} }
}
function get() { get() {
return this._state; return this._state;
} }
on(eventName, handler) {
const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
function init(component, options) { return {
component._handlers = blankObject(); cancel: function() {
component._bind = options._bind; const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
component.options = options; _differs(a, b) {
component.root = options.root || component; return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
component.store = component.root.store || options.store; }
} }
function on(eventName, handler) { class Component extends Thing {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); constructor(options) {
handlers.push(handler); super();
this._bind = options._bind;
return { this.options = options;
cancel: function() { this.root = options.root || this;
var index = handlers.indexOf(handler); this.store = this.root.store || options.store;
if (~index) handlers.splice(index, 1); }
}
};
}
function set(newState) { destroy(detach) {
this._set(assign({}, newState)); this.destroy = noop;
if (this.root._lock) return; this.fire('destroy');
this.root._lock = true; this.set = this.get = noop;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) { if (detach !== false) this._fragment.u();
var oldState = this._state, this._fragment.d();
changed = {}, this._fragment = this._state = null;
dirty = false; }
for (var key in newState) { set(newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _set(newState) {
this._recompute(changed, this._state); const previous = this._state;
if (this._bind) this._bind(changed, this._state); const changed = {};
let dirty = false;
for (var key in newState) {
if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
}
if (!dirty) return;
this._state = assign(assign({}, previous), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) { if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState }); this.fire("state", { changed, current: this._state, previous });
this._fragment.p(changed, this._state); this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState }); this.fire("update", { changed, current: this._state, previous });
}
} }
}
function callAll(fns) { _mount(target, anchor) {
while (fns && fns.length) fns.shift()(); this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
} }
_recompute() {}
function _mount(target, anchor) { _unmount() {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); if (this._fragment) this._fragment.u();
}
} }
function _unmount() { function _differsImmutable(a, b) {
if (this._fragment) this._fragment.u(); return a != a ? b == b : a !== b;
} }
var proto = { function callAll(fns) {
destroy, while (fns && fns.length) fns.shift()();
get, }
fire,
on,
set,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
@ -169,18 +171,18 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -0,0 +1,48 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insertNode, noop, proto, setStyle } from "svelte/shared.js";
function create_main_fragment(component, state) {
var div;
return {
c: function create() {
div = createElement("div");
this.h();
},
h: function hydrate() {
setStyle(div, "color", state.color);
},
m: function mount(target, anchor) {
insertNode(div, target, anchor);
},
p: function update(changed, state) {
if (changed.color) {
setStyle(div, "color", state.color);
}
},
u: function unmount() {
detachNode(div);
},
d: noop
};
}
function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insertNode, noop, proto, setStyle } from "svelte/shared.js"; import { Component, assign, createElement, detachNode, insertNode, noop, setStyle } from "svelte/shared.js";
function create_main_fragment(component, state) { function create_main_fragment(component, state) {
var div; var div;
@ -32,17 +32,17 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -25,116 +25,118 @@ function blankObject() {
return Object.create(null); return Object.create(null);
} }
function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function fire(eventName, data) { fire(eventName, data) {
var handlers = const handlers = eventName in this._handlers && this._handlers[eventName].slice();
eventName in this._handlers && this._handlers[eventName].slice(); if (!handlers) return;
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) { for (let i = 0; i < handlers.length; i += 1) {
var handler = handlers[i]; const handler = handlers[i];
if (!handler.__calling) { if (!handler.__calling) {
handler.__calling = true; handler.__calling = true;
handler.call(this, data); handler.call(this, data);
handler.__calling = false; handler.__calling = false;
}
} }
} }
}
function get() { get() {
return this._state; return this._state;
} }
on(eventName, handler) {
const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
function init(component, options) { return {
component._handlers = blankObject(); cancel: function() {
component._bind = options._bind; const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
component.options = options; _differs(a, b) {
component.root = options.root || component; return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
component.store = component.root.store || options.store; }
} }
function on(eventName, handler) { class Component extends Thing {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); constructor(options) {
handlers.push(handler); super();
this._bind = options._bind;
return { this.options = options;
cancel: function() { this.root = options.root || this;
var index = handlers.indexOf(handler); this.store = this.root.store || options.store;
if (~index) handlers.splice(index, 1); }
}
};
}
function set(newState) { destroy(detach) {
this._set(assign({}, newState)); this.destroy = noop;
if (this.root._lock) return; this.fire('destroy');
this.root._lock = true; this.set = this.get = noop;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) { if (detach !== false) this._fragment.u();
var oldState = this._state, this._fragment.d();
changed = {}, this._fragment = this._state = null;
dirty = false; }
for (var key in newState) { set(newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _set(newState) {
this._recompute(changed, this._state); const previous = this._state;
if (this._bind) this._bind(changed, this._state); const changed = {};
let dirty = false;
for (var key in newState) {
if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
}
if (!dirty) return;
this._state = assign(assign({}, previous), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) { if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState }); this.fire("state", { changed, current: this._state, previous });
this._fragment.p(changed, this._state); this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState }); this.fire("update", { changed, current: this._state, previous });
}
} }
}
function callAll(fns) { _mount(target, anchor) {
while (fns && fns.length) fns.shift()(); this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
} }
_recompute() {}
function _mount(target, anchor) { _unmount() {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); if (this._fragment) this._fragment.u();
}
} }
function _unmount() { function _differsImmutable(a, b) {
if (this._fragment) this._fragment.u(); return a != a ? b == b : a !== b;
} }
var proto = { function callAll(fns) {
destroy, while (fns && fns.length) fns.shift()();
get, }
fire,
on,
set,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
@ -180,18 +182,18 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -0,0 +1,59 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
function create_main_fragment(component, state) {
var div, text, div_1, div_1_style_value;
return {
c: function create() {
div = createElement("div");
text = createText("\n");
div_1 = createElement("div");
this.h();
},
h: function hydrate() {
div.style.cssText = state.style;
div_1.style.cssText = div_1_style_value = "" + state.key + ": " + state.value;
},
m: function mount(target, anchor) {
insertNode(div, target, anchor);
insertNode(text, target, anchor);
insertNode(div_1, target, anchor);
},
p: function update(changed, state) {
if (changed.style) {
div.style.cssText = state.style;
}
if ((changed.key || changed.value) && div_1_style_value !== (div_1_style_value = "" + state.key + ": " + state.value)) {
div_1.style.cssText = div_1_style_value;
}
},
u: function unmount() {
detachNode(div);
detachNode(text);
detachNode(div_1);
},
d: noop
};
}
function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { assign, createElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js"; import { Component, assign, createElement, createText, detachNode, insertNode, noop } from "svelte/shared.js";
function create_main_fragment(component, state) { function create_main_fragment(component, state) {
var div, text, div_1, div_1_style_value; var div, text, div_1, div_1_style_value;
@ -43,17 +43,17 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -33,116 +33,118 @@ function blankObject() {
return Object.create(null); return Object.create(null);
} }
function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function fire(eventName, data) { fire(eventName, data) {
var handlers = const handlers = eventName in this._handlers && this._handlers[eventName].slice();
eventName in this._handlers && this._handlers[eventName].slice(); if (!handlers) return;
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) { for (let i = 0; i < handlers.length; i += 1) {
var handler = handlers[i]; const handler = handlers[i];
if (!handler.__calling) { if (!handler.__calling) {
handler.__calling = true; handler.__calling = true;
handler.call(this, data); handler.call(this, data);
handler.__calling = false; handler.__calling = false;
}
} }
} }
}
function get() { get() {
return this._state; return this._state;
} }
function init(component, options) { on(eventName, handler) {
component._handlers = blankObject(); const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
component._bind = options._bind; handlers.push(handler);
return {
cancel: function() {
const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
component.options = options; _differs(a, b) {
component.root = options.root || component; return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
component.store = component.root.store || options.store; }
} }
function on(eventName, handler) { class Component extends Thing {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); constructor(options) {
handlers.push(handler); super();
this._bind = options._bind;
return { this.options = options;
cancel: function() { this.root = options.root || this;
var index = handlers.indexOf(handler); this.store = this.root.store || options.store;
if (~index) handlers.splice(index, 1); }
}
};
}
function set(newState) { destroy(detach) {
this._set(assign({}, newState)); this.destroy = noop;
if (this.root._lock) return; this.fire('destroy');
this.root._lock = true; this.set = this.get = noop;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) { if (detach !== false) this._fragment.u();
var oldState = this._state, this._fragment.d();
changed = {}, this._fragment = this._state = null;
dirty = false; }
for (var key in newState) { set(newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _set(newState) {
this._recompute(changed, this._state); const previous = this._state;
if (this._bind) this._bind(changed, this._state); const changed = {};
let dirty = false;
if (this._fragment) { for (var key in newState) {
this.fire("state", { changed: changed, current: this._state, previous: oldState }); if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
this._fragment.p(changed, this._state); }
this.fire("update", { changed: changed, current: this._state, previous: oldState });
if (!dirty) return;
this._state = assign(assign({}, previous), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed, current: this._state, previous });
this._fragment.p(changed, this._state);
this.fire("update", { changed, current: this._state, previous });
}
} }
}
function callAll(fns) { _mount(target, anchor) {
while (fns && fns.length) fns.shift()(); this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
} }
_recompute() {}
function _mount(target, anchor) { _unmount() {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); if (this._fragment) this._fragment.u();
}
} }
function _unmount() { function _differsImmutable(a, b) {
if (this._fragment) this._fragment.u(); return a != a ? b == b : a !== b;
} }
var proto = { function callAll(fns) {
destroy, while (fns && fns.length) fns.shift()();
get, }
fire,
on,
set,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
@ -178,24 +180,24 @@ function create_main_fragment(component, state) {
detachNode(input); detachNode(input);
}, },
d: function destroy$$1() { d: function destroy() {
removeListener(input, "change", input_change_handler); removeListener(input, "change", input_change_handler);
} }
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { addListener, assign, createElement, detachNode, init, insertNode, proto, removeListener, setAttribute } from "svelte/shared.js"; import { Component, addListener, assign, createElement, detachNode, insertNode, removeListener, setAttribute } from "svelte/shared.js";
function create_main_fragment(component, state) { function create_main_fragment(component, state) {
var input; var input;
@ -39,17 +39,17 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -27,116 +27,118 @@ function blankObject() {
return Object.create(null); return Object.create(null);
} }
function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function fire(eventName, data) { fire(eventName, data) {
var handlers = const handlers = eventName in this._handlers && this._handlers[eventName].slice();
eventName in this._handlers && this._handlers[eventName].slice(); if (!handlers) return;
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) { for (let i = 0; i < handlers.length; i += 1) {
var handler = handlers[i]; const handler = handlers[i];
if (!handler.__calling) { if (!handler.__calling) {
handler.__calling = true; handler.__calling = true;
handler.call(this, data); handler.call(this, data);
handler.__calling = false; handler.__calling = false;
}
} }
} }
}
function get() { get() {
return this._state; return this._state;
} }
function init(component, options) { on(eventName, handler) {
component._handlers = blankObject(); const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
component._bind = options._bind; handlers.push(handler);
return {
cancel: function() {
const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
component.options = options; _differs(a, b) {
component.root = options.root || component; return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
component.store = component.root.store || options.store; }
} }
function on(eventName, handler) { class Component extends Thing {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); constructor(options) {
handlers.push(handler); super();
this._bind = options._bind;
return { this.options = options;
cancel: function() { this.root = options.root || this;
var index = handlers.indexOf(handler); this.store = this.root.store || options.store;
if (~index) handlers.splice(index, 1); }
}
};
}
function set(newState) { destroy(detach) {
this._set(assign({}, newState)); this.destroy = noop;
if (this.root._lock) return; this.fire('destroy');
this.root._lock = true; this.set = this.get = noop;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) { if (detach !== false) this._fragment.u();
var oldState = this._state, this._fragment.d();
changed = {}, this._fragment = this._state = null;
dirty = false; }
for (var key in newState) { set(newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _set(newState) {
this._recompute(changed, this._state); const previous = this._state;
if (this._bind) this._bind(changed, this._state); const changed = {};
let dirty = false;
if (this._fragment) { for (var key in newState) {
this.fire("state", { changed: changed, current: this._state, previous: oldState }); if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
this._fragment.p(changed, this._state); }
this.fire("update", { changed: changed, current: this._state, previous: oldState });
if (!dirty) return;
this._state = assign(assign({}, previous), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed, current: this._state, previous });
this._fragment.p(changed, this._state);
this.fire("update", { changed, current: this._state, previous });
}
} }
}
function callAll(fns) { _mount(target, anchor) {
while (fns && fns.length) fns.shift()(); this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
} }
_recompute() {}
function _mount(target, anchor) { _unmount() {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); if (this._fragment) this._fragment.u();
}
} }
function _unmount() { function _differsImmutable(a, b) {
if (this._fragment) this._fragment.u(); return a != a ? b == b : a !== b;
} }
var proto = { function callAll(fns) {
destroy, while (fns && fns.length) fns.shift()();
get, }
fire,
on,
set,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
@ -167,18 +169,18 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insertNode, noop, proto, setInputType } from "svelte/shared.js"; import { Component, assign, createElement, detachNode, insertNode, noop, setInputType } from "svelte/shared.js";
function create_main_fragment(component, state) { function create_main_fragment(component, state) {
var input; var input;
@ -28,17 +28,17 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -37,116 +37,118 @@ function blankObject() {
return Object.create(null); return Object.create(null);
} }
function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function fire(eventName, data) { fire(eventName, data) {
var handlers = const handlers = eventName in this._handlers && this._handlers[eventName].slice();
eventName in this._handlers && this._handlers[eventName].slice(); if (!handlers) return;
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) { for (let i = 0; i < handlers.length; i += 1) {
var handler = handlers[i]; const handler = handlers[i];
if (!handler.__calling) { if (!handler.__calling) {
handler.__calling = true; handler.__calling = true;
handler.call(this, data); handler.call(this, data);
handler.__calling = false; handler.__calling = false;
}
} }
} }
}
function get() { get() {
return this._state; return this._state;
} }
function init(component, options) { on(eventName, handler) {
component._handlers = blankObject(); const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
component._bind = options._bind; handlers.push(handler);
return {
cancel: function() {
const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
component.options = options; _differs(a, b) {
component.root = options.root || component; return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
component.store = component.root.store || options.store; }
} }
function on(eventName, handler) { class Component extends Thing {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); constructor(options) {
handlers.push(handler); super();
this._bind = options._bind;
return { this.options = options;
cancel: function() { this.root = options.root || this;
var index = handlers.indexOf(handler); this.store = this.root.store || options.store;
if (~index) handlers.splice(index, 1); }
}
};
}
function set(newState) { destroy(detach) {
this._set(assign({}, newState)); this.destroy = noop;
if (this.root._lock) return; this.fire('destroy');
this.root._lock = true; this.set = this.get = noop;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) { if (detach !== false) this._fragment.u();
var oldState = this._state, this._fragment.d();
changed = {}, this._fragment = this._state = null;
dirty = false; }
for (var key in newState) { set(newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _set(newState) {
this._recompute(changed, this._state); const previous = this._state;
if (this._bind) this._bind(changed, this._state); const changed = {};
let dirty = false;
for (var key in newState) {
if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
}
if (!dirty) return;
this._state = assign(assign({}, previous), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) { if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState }); this.fire("state", { changed, current: this._state, previous });
this._fragment.p(changed, this._state); this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState }); this.fire("update", { changed, current: this._state, previous });
}
} }
}
function callAll(fns) { _mount(target, anchor) {
while (fns && fns.length) fns.shift()(); this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
} }
function _mount(target, anchor) { _recompute() {}
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
_unmount() {
if (this._fragment) this._fragment.u();
}
} }
function _unmount() { function _differsImmutable(a, b) {
if (this._fragment) this._fragment.u(); return a != a ? b == b : a !== b;
} }
var proto = { function callAll(fns) {
destroy, while (fns && fns.length) fns.shift()();
get, }
fire,
on,
set,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
@ -221,7 +223,7 @@ function create_main_fragment(component, state) {
detachNode(audio); detachNode(audio);
}, },
d: function destroy$$1() { d: function destroy() {
removeListener(audio, "timeupdate", audio_timeupdate_handler); removeListener(audio, "timeupdate", audio_timeupdate_handler);
removeListener(audio, "durationchange", audio_durationchange_handler); removeListener(audio, "durationchange", audio_durationchange_handler);
removeListener(audio, "play", audio_play_pause_handler); removeListener(audio, "play", audio_play_pause_handler);
@ -233,25 +235,25 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
if (!options.root) { if (!options.root) {
this._oncreate = []; this._oncreate = [];
this._beforecreate = []; this._beforecreate = [];
} }
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
callAll(this._beforecreate); callAll(this._beforecreate);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { addListener, assign, callAll, createElement, detachNode, init, insertNode, proto, removeListener, timeRangesToArray } from "svelte/shared.js"; import { Component, addListener, assign, callAll, createElement, detachNode, insertNode, removeListener, timeRangesToArray } from "svelte/shared.js";
function create_main_fragment(component, state) { function create_main_fragment(component, state) {
var audio, audio_is_paused = true, audio_updating = false, audio_animationframe; var audio, audio_is_paused = true, audio_updating = false, audio_animationframe;
@ -84,24 +84,24 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
if (!options.root) { if (!options.root) {
this._oncreate = []; this._oncreate = [];
this._beforecreate = []; this._beforecreate = [];
} }
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
callAll(this._beforecreate); callAll(this._beforecreate);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -23,116 +23,118 @@ function blankObject() {
return Object.create(null); return Object.create(null);
} }
function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function fire(eventName, data) { fire(eventName, data) {
var handlers = const handlers = eventName in this._handlers && this._handlers[eventName].slice();
eventName in this._handlers && this._handlers[eventName].slice(); if (!handlers) return;
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) { for (let i = 0; i < handlers.length; i += 1) {
var handler = handlers[i]; const handler = handlers[i];
if (!handler.__calling) { if (!handler.__calling) {
handler.__calling = true; handler.__calling = true;
handler.call(this, data); handler.call(this, data);
handler.__calling = false; handler.__calling = false;
}
} }
} }
}
function get() { get() {
return this._state; return this._state;
} }
function init(component, options) { on(eventName, handler) {
component._handlers = blankObject(); const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
component._bind = options._bind; handlers.push(handler);
return {
cancel: function() {
const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
component.options = options; _differs(a, b) {
component.root = options.root || component; return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
component.store = component.root.store || options.store; }
} }
function on(eventName, handler) { class Component extends Thing {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); constructor(options) {
handlers.push(handler); super();
this._bind = options._bind;
return { this.options = options;
cancel: function() { this.root = options.root || this;
var index = handlers.indexOf(handler); this.store = this.root.store || options.store;
if (~index) handlers.splice(index, 1); }
}
};
}
function set(newState) { destroy(detach) {
this._set(assign({}, newState)); this.destroy = noop;
if (this.root._lock) return; this.fire('destroy');
this.root._lock = true; this.set = this.get = noop;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) { if (detach !== false) this._fragment.u();
var oldState = this._state, this._fragment.d();
changed = {}, this._fragment = this._state = null;
dirty = false; }
for (var key in newState) { set(newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _set(newState) {
this._recompute(changed, this._state); const previous = this._state;
if (this._bind) this._bind(changed, this._state); const changed = {};
let dirty = false;
for (var key in newState) {
if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
}
if (!dirty) return;
this._state = assign(assign({}, previous), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) { if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState }); this.fire("state", { changed, current: this._state, previous });
this._fragment.p(changed, this._state); this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState }); this.fire("update", { changed, current: this._state, previous });
}
} }
}
function callAll(fns) { _mount(target, anchor) {
while (fns && fns.length) fns.shift()(); this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
} }
function _mount(target, anchor) { _recompute() {}
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
_unmount() {
if (this._fragment) this._fragment.u();
}
} }
function _unmount() { function _differsImmutable(a, b) {
if (this._fragment) this._fragment.u(); return a != a ? b == b : a !== b;
} }
var proto = { function callAll(fns) {
destroy, while (fns && fns.length) fns.shift()();
get, }
fire,
on,
set,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
@ -170,37 +172,37 @@ function create_main_fragment(component, state) {
nonimported._unmount(); nonimported._unmount();
}, },
d: function destroy$$1() { d: function destroy() {
imported.destroy(false); imported.destroy(false);
nonimported.destroy(false); nonimported.destroy(false);
} }
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
if (!options.root) { if (!options.root) {
this._oncreate = []; this._oncreate = [];
this._beforecreate = []; this._beforecreate = [];
this._aftercreate = []; this._aftercreate = [];
} }
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
this._lock = true; this._lock = true;
callAll(this._beforecreate); callAll(this._beforecreate);
callAll(this._oncreate); callAll(this._oncreate);
callAll(this._aftercreate); callAll(this._aftercreate);
this._lock = false; this._lock = false;
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { assign, callAll, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js"; import { Component, assign, callAll, createText, detachNode, insertNode, noop } from "svelte/shared.js";
import Imported from 'Imported.html'; import Imported from 'Imported.html';
@ -43,29 +43,29 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
if (!options.root) { if (!options.root) {
this._oncreate = []; this._oncreate = [];
this._beforecreate = []; this._beforecreate = [];
this._aftercreate = []; this._aftercreate = [];
} }
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
this._lock = true; this._lock = true;
callAll(this._beforecreate); callAll(this._beforecreate);
callAll(this._oncreate); callAll(this._oncreate);
callAll(this._aftercreate); callAll(this._aftercreate);
this._lock = false; this._lock = false;
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -9,116 +9,118 @@ function blankObject() {
return Object.create(null); return Object.create(null);
} }
function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function fire(eventName, data) { fire(eventName, data) {
var handlers = const handlers = eventName in this._handlers && this._handlers[eventName].slice();
eventName in this._handlers && this._handlers[eventName].slice(); if (!handlers) return;
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) { for (let i = 0; i < handlers.length; i += 1) {
var handler = handlers[i]; const handler = handlers[i];
if (!handler.__calling) { if (!handler.__calling) {
handler.__calling = true; handler.__calling = true;
handler.call(this, data); handler.call(this, data);
handler.__calling = false; handler.__calling = false;
}
} }
} }
}
function get() { get() {
return this._state; return this._state;
} }
function init(component, options) { on(eventName, handler) {
component._handlers = blankObject(); const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
component._bind = options._bind; handlers.push(handler);
return {
cancel: function() {
const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
component.options = options; _differs(a, b) {
component.root = options.root || component; return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
component.store = component.root.store || options.store; }
} }
function on(eventName, handler) { class Component extends Thing {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); constructor(options) {
handlers.push(handler); super();
this._bind = options._bind;
return { this.options = options;
cancel: function() { this.root = options.root || this;
var index = handlers.indexOf(handler); this.store = this.root.store || options.store;
if (~index) handlers.splice(index, 1); }
}
};
}
function set(newState) { destroy(detach) {
this._set(assign({}, newState)); this.destroy = noop;
if (this.root._lock) return; this.fire('destroy');
this.root._lock = true; this.set = this.get = noop;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) { if (detach !== false) this._fragment.u();
var oldState = this._state, this._fragment.d();
changed = {}, this._fragment = this._state = null;
dirty = false; }
for (var key in newState) { set(newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _set(newState) {
this._recompute(changed, this._state); const previous = this._state;
if (this._bind) this._bind(changed, this._state); const changed = {};
let dirty = false;
if (this._fragment) { for (var key in newState) {
this.fire("state", { changed: changed, current: this._state, previous: oldState }); if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
this._fragment.p(changed, this._state); }
this.fire("update", { changed: changed, current: this._state, previous: oldState });
if (!dirty) return;
this._state = assign(assign({}, previous), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed, current: this._state, previous });
this._fragment.p(changed, this._state);
this.fire("update", { changed, current: this._state, previous });
}
} }
}
function callAll(fns) { _mount(target, anchor) {
while (fns && fns.length) fns.shift()(); this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
} }
_recompute() {}
function _mount(target, anchor) { _unmount() {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); if (this._fragment) this._fragment.u();
}
} }
function _unmount() { function _differsImmutable(a, b) {
if (this._fragment) this._fragment.u(); return a != a ? b == b : a !== b;
} }
var proto = { function callAll(fns) {
destroy, while (fns && fns.length) fns.shift()();
get, }
fire,
on,
set,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
@ -128,14 +130,14 @@ var methods = {
} }
}; };
function setup(Component) { function setup(Component$$1) {
Component.SOME_CONSTANT = 42; Component$$1.SOME_CONSTANT = 42;
Component.factory = function (target) { Component$$1.factory = function (target) {
return new Component({ return new Component$$1({
target: target target: target
}); });
}; };
Component.prototype.foo( 'baz' ); Component$$1.prototype.foo( 'baz' );
} }
function create_main_fragment(component, state) { function create_main_fragment(component, state) {
@ -153,19 +155,20 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
assign(SvelteComponent.prototype, methods); assign(SvelteComponent.prototype, methods);
setup(SvelteComponent); setup(SvelteComponent);

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { assign, init, noop, proto } from "svelte/shared.js"; import { Component, assign, noop } from "svelte/shared.js";
var methods = { var methods = {
foo ( bar ) { foo ( bar ) {
@ -32,19 +32,20 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
assign(SvelteComponent.prototype, methods); assign(SvelteComponent.prototype, methods);
setup(SvelteComponent); setup(SvelteComponent);

@ -29,116 +29,118 @@ function blankObject() {
return Object.create(null); return Object.create(null);
} }
function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function fire(eventName, data) { fire(eventName, data) {
var handlers = const handlers = eventName in this._handlers && this._handlers[eventName].slice();
eventName in this._handlers && this._handlers[eventName].slice(); if (!handlers) return;
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) { for (let i = 0; i < handlers.length; i += 1) {
var handler = handlers[i]; const handler = handlers[i];
if (!handler.__calling) { if (!handler.__calling) {
handler.__calling = true; handler.__calling = true;
handler.call(this, data); handler.call(this, data);
handler.__calling = false; handler.__calling = false;
}
} }
} }
}
function get() { get() {
return this._state; return this._state;
} }
function init(component, options) { on(eventName, handler) {
component._handlers = blankObject(); const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
component._bind = options._bind; handlers.push(handler);
return {
cancel: function() {
const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
component.options = options; _differs(a, b) {
component.root = options.root || component; return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
component.store = component.root.store || options.store; }
} }
function on(eventName, handler) { class Component extends Thing {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); constructor(options) {
handlers.push(handler); super();
this._bind = options._bind;
return { this.options = options;
cancel: function() { this.root = options.root || this;
var index = handlers.indexOf(handler); this.store = this.root.store || options.store;
if (~index) handlers.splice(index, 1); }
}
};
}
function set(newState) { destroy(detach) {
this._set(assign({}, newState)); this.destroy = noop;
if (this.root._lock) return; this.fire('destroy');
this.root._lock = true; this.set = this.get = noop;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) { if (detach !== false) this._fragment.u();
var oldState = this._state, this._fragment.d();
changed = {}, this._fragment = this._state = null;
dirty = false; }
for (var key in newState) { set(newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _set(newState) {
this._recompute(changed, this._state); const previous = this._state;
if (this._bind) this._bind(changed, this._state); const changed = {};
let dirty = false;
if (this._fragment) { for (var key in newState) {
this.fire("state", { changed: changed, current: this._state, previous: oldState }); if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
this._fragment.p(changed, this._state); }
this.fire("update", { changed: changed, current: this._state, previous: oldState });
if (!dirty) return;
this._state = assign(assign({}, previous), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed, current: this._state, previous });
this._fragment.p(changed, this._state);
this.fire("update", { changed, current: this._state, previous });
}
} }
}
function callAll(fns) { _mount(target, anchor) {
while (fns && fns.length) fns.shift()(); this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
} }
_recompute() {}
function _mount(target, anchor) { _unmount() {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); if (this._fragment) this._fragment.u();
}
} }
function _unmount() { function _differsImmutable(a, b) {
if (this._fragment) this._fragment.u(); return a != a ? b == b : a !== b;
} }
var proto = { function callAll(fns) {
destroy, while (fns && fns.length) fns.shift()();
get, }
fire,
on,
set,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
@ -168,18 +170,18 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { appendNode, assign, createSvgElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js"; import { Component, appendNode, assign, createSvgElement, createText, detachNode, insertNode, noop } from "svelte/shared.js";
function create_main_fragment(component, state) { function create_main_fragment(component, state) {
var svg, title, text; var svg, title, text;
@ -27,17 +27,17 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -9,116 +9,118 @@ function blankObject() {
return Object.create(null); return Object.create(null);
} }
function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function fire(eventName, data) { fire(eventName, data) {
var handlers = const handlers = eventName in this._handlers && this._handlers[eventName].slice();
eventName in this._handlers && this._handlers[eventName].slice(); if (!handlers) return;
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) { for (let i = 0; i < handlers.length; i += 1) {
var handler = handlers[i]; const handler = handlers[i];
if (!handler.__calling) { if (!handler.__calling) {
handler.__calling = true; handler.__calling = true;
handler.call(this, data); handler.call(this, data);
handler.__calling = false; handler.__calling = false;
}
} }
} }
}
function get() { get() {
return this._state; return this._state;
} }
on(eventName, handler) {
const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
function init(component, options) { return {
component._handlers = blankObject(); cancel: function() {
component._bind = options._bind; const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
component.options = options; _differs(a, b) {
component.root = options.root || component; return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
component.store = component.root.store || options.store; }
} }
function on(eventName, handler) { class Component extends Thing {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); constructor(options) {
handlers.push(handler); super();
this._bind = options._bind;
return { this.options = options;
cancel: function() { this.root = options.root || this;
var index = handlers.indexOf(handler); this.store = this.root.store || options.store;
if (~index) handlers.splice(index, 1); }
}
};
}
function set(newState) { destroy(detach) {
this._set(assign({}, newState)); this.destroy = noop;
if (this.root._lock) return; this.fire('destroy');
this.root._lock = true; this.set = this.get = noop;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) { if (detach !== false) this._fragment.u();
var oldState = this._state, this._fragment.d();
changed = {}, this._fragment = this._state = null;
dirty = false; }
for (var key in newState) { set(newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _set(newState) {
this._recompute(changed, this._state); const previous = this._state;
if (this._bind) this._bind(changed, this._state); const changed = {};
let dirty = false;
for (var key in newState) {
if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
}
if (!dirty) return;
this._state = assign(assign({}, previous), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) { if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState }); this.fire("state", { changed, current: this._state, previous });
this._fragment.p(changed, this._state); this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState }); this.fire("update", { changed, current: this._state, previous });
}
} }
}
function callAll(fns) { _mount(target, anchor) {
while (fns && fns.length) fns.shift()(); this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
} }
_recompute() {}
function _mount(target, anchor) { _unmount() {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); if (this._fragment) this._fragment.u();
}
} }
function _unmount() { function _differsImmutable(a, b) {
if (this._fragment) this._fragment.u(); return a != a ? b == b : a !== b;
} }
var proto = { function callAll(fns) {
destroy, while (fns && fns.length) fns.shift()();
get, }
fire,
on,
set,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
@ -144,18 +146,18 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -0,0 +1,39 @@
/* generated by Svelte vX.Y.Z */
import { assign, init, noop, proto } from "svelte/shared.js";
function create_main_fragment(component, state) {
var title_value;
document.title = title_value = "a " + state.custom + " title";
return {
c: noop,
m: noop,
p: function update(changed, state) {
if ((changed.custom) && title_value !== (title_value = "a " + state.custom + " title")) {
document.title = title_value;
}
},
u: noop,
d: noop
};
}
function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { assign, init, noop, proto } from "svelte/shared.js"; import { Component, assign, noop } from "svelte/shared.js";
function create_main_fragment(component, state) { function create_main_fragment(component, state) {
var title_value; var title_value;
@ -23,17 +23,17 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -33,116 +33,118 @@ function blankObject() {
return Object.create(null); return Object.create(null);
} }
function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function fire(eventName, data) { fire(eventName, data) {
var handlers = const handlers = eventName in this._handlers && this._handlers[eventName].slice();
eventName in this._handlers && this._handlers[eventName].slice(); if (!handlers) return;
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) { for (let i = 0; i < handlers.length; i += 1) {
var handler = handlers[i]; const handler = handlers[i];
if (!handler.__calling) { if (!handler.__calling) {
handler.__calling = true; handler.__calling = true;
handler.call(this, data); handler.call(this, data);
handler.__calling = false; handler.__calling = false;
}
} }
} }
}
function get() { get() {
return this._state; return this._state;
} }
on(eventName, handler) {
const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
function init(component, options) { return {
component._handlers = blankObject(); cancel: function() {
component._bind = options._bind; const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
component.options = options; _differs(a, b) {
component.root = options.root || component; return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
component.store = component.root.store || options.store; }
} }
function on(eventName, handler) { class Component extends Thing {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); constructor(options) {
handlers.push(handler); super();
this._bind = options._bind;
return { this.options = options;
cancel: function() { this.root = options.root || this;
var index = handlers.indexOf(handler); this.store = this.root.store || options.store;
if (~index) handlers.splice(index, 1); }
}
};
}
function set(newState) { destroy(detach) {
this._set(assign({}, newState)); this.destroy = noop;
if (this.root._lock) return; this.fire('destroy');
this.root._lock = true; this.set = this.get = noop;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) { if (detach !== false) this._fragment.u();
var oldState = this._state, this._fragment.d();
changed = {}, this._fragment = this._state = null;
dirty = false; }
for (var key in newState) { set(newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _set(newState) {
this._recompute(changed, this._state); const previous = this._state;
if (this._bind) this._bind(changed, this._state); const changed = {};
let dirty = false;
for (var key in newState) {
if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
}
if (!dirty) return;
this._state = assign(assign({}, previous), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) { if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState }); this.fire("state", { changed, current: this._state, previous });
this._fragment.p(changed, this._state); this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState }); this.fire("update", { changed, current: this._state, previous });
}
} }
}
function callAll(fns) { _mount(target, anchor) {
while (fns && fns.length) fns.shift()(); this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
} }
_recompute() {}
function _mount(target, anchor) { _unmount() {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); if (this._fragment) this._fragment.u();
}
} }
function _unmount() { function _differsImmutable(a, b) {
if (this._fragment) this._fragment.u(); return a != a ? b == b : a !== b;
} }
var proto = { function callAll(fns) {
destroy, while (fns && fns.length) fns.shift()();
get, }
fire,
on,
set,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
@ -271,7 +273,7 @@ function create_main_fragment(component, state) {
detachNode(if_block_4_anchor); detachNode(if_block_4_anchor);
}, },
d: function destroy$$1() { d: function destroy() {
if (if_block) if_block.d(); if (if_block) if_block.d();
if (if_block_1) if_block_1.d(); if (if_block_1) if_block_1.d();
if (if_block_2) if_block_2.d(); if (if_block_2) if_block_2.d();
@ -391,18 +393,18 @@ function create_if_block_4(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -0,0 +1,262 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createComment, createElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
function create_main_fragment(component, state) {
var div, text, p, text_2, text_3, text_4, p_1, text_6, text_8, if_block_4_anchor;
var if_block = (state.a) && create_if_block(component, state);
var if_block_1 = (state.b) && create_if_block_1(component, state);
var if_block_2 = (state.c) && create_if_block_2(component, state);
var if_block_3 = (state.d) && create_if_block_3(component, state);
var if_block_4 = (state.e) && create_if_block_4(component, state);
return {
c: function create() {
div = createElement("div");
if (if_block) if_block.c();
text = createText("\n\n\t");
p = createElement("p");
p.textContent = "this can be used as an anchor";
text_2 = createText("\n\n\t");
if (if_block_1) if_block_1.c();
text_3 = createText("\n\n\t");
if (if_block_2) if_block_2.c();
text_4 = createText("\n\n\t");
p_1 = createElement("p");
p_1.textContent = "so can this";
text_6 = createText("\n\n\t");
if (if_block_3) if_block_3.c();
text_8 = createText("\n\n");
if (if_block_4) if_block_4.c();
if_block_4_anchor = createComment();
},
m: function mount(target, anchor) {
insertNode(div, target, anchor);
if (if_block) if_block.m(div, null);
appendNode(text, div);
appendNode(p, div);
appendNode(text_2, div);
if (if_block_1) if_block_1.m(div, null);
appendNode(text_3, div);
if (if_block_2) if_block_2.m(div, null);
appendNode(text_4, div);
appendNode(p_1, div);
appendNode(text_6, div);
if (if_block_3) if_block_3.m(div, null);
insertNode(text_8, target, anchor);
if (if_block_4) if_block_4.m(target, anchor);
insertNode(if_block_4_anchor, target, anchor);
},
p: function update(changed, state) {
if (state.a) {
if (!if_block) {
if_block = create_if_block(component, state);
if_block.c();
if_block.m(div, text);
}
} else if (if_block) {
if_block.u();
if_block.d();
if_block = null;
}
if (state.b) {
if (!if_block_1) {
if_block_1 = create_if_block_1(component, state);
if_block_1.c();
if_block_1.m(div, text_3);
}
} else if (if_block_1) {
if_block_1.u();
if_block_1.d();
if_block_1 = null;
}
if (state.c) {
if (!if_block_2) {
if_block_2 = create_if_block_2(component, state);
if_block_2.c();
if_block_2.m(div, text_4);
}
} else if (if_block_2) {
if_block_2.u();
if_block_2.d();
if_block_2 = null;
}
if (state.d) {
if (!if_block_3) {
if_block_3 = create_if_block_3(component, state);
if_block_3.c();
if_block_3.m(div, null);
}
} else if (if_block_3) {
if_block_3.u();
if_block_3.d();
if_block_3 = null;
}
if (state.e) {
if (!if_block_4) {
if_block_4 = create_if_block_4(component, state);
if_block_4.c();
if_block_4.m(if_block_4_anchor.parentNode, if_block_4_anchor);
}
} else if (if_block_4) {
if_block_4.u();
if_block_4.d();
if_block_4 = null;
}
},
u: function unmount() {
detachNode(div);
if (if_block) if_block.u();
if (if_block_1) if_block_1.u();
if (if_block_2) if_block_2.u();
if (if_block_3) if_block_3.u();
detachNode(text_8);
if (if_block_4) if_block_4.u();
detachNode(if_block_4_anchor);
},
d: function destroy() {
if (if_block) if_block.d();
if (if_block_1) if_block_1.d();
if (if_block_2) if_block_2.d();
if (if_block_3) if_block_3.d();
if (if_block_4) if_block_4.d();
}
};
}
// (2:1) {#if a}
function create_if_block(component, state) {
var p;
return {
c: function create() {
p = createElement("p");
p.textContent = "a";
},
m: function mount(target, anchor) {
insertNode(p, target, anchor);
},
u: function unmount() {
detachNode(p);
},
d: noop
};
}
// (8:1) {#if b}
function create_if_block_1(component, state) {
var p;
return {
c: function create() {
p = createElement("p");
p.textContent = "b";
},
m: function mount(target, anchor) {
insertNode(p, target, anchor);
},
u: function unmount() {
detachNode(p);
},
d: noop
};
}
// (12:1) {#if c}
function create_if_block_2(component, state) {
var p;
return {
c: function create() {
p = createElement("p");
p.textContent = "c";
},
m: function mount(target, anchor) {
insertNode(p, target, anchor);
},
u: function unmount() {
detachNode(p);
},
d: noop
};
}
// (18:1) {#if d}
function create_if_block_3(component, state) {
var p;
return {
c: function create() {
p = createElement("p");
p.textContent = "d";
},
m: function mount(target, anchor) {
insertNode(p, target, anchor);
},
u: function unmount() {
detachNode(p);
},
d: noop
};
}
// (25:0) {#if e}
function create_if_block_4(component, state) {
var p;
return {
c: function create() {
p = createElement("p");
p.textContent = "e";
},
m: function mount(target, anchor) {
insertNode(p, target, anchor);
},
u: function unmount() {
detachNode(p);
},
d: noop
};
}
function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { appendNode, assign, createComment, createElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js"; import { Component, appendNode, assign, createComment, createElement, createText, detachNode, insertNode, noop } from "svelte/shared.js";
function create_main_fragment(component, state) { function create_main_fragment(component, state) {
var div, text, p, text_2, text_3, text_4, p_1, text_6, text_8, if_block_4_anchor; var div, text, p, text_2, text_3, text_4, p_1, text_6, text_8, if_block_4_anchor;
@ -246,17 +246,17 @@ function create_if_block_4(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -29,116 +29,118 @@ function blankObject() {
return Object.create(null); return Object.create(null);
} }
function destroy(detach) { // TODO need to think of a suitable name for this
this.destroy = noop; class Thing {
this.fire('destroy'); constructor() {
this.set = this.get = noop; this._handlers = blankObject();
}
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function fire(eventName, data) { fire(eventName, data) {
var handlers = const handlers = eventName in this._handlers && this._handlers[eventName].slice();
eventName in this._handlers && this._handlers[eventName].slice(); if (!handlers) return;
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) { for (let i = 0; i < handlers.length; i += 1) {
var handler = handlers[i]; const handler = handlers[i];
if (!handler.__calling) { if (!handler.__calling) {
handler.__calling = true; handler.__calling = true;
handler.call(this, data); handler.call(this, data);
handler.__calling = false; handler.__calling = false;
}
} }
} }
}
function get() { get() {
return this._state; return this._state;
} }
on(eventName, handler) {
const handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
function init(component, options) { return {
component._handlers = blankObject(); cancel: function() {
component._bind = options._bind; const index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
component.options = options; _differs(a, b) {
component.root = options.root || component; return _differsImmutable(a, b) || ((a && typeof a === 'object') || typeof a === 'function');
component.store = component.root.store || options.store; }
} }
function on(eventName, handler) { class Component extends Thing {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); constructor(options) {
handlers.push(handler); super();
this._bind = options._bind;
return { this.options = options;
cancel: function() { this.root = options.root || this;
var index = handlers.indexOf(handler); this.store = this.root.store || options.store;
if (~index) handlers.splice(index, 1); }
}
};
}
function set(newState) { destroy(detach) {
this._set(assign({}, newState)); this.destroy = noop;
if (this.root._lock) return; this.fire('destroy');
this.root._lock = true; this.set = this.get = noop;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) { if (detach !== false) this._fragment.u();
var oldState = this._state, this._fragment.d();
changed = {}, this._fragment = this._state = null;
dirty = false; }
for (var key in newState) { set(newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true; this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
} }
if (!dirty) return;
this._state = assign(assign({}, oldState), newState); _set(newState) {
this._recompute(changed, this._state); const previous = this._state;
if (this._bind) this._bind(changed, this._state); const changed = {};
let dirty = false;
for (var key in newState) {
if (this._differs(newState[key], previous[key])) changed[key] = dirty = 1;
}
if (!dirty) return;
this._state = assign(assign({}, previous), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) { if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState }); this.fire("state", { changed, current: this._state, previous });
this._fragment.p(changed, this._state); this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState }); this.fire("update", { changed, current: this._state, previous });
}
} }
}
function callAll(fns) { _mount(target, anchor) {
while (fns && fns.length) fns.shift()(); this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
} }
_recompute() {}
function _mount(target, anchor) { _unmount() {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); if (this._fragment) this._fragment.u();
}
} }
function _unmount() { function _differsImmutable(a, b) {
if (this._fragment) this._fragment.u(); return a != a ? b == b : a !== b;
} }
var proto = { function callAll(fns) {
destroy, while (fns && fns.length) fns.shift()();
get, }
fire,
on,
set,
_recompute: noop,
_set,
_mount,
_unmount,
_differs
};
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
@ -188,25 +190,25 @@ function create_main_fragment(component, state) {
detachNode(p); detachNode(p);
}, },
d: function destroy$$1() { d: function destroy() {
window.removeEventListener("scroll", onwindowscroll); window.removeEventListener("scroll", onwindowscroll);
} }
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state.y = window.pageYOffset; this._state = assign({}, options.data);
this._state.y = window.pageYOffset;
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;

@ -0,0 +1,68 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createElement, createText, detachNode, init, insertNode, proto } from "svelte/shared.js";
function create_main_fragment(component, state) {
var window_updating = false, clear_window_updating = function() { window_updating = false; }, window_updating_timeout, p, text, text_1;
function onwindowscroll(event) {
if (window_updating) return;
window_updating = true;
component.set({
y: this.pageYOffset
});
window_updating = false;
}
window.addEventListener("scroll", onwindowscroll);
component.observe("y", function(y) {
window_updating = true;
clearTimeout(window_updating_timeout);
window.scrollTo(window.pageXOffset, y);
window_updating_timeout = setTimeout(clear_window_updating, 100);
});
return {
c: function create() {
p = createElement("p");
text = createText("scrolled to ");
text_1 = createText(state.y);
},
m: function mount(target, anchor) {
insertNode(p, target, anchor);
appendNode(text, p);
appendNode(text_1, p);
},
p: function update(changed, state) {
if (changed.y) {
text_1.data = state.y;
}
},
u: function unmount() {
detachNode(p);
},
d: function destroy() {
window.removeEventListener("scroll", onwindowscroll);
}
};
}
function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
this._state.y = window.pageYOffset;
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { appendNode, assign, createElement, createText, detachNode, init, insertNode, proto } from "svelte/shared.js"; import { Component, appendNode, assign, createElement, createText, detachNode, insertNode } from "svelte/shared.js";
function create_main_fragment(component, state) { function create_main_fragment(component, state) {
var window_updating = false, clear_window_updating = function() { window_updating = false; }, window_updating_timeout, p, text, text_1; var window_updating = false, clear_window_updating = function() { window_updating = false; }, window_updating_timeout, p, text, text_1;
@ -53,18 +53,18 @@ function create_main_fragment(component, state) {
}; };
} }
function SvelteComponent(options) { class SvelteComponent extends Component {
init(this, options); constructor(options) {
this._state = assign({}, options.data); super(options);
this._state.y = window.pageYOffset; this._state = assign({}, options.data);
this._state.y = window.pageYOffset;
this._fragment = create_main_fragment(this, this._state); this._fragment = create_main_fragment(this, this._state);
if (options.target) { if (options.target) {
this._fragment.c(); this._fragment.c();
this._mount(options.target, options.anchor); this._mount(options.target, options.anchor);
}
} }
} }
assign(SvelteComponent.prototype, proto);
export default SvelteComponent; export default SvelteComponent;
Loading…
Cancel
Save