From a9ea4ce0413e58a0730cd908e1db258620f62137 Mon Sep 17 00:00:00 2001 From: pk Date: Fri, 9 Nov 2018 20:18:16 +0100 Subject: [PATCH 001/409] Failing test for #1844 --- .../Nested.html | 3 +++ .../_config.js | 2 ++ .../main.html | 13 +++++++++++++ 3 files changed, 18 insertions(+) create mode 100644 test/runtime/samples/component-slot-binding-dimensions-destroys-cleanly/Nested.html create mode 100644 test/runtime/samples/component-slot-binding-dimensions-destroys-cleanly/_config.js create mode 100644 test/runtime/samples/component-slot-binding-dimensions-destroys-cleanly/main.html diff --git a/test/runtime/samples/component-slot-binding-dimensions-destroys-cleanly/Nested.html b/test/runtime/samples/component-slot-binding-dimensions-destroys-cleanly/Nested.html new file mode 100644 index 0000000000..6ddd61d4d1 --- /dev/null +++ b/test/runtime/samples/component-slot-binding-dimensions-destroys-cleanly/Nested.html @@ -0,0 +1,3 @@ +

+ +

diff --git a/test/runtime/samples/component-slot-binding-dimensions-destroys-cleanly/_config.js b/test/runtime/samples/component-slot-binding-dimensions-destroys-cleanly/_config.js new file mode 100644 index 0000000000..02a61bed5e --- /dev/null +++ b/test/runtime/samples/component-slot-binding-dimensions-destroys-cleanly/_config.js @@ -0,0 +1,2 @@ +export default { +}; diff --git a/test/runtime/samples/component-slot-binding-dimensions-destroys-cleanly/main.html b/test/runtime/samples/component-slot-binding-dimensions-destroys-cleanly/main.html new file mode 100644 index 0000000000..3f5fad9363 --- /dev/null +++ b/test/runtime/samples/component-slot-binding-dimensions-destroys-cleanly/main.html @@ -0,0 +1,13 @@ + + Hello + + + From 2491b163413e554689f5f1357152e9d9a06068ac Mon Sep 17 00:00:00 2001 From: pk Date: Wed, 30 Jan 2019 18:27:11 +0100 Subject: [PATCH 002/409] Failing test for #1999 --- .../each-block-keyed-recursive/_config.js | 26 +++++++++++++++++++ .../each-block-keyed-recursive/main.html | 12 +++++++++ 2 files changed, 38 insertions(+) create mode 100644 test/runtime/samples/each-block-keyed-recursive/_config.js create mode 100644 test/runtime/samples/each-block-keyed-recursive/main.html diff --git a/test/runtime/samples/each-block-keyed-recursive/_config.js b/test/runtime/samples/each-block-keyed-recursive/_config.js new file mode 100644 index 0000000000..e124f14ccf --- /dev/null +++ b/test/runtime/samples/each-block-keyed-recursive/_config.js @@ -0,0 +1,26 @@ +export default { + props: { + titles: [{ name: 'b' }, { name: 'c' }], + tree: [ + {id: 1, sub: null}, + {id: 2, sub: [{id: 11}]} + ] + }, + + html: ` +
1
+
2\n
11
+ `, + + test({ assert, component, target }) { + component.tree = [ + {id: 1, sub: null}, + {id: 2, sub: null} + ]; + + assert.htmlEqual(target.innerHTML, ` +
1
+
2
+ `); + } +}; diff --git a/test/runtime/samples/each-block-keyed-recursive/main.html b/test/runtime/samples/each-block-keyed-recursive/main.html new file mode 100644 index 0000000000..5e90ec501c --- /dev/null +++ b/test/runtime/samples/each-block-keyed-recursive/main.html @@ -0,0 +1,12 @@ + + +{#each tree as item, i (item.id)} +
+ {item.id} + {#if item.sub} + + {/if} +
+{/each} From 6550fe8116ae249f1f074e1a5c8a403ca84c0813 Mon Sep 17 00:00:00 2001 From: pk Date: Wed, 30 Jan 2019 18:45:24 +0100 Subject: [PATCH 003/409] Oops --- test/runtime/samples/each-block-keyed-recursive/_config.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/runtime/samples/each-block-keyed-recursive/_config.js b/test/runtime/samples/each-block-keyed-recursive/_config.js index e124f14ccf..7ad044228b 100644 --- a/test/runtime/samples/each-block-keyed-recursive/_config.js +++ b/test/runtime/samples/each-block-keyed-recursive/_config.js @@ -1,6 +1,5 @@ export default { props: { - titles: [{ name: 'b' }, { name: 'c' }], tree: [ {id: 1, sub: null}, {id: 2, sub: [{id: 11}]} From 256fd84fcb72681cd0d1afa1b9b0290fdc29403a Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Sun, 17 Mar 2019 16:14:41 -0400 Subject: [PATCH 004/409] allow transition functions to return nothing --- src/internal/transitions.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/internal/transitions.js b/src/internal/transitions.js index a6579b0cef..8af0d37f89 100644 --- a/src/internal/transitions.js +++ b/src/internal/transitions.js @@ -40,6 +40,8 @@ export function on_outro(callback) { outros.callbacks.push(callback); } +const null_transition = { duration: 0 }; + export function create_in_transition(node, fn, params) { let config = fn(node, params); let running = false; @@ -58,7 +60,7 @@ export function create_in_transition(node, fn, params) { easing = linear, tick = noop, css - } = config; + } = config || null_transition; if (css) animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++); tick(0, 1); @@ -132,7 +134,7 @@ export function create_out_transition(node, fn, params) { easing = linear, tick = noop, css - } = config; + } = config || null_transition; if (css) animation_name = create_rule(node, 1, 0, duration, delay, easing, css); @@ -221,7 +223,7 @@ export function create_bidirectional_transition(node, fn, params, intro) { easing = linear, tick = noop, css - } = config; + } = config || null_transition; const program = { start: window.performance.now() + delay, From cf7c7d15eda52e0c6da08e8dd7b10805e6679910 Mon Sep 17 00:00:00 2001 From: Vlad Glushchuk Date: Mon, 8 Apr 2019 20:28:16 +0200 Subject: [PATCH 005/409] Add bind:text and bind:html support for contenteditable elements Fixes #310 --- src/compile/nodes/Element.ts | 21 ++++++++- .../render-dom/wrappers/Element/Binding.ts | 16 +++++++ .../render-dom/wrappers/Element/index.ts | 6 +++ src/compile/render-ssr/handlers/Element.ts | 23 +++++++--- .../samples/contenteditable-html/_config.js | 43 +++++++++++++++++++ .../samples/contenteditable-html/main.svelte | 6 +++ .../samples/contenteditable-text/_config.js | 37 ++++++++++++++++ .../samples/contenteditable-text/main.svelte | 6 +++ .../contenteditable-dynamic/errors.json | 15 +++++++ .../contenteditable-dynamic/input.svelte | 6 +++ .../contenteditable-missing/errors.json | 15 +++++++ .../contenteditable-missing/input.svelte | 4 ++ 12 files changed, 192 insertions(+), 6 deletions(-) create mode 100644 test/runtime/samples/contenteditable-html/_config.js create mode 100644 test/runtime/samples/contenteditable-html/main.svelte create mode 100644 test/runtime/samples/contenteditable-text/_config.js create mode 100644 test/runtime/samples/contenteditable-text/main.svelte create mode 100644 test/validator/samples/contenteditable-dynamic/errors.json create mode 100644 test/validator/samples/contenteditable-dynamic/input.svelte create mode 100644 test/validator/samples/contenteditable-missing/errors.json create mode 100644 test/validator/samples/contenteditable-missing/input.svelte diff --git a/src/compile/nodes/Element.ts b/src/compile/nodes/Element.ts index bc1991c57e..2838129e36 100644 --- a/src/compile/nodes/Element.ts +++ b/src/compile/nodes/Element.ts @@ -570,7 +570,26 @@ export default class Element extends Node { message: `'${binding.name}' is not a valid binding on void elements like <${this.name}>. Use a wrapper element instead` }); } - } else if (name !== 'this') { + } else if ( + name === 'text' || + name === 'html' + ){ + const contenteditable = this.attributes.find( + (attribute: Attribute) => attribute.name === 'contenteditable' + ); + + if (!contenteditable) { + component.error(binding, { + code: `missing-contenteditable-attribute`, + message: `'contenteditable' attribute is required for text and html two-way bindings` + }); + } else if (contenteditable && !contenteditable.is_static) { + component.error(contenteditable, { + code: `dynamic-contenteditable-attribute`, + message: `'contenteditable' attribute cannot be dynamic if element uses two-way binding` + }); + } + } else if (name !== 'this') { component.error(binding, { code: `invalid-binding`, message: `'${binding.name}' is not a valid binding` diff --git a/src/compile/render-dom/wrappers/Element/Binding.ts b/src/compile/render-dom/wrappers/Element/Binding.ts index 828d664001..d0e5375aef 100644 --- a/src/compile/render-dom/wrappers/Element/Binding.ts +++ b/src/compile/render-dom/wrappers/Element/Binding.ts @@ -201,6 +201,14 @@ function get_dom_updater( return `${element.var}.checked = ${condition};` } + if (binding.node.name === 'text') { + return `${element.var}.textContent = ${binding.snippet};`; + } + + if (binding.node.name === 'html') { + return `${element.var}.innerHTML = ${binding.snippet};`; + } + return `${element.var}.${binding.node.name} = ${binding.snippet};`; } @@ -313,6 +321,14 @@ function get_value_from_dom( return `@time_ranges_to_array(this.${name})` } + if (name === 'text') { + return `this.textContent`; + } + + if (name === 'html') { + return `this.innerHTML`; + } + // everything else return `this.${name}`; } diff --git a/src/compile/render-dom/wrappers/Element/index.ts b/src/compile/render-dom/wrappers/Element/index.ts index 80a8308b93..10a56eaace 100644 --- a/src/compile/render-dom/wrappers/Element/index.ts +++ b/src/compile/render-dom/wrappers/Element/index.ts @@ -29,6 +29,12 @@ const events = [ node.name === 'textarea' || node.name === 'input' && !/radio|checkbox|range/.test(node.get_static_attribute_value('type')) }, + { + event_names: ['input'], + filter: (node: Element, name: string) => + (name === 'text' || name === 'html') && + node.attributes.some(attribute => attribute.name === 'contenteditable') + }, { event_names: ['change'], filter: (node: Element, name: string) => diff --git a/src/compile/render-ssr/handlers/Element.ts b/src/compile/render-ssr/handlers/Element.ts index 0c2cdc489e..f38bc0e151 100644 --- a/src/compile/render-ssr/handlers/Element.ts +++ b/src/compile/render-ssr/handlers/Element.ts @@ -48,7 +48,12 @@ const boolean_attributes = new Set([ export default function(node, renderer, options) { let opening_tag = `<${node.name}`; - let textarea_contents; // awkward special case + let node_contents; // awkward special case + const contenteditable = ( + node.name !== 'textarea' && + node.name !== 'input' && + node.attributes.some((attribute: Node) => attribute.name === 'contenteditable') + ); const slot = node.get_static_attribute_value('slot'); if (slot && node.has_ancestor('InlineComponent')) { @@ -77,7 +82,7 @@ export default function(node, renderer, options) { args.push(snip(attribute.expression)); } else { if (attribute.name === 'value' && node.name === 'textarea') { - textarea_contents = stringify_attribute(attribute, true); + node_contents = stringify_attribute(attribute, true); } else if (attribute.is_true) { args.push(`{ ${quote_name_if_necessary(attribute.name)}: true }`); } else if ( @@ -99,7 +104,7 @@ export default function(node, renderer, options) { if (attribute.type !== 'Attribute') return; if (attribute.name === 'value' && node.name === 'textarea') { - textarea_contents = stringify_attribute(attribute, true); + node_contents = stringify_attribute(attribute, true); } else if (attribute.is_true) { opening_tag += ` ${attribute.name}`; } else if ( @@ -128,6 +133,14 @@ export default function(node, renderer, options) { if (name === 'group') { // TODO server-render group bindings + } else if (contenteditable && (node === 'text' || node === 'html')) { + const snippet = snip(expression) + if (name == 'text') { + node_contents = '${@escape(' + snippet + ')}' + } else { + // Do not escape HTML content + node_contents = '${' + snippet + '}' + } } else { const snippet = snip(expression); opening_tag += ' ${(v => v ? ("' + name + '" + (v === true ? "" : "=" + JSON.stringify(v))) : "")(' + snippet + ')}'; @@ -142,8 +155,8 @@ export default function(node, renderer, options) { renderer.append(opening_tag); - if (node.name === 'textarea' && textarea_contents !== undefined) { - renderer.append(textarea_contents); + if ((node.name === 'textarea' || contenteditable) && node_contents !== undefined) { + renderer.append(node_contents); } else { renderer.render(node.children, options); } diff --git a/test/runtime/samples/contenteditable-html/_config.js b/test/runtime/samples/contenteditable-html/_config.js new file mode 100644 index 0000000000..cd2a822655 --- /dev/null +++ b/test/runtime/samples/contenteditable-html/_config.js @@ -0,0 +1,43 @@ +export default { + props: { + name: 'world', + }, + + html: ` + world +

hello world

+ `, + + ssrHtml: ` + world +

hello world

+ `, + + async test({ assert, component, target, window }) { + const el = target.querySelector('editor'); + assert.equal(el.innerHTML, 'world'); + + el.innerHTML = 'everybody'; + + // No updates to data yet + assert.htmlEqual(target.innerHTML, ` + everybody +

hello world

+ `); + + // Handle user input + const event = new window.Event('input'); + await el.dispatchEvent(event); + assert.htmlEqual(target.innerHTML, ` + everybody +

hello everybody

+ `); + + component.name = 'goodbye'; + assert.equal(el.innerHTML, 'goodbye'); + assert.htmlEqual(target.innerHTML, ` + goodbye +

hello goodbye

+ `); + }, +}; diff --git a/test/runtime/samples/contenteditable-html/main.svelte b/test/runtime/samples/contenteditable-html/main.svelte new file mode 100644 index 0000000000..53b4e81c88 --- /dev/null +++ b/test/runtime/samples/contenteditable-html/main.svelte @@ -0,0 +1,6 @@ + + + +

hello {@html name}

\ No newline at end of file diff --git a/test/runtime/samples/contenteditable-text/_config.js b/test/runtime/samples/contenteditable-text/_config.js new file mode 100644 index 0000000000..4935a3a9a7 --- /dev/null +++ b/test/runtime/samples/contenteditable-text/_config.js @@ -0,0 +1,37 @@ +export default { + props: { + name: 'world', + }, + + html: ` + world +

hello world

+ `, + + ssrHtml: ` + world +

hello world

+ `, + + async test({ assert, component, target, window }) { + const el = target.querySelector('editor'); + assert.equal(el.textContent, 'world'); + + const event = new window.Event('input'); + + el.textContent = 'everybody'; + await el.dispatchEvent(event); + + assert.htmlEqual(target.innerHTML, ` + everybody +

hello everybody

+ `); + + component.name = 'goodbye'; + assert.equal(el.textContent, 'goodbye'); + assert.htmlEqual(target.innerHTML, ` + goodbye +

hello goodbye

+ `); + }, +}; diff --git a/test/runtime/samples/contenteditable-text/main.svelte b/test/runtime/samples/contenteditable-text/main.svelte new file mode 100644 index 0000000000..a71d9f0c5b --- /dev/null +++ b/test/runtime/samples/contenteditable-text/main.svelte @@ -0,0 +1,6 @@ + + + +

hello {name}

\ No newline at end of file diff --git a/test/validator/samples/contenteditable-dynamic/errors.json b/test/validator/samples/contenteditable-dynamic/errors.json new file mode 100644 index 0000000000..0c4c5585a6 --- /dev/null +++ b/test/validator/samples/contenteditable-dynamic/errors.json @@ -0,0 +1,15 @@ +[{ + "code": "dynamic-contenteditable-attribute", + "message": "'contenteditable' attribute cannot be dynamic if element uses two-way binding", + "start": { + "line": 6, + "column": 8, + "character": 73 + }, + "end": { + "line": 6, + "column": 32, + "character": 97 + }, + "pos": 73 +}] \ No newline at end of file diff --git a/test/validator/samples/contenteditable-dynamic/input.svelte b/test/validator/samples/contenteditable-dynamic/input.svelte new file mode 100644 index 0000000000..97d2c9228c --- /dev/null +++ b/test/validator/samples/contenteditable-dynamic/input.svelte @@ -0,0 +1,6 @@ + + diff --git a/test/validator/samples/contenteditable-missing/errors.json b/test/validator/samples/contenteditable-missing/errors.json new file mode 100644 index 0000000000..9cadb20629 --- /dev/null +++ b/test/validator/samples/contenteditable-missing/errors.json @@ -0,0 +1,15 @@ +[{ + "code": "missing-contenteditable-attribute", + "message": "'contenteditable' attribute is required for text and html two-way bindings", + "start": { + "line": 4, + "column": 8, + "character": 48 + }, + "end": { + "line": 4, + "column": 24, + "character": 64 + }, + "pos": 48 +}] \ No newline at end of file diff --git a/test/validator/samples/contenteditable-missing/input.svelte b/test/validator/samples/contenteditable-missing/input.svelte new file mode 100644 index 0000000000..47f125894a --- /dev/null +++ b/test/validator/samples/contenteditable-missing/input.svelte @@ -0,0 +1,4 @@ + + From 8deee95f141f32cd027467eb7c1d2bb8ff597007 Mon Sep 17 00:00:00 2001 From: Vlad Glushchuk Date: Mon, 8 Apr 2019 20:56:52 +0200 Subject: [PATCH 006/409] Fix a typo --- src/compile/render-ssr/handlers/Element.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compile/render-ssr/handlers/Element.ts b/src/compile/render-ssr/handlers/Element.ts index f38bc0e151..cefe44ede8 100644 --- a/src/compile/render-ssr/handlers/Element.ts +++ b/src/compile/render-ssr/handlers/Element.ts @@ -133,7 +133,7 @@ export default function(node, renderer, options) { if (name === 'group') { // TODO server-render group bindings - } else if (contenteditable && (node === 'text' || node === 'html')) { + } else if (contenteditable && (name === 'text' || name === 'html')) { const snippet = snip(expression) if (name == 'text') { node_contents = '${@escape(' + snippet + ')}' From ac3bbbaa55c4908537106292d37b7f95db8abc60 Mon Sep 17 00:00:00 2001 From: Colin Casey Date: Mon, 13 May 2019 22:43:47 -0300 Subject: [PATCH 007/409] FIX: #2281 - trigger onMount callbacks in same order as child components --- src/internal/Component.js | 10 +++++----- src/internal/scheduler.js | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/internal/Component.js b/src/internal/Component.js index 871dbd6054..bf3398f449 100644 --- a/src/internal/Component.js +++ b/src/internal/Component.js @@ -14,9 +14,11 @@ export function mount_component(component, target, anchor) { fragment.m(target, anchor); - // onMount happens after the initial afterUpdate. Because - // afterUpdate callbacks happen in reverse order (inner first) - // we schedule onMount callbacks before afterUpdate callbacks + // afterUpdate callbacks happen in reverse order (inner first) so + // reverse their position so callbacks are properly ordered + after_render.reverse().forEach(add_render_callback); + + // onMount happens after the initial afterUpdate add_render_callback(() => { const new_on_destroy = on_mount.map(run).filter(is_function); if (on_destroy) { @@ -28,8 +30,6 @@ export function mount_component(component, target, anchor) { } component.$$.on_mount = []; }); - - after_render.forEach(add_render_callback); } function destroy(component, detaching) { diff --git a/src/internal/scheduler.js b/src/internal/scheduler.js index 749c3971dc..2ef79c6b69 100644 --- a/src/internal/scheduler.js +++ b/src/internal/scheduler.js @@ -52,7 +52,7 @@ export function flush() { // afterUpdate functions. This may cause // subsequent updates... while (render_callbacks.length) { - const callback = render_callbacks.pop(); + const callback = render_callbacks.shift(); if (!seen_callbacks.has(callback)) { callback(); From 59c4b763837f66c42c8518dfc90269c15421243d Mon Sep 17 00:00:00 2001 From: Colin Casey Date: Thu, 16 May 2019 23:25:28 -0300 Subject: [PATCH 008/409] unit test for child rendering lifecycle --- .../Item.svelte | 30 +++++++++++++++++++ .../_config.js | 24 +++++++++++++++ .../main.svelte | 11 +++++++ .../order.js | 1 + 4 files changed, 66 insertions(+) create mode 100755 test/runtime/samples/lifecycle-render-order-for-children/Item.svelte create mode 100644 test/runtime/samples/lifecycle-render-order-for-children/_config.js create mode 100644 test/runtime/samples/lifecycle-render-order-for-children/main.svelte create mode 100644 test/runtime/samples/lifecycle-render-order-for-children/order.js diff --git a/test/runtime/samples/lifecycle-render-order-for-children/Item.svelte b/test/runtime/samples/lifecycle-render-order-for-children/Item.svelte new file mode 100755 index 0000000000..405c656998 --- /dev/null +++ b/test/runtime/samples/lifecycle-render-order-for-children/Item.svelte @@ -0,0 +1,30 @@ + + +
  • + {logRender()} +
  • diff --git a/test/runtime/samples/lifecycle-render-order-for-children/_config.js b/test/runtime/samples/lifecycle-render-order-for-children/_config.js new file mode 100644 index 0000000000..02ff0d8d95 --- /dev/null +++ b/test/runtime/samples/lifecycle-render-order-for-children/_config.js @@ -0,0 +1,24 @@ +import order from './order.js'; + +export default { + skip_if_ssr: true, + + test({ assert, component, target }) { + assert.deepEqual(order, [ + '1: beforeUpdate', + '1: render', + '2: beforeUpdate', + '2: render', + '3: beforeUpdate', + '3: render', + '1: afterUpdate', + '1: onMount', + '2: afterUpdate', + '2: onMount', + '3: afterUpdate', + '3: onMount' + ]); + + order.length = 0; + } +}; diff --git a/test/runtime/samples/lifecycle-render-order-for-children/main.svelte b/test/runtime/samples/lifecycle-render-order-for-children/main.svelte new file mode 100644 index 0000000000..8320b86d79 --- /dev/null +++ b/test/runtime/samples/lifecycle-render-order-for-children/main.svelte @@ -0,0 +1,11 @@ + + +
      + {#each [1,2,3] as index} + + {/each} +
    + + diff --git a/test/runtime/samples/lifecycle-render-order-for-children/order.js b/test/runtime/samples/lifecycle-render-order-for-children/order.js new file mode 100644 index 0000000000..109fa8b38c --- /dev/null +++ b/test/runtime/samples/lifecycle-render-order-for-children/order.js @@ -0,0 +1 @@ +export default []; \ No newline at end of file From 5dc35283052d98c32f894431e06352e0adf4f765 Mon Sep 17 00:00:00 2001 From: Colin Casey Date: Thu, 16 May 2019 23:32:18 -0300 Subject: [PATCH 009/409] include parent component in test scenario --- .../Item.svelte | 1 - .../_config.js | 6 ++++- .../main.svelte | 22 +++++++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/test/runtime/samples/lifecycle-render-order-for-children/Item.svelte b/test/runtime/samples/lifecycle-render-order-for-children/Item.svelte index 405c656998..91411e1e73 100755 --- a/test/runtime/samples/lifecycle-render-order-for-children/Item.svelte +++ b/test/runtime/samples/lifecycle-render-order-for-children/Item.svelte @@ -1,6 +1,5 @@ +{logRender()}
      {#each [1,2,3] as index} From 393d948f873ca379a53865602bce09e9a4c48db6 Mon Sep 17 00:00:00 2001 From: Jacky Efendi Date: Fri, 17 May 2019 10:11:23 +0700 Subject: [PATCH 010/409] Add Tokopedia logo --- .../routes/_components/WhosUsingSvelte.svelte | 1 + site/static/organisations/tokopedia.png | Bin 0 -> 32383 bytes 2 files changed, 1 insertion(+) create mode 100644 site/static/organisations/tokopedia.png diff --git a/site/src/routes/_components/WhosUsingSvelte.svelte b/site/src/routes/_components/WhosUsingSvelte.svelte index 21c57d065a..65d818a8bb 100644 --- a/site/src/routes/_components/WhosUsingSvelte.svelte +++ b/site/src/routes/_components/WhosUsingSvelte.svelte @@ -55,5 +55,6 @@ Razorpay logo Stone Payments logo Thunderdome logo + Tokopedia logo + your company? diff --git a/site/static/organisations/tokopedia.png b/site/static/organisations/tokopedia.png new file mode 100644 index 0000000000000000000000000000000000000000..bc5231cd5ac5f3e053ff3de9b0fd49a6615bda0e GIT binary patch literal 32383 zcmZU)1yr0r&^NlfxVsgH;tnk?i$ifJP$<^oUSM%|iaW&@Dbf~qr&MrQyttNKr0C*y z_y4~4-1D99?s?AUNhX>6W-`end6JL1+NuP&&u{?%0D-!il0E={1p@$pZP;k2l;uI$ z3{+68tNB_P70S1$D72`nwW`V1tD;{1&quyRO}D?Yl~VUr7~gv#KM7uW$c|1g?x~Y9lOP!7@#?a~C4?9PupCVo z`gd=?HXB@cOAc-*u1?xM!F4LIaO!TemWuz$zccx~ z3RN$rz@$HlfMUQFSUra=NgSDTkYJjGs&rzs(~uPb{w7Zlje&<^YMTIS=m=s;7O99mXrg2?-7+j#pU_v*Pq;(UD0{P+e&Vjj;uy{T~|!;p!e z5`-N_a2{@d@ESF^AuB7Aqxma%NMaz!f*eN|l>HzR&G@Vvp;BqX!3J}Ad+zUry3U`| zKkO<^n4$y#dunT!**QiWDebCye>Qr0-sCOCpa((bG4(L<@t9sWz|rcTopEyN#Auu7qK8z zY-XHb96SF!2XJG1Jz4VSx#h7^3o_1CTqB_Ffo_qqTmsiUyaA(eT^tC&V~V5m#YN;-v{|iNnHXZ#z+6mSZ<_f;ki8HFW#A+=&c7K zWmO^?n#H{TSPcc4ea603&p&t+e(U=4beg^gWna(hc@V$89+yaUBpG#K|2hmOdH7XO zLZQQg0ARk8D(MS=^%Zv?h?dHE@*de11X-`S>Lt;mAj_+fBe#FB&uA+I*1sCBiJaT05FoG?LHqU(& zf;w#~Z<;1z;Rj}Cr-)uOc`QL}u85Tkwm7%iC@f6n z*qv#kpB#;i4!kTnd>JMmAZC=zlaK_QV50va4~AXY7nlirk(|tg`l6JIuaE~_ zr!tZn9Tkaqj4qT~a(xy95)69J!B77=((T)7XR=Q}=Cb=uV5UgcF+dN%Mn=YbT}(~Mh_N74a(1nkr^Ax6Z^7Nq{uxK z#0)S@=X(P@Qj!hv#3+wtm1PTa_v1Wbl%j3ck0=5}5cYHbfKoL&_`Ciq4tVxD3tAZl zMXMhXMtr?C#u_!l#>ef5dj%tthXLQ%(jZfMw2chMi!eInxdiTdSr8vlWB4~={LY+< zpnxfJvA`eYO~{}QXF49_Ym^-t(O^D&Jy_aPYP$X~SWasgx1v&sE<=G%A7+>=f7R#^ zsZG8VSoD$Bc*MGlLS6^+KX~>qIiI;5K4gIMB!P_F;WJbLn*S|8#l`TfG9${)*9w+& z%94-BgjPoWFH{TuC1^&J4=aAB&}WwxRsod1Q@7eJ4~ zQq&ab<{0af4CRRaukIHJi=DNQnN{!2YccAs3NcsRh$8a;bUFjoU>-G|dV_qmEu!f5 zn)#UDIiiUAKgt4%;%@ib6(Sb2mD=uMVX;ulf^hsF!~~swi(je{{Jk4EzUTay@;Z3` zRqX-martqb-uPu}E}g`F>1X>FGd1C@Mzot8qf3i5dcs%^o&A7DL)#}rAQ2DP= z?fcCKI{{~766EZEcy6%F%XyV{jvgLQ_d>ivx)xW0-nh!;C`?qED5KQ=AD=lc^ar?S zj-2dGdWY!ndu((W33PhPKOM$&fN<*g(p-F;w^jty_;;4HjFG`%j_mOE&Q6{@a(!#` zhcVxL)6jWwj<)lhc~?rLCpx`a5-IZS@xSSo`y(8_^hrxTnCn84m&{kXEp?O zz`F>-a&&rm0ZmwVCX^KsjU$;#3PJA?l*iJKNQN>V7Or}J5hRa}hN`?SSI|W#(cMu6 zf4>TC%dk=&c661f)Fe4y6}N``?(v;BJstS-{tZ-wI`Mb_RQMg#^Q#_gFX)7ZD~{h^ z&nVmk4i&Nxg9$WJxiuefqfsKBgeO|H&w&I-h=qvcSv&)aQDz?01t6R6lP zYv6nlIv(gL*Dq_875N_JL}i(r=B}r$)TZy+lP$Bir*i8&4_uql6J%XR3@)Q(R+j z;V5x1TowddAMV}SRCgDJqWC^!S(j)Sh{I!SbbA?ett!XJTir*QjRgrzMAc+#Tqq) ze4@3Wae}gHagM^vYyKqwXXk%N%M^X3n{<>m)3HBtlO>$;CX>D?*%kG7BMGoM8HH}y z_#N4W!E66mt2Q1rqN4<6(hZdSC4zS zUte4pcd0{eubD@Li`bZ)cQT0 z7dh54u6ovIzkd*^xLIciOwVgzF;Hb?ymGvKxcV&qW0~orp?T(yO1>u|Df`YsQGBI$ zd}^4Wca>o!z<~+1?7!VlO&5OX&3lffD}Iq5La(m;Iw;|6eEo_v{qNGx9Z9h_l>RrpD zxmJv(L90<=GnJUsWN3xeR8gY+Wjs0b&*#rA!q4nHNUvSlzti02hf+_%CMgxkj5YaV zUN5LbH_h)m63ZR5)^a&STOq!Bo&V@KS$H8g(K!FESI%3{F|6pd@;v?(4*Dy1lbVvJ z<_8YFdeTZ$lLAF%+T??O3nLw6cp%A<o|Wqaz5%c`lOCvTuDY)XtOZ z`my=TyczBr-geU*Z}YvSiX*wflZ+jCZZeS_Phh}54?XaUCm(gki9X}`#U#mXsC z4d*f1=N2XrxyhF_(}68H28LS=n5N7}C|5~9e+!>Tb3iif(ymmQR9Fz~ENv~^wJ$Hq zeoeE5E`QlO55|6;6X$B(GQDOu_r3B_=E4^fvX1zPyWaUc*yEWy$2r@C$iaU4n=Kdi zWy@CUf>qLSZ7v6aSW1Hp_S;Yn`Re+9QrwuA&;!G{E`Ty%pDa=>a4xcouXGR8 z!(<{rZ4ZJ>6rz>uzblXf7N-&eN<`~TdOB4@%kMyv9FZ08DM^P%+DmEf-^B$Lr`Wj_ zebh0Up`UVMU72#j*t@P|l}jQwODE?3*U~xJmWJ*UemQF(siYdBUCBT_zikk(82TCT zGz4=U_Cjz$`p$l<+DHm8Ai|>#K0o^fC}bTc(sDKCT8qrGOQp zCAI=U)2V>^C2-4?=3_-5NRoMw$-`c-{($$ozV@mGm$}e$OHtwT?FC^6y*Hs_MgK6j zA?;08zEwb_tigyv9&Qr7Z(o+&?FG7`j%)U&pmoif2979FF@pIAm=%@)E1kkm(w+&) zQMZAFZV?^5Q=9}K3W~?vGbup&6lnBw><2_Tt-cr#?aLzDVLVComlD@iaEq6T1I=H# zm=Xt^uHJ51E}6|ttuI^CMl&(l;=D_86TM{99*}rMz6H>`+QllHl*vU~5NO@5PJR+_3hS?pE?NR}E+Jp-hz@s}uxIqjpnOB=B( z5T;bA59DT@o-Cnd6UJSAHYeTrV+9Sts001Qt#~IPRD!nb)b;fW3$`9AI+K{0YGP}t zRx$SB?mLI!6&mDK(0KZlZM~MO;Cu1e;w7d`d|}dzcm3H1jUlu#0vD2}pmAy&c6R3J zZGRj&k{{Ppv8LI4OlHWe^p^ffSQC#7!|o0Or|>r;_{scJ#zma1QREf-3%$P0)&wlr zB;lVrr|@jj#>`B~PcJPVUpyXRA_`zyp3p$M^FmnjSd=dxHz>C{_fu5=QIP{qpZ{R; zQ6f|QVg(?j`nStcWV$>-u2D|-MPrg>Z#q{lH1U=FeNk802O zSq*tgB4|7ROwezg+Vj5LcsY`kjX5MO_)=Wef9%s~_lqfmXUFVoZy8ENbd)LIu_YJDE+3YEf|T^pdI+YqjcTs+N99hv;OP6FfdKXvhBSL%Ye z@%crkzUunIlC9&6tAp;-#y=CI!ujjp3yuQIRN2aMI=K=0t9~zQ%ALOsDauaLaN9Up z!iQy#>}5eR27~W{MRu98VaWql_u0RrS#*SmK-4n7+)tvzlXvAV&xN1TI+WA);hEY@3T=T9i?le;0H;D&VnAqeWjT5A^TDOrulf-Kh~PTdL); zwsA$C3d`f1lQ8*L6a*=!h1+O|${A#UJ*!&SIiwA#eNSphfuPWKXrpoDV%AZ&oBi{Y z1-t?waZmZ4Q;J{>_;Xh_E$AKDy|tJW_-+NNrSqrpQQbd#+S( zRxr4}3MeG))cfc-GJBHyTHi#AsAXu^ot?eKv30b*d{8yd{L`JLuR3;FND5VF#TM9H z0li~zvRg3kB_;-g11HWOiQ!OL7G85)1hszdO`m;RQZVnV!+nIsbkIRE`s>d0V)Z z9(L-RKvPBCvowZhIxV#K_?!F}Dc8DD)JYuy5|{a)VLnkl?Y(9-Y6|RZyf023vtC%v z1zjQ6t!0Tf)68fte0o~m&HS=0KH(8Yt}l69X|in^+aj>2bE&;F|2wSe8B7F#bO~a= zg8y~@gMr;n4#kt!e7W2w@B1M@fiB;h4g(%<$3*tlve0+;RlmXAHw1cKeHvqw7TAy>J-+ndO@C z6sUl)OCscx5`4ArFKzS5rHc|r^Ss^|$lF55c5)j%xvNFC?SU6Iwdd=N-pw66UsLd6 z4pS01$$bWuc^Xpe`4sM_9HxyBXeI=CyJ2vro7{AvL&+Q*7S|Z!4rt@7sb+%qe|*zu z5YKDw_XzOVaC%mKZVzeINSbe&Vc~1*vzMtau2!qn)_^EDzs~?^J@qL*`HOZ`7xu{A zcQ!Ea0xdA0URDw(?@r<1rURO5Wx&I3D*ty2#&Iv9`1f*@2GB!D;tXpc+E=B!O*D!s z2u!AiO#B0V;Cnd@m%B~Ku9ubnV~ytLaP5BSW(H)erCEMA=>9BR+vGIi{>^}T-4USxlBr^LIQ5s4%A#~pCLOOMwV zI;M@^ku_#nD8BPK$y-gIUNu>yS&G6W23#ln&Y`n312mEhpEoLif|#D7(x>2yrGKVnVXy~8IYOkK$e`?UPNiu( zl-`1&et)^>0|%QdasNR~q^B@`4)}QmJ*vN>lQAe!g42ywbF8W>qg4B9FeGZjQU^dA z)~*S~v!Z1S>3nikwbX}tt-QRF8@4+|9(`IzRu%M7h3^MaS$F9}K7y%;uh>uK9^TRQfnIAv(I(lY zp|~qyj4z!oJ(e2DGVK0Ag0K;6NHRxueGfsaV#sWj#OVp*+FY|@d@$l; zkuNrbF*(h_GE3!ARAo3pu(;x58-88NcO0n>xc}B)s0DN=f%AS*Zcu;q^t&M!!tr+;#9y&s|urt)(!?Q>oi zXb2M57loFs&tk2_eRc0o@w;E~Ejqq!@-LCOZK@P#zJ3MS`ZFvsDI@FUPo{C$8t4Ap zm$Yt8%SZx>hjjjnm|U+s3Wog!m_uKl^vH#J-H+mznt|c%qMlErRu;gJVQJ%d3Ux?w zmRzy#E#H*8C*$ihcvqbb??$&2-Jr#3w0*$7>Y-*sWViR-2wKF7M=n z;pzHlt?pMer{AVT#js?-2PLalGtBktm6`~~xMl+s!Wgq-Pz?m(1b+rfzWYYR39uWN z$2z-L$w9aMMN)V|eQPxPWGMVaE_@~L3C5Fj!~H=Gd4CNnPEj@@L7=-l+_bOD%FHS! zuHXdyTWG5aA#NfAa^t`xlnk%}^Q&yHz(rnT51mBFvg&=@0f|ZbM~aKkoaRW%q3Ro3 z35C(WsR(o-k>lox|cS>xRlT~Vrwcs z^Zqce+IE_sl#n^Ct9oi(Bf8_4dTvpX_BLeE8}EbajKzWF%de!cY8$>^u{N{aXaW*2 ziIe@iADxyIg3Ev^d@zU0{wXkbE-*~|w=`}j;QUb!d9pwuh5CRX|3%CQyD-bFU% zc^V|<9g5MO0PDN`LvMtQh^o|=wmALAZHCr;2reG{E8!7LW+3|Zkqsa@7~Cvo3i|9W zk2PWHTojV>S1i5NAD)f?6^e6F!O(Igfu`p>eU zeMJ=f5~%T0Fngo}bXmgk`$lt*Q2dGk0ot|+Z59lKwe(5vX_BZ@kw4R7n`s63hm1;a zN|wPlCR#;m$L%#ANdsq&3`2~6+7O_F;2ZU zktb68U0|mr3BtBmix1G*)1j$Z6V8(uN8GXwVN7|4s!!wg) zlAZ^mPicRC8$WbKks9>HzRUAc4%TPzNXd7lj5q*6CNo#oBW3*@!za$`V#KHU$H@vG z(;GZkOxSaOrU^Obsi>zutmcL<3W@j=Lc+6*?sQhl0zZWOaV7tED5=E2=jyvTE0odY zfZ4F7JhRWcGEq7l;eheM-u;7pcvmLj7N?i|Ez0$(vY)>qhll!RO|`No`-TtobszKN zydnL}Zg^qQ)MJq-yjr&`(9_w--qJAoJXOyNQ<5J!$%RL^AaX|;oTVx^HGdei4p5sC~gIid2KZb|6mN%UhEB*chy_&Xgv2>R_|7vzVF~09F z1iS+24cN*>Bew+C*+slP8V@F?eOnm*7L35^ITKu96Oxwe1U3y`+y< zEX0mtBLgrmKSd|+cWAC**79rX84l1%$lFTLUOF9&VI9-RJZ4QTlzH=Ag%g?y@x5R@ zDXSS=GKqcugGpG0U@2+YRCry62jwqsiX5XbOKa z^X()GzTJ(z?I5aH`t(WS6xdX#Xuk27OF=2@3UTl03?RO?m^EEX%o{2H2rBOK{ z%m~jo|6yf3IbAO1xMC)=ij!Qo^$=?=q2crQP<5LJ4Pv$Bur;cX`-W`JIU$rs0s5%u z+iN;o(I6!G;TNO=OC%KyYR}$2^TLS?F^C~JH~niQC6Qreo&W9qc5#KyR_Md={Mlu1 zWs;8`0L{+5Uk25lhQ!C~&;$9W{-!9`{r<1|zu9YuiU(7IgBZ2DzdpTipUqUyN}xA& zSVBLt+K}~xmAuNOep~#lG4t^|R?0T~a`xGHa`Amb`y)W|EV_-`r>R;)^9A)d<8{|5 zi-;5z$wwl_vFxv+B1Rp5rqR`(&c<9@hj>&Qs1q5dNgve2W= ztyWO2TEEOGX<`OnP7vc^eD1)83PUXEy_Kq4SgqE+Ci~-dbVxF6$L~s{Iw@q)qD9uf z@VstfqnJ{`d4*bu-9z_@^b-Au4~FyJFD}#@YpWjb!jzteJxiZ=i;m}6kit*tULAs~q#vU*TI6#v8;rS-^w>16< znTj_tvdQ0pTF6v76)%Yb+2dpd?ZpHR?)?BeDOjETXTkV}hc_Ck z`PxsK6$Q<@finvCa&_kr3~wM*tkQQzV|cZ-l@<2XX)r~p_IBO*+ifVH^d_tSQ{>`K zb;t+drIV!=kRb&kiofhvbgS>m*ImTXs=i$;WU1)M+X|a;#4;2-`mjXl$UAN8!~vZQ zMdxX0I~aG~$ado^+Q*{p`rNV(1{Twnz1oZa{&<1(w|4_gEna9BGagTWNO^l7Tqat5 z6=@Ea4!nGPx+{EGq8H{06^DiAWu1!a;I*yEC0zZxXnrS0x4&7c|Nlv+-#iY;o=bKIc6^o{*U$?wEtX?B{TXH_Iw z0bYInKr}Zl%J*JlDlyO{{5{XgliK?$h-i-g_!eaqVQe;xMpW}CxspPs# zA2Z+KUF>R$tzSJAt46m7>p9D+_O1Nop+MfZXEN>vHyPpl^{1yV#_?{5eI5Y;3j^&I zN(RdCBL;3##2Ge3!C#@jFe|M>Aoxx6)ctWRn9phc*Tk4NS==ksgdUSMmnT68y)Hj4 z!E>_Nr+2YXs2OKKFMIoWx?MF_YeRk~nek?A%Q%DNAs?SxMXpZStd%Ojqc4PE-OIqP zcaict9@zaUH?csAH4>e}SUN(BrA#sRF2I_`WpeE)V7_-W!K_k_0s+#<*n6Rm6@8`ocy)-3>mq%_GVg1Yl2<)} zKw@8_Z$||QD`>sHxp58AIJSGcAE)DIWF)sceXAeSz#LXi-iJpbN&e-8OiNR*)gSPF zVubPQ=5cnj=OzQg@_hg-Kjopz=O&4ApC8bwBETFlWU64C578EzPH>dy`e8e$v{}9X zTr?p7tNQ%;(Ld8JL7~lXdfu(e7eIujNQ}%!0X){`gdyse-km~doV({7E#h8ZTKX_p z(|q0zan6mZ9DpvrwJ_4jSw2Zad7904j+*vn4%D&IOyiV0{b{K#vck0cvyZhMa~F3( z#8eKELd(PLKi{^7ePMw4?`c{uL@Wyzt?R2)7#-Qgt%W=fQ=hRTaWvbjj7v3{{Pitj z?LwX<-~}$b^Ce4x*=yoD&crUPHJyv9$UnYbU|%Z{zMH^}ny(^dy^?>wuG!A8F(E)4 z(9k{~{+!!bpt;pNgakipsnCZJc>22J&LWduGO6xS0i2Sj%4XnfL9S-D6AKk-B#BY$ zy8xm#J#c=6Tid`^3F>al`*zvZle@On^`jg}K>NRbmQT0X$}A-u2XcD#SpadTSg_w) z+6Pt(Z~L5u#s@@k8{{7fY?ohI?u(XYGUG7LDgFrdqNnz3w(mGkO419bUY^)>sF`9&CEw;=yY z#t$-s!obUS>C^L9VWa^59q3%p1be~+LoD%1UVYSYd1v=jZ09E#6K(n*B?)RQc$%f2 zL+n>A_F(f}C4n}YZ35aZ>&yYI-)kPzyW2Es8=jb2-U|~IyI4T;cQ=UVmRJ+6@UQ`l ztomn*iO1_yQenNsF!x1tLH=M8ju~Ge%y08W4~Zsr6=;U2>3xy+$fw3^Uiq;fHlLO> z4aY%P`1aQU*m|bAwYp zRFNWsXk>%nw_i&1IS&1IT#XxPl$1V~{ue66M1>fLjtDWhGo+I^x&p81YR) zS4*pZ?C`dn0p{;)g?C+{q5GEBPdrv<4!KHVJ~B~N#IPww@!_GrE&fcbN9WetfnP_@ z>6pS7vo#AXC-he^WM5|i3brOnn#zNb07J!%Q`{8My1 z%?W9GeePF;Zl;O8jb2!Dt`ZUo<@rYH_RcH)Z@%*$75F8sk5lBzL}=M``I6tK zYO*r2p2waO0%1t|-~jVpkvtT!|755y26wjjR%6rf^9oe7=YdT5b(_lJ{_Np5xH684 z@;B!7YdVS*>9hKDa#oDnXW+igi^0r}t~>z@(oc0VR{=JHu~oP*fA{xV+0y5xWAR;z z1KT$a*vjqkoEzCUE=rXsuObc3ktl|P7Knl07z#TA;t3#3`Vzg!vpb}P5A;q$oGH5TwcB@JdY~T z^LhCg!BYGbsD&o?%X0+PnD8L!~8nr^rGru0i{- z*ZAL#WiwYGdcDnBmwMpSg!rXt` z*KA5x14`S+iIbWOD3{n^P1t*wc z>aYLIDTd$$ZxPY1ZhJ2=u%_}b<-r$2GJLs2FUBVOngyy-z~~TvM8z4;`ppm68Hyu* z6I4p{MoBIjVF>6P;6vkU^xKHA9r2hI;x4ReY@ZM1_$a?>LCHQQ? zx$s}f^iY$3?_kS=B>U9oKB=qW*ZC>9~)~uJuvx1HD{|C zDfiOEu)UF(9iM86?r5@jEW>UL^t2WI-RpNb&?vFUn`r__wT;m{fg~UwAq80&1A5tD z5?)o>LmH^l4l%@|aF}D~JqTm4?iAB3a;rL;*V&%LSbROVENS$swG~p~GA`oNE@_aq7j7Kr9>gJX zrNU*42lR5mawAK1B#Ajy(Z5QyO1N+nLDpu8x3w>TY;oXxZ!MnSE|9WEJVlcFsJ27j z$O-D>*A@dlmj|w{XFHzBMaC;MWxJcwa$32=fmMD-4!Gz=>KLHsQ@p-Q^2XdPeD^7K zo9u{YSAmiMJCj>!of0uAY5%#)0?erqXMpQ=U$qbBz^7p?vmJ>;v@7^=iDRFz0&i_l zTVpgj4m+nu>Ou?gB+z^`*5Cm~T4I=DyjN_0G5)6ItAl%{fkjgc`U8 z7++m<9{VED$ywzE9COuYMSOM zRT1416-y}{Uy3gV9CNRCzja?Lm5f)*>3|9dqvyjmRTfD`OfkQ=Q_okM3GYkdJ zno!qU@0c{nGa^I1@CQU7!e9F^9UrL>jFbg0>Cw1q#dzl`N&6KAjclec3~3QR{nB&D zeM@JT(~KrPOe>S+$Po8jK4jH2+{|C#WMu**KL!Y~#jk2jF+I*xp}~ij8Cx zj-zs{^1m^ho2D+_C#I3sOv+IqK%YD%sl|J3dz!v8;nDx4sMBg`EqGf(@Zr}NK}WH_ z*%D&${ltcyc5-1v;iV7BQ`2QT;krJ!o!1G~<$mDQd(eX-4WnO1DbC+`1*zHN1^?hT z9?;k;#LV=1PWLsVi^^}s;>IxTsGd3e#%`+fY$2<$Ytufn^*7Lr%EX`G8lujnp15Y# zOs@EFhP}tW7Tl8Y{d=B&aj#Y}S-LsC?@=n7`3a_tMc@U6hChbmOPKV{Y-D&U3s%H9 zi-lJS!)PQHq884(?(HLgCnLzhwIk*t_3bYx(HB&1ty2F6fTH!IKhPc(@4e{yZldt# z11?q3=;|zP1}sf&S}wd+M9LUG?7Vo~YBzoY$?SSS7?W~HzmN@jbt(XR(!j>krl>#6 ztVZjF3nZ9lg-@6S=c;SBvOZ213Vq=T#SEr|sas`iXPA2PA)FBbzukU}N-HaGUiX#wSnyE&pvYAmn6IK-$5f{ONi^wY%IJ}cv=C^Tn z_WA6g^CJ(tpt{lSTeZjGpPTe2&qo}kZ(yqS_pC=tJ8)gx^)I)p;=k~@(P0=LEaq{8 z=XDTVNO$_XzlZ+-IKAdhwgQTDzHzcjdO!SyTgCyj@%`KXsJa*#z1*b?27kz^t!IDn zP;OHM>aBvtD?Dv_k_*XTR|uCZJ9q46Oi-|}2G{w5UwG|Fw#H@jzDzVzm>AxsNLd~6 zIuQie?dxJPx(T^0q+)PgVHtAbh6(hhBs|Ie<`yoFQr}z^|1qqUn%d<9VK)!uxnWWL zNwl+{z2m_?eh(AT=YSf2*+cM0LSoS0Wm>%>V0D$6idmt++_to=@>6W);R@P;)u%X8uGcCJrrF@3GFZK_Wklyv9&srt3CyZVnI%S!U@>xs|* zsE|yrK3Eg5!N+y3_NV8rAL!ma|DZg$a!vyMl3k?LTK-Z5!2vzy`^aM+hZpeRtjlG| zw1wVTB{VP)0)Jh)8a!p&d(9ZOrdleCXE6!yVI%QgdV4P*Z%n!4U0F2fQhyUYJ^m|n ziLt}HCvEcXosV~P)L3bbU5rg1re<|dFg`|0&AQxrwui*yU*+T$jH~+akUpF6A{~<1 zg-YjFKZY!rKawI2cnV9Nn{TsOb#50j;8*^mom~s(*DaCvof68;xbRyWioy9wxX5I$ zwz#fPQ?YKfk1wTfnZ4*K3hDhRlZq}o#7)^XXY$#SV~gQvIrfjy{>Wsz>s!yiO=*(A z;JS{v8v(3lgb2by>!{DglC`G<4`S;mUUOYVtQN0Bn*aVD`{D_$N6zn9d*awFfmf{h zMN8(=n$%CiFuI1#QGHBJCiYJ+>4Nk6!o#R?RaZkd2iBgc60j}<$z^iibsg9-;=U_C znK+V{tQ+Zq$y_(`?i*bdhgqa4xTlWp8E{%roM`@2N!x|(f#k|GLM2hhTg^iVcW0`b;k+6*B>f9Ok@fGg4`}R~=Z-?Fno_;tYRtS}7oEH*{v&yN6n-xBD1 z^v(fVJczHJSF)<0Ggn6OF%3c`XR!|%n7uqO)STvIU_AW?BXeo^S%J*I_J9yVU@SdF z+k-$|x7qAsehLnH`oK465!l47Y0ciA`ED2=7+xz_4U#-|dAXsFcx9^uBNb;SIKui{*X%lu_$?dhUnY45c{YvZ^0j6U+1G~Q{S z)rUiL&Bc-*sv?4G^Zw&Yb8O0}-9G4#i4!3@tyORxl{!`c3%7D%HqqJH)`d zy}+ym9K@U!ZA==!=`prNmiQ)gi#-ig*jD|F=c@exgk57l+Ruho1OAT zcA?E(BpfU5HYZV|q_UREPs2ZFti`l*&Gwg0{1%qEy1@#vnBRBKx~~^upw_uUr?0m& z1xBqQHl*dAqt0YBz4YkC<0`*?CEFH9ijb!BW{{Llx6;py$>{pXh}iR#1)tS?KxQ~c zyn@QDcjlhYhvKH}Y}~)dk7=dc6a46If*2wDQYB<%wq~(%^zEiz!bLRyE77Cxk9RW% zIdTNXee-=6#War>?kL8@KCUCk>bX0n(^SNrh2CH?M?j3(hKE;#U`QIS~s(kiO;kZqHlBD z!ppy4jGcJ;5RJI@PTy|drieai%!j_e5VCwa3mpty3jO^dUAa@Dc@}<&=?G5|Uxnd7 zkNe!eP!qAd0clnrVc$_&XGzH=nRF#=O!lhS_PT<&ouGC8{66EV>rGscJK|>u9Cq8` zU7Xgd%QT?b`h77|RS|&~`HZ0n)@Gltk#IXchwEWQq2A`=hsGBR@WEk_0kK*P9n5?28B@Jd(%Q{E-qnpU ze>8uv(0g4rE$&@6p4)nikhibA(9>y?(8w7IDlEcSVm=%*1L>(H6^AWU>(Oz^?5NJh zm#2W{8izBygm^!0X9%7b`r;~3U> z4((FU4he`xHIu)j?N`9|tE-85@exW|0&|CO&(b4M5t zLR*Xr`ZdVYf7R=5} zWjlC6C4Fjb*j{=N|eUjzFv?yK}G$a7*w?iraU{o zucVBLBlIUC1RhF&!SWTbw~^RKakH-(b#~Pg!Ik#@nF1uz!O^P12Ar!-<@!ItVk#BW zb~Q~@0EM|`hrJKh63-TCSW>Mxw%h~~4K;&v*Xb?a|Cy`%WF0pa8yu%aU#RM-D7JS- zq1$yEd{OEUF3SYPyH^3oWIsPL^`*f;9$bgRYwmDrt+#I7nk>YIUi^txcX40SPFT9i<#BDJ@A@gr}TGFEU}$TI1%8vzQ{f z>B1DX$};M#^2AR)_zZR{d30sb`B!7PZ%{$;be1bazv}a9cdd=^yUTws?)8qKVYTEE ztENjE>`A<^o)uMytMjWV^@T$QA+--P)%VyB#Q;bO^7kTH>Iu>3Ldt>^Z=QGtrEm>O zMW1Eq75T3_xMh?iN-GrU%nb`83UXinTO1U?N6U#bh`e%BY^M$oq-c5%Nn z0uuvQqCdWqjs;cV!^SHLnZN&NP+ED2lD=^CvtcJ-7W-(mM}&g_rBFQuJ1776dS>N@ zifCz6lyV3W18@am(nXIhDgmq1xu(l|Ae^@(Y0kT!W`|&}cCKaob5=bv@Pva3cy3;i@(Cy!vGECrP*_*J)_7V=1 zcMPjd;NOCU6?A+(zbi(ASnD@wPO6vk6nHIUsQ55q!7z^au#oTXEeMc28hO!ddeRtX zLW1d|B4AhUcnMO+?WN-IM_LL`-rqVXKTUzaDXR9c+&d#|h(qh_Ng+n;e0%A-L$;+m zAi1^U9(Ie`+709mQ+ozfh?!JQHkw4pWuG zMf_IFNMQuX-;AW1I~&I-G@lpqf6b>PpAd(3iGSmu=;YD^rR^3@p3jr3sAedNdHO%x z(5#u@BD{W#Zcljn8)!Z_?*kKOwl?jxTCsIF*>B|GY{2MAp*3O zgmH^jsvChL;{q=UQ0y9IyUmG~6mxUcID-HdO8;Be?#Ep(6!GQ4m zdhmj!P(yVvPkdC?Z)=%VJmxW%;fmo5<|BSUD~q}!T5O1rvo3vDtso1$pj9W8ITEh( z9CkM|0$g$utc6you7ecwP(y1E+_y<9KB zft>XVlalNLW%Wj##Hv|fH3YH*GF85&lDfcxa6Dz| zUqDPWLd1FnIKf*(>&30!+mXW}|I%+;5pK*dS_4ma*H|o&`JjvtnDNe$ES$e;yfYk3 z)G9Ls69Cs;;5>M*b_P*-kW-S4jL3Y*2*=Jm-SZE1(t@M4{nV`K;U^%6T_j(9jrB+s z#YTvDGr^jOSe7^dkyy)WP&}t5S>QvQaJ#k4k?B__kPMN;%VWR1QCcd&P%#U<+yM;D zAyChiDpa83&X4P=3Uju*P&vsh0;2%n=ZeAs=Cq;ZJ;B! zN34$WKoD9N#&>HkFUdW?Iq&{H8gla1Z+kpSHd-E~+nRc!QP>0i}^nX_s0lr5i+2LZoW}>7_+N>0DU4LqbYg1VmtIq(flo z?t1tCJkQ7X!~FK{xp&UYojLc+iJ3E}Oc_x#>eJZhwx(KWhXXOH!PBF}I}4SGbt+pa zLO@b#Ly2!Rp$hWV?Vf7yM#@%_phobK9bO7kV03y?b14L{u)N!Pb%Bo#3C`ZkDx*LJ zq1BPzv_%8>^DM#6p67Vu|0sN4>K1q1i6aeniRnLDD`|vsnoMA!r%CgFgYRH+)p#f; z(vd~a$UqPTQNhz|7=e3zj&+LtM?*rDD%csm$%lQKNrCb}zyn+4s~J$0!)D8EYs773 z>Tc@`xjaISd`^|ze<@SJZKG@#mPo^I|Axa>HlaC$1)w|rfw?nHwhL~6>1!!!LZ#R( z_mLnxUu=EnR6nh8itA6GE!81HF{>IJr=TO~fg4%<7fZNI0i2<_SW5`w=-PpEv=tVp zhYSiM+!Ky$FBL>p#=VDM4bu6(9?p%l+&~rI()k)eNs2L(b{%Z!#o=WoPsv*iH=M?u zG_K~pJ>zERh$g!DTLUZLZk+>F{{HTonRR@Mdz9uz`|0AKZiKSTqbtmPkkxO8j@*}kkOi`>SB5(9_6e?JmV4_0 z5JIHzAg97Sc&(sP+5VlN#GDwD)80kupx@kJzz|S+(sFDH6SD9&9h%CFEm{z~Xf1Fd zha5>KiWTTRr$+1Wy@a&l#;74(O6X?(ZBP#DWKiz&;-0>Vs~!n3c#t|>av%(CbReV_ z<|kS3CJ~wvcBUWJM0=k}=9<^n$p^Q8(3*YAjOt7Idhnh!?<5U;O&jwX$wSD#PnqLO zhxFt9S-%tgZLA}%U-C5F&uxjK4wG4PV(z-%+&42RmO6iz$Y$@HXms+qerSAD$BZ zCD}5*c*%((LKPjm&6{*nlsrPE(i23ttBZfleRN!_)u+h@HcdR{W4#v@>!cdL68J!% zz4Breo?UNXlRO_O_n0!&jb}9FQk0U9Xm111hT76nPxEAU;$wsL(wfwluBv6kg@NdC zrcIvRHGjRRehf7aGg+C{Y+-2+42}JsbbCoazy^}`jJHZEFxY|4fhm6qlWeQsyxu-& z{C*+C9fzaIi*gZLkEy(hr$c(DGwV1dlIe9(+hyiiS{0<{FRoS*+NLW;+PiDQsI%3O zJSNX&yDV;a|J{`XQB*}cbZGrKO+i&*d#6zcp@AY4L7Dyh|EN}WL!%_#LW}oU_ z49|L|xCh_I`=o~MlI!S!k>-C`zQ5+NyjmlCcFbSaCltK+dn&W*{gIiI!P?bT-=G)A zKprfpU}u*=(8Zst;3y{(uURfD!aB9p_-UGs%DxWV8O|^Yiq9FF&=}ea$7&f|-KFk* zFpZxxydEc&47fMxkBZG^OPUWpNxQ1{q~tFEE%e~xpl2%;rQmM?3jj^orZ=T`Ni5}q zSCxr|ET~4O!xq!Hs_OxWr0x~nYy$(5n4bFe zwB~dN+HPi1_s-Sa^L$*rJW+ZNgn)gG39DByBl{wg)0ONSx&LnXXXTZh1Aw_q3iZyl z*OS^|np!(|wRnpBMoS3g;DaWcU@ScWTRzzWqh3MvfLfZftRK_uAlw4S>3gLe*-X(6P-F%W=hF7+Mfn1Q|QdN_VF#TGBdBi^ORF{v0};qOv+N4(W_juCO1 zh$8T8Q;2NKr&?BCW3=xYh^RXu{`|X&Ad}d`CwI+uLIsCMwOT0BHn7I{f8^7k7*n6 z>OYG~-9jy0)xmdkW(#l`4Zb7(_VbVB3s!;sl#>49Vcf44+jVg9S~I*#LR{RvZ>uCi zU%ZgsHA9Ah7CKK~AeRO|0(Sr~5>r)Ta~E^0-C|19{7G%&C;$Xd2sry-YGJn}vL|=< zmwW%(R#m|>>w%E}Lr|TynK%;6y1jxOgg2k@g5O~uEx}{Nuqi=>-)}68)<*dI$bZ#B z*3Ee=oqf3n*khgAM2eaul8)pZ{)yi)CJZG+f|Y=4g2cR)7IR=VqhX=;22jhYRE#Js zSHkxcQJ!WBRVRLg>El~+%D+^JIOS{LN;NmHsH=(9qnwAY9`4>SYERTmp3&x)xylrh+ zm|%J$j5R50==MN#CSW~btDB^dUVcrR`Xqwlng?H%(7roqwscX_W~!& zI-&{LfLNYECdrGytf%42-1)mcyM#Dq%xR-9b-8C~A(!gWS`p}CO>|C>s-{v>fAtHt z!T^F86mwI$b?G|NDfX(WYq@7}wzPtoo0oEovKIBvxSU}sXaZ^ep2i;xkw;W9At-U{Mq&KU&%t$%ybujnLM17! zlBPSv^oJ?V;+~7Q6yMR+49tfFp&VkH{9Iy!-^d`;$kLP3Xr681hEJwmQ-^`Y4wT|2 z30$LfrI+tvy(S+J{n8e4o3UA{2kHqQ@D?nT#O$0V_g*ejfaFtQS9Ms=KHtnRRQQmJ zX(@K?a&U5tyFPE~=PUp8rt9aVdt`qk&!wL`ann&Z`E-%?smd+@+ z(cC%BeO`FGRyj5=xGfrUUGlu5iM}R}q(cB2fA{N|pV(JdeAAWETEa5!m~20+u)vt^ zrmP#&Q!PPfwf+Dbxo0r=f>3P~AFgPb#47W-^I~Ao@ZqqT9L(*}OKag%zp}M#|GiI^ z>@NyaMyz(4tM_u2ignS=9;b~YLU^et>_^3)Ss6G#N!k#G?RW1>{4)~{L$uL5@QRt^ z%(&xHKF%^OH>Q6ez-d#~AorCC*W@hWYJE`}O{8Z{b?xxBM=lE!z@fjxVI(VrxVd~` zB{u4`F?u_uI8#TEK&I9iMvT-X8cpzLfYU;G!-hxl1MWeGPcH5j-Qi)xT_q)>z45`^ zp!pMLQM0yg!tAlEyZ%XC>o9&%#FN@8O7~AygQr}zH}mp8FQGIKZ?PF?!Z&@V%%AVQ4VtDD5P1FLZS<$*%Gdpx zCd1TFYrYGv9lqmR8$wwG^k^P@>%XfVE1c}#+w$bN!sM^b&c9*SmBFoTUBdg$b9l%{MKgc z#MN^L%^-G@IohZQEk;r7uKe$MUo0<{tJgWvyB|IARy=gy$58sueekvkq(X^=YbrTWXV?r^D4?O^678U!n! zxBL$#O}OSutz<$u4p`SsB=hwE-itgYOc>EW4C{26K5#&z%aeLyFT^fy1Owx$B) zzEQbUrZXcvO~LI)^0(*<>R&vSfuB9LJe*z!%b$3u``+xYV@Z%XSkg9Gr_|un)0o$C zX)mh4C}?w^R=BImQ3nW=DcGj`KK9YkP^;m)SQ6NpSaeK~CI3eXi{ej9PC00-V0x~P z#_9Pp1wZBSl=l9uHfJ?LyLvBrBirt8Q3+Rtg)WjMr1GRK%ewDgNc?R=dUE2KBX`Q?&UXTbYmMMTU{#-@eu@Iufb4RBua=fWx>0o1dl!>wS!cp z<~<=n(?U^7*s!fu7kSIXy46vbv*3+jJHbsLd)hiIc=2yL6Stf=%~);Ztx>>TX?V1y zXPDP!C~DsJ&Zfoj{0mP->kFU!E&ix4%Wff6b$)o=95C*mQ?&2TjH%z_>pi5ta}29; zJxfRROpbEimTHinq5yXF?@G<>J_vF3C(`ZiUYtffnG$&1fH zk)%5(QNyeG(6!LxvzF=O&9(O&CHW!4QobQ@I7hHcp}A(BT(Qu>IsOAdrDf8V6hsbp zCc8C%K%7J!GJNE_l$V0Uzl(=Vx6m+r{5n?qy6$|TJIny9nL6mvYpF1eM$?52oyz7M zK<1akQY}?IP6^ha%EpmU99q+NL%+z2d-YJ+znN2_?2e8PdN1nPi)=CopkTW+M4;yxVv?3uYSkXR==B;PvK2esh;x> z3||*D&3>j|>`hJufipULCqTE=1m}XgFE9RWKd7LyK>CgH=#Q)ib#a){7<(A?!3)Ne zJ`}#`q=M6tIAz!DJvQ(p0*>2_iXa-n2K@cT%xXFqmWkkn3WP!=ZpDpZ~Ff zmuQc0W;SHG!I(jNj4B{Z9qstZ$G2%6^{|7@{9}l%3taulBb4DKZ&=l`!Q&U`RgQ_S zU!s*e`ip z_dm>zp?9xw$cG3`o1b&X_N-WhXs4hCiT@UfD(TW_KB(~7>7Pyy)i1|=moUFnYGf5{(=e`}1 zH!_UK2c?fwLL;ZPxoM%;i|!AP<;-_fj2V=V;tnG4;-8;g+(h_OLBKikwJz$xU1}4 zdG*nXe50!OUcK2a)H%}ar1TpW;vFF)8HTC%3A`^kG|QUXuR^6sQ222Hd?%Ysg%>vD zi2O;l(qqi-73MU#_l7(VU`3e!}uZ14Cht9Lw9XA_PC$#7%1_z5%Hd{a4TO;PHsn5Y(ZzKt2 zxgl$vh)UVy z(kIS)z7QgHo!cY?A4X~awu{O}yPwd4XWe!;hGB$)NsV$rqaug~H*kTlVfLI~!f%s2 z9{ZorobW190#t#+*0nKBYuSbT%LNaPNAB&u>A<L&_bg zj&SMWc}RK0Q))YxK)@YgHNGyFz6<_zKme1JrdLP~#FbDX1uizY^FCFdH2BW8pKE?^ z@inX!Uu93{pM>JF7w6B<$fD$E&Y`J3ncm<4xiF^%-ex z`Wh1wg>I;$o!5={Oua#lkdt8F&kQR){3?$ z@H#J1n0wMzFu1UBzEXiSvgeL&8LK_fH-JW`Pd?jCbSZIx@P{28AAe%K`}-#+632lV zb=i+B+xTnr-ha@iXgtEr*l%meaXrjXo@W^|^Zj$=2=$ifduPg|v1rmM(H|LAcuWk# z5jjT4ByQ0(4{hHggEKkRBh6?#gZKFLb()pmfc(votupI2RA~hpb$c3kI1N9sertE@ z(a<=5lWWY=*)dJMQG_rr6BQO3N7QB8zBqU$+%28AenYq1-r~ej=5b^GxyHx>p;V)3 zO7>)@hisYQMwfLHro`u+O@cnBi_8ZF@iYCKXVB5}!EKSIDn3?7C*6Qi zQv`D=l&x=HZohl<>|x$Lj@d460gLG;?r@xLal9^VsZwx7cjm9=t+e4507ttQiS7PY z%=YhPqu@n%$-Z~;f_r{$K-`po)`c}jG*(|$-$1Dlhi1X4xrR-G+k^=y>kFH$?|k)P6<{FVFj9Ww%a;=SdJU8Y9;?17ai z*lPT*jBN&{scZNzt2H}|C{=w~!e(t0tNKvG!whEX+CO*#J4+2p-IJw?PNn z#B~OcMddL7F%kVM8SyrW__30_lVgw(CQ!6Y- zN-LR7ovs)(lo@VIW?HQQ8V*$h35av!!uulFIJ*OiXwcZ=XIF`$`f zc18G>)ouQi5DV%MTA#%~4=)ogOJ!=3M)8de)qLZ;d<*INOW;Pvqs7|jZ0AI&yw1yQ zx#02#*gfwymHA?o*N?4jW5)fx#P0%VCim1`K=A0?@>Wa?*I3TyP$G$J3N%y6({+B8 zSOzazXqNneXGMKp880%_f_5|3F;`9Mt-GW=9uLuuvjD`TFX*go-QS1ZsuL+bA$Hcx zQx&?_3Z|#?B%@}r%S+tCSOGvS=0a{UY3oTRJ>1zYFD5%y(luv1or*w&%fvj{`g~p5 zTbpX<-H66fs;(P9o(E|ljuOg;Ot1*u54_ml+ zfk1jJ#&~WP=Hb^lf`C80nQ1?sLAX+eOVisz79OF!RCcT<0$DPlFy{w1I(Hm5Y{7hr<=}MVBM=Tw8m#xZRYlOV^(O`@Y3|ZZ<>HbdX}=xlERZyX_rJv z7nCs3b@T&@J9y$h@K9I1BoVj(K7Ux*`z$tf%LbyylI}Co(6=1Z;!yd0k9s+@JvXBD z>R8(Hro(URz4vU5Z2CRdWE~@;U%rHj)a|-GIK&(}viOykom=g#spdu#+Qa3&Y_{gq zWc~6~6#W5ih4bm(*@sCgH~Wl(IUxV_c9wHPv508B;CSAX`D#NWiS{v9di_#}8jg9% znDCC{FA+W|AnzNE<$Y4g@cK*i(0;w8xm)1I%|2%w!IzvO+i6*0%rvo}7EOnAQz03g z{_{)Lv-3zKrb^83Hwe4~=@Lo)adD_h4 zywO7R&0ev{WVig~cs*`}Ike+bez|m75_{?X7Y;t_c1ii2C-2fjM>Aq>AnG67ym7R{ zLs!~)P8~IJ8rvQl8e9gk9_k-xsk7?SZPsf|C%?0ka!oFKO|m5UxFV(|hf+9n;H8a3 z$J!zOB`0pLj9dE?QOL=N9Q-RUD8)se@hT>R9oNqpDNJW$GD99xCX!K^niJ00Tvi}| zW7lgKEaPRKn`rm8$<^a)$*iV%;QKqK^Dh0;JVEEU*39W0*G9RbD|@54QbGN(SC_ae zPvIC9#Jwnzd90j}p*2!eycfbWPVz(f@!2@+arpCOIjR(qE&@Ul;OR-$WA=$jyZrX$ zoF~BQOs~p3IRVjF@+dT%+V9EVXyFq4M3uE_ZUmWJ6$LkQ%E>Z9Np~)K)Spl`9o}Q~ z?*v<~Jxt8RTawS80aUpc_%^otr@RaWcU5R-&Z2y&bBEk3f#lzPSTQ{%5a~(kf5Nzb z#5YxDkDuY9WaVBVLy@*gT8)OJae)LdQe%|g*Cdt5czcE?dwXufhc4f)zST*!?R}uM zXDd7u`dRV<*N+`(JAIV|KJC)*Q?3v}y3u6(Rjo8!s+YKDU7VfpTT4yH?@7Z6oO-X) z*mcMWeHbUO`|v*hZDYGHo2+2B{aj#8Y9CGFY#)+zKuJpMW*5%uKLlwE$|(e zX#=B-+Huta83ON8zwDpmuDp6%J`mWZ`;Nvq`ycR{E7Gnic-U?CX_?e-4%9oB%nKG~ za2YJENIB@@7<24VW9pvG-It)*w(&mSmYs4=qWmzN_7L-5?%<7t6NtWt05T{E4@O$? z17_kVp={qRDB4xyPSbJFI_TvmWG9fiaCdVl_ymWYNZ!M%rFx4ZaQPeDxzcr*yR=m7 zRnVU;Ge4j7vBAY&yrI8;@!no#j*Ccl>Kk>BW~U4aX=&5w^H>?9Zd(hC#fkzbl(@hC zPE?R`2&Rk{oGUtJrhV;+AH3}fqY*z}Sg(~%=bcL>P20a#{wE9y`GB>&6-*qVxPY@tTNYWw8k7}FLHPFLJ;HC(FmzGV%c6}Tz zNXVKvlXFe3{~muM>DWLx^LQU{nz%Rp5xeCfE;?Yd)xwN#8$x+)KsysYwj-cG%7?!s9DuY?Ehc{z-a`TSI{M%;xUf!S~dll7)q! z3iAwoiU=j_;J#fY&!=?ZKaX0X3y#I_;bp3LZ>lpT+R%TlqEEsFru!yYY5dFRwLSfi zp;sDmv^o{wTFNABa}8vphd(Kd2=nt|&+k~teLaxI|Jn-HnH5b3h|rl5eT2<85D8!QBk>M@@Ip3O;`RV#fk0I? zq0lm4;kFFaTwgs3+So;jvpoQ7RtsOIh3}i*CqjV4c3jKf7NTm^UgZ~lfm#tZd@3u} zA=Lole5v*Od&~gE?fT}zK*VJTbs2K6DCb2X7DYW$B~i5Uk{S#{x3cl|^l!zV|5(CD zW1YNDhc=EorOMEb+F7!_`zqSZVo)6(IUL&Z%rZ`c$ppYM)F#)i^N= z+hN3vj{8D=mI=^O)7ZSzP~2DYJm$wFFhL8KiO}>14`pfN;8x8>uPl@w00GoRIFKw< zN=<1ho(}F=#H{#%rC;-S1R;=9TC(~IIaVz%a8C@xWycQ-OTGM0=J(qd@X;~S3_4Zt zxU*^X6GkLO{rg|W_lG1f(q(C1!IL2FZ92f;vjB`L@t!Cp6TtkMBLd6fRNsQ}4l9lK zgZBme`Qsl4oG6e5H1{@xH=HiZw@(Po*^kJv?kCj`Y9pQFh2nn7_s)o-T1#&T=;=5r zoy$$2xIh`5Gp&sWwFwmDbuOr#d;u3tm-w$7m)j(mIK=5}<$KM&IZLh7!xYcyU?~*j z!ZIU8HkL##ve&hF*rX%N)+;$Q*Yi6kIm0MipwOzPNLWVhD4n)?$5=vHALg zp5lS)VcQM$z&dzA&gDW&;Q{eOc)^|yH}5dndH@SgwI9ct^=mlOV1o3)gQIYP1|z$p zdTV8P&)pJCPiN9lKcVmej5$K#&Yj|f4;7zln}~Dm&2nviLWda|=}Y0Dm}~gzU67$G zDM5)J__sJ`MsQk$e1XiUqMzO@zGl_77JI}U7kuBz3crh+ebgAKQvgGRvd(lN{ZOcj zMaDFg!!(k{*aJy1+7SvS9Wj;=ro={{##eY_s(ki9JZfSuiGvj=hHCa``|d;h>A)jJ zE`7`NM$7LSM*O-D{~5h3!>{shtuH6XN&DJISj9IjlKmcwwZ`Rl{50 zf_a%@<-K=p9RW?7S0gyr*_&#}faiZ&8&qryaz_-OWa31%bH&3^O_2Zh#eJ@KqSX_0#JYJl#WP~(@NJb0W8Nl3i1O$_^t*!`II>s}cAKy9qPP&Op7omHL~Hn% zS30wUQ>iR1eW@I^LytUwo^~cyy-sGWY`>a`2BY1RJdd5kO(>3InTXtW>+1SdC*vdy zs(j25;%>BvCwNH-&U`~fhSBACksuK36i2f=0Dv(aMDh{_|Fz3ayZx5+;Vh6*^aTT9 zYzzn%p-6^bMp+F8s=W#qw9vxq0(@&{pzhJ&tqn07I;9!>eqHQR-5W0Fnak zRxr&icTW^diXGME+Q?5)LS_!6-z{H={sJeC7?d)peGPR{Xt4>=H+7y=EZ>op7r;R& zQq|YX14cOj75_!an$8_qI_AEJI456lXT$na13>9MiIaS zmqo7sDwHlTqq^G9fAIkCdRE0LNB?WSX*nGKfb&fpmzS^Ibx$~<)ctXe3^?fe?J~V~ zoCRCkX%FbKE!Z@@3|BCW47?wwk{+Y#u&p&8_6-2eHj!gs8XTYvgW^43{;{kbtRWdx z_DK?GlIjAF^O&PU3ot6-xbc8|tyVwbCic_I>P+2HF)hDLe5+WB@tjXu3x*TpR77~P zR8x3Zd4c4XUx7{C-%jAM0c%XT`P-{UC%W;PNy+RhWm{~efcy~5)|~bS1}wBf&EJ_8 zEKo+$_n=337($30h*qo@daMVQ&9hRp9X|L0%hfCU=bCN;M#nRq_{NV62b!R`SU791 z#iJ7^PaZ);EqNj+3I60L=4ph z=P^^jdue@^-+ECo?0S7u@*4UOhHgaU1sh`HKxkZ_$KJe+P8!Y{k-l#0?ADV~3Ll2E zkxApBn6Wk}tgQ9owk&;tHH^eCv%mM4GbG3JB)1;(%ZxRDpFZith_TFAPdk3tGndg) z?M{8j#ssN57vRLI22U!Q#jm*t8b5A~{Q$b&G@qR&g3{8UNkO(&wy+;!%KB<;jC9-S zD&e@01w91?5)h1gtXRwpx;EQ%L>u-xS5CH;JAuAQ#Q6nSo)AA`_oZS{#>RY;1@0{g zZpS#;lKI;F-+gY-2zCu$a||I29xQ#>Ndd*joTWR7XK|dlrr3cE5h6_ab%?V@KmcO` zKVAq4v~zVc)f;TyTo-`ztm$DPL*FS~@L_=gaXSC;1zLj`6cxOc6#whX*&8;x;2Mo^ zhF-i6CNDA%-ow28P6_Bib;a$m7Py6#X4%2d6%za5(azegg{+@IyZ@di;M4Rh*HbWO zk2X~se$#n@BUaV$nGm*}u*(767Su^boXa#oqT{RzS%iX z8XE|9d^~7du=&nD+$8mOBi#mc)H~xLlMmYPv!fBHMG-TKK@upJ)S99D)y#wLQ|Dn*cu6`u2UUlF{l`%7q< zuTm8PrdP9Q$9Pj?nnr{)?M@Jg$#i4>@hj?3L%Qf6ks9Q*cw6n@N1j|Njj;^l4;)W^ z5Ts0Nr_a8iXB*3T6$0|1<+f>d^J<;xUWv)nLH*BenbnoF{b_;i37m```$e)bB6*ETHl|X z1W6edOHGTe+&-8k6QEvtH7%(Rc3Tx)laDLjrp1Y05t4+!RP0WNOj)>ytUCYdPkTqn z>AJ9E*2jlqEINC?vSVy)6!N2gny+e+jal;e5MlrQq6pThzys|(g4oHZR9v!@3y64c z;pOHeb={%&gR{8RPvOuPrzV=evKk33t{#Z9DfM6=KqJGwgXX!^=XUmMSUfhPfo3^Q zn)&PZmXUqMRh12mHtNss6ac(|YC*PSmoD0*!{tW=Pyz{DwD%w1SHG5ij%zpRd~q>i zu_Nq+kAfR)RzdU@NbZHf;mCwSnZR4tI^pHr08EQ{_*tqH?PNAZ<>IQuMuW1$nHhMK z9B~5&7`E`YV3vfjWV$|B6)&qqU_;K`&XiJ;S99USHRhakvwfqSrA=HXnN)tUC-rdR zYtOn~pLHjrR-HIQ5UJhI)5fbmb~$-v;%;X#C#uhq$9DU&7o0uqeh_AxAU*t}l8Vgm zmiN#v;T0HwADABHSKd>C|Bwb0J!!!Q^~Z@t-NnWxI?)5^IvKUs8h z`pG+s`#Can7k*>9bp2*(M7mfKz(SwYMtfW0ZT*(vX2p_o{a8r)De3zIMkzI^X6U!Y zKZ#Gj16&(3rwlw8DA18)CDJ#lW|PjXd9q9WBI`W=i4JDc>F+i^sc0mz0N8m6*O33U z?3FdG=pX|X@pkz9@Z7Ki@D;&Z94?ySK}(Dl*{&;hFr}XC3c3S)AqOSprq6CoNqrvt zJ-c=Mj5V=c+aCI06ZzM2{+lA3u}E0?g0>45K)LtSFtm91X?5E?qR&&iICBgy^)rRDez6np5h5wVBoZ;rp8HvVO@Kh&Ck(3WAV-0A|K`=T(X6nt;lTi)`U(z2cguIech`NXm;4znQ~R#y zJ(}E>{h_Zd8&18#PhjsR|E&_*?Ht()RaS_`g{Y$m?rM}wVv2(fKI#}MKKK8K#Wed| zU7sG*MmCA-9X)h(ULw24Y1aH}^?~jR)B+%Cv8pJoPpR#aLUojxXdj;SaH|%7BI^(; zA8^eWY-64dhHGs79GEGS{5#)8o1}#ikOr2lzBV7^ZOp4*6IEPf znL#I_>c4&((z`h>bb}>M_F5_$k?WPqA|fl!O53X*@Z93ay15-%!}g-SwD2jFU7Pf~ zSp~6kS^J^yi-q2HXn#vbHJ44s5`n=$GWiXe_$Qym9}MgTyKmo#m}l6#O0HIC(K8v` zTC$~<*IJ4q@A!dthL11Gc*VUWG_nN@tx*G?{MKc|O{C(bZk_ z*kZb^nG6cH$^A|ZBt!o?m)#gHJgYEAs6ub>PDRqaXl4huX#Nh4<#rN(J*|E+NF3EwC) zE;VGfB^)=eb6PAGDZVh!16tHGRMrhCQGEtK;3I_adX&XpgTcn+d)ig8zJ> zy&RLaCYNZ88fnFMU7CLUD~n#y#9lCuNgNz6@P$005vrUOarLzb?sOMQ-nSf^bx&ey zu%#*0E5s@h(G*oo;L6fLeaYYwi^mJ86Adb@T3pISI8~J!UF>$j=qoOtSIHkn1X?Ih z*HfDA2%Cc`IDT!M`5TMs=`~pIwA+w-IfMM;`zzPpa2Q8=)j4Q|p6c+DgeJ9bIFt6r*jD9g6IWIKOQ~&)Z^%U zMSAk*WA^ry+I#!`rVJAegFV{}arH{a@XP2qxlb;iTS4uwH~2%T3lHmQGe3eTvIv|V z?Ii5d1Xq+wG%9NDx%PhrN(cyY_5($*ix-_zE^&H4l8w#ZA&Z3D%%p}PPq}M z=0@xV0VU+ehKc0yfOSQ{;ujvJqIiCo6VBd0N3>XgA1Sw$C-KC?X~GCa@Z1b7n~_wY z!DGc0pKKhOk7jRplTLfJQaxk3~;wWVEGJMf4Z z@mQkzye`Ct!H|XBG>w0Lc$xll^r-iPX`~@*()A(AfVsnf7{R(w+UD)ryg~ zl~jDd(&6rRk;)UMY3c9#@3A+ezOlg<{6|L|JyR0NesiM zNMgX&p0~$03}3C&g+^$=SL4{?|M^`gHGPG7c6TwA9aFlH|6g^Y=K^i`5P-G!y-_Ph zwDb0KUTy#3yp3(TF?|F9{1f~6Zafq7q`l~>57&Pv_VSKPDGitlXL-85W(;nD0jrFF z4J8cl+Ue6|&lpCQ?#8`#GSy8pdE1M@y(`=$;rY`L1=&sd%2Q@3DC-!qC2 zWVyIMXSsXxk~WY>cT1I6KekxaOm{5P#4j(!wQ4Dk#?Qy|F!)FduGJb$#zALH<-heO z$u#@!=hwp%B>_q0aWjaN9?#!u5>Q<(= yAk%ucxm!a5KuYPCIl2Qbsmq=^;R4_{XODQ{(Kw)5#O;4+)0Gu96sqJbLjE7Cq$>IV literal 0 HcmV?d00001 From c15d7ea2e159b864ec63d666f54cbfee09c6ef67 Mon Sep 17 00:00:00 2001 From: trbrc Date: Fri, 17 May 2019 13:19:51 +0200 Subject: [PATCH 011/409] Docs: Exporting function expression vs declaration Current docs give the impression that functions can not be default values for props. Suggestion to make the distinction between expressions and declarations clearer. --- site/content/docs/01-component-format.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/site/content/docs/01-component-format.md b/site/content/docs/01-component-format.md index 1472ff3d6c..ddd2667075 100644 --- a/site/content/docs/01-component-format.md +++ b/site/content/docs/01-component-format.md @@ -47,11 +47,14 @@ Svelte uses the `export` keyword to mark a variable declaration as a *property* // Values that are passed in as props // are immediately available console.log(foo, bar); - - // function declarations cannot be set externally, - // but can be accessed from outside - export function instanceMethod() { - alert(foo); + + // Function expressions can also be props + export let format = (number) => (number.toFixed(2)); + + // Function declarations are added as methods + // on the component, rather than props + export function greetMethod() { + alert(`I'm a <${this.constructor.name}>!`); } // you can also use export { ... as ... } to have From 2cb81f0d5d9cbe25a629758c00f14224b4d6bd81 Mon Sep 17 00:00:00 2001 From: Sander Hahn Date: Fri, 17 May 2019 14:15:52 +0200 Subject: [PATCH 012/409] add docstrings to store --- src/store.ts | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/store.ts b/src/store.ts index 1f00503af2..ef86130f56 100644 --- a/src/store.ts +++ b/src/store.ts @@ -1,32 +1,64 @@ import { run_all, noop, safe_not_equal, is_function } from './internal/utils'; +/** Callback to inform of a value updates. */ type Subscriber = (value: T) => void; +/** Unsubscribes from value updates. */ type Unsubscriber = () => void; +/** Callback to update a value. */ type Updater = (value: T) => T; +/** Cleanup logic callback. */ type Invalidater = (value?: T) => void; +/** Start and stop notification callbacks. */ type StartStopNotifier = (set: Subscriber) => Unsubscriber | void; +/** Readable interface for subscribing. */ export interface Readable { + /** + * Subscribe on value changes. + * @param run subscription callback + * @param invalidate cleanup callback + */ subscribe(run: Subscriber, invalidate?: Invalidater): Unsubscriber; } +/** Writable interface for both updating and subscribing. */ export interface Writable extends Readable { + /** + * Set value and inform subscribers. + * @param value to set + */ set(value: T): void; + + /** + * Update value using callback and inform subscribers. + * @param updater callback + */ update(updater: Updater): void; } +/** Pair of subscriber and invalidator. */ type SubscribeInvalidateTuple = [Subscriber, Invalidater]; +/** + * Creates a `Readable` store that allows reading by subscription. + * @param value initial value + * @param start start and stop notifications for subscriptions + */ export function readable(value: T, start: StartStopNotifier): Readable { return { subscribe: writable(value, start).subscribe, }; } +/** + * Create a `Writable` store that allows both updating and reading by subscription. + * @param value initial value + * @param start start and stop notifications for subscriptions + */ export function writable(value: T, start: StartStopNotifier = noop): Writable { let stop: Unsubscriber; const subscribers: Array> = []; @@ -68,11 +100,20 @@ export function writable(value: T, start: StartStopNotifier = noop): Writa return { set, update, subscribe }; } +/** One or more `Readable`s. */ type Stores = Readable | [Readable, ...Array>]; +/** One or more values from `Readable` stores. */ type StoresValues = T extends Readable ? U : { [K in keyof T]: T[K] extends Readable ? U : never }; +/** + * Derived value store by synchronizing one or more readable stores and + * applying an aggration function over its input values. + * @param stores input stores + * @param fn function callback that aggregates the values + * @param initial_value when used asynchronously + */ export function derived( stores: S, fn: (values: StoresValues, set?: Subscriber) => T | Unsubscriber | void, @@ -129,6 +170,10 @@ export function derived( }); } +/** + * Get the current value from a store by subscribing and immediately unsubscribing. + * @param store readable + */ export function get(store: Readable): T { let value: T | undefined; store.subscribe((_: T) => value = _)(); From 335f77cc4806bd911b66c3e733bef193e42c5a84 Mon Sep 17 00:00:00 2001 From: Christian Kaisermann Date: Fri, 17 May 2019 15:23:47 -0300 Subject: [PATCH 013/409] =?UTF-8?q?fix:=20=F0=9F=90=9B=20data=20attributes?= =?UTF-8?q?=20without=20value=20outputting=20as=20"true"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/compile/render-dom/wrappers/Element/Attribute.ts | 2 +- .../runtime/samples/attribute-dataset-without-value/_config.js | 3 +++ .../samples/attribute-dataset-without-value/main.svelte | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 test/runtime/samples/attribute-dataset-without-value/_config.js create mode 100644 test/runtime/samples/attribute-dataset-without-value/main.svelte diff --git a/src/compile/render-dom/wrappers/Element/Attribute.ts b/src/compile/render-dom/wrappers/Element/Attribute.ts index 9841f4e85d..5007724f34 100644 --- a/src/compile/render-dom/wrappers/Element/Attribute.ts +++ b/src/compile/render-dom/wrappers/Element/Attribute.ts @@ -187,7 +187,7 @@ export default class AttributeWrapper { : property_name ? `${element.var}.${property_name} = ${value};` : is_dataset - ? `${element.var}.dataset.${camel_case_name} = ${value};` + ? `${element.var}.dataset.${camel_case_name} = ${value === true ? '""' : value};` : `${method}(${element.var}, "${name}", ${value === true ? '""' : value});` ); diff --git a/test/runtime/samples/attribute-dataset-without-value/_config.js b/test/runtime/samples/attribute-dataset-without-value/_config.js new file mode 100644 index 0000000000..934f44eb06 --- /dev/null +++ b/test/runtime/samples/attribute-dataset-without-value/_config.js @@ -0,0 +1,3 @@ +export default { + html: '
      ', +}; diff --git a/test/runtime/samples/attribute-dataset-without-value/main.svelte b/test/runtime/samples/attribute-dataset-without-value/main.svelte new file mode 100644 index 0000000000..ed7d532652 --- /dev/null +++ b/test/runtime/samples/attribute-dataset-without-value/main.svelte @@ -0,0 +1 @@ +
      From 2255aadf369a36fa64fdf4be44d003b06b852a07 Mon Sep 17 00:00:00 2001 From: Sander Hahn Date: Fri, 17 May 2019 19:15:18 +0200 Subject: [PATCH 014/409] Fixes for #2799 --- site/src/routes/index.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/src/routes/index.svelte b/site/src/routes/index.svelte index 539f522b4e..cbbdf43e95 100644 --- a/site/src/routes/index.svelte +++ b/site/src/routes/index.svelte @@ -89,7 +89,7 @@ npx degit sveltejs/template my-svelte-project cd my-svelte-project npm install -npm run dev & open http://localhost:5000 +npm run dev

      See the quickstart guide for more information.

      From 7265fd4e834d57ad266aae2953b83116861c8a2e Mon Sep 17 00:00:00 2001 From: Conduitry Date: Sat, 18 May 2019 09:43:50 -0400 Subject: [PATCH 015/409] site: fix binary template files in REPL zips (#2812) --- site/scripts/build-svelte-app-json.js | 11 ----------- site/scripts/update_template.js | 7 +++++-- 2 files changed, 5 insertions(+), 13 deletions(-) delete mode 100644 site/scripts/build-svelte-app-json.js diff --git a/site/scripts/build-svelte-app-json.js b/site/scripts/build-svelte-app-json.js deleted file mode 100644 index 59a4b4a07b..0000000000 --- a/site/scripts/build-svelte-app-json.js +++ /dev/null @@ -1,11 +0,0 @@ -const fs = require('fs'); - -const files = []; - -for (const path of process.argv.slice(2)) { - if (!path.includes('/.')) { - files.push({ path: path.slice(19), data: fs.readFileSync(path).toString() }); - } -} - -fs.writeFileSync('static/svelte-app.json', JSON.stringify(files)); diff --git a/site/scripts/update_template.js b/site/scripts/update_template.js index 814d402f5e..9d897c064f 100644 --- a/site/scripts/update_template.js +++ b/site/scripts/update_template.js @@ -1,7 +1,7 @@ const sh = require('shelljs'); const fs = require('fs'); -sh.cd(__dirname+'/../'); +sh.cd(__dirname + '/../'); // fetch svelte app sh.rm('-rf','scripts/svelte-app'); @@ -16,7 +16,10 @@ const appPath = 'scripts/svelte-app'; const files = []; for (const path of sh.find(appPath).filter(p => fs.lstatSync(p).isFile()) ) { - files.push({ path: path.slice(appPath.length + 1), data: fs.readFileSync(path).toString() }); + const bytes = fs.readFileSync(path); + const string = bytes.toString(); + const data = bytes.compare(Buffer.from(string)) === 0 ? string : [...bytes]; + files.push({ path: path.slice(appPath.length + 1), data }); } fs.writeFileSync('static/svelte-app.json', JSON.stringify(files)); \ No newline at end of file From a6d75b85e6a8e93182f94e7bb768307995e878ef Mon Sep 17 00:00:00 2001 From: Conduitry Date: Sun, 19 May 2019 07:17:30 -0400 Subject: [PATCH 016/409] site: improve instructions for using local copy of Svelte --- site/README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/site/README.md b/site/README.md index c438bda5ca..59380feffc 100644 --- a/site/README.md +++ b/site/README.md @@ -13,7 +13,11 @@ Start the server with `npm run dev`, and navigate to [localhost:3000](http://loc ## Using a local copy of Svelte -By default, the REPL will fetch the most recent version of Svelte from https://unpkg.com/svelte. To use the local copy of the compiler and runtime from this repo, you can navigate to [localhost:3000/repl?version=local](http://localhost:3000/repl?version=local). To produce the proper browser-compatible UMD build, you will need to run `npm run build` with the `PUBLISH` environment variable set (to any non-empty string). +By default, the REPL will fetch the most recent version of Svelte from https://unpkg.com/svelte. When running the site locally, you can also use your local copy of Svelte. + +To produce the proper browser-compatible UMD build of the compiler, you will need to run `npm run build` (or `npm run dev`) in the root of this repository with the `PUBLISH` environment variable set to any non-empty string. + +Then visit the REPL at [localhost:3000/repl?version=local](http://localhost:3000/repl?version=local). ## REPL GitHub integration From 7ebf3477a4a6570fa2c246eb72ab779ae4142cac Mon Sep 17 00:00:00 2001 From: Conduitry Date: Sun, 19 May 2019 16:00:21 -0400 Subject: [PATCH 017/409] site: bump @sveltejs/svelte-repl --- site/package-lock.json | 6 +++--- site/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/site/package-lock.json b/site/package-lock.json index 1fce7fa115..a905818214 100644 --- a/site/package-lock.json +++ b/site/package-lock.json @@ -1362,9 +1362,9 @@ } }, "@sveltejs/svelte-repl": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/@sveltejs/svelte-repl/-/svelte-repl-0.0.10.tgz", - "integrity": "sha512-PYXCN8OC2q3WzwtMcbFinLGzFI7RlD3cHqjkUuQWDaIMHriKYuALun4H/FxP8w3B3hNe9OBprgGmBzlkPuGEJw==", + "version": "0.0.11", + "resolved": "https://registry.npmjs.org/@sveltejs/svelte-repl/-/svelte-repl-0.0.11.tgz", + "integrity": "sha512-F284f8qaUs1rp8akqWXcB6oovlaso7qmsUz1rqm80FwUKLffjYIWy2a1p6+Yo1kRy6Q+fW8kj21JLEqv7pjOwA==", "dev": true, "requires": { "codemirror": "^5.45.0", diff --git a/site/package.json b/site/package.json index f5ef1ba258..70748dad77 100644 --- a/site/package.json +++ b/site/package.json @@ -38,7 +38,7 @@ "@babel/runtime": "^7.4.4", "@sindresorhus/slugify": "^0.9.1", "@sveltejs/site-kit": "^1.0.4", - "@sveltejs/svelte-repl": "0.0.10", + "@sveltejs/svelte-repl": "0.0.11", "degit": "^2.1.3", "dotenv": "^8.0.0", "eslint-plugin-svelte3": "^1.0.0", From 1e919113c1cb96417d1bca4664ddc262fd12318c Mon Sep 17 00:00:00 2001 From: Conduitry Date: Mon, 20 May 2019 10:22:01 -0400 Subject: [PATCH 018/409] site: document additional arguments in svelte.walk --- site/content/docs/04-compile-time.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/site/content/docs/04-compile-time.md b/site/content/docs/04-compile-time.md index b019b9437b..c219bae497 100644 --- a/site/content/docs/04-compile-time.md +++ b/site/content/docs/04-compile-time.md @@ -308,8 +308,8 @@ const { code } = svelte.preprocess(source, [ ```js walk(ast: Node, { - enter(node: Node, parent: Node)?: void, - leave(node: Node, parent: Node)?: void + enter(node: Node, parent: Node, prop: string, index: number)?: void, + leave(node: Node, parent: Node, prop: string, index: number)?: void }) ``` @@ -323,13 +323,13 @@ The walker takes an abstract syntax tree to walk and an object with two optional ```js const svelte = require('svelte/compiler'); svelte.walk(ast, { - enter(node, parent) { + enter(node, parent, prop, index) { do_something(node); if (should_skip_children(node)) { this.skip(); } }, - leave(node, parent) { + leave(node, parent, prop, index) { do_something_else(node); } }); From 394a166a4198ab27c4a2f3b51b042e1830c6bb09 Mon Sep 17 00:00:00 2001 From: Emanuele Date: Mon, 20 May 2019 18:46:27 +0100 Subject: [PATCH 019/409] docs: multiple event listeners on single node (#2825) --- site/content/docs/02-template-syntax.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/site/content/docs/02-template-syntax.md b/site/content/docs/02-template-syntax.md index 5b8a22f9bf..167d1fa3a2 100644 --- a/site/content/docs/02-template-syntax.md +++ b/site/content/docs/02-template-syntax.md @@ -351,6 +351,24 @@ If the `on:` directive is used without a value, the component will *forward* the ``` +--- + +It's possible to have multiple event listeners for the same event: + +```html + + + +``` ### Component events From 0247cca84a850f86dd65f0f698b93cf9aa7a379e Mon Sep 17 00:00:00 2001 From: Colin Casey Date: Mon, 20 May 2019 17:05:57 -0300 Subject: [PATCH 020/409] Allow custom element to be declared with no tag and no options --- src/compile/Component.ts | 2 +- .../samples/no-svelte-options/_config.js | 17 +++++++++++++++++ .../samples/no-svelte-options/main.svelte | 5 +++++ .../samples/no-svelte-options/test.js | 12 ++++++++++++ 4 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 test/custom-elements/samples/no-svelte-options/_config.js create mode 100644 test/custom-elements/samples/no-svelte-options/main.svelte create mode 100644 test/custom-elements/samples/no-svelte-options/test.js diff --git a/src/compile/Component.ts b/src/compile/Component.ts index 86b43c1b64..a429db41f6 100644 --- a/src/compile/Component.ts +++ b/src/compile/Component.ts @@ -153,7 +153,7 @@ export default class Component { if (compile_options.customElement) { if (this.component_options.tag === undefined && compile_options.tag === undefined) { - const svelteOptions = ast.html.children.find(child => child.name === 'svelte:options'); + const svelteOptions = ast.html.children.find(child => child.name === 'svelte:options') || { start: 0, end: 0 }; this.warn(svelteOptions, { code: 'custom-element-no-tag', message: `No custom element 'tag' option was specified. To automatically register a custom element, specify a name with a hyphen in it, e.g. . To hide this warning, use ` diff --git a/test/custom-elements/samples/no-svelte-options/_config.js b/test/custom-elements/samples/no-svelte-options/_config.js new file mode 100644 index 0000000000..e45582a127 --- /dev/null +++ b/test/custom-elements/samples/no-svelte-options/_config.js @@ -0,0 +1,17 @@ +export default { + warnings: [{ + code: "custom-element-no-tag", + message: "No custom element 'tag' option was specified. To automatically register a custom element, specify a name with a hyphen in it, e.g. . To hide this warning, use ", + pos: 0, + start: { + character: 0, + column: 0, + line: 1 + }, + end: { + character: 0, + column: 0, + line: 1 + } + }] +}; diff --git a/test/custom-elements/samples/no-svelte-options/main.svelte b/test/custom-elements/samples/no-svelte-options/main.svelte new file mode 100644 index 0000000000..538dc970e9 --- /dev/null +++ b/test/custom-elements/samples/no-svelte-options/main.svelte @@ -0,0 +1,5 @@ + + +

      Hello {name}!

      diff --git a/test/custom-elements/samples/no-svelte-options/test.js b/test/custom-elements/samples/no-svelte-options/test.js new file mode 100644 index 0000000000..c77f035088 --- /dev/null +++ b/test/custom-elements/samples/no-svelte-options/test.js @@ -0,0 +1,12 @@ +import * as assert from 'assert'; +import CustomElement from './main.svelte'; + +export default function (target) { + customElements.define('no-tag', CustomElement); + target.innerHTML = ``; + + const el = target.querySelector('no-tag'); + const h1 = el.shadowRoot.querySelector('h1'); + + assert.equal(h1.textContent, 'Hello world!'); +} From 832259f952fa818ed7ce9d0daffa3fd17e5a51f8 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Mon, 20 May 2019 21:13:24 -0400 Subject: [PATCH 021/409] Update store.ts --- src/store.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store.ts b/src/store.ts index ef86130f56..b0ee41fc8d 100644 --- a/src/store.ts +++ b/src/store.ts @@ -109,7 +109,7 @@ type StoresValues = T extends Readable ? U : /** * Derived value store by synchronizing one or more readable stores and - * applying an aggration function over its input values. + * applying an aggregation function over its input values. * @param stores input stores * @param fn function callback that aggregates the values * @param initial_value when used asynchronously From 4f324ce1cfda2c980fc6da6652b8b35912e25455 Mon Sep 17 00:00:00 2001 From: Rai Talha Rehman Date: Tue, 21 May 2019 06:16:31 +0500 Subject: [PATCH 022/409] update clone with https (#2787) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4d03eca934..7d0af8ac2e 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Pull requests are encouraged and always welcome. [Pick an issue](https://github. To install and work on Svelte locally: ```bash -git clone git@github.com:sveltejs/svelte.git +git clone https://github.com/sveltejs/svelte.git cd svelte npm install ``` From a0b876f99f8f5799f684a243999964078352734d Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Mon, 20 May 2019 22:13:34 -0400 Subject: [PATCH 023/409] -> v3.4.2 --- CHANGELOG.md | 6 ++++++ package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf044812a2..02d42ddc8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Svelte changelog +## 3.4.2 + +* Use empty string for empty data attributes ([#2804](https://github.com/sveltejs/svelte/pull/2804)) +* Support `customElement: true` with no `` ([#2821](https://github.com/sveltejs/svelte/issues/2821)) +* Add docstrings to `svelte/store` ([#2795](https://github.com/sveltejs/svelte/pull/2795)) + ## 3.4.1 * Handle non-falsy non-function return values from derivers ([#2780](https://github.com/sveltejs/svelte/issues/2780)) diff --git a/package.json b/package.json index 12a5cac083..90ec6d27ec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "svelte", - "version": "3.4.1", + "version": "3.4.2", "description": "Cybernetically enhanced web apps", "module": "index.mjs", "main": "index", From d548a5a5f40451331610c51c0bd9319b69bb3c61 Mon Sep 17 00:00:00 2001 From: Conduitry Date: Tue, 21 May 2019 00:20:25 -0400 Subject: [PATCH 024/409] site: bump sapper --- site/package-lock.json | 54 ++++++++++++++++-------------------------- site/package.json | 2 +- 2 files changed, 21 insertions(+), 35 deletions(-) diff --git a/site/package-lock.json b/site/package-lock.json index a905818214..b61cee722e 100644 --- a/site/package-lock.json +++ b/site/package-lock.json @@ -2556,26 +2556,18 @@ "dev": true }, "html-minifier": { - "version": "3.5.21", - "resolved": "https://registry.npmjs.org/html-minifier/-/html-minifier-3.5.21.tgz", - "integrity": "sha512-LKUKwuJDhxNa3uf/LPR/KVjm/l3rBqtYeCOAekvG8F1vItxMUpueGd94i/asDDr8/1u7InxzFA5EeGjhhG5mMA==", - "dev": true, - "requires": { - "camel-case": "3.0.x", - "clean-css": "4.2.x", - "commander": "2.17.x", - "he": "1.2.x", - "param-case": "2.1.x", - "relateurl": "0.2.x", - "uglify-js": "3.4.x" - }, - "dependencies": { - "commander": { - "version": "2.17.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", - "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", - "dev": true - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/html-minifier/-/html-minifier-4.0.0.tgz", + "integrity": "sha512-aoGxanpFPLg7MkIl/DDFYtb0iWz7jMFGqFhvEDZga6/4QTjneiD8I/NXL1x5aaoCp7FSIT6h/OhykDdPsbtMig==", + "dev": true, + "requires": { + "camel-case": "^3.0.0", + "clean-css": "^4.2.1", + "commander": "^2.19.0", + "he": "^1.2.0", + "param-case": "^2.1.1", + "relateurl": "^0.2.7", + "uglify-js": "^3.5.1" } }, "http-link-header": { @@ -4210,12 +4202,12 @@ } }, "sapper": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/sapper/-/sapper-0.26.1.tgz", - "integrity": "sha512-ogc0C/RA+L2O6ymdVsNN9kgWUYEb/toOsT7uMQhqBjI98nfNIONRSYW1ne+US0vZHPxyqz0lXE8v0BSizcDJcg==", + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/sapper/-/sapper-0.27.1.tgz", + "integrity": "sha512-RH0K1uQ3zJ1IXvowxr2SuboGXV69q22KaPMhhoM5VNDv9fsUlVHtluZE8WTcGxckiO2L1xFfgM7v/aINkSZpcw==", "dev": true, "requires": { - "html-minifier": "^3.5.21", + "html-minifier": "^4.0.0", "http-link-header": "^1.0.2", "shimport": "^1.0.0", "sourcemap-codec": "^1.4.4", @@ -4808,21 +4800,15 @@ } }, "uglify-js": { - "version": "3.4.10", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.10.tgz", - "integrity": "sha512-Y2VsbPVs0FIshJztycsO2SfPk7/KAF/T72qzv9u5EpQ4kB2hQoHlhNQTsNyy6ul7lQtqJN/AoWeS23OzEiEFxw==", + "version": "3.5.14", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.14.tgz", + "integrity": "sha512-dgyjIw8KFK6AyVl5vm2tEqPewv5TKGEiiVFLI1LbF+oHua/Njd8tZk3lIbF1AWU1rNdEg7scaceADb4zqCcWXg==", "dev": true, "requires": { - "commander": "~2.19.0", + "commander": "~2.20.0", "source-map": "~0.6.1" }, "dependencies": { - "commander": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", - "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==", - "dev": true - }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", diff --git a/site/package.json b/site/package.json index 70748dad77..d9de5a217e 100644 --- a/site/package.json +++ b/site/package.json @@ -56,7 +56,7 @@ "rollup-plugin-replace": "^2.2.0", "rollup-plugin-svelte": "^5.0.3", "rollup-plugin-terser": "^4.0.4", - "sapper": "^0.26.0", + "sapper": "^0.27.1", "shelljs": "^0.8.3", "svelte": "^3.0.0" }, From b1a24c853b571a3ee1f1ec78afa6baee9a299f93 Mon Sep 17 00:00:00 2001 From: Bogdan Savluk Date: Tue, 21 May 2019 17:51:36 +0200 Subject: [PATCH 025/409] ignore .idea folder --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7aa75b29f4..3d1322c33e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.idea .DS_Store .nyc_output node_modules From 6fdaa803c77a6bb1d0eb5c20906cc2783da430da Mon Sep 17 00:00:00 2001 From: Bogdan Savluk Date: Tue, 21 May 2019 17:54:06 +0200 Subject: [PATCH 026/409] improve parser typings --- src/interfaces.ts | 45 ++++++++++++++++++++++++++++++++++-- src/parse/read/expression.ts | 9 ++++---- src/parse/state/tag.ts | 14 +++++------ 3 files changed, 55 insertions(+), 13 deletions(-) diff --git a/src/interfaces.ts b/src/interfaces.ts index 68fef7472e..90ee60d1be 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -1,10 +1,51 @@ -export interface Node { +interface BaseNode { start: number; end: number; type: string; + children?: Node[]; [prop_name: string]: any; } +export interface Text extends BaseNode { + type: 'Text', + data: string; +} + +export interface MustacheTag extends BaseNode { + type: 'MustacheTag', + expresion: Node; +} + +export type DirectiveType = 'Action' + | 'Animation' + | 'Binding' + | 'Class' + | 'EventHandler' + | 'Let' + | 'Ref' + | 'Transition'; + +interface BaseDirective extends BaseNode { + type: DirectiveType; + expression: null|Node; + name: string; + modifiers: string[] +} + +export interface Transition extends BaseDirective{ + type: 'Transition', + intro: boolean; + outro: boolean; +} + +export type Directive = BaseDirective | Transition; + +export type Node = Text + | MustacheTag + | BaseNode + | Directive + | Transition; + export interface Parser { readonly template: string; readonly filename?: string; @@ -92,4 +133,4 @@ export interface Var { initialised?: boolean; hoistable?: boolean; subscribable?: boolean; -} \ No newline at end of file +} diff --git a/src/parse/read/expression.ts b/src/parse/read/expression.ts index 4d1de89fe7..615f270112 100644 --- a/src/parse/read/expression.ts +++ b/src/parse/read/expression.ts @@ -1,9 +1,10 @@ import { parse_expression_at } from '../acorn'; import { Parser } from '../index'; +import { Identifier, Node, SimpleLiteral } from 'estree'; const literals = new Map([['true', true], ['false', false], ['null', null]]); -export default function read_expression(parser: Parser) { +export default function read_expression(parser: Parser): Node { const start = parser.index; const name = parser.read_until(/\s*}/); @@ -17,7 +18,7 @@ export default function read_expression(parser: Parser) { end, value: literals.get(name), raw: name, - }; + } as SimpleLiteral; } return { @@ -25,7 +26,7 @@ export default function read_expression(parser: Parser) { start, end: start + name.length, name, - }; + } as Identifier; } parser.index = start; @@ -34,7 +35,7 @@ export default function read_expression(parser: Parser) { const node = parse_expression_at(parser.template, parser.index); parser.index = node.end; - return node; + return node as Node; } catch (err) { parser.acorn_error(err); } diff --git a/src/parse/state/tag.ts b/src/parse/state/tag.ts index 56195549d8..f7f5a93574 100644 --- a/src/parse/state/tag.ts +++ b/src/parse/state/tag.ts @@ -4,7 +4,7 @@ import read_style from '../read/style'; import { decode_character_references } from '../utils/html'; import { is_void } from '../../utils/names'; import { Parser } from '../index'; -import { Node } from '../../interfaces'; +import { Directive, DirectiveType, Node, Text } from '../../interfaces'; import fuzzymatch from '../../utils/fuzzymatch'; import list from '../../utils/list'; @@ -401,7 +401,7 @@ function read_attribute(parser: Parser, unique_names: Set) { } if (value[0]) { - if (value.length > 1 || value[0].type === 'Text') { + if ((value as Array).length > 1 || value[0].type === 'Text') { parser.error({ code: `invalid-directive-value`, message: `Directive value must be a JavaScript expression enclosed in curly braces` @@ -409,7 +409,7 @@ function read_attribute(parser: Parser, unique_names: Set) { } } - const directive = { + const directive: Directive = { start, end, type, @@ -445,7 +445,7 @@ function read_attribute(parser: Parser, unique_names: Set) { }; } -function get_directive_type(name) { +function get_directive_type(name: string):DirectiveType { if (name === 'use') return 'Action'; if (name === 'animate') return 'Animation'; if (name === 'bind') return 'Binding'; @@ -471,15 +471,15 @@ function read_attribute_value(parser: Parser) { return value; } -function read_sequence(parser: Parser, done: () => boolean) { - let current_chunk: Node = { +function read_sequence(parser: Parser, done: () => boolean): Node[] { + let current_chunk: Text = { start: parser.index, end: null, type: 'Text', data: '', }; - const chunks = []; + const chunks: Node[] = []; while (parser.index < parser.template.length) { const index = parser.index; From b7ec99e8c7442c5ef85fde2e4e3382e48fd2ecd8 Mon Sep 17 00:00:00 2001 From: Bogdan Savluk Date: Tue, 21 May 2019 20:55:04 +0200 Subject: [PATCH 027/409] fix compile/nodes typings --- src/compile/nodes/Attribute.ts | 9 +++- src/compile/nodes/AwaitBlock.ts | 1 + src/compile/nodes/Binding.ts | 1 + src/compile/nodes/CatchBlock.ts | 1 + src/compile/nodes/DebugTag.ts | 3 +- src/compile/nodes/EachBlock.ts | 17 +++++-- src/compile/nodes/Element.ts | 16 +++--- src/compile/nodes/ElseBlock.ts | 3 +- src/compile/nodes/EventHandler.ts | 3 +- src/compile/nodes/Fragment.ts | 6 ++- src/compile/nodes/Head.ts | 1 - src/compile/nodes/InlineComponent.ts | 3 +- src/compile/nodes/MustacheTag.ts | 4 +- src/compile/nodes/PendingBlock.ts | 2 +- src/compile/nodes/RawMustacheTag.ts | 4 +- src/compile/nodes/Slot.ts | 8 +-- src/compile/nodes/Text.ts | 8 +-- src/compile/nodes/ThenBlock.ts | 1 + src/compile/nodes/Title.ts | 10 ++-- src/compile/nodes/interfaces.ts | 62 +++++++++++++++++++++++ src/compile/nodes/shared/AbstractBlock.ts | 3 +- src/compile/nodes/shared/Expression.ts | 13 +++-- src/compile/nodes/shared/Node.ts | 12 +++-- src/compile/nodes/shared/Tag.ts | 3 +- src/compile/nodes/shared/TemplateScope.ts | 3 +- src/compile/nodes/shared/map_children.ts | 8 +-- src/compile/utils/add_to_set.ts | 5 +- src/compile/utils/scope.ts | 4 +- src/compile/utils/stringify_attribute.ts | 5 +- 29 files changed, 163 insertions(+), 56 deletions(-) create mode 100644 src/compile/nodes/interfaces.ts diff --git a/src/compile/nodes/Attribute.ts b/src/compile/nodes/Attribute.ts index c07960ce47..0b2d3a3700 100644 --- a/src/compile/nodes/Attribute.ts +++ b/src/compile/nodes/Attribute.ts @@ -67,6 +67,7 @@ export default class Attribute extends Node { this.should_cache = this.is_dynamic ? this.chunks.length === 1 + // @ts-ignore todo: probably error ? this.chunks[0].node.type !== 'Identifier' || scope.names.has(this.chunks[0].node.name) : true : false; @@ -91,8 +92,10 @@ export default class Attribute extends Node { if (this.chunks.length === 0) return `""`; if (this.chunks.length === 1) { + return this.chunks[0].type === 'Text' - ? stringify(this.chunks[0].data) + ? stringify((this.chunks[0] as Text).data) + // @ts-ignore todo: probably error : this.chunks[0].render(block); } @@ -102,6 +105,7 @@ export default class Attribute extends Node { if (chunk.type === 'Text') { return stringify(chunk.data); } else { + // @ts-ignore todo: probably error return chunk.get_precedence() <= 13 ? `(${chunk.render()})` : chunk.render(); } }) @@ -114,7 +118,8 @@ export default class Attribute extends Node { return this.is_true ? true : this.chunks[0] - ? this.chunks[0].data + // method should be called only when `is_static = true` + ? (this.chunks[0] as Text).data : ''; } } diff --git a/src/compile/nodes/AwaitBlock.ts b/src/compile/nodes/AwaitBlock.ts index f8e6896b5d..cd57750d29 100644 --- a/src/compile/nodes/AwaitBlock.ts +++ b/src/compile/nodes/AwaitBlock.ts @@ -5,6 +5,7 @@ import CatchBlock from './CatchBlock'; import Expression from './shared/Expression'; export default class AwaitBlock extends Node { + type: 'AwaitBlock'; expression: Expression; value: string; error: string; diff --git a/src/compile/nodes/Binding.ts b/src/compile/nodes/Binding.ts index b03eba0c36..0d666a543f 100644 --- a/src/compile/nodes/Binding.ts +++ b/src/compile/nodes/Binding.ts @@ -5,6 +5,7 @@ import Component from '../Component'; import TemplateScope from './shared/TemplateScope'; export default class Binding extends Node { + type: 'Binding'; name: string; expression: Expression; is_contextual: boolean; diff --git a/src/compile/nodes/CatchBlock.ts b/src/compile/nodes/CatchBlock.ts index 23c08a494c..0edc0f76d8 100644 --- a/src/compile/nodes/CatchBlock.ts +++ b/src/compile/nodes/CatchBlock.ts @@ -3,6 +3,7 @@ import TemplateScope from './shared/TemplateScope'; import AbstractBlock from './shared/AbstractBlock'; export default class CatchBlock extends AbstractBlock { + type: 'CatchBlock'; scope: TemplateScope; constructor(component, parent, scope, info) { diff --git a/src/compile/nodes/DebugTag.ts b/src/compile/nodes/DebugTag.ts index 4d2c3f6ae4..0fbfa592ad 100644 --- a/src/compile/nodes/DebugTag.ts +++ b/src/compile/nodes/DebugTag.ts @@ -2,6 +2,7 @@ import Node from './shared/Node'; import Expression from './shared/Expression'; export default class DebugTag extends Node { + type: 'DebugTag'; expressions: Expression[]; constructor(component, parent, scope, info) { @@ -11,4 +12,4 @@ export default class DebugTag extends Node { return new Expression(component, parent, scope, node); }); } -} \ No newline at end of file +} diff --git a/src/compile/nodes/EachBlock.ts b/src/compile/nodes/EachBlock.ts index b58c023ac9..2f18373137 100644 --- a/src/compile/nodes/EachBlock.ts +++ b/src/compile/nodes/EachBlock.ts @@ -6,8 +6,15 @@ import TemplateScope from './shared/TemplateScope'; import AbstractBlock from './shared/AbstractBlock'; import { Node as INode } from '../../interfaces'; import { new_tail } from '../utils/tail'; +import Element from './Element'; -function unpack_destructuring(contexts: Array<{ name: string, tail: string }>, node: INode, tail: string) { +type Context = { + key: INode, + name?: string, + tail: string +}; + +function unpack_destructuring(contexts: Array, node: INode, tail: string) { if (!node) return; if (node.type === 'Identifier' || node.type === 'RestIdentifier') { @@ -53,7 +60,7 @@ export default class EachBlock extends AbstractBlock { context: string; key: Expression; scope: TemplateScope; - contexts: Array<{ name: string, tail: string }>; + contexts: Array; has_animation: boolean; has_binding = false; @@ -82,7 +89,7 @@ export default class EachBlock extends AbstractBlock { if (this.index) { // index can only change if this is a keyed each block - const dependencies = this.key ? this.expression.dependencies : []; + const dependencies = this.key ? this.expression.dependencies : new Set([]); this.scope.add(this.index, dependencies, this); } @@ -92,8 +99,8 @@ export default class EachBlock extends AbstractBlock { if (this.has_animation) { if (this.children.length !== 1) { - const child = this.children.find(child => !!child.animation); - component.error(child.animation, { + const child = this.children.find(child => !!(child as Element).animation); + component.error((child as Element).animation, { code: `invalid-animation`, message: `An element that use the animate directive must be the sole child of a keyed each block` }); diff --git a/src/compile/nodes/Element.ts b/src/compile/nodes/Element.ts index ac2b81b3e7..aa7c14a679 100644 --- a/src/compile/nodes/Element.ts +++ b/src/compile/nodes/Element.ts @@ -15,6 +15,7 @@ import fuzzymatch from '../../utils/fuzzymatch'; import list from '../../utils/list'; import Let from './Let'; import TemplateScope from './shared/TemplateScope'; +import { INode } from './interfaces'; const svg = /^(?:altGlyph|altGlyphDef|altGlyphItem|animate|animateColor|animateMotion|animateTransform|circle|clipPath|color-profile|cursor|defs|desc|discard|ellipse|feBlend|feColorMatrix|feComponentTransfer|feComposite|feConvolveMatrix|feDiffuseLighting|feDisplacementMap|feDistantLight|feDropShadow|feFlood|feFuncA|feFuncB|feFuncG|feFuncR|feGaussianBlur|feImage|feMerge|feMergeNode|feMorphology|feOffset|fePointLight|feSpecularLighting|feSpotLight|feTile|feTurbulence|filter|font|font-face|font-face-format|font-face-name|font-face-src|font-face-uri|foreignObject|g|glyph|glyphRef|hatch|hatchpath|hkern|image|line|linearGradient|marker|mask|mesh|meshgradient|meshpatch|meshrow|metadata|missing-glyph|mpath|path|pattern|polygon|polyline|radialGradient|rect|set|solidcolor|stop|svg|switch|symbol|text|textPath|tref|tspan|unknown|use|view|vkern)$/; @@ -101,7 +102,7 @@ export default class Element extends Node { intro?: Transition = null; outro?: Transition = null; animation?: Animation = null; - children: Node[]; + children: INode[]; namespace: string; constructor(component, parent, scope, info: any) { @@ -136,7 +137,7 @@ export default class Element extends Node { // Special case — treat these the same way: // // - const value_attribute = info.attributes.find((attribute: Node) => attribute.name === 'value'); + const value_attribute = info.attributes.find(attribute => attribute.name === 'value'); if (!value_attribute) { info.attributes.push({ @@ -228,7 +229,7 @@ export default class Element extends Node { let is_figure_parent = false; while (parent) { - if (parent.name === 'figure') { + if ((parent as Element).name === 'figure') { is_figure_parent = true; break; } @@ -249,11 +250,11 @@ export default class Element extends Node { if (this.name === 'figure') { const children = this.children.filter(node => { if (node.type === 'Comment') return false; - if (node.type === 'Text') return /\S/.test(node.data); + if (node.type === 'Text') return /\S/.test((node as Text).data ); return true; }); - const index = children.findIndex(child => child.name === 'figcaption'); + const index = children.findIndex(child => (child as Element).name === 'figcaption'); if (index !== -1 && (index !== 0 && index !== children.length - 1)) { this.component.warn(children[index], { @@ -320,7 +321,9 @@ export default class Element extends Node { } const value = attribute.get_static_value(); + // @ts-ignore if (value && !aria_role_set.has(value)) { + // @ts-ignore const match = fuzzymatch(value, aria_roles); let message = `A11y: Unknown role '${value}'`; if (match) message += ` (did you mean '${match}'?)`; @@ -359,6 +362,7 @@ export default class Element extends Node { // tabindex-no-positive if (name === 'tabindex') { const value = attribute.get_static_value(); + // @ts-ignore todo is tabindex=true correct case? if (!isNaN(value) && +value > 0) { component.warn(attribute, { code: `a11y-positive-tabindex`, @@ -387,7 +391,7 @@ export default class Element extends Node { let ancestor = this.parent; do { if (ancestor.type === 'InlineComponent') break; - if (ancestor.type === 'Element' && /-/.test(ancestor.name)) break; + if (ancestor.type === 'Element' && /-/.test((ancestor as Element).name)) break; if (ancestor.type === 'IfBlock' || ancestor.type === 'EachBlock') { const type = ancestor.type === 'IfBlock' ? 'if' : 'each'; diff --git a/src/compile/nodes/ElseBlock.ts b/src/compile/nodes/ElseBlock.ts index 61c1aa5455..5f3aa29529 100644 --- a/src/compile/nodes/ElseBlock.ts +++ b/src/compile/nodes/ElseBlock.ts @@ -1,10 +1,11 @@ import map_children from './shared/map_children'; import AbstractBlock from './shared/AbstractBlock'; +import Component from '../Component'; export default class ElseBlock extends AbstractBlock { type: 'ElseBlock'; - constructor(component, parent, scope, info) { + constructor(component: Component, parent, scope, info) { super(component, parent, scope, info); this.children = map_children(component, this, scope, info.children); diff --git a/src/compile/nodes/EventHandler.ts b/src/compile/nodes/EventHandler.ts index f5e7e0e898..dab60858d5 100644 --- a/src/compile/nodes/EventHandler.ts +++ b/src/compile/nodes/EventHandler.ts @@ -5,6 +5,7 @@ import deindent from '../utils/deindent'; import Block from '../render-dom/Block'; export default class EventHandler extends Node { + type: 'EventHandler'; name: string; modifiers: Set; expression: Expression; @@ -65,4 +66,4 @@ export default class EventHandler extends Node { // this.component.add_reference(this.handler_name); return `ctx.${this.handler_name}`; } -} \ No newline at end of file +} diff --git a/src/compile/nodes/Fragment.ts b/src/compile/nodes/Fragment.ts index ec25d41a1c..6025b036a6 100644 --- a/src/compile/nodes/Fragment.ts +++ b/src/compile/nodes/Fragment.ts @@ -3,10 +3,12 @@ import Component from '../Component'; import map_children from './shared/map_children'; import Block from '../render-dom/Block'; import TemplateScope from './shared/TemplateScope'; +import { INode } from './interfaces'; export default class Fragment extends Node { + type: 'Fragment'; block: Block; - children: Node[]; + children: INode[]; scope: TemplateScope; constructor(component: Component, info: any) { @@ -16,4 +18,4 @@ export default class Fragment extends Node { this.scope = scope; this.children = map_children(component, this, scope, info.children); } -} \ No newline at end of file +} diff --git a/src/compile/nodes/Head.ts b/src/compile/nodes/Head.ts index bc6e9bde40..2c08dcd595 100644 --- a/src/compile/nodes/Head.ts +++ b/src/compile/nodes/Head.ts @@ -1,5 +1,4 @@ import Node from './shared/Node'; -import Block from '../render-dom/Block'; import map_children from './shared/map_children'; export default class Head extends Node { diff --git a/src/compile/nodes/InlineComponent.ts b/src/compile/nodes/InlineComponent.ts index 3359e981ed..8b6cd77282 100644 --- a/src/compile/nodes/InlineComponent.ts +++ b/src/compile/nodes/InlineComponent.ts @@ -7,6 +7,7 @@ import Expression from './shared/Expression'; import Component from '../Component'; import Let from './Let'; import TemplateScope from './shared/TemplateScope'; +import { INode } from './interfaces'; export default class InlineComponent extends Node { type: 'InlineComponent'; @@ -16,7 +17,7 @@ export default class InlineComponent extends Node { bindings: Binding[] = []; handlers: EventHandler[] = []; lets: Let[] = []; - children: Node[]; + children: INode[]; scope: TemplateScope; constructor(component: Component, parent, scope, info) { diff --git a/src/compile/nodes/MustacheTag.ts b/src/compile/nodes/MustacheTag.ts index e668987a9c..ac6688d503 100644 --- a/src/compile/nodes/MustacheTag.ts +++ b/src/compile/nodes/MustacheTag.ts @@ -1,3 +1,5 @@ import Tag from './shared/Tag'; -export default class MustacheTag extends Tag {} \ No newline at end of file +export default class MustacheTag extends Tag { + type: 'MustacheTag'; +} diff --git a/src/compile/nodes/PendingBlock.ts b/src/compile/nodes/PendingBlock.ts index 0fd71c0221..5ff7352558 100644 --- a/src/compile/nodes/PendingBlock.ts +++ b/src/compile/nodes/PendingBlock.ts @@ -2,7 +2,7 @@ import map_children from './shared/map_children'; import AbstractBlock from './shared/AbstractBlock'; export default class PendingBlock extends AbstractBlock { - + type: 'PendingBlock'; constructor(component, parent, scope, info) { super(component, parent, scope, info); this.children = map_children(component, parent, scope, info.children); diff --git a/src/compile/nodes/RawMustacheTag.ts b/src/compile/nodes/RawMustacheTag.ts index ada3123410..fc63885942 100644 --- a/src/compile/nodes/RawMustacheTag.ts +++ b/src/compile/nodes/RawMustacheTag.ts @@ -1,3 +1,5 @@ import Tag from './shared/Tag'; -export default class RawMustacheTag extends Tag {} \ No newline at end of file +export default class RawMustacheTag extends Tag { + type: 'RawMustacheTag' +} diff --git a/src/compile/nodes/Slot.ts b/src/compile/nodes/Slot.ts index dbb502b41a..a03fe8c026 100644 --- a/src/compile/nodes/Slot.ts +++ b/src/compile/nodes/Slot.ts @@ -1,17 +1,17 @@ -import Node from './shared/Node'; import Element from './Element'; import Attribute from './Attribute'; import Component from '../Component'; import TemplateScope from './shared/TemplateScope'; +import { INode } from './interfaces'; export default class Slot extends Element { type: 'Element'; name: string; - children: Node[]; + children: INode[]; slot_name: string; values: Map = new Map(); - constructor(component: Component, parent: Node, scope: TemplateScope, info: any) { + constructor(component: Component, parent: INode, scope: TemplateScope, info: any) { super(component, parent, scope, info); info.attributes.forEach(attr => { @@ -68,4 +68,4 @@ export default class Slot extends Element { component.slots.set(this.slot_name, this); } -} \ No newline at end of file +} diff --git a/src/compile/nodes/Text.ts b/src/compile/nodes/Text.ts index 1c31c9d83d..a3b9241ce2 100644 --- a/src/compile/nodes/Text.ts +++ b/src/compile/nodes/Text.ts @@ -1,20 +1,22 @@ import Node from './shared/Node'; import Component from '../Component'; import TemplateScope from './shared/TemplateScope'; +import { INode } from './interfaces'; +import Element from './Element'; export default class Text extends Node { type: 'Text'; data: string; use_space = false; - constructor(component: Component, parent: Node, scope: TemplateScope, info: any) { + constructor(component: Component, parent: INode, scope: TemplateScope, info: any) { super(component, parent, scope, info); this.data = info.data; if (!component.component_options.preserveWhitespace && !/\S/.test(info.data)) { let node = parent; while (node) { - if (node.type === 'Element' && node.name === 'pre') { + if (node.type === 'Element' && (node as Element).name === 'pre') { return; } node = node.parent; @@ -23,4 +25,4 @@ export default class Text extends Node { this.use_space = true; } } -} \ No newline at end of file +} diff --git a/src/compile/nodes/ThenBlock.ts b/src/compile/nodes/ThenBlock.ts index 7e4ed0e5da..7f9bbde0f0 100644 --- a/src/compile/nodes/ThenBlock.ts +++ b/src/compile/nodes/ThenBlock.ts @@ -3,6 +3,7 @@ import TemplateScope from './shared/TemplateScope'; import AbstractBlock from './shared/AbstractBlock'; export default class ThenBlock extends AbstractBlock { + type: 'ThenBlock'; scope: TemplateScope; constructor(component, parent, scope, info) { diff --git a/src/compile/nodes/Title.ts b/src/compile/nodes/Title.ts index fd58d3043d..4c459c181f 100644 --- a/src/compile/nodes/Title.ts +++ b/src/compile/nodes/Title.ts @@ -1,12 +1,14 @@ import Node from './shared/Node'; -import map_children from './shared/map_children'; +import map_children, { Children } from './shared/map_children'; +import Component from '../Component'; export default class Title extends Node { type: 'Title'; - children: any[]; // TODO + should_cache: boolean; + children: Children; - constructor(component, parent, scope, info) { + constructor(component: Component, parent, scope, info) { super(component, parent, scope, info); this.children = map_children(component, parent, scope, info.children); @@ -33,4 +35,4 @@ export default class Title extends Node { ) : true; } -} \ No newline at end of file +} diff --git a/src/compile/nodes/interfaces.ts b/src/compile/nodes/interfaces.ts new file mode 100644 index 0000000000..6613d39769 --- /dev/null +++ b/src/compile/nodes/interfaces.ts @@ -0,0 +1,62 @@ +import Tag from './shared/Tag'; + +import Action from './Action'; +import Animation from './Animation'; +import Attribute from './Attribute'; +import AwaitBlock from './AwaitBlock'; +import Binding from './Binding'; +import Body from './Body'; +import CatchBlock from './CatchBlock'; +import Class from './Class'; +import Comment from './Comment'; +import DebugTag from './DebugTag'; +import EachBlock from './EachBlock'; +import Element from './Element'; +import ElseBlock from './ElseBlock'; +import EventHandler from './EventHandler'; +import Fragment from './Fragment'; +import Head from './Head'; +import IfBlock from './IfBlock'; +import InlineComponent from './InlineComponent'; +import Let from './Let'; +import MustacheTag from './MustacheTag'; +import Options from './Options'; +import PendingBlock from './PendingBlock'; +import RawMustacheTag from './RawMustacheTag'; +import Slot from './Slot'; +import Text from './Text'; +import ThenBlock from './ThenBlock'; +import Title from './Title'; +import Transition from './Transition'; +import Window from './Window'; + +export type INode = Action + | Animation + | Attribute + | AwaitBlock + | Binding + | Body + | CatchBlock + | Class + | Comment + | DebugTag + | EachBlock + | Element + | ElseBlock + | EventHandler + | Fragment + | Head + | IfBlock + | InlineComponent + | Let + | MustacheTag + | Options + | PendingBlock + | RawMustacheTag + | Slot + | Tag + | Text + | ThenBlock + | Title + | Transition + | Window; diff --git a/src/compile/nodes/shared/AbstractBlock.ts b/src/compile/nodes/shared/AbstractBlock.ts index 1dfebd51f0..e1104e4928 100644 --- a/src/compile/nodes/shared/AbstractBlock.ts +++ b/src/compile/nodes/shared/AbstractBlock.ts @@ -1,10 +1,11 @@ import Block from '../../render-dom/Block'; import Component from './../../Component'; import Node from './Node'; +import { INode } from '../interfaces'; export default class AbstractBlock extends Node { block: Block; - children: Node[]; + children: INode[]; constructor(component: Component, parent, scope, info: any) { super(component, parent, scope, info); diff --git a/src/compile/nodes/shared/Expression.ts b/src/compile/nodes/shared/Expression.ts index fc188e9673..f7c9582115 100644 --- a/src/compile/nodes/shared/Expression.ts +++ b/src/compile/nodes/shared/Expression.ts @@ -12,6 +12,7 @@ import TemplateScope from './TemplateScope'; import get_object from '../../utils/get_object'; import { nodes_match } from '../../../utils/nodes_match'; import Block from '../../render-dom/Block'; +import { INode } from '../interfaces'; const binary_operators: Record = { '**': 15, @@ -61,10 +62,12 @@ const precedence: Record number> = { SequenceExpression: () => 0 }; +type Owner = Wrapper | INode; + export default class Expression { - type = 'Expression'; + type: 'Expression' = 'Expression'; component: Component; - owner: Wrapper; + owner: Owner; node: any; snippet: string; references: Set; @@ -81,7 +84,8 @@ export default class Expression { rendered: string; - constructor(component: Component, owner: Wrapper, template_scope: TemplateScope, info) { + // todo: owner type + constructor(component: Component, owner: Owner, template_scope: TemplateScope, info) { // TODO revert to direct property access in prod? Object.defineProperties(this, { component: { @@ -92,6 +96,7 @@ export default class Expression { this.node = info; this.template_scope = template_scope; this.owner = owner; + // @ts-ignore this.is_synthetic = owner.is_synthetic; const { dependencies, contextual_dependencies } = this; @@ -510,4 +515,4 @@ function is_contextual(component: Component, scope: TemplateScope, name: string) // assume contextual return true; -} \ No newline at end of file +} diff --git a/src/compile/nodes/shared/Node.ts b/src/compile/nodes/shared/Node.ts index b6eaf9965d..daba0d62b2 100644 --- a/src/compile/nodes/shared/Node.ts +++ b/src/compile/nodes/shared/Node.ts @@ -1,21 +1,23 @@ import Attribute from './../Attribute'; import Component from './../../Component'; +import { INode } from '../interfaces'; +import Text from '../Text'; export default class Node { readonly start: number; readonly end: number; readonly component: Component; - readonly parent: Node; + readonly parent: INode; readonly type: string; - prev?: Node; - next?: Node; + prev?: INode; + next?: INode; can_use_innerhtml: boolean; var: string; attributes: Attribute[]; - constructor(component: Component, parent, scope, info: any) { + constructor(component: Component, parent: any, scope: any, info: { start: number; end: number; type: string; }) { this.start = info.start; this.end = info.end; this.type = info.type; @@ -55,7 +57,7 @@ export default class Node { if (attribute.chunks.length === 0) return ''; if (attribute.chunks.length === 1 && attribute.chunks[0].type === 'Text') { - return attribute.chunks[0].data; + return (attribute.chunks[0] as Text).data; } return null; diff --git a/src/compile/nodes/shared/Tag.ts b/src/compile/nodes/shared/Tag.ts index 94971bef11..bc826458d9 100644 --- a/src/compile/nodes/shared/Tag.ts +++ b/src/compile/nodes/shared/Tag.ts @@ -2,6 +2,7 @@ import Node from './Node'; import Expression from './Expression'; export default class Tag extends Node { + type: 'MustacheTag' | 'RawMustacheTag'; expression: Expression; should_cache: boolean; @@ -14,4 +15,4 @@ export default class Tag extends Node { (this.expression.dependencies.size && scope.names.has(info.expression.name)) ); } -} \ No newline at end of file +} diff --git a/src/compile/nodes/shared/TemplateScope.ts b/src/compile/nodes/shared/TemplateScope.ts index abd366642e..5f30d0c883 100644 --- a/src/compile/nodes/shared/TemplateScope.ts +++ b/src/compile/nodes/shared/TemplateScope.ts @@ -2,6 +2,7 @@ import EachBlock from '../EachBlock'; import ThenBlock from '../ThenBlock'; import CatchBlock from '../CatchBlock'; import InlineComponent from '../InlineComponent'; +import Element from '../Element'; type NodeWithScope = EachBlock | ThenBlock | CatchBlock | InlineComponent | Element; @@ -41,4 +42,4 @@ export default class TemplateScope { const owner = this.get_owner(name); return owner && (owner.type === 'Element' || owner.type === 'InlineComponent'); } -} \ No newline at end of file +} diff --git a/src/compile/nodes/shared/map_children.ts b/src/compile/nodes/shared/map_children.ts index b903853016..71d764a889 100644 --- a/src/compile/nodes/shared/map_children.ts +++ b/src/compile/nodes/shared/map_children.ts @@ -14,9 +14,11 @@ import Slot from '../Slot'; import Text from '../Text'; import Title from '../Title'; import Window from '../Window'; -import Node from './Node'; +import { Node } from '../../../interfaces'; -function get_constructor(type): typeof Node { +export type Children = ReturnType; + +function get_constructor(type) { switch (type) { case 'AwaitBlock': return AwaitBlock; case 'Body': return Body; @@ -38,7 +40,7 @@ function get_constructor(type): typeof Node { } } -export default function map_children(component, parent, scope, children: any[]) { +export default function map_children(component, parent, scope, children: Node[]) { let last = null; return children.map(child => { const constructor = get_constructor(child.type); diff --git a/src/compile/utils/add_to_set.ts b/src/compile/utils/add_to_set.ts index 262d7d32e7..b37e0db931 100644 --- a/src/compile/utils/add_to_set.ts +++ b/src/compile/utils/add_to_set.ts @@ -1,5 +1,6 @@ -export default function add_to_set(a: Set, b: Set) { +export default function add_to_set(a: Set, b: Set | Array) { + // @ts-ignore b.forEach(item => { a.add(item); }); -} \ No newline at end of file +} diff --git a/src/compile/utils/scope.ts b/src/compile/utils/scope.ts index 6488986d83..a3e341be49 100644 --- a/src/compile/utils/scope.ts +++ b/src/compile/utils/scope.ts @@ -9,7 +9,7 @@ export function create_scopes(expression: Node) { let scope = new Scope(null, false); walk(expression, { - enter(node: Node, parent: Node) { + enter(node, parent) { if (node.type === 'ImportDeclaration') { node.specifiers.forEach(specifier => { scope.declarations.set(specifier.local.name, specifier); @@ -25,7 +25,7 @@ export function create_scopes(expression: Node) { if (node.id) scope.declarations.set(node.id.name, node); } - node.params.forEach((param: Node) => { + node.params.forEach((param) => { extract_names(param).forEach(name => { scope.declarations.set(name, node); }); diff --git a/src/compile/utils/stringify_attribute.ts b/src/compile/utils/stringify_attribute.ts index 9df2d18344..ee3450edbb 100644 --- a/src/compile/utils/stringify_attribute.ts +++ b/src/compile/utils/stringify_attribute.ts @@ -1,11 +1,10 @@ import Attribute from '../nodes/Attribute'; -import Node from '../nodes/shared/Node'; import { escape_template, escape } from './stringify'; import { snip } from './snip'; export function stringify_attribute(attribute: Attribute, is_ssr: boolean) { return attribute.chunks - .map((chunk: Node) => { + .map((chunk) => { if (chunk.type === 'Text') { return escape_template(escape(chunk.data).replace(/"/g, '"')); } @@ -15,4 +14,4 @@ export function stringify_attribute(attribute: Attribute, is_ssr: boolean) { : '${' + snip(chunk) + '}'; }) .join(''); -} \ No newline at end of file +} From 231603df7bbf0ff9bb5ecf573ccabaa9211bfea5 Mon Sep 17 00:00:00 2001 From: Bogdan Savluk Date: Tue, 21 May 2019 20:56:01 +0200 Subject: [PATCH 028/409] fix compile/render-ssr typings --- src/compile/render-ssr/Renderer.ts | 7 ++++++- src/compile/render-ssr/handlers/AwaitBlock.ts | 8 ++++---- src/compile/render-ssr/handlers/Comment.ts | 8 ++++---- src/compile/render-ssr/handlers/DebugTag.ts | 9 +++++---- src/compile/render-ssr/handlers/EachBlock.ts | 6 ++++-- src/compile/render-ssr/handlers/Element.ts | 13 +++++++++---- src/compile/render-ssr/handlers/Head.ts | 7 +++++-- src/compile/render-ssr/handlers/HtmlTag.ts | 6 ++++-- src/compile/render-ssr/handlers/IfBlock.ts | 7 ++++--- src/compile/render-ssr/handlers/InlineComponent.ts | 11 +++++++---- src/compile/render-ssr/handlers/Slot.ts | 6 ++++-- src/compile/render-ssr/handlers/Tag.ts | 6 +++--- src/compile/render-ssr/handlers/Text.ts | 9 ++++++--- src/compile/render-ssr/handlers/Title.ts | 7 +++++-- src/compile/render-ssr/index.ts | 8 +++++--- 15 files changed, 75 insertions(+), 43 deletions(-) diff --git a/src/compile/render-ssr/Renderer.ts b/src/compile/render-ssr/Renderer.ts index c97965de14..ef1d16429e 100644 --- a/src/compile/render-ssr/Renderer.ts +++ b/src/compile/render-ssr/Renderer.ts @@ -12,6 +12,7 @@ import Tag from './handlers/Tag'; import Text from './handlers/Text'; import Title from './handlers/Title'; import { AppendTarget, CompileOptions } from '../../interfaces'; +import { INode } from '../nodes/interfaces'; type Handler = (node: any, renderer: Renderer, options: CompileOptions) => void; @@ -36,6 +37,10 @@ const handlers: Record = { Window: noop }; +export interface RenderOptions extends CompileOptions{ + locate: (c: number) => { line: number; column: number; }; +}; + export default class Renderer { has_bindings = false; code = ''; @@ -51,7 +56,7 @@ export default class Renderer { } } - render(nodes, options) { + render(nodes: INode[], options: RenderOptions) { nodes.forEach(node => { const handler = handlers[node.type]; diff --git a/src/compile/render-ssr/handlers/AwaitBlock.ts b/src/compile/render-ssr/handlers/AwaitBlock.ts index bbc4a15e05..85bf7b3135 100644 --- a/src/compile/render-ssr/handlers/AwaitBlock.ts +++ b/src/compile/render-ssr/handlers/AwaitBlock.ts @@ -1,8 +1,8 @@ -import Renderer from '../Renderer'; -import { CompileOptions } from '../../../interfaces'; +import Renderer, { RenderOptions } from '../Renderer'; import { snip } from '../../utils/snip'; +import AwaitBlock from '../../nodes/AwaitBlock'; -export default function(node, renderer: Renderer, options: CompileOptions) { +export default function(node: AwaitBlock, renderer: Renderer, options: RenderOptions) { renderer.append('${(function(__value) { if(@is_promise(__value)) return `'); renderer.render(node.pending.children, options); @@ -13,4 +13,4 @@ export default function(node, renderer: Renderer, options: CompileOptions) { const snippet = snip(node.expression); renderer.append(`\`;}(__value);}(${snippet})) }`); -} \ No newline at end of file +} diff --git a/src/compile/render-ssr/handlers/Comment.ts b/src/compile/render-ssr/handlers/Comment.ts index 4517faace5..237c260230 100644 --- a/src/compile/render-ssr/handlers/Comment.ts +++ b/src/compile/render-ssr/handlers/Comment.ts @@ -1,8 +1,8 @@ -import Renderer from '../Renderer'; -import { CompileOptions } from '../../../interfaces'; +import Renderer, { RenderOptions } from '../Renderer'; +import Comment from '../../nodes/Comment'; -export default function(node, renderer: Renderer, options: CompileOptions) { +export default function(node: Comment, renderer: Renderer, options: RenderOptions) { if (options.preserveComments) { renderer.append(``); } -} \ No newline at end of file +} diff --git a/src/compile/render-ssr/handlers/DebugTag.ts b/src/compile/render-ssr/handlers/DebugTag.ts index b04d541105..3fd7584d57 100644 --- a/src/compile/render-ssr/handlers/DebugTag.ts +++ b/src/compile/render-ssr/handlers/DebugTag.ts @@ -1,9 +1,10 @@ import { stringify } from '../../utils/stringify'; - -export default function(node, renderer, options) { +import DebugTag from '../../nodes/DebugTag'; +import Renderer, { RenderOptions } from '../Renderer'; +export default function(node: DebugTag, renderer: Renderer, options: RenderOptions) { if (!options.dev) return; - const filename = options.file || null; + const filename = options.filename || null; const { line, column } = options.locate(node.start + 1); const obj = node.expressions.length === 0 @@ -15,4 +16,4 @@ export default function(node, renderer, options) { const str = '${@debug(' + `${filename && stringify(filename)}, ${line}, ${column}, ${obj})}`; renderer.append(str); -} \ No newline at end of file +} diff --git a/src/compile/render-ssr/handlers/EachBlock.ts b/src/compile/render-ssr/handlers/EachBlock.ts index 3731093a9b..5ed27dff15 100644 --- a/src/compile/render-ssr/handlers/EachBlock.ts +++ b/src/compile/render-ssr/handlers/EachBlock.ts @@ -1,6 +1,8 @@ import { snip } from '../../utils/snip'; +import Renderer, { RenderOptions } from '../Renderer'; +import EachBlock from '../../nodes/EachBlock'; -export default function(node, renderer, options) { +export default function(node: EachBlock, renderer: Renderer, options: RenderOptions) { const snippet = snip(node.expression); const { start, end } = node.context_node; @@ -24,4 +26,4 @@ export default function(node, renderer, options) { } renderer.append('}'); -} \ No newline at end of file +} diff --git a/src/compile/render-ssr/handlers/Element.ts b/src/compile/render-ssr/handlers/Element.ts index 7717be48e3..fc6bc5b969 100644 --- a/src/compile/render-ssr/handlers/Element.ts +++ b/src/compile/render-ssr/handlers/Element.ts @@ -5,6 +5,9 @@ import Node from '../../nodes/shared/Node'; import { snip } from '../../utils/snip'; import { stringify_attribute } from '../../utils/stringify_attribute'; import { get_slot_scope } from './shared/get_slot_scope'; +import Renderer, { RenderOptions } from '../Renderer'; +import Element from '../../nodes/Element'; +import Text from '../../nodes/Text'; // source: https://gist.github.com/ArjanSchouten/0b8574a6ad7f5065a5e7 const boolean_attributes = new Set([ @@ -47,15 +50,17 @@ const boolean_attributes = new Set([ 'translate' ]); -export default function(node, renderer, options) { +export default function(node: Element, renderer: Renderer, options: RenderOptions & { + slot_scopes: Map; +}) { let opening_tag = `<${node.name}`; let textarea_contents; // awkward special case const slot = node.get_static_attribute_value('slot'); const component = node.find_nearest(/InlineComponent/); if (slot && component) { - const slot = node.attributes.find((attribute: Node) => attribute.name === 'slot'); - const slot_name = slot.chunks[0].data; + const slot = node.attributes.find((attribute) => attribute.name === 'slot'); + const slot_name = (slot.chunks[0] as Text).data; const target = renderer.targets[renderer.targets.length - 1]; target.slot_stack.push(slot_name); target.slots[slot_name] = ''; @@ -160,4 +165,4 @@ export default function(node, renderer, options) { if (!is_void(node.name)) { renderer.append(``); } -} \ No newline at end of file +} diff --git a/src/compile/render-ssr/handlers/Head.ts b/src/compile/render-ssr/handlers/Head.ts index 656759af3c..ecd32cc0ef 100644 --- a/src/compile/render-ssr/handlers/Head.ts +++ b/src/compile/render-ssr/handlers/Head.ts @@ -1,7 +1,10 @@ -export default function(node, renderer, options) { +import Renderer, { RenderOptions } from '../Renderer'; +import Head from '../../nodes/Head'; + +export default function(node: Head, renderer: Renderer, options: RenderOptions) { renderer.append('${($$result.head += `'); renderer.render(node.children, options); renderer.append('`, "")}'); -} \ No newline at end of file +} diff --git a/src/compile/render-ssr/handlers/HtmlTag.ts b/src/compile/render-ssr/handlers/HtmlTag.ts index 7562186a4b..84e2e1f573 100644 --- a/src/compile/render-ssr/handlers/HtmlTag.ts +++ b/src/compile/render-ssr/handlers/HtmlTag.ts @@ -1,5 +1,7 @@ import { snip } from '../../utils/snip'; +import Renderer, { RenderOptions } from '../Renderer'; +import RawMustacheTag from '../../nodes/RawMustacheTag'; -export default function(node, renderer, options) { +export default function(node: RawMustacheTag, renderer: Renderer, options: RenderOptions) { renderer.append('${' + snip(node.expression) + '}'); -} \ No newline at end of file +} diff --git a/src/compile/render-ssr/handlers/IfBlock.ts b/src/compile/render-ssr/handlers/IfBlock.ts index cbe505fef8..c841f1d593 100644 --- a/src/compile/render-ssr/handlers/IfBlock.ts +++ b/src/compile/render-ssr/handlers/IfBlock.ts @@ -1,6 +1,7 @@ import { snip } from '../../utils/snip'; - -export default function(node, renderer, options) { +import IfBlock from '../../nodes/IfBlock'; +import Renderer, { RenderOptions } from '../Renderer'; +export default function(node: IfBlock, renderer: Renderer, options: RenderOptions) { const snippet = snip(node.expression); renderer.append('${ ' + snippet + ' ? `'); @@ -14,4 +15,4 @@ export default function(node, renderer, options) { } renderer.append('` }'); -} \ No newline at end of file +} diff --git a/src/compile/render-ssr/handlers/InlineComponent.ts b/src/compile/render-ssr/handlers/InlineComponent.ts index bc58be5df9..94fdcfd434 100644 --- a/src/compile/render-ssr/handlers/InlineComponent.ts +++ b/src/compile/render-ssr/handlers/InlineComponent.ts @@ -1,14 +1,17 @@ import { escape, escape_template, stringify } from '../../utils/stringify'; import { quote_name_if_necessary } from '../../../utils/names'; import { snip } from '../../utils/snip'; -import Renderer from '../Renderer'; +import Renderer, { RenderOptions } from '../Renderer'; import { stringify_props } from '../../utils/stringify_props'; import { get_slot_scope } from './shared/get_slot_scope'; import { AppendTarget } from '../../../interfaces'; +import InlineComponent from '../../nodes/InlineComponent'; +import { INode } from '../../nodes/interfaces'; +import Text from '../../nodes/Text'; -function stringify_attribute(chunk: Node) { +function stringify_attribute(chunk: INode) { if (chunk.type === 'Text') { - return escape_template(escape(chunk.data)); + return escape_template(escape((chunk as Text).data)); } return '${@escape(' + snip(chunk) + ')}'; @@ -30,7 +33,7 @@ function get_attribute_value(attribute) { return '`' + attribute.chunks.map(stringify_attribute).join('') + '`'; } -export default function(node, renderer: Renderer, options) { +export default function(node: InlineComponent, renderer: Renderer, options: RenderOptions) { const binding_props = []; const binding_fns = []; diff --git a/src/compile/render-ssr/handlers/Slot.ts b/src/compile/render-ssr/handlers/Slot.ts index b2e67f9e79..087519979b 100644 --- a/src/compile/render-ssr/handlers/Slot.ts +++ b/src/compile/render-ssr/handlers/Slot.ts @@ -1,7 +1,9 @@ import { quote_prop_if_necessary } from '../../../utils/names'; import get_slot_data from '../../utils/get_slot_data'; +import Renderer, { RenderOptions } from '../Renderer'; +import Slot from '../../nodes/Slot'; -export default function(node, renderer, options) { +export default function(node: Slot, renderer: Renderer, options: RenderOptions) { const prop = quote_prop_if_necessary(node.slot_name); const slot_data = get_slot_data(node.values, true); @@ -13,4 +15,4 @@ export default function(node, renderer, options) { renderer.render(node.children, options); renderer.append(`\`}`); -} \ No newline at end of file +} diff --git a/src/compile/render-ssr/handlers/Tag.ts b/src/compile/render-ssr/handlers/Tag.ts index eb887b8688..d03f46fe0a 100644 --- a/src/compile/render-ssr/handlers/Tag.ts +++ b/src/compile/render-ssr/handlers/Tag.ts @@ -1,6 +1,6 @@ import { snip } from '../../utils/snip'; - -export default function(node, renderer, options) { +import Renderer, { RenderOptions } from '../Renderer'; +export default function(node, renderer: Renderer, options: RenderOptions) { const snippet = snip(node.expression); renderer.append( @@ -10,4 +10,4 @@ export default function(node, renderer, options) { ? '${' + snippet + '}' : '${@escape(' + snippet + ')}' ); -} \ No newline at end of file +} diff --git a/src/compile/render-ssr/handlers/Text.ts b/src/compile/render-ssr/handlers/Text.ts index e794025370..1d2906d10a 100644 --- a/src/compile/render-ssr/handlers/Text.ts +++ b/src/compile/render-ssr/handlers/Text.ts @@ -1,14 +1,17 @@ import { escape_html, escape_template, escape } from '../../utils/stringify'; +import Renderer, { RenderOptions } from '../Renderer'; +import Text from '../../nodes/Text'; +import Element from '../../nodes/Element'; -export default function(node, renderer, options) { +export default function(node: Text, renderer: Renderer, options: RenderOptions) { let text = node.data; if ( !node.parent || node.parent.type !== 'Element' || - (node.parent.name !== 'script' && node.parent.name !== 'style') + ((node.parent as Element).name !== 'script' && (node.parent as Element).name !== 'style') ) { // unless this Text node is inside a + +
      {foo}
      diff --git a/test/runtime/samples/dev-warning-unknown-props/_config.js b/test/runtime/samples/dev-warning-unknown-props/_config.js new file mode 100644 index 0000000000..31b605e214 --- /dev/null +++ b/test/runtime/samples/dev-warning-unknown-props/_config.js @@ -0,0 +1,9 @@ +export default { + compileOptions: { + dev: true + }, + + warnings: [ + ` was created with unknown attribute 'fo'` + ] +}; diff --git a/test/runtime/samples/dev-warning-unknown-props/main.svelte b/test/runtime/samples/dev-warning-unknown-props/main.svelte new file mode 100644 index 0000000000..1566cf3e41 --- /dev/null +++ b/test/runtime/samples/dev-warning-unknown-props/main.svelte @@ -0,0 +1,5 @@ + + + From c29c389a72fe4fe130d58728c1c95e826ac1ba1d Mon Sep 17 00:00:00 2001 From: Bogdan Savluk Date: Wed, 22 May 2019 05:20:43 +0200 Subject: [PATCH 034/409] convert everything to TypeScript --- .gitignore | 10 +-- index.mjs | 10 --- package.json | 2 +- rollup.config.js | 76 ++++++++----------- animate.mjs => src/animate.ts | 6 +- src/compile/index.ts | 2 +- src/compiler.ts | 6 ++ easing.mjs => src/easing.ts | 2 +- src/index.ts | 16 ++-- src/internal/{Component.js => Component.ts} | 35 +++++++-- src/internal/{animations.js => animations.ts} | 8 +- .../{await-block.js => await-block.ts} | 10 +-- src/internal/{dom.js => dom.ts} | 43 ++++++----- src/internal/index.js | 12 --- src/internal/index.ts | 12 +++ src/internal/{keyed-each.js => keyed-each.ts} | 4 +- src/internal/{lifecycle.js => lifecycle.ts} | 0 src/internal/{loop.js => loop.ts} | 10 ++- src/internal/{scheduler.js => scheduler.ts} | 4 +- src/internal/{spread.js => spread.ts} | 0 src/internal/{ssr.js => ssr.ts} | 6 +- .../{style_manager.js => style_manager.ts} | 6 +- .../{transitions.js => transitions.ts} | 13 ++-- src/internal/{utils.js => utils.ts} | 4 +- src/motion/index.js | 2 - src/motion/index.ts | 2 + src/motion/{spring.js => spring.ts} | 42 ++++++---- src/motion/{tweened.js => tweened.ts} | 4 +- src/motion/{utils.js => utils.ts} | 4 +- src/store.ts | 2 +- transition.mjs => src/transition.ts | 6 +- src/utils/indentation.ts | 2 +- tsconfig.json | 7 +- 33 files changed, 204 insertions(+), 164 deletions(-) delete mode 100644 index.mjs rename animate.mjs => src/animate.ts (86%) create mode 100644 src/compiler.ts rename easing.mjs => src/easing.ts (98%) rename src/internal/{Component.js => Component.ts} (89%) rename src/internal/{animations.js => animations.ts} (92%) rename src/internal/{await-block.js => await-block.ts} (89%) rename src/internal/{dom.js => dom.ts} (80%) delete mode 100644 src/internal/index.js create mode 100644 src/internal/index.ts rename src/internal/{keyed-each.js => keyed-each.ts} (98%) rename src/internal/{lifecycle.js => lifecycle.ts} (100%) rename src/internal/{loop.js => loop.ts} (73%) rename src/internal/{scheduler.js => scheduler.ts} (94%) rename src/internal/{spread.js => spread.ts} (100%) rename src/internal/{ssr.js => ssr.ts} (97%) rename src/internal/{style_manager.js => style_manager.ts} (95%) rename src/internal/{transitions.js => transitions.ts} (95%) rename src/internal/{utils.js => utils.ts} (96%) delete mode 100644 src/motion/index.js create mode 100644 src/motion/index.ts rename src/motion/{spring.js => spring.ts} (73%) rename src/motion/{tweened.js => tweened.ts} (98%) rename src/motion/{utils.js => utils.ts} (63%) rename transition.mjs => src/transition.ts (97%) diff --git a/.gitignore b/.gitignore index 3d1322c33e..b50d83fd2e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,14 +4,14 @@ node_modules *.map /src/compile/internal-exports.ts -/compiler.js -/index.js +/compiler.* +/index.* /internal.* /store.* -/easing.js +/easing.* /motion.* -/transition.js -/animate.js +/transition.* +/animate.* /scratch/ /coverage/ /coverage.lcov/ diff --git a/index.mjs b/index.mjs deleted file mode 100644 index ee5b575171..0000000000 --- a/index.mjs +++ /dev/null @@ -1,10 +0,0 @@ -export { - onMount, - onDestroy, - beforeUpdate, - afterUpdate, - setContext, - getContext, - tick, - createEventDispatcher -} from './internal'; diff --git a/package.json b/package.json index b32e19786f..8665648abb 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "prepare": "npm run build && npm run tsd", "dev": "rollup -cw", "pretest": "npm run build", - "posttest": "agadoo src/internal/index.js", + "posttest": "agadoo internal.mjs", "prepublishOnly": "export PUBLISH=true && npm run lint && npm test", "tsd": "tsc -d src/store.ts --outDir .", "typecheck": "tsc --noEmit" diff --git a/rollup.config.js b/rollup.config.js index 0d19e59d4a..9fd49f3e8f 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -9,10 +9,19 @@ import pkg from './package.json'; const is_publish = !!process.env.PUBLISH; +const tsPlugin = is_publish + ? typescript({ + include: 'src/**', + typescript: require('typescript') + }) + : sucrase({ + transforms: ['typescript'] + }); + export default [ /* internal.[m]js */ { - input: `src/internal/index.js`, + input: `src/internal/index.ts`, output: [ { file: `internal.mjs`, @@ -26,19 +35,22 @@ export default [ } ], external: id => id.startsWith('svelte/'), - plugins: [{ - generateBundle(options, bundle) { - const mod = bundle['internal.mjs']; - if (mod) { - fs.writeFileSync('src/compile/internal-exports.ts', `// This file is automatically generated\nexport default new Set(${JSON.stringify(mod.exports)});`); + + plugins: [ + tsPlugin, + { + generateBundle(options, bundle) { + const mod = bundle['internal.mjs']; + if (mod) { + fs.writeFileSync('src/compile/internal-exports.ts', `// This file is automatically generated\nexport default new Set(${JSON.stringify(mod.exports)});`); + } } - } - }] + }] }, /* compiler.js */ { - input: 'src/index.ts', + input: 'src/compiler.ts', plugins: [ replace({ __VERSION__: pkg.version @@ -48,15 +60,7 @@ export default [ include: ['node_modules/**'] }), json(), - is_publish - ? typescript({ - include: 'src/**', - exclude: 'src/internal/**', - typescript: require('typescript') - }) - : sucrase({ - transforms: ['typescript'] - }) + tsPlugin ], output: { file: 'compiler.js', @@ -71,7 +75,7 @@ export default [ /* motion.mjs */ { - input: `src/motion/index.js`, + input: `src/motion/index.ts`, output: [ { file: `motion.mjs`, @@ -84,46 +88,30 @@ export default [ paths: id => id.startsWith('svelte/') && id.replace('svelte', '.') } ], + plugins: [ + tsPlugin + ], external: id => id.startsWith('svelte/') }, - /* store.mjs */ - { - input: `src/store.ts`, + // everything else + ...['index', 'easing', 'transition', 'animate', 'store'].map(name => ({ + input: `src/${name}.ts`, output: [ { - file: `store.mjs`, + file: `${name}.mjs`, format: 'esm', paths: id => id.startsWith('svelte/') && id.replace('svelte', '.') }, { - file: `store.js`, + file: `${name}.js`, format: 'cjs', paths: id => id.startsWith('svelte/') && id.replace('svelte', '.') } ], plugins: [ - is_publish - ? typescript({ - include: 'src/**', - exclude: 'src/internal/**', - typescript: require('typescript') - }) - : sucrase({ - transforms: ['typescript'] - }) + tsPlugin ], external: id => id.startsWith('svelte/') - }, - - // everything else - ...['index', 'easing', 'transition', 'animate'].map(name => ({ - input: `${name}.mjs`, - output: { - file: `${name}.js`, - format: 'cjs', - paths: id => id.startsWith('svelte/') && id.replace('svelte', '.') - }, - external: id => id !== `${name}.mjs` })) ]; diff --git a/animate.mjs b/src/animate.ts similarity index 86% rename from animate.mjs rename to src/animate.ts index f22fabe401..cf64cd060a 100644 --- a/animate.mjs +++ b/src/animate.ts @@ -1,5 +1,5 @@ -import { cubicOut } from './easing'; -import { is_function } from './internal'; +import { cubicOut } from 'svelte/easing'; +import { is_function } from 'svelte/internal'; export function flip(node, animation, params) { const style = getComputedStyle(node); @@ -22,4 +22,4 @@ export function flip(node, animation, params) { easing, css: (t, u) => `transform: ${transform} translate(${u * dx}px, ${u * dy}px);` }; -} \ No newline at end of file +} diff --git a/src/compile/index.ts b/src/compile/index.ts index 526d8abaeb..dac75f23e0 100644 --- a/src/compile/index.ts +++ b/src/compile/index.ts @@ -1,4 +1,4 @@ -import { assign } from '../internal'; +import { assign } from '../internal/index'; import Stats from '../Stats'; import parse from '../parse/index'; import render_dom from './render-dom/index'; diff --git a/src/compiler.ts b/src/compiler.ts new file mode 100644 index 0000000000..4987c18a15 --- /dev/null +++ b/src/compiler.ts @@ -0,0 +1,6 @@ +export { default as compile } from './compile/index'; +export { default as parse } from './parse/index'; +export { default as preprocess } from './preprocess/index'; +export { walk } from 'estree-walker'; + +export const VERSION = '__VERSION__'; \ No newline at end of file diff --git a/easing.mjs b/src/easing.ts similarity index 98% rename from easing.mjs rename to src/easing.ts index 4fc625c24f..7a762394c2 100644 --- a/easing.mjs +++ b/src/easing.ts @@ -3,7 +3,7 @@ Adapted from https://github.com/mattdesl Distributed under MIT License https://github.com/mattdesl/eases/blob/master/LICENSE.md */ -export { identity as linear } from './internal'; +export { identity as linear } from 'svelte/internal'; export function backInOut(t) { const s = 1.70158 * 1.525; diff --git a/src/index.ts b/src/index.ts index 4987c18a15..40928da8a0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,10 @@ -export { default as compile } from './compile/index'; -export { default as parse } from './parse/index'; -export { default as preprocess } from './preprocess/index'; -export { walk } from 'estree-walker'; - -export const VERSION = '__VERSION__'; \ No newline at end of file +export { + onMount, + onDestroy, + beforeUpdate, + afterUpdate, + setContext, + getContext, + tick, + createEventDispatcher +} from 'svelte/internal'; diff --git a/src/internal/Component.js b/src/internal/Component.ts similarity index 89% rename from src/internal/Component.js rename to src/internal/Component.ts index 871dbd6054..714d15df34 100644 --- a/src/internal/Component.js +++ b/src/internal/Component.ts @@ -1,7 +1,23 @@ -import { add_render_callback, flush, schedule_update, dirty_components } from './scheduler.js'; -import { current_component, set_current_component } from './lifecycle.js'; -import { blank_object, is_function, run, run_all, noop } from './utils.js'; -import { children } from './dom.js'; +import { add_render_callback, flush, schedule_update, dirty_components } from './scheduler'; +import { current_component, set_current_component } from './lifecycle'; +import { blank_object, is_function, run, run_all, noop } from './utils'; +import { children } from './dom'; + +interface T$$ { + dirty: null; + ctx: null|any; + bound: any; + update: () => void; + callbacks: any; + after_render: any[]; + props: any; + fragment: null|any; + not_equal: any; + before_render: any[]; + context: Map; + on_mount: any[]; + on_destroy: any[] +} export function bind(component, name, callback) { if (component.$$.props.indexOf(name) === -1) return; @@ -59,7 +75,7 @@ export function init(component, options, instance, create_fragment, not_equal, p const props = options.props || {}; - const $$ = component.$$ = { + const $$: T$$ = component.$$ = { fragment: null, ctx: null, @@ -99,9 +115,9 @@ export function init(component, options, instance, create_fragment, not_equal, p if (options.target) { if (options.hydrate) { - $$.fragment.l(children(options.target)); + $$.fragment!.l(children(options.target)); } else { - $$.fragment.c(); + $$.fragment!.c(); } if (options.intro && component.$$.fragment.i) component.$$.fragment.i(); @@ -115,13 +131,16 @@ export function init(component, options, instance, create_fragment, not_equal, p export let SvelteElement; if (typeof HTMLElement !== 'undefined') { SvelteElement = class extends HTMLElement { + $$: T$$; constructor() { super(); this.attachShadow({ mode: 'open' }); } connectedCallback() { + // @ts-ignore todo: improve typings for (const key in this.$$.slotted) { + // @ts-ignore todo: improve typings this.appendChild(this.$$.slotted[key]); } } @@ -153,6 +172,8 @@ if (typeof HTMLElement !== 'undefined') { } export class SvelteComponent { + $$: T$$; + $destroy() { destroy(this, true); this.$destroy = noop; diff --git a/src/internal/animations.js b/src/internal/animations.ts similarity index 92% rename from src/internal/animations.js rename to src/internal/animations.ts index 8d55c196ee..b6c7ae2df2 100644 --- a/src/internal/animations.js +++ b/src/internal/animations.ts @@ -1,6 +1,6 @@ -import { identity as linear, noop, now } from './utils.js'; -import { loop } from './loop.js'; -import { create_rule, delete_rule } from './style_manager.js'; +import { identity as linear, noop, now } from './utils'; +import { loop } from './loop'; +import { create_rule, delete_rule } from './style_manager'; export function create_animation(node, from, fn, params) { if (!from) return noop; @@ -90,4 +90,4 @@ export function fix_position(node) { node.style.transform = `${transform} translate(${a.left - b.left}px, ${a.top - b.top}px)`; } } -} \ No newline at end of file +} diff --git a/src/internal/await-block.js b/src/internal/await-block.ts similarity index 89% rename from src/internal/await-block.js rename to src/internal/await-block.ts index 9e14c50342..9527b000ca 100644 --- a/src/internal/await-block.js +++ b/src/internal/await-block.ts @@ -1,11 +1,11 @@ -import { assign, is_promise } from './utils.js'; -import { check_outros, group_outros, on_outro } from './transitions.js'; -import { flush } from '../internal/scheduler.js'; +import { assign, is_promise } from './utils'; +import { check_outros, group_outros, on_outro } from './transitions'; +import { flush } from '../internal/scheduler'; export function handle_promise(promise, info) { const token = info.token = {}; - function update(type, index, key, value) { + function update(type, index, key?, value?) { if (info.token !== token) return; info.resolved = key && { [key]: value }; @@ -61,4 +61,4 @@ export function handle_promise(promise, info) { info.resolved = { [info.value]: promise }; } -} \ No newline at end of file +} diff --git a/src/internal/dom.js b/src/internal/dom.ts similarity index 80% rename from src/internal/dom.js rename to src/internal/dom.ts index 46ffaa8472..293040ce20 100644 --- a/src/internal/dom.js +++ b/src/internal/dom.ts @@ -1,28 +1,28 @@ -export function append(target, node) { +export function append(target:Node, node:Node) { target.appendChild(node); } -export function insert(target, node, anchor) { +export function insert(target: Node, node: Node, anchor?:Node) { target.insertBefore(node, anchor || null); } -export function detach(node) { +export function detach(node: Node) { node.parentNode.removeChild(node); } -export function detach_between(before, after) { +export function detach_between(before: Node, after: Node) { while (before.nextSibling && before.nextSibling !== after) { before.parentNode.removeChild(before.nextSibling); } } -export function detach_before(after) { +export function detach_before(after:Node) { while (after.previousSibling) { after.parentNode.removeChild(after.previousSibling); } } -export function detach_after(before) { +export function detach_after(before:Node) { while (before.nextSibling) { before.parentNode.removeChild(before.nextSibling); } @@ -34,25 +34,30 @@ export function destroy_each(iterations, detaching) { } } -export function element(name) { - return document.createElement(name); +export function element(name: K) { + return document.createElement(name); } -export function object_without_properties(obj, exclude) { - const target = {}; +export function object_without_properties(obj:T, exclude: K[]) { + const target = {} as Pick>; for (const k in obj) { - if (Object.prototype.hasOwnProperty.call(obj, k) && exclude.indexOf(k) === -1) { + if ( + Object.prototype.hasOwnProperty.call(obj, k) + // @ts-ignore + && exclude.indexOf(k) === -1 + ) { + // @ts-ignore target[k] = obj[k]; } } return target; } -export function svg_element(name) { +export function svg_element(name:string):SVGElement { return document.createElementNS('http://www.w3.org/2000/svg', name); } -export function text(data) { +export function text(data:string) { return document.createTextNode(data); } @@ -64,7 +69,7 @@ export function empty() { return text(''); } -export function listen(node, event, handler, options) { +export function listen(node: Node, event: string, handler: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | EventListenerOptions) { node.addEventListener(event, handler, options); return () => node.removeEventListener(event, handler, options); } @@ -72,6 +77,7 @@ export function listen(node, event, handler, options) { export function prevent_default(fn) { return function(event) { event.preventDefault(); + // @ts-ignore return fn.call(this, event); }; } @@ -79,16 +85,17 @@ export function prevent_default(fn) { export function stop_propagation(fn) { return function(event) { event.stopPropagation(); + // @ts-ignore return fn.call(this, event); }; } -export function attr(node, attribute, value) { +export function attr(node: Element, attribute: string, value?: string) { if (value == null) node.removeAttribute(attribute); else node.setAttribute(attribute, value); } -export function set_attributes(node, attributes) { +export function set_attributes(node: HTMLElement, attributes: { [x: string]: string; }) { for (const key in attributes) { if (key === 'style') { node.style.cssText = attributes[key]; @@ -243,8 +250,8 @@ export function toggle_class(element, name, toggle) { element.classList[toggle ? 'add' : 'remove'](name); } -export function custom_event(type, detail) { - const e = document.createEvent('CustomEvent'); +export function custom_event(type: string, detail?: T) { + const e: CustomEvent = document.createEvent('CustomEvent'); e.initCustomEvent(type, false, false, detail); return e; } diff --git a/src/internal/index.js b/src/internal/index.js deleted file mode 100644 index f3654f6b77..0000000000 --- a/src/internal/index.js +++ /dev/null @@ -1,12 +0,0 @@ -export * from './animations.js'; -export * from './await-block.js'; -export * from './dom.js'; -export * from './keyed-each.js'; -export * from './lifecycle.js'; -export * from './loop.js'; -export * from './scheduler.js'; -export * from './spread.js'; -export * from './ssr.js'; -export * from './transitions.js'; -export * from './utils.js'; -export * from './Component.js'; \ No newline at end of file diff --git a/src/internal/index.ts b/src/internal/index.ts new file mode 100644 index 0000000000..6487f04525 --- /dev/null +++ b/src/internal/index.ts @@ -0,0 +1,12 @@ +export * from './animations'; +export * from './await-block'; +export * from './dom'; +export * from './keyed-each'; +export * from './lifecycle'; +export * from './loop'; +export * from './scheduler'; +export * from './spread'; +export * from './ssr'; +export * from './transitions'; +export * from './utils'; +export * from './Component'; diff --git a/src/internal/keyed-each.js b/src/internal/keyed-each.ts similarity index 98% rename from src/internal/keyed-each.js rename to src/internal/keyed-each.ts index c40a1cc00b..0ec8b09400 100644 --- a/src/internal/keyed-each.js +++ b/src/internal/keyed-each.ts @@ -1,4 +1,4 @@ -import { on_outro } from './transitions.js'; +import { on_outro } from './transitions'; export function destroy_block(block, lookup) { block.d(1); @@ -110,4 +110,4 @@ export function measure(blocks) { let i = blocks.length; while (i--) rects[blocks[i].key] = blocks[i].node.getBoundingClientRect(); return rects; -} \ No newline at end of file +} diff --git a/src/internal/lifecycle.js b/src/internal/lifecycle.ts similarity index 100% rename from src/internal/lifecycle.js rename to src/internal/lifecycle.ts diff --git a/src/internal/loop.js b/src/internal/loop.ts similarity index 73% rename from src/internal/loop.js rename to src/internal/loop.ts index 8150727441..b6cd53a189 100644 --- a/src/internal/loop.js +++ b/src/internal/loop.ts @@ -1,4 +1,6 @@ -import { now } from './utils.js'; +import { now } from './utils'; + +export interface Task { abort(): void; promise: Promise } const tasks = new Set(); let running = false; @@ -21,7 +23,7 @@ export function clear_loops() { running = false; } -export function loop(fn) { +export function loop(fn: (number)=>void): Task { let task; if (!running) { @@ -30,11 +32,11 @@ export function loop(fn) { } return { - promise: new Promise(fulfil => { + promise: new Promise(fulfil => { tasks.add(task = [fn, fulfil]); }), abort() { tasks.delete(task); } }; -} \ No newline at end of file +} diff --git a/src/internal/scheduler.js b/src/internal/scheduler.ts similarity index 94% rename from src/internal/scheduler.js rename to src/internal/scheduler.ts index 749c3971dc..a26a4f8c33 100644 --- a/src/internal/scheduler.js +++ b/src/internal/scheduler.ts @@ -1,5 +1,5 @@ -import { run_all } from './utils.js'; -import { set_current_component } from './lifecycle.js'; +import { run_all } from './utils'; +import { set_current_component } from './lifecycle'; export const dirty_components = []; export const intros = { enabled: false }; diff --git a/src/internal/spread.js b/src/internal/spread.ts similarity index 100% rename from src/internal/spread.js rename to src/internal/spread.ts diff --git a/src/internal/ssr.js b/src/internal/ssr.ts similarity index 97% rename from src/internal/ssr.js rename to src/internal/ssr.ts index e8d96c609c..aaa391b4dc 100644 --- a/src/internal/ssr.js +++ b/src/internal/ssr.ts @@ -1,5 +1,5 @@ -import { set_current_component, current_component } from './lifecycle.js'; -import { run_all, blank_object } from './utils.js'; +import { set_current_component, current_component } from './lifecycle'; +import { run_all, blank_object } from './utils'; export const invalid_attribute_name_character = /[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u; // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 @@ -117,4 +117,4 @@ export function get_store_value(store) { let value; store.subscribe(_ => value = _)(); return value; -} \ No newline at end of file +} diff --git a/src/internal/style_manager.js b/src/internal/style_manager.ts similarity index 95% rename from src/internal/style_manager.js rename to src/internal/style_manager.ts index d71e922f01..8e4d35ca38 100644 --- a/src/internal/style_manager.js +++ b/src/internal/style_manager.ts @@ -1,4 +1,4 @@ -import { element } from './dom.js'; +import { element } from './dom'; let stylesheet; let active = 0; @@ -43,7 +43,7 @@ export function create_rule(node, a, b, duration, delay, ease, fn, uid = 0) { return name; } -export function delete_rule(node, name) { +export function delete_rule(node, name?) { node.style.animation = (node.style.animation || '') .split(', ') .filter(name @@ -62,4 +62,4 @@ export function clear_rules() { while (i--) stylesheet.deleteRule(i); current_rules = {}; }); -} \ No newline at end of file +} diff --git a/src/internal/transitions.js b/src/internal/transitions.ts similarity index 95% rename from src/internal/transitions.js rename to src/internal/transitions.ts index af15e8969e..04942e3d16 100644 --- a/src/internal/transitions.js +++ b/src/internal/transitions.ts @@ -1,8 +1,8 @@ -import { identity as linear, noop, now, run_all } from './utils.js'; -import { loop } from './loop.js'; -import { create_rule, delete_rule } from './style_manager.js'; -import { custom_event } from './dom.js'; -import { add_render_callback } from './scheduler.js'; +import { identity as linear, noop, now, run_all } from './utils'; +import { loop } from './loop'; +import { create_rule, delete_rule } from './style_manager'; +import { custom_event } from './dom'; +import { add_render_callback } from './scheduler'; let promise; @@ -229,6 +229,7 @@ export function create_bidirectional_transition(node, fn, params, intro) { }; if (!b) { + // @ts-ignore todo: improve typings program.group = outros; outros.remaining += 1; } @@ -309,4 +310,4 @@ export function create_bidirectional_transition(node, fn, params, intro) { running_program = pending_program = null; } }; -} \ No newline at end of file +} diff --git a/src/internal/utils.js b/src/internal/utils.ts similarity index 96% rename from src/internal/utils.js rename to src/internal/utils.ts index e6d66d8717..8bb40ac071 100644 --- a/src/internal/utils.js +++ b/src/internal/utils.ts @@ -80,11 +80,11 @@ export function exclude_internal_props(props) { return result; } -export let now = typeof window !== 'undefined' +export let now: () => number = typeof window !== 'undefined' ? () => window.performance.now() : () => Date.now(); // used internally for testing export function set_now(fn) { now = fn; -} \ No newline at end of file +} diff --git a/src/motion/index.js b/src/motion/index.js deleted file mode 100644 index e0e9bcf1ae..0000000000 --- a/src/motion/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export * from './spring.js'; -export * from './tweened.js'; \ No newline at end of file diff --git a/src/motion/index.ts b/src/motion/index.ts new file mode 100644 index 0000000000..ea6c646dd9 --- /dev/null +++ b/src/motion/index.ts @@ -0,0 +1,2 @@ +export * from './spring'; +export * from './tweened'; diff --git a/src/motion/spring.js b/src/motion/spring.ts similarity index 73% rename from src/motion/spring.js rename to src/motion/spring.ts index 8b280366b2..3977c08f79 100644 --- a/src/motion/spring.js +++ b/src/motion/spring.ts @@ -1,6 +1,6 @@ -import { writable } from 'svelte/store'; // eslint-disable-line import/no-unresolved -import { loop, now } from 'svelte/internal'; // eslint-disable-line import/no-unresolved -import { is_date } from './utils.js'; +import { Readable, writable } from 'svelte/store'; +import { loop, now, Task } from 'svelte/internal'; +import { is_date } from './utils'; function tick_spring(ctx, last_value, current_value, target_value) { if (typeof current_value === 'number' || is_date(current_value)) { @@ -27,25 +27,41 @@ function tick_spring(ctx, last_value, current_value, target_value) { next_value[k] = tick_spring(ctx, last_value[k], current_value[k], target_value[k]); return next_value; } else { - throw new Error(`Cannot spring ${typeof value} values`); + throw new Error(`Cannot spring ${typeof current_value} values`); } } -export function spring(value, opts = {}) { +interface SpringOpts { + stiffness?: number, + damping?: number, + precision?: number, +} + +type SpringUpdateOpts = { hard?: any; soft?: string | number | boolean; }; + +interface Spring extends Readable{ + set: (new_value: T, opts?: SpringUpdateOpts) => (Promise | Promise); + precision: number; + update: (fn, opts: SpringUpdateOpts) => Promise; + damping: number; + stiffness: number +} + +export function spring(value: T, opts: SpringOpts = {}) { const store = writable(value); const { stiffness = 0.15, damping = 0.8, precision = 0.01 } = opts; - let last_time; - let task; - let current_token; - let last_value = value; - let target_value = value; + let last_time: number; + let task: Task; + let current_token: object; + let last_value:T = value; + let target_value:T = value; let inv_mass = 1; let inv_mass_recovery_rate = 0; let cancel_task = false; - function set(new_value, opts = {}) { + function set(new_value: any, opts: SpringUpdateOpts={}) { target_value = new_value; const token = current_token = {}; @@ -100,9 +116,9 @@ export function spring(value, opts = {}) { }); } - const spring = { + const spring: Spring = { set, - update: (fn, opts) => set(fn(target_value, value), opts), + update: (fn, opts:SpringUpdateOpts) => set(fn(target_value, value), opts), subscribe: store.subscribe, stiffness, damping, diff --git a/src/motion/tweened.js b/src/motion/tweened.ts similarity index 98% rename from src/motion/tweened.js rename to src/motion/tweened.ts index 45520832b7..3b2d0ef5a2 100644 --- a/src/motion/tweened.js +++ b/src/motion/tweened.ts @@ -1,7 +1,7 @@ import { writable } from 'svelte/store'; // eslint-disable-line import/no-unresolved import { assign, loop, now } from 'svelte/internal'; // eslint-disable-line import/no-unresolved import { linear } from 'svelte/easing'; // eslint-disable-line import/no-unresolved -import { is_date } from './utils.js'; +import { is_date } from './utils'; function get_interpolator(a, b) { if (a === b || a !== a) return () => a; @@ -109,4 +109,4 @@ export function tweened(value, defaults = {}) { update: (fn, opts) => set(fn(target_value, value), opts), subscribe: store.subscribe }; -} \ No newline at end of file +} diff --git a/src/motion/utils.js b/src/motion/utils.ts similarity index 63% rename from src/motion/utils.js rename to src/motion/utils.ts index 97a764bf46..f8bfcce14c 100644 --- a/src/motion/utils.js +++ b/src/motion/utils.ts @@ -1,3 +1,3 @@ -export function is_date(obj) { +export function is_date(obj: any) { return Object.prototype.toString.call(obj) === '[object Date]'; -} \ No newline at end of file +} diff --git a/src/store.ts b/src/store.ts index b0ee41fc8d..361632b61d 100644 --- a/src/store.ts +++ b/src/store.ts @@ -1,4 +1,4 @@ -import { run_all, noop, safe_not_equal, is_function } from './internal/utils'; +import { run_all, noop, safe_not_equal, is_function } from 'svelte/internal'; /** Callback to inform of a value updates. */ type Subscriber = (value: T) => void; diff --git a/transition.mjs b/src/transition.ts similarity index 97% rename from transition.mjs rename to src/transition.ts index 857fd03165..20619ee131 100644 --- a/transition.mjs +++ b/src/transition.ts @@ -1,5 +1,5 @@ -import { cubicOut, cubicInOut } from './easing'; -import { assign, is_function } from './internal'; +import { cubicOut, cubicInOut } from 'svelte/easing'; +import { assign, is_function } from 'svelte/internal'; export function fade(node, { delay = 0, @@ -179,4 +179,4 @@ export function crossfade({ fallback, ...defaults }) { transition(to_send, to_receive, false), transition(to_receive, to_send, true) ]; -} \ No newline at end of file +} diff --git a/src/utils/indentation.ts b/src/utils/indentation.ts index 765a62bfbf..54ededc37d 100644 --- a/src/utils/indentation.ts +++ b/src/utils/indentation.ts @@ -54,4 +54,4 @@ export function add_indentation(code: MagicString, node: Node, levels = 1) { code.appendLeft(index + 1, indent); } -} \ No newline at end of file +} diff --git a/tsconfig.json b/tsconfig.json index fdb7367e05..acbca11ac7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,12 +7,17 @@ "allowJs": true, "lib": ["es5", "es6", "dom"], "importHelpers": true, - "moduleResolution": "node" + "moduleResolution": "node", + "baseUrl": ".", + "paths": { + "svelte/*": ["./src/*"] + } }, "include": [ "src" ], "exclude": [ + "./*.*js", "node_modules" ] } From d5d5caba600b9bbc1b0e0e2000a0a3c34d1ed303 Mon Sep 17 00:00:00 2001 From: Bogdan Savluk Date: Wed, 22 May 2019 07:31:39 +0200 Subject: [PATCH 035/409] type declarations for bundled files --- .gitignore | 17 ++++++++-------- animate.d.ts | 1 + compiler.d.ts | 1 + easing.d.ts | 1 + index.d.ts | 1 + internal.d.ts | 1 + motion.d.ts | 1 + package.json | 4 ++-- store.d.ts | 1 + transition.d.ts | 1 + tsconfig.json | 53 +++++++++++++++++++++++++++++-------------------- 11 files changed, 51 insertions(+), 31 deletions(-) create mode 100644 animate.d.ts create mode 100644 compiler.d.ts create mode 100644 easing.d.ts create mode 100644 index.d.ts create mode 100644 internal.d.ts create mode 100644 motion.d.ts create mode 100644 store.d.ts create mode 100644 transition.d.ts diff --git a/.gitignore b/.gitignore index b50d83fd2e..35888493fa 100644 --- a/.gitignore +++ b/.gitignore @@ -4,14 +4,14 @@ node_modules *.map /src/compile/internal-exports.ts -/compiler.* -/index.* -/internal.* -/store.* -/easing.* -/motion.* -/transition.* -/animate.* +/compiler.*js +/index.*js +/internal.*js +/store.*js +/easing.*js +/motion.*js +/transition.*js +/animate.*js /scratch/ /coverage/ /coverage.lcov/ @@ -21,6 +21,7 @@ node_modules /test/sourcemaps/samples/*/output.css.map /yarn-error.log _actual*.* +/dist /site/cypress/screenshots/ /site/__sapper__/ diff --git a/animate.d.ts b/animate.d.ts new file mode 100644 index 0000000000..3284bfd8c0 --- /dev/null +++ b/animate.d.ts @@ -0,0 +1 @@ +export * from './dist/animate'; diff --git a/compiler.d.ts b/compiler.d.ts new file mode 100644 index 0000000000..977efefb6d --- /dev/null +++ b/compiler.d.ts @@ -0,0 +1 @@ +export * from './dist/compiler'; diff --git a/easing.d.ts b/easing.d.ts new file mode 100644 index 0000000000..c07764f4f0 --- /dev/null +++ b/easing.d.ts @@ -0,0 +1 @@ +export * from './dist/easing'; diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000000..e4ddc9027e --- /dev/null +++ b/index.d.ts @@ -0,0 +1 @@ +export * from './dist/index'; diff --git a/internal.d.ts b/internal.d.ts new file mode 100644 index 0000000000..be034cd88a --- /dev/null +++ b/internal.d.ts @@ -0,0 +1 @@ +export * from './dist/internal'; diff --git a/motion.d.ts b/motion.d.ts new file mode 100644 index 0000000000..2fdaa86c4e --- /dev/null +++ b/motion.d.ts @@ -0,0 +1 @@ +export * from './dist/motion'; diff --git a/package.json b/package.json index 8665648abb..7963e2178d 100644 --- a/package.json +++ b/package.json @@ -32,8 +32,8 @@ "pretest": "npm run build", "posttest": "agadoo internal.mjs", "prepublishOnly": "export PUBLISH=true && npm run lint && npm test", - "tsd": "tsc -d src/store.ts --outDir .", - "typecheck": "tsc --noEmit" + "tsd": "tsc -p . --emitDeclarationOnly", + "typecheck": "tsc -p . --noEmit" }, "repository": { "type": "git", diff --git a/store.d.ts b/store.d.ts new file mode 100644 index 0000000000..2c1307011b --- /dev/null +++ b/store.d.ts @@ -0,0 +1 @@ +export * from './dist/store'; diff --git a/transition.d.ts b/transition.d.ts new file mode 100644 index 0000000000..54d5f036da --- /dev/null +++ b/transition.d.ts @@ -0,0 +1 @@ +export * from './dist/transition'; diff --git a/tsconfig.json b/tsconfig.json index acbca11ac7..ff11591679 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,23 +1,34 @@ { - "compilerOptions": { - "target": "ES6", - "diagnostics": true, - "noImplicitThis": true, - "noEmitOnError": true, - "allowJs": true, - "lib": ["es5", "es6", "dom"], - "importHelpers": true, - "moduleResolution": "node", - "baseUrl": ".", - "paths": { - "svelte/*": ["./src/*"] - } - }, - "include": [ - "src" - ], - "exclude": [ - "./*.*js", - "node_modules" - ] + "compilerOptions": { + "target": "es2015", + "module": "es6", + "declarationDir": "./dist", + "outDir": "./dist", + "declaration": true, + "noImplicitThis": true, + "noEmitOnError": true, + "lib": [ + "es5", + "es6", + "dom", + "es2015" + ], + "importHelpers": true, + "moduleResolution": "node", + "baseUrl": ".", + "paths": { + "svelte/*": [ + "./src/*" + ] + }, + "typeRoots": [ + "node_modules/@types" + ] + }, + "include": [ + "src/**/*" + ], + "exclude": [ + "dist" + ] } From 33f827ca0a6f1a82f9123c0d3e6655482a687ec8 Mon Sep 17 00:00:00 2001 From: Bogdan Savluk Date: Wed, 22 May 2019 08:06:47 +0200 Subject: [PATCH 036/409] fix case sensitive import name, improve tsconfig --- src/compile/render-dom/wrappers/RawMustacheTag.ts | 2 +- tsconfig.json | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/compile/render-dom/wrappers/RawMustacheTag.ts b/src/compile/render-dom/wrappers/RawMustacheTag.ts index d8f863c674..326852bb18 100644 --- a/src/compile/render-dom/wrappers/RawMustacheTag.ts +++ b/src/compile/render-dom/wrappers/RawMustacheTag.ts @@ -1,7 +1,7 @@ import Renderer from '../Renderer'; import Block from '../Block'; import Tag from './shared/Tag'; -import Wrapper from './shared/wrapper'; +import Wrapper from './shared/Wrapper'; import deindent from '../../utils/deindent'; import MustacheTag from '../../nodes/MustacheTag'; import RawMustacheTag from '../../nodes/RawMustacheTag'; diff --git a/tsconfig.json b/tsconfig.json index ff11591679..994bc61b85 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,9 +17,10 @@ "moduleResolution": "node", "baseUrl": ".", "paths": { - "svelte/*": [ - "./src/*" - ] + "svelte/internal": ["./src/internal"], + "svelte/easing": ["./src/easing"], + "svelte/motion": ["./src/motion"], + "svelte/store": ["./src/store"] }, "typeRoots": [ "node_modules/@types" From a6c05ed3728c7b3b2e08fdb83fa58ab46a58ad5f Mon Sep 17 00:00:00 2001 From: Conduitry Date: Wed, 22 May 2019 12:00:22 -0400 Subject: [PATCH 037/409] site: add /faq redirect to GitHub wiki FAQ --- site/src/routes/faq.js | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 site/src/routes/faq.js diff --git a/site/src/routes/faq.js b/site/src/routes/faq.js new file mode 100644 index 0000000000..6263494a4c --- /dev/null +++ b/site/src/routes/faq.js @@ -0,0 +1,4 @@ +export function get(req, res) { + res.writeHead(302, { Location: 'https://github.com/sveltejs/svelte/wiki/FAQ' }); + res.end(); +} \ No newline at end of file From dabc9c3e5310316d82bfd8ef16f13e9a4fed3e66 Mon Sep 17 00:00:00 2001 From: Benjamin Milde Date: Fri, 24 May 2019 17:13:58 +0200 Subject: [PATCH 038/409] Allow binding of
      open --- src/compile/nodes/Element.ts | 10 ++- .../render-dom/wrappers/Element/index.ts | 6 ++ test/js/samples/bind-open/expected.js | 69 +++++++++++++++++++ test/js/samples/bind-open/input.svelte | 7 ++ .../samples/binding-details-open/_config.js | 25 +++++++ .../samples/binding-details-open/main.svelte | 9 +++ 6 files changed, 125 insertions(+), 1 deletion(-) create mode 100644 test/js/samples/bind-open/expected.js create mode 100644 test/js/samples/bind-open/input.svelte create mode 100644 test/runtime/samples/binding-details-open/_config.js create mode 100644 test/runtime/samples/binding-details-open/main.svelte diff --git a/src/compile/nodes/Element.ts b/src/compile/nodes/Element.ts index ac2b81b3e7..2b76d68e6d 100644 --- a/src/compile/nodes/Element.ts +++ b/src/compile/nodes/Element.ts @@ -544,7 +544,7 @@ export default class Element extends Node { message: `'group' binding can only be used with or ` }); } - } else if (name == 'files') { + } else if (name === 'files') { if (this.name !== 'input') { component.error(binding, { code: `invalid-binding`, @@ -560,6 +560,14 @@ export default class Element extends Node { message: `'files' binding can only be used with ` }); } + + } else if (name === 'open') { + if (this.name !== 'details') { + component.error(binding, { + code: `invalid-binding`, + message: `'${name}' binding can only be used with
      ` + }); + } } else if ( name === 'currentTime' || name === 'duration' || diff --git a/src/compile/render-dom/wrappers/Element/index.ts b/src/compile/render-dom/wrappers/Element/index.ts index 22ea7a78cd..ad85a46db3 100644 --- a/src/compile/render-dom/wrappers/Element/index.ts +++ b/src/compile/render-dom/wrappers/Element/index.ts @@ -91,6 +91,12 @@ const events = [ name === 'playbackRate' }, + // details event + { + event_names: ['toggle'], + filter: (node: Element, name: string) => + node.name === 'details' + }, ]; export default class ElementWrapper extends Wrapper { diff --git a/test/js/samples/bind-open/expected.js b/test/js/samples/bind-open/expected.js new file mode 100644 index 0000000000..7c73c8ddac --- /dev/null +++ b/test/js/samples/bind-open/expected.js @@ -0,0 +1,69 @@ +/* generated by Svelte vX.Y.Z */ +import { + SvelteComponent, + detach, + element, + init, + insert, + listen, + noop, + safe_not_equal +} from "svelte/internal"; + +function create_fragment(ctx) { + var details, dispose; + + return { + c() { + details = element("details"); + details.innerHTML = `summarycontent + `; + dispose = listen(details, "toggle", ctx.details_toggle_handler); + }, + + m(target, anchor) { + insert(target, details, anchor); + + details.open = ctx.open; + }, + + p(changed, ctx) { + if (changed.open) details.open = ctx.open; + }, + + i: noop, + o: noop, + + d(detaching) { + if (detaching) { + detach(details); + } + + dispose(); + } + }; +} + +function instance($$self, $$props, $$invalidate) { + let { open } = $$props; + + function details_toggle_handler() { + open = this.open; + $$invalidate('open', open); + } + + $$self.$set = $$props => { + if ('open' in $$props) $$invalidate('open', open = $$props.open); + }; + + return { open, details_toggle_handler }; +} + +class Component extends SvelteComponent { + constructor(options) { + super(); + init(this, options, instance, create_fragment, safe_not_equal, ["open"]); + } +} + +export default Component; diff --git a/test/js/samples/bind-open/input.svelte b/test/js/samples/bind-open/input.svelte new file mode 100644 index 0000000000..3dd2b03a73 --- /dev/null +++ b/test/js/samples/bind-open/input.svelte @@ -0,0 +1,7 @@ + + +
      + summarycontent +
      diff --git a/test/runtime/samples/binding-details-open/_config.js b/test/runtime/samples/binding-details-open/_config.js new file mode 100644 index 0000000000..e5e81b2c93 --- /dev/null +++ b/test/runtime/samples/binding-details-open/_config.js @@ -0,0 +1,25 @@ +export default { + html: ` +
      toggle
      + `, + + async test({ assert, component, target, window }) { + const details = target.querySelector('details'); + const event = new window.Event('toggle'); + + details.open = true; + await details.dispatchEvent(event); + assert.equal(component.open, true); + assert.htmlEqual(target.innerHTML, ` +
      toggle
      +

      hello!

      + `); + + details.open = false; + await details.dispatchEvent(event); + assert.equal(component.open, false); + assert.htmlEqual(target.innerHTML, ` +
      toggle
      + `); + } +}; diff --git a/test/runtime/samples/binding-details-open/main.svelte b/test/runtime/samples/binding-details-open/main.svelte new file mode 100644 index 0000000000..3a7a08e121 --- /dev/null +++ b/test/runtime/samples/binding-details-open/main.svelte @@ -0,0 +1,9 @@ + + +
      toggle
      + +{#if visible} +

      hello!

      +{/if} From 2f80667f207432f1154fb22ea735f03f1654793d Mon Sep 17 00:00:00 2001 From: Conduitry Date: Fri, 24 May 2019 12:05:18 -0400 Subject: [PATCH 039/409] site: actions tutorial: destroy is not required (#2776) --- site/content/tutorial/12-actions/01-actions/text.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/site/content/tutorial/12-actions/01-actions/text.md b/site/content/tutorial/12-actions/01-actions/text.md index 279dc3123f..38de8f9a65 100644 --- a/site/content/tutorial/12-actions/01-actions/text.md +++ b/site/content/tutorial/12-actions/01-actions/text.md @@ -27,7 +27,7 @@ import { pannable } from './pannable.js'; > ``` -Open the `pannable.js` file. Like transition functions, an action function receives a `node` and some optional parameters, and returns an action object. That object must have a `destroy` function, which is called when the element is unmounted. +Open the `pannable.js` file. Like transition functions, an action function receives a `node` and some optional parameters, and returns an action object. That object can have a `destroy` function, which is called when the element is unmounted. We want to fire `panstart` event when the user mouses down on the element, `panmove` events (with `dx` and `dy` properties showing how far the mouse moved) when they drag it, and `panend` events when they mouse up. One possible implementation looks like this: @@ -84,4 +84,3 @@ export function pannable(node) { Update the `pannable` function and try moving the box around. > This implementation is for demonstration purposes — a more complete one would also consider touch events. - From a5fe09c48154c9b993dfc5386e8f7c72ce748d09 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Fri, 24 May 2019 14:12:41 -0400 Subject: [PATCH 040/409] treat requestAnimationFrame as a noop on the server --- package-lock.json | 2 +- src/compile/render-dom/wrappers/Element/index.ts | 2 +- src/internal/loop.js | 6 +++--- src/internal/style_manager.js | 3 ++- src/internal/utils.js | 8 ++++++-- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index bb2b7d7d7e..28ecb0eedb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "svelte", - "version": "3.4.0", + "version": "3.4.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/compile/render-dom/wrappers/Element/index.ts b/src/compile/render-dom/wrappers/Element/index.ts index 22ea7a78cd..ad624c8d6c 100644 --- a/src/compile/render-dom/wrappers/Element/index.ts +++ b/src/compile/render-dom/wrappers/Element/index.ts @@ -455,7 +455,7 @@ export default class ElementWrapper extends Wrapper { function ${handler}() { ${animation_frame && deindent` cancelAnimationFrame(${animation_frame}); - if (!${this.var}.paused) ${animation_frame} = requestAnimationFrame(${handler});`} + if (!${this.var}.paused) ${animation_frame} = @raf(${handler});`} ${needs_lock && `${lock} = true;`} ctx.${handler}.call(${this.var}${contextual_dependencies.size > 0 ? ', ctx' : ''}); } diff --git a/src/internal/loop.js b/src/internal/loop.js index 8150727441..60c7df4d70 100644 --- a/src/internal/loop.js +++ b/src/internal/loop.js @@ -1,4 +1,4 @@ -import { now } from './utils.js'; +import { now, raf } from './utils.js'; const tasks = new Set(); let running = false; @@ -12,7 +12,7 @@ function run_tasks() { }); running = tasks.size > 0; - if (running) requestAnimationFrame(run_tasks); + if (running) raf(run_tasks); } export function clear_loops() { @@ -26,7 +26,7 @@ export function loop(fn) { if (!running) { running = true; - requestAnimationFrame(run_tasks); + raf(run_tasks); } return { diff --git a/src/internal/style_manager.js b/src/internal/style_manager.js index d71e922f01..3679470399 100644 --- a/src/internal/style_manager.js +++ b/src/internal/style_manager.js @@ -1,4 +1,5 @@ import { element } from './dom.js'; +import { raf } from './utils.js'; let stylesheet; let active = 0; @@ -56,7 +57,7 @@ export function delete_rule(node, name) { } export function clear_rules() { - requestAnimationFrame(() => { + raf(() => { if (active) return; let i = stylesheet.cssRules.length; while (i--) stylesheet.deleteRule(i); diff --git a/src/internal/utils.js b/src/internal/utils.js index e6d66d8717..c493eacb96 100644 --- a/src/internal/utils.js +++ b/src/internal/utils.js @@ -80,11 +80,15 @@ export function exclude_internal_props(props) { return result; } -export let now = typeof window !== 'undefined' +const is_client = typeof window !== 'undefined'; + +export let now = is_client ? () => window.performance.now() : () => Date.now(); // used internally for testing export function set_now(fn) { now = fn; -} \ No newline at end of file +} + +export const raf = is_client ? requestAnimationFrame : noop; \ No newline at end of file From ef59c32099ef27620be6ad5759e136925db4d819 Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Fri, 24 May 2019 16:31:01 -0700 Subject: [PATCH 041/409] Fixes #2714 --- src/parse/state/tag.ts | 9 +++++++-- src/parse/state/text.ts | 9 +++++++-- test/parser/samples/attribute-escaped/output.json | 3 ++- .../samples/convert-entities-in-element/output.json | 3 ++- test/parser/samples/convert-entities/output.json | 3 ++- test/parser/samples/nbsp/output.json | 3 ++- 6 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/parse/state/tag.ts b/src/parse/state/tag.ts index 56195549d8..fc5fc3620d 100644 --- a/src/parse/state/tag.ts +++ b/src/parse/state/tag.ts @@ -490,8 +490,13 @@ function read_sequence(parser: Parser, done: () => boolean) { if (current_chunk.data) chunks.push(current_chunk); chunks.forEach(chunk => { - if (chunk.type === 'Text') - chunk.data = decode_character_references(chunk.data); + if (chunk.type === 'Text') { + let decoded = decode_character_references(chunk.data); + if (chunk.data != decoded) { + chunk.raw = chunk.data; + chunk.data = decoded; + } + } }); return chunks; diff --git a/src/parse/state/text.ts b/src/parse/state/text.ts index f739c8cc9e..503d79aa08 100644 --- a/src/parse/state/text.ts +++ b/src/parse/state/text.ts @@ -14,10 +14,15 @@ export default function text(parser: Parser) { data += parser.template[parser.index++]; } - parser.current().children.push({ + let node = { start, end: parser.index, type: 'Text', data: decode_character_references(data), - }); + }; + + if (node.data != data) + node.raw = data; + + parser.current().children.push(node); } diff --git a/test/parser/samples/attribute-escaped/output.json b/test/parser/samples/attribute-escaped/output.json index 6a4143e674..79b135eb86 100644 --- a/test/parser/samples/attribute-escaped/output.json +++ b/test/parser/samples/attribute-escaped/output.json @@ -20,7 +20,8 @@ "start": 15, "end": 33, "type": "Text", - "data": "\"quoted\"" + "data": "\"quoted\"", + "raw": ""quoted"" } ] } diff --git a/test/parser/samples/convert-entities-in-element/output.json b/test/parser/samples/convert-entities-in-element/output.json index fb0f5b288e..92b5aafb00 100644 --- a/test/parser/samples/convert-entities-in-element/output.json +++ b/test/parser/samples/convert-entities-in-element/output.json @@ -15,7 +15,8 @@ "start": 3, "end": 20, "type": "Text", - "data": "Hello & World" + "data": "Hello & World", + "raw": "Hello & World" } ] } diff --git a/test/parser/samples/convert-entities/output.json b/test/parser/samples/convert-entities/output.json index ca1c1356f8..967895383d 100644 --- a/test/parser/samples/convert-entities/output.json +++ b/test/parser/samples/convert-entities/output.json @@ -8,7 +8,8 @@ "start": 0, "end": 17, "type": "Text", - "data": "Hello & World" + "data": "Hello & World", + "raw": "Hello & World" } ] }, diff --git a/test/parser/samples/nbsp/output.json b/test/parser/samples/nbsp/output.json index 4fa318ce48..c47257c873 100644 --- a/test/parser/samples/nbsp/output.json +++ b/test/parser/samples/nbsp/output.json @@ -15,7 +15,8 @@ "start": 6, "end": 12, "type": "Text", - "data": " " + "data": " ", + "raw": " " } ] } From 4c805018e4d20218e95017ca571fa908f10cdaec Mon Sep 17 00:00:00 2001 From: Elliot Waite <1767836+elliotwaite@users.noreply.github.com> Date: Fri, 24 May 2019 15:55:18 -1000 Subject: [PATCH 042/409] Fix CRUD example to allow changing input values. Currently, the first name and last name inputs fields can't be edited without the changes immediately being overwritten back to the selected person's first name and last name. This change will make it so that the input fields only get overwritten with the selected person's first name and last name when the selected person is changed. --- site/content/examples/19-7guis/05-7guis-crud/App.svelte | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/site/content/examples/19-7guis/05-7guis-crud/App.svelte b/site/content/examples/19-7guis/05-7guis-crud/App.svelte index 1f39fe6642..a0d6ef7f3e 100644 --- a/site/content/examples/19-7guis/05-7guis-crud/App.svelte +++ b/site/content/examples/19-7guis/05-7guis-crud/App.svelte @@ -30,10 +30,7 @@ $: selected = filteredPeople[i]; - $: { - first = selected ? selected.first : ''; - last = selected ? selected.last : ''; - } + $: reset_inputs(selected); function create() { people = people.concat({ first, last }); @@ -53,7 +50,8 @@ } function reset_inputs(person) { - ({ first, last } = person); + first = person ? person.first : ''; + last = person ? person.last : ''; } From 9d53f568fab23b82c8b344c5969c8bfab44de03a Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Sat, 25 May 2019 11:25:09 +0100 Subject: [PATCH 043/409] fix tests --- src/internal/utils.js | 6 +++++- test/js/samples/debug-hoisted/expected.js | 2 +- test/js/samples/media-bindings/expected.js | 3 ++- test/runtime/index.js | 6 +++--- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/internal/utils.js b/src/internal/utils.js index c493eacb96..7823a5b920 100644 --- a/src/internal/utils.js +++ b/src/internal/utils.js @@ -86,9 +86,13 @@ export let now = is_client ? () => window.performance.now() : () => Date.now(); +export let raf = is_client ? requestAnimationFrame : noop; + // used internally for testing export function set_now(fn) { now = fn; } -export const raf = is_client ? requestAnimationFrame : noop; \ No newline at end of file +export function set_raf(fn) { + raf = fn; +} \ No newline at end of file diff --git a/test/js/samples/debug-hoisted/expected.js b/test/js/samples/debug-hoisted/expected.js index 153f92bad8..51d8bf63a3 100644 --- a/test/js/samples/debug-hoisted/expected.js +++ b/test/js/samples/debug-hoisted/expected.js @@ -53,4 +53,4 @@ class Component extends SvelteComponentDev { } } -export default Component; +export default Component; \ No newline at end of file diff --git a/test/js/samples/media-bindings/expected.js b/test/js/samples/media-bindings/expected.js index 8a193f698b..f45f9ce8db 100644 --- a/test/js/samples/media-bindings/expected.js +++ b/test/js/samples/media-bindings/expected.js @@ -8,6 +8,7 @@ import { insert, listen, noop, + raf, run_all, safe_not_equal, time_ranges_to_array @@ -18,7 +19,7 @@ function create_fragment(ctx) { function audio_timeupdate_handler() { cancelAnimationFrame(audio_animationframe); - if (!audio.paused) audio_animationframe = requestAnimationFrame(audio_timeupdate_handler); + if (!audio.paused) audio_animationframe = raf(audio_timeupdate_handler); audio_updating = true; ctx.audio_timeupdate_handler.call(audio); } diff --git a/test/runtime/index.js b/test/runtime/index.js index db02ce13d4..fd5ffdef04 100644 --- a/test/runtime/index.js +++ b/test/runtime/index.js @@ -3,7 +3,7 @@ import * as path from "path"; import * as fs from "fs"; import { rollup } from 'rollup'; import * as virtual from 'rollup-plugin-virtual'; -import { clear_loops, set_now } from "../../internal.js"; +import { clear_loops, set_now, set_raf } from "../../internal.js"; import { showOutput, @@ -101,7 +101,7 @@ describe("runtime", () => { } }; set_now(() => raf.time); - global.requestAnimationFrame = cb => { + set_raf(cb => { let called = false; raf.callback = () => { if (!called) { @@ -109,7 +109,7 @@ describe("runtime", () => { cb(); } }; - }; + }); try { mod = require(`./samples/${dir}/main.svelte`); From db938a455936dc29375ee303725aaf22a48dbd35 Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Sat, 25 May 2019 18:03:41 +0100 Subject: [PATCH 044/409] only invalidate referenced values --- src/compile/Component.ts | 9 ++- src/compile/render-dom/index.ts | 6 +- src/interfaces.ts | 1 + .../expected.js | 2 +- .../expected.js | 17 ++-- .../input.svelte | 7 +- .../expected.js | 78 +++++++++++++++++++ .../input.svelte | 21 +++++ .../samples/immutable-nested/Nested.svelte | 5 +- .../samples/immutable-nested/_config.js | 29 +++++-- .../samples/immutable-nested/main.svelte | 2 +- 11 files changed, 151 insertions(+), 26 deletions(-) create mode 100644 test/js/samples/unreferenced-state-not-invalidated/expected.js create mode 100644 test/js/samples/unreferenced-state-not-invalidated/input.svelte diff --git a/src/compile/Component.ts b/src/compile/Component.ts index a429db41f6..b73c961672 100644 --- a/src/compile/Component.ts +++ b/src/compile/Component.ts @@ -787,6 +787,10 @@ export default class Component { return `${name.slice(1)}.set(${name})` } + if (variable && !variable.referenced && !variable.is_reactive_dependency && !variable.export_name && !name.startsWith('$$')) { + return value || name; + } + if (value) { return `$$invalidate('${name}', ${value})`; } @@ -1118,8 +1122,9 @@ export default class Component { if (!assignee_nodes.has(identifier)) { const { name } = identifier; const owner = scope.find_owner(name); - const component_var = component.var_lookup.get(name); - const is_writable_or_mutated = component_var && (component_var.writable || component_var.mutated); + const variable = component.var_lookup.get(name); + if (variable) variable.is_reactive_dependency = true; + const is_writable_or_mutated = variable && (variable.writable || variable.mutated); if ( (!owner || owner === component.instance_scope) && (name[0] === '$' || is_writable_or_mutated) diff --git a/src/compile/render-dom/index.ts b/src/compile/render-dom/index.ts index 0fd0d4b172..7942916dfb 100644 --- a/src/compile/render-dom/index.ts +++ b/src/compile/render-dom/index.ts @@ -204,8 +204,10 @@ export default function dom( if (variable && (variable.hoistable || variable.global || variable.module)) return; if (single && !(variable.subscribable && variable.reassigned)) { - code.prependRight(node.start, `$$invalidate('${name}', `); - code.appendLeft(node.end, `)`); + if (variable.referenced || variable.is_reactive_dependency || variable.export_name) { + code.prependRight(node.start, `$$invalidate('${name}', `); + code.appendLeft(node.end, `)`); + } } else { pending_assignments.add(name); } diff --git a/src/interfaces.ts b/src/interfaces.ts index 68fef7472e..dda698a0da 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -92,4 +92,5 @@ export interface Var { initialised?: boolean; hoistable?: boolean; subscribable?: boolean; + is_reactive_dependency: boolean; } \ No newline at end of file diff --git a/test/js/samples/reactive-values-non-topologically-ordered/expected.js b/test/js/samples/reactive-values-non-topologically-ordered/expected.js index 2f729362b0..b5e2b04f75 100644 --- a/test/js/samples/reactive-values-non-topologically-ordered/expected.js +++ b/test/js/samples/reactive-values-non-topologically-ordered/expected.js @@ -29,7 +29,7 @@ function instance($$self, $$props, $$invalidate) { $$self.$$.update = ($$dirty = { x: 1, b: 1 }) => { if ($$dirty.x) { $$invalidate('b', b = x); } - if ($$dirty.b) { $$invalidate('a', a = b); } + if ($$dirty.b) { a = b; } }; return { x }; diff --git a/test/js/samples/reactive-values-non-writable-dependencies/expected.js b/test/js/samples/reactive-values-non-writable-dependencies/expected.js index 62057cc6f0..8958f1ffbc 100644 --- a/test/js/samples/reactive-values-non-writable-dependencies/expected.js +++ b/test/js/samples/reactive-values-non-writable-dependencies/expected.js @@ -17,26 +17,25 @@ function create_fragment(ctx) { }; } -let a = 1; - -let b = 2; - function instance($$self, $$props, $$invalidate) { - + let { a = 1, b = 2 } = $$props; - let max; + $$self.$set = $$props => { + if ('a' in $$props) $$invalidate('a', a = $$props.a); + if ('b' in $$props) $$invalidate('b', b = $$props.b); + }; $$self.$$.update = ($$dirty = { a: 1, b: 1 }) => { - if ($$dirty.a || $$dirty.b) { $$invalidate('max', max = Math.max(a, b)); } + if ($$dirty.a || $$dirty.b) { console.log('max', Math.max(a, b)); } }; - return {}; + return { a, b }; } class Component extends SvelteComponent { constructor(options) { super(); - init(this, options, instance, create_fragment, safe_not_equal, []); + init(this, options, instance, create_fragment, safe_not_equal, ["a", "b"]); } } diff --git a/test/js/samples/reactive-values-non-writable-dependencies/input.svelte b/test/js/samples/reactive-values-non-writable-dependencies/input.svelte index 8e3397e40d..3fb70d5e8f 100644 --- a/test/js/samples/reactive-values-non-writable-dependencies/input.svelte +++ b/test/js/samples/reactive-values-non-writable-dependencies/input.svelte @@ -1,7 +1,6 @@ \ No newline at end of file diff --git a/test/js/samples/unreferenced-state-not-invalidated/expected.js b/test/js/samples/unreferenced-state-not-invalidated/expected.js new file mode 100644 index 0000000000..17b5638a84 --- /dev/null +++ b/test/js/samples/unreferenced-state-not-invalidated/expected.js @@ -0,0 +1,78 @@ +/* generated by Svelte vX.Y.Z */ +import { + SvelteComponent, + append, + detach, + element, + init, + insert, + noop, + safe_not_equal, + set_data, + text +} from "svelte/internal"; +import { onMount } from "svelte"; + +function create_fragment(ctx) { + var p, t; + + return { + c() { + p = element("p"); + t = text(ctx.y); + }, + + m(target, anchor) { + insert(target, p, anchor); + append(p, t); + }, + + p(changed, ctx) { + if (changed.y) { + set_data(t, ctx.y); + } + }, + + i: noop, + o: noop, + + d(detaching) { + if (detaching) { + detach(p); + } + } + }; +} + +function instance($$self, $$props, $$invalidate) { + let a, b, c; + + onMount(() => { + const interval = setInterval(() => { + $$invalidate('b', b += 1); + c += 1; + + console.log(b, c); + }, 1000); + + return () => clearInterval(interval); + }); + + let x, y; + + $$self.$$.update = ($$dirty = { a: 1, b: 1 }) => { + if ($$dirty.a) { x = a * 2; } + if ($$dirty.b) { $$invalidate('y', y = b * 2); } + }; + + return { y }; +} + +class Component extends SvelteComponent { + constructor(options) { + super(); + init(this, options, instance, create_fragment, safe_not_equal, []); + } +} + +export default Component; \ No newline at end of file diff --git a/test/js/samples/unreferenced-state-not-invalidated/input.svelte b/test/js/samples/unreferenced-state-not-invalidated/input.svelte new file mode 100644 index 0000000000..fff60f181d --- /dev/null +++ b/test/js/samples/unreferenced-state-not-invalidated/input.svelte @@ -0,0 +1,21 @@ + + +

      {y}

      \ No newline at end of file diff --git a/test/runtime/samples/immutable-nested/Nested.svelte b/test/runtime/samples/immutable-nested/Nested.svelte index 45385e9b0b..acb0b480a4 100644 --- a/test/runtime/samples/immutable-nested/Nested.svelte +++ b/test/runtime/samples/immutable-nested/Nested.svelte @@ -1,7 +1,7 @@ -

      Called {count} times.

      \ No newline at end of file +

      Called {count} times.

      +

      {foo.bar} {mounted}

      \ No newline at end of file diff --git a/test/runtime/samples/immutable-nested/_config.js b/test/runtime/samples/immutable-nested/_config.js index e5c515fc78..da90b43727 100644 --- a/test/runtime/samples/immutable-nested/_config.js +++ b/test/runtime/samples/immutable-nested/_config.js @@ -1,16 +1,35 @@ export default { immutable: true, - html: `

      Called 1 times.

      `, + html: ` +
      +

      Called 1 times.

      +

      baz true

      +
      + `, - ssrHtml: `

      Called 0 times.

      `, + ssrHtml: ` +
      +

      Called 0 times.

      +

      baz false

      +
      `, - test({ assert, component, target, window }) { + test({ assert, component, target }) { var nested = component.nested; - assert.htmlEqual(target.innerHTML, `

      Called 1 times.

      `); + assert.htmlEqual(target.innerHTML, ` +
      +

      Called 1 times.

      +

      baz true

      +
      + `); nested.foo = nested.foo; - assert.htmlEqual(target.innerHTML, `

      Called 1 times.

      `); + assert.htmlEqual(target.innerHTML, ` +
      +

      Called 1 times.

      +

      baz true

      +
      + `); } }; diff --git a/test/runtime/samples/immutable-nested/main.svelte b/test/runtime/samples/immutable-nested/main.svelte index e50055be0c..4ccf7008cd 100644 --- a/test/runtime/samples/immutable-nested/main.svelte +++ b/test/runtime/samples/immutable-nested/main.svelte @@ -5,5 +5,5 @@
      - +
      From ac287ed9f4bd37d0da03f0e27c738ca6b4672642 Mon Sep 17 00:00:00 2001 From: cudr Date: Sun, 26 May 2019 00:19:23 +0300 Subject: [PATCH 045/409] works correct --- src/compile/render-dom/Block.ts | 2 +- .../render-dom/wrappers/RawMustacheTag.ts | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/compile/render-dom/Block.ts b/src/compile/render-dom/Block.ts index e40b3ceb55..8baf6f18d4 100644 --- a/src/compile/render-dom/Block.ts +++ b/src/compile/render-dom/Block.ts @@ -164,7 +164,7 @@ export default class Block { if (parent_node) { this.builders.mount.add_line(`@append(${parent_node}, ${name});`); - if (parent_node === 'document.head') this.builders.destroy.add_line(`@detach(${name});`); + if (parent_node === 'document.head' && !no_detach) this.builders.destroy.add_line(`@detach(${name});`); } else { this.builders.mount.add_line(`@insert(#target, ${name}, anchor);`); if (!no_detach) this.builders.destroy.add_conditional('detaching', `@detach(${name});`); diff --git a/src/compile/render-dom/wrappers/RawMustacheTag.ts b/src/compile/render-dom/wrappers/RawMustacheTag.ts index eb71e16de9..8111e821a2 100644 --- a/src/compile/render-dom/wrappers/RawMustacheTag.ts +++ b/src/compile/render-dom/wrappers/RawMustacheTag.ts @@ -21,9 +21,18 @@ export default class RawMustacheTagWrapper extends Tag { render(block: Block, parent_node: string, parent_nodes: string) { const name = this.var; + const in_head = parent_node === 'document.head'; + const needs_anchors = !parent_node || in_head; + + // if in head always needs anchors + if (in_head) { + this.prev = null; + this.next = null; + } + // TODO use is_dom_node instead of type === 'Element'? - const needs_anchor_before = this.prev ? this.prev.node.type !== 'Element' : !parent_node; - const needs_anchor_after = this.next ? this.next.node.type !== 'Element' : !parent_node; + const needs_anchor_before = this.prev ? this.prev.node.type !== 'Element' : needs_anchors; + const needs_anchor_after = this.next ? this.next.node.type !== 'Element' : needs_anchors; const anchor_before = needs_anchor_before ? block.get_unique_name(`${name}_before`) @@ -89,7 +98,7 @@ export default class RawMustacheTagWrapper extends Tag { block.builders.mount.add_line(insert(init)); - if (!parent_node) { + if (needs_anchors) { block.builders.destroy.add_conditional('detaching', needs_anchor_before ? `${detach}\n@detach(${anchor_before});` : detach); @@ -100,4 +109,4 @@ export default class RawMustacheTagWrapper extends Tag { add_anchor_after(); } } -} \ No newline at end of file +} From cce9f14e380db04f1365ca97ca0acc4f0ca1f619 Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Sun, 26 May 2019 13:49:06 +0200 Subject: [PATCH 046/409] fix test --- test/runtime/samples/binding-details-open/_config.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/runtime/samples/binding-details-open/_config.js b/test/runtime/samples/binding-details-open/_config.js index e5e81b2c93..cf2459c3f1 100644 --- a/test/runtime/samples/binding-details-open/_config.js +++ b/test/runtime/samples/binding-details-open/_config.js @@ -9,7 +9,7 @@ export default { details.open = true; await details.dispatchEvent(event); - assert.equal(component.open, true); + assert.equal(component.visible, true); assert.htmlEqual(target.innerHTML, `
      toggle

      hello!

      @@ -17,9 +17,9 @@ export default { details.open = false; await details.dispatchEvent(event); - assert.equal(component.open, false); + assert.equal(component.visible, false); assert.htmlEqual(target.innerHTML, ` -
      toggle
      +
      toggle
      `); } }; From 089149564799fd4f22799128315bc91208dda84f Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Sun, 26 May 2019 14:04:29 +0200 Subject: [PATCH 047/409] code style --- src/compile/render-dom/index.ts | 12 ++++++------ test/js/samples/bind-open/expected.js | 2 +- test/js/samples/debug-empty/expected.js | 6 +++--- test/js/samples/debug-foo-bar-baz-things/expected.js | 6 +++--- test/js/samples/debug-foo/expected.js | 6 +++--- .../dev-warning-missing-data-computed/expected.js | 6 +++--- .../samples/dev-warning-unknown-props/_config.js | 2 +- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/compile/render-dom/index.ts b/src/compile/render-dom/index.ts index e7f063d086..1432813e9d 100644 --- a/src/compile/render-dom/index.ts +++ b/src/compile/render-dom/index.ts @@ -394,12 +394,12 @@ export default function dom( return $name; }); - let unknownPropsCheck; + let unknown_props_check; if (component.compile_options.dev && writable_props.length) { - unknownPropsCheck = deindent` - const writableProps = [${writable_props.map(prop => `'${prop.export_name}'`).join(', ')}]; + unknown_props_check = deindent` + const writable_props = [${writable_props.map(prop => `'${prop.export_name}'`).join(', ')}]; Object.keys($$props).forEach(key => { - if (!writableProps.includes(key)) console.warn(\`<${component.tag}> was created with unknown attribute '\${key}'\`); + if (!writable_props.includes(key)) console.warn(\`<${component.tag}> was created with unknown prop '\${key}'\`); }); `; } @@ -413,8 +413,8 @@ export default function dom( ${resubscribable_reactive_store_unsubscribers} ${component.javascript} - - ${unknownPropsCheck} + + ${unknown_props_check} ${component.slots.size && `let { $$slots = {}, $$scope } = $$props;`} diff --git a/test/js/samples/bind-open/expected.js b/test/js/samples/bind-open/expected.js index 7c73c8ddac..7f739aec8b 100644 --- a/test/js/samples/bind-open/expected.js +++ b/test/js/samples/bind-open/expected.js @@ -66,4 +66,4 @@ class Component extends SvelteComponent { } } -export default Component; +export default Component; \ No newline at end of file diff --git a/test/js/samples/debug-empty/expected.js b/test/js/samples/debug-empty/expected.js index 9b6ef447b4..c82cbeddd3 100644 --- a/test/js/samples/debug-empty/expected.js +++ b/test/js/samples/debug-empty/expected.js @@ -65,9 +65,9 @@ function create_fragment(ctx) { function instance($$self, $$props, $$invalidate) { let { name } = $$props; - const writableProps = ['name']; + const writable_props = ['name']; Object.keys($$props).forEach(key => { - if (!writableProps.includes(key)) console.warn(` was created with unknown attribute '${key}'`); + if (!writable_props.includes(key)) console.warn(` was created with unknown prop '${key}'`); }); $$self.$set = $$props => { @@ -98,4 +98,4 @@ class Component extends SvelteComponentDev { } } -export default Component; +export default Component; \ No newline at end of file diff --git a/test/js/samples/debug-foo-bar-baz-things/expected.js b/test/js/samples/debug-foo-bar-baz-things/expected.js index 006b25aba5..3e1571b890 100644 --- a/test/js/samples/debug-foo-bar-baz-things/expected.js +++ b/test/js/samples/debug-foo-bar-baz-things/expected.js @@ -151,9 +151,9 @@ function create_fragment(ctx) { function instance($$self, $$props, $$invalidate) { let { things, foo, bar, baz } = $$props; - const writableProps = ['things', 'foo', 'bar', 'baz']; + const writable_props = ['things', 'foo', 'bar', 'baz']; Object.keys($$props).forEach(key => { - if (!writableProps.includes(key)) console.warn(` was created with unknown attribute '${key}'`); + if (!writable_props.includes(key)) console.warn(` was created with unknown prop '${key}'`); }); $$self.$set = $$props => { @@ -220,4 +220,4 @@ class Component extends SvelteComponentDev { } } -export default Component; +export default Component; \ No newline at end of file diff --git a/test/js/samples/debug-foo/expected.js b/test/js/samples/debug-foo/expected.js index 7bc58434a8..1af0fcaebe 100644 --- a/test/js/samples/debug-foo/expected.js +++ b/test/js/samples/debug-foo/expected.js @@ -151,9 +151,9 @@ function create_fragment(ctx) { function instance($$self, $$props, $$invalidate) { let { things, foo } = $$props; - const writableProps = ['things', 'foo']; + const writable_props = ['things', 'foo']; Object.keys($$props).forEach(key => { - if (!writableProps.includes(key)) console.warn(` was created with unknown attribute '${key}'`); + if (!writable_props.includes(key)) console.warn(` was created with unknown prop '${key}'`); }); $$self.$set = $$props => { @@ -196,4 +196,4 @@ class Component extends SvelteComponentDev { } } -export default Component; +export default Component; \ No newline at end of file diff --git a/test/js/samples/dev-warning-missing-data-computed/expected.js b/test/js/samples/dev-warning-missing-data-computed/expected.js index e181486512..0c193934c0 100644 --- a/test/js/samples/dev-warning-missing-data-computed/expected.js +++ b/test/js/samples/dev-warning-missing-data-computed/expected.js @@ -65,9 +65,9 @@ function instance($$self, $$props, $$invalidate) { let bar; - const writableProps = ['foo']; + const writable_props = ['foo']; Object.keys($$props).forEach(key => { - if (!writableProps.includes(key)) console.warn(` was created with unknown attribute '${key}'`); + if (!writable_props.includes(key)) console.warn(` was created with unknown prop '${key}'`); }); $$self.$set = $$props => { @@ -102,4 +102,4 @@ class Component extends SvelteComponentDev { } } -export default Component; +export default Component; \ No newline at end of file diff --git a/test/runtime/samples/dev-warning-unknown-props/_config.js b/test/runtime/samples/dev-warning-unknown-props/_config.js index 31b605e214..9bff4a2a74 100644 --- a/test/runtime/samples/dev-warning-unknown-props/_config.js +++ b/test/runtime/samples/dev-warning-unknown-props/_config.js @@ -4,6 +4,6 @@ export default { }, warnings: [ - ` was created with unknown attribute 'fo'` + ` was created with unknown prop 'fo'` ] }; From 0d7f6fb795fc461aced9c3470932d715caf395f5 Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Sun, 26 May 2019 14:29:30 +0200 Subject: [PATCH 048/409] flesh out in/out transition tutorial chapter (#2792) --- .../content/tutorial/10-transitions/03-in-and-out/text.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/site/content/tutorial/10-transitions/03-in-and-out/text.md b/site/content/tutorial/10-transitions/03-in-and-out/text.md index 21cb221342..1f1ac2c80b 100644 --- a/site/content/tutorial/10-transitions/03-in-and-out/text.md +++ b/site/content/tutorial/10-transitions/03-in-and-out/text.md @@ -2,7 +2,13 @@ title: In and out --- -Instead of the `transition` directive, an element can have an `in` or an `out` directive, or both together: +Instead of the `transition` directive, an element can have an `in` or an `out` directive, or both together. Import `fade` alongside `fly`... + +```js +import { fade, fly } from 'svelte/transition'; +``` + +...then replace the `transition` directive with separate `in` and `out` directives: ```html

      From b7f9c9c95444fb15d20eaa170253f1c3982c1148 Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Sun, 26 May 2019 14:48:10 +0200 Subject: [PATCH 049/409] always add raw property to text nodes --- src/parse/state/tag.ts | 36 ++++++++----------- src/parse/state/text.ts | 4 +-- .../samples/action-with-call/output.json | 5 +-- .../action-with-identifier/output.json | 5 +-- .../samples/action-with-literal/output.json | 5 +-- test/parser/samples/action/output.json | 5 +-- test/parser/samples/animation/output.json | 6 ++-- .../attribute-containing-solidus/output.json | 7 ++-- .../attribute-dynamic-boolean/output.json | 5 +-- .../attribute-dynamic-reserved/output.json | 5 +-- .../samples/attribute-dynamic/output.json | 9 +++-- .../samples/attribute-escaped/output.json | 9 ++--- .../samples/attribute-multiple/output.json | 7 ++-- .../samples/attribute-shorthand/output.json | 5 +-- .../attribute-static-boolean/output.json | 5 +-- .../samples/attribute-static/output.json | 6 ++-- .../samples/attribute-unquoted/output.json | 6 ++-- .../samples/await-then-catch/output.json | 28 +++++++++------ .../samples/binding-shorthand/output.json | 1 + test/parser/samples/binding/output.json | 1 + test/parser/samples/comment/output.json | 5 +-- .../samples/component-dynamic/output.json | 5 +-- .../convert-entities-in-element/output.json | 9 ++--- .../samples/convert-entities/output.json | 9 ++--- test/parser/samples/css/output.json | 6 ++-- .../parser/samples/dynamic-import/output.json | 5 ++- .../each-block-destructured/output.json | 8 ++--- .../samples/each-block-else/output.json | 6 ++-- .../samples/each-block-indexed/output.json | 6 ++-- .../samples/each-block-keyed/output.json | 5 +-- test/parser/samples/each-block/output.json | 5 +-- .../samples/element-with-mustache/output.json | 7 ++-- .../samples/element-with-text/output.json | 6 ++-- test/parser/samples/elements/output.json | 5 +-- test/parser/samples/event-handler/output.json | 10 +++--- test/parser/samples/if-block-else/output.json | 7 ++-- .../samples/if-block-elseif/output.json | 2 ++ test/parser/samples/if-block/output.json | 6 ++-- .../samples/implicitly-closed-li/output.json | 9 ++--- test/parser/samples/nbsp/output.json | 9 ++--- test/parser/samples/raw-mustaches/output.json | 8 ++--- test/parser/samples/refs/output.json | 1 + .../samples/script-comment-only/output.json | 1 + .../output.json | 3 ++ .../script-comment-trailing/output.json | 3 ++ test/parser/samples/script/output.json | 3 ++ .../samples/self-closing-element/output.json | 5 +-- .../parser/samples/self-reference/output.json | 5 +-- .../space-between-mustaches/output.json | 9 ++--- test/parser/samples/spread/output.json | 5 +-- .../samples/textarea-children/output.json | 9 +++-- .../transition-intro-no-params/output.json | 6 ++-- .../samples/transition-intro/output.json | 6 ++-- .../samples/unusual-identifier/output.json | 5 +-- .../whitespace-leading-trailing/output.json | 7 ++-- .../samples/whitespace-normal/output.json | 8 ++--- test/parser/samples/yield/output.json | 5 +-- 57 files changed, 150 insertions(+), 229 deletions(-) diff --git a/src/parse/state/tag.ts b/src/parse/state/tag.ts index d6e9706714..108cfce3e1 100644 --- a/src/parse/state/tag.ts +++ b/src/parse/state/tag.ts @@ -476,35 +476,28 @@ function read_sequence(parser: Parser, done: () => boolean): Node[] { start: parser.index, end: null, type: 'Text', - data: '', + raw: '', + data: null }; + function flush() { + if (current_chunk.raw) { + current_chunk.data = decode_character_references(current_chunk.raw); + current_chunk.end = parser.index; + chunks.push(current_chunk); + } + } + const chunks: Node[] = []; while (parser.index < parser.template.length) { const index = parser.index; if (done()) { - current_chunk.end = parser.index; - - if (current_chunk.data) chunks.push(current_chunk); - - chunks.forEach(chunk => { - if (chunk.type === 'Text') { - let decoded = decode_character_references(chunk.data); - if (chunk.data != decoded) { - chunk.raw = chunk.data; - chunk.data = decoded; - } - } - }); - + flush(); return chunks; } else if (parser.eat('{')) { - if (current_chunk.data) { - current_chunk.end = index; - chunks.push(current_chunk); - } + flush(); parser.allow_whitespace(); const expression = read_expression(parser); @@ -522,10 +515,11 @@ function read_sequence(parser: Parser, done: () => boolean): Node[] { start: parser.index, end: null, type: 'Text', - data: '', + raw: '', + data: null }; } else { - current_chunk.data += parser.template[parser.index++]; + current_chunk.raw += parser.template[parser.index++]; } } diff --git a/src/parse/state/text.ts b/src/parse/state/text.ts index 503d79aa08..1d9099055e 100644 --- a/src/parse/state/text.ts +++ b/src/parse/state/text.ts @@ -18,11 +18,9 @@ export default function text(parser: Parser) { start, end: parser.index, type: 'Text', + raw: data, data: decode_character_references(data), }; - if (node.data != data) - node.raw = data; - parser.current().children.push(node); } diff --git a/test/parser/samples/action-with-call/output.json b/test/parser/samples/action-with-call/output.json index d6aaa72892..e910f0b49f 100644 --- a/test/parser/samples/action-with-call/output.json +++ b/test/parser/samples/action-with-call/output.json @@ -41,8 +41,5 @@ "children": [] } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/action-with-identifier/output.json b/test/parser/samples/action-with-identifier/output.json index d58b9097b7..435aee4444 100644 --- a/test/parser/samples/action-with-identifier/output.json +++ b/test/parser/samples/action-with-identifier/output.json @@ -27,8 +27,5 @@ "children": [] } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/action-with-literal/output.json b/test/parser/samples/action-with-literal/output.json index 4a6f596d10..01a6b67549 100644 --- a/test/parser/samples/action-with-literal/output.json +++ b/test/parser/samples/action-with-literal/output.json @@ -28,8 +28,5 @@ "children": [] } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/action/output.json b/test/parser/samples/action/output.json index 2f553b5efa..9828e200dd 100644 --- a/test/parser/samples/action/output.json +++ b/test/parser/samples/action/output.json @@ -22,8 +22,5 @@ "children": [] } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/animation/output.json b/test/parser/samples/animation/output.json index 8332b3ad04..f4d183eb5c 100644 --- a/test/parser/samples/animation/output.json +++ b/test/parser/samples/animation/output.json @@ -35,6 +35,7 @@ "start": 51, "end": 56, "type": "Text", + "raw": "flips", "data": "flips" } ] @@ -54,8 +55,5 @@ } } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/attribute-containing-solidus/output.json b/test/parser/samples/attribute-containing-solidus/output.json index 95372bd77d..f1158b4f50 100644 --- a/test/parser/samples/attribute-containing-solidus/output.json +++ b/test/parser/samples/attribute-containing-solidus/output.json @@ -20,6 +20,7 @@ "start": 8, "end": 30, "type": "Text", + "raw": "https://www.google.com", "data": "https://www.google.com" } ] @@ -30,13 +31,11 @@ "start": 31, "end": 37, "type": "Text", + "raw": "Google", "data": "Google" } ] } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/attribute-dynamic-boolean/output.json b/test/parser/samples/attribute-dynamic-boolean/output.json index 81a19f49b9..478144152a 100644 --- a/test/parser/samples/attribute-dynamic-boolean/output.json +++ b/test/parser/samples/attribute-dynamic-boolean/output.json @@ -33,8 +33,5 @@ "children": [] } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/attribute-dynamic-reserved/output.json b/test/parser/samples/attribute-dynamic-reserved/output.json index 3a830d448f..22be3c9087 100644 --- a/test/parser/samples/attribute-dynamic-reserved/output.json +++ b/test/parser/samples/attribute-dynamic-reserved/output.json @@ -33,8 +33,5 @@ "children": [] } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/attribute-dynamic/output.json b/test/parser/samples/attribute-dynamic/output.json index 50d8ec60a5..a48f376876 100644 --- a/test/parser/samples/attribute-dynamic/output.json +++ b/test/parser/samples/attribute-dynamic/output.json @@ -18,8 +18,9 @@ "value": [ { "start": 12, - "end": 19, + "end": 20, "type": "Text", + "raw": "color: ", "data": "color: " }, { @@ -37,6 +38,7 @@ "start": 26, "end": 27, "type": "Text", + "raw": ";", "data": ";" } ] @@ -57,8 +59,5 @@ ] } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/attribute-escaped/output.json b/test/parser/samples/attribute-escaped/output.json index 79b135eb86..e60a8c2531 100644 --- a/test/parser/samples/attribute-escaped/output.json +++ b/test/parser/samples/attribute-escaped/output.json @@ -20,8 +20,8 @@ "start": 15, "end": 33, "type": "Text", - "data": "\"quoted\"", - "raw": ""quoted"" + "raw": ""quoted"", + "data": "\"quoted\"" } ] } @@ -29,8 +29,5 @@ "children": [] } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/attribute-multiple/output.json b/test/parser/samples/attribute-multiple/output.json index 668409c0ef..c4be13e6ee 100644 --- a/test/parser/samples/attribute-multiple/output.json +++ b/test/parser/samples/attribute-multiple/output.json @@ -20,6 +20,7 @@ "start": 9, "end": 10, "type": "Text", + "raw": "x", "data": "x" } ] @@ -34,6 +35,7 @@ "start": 19, "end": 20, "type": "Text", + "raw": "y", "data": "y" } ] @@ -42,8 +44,5 @@ "children": [] } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/attribute-shorthand/output.json b/test/parser/samples/attribute-shorthand/output.json index 08ddf5eda9..f23e62b04e 100644 --- a/test/parser/samples/attribute-shorthand/output.json +++ b/test/parser/samples/attribute-shorthand/output.json @@ -33,8 +33,5 @@ "children": [] } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/attribute-static-boolean/output.json b/test/parser/samples/attribute-static-boolean/output.json index f63b5734e0..7d635004c1 100644 --- a/test/parser/samples/attribute-static-boolean/output.json +++ b/test/parser/samples/attribute-static-boolean/output.json @@ -21,8 +21,5 @@ "children": [] } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/attribute-static/output.json b/test/parser/samples/attribute-static/output.json index 3185e48736..37b41d9a89 100644 --- a/test/parser/samples/attribute-static/output.json +++ b/test/parser/samples/attribute-static/output.json @@ -20,6 +20,7 @@ "start": 12, "end": 15, "type": "Text", + "raw": "foo", "data": "foo" } ] @@ -28,8 +29,5 @@ "children": [] } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/attribute-unquoted/output.json b/test/parser/samples/attribute-unquoted/output.json index c7556f2eba..11fa397819 100644 --- a/test/parser/samples/attribute-unquoted/output.json +++ b/test/parser/samples/attribute-unquoted/output.json @@ -20,6 +20,7 @@ "start": 11, "end": 14, "type": "Text", + "raw": "foo", "data": "foo" } ] @@ -28,8 +29,5 @@ "children": [] } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/await-then-catch/output.json b/test/parser/samples/await-then-catch/output.json index f62ad16574..ac598a403a 100644 --- a/test/parser/samples/await-then-catch/output.json +++ b/test/parser/samples/await-then-catch/output.json @@ -19,13 +19,13 @@ "pending": { "start": 19, "end": 39, - "skip": false, "type": "PendingBlock", "children": [ { "start": 19, "end": 21, "type": "Text", + "raw": "\n\t", "data": "\n\t" }, { @@ -39,6 +39,7 @@ "start": 24, "end": 34, "type": "Text", + "raw": "loading...", "data": "loading..." } ] @@ -47,20 +48,22 @@ "start": 38, "end": 39, "type": "Text", + "raw": "\n", "data": "\n" } - ] + ], + "skip": false }, "then": { "start": 39, "end": 88, - "skip": false, "type": "ThenBlock", "children": [ { "start": 55, "end": 57, "type": "Text", + "raw": "\n\t", "data": "\n\t" }, { @@ -74,6 +77,7 @@ "start": 60, "end": 73, "type": "Text", + "raw": "the value is ", "data": "the value is " }, { @@ -93,20 +97,22 @@ "start": 87, "end": 88, "type": "Text", + "raw": "\n", "data": "\n" } - ] + ], + "skip": false }, "catch": { "start": 88, "end": 140, - "skip": false, "type": "CatchBlock", "children": [ { "start": 105, "end": 107, "type": "Text", + "raw": "\n\t", "data": "\n\t" }, { @@ -120,6 +126,7 @@ "start": 110, "end": 117, "type": "Text", + "raw": "oh no! ", "data": "oh no! " }, { @@ -151,14 +158,13 @@ "start": 139, "end": 140, "type": "Text", + "raw": "\n", "data": "\n" } - ] + ], + "skip": false } } ] - }, - "css": null, - "instance": null, - "module": null -} + } +} \ No newline at end of file diff --git a/test/parser/samples/binding-shorthand/output.json b/test/parser/samples/binding-shorthand/output.json index 8f92101042..7fe7acb5b3 100644 --- a/test/parser/samples/binding-shorthand/output.json +++ b/test/parser/samples/binding-shorthand/output.json @@ -8,6 +8,7 @@ "start": 28, "end": 30, "type": "Text", + "raw": "\n\n", "data": "\n\n" }, { diff --git a/test/parser/samples/binding/output.json b/test/parser/samples/binding/output.json index d084050617..72ad60202c 100644 --- a/test/parser/samples/binding/output.json +++ b/test/parser/samples/binding/output.json @@ -8,6 +8,7 @@ "start": 29, "end": 31, "type": "Text", + "raw": "\n\n", "data": "\n\n" }, { diff --git a/test/parser/samples/comment/output.json b/test/parser/samples/comment/output.json index 89295c188a..2a57c4fa5d 100644 --- a/test/parser/samples/comment/output.json +++ b/test/parser/samples/comment/output.json @@ -11,8 +11,5 @@ "data": " a comment " } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/component-dynamic/output.json b/test/parser/samples/component-dynamic/output.json index c2e4e3ee79..77837d1ca9 100644 --- a/test/parser/samples/component-dynamic/output.json +++ b/test/parser/samples/component-dynamic/output.json @@ -36,8 +36,5 @@ } } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/convert-entities-in-element/output.json b/test/parser/samples/convert-entities-in-element/output.json index 92b5aafb00..c830c276de 100644 --- a/test/parser/samples/convert-entities-in-element/output.json +++ b/test/parser/samples/convert-entities-in-element/output.json @@ -15,14 +15,11 @@ "start": 3, "end": 20, "type": "Text", - "data": "Hello & World", - "raw": "Hello & World" + "raw": "Hello & World", + "data": "Hello & World" } ] } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/convert-entities/output.json b/test/parser/samples/convert-entities/output.json index 967895383d..f4cc1a6662 100644 --- a/test/parser/samples/convert-entities/output.json +++ b/test/parser/samples/convert-entities/output.json @@ -8,12 +8,9 @@ "start": 0, "end": 17, "type": "Text", - "data": "Hello & World", - "raw": "Hello & World" + "raw": "Hello & World", + "data": "Hello & World" } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/css/output.json b/test/parser/samples/css/output.json index 3127e01c71..12d74ae7f8 100644 --- a/test/parser/samples/css/output.json +++ b/test/parser/samples/css/output.json @@ -15,6 +15,7 @@ "start": 5, "end": 8, "type": "Text", + "raw": "foo", "data": "foo" } ] @@ -23,6 +24,7 @@ "start": 14, "end": 16, "type": "Text", + "raw": "\n\n", "data": "\n\n" } ] @@ -90,7 +92,5 @@ "end": 48, "styles": "\n\tdiv {\n\t\tcolor: red;\n\t}\n" } - }, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/dynamic-import/output.json b/test/parser/samples/dynamic-import/output.json index c0d4a45e0d..fa1acf7d9b 100644 --- a/test/parser/samples/dynamic-import/output.json +++ b/test/parser/samples/dynamic-import/output.json @@ -5,7 +5,6 @@ "type": "Fragment", "children": [] }, - "css": null, "instance": { "start": 0, "end": 146, @@ -66,8 +65,8 @@ "start": 54, "end": 134, "id": null, - "generator": false, "expression": false, + "generator": false, "async": false, "params": [], "body": { @@ -120,8 +119,8 @@ "start": 88, "end": 129, "id": null, - "generator": false, "expression": false, + "generator": false, "async": false, "params": [ { diff --git a/test/parser/samples/each-block-destructured/output.json b/test/parser/samples/each-block-destructured/output.json index 0c4b1a5c54..6368b445d6 100644 --- a/test/parser/samples/each-block-destructured/output.json +++ b/test/parser/samples/each-block-destructured/output.json @@ -37,6 +37,7 @@ "start": 50, "end": 52, "type": "Text", + "raw": ": ", "data": ": " }, { @@ -80,8 +81,5 @@ } } ] - }, - "css": null, - "instance": null, - "module": null -} + } +} \ No newline at end of file diff --git a/test/parser/samples/each-block-else/output.json b/test/parser/samples/each-block-else/output.json index aefc8c2f39..1e8ac455e6 100644 --- a/test/parser/samples/each-block-else/output.json +++ b/test/parser/samples/each-block-else/output.json @@ -58,6 +58,7 @@ "start": 55, "end": 65, "type": "Text", + "raw": "no animals", "data": "no animals" } ] @@ -66,8 +67,5 @@ } } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/each-block-indexed/output.json b/test/parser/samples/each-block-indexed/output.json index 7518652468..77417ba67a 100644 --- a/test/parser/samples/each-block-indexed/output.json +++ b/test/parser/samples/each-block-indexed/output.json @@ -37,6 +37,7 @@ "start": 36, "end": 38, "type": "Text", + "raw": ": ", "data": ": " }, { @@ -62,8 +63,5 @@ "index": "i" } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/each-block-keyed/output.json b/test/parser/samples/each-block-keyed/output.json index fe893bcdb9..11cdd45ff1 100644 --- a/test/parser/samples/each-block-keyed/output.json +++ b/test/parser/samples/each-block-keyed/output.json @@ -62,8 +62,5 @@ } } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/each-block/output.json b/test/parser/samples/each-block/output.json index c16a71ad5d..6a60823952 100644 --- a/test/parser/samples/each-block/output.json +++ b/test/parser/samples/each-block/output.json @@ -44,8 +44,5 @@ } } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/element-with-mustache/output.json b/test/parser/samples/element-with-mustache/output.json index c8a386d681..f7c2e9936b 100644 --- a/test/parser/samples/element-with-mustache/output.json +++ b/test/parser/samples/element-with-mustache/output.json @@ -15,6 +15,7 @@ "start": 4, "end": 10, "type": "Text", + "raw": "hello ", "data": "hello " }, { @@ -32,13 +33,11 @@ "start": 16, "end": 17, "type": "Text", + "raw": "!", "data": "!" } ] } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/element-with-text/output.json b/test/parser/samples/element-with-text/output.json index 70f6163c93..b0e0f5c6cc 100644 --- a/test/parser/samples/element-with-text/output.json +++ b/test/parser/samples/element-with-text/output.json @@ -15,13 +15,11 @@ "start": 6, "end": 10, "type": "Text", + "raw": "test", "data": "test" } ] } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/elements/output.json b/test/parser/samples/elements/output.json index d216f7f5d8..75548c20f0 100644 --- a/test/parser/samples/elements/output.json +++ b/test/parser/samples/elements/output.json @@ -21,8 +21,5 @@ "children": [] } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/event-handler/output.json b/test/parser/samples/event-handler/output.json index b1fe89fc2a..f792ffadcc 100644 --- a/test/parser/samples/event-handler/output.json +++ b/test/parser/samples/event-handler/output.json @@ -21,8 +21,8 @@ "start": 19, "end": 43, "id": null, - "generator": false, "expression": true, + "generator": false, "async": false, "params": [], "body": { @@ -58,6 +58,7 @@ "start": 46, "end": 52, "type": "Text", + "raw": "toggle", "data": "toggle" } ] @@ -66,6 +67,7 @@ "start": 61, "end": 63, "type": "Text", + "raw": "\n\n", "data": "\n\n" }, { @@ -90,6 +92,7 @@ "start": 81, "end": 87, "type": "Text", + "raw": "hello!", "data": "hello!" } ] @@ -97,8 +100,5 @@ ] } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/if-block-else/output.json b/test/parser/samples/if-block-else/output.json index dedf2797c4..8b22cfa26b 100644 --- a/test/parser/samples/if-block-else/output.json +++ b/test/parser/samples/if-block-else/output.json @@ -26,6 +26,7 @@ "start": 14, "end": 17, "type": "Text", + "raw": "foo", "data": "foo" } ] @@ -47,6 +48,7 @@ "start": 34, "end": 41, "type": "Text", + "raw": "not foo", "data": "not foo" } ] @@ -55,8 +57,5 @@ } } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/if-block-elseif/output.json b/test/parser/samples/if-block-elseif/output.json index 188b57aaad..54fb53dacb 100644 --- a/test/parser/samples/if-block-elseif/output.json +++ b/test/parser/samples/if-block-elseif/output.json @@ -39,6 +39,7 @@ "start": 17, "end": 37, "type": "Text", + "raw": "x is greater than 10", "data": "x is greater than 10" } ] @@ -85,6 +86,7 @@ "start": 63, "end": 79, "type": "Text", + "raw": "x is less than 5", "data": "x is less than 5" } ] diff --git a/test/parser/samples/if-block/output.json b/test/parser/samples/if-block/output.json index d560824766..1714bb7141 100644 --- a/test/parser/samples/if-block/output.json +++ b/test/parser/samples/if-block/output.json @@ -19,13 +19,11 @@ "start": 9, "end": 12, "type": "Text", + "raw": "bar", "data": "bar" } ] } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/implicitly-closed-li/output.json b/test/parser/samples/implicitly-closed-li/output.json index caf69d7109..f46a2b1a26 100644 --- a/test/parser/samples/implicitly-closed-li/output.json +++ b/test/parser/samples/implicitly-closed-li/output.json @@ -15,6 +15,7 @@ "start": 4, "end": 6, "type": "Text", + "raw": "\n\t", "data": "\n\t" }, { @@ -28,6 +29,7 @@ "start": 10, "end": 13, "type": "Text", + "raw": "a\n\t", "data": "a\n\t" } ] @@ -43,6 +45,7 @@ "start": 17, "end": 20, "type": "Text", + "raw": "b\n\t", "data": "b\n\t" } ] @@ -58,6 +61,7 @@ "start": 24, "end": 26, "type": "Text", + "raw": "c\n", "data": "c\n" } ] @@ -65,8 +69,5 @@ ] } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/nbsp/output.json b/test/parser/samples/nbsp/output.json index c47257c873..044de64cba 100644 --- a/test/parser/samples/nbsp/output.json +++ b/test/parser/samples/nbsp/output.json @@ -15,14 +15,11 @@ "start": 6, "end": 12, "type": "Text", - "data": " ", - "raw": " " + "raw": " ", + "data": " " } ] } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/raw-mustaches/output.json b/test/parser/samples/raw-mustaches/output.json index 1d92b21c85..1b3d9b7a9c 100644 --- a/test/parser/samples/raw-mustaches/output.json +++ b/test/parser/samples/raw-mustaches/output.json @@ -15,6 +15,7 @@ "start": 3, "end": 4, "type": "Text", + "raw": " ", "data": " " }, { @@ -32,6 +33,7 @@ "start": 16, "end": 17, "type": "Text", + "raw": " ", "data": " " }, { @@ -49,13 +51,11 @@ "start": 29, "end": 30, "type": "Text", + "raw": " ", "data": " " } ] } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/refs/output.json b/test/parser/samples/refs/output.json index d15753b0a2..e09383f9b6 100644 --- a/test/parser/samples/refs/output.json +++ b/test/parser/samples/refs/output.json @@ -8,6 +8,7 @@ "start": 28, "end": 30, "type": "Text", + "raw": "\n\n", "data": "\n\n" }, { diff --git a/test/parser/samples/script-comment-only/output.json b/test/parser/samples/script-comment-only/output.json index 95ca769b20..ba28434318 100644 --- a/test/parser/samples/script-comment-only/output.json +++ b/test/parser/samples/script-comment-only/output.json @@ -8,6 +8,7 @@ "start": 43, "end": 45, "type": "Text", + "raw": "\n\n", "data": "\n\n" }, { diff --git a/test/parser/samples/script-comment-trailing-multiline/output.json b/test/parser/samples/script-comment-trailing-multiline/output.json index d4a45911a1..7d01599efa 100644 --- a/test/parser/samples/script-comment-trailing-multiline/output.json +++ b/test/parser/samples/script-comment-trailing-multiline/output.json @@ -8,6 +8,7 @@ "start": 77, "end": 79, "type": "Text", + "raw": "\n\n", "data": "\n\n" }, { @@ -21,6 +22,7 @@ "start": 83, "end": 89, "type": "Text", + "raw": "Hello ", "data": "Hello " }, { @@ -38,6 +40,7 @@ "start": 95, "end": 96, "type": "Text", + "raw": "!", "data": "!" } ] diff --git a/test/parser/samples/script-comment-trailing/output.json b/test/parser/samples/script-comment-trailing/output.json index 92d431b558..bc8f3e4e67 100644 --- a/test/parser/samples/script-comment-trailing/output.json +++ b/test/parser/samples/script-comment-trailing/output.json @@ -8,6 +8,7 @@ "start": 66, "end": 68, "type": "Text", + "raw": "\n\n", "data": "\n\n" }, { @@ -21,6 +22,7 @@ "start": 72, "end": 78, "type": "Text", + "raw": "Hello ", "data": "Hello " }, { @@ -38,6 +40,7 @@ "start": 84, "end": 85, "type": "Text", + "raw": "!", "data": "!" } ] diff --git a/test/parser/samples/script/output.json b/test/parser/samples/script/output.json index 95966f5dc6..75aa0a7d2c 100644 --- a/test/parser/samples/script/output.json +++ b/test/parser/samples/script/output.json @@ -8,6 +8,7 @@ "start": 39, "end": 41, "type": "Text", + "raw": "\n\n", "data": "\n\n" }, { @@ -21,6 +22,7 @@ "start": 45, "end": 51, "type": "Text", + "raw": "Hello ", "data": "Hello " }, { @@ -38,6 +40,7 @@ "start": 57, "end": 58, "type": "Text", + "raw": "!", "data": "!" } ] diff --git a/test/parser/samples/self-closing-element/output.json b/test/parser/samples/self-closing-element/output.json index 47eea2f333..63ff17a466 100644 --- a/test/parser/samples/self-closing-element/output.json +++ b/test/parser/samples/self-closing-element/output.json @@ -13,8 +13,5 @@ "children": [] } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/self-reference/output.json b/test/parser/samples/self-reference/output.json index de5112a087..92dfdfe4d0 100644 --- a/test/parser/samples/self-reference/output.json +++ b/test/parser/samples/self-reference/output.json @@ -72,8 +72,5 @@ ] } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/space-between-mustaches/output.json b/test/parser/samples/space-between-mustaches/output.json index c89409daeb..9a367bd2c1 100644 --- a/test/parser/samples/space-between-mustaches/output.json +++ b/test/parser/samples/space-between-mustaches/output.json @@ -15,6 +15,7 @@ "start": 3, "end": 4, "type": "Text", + "raw": " ", "data": " " }, { @@ -32,6 +33,7 @@ "start": 7, "end": 8, "type": "Text", + "raw": " ", "data": " " }, { @@ -49,6 +51,7 @@ "start": 11, "end": 14, "type": "Text", + "raw": " : ", "data": " : " }, { @@ -66,13 +69,11 @@ "start": 17, "end": 20, "type": "Text", + "raw": " : ", "data": " : " } ] } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/spread/output.json b/test/parser/samples/spread/output.json index 3986da3578..73a0dc9777 100644 --- a/test/parser/samples/spread/output.json +++ b/test/parser/samples/spread/output.json @@ -25,8 +25,5 @@ "children": [] } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/textarea-children/output.json b/test/parser/samples/textarea-children/output.json index 3b403458fc..90f31f3caf 100644 --- a/test/parser/samples/textarea-children/output.json +++ b/test/parser/samples/textarea-children/output.json @@ -16,8 +16,9 @@ "value": [ { "start": 10, - "end": 40, + "end": 41, "type": "Text", + "raw": "\n\t

      not actually an element. ", "data": "\n\t

      not actually an element. " }, { @@ -35,6 +36,7 @@ "start": 45, "end": 50, "type": "Text", + "raw": "

      \n", "data": "

      \n" } ] @@ -43,8 +45,5 @@ "children": [] } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/transition-intro-no-params/output.json b/test/parser/samples/transition-intro-no-params/output.json index edb15457e6..91b50f3ec8 100644 --- a/test/parser/samples/transition-intro-no-params/output.json +++ b/test/parser/samples/transition-intro-no-params/output.json @@ -26,13 +26,11 @@ "start": 13, "end": 21, "type": "Text", + "raw": "fades in", "data": "fades in" } ] } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/transition-intro/output.json b/test/parser/samples/transition-intro/output.json index 5583dd89bc..418bb97e16 100644 --- a/test/parser/samples/transition-intro/output.json +++ b/test/parser/samples/transition-intro/output.json @@ -54,13 +54,11 @@ "start": 31, "end": 39, "type": "Text", + "raw": "fades in", "data": "fades in" } ] } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/unusual-identifier/output.json b/test/parser/samples/unusual-identifier/output.json index c0d4ecc3ff..e4a2a18619 100644 --- a/test/parser/samples/unusual-identifier/output.json +++ b/test/parser/samples/unusual-identifier/output.json @@ -44,8 +44,5 @@ } } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/whitespace-leading-trailing/output.json b/test/parser/samples/whitespace-leading-trailing/output.json index f164af01ba..e4f387856e 100644 --- a/test/parser/samples/whitespace-leading-trailing/output.json +++ b/test/parser/samples/whitespace-leading-trailing/output.json @@ -8,6 +8,7 @@ "start": 0, "end": 6, "type": "Text", + "raw": "\n\n\t\t\t\t", "data": "\n\n\t\t\t\t" }, { @@ -21,13 +22,11 @@ "start": 9, "end": 32, "type": "Text", + "raw": "just chillin' over here", "data": "just chillin' over here" } ] } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/whitespace-normal/output.json b/test/parser/samples/whitespace-normal/output.json index e4ce956331..acbae7ae17 100644 --- a/test/parser/samples/whitespace-normal/output.json +++ b/test/parser/samples/whitespace-normal/output.json @@ -15,6 +15,7 @@ "start": 4, "end": 10, "type": "Text", + "raw": "Hello ", "data": "Hello " }, { @@ -39,6 +40,7 @@ "start": 24, "end": 26, "type": "Text", + "raw": "! ", "data": "! " } ] @@ -54,6 +56,7 @@ "start": 41, "end": 53, "type": "Text", + "raw": "How are you?", "data": "How are you?" } ] @@ -61,8 +64,5 @@ ] } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file diff --git a/test/parser/samples/yield/output.json b/test/parser/samples/yield/output.json index 16ea79d8e8..b2e4b9430f 100644 --- a/test/parser/samples/yield/output.json +++ b/test/parser/samples/yield/output.json @@ -16,8 +16,5 @@ } } ] - }, - "css": null, - "instance": null, - "module": null + } } \ No newline at end of file From fe552fbf1d746f55080009b5a7eee8e162c29910 Mon Sep 17 00:00:00 2001 From: Harald Fassler Date: Sun, 26 May 2019 14:48:52 +0200 Subject: [PATCH 050/409] Update animations.js Fix issue #2871 --- src/internal/animations.js | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/internal/animations.js b/src/internal/animations.js index 8d55c196ee..342eeec9fd 100644 --- a/src/internal/animations.js +++ b/src/internal/animations.js @@ -22,15 +22,14 @@ export function create_animation(node, from, fn, params) { let started = false; let name; - const css_text = node.style.cssText; - function start() { if (css) { - if (delay) node.style.cssText = css_text; // TODO create delayed animation instead? - name = create_rule(node, 0, 1, duration, 0, easing, css); + name = create_rule(node, 0, 1, duration, delay, easing, css); } - started = true; + if (!delay) { + started = true; + } } function stop() { @@ -40,7 +39,7 @@ export function create_animation(node, from, fn, params) { loop(now => { if (!started && now >= start_time) { - start(); + started = true; } if (started && now >= end) { @@ -61,11 +60,7 @@ export function create_animation(node, from, fn, params) { return true; }); - if (delay) { - if (css) node.style.cssText += css(0, 1); - } else { - start(); - } + start(); tick(0, 1); From 04af24916a41e408f9407f79535428645bc071bc Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Sun, 26 May 2019 14:59:38 +0200 Subject: [PATCH 051/409] -> v3.4.3 --- CHANGELOG.md | 9 +++++++++ package.json | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02d42ddc8c..4981ca096b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Svelte changelog +## 3.4.3 + +* Add type declaration files for everything ([#2842](https://github.com/sveltejs/svelte/pull/2842)) +* Prevent `svelte/store` being bundled ([#2786](https://github.com/sveltejs/svelte/issues/2786)) +* Warn on unknown props in dev mode ([#2840](https://github.com/sveltejs/svelte/pull/2840)) +* Treat `requestAnimationFrame` as a no-op on the server ([#2856](https://github.com/sveltejs/svelte/pull/2856)) +* Add `raw` property to AST's `Text` nodes ([#2714](https://github.com/sveltejs/svelte/issues/2714)) +* Add `
      ` ([#2854](https://github.com/sveltejs/svelte/issues/2854)) + ## 3.4.2 * Use empty string for empty data attributes ([#2804](https://github.com/sveltejs/svelte/pull/2804)) diff --git a/package.json b/package.json index 7963e2178d..b7214c9254 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "svelte", - "version": "3.4.2", + "version": "3.4.3", "description": "Cybernetically enhanced web apps", "module": "index.mjs", "main": "index", From 2f5d755b5be7c04f208cbeb7d14beab2cf879344 Mon Sep 17 00:00:00 2001 From: Brian Takita Date: Sun, 26 May 2019 02:11:54 -0400 Subject: [PATCH 052/409] Additional detail to jsdocs for writable, readable, & derived Fixes https://github.com/sveltejs/svelte/issues/2867 --- src/store.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/store.ts b/src/store.ts index 361632b61d..a957ea66aa 100644 --- a/src/store.ts +++ b/src/store.ts @@ -45,8 +45,8 @@ type SubscribeInvalidateTuple = [Subscriber, Invalidater]; /** * Creates a `Readable` store that allows reading by subscription. - * @param value initial value - * @param start start and stop notifications for subscriptions + * @param [value] initial value + * @param [start] start and stop notifications for subscriptions */ export function readable(value: T, start: StartStopNotifier): Readable { return { @@ -56,8 +56,8 @@ export function readable(value: T, start: StartStopNotifier): Readable /** * Create a `Writable` store that allows both updating and reading by subscription. - * @param value initial value - * @param start start and stop notifications for subscriptions + * @param [value] initial value + * @param {StartStopNotifier}[start] start and stop notifications for subscriptions */ export function writable(value: T, start: StartStopNotifier = noop): Writable { let stop: Unsubscriber; @@ -110,9 +110,9 @@ type StoresValues = T extends Readable ? U : /** * Derived value store by synchronizing one or more readable stores and * applying an aggregation function over its input values. - * @param stores input stores - * @param fn function callback that aggregates the values - * @param initial_value when used asynchronously + * @param {Stores} stores input stores + * @param {function(StoresValues,[Subscriber])|Unsubscriber|void}fn function callback that aggregates the values + * @param [initial_value] when used asynchronously */ export function derived( stores: S, From 6fc7001993e31b9d93f37bce4a6fae92fe691c00 Mon Sep 17 00:00:00 2001 From: Brian Takita Date: Sun, 26 May 2019 10:15:13 -0400 Subject: [PATCH 053/409] Apply suggestions from code review Co-Authored-By: Rich Harris --- src/store.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/store.ts b/src/store.ts index a957ea66aa..aff15ff2ca 100644 --- a/src/store.ts +++ b/src/store.ts @@ -45,8 +45,8 @@ type SubscribeInvalidateTuple = [Subscriber, Invalidater]; /** * Creates a `Readable` store that allows reading by subscription. - * @param [value] initial value - * @param [start] start and stop notifications for subscriptions + * @param value initial value + * @param {StartStopNotifier}start start and stop notifications for subscriptions */ export function readable(value: T, start: StartStopNotifier): Readable { return { From a98a70cf832b66f1414caa9156b30f8da3ec9830 Mon Sep 17 00:00:00 2001 From: Brian Takita Date: Sun, 26 May 2019 10:51:49 -0400 Subject: [PATCH 054/409] jsdoc: `derived` second argument * optional first argument is a Stores type * optional second argument is a function that takes a single argument * has a return value --- src/store.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/store.ts b/src/store.ts index aff15ff2ca..e7db228401 100644 --- a/src/store.ts +++ b/src/store.ts @@ -56,8 +56,8 @@ export function readable(value: T, start: StartStopNotifier): Readable /** * Create a `Writable` store that allows both updating and reading by subscription. - * @param [value] initial value - * @param {StartStopNotifier}[start] start and stop notifications for subscriptions + * @param {*=}value initial value + * @param {StartStopNotifier=}start start and stop notifications for subscriptions */ export function writable(value: T, start: StartStopNotifier = noop): Writable { let stop: Unsubscriber; @@ -111,8 +111,8 @@ type StoresValues = T extends Readable ? U : * Derived value store by synchronizing one or more readable stores and * applying an aggregation function over its input values. * @param {Stores} stores input stores - * @param {function(StoresValues,[Subscriber])|Unsubscriber|void}fn function callback that aggregates the values - * @param [initial_value] when used asynchronously + * @param {function(Stores=, function(*)=):*}fn function callback that aggregates the values + * @param {*=}initial_value when used asynchronously */ export function derived( stores: S, From 04dce6816851c08a4dd6da03d50145b4c099b7e6 Mon Sep 17 00:00:00 2001 From: Viet Truong Date: Sun, 26 May 2019 16:58:46 -0700 Subject: [PATCH 055/409] publish dist in order to get types --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index b7214c9254..66f433e675 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "module": "index.mjs", "main": "index", "files": [ + "dist", "compiler.js", "register.js", "index.*", From f0831202d9243f9f216693308b20b95add1df971 Mon Sep 17 00:00:00 2001 From: Colin Casey Date: Sun, 26 May 2019 23:44:24 -0300 Subject: [PATCH 056/409] Omits readonly attributes from SSR code * move `is_readonly` into the common `Binding` AST class * prevents the following bindings from being emitted into the SSR code: * `bind:clientWidth` * `bind:clientHeight` * `bind:offsetWidth` * `bind:offsetHeight` * `bind:duration` * `bind:buffered` * `bind:seekable` * `bind:played` * `bind:value` (only for `input` with `type=file`) --- src/compile/nodes/Binding.ts | 22 ++++++++++ src/compile/nodes/shared/Node.ts | 2 +- .../render-dom/wrappers/Element/Binding.ts | 18 +------- src/compile/render-ssr/handlers/Element.ts | 4 ++ .../samples/bindings-readonly/_expected.html | 4 ++ .../samples/bindings-readonly/main.svelte | 44 +++++++++++++++++++ 6 files changed, 77 insertions(+), 17 deletions(-) create mode 100644 test/server-side-rendering/samples/bindings-readonly/_expected.html create mode 100644 test/server-side-rendering/samples/bindings-readonly/main.svelte diff --git a/src/compile/nodes/Binding.ts b/src/compile/nodes/Binding.ts index 0d666a543f..e099f4405a 100644 --- a/src/compile/nodes/Binding.ts +++ b/src/compile/nodes/Binding.ts @@ -3,6 +3,15 @@ import get_object from '../utils/get_object'; import Expression from './shared/Expression'; import Component from '../Component'; import TemplateScope from './shared/TemplateScope'; +import {dimensions} from "../../utils/patterns"; + +// TODO this should live in a specific binding +const read_only_media_attributes = new Set([ + 'duration', + 'buffered', + 'seekable', + 'played' +]); export default class Binding extends Node { type: 'Binding'; @@ -11,6 +20,7 @@ export default class Binding extends Node { is_contextual: boolean; obj: string; prop: string; + is_readonly: boolean; constructor(component: Component, parent, scope: TemplateScope, info) { super(component, parent, scope, info); @@ -64,5 +74,17 @@ export default class Binding extends Node { this.obj = obj; this.prop = prop; + + const type = parent.get_static_attribute_value('type'); + + this.is_readonly = ( + dimensions.test(this.name) || + (parent.is_media_node && parent.is_media_node() && read_only_media_attributes.has(this.name)) || + (parent.name === 'input' && type === 'file') // TODO others? + ); + } + + is_readonly_media_attribute() { + return read_only_media_attributes.has(this.name); } } diff --git a/src/compile/nodes/shared/Node.ts b/src/compile/nodes/shared/Node.ts index b647e3a158..f27e4ceb62 100644 --- a/src/compile/nodes/shared/Node.ts +++ b/src/compile/nodes/shared/Node.ts @@ -47,7 +47,7 @@ export default class Node { } get_static_attribute_value(name: string) { - const attribute = this.attributes.find( + const attribute = this.attributes && this.attributes.find( (attr: Attribute) => attr.type === 'Attribute' && attr.name.toLowerCase() === name ); diff --git a/src/compile/render-dom/wrappers/Element/Binding.ts b/src/compile/render-dom/wrappers/Element/Binding.ts index a34a9466fc..b88479ad52 100644 --- a/src/compile/render-dom/wrappers/Element/Binding.ts +++ b/src/compile/render-dom/wrappers/Element/Binding.ts @@ -9,14 +9,6 @@ import flatten_reference from '../../../utils/flatten_reference'; import EachBlock from '../../../nodes/EachBlock'; import { Node as INode } from '../../../../interfaces'; -// TODO this should live in a specific binding -const read_only_media_attributes = new Set([ - 'duration', - 'buffered', - 'seekable', - 'played' -]); - function get_tail(node: INode) { const end = node.end; while (node.type === 'MemberExpression') node = node.object; @@ -74,13 +66,7 @@ export default class BindingWrapper { this.snippet = this.node.expression.render(block); - const type = parent.node.get_static_attribute_value('type'); - - this.is_readonly = ( - dimensions.test(this.node.name) || - (parent.node.is_media_node() && read_only_media_attributes.has(this.node.name)) || - (parent.node.name === 'input' && type === 'file') // TODO others? - ); + this.is_readonly = this.node.is_readonly; this.needs_lock = this.node.name === 'currentTime'; // TODO others? } @@ -101,7 +87,7 @@ export default class BindingWrapper { } is_readonly_media_attribute() { - return read_only_media_attributes.has(this.node.name); + return this.node.is_readonly_media_attribute() } render(block: Block, lock: string) { diff --git a/src/compile/render-ssr/handlers/Element.ts b/src/compile/render-ssr/handlers/Element.ts index fc6bc5b969..5ed6875dec 100644 --- a/src/compile/render-ssr/handlers/Element.ts +++ b/src/compile/render-ssr/handlers/Element.ts @@ -140,6 +140,10 @@ export default function(node: Element, renderer: Renderer, options: RenderOption node.bindings.forEach(binding => { const { name, expression } = binding; + if (binding.is_readonly) { + return; + } + if (name === 'group') { // TODO server-render group bindings } else { diff --git a/test/server-side-rendering/samples/bindings-readonly/_expected.html b/test/server-side-rendering/samples/bindings-readonly/_expected.html new file mode 100644 index 0000000000..af678acde0 --- /dev/null +++ b/test/server-side-rendering/samples/bindings-readonly/_expected.html @@ -0,0 +1,4 @@ +
      + + + diff --git a/test/server-side-rendering/samples/bindings-readonly/main.svelte b/test/server-side-rendering/samples/bindings-readonly/main.svelte new file mode 100644 index 0000000000..3ff98a3ead --- /dev/null +++ b/test/server-side-rendering/samples/bindings-readonly/main.svelte @@ -0,0 +1,44 @@ + + +
      + + + + + + From 7071ce86f533ff3eade1a3432a07c6e033123ec7 Mon Sep 17 00:00:00 2001 From: cudr Date: Mon, 27 May 2019 12:20:01 +0300 Subject: [PATCH 057/409] add tests --- src/compile/render-dom/wrappers/Head.ts | 4 +-- src/compile/render-dom/wrappers/IfBlock.ts | 25 +++++++++++------- test/runtime/samples/head-if-block/_config.js | 2 +- .../runtime/samples/head-if-block/main.svelte | 2 +- .../samples/head-if-else-block/_config.js | 14 ++++++++++ .../samples/head-if-else-block/main.svelte | 11 ++++++++ .../head-if-else-raw-dynamic/_config.js | 19 ++++++++++++++ .../head-if-else-raw-dynamic/main.svelte | 11 ++++++++ .../samples/head-raw-dynamic/Bar.svelte | 11 ++++++++ .../samples/head-raw-dynamic/Foo.svelte | 7 +++++ .../samples/head-raw-dynamic/_config.js | 26 +++++++++++++++++++ .../samples/head-raw-dynamic/main.svelte | 12 +++++++++ 12 files changed, 130 insertions(+), 14 deletions(-) create mode 100644 test/runtime/samples/head-if-else-block/_config.js create mode 100644 test/runtime/samples/head-if-else-block/main.svelte create mode 100644 test/runtime/samples/head-if-else-raw-dynamic/_config.js create mode 100644 test/runtime/samples/head-if-else-raw-dynamic/main.svelte create mode 100644 test/runtime/samples/head-raw-dynamic/Bar.svelte create mode 100644 test/runtime/samples/head-raw-dynamic/Foo.svelte create mode 100644 test/runtime/samples/head-raw-dynamic/_config.js create mode 100644 test/runtime/samples/head-raw-dynamic/main.svelte diff --git a/src/compile/render-dom/wrappers/Head.ts b/src/compile/render-dom/wrappers/Head.ts index 9eb1369b6a..dbd38c1c80 100644 --- a/src/compile/render-dom/wrappers/Head.ts +++ b/src/compile/render-dom/wrappers/Head.ts @@ -30,6 +30,6 @@ export default class HeadWrapper extends Wrapper { } render(block: Block, parent_node: string, parent_nodes: string) { - this.fragment.render(block, 'document.head', null); + this.fragment.render(block, 'document.head', 'nodes'); } -} \ No newline at end of file +} diff --git a/src/compile/render-dom/wrappers/IfBlock.ts b/src/compile/render-dom/wrappers/IfBlock.ts index f3b5c7f2b2..67a5c1e424 100644 --- a/src/compile/render-dom/wrappers/IfBlock.ts +++ b/src/compile/render-dom/wrappers/IfBlock.ts @@ -154,16 +154,18 @@ export default class IfBlockWrapper extends Wrapper { const vars = { name, anchor, if_name, has_else, has_transitions }; + const detaching = (parent_node && parent_node !== 'document.head') ? '' : 'detaching'; + if (this.node.else) { if (has_outros) { - this.render_compound_with_outros(block, parent_node, parent_nodes, dynamic, vars); + this.render_compound_with_outros(block, parent_node, parent_nodes, dynamic, vars, detaching); block.builders.outro.add_line(`if (${name}) ${name}.o();`); } else { - this.render_compound(block, parent_node, parent_nodes, dynamic, vars); + this.render_compound(block, parent_node, parent_nodes, dynamic, vars, detaching); } } else { - this.render_simple(block, parent_node, parent_nodes, dynamic, vars); + this.render_simple(block, parent_node, parent_nodes, dynamic, vars, detaching); if (has_outros) { block.builders.outro.add_line(`if (${name}) ${name}.o();`); @@ -201,7 +203,8 @@ export default class IfBlockWrapper extends Wrapper { parent_node: string, parent_nodes: string, dynamic, - { name, anchor, has_else, if_name, has_transitions } + { name, anchor, has_else, if_name, has_transitions }, + detaching ) { const select_block_type = this.renderer.component.get_unique_name(`select_block_type`); const current_block_type = block.get_unique_name(`current_block_type`); @@ -254,7 +257,7 @@ export default class IfBlockWrapper extends Wrapper { `); } - block.builders.destroy.add_line(`${if_name}${name}.d(${parent_node ? '' : 'detaching'});`); + block.builders.destroy.add_line(`${if_name}${name}.d(${detaching});`); } // if any of the siblings have outros, we need to keep references to the blocks @@ -264,7 +267,8 @@ export default class IfBlockWrapper extends Wrapper { parent_node: string, parent_nodes: string, dynamic, - { name, anchor, has_else, has_transitions } + { name, anchor, has_else, has_transitions }, + detaching ) { const select_block_type = this.renderer.component.get_unique_name(`select_block_type`); const current_block_type_index = block.get_unique_name(`current_block_type_index`); @@ -375,7 +379,7 @@ export default class IfBlockWrapper extends Wrapper { } block.builders.destroy.add_line(deindent` - ${if_current_block_type_index}${if_blocks}[${current_block_type_index}].d(${parent_node ? '' : 'detaching'}); + ${if_current_block_type_index}${if_blocks}[${current_block_type_index}].d(${detaching}); `); } @@ -384,7 +388,8 @@ export default class IfBlockWrapper extends Wrapper { parent_node: string, parent_nodes: string, dynamic, - { name, anchor, if_name, has_transitions } + { name, anchor, if_name, has_transitions }, + detaching ) { const branch = this.branches[0]; @@ -450,6 +455,6 @@ export default class IfBlockWrapper extends Wrapper { } `); - block.builders.destroy.add_line(`${if_name}${name}.d(${parent_node ? '' : 'detaching'});`); + block.builders.destroy.add_line(`${if_name}${name}.d(${detaching});`); } -} \ No newline at end of file +} diff --git a/test/runtime/samples/head-if-block/_config.js b/test/runtime/samples/head-if-block/_config.js index 26e1457be7..439ed2cb1b 100644 --- a/test/runtime/samples/head-if-block/_config.js +++ b/test/runtime/samples/head-if-block/_config.js @@ -9,4 +9,4 @@ export default { component.condition = true; assert.equal(window.document.title, 'woo!!!'); } -}; \ No newline at end of file +}; diff --git a/test/runtime/samples/head-if-block/main.svelte b/test/runtime/samples/head-if-block/main.svelte index a6b115bf28..1656278b9e 100644 --- a/test/runtime/samples/head-if-block/main.svelte +++ b/test/runtime/samples/head-if-block/main.svelte @@ -6,4 +6,4 @@ {#if condition} woo!!! {/if} - \ No newline at end of file + diff --git a/test/runtime/samples/head-if-else-block/_config.js b/test/runtime/samples/head-if-else-block/_config.js new file mode 100644 index 0000000000..7665bfe90b --- /dev/null +++ b/test/runtime/samples/head-if-else-block/_config.js @@ -0,0 +1,14 @@ +export default { + props: { + condition: false + }, + + test({ assert, component, target, window }) { + assert.equal(window.document.title, ''); + assert.equal(Boolean(window.document.getElementById('meta')), true); + + component.condition = true; + assert.equal(window.document.title, 'woo!!!'); + assert.equal(window.document.getElementById('meta'), null); + } +}; diff --git a/test/runtime/samples/head-if-else-block/main.svelte b/test/runtime/samples/head-if-else-block/main.svelte new file mode 100644 index 0000000000..a31bdf3330 --- /dev/null +++ b/test/runtime/samples/head-if-else-block/main.svelte @@ -0,0 +1,11 @@ + + + + {#if condition} + woo!!! + {:else} + + {/if} + diff --git a/test/runtime/samples/head-if-else-raw-dynamic/_config.js b/test/runtime/samples/head-if-else-raw-dynamic/_config.js new file mode 100644 index 0000000000..b6da617cb9 --- /dev/null +++ b/test/runtime/samples/head-if-else-raw-dynamic/_config.js @@ -0,0 +1,19 @@ +const foo = ''; +const bar = ''; + +export default { + props: { + condition: false, + foo, + bar + }, + + test({ assert, component, window }) { + assert.equal(window.document.head.innerHTML.includes(foo), false); + assert.equal(window.document.head.innerHTML.includes(bar), true); + + component.condition = true; + assert.equal(window.document.head.innerHTML.includes(foo), true); + assert.equal(window.document.head.innerHTML.includes(bar), false); + } +}; diff --git a/test/runtime/samples/head-if-else-raw-dynamic/main.svelte b/test/runtime/samples/head-if-else-raw-dynamic/main.svelte new file mode 100644 index 0000000000..ca322dad83 --- /dev/null +++ b/test/runtime/samples/head-if-else-raw-dynamic/main.svelte @@ -0,0 +1,11 @@ + + + + {#if condition} + {@html foo} + {:else} + {@html bar} + {/if} + diff --git a/test/runtime/samples/head-raw-dynamic/Bar.svelte b/test/runtime/samples/head-raw-dynamic/Bar.svelte new file mode 100644 index 0000000000..11e5cb9ee8 --- /dev/null +++ b/test/runtime/samples/head-raw-dynamic/Bar.svelte @@ -0,0 +1,11 @@ + + + + + {#if true} + {@html bar} + {/if} + bar!!! + diff --git a/test/runtime/samples/head-raw-dynamic/Foo.svelte b/test/runtime/samples/head-raw-dynamic/Foo.svelte new file mode 100644 index 0000000000..f4fd5741ac --- /dev/null +++ b/test/runtime/samples/head-raw-dynamic/Foo.svelte @@ -0,0 +1,7 @@ + + + + {@html foo} + diff --git a/test/runtime/samples/head-raw-dynamic/_config.js b/test/runtime/samples/head-raw-dynamic/_config.js new file mode 100644 index 0000000000..61e86727ff --- /dev/null +++ b/test/runtime/samples/head-raw-dynamic/_config.js @@ -0,0 +1,26 @@ +const foo = ''; +const bar = ''; + +export default { + props: { + condition: 1, + foo, + bar + }, + + test({ assert, component, window }) { + assert.equal(window.document.head.innerHTML.includes(foo), true); + + component.condition = false; + assert.equal(window.document.head.innerHTML.includes(foo), false); + + component.condition = 2; + assert.equal(window.document.title, 'bar!!!'); + assert.equal(window.document.head.innerHTML.includes(bar), true); + assert.equal(Boolean(window.document.getElementById('meta')), true); + + component.condition = false; + assert.equal(window.document.head.innerHTML.includes(bar), false); + assert.equal(window.document.getElementById('meta'), null); + } +}; diff --git a/test/runtime/samples/head-raw-dynamic/main.svelte b/test/runtime/samples/head-raw-dynamic/main.svelte new file mode 100644 index 0000000000..69f341ae36 --- /dev/null +++ b/test/runtime/samples/head-raw-dynamic/main.svelte @@ -0,0 +1,12 @@ + + +{#if condition === 1} + +{:else if condition === 2} + +{/if} From c8fbde410bee905a86c13b397beb06d89b8b0585 Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Mon, 27 May 2019 11:51:32 +0200 Subject: [PATCH 058/409] remove eslint, now that everything is typescript --- package-lock.json | 827 +--------------------------------------------- package.json | 6 +- 2 files changed, 9 insertions(+), 824 deletions(-) diff --git a/package-lock.json b/package-lock.json index f87b3610df..e2b0fd0ffd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,29 +1,9 @@ { "name": "svelte", - "version": "3.4.2", + "version": "3.4.3", "lockfileVersion": 1, "requires": true, "dependencies": { - "@babel/code-frame": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", - "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", - "dev": true, - "requires": { - "@babel/highlight": "^7.0.0" - } - }, - "@babel/highlight": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", - "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", - "dev": true, - "requires": { - "chalk": "^2.0.0", - "esutils": "^2.0.2", - "js-tokens": "^4.0.0" - } - }, "@bcoe/v8-coverage": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.1.0.tgz", @@ -92,12 +72,6 @@ "acorn-walk": "^6.0.1" } }, - "acorn-jsx": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.1.tgz", - "integrity": "sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg==", - "dev": true - }, "acorn-walk": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.1.1.tgz", @@ -147,27 +121,12 @@ "uri-js": "^4.2.2" } }, - "ansi-escapes": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", - "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", - "dev": true - }, "ansi-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, "any-promise": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", @@ -209,7 +168,7 @@ }, "array-equal": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", + "resolved": "http://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", "dev": true }, @@ -240,12 +199,6 @@ "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", "dev": true }, - "astral-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", - "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", - "dev": true - }, "async-limiter": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", @@ -483,41 +436,12 @@ } } }, - "callsites": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.0.0.tgz", - "integrity": "sha512-tWnkwu9YEq2uzlBDI4RcLn8jrFvF9AOi8PxDNU3hZZjJcjkcRAq3vCI+vZcg1SuxISDYe86k9VZFwAxDiJGoAw==", - "dev": true - }, "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", "dev": true }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "chardet": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", - "dev": true - }, - "circular-json": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", - "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", - "dev": true - }, "class-utils": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", @@ -547,21 +471,6 @@ } } }, - "cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", - "dev": true, - "requires": { - "restore-cursor": "^2.0.0" - } - }, - "cli-width": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", - "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", - "dev": true - }, "cliui": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", @@ -608,21 +517,6 @@ "object-visit": "^1.0.0" } }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, "combined-stream": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", @@ -634,7 +528,7 @@ }, "commander": { "version": "2.15.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "resolved": "http://registry.npmjs.org/commander/-/commander-2.15.1.tgz", "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", "dev": true }, @@ -688,12 +582,6 @@ } } }, - "contains-path": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", - "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", - "dev": true - }, "copy-descriptor": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", @@ -864,39 +752,6 @@ "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", "dev": true }, - "doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", - "dev": true, - "requires": { - "esutils": "^2.0.2" - } - }, - "dom-serializer": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", - "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", - "dev": true, - "requires": { - "domelementtype": "~1.1.1", - "entities": "~1.1.1" - }, - "dependencies": { - "domelementtype": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", - "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=", - "dev": true - } - } - }, - "domelementtype": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", - "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", - "dev": true - }, "domexception": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", @@ -906,25 +761,6 @@ "webidl-conversions": "^4.0.2" } }, - "domhandler": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz", - "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", - "dev": true, - "requires": { - "domelementtype": "1" - } - }, - "domutils": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz", - "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==", - "dev": true, - "requires": { - "dom-serializer": "0", - "domelementtype": "1" - } - }, "ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", @@ -944,12 +780,6 @@ "once": "^1.4.0" } }, - "entities": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", - "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", - "dev": true - }, "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -1001,216 +831,12 @@ } } }, - "eslint": { - "version": "5.12.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.12.1.tgz", - "integrity": "sha512-54NV+JkTpTu0d8+UYSA8mMKAG4XAsaOrozA9rCW7tgneg1mevcL7wIotPC+fZ0SkWwdhNqoXoxnQCTBp7UvTsg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "ajv": "^6.5.3", - "chalk": "^2.1.0", - "cross-spawn": "^6.0.5", - "debug": "^4.0.1", - "doctrine": "^2.1.0", - "eslint-scope": "^4.0.0", - "eslint-utils": "^1.3.1", - "eslint-visitor-keys": "^1.0.0", - "espree": "^5.0.0", - "esquery": "^1.0.1", - "esutils": "^2.0.2", - "file-entry-cache": "^2.0.0", - "functional-red-black-tree": "^1.0.1", - "glob": "^7.1.2", - "globals": "^11.7.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "inquirer": "^6.1.0", - "js-yaml": "^3.12.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.3.0", - "lodash": "^4.17.5", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", - "natural-compare": "^1.4.0", - "optionator": "^0.8.2", - "path-is-inside": "^1.0.2", - "pluralize": "^7.0.0", - "progress": "^2.0.0", - "regexpp": "^2.0.1", - "semver": "^5.5.1", - "strip-ansi": "^4.0.0", - "strip-json-comments": "^2.0.1", - "table": "^5.0.2", - "text-table": "^0.2.0" - } - }, - "eslint-import-resolver-node": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz", - "integrity": "sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==", - "dev": true, - "requires": { - "debug": "^2.6.9", - "resolve": "^1.5.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, - "eslint-module-utils": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.3.0.tgz", - "integrity": "sha512-lmDJgeOOjk8hObTysjqH7wyMi+nsHwwvfBykwfhjR1LNdd7C2uFJBvx4OpWYpXOw4df1yE1cDEVd1yLHitk34w==", - "dev": true, - "requires": { - "debug": "^2.6.8", - "pkg-dir": "^2.0.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, - "eslint-plugin-html": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-html/-/eslint-plugin-html-5.0.0.tgz", - "integrity": "sha512-f7p/7YQdgQUFVAX3nB4dnMQbrDeTalcA01PDhuvTLk0ZadCwM4Pb+639SRuqEf1zMkIxckLY+ckCr0hVP5zl6A==", - "dev": true, - "requires": { - "htmlparser2": "^3.10.0" - } - }, - "eslint-plugin-import": { - "version": "2.15.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.15.0.tgz", - "integrity": "sha512-LEHqgR+RcnpGqYW7h9WMkPb/tP+ekKxWdQDztfTtZeV43IHF+X8lXU+1HOCcR4oXD24qRgEwNSxIweD5uNKGVg==", - "dev": true, - "requires": { - "contains-path": "^0.1.0", - "debug": "^2.6.9", - "doctrine": "1.5.0", - "eslint-import-resolver-node": "^0.3.2", - "eslint-module-utils": "^2.3.0", - "has": "^1.0.3", - "lodash": "^4.17.11", - "minimatch": "^3.0.4", - "read-pkg-up": "^2.0.0", - "resolve": "^1.9.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "doctrine": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", - "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "isarray": "^1.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, - "eslint-scope": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz", - "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==", - "dev": true, - "requires": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - } - }, - "eslint-utils": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz", - "integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==", - "dev": true - }, - "eslint-visitor-keys": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", - "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", - "dev": true - }, - "espree": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.0.tgz", - "integrity": "sha512-1MpUfwsdS9MMoN7ZXqAr9e9UKdVHDcvrJpyx7mm1WuQlx/ygErEQBzgi5Nh5qBHIoYweprhtMkTCb9GhcAIcsA==", - "dev": true, - "requires": { - "acorn": "^6.0.2", - "acorn-jsx": "^5.0.0", - "eslint-visitor-keys": "^1.0.0" - } - }, "esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true }, - "esquery": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", - "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", - "dev": true, - "requires": { - "estraverse": "^4.0.0" - } - }, - "esrecurse": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", - "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", - "dev": true, - "requires": { - "estraverse": "^4.1.0" - } - }, "estraverse": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", @@ -1271,17 +897,6 @@ } } }, - "external-editor": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz", - "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==", - "dev": true, - "requires": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" - } - }, "extract-zip": { "version": "1.6.7", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.7.tgz", @@ -1344,46 +959,6 @@ "pend": "~1.2.0" } }, - "figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.5" - } - }, - "file-entry-cache": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", - "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", - "dev": true, - "requires": { - "flat-cache": "^1.2.1", - "object-assign": "^4.0.1" - } - }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "flat-cache": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.4.tgz", - "integrity": "sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg==", - "dev": true, - "requires": { - "circular-json": "^0.3.1", - "graceful-fs": "^4.1.2", - "rimraf": "~2.6.2", - "write": "^0.2.1" - } - }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -1444,18 +1019,6 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true - }, "furi": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/furi/-/furi-1.3.0.tgz", @@ -1510,12 +1073,6 @@ "path-is-absolute": "^1.0.0" } }, - "globals": { - "version": "11.10.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.10.0.tgz", - "integrity": "sha512-0GZF1RiPKU97IHUO5TORo9w1PwrH/NBPl+fS7oMLdaTRiYmYbwK4NWoZWrAdd0/abG9R2BU+OiwyQpTpE6pdfQ==", - "dev": true - }, "globalyzer": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz", @@ -1568,15 +1125,6 @@ "har-schema": "^2.0.0" } }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "requires": { - "function-bind": "^1.1.1" - } - }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -1664,20 +1212,6 @@ "whatwg-encoding": "^1.0.1" } }, - "htmlparser2": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.0.tgz", - "integrity": "sha512-J1nEUGv+MkXS0weHNWVKJJ+UrLfePxRWpN3C9bEi9fLxL2+ggW94DQvgYVXsaT30PGwYRIZKNZXuyMhp3Di4bQ==", - "dev": true, - "requires": { - "domelementtype": "^1.3.0", - "domhandler": "^2.3.0", - "domutils": "^1.5.1", - "entities": "^1.1.1", - "inherits": "^2.0.1", - "readable-stream": "^3.0.6" - } - }, "http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", @@ -1719,12 +1253,6 @@ "safer-buffer": ">= 2.1.2 < 3" } }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true - }, "ignore-walk": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", @@ -1734,22 +1262,6 @@ "minimatch": "^3.0.4" } }, - "import-fresh": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.0.0.tgz", - "integrity": "sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ==", - "dev": true, - "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true - }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -1766,44 +1278,6 @@ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, - "inquirer": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.1.tgz", - "integrity": "sha512-088kl3DRT2dLU5riVMKKr1DlImd6X7smDhpXUCkJDCKvTEJeRiXh0G132HG9u5a+6Ylw9plFRY7RuTnwohYSpg==", - "dev": true, - "requires": { - "ansi-escapes": "^3.0.0", - "chalk": "^2.0.0", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "external-editor": "^3.0.0", - "figures": "^2.0.0", - "lodash": "^4.17.10", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rxjs": "^6.1.0", - "string-width": "^2.1.0", - "strip-ansi": "^5.0.0", - "through": "^2.3.6" - }, - "dependencies": { - "ansi-regex": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.0.0.tgz", - "integrity": "sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w==", - "dev": true - }, - "strip-ansi": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.0.0.tgz", - "integrity": "sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow==", - "dev": true, - "requires": { - "ansi-regex": "^4.0.0" - } - } - } - }, "invert-kv": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", @@ -1833,7 +1307,7 @@ }, "is-builtin-module": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "resolved": "http://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", "dev": true, "requires": { @@ -1903,12 +1377,6 @@ } } }, - "is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", - "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", - "dev": true - }, "is-reference": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.1.1.tgz", @@ -1980,12 +1448,6 @@ "handlebars": "^4.0.11" } }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, "js-yaml": { "version": "3.13.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", @@ -2053,12 +1515,6 @@ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true - }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -2117,34 +1573,12 @@ "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", "dev": true }, - "load-json-file": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", - "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "strip-bom": "^3.0.0" - } - }, "locate-character": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/locate-character/-/locate-character-2.0.5.tgz", "integrity": "sha512-n2GmejDXtOPBAZdIiEFy5dJ5N38xBCXLNOtw2WpB9kGh6pnrEuKlwYI+Tkpofc4wDtVXHtoAOJaMRlYG/oYaxg==", "dev": true }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, "lodash": { "version": "4.17.11", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", @@ -2278,7 +1712,7 @@ }, "minimist": { "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, @@ -2305,7 +1739,7 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "requires": { @@ -2377,12 +1811,6 @@ "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true }, - "mute-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", - "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", - "dev": true - }, "mz": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", @@ -2433,12 +1861,6 @@ } } }, - "natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true - }, "neo-async": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", @@ -2567,15 +1989,6 @@ "wrappy": "1" } }, - "onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", - "dev": true, - "requires": { - "mimic-fn": "^1.0.0" - } - }, "optimist": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", @@ -2619,12 +2032,6 @@ "mem": "^4.0.0" } }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true - }, "p-defer": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", @@ -2643,48 +2050,6 @@ "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=", "dev": true }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - }, - "parent-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.0.tgz", - "integrity": "sha512-8Mf5juOMmiE4FcmzYc4IaiS9L3+9paz2KOiXzkRviCP6aDmN49Hz6EMWz0lGNp9pX80GvvAuLADtyGfW/Em3TA==", - "dev": true, - "requires": { - "callsites": "^3.0.0" - } - }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "dev": true, - "requires": { - "error-ex": "^1.2.0" - } - }, "parse5": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.0.tgz", @@ -2705,16 +2070,10 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, - "path-is-inside": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", - "dev": true - }, "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", @@ -2727,15 +2086,6 @@ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, - "path-type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", - "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", - "dev": true, - "requires": { - "pify": "^2.0.0" - } - }, "pend": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", @@ -2748,12 +2098,6 @@ "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", "dev": true }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - }, "pirates": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.0.tgz", @@ -2763,21 +2107,6 @@ "node-modules-regexp": "^1.0.0" } }, - "pkg-dir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", - "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", - "dev": true, - "requires": { - "find-up": "^2.1.0" - } - }, - "pluralize": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", - "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", - "dev": true - }, "pn": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", @@ -2864,38 +2193,6 @@ "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", "dev": true }, - "read-pkg": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", - "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", - "dev": true, - "requires": { - "load-json-file": "^2.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^2.0.0" - } - }, - "read-pkg-up": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", - "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", - "dev": true, - "requires": { - "find-up": "^2.0.0", - "read-pkg": "^2.0.0" - } - }, - "readable-stream": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.1.1.tgz", - "integrity": "sha512-DkN66hPyqDhnIQ6Jcsvx9bFjhw214O4poMBcIMgPVpQvNy9a0e0Uhg5SqySyDKAmUlwt8LonTBz1ezOnM8pUdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, "regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", @@ -2906,12 +2203,6 @@ "safe-regex": "^1.1.0" } }, - "regexpp": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", - "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", - "dev": true - }, "repeat-element": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", @@ -2993,28 +2284,12 @@ "path-parse": "^1.0.6" } }, - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true - }, "resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", "dev": true }, - "restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", - "dev": true, - "requires": { - "onetime": "^2.0.0", - "signal-exit": "^3.0.2" - } - }, "ret": { "version": "0.1.15", "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", @@ -3427,24 +2702,6 @@ } } }, - "run-async": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", - "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", - "dev": true, - "requires": { - "is-promise": "^2.1.0" - } - }, - "rxjs": { - "version": "6.3.3", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.3.3.tgz", - "integrity": "sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw==", - "dev": true, - "requires": { - "tslib": "^1.9.0" - } - }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -3453,7 +2710,7 @@ }, "safe-regex": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "resolved": "http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", "dev": true, "requires": { @@ -3531,17 +2788,6 @@ "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, - "slice-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.0.0.tgz", - "integrity": "sha512-4j2WTWjp3GsZ+AOagyzVbzp4vWGtZ0hEZ/gDY/uTvm6MTxUfTUIsnMIFb1bn8o0RuXiqUw15H1bue8f22Vw2oQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.0", - "astral-regex": "^1.0.0", - "is-fullwidth-code-point": "^2.0.0" - } - }, "snapdragon": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", @@ -3813,15 +3059,6 @@ "strip-ansi": "^4.0.0" } }, - "string_decoder": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.2.0.tgz", - "integrity": "sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, "strip-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", @@ -3843,12 +3080,6 @@ "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "dev": true }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true - }, "sucrase": { "version": "3.9.5", "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.9.5.tgz", @@ -3884,18 +3115,6 @@ "integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY=", "dev": true }, - "table": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/table/-/table-5.2.1.tgz", - "integrity": "sha512-qmhNs2GEHNqY5fd2Mo+8N1r2sw/rvTAAvBZTaTx+Y7PHLypqyrxr1MdIu0pLw6Xvl/Gi4ONu/sdceP8vvUjkyA==", - "dev": true, - "requires": { - "ajv": "^6.6.1", - "lodash": "^4.17.11", - "slice-ansi": "2.0.0", - "string-width": "^2.1.1" - } - }, "test-exclude": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.0.0.tgz", @@ -4011,12 +3230,6 @@ } } }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true - }, "thenify": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.0.tgz", @@ -4035,12 +3248,6 @@ "thenify": ">= 3.1.0 < 4" } }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true - }, "tiny-glob": { "version": "0.2.6", "resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.6.tgz", @@ -4051,15 +3258,6 @@ "globrex": "^0.1.1" } }, - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, - "requires": { - "os-tmpdir": "~1.0.2" - } - }, "to-object-path": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", @@ -4466,15 +3664,6 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, - "write": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", - "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", - "dev": true, - "requires": { - "mkdirp": "^0.5.1" - } - }, "ws": { "version": "6.1.3", "resolved": "https://registry.npmjs.org/ws/-/ws-6.1.3.tgz", diff --git a/package.json b/package.json index b7214c9254..56f902a3c1 100644 --- a/package.json +++ b/package.json @@ -25,13 +25,12 @@ "coverage": "c8 report --reporter=text-lcov > coverage.lcov && c8 report --reporter=html", "codecov": "codecov", "precodecov": "npm run coverage", - "lint": "eslint src test/*.js", "build": "rollup -c", "prepare": "npm run build && npm run tsd", "dev": "rollup -cw", "pretest": "npm run build", "posttest": "agadoo internal.mjs", - "prepublishOnly": "export PUBLISH=true && npm run lint && npm test", + "prepublishOnly": "export PUBLISH=true && npm test", "tsd": "tsc -p . --emitDeclarationOnly", "typecheck": "tsc -p . --noEmit" }, @@ -61,9 +60,6 @@ "c8": "^3.4.0", "codecov": "^3.0.0", "css-tree": "1.0.0-alpha22", - "eslint": "^5.3.0", - "eslint-plugin-html": "^5.0.0", - "eslint-plugin-import": "^2.11.0", "estree-walker": "^0.6.0", "is-reference": "^1.1.1", "jsdom": "^12.2.0", From e8b769ca5081058ad0fd6a062b97716ffedd39b9 Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Mon, 27 May 2019 12:00:54 +0200 Subject: [PATCH 059/409] make is_reactive_dependency optional --- src/interfaces.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interfaces.ts b/src/interfaces.ts index 3b79c99bd0..42781cbdad 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -133,5 +133,5 @@ export interface Var { initialised?: boolean; hoistable?: boolean; subscribable?: boolean; - is_reactive_dependency: boolean; + is_reactive_dependency?: boolean; } \ No newline at end of file From cb1a76b08c1766b7f68191583352d7a3ef7c5f04 Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Mon, 27 May 2019 12:09:21 +0200 Subject: [PATCH 060/409] dont create unknown prop warnings for $$scope etc, or if component has $$props - fixes #2878 --- src/compile/render-dom/index.ts | 4 ++-- .../dev-warning-unknown-props-with-$$props/Foo.svelte | 7 +++++++ .../dev-warning-unknown-props-with-$$props/_config.js | 7 +++++++ .../dev-warning-unknown-props-with-$$props/main.svelte | 5 +++++ .../dev-warning-unknown-props-with-$$scope/Foo.svelte | 6 ++++++ .../dev-warning-unknown-props-with-$$scope/_config.js | 7 +++++++ .../dev-warning-unknown-props-with-$$scope/main.svelte | 7 +++++++ 7 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 test/runtime/samples/dev-warning-unknown-props-with-$$props/Foo.svelte create mode 100644 test/runtime/samples/dev-warning-unknown-props-with-$$props/_config.js create mode 100644 test/runtime/samples/dev-warning-unknown-props-with-$$props/main.svelte create mode 100644 test/runtime/samples/dev-warning-unknown-props-with-$$scope/Foo.svelte create mode 100644 test/runtime/samples/dev-warning-unknown-props-with-$$scope/_config.js create mode 100644 test/runtime/samples/dev-warning-unknown-props-with-$$scope/main.svelte diff --git a/src/compile/render-dom/index.ts b/src/compile/render-dom/index.ts index 1432813e9d..2bf8935150 100644 --- a/src/compile/render-dom/index.ts +++ b/src/compile/render-dom/index.ts @@ -395,11 +395,11 @@ export default function dom( }); let unknown_props_check; - if (component.compile_options.dev && writable_props.length) { + if (component.compile_options.dev && !component.var_lookup.has('$$props') && writable_props.length) { unknown_props_check = deindent` const writable_props = [${writable_props.map(prop => `'${prop.export_name}'`).join(', ')}]; Object.keys($$props).forEach(key => { - if (!writable_props.includes(key)) console.warn(\`<${component.tag}> was created with unknown prop '\${key}'\`); + if (!writable_props.includes(key) && !key.startsWith('$$')) console.warn(\`<${component.tag}> was created with unknown prop '\${key}'\`); }); `; } diff --git a/test/runtime/samples/dev-warning-unknown-props-with-$$props/Foo.svelte b/test/runtime/samples/dev-warning-unknown-props-with-$$props/Foo.svelte new file mode 100644 index 0000000000..9e5c62339d --- /dev/null +++ b/test/runtime/samples/dev-warning-unknown-props-with-$$props/Foo.svelte @@ -0,0 +1,7 @@ + + +
      {foo}
      +
      {JSON.stringify($$props)}
      diff --git a/test/runtime/samples/dev-warning-unknown-props-with-$$props/_config.js b/test/runtime/samples/dev-warning-unknown-props-with-$$props/_config.js new file mode 100644 index 0000000000..62ad08624d --- /dev/null +++ b/test/runtime/samples/dev-warning-unknown-props-with-$$props/_config.js @@ -0,0 +1,7 @@ +export default { + compileOptions: { + dev: true + }, + + warnings: [] +}; diff --git a/test/runtime/samples/dev-warning-unknown-props-with-$$props/main.svelte b/test/runtime/samples/dev-warning-unknown-props-with-$$props/main.svelte new file mode 100644 index 0000000000..1566cf3e41 --- /dev/null +++ b/test/runtime/samples/dev-warning-unknown-props-with-$$props/main.svelte @@ -0,0 +1,5 @@ + + + diff --git a/test/runtime/samples/dev-warning-unknown-props-with-$$scope/Foo.svelte b/test/runtime/samples/dev-warning-unknown-props-with-$$scope/Foo.svelte new file mode 100644 index 0000000000..b9f7feec24 --- /dev/null +++ b/test/runtime/samples/dev-warning-unknown-props-with-$$scope/Foo.svelte @@ -0,0 +1,6 @@ + + +

      {answer}

      +
      diff --git a/test/runtime/samples/dev-warning-unknown-props-with-$$scope/_config.js b/test/runtime/samples/dev-warning-unknown-props-with-$$scope/_config.js new file mode 100644 index 0000000000..62ad08624d --- /dev/null +++ b/test/runtime/samples/dev-warning-unknown-props-with-$$scope/_config.js @@ -0,0 +1,7 @@ +export default { + compileOptions: { + dev: true + }, + + warnings: [] +}; diff --git a/test/runtime/samples/dev-warning-unknown-props-with-$$scope/main.svelte b/test/runtime/samples/dev-warning-unknown-props-with-$$scope/main.svelte new file mode 100644 index 0000000000..a1656e86e0 --- /dev/null +++ b/test/runtime/samples/dev-warning-unknown-props-with-$$scope/main.svelte @@ -0,0 +1,7 @@ + + + + bar + From dda69dbad038354786c7eba5e2e24eff290f759f Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Mon, 27 May 2019 12:14:51 +0200 Subject: [PATCH 061/409] update tests --- test/js/samples/debug-empty/expected.js | 2 +- test/js/samples/debug-foo-bar-baz-things/expected.js | 2 +- test/js/samples/debug-foo/expected.js | 2 +- test/js/samples/dev-warning-missing-data-computed/expected.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/js/samples/debug-empty/expected.js b/test/js/samples/debug-empty/expected.js index c82cbeddd3..6f07993590 100644 --- a/test/js/samples/debug-empty/expected.js +++ b/test/js/samples/debug-empty/expected.js @@ -67,7 +67,7 @@ function instance($$self, $$props, $$invalidate) { const writable_props = ['name']; Object.keys($$props).forEach(key => { - if (!writable_props.includes(key)) console.warn(` was created with unknown prop '${key}'`); + if (!writable_props.includes(key) && !key.startsWith('$$')) console.warn(` was created with unknown prop '${key}'`); }); $$self.$set = $$props => { diff --git a/test/js/samples/debug-foo-bar-baz-things/expected.js b/test/js/samples/debug-foo-bar-baz-things/expected.js index 3e1571b890..eea35d5ba7 100644 --- a/test/js/samples/debug-foo-bar-baz-things/expected.js +++ b/test/js/samples/debug-foo-bar-baz-things/expected.js @@ -153,7 +153,7 @@ function instance($$self, $$props, $$invalidate) { const writable_props = ['things', 'foo', 'bar', 'baz']; Object.keys($$props).forEach(key => { - if (!writable_props.includes(key)) console.warn(` was created with unknown prop '${key}'`); + if (!writable_props.includes(key) && !key.startsWith('$$')) console.warn(` was created with unknown prop '${key}'`); }); $$self.$set = $$props => { diff --git a/test/js/samples/debug-foo/expected.js b/test/js/samples/debug-foo/expected.js index 1af0fcaebe..5b931d9464 100644 --- a/test/js/samples/debug-foo/expected.js +++ b/test/js/samples/debug-foo/expected.js @@ -153,7 +153,7 @@ function instance($$self, $$props, $$invalidate) { const writable_props = ['things', 'foo']; Object.keys($$props).forEach(key => { - if (!writable_props.includes(key)) console.warn(` was created with unknown prop '${key}'`); + if (!writable_props.includes(key) && !key.startsWith('$$')) console.warn(` was created with unknown prop '${key}'`); }); $$self.$set = $$props => { diff --git a/test/js/samples/dev-warning-missing-data-computed/expected.js b/test/js/samples/dev-warning-missing-data-computed/expected.js index 0c193934c0..5c4b2ece1b 100644 --- a/test/js/samples/dev-warning-missing-data-computed/expected.js +++ b/test/js/samples/dev-warning-missing-data-computed/expected.js @@ -67,7 +67,7 @@ function instance($$self, $$props, $$invalidate) { const writable_props = ['foo']; Object.keys($$props).forEach(key => { - if (!writable_props.includes(key)) console.warn(` was created with unknown prop '${key}'`); + if (!writable_props.includes(key) && !key.startsWith('$$')) console.warn(` was created with unknown prop '${key}'`); }); $$self.$set = $$props => { From 8fd94aea6960e3db7db9bed4841b9b5380b27491 Mon Sep 17 00:00:00 2001 From: Conduitry Date: Mon, 27 May 2019 06:39:06 -0400 Subject: [PATCH 062/409] remove unused eslint setting --- .eslintrc.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 7e8c26382a..3d2c0f6869 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -38,7 +38,6 @@ "sourceType": "module" }, "settings": { - "import/core-modules": ["svelte"], - "svelte3/extensions": ["html"] + "import/core-modules": ["svelte"] } } From 7cecb99b4896dfe5e8516c21953e553b420b8870 Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Mon, 27 May 2019 12:50:00 +0200 Subject: [PATCH 063/409] move dist to types --- .flowconfig | 2 +- .gitignore | 2 +- animate.d.ts | 2 +- compiler.d.ts | 2 +- easing.d.ts | 2 +- index.d.ts | 2 +- internal.d.ts | 2 +- motion.d.ts | 2 +- package.json | 2 +- store.d.ts | 2 +- transition.d.ts | 2 +- tsconfig.json | 6 +++--- 12 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.flowconfig b/.flowconfig index 2ed2b0c713..c1961b7a6b 100644 --- a/.flowconfig +++ b/.flowconfig @@ -1,5 +1,5 @@ [ignore] -/dist/.* +/types/.* [include] diff --git a/.gitignore b/.gitignore index 35888493fa..847d12a540 100644 --- a/.gitignore +++ b/.gitignore @@ -21,7 +21,7 @@ node_modules /test/sourcemaps/samples/*/output.css.map /yarn-error.log _actual*.* -/dist +/types /site/cypress/screenshots/ /site/__sapper__/ diff --git a/animate.d.ts b/animate.d.ts index 3284bfd8c0..e0c5aebb0e 100644 --- a/animate.d.ts +++ b/animate.d.ts @@ -1 +1 @@ -export * from './dist/animate'; +export * from './types/animate'; diff --git a/compiler.d.ts b/compiler.d.ts index 977efefb6d..e2a3820bc5 100644 --- a/compiler.d.ts +++ b/compiler.d.ts @@ -1 +1 @@ -export * from './dist/compiler'; +export * from './types/compiler'; diff --git a/easing.d.ts b/easing.d.ts index c07764f4f0..9af6dd9ca7 100644 --- a/easing.d.ts +++ b/easing.d.ts @@ -1 +1 @@ -export * from './dist/easing'; +export * from './types/easing'; diff --git a/index.d.ts b/index.d.ts index e4ddc9027e..a3d3b4a0d6 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1 +1 @@ -export * from './dist/index'; +export * from './types/index'; diff --git a/internal.d.ts b/internal.d.ts index be034cd88a..135ffe7611 100644 --- a/internal.d.ts +++ b/internal.d.ts @@ -1 +1 @@ -export * from './dist/internal'; +export * from './types/internal'; diff --git a/motion.d.ts b/motion.d.ts index 2fdaa86c4e..4cc764a2c9 100644 --- a/motion.d.ts +++ b/motion.d.ts @@ -1 +1 @@ -export * from './dist/motion'; +export * from './types/motion'; diff --git a/package.json b/package.json index a8ef5134e0..8adfbda2ff 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "module": "index.mjs", "main": "index", "files": [ - "dist", + "types", "compiler.js", "register.js", "index.*", diff --git a/store.d.ts b/store.d.ts index 2c1307011b..6d345dce57 100644 --- a/store.d.ts +++ b/store.d.ts @@ -1 +1 @@ -export * from './dist/store'; +export * from './types/store'; diff --git a/transition.d.ts b/transition.d.ts index 54d5f036da..58f51d94d5 100644 --- a/transition.d.ts +++ b/transition.d.ts @@ -1 +1 @@ -export * from './dist/transition'; +export * from './types/transition'; diff --git a/tsconfig.json b/tsconfig.json index 994bc61b85..6c4e786f6d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,8 +2,8 @@ "compilerOptions": { "target": "es2015", "module": "es6", - "declarationDir": "./dist", - "outDir": "./dist", + "declarationDir": "./types", + "outDir": "./types", "declaration": true, "noImplicitThis": true, "noEmitOnError": true, @@ -30,6 +30,6 @@ "src/**/*" ], "exclude": [ - "dist" + "types" ] } From 78cf400ba8e753c5a22a2566163e0882c07a6406 Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Mon, 27 May 2019 12:58:59 +0200 Subject: [PATCH 064/409] -> v3.4.4 --- CHANGELOG.md | 10 ++++++++++ package.json | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4981ca096b..766a1634e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Svelte changelog +## 3.4.4 + +* Publish type declaration files ([#2874](https://github.com/sveltejs/svelte/issues/2874)) +* Don't trigger updates for unreferenced values ([#2865](https://github.com/sveltejs/svelte/pull/2865)) +* Omit readonly bindings from SSR output ([#2339](https://github.com/sveltejs/svelte/issues/2339)) +* Prevent outdated animation CSS ([#2871](https://github.com/sveltejs/svelte/issues/2871)) +* Repair dynamic `{@html ...}` in head ([#2880](https://github.com/sveltejs/svelte/pull/2880)) +* Don't create unknown prop warnings for internal props, or if component has `$$props` ([#2881](https://github.com/sveltejs/svelte/pull/2881)) + + ## 3.4.3 * Add type declaration files for everything ([#2842](https://github.com/sveltejs/svelte/pull/2842)) diff --git a/package.json b/package.json index 8adfbda2ff..1ce1b9b5b7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "svelte", - "version": "3.4.3", + "version": "3.4.4", "description": "Cybernetically enhanced web apps", "module": "index.mjs", "main": "index", From 6d59a40a626edb859f454af2ce3e149af9c66d68 Mon Sep 17 00:00:00 2001 From: Karsten 7 Date: Mon, 27 May 2019 13:49:20 +0200 Subject: [PATCH 065/409] Add implementation for the given tutorial example --- .../02-reactivity/04-updating-arrays-and-objects/text.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/site/content/tutorial/02-reactivity/04-updating-arrays-and-objects/text.md b/site/content/tutorial/02-reactivity/04-updating-arrays-and-objects/text.md index 0a78c7ca32..9cc875bc73 100644 --- a/site/content/tutorial/02-reactivity/04-updating-arrays-and-objects/text.md +++ b/site/content/tutorial/02-reactivity/04-updating-arrays-and-objects/text.md @@ -24,3 +24,9 @@ function addNumber() { You can use similar patterns to replace `pop`, `shift`, `unshift` and `splice`. > Assignments to *properties* of arrays and objects — e.g. `obj.foo += 1` or `array[i] = x` — work the same way as assignments to the values themselves. +> +> ```js +> function addNumber() { +> numbers[numbers.length] = numbers.length + 1; +> } +> ``` From db823ca80a7755fab446e4b84820844cf0e97bdf Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Mon, 27 May 2019 20:02:55 +0200 Subject: [PATCH 066/409] bundle locally --- site/package.json | 5 +- site/src/components/Repl/ReplWidget.svelte | 1 + site/src/routes/examples/index.svelte | 1 + site/src/routes/repl/[id]/index.svelte | 1 + site/src/routes/tutorial/[slug]/index.svelte | 1 + site/src/server.js | 3 +- site/static/workers/bundler.js | 5343 ++++++++++++++++++ site/static/workers/compiler.js | 59 + 8 files changed, 5411 insertions(+), 3 deletions(-) create mode 100644 site/static/workers/bundler.js create mode 100644 site/static/workers/compiler.js diff --git a/site/package.json b/site/package.json index d9de5a217e..bc87ad00b7 100644 --- a/site/package.json +++ b/site/package.json @@ -3,9 +3,10 @@ "version": "1.0.0", "description": "Docs and examples for Svelte", "scripts": { - "dev": "sapper dev", + "dev": "npm run copy-workers && sapper dev", + "copy-workers": "rm -rf static/workers && cp -r node_modules/@sveltejs/svelte-repl/workers static", "migrate": "node-pg-migrate -r dotenv/config", - "sapper": "sapper build --legacy", + "sapper": "npm run copy-workers && sapper build --legacy", "update_shimport": "cp node_modules/shimport/index.js __sapper__/build/client/shimport@0.0.14.js", "update": "node scripts/update_template.js && node scripts/get-contributors.js", "start": "node __sapper__/build", diff --git a/site/src/components/Repl/ReplWidget.svelte b/site/src/components/Repl/ReplWidget.svelte index 07a5814010..9d06fb7868 100644 --- a/site/src/components/Repl/ReplWidget.svelte +++ b/site/src/components/Repl/ReplWidget.svelte @@ -116,6 +116,7 @@ {#if process.browser} =e.length)&&56320==(64512&e.charCodeAt(t+1)))}function s(e){return (e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function o(e){return 1===e.length?"0"+e:e}function a(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}r.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)};var h={inherits:(function(e){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}});}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e;};}(e={exports:{}},e.exports),e.exports),toArray:function(e,t){if(Array.isArray(e))return e.slice();if(!e)return [];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),s=0;s>6|192,n[r++]=63&o|128):i(e,s)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++s)),n[r++]=o>>18|240,n[r++]=o>>12&63|128,n[r++]=o>>6&63|128,n[r++]=63&o|128):(n[r++]=o>>12|224,n[r++]=o>>6&63|128,n[r++]=63&o|128);}else for(s=0;s>>0;}return o},split32:function(e,t){for(var n=new Array(4*e.length),r=0,i=0;r>>24,n[i+1]=s>>>16&255,n[i+2]=s>>>8&255,n[i+3]=255&s):(n[i+3]=s>>>24,n[i+2]=s>>>16&255,n[i+1]=s>>>8&255,n[i]=255&s);}return n},rotr32:function(e,t){return e>>>t|e<<32-t},rotl32:function(e,t){return e<>>32-t},sum32:function(e,t){return e+t>>>0},sum32_3:function(e,t,n){return e+t+n>>>0},sum32_4:function(e,t,n,r){return e+t+n+r>>>0},sum32_5:function(e,t,n,r,i){return e+t+n+r+i>>>0},sum64:function(e,t,n,r){var i=e[t],s=r+e[t+1]>>>0,o=(s>>0,e[t+1]=s;},sum64_hi:function(e,t,n,r){return (t+r>>>0>>0},sum64_lo:function(e,t,n,r){return t+r>>>0},sum64_4_hi:function(e,t,n,r,i,s,o,a){var h=0,u=t;return h+=(u=u+r>>>0)>>0)>>0)>>0},sum64_4_lo:function(e,t,n,r,i,s,o,a){return t+r+s+a>>>0},sum64_5_hi:function(e,t,n,r,i,s,o,a,h,u){var c=0,l=t;return c+=(l=l+r>>>0)>>0)>>0)>>0)>>0},sum64_5_lo:function(e,t,n,r,i,s,o,a,h,u){return t+r+s+a+u>>>0},rotr64_hi:function(e,t,n){return (t<<32-n|e>>>n)>>>0},rotr64_lo:function(e,t,n){return (e<<32-n|t>>>n)>>>0},shr64_hi:function(e,t,n){return e>>>n},shr64_lo:function(e,t,n){return (e<<32-n|t>>>n)>>>0}};function u(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32;}var c=u;u.prototype.update=function(e,t){if(e=h.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=h.join32(e,0,e.length-n,this.endian);for(var r=0;r>>24&255,r[i++]=e>>>16&255,r[i++]=e>>>8&255,r[i++]=255&e;}else for(r[i++]=255&e,r[i++]=e>>>8&255,r[i++]=e>>>16&255,r[i++]=e>>>24&255,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,s=8;s>>3},g1_256:function(e){return p(e,17)^p(e,19)^e>>>10}},y=h.sum32,x=h.sum32_4,v=h.sum32_5,E=g.ch32,_=g.maj32,b=g.s0_256,A=g.s1_256,S=g.g0_256,I=g.g1_256,w=l.BlockHash,P=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function k(){if(!(this instanceof k))return new k;w.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=P,this.W=new Array(64);}h.inherits(k,w);var C=k;k.blockSize=512,k.outSize=256,k.hmacStrength=192,k.padLength=64,k.prototype._update=function(e,t){for(var r=this.W,i=0;i<16;i++)r[i]=e[t+i];for(;i>=1;var x=y?-p:p;0==c?(t+=x,h.push(t)):1===c?(n+=x,h.push(n)):2===c?(r+=x,h.push(r)):3===c?(i+=x,h.push(i)):4===c&&(s+=x,h.push(s)),c++,p=l=0;}}}return h.length&&a.push(new Int32Array(h)),o.push(a),o}function M(e){var t="";e=e<0?-e<<1|1:e<<1;do{var n=31&e;(e>>=5)>0&&(n|=32),t+=$[n];}while(e>0);return t}var T=function(e,t,n){this.start=e,this.end=t,this.original=n,this.intro="",this.outro="",this.content=n,this.storeName=!1,this.edited=!1,Object.defineProperties(this,{previous:{writable:!0,value:null},next:{writable:!0,value:null}});};T.prototype.appendLeft=function(e){this.outro+=e;},T.prototype.appendRight=function(e){this.intro=this.intro+e;},T.prototype.clone=function(){var e=new T(this.start,this.end,this.original);return e.intro=this.intro,e.outro=this.outro,e.content=this.content,e.storeName=this.storeName,e.edited=this.edited,e},T.prototype.contains=function(e){return this.start0&&(s+=";"),0!==a.length){for(var h=0,u=[],c=0,l=a;c1&&(d+=M(p[1]-t)+M(p[2]-n)+M(p[3]-r),t=p[1],n=p[2],r=p[3]),5===p.length&&(d+=M(p[4]-i),i=p[4]),u.push(d);}s+=u.join(",");}}return s}(e.mappings);};function V(e){var t=e.split("\n"),n=t.filter(function(e){return /^\t+/.test(e)}),r=t.filter(function(e){return /^ {2,}/.test(e)});if(0===n.length&&0===r.length)return null;if(n.length>=r.length)return "\t";var i=r.reduce(function(e,t){var n=/^ +/.exec(t)[0].length;return Math.min(n,e)},1/0);return new Array(i+1).join(" ")}function B(e,t){var n=e.split(/[\/\\]/),r=t.split(/[\/\\]/);for(n.pop();n[0]===r[0];)n.shift(),r.shift();if(n.length)for(var i=n.length;i--;)n[i]="..";return n.concat(r).join("/")}L.prototype.toString=function(){return JSON.stringify(this)},L.prototype.toUrl=function(){return "data:application/json;charset=utf-8;base64,"+D(this.toString())};var z=Object.prototype.toString;function j(e){return "[object Object]"===z.call(e)}function W(e){for(var t=e.split("\n"),n=[],r=0,i=0;r>1;e=0&&i.push(r),this.rawSegments.push(i);}else this.pending&&this.rawSegments.push(this.pending);this.advance(t),this.pending=null;},U.prototype.addUneditedChunk=function(e,t,n,r,i){for(var s=t.start,o=!0;s1){for(var n=0;n=e&&n<=t)throw new Error("Cannot move a selection inside itself");this._split(e),this._split(t),this._split(n);var r=this.byStart[e],i=this.byEnd[t],s=r.previous,o=i.next,a=this.byStart[n];if(!a&&i===this.lastChunk)return this;var h=a?a.previous:this.lastChunk;return s&&(s.next=o),o&&(o.previous=s),h&&(h.next=r),a&&(a.previous=i),r.previous||(this.firstChunk=i.next),i.next||(this.lastChunk=r.previous,this.lastChunk.next=null),r.previous=h,i.next=a||null,h||(this.firstChunk=r),a||(this.lastChunk=i),this},G.prototype.overwrite=function(e,t,n,r){if("string"!=typeof n)throw new TypeError("replacement content must be a string");for(;e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length;if(t>this.original.length)throw new Error("end is out of bounds");if(e===t)throw new Error("Cannot overwrite a zero-length range – use appendLeft or prependRight instead");this._split(e),this._split(t),!0===r&&(q.storeName||(console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"),q.storeName=!0),r={storeName:!0});var i=void 0!==r&&r.storeName,s=void 0!==r&&r.contentOnly;if(i){var o=this.original.slice(e,t);this.storedNames[o]=!0;}var a=this.byStart[e],h=this.byEnd[t];if(a){if(t>a.end&&a.next!==this.byStart[a.end])throw new Error("Cannot overwrite across a split point");if(a.edit(n,i,s),a!==h){for(var u=a.next;u!==h;)u.edit("",!1),u=u.next;u.edit("",!1);}}else{var c=new T(e,t,"").edit(n,i);h.next=c,c.previous=h;}return this},G.prototype.prepend=function(e){if("string"!=typeof e)throw new TypeError("outro content must be a string");return this.intro=e+this.intro,this},G.prototype.prependLeft=function(e,t){if("string"!=typeof t)throw new TypeError("inserted content must be a string");this._split(e);var n=this.byEnd[e];return n?n.prependLeft(t):this.intro=t+this.intro,this},G.prototype.prependRight=function(e,t){if("string"!=typeof t)throw new TypeError("inserted content must be a string");this._split(e);var n=this.byStart[e];return n?n.prependRight(t):this.outro=t+this.outro,this},G.prototype.remove=function(e,t){for(;e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length;if(e===t)return this;if(e<0||t>this.original.length)throw new Error("Character is out of bounds");if(e>t)throw new Error("end must be greater than start");this._split(e),this._split(t);for(var n=this.byStart[e];n;)n.intro="",n.outro="",n.edit(""),n=t>n.end?this.byStart[n.end]:null;return this},G.prototype.lastChar=function(){if(this.outro.length)return this.outro[this.outro.length-1];var e=this.lastChunk;do{if(e.outro.length)return e.outro[e.outro.length-1];if(e.content.length)return e.content[e.content.length-1];if(e.intro.length)return e.intro[e.intro.length-1]}while(e=e.previous);return this.intro.length?this.intro[this.intro.length-1]:""},G.prototype.lastLine=function(){var e=this.outro.lastIndexOf(F);if(-1!==e)return this.outro.substr(e+1);var t=this.outro,n=this.lastChunk;do{if(n.outro.length>0){if(-1!==(e=n.outro.lastIndexOf(F)))return n.outro.substr(e+1)+t;t=n.outro+t;}if(n.content.length>0){if(-1!==(e=n.content.lastIndexOf(F)))return n.content.substr(e+1)+t;t=n.content+t;}if(n.intro.length>0){if(-1!==(e=n.intro.lastIndexOf(F)))return n.intro.substr(e+1)+t;t=n.intro+t;}}while(n=n.previous);return -1!==(e=this.intro.lastIndexOf(F))?this.intro.substr(e+1)+t:this.intro+t},G.prototype.slice=function(e,t){for(void 0===e&&(e=0),void 0===t&&(t=this.original.length);e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length;for(var n="",r=this.firstChunk;r&&(r.start>e||r.end<=e);){if(r.start=t)return n;r=r.next;}if(r&&r.edited&&r.start!==e)throw new Error("Cannot use replaced character "+e+" as slice start anchor.");for(var i=r;r;){!r.intro||i===r&&r.start!==e||(n+=r.intro);var s=r.start=t;if(s&&r.edited&&r.end!==t)throw new Error("Cannot use replaced character "+t+" as slice end anchor.");var o=i===r?e-r.start:0,a=s?r.content.length+t-r.end:r.content.length;if(n+=r.content.slice(o,a),!r.outro||s&&r.end!==t||(n+=r.outro),s)break;r=r.next;}return n},G.prototype.snip=function(e,t){var n=this.clone();return n.remove(0,e),n.remove(t,n.original.length),n},G.prototype._split=function(e){if(!this.byStart[e]&&!this.byEnd[e])for(var t=this.lastSearchedChunk,n=e>t.end;t;){if(t.contains(e))return this._splitChunk(t,e);t=n?this.byStart[t.end]:this.byEnd[t.start];}},G.prototype._splitChunk=function(e,t){if(e.edited&&e.content.length){var n=W(this.original)(t);throw new Error("Cannot split a chunk that has already been edited ("+n.line+":"+n.column+' – "'+e.original+'")')}var r=e.split(t);return this.byEnd[t]=e,this.byStart[t]=r,this.byEnd[r.end]=r,e===this.lastChunk&&(this.lastChunk=r),this.lastSearchedChunk=e,!0},G.prototype.toString=function(){for(var e=this.intro,t=this.firstChunk;t;)e+=t.toString(),t=t.next;return e+this.outro},G.prototype.isEmpty=function(){var e=this.firstChunk;do{if(e.intro.length&&e.intro.trim()||e.content.length&&e.content.trim()||e.outro.length&&e.outro.trim())return !1}while(e=e.next);return !0},G.prototype.length=function(){var e=this.firstChunk,t=0;do{t+=e.intro.length+e.content.length+e.outro.length;}while(e=e.next);return t},G.prototype.trimLines=function(){return this.trim("[\\r\\n]")},G.prototype.trim=function(e){return this.trimStart(e).trimEnd(e)},G.prototype.trimEndAborted=function(e){var t=new RegExp((e||"\\s")+"+$");if(this.outro=this.outro.replace(t,""),this.outro.length)return !0;var n=this.lastChunk;do{var r=n.end,i=n.trimEnd(t);if(n.end!==r&&(this.lastChunk===n&&(this.lastChunk=n.next),this.byEnd[n.end]=n,this.byStart[n.next.start]=n.next,this.byEnd[n.next.end]=n.next),i)return !0;n=n.previous;}while(n);return !1},G.prototype.trimEnd=function(e){return this.trimEndAborted(e),this},G.prototype.trimStartAborted=function(e){var t=new RegExp("^"+(e||"\\s")+"+");if(this.intro=this.intro.replace(t,""),this.intro.length)return !0;var n=this.firstChunk;do{var r=n.end,i=n.trimStart(t);if(n.end!==r&&(n===this.lastChunk&&(this.lastChunk=n.next),this.byEnd[n.end]=n,this.byStart[n.next.start]=n.next,this.byEnd[n.next.end]=n.next),i)return !0;n=n.next;}while(n);return !1},G.prototype.trimStart=function(e){return this.trimStartAborted(e),this};var H=Object.prototype.hasOwnProperty,K=function(e){void 0===e&&(e={}),this.intro=e.intro||"",this.separator=void 0!==e.separator?e.separator:"\n",this.sources=[],this.uniqueSources=[],this.uniqueSourceIndexByFilename={};};K.prototype.addSource=function(e){if(e instanceof G)return this.addSource({content:e,filename:e.filename,separator:this.separator});if(!j(e)||!e.content)throw new Error("bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`");if(["filename","indentExclusionRanges","separator"].forEach(function(t){H.call(e,t)||(e[t]=e.content[t]);}),void 0===e.separator&&(e.separator=this.separator),e.filename)if(H.call(this.uniqueSourceIndexByFilename,e.filename)){var t=this.uniqueSources[this.uniqueSourceIndexByFilename[e.filename]];if(e.content.original!==t.content)throw new Error("Illegal source: same filename ("+e.filename+"), different contents")}else this.uniqueSourceIndexByFilename[e.filename]=this.uniqueSources.length,this.uniqueSources.push({filename:e.filename,content:e.content.original});return this.sources.push(e),this},K.prototype.append=function(e,t){return this.addSource({content:new G(e),separator:t&&t.separator||""}),this},K.prototype.clone=function(){var e=new K({intro:this.intro,separator:this.separator});return this.sources.forEach(function(t){e.addSource({filename:t.filename,content:t.content.clone(),separator:t.separator});}),e},K.prototype.generateDecodedMap=function(e){var t=this;void 0===e&&(e={});var n=[];this.sources.forEach(function(e){Object.keys(e.content.storedNames).forEach(function(e){~n.indexOf(e)||n.push(e);});});var r=new U(e.hires);return this.intro&&r.advance(this.intro),this.sources.forEach(function(e,i){i>0&&r.advance(t.separator);var s=e.filename?t.uniqueSourceIndexByFilename[e.filename]:-1,o=e.content,a=W(o.original);o.intro&&r.advance(o.intro),o.firstChunk.eachNext(function(t){var i=a(t.start);t.intro.length&&r.advance(t.intro),e.filename?t.edited?r.addEdit(s,t.content,i,t.storeName?n.indexOf(t.original):-1):r.addUneditedChunk(s,t,o.original,i,o.sourcemapLocations):r.advance(t.content),t.outro.length&&r.advance(t.outro);}),o.outro&&r.advance(o.outro);}),{file:e.file?e.file.split(/[\/\\]/).pop():null,sources:this.uniqueSources.map(function(t){return e.file?B(e.file,t.filename):t.filename}),sourcesContent:this.uniqueSources.map(function(t){return e.includeContent?t.content:null}),names:n,mappings:r.raw}},K.prototype.generateMap=function(e){return new L(this.generateDecodedMap(e))},K.prototype.getIndentString=function(){var e={};return this.sources.forEach(function(t){var n=t.content.indentStr;null!==n&&(e[n]||(e[n]=0),e[n]+=1);}),Object.keys(e).sort(function(t,n){return e[t]-e[n]})[0]||"\t"},K.prototype.indent=function(e){var t=this;if(arguments.length||(e=this.getIndentString()),""===e)return this;var n=!this.intro||"\n"===this.intro.slice(-1);return this.sources.forEach(function(r,i){var s=void 0!==r.separator?r.separator:t.separator,o=n||i>0&&/\r?\n$/.test(s);r.content.indent(e,{exclude:r.indentExclusionRanges,indentStart:o}),n="\n"===r.content.lastChar();}),this.intro&&(this.intro=e+this.intro.replace(/^[^\n]/gm,function(t,n){return n>0?e+t:t})),this},K.prototype.prepend=function(e){return this.intro=e+this.intro,this},K.prototype.toString=function(){var e=this,t=this.sources.map(function(t,n){var r=void 0!==t.separator?t.separator:e.separator;return (n>0?r:"")+t.content.toString()}).join("");return this.intro+t},K.prototype.isEmpty=function(){return (!this.intro.length||!this.intro.trim())&&!this.sources.some(function(e){return !e.content.isEmpty()})},K.prototype.length=function(){return this.sources.reduce(function(e,t){return e+t.content.length()},this.intro.length)},K.prototype.trimLines=function(){return this.trim("[\\r\\n]")},K.prototype.trim=function(e){return this.trimStart(e).trimEnd(e)},K.prototype.trimStart=function(e){var t=new RegExp("^"+(e||"\\s")+"+");if(this.intro=this.intro.replace(t,""),!this.intro){var n,r=0;do{if(!(n=this.sources[r++]))break}while(!n.content.trimStartAborted(e))}return this},K.prototype.trimEnd=function(e){var t,n=new RegExp((e||"\\s")+"+$"),r=this.sources.length-1;do{if(!(t=this.sources[r--])){this.intro=this.intro.replace(n,"");break}}while(!t.content.trimEndAborted(e));return this};const Y=Object.create(null),X="BlockStatement",Q="CallExpression",J="ExportAllDeclaration",Z="ExpressionStatement",ee="FunctionExpression",te="Identifier",ne="ImportDefaultSpecifier",re="ImportNamespaceSpecifier",ie="Program",se="Property",oe="ReturnStatement",ae="VariableDeclaration";function he(e,t,n,r){if(t.remove(n,r),e.annotations)for(const r of e.annotations){if(!(r.startr)return r;if(i=e.charCodeAt(++n),++n,47===i){if(0===(n=e.indexOf("\n",n)+1))return -1;n>r&&(r=e.indexOf(t,n));}else 42===i&&(n=e.indexOf("*/",n)+2)>r&&(r=e.indexOf(t,n));}}function pe(e,t=0){let n,r;for(n=e.indexOf("\n",t);;){if(-1===(t=e.indexOf("/",t))||t>n)return n;if(47===(r=e.charCodeAt(++t)))return n;++t,42===r&&(t=e.indexOf("*/",t)+2)>n&&(n=e.indexOf("\n",t));}}function de(e,t,n,r,i){if(0===e.length)return;let s,o,a,h,u=e[0],c=!u.included||u.needsBoundaries;c&&(h=n+pe(t.original.slice(n,u.start))+1);for(let n=1;n<=e.length;n++)s=u,o=h,a=c,c=void 0!==(u=e[n])&&(!u.included||u.needsBoundaries),a||c?(h=s.end+pe(t.original.slice(s.end,void 0===u?r:u.start))+1,s.included?a?s.render(t,i,{end:h,start:o}):s.render(t,i):he(s,t,o,h)):s.render(t,i);}function fe(e,t,n,r){const i=[];let s,o,a,h,u,c=n-1;for(let r=0;r{},getLiteralValueAtPath:()=>Se,getReturnExpressionWhenCalledAtPath:()=>Ie,hasEffectsWhenAccessedAtPath:e=>e.length>0,hasEffectsWhenAssignedAtPath:e=>e.length>0,hasEffectsWhenCalledAtPath:()=>!0,include:()=>{},included:!0,toString:()=>"[[UNKNOWN]]"},we={deoptimizePath:()=>{},getLiteralValueAtPath:()=>void 0,getReturnExpressionWhenCalledAtPath:()=>Ie,hasEffectsWhenAccessedAtPath:e=>e.length>0,hasEffectsWhenAssignedAtPath:e=>e.length>0,hasEffectsWhenCalledAtPath:()=>!0,include:()=>{},included:!0,toString:()=>"undefined"},Pe={value:{returns:null,returnsPrimitive:Ie,callsArgs:null,mutatesSelf:!0}},ke={value:{returns:null,returnsPrimitive:Ie,callsArgs:[0],mutatesSelf:!1}};class Ce{constructor(){this.included=!1;}deoptimizePath(){}getLiteralValueAtPath(){return Se}getReturnExpressionWhenCalledAtPath(e){return 1===e.length?Xe(qe,e[0]):Ie}hasEffectsWhenAccessedAtPath(e){return e.length>1}hasEffectsWhenAssignedAtPath(e){return e.length>1}hasEffectsWhenCalledAtPath(e,t,n){return 1!==e.length||Ye(qe,e[0],this.included,t,n)}include(){this.included=!0;}toString(){return "[[UNKNOWN ARRAY]]"}}const Ne={value:{callsArgs:null,mutatesSelf:!1,returns:Ce,returnsPrimitive:null}},$e={value:{callsArgs:null,mutatesSelf:!0,returns:Ce,returnsPrimitive:null}},Re={value:{callsArgs:[0],mutatesSelf:!1,returns:Ce,returnsPrimitive:null}},Oe={value:{callsArgs:[0],mutatesSelf:!0,returns:Ce,returnsPrimitive:null}},Me={deoptimizePath:()=>{},getLiteralValueAtPath:()=>Se,getReturnExpressionWhenCalledAtPath:e=>1===e.length?Xe(Ge,e[0]):Ie,hasEffectsWhenAccessedAtPath:e=>e.length>1,hasEffectsWhenAssignedAtPath:e=>e.length>0,hasEffectsWhenCalledAtPath:e=>{if(1===e.length){const t=e[0];return "string"!=typeof t||!Ge[t]}return !0},include:()=>{},included:!0,toString:()=>"[[UNKNOWN BOOLEAN]]"},Te={value:{callsArgs:null,mutatesSelf:!1,returns:null,returnsPrimitive:Me}},De={value:{callsArgs:[0],mutatesSelf:!1,returns:null,returnsPrimitive:Me}},Le={deoptimizePath:()=>{},getLiteralValueAtPath:()=>Se,getReturnExpressionWhenCalledAtPath:e=>1===e.length?Xe(He,e[0]):Ie,hasEffectsWhenAccessedAtPath:e=>e.length>1,hasEffectsWhenAssignedAtPath:e=>e.length>0,hasEffectsWhenCalledAtPath:e=>{if(1===e.length){const t=e[0];return "string"!=typeof t||!He[t]}return !0},include:()=>{},included:!0,toString:()=>"[[UNKNOWN NUMBER]]"},Ve={value:{callsArgs:null,mutatesSelf:!1,returns:null,returnsPrimitive:Le}},Be={value:{callsArgs:null,mutatesSelf:!0,returns:null,returnsPrimitive:Le}},ze={value:{callsArgs:[0],mutatesSelf:!1,returns:null,returnsPrimitive:Le}},je={deoptimizePath:()=>{},getLiteralValueAtPath:()=>Se,getReturnExpressionWhenCalledAtPath:e=>1===e.length?Xe(Ke,e[0]):Ie,hasEffectsWhenAccessedAtPath:e=>e.length>1,hasEffectsWhenAssignedAtPath:e=>e.length>0,hasEffectsWhenCalledAtPath:(e,t,n)=>1!==e.length||Ye(Ke,e[0],!0,t,n),include:()=>{},included:!0,toString:()=>"[[UNKNOWN STRING]]"},We={value:{callsArgs:null,mutatesSelf:!1,returns:null,returnsPrimitive:je}};class Ue{constructor(){this.included=!1;}deoptimizePath(){}getLiteralValueAtPath(){return Se}getReturnExpressionWhenCalledAtPath(e){return 1===e.length?Xe(Fe,e[0]):Ie}hasEffectsWhenAccessedAtPath(e){return e.length>1}hasEffectsWhenAssignedAtPath(e){return e.length>1}hasEffectsWhenCalledAtPath(e,t,n){return 1!==e.length||Ye(Fe,e[0],this.included,t,n)}include(){this.included=!0;}toString(){return "[[UNKNOWN OBJECT]]"}}const Fe=Ae({hasOwnProperty:Te,isPrototypeOf:Te,propertyIsEnumerable:Te,toLocaleString:We,toString:We,valueOf:{value:{callsArgs:null,mutatesSelf:!1,returns:null,returnsPrimitive:Ie}}}),qe=Ae({concat:Ne,copyWithin:$e,every:De,fill:$e,filter:Re,find:ke,findIndex:ze,forEach:ke,includes:Te,indexOf:Ve,join:We,lastIndexOf:Ve,map:Re,pop:Pe,push:Be,reduce:ke,reduceRight:ke,reverse:$e,shift:Pe,slice:Ne,some:De,sort:Oe,splice:$e,unshift:Be},Fe),Ge=Ae({valueOf:Te},Fe),He=Ae({toExponential:We,toFixed:We,toLocaleString:We,toPrecision:We,valueOf:Ve},Fe),Ke=Ae({charAt:We,charCodeAt:Ve,codePointAt:Ve,concat:We,endsWith:Te,includes:Te,indexOf:Ve,lastIndexOf:Ve,localeCompare:Ve,match:Te,normalize:We,padEnd:We,padStart:We,repeat:We,replace:{value:{callsArgs:[1],mutatesSelf:!1,returns:null,returnsPrimitive:je}},search:Ve,slice:We,split:Ne,startsWith:Te,substr:We,substring:We,toLocaleLowerCase:We,toLocaleUpperCase:We,toLowerCase:We,toUpperCase:We,trim:We,valueOf:We},Fe);function Ye(e,t,n,r,i){if("string"!=typeof t||!e[t])return !0;if(e[t].mutatesSelf&&n)return !0;if(!e[t].callsArgs)return !1;for(const n of e[t].callsArgs)if(r.args[n]&&r.args[n].hasEffectsWhenCalledAtPath(_e,ve.create({args:[],callIdentifier:{},withNew:!1}),i.getHasEffectsWhenCalledOptions()))return !0;return !1}function Xe(e,t){return "string"==typeof t&&e[t]?null!==e[t].returnsPrimitive?e[t].returnsPrimitive:new e[t].returns:Ie}class Qe{constructor(e){this.exportName=null,this.included=!1,this.isId=!1,this.isReassigned=!1,this.reexported=!1,this.renderBaseName=null,this.renderName=null,this.safeExportName=null,this.name=e;}addReference(e){}deoptimizePath(e){}getBaseVariableName(){return this.renderBaseName||this.renderName||this.name}getLiteralValueAtPath(e,t,n){return Se}getName(){const e=this.renderName||this.name;return this.renderBaseName?`${this.renderBaseName}.${e}`:e}getReturnExpressionWhenCalledAtPath(e,t,n){return Ie}hasEffectsWhenAccessedAtPath(e,t){return e.length>0}hasEffectsWhenAssignedAtPath(e,t){return !0}hasEffectsWhenCalledAtPath(e,t,n){return !0}include(){this.included=!0;}setRenderNames(e,t){this.renderBaseName=e,this.renderName=t;}setSafeName(e){this.renderName=e;}toString(){return this.name}}class Je extends Qe{constructor(e,t){super(t),this.module=e,this.isNamespace="*"===t,this.referenced=!1;}addReference(e){this.referenced=!0,"default"!==this.name&&"*"!==this.name||this.module.suggestName(e.name);}include(){this.included||(this.included=!0,this.module.used=!0);}}Je.prototype.isExternal=!0;const Ze="break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public".split(" "),et="Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl".split(" "),tt=Object.create(null);Ze.concat(et).forEach(e=>tt[e]=!0);const nt=/[^$_a-zA-Z0-9]/g,rt=e=>/\d/.test(e[0]);function it(e){return e=e.replace(/-(\w)/g,(e,t)=>t.toUpperCase()).replace(nt,"_"),(rt(e)||tt[e])&&(e=`_${e}`),e}const st=/^(?:\/|(?:[A-Za-z]:)?[\\|\/])/,ot=/^\.?\.\//;function at(e){return st.test(e)}function ht(e){return ot.test(e)}function ut(e){return e.replace(/\\/g,"/")}function ct(e){return e.split(/(\/|\\)/).pop()}function lt(e){const t=/(\/|\\)[^\/\\]*$/.exec(e);if(!t)return ".";const n=e.slice(0,-t[0].length);return n||"/"}function pt(e){const t=/\.[^.]+$/.exec(ct(e));return t?t[0]:""}function dt(e,t){const n=e.split(/[\/\\]/).filter(Boolean),r=t.split(/[\/\\]/).filter(Boolean);for(;n[0]&&r[0]&&n[0]===r[0];)n.shift(),r.shift();for(;"."===r[0]||".."===r[0];){".."===r.shift()&&n.pop();}for(;n.pop();)r.unshift("..");return r.join("/")}function ft(...e){let t=e.shift().split(/[\/\\]/);return e.forEach(e=>{if(at(e))t=e.split(/[\/\\]/);else{const n=e.split(/[\/\\]/);for(;"."===n[0]||".."===n[0];){".."===n.shift()&&t.pop();}t.push.apply(t,n);}}),t.join("/")}class mt{constructor(e,t,n){this.exportsNames=!1,this.exportsNamespace=!1,this.isExternal=!0,this.mostCommonSuggestion=0,this.reexported=!1,this.renderPath=void 0,this.renormalizeRenderPath=!1,this.used=!1,this.graph=e,this.id=t,this.execIndex=1/0,this.moduleSideEffects=n;const r=t.split(/[\\\/]/);this.variableName=it(r.pop()),this.nameSuggestions=Object.create(null),this.declarations=Object.create(null),this.exportedVariables=new Map;}getVariableForExportName(e,t){"default"!==e&&"*"!==e&&(this.exportsNames=!0),"*"===e&&(this.exportsNamespace=!0);let n=this.declarations[e];return n||(this.declarations[e]=n=new Je(this,e),this.exportedVariables.set(n,e),n)}setRenderPath(e,t){return this.renderPath="",e.paths&&(this.renderPath="function"==typeof e.paths?e.paths(this.id):e.paths[this.id]),this.renderPath||(at(this.id)?(this.renderPath=ut(dt(t,this.id)),this.renormalizeRenderPath=!0):this.renderPath=this.id),this.renderPath}suggestName(e){this.nameSuggestions[e]||(this.nameSuggestions[e]=0),this.nameSuggestions[e]+=1,this.nameSuggestions[e]>this.mostCommonSuggestion&&(this.mostCommonSuggestion=this.nameSuggestions[e],this.variableName=e);}warnUnusedImports(){const e=Object.keys(this.declarations).filter(e=>{if("*"===e)return !1;const t=this.declarations[e];return !t.included&&!this.reexported&&!t.referenced});if(0===e.length)return;const t=1===e.length?`'${e[0]}' is`:`${e.slice(0,-1).map(e=>`'${e}'`).join(", ")} and '${e.slice(-1)}' are`;this.graph.warn({code:"UNUSED_EXTERNAL_IMPORT",message:`${t} imported from external module '${this.id}' but never used`,names:e,source:this.id});}}function gt(e){e.isExecuted=!0;const t=[e],n={};for(const e of t)for(const r of e.dependencies)r instanceof mt||r.isExecuted||!r.moduleSideEffects||n[r.id]||(r.isExecuted=!0,n[r.id]=!0,t.push(r));}const yt=7;class xt extends Qe{constructor(e,t,n,r){super(e),this.additionalInitializers=null,this.expressionsToBeDeoptimized=[],this.declarations=t?[t]:[],this.init=n,this.deoptimizationTracker=r.deoptimizationTracker,this.module=r.module;}addDeclaration(e,t){this.declarations.push(e),null===this.additionalInitializers&&(this.additionalInitializers=null===this.init?[]:[this.init],this.init=Ie,this.isReassigned=!0),null!==t&&this.additionalInitializers.push(t);}consolidateInitializers(){if(null!==this.additionalInitializers){for(const e of this.additionalInitializers)e.deoptimizePath(be);this.additionalInitializers=null;}}deoptimizePath(e){if(!(e.length>yt||this.isReassigned||this.deoptimizationTracker.track(this,e)))if(0===e.length){if(!this.isReassigned){this.isReassigned=!0;for(const e of this.expressionsToBeDeoptimized)e.deoptimizeCache();this.init&&this.init.deoptimizePath(be);}}else this.init&&this.init.deoptimizePath(e);}getLiteralValueAtPath(e,t,n){return this.isReassigned||!this.init||e.length>yt||t.isTracked(this.init,e)?Se:(this.expressionsToBeDeoptimized.push(n),this.init.getLiteralValueAtPath(e,t.track(this.init,e),n))}getReturnExpressionWhenCalledAtPath(e,t,n){return this.isReassigned||!this.init||e.length>yt||t.isTracked(this.init,e)?Ie:(this.expressionsToBeDeoptimized.push(n),this.init.getReturnExpressionWhenCalledAtPath(e,t.track(this.init,e),n))}hasEffectsWhenAccessedAtPath(e,t){return 0!==e.length&&(this.isReassigned||e.length>yt||this.init&&!t.hasNodeBeenAccessedAtPath(e,this.init)&&this.init.hasEffectsWhenAccessedAtPath(e,t.addAccessedNodeAtPath(e,this.init)))}hasEffectsWhenAssignedAtPath(e,t){return !!(this.included||e.length>yt)||0!==e.length&&(this.isReassigned||this.init&&!t.hasNodeBeenAssignedAtPath(e,this.init)&&this.init.hasEffectsWhenAssignedAtPath(e,t.addAssignedNodeAtPath(e,this.init)))}hasEffectsWhenCalledAtPath(e,t,n){return e.length>yt||(this.isReassigned||this.init&&!n.hasNodeBeenCalledAtPathWithOptions(e,this.init,t)&&this.init.hasEffectsWhenCalledAtPath(e,t,n.addCalledNodeAtPathWithOptions(e,this.init,t)))}include(){if(!this.included){this.included=!0,this.module.isExecuted||gt(this.module);for(const e of this.declarations){e.included||e.include(!1);let t=e.parent;for(;!t.included&&(t.included=!0,t.type!==ie);)t=t.parent;}}}}xt.prototype.isLocal=!0;class vt{constructor(){this.children=[],this.variables=Object.create(null);}addDeclaration(e,t,n=null,r){const i=e.name;return this.variables[i]?this.variables[i].addDeclaration(e,n):this.variables[i]=new xt(e.name,e,n||we,t),this.variables[i]}contains(e){return e in this.variables}findVariable(e){throw new Error("Internal Error: findVariable needs to be implemented by a subclass")}}class Et extends vt{constructor(e){super(),this.accessedOutsideVariables=Object.create(null),this.parent=e,e.children.push(this);}addNamespaceMemberAccess(e,t){this.accessedOutsideVariables[e]=t,this.parent instanceof Et&&this.parent.addNamespaceMemberAccess(e,t);}addReturnExpression(e){this.parent instanceof Et&&this.parent.addReturnExpression(e);}contains(e){return e in this.variables||this.parent.contains(e)}deconflict(e){const t=Object.assign(Object.create(null),e);for(const e of Object.keys(this.accessedOutsideVariables)){const n=this.accessedOutsideVariables[e];n.included&&(t[n.getBaseVariableName()]=!0);}for(const e of Object.keys(this.variables)){const n=this.variables[e];n.included&&n.setSafeName(xe(e,t));}for(const t of this.children)t.deconflict(e);}findLexicalBoundary(){return this.parent instanceof Et?this.parent.findLexicalBoundary():this}findVariable(e){const t=this.variables[e]||this.accessedOutsideVariables[e];return t||(this.accessedOutsideVariables[e]=this.parent.findVariable(e))}}function _t(e,t,n){if("number"==typeof n)throw new Error("locate takes a { startIndex, offsetLine, offsetColumn } object as the third argument");return function(e,t){void 0===t&&(t={});var n=t.offsetLine||0,r=t.offsetColumn||0,i=e.split("\n"),s=0,o=i.map(function(e,t){var n=s+e.length+1,r={start:s,end:n,line:t};return s=n,r}),a=0;function h(e,t){return e.start<=t&&t=r.end?1:-1;r;){if(h(r,t))return u(r,t);r=o[a+=i];}}}(e,n)(t,n&&n.startIndex)}var bt=5,At=1<>>0;if(""+n!==t||4294967295===n)return NaN;t=n;}return t<0?kt(e)+t:t}function Nt(){return !0}function $t(e,t,n){return (0===e&&!Tt(e)||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function Rt(e,t){return Mt(e,t,0)}function Ot(e,t){return Mt(e,t,t)}function Mt(e,t,n){return void 0===e?n:Tt(e)?t===1/0?t:0|Math.max(0,t+e):void 0===t||t===e?e:0|Math.min(t,e)}function Tt(e){return e<0||0===e&&1/e==-1/0}var Dt="@@__IMMUTABLE_ITERABLE__@@";function Lt(e){return Boolean(e&&e[Dt])}var Vt="@@__IMMUTABLE_KEYED__@@";function Bt(e){return Boolean(e&&e[Vt])}var zt="@@__IMMUTABLE_INDEXED__@@";function jt(e){return Boolean(e&&e[zt])}function Wt(e){return Bt(e)||jt(e)}var Ut=function(e){return Lt(e)?e:gn(e)},Ft=function(e){function t(e){return Bt(e)?e:yn(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Ut),qt=function(e){function t(e){return jt(e)?e:xn(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Ut),Gt=function(e){function t(e){return Lt(e)&&!Wt(e)?e:vn(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Ut);Ut.Keyed=Ft,Ut.Indexed=qt,Ut.Set=Gt;var Ht="@@__IMMUTABLE_SEQ__@@";function Kt(e){return Boolean(e&&e[Ht])}var Yt="@@__IMMUTABLE_RECORD__@@";function Xt(e){return Boolean(e&&e[Yt])}function Qt(e){return Lt(e)||Xt(e)}var Jt="@@__IMMUTABLE_ORDERED__@@";function Zt(e){return Boolean(e&&e[Jt])}var en=0,tn=1,nn=2,rn="function"==typeof Symbol&&Symbol.iterator,sn="@@iterator",on=rn||sn,an=function(e){this.next=e;};function hn(e,t,n,r){var i=0===e?t:1===e?n:[t,n];return r?r.value=i:r={value:i,done:!1},r}function un(){return {value:void 0,done:!0}}function cn(e){return !!dn(e)}function ln(e){return e&&"function"==typeof e.next}function pn(e){var t=dn(e);return t&&t.call(e)}function dn(e){var t=e&&(rn&&e[rn]||e[sn]);if("function"==typeof t)return t}an.prototype.toString=function(){return "[Iterator]"},an.KEYS=en,an.VALUES=tn,an.ENTRIES=nn,an.prototype.inspect=an.prototype.toSource=function(){return this.toString()},an.prototype[on]=function(){return this};var fn=Object.prototype.hasOwnProperty;function mn(e){return !(!Array.isArray(e)&&"string"!=typeof e)||e&&"object"==typeof e&&Number.isInteger(e.length)&&e.length>=0&&(0===e.length?1===Object.keys(e).length:e.hasOwnProperty(e.length-1))}var gn=function(e){function t(e){return null==e?Sn():Qt(e)?e.toSeq():function(e){var t=Pn(e);if(t)return t;if("object"==typeof e)return new _n(e);throw new TypeError("Expected Array or collection object of values, or keyed object: "+e)}(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq {","}")},t.prototype.cacheResult=function(){return !this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},t.prototype.__iterate=function(e,t){var n=this._cache;if(n){for(var r=n.length,i=0;i!==r;){var s=n[t?r-++i:i++];if(!1===e(s[1],s[0],this))break}return i}return this.__iterateUncached(e,t)},t.prototype.__iterator=function(e,t){var n=this._cache;if(n){var r=n.length,i=0;return new an(function(){if(i===r)return {value:void 0,done:!0};var s=n[t?r-++i:i++];return hn(e,s[0],s[1])})}return this.__iteratorUncached(e,t)},t}(Ut),yn=function(e){function t(e){return null==e?Sn().toKeyedSeq():Lt(e)?Bt(e)?e.toSeq():e.fromEntrySeq():Xt(e)?e.toSeq():In(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toKeyedSeq=function(){return this},t}(gn),xn=function(e){function t(e){return null==e?Sn():Lt(e)?Bt(e)?e.entrySeq():e.toIndexedSeq():Xt(e)?e.toSeq().entrySeq():wn(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toIndexedSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq [","]")},t}(gn),vn=function(e){function t(e){return (Lt(e)&&!Wt(e)?e:xn(e)).toSetSeq()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toSetSeq=function(){return this},t}(gn);gn.isSeq=Kt,gn.Keyed=yn,gn.Set=vn,gn.Indexed=xn,gn.prototype[Ht]=!0;var En=function(e){function t(e){this._array=e,this.size=e.length;}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e,t){return this.has(e)?this._array[Ct(this,e)]:t},t.prototype.__iterate=function(e,t){for(var n=this._array,r=n.length,i=0;i!==r;){var s=t?r-++i:i++;if(!1===e(n[s],s,this))break}return i},t.prototype.__iterator=function(e,t){var n=this._array,r=n.length,i=0;return new an(function(){if(i===r)return {value:void 0,done:!0};var s=t?r-++i:i++;return hn(e,s,n[s])})},t}(xn),_n=function(e){function t(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length;}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},t.prototype.has=function(e){return fn.call(this._object,e)},t.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,i=r.length,s=0;s!==i;){var o=r[t?i-++s:s++];if(!1===e(n[o],o,this))break}return s},t.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,i=r.length,s=0;return new an(function(){if(s===i)return {value:void 0,done:!0};var o=r[t?i-++s:s++];return hn(e,o,n[o])})},t}(yn);_n.prototype[Jt]=!0;var bn,An=function(e){function t(e){this._collection=e,this.size=e.length||e.size;}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=pn(this._collection),r=0;if(ln(n))for(var i;!(i=n.next()).done&&!1!==e(i.value,r++,this););return r},t.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=pn(this._collection);if(!ln(n))return new an(un);var r=0;return new an(function(){var t=n.next();return t.done?t:hn(e,r++,t.value)})},t}(xn);function Sn(){return bn||(bn=new En([]))}function In(e){var t=Array.isArray(e)?new En(e):cn(e)?new An(e):void 0;if(t)return t.fromEntrySeq();if("object"==typeof e)return new _n(e);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+e)}function wn(e){var t=Pn(e);if(t)return t;throw new TypeError("Expected Array or collection object of values: "+e)}function Pn(e){return mn(e)?new En(e):cn(e)?new An(e):void 0}var kn="@@__IMMUTABLE_MAP__@@";function Cn(e){return Boolean(e&&e[kn])}function Nn(e){return Cn(e)&&Zt(e)}function $n(e){return Boolean(e&&"function"==typeof e.equals&&"function"==typeof e.hashCode)}function Rn(e,t){if(e===t||e!=e&&t!=t)return !0;if(!e||!t)return !1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if((e=e.valueOf())===(t=t.valueOf())||e!=e&&t!=t)return !0;if(!e||!t)return !1}return !!($n(e)&&$n(t)&&e.equals(t))}var On="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var n=65535&(e|=0),r=65535&(t|=0);return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0};function Mn(e){return e>>>1&1073741824|3221225471&e}var Tn=Object.prototype.valueOf;function Dn(e){switch(typeof e){case"boolean":return e?1108378657:1108378656;case"number":return function(e){if(e!=e||e===1/0)return 0;var t=0|e;t!==e&&(t^=4294967295*e);for(;e>4294967295;)t^=e/=4294967295;return Mn(t)}(e);case"string":return e.length>Fn?function(e){var t=Hn[e];void 0===t&&(t=Ln(e),Gn===qn&&(Gn=0,Hn={}),Gn++,Hn[e]=t);return t}(e):Ln(e);case"object":case"function":return null===e?1108378658:"function"==typeof e.hashCode?Mn(e.hashCode(e)):(e.valueOf!==Tn&&"function"==typeof e.valueOf&&(e=e.valueOf(e)),function(e){var t;if(jn&&void 0!==(t=zn.get(e)))return t;if(void 0!==(t=e[Un]))return t;if(!Bn){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[Un]))return t;if(void 0!==(t=function(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e)))return t}t=++Wn,1073741824&Wn&&(Wn=0);if(jn)zn.set(e,t);else{if(void 0!==Vn&&!1===Vn(e))throw new Error("Non-extensible objects are not allowed as keys.");if(Bn)Object.defineProperty(e,Un,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[Un]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[Un]=t;}}return t}(e));case"undefined":return 1108378659;default:if("function"==typeof e.toString)return Ln(e.toString());throw new Error("Value type "+typeof e+" cannot be hashed.")}}function Ln(e){for(var t=0,n=0;n=0&&(u.get=function(t,n){return (t=Ct(this,t))>=0&&ta)return {value:void 0,done:!0};var e=i.next();return r||t===tn||e.done?e:hn(t,h-1,t===en?void 0:e.value[1],e)})},u}function rr(e,t,n,r){var i=pr(e);return i.__iterateUncached=function(i,s){var o=this;if(s)return this.cacheResult().__iterate(i,s);var a=!0,h=0;return e.__iterate(function(e,s,u){if(!a||!(a=t.call(n,e,s,u)))return h++,i(e,r?s:h-1,o)}),h},i.__iteratorUncached=function(i,s){var o=this;if(s)return this.cacheResult().__iterator(i,s);var a=e.__iterator(nn,s),h=!0,u=0;return new an(function(){var e,s,c;do{if((e=a.next()).done)return r||i===tn?e:hn(i,u++,i===en?void 0:e.value[1],e);var l=e.value;s=l[0],c=l[1],h&&(h=t.call(n,c,s,o));}while(h);return i===nn?e:hn(i,s,c,e)})},i}function ir(e,t,n){var r=pr(e);return r.__iterateUncached=function(i,s){if(s)return this.cacheResult().__iterate(i,s);var o=0,a=!1;return function e(h,u){h.__iterate(function(s,h){return (!t||u0}function hr(e,t,n,r){var i=pr(e),s=new En(n).map(function(e){return e.size});return i.size=r?s.max():s.min(),i.__iterate=function(e,t){for(var n,r=this.__iterator(tn,t),i=0;!(n=r.next()).done&&!1!==e(n.value,i++,this););return i},i.__iteratorUncached=function(e,i){var s=n.map(function(e){return e=Ut(e),pn(i?e.reverse():e)}),o=0,a=!1;return new an(function(){var n;return a||(n=s.map(function(e){return e.next()}),a=r?n.every(function(e){return e.done}):n.some(function(e){return e.done})),a?{value:void 0,done:!0}:hn(e,o++,t.apply(null,n.map(function(e){return e.value})))})},i}function ur(e,t){return e===t?e:Kt(e)?t:e.constructor(t)}function cr(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function lr(e){return Bt(e)?Ft:jt(e)?qt:Gt}function pr(e){return Object.create((Bt(e)?yn:jt(e)?xn:vn).prototype)}function dr(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):gn.prototype.cacheResult.call(this)}function fr(e,t){return void 0===e&&void 0===t?0:void 0===e?1:void 0===t?-1:e>t?1:e0;)t[n]=arguments[n+1];if("function"!=typeof e)throw new TypeError("Invalid merger function: "+e);return Lr(this,t,e)}function Lr(e,t,n){for(var r=[],i=0;i0;)t[n]=arguments[n+1];return Vr(this,t,e)}function Wr(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return Pr(this,e,oi(),function(e){return Br(e,t)})}function Ur(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return Pr(this,e,oi(),function(e){return Vr(e,t)})}function Fr(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this}function qr(){return this.__ownerID?this:this.__ensureOwner(new Pt)}function Gr(){return this.__ensureOwner()}function Hr(){return this.__altered}Yn.prototype.cacheResult=Kn.prototype.cacheResult=Xn.prototype.cacheResult=Qn.prototype.cacheResult=dr;var Kr=function(e){function t(t){return null==t?oi():Cn(t)&&!Zt(t)?t:oi().withMutations(function(n){var r=e(t);yr(r.size),r.forEach(function(e,t){return n.set(t,e)});})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return oi().withMutations(function(t){for(var n=0;n=e.length)throw new Error("Missing value for key: "+e[n]);t.set(e[n],e[n+1]);}})},t.prototype.toString=function(){return this.__toString("Map {","}")},t.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},t.prototype.set=function(e,t){return ai(this,e,t)},t.prototype.remove=function(e){return ai(this,e,It)},t.prototype.deleteAll=function(e){var t=Ut(e);return 0===t.size?this:this.withMutations(function(e){t.forEach(function(t){return e.remove(t)});})},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):oi()},t.prototype.sort=function(e){return Ri(sr(this,e))},t.prototype.sortBy=function(e,t){return Ri(sr(this,t,e))},t.prototype.map=function(e,t){return this.withMutations(function(n){n.forEach(function(r,i){n.set(i,e.call(t,r,i,n));});})},t.prototype.__iterator=function(e,t){return new ni(this,e,t)},t.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate(function(t){return r++,e(t[1],t[0],n)},t),r},t.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?si(this.size,this._root,e,this.__hash):0===this.size?oi():(this.__ownerID=e,this.__altered=!1,this)},t}(Ft);Kr.isMap=Cn;var Yr=Kr.prototype;Yr[kn]=!0,Yr.delete=Yr.remove,Yr.removeAll=Yr.deleteAll,Yr.setIn=Cr,Yr.removeIn=Yr.deleteIn=$r,Yr.update=Or,Yr.updateIn=Mr,Yr.merge=Yr.concat=Tr,Yr.mergeWith=Dr,Yr.mergeDeep=zr,Yr.mergeDeepWith=jr,Yr.mergeIn=Wr,Yr.mergeDeepIn=Ur,Yr.withMutations=Fr,Yr.wasAltered=Hr,Yr.asImmutable=Gr,Yr["@@transducer/init"]=Yr.asMutable=qr,Yr["@@transducer/step"]=function(e,t){return e.set(t[0],t[1])},Yr["@@transducer/result"]=function(e){return e.asImmutable()};var Xr=function(e,t){this.ownerID=e,this.entries=t;};Xr.prototype.get=function(e,t,n,r){for(var i=this.entries,s=0,o=i.length;s=di)return function(e,t,n,r){e||(e=new Pt);for(var i=new ei(e,Dn(n),[n,r]),s=0;s>>e)&St),s=this.bitmap;return 0==(s&i)?r:this.nodes[li(s&i-1)].get(e+bt,t,n,r)},Qr.prototype.update=function(e,t,n,r,i,s,o){void 0===n&&(n=Dn(r));var a=(0===t?n:n>>>t)&St,h=1<=fi)return function(e,t,n,r,i){for(var s=0,o=new Array(At),a=0;0!==n;a++,n>>>=1)o[a]=1&n?t[s++]:void 0;return o[r]=i,new Jr(e,s+1,o)}(e,p,u,a,f);if(c&&!f&&2===p.length&&ui(p[1^l]))return p[1^l];if(c&&f&&1===p.length&&ui(f))return f;var m=e&&e===this.ownerID,g=c?f?u:u^h:u|h,y=c?f?pi(p,l,f,m):function(e,t,n){var r=e.length-1;if(n&&t===r)return e.pop(),e;for(var i=new Array(r),s=0,o=0;o>>e)&St,s=this.nodes[i];return s?s.get(e+bt,t,n,r):r},Jr.prototype.update=function(e,t,n,r,i,s,o){void 0===n&&(n=Dn(r));var a=(0===t?n:n>>>t)&St,h=i===It,u=this.nodes,c=u[a];if(h&&!c)return this;var l=hi(c,e,t+bt,n,r,i,s,o);if(l===c)return this;var p=this.count;if(c){if(!l&&--p>>n)&St,a=(0===n?r:r>>>n)&St,h=o===a?[ci(e,t,n+bt,r,i)]:(s=new ei(t,r,i),o>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function pi(e,t,n,r){var i=r?e:mr(e);return i[t]=n,i}var di=At/4,fi=At/2,mi=At/4,gi="@@__IMMUTABLE_LIST__@@";function yi(e){return Boolean(e&&e[gi])}var xi=function(e){function t(t){var n=Ii();if(null==t)return n;if(yi(t))return t;var r=e(t),i=r.size;return 0===i?n:(yr(i),i>0&&i=0&&e=e.size||t<0)return e.withMutations(function(e){t<0?Ci(e,t).set(0,n):Ci(e,0,t+1).set(t,n);});t+=e._origin;var r=e._tail,i=e._root,s={value:!1};t>=Ni(e._capacity)?r=wi(r,e.__ownerID,0,t,n,s):i=wi(i,e.__ownerID,e._level,t,n,s);if(!s.value)return e;if(e.__ownerID)return e._root=i,e._tail=r,e.__hash=void 0,e.__altered=!0,e;return Si(e._origin,e._capacity,e._level,i,r)}(this,e,t)},t.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},t.prototype.insert=function(e,t){return this.splice(e,0,t)},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=bt,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):Ii()},t.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations(function(n){Ci(n,0,t+e.length);for(var r=0;r>>t&St;if(r>=this.array.length)return new Ei([],e);var i,s=0===r;if(t>0){var o=this.array[r];if((i=o&&o.removeBefore(e,t-bt,n))===o&&s)return this}if(s&&!i)return this;var a=Pi(this,e);if(!s)for(var h=0;h>>t&St;if(i>=this.array.length)return this;if(t>0){var s=this.array[i];if((r=s&&s.removeAfter(e,t-bt,n))===s&&i===this.array.length-1)return this}var o=Pi(this,e);return o.array.splice(i+1),r&&(o.array[i]=r),o};var _i,bi={};function Ai(e,t){var n=e._origin,r=e._capacity,i=Ni(r),s=e._tail;return o(e._root,e._level,0);function o(e,a,h){return 0===a?function(e,o){var a=o===i?s&&s.array:e&&e.array,h=o>n?0:n-o,u=r-o;u>At&&(u=At);return function(){if(h===u)return bi;var e=t?--u:h++;return a&&a[e]}}(e,h):function(e,i,s){var a,h=e&&e.array,u=s>n?0:n-s>>i,c=1+(r-s>>i);c>At&&(c=At);return function(){for(;;){if(a){var e=a();if(e!==bi)return e;a=null;}if(u===c)return bi;var n=t?--c:u++;a=o(h&&h[n],i-bt,s+(n<>>n&St,h=e&&a0){var u=e&&e.array[a],c=wi(u,t,n-bt,r,i,s);return c===u?e:((o=Pi(e,t)).array[a]=c,o)}return h&&e.array[a]===i?e:(s&&wt(s),o=Pi(e,t),void 0===i&&a===o.array.length-1?o.array.pop():o.array[a]=i,o)}function Pi(e,t){return t&&e&&t===e.ownerID?e:new Ei(e?e.array.slice():[],t)}function ki(e,t){if(t>=Ni(e._capacity))return e._tail;if(t<1<0;)n=n.array[t>>>r&St],r-=bt;return n}}function Ci(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new Pt,i=e._origin,s=e._capacity,o=i+t,a=void 0===n?s:n<0?s+n:i+n;if(o===i&&a===s)return e;if(o>=a)return e.clear();for(var h=e._level,u=e._root,c=0;o+c<0;)u=new Ei(u&&u.array.length?[void 0,u]:[],r),c+=1<<(h+=bt);c&&(o+=c,i+=c,a+=c,s+=c);for(var l=Ni(s),p=Ni(a);p>=1<l?new Ei([],r):d;if(d&&p>l&&obt;g-=bt){var y=l>>>g&St;m=m.array[y]=Pi(m.array[y],r);}m.array[l>>>bt&St]=d;}if(a=p)o-=p,a-=p,h=bt,u=null,f=f&&f.removeBefore(r,0,o);else if(o>i||p>>h&St;if(x!==p>>>h&St)break;x&&(c+=(1<i&&(u=u.removeBefore(r,h,o-c)),u&&p>>bt<=At&&o.size>=2*s.size?(r=(i=o.filter(function(e,t){return void 0!==e&&a!==t})).toKeyedSeq().map(function(e){return e[0]}).flip().toMap(),e.__ownerID&&(r.__ownerID=i.__ownerID=e.__ownerID)):(r=s.remove(t),i=a===o.size-1?o.pop():o.set(a,void 0));}else if(h){if(n===o.get(a)[1])return e;r=s,i=o.set(a,[t,n]);}else r=s.set(t,o.size),i=o.set(o.size,[t,n]);return e.__ownerID?(e.size=r.size,e._map=r,e._list=i,e.__hash=void 0,e):Oi(r,i)}Ri.isOrderedMap=Nn,Ri.prototype[Jt]=!0,Ri.prototype.delete=Ri.prototype.remove;var Di="@@__IMMUTABLE_STACK__@@";function Li(e){return Boolean(e&&e[Di])}var Vi=function(e){function t(e){return null==e?Wi():Li(e)?e:Wi().pushAll(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("Stack [","]")},t.prototype.get=function(e,t){var n=this._head;for(e=Ct(this,e);n&&e--;)n=n.next;return n?n.value:t},t.prototype.peek=function(){return this._head&&this._head.value},t.prototype.push=function(){var e=arguments;if(0===arguments.length)return this;for(var t=this.size+arguments.length,n=this._head,r=arguments.length-1;r>=0;r--)n={value:e[r],next:n};return this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):ji(t,n)},t.prototype.pushAll=function(t){if(0===(t=e(t)).size)return this;if(0===this.size&&Li(t))return t;yr(t.size);var n=this.size,r=this._head;return t.__iterate(function(e){n++,r={value:e,next:r};},!0),this.__ownerID?(this.size=n,this._head=r,this.__hash=void 0,this.__altered=!0,this):ji(n,r)},t.prototype.pop=function(){return this.slice(1)},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Wi()},t.prototype.slice=function(t,n){if($t(t,n,this.size))return this;var r=Rt(t,this.size);if(Ot(n,this.size)!==this.size)return e.prototype.slice.call(this,t,n);for(var i=this.size-r,s=this._head;r--;)s=s.next;return this.__ownerID?(this.size=i,this._head=s,this.__hash=void 0,this.__altered=!0,this):ji(i,s)},t.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?ji(this.size,this._head,e,this.__hash):0===this.size?Wi():(this.__ownerID=e,this.__altered=!1,this)},t.prototype.__iterate=function(e,t){var n=this;if(t)return new En(this.toArray()).__iterate(function(t,r){return e(t,r,n)},t);for(var r=0,i=this._head;i&&!1!==e(i.value,r++,this);)i=i.next;return r},t.prototype.__iterator=function(e,t){if(t)return new En(this.toArray()).__iterator(e,t);var n=0,r=this._head;return new an(function(){if(r){var t=r.value;return r=r.next,hn(e,n++,t)}return {value:void 0,done:!0}})},t}(qt);Vi.isStack=Li;var Bi,zi=Vi.prototype;function ji(e,t,n,r){var i=Object.create(zi);return i.size=e,i._head=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function Wi(){return Bi||(Bi=ji(0))}zi[Di]=!0,zi.shift=zi.pop,zi.unshift=zi.push,zi.unshiftAll=zi.pushAll,zi.withMutations=Fr,zi.wasAltered=Hr,zi.asImmutable=Gr,zi["@@transducer/init"]=zi.asMutable=qr,zi["@@transducer/step"]=function(e,t){return e.unshift(t)},zi["@@transducer/result"]=function(e){return e.asImmutable()};var Ui="@@__IMMUTABLE_SET__@@";function Fi(e){return Boolean(e&&e[Ui])}function qi(e){return Fi(e)&&Zt(e)}function Gi(e,t){if(e===t)return !0;if(!Lt(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||Bt(e)!==Bt(t)||jt(e)!==jt(t)||Zt(e)!==Zt(t))return !1;if(0===e.size&&0===t.size)return !0;var n=!Wt(e);if(Zt(e)){var r=e.entries();return t.every(function(e,t){var i=r.next().value;return i&&Rn(i[1],e)&&(n||Rn(i[0],t))})&&r.next().done}var i=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{i=!0;var s=e;e=t,t=s;}var o=!0,a=t.__iterate(function(t,r){if(n?!e.has(t):i?!Rn(t,e.get(r,It)):!Rn(e.get(r,It),t))return o=!1,!1});return o&&e.size===a}function Hi(e,t){var n=function(n){e.prototype[n]=t[n];};return Object.keys(t).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(n),e}function Ki(e){if(!e||"object"!=typeof e)return e;if(!Lt(e)){if(!Er(e))return e;e=gn(e);}if(Bt(e)){var t={};return e.__iterate(function(e,n){t[n]=Ki(e);}),t}var n=[];return e.__iterate(function(e){n.push(Ki(e));}),n}var Yi=function(e){function t(t){return null==t?es():Fi(t)&&!Zt(t)?t:es().withMutations(function(n){var r=e(t);yr(r.size),r.forEach(function(e){return n.add(e)});})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(e){return this(Ft(e).keySeq())},t.intersect=function(e){return (e=Ut(e).toArray()).length?Qi.intersect.apply(t(e.pop()),e):es()},t.union=function(e){return (e=Ut(e).toArray()).length?Qi.union.apply(t(e.pop()),e):es()},t.prototype.toString=function(){return this.__toString("Set {","}")},t.prototype.has=function(e){return this._map.has(e)},t.prototype.add=function(e){return Ji(this,this._map.set(e,e))},t.prototype.remove=function(e){return Ji(this,this._map.remove(e))},t.prototype.clear=function(){return Ji(this,this._map.clear())},t.prototype.map=function(e,t){var n=this,r=[],i=[];return this.forEach(function(s){var o=e.call(t,s,s,n);o!==s&&(r.push(s),i.push(o));}),this.withMutations(function(e){r.forEach(function(t){return e.remove(t)}),i.forEach(function(t){return e.add(t)});})},t.prototype.union=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];return 0===(t=t.filter(function(e){return 0!==e.size})).length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations(function(n){for(var r=0;r=0&&t=0&&n>>-15,461845907),t=On(t<<13|t>>>-13,5),t=On((t=(t+3864292196|0)^e)^t>>>16,2246822507),t=Mn((t=On(t^t>>>13,3266489909))^t>>>16)}(e.__iterate(n?t?function(e,t){r=31*r+ys(Dn(e),Dn(t))|0;}:function(e,t){r=r+ys(Dn(e),Dn(t))|0;}:t?function(e){r=31*r+Dn(e)|0;}:function(e){r=r+Dn(e)|0;}),r)}(this))}});var as=Ut.prototype;as[Dt]=!0,as[on]=as.values,as.toJSON=as.toArray,as.__toStringMapper=_r,as.inspect=as.toSource=function(){return this.toString()},as.chain=as.flatMap,as.contains=as.includes,Hi(Ft,{flip:function(){return ur(this,Jn(this))},mapEntries:function(e,t){var n=this,r=0;return ur(this,this.toSeq().map(function(i,s){return e.call(t,[s,i],r++,n)}).fromEntrySeq())},mapKeys:function(e,t){var n=this;return ur(this,this.toSeq().flip().map(function(r,i){return e.call(t,r,i,n)}).flip())}});var hs=Ft.prototype;hs[Vt]=!0,hs[on]=as.entries,hs.toJSON=os,hs.__toStringMapper=function(e,t){return _r(t)+": "+_r(e)},Hi(qt,{toKeyedSeq:function(){return new Kn(this,!1)},filter:function(e,t){return ur(this,tr(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return ur(this,er(this,!1))},slice:function(e,t){return ur(this,nr(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(t||0,0),0===n||2===n&&!t)return this;e=Rt(e,e<0?this.count():this.size);var r=this.slice(0,e);return ur(this,1===n?r:r.concat(mr(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.findLastEntry(e,t);return n?n[0]:-1},first:function(e){return this.get(0,e)},flatten:function(e){return ur(this,ir(this,e,!1))},get:function(e,t){return (e=Ct(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find(function(t,n){return n===e},void 0,t)},has:function(e){return (e=Ct(this,e))>=0&&(void 0!==this.size?this.size===1/0||et?-1:0}function ys(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}us[zt]=!0,us[Jt]=!0,Hi(Gt,{get:function(e,t){return this.has(e)?e:t},includes:function(e){return this.has(e)},keySeq:function(){return this.valueSeq()}}),Gt.prototype.has=as.includes,Gt.prototype.contains=Gt.prototype.includes,Hi(yn,Ft.prototype),Hi(xn,qt.prototype),Hi(vn,Gt.prototype);var xs=function(e){function t(e){return null==e?bs():qi(e)?e:bs().withMutations(function(t){var n=Gt(e);yr(n.size),n.forEach(function(e){return t.add(e)});})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(e){return this(Ft(e).keySeq())},t.prototype.toString=function(){return this.__toString("OrderedSet {","}")},t}(Yi);xs.isOrderedSet=qi;var vs,Es=xs.prototype;function _s(e,t){var n=Object.create(Es);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function bs(){return vs||(vs=_s(Mi()))}Es[Jt]=!0,Es.zip=us.zip,Es.zipWith=us.zipWith,Es.__empty=bs,Es.__make=_s;var As=function(e,t){var n,r=function(s){var o=this;if(s instanceof r)return s;if(!(this instanceof r))return new r(s);if(!n){n=!0;var a=Object.keys(e),h=i._indices={};i._name=t,i._keys=a,i._defaultValues=e;for(var u=0;u2?[]:void 0,{"":e})},hash:Dn,isImmutable:Qt,isCollection:Lt,isKeyed:Bt,isIndexed:jt,isAssociative:Wt,isOrdered:Zt,isValueObject:$n,isSeq:Kt,isList:yi,isMap:Cn,isOrderedMap:Nn,isStack:Li,isSet:Fi,isOrderedSet:qi,isRecord:Xt,get:Ar,getIn:rs,has:br,hasIn:ss,merge:function(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return Br(e,t)},mergeDeep:function(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return Vr(e,t)},mergeWith:function(e,t){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];return Br(t,n,e)},mergeDeepWith:function(e,t){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];return Vr(t,n,e)},remove:Ir,removeIn:Nr,set:wr,setIn:kr,update:Rr,updateIn:Pr};!function(e){e[e.IGNORED_LABELS=0]="IGNORED_LABELS",e[e.ACCESSED_NODES=1]="ACCESSED_NODES",e[e.ARGUMENTS_VARIABLES=2]="ARGUMENTS_VARIABLES",e[e.ASSIGNED_NODES=3]="ASSIGNED_NODES",e[e.IGNORE_BREAK_STATEMENTS=4]="IGNORE_BREAK_STATEMENTS",e[e.IGNORE_RETURN_AWAIT_YIELD=5]="IGNORE_RETURN_AWAIT_YIELD",e[e.NODES_CALLED_AT_PATH_WITH_OPTIONS=6]="NODES_CALLED_AT_PATH_WITH_OPTIONS",e[e.REPLACED_VARIABLE_INITS=7]="REPLACED_VARIABLE_INITS",e[e.RETURN_EXPRESSIONS_ACCESSED_AT_PATH=8]="RETURN_EXPRESSIONS_ACCESSED_AT_PATH",e[e.RETURN_EXPRESSIONS_ASSIGNED_AT_PATH=9]="RETURN_EXPRESSIONS_ASSIGNED_AT_PATH",e[e.RETURN_EXPRESSIONS_CALLED_AT_PATH=10]="RETURN_EXPRESSIONS_CALLED_AT_PATH";}($s||($s={}));const Os={};class Ms{static create(){return new this(Rs.Map())}constructor(e){this.optionValues=e;}addAccessedNodeAtPath(e,t){return this.setIn([$s.ACCESSED_NODES,t,...e,Os],!0)}addAccessedReturnExpressionAtPath(e,t){return this.setIn([$s.RETURN_EXPRESSIONS_ACCESSED_AT_PATH,t,...e,Os],!0)}addAssignedNodeAtPath(e,t){return this.setIn([$s.ASSIGNED_NODES,t,...e,Os],!0)}addAssignedReturnExpressionAtPath(e,t){return this.setIn([$s.RETURN_EXPRESSIONS_ASSIGNED_AT_PATH,t,...e,Os],!0)}addCalledNodeAtPathWithOptions(e,t,n){return this.setIn([$s.NODES_CALLED_AT_PATH_WITH_OPTIONS,t,...e,Os,n],!0)}addCalledReturnExpressionAtPath(e,t){return this.setIn([$s.RETURN_EXPRESSIONS_CALLED_AT_PATH,t,...e,Os],!0)}getArgumentsVariables(){return this.get($s.ARGUMENTS_VARIABLES)||[]}getHasEffectsWhenCalledOptions(){return this.setIgnoreReturnAwaitYield().setIgnoreBreakStatements(!1).setIgnoreNoLabels()}getReplacedVariableInit(e){return this.optionValues.getIn([$s.REPLACED_VARIABLE_INITS,e])}hasNodeBeenAccessedAtPath(e,t){return this.optionValues.getIn([$s.ACCESSED_NODES,t,...e,Os])}hasNodeBeenAssignedAtPath(e,t){return this.optionValues.getIn([$s.ASSIGNED_NODES,t,...e,Os])}hasNodeBeenCalledAtPathWithOptions(e,t,n){const r=this.optionValues.getIn([$s.NODES_CALLED_AT_PATH_WITH_OPTIONS,t,...e,Os]);return r&&r.find((e,t)=>t.equals(n))}hasReturnExpressionBeenAccessedAtPath(e,t){return this.optionValues.getIn([$s.RETURN_EXPRESSIONS_ACCESSED_AT_PATH,t,...e,Os])}hasReturnExpressionBeenAssignedAtPath(e,t){return this.optionValues.getIn([$s.RETURN_EXPRESSIONS_ASSIGNED_AT_PATH,t,...e,Os])}hasReturnExpressionBeenCalledAtPath(e,t){return this.optionValues.getIn([$s.RETURN_EXPRESSIONS_CALLED_AT_PATH,t,...e,Os])}ignoreBreakStatements(){return this.get($s.IGNORE_BREAK_STATEMENTS)}ignoreLabel(e){return this.optionValues.getIn([$s.IGNORED_LABELS,e])}ignoreReturnAwaitYield(){return this.get($s.IGNORE_RETURN_AWAIT_YIELD)}replaceVariableInit(e,t){return this.setIn([$s.REPLACED_VARIABLE_INITS,e],t)}setArgumentsVariables(e){return this.set($s.ARGUMENTS_VARIABLES,e)}setIgnoreBreakStatements(e=!0){return this.set($s.IGNORE_BREAK_STATEMENTS,e)}setIgnoreLabel(e){return this.setIn([$s.IGNORED_LABELS,e],!0)}setIgnoreNoLabels(){return this.remove($s.IGNORED_LABELS)}setIgnoreReturnAwaitYield(e=!0){return this.set($s.IGNORE_RETURN_AWAIT_YIELD,e)}get(e){return this.optionValues.get(e)}remove(e){return new Ms(this.optionValues.remove(e))}set(e,t){return new Ms(this.optionValues.set(e,t))}setIn(e,t){return new Ms(this.optionValues.setIn(e,t))}}const Ts={Literal:[],Program:["body"]};const Ds=Ms.create();class Ls{constructor(e,t,n){this.keys=Ts[e.type]||function(e){return Ts[e.type]=Object.keys(e).filter(t=>"object"==typeof e[t]),Ts[e.type]}(e),this.parent=t,this.context=t.context,this.createScope(n),this.parseNode(e),this.initialise(),this.context.magicString.addSourcemapLocation(this.start),this.context.magicString.addSourcemapLocation(this.end);}bind(){for(const e of this.keys){const t=this[e];if(null!==t&&"annotations"!==e)if(Array.isArray(t))for(const e of t)null!==e&&e.bind();else t.bind();}}createScope(e){this.scope=e;}declare(e,t){}deoptimizePath(e){}getLiteralValueAtPath(e,t,n){return Se}getReturnExpressionWhenCalledAtPath(e,t,n){return Ie}hasEffects(e){for(const t of this.keys){const n=this[t];if(null!==n&&"annotations"!==t)if(Array.isArray(n)){for(const t of n)if(null!==t&&t.hasEffects(e))return !0}else if(n.hasEffects(e))return !0}return !1}hasEffectsWhenAccessedAtPath(e,t){return e.length>0}hasEffectsWhenAssignedAtPath(e,t){return !0}hasEffectsWhenCalledAtPath(e,t,n){return !0}include(e){this.included=!0;for(const t of this.keys){const n=this[t];if(null!==n&&"annotations"!==t)if(Array.isArray(n))for(const t of n)null!==t&&t.include(e);else n.include(e);}}includeWithAllDeclaredVariables(e){this.include(e);}initialise(){this.included=!1;}insertSemicolon(e){";"!==e.original[this.end-1]&&e.appendLeft(this.end,";");}locate(){const e=_t(this.context.code,this.start,{offsetLine:1});return e.file=this.context.fileName,e.toString=(()=>JSON.stringify(e)),e}parseNode(e){for(const t of Object.keys(e)){if(this.hasOwnProperty(t))continue;const n=e[t];if("object"!=typeof n||null===n||"annotations"===t)this[t]=n;else if(Array.isArray(n)){this[t]=[];for(const e of n)this[t].push(null===e?null:new(this.context.nodeConstructors[e.type]||this.context.nodeConstructors.UnknownNode)(e,this,this.scope));}else this[t]=new(this.context.nodeConstructors[n.type]||this.context.nodeConstructors.UnknownNode)(n,this,this.scope);}}render(e,t){for(const n of this.keys){const r=this[n];if(null!==r&&"annotations"!==n)if(Array.isArray(r))for(const n of r)null!==n&&n.render(e,t);else r.render(e,t);}}shouldBeIncluded(){return this.included||this.hasEffects(Ds)}toString(){return this.context.code.slice(this.start,this.end)}}class Vs extends Ls{createScope(e){this.scope=new Et(e);}hasEffectsWhenAccessedAtPath(e,t){return e.length>1}hasEffectsWhenAssignedAtPath(e,t){return e.length>1}hasEffectsWhenCalledAtPath(e,t,n){return this.body.hasEffectsWhenCalledAtPath(e,t,n)||null!==this.superClass&&this.superClass.hasEffectsWhenCalledAtPath(e,t,n)}initialise(){this.included=!1,null!==this.id&&this.id.declare("class",this);}}class Bs extends Vs{initialise(){super.initialise(),null!==this.id&&(this.id.variable.isId=!0);}parseNode(e){null!==e.id&&(this.id=new this.context.nodeConstructors.Identifier(e.id,this,this.scope.parent)),super.parseNode(e);}render(e,t){"system"===t.format&&this.id&&this.id.variable.exportName&&e.appendLeft(this.end,` exports('${this.id.variable.exportName}', ${this.id.variable.getName()});`),super.render(e,t);}}const zs=(e,t)=>{const n=parseInt(e[0],10);return n0&&t>=0&&this.parameters[t]&&this.parameters[t].deoptimizePath(e.slice(1));}hasEffectsWhenAccessedAtPath(e,t){return e.length>1&&zs(e,t).hasEffectsWhenAccessedAtPath(e.slice(1),t)}hasEffectsWhenAssignedAtPath(e,t){return 0===e.length||this.included||zs(e,t).hasEffectsWhenAssignedAtPath(e.slice(1),t)}hasEffectsWhenCalledAtPath(e,t,n){return 0===e.length||zs(e,n).hasEffectsWhenCalledAtPath(e.slice(1),t,n)}}class Ws extends xt{constructor(e){super("this",null,null,e);}_getInit(e){return e.getReplacedVariableInit(this)||Ie}getLiteralValueAtPath(){return Se}hasEffectsWhenAccessedAtPath(e,t){return this._getInit(t).hasEffectsWhenAccessedAtPath(e,t)||super.hasEffectsWhenAccessedAtPath(e,t)}hasEffectsWhenAssignedAtPath(e,t){return this._getInit(t).hasEffectsWhenAssignedAtPath(e,t)||super.hasEffectsWhenAssignedAtPath(e,t)}hasEffectsWhenCalledAtPath(e,t,n){return this._getInit(n).hasEffectsWhenCalledAtPath(e,t,n)||super.hasEffectsWhenCalledAtPath(e,t,n)}}class Us extends Et{constructor(e,t){super(e),this.parameters=[],this.context=t,this.hoistedBodyVarScope=new Et(this);}addParameterDeclaration(e){const t=e.name;let n;return t in this.hoistedBodyVarScope.variables?(n=this.hoistedBodyVarScope.variables[t]).addDeclaration(e,null):n=new xt(t,e,Ie,this.context),this.variables[t]=n,this.parameters.push(n),n}getParameterVariables(){return this.parameters}}class Fs extends Us{constructor(){super(...arguments),this.returnExpression=null,this.returnExpressions=[];}addReturnExpression(e){this.returnExpressions.push(e);}getReturnExpression(){return null===this.returnExpression&&this.updateReturnExpression(),this.returnExpression}updateReturnExpression(){if(1===this.returnExpressions.length)this.returnExpression=this.returnExpressions[0];else{this.returnExpression=Ie;for(const e of this.returnExpressions)e.deoptimizePath(be);}}}class qs extends Fs{constructor(e,t){super(e,t),this.variables.arguments=new js(super.getParameterVariables(),t),this.variables.this=new Ws(t);}findLexicalBoundary(){return this}getOptionsWhenCalledWith({args:e,withNew:t},n){return n.replaceVariableInit(this.variables.this,t?new Ue:Ie).setArgumentsVariables(e.map((e,t)=>super.getParameterVariables()[t]||e))}}class Gs extends Ls{createScope(e){this.scope=new qs(e,this.context);}deoptimizePath(e){1===e.length&&("prototype"===e[0]?this.isPrototypeDeoptimized=!0:e[0]===Ee&&(this.isPrototypeDeoptimized=!0,this.scope.getReturnExpression().deoptimizePath(be)));}getReturnExpressionWhenCalledAtPath(e){return 0===e.length?this.scope.getReturnExpression():Ie}hasEffects(e){return null!==this.id&&this.id.hasEffects(e)}hasEffectsWhenAccessedAtPath(e){return !(e.length<=1)&&(e.length>2||"prototype"!==e[0]||this.isPrototypeDeoptimized)}hasEffectsWhenAssignedAtPath(e){return !(e.length<=1)&&(e.length>2||"prototype"!==e[0]||this.isPrototypeDeoptimized)}hasEffectsWhenCalledAtPath(e,t,n){if(e.length>0)return !0;const r=this.scope.getOptionsWhenCalledWith(t,n);for(const e of this.params)if(e.hasEffects(r))return !0;return this.body.hasEffects(r)}include(e){this.scope.variables.arguments.include(),super.include(e);}initialise(){this.included=!1,this.isPrototypeDeoptimized=!1,null!==this.id&&this.id.declare("function",this);for(const e of this.params)e.declare("parameter",Ie);this.body.addImplicitReturnExpressionToScope();}parseNode(e){this.body=new this.context.nodeConstructors.BlockStatement(e.body,this,this.scope.hoistedBodyVarScope),super.parseNode(e);}}Gs.prototype.preventChildBlockScope=!0;class Hs extends Gs{initialise(){super.initialise(),null!==this.id&&(this.id.variable.isId=!0);}parseNode(e){null!==e.id&&(this.id=new this.context.nodeConstructors.Identifier(e.id,this,this.scope.parent)),super.parseNode(e);}}const Ks=/\s/;class Ys extends Ls{include(e){super.include(e),e&&this.context.includeVariable(this.variable);}initialise(){this.included=!1;const e=this.declaration;this.declarationName=e.id&&e.id.name||this.declaration.name,this.variable=this.scope.addExportDefaultDeclaration(this.declarationName||this.context.getModuleName(),this,this.context),this.context.addExport(this);}render(e,t,{start:n,end:r}=Y){const i=function(e,t=0){for(t=le(e,"default",t)+7;Ks.test(e[t]);)t++;return t}(e.original,this.start);if(this.declaration instanceof Hs)this.renderNamedDeclaration(e,i,"function",null===this.declaration.id,t);else if(this.declaration instanceof Bs)this.renderNamedDeclaration(e,i,"class",null===this.declaration.id,t);else{if(this.variable.getOriginalVariable()!==this.variable)return void("system"===t.format&&this.variable.exportName?e.overwrite(n,r,`exports('${this.variable.exportName}', ${this.variable.getName()});`):he(this,e,n,r));if(!this.variable.included)return e.remove(this.start,i),this.declaration.render(e,t,{isCalleeOfRenderedParent:!1,renderedParentType:Z}),void(";"!==e.original[this.end-1]&&e.appendLeft(this.end,";"));this.renderVariableDeclaration(e,i,t);}this.declaration.render(e,t);}renderNamedDeclaration(e,t,n,r,i){const s=this.variable.getName();e.remove(this.start,t),r&&e.appendLeft(function(e,t,n=0){const r=le(e,t,n)+t.length;e=e.slice(r,le(e,"{",r));const i=le(e,"*");return -1===i?r:r+i+1}(e.original,n,t),` ${s}`),"system"===i.format&&this.declaration instanceof Bs&&this.variable.exportName&&e.appendLeft(this.end,` exports('${this.variable.exportName}', ${s});`);}renderVariableDeclaration(e,t,n){const r="system"===n.format&&this.variable.exportName?`exports('${this.variable.exportName}', `:"";e.overwrite(this.start,t,`${n.varOrConst} ${this.variable.getName()} = ${r}`);const i=59===e.original.charCodeAt(this.end-1);r?e.appendRight(i?this.end-1:this.end,")"+(i?"":";")):i||e.appendLeft(this.end,";");}}Ys.prototype.needsBoundaries=!0;class Xs extends Ls{addExportedVariables(e){null!==this.variable&&this.variable.exportName&&e.push(this.variable);}bind(){this.bound||(this.bound=!0,null===this.variable&&function e(t,n){if("MemberExpression"===t.type)return !t.computed&&e(t.object,t);if("Identifier"===t.type)switch(n.type){case"MemberExpression":return n.computed||t===n.object;case"MethodDefinition":return n.computed;case"Property":return n.computed||t===n.value;case"ExportSpecifier":return t===n.local;case"LabeledStatement":case"BreakStatement":case"ContinueStatement":return !1;default:return !0}return !1}(this,this.parent)&&(this.variable=this.scope.findVariable(this.name),this.variable.addReference(this)),null!==this.variable&&this.variable.isLocal&&null!==this.variable.additionalInitializers&&this.variable.consolidateInitializers());}declare(e,t){switch(e){case"var":case"function":this.variable=this.scope.addDeclaration(this,this.context,t,!0);break;case"let":case"const":case"class":this.variable=this.scope.addDeclaration(this,this.context,t,!1);break;case"parameter":this.variable=this.scope.addParameterDeclaration(this);break;default:throw new Error(`Unexpected identifier kind ${e}.`)}}deoptimizePath(e){this.bound||this.bind(),null!==this.variable&&(0===e.length&&this.name in this.context.importDescriptions&&!this.scope.contains(this.name)&&this.disallowImportReassignment(),this.variable.deoptimizePath(e));}getLiteralValueAtPath(e,t,n){return this.bound||this.bind(),null!==this.variable?this.variable.getLiteralValueAtPath(e,t,n):Se}getReturnExpressionWhenCalledAtPath(e,t,n){return this.bound||this.bind(),null!==this.variable?this.variable.getReturnExpressionWhenCalledAtPath(e,t,n):Ie}hasEffectsWhenAccessedAtPath(e,t){return null!==this.variable&&this.variable.hasEffectsWhenAccessedAtPath(e,t)}hasEffectsWhenAssignedAtPath(e,t){return !this.variable||this.variable.hasEffectsWhenAssignedAtPath(e,t)}hasEffectsWhenCalledAtPath(e,t,n){return !this.variable||this.variable.hasEffectsWhenCalledAtPath(e,t,n)}include(e){this.included||(this.included=!0,null!==this.variable&&this.context.includeVariable(this.variable));}initialise(){this.included=!1,this.bound=!1,this.variable||(this.variable=null);}render(e,t,{renderedParentType:n,isCalleeOfRenderedParent:r,isShorthandProperty:i}=Y){if(this.variable){const t=this.variable.getName();t!==this.name&&(e.overwrite(this.start,this.end,t,{contentOnly:!0,storeName:!0}),i&&e.prependRight(this.start,`${this.name}: `)),"eval"===t&&n===Q&&r&&e.appendRight(this.start,"0, ");}}disallowImportReassignment(){this.context.error({code:"ILLEGAL_REASSIGNMENT",message:`Illegal reassignment to import '${this.name}'`},this.start);}}class Qs extends xt{constructor(e,t,n){super(e,t,t.declaration,n),this.originalId=null,this.originalVariable=null;const r=t.declaration;(r instanceof Hs||r instanceof Bs)&&r.id?(this.hasId=!0,this.originalId=r.id):r instanceof Xs&&(this.originalId=r);}addReference(e){this.hasId||(this.name=e.name);}getAssignedVariableName(){return this.originalId&&this.originalId.name||null}getName(){const e=this.getOriginalVariable();return e===this?super.getName():e.getName()}getOriginalVariable(){if(null===this.originalVariable)if(!this.originalId||!this.hasId&&this.originalId.variable.isReassigned)this.originalVariable=this;else{const e=this.originalId.variable;this.originalVariable=e instanceof Qs?e.getOriginalVariable():e;}return this.originalVariable}setRenderNames(e,t){const n=this.getOriginalVariable();n===this?super.setRenderNames(e,t):n.setRenderNames(e,t);}setSafeName(e){const t=this.getOriginalVariable();t===this?super.setSafeName(e):t.setSafeName(e);}}Qs.prototype.getBaseVariableName=Qs.prototype.getName,Qs.prototype.isDefault=!0;const Js="_missingExportShim",Zs="_interopDefault";class eo extends Qe{constructor(e){super(Js),this.module=e;}}const to={},no="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),ro="Int8x16 Int16x8 Int32x4 Float32x4 Float64x2".split(" "),io="abs add and bool check div equal extractLane fromFloat32x4 fromFloat32x4Bits fromFloat64x2 fromFloat64x2Bits fromInt16x8Bits fromInt32x4 fromInt32x4Bits fromInt8x16Bits greaterThan greaterThanOrEqual lessThan lessThanOrEqual load max maxNum min minNum mul neg not notEqual or reciprocalApproximation reciprocalSqrtApproximation replaceLane select selectBits shiftLeftByScalar shiftRightArithmeticByScalar shiftRightLogicalByScalar shuffle splat sqrt store sub swizzle xor".split(" "),so=[];ro.forEach(e=>{io.forEach(t=>{so.push(`SIMD.${e}.${t}`);});}),["Array.isArray","Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape","Object","Object.create","Object.getNotifier","Object.getOwn","Object.getOwnPropertyDescriptor","Object.getOwnPropertyNames","Object.getOwnPropertySymbols","Object.getPrototypeOf","Object.is","Object.isExtensible","Object.isFrozen","Object.isSealed","Object.keys","Boolean","Number","Number.isFinite","Number.isInteger","Number.isNaN","Number.isSafeInteger","Number.parseFloat","Number.parseInt","Symbol","Symbol.for","Symbol.keyFor","Math.abs","Math.acos","Math.acosh","Math.asin","Math.asinh","Math.atan","Math.atan2","Math.atanh","Math.cbrt","Math.ceil","Math.clz32","Math.cos","Math.cosh","Math.exp","Math.expm1","Math.floor","Math.fround","Math.hypot","Math.imul","Math.log","Math.log10","Math.log1p","Math.log2","Math.max","Math.min","Math.pow","Math.random","Math.round","Math.sign","Math.sin","Math.sinh","Math.sqrt","Math.tan","Math.tanh","Math.trunc","Date","Date.UTC","Date.now","Date.parse","String","String.fromCharCode","String.fromCodePoint","String.raw","RegExp","Map","Set","WeakMap","WeakSet","ArrayBuffer","ArrayBuffer.isView","DataView","Promise.all","Promise.race","Promise.resolve","Intl.Collator","Intl.Collator.supportedLocalesOf","Intl.DateTimeFormat","Intl.DateTimeFormat.supportedLocalesOf","Intl.NumberFormat","Intl.NumberFormat.supportedLocalesOf"].concat(no,no.map(e=>`${e}.from`),no.map(e=>`${e}.of`),ro.map(e=>`SIMD.${e}`),so).forEach(e=>to[e]=!0);class oo extends Qe{hasEffectsWhenAccessedAtPath(e){return e.length>0&&!this.isPureFunctionMember(e)&&!("Reflect"===this.name&&1===e.length)}hasEffectsWhenCalledAtPath(e){return !to[[this.name,...e].join(".")]}isPureFunctionMember(e){return to[[this.name,...e].join(".")]||e.length>=1&&to[[this.name,...e.slice(0,-1)].join(".")]||e.length>=2&&to[[this.name,...e.slice(0,-2)].join(".")]&&"prototype"===e[e.length-2]}}const ao=Object.assign(Object.create(null),{await:!0,break:!0,case:!0,catch:!0,class:!0,const:!0,continue:!0,debugger:!0,default:!0,delete:!0,do:!0,else:!0,enum:!0,eval:!0,export:!0,extends:!0,false:!0,finally:!0,for:!0,function:!0,if:!0,implements:!0,import:!0,in:!0,instanceof:!0,interface:!0,let:!0,new:!0,null:!0,package:!0,private:!0,protected:!0,public:!0,return:!0,static:!0,super:!0,switch:!0,this:!0,throw:!0,true:!0,try:!0,typeof:!0,undefined:!0,var:!0,void:!0,while:!0,with:!0,yield:!0}),ho={},uo={exports:!0},co={amd:{formatGlobals:uo,forbiddenNames:ao},cjs:{forbiddenNames:ao,formatGlobals:{exports:!0,module:!0,[Zs]:!0}},es:{formatGlobals:ho,forbiddenNames:ao},iife:{formatGlobals:uo,forbiddenNames:ao},system:{forbiddenNames:Object.assign(Object.create(null),ao,uo),formatGlobals:ho},umd:{formatGlobals:uo,forbiddenNames:ao}};class lo extends Qe{constructor(e){super(e.getModuleName()),this.memberVariables=Object.create(null),this.containsExternalNamespace=!1,this.referencedEarly=!1,this.references=[],this.context=e,this.module=e.module;for(const e of this.context.getExports().concat(this.context.getReexports()))"*"===e[0]&&e.length>1&&(this.containsExternalNamespace=!0),this.memberVariables[e]=this.context.traceExport(e);}addReference(e){this.references.push(e),this.name=e.name;}deoptimizePath(){for(const e in this.memberVariables)this.memberVariables[e].deoptimizePath(be);}include(){if(!this.included){this.containsExternalNamespace&&this.context.error({code:"NAMESPACE_CANNOT_CONTAIN_EXTERNAL",id:this.module.id,message:`Cannot create an explicit namespace object for module "${this.context.getModuleName()}" because it contains a reexported external namespace`},void 0),this.included=!0;for(const e of this.references)if(e.context.getModuleExecIndex()<=this.context.getModuleExecIndex()){this.referencedEarly=!0;break}if(this.context.preserveModules)for(const e of Object.keys(this.memberVariables))this.memberVariables[e].include();else for(const e of Object.keys(this.memberVariables))this.context.includeVariable(this.memberVariables[e]);}}renderBlock(e){const t=e.compact?"":" ",n=e.compact?"":"\n",r=e.indent,i=Object.keys(this.memberVariables).map(n=>{const i=this.memberVariables[n];if(this.referencedEarly||i.isReassigned)return `${r}get ${n}${t}()${t}{${t}return ${i.getName()}${e.compact?"":";"}${t}}`;const s=ao[n]?`'${n}'`:n;return `${r}${s}: ${i.getName()}`}),s=this.getName(),o=e.freeze?"/*#__PURE__*/Object.freeze":"";let a=`${e.varOrConst} ${s} = ${e.namespaceToStringTag?`{${n}${i.join(`,${n}`)}${n}};`:`${o}({${n}${i.join(`,${n}`)}${n}});`}`;return e.namespaceToStringTag&&(a+=`${n}if${t}(typeof Symbol${t}!==${t}'undefined'${t}&&${t}Symbol.toStringTag)${n}`,a+=`${r}Object.defineProperty(${s},${t}Symbol.toStringTag,${t}{${t}value:${t}'Module'${t}});${n}`,a+=`else${n||" "}`,a+=`${r}Object.defineProperty(${s},${t}'toString',${t}{${t}value:${t}function${t}()${t}{${t}return${t}'[object Module]'${e.compact?";":""}${t}}${t}});${n}`,a+=`${o}(${s});`),"system"===e.format&&this.exportName&&(a+=`${n}exports('${this.exportName}',${t}${s});`),a}renderFirst(){return this.referencedEarly}}lo.prototype.isNamespace=!0;const po="Object.defineProperty(exports, '__esModule', { value: true });",fo="Object.defineProperty(exports,'__esModule',{value:true});";function mo(e,t,n,r,i,s,o="return "){const a=i?"":" ",h=i?"":"\n";if(!n){let n;return e.some(e=>"default"===e.exported&&(n=e.local,!0)),n||t.some(e=>!!e.reexports&&e.reexports.some(t=>"default"===t.reexported&&(n=e.namedExportsMode?`${e.name}.${t.imported}`:e.name,!0))),`${o}${n};`}let u="";return t.forEach(({name:e,reexports:t})=>{t&&n&&t.forEach(t=>{"*"===t.reexported&&(!i&&u&&(u+="\n"),u+=`Object.keys(${e}).forEach(function${a}(key)${a}{${h}`+`${s}Object.defineProperty(exports,${a}key,${a}{${h}`+`${s}${s}enumerable:${a}true,${h}`+`${s}${s}get:${a}function${a}()${a}{${h}`+`${s}${s}${s}return ${e}[key];${h}`+`${s}${s}}${h}${s}});${h}});`);});}),t.forEach(({name:e,imports:t,reexports:o,isChunk:c,namedExportsMode:l})=>{o&&n&&o.forEach(n=>{if("default"!==n.imported||c)if("*"!==n.imported){u&&!i&&(u+="\n");const t="default"!==n.imported||l?`${e}.${n.imported}`:e;u+=n.needsLiveBinding?`Object.defineProperty(exports,${a}'${n.reexported}',${a}{${h}`+`${s}enumerable:${a}true,${h}`+`${s}get:${a}function${a}()${a}{${h}`+`${s}${s}return ${t};${h}${s}}${h}});`:`exports.${n.reexported}${a}=${a}${t};`;}else"*"!==n.reexported&&(u&&!i&&(u+="\n"),u+=`exports.${n.reexported}${a}=${a}${e};`);else{const s=t&&t.some(e=>"default"!==e.imported)||o&&o.some(e=>"default"!==e.imported&&"*"!==e.imported),h=o&&o.some(e=>"default"===e.imported&&"default"===e.reexported);u&&!i&&(u+="\n"),u+=s||h?`exports.${n.reexported}${a}=${a}${e}${!1!==r?"__default":".default"};`:`exports.${n.reexported}${a}=${a}${e};`;}});}),e.forEach(e=>{const t=`exports.${e.exported}`,n=e.local;t!==n&&(u&&!i&&(u+="\n"),u+=`${t}${a}=${a}${n};`);}),u}function go(e,t,n){return e.map(({name:e,exportsNames:r,exportsDefault:i,namedExportsMode:s})=>{if(s)return i&&!1!==t.interop?r?t.compact?`${n} ${e}__default='default'in ${e}?${e}['default']:${e};`:`${n} ${e}__default = 'default' in ${e} ? ${e}['default'] : ${e};`:t.compact?`${e}=${e}&&${e}.hasOwnProperty('default')?${e}['default']:${e};`:`${e} = ${e} && ${e}.hasOwnProperty('default') ? ${e}['default'] : ${e};`:null}).filter(Boolean).join(t.compact?"":"\n")}const yo={assert:!0,buffer:!0,console:!0,constants:!0,domain:!0,events:!0,http:!0,https:!0,os:!0,path:!0,process:!0,punycode:!0,querystring:!0,stream:!0,string_decoder:!0,timers:!0,tty:!0,url:!0,util:!0,vm:!0,zlib:!0};function xo(e,t){const n=t.map(({id:e})=>e).filter(e=>e in yo);n.length&&e({code:"MISSING_NODE_BUILTINS",message:`Creating a browser bundle that depends on Node.js built-in ${1===n.length?`module ('${n[0]}')`:`modules (${n.slice(0,-1).map(e=>`'${e}'`).join(", ")} and '${n.slice(-1)}')`}. You might need to include https://www.npmjs.com/package/rollup-plugin-node-builtins`,modules:n});}function vo(e){return e.replace(/^\t+/,e=>e.split("\t").join(" "))}function Eo(e,t,n){let r=e.split("\n");const i=Math.max(0,t-3);let s=Math.min(t+2,r.length);for(r=r.slice(i,s);!/\S/.test(r[r.length-1]);)r.pop(),s-=1;const o=String(s).length;return r.map((e,r)=>{const s=i+r+1===t;let a=String(r+i+1);for(;a.length(h+=No(e),`${h}${s}=${s}${h}${s}||${s}{}`)).concat(`${h}${No(a)}`).join(`,${s}`).concat(`${s}=${s}${i}`);return o.length>0&&(u=`(${u})`),u}function Oo(e){let t=e.length;for(;t--;){const n=e[t];if(n.exportsDefault||n.exportsNames)return e.slice(0,t+1)}return []}const Mo=e=>`this${$o(e)}`;const To=(e,t,n,r,i)=>e?`${i}${r}${t} _starExcludes${n}=${n}{${n}${Array.from(e).join(`:${n}1,${n}`)}${e.size?`:${n}1`:""}${n}};`:"",Do=(e,t,n,r)=>e.length?`${r}${n}var ${e.join(`,${t}`)};`:"";function Lo(e,t,n,r){return 0===e.length?"":1===e.length?`${n}${n}${n}exports('${e[0].name}',${t}${e[0].value});${r}${r}`:`${n}${n}${n}exports({${r}`+e.map(({name:e,value:r})=>`${n}${n}${n}${n}${e}:${t}${r}`).join(`,${r}`)+`${r}${n}${n}${n}});${r}${r}`}const Vo=(e,t,n,r)=>Lo(e.filter(e=>e.hoisted||e.uninitialized).map(e=>({name:e.exported,value:e.uninitialized?"void 0":e.local})),t,n,r),Bo=(e,t,n,r)=>Lo(e.filter(e=>e.local===Js).map(e=>({name:e.exported,value:Js})),t,n,r);function zo(e,t){return e?`${t}${$o(e)}`:"null"}var jo={system:function(e,{dependencies:t,exports:n,indentString:r,intro:i,outro:s,usesTopLevelAwait:o,varOrConst:a},h){const u=h.compact?"":"\n",c=h.compact?"":" ",l=t.map(e=>`'${e.id}'`),p=[];let d;const f=[];t.forEach(({imports:e,reexports:i})=>{const s=[];if(e&&e.forEach(e=>{p.push(e.local),"*"===e.imported?s.push(`${e.local}${c}=${c}module;`):s.push(`${e.local}${c}=${c}module.${e.imported};`);}),i){let e=!1;i.length>1||1===i.length&&("*"===i[0].reexported||"*"===i[0].imported)?(i.forEach(i=>{"*"===i.reexported&&(d||(d=function({dependencies:e,exports:t}){const n=new Set(t.map(e=>e.exported));return n.has("default")||n.add("default"),e.forEach(({reexports:e})=>{e&&e.forEach(e=>{"*"===e.imported||n.has(e.reexported)||n.add(e.reexported);});}),n}({dependencies:t,exports:n})),e||(s.push(`${a} _setter${c}=${c}{};`),e=!0),s.push(`for${c}(var _$p${c}in${c}module)${c}{`),s.push(`${r}if${c}(!_starExcludes[_$p])${c}_setter[_$p]${c}=${c}module[_$p];`),s.push("}"));}),i.forEach(e=>{"*"===e.imported&&"*"!==e.reexported&&s.push(`exports('${e.reexported}',${c}module);`);}),i.forEach(t=>{"*"!==t.reexported&&"*"!==t.imported&&(e||(s.push(`${a} _setter${c}=${c}{};`),e=!0),s.push(`_setter.${t.reexported}${c}=${c}module.${t.imported};`));}),e&&s.push("exports(_setter);")):i.forEach(e=>{s.push(`exports('${e.reexported}',${c}module.${e.imported});`);});}f.push(s.join(`${u}${r}${r}${r}`));});let m=`System.register(${h.name?`'${h.name}',${c}`:""}[`+l.join(`,${c}`)+`],${c}function${c}(exports,${c}module)${c}{${u}${r}'use strict';`+To(d,a,c,r,u)+Do(p,c,r,u)+`${u}${r}return${c}{${f.length?`${u}${r}${r}setters:${c}[${f.map(e=>e?`function${c}(module)${c}{${u}${r}${r}${r}${e}${u}${r}${r}}`:`function${c}()${c}{}`).join(`,${c}`)}],`:""}${u}`;m+=`${r}${r}execute:${c}${o?`async${c}`:""}function${c}()${c}{${u}${u}`+Vo(n,c,r,u);const g=`${u}${u}`+Bo(n,c,r,u)+`${r}${r}}${u}${r}}${h.compact?"":";"}${u}});`;return i&&e.prepend(i),s&&e.append(s),e.indent(`${r}${r}${r}`).append(g).prepend(m)},amd:function(e,{dependencies:t,dynamicImport:n,exports:r,hasExports:i,indentString:s,intro:o,isEntryModuleFacade:a,namedExportsMode:h,needsAmdModule:u,outro:c,varOrConst:l,warn:p},d){xo(p,t);const f=t.map(e=>`'${function(e){return "."===e[0]&&e.endsWith(".js")?e.slice(0,-3):e}(e.id)}'`),m=t.map(e=>e.name),g=d.compact?"":"\n",y=d.compact?"":" ";h&&i&&(m.unshift("exports"),f.unshift("'exports'")),n&&(m.unshift("require"),f.unshift("'require'")),u&&(m.unshift("module"),f.unshift("'module'"));const x=d.amd||{},v=(x.id?`'${x.id}',${y}`:"")+(f.length?`[${f.join(`,${y}`)}],${y}`:""),E=!1!==d.strict?`${y}'use strict';`:"",_=`${x.define||"define"}(${v}function${y}(${m.join(`,${y}`)})${y}{${E}${g}${g}`,b=go(t,d,l);b&&e.prepend(b+g+g),o&&e.prepend(o);const A=mo(r,t,h,d.interop,d.compact,s);return A&&e.append(g+g+A),h&&i&&a&&d.esModule&&e.append(`${g}${g}${d.compact?fo:po}`),c&&e.append(c),e.indent(s).append(g+g+"});").prepend(_)},cjs:function(e,{dependencies:t,exports:n,hasExports:r,indentString:i,intro:s,isEntryModuleFacade:o,namedExportsMode:a,outro:h,varOrConst:u},c){const l=c.compact?"":"\n",p=c.compact?"":" ";s=(!1===c.strict?s:`'use strict';${l}${l}${s}`)+(a&&r&&o&&c.esModule?`${c.compact?fo:po}${l}${l}`:"");let d=!1;const f=!1!==c.interop;let m,g=!1;m="";for(const{id:e,namedExportsMode:n,isChunk:r,name:i,reexports:s,imports:o,exportsNames:a,exportsDefault:h}of t)s||o?(m+=c.compact&&g?",":`${m?`;${l}`:""}${u} `,g=!0,f&&!r&&h&&n?(d=!0,m+=a?`${i}${p}=${p}require('${e}')${c.compact?",":`;\n${u} `}${i}__default${p}=${p}${Zs}(${i})`:`${i}${p}=${p}${Zs}(require('${e}'))`):m+=`${i}${p}=${p}require('${e}')`):(m&&(m+=!c.compact||g?`;${l}`:","),g=!1,m+=`require('${e}')`);if(m&&(m+=";"),d){const e=c.compact?"e":"ex";s+=`function ${Zs}${p}(${e})${p}{${p}return${p}`+`(${e}${p}&&${p}(typeof ${e}${p}===${p}'object')${p}&&${p}'default'${p}in ${e})${p}`+`?${p}${e}['default']${p}:${p}${e}${c.compact?"":"; "}}${l}${l}`;}m&&(s+=m+l+l);const y=mo(n,t,a,c.interop,c.compact,i,`module.exports${p}=${p}`);return e.prepend(s),y&&e.append(l+l+y),h&&e.append(h),e},es:function(e,{intro:t,outro:n,dependencies:r,exports:i},s){const o=s.compact?"":" ",a=s.compact?"":"\n",h=r.map(({id:e,reexports:t,imports:n,name:r})=>{if(!t&&!n)return `import${o}'${e}';`;let i="";if(n){const t=n.find(e=>"default"===e.imported),r=n.find(e=>"*"===e.imported);r&&(i+=`import${o}*${o}as ${r.local} from${o}'${e}';`,n.length>1&&(i+=a)),t&&1===n.length?i+=`import ${t.local} from${o}'${e}';`:(!r||n.length>1)&&(i+=`import ${t?`${t.local},${o}`:""}{${o}${n.filter(e=>e!==t&&e!==r).map(e=>e.imported===e.local?e.imported:`${e.imported} as ${e.local}`).join(`,${o}`)}${o}}${o}from${o}'${e}';`);}if(t){n&&(i+=a);const s=t.find(e=>"*"===e.reexported),h=t.find(e=>"*"===e.imported&&"*"!==e.reexported);if(s){if(i+=`export${o}*${o}from${o}'${e}';`,1===t.length)return i;i+=a;}if(h){if(n&&n.some(e=>"*"===e.imported&&e.local===r)||(i+=`import${o}*${o}as ${r} from${o}'${e}';${a}`),i+=`export${o}{${o}${r===h.reexported?r:`${r} as ${h.reexported}`} };`,t.length===(s?2:1))return i;i+=a;}i+=`export${o}{${o}${t.filter(e=>e!==s&&e!==h).map(e=>e.imported===e.reexported?e.imported:`${e.imported} as ${e.reexported}`).join(`,${o}`)}${o}}${o}from${o}'${e}';`;}return i}).join(a);h&&(t+=h+a+a),t&&e.prepend(t);const u=[],c=[];return i.forEach(e=>{"default"===e.exported?u.push(`export default ${e.local};`):c.push(e.exported===e.local?e.local:`${e.local} as ${e.exported}`);}),c.length&&u.push(`export${o}{${o}${c.join(`,${o}`)}${o}};`),u.length&&e.append(a+a+u.join(a).trim()),n&&e.append(n),e.trim()},iife:function(e,{dependencies:t,exports:n,hasExports:r,indentString:i,intro:s,namedExportsMode:o,outro:a,varOrConst:h,warn:u},c){const l=c.compact?"":" ",p=c.compact?"":"\n",{extend:d,name:f}=c,m=f&&-1!==f.indexOf("."),g=!d&&!m;var y;f&&g&&(rt(y=f)||tt[y]||nt.test(y))&&So({code:"ILLEGAL_IDENTIFIER_AS_NAME",message:`Given name (${f}) is not legal JS identifier. If you need this you can try --extend option`}),xo(u,t);const x=Oo(t),v=x.map(e=>e.globalName||"null"),E=x.map(e=>e.name);r&&!f&&So({code:"INVALID_OPTION",message:'You must supply "output.name" for IIFE bundles.'}),o&&r&&(d?(v.unshift(`${Mo(f)}${l}=${l}${Mo(f)}${l}||${l}{}`),E.unshift("exports")):(v.unshift("{}"),E.unshift("exports")));const _=!1!==c.strict?`${i}'use strict';${p}${p}`:"";let b=`(function${l}(${E.join(`,${l}`)})${l}{${p}${_}`;!r||d&&o||(b=(g?`${h} ${f}`:Mo(f))+`${l}=${l}${b}`),m&&r&&(b=function(e,t,n,r){const i=e.split(".");n&&(i[0]=("function"==typeof n?n(i[0]):n[i[0]])||i[0]);const s=r?"":" ";i.pop();let o=t;return i.map(e=>(o+=No(e),`${o}${s}=${s}${o}${s}||${s}{}${r?"":";"}`)).join(r?",":"\n")+(r&&i.length?";":"\n")}(f,"this",c.globals,c.compact)+b);let A=`${p}${p}}(${v.join(`,${l}`)}));`;!d&&o&&r&&(A=`${p}${p}${i}return exports;${A}`);const S=go(t,c,h);S&&e.prepend(S+p+p),s&&e.prepend(s);const I=mo(n,t,o,c.interop,c.compact,i);return I&&e.append(p+p+I),a&&e.append(a),e.indent(i).prepend(b).append(A)},umd:function(e,{dependencies:t,exports:n,hasExports:r,indentString:i,intro:s,namedExportsMode:o,outro:a,varOrConst:h,warn:u},c){const l=c.compact?"":" ",p=c.compact?"":"\n",d=c.compact?"f":"factory",f=c.compact?"g":"global";r&&!c.name&&So({code:"INVALID_OPTION",message:'You must supply "output.name" for UMD bundles.'}),xo(u,t);const m=t.map(e=>`'${e.id}'`),g=t.map(e=>`require('${e.id}')`),y=Oo(t),x=y.map(e=>zo(e.globalName,f)),v=y.map(e=>e.name);o&&(r||!0===c.noConflict)&&(m.unshift("'exports'"),g.unshift("exports"),x.unshift(Ro(c.name,f,c.globals,c.compact,`${c.extend?`${zo(c.name,f)}${l}||${l}`:""}{}`)),v.unshift("exports"));const E=c.amd||{},_=(E.id?`'${E.id}',${l}`:"")+(m.length?`[${m.join(`,${l}`)}],${l}`:""),b=E.define||"define",A=!o&&r?`module.exports${l}=${l}`:"",S=!1!==c.strict?`${l}'use strict';${p}`:"";let I;if(!0===c.noConflict){const e=c.compact?"e":"exports";let t;!o&&r?t=`var ${e}${l}=${l}${Ro(c.name,f,c.globals,c.compact,`${d}(${x.join(`,${l}`)})`)};`:o&&(t=`var ${e}${l}=${l}${x.shift()};${p}`+`${i}${i}${d}(${[e].concat(x).join(`,${l}`)});`),I=`(function${l}()${l}{${p}`+`${i}${i}var current${l}=${l}${function(e,t,n){const r=e.split(".");let i=t;return r.map(e=>(i+=No(e),i)).join(`${n}&&${n}`)}(c.name,f,l)};${p}`+`${i}${i}${t}${p}`+`${i}${i}${e}.noConflict${l}=${l}function${l}()${l}{${l}`+`${zo(c.name,f)}${l}=${l}current;${l}return ${e}${c.compact?"":"; "}};${p}`+`${i}}())`;}else I=`${d}(${x.join(`,${l}`)})`,!o&&r&&(I=Ro(c.name,f,c.globals,c.compact,I));const w=r||!0===c.noConflict&&o||x.length>0,P=w?`this,${l}`:"",k=w?`(${f}${l}=${l}${f}${l}||${l}self,${l}`:"",C=w?")":"",N=`(function${l}(${w?`${f},${l}`:""}${d})${l}{${p}`+(w?`${i}typeof exports${l}===${l}'object'${l}&&${l}typeof module${l}!==${l}'undefined'${l}?`+`${l}${A}${d}(${g.join(`,${l}`)})${l}:${p}`:"")+`${i}typeof ${b}${l}===${l}'function'${l}&&${l}${b}.amd${l}?${l}${b}(${_}${d})${l}:${p}`+`${i}${k}${I}${C};${p}`+`}(${P}function${l}(${v.join(", ")})${l}{${S}${p}`,$=p+p+"}));",R=go(t,c,h);R&&e.prepend(R+p+p),s&&e.prepend(s);const O=mo(n,t,o,c.interop,c.compact,i);return O&&e.append(p+p+O),o&&r&&c.esModule&&e.append(p+p+(c.compact?fo:po)),a&&e.append(a),e.trim().indent(i).append($).prepend(N)}};const Wo={ArrayPattern(e,t){for(const n of t.elements)n&&Wo[n.type](e,n);},AssignmentPattern(e,t){Wo[t.left.type](e,t.left);},Identifier(e,t){e.push(t.name);},MemberExpression(){},ObjectPattern(e,t){for(const n of t.properties)"RestElement"===n.type?Wo.RestElement(e,n):Wo[n.value.type](e,n.value);},RestElement(e,t){Wo[t.argument.type](e,t.argument);}},Uo=function(e){const t=[];return Wo[e.type](t,e),t};class Fo extends Et{addDeclaration(e,t,n=null,r=!1){return r?this.parent.addDeclaration(e,t,Ie,!0):super.addDeclaration(e,t,n,!1)}}class qo extends Ls{addImplicitReturnExpressionToScope(){const e=this.body[this.body.length-1];e&&e.type===oe||this.scope.addReturnExpression(Ie);}createScope(e){this.scope=this.parent.preventChildBlockScope?e:new Fo(e);}hasEffects(e){for(const t of this.body)if(t.hasEffects(e))return !0;return !1}include(e){this.included=!0;for(const t of this.body)(e||t.shouldBeIncluded())&&t.include(e);}render(e,t){this.body.length?de(this.body,e,this.start+1,this.end-1,t):super.render(e,t);}}class Go extends Ls{createScope(e){this.scope=new Fs(e,this.context);}deoptimizePath(e){1===e.length&&e[0]===Ee&&this.scope.getReturnExpression().deoptimizePath(be);}getReturnExpressionWhenCalledAtPath(e){return 0===e.length?this.scope.getReturnExpression():Ie}hasEffects(e){return !1}hasEffectsWhenAccessedAtPath(e,t){return e.length>1}hasEffectsWhenAssignedAtPath(e,t){return e.length>1}hasEffectsWhenCalledAtPath(e,t,n){if(e.length>0)return !0;for(const e of this.params)if(e.hasEffects(n))return !0;return this.body.hasEffects(n)}initialise(){this.included=!1;for(const e of this.params)e.declare("parameter",Ie);this.body instanceof qo?this.body.addImplicitReturnExpressionToScope():this.scope.addReturnExpression(this.body);}parseNode(e){e.body.type===X&&(this.body=new this.context.nodeConstructors.BlockStatement(e.body,this,this.scope.hoistedBodyVarScope)),super.parseNode(e);}}function Ho(e){return 1===e.length?`exports('${e[0].safeExportName||e[0].exportName}', ${e[0].getName()});`:`exports({${e.map(e=>`${e.safeExportName||e.exportName}: ${e.getName()}`).join(", ")}});`}Go.prototype.preventChildBlockScope=!0;const Ko={"!=":(e,t)=>e!=t,"!==":(e,t)=>e!==t,"%":(e,t)=>e%t,"&":(e,t)=>e&t,"*":(e,t)=>e*t,"**":(e,t)=>Math.pow(e,t),"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"<":(e,t)=>ee<e<=t,"==":(e,t)=>e==t,"===":(e,t)=>e===t,">":(e,t)=>e>t,">=":(e,t)=>e>=t,">>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t,"^":(e,t)=>e^t,in:()=>Se,instanceof:()=>Se,"|":(e,t)=>e|t};const Yo={};class Xo{constructor(e=Rs.Map()){this.entityPaths=e;}isTracked(e,t){return this.entityPaths.getIn([e,...t,Yo])}track(e,t){return new Xo(this.entityPaths.setIn([e,...t,Yo],!0))}}const Qo=new Xo;class Jo extends Us{addDeclaration(e,t,n=null,r=!1){return r?this.parent.addDeclaration(e,t,n,!0):super.addDeclaration(e,t,n,!1)}}class Zo extends Ls{createScope(e){this.scope=new Jo(e,this.context);}initialise(){this.included=!1,this.param&&this.param.declare("parameter",Ie);}parseNode(e){this.body=new this.context.nodeConstructors.BlockStatement(e.body,this,this.scope),super.parseNode(e);}}Zo.prototype.preventChildBlockScope=!0;class ea{constructor(e){this.expressions=e;}deoptimizePath(e){for(const t of this.expressions)t.deoptimizePath(e);}getLiteralValueAtPath(){return Se}getReturnExpressionWhenCalledAtPath(e,t,n){return new ea(this.expressions.map(r=>r.getReturnExpressionWhenCalledAtPath(e,t,n)))}hasEffectsWhenAccessedAtPath(e,t){for(const n of this.expressions)if(n.hasEffectsWhenAccessedAtPath(e,t))return !0;return !1}hasEffectsWhenAssignedAtPath(e,t){for(const n of this.expressions)if(n.hasEffectsWhenAssignedAtPath(e,t))return !0;return !1}hasEffectsWhenCalledAtPath(e,t,n){for(const r of this.expressions)if(r.hasEffectsWhenCalledAtPath(e,t,n))return !0;return !1}include(){}}class ta extends Ls{hasEffects(){return !1}initialise(){this.included=!1,this.context.addExport(this);}render(e,t,{start:n,end:r}=Y){e.remove(n,r);}}ta.prototype.needsBoundaries=!0;class na extends Ls{bind(){null!==this.declaration&&this.declaration.bind();}hasEffects(e){return null!==this.declaration&&this.declaration.hasEffects(e)}initialise(){this.included=!1,this.context.addExport(this);}render(e,t,{start:n,end:r}=Y){null===this.declaration?e.remove(n,r):(e.remove(this.start,this.declaration.start),this.declaration.render(e,t,{start:n,end:r}));}}na.prototype.needsBoundaries=!0;const ra=e=>{switch(e.format){case"cjs":{const t=e.compact?"":" ";return {interopLeft:`Promise.resolve({${t}default:${t}require(`,interopRight:`)${t}})`,left:"Promise.resolve(require(",right:"))"}}case"amd":{const t=e.compact?"":" ",n=e.compact?"c":"resolve",r=e.compact?"e":"reject";return {interopLeft:`new Promise(function${t}(${n},${t}${r})${t}{${t}require([`,interopRight:`],${t}function${t}(m)${t}{${t}${n}({${t}default:${t}m${t}})${t}},${t}${r})${t}})`,left:`new Promise(function${t}(${n},${t}${r})${t}{${t}require([`,right:`],${t}${n},${t}${r})${t}})`}}case"system":return {left:"module.import(",right:")"};case"es":return {left:`${e.dynamicImportFunction||"import"}(`,right:")"}}};class ia extends Ls{bind(){}hasEffects(){return !1}initialise(){this.included=!1,this.context.addImport(this);}render(e,t,{start:n,end:r}=Y){e.remove(n,r);}}ia.prototype.needsBoundaries=!0;class sa extends Ls{getLiteralValueAtPath(e){return e.length>0||null===this.value&&110!==this.context.code.charCodeAt(this.start)||"bigint"==typeof this.value?Se:this.value}getReturnExpressionWhenCalledAtPath(e){return 1!==e.length?Ie:Xe(this.members,e[0])}hasEffectsWhenAccessedAtPath(e){return null===this.value?e.length>0:e.length>1}hasEffectsWhenAssignedAtPath(e){return e.length>0}hasEffectsWhenCalledAtPath(e,t,n){return 1!==e.length||Ye(this.members,e[0],this.included,t,n)}initialise(){this.included=!1,this.members=function(e){switch(typeof e){case"boolean":return Ge;case"number":return He;case"string":return Ke;default:return Object.create(null)}}(this.value);}render(e,t){"string"==typeof this.value&&e.indentExclusionRanges.push([this.start+1,this.end-1]);}}function oa(e){return e.computed?function(e){if(e instanceof sa)return String(e.value);return null}(e.property):e.property.name}class aa extends Ls{constructor(){super(...arguments),this.variable=null;}addExportedVariables(){}bind(){if(this.bound)return;this.bound=!0;const e=function e(t){const n=t.propertyKey,r=t.object;if("string"==typeof n){if(r instanceof Xs)return [{key:r.name,pos:r.start},{key:n,pos:t.property.start}];if(r instanceof aa){const i=e(r);return i&&[...i,{key:n,pos:t.property.start}]}}return null}(this),t=e&&this.scope.findVariable(e[0].key);if(t&&t.isNamespace){const n=this.resolveNamespaceVariables(t,e.slice(1));n?"string"==typeof n?this.replacement=n:(n.isExternal&&n.module&&n.module.suggestName(e[0].key),this.variable=n,this.scope.addNamespaceMemberAccess(function(e){let t=e[0].key;for(let n=1;n0||1!==this.quasis.length?Se:this.quasis[0].value.cooked}render(e,t){e.indentExclusionRanges.push([this.start,this.end]),super.render(e,t);}}class da extends Et{constructor(e,t){super(e),this.context=t,this.variables.this=new xt("this",null,we,t);}addExportDefaultDeclaration(e,t,n){return this.variables.default=new Qs(e,t,n)}addNamespaceMemberAccess(e,t){t instanceof oo&&(this.accessedOutsideVariables[t.name]=t);}deconflict(e){for(const t of this.children)t.deconflict(e);}findLexicalBoundary(){return this}findVariable(e){const t=this.variables[e]||this.accessedOutsideVariables[e];if(t)return t;const n=this.context.traceVariable(e)||this.parent.findVariable(e);return n instanceof oo&&(this.accessedOutsideVariables[e]=n),n}}const fa={"!":e=>!e,"+":e=>+e,"-":e=>-e,delete:()=>Se,typeof:e=>typeof e,void:()=>void 0,"~":e=>~e};function ma(e){return null!==e.renderBaseName&&null!==e.exportName&&e.isReassigned}const ga={ArrayExpression:class extends Ls{bind(){super.bind();for(const e of this.elements)null!==e&&e.deoptimizePath(be);}getReturnExpressionWhenCalledAtPath(e){return 1!==e.length?Ie:Xe(qe,e[0])}hasEffectsWhenAccessedAtPath(e){return e.length>1}hasEffectsWhenCalledAtPath(e,t,n){return 1!==e.length||Ye(qe,e[0],this.included,t,n)}},ArrayPattern:class extends Ls{addExportedVariables(e){for(const t of this.elements)null!==t&&t.addExportedVariables(e);}declare(e,t){for(const t of this.elements)null!==t&&t.declare(e,Ie);}deoptimizePath(e){if(0===e.length)for(const t of this.elements)null!==t&&t.deoptimizePath(e);}hasEffectsWhenAssignedAtPath(e,t){if(e.length>0)return !0;for(const e of this.elements)if(null!==e&&e.hasEffectsWhenAssignedAtPath(_e,t))return !0;return !1}},ArrowFunctionExpression:Go,AssignmentExpression:class extends Ls{bind(){super.bind(),this.left.deoptimizePath(_e),this.right.deoptimizePath(be);}hasEffects(e){return this.right.hasEffects(e)||this.left.hasEffects(e)||this.left.hasEffectsWhenAssignedAtPath(_e,e)}hasEffectsWhenAccessedAtPath(e,t){return e.length>0&&this.right.hasEffectsWhenAccessedAtPath(e,t)}render(e,t){if(this.left.render(e,t),this.right.render(e,t),"system"===t.format)if(this.left.variable&&this.left.variable.exportName)e.prependLeft(e.original.indexOf("=",this.left.end)+1,` exports('${this.left.variable.exportName}',`),e.appendLeft(this.right.end,")");else if("addExportedVariables"in this.left){const t=[];this.left.addExportedVariables(t),t.length>0&&(e.prependRight(this.start,`function (v) {${Ho(t)} return v;} (`),e.appendLeft(this.end,")"));}}},AssignmentPattern:class extends Ls{addExportedVariables(e){this.left.addExportedVariables(e);}bind(){super.bind(),this.left.deoptimizePath(_e),this.right.deoptimizePath(be);}declare(e,t){this.left.declare(e,t);}deoptimizePath(e){0===e.length&&this.left.deoptimizePath(e);}hasEffectsWhenAssignedAtPath(e,t){return e.length>0||this.left.hasEffectsWhenAssignedAtPath(_e,t)}render(e,t,{isShorthandProperty:n}=Y){this.left.render(e,t,{isShorthandProperty:n}),this.right.render(e,t);}},AwaitExpression:class extends Ls{hasEffects(e){return super.hasEffects(e)||!e.ignoreReturnAwaitYield()}include(e){if(super.include(e),!this.context.usesTopLevelAwait){let e=this.parent;do{if(e instanceof Gs||e instanceof Go)return}while(e=e.parent);this.context.usesTopLevelAwait=!0;}}render(e,t){super.render(e,t);}},BinaryExpression:class extends Ls{getLiteralValueAtPath(e,t,n){if(e.length>0)return Se;const r=this.left.getLiteralValueAtPath(_e,t,n);if(r===Se)return Se;const i=this.right.getLiteralValueAtPath(_e,t,n);if(i===Se)return Se;const s=Ko[this.operator];return s?s(r,i):Se}hasEffectsWhenAccessedAtPath(e,t){return e.length>1}},BlockStatement:qo,BreakStatement:class extends Ls{hasEffects(e){return super.hasEffects(e)||!e.ignoreBreakStatements()||null!==this.label&&!e.ignoreLabel(this.label.name)}},CallExpression:class extends Ls{bind(){super.bind(),this.callee instanceof Xs&&(this.scope.findVariable(this.callee.name).isNamespace&&this.context.error({code:"CANNOT_CALL_NAMESPACE",message:`Cannot call a namespace ('${this.callee.name}')`},this.start),"eval"===this.callee.name&&this.context.warn({code:"EVAL",message:"Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification",url:"https://rollupjs.org/guide/en#avoiding-eval"},this.start)),null===this.returnExpression&&(this.returnExpression=this.callee.getReturnExpressionWhenCalledAtPath(_e,Qo,this));for(const e of this.arguments)e.deoptimizePath(be);}deoptimizeCache(){if(this.returnExpression!==Ie){this.returnExpression=Ie;for(const e of this.expressionsToBeDeoptimized)e.deoptimizeCache();}}deoptimizePath(e){e.length>0&&!this.context.deoptimizationTracker.track(this,e)&&(null===this.returnExpression&&(this.returnExpression=this.callee.getReturnExpressionWhenCalledAtPath(_e,Qo,this)),this.returnExpression.deoptimizePath(e));}getLiteralValueAtPath(e,t,n){return null===this.returnExpression&&(this.returnExpression=this.callee.getReturnExpressionWhenCalledAtPath(_e,t,this)),this.returnExpression===Ie||t.isTracked(this.returnExpression,e)?Se:(this.expressionsToBeDeoptimized.push(n),this.returnExpression.getLiteralValueAtPath(e,t.track(this.returnExpression,e),n))}getReturnExpressionWhenCalledAtPath(e,t,n){return null===this.returnExpression&&(this.returnExpression=this.callee.getReturnExpressionWhenCalledAtPath(_e,t,this)),this.returnExpression===Ie||t.isTracked(this.returnExpression,e)?Ie:(this.expressionsToBeDeoptimized.push(n),this.returnExpression.getReturnExpressionWhenCalledAtPath(e,t.track(this.returnExpression,e),n))}hasEffects(e){for(const t of this.arguments)if(t.hasEffects(e))return !0;return (!this.context.annotations||!this.annotatedPure)&&(this.callee.hasEffects(e)||this.callee.hasEffectsWhenCalledAtPath(_e,this.callOptions,e.getHasEffectsWhenCalledOptions()))}hasEffectsWhenAccessedAtPath(e,t){return e.length>0&&!t.hasReturnExpressionBeenAccessedAtPath(e,this)&&this.returnExpression.hasEffectsWhenAccessedAtPath(e,t.addAccessedReturnExpressionAtPath(e,this))}hasEffectsWhenAssignedAtPath(e,t){return 0===e.length||!t.hasReturnExpressionBeenAssignedAtPath(e,this)&&this.returnExpression.hasEffectsWhenAssignedAtPath(e,t.addAssignedReturnExpressionAtPath(e,this))}hasEffectsWhenCalledAtPath(e,t,n){return !n.hasReturnExpressionBeenCalledAtPath(e,this)&&this.returnExpression.hasEffectsWhenCalledAtPath(e,t,n.addCalledReturnExpressionAtPath(e,this))}include(e){super.include(e),this.returnExpression.included||this.returnExpression.include(!1);}initialise(){this.included=!1,this.returnExpression=null,this.callOptions=ve.create({args:this.arguments,callIdentifier:this,withNew:!1}),this.expressionsToBeDeoptimized=[];}render(e,t,{renderedParentType:n}=Y){super.render(e,t),n===Z&&this.callee.type===ee&&(e.appendRight(this.start,"("),e.prependLeft(this.end,")"));}},CatchClause:Zo,ClassBody:class extends Ls{hasEffectsWhenCalledAtPath(e,t,n){return e.length>0||null!==this.classConstructor&&this.classConstructor.hasEffectsWhenCalledAtPath(_e,t,n)}initialise(){this.included=!1;for(const e of this.body)if("constructor"===e.kind)return void(this.classConstructor=e);this.classConstructor=null;}},ClassDeclaration:Bs,ClassExpression:class extends Vs{},ConditionalExpression:class extends Ls{bind(){super.bind(),this.isBranchResolutionAnalysed||this.analyseBranchResolution();}deoptimizeCache(){if(null!==this.usedBranch){this.usedBranch=null,this.unusedBranch.deoptimizePath(be);for(const e of this.expressionsToBeDeoptimized)e.deoptimizeCache();}}deoptimizePath(e){e.length>0&&(this.isBranchResolutionAnalysed||this.analyseBranchResolution(),null===this.usedBranch?(this.consequent.deoptimizePath(e),this.alternate.deoptimizePath(e)):this.usedBranch.deoptimizePath(e));}getLiteralValueAtPath(e,t,n){return this.isBranchResolutionAnalysed||this.analyseBranchResolution(),null===this.usedBranch?Se:(this.expressionsToBeDeoptimized.push(n),this.usedBranch.getLiteralValueAtPath(e,t,n))}getReturnExpressionWhenCalledAtPath(e,t,n){return this.isBranchResolutionAnalysed||this.analyseBranchResolution(),null===this.usedBranch?new ea([this.consequent.getReturnExpressionWhenCalledAtPath(e,t,n),this.alternate.getReturnExpressionWhenCalledAtPath(e,t,n)]):(this.expressionsToBeDeoptimized.push(n),this.usedBranch.getReturnExpressionWhenCalledAtPath(e,t,n))}hasEffects(e){return !!this.test.hasEffects(e)||(null===this.usedBranch?this.consequent.hasEffects(e)||this.alternate.hasEffects(e):this.usedBranch.hasEffects(e))}hasEffectsWhenAccessedAtPath(e,t){return 0!==e.length&&(null===this.usedBranch?this.consequent.hasEffectsWhenAccessedAtPath(e,t)||this.alternate.hasEffectsWhenAccessedAtPath(e,t):this.usedBranch.hasEffectsWhenAccessedAtPath(e,t))}hasEffectsWhenAssignedAtPath(e,t){return 0===e.length||(null===this.usedBranch?this.consequent.hasEffectsWhenAssignedAtPath(e,t)||this.alternate.hasEffectsWhenAssignedAtPath(e,t):this.usedBranch.hasEffectsWhenAssignedAtPath(e,t))}hasEffectsWhenCalledAtPath(e,t,n){return null===this.usedBranch?this.consequent.hasEffectsWhenCalledAtPath(e,t,n)||this.alternate.hasEffectsWhenCalledAtPath(e,t,n):this.usedBranch.hasEffectsWhenCalledAtPath(e,t,n)}include(e){this.included=!0,e||null===this.usedBranch||this.test.shouldBeIncluded()?(this.test.include(e),this.consequent.include(e),this.alternate.include(e)):this.usedBranch.include(e);}initialise(){this.included=!1,this.isBranchResolutionAnalysed=!1,this.usedBranch=null,this.unusedBranch=null,this.expressionsToBeDeoptimized=[];}render(e,t,{renderedParentType:n,isCalleeOfRenderedParent:r}=Y){this.test.included?super.render(e,t):(e.remove(this.start,this.usedBranch.start),e.remove(this.usedBranch.end,this.end),ue(this,e),this.usedBranch.render(e,t,{isCalleeOfRenderedParent:n?r:this.parent.callee===this,renderedParentType:n||this.parent.type}));}analyseBranchResolution(){this.isBranchResolutionAnalysed=!0;const e=this.test.getLiteralValueAtPath(_e,Qo,this);e!==Se&&(e?(this.usedBranch=this.consequent,this.unusedBranch=this.alternate):(this.usedBranch=this.alternate,this.unusedBranch=this.consequent));}},DoWhileStatement:class extends Ls{hasEffects(e){return this.test.hasEffects(e)||this.body.hasEffects(e.setIgnoreBreakStatements())}},EmptyStatement:class extends Ls{hasEffects(){return !1}},ExportAllDeclaration:ta,ExportDefaultDeclaration:Ys,ExportNamedDeclaration:na,ExpressionStatement:class extends Ls{initialise(){this.included=!1,this.directive&&"use strict"!==this.directive&&this.parent.type===ie&&this.context.warn({code:"MODULE_LEVEL_DIRECTIVE",message:`Module level directives cause errors when bundled, '${this.directive}' was ignored.`},this.start);}render(e,t){super.render(e,t),this.included&&this.insertSemicolon(e);}shouldBeIncluded(){return this.directive&&"use strict"!==this.directive?this.parent.type!==ie:super.shouldBeIncluded()}},ForInStatement:class extends Ls{bind(){this.left.bind(),this.left.deoptimizePath(_e),this.right.bind(),this.body.bind();}createScope(e){this.scope=new Fo(e);}hasEffects(e){return this.left&&(this.left.hasEffects(e)||this.left.hasEffectsWhenAssignedAtPath(_e,e))||this.right&&this.right.hasEffects(e)||this.body.hasEffects(e.setIgnoreBreakStatements())}include(e){this.included=!0,this.left.includeWithAllDeclaredVariables(e),this.left.deoptimizePath(_e),this.right.include(e),this.body.include(e);}render(e,t){this.left.render(e,t,ce),this.right.render(e,t,ce),this.body.render(e,t);}},ForOfStatement:class extends Ls{bind(){this.left.bind(),this.left.deoptimizePath(_e),this.right.bind(),this.body.bind();}createScope(e){this.scope=new Fo(e);}hasEffects(e){return this.left&&(this.left.hasEffects(e)||this.left.hasEffectsWhenAssignedAtPath(_e,e))||this.right&&this.right.hasEffects(e)||this.body.hasEffects(e.setIgnoreBreakStatements())}include(e){this.included=!0,this.left.includeWithAllDeclaredVariables(e),this.left.deoptimizePath(_e),this.right.include(e),this.body.include(e);}render(e,t){this.left.render(e,t,ce),this.right.render(e,t,ce),this.body.render(e,t);}},ForStatement:class extends Ls{createScope(e){this.scope=new Fo(e);}hasEffects(e){return this.init&&this.init.hasEffects(e)||this.test&&this.test.hasEffects(e)||this.update&&this.update.hasEffects(e)||this.body.hasEffects(e.setIgnoreBreakStatements())}render(e,t){this.init&&this.init.render(e,t,ce),this.test&&this.test.render(e,t,ce),this.update&&this.update.render(e,t,ce),this.body.render(e,t);}},FunctionDeclaration:Hs,FunctionExpression:class extends Gs{},Identifier:Xs,IfStatement:class extends Ls{bind(){super.bind(),this.isTestValueAnalysed||(this.testValue=Se,this.isTestValueAnalysed=!0,this.testValue=this.test.getLiteralValueAtPath(_e,Qo,this));}deoptimizeCache(){this.testValue=Se;}hasEffects(e){return !!this.test.hasEffects(e)||(this.testValue===Se?this.consequent.hasEffects(e)||null!==this.alternate&&this.alternate.hasEffects(e):this.testValue?this.consequent.hasEffects(e):null!==this.alternate&&this.alternate.hasEffects(e))}include(e){if(this.included=!0,e)return this.test.include(!0),this.consequent.include(!0),void(null!==this.alternate&&this.alternate.include(!0));const t=this.testValue===Se;(t||this.test.shouldBeIncluded())&&this.test.include(!1),(t||this.testValue)&&this.consequent.shouldBeIncluded()&&this.consequent.include(!1),null===this.alternate||!t&&this.testValue||!this.alternate.shouldBeIncluded()||this.alternate.include(!1);}initialise(){this.included=!1,this.isTestValueAnalysed=!1;}render(e,t){if(this.test.included||(this.testValue?null!==this.alternate&&this.alternate.included:this.consequent.included))this.test.included?this.test.render(e,t):e.overwrite(this.test.start,this.test.end,this.testValue?"true":"false"),this.consequent.included?this.consequent.render(e,t):e.overwrite(this.consequent.start,this.consequent.end,";"),null!==this.alternate&&(this.alternate.included?this.alternate.render(e,t):e.remove(this.consequent.end,this.alternate.end));else{const n=this.testValue?this.consequent:this.alternate;e.remove(this.start,n.start),e.remove(n.end,this.end),ue(this,e),n.render(e,t);}}},Import:class extends Ls{include(){this.included=!0,this.context.includeDynamicImport(this);}initialise(){this.included=!1,this.resolutionNamespace=void 0,this.resolutionInterop=!1,this.context.addDynamicImport(this);}render(e,t){if(this.resolutionNamespace){const n=t.compact?"":" ",r=t.compact?"":";";return void e.overwrite(this.parent.start,this.parent.end,`Promise.resolve().then(function${n}()${n}{${n}return ${this.resolutionNamespace}${r}${n}})`)}const n=ra(t);if(n){const t=this.resolutionInterop&&n.interopLeft||n.left,r=le(e.original,"(",this.parent.callee.end)+1;e.overwrite(this.parent.start,r,t);const i=this.resolutionInterop&&n.interopRight||n.right;e.overwrite(this.parent.end-1,this.parent.end,i);}}renderFinalResolution(e,t,n){this.included&&("amd"===n&&t.startsWith("'.")&&t.endsWith(".js'")&&(t=t.slice(0,-4)+"'"),e.overwrite(this.parent.arguments[0].start,this.parent.arguments[0].end,t));}setResolution(e,t){this.resolutionInterop=e,this.resolutionNamespace=t;}},ImportDeclaration:ia,LabeledStatement:class extends Ls{hasEffects(e){return this.body.hasEffects(e.setIgnoreLabel(this.label.name).setIgnoreBreakStatements())}},Literal:sa,LogicalExpression:class extends Ls{bind(){super.bind(),this.isBranchResolutionAnalysed||this.analyseBranchResolution();}deoptimizeCache(){if(null!==this.usedBranch){this.usedBranch=null,this.unusedBranch.deoptimizePath(be);for(const e of this.expressionsToBeDeoptimized)e.deoptimizeCache();}}deoptimizePath(e){e.length>0&&(this.isBranchResolutionAnalysed||this.analyseBranchResolution(),null===this.usedBranch?(this.left.deoptimizePath(e),this.right.deoptimizePath(e)):this.usedBranch.deoptimizePath(e));}getLiteralValueAtPath(e,t,n){return this.isBranchResolutionAnalysed||this.analyseBranchResolution(),null===this.usedBranch?Se:(this.expressionsToBeDeoptimized.push(n),this.usedBranch.getLiteralValueAtPath(e,t,n))}getReturnExpressionWhenCalledAtPath(e,t,n){return this.isBranchResolutionAnalysed||this.analyseBranchResolution(),null===this.usedBranch?new ea([this.left.getReturnExpressionWhenCalledAtPath(e,t,n),this.right.getReturnExpressionWhenCalledAtPath(e,t,n)]):(this.expressionsToBeDeoptimized.push(n),this.usedBranch.getReturnExpressionWhenCalledAtPath(e,t,n))}hasEffects(e){return null===this.usedBranch?this.left.hasEffects(e)||this.right.hasEffects(e):this.usedBranch.hasEffects(e)}hasEffectsWhenAccessedAtPath(e,t){return 0!==e.length&&(null===this.usedBranch?this.left.hasEffectsWhenAccessedAtPath(e,t)||this.right.hasEffectsWhenAccessedAtPath(e,t):this.usedBranch.hasEffectsWhenAccessedAtPath(e,t))}hasEffectsWhenAssignedAtPath(e,t){return 0===e.length||(null===this.usedBranch?this.left.hasEffectsWhenAssignedAtPath(e,t)||this.right.hasEffectsWhenAssignedAtPath(e,t):this.usedBranch.hasEffectsWhenAssignedAtPath(e,t))}hasEffectsWhenCalledAtPath(e,t,n){return null===this.usedBranch?this.left.hasEffectsWhenCalledAtPath(e,t,n)||this.right.hasEffectsWhenCalledAtPath(e,t,n):this.usedBranch.hasEffectsWhenCalledAtPath(e,t,n)}include(e){this.included=!0,e||null===this.usedBranch||this.unusedBranch.shouldBeIncluded()?(this.left.include(e),this.right.include(e)):this.usedBranch.include(e);}initialise(){this.included=!1,this.isBranchResolutionAnalysed=!1,this.usedBranch=null,this.unusedBranch=null,this.expressionsToBeDeoptimized=[];}render(e,t,{renderedParentType:n,isCalleeOfRenderedParent:r}=Y){this.left.included&&this.right.included?super.render(e,t):(e.remove(this.start,this.usedBranch.start),e.remove(this.usedBranch.end,this.end),ue(this,e),this.usedBranch.render(e,t,{isCalleeOfRenderedParent:n?r:this.parent.callee===this,renderedParentType:n||this.parent.type}));}analyseBranchResolution(){this.isBranchResolutionAnalysed=!0;const e=this.left.getLiteralValueAtPath(_e,Qo,this);e!==Se&&(("||"===this.operator?e:!e)?(this.usedBranch=this.left,this.unusedBranch=this.right):(this.usedBranch=this.right,this.unusedBranch=this.left));}},MemberExpression:aa,MetaProperty:class extends Ls{hasEffectsWhenAccessedAtPath(e){return e.length>1}initialise(){"import"===this.meta.name&&this.context.addImportMeta(this),this.included=!1;}renderFinalMechanism(e,t,n,r){if(!this.included)return !1;const i=this.parent,s=i instanceof aa&&"string"==typeof i.propertyKey?i.propertyKey:null;if(s&&(s.startsWith(ha)||s.startsWith(ua))){let o,a=null,h=null;s.startsWith(ha)?(a=s.substr(ha.length),o=this.context.getAssetFileName(a)):(h=s.substr(ua.length),o=this.context.getChunkFileName(h));const u=ut(dt(lt(t),o));let c;return null!==a&&(c=r.hookFirstSync("resolveAssetUrl",[{assetFileName:o,chunkId:t,format:n,moduleId:this.context.module.id,relativeAssetPath:u}])),c||(c=r.hookFirstSync("resolveFileUrl",[{assetReferenceId:a,chunkId:t,chunkReferenceId:h,fileName:o,format:n,moduleId:this.context.module.id,relativePath:u}])),e.overwrite(i.start,i.end,c),!0}const o=r.hookFirstSync("resolveImportMeta",[s,{chunkId:t,format:n,moduleId:this.context.module.id}]);return "string"==typeof o&&(i instanceof aa?e.overwrite(i.start,i.end,o):e.overwrite(this.start,this.end,o),!0)}},MethodDefinition:class extends Ls{hasEffects(e){return this.key.hasEffects(e)}hasEffectsWhenCalledAtPath(e,t,n){return e.length>0||this.value.hasEffectsWhenCalledAtPath(_e,t,n)}},NewExpression:class extends Ls{bind(){super.bind();for(const e of this.arguments)e.deoptimizePath(be);}hasEffects(e){for(const t of this.arguments)if(t.hasEffects(e))return !0;return !this.annotatedPure&&this.callee.hasEffectsWhenCalledAtPath(_e,this.callOptions,e.getHasEffectsWhenCalledOptions())}hasEffectsWhenAccessedAtPath(e,t){return e.length>1}initialise(){this.included=!1,this.callOptions=ve.create({args:this.arguments,callIdentifier:this,withNew:!0});}},ObjectExpression:class extends Ls{bind(){super.bind(),null===this.propertyMap&&this.buildPropertyMap();}deoptimizeCache(){this.hasUnknownDeoptimizedProperty||this.deoptimizeAllProperties();}deoptimizePath(e){if(this.hasUnknownDeoptimizedProperty)return;if(null===this.propertyMap&&this.buildPropertyMap(),0===e.length)return void this.deoptimizeAllProperties();const t=e[0];if(1===e.length){if("string"!=typeof t)return void this.deoptimizeAllProperties();if(!this.deoptimizedPaths[t]&&(this.deoptimizedPaths[t]=!0,this.expressionsToBeDeoptimized[t]))for(const e of this.expressionsToBeDeoptimized[t])e.deoptimizeCache();}const n=1===e.length?be:e.slice(1);for(const e of"string"==typeof t?this.propertyMap[t]?this.propertyMap[t].propertiesRead:[]:this.properties)e.deoptimizePath(n);}getLiteralValueAtPath(e,t,n){null===this.propertyMap&&this.buildPropertyMap();const r=e[0];return 0===e.length||this.hasUnknownDeoptimizedProperty||"string"!=typeof r||this.deoptimizedPaths[r]?Se:1!==e.length||this.propertyMap[r]||Fe[r]||0!==this.unmatchablePropertiesRead.length?!this.propertyMap[r]||null===this.propertyMap[r].exactMatchRead||this.propertyMap[r].propertiesRead.length>1?Se:(this.expressionsToBeDeoptimized[r]?this.expressionsToBeDeoptimized[r].push(n):this.expressionsToBeDeoptimized[r]=[n],this.propertyMap[r].exactMatchRead.getLiteralValueAtPath(e.slice(1),t,n)):void(this.expressionsToBeDeoptimized[r]?this.expressionsToBeDeoptimized[r].push(n):this.expressionsToBeDeoptimized[r]=[n])}getReturnExpressionWhenCalledAtPath(e,t,n){null===this.propertyMap&&this.buildPropertyMap();const r=e[0];return 0===e.length||this.hasUnknownDeoptimizedProperty||"string"!=typeof r||this.deoptimizedPaths[r]?Ie:1!==e.length||!Fe[r]||0!==this.unmatchablePropertiesRead.length||this.propertyMap[r]&&null!==this.propertyMap[r].exactMatchRead?!this.propertyMap[r]||null===this.propertyMap[r].exactMatchRead||this.propertyMap[r].propertiesRead.length>1?Ie:(this.expressionsToBeDeoptimized[r]?this.expressionsToBeDeoptimized[r].push(n):this.expressionsToBeDeoptimized[r]=[n],this.propertyMap[r].exactMatchRead.getReturnExpressionWhenCalledAtPath(e.slice(1),t,n)):Xe(Fe,r)}hasEffectsWhenAccessedAtPath(e,t){if(0===e.length)return !1;const n=e[0];if(e.length>1&&(this.hasUnknownDeoptimizedProperty||"string"!=typeof n||this.deoptimizedPaths[n]||!this.propertyMap[n]||null===this.propertyMap[n].exactMatchRead))return !0;const r=e.slice(1);for(const e of"string"!=typeof n?this.properties:this.propertyMap[n]?this.propertyMap[n].propertiesRead:[])if(e.hasEffectsWhenAccessedAtPath(r,t))return !0;return !1}hasEffectsWhenAssignedAtPath(e,t){if(0===e.length)return !1;const n=e[0];if(e.length>1&&(this.hasUnknownDeoptimizedProperty||"string"!=typeof n||this.deoptimizedPaths[n]||!this.propertyMap[n]||null===this.propertyMap[n].exactMatchRead))return !0;const r=e.slice(1);for(const i of"string"!=typeof n?this.properties:e.length>1?this.propertyMap[n].propertiesRead:this.propertyMap[n]?this.propertyMap[n].propertiesSet:[])if(i.hasEffectsWhenAssignedAtPath(r,t))return !0;return !1}hasEffectsWhenCalledAtPath(e,t,n){const r=e[0];if(0===e.length||this.hasUnknownDeoptimizedProperty||"string"!=typeof r||this.deoptimizedPaths[r]||(this.propertyMap[r]?!this.propertyMap[r].exactMatchRead:e.length>1||!Fe[r]))return !0;const i=e.slice(1);for(const e of this.propertyMap[r]?this.propertyMap[r].propertiesRead:[])if(e.hasEffectsWhenCalledAtPath(i,t,n))return !0;return !(1!==e.length||!Fe[r])&&Ye(Fe,r,this.included,t,n)}initialise(){this.included=!1,this.hasUnknownDeoptimizedProperty=!1,this.deoptimizedPaths=Object.create(null),this.propertyMap=null,this.expressionsToBeDeoptimized=Object.create(null);}render(e,t,{renderedParentType:n}=Y){super.render(e,t),n===Z&&(e.appendRight(this.start,"("),e.prependLeft(this.end,")"));}buildPropertyMap(){this.propertyMap=Object.create(null),this.unmatchablePropertiesRead=[],this.unmatchablePropertiesWrite=[];for(let e=this.properties.length-1;e>=0;e--){const t=this.properties[e];if(t instanceof ca){this.unmatchablePropertiesRead.push(t);continue}const n="get"!==t.kind,r="set"!==t.kind;let i;if(t.computed){const e=t.key.getLiteralValueAtPath(_e,Qo,this);if(e===Se){r?this.unmatchablePropertiesRead.push(t):this.unmatchablePropertiesWrite.push(t);continue}i=String(e);}else i=t.key instanceof Xs?t.key.name:String(t.key.value);const s=this.propertyMap[i];s?(r&&null===s.exactMatchRead&&(s.exactMatchRead=t,s.propertiesRead.push(t,...this.unmatchablePropertiesRead)),n&&!r&&null===s.exactMatchWrite&&(s.exactMatchWrite=t,s.propertiesSet.push(t,...this.unmatchablePropertiesWrite))):this.propertyMap[i]={exactMatchRead:r?t:null,exactMatchWrite:n?t:null,propertiesRead:r?[t,...this.unmatchablePropertiesRead]:[],propertiesSet:n&&!r?[t,...this.unmatchablePropertiesWrite]:[]};}}deoptimizeAllProperties(){this.hasUnknownDeoptimizedProperty=!0;for(const e of this.properties)e.deoptimizePath(be);for(const e of Object.keys(this.expressionsToBeDeoptimized))for(const t of this.expressionsToBeDeoptimized[e])t.deoptimizeCache();}},ObjectPattern:class extends Ls{addExportedVariables(e){for(const t of this.properties)t.type===se?t.value.addExportedVariables(e):t.argument.addExportedVariables(e);}declare(e,t){for(const n of this.properties)n.declare(e,t);}deoptimizePath(e){if(0===e.length)for(const t of this.properties)t.deoptimizePath(e);}hasEffectsWhenAssignedAtPath(e,t){if(e.length>0)return !0;for(const e of this.properties)if(e.hasEffectsWhenAssignedAtPath(_e,t))return !0;return !1}},Program:la,Property:class extends Ls{constructor(){super(...arguments),this.declarationInit=null;}bind(){super.bind(),"get"===this.kind&&null===this.returnExpression&&this.updateReturnExpression(),null!==this.declarationInit&&this.declarationInit.deoptimizePath([Ee,Ee]);}declare(e,t){this.declarationInit=t,this.value.declare(e,Ie);}deoptimizeCache(){throw new Error("Unexpected deoptimization")}deoptimizePath(e){"get"===this.kind?e.length>0&&(null===this.returnExpression&&this.updateReturnExpression(),this.returnExpression.deoptimizePath(e)):"set"!==this.kind&&this.value.deoptimizePath(e);}getLiteralValueAtPath(e,t,n){return "set"===this.kind?Se:"get"===this.kind?(null===this.returnExpression&&this.updateReturnExpression(),this.returnExpression.getLiteralValueAtPath(e,t,n)):this.value.getLiteralValueAtPath(e,t,n)}getReturnExpressionWhenCalledAtPath(e,t,n){return "set"===this.kind?Ie:"get"===this.kind?(null===this.returnExpression&&this.updateReturnExpression(),this.returnExpression.getReturnExpressionWhenCalledAtPath(e,t,n)):this.value.getReturnExpressionWhenCalledAtPath(e,t,n)}hasEffects(e){return this.key.hasEffects(e)||this.value.hasEffects(e)}hasEffectsWhenAccessedAtPath(e,t){return "get"===this.kind?this.value.hasEffectsWhenCalledAtPath(_e,this.accessorCallOptions,t.getHasEffectsWhenCalledOptions())||e.length>0&&this.returnExpression.hasEffectsWhenAccessedAtPath(e,t):this.value.hasEffectsWhenAccessedAtPath(e,t)}hasEffectsWhenAssignedAtPath(e,t){return "get"===this.kind?0===e.length||this.returnExpression.hasEffectsWhenAssignedAtPath(e,t):"set"===this.kind?e.length>0||this.value.hasEffectsWhenCalledAtPath(_e,this.accessorCallOptions,t.getHasEffectsWhenCalledOptions()):this.value.hasEffectsWhenAssignedAtPath(e,t)}hasEffectsWhenCalledAtPath(e,t,n){return "get"===this.kind?this.returnExpression.hasEffectsWhenCalledAtPath(e,t,n):this.value.hasEffectsWhenCalledAtPath(e,t,n)}initialise(){this.included=!1,this.returnExpression=null,this.accessorCallOptions=ve.create({callIdentifier:this,withNew:!1});}render(e,t){this.shorthand||this.key.render(e,t),this.value.render(e,t,{isShorthandProperty:this.shorthand});}updateReturnExpression(){this.returnExpression=Ie,this.returnExpression=this.value.getReturnExpressionWhenCalledAtPath(_e,Qo,this);}},RestElement:class extends Ls{constructor(){super(...arguments),this.declarationInit=null;}addExportedVariables(e){this.argument.addExportedVariables(e);}bind(){super.bind(),null!==this.declarationInit&&this.declarationInit.deoptimizePath([Ee,Ee]);}declare(e,t){this.argument.declare(e,Ie),this.declarationInit=t;}deoptimizePath(e){0===e.length&&this.argument.deoptimizePath(_e);}hasEffectsWhenAssignedAtPath(e,t){return e.length>0||this.argument.hasEffectsWhenAssignedAtPath(_e,t)}},ReturnStatement:class extends Ls{hasEffects(e){return !e.ignoreReturnAwaitYield()||null!==this.argument&&this.argument.hasEffects(e)}initialise(){this.included=!1,this.scope.addReturnExpression(this.argument||Ie);}render(e,t){this.argument&&(this.argument.render(e,t),this.argument.start===this.start+6&&e.prependLeft(this.start+6," "));}},SequenceExpression:class extends Ls{deoptimizePath(e){e.length>0&&this.expressions[this.expressions.length-1].deoptimizePath(e);}getLiteralValueAtPath(e,t,n){return this.expressions[this.expressions.length-1].getLiteralValueAtPath(e,t,n)}hasEffects(e){for(const t of this.expressions)if(t.hasEffects(e))return !0;return !1}hasEffectsWhenAccessedAtPath(e,t){return e.length>0&&this.expressions[this.expressions.length-1].hasEffectsWhenAccessedAtPath(e,t)}hasEffectsWhenAssignedAtPath(e,t){return 0===e.length||this.expressions[this.expressions.length-1].hasEffectsWhenAssignedAtPath(e,t)}hasEffectsWhenCalledAtPath(e,t,n){return this.expressions[this.expressions.length-1].hasEffectsWhenCalledAtPath(e,t,n)}include(e){this.included=!0;for(let t=0;t1&&n&&(e.prependRight(s,"("),e.appendLeft(i,")"));}},SpreadElement:ca,SwitchCase:class extends Ls{include(e){this.included=!0,this.test&&this.test.include(e);for(const t of this.consequent)(e||t.shouldBeIncluded())&&t.include(e);}render(e,t){if(this.consequent.length){this.test&&this.test.render(e,t);const n=this.test?this.test.end:le(e.original,"default",this.start)+7,r=le(e.original,":",n)+1;de(this.consequent,e,r,this.end,t);}else super.render(e,t);}},SwitchStatement:class extends Ls{createScope(e){this.scope=new Fo(e);}hasEffects(e){return super.hasEffects(e.setIgnoreBreakStatements())}},TaggedTemplateExpression:class extends Ls{bind(){super.bind(),this.tag.type===te&&(this.scope.findVariable(this.tag.name).isNamespace&&this.context.error({code:"CANNOT_CALL_NAMESPACE",message:`Cannot call a namespace ('${this.tag.name}')`},this.start),"eval"===this.tag.name&&this.context.warn({code:"EVAL",message:"Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification",url:"https://rollupjs.org/guide/en#avoiding-eval"},this.start));}hasEffects(e){return super.hasEffects(e)||this.tag.hasEffectsWhenCalledAtPath(_e,this.callOptions,e.getHasEffectsWhenCalledOptions())}initialise(){this.included=!1,this.callOptions=ve.create({callIdentifier:this,withNew:!1});}},TemplateElement:class extends Ls{hasEffects(e){return !1}},TemplateLiteral:pa,ThisExpression:class extends Ls{bind(){super.bind(),this.variable=this.scope.findVariable("this");}hasEffectsWhenAccessedAtPath(e,t){return e.length>0&&this.variable.hasEffectsWhenAccessedAtPath(e,t)}hasEffectsWhenAssignedAtPath(e,t){return this.variable.hasEffectsWhenAssignedAtPath(e,t)}initialise(){this.included=!1,this.variable=null,this.alias=this.scope.findLexicalBoundary()instanceof da?this.context.moduleContext:null,"undefined"===this.alias&&this.context.warn({code:"THIS_IS_UNDEFINED",message:"The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten",url:"https://rollupjs.org/guide/en#error-this-is-undefined"},this.start);}render(e,t){null!==this.alias&&e.overwrite(this.start,this.end,this.alias,{contentOnly:!1,storeName:!0});}},ThrowStatement:class extends Ls{hasEffects(e){return !0}},TryStatement:Ls,UnaryExpression:class extends Ls{bind(){super.bind(),"delete"===this.operator&&this.argument.deoptimizePath(_e);}getLiteralValueAtPath(e,t,n){if(e.length>0)return Se;const r=this.argument.getLiteralValueAtPath(_e,t,n);return r===Se?Se:fa[this.operator](r)}hasEffects(e){return this.argument.hasEffects(e)||"delete"===this.operator&&this.argument.hasEffectsWhenAssignedAtPath(_e,e)}hasEffectsWhenAccessedAtPath(e,t){return "void"===this.operator?e.length>0:e.length>1}},UnknownNode:class extends Ls{hasEffects(e){return !0}include(){super.include(!0);}},UpdateExpression:class extends Ls{bind(){super.bind(),this.argument.deoptimizePath(_e),this.argument instanceof Xs&&(this.scope.findVariable(this.argument.name).isReassigned=!0);}hasEffects(e){return this.argument.hasEffects(e)||this.argument.hasEffectsWhenAssignedAtPath(_e,e)}hasEffectsWhenAccessedAtPath(e,t){return e.length>1}render(e,t){this.argument.render(e,t);const n=this.argument.variable;if("system"===t.format&&n&&n.exportName){const t=n.getName();if(this.prefix)e.overwrite(this.start,this.end,`exports('${n.exportName}', ${this.operator}${t})`);else{let r;switch(this.operator){case"++":r=`${t} + 1`;break;case"--":r=`${t} - 1`;}e.overwrite(this.start,this.end,`(exports('${n.exportName}', ${r}), ${t}${this.operator})`);}}}},VariableDeclaration:class extends Ls{deoptimizePath(e){for(const e of this.declarations)e.deoptimizePath(_e);}hasEffectsWhenAssignedAtPath(e,t){return !1}include(e){this.included=!0;for(const t of this.declarations)(e||t.shouldBeIncluded())&&t.include(e);}includeWithAllDeclaredVariables(e){this.included=!0;for(const t of this.declarations)t.include(e);}initialise(){this.included=!1;for(const e of this.declarations)e.declareDeclarator(this.kind);}render(e,t,n=Y){if(function(e){for(const t of e){if(!t.included)return !1;if(t.id.type===te){if(t.id.variable.exportName)return !1}else{const e=[];if(t.id.addExportedVariables(e),e.length>0)return !1}}return !0}(this.declarations)){for(const n of this.declarations)n.render(e,t);n.isNoStatement||59===e.original.charCodeAt(this.end-1)||e.appendLeft(this.end,";");}else this.renderReplacedDeclarations(e,t,n);}renderDeclarationEnd(e,t,n,r,i,s,o){59===e.original.charCodeAt(this.end-1)&&e.remove(this.end-1,this.end),s&&(t+=";"),null!==n?(10!==e.original.charCodeAt(r-1)||10!==e.original.charCodeAt(this.end)&&13!==e.original.charCodeAt(this.end)||(r--,13===e.original.charCodeAt(r)&&r--),r===n+1?e.overwrite(n,i,t):(e.overwrite(n,n+1,t),e.remove(r,i))):e.appendLeft(i,t),o.length>0&&e.appendLeft(i," "+Ho(o));}renderReplacedDeclarations(e,t,{start:n=this.start,end:r=this.end,isNoStatement:i}){const s=fe(this.declarations,e,this.start+this.kind.length,this.end-(59===e.original.charCodeAt(this.end-1)?1:0));let o,a,h=(a=/\n\s*$/.test(e.slice(this.start,s[0].start))?this.start+this.kind.length:s[0].start)-1;e.remove(this.start,h);let u,c,l=!1,p=!1,d="";const f=[];for(const{node:n,start:r,separator:i,contentEnd:m,end:g}of s)!n.included||n.id instanceof Xs&&ma(n.id.variable)&&null===n.init?e.remove(r,g):(u="",c="",n.id instanceof Xs&&ma(n.id.variable)?(p&&(d+=";"),l=!1):("system"===t.format&&null!==n.init&&(n.id.type!==te?n.id.addExportedVariables(f):n.id.variable.exportName&&(e.prependLeft(e.original.indexOf("=",n.id.end)+1,` exports('${n.id.variable.safeExportName||n.id.variable.exportName}',`),c+=")")),l?d+=",":(p&&(d+=";"),u+=`${this.kind} `,l=!0)),a===h+1?e.overwrite(h,a,d+u):(e.overwrite(h,h+1,d),e.appendLeft(a,u)),n.render(e,t),o=m,a=g,p=!0,h=i,d=c);p?this.renderDeclarationEnd(e,d,h,o,a,!i,f):e.remove(n,r);}},VariableDeclarator:class extends Ls{declareDeclarator(e){this.id.declare(e,this.init||we);}deoptimizePath(e){this.id.deoptimizePath(e);}render(e,t){null===this.init||this.init.included?super.render(e,t):(e.remove(this.id.end,this.end),this.id.render(e,t));}},WhileStatement:class extends Ls{hasEffects(e){return this.test.hasEffects(e)||this.body.hasEffects(e.setIgnoreBreakStatements())}},YieldExpression:class extends Ls{bind(){super.bind(),null!==this.argument&&this.argument.deoptimizePath(be);}hasEffects(e){return !e.ignoreReturnAwaitYield()||null!==this.argument&&this.argument.hasEffects(e)}render(e,t){this.argument&&(this.argument.render(e,t),this.argument.start===this.start+5&&e.prependLeft(this.start+5," "));}}};function ya(e,t,n){n(e,t);}function xa(e,t,n){}var va={};function Ea(e,t,n=e.type){let r=t.commentNodes[t.commentIndex];for(;r&&e.start>=r.end;)_a(e,r),r=t.commentNodes[++t.commentIndex];r&&r.end<=e.end&&va[n](e,t,Ea);}function _a(e,t){e.annotations?e.annotations.push(t):e.annotations=[t],"ExpressionStatement"===e.type&&(e=e.expression),"CallExpression"!==e.type&&"NewExpression"!==e.type||(e.annotatedPure=!0);}va.Program=va.BlockStatement=function(e,t,n){for(var r=0,i=e.body;rba.test(e.text);let Sa="sourceMa";Sa+="ppingURL";const Ia=new RegExp(`^#\\s+${Sa}=.+\\n?`),wa=()=>{};let Pa=()=>0,ka=()=>0,Ca=()=>0,Na={};const $a=e=>1e3*e[0]+e[1]/1e6;function Ra(e,t){switch(t){case 1:return `# ${e}`;case 2:return `## ${e}`;case 3:return e;default:return `${" ".repeat(t-4)}- ${e}`}}function Oa(e,t=3){e=Ra(e,t),Na.hasOwnProperty(e)||(Na[e]={memory:0,startMemory:void 0,startTime:void 0,time:0,totalMemory:0});const n=Ca();Na[e].startTime=Pa(),Na[e].startMemory=n;}function Ma(e,t=3){if(e=Ra(e,t),Na.hasOwnProperty(e)){const t=Ca();Na[e].time+=ka(Na[e].startTime),Na[e].totalMemory=Math.max(Na[e].totalMemory,t),Na[e].memory+=t-Na[e].startMemory;}}function Ta(){const e={};return Object.keys(Na).forEach(t=>{e[t]=[Na[t].time,Na[t].memory,Na[t].totalMemory];}),e}let Da=wa,La=wa;const Va={load:!0,ongenerate:!0,onwrite:!0,resolveDynamicImport:!0,resolveId:!0,transform:!0,transformBundle:!0};function Ba(e,t){const n={};for(const r of Object.keys(e))if(!0===Va[r]){let i=`plugin ${t}`;e.name&&(i+=` (${e.name})`),i+=` - ${r}`,n[r]=function(){Da(i,4);const t=e[r].apply(this===n?e:this,arguments);return La(i,4),t&&"function"==typeof t.then&&(Da(`${i} (async)`,4),t.then(()=>La(`${i} (async)`,4))),t};}else n[r]=e[r];return n}function za(e){e.perf?(Na={},"undefined"!=typeof process&&"function"==typeof process.hrtime?(Pa=process.hrtime.bind(process),ka=(e=>$a(process.hrtime(e)))):"undefined"!=typeof performance&&"function"==typeof performance.now&&(Pa=performance.now.bind(performance),ka=(e=>performance.now()-e)),"undefined"!=typeof process&&"function"==typeof process.memoryUsage&&(Ca=(()=>process.memoryUsage().heapUsed)),Da=Oa,La=Ma,e.plugins=e.plugins.map(Ba)):(Da=wa,La=wa);}const ja={ecmaVersion:2019,preserveParens:!1,sourceType:"module"};function Wa(e,t,n,r){t.error({code:"MISSING_EXPORT",message:`'${e}' is not exported by ${bo(n)}`,url:"https://rollupjs.org/guide/en#error-name-is-not-exported-by-module-"},r);}const Ua={identifier:null,localName:Js};class Fa{constructor(e,t,n,r){this.chunkAlias=null,this.comments=[],this.dependencies=[],this.dynamicallyImportedBy=[],this.dynamicDependencies=[],this.dynamicImports=[],this.entryPointsHash=new Uint8Array(10),this.execIndex=1/0,this.exportAllModules=null,this.exportAllSources=[],this.exports=Object.create(null),this.exportsAll=Object.create(null),this.exportShimVariable=new eo(this),this.facadeChunk=null,this.importDescriptions=Object.create(null),this.importMetas=[],this.imports=new Set,this.isExecuted=!1,this.isUserDefinedEntryPoint=!1,this.manualChunkAlias=null,this.reexports=Object.create(null),this.sources=[],this.usesTopLevelAwait=!1,this.namespaceVariable=void 0,this.id=t,this.graph=e,this.excludeFromSourcemap=/\0/.test(t),this.context=e.getModuleContext(t),this.moduleSideEffects=n,this.isEntryPoint=r;}basename(){const e=ct(this.id),t=pt(this.id);return it(t?e.slice(0,-t.length):e)}bindReferences(){this.ast.bind();}error(e,t){if(void 0!==t){e.pos=t;let n=_t(this.code,t,{offsetLine:1});try{n=function(e,t){const n=e.filter(e=>e.mappings);for(;n.length>0;){const e=n.pop(),r=e.mappings[t.line-1];let i=!1;if(void 0!==r)for(const n of r)if(n[0]>=t.column){if(n.length<4)break;t={column:n[3],line:n[2]+1,name:e.names[n[4]],source:e.sources[n[1]]},i=!0;break}if(!i)throw new Error("Can't resolve original location of error.")}return t}(this.sourcemapChain,n);}catch(e){this.warn({code:"SOURCEMAP_ERROR",loc:{column:n.column,file:this.id,line:n.line},message:`Error when using sourcemap for reporting an error: ${e.message}`,pos:t},void 0);}e.loc={column:n.column,file:this.id,line:n.line},e.frame=Eo(this.originalCode,n.line,n.column);}So(e);}getAllExports(){const e=Object.assign(Object.create(null),this.exports,this.reexports);return this.exportAllModules.forEach(t=>{if(t.isExternal)e[`*${t.id}`]=!0;else for(const n of t.getAllExports())"default"!==n&&(e[n]=!0);}),Object.keys(e)}getDynamicImportExpressions(){return this.dynamicImports.map(({node:e})=>{const t=e.parent.arguments[0];if(t instanceof pa){if(0===t.expressions.length&&1===t.quasis.length)return t.quasis[0].value.cooked}else{if(!(t instanceof sa))return t;if("string"==typeof t.value)return t.value}})}getExports(){return Object.keys(this.exports)}getOrCreateNamespace(){return this.namespaceVariable||(this.namespaceVariable=new lo(this.astContext))}getReexports(){if(this.transitiveReexports)return this.transitiveReexports;this.transitiveReexports=[];const e=new Set;for(const t in this.reexports)e.add(t);for(const t of this.exportAllModules)if(t instanceof mt)e.add(`*${t.id}`);else for(const n of t.getExports().concat(t.getReexports()))"default"!==n&&e.add(n);return this.transitiveReexports=Array.from(e)}getRenderedExports(){const e=[],t=[];for(const n in this.exports){const r=this.getVariableForExportName(n);(r&&r.included?e:t).push(n);}return {renderedExports:e,removedExports:t}}getTransitiveDependencies(){return this.dependencies.concat(this.getReexports().map(e=>this.getVariableForExportName(e).module))}getVariableForExportName(e,t){if("*"===e[0]){if(1===e.length)return this.getOrCreateNamespace();return this.graph.moduleById.get(e.slice(1)).getVariableForExportName("*")}const n=this.reexports[e];if(n){const e=n.module.getVariableForExportName(n.localName);return e||Wa(n.localName,this,n.module.id,n.start),e}const r=this.exports[e];if(r){if(r===Ua)return this.exportShimVariable;const e=r.localName;return this.traceVariable(e)||this.graph.scope.findVariable(e)}if("default"!==e)for(let t=0;t{const t=this.resolvedIds[e].id;return this.graph.moduleById.get(t)});}render(e){const t=this.magicString.clone();return this.ast.render(t,e),this.usesTopLevelAwait=this.astContext.usesTopLevelAwait,t}setSource({ast:e,code:t,customTransformCache:n,moduleSideEffects:r,originalCode:i,originalSourcemap:s,resolvedIds:o,sourcemapChain:a,transformDependencies:h}){var u;this.code=t,this.originalCode=i,this.originalSourcemap=s,this.sourcemapChain=a,this.transformDependencies=h,this.customTransformCache=n,"boolean"==typeof r&&(this.moduleSideEffects=r),Da("generate ast",3),this.esTreeAst=e||function(e,t,n){try{return t.parse(e.code,Object.assign({},ja,n,{onComment:(t,n,r,i)=>e.comments.push({block:t,text:n,start:r,end:i})}))}catch(t){let n=t.message.replace(/ \(\d+:\d+\)$/,"");e.id.endsWith(".json")?n+=" (Note that you need rollup-plugin-json to import JSON files)":e.id.endsWith(".js")||(n+=" (Note that you need plugins to import files that are not JavaScript)"),e.error({code:"PARSE_ERROR",message:n},t.pos);}}(this,this.graph.acornParser,this.graph.acornOptions),u=this.comments,Ea(this.esTreeAst,{commentIndex:0,commentNodes:u.filter(Aa)}),La("generate ast",3),this.resolvedIds=o||Object.create(null);const c=this.id;this.magicString=new G(t,{filename:this.excludeFromSourcemap?null:c,indentExclusionRanges:[]}),this.removeExistingSourceMap(),Da("analyse ast",3),this.astContext={addDynamicImport:this.addDynamicImport.bind(this),addExport:this.addExport.bind(this),addImport:this.addImport.bind(this),addImportMeta:this.addImportMeta.bind(this),annotations:this.graph.treeshake&&this.graph.treeshakingOptions.annotations,code:t,deoptimizationTracker:this.graph.deoptimizationTracker,error:this.error.bind(this),fileName:c,getAssetFileName:this.graph.pluginDriver.getAssetFileName,getChunkFileName:this.graph.moduleLoader.getChunkFileName.bind(this.graph.moduleLoader),getExports:this.getExports.bind(this),getModuleExecIndex:()=>this.execIndex,getModuleName:this.basename.bind(this),getReexports:this.getReexports.bind(this),importDescriptions:this.importDescriptions,includeDynamicImport:this.includeDynamicImport.bind(this),includeVariable:this.includeVariable.bind(this),isCrossChunkImport:e=>e.module.chunk!==this.chunk,magicString:this.magicString,module:this,moduleContext:this.context,nodeConstructors:ga,preserveModules:this.graph.preserveModules,propertyReadSideEffects:!this.graph.treeshake||this.graph.treeshakingOptions.propertyReadSideEffects,traceExport:this.getVariableForExportName.bind(this),traceVariable:this.traceVariable.bind(this),treeshake:this.graph.treeshake,usesTopLevelAwait:!1,warn:this.warn.bind(this)},this.scope=new da(this.graph.scope,this.astContext),this.ast=new la(this.esTreeAst,{type:"Module",context:this.astContext},this.scope),La("analyse ast",3);}toJSON(){return {ast:this.esTreeAst,code:this.code,customTransformCache:this.customTransformCache,dependencies:this.dependencies.map(e=>e.id),id:this.id,moduleSideEffects:this.moduleSideEffects,originalCode:this.originalCode,originalSourcemap:this.originalSourcemap,resolvedIds:this.resolvedIds,sourcemapChain:this.sourcemapChain,transformAssets:this.transformAssets,transformDependencies:this.transformDependencies}}traceVariable(e){if(e in this.scope.variables)return this.scope.variables[e];if(e in this.importDescriptions){const t=this.importDescriptions[e],n=t.module;if(!n.isExternal&&"*"===t.name)return n.getOrCreateNamespace();const r=n.getVariableForExportName(t.name);return r||Wa(t.name,this,n.id,t.start),r}return null}warn(e,t){if(void 0!==t){e.pos=t;const{line:n,column:r}=_t(this.code,t,{offsetLine:1});e.loc={file:this.id,line:n,column:r},e.frame=Eo(this.code,n,r);}e.id=this.id,this.graph.warn(e);}addDynamicImport(e){this.dynamicImports.push({node:e,resolution:void 0});}addExport(e){const t=e.source&&e.source.value;if(t)if(-1===this.sources.indexOf(t)&&this.sources.push(t),e.type===J)this.exportAllSources.push(t);else for(const n of e.specifiers){const e=n.exported.name;(this.exports[e]||this.reexports[e])&&this.error({code:"DUPLICATE_EXPORT",message:`A module cannot have multiple exports with the same name ('${e}')`},n.start),this.reexports[e]={localName:n.local.name,module:null,source:t,start:n.start};}else if(e instanceof Ys)this.exports.default&&this.error({code:"DUPLICATE_EXPORT",message:"A module can only have one default export"},e.start),this.exports.default={identifier:e.variable.getAssignedVariableName(),localName:"default"};else if(e.declaration){const t=e.declaration;if(t.type===ae)for(const e of t.declarations)for(const t of Uo(e.id))this.exports[t]={identifier:null,localName:t};else{const e=t.id.name;this.exports[e]={identifier:null,localName:e};}}else for(const t of e.specifiers){const e=t.local.name,n=t.exported.name;(this.exports[n]||this.reexports[n])&&this.error({code:"DUPLICATE_EXPORT",message:`A module cannot have multiple exports with the same name ('${n}')`},t.start),this.exports[n]={identifier:null,localName:e};}}addImport(e){const t=e.source.value;-1===this.sources.indexOf(t)&&this.sources.push(t);for(const n of e.specifiers){const e=n.local.name;this.importDescriptions[e]&&this.error({code:"DUPLICATE_IMPORT",message:`Duplicated import '${e}'`},n.start);const r=n.type===ne,i=n.type===re,s=r?"default":i?"*":n.imported.name;this.importDescriptions[e]={source:t,start:n.start,name:s,module:null};}}addImportMeta(e){this.importMetas.push(e);}addModulesToSpecifiers(e){for(const t of Object.keys(e)){const n=e[t],r=this.resolvedIds[n.source].id;n.module=this.graph.moduleById.get(r);}}includeDynamicImport(e){const t=this.dynamicImports.find(t=>t.node===e).resolution;t instanceof Fa&&(t.dynamicallyImportedBy.push(this),t.includeAllExports());}includeVariable(e){const t=e.module;e.included||(e.include(),this.graph.needsTreeshakingPass=!0),t&&t!==this&&this.imports.add(e);}removeExistingSourceMap(){for(const e of this.comments)!e.block&&Ia.test(e.text)&&this.magicString.remove(e.start,e.end);}shimMissingExport(e){this.exports[e]||(this.graph.warn({code:"SHIMMED_EXPORT",exporter:bo(this.id),exportName:e,message:`Missing export "${e}" has been shimmed in module ${bo(this.id)}.`}),this.exports[e]=Ua);}}class qa{constructor(e,t){this.isOriginal=!0,this.filename=e,this.content=t;}traceSegment(e,t,n){return {line:e,column:t,name:n,source:this}}}class Ga{constructor(e,t){this.sources=t,this.names=e.names,this.mappings=e.mappings;}traceMappings(){const e=[],t=[],n=[],r=[];for(const i of this.mappings){const s=[];for(const r of i){const i=this.sources[r[1]];if(!i)continue;const o=i.traceSegment(r[2],r[3],this.names[r[4]]);if(o){let i=e.lastIndexOf(o.source.filename);-1===i?(i=e.length,e.push(o.source.filename),t[i]=o.source.content):null==t[i]?t[i]=o.source.content:null!=o.source.content&&t[i]!==o.source.content&&So({message:`Multiple conflicting contents for sourcemap source ${o.source.filename}`});const a=[r[0],i,o.line,o.column];if(o.name){let e=n.indexOf(o.name);-1===e&&(e=n.length,n.push(o.name)),a[4]=e;}s.push(a);}}r.push(s);}return {sources:e,sourcesContent:t,names:n,mappings:r}}traceSegment(e,t,n){const r=this.mappings[e];if(!r)return null;let i=0,s=r.length-1;for(;i<=s;){const e=i+s>>1,o=r[e];if(o[0]===t){const e=this.sources[o[1]];return e?e.traceSegment(o[2],o[3],this.names[o[4]]||n):null}o[0]>t?s=e-1:i=e+1;}return null}}const Ha={amd:Xa,cjs:Xa,es:Ya,iife:Xa,system:Ya,umd:Xa};function Ka(e,t,n,r,i,s,o){const{forbiddenNames:a,formatGlobals:h}=co[i];Object.assign(r,a),Object.assign(r,h),function(e,t){const n=Object.assign({},...t.map(e=>e.scope.accessedOutsideVariables));for(const t of Object.keys(n)){const r=n[t];r.included&&(e[t]=!0);}}(r,e),function(e,t){for(const n of t){const t=n.scope.variables;for(const n of Object.keys(t)){const r=t[n];r.included&&!(r.renderBaseName||r instanceof Qs&&r.getOriginalVariable()!==r)&&r.setRenderNames(null,xe(r.name,e));}const r=n.getOrCreateNamespace();r.included&&r.setRenderNames(null,xe(r.name,e));}}(r,e),Ha[i](r,n,t,s,o);for(const t of e)t.scope.deconflict(a);}function Ya(e,t,n,r){for(const n of t){const t=n.module,i=n.name;let s;s=t instanceof mt&&("*"===i||"default"===i)?"default"===i&&r&&t.exportsNamespace?t.variableName+"__default":t.variableName:i,n.setRenderNames(null,xe(s,e));}}function Xa(e,t,n,r,i){for(const t of n)t.variableName=xe(t.variableName,e);for(const e of t){const t=e.module;if(t instanceof mt){const n=e.name;"default"===n&&r&&(t.exportsNamespace||t.exportsNames)?e.setRenderNames(null,t.variableName+"__default"):"*"===n||"default"===n?e.setRenderNames(null,t.variableName):e.setRenderNames(t.variableName,null);}else{const n=t.chunk;"default"===n.exportMode||i&&e.isNamespace?e.setRenderNames(null,n.variableName):e.setRenderNames(n.variableName,n.getVariableExportName(e));}}}const Qa=(e,t)=>e.execIndex>t.execIndex?1:-1;function Ja(e){e.sort(Qa);}function Za(e,t,n){const r=[bo(e)];let i=t;for(;i!==e&&(r.push(bo(i)),i=n[i]););return r.push(r[0]),r.reverse(),r}function eh(e){const t=e.split("\n"),n=t.filter(e=>/^\t+/.test(e)),r=t.filter(e=>/^ {2,}/.test(e));if(0===n.length&&0===r.length)return null;if(n.length>=r.length)return "\t";const i=r.reduce((e,t)=>{const n=/^ +/.exec(t)[0].length;return Math.min(n,e)},1/0);return new Array(i+1).join(" ")}function th(e,t,n){return Ao(e)||So({code:"INVALID_PATTERN",message:`Invalid output pattern "${e}" for ${t}, cannot be an absolute or relative URL or path.`}),e.replace(/\[(\w+)\]/g,(e,r)=>{const i=n(r);return void 0===i&&So({code:"INVALID_PATTERN_REPLACEMENT",message:`"${r}" is not a valid substitution name in output option ${t} pattern.`}),Ao(i)||So({code:"INVALID_PATTERN_REPLACEMENT",message:`Invalid replacement "${i}" for "${r}" in ${t} pattern, must be a plain path name.`}),i})}function nh(e,t){if(e in t==!1)return e;const n=pt(e);e=e.substr(0,e.length-n.length);let r,i=1;for(;t[r=e+ ++i+n];);return r}function rh(e){return e.replace(/[\0?*]/g,"_")}function ih(e,t,n,r){let i;return "function"==typeof t?i=t(e.id):t&&(i=t[e.id]),i||(r?(n.warn({code:"MISSING_GLOBAL_NAME",guess:e.variableName,message:`No name was provided for external module '${e.id}' in output.globals – guessing '${e.variableName}'`,source:e.id}),e.variableName):void 0)}function sh(e){return !e.isEmpty||e.entryModules.length>0||null!==e.manualChunkAlias}class oh{constructor(e,t){this.entryModules=[],this.exportMode="named",this.facadeModule=null,this.hasDynamicImport=!1,this.id=void 0,this.indentString=void 0,this.manualChunkAlias=null,this.usedModules=void 0,this.dependencies=void 0,this.dynamicDependencies=void 0,this.exportNames=Object.create(null),this.exports=new Set,this.imports=new Set,this.needsExportsShim=!1,this.renderedDeclarations=void 0,this.renderedHash=void 0,this.renderedModuleSources=void 0,this.renderedSource=null,this.renderedSourceLength=void 0,this.sortedExportNames=null,this.graph=e,this.orderedModules=t,this.execIndex=t.length>0?t[0].execIndex:1/0,this.isEmpty=!0;for(const e of t)this.isEmpty&&e.isIncluded()&&(this.isEmpty=!1),e.manualChunkAlias&&(this.manualChunkAlias=e.manualChunkAlias),e.chunk=this,(e.isEntryPoint||e.dynamicallyImportedBy.some(e=>-1===t.indexOf(e)))&&this.entryModules.push(e);const n=this.entryModules[0];this.variableName=n?it(ct(n.chunkAlias||n.manualChunkAlias||_o(n.id))):"__chunk_"+ ++e.curChunkIndex;}generateEntryExportsOrMarkAsTainted(){const e=this.entryModules.map(e=>({map:this.getVariableExportNamesForModule(e),module:e}));for(const{map:t}of e)for(const e of t.keys())this.exports.add(e);e:for(const{map:t,module:n}of e){if(!this.graph.preserveModules){if(this.manualChunkAlias&&n.chunkAlias&&this.manualChunkAlias!==n.chunkAlias)continue e;for(const e of this.exports)if(!t.has(e))continue e}this.facadeModule=n;for(const[e,n]of t)for(const t of n)this.exportNames[t]=e;return}}generateId(e,t,n,r,i){this.id=nh(th(e,t,e=>{switch(e){case"format":return "es"===r.format?"esm":r.format;case"hash":return this.computeContentHashWithDependencies(n,r);case"name":return this.getChunkName()}}),i);}generateIdPreserveModules(e,t){const n=rh(this.orderedModules[0].id);this.id=nh(ut(at(this.orderedModules[0].id)?dt(e,n):"_virtual/"+ct(n)),t);}generateInternalExports(e){if(null!==this.facadeModule)return;const t="system"===e.format||"es"===e.format||e.compact;let n,r=0;if(this.exportNames=Object.create(null),this.sortedExportNames=null,t)for(const e of this.exports){do{49===(n=ye(++r)).charCodeAt(0)&&(n=ye(r+=9*Math.pow(64,n.length-1)));}while(ao[n]);this.exportNames[n]=e;}else for(const e of this.exports){for(r=0,n=e.name;this.exportNames[n];)n=e.name+"$"+ ++r;this.exportNames[n]=e;}}getChunkName(){return this.chunkName||(this.chunkName=this.computeChunkName())}getDynamicImportIds(){return this.dynamicDependencies.map(e=>e.id).filter(Boolean)}getExportNames(){return this.sortedExportNames||(this.sortedExportNames=Object.keys(this.exportNames).sort())}getImportIds(){return this.dependencies.map(e=>e.id)}getRenderedHash(){if(this.renderedHash)return this.renderedHash;if(!this.renderedSource)return "";const e=C();return e.update(this.renderedSource.toString()),e.update(this.getExportNames().map(e=>{const t=this.exportNames[e];return `${bo(t.module.id).replace(/\\/g,"/")}:${t.name}:${e}`}).join(",")),this.renderedHash=e.digest("hex")}getRenderedSourceLength(){return void 0!==this.renderedSourceLength?this.renderedSourceLength:this.renderedSourceLength=this.renderedSource.length()}getVariableExportName(e){if(this.graph.preserveModules&&e instanceof lo)return "*";for(const t of Object.keys(this.exportNames))if(this.exportNames[t]===e)return t}link(){const e=new Set,t=new Set;for(const n of this.orderedModules)this.addChunksFromDependencies(n.getTransitiveDependencies(),e),this.addChunksFromDependencies(n.dynamicDependencies,t),this.setUpModuleImports(n);this.dependencies=Array.from(e),this.dynamicDependencies=Array.from(t);}merge(e,t,n,r){if(null!==this.facadeModule||null!==e.facadeModule)throw new Error("Internal error: Code splitting chunk merges not supported for facades");for(const t of e.orderedModules)t.chunk=this,this.orderedModules.push(t);for(const t of e.imports)this.imports.has(t)||t.module.chunk===this||this.imports.add(t);for(const t of e.exports)this.exports.has(t)||this.exports.add(t);const i=this.exportNames;this.generateInternalExports(n);const s=(e,t)=>{if(e.imports)for(const n of e.imports)n.imported=this.getVariableExportName(t[n.imported]);if(e.reexports)for(const n of e.reexports)n.imported=this.getVariableExportName(t[n.imported]);},o=(e,t)=>{t.imports&&(e.imports?e.imports=e.imports.concat(t.imports):e.imports=t.imports),t.reexports&&(e.reexports?e.reexports=e.reexports.concat(t.reexports):e.reexports=t.reexports),!e.exportsNames&&t.exportsNames&&(e.exportsNames=!0),!e.exportsDefault&&t.exportsDefault&&(e.exportsDefault=!0),e.name=this.variableName;};for(const n of t){let t=void 0;for(let r=0;re.reexports&&0!==e.reexports.length),o=this.orderedModules.some(e=>e.usesTopLevelAwait);o&&"es"!==e.format&&"system"!==e.format&&So({code:"INVALID_TLA_FORMAT",message:`Module format ${e.format} does not support top-level await. Use the "es" or "system" output formats rather.`});const a=r(this.renderedSource,{dependencies:this.renderedDeclarations.dependencies,dynamicImport:this.hasDynamicImport,exports:this.renderedDeclarations.exports,hasExports:s,indentString:this.indentString,intro:t.intro,isEntryModuleFacade:null!==this.facadeModule&&this.facadeModule.isEntryPoint,namedExportsMode:"default"!==this.exportMode,needsAmdModule:i,outro:t.outro,usesTopLevelAwait:o,varOrConst:e.preferConst?"const":"var",warn:this.graph.warn.bind(this.graph)},e);t.banner&&a.prepend(t.banner),t.footer&&a.append(t.footer);const h=a.toString();La("render format",3);let u=null;const c=[];return function({graph:e,chunk:t,renderChunk:n,code:r,sourcemapChain:i,options:s}){const o=(e,t,n)=>{if(null==t)return e;"string"==typeof t&&(t={code:t,map:void 0});const r="string"==typeof t.map?JSON.parse(t.map):t.map;return r&&"string"==typeof r.mappings&&(r.mappings=O(r.mappings)),null!==r&&i.push(r||{missing:!0,plugin:n.name}),t.code};let a=!1,h=!0;return e.pluginDriver.hookReduceArg0("renderChunk",[r,n,s],o).then(n=>(h=!1,e.pluginDriver.hookReduceArg0("transformChunk",[n,s,t],o))).then(n=>(a=!0,e.pluginDriver.hookReduceArg0("transformBundle",[n,s,t],o))).catch(e=>{if(h)throw e;So(e,{code:a?"BAD_BUNDLE_TRANSFORMER":"BAD_CHUNK_TRANSFORMER",message:`Error transforming ${(a?"bundle":"chunk")+(e.plugin?` with '${e.plugin}' plugin`:"")}: ${e.message}`,plugin:e.plugin});})}({chunk:this,code:h,graph:this.graph,options:e,renderChunk:n,sourcemapChain:c}).then(t=>{if(e.sourcemap){let t;if(Da("sourcemap",3),t=e.file?ft(e.sourcemapFile||e.file):e.dir?ft(e.dir,this.id):ft(this.id),this.graph.pluginDriver.hasLoadersOrTransforms){const n=a.generateDecodedMap({});u=function(e,t,n,r,i,s){function o(t,n){return n.missing&&(e.graph.warn({code:"SOURCEMAP_BROKEN",message:`Sourcemap is likely to be incorrect: a plugin${n.plugin?` ('${n.plugin}')`:""} was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help`,plugin:n.plugin,url:"https://rollupjs.org/guide/en#warning-sourcemap-is-likely-to-be-incorrect"}),n={mappings:"",names:[]}),new Ga(n,[t])}const a=r.filter(e=>!e.excludeFromSourcemap).map(e=>{let t,n=e.sourcemapChain;const r=e.originalSourcemap;if(r){const i=r.sources,s=r.sourcesContent||[];if(null==i||i.length<=1&&null==i[0])t=new qa(e.id,s[0]),n=[r].concat(n);else{const n=lt(e.id)||".",o=r.sourceRoot||".",a=i.map((e,t)=>new qa(ft(n,o,e),s[t]));t=new Ga(r,a);}}else t=new qa(e.id,e.originalCode);return t=n.reduce(o,t)});let h=new Ga(n,a);h=i.reduce(o,h);let{sources:u,sourcesContent:c,names:l,mappings:p}=h.traceMappings();if(t){const e=lt(t);u=u.map(t=>dt(e,t)),t=ct(t);}return new L({file:t,sources:u,sourcesContent:c=s?null:c,names:l,mappings:p})}(this,t,n,this.usedModules,c,e.sourcemapExcludeSources);}else u=a.generateMap({file:t,includeContent:!e.sourcemapExcludeSources});u.sources=u.sources.map(t=>ut(e.sourcemapPathTransform?e.sourcemapPathTransform(t):t)),La("sourcemap",3);}return !0!==e.compact&&"\n"!==t[t.length-1]&&(t+="\n"),{code:t,map:u}})}turnIntoFacade(e){this.dependencies=[e.chunk],this.dynamicDependencies=[],this.facadeModule=e,e.facadeChunk=this;for(const t of e.getAllExports()){const n=e.getVariableForExportName(t);this.exports.add(n),this.exportNames[t]=n;}}visitDependencies(e){const t=[this],n=new Set;for(const r of t)if(e(r),!(r instanceof mt))for(const e of r.dependencies.concat(r.dynamicDependencies))n.has(e)||(n.add(e),t.push(e));}visitStaticDependenciesUntilCondition(e){const t=new Set;return function n(r){if(!t.has(r)){if(t.add(r),r instanceof oh)for(const e of r.dependencies)if(n(e))return !0;return !0===e(r)}}(this)}addChunksFromDependencies(e,t){for(const n of e){if(n.chunk===this)continue;let e;if(n instanceof Fa)e=n.chunk;else{if(!n.used&&!n.moduleSideEffects)continue;e=n;}t.add(e);}}computeChunkName(){if(this.manualChunkAlias)return rh(this.manualChunkAlias);if(null!==this.facadeModule)return rh(this.facadeModule.chunkAlias||_o(this.facadeModule.id));for(const e of this.orderedModules)if(e.chunkAlias)return rh(e.chunkAlias);return "chunk"}computeContentHashWithDependencies(e,t){const n=C();return n.update([e.intro,e.outro,e.banner,e.footer].map(e=>e||"").join(":")),n.update(t.format),this.visitDependencies(e=>{e instanceof mt?n.update(":"+e.renderPath):n.update(e.getRenderedHash());}),n.digest("hex").substr(0,8)}finaliseDynamicImports(e){for(let t=0;t0?s:null,isChunk:!i.isExternal,name:i.variableName,namedExportsMode:u,reexports:o});}return r}getChunkExportDeclarations(){const e=[];for(const t of this.getExportNames()){if("*"===t[0])continue;const n=this.exportNames[t],r=n.module;if(r&&r.chunk!==this)continue;let i=!1,s=!1;if(n instanceof xt){n.init===we&&(s=!0);for(const e of n.declarations)if(e.parent instanceof Hs||e instanceof Ys&&e.declaration instanceof Hs){i=!0;break}}else n instanceof oo&&(i=!0);const o=n.getName();e.push({exported:"*"===t?o:t,hoisted:i,local:o,uninitialized:s});}return e}getVariableExportNamesForModule(e){const t=new Map;for(const n of e.getAllExports()){const r=e.getVariableForExportName(n);if(!r||!r.included&&!r.isExternal)continue;const i=t.get(r);i?i.push(n):t.set(r,[n]);const s=r.module;s&&s.chunk&&s.chunk!==this&&s.chunk.exports.add(r);}return t}inlineChunkDependencies(e,t){for(const n of e.dependencies)if(n instanceof mt)-1===this.dependencies.indexOf(n)&&this.dependencies.push(n);else{if(n===this||-1!==this.dependencies.indexOf(n))continue;n.isEmpty||this.dependencies.push(n),t&&this.inlineChunkDependencies(n,!0);}}prepareDynamicImports(){for(const e of this.orderedModules)for(const{node:t,resolution:n}of e.dynamicImports)if(n)if(n instanceof Fa)if(n.chunk===this){const e=n.getOrCreateNamespace();t.setResolution(!1,e.getName());}else t.setResolution(!1);else t.setResolution(!1);}setExternalRenderPaths(e,t){for(const n of this.dependencies.concat(this.dynamicDependencies))n instanceof mt&&n.setRenderPath(e,t);}setIdentifierRenderResolutions(e){for(const t of this.getExportNames()){const n=this.exportNames[t];n&&(n instanceof eo&&(this.needsExportsShim=!0),n.exportName=t,"es"===e.format||"system"===e.format||!n.isReassigned||n.isId||n instanceof Qs&&n.hasId?n.setRenderNames(null,null):n.setRenderNames("exports",t));}const t=Object.create(null);this.needsExportsShim&&(t[Js]=!0),Ka(this.orderedModules,this.dependencies,this.imports,t,e.format,!1!==e.interop,this.graph.preserveModules);}setUpModuleImports(e){for(const t of e.imports)t.module.chunk!==this&&(this.imports.add(t),t.module instanceof Fa&&t.module.chunk.exports.add(t));if(e.getOrCreateNamespace().included)for(const t of Object.keys(e.reexports)){const n=e.reexports[t],r=n.module.getVariableForExportName(n.localName);r.module.chunk!==this&&(this.imports.add(r),r.module instanceof Fa&&r.module.chunk.exports.add(r));}for(const{node:t,resolution:n}of e.dynamicImports)t.included&&(this.hasDynamicImport=!0,n instanceof Fa&&n.chunk===this&&n.getOrCreateNamespace().include());}}var ah={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},hh="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",uh={5:hh,6:hh+" const class extends export import super"},ch=/^in(stanceof)?$/,lh="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࢽऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿯ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞹꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭥꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",ph="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",dh=new RegExp("["+lh+"]"),fh=new RegExp("["+lh+ph+"]");lh=ph=null;var mh=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,477,28,11,0,9,21,190,52,76,44,33,24,27,35,30,0,12,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,54,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,86,26,230,43,117,63,32,0,257,0,11,39,8,0,22,0,12,39,3,3,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,270,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,68,12,0,67,12,65,1,31,6129,15,754,9486,286,82,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,60,67,1213,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,15,7472,3104,541],gh=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,525,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,4,9,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,280,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1016,45,17,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,2214,6,110,6,6,9,792487,239];function yh(e,t){for(var n=65536,r=0;re)return !1;if((n+=t[r+1])>=e)return !0}}function xh(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&dh.test(String.fromCharCode(e)):!1!==t&&yh(e,mh)))}function vh(e,t){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&fh.test(String.fromCharCode(e)):!1!==t&&(yh(e,mh)||yh(e,gh)))))}var Eh=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null;};function _h(e,t){return new Eh(e,{beforeExpr:!0,binop:t})}var bh={beforeExpr:!0},Ah={startsExpr:!0},Sh={};function Ih(e,t){return void 0===t&&(t={}),t.keyword=e,Sh[e]=new Eh(e,t)}var wh={num:new Eh("num",Ah),regexp:new Eh("regexp",Ah),string:new Eh("string",Ah),name:new Eh("name",Ah),eof:new Eh("eof"),bracketL:new Eh("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new Eh("]"),braceL:new Eh("{",{beforeExpr:!0,startsExpr:!0}),braceR:new Eh("}"),parenL:new Eh("(",{beforeExpr:!0,startsExpr:!0}),parenR:new Eh(")"),comma:new Eh(",",bh),semi:new Eh(";",bh),colon:new Eh(":",bh),dot:new Eh("."),question:new Eh("?",bh),arrow:new Eh("=>",bh),template:new Eh("template"),invalidTemplate:new Eh("invalidTemplate"),ellipsis:new Eh("...",bh),backQuote:new Eh("`",Ah),dollarBraceL:new Eh("${",{beforeExpr:!0,startsExpr:!0}),eq:new Eh("=",{beforeExpr:!0,isAssign:!0}),assign:new Eh("_=",{beforeExpr:!0,isAssign:!0}),incDec:new Eh("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new Eh("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:_h("||",1),logicalAND:_h("&&",2),bitwiseOR:_h("|",3),bitwiseXOR:_h("^",4),bitwiseAND:_h("&",5),equality:_h("==/!=/===/!==",6),relational:_h("/<=/>=",7),bitShift:_h("<>/>>>",8),plusMin:new Eh("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:_h("%",10),star:_h("*",10),slash:_h("/",10),starstar:new Eh("**",{beforeExpr:!0}),_break:Ih("break"),_case:Ih("case",bh),_catch:Ih("catch"),_continue:Ih("continue"),_debugger:Ih("debugger"),_default:Ih("default",bh),_do:Ih("do",{isLoop:!0,beforeExpr:!0}),_else:Ih("else",bh),_finally:Ih("finally"),_for:Ih("for",{isLoop:!0}),_function:Ih("function",Ah),_if:Ih("if"),_return:Ih("return",bh),_switch:Ih("switch"),_throw:Ih("throw",bh),_try:Ih("try"),_var:Ih("var"),_const:Ih("const"),_while:Ih("while",{isLoop:!0}),_with:Ih("with"),_new:Ih("new",{beforeExpr:!0,startsExpr:!0}),_this:Ih("this",Ah),_super:Ih("super",Ah),_class:Ih("class",Ah),_extends:Ih("extends",bh),_export:Ih("export"),_import:Ih("import"),_null:Ih("null",Ah),_true:Ih("true",Ah),_false:Ih("false",Ah),_in:Ih("in",{beforeExpr:!0,binop:7}),_instanceof:Ih("instanceof",{beforeExpr:!0,binop:7}),_typeof:Ih("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:Ih("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:Ih("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},Ph=/\r\n?|\n|\u2028|\u2029/,kh=new RegExp(Ph.source,"g");function Ch(e,t){return 10===e||13===e||!t&&(8232===e||8233===e)}var Nh=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,$h=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Rh=Object.prototype,Oh=Rh.hasOwnProperty,Mh=Rh.toString;function Th(e,t){return Oh.call(e,t)}var Dh=Array.isArray||function(e){return "[object Array]"===Mh.call(e)};function Lh(e){return new RegExp("^(?:"+e.replace(/ /g,"|")+")$")}var Vh=function(e,t){this.line=e,this.column=t;};Vh.prototype.offset=function(e){return new Vh(this.line,this.column+e)};var Bh=function(e,t,n){this.start=t,this.end=n,null!==e.sourceFile&&(this.source=e.sourceFile);};function zh(e,t){for(var n=1,r=0;;){kh.lastIndex=r;var i=kh.exec(e);if(!(i&&i.index=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),Dh(t.onToken)){var r=t.onToken;t.onToken=function(e){return r.push(e)};}return Dh(t.onComment)&&(t.onComment=function(e,t){return function(n,r,i,s,o,a){var h={type:n?"Block":"Line",value:r,start:i,end:s};e.locations&&(h.loc=new Bh(this,o,a)),e.ranges&&(h.range=[i,s]),t.push(h);}}(t,t.onComment)),t}var Uh=2,Fh=1|Uh,qh=4,Gh=8;function Hh(e,t){return Uh|(e?qh:0)|(t?Gh:0)}var Kh=function(e,t,n){this.options=e=Wh(e),this.sourceFile=e.sourceFile,this.keywords=Lh(uh[e.ecmaVersion>=6?6:5]);var r="";if(!e.allowReserved){for(var i=e.ecmaVersion;!(r=ah[i]);i--);"module"===e.sourceType&&(r+=" await");}this.reservedWords=Lh(r);var s=(r?r+" ":"")+ah.strict;this.reservedWordsStrict=Lh(s),this.reservedWordsStrictBind=Lh(s+" "+ah.strictBind),this.input=String(t),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf("\n",n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(Ph).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=wh.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports={},0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(1),this.regexpState=null;},Yh={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}};Kh.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},Yh.inFunction.get=function(){return (this.currentVarScope().flags&Uh)>0},Yh.inGenerator.get=function(){return (this.currentVarScope().flags&Gh)>0},Yh.inAsync.get=function(){return (this.currentVarScope().flags&qh)>0},Yh.allowSuper.get=function(){return (64&this.currentThisScope().flags)>0},Yh.allowDirectSuper.get=function(){return (128&this.currentThisScope().flags)>0},Yh.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},Kh.prototype.inNonArrowFunction=function(){return (this.currentThisScope().flags&Uh)>0},Kh.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,r=0;r-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,"Parenthesized pattern");}},Xh.checkExpressionErrors=function(e,t){if(!e)return !1;var n=e.shorthandAssign,r=e.doubleProto;if(!t)return n>=0||r>=0;n>=0&&this.raise(n,"Shorthand property assignments are valid only in destructuring patterns"),r>=0&&this.raiseRecoverable(r,"Redefinition of __proto__ property");},Xh.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos=6&&(e.sourceType=this.options.sourceType),this.finishNode(e,"Program")};var eu={kind:"loop"},tu={kind:"switch"};Zh.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return !1;$h.lastIndex=this.pos;var t=$h.exec(this.input),n=this.pos+t[0].length,r=this.input.charCodeAt(n);if(91===r)return !0;if(e)return !1;if(123===r)return !0;if(xh(r,!0)){for(var i=n+1;vh(this.input.charCodeAt(i),!0);)++i;var s=this.input.slice(n,i);if(!ch.test(s))return !0}return !1},Zh.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return !1;$h.lastIndex=this.pos;var e=$h.exec(this.input),t=this.pos+e[0].length;return !(Ph.test(this.input.slice(this.pos,t))||"function"!==this.input.slice(t,t+8)||t+8!==this.input.length&&vh(this.input.charAt(t+8)))},Zh.parseStatement=function(e,t,n){var r,i=this.type,s=this.startNode();switch(this.isLet(e)&&(i=wh._var,r="let"),i){case wh._break:case wh._continue:return this.parseBreakContinueStatement(s,i.keyword);case wh._debugger:return this.parseDebuggerStatement(s);case wh._do:return this.parseDoStatement(s);case wh._for:return this.parseForStatement(s);case wh._function:return e&&(this.strict||"if"!==e&&"label"!==e)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(s,!1,!e);case wh._class:return e&&this.unexpected(),this.parseClass(s,!0);case wh._if:return this.parseIfStatement(s);case wh._return:return this.parseReturnStatement(s);case wh._switch:return this.parseSwitchStatement(s);case wh._throw:return this.parseThrowStatement(s);case wh._try:return this.parseTryStatement(s);case wh._const:case wh._var:return r=r||this.value,e&&"var"!==r&&this.unexpected(),this.parseVarStatement(s,r);case wh._while:return this.parseWhileStatement(s);case wh._with:return this.parseWithStatement(s);case wh.braceL:return this.parseBlock(!0,s);case wh.semi:return this.parseEmptyStatement(s);case wh._export:case wh._import:return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),i===wh._import?this.parseImport(s):this.parseExport(s,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(s,!0,!e);var o=this.value,a=this.parseExpression();return i===wh.name&&"Identifier"===a.type&&this.eat(wh.colon)?this.parseLabeledStatement(s,o,a,e):this.parseExpressionStatement(s,a)}},Zh.parseBreakContinueStatement=function(e,t){var n="break"===t;this.next(),this.eat(wh.semi)||this.insertSemicolon()?e.label=null:this.type!==wh.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var r=0;r=6?this.eat(wh.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},Zh.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction)&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(eu),this.enterScope(0),this.expect(wh.parenL),this.type===wh.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===wh._var||this.type===wh._const||n){var r=this.startNode(),i=n?"let":this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,"VariableDeclaration"),!(this.type===wh._in||this.options.ecmaVersion>=6&&this.isContextual("of"))||1!==r.declarations.length||"var"!==i&&r.declarations[0].init?(t>-1&&this.unexpected(t),this.parseFor(e,r)):(this.options.ecmaVersion>=9&&(this.type===wh._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,r))}var s=new Jh,o=this.parseExpression(!0,s);return this.type===wh._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.options.ecmaVersion>=9&&(this.type===wh._in?t>-1&&this.unexpected(t):e.await=t>-1),this.toAssignable(o,!1,s),this.checkLVal(o),this.parseForIn(e,o)):(this.checkExpressionErrors(s,!0),t>-1&&this.unexpected(t),this.parseFor(e,o))},Zh.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,ru|(n?0:iu),!1,t)},Zh.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(wh._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},Zh.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(wh.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},Zh.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(wh.braceL),this.labels.push(tu),this.enterScope(0);for(var n=!1;this.type!==wh.braceR;)if(this.type===wh._case||this.type===wh._default){var r=this.type===wh._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),n=!0,t.test=null),this.expect(wh.colon);}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},Zh.parseThrowStatement=function(e){return this.next(),Ph.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var nu=[];Zh.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===wh._catch){var t=this.startNode();if(this.next(),this.eat(wh.parenL)){t.param=this.parseBindingAtom();var n="Identifier"===t.param.type;this.enterScope(n?32:0),this.checkLVal(t.param,n?4:2),this.expect(wh.parenR);}else this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0);t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause");}return e.finalizer=this.eat(wh._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},Zh.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},Zh.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(eu),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},Zh.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},Zh.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},Zh.parseLabeledStatement=function(e,t,n,r){for(var i=0,s=this.labels;i=0;a--){var h=this.labels[a];if(h.statementStart!==e.start)break;h.statementStart=this.start,h.kind=o;}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?-1===r.indexOf("label")?r+"label":r:"label"),this.labels.pop(),e.label=n,this.finishNode(e,"LabeledStatement")},Zh.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},Zh.parseBlock=function(e,t){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect(wh.braceL),e&&this.enterScope(0);!this.eat(wh.braceR);){var n=this.parseStatement(null);t.body.push(n);}return e&&this.exitScope(),this.finishNode(t,"BlockStatement")},Zh.parseFor=function(e,t){return e.init=t,this.expect(wh.semi),e.test=this.type===wh.semi?null:this.parseExpression(),this.expect(wh.semi),e.update=this.type===wh.parenR?null:this.parseExpression(),this.expect(wh.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},Zh.parseForIn=function(e,t){var n=this.type===wh._in?"ForInStatement":"ForOfStatement";return this.next(),"ForInStatement"===n&&("AssignmentPattern"===t.type||"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(this.strict||"Identifier"!==t.declarations[0].id.type))&&this.raise(t.start,"Invalid assignment in for-in loop head"),e.left=t,e.right="ForInStatement"===n?this.parseExpression():this.parseMaybeAssign(),this.expect(wh.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,n)},Zh.parseVar=function(e,t,n){for(e.declarations=[],e.kind=n;;){var r=this.startNode();if(this.parseVarId(r,n),this.eat(wh.eq)?r.init=this.parseMaybeAssign(t):"const"!==n||this.type===wh._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===r.id.type||t&&(this.type===wh._in||this.isContextual("of"))?r.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat(wh.comma))break}return e},Zh.parseVarId=function(e,t){"const"!==t&&"let"!==t||!this.isContextual("let")||this.raiseRecoverable(this.start,"let is disallowed as a lexically bound name"),e.id=this.parseBindingAtom(),this.checkLVal(e.id,"var"===t?1:2,!1);};var ru=1,iu=2;Zh.parseFunction=function(e,t,n,r){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===wh.star&&t&iu&&this.unexpected(),e.generator=this.eat(wh.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&ru&&(e.id=4&t&&this.type!==wh.name?null:this.parseIdent(),!e.id||t&iu||this.checkLVal(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?1:2:3));var i=this.yieldPos,s=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Hh(e.async,e.generator)),t&ru||(e.id=this.type===wh.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1),this.yieldPos=i,this.awaitPos=s,this.awaitIdentPos=o,this.finishNode(e,t&ru?"FunctionDeclaration":"FunctionExpression")},Zh.parseFunctionParams=function(e){this.expect(wh.parenL),e.params=this.parseBindingList(wh.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams();},Zh.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.startNode(),i=!1;for(r.body=[],this.expect(wh.braceL);!this.eat(wh.braceR);){var s=this.parseClassElement(null!==e.superClass);s&&(r.body.push(s),"MethodDefinition"===s.type&&"constructor"===s.kind&&(i&&this.raise(s.start,"Duplicate constructor in the same class"),i=!0));}return e.body=this.finishNode(r,"ClassBody"),this.strict=n,this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},Zh.parseClassElement=function(e){var t=this;if(this.eat(wh.semi))return null;var n=this.startNode(),r=function(e,r){void 0===r&&(r=!1);var i=t.start,s=t.startLoc;return !!t.eatContextual(e)&&(!(t.type===wh.parenL||r&&t.canInsertSemicolon())||(n.key&&t.unexpected(),n.computed=!1,n.key=t.startNodeAt(i,s),n.key.name=e,t.finishNode(n.key,"Identifier"),!1))};n.kind="method",n.static=r("static");var i=this.eat(wh.star),s=!1;i||(this.options.ecmaVersion>=8&&r("async",!0)?(s=!0,i=this.options.ecmaVersion>=9&&this.eat(wh.star)):r("get")?n.kind="get":r("set")&&(n.kind="set")),n.key||this.parsePropertyName(n);var o=n.key,a=!1;return n.computed||n.static||!("Identifier"===o.type&&"constructor"===o.name||"Literal"===o.type&&"constructor"===o.value)?n.static&&"Identifier"===o.type&&"prototype"===o.name&&this.raise(o.start,"Classes may not have a static property named prototype"):("method"!==n.kind&&this.raise(o.start,"Constructor can't have get/set modifier"),i&&this.raise(o.start,"Constructor can't be a generator"),s&&this.raise(o.start,"Constructor can't be an async method"),n.kind="constructor",a=e),this.parseClassMethod(n,i,s,a),"get"===n.kind&&0!==n.value.params.length&&this.raiseRecoverable(n.value.start,"getter should have no params"),"set"===n.kind&&1!==n.value.params.length&&this.raiseRecoverable(n.value.start,"setter should have exactly one param"),"set"===n.kind&&"RestElement"===n.value.params[0].type&&this.raiseRecoverable(n.value.params[0].start,"Setter cannot use rest params"),n},Zh.parseClassMethod=function(e,t,n,r){return e.value=this.parseMethod(t,n,r),this.finishNode(e,"MethodDefinition")},Zh.parseClassId=function(e,t){this.type===wh.name?(e.id=this.parseIdent(),t&&this.checkLVal(e.id,2,!1)):(!0===t&&this.unexpected(),e.id=null);},Zh.parseClassSuper=function(e){e.superClass=this.eat(wh._extends)?this.parseExprSubscripts():null;},Zh.parseExport=function(e,t){if(this.next(),this.eat(wh.star))return this.expectContextual("from"),this.type!==wh.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(wh._default)){var n;if(this.checkExport(t,"default",this.lastTokStart),this.type===wh._function||(n=this.isAsyncFunction())){var r=this.startNode();this.next(),n&&this.next(),e.declaration=this.parseFunction(r,4|ru,!1,n);}else if(this.type===wh._class){var i=this.startNode();e.declaration=this.parseClass(i,"nullableID");}else e.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(null),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id.name,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==wh.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var s=0,o=e.specifiers;s=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",n&&this.checkPatternErrors(n,!0);for(var r=0,i=e.properties;r=8&&!s&&"async"===o.name&&!this.canInsertSemicolon()&&this.eat(wh._function))return this.parseFunction(this.startNodeAt(r,i),0,!1,!0);if(n&&!this.canInsertSemicolon()){if(this.eat(wh.arrow))return this.parseArrowExpression(this.startNodeAt(r,i),[o],!1);if(this.options.ecmaVersion>=8&&"async"===o.name&&this.type===wh.name&&!s)return o=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(wh.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(r,i),[o],!0)}return o;case wh.regexp:var a=this.value;return (t=this.parseLiteral(a.value)).regex={pattern:a.pattern,flags:a.flags},t;case wh.num:case wh.string:return this.parseLiteral(this.value);case wh._null:case wh._true:case wh._false:return (t=this.startNode()).value=this.type===wh._null?null:this.type===wh._true,t.raw=this.type.keyword,this.next(),this.finishNode(t,"Literal");case wh.parenL:var h=this.start,u=this.parseParenAndDistinguishExpression(n);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(u)&&(e.parenthesizedAssign=h),e.parenthesizedBind<0&&(e.parenthesizedBind=h)),u;case wh.bracketL:return t=this.startNode(),this.next(),t.elements=this.parseExprList(wh.bracketR,!0,!0,e),this.finishNode(t,"ArrayExpression");case wh.braceL:return this.parseObj(!1,e);case wh._function:return t=this.startNode(),this.next(),this.parseFunction(t,0);case wh._class:return this.parseClass(this.startNode(),!1);case wh._new:return this.parseNew();case wh.backQuote:return this.parseTemplate();default:this.unexpected();}},ou.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),this.next(),this.finishNode(t,"Literal")},ou.parseParenExpression=function(){this.expect(wh.parenL);var e=this.parseExpression();return this.expect(wh.parenR),e},ou.parseParenAndDistinguishExpression=function(e){var t,n=this.start,r=this.startLoc,i=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var s,o=this.start,a=this.startLoc,h=[],u=!0,c=!1,l=new Jh,p=this.yieldPos,d=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==wh.parenR;){if(u?u=!1:this.expect(wh.comma),i&&this.afterTrailingComma(wh.parenR,!0)){c=!0;break}if(this.type===wh.ellipsis){s=this.start,h.push(this.parseParenItem(this.parseRestBinding())),this.type===wh.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}h.push(this.parseMaybeAssign(!1,l,this.parseParenItem));}var f=this.start,m=this.startLoc;if(this.expect(wh.parenR),e&&!this.canInsertSemicolon()&&this.eat(wh.arrow))return this.checkPatternErrors(l,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=p,this.awaitPos=d,this.parseParenArrowList(n,r,h);h.length&&!c||this.unexpected(this.lastTokStart),s&&this.unexpected(s),this.checkExpressionErrors(l,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=d||this.awaitPos,h.length>1?((t=this.startNodeAt(o,a)).expressions=h,this.finishNodeAt(t,"SequenceExpression",f,m)):t=h[0];}else t=this.parseParenExpression();if(this.options.preserveParens){var g=this.startNodeAt(n,r);return g.expression=t,this.finishNode(g,"ParenthesizedExpression")}return t},ou.parseParenItem=function(e){return e},ou.parseParenArrowList=function(e,t,n){return this.parseArrowExpression(this.startNodeAt(e,t),n)};var au=[];ou.parseNew=function(){var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(wh.dot)){e.meta=t;var n=this.containsEsc;return e.property=this.parseIdent(!0),("target"!==e.property.name||n)&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is new.target"),this.inNonArrowFunction()||this.raiseRecoverable(e.start,"new.target can only be used in functions"),this.finishNode(e,"MetaProperty")}var r=this.start,i=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(),r,i,!0),this.eat(wh.parenL)?e.arguments=this.parseExprList(wh.parenR,this.options.ecmaVersion>=8,!1):e.arguments=au,this.finishNode(e,"NewExpression")},ou.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===wh.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),n.value={raw:this.value,cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),n.tail=this.type===wh.backQuote,this.finishNode(n,"TemplateElement")},ou.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(n.quasis=[r];!r.tail;)this.type===wh.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(wh.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(wh.braceR),n.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,"TemplateLiteral")},ou.isAsyncProp=function(e){return !e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===wh.name||this.type===wh.num||this.type===wh.string||this.type===wh.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===wh.star)&&!Ph.test(this.input.slice(this.lastTokEnd,this.start))},ou.parseObj=function(e,t){var n=this.startNode(),r=!0,i={};for(n.properties=[],this.next();!this.eat(wh.braceR);){if(r)r=!1;else if(this.expect(wh.comma),this.afterTrailingComma(wh.braceR))break;var s=this.parseProperty(e,t);e||this.checkPropClash(s,i,t),n.properties.push(s);}return this.finishNode(n,e?"ObjectPattern":"ObjectExpression")},ou.parseProperty=function(e,t){var n,r,i,s,o=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(wh.ellipsis))return e?(o.argument=this.parseIdent(!1),this.type===wh.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(o,"RestElement")):(this.type===wh.parenL&&t&&(t.parenthesizedAssign<0&&(t.parenthesizedAssign=this.start),t.parenthesizedBind<0&&(t.parenthesizedBind=this.start)),o.argument=this.parseMaybeAssign(!1,t),this.type===wh.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(o,"SpreadElement"));this.options.ecmaVersion>=6&&(o.method=!1,o.shorthand=!1,(e||t)&&(i=this.start,s=this.startLoc),e||(n=this.eat(wh.star)));var a=this.containsEsc;return this.parsePropertyName(o),!e&&!a&&this.options.ecmaVersion>=8&&!n&&this.isAsyncProp(o)?(r=!0,n=this.options.ecmaVersion>=9&&this.eat(wh.star),this.parsePropertyName(o,t)):r=!1,this.parsePropertyValue(o,e,n,r,i,s,t,a),this.finishNode(o,"Property")},ou.parsePropertyValue=function(e,t,n,r,i,s,o,a){if((n||r)&&this.type===wh.colon&&this.unexpected(),this.eat(wh.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===wh.parenL)t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(n,r);else if(t||a||!(this.options.ecmaVersion>=5)||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.type===wh.comma||this.type===wh.braceR)this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((n||r)&&this.unexpected(),this.checkUnreserved(e.key),"await"!==e.key.name||this.awaitIdentPos||(this.awaitIdentPos=i),e.kind="init",t?e.value=this.parseMaybeDefault(i,s,e.key):this.type===wh.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,s,e.key)):e.value=e.key,e.shorthand=!0):this.unexpected();else{(n||r)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var h="get"===e.kind?0:1;if(e.value.params.length!==h){var u=e.value.start;"get"===e.kind?this.raiseRecoverable(u,"getter should have no params"):this.raiseRecoverable(u,"setter should have exactly one param");}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params");}},ou.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(wh.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(wh.bracketR),e.key;e.computed=!1;}return e.key=this.type===wh.num||this.type===wh.string?this.parseExprAtom():this.parseIdent(!0)},ou.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1);},ou.parseMethod=function(e,t,n){var r=this.startNode(),i=this.yieldPos,s=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|Hh(t,r.generator)|(n?128:0)),this.expect(wh.parenL),r.params=this.parseBindingList(wh.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0),this.yieldPos=i,this.awaitPos=s,this.awaitIdentPos=o,this.finishNode(r,"FunctionExpression")},ou.parseArrowExpression=function(e,t,n){var r=this.yieldPos,i=this.awaitPos,s=this.awaitIdentPos;return this.enterScope(16|Hh(n,!1)),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1),this.yieldPos=r,this.awaitPos=i,this.awaitIdentPos=s,this.finishNode(e,"ArrowFunctionExpression")},ou.parseFunctionBody=function(e,t,n){var r=t&&this.type!==wh.braceL,i=this.strict,s=!1;if(r)e.body=this.parseMaybeAssign(),e.expression=!0,this.checkParams(e,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);i&&!o||(s=this.strictDirective(this.end))&&o&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list");var a=this.labels;this.labels=[],s&&(this.strict=!0),this.checkParams(e,!i&&!s&&!t&&!n&&this.isSimpleParamList(e.params)),e.body=this.parseBlock(!1),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=a;}this.exitScope(),this.strict&&e.id&&this.checkLVal(e.id,5),this.strict=i;},ou.isSimpleParamList=function(e){for(var t=0,n=e;t-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&1&i.flags&&delete this.undefinedExports[e];}else if(4===t){this.currentScope().lexical.push(e);}else if(3===t){var s=this.currentScope();r=this.treatFunctionsAsVar?s.lexical.indexOf(e)>-1:s.lexical.indexOf(e)>-1||s.var.indexOf(e)>-1,s.functions.push(e);}else for(var o=this.scopeStack.length-1;o>=0;--o){var a=this.scopeStack[o];if(a.lexical.indexOf(e)>-1&&!(32&a.flags&&a.lexical[0]===e)||!this.treatFunctionsAsVarInScope(a)&&a.functions.indexOf(e)>-1){r=!0;break}if(a.var.push(e),this.inModule&&1&a.flags&&delete this.undefinedExports[e],a.flags&Fh)break}r&&this.raiseRecoverable(n,"Identifier '"+e+"' has already been declared");},uu.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e);},uu.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},uu.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&Fh)return t}},uu.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&Fh&&!(16&t.flags))return t}};var lu=function(e,t,n){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new Bh(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0]);},pu=Kh.prototype;function du(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}pu.startNode=function(){return new lu(this,this.start,this.startLoc)},pu.startNodeAt=function(e,t){return new lu(this,e,t)},pu.finishNode=function(e,t){return du.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},pu.finishNodeAt=function(e,t,n,r){return du.call(this,e,t,n,r)};var fu=function(e,t,n,r,i){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=r,this.generator=!!i;},mu={b_stat:new fu("{",!1),b_expr:new fu("{",!0),b_tmpl:new fu("${",!1),p_stat:new fu("(",!1),p_expr:new fu("(",!0),q_tmpl:new fu("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new fu("function",!1),f_expr:new fu("function",!0),f_expr_gen:new fu("function",!0,!1,null,!0),f_gen:new fu("function",!1,!1,null,!0)},gu=Kh.prototype;gu.initialContext=function(){return [mu.b_stat]},gu.braceIsBlock=function(e){var t=this.curContext();return t===mu.f_expr||t===mu.f_stat||(e!==wh.colon||t!==mu.b_stat&&t!==mu.b_expr?e===wh._return||e===wh.name&&this.exprAllowed?Ph.test(this.input.slice(this.lastTokEnd,this.start)):e===wh._else||e===wh.semi||e===wh.eof||e===wh.parenR||e===wh.arrow||(e===wh.braceL?t===mu.b_stat:e!==wh._var&&e!==wh._const&&e!==wh.name&&!this.exprAllowed):!t.isExpr)},gu.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if("function"===t.token)return t.generator}return !1},gu.updateContext=function(e){var t,n=this.type;n.keyword&&e===wh.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr;},wh.parenR.updateContext=wh.braceR.updateContext=function(){if(1!==this.context.length){var e=this.context.pop();e===mu.b_stat&&"function"===this.curContext().token&&(e=this.context.pop()),this.exprAllowed=!e.isExpr;}else this.exprAllowed=!0;},wh.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?mu.b_stat:mu.b_expr),this.exprAllowed=!0;},wh.dollarBraceL.updateContext=function(){this.context.push(mu.b_tmpl),this.exprAllowed=!0;},wh.parenL.updateContext=function(e){var t=e===wh._if||e===wh._for||e===wh._with||e===wh._while;this.context.push(t?mu.p_stat:mu.p_expr),this.exprAllowed=!0;},wh.incDec.updateContext=function(){},wh._function.updateContext=wh._class.updateContext=function(e){!e.beforeExpr||e===wh.semi||e===wh._else||e===wh._return&&Ph.test(this.input.slice(this.lastTokEnd,this.start))||(e===wh.colon||e===wh.braceL)&&this.curContext()===mu.b_stat?this.context.push(mu.f_stat):this.context.push(mu.f_expr),this.exprAllowed=!1;},wh.backQuote.updateContext=function(){this.curContext()===mu.q_tmpl?this.context.pop():this.context.push(mu.q_tmpl),this.exprAllowed=!1;},wh.star.updateContext=function(e){if(e===wh._function){var t=this.context.length-1;this.context[t]===mu.f_expr?this.context[t]=mu.f_expr_gen:this.context[t]=mu.f_gen;}this.exprAllowed=!0;},wh.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==wh.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t;};var yu="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",xu={9:yu,10:yu+" Extended_Pictographic"},vu="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Eu="Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",_u={9:Eu,10:Eu+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd"},bu={};function Au(e){var t=bu[e]={binary:Lh(xu[e]+" "+vu),nonBinary:{General_Category:Lh(vu),Script:Lh(_u[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions;}Au(9),Au(10);var Su=Kh.prototype,Iu=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":""),this.unicodeProperties=bu[e.options.ecmaVersion>=10?10:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[];};function wu(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function Pu(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function ku(e){return e>=65&&e<=90||e>=97&&e<=122}function Cu(e){return ku(e)||95===e}function Nu(e){return Cu(e)||$u(e)}function $u(e){return e>=48&&e<=57}function Ru(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Ou(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function Mu(e){return e>=48&&e<=55}Iu.prototype.reset=function(e,t,n){var r=-1!==n.indexOf("u");this.start=0|e,this.source=t+"",this.flags=n,this.switchU=r&&this.parser.options.ecmaVersion>=6,this.switchN=r&&this.parser.options.ecmaVersion>=9;},Iu.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e);},Iu.prototype.at=function(e){var t=this.source,n=t.length;if(e>=n)return -1;var r=t.charCodeAt(e);return !this.switchU||r<=55295||r>=57344||e+1>=n?r:(r<<10)+t.charCodeAt(e+1)-56613888},Iu.prototype.nextIndex=function(e){var t=this.source,n=t.length;if(e>=n)return n;var r=t.charCodeAt(e);return !this.switchU||r<=55295||r>=57344||e+1>=n?e+1:e+2},Iu.prototype.current=function(){return this.at(this.pos)},Iu.prototype.lookahead=function(){return this.at(this.nextIndex(this.pos))},Iu.prototype.advance=function(){this.pos=this.nextIndex(this.pos);},Iu.prototype.eat=function(e){return this.current()===e&&(this.advance(),!0)},Su.validateRegExpFlags=function(e){for(var t=e.validFlags,n=e.flags,r=0;r-1&&this.raise(e.start,"Duplicate regular expression flag");}},Su.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e));},Su.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,n=e.backReferenceNames;t=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},Su.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},Su.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},Su.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var r=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return -1!==i&&i=9?this.regexp_groupSpecifier(e):63===e.current()&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group");}return !1},Su.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},Su.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},Su.regexp_eatSyntaxCharacter=function(e){var t=e.current();return !!Pu(t)&&(e.lastIntValue=t,e.advance(),!0)},Su.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;-1!==(n=e.current())&&!Pu(n);)e.advance();return e.pos!==t},Su.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return !(-1===t||36===t||t>=40&&t<=43||46===t||63===t||91===t||94===t||124===t)&&(e.advance(),!0)},Su.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e))return -1!==e.groupNames.indexOf(e.lastStringValue)&&e.raise("Duplicate capture group name"),void e.groupNames.push(e.lastStringValue);e.raise("Invalid group");}},Su.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return !0;e.raise("Invalid capture group name");}return !1},Su.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=wu(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=wu(e.lastIntValue);return !0}return !1},Su.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=e.current();return e.advance(),92===n&&this.regexp_eatRegExpUnicodeEscapeSequence(e)&&(n=e.lastIntValue),function(e){return xh(e,!0)||36===e||95===e}(n)?(e.lastIntValue=n,!0):(e.pos=t,!1)},Su.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=e.current();return e.advance(),92===n&&this.regexp_eatRegExpUnicodeEscapeSequence(e)&&(n=e.lastIntValue),function(e){return vh(e,!0)||36===e||95===e||8204===e||8205===e}(n)?(e.lastIntValue=n,!0):(e.pos=t,!1)},Su.regexp_eatAtomEscape=function(e){return !!(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))||(e.switchU&&(99===e.current()&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},Su.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return !0;e.pos=t;}return !1},Su.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference");}return !1},Su.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},Su.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return !0;e.pos=t;}return !1},Su.regexp_eatZero=function(e){return 48===e.current()&&!$u(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},Su.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},Su.regexp_eatControlLetter=function(e){var t=e.current();return !!ku(t)&&(e.lastIntValue=t%32,e.advance(),!0)},Su.regexp_eatRegExpUnicodeEscapeSequence=function(e){var t,n=e.pos;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var r=e.lastIntValue;if(e.switchU&&r>=55296&&r<=56319){var i=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(s>=56320&&s<=57343)return e.lastIntValue=1024*(r-55296)+(s-56320)+65536,!0}e.pos=i,e.lastIntValue=r;}return !0}if(e.switchU&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&((t=e.lastIntValue)>=0&&t<=1114111))return !0;e.switchU&&e.raise("Invalid unicode escape"),e.pos=n;}return !1},Su.regexp_eatIdentityEscape=function(e){if(e.switchU)return !!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return !(99===t||e.switchN&&107===t)&&(e.lastIntValue=t,e.advance(),!0)},Su.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();}while((t=e.current())>=48&&t<=57);return !0}return !1},Su.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(function(e){return 100===e||68===e||115===e||83===e||119===e||87===e}(t))return e.lastIntValue=-1,e.advance(),!0;if(e.switchU&&this.options.ecmaVersion>=9&&(80===t||112===t)){if(e.lastIntValue=-1,e.advance(),e.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(e)&&e.eat(125))return !0;e.raise("Invalid property name");}return !1},Su.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,r),!0}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i),!0}return !1},Su.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){Th(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(n)||e.raise("Invalid property value");},Su.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name");},Su.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Cu(t=e.current());)e.lastStringValue+=wu(t),e.advance();return ""!==e.lastStringValue},Su.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";Nu(t=e.current());)e.lastStringValue+=wu(t),e.advance();return ""!==e.lastStringValue},Su.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},Su.regexp_eatCharacterClass=function(e){if(e.eat(91)){if(e.eat(94),this.regexp_classRanges(e),e.eat(93))return !0;e.raise("Unterminated character class");}return !1},Su.regexp_classRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;!e.switchU||-1!==t&&-1!==n||e.raise("Invalid character class"),-1!==t&&-1!==n&&t>n&&e.raise("Range out of order in character class");}}},Su.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return !0;if(e.switchU){var n=e.current();(99===n||Mu(n))&&e.raise("Invalid class escape"),e.raise("Invalid escape");}e.pos=t;}var r=e.current();return 93!==r&&(e.lastIntValue=r,e.advance(),!0)},Su.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return !0;e.pos=t;}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},Su.regexp_eatClassControlLetter=function(e){var t=e.current();return !(!$u(t)&&95!==t)&&(e.lastIntValue=t%32,e.advance(),!0)},Su.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return !0;e.switchU&&e.raise("Invalid escape"),e.pos=t;}return !1},Su.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;$u(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t},Su.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Ru(n=e.current());)e.lastIntValue=16*e.lastIntValue+Ou(n),e.advance();return e.pos!==t},Su.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*n+e.lastIntValue:e.lastIntValue=8*t+n;}else e.lastIntValue=t;return !0}return !1},Su.regexp_eatOctalDigit=function(e){var t=e.current();return Mu(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},Su.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var r=0;r>10),56320+(1023&e)))}Du.next=function(){this.options.onToken&&this.options.onToken(new Tu(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken();},Du.getToken=function(){return this.next(),new Tu(this)},"undefined"!=typeof Symbol&&(Du[Symbol.iterator]=function(){var e=this;return {next:function(){var t=e.getToken();return {done:t.type===wh.eof,value:t}}}}),Du.curContext=function(){return this.context[this.context.length-1]},Du.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(wh.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},Du.readToken=function(e){return xh(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},Du.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);return e<=55295||e>=57344?e:(e<<10)+this.input.charCodeAt(this.pos+1)-56613888},Du.skipBlockComment=function(){var e,t=this.options.onComment&&this.curPosition(),n=this.pos,r=this.input.indexOf("*/",this.pos+=2);if(-1===r&&this.raise(this.pos-2,"Unterminated comment"),this.pos=r+2,this.options.locations)for(kh.lastIndex=n;(e=kh.exec(this.input))&&e.index8&&e<14||e>=5760&&Nh.test(String.fromCharCode(e))))break e;++this.pos;}}},Du.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n);},Du.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(wh.ellipsis)):(++this.pos,this.finishToken(wh.dot))},Du.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(wh.assign,2):this.finishOp(wh.slash,1)},Du.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=42===e?wh.star:wh.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++n,r=wh.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(wh.assign,n+1):this.finishOp(r,n)},Du.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.finishOp(124===e?wh.logicalOR:wh.logicalAND,2):61===t?this.finishOp(wh.assign,2):this.finishOp(124===e?wh.bitwiseOR:wh.bitwiseAND,1)},Du.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(wh.assign,2):this.finishOp(wh.bitwiseXOR,1)},Du.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45!==t||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!Ph.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(wh.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(wh.assign,2):this.finishOp(wh.plusMin,1)},Du.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+n)?this.finishOp(wh.assign,n+1):this.finishOp(wh.bitShift,n)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(n=2),this.finishOp(wh.relational,n)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},Du.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(wh.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(wh.arrow)):this.finishOp(61===e?wh.eq:wh.prefix,1)},Du.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return ++this.pos,this.finishToken(wh.parenL);case 41:return ++this.pos,this.finishToken(wh.parenR);case 59:return ++this.pos,this.finishToken(wh.semi);case 44:return ++this.pos,this.finishToken(wh.comma);case 91:return ++this.pos,this.finishToken(wh.bracketL);case 93:return ++this.pos,this.finishToken(wh.bracketR);case 123:return ++this.pos,this.finishToken(wh.braceL);case 125:return ++this.pos,this.finishToken(wh.braceR);case 58:return ++this.pos,this.finishToken(wh.colon);case 63:return ++this.pos,this.finishToken(wh.question);case 96:if(this.options.ecmaVersion<6)break;return ++this.pos,this.finishToken(wh.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 126:return this.finishOp(wh.prefix,1)}this.raise(this.pos,"Unexpected character '"+Lu(e)+"'");},Du.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},Du.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,"Unterminated regular expression");var r=this.input.charAt(this.pos);if(Ph.test(r)&&this.raise(n,"Unterminated regular expression"),e)e=!1;else{if("["===r)t=!0;else if("]"===r&&t)t=!1;else if("/"===r&&!t)break;e="\\"===r;}++this.pos;}var i=this.input.slice(n,this.pos);++this.pos;var s=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(s);var a=this.regexpState||(this.regexpState=new Iu(this));a.reset(n,i,o),this.validateRegExpFlags(a),this.validateRegExpPattern(a);var h=null;try{h=new RegExp(i,o);}catch(e){}return this.finishToken(wh.regexp,{pattern:i,flags:o,value:h})},Du.readInt=function(e,t){for(var n=this.pos,r=0,i=0,s=null==t?1/0:t;i=97?o-97+10:o>=65?o-65+10:o>=48&&o<=57?o-48:1/0)>=e)break;++this.pos,r=r*e+a;}return this.pos===n||null!=t&&this.pos-n!==t?null:r},Du.readRadixNumber=function(e){this.pos+=2;var t=this.readInt(e);return null==t&&this.raise(this.start+2,"Expected number in radix "+e),xh(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(wh.num,t)},Du.readNumber=function(e){var t=this.pos;e||null!==this.readInt(10)||this.raise(t,"Invalid number");var n=this.pos-t>=2&&48===this.input.charCodeAt(t);n&&this.strict&&this.raise(t,"Invalid number"),n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1);var r=this.input.charCodeAt(this.pos);46!==r||n||(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),69!==r&&101!==r||n||(43!==(r=this.input.charCodeAt(++this.pos))&&45!==r||++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number")),xh(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var i=this.input.slice(t,this.pos),s=n?parseInt(i,8):parseFloat(i);return this.finishToken(wh.num,s)},Du.readCodePoint=function(){var e;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds");}else e=this.readHexChar(4);return e},Du.readString=function(e){for(var t="",n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var r=this.input.charCodeAt(this.pos);if(r===e)break;92===r?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):(Ch(r,this.options.ecmaVersion>=10)&&this.raise(this.start,"Unterminated string constant"),++this.pos);}return t+=this.input.slice(n,this.pos++),this.finishToken(wh.string,t)};var Vu={};Du.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken();}catch(e){if(e!==Vu)throw e;this.readInvalidTemplateToken();}this.inTemplateElement=!1;},Du.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Vu;this.raise(e,t);},Du.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var n=this.input.charCodeAt(this.pos);if(96===n||36===n&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==wh.template&&this.type!==wh.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(wh.template,e)):36===n?(this.pos+=2,this.finishToken(wh.dollarBraceL)):(++this.pos,this.finishToken(wh.backQuote));if(92===n)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(Ch(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(n);}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos;}else++this.pos;}},Du.readInvalidTemplateToken=function(){for(;this.pos=48&&t<=55){var n=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],r=parseInt(n,8);return r>255&&(n=n.slice(0,-1),r=parseInt(n,8)),this.pos+=n.length-1,t=this.input.charCodeAt(this.pos),"0"===n&&56!==t&&57!==t||!this.strict&&!e||this.invalidStringToken(this.pos-1-n.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(r)}return Ch(t)?"":String.fromCharCode(t)}},Du.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return null===n&&this.invalidStringToken(t,"Bad character escape sequence"),n},Du.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos{Gu.lastIndex=e.pos;let t=Gu.exec(e.input),n=e.pos+t[0].length;return "."===e.input.slice(n,n+1)};var Ku=function(e){return class extends e{parseExprAtom(e){if(this.type!==qu._import||!Hu(this))return super.parseExprAtom(e);this.options.allowImportExportEverywhere||this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'");let t=this.startNode();return t.meta=this.parseIdent(!0),this.expect(qu.dot),t.property=this.parseIdent(!0),"meta"!==t.property.name&&this.raiseRecoverable(t.property.start,"The only valid meta property for import is import.meta"),this.containsEsc&&this.raiseRecoverable(t.property.start,'"meta" in import.meta must not contain escape sequences'),this.finishNode(t,"MetaProperty")}parseStatement(e,t,n){if(this.type!==qu._import||!Hu(this))return super.parseStatement(e,t,n);let r=this.startNode(),i=this.parseExpression();return this.parseExpressionStatement(r,i)}}};class Yu extends Qe{constructor(){super("undefined");}getLiteralValueAtPath(){}}class Xu extends vt{constructor(){super(),this.variables.undefined=new Yu;}findVariable(e){return this.variables[e]?this.variables[e]:this.variables[e]=new oo(e)}}const Qu=()=>({paths:Object.create(null),tracked:!1,unknownPath:null});class Ju{constructor(){this.entityPaths=new Map;}track(e,t){let n=this.entityPaths.get(e);n||(n=Qu(),this.entityPaths.set(e,n));let r,i=0;for(;i{switch(t){case"hash":const n=C();return n.update(t),n.update(":"),n.update(e.source),n.digest("hex").substr(0,8);case"name":return e.name.substr(0,e.name.length-pt(e.name).length);case"extname":return pt(e.name);case"ext":return pt(e.name).substr(1)}}),t)}function tc(e,t,n){return {emitAsset(r,i){"string"==typeof r&&Ao(r)||So(function(e){return {code:wo.INVALID_ASSET_NAME,message:`Plugin error creating asset, name "${e}" is not a plain (non relative or absolute URL) string name.`}}(r));const s={name:r,source:i,fileName:void 0};return t&&void 0!==i&&nc(s,t,n),Zu(s,e,r)},setAssetSource(r,i){const s=e.get(r);return s?void 0!==s.source?So(function(e){return {code:wo.ASSET_SOURCE_ALREADY_SET,message:`Plugin error - Unable to set the source for asset "${e.name}", source already set.`}}(s)):"string"==typeof i||i?(s.source=i,void(t&&nc(s,t,n))):So(function(e){return {code:wo.ASSET_SOURCE_MISSING,message:`Plugin error creating asset "${e.name}", setAssetSource call without a source.`}}(s)):So(function(e){return {code:wo.ASSET_NOT_FOUND,message:`Plugin error - Unable to set the source for unknown asset "${e}".`}}(r))},getAssetFileName(t){const n=e.get(t);return n?void 0===n.fileName?So(function(e){return {code:wo.ASSET_NOT_FINALISED,message:`Plugin error - Unable to get file name for asset "${e.name}". Ensure that the source is set and that generate is called first.`}}(n)):n.fileName:So(function(e){return {code:wo.ASSET_NOT_FOUND,message:`Plugin error - Unable to get file name for unknown asset "${e}".`}}(t))}}}function nc(e,t,n){const r=ec(e,t,n);e.fileName=r,t[r]={fileName:r,isAsset:!0,source:e.source};}var rc;!function(e){e[e.LOAD_AND_PARSE=0]="LOAD_AND_PARSE",e[e.ANALYSE=1]="ANALYSE",e[e.GENERATE=2]="GENERATE";}(rc||(rc={}));const ic=e=>(...t)=>{throw new Error(`Cannot use fs.${e} inside browser`)},sc=ic("lstatSync"),oc=ic("readdirSync"),ac=ic("readFileSync"),hc=ic("realpathSync"),uc=ic("writeFile");function cc(e,t){try{const n=sc(e);if(!t&&n.isSymbolicLink())return cc(hc(e),t);if(t&&n.isSymbolicLink()||n.isFile()){const t=ct(e);if(-1!==oc(lt(e)).indexOf(t))return e}}catch(e){}}function lc(e){return function(t,n){return "undefined"==typeof process&&So({code:"MISSING_PROCESS",message:"It looks like you're using Rollup in a non-Node.js environment. This means you must supply a plugin with custom resolveId and load functions",url:"https://rollupjs.org/guide/en#a-simple-example"}),void 0===n||at(t)||"."===t[0]?function(e,t){let n=cc(e,t);return n||((n=cc(e+".mjs",t))?n:n=cc(e+".js",t))}(ft(n?lt(n):ft(),t),e):null}}const pc=(e,t="URL")=>`new ${t}(${e}).href`,dc=e=>`(document.currentScript && document.currentScript.src || new URL('${e}', document.baseURI).href)`,fc=e=>(t,n)=>{const r=e(n);return null===t?`({ url: ${r} })`:"url"===t?r:"undefined"},mc={amd:fc(()=>pc("module.uri, document.baseURI")),cjs:fc(e=>`(typeof document === 'undefined' ? ${pc("'file:' + __filename","(require('u' + 'rl').URL)")} : ${dc(e)})`),iife:fc(e=>dc(e)),system:e=>null===e?"module.meta":`module.meta.${e}`,umd:fc(e=>`(typeof document === 'undefined' ? ${pc("'file:' + __filename","(require('u' + 'rl').URL)")} : ${dc(e)})`)},gc=e=>pc(`(document.currentScript && document.currentScript.src || document.baseURI) + '/../${e}'`),yc={amd:e=>pc(`module.uri + '/../${e}', document.baseURI`),cjs:e=>`(typeof document === 'undefined' ? ${pc(`'file:' + __dirname + '/${e}'`,"(require('u' + 'rl').URL)")} : ${gc(e)})`,es:e=>pc(`'${e}', import.meta.url`),iife:e=>gc(e),system:e=>pc(`'${e}', module.meta.url`),umd:e=>`(typeof document === 'undefined' ? ${pc(`'file:' + __dirname + '/${e}'`,"(require('u' + 'rl').URL)")} : ${gc(e)})`},xc={ongenerate:"generateBundle",onwrite:"generateBundle",transformBundle:"renderChunk",transformChunk:"renderChunk"};function vc(e,n,r,i){const s=[...n.plugins||[],(o=n.preserveSymlinks,{name:"Rollup Core",resolveId:lc(o),load:e=>ac(e,"utf-8"),resolveFileUrl:({relativePath:e,format:t})=>yc[t](e),resolveImportMeta(e,{chunkId:t,format:n}){const r=mc[n]&&mc[n](e,t);if(r)return r}})];var o;const{emitAsset:a,getAssetFileName:h,setAssetSource:u}=tc(e.assetsById),c={};let l=!1;const p=s.map((n,s)=>{let o,p=!0;if("string"!=typeof n.cacheKey&&("string"!=typeof n.name||c[n.name]?p=!1:c[n.name]=!0),!l&&(n.load||n.transform||n.transformBundle||n.transformChunk)&&(l=!0),r)if(p){const e=n.cacheKey||n.name;o=function(e){return {has(t){const n=e[t];return !!n&&(n[0]=0,!0)},get(t){const n=e[t];if(n)return n[0]=0,n[1]},set(t,n){e[t]=[0,n];},delete:t=>delete e[t]}}(r[e]||(r[e]=Object.create(null)));}else o=bc(n.name);else o=Ec;let d=!1;function f(e,t){return d||(m.warn({code:"PLUGIN_WATCHER_DEPRECATED",message:"this.watcher usage is deprecated in plugins. Use the watchChange plugin hook and this.addWatchFile() instead."}),d=!0),i.on(e,t)}const m={addWatchFile(t){e.phase>=rc.GENERATE&&this.error({code:wo.INVALID_ROLLUP_PHASE,message:"Cannot call addWatchFile after the build has finished."}),e.watchFiles[t]=!0;},cache:o,emitAsset:a,emitChunk(t,n){return e.phase>rc.LOAD_AND_PARSE&&this.error({code:wo.INVALID_ROLLUP_PHASE,message:"Cannot call emitChunk after module loading has finished."}),e.moduleLoader.addEntryModuleAndGetReferenceId({alias:n&&n.name||null,unresolvedId:t})},error:e=>("string"==typeof e&&(e={message:e}),e.code&&(e.pluginCode=e.code),e.code="PLUGIN_ERROR",e.plugin=n.name||`Plugin at position ${s+1}`,So(e)),isExternal:(t,n,r=!1)=>e.moduleLoader.isExternal(t,n,r),getAssetFileName:h,getChunkFileName:t=>e.moduleLoader.getChunkFileName(t),getModuleInfo(t){const n=e.moduleById.get(t);if(null==n)throw new Error(`Unable to find module ${t}`);return {hasModuleSideEffects:n.moduleSideEffects,id:n.id,importedIds:n instanceof mt?[]:n.sources.map(e=>n.resolvedIds[e].id),isEntry:n instanceof Fa&&n.isEntryPoint,isExternal:n instanceof mt}},meta:{rollupVersion:t},get moduleIds(){return e.moduleById.keys()},parse:e.contextParse,resolveId:(t,n)=>e.moduleLoader.resolveId(t,n).then(e=>e&&e.id),resolve:(t,n,r)=>e.moduleLoader.resolveId(t,n,r&&r.skipSelf?s:null),setAssetSource:u,warn(t){"string"==typeof t&&(t={message:t}),t.code&&(t.pluginCode=t.code),t.code="PLUGIN_WARNING",t.plugin=n.name||`Plugin at position ${s+1}`,e.warn(t);},watcher:i?Object.assign({},i,{addListener:f,on:f}):void 0};return m});function d(e,t,n,r=!1,i){const o=s[n];let a=p[n];const h=o[e];if(!h)return;const u=xc[e];if(u&&a.warn(Ac(e,u,o,n)),i&&(!(a=i(a,o))||a===p[n]))throw new Error("Internal Rollup error: hookContext must return a new context object.");try{if("function"!=typeof h){if(r)return h;So({code:"INVALID_PLUGIN_HOOK",message:`Error running plugin hook ${e} for ${o.name||`Plugin at position ${n+1}`}, expected a function hook.`});}return h.apply(a,t)}catch(t){"string"==typeof t&&(t={message:t}),"PLUGIN_ERROR"!==t.code&&(t.code&&(t.pluginCode=t.code),t.code="PLUGIN_ERROR"),t.plugin=o.name||`Plugin at position ${n+1}`,t.hook=e,So(t);}}function f(e,t,n,r=!1,i){const o=s[n];let a=p[n];const h=o[e];if(!h)return;const u=xc[e];if(u&&a.warn(Ac(e,u,o,n)),i&&(!(a=i(a,o))||a===p[n]))throw new Error("Internal Rollup error: hookContext must return a new context object.");return Promise.resolve().then(()=>{if("function"!=typeof h){if(r)return h;So({code:"INVALID_PLUGIN_HOOK",message:`Error running plugin hook ${e} for ${o.name||`Plugin at position ${n+1}`}, expected a function hook.`});}return h.apply(a,t)}).catch(t=>{"string"==typeof t&&(t={message:t}),"PLUGIN_ERROR"!==t.code&&(t.code&&(t.pluginCode=t.code),t.code="PLUGIN_ERROR"),t.plugin=o.name||`Plugin at position ${n+1}`,t.hook=e,So(t);})}return {emitAsset:a,getAssetFileName:h,hasLoadersOrTransforms:l,hookSeq(e,t,n){let r=Promise.resolve();for(let i=0;if(e,t,i,!1,n));return r},hookSeqSync(e,t,n){for(let r=0;rnull!=r?r:f(e,t,o,!1,n)));return i},hookFirstSync(e,t,n){for(let r=0;r{})},hookReduceArg0(e,[t,...n],r,i){let o=Promise.resolve(t);for(let t=0;t{const a=f(e,[o,...n],t,!1,i);return a?a.then(e=>r.call(p[t],o,e,s[t])):o});return o},hookReduceArg0Sync(e,[t,...n],r,i){for(let o=0;o{const a=f(e,n,t,!0,i);return a?a.then(e=>r.call(p[t],o,e,s[t])):o});return o}}}const Ec={has:()=>!1,get(){},set(){},delete:()=>!1};function _c(e){So(e?{code:"DUPLICATE_PLUGIN_NAME",message:`The plugin name ${e} is being used twice in the same build. Plugin names must be distinct or provide a cacheKey (please post an issue to the plugin if you are a plugin user).`}:{code:"ANONYMOUS_PLUGIN_CACHE",message:"A plugin is trying to use the Rollup cache but is not declaring a plugin name or cacheKey."});}const bc=e=>({has:()=>(_c(e),!1),get(){_c(e);},set(){_c(e);},delete:()=>(_c(e),!1)});function Ac(e,t,n,r){return {code:e.toUpperCase()+"_HOOK_DEPRECATED",message:`The ${e} hook used by plugin ${n.name||`at position ${r+1}`} is deprecated. The ${t} hook should be used instead.`}}function Sc(e,t){return ht(t)?ft(e,"..",t):t}function Ic(e){if(!0===e)return ()=>!0;if("function"==typeof e)return (t,...n)=>!t.startsWith("\0")&&e(t,...n)||!1;if(e){const t=new Set(Array.isArray(e)?e:e?[e]:[]);return e=>t.has(e)}return ()=>!1}function wc(e,t,n){if("boolean"==typeof e)return ()=>e;if("no-external"===e)return (e,t)=>!t;if("function"==typeof e)return (t,n)=>!!t.startsWith("\0")||!1!==e(t,n);if(Array.isArray(e)){const t=new Set(e);return e=>t.has(e)}var r,i;e&&n.warn((r="treeshake.moduleSideEffects",i='please use one of false, "no-external", a function or an array',{code:wo.INVALID_OPTION,message:`Invalid value for option "${r}" - ${i}.`}));const s=Ic(t);return (e,t)=>!(t&&s(e))}class Pc{constructor(e,t,n,r,i,s,o){this.entriesByReferenceId=new Map,this.entryModules=[],this.latestLoadModulesPromise=Promise.resolve(),this.manualChunkModules={},this.loadEntryModule=(({alias:e,unresolvedId:t},n)=>this.pluginDriver.hookFirst("resolveId",[t,void 0]).then(r=>{if(!1===r||r&&"object"==typeof r&&r.external)return So(function(e){return {code:wo.UNRESOLVED_ENTRY,message:`Entry module cannot be external (${bo(e)}).`}}(t));const i=r&&"object"==typeof r?r.id:r;return "string"==typeof i?this.fetchModule(i,void 0,!0,n).then(t=>{if(null!==e){if(null!==t.chunkAlias&&t.chunkAlias!==e)return So(Po(t.id,e,t.chunkAlias));t.chunkAlias=e;}return t}):So(function(e){return {code:wo.UNRESOLVED_ENTRY,message:`Could not resolve entry module (${bo(e)}).`}}(t))})),this.graph=e,this.modulesById=t,this.pluginDriver=n,this.isExternal=Ic(r),this.hasModuleSideEffects=wc(s,o,e),this.getManualChunk="function"==typeof i?i:()=>null;}addEntryModuleAndGetReferenceId(e){const t={module:null,name:e.unresolvedId},n=Zu(t,this.entriesByReferenceId,e.unresolvedId);return this.addEntryModules([e],!1).then(({newEntryModules:[e]})=>{t.module=e;}).catch(()=>{}),n}addEntryModules(e,t){const n=Promise.all(e.map(e=>this.loadEntryModule(e,!0))).then(e=>{for(const n of e){n.isUserDefinedEntryPoint=n.isUserDefinedEntryPoint||t,this.entryModules.find(e=>e.id===n.id)||this.entryModules.push(n);}return e});return this.awaitLoadModulesPromise(n).then(e=>({entryModules:this.entryModules,manualChunkModulesByAlias:this.manualChunkModules,newEntryModules:e}))}addManualChunks(e){const t=[];for(const n of Object.keys(e)){const r=e[n];for(const e of r)t.push({alias:null,unresolvedId:e,manualChunkAlias:n});}const n=Promise.all(t.map(e=>this.loadEntryModule(e,!1))).then(e=>{for(let n=0;nthis.normalizeResolveIdResult(n,t,e))}addToManualChunk(e,t){null!==t.manualChunkAlias&&t.manualChunkAlias!==e&&So(Po(t.id,e,t.manualChunkAlias)),t.manualChunkAlias=e,this.manualChunkModules[e]||(this.manualChunkModules[e]=[]),this.manualChunkModules[e].push(t);}awaitLoadModulesPromise(e){this.latestLoadModulesPromise=Promise.all([e,this.latestLoadModulesPromise]);const t=()=>{const e=this.latestLoadModulesPromise;return e.then(()=>{if(this.latestLoadModulesPromise!==e)return t()})};return t().then(()=>e)}fetchAllDependencies(e){const t=Promise.all(e.getDynamicImportExpressions().map((t,n)=>this.resolveDynamicImport(t,e.id).then(t=>{if(null===t)return;const r=e.dynamicImports[n];if("string"!=typeof t)return this.fetchResolvedDependency(bo(t.id),e.id,t).then(e=>{r.resolution=e;});r.resolution=t;})));return t.catch(()=>{}),Promise.all(e.sources.map(t=>this.resolveAndFetchDependency(e,t))).then(()=>t)}fetchModule(e,t,n,r){const i=this.modulesById.get(e);if(i){if(i instanceof mt)throw new Error(`Cannot fetch external module ${e}`);return i.isEntryPoint=i.isEntryPoint||r,Promise.resolve(i)}const s=new Fa(this.graph,e,n,r);this.modulesById.set(e,s);const o=this.getManualChunk(e);return "string"==typeof o&&this.addToManualChunk(o,s),Da("load modules",3),Promise.resolve(this.pluginDriver.hookFirst("load",[e])).catch(n=>{La("load modules",3);let r=`Could not load ${e}`;throw t&&(r+=` (imported by ${t})`),r+=`: ${n.message}`,n.message=r,n}).then(t=>(La("load modules",3),"string"==typeof t?{code:t}:t&&"object"==typeof t&&"string"==typeof t.code?t:So(function(e){return {code:wo.BAD_LOADER,message:`Error loading ${bo(e)}: plugin load hook should return a string, a { code, map } object, or nothing/null`}}(e)))).then(t=>{const n=this.graph.cachedModules.get(e);if(n&&!n.customTransformCache&&n.originalCode===t.code){if(n.transformAssets)for(const e of n.transformAssets)this.pluginDriver.emitAsset(e.name,e.source);return n}return "boolean"==typeof t.moduleSideEffects&&(s.moduleSideEffects=t.moduleSideEffects),function(e,t,n){const r=n.id,i=[],s="string"==typeof t.map?JSON.parse(t.map):t.map;s&&"string"==typeof s.mappings&&(s.mappings=O(s.mappings));const o=e.pluginDriver.emitAsset,a=t.code;let h,u,c,l,p=t.ast,d=!1,f=null;const m=t.code;let g;return e.pluginDriver.hookReduceArg0("transform",[m,r],function(t,s,o){if(!d&&c.used&&(d=!0),d){if(s&&"object"==typeof s&&Array.isArray(s.dependencies))for(const t of s.dependencies){const n=ft(lt(r),t);e.watchFiles[n]||(e.watchFiles[n]=!0);}}else if(u.length&&(n.transformAssets=u),s&&"object"==typeof s&&Array.isArray(s.dependencies)){l.warnedTransformDependencies||this.warn({code:"TRANSFORM_DEPENDENCIES_DEPRECATED",message:'Returning "dependencies" from plugin transform hook is deprecated for using this.addWatchFile() instead.'}),l.warnedTransformDependencies=!0,h||(h=[]);for(const e of s.dependencies)h.push(ft(lt(r),e));}if("string"==typeof s)s={ast:void 0,code:s,map:void 0};else{if(!s||"object"!=typeof s)return t;"string"==typeof s.map&&(s.map=JSON.parse(s.map)),"boolean"==typeof s.moduleSideEffects&&(f=s.moduleSideEffects);}return s.map&&"string"==typeof s.map.mappings&&(s.map.mappings=O(s.map.mappings)),null!==s.map&&i.push(s.map||{missing:!0,plugin:o.name}),p=s.ast,s.code},(t,n)=>{let i;return (l=n).cacheKey?d=!0:c=function(e){const t={used:!1,cache:void 0};return t.cache={has:n=>(t.used=!0,e.has(n)),get:n=>(t.used=!0,e.get(n)),set:(n,r)=>(t.used=!0,e.set(n,r)),delete:n=>(t.used=!0,e.delete(n))},t}(t.cache),({assets:u,emitAsset:i}=function(e,t){const n=[];return {assets:n,emitAsset:(r,i)=>{const s=t(r,i),o=e.get(s);return n.push({fileName:void 0,name:o.name,source:o.source}),s}}}(e.assetsById,o)),Object.assign({},t,{cache:c?c.cache:t.cache,warn(e,n){"string"==typeof e&&(e={message:e}),n&&Io(e,n,m,r),e.id=r,e.hook="transform",t.warn(e);},error:(e,n)=>("string"==typeof e&&(e={message:e}),n&&Io(e,n,m,r),e.id=r,e.hook="transform",t.error(e)),emitAsset:i,addWatchFile(e){h||(h=[]),h.push(e),t.addWatchFile(e);},setAssetSource(e,n){if(t.setAssetSource(e,n),!d&&!g)try{this.error({code:"INVALID_SETASSETSOURCE",message:"setAssetSource cannot be called in transform for caching reasons. Use emitAsset with a source, or call setAssetSource in another hook."});}catch(e){g=e;}}})}).catch(e=>{"string"==typeof e&&(e={message:e}),"PLUGIN_ERROR"!==e.code&&(e.code&&(e.pluginCode=e.code),e.code="PLUGIN_ERROR"),e.id=r,So(e);}).then(e=>{if(!d&&g)throw g;return {ast:p,code:e,customTransformCache:d,moduleSideEffects:f,originalCode:a,originalSourcemap:s,sourcemapChain:i,transformDependencies:h}})}(this.graph,t,s)}).then(t=>(s.setSource(t),this.modulesById.set(e,s),this.fetchAllDependencies(s).then(()=>{for(const e in s.exports)"default"!==e&&(s.exportsAll[e]=s.id);return s.exportAllSources.forEach(e=>{const t=s.resolvedIds[e].id,n=this.modulesById.get(t);if(!(n instanceof mt))for(const e in n.exportsAll)e in s.exportsAll?this.graph.warn(ko(e,s,n)):s.exportsAll[e]=n.exportsAll[e];}),s})))}fetchResolvedDependency(e,t,n){if(n.external){this.modulesById.has(n.id)||this.modulesById.set(n.id,new mt(this.graph,n.id,n.moduleSideEffects));const r=this.modulesById.get(n.id);return r instanceof mt?Promise.resolve(r):So(function(e,t){return {code:wo.INVALID_EXTERNAL_ID,message:`'${e}' is imported as an external by ${bo(t)}, but is already an existing non-external module id.`}}(e,t))}return this.fetchModule(n.id,t,n.moduleSideEffects,!1)}handleMissingImports(e,t,n){return null===e?(ht(t)&&So(function(e,t){return {code:wo.UNRESOLVED_IMPORT,message:`Could not resolve '${e}' from ${bo(t)}`}}(t,n)),this.graph.warn(function(e,t){return {code:wo.UNRESOLVED_IMPORT,importer:bo(t),message:`'${e}' is imported by ${bo(t)}, but could not be resolved – treating it as an external dependency`,source:e,url:"https://rollupjs.org/guide/en#warning-treating-module-as-external-dependency"}}(t,n)),{id:t,external:!0,moduleSideEffects:!0}):e}normalizeResolveIdResult(e,t,n){let r="",i=!1,s=null;if(e)"object"==typeof e?(r=e.id,e.external&&(i=!0),"boolean"==typeof e.moduleSideEffects&&(s=e.moduleSideEffects)):(r=e,this.isExternal(r,t,!0)&&(i=!0)),i&&(r=Sc(t,r));else{if(r=Sc(t,n),!1!==e&&!this.isExternal(r,t,!0))return null;i=!0;}return {external:i,id:r,moduleSideEffects:"boolean"==typeof s?s:this.hasModuleSideEffects(r,i)}}resolveAndFetchDependency(e,t){return Promise.resolve(e.resolvedIds[t]||this.resolveId(t,e.id).then(n=>this.handleMissingImports(n,t,e.id))).then(n=>(e.resolvedIds[t]=n,this.fetchResolvedDependency(t,e.id,n)))}resolveDynamicImport(e,t){return this.pluginDriver.hookFirst("resolveDynamicImport",[e,t]).then(n=>"string"!=typeof e?"string"==typeof n?n:n?Object.assign({external:!1,moduleSideEffects:!0},n):null:null==n?this.resolveId(e,t).then(n=>this.handleMissingImports(n,e,t)):this.handleMissingImports(this.normalizeResolveIdResult(n,t,e),e,t))}}const kc=97,Cc=48;function Nc(e){return e<10?String.fromCharCode(Cc+e):String.fromCharCode(kc+(e-10))}function $c(e){let t="";for(let n=0;n>4),t+=Nc(15&r);}return t}function Rc(e){const t=new Uint8Array(e);for(let e=0;e({alias:null,unresolvedId:e})):Object.keys(e).map(t=>({alias:t,unresolvedId:e[t]}))}class Mc{constructor(e,t){if(this.assetsById=new Map,this.curChunkIndex=0,this.moduleById=new Map,this.needsTreeshakingPass=!1,this.phase=rc.LOAD_AND_PARSE,this.watchFiles=Object.create(null),this.externalModules=[],this.modules=[],this.curChunkIndex=0,this.deoptimizationTracker=new Ju,this.cachedModules=new Map,e.cache&&e.cache.modules)for(const t of e.cache.modules)this.cachedModules.set(t.id,t);if(!1!==e.cache){this.pluginCache=e.cache&&e.cache.plugins||Object.create(null);for(const e in this.pluginCache){const t=this.pluginCache[e];for(const e of Object.keys(t))t[e][0]++;}}if(this.preserveModules=e.preserveModules,this.cacheExpiry=e.experimentalCacheExpiry,this.treeshake=!1!==e.treeshake,this.treeshake&&(this.treeshakingOptions=e.treeshake?{annotations:!1!==e.treeshake.annotations,moduleSideEffects:e.treeshake.moduleSideEffects,propertyReadSideEffects:!1!==e.treeshake.propertyReadSideEffects,pureExternalModules:e.treeshake.pureExternalModules}:{annotations:!0,moduleSideEffects:!0,propertyReadSideEffects:!0,pureExternalModules:!1}),this.contextParse=((e,t={})=>this.acornParser.parse(e,Object.assign({},ja,t,this.acornOptions))),this.pluginDriver=vc(this,e,this.pluginCache,t),t){const e=e=>this.pluginDriver.hookSeqSync("watchChange",[e]);t.on("change",e),t.once("restart",()=>{t.removeListener("change",e);});}this.shimMissingExports=e.shimMissingExports,this.scope=new Xu,this.context=String(e.context);const n=e.moduleContext;if("function"==typeof n)this.getModuleContext=(e=>n(e)||this.context);else if("object"==typeof n){const e=new Map;for(const t in n)e.set(ft(t),n[t]);this.getModuleContext=(t=>e.get(t)||this.context);}else this.getModuleContext=(()=>this.context);this.onwarn=e.onwarn||function(){const e=Object.create(null);return t=>{const n=t.toString();n in e||(console.error(n),e[n]=!0);}}(),this.acornOptions=e.acorn||{};const r=[];r.push(Fu),r.push(Ku),r.push(Wu),e.experimentalTopLevelAwait&&(this.acornOptions.allowAwaitOutsideFunction=!0);const i=e.acornInjectPlugins;r.push(...Array.isArray(i)?i:i?[i]:[]),this.acornParser=Kh.extend(...r),this.moduleLoader=new Pc(this,this.moduleById,this.pluginDriver,e.external,"function"==typeof e.manualChunks&&e.manualChunks,this.treeshake?this.treeshakingOptions.moduleSideEffects:null,!!this.treeshake&&this.treeshakingOptions.pureExternalModules);}build(e,t,n){return Da("parse modules",2),Promise.all([this.moduleLoader.addEntryModules(Oc(e),!0),t&&"object"==typeof t&&this.moduleLoader.addManualChunks(t)]).then(([{entryModules:e,manualChunkModulesByAlias:t}])=>{if(0===e.length)throw new Error("You must supply options.input to rollup");for(const e of this.moduleById.values())e instanceof Fa?(this.modules.push(e),this.watchFiles[e.id]=!0):this.externalModules.push(e);if(La("parse modules",2),this.phase=rc.ANALYSE,Da("analyse dependency graph",2),this.link(e),La("analyse dependency graph",2),Da("mark included statements",2),n&&e.length>1)throw new Error("Internal Error: can only inline dynamic imports for single-file builds.");for(const t of e)t.includeAllExports();this.includeMarked(this.modules);for(const e of this.externalModules)e.warnUnusedImports();La("mark included statements",2),Da("generate chunks",2),this.preserveModules||n||function(e,t){let n,r,i;const s=new Set,o=[],a=e=>{n.manualChunkAlias?(e.manualChunkAlias=n.manualChunkAlias,e.entryPointsHash=r):function(e,t){for(let n=0;n0&&!t.manualChunkAlias&&o.push(t);};if(t)for(const e of Object.keys(t))for(n of(r=Rc(10),t[e]))i=new Set(n.id),a(n);for(n of e)s.add(n.id),r=Rc(10),i=new Set(n.id),n.manualChunkAlias||a(n);for(n of o)s.has(n.id)||(s.add(n.id),r=Rc(10),i=new Set(n.id),a(n));}(e,t);let r=[];if(this.preserveModules)for(const e of this.modules){const t=new oh(this,[e]);!e.isEntryPoint&&t.isEmpty||(t.entryModules=[e]),r.push(t);}else{const e={};for(const t of this.modules){const n=$c(t.entryPointsHash),r=e[n];r?r.push(t):e[n]=[t];}for(const t in e){const n=e[t];Ja(n);const i=new oh(this,n);r.push(i);}}for(const e of r)e.link();r=r.filter(sh);for(const e of r)(this.preserveModules||e.entryModules.length>0)&&e.generateEntryExportsOrMarkAsTainted();const i=[];if(!this.preserveModules)for(const e of r)for(const t of e.entryModules)if(e.facadeModule!==t){const e=new oh(this,[]);e.turnIntoFacade(t),i.push(e);}return La("generate chunks",2),this.phase=rc.GENERATE,r.concat(i)})}finaliseAssets(e){const t=Object.create(null);return this.assetsById.forEach(n=>{void 0!==n.source&&nc(n,t,e);}),t}getCache(){for(const e in this.pluginCache){const t=this.pluginCache[e];let n=!0;for(const e of Object.keys(t))t[e][0]>=this.cacheExpiry?delete t[e]:n=!1;n&&delete this.pluginCache[e];}return {modules:this.modules.map(e=>e.toJSON()),plugins:this.pluginCache}}includeMarked(e){if(this.treeshake){let t=1;do{Da(`treeshaking pass ${t}`,3),this.needsTreeshakingPass=!1;for(const t of e)t.isExecuted&&t.include();La(`treeshaking pass ${t++}`,3);}while(this.needsTreeshakingPass)}else for(const t of e)t.includeAllInBundle();}warn(e){e.toString=(()=>{let t="";return e.plugin&&(t+=`(${e.plugin} plugin) `),e.loc&&(t+=`${bo(e.loc.file)} (${e.loc.line}:${e.loc.column}) `),t+=e.message}),this.onwarn(e);}link(e){for(const e of this.modules)e.linkDependencies();const{orderedModules:t,cyclePaths:n}=function(e){let t=0;const n=[],r={},i=[],s=[],o={},a=e=>{if(!r[e.id]){if(e instanceof mt)return e.execIndex=t++,void(r[e.id]=!0);for(const t of e.dependencies)t.id in o?r[t.id]||n.push(Za(t.id,e.id,o)):(o[t.id]=e.id,a(t));for(const{resolution:t}of e.dynamicImports)t instanceof Fa&&-1===s.indexOf(t)&&s.push(t);e.execIndex=t++,r[e.id]=!0,i.push(e);}};for(const t of e)o[t.id]||(o[t.id]=null,a(t));for(const e of s)o[e.id]||(o[e.id]=null,a(e));return {orderedModules:i,cyclePaths:n}}(e);for(const e of n)this.warn({code:"CIRCULAR_DEPENDENCY",importer:e[0],message:`Circular dependency: ${e.join(" -> ")}`});this.modules=t;for(const e of this.modules)e.bindReferences();this.warnForMissingExports();}warnForMissingExports(){for(const e of this.modules)for(const t of Object.keys(e.importDescriptions)){const n=e.importDescriptions[t];"*"===n.name||n.module.getVariableForExportName(n.name)||e.warn({code:"NON_EXISTENT_EXPORT",message:`Non-existent export '${n.name}' is imported from ${bo(n.module.id)}`,name:n.name,source:n.module.id},n.start);}}}function Tc(e){switch(typeof e){case"function":return e();case"string":return e;default:return ""}}const Dc=(e,t)=>t?`${e}\n${t}`:e,Lc=(e,t)=>t?`${e}\n\n${t}`:e;function Vc(e,t){So({code:"INVALID_EXPORT_OPTION",message:`'${e}' was specified for output.exports, but entry module has following exports: ${t.join(", ")}`});}function Bc(e,{exports:t,name:n,format:r}){const i=e.getExportNames();return "default"===t?1===i.length&&"default"===i[0]||Vc("default",i):"none"===t&&i.length&&Vc("none",i),t&&"auto"!==t||(0===i.length?t="none":1===i.length&&"default"===i[0]?t="default":(null!==e.facadeModule&&e.facadeModule.isEntryPoint&&"es"!==r&&-1!==i.indexOf("default")&&e.graph.warn({code:"MIXED_EXPORTS",message:`Using named and default exports together. Consumers of your bundle will have to use ${n||"bundle"}['default'] to access the default export, which may not be what you want. Use \`output.exports: 'named'\` to disable this warning`,url:"https://rollupjs.org/guide/en#output-exports"}),t="named")),/(?:default|named|none)/.test(t)||So({code:"INVALID_EXPORT_OPTION",message:"output.exports must be 'default', 'named', 'none', 'auto', or left unspecified (defaults to 'auto')",url:"https://rollupjs.org/guide/en#output-exports"}),t}const zc=(e,t)=>(n,r)=>void 0!==t[n]?t[n]:void 0!==e[n]?e[n]:r,jc=e=>e&&"object"!=typeof e?{}:e,Wc=(e,t,n)=>{const r=jc(t[n]),i=jc(e[n]);return void 0!==r?r&&i?Object.assign({},i,r):r:i},Uc=(e,t,n=(e=>{"string"==typeof e?console.warn(e):console.warn(e.message);}))=>t.silent?()=>{}:e.onwarn?t=>e.onwarn(t,n):n,Fc=(e,t)=>{const n=e.external;return "function"==typeof n?(e,...r)=>n(e,...r)||-1!==t.external.indexOf(e):("string"==typeof e.external?[n]:Array.isArray(n)?n:[]).concat(t.external)},qc={c:"config",d:"dir",e:"external",f:"format",g:"globals",h:"help",i:"input",m:"sourcemap",n:"name",o:"file",v:"version",w:"watch"};function Gc({config:e={},command:t={},defaultOnWarnHandler:n}){const r=function(e){const t=e.external&&"string"==typeof e.external?e.external.split(","):[];return Object.assign({},e,{external:t,globals:"string"==typeof e.globals?e.globals.split(",").reduce((e,n)=>{const[r,i]=n.split(":");return e[r]=i,-1===t.indexOf(r)&&t.push(r),e},Object.create(null)):void 0})}(t),i=function(e,t={external:[],globals:void 0},n){const r=zc(e,t),i={acorn:e.acorn,acornInjectPlugins:e.acornInjectPlugins,cache:r("cache"),chunkGroupingSize:r("chunkGroupingSize",5e3),context:e.context,experimentalCacheExpiry:r("experimentalCacheExpiry",10),experimentalOptimizeChunks:r("experimentalOptimizeChunks"),experimentalTopLevelAwait:r("experimentalTopLevelAwait"),external:Fc(e,t),inlineDynamicImports:r("inlineDynamicImports",!1),input:r("input",[]),manualChunks:r("manualChunks"),moduleContext:e.moduleContext,onwarn:Uc(e,t,n),perf:r("perf",!1),plugins:e.plugins,preserveModules:r("preserveModules"),preserveSymlinks:r("preserveSymlinks"),shimMissingExports:r("shimMissingExports"),treeshake:Wc(e,t,"treeshake"),watch:e.watch};i.cache&&i.cache.cache&&(i.cache=i.cache.cache);return i}(e,r,n);r.output&&Object.assign(r,r.output);const s=e.output,o=Array.isArray(s)?s:s?[s]:[];0===o.length&&o.push({});const a=o.map(e=>(function(e,t={}){const n=zc(e,t);let r=n("format");switch(r){case"esm":case"module":r="es";break;case"commonjs":r="cjs";}return {amd:Object.assign({},e.amd,t.amd),assetFileNames:n("assetFileNames"),banner:n("banner"),chunkFileNames:n("chunkFileNames"),compact:n("compact",!1),dir:n("dir"),dynamicImportFunction:n("dynamicImportFunction"),entryFileNames:n("entryFileNames"),esModule:n("esModule",!0),exports:n("exports"),extend:n("extend"),file:n("file"),footer:n("footer"),format:"esm"===r?"es":r,freeze:n("freeze",!0),globals:n("globals"),indent:n("indent",!0),interop:n("interop",!0),intro:n("intro"),name:n("name"),namespaceToStringTag:n("namespaceToStringTag",!1),noConflict:n("noConflict"),outro:n("outro"),paths:n("paths"),preferConst:n("preferConst"),sourcemap:n("sourcemap"),sourcemapExcludeSources:n("sourcemapExcludeSources"),sourcemapFile:n("sourcemapFile"),sourcemapPathTransform:n("sourcemapPathTransform"),strict:n("strict",!0)}})(e,r)),h=[],u=Object.keys(i);Hc(h,Object.keys(e),u,"input option",/^output$/);const c=Object.keys(a[0]);Hc(h,a.reduce((e,t)=>e.concat(Object.keys(t)),[]),c,"output option");const l=c.filter(e=>"sourcemapPathTransform"!==e);return Hc(h,Object.keys(r),u.concat(l,Object.keys(qc),"config","environment","silent"),"CLI flag",/^_|output|(config.*)$/),{inputOptions:i,optionError:h.length>0?h.join("\n"):null,outputOptions:a}}function Hc(e,t,n,r,i=/$./){const s=t.filter(e=>-1===n.indexOf(e)&&!i.test(e));s.length>0&&e.push(`Unknown ${r}: ${s.join(", ")}. Allowed options: ${n.sort().join(", ")}`);}const Kc={get(){throw new Error("bundle.generate(...) now returns a Promise instead of a { code, map } object")}};function Yc(e,n){return n.options&&n.options.call({meta:{rollupVersion:t}},e)||e}let Xc;function Qc(e){try{const t=function(e){if(!e)throw new Error("You must supply an options object to rollup");let{inputOptions:t,optionError:n}=Gc({config:e});n&&t.onwarn({message:n,code:"UNKNOWN_OPTION"});const r=t.plugins;return t.plugins=Array.isArray(r)?r.filter(Boolean):r?[r]:[],(t=t.plugins.reduce(Yc,t)).inlineDynamicImports?(t.preserveModules&&So({code:"INVALID_OPTION",message:'"preserveModules" does not support the "inlineDynamicImports" option.'}),t.manualChunks&&So({code:"INVALID_OPTION",message:'"manualChunks" option is not supported for "inlineDynamicImports".'}),t.experimentalOptimizeChunks&&So({code:"INVALID_OPTION",message:'"experimentalOptimizeChunks" option is not supported for "inlineDynamicImports".'}),(t.input instanceof Array&&t.input.length>1||"object"==typeof t.input&&Object.keys(t.input).length>1)&&So({code:"INVALID_OPTION",message:'Multiple inputs are not supported for "inlineDynamicImports".'})):t.preserveModules&&(t.manualChunks&&So({code:"INVALID_OPTION",message:'"preserveModules" does not support the "manualChunks" option.'}),t.experimentalOptimizeChunks&&So({code:"INVALID_OPTION",message:'"preserveModules" does not support the "experimentalOptimizeChunks" option.'})),t}(e);za(t);const n=new Mc(t,Xc);Xc=void 0;const r=!1!==e.cache;return delete t.cache,delete e.cache,Da("BUILD",1),n.pluginDriver.hookParallel("buildStart",[t]).then(()=>n.build(t.input,t.manualChunks,t.inlineDynamicImports)).then(e=>n.pluginDriver.hookParallel("buildEnd",[]).then(()=>e),e=>n.pluginDriver.hookParallel("buildEnd",[e]).then(()=>{throw e})).then(e=>{La("BUILD",1);let i=!1;function s(r){return function(e,t,n,r){if(!t)throw new Error("You must supply an options object");const i=Gc({config:{output:Object.assign({},t,t.output,e.output)}});if(i.optionError)throw new Error(i.optionError);const s=i.outputOptions[0],o=r.hookReduceArg0Sync("outputOptions",[s],(e,t)=>t||e);a=o,"es6"===a.format&&So({message:'The "es6" output format is deprecated – use "esm" instead',url:"https://rollupjs.org/guide/en#output-format"}),["amd","cjs","system","es","iife","umd"].indexOf(a.format)<0&&So({message:'You must specify "output.format", which can be one of "amd", "cjs", "system", "esm", "iife" or "umd".',url:"https://rollupjs.org/guide/en#output-format"}),"string"==typeof o.file&&("string"==typeof o.dir&&So({code:"INVALID_OPTION",message:'You must set either "output.file" for a single-file build or "output.dir" when generating multiple chunks.'}),e.preserveModules&&So({code:"INVALID_OPTION",message:'You must set "output.dir" instead of "output.file" when using the "preserveModules" option.'}),"object"!=typeof e.input||Array.isArray(e.input)||So({code:"INVALID_OPTION",message:'You must set "output.dir" instead of "output.file" when providing named inputs.'}));var a;n&&("umd"!==o.format&&"iife"!==o.format||So({code:"INVALID_OPTION",message:"UMD and IIFE output formats are not supported for code-splitting builds."}),"string"==typeof o.file&&So({code:"INVALID_OPTION",message:'You must set "output.dir" instead of "output.file" when generating multiple chunks.'}));return o}(t,r,e.length>1,n.pluginDriver)}function o(r,s){Da("GENERATE",1);const o=r.assetFileNames||"assets/[name]-[hash][extname]",a=n.finaliseAssets(o),h=function(e){if(0===e.length)return "/";if(1===e.length)return lt(e[0]);const t=e.slice(1).reduce((e,t)=>{const n=t.split(/\/+|\\+/);let r;for(r=0;e[r]===n[r]&&r1?t.join("/"):"/"}(function(e){const t=[];for(const n of e)for(const e of n.entryModules)at(e.id)&&t.push(e.id);return t}(e));return n.pluginDriver.hookParallel("renderStart",[]).then(()=>(function(e,t){const n=e.pluginDriver;return Promise.all([n.hookReduceValue("banner",Tc(t.banner),[],Dc),n.hookReduceValue("footer",Tc(t.footer),[],Dc),n.hookReduceValue("intro",Tc(t.intro),[],Lc),n.hookReduceValue("outro",Tc(t.outro),[],Lc)]).then(([e,t,n,r])=>(n&&(n+="\n\n"),r&&(r=`\n\n${r}`),e.length&&(e+="\n"),t.length&&(t="\n"+t),{intro:n,outro:r,banner:e,footer:t})).catch(e=>{So({code:"ADDON_ERROR",message:`Could not retrieve ${e.hook}. Check configuration of ${e.plugin}.\n\tError Message: ${e.message}`});})})(n,r)).then(s=>{for(const n of e)t.preserveModules||n.generateInternalExports(r),n.facadeModule&&n.facadeModule.isEntryPoint&&(n.exportMode=Bc(n,r));for(const t of e)t.preRender(r,h);!i&&t.experimentalOptimizeChunks&&(!function(e,t,n,r){for(let i=0;i{e instanceof oh&&o.push(e);}),o.length<2)continue;let a=1,h=!0,u=void 0,c=o[0],l=o[1];const p=e=>!(null!==e.facadeModule||null!==e.manualChunkAlias||!l||null!==l.facadeModule||e.getRenderedSourceLength()>n);do{if(h){p(c)&&(h=!1);continue}let s=n-u.getRenderedSourceLength()-c.getRenderedSourceLength();if(s<=0){p(c)||(h=!0);continue}const d=new Set;c.visitStaticDependenciesUntilCondition(e=>d.add(e));const f=new Set([c,u]);if(u.visitStaticDependenciesUntilCondition(e=>e!==c&&e!==u&&!d.has(e)&&(e instanceof mt||(s-=e.getRenderedSourceLength())<=0||void f.add(e)))){p(c)||(h=!0);continue}if(c.visitStaticDependenciesUntilCondition(e=>!f.has(e)&&(e instanceof mt||(s-=e.getRenderedSourceLength())<=0||void 0))){p(c)||(h=!0);continue}const m=e.indexOf(c);m<=i&&i--,e.splice(m,1),u.merge(c,e,t,r),o.splice(--a,1),c=u,l&&!p(l)&&(h=!0);}while(u=c,c=l,l=o[++a],c)}}(e,r,t.chunkGroupingSize,h),i=!0),function(e,t,n,r,i){const s={},[o,a]=e.reduce(([e,t],n)=>((n.facadeModule&&n.facadeModule.isUserDefinedEntryPoint?e:t).push(n),[e,t]),[[],[]]),h=o.concat(a);for(let e=0;e0,isEntry:null!==r&&r.isEntryPoint,map:void 0,modules:n.renderedModules,get name(){return n.getChunkName()}};}return Promise.all(e.map(e=>{const t=a[e.id];return e.render(r,s,t).then(e=>(t.code=e.code,t.map=e.map,n.pluginDriver.hookParallel("ongenerate",[Object.assign({bundle:t},r),t])))})).then(()=>{})}).catch(e=>n.pluginDriver.hookParallel("renderError",[e]).then(()=>{throw e})).then(()=>{const e=new Map(n.assetsById),t=tc(e,a,o);return n.pluginDriver.hookSeq("generateBundle",[r,a,s],e=>Object.assign({},e,t)).then(()=>{e.forEach(e=>{void 0===e.fileName&&nc(e,a,o);});})}).then(()=>(La("GENERATE",1),a))}const a={cache:r?n.getCache():void 0,generate:e=>{const t=o(s(e),!1).then(e=>el(e));return Object.defineProperty(t,"code",Kc),Object.defineProperty(t,"map",Kc),t},watchFiles:Object.keys(n.watchFiles),write:e=>{const r=s(e);return r.dir||r.file||So({code:"MISSING_OPTION",message:'You must specify "output.file" or "output.dir" for the build.'}),o(r,!0).then(e=>{let i=0;for(const t of Object.keys(e)){if(!e[t].isAsset&&++i>1)break}return i>1&&(r.sourcemapFile&&So({code:"INVALID_OPTION",message:'"output.sourcemapFile" is only supported for single-file builds.'}),"string"==typeof r.file&&So({code:"INVALID_OPTION",message:'When building multiple chunks, the "output.dir" option must be used, not "output.file".'+("string"!=typeof t.input||!0===t.inlineDynamicImports?"":' To inline dynamic imports, set the "inlineDynamicImports" option.')})),Promise.all(Object.keys(e).map(t=>(function(e,t,n,r){const i=ft(r.dir||lt(r.file),n.fileName);let s,o;if(tl(n))o=n.source;else if(o=n.code,r.sourcemap&&n.map){let e;"inline"===r.sourcemap?e=n.map.toUrl():(e=`${ct(n.fileName)}.map`,s=uc(`${i}.map`,n.map.toString())),o+=`//# ${Sa}=${e}\n`;}return uc(i,o).then(()=>s).then(()=>!tl(n)&&e.pluginDriver.hookSeq("onwrite",[Object.assign({bundle:t},r),n])).then(()=>{})})(n,a,e[t],r))).then(()=>n.pluginDriver.hookParallel("writeBundle",[e])).then(()=>el(e))})}};return !0===t.perf&&(a.getTimings=Ta),a})}catch(e){return Promise.reject(e)}}var Jc;function Zc(e){return e.isAsset?Jc.ASSET:e.isEntry?Jc.ENTRY_CHUNK:Jc.SECONDARY_CHUNK}function el(e){return {output:Object.keys(e).map(t=>e[t]).sort((e,t)=>{const n=Zc(e),r=Zc(t);return n===r?0:n0xffff code points that are a valid part of identifiers. The + // offset starts at 0x10000, and each pair of numbers represents an + // offset to the next range, and then a size of the range. They were + // generated by bin/generate-identifier-regex.js + + // eslint-disable-next-line comma-spacing + var astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,477,28,11,0,9,21,190,52,76,44,33,24,27,35,30,0,12,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,54,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,86,26,230,43,117,63,32,0,257,0,11,39,8,0,22,0,12,39,3,3,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,270,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,68,12,0,67,12,65,1,31,6129,15,754,9486,286,82,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,60,67,1213,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,15,7472,3104,541]; + + // eslint-disable-next-line comma-spacing + var astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,525,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,4,9,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,280,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1016,45,17,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,2214,6,110,6,6,9,792487,239]; + + // This has a complexity linear to the value of the code. The + // assumption is that looking up astral identifier characters is + // rare. + function isInAstralSet(code, set) { + var pos = 0x10000; + for (var i = 0; i < set.length; i += 2) { + pos += set[i]; + if (pos > code) { return false } + pos += set[i + 1]; + if (pos >= code) { return true } + } + } + + // Test whether a given character code starts an identifier. + + function isIdentifierStart(code, astral) { + if (code < 65) { return code === 36 } + if (code < 91) { return true } + if (code < 97) { return code === 95 } + if (code < 123) { return true } + if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)) } + if (astral === false) { return false } + return isInAstralSet(code, astralIdentifierStartCodes) + } + + // Test whether a given character is part of an identifier. + + function isIdentifierChar(code, astral) { + if (code < 48) { return code === 36 } + if (code < 58) { return true } + if (code < 65) { return false } + if (code < 91) { return true } + if (code < 97) { return code === 95 } + if (code < 123) { return true } + if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) } + if (astral === false) { return false } + return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes) + } + + // ## Token types + + // The assignment of fine-grained, information-carrying type objects + // allows the tokenizer to store the information it has about a + // token in a way that is very cheap for the parser to look up. + + // All token type variables start with an underscore, to make them + // easy to recognize. + + // The `beforeExpr` property is used to disambiguate between regular + // expressions and divisions. It is set on all token types that can + // be followed by an expression (thus, a slash after them would be a + // regular expression). + // + // The `startsExpr` property is used to check if the token ends a + // `yield` expression. It is set on all token types that either can + // directly start an expression (like a quotation mark) or can + // continue an expression (like the body of a string). + // + // `isLoop` marks a keyword as starting a loop, which is important + // to know when parsing a label, in order to allow or disallow + // continue jumps to that label. + + var TokenType = function TokenType(label, conf) { + if ( conf === void 0 ) conf = {}; + + this.label = label; + this.keyword = conf.keyword; + this.beforeExpr = !!conf.beforeExpr; + this.startsExpr = !!conf.startsExpr; + this.isLoop = !!conf.isLoop; + this.isAssign = !!conf.isAssign; + this.prefix = !!conf.prefix; + this.postfix = !!conf.postfix; + this.binop = conf.binop || null; + this.updateContext = null; + }; + + function binop(name, prec) { + return new TokenType(name, {beforeExpr: true, binop: prec}) + } + var beforeExpr = {beforeExpr: true}; + var startsExpr = {startsExpr: true}; + + // Map keyword names to token types. + + var keywords$1 = {}; + + // Succinct definitions of keyword token types + function kw(name, options) { + if ( options === void 0 ) options = {}; + + options.keyword = name; + return keywords$1[name] = new TokenType(name, options) + } + + var types = { + num: new TokenType("num", startsExpr), + regexp: new TokenType("regexp", startsExpr), + string: new TokenType("string", startsExpr), + name: new TokenType("name", startsExpr), + eof: new TokenType("eof"), + + // Punctuation token types. + bracketL: new TokenType("[", {beforeExpr: true, startsExpr: true}), + bracketR: new TokenType("]"), + braceL: new TokenType("{", {beforeExpr: true, startsExpr: true}), + braceR: new TokenType("}"), + parenL: new TokenType("(", {beforeExpr: true, startsExpr: true}), + parenR: new TokenType(")"), + comma: new TokenType(",", beforeExpr), + semi: new TokenType(";", beforeExpr), + colon: new TokenType(":", beforeExpr), + dot: new TokenType("."), + question: new TokenType("?", beforeExpr), + arrow: new TokenType("=>", beforeExpr), + template: new TokenType("template"), + invalidTemplate: new TokenType("invalidTemplate"), + ellipsis: new TokenType("...", beforeExpr), + backQuote: new TokenType("`", startsExpr), + dollarBraceL: new TokenType("${", {beforeExpr: true, startsExpr: true}), + + // Operators. These carry several kinds of properties to help the + // parser use them properly (the presence of these properties is + // what categorizes them as operators). + // + // `binop`, when present, specifies that this operator is a binary + // operator, and will refer to its precedence. + // + // `prefix` and `postfix` mark the operator as a prefix or postfix + // unary operator. + // + // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as + // binary operators with a very low precedence, that should result + // in AssignmentExpression nodes. + + eq: new TokenType("=", {beforeExpr: true, isAssign: true}), + assign: new TokenType("_=", {beforeExpr: true, isAssign: true}), + incDec: new TokenType("++/--", {prefix: true, postfix: true, startsExpr: true}), + prefix: new TokenType("!/~", {beforeExpr: true, prefix: true, startsExpr: true}), + logicalOR: binop("||", 1), + logicalAND: binop("&&", 2), + bitwiseOR: binop("|", 3), + bitwiseXOR: binop("^", 4), + bitwiseAND: binop("&", 5), + equality: binop("==/!=/===/!==", 6), + relational: binop("/<=/>=", 7), + bitShift: binop("<>/>>>", 8), + plusMin: new TokenType("+/-", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}), + modulo: binop("%", 10), + star: binop("*", 10), + slash: binop("/", 10), + starstar: new TokenType("**", {beforeExpr: true}), + + // Keyword token types. + _break: kw("break"), + _case: kw("case", beforeExpr), + _catch: kw("catch"), + _continue: kw("continue"), + _debugger: kw("debugger"), + _default: kw("default", beforeExpr), + _do: kw("do", {isLoop: true, beforeExpr: true}), + _else: kw("else", beforeExpr), + _finally: kw("finally"), + _for: kw("for", {isLoop: true}), + _function: kw("function", startsExpr), + _if: kw("if"), + _return: kw("return", beforeExpr), + _switch: kw("switch"), + _throw: kw("throw", beforeExpr), + _try: kw("try"), + _var: kw("var"), + _const: kw("const"), + _while: kw("while", {isLoop: true}), + _with: kw("with"), + _new: kw("new", {beforeExpr: true, startsExpr: true}), + _this: kw("this", startsExpr), + _super: kw("super", startsExpr), + _class: kw("class", startsExpr), + _extends: kw("extends", beforeExpr), + _export: kw("export"), + _import: kw("import"), + _null: kw("null", startsExpr), + _true: kw("true", startsExpr), + _false: kw("false", startsExpr), + _in: kw("in", {beforeExpr: true, binop: 7}), + _instanceof: kw("instanceof", {beforeExpr: true, binop: 7}), + _typeof: kw("typeof", {beforeExpr: true, prefix: true, startsExpr: true}), + _void: kw("void", {beforeExpr: true, prefix: true, startsExpr: true}), + _delete: kw("delete", {beforeExpr: true, prefix: true, startsExpr: true}) + }; + + // Matches a whole line break (where CRLF is considered a single + // line break). Used to count lines. + + var lineBreak = /\r\n?|\n|\u2028|\u2029/; + var lineBreakG = new RegExp(lineBreak.source, "g"); + + function isNewLine(code, ecma2019String) { + return code === 10 || code === 13 || (!ecma2019String && (code === 0x2028 || code === 0x2029)) + } + + var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/; + + var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; + + var ref = Object.prototype; + var hasOwnProperty = ref.hasOwnProperty; + var toString = ref.toString; + + // Checks if an object has a property. + + function has(obj, propName) { + return hasOwnProperty.call(obj, propName) + } + + var isArray = Array.isArray || (function (obj) { return ( + toString.call(obj) === "[object Array]" + ); }); + + function wordsRegexp(words) { + return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$") + } + + // These are used when `options.locations` is on, for the + // `startLoc` and `endLoc` properties. + + var Position = function Position(line, col) { + this.line = line; + this.column = col; + }; + + Position.prototype.offset = function offset (n) { + return new Position(this.line, this.column + n) + }; + + var SourceLocation = function SourceLocation(p, start, end) { + this.start = start; + this.end = end; + if (p.sourceFile !== null) { this.source = p.sourceFile; } + }; + + // The `getLineInfo` function is mostly useful when the + // `locations` option is off (for performance reasons) and you + // want to find the line/column position for a given character + // offset. `input` should be the code string that the offset refers + // into. + + function getLineInfo(input, offset) { + for (var line = 1, cur = 0;;) { + lineBreakG.lastIndex = cur; + var match = lineBreakG.exec(input); + if (match && match.index < offset) { + ++line; + cur = match.index + match[0].length; + } else { + return new Position(line, offset - cur) + } + } + } + + // A second optional argument can be given to further configure + // the parser process. These options are recognized: + + var defaultOptions = { + // `ecmaVersion` indicates the ECMAScript version to parse. Must be + // either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018), or 10 + // (2019). This influences support for strict mode, the set of + // reserved words, and support for new syntax features. The default + // is 9. + ecmaVersion: 9, + // `sourceType` indicates the mode the code should be parsed in. + // Can be either `"script"` or `"module"`. This influences global + // strict mode and parsing of `import` and `export` declarations. + sourceType: "script", + // `onInsertedSemicolon` can be a callback that will be called + // when a semicolon is automatically inserted. It will be passed + // the position of the comma as an offset, and if `locations` is + // enabled, it is given the location as a `{line, column}` object + // as second argument. + onInsertedSemicolon: null, + // `onTrailingComma` is similar to `onInsertedSemicolon`, but for + // trailing commas. + onTrailingComma: null, + // By default, reserved words are only enforced if ecmaVersion >= 5. + // Set `allowReserved` to a boolean value to explicitly turn this on + // an off. When this option has the value "never", reserved words + // and keywords can also not be used as property names. + allowReserved: null, + // When enabled, a return at the top level is not considered an + // error. + allowReturnOutsideFunction: false, + // When enabled, import/export statements are not constrained to + // appearing at the top of the program. + allowImportExportEverywhere: false, + // When enabled, await identifiers are allowed to appear at the top-level scope, + // but they are still not allowed in non-async functions. + allowAwaitOutsideFunction: false, + // When enabled, hashbang directive in the beginning of file + // is allowed and treated as a line comment. + allowHashBang: false, + // When `locations` is on, `loc` properties holding objects with + // `start` and `end` properties in `{line, column}` form (with + // line being 1-based and column 0-based) will be attached to the + // nodes. + locations: false, + // A function can be passed as `onToken` option, which will + // cause Acorn to call that function with object in the same + // format as tokens returned from `tokenizer().getToken()`. Note + // that you are not allowed to call the parser from the + // callback—that will corrupt its internal state. + onToken: null, + // A function can be passed as `onComment` option, which will + // cause Acorn to call that function with `(block, text, start, + // end)` parameters whenever a comment is skipped. `block` is a + // boolean indicating whether this is a block (`/* */`) comment, + // `text` is the content of the comment, and `start` and `end` are + // character offsets that denote the start and end of the comment. + // When the `locations` option is on, two more parameters are + // passed, the full `{line, column}` locations of the start and + // end of the comments. Note that you are not allowed to call the + // parser from the callback—that will corrupt its internal state. + onComment: null, + // Nodes have their start and end characters offsets recorded in + // `start` and `end` properties (directly on the node, rather than + // the `loc` object, which holds line/column data. To also add a + // [semi-standardized][range] `range` property holding a `[start, + // end]` array with the same numbers, set the `ranges` option to + // `true`. + // + // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678 + ranges: false, + // It is possible to parse multiple files into a single AST by + // passing the tree produced by parsing the first file as + // `program` option in subsequent parses. This will add the + // toplevel forms of the parsed file to the `Program` (top) node + // of an existing parse tree. + program: null, + // When `locations` is on, you can pass this to record the source + // file in every node's `loc` object. + sourceFile: null, + // This value, if given, is stored in every node, whether + // `locations` is on or off. + directSourceFile: null, + // When enabled, parenthesized expressions are represented by + // (non-standard) ParenthesizedExpression nodes + preserveParens: false + }; + + // Interpret and default an options object + + function getOptions(opts) { + var options = {}; + + for (var opt in defaultOptions) + { options[opt] = opts && has(opts, opt) ? opts[opt] : defaultOptions[opt]; } + + if (options.ecmaVersion >= 2015) + { options.ecmaVersion -= 2009; } + + if (options.allowReserved == null) + { options.allowReserved = options.ecmaVersion < 5; } + + if (isArray(options.onToken)) { + var tokens = options.onToken; + options.onToken = function (token) { return tokens.push(token); }; + } + if (isArray(options.onComment)) + { options.onComment = pushComment(options, options.onComment); } + + return options + } + + function pushComment(options, array) { + return function(block, text, start, end, startLoc, endLoc) { + var comment = { + type: block ? "Block" : "Line", + value: text, + start: start, + end: end + }; + if (options.locations) + { comment.loc = new SourceLocation(this, startLoc, endLoc); } + if (options.ranges) + { comment.range = [start, end]; } + array.push(comment); + } + } + + // Each scope gets a bitset that may contain these flags + var SCOPE_TOP = 1; + var SCOPE_FUNCTION = 2; + var SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION; + var SCOPE_ASYNC = 4; + var SCOPE_GENERATOR = 8; + var SCOPE_ARROW = 16; + var SCOPE_SIMPLE_CATCH = 32; + var SCOPE_SUPER = 64; + var SCOPE_DIRECT_SUPER = 128; + + function functionFlags(async, generator) { + return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0) + } + + // Used in checkLVal and declareName to determine the type of a binding + var BIND_NONE = 0; + var BIND_VAR = 1; + var BIND_LEXICAL = 2; + var BIND_FUNCTION = 3; + var BIND_SIMPLE_CATCH = 4; + var BIND_OUTSIDE = 5; // Special case for function names as bound inside the function + + var Parser = function Parser(options, input, startPos) { + this.options = options = getOptions(options); + this.sourceFile = options.sourceFile; + this.keywords = wordsRegexp(keywords[options.ecmaVersion >= 6 ? 6 : 5]); + var reserved = ""; + if (!options.allowReserved) { + for (var v = options.ecmaVersion;; v--) + { if (reserved = reservedWords[v]) { break } } + if (options.sourceType === "module") { reserved += " await"; } + } + this.reservedWords = wordsRegexp(reserved); + var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict; + this.reservedWordsStrict = wordsRegexp(reservedStrict); + this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind); + this.input = String(input); + + // Used to signal to callers of `readWord1` whether the word + // contained any escape sequences. This is needed because words with + // escape sequences must not be interpreted as keywords. + this.containsEsc = false; + + // Set up token state + + // The current position of the tokenizer in the input. + if (startPos) { + this.pos = startPos; + this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1; + this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length; + } else { + this.pos = this.lineStart = 0; + this.curLine = 1; + } + + // Properties of the current token: + // Its type + this.type = types.eof; + // For tokens that include more information than their type, the value + this.value = null; + // Its start and end offset + this.start = this.end = this.pos; + // And, if locations are used, the {line, column} object + // corresponding to those offsets + this.startLoc = this.endLoc = this.curPosition(); + + // Position information for the previous token + this.lastTokEndLoc = this.lastTokStartLoc = null; + this.lastTokStart = this.lastTokEnd = this.pos; + + // The context stack is used to superficially track syntactic + // context to predict whether a regular expression is allowed in a + // given position. + this.context = this.initialContext(); + this.exprAllowed = true; + + // Figure out if it's a module code. + this.inModule = options.sourceType === "module"; + this.strict = this.inModule || this.strictDirective(this.pos); + + // Used to signify the start of a potential arrow function + this.potentialArrowAt = -1; + + // Positions to delayed-check that yield/await does not exist in default parameters. + this.yieldPos = this.awaitPos = this.awaitIdentPos = 0; + // Labels in scope. + this.labels = []; + // Thus-far undefined exports. + this.undefinedExports = {}; + + // If enabled, skip leading hashbang line. + if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!") + { this.skipLineComment(2); } + + // Scope tracking for duplicate variable names (see scope.js) + this.scopeStack = []; + this.enterScope(SCOPE_TOP); + + // For RegExp validation + this.regexpState = null; + }; + + var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true } }; + + Parser.prototype.parse = function parse () { + var node = this.options.program || this.startNode(); + this.nextToken(); + return this.parseTopLevel(node) + }; + + prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 }; + prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 }; + prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 }; + prototypeAccessors.allowSuper.get = function () { return (this.currentThisScope().flags & SCOPE_SUPER) > 0 }; + prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 }; + prototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) }; + + // Switch to a getter for 7.0.0. + Parser.prototype.inNonArrowFunction = function inNonArrowFunction () { return (this.currentThisScope().flags & SCOPE_FUNCTION) > 0 }; + + Parser.extend = function extend () { + var plugins = [], len = arguments.length; + while ( len-- ) plugins[ len ] = arguments[ len ]; + + var cls = this; + for (var i = 0; i < plugins.length; i++) { cls = plugins[i](cls); } + return cls + }; + + Parser.parse = function parse (input, options) { + return new this(options, input).parse() + }; + + Parser.parseExpressionAt = function parseExpressionAt (input, pos, options) { + var parser = new this(options, input, pos); + parser.nextToken(); + return parser.parseExpression() + }; + + Parser.tokenizer = function tokenizer (input, options) { + return new this(options, input) + }; + + Object.defineProperties( Parser.prototype, prototypeAccessors ); + + var pp = Parser.prototype; + + // ## Parser utilities + + var literal = /^(?:'((?:\\.|[^'])*?)'|"((?:\\.|[^"])*?)")/; + pp.strictDirective = function(start) { + var this$1 = this; + + for (;;) { + // Try to find string literal. + skipWhiteSpace.lastIndex = start; + start += skipWhiteSpace.exec(this$1.input)[0].length; + var match = literal.exec(this$1.input.slice(start)); + if (!match) { return false } + if ((match[1] || match[2]) === "use strict") { return true } + start += match[0].length; + + // Skip semicolon, if any. + skipWhiteSpace.lastIndex = start; + start += skipWhiteSpace.exec(this$1.input)[0].length; + if (this$1.input[start] === ";") + { start++; } + } + }; + + // Predicate that tests whether the next token is of the given + // type, and if yes, consumes it as a side effect. + + pp.eat = function(type) { + if (this.type === type) { + this.next(); + return true + } else { + return false + } + }; + + // Tests whether parsed token is a contextual keyword. + + pp.isContextual = function(name) { + return this.type === types.name && this.value === name && !this.containsEsc + }; + + // Consumes contextual keyword if possible. + + pp.eatContextual = function(name) { + if (!this.isContextual(name)) { return false } + this.next(); + return true + }; + + // Asserts that following token is given contextual keyword. + + pp.expectContextual = function(name) { + if (!this.eatContextual(name)) { this.unexpected(); } + }; + + // Test whether a semicolon can be inserted at the current position. + + pp.canInsertSemicolon = function() { + return this.type === types.eof || + this.type === types.braceR || + lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) + }; + + pp.insertSemicolon = function() { + if (this.canInsertSemicolon()) { + if (this.options.onInsertedSemicolon) + { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); } + return true + } + }; + + // Consume a semicolon, or, failing that, see if we are allowed to + // pretend that there is a semicolon at this position. + + pp.semicolon = function() { + if (!this.eat(types.semi) && !this.insertSemicolon()) { this.unexpected(); } + }; + + pp.afterTrailingComma = function(tokType, notNext) { + if (this.type === tokType) { + if (this.options.onTrailingComma) + { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); } + if (!notNext) + { this.next(); } + return true + } + }; + + // Expect a token of a given type. If found, consume it, otherwise, + // raise an unexpected token error. + + pp.expect = function(type) { + this.eat(type) || this.unexpected(); + }; + + // Raise an unexpected token error. + + pp.unexpected = function(pos) { + this.raise(pos != null ? pos : this.start, "Unexpected token"); + }; + + function DestructuringErrors() { + this.shorthandAssign = + this.trailingComma = + this.parenthesizedAssign = + this.parenthesizedBind = + this.doubleProto = + -1; + } + + pp.checkPatternErrors = function(refDestructuringErrors, isAssign) { + if (!refDestructuringErrors) { return } + if (refDestructuringErrors.trailingComma > -1) + { this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); } + var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind; + if (parens > -1) { this.raiseRecoverable(parens, "Parenthesized pattern"); } + }; + + pp.checkExpressionErrors = function(refDestructuringErrors, andThrow) { + if (!refDestructuringErrors) { return false } + var shorthandAssign = refDestructuringErrors.shorthandAssign; + var doubleProto = refDestructuringErrors.doubleProto; + if (!andThrow) { return shorthandAssign >= 0 || doubleProto >= 0 } + if (shorthandAssign >= 0) + { this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"); } + if (doubleProto >= 0) + { this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); } + }; + + pp.checkYieldAwaitInDefaultParams = function() { + if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) + { this.raise(this.yieldPos, "Yield expression cannot be a default value"); } + if (this.awaitPos) + { this.raise(this.awaitPos, "Await expression cannot be a default value"); } + }; + + pp.isSimpleAssignTarget = function(expr) { + if (expr.type === "ParenthesizedExpression") + { return this.isSimpleAssignTarget(expr.expression) } + return expr.type === "Identifier" || expr.type === "MemberExpression" + }; + + var pp$1 = Parser.prototype; + + // ### Statement parsing + + // Parse a program. Initializes the parser, reads any number of + // statements, and wraps them in a Program node. Optionally takes a + // `program` argument. If present, the statements will be appended + // to its body instead of creating a new node. + + pp$1.parseTopLevel = function(node) { + var this$1 = this; + + var exports = {}; + if (!node.body) { node.body = []; } + while (this.type !== types.eof) { + var stmt = this$1.parseStatement(null, true, exports); + node.body.push(stmt); + } + if (this.inModule) + { for (var i = 0, list = Object.keys(this$1.undefinedExports); i < list.length; i += 1) + { + var name = list[i]; + + this$1.raiseRecoverable(this$1.undefinedExports[name].start, ("Export '" + name + "' is not defined")); + } } + this.adaptDirectivePrologue(node.body); + this.next(); + if (this.options.ecmaVersion >= 6) { + node.sourceType = this.options.sourceType; + } + return this.finishNode(node, "Program") + }; + + var loopLabel = {kind: "loop"}; + var switchLabel = {kind: "switch"}; + + pp$1.isLet = function(context) { + if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false } + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); + // For ambiguous cases, determine if a LexicalDeclaration (or only a + // Statement) is allowed here. If context is not empty then only a Statement + // is allowed. However, `let [` is an explicit negative lookahead for + // ExpressionStatement, so special-case it first. + if (nextCh === 91) { return true } // '[' + if (context) { return false } + + if (nextCh === 123) { return true } // '{' + if (isIdentifierStart(nextCh, true)) { + var pos = next + 1; + while (isIdentifierChar(this.input.charCodeAt(pos), true)) { ++pos; } + var ident = this.input.slice(next, pos); + if (!keywordRelationalOperator.test(ident)) { return true } + } + return false + }; + + // check 'async [no LineTerminator here] function' + // - 'async /*foo*/ function' is OK. + // - 'async /*\n*/ function' is invalid. + pp$1.isAsyncFunction = function() { + if (this.options.ecmaVersion < 8 || !this.isContextual("async")) + { return false } + + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length; + return !lineBreak.test(this.input.slice(this.pos, next)) && + this.input.slice(next, next + 8) === "function" && + (next + 8 === this.input.length || !isIdentifierChar(this.input.charAt(next + 8))) + }; + + // Parse a single statement. + // + // If expecting a statement and finding a slash operator, parse a + // regular expression literal. This is to handle cases like + // `if (foo) /blah/.exec(foo)`, where looking at the previous token + // does not help. + + pp$1.parseStatement = function(context, topLevel, exports) { + var starttype = this.type, node = this.startNode(), kind; + + if (this.isLet(context)) { + starttype = types._var; + kind = "let"; + } + + // Most types of statements are recognized by the keyword they + // start with. Many are trivial to parse, some require a bit of + // complexity. + + switch (starttype) { + case types._break: case types._continue: return this.parseBreakContinueStatement(node, starttype.keyword) + case types._debugger: return this.parseDebuggerStatement(node) + case types._do: return this.parseDoStatement(node) + case types._for: return this.parseForStatement(node) + case types._function: + // Function as sole body of either an if statement or a labeled statement + // works, but not when it is part of a labeled statement that is the sole + // body of an if statement. + if ((context && (this.strict || context !== "if" && context !== "label")) && this.options.ecmaVersion >= 6) { this.unexpected(); } + return this.parseFunctionStatement(node, false, !context) + case types._class: + if (context) { this.unexpected(); } + return this.parseClass(node, true) + case types._if: return this.parseIfStatement(node) + case types._return: return this.parseReturnStatement(node) + case types._switch: return this.parseSwitchStatement(node) + case types._throw: return this.parseThrowStatement(node) + case types._try: return this.parseTryStatement(node) + case types._const: case types._var: + kind = kind || this.value; + if (context && kind !== "var") { this.unexpected(); } + return this.parseVarStatement(node, kind) + case types._while: return this.parseWhileStatement(node) + case types._with: return this.parseWithStatement(node) + case types.braceL: return this.parseBlock(true, node) + case types.semi: return this.parseEmptyStatement(node) + case types._export: + case types._import: + if (!this.options.allowImportExportEverywhere) { + if (!topLevel) + { this.raise(this.start, "'import' and 'export' may only appear at the top level"); } + if (!this.inModule) + { this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); } + } + return starttype === types._import ? this.parseImport(node) : this.parseExport(node, exports) + + // If the statement does not start with a statement keyword or a + // brace, it's an ExpressionStatement or LabeledStatement. We + // simply start parsing an expression, and afterwards, if the + // next token is a colon and the expression was a simple + // Identifier node, we switch to interpreting it as a label. + default: + if (this.isAsyncFunction()) { + if (context) { this.unexpected(); } + this.next(); + return this.parseFunctionStatement(node, true, !context) + } + + var maybeName = this.value, expr = this.parseExpression(); + if (starttype === types.name && expr.type === "Identifier" && this.eat(types.colon)) + { return this.parseLabeledStatement(node, maybeName, expr, context) } + else { return this.parseExpressionStatement(node, expr) } + } + }; + + pp$1.parseBreakContinueStatement = function(node, keyword) { + var this$1 = this; + + var isBreak = keyword === "break"; + this.next(); + if (this.eat(types.semi) || this.insertSemicolon()) { node.label = null; } + else if (this.type !== types.name) { this.unexpected(); } + else { + node.label = this.parseIdent(); + this.semicolon(); + } + + // Verify that there is an actual destination to break or + // continue to. + var i = 0; + for (; i < this.labels.length; ++i) { + var lab = this$1.labels[i]; + if (node.label == null || lab.name === node.label.name) { + if (lab.kind != null && (isBreak || lab.kind === "loop")) { break } + if (node.label && isBreak) { break } + } + } + if (i === this.labels.length) { this.raise(node.start, "Unsyntactic " + keyword); } + return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement") + }; + + pp$1.parseDebuggerStatement = function(node) { + this.next(); + this.semicolon(); + return this.finishNode(node, "DebuggerStatement") + }; + + pp$1.parseDoStatement = function(node) { + this.next(); + this.labels.push(loopLabel); + node.body = this.parseStatement("do"); + this.labels.pop(); + this.expect(types._while); + node.test = this.parseParenExpression(); + if (this.options.ecmaVersion >= 6) + { this.eat(types.semi); } + else + { this.semicolon(); } + return this.finishNode(node, "DoWhileStatement") + }; + + // Disambiguating between a `for` and a `for`/`in` or `for`/`of` + // loop is non-trivial. Basically, we have to parse the init `var` + // statement or expression, disallowing the `in` operator (see + // the second parameter to `parseExpression`), and then check + // whether the next token is `in` or `of`. When there is no init + // part (semicolon immediately after the opening parenthesis), it + // is a regular `for` loop. + + pp$1.parseForStatement = function(node) { + this.next(); + var awaitAt = (this.options.ecmaVersion >= 9 && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction)) && this.eatContextual("await")) ? this.lastTokStart : -1; + this.labels.push(loopLabel); + this.enterScope(0); + this.expect(types.parenL); + if (this.type === types.semi) { + if (awaitAt > -1) { this.unexpected(awaitAt); } + return this.parseFor(node, null) + } + var isLet = this.isLet(); + if (this.type === types._var || this.type === types._const || isLet) { + var init$1 = this.startNode(), kind = isLet ? "let" : this.value; + this.next(); + this.parseVar(init$1, true, kind); + this.finishNode(init$1, "VariableDeclaration"); + if ((this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1 && + !(kind !== "var" && init$1.declarations[0].init)) { + if (this.options.ecmaVersion >= 9) { + if (this.type === types._in) { + if (awaitAt > -1) { this.unexpected(awaitAt); } + } else { node.await = awaitAt > -1; } + } + return this.parseForIn(node, init$1) + } + if (awaitAt > -1) { this.unexpected(awaitAt); } + return this.parseFor(node, init$1) + } + var refDestructuringErrors = new DestructuringErrors; + var init = this.parseExpression(true, refDestructuringErrors); + if (this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) { + if (this.options.ecmaVersion >= 9) { + if (this.type === types._in) { + if (awaitAt > -1) { this.unexpected(awaitAt); } + } else { node.await = awaitAt > -1; } + } + this.toAssignable(init, false, refDestructuringErrors); + this.checkLVal(init); + return this.parseForIn(node, init) + } else { + this.checkExpressionErrors(refDestructuringErrors, true); + } + if (awaitAt > -1) { this.unexpected(awaitAt); } + return this.parseFor(node, init) + }; + + pp$1.parseFunctionStatement = function(node, isAsync, declarationPosition) { + this.next(); + return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync) + }; + + pp$1.parseIfStatement = function(node) { + this.next(); + node.test = this.parseParenExpression(); + // allow function declarations in branches, but only in non-strict mode + node.consequent = this.parseStatement("if"); + node.alternate = this.eat(types._else) ? this.parseStatement("if") : null; + return this.finishNode(node, "IfStatement") + }; + + pp$1.parseReturnStatement = function(node) { + if (!this.inFunction && !this.options.allowReturnOutsideFunction) + { this.raise(this.start, "'return' outside of function"); } + this.next(); + + // In `return` (and `break`/`continue`), the keywords with + // optional arguments, we eagerly look for a semicolon or the + // possibility to insert one. + + if (this.eat(types.semi) || this.insertSemicolon()) { node.argument = null; } + else { node.argument = this.parseExpression(); this.semicolon(); } + return this.finishNode(node, "ReturnStatement") + }; + + pp$1.parseSwitchStatement = function(node) { + var this$1 = this; + + this.next(); + node.discriminant = this.parseParenExpression(); + node.cases = []; + this.expect(types.braceL); + this.labels.push(switchLabel); + this.enterScope(0); + + // Statements under must be grouped (by label) in SwitchCase + // nodes. `cur` is used to keep the node that we are currently + // adding statements to. + + var cur; + for (var sawDefault = false; this.type !== types.braceR;) { + if (this$1.type === types._case || this$1.type === types._default) { + var isCase = this$1.type === types._case; + if (cur) { this$1.finishNode(cur, "SwitchCase"); } + node.cases.push(cur = this$1.startNode()); + cur.consequent = []; + this$1.next(); + if (isCase) { + cur.test = this$1.parseExpression(); + } else { + if (sawDefault) { this$1.raiseRecoverable(this$1.lastTokStart, "Multiple default clauses"); } + sawDefault = true; + cur.test = null; + } + this$1.expect(types.colon); + } else { + if (!cur) { this$1.unexpected(); } + cur.consequent.push(this$1.parseStatement(null)); + } + } + this.exitScope(); + if (cur) { this.finishNode(cur, "SwitchCase"); } + this.next(); // Closing brace + this.labels.pop(); + return this.finishNode(node, "SwitchStatement") + }; + + pp$1.parseThrowStatement = function(node) { + this.next(); + if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) + { this.raise(this.lastTokEnd, "Illegal newline after throw"); } + node.argument = this.parseExpression(); + this.semicolon(); + return this.finishNode(node, "ThrowStatement") + }; + + // Reused empty array added for node fields that are always empty. + + var empty = []; + + pp$1.parseTryStatement = function(node) { + this.next(); + node.block = this.parseBlock(); + node.handler = null; + if (this.type === types._catch) { + var clause = this.startNode(); + this.next(); + if (this.eat(types.parenL)) { + clause.param = this.parseBindingAtom(); + var simple = clause.param.type === "Identifier"; + this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0); + this.checkLVal(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL); + this.expect(types.parenR); + } else { + if (this.options.ecmaVersion < 10) { this.unexpected(); } + clause.param = null; + this.enterScope(0); + } + clause.body = this.parseBlock(false); + this.exitScope(); + node.handler = this.finishNode(clause, "CatchClause"); + } + node.finalizer = this.eat(types._finally) ? this.parseBlock() : null; + if (!node.handler && !node.finalizer) + { this.raise(node.start, "Missing catch or finally clause"); } + return this.finishNode(node, "TryStatement") + }; + + pp$1.parseVarStatement = function(node, kind) { + this.next(); + this.parseVar(node, false, kind); + this.semicolon(); + return this.finishNode(node, "VariableDeclaration") + }; + + pp$1.parseWhileStatement = function(node) { + this.next(); + node.test = this.parseParenExpression(); + this.labels.push(loopLabel); + node.body = this.parseStatement("while"); + this.labels.pop(); + return this.finishNode(node, "WhileStatement") + }; + + pp$1.parseWithStatement = function(node) { + if (this.strict) { this.raise(this.start, "'with' in strict mode"); } + this.next(); + node.object = this.parseParenExpression(); + node.body = this.parseStatement("with"); + return this.finishNode(node, "WithStatement") + }; + + pp$1.parseEmptyStatement = function(node) { + this.next(); + return this.finishNode(node, "EmptyStatement") + }; + + pp$1.parseLabeledStatement = function(node, maybeName, expr, context) { + var this$1 = this; + + for (var i$1 = 0, list = this$1.labels; i$1 < list.length; i$1 += 1) + { + var label = list[i$1]; + + if (label.name === maybeName) + { this$1.raise(expr.start, "Label '" + maybeName + "' is already declared"); + } } + var kind = this.type.isLoop ? "loop" : this.type === types._switch ? "switch" : null; + for (var i = this.labels.length - 1; i >= 0; i--) { + var label$1 = this$1.labels[i]; + if (label$1.statementStart === node.start) { + // Update information about previous labels on this node + label$1.statementStart = this$1.start; + label$1.kind = kind; + } else { break } + } + this.labels.push({name: maybeName, kind: kind, statementStart: this.start}); + node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label"); + this.labels.pop(); + node.label = expr; + return this.finishNode(node, "LabeledStatement") + }; + + pp$1.parseExpressionStatement = function(node, expr) { + node.expression = expr; + this.semicolon(); + return this.finishNode(node, "ExpressionStatement") + }; + + // Parse a semicolon-enclosed block of statements, handling `"use + // strict"` declarations when `allowStrict` is true (used for + // function bodies). + + pp$1.parseBlock = function(createNewLexicalScope, node) { + var this$1 = this; + if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true; + if ( node === void 0 ) node = this.startNode(); + + node.body = []; + this.expect(types.braceL); + if (createNewLexicalScope) { this.enterScope(0); } + while (!this.eat(types.braceR)) { + var stmt = this$1.parseStatement(null); + node.body.push(stmt); + } + if (createNewLexicalScope) { this.exitScope(); } + return this.finishNode(node, "BlockStatement") + }; + + // Parse a regular `for` loop. The disambiguation code in + // `parseStatement` will already have parsed the init statement or + // expression. + + pp$1.parseFor = function(node, init) { + node.init = init; + this.expect(types.semi); + node.test = this.type === types.semi ? null : this.parseExpression(); + this.expect(types.semi); + node.update = this.type === types.parenR ? null : this.parseExpression(); + this.expect(types.parenR); + node.body = this.parseStatement("for"); + this.exitScope(); + this.labels.pop(); + return this.finishNode(node, "ForStatement") + }; + + // Parse a `for`/`in` and `for`/`of` loop, which are almost + // same from parser's perspective. + + pp$1.parseForIn = function(node, init) { + var type = this.type === types._in ? "ForInStatement" : "ForOfStatement"; + this.next(); + if (type === "ForInStatement") { + if (init.type === "AssignmentPattern" || + (init.type === "VariableDeclaration" && init.declarations[0].init != null && + (this.strict || init.declarations[0].id.type !== "Identifier"))) + { this.raise(init.start, "Invalid assignment in for-in loop head"); } + } + node.left = init; + node.right = type === "ForInStatement" ? this.parseExpression() : this.parseMaybeAssign(); + this.expect(types.parenR); + node.body = this.parseStatement("for"); + this.exitScope(); + this.labels.pop(); + return this.finishNode(node, type) + }; + + // Parse a list of variable declarations. + + pp$1.parseVar = function(node, isFor, kind) { + var this$1 = this; + + node.declarations = []; + node.kind = kind; + for (;;) { + var decl = this$1.startNode(); + this$1.parseVarId(decl, kind); + if (this$1.eat(types.eq)) { + decl.init = this$1.parseMaybeAssign(isFor); + } else if (kind === "const" && !(this$1.type === types._in || (this$1.options.ecmaVersion >= 6 && this$1.isContextual("of")))) { + this$1.unexpected(); + } else if (decl.id.type !== "Identifier" && !(isFor && (this$1.type === types._in || this$1.isContextual("of")))) { + this$1.raise(this$1.lastTokEnd, "Complex binding patterns require an initialization value"); + } else { + decl.init = null; + } + node.declarations.push(this$1.finishNode(decl, "VariableDeclarator")); + if (!this$1.eat(types.comma)) { break } + } + return node + }; + + pp$1.parseVarId = function(decl, kind) { + if ((kind === "const" || kind === "let") && this.isContextual("let")) { + this.raiseRecoverable(this.start, "let is disallowed as a lexically bound name"); + } + decl.id = this.parseBindingAtom(); + this.checkLVal(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false); + }; + + var FUNC_STATEMENT = 1; + var FUNC_HANGING_STATEMENT = 2; + var FUNC_NULLABLE_ID = 4; + + // Parse a function declaration or literal (depending on the + // `statement & FUNC_STATEMENT`). + + // Remove `allowExpressionBody` for 7.0.0, as it is only called with false + pp$1.parseFunction = function(node, statement, allowExpressionBody, isAsync) { + this.initFunction(node); + if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) { + if (this.type === types.star && (statement & FUNC_HANGING_STATEMENT)) + { this.unexpected(); } + node.generator = this.eat(types.star); + } + if (this.options.ecmaVersion >= 8) + { node.async = !!isAsync; } + + if (statement & FUNC_STATEMENT) { + node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types.name ? null : this.parseIdent(); + if (node.id && !(statement & FUNC_HANGING_STATEMENT)) + // If it is a regular function declaration in sloppy mode, then it is + // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding + // mode depends on properties of the current scope (see + // treatFunctionsAsVar). + { this.checkLVal(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); } + } + + var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + this.enterScope(functionFlags(node.async, node.generator)); + + if (!(statement & FUNC_STATEMENT)) + { node.id = this.type === types.name ? this.parseIdent() : null; } + + this.parseFunctionParams(node); + this.parseFunctionBody(node, allowExpressionBody, false); + + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, (statement & FUNC_STATEMENT) ? "FunctionDeclaration" : "FunctionExpression") + }; + + pp$1.parseFunctionParams = function(node) { + this.expect(types.parenL); + node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8); + this.checkYieldAwaitInDefaultParams(); + }; + + // Parse a class declaration or literal (depending on the + // `isStatement` parameter). + + pp$1.parseClass = function(node, isStatement) { + var this$1 = this; + + this.next(); + + // ecma-262 14.6 Class Definitions + // A class definition is always strict mode code. + var oldStrict = this.strict; + this.strict = true; + + this.parseClassId(node, isStatement); + this.parseClassSuper(node); + var classBody = this.startNode(); + var hadConstructor = false; + classBody.body = []; + this.expect(types.braceL); + while (!this.eat(types.braceR)) { + var element = this$1.parseClassElement(node.superClass !== null); + if (element) { + classBody.body.push(element); + if (element.type === "MethodDefinition" && element.kind === "constructor") { + if (hadConstructor) { this$1.raise(element.start, "Duplicate constructor in the same class"); } + hadConstructor = true; + } + } + } + node.body = this.finishNode(classBody, "ClassBody"); + this.strict = oldStrict; + return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression") + }; + + pp$1.parseClassElement = function(constructorAllowsSuper) { + var this$1 = this; + + if (this.eat(types.semi)) { return null } + + var method = this.startNode(); + var tryContextual = function (k, noLineBreak) { + if ( noLineBreak === void 0 ) noLineBreak = false; + + var start = this$1.start, startLoc = this$1.startLoc; + if (!this$1.eatContextual(k)) { return false } + if (this$1.type !== types.parenL && (!noLineBreak || !this$1.canInsertSemicolon())) { return true } + if (method.key) { this$1.unexpected(); } + method.computed = false; + method.key = this$1.startNodeAt(start, startLoc); + method.key.name = k; + this$1.finishNode(method.key, "Identifier"); + return false + }; + + method.kind = "method"; + method.static = tryContextual("static"); + var isGenerator = this.eat(types.star); + var isAsync = false; + if (!isGenerator) { + if (this.options.ecmaVersion >= 8 && tryContextual("async", true)) { + isAsync = true; + isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star); + } else if (tryContextual("get")) { + method.kind = "get"; + } else if (tryContextual("set")) { + method.kind = "set"; + } + } + if (!method.key) { this.parsePropertyName(method); } + var key = method.key; + var allowsDirectSuper = false; + if (!method.computed && !method.static && (key.type === "Identifier" && key.name === "constructor" || + key.type === "Literal" && key.value === "constructor")) { + if (method.kind !== "method") { this.raise(key.start, "Constructor can't have get/set modifier"); } + if (isGenerator) { this.raise(key.start, "Constructor can't be a generator"); } + if (isAsync) { this.raise(key.start, "Constructor can't be an async method"); } + method.kind = "constructor"; + allowsDirectSuper = constructorAllowsSuper; + } else if (method.static && key.type === "Identifier" && key.name === "prototype") { + this.raise(key.start, "Classes may not have a static property named prototype"); + } + this.parseClassMethod(method, isGenerator, isAsync, allowsDirectSuper); + if (method.kind === "get" && method.value.params.length !== 0) + { this.raiseRecoverable(method.value.start, "getter should have no params"); } + if (method.kind === "set" && method.value.params.length !== 1) + { this.raiseRecoverable(method.value.start, "setter should have exactly one param"); } + if (method.kind === "set" && method.value.params[0].type === "RestElement") + { this.raiseRecoverable(method.value.params[0].start, "Setter cannot use rest params"); } + return method + }; + + pp$1.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) { + method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper); + return this.finishNode(method, "MethodDefinition") + }; + + pp$1.parseClassId = function(node, isStatement) { + if (this.type === types.name) { + node.id = this.parseIdent(); + if (isStatement) + { this.checkLVal(node.id, BIND_LEXICAL, false); } + } else { + if (isStatement === true) + { this.unexpected(); } + node.id = null; + } + }; + + pp$1.parseClassSuper = function(node) { + node.superClass = this.eat(types._extends) ? this.parseExprSubscripts() : null; + }; + + // Parses module export declaration. + + pp$1.parseExport = function(node, exports) { + var this$1 = this; + + this.next(); + // export * from '...' + if (this.eat(types.star)) { + this.expectContextual("from"); + if (this.type !== types.string) { this.unexpected(); } + node.source = this.parseExprAtom(); + this.semicolon(); + return this.finishNode(node, "ExportAllDeclaration") + } + if (this.eat(types._default)) { // export default ... + this.checkExport(exports, "default", this.lastTokStart); + var isAsync; + if (this.type === types._function || (isAsync = this.isAsyncFunction())) { + var fNode = this.startNode(); + this.next(); + if (isAsync) { this.next(); } + node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync); + } else if (this.type === types._class) { + var cNode = this.startNode(); + node.declaration = this.parseClass(cNode, "nullableID"); + } else { + node.declaration = this.parseMaybeAssign(); + this.semicolon(); + } + return this.finishNode(node, "ExportDefaultDeclaration") + } + // export var|const|let|function|class ... + if (this.shouldParseExportStatement()) { + node.declaration = this.parseStatement(null); + if (node.declaration.type === "VariableDeclaration") + { this.checkVariableExport(exports, node.declaration.declarations); } + else + { this.checkExport(exports, node.declaration.id.name, node.declaration.id.start); } + node.specifiers = []; + node.source = null; + } else { // export { x, y as z } [from '...'] + node.declaration = null; + node.specifiers = this.parseExportSpecifiers(exports); + if (this.eatContextual("from")) { + if (this.type !== types.string) { this.unexpected(); } + node.source = this.parseExprAtom(); + } else { + for (var i = 0, list = node.specifiers; i < list.length; i += 1) { + // check for keywords used as local names + var spec = list[i]; + + this$1.checkUnreserved(spec.local); + // check if export is defined + this$1.checkLocalExport(spec.local); + } + + node.source = null; + } + this.semicolon(); + } + return this.finishNode(node, "ExportNamedDeclaration") + }; + + pp$1.checkExport = function(exports, name, pos) { + if (!exports) { return } + if (has(exports, name)) + { this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); } + exports[name] = true; + }; + + pp$1.checkPatternExport = function(exports, pat) { + var this$1 = this; + + var type = pat.type; + if (type === "Identifier") + { this.checkExport(exports, pat.name, pat.start); } + else if (type === "ObjectPattern") + { for (var i = 0, list = pat.properties; i < list.length; i += 1) + { + var prop = list[i]; + + this$1.checkPatternExport(exports, prop); + } } + else if (type === "ArrayPattern") + { for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) { + var elt = list$1[i$1]; + + if (elt) { this$1.checkPatternExport(exports, elt); } + } } + else if (type === "Property") + { this.checkPatternExport(exports, pat.value); } + else if (type === "AssignmentPattern") + { this.checkPatternExport(exports, pat.left); } + else if (type === "RestElement") + { this.checkPatternExport(exports, pat.argument); } + else if (type === "ParenthesizedExpression") + { this.checkPatternExport(exports, pat.expression); } + }; + + pp$1.checkVariableExport = function(exports, decls) { + var this$1 = this; + + if (!exports) { return } + for (var i = 0, list = decls; i < list.length; i += 1) + { + var decl = list[i]; + + this$1.checkPatternExport(exports, decl.id); + } + }; + + pp$1.shouldParseExportStatement = function() { + return this.type.keyword === "var" || + this.type.keyword === "const" || + this.type.keyword === "class" || + this.type.keyword === "function" || + this.isLet() || + this.isAsyncFunction() + }; + + // Parses a comma-separated list of module exports. + + pp$1.parseExportSpecifiers = function(exports) { + var this$1 = this; + + var nodes = [], first = true; + // export { x, y as z } [from '...'] + this.expect(types.braceL); + while (!this.eat(types.braceR)) { + if (!first) { + this$1.expect(types.comma); + if (this$1.afterTrailingComma(types.braceR)) { break } + } else { first = false; } + + var node = this$1.startNode(); + node.local = this$1.parseIdent(true); + node.exported = this$1.eatContextual("as") ? this$1.parseIdent(true) : node.local; + this$1.checkExport(exports, node.exported.name, node.exported.start); + nodes.push(this$1.finishNode(node, "ExportSpecifier")); + } + return nodes + }; + + // Parses import declaration. + + pp$1.parseImport = function(node) { + this.next(); + // import '...' + if (this.type === types.string) { + node.specifiers = empty; + node.source = this.parseExprAtom(); + } else { + node.specifiers = this.parseImportSpecifiers(); + this.expectContextual("from"); + node.source = this.type === types.string ? this.parseExprAtom() : this.unexpected(); + } + this.semicolon(); + return this.finishNode(node, "ImportDeclaration") + }; + + // Parses a comma-separated list of module imports. + + pp$1.parseImportSpecifiers = function() { + var this$1 = this; + + var nodes = [], first = true; + if (this.type === types.name) { + // import defaultObj, { x, y as z } from '...' + var node = this.startNode(); + node.local = this.parseIdent(); + this.checkLVal(node.local, BIND_LEXICAL); + nodes.push(this.finishNode(node, "ImportDefaultSpecifier")); + if (!this.eat(types.comma)) { return nodes } + } + if (this.type === types.star) { + var node$1 = this.startNode(); + this.next(); + this.expectContextual("as"); + node$1.local = this.parseIdent(); + this.checkLVal(node$1.local, BIND_LEXICAL); + nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier")); + return nodes + } + this.expect(types.braceL); + while (!this.eat(types.braceR)) { + if (!first) { + this$1.expect(types.comma); + if (this$1.afterTrailingComma(types.braceR)) { break } + } else { first = false; } + + var node$2 = this$1.startNode(); + node$2.imported = this$1.parseIdent(true); + if (this$1.eatContextual("as")) { + node$2.local = this$1.parseIdent(); + } else { + this$1.checkUnreserved(node$2.imported); + node$2.local = node$2.imported; + } + this$1.checkLVal(node$2.local, BIND_LEXICAL); + nodes.push(this$1.finishNode(node$2, "ImportSpecifier")); + } + return nodes + }; + + // Set `ExpressionStatement#directive` property for directive prologues. + pp$1.adaptDirectivePrologue = function(statements) { + for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) { + statements[i].directive = statements[i].expression.raw.slice(1, -1); + } + }; + pp$1.isDirectiveCandidate = function(statement) { + return ( + statement.type === "ExpressionStatement" && + statement.expression.type === "Literal" && + typeof statement.expression.value === "string" && + // Reject parenthesized strings. + (this.input[statement.start] === "\"" || this.input[statement.start] === "'") + ) + }; + + var pp$2 = Parser.prototype; + + // Convert existing expression atom to assignable pattern + // if possible. + + pp$2.toAssignable = function(node, isBinding, refDestructuringErrors) { + var this$1 = this; + + if (this.options.ecmaVersion >= 6 && node) { + switch (node.type) { + case "Identifier": + if (this.inAsync && node.name === "await") + { this.raise(node.start, "Cannot use 'await' as identifier inside an async function"); } + break + + case "ObjectPattern": + case "ArrayPattern": + case "RestElement": + break + + case "ObjectExpression": + node.type = "ObjectPattern"; + if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } + for (var i = 0, list = node.properties; i < list.length; i += 1) { + var prop = list[i]; + + this$1.toAssignable(prop, isBinding); + // Early error: + // AssignmentRestProperty[Yield, Await] : + // `...` DestructuringAssignmentTarget[Yield, Await] + // + // It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|. + if ( + prop.type === "RestElement" && + (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern") + ) { + this$1.raise(prop.argument.start, "Unexpected token"); + } + } + break + + case "Property": + // AssignmentProperty has type === "Property" + if (node.kind !== "init") { this.raise(node.key.start, "Object pattern can't contain getter or setter"); } + this.toAssignable(node.value, isBinding); + break + + case "ArrayExpression": + node.type = "ArrayPattern"; + if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } + this.toAssignableList(node.elements, isBinding); + break + + case "SpreadElement": + node.type = "RestElement"; + this.toAssignable(node.argument, isBinding); + if (node.argument.type === "AssignmentPattern") + { this.raise(node.argument.start, "Rest elements cannot have a default value"); } + break + + case "AssignmentExpression": + if (node.operator !== "=") { this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); } + node.type = "AssignmentPattern"; + delete node.operator; + this.toAssignable(node.left, isBinding); + // falls through to AssignmentPattern + + case "AssignmentPattern": + break + + case "ParenthesizedExpression": + this.toAssignable(node.expression, isBinding, refDestructuringErrors); + break + + case "MemberExpression": + if (!isBinding) { break } + + default: + this.raise(node.start, "Assigning to rvalue"); + } + } else if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } + return node + }; + + // Convert list of expression atoms to binding list. + + pp$2.toAssignableList = function(exprList, isBinding) { + var this$1 = this; + + var end = exprList.length; + for (var i = 0; i < end; i++) { + var elt = exprList[i]; + if (elt) { this$1.toAssignable(elt, isBinding); } + } + if (end) { + var last = exprList[end - 1]; + if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier") + { this.unexpected(last.argument.start); } + } + return exprList + }; + + // Parses spread element. + + pp$2.parseSpread = function(refDestructuringErrors) { + var node = this.startNode(); + this.next(); + node.argument = this.parseMaybeAssign(false, refDestructuringErrors); + return this.finishNode(node, "SpreadElement") + }; + + pp$2.parseRestBinding = function() { + var node = this.startNode(); + this.next(); + + // RestElement inside of a function parameter must be an identifier + if (this.options.ecmaVersion === 6 && this.type !== types.name) + { this.unexpected(); } + + node.argument = this.parseBindingAtom(); + + return this.finishNode(node, "RestElement") + }; + + // Parses lvalue (assignable) atom. + + pp$2.parseBindingAtom = function() { + if (this.options.ecmaVersion >= 6) { + switch (this.type) { + case types.bracketL: + var node = this.startNode(); + this.next(); + node.elements = this.parseBindingList(types.bracketR, true, true); + return this.finishNode(node, "ArrayPattern") + + case types.braceL: + return this.parseObj(true) + } + } + return this.parseIdent() + }; + + pp$2.parseBindingList = function(close, allowEmpty, allowTrailingComma) { + var this$1 = this; + + var elts = [], first = true; + while (!this.eat(close)) { + if (first) { first = false; } + else { this$1.expect(types.comma); } + if (allowEmpty && this$1.type === types.comma) { + elts.push(null); + } else if (allowTrailingComma && this$1.afterTrailingComma(close)) { + break + } else if (this$1.type === types.ellipsis) { + var rest = this$1.parseRestBinding(); + this$1.parseBindingListItem(rest); + elts.push(rest); + if (this$1.type === types.comma) { this$1.raise(this$1.start, "Comma is not permitted after the rest element"); } + this$1.expect(close); + break + } else { + var elem = this$1.parseMaybeDefault(this$1.start, this$1.startLoc); + this$1.parseBindingListItem(elem); + elts.push(elem); + } + } + return elts + }; + + pp$2.parseBindingListItem = function(param) { + return param + }; + + // Parses assignment pattern around given atom if possible. + + pp$2.parseMaybeDefault = function(startPos, startLoc, left) { + left = left || this.parseBindingAtom(); + if (this.options.ecmaVersion < 6 || !this.eat(types.eq)) { return left } + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.right = this.parseMaybeAssign(); + return this.finishNode(node, "AssignmentPattern") + }; + + // Verify that a node is an lval — something that can be assigned + // to. + // bindingType can be either: + // 'var' indicating that the lval creates a 'var' binding + // 'let' indicating that the lval creates a lexical ('let' or 'const') binding + // 'none' indicating that the binding should be checked for illegal identifiers, but not for duplicate references + + pp$2.checkLVal = function(expr, bindingType, checkClashes) { + var this$1 = this; + if ( bindingType === void 0 ) bindingType = BIND_NONE; + + switch (expr.type) { + case "Identifier": + if (this.strict && this.reservedWordsStrictBind.test(expr.name)) + { this.raiseRecoverable(expr.start, (bindingType ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); } + if (checkClashes) { + if (has(checkClashes, expr.name)) + { this.raiseRecoverable(expr.start, "Argument name clash"); } + checkClashes[expr.name] = true; + } + if (bindingType !== BIND_NONE && bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); } + break + + case "MemberExpression": + if (bindingType) { this.raiseRecoverable(expr.start, "Binding member expression"); } + break + + case "ObjectPattern": + for (var i = 0, list = expr.properties; i < list.length; i += 1) + { + var prop = list[i]; + + this$1.checkLVal(prop, bindingType, checkClashes); + } + break + + case "Property": + // AssignmentProperty has type === "Property" + this.checkLVal(expr.value, bindingType, checkClashes); + break + + case "ArrayPattern": + for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) { + var elem = list$1[i$1]; + + if (elem) { this$1.checkLVal(elem, bindingType, checkClashes); } + } + break + + case "AssignmentPattern": + this.checkLVal(expr.left, bindingType, checkClashes); + break + + case "RestElement": + this.checkLVal(expr.argument, bindingType, checkClashes); + break + + case "ParenthesizedExpression": + this.checkLVal(expr.expression, bindingType, checkClashes); + break + + default: + this.raise(expr.start, (bindingType ? "Binding" : "Assigning to") + " rvalue"); + } + }; + + // A recursive descent parser operates by defining functions for all + // syntactic elements, and recursively calling those, each function + // advancing the input stream and returning an AST node. Precedence + // of constructs (for example, the fact that `!x[1]` means `!(x[1])` + // instead of `(!x)[1]` is handled by the fact that the parser + // function that parses unary prefix operators is called first, and + // in turn calls the function that parses `[]` subscripts — that + // way, it'll receive the node for `x[1]` already parsed, and wraps + // *that* in the unary operator node. + // + // Acorn uses an [operator precedence parser][opp] to handle binary + // operator precedence, because it is much more compact than using + // the technique outlined above, which uses different, nesting + // functions to specify precedence, for all of the ten binary + // precedence levels that JavaScript defines. + // + // [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser + + var pp$3 = Parser.prototype; + + // Check if property name clashes with already added. + // Object/class getters and setters are not allowed to clash — + // either with each other or with an init property — and in + // strict mode, init properties are also not allowed to be repeated. + + pp$3.checkPropClash = function(prop, propHash, refDestructuringErrors) { + if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement") + { return } + if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand)) + { return } + var key = prop.key; + var name; + switch (key.type) { + case "Identifier": name = key.name; break + case "Literal": name = String(key.value); break + default: return + } + var kind = prop.kind; + if (this.options.ecmaVersion >= 6) { + if (name === "__proto__" && kind === "init") { + if (propHash.proto) { + if (refDestructuringErrors && refDestructuringErrors.doubleProto < 0) { refDestructuringErrors.doubleProto = key.start; } + // Backwards-compat kludge. Can be removed in version 6.0 + else { this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); } + } + propHash.proto = true; + } + return + } + name = "$" + name; + var other = propHash[name]; + if (other) { + var redefinition; + if (kind === "init") { + redefinition = this.strict && other.init || other.get || other.set; + } else { + redefinition = other.init || other[kind]; + } + if (redefinition) + { this.raiseRecoverable(key.start, "Redefinition of property"); } + } else { + other = propHash[name] = { + init: false, + get: false, + set: false + }; + } + other[kind] = true; + }; + + // ### Expression parsing + + // These nest, from the most general expression type at the top to + // 'atomic', nondivisible expression types at the bottom. Most of + // the functions will simply let the function(s) below them parse, + // and, *if* the syntactic construct they handle is present, wrap + // the AST node that the inner parser gave them in another node. + + // Parse a full expression. The optional arguments are used to + // forbid the `in` operator (in for loops initalization expressions) + // and provide reference for storing '=' operator inside shorthand + // property assignment in contexts where both object expression + // and object pattern might appear (so it's possible to raise + // delayed syntax error at correct position). + + pp$3.parseExpression = function(noIn, refDestructuringErrors) { + var this$1 = this; + + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseMaybeAssign(noIn, refDestructuringErrors); + if (this.type === types.comma) { + var node = this.startNodeAt(startPos, startLoc); + node.expressions = [expr]; + while (this.eat(types.comma)) { node.expressions.push(this$1.parseMaybeAssign(noIn, refDestructuringErrors)); } + return this.finishNode(node, "SequenceExpression") + } + return expr + }; + + // Parse an assignment expression. This includes applications of + // operators like `+=`. + + pp$3.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) { + if (this.isContextual("yield")) { + if (this.inGenerator) { return this.parseYield(noIn) } + // The tokenizer will assume an expression is allowed after + // `yield`, but this isn't that kind of yield + else { this.exprAllowed = false; } + } + + var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldShorthandAssign = -1; + if (refDestructuringErrors) { + oldParenAssign = refDestructuringErrors.parenthesizedAssign; + oldTrailingComma = refDestructuringErrors.trailingComma; + oldShorthandAssign = refDestructuringErrors.shorthandAssign; + refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.shorthandAssign = -1; + } else { + refDestructuringErrors = new DestructuringErrors; + ownDestructuringErrors = true; + } + + var startPos = this.start, startLoc = this.startLoc; + if (this.type === types.parenL || this.type === types.name) + { this.potentialArrowAt = this.start; } + var left = this.parseMaybeConditional(noIn, refDestructuringErrors); + if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); } + if (this.type.isAssign) { + var node = this.startNodeAt(startPos, startLoc); + node.operator = this.value; + node.left = this.type === types.eq ? this.toAssignable(left, false, refDestructuringErrors) : left; + if (!ownDestructuringErrors) { DestructuringErrors.call(refDestructuringErrors); } + refDestructuringErrors.shorthandAssign = -1; // reset because shorthand default was used correctly + this.checkLVal(left); + this.next(); + node.right = this.parseMaybeAssign(noIn); + return this.finishNode(node, "AssignmentExpression") + } else { + if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); } + } + if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; } + if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; } + if (oldShorthandAssign > -1) { refDestructuringErrors.shorthandAssign = oldShorthandAssign; } + return left + }; + + // Parse a ternary conditional (`?:`) operator. + + pp$3.parseMaybeConditional = function(noIn, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseExprOps(noIn, refDestructuringErrors); + if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } + if (this.eat(types.question)) { + var node = this.startNodeAt(startPos, startLoc); + node.test = expr; + node.consequent = this.parseMaybeAssign(); + this.expect(types.colon); + node.alternate = this.parseMaybeAssign(noIn); + return this.finishNode(node, "ConditionalExpression") + } + return expr + }; + + // Start the precedence parser. + + pp$3.parseExprOps = function(noIn, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseMaybeUnary(refDestructuringErrors, false); + if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } + return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, noIn) + }; + + // Parse binary operators with the operator precedence parsing + // algorithm. `left` is the left-hand side of the operator. + // `minPrec` provides context that allows the function to stop and + // defer further parser to one of its callers when it encounters an + // operator that has a lower precedence than the set it is parsing. + + pp$3.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, noIn) { + var prec = this.type.binop; + if (prec != null && (!noIn || this.type !== types._in)) { + if (prec > minPrec) { + var logical = this.type === types.logicalOR || this.type === types.logicalAND; + var op = this.value; + this.next(); + var startPos = this.start, startLoc = this.startLoc; + var right = this.parseExprOp(this.parseMaybeUnary(null, false), startPos, startLoc, prec, noIn); + var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical); + return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn) + } + } + return left + }; + + pp$3.buildBinary = function(startPos, startLoc, left, right, op, logical) { + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.operator = op; + node.right = right; + return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression") + }; + + // Parse unary operators, both prefix and postfix. + + pp$3.parseMaybeUnary = function(refDestructuringErrors, sawUnary) { + var this$1 = this; + + var startPos = this.start, startLoc = this.startLoc, expr; + if (this.isContextual("await") && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction))) { + expr = this.parseAwait(); + sawUnary = true; + } else if (this.type.prefix) { + var node = this.startNode(), update = this.type === types.incDec; + node.operator = this.value; + node.prefix = true; + this.next(); + node.argument = this.parseMaybeUnary(null, true); + this.checkExpressionErrors(refDestructuringErrors, true); + if (update) { this.checkLVal(node.argument); } + else if (this.strict && node.operator === "delete" && + node.argument.type === "Identifier") + { this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); } + else { sawUnary = true; } + expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); + } else { + expr = this.parseExprSubscripts(refDestructuringErrors); + if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } + while (this.type.postfix && !this.canInsertSemicolon()) { + var node$1 = this$1.startNodeAt(startPos, startLoc); + node$1.operator = this$1.value; + node$1.prefix = false; + node$1.argument = expr; + this$1.checkLVal(expr); + this$1.next(); + expr = this$1.finishNode(node$1, "UpdateExpression"); + } + } + + if (!sawUnary && this.eat(types.starstar)) + { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false), "**", false) } + else + { return expr } + }; + + // Parse call, dot, and `[]`-subscript expressions. + + pp$3.parseExprSubscripts = function(refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseExprAtom(refDestructuringErrors); + var skipArrowSubscripts = expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")"; + if (this.checkExpressionErrors(refDestructuringErrors) || skipArrowSubscripts) { return expr } + var result = this.parseSubscripts(expr, startPos, startLoc); + if (refDestructuringErrors && result.type === "MemberExpression") { + if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; } + if (refDestructuringErrors.parenthesizedBind >= result.start) { refDestructuringErrors.parenthesizedBind = -1; } + } + return result + }; + + pp$3.parseSubscripts = function(base, startPos, startLoc, noCalls) { + var this$1 = this; + + var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" && + this.lastTokEnd === base.end && !this.canInsertSemicolon() && this.input.slice(base.start, base.end) === "async"; + while (true) { + var element = this$1.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow); + if (element === base || element.type === "ArrowFunctionExpression") { return element } + base = element; + } + }; + + pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow) { + var computed = this.eat(types.bracketL); + if (computed || this.eat(types.dot)) { + var node = this.startNodeAt(startPos, startLoc); + node.object = base; + node.property = computed ? this.parseExpression() : this.parseIdent(true); + node.computed = !!computed; + if (computed) { this.expect(types.bracketR); } + base = this.finishNode(node, "MemberExpression"); + } else if (!noCalls && this.eat(types.parenL)) { + var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + var exprList = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors); + if (maybeAsyncArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) { + this.checkPatternErrors(refDestructuringErrors, false); + this.checkYieldAwaitInDefaultParams(); + if (this.awaitIdentPos > 0) + { this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"); } + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true) + } + this.checkExpressionErrors(refDestructuringErrors, true); + this.yieldPos = oldYieldPos || this.yieldPos; + this.awaitPos = oldAwaitPos || this.awaitPos; + this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos; + var node$1 = this.startNodeAt(startPos, startLoc); + node$1.callee = base; + node$1.arguments = exprList; + base = this.finishNode(node$1, "CallExpression"); + } else if (this.type === types.backQuote) { + var node$2 = this.startNodeAt(startPos, startLoc); + node$2.tag = base; + node$2.quasi = this.parseTemplate({isTagged: true}); + base = this.finishNode(node$2, "TaggedTemplateExpression"); + } + return base + }; + + // Parse an atomic expression — either a single token that is an + // expression, an expression started by a keyword like `function` or + // `new`, or an expression wrapped in punctuation like `()`, `[]`, + // or `{}`. + + pp$3.parseExprAtom = function(refDestructuringErrors) { + // If a division operator appears in an expression position, the + // tokenizer got confused, and we force it to read a regexp instead. + if (this.type === types.slash) { this.readRegexp(); } + + var node, canBeArrow = this.potentialArrowAt === this.start; + switch (this.type) { + case types._super: + if (!this.allowSuper) + { this.raise(this.start, "'super' keyword outside a method"); } + node = this.startNode(); + this.next(); + if (this.type === types.parenL && !this.allowDirectSuper) + { this.raise(node.start, "super() call outside constructor of a subclass"); } + // The `super` keyword can appear at below: + // SuperProperty: + // super [ Expression ] + // super . IdentifierName + // SuperCall: + // super Arguments + if (this.type !== types.dot && this.type !== types.bracketL && this.type !== types.parenL) + { this.unexpected(); } + return this.finishNode(node, "Super") + + case types._this: + node = this.startNode(); + this.next(); + return this.finishNode(node, "ThisExpression") + + case types.name: + var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc; + var id = this.parseIdent(false); + if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types._function)) + { return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true) } + if (canBeArrow && !this.canInsertSemicolon()) { + if (this.eat(types.arrow)) + { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false) } + if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types.name && !containsEsc) { + id = this.parseIdent(false); + if (this.canInsertSemicolon() || !this.eat(types.arrow)) + { this.unexpected(); } + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true) + } + } + return id + + case types.regexp: + var value = this.value; + node = this.parseLiteral(value.value); + node.regex = {pattern: value.pattern, flags: value.flags}; + return node + + case types.num: case types.string: + return this.parseLiteral(this.value) + + case types._null: case types._true: case types._false: + node = this.startNode(); + node.value = this.type === types._null ? null : this.type === types._true; + node.raw = this.type.keyword; + this.next(); + return this.finishNode(node, "Literal") + + case types.parenL: + var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow); + if (refDestructuringErrors) { + if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr)) + { refDestructuringErrors.parenthesizedAssign = start; } + if (refDestructuringErrors.parenthesizedBind < 0) + { refDestructuringErrors.parenthesizedBind = start; } + } + return expr + + case types.bracketL: + node = this.startNode(); + this.next(); + node.elements = this.parseExprList(types.bracketR, true, true, refDestructuringErrors); + return this.finishNode(node, "ArrayExpression") + + case types.braceL: + return this.parseObj(false, refDestructuringErrors) + + case types._function: + node = this.startNode(); + this.next(); + return this.parseFunction(node, 0) + + case types._class: + return this.parseClass(this.startNode(), false) + + case types._new: + return this.parseNew() + + case types.backQuote: + return this.parseTemplate() + + default: + this.unexpected(); + } + }; + + pp$3.parseLiteral = function(value) { + var node = this.startNode(); + node.value = value; + node.raw = this.input.slice(this.start, this.end); + this.next(); + return this.finishNode(node, "Literal") + }; + + pp$3.parseParenExpression = function() { + this.expect(types.parenL); + var val = this.parseExpression(); + this.expect(types.parenR); + return val + }; + + pp$3.parseParenAndDistinguishExpression = function(canBeArrow) { + var this$1 = this; + + var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8; + if (this.options.ecmaVersion >= 6) { + this.next(); + + var innerStartPos = this.start, innerStartLoc = this.startLoc; + var exprList = [], first = true, lastIsComma = false; + var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart; + this.yieldPos = 0; + this.awaitPos = 0; + // Do not save awaitIdentPos to allow checking awaits nested in parameters + while (this.type !== types.parenR) { + first ? first = false : this$1.expect(types.comma); + if (allowTrailingComma && this$1.afterTrailingComma(types.parenR, true)) { + lastIsComma = true; + break + } else if (this$1.type === types.ellipsis) { + spreadStart = this$1.start; + exprList.push(this$1.parseParenItem(this$1.parseRestBinding())); + if (this$1.type === types.comma) { this$1.raise(this$1.start, "Comma is not permitted after the rest element"); } + break + } else { + exprList.push(this$1.parseMaybeAssign(false, refDestructuringErrors, this$1.parseParenItem)); + } + } + var innerEndPos = this.start, innerEndLoc = this.startLoc; + this.expect(types.parenR); + + if (canBeArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) { + this.checkPatternErrors(refDestructuringErrors, false); + this.checkYieldAwaitInDefaultParams(); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + return this.parseParenArrowList(startPos, startLoc, exprList) + } + + if (!exprList.length || lastIsComma) { this.unexpected(this.lastTokStart); } + if (spreadStart) { this.unexpected(spreadStart); } + this.checkExpressionErrors(refDestructuringErrors, true); + this.yieldPos = oldYieldPos || this.yieldPos; + this.awaitPos = oldAwaitPos || this.awaitPos; + + if (exprList.length > 1) { + val = this.startNodeAt(innerStartPos, innerStartLoc); + val.expressions = exprList; + this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); + } else { + val = exprList[0]; + } + } else { + val = this.parseParenExpression(); + } + + if (this.options.preserveParens) { + var par = this.startNodeAt(startPos, startLoc); + par.expression = val; + return this.finishNode(par, "ParenthesizedExpression") + } else { + return val + } + }; + + pp$3.parseParenItem = function(item) { + return item + }; + + pp$3.parseParenArrowList = function(startPos, startLoc, exprList) { + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList) + }; + + // New's precedence is slightly tricky. It must allow its argument to + // be a `[]` or dot subscript expression, but not a call — at least, + // not without wrapping it in parentheses. Thus, it uses the noCalls + // argument to parseSubscripts to prevent it from consuming the + // argument list. + + var empty$1 = []; + + pp$3.parseNew = function() { + var node = this.startNode(); + var meta = this.parseIdent(true); + if (this.options.ecmaVersion >= 6 && this.eat(types.dot)) { + node.meta = meta; + var containsEsc = this.containsEsc; + node.property = this.parseIdent(true); + if (node.property.name !== "target" || containsEsc) + { this.raiseRecoverable(node.property.start, "The only valid meta property for new is new.target"); } + if (!this.inNonArrowFunction()) + { this.raiseRecoverable(node.start, "new.target can only be used in functions"); } + return this.finishNode(node, "MetaProperty") + } + var startPos = this.start, startLoc = this.startLoc; + node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true); + if (this.eat(types.parenL)) { node.arguments = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false); } + else { node.arguments = empty$1; } + return this.finishNode(node, "NewExpression") + }; + + // Parse template expression. + + pp$3.parseTemplateElement = function(ref) { + var isTagged = ref.isTagged; + + var elem = this.startNode(); + if (this.type === types.invalidTemplate) { + if (!isTagged) { + this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"); + } + elem.value = { + raw: this.value, + cooked: null + }; + } else { + elem.value = { + raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"), + cooked: this.value + }; + } + this.next(); + elem.tail = this.type === types.backQuote; + return this.finishNode(elem, "TemplateElement") + }; + + pp$3.parseTemplate = function(ref) { + var this$1 = this; + if ( ref === void 0 ) ref = {}; + var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false; + + var node = this.startNode(); + this.next(); + node.expressions = []; + var curElt = this.parseTemplateElement({isTagged: isTagged}); + node.quasis = [curElt]; + while (!curElt.tail) { + if (this$1.type === types.eof) { this$1.raise(this$1.pos, "Unterminated template literal"); } + this$1.expect(types.dollarBraceL); + node.expressions.push(this$1.parseExpression()); + this$1.expect(types.braceR); + node.quasis.push(curElt = this$1.parseTemplateElement({isTagged: isTagged})); + } + this.next(); + return this.finishNode(node, "TemplateLiteral") + }; + + pp$3.isAsyncProp = function(prop) { + return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && + (this.type === types.name || this.type === types.num || this.type === types.string || this.type === types.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types.star)) && + !lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) + }; + + // Parse an object literal or binding pattern. + + pp$3.parseObj = function(isPattern, refDestructuringErrors) { + var this$1 = this; + + var node = this.startNode(), first = true, propHash = {}; + node.properties = []; + this.next(); + while (!this.eat(types.braceR)) { + if (!first) { + this$1.expect(types.comma); + if (this$1.afterTrailingComma(types.braceR)) { break } + } else { first = false; } + + var prop = this$1.parseProperty(isPattern, refDestructuringErrors); + if (!isPattern) { this$1.checkPropClash(prop, propHash, refDestructuringErrors); } + node.properties.push(prop); + } + return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression") + }; + + pp$3.parseProperty = function(isPattern, refDestructuringErrors) { + var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc; + if (this.options.ecmaVersion >= 9 && this.eat(types.ellipsis)) { + if (isPattern) { + prop.argument = this.parseIdent(false); + if (this.type === types.comma) { + this.raise(this.start, "Comma is not permitted after the rest element"); + } + return this.finishNode(prop, "RestElement") + } + // To disallow parenthesized identifier via `this.toAssignable()`. + if (this.type === types.parenL && refDestructuringErrors) { + if (refDestructuringErrors.parenthesizedAssign < 0) { + refDestructuringErrors.parenthesizedAssign = this.start; + } + if (refDestructuringErrors.parenthesizedBind < 0) { + refDestructuringErrors.parenthesizedBind = this.start; + } + } + // Parse argument. + prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); + // To disallow trailing comma via `this.toAssignable()`. + if (this.type === types.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { + refDestructuringErrors.trailingComma = this.start; + } + // Finish + return this.finishNode(prop, "SpreadElement") + } + if (this.options.ecmaVersion >= 6) { + prop.method = false; + prop.shorthand = false; + if (isPattern || refDestructuringErrors) { + startPos = this.start; + startLoc = this.startLoc; + } + if (!isPattern) + { isGenerator = this.eat(types.star); } + } + var containsEsc = this.containsEsc; + this.parsePropertyName(prop); + if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) { + isAsync = true; + isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star); + this.parsePropertyName(prop, refDestructuringErrors); + } else { + isAsync = false; + } + this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc); + return this.finishNode(prop, "Property") + }; + + pp$3.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { + if ((isGenerator || isAsync) && this.type === types.colon) + { this.unexpected(); } + + if (this.eat(types.colon)) { + prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors); + prop.kind = "init"; + } else if (this.options.ecmaVersion >= 6 && this.type === types.parenL) { + if (isPattern) { this.unexpected(); } + prop.kind = "init"; + prop.method = true; + prop.value = this.parseMethod(isGenerator, isAsync); + } else if (!isPattern && !containsEsc && + this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && + (prop.key.name === "get" || prop.key.name === "set") && + (this.type !== types.comma && this.type !== types.braceR)) { + if (isGenerator || isAsync) { this.unexpected(); } + prop.kind = prop.key.name; + this.parsePropertyName(prop); + prop.value = this.parseMethod(false); + var paramCount = prop.kind === "get" ? 0 : 1; + if (prop.value.params.length !== paramCount) { + var start = prop.value.start; + if (prop.kind === "get") + { this.raiseRecoverable(start, "getter should have no params"); } + else + { this.raiseRecoverable(start, "setter should have exactly one param"); } + } else { + if (prop.kind === "set" && prop.value.params[0].type === "RestElement") + { this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); } + } + } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") { + if (isGenerator || isAsync) { this.unexpected(); } + this.checkUnreserved(prop.key); + if (prop.key.name === "await" && !this.awaitIdentPos) + { this.awaitIdentPos = startPos; } + prop.kind = "init"; + if (isPattern) { + prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key); + } else if (this.type === types.eq && refDestructuringErrors) { + if (refDestructuringErrors.shorthandAssign < 0) + { refDestructuringErrors.shorthandAssign = this.start; } + prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key); + } else { + prop.value = prop.key; + } + prop.shorthand = true; + } else { this.unexpected(); } + }; + + pp$3.parsePropertyName = function(prop) { + if (this.options.ecmaVersion >= 6) { + if (this.eat(types.bracketL)) { + prop.computed = true; + prop.key = this.parseMaybeAssign(); + this.expect(types.bracketR); + return prop.key + } else { + prop.computed = false; + } + } + return prop.key = this.type === types.num || this.type === types.string ? this.parseExprAtom() : this.parseIdent(true) + }; + + // Initialize empty function node. + + pp$3.initFunction = function(node) { + node.id = null; + if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; } + if (this.options.ecmaVersion >= 8) { node.async = false; } + }; + + // Parse object or class method. + + pp$3.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { + var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + + this.initFunction(node); + if (this.options.ecmaVersion >= 6) + { node.generator = isGenerator; } + if (this.options.ecmaVersion >= 8) + { node.async = !!isAsync; } + + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)); + + this.expect(types.parenL); + node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8); + this.checkYieldAwaitInDefaultParams(); + this.parseFunctionBody(node, false, true); + + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, "FunctionExpression") + }; + + // Parse arrow function expression with given parameters. + + pp$3.parseArrowExpression = function(node, params, isAsync) { + var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + + this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW); + this.initFunction(node); + if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; } + + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + + node.params = this.toAssignableList(params, true); + this.parseFunctionBody(node, true, false); + + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, "ArrowFunctionExpression") + }; + + // Parse function body and check parameters. + + pp$3.parseFunctionBody = function(node, isArrowFunction, isMethod) { + var isExpression = isArrowFunction && this.type !== types.braceL; + var oldStrict = this.strict, useStrict = false; + + if (isExpression) { + node.body = this.parseMaybeAssign(); + node.expression = true; + this.checkParams(node, false); + } else { + var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params); + if (!oldStrict || nonSimple) { + useStrict = this.strictDirective(this.end); + // If this is a strict mode function, verify that argument names + // are not repeated, and it does not try to bind the words `eval` + // or `arguments`. + if (useStrict && nonSimple) + { this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); } + } + // Start a new scope with regard to labels and the `inFunction` + // flag (restore them to their old value afterwards). + var oldLabels = this.labels; + this.labels = []; + if (useStrict) { this.strict = true; } + + // Add the params to varDeclaredNames to ensure that an error is thrown + // if a let/const declaration in the function clashes with one of the params. + this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params)); + node.body = this.parseBlock(false); + node.expression = false; + this.adaptDirectivePrologue(node.body.body); + this.labels = oldLabels; + } + this.exitScope(); + + // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval' + if (this.strict && node.id) { this.checkLVal(node.id, BIND_OUTSIDE); } + this.strict = oldStrict; + }; + + pp$3.isSimpleParamList = function(params) { + for (var i = 0, list = params; i < list.length; i += 1) + { + var param = list[i]; + + if (param.type !== "Identifier") { return false + } } + return true + }; + + // Checks function params for various disallowed patterns such as using "eval" + // or "arguments" and duplicate parameters. + + pp$3.checkParams = function(node, allowDuplicates) { + var this$1 = this; + + var nameHash = {}; + for (var i = 0, list = node.params; i < list.length; i += 1) + { + var param = list[i]; + + this$1.checkLVal(param, BIND_VAR, allowDuplicates ? null : nameHash); + } + }; + + // Parses a comma-separated list of expressions, and returns them as + // an array. `close` is the token type that ends the list, and + // `allowEmpty` can be turned on to allow subsequent commas with + // nothing in between them to be parsed as `null` (which is needed + // for array literals). + + pp$3.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { + var this$1 = this; + + var elts = [], first = true; + while (!this.eat(close)) { + if (!first) { + this$1.expect(types.comma); + if (allowTrailingComma && this$1.afterTrailingComma(close)) { break } + } else { first = false; } + + var elt = (void 0); + if (allowEmpty && this$1.type === types.comma) + { elt = null; } + else if (this$1.type === types.ellipsis) { + elt = this$1.parseSpread(refDestructuringErrors); + if (refDestructuringErrors && this$1.type === types.comma && refDestructuringErrors.trailingComma < 0) + { refDestructuringErrors.trailingComma = this$1.start; } + } else { + elt = this$1.parseMaybeAssign(false, refDestructuringErrors); + } + elts.push(elt); + } + return elts + }; + + pp$3.checkUnreserved = function(ref) { + var start = ref.start; + var end = ref.end; + var name = ref.name; + + if (this.inGenerator && name === "yield") + { this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator"); } + if (this.inAsync && name === "await") + { this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function"); } + if (this.keywords.test(name)) + { this.raise(start, ("Unexpected keyword '" + name + "'")); } + if (this.options.ecmaVersion < 6 && + this.input.slice(start, end).indexOf("\\") !== -1) { return } + var re = this.strict ? this.reservedWordsStrict : this.reservedWords; + if (re.test(name)) { + if (!this.inAsync && name === "await") + { this.raiseRecoverable(start, "Cannot use keyword 'await' outside an async function"); } + this.raiseRecoverable(start, ("The keyword '" + name + "' is reserved")); + } + }; + + // Parse the next token as an identifier. If `liberal` is true (used + // when parsing properties), it will also convert keywords into + // identifiers. + + pp$3.parseIdent = function(liberal, isBinding) { + var node = this.startNode(); + if (liberal && this.options.allowReserved === "never") { liberal = false; } + if (this.type === types.name) { + node.name = this.value; + } else if (this.type.keyword) { + node.name = this.type.keyword; + + // To fix https://github.com/acornjs/acorn/issues/575 + // `class` and `function` keywords push new context into this.context. + // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name. + // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword + if ((node.name === "class" || node.name === "function") && + (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) { + this.context.pop(); + } + } else { + this.unexpected(); + } + this.next(); + this.finishNode(node, "Identifier"); + if (!liberal) { + this.checkUnreserved(node); + if (node.name === "await" && !this.awaitIdentPos) + { this.awaitIdentPos = node.start; } + } + return node + }; + + // Parses yield expression inside generator. + + pp$3.parseYield = function(noIn) { + if (!this.yieldPos) { this.yieldPos = this.start; } + + var node = this.startNode(); + this.next(); + if (this.type === types.semi || this.canInsertSemicolon() || (this.type !== types.star && !this.type.startsExpr)) { + node.delegate = false; + node.argument = null; + } else { + node.delegate = this.eat(types.star); + node.argument = this.parseMaybeAssign(noIn); + } + return this.finishNode(node, "YieldExpression") + }; + + pp$3.parseAwait = function() { + if (!this.awaitPos) { this.awaitPos = this.start; } + + var node = this.startNode(); + this.next(); + node.argument = this.parseMaybeUnary(null, true); + return this.finishNode(node, "AwaitExpression") + }; + + var pp$4 = Parser.prototype; + + // This function is used to raise exceptions on parse errors. It + // takes an offset integer (into the current `input`) to indicate + // the location of the error, attaches the position to the end + // of the error message, and then raises a `SyntaxError` with that + // message. + + pp$4.raise = function(pos, message) { + var loc = getLineInfo(this.input, pos); + message += " (" + loc.line + ":" + loc.column + ")"; + var err = new SyntaxError(message); + err.pos = pos; err.loc = loc; err.raisedAt = this.pos; + throw err + }; + + pp$4.raiseRecoverable = pp$4.raise; + + pp$4.curPosition = function() { + if (this.options.locations) { + return new Position(this.curLine, this.pos - this.lineStart) + } + }; + + var pp$5 = Parser.prototype; + + var Scope = function Scope(flags) { + this.flags = flags; + // A list of var-declared names in the current lexical scope + this.var = []; + // A list of lexically-declared names in the current lexical scope + this.lexical = []; + // A list of lexically-declared FunctionDeclaration names in the current lexical scope + this.functions = []; + }; + + // The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names. + + pp$5.enterScope = function(flags) { + this.scopeStack.push(new Scope(flags)); + }; + + pp$5.exitScope = function() { + this.scopeStack.pop(); + }; + + // The spec says: + // > At the top level of a function, or script, function declarations are + // > treated like var declarations rather than like lexical declarations. + pp$5.treatFunctionsAsVarInScope = function(scope) { + return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP) + }; + + pp$5.declareName = function(name, bindingType, pos) { + var this$1 = this; + + var redeclared = false; + if (bindingType === BIND_LEXICAL) { + var scope = this.currentScope(); + redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1; + scope.lexical.push(name); + if (this.inModule && (scope.flags & SCOPE_TOP)) + { delete this.undefinedExports[name]; } + } else if (bindingType === BIND_SIMPLE_CATCH) { + var scope$1 = this.currentScope(); + scope$1.lexical.push(name); + } else if (bindingType === BIND_FUNCTION) { + var scope$2 = this.currentScope(); + if (this.treatFunctionsAsVar) + { redeclared = scope$2.lexical.indexOf(name) > -1; } + else + { redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1; } + scope$2.functions.push(name); + } else { + for (var i = this.scopeStack.length - 1; i >= 0; --i) { + var scope$3 = this$1.scopeStack[i]; + if (scope$3.lexical.indexOf(name) > -1 && !((scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name) || + !this$1.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) { + redeclared = true; + break + } + scope$3.var.push(name); + if (this$1.inModule && (scope$3.flags & SCOPE_TOP)) + { delete this$1.undefinedExports[name]; } + if (scope$3.flags & SCOPE_VAR) { break } + } + } + if (redeclared) { this.raiseRecoverable(pos, ("Identifier '" + name + "' has already been declared")); } + }; + + pp$5.checkLocalExport = function(id) { + // scope.functions must be empty as Module code is always strict. + if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && + this.scopeStack[0].var.indexOf(id.name) === -1) { + this.undefinedExports[id.name] = id; + } + }; + + pp$5.currentScope = function() { + return this.scopeStack[this.scopeStack.length - 1] + }; + + pp$5.currentVarScope = function() { + var this$1 = this; + + for (var i = this.scopeStack.length - 1;; i--) { + var scope = this$1.scopeStack[i]; + if (scope.flags & SCOPE_VAR) { return scope } + } + }; + + // Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`. + pp$5.currentThisScope = function() { + var this$1 = this; + + for (var i = this.scopeStack.length - 1;; i--) { + var scope = this$1.scopeStack[i]; + if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { return scope } + } + }; + + var Node = function Node(parser, pos, loc) { + this.type = ""; + this.start = pos; + this.end = 0; + if (parser.options.locations) + { this.loc = new SourceLocation(parser, loc); } + if (parser.options.directSourceFile) + { this.sourceFile = parser.options.directSourceFile; } + if (parser.options.ranges) + { this.range = [pos, 0]; } + }; + + // Start an AST node, attaching a start offset. + + var pp$6 = Parser.prototype; + + pp$6.startNode = function() { + return new Node(this, this.start, this.startLoc) + }; + + pp$6.startNodeAt = function(pos, loc) { + return new Node(this, pos, loc) + }; + + // Finish an AST node, adding `type` and `end` properties. + + function finishNodeAt(node, type, pos, loc) { + node.type = type; + node.end = pos; + if (this.options.locations) + { node.loc.end = loc; } + if (this.options.ranges) + { node.range[1] = pos; } + return node + } + + pp$6.finishNode = function(node, type) { + return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc) + }; + + // Finish node at given position + + pp$6.finishNodeAt = function(node, type, pos, loc) { + return finishNodeAt.call(this, node, type, pos, loc) + }; + + // The algorithm used to determine whether a regexp can appear at a + // given point in the program is loosely based on sweet.js' approach. + // See https://github.com/mozilla/sweet.js/wiki/design + + var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) { + this.token = token; + this.isExpr = !!isExpr; + this.preserveSpace = !!preserveSpace; + this.override = override; + this.generator = !!generator; + }; + + var types$1 = { + b_stat: new TokContext("{", false), + b_expr: new TokContext("{", true), + b_tmpl: new TokContext("${", false), + p_stat: new TokContext("(", false), + p_expr: new TokContext("(", true), + q_tmpl: new TokContext("`", true, true, function (p) { return p.tryReadTemplateToken(); }), + f_stat: new TokContext("function", false), + f_expr: new TokContext("function", true), + f_expr_gen: new TokContext("function", true, false, null, true), + f_gen: new TokContext("function", false, false, null, true) + }; + + var pp$7 = Parser.prototype; + + pp$7.initialContext = function() { + return [types$1.b_stat] + }; + + pp$7.braceIsBlock = function(prevType) { + var parent = this.curContext(); + if (parent === types$1.f_expr || parent === types$1.f_stat) + { return true } + if (prevType === types.colon && (parent === types$1.b_stat || parent === types$1.b_expr)) + { return !parent.isExpr } + + // The check for `tt.name && exprAllowed` detects whether we are + // after a `yield` or `of` construct. See the `updateContext` for + // `tt.name`. + if (prevType === types._return || prevType === types.name && this.exprAllowed) + { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) } + if (prevType === types._else || prevType === types.semi || prevType === types.eof || prevType === types.parenR || prevType === types.arrow) + { return true } + if (prevType === types.braceL) + { return parent === types$1.b_stat } + if (prevType === types._var || prevType === types._const || prevType === types.name) + { return false } + return !this.exprAllowed + }; + + pp$7.inGeneratorContext = function() { + var this$1 = this; + + for (var i = this.context.length - 1; i >= 1; i--) { + var context = this$1.context[i]; + if (context.token === "function") + { return context.generator } + } + return false + }; + + pp$7.updateContext = function(prevType) { + var update, type = this.type; + if (type.keyword && prevType === types.dot) + { this.exprAllowed = false; } + else if (update = type.updateContext) + { update.call(this, prevType); } + else + { this.exprAllowed = type.beforeExpr; } + }; + + // Token-specific context update code + + types.parenR.updateContext = types.braceR.updateContext = function() { + if (this.context.length === 1) { + this.exprAllowed = true; + return + } + var out = this.context.pop(); + if (out === types$1.b_stat && this.curContext().token === "function") { + out = this.context.pop(); + } + this.exprAllowed = !out.isExpr; + }; + + types.braceL.updateContext = function(prevType) { + this.context.push(this.braceIsBlock(prevType) ? types$1.b_stat : types$1.b_expr); + this.exprAllowed = true; + }; + + types.dollarBraceL.updateContext = function() { + this.context.push(types$1.b_tmpl); + this.exprAllowed = true; + }; + + types.parenL.updateContext = function(prevType) { + var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while; + this.context.push(statementParens ? types$1.p_stat : types$1.p_expr); + this.exprAllowed = true; + }; + + types.incDec.updateContext = function() { + // tokExprAllowed stays unchanged + }; + + types._function.updateContext = types._class.updateContext = function(prevType) { + if (prevType.beforeExpr && prevType !== types.semi && prevType !== types._else && + !(prevType === types._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) && + !((prevType === types.colon || prevType === types.braceL) && this.curContext() === types$1.b_stat)) + { this.context.push(types$1.f_expr); } + else + { this.context.push(types$1.f_stat); } + this.exprAllowed = false; + }; + + types.backQuote.updateContext = function() { + if (this.curContext() === types$1.q_tmpl) + { this.context.pop(); } + else + { this.context.push(types$1.q_tmpl); } + this.exprAllowed = false; + }; + + types.star.updateContext = function(prevType) { + if (prevType === types._function) { + var index = this.context.length - 1; + if (this.context[index] === types$1.f_expr) + { this.context[index] = types$1.f_expr_gen; } + else + { this.context[index] = types$1.f_gen; } + } + this.exprAllowed = true; + }; + + types.name.updateContext = function(prevType) { + var allowed = false; + if (this.options.ecmaVersion >= 6 && prevType !== types.dot) { + if (this.value === "of" && !this.exprAllowed || + this.value === "yield" && this.inGeneratorContext()) + { allowed = true; } + } + this.exprAllowed = allowed; + }; + + // This file contains Unicode properties extracted from the ECMAScript + // specification. The lists are extracted like so: + // $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText) + + // #table-binary-unicode-properties + var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS"; + var unicodeBinaryProperties = { + 9: ecma9BinaryProperties, + 10: ecma9BinaryProperties + " Extended_Pictographic" + }; + + // #table-unicode-general-category-values + var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu"; + + // #table-unicode-script-values + var ecma9ScriptValues = "Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb"; + var unicodeScriptValues = { + 9: ecma9ScriptValues, + 10: ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd" + }; + + var data = {}; + function buildUnicodeData(ecmaVersion) { + var d = data[ecmaVersion] = { + binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues), + nonBinary: { + General_Category: wordsRegexp(unicodeGeneralCategoryValues), + Script: wordsRegexp(unicodeScriptValues[ecmaVersion]) + } + }; + d.nonBinary.Script_Extensions = d.nonBinary.Script; + + d.nonBinary.gc = d.nonBinary.General_Category; + d.nonBinary.sc = d.nonBinary.Script; + d.nonBinary.scx = d.nonBinary.Script_Extensions; + } + buildUnicodeData(9); + buildUnicodeData(10); + + var pp$9 = Parser.prototype; + + var RegExpValidationState = function RegExpValidationState(parser) { + this.parser = parser; + this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : ""); + this.unicodeProperties = data[parser.options.ecmaVersion >= 10 ? 10 : parser.options.ecmaVersion]; + this.source = ""; + this.flags = ""; + this.start = 0; + this.switchU = false; + this.switchN = false; + this.pos = 0; + this.lastIntValue = 0; + this.lastStringValue = ""; + this.lastAssertionIsQuantifiable = false; + this.numCapturingParens = 0; + this.maxBackReference = 0; + this.groupNames = []; + this.backReferenceNames = []; + }; + + RegExpValidationState.prototype.reset = function reset (start, pattern, flags) { + var unicode = flags.indexOf("u") !== -1; + this.start = start | 0; + this.source = pattern + ""; + this.flags = flags; + this.switchU = unicode && this.parser.options.ecmaVersion >= 6; + this.switchN = unicode && this.parser.options.ecmaVersion >= 9; + }; + + RegExpValidationState.prototype.raise = function raise (message) { + this.parser.raiseRecoverable(this.start, ("Invalid regular expression: /" + (this.source) + "/: " + message)); + }; + + // If u flag is given, this returns the code point at the index (it combines a surrogate pair). + // Otherwise, this returns the code unit of the index (can be a part of a surrogate pair). + RegExpValidationState.prototype.at = function at (i) { + var s = this.source; + var l = s.length; + if (i >= l) { + return -1 + } + var c = s.charCodeAt(i); + if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) { + return c + } + return (c << 10) + s.charCodeAt(i + 1) - 0x35FDC00 + }; + + RegExpValidationState.prototype.nextIndex = function nextIndex (i) { + var s = this.source; + var l = s.length; + if (i >= l) { + return l + } + var c = s.charCodeAt(i); + if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) { + return i + 1 + } + return i + 2 + }; + + RegExpValidationState.prototype.current = function current () { + return this.at(this.pos) + }; + + RegExpValidationState.prototype.lookahead = function lookahead () { + return this.at(this.nextIndex(this.pos)) + }; + + RegExpValidationState.prototype.advance = function advance () { + this.pos = this.nextIndex(this.pos); + }; + + RegExpValidationState.prototype.eat = function eat (ch) { + if (this.current() === ch) { + this.advance(); + return true + } + return false + }; + + function codePointToString$1(ch) { + if (ch <= 0xFFFF) { return String.fromCharCode(ch) } + ch -= 0x10000; + return String.fromCharCode((ch >> 10) + 0xD800, (ch & 0x03FF) + 0xDC00) + } + + /** + * Validate the flags part of a given RegExpLiteral. + * + * @param {RegExpValidationState} state The state to validate RegExp. + * @returns {void} + */ + pp$9.validateRegExpFlags = function(state) { + var this$1 = this; + + var validFlags = state.validFlags; + var flags = state.flags; + + for (var i = 0; i < flags.length; i++) { + var flag = flags.charAt(i); + if (validFlags.indexOf(flag) === -1) { + this$1.raise(state.start, "Invalid regular expression flag"); + } + if (flags.indexOf(flag, i + 1) > -1) { + this$1.raise(state.start, "Duplicate regular expression flag"); + } + } + }; + + /** + * Validate the pattern part of a given RegExpLiteral. + * + * @param {RegExpValidationState} state The state to validate RegExp. + * @returns {void} + */ + pp$9.validateRegExpPattern = function(state) { + this.regexp_pattern(state); + + // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of + // parsing contains a |GroupName|, reparse with the goal symbol + // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError* + // exception if _P_ did not conform to the grammar, if any elements of _P_ + // were not matched by the parse, or if any Early Error conditions exist. + if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) { + state.switchN = true; + this.regexp_pattern(state); + } + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern + pp$9.regexp_pattern = function(state) { + state.pos = 0; + state.lastIntValue = 0; + state.lastStringValue = ""; + state.lastAssertionIsQuantifiable = false; + state.numCapturingParens = 0; + state.maxBackReference = 0; + state.groupNames.length = 0; + state.backReferenceNames.length = 0; + + this.regexp_disjunction(state); + + if (state.pos !== state.source.length) { + // Make the same messages as V8. + if (state.eat(0x29 /* ) */)) { + state.raise("Unmatched ')'"); + } + if (state.eat(0x5D /* [ */) || state.eat(0x7D /* } */)) { + state.raise("Lone quantifier brackets"); + } + } + if (state.maxBackReference > state.numCapturingParens) { + state.raise("Invalid escape"); + } + for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) { + var name = list[i]; + + if (state.groupNames.indexOf(name) === -1) { + state.raise("Invalid named capture referenced"); + } + } + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction + pp$9.regexp_disjunction = function(state) { + var this$1 = this; + + this.regexp_alternative(state); + while (state.eat(0x7C /* | */)) { + this$1.regexp_alternative(state); + } + + // Make the same message as V8. + if (this.regexp_eatQuantifier(state, true)) { + state.raise("Nothing to repeat"); + } + if (state.eat(0x7B /* { */)) { + state.raise("Lone quantifier brackets"); + } + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative + pp$9.regexp_alternative = function(state) { + while (state.pos < state.source.length && this.regexp_eatTerm(state)) + { } + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term + pp$9.regexp_eatTerm = function(state) { + if (this.regexp_eatAssertion(state)) { + // Handle `QuantifiableAssertion Quantifier` alternative. + // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion + // is a QuantifiableAssertion. + if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) { + // Make the same message as V8. + if (state.switchU) { + state.raise("Invalid quantifier"); + } + } + return true + } + + if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) { + this.regexp_eatQuantifier(state); + return true + } + + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion + pp$9.regexp_eatAssertion = function(state) { + var start = state.pos; + state.lastAssertionIsQuantifiable = false; + + // ^, $ + if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) { + return true + } + + // \b \B + if (state.eat(0x5C /* \ */)) { + if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) { + return true + } + state.pos = start; + } + + // Lookahead / Lookbehind + if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) { + var lookbehind = false; + if (this.options.ecmaVersion >= 9) { + lookbehind = state.eat(0x3C /* < */); + } + if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) { + this.regexp_disjunction(state); + if (!state.eat(0x29 /* ) */)) { + state.raise("Unterminated group"); + } + state.lastAssertionIsQuantifiable = !lookbehind; + return true + } + } + + state.pos = start; + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier + pp$9.regexp_eatQuantifier = function(state, noError) { + if ( noError === void 0 ) noError = false; + + if (this.regexp_eatQuantifierPrefix(state, noError)) { + state.eat(0x3F /* ? */); + return true + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix + pp$9.regexp_eatQuantifierPrefix = function(state, noError) { + return ( + state.eat(0x2A /* * */) || + state.eat(0x2B /* + */) || + state.eat(0x3F /* ? */) || + this.regexp_eatBracedQuantifier(state, noError) + ) + }; + pp$9.regexp_eatBracedQuantifier = function(state, noError) { + var start = state.pos; + if (state.eat(0x7B /* { */)) { + var min = 0, max = -1; + if (this.regexp_eatDecimalDigits(state)) { + min = state.lastIntValue; + if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) { + max = state.lastIntValue; + } + if (state.eat(0x7D /* } */)) { + // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term + if (max !== -1 && max < min && !noError) { + state.raise("numbers out of order in {} quantifier"); + } + return true + } + } + if (state.switchU && !noError) { + state.raise("Incomplete quantifier"); + } + state.pos = start; + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-Atom + pp$9.regexp_eatAtom = function(state) { + return ( + this.regexp_eatPatternCharacters(state) || + state.eat(0x2E /* . */) || + this.regexp_eatReverseSolidusAtomEscape(state) || + this.regexp_eatCharacterClass(state) || + this.regexp_eatUncapturingGroup(state) || + this.regexp_eatCapturingGroup(state) + ) + }; + pp$9.regexp_eatReverseSolidusAtomEscape = function(state) { + var start = state.pos; + if (state.eat(0x5C /* \ */)) { + if (this.regexp_eatAtomEscape(state)) { + return true + } + state.pos = start; + } + return false + }; + pp$9.regexp_eatUncapturingGroup = function(state) { + var start = state.pos; + if (state.eat(0x28 /* ( */)) { + if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) { + this.regexp_disjunction(state); + if (state.eat(0x29 /* ) */)) { + return true + } + state.raise("Unterminated group"); + } + state.pos = start; + } + return false + }; + pp$9.regexp_eatCapturingGroup = function(state) { + if (state.eat(0x28 /* ( */)) { + if (this.options.ecmaVersion >= 9) { + this.regexp_groupSpecifier(state); + } else if (state.current() === 0x3F /* ? */) { + state.raise("Invalid group"); + } + this.regexp_disjunction(state); + if (state.eat(0x29 /* ) */)) { + state.numCapturingParens += 1; + return true + } + state.raise("Unterminated group"); + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom + pp$9.regexp_eatExtendedAtom = function(state) { + return ( + state.eat(0x2E /* . */) || + this.regexp_eatReverseSolidusAtomEscape(state) || + this.regexp_eatCharacterClass(state) || + this.regexp_eatUncapturingGroup(state) || + this.regexp_eatCapturingGroup(state) || + this.regexp_eatInvalidBracedQuantifier(state) || + this.regexp_eatExtendedPatternCharacter(state) + ) + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier + pp$9.regexp_eatInvalidBracedQuantifier = function(state) { + if (this.regexp_eatBracedQuantifier(state, true)) { + state.raise("Nothing to repeat"); + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter + pp$9.regexp_eatSyntaxCharacter = function(state) { + var ch = state.current(); + if (isSyntaxCharacter(ch)) { + state.lastIntValue = ch; + state.advance(); + return true + } + return false + }; + function isSyntaxCharacter(ch) { + return ( + ch === 0x24 /* $ */ || + ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ || + ch === 0x2E /* . */ || + ch === 0x3F /* ? */ || + ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ || + ch >= 0x7B /* { */ && ch <= 0x7D /* } */ + ) + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter + // But eat eager. + pp$9.regexp_eatPatternCharacters = function(state) { + var start = state.pos; + var ch = 0; + while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) { + state.advance(); + } + return state.pos !== start + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter + pp$9.regexp_eatExtendedPatternCharacter = function(state) { + var ch = state.current(); + if ( + ch !== -1 && + ch !== 0x24 /* $ */ && + !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) && + ch !== 0x2E /* . */ && + ch !== 0x3F /* ? */ && + ch !== 0x5B /* [ */ && + ch !== 0x5E /* ^ */ && + ch !== 0x7C /* | */ + ) { + state.advance(); + return true + } + return false + }; + + // GroupSpecifier[U] :: + // [empty] + // `?` GroupName[?U] + pp$9.regexp_groupSpecifier = function(state) { + if (state.eat(0x3F /* ? */)) { + if (this.regexp_eatGroupName(state)) { + if (state.groupNames.indexOf(state.lastStringValue) !== -1) { + state.raise("Duplicate capture group name"); + } + state.groupNames.push(state.lastStringValue); + return + } + state.raise("Invalid group"); + } + }; + + // GroupName[U] :: + // `<` RegExpIdentifierName[?U] `>` + // Note: this updates `state.lastStringValue` property with the eaten name. + pp$9.regexp_eatGroupName = function(state) { + state.lastStringValue = ""; + if (state.eat(0x3C /* < */)) { + if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) { + return true + } + state.raise("Invalid capture group name"); + } + return false + }; + + // RegExpIdentifierName[U] :: + // RegExpIdentifierStart[?U] + // RegExpIdentifierName[?U] RegExpIdentifierPart[?U] + // Note: this updates `state.lastStringValue` property with the eaten name. + pp$9.regexp_eatRegExpIdentifierName = function(state) { + state.lastStringValue = ""; + if (this.regexp_eatRegExpIdentifierStart(state)) { + state.lastStringValue += codePointToString$1(state.lastIntValue); + while (this.regexp_eatRegExpIdentifierPart(state)) { + state.lastStringValue += codePointToString$1(state.lastIntValue); + } + return true + } + return false + }; + + // RegExpIdentifierStart[U] :: + // UnicodeIDStart + // `$` + // `_` + // `\` RegExpUnicodeEscapeSequence[?U] + pp$9.regexp_eatRegExpIdentifierStart = function(state) { + var start = state.pos; + var ch = state.current(); + state.advance(); + + if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state)) { + ch = state.lastIntValue; + } + if (isRegExpIdentifierStart(ch)) { + state.lastIntValue = ch; + return true + } + + state.pos = start; + return false + }; + function isRegExpIdentifierStart(ch) { + return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ + } + + // RegExpIdentifierPart[U] :: + // UnicodeIDContinue + // `$` + // `_` + // `\` RegExpUnicodeEscapeSequence[?U] + // + // + pp$9.regexp_eatRegExpIdentifierPart = function(state) { + var start = state.pos; + var ch = state.current(); + state.advance(); + + if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state)) { + ch = state.lastIntValue; + } + if (isRegExpIdentifierPart(ch)) { + state.lastIntValue = ch; + return true + } + + state.pos = start; + return false + }; + function isRegExpIdentifierPart(ch) { + return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* */ || ch === 0x200D /* */ + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape + pp$9.regexp_eatAtomEscape = function(state) { + if ( + this.regexp_eatBackReference(state) || + this.regexp_eatCharacterClassEscape(state) || + this.regexp_eatCharacterEscape(state) || + (state.switchN && this.regexp_eatKGroupName(state)) + ) { + return true + } + if (state.switchU) { + // Make the same message as V8. + if (state.current() === 0x63 /* c */) { + state.raise("Invalid unicode escape"); + } + state.raise("Invalid escape"); + } + return false + }; + pp$9.regexp_eatBackReference = function(state) { + var start = state.pos; + if (this.regexp_eatDecimalEscape(state)) { + var n = state.lastIntValue; + if (state.switchU) { + // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape + if (n > state.maxBackReference) { + state.maxBackReference = n; + } + return true + } + if (n <= state.numCapturingParens) { + return true + } + state.pos = start; + } + return false + }; + pp$9.regexp_eatKGroupName = function(state) { + if (state.eat(0x6B /* k */)) { + if (this.regexp_eatGroupName(state)) { + state.backReferenceNames.push(state.lastStringValue); + return true + } + state.raise("Invalid named reference"); + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape + pp$9.regexp_eatCharacterEscape = function(state) { + return ( + this.regexp_eatControlEscape(state) || + this.regexp_eatCControlLetter(state) || + this.regexp_eatZero(state) || + this.regexp_eatHexEscapeSequence(state) || + this.regexp_eatRegExpUnicodeEscapeSequence(state) || + (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) || + this.regexp_eatIdentityEscape(state) + ) + }; + pp$9.regexp_eatCControlLetter = function(state) { + var start = state.pos; + if (state.eat(0x63 /* c */)) { + if (this.regexp_eatControlLetter(state)) { + return true + } + state.pos = start; + } + return false + }; + pp$9.regexp_eatZero = function(state) { + if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) { + state.lastIntValue = 0; + state.advance(); + return true + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape + pp$9.regexp_eatControlEscape = function(state) { + var ch = state.current(); + if (ch === 0x74 /* t */) { + state.lastIntValue = 0x09; /* \t */ + state.advance(); + return true + } + if (ch === 0x6E /* n */) { + state.lastIntValue = 0x0A; /* \n */ + state.advance(); + return true + } + if (ch === 0x76 /* v */) { + state.lastIntValue = 0x0B; /* \v */ + state.advance(); + return true + } + if (ch === 0x66 /* f */) { + state.lastIntValue = 0x0C; /* \f */ + state.advance(); + return true + } + if (ch === 0x72 /* r */) { + state.lastIntValue = 0x0D; /* \r */ + state.advance(); + return true + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter + pp$9.regexp_eatControlLetter = function(state) { + var ch = state.current(); + if (isControlLetter(ch)) { + state.lastIntValue = ch % 0x20; + state.advance(); + return true + } + return false + }; + function isControlLetter(ch) { + return ( + (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) || + (ch >= 0x61 /* a */ && ch <= 0x7A /* z */) + ) + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence + pp$9.regexp_eatRegExpUnicodeEscapeSequence = function(state) { + var start = state.pos; + + if (state.eat(0x75 /* u */)) { + if (this.regexp_eatFixedHexDigits(state, 4)) { + var lead = state.lastIntValue; + if (state.switchU && lead >= 0xD800 && lead <= 0xDBFF) { + var leadSurrogateEnd = state.pos; + if (state.eat(0x5C /* \ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) { + var trail = state.lastIntValue; + if (trail >= 0xDC00 && trail <= 0xDFFF) { + state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; + return true + } + } + state.pos = leadSurrogateEnd; + state.lastIntValue = lead; + } + return true + } + if ( + state.switchU && + state.eat(0x7B /* { */) && + this.regexp_eatHexDigits(state) && + state.eat(0x7D /* } */) && + isValidUnicode(state.lastIntValue) + ) { + return true + } + if (state.switchU) { + state.raise("Invalid unicode escape"); + } + state.pos = start; + } + + return false + }; + function isValidUnicode(ch) { + return ch >= 0 && ch <= 0x10FFFF + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape + pp$9.regexp_eatIdentityEscape = function(state) { + if (state.switchU) { + if (this.regexp_eatSyntaxCharacter(state)) { + return true + } + if (state.eat(0x2F /* / */)) { + state.lastIntValue = 0x2F; /* / */ + return true + } + return false + } + + var ch = state.current(); + if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) { + state.lastIntValue = ch; + state.advance(); + return true + } + + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape + pp$9.regexp_eatDecimalEscape = function(state) { + state.lastIntValue = 0; + var ch = state.current(); + if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) { + do { + state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */); + state.advance(); + } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) + return true + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape + pp$9.regexp_eatCharacterClassEscape = function(state) { + var ch = state.current(); + + if (isCharacterClassEscape(ch)) { + state.lastIntValue = -1; + state.advance(); + return true + } + + if ( + state.switchU && + this.options.ecmaVersion >= 9 && + (ch === 0x50 /* P */ || ch === 0x70 /* p */) + ) { + state.lastIntValue = -1; + state.advance(); + if ( + state.eat(0x7B /* { */) && + this.regexp_eatUnicodePropertyValueExpression(state) && + state.eat(0x7D /* } */) + ) { + return true + } + state.raise("Invalid property name"); + } + + return false + }; + function isCharacterClassEscape(ch) { + return ( + ch === 0x64 /* d */ || + ch === 0x44 /* D */ || + ch === 0x73 /* s */ || + ch === 0x53 /* S */ || + ch === 0x77 /* w */ || + ch === 0x57 /* W */ + ) + } + + // UnicodePropertyValueExpression :: + // UnicodePropertyName `=` UnicodePropertyValue + // LoneUnicodePropertyNameOrValue + pp$9.regexp_eatUnicodePropertyValueExpression = function(state) { + var start = state.pos; + + // UnicodePropertyName `=` UnicodePropertyValue + if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) { + var name = state.lastStringValue; + if (this.regexp_eatUnicodePropertyValue(state)) { + var value = state.lastStringValue; + this.regexp_validateUnicodePropertyNameAndValue(state, name, value); + return true + } + } + state.pos = start; + + // LoneUnicodePropertyNameOrValue + if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) { + var nameOrValue = state.lastStringValue; + this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue); + return true + } + return false + }; + pp$9.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) { + if (!has(state.unicodeProperties.nonBinary, name)) + { state.raise("Invalid property name"); } + if (!state.unicodeProperties.nonBinary[name].test(value)) + { state.raise("Invalid property value"); } + }; + pp$9.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { + if (!state.unicodeProperties.binary.test(nameOrValue)) + { state.raise("Invalid property name"); } + }; + + // UnicodePropertyName :: + // UnicodePropertyNameCharacters + pp$9.regexp_eatUnicodePropertyName = function(state) { + var ch = 0; + state.lastStringValue = ""; + while (isUnicodePropertyNameCharacter(ch = state.current())) { + state.lastStringValue += codePointToString$1(ch); + state.advance(); + } + return state.lastStringValue !== "" + }; + function isUnicodePropertyNameCharacter(ch) { + return isControlLetter(ch) || ch === 0x5F /* _ */ + } + + // UnicodePropertyValue :: + // UnicodePropertyValueCharacters + pp$9.regexp_eatUnicodePropertyValue = function(state) { + var ch = 0; + state.lastStringValue = ""; + while (isUnicodePropertyValueCharacter(ch = state.current())) { + state.lastStringValue += codePointToString$1(ch); + state.advance(); + } + return state.lastStringValue !== "" + }; + function isUnicodePropertyValueCharacter(ch) { + return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch) + } + + // LoneUnicodePropertyNameOrValue :: + // UnicodePropertyValueCharacters + pp$9.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { + return this.regexp_eatUnicodePropertyValue(state) + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass + pp$9.regexp_eatCharacterClass = function(state) { + if (state.eat(0x5B /* [ */)) { + state.eat(0x5E /* ^ */); + this.regexp_classRanges(state); + if (state.eat(0x5D /* [ */)) { + return true + } + // Unreachable since it threw "unterminated regular expression" error before. + state.raise("Unterminated character class"); + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges + // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges + // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash + pp$9.regexp_classRanges = function(state) { + var this$1 = this; + + while (this.regexp_eatClassAtom(state)) { + var left = state.lastIntValue; + if (state.eat(0x2D /* - */) && this$1.regexp_eatClassAtom(state)) { + var right = state.lastIntValue; + if (state.switchU && (left === -1 || right === -1)) { + state.raise("Invalid character class"); + } + if (left !== -1 && right !== -1 && left > right) { + state.raise("Range out of order in character class"); + } + } + } + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom + // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash + pp$9.regexp_eatClassAtom = function(state) { + var start = state.pos; + + if (state.eat(0x5C /* \ */)) { + if (this.regexp_eatClassEscape(state)) { + return true + } + if (state.switchU) { + // Make the same message as V8. + var ch$1 = state.current(); + if (ch$1 === 0x63 /* c */ || isOctalDigit(ch$1)) { + state.raise("Invalid class escape"); + } + state.raise("Invalid escape"); + } + state.pos = start; + } + + var ch = state.current(); + if (ch !== 0x5D /* [ */) { + state.lastIntValue = ch; + state.advance(); + return true + } + + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape + pp$9.regexp_eatClassEscape = function(state) { + var start = state.pos; + + if (state.eat(0x62 /* b */)) { + state.lastIntValue = 0x08; /* */ + return true + } + + if (state.switchU && state.eat(0x2D /* - */)) { + state.lastIntValue = 0x2D; /* - */ + return true + } + + if (!state.switchU && state.eat(0x63 /* c */)) { + if (this.regexp_eatClassControlLetter(state)) { + return true + } + state.pos = start; + } + + return ( + this.regexp_eatCharacterClassEscape(state) || + this.regexp_eatCharacterEscape(state) + ) + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter + pp$9.regexp_eatClassControlLetter = function(state) { + var ch = state.current(); + if (isDecimalDigit(ch) || ch === 0x5F /* _ */) { + state.lastIntValue = ch % 0x20; + state.advance(); + return true + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence + pp$9.regexp_eatHexEscapeSequence = function(state) { + var start = state.pos; + if (state.eat(0x78 /* x */)) { + if (this.regexp_eatFixedHexDigits(state, 2)) { + return true + } + if (state.switchU) { + state.raise("Invalid escape"); + } + state.pos = start; + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits + pp$9.regexp_eatDecimalDigits = function(state) { + var start = state.pos; + var ch = 0; + state.lastIntValue = 0; + while (isDecimalDigit(ch = state.current())) { + state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */); + state.advance(); + } + return state.pos !== start + }; + function isDecimalDigit(ch) { + return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */ + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits + pp$9.regexp_eatHexDigits = function(state) { + var start = state.pos; + var ch = 0; + state.lastIntValue = 0; + while (isHexDigit(ch = state.current())) { + state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); + state.advance(); + } + return state.pos !== start + }; + function isHexDigit(ch) { + return ( + (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) || + (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) || + (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) + ) + } + function hexToInt(ch) { + if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) { + return 10 + (ch - 0x41 /* A */) + } + if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) { + return 10 + (ch - 0x61 /* a */) + } + return ch - 0x30 /* 0 */ + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence + // Allows only 0-377(octal) i.e. 0-255(decimal). + pp$9.regexp_eatLegacyOctalEscapeSequence = function(state) { + if (this.regexp_eatOctalDigit(state)) { + var n1 = state.lastIntValue; + if (this.regexp_eatOctalDigit(state)) { + var n2 = state.lastIntValue; + if (n1 <= 3 && this.regexp_eatOctalDigit(state)) { + state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue; + } else { + state.lastIntValue = n1 * 8 + n2; + } + } else { + state.lastIntValue = n1; + } + return true + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit + pp$9.regexp_eatOctalDigit = function(state) { + var ch = state.current(); + if (isOctalDigit(ch)) { + state.lastIntValue = ch - 0x30; /* 0 */ + state.advance(); + return true + } + state.lastIntValue = 0; + return false + }; + function isOctalDigit(ch) { + return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */ + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits + // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit + // And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence + pp$9.regexp_eatFixedHexDigits = function(state, length) { + var start = state.pos; + state.lastIntValue = 0; + for (var i = 0; i < length; ++i) { + var ch = state.current(); + if (!isHexDigit(ch)) { + state.pos = start; + return false + } + state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); + state.advance(); + } + return true + }; + + // Object type used to represent tokens. Note that normally, tokens + // simply exist as properties on the parser object. This is only + // used for the onToken callback and the external tokenizer. + + var Token = function Token(p) { + this.type = p.type; + this.value = p.value; + this.start = p.start; + this.end = p.end; + if (p.options.locations) + { this.loc = new SourceLocation(p, p.startLoc, p.endLoc); } + if (p.options.ranges) + { this.range = [p.start, p.end]; } + }; + + // ## Tokenizer + + var pp$8 = Parser.prototype; + + // Move to the next token + + pp$8.next = function() { + if (this.options.onToken) + { this.options.onToken(new Token(this)); } + + this.lastTokEnd = this.end; + this.lastTokStart = this.start; + this.lastTokEndLoc = this.endLoc; + this.lastTokStartLoc = this.startLoc; + this.nextToken(); + }; + + pp$8.getToken = function() { + this.next(); + return new Token(this) + }; + + // If we're in an ES6 environment, make parsers iterable + if (typeof Symbol !== "undefined") + { pp$8[Symbol.iterator] = function() { + var this$1 = this; + + return { + next: function () { + var token = this$1.getToken(); + return { + done: token.type === types.eof, + value: token + } + } + } + }; } + + // Toggle strict mode. Re-reads the next number or string to please + // pedantic tests (`"use strict"; 010;` should fail). + + pp$8.curContext = function() { + return this.context[this.context.length - 1] + }; + + // Read a single token, updating the parser object's token-related + // properties. + + pp$8.nextToken = function() { + var curContext = this.curContext(); + if (!curContext || !curContext.preserveSpace) { this.skipSpace(); } + + this.start = this.pos; + if (this.options.locations) { this.startLoc = this.curPosition(); } + if (this.pos >= this.input.length) { return this.finishToken(types.eof) } + + if (curContext.override) { return curContext.override(this) } + else { this.readToken(this.fullCharCodeAtPos()); } + }; + + pp$8.readToken = function(code) { + // Identifier or keyword. '\uXXXX' sequences are allowed in + // identifiers, so '\' also dispatches to that. + if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */) + { return this.readWord() } + + return this.getTokenFromCode(code) + }; + + pp$8.fullCharCodeAtPos = function() { + var code = this.input.charCodeAt(this.pos); + if (code <= 0xd7ff || code >= 0xe000) { return code } + var next = this.input.charCodeAt(this.pos + 1); + return (code << 10) + next - 0x35fdc00 + }; + + pp$8.skipBlockComment = function() { + var this$1 = this; + + var startLoc = this.options.onComment && this.curPosition(); + var start = this.pos, end = this.input.indexOf("*/", this.pos += 2); + if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); } + this.pos = end + 2; + if (this.options.locations) { + lineBreakG.lastIndex = start; + var match; + while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) { + ++this$1.curLine; + this$1.lineStart = match.index + match[0].length; + } + } + if (this.options.onComment) + { this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos, + startLoc, this.curPosition()); } + }; + + pp$8.skipLineComment = function(startSkip) { + var this$1 = this; + + var start = this.pos; + var startLoc = this.options.onComment && this.curPosition(); + var ch = this.input.charCodeAt(this.pos += startSkip); + while (this.pos < this.input.length && !isNewLine(ch)) { + ch = this$1.input.charCodeAt(++this$1.pos); + } + if (this.options.onComment) + { this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos, + startLoc, this.curPosition()); } + }; + + // Called at the start of the parse and after every token. Skips + // whitespace and comments, and. + + pp$8.skipSpace = function() { + var this$1 = this; + + loop: while (this.pos < this.input.length) { + var ch = this$1.input.charCodeAt(this$1.pos); + switch (ch) { + case 32: case 160: // ' ' + ++this$1.pos; + break + case 13: + if (this$1.input.charCodeAt(this$1.pos + 1) === 10) { + ++this$1.pos; + } + case 10: case 8232: case 8233: + ++this$1.pos; + if (this$1.options.locations) { + ++this$1.curLine; + this$1.lineStart = this$1.pos; + } + break + case 47: // '/' + switch (this$1.input.charCodeAt(this$1.pos + 1)) { + case 42: // '*' + this$1.skipBlockComment(); + break + case 47: + this$1.skipLineComment(2); + break + default: + break loop + } + break + default: + if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { + ++this$1.pos; + } else { + break loop + } + } + } + }; + + // Called at the end of every token. Sets `end`, `val`, and + // maintains `context` and `exprAllowed`, and skips the space after + // the token, so that the next one's `start` will point at the + // right position. + + pp$8.finishToken = function(type, val) { + this.end = this.pos; + if (this.options.locations) { this.endLoc = this.curPosition(); } + var prevType = this.type; + this.type = type; + this.value = val; + + this.updateContext(prevType); + }; + + // ### Token reading + + // This is the function that is called to fetch the next token. It + // is somewhat obscure, because it works in character codes rather + // than characters, and because operator parsing has been inlined + // into it. + // + // All in the name of speed. + // + pp$8.readToken_dot = function() { + var next = this.input.charCodeAt(this.pos + 1); + if (next >= 48 && next <= 57) { return this.readNumber(true) } + var next2 = this.input.charCodeAt(this.pos + 2); + if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.' + this.pos += 3; + return this.finishToken(types.ellipsis) + } else { + ++this.pos; + return this.finishToken(types.dot) + } + }; + + pp$8.readToken_slash = function() { // '/' + var next = this.input.charCodeAt(this.pos + 1); + if (this.exprAllowed) { ++this.pos; return this.readRegexp() } + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(types.slash, 1) + }; + + pp$8.readToken_mult_modulo_exp = function(code) { // '%*' + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + var tokentype = code === 42 ? types.star : types.modulo; + + // exponentiation operator ** and **= + if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) { + ++size; + tokentype = types.starstar; + next = this.input.charCodeAt(this.pos + 2); + } + + if (next === 61) { return this.finishOp(types.assign, size + 1) } + return this.finishOp(tokentype, size) + }; + + pp$8.readToken_pipe_amp = function(code) { // '|&' + var next = this.input.charCodeAt(this.pos + 1); + if (next === code) { return this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2) } + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1) + }; + + pp$8.readToken_caret = function() { // '^' + var next = this.input.charCodeAt(this.pos + 1); + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(types.bitwiseXOR, 1) + }; + + pp$8.readToken_plus_min = function(code) { // '+-' + var next = this.input.charCodeAt(this.pos + 1); + if (next === code) { + if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && + (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) { + // A `-->` line comment + this.skipLineComment(3); + this.skipSpace(); + return this.nextToken() + } + return this.finishOp(types.incDec, 2) + } + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(types.plusMin, 1) + }; + + pp$8.readToken_lt_gt = function(code) { // '<>' + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + if (next === code) { + size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; + if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) } + return this.finishOp(types.bitShift, size) + } + if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && + this.input.charCodeAt(this.pos + 3) === 45) { + // `` line comment - this.skipLineComment(3); - this.skipSpace(); - return this.nextToken() - } - return this.finishOp(types.incDec, 2) - } - if (next === 61) { return this.finishOp(types.assign, 2) } - return this.finishOp(types.plusMin, 1) - }; - - pp$8.readToken_lt_gt = function(code) { // '<>' - var next = this.input.charCodeAt(this.pos + 1); - var size = 1; - if (next === code) { - size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; - if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) } - return this.finishOp(types.bitShift, size) - } - if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && - this.input.charCodeAt(this.pos + 3) === 45) { - // ` @@ -1079,6 +1081,8 @@ The content is exposed in the child component using the `` element, which ``` +#### Named slots (slot="name") + --- Named slots allow consumers to target specific areas. They can also have fallback content. @@ -1098,6 +1102,8 @@ Named slots allow consumers to target specific areas. They can also have fallbac ``` +#### Let directive (let:name) + --- Slots can be rendered zero or more times, and can pass values *back* to the parent using props. The parent exposes the values to the slot template using the `let:` directive. @@ -1325,4 +1331,4 @@ It accepts a comma-separated list of variable names (not arbitrary expressions). {@debug typeof user === 'object'} ``` -The `{@debug}` tag without any arguments will insert a `debugger` statement that gets triggered when *any* state changes, as opposed to the specified variables. \ No newline at end of file +The `{@debug}` tag without any arguments will insert a `debugger` statement that gets triggered when *any* state changes, as opposed to the specified variables. From 08f2ca68fac27996e382a3fe97569b517be9a020 Mon Sep 17 00:00:00 2001 From: Hongarc Date: Sun, 2 Jun 2019 16:41:19 +0700 Subject: [PATCH 092/409] refactor: better parsing name of file --- register.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/register.js b/register.js index f5cbeb5063..3278c1cbf5 100644 --- a/register.js +++ b/register.js @@ -25,8 +25,7 @@ function deregisterExtension(extension) { function registerExtension(extension) { require.extensions[extension] = function(module, filename) { - const name = path.basename(filename) - .slice(0, -path.extname(filename).length) + const name = path.parse(filename).name .replace(/^\d/, '_$&') .replace(/[^a-zA-Z0-9_$]/g, ''); @@ -46,4 +45,4 @@ function registerExtension(extension) { registerExtension('.svelte'); registerExtension('.html'); -module.exports = register; \ No newline at end of file +module.exports = register; From 25b089705282e18f8ba0c0da3caf65b896e36696 Mon Sep 17 00:00:00 2001 From: Yury Zhuravlev Date: Mon, 3 Jun 2019 19:53:50 +0900 Subject: [PATCH 093/409] Add strixcloud logo. --- .../routes/_components/WhosUsingSvelte.svelte | 1 + site/static/organisations/strixcloud.svg | 244 ++++++++++++++++++ 2 files changed, 245 insertions(+) create mode 100644 site/static/organisations/strixcloud.svg diff --git a/site/src/routes/_components/WhosUsingSvelte.svelte b/site/src/routes/_components/WhosUsingSvelte.svelte index 65d818a8bb..a52eacd266 100644 --- a/site/src/routes/_components/WhosUsingSvelte.svelte +++ b/site/src/routes/_components/WhosUsingSvelte.svelte @@ -54,6 +54,7 @@ The New York Times logo Razorpay logo Stone Payments logo + Strix Cloud logoStrix Cloud Thunderdome logo Tokopedia logo + your company? diff --git a/site/static/organisations/strixcloud.svg b/site/static/organisations/strixcloud.svg new file mode 100644 index 0000000000..49fe96b061 --- /dev/null +++ b/site/static/organisations/strixcloud.svg @@ -0,0 +1,244 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 201c8c8553ba77088e3a2fbf168161c4d2c16357 Mon Sep 17 00:00:00 2001 From: Yury Zhuravlev Date: Mon, 3 Jun 2019 20:05:54 +0900 Subject: [PATCH 094/409] remove lead slesh from company link --- site/src/routes/_components/WhosUsingSvelte.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/src/routes/_components/WhosUsingSvelte.svelte b/site/src/routes/_components/WhosUsingSvelte.svelte index a52eacd266..c0943d69a9 100644 --- a/site/src/routes/_components/WhosUsingSvelte.svelte +++ b/site/src/routes/_components/WhosUsingSvelte.svelte @@ -54,7 +54,7 @@ The New York Times logo Razorpay logo Stone Payments logo - Strix Cloud logoStrix Cloud + Strix Cloud logoStrix Cloud Thunderdome logo Tokopedia logo + your company? From f65379f38b0276fc8d7faae753018042e6ed01bf Mon Sep 17 00:00:00 2001 From: Jacob Wright Date: Mon, 3 Jun 2019 13:26:47 -0600 Subject: [PATCH 095/409] Fix component binding example While `cart.empty` could be passed around, it is undefined on first render and results in an error being thrown. The example here was broken and needed fixing. --- site/content/docs/02-template-syntax.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/site/content/docs/02-template-syntax.md b/site/content/docs/02-template-syntax.md index 167d1fa3a2..aad7e3fc19 100644 --- a/site/content/docs/02-template-syntax.md +++ b/site/content/docs/02-template-syntax.md @@ -593,12 +593,12 @@ You can bind to component props using the same mechanism. Components also support `bind:this`, allowing you to interact with component instances programmatically. -> Note that we can do `{cart.empty}` rather than `{() => cart.empty()}`, since component methods are closures. You don't need to worry about the value of `this` when calling them. +> Note that we can't do `{cart.empty}` since `cart` is `undefined` when the button is first rendered and throws an error. ```html - ``` @@ -1325,4 +1325,4 @@ It accepts a comma-separated list of variable names (not arbitrary expressions). {@debug typeof user === 'object'} ``` -The `{@debug}` tag without any arguments will insert a `debugger` statement that gets triggered when *any* state changes, as opposed to the specified variables. \ No newline at end of file +The `{@debug}` tag without any arguments will insert a `debugger` statement that gets triggered when *any* state changes, as opposed to the specified variables. From ef74838e1e68fce489f6a7cab8526dee38b253c5 Mon Sep 17 00:00:00 2001 From: Harald-1 <51047840+Harald-1@users.noreply.github.com> Date: Mon, 3 Jun 2019 21:42:30 +0200 Subject: [PATCH 096/409] Apply suggestions from code review call add_transform directly instead of wrapping it into prepare_outro Co-Authored-By: Rich Harris --- src/compiler/compile/render-dom/wrappers/Element/index.ts | 2 +- src/runtime/internal/animations.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/compile/render-dom/wrappers/Element/index.ts b/src/compiler/compile/render-dom/wrappers/Element/index.ts index 712fab3eca..65d008278f 100644 --- a/src/compiler/compile/render-dom/wrappers/Element/index.ts +++ b/src/compiler/compile/render-dom/wrappers/Element/index.ts @@ -778,7 +778,7 @@ export default class ElementWrapper extends Wrapper { block.builders.fix.add_block(deindent` @fix_position(${this.var}); ${stop_animation}(); - ${outro && `@prepare_outro(${this.var}, ${rect});`} + ${outro && `@add_transform(${this.var}, ${rect});`} `); const params = this.node.animation.expression ? this.node.animation.expression.render(block) : '{}'; diff --git a/src/runtime/internal/animations.ts b/src/runtime/internal/animations.ts index b1b4a0cf8a..6a7f9e7828 100644 --- a/src/runtime/internal/animations.ts +++ b/src/runtime/internal/animations.ts @@ -94,7 +94,7 @@ export function fix_position(node: Element & ElementCSSInlineStyle) { } } -function add_transform(node: Element & ElementCSSInlineStyle, a: PositionRect) { +export function add_transform(node: Element & ElementCSSInlineStyle, a: PositionRect) { const b = node.getBoundingClientRect(); if (a.left !== b.left || a.top !== b.top) { From 2b1ff3f487e7c88c33b51f62fa50511a373aac40 Mon Sep 17 00:00:00 2001 From: Harald Fassler Date: Mon, 3 Jun 2019 21:54:48 +0200 Subject: [PATCH 097/409] remove prepare_outro --- src/runtime/internal/animations.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/runtime/internal/animations.ts b/src/runtime/internal/animations.ts index 6a7f9e7828..b0357647f5 100644 --- a/src/runtime/internal/animations.ts +++ b/src/runtime/internal/animations.ts @@ -77,10 +77,6 @@ export function create_animation(node: Element & ElementCSSInlineStyle, from: Po return stop; } -export function prepare_outro(node: Element & ElementCSSInlineStyle, rect: PositionRect) { - add_transform(node, rect); -} - export function fix_position(node: Element & ElementCSSInlineStyle) { const style = getComputedStyle(node); From ddd4a33f3b719de59ba4902e5b6f1696eb79bb34 Mon Sep 17 00:00:00 2001 From: Lyphon Date: Mon, 3 Jun 2019 22:59:30 +0300 Subject: [PATCH 098/409] Fix 2929 --- src/compiler/compile/css/Selector.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/compile/css/Selector.ts b/src/compiler/compile/css/Selector.ts index 713b035efe..56f97ca852 100644 --- a/src/compiler/compile/css/Selector.ts +++ b/src/compiler/compile/css/Selector.ts @@ -239,7 +239,8 @@ function attribute_matches(node: Node, name: string, expected_value: string, ope function class_matches(node, name: string) { return node.classes.some(function(class_directive) { - return class_directive.name === name; + name = new RegExp(`\\b${name}\\b`); + return name.test(class_directive.name); }); } From bef6f153dba30439215ffe80cc1db4b3baefda47 Mon Sep 17 00:00:00 2001 From: Lyphon Date: Mon, 3 Jun 2019 23:29:21 +0300 Subject: [PATCH 099/409] Fix build appveyor build failure --- src/compiler/compile/css/Selector.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/compiler/compile/css/Selector.ts b/src/compiler/compile/css/Selector.ts index 56f97ca852..854acde216 100644 --- a/src/compiler/compile/css/Selector.ts +++ b/src/compiler/compile/css/Selector.ts @@ -239,8 +239,7 @@ function attribute_matches(node: Node, name: string, expected_value: string, ope function class_matches(node, name: string) { return node.classes.some(function(class_directive) { - name = new RegExp(`\\b${name}\\b`); - return name.test(class_directive.name); + return new RegExp(`\\b${name}\\b`).test(class_directive.name); }); } From 86c08c6e2e59e53f9bfb64192e9ee38cc3aaef07 Mon Sep 17 00:00:00 2001 From: Conv Date: Mon, 3 Jun 2019 21:50:25 -0400 Subject: [PATCH 100/409] site: support new folder structure in REPL (#2945) * site: support files in directories in /repl/local/ * site: bump @sveltejs/svelte-repl --- site/package-lock.json | 6 +++--- site/package.json | 2 +- site/src/routes/repl/local/{[file].js => [...file].js} | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) rename site/src/routes/repl/local/{[file].js => [...file].js} (63%) diff --git a/site/package-lock.json b/site/package-lock.json index 0127c84d53..b4cbd4f13a 100644 --- a/site/package-lock.json +++ b/site/package-lock.json @@ -1362,9 +1362,9 @@ } }, "@sveltejs/svelte-repl": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/@sveltejs/svelte-repl/-/svelte-repl-0.1.2.tgz", - "integrity": "sha512-OHIj01ly4+/WwNb0zGqLSQL7POSs2BPx47CzryVsbu0omVDe7olYTJnCYV4ePUENnlL5JzZihzvlvxmVGP6knw==", + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/@sveltejs/svelte-repl/-/svelte-repl-0.1.5.tgz", + "integrity": "sha512-gk7Ny/i19g3njob9lGGV5JzDed8eAaFphHidxquFGW5QgMCScEu+YgweBo+tRkRE0sJObFzMz3MjudH5o+KdIw==", "dev": true, "requires": { "codemirror": "^5.45.0", diff --git a/site/package.json b/site/package.json index ec429f54ab..3f7172b8a8 100644 --- a/site/package.json +++ b/site/package.json @@ -39,7 +39,7 @@ "@babel/runtime": "^7.4.4", "@sindresorhus/slugify": "^0.9.1", "@sveltejs/site-kit": "^1.0.4", - "@sveltejs/svelte-repl": "^0.1.2", + "@sveltejs/svelte-repl": "^0.1.5", "degit": "^2.1.3", "dotenv": "^8.0.0", "eslint-plugin-svelte3": "^1.0.0", diff --git a/site/src/routes/repl/local/[file].js b/site/src/routes/repl/local/[...file].js similarity index 63% rename from site/src/routes/repl/local/[file].js rename to site/src/routes/repl/local/[...file].js index 20d9f509cb..7bd1c6a82c 100644 --- a/site/src/routes/repl/local/[file].js +++ b/site/src/routes/repl/local/[...file].js @@ -1,12 +1,13 @@ import { createReadStream } from 'fs'; export function get(req, res) { - if (process.env.NODE_ENV !== 'development' || !/^[a-z.]+$/.test(req.params.file)) { + const path = req.params.file.join('/'); + if (process.env.NODE_ENV !== 'development' || ('/' + path).includes('/.')) { res.writeHead(403); res.end(); return; } - createReadStream('../' + req.params.file) + createReadStream('../' + path) .on('error', () => { res.writeHead(403); res.end(); From a5cdc13b508483ce5a7145ac00d9be77dc1bccec Mon Sep 17 00:00:00 2001 From: "Benjamin W. Broersma" Date: Sun, 5 May 2019 22:16:17 +0200 Subject: [PATCH 101/409] Fixing #2689 correctly, checking outro.is_local for adding if(local). --- src/compiler/compile/render-dom/wrappers/EachBlock.ts | 2 +- src/compiler/compile/render-dom/wrappers/Element/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/compile/render-dom/wrappers/EachBlock.ts b/src/compiler/compile/render-dom/wrappers/EachBlock.ts index b2dd5a7508..9d23eb7309 100644 --- a/src/compiler/compile/render-dom/wrappers/EachBlock.ts +++ b/src/compiler/compile/render-dom/wrappers/EachBlock.ts @@ -510,7 +510,7 @@ export default class EachBlockWrapper extends Wrapper { if (outro_block) { block.builders.outro.add_block(deindent` ${iterations} = ${iterations}.filter(Boolean); - for (let #i = 0; #i < ${view_length}; #i += 1) ${outro_block}(#i, 0);` + for (let #i = 0; #i < ${view_length}; #i += 1) ${outro_block}(#i, 0, 0);` ); } diff --git a/src/compiler/compile/render-dom/wrappers/Element/index.ts b/src/compiler/compile/render-dom/wrappers/Element/index.ts index 41db1c03a0..7d458481f1 100644 --- a/src/compiler/compile/render-dom/wrappers/Element/index.ts +++ b/src/compiler/compile/render-dom/wrappers/Element/index.ts @@ -744,7 +744,7 @@ export default class ElementWrapper extends Wrapper { ${outro_name} = @create_out_transition(${this.var}, ${fn}, ${snippet}); `; - if (outro_block) { + if (outro.is_local) { outro_block = deindent` if (#local) { ${outro_block} From 53e46d350019c7e44e225f3fe49e8289d32ec0a2 Mon Sep 17 00:00:00 2001 From: "Benjamin W. Broersma" Date: Tue, 4 Jun 2019 19:47:23 +0200 Subject: [PATCH 102/409] Add https://github.com/openstate/ and https://github.com/spnl/ as Svelte/Sapper users. --- site/src/routes/_components/WhosUsingSvelte.svelte | 2 ++ site/static/organisations/open-state-foundation.svg | 1 + site/static/organisations/socialist-party.svg | 1 + 3 files changed, 4 insertions(+) create mode 100644 site/static/organisations/open-state-foundation.svg create mode 100644 site/static/organisations/socialist-party.svg diff --git a/site/src/routes/_components/WhosUsingSvelte.svelte b/site/src/routes/_components/WhosUsingSvelte.svelte index 65d818a8bb..e84c2ac43b 100644 --- a/site/src/routes/_components/WhosUsingSvelte.svelte +++ b/site/src/routes/_components/WhosUsingSvelte.svelte @@ -52,7 +52,9 @@ Mustlab logo Nesta logo The New York Times logo + Open State Foundation logo Razorpay logo + Socialist Party logo Stone Payments logo Thunderdome logo Tokopedia logo diff --git a/site/static/organisations/open-state-foundation.svg b/site/static/organisations/open-state-foundation.svg new file mode 100644 index 0000000000..8e27e20d21 --- /dev/null +++ b/site/static/organisations/open-state-foundation.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/site/static/organisations/socialist-party.svg b/site/static/organisations/socialist-party.svg new file mode 100644 index 0000000000..6fc8348b0b --- /dev/null +++ b/site/static/organisations/socialist-party.svg @@ -0,0 +1 @@ + \ No newline at end of file From 3805421d44d64e995a5cb1dddc4cc653cb61ddc5 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Tue, 4 Jun 2019 14:05:41 -0400 Subject: [PATCH 103/409] solve diamond dependencies (#2660) --- src/runtime/store/index.ts | 62 ++++++++++++++++++++++++++++++-------- test/store/index.ts | 28 +++++++++++++++++ 2 files changed, 77 insertions(+), 13 deletions(-) diff --git a/src/runtime/store/index.ts b/src/runtime/store/index.ts index e7db228401..f03a550c5f 100644 --- a/src/runtime/store/index.ts +++ b/src/runtime/store/index.ts @@ -112,12 +112,12 @@ type StoresValues = T extends Readable ? U : * applying an aggregation function over its input values. * @param {Stores} stores input stores * @param {function(Stores=, function(*)=):*}fn function callback that aggregates the values - * @param {*=}initial_value when used asynchronously + * @param {*=}value initial value, when used asynchronously */ export function derived( stores: S, fn: (values: StoresValues, set?: Subscriber) => T | Unsubscriber | void, - initial_value?: T, + value?: T, ): Readable { const single = !Array.isArray(stores); @@ -127,12 +127,28 @@ export function derived( const auto = fn.length < 2; - return readable(initial_value, (set) => { - let inited = false; + const subscribers: Array> = []; + let unsubscribers; + let cleanup = noop; + let running = false; + + function invalidate() { + subscribers.forEach(subscriber => subscriber[1]()); + } + + function set(current_value) { + value = current_value; + if (running) { + invalidate(); + subscribers.forEach(subscriber => subscriber[0](value)); + } + } + + function start() { const values: StoresValues = [] as StoresValues; let pending = 0; - let cleanup = noop; + running = false; const sync = () => { if (pending) { @@ -147,27 +163,47 @@ export function derived( } }; - const unsubscribers = stores_array.map((store, i) => store.subscribe( + unsubscribers = stores_array.map((store, i) => store.subscribe( (value) => { values[i] = value; pending &= ~(1 << i); - if (inited) { + if (running) { sync(); } }, () => { + invalidate(); pending |= (1 << i); }), ); - inited = true; sync(); + running = true; + } - return function stop() { - run_all(unsubscribers); - cleanup(); - }; - }); + function stop() { + run_all(unsubscribers); + cleanup(); + } + + return { + subscribe(run: Subscriber, invalidate: Invalidater = noop): Unsubscriber { + const subscriber: SubscribeInvalidateTuple = [run, invalidate]; + subscribers.push(subscriber); + if (subscribers.length === 1) start(); + run(value); + + return () => { + const index = subscribers.indexOf(subscriber); + if (index !== -1) { + subscribers.splice(index, 1); + } + if (subscribers.length === 0) { + stop(); + } + }; + } + }; } /** diff --git a/test/store/index.ts b/test/store/index.ts index 13b8e1f869..77ef9f9549 100644 --- a/test/store/index.ts +++ b/test/store/index.ts @@ -189,6 +189,34 @@ describe('store', () => { unsubscribe(); }); + it('prevents diamond dependency problem', () => { + const count = writable(0); + const values = []; + + const a = derived(count, $count => { + return 'a' + $count; + }); + + const b = derived(count, $count => { + return 'b' + $count; + }); + + const combined = derived([a, b], ([a, b]) => { + return a + b; + }); + + const unsubscribe = combined.subscribe(v => { + values.push(v); + }); + + assert.deepEqual(values, ['a0b0']); + + count.set(1); + assert.deepEqual(values, ['a0b0', 'a1b1']); + + unsubscribe(); + }); + it('is updated with safe_not_equal logic', () => { const arr = [0]; From ed2a19aa67e511cab9f7db0229215adaff134ba5 Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Tue, 4 Jun 2019 22:14:36 -0400 Subject: [PATCH 104/409] DRY out --- src/runtime/store/index.ts | 63 ++++++++++++++------------------------ 1 file changed, 23 insertions(+), 40 deletions(-) diff --git a/src/runtime/store/index.ts b/src/runtime/store/index.ts index f03a550c5f..6f14162115 100644 --- a/src/runtime/store/index.ts +++ b/src/runtime/store/index.ts @@ -112,12 +112,12 @@ type StoresValues = T extends Readable ? U : * applying an aggregation function over its input values. * @param {Stores} stores input stores * @param {function(Stores=, function(*)=):*}fn function callback that aggregates the values - * @param {*=}value initial value, when used asynchronously + * @param {*=}initial_value when used asynchronously */ export function derived( stores: S, fn: (values: StoresValues, set?: Subscriber) => T | Unsubscriber | void, - value?: T, + initial_value?: T, ): Readable { const single = !Array.isArray(stores); @@ -127,28 +127,14 @@ export function derived( const auto = fn.length < 2; - const subscribers: Array> = []; - let unsubscribers; - let cleanup = noop; - let running = false; - - function invalidate() { - subscribers.forEach(subscriber => subscriber[1]()); - } - - function set(current_value) { - value = current_value; - if (running) { - invalidate(); - subscribers.forEach(subscriber => subscriber[0](value)); - } - } + const invalidators: Array> = []; - function start() { + const store = readable(initial_value, (set) => { + let inited = false; const values: StoresValues = [] as StoresValues; let pending = 0; - running = false; + let cleanup = noop; const sync = () => { if (pending) { @@ -163,47 +149,44 @@ export function derived( } }; - unsubscribers = stores_array.map((store, i) => store.subscribe( + const unsubscribers = stores_array.map((store, i) => store.subscribe( (value) => { values[i] = value; pending &= ~(1 << i); - if (running) { + if (inited) { sync(); } }, () => { - invalidate(); + run_all(invalidators); pending |= (1 << i); }), ); + inited = true; sync(); - running = true; - } - function stop() { - run_all(unsubscribers); - cleanup(); - } + return function stop() { + run_all(unsubscribers); + cleanup(); + }; + }); return { subscribe(run: Subscriber, invalidate: Invalidater = noop): Unsubscriber { - const subscriber: SubscribeInvalidateTuple = [run, invalidate]; - subscribers.push(subscriber); - if (subscribers.length === 1) start(); - run(value); + invalidators.push(invalidate); + + const unsubscribe = store.subscribe(run, invalidate); return () => { - const index = subscribers.indexOf(subscriber); + const index = invalidators.indexOf(invalidate); if (index !== -1) { - subscribers.splice(index, 1); - } - if (subscribers.length === 0) { - stop(); + invalidators.splice(index, 1); } + unsubscribe(); }; } - }; + } } /** @@ -214,4 +197,4 @@ export function get(store: Readable): T { let value: T | undefined; store.subscribe((_: T) => value = _)(); return value as T; -} +} \ No newline at end of file From 0d31e5c046106b4ee7c2c699b9d04c71bb75611a Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Tue, 4 Jun 2019 22:15:58 -0400 Subject: [PATCH 105/409] fix typo --- src/runtime/store/index.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/runtime/store/index.ts b/src/runtime/store/index.ts index 6f14162115..5ab6cfa26b 100644 --- a/src/runtime/store/index.ts +++ b/src/runtime/store/index.ts @@ -10,7 +10,7 @@ type Unsubscriber = () => void; type Updater = (value: T) => T; /** Cleanup logic callback. */ -type Invalidater = (value?: T) => void; +type Invalidator = (value?: T) => void; /** Start and stop notification callbacks. */ type StartStopNotifier = (set: Subscriber) => Unsubscriber | void; @@ -22,7 +22,7 @@ export interface Readable { * @param run subscription callback * @param invalidate cleanup callback */ - subscribe(run: Subscriber, invalidate?: Invalidater): Unsubscriber; + subscribe(run: Subscriber, invalidate?: Invalidator): Unsubscriber; } /** Writable interface for both updating and subscribing. */ @@ -41,7 +41,7 @@ export interface Writable extends Readable { } /** Pair of subscriber and invalidator. */ -type SubscribeInvalidateTuple = [Subscriber, Invalidater]; +type SubscribeInvalidateTuple = [Subscriber, Invalidator]; /** * Creates a `Readable` store that allows reading by subscription. @@ -78,7 +78,7 @@ export function writable(value: T, start: StartStopNotifier = noop): Writa set(fn(value)); } - function subscribe(run: Subscriber, invalidate: Invalidater = noop): Unsubscriber { + function subscribe(run: Subscriber, invalidate: Invalidator = noop): Unsubscriber { const subscriber: SubscribeInvalidateTuple = [run, invalidate]; subscribers.push(subscriber); if (subscribers.length === 1) { @@ -127,7 +127,7 @@ export function derived( const auto = fn.length < 2; - const invalidators: Array> = []; + const invalidators: Array> = []; const store = readable(initial_value, (set) => { let inited = false; @@ -173,7 +173,7 @@ export function derived( }); return { - subscribe(run: Subscriber, invalidate: Invalidater = noop): Unsubscriber { + subscribe(run: Subscriber, invalidate: Invalidator = noop): Unsubscriber { invalidators.push(invalidate); const unsubscribe = store.subscribe(run, invalidate); From 3fe7f6aa307b33bce6da783cc3d27fa7e21c5bb1 Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Tue, 4 Jun 2019 22:25:33 -0400 Subject: [PATCH 106/409] shuffle styles around, fix markup --- site/src/routes/_components/WhosUsingSvelte.svelte | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/site/src/routes/_components/WhosUsingSvelte.svelte b/site/src/routes/_components/WhosUsingSvelte.svelte index c0943d69a9..a22b0ed937 100644 --- a/site/src/routes/_components/WhosUsingSvelte.svelte +++ b/site/src/routes/_components/WhosUsingSvelte.svelte @@ -18,15 +18,16 @@ a { height: 40px; margin: 0 0.5em 0.5em 0; + display: flex; + align-items: center; border: 2px solid var(--second); padding: 5px 10px; border-radius: 20px; + color: var(--text); } .add-yourself { - display: flex; - align-items: center; - border: 2px solid var(--second); + color: var(--prime); } img { @@ -54,7 +55,7 @@ The New York Times logo Razorpay logo Stone Payments logo - Strix Cloud logoStrix Cloud + Strix Cloud logoStrix Cloud Thunderdome logo Tokopedia logo + your company? From 450464f014cf2544e701f882b45df2dcf0a9c492 Mon Sep 17 00:00:00 2001 From: Vlad Glushchuk Date: Mon, 8 Apr 2019 20:28:16 +0200 Subject: [PATCH 107/409] Add bind:text and bind:html support for contenteditable elements Fixes #310 --- src/compiler/compile/nodes/Element.ts | 21 ++++++++- .../render-dom/wrappers/Element/Binding.ts | 16 +++++++ .../render-dom/wrappers/Element/index.ts | 6 +++ .../compile/render-ssr/handlers/Element.ts | 23 +++++++--- .../samples/contenteditable-html/_config.js | 43 +++++++++++++++++++ .../samples/contenteditable-html/main.svelte | 6 +++ .../samples/contenteditable-text/_config.js | 37 ++++++++++++++++ .../samples/contenteditable-text/main.svelte | 6 +++ .../contenteditable-dynamic/errors.json | 15 +++++++ .../contenteditable-dynamic/input.svelte | 6 +++ .../contenteditable-missing/errors.json | 15 +++++++ .../contenteditable-missing/input.svelte | 4 ++ 12 files changed, 192 insertions(+), 6 deletions(-) create mode 100644 test/runtime/samples/contenteditable-html/_config.js create mode 100644 test/runtime/samples/contenteditable-html/main.svelte create mode 100644 test/runtime/samples/contenteditable-text/_config.js create mode 100644 test/runtime/samples/contenteditable-text/main.svelte create mode 100644 test/validator/samples/contenteditable-dynamic/errors.json create mode 100644 test/validator/samples/contenteditable-dynamic/input.svelte create mode 100644 test/validator/samples/contenteditable-missing/errors.json create mode 100644 test/validator/samples/contenteditable-missing/input.svelte diff --git a/src/compiler/compile/nodes/Element.ts b/src/compiler/compile/nodes/Element.ts index 1b2d82188c..757157d9b4 100644 --- a/src/compiler/compile/nodes/Element.ts +++ b/src/compiler/compile/nodes/Element.ts @@ -605,7 +605,26 @@ export default class Element extends Node { message: `'${binding.name}' is not a valid binding on void elements like <${this.name}>. Use a wrapper element instead` }); } - } else if (name !== 'this') { + } else if ( + name === 'text' || + name === 'html' + ){ + const contenteditable = this.attributes.find( + (attribute: Attribute) => attribute.name === 'contenteditable' + ); + + if (!contenteditable) { + component.error(binding, { + code: `missing-contenteditable-attribute`, + message: `'contenteditable' attribute is required for text and html two-way bindings` + }); + } else if (contenteditable && !contenteditable.is_static) { + component.error(contenteditable, { + code: `dynamic-contenteditable-attribute`, + message: `'contenteditable' attribute cannot be dynamic if element uses two-way binding` + }); + } + } else if (name !== 'this') { component.error(binding, { code: `invalid-binding`, message: `'${binding.name}' is not a valid binding` diff --git a/src/compiler/compile/render-dom/wrappers/Element/Binding.ts b/src/compiler/compile/render-dom/wrappers/Element/Binding.ts index 70123fa10c..8eb5ba8097 100644 --- a/src/compiler/compile/render-dom/wrappers/Element/Binding.ts +++ b/src/compiler/compile/render-dom/wrappers/Element/Binding.ts @@ -195,6 +195,14 @@ function get_dom_updater( return `${element.var}.checked = ${condition};` } + if (binding.node.name === 'text') { + return `${element.var}.textContent = ${binding.snippet};`; + } + + if (binding.node.name === 'html') { + return `${element.var}.innerHTML = ${binding.snippet};`; + } + return `${element.var}.${binding.node.name} = ${binding.snippet};`; } @@ -307,6 +315,14 @@ function get_value_from_dom( return `@time_ranges_to_array(this.${name})` } + if (name === 'text') { + return `this.textContent`; + } + + if (name === 'html') { + return `this.innerHTML`; + } + // everything else return `this.${name}`; } diff --git a/src/compiler/compile/render-dom/wrappers/Element/index.ts b/src/compiler/compile/render-dom/wrappers/Element/index.ts index 7d458481f1..a86b45dbb5 100644 --- a/src/compiler/compile/render-dom/wrappers/Element/index.ts +++ b/src/compiler/compile/render-dom/wrappers/Element/index.ts @@ -28,6 +28,12 @@ const events = [ node.name === 'textarea' || node.name === 'input' && !/radio|checkbox|range/.test(node.get_static_attribute_value('type') as string) }, + { + event_names: ['input'], + filter: (node: Element, name: string) => + (name === 'text' || name === 'html') && + node.attributes.some(attribute => attribute.name === 'contenteditable') + }, { event_names: ['change'], filter: (node: Element, name: string) => diff --git a/src/compiler/compile/render-ssr/handlers/Element.ts b/src/compiler/compile/render-ssr/handlers/Element.ts index 5ed6875dec..36ae121b53 100644 --- a/src/compiler/compile/render-ssr/handlers/Element.ts +++ b/src/compiler/compile/render-ssr/handlers/Element.ts @@ -54,7 +54,12 @@ export default function(node: Element, renderer: Renderer, options: RenderOption slot_scopes: Map; }) { let opening_tag = `<${node.name}`; - let textarea_contents; // awkward special case + let node_contents; // awkward special case + const contenteditable = ( + node.name !== 'textarea' && + node.name !== 'input' && + node.attributes.some((attribute: Node) => attribute.name === 'contenteditable') + ); const slot = node.get_static_attribute_value('slot'); const component = node.find_nearest(/InlineComponent/); @@ -91,7 +96,7 @@ export default function(node: Element, renderer: Renderer, options: RenderOption args.push(snip(attribute.expression)); } else { if (attribute.name === 'value' && node.name === 'textarea') { - textarea_contents = stringify_attribute(attribute, true); + node_contents = stringify_attribute(attribute, true); } else if (attribute.is_true) { args.push(`{ ${quote_name_if_necessary(attribute.name)}: true }`); } else if ( @@ -113,7 +118,7 @@ export default function(node: Element, renderer: Renderer, options: RenderOption if (attribute.type !== 'Attribute') return; if (attribute.name === 'value' && node.name === 'textarea') { - textarea_contents = stringify_attribute(attribute, true); + node_contents = stringify_attribute(attribute, true); } else if (attribute.is_true) { opening_tag += ` ${attribute.name}`; } else if ( @@ -146,6 +151,14 @@ export default function(node: Element, renderer: Renderer, options: RenderOption if (name === 'group') { // TODO server-render group bindings + } else if (contenteditable && (node === 'text' || node === 'html')) { + const snippet = snip(expression) + if (name == 'text') { + node_contents = '${@escape(' + snippet + ')}' + } else { + // Do not escape HTML content + node_contents = '${' + snippet + '}' + } } else { const snippet = snip(expression); opening_tag += ' ${(v => v ? ("' + name + '" + (v === true ? "" : "=" + JSON.stringify(v))) : "")(' + snippet + ')}'; @@ -160,8 +173,8 @@ export default function(node: Element, renderer: Renderer, options: RenderOption renderer.append(opening_tag); - if (node.name === 'textarea' && textarea_contents !== undefined) { - renderer.append(textarea_contents); + if ((node.name === 'textarea' || contenteditable) && node_contents !== undefined) { + renderer.append(node_contents); } else { renderer.render(node.children, options); } diff --git a/test/runtime/samples/contenteditable-html/_config.js b/test/runtime/samples/contenteditable-html/_config.js new file mode 100644 index 0000000000..cd2a822655 --- /dev/null +++ b/test/runtime/samples/contenteditable-html/_config.js @@ -0,0 +1,43 @@ +export default { + props: { + name: 'world', + }, + + html: ` + world +

      hello world

      + `, + + ssrHtml: ` + world +

      hello world

      + `, + + async test({ assert, component, target, window }) { + const el = target.querySelector('editor'); + assert.equal(el.innerHTML, 'world'); + + el.innerHTML = 'everybody'; + + // No updates to data yet + assert.htmlEqual(target.innerHTML, ` + everybody +

      hello world

      + `); + + // Handle user input + const event = new window.Event('input'); + await el.dispatchEvent(event); + assert.htmlEqual(target.innerHTML, ` + everybody +

      hello everybody

      + `); + + component.name = 'goodbye'; + assert.equal(el.innerHTML, 'goodbye'); + assert.htmlEqual(target.innerHTML, ` + goodbye +

      hello goodbye

      + `); + }, +}; diff --git a/test/runtime/samples/contenteditable-html/main.svelte b/test/runtime/samples/contenteditable-html/main.svelte new file mode 100644 index 0000000000..53b4e81c88 --- /dev/null +++ b/test/runtime/samples/contenteditable-html/main.svelte @@ -0,0 +1,6 @@ + + + +

      hello {@html name}

      \ No newline at end of file diff --git a/test/runtime/samples/contenteditable-text/_config.js b/test/runtime/samples/contenteditable-text/_config.js new file mode 100644 index 0000000000..4935a3a9a7 --- /dev/null +++ b/test/runtime/samples/contenteditable-text/_config.js @@ -0,0 +1,37 @@ +export default { + props: { + name: 'world', + }, + + html: ` + world +

      hello world

      + `, + + ssrHtml: ` + world +

      hello world

      + `, + + async test({ assert, component, target, window }) { + const el = target.querySelector('editor'); + assert.equal(el.textContent, 'world'); + + const event = new window.Event('input'); + + el.textContent = 'everybody'; + await el.dispatchEvent(event); + + assert.htmlEqual(target.innerHTML, ` + everybody +

      hello everybody

      + `); + + component.name = 'goodbye'; + assert.equal(el.textContent, 'goodbye'); + assert.htmlEqual(target.innerHTML, ` + goodbye +

      hello goodbye

      + `); + }, +}; diff --git a/test/runtime/samples/contenteditable-text/main.svelte b/test/runtime/samples/contenteditable-text/main.svelte new file mode 100644 index 0000000000..a71d9f0c5b --- /dev/null +++ b/test/runtime/samples/contenteditable-text/main.svelte @@ -0,0 +1,6 @@ + + + +

      hello {name}

      \ No newline at end of file diff --git a/test/validator/samples/contenteditable-dynamic/errors.json b/test/validator/samples/contenteditable-dynamic/errors.json new file mode 100644 index 0000000000..0c4c5585a6 --- /dev/null +++ b/test/validator/samples/contenteditable-dynamic/errors.json @@ -0,0 +1,15 @@ +[{ + "code": "dynamic-contenteditable-attribute", + "message": "'contenteditable' attribute cannot be dynamic if element uses two-way binding", + "start": { + "line": 6, + "column": 8, + "character": 73 + }, + "end": { + "line": 6, + "column": 32, + "character": 97 + }, + "pos": 73 +}] \ No newline at end of file diff --git a/test/validator/samples/contenteditable-dynamic/input.svelte b/test/validator/samples/contenteditable-dynamic/input.svelte new file mode 100644 index 0000000000..97d2c9228c --- /dev/null +++ b/test/validator/samples/contenteditable-dynamic/input.svelte @@ -0,0 +1,6 @@ + + diff --git a/test/validator/samples/contenteditable-missing/errors.json b/test/validator/samples/contenteditable-missing/errors.json new file mode 100644 index 0000000000..9cadb20629 --- /dev/null +++ b/test/validator/samples/contenteditable-missing/errors.json @@ -0,0 +1,15 @@ +[{ + "code": "missing-contenteditable-attribute", + "message": "'contenteditable' attribute is required for text and html two-way bindings", + "start": { + "line": 4, + "column": 8, + "character": 48 + }, + "end": { + "line": 4, + "column": 24, + "character": 64 + }, + "pos": 48 +}] \ No newline at end of file diff --git a/test/validator/samples/contenteditable-missing/input.svelte b/test/validator/samples/contenteditable-missing/input.svelte new file mode 100644 index 0000000000..47f125894a --- /dev/null +++ b/test/validator/samples/contenteditable-missing/input.svelte @@ -0,0 +1,4 @@ + + From b1dc46d4f44d9d04f963f0829da4eb8cf5fd28f6 Mon Sep 17 00:00:00 2001 From: Vlad Glushchuk Date: Mon, 8 Apr 2019 20:56:52 +0200 Subject: [PATCH 108/409] Fix a typo --- src/compiler/compile/render-ssr/handlers/Element.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/compile/render-ssr/handlers/Element.ts b/src/compiler/compile/render-ssr/handlers/Element.ts index 36ae121b53..fc7f7df1a6 100644 --- a/src/compiler/compile/render-ssr/handlers/Element.ts +++ b/src/compiler/compile/render-ssr/handlers/Element.ts @@ -151,7 +151,7 @@ export default function(node: Element, renderer: Renderer, options: RenderOption if (name === 'group') { // TODO server-render group bindings - } else if (contenteditable && (node === 'text' || node === 'html')) { + } else if (contenteditable && (name === 'text' || name === 'html')) { const snippet = snip(expression) if (name == 'text') { node_contents = '${@escape(' + snippet + ')}' From 2cd66c0447cdcf7d1a0f42de513047d553467bcc Mon Sep 17 00:00:00 2001 From: Vlad Glushchuk Date: Sat, 20 Apr 2019 08:11:57 +0200 Subject: [PATCH 109/409] Fix the cursor reset issue --- src/compiler/compile/render-dom/wrappers/Element/Binding.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/compile/render-dom/wrappers/Element/Binding.ts b/src/compiler/compile/render-dom/wrappers/Element/Binding.ts index 8eb5ba8097..74a7bd86ab 100644 --- a/src/compiler/compile/render-dom/wrappers/Element/Binding.ts +++ b/src/compiler/compile/render-dom/wrappers/Element/Binding.ts @@ -196,11 +196,11 @@ function get_dom_updater( } if (binding.node.name === 'text') { - return `${element.var}.textContent = ${binding.snippet};`; + return `if (${binding.snippet} !== ${element.var}.textContent) ${element.var}.textContent = ${binding.snippet};`; } if (binding.node.name === 'html') { - return `${element.var}.innerHTML = ${binding.snippet};`; + return `if (${binding.snippet} !== ${element.var}.innerHTML) ${element.var}.innerHTML = ${binding.snippet};`; } return `${element.var}.${binding.node.name} = ${binding.snippet};`; From f5dde02b9912287cdd4f53fd5af0935af80b57a0 Mon Sep 17 00:00:00 2001 From: Vlad Glushchuk Date: Thu, 6 Jun 2019 10:57:41 +0200 Subject: [PATCH 110/409] Rebase and fix linter warning --- src/compiler/compile/render-ssr/handlers/Element.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/compile/render-ssr/handlers/Element.ts b/src/compiler/compile/render-ssr/handlers/Element.ts index fc7f7df1a6..8b901853d1 100644 --- a/src/compiler/compile/render-ssr/handlers/Element.ts +++ b/src/compiler/compile/render-ssr/handlers/Element.ts @@ -58,7 +58,7 @@ export default function(node: Element, renderer: Renderer, options: RenderOption const contenteditable = ( node.name !== 'textarea' && node.name !== 'input' && - node.attributes.some((attribute: Node) => attribute.name === 'contenteditable') + node.attributes.some((attribute) => attribute.name === 'contenteditable') ); const slot = node.get_static_attribute_value('slot'); From 234db33eb4d43f9456d61ca1f5e39205e75a3311 Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Thu, 6 Jun 2019 07:44:15 -0400 Subject: [PATCH 111/409] add test for class: directive special characters --- .../samples/directive-special-character/expected.css | 1 + .../samples/directive-special-character/expected.html | 1 + .../samples/directive-special-character/input.svelte | 11 +++++++++++ 3 files changed, 13 insertions(+) create mode 100644 test/css/samples/directive-special-character/expected.css create mode 100644 test/css/samples/directive-special-character/expected.html create mode 100644 test/css/samples/directive-special-character/input.svelte diff --git a/test/css/samples/directive-special-character/expected.css b/test/css/samples/directive-special-character/expected.css new file mode 100644 index 0000000000..8b25d59d2e --- /dev/null +++ b/test/css/samples/directive-special-character/expected.css @@ -0,0 +1 @@ +.foo\:bar.svelte-xyz{color:red} \ No newline at end of file diff --git a/test/css/samples/directive-special-character/expected.html b/test/css/samples/directive-special-character/expected.html new file mode 100644 index 0000000000..40eff4ca21 --- /dev/null +++ b/test/css/samples/directive-special-character/expected.html @@ -0,0 +1 @@ +
      Hello world
      \ No newline at end of file diff --git a/test/css/samples/directive-special-character/input.svelte b/test/css/samples/directive-special-character/input.svelte new file mode 100644 index 0000000000..8f95fe1355 --- /dev/null +++ b/test/css/samples/directive-special-character/input.svelte @@ -0,0 +1,11 @@ + + +
      Hello world
      + + From 535d66851677ada16410dc7e567d1b3e170bab32 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Thu, 6 Jun 2019 08:20:46 -0400 Subject: [PATCH 112/409] Change text to a sentence, since we're ending it with a period --- .../tutorial/01-introduction/03-dynamic-attributes/text.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/site/content/tutorial/01-introduction/03-dynamic-attributes/text.md b/site/content/tutorial/01-introduction/03-dynamic-attributes/text.md index 7c75f25168..c503b4f548 100644 --- a/site/content/tutorial/01-introduction/03-dynamic-attributes/text.md +++ b/site/content/tutorial/01-introduction/03-dynamic-attributes/text.md @@ -19,10 +19,10 @@ When building web apps, it's important to make sure that they're *accessible* to In this case, we're missing the `alt` attribute that describes the image for people using screenreaders, or people with slow or flaky internet connections that can't download the image. Let's add one: ```html -A man dancing. +A man dances. ``` -We can use curly braces *inside* attributes. Try changing it to `"{name} dancing."` — remember to declare a `name` variable in the ` -{name} dancing. +{name} dances. From 570098e8dd2b26d4f5befba85a30f996cdfd561a Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Thu, 6 Jun 2019 09:05:20 -0400 Subject: [PATCH 114/409] restructure --- site/content/docs/02-template-syntax.md | 341 ++++++++++++------------ site/src/routes/docs/_sections.js | 16 +- 2 files changed, 181 insertions(+), 176 deletions(-) diff --git a/site/content/docs/02-template-syntax.md b/site/content/docs/02-template-syntax.md index 497396af30..bc82e7b8ae 100644 --- a/site/content/docs/02-template-syntax.md +++ b/site/content/docs/02-template-syntax.md @@ -101,27 +101,7 @@ Text can also contain JavaScript expressions: ``` -### HTML expressions - -```sv -{@html expression} -``` - ---- - -In a text expression, characters like `<` and `>` are escaped. With HTML expressions, they're not. - -> Svelte does not sanitize expressions before injecting HTML. If the data comes from an untrusted source, you must sanitize it, or you are exposing your users to an XSS vulnerability. - -```html -
      -

      {post.title}

      - {@html post.content} -
      -``` - - -### If blocks +### `{#if ...}` ```sv {#if expression}...{/if} @@ -158,7 +138,7 @@ Additional conditions can be added with `{:else if expression}`, optionally endi ``` -### Each blocks +### `{#each ...}` ```sv {#each expression as name}...{/each} @@ -229,7 +209,7 @@ An each block can also have an `{:else}` clause, which is rendered if the list i ``` -### Await blocks +### `{#await ...}` ```sv {#await expression}...{:then name}...{:catch name}...{/await} @@ -283,7 +263,77 @@ If you don't care about the pending state, you can also omit the initial block. ``` -### DOM events (on:eventname) +### `{@html ...}` + +```sv +{@html expression} +``` + +--- + +In a text expression, characters like `<` and `>` are escaped. With HTML expressions, they're not. + +> Svelte does not sanitize expressions before injecting HTML. If the data comes from an untrusted source, you must sanitize it, or you are exposing your users to an XSS vulnerability. + +```html +
      +

      {post.title}

      + {@html post.content} +
      +``` + + +### `{@debug ...}` + +```sv +{@debug} +``` +```sv +{@debug var1, var2, ..., varN} +``` + +--- + +The `{@debug ...}` tag offers an alternative to `console.log(...)`. It logs the values of specific variables whenever they change, and pauses code execution if you have devtools open. + +It accepts a comma-separated list of variable names (not arbitrary expressions). + +```html + + +{@debug user} + +

      Hello {user.firstname}!

      +``` + +--- + +`{@debug ...}` accepts a comma-separated list of variable names (not arbitrary expressions). + +```html + +{@debug user} +{@debug user1, user2, user3} + + +{@debug user.firstname} +{@debug myArray[0]} +{@debug !isReady} +{@debug typeof user === 'object'} +``` + +The `{@debug}` tag without any arguments will insert a `debugger` statement that gets triggered when *any* state changes, as opposed to the specified variables. + + + +### Element directives + +#### on:*event* ```sv on:eventname={handler} @@ -370,29 +420,7 @@ It's possible to have multiple event listeners for the same event: ``` -### Component events (on:eventname) - -```sv -on:eventname={handler} -``` - ---- - -Components can emit events using [createEventDispatcher](docs#createEventDispatcher), or by forwarding DOM events. Listening for component events looks the same as listening for DOM events: - -```html - -``` - ---- - -As with DOM events, if the `on:` directive is used without a value, the component will *forward* the event, meaning that a consumer of the component can listen for it. - -```html - -``` - -### Element bindings (bind:property) +#### bind:*name* ```sv bind:property={variable} @@ -436,7 +464,7 @@ Numeric input values are coerced; even though `input.value` is a string as far a ``` -#### Binding related elements (bind:group) +#### `bind:group` --- @@ -460,6 +488,28 @@ Inputs that work together can use `bind:group`. ``` +#### `bind:this` (elements) + +--- + +To get a reference to a DOM node, use `bind:this`. + +```html + + + +``` + + #### Binding ` +

      some text

      `, diff --git a/test/server-side-rendering/samples/text-area-bind/_expected.html b/test/server-side-rendering/samples/text-area-bind/_expected.html new file mode 100644 index 0000000000..c3c8441f56 --- /dev/null +++ b/test/server-side-rendering/samples/text-area-bind/_expected.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/test/server-side-rendering/samples/text-area-bind/main.svelte b/test/server-side-rendering/samples/text-area-bind/main.svelte new file mode 100644 index 0000000000..7126e09375 --- /dev/null +++ b/test/server-side-rendering/samples/text-area-bind/main.svelte @@ -0,0 +1,5 @@ + + + \ No newline at end of file From 0dde4f51e0b1c9231d8b696a191fa46f8a473d5d Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Sun, 9 Jun 2019 11:08:49 -0400 Subject: [PATCH 120/409] Update text.md --- site/content/tutorial/03-props/02-default-values/text.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/content/tutorial/03-props/02-default-values/text.md b/site/content/tutorial/03-props/02-default-values/text.md index dda6a370fe..1532407380 100644 --- a/site/content/tutorial/03-props/02-default-values/text.md +++ b/site/content/tutorial/03-props/02-default-values/text.md @@ -10,9 +10,9 @@ We can easily specify default values for props: ``` -If we now instantiate the component without an `answer` prop, it will fall back to the default: +If we now add a second component *without* an `answer` prop, it will fall back to the default: ```html -``` \ No newline at end of file +``` From caebe0deb80d959ad7c7b5276d7e017be71769c7 Mon Sep 17 00:00:00 2001 From: James Garbutt <43081j@users.noreply.github.com> Date: Sun, 9 Jun 2019 16:31:28 +0100 Subject: [PATCH 121/409] Introduce ESLint to svelte sources (#2958) * introduce eslint * add lint npm script * first eslint run * use tsc stronger checks for unused vars * fix strict typescript unused checks * reintroduce unicode oddities * revert ordering changes * revert whitespace changes * set indent lint rule as error and ignore outliers * revert some more unicode * reintroduce scissors unicode again --- .eslintignore | 8 +- .eslintrc.json | 115 ++- package-lock.json | 941 ++++++++++++++++++ package.json | 7 +- src/compiler/Stats.ts | 2 +- src/compiler/compile/Component.ts | 77 +- src/compiler/compile/create_module.ts | 16 +- src/compiler/compile/css/Selector.ts | 6 +- src/compiler/compile/css/Stylesheet.ts | 12 +- src/compiler/compile/index.ts | 7 +- src/compiler/compile/nodes/Attribute.ts | 2 +- src/compiler/compile/nodes/EachBlock.ts | 16 +- src/compiler/compile/nodes/Element.ts | 6 +- src/compiler/compile/nodes/InlineComponent.ts | 2 + src/compiler/compile/nodes/PendingBlock.ts | 2 +- src/compiler/compile/nodes/Window.ts | 4 +- src/compiler/compile/nodes/interfaces.ts | 58 +- .../compile/nodes/shared/Expression.ts | 10 +- src/compiler/compile/nodes/shared/Node.ts | 2 +- src/compiler/compile/render-dom/Block.ts | 10 +- src/compiler/compile/render-dom/Renderer.ts | 4 +- src/compiler/compile/render-dom/index.ts | 10 +- .../compile/render-dom/wrappers/Body.ts | 2 +- .../compile/render-dom/wrappers/DebugTag.ts | 6 +- .../compile/render-dom/wrappers/EachBlock.ts | 2 +- .../render-dom/wrappers/Element/Attribute.ts | 6 +- .../render-dom/wrappers/Element/Binding.ts | 23 +- .../wrappers/Element/StyleAttribute.ts | 12 +- .../render-dom/wrappers/Element/index.ts | 20 +- .../compile/render-dom/wrappers/Fragment.ts | 7 +- .../compile/render-dom/wrappers/Head.ts | 2 +- .../compile/render-dom/wrappers/IfBlock.ts | 10 +- .../wrappers/InlineComponent/index.ts | 12 +- .../compile/render-dom/wrappers/Slot.ts | 4 +- .../compile/render-dom/wrappers/Title.ts | 9 +- .../compile/render-dom/wrappers/Window.ts | 5 +- .../render-dom/wrappers/shared/Wrapper.ts | 2 +- .../render-dom/wrappers/shared/add_actions.ts | 5 +- src/compiler/compile/render-ssr/Renderer.ts | 6 +- .../compile/render-ssr/handlers/EachBlock.ts | 2 +- .../compile/render-ssr/handlers/Element.ts | 1 - .../compile/render-ssr/handlers/HtmlTag.ts | 2 +- .../compile/render-ssr/handlers/Tag.ts | 2 +- .../compile/render-ssr/handlers/Text.ts | 2 +- src/compiler/compile/utils/add_to_set.ts | 2 +- src/compiler/compile/utils/scope.ts | 4 +- src/compiler/interfaces.ts | 36 +- src/compiler/parse/index.ts | 4 +- src/compiler/parse/read/context.ts | 14 +- src/compiler/parse/read/expression.ts | 2 + src/compiler/parse/state/mustache.ts | 2 +- src/compiler/parse/state/tag.ts | 10 +- src/compiler/parse/state/text.ts | 2 +- src/compiler/preprocess/index.ts | 22 +- src/compiler/utils/error.ts | 16 +- src/compiler/utils/full_char_code_at.ts | 4 +- src/compiler/utils/fuzzymatch.ts | 6 +- src/runtime/animate/index.ts | 16 +- src/runtime/internal/Component.ts | 7 +- src/runtime/internal/animations.ts | 2 +- src/runtime/internal/dom.ts | 17 +- src/runtime/internal/loop.ts | 2 +- src/runtime/internal/transitions.ts | 8 +- src/runtime/internal/utils.ts | 2 +- src/runtime/motion/spring.ts | 24 +- src/runtime/motion/tweened.ts | 8 +- src/runtime/store/index.ts | 4 +- src/runtime/transition/index.ts | 26 +- test/.eslintrc.json | 5 + test/runtime/samples/animation-css/_config.js | 4 +- .../samples/animation-js-delay/_config.js | 4 +- .../samples/animation-js-easing/_config.js | 4 +- test/runtime/samples/animation-js/_config.js | 2 +- .../samples/await-containing-if/_config.js | 2 +- test/runtime/samples/await-in-each/_config.js | 2 +- .../samples/await-then-catch-order/_config.js | 2 +- .../samples/await-with-components/_config.js | 3 +- .../_config.js | 2 +- .../samples/element-invalid-name/_config.js | 2 +- .../export-function-hoisting/_config.js | 4 +- .../samples/function-hoisting/_config.js | 10 +- .../samples/get-after-destroy/_config.js | 2 +- .../samples/immutable-nested/_config.js | 3 +- .../samples/immutable-option/_config.js | 1 + .../immutable-svelte-meta-false/_config.js | 1 + .../samples/immutable-svelte-meta/_config.js | 1 + .../runtime/samples/internal-state/_config.js | 28 +- .../samples/mixed-let-export/_config.js | 14 +- test/runtime/samples/prop-exports/_config.js | 46 +- test/runtime/samples/spring/_config.js | 2 +- .../transition-js-await-block/_config.js | 6 +- test/server-side-rendering/index.js | 1 - test/setup.js | 4 +- test/sourcemaps/index.js | 4 +- test/store/index.ts | 2 +- test/test.js | 4 +- test/validator/index.js | 4 +- tsconfig.json | 2 + 98 files changed, 1442 insertions(+), 428 deletions(-) create mode 100644 test/.eslintrc.json diff --git a/.eslintignore b/.eslintignore index 4a113378ce..97a855e951 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,7 +1,3 @@ -src/shared -shared.js -store.js -test/test.js -test/setup.js **/_actual.js -**/expected.js \ No newline at end of file +**/expected.js +test/*/samples/*/output.js diff --git a/.eslintrc.json b/.eslintrc.json index 3d2c0f6869..c821993c40 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,43 +1,76 @@ { - "root": true, - "rules": { - "indent": [2, "tab", { "SwitchCase": 1 }], - "semi": [2, "always"], - "keyword-spacing": [2, { "before": true, "after": true }], - "space-before-blocks": [2, "always"], - "no-mixed-spaces-and-tabs": [2, "smart-tabs"], - "no-cond-assign": 0, - "no-unused-vars": 2, - "object-shorthand": [2, "always"], - "no-const-assign": 2, - "no-class-assign": 2, - "no-this-before-super": 2, - "no-var": 2, - "no-unreachable": 2, - "valid-typeof": 2, - "quote-props": [2, "as-needed"], - "one-var": [2, "never"], - "prefer-arrow-callback": 2, - "prefer-const": [2, { "destructuring": "all" }], - "arrow-spacing": 2, - "no-inner-declarations": 0 - }, - "env": { - "es6": true, - "browser": true, - "node": true, - "mocha": true - }, - "extends": [ - "eslint:recommended", - "plugin:import/errors", - "plugin:import/warnings" - ], - "parserOptions": { - "ecmaVersion": 9, - "sourceType": "module" - }, - "settings": { - "import/core-modules": ["svelte"] - } + "root": true, + "rules": { + "indent": "off", + "no-unused-vars": "off", + "semi": [2, "always"], + "keyword-spacing": [2, { "before": true, "after": true }], + "space-before-blocks": [2, "always"], + "no-mixed-spaces-and-tabs": [2, "smart-tabs"], + "no-cond-assign": 0, + "object-shorthand": [2, "always"], + "no-const-assign": 2, + "no-class-assign": 2, + "no-this-before-super": 2, + "no-var": 2, + "no-unreachable": 2, + "valid-typeof": 2, + "quote-props": [2, "as-needed"], + "one-var": [2, "never"], + "prefer-arrow-callback": 2, + "prefer-const": [2, { "destructuring": "all" }], + "arrow-spacing": 2, + "no-inner-declarations": 0, + "@typescript-eslint/indent": ["error", "tab", { + "SwitchCase": 1, + "ignoredNodes": ["TemplateLiteral"] + }], + "@typescript-eslint/camelcase": "off", + "@typescript-eslint/no-use-before-define": "off", + "@typescript-eslint/array-type": ["error", "array-simple"], + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/explicit-member-accessibility": "off", + "@typescript-eslint/no-unused-vars": ["error", { + "argsIgnorePattern": "^_" + }], + "@typescript-eslint/no-object-literal-type-assertion": ["error", { + "allowAsParameter": true + }], + "@typescript-eslint/no-unused-vars": "off" + }, + "env": { + "es6": true, + "browser": true, + "node": true, + "mocha": true + }, + "extends": [ + "eslint:recommended", + "plugin:import/errors", + "plugin:import/warnings", + "plugin:import/typescript", + "plugin:@typescript-eslint/recommended" + ], + "parserOptions": { + "ecmaVersion": 9, + "sourceType": "module" + }, + "settings": { + "import/core-modules": [ + "svelte", + "svelte/internal", + "svelte/store", + "svelte/easing", + "estree" + ] + }, + "overrides": [ + { + "files": ["*.js"], + "rules": { + "@typescript-eslint/no-var-requires": "off" + } + } + ] } diff --git a/package-lock.json b/package-lock.json index 1c6ced1a92..f1e8bf1d32 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,26 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/code-frame": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", + "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "@babel/highlight": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", + "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + } + }, "@bcoe/v8-coverage": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.1.0.tgz", @@ -44,6 +64,60 @@ "integrity": "sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==", "dev": true }, + "@typescript-eslint/eslint-plugin": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.9.0.tgz", + "integrity": "sha512-FOgfBorxjlBGpDIw+0LaZIXRX6GEEUfzj8LXwaQIUCp+gDOvkI+1WgugJ7SmWiISqK9Vj5r8S7NDKO/LB+6X9A==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "1.9.0", + "@typescript-eslint/parser": "1.9.0", + "eslint-utils": "^1.3.1", + "functional-red-black-tree": "^1.0.1", + "regexpp": "^2.0.1", + "requireindex": "^1.2.0", + "tsutils": "^3.7.0" + } + }, + "@typescript-eslint/experimental-utils": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-1.9.0.tgz", + "integrity": "sha512-1s2dY9XxBwtS9IlSnRIlzqILPyeMly5tz1bfAmQ84Ul687xBBve5YsH5A5EKeIcGurYYqY2w6RkHETXIwnwV0A==", + "dev": true, + "requires": { + "@typescript-eslint/typescript-estree": "1.9.0" + } + }, + "@typescript-eslint/parser": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-1.9.0.tgz", + "integrity": "sha512-CWgC1XrQ34H/+LwAU7vY5xteZDkNqeAkeidEpJnJgkKu0yqQ3ZhQ7S+dI6MX4vmmM1TKRbOrKuXc6W0fIHhdbA==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "1.9.0", + "@typescript-eslint/typescript-estree": "1.9.0", + "eslint-scope": "^4.0.0", + "eslint-visitor-keys": "^1.0.0" + } + }, + "@typescript-eslint/typescript-estree": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-1.9.0.tgz", + "integrity": "sha512-7Eg0TEQpCkTsEwsl1lIzd6i7L3pJLQFWesV08dS87bNz0NeSjbL78gNAP1xCKaCejkds4PhpLnZkaAjx9SU8OA==", + "dev": true, + "requires": { + "lodash.unescape": "4.0.1", + "semver": "5.5.0" + }, + "dependencies": { + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + } + } + }, "abab": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.0.tgz", @@ -72,6 +146,12 @@ "acorn-walk": "^6.0.1" } }, + "acorn-jsx": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.1.tgz", + "integrity": "sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg==", + "dev": true + }, "acorn-walk": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.1.1.tgz", @@ -121,12 +201,27 @@ "uri-js": "^4.2.2" } }, + "ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", + "dev": true + }, "ansi-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, "any-promise": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", @@ -172,6 +267,16 @@ "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", "dev": true }, + "array-includes": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz", + "integrity": "sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0=", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.7.0" + } + }, "arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", @@ -199,6 +304,12 @@ "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", "dev": true }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, "async-limiter": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", @@ -436,12 +547,35 @@ } } }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", "dev": true }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, "class-utils": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", @@ -471,6 +605,21 @@ } } }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, "cliui": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", @@ -517,6 +666,21 @@ "object-visit": "^1.0.0" } }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, "combined-stream": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", @@ -582,6 +746,12 @@ } } }, + "contains-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", + "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", + "dev": true + }, "copy-descriptor": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", @@ -687,6 +857,15 @@ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, "define-property": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", @@ -752,6 +931,15 @@ "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", "dev": true }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, "domexception": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", @@ -771,6 +959,12 @@ "safer-buffer": "^2.1.0" } }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, "end-of-stream": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", @@ -789,6 +983,31 @@ "is-arrayish": "^0.2.1" } }, + "es-abstract": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", + "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.0", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "is-callable": "^1.1.4", + "is-regex": "^1.0.4", + "object-keys": "^1.0.12" + } + }, + "es-to-primitive": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", + "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, "es6-promise": { "version": "4.2.6", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.6.tgz", @@ -831,12 +1050,230 @@ } } }, + "eslint": { + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz", + "integrity": "sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.9.1", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^4.0.3", + "eslint-utils": "^1.3.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^5.0.1", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob": "^7.1.2", + "globals": "^11.7.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^6.2.2", + "js-yaml": "^3.13.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.11", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "path-is-inside": "^1.0.2", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "semver": "^5.5.1", + "strip-ansi": "^4.0.0", + "strip-json-comments": "^2.0.1", + "table": "^5.2.3", + "text-table": "^0.2.0" + }, + "dependencies": { + "ajv": { + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", + "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + } + } + }, + "eslint-import-resolver-node": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz", + "integrity": "sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==", + "dev": true, + "requires": { + "debug": "^2.6.9", + "resolve": "^1.5.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "eslint-module-utils": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.4.0.tgz", + "integrity": "sha512-14tltLm38Eu3zS+mt0KvILC3q8jyIAH518MlG+HO0p+yK885Lb1UHTY/UgR91eOyGdmxAPb+OLoW4znqIT6Ndw==", + "dev": true, + "requires": { + "debug": "^2.6.8", + "pkg-dir": "^2.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "eslint-plugin-import": { + "version": "2.17.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.17.3.tgz", + "integrity": "sha512-qeVf/UwXFJbeyLbxuY8RgqDyEKCkqV7YC+E5S5uOjAp4tOc8zj01JP3ucoBM8JcEqd1qRasJSg6LLlisirfy0Q==", + "dev": true, + "requires": { + "array-includes": "^3.0.3", + "contains-path": "^0.1.0", + "debug": "^2.6.9", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "^0.3.2", + "eslint-module-utils": "^2.4.0", + "has": "^1.0.3", + "lodash": "^4.17.11", + "minimatch": "^3.0.4", + "read-pkg-up": "^2.0.0", + "resolve": "^1.11.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "isarray": "^1.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "resolve": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz", + "integrity": "sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + } + } + }, + "eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz", + "integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==", + "dev": true + }, + "eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", + "dev": true + }, + "espree": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz", + "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==", + "dev": true, + "requires": { + "acorn": "^6.0.7", + "acorn-jsx": "^5.0.0", + "eslint-visitor-keys": "^1.0.0" + } + }, "esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true }, + "esquery": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", + "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "dev": true, + "requires": { + "estraverse": "^4.0.0" + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "^4.1.0" + } + }, "estraverse": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", @@ -897,6 +1334,17 @@ } } }, + "external-editor": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz", + "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==", + "dev": true, + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + } + }, "extract-zip": { "version": "1.6.7", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.7.tgz", @@ -959,6 +1407,50 @@ "pend": "~1.2.0" } }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dev": true, + "requires": { + "flat-cache": "^2.0.1" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + } + }, + "flatted": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.0.tgz", + "integrity": "sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg==", + "dev": true + }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -1019,6 +1511,18 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, "furi": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/furi/-/furi-1.3.0.tgz", @@ -1073,6 +1577,12 @@ "path-is-absolute": "^1.0.0" } }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, "globalyzer": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz", @@ -1125,12 +1635,27 @@ "har-schema": "^2.0.0" } }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, + "has-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", + "dev": true + }, "has-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", @@ -1253,6 +1778,12 @@ "safer-buffer": ">= 2.1.2 < 3" } }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, "ignore-walk": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", @@ -1262,6 +1793,22 @@ "minimatch": "^3.0.4" } }, + "import-fresh": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.0.0.tgz", + "integrity": "sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -1278,6 +1825,44 @@ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, + "inquirer": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.3.1.tgz", + "integrity": "sha512-MmL624rfkFt4TG9y/Jvmt8vdmOo836U7Y0Hxr2aFk3RelZEGX4Igk0KabWrcaaZaTv9uzglOqWh1Vly+FAWAXA==", + "dev": true, + "requires": { + "ansi-escapes": "^3.2.0", + "chalk": "^2.4.2", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^2.0.0", + "lodash": "^4.17.11", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.4.0", + "string-width": "^2.1.0", + "strip-ansi": "^5.1.0", + "through": "^2.3.6" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, "invert-kv": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", @@ -1314,6 +1899,12 @@ "builtin-modules": "^1.0.0" } }, + "is-callable": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", + "dev": true + }, "is-data-descriptor": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", @@ -1323,6 +1914,12 @@ "kind-of": "^3.0.2" } }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true + }, "is-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", @@ -1377,6 +1974,12 @@ } } }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, "is-reference": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.1.1.tgz", @@ -1386,12 +1989,30 @@ "@types/estree": "0.0.39" } }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "dev": true, + "requires": { + "has": "^1.0.1" + } + }, "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", "dev": true }, + "is-symbol": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", + "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "dev": true, + "requires": { + "has-symbols": "^1.0.0" + } + }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", @@ -1448,6 +2069,12 @@ "handlebars": "^4.0.11" } }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, "js-yaml": { "version": "3.13.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", @@ -1515,6 +2142,12 @@ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -1573,12 +2206,34 @@ "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", "dev": true }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" + } + }, "locate-character": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/locate-character/-/locate-character-2.0.5.tgz", "integrity": "sha512-n2GmejDXtOPBAZdIiEFy5dJ5N38xBCXLNOtw2WpB9kGh6pnrEuKlwYI+Tkpofc4wDtVXHtoAOJaMRlYG/oYaxg==", "dev": true }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, "lodash": { "version": "4.17.11", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", @@ -1591,6 +2246,12 @@ "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", "dev": true }, + "lodash.unescape": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.unescape/-/lodash.unescape-4.0.1.tgz", + "integrity": "sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw=", + "dev": true + }, "lru-cache": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", @@ -1811,6 +2472,12 @@ "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, "mz": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", @@ -1861,6 +2528,12 @@ } } }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, "neo-async": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", @@ -1946,6 +2619,12 @@ } } }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, "object-visit": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", @@ -1989,6 +2668,15 @@ "wrappy": "1" } }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, "optimist": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", @@ -2032,6 +2720,12 @@ "mem": "^4.0.0" } }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, "p-defer": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", @@ -2050,6 +2744,48 @@ "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=", "dev": true }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, "parse5": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.0.tgz", @@ -2074,6 +2810,12 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", @@ -2086,6 +2828,15 @@ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "^2.0.0" + } + }, "pend": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", @@ -2098,6 +2849,12 @@ "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", "dev": true }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, "pirates": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.0.tgz", @@ -2107,6 +2864,15 @@ "node-modules-regexp": "^1.0.0" } }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "requires": { + "find-up": "^2.1.0" + } + }, "pn": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", @@ -2193,6 +2959,27 @@ "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", "dev": true }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true, + "requires": { + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" + } + }, "regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", @@ -2203,6 +2990,12 @@ "safe-regex": "^1.1.0" } }, + "regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "dev": true + }, "repeat-element": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", @@ -2275,6 +3068,12 @@ "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", "dev": true }, + "requireindex": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/requireindex/-/requireindex-1.2.0.tgz", + "integrity": "sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==", + "dev": true + }, "resolve": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", @@ -2284,12 +3083,28 @@ "path-parse": "^1.0.6" } }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, "resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", "dev": true }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + }, "ret": { "version": "0.1.15", "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", @@ -2702,6 +3517,24 @@ } } }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "is-promise": "^2.1.0" + } + }, + "rxjs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.2.tgz", + "integrity": "sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -2788,6 +3621,17 @@ "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + } + }, "snapdragon": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", @@ -3080,6 +3924,12 @@ "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "dev": true }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, "sucrase": { "version": "3.9.5", "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.9.5.tgz", @@ -3115,6 +3965,58 @@ "integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY=", "dev": true }, + "table": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.0.tgz", + "integrity": "sha512-nHFDrxmbrkU7JAFKqKbDJXfzrX2UBsWmrieXFTGxiI5e4ncg3VqsZeI4EzNmX0ncp4XNGVeoxIWJXfCIXwrsvw==", + "dev": true, + "requires": { + "ajv": "^6.9.1", + "lodash": "^4.17.11", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "dependencies": { + "ajv": { + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", + "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, "test-exclude": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.0.0.tgz", @@ -3230,6 +4132,12 @@ } } }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, "thenify": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.0.tgz", @@ -3248,6 +4156,12 @@ "thenify": ">= 3.1.0 < 4" } }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, "tiny-glob": { "version": "0.2.6", "resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.6.tgz", @@ -3258,6 +4172,15 @@ "globrex": "^0.1.1" } }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, "to-object-path": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", @@ -3346,6 +4269,15 @@ "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", "dev": true }, + "tsutils": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.14.0.tgz", + "integrity": "sha512-SmzGbB0l+8I0QwsPgjooFRaRvHLBLNYM8SeQ0k6rtNDru5sCGeLJcZdwilNndN+GysuFjF5EIYgN8GfFG6UeUw==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -3664,6 +4596,15 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, + "write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + } + }, "ws": { "version": "6.1.3", "resolved": "https://registry.npmjs.org/ws/-/ws-6.1.3.tgz", diff --git a/package.json b/package.json index d45b37724f..5004c27cfb 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ "prepublishOnly": "export PUBLISH=true && npm test && npm run create-stubs", "create-stubs": "node scripts/create-stubs.js", "tsd": "tsc -p . --emitDeclarationOnly", - "typecheck": "tsc -p . --noEmit" + "typecheck": "tsc -p . --noEmit", + "lint": "eslint \"{src,test}/**/*.{ts,js}\"" }, "repository": { "type": "git", @@ -60,12 +61,16 @@ "@sveltejs/svelte-repl": "0.0.5", "@types/mocha": "^5.2.0", "@types/node": "^10.5.5", + "@typescript-eslint/eslint-plugin": "^1.9.0", + "@typescript-eslint/parser": "^1.9.0", "acorn": "^6.1.1", "acorn-dynamic-import": "^4.0.0", "agadoo": "^1.0.1", "c8": "^3.4.0", "codecov": "^3.0.0", "css-tree": "1.0.0-alpha22", + "eslint": "^5.16.0", + "eslint-plugin-import": "^2.17.3", "estree-walker": "^0.6.1", "is-reference": "^1.1.1", "jsdom": "^12.2.0", diff --git a/src/compiler/Stats.ts b/src/compiler/Stats.ts index c54f1e8ea9..200fa448e9 100644 --- a/src/compiler/Stats.ts +++ b/src/compiler/Stats.ts @@ -5,7 +5,7 @@ const now = (typeof process !== 'undefined' && process.hrtime) } : () => self.performance.now(); -type Timing = { +interface Timing { label: string; start: number; end: number; diff --git a/src/compiler/compile/Component.ts b/src/compiler/compile/Component.ts index e5f3501716..89c1e6b4f6 100644 --- a/src/compiler/compile/Component.ts +++ b/src/compiler/compile/Component.ts @@ -24,13 +24,13 @@ import unwrap_parens from './utils/unwrap_parens'; import Slot from './nodes/Slot'; import { Node as ESTreeNode } from 'estree'; -type ComponentOptions = { +interface ComponentOptions { namespace?: string; tag?: string; immutable?: boolean; accessors?: boolean; preserveWhitespace?: boolean; -}; +} // We need to tell estree-walker that it should always // look for an `else` block, otherwise it might get @@ -97,7 +97,7 @@ export default class Component { node_for_declaration: Map = new Map(); partly_hoisted: string[] = []; fully_hoisted: string[] = []; - reactive_declarations: Array<{ assignees: Set, dependencies: Set, node: Node, declaration: Node }> = []; + reactive_declarations: Array<{ assignees: Set; dependencies: Set; node: Node; declaration: Node }> = []; reactive_declaration_nodes: Set = new Set(); has_reactive_assignments = false; injected_reactive_declaration_vars: Set = new Set(); @@ -106,12 +106,12 @@ export default class Component { indirect_dependencies: Map> = new Map(); file: string; - locate: (c: number) => { line: number, column: number }; + locate: (c: number) => { line: number; column: number }; // TODO this does the same as component.locate! remove one or the other locator: (search: number, startIndex?: number) => { - line: number, - column: number + line: number; + column: number; }; stylesheet: Stylesheet; @@ -140,6 +140,7 @@ export default class Component { this.compile_options = compile_options; this.file = compile_options.filename && ( + // eslint-disable-next-line no-useless-escape typeof process !== 'undefined' ? compile_options.filename.replace(process.cwd(), '').replace(/^[\/\\]/, '') : compile_options.filename ); this.locate = getLocator(this.source); @@ -248,7 +249,7 @@ export default class Component { result = result .replace(/__svelte:self__/g, this.name) - .replace(compile_options.generate === 'ssr' ? /(@+|#+)(\w*(?:-\w*)?)/g : /(@+)(\w*(?:-\w*)?)/g, (match: string, sigil: string, name: string) => { + .replace(compile_options.generate === 'ssr' ? /(@+|#+)(\w*(?:-\w*)?)/g : /(@+)(\w*(?:-\w*)?)/g, (_match: string, sigil: string, name: string) => { if (sigil === '@') { if (internal_exports.has(name)) { if (compile_options.dev && internal_exports.has(`${name}Dev`)) name = `${name}Dev`; @@ -379,7 +380,7 @@ export default class Component { reserved.forEach(add); internal_exports.forEach(add); - this.var_lookup.forEach((value, key) => add(key)); + this.var_lookup.forEach((_value, key) => add(key)); return (name: string) => { if (test) name = `${name}$`; @@ -398,12 +399,12 @@ export default class Component { error( pos: { - start: number, - end: number + start: number; + end: number; }, - e : { - code: string, - message: string + e: { + code: string; + message: string; } ) { error(e.message, { @@ -418,12 +419,12 @@ export default class Component { warn( pos: { - start: number, - end: number + start: number; + end: number; }, warning: { - code: string, - message: string + code: string; + message: string; } ) { if (!this.locator) { @@ -527,7 +528,7 @@ export default class Component { let result = ''; - script.content.body.forEach((node, i) => { + script.content.body.forEach((node) => { if (this.hoistable_nodes.has(node) || this.reactive_declaration_nodes.has(node)) { if (a !== b) result += `[✂${a}-${b}✂]`; a = node.end; @@ -564,7 +565,7 @@ export default class Component { this.add_sourcemap_locations(script.content); - let { scope, globals } = create_scopes(script.content); + const { scope, globals } = create_scopes(script.content); this.module_scope = scope; scope.declarations.forEach((node, name) => { @@ -588,7 +589,7 @@ export default class Component { this.error(node, { code: 'illegal-subscription', message: `Cannot reference store value inside - - - - - - - - - - - -``` - -#### `bind:this` (elements) - ---- - -To get a reference to a DOM node, use `bind:this`. - -```html - - - -``` - -#### Binding `` value --- @@ -550,7 +502,7 @@ When the value of an `