simplify module wrapping

pull/7738/head
Rich Harris 8 years ago
parent 8f5303ad30
commit c765ec6acc

@ -8,7 +8,7 @@ import globalWhitelist from '../utils/globalWhitelist';
import reservedNames from '../utils/reservedNames'; import reservedNames from '../utils/reservedNames';
import namespaces from '../utils/namespaces'; import namespaces from '../utils/namespaces';
import { removeNode, removeObjectKey } from '../utils/removeNode'; import { removeNode, removeObjectKey } from '../utils/removeNode';
import getModuleWrapper from './shared/utils/getModuleWrapper'; import wrapModule from './shared/utils/wrapModule';
import annotateWithScopes from '../utils/annotateWithScopes'; import annotateWithScopes from '../utils/annotateWithScopes';
import clone from '../utils/clone'; import clone from '../utils/clone';
import DomBlock from './dom/Block'; import DomBlock from './dom/Block';
@ -305,7 +305,9 @@ export default class Generator {
generate(result: string, options: CompileOptions, { banner = '', sharedPath, helpers, name, format }: GenerateOptions ) { generate(result: string, options: CompileOptions, { banner = '', sharedPath, helpers, name, format }: GenerateOptions ) {
const pattern = /\[✂(\d+)-(\d+)$/; const pattern = /\[✂(\d+)-(\d+)$/;
const parts = result.split('✂]'); const module = wrapModule(result, format, name, options, banner, sharedPath, helpers, this.imports, this.source);
const parts = module.split('✂]');
const finalChunk = parts.pop(); const finalChunk = parts.pop();
const compiled = new Bundle({ separator: '' }); const compiled = new Bundle({ separator: '' });
@ -316,10 +318,6 @@ export default class Generator {
}); });
} }
const { intro, outro } = getModuleWrapper(format, name, options, banner, sharedPath, helpers, this.imports, this.source);
addString(intro + '\n\n');
const { filename } = options; const { filename } = options;
// special case — the source file doesn't actually get used anywhere. we need // special case — the source file doesn't actually get used anywhere. we need
@ -346,7 +344,6 @@ export default class Generator {
}); });
addString(finalChunk); addString(finalChunk);
addString('\n\n' + outro);
const { css, cssMap } = this.customElement ? const { css, cssMap } = this.customElement ?
{ css: null, cssMap: null } : { css: null, cssMap: null } :

