w3ps1/_app/immutable/chunks/helpers-88229792.js
2023-04-28 12:29:35 +00:00

7554 lines
201 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { o as onMount, S as SvelteComponent, i as init, s as safe_not_equal, e as empty, b as insert_hydration, g as group_outros, t as transition_out, d as check_outros, f as transition_in, h as detach, M as compute_rest_props, N as assign, O as exclude_internal_props, K as destroy_each, x as create_component, y as claim_component, z as mount_component, P as get_spread_update, Q as get_spread_object, A as destroy_component, w as construct_svelte_component, a as space, c as claim_space, q as text, r as claim_text, u as set_data, C as noop, R as getContext, D as create_slot, k as element, l as claim_element, m as children, n as attr, H as update_slot_base, I as get_all_dirty_from_scope, J as get_slot_changes, E as src_url_equal, F as append_hydration, T as HtmlTagHydration, U as claim_html_tag, V as createEventDispatcher, W as setContext } from "./index-2a025a89.js";
function supressWarnings() {
const origWarn = console.warn;
console.warn = (message) => {
if (message.includes("unknown prop"))
return;
if (message.includes("unexpected slot"))
return;
origWarn(message);
};
onMount(() => {
console.warn = origWarn;
});
}
function get_each_context_5(ctx, list, i) {
const child_ctx = ctx.slice();
child_ctx[18] = list[i];
return child_ctx;
}
function get_each_context_4(ctx, list, i) {
const child_ctx = ctx.slice();
child_ctx[18] = list[i];
return child_ctx;
}
function get_each_context_1(ctx, list, i) {
const child_ctx = ctx.slice();
child_ctx[10] = list[i];
return child_ctx;
}
function get_each_context_2(ctx, list, i) {
const child_ctx = ctx.slice();
child_ctx[13] = list[i];
child_ctx[15] = i;
return child_ctx;
}
function get_each_context_3(ctx, list, i) {
const child_ctx = ctx.slice();
child_ctx[16] = list[i];
child_ctx[15] = i;
return child_ctx;
}
function get_each_context(ctx, list, i) {
const child_ctx = ctx.slice();
child_ctx[7] = list[i];
return child_ctx;
}
function create_if_block_1$1(ctx) {
let current_block_type_index;
let if_block;
let if_block_anchor;
let current;
const if_block_creators = [create_if_block_2$1, create_if_block_3$1, create_else_block_1];
const if_blocks = [];
function select_block_type_1(ctx2, dirty) {
if (
/*type*/
ctx2[0] === "table"
)
return 0;
if (
/*type*/
ctx2[0] === "list"
)
return 1;
return 2;
}
current_block_type_index = select_block_type_1(ctx);
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
return {
c() {
if_block.c();
if_block_anchor = empty();
},
l(nodes) {
if_block.l(nodes);
if_block_anchor = empty();
},
m(target, anchor) {
if_blocks[current_block_type_index].m(target, anchor);
insert_hydration(target, if_block_anchor, anchor);
current = true;
},
p(ctx2, dirty) {
let previous_block_index = current_block_type_index;
current_block_type_index = select_block_type_1(ctx2);
if (current_block_type_index === previous_block_index) {
if_blocks[current_block_type_index].p(ctx2, dirty);
} else {
group_outros();
transition_out(if_blocks[previous_block_index], 1, 1, () => {
if_blocks[previous_block_index] = null;
});
check_outros();
if_block = if_blocks[current_block_type_index];
if (!if_block) {
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2);
if_block.c();
} else {
if_block.p(ctx2, dirty);
}
transition_in(if_block, 1);
if_block.m(if_block_anchor.parentNode, if_block_anchor);
}
},
i(local) {
if (current)
return;
transition_in(if_block);
current = true;
},
o(local) {
transition_out(if_block);
current = false;
},
d(detaching) {
if_blocks[current_block_type_index].d(detaching);
if (detaching)
detach(if_block_anchor);
}
};
}
function create_if_block$3(ctx) {
let each_1_anchor;
let current;
let each_value = (
/*tokens*/
ctx[1]
);
let each_blocks = [];
for (let i = 0; i < each_value.length; i += 1) {
each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
}
const out = (i) => transition_out(each_blocks[i], 1, 1, () => {
each_blocks[i] = null;
});
return {
c() {
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].c();
}
each_1_anchor = empty();
},
l(nodes) {
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].l(nodes);
}
each_1_anchor = empty();
},
m(target, anchor) {
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(target, anchor);
}
insert_hydration(target, each_1_anchor, anchor);
current = true;
},
p(ctx2, dirty) {
if (dirty & /*tokens, renderers*/
34) {
each_value = /*tokens*/
ctx2[1];
let i;
for (i = 0; i < each_value.length; i += 1) {
const child_ctx = get_each_context(ctx2, each_value, i);
if (each_blocks[i]) {
each_blocks[i].p(child_ctx, dirty);
transition_in(each_blocks[i], 1);
} else {
each_blocks[i] = create_each_block(child_ctx);
each_blocks[i].c();
transition_in(each_blocks[i], 1);
each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
}
}
group_outros();
for (i = each_value.length; i < each_blocks.length; i += 1) {
out(i);
}
check_outros();
}
},
i(local) {
if (current)
return;
for (let i = 0; i < each_value.length; i += 1) {
transition_in(each_blocks[i]);
}
current = true;
},
o(local) {
each_blocks = each_blocks.filter(Boolean);
for (let i = 0; i < each_blocks.length; i += 1) {
transition_out(each_blocks[i]);
}
current = false;
},
d(detaching) {
destroy_each(each_blocks, detaching);
if (detaching)
detach(each_1_anchor);
}
};
}
function create_else_block_1(ctx) {
let switch_instance;
let switch_instance_anchor;
let current;
const switch_instance_spread_levels = [
/*$$restProps*/
ctx[6]
];
var switch_value = (
/*renderers*/
ctx[5][
/*type*/
ctx[0]
]
);
function switch_props(ctx2) {
let switch_instance_props = {
$$slots: { default: [create_default_slot_11] },
$$scope: { ctx: ctx2 }
};
for (let i = 0; i < switch_instance_spread_levels.length; i += 1) {
switch_instance_props = assign(switch_instance_props, switch_instance_spread_levels[i]);
}
return { props: switch_instance_props };
}
if (switch_value) {
switch_instance = construct_svelte_component(switch_value, switch_props(ctx));
}
return {
c() {
if (switch_instance)
create_component(switch_instance.$$.fragment);
switch_instance_anchor = empty();
},
l(nodes) {
if (switch_instance)
claim_component(switch_instance.$$.fragment, nodes);
switch_instance_anchor = empty();
},
m(target, anchor) {
if (switch_instance)
mount_component(switch_instance, target, anchor);
insert_hydration(target, switch_instance_anchor, anchor);
current = true;
},
p(ctx2, dirty) {
const switch_instance_changes = dirty & /*$$restProps*/
64 ? get_spread_update(switch_instance_spread_levels, [get_spread_object(
/*$$restProps*/
ctx2[6]
)]) : {};
if (dirty & /*$$scope, tokens, renderers, $$restProps*/
8388706) {
switch_instance_changes.$$scope = { dirty, ctx: ctx2 };
}
if (switch_value !== (switch_value = /*renderers*/
ctx2[5][
/*type*/
ctx2[0]
])) {
if (switch_instance) {
group_outros();
const old_component = switch_instance;
transition_out(old_component.$$.fragment, 1, 0, () => {
destroy_component(old_component, 1);
});
check_outros();
}
if (switch_value) {
switch_instance = construct_svelte_component(switch_value, switch_props(ctx2));
create_component(switch_instance.$$.fragment);
transition_in(switch_instance.$$.fragment, 1);
mount_component(switch_instance, switch_instance_anchor.parentNode, switch_instance_anchor);
} else {
switch_instance = null;
}
} else if (switch_value) {
switch_instance.$set(switch_instance_changes);
}
},
i(local) {
if (current)
return;
if (switch_instance)
transition_in(switch_instance.$$.fragment, local);
current = true;
},
o(local) {
if (switch_instance)
transition_out(switch_instance.$$.fragment, local);
current = false;
},
d(detaching) {
if (detaching)
detach(switch_instance_anchor);
if (switch_instance)
destroy_component(switch_instance, detaching);
}
};
}
function create_if_block_3$1(ctx) {
let current_block_type_index;
let if_block;
let if_block_anchor;
let current;
const if_block_creators = [create_if_block_4$1, create_else_block$3];
const if_blocks = [];
function select_block_type_2(ctx2, dirty) {
if (
/*ordered*/
ctx2[4]
)
return 0;
return 1;
}
current_block_type_index = select_block_type_2(ctx);
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
return {
c() {
if_block.c();
if_block_anchor = empty();
},
l(nodes) {
if_block.l(nodes);
if_block_anchor = empty();
},
m(target, anchor) {
if_blocks[current_block_type_index].m(target, anchor);
insert_hydration(target, if_block_anchor, anchor);
current = true;
},
p(ctx2, dirty) {
let previous_block_index = current_block_type_index;
current_block_type_index = select_block_type_2(ctx2);
if (current_block_type_index === previous_block_index) {
if_blocks[current_block_type_index].p(ctx2, dirty);
} else {
group_outros();
transition_out(if_blocks[previous_block_index], 1, 1, () => {
if_blocks[previous_block_index] = null;
});
check_outros();
if_block = if_blocks[current_block_type_index];
if (!if_block) {
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2);
if_block.c();
} else {
if_block.p(ctx2, dirty);
}
transition_in(if_block, 1);
if_block.m(if_block_anchor.parentNode, if_block_anchor);
}
},
i(local) {
if (current)
return;
transition_in(if_block);
current = true;
},
o(local) {
transition_out(if_block);
current = false;
},
d(detaching) {
if_blocks[current_block_type_index].d(detaching);
if (detaching)
detach(if_block_anchor);
}
};
}
function create_if_block_2$1(ctx) {
let switch_instance;
let switch_instance_anchor;
let current;
var switch_value = (
/*renderers*/
ctx[5].table
);
function switch_props(ctx2) {
return {
props: {
$$slots: { default: [create_default_slot] },
$$scope: { ctx: ctx2 }
}
};
}
if (switch_value) {
switch_instance = construct_svelte_component(switch_value, switch_props(ctx));
}
return {
c() {
if (switch_instance)
create_component(switch_instance.$$.fragment);
switch_instance_anchor = empty();
},
l(nodes) {
if (switch_instance)
claim_component(switch_instance.$$.fragment, nodes);
switch_instance_anchor = empty();
},
m(target, anchor) {
if (switch_instance)
mount_component(switch_instance, target, anchor);
insert_hydration(target, switch_instance_anchor, anchor);
current = true;
},
p(ctx2, dirty) {
const switch_instance_changes = {};
if (dirty & /*$$scope, renderers, rows, $$restProps, header*/
8388716) {
switch_instance_changes.$$scope = { dirty, ctx: ctx2 };
}
if (switch_value !== (switch_value = /*renderers*/
ctx2[5].table)) {
if (switch_instance) {
group_outros();
const old_component = switch_instance;
transition_out(old_component.$$.fragment, 1, 0, () => {
destroy_component(old_component, 1);
});
check_outros();
}
if (switch_value) {
switch_instance = construct_svelte_component(switch_value, switch_props(ctx2));
create_component(switch_instance.$$.fragment);
transition_in(switch_instance.$$.fragment, 1);
mount_component(switch_instance, switch_instance_anchor.parentNode, switch_instance_anchor);
} else {
switch_instance = null;
}
} else if (switch_value) {
switch_instance.$set(switch_instance_changes);
}
},
i(local) {
if (current)
return;
if (switch_instance)
transition_in(switch_instance.$$.fragment, local);
current = true;
},
o(local) {
if (switch_instance)
transition_out(switch_instance.$$.fragment, local);
current = false;
},
d(detaching) {
if (detaching)
detach(switch_instance_anchor);
if (switch_instance)
destroy_component(switch_instance, detaching);
}
};
}
function create_else_block_2(ctx) {
let t_value = (
/*$$restProps*/
ctx[6].raw + ""
);
let t;
return {
c() {
t = text(t_value);
},
l(nodes) {
t = claim_text(nodes, t_value);
},
m(target, anchor) {
insert_hydration(target, t, anchor);
},
p(ctx2, dirty) {
if (dirty & /*$$restProps*/
64 && t_value !== (t_value = /*$$restProps*/
ctx2[6].raw + ""))
set_data(t, t_value);
},
i: noop,
o: noop,
d(detaching) {
if (detaching)
detach(t);
}
};
}
function create_if_block_5$1(ctx) {
let parser;
let current;
parser = new Parser$1({
props: {
tokens: (
/*tokens*/
ctx[1]
),
renderers: (
/*renderers*/
ctx[5]
)
}
});
return {
c() {
create_component(parser.$$.fragment);
},
l(nodes) {
claim_component(parser.$$.fragment, nodes);
},
m(target, anchor) {
mount_component(parser, target, anchor);
current = true;
},
p(ctx2, dirty) {
const parser_changes = {};
if (dirty & /*tokens*/
2)
parser_changes.tokens = /*tokens*/
ctx2[1];
if (dirty & /*renderers*/
32)
parser_changes.renderers = /*renderers*/
ctx2[5];
parser.$set(parser_changes);
},
i(local) {
if (current)
return;
transition_in(parser.$$.fragment, local);
current = true;
},
o(local) {
transition_out(parser.$$.fragment, local);
current = false;
},
d(detaching) {
destroy_component(parser, detaching);
}
};
}
function create_default_slot_11(ctx) {
let current_block_type_index;
let if_block;
let if_block_anchor;
let current;
const if_block_creators = [create_if_block_5$1, create_else_block_2];
const if_blocks = [];
function select_block_type_3(ctx2, dirty) {
if (
/*tokens*/
ctx2[1]
)
return 0;
return 1;
}
current_block_type_index = select_block_type_3(ctx);
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
return {
c() {
if_block.c();
if_block_anchor = empty();
},
l(nodes) {
if_block.l(nodes);
if_block_anchor = empty();
},
m(target, anchor) {
if_blocks[current_block_type_index].m(target, anchor);
insert_hydration(target, if_block_anchor, anchor);
current = true;
},
p(ctx2, dirty) {
let previous_block_index = current_block_type_index;
current_block_type_index = select_block_type_3(ctx2);
if (current_block_type_index === previous_block_index) {
if_blocks[current_block_type_index].p(ctx2, dirty);
} else {
group_outros();
transition_out(if_blocks[previous_block_index], 1, 1, () => {
if_blocks[previous_block_index] = null;
});
check_outros();
if_block = if_blocks[current_block_type_index];
if (!if_block) {
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2);
if_block.c();
} else {
if_block.p(ctx2, dirty);
}
transition_in(if_block, 1);
if_block.m(if_block_anchor.parentNode, if_block_anchor);
}
},
i(local) {
if (current)
return;
transition_in(if_block);
current = true;
},
o(local) {
transition_out(if_block);
current = false;
},
d(detaching) {
if_blocks[current_block_type_index].d(detaching);
if (detaching)
detach(if_block_anchor);
}
};
}
function create_else_block$3(ctx) {
let switch_instance;
let switch_instance_anchor;
let current;
const switch_instance_spread_levels = [
{ ordered: (
/*ordered*/
ctx[4]
) },
/*$$restProps*/
ctx[6]
];
var switch_value = (
/*renderers*/
ctx[5].list
);
function switch_props(ctx2) {
let switch_instance_props = {
$$slots: { default: [create_default_slot_9] },
$$scope: { ctx: ctx2 }
};
for (let i = 0; i < switch_instance_spread_levels.length; i += 1) {
switch_instance_props = assign(switch_instance_props, switch_instance_spread_levels[i]);
}
return { props: switch_instance_props };
}
if (switch_value) {
switch_instance = construct_svelte_component(switch_value, switch_props(ctx));
}
return {
c() {
if (switch_instance)
create_component(switch_instance.$$.fragment);
switch_instance_anchor = empty();
},
l(nodes) {
if (switch_instance)
claim_component(switch_instance.$$.fragment, nodes);
switch_instance_anchor = empty();
},
m(target, anchor) {
if (switch_instance)
mount_component(switch_instance, target, anchor);
insert_hydration(target, switch_instance_anchor, anchor);
current = true;
},
p(ctx2, dirty) {
const switch_instance_changes = dirty & /*ordered, $$restProps*/
80 ? get_spread_update(switch_instance_spread_levels, [
dirty & /*ordered*/
16 && { ordered: (
/*ordered*/
ctx2[4]
) },
dirty & /*$$restProps*/
64 && get_spread_object(
/*$$restProps*/
ctx2[6]
)
]) : {};
if (dirty & /*$$scope, $$restProps, renderers*/
8388704) {
switch_instance_changes.$$scope = { dirty, ctx: ctx2 };
}
if (switch_value !== (switch_value = /*renderers*/
ctx2[5].list)) {
if (switch_instance) {
group_outros();
const old_component = switch_instance;
transition_out(old_component.$$.fragment, 1, 0, () => {
destroy_component(old_component, 1);
});
check_outros();
}
if (switch_value) {
switch_instance = construct_svelte_component(switch_value, switch_props(ctx2));
create_component(switch_instance.$$.fragment);
transition_in(switch_instance.$$.fragment, 1);
mount_component(switch_instance, switch_instance_anchor.parentNode, switch_instance_anchor);
} else {
switch_instance = null;
}
} else if (switch_value) {
switch_instance.$set(switch_instance_changes);
}
},
i(local) {
if (current)
return;
if (switch_instance)
transition_in(switch_instance.$$.fragment, local);
current = true;
},
o(local) {
if (switch_instance)
transition_out(switch_instance.$$.fragment, local);
current = false;
},
d(detaching) {
if (detaching)
detach(switch_instance_anchor);
if (switch_instance)
destroy_component(switch_instance, detaching);
}
};
}
function create_if_block_4$1(ctx) {
let switch_instance;
let switch_instance_anchor;
let current;
const switch_instance_spread_levels = [
{ ordered: (
/*ordered*/
ctx[4]
) },
/*$$restProps*/
ctx[6]
];
var switch_value = (
/*renderers*/
ctx[5].list
);
function switch_props(ctx2) {
let switch_instance_props = {
$$slots: { default: [create_default_slot_7] },
$$scope: { ctx: ctx2 }
};
for (let i = 0; i < switch_instance_spread_levels.length; i += 1) {
switch_instance_props = assign(switch_instance_props, switch_instance_spread_levels[i]);
}
return { props: switch_instance_props };
}
if (switch_value) {
switch_instance = construct_svelte_component(switch_value, switch_props(ctx));
}
return {
c() {
if (switch_instance)
create_component(switch_instance.$$.fragment);
switch_instance_anchor = empty();
},
l(nodes) {
if (switch_instance)
claim_component(switch_instance.$$.fragment, nodes);
switch_instance_anchor = empty();
},
m(target, anchor) {
if (switch_instance)
mount_component(switch_instance, target, anchor);
insert_hydration(target, switch_instance_anchor, anchor);
current = true;
},
p(ctx2, dirty) {
const switch_instance_changes = dirty & /*ordered, $$restProps*/
80 ? get_spread_update(switch_instance_spread_levels, [
dirty & /*ordered*/
16 && { ordered: (
/*ordered*/
ctx2[4]
) },
dirty & /*$$restProps*/
64 && get_spread_object(
/*$$restProps*/
ctx2[6]
)
]) : {};
if (dirty & /*$$scope, $$restProps, renderers*/
8388704) {
switch_instance_changes.$$scope = { dirty, ctx: ctx2 };
}
if (switch_value !== (switch_value = /*renderers*/
ctx2[5].list)) {
if (switch_instance) {
group_outros();
const old_component = switch_instance;
transition_out(old_component.$$.fragment, 1, 0, () => {
destroy_component(old_component, 1);
});
check_outros();
}
if (switch_value) {
switch_instance = construct_svelte_component(switch_value, switch_props(ctx2));
create_component(switch_instance.$$.fragment);
transition_in(switch_instance.$$.fragment, 1);
mount_component(switch_instance, switch_instance_anchor.parentNode, switch_instance_anchor);
} else {
switch_instance = null;
}
} else if (switch_value) {
switch_instance.$set(switch_instance_changes);
}
},
i(local) {
if (current)
return;
if (switch_instance)
transition_in(switch_instance.$$.fragment, local);
current = true;
},
o(local) {
if (switch_instance)
transition_out(switch_instance.$$.fragment, local);
current = false;
},
d(detaching) {
if (detaching)
detach(switch_instance_anchor);
if (switch_instance)
destroy_component(switch_instance, detaching);
}
};
}
function create_default_slot_10(ctx) {
let parser;
let t;
let current;
parser = new Parser$1({
props: {
tokens: (
/*item*/
ctx[18].tokens
),
renderers: (
/*renderers*/
ctx[5]
)
}
});
return {
c() {
create_component(parser.$$.fragment);
t = space();
},
l(nodes) {
claim_component(parser.$$.fragment, nodes);
t = claim_space(nodes);
},
m(target, anchor) {
mount_component(parser, target, anchor);
insert_hydration(target, t, anchor);
current = true;
},
p(ctx2, dirty) {
const parser_changes = {};
if (dirty & /*$$restProps*/
64)
parser_changes.tokens = /*item*/
ctx2[18].tokens;
if (dirty & /*renderers*/
32)
parser_changes.renderers = /*renderers*/
ctx2[5];
parser.$set(parser_changes);
},
i(local) {
if (current)
return;
transition_in(parser.$$.fragment, local);
current = true;
},
o(local) {
transition_out(parser.$$.fragment, local);
current = false;
},
d(detaching) {
destroy_component(parser, detaching);
if (detaching)
detach(t);
}
};
}
function create_each_block_5(ctx) {
let switch_instance;
let switch_instance_anchor;
let current;
const switch_instance_spread_levels = [
/*item*/
ctx[18]
];
var switch_value = (
/*renderers*/
ctx[5].unorderedlistitem || /*renderers*/
ctx[5].listitem
);
function switch_props(ctx2) {
let switch_instance_props = {
$$slots: { default: [create_default_slot_10] },
$$scope: { ctx: ctx2 }
};
for (let i = 0; i < switch_instance_spread_levels.length; i += 1) {
switch_instance_props = assign(switch_instance_props, switch_instance_spread_levels[i]);
}
return { props: switch_instance_props };
}
if (switch_value) {
switch_instance = construct_svelte_component(switch_value, switch_props(ctx));
}
return {
c() {
if (switch_instance)
create_component(switch_instance.$$.fragment);
switch_instance_anchor = empty();
},
l(nodes) {
if (switch_instance)
claim_component(switch_instance.$$.fragment, nodes);
switch_instance_anchor = empty();
},
m(target, anchor) {
if (switch_instance)
mount_component(switch_instance, target, anchor);
insert_hydration(target, switch_instance_anchor, anchor);
current = true;
},
p(ctx2, dirty) {
const switch_instance_changes = dirty & /*$$restProps*/
64 ? get_spread_update(switch_instance_spread_levels, [get_spread_object(
/*item*/
ctx2[18]
)]) : {};
if (dirty & /*$$scope, $$restProps, renderers*/
8388704) {
switch_instance_changes.$$scope = { dirty, ctx: ctx2 };
}
if (switch_value !== (switch_value = /*renderers*/
ctx2[5].unorderedlistitem || /*renderers*/
ctx2[5].listitem)) {
if (switch_instance) {
group_outros();
const old_component = switch_instance;
transition_out(old_component.$$.fragment, 1, 0, () => {
destroy_component(old_component, 1);
});
check_outros();
}
if (switch_value) {
switch_instance = construct_svelte_component(switch_value, switch_props(ctx2));
create_component(switch_instance.$$.fragment);
transition_in(switch_instance.$$.fragment, 1);
mount_component(switch_instance, switch_instance_anchor.parentNode, switch_instance_anchor);
} else {
switch_instance = null;
}
} else if (switch_value) {
switch_instance.$set(switch_instance_changes);
}
},
i(local) {
if (current)
return;
if (switch_instance)
transition_in(switch_instance.$$.fragment, local);
current = true;
},
o(local) {
if (switch_instance)
transition_out(switch_instance.$$.fragment, local);
current = false;
},
d(detaching) {
if (detaching)
detach(switch_instance_anchor);
if (switch_instance)
destroy_component(switch_instance, detaching);
}
};
}
function create_default_slot_9(ctx) {
let each_1_anchor;
let current;
let each_value_5 = (
/*$$restProps*/
ctx[6].items
);
let each_blocks = [];
for (let i = 0; i < each_value_5.length; i += 1) {
each_blocks[i] = create_each_block_5(get_each_context_5(ctx, each_value_5, i));
}
const out = (i) => transition_out(each_blocks[i], 1, 1, () => {
each_blocks[i] = null;
});
return {
c() {
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].c();
}
each_1_anchor = empty();
},
l(nodes) {
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].l(nodes);
}
each_1_anchor = empty();
},
m(target, anchor) {
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(target, anchor);
}
insert_hydration(target, each_1_anchor, anchor);
current = true;
},
p(ctx2, dirty) {
if (dirty & /*renderers, $$restProps*/
96) {
each_value_5 = /*$$restProps*/
ctx2[6].items;
let i;
for (i = 0; i < each_value_5.length; i += 1) {
const child_ctx = get_each_context_5(ctx2, each_value_5, i);
if (each_blocks[i]) {
each_blocks[i].p(child_ctx, dirty);
transition_in(each_blocks[i], 1);
} else {
each_blocks[i] = create_each_block_5(child_ctx);
each_blocks[i].c();
transition_in(each_blocks[i], 1);
each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
}
}
group_outros();
for (i = each_value_5.length; i < each_blocks.length; i += 1) {
out(i);
}
check_outros();
}
},
i(local) {
if (current)
return;
for (let i = 0; i < each_value_5.length; i += 1) {
transition_in(each_blocks[i]);
}
current = true;
},
o(local) {
each_blocks = each_blocks.filter(Boolean);
for (let i = 0; i < each_blocks.length; i += 1) {
transition_out(each_blocks[i]);
}
current = false;
},
d(detaching) {
destroy_each(each_blocks, detaching);
if (detaching)
detach(each_1_anchor);
}
};
}
function create_default_slot_8(ctx) {
let parser;
let t;
let current;
parser = new Parser$1({
props: {
tokens: (
/*item*/
ctx[18].tokens
),
renderers: (
/*renderers*/
ctx[5]
)
}
});
return {
c() {
create_component(parser.$$.fragment);
t = space();
},
l(nodes) {
claim_component(parser.$$.fragment, nodes);
t = claim_space(nodes);
},
m(target, anchor) {
mount_component(parser, target, anchor);
insert_hydration(target, t, anchor);
current = true;
},
p(ctx2, dirty) {
const parser_changes = {};
if (dirty & /*$$restProps*/
64)
parser_changes.tokens = /*item*/
ctx2[18].tokens;
if (dirty & /*renderers*/
32)
parser_changes.renderers = /*renderers*/
ctx2[5];
parser.$set(parser_changes);
},
i(local) {
if (current)
return;
transition_in(parser.$$.fragment, local);
current = true;
},
o(local) {
transition_out(parser.$$.fragment, local);
current = false;
},
d(detaching) {
destroy_component(parser, detaching);
if (detaching)
detach(t);
}
};
}
function create_each_block_4(ctx) {
let switch_instance;
let switch_instance_anchor;
let current;
const switch_instance_spread_levels = [
/*item*/
ctx[18]
];
var switch_value = (
/*renderers*/
ctx[5].orderedlistitem || /*renderers*/
ctx[5].listitem
);
function switch_props(ctx2) {
let switch_instance_props = {
$$slots: { default: [create_default_slot_8] },
$$scope: { ctx: ctx2 }
};
for (let i = 0; i < switch_instance_spread_levels.length; i += 1) {
switch_instance_props = assign(switch_instance_props, switch_instance_spread_levels[i]);
}
return { props: switch_instance_props };
}
if (switch_value) {
switch_instance = construct_svelte_component(switch_value, switch_props(ctx));
}
return {
c() {
if (switch_instance)
create_component(switch_instance.$$.fragment);
switch_instance_anchor = empty();
},
l(nodes) {
if (switch_instance)
claim_component(switch_instance.$$.fragment, nodes);
switch_instance_anchor = empty();
},
m(target, anchor) {
if (switch_instance)
mount_component(switch_instance, target, anchor);
insert_hydration(target, switch_instance_anchor, anchor);
current = true;
},
p(ctx2, dirty) {
const switch_instance_changes = dirty & /*$$restProps*/
64 ? get_spread_update(switch_instance_spread_levels, [get_spread_object(
/*item*/
ctx2[18]
)]) : {};
if (dirty & /*$$scope, $$restProps, renderers*/
8388704) {
switch_instance_changes.$$scope = { dirty, ctx: ctx2 };
}
if (switch_value !== (switch_value = /*renderers*/
ctx2[5].orderedlistitem || /*renderers*/
ctx2[5].listitem)) {
if (switch_instance) {
group_outros();
const old_component = switch_instance;
transition_out(old_component.$$.fragment, 1, 0, () => {
destroy_component(old_component, 1);
});
check_outros();
}
if (switch_value) {
switch_instance = construct_svelte_component(switch_value, switch_props(ctx2));
create_component(switch_instance.$$.fragment);
transition_in(switch_instance.$$.fragment, 1);
mount_component(switch_instance, switch_instance_anchor.parentNode, switch_instance_anchor);
} else {
switch_instance = null;
}
} else if (switch_value) {
switch_instance.$set(switch_instance_changes);
}
},
i(local) {
if (current)
return;
if (switch_instance)
transition_in(switch_instance.$$.fragment, local);
current = true;
},
o(local) {
if (switch_instance)
transition_out(switch_instance.$$.fragment, local);
current = false;
},
d(detaching) {
if (detaching)
detach(switch_instance_anchor);
if (switch_instance)
destroy_component(switch_instance, detaching);
}
};
}
function create_default_slot_7(ctx) {
let each_1_anchor;
let current;
let each_value_4 = (
/*$$restProps*/
ctx[6].items
);
let each_blocks = [];
for (let i = 0; i < each_value_4.length; i += 1) {
each_blocks[i] = create_each_block_4(get_each_context_4(ctx, each_value_4, i));
}
const out = (i) => transition_out(each_blocks[i], 1, 1, () => {
each_blocks[i] = null;
});
return {
c() {
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].c();
}
each_1_anchor = empty();
},
l(nodes) {
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].l(nodes);
}
each_1_anchor = empty();
},
m(target, anchor) {
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(target, anchor);
}
insert_hydration(target, each_1_anchor, anchor);
current = true;
},
p(ctx2, dirty) {
if (dirty & /*renderers, $$restProps*/
96) {
each_value_4 = /*$$restProps*/
ctx2[6].items;
let i;
for (i = 0; i < each_value_4.length; i += 1) {
const child_ctx = get_each_context_4(ctx2, each_value_4, i);
if (each_blocks[i]) {
each_blocks[i].p(child_ctx, dirty);
transition_in(each_blocks[i], 1);
} else {
each_blocks[i] = create_each_block_4(child_ctx);
each_blocks[i].c();
transition_in(each_blocks[i], 1);
each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
}
}
group_outros();
for (i = each_value_4.length; i < each_blocks.length; i += 1) {
out(i);
}
check_outros();
}
},
i(local) {
if (current)
return;
for (let i = 0; i < each_value_4.length; i += 1) {
transition_in(each_blocks[i]);
}
current = true;
},
o(local) {
each_blocks = each_blocks.filter(Boolean);
for (let i = 0; i < each_blocks.length; i += 1) {
transition_out(each_blocks[i]);
}
current = false;
},
d(detaching) {
destroy_each(each_blocks, detaching);
if (detaching)
detach(each_1_anchor);
}
};
}
function create_default_slot_6(ctx) {
let parser;
let t;
let current;
parser = new Parser$1({
props: {
tokens: (
/*headerItem*/
ctx[16].tokens
),
renderers: (
/*renderers*/
ctx[5]
)
}
});
return {
c() {
create_component(parser.$$.fragment);
t = space();
},
l(nodes) {
claim_component(parser.$$.fragment, nodes);
t = claim_space(nodes);
},
m(target, anchor) {
mount_component(parser, target, anchor);
insert_hydration(target, t, anchor);
current = true;
},
p(ctx2, dirty) {
const parser_changes = {};
if (dirty & /*header*/
4)
parser_changes.tokens = /*headerItem*/
ctx2[16].tokens;
if (dirty & /*renderers*/
32)
parser_changes.renderers = /*renderers*/
ctx2[5];
parser.$set(parser_changes);
},
i(local) {
if (current)
return;
transition_in(parser.$$.fragment, local);
current = true;
},
o(local) {
transition_out(parser.$$.fragment, local);
current = false;
},
d(detaching) {
destroy_component(parser, detaching);
if (detaching)
detach(t);
}
};
}
function create_each_block_3(ctx) {
let switch_instance;
let switch_instance_anchor;
let current;
var switch_value = (
/*renderers*/
ctx[5].tablecell
);
function switch_props(ctx2) {
return {
props: {
header: true,
align: (
/*$$restProps*/
ctx2[6].align[
/*i*/
ctx2[15]
] || "center"
),
$$slots: { default: [create_default_slot_6] },
$$scope: { ctx: ctx2 }
}
};
}
if (switch_value) {
switch_instance = construct_svelte_component(switch_value, switch_props(ctx));
}
return {
c() {
if (switch_instance)
create_component(switch_instance.$$.fragment);
switch_instance_anchor = empty();
},
l(nodes) {
if (switch_instance)
claim_component(switch_instance.$$.fragment, nodes);
switch_instance_anchor = empty();
},
m(target, anchor) {
if (switch_instance)
mount_component(switch_instance, target, anchor);
insert_hydration(target, switch_instance_anchor, anchor);
current = true;
},
p(ctx2, dirty) {
const switch_instance_changes = {};
if (dirty & /*$$restProps*/
64)
switch_instance_changes.align = /*$$restProps*/
ctx2[6].align[
/*i*/
ctx2[15]
] || "center";
if (dirty & /*$$scope, header, renderers*/
8388644) {
switch_instance_changes.$$scope = { dirty, ctx: ctx2 };
}
if (switch_value !== (switch_value = /*renderers*/
ctx2[5].tablecell)) {
if (switch_instance) {
group_outros();
const old_component = switch_instance;
transition_out(old_component.$$.fragment, 1, 0, () => {
destroy_component(old_component, 1);
});
check_outros();
}
if (switch_value) {
switch_instance = construct_svelte_component(switch_value, switch_props(ctx2));
create_component(switch_instance.$$.fragment);
transition_in(switch_instance.$$.fragment, 1);
mount_component(switch_instance, switch_instance_anchor.parentNode, switch_instance_anchor);
} else {
switch_instance = null;
}
} else if (switch_value) {
switch_instance.$set(switch_instance_changes);
}
},
i(local) {
if (current)
return;
if (switch_instance)
transition_in(switch_instance.$$.fragment, local);
current = true;
},
o(local) {
if (switch_instance)
transition_out(switch_instance.$$.fragment, local);
current = false;
},
d(detaching) {
if (detaching)
detach(switch_instance_anchor);
if (switch_instance)
destroy_component(switch_instance, detaching);
}
};
}
function create_default_slot_5(ctx) {
let each_1_anchor;
let current;
let each_value_3 = (
/*header*/
ctx[2]
);
let each_blocks = [];
for (let i = 0; i < each_value_3.length; i += 1) {
each_blocks[i] = create_each_block_3(get_each_context_3(ctx, each_value_3, i));
}
const out = (i) => transition_out(each_blocks[i], 1, 1, () => {
each_blocks[i] = null;
});
return {
c() {
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].c();
}
each_1_anchor = empty();
},
l(nodes) {
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].l(nodes);
}
each_1_anchor = empty();
},
m(target, anchor) {
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(target, anchor);
}
insert_hydration(target, each_1_anchor, anchor);
current = true;
},
p(ctx2, dirty) {
if (dirty & /*renderers, $$restProps, header*/
100) {
each_value_3 = /*header*/
ctx2[2];
let i;
for (i = 0; i < each_value_3.length; i += 1) {
const child_ctx = get_each_context_3(ctx2, each_value_3, i);
if (each_blocks[i]) {
each_blocks[i].p(child_ctx, dirty);
transition_in(each_blocks[i], 1);
} else {
each_blocks[i] = create_each_block_3(child_ctx);
each_blocks[i].c();
transition_in(each_blocks[i], 1);
each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
}
}
group_outros();
for (i = each_value_3.length; i < each_blocks.length; i += 1) {
out(i);
}
check_outros();
}
},
i(local) {
if (current)
return;
for (let i = 0; i < each_value_3.length; i += 1) {
transition_in(each_blocks[i]);
}
current = true;
},
o(local) {
each_blocks = each_blocks.filter(Boolean);
for (let i = 0; i < each_blocks.length; i += 1) {
transition_out(each_blocks[i]);
}
current = false;
},
d(detaching) {
destroy_each(each_blocks, detaching);
if (detaching)
detach(each_1_anchor);
}
};
}
function create_default_slot_4(ctx) {
let switch_instance;
let switch_instance_anchor;
let current;
var switch_value = (
/*renderers*/
ctx[5].tablerow
);
function switch_props(ctx2) {
return {
props: {
$$slots: { default: [create_default_slot_5] },
$$scope: { ctx: ctx2 }
}
};
}
if (switch_value) {
switch_instance = construct_svelte_component(switch_value, switch_props(ctx));
}
return {
c() {
if (switch_instance)
create_component(switch_instance.$$.fragment);
switch_instance_anchor = empty();
},
l(nodes) {
if (switch_instance)
claim_component(switch_instance.$$.fragment, nodes);
switch_instance_anchor = empty();
},
m(target, anchor) {
if (switch_instance)
mount_component(switch_instance, target, anchor);
insert_hydration(target, switch_instance_anchor, anchor);
current = true;
},
p(ctx2, dirty) {
const switch_instance_changes = {};
if (dirty & /*$$scope, header, renderers, $$restProps*/
8388708) {
switch_instance_changes.$$scope = { dirty, ctx: ctx2 };
}
if (switch_value !== (switch_value = /*renderers*/
ctx2[5].tablerow)) {
if (switch_instance) {
group_outros();
const old_component = switch_instance;
transition_out(old_component.$$.fragment, 1, 0, () => {
destroy_component(old_component, 1);
});
check_outros();
}
if (switch_value) {
switch_instance = construct_svelte_component(switch_value, switch_props(ctx2));
create_component(switch_instance.$$.fragment);
transition_in(switch_instance.$$.fragment, 1);
mount_component(switch_instance, switch_instance_anchor.parentNode, switch_instance_anchor);
} else {
switch_instance = null;
}
} else if (switch_value) {
switch_instance.$set(switch_instance_changes);
}
},
i(local) {
if (current)
return;
if (switch_instance)
transition_in(switch_instance.$$.fragment, local);
current = true;
},
o(local) {
if (switch_instance)
transition_out(switch_instance.$$.fragment, local);
current = false;
},
d(detaching) {
if (detaching)
detach(switch_instance_anchor);
if (switch_instance)
destroy_component(switch_instance, detaching);
}
};
}
function create_default_slot_3(ctx) {
let parser;
let current;
parser = new Parser$1({
props: {
tokens: (
/*cells*/
ctx[13].tokens
),
renderers: (
/*renderers*/
ctx[5]
)
}
});
return {
c() {
create_component(parser.$$.fragment);
},
l(nodes) {
claim_component(parser.$$.fragment, nodes);
},
m(target, anchor) {
mount_component(parser, target, anchor);
current = true;
},
p(ctx2, dirty) {
const parser_changes = {};
if (dirty & /*rows*/
8)
parser_changes.tokens = /*cells*/
ctx2[13].tokens;
if (dirty & /*renderers*/
32)
parser_changes.renderers = /*renderers*/
ctx2[5];
parser.$set(parser_changes);
},
i(local) {
if (current)
return;
transition_in(parser.$$.fragment, local);
current = true;
},
o(local) {
transition_out(parser.$$.fragment, local);
current = false;
},
d(detaching) {
destroy_component(parser, detaching);
}
};
}
function create_each_block_2(ctx) {
let switch_instance;
let switch_instance_anchor;
let current;
var switch_value = (
/*renderers*/
ctx[5].tablecell
);
function switch_props(ctx2) {
return {
props: {
header: false,
align: (
/*$$restProps*/
ctx2[6].align[
/*i*/
ctx2[15]
] || "center"
),
$$slots: { default: [create_default_slot_3] },
$$scope: { ctx: ctx2 }
}
};
}
if (switch_value) {
switch_instance = construct_svelte_component(switch_value, switch_props(ctx));
}
return {
c() {
if (switch_instance)
create_component(switch_instance.$$.fragment);
switch_instance_anchor = empty();
},
l(nodes) {
if (switch_instance)
claim_component(switch_instance.$$.fragment, nodes);
switch_instance_anchor = empty();
},
m(target, anchor) {
if (switch_instance)
mount_component(switch_instance, target, anchor);
insert_hydration(target, switch_instance_anchor, anchor);
current = true;
},
p(ctx2, dirty) {
const switch_instance_changes = {};
if (dirty & /*$$restProps*/
64)
switch_instance_changes.align = /*$$restProps*/
ctx2[6].align[
/*i*/
ctx2[15]
] || "center";
if (dirty & /*$$scope, rows, renderers*/
8388648) {
switch_instance_changes.$$scope = { dirty, ctx: ctx2 };
}
if (switch_value !== (switch_value = /*renderers*/
ctx2[5].tablecell)) {
if (switch_instance) {
group_outros();
const old_component = switch_instance;
transition_out(old_component.$$.fragment, 1, 0, () => {
destroy_component(old_component, 1);
});
check_outros();
}
if (switch_value) {
switch_instance = construct_svelte_component(switch_value, switch_props(ctx2));
create_component(switch_instance.$$.fragment);
transition_in(switch_instance.$$.fragment, 1);
mount_component(switch_instance, switch_instance_anchor.parentNode, switch_instance_anchor);
} else {
switch_instance = null;
}
} else if (switch_value) {
switch_instance.$set(switch_instance_changes);
}
},
i(local) {
if (current)
return;
if (switch_instance)
transition_in(switch_instance.$$.fragment, local);
current = true;
},
o(local) {
if (switch_instance)
transition_out(switch_instance.$$.fragment, local);
current = false;
},
d(detaching) {
if (detaching)
detach(switch_instance_anchor);
if (switch_instance)
destroy_component(switch_instance, detaching);
}
};
}
function create_default_slot_2(ctx) {
let t;
let current;
let each_value_2 = (
/*row*/
ctx[10]
);
let each_blocks = [];
for (let i = 0; i < each_value_2.length; i += 1) {
each_blocks[i] = create_each_block_2(get_each_context_2(ctx, each_value_2, i));
}
const out = (i) => transition_out(each_blocks[i], 1, 1, () => {
each_blocks[i] = null;
});
return {
c() {
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].c();
}
t = space();
},
l(nodes) {
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].l(nodes);
}
t = claim_space(nodes);
},
m(target, anchor) {
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(target, anchor);
}
insert_hydration(target, t, anchor);
current = true;
},
p(ctx2, dirty) {
if (dirty & /*renderers, $$restProps, rows*/
104) {
each_value_2 = /*row*/
ctx2[10];
let i;
for (i = 0; i < each_value_2.length; i += 1) {
const child_ctx = get_each_context_2(ctx2, each_value_2, i);
if (each_blocks[i]) {
each_blocks[i].p(child_ctx, dirty);
transition_in(each_blocks[i], 1);
} else {
each_blocks[i] = create_each_block_2(child_ctx);
each_blocks[i].c();
transition_in(each_blocks[i], 1);
each_blocks[i].m(t.parentNode, t);
}
}
group_outros();
for (i = each_value_2.length; i < each_blocks.length; i += 1) {
out(i);
}
check_outros();
}
},
i(local) {
if (current)
return;
for (let i = 0; i < each_value_2.length; i += 1) {
transition_in(each_blocks[i]);
}
current = true;
},
o(local) {
each_blocks = each_blocks.filter(Boolean);
for (let i = 0; i < each_blocks.length; i += 1) {
transition_out(each_blocks[i]);
}
current = false;
},
d(detaching) {
destroy_each(each_blocks, detaching);
if (detaching)
detach(t);
}
};
}
function create_each_block_1(ctx) {
let switch_instance;
let switch_instance_anchor;
let current;
var switch_value = (
/*renderers*/
ctx[5].tablerow
);
function switch_props(ctx2) {
return {
props: {
$$slots: { default: [create_default_slot_2] },
$$scope: { ctx: ctx2 }
}
};
}
if (switch_value) {
switch_instance = construct_svelte_component(switch_value, switch_props(ctx));
}
return {
c() {
if (switch_instance)
create_component(switch_instance.$$.fragment);
switch_instance_anchor = empty();
},
l(nodes) {
if (switch_instance)
claim_component(switch_instance.$$.fragment, nodes);
switch_instance_anchor = empty();
},
m(target, anchor) {
if (switch_instance)
mount_component(switch_instance, target, anchor);
insert_hydration(target, switch_instance_anchor, anchor);
current = true;
},
p(ctx2, dirty) {
const switch_instance_changes = {};
if (dirty & /*$$scope, rows, renderers, $$restProps*/
8388712) {
switch_instance_changes.$$scope = { dirty, ctx: ctx2 };
}
if (switch_value !== (switch_value = /*renderers*/
ctx2[5].tablerow)) {
if (switch_instance) {
group_outros();
const old_component = switch_instance;
transition_out(old_component.$$.fragment, 1, 0, () => {
destroy_component(old_component, 1);
});
check_outros();
}
if (switch_value) {
switch_instance = construct_svelte_component(switch_value, switch_props(ctx2));
create_component(switch_instance.$$.fragment);
transition_in(switch_instance.$$.fragment, 1);
mount_component(switch_instance, switch_instance_anchor.parentNode, switch_instance_anchor);
} else {
switch_instance = null;
}
} else if (switch_value) {
switch_instance.$set(switch_instance_changes);
}
},
i(local) {
if (current)
return;
if (switch_instance)
transition_in(switch_instance.$$.fragment, local);
current = true;
},
o(local) {
if (switch_instance)
transition_out(switch_instance.$$.fragment, local);
current = false;
},
d(detaching) {
if (detaching)
detach(switch_instance_anchor);
if (switch_instance)
destroy_component(switch_instance, detaching);
}
};
}
function create_default_slot_1(ctx) {
let each_1_anchor;
let current;
let each_value_1 = (
/*rows*/
ctx[3]
);
let each_blocks = [];
for (let i = 0; i < each_value_1.length; i += 1) {
each_blocks[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i));
}
const out = (i) => transition_out(each_blocks[i], 1, 1, () => {
each_blocks[i] = null;
});
return {
c() {
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].c();
}
each_1_anchor = empty();
},
l(nodes) {
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].l(nodes);
}
each_1_anchor = empty();
},
m(target, anchor) {
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(target, anchor);
}
insert_hydration(target, each_1_anchor, anchor);
current = true;
},
p(ctx2, dirty) {
if (dirty & /*renderers, rows, $$restProps*/
104) {
each_value_1 = /*rows*/
ctx2[3];
let i;
for (i = 0; i < each_value_1.length; i += 1) {
const child_ctx = get_each_context_1(ctx2, each_value_1, i);
if (each_blocks[i]) {
each_blocks[i].p(child_ctx, dirty);
transition_in(each_blocks[i], 1);
} else {
each_blocks[i] = create_each_block_1(child_ctx);
each_blocks[i].c();
transition_in(each_blocks[i], 1);
each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
}
}
group_outros();
for (i = each_value_1.length; i < each_blocks.length; i += 1) {
out(i);
}
check_outros();
}
},
i(local) {
if (current)
return;
for (let i = 0; i < each_value_1.length; i += 1) {
transition_in(each_blocks[i]);
}
current = true;
},
o(local) {
each_blocks = each_blocks.filter(Boolean);
for (let i = 0; i < each_blocks.length; i += 1) {
transition_out(each_blocks[i]);
}
current = false;
},
d(detaching) {
destroy_each(each_blocks, detaching);
if (detaching)
detach(each_1_anchor);
}
};
}
function create_default_slot(ctx) {
let switch_instance0;
let t;
let switch_instance1;
let switch_instance1_anchor;
let current;
var switch_value = (
/*renderers*/
ctx[5].tablehead
);
function switch_props(ctx2) {
return {
props: {
$$slots: { default: [create_default_slot_4] },
$$scope: { ctx: ctx2 }
}
};
}
if (switch_value) {
switch_instance0 = construct_svelte_component(switch_value, switch_props(ctx));
}
var switch_value_1 = (
/*renderers*/
ctx[5].tablebody
);
function switch_props_1(ctx2) {
return {
props: {
$$slots: { default: [create_default_slot_1] },
$$scope: { ctx: ctx2 }
}
};
}
if (switch_value_1) {
switch_instance1 = construct_svelte_component(switch_value_1, switch_props_1(ctx));
}
return {
c() {
if (switch_instance0)
create_component(switch_instance0.$$.fragment);
t = space();
if (switch_instance1)
create_component(switch_instance1.$$.fragment);
switch_instance1_anchor = empty();
},
l(nodes) {
if (switch_instance0)
claim_component(switch_instance0.$$.fragment, nodes);
t = claim_space(nodes);
if (switch_instance1)
claim_component(switch_instance1.$$.fragment, nodes);
switch_instance1_anchor = empty();
},
m(target, anchor) {
if (switch_instance0)
mount_component(switch_instance0, target, anchor);
insert_hydration(target, t, anchor);
if (switch_instance1)
mount_component(switch_instance1, target, anchor);
insert_hydration(target, switch_instance1_anchor, anchor);
current = true;
},
p(ctx2, dirty) {
const switch_instance0_changes = {};
if (dirty & /*$$scope, renderers, header, $$restProps*/
8388708) {
switch_instance0_changes.$$scope = { dirty, ctx: ctx2 };
}
if (switch_value !== (switch_value = /*renderers*/
ctx2[5].tablehead)) {
if (switch_instance0) {
group_outros();
const old_component = switch_instance0;
transition_out(old_component.$$.fragment, 1, 0, () => {
destroy_component(old_component, 1);
});
check_outros();
}
if (switch_value) {
switch_instance0 = construct_svelte_component(switch_value, switch_props(ctx2));
create_component(switch_instance0.$$.fragment);
transition_in(switch_instance0.$$.fragment, 1);
mount_component(switch_instance0, t.parentNode, t);
} else {
switch_instance0 = null;
}
} else if (switch_value) {
switch_instance0.$set(switch_instance0_changes);
}
const switch_instance1_changes = {};
if (dirty & /*$$scope, rows, renderers, $$restProps*/
8388712) {
switch_instance1_changes.$$scope = { dirty, ctx: ctx2 };
}
if (switch_value_1 !== (switch_value_1 = /*renderers*/
ctx2[5].tablebody)) {
if (switch_instance1) {
group_outros();
const old_component = switch_instance1;
transition_out(old_component.$$.fragment, 1, 0, () => {
destroy_component(old_component, 1);
});
check_outros();
}
if (switch_value_1) {
switch_instance1 = construct_svelte_component(switch_value_1, switch_props_1(ctx2));
create_component(switch_instance1.$$.fragment);
transition_in(switch_instance1.$$.fragment, 1);
mount_component(switch_instance1, switch_instance1_anchor.parentNode, switch_instance1_anchor);
} else {
switch_instance1 = null;
}
} else if (switch_value_1) {
switch_instance1.$set(switch_instance1_changes);
}
},
i(local) {
if (current)
return;
if (switch_instance0)
transition_in(switch_instance0.$$.fragment, local);
if (switch_instance1)
transition_in(switch_instance1.$$.fragment, local);
current = true;
},
o(local) {
if (switch_instance0)
transition_out(switch_instance0.$$.fragment, local);
if (switch_instance1)
transition_out(switch_instance1.$$.fragment, local);
current = false;
},
d(detaching) {
if (switch_instance0)
destroy_component(switch_instance0, detaching);
if (detaching)
detach(t);
if (detaching)
detach(switch_instance1_anchor);
if (switch_instance1)
destroy_component(switch_instance1, detaching);
}
};
}
function create_each_block(ctx) {
let parser;
let current;
const parser_spread_levels = [
/*token*/
ctx[7],
{ renderers: (
/*renderers*/
ctx[5]
) }
];
let parser_props = {};
for (let i = 0; i < parser_spread_levels.length; i += 1) {
parser_props = assign(parser_props, parser_spread_levels[i]);
}
parser = new Parser$1({ props: parser_props });
return {
c() {
create_component(parser.$$.fragment);
},
l(nodes) {
claim_component(parser.$$.fragment, nodes);
},
m(target, anchor) {
mount_component(parser, target, anchor);
current = true;
},
p(ctx2, dirty) {
const parser_changes = dirty & /*tokens, renderers*/
34 ? get_spread_update(parser_spread_levels, [
dirty & /*tokens*/
2 && get_spread_object(
/*token*/
ctx2[7]
),
dirty & /*renderers*/
32 && { renderers: (
/*renderers*/
ctx2[5]
) }
]) : {};
parser.$set(parser_changes);
},
i(local) {
if (current)
return;
transition_in(parser.$$.fragment, local);
current = true;
},
o(local) {
transition_out(parser.$$.fragment, local);
current = false;
},
d(detaching) {
destroy_component(parser, detaching);
}
};
}
function create_fragment$m(ctx) {
let current_block_type_index;
let if_block;
let if_block_anchor;
let current;
const if_block_creators = [create_if_block$3, create_if_block_1$1];
const if_blocks = [];
function select_block_type(ctx2, dirty) {
if (!/*type*/
ctx2[0])
return 0;
if (
/*renderers*/
ctx2[5][
/*type*/
ctx2[0]
]
)
return 1;
return -1;
}
if (~(current_block_type_index = select_block_type(ctx))) {
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
}
return {
c() {
if (if_block)
if_block.c();
if_block_anchor = empty();
},
l(nodes) {
if (if_block)
if_block.l(nodes);
if_block_anchor = empty();
},
m(target, anchor) {
if (~current_block_type_index) {
if_blocks[current_block_type_index].m(target, anchor);
}
insert_hydration(target, if_block_anchor, anchor);
current = true;
},
p(ctx2, [dirty]) {
let previous_block_index = current_block_type_index;
current_block_type_index = select_block_type(ctx2);
if (current_block_type_index === previous_block_index) {
if (~current_block_type_index) {
if_blocks[current_block_type_index].p(ctx2, dirty);
}
} else {
if (if_block) {
group_outros();
transition_out(if_blocks[previous_block_index], 1, 1, () => {
if_blocks[previous_block_index] = null;
});
check_outros();
}
if (~current_block_type_index) {
if_block = if_blocks[current_block_type_index];
if (!if_block) {
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2);
if_block.c();
} else {
if_block.p(ctx2, dirty);
}
transition_in(if_block, 1);
if_block.m(if_block_anchor.parentNode, if_block_anchor);
} else {
if_block = null;
}
}
},
i(local) {
if (current)
return;
transition_in(if_block);
current = true;
},
o(local) {
transition_out(if_block);
current = false;
},
d(detaching) {
if (~current_block_type_index) {
if_blocks[current_block_type_index].d(detaching);
}
if (detaching)
detach(if_block_anchor);
}
};
}
function instance$l($$self, $$props, $$invalidate) {
const omit_props_names = ["type", "tokens", "header", "rows", "ordered", "renderers"];
let $$restProps = compute_rest_props($$props, omit_props_names);
let { type = void 0 } = $$props;
let { tokens = void 0 } = $$props;
let { header = void 0 } = $$props;
let { rows = void 0 } = $$props;
let { ordered = false } = $$props;
let { renderers } = $$props;
supressWarnings();
$$self.$$set = ($$new_props) => {
$$props = assign(assign({}, $$props), exclude_internal_props($$new_props));
$$invalidate(6, $$restProps = compute_rest_props($$props, omit_props_names));
if ("type" in $$new_props)
$$invalidate(0, type = $$new_props.type);
if ("tokens" in $$new_props)
$$invalidate(1, tokens = $$new_props.tokens);
if ("header" in $$new_props)
$$invalidate(2, header = $$new_props.header);
if ("rows" in $$new_props)
$$invalidate(3, rows = $$new_props.rows);
if ("ordered" in $$new_props)
$$invalidate(4, ordered = $$new_props.ordered);
if ("renderers" in $$new_props)
$$invalidate(5, renderers = $$new_props.renderers);
};
return [type, tokens, header, rows, ordered, renderers, $$restProps];
}
let Parser$1 = class Parser extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$l, create_fragment$m, safe_not_equal, {
type: 0,
tokens: 1,
header: 2,
rows: 3,
ordered: 4,
renderers: 5
});
}
};
function getDefaults() {
return {
async: false,
baseUrl: null,
breaks: false,
extensions: null,
gfm: true,
headerIds: true,
headerPrefix: "",
highlight: null,
langPrefix: "language-",
mangle: true,
pedantic: false,
renderer: null,
sanitize: false,
sanitizer: null,
silent: false,
smartypants: false,
tokenizer: null,
walkTokens: null,
xhtml: false
};
}
let defaults = getDefaults();
function changeDefaults(newDefaults) {
defaults = newDefaults;
}
const escapeTest = /[&<>"']/;
const escapeReplace = new RegExp(escapeTest.source, "g");
const escapeTestNoEncode = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/;
const escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, "g");
const escapeReplacements = {
"&": "&amp;",
"<": "&lt;",
">": "&gt;",
'"': "&quot;",
"'": "&#39;"
};
const getEscapeReplacement = (ch) => escapeReplacements[ch];
function escape(html, encode) {
if (encode) {
if (escapeTest.test(html)) {
return html.replace(escapeReplace, getEscapeReplacement);
}
} else {
if (escapeTestNoEncode.test(html)) {
return html.replace(escapeReplaceNoEncode, getEscapeReplacement);
}
}
return html;
}
const unescapeTest = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
function unescape(html) {
return html.replace(unescapeTest, (_, n) => {
n = n.toLowerCase();
if (n === "colon")
return ":";
if (n.charAt(0) === "#") {
return n.charAt(1) === "x" ? String.fromCharCode(parseInt(n.substring(2), 16)) : String.fromCharCode(+n.substring(1));
}
return "";
});
}
const caret = /(^|[^\[])\^/g;
function edit(regex, opt) {
regex = typeof regex === "string" ? regex : regex.source;
opt = opt || "";
const obj = {
replace: (name, val) => {
val = val.source || val;
val = val.replace(caret, "$1");
regex = regex.replace(name, val);
return obj;
},
getRegex: () => {
return new RegExp(regex, opt);
}
};
return obj;
}
const nonWordAndColonTest = /[^\w:]/g;
const originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;
function cleanUrl(sanitize, base, href) {
if (sanitize) {
let prot;
try {
prot = decodeURIComponent(unescape(href)).replace(nonWordAndColonTest, "").toLowerCase();
} catch (e) {
return null;
}
if (prot.indexOf("javascript:") === 0 || prot.indexOf("vbscript:") === 0 || prot.indexOf("data:") === 0) {
return null;
}
}
if (base && !originIndependentUrl.test(href)) {
href = resolveUrl(base, href);
}
try {
href = encodeURI(href).replace(/%25/g, "%");
} catch (e) {
return null;
}
return href;
}
const baseUrls = {};
const justDomain = /^[^:]+:\/*[^/]*$/;
const protocol = /^([^:]+:)[\s\S]*$/;
const domain = /^([^:]+:\/*[^/]*)[\s\S]*$/;
function resolveUrl(base, href) {
if (!baseUrls[" " + base]) {
if (justDomain.test(base)) {
baseUrls[" " + base] = base + "/";
} else {
baseUrls[" " + base] = rtrim(base, "/", true);
}
}
base = baseUrls[" " + base];
const relativeBase = base.indexOf(":") === -1;
if (href.substring(0, 2) === "//") {
if (relativeBase) {
return href;
}
return base.replace(protocol, "$1") + href;
} else if (href.charAt(0) === "/") {
if (relativeBase) {
return href;
}
return base.replace(domain, "$1") + href;
} else {
return base + href;
}
}
const noopTest = { exec: function noopTest2() {
} };
function merge(obj) {
let i = 1, target, key2;
for (; i < arguments.length; i++) {
target = arguments[i];
for (key2 in target) {
if (Object.prototype.hasOwnProperty.call(target, key2)) {
obj[key2] = target[key2];
}
}
}
return obj;
}
function splitCells(tableRow, count) {
const row = tableRow.replace(/\|/g, (match, offset, str) => {
let escaped = false, curr = offset;
while (--curr >= 0 && str[curr] === "\\")
escaped = !escaped;
if (escaped) {
return "|";
} else {
return " |";
}
}), cells = row.split(/ \|/);
let i = 0;
if (!cells[0].trim()) {
cells.shift();
}
if (cells.length > 0 && !cells[cells.length - 1].trim()) {
cells.pop();
}
if (cells.length > count) {
cells.splice(count);
} else {
while (cells.length < count)
cells.push("");
}
for (; i < cells.length; i++) {
cells[i] = cells[i].trim().replace(/\\\|/g, "|");
}
return cells;
}
function rtrim(str, c, invert) {
const l = str.length;
if (l === 0) {
return "";
}
let suffLen = 0;
while (suffLen < l) {
const currChar = str.charAt(l - suffLen - 1);
if (currChar === c && !invert) {
suffLen++;
} else if (currChar !== c && invert) {
suffLen++;
} else {
break;
}
}
return str.slice(0, l - suffLen);
}
function findClosingBracket(str, b) {
if (str.indexOf(b[1]) === -1) {
return -1;
}
const l = str.length;
let level = 0, i = 0;
for (; i < l; i++) {
if (str[i] === "\\") {
i++;
} else if (str[i] === b[0]) {
level++;
} else if (str[i] === b[1]) {
level--;
if (level < 0) {
return i;
}
}
}
return -1;
}
function checkSanitizeDeprecation(opt) {
if (opt && opt.sanitize && !opt.silent) {
console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options");
}
}
function repeatString(pattern, count) {
if (count < 1) {
return "";
}
let result = "";
while (count > 1) {
if (count & 1) {
result += pattern;
}
count >>= 1;
pattern += pattern;
}
return result + pattern;
}
function outputLink(cap, link, raw, lexer) {
const href = link.href;
const title = link.title ? escape(link.title) : null;
const text2 = cap[1].replace(/\\([\[\]])/g, "$1");
if (cap[0].charAt(0) !== "!") {
lexer.state.inLink = true;
const token = {
type: "link",
raw,
href,
title,
text: text2,
tokens: lexer.inlineTokens(text2)
};
lexer.state.inLink = false;
return token;
}
return {
type: "image",
raw,
href,
title,
text: escape(text2)
};
}
function indentCodeCompensation(raw, text2) {
const matchIndentToCode = raw.match(/^(\s+)(?:```)/);
if (matchIndentToCode === null) {
return text2;
}
const indentToCode = matchIndentToCode[1];
return text2.split("\n").map((node) => {
const matchIndentInNode = node.match(/^\s+/);
if (matchIndentInNode === null) {
return node;
}
const [indentInNode] = matchIndentInNode;
if (indentInNode.length >= indentToCode.length) {
return node.slice(indentToCode.length);
}
return node;
}).join("\n");
}
class Tokenizer {
constructor(options) {
this.options = options || defaults;
}
space(src) {
const cap = this.rules.block.newline.exec(src);
if (cap && cap[0].length > 0) {
return {
type: "space",
raw: cap[0]
};
}
}
code(src) {
const cap = this.rules.block.code.exec(src);
if (cap) {
const text2 = cap[0].replace(/^ {1,4}/gm, "");
return {
type: "code",
raw: cap[0],
codeBlockStyle: "indented",
text: !this.options.pedantic ? rtrim(text2, "\n") : text2
};
}
}
fences(src) {
const cap = this.rules.block.fences.exec(src);
if (cap) {
const raw = cap[0];
const text2 = indentCodeCompensation(raw, cap[3] || "");
return {
type: "code",
raw,
lang: cap[2] ? cap[2].trim().replace(this.rules.inline._escapes, "$1") : cap[2],
text: text2
};
}
}
heading(src) {
const cap = this.rules.block.heading.exec(src);
if (cap) {
let text2 = cap[2].trim();
if (/#$/.test(text2)) {
const trimmed = rtrim(text2, "#");
if (this.options.pedantic) {
text2 = trimmed.trim();
} else if (!trimmed || / $/.test(trimmed)) {
text2 = trimmed.trim();
}
}
return {
type: "heading",
raw: cap[0],
depth: cap[1].length,
text: text2,
tokens: this.lexer.inline(text2)
};
}
}
hr(src) {
const cap = this.rules.block.hr.exec(src);
if (cap) {
return {
type: "hr",
raw: cap[0]
};
}
}
blockquote(src) {
const cap = this.rules.block.blockquote.exec(src);
if (cap) {
const text2 = cap[0].replace(/^ *>[ \t]?/gm, "");
const top = this.lexer.state.top;
this.lexer.state.top = true;
const tokens = this.lexer.blockTokens(text2);
this.lexer.state.top = top;
return {
type: "blockquote",
raw: cap[0],
tokens,
text: text2
};
}
}
list(src) {
let cap = this.rules.block.list.exec(src);
if (cap) {
let raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine, line, nextLine, rawLine, itemContents, endEarly;
let bull = cap[1].trim();
const isordered = bull.length > 1;
const list = {
type: "list",
raw: "",
ordered: isordered,
start: isordered ? +bull.slice(0, -1) : "",
loose: false,
items: []
};
bull = isordered ? `\\d{1,9}\\${bull.slice(-1)}` : `\\${bull}`;
if (this.options.pedantic) {
bull = isordered ? bull : "[*+-]";
}
const itemRegex = new RegExp(`^( {0,3}${bull})((?:[ ][^\\n]*)?(?:\\n|$))`);
while (src) {
endEarly = false;
if (!(cap = itemRegex.exec(src))) {
break;
}
if (this.rules.block.hr.test(src)) {
break;
}
raw = cap[0];
src = src.substring(raw.length);
line = cap[2].split("\n", 1)[0].replace(/^\t+/, (t) => " ".repeat(3 * t.length));
nextLine = src.split("\n", 1)[0];
if (this.options.pedantic) {
indent = 2;
itemContents = line.trimLeft();
} else {
indent = cap[2].search(/[^ ]/);
indent = indent > 4 ? 1 : indent;
itemContents = line.slice(indent);
indent += cap[1].length;
}
blankLine = false;
if (!line && /^ *$/.test(nextLine)) {
raw += nextLine + "\n";
src = src.substring(nextLine.length + 1);
endEarly = true;
}
if (!endEarly) {
const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`);
const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`);
const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\`\`\`|~~~)`);
const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);
while (src) {
rawLine = src.split("\n", 1)[0];
nextLine = rawLine;
if (this.options.pedantic) {
nextLine = nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ");
}
if (fencesBeginRegex.test(nextLine)) {
break;
}
if (headingBeginRegex.test(nextLine)) {
break;
}
if (nextBulletRegex.test(nextLine)) {
break;
}
if (hrRegex.test(src)) {
break;
}
if (nextLine.search(/[^ ]/) >= indent || !nextLine.trim()) {
itemContents += "\n" + nextLine.slice(indent);
} else {
if (blankLine) {
break;
}
if (line.search(/[^ ]/) >= 4) {
break;
}
if (fencesBeginRegex.test(line)) {
break;
}
if (headingBeginRegex.test(line)) {
break;
}
if (hrRegex.test(line)) {
break;
}
itemContents += "\n" + nextLine;
}
if (!blankLine && !nextLine.trim()) {
blankLine = true;
}
raw += rawLine + "\n";
src = src.substring(rawLine.length + 1);
line = nextLine.slice(indent);
}
}
if (!list.loose) {
if (endsWithBlankLine) {
list.loose = true;
} else if (/\n *\n *$/.test(raw)) {
endsWithBlankLine = true;
}
}
if (this.options.gfm) {
istask = /^\[[ xX]\] /.exec(itemContents);
if (istask) {
ischecked = istask[0] !== "[ ] ";
itemContents = itemContents.replace(/^\[[ xX]\] +/, "");
}
}
list.items.push({
type: "list_item",
raw,
task: !!istask,
checked: ischecked,
loose: false,
text: itemContents
});
list.raw += raw;
}
list.items[list.items.length - 1].raw = raw.trimRight();
list.items[list.items.length - 1].text = itemContents.trimRight();
list.raw = list.raw.trimRight();
const l = list.items.length;
for (i = 0; i < l; i++) {
this.lexer.state.top = false;
list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);
if (!list.loose) {
const spacers = list.items[i].tokens.filter((t) => t.type === "space");
const hasMultipleLineBreaks = spacers.length > 0 && spacers.some((t) => /\n.*\n/.test(t.raw));
list.loose = hasMultipleLineBreaks;
}
}
if (list.loose) {
for (i = 0; i < l; i++) {
list.items[i].loose = true;
}
}
return list;
}
}
html(src) {
const cap = this.rules.block.html.exec(src);
if (cap) {
const token = {
type: "html",
raw: cap[0],
pre: !this.options.sanitizer && (cap[1] === "pre" || cap[1] === "script" || cap[1] === "style"),
text: cap[0]
};
if (this.options.sanitize) {
const text2 = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]);
token.type = "paragraph";
token.text = text2;
token.tokens = this.lexer.inline(text2);
}
return token;
}
}
def(src) {
const cap = this.rules.block.def.exec(src);
if (cap) {
const tag = cap[1].toLowerCase().replace(/\s+/g, " ");
const href = cap[2] ? cap[2].replace(/^<(.*)>$/, "$1").replace(this.rules.inline._escapes, "$1") : "";
const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline._escapes, "$1") : cap[3];
return {
type: "def",
tag,
raw: cap[0],
href,
title
};
}
}
table(src) {
const cap = this.rules.block.table.exec(src);
if (cap) {
const item = {
type: "table",
header: splitCells(cap[1]).map((c) => {
return { text: c };
}),
align: cap[2].replace(/^ *|\| *$/g, "").split(/ *\| */),
rows: cap[3] && cap[3].trim() ? cap[3].replace(/\n[ \t]*$/, "").split("\n") : []
};
if (item.header.length === item.align.length) {
item.raw = cap[0];
let l = item.align.length;
let i, j, k, row;
for (i = 0; i < l; i++) {
if (/^ *-+: *$/.test(item.align[i])) {
item.align[i] = "right";
} else if (/^ *:-+: *$/.test(item.align[i])) {
item.align[i] = "center";
} else if (/^ *:-+ *$/.test(item.align[i])) {
item.align[i] = "left";
} else {
item.align[i] = null;
}
}
l = item.rows.length;
for (i = 0; i < l; i++) {
item.rows[i] = splitCells(item.rows[i], item.header.length).map((c) => {
return { text: c };
});
}
l = item.header.length;
for (j = 0; j < l; j++) {
item.header[j].tokens = this.lexer.inline(item.header[j].text);
}
l = item.rows.length;
for (j = 0; j < l; j++) {
row = item.rows[j];
for (k = 0; k < row.length; k++) {
row[k].tokens = this.lexer.inline(row[k].text);
}
}
return item;
}
}
}
lheading(src) {
const cap = this.rules.block.lheading.exec(src);
if (cap) {
return {
type: "heading",
raw: cap[0],
depth: cap[2].charAt(0) === "=" ? 1 : 2,
text: cap[1],
tokens: this.lexer.inline(cap[1])
};
}
}
paragraph(src) {
const cap = this.rules.block.paragraph.exec(src);
if (cap) {
const text2 = cap[1].charAt(cap[1].length - 1) === "\n" ? cap[1].slice(0, -1) : cap[1];
return {
type: "paragraph",
raw: cap[0],
text: text2,
tokens: this.lexer.inline(text2)
};
}
}
text(src) {
const cap = this.rules.block.text.exec(src);
if (cap) {
return {
type: "text",
raw: cap[0],
text: cap[0],
tokens: this.lexer.inline(cap[0])
};
}
}
escape(src) {
const cap = this.rules.inline.escape.exec(src);
if (cap) {
return {
type: "escape",
raw: cap[0],
text: escape(cap[1])
};
}
}
tag(src) {
const cap = this.rules.inline.tag.exec(src);
if (cap) {
if (!this.lexer.state.inLink && /^<a /i.test(cap[0])) {
this.lexer.state.inLink = true;
} else if (this.lexer.state.inLink && /^<\/a>/i.test(cap[0])) {
this.lexer.state.inLink = false;
}
if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
this.lexer.state.inRawBlock = true;
} else if (this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
this.lexer.state.inRawBlock = false;
}
return {
type: this.options.sanitize ? "text" : "html",
raw: cap[0],
inLink: this.lexer.state.inLink,
inRawBlock: this.lexer.state.inRawBlock,
text: this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]) : cap[0]
};
}
}
link(src) {
const cap = this.rules.inline.link.exec(src);
if (cap) {
const trimmedUrl = cap[2].trim();
if (!this.options.pedantic && /^</.test(trimmedUrl)) {
if (!/>$/.test(trimmedUrl)) {
return;
}
const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), "\\");
if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {
return;
}
} else {
const lastParenIndex = findClosingBracket(cap[2], "()");
if (lastParenIndex > -1) {
const start = cap[0].indexOf("!") === 0 ? 5 : 4;
const linkLen = start + cap[1].length + lastParenIndex;
cap[2] = cap[2].substring(0, lastParenIndex);
cap[0] = cap[0].substring(0, linkLen).trim();
cap[3] = "";
}
}
let href = cap[2];
let title = "";
if (this.options.pedantic) {
const link = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href);
if (link) {
href = link[1];
title = link[3];
}
} else {
title = cap[3] ? cap[3].slice(1, -1) : "";
}
href = href.trim();
if (/^</.test(href)) {
if (this.options.pedantic && !/>$/.test(trimmedUrl)) {
href = href.slice(1);
} else {
href = href.slice(1, -1);
}
}
return outputLink(cap, {
href: href ? href.replace(this.rules.inline._escapes, "$1") : href,
title: title ? title.replace(this.rules.inline._escapes, "$1") : title
}, cap[0], this.lexer);
}
}
reflink(src, links) {
let cap;
if ((cap = this.rules.inline.reflink.exec(src)) || (cap = this.rules.inline.nolink.exec(src))) {
let link = (cap[2] || cap[1]).replace(/\s+/g, " ");
link = links[link.toLowerCase()];
if (!link) {
const text2 = cap[0].charAt(0);
return {
type: "text",
raw: text2,
text: text2
};
}
return outputLink(cap, link, cap[0], this.lexer);
}
}
emStrong(src, maskedSrc, prevChar = "") {
let match = this.rules.inline.emStrong.lDelim.exec(src);
if (!match)
return;
if (match[3] && prevChar.match(/[\p{L}\p{N}]/u))
return;
const nextChar = match[1] || match[2] || "";
if (!nextChar || nextChar && (prevChar === "" || this.rules.inline.punctuation.exec(prevChar))) {
const lLength = match[0].length - 1;
let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;
const endReg = match[0][0] === "*" ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd;
endReg.lastIndex = 0;
maskedSrc = maskedSrc.slice(-1 * src.length + lLength);
while ((match = endReg.exec(maskedSrc)) != null) {
rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];
if (!rDelim)
continue;
rLength = rDelim.length;
if (match[3] || match[4]) {
delimTotal += rLength;
continue;
} else if (match[5] || match[6]) {
if (lLength % 3 && !((lLength + rLength) % 3)) {
midDelimTotal += rLength;
continue;
}
}
delimTotal -= rLength;
if (delimTotal > 0)
continue;
rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);
const raw = src.slice(0, lLength + match.index + (match[0].length - rDelim.length) + rLength);
if (Math.min(lLength, rLength) % 2) {
const text3 = raw.slice(1, -1);
return {
type: "em",
raw,
text: text3,
tokens: this.lexer.inlineTokens(text3)
};
}
const text2 = raw.slice(2, -2);
return {
type: "strong",
raw,
text: text2,
tokens: this.lexer.inlineTokens(text2)
};
}
}
}
codespan(src) {
const cap = this.rules.inline.code.exec(src);
if (cap) {
let text2 = cap[2].replace(/\n/g, " ");
const hasNonSpaceChars = /[^ ]/.test(text2);
const hasSpaceCharsOnBothEnds = /^ /.test(text2) && / $/.test(text2);
if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {
text2 = text2.substring(1, text2.length - 1);
}
text2 = escape(text2, true);
return {
type: "codespan",
raw: cap[0],
text: text2
};
}
}
br(src) {
const cap = this.rules.inline.br.exec(src);
if (cap) {
return {
type: "br",
raw: cap[0]
};
}
}
del(src) {
const cap = this.rules.inline.del.exec(src);
if (cap) {
return {
type: "del",
raw: cap[0],
text: cap[2],
tokens: this.lexer.inlineTokens(cap[2])
};
}
}
autolink(src, mangle2) {
const cap = this.rules.inline.autolink.exec(src);
if (cap) {
let text2, href;
if (cap[2] === "@") {
text2 = escape(this.options.mangle ? mangle2(cap[1]) : cap[1]);
href = "mailto:" + text2;
} else {
text2 = escape(cap[1]);
href = text2;
}
return {
type: "link",
raw: cap[0],
text: text2,
href,
tokens: [
{
type: "text",
raw: text2,
text: text2
}
]
};
}
}
url(src, mangle2) {
let cap;
if (cap = this.rules.inline.url.exec(src)) {
let text2, href;
if (cap[2] === "@") {
text2 = escape(this.options.mangle ? mangle2(cap[0]) : cap[0]);
href = "mailto:" + text2;
} else {
let prevCapZero;
do {
prevCapZero = cap[0];
cap[0] = this.rules.inline._backpedal.exec(cap[0])[0];
} while (prevCapZero !== cap[0]);
text2 = escape(cap[0]);
if (cap[1] === "www.") {
href = "http://" + cap[0];
} else {
href = cap[0];
}
}
return {
type: "link",
raw: cap[0],
text: text2,
href,
tokens: [
{
type: "text",
raw: text2,
text: text2
}
]
};
}
}
inlineText(src, smartypants2) {
const cap = this.rules.inline.text.exec(src);
if (cap) {
let text2;
if (this.lexer.state.inRawBlock) {
text2 = this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]) : cap[0];
} else {
text2 = escape(this.options.smartypants ? smartypants2(cap[0]) : cap[0]);
}
return {
type: "text",
raw: cap[0],
text: text2
};
}
}
}
const block = {
newline: /^(?: *(?:\n|$))+/,
code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,
fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,
hr: /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,
heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,
blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,
list: /^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,
html: "^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",
def: /^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,
table: noopTest,
lheading: /^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
// regex template, placeholders will be replaced according to different paragraph
// interruption rules of commonmark and the original markdown spec:
_paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,
text: /^[^\n]+/
};
block._label = /(?!\s*\])(?:\\.|[^\[\]\\])+/;
block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
block.def = edit(block.def).replace("label", block._label).replace("title", block._title).getRegex();
block.bullet = /(?:[*+-]|\d{1,9}[.)])/;
block.listItemStart = edit(/^( *)(bull) */).replace("bull", block.bullet).getRegex();
block.list = edit(block.list).replace(/bull/g, block.bullet).replace("hr", "\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def", "\\n+(?=" + block.def.source + ")").getRegex();
block._tag = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
block._comment = /<!--(?!-?>)[\s\S]*?(?:-->|$)/;
block.html = edit(block.html, "i").replace("comment", block._comment).replace("tag", block._tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
block.paragraph = edit(block._paragraph).replace("hr", block.hr).replace("heading", " {0,3}#{1,6} ").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", block._tag).getRegex();
block.blockquote = edit(block.blockquote).replace("paragraph", block.paragraph).getRegex();
block.normal = merge({}, block);
block.gfm = merge({}, block.normal, {
table: "^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"
// Cells
});
block.gfm.table = edit(block.gfm.table).replace("hr", block.hr).replace("heading", " {0,3}#{1,6} ").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", block._tag).getRegex();
block.gfm.paragraph = edit(block._paragraph).replace("hr", block.hr).replace("heading", " {0,3}#{1,6} ").replace("|lheading", "").replace("table", block.gfm.table).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", block._tag).getRegex();
block.pedantic = merge({}, block.normal, {
html: edit(
`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`
).replace("comment", block._comment).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
heading: /^(#{1,6})(.*)(?:\n+|$)/,
fences: noopTest,
// fences not supported
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
paragraph: edit(block.normal._paragraph).replace("hr", block.hr).replace("heading", " *#{1,6} *[^\n]").replace("lheading", block.lheading).replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").getRegex()
});
const inline = {
escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/,
url: noopTest,
tag: "^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",
// CDATA section
link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,
reflink: /^!?\[(label)\]\[(ref)\]/,
nolink: /^!?\[(ref)\](?:\[\])?/,
reflinkSearch: "reflink|nolink(?!\\()",
emStrong: {
lDelim: /^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,
// (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and (6) can be either Left or Right.
// () Skip orphan inside strong () Consume to delim (1) #*** (2) a***#, a*** (3) #***a, ***a (4) ***# (5) #***# (6) a***a
rDelimAst: /^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,
rDelimUnd: /^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/
// ^- Not allowed for _
},
code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,
br: /^( {2,}|\\)\n(?!\s*$)/,
del: noopTest,
text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,
punctuation: /^([\spunctuation])/
};
inline._punctuation = "!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";
inline.punctuation = edit(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex();
inline.blockSkip = /\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;
inline.escapedEmSt = /(?:^|[^\\])(?:\\\\)*\\[*_]/g;
inline._comment = edit(block._comment).replace("(?:-->|$)", "-->").getRegex();
inline.emStrong.lDelim = edit(inline.emStrong.lDelim).replace(/punct/g, inline._punctuation).getRegex();
inline.emStrong.rDelimAst = edit(inline.emStrong.rDelimAst, "g").replace(/punct/g, inline._punctuation).getRegex();
inline.emStrong.rDelimUnd = edit(inline.emStrong.rDelimUnd, "g").replace(/punct/g, inline._punctuation).getRegex();
inline._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;
inline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;
inline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;
inline.autolink = edit(inline.autolink).replace("scheme", inline._scheme).replace("email", inline._email).getRegex();
inline._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;
inline.tag = edit(inline.tag).replace("comment", inline._comment).replace("attribute", inline._attribute).getRegex();
inline._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
inline._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;
inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;
inline.link = edit(inline.link).replace("label", inline._label).replace("href", inline._href).replace("title", inline._title).getRegex();
inline.reflink = edit(inline.reflink).replace("label", inline._label).replace("ref", block._label).getRegex();
inline.nolink = edit(inline.nolink).replace("ref", block._label).getRegex();
inline.reflinkSearch = edit(inline.reflinkSearch, "g").replace("reflink", inline.reflink).replace("nolink", inline.nolink).getRegex();
inline.normal = merge({}, inline);
inline.pedantic = merge({}, inline.normal, {
strong: {
start: /^__|\*\*/,
middle: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
endAst: /\*\*(?!\*)/g,
endUnd: /__(?!_)/g
},
em: {
start: /^_|\*/,
middle: /^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,
endAst: /\*(?!\*)/g,
endUnd: /_(?!_)/g
},
link: edit(/^!?\[(label)\]\((.*?)\)/).replace("label", inline._label).getRegex(),
reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", inline._label).getRegex()
});
inline.gfm = merge({}, inline.normal, {
escape: edit(inline.escape).replace("])", "~|])").getRegex(),
_extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,
url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
});
inline.gfm.url = edit(inline.gfm.url, "i").replace("email", inline.gfm._extended_email).getRegex();
inline.breaks = merge({}, inline.gfm, {
br: edit(inline.br).replace("{2,}", "*").getRegex(),
text: edit(inline.gfm.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
});
function smartypants(text2) {
return text2.replace(/---/g, "—").replace(/--/g, "").replace(/(^|[-\u2014/(\[{"\s])'/g, "$1").replace(/'/g, "").replace(/(^|[-\u2014/(\[{\u2018\s])"/g, "$1“").replace(/"/g, "”").replace(/\.{3}/g, "…");
}
function mangle(text2) {
let out = "", i, ch;
const l = text2.length;
for (i = 0; i < l; i++) {
ch = text2.charCodeAt(i);
if (Math.random() > 0.5) {
ch = "x" + ch.toString(16);
}
out += "&#" + ch + ";";
}
return out;
}
class Lexer {
constructor(options) {
this.tokens = [];
this.tokens.links = /* @__PURE__ */ Object.create(null);
this.options = options || defaults;
this.options.tokenizer = this.options.tokenizer || new Tokenizer();
this.tokenizer = this.options.tokenizer;
this.tokenizer.options = this.options;
this.tokenizer.lexer = this;
this.inlineQueue = [];
this.state = {
inLink: false,
inRawBlock: false,
top: true
};
const rules = {
block: block.normal,
inline: inline.normal
};
if (this.options.pedantic) {
rules.block = block.pedantic;
rules.inline = inline.pedantic;
} else if (this.options.gfm) {
rules.block = block.gfm;
if (this.options.breaks) {
rules.inline = inline.breaks;
} else {
rules.inline = inline.gfm;
}
}
this.tokenizer.rules = rules;
}
/**
* Expose Rules
*/
static get rules() {
return {
block,
inline
};
}
/**
* Static Lex Method
*/
static lex(src, options) {
const lexer = new Lexer(options);
return lexer.lex(src);
}
/**
* Static Lex Inline Method
*/
static lexInline(src, options) {
const lexer = new Lexer(options);
return lexer.inlineTokens(src);
}
/**
* Preprocessing
*/
lex(src) {
src = src.replace(/\r\n|\r/g, "\n");
this.blockTokens(src, this.tokens);
let next;
while (next = this.inlineQueue.shift()) {
this.inlineTokens(next.src, next.tokens);
}
return this.tokens;
}
/**
* Lexing
*/
blockTokens(src, tokens = []) {
if (this.options.pedantic) {
src = src.replace(/\t/g, " ").replace(/^ +$/gm, "");
} else {
src = src.replace(/^( *)(\t+)/gm, (_, leading, tabs) => {
return leading + " ".repeat(tabs.length);
});
}
let token, lastToken, cutSrc, lastParagraphClipped;
while (src) {
if (this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((extTokenizer) => {
if (token = extTokenizer.call({ lexer: this }, src, tokens)) {
src = src.substring(token.raw.length);
tokens.push(token);
return true;
}
return false;
})) {
continue;
}
if (token = this.tokenizer.space(src)) {
src = src.substring(token.raw.length);
if (token.raw.length === 1 && tokens.length > 0) {
tokens[tokens.length - 1].raw += "\n";
} else {
tokens.push(token);
}
continue;
}
if (token = this.tokenizer.code(src)) {
src = src.substring(token.raw.length);
lastToken = tokens[tokens.length - 1];
if (lastToken && (lastToken.type === "paragraph" || lastToken.type === "text")) {
lastToken.raw += "\n" + token.raw;
lastToken.text += "\n" + token.text;
this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
} else {
tokens.push(token);
}
continue;
}
if (token = this.tokenizer.fences(src)) {
src = src.substring(token.raw.length);
tokens.push(token);
continue;
}
if (token = this.tokenizer.heading(src)) {
src = src.substring(token.raw.length);
tokens.push(token);
continue;
}
if (token = this.tokenizer.hr(src)) {
src = src.substring(token.raw.length);
tokens.push(token);
continue;
}
if (token = this.tokenizer.blockquote(src)) {
src = src.substring(token.raw.length);
tokens.push(token);
continue;
}
if (token = this.tokenizer.list(src)) {
src = src.substring(token.raw.length);
tokens.push(token);
continue;
}
if (token = this.tokenizer.html(src)) {
src = src.substring(token.raw.length);
tokens.push(token);
continue;
}
if (token = this.tokenizer.def(src)) {
src = src.substring(token.raw.length);
lastToken = tokens[tokens.length - 1];
if (lastToken && (lastToken.type === "paragraph" || lastToken.type === "text")) {
lastToken.raw += "\n" + token.raw;
lastToken.text += "\n" + token.raw;
this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
} else if (!this.tokens.links[token.tag]) {
this.tokens.links[token.tag] = {
href: token.href,
title: token.title
};
}
continue;
}
if (token = this.tokenizer.table(src)) {
src = src.substring(token.raw.length);
tokens.push(token);
continue;
}
if (token = this.tokenizer.lheading(src)) {
src = src.substring(token.raw.length);
tokens.push(token);
continue;
}
cutSrc = src;
if (this.options.extensions && this.options.extensions.startBlock) {
let startIndex = Infinity;
const tempSrc = src.slice(1);
let tempStart;
this.options.extensions.startBlock.forEach(function(getStartIndex) {
tempStart = getStartIndex.call({ lexer: this }, tempSrc);
if (typeof tempStart === "number" && tempStart >= 0) {
startIndex = Math.min(startIndex, tempStart);
}
});
if (startIndex < Infinity && startIndex >= 0) {
cutSrc = src.substring(0, startIndex + 1);
}
}
if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {
lastToken = tokens[tokens.length - 1];
if (lastParagraphClipped && lastToken.type === "paragraph") {
lastToken.raw += "\n" + token.raw;
lastToken.text += "\n" + token.text;
this.inlineQueue.pop();
this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
} else {
tokens.push(token);
}
lastParagraphClipped = cutSrc.length !== src.length;
src = src.substring(token.raw.length);
continue;
}
if (token = this.tokenizer.text(src)) {
src = src.substring(token.raw.length);
lastToken = tokens[tokens.length - 1];
if (lastToken && lastToken.type === "text") {
lastToken.raw += "\n" + token.raw;
lastToken.text += "\n" + token.text;
this.inlineQueue.pop();
this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text;
} else {
tokens.push(token);
}
continue;
}
if (src) {
const errMsg = "Infinite loop on byte: " + src.charCodeAt(0);
if (this.options.silent) {
console.error(errMsg);
break;
} else {
throw new Error(errMsg);
}
}
}
this.state.top = true;
return tokens;
}
inline(src, tokens = []) {
this.inlineQueue.push({ src, tokens });
return tokens;
}
/**
* Lexing/Compiling
*/
inlineTokens(src, tokens = []) {
let token, lastToken, cutSrc;
let maskedSrc = src;
let match;
let keepPrevChar, prevChar;
if (this.tokens.links) {
const links = Object.keys(this.tokens.links);
if (links.length > 0) {
while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {
if (links.includes(match[0].slice(match[0].lastIndexOf("[") + 1, -1))) {
maskedSrc = maskedSrc.slice(0, match.index) + "[" + repeatString("a", match[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);
}
}
}
}
while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {
maskedSrc = maskedSrc.slice(0, match.index) + "[" + repeatString("a", match[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
}
while ((match = this.tokenizer.rules.inline.escapedEmSt.exec(maskedSrc)) != null) {
maskedSrc = maskedSrc.slice(0, match.index + match[0].length - 2) + "++" + maskedSrc.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);
this.tokenizer.rules.inline.escapedEmSt.lastIndex--;
}
while (src) {
if (!keepPrevChar) {
prevChar = "";
}
keepPrevChar = false;
if (this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((extTokenizer) => {
if (token = extTokenizer.call({ lexer: this }, src, tokens)) {
src = src.substring(token.raw.length);
tokens.push(token);
return true;
}
return false;
})) {
continue;
}
if (token = this.tokenizer.escape(src)) {
src = src.substring(token.raw.length);
tokens.push(token);
continue;
}
if (token = this.tokenizer.tag(src)) {
src = src.substring(token.raw.length);
lastToken = tokens[tokens.length - 1];
if (lastToken && token.type === "text" && lastToken.type === "text") {
lastToken.raw += token.raw;
lastToken.text += token.text;
} else {
tokens.push(token);
}
continue;
}
if (token = this.tokenizer.link(src)) {
src = src.substring(token.raw.length);
tokens.push(token);
continue;
}
if (token = this.tokenizer.reflink(src, this.tokens.links)) {
src = src.substring(token.raw.length);
lastToken = tokens[tokens.length - 1];
if (lastToken && token.type === "text" && lastToken.type === "text") {
lastToken.raw += token.raw;
lastToken.text += token.text;
} else {
tokens.push(token);
}
continue;
}
if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {
src = src.substring(token.raw.length);
tokens.push(token);
continue;
}
if (token = this.tokenizer.codespan(src)) {
src = src.substring(token.raw.length);
tokens.push(token);
continue;
}
if (token = this.tokenizer.br(src)) {
src = src.substring(token.raw.length);
tokens.push(token);
continue;
}
if (token = this.tokenizer.del(src)) {
src = src.substring(token.raw.length);
tokens.push(token);
continue;
}
if (token = this.tokenizer.autolink(src, mangle)) {
src = src.substring(token.raw.length);
tokens.push(token);
continue;
}
if (!this.state.inLink && (token = this.tokenizer.url(src, mangle))) {
src = src.substring(token.raw.length);
tokens.push(token);
continue;
}
cutSrc = src;
if (this.options.extensions && this.options.extensions.startInline) {
let startIndex = Infinity;
const tempSrc = src.slice(1);
let tempStart;
this.options.extensions.startInline.forEach(function(getStartIndex) {
tempStart = getStartIndex.call({ lexer: this }, tempSrc);
if (typeof tempStart === "number" && tempStart >= 0) {
startIndex = Math.min(startIndex, tempStart);
}
});
if (startIndex < Infinity && startIndex >= 0) {
cutSrc = src.substring(0, startIndex + 1);
}
}
if (token = this.tokenizer.inlineText(cutSrc, smartypants)) {
src = src.substring(token.raw.length);
if (token.raw.slice(-1) !== "_") {
prevChar = token.raw.slice(-1);
}
keepPrevChar = true;
lastToken = tokens[tokens.length - 1];
if (lastToken && lastToken.type === "text") {
lastToken.raw += token.raw;
lastToken.text += token.text;
} else {
tokens.push(token);
}
continue;
}
if (src) {
const errMsg = "Infinite loop on byte: " + src.charCodeAt(0);
if (this.options.silent) {
console.error(errMsg);
break;
} else {
throw new Error(errMsg);
}
}
}
return tokens;
}
}
class Renderer {
constructor(options) {
this.options = options || defaults;
}
code(code, infostring, escaped) {
const lang = (infostring || "").match(/\S*/)[0];
if (this.options.highlight) {
const out = this.options.highlight(code, lang);
if (out != null && out !== code) {
escaped = true;
code = out;
}
}
code = code.replace(/\n$/, "") + "\n";
if (!lang) {
return "<pre><code>" + (escaped ? code : escape(code, true)) + "</code></pre>\n";
}
return '<pre><code class="' + this.options.langPrefix + escape(lang) + '">' + (escaped ? code : escape(code, true)) + "</code></pre>\n";
}
/**
* @param {string} quote
*/
blockquote(quote) {
return `<blockquote>
${quote}</blockquote>
`;
}
html(html) {
return html;
}
/**
* @param {string} text
* @param {string} level
* @param {string} raw
* @param {any} slugger
*/
heading(text2, level, raw, slugger) {
if (this.options.headerIds) {
const id = this.options.headerPrefix + slugger.slug(raw);
return `<h${level} id="${id}">${text2}</h${level}>
`;
}
return `<h${level}>${text2}</h${level}>
`;
}
hr() {
return this.options.xhtml ? "<hr/>\n" : "<hr>\n";
}
list(body, ordered, start) {
const type = ordered ? "ol" : "ul", startatt = ordered && start !== 1 ? ' start="' + start + '"' : "";
return "<" + type + startatt + ">\n" + body + "</" + type + ">\n";
}
/**
* @param {string} text
*/
listitem(text2) {
return `<li>${text2}</li>
`;
}
checkbox(checked) {
return "<input " + (checked ? 'checked="" ' : "") + 'disabled="" type="checkbox"' + (this.options.xhtml ? " /" : "") + "> ";
}
/**
* @param {string} text
*/
paragraph(text2) {
return `<p>${text2}</p>
`;
}
/**
* @param {string} header
* @param {string} body
*/
table(header, body) {
if (body)
body = `<tbody>${body}</tbody>`;
return "<table>\n<thead>\n" + header + "</thead>\n" + body + "</table>\n";
}
/**
* @param {string} content
*/
tablerow(content) {
return `<tr>
${content}</tr>
`;
}
tablecell(content, flags) {
const type = flags.header ? "th" : "td";
const tag = flags.align ? `<${type} align="${flags.align}">` : `<${type}>`;
return tag + content + `</${type}>
`;
}
/**
* span level renderer
* @param {string} text
*/
strong(text2) {
return `<strong>${text2}</strong>`;
}
/**
* @param {string} text
*/
em(text2) {
return `<em>${text2}</em>`;
}
/**
* @param {string} text
*/
codespan(text2) {
return `<code>${text2}</code>`;
}
br() {
return this.options.xhtml ? "<br/>" : "<br>";
}
/**
* @param {string} text
*/
del(text2) {
return `<del>${text2}</del>`;
}
/**
* @param {string} href
* @param {string} title
* @param {string} text
*/
link(href, title, text2) {
href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);
if (href === null) {
return text2;
}
let out = '<a href="' + href + '"';
if (title) {
out += ' title="' + title + '"';
}
out += ">" + text2 + "</a>";
return out;
}
/**
* @param {string} href
* @param {string} title
* @param {string} text
*/
image(href, title, text2) {
href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);
if (href === null) {
return text2;
}
let out = `<img src="${href}" alt="${text2}"`;
if (title) {
out += ` title="${title}"`;
}
out += this.options.xhtml ? "/>" : ">";
return out;
}
text(text2) {
return text2;
}
}
class TextRenderer {
// no need for block level renderers
strong(text2) {
return text2;
}
em(text2) {
return text2;
}
codespan(text2) {
return text2;
}
del(text2) {
return text2;
}
html(text2) {
return text2;
}
text(text2) {
return text2;
}
link(href, title, text2) {
return "" + text2;
}
image(href, title, text2) {
return "" + text2;
}
br() {
return "";
}
}
class Slugger {
constructor() {
this.seen = {};
}
/**
* @param {string} value
*/
serialize(value) {
return value.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig, "").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, "").replace(/\s/g, "-");
}
/**
* Finds the next safe (unique) slug to use
* @param {string} originalSlug
* @param {boolean} isDryRun
*/
getNextSafeSlug(originalSlug, isDryRun) {
let slug = originalSlug;
let occurenceAccumulator = 0;
if (this.seen.hasOwnProperty(slug)) {
occurenceAccumulator = this.seen[originalSlug];
do {
occurenceAccumulator++;
slug = originalSlug + "-" + occurenceAccumulator;
} while (this.seen.hasOwnProperty(slug));
}
if (!isDryRun) {
this.seen[originalSlug] = occurenceAccumulator;
this.seen[slug] = 0;
}
return slug;
}
/**
* Convert string to unique id
* @param {object} [options]
* @param {boolean} [options.dryrun] Generates the next unique slug without
* updating the internal accumulator.
*/
slug(value, options = {}) {
const slug = this.serialize(value);
return this.getNextSafeSlug(slug, options.dryrun);
}
}
class Parser2 {
constructor(options) {
this.options = options || defaults;
this.options.renderer = this.options.renderer || new Renderer();
this.renderer = this.options.renderer;
this.renderer.options = this.options;
this.textRenderer = new TextRenderer();
this.slugger = new Slugger();
}
/**
* Static Parse Method
*/
static parse(tokens, options) {
const parser = new Parser2(options);
return parser.parse(tokens);
}
/**
* Static Parse Inline Method
*/
static parseInline(tokens, options) {
const parser = new Parser2(options);
return parser.parseInline(tokens);
}
/**
* Parse Loop
*/
parse(tokens, top = true) {
let out = "", i, j, k, l2, l3, row, cell, header, body, token, ordered, start, loose, itemBody, item, checked, task, checkbox, ret;
const l = tokens.length;
for (i = 0; i < l; i++) {
token = tokens[i];
if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {
ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);
if (ret !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(token.type)) {
out += ret || "";
continue;
}
}
switch (token.type) {
case "space": {
continue;
}
case "hr": {
out += this.renderer.hr();
continue;
}
case "heading": {
out += this.renderer.heading(
this.parseInline(token.tokens),
token.depth,
unescape(this.parseInline(token.tokens, this.textRenderer)),
this.slugger
);
continue;
}
case "code": {
out += this.renderer.code(
token.text,
token.lang,
token.escaped
);
continue;
}
case "table": {
header = "";
cell = "";
l2 = token.header.length;
for (j = 0; j < l2; j++) {
cell += this.renderer.tablecell(
this.parseInline(token.header[j].tokens),
{ header: true, align: token.align[j] }
);
}
header += this.renderer.tablerow(cell);
body = "";
l2 = token.rows.length;
for (j = 0; j < l2; j++) {
row = token.rows[j];
cell = "";
l3 = row.length;
for (k = 0; k < l3; k++) {
cell += this.renderer.tablecell(
this.parseInline(row[k].tokens),
{ header: false, align: token.align[k] }
);
}
body += this.renderer.tablerow(cell);
}
out += this.renderer.table(header, body);
continue;
}
case "blockquote": {
body = this.parse(token.tokens);
out += this.renderer.blockquote(body);
continue;
}
case "list": {
ordered = token.ordered;
start = token.start;
loose = token.loose;
l2 = token.items.length;
body = "";
for (j = 0; j < l2; j++) {
item = token.items[j];
checked = item.checked;
task = item.task;
itemBody = "";
if (item.task) {
checkbox = this.renderer.checkbox(checked);
if (loose) {
if (item.tokens.length > 0 && item.tokens[0].type === "paragraph") {
item.tokens[0].text = checkbox + " " + item.tokens[0].text;
if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === "text") {
item.tokens[0].tokens[0].text = checkbox + " " + item.tokens[0].tokens[0].text;
}
} else {
item.tokens.unshift({
type: "text",
text: checkbox
});
}
} else {
itemBody += checkbox;
}
}
itemBody += this.parse(item.tokens, loose);
body += this.renderer.listitem(itemBody, task, checked);
}
out += this.renderer.list(body, ordered, start);
continue;
}
case "html": {
out += this.renderer.html(token.text);
continue;
}
case "paragraph": {
out += this.renderer.paragraph(this.parseInline(token.tokens));
continue;
}
case "text": {
body = token.tokens ? this.parseInline(token.tokens) : token.text;
while (i + 1 < l && tokens[i + 1].type === "text") {
token = tokens[++i];
body += "\n" + (token.tokens ? this.parseInline(token.tokens) : token.text);
}
out += top ? this.renderer.paragraph(body) : body;
continue;
}
default: {
const errMsg = 'Token with "' + token.type + '" type was not found.';
if (this.options.silent) {
console.error(errMsg);
return;
} else {
throw new Error(errMsg);
}
}
}
}
return out;
}
/**
* Parse Inline Tokens
*/
parseInline(tokens, renderer) {
renderer = renderer || this.renderer;
let out = "", i, token, ret;
const l = tokens.length;
for (i = 0; i < l; i++) {
token = tokens[i];
if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {
ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);
if (ret !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(token.type)) {
out += ret || "";
continue;
}
}
switch (token.type) {
case "escape": {
out += renderer.text(token.text);
break;
}
case "html": {
out += renderer.html(token.text);
break;
}
case "link": {
out += renderer.link(token.href, token.title, this.parseInline(token.tokens, renderer));
break;
}
case "image": {
out += renderer.image(token.href, token.title, token.text);
break;
}
case "strong": {
out += renderer.strong(this.parseInline(token.tokens, renderer));
break;
}
case "em": {
out += renderer.em(this.parseInline(token.tokens, renderer));
break;
}
case "codespan": {
out += renderer.codespan(token.text);
break;
}
case "br": {
out += renderer.br();
break;
}
case "del": {
out += renderer.del(this.parseInline(token.tokens, renderer));
break;
}
case "text": {
out += renderer.text(token.text);
break;
}
default: {
const errMsg = 'Token with "' + token.type + '" type was not found.';
if (this.options.silent) {
console.error(errMsg);
return;
} else {
throw new Error(errMsg);
}
}
}
}
return out;
}
}
function marked(src, opt, callback) {
if (typeof src === "undefined" || src === null) {
throw new Error("marked(): input parameter is undefined or null");
}
if (typeof src !== "string") {
throw new Error("marked(): input parameter is of type " + Object.prototype.toString.call(src) + ", string expected");
}
if (typeof opt === "function") {
callback = opt;
opt = null;
}
opt = merge({}, marked.defaults, opt || {});
checkSanitizeDeprecation(opt);
if (callback) {
const highlight = opt.highlight;
let tokens;
try {
tokens = Lexer.lex(src, opt);
} catch (e) {
return callback(e);
}
const done = function(err) {
let out;
if (!err) {
try {
if (opt.walkTokens) {
marked.walkTokens(tokens, opt.walkTokens);
}
out = Parser2.parse(tokens, opt);
} catch (e) {
err = e;
}
}
opt.highlight = highlight;
return err ? callback(err) : callback(null, out);
};
if (!highlight || highlight.length < 3) {
return done();
}
delete opt.highlight;
if (!tokens.length)
return done();
let pending = 0;
marked.walkTokens(tokens, function(token) {
if (token.type === "code") {
pending++;
setTimeout(() => {
highlight(token.text, token.lang, function(err, code) {
if (err) {
return done(err);
}
if (code != null && code !== token.text) {
token.text = code;
token.escaped = true;
}
pending--;
if (pending === 0) {
done();
}
});
}, 0);
}
});
if (pending === 0) {
done();
}
return;
}
function onError(e) {
e.message += "\nPlease report this to https://github.com/markedjs/marked.";
if (opt.silent) {
return "<p>An error occurred:</p><pre>" + escape(e.message + "", true) + "</pre>";
}
throw e;
}
try {
const tokens = Lexer.lex(src, opt);
if (opt.walkTokens) {
if (opt.async) {
return Promise.all(marked.walkTokens(tokens, opt.walkTokens)).then(() => {
return Parser2.parse(tokens, opt);
}).catch(onError);
}
marked.walkTokens(tokens, opt.walkTokens);
}
return Parser2.parse(tokens, opt);
} catch (e) {
onError(e);
}
}
marked.options = marked.setOptions = function(opt) {
merge(marked.defaults, opt);
changeDefaults(marked.defaults);
return marked;
};
marked.getDefaults = getDefaults;
marked.defaults = defaults;
marked.use = function(...args) {
const extensions = marked.defaults.extensions || { renderers: {}, childTokens: {} };
args.forEach((pack) => {
const opts = merge({}, pack);
opts.async = marked.defaults.async || opts.async;
if (pack.extensions) {
pack.extensions.forEach((ext) => {
if (!ext.name) {
throw new Error("extension name required");
}
if (ext.renderer) {
const prevRenderer = extensions.renderers[ext.name];
if (prevRenderer) {
extensions.renderers[ext.name] = function(...args2) {
let ret = ext.renderer.apply(this, args2);
if (ret === false) {
ret = prevRenderer.apply(this, args2);
}
return ret;
};
} else {
extensions.renderers[ext.name] = ext.renderer;
}
}
if (ext.tokenizer) {
if (!ext.level || ext.level !== "block" && ext.level !== "inline") {
throw new Error("extension level must be 'block' or 'inline'");
}
if (extensions[ext.level]) {
extensions[ext.level].unshift(ext.tokenizer);
} else {
extensions[ext.level] = [ext.tokenizer];
}
if (ext.start) {
if (ext.level === "block") {
if (extensions.startBlock) {
extensions.startBlock.push(ext.start);
} else {
extensions.startBlock = [ext.start];
}
} else if (ext.level === "inline") {
if (extensions.startInline) {
extensions.startInline.push(ext.start);
} else {
extensions.startInline = [ext.start];
}
}
}
}
if (ext.childTokens) {
extensions.childTokens[ext.name] = ext.childTokens;
}
});
opts.extensions = extensions;
}
if (pack.renderer) {
const renderer = marked.defaults.renderer || new Renderer();
for (const prop in pack.renderer) {
const prevRenderer = renderer[prop];
renderer[prop] = (...args2) => {
let ret = pack.renderer[prop].apply(renderer, args2);
if (ret === false) {
ret = prevRenderer.apply(renderer, args2);
}
return ret;
};
}
opts.renderer = renderer;
}
if (pack.tokenizer) {
const tokenizer = marked.defaults.tokenizer || new Tokenizer();
for (const prop in pack.tokenizer) {
const prevTokenizer = tokenizer[prop];
tokenizer[prop] = (...args2) => {
let ret = pack.tokenizer[prop].apply(tokenizer, args2);
if (ret === false) {
ret = prevTokenizer.apply(tokenizer, args2);
}
return ret;
};
}
opts.tokenizer = tokenizer;
}
if (pack.walkTokens) {
const walkTokens = marked.defaults.walkTokens;
opts.walkTokens = function(token) {
let values = [];
values.push(pack.walkTokens.call(this, token));
if (walkTokens) {
values = values.concat(walkTokens.call(this, token));
}
return values;
};
}
marked.setOptions(opts);
});
};
marked.walkTokens = function(tokens, callback) {
let values = [];
for (const token of tokens) {
values = values.concat(callback.call(marked, token));
switch (token.type) {
case "table": {
for (const cell of token.header) {
values = values.concat(marked.walkTokens(cell.tokens, callback));
}
for (const row of token.rows) {
for (const cell of row) {
values = values.concat(marked.walkTokens(cell.tokens, callback));
}
}
break;
}
case "list": {
values = values.concat(marked.walkTokens(token.items, callback));
break;
}
default: {
if (marked.defaults.extensions && marked.defaults.extensions.childTokens && marked.defaults.extensions.childTokens[token.type]) {
marked.defaults.extensions.childTokens[token.type].forEach(function(childTokens) {
values = values.concat(marked.walkTokens(token[childTokens], callback));
});
} else if (token.tokens) {
values = values.concat(marked.walkTokens(token.tokens, callback));
}
}
}
}
return values;
};
marked.parseInline = function(src, opt) {
if (typeof src === "undefined" || src === null) {
throw new Error("marked.parseInline(): input parameter is undefined or null");
}
if (typeof src !== "string") {
throw new Error("marked.parseInline(): input parameter is of type " + Object.prototype.toString.call(src) + ", string expected");
}
opt = merge({}, marked.defaults, opt || {});
checkSanitizeDeprecation(opt);
try {
const tokens = Lexer.lexInline(src, opt);
if (opt.walkTokens) {
marked.walkTokens(tokens, opt.walkTokens);
}
return Parser2.parseInline(tokens, opt);
} catch (e) {
e.message += "\nPlease report this to https://github.com/markedjs/marked.";
if (opt.silent) {
return "<p>An error occurred:</p><pre>" + escape(e.message + "", true) + "</pre>";
}
throw e;
}
};
marked.Parser = Parser2;
marked.parser = Parser2.parse;
marked.Renderer = Renderer;
marked.TextRenderer = TextRenderer;
marked.Lexer = Lexer;
marked.lexer = Lexer.lex;
marked.Tokenizer = Tokenizer;
marked.Slugger = Slugger;
marked.parse = marked;
marked.options;
marked.setOptions;
marked.use;
marked.walkTokens;
marked.parseInline;
Parser2.parse;
Lexer.lex;
const key = {};
function create_else_block$2(ctx) {
let t;
return {
c() {
t = text(
/*raw*/
ctx[1]
);
},
l(nodes) {
t = claim_text(
nodes,
/*raw*/
ctx[1]
);
},
m(target, anchor) {
insert_hydration(target, t, anchor);
},
p(ctx2, dirty) {
if (dirty & /*raw*/
2)
set_data(
t,
/*raw*/
ctx2[1]
);
},
i: noop,
o: noop,
d(detaching) {
if (detaching)
detach(t);
}
};
}
function create_if_block_5(ctx) {
let h6;
let current;
const default_slot_template = (
/*#slots*/
ctx[5].default
);
const default_slot = create_slot(
default_slot_template,
ctx,
/*$$scope*/
ctx[4],
null
);
return {
c() {
h6 = element("h6");
if (default_slot)
default_slot.c();
this.h();
},
l(nodes) {
h6 = claim_element(nodes, "H6", { id: true });
var h6_nodes = children(h6);
if (default_slot)
default_slot.l(h6_nodes);
h6_nodes.forEach(detach);
this.h();
},
h() {
attr(
h6,
"id",
/*id*/
ctx[2]
);
},
m(target, anchor) {
insert_hydration(target, h6, anchor);
if (default_slot) {
default_slot.m(h6, null);
}
current = true;
},
p(ctx2, dirty) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/
16)) {
update_slot_base(
default_slot,
default_slot_template,
ctx2,
/*$$scope*/
ctx2[4],
!current ? get_all_dirty_from_scope(
/*$$scope*/
ctx2[4]
) : get_slot_changes(
default_slot_template,
/*$$scope*/
ctx2[4],
dirty,
null
),
null
);
}
}
if (!current || dirty & /*id*/
4) {
attr(
h6,
"id",
/*id*/
ctx2[2]
);
}
},
i(local) {
if (current)
return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching)
detach(h6);
if (default_slot)
default_slot.d(detaching);
}
};
}
function create_if_block_4(ctx) {
let h5;
let current;
const default_slot_template = (
/*#slots*/
ctx[5].default
);
const default_slot = create_slot(
default_slot_template,
ctx,
/*$$scope*/
ctx[4],
null
);
return {
c() {
h5 = element("h5");
if (default_slot)
default_slot.c();
this.h();
},
l(nodes) {
h5 = claim_element(nodes, "H5", { id: true });
var h5_nodes = children(h5);
if (default_slot)
default_slot.l(h5_nodes);
h5_nodes.forEach(detach);
this.h();
},
h() {
attr(
h5,
"id",
/*id*/
ctx[2]
);
},
m(target, anchor) {
insert_hydration(target, h5, anchor);
if (default_slot) {
default_slot.m(h5, null);
}
current = true;
},
p(ctx2, dirty) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/
16)) {
update_slot_base(
default_slot,
default_slot_template,
ctx2,
/*$$scope*/
ctx2[4],
!current ? get_all_dirty_from_scope(
/*$$scope*/
ctx2[4]
) : get_slot_changes(
default_slot_template,
/*$$scope*/
ctx2[4],
dirty,
null
),
null
);
}
}
if (!current || dirty & /*id*/
4) {
attr(
h5,
"id",
/*id*/
ctx2[2]
);
}
},
i(local) {
if (current)
return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching)
detach(h5);
if (default_slot)
default_slot.d(detaching);
}
};
}
function create_if_block_3(ctx) {
let h4;
let current;
const default_slot_template = (
/*#slots*/
ctx[5].default
);
const default_slot = create_slot(
default_slot_template,
ctx,
/*$$scope*/
ctx[4],
null
);
return {
c() {
h4 = element("h4");
if (default_slot)
default_slot.c();
this.h();
},
l(nodes) {
h4 = claim_element(nodes, "H4", { id: true });
var h4_nodes = children(h4);
if (default_slot)
default_slot.l(h4_nodes);
h4_nodes.forEach(detach);
this.h();
},
h() {
attr(
h4,
"id",
/*id*/
ctx[2]
);
},
m(target, anchor) {
insert_hydration(target, h4, anchor);
if (default_slot) {
default_slot.m(h4, null);
}
current = true;
},
p(ctx2, dirty) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/
16)) {
update_slot_base(
default_slot,
default_slot_template,
ctx2,
/*$$scope*/
ctx2[4],
!current ? get_all_dirty_from_scope(
/*$$scope*/
ctx2[4]
) : get_slot_changes(
default_slot_template,
/*$$scope*/
ctx2[4],
dirty,
null
),
null
);
}
}
if (!current || dirty & /*id*/
4) {
attr(
h4,
"id",
/*id*/
ctx2[2]
);
}
},
i(local) {
if (current)
return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching)
detach(h4);
if (default_slot)
default_slot.d(detaching);
}
};
}
function create_if_block_2(ctx) {
let h3;
let current;
const default_slot_template = (
/*#slots*/
ctx[5].default
);
const default_slot = create_slot(
default_slot_template,
ctx,
/*$$scope*/
ctx[4],
null
);
return {
c() {
h3 = element("h3");
if (default_slot)
default_slot.c();
this.h();
},
l(nodes) {
h3 = claim_element(nodes, "H3", { id: true });
var h3_nodes = children(h3);
if (default_slot)
default_slot.l(h3_nodes);
h3_nodes.forEach(detach);
this.h();
},
h() {
attr(
h3,
"id",
/*id*/
ctx[2]
);
},
m(target, anchor) {
insert_hydration(target, h3, anchor);
if (default_slot) {
default_slot.m(h3, null);
}
current = true;
},
p(ctx2, dirty) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/
16)) {
update_slot_base(
default_slot,
default_slot_template,
ctx2,
/*$$scope*/
ctx2[4],
!current ? get_all_dirty_from_scope(
/*$$scope*/
ctx2[4]
) : get_slot_changes(
default_slot_template,
/*$$scope*/
ctx2[4],
dirty,
null
),
null
);
}
}
if (!current || dirty & /*id*/
4) {
attr(
h3,
"id",
/*id*/
ctx2[2]
);
}
},
i(local) {
if (current)
return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching)
detach(h3);
if (default_slot)
default_slot.d(detaching);
}
};
}
function create_if_block_1(ctx) {
let h2;
let current;
const default_slot_template = (
/*#slots*/
ctx[5].default
);
const default_slot = create_slot(
default_slot_template,
ctx,
/*$$scope*/
ctx[4],
null
);
return {
c() {
h2 = element("h2");
if (default_slot)
default_slot.c();
this.h();
},
l(nodes) {
h2 = claim_element(nodes, "H2", { id: true });
var h2_nodes = children(h2);
if (default_slot)
default_slot.l(h2_nodes);
h2_nodes.forEach(detach);
this.h();
},
h() {
attr(
h2,
"id",
/*id*/
ctx[2]
);
},
m(target, anchor) {
insert_hydration(target, h2, anchor);
if (default_slot) {
default_slot.m(h2, null);
}
current = true;
},
p(ctx2, dirty) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/
16)) {
update_slot_base(
default_slot,
default_slot_template,
ctx2,
/*$$scope*/
ctx2[4],
!current ? get_all_dirty_from_scope(
/*$$scope*/
ctx2[4]
) : get_slot_changes(
default_slot_template,
/*$$scope*/
ctx2[4],
dirty,
null
),
null
);
}
}
if (!current || dirty & /*id*/
4) {
attr(
h2,
"id",
/*id*/
ctx2[2]
);
}
},
i(local) {
if (current)
return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching)
detach(h2);
if (default_slot)
default_slot.d(detaching);
}
};
}
function create_if_block$2(ctx) {
let h1;
let current;
const default_slot_template = (
/*#slots*/
ctx[5].default
);
const default_slot = create_slot(
default_slot_template,
ctx,
/*$$scope*/
ctx[4],
null
);
return {
c() {
h1 = element("h1");
if (default_slot)
default_slot.c();
this.h();
},
l(nodes) {
h1 = claim_element(nodes, "H1", { id: true });
var h1_nodes = children(h1);
if (default_slot)
default_slot.l(h1_nodes);
h1_nodes.forEach(detach);
this.h();
},
h() {
attr(
h1,
"id",
/*id*/
ctx[2]
);
},
m(target, anchor) {
insert_hydration(target, h1, anchor);
if (default_slot) {
default_slot.m(h1, null);
}
current = true;
},
p(ctx2, dirty) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/
16)) {
update_slot_base(
default_slot,
default_slot_template,
ctx2,
/*$$scope*/
ctx2[4],
!current ? get_all_dirty_from_scope(
/*$$scope*/
ctx2[4]
) : get_slot_changes(
default_slot_template,
/*$$scope*/
ctx2[4],
dirty,
null
),
null
);
}
}
if (!current || dirty & /*id*/
4) {
attr(
h1,
"id",
/*id*/
ctx2[2]
);
}
},
i(local) {
if (current)
return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching)
detach(h1);
if (default_slot)
default_slot.d(detaching);
}
};
}
function create_fragment$l(ctx) {
let current_block_type_index;
let if_block;
let if_block_anchor;
let current;
const if_block_creators = [
create_if_block$2,
create_if_block_1,
create_if_block_2,
create_if_block_3,
create_if_block_4,
create_if_block_5,
create_else_block$2
];
const if_blocks = [];
function select_block_type(ctx2, dirty) {
if (
/*depth*/
ctx2[0] === 1
)
return 0;
if (
/*depth*/
ctx2[0] === 2
)
return 1;
if (
/*depth*/
ctx2[0] === 3
)
return 2;
if (
/*depth*/
ctx2[0] === 4
)
return 3;
if (
/*depth*/
ctx2[0] === 5
)
return 4;
if (
/*depth*/
ctx2[0] === 6
)
return 5;
return 6;
}
current_block_type_index = select_block_type(ctx);
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
return {
c() {
if_block.c();
if_block_anchor = empty();
},
l(nodes) {
if_block.l(nodes);
if_block_anchor = empty();
},
m(target, anchor) {
if_blocks[current_block_type_index].m(target, anchor);
insert_hydration(target, if_block_anchor, anchor);
current = true;
},
p(ctx2, [dirty]) {
let previous_block_index = current_block_type_index;
current_block_type_index = select_block_type(ctx2);
if (current_block_type_index === previous_block_index) {
if_blocks[current_block_type_index].p(ctx2, dirty);
} else {
group_outros();
transition_out(if_blocks[previous_block_index], 1, 1, () => {
if_blocks[previous_block_index] = null;
});
check_outros();
if_block = if_blocks[current_block_type_index];
if (!if_block) {
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2);
if_block.c();
} else {
if_block.p(ctx2, dirty);
}
transition_in(if_block, 1);
if_block.m(if_block_anchor.parentNode, if_block_anchor);
}
},
i(local) {
if (current)
return;
transition_in(if_block);
current = true;
},
o(local) {
transition_out(if_block);
current = false;
},
d(detaching) {
if_blocks[current_block_type_index].d(detaching);
if (detaching)
detach(if_block_anchor);
}
};
}
function instance$k($$self, $$props, $$invalidate) {
let id;
let { $$slots: slots = {}, $$scope } = $$props;
let { depth } = $$props;
let { raw } = $$props;
let { text: text2 } = $$props;
const { slug, getOptions } = getContext(key);
const options = getOptions();
$$self.$$set = ($$props2) => {
if ("depth" in $$props2)
$$invalidate(0, depth = $$props2.depth);
if ("raw" in $$props2)
$$invalidate(1, raw = $$props2.raw);
if ("text" in $$props2)
$$invalidate(3, text2 = $$props2.text);
if ("$$scope" in $$props2)
$$invalidate(4, $$scope = $$props2.$$scope);
};
$$self.$$.update = () => {
if ($$self.$$.dirty & /*text*/
8) {
$$invalidate(2, id = options.headerIds ? options.headerPrefix + slug(text2) : void 0);
}
};
return [depth, raw, id, text2, $$scope, slots];
}
class Heading extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$k, create_fragment$l, safe_not_equal, { depth: 0, raw: 1, text: 3 });
}
}
function create_fragment$k(ctx) {
let p;
let current;
const default_slot_template = (
/*#slots*/
ctx[1].default
);
const default_slot = create_slot(
default_slot_template,
ctx,
/*$$scope*/
ctx[0],
null
);
return {
c() {
p = element("p");
if (default_slot)
default_slot.c();
},
l(nodes) {
p = claim_element(nodes, "P", {});
var p_nodes = children(p);
if (default_slot)
default_slot.l(p_nodes);
p_nodes.forEach(detach);
},
m(target, anchor) {
insert_hydration(target, p, anchor);
if (default_slot) {
default_slot.m(p, null);
}
current = true;
},
p(ctx2, [dirty]) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/
1)) {
update_slot_base(
default_slot,
default_slot_template,
ctx2,
/*$$scope*/
ctx2[0],
!current ? get_all_dirty_from_scope(
/*$$scope*/
ctx2[0]
) : get_slot_changes(
default_slot_template,
/*$$scope*/
ctx2[0],
dirty,
null
),
null
);
}
}
},
i(local) {
if (current)
return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching)
detach(p);
if (default_slot)
default_slot.d(detaching);
}
};
}
function instance$j($$self, $$props, $$invalidate) {
let { $$slots: slots = {}, $$scope } = $$props;
$$self.$$set = ($$props2) => {
if ("$$scope" in $$props2)
$$invalidate(0, $$scope = $$props2.$$scope);
};
return [$$scope, slots];
}
class Paragraph extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$j, create_fragment$k, safe_not_equal, {});
}
}
function create_fragment$j(ctx) {
let current;
const default_slot_template = (
/*#slots*/
ctx[3].default
);
const default_slot = create_slot(
default_slot_template,
ctx,
/*$$scope*/
ctx[2],
null
);
return {
c() {
if (default_slot)
default_slot.c();
},
l(nodes) {
if (default_slot)
default_slot.l(nodes);
},
m(target, anchor) {
if (default_slot) {
default_slot.m(target, anchor);
}
current = true;
},
p(ctx2, [dirty]) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/
4)) {
update_slot_base(
default_slot,
default_slot_template,
ctx2,
/*$$scope*/
ctx2[2],
!current ? get_all_dirty_from_scope(
/*$$scope*/
ctx2[2]
) : get_slot_changes(
default_slot_template,
/*$$scope*/
ctx2[2],
dirty,
null
),
null
);
}
}
},
i(local) {
if (current)
return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (default_slot)
default_slot.d(detaching);
}
};
}
function instance$i($$self, $$props, $$invalidate) {
let { $$slots: slots = {}, $$scope } = $$props;
let { text: text2 } = $$props;
let { raw } = $$props;
$$self.$$set = ($$props2) => {
if ("text" in $$props2)
$$invalidate(0, text2 = $$props2.text);
if ("raw" in $$props2)
$$invalidate(1, raw = $$props2.raw);
if ("$$scope" in $$props2)
$$invalidate(2, $$scope = $$props2.$$scope);
};
return [text2, raw, $$scope, slots];
}
class Text extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$i, create_fragment$j, safe_not_equal, { text: 0, raw: 1 });
}
}
function create_fragment$i(ctx) {
let img;
let img_src_value;
return {
c() {
img = element("img");
this.h();
},
l(nodes) {
img = claim_element(nodes, "IMG", { src: true, title: true, alt: true });
this.h();
},
h() {
if (!src_url_equal(img.src, img_src_value = /*href*/
ctx[0]))
attr(img, "src", img_src_value);
attr(
img,
"title",
/*title*/
ctx[1]
);
attr(
img,
"alt",
/*text*/
ctx[2]
);
},
m(target, anchor) {
insert_hydration(target, img, anchor);
},
p(ctx2, [dirty]) {
if (dirty & /*href*/
1 && !src_url_equal(img.src, img_src_value = /*href*/
ctx2[0])) {
attr(img, "src", img_src_value);
}
if (dirty & /*title*/
2) {
attr(
img,
"title",
/*title*/
ctx2[1]
);
}
if (dirty & /*text*/
4) {
attr(
img,
"alt",
/*text*/
ctx2[2]
);
}
},
i: noop,
o: noop,
d(detaching) {
if (detaching)
detach(img);
}
};
}
function instance$h($$self, $$props, $$invalidate) {
let { href = "" } = $$props;
let { title = void 0 } = $$props;
let { text: text2 = "" } = $$props;
$$self.$$set = ($$props2) => {
if ("href" in $$props2)
$$invalidate(0, href = $$props2.href);
if ("title" in $$props2)
$$invalidate(1, title = $$props2.title);
if ("text" in $$props2)
$$invalidate(2, text2 = $$props2.text);
};
return [href, title, text2];
}
class Image extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$h, create_fragment$i, safe_not_equal, { href: 0, title: 1, text: 2 });
}
}
function create_fragment$h(ctx) {
let a;
let current;
const default_slot_template = (
/*#slots*/
ctx[3].default
);
const default_slot = create_slot(
default_slot_template,
ctx,
/*$$scope*/
ctx[2],
null
);
return {
c() {
a = element("a");
if (default_slot)
default_slot.c();
this.h();
},
l(nodes) {
a = claim_element(nodes, "A", { href: true, title: true });
var a_nodes = children(a);
if (default_slot)
default_slot.l(a_nodes);
a_nodes.forEach(detach);
this.h();
},
h() {
attr(
a,
"href",
/*href*/
ctx[0]
);
attr(
a,
"title",
/*title*/
ctx[1]
);
},
m(target, anchor) {
insert_hydration(target, a, anchor);
if (default_slot) {
default_slot.m(a, null);
}
current = true;
},
p(ctx2, [dirty]) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/
4)) {
update_slot_base(
default_slot,
default_slot_template,
ctx2,
/*$$scope*/
ctx2[2],
!current ? get_all_dirty_from_scope(
/*$$scope*/
ctx2[2]
) : get_slot_changes(
default_slot_template,
/*$$scope*/
ctx2[2],
dirty,
null
),
null
);
}
}
if (!current || dirty & /*href*/
1) {
attr(
a,
"href",
/*href*/
ctx2[0]
);
}
if (!current || dirty & /*title*/
2) {
attr(
a,
"title",
/*title*/
ctx2[1]
);
}
},
i(local) {
if (current)
return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching)
detach(a);
if (default_slot)
default_slot.d(detaching);
}
};
}
function instance$g($$self, $$props, $$invalidate) {
let { $$slots: slots = {}, $$scope } = $$props;
let { href = "" } = $$props;
let { title = void 0 } = $$props;
$$self.$$set = ($$props2) => {
if ("href" in $$props2)
$$invalidate(0, href = $$props2.href);
if ("title" in $$props2)
$$invalidate(1, title = $$props2.title);
if ("$$scope" in $$props2)
$$invalidate(2, $$scope = $$props2.$$scope);
};
return [href, title, $$scope, slots];
}
class Link extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$g, create_fragment$h, safe_not_equal, { href: 0, title: 1 });
}
}
function create_fragment$g(ctx) {
let em;
let current;
const default_slot_template = (
/*#slots*/
ctx[1].default
);
const default_slot = create_slot(
default_slot_template,
ctx,
/*$$scope*/
ctx[0],
null
);
return {
c() {
em = element("em");
if (default_slot)
default_slot.c();
},
l(nodes) {
em = claim_element(nodes, "EM", {});
var em_nodes = children(em);
if (default_slot)
default_slot.l(em_nodes);
em_nodes.forEach(detach);
},
m(target, anchor) {
insert_hydration(target, em, anchor);
if (default_slot) {
default_slot.m(em, null);
}
current = true;
},
p(ctx2, [dirty]) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/
1)) {
update_slot_base(
default_slot,
default_slot_template,
ctx2,
/*$$scope*/
ctx2[0],
!current ? get_all_dirty_from_scope(
/*$$scope*/
ctx2[0]
) : get_slot_changes(
default_slot_template,
/*$$scope*/
ctx2[0],
dirty,
null
),
null
);
}
}
},
i(local) {
if (current)
return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching)
detach(em);
if (default_slot)
default_slot.d(detaching);
}
};
}
function instance$f($$self, $$props, $$invalidate) {
let { $$slots: slots = {}, $$scope } = $$props;
$$self.$$set = ($$props2) => {
if ("$$scope" in $$props2)
$$invalidate(0, $$scope = $$props2.$$scope);
};
return [$$scope, slots];
}
class Em extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$f, create_fragment$g, safe_not_equal, {});
}
}
function create_fragment$f(ctx) {
let del;
let current;
const default_slot_template = (
/*#slots*/
ctx[1].default
);
const default_slot = create_slot(
default_slot_template,
ctx,
/*$$scope*/
ctx[0],
null
);
return {
c() {
del = element("del");
if (default_slot)
default_slot.c();
},
l(nodes) {
del = claim_element(nodes, "DEL", {});
var del_nodes = children(del);
if (default_slot)
default_slot.l(del_nodes);
del_nodes.forEach(detach);
},
m(target, anchor) {
insert_hydration(target, del, anchor);
if (default_slot) {
default_slot.m(del, null);
}
current = true;
},
p(ctx2, [dirty]) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/
1)) {
update_slot_base(
default_slot,
default_slot_template,
ctx2,
/*$$scope*/
ctx2[0],
!current ? get_all_dirty_from_scope(
/*$$scope*/
ctx2[0]
) : get_slot_changes(
default_slot_template,
/*$$scope*/
ctx2[0],
dirty,
null
),
null
);
}
}
},
i(local) {
if (current)
return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching)
detach(del);
if (default_slot)
default_slot.d(detaching);
}
};
}
function instance$e($$self, $$props, $$invalidate) {
let { $$slots: slots = {}, $$scope } = $$props;
$$self.$$set = ($$props2) => {
if ("$$scope" in $$props2)
$$invalidate(0, $$scope = $$props2.$$scope);
};
return [$$scope, slots];
}
class Del extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$e, create_fragment$f, safe_not_equal, {});
}
}
function create_fragment$e(ctx) {
let code;
let t_value = (
/*raw*/
ctx[0].replace(/`/g, "") + ""
);
let t;
return {
c() {
code = element("code");
t = text(t_value);
},
l(nodes) {
code = claim_element(nodes, "CODE", {});
var code_nodes = children(code);
t = claim_text(code_nodes, t_value);
code_nodes.forEach(detach);
},
m(target, anchor) {
insert_hydration(target, code, anchor);
append_hydration(code, t);
},
p(ctx2, [dirty]) {
if (dirty & /*raw*/
1 && t_value !== (t_value = /*raw*/
ctx2[0].replace(/`/g, "") + ""))
set_data(t, t_value);
},
i: noop,
o: noop,
d(detaching) {
if (detaching)
detach(code);
}
};
}
function instance$d($$self, $$props, $$invalidate) {
let { raw } = $$props;
$$self.$$set = ($$props2) => {
if ("raw" in $$props2)
$$invalidate(0, raw = $$props2.raw);
};
return [raw];
}
class Codespan extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$d, create_fragment$e, safe_not_equal, { raw: 0 });
}
}
function create_fragment$d(ctx) {
let strong;
let current;
const default_slot_template = (
/*#slots*/
ctx[1].default
);
const default_slot = create_slot(
default_slot_template,
ctx,
/*$$scope*/
ctx[0],
null
);
return {
c() {
strong = element("strong");
if (default_slot)
default_slot.c();
},
l(nodes) {
strong = claim_element(nodes, "STRONG", {});
var strong_nodes = children(strong);
if (default_slot)
default_slot.l(strong_nodes);
strong_nodes.forEach(detach);
},
m(target, anchor) {
insert_hydration(target, strong, anchor);
if (default_slot) {
default_slot.m(strong, null);
}
current = true;
},
p(ctx2, [dirty]) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/
1)) {
update_slot_base(
default_slot,
default_slot_template,
ctx2,
/*$$scope*/
ctx2[0],
!current ? get_all_dirty_from_scope(
/*$$scope*/
ctx2[0]
) : get_slot_changes(
default_slot_template,
/*$$scope*/
ctx2[0],
dirty,
null
),
null
);
}
}
},
i(local) {
if (current)
return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching)
detach(strong);
if (default_slot)
default_slot.d(detaching);
}
};
}
function instance$c($$self, $$props, $$invalidate) {
let { $$slots: slots = {}, $$scope } = $$props;
$$self.$$set = ($$props2) => {
if ("$$scope" in $$props2)
$$invalidate(0, $$scope = $$props2.$$scope);
};
return [$$scope, slots];
}
class Strong extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$c, create_fragment$d, safe_not_equal, {});
}
}
function create_fragment$c(ctx) {
let table;
let current;
const default_slot_template = (
/*#slots*/
ctx[1].default
);
const default_slot = create_slot(
default_slot_template,
ctx,
/*$$scope*/
ctx[0],
null
);
return {
c() {
table = element("table");
if (default_slot)
default_slot.c();
},
l(nodes) {
table = claim_element(nodes, "TABLE", {});
var table_nodes = children(table);
if (default_slot)
default_slot.l(table_nodes);
table_nodes.forEach(detach);
},
m(target, anchor) {
insert_hydration(target, table, anchor);
if (default_slot) {
default_slot.m(table, null);
}
current = true;
},
p(ctx2, [dirty]) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/
1)) {
update_slot_base(
default_slot,
default_slot_template,
ctx2,
/*$$scope*/
ctx2[0],
!current ? get_all_dirty_from_scope(
/*$$scope*/
ctx2[0]
) : get_slot_changes(
default_slot_template,
/*$$scope*/
ctx2[0],
dirty,
null
),
null
);
}
}
},
i(local) {
if (current)
return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching)
detach(table);
if (default_slot)
default_slot.d(detaching);
}
};
}
function instance$b($$self, $$props, $$invalidate) {
let { $$slots: slots = {}, $$scope } = $$props;
$$self.$$set = ($$props2) => {
if ("$$scope" in $$props2)
$$invalidate(0, $$scope = $$props2.$$scope);
};
return [$$scope, slots];
}
class Table extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$b, create_fragment$c, safe_not_equal, {});
}
}
function create_fragment$b(ctx) {
let thead;
let current;
const default_slot_template = (
/*#slots*/
ctx[1].default
);
const default_slot = create_slot(
default_slot_template,
ctx,
/*$$scope*/
ctx[0],
null
);
return {
c() {
thead = element("thead");
if (default_slot)
default_slot.c();
},
l(nodes) {
thead = claim_element(nodes, "THEAD", {});
var thead_nodes = children(thead);
if (default_slot)
default_slot.l(thead_nodes);
thead_nodes.forEach(detach);
},
m(target, anchor) {
insert_hydration(target, thead, anchor);
if (default_slot) {
default_slot.m(thead, null);
}
current = true;
},
p(ctx2, [dirty]) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/
1)) {
update_slot_base(
default_slot,
default_slot_template,
ctx2,
/*$$scope*/
ctx2[0],
!current ? get_all_dirty_from_scope(
/*$$scope*/
ctx2[0]
) : get_slot_changes(
default_slot_template,
/*$$scope*/
ctx2[0],
dirty,
null
),
null
);
}
}
},
i(local) {
if (current)
return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching)
detach(thead);
if (default_slot)
default_slot.d(detaching);
}
};
}
function instance$a($$self, $$props, $$invalidate) {
let { $$slots: slots = {}, $$scope } = $$props;
$$self.$$set = ($$props2) => {
if ("$$scope" in $$props2)
$$invalidate(0, $$scope = $$props2.$$scope);
};
return [$$scope, slots];
}
class TableHead extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$a, create_fragment$b, safe_not_equal, {});
}
}
function create_fragment$a(ctx) {
let tbody;
let current;
const default_slot_template = (
/*#slots*/
ctx[1].default
);
const default_slot = create_slot(
default_slot_template,
ctx,
/*$$scope*/
ctx[0],
null
);
return {
c() {
tbody = element("tbody");
if (default_slot)
default_slot.c();
},
l(nodes) {
tbody = claim_element(nodes, "TBODY", {});
var tbody_nodes = children(tbody);
if (default_slot)
default_slot.l(tbody_nodes);
tbody_nodes.forEach(detach);
},
m(target, anchor) {
insert_hydration(target, tbody, anchor);
if (default_slot) {
default_slot.m(tbody, null);
}
current = true;
},
p(ctx2, [dirty]) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/
1)) {
update_slot_base(
default_slot,
default_slot_template,
ctx2,
/*$$scope*/
ctx2[0],
!current ? get_all_dirty_from_scope(
/*$$scope*/
ctx2[0]
) : get_slot_changes(
default_slot_template,
/*$$scope*/
ctx2[0],
dirty,
null
),
null
);
}
}
},
i(local) {
if (current)
return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching)
detach(tbody);
if (default_slot)
default_slot.d(detaching);
}
};
}
function instance$9($$self, $$props, $$invalidate) {
let { $$slots: slots = {}, $$scope } = $$props;
$$self.$$set = ($$props2) => {
if ("$$scope" in $$props2)
$$invalidate(0, $$scope = $$props2.$$scope);
};
return [$$scope, slots];
}
class TableBody extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$9, create_fragment$a, safe_not_equal, {});
}
}
function create_fragment$9(ctx) {
let tr;
let current;
const default_slot_template = (
/*#slots*/
ctx[1].default
);
const default_slot = create_slot(
default_slot_template,
ctx,
/*$$scope*/
ctx[0],
null
);
return {
c() {
tr = element("tr");
if (default_slot)
default_slot.c();
},
l(nodes) {
tr = claim_element(nodes, "TR", {});
var tr_nodes = children(tr);
if (default_slot)
default_slot.l(tr_nodes);
tr_nodes.forEach(detach);
},
m(target, anchor) {
insert_hydration(target, tr, anchor);
if (default_slot) {
default_slot.m(tr, null);
}
current = true;
},
p(ctx2, [dirty]) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/
1)) {
update_slot_base(
default_slot,
default_slot_template,
ctx2,
/*$$scope*/
ctx2[0],
!current ? get_all_dirty_from_scope(
/*$$scope*/
ctx2[0]
) : get_slot_changes(
default_slot_template,
/*$$scope*/
ctx2[0],
dirty,
null
),
null
);
}
}
},
i(local) {
if (current)
return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching)
detach(tr);
if (default_slot)
default_slot.d(detaching);
}
};
}
function instance$8($$self, $$props, $$invalidate) {
let { $$slots: slots = {}, $$scope } = $$props;
$$self.$$set = ($$props2) => {
if ("$$scope" in $$props2)
$$invalidate(0, $$scope = $$props2.$$scope);
};
return [$$scope, slots];
}
class TableRow extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$8, create_fragment$9, safe_not_equal, {});
}
}
function create_else_block$1(ctx) {
let td;
let current;
const default_slot_template = (
/*#slots*/
ctx[3].default
);
const default_slot = create_slot(
default_slot_template,
ctx,
/*$$scope*/
ctx[2],
null
);
return {
c() {
td = element("td");
if (default_slot)
default_slot.c();
this.h();
},
l(nodes) {
td = claim_element(nodes, "TD", { align: true });
var td_nodes = children(td);
if (default_slot)
default_slot.l(td_nodes);
td_nodes.forEach(detach);
this.h();
},
h() {
attr(
td,
"align",
/*align*/
ctx[1]
);
},
m(target, anchor) {
insert_hydration(target, td, anchor);
if (default_slot) {
default_slot.m(td, null);
}
current = true;
},
p(ctx2, dirty) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/
4)) {
update_slot_base(
default_slot,
default_slot_template,
ctx2,
/*$$scope*/
ctx2[2],
!current ? get_all_dirty_from_scope(
/*$$scope*/
ctx2[2]
) : get_slot_changes(
default_slot_template,
/*$$scope*/
ctx2[2],
dirty,
null
),
null
);
}
}
if (!current || dirty & /*align*/
2) {
attr(
td,
"align",
/*align*/
ctx2[1]
);
}
},
i(local) {
if (current)
return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching)
detach(td);
if (default_slot)
default_slot.d(detaching);
}
};
}
function create_if_block$1(ctx) {
let th;
let current;
const default_slot_template = (
/*#slots*/
ctx[3].default
);
const default_slot = create_slot(
default_slot_template,
ctx,
/*$$scope*/
ctx[2],
null
);
return {
c() {
th = element("th");
if (default_slot)
default_slot.c();
this.h();
},
l(nodes) {
th = claim_element(nodes, "TH", { align: true });
var th_nodes = children(th);
if (default_slot)
default_slot.l(th_nodes);
th_nodes.forEach(detach);
this.h();
},
h() {
attr(
th,
"align",
/*align*/
ctx[1]
);
},
m(target, anchor) {
insert_hydration(target, th, anchor);
if (default_slot) {
default_slot.m(th, null);
}
current = true;
},
p(ctx2, dirty) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/
4)) {
update_slot_base(
default_slot,
default_slot_template,
ctx2,
/*$$scope*/
ctx2[2],
!current ? get_all_dirty_from_scope(
/*$$scope*/
ctx2[2]
) : get_slot_changes(
default_slot_template,
/*$$scope*/
ctx2[2],
dirty,
null
),
null
);
}
}
if (!current || dirty & /*align*/
2) {
attr(
th,
"align",
/*align*/
ctx2[1]
);
}
},
i(local) {
if (current)
return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching)
detach(th);
if (default_slot)
default_slot.d(detaching);
}
};
}
function create_fragment$8(ctx) {
let current_block_type_index;
let if_block;
let if_block_anchor;
let current;
const if_block_creators = [create_if_block$1, create_else_block$1];
const if_blocks = [];
function select_block_type(ctx2, dirty) {
if (
/*header*/
ctx2[0]
)
return 0;
return 1;
}
current_block_type_index = select_block_type(ctx);
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
return {
c() {
if_block.c();
if_block_anchor = empty();
},
l(nodes) {
if_block.l(nodes);
if_block_anchor = empty();
},
m(target, anchor) {
if_blocks[current_block_type_index].m(target, anchor);
insert_hydration(target, if_block_anchor, anchor);
current = true;
},
p(ctx2, [dirty]) {
let previous_block_index = current_block_type_index;
current_block_type_index = select_block_type(ctx2);
if (current_block_type_index === previous_block_index) {
if_blocks[current_block_type_index].p(ctx2, dirty);
} else {
group_outros();
transition_out(if_blocks[previous_block_index], 1, 1, () => {
if_blocks[previous_block_index] = null;
});
check_outros();
if_block = if_blocks[current_block_type_index];
if (!if_block) {
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2);
if_block.c();
} else {
if_block.p(ctx2, dirty);
}
transition_in(if_block, 1);
if_block.m(if_block_anchor.parentNode, if_block_anchor);
}
},
i(local) {
if (current)
return;
transition_in(if_block);
current = true;
},
o(local) {
transition_out(if_block);
current = false;
},
d(detaching) {
if_blocks[current_block_type_index].d(detaching);
if (detaching)
detach(if_block_anchor);
}
};
}
function instance$7($$self, $$props, $$invalidate) {
let { $$slots: slots = {}, $$scope } = $$props;
let { header } = $$props;
let { align } = $$props;
$$self.$$set = ($$props2) => {
if ("header" in $$props2)
$$invalidate(0, header = $$props2.header);
if ("align" in $$props2)
$$invalidate(1, align = $$props2.align);
if ("$$scope" in $$props2)
$$invalidate(2, $$scope = $$props2.$$scope);
};
return [header, align, $$scope, slots];
}
class TableCell extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$7, create_fragment$8, safe_not_equal, { header: 0, align: 1 });
}
}
function create_else_block(ctx) {
let ul;
let current;
const default_slot_template = (
/*#slots*/
ctx[3].default
);
const default_slot = create_slot(
default_slot_template,
ctx,
/*$$scope*/
ctx[2],
null
);
return {
c() {
ul = element("ul");
if (default_slot)
default_slot.c();
},
l(nodes) {
ul = claim_element(nodes, "UL", {});
var ul_nodes = children(ul);
if (default_slot)
default_slot.l(ul_nodes);
ul_nodes.forEach(detach);
},
m(target, anchor) {
insert_hydration(target, ul, anchor);
if (default_slot) {
default_slot.m(ul, null);
}
current = true;
},
p(ctx2, dirty) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/
4)) {
update_slot_base(
default_slot,
default_slot_template,
ctx2,
/*$$scope*/
ctx2[2],
!current ? get_all_dirty_from_scope(
/*$$scope*/
ctx2[2]
) : get_slot_changes(
default_slot_template,
/*$$scope*/
ctx2[2],
dirty,
null
),
null
);
}
}
},
i(local) {
if (current)
return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching)
detach(ul);
if (default_slot)
default_slot.d(detaching);
}
};
}
function create_if_block(ctx) {
let ol;
let current;
const default_slot_template = (
/*#slots*/
ctx[3].default
);
const default_slot = create_slot(
default_slot_template,
ctx,
/*$$scope*/
ctx[2],
null
);
return {
c() {
ol = element("ol");
if (default_slot)
default_slot.c();
this.h();
},
l(nodes) {
ol = claim_element(nodes, "OL", { start: true });
var ol_nodes = children(ol);
if (default_slot)
default_slot.l(ol_nodes);
ol_nodes.forEach(detach);
this.h();
},
h() {
attr(
ol,
"start",
/*start*/
ctx[1]
);
},
m(target, anchor) {
insert_hydration(target, ol, anchor);
if (default_slot) {
default_slot.m(ol, null);
}
current = true;
},
p(ctx2, dirty) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/
4)) {
update_slot_base(
default_slot,
default_slot_template,
ctx2,
/*$$scope*/
ctx2[2],
!current ? get_all_dirty_from_scope(
/*$$scope*/
ctx2[2]
) : get_slot_changes(
default_slot_template,
/*$$scope*/
ctx2[2],
dirty,
null
),
null
);
}
}
if (!current || dirty & /*start*/
2) {
attr(
ol,
"start",
/*start*/
ctx2[1]
);
}
},
i(local) {
if (current)
return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching)
detach(ol);
if (default_slot)
default_slot.d(detaching);
}
};
}
function create_fragment$7(ctx) {
let current_block_type_index;
let if_block;
let if_block_anchor;
let current;
const if_block_creators = [create_if_block, create_else_block];
const if_blocks = [];
function select_block_type(ctx2, dirty) {
if (
/*ordered*/
ctx2[0]
)
return 0;
return 1;
}
current_block_type_index = select_block_type(ctx);
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
return {
c() {
if_block.c();
if_block_anchor = empty();
},
l(nodes) {
if_block.l(nodes);
if_block_anchor = empty();
},
m(target, anchor) {
if_blocks[current_block_type_index].m(target, anchor);
insert_hydration(target, if_block_anchor, anchor);
current = true;
},
p(ctx2, [dirty]) {
let previous_block_index = current_block_type_index;
current_block_type_index = select_block_type(ctx2);
if (current_block_type_index === previous_block_index) {
if_blocks[current_block_type_index].p(ctx2, dirty);
} else {
group_outros();
transition_out(if_blocks[previous_block_index], 1, 1, () => {
if_blocks[previous_block_index] = null;
});
check_outros();
if_block = if_blocks[current_block_type_index];
if (!if_block) {
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2);
if_block.c();
} else {
if_block.p(ctx2, dirty);
}
transition_in(if_block, 1);
if_block.m(if_block_anchor.parentNode, if_block_anchor);
}
},
i(local) {
if (current)
return;
transition_in(if_block);
current = true;
},
o(local) {
transition_out(if_block);
current = false;
},
d(detaching) {
if_blocks[current_block_type_index].d(detaching);
if (detaching)
detach(if_block_anchor);
}
};
}
function instance$6($$self, $$props, $$invalidate) {
let { $$slots: slots = {}, $$scope } = $$props;
let { ordered } = $$props;
let { start } = $$props;
$$self.$$set = ($$props2) => {
if ("ordered" in $$props2)
$$invalidate(0, ordered = $$props2.ordered);
if ("start" in $$props2)
$$invalidate(1, start = $$props2.start);
if ("$$scope" in $$props2)
$$invalidate(2, $$scope = $$props2.$$scope);
};
return [ordered, start, $$scope, slots];
}
class List extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$6, create_fragment$7, safe_not_equal, { ordered: 0, start: 1 });
}
}
function create_fragment$6(ctx) {
let li;
let current;
const default_slot_template = (
/*#slots*/
ctx[1].default
);
const default_slot = create_slot(
default_slot_template,
ctx,
/*$$scope*/
ctx[0],
null
);
return {
c() {
li = element("li");
if (default_slot)
default_slot.c();
},
l(nodes) {
li = claim_element(nodes, "LI", {});
var li_nodes = children(li);
if (default_slot)
default_slot.l(li_nodes);
li_nodes.forEach(detach);
},
m(target, anchor) {
insert_hydration(target, li, anchor);
if (default_slot) {
default_slot.m(li, null);
}
current = true;
},
p(ctx2, [dirty]) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/
1)) {
update_slot_base(
default_slot,
default_slot_template,
ctx2,
/*$$scope*/
ctx2[0],
!current ? get_all_dirty_from_scope(
/*$$scope*/
ctx2[0]
) : get_slot_changes(
default_slot_template,
/*$$scope*/
ctx2[0],
dirty,
null
),
null
);
}
}
},
i(local) {
if (current)
return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching)
detach(li);
if (default_slot)
default_slot.d(detaching);
}
};
}
function instance$5($$self, $$props, $$invalidate) {
let { $$slots: slots = {}, $$scope } = $$props;
$$self.$$set = ($$props2) => {
if ("$$scope" in $$props2)
$$invalidate(0, $$scope = $$props2.$$scope);
};
return [$$scope, slots];
}
class ListItem extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$5, create_fragment$6, safe_not_equal, {});
}
}
function create_fragment$5(ctx) {
let hr;
return {
c() {
hr = element("hr");
},
l(nodes) {
hr = claim_element(nodes, "HR", {});
},
m(target, anchor) {
insert_hydration(target, hr, anchor);
},
p: noop,
i: noop,
o: noop,
d(detaching) {
if (detaching)
detach(hr);
}
};
}
class Hr extends SvelteComponent {
constructor(options) {
super();
init(this, options, null, create_fragment$5, safe_not_equal, {});
}
}
function create_fragment$4(ctx) {
let html_tag;
let html_anchor;
return {
c() {
html_tag = new HtmlTagHydration(false);
html_anchor = empty();
this.h();
},
l(nodes) {
html_tag = claim_html_tag(nodes, false);
html_anchor = empty();
this.h();
},
h() {
html_tag.a = html_anchor;
},
m(target, anchor) {
html_tag.m(
/*text*/
ctx[0],
target,
anchor
);
insert_hydration(target, html_anchor, anchor);
},
p(ctx2, [dirty]) {
if (dirty & /*text*/
1)
html_tag.p(
/*text*/
ctx2[0]
);
},
i: noop,
o: noop,
d(detaching) {
if (detaching)
detach(html_anchor);
if (detaching)
html_tag.d();
}
};
}
function instance$4($$self, $$props, $$invalidate) {
let { text: text2 } = $$props;
$$self.$$set = ($$props2) => {
if ("text" in $$props2)
$$invalidate(0, text2 = $$props2.text);
};
return [text2];
}
class Html extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$4, create_fragment$4, safe_not_equal, { text: 0 });
}
}
function create_fragment$3(ctx) {
let blockquote;
let current;
const default_slot_template = (
/*#slots*/
ctx[1].default
);
const default_slot = create_slot(
default_slot_template,
ctx,
/*$$scope*/
ctx[0],
null
);
return {
c() {
blockquote = element("blockquote");
if (default_slot)
default_slot.c();
},
l(nodes) {
blockquote = claim_element(nodes, "BLOCKQUOTE", {});
var blockquote_nodes = children(blockquote);
if (default_slot)
default_slot.l(blockquote_nodes);
blockquote_nodes.forEach(detach);
},
m(target, anchor) {
insert_hydration(target, blockquote, anchor);
if (default_slot) {
default_slot.m(blockquote, null);
}
current = true;
},
p(ctx2, [dirty]) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/
1)) {
update_slot_base(
default_slot,
default_slot_template,
ctx2,
/*$$scope*/
ctx2[0],
!current ? get_all_dirty_from_scope(
/*$$scope*/
ctx2[0]
) : get_slot_changes(
default_slot_template,
/*$$scope*/
ctx2[0],
dirty,
null
),
null
);
}
}
},
i(local) {
if (current)
return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching)
detach(blockquote);
if (default_slot)
default_slot.d(detaching);
}
};
}
function instance$3($$self, $$props, $$invalidate) {
let { $$slots: slots = {}, $$scope } = $$props;
$$self.$$set = ($$props2) => {
if ("$$scope" in $$props2)
$$invalidate(0, $$scope = $$props2.$$scope);
};
return [$$scope, slots];
}
class Blockquote extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$3, create_fragment$3, safe_not_equal, {});
}
}
function create_fragment$2(ctx) {
let pre;
let code;
let t;
return {
c() {
pre = element("pre");
code = element("code");
t = text(
/*text*/
ctx[1]
);
this.h();
},
l(nodes) {
pre = claim_element(nodes, "PRE", { class: true });
var pre_nodes = children(pre);
code = claim_element(pre_nodes, "CODE", {});
var code_nodes = children(code);
t = claim_text(
code_nodes,
/*text*/
ctx[1]
);
code_nodes.forEach(detach);
pre_nodes.forEach(detach);
this.h();
},
h() {
attr(
pre,
"class",
/*lang*/
ctx[0]
);
},
m(target, anchor) {
insert_hydration(target, pre, anchor);
append_hydration(pre, code);
append_hydration(code, t);
},
p(ctx2, [dirty]) {
if (dirty & /*text*/
2)
set_data(
t,
/*text*/
ctx2[1]
);
if (dirty & /*lang*/
1) {
attr(
pre,
"class",
/*lang*/
ctx2[0]
);
}
},
i: noop,
o: noop,
d(detaching) {
if (detaching)
detach(pre);
}
};
}
function instance$2($$self, $$props, $$invalidate) {
let { lang } = $$props;
let { text: text2 } = $$props;
$$self.$$set = ($$props2) => {
if ("lang" in $$props2)
$$invalidate(0, lang = $$props2.lang);
if ("text" in $$props2)
$$invalidate(1, text2 = $$props2.text);
};
return [lang, text2];
}
class Code extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$2, create_fragment$2, safe_not_equal, { lang: 0, text: 1 });
}
}
function create_fragment$1(ctx) {
let br;
let current;
const default_slot_template = (
/*#slots*/
ctx[1].default
);
const default_slot = create_slot(
default_slot_template,
ctx,
/*$$scope*/
ctx[0],
null
);
return {
c() {
br = element("br");
if (default_slot)
default_slot.c();
},
l(nodes) {
br = claim_element(nodes, "BR", {});
if (default_slot)
default_slot.l(nodes);
},
m(target, anchor) {
insert_hydration(target, br, anchor);
if (default_slot) {
default_slot.m(target, anchor);
}
current = true;
},
p(ctx2, [dirty]) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/
1)) {
update_slot_base(
default_slot,
default_slot_template,
ctx2,
/*$$scope*/
ctx2[0],
!current ? get_all_dirty_from_scope(
/*$$scope*/
ctx2[0]
) : get_slot_changes(
default_slot_template,
/*$$scope*/
ctx2[0],
dirty,
null
),
null
);
}
}
},
i(local) {
if (current)
return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching)
detach(br);
if (default_slot)
default_slot.d(detaching);
}
};
}
function instance$1($$self, $$props, $$invalidate) {
let { $$slots: slots = {}, $$scope } = $$props;
$$self.$$set = ($$props2) => {
if ("$$scope" in $$props2)
$$invalidate(0, $$scope = $$props2.$$scope);
};
return [$$scope, slots];
}
class Br extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$1, create_fragment$1, safe_not_equal, {});
}
}
const defaultRenderers = {
heading: Heading,
paragraph: Paragraph,
text: Text,
image: Image,
link: Link,
em: Em,
strong: Strong,
codespan: Codespan,
del: Del,
table: Table,
tablehead: TableHead,
tablebody: TableBody,
tablerow: TableRow,
tablecell: TableCell,
list: List,
orderedlistitem: null,
unorderedlistitem: null,
listitem: ListItem,
hr: Hr,
html: Html,
blockquote: Blockquote,
code: Code,
br: Br
};
const defaultOptions = {
baseUrl: null,
breaks: false,
gfm: true,
headerIds: true,
headerPrefix: "",
highlight: null,
langPrefix: "language-",
mangle: true,
pedantic: false,
renderer: null,
sanitize: false,
sanitizer: null,
silent: false,
smartLists: false,
smartypants: false,
tokenizer: null,
xhtml: false
};
function create_fragment(ctx) {
let parser;
let current;
parser = new Parser$1({
props: {
tokens: (
/*tokens*/
ctx[0]
),
renderers: (
/*combinedRenderers*/
ctx[1]
)
}
});
return {
c() {
create_component(parser.$$.fragment);
},
l(nodes) {
claim_component(parser.$$.fragment, nodes);
},
m(target, anchor) {
mount_component(parser, target, anchor);
current = true;
},
p(ctx2, [dirty]) {
const parser_changes = {};
if (dirty & /*tokens*/
1)
parser_changes.tokens = /*tokens*/
ctx2[0];
if (dirty & /*combinedRenderers*/
2)
parser_changes.renderers = /*combinedRenderers*/
ctx2[1];
parser.$set(parser_changes);
},
i(local) {
if (current)
return;
transition_in(parser.$$.fragment, local);
current = true;
},
o(local) {
transition_out(parser.$$.fragment, local);
current = false;
},
d(detaching) {
destroy_component(parser, detaching);
}
};
}
function instance($$self, $$props, $$invalidate) {
let preprocessed;
let slugger;
let combinedOptions;
let combinedRenderers;
let { source = [] } = $$props;
let { renderers = {} } = $$props;
let { options = {} } = $$props;
let { isInline = false } = $$props;
const dispatch = createEventDispatcher();
let tokens;
let lexer;
let mounted;
setContext(key, {
slug: (val) => slugger ? slugger.slug(val) : "",
getOptions: () => combinedOptions
});
onMount(() => {
$$invalidate(7, mounted = true);
});
$$self.$$set = ($$props2) => {
if ("source" in $$props2)
$$invalidate(2, source = $$props2.source);
if ("renderers" in $$props2)
$$invalidate(3, renderers = $$props2.renderers);
if ("options" in $$props2)
$$invalidate(4, options = $$props2.options);
if ("isInline" in $$props2)
$$invalidate(5, isInline = $$props2.isInline);
};
$$self.$$.update = () => {
if ($$self.$$.dirty & /*source*/
4) {
$$invalidate(8, preprocessed = Array.isArray(source));
}
if ($$self.$$.dirty & /*source*/
4) {
slugger = source ? new Slugger() : void 0;
}
if ($$self.$$.dirty & /*options*/
16) {
$$invalidate(9, combinedOptions = { ...defaultOptions, ...options });
}
if ($$self.$$.dirty & /*preprocessed, source, combinedOptions, isInline, lexer, tokens*/
869) {
if (preprocessed) {
$$invalidate(0, tokens = source);
} else {
$$invalidate(6, lexer = new Lexer(combinedOptions));
$$invalidate(0, tokens = isInline ? lexer.inlineTokens(source) : lexer.lex(source));
dispatch("parsed", { tokens });
}
}
if ($$self.$$.dirty & /*renderers*/
8) {
$$invalidate(1, combinedRenderers = { ...defaultRenderers, ...renderers });
}
if ($$self.$$.dirty & /*mounted, preprocessed, tokens*/
385) {
mounted && !preprocessed && dispatch("parsed", { tokens });
}
};
return [
tokens,
combinedRenderers,
source,
renderers,
options,
isInline,
lexer,
mounted,
preprocessed,
combinedOptions
];
}
class SvelteMarkdown extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance, create_fragment, safe_not_equal, {
source: 2,
renderers: 3,
options: 4,
isInline: 5
});
}
}
var removeMarkdown = function(md, options) {
options = options || {};
options.listUnicodeChar = options.hasOwnProperty("listUnicodeChar") ? options.listUnicodeChar : false;
options.stripListLeaders = options.hasOwnProperty("stripListLeaders") ? options.stripListLeaders : true;
options.gfm = options.hasOwnProperty("gfm") ? options.gfm : true;
options.useImgAltText = options.hasOwnProperty("useImgAltText") ? options.useImgAltText : true;
options.abbr = options.hasOwnProperty("abbr") ? options.abbr : false;
options.replaceLinksWithURL = options.hasOwnProperty("replaceLinksWithURL") ? options.replaceLinksWithURL : false;
options.htmlTagsToSkip = options.hasOwnProperty("htmlTagsToSkip") ? options.htmlTagsToSkip : [];
var output = md || "";
output = output.replace(/^(-\s*?|\*\s*?|_\s*?){3,}\s*/gm, "");
try {
if (options.stripListLeaders) {
if (options.listUnicodeChar)
output = output.replace(/^([\s\t]*)([\*\-\+]|\d+\.)\s+/gm, options.listUnicodeChar + " $1");
else
output = output.replace(/^([\s\t]*)([\*\-\+]|\d+\.)\s+/gm, "$1");
}
if (options.gfm) {
output = output.replace(/\n={2,}/g, "\n").replace(/~{3}.*\n/g, "").replace(/~~/g, "").replace(/`{3}.*\n/g, "");
}
if (options.abbr) {
output = output.replace(/\*\[.*\]:.*\n/, "");
}
output = output.replace(/<[^>]*>/g, "");
var htmlReplaceRegex = new RegExp("<[^>]*>", "g");
if (options.htmlTagsToSkip.length > 0) {
var joinedHtmlTagsToSkip = "(?!" + options.htmlTagsToSkip.join("|") + ")";
htmlReplaceRegex = new RegExp(
"<" + joinedHtmlTagsToSkip + "[^>]*>",
"ig"
);
}
output = output.replace(htmlReplaceRegex, "").replace(/^[=\-]{2,}\s*$/g, "").replace(/\[\^.+?\](\: .*?$)?/g, "").replace(/\s{0,2}\[.*?\]: .*?$/g, "").replace(/\!\[(.*?)\][\[\(].*?[\]\)]/g, options.useImgAltText ? "$1" : "").replace(/\[([^\]]*?)\][\[\(].*?[\]\)]/g, options.replaceLinksWithURL ? "$2" : "$1").replace(/^\s{0,3}>\s?/gm, "").replace(/^\s{1,2}\[(.*?)\]: (\S+)( ".*?")?\s*$/g, "").replace(/^(\n)?\s{0,}#{1,6}\s+| {0,}(\n)?\s{0,}#{0,} #{0,}(\n)?\s{0,}$/gm, "$1$2$3").replace(/([\*]+)(\S)(.*?\S)??\1/g, "$2$3").replace(/(^|\W)([_]+)(\S)(.*?\S)??\2($|\W)/g, "$1$3$4$5").replace(/(`{3,})(.*?)\1/gm, "$2").replace(/`(.+?)`/g, "$1").replace(/~(.*?)~/g, "$1");
} catch (e) {
console.error(e);
return md;
}
return output;
};
function rand(length) {
let result = "";
const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
const charactersLength = characters.length;
let counter = 0;
while (counter < length) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
counter += 1;
}
return result;
}
function animateText(ev, interval = 50) {
if (!ev.target.getAttribute("data-text")) {
ev.target.setAttribute("data-text", ev.target.innerHTML);
}
if (ev.target.getAttribute("data-animate") === "1") {
return;
}
ev.target.setAttribute("data-animate", "1");
const orig = removeMarkdown(ev.target.getAttribute("data-text")).replace("&amp;", "&");
const steps = orig.length;
const genRand = (pos = 0, len = null) => orig.substring(pos, len).split(" ").map((x) => rand(x.length)).join(" ");
const random = genRand(0, orig.length);
ev.target.innerHTML = random;
for (let i = 0; i <= steps; i++) {
setTimeout(() => {
ev.target.innerHTML = orig.substring(0, i) + genRand(i, orig.length);
if (i === steps) {
ev.target.setAttribute("data-animate", "0");
}
}, interval * i);
}
}
async function handleAnchorClick(event) {
event.preventDefault();
const link = event.currentTarget;
const anchorId = new URL(link.href).hash.replace("#", "");
const anchor = document.getElementById(anchorId || "intro");
return window.scrollTo({
top: anchor.offsetTop,
behavior: "smooth"
});
}
function animateSection(interval = 50) {
return (el) => {
for (const e of el.target.getElementsByClassName("animate-section")) {
animateText({ target: e }, interval);
}
};
}
export {
SvelteMarkdown as S,
animateText as a,
animateSection as b,
handleAnchorClick as h
};