diff --git a/clift/src/api/initiate_upload.rs b/clift/src/api/initiate_upload.rs index 36afcef209..f4cb551a29 100644 --- a/clift/src/api/initiate_upload.rs +++ b/clift/src/api/initiate_upload.rs @@ -65,7 +65,7 @@ pub enum InitiateUploadError { CantReadBodyDuringError(reqwest::Error), #[error("got error from api: {0}")] APIError(String), - #[error("cant unresolved json: {0}")] + #[error("cant parse json: {0}")] CantParseJson(#[from] serde_json::Error), #[error("got failure from ft: {0:?}")] GotFailure(std::collections::HashMap), diff --git a/design/new-design.md b/design/new-design.md index f778f4caa8..0e1b50ed01 100644 --- a/design/new-design.md +++ b/design/new-design.md @@ -151,7 +151,7 @@ pub struct Section { } pub enum AST { - // ftd::resolved::Ast + // ftd::ast::Ast #[serde(rename = "import")] Import(ftd::ast::Import), #[serde(rename = "record")] diff --git a/fastn-core/fbt-tests/08-static-assets/output/default-E87B99BE6FF21AF6C57366B9BC72D11BBAD05FAB0169EF5CFBE70FCD47F842B6.js b/fastn-core/fbt-tests/08-static-assets/output/default-E87B99BE6FF21AF6C57366B9BC72D11BBAD05FAB0169EF5CFBE70FCD47F842B6.js index 755060b92e..d0cd243c58 100644 --- a/fastn-core/fbt-tests/08-static-assets/output/default-E87B99BE6FF21AF6C57366B9BC72D11BBAD05FAB0169EF5CFBE70FCD47F842B6.js +++ b/fastn-core/fbt-tests/08-static-assets/output/default-E87B99BE6FF21AF6C57366B9BC72D11BBAD05FAB0169EF5CFBE70FCD47F842B6.js @@ -108,1167 +108,7 @@ Prism.languages.ftd = { * https://github.com/markedjs/marked */ // Content taken from https://cdn.jsdelivr.net/npm/marked/marked.min.js -!function (e, t) { - "object" == typeof exports && "undefined" != typeof module ? t(exports) : "function" == typeof define && define.amd ? define(["exports"], t) : t((e = "undefined" != typeof globalThis ? globalThis : e || self).marked = {}) -}(this, (function (e) { - "use strict"; - - function t() { - return { - async: !1, - breaks: !1, - extensions: null, - gfm: !0, - hooks: null, - pedantic: !1, - renderer: null, - silent: !1, - tokenizer: null, - walkTokens: null - } - } - - function n(t) { - e.defaults = t - } - - e.defaults = { - async: !1, - breaks: !1, - extensions: null, - gfm: !0, - hooks: null, - pedantic: !1, - renderer: null, - silent: !1, - tokenizer: null, - walkTokens: null - }; - const s = /[&<>"']/, r = new RegExp(s.source, "g"), i = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, - l = new RegExp(i.source, "g"), o = {"&": "&", "<": "<", ">": ">", '"': """, "'": "'"}, - a = e => o[e]; - - function c(e, t) { - if (t) { - if (s.test(e)) return e.replace(r, a) - } else if (i.test(e)) return e.replace(l, a); - return e - } - - const h = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi; - const p = /(^|[^\[])\^/g; - - function u(e, t) { - e = "string" == typeof e ? e : e.source, t = t || ""; - const n = { - replace: (t, s) => (s = (s = "object" == typeof s && "source" in s ? s.source : s).replace(p, "$1"), e = e.replace(t, s), n), - getRegex: () => new RegExp(e, t) - }; - return n - } - - function g(e) { - try { - e = encodeURI(e).replace(/%25/g, "%") - } catch (e) { - return null - } - return e - } - - const k = {exec: () => null}; - - function f(e, t) { - const n = e.replace(/\|/g, ((e, t, n) => { - let s = !1, r = t; - for (; --r >= 0 && "\\" === n[r];) s = !s; - return s ? "|" : " |" - })).split(/ \|/); - let s = 0; - if (n[0].trim() || n.shift(), n.length > 0 && !n[n.length - 1].trim() && n.pop(), t) if (n.length > t) n.splice(t); else for (; n.length < t;) n.push(""); - for (; s < n.length; s++) n[s] = n[s].trim().replace(/\\\|/g, "|"); - return n - } - - function d(e, t, n) { - const s = e.length; - if (0 === s) return ""; - let r = 0; - for (; r < s;) { - const i = e.charAt(s - r - 1); - if (i !== t || n) { - if (i === t || !n) break; - r++ - } else r++ - } - return e.slice(0, s - r) - } - - function x(e, t, n, s) { - const r = t.href, i = t.title ? c(t.title) : null, l = e[1].replace(/\\([\[\]])/g, "$1"); - if ("!" !== e[0].charAt(0)) { - s.state.inLink = !0; - const e = {type: "link", raw: n, href: r, title: i, text: l, tokens: s.inlineTokens(l)}; - return s.state.inLink = !1, e - } - return {type: "image", raw: n, href: r, title: i, text: c(l)} - } - - class b { - options; - rules; - lexer; - - constructor(t) { - this.options = t || e.defaults - } - - space(e) { - const t = this.rules.block.newline.exec(e); - if (t && t[0].length > 0) return {type: "space", raw: t[0]} - } - - code(e) { - const t = this.rules.block.code.exec(e); - if (t) { - const e = t[0].replace(/^ {1,4}/gm, ""); - return { - type: "code", - raw: t[0], - codeBlockStyle: "indented", - text: this.options.pedantic ? e : d(e, "\n") - } - } - } - - fences(e) { - const t = this.rules.block.fences.exec(e); - if (t) { - const e = t[0], n = function (e, t) { - const n = e.match(/^(\s+)(?:```)/); - if (null === n) return t; - const s = n[1]; - return t.split("\n").map((e => { - const t = e.match(/^\s+/); - if (null === t) return e; - const [n] = t; - return n.length >= s.length ? e.slice(s.length) : e - })).join("\n") - }(e, t[3] || ""); - return { - type: "code", - raw: e, - lang: t[2] ? t[2].trim().replace(this.rules.inline._escapes, "$1") : t[2], - text: n - } - } - } - - heading(e) { - const t = this.rules.block.heading.exec(e); - if (t) { - let e = t[2].trim(); - if (/#$/.test(e)) { - const t = d(e, "#"); - this.options.pedantic ? e = t.trim() : t && !/ $/.test(t) || (e = t.trim()) - } - return {type: "heading", raw: t[0], depth: t[1].length, text: e, tokens: this.lexer.inline(e)} - } - } - - hr(e) { - const t = this.rules.block.hr.exec(e); - if (t) return {type: "hr", raw: t[0]} - } - - blockquote(e) { - const t = this.rules.block.blockquote.exec(e); - if (t) { - const e = d(t[0].replace(/^ *>[ \t]?/gm, ""), "\n"), n = this.lexer.state.top; - this.lexer.state.top = !0; - const s = this.lexer.blockTokens(e); - return this.lexer.state.top = n, {type: "blockquote", raw: t[0], tokens: s, text: e} - } - } - - list(e) { - let t = this.rules.block.list.exec(e); - if (t) { - let n = t[1].trim(); - const s = n.length > 1, - r = {type: "list", raw: "", ordered: s, start: s ? +n.slice(0, -1) : "", loose: !1, items: []}; - n = s ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = s ? n : "[*+-]"); - const i = new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`); - let l = "", o = "", a = !1; - for (; e;) { - let n = !1; - if (!(t = i.exec(e))) break; - if (this.rules.block.hr.test(e)) break; - l = t[0], e = e.substring(l.length); - let s = t[2].split("\n", 1)[0].replace(/^\t+/, (e => " ".repeat(3 * e.length))), - c = e.split("\n", 1)[0], h = 0; - this.options.pedantic ? (h = 2, o = s.trimStart()) : (h = t[2].search(/[^ ]/), h = h > 4 ? 1 : h, o = s.slice(h), h += t[1].length); - let p = !1; - if (!s && /^ *$/.test(c) && (l += c + "\n", e = e.substring(c.length + 1), n = !0), !n) { - const t = new RegExp(`^ {0,${Math.min(3,h-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`), - n = new RegExp(`^ {0,${Math.min(3,h-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), - r = new RegExp(`^ {0,${Math.min(3,h-1)}}(?:\`\`\`|~~~)`), - i = new RegExp(`^ {0,${Math.min(3,h-1)}}#`); - for (; e;) { - const a = e.split("\n", 1)[0]; - if (c = a, this.options.pedantic && (c = c.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ")), r.test(c)) break; - if (i.test(c)) break; - if (t.test(c)) break; - if (n.test(e)) break; - if (c.search(/[^ ]/) >= h || !c.trim()) o += "\n" + c.slice(h); else { - if (p) break; - if (s.search(/[^ ]/) >= 4) break; - if (r.test(s)) break; - if (i.test(s)) break; - if (n.test(s)) break; - o += "\n" + c - } - p || c.trim() || (p = !0), l += a + "\n", e = e.substring(a.length + 1), s = c.slice(h) - } - } - r.loose || (a ? r.loose = !0 : /\n *\n *$/.test(l) && (a = !0)); - let u, g = null; - this.options.gfm && (g = /^\[[ xX]\] /.exec(o), g && (u = "[ ] " !== g[0], o = o.replace(/^\[[ xX]\] +/, ""))), r.items.push({ - type: "list_item", - raw: l, - task: !!g, - checked: u, - loose: !1, - text: o, - tokens: [] - }), r.raw += l - } - r.items[r.items.length - 1].raw = l.trimEnd(), r.items[r.items.length - 1].text = o.trimEnd(), r.raw = r.raw.trimEnd(); - for (let e = 0; e < r.items.length; e++) if (this.lexer.state.top = !1, r.items[e].tokens = this.lexer.blockTokens(r.items[e].text, []), !r.loose) { - const t = r.items[e].tokens.filter((e => "space" === e.type)), - n = t.length > 0 && t.some((e => /\n.*\n/.test(e.raw))); - r.loose = n - } - if (r.loose) for (let e = 0; e < r.items.length; e++) r.items[e].loose = !0; - return r - } - } - - html(e) { - const t = this.rules.block.html.exec(e); - if (t) { - return { - type: "html", - block: !0, - raw: t[0], - pre: "pre" === t[1] || "script" === t[1] || "style" === t[1], - text: t[0] - } - } - } - - def(e) { - const t = this.rules.block.def.exec(e); - if (t) { - const e = t[1].toLowerCase().replace(/\s+/g, " "), - n = t[2] ? t[2].replace(/^<(.*)>$/, "$1").replace(this.rules.inline._escapes, "$1") : "", - s = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline._escapes, "$1") : t[3]; - return {type: "def", tag: e, raw: t[0], href: n, title: s} - } - } - - table(e) { - const t = this.rules.block.table.exec(e); - if (t) { - if (!/[:|]/.test(t[2])) return; - const e = { - type: "table", - raw: t[0], - header: f(t[1]).map((e => ({text: e, tokens: []}))), - align: t[2].replace(/^\||\| *$/g, "").split("|"), - rows: t[3] && t[3].trim() ? t[3].replace(/\n[ \t]*$/, "").split("\n") : [] - }; - if (e.header.length === e.align.length) { - let t, n, s, r, i = e.align.length; - for (t = 0; t < i; t++) { - const n = e.align[t]; - n && (/^ *-+: *$/.test(n) ? e.align[t] = "right" : /^ *:-+: *$/.test(n) ? e.align[t] = "center" : /^ *:-+ *$/.test(n) ? e.align[t] = "left" : e.align[t] = null) - } - for (i = e.rows.length, t = 0; t < i; t++) e.rows[t] = f(e.rows[t], e.header.length).map((e => ({ - text: e, - tokens: [] - }))); - for (i = e.header.length, n = 0; n < i; n++) e.header[n].tokens = this.lexer.inline(e.header[n].text); - for (i = e.rows.length, n = 0; n < i; n++) for (r = e.rows[n], s = 0; s < r.length; s++) r[s].tokens = this.lexer.inline(r[s].text); - return e - } - } - } - - lheading(e) { - const t = this.rules.block.lheading.exec(e); - if (t) return { - type: "heading", - raw: t[0], - depth: "=" === t[2].charAt(0) ? 1 : 2, - text: t[1], - tokens: this.lexer.inline(t[1]) - } - } - - paragraph(e) { - const t = this.rules.block.paragraph.exec(e); - if (t) { - const e = "\n" === t[1].charAt(t[1].length - 1) ? t[1].slice(0, -1) : t[1]; - return {type: "paragraph", raw: t[0], text: e, tokens: this.lexer.inline(e)} - } - } - - text(e) { - const t = this.rules.block.text.exec(e); - if (t) return {type: "text", raw: t[0], text: t[0], tokens: this.lexer.inline(t[0])} - } - - escape(e) { - const t = this.rules.inline.escape.exec(e); - if (t) return {type: "escape", raw: t[0], text: c(t[1])} - } - - tag(e) { - const t = this.rules.inline.tag.exec(e); - if (t) return !this.lexer.state.inLink && /^/i.test(t[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(t[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0]) && (this.lexer.state.inRawBlock = !1), { - type: "html", - raw: t[0], - inLink: this.lexer.state.inLink, - inRawBlock: this.lexer.state.inRawBlock, - block: !1, - text: t[0] - } - } - - link(e) { - const t = this.rules.inline.link.exec(e); - if (t) { - const e = t[2].trim(); - if (!this.options.pedantic && /^$/.test(e)) return; - const t = d(e.slice(0, -1), "\\"); - if ((e.length - t.length) % 2 == 0) return - } else { - const e = function (e, t) { - if (-1 === e.indexOf(t[1])) return -1; - let n = 0; - for (let s = 0; s < e.length; s++) if ("\\" === e[s]) s++; else if (e[s] === t[0]) n++; else if (e[s] === t[1] && (n--, n < 0)) return s; - return -1 - }(t[2], "()"); - if (e > -1) { - const n = (0 === t[0].indexOf("!") ? 5 : 4) + t[1].length + e; - t[2] = t[2].substring(0, e), t[0] = t[0].substring(0, n).trim(), t[3] = "" - } - } - let n = t[2], s = ""; - if (this.options.pedantic) { - const e = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n); - e && (n = e[1], s = e[3]) - } else s = t[3] ? t[3].slice(1, -1) : ""; - return n = n.trim(), /^$/.test(e) ? n.slice(1) : n.slice(1, -1)), x(t, { - href: n ? n.replace(this.rules.inline._escapes, "$1") : n, - title: s ? s.replace(this.rules.inline._escapes, "$1") : s - }, t[0], this.lexer) - } - } - - reflink(e, t) { - let n; - if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) { - let e = (n[2] || n[1]).replace(/\s+/g, " "); - if (e = t[e.toLowerCase()], !e) { - const e = n[0].charAt(0); - return {type: "text", raw: e, text: e} - } - return x(n, e, n[0], this.lexer) - } - } - - emStrong(e, t, n = "") { - let s = this.rules.inline.emStrong.lDelim.exec(e); - if (!s) return; - if (s[3] && n.match(/[\p{L}\p{N}]/u)) return; - if (!(s[1] || s[2] || "") || !n || this.rules.inline.punctuation.exec(n)) { - const n = [...s[0]].length - 1; - let r, i, l = n, o = 0; - const a = "*" === s[0][0] ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd; - for (a.lastIndex = 0, t = t.slice(-1 * e.length + s[0].length - 1); null != (s = a.exec(t));) { - if (r = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !r) continue; - if (i = [...r].length, s[3] || s[4]) { - l += i; - continue - } - if ((s[5] || s[6]) && n % 3 && !((n + i) % 3)) { - o += i; - continue - } - if (l -= i, l > 0) continue; - i = Math.min(i, i + l + o); - const t = [...e].slice(0, n + s.index + i + 1).join(""); - if (Math.min(n, i) % 2) { - const e = t.slice(1, -1); - return {type: "em", raw: t, text: e, tokens: this.lexer.inlineTokens(e)} - } - const a = t.slice(2, -2); - return {type: "strong", raw: t, text: a, tokens: this.lexer.inlineTokens(a)} - } - } - } - - codespan(e) { - const t = this.rules.inline.code.exec(e); - if (t) { - let e = t[2].replace(/\n/g, " "); - const n = /[^ ]/.test(e), s = /^ /.test(e) && / $/.test(e); - return n && s && (e = e.substring(1, e.length - 1)), e = c(e, !0), { - type: "codespan", - raw: t[0], - text: e - } - } - } - - br(e) { - const t = this.rules.inline.br.exec(e); - if (t) return {type: "br", raw: t[0]} - } - - del(e) { - const t = this.rules.inline.del.exec(e); - if (t) return {type: "del", raw: t[0], text: t[2], tokens: this.lexer.inlineTokens(t[2])} - } - - autolink(e) { - const t = this.rules.inline.autolink.exec(e); - if (t) { - let e, n; - return "@" === t[2] ? (e = c(t[1]), n = "mailto:" + e) : (e = c(t[1]), n = e), { - type: "link", - raw: t[0], - text: e, - href: n, - tokens: [{type: "text", raw: e, text: e}] - } - } - } - - url(e) { - let t; - if (t = this.rules.inline.url.exec(e)) { - let e, n; - if ("@" === t[2]) e = c(t[0]), n = "mailto:" + e; else { - let s; - do { - s = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])[0] - } while (s !== t[0]); - e = c(t[0]), n = "www." === t[1] ? "http://" + t[0] : t[0] - } - return {type: "link", raw: t[0], text: e, href: n, tokens: [{type: "text", raw: e, text: e}]} - } - } - - inlineText(e) { - const t = this.rules.inline.text.exec(e); - if (t) { - let e; - return e = this.lexer.state.inRawBlock ? t[0] : c(t[0]), {type: "text", raw: t[0], text: e} - } - } - } - - const m = { - 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]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))", - def: /^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/, - table: k, - lheading: /^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, - _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, - text: /^[^\n]+/, - _label: /(?!\s*\])(?:\\.|[^\[\]\\])+/, - _title: /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/ - }; - m.def = u(m.def).replace("label", m._label).replace("title", m._title).getRegex(), m.bullet = /(?:[*+-]|\d{1,9}[.)])/, m.listItemStart = u(/^( *)(bull) */).replace("bull", m.bullet).getRegex(), m.list = u(m.list).replace(/bull/g, m.bullet).replace("hr", "\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def", "\\n+(?=" + m.def.source + ")").getRegex(), m._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", m._comment = /|$)/, m.html = u(m.html, "i").replace("comment", m._comment).replace("tag", m._tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), m.lheading = u(m.lheading).replace(/bull/g, m.bullet).getRegex(), m.paragraph = u(m._paragraph).replace("hr", m.hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").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", ")|<(?:script|pre|style|textarea|!--)").replace("tag", m._tag).getRegex(), m.blockquote = u(m.blockquote).replace("paragraph", m.paragraph).getRegex(), m.normal = {...m}, m.gfm = { - ...m.normal, - table: "^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)" - }, m.gfm.table = u(m.gfm.table).replace("hr", m.hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").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", ")|<(?:script|pre|style|textarea|!--)").replace("tag", m._tag).getRegex(), m.gfm.paragraph = u(m._paragraph).replace("hr", m.hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", m.gfm.table).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", ")|<(?:script|pre|style|textarea|!--)").replace("tag", m._tag).getRegex(), m.pedantic = { - ...m.normal, - html: u("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", m._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: /^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, - heading: /^(#{1,6})(.*)(?:\n+|$)/, - fences: k, - lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, - paragraph: u(m.normal._paragraph).replace("hr", m.hr).replace("heading", " *#{1,6} *[^\n]").replace("lheading", m.lheading).replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").getRegex() - }; - const w = { - escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, - autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/, - url: k, - tag: "^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^", - link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/, - reflink: /^!?\[(label)\]\[(ref)\]/, - nolink: /^!?\[(ref)\](?:\[\])?/, - reflinkSearch: "reflink|nolink(?!\\()", - emStrong: { - lDelim: /^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, - 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])/ - }, - code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, - br: /^( {2,}|\\)\n(?!\s*$)/, - del: k, - text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`^|~" - }; - w.punctuation = u(w.punctuation, "u").replace(/punctuation/g, w._punctuation).getRegex(), w.blockSkip = /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g, w.anyPunctuation = /\\[punct]/g, w._escapes = /\\([punct])/g, w._comment = u(m._comment).replace("(?:--\x3e|$)", "--\x3e").getRegex(), w.emStrong.lDelim = u(w.emStrong.lDelim, "u").replace(/punct/g, w._punctuation).getRegex(), w.emStrong.rDelimAst = u(w.emStrong.rDelimAst, "gu").replace(/punct/g, w._punctuation).getRegex(), w.emStrong.rDelimUnd = u(w.emStrong.rDelimUnd, "gu").replace(/punct/g, w._punctuation).getRegex(), w.anyPunctuation = u(w.anyPunctuation, "gu").replace(/punct/g, w._punctuation).getRegex(), w._escapes = u(w._escapes, "gu").replace(/punct/g, w._punctuation).getRegex(), w._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/, w._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])?)+(?![-_])/, w.autolink = u(w.autolink).replace("scheme", w._scheme).replace("email", w._email).getRegex(), w._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/, w.tag = u(w.tag).replace("comment", w._comment).replace("attribute", w._attribute).getRegex(), w._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, w._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/, w._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/, w.link = u(w.link).replace("label", w._label).replace("href", w._href).replace("title", w._title).getRegex(), w.reflink = u(w.reflink).replace("label", w._label).replace("ref", m._label).getRegex(), w.nolink = u(w.nolink).replace("ref", m._label).getRegex(), w.reflinkSearch = u(w.reflinkSearch, "g").replace("reflink", w.reflink).replace("nolink", w.nolink).getRegex(), w.normal = {...w}, w.pedantic = { - ...w.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: u(/^!?\[(label)\]\((.*?)\)/).replace("label", w._label).getRegex(), - reflink: u(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", w._label).getRegex() - }, w.gfm = { - ...w.normal, - escape: u(w.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]*?(?:(?=[\\ t + " ".repeat(n.length))); e;) if (!(this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((s => !!(n = s.call({lexer: this}, e, t)) && (e = e.substring(n.raw.length), t.push(n), !0))))) if (n = this.tokenizer.space(e)) e = e.substring(n.raw.length), 1 === n.raw.length && t.length > 0 ? t[t.length - 1].raw += "\n" : t.push(n); else if (n = this.tokenizer.code(e)) e = e.substring(n.raw.length), s = t[t.length - 1], !s || "paragraph" !== s.type && "text" !== s.type ? t.push(n) : (s.raw += "\n" + n.raw, s.text += "\n" + n.text, this.inlineQueue[this.inlineQueue.length - 1].src = s.text); else if (n = this.tokenizer.fences(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.heading(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.hr(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.blockquote(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.list(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.html(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.def(e)) e = e.substring(n.raw.length), s = t[t.length - 1], !s || "paragraph" !== s.type && "text" !== s.type ? this.tokens.links[n.tag] || (this.tokens.links[n.tag] = { - href: n.href, - title: n.title - }) : (s.raw += "\n" + n.raw, s.text += "\n" + n.raw, this.inlineQueue[this.inlineQueue.length - 1].src = s.text); else if (n = this.tokenizer.table(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.lheading(e)) e = e.substring(n.raw.length), t.push(n); else { - if (r = e, this.options.extensions && this.options.extensions.startBlock) { - let t = 1 / 0; - const n = e.slice(1); - let s; - this.options.extensions.startBlock.forEach((e => { - s = e.call({lexer: this}, n), "number" == typeof s && s >= 0 && (t = Math.min(t, s)) - })), t < 1 / 0 && t >= 0 && (r = e.substring(0, t + 1)) - } - if (this.state.top && (n = this.tokenizer.paragraph(r))) s = t[t.length - 1], i && "paragraph" === s.type ? (s.raw += "\n" + n.raw, s.text += "\n" + n.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = s.text) : t.push(n), i = r.length !== e.length, e = e.substring(n.raw.length); else if (n = this.tokenizer.text(e)) e = e.substring(n.raw.length), s = t[t.length - 1], s && "text" === s.type ? (s.raw += "\n" + n.raw, s.text += "\n" + n.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = s.text) : t.push(n); else if (e) { - const t = "Infinite loop on byte: " + e.charCodeAt(0); - if (this.options.silent) { - console.error(t); - break - } - throw new Error(t) - } - } - return this.state.top = !0, t - } - - inline(e, t = []) { - return this.inlineQueue.push({src: e, tokens: t}), t - } - - inlineTokens(e, t = []) { - let n, s, r, i, l, o, a = e; - if (this.tokens.links) { - const e = Object.keys(this.tokens.links); - if (e.length > 0) for (; null != (i = this.tokenizer.rules.inline.reflinkSearch.exec(a));) e.includes(i[0].slice(i[0].lastIndexOf("[") + 1, -1)) && (a = a.slice(0, i.index) + "[" + "a".repeat(i[0].length - 2) + "]" + a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex)) - } - for (; null != (i = this.tokenizer.rules.inline.blockSkip.exec(a));) a = a.slice(0, i.index) + "[" + "a".repeat(i[0].length - 2) + "]" + a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex); - for (; null != (i = this.tokenizer.rules.inline.anyPunctuation.exec(a));) a = a.slice(0, i.index) + "++" + a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex); - for (; e;) if (l || (o = ""), l = !1, !(this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((s => !!(n = s.call({lexer: this}, e, t)) && (e = e.substring(n.raw.length), t.push(n), !0))))) if (n = this.tokenizer.escape(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.tag(e)) e = e.substring(n.raw.length), s = t[t.length - 1], s && "text" === n.type && "text" === s.type ? (s.raw += n.raw, s.text += n.text) : t.push(n); else if (n = this.tokenizer.link(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.reflink(e, this.tokens.links)) e = e.substring(n.raw.length), s = t[t.length - 1], s && "text" === n.type && "text" === s.type ? (s.raw += n.raw, s.text += n.text) : t.push(n); else if (n = this.tokenizer.emStrong(e, a, o)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.codespan(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.br(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.del(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.autolink(e)) e = e.substring(n.raw.length), t.push(n); else if (this.state.inLink || !(n = this.tokenizer.url(e))) { - if (r = e, this.options.extensions && this.options.extensions.startInline) { - let t = 1 / 0; - const n = e.slice(1); - let s; - this.options.extensions.startInline.forEach((e => { - s = e.call({lexer: this}, n), "number" == typeof s && s >= 0 && (t = Math.min(t, s)) - })), t < 1 / 0 && t >= 0 && (r = e.substring(0, t + 1)) - } - if (n = this.tokenizer.inlineText(r)) e = e.substring(n.raw.length), "_" !== n.raw.slice(-1) && (o = n.raw.slice(-1)), l = !0, s = t[t.length - 1], s && "text" === s.type ? (s.raw += n.raw, s.text += n.text) : t.push(n); else if (e) { - const t = "Infinite loop on byte: " + e.charCodeAt(0); - if (this.options.silent) { - console.error(t); - break - } - throw new Error(t) - } - } else e = e.substring(n.raw.length), t.push(n); - return t - } - } - - class y { - options; - - constructor(t) { - this.options = t || e.defaults - } - - code(e, t, n) { - const s = (t || "").match(/^\S*/)?.[0]; - return e = e.replace(/\n$/, "") + "\n", s ? '
' + (n ? e : c(e, !0)) + "
\n" : "
" + (n ? e : c(e, !0)) + "
\n" - } - - blockquote(e) { - return `
\n${e}
\n` - } - - html(e, t) { - return e - } - - heading(e, t, n) { - return `${e}\n` - } - - hr() { - return "
\n" - } - - list(e, t, n) { - const s = t ? "ol" : "ul"; - return "<" + s + (t && 1 !== n ? ' start="' + n + '"' : "") + ">\n" + e + "\n" - } - - listitem(e, t, n) { - return `
  • ${e}
  • \n` - } - - checkbox(e) { - return "' - } - - paragraph(e) { - return `

    ${e}

    \n` - } - - table(e, t) { - return t && (t = `${t}`), "\n\n" + e + "\n" + t + "
    \n" - } - - tablerow(e) { - return `\n${e}\n` - } - - tablecell(e, t) { - const n = t.header ? "th" : "td"; - return (t.align ? `<${n} align="${t.align}">` : `<${n}>`) + e + `\n` - } - - strong(e) { - return `${e}` - } - - em(e) { - return `${e}` - } - - codespan(e) { - return `${e}` - } - - br() { - return "
    " - } - - del(e) { - return `${e}` - } - - link(e, t, n) { - const s = g(e); - if (null === s) return n; - let r = '
    ", r - } - - image(e, t, n) { - const s = g(e); - if (null === s) return n; - let r = `${n} "colon" === (t = t.toLowerCase()) ? ":" : "#" === t.charAt(0) ? "x" === t.charAt(1) ? String.fromCharCode(parseInt(t.substring(2), 16)) : String.fromCharCode(+t.substring(1)) : ""))); - continue - } - case"code": { - const e = r; - n += this.renderer.code(e.text, e.lang, !!e.escaped); - continue - } - case"table": { - const e = r; - let t = "", s = ""; - for (let t = 0; t < e.header.length; t++) s += this.renderer.tablecell(this.parseInline(e.header[t].tokens), { - header: !0, - align: e.align[t] - }); - t += this.renderer.tablerow(s); - let i = ""; - for (let t = 0; t < e.rows.length; t++) { - const n = e.rows[t]; - s = ""; - for (let t = 0; t < n.length; t++) s += this.renderer.tablecell(this.parseInline(n[t].tokens), { - header: !1, - align: e.align[t] - }); - i += this.renderer.tablerow(s) - } - n += this.renderer.table(t, i); - continue - } - case"blockquote": { - const e = r, t = this.parse(e.tokens); - n += this.renderer.blockquote(t); - continue - } - case"list": { - const e = r, t = e.ordered, s = e.start, i = e.loose; - let l = ""; - for (let t = 0; t < e.items.length; t++) { - const n = e.items[t], s = n.checked, r = n.task; - let o = ""; - if (n.task) { - const e = this.renderer.checkbox(!!s); - i ? n.tokens.length > 0 && "paragraph" === n.tokens[0].type ? (n.tokens[0].text = e + " " + n.tokens[0].text, n.tokens[0].tokens && n.tokens[0].tokens.length > 0 && "text" === n.tokens[0].tokens[0].type && (n.tokens[0].tokens[0].text = e + " " + n.tokens[0].tokens[0].text)) : n.tokens.unshift({ - type: "text", - text: e + " " - }) : o += e + " " - } - o += this.parse(n.tokens, i), l += this.renderer.listitem(o, r, !!s) - } - n += this.renderer.list(l, t, s); - continue - } - case"html": { - const e = r; - n += this.renderer.html(e.text, e.block); - continue - } - case"paragraph": { - const e = r; - n += this.renderer.paragraph(this.parseInline(e.tokens)); - continue - } - case"text": { - let i = r, l = i.tokens ? this.parseInline(i.tokens) : i.text; - for (; s + 1 < e.length && "text" === e[s + 1].type;) i = e[++s], l += "\n" + (i.tokens ? this.parseInline(i.tokens) : i.text); - n += t ? this.renderer.paragraph(l) : l; - continue - } - default: { - const e = 'Token with "' + r.type + '" type was not found.'; - if (this.options.silent) return console.error(e), ""; - throw new Error(e) - } - } - } - return n - } - - parseInline(e, t) { - t = t || this.renderer; - let n = ""; - for (let s = 0; s < e.length; s++) { - const r = e[s]; - if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[r.type]) { - const e = this.options.extensions.renderers[r.type].call({parser: this}, r); - if (!1 !== e || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(r.type)) { - n += e || ""; - continue - } - } - switch (r.type) { - case"escape": { - const e = r; - n += t.text(e.text); - break - } - case"html": { - const e = r; - n += t.html(e.text); - break - } - case"link": { - const e = r; - n += t.link(e.href, e.title, this.parseInline(e.tokens, t)); - break - } - case"image": { - const e = r; - n += t.image(e.href, e.title, e.text); - break - } - case"strong": { - const e = r; - n += t.strong(this.parseInline(e.tokens, t)); - break - } - case"em": { - const e = r; - n += t.em(this.parseInline(e.tokens, t)); - break - } - case"codespan": { - const e = r; - n += t.codespan(e.text); - break - } - case"br": - n += t.br(); - break; - case"del": { - const e = r; - n += t.del(this.parseInline(e.tokens, t)); - break - } - case"text": { - const e = r; - n += t.text(e.text); - break - } - default: { - const e = 'Token with "' + r.type + '" type was not found.'; - if (this.options.silent) return console.error(e), ""; - throw new Error(e) - } - } - } - return n - } - } - - class T { - options; - - constructor(t) { - this.options = t || e.defaults - } - - static passThroughHooks = new Set(["preprocess", "postprocess"]); - - preprocess(e) { - return e - } - - postprocess(e) { - return e - } - } - - class R { - defaults = { - async: !1, - breaks: !1, - extensions: null, - gfm: !0, - hooks: null, - pedantic: !1, - renderer: null, - silent: !1, - tokenizer: null, - walkTokens: null - }; - options = this.setOptions; - parse = this.#e(_.lex, z.parse); - parseInline = this.#e(_.lexInline, z.parseInline); - Parser = z; - parser = z.parse; - Renderer = y; - TextRenderer = $; - Lexer = _; - lexer = _.lex; - Tokenizer = b; - Hooks = T; - - constructor(...e) { - this.use(...e) - } - - walkTokens(e, t) { - let n = []; - for (const s of e) switch (n = n.concat(t.call(this, s)), s.type) { - case"table": { - const e = s; - for (const s of e.header) n = n.concat(this.walkTokens(s.tokens, t)); - for (const s of e.rows) for (const e of s) n = n.concat(this.walkTokens(e.tokens, t)); - break - } - case"list": { - const e = s; - n = n.concat(this.walkTokens(e.items, t)); - break - } - default: { - const e = s; - this.defaults.extensions?.childTokens?.[e.type] ? this.defaults.extensions.childTokens[e.type].forEach((s => { - n = n.concat(this.walkTokens(e[s], t)) - })) : e.tokens && (n = n.concat(this.walkTokens(e.tokens, t))) - } - } - return n - } - - use(...e) { - const t = this.defaults.extensions || {renderers: {}, childTokens: {}}; - return e.forEach((e => { - const n = {...e}; - if (n.async = this.defaults.async || n.async || !1, e.extensions && (e.extensions.forEach((e => { - if (!e.name) throw new Error("extension name required"); - if ("renderer" in e) { - const n = t.renderers[e.name]; - t.renderers[e.name] = n ? function (...t) { - let s = e.renderer.apply(this, t); - return !1 === s && (s = n.apply(this, t)), s - } : e.renderer - } - if ("tokenizer" in e) { - if (!e.level || "block" !== e.level && "inline" !== e.level) throw new Error("extension level must be 'block' or 'inline'"); - const n = t[e.level]; - n ? n.unshift(e.tokenizer) : t[e.level] = [e.tokenizer], e.start && ("block" === e.level ? t.startBlock ? t.startBlock.push(e.start) : t.startBlock = [e.start] : "inline" === e.level && (t.startInline ? t.startInline.push(e.start) : t.startInline = [e.start])) - } - "childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens) - })), n.extensions = t), e.renderer) { - const t = this.defaults.renderer || new y(this.defaults); - for (const n in e.renderer) { - const s = e.renderer[n], r = n, i = t[r]; - t[r] = (...e) => { - let n = s.apply(t, e); - return !1 === n && (n = i.apply(t, e)), n || "" - } - } - n.renderer = t - } - if (e.tokenizer) { - const t = this.defaults.tokenizer || new b(this.defaults); - for (const n in e.tokenizer) { - const s = e.tokenizer[n], r = n, i = t[r]; - t[r] = (...e) => { - let n = s.apply(t, e); - return !1 === n && (n = i.apply(t, e)), n - } - } - n.tokenizer = t - } - if (e.hooks) { - const t = this.defaults.hooks || new T; - for (const n in e.hooks) { - const s = e.hooks[n], r = n, i = t[r]; - T.passThroughHooks.has(n) ? t[r] = e => { - if (this.defaults.async) return Promise.resolve(s.call(t, e)).then((e => i.call(t, e))); - const n = s.call(t, e); - return i.call(t, n) - } : t[r] = (...e) => { - let n = s.apply(t, e); - return !1 === n && (n = i.apply(t, e)), n - } - } - n.hooks = t - } - if (e.walkTokens) { - const t = this.defaults.walkTokens, s = e.walkTokens; - n.walkTokens = function (e) { - let n = []; - return n.push(s.call(this, e)), t && (n = n.concat(t.call(this, e))), n - } - } - this.defaults = {...this.defaults, ...n} - })), this - } - - setOptions(e) { - return this.defaults = {...this.defaults, ...e}, this - } - - #e(e, t) { - return (n, s) => { - const r = {...s}, i = {...this.defaults, ...r}; - !0 === this.defaults.async && !1 === r.async && (i.silent || console.warn("marked(): The async option was set to true by an extension. The async: false option sent to unresolved will be ignored."), i.async = !0); - const l = this.#t(!!i.silent, !!i.async); - if (null == n) return l(new Error("marked(): input parameter is undefined or null")); - if ("string" != typeof n) return l(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected")); - if (i.hooks && (i.hooks.options = i), i.async) return Promise.resolve(i.hooks ? i.hooks.preprocess(n) : n).then((t => e(t, i))).then((e => i.walkTokens ? Promise.all(this.walkTokens(e, i.walkTokens)).then((() => e)) : e)).then((e => t(e, i))).then((e => i.hooks ? i.hooks.postprocess(e) : e)).catch(l); - try { - i.hooks && (n = i.hooks.preprocess(n)); - const s = e(n, i); - i.walkTokens && this.walkTokens(s, i.walkTokens); - let r = t(s, i); - return i.hooks && (r = i.hooks.postprocess(r)), r - } catch (e) { - return l(e) - } - } - } - - #t(e, t) { - return n => { - if (n.message += "\nPlease report this to https://github.com/markedjs/marked.", e) { - const e = "

    An error occurred:

    " + c(n.message + "", !0) + "
    "; - return t ? Promise.resolve(e) : e - } - if (t) return Promise.reject(n); - throw n - } - } - } - - const S = new R; - - function A(e, t) { - return S.parse(e, t) - } - - A.options = A.setOptions = function (e) { - return S.setOptions(e), A.defaults = S.defaults, n(A.defaults), A - }, A.getDefaults = t, A.defaults = e.defaults, A.use = function (...e) { - return S.use(...e), A.defaults = S.defaults, n(A.defaults), A - }, A.walkTokens = function (e, t) { - return S.walkTokens(e, t) - }, A.parseInline = S.parseInline, A.Parser = z, A.parser = z.parse, A.Renderer = y, A.TextRenderer = $, A.Lexer = _, A.lexer = _.lex, A.Tokenizer = b, A.Hooks = T, A.parse = A; - const I = A.options, E = A.setOptions, Z = A.use, q = A.walkTokens, L = A.parseInline, D = A, P = z.parse, - v = _.lex; - e.Hooks = T, e.Lexer = _, e.Marked = R, e.Parser = z, e.Renderer = y, e.TextRenderer = $, e.Tokenizer = b, e.getDefaults = t, e.lexer = v, e.marked = A, e.options = I, e.parse = D, e.parseInline = L, e.parser = P, e.setOptions = E, e.use = Z, e.walkTokens = q -})); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).marked={})}(this,(function(e){"use strict";function t(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function n(t){e.defaults=t}e.defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};const s=/[&<>"']/,r=new RegExp(s.source,"g"),i=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,l=new RegExp(i.source,"g"),o={"&":"&","<":"<",">":">",'"':""","'":"'"},a=e=>o[e];function c(e,t){if(t){if(s.test(e))return e.replace(r,a)}else if(i.test(e))return e.replace(l,a);return e}const h=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;const p=/(^|[^\[])\^/g;function u(e,t){e="string"==typeof e?e:e.source,t=t||"";const n={replace:(t,s)=>(s=(s="object"==typeof s&&"source"in s?s.source:s).replace(p,"$1"),e=e.replace(t,s),n),getRegex:()=>new RegExp(e,t)};return n}function g(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const k={exec:()=>null};function f(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let s=!1,r=t;for(;--r>=0&&"\\"===n[r];)s=!s;return s?"|":" |"})).split(/ \|/);let s=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:d(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const s=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=s.length?e.slice(s.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=d(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=d(t[0].replace(/^ *>[ \t]?/gm,""),"\n"),n=this.lexer.state.top;this.lexer.state.top=!0;const s=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:s,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const s=n.length>1,r={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");const i=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let l="",o="",a=!1;for(;e;){let n=!1;if(!(t=i.exec(e)))break;if(this.rules.block.hr.test(e))break;l=t[0],e=e.substring(l.length);let s=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),c=e.split("\n",1)[0],h=0;this.options.pedantic?(h=2,o=s.trimStart()):(h=t[2].search(/[^ ]/),h=h>4?1:h,o=s.slice(h),h+=t[1].length);let p=!1;if(!s&&/^ *$/.test(c)&&(l+=c+"\n",e=e.substring(c.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,h-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,h-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),r=new RegExp(`^ {0,${Math.min(3,h-1)}}(?:\`\`\`|~~~)`),i=new RegExp(`^ {0,${Math.min(3,h-1)}}#`);for(;e;){const a=e.split("\n",1)[0];if(c=a,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),r.test(c))break;if(i.test(c))break;if(t.test(c))break;if(n.test(e))break;if(c.search(/[^ ]/)>=h||!c.trim())o+="\n"+c.slice(h);else{if(p)break;if(s.search(/[^ ]/)>=4)break;if(r.test(s))break;if(i.test(s))break;if(n.test(s))break;o+="\n"+c}p||c.trim()||(p=!0),l+=a+"\n",e=e.substring(a.length+1),s=c.slice(h)}}r.loose||(a?r.loose=!0:/\n *\n *$/.test(l)&&(a=!0));let u,g=null;this.options.gfm&&(g=/^\[[ xX]\] /.exec(o),g&&(u="[ ] "!==g[0],o=o.replace(/^\[[ xX]\] +/,""))),r.items.push({type:"list_item",raw:l,task:!!g,checked:u,loose:!1,text:o,tokens:[]}),r.raw+=l}r.items[r.items.length-1].raw=l.trimEnd(),r.items[r.items.length-1].text=o.trimEnd(),r.raw=r.raw.trimEnd();for(let e=0;e"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));r.loose=n}if(r.loose)for(let e=0;e$/,"$1").replace(this.rules.inline._escapes,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:s}}}table(e){const t=this.rules.block.table.exec(e);if(t){if(!/[:|]/.test(t[2]))return;const e={type:"table",raw:t[0],header:f(t[1]).map((e=>({text:e,tokens:[]}))),align:t[2].replace(/^\||\| *$/g,"").split("|"),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){let t,n,s,r,i=e.align.length;for(t=0;t({text:e,tokens:[]})));for(i=e.header.length,n=0;n/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=d(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let s=0;s-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],s="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],s=e[3])}else s=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(e)?n.slice(1):n.slice(1,-1)),x(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:s?s.replace(this.rules.inline._escapes,"$1"):s},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return x(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let s=this.rules.inline.emStrong.lDelim.exec(e);if(!s)return;if(s[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(s[1]||s[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...s[0]].length-1;let r,i,l=n,o=0;const a="*"===s[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(a.lastIndex=0,t=t.slice(-1*e.length+s[0].length-1);null!=(s=a.exec(t));){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r)continue;if(i=[...r].length,s[3]||s[4]){l+=i;continue}if((s[5]||s[6])&&n%3&&!((n+i)%3)){o+=i;continue}if(l-=i,l>0)continue;i=Math.min(i,i+l+o);const t=[...e].slice(0,n+s.index+i+1).join("");if(Math.min(n,i)%2){const e=t.slice(1,-1);return{type:"em",raw:t,text:e,tokens:this.lexer.inlineTokens(e)}}const a=t.slice(2,-2);return{type:"strong",raw:t,text:a,tokens:this.lexer.inlineTokens(a)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),s=/^ /.test(e)&&/ $/.test(e);return n&&s&&(e=e.substring(1,e.length-1)),e=c(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=c(t[1]),n="mailto:"+e):(e=c(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=c(t[0]),n="mailto:"+e;else{let s;do{s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])[0]}while(s!==t[0]);e=c(t[0]),n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:c(t[0]),{type:"text",raw:t[0],text:e}}}}const m={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]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:k,lheading:/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};m.def=u(m.def).replace("label",m._label).replace("title",m._title).getRegex(),m.bullet=/(?:[*+-]|\d{1,9}[.)])/,m.listItemStart=u(/^( *)(bull) */).replace("bull",m.bullet).getRegex(),m.list=u(m.list).replace(/bull/g,m.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+m.def.source+")").getRegex(),m._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",m._comment=/|$)/,m.html=u(m.html,"i").replace("comment",m._comment).replace("tag",m._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),m.lheading=u(m.lheading).replace(/bull/g,m.bullet).getRegex(),m.paragraph=u(m._paragraph).replace("hr",m.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").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",")|<(?:script|pre|style|textarea|!--)").replace("tag",m._tag).getRegex(),m.blockquote=u(m.blockquote).replace("paragraph",m.paragraph).getRegex(),m.normal={...m},m.gfm={...m.normal,table:"^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},m.gfm.table=u(m.gfm.table).replace("hr",m.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").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",")|<(?:script|pre|style|textarea|!--)").replace("tag",m._tag).getRegex(),m.gfm.paragraph=u(m._paragraph).replace("hr",m.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",m.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",m._tag).getRegex(),m.pedantic={...m.normal,html:u("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",m._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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:k,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:u(m.normal._paragraph).replace("hr",m.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",m.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const w={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:k,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,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])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:k,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`^|~"};w.punctuation=u(w.punctuation,"u").replace(/punctuation/g,w._punctuation).getRegex(),w.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,w.anyPunctuation=/\\[punct]/g,w._escapes=/\\([punct])/g,w._comment=u(m._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),w.emStrong.lDelim=u(w.emStrong.lDelim,"u").replace(/punct/g,w._punctuation).getRegex(),w.emStrong.rDelimAst=u(w.emStrong.rDelimAst,"gu").replace(/punct/g,w._punctuation).getRegex(),w.emStrong.rDelimUnd=u(w.emStrong.rDelimUnd,"gu").replace(/punct/g,w._punctuation).getRegex(),w.anyPunctuation=u(w.anyPunctuation,"gu").replace(/punct/g,w._punctuation).getRegex(),w._escapes=u(w._escapes,"gu").replace(/punct/g,w._punctuation).getRegex(),w._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,w._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])?)+(?![-_])/,w.autolink=u(w.autolink).replace("scheme",w._scheme).replace("email",w._email).getRegex(),w._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,w.tag=u(w.tag).replace("comment",w._comment).replace("attribute",w._attribute).getRegex(),w._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,w._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,w._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,w.link=u(w.link).replace("label",w._label).replace("href",w._href).replace("title",w._title).getRegex(),w.reflink=u(w.reflink).replace("label",w._label).replace("ref",m._label).getRegex(),w.nolink=u(w.nolink).replace("ref",m._label).getRegex(),w.reflinkSearch=u(w.reflinkSearch,"g").replace("reflink",w.reflink).replace("nolink",w.nolink).getRegex(),w.normal={...w},w.pedantic={...w.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:u(/^!?\[(label)\]\((.*?)\)/).replace("label",w._label).getRegex(),reflink:u(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",w._label).getRegex()},w.gfm={...w.normal,escape:u(w.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]*?(?:(?=[\\t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((s=>!!(n=s.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),s=t[t.length-1],!s||"paragraph"!==s.type&&"text"!==s.type?t.push(n):(s.raw+="\n"+n.raw,s.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=s.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),s=t[t.length-1],!s||"paragraph"!==s.type&&"text"!==s.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(s.raw+="\n"+n.raw,s.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=s.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(r=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let s;this.options.extensions.startBlock.forEach((e=>{s=e.call({lexer:this},n),"number"==typeof s&&s>=0&&(t=Math.min(t,s))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(r)))s=t[t.length-1],i&&"paragraph"===s.type?(s.raw+="\n"+n.raw,s.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n),i=r.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),s=t[t.length-1],s&&"text"===s.type?(s.raw+="\n"+n.raw,s.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,s,r,i,l,o,a=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(a));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(a));)a=a.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.anyPunctuation.exec(a));)a=a.slice(0,i.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(l||(o=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((s=>!!(n=s.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),s=t[t.length-1],s&&"text"===n.type&&"text"===s.type?(s.raw+=n.raw,s.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),s=t[t.length-1],s&&"text"===n.type&&"text"===s.type?(s.raw+=n.raw,s.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,a,o))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(r=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let s;this.options.extensions.startInline.forEach((e=>{s=e.call({lexer:this},n),"number"==typeof s&&s>=0&&(t=Math.min(t,s))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(r))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(o=n.raw.slice(-1)),l=!0,s=t[t.length-1],s&&"text"===s.type?(s.raw+=n.raw,s.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class y{options;constructor(t){this.options=t||e.defaults}code(e,t,n){const s=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+"\n",s?'
    '+(n?e:c(e,!0))+"
    \n":"
    "+(n?e:c(e,!0))+"
    \n"}blockquote(e){return`
    \n${e}
    \n`}html(e,t){return e}heading(e,t,n){return`${e}\n`}hr(){return"
    \n"}list(e,t,n){const s=t?"ol":"ul";return"<"+s+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"}listitem(e,t,n){return`
  • ${e}
  • \n`}checkbox(e){return"'}paragraph(e){return`

    ${e}

    \n`}table(e,t){return t&&(t=`${t}`),"\n\n"+e+"\n"+t+"
    \n"}tablerow(e){return`\n${e}\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`\n`}strong(e){return`${e}`}em(e){return`${e}`}codespan(e){return`${e}`}br(){return"
    "}del(e){return`${e}`}link(e,t,n){const s=g(e);if(null===s)return n;let r='
    ",r}image(e,t,n){const s=g(e);if(null===s)return n;let r=`${n}"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):"")));continue}case"code":{const e=r;n+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case"table":{const e=r;let t="",s="";for(let t=0;t0&&"paragraph"===n.tokens[0].type?(n.tokens[0].text=e+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&"text"===n.tokens[0].tokens[0].type&&(n.tokens[0].tokens[0].text=e+" "+n.tokens[0].tokens[0].text)):n.tokens.unshift({type:"text",text:e+" "}):o+=e+" "}o+=this.parse(n.tokens,i),l+=this.renderer.listitem(o,r,!!s)}n+=this.renderer.list(l,t,s);continue}case"html":{const e=r;n+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=r;n+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let i=r,l=i.tokens?this.parseInline(i.tokens):i.text;for(;s+1{n=n.concat(this.walkTokens(e[s],t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let s=e.renderer.apply(this,t);return!1===s&&(s=n.apply(this,t)),s}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new y(this.defaults);for(const n in e.renderer){const s=e.renderer[n],r=n,i=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=i.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new b(this.defaults);for(const n in e.tokenizer){const s=e.tokenizer[n],r=n,i=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new T;for(const n in e.hooks){const s=e.hooks[n],r=n,i=t[r];T.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(s.call(t,e)).then((e=>i.call(t,e)));const n=s.call(t,e);return i.call(t,n)}:t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,s=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(s.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}#e(e,t){return(n,s)=>{const r={...s},i={...this.defaults,...r};!0===this.defaults.async&&!1===r.async&&(i.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),i.async=!0);const l=this.#t(!!i.silent,!!i.async);if(null==n)return l(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(i.hooks&&(i.hooks.options=i),i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then((t=>e(t,i))).then((e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then((()=>e)):e)).then((e=>t(e,i))).then((e=>i.hooks?i.hooks.postprocess(e):e)).catch(l);try{i.hooks&&(n=i.hooks.preprocess(n));const s=e(n,i);i.walkTokens&&this.walkTokens(s,i.walkTokens);let r=t(s,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return l(e)}}}#t(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="

    An error occurred:

    "+c(n.message+"",!0)+"
    ";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}}const S=new R;function A(e,t){return S.parse(e,t)}A.options=A.setOptions=function(e){return S.setOptions(e),A.defaults=S.defaults,n(A.defaults),A},A.getDefaults=t,A.defaults=e.defaults,A.use=function(...e){return S.use(...e),A.defaults=S.defaults,n(A.defaults),A},A.walkTokens=function(e,t){return S.walkTokens(e,t)},A.parseInline=S.parseInline,A.Parser=z,A.parser=z.parse,A.Renderer=y,A.TextRenderer=$,A.Lexer=_,A.lexer=_.lex,A.Tokenizer=b,A.Hooks=T,A.parse=A;const I=A.options,E=A.setOptions,Z=A.use,q=A.walkTokens,L=A.parseInline,D=A,P=z.parse,v=_.lex;e.Hooks=T,e.Lexer=_,e.Marked=R,e.Parser=z,e.Renderer=y,e.TextRenderer=$,e.Tokenizer=b,e.getDefaults=t,e.lexer=v,e.marked=A,e.options=I,e.parse=D,e.parseInline=L,e.parser=P,e.setOptions=E,e.use=Z,e.walkTokens=q})); const fastn = (function (fastn) { class Closure { #cached_value; @@ -1816,8 +656,8 @@ const fastn = (function (fastn) { if (!(key in obj.#fields)) { throw new Error( "RecordInstance.replace: key " + - key + - " not present in new object", + key + + " not present in new object", ); } this.#fields[key] = fastn.wrapMutable(obj.#fields[key]); @@ -2705,7 +1545,6 @@ fastn_dom.Event = { class PropertyValueAsClosure { closureFunction; deps; - constructor(closureFunction, deps) { this.closureFunction = closureFunction; this.deps = deps; @@ -2732,7 +1571,6 @@ class Node2 { */ #extraData; #children; - constructor(parentOrSibiling, kind) { this.#kind = kind; this.#parent = parentOrSibiling; @@ -2774,7 +1612,6 @@ class Node2 { this.#parent.appendChild(this.#node); } } - createNode(kind) { if (kind === fastn_dom.ElementKind.Code) { let [node, classes, attributes] = fastn_utils.htmlNode(kind); @@ -2797,15 +1634,12 @@ class Node2 { ); } } - getTagName() { return this.#tagName; } - getParent() { return this.#parent; } - removeAllFaviconLinks() { if (doubleBuffering) { const links = document.head.querySelectorAll( @@ -2816,7 +1650,6 @@ class Node2 { }); } } - setFavicon(url) { if (doubleBuffering) { if (url instanceof fastn.recordInstanceClass) url = url.get("src"); @@ -2833,7 +1666,6 @@ class Node2 { document.head.appendChild(link_element); } } - updateTextInputValue() { if (fastn_utils.isNull(this.#rawInnerValue)) { this.attachAttribute("value"); @@ -2845,7 +1677,6 @@ class Node2 { this.attachAttribute("value", this.#rawInnerValue); } } - // for attaching inline attributes attachAttribute(property, value) { // If the value is null, undefined, or false, the attribute will be removed. @@ -2856,11 +1687,9 @@ class Node2 { } this.#node.setAttribute(property, value); } - removeAttribute(property) { this.#node.removeAttribute(property); } - updateTagName(name) { if (ssr) { this.#node.updateTagName(name); @@ -2881,7 +1710,6 @@ class Node2 { this.#node = newElement; } } - updateToAnchor(url) { let node_kind = this.#kind; if (ssr) { @@ -2902,7 +1730,6 @@ class Node2 { this.#node.href = url; } } - updatePositionForNodeById(node_id, value) { if (!ssr) { const target_node = fastnVirtual.root.querySelector( @@ -2912,7 +1739,6 @@ class Node2 { target_node.style["position"] = value; } } - updateParentPosition(value) { if (ssr) { let parent = this.#parent; @@ -2926,13 +1752,11 @@ class Node2 { } } } - updateMetaTitle(value) { if (!ssr && doubleBuffering) { if (!fastn_utils.isNull(value)) window.document.title = value; } } - addMetaTagByName(name, value) { if (value === null || value === undefined) { this.removeMetaTagByName(name); @@ -2945,7 +1769,6 @@ class Node2 { document.head.appendChild(metaTag); } } - addMetaTagByProperty(property, value) { if (value === null || value === undefined) { this.removeMetaTagByProperty(property); @@ -2958,7 +1781,6 @@ class Node2 { document.head.appendChild(metaTag); } } - removeMetaTagByName(name) { if (!ssr && doubleBuffering) { const metaTags = document.getElementsByTagName("meta"); @@ -2971,7 +1793,6 @@ class Node2 { } } } - removeMetaTagByProperty(property) { if (!ssr && doubleBuffering) { const metaTags = document.getElementsByTagName("meta"); @@ -2984,7 +1805,6 @@ class Node2 { } } } - // dynamic-class-css attachCss(property, value, createClass, className) { let propertyShort = fastn_dom.propertyMap[property] || property; @@ -3000,7 +1820,7 @@ class Node2 { } let cssClass = className ? cls : `.${cls}`; - const obj = {property, value}; + const obj = { property, value }; if (value === undefined) { if (!ssr) { @@ -3063,7 +1883,6 @@ class Node2 { this.#node.classList.add(cls); return cls; } - attachShadow(value) { if (fastn_utils.isNull(value)) { this.attachCss("box-shadow", value); @@ -3099,7 +1918,6 @@ class Node2 { ); } } - attachBackdropMultiFilter(value) { const filters = { blur: fastn_utils.getStaticValue(value.get("blur")), @@ -3119,7 +1937,6 @@ class Node2 { this.attachCss("backdrop-filter", filterString, false); } - attachTextShadow(value) { if (fastn_utils.isNull(value)) { this.attachCss("text-shadow", value); @@ -3151,7 +1968,6 @@ class Node2 { ); } } - getLinearGradientString(value) { var lightGradientString = ""; var darkGradientString = ""; @@ -3197,7 +2013,6 @@ class Node2 { return [lightGradientString, darkGradientString]; } - attachLinearGradientCss(value) { if (fastn_utils.isNull(value)) { this.attachCss("background-image", value); @@ -3237,7 +2052,7 @@ class Node2 { const colorsList = value.get("colors").get().getList(); - colorsList.forEach(({item}) => { + colorsList.forEach(({ item }) => { const color = item.get("color"); [color.get("light"), color.get("dark")].forEach((variant) => { @@ -3246,7 +2061,6 @@ class Node2 { }); }); } - attachBackgroundImageCss(value) { if (fastn_utils.isNull(value)) { this.attachCss("background-repeat", value); @@ -3308,7 +2122,6 @@ class Node2 { ); } } - attachMaskImageCss(value, vendorPrefix) { const propertyWithPrefix = vendorPrefix ? `${vendorPrefix}-mask-image` @@ -3397,7 +2210,6 @@ class Node2 { ); } } - attachMaskSizeCss(value, vendorPrefix) { const propertyNameWithPrefix = vendorPrefix ? `${vendorPrefix}-mask-size` @@ -3416,7 +2228,6 @@ class Node2 { this.attachCss(propertyNameWithPrefix, `${size_x} ${size_y}`, true); } } - attachMaskMultiCss(value, vendorPrefix) { if (fastn_utils.isNull(value)) { this.attachCss("mask-repeat", value); @@ -3450,7 +2261,6 @@ class Node2 { this.attachCss("-webkit-mask-position", maskPositionValue, true); } } - attachExternalCss(css) { if (!ssr) { let css_tag = document.createElement("link"); @@ -3466,7 +2276,6 @@ class Node2 { } } } - attachExternalJs(js) { if (!ssr) { let js_tag = document.createElement("script"); @@ -3480,7 +2289,6 @@ class Node2 { } } } - attachColorCss(property, value, visited) { if (fastn_utils.isNull(value)) { this.attachCss(property, value); @@ -3533,7 +2341,6 @@ class Node2 { this.#mutables.push(modeValue); }); } - attachRoleCss(value) { if (fastn_utils.isNull(value)) { this.attachCss("role", value); @@ -3573,7 +2380,6 @@ class Node2 { ); this.#mutables.push(value); } - attachTextStyles(styles) { if (fastn_utils.isNull(styles)) { this.attachCss("font-style", styles); @@ -3595,7 +2401,6 @@ class Node2 { } } } - attachAlignContent(value, node_kind) { if (fastn_utils.isNull(value)) { this.attachCss("align-items", value); @@ -3851,7 +2656,6 @@ class Node2 { ); this.#mutables.push(ftd.dark_mode); } - setStaticProperty(kind, value, inherited) { // value can be either static or mutable let staticValue = fastn_utils.getStaticValue(value); @@ -4488,7 +3292,7 @@ class Node2 { this.attachRoleCss(staticValue); } else if (kind === fastn_dom.PropertyKind.Code) { if (!fastn_utils.isNull(staticValue)) { - let {modifiedText, highlightedLines} = + let { modifiedText, highlightedLines } = fastn_utils.findAndRemoveHighlighter(staticValue); if (highlightedLines.length !== 0) { this.attachAttribute("data-line", highlightedLines); @@ -4630,24 +3434,23 @@ class Node2 { this.#node.innerHTML = staticValue; this.#rawInnerValue = staticValue; } else if (kind === fastn_dom.PropertyKind.StringValue) { - this.#rawInnerValue = staticValue; - staticValue = fastn_utils.markdown_inline( - fastn_utils.escapeHtmlInMarkdown(staticValue), - ); - staticValue = fastn_utils.process_post_markdown( - this.#node, - staticValue, - ); - if (!fastn_utils.isNull(staticValue)) { - this.#node.innerHTML = staticValue; - } else { - this.#node.innerHTML = ""; - } + this.#rawInnerValue = staticValue; + staticValue = fastn_utils.markdown_inline( + fastn_utils.escapeHtmlInMarkdown(staticValue), + ); + staticValue = fastn_utils.process_post_markdown( + this.#node, + staticValue, + ); + if (!fastn_utils.isNull(staticValue)) { + this.#node.innerHTML = staticValue; } else { - throw "invalid fastn_dom.PropertyKind: " + kind; + this.#node.innerHTML = ""; } + } else { + throw "invalid fastn_dom.PropertyKind: " + kind; + } } - setProperty(kind, value, inherited) { if (value instanceof fastn.mutableClass) { this.setDynamicProperty( @@ -4669,7 +3472,6 @@ class Node2 { this.setStaticProperty(kind, value, inherited); } } - setDynamicProperty(kind, deps, func, inherited) { let closure = fastn .closure(func) @@ -4682,26 +3484,21 @@ class Node2 { this.#mutables.push(deps[dep]); } } - getNode() { return this.#node; } - getExtraData() { return this.#extraData; } - getChildren() { return this.#children; } - mergeFnCalls(current, newFunc) { return () => { if (current instanceof Function) current(); if (newFunc instanceof Function) newFunc(); }; } - addEventHandler(event, func) { if (event === fastn_dom.Event.Click) { let onclickEvents = this.mergeFnCalls(this.#node.onclick, func); @@ -4743,7 +3540,6 @@ class Node2 { this.#node.onfocus = onFocusEvents; } } - destroy() { for (let i = 0; i < this.#mutables.length; i++) { this.#mutables[i].unlinkNode(this); @@ -4843,16 +3639,13 @@ fastn_dom.conditionalDom = function ( class ParentNodeWithSibiling { #parent; #sibiling; - constructor(parent, sibiling) { this.#parent = parent; this.#sibiling = sibiling; } - getParent() { return this.#parent; } - getSibiling() { return this.#sibiling; } @@ -4864,7 +3657,6 @@ class ForLoop { #wrapper; #parent; #nodes; - constructor(parent, node_constructor, list) { this.#wrapper = fastn_dom.createKernel( parent, @@ -4881,7 +3673,6 @@ class ForLoop { } fastn_utils.setFullHeight(); } - createNode(index, resizeBodyHeight = true) { if (resizeBodyHeight) { fastn_utils.resetFullHeight(); @@ -4904,7 +3695,6 @@ class ForLoop { } return node; } - createAllNode() { fastn_utils.resetFullHeight(); this.deleteAllNode(false); @@ -4913,7 +3703,6 @@ class ForLoop { } fastn_utils.setFullHeight(); } - deleteAllNode(resizeBodyHeight = true) { if (resizeBodyHeight) { fastn_utils.resetFullHeight(); @@ -4925,18 +3714,15 @@ class ForLoop { fastn_utils.setFullHeight(); } } - getWrapper() { return this.#wrapper; } - deleteNode(index) { fastn_utils.resetFullHeight(); let node = this.#nodes.splice(index, 1)[0]; node.destroy(); fastn_utils.setFullHeight(); } - getParent() { return this.#parent; } @@ -5272,7 +4058,7 @@ let fastn_utils = { markdown_inline(i) { if (fastn_utils.isNull(i)) return; i = i.toString(); - const {space_before, space_after} = fastn_utils.private.spaces(i); + const { space_before, space_after } = fastn_utils.private.spaces(i); const o = (() => { let g = fastn_utils.private.replace_last_occurrence( marked.parse(i), @@ -5610,7 +4396,7 @@ fastn_utils.private = { space_before = i + 1; } if (space_before === s.length) { - return {space_before, space_after: 0}; + return { space_before, space_after: 0 }; } let space_after = 0; @@ -5622,7 +4408,7 @@ fastn_utils.private = { space_after = i + 1; } - return {space_before, space_after}; + return { space_before, space_after }; }, /** * Helper function for `fastn_utils.markdown_inline` to replace the last @@ -5649,7 +4435,7 @@ fastn_utils.private = { * @returns {string} - A string with 'n' spaces concatenated together. */ repeated_space(n) { - return Array.from({length: n}, () => " ").join(""); + return Array.from({ length: n }, () => " ").join(""); }, /** * Merges consecutive numbers in a comma-separated list into ranges. @@ -5775,7 +4561,6 @@ let doubleBuffering = false; class ClassList { #classes = []; - add(item) { this.#classes.push(item); } @@ -5783,11 +4568,9 @@ class ClassList { remove(itemToRemove) { this.#classes.filter((item) => item !== itemToRemove); } - toString() { return this.#classes.join(" "); } - getClasses() { return this.#classes; } @@ -5799,7 +4582,6 @@ class Node { #tagName; #children; #attributes; - constructor(id, tagName) { this.#tagName = tagName; this.#dataId = id; @@ -5811,7 +4593,6 @@ class Node { this.onclick = null; this.id = null; } - appendChild(c) { this.#children.push(c); } @@ -5840,7 +4621,6 @@ class Node { updateTagName(tagName) { this.#tagName = tagName; } - // Caution: This is only supported in ssr mode toHtmlAsString() { const openingTag = `<${ @@ -5854,23 +4634,19 @@ class Node { return `${openingTag}${innerHTML}${childNodes}${closingTag}`; } - // Caution: This is only supported in ssr mode getDataIdString() { return ` data-id="${this.#dataId}"`; } - // Caution: This is only supported in ssr mode getIdString() { return fastn_utils.isNull(this.id) ? "" : ` id="${this.id}"`; } - // Caution: This is only supported in ssr mode getClassString() { const classList = this.classList.toString(); return classList ? ` class="${classList}"` : ""; } - // Caution: This is only supported in ssr mode getStyleString() { const styleProperties = Object.entries(this.style) @@ -5878,7 +4654,6 @@ class Node { .join(";"); return styleProperties ? ` style="${styleProperties}"` : ""; } - // Caution: This is only supported in ssr mode getAttributesString() { const nodeAttributes = Object.entries(this.#attributes) @@ -5952,10 +4727,8 @@ fastnVirtual.ssr = function (main) { id_counter = 0; return body.toHtmlAsString() + fastn_dom.getClassesAsString(); }; - class MutableVariable { #value; - constructor(value) { this.#value = value; } @@ -5967,7 +4740,6 @@ class MutableVariable { set(value) { this.#value.set(value); } - // Todo: Remove closure when node is removed. on_change(func) { this.#value.addClosure(fastn.closureWithoutExecute(func)); @@ -5976,15 +4748,12 @@ class MutableVariable { class MutableListVariable { #value; - constructor(value) { this.#value = value; } - get() { return fastn_utils.getStaticValue(this.#value); } - set(index, list) { if (list === undefined) { this.#value.set(fastn_utils.staticToMutables(index)); @@ -5992,27 +4761,21 @@ class MutableListVariable { } this.#value.set(index, fastn_utils.staticToMutables(list)); } - insertAt(index, value) { this.#value.insertAt(index, fastn_utils.staticToMutables(value)); } - deleteAt(index) { this.#value.deleteAt(index); } - push(value) { this.#value.push(value); } - pop() { this.#value.pop(); } - clearAll() { this.#value.clearAll(); } - on_change(func) { this.#value.addClosure(fastn.closureWithoutExecute(func)); } @@ -6020,7 +4783,6 @@ class MutableListVariable { class RecordVariable { #value; - constructor(value) { this.#value = value; } @@ -6037,11 +4799,9 @@ class RecordVariable { this.#value.addClosure(fastn.closureWithoutExecute(func)); } } - class StaticVariable { #value; #closures; - constructor(value) { this.#value = value; this.#closures = []; @@ -6282,7 +5042,7 @@ const ftd = (function () { method = method.trim().toUpperCase(); const init = { method, - headers: {"Content-Type": "application/json"}, + headers: { "Content-Type": "application/json" }, }; if (headers && headers instanceof fastn.recordInstanceClass) { Object.assign(init.headers, headers.toObject()); @@ -6586,7 +5346,7 @@ const ftd = (function () { redirect: "error", // TODO: set credentials? credentials: "same-origin", - headers: {"Content-Type": "application/json"}, + headers: { "Content-Type": "application/json" }, body: JSON.stringify(data), }; @@ -6679,7 +5439,6 @@ ftd.post_init = function () { window.onresize = function () { initialise_device(); }; - function initialise_click_outside_events() { document.addEventListener("click", function (event) { ftd.clickOutsideEvents.forEach(([ftdNode, func]) => { @@ -6694,7 +5453,6 @@ ftd.post_init = function () { }); }); } - function initialise_global_key_events() { let globalKeys = {}; let buffer = []; @@ -6753,7 +5511,6 @@ ftd.post_init = function () { globalKeys[fastn_utils.getEventKey(event)] = false; }); } - function initialise_device() { let current = ftd.get_device(); if (current === last_device) { @@ -6837,23 +5594,19 @@ ftd.post_init = function () { set_cookie(DARK_MODE_COOKIE, COOKIE_SYSTEM_LIGHT); } }; - function set_cookie(name, value) { document.cookie = name + "=" + value + "; path=/"; } - function system_dark_mode() { return !!( window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ); } - function initialise_dark_mode() { update_dark_mode(); start_watching_dark_mode_system_preference(); } - function get_cookie(name, def) { // source: https://stackoverflow.com/questions/5639346/ let regex = document.cookie.match( @@ -6861,7 +5614,6 @@ ftd.post_init = function () { ); return regex !== null ? regex.pop() : def; } - function update_dark_mode() { let current_dark_mode_cookie = get_cookie( DARK_MODE_COOKIE, @@ -6883,13 +5635,11 @@ ftd.post_init = function () { window.enable_system_mode(); } } - function start_watching_dark_mode_system_preference() { window .matchMedia("(prefers-color-scheme: dark)") .addEventListener("change", update_dark_mode); } - initialise_device(); initialise_dark_mode(); initialise_click_outside_events(); @@ -6901,218 +5651,234 @@ ftd.post_init = function () { window.ftd = ftd; ftd.toggle = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "www_amitu_com"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(!fastn_utils.getStaticValue(__args__.a)); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "www_amitu_com"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(!fastn_utils.getStaticValue(__args__.a)); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.integer_field_with_default = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "www_amitu_com"; - try { - let __args__ = fastn_utils.getArgs({}, args); - return (ftd.field_with_default_js(__args__.name, __args__.default)); - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "www_amitu_com"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + return (ftd.field_with_default_js(__args__.name, __args__.default)); + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.decimal_field_with_default = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "www_amitu_com"; - try { - let __args__ = fastn_utils.getArgs({}, args); - return (ftd.field_with_default_js(__args__.name, __args__.default)); - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "www_amitu_com"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + return (ftd.field_with_default_js(__args__.name, __args__.default)); + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.boolean_field_with_default = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "www_amitu_com"; - try { - let __args__ = fastn_utils.getArgs({}, args); - return (ftd.field_with_default_js(__args__.name, __args__.default)); - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "www_amitu_com"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + return (ftd.field_with_default_js(__args__.name, __args__.default)); + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.string_field_with_default = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "www_amitu_com"; - try { - let __args__ = fastn_utils.getArgs({}, args); - return (ftd.field_with_default_js(__args__.name, __args__.default)); - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "www_amitu_com"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + return (ftd.field_with_default_js(__args__.name, __args__.default)); + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.increment = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "www_amitu_com"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(fastn_utils.getStaticValue(__args__.a) + 1); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "www_amitu_com"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(fastn_utils.getStaticValue(__args__.a) + 1); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.increment_by = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "www_amitu_com"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(fastn_utils.getStaticValue(__args__.a) + fastn_utils.getStaticValue(__args__.v)); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "www_amitu_com"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(fastn_utils.getStaticValue(__args__.a) + fastn_utils.getStaticValue(__args__.v)); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.decrement = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "www_amitu_com"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(fastn_utils.getStaticValue(__args__.a) - 1); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "www_amitu_com"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(fastn_utils.getStaticValue(__args__.a) - 1); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.decrement_by = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "www_amitu_com"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(fastn_utils.getStaticValue(__args__.a) - fastn_utils.getStaticValue(__args__.v)); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "www_amitu_com"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(fastn_utils.getStaticValue(__args__.a) - fastn_utils.getStaticValue(__args__.v)); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.enable_light_mode = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "www_amitu_com"; - try { - let __args__ = fastn_utils.getArgs({}, args); - return (enable_light_mode()); - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "www_amitu_com"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + return (enable_light_mode()); + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.enable_dark_mode = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "www_amitu_com"; - try { - let __args__ = fastn_utils.getArgs({}, args); - return (enable_dark_mode()); - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "www_amitu_com"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + return (enable_dark_mode()); + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.enable_system_mode = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "www_amitu_com"; - try { - let __args__ = fastn_utils.getArgs({}, args); - return (enable_system_mode()); - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "www_amitu_com"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + return (enable_system_mode()); + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.set_bool = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "www_amitu_com"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(__args__.v); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "www_amitu_com"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(__args__.v); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.set_boolean = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "www_amitu_com"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(__args__.v); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "www_amitu_com"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(__args__.v); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.set_string = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "www_amitu_com"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(__args__.v); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "www_amitu_com"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(__args__.v); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.set_integer = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "www_amitu_com"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(__args__.v); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "www_amitu_com"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(__args__.v); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.dark_mode = fastn.mutable(false); ftd.empty = ""; @@ -7125,872 +5891,1010 @@ ftd.font_display = fastn.mutable("sans-serif"); ftd.font_copy = fastn.mutable("sans-serif"); ftd.font_code = fastn.mutable("sans-serif"); ftd.default_types = function () { - let record = fastn.recordInstance({}); - record.set("heading_large", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(50)); - record.set("line_height", fastn_dom.FontSize.Px(65)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(36)); - record.set("line_height", fastn_dom.FontSize.Px(54)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + let record = fastn.recordInstance({ + }); + record.set("heading_large", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(50)); + record.set("line_height", fastn_dom.FontSize.Px(65)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(36)); + record.set("line_height", fastn_dom.FontSize.Px(54)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + return record; + }()); + record.set("heading_medium", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(38)); + record.set("line_height", fastn_dom.FontSize.Px(57)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(26)); + record.set("line_height", fastn_dom.FontSize.Px(40)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + return record; + }()); + record.set("heading_small", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(24)); + record.set("line_height", fastn_dom.FontSize.Px(31)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(22)); + record.set("line_height", fastn_dom.FontSize.Px(29)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + return record; + }()); + record.set("heading_hero", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(80)); + record.set("line_height", fastn_dom.FontSize.Px(104)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(48)); + record.set("line_height", fastn_dom.FontSize.Px(64)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + return record; + }()); + record.set("heading_tiny", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(20)); + record.set("line_height", fastn_dom.FontSize.Px(26)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(18)); + record.set("line_height", fastn_dom.FontSize.Px(24)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + return record; + }()); + record.set("copy_small", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(14)); + record.set("line_height", fastn_dom.FontSize.Px(24)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_copy); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(12)); + record.set("line_height", fastn_dom.FontSize.Px(16)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_copy); + return record; + }()); + return record; + }()); + record.set("copy_regular", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(18)); + record.set("line_height", fastn_dom.FontSize.Px(30)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_copy); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(16)); + record.set("line_height", fastn_dom.FontSize.Px(24)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_copy); + return record; + }()); + return record; + }()); + record.set("copy_large", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(22)); + record.set("line_height", fastn_dom.FontSize.Px(34)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_copy); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(18)); + record.set("line_height", fastn_dom.FontSize.Px(28)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_copy); + return record; + }()); + return record; + }()); + record.set("fine_print", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(12)); + record.set("line_height", fastn_dom.FontSize.Px(16)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_code); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(12)); + record.set("line_height", fastn_dom.FontSize.Px(16)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_code); + return record; }()); - record.set("heading_medium", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(38)); - record.set("line_height", fastn_dom.FontSize.Px(57)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(26)); - record.set("line_height", fastn_dom.FontSize.Px(40)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + return record; + }()); + record.set("blockquote", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(16)); + record.set("line_height", fastn_dom.FontSize.Px(21)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_code); + return record; }()); - record.set("heading_small", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(24)); - record.set("line_height", fastn_dom.FontSize.Px(31)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(22)); - record.set("line_height", fastn_dom.FontSize.Px(29)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(16)); + record.set("line_height", fastn_dom.FontSize.Px(21)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_code); + return record; }()); - record.set("heading_hero", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(80)); - record.set("line_height", fastn_dom.FontSize.Px(104)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(48)); - record.set("line_height", fastn_dom.FontSize.Px(64)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + return record; + }()); + record.set("source_code", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(18)); + record.set("line_height", fastn_dom.FontSize.Px(30)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_code); + return record; }()); - record.set("heading_tiny", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(20)); - record.set("line_height", fastn_dom.FontSize.Px(26)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(18)); - record.set("line_height", fastn_dom.FontSize.Px(24)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(16)); + record.set("line_height", fastn_dom.FontSize.Px(21)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_code); + return record; }()); - record.set("copy_small", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(14)); - record.set("line_height", fastn_dom.FontSize.Px(24)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_copy); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(12)); - record.set("line_height", fastn_dom.FontSize.Px(16)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_copy); - return record; - }()); - return record; + return record; + }()); + record.set("button_small", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(14)); + record.set("line_height", fastn_dom.FontSize.Px(19)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("copy_regular", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(18)); - record.set("line_height", fastn_dom.FontSize.Px(30)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_copy); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(16)); - record.set("line_height", fastn_dom.FontSize.Px(24)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_copy); - return record; - }()); - return record; + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(14)); + record.set("line_height", fastn_dom.FontSize.Px(19)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("copy_large", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(22)); - record.set("line_height", fastn_dom.FontSize.Px(34)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_copy); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(18)); - record.set("line_height", fastn_dom.FontSize.Px(28)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_copy); - return record; - }()); - return record; + return record; + }()); + record.set("button_medium", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(16)); + record.set("line_height", fastn_dom.FontSize.Px(21)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("fine_print", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(12)); - record.set("line_height", fastn_dom.FontSize.Px(16)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_code); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(12)); - record.set("line_height", fastn_dom.FontSize.Px(16)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_code); - return record; - }()); - return record; + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(16)); + record.set("line_height", fastn_dom.FontSize.Px(21)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("blockquote", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(16)); - record.set("line_height", fastn_dom.FontSize.Px(21)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_code); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(16)); - record.set("line_height", fastn_dom.FontSize.Px(21)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_code); - return record; - }()); - return record; + return record; + }()); + record.set("button_large", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(18)); + record.set("line_height", fastn_dom.FontSize.Px(24)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("source_code", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(18)); - record.set("line_height", fastn_dom.FontSize.Px(30)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_code); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(16)); - record.set("line_height", fastn_dom.FontSize.Px(21)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_code); - return record; - }()); - return record; + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(18)); + record.set("line_height", fastn_dom.FontSize.Px(24)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("button_small", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(14)); - record.set("line_height", fastn_dom.FontSize.Px(19)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(14)); - record.set("line_height", fastn_dom.FontSize.Px(19)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + return record; + }()); + record.set("link", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(14)); + record.set("line_height", fastn_dom.FontSize.Px(19)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("button_medium", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(16)); - record.set("line_height", fastn_dom.FontSize.Px(21)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(16)); - record.set("line_height", fastn_dom.FontSize.Px(21)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(14)); + record.set("line_height", fastn_dom.FontSize.Px(19)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("button_large", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(18)); - record.set("line_height", fastn_dom.FontSize.Px(24)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(18)); - record.set("line_height", fastn_dom.FontSize.Px(24)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + return record; + }()); + record.set("label_large", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(14)); + record.set("line_height", fastn_dom.FontSize.Px(19)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("link", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(14)); - record.set("line_height", fastn_dom.FontSize.Px(19)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(14)); - record.set("line_height", fastn_dom.FontSize.Px(19)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(14)); + record.set("line_height", fastn_dom.FontSize.Px(19)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("label_large", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(14)); - record.set("line_height", fastn_dom.FontSize.Px(19)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(14)); - record.set("line_height", fastn_dom.FontSize.Px(19)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + return record; + }()); + record.set("label_small", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(12)); + record.set("line_height", fastn_dom.FontSize.Px(16)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("label_small", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(12)); - record.set("line_height", fastn_dom.FontSize.Px(16)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(12)); - record.set("line_height", fastn_dom.FontSize.Px(16)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(12)); + record.set("line_height", fastn_dom.FontSize.Px(16)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); return record; + }()); + return record; }(); ftd.default_colors = function () { - let record = fastn.recordInstance({}); - record.set("background", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#e7e7e4"); - record.set("dark", "#18181b"); - return record; - }()); - record.set("step_1", function () { - let record = fastn.recordInstance({}); - record.set("light", "#f3f3f3"); - record.set("dark", "#141414"); - return record; - }()); - record.set("step_2", function () { - let record = fastn.recordInstance({}); - record.set("light", "#c9cece"); - record.set("dark", "#585656"); - return record; - }()); - record.set("overlay", function () { - let record = fastn.recordInstance({}); - record.set("light", "rgba(0, 0, 0, 0.8)"); - record.set("dark", "rgba(0, 0, 0, 0.8)"); - return record; - }()); - record.set("code", function () { - let record = fastn.recordInstance({}); - record.set("light", "#F5F5F5"); - record.set("dark", "#21222C"); - return record; - }()); - return record; + let record = fastn.recordInstance({ + }); + record.set("background", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#e7e7e4"); + record.set("dark", "#18181b"); + return record; + }()); + record.set("step_1", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#f3f3f3"); + record.set("dark", "#141414"); + return record; + }()); + record.set("step_2", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#c9cece"); + record.set("dark", "#585656"); + return record; + }()); + record.set("overlay", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "rgba(0, 0, 0, 0.8)"); + record.set("dark", "rgba(0, 0, 0, 0.8)"); + return record; + }()); + record.set("code", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#F5F5F5"); + record.set("dark", "#21222C"); + return record; + }()); + return record; + }()); + record.set("border", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#434547"); + record.set("dark", "#434547"); + return record; + }()); + record.set("border_strong", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#919192"); + record.set("dark", "#919192"); + return record; + }()); + record.set("text", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#584b42"); + record.set("dark", "#a8a29e"); + return record; + }()); + record.set("text_strong", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#141414"); + record.set("dark", "#ffffff"); + return record; + }()); + record.set("shadow", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#007f9b"); + record.set("dark", "#007f9b"); + return record; + }()); + record.set("scrim", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#007f9b"); + record.set("dark", "#007f9b"); + return record; + }()); + record.set("cta_primary", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#2dd4bf"); + record.set("dark", "#2dd4bf"); + return record; + }()); + record.set("hover", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#2c9f90"); + record.set("dark", "#2c9f90"); + return record; + }()); + record.set("pressed", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#2cc9b5"); + record.set("dark", "#2cc9b5"); + return record; + }()); + record.set("disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "rgba(44, 201, 181, 0.1)"); + record.set("dark", "rgba(44, 201, 181, 0.1)"); + return record; + }()); + record.set("focused", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#2cbfac"); + record.set("dark", "#2cbfac"); + return record; + }()); + record.set("border", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#2b8074"); + record.set("dark", "#2b8074"); + return record; + }()); + record.set("border_disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#65b693"); + record.set("dark", "#65b693"); + return record; + }()); + record.set("text", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#feffff"); + record.set("dark", "#feffff"); + return record; + }()); + record.set("text_disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#65b693"); + record.set("dark", "#65b693"); + return record; + }()); + return record; + }()); + record.set("cta_secondary", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#4fb2df"); + record.set("dark", "#4fb2df"); + return record; + }()); + record.set("hover", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#40afe1"); + record.set("dark", "#40afe1"); + return record; + }()); + record.set("pressed", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#4fb2df"); + record.set("dark", "#4fb2df"); + return record; + }()); + record.set("disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "rgba(79, 178, 223, 0.1)"); + record.set("dark", "rgba(79, 178, 223, 0.1)"); + return record; + }()); + record.set("focused", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#4fb1df"); + record.set("dark", "#4fb1df"); + return record; + }()); + record.set("border", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#209fdb"); + record.set("dark", "#209fdb"); + return record; + }()); + record.set("border_disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#65b693"); + record.set("dark", "#65b693"); + return record; + }()); + record.set("text", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#584b42"); + record.set("dark", "#ffffff"); + return record; + }()); + record.set("text_disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#65b693"); + record.set("dark", "#65b693"); + return record; + }()); + return record; + }()); + record.set("cta_tertiary", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#556375"); + record.set("dark", "#556375"); + return record; + }()); + record.set("hover", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#c7cbd1"); + record.set("dark", "#c7cbd1"); + return record; + }()); + record.set("pressed", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#3b4047"); + record.set("dark", "#3b4047"); + return record; + }()); + record.set("disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "rgba(85, 99, 117, 0.1)"); + record.set("dark", "rgba(85, 99, 117, 0.1)"); + return record; + }()); + record.set("focused", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#e0e2e6"); + record.set("dark", "#e0e2e6"); + return record; + }()); + record.set("border", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#e2e4e7"); + record.set("dark", "#e2e4e7"); + return record; + }()); + record.set("border_disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#65b693"); + record.set("dark", "#65b693"); + return record; + }()); + record.set("text", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#ffffff"); + record.set("dark", "#ffffff"); + return record; + }()); + record.set("text_disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#65b693"); + record.set("dark", "#65b693"); + return record; + }()); + return record; + }()); + record.set("cta_danger", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#1C1B1F"); + record.set("dark", "#1C1B1F"); + return record; + }()); + record.set("hover", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#1C1B1F"); + record.set("dark", "#1C1B1F"); + return record; + }()); + record.set("pressed", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#1C1B1F"); + record.set("dark", "#1C1B1F"); + return record; + }()); + record.set("disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#1C1B1F"); + record.set("dark", "#1C1B1F"); + return record; + }()); + record.set("focused", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#1C1B1F"); + record.set("dark", "#1C1B1F"); + return record; + }()); + record.set("border", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#1C1B1F"); + record.set("dark", "#1C1B1F"); + return record; + }()); + record.set("border_disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#feffff"); + record.set("dark", "#feffff"); + return record; + }()); + record.set("text", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#1C1B1F"); + record.set("dark", "#1C1B1F"); + return record; + }()); + record.set("text_disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#feffff"); + record.set("dark", "#feffff"); + return record; + }()); + return record; + }()); + record.set("accent", function () { + let record = fastn.recordInstance({ + }); + record.set("primary", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#2dd4bf"); + record.set("dark", "#2dd4bf"); + return record; + }()); + record.set("secondary", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#4fb2df"); + record.set("dark", "#4fb2df"); + return record; + }()); + record.set("tertiary", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#c5cbd7"); + record.set("dark", "#c5cbd7"); + return record; + }()); + return record; + }()); + record.set("error", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#f5bdbb"); + record.set("dark", "#311b1f"); + return record; + }()); + record.set("text", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#c62a21"); + record.set("dark", "#c62a21"); + return record; + }()); + record.set("border", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#df2b2b"); + record.set("dark", "#df2b2b"); + return record; + }()); + return record; + }()); + record.set("success", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#e3f0c4"); + record.set("dark", "#405508ad"); + return record; + }()); + record.set("text", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#467b28"); + record.set("dark", "#479f16"); + return record; }()); record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#434547"); - record.set("dark", "#434547"); - return record; + let record = fastn.recordInstance({ + }); + record.set("light", "#3d741f"); + record.set("dark", "#3d741f"); + return record; }()); - record.set("border_strong", function () { - let record = fastn.recordInstance({}); - record.set("light", "#919192"); - record.set("dark", "#919192"); - return record; + return record; + }()); + record.set("info", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#c4edfd"); + record.set("dark", "#15223a"); + return record; }()); record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#584b42"); - record.set("dark", "#a8a29e"); - return record; + let record = fastn.recordInstance({ + }); + record.set("light", "#205694"); + record.set("dark", "#1f6feb"); + return record; + }()); + record.set("border", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#205694"); + record.set("dark", "#205694"); + return record; }()); - record.set("text_strong", function () { - let record = fastn.recordInstance({}); - record.set("light", "#141414"); - record.set("dark", "#ffffff"); - return record; + return record; + }()); + record.set("warning", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#fbefba"); + record.set("dark", "#544607a3"); + return record; }()); - record.set("shadow", function () { - let record = fastn.recordInstance({}); - record.set("light", "#007f9b"); - record.set("dark", "#007f9b"); - return record; + record.set("text", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#966220"); + record.set("dark", "#d07f19"); + return record; }()); - record.set("scrim", function () { - let record = fastn.recordInstance({}); - record.set("light", "#007f9b"); - record.set("dark", "#007f9b"); - return record; + record.set("border", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#966220"); + record.set("dark", "#966220"); + return record; }()); - record.set("cta_primary", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#2dd4bf"); - record.set("dark", "#2dd4bf"); - return record; - }()); - record.set("hover", function () { - let record = fastn.recordInstance({}); - record.set("light", "#2c9f90"); - record.set("dark", "#2c9f90"); - return record; - }()); - record.set("pressed", function () { - let record = fastn.recordInstance({}); - record.set("light", "#2cc9b5"); - record.set("dark", "#2cc9b5"); - return record; - }()); - record.set("disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "rgba(44, 201, 181, 0.1)"); - record.set("dark", "rgba(44, 201, 181, 0.1)"); - return record; - }()); - record.set("focused", function () { - let record = fastn.recordInstance({}); - record.set("light", "#2cbfac"); - record.set("dark", "#2cbfac"); - return record; - }()); - record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#2b8074"); - record.set("dark", "#2b8074"); - return record; - }()); - record.set("border_disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#65b693"); - record.set("dark", "#65b693"); - return record; - }()); - record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#feffff"); - record.set("dark", "#feffff"); - return record; - }()); - record.set("text_disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#65b693"); - record.set("dark", "#65b693"); - return record; - }()); - return record; + return record; + }()); + record.set("custom", function () { + let record = fastn.recordInstance({ + }); + record.set("one", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#ed753a"); + record.set("dark", "#ed753a"); + return record; }()); - record.set("cta_secondary", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#4fb2df"); - record.set("dark", "#4fb2df"); - return record; - }()); - record.set("hover", function () { - let record = fastn.recordInstance({}); - record.set("light", "#40afe1"); - record.set("dark", "#40afe1"); - return record; - }()); - record.set("pressed", function () { - let record = fastn.recordInstance({}); - record.set("light", "#4fb2df"); - record.set("dark", "#4fb2df"); - return record; - }()); - record.set("disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "rgba(79, 178, 223, 0.1)"); - record.set("dark", "rgba(79, 178, 223, 0.1)"); - return record; - }()); - record.set("focused", function () { - let record = fastn.recordInstance({}); - record.set("light", "#4fb1df"); - record.set("dark", "#4fb1df"); - return record; - }()); - record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#209fdb"); - record.set("dark", "#209fdb"); - return record; - }()); - record.set("border_disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#65b693"); - record.set("dark", "#65b693"); - return record; - }()); - record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#584b42"); - record.set("dark", "#ffffff"); - return record; - }()); - record.set("text_disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#65b693"); - record.set("dark", "#65b693"); - return record; - }()); - return record; + record.set("two", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#f3db5f"); + record.set("dark", "#f3db5f"); + return record; }()); - record.set("cta_tertiary", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#556375"); - record.set("dark", "#556375"); - return record; - }()); - record.set("hover", function () { - let record = fastn.recordInstance({}); - record.set("light", "#c7cbd1"); - record.set("dark", "#c7cbd1"); - return record; - }()); - record.set("pressed", function () { - let record = fastn.recordInstance({}); - record.set("light", "#3b4047"); - record.set("dark", "#3b4047"); - return record; - }()); - record.set("disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "rgba(85, 99, 117, 0.1)"); - record.set("dark", "rgba(85, 99, 117, 0.1)"); - return record; - }()); - record.set("focused", function () { - let record = fastn.recordInstance({}); - record.set("light", "#e0e2e6"); - record.set("dark", "#e0e2e6"); - return record; - }()); - record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#e2e4e7"); - record.set("dark", "#e2e4e7"); - return record; - }()); - record.set("border_disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#65b693"); - record.set("dark", "#65b693"); - return record; - }()); - record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#ffffff"); - record.set("dark", "#ffffff"); - return record; - }()); - record.set("text_disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#65b693"); - record.set("dark", "#65b693"); - return record; - }()); - return record; + record.set("three", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#8fdcf8"); + record.set("dark", "#8fdcf8"); + return record; }()); - record.set("cta_danger", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#1C1B1F"); - record.set("dark", "#1C1B1F"); - return record; - }()); - record.set("hover", function () { - let record = fastn.recordInstance({}); - record.set("light", "#1C1B1F"); - record.set("dark", "#1C1B1F"); - return record; - }()); - record.set("pressed", function () { - let record = fastn.recordInstance({}); - record.set("light", "#1C1B1F"); - record.set("dark", "#1C1B1F"); - return record; - }()); - record.set("disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#1C1B1F"); - record.set("dark", "#1C1B1F"); - return record; - }()); - record.set("focused", function () { - let record = fastn.recordInstance({}); - record.set("light", "#1C1B1F"); - record.set("dark", "#1C1B1F"); - return record; - }()); - record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#1C1B1F"); - record.set("dark", "#1C1B1F"); - return record; - }()); - record.set("border_disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#feffff"); - record.set("dark", "#feffff"); - return record; - }()); - record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#1C1B1F"); - record.set("dark", "#1C1B1F"); - return record; - }()); - record.set("text_disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#feffff"); - record.set("dark", "#feffff"); - return record; - }()); - return record; + record.set("four", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#7a65c7"); + record.set("dark", "#7a65c7"); + return record; }()); - record.set("accent", function () { - let record = fastn.recordInstance({}); - record.set("primary", function () { - let record = fastn.recordInstance({}); - record.set("light", "#2dd4bf"); - record.set("dark", "#2dd4bf"); - return record; - }()); - record.set("secondary", function () { - let record = fastn.recordInstance({}); - record.set("light", "#4fb2df"); - record.set("dark", "#4fb2df"); - return record; - }()); - record.set("tertiary", function () { - let record = fastn.recordInstance({}); - record.set("light", "#c5cbd7"); - record.set("dark", "#c5cbd7"); - return record; - }()); - return record; + record.set("five", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#eb57be"); + record.set("dark", "#eb57be"); + return record; }()); - record.set("error", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#f5bdbb"); - record.set("dark", "#311b1f"); - return record; - }()); - record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#c62a21"); - record.set("dark", "#c62a21"); - return record; - }()); - record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#df2b2b"); - record.set("dark", "#df2b2b"); - return record; - }()); - return record; + record.set("six", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#ef8dd6"); + record.set("dark", "#ef8dd6"); + return record; }()); - record.set("success", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#e3f0c4"); - record.set("dark", "#405508ad"); - return record; - }()); - record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#467b28"); - record.set("dark", "#479f16"); - return record; - }()); - record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#3d741f"); - record.set("dark", "#3d741f"); - return record; - }()); - return record; + record.set("seven", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#7564be"); + record.set("dark", "#7564be"); + return record; }()); - record.set("info", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#c4edfd"); - record.set("dark", "#15223a"); - return record; - }()); - record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#205694"); - record.set("dark", "#1f6feb"); - return record; - }()); - record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#205694"); - record.set("dark", "#205694"); - return record; - }()); - return record; + record.set("eight", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#d554b3"); + record.set("dark", "#d554b3"); + return record; }()); - record.set("warning", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#fbefba"); - record.set("dark", "#544607a3"); - return record; - }()); - record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#966220"); - record.set("dark", "#d07f19"); - return record; - }()); - record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#966220"); - record.set("dark", "#966220"); - return record; - }()); - return record; + record.set("nine", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#ec8943"); + record.set("dark", "#ec8943"); + return record; }()); - record.set("custom", function () { - let record = fastn.recordInstance({}); - record.set("one", function () { - let record = fastn.recordInstance({}); - record.set("light", "#ed753a"); - record.set("dark", "#ed753a"); - return record; - }()); - record.set("two", function () { - let record = fastn.recordInstance({}); - record.set("light", "#f3db5f"); - record.set("dark", "#f3db5f"); - return record; - }()); - record.set("three", function () { - let record = fastn.recordInstance({}); - record.set("light", "#8fdcf8"); - record.set("dark", "#8fdcf8"); - return record; - }()); - record.set("four", function () { - let record = fastn.recordInstance({}); - record.set("light", "#7a65c7"); - record.set("dark", "#7a65c7"); - return record; - }()); - record.set("five", function () { - let record = fastn.recordInstance({}); - record.set("light", "#eb57be"); - record.set("dark", "#eb57be"); - return record; - }()); - record.set("six", function () { - let record = fastn.recordInstance({}); - record.set("light", "#ef8dd6"); - record.set("dark", "#ef8dd6"); - return record; - }()); - record.set("seven", function () { - let record = fastn.recordInstance({}); - record.set("light", "#7564be"); - record.set("dark", "#7564be"); - return record; - }()); - record.set("eight", function () { - let record = fastn.recordInstance({}); - record.set("light", "#d554b3"); - record.set("dark", "#d554b3"); - return record; - }()); - record.set("nine", function () { - let record = fastn.recordInstance({}); - record.set("light", "#ec8943"); - record.set("dark", "#ec8943"); - return record; - }()); - record.set("ten", function () { - let record = fastn.recordInstance({}); - record.set("light", "#da7a4a"); - record.set("dark", "#da7a4a"); - return record; - }()); - return record; + record.set("ten", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#da7a4a"); + record.set("dark", "#da7a4a"); + return record; }()); return record; + }()); + return record; }(); ftd.breakpoint_width = function () { - let record = fastn.recordInstance({}); - record.set("mobile", 768); - return record; + let record = fastn.recordInstance({ + }); + record.set("mobile", 768); + return record; }(); ftd.device = fastn.mutable(fastn_dom.DeviceData.Mobile); let inherited = function () { - let record = fastn.recordInstance({}); - record.set("colors", ftd.default_colors.getClone().setAndReturn("is_root", true)); - record.set("types", ftd.default_types.getClone().setAndReturn("is_root", true)); - return record; + let record = fastn.recordInstance({ + }); + record.set("colors", ftd.default_colors.getClone().setAndReturn("is_root", true)); + record.set("types", ftd.default_types.getClone().setAndReturn("is_root", true)); + return record; }(); diff --git a/fastn-core/fbt-tests/09-markdown-pages/output/default-38B6AD79997E8237A3353BC273DEB754A3D5AAE95DD3DC036A206192A32563EE.js b/fastn-core/fbt-tests/09-markdown-pages/output/default-38B6AD79997E8237A3353BC273DEB754A3D5AAE95DD3DC036A206192A32563EE.js index 094d43817e..c9a6811592 100644 --- a/fastn-core/fbt-tests/09-markdown-pages/output/default-38B6AD79997E8237A3353BC273DEB754A3D5AAE95DD3DC036A206192A32563EE.js +++ b/fastn-core/fbt-tests/09-markdown-pages/output/default-38B6AD79997E8237A3353BC273DEB754A3D5AAE95DD3DC036A206192A32563EE.js @@ -108,1167 +108,7 @@ Prism.languages.ftd = { * https://github.com/markedjs/marked */ // Content taken from https://cdn.jsdelivr.net/npm/marked/marked.min.js -!function (e, t) { - "object" == typeof exports && "undefined" != typeof module ? t(exports) : "function" == typeof define && define.amd ? define(["exports"], t) : t((e = "undefined" != typeof globalThis ? globalThis : e || self).marked = {}) -}(this, (function (e) { - "use strict"; - - function t() { - return { - async: !1, - breaks: !1, - extensions: null, - gfm: !0, - hooks: null, - pedantic: !1, - renderer: null, - silent: !1, - tokenizer: null, - walkTokens: null - } - } - - function n(t) { - e.defaults = t - } - - e.defaults = { - async: !1, - breaks: !1, - extensions: null, - gfm: !0, - hooks: null, - pedantic: !1, - renderer: null, - silent: !1, - tokenizer: null, - walkTokens: null - }; - const s = /[&<>"']/, r = new RegExp(s.source, "g"), i = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, - l = new RegExp(i.source, "g"), o = {"&": "&", "<": "<", ">": ">", '"': """, "'": "'"}, - a = e => o[e]; - - function c(e, t) { - if (t) { - if (s.test(e)) return e.replace(r, a) - } else if (i.test(e)) return e.replace(l, a); - return e - } - - const h = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi; - const p = /(^|[^\[])\^/g; - - function u(e, t) { - e = "string" == typeof e ? e : e.source, t = t || ""; - const n = { - replace: (t, s) => (s = (s = "object" == typeof s && "source" in s ? s.source : s).replace(p, "$1"), e = e.replace(t, s), n), - getRegex: () => new RegExp(e, t) - }; - return n - } - - function g(e) { - try { - e = encodeURI(e).replace(/%25/g, "%") - } catch (e) { - return null - } - return e - } - - const k = {exec: () => null}; - - function f(e, t) { - const n = e.replace(/\|/g, ((e, t, n) => { - let s = !1, r = t; - for (; --r >= 0 && "\\" === n[r];) s = !s; - return s ? "|" : " |" - })).split(/ \|/); - let s = 0; - if (n[0].trim() || n.shift(), n.length > 0 && !n[n.length - 1].trim() && n.pop(), t) if (n.length > t) n.splice(t); else for (; n.length < t;) n.push(""); - for (; s < n.length; s++) n[s] = n[s].trim().replace(/\\\|/g, "|"); - return n - } - - function d(e, t, n) { - const s = e.length; - if (0 === s) return ""; - let r = 0; - for (; r < s;) { - const i = e.charAt(s - r - 1); - if (i !== t || n) { - if (i === t || !n) break; - r++ - } else r++ - } - return e.slice(0, s - r) - } - - function x(e, t, n, s) { - const r = t.href, i = t.title ? c(t.title) : null, l = e[1].replace(/\\([\[\]])/g, "$1"); - if ("!" !== e[0].charAt(0)) { - s.state.inLink = !0; - const e = {type: "link", raw: n, href: r, title: i, text: l, tokens: s.inlineTokens(l)}; - return s.state.inLink = !1, e - } - return {type: "image", raw: n, href: r, title: i, text: c(l)} - } - - class b { - options; - rules; - lexer; - - constructor(t) { - this.options = t || e.defaults - } - - space(e) { - const t = this.rules.block.newline.exec(e); - if (t && t[0].length > 0) return {type: "space", raw: t[0]} - } - - code(e) { - const t = this.rules.block.code.exec(e); - if (t) { - const e = t[0].replace(/^ {1,4}/gm, ""); - return { - type: "code", - raw: t[0], - codeBlockStyle: "indented", - text: this.options.pedantic ? e : d(e, "\n") - } - } - } - - fences(e) { - const t = this.rules.block.fences.exec(e); - if (t) { - const e = t[0], n = function (e, t) { - const n = e.match(/^(\s+)(?:```)/); - if (null === n) return t; - const s = n[1]; - return t.split("\n").map((e => { - const t = e.match(/^\s+/); - if (null === t) return e; - const [n] = t; - return n.length >= s.length ? e.slice(s.length) : e - })).join("\n") - }(e, t[3] || ""); - return { - type: "code", - raw: e, - lang: t[2] ? t[2].trim().replace(this.rules.inline._escapes, "$1") : t[2], - text: n - } - } - } - - heading(e) { - const t = this.rules.block.heading.exec(e); - if (t) { - let e = t[2].trim(); - if (/#$/.test(e)) { - const t = d(e, "#"); - this.options.pedantic ? e = t.trim() : t && !/ $/.test(t) || (e = t.trim()) - } - return {type: "heading", raw: t[0], depth: t[1].length, text: e, tokens: this.lexer.inline(e)} - } - } - - hr(e) { - const t = this.rules.block.hr.exec(e); - if (t) return {type: "hr", raw: t[0]} - } - - blockquote(e) { - const t = this.rules.block.blockquote.exec(e); - if (t) { - const e = d(t[0].replace(/^ *>[ \t]?/gm, ""), "\n"), n = this.lexer.state.top; - this.lexer.state.top = !0; - const s = this.lexer.blockTokens(e); - return this.lexer.state.top = n, {type: "blockquote", raw: t[0], tokens: s, text: e} - } - } - - list(e) { - let t = this.rules.block.list.exec(e); - if (t) { - let n = t[1].trim(); - const s = n.length > 1, - r = {type: "list", raw: "", ordered: s, start: s ? +n.slice(0, -1) : "", loose: !1, items: []}; - n = s ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = s ? n : "[*+-]"); - const i = new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`); - let l = "", o = "", a = !1; - for (; e;) { - let n = !1; - if (!(t = i.exec(e))) break; - if (this.rules.block.hr.test(e)) break; - l = t[0], e = e.substring(l.length); - let s = t[2].split("\n", 1)[0].replace(/^\t+/, (e => " ".repeat(3 * e.length))), - c = e.split("\n", 1)[0], h = 0; - this.options.pedantic ? (h = 2, o = s.trimStart()) : (h = t[2].search(/[^ ]/), h = h > 4 ? 1 : h, o = s.slice(h), h += t[1].length); - let p = !1; - if (!s && /^ *$/.test(c) && (l += c + "\n", e = e.substring(c.length + 1), n = !0), !n) { - const t = new RegExp(`^ {0,${Math.min(3,h-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`), - n = new RegExp(`^ {0,${Math.min(3,h-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), - r = new RegExp(`^ {0,${Math.min(3,h-1)}}(?:\`\`\`|~~~)`), - i = new RegExp(`^ {0,${Math.min(3,h-1)}}#`); - for (; e;) { - const a = e.split("\n", 1)[0]; - if (c = a, this.options.pedantic && (c = c.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ")), r.test(c)) break; - if (i.test(c)) break; - if (t.test(c)) break; - if (n.test(e)) break; - if (c.search(/[^ ]/) >= h || !c.trim()) o += "\n" + c.slice(h); else { - if (p) break; - if (s.search(/[^ ]/) >= 4) break; - if (r.test(s)) break; - if (i.test(s)) break; - if (n.test(s)) break; - o += "\n" + c - } - p || c.trim() || (p = !0), l += a + "\n", e = e.substring(a.length + 1), s = c.slice(h) - } - } - r.loose || (a ? r.loose = !0 : /\n *\n *$/.test(l) && (a = !0)); - let u, g = null; - this.options.gfm && (g = /^\[[ xX]\] /.exec(o), g && (u = "[ ] " !== g[0], o = o.replace(/^\[[ xX]\] +/, ""))), r.items.push({ - type: "list_item", - raw: l, - task: !!g, - checked: u, - loose: !1, - text: o, - tokens: [] - }), r.raw += l - } - r.items[r.items.length - 1].raw = l.trimEnd(), r.items[r.items.length - 1].text = o.trimEnd(), r.raw = r.raw.trimEnd(); - for (let e = 0; e < r.items.length; e++) if (this.lexer.state.top = !1, r.items[e].tokens = this.lexer.blockTokens(r.items[e].text, []), !r.loose) { - const t = r.items[e].tokens.filter((e => "space" === e.type)), - n = t.length > 0 && t.some((e => /\n.*\n/.test(e.raw))); - r.loose = n - } - if (r.loose) for (let e = 0; e < r.items.length; e++) r.items[e].loose = !0; - return r - } - } - - html(e) { - const t = this.rules.block.html.exec(e); - if (t) { - return { - type: "html", - block: !0, - raw: t[0], - pre: "pre" === t[1] || "script" === t[1] || "style" === t[1], - text: t[0] - } - } - } - - def(e) { - const t = this.rules.block.def.exec(e); - if (t) { - const e = t[1].toLowerCase().replace(/\s+/g, " "), - n = t[2] ? t[2].replace(/^<(.*)>$/, "$1").replace(this.rules.inline._escapes, "$1") : "", - s = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline._escapes, "$1") : t[3]; - return {type: "def", tag: e, raw: t[0], href: n, title: s} - } - } - - table(e) { - const t = this.rules.block.table.exec(e); - if (t) { - if (!/[:|]/.test(t[2])) return; - const e = { - type: "table", - raw: t[0], - header: f(t[1]).map((e => ({text: e, tokens: []}))), - align: t[2].replace(/^\||\| *$/g, "").split("|"), - rows: t[3] && t[3].trim() ? t[3].replace(/\n[ \t]*$/, "").split("\n") : [] - }; - if (e.header.length === e.align.length) { - let t, n, s, r, i = e.align.length; - for (t = 0; t < i; t++) { - const n = e.align[t]; - n && (/^ *-+: *$/.test(n) ? e.align[t] = "right" : /^ *:-+: *$/.test(n) ? e.align[t] = "center" : /^ *:-+ *$/.test(n) ? e.align[t] = "left" : e.align[t] = null) - } - for (i = e.rows.length, t = 0; t < i; t++) e.rows[t] = f(e.rows[t], e.header.length).map((e => ({ - text: e, - tokens: [] - }))); - for (i = e.header.length, n = 0; n < i; n++) e.header[n].tokens = this.lexer.inline(e.header[n].text); - for (i = e.rows.length, n = 0; n < i; n++) for (r = e.rows[n], s = 0; s < r.length; s++) r[s].tokens = this.lexer.inline(r[s].text); - return e - } - } - } - - lheading(e) { - const t = this.rules.block.lheading.exec(e); - if (t) return { - type: "heading", - raw: t[0], - depth: "=" === t[2].charAt(0) ? 1 : 2, - text: t[1], - tokens: this.lexer.inline(t[1]) - } - } - - paragraph(e) { - const t = this.rules.block.paragraph.exec(e); - if (t) { - const e = "\n" === t[1].charAt(t[1].length - 1) ? t[1].slice(0, -1) : t[1]; - return {type: "paragraph", raw: t[0], text: e, tokens: this.lexer.inline(e)} - } - } - - text(e) { - const t = this.rules.block.text.exec(e); - if (t) return {type: "text", raw: t[0], text: t[0], tokens: this.lexer.inline(t[0])} - } - - escape(e) { - const t = this.rules.inline.escape.exec(e); - if (t) return {type: "escape", raw: t[0], text: c(t[1])} - } - - tag(e) { - const t = this.rules.inline.tag.exec(e); - if (t) return !this.lexer.state.inLink && /^
    /i.test(t[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(t[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0]) && (this.lexer.state.inRawBlock = !1), { - type: "html", - raw: t[0], - inLink: this.lexer.state.inLink, - inRawBlock: this.lexer.state.inRawBlock, - block: !1, - text: t[0] - } - } - - link(e) { - const t = this.rules.inline.link.exec(e); - if (t) { - const e = t[2].trim(); - if (!this.options.pedantic && /^$/.test(e)) return; - const t = d(e.slice(0, -1), "\\"); - if ((e.length - t.length) % 2 == 0) return - } else { - const e = function (e, t) { - if (-1 === e.indexOf(t[1])) return -1; - let n = 0; - for (let s = 0; s < e.length; s++) if ("\\" === e[s]) s++; else if (e[s] === t[0]) n++; else if (e[s] === t[1] && (n--, n < 0)) return s; - return -1 - }(t[2], "()"); - if (e > -1) { - const n = (0 === t[0].indexOf("!") ? 5 : 4) + t[1].length + e; - t[2] = t[2].substring(0, e), t[0] = t[0].substring(0, n).trim(), t[3] = "" - } - } - let n = t[2], s = ""; - if (this.options.pedantic) { - const e = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n); - e && (n = e[1], s = e[3]) - } else s = t[3] ? t[3].slice(1, -1) : ""; - return n = n.trim(), /^$/.test(e) ? n.slice(1) : n.slice(1, -1)), x(t, { - href: n ? n.replace(this.rules.inline._escapes, "$1") : n, - title: s ? s.replace(this.rules.inline._escapes, "$1") : s - }, t[0], this.lexer) - } - } - - reflink(e, t) { - let n; - if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) { - let e = (n[2] || n[1]).replace(/\s+/g, " "); - if (e = t[e.toLowerCase()], !e) { - const e = n[0].charAt(0); - return {type: "text", raw: e, text: e} - } - return x(n, e, n[0], this.lexer) - } - } - - emStrong(e, t, n = "") { - let s = this.rules.inline.emStrong.lDelim.exec(e); - if (!s) return; - if (s[3] && n.match(/[\p{L}\p{N}]/u)) return; - if (!(s[1] || s[2] || "") || !n || this.rules.inline.punctuation.exec(n)) { - const n = [...s[0]].length - 1; - let r, i, l = n, o = 0; - const a = "*" === s[0][0] ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd; - for (a.lastIndex = 0, t = t.slice(-1 * e.length + s[0].length - 1); null != (s = a.exec(t));) { - if (r = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !r) continue; - if (i = [...r].length, s[3] || s[4]) { - l += i; - continue - } - if ((s[5] || s[6]) && n % 3 && !((n + i) % 3)) { - o += i; - continue - } - if (l -= i, l > 0) continue; - i = Math.min(i, i + l + o); - const t = [...e].slice(0, n + s.index + i + 1).join(""); - if (Math.min(n, i) % 2) { - const e = t.slice(1, -1); - return {type: "em", raw: t, text: e, tokens: this.lexer.inlineTokens(e)} - } - const a = t.slice(2, -2); - return {type: "strong", raw: t, text: a, tokens: this.lexer.inlineTokens(a)} - } - } - } - - codespan(e) { - const t = this.rules.inline.code.exec(e); - if (t) { - let e = t[2].replace(/\n/g, " "); - const n = /[^ ]/.test(e), s = /^ /.test(e) && / $/.test(e); - return n && s && (e = e.substring(1, e.length - 1)), e = c(e, !0), { - type: "codespan", - raw: t[0], - text: e - } - } - } - - br(e) { - const t = this.rules.inline.br.exec(e); - if (t) return {type: "br", raw: t[0]} - } - - del(e) { - const t = this.rules.inline.del.exec(e); - if (t) return {type: "del", raw: t[0], text: t[2], tokens: this.lexer.inlineTokens(t[2])} - } - - autolink(e) { - const t = this.rules.inline.autolink.exec(e); - if (t) { - let e, n; - return "@" === t[2] ? (e = c(t[1]), n = "mailto:" + e) : (e = c(t[1]), n = e), { - type: "link", - raw: t[0], - text: e, - href: n, - tokens: [{type: "text", raw: e, text: e}] - } - } - } - - url(e) { - let t; - if (t = this.rules.inline.url.exec(e)) { - let e, n; - if ("@" === t[2]) e = c(t[0]), n = "mailto:" + e; else { - let s; - do { - s = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])[0] - } while (s !== t[0]); - e = c(t[0]), n = "www." === t[1] ? "http://" + t[0] : t[0] - } - return {type: "link", raw: t[0], text: e, href: n, tokens: [{type: "text", raw: e, text: e}]} - } - } - - inlineText(e) { - const t = this.rules.inline.text.exec(e); - if (t) { - let e; - return e = this.lexer.state.inRawBlock ? t[0] : c(t[0]), {type: "text", raw: t[0], text: e} - } - } - } - - const m = { - 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]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))", - def: /^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/, - table: k, - lheading: /^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, - _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, - text: /^[^\n]+/, - _label: /(?!\s*\])(?:\\.|[^\[\]\\])+/, - _title: /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/ - }; - m.def = u(m.def).replace("label", m._label).replace("title", m._title).getRegex(), m.bullet = /(?:[*+-]|\d{1,9}[.)])/, m.listItemStart = u(/^( *)(bull) */).replace("bull", m.bullet).getRegex(), m.list = u(m.list).replace(/bull/g, m.bullet).replace("hr", "\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def", "\\n+(?=" + m.def.source + ")").getRegex(), m._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", m._comment = /|$)/, m.html = u(m.html, "i").replace("comment", m._comment).replace("tag", m._tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), m.lheading = u(m.lheading).replace(/bull/g, m.bullet).getRegex(), m.paragraph = u(m._paragraph).replace("hr", m.hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").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", ")|<(?:script|pre|style|textarea|!--)").replace("tag", m._tag).getRegex(), m.blockquote = u(m.blockquote).replace("paragraph", m.paragraph).getRegex(), m.normal = {...m}, m.gfm = { - ...m.normal, - table: "^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)" - }, m.gfm.table = u(m.gfm.table).replace("hr", m.hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").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", ")|<(?:script|pre|style|textarea|!--)").replace("tag", m._tag).getRegex(), m.gfm.paragraph = u(m._paragraph).replace("hr", m.hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", m.gfm.table).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", ")|<(?:script|pre|style|textarea|!--)").replace("tag", m._tag).getRegex(), m.pedantic = { - ...m.normal, - html: u("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", m._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: /^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, - heading: /^(#{1,6})(.*)(?:\n+|$)/, - fences: k, - lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, - paragraph: u(m.normal._paragraph).replace("hr", m.hr).replace("heading", " *#{1,6} *[^\n]").replace("lheading", m.lheading).replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").getRegex() - }; - const w = { - escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, - autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/, - url: k, - tag: "^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^", - link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/, - reflink: /^!?\[(label)\]\[(ref)\]/, - nolink: /^!?\[(ref)\](?:\[\])?/, - reflinkSearch: "reflink|nolink(?!\\()", - emStrong: { - lDelim: /^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, - 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])/ - }, - code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, - br: /^( {2,}|\\)\n(?!\s*$)/, - del: k, - text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`^|~" - }; - w.punctuation = u(w.punctuation, "u").replace(/punctuation/g, w._punctuation).getRegex(), w.blockSkip = /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g, w.anyPunctuation = /\\[punct]/g, w._escapes = /\\([punct])/g, w._comment = u(m._comment).replace("(?:--\x3e|$)", "--\x3e").getRegex(), w.emStrong.lDelim = u(w.emStrong.lDelim, "u").replace(/punct/g, w._punctuation).getRegex(), w.emStrong.rDelimAst = u(w.emStrong.rDelimAst, "gu").replace(/punct/g, w._punctuation).getRegex(), w.emStrong.rDelimUnd = u(w.emStrong.rDelimUnd, "gu").replace(/punct/g, w._punctuation).getRegex(), w.anyPunctuation = u(w.anyPunctuation, "gu").replace(/punct/g, w._punctuation).getRegex(), w._escapes = u(w._escapes, "gu").replace(/punct/g, w._punctuation).getRegex(), w._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/, w._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])?)+(?![-_])/, w.autolink = u(w.autolink).replace("scheme", w._scheme).replace("email", w._email).getRegex(), w._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/, w.tag = u(w.tag).replace("comment", w._comment).replace("attribute", w._attribute).getRegex(), w._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, w._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/, w._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/, w.link = u(w.link).replace("label", w._label).replace("href", w._href).replace("title", w._title).getRegex(), w.reflink = u(w.reflink).replace("label", w._label).replace("ref", m._label).getRegex(), w.nolink = u(w.nolink).replace("ref", m._label).getRegex(), w.reflinkSearch = u(w.reflinkSearch, "g").replace("reflink", w.reflink).replace("nolink", w.nolink).getRegex(), w.normal = {...w}, w.pedantic = { - ...w.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: u(/^!?\[(label)\]\((.*?)\)/).replace("label", w._label).getRegex(), - reflink: u(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", w._label).getRegex() - }, w.gfm = { - ...w.normal, - escape: u(w.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]*?(?:(?=[\\ t + " ".repeat(n.length))); e;) if (!(this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((s => !!(n = s.call({lexer: this}, e, t)) && (e = e.substring(n.raw.length), t.push(n), !0))))) if (n = this.tokenizer.space(e)) e = e.substring(n.raw.length), 1 === n.raw.length && t.length > 0 ? t[t.length - 1].raw += "\n" : t.push(n); else if (n = this.tokenizer.code(e)) e = e.substring(n.raw.length), s = t[t.length - 1], !s || "paragraph" !== s.type && "text" !== s.type ? t.push(n) : (s.raw += "\n" + n.raw, s.text += "\n" + n.text, this.inlineQueue[this.inlineQueue.length - 1].src = s.text); else if (n = this.tokenizer.fences(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.heading(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.hr(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.blockquote(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.list(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.html(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.def(e)) e = e.substring(n.raw.length), s = t[t.length - 1], !s || "paragraph" !== s.type && "text" !== s.type ? this.tokens.links[n.tag] || (this.tokens.links[n.tag] = { - href: n.href, - title: n.title - }) : (s.raw += "\n" + n.raw, s.text += "\n" + n.raw, this.inlineQueue[this.inlineQueue.length - 1].src = s.text); else if (n = this.tokenizer.table(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.lheading(e)) e = e.substring(n.raw.length), t.push(n); else { - if (r = e, this.options.extensions && this.options.extensions.startBlock) { - let t = 1 / 0; - const n = e.slice(1); - let s; - this.options.extensions.startBlock.forEach((e => { - s = e.call({lexer: this}, n), "number" == typeof s && s >= 0 && (t = Math.min(t, s)) - })), t < 1 / 0 && t >= 0 && (r = e.substring(0, t + 1)) - } - if (this.state.top && (n = this.tokenizer.paragraph(r))) s = t[t.length - 1], i && "paragraph" === s.type ? (s.raw += "\n" + n.raw, s.text += "\n" + n.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = s.text) : t.push(n), i = r.length !== e.length, e = e.substring(n.raw.length); else if (n = this.tokenizer.text(e)) e = e.substring(n.raw.length), s = t[t.length - 1], s && "text" === s.type ? (s.raw += "\n" + n.raw, s.text += "\n" + n.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = s.text) : t.push(n); else if (e) { - const t = "Infinite loop on byte: " + e.charCodeAt(0); - if (this.options.silent) { - console.error(t); - break - } - throw new Error(t) - } - } - return this.state.top = !0, t - } - - inline(e, t = []) { - return this.inlineQueue.push({src: e, tokens: t}), t - } - - inlineTokens(e, t = []) { - let n, s, r, i, l, o, a = e; - if (this.tokens.links) { - const e = Object.keys(this.tokens.links); - if (e.length > 0) for (; null != (i = this.tokenizer.rules.inline.reflinkSearch.exec(a));) e.includes(i[0].slice(i[0].lastIndexOf("[") + 1, -1)) && (a = a.slice(0, i.index) + "[" + "a".repeat(i[0].length - 2) + "]" + a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex)) - } - for (; null != (i = this.tokenizer.rules.inline.blockSkip.exec(a));) a = a.slice(0, i.index) + "[" + "a".repeat(i[0].length - 2) + "]" + a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex); - for (; null != (i = this.tokenizer.rules.inline.anyPunctuation.exec(a));) a = a.slice(0, i.index) + "++" + a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex); - for (; e;) if (l || (o = ""), l = !1, !(this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((s => !!(n = s.call({lexer: this}, e, t)) && (e = e.substring(n.raw.length), t.push(n), !0))))) if (n = this.tokenizer.escape(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.tag(e)) e = e.substring(n.raw.length), s = t[t.length - 1], s && "text" === n.type && "text" === s.type ? (s.raw += n.raw, s.text += n.text) : t.push(n); else if (n = this.tokenizer.link(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.reflink(e, this.tokens.links)) e = e.substring(n.raw.length), s = t[t.length - 1], s && "text" === n.type && "text" === s.type ? (s.raw += n.raw, s.text += n.text) : t.push(n); else if (n = this.tokenizer.emStrong(e, a, o)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.codespan(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.br(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.del(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.autolink(e)) e = e.substring(n.raw.length), t.push(n); else if (this.state.inLink || !(n = this.tokenizer.url(e))) { - if (r = e, this.options.extensions && this.options.extensions.startInline) { - let t = 1 / 0; - const n = e.slice(1); - let s; - this.options.extensions.startInline.forEach((e => { - s = e.call({lexer: this}, n), "number" == typeof s && s >= 0 && (t = Math.min(t, s)) - })), t < 1 / 0 && t >= 0 && (r = e.substring(0, t + 1)) - } - if (n = this.tokenizer.inlineText(r)) e = e.substring(n.raw.length), "_" !== n.raw.slice(-1) && (o = n.raw.slice(-1)), l = !0, s = t[t.length - 1], s && "text" === s.type ? (s.raw += n.raw, s.text += n.text) : t.push(n); else if (e) { - const t = "Infinite loop on byte: " + e.charCodeAt(0); - if (this.options.silent) { - console.error(t); - break - } - throw new Error(t) - } - } else e = e.substring(n.raw.length), t.push(n); - return t - } - } - - class y { - options; - - constructor(t) { - this.options = t || e.defaults - } - - code(e, t, n) { - const s = (t || "").match(/^\S*/)?.[0]; - return e = e.replace(/\n$/, "") + "\n", s ? '
    ' + (n ? e : c(e, !0)) + "
    \n" : "
    " + (n ? e : c(e, !0)) + "
    \n" - } - - blockquote(e) { - return `
    \n${e}
    \n` - } - - html(e, t) { - return e - } - - heading(e, t, n) { - return `${e}\n` - } - - hr() { - return "
    \n" - } - - list(e, t, n) { - const s = t ? "ol" : "ul"; - return "<" + s + (t && 1 !== n ? ' start="' + n + '"' : "") + ">\n" + e + "\n" - } - - listitem(e, t, n) { - return `
  • ${e}
  • \n` - } - - checkbox(e) { - return "' - } - - paragraph(e) { - return `

    ${e}

    \n` - } - - table(e, t) { - return t && (t = `${t}`), "\n\n" + e + "\n" + t + "
    \n" - } - - tablerow(e) { - return `\n${e}\n` - } - - tablecell(e, t) { - const n = t.header ? "th" : "td"; - return (t.align ? `<${n} align="${t.align}">` : `<${n}>`) + e + `\n` - } - - strong(e) { - return `${e}` - } - - em(e) { - return `${e}` - } - - codespan(e) { - return `${e}` - } - - br() { - return "
    " - } - - del(e) { - return `${e}` - } - - link(e, t, n) { - const s = g(e); - if (null === s) return n; - let r = '
    ", r - } - - image(e, t, n) { - const s = g(e); - if (null === s) return n; - let r = `${n} "colon" === (t = t.toLowerCase()) ? ":" : "#" === t.charAt(0) ? "x" === t.charAt(1) ? String.fromCharCode(parseInt(t.substring(2), 16)) : String.fromCharCode(+t.substring(1)) : ""))); - continue - } - case"code": { - const e = r; - n += this.renderer.code(e.text, e.lang, !!e.escaped); - continue - } - case"table": { - const e = r; - let t = "", s = ""; - for (let t = 0; t < e.header.length; t++) s += this.renderer.tablecell(this.parseInline(e.header[t].tokens), { - header: !0, - align: e.align[t] - }); - t += this.renderer.tablerow(s); - let i = ""; - for (let t = 0; t < e.rows.length; t++) { - const n = e.rows[t]; - s = ""; - for (let t = 0; t < n.length; t++) s += this.renderer.tablecell(this.parseInline(n[t].tokens), { - header: !1, - align: e.align[t] - }); - i += this.renderer.tablerow(s) - } - n += this.renderer.table(t, i); - continue - } - case"blockquote": { - const e = r, t = this.parse(e.tokens); - n += this.renderer.blockquote(t); - continue - } - case"list": { - const e = r, t = e.ordered, s = e.start, i = e.loose; - let l = ""; - for (let t = 0; t < e.items.length; t++) { - const n = e.items[t], s = n.checked, r = n.task; - let o = ""; - if (n.task) { - const e = this.renderer.checkbox(!!s); - i ? n.tokens.length > 0 && "paragraph" === n.tokens[0].type ? (n.tokens[0].text = e + " " + n.tokens[0].text, n.tokens[0].tokens && n.tokens[0].tokens.length > 0 && "text" === n.tokens[0].tokens[0].type && (n.tokens[0].tokens[0].text = e + " " + n.tokens[0].tokens[0].text)) : n.tokens.unshift({ - type: "text", - text: e + " " - }) : o += e + " " - } - o += this.parse(n.tokens, i), l += this.renderer.listitem(o, r, !!s) - } - n += this.renderer.list(l, t, s); - continue - } - case"html": { - const e = r; - n += this.renderer.html(e.text, e.block); - continue - } - case"paragraph": { - const e = r; - n += this.renderer.paragraph(this.parseInline(e.tokens)); - continue - } - case"text": { - let i = r, l = i.tokens ? this.parseInline(i.tokens) : i.text; - for (; s + 1 < e.length && "text" === e[s + 1].type;) i = e[++s], l += "\n" + (i.tokens ? this.parseInline(i.tokens) : i.text); - n += t ? this.renderer.paragraph(l) : l; - continue - } - default: { - const e = 'Token with "' + r.type + '" type was not found.'; - if (this.options.silent) return console.error(e), ""; - throw new Error(e) - } - } - } - return n - } - - parseInline(e, t) { - t = t || this.renderer; - let n = ""; - for (let s = 0; s < e.length; s++) { - const r = e[s]; - if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[r.type]) { - const e = this.options.extensions.renderers[r.type].call({parser: this}, r); - if (!1 !== e || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(r.type)) { - n += e || ""; - continue - } - } - switch (r.type) { - case"escape": { - const e = r; - n += t.text(e.text); - break - } - case"html": { - const e = r; - n += t.html(e.text); - break - } - case"link": { - const e = r; - n += t.link(e.href, e.title, this.parseInline(e.tokens, t)); - break - } - case"image": { - const e = r; - n += t.image(e.href, e.title, e.text); - break - } - case"strong": { - const e = r; - n += t.strong(this.parseInline(e.tokens, t)); - break - } - case"em": { - const e = r; - n += t.em(this.parseInline(e.tokens, t)); - break - } - case"codespan": { - const e = r; - n += t.codespan(e.text); - break - } - case"br": - n += t.br(); - break; - case"del": { - const e = r; - n += t.del(this.parseInline(e.tokens, t)); - break - } - case"text": { - const e = r; - n += t.text(e.text); - break - } - default: { - const e = 'Token with "' + r.type + '" type was not found.'; - if (this.options.silent) return console.error(e), ""; - throw new Error(e) - } - } - } - return n - } - } - - class T { - options; - - constructor(t) { - this.options = t || e.defaults - } - - static passThroughHooks = new Set(["preprocess", "postprocess"]); - - preprocess(e) { - return e - } - - postprocess(e) { - return e - } - } - - class R { - defaults = { - async: !1, - breaks: !1, - extensions: null, - gfm: !0, - hooks: null, - pedantic: !1, - renderer: null, - silent: !1, - tokenizer: null, - walkTokens: null - }; - options = this.setOptions; - parse = this.#e(_.lex, z.parse); - parseInline = this.#e(_.lexInline, z.parseInline); - Parser = z; - parser = z.parse; - Renderer = y; - TextRenderer = $; - Lexer = _; - lexer = _.lex; - Tokenizer = b; - Hooks = T; - - constructor(...e) { - this.use(...e) - } - - walkTokens(e, t) { - let n = []; - for (const s of e) switch (n = n.concat(t.call(this, s)), s.type) { - case"table": { - const e = s; - for (const s of e.header) n = n.concat(this.walkTokens(s.tokens, t)); - for (const s of e.rows) for (const e of s) n = n.concat(this.walkTokens(e.tokens, t)); - break - } - case"list": { - const e = s; - n = n.concat(this.walkTokens(e.items, t)); - break - } - default: { - const e = s; - this.defaults.extensions?.childTokens?.[e.type] ? this.defaults.extensions.childTokens[e.type].forEach((s => { - n = n.concat(this.walkTokens(e[s], t)) - })) : e.tokens && (n = n.concat(this.walkTokens(e.tokens, t))) - } - } - return n - } - - use(...e) { - const t = this.defaults.extensions || {renderers: {}, childTokens: {}}; - return e.forEach((e => { - const n = {...e}; - if (n.async = this.defaults.async || n.async || !1, e.extensions && (e.extensions.forEach((e => { - if (!e.name) throw new Error("extension name required"); - if ("renderer" in e) { - const n = t.renderers[e.name]; - t.renderers[e.name] = n ? function (...t) { - let s = e.renderer.apply(this, t); - return !1 === s && (s = n.apply(this, t)), s - } : e.renderer - } - if ("tokenizer" in e) { - if (!e.level || "block" !== e.level && "inline" !== e.level) throw new Error("extension level must be 'block' or 'inline'"); - const n = t[e.level]; - n ? n.unshift(e.tokenizer) : t[e.level] = [e.tokenizer], e.start && ("block" === e.level ? t.startBlock ? t.startBlock.push(e.start) : t.startBlock = [e.start] : "inline" === e.level && (t.startInline ? t.startInline.push(e.start) : t.startInline = [e.start])) - } - "childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens) - })), n.extensions = t), e.renderer) { - const t = this.defaults.renderer || new y(this.defaults); - for (const n in e.renderer) { - const s = e.renderer[n], r = n, i = t[r]; - t[r] = (...e) => { - let n = s.apply(t, e); - return !1 === n && (n = i.apply(t, e)), n || "" - } - } - n.renderer = t - } - if (e.tokenizer) { - const t = this.defaults.tokenizer || new b(this.defaults); - for (const n in e.tokenizer) { - const s = e.tokenizer[n], r = n, i = t[r]; - t[r] = (...e) => { - let n = s.apply(t, e); - return !1 === n && (n = i.apply(t, e)), n - } - } - n.tokenizer = t - } - if (e.hooks) { - const t = this.defaults.hooks || new T; - for (const n in e.hooks) { - const s = e.hooks[n], r = n, i = t[r]; - T.passThroughHooks.has(n) ? t[r] = e => { - if (this.defaults.async) return Promise.resolve(s.call(t, e)).then((e => i.call(t, e))); - const n = s.call(t, e); - return i.call(t, n) - } : t[r] = (...e) => { - let n = s.apply(t, e); - return !1 === n && (n = i.apply(t, e)), n - } - } - n.hooks = t - } - if (e.walkTokens) { - const t = this.defaults.walkTokens, s = e.walkTokens; - n.walkTokens = function (e) { - let n = []; - return n.push(s.call(this, e)), t && (n = n.concat(t.call(this, e))), n - } - } - this.defaults = {...this.defaults, ...n} - })), this - } - - setOptions(e) { - return this.defaults = {...this.defaults, ...e}, this - } - - #e(e, t) { - return (n, s) => { - const r = {...s}, i = {...this.defaults, ...r}; - !0 === this.defaults.async && !1 === r.async && (i.silent || console.warn("marked(): The async option was set to true by an extension. The async: false option sent to unresolved will be ignored."), i.async = !0); - const l = this.#t(!!i.silent, !!i.async); - if (null == n) return l(new Error("marked(): input parameter is undefined or null")); - if ("string" != typeof n) return l(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected")); - if (i.hooks && (i.hooks.options = i), i.async) return Promise.resolve(i.hooks ? i.hooks.preprocess(n) : n).then((t => e(t, i))).then((e => i.walkTokens ? Promise.all(this.walkTokens(e, i.walkTokens)).then((() => e)) : e)).then((e => t(e, i))).then((e => i.hooks ? i.hooks.postprocess(e) : e)).catch(l); - try { - i.hooks && (n = i.hooks.preprocess(n)); - const s = e(n, i); - i.walkTokens && this.walkTokens(s, i.walkTokens); - let r = t(s, i); - return i.hooks && (r = i.hooks.postprocess(r)), r - } catch (e) { - return l(e) - } - } - } - - #t(e, t) { - return n => { - if (n.message += "\nPlease report this to https://github.com/markedjs/marked.", e) { - const e = "

    An error occurred:

    " + c(n.message + "", !0) + "
    "; - return t ? Promise.resolve(e) : e - } - if (t) return Promise.reject(n); - throw n - } - } - } - - const S = new R; - - function A(e, t) { - return S.parse(e, t) - } - - A.options = A.setOptions = function (e) { - return S.setOptions(e), A.defaults = S.defaults, n(A.defaults), A - }, A.getDefaults = t, A.defaults = e.defaults, A.use = function (...e) { - return S.use(...e), A.defaults = S.defaults, n(A.defaults), A - }, A.walkTokens = function (e, t) { - return S.walkTokens(e, t) - }, A.parseInline = S.parseInline, A.Parser = z, A.parser = z.parse, A.Renderer = y, A.TextRenderer = $, A.Lexer = _, A.lexer = _.lex, A.Tokenizer = b, A.Hooks = T, A.parse = A; - const I = A.options, E = A.setOptions, Z = A.use, q = A.walkTokens, L = A.parseInline, D = A, P = z.parse, - v = _.lex; - e.Hooks = T, e.Lexer = _, e.Marked = R, e.Parser = z, e.Renderer = y, e.TextRenderer = $, e.Tokenizer = b, e.getDefaults = t, e.lexer = v, e.marked = A, e.options = I, e.parse = D, e.parseInline = L, e.parser = P, e.setOptions = E, e.use = Z, e.walkTokens = q -})); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).marked={})}(this,(function(e){"use strict";function t(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function n(t){e.defaults=t}e.defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};const s=/[&<>"']/,r=new RegExp(s.source,"g"),i=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,l=new RegExp(i.source,"g"),o={"&":"&","<":"<",">":">",'"':""","'":"'"},a=e=>o[e];function c(e,t){if(t){if(s.test(e))return e.replace(r,a)}else if(i.test(e))return e.replace(l,a);return e}const h=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;const p=/(^|[^\[])\^/g;function u(e,t){e="string"==typeof e?e:e.source,t=t||"";const n={replace:(t,s)=>(s=(s="object"==typeof s&&"source"in s?s.source:s).replace(p,"$1"),e=e.replace(t,s),n),getRegex:()=>new RegExp(e,t)};return n}function g(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const k={exec:()=>null};function f(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let s=!1,r=t;for(;--r>=0&&"\\"===n[r];)s=!s;return s?"|":" |"})).split(/ \|/);let s=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:d(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const s=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=s.length?e.slice(s.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=d(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=d(t[0].replace(/^ *>[ \t]?/gm,""),"\n"),n=this.lexer.state.top;this.lexer.state.top=!0;const s=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:s,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const s=n.length>1,r={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");const i=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let l="",o="",a=!1;for(;e;){let n=!1;if(!(t=i.exec(e)))break;if(this.rules.block.hr.test(e))break;l=t[0],e=e.substring(l.length);let s=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),c=e.split("\n",1)[0],h=0;this.options.pedantic?(h=2,o=s.trimStart()):(h=t[2].search(/[^ ]/),h=h>4?1:h,o=s.slice(h),h+=t[1].length);let p=!1;if(!s&&/^ *$/.test(c)&&(l+=c+"\n",e=e.substring(c.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,h-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,h-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),r=new RegExp(`^ {0,${Math.min(3,h-1)}}(?:\`\`\`|~~~)`),i=new RegExp(`^ {0,${Math.min(3,h-1)}}#`);for(;e;){const a=e.split("\n",1)[0];if(c=a,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),r.test(c))break;if(i.test(c))break;if(t.test(c))break;if(n.test(e))break;if(c.search(/[^ ]/)>=h||!c.trim())o+="\n"+c.slice(h);else{if(p)break;if(s.search(/[^ ]/)>=4)break;if(r.test(s))break;if(i.test(s))break;if(n.test(s))break;o+="\n"+c}p||c.trim()||(p=!0),l+=a+"\n",e=e.substring(a.length+1),s=c.slice(h)}}r.loose||(a?r.loose=!0:/\n *\n *$/.test(l)&&(a=!0));let u,g=null;this.options.gfm&&(g=/^\[[ xX]\] /.exec(o),g&&(u="[ ] "!==g[0],o=o.replace(/^\[[ xX]\] +/,""))),r.items.push({type:"list_item",raw:l,task:!!g,checked:u,loose:!1,text:o,tokens:[]}),r.raw+=l}r.items[r.items.length-1].raw=l.trimEnd(),r.items[r.items.length-1].text=o.trimEnd(),r.raw=r.raw.trimEnd();for(let e=0;e"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));r.loose=n}if(r.loose)for(let e=0;e$/,"$1").replace(this.rules.inline._escapes,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:s}}}table(e){const t=this.rules.block.table.exec(e);if(t){if(!/[:|]/.test(t[2]))return;const e={type:"table",raw:t[0],header:f(t[1]).map((e=>({text:e,tokens:[]}))),align:t[2].replace(/^\||\| *$/g,"").split("|"),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){let t,n,s,r,i=e.align.length;for(t=0;t({text:e,tokens:[]})));for(i=e.header.length,n=0;n/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=d(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let s=0;s-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],s="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],s=e[3])}else s=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(e)?n.slice(1):n.slice(1,-1)),x(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:s?s.replace(this.rules.inline._escapes,"$1"):s},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return x(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let s=this.rules.inline.emStrong.lDelim.exec(e);if(!s)return;if(s[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(s[1]||s[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...s[0]].length-1;let r,i,l=n,o=0;const a="*"===s[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(a.lastIndex=0,t=t.slice(-1*e.length+s[0].length-1);null!=(s=a.exec(t));){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r)continue;if(i=[...r].length,s[3]||s[4]){l+=i;continue}if((s[5]||s[6])&&n%3&&!((n+i)%3)){o+=i;continue}if(l-=i,l>0)continue;i=Math.min(i,i+l+o);const t=[...e].slice(0,n+s.index+i+1).join("");if(Math.min(n,i)%2){const e=t.slice(1,-1);return{type:"em",raw:t,text:e,tokens:this.lexer.inlineTokens(e)}}const a=t.slice(2,-2);return{type:"strong",raw:t,text:a,tokens:this.lexer.inlineTokens(a)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),s=/^ /.test(e)&&/ $/.test(e);return n&&s&&(e=e.substring(1,e.length-1)),e=c(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=c(t[1]),n="mailto:"+e):(e=c(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=c(t[0]),n="mailto:"+e;else{let s;do{s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])[0]}while(s!==t[0]);e=c(t[0]),n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:c(t[0]),{type:"text",raw:t[0],text:e}}}}const m={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]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:k,lheading:/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};m.def=u(m.def).replace("label",m._label).replace("title",m._title).getRegex(),m.bullet=/(?:[*+-]|\d{1,9}[.)])/,m.listItemStart=u(/^( *)(bull) */).replace("bull",m.bullet).getRegex(),m.list=u(m.list).replace(/bull/g,m.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+m.def.source+")").getRegex(),m._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",m._comment=/|$)/,m.html=u(m.html,"i").replace("comment",m._comment).replace("tag",m._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),m.lheading=u(m.lheading).replace(/bull/g,m.bullet).getRegex(),m.paragraph=u(m._paragraph).replace("hr",m.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").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",")|<(?:script|pre|style|textarea|!--)").replace("tag",m._tag).getRegex(),m.blockquote=u(m.blockquote).replace("paragraph",m.paragraph).getRegex(),m.normal={...m},m.gfm={...m.normal,table:"^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},m.gfm.table=u(m.gfm.table).replace("hr",m.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").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",")|<(?:script|pre|style|textarea|!--)").replace("tag",m._tag).getRegex(),m.gfm.paragraph=u(m._paragraph).replace("hr",m.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",m.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",m._tag).getRegex(),m.pedantic={...m.normal,html:u("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",m._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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:k,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:u(m.normal._paragraph).replace("hr",m.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",m.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const w={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:k,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,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])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:k,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`^|~"};w.punctuation=u(w.punctuation,"u").replace(/punctuation/g,w._punctuation).getRegex(),w.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,w.anyPunctuation=/\\[punct]/g,w._escapes=/\\([punct])/g,w._comment=u(m._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),w.emStrong.lDelim=u(w.emStrong.lDelim,"u").replace(/punct/g,w._punctuation).getRegex(),w.emStrong.rDelimAst=u(w.emStrong.rDelimAst,"gu").replace(/punct/g,w._punctuation).getRegex(),w.emStrong.rDelimUnd=u(w.emStrong.rDelimUnd,"gu").replace(/punct/g,w._punctuation).getRegex(),w.anyPunctuation=u(w.anyPunctuation,"gu").replace(/punct/g,w._punctuation).getRegex(),w._escapes=u(w._escapes,"gu").replace(/punct/g,w._punctuation).getRegex(),w._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,w._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])?)+(?![-_])/,w.autolink=u(w.autolink).replace("scheme",w._scheme).replace("email",w._email).getRegex(),w._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,w.tag=u(w.tag).replace("comment",w._comment).replace("attribute",w._attribute).getRegex(),w._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,w._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,w._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,w.link=u(w.link).replace("label",w._label).replace("href",w._href).replace("title",w._title).getRegex(),w.reflink=u(w.reflink).replace("label",w._label).replace("ref",m._label).getRegex(),w.nolink=u(w.nolink).replace("ref",m._label).getRegex(),w.reflinkSearch=u(w.reflinkSearch,"g").replace("reflink",w.reflink).replace("nolink",w.nolink).getRegex(),w.normal={...w},w.pedantic={...w.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:u(/^!?\[(label)\]\((.*?)\)/).replace("label",w._label).getRegex(),reflink:u(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",w._label).getRegex()},w.gfm={...w.normal,escape:u(w.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]*?(?:(?=[\\t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((s=>!!(n=s.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),s=t[t.length-1],!s||"paragraph"!==s.type&&"text"!==s.type?t.push(n):(s.raw+="\n"+n.raw,s.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=s.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),s=t[t.length-1],!s||"paragraph"!==s.type&&"text"!==s.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(s.raw+="\n"+n.raw,s.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=s.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(r=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let s;this.options.extensions.startBlock.forEach((e=>{s=e.call({lexer:this},n),"number"==typeof s&&s>=0&&(t=Math.min(t,s))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(r)))s=t[t.length-1],i&&"paragraph"===s.type?(s.raw+="\n"+n.raw,s.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n),i=r.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),s=t[t.length-1],s&&"text"===s.type?(s.raw+="\n"+n.raw,s.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,s,r,i,l,o,a=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(a));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(a));)a=a.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.anyPunctuation.exec(a));)a=a.slice(0,i.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(l||(o=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((s=>!!(n=s.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),s=t[t.length-1],s&&"text"===n.type&&"text"===s.type?(s.raw+=n.raw,s.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),s=t[t.length-1],s&&"text"===n.type&&"text"===s.type?(s.raw+=n.raw,s.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,a,o))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(r=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let s;this.options.extensions.startInline.forEach((e=>{s=e.call({lexer:this},n),"number"==typeof s&&s>=0&&(t=Math.min(t,s))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(r))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(o=n.raw.slice(-1)),l=!0,s=t[t.length-1],s&&"text"===s.type?(s.raw+=n.raw,s.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class y{options;constructor(t){this.options=t||e.defaults}code(e,t,n){const s=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+"\n",s?'
    '+(n?e:c(e,!0))+"
    \n":"
    "+(n?e:c(e,!0))+"
    \n"}blockquote(e){return`
    \n${e}
    \n`}html(e,t){return e}heading(e,t,n){return`${e}\n`}hr(){return"
    \n"}list(e,t,n){const s=t?"ol":"ul";return"<"+s+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"}listitem(e,t,n){return`
  • ${e}
  • \n`}checkbox(e){return"'}paragraph(e){return`

    ${e}

    \n`}table(e,t){return t&&(t=`${t}`),"\n\n"+e+"\n"+t+"
    \n"}tablerow(e){return`\n${e}\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`\n`}strong(e){return`${e}`}em(e){return`${e}`}codespan(e){return`${e}`}br(){return"
    "}del(e){return`${e}`}link(e,t,n){const s=g(e);if(null===s)return n;let r='
    ",r}image(e,t,n){const s=g(e);if(null===s)return n;let r=`${n}"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):"")));continue}case"code":{const e=r;n+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case"table":{const e=r;let t="",s="";for(let t=0;t0&&"paragraph"===n.tokens[0].type?(n.tokens[0].text=e+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&"text"===n.tokens[0].tokens[0].type&&(n.tokens[0].tokens[0].text=e+" "+n.tokens[0].tokens[0].text)):n.tokens.unshift({type:"text",text:e+" "}):o+=e+" "}o+=this.parse(n.tokens,i),l+=this.renderer.listitem(o,r,!!s)}n+=this.renderer.list(l,t,s);continue}case"html":{const e=r;n+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=r;n+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let i=r,l=i.tokens?this.parseInline(i.tokens):i.text;for(;s+1{n=n.concat(this.walkTokens(e[s],t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let s=e.renderer.apply(this,t);return!1===s&&(s=n.apply(this,t)),s}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new y(this.defaults);for(const n in e.renderer){const s=e.renderer[n],r=n,i=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=i.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new b(this.defaults);for(const n in e.tokenizer){const s=e.tokenizer[n],r=n,i=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new T;for(const n in e.hooks){const s=e.hooks[n],r=n,i=t[r];T.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(s.call(t,e)).then((e=>i.call(t,e)));const n=s.call(t,e);return i.call(t,n)}:t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,s=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(s.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}#e(e,t){return(n,s)=>{const r={...s},i={...this.defaults,...r};!0===this.defaults.async&&!1===r.async&&(i.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),i.async=!0);const l=this.#t(!!i.silent,!!i.async);if(null==n)return l(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(i.hooks&&(i.hooks.options=i),i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then((t=>e(t,i))).then((e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then((()=>e)):e)).then((e=>t(e,i))).then((e=>i.hooks?i.hooks.postprocess(e):e)).catch(l);try{i.hooks&&(n=i.hooks.preprocess(n));const s=e(n,i);i.walkTokens&&this.walkTokens(s,i.walkTokens);let r=t(s,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return l(e)}}}#t(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="

    An error occurred:

    "+c(n.message+"",!0)+"
    ";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}}const S=new R;function A(e,t){return S.parse(e,t)}A.options=A.setOptions=function(e){return S.setOptions(e),A.defaults=S.defaults,n(A.defaults),A},A.getDefaults=t,A.defaults=e.defaults,A.use=function(...e){return S.use(...e),A.defaults=S.defaults,n(A.defaults),A},A.walkTokens=function(e,t){return S.walkTokens(e,t)},A.parseInline=S.parseInline,A.Parser=z,A.parser=z.parse,A.Renderer=y,A.TextRenderer=$,A.Lexer=_,A.lexer=_.lex,A.Tokenizer=b,A.Hooks=T,A.parse=A;const I=A.options,E=A.setOptions,Z=A.use,q=A.walkTokens,L=A.parseInline,D=A,P=z.parse,v=_.lex;e.Hooks=T,e.Lexer=_,e.Marked=R,e.Parser=z,e.Renderer=y,e.TextRenderer=$,e.Tokenizer=b,e.getDefaults=t,e.lexer=v,e.marked=A,e.options=I,e.parse=D,e.parseInline=L,e.parser=P,e.setOptions=E,e.use=Z,e.walkTokens=q})); const fastn = (function (fastn) { class Closure { #cached_value; @@ -1816,8 +656,8 @@ const fastn = (function (fastn) { if (!(key in obj.#fields)) { throw new Error( "RecordInstance.replace: key " + - key + - " not present in new object", + key + + " not present in new object", ); } this.#fields[key] = fastn.wrapMutable(obj.#fields[key]); @@ -2705,7 +1545,6 @@ fastn_dom.Event = { class PropertyValueAsClosure { closureFunction; deps; - constructor(closureFunction, deps) { this.closureFunction = closureFunction; this.deps = deps; @@ -2732,7 +1571,6 @@ class Node2 { */ #extraData; #children; - constructor(parentOrSibiling, kind) { this.#kind = kind; this.#parent = parentOrSibiling; @@ -2774,7 +1612,6 @@ class Node2 { this.#parent.appendChild(this.#node); } } - createNode(kind) { if (kind === fastn_dom.ElementKind.Code) { let [node, classes, attributes] = fastn_utils.htmlNode(kind); @@ -2797,15 +1634,12 @@ class Node2 { ); } } - getTagName() { return this.#tagName; } - getParent() { return this.#parent; } - removeAllFaviconLinks() { if (doubleBuffering) { const links = document.head.querySelectorAll( @@ -2816,7 +1650,6 @@ class Node2 { }); } } - setFavicon(url) { if (doubleBuffering) { if (url instanceof fastn.recordInstanceClass) url = url.get("src"); @@ -2833,7 +1666,6 @@ class Node2 { document.head.appendChild(link_element); } } - updateTextInputValue() { if (fastn_utils.isNull(this.#rawInnerValue)) { this.attachAttribute("value"); @@ -2845,7 +1677,6 @@ class Node2 { this.attachAttribute("value", this.#rawInnerValue); } } - // for attaching inline attributes attachAttribute(property, value) { // If the value is null, undefined, or false, the attribute will be removed. @@ -2856,11 +1687,9 @@ class Node2 { } this.#node.setAttribute(property, value); } - removeAttribute(property) { this.#node.removeAttribute(property); } - updateTagName(name) { if (ssr) { this.#node.updateTagName(name); @@ -2881,7 +1710,6 @@ class Node2 { this.#node = newElement; } } - updateToAnchor(url) { let node_kind = this.#kind; if (ssr) { @@ -2902,7 +1730,6 @@ class Node2 { this.#node.href = url; } } - updatePositionForNodeById(node_id, value) { if (!ssr) { const target_node = fastnVirtual.root.querySelector( @@ -2912,7 +1739,6 @@ class Node2 { target_node.style["position"] = value; } } - updateParentPosition(value) { if (ssr) { let parent = this.#parent; @@ -2926,13 +1752,11 @@ class Node2 { } } } - updateMetaTitle(value) { if (!ssr && doubleBuffering) { if (!fastn_utils.isNull(value)) window.document.title = value; } } - addMetaTagByName(name, value) { if (value === null || value === undefined) { this.removeMetaTagByName(name); @@ -2945,7 +1769,6 @@ class Node2 { document.head.appendChild(metaTag); } } - addMetaTagByProperty(property, value) { if (value === null || value === undefined) { this.removeMetaTagByProperty(property); @@ -2958,7 +1781,6 @@ class Node2 { document.head.appendChild(metaTag); } } - removeMetaTagByName(name) { if (!ssr && doubleBuffering) { const metaTags = document.getElementsByTagName("meta"); @@ -2971,7 +1793,6 @@ class Node2 { } } } - removeMetaTagByProperty(property) { if (!ssr && doubleBuffering) { const metaTags = document.getElementsByTagName("meta"); @@ -2984,7 +1805,6 @@ class Node2 { } } } - // dynamic-class-css attachCss(property, value, createClass, className) { let propertyShort = fastn_dom.propertyMap[property] || property; @@ -3000,7 +1820,7 @@ class Node2 { } let cssClass = className ? cls : `.${cls}`; - const obj = {property, value}; + const obj = { property, value }; if (value === undefined) { if (!ssr) { @@ -3063,7 +1883,6 @@ class Node2 { this.#node.classList.add(cls); return cls; } - attachShadow(value) { if (fastn_utils.isNull(value)) { this.attachCss("box-shadow", value); @@ -3099,7 +1918,6 @@ class Node2 { ); } } - attachBackdropMultiFilter(value) { const filters = { blur: fastn_utils.getStaticValue(value.get("blur")), @@ -3119,7 +1937,6 @@ class Node2 { this.attachCss("backdrop-filter", filterString, false); } - attachTextShadow(value) { if (fastn_utils.isNull(value)) { this.attachCss("text-shadow", value); @@ -3151,7 +1968,6 @@ class Node2 { ); } } - getLinearGradientString(value) { var lightGradientString = ""; var darkGradientString = ""; @@ -3197,7 +2013,6 @@ class Node2 { return [lightGradientString, darkGradientString]; } - attachLinearGradientCss(value) { if (fastn_utils.isNull(value)) { this.attachCss("background-image", value); @@ -3237,7 +2052,7 @@ class Node2 { const colorsList = value.get("colors").get().getList(); - colorsList.forEach(({item}) => { + colorsList.forEach(({ item }) => { const color = item.get("color"); [color.get("light"), color.get("dark")].forEach((variant) => { @@ -3246,7 +2061,6 @@ class Node2 { }); }); } - attachBackgroundImageCss(value) { if (fastn_utils.isNull(value)) { this.attachCss("background-repeat", value); @@ -3308,7 +2122,6 @@ class Node2 { ); } } - attachMaskImageCss(value, vendorPrefix) { const propertyWithPrefix = vendorPrefix ? `${vendorPrefix}-mask-image` @@ -3397,7 +2210,6 @@ class Node2 { ); } } - attachMaskSizeCss(value, vendorPrefix) { const propertyNameWithPrefix = vendorPrefix ? `${vendorPrefix}-mask-size` @@ -3416,7 +2228,6 @@ class Node2 { this.attachCss(propertyNameWithPrefix, `${size_x} ${size_y}`, true); } } - attachMaskMultiCss(value, vendorPrefix) { if (fastn_utils.isNull(value)) { this.attachCss("mask-repeat", value); @@ -3450,7 +2261,6 @@ class Node2 { this.attachCss("-webkit-mask-position", maskPositionValue, true); } } - attachExternalCss(css) { if (!ssr) { let css_tag = document.createElement("link"); @@ -3466,7 +2276,6 @@ class Node2 { } } } - attachExternalJs(js) { if (!ssr) { let js_tag = document.createElement("script"); @@ -3480,7 +2289,6 @@ class Node2 { } } } - attachColorCss(property, value, visited) { if (fastn_utils.isNull(value)) { this.attachCss(property, value); @@ -3533,7 +2341,6 @@ class Node2 { this.#mutables.push(modeValue); }); } - attachRoleCss(value) { if (fastn_utils.isNull(value)) { this.attachCss("role", value); @@ -3573,7 +2380,6 @@ class Node2 { ); this.#mutables.push(value); } - attachTextStyles(styles) { if (fastn_utils.isNull(styles)) { this.attachCss("font-style", styles); @@ -3595,7 +2401,6 @@ class Node2 { } } } - attachAlignContent(value, node_kind) { if (fastn_utils.isNull(value)) { this.attachCss("align-items", value); @@ -3851,7 +2656,6 @@ class Node2 { ); this.#mutables.push(ftd.dark_mode); } - setStaticProperty(kind, value, inherited) { // value can be either static or mutable let staticValue = fastn_utils.getStaticValue(value); @@ -4488,7 +3292,7 @@ class Node2 { this.attachRoleCss(staticValue); } else if (kind === fastn_dom.PropertyKind.Code) { if (!fastn_utils.isNull(staticValue)) { - let {modifiedText, highlightedLines} = + let { modifiedText, highlightedLines } = fastn_utils.findAndRemoveHighlighter(staticValue); if (highlightedLines.length !== 0) { this.attachAttribute("data-line", highlightedLines); @@ -4630,24 +3434,23 @@ class Node2 { this.#node.innerHTML = staticValue; this.#rawInnerValue = staticValue; } else if (kind === fastn_dom.PropertyKind.StringValue) { - this.#rawInnerValue = staticValue; - staticValue = fastn_utils.markdown_inline( - fastn_utils.escapeHtmlInMarkdown(staticValue), - ); - staticValue = fastn_utils.process_post_markdown( - this.#node, - staticValue, - ); - if (!fastn_utils.isNull(staticValue)) { - this.#node.innerHTML = staticValue; - } else { - this.#node.innerHTML = ""; - } + this.#rawInnerValue = staticValue; + staticValue = fastn_utils.markdown_inline( + fastn_utils.escapeHtmlInMarkdown(staticValue), + ); + staticValue = fastn_utils.process_post_markdown( + this.#node, + staticValue, + ); + if (!fastn_utils.isNull(staticValue)) { + this.#node.innerHTML = staticValue; } else { - throw "invalid fastn_dom.PropertyKind: " + kind; + this.#node.innerHTML = ""; } + } else { + throw "invalid fastn_dom.PropertyKind: " + kind; + } } - setProperty(kind, value, inherited) { if (value instanceof fastn.mutableClass) { this.setDynamicProperty( @@ -4669,7 +3472,6 @@ class Node2 { this.setStaticProperty(kind, value, inherited); } } - setDynamicProperty(kind, deps, func, inherited) { let closure = fastn .closure(func) @@ -4682,26 +3484,21 @@ class Node2 { this.#mutables.push(deps[dep]); } } - getNode() { return this.#node; } - getExtraData() { return this.#extraData; } - getChildren() { return this.#children; } - mergeFnCalls(current, newFunc) { return () => { if (current instanceof Function) current(); if (newFunc instanceof Function) newFunc(); }; } - addEventHandler(event, func) { if (event === fastn_dom.Event.Click) { let onclickEvents = this.mergeFnCalls(this.#node.onclick, func); @@ -4743,7 +3540,6 @@ class Node2 { this.#node.onfocus = onFocusEvents; } } - destroy() { for (let i = 0; i < this.#mutables.length; i++) { this.#mutables[i].unlinkNode(this); @@ -4843,16 +3639,13 @@ fastn_dom.conditionalDom = function ( class ParentNodeWithSibiling { #parent; #sibiling; - constructor(parent, sibiling) { this.#parent = parent; this.#sibiling = sibiling; } - getParent() { return this.#parent; } - getSibiling() { return this.#sibiling; } @@ -4864,7 +3657,6 @@ class ForLoop { #wrapper; #parent; #nodes; - constructor(parent, node_constructor, list) { this.#wrapper = fastn_dom.createKernel( parent, @@ -4881,7 +3673,6 @@ class ForLoop { } fastn_utils.setFullHeight(); } - createNode(index, resizeBodyHeight = true) { if (resizeBodyHeight) { fastn_utils.resetFullHeight(); @@ -4904,7 +3695,6 @@ class ForLoop { } return node; } - createAllNode() { fastn_utils.resetFullHeight(); this.deleteAllNode(false); @@ -4913,7 +3703,6 @@ class ForLoop { } fastn_utils.setFullHeight(); } - deleteAllNode(resizeBodyHeight = true) { if (resizeBodyHeight) { fastn_utils.resetFullHeight(); @@ -4925,18 +3714,15 @@ class ForLoop { fastn_utils.setFullHeight(); } } - getWrapper() { return this.#wrapper; } - deleteNode(index) { fastn_utils.resetFullHeight(); let node = this.#nodes.splice(index, 1)[0]; node.destroy(); fastn_utils.setFullHeight(); } - getParent() { return this.#parent; } @@ -5272,7 +4058,7 @@ let fastn_utils = { markdown_inline(i) { if (fastn_utils.isNull(i)) return; i = i.toString(); - const {space_before, space_after} = fastn_utils.private.spaces(i); + const { space_before, space_after } = fastn_utils.private.spaces(i); const o = (() => { let g = fastn_utils.private.replace_last_occurrence( marked.parse(i), @@ -5610,7 +4396,7 @@ fastn_utils.private = { space_before = i + 1; } if (space_before === s.length) { - return {space_before, space_after: 0}; + return { space_before, space_after: 0 }; } let space_after = 0; @@ -5622,7 +4408,7 @@ fastn_utils.private = { space_after = i + 1; } - return {space_before, space_after}; + return { space_before, space_after }; }, /** * Helper function for `fastn_utils.markdown_inline` to replace the last @@ -5649,7 +4435,7 @@ fastn_utils.private = { * @returns {string} - A string with 'n' spaces concatenated together. */ repeated_space(n) { - return Array.from({length: n}, () => " ").join(""); + return Array.from({ length: n }, () => " ").join(""); }, /** * Merges consecutive numbers in a comma-separated list into ranges. @@ -5775,7 +4561,6 @@ let doubleBuffering = false; class ClassList { #classes = []; - add(item) { this.#classes.push(item); } @@ -5783,11 +4568,9 @@ class ClassList { remove(itemToRemove) { this.#classes.filter((item) => item !== itemToRemove); } - toString() { return this.#classes.join(" "); } - getClasses() { return this.#classes; } @@ -5799,7 +4582,6 @@ class Node { #tagName; #children; #attributes; - constructor(id, tagName) { this.#tagName = tagName; this.#dataId = id; @@ -5811,7 +4593,6 @@ class Node { this.onclick = null; this.id = null; } - appendChild(c) { this.#children.push(c); } @@ -5840,7 +4621,6 @@ class Node { updateTagName(tagName) { this.#tagName = tagName; } - // Caution: This is only supported in ssr mode toHtmlAsString() { const openingTag = `<${ @@ -5854,23 +4634,19 @@ class Node { return `${openingTag}${innerHTML}${childNodes}${closingTag}`; } - // Caution: This is only supported in ssr mode getDataIdString() { return ` data-id="${this.#dataId}"`; } - // Caution: This is only supported in ssr mode getIdString() { return fastn_utils.isNull(this.id) ? "" : ` id="${this.id}"`; } - // Caution: This is only supported in ssr mode getClassString() { const classList = this.classList.toString(); return classList ? ` class="${classList}"` : ""; } - // Caution: This is only supported in ssr mode getStyleString() { const styleProperties = Object.entries(this.style) @@ -5878,7 +4654,6 @@ class Node { .join(";"); return styleProperties ? ` style="${styleProperties}"` : ""; } - // Caution: This is only supported in ssr mode getAttributesString() { const nodeAttributes = Object.entries(this.#attributes) @@ -5952,10 +4727,8 @@ fastnVirtual.ssr = function (main) { id_counter = 0; return body.toHtmlAsString() + fastn_dom.getClassesAsString(); }; - class MutableVariable { #value; - constructor(value) { this.#value = value; } @@ -5967,7 +4740,6 @@ class MutableVariable { set(value) { this.#value.set(value); } - // Todo: Remove closure when node is removed. on_change(func) { this.#value.addClosure(fastn.closureWithoutExecute(func)); @@ -5976,15 +4748,12 @@ class MutableVariable { class MutableListVariable { #value; - constructor(value) { this.#value = value; } - get() { return fastn_utils.getStaticValue(this.#value); } - set(index, list) { if (list === undefined) { this.#value.set(fastn_utils.staticToMutables(index)); @@ -5992,27 +4761,21 @@ class MutableListVariable { } this.#value.set(index, fastn_utils.staticToMutables(list)); } - insertAt(index, value) { this.#value.insertAt(index, fastn_utils.staticToMutables(value)); } - deleteAt(index) { this.#value.deleteAt(index); } - push(value) { this.#value.push(value); } - pop() { this.#value.pop(); } - clearAll() { this.#value.clearAll(); } - on_change(func) { this.#value.addClosure(fastn.closureWithoutExecute(func)); } @@ -6020,7 +4783,6 @@ class MutableListVariable { class RecordVariable { #value; - constructor(value) { this.#value = value; } @@ -6037,11 +4799,9 @@ class RecordVariable { this.#value.addClosure(fastn.closureWithoutExecute(func)); } } - class StaticVariable { #value; #closures; - constructor(value) { this.#value = value; this.#closures = []; @@ -6282,7 +5042,7 @@ const ftd = (function () { method = method.trim().toUpperCase(); const init = { method, - headers: {"Content-Type": "application/json"}, + headers: { "Content-Type": "application/json" }, }; if (headers && headers instanceof fastn.recordInstanceClass) { Object.assign(init.headers, headers.toObject()); @@ -6586,7 +5346,7 @@ const ftd = (function () { redirect: "error", // TODO: set credentials? credentials: "same-origin", - headers: {"Content-Type": "application/json"}, + headers: { "Content-Type": "application/json" }, body: JSON.stringify(data), }; @@ -6679,7 +5439,6 @@ ftd.post_init = function () { window.onresize = function () { initialise_device(); }; - function initialise_click_outside_events() { document.addEventListener("click", function (event) { ftd.clickOutsideEvents.forEach(([ftdNode, func]) => { @@ -6694,7 +5453,6 @@ ftd.post_init = function () { }); }); } - function initialise_global_key_events() { let globalKeys = {}; let buffer = []; @@ -6753,7 +5511,6 @@ ftd.post_init = function () { globalKeys[fastn_utils.getEventKey(event)] = false; }); } - function initialise_device() { let current = ftd.get_device(); if (current === last_device) { @@ -6837,23 +5594,19 @@ ftd.post_init = function () { set_cookie(DARK_MODE_COOKIE, COOKIE_SYSTEM_LIGHT); } }; - function set_cookie(name, value) { document.cookie = name + "=" + value + "; path=/"; } - function system_dark_mode() { return !!( window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ); } - function initialise_dark_mode() { update_dark_mode(); start_watching_dark_mode_system_preference(); } - function get_cookie(name, def) { // source: https://stackoverflow.com/questions/5639346/ let regex = document.cookie.match( @@ -6861,7 +5614,6 @@ ftd.post_init = function () { ); return regex !== null ? regex.pop() : def; } - function update_dark_mode() { let current_dark_mode_cookie = get_cookie( DARK_MODE_COOKIE, @@ -6883,13 +5635,11 @@ ftd.post_init = function () { window.enable_system_mode(); } } - function start_watching_dark_mode_system_preference() { window .matchMedia("(prefers-color-scheme: dark)") .addEventListener("change", update_dark_mode); } - initialise_device(); initialise_dark_mode(); initialise_click_outside_events(); @@ -6901,218 +5651,234 @@ ftd.post_init = function () { window.ftd = ftd; ftd.toggle = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "amitu"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(!fastn_utils.getStaticValue(__args__.a)); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "amitu"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(!fastn_utils.getStaticValue(__args__.a)); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.integer_field_with_default = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "amitu"; - try { - let __args__ = fastn_utils.getArgs({}, args); - return (ftd.field_with_default_js(__args__.name, __args__.default)); - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "amitu"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + return (ftd.field_with_default_js(__args__.name, __args__.default)); + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.decimal_field_with_default = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "amitu"; - try { - let __args__ = fastn_utils.getArgs({}, args); - return (ftd.field_with_default_js(__args__.name, __args__.default)); - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "amitu"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + return (ftd.field_with_default_js(__args__.name, __args__.default)); + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.boolean_field_with_default = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "amitu"; - try { - let __args__ = fastn_utils.getArgs({}, args); - return (ftd.field_with_default_js(__args__.name, __args__.default)); - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "amitu"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + return (ftd.field_with_default_js(__args__.name, __args__.default)); + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.string_field_with_default = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "amitu"; - try { - let __args__ = fastn_utils.getArgs({}, args); - return (ftd.field_with_default_js(__args__.name, __args__.default)); - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "amitu"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + return (ftd.field_with_default_js(__args__.name, __args__.default)); + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.increment = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "amitu"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(fastn_utils.getStaticValue(__args__.a) + 1); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "amitu"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(fastn_utils.getStaticValue(__args__.a) + 1); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.increment_by = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "amitu"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(fastn_utils.getStaticValue(__args__.a) + fastn_utils.getStaticValue(__args__.v)); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "amitu"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(fastn_utils.getStaticValue(__args__.a) + fastn_utils.getStaticValue(__args__.v)); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.decrement = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "amitu"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(fastn_utils.getStaticValue(__args__.a) - 1); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "amitu"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(fastn_utils.getStaticValue(__args__.a) - 1); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.decrement_by = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "amitu"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(fastn_utils.getStaticValue(__args__.a) - fastn_utils.getStaticValue(__args__.v)); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "amitu"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(fastn_utils.getStaticValue(__args__.a) - fastn_utils.getStaticValue(__args__.v)); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.enable_light_mode = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "amitu"; - try { - let __args__ = fastn_utils.getArgs({}, args); - return (enable_light_mode()); - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "amitu"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + return (enable_light_mode()); + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.enable_dark_mode = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "amitu"; - try { - let __args__ = fastn_utils.getArgs({}, args); - return (enable_dark_mode()); - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "amitu"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + return (enable_dark_mode()); + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.enable_system_mode = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "amitu"; - try { - let __args__ = fastn_utils.getArgs({}, args); - return (enable_system_mode()); - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "amitu"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + return (enable_system_mode()); + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.set_bool = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "amitu"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(__args__.v); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "amitu"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(__args__.v); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.set_boolean = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "amitu"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(__args__.v); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "amitu"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(__args__.v); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.set_string = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "amitu"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(__args__.v); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "amitu"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(__args__.v); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.set_integer = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "amitu"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(__args__.v); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "amitu"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(__args__.v); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.dark_mode = fastn.mutable(false); ftd.empty = ""; @@ -7125,872 +5891,1010 @@ ftd.font_display = fastn.mutable("sans-serif"); ftd.font_copy = fastn.mutable("sans-serif"); ftd.font_code = fastn.mutable("sans-serif"); ftd.default_types = function () { - let record = fastn.recordInstance({}); - record.set("heading_large", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(50)); - record.set("line_height", fastn_dom.FontSize.Px(65)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(36)); - record.set("line_height", fastn_dom.FontSize.Px(54)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + let record = fastn.recordInstance({ + }); + record.set("heading_large", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(50)); + record.set("line_height", fastn_dom.FontSize.Px(65)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(36)); + record.set("line_height", fastn_dom.FontSize.Px(54)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + return record; + }()); + record.set("heading_medium", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(38)); + record.set("line_height", fastn_dom.FontSize.Px(57)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(26)); + record.set("line_height", fastn_dom.FontSize.Px(40)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + return record; + }()); + record.set("heading_small", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(24)); + record.set("line_height", fastn_dom.FontSize.Px(31)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(22)); + record.set("line_height", fastn_dom.FontSize.Px(29)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + return record; + }()); + record.set("heading_hero", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(80)); + record.set("line_height", fastn_dom.FontSize.Px(104)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(48)); + record.set("line_height", fastn_dom.FontSize.Px(64)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + return record; + }()); + record.set("heading_tiny", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(20)); + record.set("line_height", fastn_dom.FontSize.Px(26)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(18)); + record.set("line_height", fastn_dom.FontSize.Px(24)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + return record; + }()); + record.set("copy_small", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(14)); + record.set("line_height", fastn_dom.FontSize.Px(24)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_copy); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(12)); + record.set("line_height", fastn_dom.FontSize.Px(16)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_copy); + return record; + }()); + return record; + }()); + record.set("copy_regular", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(18)); + record.set("line_height", fastn_dom.FontSize.Px(30)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_copy); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(16)); + record.set("line_height", fastn_dom.FontSize.Px(24)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_copy); + return record; + }()); + return record; + }()); + record.set("copy_large", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(22)); + record.set("line_height", fastn_dom.FontSize.Px(34)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_copy); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(18)); + record.set("line_height", fastn_dom.FontSize.Px(28)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_copy); + return record; + }()); + return record; + }()); + record.set("fine_print", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(12)); + record.set("line_height", fastn_dom.FontSize.Px(16)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_code); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(12)); + record.set("line_height", fastn_dom.FontSize.Px(16)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_code); + return record; }()); - record.set("heading_medium", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(38)); - record.set("line_height", fastn_dom.FontSize.Px(57)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(26)); - record.set("line_height", fastn_dom.FontSize.Px(40)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + return record; + }()); + record.set("blockquote", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(16)); + record.set("line_height", fastn_dom.FontSize.Px(21)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_code); + return record; }()); - record.set("heading_small", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(24)); - record.set("line_height", fastn_dom.FontSize.Px(31)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(22)); - record.set("line_height", fastn_dom.FontSize.Px(29)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(16)); + record.set("line_height", fastn_dom.FontSize.Px(21)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_code); + return record; }()); - record.set("heading_hero", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(80)); - record.set("line_height", fastn_dom.FontSize.Px(104)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(48)); - record.set("line_height", fastn_dom.FontSize.Px(64)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + return record; + }()); + record.set("source_code", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(18)); + record.set("line_height", fastn_dom.FontSize.Px(30)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_code); + return record; }()); - record.set("heading_tiny", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(20)); - record.set("line_height", fastn_dom.FontSize.Px(26)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(18)); - record.set("line_height", fastn_dom.FontSize.Px(24)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(16)); + record.set("line_height", fastn_dom.FontSize.Px(21)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_code); + return record; }()); - record.set("copy_small", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(14)); - record.set("line_height", fastn_dom.FontSize.Px(24)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_copy); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(12)); - record.set("line_height", fastn_dom.FontSize.Px(16)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_copy); - return record; - }()); - return record; + return record; + }()); + record.set("button_small", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(14)); + record.set("line_height", fastn_dom.FontSize.Px(19)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("copy_regular", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(18)); - record.set("line_height", fastn_dom.FontSize.Px(30)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_copy); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(16)); - record.set("line_height", fastn_dom.FontSize.Px(24)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_copy); - return record; - }()); - return record; + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(14)); + record.set("line_height", fastn_dom.FontSize.Px(19)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("copy_large", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(22)); - record.set("line_height", fastn_dom.FontSize.Px(34)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_copy); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(18)); - record.set("line_height", fastn_dom.FontSize.Px(28)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_copy); - return record; - }()); - return record; + return record; + }()); + record.set("button_medium", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(16)); + record.set("line_height", fastn_dom.FontSize.Px(21)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("fine_print", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(12)); - record.set("line_height", fastn_dom.FontSize.Px(16)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_code); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(12)); - record.set("line_height", fastn_dom.FontSize.Px(16)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_code); - return record; - }()); - return record; + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(16)); + record.set("line_height", fastn_dom.FontSize.Px(21)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("blockquote", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(16)); - record.set("line_height", fastn_dom.FontSize.Px(21)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_code); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(16)); - record.set("line_height", fastn_dom.FontSize.Px(21)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_code); - return record; - }()); - return record; + return record; + }()); + record.set("button_large", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(18)); + record.set("line_height", fastn_dom.FontSize.Px(24)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("source_code", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(18)); - record.set("line_height", fastn_dom.FontSize.Px(30)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_code); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(16)); - record.set("line_height", fastn_dom.FontSize.Px(21)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_code); - return record; - }()); - return record; + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(18)); + record.set("line_height", fastn_dom.FontSize.Px(24)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("button_small", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(14)); - record.set("line_height", fastn_dom.FontSize.Px(19)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(14)); - record.set("line_height", fastn_dom.FontSize.Px(19)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + return record; + }()); + record.set("link", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(14)); + record.set("line_height", fastn_dom.FontSize.Px(19)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("button_medium", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(16)); - record.set("line_height", fastn_dom.FontSize.Px(21)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(16)); - record.set("line_height", fastn_dom.FontSize.Px(21)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(14)); + record.set("line_height", fastn_dom.FontSize.Px(19)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("button_large", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(18)); - record.set("line_height", fastn_dom.FontSize.Px(24)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(18)); - record.set("line_height", fastn_dom.FontSize.Px(24)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + return record; + }()); + record.set("label_large", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(14)); + record.set("line_height", fastn_dom.FontSize.Px(19)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("link", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(14)); - record.set("line_height", fastn_dom.FontSize.Px(19)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(14)); - record.set("line_height", fastn_dom.FontSize.Px(19)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(14)); + record.set("line_height", fastn_dom.FontSize.Px(19)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("label_large", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(14)); - record.set("line_height", fastn_dom.FontSize.Px(19)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(14)); - record.set("line_height", fastn_dom.FontSize.Px(19)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + return record; + }()); + record.set("label_small", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(12)); + record.set("line_height", fastn_dom.FontSize.Px(16)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("label_small", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(12)); - record.set("line_height", fastn_dom.FontSize.Px(16)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(12)); - record.set("line_height", fastn_dom.FontSize.Px(16)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(12)); + record.set("line_height", fastn_dom.FontSize.Px(16)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); return record; + }()); + return record; }(); ftd.default_colors = function () { - let record = fastn.recordInstance({}); - record.set("background", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#e7e7e4"); - record.set("dark", "#18181b"); - return record; - }()); - record.set("step_1", function () { - let record = fastn.recordInstance({}); - record.set("light", "#f3f3f3"); - record.set("dark", "#141414"); - return record; - }()); - record.set("step_2", function () { - let record = fastn.recordInstance({}); - record.set("light", "#c9cece"); - record.set("dark", "#585656"); - return record; - }()); - record.set("overlay", function () { - let record = fastn.recordInstance({}); - record.set("light", "rgba(0, 0, 0, 0.8)"); - record.set("dark", "rgba(0, 0, 0, 0.8)"); - return record; - }()); - record.set("code", function () { - let record = fastn.recordInstance({}); - record.set("light", "#F5F5F5"); - record.set("dark", "#21222C"); - return record; - }()); - return record; + let record = fastn.recordInstance({ + }); + record.set("background", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#e7e7e4"); + record.set("dark", "#18181b"); + return record; + }()); + record.set("step_1", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#f3f3f3"); + record.set("dark", "#141414"); + return record; + }()); + record.set("step_2", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#c9cece"); + record.set("dark", "#585656"); + return record; + }()); + record.set("overlay", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "rgba(0, 0, 0, 0.8)"); + record.set("dark", "rgba(0, 0, 0, 0.8)"); + return record; + }()); + record.set("code", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#F5F5F5"); + record.set("dark", "#21222C"); + return record; + }()); + return record; + }()); + record.set("border", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#434547"); + record.set("dark", "#434547"); + return record; + }()); + record.set("border_strong", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#919192"); + record.set("dark", "#919192"); + return record; + }()); + record.set("text", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#584b42"); + record.set("dark", "#a8a29e"); + return record; + }()); + record.set("text_strong", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#141414"); + record.set("dark", "#ffffff"); + return record; + }()); + record.set("shadow", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#007f9b"); + record.set("dark", "#007f9b"); + return record; + }()); + record.set("scrim", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#007f9b"); + record.set("dark", "#007f9b"); + return record; + }()); + record.set("cta_primary", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#2dd4bf"); + record.set("dark", "#2dd4bf"); + return record; + }()); + record.set("hover", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#2c9f90"); + record.set("dark", "#2c9f90"); + return record; + }()); + record.set("pressed", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#2cc9b5"); + record.set("dark", "#2cc9b5"); + return record; + }()); + record.set("disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "rgba(44, 201, 181, 0.1)"); + record.set("dark", "rgba(44, 201, 181, 0.1)"); + return record; + }()); + record.set("focused", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#2cbfac"); + record.set("dark", "#2cbfac"); + return record; + }()); + record.set("border", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#2b8074"); + record.set("dark", "#2b8074"); + return record; + }()); + record.set("border_disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#65b693"); + record.set("dark", "#65b693"); + return record; + }()); + record.set("text", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#feffff"); + record.set("dark", "#feffff"); + return record; + }()); + record.set("text_disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#65b693"); + record.set("dark", "#65b693"); + return record; + }()); + return record; + }()); + record.set("cta_secondary", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#4fb2df"); + record.set("dark", "#4fb2df"); + return record; + }()); + record.set("hover", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#40afe1"); + record.set("dark", "#40afe1"); + return record; + }()); + record.set("pressed", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#4fb2df"); + record.set("dark", "#4fb2df"); + return record; + }()); + record.set("disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "rgba(79, 178, 223, 0.1)"); + record.set("dark", "rgba(79, 178, 223, 0.1)"); + return record; + }()); + record.set("focused", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#4fb1df"); + record.set("dark", "#4fb1df"); + return record; + }()); + record.set("border", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#209fdb"); + record.set("dark", "#209fdb"); + return record; + }()); + record.set("border_disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#65b693"); + record.set("dark", "#65b693"); + return record; + }()); + record.set("text", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#584b42"); + record.set("dark", "#ffffff"); + return record; + }()); + record.set("text_disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#65b693"); + record.set("dark", "#65b693"); + return record; + }()); + return record; + }()); + record.set("cta_tertiary", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#556375"); + record.set("dark", "#556375"); + return record; + }()); + record.set("hover", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#c7cbd1"); + record.set("dark", "#c7cbd1"); + return record; + }()); + record.set("pressed", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#3b4047"); + record.set("dark", "#3b4047"); + return record; + }()); + record.set("disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "rgba(85, 99, 117, 0.1)"); + record.set("dark", "rgba(85, 99, 117, 0.1)"); + return record; + }()); + record.set("focused", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#e0e2e6"); + record.set("dark", "#e0e2e6"); + return record; + }()); + record.set("border", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#e2e4e7"); + record.set("dark", "#e2e4e7"); + return record; + }()); + record.set("border_disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#65b693"); + record.set("dark", "#65b693"); + return record; + }()); + record.set("text", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#ffffff"); + record.set("dark", "#ffffff"); + return record; + }()); + record.set("text_disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#65b693"); + record.set("dark", "#65b693"); + return record; + }()); + return record; + }()); + record.set("cta_danger", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#1C1B1F"); + record.set("dark", "#1C1B1F"); + return record; + }()); + record.set("hover", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#1C1B1F"); + record.set("dark", "#1C1B1F"); + return record; + }()); + record.set("pressed", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#1C1B1F"); + record.set("dark", "#1C1B1F"); + return record; + }()); + record.set("disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#1C1B1F"); + record.set("dark", "#1C1B1F"); + return record; + }()); + record.set("focused", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#1C1B1F"); + record.set("dark", "#1C1B1F"); + return record; + }()); + record.set("border", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#1C1B1F"); + record.set("dark", "#1C1B1F"); + return record; + }()); + record.set("border_disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#feffff"); + record.set("dark", "#feffff"); + return record; + }()); + record.set("text", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#1C1B1F"); + record.set("dark", "#1C1B1F"); + return record; + }()); + record.set("text_disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#feffff"); + record.set("dark", "#feffff"); + return record; + }()); + return record; + }()); + record.set("accent", function () { + let record = fastn.recordInstance({ + }); + record.set("primary", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#2dd4bf"); + record.set("dark", "#2dd4bf"); + return record; + }()); + record.set("secondary", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#4fb2df"); + record.set("dark", "#4fb2df"); + return record; + }()); + record.set("tertiary", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#c5cbd7"); + record.set("dark", "#c5cbd7"); + return record; + }()); + return record; + }()); + record.set("error", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#f5bdbb"); + record.set("dark", "#311b1f"); + return record; + }()); + record.set("text", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#c62a21"); + record.set("dark", "#c62a21"); + return record; + }()); + record.set("border", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#df2b2b"); + record.set("dark", "#df2b2b"); + return record; + }()); + return record; + }()); + record.set("success", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#e3f0c4"); + record.set("dark", "#405508ad"); + return record; + }()); + record.set("text", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#467b28"); + record.set("dark", "#479f16"); + return record; }()); record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#434547"); - record.set("dark", "#434547"); - return record; + let record = fastn.recordInstance({ + }); + record.set("light", "#3d741f"); + record.set("dark", "#3d741f"); + return record; }()); - record.set("border_strong", function () { - let record = fastn.recordInstance({}); - record.set("light", "#919192"); - record.set("dark", "#919192"); - return record; + return record; + }()); + record.set("info", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#c4edfd"); + record.set("dark", "#15223a"); + return record; }()); record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#584b42"); - record.set("dark", "#a8a29e"); - return record; + let record = fastn.recordInstance({ + }); + record.set("light", "#205694"); + record.set("dark", "#1f6feb"); + return record; + }()); + record.set("border", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#205694"); + record.set("dark", "#205694"); + return record; }()); - record.set("text_strong", function () { - let record = fastn.recordInstance({}); - record.set("light", "#141414"); - record.set("dark", "#ffffff"); - return record; + return record; + }()); + record.set("warning", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#fbefba"); + record.set("dark", "#544607a3"); + return record; }()); - record.set("shadow", function () { - let record = fastn.recordInstance({}); - record.set("light", "#007f9b"); - record.set("dark", "#007f9b"); - return record; + record.set("text", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#966220"); + record.set("dark", "#d07f19"); + return record; }()); - record.set("scrim", function () { - let record = fastn.recordInstance({}); - record.set("light", "#007f9b"); - record.set("dark", "#007f9b"); - return record; + record.set("border", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#966220"); + record.set("dark", "#966220"); + return record; }()); - record.set("cta_primary", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#2dd4bf"); - record.set("dark", "#2dd4bf"); - return record; - }()); - record.set("hover", function () { - let record = fastn.recordInstance({}); - record.set("light", "#2c9f90"); - record.set("dark", "#2c9f90"); - return record; - }()); - record.set("pressed", function () { - let record = fastn.recordInstance({}); - record.set("light", "#2cc9b5"); - record.set("dark", "#2cc9b5"); - return record; - }()); - record.set("disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "rgba(44, 201, 181, 0.1)"); - record.set("dark", "rgba(44, 201, 181, 0.1)"); - return record; - }()); - record.set("focused", function () { - let record = fastn.recordInstance({}); - record.set("light", "#2cbfac"); - record.set("dark", "#2cbfac"); - return record; - }()); - record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#2b8074"); - record.set("dark", "#2b8074"); - return record; - }()); - record.set("border_disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#65b693"); - record.set("dark", "#65b693"); - return record; - }()); - record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#feffff"); - record.set("dark", "#feffff"); - return record; - }()); - record.set("text_disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#65b693"); - record.set("dark", "#65b693"); - return record; - }()); - return record; + return record; + }()); + record.set("custom", function () { + let record = fastn.recordInstance({ + }); + record.set("one", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#ed753a"); + record.set("dark", "#ed753a"); + return record; }()); - record.set("cta_secondary", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#4fb2df"); - record.set("dark", "#4fb2df"); - return record; - }()); - record.set("hover", function () { - let record = fastn.recordInstance({}); - record.set("light", "#40afe1"); - record.set("dark", "#40afe1"); - return record; - }()); - record.set("pressed", function () { - let record = fastn.recordInstance({}); - record.set("light", "#4fb2df"); - record.set("dark", "#4fb2df"); - return record; - }()); - record.set("disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "rgba(79, 178, 223, 0.1)"); - record.set("dark", "rgba(79, 178, 223, 0.1)"); - return record; - }()); - record.set("focused", function () { - let record = fastn.recordInstance({}); - record.set("light", "#4fb1df"); - record.set("dark", "#4fb1df"); - return record; - }()); - record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#209fdb"); - record.set("dark", "#209fdb"); - return record; - }()); - record.set("border_disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#65b693"); - record.set("dark", "#65b693"); - return record; - }()); - record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#584b42"); - record.set("dark", "#ffffff"); - return record; - }()); - record.set("text_disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#65b693"); - record.set("dark", "#65b693"); - return record; - }()); - return record; + record.set("two", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#f3db5f"); + record.set("dark", "#f3db5f"); + return record; }()); - record.set("cta_tertiary", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#556375"); - record.set("dark", "#556375"); - return record; - }()); - record.set("hover", function () { - let record = fastn.recordInstance({}); - record.set("light", "#c7cbd1"); - record.set("dark", "#c7cbd1"); - return record; - }()); - record.set("pressed", function () { - let record = fastn.recordInstance({}); - record.set("light", "#3b4047"); - record.set("dark", "#3b4047"); - return record; - }()); - record.set("disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "rgba(85, 99, 117, 0.1)"); - record.set("dark", "rgba(85, 99, 117, 0.1)"); - return record; - }()); - record.set("focused", function () { - let record = fastn.recordInstance({}); - record.set("light", "#e0e2e6"); - record.set("dark", "#e0e2e6"); - return record; - }()); - record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#e2e4e7"); - record.set("dark", "#e2e4e7"); - return record; - }()); - record.set("border_disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#65b693"); - record.set("dark", "#65b693"); - return record; - }()); - record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#ffffff"); - record.set("dark", "#ffffff"); - return record; - }()); - record.set("text_disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#65b693"); - record.set("dark", "#65b693"); - return record; - }()); - return record; + record.set("three", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#8fdcf8"); + record.set("dark", "#8fdcf8"); + return record; }()); - record.set("cta_danger", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#1C1B1F"); - record.set("dark", "#1C1B1F"); - return record; - }()); - record.set("hover", function () { - let record = fastn.recordInstance({}); - record.set("light", "#1C1B1F"); - record.set("dark", "#1C1B1F"); - return record; - }()); - record.set("pressed", function () { - let record = fastn.recordInstance({}); - record.set("light", "#1C1B1F"); - record.set("dark", "#1C1B1F"); - return record; - }()); - record.set("disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#1C1B1F"); - record.set("dark", "#1C1B1F"); - return record; - }()); - record.set("focused", function () { - let record = fastn.recordInstance({}); - record.set("light", "#1C1B1F"); - record.set("dark", "#1C1B1F"); - return record; - }()); - record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#1C1B1F"); - record.set("dark", "#1C1B1F"); - return record; - }()); - record.set("border_disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#feffff"); - record.set("dark", "#feffff"); - return record; - }()); - record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#1C1B1F"); - record.set("dark", "#1C1B1F"); - return record; - }()); - record.set("text_disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#feffff"); - record.set("dark", "#feffff"); - return record; - }()); - return record; + record.set("four", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#7a65c7"); + record.set("dark", "#7a65c7"); + return record; }()); - record.set("accent", function () { - let record = fastn.recordInstance({}); - record.set("primary", function () { - let record = fastn.recordInstance({}); - record.set("light", "#2dd4bf"); - record.set("dark", "#2dd4bf"); - return record; - }()); - record.set("secondary", function () { - let record = fastn.recordInstance({}); - record.set("light", "#4fb2df"); - record.set("dark", "#4fb2df"); - return record; - }()); - record.set("tertiary", function () { - let record = fastn.recordInstance({}); - record.set("light", "#c5cbd7"); - record.set("dark", "#c5cbd7"); - return record; - }()); - return record; + record.set("five", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#eb57be"); + record.set("dark", "#eb57be"); + return record; }()); - record.set("error", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#f5bdbb"); - record.set("dark", "#311b1f"); - return record; - }()); - record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#c62a21"); - record.set("dark", "#c62a21"); - return record; - }()); - record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#df2b2b"); - record.set("dark", "#df2b2b"); - return record; - }()); - return record; + record.set("six", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#ef8dd6"); + record.set("dark", "#ef8dd6"); + return record; }()); - record.set("success", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#e3f0c4"); - record.set("dark", "#405508ad"); - return record; - }()); - record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#467b28"); - record.set("dark", "#479f16"); - return record; - }()); - record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#3d741f"); - record.set("dark", "#3d741f"); - return record; - }()); - return record; + record.set("seven", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#7564be"); + record.set("dark", "#7564be"); + return record; }()); - record.set("info", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#c4edfd"); - record.set("dark", "#15223a"); - return record; - }()); - record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#205694"); - record.set("dark", "#1f6feb"); - return record; - }()); - record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#205694"); - record.set("dark", "#205694"); - return record; - }()); - return record; + record.set("eight", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#d554b3"); + record.set("dark", "#d554b3"); + return record; }()); - record.set("warning", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#fbefba"); - record.set("dark", "#544607a3"); - return record; - }()); - record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#966220"); - record.set("dark", "#d07f19"); - return record; - }()); - record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#966220"); - record.set("dark", "#966220"); - return record; - }()); - return record; + record.set("nine", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#ec8943"); + record.set("dark", "#ec8943"); + return record; }()); - record.set("custom", function () { - let record = fastn.recordInstance({}); - record.set("one", function () { - let record = fastn.recordInstance({}); - record.set("light", "#ed753a"); - record.set("dark", "#ed753a"); - return record; - }()); - record.set("two", function () { - let record = fastn.recordInstance({}); - record.set("light", "#f3db5f"); - record.set("dark", "#f3db5f"); - return record; - }()); - record.set("three", function () { - let record = fastn.recordInstance({}); - record.set("light", "#8fdcf8"); - record.set("dark", "#8fdcf8"); - return record; - }()); - record.set("four", function () { - let record = fastn.recordInstance({}); - record.set("light", "#7a65c7"); - record.set("dark", "#7a65c7"); - return record; - }()); - record.set("five", function () { - let record = fastn.recordInstance({}); - record.set("light", "#eb57be"); - record.set("dark", "#eb57be"); - return record; - }()); - record.set("six", function () { - let record = fastn.recordInstance({}); - record.set("light", "#ef8dd6"); - record.set("dark", "#ef8dd6"); - return record; - }()); - record.set("seven", function () { - let record = fastn.recordInstance({}); - record.set("light", "#7564be"); - record.set("dark", "#7564be"); - return record; - }()); - record.set("eight", function () { - let record = fastn.recordInstance({}); - record.set("light", "#d554b3"); - record.set("dark", "#d554b3"); - return record; - }()); - record.set("nine", function () { - let record = fastn.recordInstance({}); - record.set("light", "#ec8943"); - record.set("dark", "#ec8943"); - return record; - }()); - record.set("ten", function () { - let record = fastn.recordInstance({}); - record.set("light", "#da7a4a"); - record.set("dark", "#da7a4a"); - return record; - }()); - return record; + record.set("ten", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#da7a4a"); + record.set("dark", "#da7a4a"); + return record; }()); return record; + }()); + return record; }(); ftd.breakpoint_width = function () { - let record = fastn.recordInstance({}); - record.set("mobile", 768); - return record; + let record = fastn.recordInstance({ + }); + record.set("mobile", 768); + return record; }(); ftd.device = fastn.mutable(fastn_dom.DeviceData.Mobile); let inherited = function () { - let record = fastn.recordInstance({}); - record.set("colors", ftd.default_colors.getClone().setAndReturn("is_root", true)); - record.set("types", ftd.default_types.getClone().setAndReturn("is_root", true)); - return record; + let record = fastn.recordInstance({ + }); + record.set("colors", ftd.default_colors.getClone().setAndReturn("is_root", true)); + record.set("types", ftd.default_types.getClone().setAndReturn("is_root", true)); + return record; }(); diff --git a/fastn-core/fbt-tests/19-offline-build/output/default-374F1425D092AD7AA3896B514AC1A623828269A081B9738587078255BBA70379.js b/fastn-core/fbt-tests/19-offline-build/output/default-374F1425D092AD7AA3896B514AC1A623828269A081B9738587078255BBA70379.js index 4d49878966..5b2bc05b4c 100644 --- a/fastn-core/fbt-tests/19-offline-build/output/default-374F1425D092AD7AA3896B514AC1A623828269A081B9738587078255BBA70379.js +++ b/fastn-core/fbt-tests/19-offline-build/output/default-374F1425D092AD7AA3896B514AC1A623828269A081B9738587078255BBA70379.js @@ -108,1167 +108,7 @@ Prism.languages.ftd = { * https://github.com/markedjs/marked */ // Content taken from https://cdn.jsdelivr.net/npm/marked/marked.min.js -!function (e, t) { - "object" == typeof exports && "undefined" != typeof module ? t(exports) : "function" == typeof define && define.amd ? define(["exports"], t) : t((e = "undefined" != typeof globalThis ? globalThis : e || self).marked = {}) -}(this, (function (e) { - "use strict"; - - function t() { - return { - async: !1, - breaks: !1, - extensions: null, - gfm: !0, - hooks: null, - pedantic: !1, - renderer: null, - silent: !1, - tokenizer: null, - walkTokens: null - } - } - - function n(t) { - e.defaults = t - } - - e.defaults = { - async: !1, - breaks: !1, - extensions: null, - gfm: !0, - hooks: null, - pedantic: !1, - renderer: null, - silent: !1, - tokenizer: null, - walkTokens: null - }; - const s = /[&<>"']/, r = new RegExp(s.source, "g"), i = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, - l = new RegExp(i.source, "g"), o = {"&": "&", "<": "<", ">": ">", '"': """, "'": "'"}, - a = e => o[e]; - - function c(e, t) { - if (t) { - if (s.test(e)) return e.replace(r, a) - } else if (i.test(e)) return e.replace(l, a); - return e - } - - const h = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi; - const p = /(^|[^\[])\^/g; - - function u(e, t) { - e = "string" == typeof e ? e : e.source, t = t || ""; - const n = { - replace: (t, s) => (s = (s = "object" == typeof s && "source" in s ? s.source : s).replace(p, "$1"), e = e.replace(t, s), n), - getRegex: () => new RegExp(e, t) - }; - return n - } - - function g(e) { - try { - e = encodeURI(e).replace(/%25/g, "%") - } catch (e) { - return null - } - return e - } - - const k = {exec: () => null}; - - function f(e, t) { - const n = e.replace(/\|/g, ((e, t, n) => { - let s = !1, r = t; - for (; --r >= 0 && "\\" === n[r];) s = !s; - return s ? "|" : " |" - })).split(/ \|/); - let s = 0; - if (n[0].trim() || n.shift(), n.length > 0 && !n[n.length - 1].trim() && n.pop(), t) if (n.length > t) n.splice(t); else for (; n.length < t;) n.push(""); - for (; s < n.length; s++) n[s] = n[s].trim().replace(/\\\|/g, "|"); - return n - } - - function d(e, t, n) { - const s = e.length; - if (0 === s) return ""; - let r = 0; - for (; r < s;) { - const i = e.charAt(s - r - 1); - if (i !== t || n) { - if (i === t || !n) break; - r++ - } else r++ - } - return e.slice(0, s - r) - } - - function x(e, t, n, s) { - const r = t.href, i = t.title ? c(t.title) : null, l = e[1].replace(/\\([\[\]])/g, "$1"); - if ("!" !== e[0].charAt(0)) { - s.state.inLink = !0; - const e = {type: "link", raw: n, href: r, title: i, text: l, tokens: s.inlineTokens(l)}; - return s.state.inLink = !1, e - } - return {type: "image", raw: n, href: r, title: i, text: c(l)} - } - - class b { - options; - rules; - lexer; - - constructor(t) { - this.options = t || e.defaults - } - - space(e) { - const t = this.rules.block.newline.exec(e); - if (t && t[0].length > 0) return {type: "space", raw: t[0]} - } - - code(e) { - const t = this.rules.block.code.exec(e); - if (t) { - const e = t[0].replace(/^ {1,4}/gm, ""); - return { - type: "code", - raw: t[0], - codeBlockStyle: "indented", - text: this.options.pedantic ? e : d(e, "\n") - } - } - } - - fences(e) { - const t = this.rules.block.fences.exec(e); - if (t) { - const e = t[0], n = function (e, t) { - const n = e.match(/^(\s+)(?:```)/); - if (null === n) return t; - const s = n[1]; - return t.split("\n").map((e => { - const t = e.match(/^\s+/); - if (null === t) return e; - const [n] = t; - return n.length >= s.length ? e.slice(s.length) : e - })).join("\n") - }(e, t[3] || ""); - return { - type: "code", - raw: e, - lang: t[2] ? t[2].trim().replace(this.rules.inline._escapes, "$1") : t[2], - text: n - } - } - } - - heading(e) { - const t = this.rules.block.heading.exec(e); - if (t) { - let e = t[2].trim(); - if (/#$/.test(e)) { - const t = d(e, "#"); - this.options.pedantic ? e = t.trim() : t && !/ $/.test(t) || (e = t.trim()) - } - return {type: "heading", raw: t[0], depth: t[1].length, text: e, tokens: this.lexer.inline(e)} - } - } - - hr(e) { - const t = this.rules.block.hr.exec(e); - if (t) return {type: "hr", raw: t[0]} - } - - blockquote(e) { - const t = this.rules.block.blockquote.exec(e); - if (t) { - const e = d(t[0].replace(/^ *>[ \t]?/gm, ""), "\n"), n = this.lexer.state.top; - this.lexer.state.top = !0; - const s = this.lexer.blockTokens(e); - return this.lexer.state.top = n, {type: "blockquote", raw: t[0], tokens: s, text: e} - } - } - - list(e) { - let t = this.rules.block.list.exec(e); - if (t) { - let n = t[1].trim(); - const s = n.length > 1, - r = {type: "list", raw: "", ordered: s, start: s ? +n.slice(0, -1) : "", loose: !1, items: []}; - n = s ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = s ? n : "[*+-]"); - const i = new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`); - let l = "", o = "", a = !1; - for (; e;) { - let n = !1; - if (!(t = i.exec(e))) break; - if (this.rules.block.hr.test(e)) break; - l = t[0], e = e.substring(l.length); - let s = t[2].split("\n", 1)[0].replace(/^\t+/, (e => " ".repeat(3 * e.length))), - c = e.split("\n", 1)[0], h = 0; - this.options.pedantic ? (h = 2, o = s.trimStart()) : (h = t[2].search(/[^ ]/), h = h > 4 ? 1 : h, o = s.slice(h), h += t[1].length); - let p = !1; - if (!s && /^ *$/.test(c) && (l += c + "\n", e = e.substring(c.length + 1), n = !0), !n) { - const t = new RegExp(`^ {0,${Math.min(3,h-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`), - n = new RegExp(`^ {0,${Math.min(3,h-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), - r = new RegExp(`^ {0,${Math.min(3,h-1)}}(?:\`\`\`|~~~)`), - i = new RegExp(`^ {0,${Math.min(3,h-1)}}#`); - for (; e;) { - const a = e.split("\n", 1)[0]; - if (c = a, this.options.pedantic && (c = c.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ")), r.test(c)) break; - if (i.test(c)) break; - if (t.test(c)) break; - if (n.test(e)) break; - if (c.search(/[^ ]/) >= h || !c.trim()) o += "\n" + c.slice(h); else { - if (p) break; - if (s.search(/[^ ]/) >= 4) break; - if (r.test(s)) break; - if (i.test(s)) break; - if (n.test(s)) break; - o += "\n" + c - } - p || c.trim() || (p = !0), l += a + "\n", e = e.substring(a.length + 1), s = c.slice(h) - } - } - r.loose || (a ? r.loose = !0 : /\n *\n *$/.test(l) && (a = !0)); - let u, g = null; - this.options.gfm && (g = /^\[[ xX]\] /.exec(o), g && (u = "[ ] " !== g[0], o = o.replace(/^\[[ xX]\] +/, ""))), r.items.push({ - type: "list_item", - raw: l, - task: !!g, - checked: u, - loose: !1, - text: o, - tokens: [] - }), r.raw += l - } - r.items[r.items.length - 1].raw = l.trimEnd(), r.items[r.items.length - 1].text = o.trimEnd(), r.raw = r.raw.trimEnd(); - for (let e = 0; e < r.items.length; e++) if (this.lexer.state.top = !1, r.items[e].tokens = this.lexer.blockTokens(r.items[e].text, []), !r.loose) { - const t = r.items[e].tokens.filter((e => "space" === e.type)), - n = t.length > 0 && t.some((e => /\n.*\n/.test(e.raw))); - r.loose = n - } - if (r.loose) for (let e = 0; e < r.items.length; e++) r.items[e].loose = !0; - return r - } - } - - html(e) { - const t = this.rules.block.html.exec(e); - if (t) { - return { - type: "html", - block: !0, - raw: t[0], - pre: "pre" === t[1] || "script" === t[1] || "style" === t[1], - text: t[0] - } - } - } - - def(e) { - const t = this.rules.block.def.exec(e); - if (t) { - const e = t[1].toLowerCase().replace(/\s+/g, " "), - n = t[2] ? t[2].replace(/^<(.*)>$/, "$1").replace(this.rules.inline._escapes, "$1") : "", - s = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline._escapes, "$1") : t[3]; - return {type: "def", tag: e, raw: t[0], href: n, title: s} - } - } - - table(e) { - const t = this.rules.block.table.exec(e); - if (t) { - if (!/[:|]/.test(t[2])) return; - const e = { - type: "table", - raw: t[0], - header: f(t[1]).map((e => ({text: e, tokens: []}))), - align: t[2].replace(/^\||\| *$/g, "").split("|"), - rows: t[3] && t[3].trim() ? t[3].replace(/\n[ \t]*$/, "").split("\n") : [] - }; - if (e.header.length === e.align.length) { - let t, n, s, r, i = e.align.length; - for (t = 0; t < i; t++) { - const n = e.align[t]; - n && (/^ *-+: *$/.test(n) ? e.align[t] = "right" : /^ *:-+: *$/.test(n) ? e.align[t] = "center" : /^ *:-+ *$/.test(n) ? e.align[t] = "left" : e.align[t] = null) - } - for (i = e.rows.length, t = 0; t < i; t++) e.rows[t] = f(e.rows[t], e.header.length).map((e => ({ - text: e, - tokens: [] - }))); - for (i = e.header.length, n = 0; n < i; n++) e.header[n].tokens = this.lexer.inline(e.header[n].text); - for (i = e.rows.length, n = 0; n < i; n++) for (r = e.rows[n], s = 0; s < r.length; s++) r[s].tokens = this.lexer.inline(r[s].text); - return e - } - } - } - - lheading(e) { - const t = this.rules.block.lheading.exec(e); - if (t) return { - type: "heading", - raw: t[0], - depth: "=" === t[2].charAt(0) ? 1 : 2, - text: t[1], - tokens: this.lexer.inline(t[1]) - } - } - - paragraph(e) { - const t = this.rules.block.paragraph.exec(e); - if (t) { - const e = "\n" === t[1].charAt(t[1].length - 1) ? t[1].slice(0, -1) : t[1]; - return {type: "paragraph", raw: t[0], text: e, tokens: this.lexer.inline(e)} - } - } - - text(e) { - const t = this.rules.block.text.exec(e); - if (t) return {type: "text", raw: t[0], text: t[0], tokens: this.lexer.inline(t[0])} - } - - escape(e) { - const t = this.rules.inline.escape.exec(e); - if (t) return {type: "escape", raw: t[0], text: c(t[1])} - } - - tag(e) { - const t = this.rules.inline.tag.exec(e); - if (t) return !this.lexer.state.inLink && /^
    /i.test(t[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(t[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0]) && (this.lexer.state.inRawBlock = !1), { - type: "html", - raw: t[0], - inLink: this.lexer.state.inLink, - inRawBlock: this.lexer.state.inRawBlock, - block: !1, - text: t[0] - } - } - - link(e) { - const t = this.rules.inline.link.exec(e); - if (t) { - const e = t[2].trim(); - if (!this.options.pedantic && /^$/.test(e)) return; - const t = d(e.slice(0, -1), "\\"); - if ((e.length - t.length) % 2 == 0) return - } else { - const e = function (e, t) { - if (-1 === e.indexOf(t[1])) return -1; - let n = 0; - for (let s = 0; s < e.length; s++) if ("\\" === e[s]) s++; else if (e[s] === t[0]) n++; else if (e[s] === t[1] && (n--, n < 0)) return s; - return -1 - }(t[2], "()"); - if (e > -1) { - const n = (0 === t[0].indexOf("!") ? 5 : 4) + t[1].length + e; - t[2] = t[2].substring(0, e), t[0] = t[0].substring(0, n).trim(), t[3] = "" - } - } - let n = t[2], s = ""; - if (this.options.pedantic) { - const e = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n); - e && (n = e[1], s = e[3]) - } else s = t[3] ? t[3].slice(1, -1) : ""; - return n = n.trim(), /^$/.test(e) ? n.slice(1) : n.slice(1, -1)), x(t, { - href: n ? n.replace(this.rules.inline._escapes, "$1") : n, - title: s ? s.replace(this.rules.inline._escapes, "$1") : s - }, t[0], this.lexer) - } - } - - reflink(e, t) { - let n; - if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) { - let e = (n[2] || n[1]).replace(/\s+/g, " "); - if (e = t[e.toLowerCase()], !e) { - const e = n[0].charAt(0); - return {type: "text", raw: e, text: e} - } - return x(n, e, n[0], this.lexer) - } - } - - emStrong(e, t, n = "") { - let s = this.rules.inline.emStrong.lDelim.exec(e); - if (!s) return; - if (s[3] && n.match(/[\p{L}\p{N}]/u)) return; - if (!(s[1] || s[2] || "") || !n || this.rules.inline.punctuation.exec(n)) { - const n = [...s[0]].length - 1; - let r, i, l = n, o = 0; - const a = "*" === s[0][0] ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd; - for (a.lastIndex = 0, t = t.slice(-1 * e.length + s[0].length - 1); null != (s = a.exec(t));) { - if (r = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !r) continue; - if (i = [...r].length, s[3] || s[4]) { - l += i; - continue - } - if ((s[5] || s[6]) && n % 3 && !((n + i) % 3)) { - o += i; - continue - } - if (l -= i, l > 0) continue; - i = Math.min(i, i + l + o); - const t = [...e].slice(0, n + s.index + i + 1).join(""); - if (Math.min(n, i) % 2) { - const e = t.slice(1, -1); - return {type: "em", raw: t, text: e, tokens: this.lexer.inlineTokens(e)} - } - const a = t.slice(2, -2); - return {type: "strong", raw: t, text: a, tokens: this.lexer.inlineTokens(a)} - } - } - } - - codespan(e) { - const t = this.rules.inline.code.exec(e); - if (t) { - let e = t[2].replace(/\n/g, " "); - const n = /[^ ]/.test(e), s = /^ /.test(e) && / $/.test(e); - return n && s && (e = e.substring(1, e.length - 1)), e = c(e, !0), { - type: "codespan", - raw: t[0], - text: e - } - } - } - - br(e) { - const t = this.rules.inline.br.exec(e); - if (t) return {type: "br", raw: t[0]} - } - - del(e) { - const t = this.rules.inline.del.exec(e); - if (t) return {type: "del", raw: t[0], text: t[2], tokens: this.lexer.inlineTokens(t[2])} - } - - autolink(e) { - const t = this.rules.inline.autolink.exec(e); - if (t) { - let e, n; - return "@" === t[2] ? (e = c(t[1]), n = "mailto:" + e) : (e = c(t[1]), n = e), { - type: "link", - raw: t[0], - text: e, - href: n, - tokens: [{type: "text", raw: e, text: e}] - } - } - } - - url(e) { - let t; - if (t = this.rules.inline.url.exec(e)) { - let e, n; - if ("@" === t[2]) e = c(t[0]), n = "mailto:" + e; else { - let s; - do { - s = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])[0] - } while (s !== t[0]); - e = c(t[0]), n = "www." === t[1] ? "http://" + t[0] : t[0] - } - return {type: "link", raw: t[0], text: e, href: n, tokens: [{type: "text", raw: e, text: e}]} - } - } - - inlineText(e) { - const t = this.rules.inline.text.exec(e); - if (t) { - let e; - return e = this.lexer.state.inRawBlock ? t[0] : c(t[0]), {type: "text", raw: t[0], text: e} - } - } - } - - const m = { - 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]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))", - def: /^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/, - table: k, - lheading: /^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, - _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, - text: /^[^\n]+/, - _label: /(?!\s*\])(?:\\.|[^\[\]\\])+/, - _title: /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/ - }; - m.def = u(m.def).replace("label", m._label).replace("title", m._title).getRegex(), m.bullet = /(?:[*+-]|\d{1,9}[.)])/, m.listItemStart = u(/^( *)(bull) */).replace("bull", m.bullet).getRegex(), m.list = u(m.list).replace(/bull/g, m.bullet).replace("hr", "\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def", "\\n+(?=" + m.def.source + ")").getRegex(), m._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", m._comment = /|$)/, m.html = u(m.html, "i").replace("comment", m._comment).replace("tag", m._tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), m.lheading = u(m.lheading).replace(/bull/g, m.bullet).getRegex(), m.paragraph = u(m._paragraph).replace("hr", m.hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").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", ")|<(?:script|pre|style|textarea|!--)").replace("tag", m._tag).getRegex(), m.blockquote = u(m.blockquote).replace("paragraph", m.paragraph).getRegex(), m.normal = {...m}, m.gfm = { - ...m.normal, - table: "^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)" - }, m.gfm.table = u(m.gfm.table).replace("hr", m.hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").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", ")|<(?:script|pre|style|textarea|!--)").replace("tag", m._tag).getRegex(), m.gfm.paragraph = u(m._paragraph).replace("hr", m.hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", m.gfm.table).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", ")|<(?:script|pre|style|textarea|!--)").replace("tag", m._tag).getRegex(), m.pedantic = { - ...m.normal, - html: u("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", m._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: /^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, - heading: /^(#{1,6})(.*)(?:\n+|$)/, - fences: k, - lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, - paragraph: u(m.normal._paragraph).replace("hr", m.hr).replace("heading", " *#{1,6} *[^\n]").replace("lheading", m.lheading).replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").getRegex() - }; - const w = { - escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, - autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/, - url: k, - tag: "^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^", - link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/, - reflink: /^!?\[(label)\]\[(ref)\]/, - nolink: /^!?\[(ref)\](?:\[\])?/, - reflinkSearch: "reflink|nolink(?!\\()", - emStrong: { - lDelim: /^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, - 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])/ - }, - code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, - br: /^( {2,}|\\)\n(?!\s*$)/, - del: k, - text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`^|~" - }; - w.punctuation = u(w.punctuation, "u").replace(/punctuation/g, w._punctuation).getRegex(), w.blockSkip = /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g, w.anyPunctuation = /\\[punct]/g, w._escapes = /\\([punct])/g, w._comment = u(m._comment).replace("(?:--\x3e|$)", "--\x3e").getRegex(), w.emStrong.lDelim = u(w.emStrong.lDelim, "u").replace(/punct/g, w._punctuation).getRegex(), w.emStrong.rDelimAst = u(w.emStrong.rDelimAst, "gu").replace(/punct/g, w._punctuation).getRegex(), w.emStrong.rDelimUnd = u(w.emStrong.rDelimUnd, "gu").replace(/punct/g, w._punctuation).getRegex(), w.anyPunctuation = u(w.anyPunctuation, "gu").replace(/punct/g, w._punctuation).getRegex(), w._escapes = u(w._escapes, "gu").replace(/punct/g, w._punctuation).getRegex(), w._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/, w._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])?)+(?![-_])/, w.autolink = u(w.autolink).replace("scheme", w._scheme).replace("email", w._email).getRegex(), w._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/, w.tag = u(w.tag).replace("comment", w._comment).replace("attribute", w._attribute).getRegex(), w._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, w._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/, w._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/, w.link = u(w.link).replace("label", w._label).replace("href", w._href).replace("title", w._title).getRegex(), w.reflink = u(w.reflink).replace("label", w._label).replace("ref", m._label).getRegex(), w.nolink = u(w.nolink).replace("ref", m._label).getRegex(), w.reflinkSearch = u(w.reflinkSearch, "g").replace("reflink", w.reflink).replace("nolink", w.nolink).getRegex(), w.normal = {...w}, w.pedantic = { - ...w.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: u(/^!?\[(label)\]\((.*?)\)/).replace("label", w._label).getRegex(), - reflink: u(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", w._label).getRegex() - }, w.gfm = { - ...w.normal, - escape: u(w.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]*?(?:(?=[\\ t + " ".repeat(n.length))); e;) if (!(this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((s => !!(n = s.call({lexer: this}, e, t)) && (e = e.substring(n.raw.length), t.push(n), !0))))) if (n = this.tokenizer.space(e)) e = e.substring(n.raw.length), 1 === n.raw.length && t.length > 0 ? t[t.length - 1].raw += "\n" : t.push(n); else if (n = this.tokenizer.code(e)) e = e.substring(n.raw.length), s = t[t.length - 1], !s || "paragraph" !== s.type && "text" !== s.type ? t.push(n) : (s.raw += "\n" + n.raw, s.text += "\n" + n.text, this.inlineQueue[this.inlineQueue.length - 1].src = s.text); else if (n = this.tokenizer.fences(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.heading(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.hr(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.blockquote(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.list(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.html(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.def(e)) e = e.substring(n.raw.length), s = t[t.length - 1], !s || "paragraph" !== s.type && "text" !== s.type ? this.tokens.links[n.tag] || (this.tokens.links[n.tag] = { - href: n.href, - title: n.title - }) : (s.raw += "\n" + n.raw, s.text += "\n" + n.raw, this.inlineQueue[this.inlineQueue.length - 1].src = s.text); else if (n = this.tokenizer.table(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.lheading(e)) e = e.substring(n.raw.length), t.push(n); else { - if (r = e, this.options.extensions && this.options.extensions.startBlock) { - let t = 1 / 0; - const n = e.slice(1); - let s; - this.options.extensions.startBlock.forEach((e => { - s = e.call({lexer: this}, n), "number" == typeof s && s >= 0 && (t = Math.min(t, s)) - })), t < 1 / 0 && t >= 0 && (r = e.substring(0, t + 1)) - } - if (this.state.top && (n = this.tokenizer.paragraph(r))) s = t[t.length - 1], i && "paragraph" === s.type ? (s.raw += "\n" + n.raw, s.text += "\n" + n.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = s.text) : t.push(n), i = r.length !== e.length, e = e.substring(n.raw.length); else if (n = this.tokenizer.text(e)) e = e.substring(n.raw.length), s = t[t.length - 1], s && "text" === s.type ? (s.raw += "\n" + n.raw, s.text += "\n" + n.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = s.text) : t.push(n); else if (e) { - const t = "Infinite loop on byte: " + e.charCodeAt(0); - if (this.options.silent) { - console.error(t); - break - } - throw new Error(t) - } - } - return this.state.top = !0, t - } - - inline(e, t = []) { - return this.inlineQueue.push({src: e, tokens: t}), t - } - - inlineTokens(e, t = []) { - let n, s, r, i, l, o, a = e; - if (this.tokens.links) { - const e = Object.keys(this.tokens.links); - if (e.length > 0) for (; null != (i = this.tokenizer.rules.inline.reflinkSearch.exec(a));) e.includes(i[0].slice(i[0].lastIndexOf("[") + 1, -1)) && (a = a.slice(0, i.index) + "[" + "a".repeat(i[0].length - 2) + "]" + a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex)) - } - for (; null != (i = this.tokenizer.rules.inline.blockSkip.exec(a));) a = a.slice(0, i.index) + "[" + "a".repeat(i[0].length - 2) + "]" + a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex); - for (; null != (i = this.tokenizer.rules.inline.anyPunctuation.exec(a));) a = a.slice(0, i.index) + "++" + a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex); - for (; e;) if (l || (o = ""), l = !1, !(this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((s => !!(n = s.call({lexer: this}, e, t)) && (e = e.substring(n.raw.length), t.push(n), !0))))) if (n = this.tokenizer.escape(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.tag(e)) e = e.substring(n.raw.length), s = t[t.length - 1], s && "text" === n.type && "text" === s.type ? (s.raw += n.raw, s.text += n.text) : t.push(n); else if (n = this.tokenizer.link(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.reflink(e, this.tokens.links)) e = e.substring(n.raw.length), s = t[t.length - 1], s && "text" === n.type && "text" === s.type ? (s.raw += n.raw, s.text += n.text) : t.push(n); else if (n = this.tokenizer.emStrong(e, a, o)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.codespan(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.br(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.del(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.autolink(e)) e = e.substring(n.raw.length), t.push(n); else if (this.state.inLink || !(n = this.tokenizer.url(e))) { - if (r = e, this.options.extensions && this.options.extensions.startInline) { - let t = 1 / 0; - const n = e.slice(1); - let s; - this.options.extensions.startInline.forEach((e => { - s = e.call({lexer: this}, n), "number" == typeof s && s >= 0 && (t = Math.min(t, s)) - })), t < 1 / 0 && t >= 0 && (r = e.substring(0, t + 1)) - } - if (n = this.tokenizer.inlineText(r)) e = e.substring(n.raw.length), "_" !== n.raw.slice(-1) && (o = n.raw.slice(-1)), l = !0, s = t[t.length - 1], s && "text" === s.type ? (s.raw += n.raw, s.text += n.text) : t.push(n); else if (e) { - const t = "Infinite loop on byte: " + e.charCodeAt(0); - if (this.options.silent) { - console.error(t); - break - } - throw new Error(t) - } - } else e = e.substring(n.raw.length), t.push(n); - return t - } - } - - class y { - options; - - constructor(t) { - this.options = t || e.defaults - } - - code(e, t, n) { - const s = (t || "").match(/^\S*/)?.[0]; - return e = e.replace(/\n$/, "") + "\n", s ? '
    ' + (n ? e : c(e, !0)) + "
    \n" : "
    " + (n ? e : c(e, !0)) + "
    \n" - } - - blockquote(e) { - return `
    \n${e}
    \n` - } - - html(e, t) { - return e - } - - heading(e, t, n) { - return `${e}\n` - } - - hr() { - return "
    \n" - } - - list(e, t, n) { - const s = t ? "ol" : "ul"; - return "<" + s + (t && 1 !== n ? ' start="' + n + '"' : "") + ">\n" + e + "\n" - } - - listitem(e, t, n) { - return `
  • ${e}
  • \n` - } - - checkbox(e) { - return "' - } - - paragraph(e) { - return `

    ${e}

    \n` - } - - table(e, t) { - return t && (t = `${t}`), "\n\n" + e + "\n" + t + "
    \n" - } - - tablerow(e) { - return `\n${e}\n` - } - - tablecell(e, t) { - const n = t.header ? "th" : "td"; - return (t.align ? `<${n} align="${t.align}">` : `<${n}>`) + e + `\n` - } - - strong(e) { - return `${e}` - } - - em(e) { - return `${e}` - } - - codespan(e) { - return `${e}` - } - - br() { - return "
    " - } - - del(e) { - return `${e}` - } - - link(e, t, n) { - const s = g(e); - if (null === s) return n; - let r = '
    ", r - } - - image(e, t, n) { - const s = g(e); - if (null === s) return n; - let r = `${n} "colon" === (t = t.toLowerCase()) ? ":" : "#" === t.charAt(0) ? "x" === t.charAt(1) ? String.fromCharCode(parseInt(t.substring(2), 16)) : String.fromCharCode(+t.substring(1)) : ""))); - continue - } - case"code": { - const e = r; - n += this.renderer.code(e.text, e.lang, !!e.escaped); - continue - } - case"table": { - const e = r; - let t = "", s = ""; - for (let t = 0; t < e.header.length; t++) s += this.renderer.tablecell(this.parseInline(e.header[t].tokens), { - header: !0, - align: e.align[t] - }); - t += this.renderer.tablerow(s); - let i = ""; - for (let t = 0; t < e.rows.length; t++) { - const n = e.rows[t]; - s = ""; - for (let t = 0; t < n.length; t++) s += this.renderer.tablecell(this.parseInline(n[t].tokens), { - header: !1, - align: e.align[t] - }); - i += this.renderer.tablerow(s) - } - n += this.renderer.table(t, i); - continue - } - case"blockquote": { - const e = r, t = this.parse(e.tokens); - n += this.renderer.blockquote(t); - continue - } - case"list": { - const e = r, t = e.ordered, s = e.start, i = e.loose; - let l = ""; - for (let t = 0; t < e.items.length; t++) { - const n = e.items[t], s = n.checked, r = n.task; - let o = ""; - if (n.task) { - const e = this.renderer.checkbox(!!s); - i ? n.tokens.length > 0 && "paragraph" === n.tokens[0].type ? (n.tokens[0].text = e + " " + n.tokens[0].text, n.tokens[0].tokens && n.tokens[0].tokens.length > 0 && "text" === n.tokens[0].tokens[0].type && (n.tokens[0].tokens[0].text = e + " " + n.tokens[0].tokens[0].text)) : n.tokens.unshift({ - type: "text", - text: e + " " - }) : o += e + " " - } - o += this.parse(n.tokens, i), l += this.renderer.listitem(o, r, !!s) - } - n += this.renderer.list(l, t, s); - continue - } - case"html": { - const e = r; - n += this.renderer.html(e.text, e.block); - continue - } - case"paragraph": { - const e = r; - n += this.renderer.paragraph(this.parseInline(e.tokens)); - continue - } - case"text": { - let i = r, l = i.tokens ? this.parseInline(i.tokens) : i.text; - for (; s + 1 < e.length && "text" === e[s + 1].type;) i = e[++s], l += "\n" + (i.tokens ? this.parseInline(i.tokens) : i.text); - n += t ? this.renderer.paragraph(l) : l; - continue - } - default: { - const e = 'Token with "' + r.type + '" type was not found.'; - if (this.options.silent) return console.error(e), ""; - throw new Error(e) - } - } - } - return n - } - - parseInline(e, t) { - t = t || this.renderer; - let n = ""; - for (let s = 0; s < e.length; s++) { - const r = e[s]; - if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[r.type]) { - const e = this.options.extensions.renderers[r.type].call({parser: this}, r); - if (!1 !== e || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(r.type)) { - n += e || ""; - continue - } - } - switch (r.type) { - case"escape": { - const e = r; - n += t.text(e.text); - break - } - case"html": { - const e = r; - n += t.html(e.text); - break - } - case"link": { - const e = r; - n += t.link(e.href, e.title, this.parseInline(e.tokens, t)); - break - } - case"image": { - const e = r; - n += t.image(e.href, e.title, e.text); - break - } - case"strong": { - const e = r; - n += t.strong(this.parseInline(e.tokens, t)); - break - } - case"em": { - const e = r; - n += t.em(this.parseInline(e.tokens, t)); - break - } - case"codespan": { - const e = r; - n += t.codespan(e.text); - break - } - case"br": - n += t.br(); - break; - case"del": { - const e = r; - n += t.del(this.parseInline(e.tokens, t)); - break - } - case"text": { - const e = r; - n += t.text(e.text); - break - } - default: { - const e = 'Token with "' + r.type + '" type was not found.'; - if (this.options.silent) return console.error(e), ""; - throw new Error(e) - } - } - } - return n - } - } - - class T { - options; - - constructor(t) { - this.options = t || e.defaults - } - - static passThroughHooks = new Set(["preprocess", "postprocess"]); - - preprocess(e) { - return e - } - - postprocess(e) { - return e - } - } - - class R { - defaults = { - async: !1, - breaks: !1, - extensions: null, - gfm: !0, - hooks: null, - pedantic: !1, - renderer: null, - silent: !1, - tokenizer: null, - walkTokens: null - }; - options = this.setOptions; - parse = this.#e(_.lex, z.parse); - parseInline = this.#e(_.lexInline, z.parseInline); - Parser = z; - parser = z.parse; - Renderer = y; - TextRenderer = $; - Lexer = _; - lexer = _.lex; - Tokenizer = b; - Hooks = T; - - constructor(...e) { - this.use(...e) - } - - walkTokens(e, t) { - let n = []; - for (const s of e) switch (n = n.concat(t.call(this, s)), s.type) { - case"table": { - const e = s; - for (const s of e.header) n = n.concat(this.walkTokens(s.tokens, t)); - for (const s of e.rows) for (const e of s) n = n.concat(this.walkTokens(e.tokens, t)); - break - } - case"list": { - const e = s; - n = n.concat(this.walkTokens(e.items, t)); - break - } - default: { - const e = s; - this.defaults.extensions?.childTokens?.[e.type] ? this.defaults.extensions.childTokens[e.type].forEach((s => { - n = n.concat(this.walkTokens(e[s], t)) - })) : e.tokens && (n = n.concat(this.walkTokens(e.tokens, t))) - } - } - return n - } - - use(...e) { - const t = this.defaults.extensions || {renderers: {}, childTokens: {}}; - return e.forEach((e => { - const n = {...e}; - if (n.async = this.defaults.async || n.async || !1, e.extensions && (e.extensions.forEach((e => { - if (!e.name) throw new Error("extension name required"); - if ("renderer" in e) { - const n = t.renderers[e.name]; - t.renderers[e.name] = n ? function (...t) { - let s = e.renderer.apply(this, t); - return !1 === s && (s = n.apply(this, t)), s - } : e.renderer - } - if ("tokenizer" in e) { - if (!e.level || "block" !== e.level && "inline" !== e.level) throw new Error("extension level must be 'block' or 'inline'"); - const n = t[e.level]; - n ? n.unshift(e.tokenizer) : t[e.level] = [e.tokenizer], e.start && ("block" === e.level ? t.startBlock ? t.startBlock.push(e.start) : t.startBlock = [e.start] : "inline" === e.level && (t.startInline ? t.startInline.push(e.start) : t.startInline = [e.start])) - } - "childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens) - })), n.extensions = t), e.renderer) { - const t = this.defaults.renderer || new y(this.defaults); - for (const n in e.renderer) { - const s = e.renderer[n], r = n, i = t[r]; - t[r] = (...e) => { - let n = s.apply(t, e); - return !1 === n && (n = i.apply(t, e)), n || "" - } - } - n.renderer = t - } - if (e.tokenizer) { - const t = this.defaults.tokenizer || new b(this.defaults); - for (const n in e.tokenizer) { - const s = e.tokenizer[n], r = n, i = t[r]; - t[r] = (...e) => { - let n = s.apply(t, e); - return !1 === n && (n = i.apply(t, e)), n - } - } - n.tokenizer = t - } - if (e.hooks) { - const t = this.defaults.hooks || new T; - for (const n in e.hooks) { - const s = e.hooks[n], r = n, i = t[r]; - T.passThroughHooks.has(n) ? t[r] = e => { - if (this.defaults.async) return Promise.resolve(s.call(t, e)).then((e => i.call(t, e))); - const n = s.call(t, e); - return i.call(t, n) - } : t[r] = (...e) => { - let n = s.apply(t, e); - return !1 === n && (n = i.apply(t, e)), n - } - } - n.hooks = t - } - if (e.walkTokens) { - const t = this.defaults.walkTokens, s = e.walkTokens; - n.walkTokens = function (e) { - let n = []; - return n.push(s.call(this, e)), t && (n = n.concat(t.call(this, e))), n - } - } - this.defaults = {...this.defaults, ...n} - })), this - } - - setOptions(e) { - return this.defaults = {...this.defaults, ...e}, this - } - - #e(e, t) { - return (n, s) => { - const r = {...s}, i = {...this.defaults, ...r}; - !0 === this.defaults.async && !1 === r.async && (i.silent || console.warn("marked(): The async option was set to true by an extension. The async: false option sent to unresolved will be ignored."), i.async = !0); - const l = this.#t(!!i.silent, !!i.async); - if (null == n) return l(new Error("marked(): input parameter is undefined or null")); - if ("string" != typeof n) return l(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected")); - if (i.hooks && (i.hooks.options = i), i.async) return Promise.resolve(i.hooks ? i.hooks.preprocess(n) : n).then((t => e(t, i))).then((e => i.walkTokens ? Promise.all(this.walkTokens(e, i.walkTokens)).then((() => e)) : e)).then((e => t(e, i))).then((e => i.hooks ? i.hooks.postprocess(e) : e)).catch(l); - try { - i.hooks && (n = i.hooks.preprocess(n)); - const s = e(n, i); - i.walkTokens && this.walkTokens(s, i.walkTokens); - let r = t(s, i); - return i.hooks && (r = i.hooks.postprocess(r)), r - } catch (e) { - return l(e) - } - } - } - - #t(e, t) { - return n => { - if (n.message += "\nPlease report this to https://github.com/markedjs/marked.", e) { - const e = "

    An error occurred:

    " + c(n.message + "", !0) + "
    "; - return t ? Promise.resolve(e) : e - } - if (t) return Promise.reject(n); - throw n - } - } - } - - const S = new R; - - function A(e, t) { - return S.parse(e, t) - } - - A.options = A.setOptions = function (e) { - return S.setOptions(e), A.defaults = S.defaults, n(A.defaults), A - }, A.getDefaults = t, A.defaults = e.defaults, A.use = function (...e) { - return S.use(...e), A.defaults = S.defaults, n(A.defaults), A - }, A.walkTokens = function (e, t) { - return S.walkTokens(e, t) - }, A.parseInline = S.parseInline, A.Parser = z, A.parser = z.parse, A.Renderer = y, A.TextRenderer = $, A.Lexer = _, A.lexer = _.lex, A.Tokenizer = b, A.Hooks = T, A.parse = A; - const I = A.options, E = A.setOptions, Z = A.use, q = A.walkTokens, L = A.parseInline, D = A, P = z.parse, - v = _.lex; - e.Hooks = T, e.Lexer = _, e.Marked = R, e.Parser = z, e.Renderer = y, e.TextRenderer = $, e.Tokenizer = b, e.getDefaults = t, e.lexer = v, e.marked = A, e.options = I, e.parse = D, e.parseInline = L, e.parser = P, e.setOptions = E, e.use = Z, e.walkTokens = q -})); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).marked={})}(this,(function(e){"use strict";function t(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function n(t){e.defaults=t}e.defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};const s=/[&<>"']/,r=new RegExp(s.source,"g"),i=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,l=new RegExp(i.source,"g"),o={"&":"&","<":"<",">":">",'"':""","'":"'"},a=e=>o[e];function c(e,t){if(t){if(s.test(e))return e.replace(r,a)}else if(i.test(e))return e.replace(l,a);return e}const h=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;const p=/(^|[^\[])\^/g;function u(e,t){e="string"==typeof e?e:e.source,t=t||"";const n={replace:(t,s)=>(s=(s="object"==typeof s&&"source"in s?s.source:s).replace(p,"$1"),e=e.replace(t,s),n),getRegex:()=>new RegExp(e,t)};return n}function g(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const k={exec:()=>null};function f(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let s=!1,r=t;for(;--r>=0&&"\\"===n[r];)s=!s;return s?"|":" |"})).split(/ \|/);let s=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:d(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const s=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=s.length?e.slice(s.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=d(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=d(t[0].replace(/^ *>[ \t]?/gm,""),"\n"),n=this.lexer.state.top;this.lexer.state.top=!0;const s=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:s,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const s=n.length>1,r={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");const i=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let l="",o="",a=!1;for(;e;){let n=!1;if(!(t=i.exec(e)))break;if(this.rules.block.hr.test(e))break;l=t[0],e=e.substring(l.length);let s=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),c=e.split("\n",1)[0],h=0;this.options.pedantic?(h=2,o=s.trimStart()):(h=t[2].search(/[^ ]/),h=h>4?1:h,o=s.slice(h),h+=t[1].length);let p=!1;if(!s&&/^ *$/.test(c)&&(l+=c+"\n",e=e.substring(c.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,h-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,h-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),r=new RegExp(`^ {0,${Math.min(3,h-1)}}(?:\`\`\`|~~~)`),i=new RegExp(`^ {0,${Math.min(3,h-1)}}#`);for(;e;){const a=e.split("\n",1)[0];if(c=a,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),r.test(c))break;if(i.test(c))break;if(t.test(c))break;if(n.test(e))break;if(c.search(/[^ ]/)>=h||!c.trim())o+="\n"+c.slice(h);else{if(p)break;if(s.search(/[^ ]/)>=4)break;if(r.test(s))break;if(i.test(s))break;if(n.test(s))break;o+="\n"+c}p||c.trim()||(p=!0),l+=a+"\n",e=e.substring(a.length+1),s=c.slice(h)}}r.loose||(a?r.loose=!0:/\n *\n *$/.test(l)&&(a=!0));let u,g=null;this.options.gfm&&(g=/^\[[ xX]\] /.exec(o),g&&(u="[ ] "!==g[0],o=o.replace(/^\[[ xX]\] +/,""))),r.items.push({type:"list_item",raw:l,task:!!g,checked:u,loose:!1,text:o,tokens:[]}),r.raw+=l}r.items[r.items.length-1].raw=l.trimEnd(),r.items[r.items.length-1].text=o.trimEnd(),r.raw=r.raw.trimEnd();for(let e=0;e"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));r.loose=n}if(r.loose)for(let e=0;e$/,"$1").replace(this.rules.inline._escapes,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:s}}}table(e){const t=this.rules.block.table.exec(e);if(t){if(!/[:|]/.test(t[2]))return;const e={type:"table",raw:t[0],header:f(t[1]).map((e=>({text:e,tokens:[]}))),align:t[2].replace(/^\||\| *$/g,"").split("|"),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){let t,n,s,r,i=e.align.length;for(t=0;t({text:e,tokens:[]})));for(i=e.header.length,n=0;n/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=d(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let s=0;s-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],s="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],s=e[3])}else s=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(e)?n.slice(1):n.slice(1,-1)),x(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:s?s.replace(this.rules.inline._escapes,"$1"):s},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return x(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let s=this.rules.inline.emStrong.lDelim.exec(e);if(!s)return;if(s[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(s[1]||s[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...s[0]].length-1;let r,i,l=n,o=0;const a="*"===s[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(a.lastIndex=0,t=t.slice(-1*e.length+s[0].length-1);null!=(s=a.exec(t));){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r)continue;if(i=[...r].length,s[3]||s[4]){l+=i;continue}if((s[5]||s[6])&&n%3&&!((n+i)%3)){o+=i;continue}if(l-=i,l>0)continue;i=Math.min(i,i+l+o);const t=[...e].slice(0,n+s.index+i+1).join("");if(Math.min(n,i)%2){const e=t.slice(1,-1);return{type:"em",raw:t,text:e,tokens:this.lexer.inlineTokens(e)}}const a=t.slice(2,-2);return{type:"strong",raw:t,text:a,tokens:this.lexer.inlineTokens(a)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),s=/^ /.test(e)&&/ $/.test(e);return n&&s&&(e=e.substring(1,e.length-1)),e=c(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=c(t[1]),n="mailto:"+e):(e=c(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=c(t[0]),n="mailto:"+e;else{let s;do{s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])[0]}while(s!==t[0]);e=c(t[0]),n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:c(t[0]),{type:"text",raw:t[0],text:e}}}}const m={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]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:k,lheading:/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};m.def=u(m.def).replace("label",m._label).replace("title",m._title).getRegex(),m.bullet=/(?:[*+-]|\d{1,9}[.)])/,m.listItemStart=u(/^( *)(bull) */).replace("bull",m.bullet).getRegex(),m.list=u(m.list).replace(/bull/g,m.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+m.def.source+")").getRegex(),m._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",m._comment=/|$)/,m.html=u(m.html,"i").replace("comment",m._comment).replace("tag",m._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),m.lheading=u(m.lheading).replace(/bull/g,m.bullet).getRegex(),m.paragraph=u(m._paragraph).replace("hr",m.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").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",")|<(?:script|pre|style|textarea|!--)").replace("tag",m._tag).getRegex(),m.blockquote=u(m.blockquote).replace("paragraph",m.paragraph).getRegex(),m.normal={...m},m.gfm={...m.normal,table:"^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},m.gfm.table=u(m.gfm.table).replace("hr",m.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").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",")|<(?:script|pre|style|textarea|!--)").replace("tag",m._tag).getRegex(),m.gfm.paragraph=u(m._paragraph).replace("hr",m.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",m.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",m._tag).getRegex(),m.pedantic={...m.normal,html:u("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",m._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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:k,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:u(m.normal._paragraph).replace("hr",m.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",m.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const w={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:k,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,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])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:k,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`^|~"};w.punctuation=u(w.punctuation,"u").replace(/punctuation/g,w._punctuation).getRegex(),w.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,w.anyPunctuation=/\\[punct]/g,w._escapes=/\\([punct])/g,w._comment=u(m._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),w.emStrong.lDelim=u(w.emStrong.lDelim,"u").replace(/punct/g,w._punctuation).getRegex(),w.emStrong.rDelimAst=u(w.emStrong.rDelimAst,"gu").replace(/punct/g,w._punctuation).getRegex(),w.emStrong.rDelimUnd=u(w.emStrong.rDelimUnd,"gu").replace(/punct/g,w._punctuation).getRegex(),w.anyPunctuation=u(w.anyPunctuation,"gu").replace(/punct/g,w._punctuation).getRegex(),w._escapes=u(w._escapes,"gu").replace(/punct/g,w._punctuation).getRegex(),w._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,w._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])?)+(?![-_])/,w.autolink=u(w.autolink).replace("scheme",w._scheme).replace("email",w._email).getRegex(),w._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,w.tag=u(w.tag).replace("comment",w._comment).replace("attribute",w._attribute).getRegex(),w._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,w._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,w._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,w.link=u(w.link).replace("label",w._label).replace("href",w._href).replace("title",w._title).getRegex(),w.reflink=u(w.reflink).replace("label",w._label).replace("ref",m._label).getRegex(),w.nolink=u(w.nolink).replace("ref",m._label).getRegex(),w.reflinkSearch=u(w.reflinkSearch,"g").replace("reflink",w.reflink).replace("nolink",w.nolink).getRegex(),w.normal={...w},w.pedantic={...w.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:u(/^!?\[(label)\]\((.*?)\)/).replace("label",w._label).getRegex(),reflink:u(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",w._label).getRegex()},w.gfm={...w.normal,escape:u(w.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]*?(?:(?=[\\t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((s=>!!(n=s.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),s=t[t.length-1],!s||"paragraph"!==s.type&&"text"!==s.type?t.push(n):(s.raw+="\n"+n.raw,s.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=s.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),s=t[t.length-1],!s||"paragraph"!==s.type&&"text"!==s.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(s.raw+="\n"+n.raw,s.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=s.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(r=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let s;this.options.extensions.startBlock.forEach((e=>{s=e.call({lexer:this},n),"number"==typeof s&&s>=0&&(t=Math.min(t,s))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(r)))s=t[t.length-1],i&&"paragraph"===s.type?(s.raw+="\n"+n.raw,s.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n),i=r.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),s=t[t.length-1],s&&"text"===s.type?(s.raw+="\n"+n.raw,s.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,s,r,i,l,o,a=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(a));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(a));)a=a.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.anyPunctuation.exec(a));)a=a.slice(0,i.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(l||(o=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((s=>!!(n=s.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),s=t[t.length-1],s&&"text"===n.type&&"text"===s.type?(s.raw+=n.raw,s.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),s=t[t.length-1],s&&"text"===n.type&&"text"===s.type?(s.raw+=n.raw,s.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,a,o))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(r=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let s;this.options.extensions.startInline.forEach((e=>{s=e.call({lexer:this},n),"number"==typeof s&&s>=0&&(t=Math.min(t,s))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(r))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(o=n.raw.slice(-1)),l=!0,s=t[t.length-1],s&&"text"===s.type?(s.raw+=n.raw,s.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class y{options;constructor(t){this.options=t||e.defaults}code(e,t,n){const s=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+"\n",s?'
    '+(n?e:c(e,!0))+"
    \n":"
    "+(n?e:c(e,!0))+"
    \n"}blockquote(e){return`
    \n${e}
    \n`}html(e,t){return e}heading(e,t,n){return`${e}\n`}hr(){return"
    \n"}list(e,t,n){const s=t?"ol":"ul";return"<"+s+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"}listitem(e,t,n){return`
  • ${e}
  • \n`}checkbox(e){return"'}paragraph(e){return`

    ${e}

    \n`}table(e,t){return t&&(t=`${t}`),"\n\n"+e+"\n"+t+"
    \n"}tablerow(e){return`\n${e}\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`\n`}strong(e){return`${e}`}em(e){return`${e}`}codespan(e){return`${e}`}br(){return"
    "}del(e){return`${e}`}link(e,t,n){const s=g(e);if(null===s)return n;let r='
    ",r}image(e,t,n){const s=g(e);if(null===s)return n;let r=`${n}"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):"")));continue}case"code":{const e=r;n+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case"table":{const e=r;let t="",s="";for(let t=0;t0&&"paragraph"===n.tokens[0].type?(n.tokens[0].text=e+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&"text"===n.tokens[0].tokens[0].type&&(n.tokens[0].tokens[0].text=e+" "+n.tokens[0].tokens[0].text)):n.tokens.unshift({type:"text",text:e+" "}):o+=e+" "}o+=this.parse(n.tokens,i),l+=this.renderer.listitem(o,r,!!s)}n+=this.renderer.list(l,t,s);continue}case"html":{const e=r;n+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=r;n+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let i=r,l=i.tokens?this.parseInline(i.tokens):i.text;for(;s+1{n=n.concat(this.walkTokens(e[s],t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let s=e.renderer.apply(this,t);return!1===s&&(s=n.apply(this,t)),s}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new y(this.defaults);for(const n in e.renderer){const s=e.renderer[n],r=n,i=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=i.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new b(this.defaults);for(const n in e.tokenizer){const s=e.tokenizer[n],r=n,i=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new T;for(const n in e.hooks){const s=e.hooks[n],r=n,i=t[r];T.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(s.call(t,e)).then((e=>i.call(t,e)));const n=s.call(t,e);return i.call(t,n)}:t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,s=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(s.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}#e(e,t){return(n,s)=>{const r={...s},i={...this.defaults,...r};!0===this.defaults.async&&!1===r.async&&(i.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),i.async=!0);const l=this.#t(!!i.silent,!!i.async);if(null==n)return l(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(i.hooks&&(i.hooks.options=i),i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then((t=>e(t,i))).then((e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then((()=>e)):e)).then((e=>t(e,i))).then((e=>i.hooks?i.hooks.postprocess(e):e)).catch(l);try{i.hooks&&(n=i.hooks.preprocess(n));const s=e(n,i);i.walkTokens&&this.walkTokens(s,i.walkTokens);let r=t(s,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return l(e)}}}#t(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="

    An error occurred:

    "+c(n.message+"",!0)+"
    ";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}}const S=new R;function A(e,t){return S.parse(e,t)}A.options=A.setOptions=function(e){return S.setOptions(e),A.defaults=S.defaults,n(A.defaults),A},A.getDefaults=t,A.defaults=e.defaults,A.use=function(...e){return S.use(...e),A.defaults=S.defaults,n(A.defaults),A},A.walkTokens=function(e,t){return S.walkTokens(e,t)},A.parseInline=S.parseInline,A.Parser=z,A.parser=z.parse,A.Renderer=y,A.TextRenderer=$,A.Lexer=_,A.lexer=_.lex,A.Tokenizer=b,A.Hooks=T,A.parse=A;const I=A.options,E=A.setOptions,Z=A.use,q=A.walkTokens,L=A.parseInline,D=A,P=z.parse,v=_.lex;e.Hooks=T,e.Lexer=_,e.Marked=R,e.Parser=z,e.Renderer=y,e.TextRenderer=$,e.Tokenizer=b,e.getDefaults=t,e.lexer=v,e.marked=A,e.options=I,e.parse=D,e.parseInline=L,e.parser=P,e.setOptions=E,e.use=Z,e.walkTokens=q})); const fastn = (function (fastn) { class Closure { #cached_value; @@ -1816,8 +656,8 @@ const fastn = (function (fastn) { if (!(key in obj.#fields)) { throw new Error( "RecordInstance.replace: key " + - key + - " not present in new object", + key + + " not present in new object", ); } this.#fields[key] = fastn.wrapMutable(obj.#fields[key]); @@ -2705,7 +1545,6 @@ fastn_dom.Event = { class PropertyValueAsClosure { closureFunction; deps; - constructor(closureFunction, deps) { this.closureFunction = closureFunction; this.deps = deps; @@ -2732,7 +1571,6 @@ class Node2 { */ #extraData; #children; - constructor(parentOrSibiling, kind) { this.#kind = kind; this.#parent = parentOrSibiling; @@ -2774,7 +1612,6 @@ class Node2 { this.#parent.appendChild(this.#node); } } - createNode(kind) { if (kind === fastn_dom.ElementKind.Code) { let [node, classes, attributes] = fastn_utils.htmlNode(kind); @@ -2797,15 +1634,12 @@ class Node2 { ); } } - getTagName() { return this.#tagName; } - getParent() { return this.#parent; } - removeAllFaviconLinks() { if (doubleBuffering) { const links = document.head.querySelectorAll( @@ -2816,7 +1650,6 @@ class Node2 { }); } } - setFavicon(url) { if (doubleBuffering) { if (url instanceof fastn.recordInstanceClass) url = url.get("src"); @@ -2833,7 +1666,6 @@ class Node2 { document.head.appendChild(link_element); } } - updateTextInputValue() { if (fastn_utils.isNull(this.#rawInnerValue)) { this.attachAttribute("value"); @@ -2845,7 +1677,6 @@ class Node2 { this.attachAttribute("value", this.#rawInnerValue); } } - // for attaching inline attributes attachAttribute(property, value) { // If the value is null, undefined, or false, the attribute will be removed. @@ -2856,11 +1687,9 @@ class Node2 { } this.#node.setAttribute(property, value); } - removeAttribute(property) { this.#node.removeAttribute(property); } - updateTagName(name) { if (ssr) { this.#node.updateTagName(name); @@ -2881,7 +1710,6 @@ class Node2 { this.#node = newElement; } } - updateToAnchor(url) { let node_kind = this.#kind; if (ssr) { @@ -2902,7 +1730,6 @@ class Node2 { this.#node.href = url; } } - updatePositionForNodeById(node_id, value) { if (!ssr) { const target_node = fastnVirtual.root.querySelector( @@ -2912,7 +1739,6 @@ class Node2 { target_node.style["position"] = value; } } - updateParentPosition(value) { if (ssr) { let parent = this.#parent; @@ -2926,13 +1752,11 @@ class Node2 { } } } - updateMetaTitle(value) { if (!ssr && doubleBuffering) { if (!fastn_utils.isNull(value)) window.document.title = value; } } - addMetaTagByName(name, value) { if (value === null || value === undefined) { this.removeMetaTagByName(name); @@ -2945,7 +1769,6 @@ class Node2 { document.head.appendChild(metaTag); } } - addMetaTagByProperty(property, value) { if (value === null || value === undefined) { this.removeMetaTagByProperty(property); @@ -2958,7 +1781,6 @@ class Node2 { document.head.appendChild(metaTag); } } - removeMetaTagByName(name) { if (!ssr && doubleBuffering) { const metaTags = document.getElementsByTagName("meta"); @@ -2971,7 +1793,6 @@ class Node2 { } } } - removeMetaTagByProperty(property) { if (!ssr && doubleBuffering) { const metaTags = document.getElementsByTagName("meta"); @@ -2984,7 +1805,6 @@ class Node2 { } } } - // dynamic-class-css attachCss(property, value, createClass, className) { let propertyShort = fastn_dom.propertyMap[property] || property; @@ -3000,7 +1820,7 @@ class Node2 { } let cssClass = className ? cls : `.${cls}`; - const obj = {property, value}; + const obj = { property, value }; if (value === undefined) { if (!ssr) { @@ -3063,7 +1883,6 @@ class Node2 { this.#node.classList.add(cls); return cls; } - attachShadow(value) { if (fastn_utils.isNull(value)) { this.attachCss("box-shadow", value); @@ -3099,7 +1918,6 @@ class Node2 { ); } } - attachBackdropMultiFilter(value) { const filters = { blur: fastn_utils.getStaticValue(value.get("blur")), @@ -3119,7 +1937,6 @@ class Node2 { this.attachCss("backdrop-filter", filterString, false); } - attachTextShadow(value) { if (fastn_utils.isNull(value)) { this.attachCss("text-shadow", value); @@ -3151,7 +1968,6 @@ class Node2 { ); } } - getLinearGradientString(value) { var lightGradientString = ""; var darkGradientString = ""; @@ -3197,7 +2013,6 @@ class Node2 { return [lightGradientString, darkGradientString]; } - attachLinearGradientCss(value) { if (fastn_utils.isNull(value)) { this.attachCss("background-image", value); @@ -3237,7 +2052,7 @@ class Node2 { const colorsList = value.get("colors").get().getList(); - colorsList.forEach(({item}) => { + colorsList.forEach(({ item }) => { const color = item.get("color"); [color.get("light"), color.get("dark")].forEach((variant) => { @@ -3246,7 +2061,6 @@ class Node2 { }); }); } - attachBackgroundImageCss(value) { if (fastn_utils.isNull(value)) { this.attachCss("background-repeat", value); @@ -3308,7 +2122,6 @@ class Node2 { ); } } - attachMaskImageCss(value, vendorPrefix) { const propertyWithPrefix = vendorPrefix ? `${vendorPrefix}-mask-image` @@ -3397,7 +2210,6 @@ class Node2 { ); } } - attachMaskSizeCss(value, vendorPrefix) { const propertyNameWithPrefix = vendorPrefix ? `${vendorPrefix}-mask-size` @@ -3416,7 +2228,6 @@ class Node2 { this.attachCss(propertyNameWithPrefix, `${size_x} ${size_y}`, true); } } - attachMaskMultiCss(value, vendorPrefix) { if (fastn_utils.isNull(value)) { this.attachCss("mask-repeat", value); @@ -3450,7 +2261,6 @@ class Node2 { this.attachCss("-webkit-mask-position", maskPositionValue, true); } } - attachExternalCss(css) { if (!ssr) { let css_tag = document.createElement("link"); @@ -3466,7 +2276,6 @@ class Node2 { } } } - attachExternalJs(js) { if (!ssr) { let js_tag = document.createElement("script"); @@ -3480,7 +2289,6 @@ class Node2 { } } } - attachColorCss(property, value, visited) { if (fastn_utils.isNull(value)) { this.attachCss(property, value); @@ -3533,7 +2341,6 @@ class Node2 { this.#mutables.push(modeValue); }); } - attachRoleCss(value) { if (fastn_utils.isNull(value)) { this.attachCss("role", value); @@ -3573,7 +2380,6 @@ class Node2 { ); this.#mutables.push(value); } - attachTextStyles(styles) { if (fastn_utils.isNull(styles)) { this.attachCss("font-style", styles); @@ -3595,7 +2401,6 @@ class Node2 { } } } - attachAlignContent(value, node_kind) { if (fastn_utils.isNull(value)) { this.attachCss("align-items", value); @@ -3851,7 +2656,6 @@ class Node2 { ); this.#mutables.push(ftd.dark_mode); } - setStaticProperty(kind, value, inherited) { // value can be either static or mutable let staticValue = fastn_utils.getStaticValue(value); @@ -4488,7 +3292,7 @@ class Node2 { this.attachRoleCss(staticValue); } else if (kind === fastn_dom.PropertyKind.Code) { if (!fastn_utils.isNull(staticValue)) { - let {modifiedText, highlightedLines} = + let { modifiedText, highlightedLines } = fastn_utils.findAndRemoveHighlighter(staticValue); if (highlightedLines.length !== 0) { this.attachAttribute("data-line", highlightedLines); @@ -4630,24 +3434,23 @@ class Node2 { this.#node.innerHTML = staticValue; this.#rawInnerValue = staticValue; } else if (kind === fastn_dom.PropertyKind.StringValue) { - this.#rawInnerValue = staticValue; - staticValue = fastn_utils.markdown_inline( - fastn_utils.escapeHtmlInMarkdown(staticValue), - ); - staticValue = fastn_utils.process_post_markdown( - this.#node, - staticValue, - ); - if (!fastn_utils.isNull(staticValue)) { - this.#node.innerHTML = staticValue; - } else { - this.#node.innerHTML = ""; - } + this.#rawInnerValue = staticValue; + staticValue = fastn_utils.markdown_inline( + fastn_utils.escapeHtmlInMarkdown(staticValue), + ); + staticValue = fastn_utils.process_post_markdown( + this.#node, + staticValue, + ); + if (!fastn_utils.isNull(staticValue)) { + this.#node.innerHTML = staticValue; } else { - throw "invalid fastn_dom.PropertyKind: " + kind; + this.#node.innerHTML = ""; } + } else { + throw "invalid fastn_dom.PropertyKind: " + kind; + } } - setProperty(kind, value, inherited) { if (value instanceof fastn.mutableClass) { this.setDynamicProperty( @@ -4669,7 +3472,6 @@ class Node2 { this.setStaticProperty(kind, value, inherited); } } - setDynamicProperty(kind, deps, func, inherited) { let closure = fastn .closure(func) @@ -4682,26 +3484,21 @@ class Node2 { this.#mutables.push(deps[dep]); } } - getNode() { return this.#node; } - getExtraData() { return this.#extraData; } - getChildren() { return this.#children; } - mergeFnCalls(current, newFunc) { return () => { if (current instanceof Function) current(); if (newFunc instanceof Function) newFunc(); }; } - addEventHandler(event, func) { if (event === fastn_dom.Event.Click) { let onclickEvents = this.mergeFnCalls(this.#node.onclick, func); @@ -4743,7 +3540,6 @@ class Node2 { this.#node.onfocus = onFocusEvents; } } - destroy() { for (let i = 0; i < this.#mutables.length; i++) { this.#mutables[i].unlinkNode(this); @@ -4843,16 +3639,13 @@ fastn_dom.conditionalDom = function ( class ParentNodeWithSibiling { #parent; #sibiling; - constructor(parent, sibiling) { this.#parent = parent; this.#sibiling = sibiling; } - getParent() { return this.#parent; } - getSibiling() { return this.#sibiling; } @@ -4864,7 +3657,6 @@ class ForLoop { #wrapper; #parent; #nodes; - constructor(parent, node_constructor, list) { this.#wrapper = fastn_dom.createKernel( parent, @@ -4881,7 +3673,6 @@ class ForLoop { } fastn_utils.setFullHeight(); } - createNode(index, resizeBodyHeight = true) { if (resizeBodyHeight) { fastn_utils.resetFullHeight(); @@ -4904,7 +3695,6 @@ class ForLoop { } return node; } - createAllNode() { fastn_utils.resetFullHeight(); this.deleteAllNode(false); @@ -4913,7 +3703,6 @@ class ForLoop { } fastn_utils.setFullHeight(); } - deleteAllNode(resizeBodyHeight = true) { if (resizeBodyHeight) { fastn_utils.resetFullHeight(); @@ -4925,18 +3714,15 @@ class ForLoop { fastn_utils.setFullHeight(); } } - getWrapper() { return this.#wrapper; } - deleteNode(index) { fastn_utils.resetFullHeight(); let node = this.#nodes.splice(index, 1)[0]; node.destroy(); fastn_utils.setFullHeight(); } - getParent() { return this.#parent; } @@ -5272,7 +4058,7 @@ let fastn_utils = { markdown_inline(i) { if (fastn_utils.isNull(i)) return; i = i.toString(); - const {space_before, space_after} = fastn_utils.private.spaces(i); + const { space_before, space_after } = fastn_utils.private.spaces(i); const o = (() => { let g = fastn_utils.private.replace_last_occurrence( marked.parse(i), @@ -5610,7 +4396,7 @@ fastn_utils.private = { space_before = i + 1; } if (space_before === s.length) { - return {space_before, space_after: 0}; + return { space_before, space_after: 0 }; } let space_after = 0; @@ -5622,7 +4408,7 @@ fastn_utils.private = { space_after = i + 1; } - return {space_before, space_after}; + return { space_before, space_after }; }, /** * Helper function for `fastn_utils.markdown_inline` to replace the last @@ -5649,7 +4435,7 @@ fastn_utils.private = { * @returns {string} - A string with 'n' spaces concatenated together. */ repeated_space(n) { - return Array.from({length: n}, () => " ").join(""); + return Array.from({ length: n }, () => " ").join(""); }, /** * Merges consecutive numbers in a comma-separated list into ranges. @@ -5775,7 +4561,6 @@ let doubleBuffering = false; class ClassList { #classes = []; - add(item) { this.#classes.push(item); } @@ -5783,11 +4568,9 @@ class ClassList { remove(itemToRemove) { this.#classes.filter((item) => item !== itemToRemove); } - toString() { return this.#classes.join(" "); } - getClasses() { return this.#classes; } @@ -5799,7 +4582,6 @@ class Node { #tagName; #children; #attributes; - constructor(id, tagName) { this.#tagName = tagName; this.#dataId = id; @@ -5811,7 +4593,6 @@ class Node { this.onclick = null; this.id = null; } - appendChild(c) { this.#children.push(c); } @@ -5840,7 +4621,6 @@ class Node { updateTagName(tagName) { this.#tagName = tagName; } - // Caution: This is only supported in ssr mode toHtmlAsString() { const openingTag = `<${ @@ -5854,23 +4634,19 @@ class Node { return `${openingTag}${innerHTML}${childNodes}${closingTag}`; } - // Caution: This is only supported in ssr mode getDataIdString() { return ` data-id="${this.#dataId}"`; } - // Caution: This is only supported in ssr mode getIdString() { return fastn_utils.isNull(this.id) ? "" : ` id="${this.id}"`; } - // Caution: This is only supported in ssr mode getClassString() { const classList = this.classList.toString(); return classList ? ` class="${classList}"` : ""; } - // Caution: This is only supported in ssr mode getStyleString() { const styleProperties = Object.entries(this.style) @@ -5878,7 +4654,6 @@ class Node { .join(";"); return styleProperties ? ` style="${styleProperties}"` : ""; } - // Caution: This is only supported in ssr mode getAttributesString() { const nodeAttributes = Object.entries(this.#attributes) @@ -5952,10 +4727,8 @@ fastnVirtual.ssr = function (main) { id_counter = 0; return body.toHtmlAsString() + fastn_dom.getClassesAsString(); }; - class MutableVariable { #value; - constructor(value) { this.#value = value; } @@ -5967,7 +4740,6 @@ class MutableVariable { set(value) { this.#value.set(value); } - // Todo: Remove closure when node is removed. on_change(func) { this.#value.addClosure(fastn.closureWithoutExecute(func)); @@ -5976,15 +4748,12 @@ class MutableVariable { class MutableListVariable { #value; - constructor(value) { this.#value = value; } - get() { return fastn_utils.getStaticValue(this.#value); } - set(index, list) { if (list === undefined) { this.#value.set(fastn_utils.staticToMutables(index)); @@ -5992,27 +4761,21 @@ class MutableListVariable { } this.#value.set(index, fastn_utils.staticToMutables(list)); } - insertAt(index, value) { this.#value.insertAt(index, fastn_utils.staticToMutables(value)); } - deleteAt(index) { this.#value.deleteAt(index); } - push(value) { this.#value.push(value); } - pop() { this.#value.pop(); } - clearAll() { this.#value.clearAll(); } - on_change(func) { this.#value.addClosure(fastn.closureWithoutExecute(func)); } @@ -6020,7 +4783,6 @@ class MutableListVariable { class RecordVariable { #value; - constructor(value) { this.#value = value; } @@ -6037,11 +4799,9 @@ class RecordVariable { this.#value.addClosure(fastn.closureWithoutExecute(func)); } } - class StaticVariable { #value; #closures; - constructor(value) { this.#value = value; this.#closures = []; @@ -6282,7 +5042,7 @@ const ftd = (function () { method = method.trim().toUpperCase(); const init = { method, - headers: {"Content-Type": "application/json"}, + headers: { "Content-Type": "application/json" }, }; if (headers && headers instanceof fastn.recordInstanceClass) { Object.assign(init.headers, headers.toObject()); @@ -6586,7 +5346,7 @@ const ftd = (function () { redirect: "error", // TODO: set credentials? credentials: "same-origin", - headers: {"Content-Type": "application/json"}, + headers: { "Content-Type": "application/json" }, body: JSON.stringify(data), }; @@ -6679,7 +5439,6 @@ ftd.post_init = function () { window.onresize = function () { initialise_device(); }; - function initialise_click_outside_events() { document.addEventListener("click", function (event) { ftd.clickOutsideEvents.forEach(([ftdNode, func]) => { @@ -6694,7 +5453,6 @@ ftd.post_init = function () { }); }); } - function initialise_global_key_events() { let globalKeys = {}; let buffer = []; @@ -6753,7 +5511,6 @@ ftd.post_init = function () { globalKeys[fastn_utils.getEventKey(event)] = false; }); } - function initialise_device() { let current = ftd.get_device(); if (current === last_device) { @@ -6837,23 +5594,19 @@ ftd.post_init = function () { set_cookie(DARK_MODE_COOKIE, COOKIE_SYSTEM_LIGHT); } }; - function set_cookie(name, value) { document.cookie = name + "=" + value + "; path=/"; } - function system_dark_mode() { return !!( window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ); } - function initialise_dark_mode() { update_dark_mode(); start_watching_dark_mode_system_preference(); } - function get_cookie(name, def) { // source: https://stackoverflow.com/questions/5639346/ let regex = document.cookie.match( @@ -6861,7 +5614,6 @@ ftd.post_init = function () { ); return regex !== null ? regex.pop() : def; } - function update_dark_mode() { let current_dark_mode_cookie = get_cookie( DARK_MODE_COOKIE, @@ -6883,13 +5635,11 @@ ftd.post_init = function () { window.enable_system_mode(); } } - function start_watching_dark_mode_system_preference() { window .matchMedia("(prefers-color-scheme: dark)") .addEventListener("change", update_dark_mode); } - initialise_device(); initialise_dark_mode(); initialise_click_outside_events(); @@ -6901,218 +5651,234 @@ ftd.post_init = function () { window.ftd = ftd; ftd.toggle = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "fastn_community_github_io_business_card_demo"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(!fastn_utils.getStaticValue(__args__.a)); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "fastn_community_github_io_business_card_demo"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(!fastn_utils.getStaticValue(__args__.a)); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.integer_field_with_default = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "fastn_community_github_io_business_card_demo"; - try { - let __args__ = fastn_utils.getArgs({}, args); - return (ftd.field_with_default_js(__args__.name, __args__.default)); - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "fastn_community_github_io_business_card_demo"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + return (ftd.field_with_default_js(__args__.name, __args__.default)); + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.decimal_field_with_default = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "fastn_community_github_io_business_card_demo"; - try { - let __args__ = fastn_utils.getArgs({}, args); - return (ftd.field_with_default_js(__args__.name, __args__.default)); - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "fastn_community_github_io_business_card_demo"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + return (ftd.field_with_default_js(__args__.name, __args__.default)); + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.boolean_field_with_default = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "fastn_community_github_io_business_card_demo"; - try { - let __args__ = fastn_utils.getArgs({}, args); - return (ftd.field_with_default_js(__args__.name, __args__.default)); - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "fastn_community_github_io_business_card_demo"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + return (ftd.field_with_default_js(__args__.name, __args__.default)); + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.string_field_with_default = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "fastn_community_github_io_business_card_demo"; - try { - let __args__ = fastn_utils.getArgs({}, args); - return (ftd.field_with_default_js(__args__.name, __args__.default)); - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "fastn_community_github_io_business_card_demo"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + return (ftd.field_with_default_js(__args__.name, __args__.default)); + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.increment = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "fastn_community_github_io_business_card_demo"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(fastn_utils.getStaticValue(__args__.a) + 1); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "fastn_community_github_io_business_card_demo"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(fastn_utils.getStaticValue(__args__.a) + 1); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.increment_by = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "fastn_community_github_io_business_card_demo"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(fastn_utils.getStaticValue(__args__.a) + fastn_utils.getStaticValue(__args__.v)); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "fastn_community_github_io_business_card_demo"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(fastn_utils.getStaticValue(__args__.a) + fastn_utils.getStaticValue(__args__.v)); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.decrement = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "fastn_community_github_io_business_card_demo"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(fastn_utils.getStaticValue(__args__.a) - 1); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "fastn_community_github_io_business_card_demo"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(fastn_utils.getStaticValue(__args__.a) - 1); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.decrement_by = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "fastn_community_github_io_business_card_demo"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(fastn_utils.getStaticValue(__args__.a) - fastn_utils.getStaticValue(__args__.v)); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "fastn_community_github_io_business_card_demo"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(fastn_utils.getStaticValue(__args__.a) - fastn_utils.getStaticValue(__args__.v)); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.enable_light_mode = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "fastn_community_github_io_business_card_demo"; - try { - let __args__ = fastn_utils.getArgs({}, args); - return (enable_light_mode()); - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "fastn_community_github_io_business_card_demo"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + return (enable_light_mode()); + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.enable_dark_mode = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "fastn_community_github_io_business_card_demo"; - try { - let __args__ = fastn_utils.getArgs({}, args); - return (enable_dark_mode()); - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "fastn_community_github_io_business_card_demo"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + return (enable_dark_mode()); + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.enable_system_mode = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "fastn_community_github_io_business_card_demo"; - try { - let __args__ = fastn_utils.getArgs({}, args); - return (enable_system_mode()); - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "fastn_community_github_io_business_card_demo"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + return (enable_system_mode()); + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.set_bool = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "fastn_community_github_io_business_card_demo"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(__args__.v); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "fastn_community_github_io_business_card_demo"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(__args__.v); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.set_boolean = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "fastn_community_github_io_business_card_demo"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(__args__.v); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "fastn_community_github_io_business_card_demo"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(__args__.v); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.set_string = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "fastn_community_github_io_business_card_demo"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(__args__.v); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "fastn_community_github_io_business_card_demo"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(__args__.v); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.set_integer = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "fastn_community_github_io_business_card_demo"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(__args__.v); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "fastn_community_github_io_business_card_demo"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(__args__.v); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.dark_mode = fastn.mutable(false); ftd.empty = ""; @@ -7125,872 +5891,1010 @@ ftd.font_display = fastn.mutable("sans-serif"); ftd.font_copy = fastn.mutable("sans-serif"); ftd.font_code = fastn.mutable("sans-serif"); ftd.default_types = function () { - let record = fastn.recordInstance({}); - record.set("heading_large", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(50)); - record.set("line_height", fastn_dom.FontSize.Px(65)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(36)); - record.set("line_height", fastn_dom.FontSize.Px(54)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + let record = fastn.recordInstance({ + }); + record.set("heading_large", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(50)); + record.set("line_height", fastn_dom.FontSize.Px(65)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(36)); + record.set("line_height", fastn_dom.FontSize.Px(54)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + return record; + }()); + record.set("heading_medium", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(38)); + record.set("line_height", fastn_dom.FontSize.Px(57)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(26)); + record.set("line_height", fastn_dom.FontSize.Px(40)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + return record; + }()); + record.set("heading_small", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(24)); + record.set("line_height", fastn_dom.FontSize.Px(31)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(22)); + record.set("line_height", fastn_dom.FontSize.Px(29)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + return record; + }()); + record.set("heading_hero", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(80)); + record.set("line_height", fastn_dom.FontSize.Px(104)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(48)); + record.set("line_height", fastn_dom.FontSize.Px(64)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + return record; + }()); + record.set("heading_tiny", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(20)); + record.set("line_height", fastn_dom.FontSize.Px(26)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(18)); + record.set("line_height", fastn_dom.FontSize.Px(24)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + return record; + }()); + record.set("copy_small", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(14)); + record.set("line_height", fastn_dom.FontSize.Px(24)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_copy); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(12)); + record.set("line_height", fastn_dom.FontSize.Px(16)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_copy); + return record; + }()); + return record; + }()); + record.set("copy_regular", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(18)); + record.set("line_height", fastn_dom.FontSize.Px(30)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_copy); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(16)); + record.set("line_height", fastn_dom.FontSize.Px(24)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_copy); + return record; + }()); + return record; + }()); + record.set("copy_large", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(22)); + record.set("line_height", fastn_dom.FontSize.Px(34)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_copy); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(18)); + record.set("line_height", fastn_dom.FontSize.Px(28)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_copy); + return record; + }()); + return record; + }()); + record.set("fine_print", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(12)); + record.set("line_height", fastn_dom.FontSize.Px(16)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_code); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(12)); + record.set("line_height", fastn_dom.FontSize.Px(16)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_code); + return record; }()); - record.set("heading_medium", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(38)); - record.set("line_height", fastn_dom.FontSize.Px(57)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(26)); - record.set("line_height", fastn_dom.FontSize.Px(40)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + return record; + }()); + record.set("blockquote", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(16)); + record.set("line_height", fastn_dom.FontSize.Px(21)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_code); + return record; }()); - record.set("heading_small", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(24)); - record.set("line_height", fastn_dom.FontSize.Px(31)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(22)); - record.set("line_height", fastn_dom.FontSize.Px(29)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(16)); + record.set("line_height", fastn_dom.FontSize.Px(21)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_code); + return record; }()); - record.set("heading_hero", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(80)); - record.set("line_height", fastn_dom.FontSize.Px(104)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(48)); - record.set("line_height", fastn_dom.FontSize.Px(64)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + return record; + }()); + record.set("source_code", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(18)); + record.set("line_height", fastn_dom.FontSize.Px(30)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_code); + return record; }()); - record.set("heading_tiny", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(20)); - record.set("line_height", fastn_dom.FontSize.Px(26)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(18)); - record.set("line_height", fastn_dom.FontSize.Px(24)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(16)); + record.set("line_height", fastn_dom.FontSize.Px(21)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_code); + return record; }()); - record.set("copy_small", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(14)); - record.set("line_height", fastn_dom.FontSize.Px(24)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_copy); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(12)); - record.set("line_height", fastn_dom.FontSize.Px(16)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_copy); - return record; - }()); - return record; + return record; + }()); + record.set("button_small", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(14)); + record.set("line_height", fastn_dom.FontSize.Px(19)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("copy_regular", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(18)); - record.set("line_height", fastn_dom.FontSize.Px(30)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_copy); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(16)); - record.set("line_height", fastn_dom.FontSize.Px(24)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_copy); - return record; - }()); - return record; + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(14)); + record.set("line_height", fastn_dom.FontSize.Px(19)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("copy_large", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(22)); - record.set("line_height", fastn_dom.FontSize.Px(34)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_copy); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(18)); - record.set("line_height", fastn_dom.FontSize.Px(28)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_copy); - return record; - }()); - return record; + return record; + }()); + record.set("button_medium", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(16)); + record.set("line_height", fastn_dom.FontSize.Px(21)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("fine_print", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(12)); - record.set("line_height", fastn_dom.FontSize.Px(16)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_code); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(12)); - record.set("line_height", fastn_dom.FontSize.Px(16)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_code); - return record; - }()); - return record; + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(16)); + record.set("line_height", fastn_dom.FontSize.Px(21)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("blockquote", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(16)); - record.set("line_height", fastn_dom.FontSize.Px(21)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_code); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(16)); - record.set("line_height", fastn_dom.FontSize.Px(21)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_code); - return record; - }()); - return record; + return record; + }()); + record.set("button_large", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(18)); + record.set("line_height", fastn_dom.FontSize.Px(24)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("source_code", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(18)); - record.set("line_height", fastn_dom.FontSize.Px(30)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_code); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(16)); - record.set("line_height", fastn_dom.FontSize.Px(21)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_code); - return record; - }()); - return record; + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(18)); + record.set("line_height", fastn_dom.FontSize.Px(24)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("button_small", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(14)); - record.set("line_height", fastn_dom.FontSize.Px(19)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(14)); - record.set("line_height", fastn_dom.FontSize.Px(19)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + return record; + }()); + record.set("link", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(14)); + record.set("line_height", fastn_dom.FontSize.Px(19)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("button_medium", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(16)); - record.set("line_height", fastn_dom.FontSize.Px(21)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(16)); - record.set("line_height", fastn_dom.FontSize.Px(21)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(14)); + record.set("line_height", fastn_dom.FontSize.Px(19)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("button_large", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(18)); - record.set("line_height", fastn_dom.FontSize.Px(24)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(18)); - record.set("line_height", fastn_dom.FontSize.Px(24)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + return record; + }()); + record.set("label_large", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(14)); + record.set("line_height", fastn_dom.FontSize.Px(19)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("link", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(14)); - record.set("line_height", fastn_dom.FontSize.Px(19)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(14)); - record.set("line_height", fastn_dom.FontSize.Px(19)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(14)); + record.set("line_height", fastn_dom.FontSize.Px(19)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("label_large", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(14)); - record.set("line_height", fastn_dom.FontSize.Px(19)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(14)); - record.set("line_height", fastn_dom.FontSize.Px(19)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + return record; + }()); + record.set("label_small", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(12)); + record.set("line_height", fastn_dom.FontSize.Px(16)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("label_small", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(12)); - record.set("line_height", fastn_dom.FontSize.Px(16)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(12)); - record.set("line_height", fastn_dom.FontSize.Px(16)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(12)); + record.set("line_height", fastn_dom.FontSize.Px(16)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); return record; + }()); + return record; }(); ftd.default_colors = function () { - let record = fastn.recordInstance({}); - record.set("background", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#e7e7e4"); - record.set("dark", "#18181b"); - return record; - }()); - record.set("step_1", function () { - let record = fastn.recordInstance({}); - record.set("light", "#f3f3f3"); - record.set("dark", "#141414"); - return record; - }()); - record.set("step_2", function () { - let record = fastn.recordInstance({}); - record.set("light", "#c9cece"); - record.set("dark", "#585656"); - return record; - }()); - record.set("overlay", function () { - let record = fastn.recordInstance({}); - record.set("light", "rgba(0, 0, 0, 0.8)"); - record.set("dark", "rgba(0, 0, 0, 0.8)"); - return record; - }()); - record.set("code", function () { - let record = fastn.recordInstance({}); - record.set("light", "#F5F5F5"); - record.set("dark", "#21222C"); - return record; - }()); - return record; + let record = fastn.recordInstance({ + }); + record.set("background", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#e7e7e4"); + record.set("dark", "#18181b"); + return record; + }()); + record.set("step_1", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#f3f3f3"); + record.set("dark", "#141414"); + return record; + }()); + record.set("step_2", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#c9cece"); + record.set("dark", "#585656"); + return record; + }()); + record.set("overlay", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "rgba(0, 0, 0, 0.8)"); + record.set("dark", "rgba(0, 0, 0, 0.8)"); + return record; + }()); + record.set("code", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#F5F5F5"); + record.set("dark", "#21222C"); + return record; + }()); + return record; + }()); + record.set("border", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#434547"); + record.set("dark", "#434547"); + return record; + }()); + record.set("border_strong", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#919192"); + record.set("dark", "#919192"); + return record; + }()); + record.set("text", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#584b42"); + record.set("dark", "#a8a29e"); + return record; + }()); + record.set("text_strong", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#141414"); + record.set("dark", "#ffffff"); + return record; + }()); + record.set("shadow", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#007f9b"); + record.set("dark", "#007f9b"); + return record; + }()); + record.set("scrim", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#007f9b"); + record.set("dark", "#007f9b"); + return record; + }()); + record.set("cta_primary", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#2dd4bf"); + record.set("dark", "#2dd4bf"); + return record; + }()); + record.set("hover", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#2c9f90"); + record.set("dark", "#2c9f90"); + return record; + }()); + record.set("pressed", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#2cc9b5"); + record.set("dark", "#2cc9b5"); + return record; + }()); + record.set("disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "rgba(44, 201, 181, 0.1)"); + record.set("dark", "rgba(44, 201, 181, 0.1)"); + return record; + }()); + record.set("focused", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#2cbfac"); + record.set("dark", "#2cbfac"); + return record; + }()); + record.set("border", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#2b8074"); + record.set("dark", "#2b8074"); + return record; + }()); + record.set("border_disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#65b693"); + record.set("dark", "#65b693"); + return record; + }()); + record.set("text", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#feffff"); + record.set("dark", "#feffff"); + return record; + }()); + record.set("text_disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#65b693"); + record.set("dark", "#65b693"); + return record; + }()); + return record; + }()); + record.set("cta_secondary", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#4fb2df"); + record.set("dark", "#4fb2df"); + return record; + }()); + record.set("hover", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#40afe1"); + record.set("dark", "#40afe1"); + return record; + }()); + record.set("pressed", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#4fb2df"); + record.set("dark", "#4fb2df"); + return record; + }()); + record.set("disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "rgba(79, 178, 223, 0.1)"); + record.set("dark", "rgba(79, 178, 223, 0.1)"); + return record; + }()); + record.set("focused", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#4fb1df"); + record.set("dark", "#4fb1df"); + return record; + }()); + record.set("border", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#209fdb"); + record.set("dark", "#209fdb"); + return record; + }()); + record.set("border_disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#65b693"); + record.set("dark", "#65b693"); + return record; + }()); + record.set("text", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#584b42"); + record.set("dark", "#ffffff"); + return record; + }()); + record.set("text_disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#65b693"); + record.set("dark", "#65b693"); + return record; + }()); + return record; + }()); + record.set("cta_tertiary", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#556375"); + record.set("dark", "#556375"); + return record; + }()); + record.set("hover", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#c7cbd1"); + record.set("dark", "#c7cbd1"); + return record; + }()); + record.set("pressed", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#3b4047"); + record.set("dark", "#3b4047"); + return record; + }()); + record.set("disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "rgba(85, 99, 117, 0.1)"); + record.set("dark", "rgba(85, 99, 117, 0.1)"); + return record; + }()); + record.set("focused", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#e0e2e6"); + record.set("dark", "#e0e2e6"); + return record; + }()); + record.set("border", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#e2e4e7"); + record.set("dark", "#e2e4e7"); + return record; + }()); + record.set("border_disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#65b693"); + record.set("dark", "#65b693"); + return record; + }()); + record.set("text", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#ffffff"); + record.set("dark", "#ffffff"); + return record; + }()); + record.set("text_disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#65b693"); + record.set("dark", "#65b693"); + return record; + }()); + return record; + }()); + record.set("cta_danger", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#1C1B1F"); + record.set("dark", "#1C1B1F"); + return record; + }()); + record.set("hover", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#1C1B1F"); + record.set("dark", "#1C1B1F"); + return record; + }()); + record.set("pressed", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#1C1B1F"); + record.set("dark", "#1C1B1F"); + return record; + }()); + record.set("disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#1C1B1F"); + record.set("dark", "#1C1B1F"); + return record; + }()); + record.set("focused", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#1C1B1F"); + record.set("dark", "#1C1B1F"); + return record; + }()); + record.set("border", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#1C1B1F"); + record.set("dark", "#1C1B1F"); + return record; + }()); + record.set("border_disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#feffff"); + record.set("dark", "#feffff"); + return record; + }()); + record.set("text", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#1C1B1F"); + record.set("dark", "#1C1B1F"); + return record; + }()); + record.set("text_disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#feffff"); + record.set("dark", "#feffff"); + return record; + }()); + return record; + }()); + record.set("accent", function () { + let record = fastn.recordInstance({ + }); + record.set("primary", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#2dd4bf"); + record.set("dark", "#2dd4bf"); + return record; + }()); + record.set("secondary", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#4fb2df"); + record.set("dark", "#4fb2df"); + return record; + }()); + record.set("tertiary", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#c5cbd7"); + record.set("dark", "#c5cbd7"); + return record; + }()); + return record; + }()); + record.set("error", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#f5bdbb"); + record.set("dark", "#311b1f"); + return record; + }()); + record.set("text", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#c62a21"); + record.set("dark", "#c62a21"); + return record; + }()); + record.set("border", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#df2b2b"); + record.set("dark", "#df2b2b"); + return record; + }()); + return record; + }()); + record.set("success", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#e3f0c4"); + record.set("dark", "#405508ad"); + return record; + }()); + record.set("text", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#467b28"); + record.set("dark", "#479f16"); + return record; }()); record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#434547"); - record.set("dark", "#434547"); - return record; + let record = fastn.recordInstance({ + }); + record.set("light", "#3d741f"); + record.set("dark", "#3d741f"); + return record; }()); - record.set("border_strong", function () { - let record = fastn.recordInstance({}); - record.set("light", "#919192"); - record.set("dark", "#919192"); - return record; + return record; + }()); + record.set("info", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#c4edfd"); + record.set("dark", "#15223a"); + return record; }()); record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#584b42"); - record.set("dark", "#a8a29e"); - return record; + let record = fastn.recordInstance({ + }); + record.set("light", "#205694"); + record.set("dark", "#1f6feb"); + return record; + }()); + record.set("border", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#205694"); + record.set("dark", "#205694"); + return record; }()); - record.set("text_strong", function () { - let record = fastn.recordInstance({}); - record.set("light", "#141414"); - record.set("dark", "#ffffff"); - return record; + return record; + }()); + record.set("warning", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#fbefba"); + record.set("dark", "#544607a3"); + return record; }()); - record.set("shadow", function () { - let record = fastn.recordInstance({}); - record.set("light", "#007f9b"); - record.set("dark", "#007f9b"); - return record; + record.set("text", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#966220"); + record.set("dark", "#d07f19"); + return record; }()); - record.set("scrim", function () { - let record = fastn.recordInstance({}); - record.set("light", "#007f9b"); - record.set("dark", "#007f9b"); - return record; + record.set("border", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#966220"); + record.set("dark", "#966220"); + return record; }()); - record.set("cta_primary", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#2dd4bf"); - record.set("dark", "#2dd4bf"); - return record; - }()); - record.set("hover", function () { - let record = fastn.recordInstance({}); - record.set("light", "#2c9f90"); - record.set("dark", "#2c9f90"); - return record; - }()); - record.set("pressed", function () { - let record = fastn.recordInstance({}); - record.set("light", "#2cc9b5"); - record.set("dark", "#2cc9b5"); - return record; - }()); - record.set("disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "rgba(44, 201, 181, 0.1)"); - record.set("dark", "rgba(44, 201, 181, 0.1)"); - return record; - }()); - record.set("focused", function () { - let record = fastn.recordInstance({}); - record.set("light", "#2cbfac"); - record.set("dark", "#2cbfac"); - return record; - }()); - record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#2b8074"); - record.set("dark", "#2b8074"); - return record; - }()); - record.set("border_disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#65b693"); - record.set("dark", "#65b693"); - return record; - }()); - record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#feffff"); - record.set("dark", "#feffff"); - return record; - }()); - record.set("text_disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#65b693"); - record.set("dark", "#65b693"); - return record; - }()); - return record; + return record; + }()); + record.set("custom", function () { + let record = fastn.recordInstance({ + }); + record.set("one", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#ed753a"); + record.set("dark", "#ed753a"); + return record; }()); - record.set("cta_secondary", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#4fb2df"); - record.set("dark", "#4fb2df"); - return record; - }()); - record.set("hover", function () { - let record = fastn.recordInstance({}); - record.set("light", "#40afe1"); - record.set("dark", "#40afe1"); - return record; - }()); - record.set("pressed", function () { - let record = fastn.recordInstance({}); - record.set("light", "#4fb2df"); - record.set("dark", "#4fb2df"); - return record; - }()); - record.set("disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "rgba(79, 178, 223, 0.1)"); - record.set("dark", "rgba(79, 178, 223, 0.1)"); - return record; - }()); - record.set("focused", function () { - let record = fastn.recordInstance({}); - record.set("light", "#4fb1df"); - record.set("dark", "#4fb1df"); - return record; - }()); - record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#209fdb"); - record.set("dark", "#209fdb"); - return record; - }()); - record.set("border_disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#65b693"); - record.set("dark", "#65b693"); - return record; - }()); - record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#584b42"); - record.set("dark", "#ffffff"); - return record; - }()); - record.set("text_disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#65b693"); - record.set("dark", "#65b693"); - return record; - }()); - return record; + record.set("two", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#f3db5f"); + record.set("dark", "#f3db5f"); + return record; }()); - record.set("cta_tertiary", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#556375"); - record.set("dark", "#556375"); - return record; - }()); - record.set("hover", function () { - let record = fastn.recordInstance({}); - record.set("light", "#c7cbd1"); - record.set("dark", "#c7cbd1"); - return record; - }()); - record.set("pressed", function () { - let record = fastn.recordInstance({}); - record.set("light", "#3b4047"); - record.set("dark", "#3b4047"); - return record; - }()); - record.set("disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "rgba(85, 99, 117, 0.1)"); - record.set("dark", "rgba(85, 99, 117, 0.1)"); - return record; - }()); - record.set("focused", function () { - let record = fastn.recordInstance({}); - record.set("light", "#e0e2e6"); - record.set("dark", "#e0e2e6"); - return record; - }()); - record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#e2e4e7"); - record.set("dark", "#e2e4e7"); - return record; - }()); - record.set("border_disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#65b693"); - record.set("dark", "#65b693"); - return record; - }()); - record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#ffffff"); - record.set("dark", "#ffffff"); - return record; - }()); - record.set("text_disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#65b693"); - record.set("dark", "#65b693"); - return record; - }()); - return record; + record.set("three", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#8fdcf8"); + record.set("dark", "#8fdcf8"); + return record; }()); - record.set("cta_danger", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#1C1B1F"); - record.set("dark", "#1C1B1F"); - return record; - }()); - record.set("hover", function () { - let record = fastn.recordInstance({}); - record.set("light", "#1C1B1F"); - record.set("dark", "#1C1B1F"); - return record; - }()); - record.set("pressed", function () { - let record = fastn.recordInstance({}); - record.set("light", "#1C1B1F"); - record.set("dark", "#1C1B1F"); - return record; - }()); - record.set("disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#1C1B1F"); - record.set("dark", "#1C1B1F"); - return record; - }()); - record.set("focused", function () { - let record = fastn.recordInstance({}); - record.set("light", "#1C1B1F"); - record.set("dark", "#1C1B1F"); - return record; - }()); - record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#1C1B1F"); - record.set("dark", "#1C1B1F"); - return record; - }()); - record.set("border_disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#feffff"); - record.set("dark", "#feffff"); - return record; - }()); - record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#1C1B1F"); - record.set("dark", "#1C1B1F"); - return record; - }()); - record.set("text_disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#feffff"); - record.set("dark", "#feffff"); - return record; - }()); - return record; + record.set("four", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#7a65c7"); + record.set("dark", "#7a65c7"); + return record; }()); - record.set("accent", function () { - let record = fastn.recordInstance({}); - record.set("primary", function () { - let record = fastn.recordInstance({}); - record.set("light", "#2dd4bf"); - record.set("dark", "#2dd4bf"); - return record; - }()); - record.set("secondary", function () { - let record = fastn.recordInstance({}); - record.set("light", "#4fb2df"); - record.set("dark", "#4fb2df"); - return record; - }()); - record.set("tertiary", function () { - let record = fastn.recordInstance({}); - record.set("light", "#c5cbd7"); - record.set("dark", "#c5cbd7"); - return record; - }()); - return record; + record.set("five", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#eb57be"); + record.set("dark", "#eb57be"); + return record; }()); - record.set("error", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#f5bdbb"); - record.set("dark", "#311b1f"); - return record; - }()); - record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#c62a21"); - record.set("dark", "#c62a21"); - return record; - }()); - record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#df2b2b"); - record.set("dark", "#df2b2b"); - return record; - }()); - return record; + record.set("six", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#ef8dd6"); + record.set("dark", "#ef8dd6"); + return record; }()); - record.set("success", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#e3f0c4"); - record.set("dark", "#405508ad"); - return record; - }()); - record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#467b28"); - record.set("dark", "#479f16"); - return record; - }()); - record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#3d741f"); - record.set("dark", "#3d741f"); - return record; - }()); - return record; + record.set("seven", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#7564be"); + record.set("dark", "#7564be"); + return record; }()); - record.set("info", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#c4edfd"); - record.set("dark", "#15223a"); - return record; - }()); - record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#205694"); - record.set("dark", "#1f6feb"); - return record; - }()); - record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#205694"); - record.set("dark", "#205694"); - return record; - }()); - return record; + record.set("eight", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#d554b3"); + record.set("dark", "#d554b3"); + return record; }()); - record.set("warning", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#fbefba"); - record.set("dark", "#544607a3"); - return record; - }()); - record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#966220"); - record.set("dark", "#d07f19"); - return record; - }()); - record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#966220"); - record.set("dark", "#966220"); - return record; - }()); - return record; + record.set("nine", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#ec8943"); + record.set("dark", "#ec8943"); + return record; }()); - record.set("custom", function () { - let record = fastn.recordInstance({}); - record.set("one", function () { - let record = fastn.recordInstance({}); - record.set("light", "#ed753a"); - record.set("dark", "#ed753a"); - return record; - }()); - record.set("two", function () { - let record = fastn.recordInstance({}); - record.set("light", "#f3db5f"); - record.set("dark", "#f3db5f"); - return record; - }()); - record.set("three", function () { - let record = fastn.recordInstance({}); - record.set("light", "#8fdcf8"); - record.set("dark", "#8fdcf8"); - return record; - }()); - record.set("four", function () { - let record = fastn.recordInstance({}); - record.set("light", "#7a65c7"); - record.set("dark", "#7a65c7"); - return record; - }()); - record.set("five", function () { - let record = fastn.recordInstance({}); - record.set("light", "#eb57be"); - record.set("dark", "#eb57be"); - return record; - }()); - record.set("six", function () { - let record = fastn.recordInstance({}); - record.set("light", "#ef8dd6"); - record.set("dark", "#ef8dd6"); - return record; - }()); - record.set("seven", function () { - let record = fastn.recordInstance({}); - record.set("light", "#7564be"); - record.set("dark", "#7564be"); - return record; - }()); - record.set("eight", function () { - let record = fastn.recordInstance({}); - record.set("light", "#d554b3"); - record.set("dark", "#d554b3"); - return record; - }()); - record.set("nine", function () { - let record = fastn.recordInstance({}); - record.set("light", "#ec8943"); - record.set("dark", "#ec8943"); - return record; - }()); - record.set("ten", function () { - let record = fastn.recordInstance({}); - record.set("light", "#da7a4a"); - record.set("dark", "#da7a4a"); - return record; - }()); - return record; + record.set("ten", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#da7a4a"); + record.set("dark", "#da7a4a"); + return record; }()); return record; + }()); + return record; }(); ftd.breakpoint_width = function () { - let record = fastn.recordInstance({}); - record.set("mobile", 768); - return record; + let record = fastn.recordInstance({ + }); + record.set("mobile", 768); + return record; }(); ftd.device = fastn.mutable(fastn_dom.DeviceData.Mobile); let inherited = function () { - let record = fastn.recordInstance({}); - record.set("colors", ftd.default_colors.getClone().setAndReturn("is_root", true)); - record.set("types", ftd.default_types.getClone().setAndReturn("is_root", true)); - return record; + let record = fastn.recordInstance({ + }); + record.set("colors", ftd.default_colors.getClone().setAndReturn("is_root", true)); + record.set("types", ftd.default_types.getClone().setAndReturn("is_root", true)); + return record; }(); diff --git a/fastn-core/fbt-tests/22-request-data-processor/output/default-8E31FABF380953C7F7EF9DCD5A134E06E49F7FAFB0205953F85809A66AA5FB29.js b/fastn-core/fbt-tests/22-request-data-processor/output/default-8E31FABF380953C7F7EF9DCD5A134E06E49F7FAFB0205953F85809A66AA5FB29.js index 3c04c0dd8e..5ddc443290 100644 --- a/fastn-core/fbt-tests/22-request-data-processor/output/default-8E31FABF380953C7F7EF9DCD5A134E06E49F7FAFB0205953F85809A66AA5FB29.js +++ b/fastn-core/fbt-tests/22-request-data-processor/output/default-8E31FABF380953C7F7EF9DCD5A134E06E49F7FAFB0205953F85809A66AA5FB29.js @@ -108,1167 +108,7 @@ Prism.languages.ftd = { * https://github.com/markedjs/marked */ // Content taken from https://cdn.jsdelivr.net/npm/marked/marked.min.js -!function (e, t) { - "object" == typeof exports && "undefined" != typeof module ? t(exports) : "function" == typeof define && define.amd ? define(["exports"], t) : t((e = "undefined" != typeof globalThis ? globalThis : e || self).marked = {}) -}(this, (function (e) { - "use strict"; - - function t() { - return { - async: !1, - breaks: !1, - extensions: null, - gfm: !0, - hooks: null, - pedantic: !1, - renderer: null, - silent: !1, - tokenizer: null, - walkTokens: null - } - } - - function n(t) { - e.defaults = t - } - - e.defaults = { - async: !1, - breaks: !1, - extensions: null, - gfm: !0, - hooks: null, - pedantic: !1, - renderer: null, - silent: !1, - tokenizer: null, - walkTokens: null - }; - const s = /[&<>"']/, r = new RegExp(s.source, "g"), i = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, - l = new RegExp(i.source, "g"), o = {"&": "&", "<": "<", ">": ">", '"': """, "'": "'"}, - a = e => o[e]; - - function c(e, t) { - if (t) { - if (s.test(e)) return e.replace(r, a) - } else if (i.test(e)) return e.replace(l, a); - return e - } - - const h = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi; - const p = /(^|[^\[])\^/g; - - function u(e, t) { - e = "string" == typeof e ? e : e.source, t = t || ""; - const n = { - replace: (t, s) => (s = (s = "object" == typeof s && "source" in s ? s.source : s).replace(p, "$1"), e = e.replace(t, s), n), - getRegex: () => new RegExp(e, t) - }; - return n - } - - function g(e) { - try { - e = encodeURI(e).replace(/%25/g, "%") - } catch (e) { - return null - } - return e - } - - const k = {exec: () => null}; - - function f(e, t) { - const n = e.replace(/\|/g, ((e, t, n) => { - let s = !1, r = t; - for (; --r >= 0 && "\\" === n[r];) s = !s; - return s ? "|" : " |" - })).split(/ \|/); - let s = 0; - if (n[0].trim() || n.shift(), n.length > 0 && !n[n.length - 1].trim() && n.pop(), t) if (n.length > t) n.splice(t); else for (; n.length < t;) n.push(""); - for (; s < n.length; s++) n[s] = n[s].trim().replace(/\\\|/g, "|"); - return n - } - - function d(e, t, n) { - const s = e.length; - if (0 === s) return ""; - let r = 0; - for (; r < s;) { - const i = e.charAt(s - r - 1); - if (i !== t || n) { - if (i === t || !n) break; - r++ - } else r++ - } - return e.slice(0, s - r) - } - - function x(e, t, n, s) { - const r = t.href, i = t.title ? c(t.title) : null, l = e[1].replace(/\\([\[\]])/g, "$1"); - if ("!" !== e[0].charAt(0)) { - s.state.inLink = !0; - const e = {type: "link", raw: n, href: r, title: i, text: l, tokens: s.inlineTokens(l)}; - return s.state.inLink = !1, e - } - return {type: "image", raw: n, href: r, title: i, text: c(l)} - } - - class b { - options; - rules; - lexer; - - constructor(t) { - this.options = t || e.defaults - } - - space(e) { - const t = this.rules.block.newline.exec(e); - if (t && t[0].length > 0) return {type: "space", raw: t[0]} - } - - code(e) { - const t = this.rules.block.code.exec(e); - if (t) { - const e = t[0].replace(/^ {1,4}/gm, ""); - return { - type: "code", - raw: t[0], - codeBlockStyle: "indented", - text: this.options.pedantic ? e : d(e, "\n") - } - } - } - - fences(e) { - const t = this.rules.block.fences.exec(e); - if (t) { - const e = t[0], n = function (e, t) { - const n = e.match(/^(\s+)(?:```)/); - if (null === n) return t; - const s = n[1]; - return t.split("\n").map((e => { - const t = e.match(/^\s+/); - if (null === t) return e; - const [n] = t; - return n.length >= s.length ? e.slice(s.length) : e - })).join("\n") - }(e, t[3] || ""); - return { - type: "code", - raw: e, - lang: t[2] ? t[2].trim().replace(this.rules.inline._escapes, "$1") : t[2], - text: n - } - } - } - - heading(e) { - const t = this.rules.block.heading.exec(e); - if (t) { - let e = t[2].trim(); - if (/#$/.test(e)) { - const t = d(e, "#"); - this.options.pedantic ? e = t.trim() : t && !/ $/.test(t) || (e = t.trim()) - } - return {type: "heading", raw: t[0], depth: t[1].length, text: e, tokens: this.lexer.inline(e)} - } - } - - hr(e) { - const t = this.rules.block.hr.exec(e); - if (t) return {type: "hr", raw: t[0]} - } - - blockquote(e) { - const t = this.rules.block.blockquote.exec(e); - if (t) { - const e = d(t[0].replace(/^ *>[ \t]?/gm, ""), "\n"), n = this.lexer.state.top; - this.lexer.state.top = !0; - const s = this.lexer.blockTokens(e); - return this.lexer.state.top = n, {type: "blockquote", raw: t[0], tokens: s, text: e} - } - } - - list(e) { - let t = this.rules.block.list.exec(e); - if (t) { - let n = t[1].trim(); - const s = n.length > 1, - r = {type: "list", raw: "", ordered: s, start: s ? +n.slice(0, -1) : "", loose: !1, items: []}; - n = s ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = s ? n : "[*+-]"); - const i = new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`); - let l = "", o = "", a = !1; - for (; e;) { - let n = !1; - if (!(t = i.exec(e))) break; - if (this.rules.block.hr.test(e)) break; - l = t[0], e = e.substring(l.length); - let s = t[2].split("\n", 1)[0].replace(/^\t+/, (e => " ".repeat(3 * e.length))), - c = e.split("\n", 1)[0], h = 0; - this.options.pedantic ? (h = 2, o = s.trimStart()) : (h = t[2].search(/[^ ]/), h = h > 4 ? 1 : h, o = s.slice(h), h += t[1].length); - let p = !1; - if (!s && /^ *$/.test(c) && (l += c + "\n", e = e.substring(c.length + 1), n = !0), !n) { - const t = new RegExp(`^ {0,${Math.min(3,h-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`), - n = new RegExp(`^ {0,${Math.min(3,h-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), - r = new RegExp(`^ {0,${Math.min(3,h-1)}}(?:\`\`\`|~~~)`), - i = new RegExp(`^ {0,${Math.min(3,h-1)}}#`); - for (; e;) { - const a = e.split("\n", 1)[0]; - if (c = a, this.options.pedantic && (c = c.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ")), r.test(c)) break; - if (i.test(c)) break; - if (t.test(c)) break; - if (n.test(e)) break; - if (c.search(/[^ ]/) >= h || !c.trim()) o += "\n" + c.slice(h); else { - if (p) break; - if (s.search(/[^ ]/) >= 4) break; - if (r.test(s)) break; - if (i.test(s)) break; - if (n.test(s)) break; - o += "\n" + c - } - p || c.trim() || (p = !0), l += a + "\n", e = e.substring(a.length + 1), s = c.slice(h) - } - } - r.loose || (a ? r.loose = !0 : /\n *\n *$/.test(l) && (a = !0)); - let u, g = null; - this.options.gfm && (g = /^\[[ xX]\] /.exec(o), g && (u = "[ ] " !== g[0], o = o.replace(/^\[[ xX]\] +/, ""))), r.items.push({ - type: "list_item", - raw: l, - task: !!g, - checked: u, - loose: !1, - text: o, - tokens: [] - }), r.raw += l - } - r.items[r.items.length - 1].raw = l.trimEnd(), r.items[r.items.length - 1].text = o.trimEnd(), r.raw = r.raw.trimEnd(); - for (let e = 0; e < r.items.length; e++) if (this.lexer.state.top = !1, r.items[e].tokens = this.lexer.blockTokens(r.items[e].text, []), !r.loose) { - const t = r.items[e].tokens.filter((e => "space" === e.type)), - n = t.length > 0 && t.some((e => /\n.*\n/.test(e.raw))); - r.loose = n - } - if (r.loose) for (let e = 0; e < r.items.length; e++) r.items[e].loose = !0; - return r - } - } - - html(e) { - const t = this.rules.block.html.exec(e); - if (t) { - return { - type: "html", - block: !0, - raw: t[0], - pre: "pre" === t[1] || "script" === t[1] || "style" === t[1], - text: t[0] - } - } - } - - def(e) { - const t = this.rules.block.def.exec(e); - if (t) { - const e = t[1].toLowerCase().replace(/\s+/g, " "), - n = t[2] ? t[2].replace(/^<(.*)>$/, "$1").replace(this.rules.inline._escapes, "$1") : "", - s = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline._escapes, "$1") : t[3]; - return {type: "def", tag: e, raw: t[0], href: n, title: s} - } - } - - table(e) { - const t = this.rules.block.table.exec(e); - if (t) { - if (!/[:|]/.test(t[2])) return; - const e = { - type: "table", - raw: t[0], - header: f(t[1]).map((e => ({text: e, tokens: []}))), - align: t[2].replace(/^\||\| *$/g, "").split("|"), - rows: t[3] && t[3].trim() ? t[3].replace(/\n[ \t]*$/, "").split("\n") : [] - }; - if (e.header.length === e.align.length) { - let t, n, s, r, i = e.align.length; - for (t = 0; t < i; t++) { - const n = e.align[t]; - n && (/^ *-+: *$/.test(n) ? e.align[t] = "right" : /^ *:-+: *$/.test(n) ? e.align[t] = "center" : /^ *:-+ *$/.test(n) ? e.align[t] = "left" : e.align[t] = null) - } - for (i = e.rows.length, t = 0; t < i; t++) e.rows[t] = f(e.rows[t], e.header.length).map((e => ({ - text: e, - tokens: [] - }))); - for (i = e.header.length, n = 0; n < i; n++) e.header[n].tokens = this.lexer.inline(e.header[n].text); - for (i = e.rows.length, n = 0; n < i; n++) for (r = e.rows[n], s = 0; s < r.length; s++) r[s].tokens = this.lexer.inline(r[s].text); - return e - } - } - } - - lheading(e) { - const t = this.rules.block.lheading.exec(e); - if (t) return { - type: "heading", - raw: t[0], - depth: "=" === t[2].charAt(0) ? 1 : 2, - text: t[1], - tokens: this.lexer.inline(t[1]) - } - } - - paragraph(e) { - const t = this.rules.block.paragraph.exec(e); - if (t) { - const e = "\n" === t[1].charAt(t[1].length - 1) ? t[1].slice(0, -1) : t[1]; - return {type: "paragraph", raw: t[0], text: e, tokens: this.lexer.inline(e)} - } - } - - text(e) { - const t = this.rules.block.text.exec(e); - if (t) return {type: "text", raw: t[0], text: t[0], tokens: this.lexer.inline(t[0])} - } - - escape(e) { - const t = this.rules.inline.escape.exec(e); - if (t) return {type: "escape", raw: t[0], text: c(t[1])} - } - - tag(e) { - const t = this.rules.inline.tag.exec(e); - if (t) return !this.lexer.state.inLink && /^
    /i.test(t[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(t[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0]) && (this.lexer.state.inRawBlock = !1), { - type: "html", - raw: t[0], - inLink: this.lexer.state.inLink, - inRawBlock: this.lexer.state.inRawBlock, - block: !1, - text: t[0] - } - } - - link(e) { - const t = this.rules.inline.link.exec(e); - if (t) { - const e = t[2].trim(); - if (!this.options.pedantic && /^$/.test(e)) return; - const t = d(e.slice(0, -1), "\\"); - if ((e.length - t.length) % 2 == 0) return - } else { - const e = function (e, t) { - if (-1 === e.indexOf(t[1])) return -1; - let n = 0; - for (let s = 0; s < e.length; s++) if ("\\" === e[s]) s++; else if (e[s] === t[0]) n++; else if (e[s] === t[1] && (n--, n < 0)) return s; - return -1 - }(t[2], "()"); - if (e > -1) { - const n = (0 === t[0].indexOf("!") ? 5 : 4) + t[1].length + e; - t[2] = t[2].substring(0, e), t[0] = t[0].substring(0, n).trim(), t[3] = "" - } - } - let n = t[2], s = ""; - if (this.options.pedantic) { - const e = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n); - e && (n = e[1], s = e[3]) - } else s = t[3] ? t[3].slice(1, -1) : ""; - return n = n.trim(), /^$/.test(e) ? n.slice(1) : n.slice(1, -1)), x(t, { - href: n ? n.replace(this.rules.inline._escapes, "$1") : n, - title: s ? s.replace(this.rules.inline._escapes, "$1") : s - }, t[0], this.lexer) - } - } - - reflink(e, t) { - let n; - if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) { - let e = (n[2] || n[1]).replace(/\s+/g, " "); - if (e = t[e.toLowerCase()], !e) { - const e = n[0].charAt(0); - return {type: "text", raw: e, text: e} - } - return x(n, e, n[0], this.lexer) - } - } - - emStrong(e, t, n = "") { - let s = this.rules.inline.emStrong.lDelim.exec(e); - if (!s) return; - if (s[3] && n.match(/[\p{L}\p{N}]/u)) return; - if (!(s[1] || s[2] || "") || !n || this.rules.inline.punctuation.exec(n)) { - const n = [...s[0]].length - 1; - let r, i, l = n, o = 0; - const a = "*" === s[0][0] ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd; - for (a.lastIndex = 0, t = t.slice(-1 * e.length + s[0].length - 1); null != (s = a.exec(t));) { - if (r = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !r) continue; - if (i = [...r].length, s[3] || s[4]) { - l += i; - continue - } - if ((s[5] || s[6]) && n % 3 && !((n + i) % 3)) { - o += i; - continue - } - if (l -= i, l > 0) continue; - i = Math.min(i, i + l + o); - const t = [...e].slice(0, n + s.index + i + 1).join(""); - if (Math.min(n, i) % 2) { - const e = t.slice(1, -1); - return {type: "em", raw: t, text: e, tokens: this.lexer.inlineTokens(e)} - } - const a = t.slice(2, -2); - return {type: "strong", raw: t, text: a, tokens: this.lexer.inlineTokens(a)} - } - } - } - - codespan(e) { - const t = this.rules.inline.code.exec(e); - if (t) { - let e = t[2].replace(/\n/g, " "); - const n = /[^ ]/.test(e), s = /^ /.test(e) && / $/.test(e); - return n && s && (e = e.substring(1, e.length - 1)), e = c(e, !0), { - type: "codespan", - raw: t[0], - text: e - } - } - } - - br(e) { - const t = this.rules.inline.br.exec(e); - if (t) return {type: "br", raw: t[0]} - } - - del(e) { - const t = this.rules.inline.del.exec(e); - if (t) return {type: "del", raw: t[0], text: t[2], tokens: this.lexer.inlineTokens(t[2])} - } - - autolink(e) { - const t = this.rules.inline.autolink.exec(e); - if (t) { - let e, n; - return "@" === t[2] ? (e = c(t[1]), n = "mailto:" + e) : (e = c(t[1]), n = e), { - type: "link", - raw: t[0], - text: e, - href: n, - tokens: [{type: "text", raw: e, text: e}] - } - } - } - - url(e) { - let t; - if (t = this.rules.inline.url.exec(e)) { - let e, n; - if ("@" === t[2]) e = c(t[0]), n = "mailto:" + e; else { - let s; - do { - s = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])[0] - } while (s !== t[0]); - e = c(t[0]), n = "www." === t[1] ? "http://" + t[0] : t[0] - } - return {type: "link", raw: t[0], text: e, href: n, tokens: [{type: "text", raw: e, text: e}]} - } - } - - inlineText(e) { - const t = this.rules.inline.text.exec(e); - if (t) { - let e; - return e = this.lexer.state.inRawBlock ? t[0] : c(t[0]), {type: "text", raw: t[0], text: e} - } - } - } - - const m = { - 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]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))", - def: /^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/, - table: k, - lheading: /^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, - _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, - text: /^[^\n]+/, - _label: /(?!\s*\])(?:\\.|[^\[\]\\])+/, - _title: /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/ - }; - m.def = u(m.def).replace("label", m._label).replace("title", m._title).getRegex(), m.bullet = /(?:[*+-]|\d{1,9}[.)])/, m.listItemStart = u(/^( *)(bull) */).replace("bull", m.bullet).getRegex(), m.list = u(m.list).replace(/bull/g, m.bullet).replace("hr", "\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def", "\\n+(?=" + m.def.source + ")").getRegex(), m._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", m._comment = /|$)/, m.html = u(m.html, "i").replace("comment", m._comment).replace("tag", m._tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), m.lheading = u(m.lheading).replace(/bull/g, m.bullet).getRegex(), m.paragraph = u(m._paragraph).replace("hr", m.hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").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", ")|<(?:script|pre|style|textarea|!--)").replace("tag", m._tag).getRegex(), m.blockquote = u(m.blockquote).replace("paragraph", m.paragraph).getRegex(), m.normal = {...m}, m.gfm = { - ...m.normal, - table: "^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)" - }, m.gfm.table = u(m.gfm.table).replace("hr", m.hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").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", ")|<(?:script|pre|style|textarea|!--)").replace("tag", m._tag).getRegex(), m.gfm.paragraph = u(m._paragraph).replace("hr", m.hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", m.gfm.table).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", ")|<(?:script|pre|style|textarea|!--)").replace("tag", m._tag).getRegex(), m.pedantic = { - ...m.normal, - html: u("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", m._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: /^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, - heading: /^(#{1,6})(.*)(?:\n+|$)/, - fences: k, - lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, - paragraph: u(m.normal._paragraph).replace("hr", m.hr).replace("heading", " *#{1,6} *[^\n]").replace("lheading", m.lheading).replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").getRegex() - }; - const w = { - escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, - autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/, - url: k, - tag: "^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^", - link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/, - reflink: /^!?\[(label)\]\[(ref)\]/, - nolink: /^!?\[(ref)\](?:\[\])?/, - reflinkSearch: "reflink|nolink(?!\\()", - emStrong: { - lDelim: /^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, - 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])/ - }, - code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, - br: /^( {2,}|\\)\n(?!\s*$)/, - del: k, - text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`^|~" - }; - w.punctuation = u(w.punctuation, "u").replace(/punctuation/g, w._punctuation).getRegex(), w.blockSkip = /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g, w.anyPunctuation = /\\[punct]/g, w._escapes = /\\([punct])/g, w._comment = u(m._comment).replace("(?:--\x3e|$)", "--\x3e").getRegex(), w.emStrong.lDelim = u(w.emStrong.lDelim, "u").replace(/punct/g, w._punctuation).getRegex(), w.emStrong.rDelimAst = u(w.emStrong.rDelimAst, "gu").replace(/punct/g, w._punctuation).getRegex(), w.emStrong.rDelimUnd = u(w.emStrong.rDelimUnd, "gu").replace(/punct/g, w._punctuation).getRegex(), w.anyPunctuation = u(w.anyPunctuation, "gu").replace(/punct/g, w._punctuation).getRegex(), w._escapes = u(w._escapes, "gu").replace(/punct/g, w._punctuation).getRegex(), w._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/, w._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])?)+(?![-_])/, w.autolink = u(w.autolink).replace("scheme", w._scheme).replace("email", w._email).getRegex(), w._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/, w.tag = u(w.tag).replace("comment", w._comment).replace("attribute", w._attribute).getRegex(), w._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, w._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/, w._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/, w.link = u(w.link).replace("label", w._label).replace("href", w._href).replace("title", w._title).getRegex(), w.reflink = u(w.reflink).replace("label", w._label).replace("ref", m._label).getRegex(), w.nolink = u(w.nolink).replace("ref", m._label).getRegex(), w.reflinkSearch = u(w.reflinkSearch, "g").replace("reflink", w.reflink).replace("nolink", w.nolink).getRegex(), w.normal = {...w}, w.pedantic = { - ...w.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: u(/^!?\[(label)\]\((.*?)\)/).replace("label", w._label).getRegex(), - reflink: u(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", w._label).getRegex() - }, w.gfm = { - ...w.normal, - escape: u(w.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]*?(?:(?=[\\ t + " ".repeat(n.length))); e;) if (!(this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((s => !!(n = s.call({lexer: this}, e, t)) && (e = e.substring(n.raw.length), t.push(n), !0))))) if (n = this.tokenizer.space(e)) e = e.substring(n.raw.length), 1 === n.raw.length && t.length > 0 ? t[t.length - 1].raw += "\n" : t.push(n); else if (n = this.tokenizer.code(e)) e = e.substring(n.raw.length), s = t[t.length - 1], !s || "paragraph" !== s.type && "text" !== s.type ? t.push(n) : (s.raw += "\n" + n.raw, s.text += "\n" + n.text, this.inlineQueue[this.inlineQueue.length - 1].src = s.text); else if (n = this.tokenizer.fences(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.heading(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.hr(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.blockquote(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.list(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.html(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.def(e)) e = e.substring(n.raw.length), s = t[t.length - 1], !s || "paragraph" !== s.type && "text" !== s.type ? this.tokens.links[n.tag] || (this.tokens.links[n.tag] = { - href: n.href, - title: n.title - }) : (s.raw += "\n" + n.raw, s.text += "\n" + n.raw, this.inlineQueue[this.inlineQueue.length - 1].src = s.text); else if (n = this.tokenizer.table(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.lheading(e)) e = e.substring(n.raw.length), t.push(n); else { - if (r = e, this.options.extensions && this.options.extensions.startBlock) { - let t = 1 / 0; - const n = e.slice(1); - let s; - this.options.extensions.startBlock.forEach((e => { - s = e.call({lexer: this}, n), "number" == typeof s && s >= 0 && (t = Math.min(t, s)) - })), t < 1 / 0 && t >= 0 && (r = e.substring(0, t + 1)) - } - if (this.state.top && (n = this.tokenizer.paragraph(r))) s = t[t.length - 1], i && "paragraph" === s.type ? (s.raw += "\n" + n.raw, s.text += "\n" + n.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = s.text) : t.push(n), i = r.length !== e.length, e = e.substring(n.raw.length); else if (n = this.tokenizer.text(e)) e = e.substring(n.raw.length), s = t[t.length - 1], s && "text" === s.type ? (s.raw += "\n" + n.raw, s.text += "\n" + n.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = s.text) : t.push(n); else if (e) { - const t = "Infinite loop on byte: " + e.charCodeAt(0); - if (this.options.silent) { - console.error(t); - break - } - throw new Error(t) - } - } - return this.state.top = !0, t - } - - inline(e, t = []) { - return this.inlineQueue.push({src: e, tokens: t}), t - } - - inlineTokens(e, t = []) { - let n, s, r, i, l, o, a = e; - if (this.tokens.links) { - const e = Object.keys(this.tokens.links); - if (e.length > 0) for (; null != (i = this.tokenizer.rules.inline.reflinkSearch.exec(a));) e.includes(i[0].slice(i[0].lastIndexOf("[") + 1, -1)) && (a = a.slice(0, i.index) + "[" + "a".repeat(i[0].length - 2) + "]" + a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex)) - } - for (; null != (i = this.tokenizer.rules.inline.blockSkip.exec(a));) a = a.slice(0, i.index) + "[" + "a".repeat(i[0].length - 2) + "]" + a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex); - for (; null != (i = this.tokenizer.rules.inline.anyPunctuation.exec(a));) a = a.slice(0, i.index) + "++" + a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex); - for (; e;) if (l || (o = ""), l = !1, !(this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((s => !!(n = s.call({lexer: this}, e, t)) && (e = e.substring(n.raw.length), t.push(n), !0))))) if (n = this.tokenizer.escape(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.tag(e)) e = e.substring(n.raw.length), s = t[t.length - 1], s && "text" === n.type && "text" === s.type ? (s.raw += n.raw, s.text += n.text) : t.push(n); else if (n = this.tokenizer.link(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.reflink(e, this.tokens.links)) e = e.substring(n.raw.length), s = t[t.length - 1], s && "text" === n.type && "text" === s.type ? (s.raw += n.raw, s.text += n.text) : t.push(n); else if (n = this.tokenizer.emStrong(e, a, o)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.codespan(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.br(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.del(e)) e = e.substring(n.raw.length), t.push(n); else if (n = this.tokenizer.autolink(e)) e = e.substring(n.raw.length), t.push(n); else if (this.state.inLink || !(n = this.tokenizer.url(e))) { - if (r = e, this.options.extensions && this.options.extensions.startInline) { - let t = 1 / 0; - const n = e.slice(1); - let s; - this.options.extensions.startInline.forEach((e => { - s = e.call({lexer: this}, n), "number" == typeof s && s >= 0 && (t = Math.min(t, s)) - })), t < 1 / 0 && t >= 0 && (r = e.substring(0, t + 1)) - } - if (n = this.tokenizer.inlineText(r)) e = e.substring(n.raw.length), "_" !== n.raw.slice(-1) && (o = n.raw.slice(-1)), l = !0, s = t[t.length - 1], s && "text" === s.type ? (s.raw += n.raw, s.text += n.text) : t.push(n); else if (e) { - const t = "Infinite loop on byte: " + e.charCodeAt(0); - if (this.options.silent) { - console.error(t); - break - } - throw new Error(t) - } - } else e = e.substring(n.raw.length), t.push(n); - return t - } - } - - class y { - options; - - constructor(t) { - this.options = t || e.defaults - } - - code(e, t, n) { - const s = (t || "").match(/^\S*/)?.[0]; - return e = e.replace(/\n$/, "") + "\n", s ? '
    ' + (n ? e : c(e, !0)) + "
    \n" : "
    " + (n ? e : c(e, !0)) + "
    \n" - } - - blockquote(e) { - return `
    \n${e}
    \n` - } - - html(e, t) { - return e - } - - heading(e, t, n) { - return `${e}\n` - } - - hr() { - return "
    \n" - } - - list(e, t, n) { - const s = t ? "ol" : "ul"; - return "<" + s + (t && 1 !== n ? ' start="' + n + '"' : "") + ">\n" + e + "\n" - } - - listitem(e, t, n) { - return `
  • ${e}
  • \n` - } - - checkbox(e) { - return "' - } - - paragraph(e) { - return `

    ${e}

    \n` - } - - table(e, t) { - return t && (t = `${t}`), "\n\n" + e + "\n" + t + "
    \n" - } - - tablerow(e) { - return `\n${e}\n` - } - - tablecell(e, t) { - const n = t.header ? "th" : "td"; - return (t.align ? `<${n} align="${t.align}">` : `<${n}>`) + e + `\n` - } - - strong(e) { - return `${e}` - } - - em(e) { - return `${e}` - } - - codespan(e) { - return `${e}` - } - - br() { - return "
    " - } - - del(e) { - return `${e}` - } - - link(e, t, n) { - const s = g(e); - if (null === s) return n; - let r = '
    ", r - } - - image(e, t, n) { - const s = g(e); - if (null === s) return n; - let r = `${n} "colon" === (t = t.toLowerCase()) ? ":" : "#" === t.charAt(0) ? "x" === t.charAt(1) ? String.fromCharCode(parseInt(t.substring(2), 16)) : String.fromCharCode(+t.substring(1)) : ""))); - continue - } - case"code": { - const e = r; - n += this.renderer.code(e.text, e.lang, !!e.escaped); - continue - } - case"table": { - const e = r; - let t = "", s = ""; - for (let t = 0; t < e.header.length; t++) s += this.renderer.tablecell(this.parseInline(e.header[t].tokens), { - header: !0, - align: e.align[t] - }); - t += this.renderer.tablerow(s); - let i = ""; - for (let t = 0; t < e.rows.length; t++) { - const n = e.rows[t]; - s = ""; - for (let t = 0; t < n.length; t++) s += this.renderer.tablecell(this.parseInline(n[t].tokens), { - header: !1, - align: e.align[t] - }); - i += this.renderer.tablerow(s) - } - n += this.renderer.table(t, i); - continue - } - case"blockquote": { - const e = r, t = this.parse(e.tokens); - n += this.renderer.blockquote(t); - continue - } - case"list": { - const e = r, t = e.ordered, s = e.start, i = e.loose; - let l = ""; - for (let t = 0; t < e.items.length; t++) { - const n = e.items[t], s = n.checked, r = n.task; - let o = ""; - if (n.task) { - const e = this.renderer.checkbox(!!s); - i ? n.tokens.length > 0 && "paragraph" === n.tokens[0].type ? (n.tokens[0].text = e + " " + n.tokens[0].text, n.tokens[0].tokens && n.tokens[0].tokens.length > 0 && "text" === n.tokens[0].tokens[0].type && (n.tokens[0].tokens[0].text = e + " " + n.tokens[0].tokens[0].text)) : n.tokens.unshift({ - type: "text", - text: e + " " - }) : o += e + " " - } - o += this.parse(n.tokens, i), l += this.renderer.listitem(o, r, !!s) - } - n += this.renderer.list(l, t, s); - continue - } - case"html": { - const e = r; - n += this.renderer.html(e.text, e.block); - continue - } - case"paragraph": { - const e = r; - n += this.renderer.paragraph(this.parseInline(e.tokens)); - continue - } - case"text": { - let i = r, l = i.tokens ? this.parseInline(i.tokens) : i.text; - for (; s + 1 < e.length && "text" === e[s + 1].type;) i = e[++s], l += "\n" + (i.tokens ? this.parseInline(i.tokens) : i.text); - n += t ? this.renderer.paragraph(l) : l; - continue - } - default: { - const e = 'Token with "' + r.type + '" type was not found.'; - if (this.options.silent) return console.error(e), ""; - throw new Error(e) - } - } - } - return n - } - - parseInline(e, t) { - t = t || this.renderer; - let n = ""; - for (let s = 0; s < e.length; s++) { - const r = e[s]; - if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[r.type]) { - const e = this.options.extensions.renderers[r.type].call({parser: this}, r); - if (!1 !== e || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(r.type)) { - n += e || ""; - continue - } - } - switch (r.type) { - case"escape": { - const e = r; - n += t.text(e.text); - break - } - case"html": { - const e = r; - n += t.html(e.text); - break - } - case"link": { - const e = r; - n += t.link(e.href, e.title, this.parseInline(e.tokens, t)); - break - } - case"image": { - const e = r; - n += t.image(e.href, e.title, e.text); - break - } - case"strong": { - const e = r; - n += t.strong(this.parseInline(e.tokens, t)); - break - } - case"em": { - const e = r; - n += t.em(this.parseInline(e.tokens, t)); - break - } - case"codespan": { - const e = r; - n += t.codespan(e.text); - break - } - case"br": - n += t.br(); - break; - case"del": { - const e = r; - n += t.del(this.parseInline(e.tokens, t)); - break - } - case"text": { - const e = r; - n += t.text(e.text); - break - } - default: { - const e = 'Token with "' + r.type + '" type was not found.'; - if (this.options.silent) return console.error(e), ""; - throw new Error(e) - } - } - } - return n - } - } - - class T { - options; - - constructor(t) { - this.options = t || e.defaults - } - - static passThroughHooks = new Set(["preprocess", "postprocess"]); - - preprocess(e) { - return e - } - - postprocess(e) { - return e - } - } - - class R { - defaults = { - async: !1, - breaks: !1, - extensions: null, - gfm: !0, - hooks: null, - pedantic: !1, - renderer: null, - silent: !1, - tokenizer: null, - walkTokens: null - }; - options = this.setOptions; - parse = this.#e(_.lex, z.parse); - parseInline = this.#e(_.lexInline, z.parseInline); - Parser = z; - parser = z.parse; - Renderer = y; - TextRenderer = $; - Lexer = _; - lexer = _.lex; - Tokenizer = b; - Hooks = T; - - constructor(...e) { - this.use(...e) - } - - walkTokens(e, t) { - let n = []; - for (const s of e) switch (n = n.concat(t.call(this, s)), s.type) { - case"table": { - const e = s; - for (const s of e.header) n = n.concat(this.walkTokens(s.tokens, t)); - for (const s of e.rows) for (const e of s) n = n.concat(this.walkTokens(e.tokens, t)); - break - } - case"list": { - const e = s; - n = n.concat(this.walkTokens(e.items, t)); - break - } - default: { - const e = s; - this.defaults.extensions?.childTokens?.[e.type] ? this.defaults.extensions.childTokens[e.type].forEach((s => { - n = n.concat(this.walkTokens(e[s], t)) - })) : e.tokens && (n = n.concat(this.walkTokens(e.tokens, t))) - } - } - return n - } - - use(...e) { - const t = this.defaults.extensions || {renderers: {}, childTokens: {}}; - return e.forEach((e => { - const n = {...e}; - if (n.async = this.defaults.async || n.async || !1, e.extensions && (e.extensions.forEach((e => { - if (!e.name) throw new Error("extension name required"); - if ("renderer" in e) { - const n = t.renderers[e.name]; - t.renderers[e.name] = n ? function (...t) { - let s = e.renderer.apply(this, t); - return !1 === s && (s = n.apply(this, t)), s - } : e.renderer - } - if ("tokenizer" in e) { - if (!e.level || "block" !== e.level && "inline" !== e.level) throw new Error("extension level must be 'block' or 'inline'"); - const n = t[e.level]; - n ? n.unshift(e.tokenizer) : t[e.level] = [e.tokenizer], e.start && ("block" === e.level ? t.startBlock ? t.startBlock.push(e.start) : t.startBlock = [e.start] : "inline" === e.level && (t.startInline ? t.startInline.push(e.start) : t.startInline = [e.start])) - } - "childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens) - })), n.extensions = t), e.renderer) { - const t = this.defaults.renderer || new y(this.defaults); - for (const n in e.renderer) { - const s = e.renderer[n], r = n, i = t[r]; - t[r] = (...e) => { - let n = s.apply(t, e); - return !1 === n && (n = i.apply(t, e)), n || "" - } - } - n.renderer = t - } - if (e.tokenizer) { - const t = this.defaults.tokenizer || new b(this.defaults); - for (const n in e.tokenizer) { - const s = e.tokenizer[n], r = n, i = t[r]; - t[r] = (...e) => { - let n = s.apply(t, e); - return !1 === n && (n = i.apply(t, e)), n - } - } - n.tokenizer = t - } - if (e.hooks) { - const t = this.defaults.hooks || new T; - for (const n in e.hooks) { - const s = e.hooks[n], r = n, i = t[r]; - T.passThroughHooks.has(n) ? t[r] = e => { - if (this.defaults.async) return Promise.resolve(s.call(t, e)).then((e => i.call(t, e))); - const n = s.call(t, e); - return i.call(t, n) - } : t[r] = (...e) => { - let n = s.apply(t, e); - return !1 === n && (n = i.apply(t, e)), n - } - } - n.hooks = t - } - if (e.walkTokens) { - const t = this.defaults.walkTokens, s = e.walkTokens; - n.walkTokens = function (e) { - let n = []; - return n.push(s.call(this, e)), t && (n = n.concat(t.call(this, e))), n - } - } - this.defaults = {...this.defaults, ...n} - })), this - } - - setOptions(e) { - return this.defaults = {...this.defaults, ...e}, this - } - - #e(e, t) { - return (n, s) => { - const r = {...s}, i = {...this.defaults, ...r}; - !0 === this.defaults.async && !1 === r.async && (i.silent || console.warn("marked(): The async option was set to true by an extension. The async: false option sent to unresolved will be ignored."), i.async = !0); - const l = this.#t(!!i.silent, !!i.async); - if (null == n) return l(new Error("marked(): input parameter is undefined or null")); - if ("string" != typeof n) return l(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected")); - if (i.hooks && (i.hooks.options = i), i.async) return Promise.resolve(i.hooks ? i.hooks.preprocess(n) : n).then((t => e(t, i))).then((e => i.walkTokens ? Promise.all(this.walkTokens(e, i.walkTokens)).then((() => e)) : e)).then((e => t(e, i))).then((e => i.hooks ? i.hooks.postprocess(e) : e)).catch(l); - try { - i.hooks && (n = i.hooks.preprocess(n)); - const s = e(n, i); - i.walkTokens && this.walkTokens(s, i.walkTokens); - let r = t(s, i); - return i.hooks && (r = i.hooks.postprocess(r)), r - } catch (e) { - return l(e) - } - } - } - - #t(e, t) { - return n => { - if (n.message += "\nPlease report this to https://github.com/markedjs/marked.", e) { - const e = "

    An error occurred:

    " + c(n.message + "", !0) + "
    "; - return t ? Promise.resolve(e) : e - } - if (t) return Promise.reject(n); - throw n - } - } - } - - const S = new R; - - function A(e, t) { - return S.parse(e, t) - } - - A.options = A.setOptions = function (e) { - return S.setOptions(e), A.defaults = S.defaults, n(A.defaults), A - }, A.getDefaults = t, A.defaults = e.defaults, A.use = function (...e) { - return S.use(...e), A.defaults = S.defaults, n(A.defaults), A - }, A.walkTokens = function (e, t) { - return S.walkTokens(e, t) - }, A.parseInline = S.parseInline, A.Parser = z, A.parser = z.parse, A.Renderer = y, A.TextRenderer = $, A.Lexer = _, A.lexer = _.lex, A.Tokenizer = b, A.Hooks = T, A.parse = A; - const I = A.options, E = A.setOptions, Z = A.use, q = A.walkTokens, L = A.parseInline, D = A, P = z.parse, - v = _.lex; - e.Hooks = T, e.Lexer = _, e.Marked = R, e.Parser = z, e.Renderer = y, e.TextRenderer = $, e.Tokenizer = b, e.getDefaults = t, e.lexer = v, e.marked = A, e.options = I, e.parse = D, e.parseInline = L, e.parser = P, e.setOptions = E, e.use = Z, e.walkTokens = q -})); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).marked={})}(this,(function(e){"use strict";function t(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function n(t){e.defaults=t}e.defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};const s=/[&<>"']/,r=new RegExp(s.source,"g"),i=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,l=new RegExp(i.source,"g"),o={"&":"&","<":"<",">":">",'"':""","'":"'"},a=e=>o[e];function c(e,t){if(t){if(s.test(e))return e.replace(r,a)}else if(i.test(e))return e.replace(l,a);return e}const h=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;const p=/(^|[^\[])\^/g;function u(e,t){e="string"==typeof e?e:e.source,t=t||"";const n={replace:(t,s)=>(s=(s="object"==typeof s&&"source"in s?s.source:s).replace(p,"$1"),e=e.replace(t,s),n),getRegex:()=>new RegExp(e,t)};return n}function g(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const k={exec:()=>null};function f(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let s=!1,r=t;for(;--r>=0&&"\\"===n[r];)s=!s;return s?"|":" |"})).split(/ \|/);let s=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:d(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const s=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=s.length?e.slice(s.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=d(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=d(t[0].replace(/^ *>[ \t]?/gm,""),"\n"),n=this.lexer.state.top;this.lexer.state.top=!0;const s=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:s,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const s=n.length>1,r={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");const i=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let l="",o="",a=!1;for(;e;){let n=!1;if(!(t=i.exec(e)))break;if(this.rules.block.hr.test(e))break;l=t[0],e=e.substring(l.length);let s=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),c=e.split("\n",1)[0],h=0;this.options.pedantic?(h=2,o=s.trimStart()):(h=t[2].search(/[^ ]/),h=h>4?1:h,o=s.slice(h),h+=t[1].length);let p=!1;if(!s&&/^ *$/.test(c)&&(l+=c+"\n",e=e.substring(c.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,h-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,h-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),r=new RegExp(`^ {0,${Math.min(3,h-1)}}(?:\`\`\`|~~~)`),i=new RegExp(`^ {0,${Math.min(3,h-1)}}#`);for(;e;){const a=e.split("\n",1)[0];if(c=a,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),r.test(c))break;if(i.test(c))break;if(t.test(c))break;if(n.test(e))break;if(c.search(/[^ ]/)>=h||!c.trim())o+="\n"+c.slice(h);else{if(p)break;if(s.search(/[^ ]/)>=4)break;if(r.test(s))break;if(i.test(s))break;if(n.test(s))break;o+="\n"+c}p||c.trim()||(p=!0),l+=a+"\n",e=e.substring(a.length+1),s=c.slice(h)}}r.loose||(a?r.loose=!0:/\n *\n *$/.test(l)&&(a=!0));let u,g=null;this.options.gfm&&(g=/^\[[ xX]\] /.exec(o),g&&(u="[ ] "!==g[0],o=o.replace(/^\[[ xX]\] +/,""))),r.items.push({type:"list_item",raw:l,task:!!g,checked:u,loose:!1,text:o,tokens:[]}),r.raw+=l}r.items[r.items.length-1].raw=l.trimEnd(),r.items[r.items.length-1].text=o.trimEnd(),r.raw=r.raw.trimEnd();for(let e=0;e"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));r.loose=n}if(r.loose)for(let e=0;e$/,"$1").replace(this.rules.inline._escapes,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:s}}}table(e){const t=this.rules.block.table.exec(e);if(t){if(!/[:|]/.test(t[2]))return;const e={type:"table",raw:t[0],header:f(t[1]).map((e=>({text:e,tokens:[]}))),align:t[2].replace(/^\||\| *$/g,"").split("|"),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){let t,n,s,r,i=e.align.length;for(t=0;t({text:e,tokens:[]})));for(i=e.header.length,n=0;n/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=d(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let s=0;s-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],s="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],s=e[3])}else s=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(e)?n.slice(1):n.slice(1,-1)),x(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:s?s.replace(this.rules.inline._escapes,"$1"):s},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return x(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let s=this.rules.inline.emStrong.lDelim.exec(e);if(!s)return;if(s[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(s[1]||s[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...s[0]].length-1;let r,i,l=n,o=0;const a="*"===s[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(a.lastIndex=0,t=t.slice(-1*e.length+s[0].length-1);null!=(s=a.exec(t));){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r)continue;if(i=[...r].length,s[3]||s[4]){l+=i;continue}if((s[5]||s[6])&&n%3&&!((n+i)%3)){o+=i;continue}if(l-=i,l>0)continue;i=Math.min(i,i+l+o);const t=[...e].slice(0,n+s.index+i+1).join("");if(Math.min(n,i)%2){const e=t.slice(1,-1);return{type:"em",raw:t,text:e,tokens:this.lexer.inlineTokens(e)}}const a=t.slice(2,-2);return{type:"strong",raw:t,text:a,tokens:this.lexer.inlineTokens(a)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),s=/^ /.test(e)&&/ $/.test(e);return n&&s&&(e=e.substring(1,e.length-1)),e=c(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=c(t[1]),n="mailto:"+e):(e=c(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=c(t[0]),n="mailto:"+e;else{let s;do{s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])[0]}while(s!==t[0]);e=c(t[0]),n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:c(t[0]),{type:"text",raw:t[0],text:e}}}}const m={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]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:k,lheading:/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};m.def=u(m.def).replace("label",m._label).replace("title",m._title).getRegex(),m.bullet=/(?:[*+-]|\d{1,9}[.)])/,m.listItemStart=u(/^( *)(bull) */).replace("bull",m.bullet).getRegex(),m.list=u(m.list).replace(/bull/g,m.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+m.def.source+")").getRegex(),m._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",m._comment=/|$)/,m.html=u(m.html,"i").replace("comment",m._comment).replace("tag",m._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),m.lheading=u(m.lheading).replace(/bull/g,m.bullet).getRegex(),m.paragraph=u(m._paragraph).replace("hr",m.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").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",")|<(?:script|pre|style|textarea|!--)").replace("tag",m._tag).getRegex(),m.blockquote=u(m.blockquote).replace("paragraph",m.paragraph).getRegex(),m.normal={...m},m.gfm={...m.normal,table:"^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},m.gfm.table=u(m.gfm.table).replace("hr",m.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").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",")|<(?:script|pre|style|textarea|!--)").replace("tag",m._tag).getRegex(),m.gfm.paragraph=u(m._paragraph).replace("hr",m.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",m.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",m._tag).getRegex(),m.pedantic={...m.normal,html:u("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",m._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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:k,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:u(m.normal._paragraph).replace("hr",m.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",m.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const w={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:k,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,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])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:k,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`^|~"};w.punctuation=u(w.punctuation,"u").replace(/punctuation/g,w._punctuation).getRegex(),w.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,w.anyPunctuation=/\\[punct]/g,w._escapes=/\\([punct])/g,w._comment=u(m._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),w.emStrong.lDelim=u(w.emStrong.lDelim,"u").replace(/punct/g,w._punctuation).getRegex(),w.emStrong.rDelimAst=u(w.emStrong.rDelimAst,"gu").replace(/punct/g,w._punctuation).getRegex(),w.emStrong.rDelimUnd=u(w.emStrong.rDelimUnd,"gu").replace(/punct/g,w._punctuation).getRegex(),w.anyPunctuation=u(w.anyPunctuation,"gu").replace(/punct/g,w._punctuation).getRegex(),w._escapes=u(w._escapes,"gu").replace(/punct/g,w._punctuation).getRegex(),w._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,w._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])?)+(?![-_])/,w.autolink=u(w.autolink).replace("scheme",w._scheme).replace("email",w._email).getRegex(),w._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,w.tag=u(w.tag).replace("comment",w._comment).replace("attribute",w._attribute).getRegex(),w._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,w._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,w._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,w.link=u(w.link).replace("label",w._label).replace("href",w._href).replace("title",w._title).getRegex(),w.reflink=u(w.reflink).replace("label",w._label).replace("ref",m._label).getRegex(),w.nolink=u(w.nolink).replace("ref",m._label).getRegex(),w.reflinkSearch=u(w.reflinkSearch,"g").replace("reflink",w.reflink).replace("nolink",w.nolink).getRegex(),w.normal={...w},w.pedantic={...w.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:u(/^!?\[(label)\]\((.*?)\)/).replace("label",w._label).getRegex(),reflink:u(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",w._label).getRegex()},w.gfm={...w.normal,escape:u(w.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]*?(?:(?=[\\t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((s=>!!(n=s.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),s=t[t.length-1],!s||"paragraph"!==s.type&&"text"!==s.type?t.push(n):(s.raw+="\n"+n.raw,s.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=s.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),s=t[t.length-1],!s||"paragraph"!==s.type&&"text"!==s.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(s.raw+="\n"+n.raw,s.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=s.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(r=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let s;this.options.extensions.startBlock.forEach((e=>{s=e.call({lexer:this},n),"number"==typeof s&&s>=0&&(t=Math.min(t,s))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(r)))s=t[t.length-1],i&&"paragraph"===s.type?(s.raw+="\n"+n.raw,s.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n),i=r.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),s=t[t.length-1],s&&"text"===s.type?(s.raw+="\n"+n.raw,s.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,s,r,i,l,o,a=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(a));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(a));)a=a.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.anyPunctuation.exec(a));)a=a.slice(0,i.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(l||(o=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((s=>!!(n=s.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),s=t[t.length-1],s&&"text"===n.type&&"text"===s.type?(s.raw+=n.raw,s.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),s=t[t.length-1],s&&"text"===n.type&&"text"===s.type?(s.raw+=n.raw,s.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,a,o))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(r=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let s;this.options.extensions.startInline.forEach((e=>{s=e.call({lexer:this},n),"number"==typeof s&&s>=0&&(t=Math.min(t,s))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(r))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(o=n.raw.slice(-1)),l=!0,s=t[t.length-1],s&&"text"===s.type?(s.raw+=n.raw,s.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class y{options;constructor(t){this.options=t||e.defaults}code(e,t,n){const s=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+"\n",s?'
    '+(n?e:c(e,!0))+"
    \n":"
    "+(n?e:c(e,!0))+"
    \n"}blockquote(e){return`
    \n${e}
    \n`}html(e,t){return e}heading(e,t,n){return`${e}\n`}hr(){return"
    \n"}list(e,t,n){const s=t?"ol":"ul";return"<"+s+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"}listitem(e,t,n){return`
  • ${e}
  • \n`}checkbox(e){return"'}paragraph(e){return`

    ${e}

    \n`}table(e,t){return t&&(t=`${t}`),"\n\n"+e+"\n"+t+"
    \n"}tablerow(e){return`\n${e}\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`\n`}strong(e){return`${e}`}em(e){return`${e}`}codespan(e){return`${e}`}br(){return"
    "}del(e){return`${e}`}link(e,t,n){const s=g(e);if(null===s)return n;let r='
    ",r}image(e,t,n){const s=g(e);if(null===s)return n;let r=`${n}"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):"")));continue}case"code":{const e=r;n+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case"table":{const e=r;let t="",s="";for(let t=0;t0&&"paragraph"===n.tokens[0].type?(n.tokens[0].text=e+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&"text"===n.tokens[0].tokens[0].type&&(n.tokens[0].tokens[0].text=e+" "+n.tokens[0].tokens[0].text)):n.tokens.unshift({type:"text",text:e+" "}):o+=e+" "}o+=this.parse(n.tokens,i),l+=this.renderer.listitem(o,r,!!s)}n+=this.renderer.list(l,t,s);continue}case"html":{const e=r;n+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=r;n+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let i=r,l=i.tokens?this.parseInline(i.tokens):i.text;for(;s+1{n=n.concat(this.walkTokens(e[s],t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let s=e.renderer.apply(this,t);return!1===s&&(s=n.apply(this,t)),s}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new y(this.defaults);for(const n in e.renderer){const s=e.renderer[n],r=n,i=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=i.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new b(this.defaults);for(const n in e.tokenizer){const s=e.tokenizer[n],r=n,i=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new T;for(const n in e.hooks){const s=e.hooks[n],r=n,i=t[r];T.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(s.call(t,e)).then((e=>i.call(t,e)));const n=s.call(t,e);return i.call(t,n)}:t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,s=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(s.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}#e(e,t){return(n,s)=>{const r={...s},i={...this.defaults,...r};!0===this.defaults.async&&!1===r.async&&(i.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),i.async=!0);const l=this.#t(!!i.silent,!!i.async);if(null==n)return l(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(i.hooks&&(i.hooks.options=i),i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then((t=>e(t,i))).then((e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then((()=>e)):e)).then((e=>t(e,i))).then((e=>i.hooks?i.hooks.postprocess(e):e)).catch(l);try{i.hooks&&(n=i.hooks.preprocess(n));const s=e(n,i);i.walkTokens&&this.walkTokens(s,i.walkTokens);let r=t(s,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return l(e)}}}#t(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="

    An error occurred:

    "+c(n.message+"",!0)+"
    ";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}}const S=new R;function A(e,t){return S.parse(e,t)}A.options=A.setOptions=function(e){return S.setOptions(e),A.defaults=S.defaults,n(A.defaults),A},A.getDefaults=t,A.defaults=e.defaults,A.use=function(...e){return S.use(...e),A.defaults=S.defaults,n(A.defaults),A},A.walkTokens=function(e,t){return S.walkTokens(e,t)},A.parseInline=S.parseInline,A.Parser=z,A.parser=z.parse,A.Renderer=y,A.TextRenderer=$,A.Lexer=_,A.lexer=_.lex,A.Tokenizer=b,A.Hooks=T,A.parse=A;const I=A.options,E=A.setOptions,Z=A.use,q=A.walkTokens,L=A.parseInline,D=A,P=z.parse,v=_.lex;e.Hooks=T,e.Lexer=_,e.Marked=R,e.Parser=z,e.Renderer=y,e.TextRenderer=$,e.Tokenizer=b,e.getDefaults=t,e.lexer=v,e.marked=A,e.options=I,e.parse=D,e.parseInline=L,e.parser=P,e.setOptions=E,e.use=Z,e.walkTokens=q})); const fastn = (function (fastn) { class Closure { #cached_value; @@ -1816,8 +656,8 @@ const fastn = (function (fastn) { if (!(key in obj.#fields)) { throw new Error( "RecordInstance.replace: key " + - key + - " not present in new object", + key + + " not present in new object", ); } this.#fields[key] = fastn.wrapMutable(obj.#fields[key]); @@ -2705,7 +1545,6 @@ fastn_dom.Event = { class PropertyValueAsClosure { closureFunction; deps; - constructor(closureFunction, deps) { this.closureFunction = closureFunction; this.deps = deps; @@ -2732,7 +1571,6 @@ class Node2 { */ #extraData; #children; - constructor(parentOrSibiling, kind) { this.#kind = kind; this.#parent = parentOrSibiling; @@ -2774,7 +1612,6 @@ class Node2 { this.#parent.appendChild(this.#node); } } - createNode(kind) { if (kind === fastn_dom.ElementKind.Code) { let [node, classes, attributes] = fastn_utils.htmlNode(kind); @@ -2797,15 +1634,12 @@ class Node2 { ); } } - getTagName() { return this.#tagName; } - getParent() { return this.#parent; } - removeAllFaviconLinks() { if (doubleBuffering) { const links = document.head.querySelectorAll( @@ -2816,7 +1650,6 @@ class Node2 { }); } } - setFavicon(url) { if (doubleBuffering) { if (url instanceof fastn.recordInstanceClass) url = url.get("src"); @@ -2833,7 +1666,6 @@ class Node2 { document.head.appendChild(link_element); } } - updateTextInputValue() { if (fastn_utils.isNull(this.#rawInnerValue)) { this.attachAttribute("value"); @@ -2845,7 +1677,6 @@ class Node2 { this.attachAttribute("value", this.#rawInnerValue); } } - // for attaching inline attributes attachAttribute(property, value) { // If the value is null, undefined, or false, the attribute will be removed. @@ -2856,11 +1687,9 @@ class Node2 { } this.#node.setAttribute(property, value); } - removeAttribute(property) { this.#node.removeAttribute(property); } - updateTagName(name) { if (ssr) { this.#node.updateTagName(name); @@ -2881,7 +1710,6 @@ class Node2 { this.#node = newElement; } } - updateToAnchor(url) { let node_kind = this.#kind; if (ssr) { @@ -2902,7 +1730,6 @@ class Node2 { this.#node.href = url; } } - updatePositionForNodeById(node_id, value) { if (!ssr) { const target_node = fastnVirtual.root.querySelector( @@ -2912,7 +1739,6 @@ class Node2 { target_node.style["position"] = value; } } - updateParentPosition(value) { if (ssr) { let parent = this.#parent; @@ -2926,13 +1752,11 @@ class Node2 { } } } - updateMetaTitle(value) { if (!ssr && doubleBuffering) { if (!fastn_utils.isNull(value)) window.document.title = value; } } - addMetaTagByName(name, value) { if (value === null || value === undefined) { this.removeMetaTagByName(name); @@ -2945,7 +1769,6 @@ class Node2 { document.head.appendChild(metaTag); } } - addMetaTagByProperty(property, value) { if (value === null || value === undefined) { this.removeMetaTagByProperty(property); @@ -2958,7 +1781,6 @@ class Node2 { document.head.appendChild(metaTag); } } - removeMetaTagByName(name) { if (!ssr && doubleBuffering) { const metaTags = document.getElementsByTagName("meta"); @@ -2971,7 +1793,6 @@ class Node2 { } } } - removeMetaTagByProperty(property) { if (!ssr && doubleBuffering) { const metaTags = document.getElementsByTagName("meta"); @@ -2984,7 +1805,6 @@ class Node2 { } } } - // dynamic-class-css attachCss(property, value, createClass, className) { let propertyShort = fastn_dom.propertyMap[property] || property; @@ -3000,7 +1820,7 @@ class Node2 { } let cssClass = className ? cls : `.${cls}`; - const obj = {property, value}; + const obj = { property, value }; if (value === undefined) { if (!ssr) { @@ -3063,7 +1883,6 @@ class Node2 { this.#node.classList.add(cls); return cls; } - attachShadow(value) { if (fastn_utils.isNull(value)) { this.attachCss("box-shadow", value); @@ -3099,7 +1918,6 @@ class Node2 { ); } } - attachBackdropMultiFilter(value) { const filters = { blur: fastn_utils.getStaticValue(value.get("blur")), @@ -3119,7 +1937,6 @@ class Node2 { this.attachCss("backdrop-filter", filterString, false); } - attachTextShadow(value) { if (fastn_utils.isNull(value)) { this.attachCss("text-shadow", value); @@ -3151,7 +1968,6 @@ class Node2 { ); } } - getLinearGradientString(value) { var lightGradientString = ""; var darkGradientString = ""; @@ -3197,7 +2013,6 @@ class Node2 { return [lightGradientString, darkGradientString]; } - attachLinearGradientCss(value) { if (fastn_utils.isNull(value)) { this.attachCss("background-image", value); @@ -3237,7 +2052,7 @@ class Node2 { const colorsList = value.get("colors").get().getList(); - colorsList.forEach(({item}) => { + colorsList.forEach(({ item }) => { const color = item.get("color"); [color.get("light"), color.get("dark")].forEach((variant) => { @@ -3246,7 +2061,6 @@ class Node2 { }); }); } - attachBackgroundImageCss(value) { if (fastn_utils.isNull(value)) { this.attachCss("background-repeat", value); @@ -3308,7 +2122,6 @@ class Node2 { ); } } - attachMaskImageCss(value, vendorPrefix) { const propertyWithPrefix = vendorPrefix ? `${vendorPrefix}-mask-image` @@ -3397,7 +2210,6 @@ class Node2 { ); } } - attachMaskSizeCss(value, vendorPrefix) { const propertyNameWithPrefix = vendorPrefix ? `${vendorPrefix}-mask-size` @@ -3416,7 +2228,6 @@ class Node2 { this.attachCss(propertyNameWithPrefix, `${size_x} ${size_y}`, true); } } - attachMaskMultiCss(value, vendorPrefix) { if (fastn_utils.isNull(value)) { this.attachCss("mask-repeat", value); @@ -3450,7 +2261,6 @@ class Node2 { this.attachCss("-webkit-mask-position", maskPositionValue, true); } } - attachExternalCss(css) { if (!ssr) { let css_tag = document.createElement("link"); @@ -3466,7 +2276,6 @@ class Node2 { } } } - attachExternalJs(js) { if (!ssr) { let js_tag = document.createElement("script"); @@ -3480,7 +2289,6 @@ class Node2 { } } } - attachColorCss(property, value, visited) { if (fastn_utils.isNull(value)) { this.attachCss(property, value); @@ -3533,7 +2341,6 @@ class Node2 { this.#mutables.push(modeValue); }); } - attachRoleCss(value) { if (fastn_utils.isNull(value)) { this.attachCss("role", value); @@ -3573,7 +2380,6 @@ class Node2 { ); this.#mutables.push(value); } - attachTextStyles(styles) { if (fastn_utils.isNull(styles)) { this.attachCss("font-style", styles); @@ -3595,7 +2401,6 @@ class Node2 { } } } - attachAlignContent(value, node_kind) { if (fastn_utils.isNull(value)) { this.attachCss("align-items", value); @@ -3851,7 +2656,6 @@ class Node2 { ); this.#mutables.push(ftd.dark_mode); } - setStaticProperty(kind, value, inherited) { // value can be either static or mutable let staticValue = fastn_utils.getStaticValue(value); @@ -4488,7 +3292,7 @@ class Node2 { this.attachRoleCss(staticValue); } else if (kind === fastn_dom.PropertyKind.Code) { if (!fastn_utils.isNull(staticValue)) { - let {modifiedText, highlightedLines} = + let { modifiedText, highlightedLines } = fastn_utils.findAndRemoveHighlighter(staticValue); if (highlightedLines.length !== 0) { this.attachAttribute("data-line", highlightedLines); @@ -4630,24 +3434,23 @@ class Node2 { this.#node.innerHTML = staticValue; this.#rawInnerValue = staticValue; } else if (kind === fastn_dom.PropertyKind.StringValue) { - this.#rawInnerValue = staticValue; - staticValue = fastn_utils.markdown_inline( - fastn_utils.escapeHtmlInMarkdown(staticValue), - ); - staticValue = fastn_utils.process_post_markdown( - this.#node, - staticValue, - ); - if (!fastn_utils.isNull(staticValue)) { - this.#node.innerHTML = staticValue; - } else { - this.#node.innerHTML = ""; - } + this.#rawInnerValue = staticValue; + staticValue = fastn_utils.markdown_inline( + fastn_utils.escapeHtmlInMarkdown(staticValue), + ); + staticValue = fastn_utils.process_post_markdown( + this.#node, + staticValue, + ); + if (!fastn_utils.isNull(staticValue)) { + this.#node.innerHTML = staticValue; } else { - throw "invalid fastn_dom.PropertyKind: " + kind; + this.#node.innerHTML = ""; } + } else { + throw "invalid fastn_dom.PropertyKind: " + kind; + } } - setProperty(kind, value, inherited) { if (value instanceof fastn.mutableClass) { this.setDynamicProperty( @@ -4669,7 +3472,6 @@ class Node2 { this.setStaticProperty(kind, value, inherited); } } - setDynamicProperty(kind, deps, func, inherited) { let closure = fastn .closure(func) @@ -4682,26 +3484,21 @@ class Node2 { this.#mutables.push(deps[dep]); } } - getNode() { return this.#node; } - getExtraData() { return this.#extraData; } - getChildren() { return this.#children; } - mergeFnCalls(current, newFunc) { return () => { if (current instanceof Function) current(); if (newFunc instanceof Function) newFunc(); }; } - addEventHandler(event, func) { if (event === fastn_dom.Event.Click) { let onclickEvents = this.mergeFnCalls(this.#node.onclick, func); @@ -4743,7 +3540,6 @@ class Node2 { this.#node.onfocus = onFocusEvents; } } - destroy() { for (let i = 0; i < this.#mutables.length; i++) { this.#mutables[i].unlinkNode(this); @@ -4843,16 +3639,13 @@ fastn_dom.conditionalDom = function ( class ParentNodeWithSibiling { #parent; #sibiling; - constructor(parent, sibiling) { this.#parent = parent; this.#sibiling = sibiling; } - getParent() { return this.#parent; } - getSibiling() { return this.#sibiling; } @@ -4864,7 +3657,6 @@ class ForLoop { #wrapper; #parent; #nodes; - constructor(parent, node_constructor, list) { this.#wrapper = fastn_dom.createKernel( parent, @@ -4881,7 +3673,6 @@ class ForLoop { } fastn_utils.setFullHeight(); } - createNode(index, resizeBodyHeight = true) { if (resizeBodyHeight) { fastn_utils.resetFullHeight(); @@ -4904,7 +3695,6 @@ class ForLoop { } return node; } - createAllNode() { fastn_utils.resetFullHeight(); this.deleteAllNode(false); @@ -4913,7 +3703,6 @@ class ForLoop { } fastn_utils.setFullHeight(); } - deleteAllNode(resizeBodyHeight = true) { if (resizeBodyHeight) { fastn_utils.resetFullHeight(); @@ -4925,18 +3714,15 @@ class ForLoop { fastn_utils.setFullHeight(); } } - getWrapper() { return this.#wrapper; } - deleteNode(index) { fastn_utils.resetFullHeight(); let node = this.#nodes.splice(index, 1)[0]; node.destroy(); fastn_utils.setFullHeight(); } - getParent() { return this.#parent; } @@ -5272,7 +4058,7 @@ let fastn_utils = { markdown_inline(i) { if (fastn_utils.isNull(i)) return; i = i.toString(); - const {space_before, space_after} = fastn_utils.private.spaces(i); + const { space_before, space_after } = fastn_utils.private.spaces(i); const o = (() => { let g = fastn_utils.private.replace_last_occurrence( marked.parse(i), @@ -5610,7 +4396,7 @@ fastn_utils.private = { space_before = i + 1; } if (space_before === s.length) { - return {space_before, space_after: 0}; + return { space_before, space_after: 0 }; } let space_after = 0; @@ -5622,7 +4408,7 @@ fastn_utils.private = { space_after = i + 1; } - return {space_before, space_after}; + return { space_before, space_after }; }, /** * Helper function for `fastn_utils.markdown_inline` to replace the last @@ -5649,7 +4435,7 @@ fastn_utils.private = { * @returns {string} - A string with 'n' spaces concatenated together. */ repeated_space(n) { - return Array.from({length: n}, () => " ").join(""); + return Array.from({ length: n }, () => " ").join(""); }, /** * Merges consecutive numbers in a comma-separated list into ranges. @@ -5775,7 +4561,6 @@ let doubleBuffering = false; class ClassList { #classes = []; - add(item) { this.#classes.push(item); } @@ -5783,11 +4568,9 @@ class ClassList { remove(itemToRemove) { this.#classes.filter((item) => item !== itemToRemove); } - toString() { return this.#classes.join(" "); } - getClasses() { return this.#classes; } @@ -5799,7 +4582,6 @@ class Node { #tagName; #children; #attributes; - constructor(id, tagName) { this.#tagName = tagName; this.#dataId = id; @@ -5811,7 +4593,6 @@ class Node { this.onclick = null; this.id = null; } - appendChild(c) { this.#children.push(c); } @@ -5840,7 +4621,6 @@ class Node { updateTagName(tagName) { this.#tagName = tagName; } - // Caution: This is only supported in ssr mode toHtmlAsString() { const openingTag = `<${ @@ -5854,23 +4634,19 @@ class Node { return `${openingTag}${innerHTML}${childNodes}${closingTag}`; } - // Caution: This is only supported in ssr mode getDataIdString() { return ` data-id="${this.#dataId}"`; } - // Caution: This is only supported in ssr mode getIdString() { return fastn_utils.isNull(this.id) ? "" : ` id="${this.id}"`; } - // Caution: This is only supported in ssr mode getClassString() { const classList = this.classList.toString(); return classList ? ` class="${classList}"` : ""; } - // Caution: This is only supported in ssr mode getStyleString() { const styleProperties = Object.entries(this.style) @@ -5878,7 +4654,6 @@ class Node { .join(";"); return styleProperties ? ` style="${styleProperties}"` : ""; } - // Caution: This is only supported in ssr mode getAttributesString() { const nodeAttributes = Object.entries(this.#attributes) @@ -5952,10 +4727,8 @@ fastnVirtual.ssr = function (main) { id_counter = 0; return body.toHtmlAsString() + fastn_dom.getClassesAsString(); }; - class MutableVariable { #value; - constructor(value) { this.#value = value; } @@ -5967,7 +4740,6 @@ class MutableVariable { set(value) { this.#value.set(value); } - // Todo: Remove closure when node is removed. on_change(func) { this.#value.addClosure(fastn.closureWithoutExecute(func)); @@ -5976,15 +4748,12 @@ class MutableVariable { class MutableListVariable { #value; - constructor(value) { this.#value = value; } - get() { return fastn_utils.getStaticValue(this.#value); } - set(index, list) { if (list === undefined) { this.#value.set(fastn_utils.staticToMutables(index)); @@ -5992,27 +4761,21 @@ class MutableListVariable { } this.#value.set(index, fastn_utils.staticToMutables(list)); } - insertAt(index, value) { this.#value.insertAt(index, fastn_utils.staticToMutables(value)); } - deleteAt(index) { this.#value.deleteAt(index); } - push(value) { this.#value.push(value); } - pop() { this.#value.pop(); } - clearAll() { this.#value.clearAll(); } - on_change(func) { this.#value.addClosure(fastn.closureWithoutExecute(func)); } @@ -6020,7 +4783,6 @@ class MutableListVariable { class RecordVariable { #value; - constructor(value) { this.#value = value; } @@ -6037,11 +4799,9 @@ class RecordVariable { this.#value.addClosure(fastn.closureWithoutExecute(func)); } } - class StaticVariable { #value; #closures; - constructor(value) { this.#value = value; this.#closures = []; @@ -6282,7 +5042,7 @@ const ftd = (function () { method = method.trim().toUpperCase(); const init = { method, - headers: {"Content-Type": "application/json"}, + headers: { "Content-Type": "application/json" }, }; if (headers && headers instanceof fastn.recordInstanceClass) { Object.assign(init.headers, headers.toObject()); @@ -6586,7 +5346,7 @@ const ftd = (function () { redirect: "error", // TODO: set credentials? credentials: "same-origin", - headers: {"Content-Type": "application/json"}, + headers: { "Content-Type": "application/json" }, body: JSON.stringify(data), }; @@ -6679,7 +5439,6 @@ ftd.post_init = function () { window.onresize = function () { initialise_device(); }; - function initialise_click_outside_events() { document.addEventListener("click", function (event) { ftd.clickOutsideEvents.forEach(([ftdNode, func]) => { @@ -6694,7 +5453,6 @@ ftd.post_init = function () { }); }); } - function initialise_global_key_events() { let globalKeys = {}; let buffer = []; @@ -6753,7 +5511,6 @@ ftd.post_init = function () { globalKeys[fastn_utils.getEventKey(event)] = false; }); } - function initialise_device() { let current = ftd.get_device(); if (current === last_device) { @@ -6837,23 +5594,19 @@ ftd.post_init = function () { set_cookie(DARK_MODE_COOKIE, COOKIE_SYSTEM_LIGHT); } }; - function set_cookie(name, value) { document.cookie = name + "=" + value + "; path=/"; } - function system_dark_mode() { return !!( window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ); } - function initialise_dark_mode() { update_dark_mode(); start_watching_dark_mode_system_preference(); } - function get_cookie(name, def) { // source: https://stackoverflow.com/questions/5639346/ let regex = document.cookie.match( @@ -6861,7 +5614,6 @@ ftd.post_init = function () { ); return regex !== null ? regex.pop() : def; } - function update_dark_mode() { let current_dark_mode_cookie = get_cookie( DARK_MODE_COOKIE, @@ -6883,13 +5635,11 @@ ftd.post_init = function () { window.enable_system_mode(); } } - function start_watching_dark_mode_system_preference() { window .matchMedia("(prefers-color-scheme: dark)") .addEventListener("change", update_dark_mode); } - initialise_device(); initialise_dark_mode(); initialise_click_outside_events(); @@ -6901,218 +5651,234 @@ ftd.post_init = function () { window.ftd = ftd; ftd.toggle = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "fastn_stack_github_io_request_data_processor_test"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(!fastn_utils.getStaticValue(__args__.a)); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "fastn_stack_github_io_request_data_processor_test"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(!fastn_utils.getStaticValue(__args__.a)); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.integer_field_with_default = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "fastn_stack_github_io_request_data_processor_test"; - try { - let __args__ = fastn_utils.getArgs({}, args); - return (ftd.field_with_default_js(__args__.name, __args__.default)); - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "fastn_stack_github_io_request_data_processor_test"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + return (ftd.field_with_default_js(__args__.name, __args__.default)); + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.decimal_field_with_default = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "fastn_stack_github_io_request_data_processor_test"; - try { - let __args__ = fastn_utils.getArgs({}, args); - return (ftd.field_with_default_js(__args__.name, __args__.default)); - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "fastn_stack_github_io_request_data_processor_test"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + return (ftd.field_with_default_js(__args__.name, __args__.default)); + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.boolean_field_with_default = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "fastn_stack_github_io_request_data_processor_test"; - try { - let __args__ = fastn_utils.getArgs({}, args); - return (ftd.field_with_default_js(__args__.name, __args__.default)); - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "fastn_stack_github_io_request_data_processor_test"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + return (ftd.field_with_default_js(__args__.name, __args__.default)); + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.string_field_with_default = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "fastn_stack_github_io_request_data_processor_test"; - try { - let __args__ = fastn_utils.getArgs({}, args); - return (ftd.field_with_default_js(__args__.name, __args__.default)); - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "fastn_stack_github_io_request_data_processor_test"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + return (ftd.field_with_default_js(__args__.name, __args__.default)); + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.increment = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "fastn_stack_github_io_request_data_processor_test"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(fastn_utils.getStaticValue(__args__.a) + 1); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "fastn_stack_github_io_request_data_processor_test"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(fastn_utils.getStaticValue(__args__.a) + 1); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.increment_by = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "fastn_stack_github_io_request_data_processor_test"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(fastn_utils.getStaticValue(__args__.a) + fastn_utils.getStaticValue(__args__.v)); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "fastn_stack_github_io_request_data_processor_test"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(fastn_utils.getStaticValue(__args__.a) + fastn_utils.getStaticValue(__args__.v)); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.decrement = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "fastn_stack_github_io_request_data_processor_test"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(fastn_utils.getStaticValue(__args__.a) - 1); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "fastn_stack_github_io_request_data_processor_test"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(fastn_utils.getStaticValue(__args__.a) - 1); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.decrement_by = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "fastn_stack_github_io_request_data_processor_test"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(fastn_utils.getStaticValue(__args__.a) - fastn_utils.getStaticValue(__args__.v)); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "fastn_stack_github_io_request_data_processor_test"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(fastn_utils.getStaticValue(__args__.a) - fastn_utils.getStaticValue(__args__.v)); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.enable_light_mode = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "fastn_stack_github_io_request_data_processor_test"; - try { - let __args__ = fastn_utils.getArgs({}, args); - return (enable_light_mode()); - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "fastn_stack_github_io_request_data_processor_test"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + return (enable_light_mode()); + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.enable_dark_mode = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "fastn_stack_github_io_request_data_processor_test"; - try { - let __args__ = fastn_utils.getArgs({}, args); - return (enable_dark_mode()); - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "fastn_stack_github_io_request_data_processor_test"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + return (enable_dark_mode()); + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.enable_system_mode = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "fastn_stack_github_io_request_data_processor_test"; - try { - let __args__ = fastn_utils.getArgs({}, args); - return (enable_system_mode()); - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "fastn_stack_github_io_request_data_processor_test"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + return (enable_system_mode()); + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.set_bool = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "fastn_stack_github_io_request_data_processor_test"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(__args__.v); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "fastn_stack_github_io_request_data_processor_test"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(__args__.v); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.set_boolean = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "fastn_stack_github_io_request_data_processor_test"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(__args__.v); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "fastn_stack_github_io_request_data_processor_test"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(__args__.v); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.set_string = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "fastn_stack_github_io_request_data_processor_test"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(__args__.v); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "fastn_stack_github_io_request_data_processor_test"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(__args__.v); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.set_integer = function (args) { - let __fastn_super_package_name__ = __fastn_package_name__; - __fastn_package_name__ = "fastn_stack_github_io_request_data_processor_test"; - try { - let __args__ = fastn_utils.getArgs({}, args); - let fastn_utils_val___args___a = fastn_utils.clone(__args__.v); - if (fastn_utils_val___args___a instanceof fastn.mutableClass) { - fastn_utils_val___args___a = fastn_utils_val___args___a.get(); - } - if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { - __args__.a = fastn_utils_val___args___a; - } - } finally { - __fastn_package_name__ = __fastn_super_package_name__; - } + let __fastn_super_package_name__ = __fastn_package_name__; + __fastn_package_name__ = "fastn_stack_github_io_request_data_processor_test"; + try { + let __args__ = fastn_utils.getArgs({ + }, args); + let fastn_utils_val___args___a = fastn_utils.clone(__args__.v); + if (fastn_utils_val___args___a instanceof fastn.mutableClass) { + fastn_utils_val___args___a = fastn_utils_val___args___a.get(); + } + if (!fastn_utils.setter(__args__.a, fastn_utils_val___args___a)) { + __args__.a = fastn_utils_val___args___a; + } + } finally { + __fastn_package_name__ = __fastn_super_package_name__; + } } ftd.dark_mode = fastn.mutable(false); ftd.empty = ""; @@ -7125,872 +5891,1010 @@ ftd.font_display = fastn.mutable("sans-serif"); ftd.font_copy = fastn.mutable("sans-serif"); ftd.font_code = fastn.mutable("sans-serif"); ftd.default_types = function () { - let record = fastn.recordInstance({}); - record.set("heading_large", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(50)); - record.set("line_height", fastn_dom.FontSize.Px(65)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(36)); - record.set("line_height", fastn_dom.FontSize.Px(54)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + let record = fastn.recordInstance({ + }); + record.set("heading_large", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(50)); + record.set("line_height", fastn_dom.FontSize.Px(65)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(36)); + record.set("line_height", fastn_dom.FontSize.Px(54)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + return record; + }()); + record.set("heading_medium", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(38)); + record.set("line_height", fastn_dom.FontSize.Px(57)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(26)); + record.set("line_height", fastn_dom.FontSize.Px(40)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + return record; + }()); + record.set("heading_small", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(24)); + record.set("line_height", fastn_dom.FontSize.Px(31)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(22)); + record.set("line_height", fastn_dom.FontSize.Px(29)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + return record; + }()); + record.set("heading_hero", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(80)); + record.set("line_height", fastn_dom.FontSize.Px(104)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(48)); + record.set("line_height", fastn_dom.FontSize.Px(64)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + return record; + }()); + record.set("heading_tiny", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(20)); + record.set("line_height", fastn_dom.FontSize.Px(26)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(18)); + record.set("line_height", fastn_dom.FontSize.Px(24)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; + }()); + return record; + }()); + record.set("copy_small", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(14)); + record.set("line_height", fastn_dom.FontSize.Px(24)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_copy); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(12)); + record.set("line_height", fastn_dom.FontSize.Px(16)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_copy); + return record; + }()); + return record; + }()); + record.set("copy_regular", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(18)); + record.set("line_height", fastn_dom.FontSize.Px(30)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_copy); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(16)); + record.set("line_height", fastn_dom.FontSize.Px(24)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_copy); + return record; + }()); + return record; + }()); + record.set("copy_large", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(22)); + record.set("line_height", fastn_dom.FontSize.Px(34)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_copy); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(18)); + record.set("line_height", fastn_dom.FontSize.Px(28)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_copy); + return record; + }()); + return record; + }()); + record.set("fine_print", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(12)); + record.set("line_height", fastn_dom.FontSize.Px(16)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_code); + return record; + }()); + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(12)); + record.set("line_height", fastn_dom.FontSize.Px(16)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_code); + return record; }()); - record.set("heading_medium", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(38)); - record.set("line_height", fastn_dom.FontSize.Px(57)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(26)); - record.set("line_height", fastn_dom.FontSize.Px(40)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + return record; + }()); + record.set("blockquote", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(16)); + record.set("line_height", fastn_dom.FontSize.Px(21)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_code); + return record; }()); - record.set("heading_small", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(24)); - record.set("line_height", fastn_dom.FontSize.Px(31)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(22)); - record.set("line_height", fastn_dom.FontSize.Px(29)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(16)); + record.set("line_height", fastn_dom.FontSize.Px(21)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_code); + return record; }()); - record.set("heading_hero", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(80)); - record.set("line_height", fastn_dom.FontSize.Px(104)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(48)); - record.set("line_height", fastn_dom.FontSize.Px(64)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + return record; + }()); + record.set("source_code", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(18)); + record.set("line_height", fastn_dom.FontSize.Px(30)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_code); + return record; }()); - record.set("heading_tiny", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(20)); - record.set("line_height", fastn_dom.FontSize.Px(26)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(18)); - record.set("line_height", fastn_dom.FontSize.Px(24)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(16)); + record.set("line_height", fastn_dom.FontSize.Px(21)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_code); + return record; }()); - record.set("copy_small", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(14)); - record.set("line_height", fastn_dom.FontSize.Px(24)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_copy); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(12)); - record.set("line_height", fastn_dom.FontSize.Px(16)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_copy); - return record; - }()); - return record; + return record; + }()); + record.set("button_small", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(14)); + record.set("line_height", fastn_dom.FontSize.Px(19)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("copy_regular", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(18)); - record.set("line_height", fastn_dom.FontSize.Px(30)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_copy); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(16)); - record.set("line_height", fastn_dom.FontSize.Px(24)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_copy); - return record; - }()); - return record; + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(14)); + record.set("line_height", fastn_dom.FontSize.Px(19)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("copy_large", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(22)); - record.set("line_height", fastn_dom.FontSize.Px(34)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_copy); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(18)); - record.set("line_height", fastn_dom.FontSize.Px(28)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_copy); - return record; - }()); - return record; + return record; + }()); + record.set("button_medium", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(16)); + record.set("line_height", fastn_dom.FontSize.Px(21)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("fine_print", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(12)); - record.set("line_height", fastn_dom.FontSize.Px(16)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_code); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(12)); - record.set("line_height", fastn_dom.FontSize.Px(16)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_code); - return record; - }()); - return record; + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(16)); + record.set("line_height", fastn_dom.FontSize.Px(21)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("blockquote", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(16)); - record.set("line_height", fastn_dom.FontSize.Px(21)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_code); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(16)); - record.set("line_height", fastn_dom.FontSize.Px(21)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_code); - return record; - }()); - return record; + return record; + }()); + record.set("button_large", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(18)); + record.set("line_height", fastn_dom.FontSize.Px(24)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("source_code", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(18)); - record.set("line_height", fastn_dom.FontSize.Px(30)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_code); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(16)); - record.set("line_height", fastn_dom.FontSize.Px(21)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_code); - return record; - }()); - return record; + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(18)); + record.set("line_height", fastn_dom.FontSize.Px(24)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("button_small", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(14)); - record.set("line_height", fastn_dom.FontSize.Px(19)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(14)); - record.set("line_height", fastn_dom.FontSize.Px(19)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + return record; + }()); + record.set("link", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(14)); + record.set("line_height", fastn_dom.FontSize.Px(19)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("button_medium", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(16)); - record.set("line_height", fastn_dom.FontSize.Px(21)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(16)); - record.set("line_height", fastn_dom.FontSize.Px(21)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(14)); + record.set("line_height", fastn_dom.FontSize.Px(19)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("button_large", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(18)); - record.set("line_height", fastn_dom.FontSize.Px(24)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(18)); - record.set("line_height", fastn_dom.FontSize.Px(24)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + return record; + }()); + record.set("label_large", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(14)); + record.set("line_height", fastn_dom.FontSize.Px(19)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("link", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(14)); - record.set("line_height", fastn_dom.FontSize.Px(19)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(14)); - record.set("line_height", fastn_dom.FontSize.Px(19)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(14)); + record.set("line_height", fastn_dom.FontSize.Px(19)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("label_large", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(14)); - record.set("line_height", fastn_dom.FontSize.Px(19)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(14)); - record.set("line_height", fastn_dom.FontSize.Px(19)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + return record; + }()); + record.set("label_small", function () { + let record = fastn.recordInstance({ + }); + record.set("desktop", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(12)); + record.set("line_height", fastn_dom.FontSize.Px(16)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); - record.set("label_small", function () { - let record = fastn.recordInstance({}); - record.set("desktop", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(12)); - record.set("line_height", fastn_dom.FontSize.Px(16)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - record.set("mobile", function () { - let record = fastn.recordInstance({}); - record.set("size", fastn_dom.FontSize.Px(12)); - record.set("line_height", fastn_dom.FontSize.Px(16)); - record.set("letter_spacing", null); - record.set("weight", 400); - record.set("font_family", ftd.font_display); - return record; - }()); - return record; + record.set("mobile", function () { + let record = fastn.recordInstance({ + }); + record.set("size", fastn_dom.FontSize.Px(12)); + record.set("line_height", fastn_dom.FontSize.Px(16)); + record.set("letter_spacing", null); + record.set("weight", 400); + record.set("font_family", ftd.font_display); + return record; }()); return record; + }()); + return record; }(); ftd.default_colors = function () { - let record = fastn.recordInstance({}); - record.set("background", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#e7e7e4"); - record.set("dark", "#18181b"); - return record; - }()); - record.set("step_1", function () { - let record = fastn.recordInstance({}); - record.set("light", "#f3f3f3"); - record.set("dark", "#141414"); - return record; - }()); - record.set("step_2", function () { - let record = fastn.recordInstance({}); - record.set("light", "#c9cece"); - record.set("dark", "#585656"); - return record; - }()); - record.set("overlay", function () { - let record = fastn.recordInstance({}); - record.set("light", "rgba(0, 0, 0, 0.8)"); - record.set("dark", "rgba(0, 0, 0, 0.8)"); - return record; - }()); - record.set("code", function () { - let record = fastn.recordInstance({}); - record.set("light", "#F5F5F5"); - record.set("dark", "#21222C"); - return record; - }()); - return record; + let record = fastn.recordInstance({ + }); + record.set("background", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#e7e7e4"); + record.set("dark", "#18181b"); + return record; + }()); + record.set("step_1", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#f3f3f3"); + record.set("dark", "#141414"); + return record; + }()); + record.set("step_2", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#c9cece"); + record.set("dark", "#585656"); + return record; + }()); + record.set("overlay", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "rgba(0, 0, 0, 0.8)"); + record.set("dark", "rgba(0, 0, 0, 0.8)"); + return record; + }()); + record.set("code", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#F5F5F5"); + record.set("dark", "#21222C"); + return record; + }()); + return record; + }()); + record.set("border", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#434547"); + record.set("dark", "#434547"); + return record; + }()); + record.set("border_strong", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#919192"); + record.set("dark", "#919192"); + return record; + }()); + record.set("text", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#584b42"); + record.set("dark", "#a8a29e"); + return record; + }()); + record.set("text_strong", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#141414"); + record.set("dark", "#ffffff"); + return record; + }()); + record.set("shadow", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#007f9b"); + record.set("dark", "#007f9b"); + return record; + }()); + record.set("scrim", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#007f9b"); + record.set("dark", "#007f9b"); + return record; + }()); + record.set("cta_primary", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#2dd4bf"); + record.set("dark", "#2dd4bf"); + return record; + }()); + record.set("hover", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#2c9f90"); + record.set("dark", "#2c9f90"); + return record; + }()); + record.set("pressed", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#2cc9b5"); + record.set("dark", "#2cc9b5"); + return record; + }()); + record.set("disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "rgba(44, 201, 181, 0.1)"); + record.set("dark", "rgba(44, 201, 181, 0.1)"); + return record; + }()); + record.set("focused", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#2cbfac"); + record.set("dark", "#2cbfac"); + return record; + }()); + record.set("border", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#2b8074"); + record.set("dark", "#2b8074"); + return record; + }()); + record.set("border_disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#65b693"); + record.set("dark", "#65b693"); + return record; + }()); + record.set("text", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#feffff"); + record.set("dark", "#feffff"); + return record; + }()); + record.set("text_disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#65b693"); + record.set("dark", "#65b693"); + return record; + }()); + return record; + }()); + record.set("cta_secondary", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#4fb2df"); + record.set("dark", "#4fb2df"); + return record; + }()); + record.set("hover", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#40afe1"); + record.set("dark", "#40afe1"); + return record; + }()); + record.set("pressed", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#4fb2df"); + record.set("dark", "#4fb2df"); + return record; + }()); + record.set("disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "rgba(79, 178, 223, 0.1)"); + record.set("dark", "rgba(79, 178, 223, 0.1)"); + return record; + }()); + record.set("focused", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#4fb1df"); + record.set("dark", "#4fb1df"); + return record; + }()); + record.set("border", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#209fdb"); + record.set("dark", "#209fdb"); + return record; + }()); + record.set("border_disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#65b693"); + record.set("dark", "#65b693"); + return record; + }()); + record.set("text", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#584b42"); + record.set("dark", "#ffffff"); + return record; + }()); + record.set("text_disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#65b693"); + record.set("dark", "#65b693"); + return record; + }()); + return record; + }()); + record.set("cta_tertiary", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#556375"); + record.set("dark", "#556375"); + return record; + }()); + record.set("hover", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#c7cbd1"); + record.set("dark", "#c7cbd1"); + return record; + }()); + record.set("pressed", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#3b4047"); + record.set("dark", "#3b4047"); + return record; + }()); + record.set("disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "rgba(85, 99, 117, 0.1)"); + record.set("dark", "rgba(85, 99, 117, 0.1)"); + return record; + }()); + record.set("focused", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#e0e2e6"); + record.set("dark", "#e0e2e6"); + return record; + }()); + record.set("border", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#e2e4e7"); + record.set("dark", "#e2e4e7"); + return record; + }()); + record.set("border_disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#65b693"); + record.set("dark", "#65b693"); + return record; + }()); + record.set("text", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#ffffff"); + record.set("dark", "#ffffff"); + return record; + }()); + record.set("text_disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#65b693"); + record.set("dark", "#65b693"); + return record; + }()); + return record; + }()); + record.set("cta_danger", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#1C1B1F"); + record.set("dark", "#1C1B1F"); + return record; + }()); + record.set("hover", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#1C1B1F"); + record.set("dark", "#1C1B1F"); + return record; + }()); + record.set("pressed", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#1C1B1F"); + record.set("dark", "#1C1B1F"); + return record; + }()); + record.set("disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#1C1B1F"); + record.set("dark", "#1C1B1F"); + return record; + }()); + record.set("focused", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#1C1B1F"); + record.set("dark", "#1C1B1F"); + return record; + }()); + record.set("border", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#1C1B1F"); + record.set("dark", "#1C1B1F"); + return record; + }()); + record.set("border_disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#feffff"); + record.set("dark", "#feffff"); + return record; + }()); + record.set("text", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#1C1B1F"); + record.set("dark", "#1C1B1F"); + return record; + }()); + record.set("text_disabled", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#feffff"); + record.set("dark", "#feffff"); + return record; + }()); + return record; + }()); + record.set("accent", function () { + let record = fastn.recordInstance({ + }); + record.set("primary", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#2dd4bf"); + record.set("dark", "#2dd4bf"); + return record; + }()); + record.set("secondary", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#4fb2df"); + record.set("dark", "#4fb2df"); + return record; + }()); + record.set("tertiary", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#c5cbd7"); + record.set("dark", "#c5cbd7"); + return record; + }()); + return record; + }()); + record.set("error", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#f5bdbb"); + record.set("dark", "#311b1f"); + return record; + }()); + record.set("text", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#c62a21"); + record.set("dark", "#c62a21"); + return record; + }()); + record.set("border", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#df2b2b"); + record.set("dark", "#df2b2b"); + return record; + }()); + return record; + }()); + record.set("success", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#e3f0c4"); + record.set("dark", "#405508ad"); + return record; + }()); + record.set("text", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#467b28"); + record.set("dark", "#479f16"); + return record; }()); record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#434547"); - record.set("dark", "#434547"); - return record; + let record = fastn.recordInstance({ + }); + record.set("light", "#3d741f"); + record.set("dark", "#3d741f"); + return record; }()); - record.set("border_strong", function () { - let record = fastn.recordInstance({}); - record.set("light", "#919192"); - record.set("dark", "#919192"); - return record; + return record; + }()); + record.set("info", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#c4edfd"); + record.set("dark", "#15223a"); + return record; }()); record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#584b42"); - record.set("dark", "#a8a29e"); - return record; + let record = fastn.recordInstance({ + }); + record.set("light", "#205694"); + record.set("dark", "#1f6feb"); + return record; + }()); + record.set("border", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#205694"); + record.set("dark", "#205694"); + return record; }()); - record.set("text_strong", function () { - let record = fastn.recordInstance({}); - record.set("light", "#141414"); - record.set("dark", "#ffffff"); - return record; + return record; + }()); + record.set("warning", function () { + let record = fastn.recordInstance({ + }); + record.set("base", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#fbefba"); + record.set("dark", "#544607a3"); + return record; }()); - record.set("shadow", function () { - let record = fastn.recordInstance({}); - record.set("light", "#007f9b"); - record.set("dark", "#007f9b"); - return record; + record.set("text", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#966220"); + record.set("dark", "#d07f19"); + return record; }()); - record.set("scrim", function () { - let record = fastn.recordInstance({}); - record.set("light", "#007f9b"); - record.set("dark", "#007f9b"); - return record; + record.set("border", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#966220"); + record.set("dark", "#966220"); + return record; }()); - record.set("cta_primary", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#2dd4bf"); - record.set("dark", "#2dd4bf"); - return record; - }()); - record.set("hover", function () { - let record = fastn.recordInstance({}); - record.set("light", "#2c9f90"); - record.set("dark", "#2c9f90"); - return record; - }()); - record.set("pressed", function () { - let record = fastn.recordInstance({}); - record.set("light", "#2cc9b5"); - record.set("dark", "#2cc9b5"); - return record; - }()); - record.set("disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "rgba(44, 201, 181, 0.1)"); - record.set("dark", "rgba(44, 201, 181, 0.1)"); - return record; - }()); - record.set("focused", function () { - let record = fastn.recordInstance({}); - record.set("light", "#2cbfac"); - record.set("dark", "#2cbfac"); - return record; - }()); - record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#2b8074"); - record.set("dark", "#2b8074"); - return record; - }()); - record.set("border_disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#65b693"); - record.set("dark", "#65b693"); - return record; - }()); - record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#feffff"); - record.set("dark", "#feffff"); - return record; - }()); - record.set("text_disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#65b693"); - record.set("dark", "#65b693"); - return record; - }()); - return record; + return record; + }()); + record.set("custom", function () { + let record = fastn.recordInstance({ + }); + record.set("one", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#ed753a"); + record.set("dark", "#ed753a"); + return record; }()); - record.set("cta_secondary", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#4fb2df"); - record.set("dark", "#4fb2df"); - return record; - }()); - record.set("hover", function () { - let record = fastn.recordInstance({}); - record.set("light", "#40afe1"); - record.set("dark", "#40afe1"); - return record; - }()); - record.set("pressed", function () { - let record = fastn.recordInstance({}); - record.set("light", "#4fb2df"); - record.set("dark", "#4fb2df"); - return record; - }()); - record.set("disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "rgba(79, 178, 223, 0.1)"); - record.set("dark", "rgba(79, 178, 223, 0.1)"); - return record; - }()); - record.set("focused", function () { - let record = fastn.recordInstance({}); - record.set("light", "#4fb1df"); - record.set("dark", "#4fb1df"); - return record; - }()); - record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#209fdb"); - record.set("dark", "#209fdb"); - return record; - }()); - record.set("border_disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#65b693"); - record.set("dark", "#65b693"); - return record; - }()); - record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#584b42"); - record.set("dark", "#ffffff"); - return record; - }()); - record.set("text_disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#65b693"); - record.set("dark", "#65b693"); - return record; - }()); - return record; + record.set("two", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#f3db5f"); + record.set("dark", "#f3db5f"); + return record; }()); - record.set("cta_tertiary", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#556375"); - record.set("dark", "#556375"); - return record; - }()); - record.set("hover", function () { - let record = fastn.recordInstance({}); - record.set("light", "#c7cbd1"); - record.set("dark", "#c7cbd1"); - return record; - }()); - record.set("pressed", function () { - let record = fastn.recordInstance({}); - record.set("light", "#3b4047"); - record.set("dark", "#3b4047"); - return record; - }()); - record.set("disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "rgba(85, 99, 117, 0.1)"); - record.set("dark", "rgba(85, 99, 117, 0.1)"); - return record; - }()); - record.set("focused", function () { - let record = fastn.recordInstance({}); - record.set("light", "#e0e2e6"); - record.set("dark", "#e0e2e6"); - return record; - }()); - record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#e2e4e7"); - record.set("dark", "#e2e4e7"); - return record; - }()); - record.set("border_disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#65b693"); - record.set("dark", "#65b693"); - return record; - }()); - record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#ffffff"); - record.set("dark", "#ffffff"); - return record; - }()); - record.set("text_disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#65b693"); - record.set("dark", "#65b693"); - return record; - }()); - return record; + record.set("three", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#8fdcf8"); + record.set("dark", "#8fdcf8"); + return record; }()); - record.set("cta_danger", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#1C1B1F"); - record.set("dark", "#1C1B1F"); - return record; - }()); - record.set("hover", function () { - let record = fastn.recordInstance({}); - record.set("light", "#1C1B1F"); - record.set("dark", "#1C1B1F"); - return record; - }()); - record.set("pressed", function () { - let record = fastn.recordInstance({}); - record.set("light", "#1C1B1F"); - record.set("dark", "#1C1B1F"); - return record; - }()); - record.set("disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#1C1B1F"); - record.set("dark", "#1C1B1F"); - return record; - }()); - record.set("focused", function () { - let record = fastn.recordInstance({}); - record.set("light", "#1C1B1F"); - record.set("dark", "#1C1B1F"); - return record; - }()); - record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#1C1B1F"); - record.set("dark", "#1C1B1F"); - return record; - }()); - record.set("border_disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#feffff"); - record.set("dark", "#feffff"); - return record; - }()); - record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#1C1B1F"); - record.set("dark", "#1C1B1F"); - return record; - }()); - record.set("text_disabled", function () { - let record = fastn.recordInstance({}); - record.set("light", "#feffff"); - record.set("dark", "#feffff"); - return record; - }()); - return record; + record.set("four", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#7a65c7"); + record.set("dark", "#7a65c7"); + return record; }()); - record.set("accent", function () { - let record = fastn.recordInstance({}); - record.set("primary", function () { - let record = fastn.recordInstance({}); - record.set("light", "#2dd4bf"); - record.set("dark", "#2dd4bf"); - return record; - }()); - record.set("secondary", function () { - let record = fastn.recordInstance({}); - record.set("light", "#4fb2df"); - record.set("dark", "#4fb2df"); - return record; - }()); - record.set("tertiary", function () { - let record = fastn.recordInstance({}); - record.set("light", "#c5cbd7"); - record.set("dark", "#c5cbd7"); - return record; - }()); - return record; + record.set("five", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#eb57be"); + record.set("dark", "#eb57be"); + return record; }()); - record.set("error", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#f5bdbb"); - record.set("dark", "#311b1f"); - return record; - }()); - record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#c62a21"); - record.set("dark", "#c62a21"); - return record; - }()); - record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#df2b2b"); - record.set("dark", "#df2b2b"); - return record; - }()); - return record; + record.set("six", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#ef8dd6"); + record.set("dark", "#ef8dd6"); + return record; }()); - record.set("success", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#e3f0c4"); - record.set("dark", "#405508ad"); - return record; - }()); - record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#467b28"); - record.set("dark", "#479f16"); - return record; - }()); - record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#3d741f"); - record.set("dark", "#3d741f"); - return record; - }()); - return record; + record.set("seven", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#7564be"); + record.set("dark", "#7564be"); + return record; }()); - record.set("info", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#c4edfd"); - record.set("dark", "#15223a"); - return record; - }()); - record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#205694"); - record.set("dark", "#1f6feb"); - return record; - }()); - record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#205694"); - record.set("dark", "#205694"); - return record; - }()); - return record; + record.set("eight", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#d554b3"); + record.set("dark", "#d554b3"); + return record; }()); - record.set("warning", function () { - let record = fastn.recordInstance({}); - record.set("base", function () { - let record = fastn.recordInstance({}); - record.set("light", "#fbefba"); - record.set("dark", "#544607a3"); - return record; - }()); - record.set("text", function () { - let record = fastn.recordInstance({}); - record.set("light", "#966220"); - record.set("dark", "#d07f19"); - return record; - }()); - record.set("border", function () { - let record = fastn.recordInstance({}); - record.set("light", "#966220"); - record.set("dark", "#966220"); - return record; - }()); - return record; + record.set("nine", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#ec8943"); + record.set("dark", "#ec8943"); + return record; }()); - record.set("custom", function () { - let record = fastn.recordInstance({}); - record.set("one", function () { - let record = fastn.recordInstance({}); - record.set("light", "#ed753a"); - record.set("dark", "#ed753a"); - return record; - }()); - record.set("two", function () { - let record = fastn.recordInstance({}); - record.set("light", "#f3db5f"); - record.set("dark", "#f3db5f"); - return record; - }()); - record.set("three", function () { - let record = fastn.recordInstance({}); - record.set("light", "#8fdcf8"); - record.set("dark", "#8fdcf8"); - return record; - }()); - record.set("four", function () { - let record = fastn.recordInstance({}); - record.set("light", "#7a65c7"); - record.set("dark", "#7a65c7"); - return record; - }()); - record.set("five", function () { - let record = fastn.recordInstance({}); - record.set("light", "#eb57be"); - record.set("dark", "#eb57be"); - return record; - }()); - record.set("six", function () { - let record = fastn.recordInstance({}); - record.set("light", "#ef8dd6"); - record.set("dark", "#ef8dd6"); - return record; - }()); - record.set("seven", function () { - let record = fastn.recordInstance({}); - record.set("light", "#7564be"); - record.set("dark", "#7564be"); - return record; - }()); - record.set("eight", function () { - let record = fastn.recordInstance({}); - record.set("light", "#d554b3"); - record.set("dark", "#d554b3"); - return record; - }()); - record.set("nine", function () { - let record = fastn.recordInstance({}); - record.set("light", "#ec8943"); - record.set("dark", "#ec8943"); - return record; - }()); - record.set("ten", function () { - let record = fastn.recordInstance({}); - record.set("light", "#da7a4a"); - record.set("dark", "#da7a4a"); - return record; - }()); - return record; + record.set("ten", function () { + let record = fastn.recordInstance({ + }); + record.set("light", "#da7a4a"); + record.set("dark", "#da7a4a"); + return record; }()); return record; + }()); + return record; }(); ftd.breakpoint_width = function () { - let record = fastn.recordInstance({}); - record.set("mobile", 768); - return record; + let record = fastn.recordInstance({ + }); + record.set("mobile", 768); + return record; }(); ftd.device = fastn.mutable(fastn_dom.DeviceData.Mobile); let inherited = function () { - let record = fastn.recordInstance({}); - record.set("colors", ftd.default_colors.getClone().setAndReturn("is_root", true)); - record.set("types", ftd.default_types.getClone().setAndReturn("is_root", true)); - return record; + let record = fastn.recordInstance({ + }); + record.set("colors", ftd.default_colors.getClone().setAndReturn("is_root", true)); + record.set("types", ftd.default_types.getClone().setAndReturn("is_root", true)); + return record; }(); diff --git a/fastn-core/src/commands/fmt.rs b/fastn-core/src/commands/fmt.rs index 07aac123ec..9fbd2c86db 100644 --- a/fastn-core/src/commands/fmt.rs +++ b/fastn-core/src/commands/fmt.rs @@ -156,7 +156,7 @@ fn parsed_to_sections(input: &str) -> Vec
    { sections.push(section); } else { panic!( - "`{}`: can't unresolved", + "`{}`: can't parse", input .split_once('\n') .map(|(v, _)| v.to_string()) diff --git a/fastn-core/src/commands/query.rs b/fastn-core/src/commands/query.rs index 785f669ad0..f88577e684 100644 --- a/fastn-core/src/commands/query.rs +++ b/fastn-core/src/commands/query.rs @@ -67,7 +67,7 @@ pub(crate) fn get_ftd_json( match stage { "p1" => get_p1_json(document), - "resolved" => get_ast_json(document), + "ast" => get_ast_json(document), _ => unimplemented!(), } } diff --git a/fastn-core/src/config/mod.rs b/fastn-core/src/config/mod.rs index 56253ca30c..e93a9ee360 100644 --- a/fastn-core/src/config/mod.rs +++ b/fastn-core/src/config/mod.rs @@ -517,7 +517,7 @@ impl Config { }; if let Some((v, _)) = id.split_once('/') { - fastn_core::Version::unresolved(v) + fastn_core::Version::parse(v) } else { Ok(fastn_core::Version::base()) } @@ -931,7 +931,7 @@ impl Config { Ok(fastn_manifest_processed) => fastn_manifest_processed, Err(e) => { return Err(fastn_core::Error::PackageError { - message: format!("failed to unresolved fastn.manifest.ftd: {:?}", &e), + message: format!("failed to parse fastn.manifest.ftd: {:?}", &e), }); } }; diff --git a/fastn-core/src/config/utils.rs b/fastn-core/src/config/utils.rs index 96c0e33c3a..c44ef7e4a6 100644 --- a/fastn-core/src/config/utils.rs +++ b/fastn-core/src/config/utils.rs @@ -28,7 +28,7 @@ pub async fn fastn_doc( match fastn_core::doc::parse_ftd("fastn", doc.as_str(), &lib) { Ok(v) => Ok(v), Err(e) => Err(fastn_core::Error::PackageError { - message: format!("failed to unresolved FASTN.ftd 3: {:?}", &e), + message: format!("failed to parse FASTN.ftd 3: {:?}", &e), }), } } diff --git a/fastn-core/src/http.rs b/fastn-core/src/http.rs index cbf1acfeb6..f1171eaeb2 100644 --- a/fastn-core/src/http.rs +++ b/fastn-core/src/http.rs @@ -186,7 +186,7 @@ impl Request { ) { headers.insert(k, v.clone()); } else { - tracing::warn!("failed to unresolved header: {key:?} {value:?}"); + tracing::warn!("failed to parse header: {key:?} {value:?}"); } } headers diff --git a/fastn-core/src/library2022/processor/google_sheets.rs b/fastn-core/src/library2022/processor/google_sheets.rs index c056725107..5dced85d2c 100644 --- a/fastn-core/src/library2022/processor/google_sheets.rs +++ b/fastn-core/src/library2022/processor/google_sheets.rs @@ -182,7 +182,7 @@ fn to_interpreter_value( serde_json::Value::String(v) => v.to_string(), _ => { return ftd::interpreter::utils::e2( - format!("Can't unresolved to string, found: {}", &val.v), + format!("Can't parse to string, found: {}", &val.v), doc.name, line_number, ) @@ -200,7 +200,7 @@ fn to_interpreter_value( serde_json::Value::Number(n) => { n.as_f64().map(|f| f as i64).ok_or_else(|| { ftd::interpreter::Error::ParseError { - message: format!("Can't unresolved to integer, found: {}", &val.v), + message: format!("Can't parse to integer, found: {}", &val.v), doc_id: doc.name.to_string(), line_number, } @@ -209,14 +209,14 @@ fn to_interpreter_value( serde_json::Value::String(s) => { s.parse::() .map_err(|_| ftd::interpreter::Error::ParseError { - message: format!("Can't unresolved to integer, found: {}", &val.v), + message: format!("Can't parse to integer, found: {}", &val.v), doc_id: doc.name.to_string(), line_number, })? } _ => { return Err(ftd::interpreter::Error::ParseError { - message: format!("Can't unresolved to integer, found: {}", &val.v), + message: format!("Can't parse to integer, found: {}", &val.v), doc_id: doc.name.to_string(), line_number, }) @@ -224,7 +224,7 @@ fn to_interpreter_value( }, t => { return Err(ftd::interpreter::Error::ParseError { - message: format!("Can't unresolved to integer, found: {t}"), + message: format!("Can't parse to integer, found: {t}"), doc_id: doc.name.to_string(), line_number, }) @@ -236,7 +236,7 @@ fn to_interpreter_value( serde_json::Value::Number(n) => { n.as_f64() .ok_or_else(|| ftd::interpreter::Error::ParseError { - message: format!("Can't unresolved to decimal, found: {}", &val.v), + message: format!("Can't parse to decimal, found: {}", &val.v), doc_id: doc.name.to_string(), line_number, })? @@ -244,14 +244,14 @@ fn to_interpreter_value( serde_json::Value::String(s) => { s.parse::() .map_err(|_| ftd::interpreter::Error::ParseError { - message: format!("Can't unresolved to decimal, found: {}", &val.v), + message: format!("Can't parse to decimal, found: {}", &val.v), doc_id: doc.name.to_string(), line_number, })? } _ => { return Err(ftd::interpreter::Error::ParseError { - message: format!("Can't unresolved to decimal, found: {}", &val.v), + message: format!("Can't parse to decimal, found: {}", &val.v), doc_id: doc.name.to_string(), line_number, }) @@ -264,14 +264,14 @@ fn to_interpreter_value( serde_json::Value::String(s) => { s.parse::() .map_err(|_| ftd::interpreter::Error::ParseError { - message: format!("Can't unresolved to boolean, found: {}", &val.v), + message: format!("Can't parse to boolean, found: {}", &val.v), doc_id: doc.name.to_string(), line_number, })? } _ => { return Err(ftd::interpreter::Error::ParseError { - message: format!("Can't unresolved to boolean, found: {}", &val.v), + message: format!("Can't parse to boolean, found: {}", &val.v), doc_id: doc.name.to_string(), line_number, }) @@ -351,7 +351,7 @@ fn parse_json( match serde_json::from_str::(json) { Ok(response) => Ok(response), Err(e) => ftd::interpreter::utils::e2( - format!("Failed to unresolved query response: {:?}", e), + format!("Failed to parse query response: {:?}", e), doc_name, line_number, ), @@ -541,7 +541,7 @@ pub(crate) fn parse_query( } State::ParseError(error) => { return Err(ftd::interpreter::Error::ParseError { - message: format!("Failed to unresolved SQL Query: {}", error), + message: format!("Failed to parse SQL Query: {}", error), doc_id: doc.name.to_string(), line_number, }); diff --git a/fastn-core/src/library2022/processor/pg.rs b/fastn-core/src/library2022/processor/pg.rs index 48a20e1256..32f3f587a0 100644 --- a/fastn-core/src/library2022/processor/pg.rs +++ b/fastn-core/src/library2022/processor/pg.rs @@ -128,7 +128,7 @@ fn resolve_variable_from_headers( Ok(r) => Ok(r), Err(e) => ftd::interpreter::utils::e2( format!( - "failed to unresolved `{var}: {val}` into {into}: {e}", + "failed to parse `{var}: {val}` into {into}: {e}", e = e.to_string() ), doc_name, diff --git a/fastn-core/src/library2022/processor/query.rs b/fastn-core/src/library2022/processor/query.rs index 4b12e9cc64..0fd5f6a803 100644 --- a/fastn-core/src/library2022/processor/query.rs +++ b/fastn-core/src/library2022/processor/query.rs @@ -18,7 +18,7 @@ pub async fn process( let stage = headers .get_optional_string_by_key("stage", doc.name, value.line_number())? - .unwrap_or_else(|| "resolved".to_string()); + .unwrap_or_else(|| "ast".to_string()); let file = req_config .get_file_and_package_by_id(path.as_str(), preview_session_id) diff --git a/fastn-core/src/library2022/processor/toc.rs b/fastn-core/src/library2022/processor/toc.rs index 107293b8d7..b9649bd5d4 100644 --- a/fastn-core/src/library2022/processor/toc.rs +++ b/fastn-core/src/library2022/processor/toc.rs @@ -18,7 +18,7 @@ pub fn process( doc.name, ) .map_err(|e| ftd::ftd2021::p1::Error::ParseError { - message: format!("Cannot unresolved body: {:?}", e), + message: format!("Cannot parse body: {:?}", e), doc_id: doc.name.to_string(), line_number, })? diff --git a/fastn-core/src/package/dependency.rs b/fastn-core/src/package/dependency.rs index 25958dceb0..cdc61b9244 100644 --- a/fastn-core/src/package/dependency.rs +++ b/fastn-core/src/package/dependency.rs @@ -170,7 +170,7 @@ impl fastn_core::Package { Ok(v) => v, Err(e) => { return Err(fastn_core::Error::PackageError { - message: format!("failed to unresolved FASTN.ftd: {:?}", &e), + message: format!("failed to parse FASTN.ftd: {:?}", &e), }); } }; @@ -267,7 +267,7 @@ impl fastn_core::Package { } Err(e) => { return Err(fastn_core::Error::PackageError { - message: format!("failed to unresolved fastn.manifest.ftd: {:?}", &e), + message: format!("failed to parse fastn.manifest.ftd: {:?}", &e), }); } } @@ -387,7 +387,7 @@ impl fastn_core::Package { } Err(e) => { return Err(fastn_core::Error::PackageError { - message: format!("failed to unresolved fastn.manifest.ftd: {:?}", &e), + message: format!("failed to parse fastn.manifest.ftd: {:?}", &e), }); } } @@ -449,7 +449,7 @@ impl fastn_core::Package { Ok(v) => v, Err(e) => { return Err(fastn_core::Error::PackageError { - message: format!("failed to unresolved FASTN.ftd 2: {:?}", &e), + message: format!("failed to parse FASTN.ftd 2: {:?}", &e), }); } } @@ -568,7 +568,7 @@ impl fastn_core::Package { Ok(v) => v, Err(e) => { return Err(fastn_core::Error::PackageError { - message: format!("failed to unresolved FASTN.ftd 2: {:?}", &e), + message: format!("failed to parse FASTN.ftd 2: {:?}", &e), }); } } diff --git a/fastn-core/src/package/mod.rs b/fastn-core/src/package/mod.rs index fd6c43b4f8..366c9cfe25 100644 --- a/fastn-core/src/package/mod.rs +++ b/fastn-core/src/package/mod.rs @@ -578,7 +578,7 @@ impl Package { path = fastn_path.to_string() ); return Err(fastn_core::Error::PackageError { - message: format!("failed to unresolved FASTN.ftd: {:?}", &e), + message: format!("failed to parse FASTN.ftd: {:?}", &e), }); } } diff --git a/fastn-core/src/package/package_doc.rs b/fastn-core/src/package/package_doc.rs index 1886c0a7f2..4146fa0cba 100644 --- a/fastn-core/src/package/package_doc.rs +++ b/fastn-core/src/package/package_doc.rs @@ -435,9 +435,9 @@ pub(crate) async fn read_ftd_2022( { Ok(v) => v, Err(e) => { - tracing::error!(msg = "failed to unresolved", doc = main.id.as_str()); + tracing::error!(msg = "failed to parse", doc = main.id.as_str()); return Err(fastn_core::Error::PackageError { - message: format!("failed to unresolved {:?}", &e), + message: format!("failed to parse {:?}", &e), }); } }; @@ -504,9 +504,9 @@ pub(crate) async fn read_ftd_2023( { Ok(v) => v, Err(e) => { - tracing::error!(msg = "failed to unresolved", doc = main.id.as_str()); + tracing::error!(msg = "failed to parse", doc = main.id.as_str()); return Err(fastn_core::Error::PackageError { - message: format!("failed to unresolved {:?}", &e), + message: format!("failed to parse {:?}", &e), }); } }; diff --git a/fastn-core/src/package/redirects.rs b/fastn-core/src/package/redirects.rs index e95ae3ac2b..13da26c513 100644 --- a/fastn-core/src/package/redirects.rs +++ b/fastn-core/src/package/redirects.rs @@ -30,7 +30,7 @@ impl UrlMappingsTemp { self.find_url_mappings(url_mappings_body) } - // todo: unresolved dynamic-urls in this later + // todo: parse dynamic-urls in this later /// Parses url mappings from fastn.url-mappings body /// /// and returns UrlMappings { redirects, endpoints } diff --git a/fastn-core/src/sitemap/mod.rs b/fastn-core/src/sitemap/mod.rs index 074965789f..bdd391ed02 100644 --- a/fastn-core/src/sitemap/mod.rs +++ b/fastn-core/src/sitemap/mod.rs @@ -210,7 +210,7 @@ impl SitemapElement { // If url contains path parameters so it will set those parameters // /person// - // In that case it will unresolved and set parameters `username` and `age` + // In that case it will parse and set parameters `username` and `age` pub(crate) fn set_path_params(&mut self, url: &str) -> Result<(), ParseError> { let params = utils::parse_named_params(url)?; diff --git a/fastn-core/src/snapshot.rs b/fastn-core/src/snapshot.rs index 774094f6c3..9000276653 100644 --- a/fastn-core/src/snapshot.rs +++ b/fastn-core/src/snapshot.rs @@ -14,7 +14,7 @@ pub(crate) async fn resolve_snapshots( let b = match fastn_core::doc::parse_ftd(".latest.ftd", content, &lib) { Ok(v) => v, Err(e) => { - eprintln!("failed to unresolved .latest.ftd: {:?}", &e); + eprintln!("failed to parse .latest.ftd: {:?}", &e); todo!(); } }; diff --git a/fastn-core/src/tracker.rs b/fastn-core/src/tracker.rs index e1c3920be8..21f3888813 100644 --- a/fastn-core/src/tracker.rs +++ b/fastn-core/src/tracker.rs @@ -28,7 +28,7 @@ pub(crate) async fn get_tracks( let b = match fastn_core::doc::parse_ftd(base_path.to_string().as_str(), doc.as_str(), &lib) { Ok(v) => v, Err(e) => { - eprintln!("failed to unresolved {}: {:?}", base_path, &e); + eprintln!("failed to parse {}: {:?}", base_path, &e); todo!(); } }; diff --git a/fastn-core/src/wasm.rs b/fastn-core/src/wasm.rs index dadf27fbe2..b2a263e755 100644 --- a/fastn-core/src/wasm.rs +++ b/fastn-core/src/wasm.rs @@ -126,7 +126,7 @@ pub async fn handle_wasm( header_name.as_str().to_string(), header_value .to_str() - .expect("Unable to unresolved header value") + .expect("Unable to parse header value") .to_string(), )); }); @@ -147,19 +147,17 @@ pub async fn handle_wasm( method: req.method(), payload: body_str, }; - fastn_core::time("WASM Guest function").it( - match import.handlerequest(&mut store, request) { - Ok(data) => Ok(actix_web::HttpResponse::Ok() - .content_type(actix_web::http::header::ContentType::json()) - .status(if data.success { - actix_web::http::StatusCode::OK - } else { - actix_web::http::StatusCode::BAD_REQUEST - }) - .body(data.data)), - Err(err) => Err(WASMError::WasmFunctionInvoke(err.to_string())), - }, - ) + fastn_core::time("WASM Guest function").it(match import.handlerequest(&mut store, request) { + Ok(data) => Ok(actix_web::HttpResponse::Ok() + .content_type(actix_web::http::header::ContentType::json()) + .status(if data.success { + actix_web::http::StatusCode::OK + } else { + actix_web::http::StatusCode::BAD_REQUEST + }) + .body(data.data)), + Err(err) => Err(WASMError::WasmFunctionInvoke(err.to_string())), + }) } fastn_core::time("WASM Execution: ").it(match inner(req, wasm_module, backend_headers).await { Ok(resp) => resp, diff --git a/fastn-ds/src/lib.rs b/fastn-ds/src/lib.rs index d5d6da1258..2f41473cbd 100644 --- a/fastn-ds/src/lib.rs +++ b/fastn-ds/src/lib.rs @@ -133,7 +133,7 @@ pub enum WasmReadError { pub enum HttpError { #[error("http error {0}")] ReqwestError(#[from] reqwest::Error), - #[error("url unresolved error {0}")] + #[error("url parse error {0}")] URLParseError(#[from] url::ParseError), #[error("generic error {message}")] GenericError { message: String }, diff --git a/fastn-expr/src/interpolator.rs b/fastn-expr/src/interpolator.rs index 88baf0a24c..961d205336 100644 --- a/fastn-expr/src/interpolator.rs +++ b/fastn-expr/src/interpolator.rs @@ -1,6 +1,6 @@ #[derive(thiserror::Error, Debug)] pub enum InterpolationError { - #[error("Failed to unresolved interpolation: {0}")] + #[error("Failed to parse interpolation: {0}")] FailedToParse(#[from] fastn_expr::parser::ParseError), #[error("Failed to interpolate: {0}")] CantInterpolate(String), diff --git a/fastn-grammar/src/evalexpr/token/mod.rs b/fastn-grammar/src/evalexpr/token/mod.rs index 112374f291..0f4ace0f10 100644 --- a/fastn-grammar/src/evalexpr/token/mod.rs +++ b/fastn-grammar/src/evalexpr/token/mod.rs @@ -358,9 +358,9 @@ fn partial_tokens_to_tokens(mut tokens: &[PartialToken]) -> EvalexprResulte{+,-}`, - // for example [Literal("10e"), Minus, Literal("3")] => "1e-3".unresolved(). + // for example [Literal("10e"), Minus, Literal("3")] => "1e-3".parse(). match (second, third) { (Some(second), Some(third)) if second == PartialToken::Minus diff --git a/fastn-issues/src/initialization.rs b/fastn-issues/src/initialization.rs index 7851e88143..3b3d595cbc 100644 --- a/fastn-issues/src/initialization.rs +++ b/fastn-issues/src/initialization.rs @@ -19,7 +19,7 @@ pub enum FastnFTDError { #[from] source: FileAsStringError, }, - #[error("Cant unresolved FASTN.ftd: {source}")] + #[error("Cant parse FASTN.ftd: {source}")] ParseFASTNFile { #[from] source: OldFastnParseError, diff --git a/fastn-runtime/src/wasm.rs b/fastn-runtime/src/wasm.rs index 67f6d26324..e403d8caf6 100644 --- a/fastn-runtime/src/wasm.rs +++ b/fastn-runtime/src/wasm.rs @@ -4,7 +4,7 @@ impl fastn_runtime::Dom { ) -> (wasmtime::Store, wasmtime::Instance) { let engine = wasmtime::Engine::new(wasmtime::Config::new().async_support(false)) .expect("cant create engine"); - let module = wasmtime::Module::new(&engine, wat).expect("cant unresolved module"); + let module = wasmtime::Module::new(&engine, wat).expect("cant parse module"); let dom = fastn_runtime::Dom::new(0, 0); let mut linker = wasmtime::Linker::new(&engine); diff --git a/fastn-update/src/utils.rs b/fastn-update/src/utils.rs index 4a12134af6..bf9133fa83 100644 --- a/fastn-update/src/utils.rs +++ b/fastn-update/src/utils.rs @@ -9,7 +9,7 @@ pub async fn from_fastn_doc( let fastn_doc = match fastn_core::doc::parse_ftd("fastn", doc.as_str(), &lib) { Ok(v) => Ok(v), Err(e) => Err(fastn_core::Error::PackageError { - message: format!("failed to unresolved FASTN.ftd 3: {:?}", &e), + message: format!("failed to parse FASTN.ftd 3: {:?}", &e), }), }?; let package = fastn_core::Package::from_fastn_doc(ds, &fastn_doc)?; diff --git a/fbt_lib/src/run.rs b/fbt_lib/src/run.rs index f456bb6d74..a29fa15eb1 100644 --- a/fbt_lib/src/run.rs +++ b/fbt_lib/src/run.rs @@ -24,7 +24,7 @@ pub fn main_with_filters(filters: &[String], to_fix: bool, folder: Option { - eprintln!("{}", format!("Cant unresolved config file: {:?}", e).red()); + eprintln!("{}", format!("Cant parse config file: {:?}", e).red()); return Some(1); } Err(crate::Error::BuildFailedToLaunch(e)) => { diff --git a/ftd-ast/src/ast.rs b/ftd-ast/src/ast.rs index 1930a5d68c..59e0a40cfa 100644 --- a/ftd-ast/src/ast.rs +++ b/ftd-ast/src/ast.rs @@ -1,5 +1,5 @@ #[derive(Debug, Clone, PartialEq, serde::Deserialize, serde::Serialize)] -// #[serde(tag = "resolved-type", content = "c")] +// #[serde(tag = "ast-type", content = "c")] pub enum Ast { #[serde(rename = "import")] Import(ftd_ast::Import), diff --git a/ftd-ast/src/test.rs b/ftd-ast/src/test.rs index a89e731b70..59b36ad856 100644 --- a/ftd-ast/src/test.rs +++ b/ftd-ast/src/test.rs @@ -17,9 +17,9 @@ fn p(s: &str, t: &str, fix: bool, file_location: &std::path::PathBuf) { /*#[track_caller] fn f(s: &str, m: &str) { - let sections = ftd_p1::unresolved(s, "foo").unwrap_or_else(|e| panic!("{:?}", e)); - let resolved = ftd_ast::AST::from_sections(sections.as_slice(), "foo"); - match resolved { + let sections = ftd_p1::parse(s, "foo").unwrap_or_else(|e| panic!("{:?}", e)); + let ast = ftd_ast::AST::from_sections(sections.as_slice(), "foo"); + match ast { Ok(r) => panic!("expected failure, found: {:?}", r), Err(e) => { let expected = m.trim(); @@ -68,8 +68,7 @@ fn ast_test_all() { fn find_file_groups() -> Vec<(Vec, std::path::PathBuf)> { let files = { - let mut f = - ftd_p1::utils::find_all_files_matching_extension_recursively("t/resolved", "ftd"); + let mut f = ftd_p1::utils::find_all_files_matching_extension_recursively("t/ast", "ftd"); f.sort(); f }; diff --git a/ftd-p1/src/utils.rs b/ftd-p1/src/utils.rs index 1737b7e4a7..6bac5557ac 100644 --- a/ftd-p1/src/utils.rs +++ b/ftd-p1/src/utils.rs @@ -49,11 +49,11 @@ pub const INLINE_IF: &str = " if "; pub const IF: &str = "if"; /** - * Constructs a unresolved error Result of a specific type + * Constructs a parse error Result of a specific type * * # Parameters * - * - `m` - a message to add to the unresolved error + * - `m` - a message to add to the parse error * - `doc_id` - a reference to a string representing the document id * - `line_number` - a usize representing the line number where the error occured * diff --git a/ftd-tc/src/error.rs b/ftd-tc/src/error.rs index 3d363f3c4e..8243096f2e 100644 --- a/ftd-tc/src/error.rs +++ b/ftd-tc/src/error.rs @@ -1,6 +1,6 @@ #[derive(thiserror::Error, Debug)] pub enum Error { - #[error("resolved: {0}")] + #[error("ast: {0}")] Ast(#[from] ftd_ast::Error), #[error("ftd-p1: {name}")] diff --git a/ftd/src/ftd2021/p1/header.rs b/ftd/src/ftd2021/p1/header.rs index 91c14c9a96..c0a7914502 100644 --- a/ftd/src/ftd2021/p1/header.rs +++ b/ftd/src/ftd2021/p1/header.rs @@ -70,7 +70,7 @@ impl Header { Ok(v == "true") } else { Err(ftd::ftd2021::p1::Error::ParseError { - message: "can't unresolved bool".to_string(), + message: "can't parse bool".to_string(), doc_id: doc_id.to_string(), line_number: *l, }) diff --git a/ftd/src/ftd2021/p1/to_string.rs b/ftd/src/ftd2021/p1/to_string.rs index 23e419efcd..6227c6971e 100644 --- a/ftd/src/ftd2021/p1/to_string.rs +++ b/ftd/src/ftd2021/p1/to_string.rs @@ -106,7 +106,7 @@ mod test { ), "foo" ) - .expect("Cannot unresolved to section") + .expect("Cannot parse to section") ) ); } @@ -136,7 +136,7 @@ mod test { ), "foo" ) - .expect("Cannot unresolved to section") + .expect("Cannot parse to section") ) ); @@ -164,7 +164,7 @@ mod test { ), "foo" ) - .expect("Cannot unresolved to section") + .expect("Cannot parse to section") ) ); } diff --git a/ftd/src/ftd2021/p2/tdoc.rs b/ftd/src/ftd2021/p2/tdoc.rs index a0e60f1cb8..1ed2fa1340 100644 --- a/ftd/src/ftd2021/p2/tdoc.rs +++ b/ftd/src/ftd2021/p2/tdoc.rs @@ -638,7 +638,7 @@ impl TDoc<'_> { ftd::ftd2021::p2::Kind::String { .. } => ftd::Value::String { text: serde_json::from_value::(json.to_owned()).map_err(|_| { ftd::ftd2021::p1::Error::ParseError { - message: format!("Can't unresolved to string, found: {}", json), + message: format!("Can't parse to string, found: {}", json), doc_id: self.name.to_string(), line_number, } @@ -648,7 +648,7 @@ impl TDoc<'_> { ftd::ftd2021::p2::Kind::Integer { .. } => ftd::Value::Integer { value: serde_json::from_value::(json.to_owned()).map_err(|_| { ftd::ftd2021::p1::Error::ParseError { - message: format!("Can't unresolved to integer, found: {}", json), + message: format!("Can't parse to integer, found: {}", json), doc_id: self.name.to_string(), line_number, } @@ -657,7 +657,7 @@ impl TDoc<'_> { ftd::ftd2021::p2::Kind::Decimal { .. } => ftd::Value::Decimal { value: serde_json::from_value::(json.to_owned()).map_err(|_| { ftd::ftd2021::p1::Error::ParseError { - message: format!("Can't unresolved to decimal, found: {}", json), + message: format!("Can't parse to decimal, found: {}", json), doc_id: self.name.to_string(), line_number, } @@ -666,7 +666,7 @@ impl TDoc<'_> { ftd::ftd2021::p2::Kind::Boolean { .. } => ftd::Value::Boolean { value: serde_json::from_value::(json.to_owned()).map_err(|_| { ftd::ftd2021::p1::Error::ParseError { - message: format!("Can't unresolved to boolean,found: {}", json), + message: format!("Can't parse to boolean,found: {}", json), doc_id: self.name.to_string(), line_number, } @@ -854,7 +854,7 @@ impl TDoc<'_> { ftd::ftd2021::p2::Kind::String { .. } if row.first().is_some() => ftd::Value::String { text: serde_json::from_value::(row.first().unwrap().to_owned()).map_err( |_| ftd::ftd2021::p1::Error::ParseError { - message: format!("Can't unresolved to string, found: {:?}", row), + message: format!("Can't parse to string, found: {:?}", row), doc_id: self.name.to_string(), line_number, }, @@ -865,7 +865,7 @@ impl TDoc<'_> { ftd::Value::Integer { value: serde_json::from_value::(row.first().unwrap().to_owned()).map_err( |_| ftd::ftd2021::p1::Error::ParseError { - message: format!("Can't unresolved to integer, found: {:?}", row), + message: format!("Can't parse to integer, found: {:?}", row), doc_id: self.name.to_string(), line_number, }, @@ -876,7 +876,7 @@ impl TDoc<'_> { ftd::Value::Decimal { value: serde_json::from_value::(row.first().unwrap().to_owned()).map_err( |_| ftd::ftd2021::p1::Error::ParseError { - message: format!("Can't unresolved to decimal, found: {:?}", row), + message: format!("Can't parse to decimal, found: {:?}", row), doc_id: self.name.to_string(), line_number, }, @@ -887,7 +887,7 @@ impl TDoc<'_> { ftd::Value::Boolean { value: serde_json::from_value::(row.first().unwrap().to_owned()) .map_err(|_| ftd::ftd2021::p1::Error::ParseError { - message: format!("Can't unresolved to boolean,found: {:?}", row), + message: format!("Can't parse to boolean,found: {:?}", row), doc_id: self.name.to_string(), line_number, })?, diff --git a/ftd/src/interpreter/main.rs b/ftd/src/interpreter/main.rs index 56c8d651b1..90fa7dea13 100644 --- a/ftd/src/interpreter/main.rs +++ b/ftd/src/interpreter/main.rs @@ -535,7 +535,7 @@ impl InterpreterState { /// InterpreterState instance it is called on. If the last element exists, it looks at the /// first element in the ast_list field of the last element. If the first element exists, the /// method returns a tuple containing the doc_name as a String, the `number_of_scan` as an - /// usize, and the resolved as a reference to an ftd_ast::AST. If either the last element of the + /// usize, and the ast as a reference to an ftd_ast::AST. If either the last element of the /// stack or the first element of the ast_list field do not exist, the method returns None. pub fn peek_stack(&self) -> Option<(String, usize, &ftd_ast::Ast)> { if let Some((doc_name, ast_list)) = self.to_process.stack.last() { @@ -1077,7 +1077,7 @@ impl ParsedDocument { /// document field. /// /// StuckOnProcessor: The interpreter is currently stuck on processing an AST and is waiting on a -/// processor to finish its execution. The state, resolved, module, and processor fields hold the +/// processor to finish its execution. The state, ast, module, and processor fields hold the /// current state of the interpreter, the AST being processed, the name of the module containing /// the processor, and the name of the processor, respectively. /// diff --git a/ftd/src/interpreter/tdoc.rs b/ftd/src/interpreter/tdoc.rs index c8513d60b5..9f55b1b048 100644 --- a/ftd/src/interpreter/tdoc.rs +++ b/ftd/src/interpreter/tdoc.rs @@ -1112,7 +1112,7 @@ impl<'a> TDoc<'a> { /*if doc_name.ne(self.name) { let current_doc_contains_thing = current_parsed_document - .resolved + .ast .iter() .filter(|v| { !v.is_component() @@ -1956,7 +1956,7 @@ impl<'a> TDoc<'a> { } ftd::interpreter::utils::e2( - format!("Can't unresolved to {kind:?}, found: {o:?}"), + format!("Can't parse to {kind:?}, found: {o:?}"), self.name, line_number, ) @@ -1979,7 +1979,7 @@ impl<'a> TDoc<'a> { } _ => { return ftd::interpreter::utils::e2( - format!("Can't unresolved to string, found: {json}"), + format!("Can't parse to string, found: {json}"), self.name, line_number, ) @@ -1991,7 +1991,7 @@ impl<'a> TDoc<'a> { serde_json::Value::Number(n) => { n.as_i64() .ok_or_else(|| ftd::interpreter::Error::ParseError { - message: format!("Can't unresolved to integer, found: {json}"), + message: format!("Can't parse to integer, found: {json}"), doc_id: self.name.to_string(), line_number, })? @@ -1999,7 +1999,7 @@ impl<'a> TDoc<'a> { serde_json::Value::String(s) => { s.parse::() .map_err(|_| ftd::interpreter::Error::ParseError { - message: format!("Can't unresolved to integer, found: {json}"), + message: format!("Can't parse to integer, found: {json}"), doc_id: self.name.to_string(), line_number, })? @@ -2009,7 +2009,7 @@ impl<'a> TDoc<'a> { } _ => { return ftd::interpreter::utils::e2( - format!("Can't unresolved to integer, found: {json}"), + format!("Can't parse to integer, found: {json}"), self.name, line_number, ) @@ -2021,7 +2021,7 @@ impl<'a> TDoc<'a> { serde_json::Value::Number(n) => { n.as_f64() .ok_or_else(|| ftd::interpreter::Error::ParseError { - message: format!("Can't unresolved to decimal, found: {json}"), + message: format!("Can't parse to decimal, found: {json}"), doc_id: self.name.to_string(), line_number, })? @@ -2029,7 +2029,7 @@ impl<'a> TDoc<'a> { serde_json::Value::String(s) => { s.parse::() .map_err(|_| ftd::interpreter::Error::ParseError { - message: format!("Can't unresolved to decimal, found: {json}"), + message: format!("Can't parse to decimal, found: {json}"), doc_id: self.name.to_string(), line_number, })? @@ -2039,7 +2039,7 @@ impl<'a> TDoc<'a> { } _ => { return ftd::interpreter::utils::e2( - format!("Can't unresolved to decimal, found: {}", json), + format!("Can't parse to decimal, found: {}", json), self.name, line_number, ) @@ -2052,7 +2052,7 @@ impl<'a> TDoc<'a> { serde_json::Value::String(s) => { s.parse::() .map_err(|_| ftd::interpreter::Error::ParseError { - message: format!("Can't unresolved to boolean, found: {}", json), + message: format!("Can't parse to boolean, found: {}", json), doc_id: self.name.to_string(), line_number, })? @@ -2062,7 +2062,7 @@ impl<'a> TDoc<'a> { Some(1) => true, _ => { return Err(ftd::interpreter::Error::ParseError { - message: format!("Can't unresolved to decimal, found: {json}"), + message: format!("Can't parse to decimal, found: {json}"), doc_id: self.name.to_string(), line_number, }) @@ -2073,7 +2073,7 @@ impl<'a> TDoc<'a> { } _ => { return ftd::interpreter::utils::e2( - format!("Can't unresolved to boolean, found: {}", json), + format!("Can't parse to boolean, found: {}", json), self.name, line_number, ) diff --git a/ftd/src/interpreter/things/component.rs b/ftd/src/interpreter/things/component.rs index 3b15e6dfb4..20c3cf4cae 100644 --- a/ftd/src/interpreter/things/component.rs +++ b/ftd/src/interpreter/things/component.rs @@ -248,7 +248,7 @@ impl Component { Some(v) => v, None => { return Err(ftd::interpreter::Error::ParseError { - message: "Could not unresolved keyword argument value as string." + message: "Could not parse keyword argument value as string." .to_string(), doc_id: doc.name.clone(), line_number: value.line_number(), diff --git a/ftd/src/interpreter/things/record.rs b/ftd/src/interpreter/things/record.rs index c672d69b7d..670ba45d88 100644 --- a/ftd/src/interpreter/things/record.rs +++ b/ftd/src/interpreter/things/record.rs @@ -288,14 +288,14 @@ impl Field { doc: &mut ftd::interpreter::TDoc, known_kinds: &ftd::Map, ) -> ftd::interpreter::Result>> { - // First resolve all kinds from resolved fields + // First resolve all kinds from ast fields let partial_resolved_fields = try_ok_state!(Field::resolve_kinds_from_ast_fields( fields, doc, known_kinds )?); - // Once resolved kinds are resolved, then try resolving resolved values + // Once ast kinds are resolved, then try resolving ast values let resolved_fields = Field::resolve_values_from_ast_fields(name, partial_resolved_fields, doc)?;