@ -407,17 +407,17 @@ export default function dom(
// special case // special case
const global = `_svelteTransitionManager`; const global = `_svelteTransitionManager`;
inlineHelpers += `var ${generator.alias('transitionManager')} = window.${global} || (window.${global} = ${code});\n\n`; inlineHelpers += `\n\nvar ${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 += `${code}\n\n`; inlineHelpers += `\n\n${code}`;
} }
}); });
result = inlineHelpers + result; result += inlineHelpers;
} }
const filename = options.filename && ( const filename = options.filename && (

@ -7,7 +7,10 @@ interface Dependency {
source: string; source: string;
} }
export default function getModuleWrapper( const wrappers = { es, amd, cjs, iife, umd, eval: expr };
export default function wrapModule(
code: string,
format: ModuleFormat, format: ModuleFormat,
name: string, name: string,
options: CompileOptions, options: CompileOptions,
@ -16,8 +19,8 @@ export default function getModuleWrapper(
helpers: { name: string, alias: string }[], helpers: { name: string, alias: string }[],
imports: Node[], imports: Node[],
source: string source: string
) { ): string {
if (format === 'es') return getEsWrapper(name, options, banner, sharedPath, helpers, imports, source); if (format === 'es') return es(code, name, options, banner, sharedPath, helpers, imports, source);
const dependencies = imports.map((declaration, i) => { const dependencies = imports.map((declaration, i) => {
const defaultImport = declaration.specifiers.find( const defaultImport = declaration.specifiers.find(
@ -56,16 +59,17 @@ export default function getModuleWrapper(
return { name, statements, source: declaration.source.value }; return { name, statements, source: declaration.source.value };
}); });
if (format === 'amd') return getAmdWrapper(name, options, banner, dependencies); if (format === 'amd') return amd(code, name, options, banner, dependencies);
if (format === 'cjs') return getCjsWrapper(name, options, banner, sharedPath, helpers, dependencies); if (format === 'cjs') return cjs(code, name, options, banner, sharedPath, helpers, dependencies);
if (format === 'iife') return getIifeWrapper(name, options, banner, dependencies); if (format === 'iife') return iife(code, name, options, banner, dependencies);
if (format === 'umd') return getUmdWrapper(name, options, banner, dependencies); if (format === 'umd') return umd(code, name, options, banner, dependencies);
if (format === 'eval') return getEvalWrapper(name, options, banner, dependencies); if (format === 'eval') return expr(code, name, options, banner, dependencies);
throw new Error(`Not implemented: ${format}`); throw new Error(`Not implemented: ${format}`);
} }
function getEsWrapper( function es(
code: string,
name: string, name: string,
options: CompileOptions, options: CompileOptions,
banner: string, banner: string,
@ -78,25 +82,25 @@ function getEsWrapper(
`import { ${helpers.map(h => h.name === h.alias ? h.name : `${h.name} as ${h.alias}`).join(', ')} } from ${JSON.stringify(sharedPath)};` `import { ${helpers.map(h => h.name === h.alias ? h.name : `${h.name} as ${h.alias}`).join(', ')} } from ${JSON.stringify(sharedPath)};`
); );
const importBlock = imports const importBlock = imports.length > 0 && (
imports
.map((declaration: Node) => source.slice(declaration.start, declaration.end)) .map((declaration: Node) => source.slice(declaration.start, declaration.end))
.join('\n'); .join('\n')
);
return { return deindent`
intro: deindent`
${banner} ${banner}
${importHelpers} ${importHelpers}
${importBlock} ${importBlock}
export default (function() { export default (function() {
`, ${code}
outro: deindent`
return ${name}; return ${name};
}());` }());`;
};
} }
function getAmdWrapper( function amd(
code: string,
name: string, name: string,
options: CompileOptions, options: CompileOptions,
banner: string, banner: string,
@ -108,20 +112,17 @@ function getAmdWrapper(
const id = options.amd && options.amd.id; const id = options.amd && options.amd.id;
return { return deindent`
intro: deindent`
define(${id ? `"${id}", ` : ''}${sourceString}function(${paramString(dependencies)}) { "use strict"; define(${id ? `"${id}", ` : ''}${sourceString}function(${paramString(dependencies)}) { "use strict";
${getCompatibilityStatements(dependencies)} ${getCompatibilityStatements(dependencies)}
`, ${code}
outro: deindent`
return ${name}; return ${name};
});` });`;
};
} }
function getCjsWrapper( function cjs(
code: string,
name: string, name: string,
options: CompileOptions, options: CompileOptions,
banner: string, banner: string,
@ -137,12 +138,13 @@ function getCjsWrapper(
}).join('\n') }).join('\n')
); );
const requireBlock = dependencies const requireBlock = dependencies.length > 0 && (
dependencies
.map(d => `var ${d.name} = require("${d.source}");`) .map(d => `var ${d.name} = require("${d.source}");`)
.join('\n\n'); .join('\n\n')
);
const intro = requireBlock ? return deindent`
deindent`
${banner} ${banner}
"use strict"; "use strict";
@ -150,20 +152,13 @@ function getCjsWrapper(
${requireBlock} ${requireBlock}
${getCompatibilityStatements(dependencies)} ${getCompatibilityStatements(dependencies)}
` : ${code}
deindent`
${banner}
"use strict";
${helperBlock}
`;
const outro = `module.exports = ${name};`
return { intro, outro }; module.exports = ${name};`
} }
function getIifeWrapper( function iife(
code: string,
name: string, name: string,
options: CompileOptions, options: CompileOptions,
banner: string, banner: string,
@ -175,22 +170,18 @@ function getIifeWrapper(
const globals = getGlobals(dependencies, options); const globals = getGlobals(dependencies, options);
return { return deindent`
intro: deindent`
${banner} ${banner}
var ${options.name} = (function(${paramString(dependencies)}) { "use strict"; var ${options.name} = (function(${paramString(dependencies)}) { "use strict";
${getCompatibilityStatements(dependencies)} ${getCompatibilityStatements(dependencies)}
`, ${code}
outro: deindent`
return ${name}; return ${name};
}(${globals.join(', ')}));` }(${globals.join(', ')}));`;
};
} }
function getUmdWrapper( function umd(
code: string,
name: string, name: string,
options: CompileOptions, options: CompileOptions,
banner: string, banner: string,
@ -212,8 +203,7 @@ function getUmdWrapper(
const globals = getGlobals(dependencies, options); const globals = getGlobals(dependencies, options);
return { return deindent`
intro: deindent`
${banner} ${banner}
(function(global, factory) { (function(global, factory) {
typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory(${cjsDeps}) : typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory(${cjsDeps}) :
@ -223,16 +213,15 @@ function getUmdWrapper(
${getCompatibilityStatements(dependencies)} ${getCompatibilityStatements(dependencies)}
`, ${code}
outro: deindent`
return ${name}; return ${name};
})));` })));`;
};
} }
function getEvalWrapper( function expr(
code: string,
name: string, name: string,
options: CompileOptions, options: CompileOptions,
banner: string, banner: string,
@ -240,17 +229,16 @@ function getEvalWrapper(
) { ) {
const globals = getGlobals(dependencies, options); const globals = getGlobals(dependencies, options);
return { return deindent`
intro: deindent`
(function (${paramString(dependencies)}) { "use strict"; (function (${paramString(dependencies)}) { "use strict";
${banner} ${banner}
${getCompatibilityStatements(dependencies)} ${getCompatibilityStatements(dependencies)}
`, ${code}
outro: `return ${name};\n\n}(${globals.join(', ')}))` return ${name};
}; }(${globals.join(', ')}))`;
} }
function paramString(dependencies: Dependency[]) { function paramString(dependencies: Dependency[]) {

@ -191,8 +191,7 @@ var proto = {
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
var _actual = (function() { var _actual = (function() {
var template = (function() {
var template = (function() {
return { return {
data: function () { data: function () {
return { foo: 42 } return { foo: 42 }
@ -200,18 +199,18 @@ var template = (function() {
}; };
}()); }());
function encapsulateStyles(node) { function encapsulateStyles(node) {
setAttribute(node, "svelte-3590263702", ""); setAttribute(node, "svelte-3590263702", "");
} }
function add_css() { function add_css() {
var style = createElement("style"); var style = createElement("style");
style.id = 'svelte-3590263702-style'; style.id = 'svelte-3590263702-style';
style.textContent = "p[svelte-3590263702],[svelte-3590263702] p{color:red}"; style.textContent = "p[svelte-3590263702],[svelte-3590263702] p{color:red}";
appendNode(style, document.head); appendNode(style, document.head);
} }
function create_main_fragment(state, component) { function create_main_fragment(state, component) {
var p, text; var p, text;
return { return {
@ -242,9 +241,9 @@ function create_main_fragment(state, component) {
destroy: noop destroy: noop
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = assign(template.data(), options.data); this._state = assign(template.data(), options.data);
@ -256,11 +255,10 @@ function SvelteComponent(options) {
this._fragment.create(); this._fragment.create();
this._fragment.mount(options.target, options.anchor || null); this._fragment.mount(options.target, options.anchor || null);
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());
export default _actual; export default _actual;

@ -1,10 +1,8 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { appendNode, assign, createElement, createText, detachNode, init, insertNode, noop, proto, setAttribute } from "svelte/shared.js"; import { appendNode, assign, createElement, createText, detachNode, init, insertNode, noop, proto, setAttribute } from "svelte/shared.js";
export default (function() { export default (function() {
var template = (function() {
var template = (function() {
return { return {
data: function () { data: function () {
return { foo: 42 } return { foo: 42 }
@ -12,18 +10,18 @@ var template = (function() {
}; };
}()); }());
function encapsulateStyles(node) { function encapsulateStyles(node) {
setAttribute(node, "svelte-3590263702", ""); setAttribute(node, "svelte-3590263702", "");
} }
function add_css() { function add_css() {
var style = createElement("style"); var style = createElement("style");
style.id = 'svelte-3590263702-style'; style.id = 'svelte-3590263702-style';
style.textContent = "p[svelte-3590263702],[svelte-3590263702] p{color:red}"; style.textContent = "p[svelte-3590263702],[svelte-3590263702] p{color:red}";
appendNode(style, document.head); appendNode(style, document.head);
} }
function create_main_fragment(state, component) { function create_main_fragment(state, component) {
var p, text; var p, text;
return { return {
@ -54,9 +52,9 @@ function create_main_fragment(state, component) {
destroy: noop destroy: noop
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = assign(template.data(), options.data); this._state = assign(template.data(), options.data);
@ -68,9 +66,8 @@ function SvelteComponent(options) {
this._fragment.create(); this._fragment.create();
this._fragment.mount(options.target, options.anchor || null); this._fragment.mount(options.target, options.anchor || null);
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());

@ -167,8 +167,7 @@ var proto = {
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
var _actual = (function() { var _actual = (function() {
var template = (function() {
var template = (function() {
return { return {
components: { components: {
Nested: window.Nested Nested: window.Nested
@ -176,7 +175,7 @@ var template = (function() {
}; };
}()); }());
function create_main_fragment(state, component) { function create_main_fragment(state, component) {
var nested = new template.components.Nested({ var nested = new template.components.Nested({
_root: component._root, _root: component._root,
@ -202,9 +201,9 @@ function create_main_fragment(state, component) {
nested.destroy(false); nested.destroy(false);
} }
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -226,11 +225,10 @@ function SvelteComponent(options) {
callAll(this._aftercreate); callAll(this._aftercreate);
this._lock = false; this._lock = false;
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());
export default _actual; export default _actual;

@ -1,10 +1,8 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { assign, callAll, init, noop, proto } from "svelte/shared.js"; import { assign, callAll, init, noop, proto } from "svelte/shared.js";
export default (function() { export default (function() {
var template = (function() {
var template = (function() {
return { return {
components: { components: {
Nested: window.Nested Nested: window.Nested
@ -12,7 +10,7 @@ var template = (function() {
}; };
}()); }());
function create_main_fragment(state, component) { function create_main_fragment(state, component) {
var nested = new template.components.Nested({ var nested = new template.components.Nested({
_root: component._root, _root: component._root,
@ -38,9 +36,9 @@ function create_main_fragment(state, component) {
nested.destroy(false); nested.destroy(false);
} }
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -62,9 +60,8 @@ function SvelteComponent(options) {
callAll(this._aftercreate); callAll(this._aftercreate);
this._lock = false; this._lock = false;
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());

@ -167,8 +167,7 @@ var proto = {
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
var _actual = (function() { var _actual = (function() {
var template = (function() {
var template = (function() {
return { return {
computed: { computed: {
a: x => x * 2, a: x => x * 2,
@ -177,7 +176,7 @@ var template = (function() {
}; };
}()); }());
function create_main_fragment(state, component) { function create_main_fragment(state, component) {
return { return {
create: noop, create: noop,
@ -190,9 +189,9 @@ function create_main_fragment(state, component) {
destroy: noop destroy: noop
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
this._recompute({ x: 1 }, this._state); this._recompute({ x: 1 }, this._state);
@ -203,18 +202,17 @@ function SvelteComponent(options) {
this._fragment.create(); this._fragment.create();
this._fragment.mount(options.target, options.anchor || null); this._fragment.mount(options.target, options.anchor || null);
} }
} }
assign(SvelteComponent.prototype, proto); 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 (differs(state.a, (state.a = template.computed.a(state.x)))) changed.a = true; if (differs(state.a, (state.a = template.computed.a(state.x)))) changed.a = true;
if (differs(state.b, (state.b = template.computed.b(state.x)))) changed.b = true; if (differs(state.b, (state.b = template.computed.b(state.x)))) changed.b = true;
} }
}; };
return SvelteComponent;
return SvelteComponent;
}()); }());
export default _actual; export default _actual;

@ -1,10 +1,8 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { assign, differs, init, noop, proto } from "svelte/shared.js"; import { assign, differs, init, noop, proto } from "svelte/shared.js";
export default (function() { export default (function() {
var template = (function() {
var template = (function() {
return { return {
computed: { computed: {
a: x => x * 2, a: x => x * 2,
@ -13,7 +11,7 @@ var template = (function() {
}; };
}()); }());
function create_main_fragment(state, component) { function create_main_fragment(state, component) {
return { return {
create: noop, create: noop,
@ -26,9 +24,9 @@ function create_main_fragment(state, component) {
destroy: noop destroy: noop
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
this._recompute({ x: 1 }, this._state); this._recompute({ x: 1 }, this._state);
@ -39,16 +37,15 @@ function SvelteComponent(options) {
this._fragment.create(); this._fragment.create();
this._fragment.mount(options.target, options.anchor || null); this._fragment.mount(options.target, options.anchor || null);
} }
} }
assign(SvelteComponent.prototype, proto); 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 (differs(state.a, (state.a = template.computed.a(state.x)))) changed.a = true; if (differs(state.a, (state.a = template.computed.a(state.x)))) changed.a = true;
if (differs(state.b, (state.b = template.computed.b(state.x)))) changed.b = true; if (differs(state.b, (state.b = template.computed.b(state.x)))) changed.b = true;
} }
} }
return SvelteComponent;
return SvelteComponent;
}()); }());

@ -187,19 +187,18 @@ var proto = {
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
var _actual = (function() { var _actual = (function() {
function encapsulateStyles(node) {
function encapsulateStyles(node) {
setAttribute(node, "svelte-2363328337", ""); setAttribute(node, "svelte-2363328337", "");
} }
function add_css() { function add_css() {
var style = createElement("style"); var style = createElement("style");
style.id = 'svelte-2363328337-style'; style.id = 'svelte-2363328337-style';
style.textContent = "@media(min-width: 1px){div[svelte-2363328337],[svelte-2363328337] div{color:red}}"; style.textContent = "@media(min-width: 1px){div[svelte-2363328337],[svelte-2363328337] div{color:red}}";
appendNode(style, document.head); appendNode(style, document.head);
} }
function create_main_fragment(state, component) { function create_main_fragment(state, component) {
var div; var div;
return { return {
@ -224,9 +223,9 @@ function create_main_fragment(state, component) {
destroy: noop destroy: noop
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -238,11 +237,10 @@ function SvelteComponent(options) {
this._fragment.create(); this._fragment.create();
this._fragment.mount(options.target, options.anchor || null); this._fragment.mount(options.target, options.anchor || null);
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());
export default _actual; export default _actual;

@ -1,21 +1,19 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { appendNode, assign, createElement, detachNode, init, insertNode, noop, proto, setAttribute } from "svelte/shared.js"; import { appendNode, assign, createElement, detachNode, init, insertNode, noop, proto, setAttribute } from "svelte/shared.js";
export default (function() { export default (function() {
function encapsulateStyles(node) {
function encapsulateStyles(node) {
setAttribute(node, "svelte-2363328337", ""); setAttribute(node, "svelte-2363328337", "");
} }
function add_css() { function add_css() {
var style = createElement("style"); var style = createElement("style");
style.id = 'svelte-2363328337-style'; style.id = 'svelte-2363328337-style';
style.textContent = "@media(min-width: 1px){div[svelte-2363328337],[svelte-2363328337] div{color:red}}"; style.textContent = "@media(min-width: 1px){div[svelte-2363328337],[svelte-2363328337] div{color:red}}";
appendNode(style, document.head); appendNode(style, document.head);
} }
function create_main_fragment(state, component) { function create_main_fragment(state, component) {
var div; var div;
return { return {
@ -40,9 +38,9 @@ function create_main_fragment(state, component) {
destroy: noop destroy: noop
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -54,9 +52,8 @@ function SvelteComponent(options) {
this._fragment.create(); this._fragment.create();
this._fragment.mount(options.target, options.anchor || null); this._fragment.mount(options.target, options.anchor || null);
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());

@ -187,8 +187,7 @@ var proto = {
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
var _actual = (function() { var _actual = (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var div, text; var div, text;
return { return {
@ -210,9 +209,9 @@ function create_main_fragment(state, component) {
destroy: noop destroy: noop
}; };
} }
class SvelteComponent extends HTMLElement { class SvelteComponent extends HTMLElement {
constructor(options = {}) { constructor(options = {}) {
super(); super();
init(this, options); init(this, options);
@ -236,10 +235,10 @@ class SvelteComponent extends HTMLElement {
attributeChangedCallback(attr, oldValue, newValue) { attributeChangedCallback(attr, oldValue, newValue) {
this.set({ [attr]: newValue }); this.set({ [attr]: newValue });
} }
} }
customElements.define("custom-element", SvelteComponent); customElements.define("custom-element", SvelteComponent);
assign(SvelteComponent.prototype, proto, { assign(SvelteComponent.prototype, proto, {
_mount(target, anchor) { _mount(target, anchor) {
target.insertBefore(this, anchor); target.insertBefore(this, anchor);
}, },
@ -247,9 +246,8 @@ assign(SvelteComponent.prototype, proto, {
_unmount() { _unmount() {
this.parentNode.removeChild(this); this.parentNode.removeChild(this);
} }
}); });
return SvelteComponent;
return SvelteComponent;
}()); }());
export default _actual; export default _actual;

@ -1,10 +1,8 @@
/* 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 { appendNode, assign, createElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
export default (function() { export default (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var div, text; var div, text;
return { return {
@ -26,9 +24,9 @@ function create_main_fragment(state, component) {
destroy: noop destroy: noop
}; };
} }
class SvelteComponent extends HTMLElement { class SvelteComponent extends HTMLElement {
constructor(options = {}) { constructor(options = {}) {
super(); super();
init(this, options); init(this, options);
@ -52,10 +50,10 @@ class SvelteComponent extends HTMLElement {
attributeChangedCallback(attr, oldValue, newValue) { attributeChangedCallback(attr, oldValue, newValue) {
this.set({ [attr]: newValue }); this.set({ [attr]: newValue });
} }
} }
customElements.define("custom-element", SvelteComponent); customElements.define("custom-element", SvelteComponent);
assign(SvelteComponent.prototype, proto, { assign(SvelteComponent.prototype, proto, {
_mount(target, anchor) { _mount(target, anchor) {
target.insertBefore(this, anchor); target.insertBefore(this, anchor);
}, },
@ -63,7 +61,6 @@ assign(SvelteComponent.prototype, proto, {
_unmount() { _unmount() {
this.parentNode.removeChild(this); this.parentNode.removeChild(this);
} }
}); });
return SvelteComponent;
return SvelteComponent;
}()); }());

@ -200,8 +200,7 @@ var proto = {
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
var _actual = (function() { var _actual = (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var text, p, text_1; var text, p, text_1;
var comments = state.comments; var comments = state.comments;
@ -272,10 +271,10 @@ function create_main_fragment(state, component) {
destroyEach(each_blocks, false, 0); destroyEach(each_blocks, false, 0);
} }
}; };
} }
// (1:0) {{#each comments as comment, i}} // (1:0) {{#each comments as comment, i}}
function create_each_block(state, comments, comment, i, component) { function create_each_block(state, comments, comment, i, component) {
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; 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 { return {
@ -337,9 +336,9 @@ function create_each_block(state, comments, comment, i, component) {
destroy: noop destroy: noop
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -349,11 +348,10 @@ function SvelteComponent(options) {
this._fragment.create(); this._fragment.create();
this._fragment.mount(options.target, options.anchor || null); this._fragment.mount(options.target, options.anchor || null);
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());
export default _actual; export default _actual;

@ -1,10 +1,8 @@
/* 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 { appendNode, assign, createElement, createText, destroyEach, detachAfter, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
export default (function() { export default (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var text, p, text_1; var text, p, text_1;
var comments = state.comments; var comments = state.comments;
@ -75,10 +73,10 @@ function create_main_fragment(state, component) {
destroyEach(each_blocks, false, 0); destroyEach(each_blocks, false, 0);
} }
}; };
} }
// (1:0) {{#each comments as comment, i}} // (1:0) {{#each comments as comment, i}}
function create_each_block(state, comments, comment, i, component) { function create_each_block(state, comments, comment, i, component) {
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; 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 { return {
@ -140,9 +138,9 @@ function create_each_block(state, comments, comment, i, component) {
destroy: noop destroy: noop
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -152,9 +150,8 @@ function SvelteComponent(options) {
this._fragment.create(); this._fragment.create();
this._fragment.mount(options.target, options.anchor || null); this._fragment.mount(options.target, options.anchor || null);
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());

@ -187,8 +187,7 @@ var proto = {
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
var _actual = (function() { var _actual = (function() {
var template = (function() {
var template = (function() {
return { return {
methods: { methods: {
foo ( bar ) { foo ( bar ) {
@ -203,7 +202,7 @@ var template = (function() {
}; };
}()); }());
function create_main_fragment(state, component) { function create_main_fragment(state, component) {
var button, foo_handler, text; var button, foo_handler, text;
return { return {
@ -235,9 +234,9 @@ function create_main_fragment(state, component) {
foo_handler.teardown(); foo_handler.teardown();
} }
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -247,11 +246,10 @@ function SvelteComponent(options) {
this._fragment.create(); this._fragment.create();
this._fragment.mount(options.target, options.anchor || null); this._fragment.mount(options.target, options.anchor || null);
} }
} }
assign(SvelteComponent.prototype, template.methods, proto);
return SvelteComponent; assign(SvelteComponent.prototype, template.methods, proto);
return SvelteComponent;
}()); }());
export default _actual; export default _actual;

@ -1,10 +1,8 @@
/* 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 { appendNode, assign, createElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
export default (function() { export default (function() {
var template = (function() {
var template = (function() {
return { return {
methods: { methods: {
foo ( bar ) { foo ( bar ) {
@ -19,7 +17,7 @@ var template = (function() {
}; };
}()); }());
function create_main_fragment(state, component) { function create_main_fragment(state, component) {
var button, foo_handler, text; var button, foo_handler, text;
return { return {
@ -51,9 +49,9 @@ function create_main_fragment(state, component) {
foo_handler.teardown(); foo_handler.teardown();
} }
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -63,9 +61,8 @@ function SvelteComponent(options) {
this._fragment.create(); this._fragment.create();
this._fragment.mount(options.target, options.anchor || null); this._fragment.mount(options.target, options.anchor || null);
} }
} }
assign(SvelteComponent.prototype, template.methods, proto);
return SvelteComponent; assign(SvelteComponent.prototype, template.methods, proto);
return SvelteComponent;
}()); }());

@ -191,8 +191,7 @@ var proto = {
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
var _actual = (function() { var _actual = (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var if_block_anchor; var if_block_anchor;
var current_block_type = select_block_type(state); var current_block_type = select_block_type(state);
@ -228,10 +227,10 @@ function create_main_fragment(state, component) {
if_block.destroy(); if_block.destroy();
} }
}; };
} }
// (1:0) {{#if foo}} // (1:0) {{#if foo}}
function create_if_block(state, component) { function create_if_block(state, component) {
var p, text; var p, text;
return { return {
@ -251,10 +250,10 @@ function create_if_block(state, component) {
destroy: noop destroy: noop
}; };
} }
// (3:0) {{else}} // (3:0) {{else}}
function create_if_block_1(state, component) { function create_if_block_1(state, component) {
var p, text; var p, text;
return { return {
@ -274,14 +273,14 @@ function create_if_block_1(state, component) {
destroy: noop destroy: noop
}; };
} }
function select_block_type(state) { function select_block_type(state) {
if (state.foo) return create_if_block; if (state.foo) return create_if_block;
return create_if_block_1; return create_if_block_1;
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -291,11 +290,10 @@ function SvelteComponent(options) {
this._fragment.create(); this._fragment.create();
this._fragment.mount(options.target, options.anchor || null); this._fragment.mount(options.target, options.anchor || null);
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());
export default _actual; export default _actual;

@ -1,10 +1,8 @@
/* 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 { appendNode, assign, createComment, createElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
export default (function() { export default (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var if_block_anchor; var if_block_anchor;
var current_block_type = select_block_type(state); var current_block_type = select_block_type(state);
@ -40,10 +38,10 @@ function create_main_fragment(state, component) {
if_block.destroy(); if_block.destroy();
} }
}; };
} }
// (1:0) {{#if foo}} // (1:0) {{#if foo}}
function create_if_block(state, component) { function create_if_block(state, component) {
var p, text; var p, text;
return { return {
@ -63,10 +61,10 @@ function create_if_block(state, component) {
destroy: noop destroy: noop
}; };
} }
// (3:0) {{else}} // (3:0) {{else}}
function create_if_block_1(state, component) { function create_if_block_1(state, component) {
var p, text; var p, text;
return { return {
@ -86,14 +84,14 @@ function create_if_block_1(state, component) {
destroy: noop destroy: noop
}; };
} }
function select_block_type(state) { function select_block_type(state) {
if (state.foo) return create_if_block; if (state.foo) return create_if_block;
return create_if_block_1; return create_if_block_1;
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -103,9 +101,8 @@ function SvelteComponent(options) {
this._fragment.create(); this._fragment.create();
this._fragment.mount(options.target, options.anchor || null); this._fragment.mount(options.target, options.anchor || null);
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());

@ -191,8 +191,7 @@ var proto = {
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
var _actual = (function() { var _actual = (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var if_block_anchor; var if_block_anchor;
var if_block = (state.foo) && create_if_block(state, component); var if_block = (state.foo) && create_if_block(state, component);
@ -231,10 +230,10 @@ function create_main_fragment(state, component) {
if (if_block) if_block.destroy(); if (if_block) if_block.destroy();
} }
}; };
} }
// (1:0) {{#if foo}} // (1:0) {{#if foo}}
function create_if_block(state, component) { function create_if_block(state, component) {
var p, text; var p, text;
return { return {
@ -254,9 +253,9 @@ function create_if_block(state, component) {
destroy: noop destroy: noop
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -266,11 +265,10 @@ function SvelteComponent(options) {
this._fragment.create(); this._fragment.create();
this._fragment.mount(options.target, options.anchor || null); this._fragment.mount(options.target, options.anchor || null);
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());
export default _actual; export default _actual;

@ -1,10 +1,8 @@
/* 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 { appendNode, assign, createComment, createElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
export default (function() { export default (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var if_block_anchor; var if_block_anchor;
var if_block = (state.foo) && create_if_block(state, component); var if_block = (state.foo) && create_if_block(state, component);
@ -43,10 +41,10 @@ function create_main_fragment(state, component) {
if (if_block) if_block.destroy(); if (if_block) if_block.destroy();
} }
}; };
} }
// (1:0) {{#if foo}} // (1:0) {{#if foo}}
function create_if_block(state, component) { function create_if_block(state, component) {
var p, text; var p, text;
return { return {
@ -66,9 +64,9 @@ function create_if_block(state, component) {
destroy: noop destroy: noop
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -78,9 +76,8 @@ function SvelteComponent(options) {
this._fragment.create(); this._fragment.create();
this._fragment.mount(options.target, options.anchor || null); this._fragment.mount(options.target, options.anchor || null);
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());

@ -183,8 +183,7 @@ var proto = {
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
var _actual = (function() { var _actual = (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var div; var div;
return { return {
@ -218,9 +217,9 @@ function create_main_fragment(state, component) {
destroy: noop destroy: noop
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -230,11 +229,10 @@ function SvelteComponent(options) {
this._fragment.create(); this._fragment.create();
this._fragment.mount(options.target, options.anchor || null); this._fragment.mount(options.target, options.anchor || null);
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());
export default _actual; export default _actual;

@ -1,10 +1,8 @@
/* 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 { assign, createElement, detachNode, init, insertNode, noop, proto, setStyle } from "svelte/shared.js";
export default (function() { export default (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var div; var div;
return { return {
@ -38,9 +36,9 @@ function create_main_fragment(state, component) {
destroy: noop destroy: noop
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -50,9 +48,8 @@ function SvelteComponent(options) {
this._fragment.create(); this._fragment.create();
this._fragment.mount(options.target, options.anchor || null); this._fragment.mount(options.target, options.anchor || null);
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());

@ -183,8 +183,7 @@ var proto = {
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
var _actual = (function() { var _actual = (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var div; var div;
return { return {
@ -213,9 +212,9 @@ function create_main_fragment(state, component) {
destroy: noop destroy: noop
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -225,11 +224,10 @@ function SvelteComponent(options) {
this._fragment.create(); this._fragment.create();
this._fragment.mount(options.target, options.anchor || null); this._fragment.mount(options.target, options.anchor || null);
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());
export default _actual; export default _actual;

@ -1,10 +1,8 @@
/* 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 { assign, createElement, detachNode, init, insertNode, noop, proto, setStyle } from "svelte/shared.js";
export default (function() { export default (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var div; var div;
return { return {
@ -33,9 +31,9 @@ function create_main_fragment(state, component) {
destroy: noop destroy: noop
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -45,9 +43,8 @@ function SvelteComponent(options) {
this._fragment.create(); this._fragment.create();
this._fragment.mount(options.target, options.anchor || null); this._fragment.mount(options.target, options.anchor || null);
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());

@ -183,8 +183,7 @@ var proto = {
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
var _actual = (function() { var _actual = (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var div; var div;
return { return {
@ -213,9 +212,9 @@ function create_main_fragment(state, component) {
destroy: noop destroy: noop
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -225,11 +224,10 @@ function SvelteComponent(options) {
this._fragment.create(); this._fragment.create();
this._fragment.mount(options.target, options.anchor || null); this._fragment.mount(options.target, options.anchor || null);
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());
export default _actual; export default _actual;

@ -1,10 +1,8 @@
/* 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 { assign, createElement, detachNode, init, insertNode, noop, proto, setStyle } from "svelte/shared.js";
export default (function() { export default (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var div; var div;
return { return {
@ -33,9 +31,9 @@ function create_main_fragment(state, component) {
destroy: noop destroy: noop
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -45,9 +43,8 @@ function SvelteComponent(options) {
this._fragment.create(); this._fragment.create();
this._fragment.mount(options.target, options.anchor || null); this._fragment.mount(options.target, options.anchor || null);
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());

@ -183,8 +183,7 @@ var proto = {
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
var _actual = (function() { var _actual = (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var div, text, div_1, div_1_style_value; var div, text, div_1, div_1_style_value;
return { return {
@ -224,9 +223,9 @@ function create_main_fragment(state, component) {
destroy: noop destroy: noop
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -236,11 +235,10 @@ function SvelteComponent(options) {
this._fragment.create(); this._fragment.create();
this._fragment.mount(options.target, options.anchor || null); this._fragment.mount(options.target, options.anchor || null);
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());
export default _actual; export default _actual;

@ -1,10 +1,8 @@
/* 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 { assign, createElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
export default (function() { export default (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var div, text, div_1, div_1_style_value; var div, text, div_1, div_1_style_value;
return { return {
@ -44,9 +42,9 @@ function create_main_fragment(state, component) {
destroy: noop destroy: noop
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -56,9 +54,8 @@ function SvelteComponent(options) {
this._fragment.create(); this._fragment.create();
this._fragment.mount(options.target, options.anchor || null); this._fragment.mount(options.target, options.anchor || null);
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());

@ -187,8 +187,7 @@ var proto = {
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
var _actual = (function() { var _actual = (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var input; var input;
function input_change_handler() { function input_change_handler() {
@ -224,9 +223,9 @@ function create_main_fragment(state, component) {
removeListener(input, "change", input_change_handler); removeListener(input, "change", input_change_handler);
} }
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -236,11 +235,10 @@ function SvelteComponent(options) {
this._fragment.create(); this._fragment.create();
this._fragment.mount(options.target, options.anchor || null); this._fragment.mount(options.target, options.anchor || null);
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());
export default _actual; export default _actual;

@ -1,10 +1,8 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { addListener, assign, createElement, detachNode, init, insertNode, proto, removeListener } from "svelte/shared.js"; import { addListener, assign, createElement, detachNode, init, insertNode, proto, removeListener } from "svelte/shared.js";
export default (function() { export default (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var input; var input;
function input_change_handler() { function input_change_handler() {
@ -40,9 +38,9 @@ function create_main_fragment(state, component) {
removeListener(input, "change", input_change_handler); removeListener(input, "change", input_change_handler);
} }
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -52,9 +50,8 @@ function SvelteComponent(options) {
this._fragment.create(); this._fragment.create();
this._fragment.mount(options.target, options.anchor || null); this._fragment.mount(options.target, options.anchor || null);
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());

@ -185,8 +185,7 @@ var proto = {
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
var _actual = (function() { var _actual = (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var input; var input;
return { return {
@ -211,9 +210,9 @@ function create_main_fragment(state, component) {
destroy: noop destroy: noop
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -223,11 +222,10 @@ function SvelteComponent(options) {
this._fragment.create(); this._fragment.create();
this._fragment.mount(options.target, options.anchor || null); this._fragment.mount(options.target, options.anchor || null);
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());
export default _actual; export default _actual;

@ -1,10 +1,8 @@
/* 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 { assign, createElement, detachNode, init, insertNode, noop, proto, setInputType } from "svelte/shared.js";
export default (function() { export default (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var input; var input;
return { return {
@ -29,9 +27,9 @@ function create_main_fragment(state, component) {
destroy: noop destroy: noop
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -41,9 +39,8 @@ function SvelteComponent(options) {
this._fragment.create(); this._fragment.create();
this._fragment.mount(options.target, options.anchor || null); this._fragment.mount(options.target, options.anchor || null);
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());

@ -202,8 +202,7 @@ var proto = {
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
var _actual = (function() { var _actual = (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var div; var div;
return { return {
@ -236,9 +235,9 @@ function create_main_fragment(state, component) {
destroy: noop destroy: noop
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -250,11 +249,10 @@ function SvelteComponent(options) {
nodes.forEach(detachNode); nodes.forEach(detachNode);
this._fragment.mount(options.target, options.anchor || null); this._fragment.mount(options.target, options.anchor || null);
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());
export default _actual; export default _actual;

@ -1,10 +1,8 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { assign, children, claimElement, createElement, detachNode, init, insertNode, noop, proto } from "svelte/shared.js"; import { assign, children, claimElement, createElement, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
export default (function() { export default (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var div; var div;
return { return {
@ -37,9 +35,9 @@ function create_main_fragment(state, component) {
destroy: noop destroy: noop
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -51,9 +49,8 @@ function SvelteComponent(options) {
nodes.forEach(detachNode); nodes.forEach(detachNode);
this._fragment.mount(options.target, options.anchor || null); this._fragment.mount(options.target, options.anchor || null);
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());

@ -195,8 +195,7 @@ var proto = {
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
var _actual = (function() { var _actual = (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var audio, audio_updating = false, audio_animationframe, audio_paused_value = true; var audio, audio_updating = false, audio_animationframe, audio_paused_value = true;
function audio_progress_loadedmetadata_handler() { function audio_progress_loadedmetadata_handler() {
@ -300,9 +299,9 @@ function create_main_fragment(state, component) {
removeListener(audio, "play", audio_pause_handler); removeListener(audio, "play", audio_pause_handler);
} }
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -319,11 +318,10 @@ function SvelteComponent(options) {
callAll(this._beforecreate); callAll(this._beforecreate);
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());
export default _actual; export default _actual;

@ -1,10 +1,8 @@
/* 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 { addListener, assign, callAll, createElement, detachNode, init, insertNode, proto, removeListener, timeRangesToArray } from "svelte/shared.js";
export default (function() { export default (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var audio, audio_updating = false, audio_animationframe, audio_paused_value = true; var audio, audio_updating = false, audio_animationframe, audio_paused_value = true;
function audio_progress_loadedmetadata_handler() { function audio_progress_loadedmetadata_handler() {
@ -108,9 +106,9 @@ function create_main_fragment(state, component) {
removeListener(audio, "play", audio_pause_handler); removeListener(audio, "play", audio_pause_handler);
} }
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -127,9 +125,8 @@ function SvelteComponent(options) {
callAll(this._beforecreate); callAll(this._beforecreate);
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());

@ -181,8 +181,7 @@ var proto = {
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
var _actual = (function() { var _actual = (function() {
var template = (function() {
var template = (function() {
return { return {
components: { components: {
NonImported NonImported
@ -190,7 +189,7 @@ var template = (function() {
}; };
}()); }());
function create_main_fragment(state, component) { function create_main_fragment(state, component) {
var text; var text;
var imported = new Imported({ var imported = new Imported({
@ -227,9 +226,9 @@ function create_main_fragment(state, component) {
nonimported.destroy(false); nonimported.destroy(false);
} }
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -251,11 +250,10 @@ function SvelteComponent(options) {
callAll(this._aftercreate); callAll(this._aftercreate);
this._lock = false; this._lock = false;
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());
export default _actual; export default _actual;

@ -3,8 +3,7 @@ import { assign, callAll, createText, detachNode, init, insertNode, noop, proto
import Imported from 'Imported.html'; import Imported from 'Imported.html';
export default (function() { export default (function() {
var template = (function() {
var template = (function() {
return { return {
components: { components: {
NonImported NonImported
@ -12,7 +11,7 @@ var template = (function() {
}; };
}()); }());
function create_main_fragment(state, component) { function create_main_fragment(state, component) {
var text; var text;
var imported = new Imported({ var imported = new Imported({
@ -49,9 +48,9 @@ function create_main_fragment(state, component) {
nonimported.destroy(false); nonimported.destroy(false);
} }
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -73,9 +72,8 @@ function SvelteComponent(options) {
callAll(this._aftercreate); callAll(this._aftercreate);
this._lock = false; this._lock = false;
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());

@ -167,8 +167,7 @@ var proto = {
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
var _actual = (function() { var _actual = (function() {
var template = (function() {
var template = (function() {
return { return {
// this test should be removed in v2 // this test should be removed in v2
oncreate () {}, oncreate () {},
@ -176,7 +175,7 @@ var template = (function() {
}; };
}()); }());
function create_main_fragment(state, component) { function create_main_fragment(state, component) {
return { return {
create: noop, create: noop,
@ -189,9 +188,9 @@ function create_main_fragment(state, component) {
destroy: noop destroy: noop
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -213,11 +212,10 @@ function SvelteComponent(options) {
callAll(this._oncreate); callAll(this._oncreate);
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());
export default _actual; export default _actual;

@ -1,10 +1,8 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { assign, callAll, init, noop, proto } from "svelte/shared.js"; import { assign, callAll, init, noop, proto } from "svelte/shared.js";
export default (function() { export default (function() {
var template = (function() {
var template = (function() {
return { return {
// this test should be removed in v2 // this test should be removed in v2
oncreate () {}, oncreate () {},
@ -12,7 +10,7 @@ var template = (function() {
}; };
}()); }());
function create_main_fragment(state, component) { function create_main_fragment(state, component) {
return { return {
create: noop, create: noop,
@ -25,9 +23,9 @@ function create_main_fragment(state, component) {
destroy: noop destroy: noop
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -49,9 +47,8 @@ function SvelteComponent(options) {
callAll(this._oncreate); callAll(this._oncreate);
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());

@ -167,8 +167,7 @@ var proto = {
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
var _actual = (function() { var _actual = (function() {
var template = (function() {
var template = (function() {
return { return {
methods: { methods: {
foo ( bar ) { foo ( bar ) {
@ -187,7 +186,7 @@ var template = (function() {
}; };
}()); }());
function create_main_fragment(state, component) { function create_main_fragment(state, component) {
return { return {
create: noop, create: noop,
@ -200,9 +199,9 @@ function create_main_fragment(state, component) {
destroy: noop destroy: noop
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -212,13 +211,12 @@ function SvelteComponent(options) {
this._fragment.create(); this._fragment.create();
this._fragment.mount(options.target, options.anchor || null); this._fragment.mount(options.target, options.anchor || null);
} }
} }
assign(SvelteComponent.prototype, template.methods, proto);
template.setup(SvelteComponent); assign(SvelteComponent.prototype, template.methods, proto);
return SvelteComponent; template.setup(SvelteComponent);
return SvelteComponent;
}()); }());
export default _actual; export default _actual;

@ -1,10 +1,8 @@
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
import { assign, init, noop, proto } from "svelte/shared.js"; import { assign, init, noop, proto } from "svelte/shared.js";
export default (function() { export default (function() {
var template = (function() {
var template = (function() {
return { return {
methods: { methods: {
foo ( bar ) { foo ( bar ) {
@ -23,7 +21,7 @@ var template = (function() {
}; };
}()); }());
function create_main_fragment(state, component) { function create_main_fragment(state, component) {
return { return {
create: noop, create: noop,
@ -36,9 +34,9 @@ function create_main_fragment(state, component) {
destroy: noop destroy: noop
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -48,11 +46,10 @@ function SvelteComponent(options) {
this._fragment.create(); this._fragment.create();
this._fragment.mount(options.target, options.anchor || null); this._fragment.mount(options.target, options.anchor || null);
} }
} }
assign(SvelteComponent.prototype, template.methods, proto);
template.setup(SvelteComponent); assign(SvelteComponent.prototype, template.methods, proto);
return SvelteComponent; template.setup(SvelteComponent);
return SvelteComponent;
}()); }());

@ -191,8 +191,7 @@ var proto = {
/* generated by Svelte vX.Y.Z */ /* generated by Svelte vX.Y.Z */
var _actual = (function() { var _actual = (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var div, text, p, text_1, text_2, text_3, text_4, p_1, text_5, text_6, text_8, if_block_4_anchor; var div, text, p, text_1, text_2, text_3, text_4, p_1, text_5, text_6, text_8, if_block_4_anchor;
var if_block = (state.a) && create_if_block(state, component); var if_block = (state.a) && create_if_block(state, component);
@ -327,10 +326,10 @@ function create_main_fragment(state, component) {
if (if_block_4) if_block_4.destroy(); if (if_block_4) if_block_4.destroy();
} }
}; };
} }
// (2:1) {{#if a}} // (2:1) {{#if a}}
function create_if_block(state, component) { function create_if_block(state, component) {
var p, text; var p, text;
return { return {
@ -350,10 +349,10 @@ function create_if_block(state, component) {
destroy: noop destroy: noop
}; };
} }
// (8:1) {{#if b}} // (8:1) {{#if b}}
function create_if_block_1(state, component) { function create_if_block_1(state, component) {
var p, text; var p, text;
return { return {
@ -373,10 +372,10 @@ function create_if_block_1(state, component) {
destroy: noop destroy: noop
}; };
} }
// (12:1) {{#if c}} // (12:1) {{#if c}}
function create_if_block_2(state, component) { function create_if_block_2(state, component) {
var p, text; var p, text;
return { return {
@ -396,10 +395,10 @@ function create_if_block_2(state, component) {
destroy: noop destroy: noop
}; };
} }
// (18:1) {{#if d}} // (18:1) {{#if d}}
function create_if_block_3(state, component) { function create_if_block_3(state, component) {
var p, text; var p, text;
return { return {
@ -419,10 +418,10 @@ function create_if_block_3(state, component) {
destroy: noop destroy: noop
}; };
} }
// (25:0) {{#if e}} // (25:0) {{#if e}}
function create_if_block_4(state, component) { function create_if_block_4(state, component) {
var p, text; var p, text;
return { return {
@ -442,9 +441,9 @@ function create_if_block_4(state, component) {
destroy: noop destroy: noop
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -454,11 +453,10 @@ function SvelteComponent(options) {
this._fragment.create(); this._fragment.create();
this._fragment.mount(options.target, options.anchor || null); this._fragment.mount(options.target, options.anchor || null);
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());
export default _actual; export default _actual;

@ -1,10 +1,8 @@
/* 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 { appendNode, assign, createComment, createElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
export default (function() { export default (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var div, text, p, text_1, text_2, text_3, text_4, p_1, text_5, text_6, text_8, if_block_4_anchor; var div, text, p, text_1, text_2, text_3, text_4, p_1, text_5, text_6, text_8, if_block_4_anchor;
var if_block = (state.a) && create_if_block(state, component); var if_block = (state.a) && create_if_block(state, component);
@ -139,10 +137,10 @@ function create_main_fragment(state, component) {
if (if_block_4) if_block_4.destroy(); if (if_block_4) if_block_4.destroy();
} }
}; };
} }
// (2:1) {{#if a}} // (2:1) {{#if a}}
function create_if_block(state, component) { function create_if_block(state, component) {
var p, text; var p, text;
return { return {
@ -162,10 +160,10 @@ function create_if_block(state, component) {
destroy: noop destroy: noop
}; };
} }
// (8:1) {{#if b}} // (8:1) {{#if b}}
function create_if_block_1(state, component) { function create_if_block_1(state, component) {
var p, text; var p, text;
return { return {
@ -185,10 +183,10 @@ function create_if_block_1(state, component) {
destroy: noop destroy: noop
}; };
} }
// (12:1) {{#if c}} // (12:1) {{#if c}}
function create_if_block_2(state, component) { function create_if_block_2(state, component) {
var p, text; var p, text;
return { return {
@ -208,10 +206,10 @@ function create_if_block_2(state, component) {
destroy: noop destroy: noop
}; };
} }
// (18:1) {{#if d}} // (18:1) {{#if d}}
function create_if_block_3(state, component) { function create_if_block_3(state, component) {
var p, text; var p, text;
return { return {
@ -231,10 +229,10 @@ function create_if_block_3(state, component) {
destroy: noop destroy: noop
}; };
} }
// (25:0) {{#if e}} // (25:0) {{#if e}}
function create_if_block_4(state, component) { function create_if_block_4(state, component) {
var p, text; var p, text;
return { return {
@ -254,9 +252,9 @@ function create_if_block_4(state, component) {
destroy: noop destroy: noop
}; };
} }
function SvelteComponent(options) { function SvelteComponent(options) {
init(this, options); init(this, options);
this._state = options.data || {}; this._state = options.data || {};
@ -266,9 +264,8 @@ function SvelteComponent(options) {
this._fragment.create(); this._fragment.create();
this._fragment.mount(options.target, options.anchor || null); this._fragment.mount(options.target, options.anchor || null);
} }
} }
assign(SvelteComponent.prototype, proto);
return SvelteComponent; assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}()); }());
Loading…
Cancel
Save