diff --git a/_site/slides/telling-a-story.html b/_site/slides/telling-a-story.html index 35fde82..4dc5a71 100644 --- a/_site/slides/telling-a-story.html +++ b/_site/slides/telling-a-story.html @@ -390,16 +390,16 @@

Every story needs an arc

Mapping my story onto this format

-
+

Opening: We need to make many data visualizations in my lab

-
+

Challenge: I end up telling my students the same things over and over

-
+

Action: I go and write a book about data visualization

-
+

Resolution: The book is written. But now I teach the material, so I still keep saying the same things over and over

diff --git a/_site/slides/telling-a-story.qmd b/_site/slides/telling-a-story.qmd index 043e408..f01e0bc 100644 --- a/_site/slides/telling-a-story.qmd +++ b/_site/slides/telling-a-story.qmd @@ -97,19 +97,19 @@ Challenge and resolution are
the two most important parts ## Mapping my story onto this format -::: {.fragment .move-down-1em} +::: {.fragment .small-font .move-down-1em} **Opening:** We need to make many data visualizations in my lab ::: -::: {.fragment .move-down-1em} +::: {.fragment .small-font .move-down-1em} **Challenge:** I end up telling my students the same things over and over ::: -::: {.fragment .move-down-1em} +::: {.fragment .small-font .move-down-1em} **Action:** I go and write a book about data visualization ::: -::: {.fragment .move-down-1em} +::: {.fragment .small-font .move-down-1em} **Resolution:** The book is written. But now I teach the material, so I still keep saying the same things over and over ::: diff --git a/_site/worksheets/_extensions/r-wasm/live/_extension.yml b/_site/worksheets/_extensions/r-wasm/live/_extension.yml new file mode 100644 index 0000000..cd325cb --- /dev/null +++ b/_site/worksheets/_extensions/r-wasm/live/_extension.yml @@ -0,0 +1,15 @@ +title: Quarto Live +author: George Stagg +version: 0.1.2-dev +quarto-required: ">=1.4.0" +contributes: + filters: + - live.lua + formats: + common: + ojs-engine: true + filters: + - live.lua + html: default + revealjs: default + dashboard: default diff --git a/_site/worksheets/_extensions/r-wasm/live/_gradethis.qmd b/_site/worksheets/_extensions/r-wasm/live/_gradethis.qmd new file mode 100644 index 0000000..bd0186f --- /dev/null +++ b/_site/worksheets/_extensions/r-wasm/live/_gradethis.qmd @@ -0,0 +1,40 @@ +```{webr} +#| edit: false +#| output: false +webr::install("gradethis", quiet = TRUE) +library(gradethis) +options(webr.exercise.checker = function( + label, user_code, solution_code, check_code, envir_result, evaluate_result, + envir_prep, last_value, engine, stage, ... +) { + if (is.null(check_code)) { + # No grading code, so just skip grading + invisible(NULL) + } else if (is.null(label)) { + list( + correct = FALSE, + type = "warning", + message = "All exercises must have a label." + ) + } else if (is.null(solution_code)) { + list( + correct = FALSE, + type = "warning", + message = htmltools::tags$div( + htmltools::tags$p("A problem occurred grading this exercise."), + htmltools::tags$p( + "No solution code was found. Note that grading exercises using the ", + htmltools::tags$code("gradethis"), + "package requires a model solution to be included in the document." + ) + ) + ) + } else { + gradethis::gradethis_exercise_checker( + label = label, solution_code = solution_code, user_code = user_code, + check_code = check_code, envir_result = envir_result, + evaluate_result = evaluate_result, envir_prep = envir_prep, + last_value = last_value, stage = stage, engine = engine) + } +}) +``` diff --git a/_site/worksheets/_extensions/r-wasm/live/_knitr.qmd b/_site/worksheets/_extensions/r-wasm/live/_knitr.qmd new file mode 100644 index 0000000..5bfca80 --- /dev/null +++ b/_site/worksheets/_extensions/r-wasm/live/_knitr.qmd @@ -0,0 +1,32 @@ +```{r echo=FALSE} +# Setup knitr for handling {webr} and {pyodide} blocks +# TODO: With quarto-dev/quarto-cli#10169, we can implement this in a filter + +# We'll handle `include: false` in Lua, always include cell in knitr output +knitr::opts_hooks$set(include = function(options) { + if (options$engine == "webr" || options$engine == "pyodide") { + options$include <- TRUE + } + options +}) + +# Passthrough engine for webr +knitr::knit_engines$set(webr = function(options) { + knitr:::one_string(c( + "```{webr}", + options$yaml.code, + options$code, + "```" + )) +}) + +# Passthrough engine for pyodide +knitr::knit_engines$set(pyodide = function(options) { + knitr:::one_string(c( + "```{pyodide}", + options$yaml.code, + options$code, + "```" + )) +}) +``` diff --git a/_site/worksheets/_extensions/r-wasm/live/live.lua b/_site/worksheets/_extensions/r-wasm/live/live.lua new file mode 100644 index 0000000..681d370 --- /dev/null +++ b/_site/worksheets/_extensions/r-wasm/live/live.lua @@ -0,0 +1,733 @@ +local tinyyaml = require "resources/tinyyaml" + +local cell_options = { + webr = { eval = true }, + pyodide = { eval = true }, +} + +local live_options = { + ["show-solutions"] = true, + ["show-hints"] = true, + ["grading"] = true, +} + +local ojs_definitions = { + contents = {}, +} +local block_id = 0 + +local include_webr = false +local include_pyodide = false + +local function json_as_b64(obj) + local json_string = quarto.json.encode(obj) + return quarto.base64.encode(json_string) +end + +local function tree(root) + function isdir(path) + -- Is there a better OS agnostic way to do this? + local ok, err, code = os.rename(path .. "/", path .. "/") + if not ok then + if code == 13 then + -- Permission denied, but it exists + return true + end + end + return ok, err + end + + function gather(path, list) + if (isdir(path)) then + -- For each item in this dir, recurse for subdir content + local items = pandoc.system.list_directory(path) + for _, item in pairs(items) do + gather(path .. "/" .. item, list) + end + else + -- This is a file, add it to the table directly + table.insert(list, path) + end + return list + end + + return gather(root, {}) +end + +function ParseBlock(block, engine) + local attr = {} + local param_lines = {} + local code_lines = {} + for line in block.text:gmatch("([^\r\n]*)[\r\n]?") do + local param_line = string.find(line, "^#|") + if (param_line ~= nil) then + table.insert(param_lines, string.sub(line, 4)) + else + table.insert(code_lines, line) + end + end + local code = table.concat(code_lines, "\n") + + -- Include cell-options defaults + for k, v in pairs(cell_options[engine]) do + attr[k] = v + end + + -- Parse quarto-style yaml attributes + local param_yaml = table.concat(param_lines, "\n") + if (param_yaml ~= "") then + param_attr = tinyyaml.parse(param_yaml) + for k, v in pairs(param_attr) do + attr[k] = v + end + end + + -- Parse traditional knitr-style attributes + for k, v in pairs(block.attributes) do + local function toboolean(v) + return string.lower(v) == "true" + end + + local convert = { + autorun = toboolean, + runbutton = toboolean, + echo = toboolean, + edit = toboolean, + error = toboolean, + eval = toboolean, + include = toboolean, + output = toboolean, + startover = toboolean, + solution = toboolean, + warning = toboolean, + timelimit = tonumber, + ["fig-width"] = tonumber, + ["fig-height"] = tonumber, + } + + if (convert[k]) then + attr[k] = convert[k](v) + else + attr[k] = v + end + end + + -- When echo: false: disable the editor + if (attr.echo == false) then + attr.edit = false + end + + -- When `include: false`: disable the editor, source block echo, and output + if (attr.include == false) then + attr.edit = false + attr.echo = false + attr.output = false + end + + -- If we're not executing anything, there's no point showing an editor + if (attr.edit == nil) then + attr.edit = attr.eval + end + + return { + code = code, + attr = attr + } +end + +local exercise_keys = {} +function assertUniqueExercise(key) + if (exercise_keys[key]) then + error("Document contains multiple exercises with key `" .. tostring(key) .. + "`." .. "Exercise keys must be unique.") + end + exercise_keys[key] = true +end + +function assertBlockExercise(type, engine, block) + if (not block.attr.exercise) then + error("Can't create `" .. engine .. "` " .. type .. + " block, `exercise` not defined in cell options.") + end +end + +function ExerciseDataBlocks(btype, block) + local ex = block.attr.exercise + if (type(ex) ~= "table") then + ex = { ex } + end + + local blocks = {} + for idx, ex_id in pairs(ex) do + blocks[idx] = pandoc.RawBlock( + "html", + "" + ) + end + return blocks +end + +function PyodideCodeBlock(code) + block_id = block_id + 1 + + function append_ojs_template(template, template_vars) + local file = io.open(quarto.utils.resolve_path("templates/" .. template), "r") + assert(file) + local content = file:read("*a") + for k, v in pairs(template_vars) do + content = string.gsub(content, "{{" .. k .. "}}", v) + end + + table.insert(ojs_definitions.contents, 1, { + methodName = "interpret", + cellName = "pyodide-" .. block_id, + inline = false, + source = content, + }) + end + + -- Parse codeblock contents for YAML header and Python code body + local block = ParseBlock(code, "pyodide") + + if (block.attr.output == "asis") then + quarto.log.warning( + "For `pyodide` code blocks, using `output: asis` renders Python output as HTML.", + "Markdown rendering is not currently supported." + ) + end + + -- Supplementary execise blocks: setup, check, hint, solution + if (block.attr.setup) then + assertBlockExercise("setup", "pyodide", block) + return ExerciseDataBlocks("setup", block) + end + + if (block.attr.check) then + assertBlockExercise("check", "pyodide", block) + if live_options["grading"] then + return ExerciseDataBlocks("check", block) + else + return {} + end + end + + if (block.attr.hint) then + assertBlockExercise("hint", "pyodide", block) + if live_options["show-hints"] then + return pandoc.Div( + InterpolatedBlock( + pandoc.CodeBlock(block.code, pandoc.Attr('', { 'python', 'cell-code' })), + "python" + ), + pandoc.Attr('', + { 'pyodide-ojs-exercise', 'exercise-hint', 'd-none' }, + { exercise = block.attr.exercise } + ) + ) + end + return {} + end + + if (block.attr.solution) then + assertBlockExercise("solution", "pyodide", block) + if live_options["show-solutions"] then + local plaincode = pandoc.Code(block.code, pandoc.Attr('', { 'solution-code', 'd-none' })) + local codeblock = pandoc.CodeBlock(block.code, pandoc.Attr('', { 'python', 'cell-code' })) + return pandoc.Div( + { + InterpolatedBlock(plaincode, "none"), + InterpolatedBlock(codeblock, "python"), + }, + pandoc.Attr('', + { 'pyodide-ojs-exercise', 'exercise-solution', 'd-none' }, + { exercise = block.attr.exercise } + ) + ) + end + return {} + end + + -- Prepare OJS attributes + local input = "{" .. table.concat(block.attr.input or {}, ", ") .. "}" + local ojs_vars = { + block_id = block_id, + block_input = input, + } + + -- Render appropriate OJS for the type of client-side block we're working with + local ojs_source = nil + if (block.attr.exercise) then + -- Primary interactive exercise block + assertUniqueExercise(block.attr.exercise) + ojs_source = "pyodide-exercise.ojs" + elseif (block.attr.edit) then + -- Editable non-exercise sandbox block + ojs_source = "pyodide-editor.ojs" + else + -- Non-interactive evaluation block + ojs_source = "pyodide-evaluate.ojs" + end + + append_ojs_template(ojs_source, ojs_vars) + + return pandoc.Div({ + pandoc.Div({}, pandoc.Attr("pyodide-" .. block_id, { 'exercise-cell' })), + pandoc.RawBlock( + "html", + "" + ) + }) +end + +function WebRCodeBlock(code) + block_id = block_id + 1 + + function append_ojs_template(template, template_vars) + local file = io.open(quarto.utils.resolve_path("templates/" .. template), "r") + assert(file) + local content = file:read("*a") + for k, v in pairs(template_vars) do + content = string.gsub(content, "{{" .. k .. "}}", v) + end + + table.insert(ojs_definitions.contents, 1, { + methodName = "interpret", + cellName = "webr-" .. block_id, + inline = false, + source = content, + }) + end + + -- Parse codeblock contents for YAML header and R code body + local block = ParseBlock(code, "webr") + + if (block.attr.output == "asis") then + quarto.log.warning( + "For `webr` code blocks, using `output: asis` renders R output as HTML.", + "Markdown rendering is not currently supported." + ) + end + + -- Supplementary execise blocks: setup, check, hint, solution + if (block.attr.setup) then + assertBlockExercise("setup", "webr", block) + return ExerciseDataBlocks("setup", block) + end + + if (block.attr.check) then + assertBlockExercise("check", "webr", block) + if live_options["grading"] then + return ExerciseDataBlocks("check", block) + else + return {} + end + end + + if (block.attr.hint) then + assertBlockExercise("hint", "webr", block) + if live_options["show-hints"] then + return pandoc.Div( + InterpolatedBlock( + pandoc.CodeBlock(block.code, pandoc.Attr('', { 'r', 'cell-code' })), + "r" + ), + pandoc.Attr('', + { 'webr-ojs-exercise', 'exercise-hint', 'd-none' }, + { exercise = block.attr.exercise } + ) + ) + end + return {} + end + + if (block.attr.solution) then + assertBlockExercise("solution", "webr", block) + if live_options["show-solutions"] then + local plaincode = pandoc.Code(block.code, pandoc.Attr('', { 'solution-code', 'd-none' })) + local codeblock = pandoc.CodeBlock(block.code, pandoc.Attr('', { 'r', 'cell-code' })) + return pandoc.Div( + { + InterpolatedBlock(plaincode, "none"), + InterpolatedBlock(codeblock, "r"), + }, + pandoc.Attr('', + { 'webr-ojs-exercise', 'exercise-solution', 'd-none' }, + { exercise = block.attr.exercise } + ) + ) + end + return {} + end + + -- Prepare OJS attributes + local input = "{" .. table.concat(block.attr.input or {}, ", ") .. "}" + local ojs_vars = { + block_id = block_id, + block_input = input, + } + + -- Render appropriate OJS for the type of client-side block we're working with + local ojs_source = nil + if (block.attr.exercise) then + -- Primary interactive exercise block + assertUniqueExercise(block.attr.exercise) + ojs_source = "webr-exercise.ojs" + elseif (block.attr.edit) then + -- Editable non-exercise sandbox block + ojs_source = "webr-editor.ojs" + else + -- Non-interactive evaluation block + ojs_source = "webr-evaluate.ojs" + end + + append_ojs_template(ojs_source, ojs_vars) + + -- Render any HTMLWidgets after HTML output has been added to the DOM + HTMLWidget(block_id) + + return pandoc.Div({ + pandoc.Div({}, pandoc.Attr("webr-" .. block_id, { 'exercise-cell' })), + pandoc.RawBlock( + "html", + "" + ) + }) +end + +function InterpolatedBlock(block, language) + block_id = block_id + 1 + + -- Reactively render OJS variables in codeblocks + file = io.open(quarto.utils.resolve_path("templates/interpolate.ojs"), "r") + assert(file) + content = file:read("*a") + + -- Build map of OJS variable names to JS template literals + local map = "{\n" + for var in block.text:gmatch("${([a-zA-Z_$][%w_$]+)}") do + map = map .. var .. ",\n" + end + map = map .. "}" + + -- We add this OJS block for its side effect of updating the HTML element + content = string.gsub(content, "{{block_id}}", block_id) + content = string.gsub(content, "{{def_map}}", map) + content = string.gsub(content, "{{language}}", language) + table.insert(ojs_definitions.contents, { + methodName = "interpretQuiet", + cellName = "interpolate-" .. block_id, + inline = false, + source = content, + }) + + block.identifier = "interpolate-" .. block_id + return block +end + +function CodeBlock(code) + if ( + code.classes:includes("{webr}") or + code.classes:includes("webr") or + code.classes:includes("{webr-r}") + ) then + -- Client side R code block + include_webr = true + return WebRCodeBlock(code) + end + + if ( + code.classes:includes("{pyodide}") or + code.classes:includes("pyodide") or + code.classes:includes("{pyodide-python}") + ) then + -- Client side Python code block + include_pyodide = true + return PyodideCodeBlock(code) + end + + -- Non-interactive code block containing OJS variables + if (string.match(code.text, "${[a-zA-Z_$][%w_$]+}")) then + if (code.classes:includes("r")) then + include_webr = true + return InterpolatedBlock(code, "r") + elseif (code.classes:includes("python")) then + include_pyodide = true + return InterpolatedBlock(code, "python") + end + end +end + +function HTMLWidget(block_id) + local file = io.open(quarto.utils.resolve_path("templates/webr-widget.ojs"), "r") + assert(file) + content = file:read("*a") + + table.insert(ojs_definitions.contents, 1, { + methodName = "interpretQuiet", + cellName = "webr-widget-" .. block_id, + inline = false, + source = string.gsub(content, "{{block_id}}", block_id), + }) +end + +function Div(block) + -- Render exercise hints with display:none + if (block.classes:includes("hint") and block.attributes["exercise"] ~= nil) then + if live_options["show-hints"] then + block.classes:insert("webr-ojs-exercise") + block.classes:insert("exercise-hint") + block.classes:insert("d-none") + return block + else + return {} + end + end +end + +function Proof(block) + -- Quarto wraps solution blocks in a Proof structure + -- Dig into the expected shape and look for our own exercise solutions + if (block["type"] == "Solution") then + local content = block["__quarto_custom_node"] + local container = content.c[1] + if (container) then + local solution = container.c[1] + if (solution) then + if (solution.attributes["exercise"] ~= nil) then + if live_options["show-solutions"] then + solution.classes:insert("webr-ojs-exercise") + solution.classes:insert("exercise-solution") + solution.classes:insert("d-none") + return solution + else + return {} + end + end + end + end + end +end + +function setupPyodide(doc) + local pyodide = doc.meta.pyodide or {} + local packages = pyodide.packages or {} + + local file = io.open(quarto.utils.resolve_path("templates/pyodide-setup.ojs"), "r") + assert(file) + local content = file:read("*a") + + local pyodide_packages = { + pkgs = { "pyodide_http", "micropip", "ipython" }, + } + for _, pkg in pairs(packages) do + table.insert(pyodide_packages.pkgs, pandoc.utils.stringify(pkg)) + end + + -- Initial Pyodide startup options + local pyodide_options = { + indexURL = "https://cdn.jsdelivr.net/pyodide/v0.26.1/full/", + } + if (pyodide["engine-url"]) then + pyodide_options["indexURL"] = pandoc.utils.stringify(pyodide["engine-url"]) + end + + local data = { + packages = pyodide_packages, + options = pyodide_options, + } + + table.insert(ojs_definitions.contents, { + methodName = "interpretQuiet", + cellName = "pyodide-prelude", + inline = false, + source = content, + }) + + doc.blocks:insert(pandoc.RawBlock( + "html", + "" + )) + + return pyodide +end + +function setupWebR(doc) + local webr = doc.meta.webr or {} + local packages = webr.packages or {} + local repos = webr.repos or {} + + local file = io.open(quarto.utils.resolve_path("templates/webr-setup.ojs"), "r") + assert(file) + local content = file:read("*a") + + -- List of webR R packages and repositories to install + local webr_packages = { + pkgs = { "evaluate", "knitr", "htmltools" }, + repos = {} + } + for _, pkg in pairs(packages) do + table.insert(webr_packages.pkgs, pandoc.utils.stringify(pkg)) + end + for _, repo in pairs(repos) do + table.insert(webr_packages.repos, pandoc.utils.stringify(repo)) + end + + -- Data frame rendering + local webr_render_df = "default" + if (webr["render-df"]) then + webr_render_df = pandoc.utils.stringify(webr["render-df"]) + local pkg = { + ["paged-table"] = "rmarkdown", + ["gt"] = "gt", + ["gt-interactive"] = "gt", + ["dt"] = "DT", + ["reactable"] = "reactable", + } + if (pkg[webr_render_df]) then + table.insert(webr_packages.pkgs, pkg[webr_render_df]) + end + end + + -- Initial webR startup options + local webr_options = { + baseUrl = "https://webr.r-wasm.org/v0.4.2/", + } + if (webr["engine-url"]) then + webr_options["baseUrl"] = pandoc.utils.stringify(webr["engine-url"]) + end + + local data = { + packages = webr_packages, + options = webr_options, + render_df = webr_render_df, + } + + table.insert(ojs_definitions.contents, { + methodName = "interpretQuiet", + cellName = "webr-prelude", + inline = false, + source = content, + }) + + doc.blocks:insert(pandoc.RawBlock( + "html", + "" + )) + + return webr +end + +function Pandoc(doc) + local webr = nil + local pyodide = nil + if (include_webr) then + webr = setupWebR(doc) + end + if (include_pyodide) then + pyodide = setupPyodide(doc) + end + + -- OJS block definitions + doc.blocks:insert(pandoc.RawBlock( + "html", + "" + )) + + -- Loading indicator + doc.blocks:insert( + pandoc.Div({ + pandoc.Div({}, pandoc.Attr("exercise-loading-status", { "d-flex", "gap-2" })), + pandoc.Div({}, pandoc.Attr("", { "spinner-grow", "spinner-grow-sm" })), + }, pandoc.Attr( + "exercise-loading-indicator", + { "exercise-loading-indicator", "d-none", "d-flex", "align-items-center", "gap-2" } + )) + ) + + -- Exercise runtime dependencies + quarto.doc.add_html_dependency({ + name = 'live-runtime', + scripts = { + { path = "resources/live-runtime.js", attribs = { type = "module" } }, + }, + resources = { "resources/pyodide-worker.js" }, + stylesheets = { "resources/live-runtime.css" }, + }) + + -- Copy resources for upload to VFS at runtime + local vfs_files = {} + if (webr and webr.resources) then + resource_list = webr.resources + elseif (pyodide and pyodide.resources) then + resource_list = pyodide.resources + else + resource_list = doc.meta.resources + end + + if (type(resource_list) ~= "table") then + resource_list = { resource_list } + end + + if (resource_list) then + for _, files in pairs(resource_list) do + if (type(files) ~= "table") then + files = { files } + end + for _, file in pairs(files) do + local filetree = tree(pandoc.utils.stringify(file)) + for _, path in pairs(filetree) do + table.insert(vfs_files, path) + end + end + end + end + doc.blocks:insert(pandoc.RawBlock( + "html", + "" + )) + return doc +end + +function Meta(meta) + local webr = meta.webr or {} + + for k, v in pairs(webr["cell-options"] or {}) do + if (type(v) == "table") then + cell_options.webr[k] = pandoc.utils.stringify(v) + else + cell_options.webr[k] = v + end + end + + local pyodide = meta.pyodide or {} + + for k, v in pairs(pyodide["cell-options"] or {}) do + if (type(v) == "table") then + cell_options.pyodide[k] = pandoc.utils.stringify(v) + else + cell_options.pyodide[k] = v + end + end + + local live = meta.live or {} + if (type(live) == "table") then + for k, v in pairs(live) do + live_options[k] = v + end + else + quarto.log.error("Invalid value for document yaml key: `live`.") + end +end + +return { + { Meta = Meta }, + { + Div = Div, + Proof = Proof, + CodeBlock = CodeBlock, + Pandoc = Pandoc, + }, +} diff --git a/_site/worksheets/_extensions/r-wasm/live/resources/live-runtime.css b/_site/worksheets/_extensions/r-wasm/live/resources/live-runtime.css new file mode 100644 index 0000000..1ddfc5c --- /dev/null +++ b/_site/worksheets/_extensions/r-wasm/live/resources/live-runtime.css @@ -0,0 +1 @@ +.quarto-light{--exercise-main-color: var(--bs-body-color, var(--r-main-color, #212529));--exercise-main-bg: var(--bs-body-bg, var(--r-background-color, #ffffff));--exercise-primary-rgb: var(--bs-primary-rgb, 13, 110, 253);--exercise-gray: var(--bs-gray-300, #dee2e6);--exercise-cap-bg: var(--bs-light-bg-subtle, #f8f8f8);--exercise-line-bg: rgba(var(--exercise-primary-rgb), .05);--exercise-line-gutter-bg: rgba(var(--exercise-primary-rgb), .1);--exercise-code-block-color: var(--quarto-scss-export-code-block-color, var(--exercise-main-color));--exercise-code-block-bg: var(--quarto-scss-export-code-block-bg, var(--exercise-main-bg))}.quarto-dark{--exercise-main-color: var(--bs-body-color, var(--r-main-color, #ffffff));--exercise-main-bg: var(--bs-body-bg, var(--r-background-color, #222222));--exercise-primary-rgb: var(--bs-primary-rgb, 55, 90, 127);--exercise-gray: var(--bs-gray-700, #434343);--exercise-cap-bg: var(--bs-card-cap-bg, #505050);--exercise-line-bg: rgba(var(--exercise-primary-rgb), .2);--exercise-line-gutter-bg: rgba(var(--exercise-primary-rgb), .4);--exercise-code-block-color: var(--quarto-scss-export-code-block-color, var(--exercise-main-color));--exercise-code-block-bg: var(--quarto-scss-export-code-block-bg, var(--exercise-main-bg))}.webr-ojs-exercise.exercise-solution,.webr-ojs-exercise.exercise-hint{border:var(--exercise-gray) 1px solid;border-radius:5px;padding:1rem}.exercise-hint .exercise-hint,.exercise-solution .exercise-solution{border:none;padding:0}.webr-ojs-exercise.exercise-solution>.callout,.webr-ojs-exercise.exercise-hint>.callout{margin:-1rem;border:0}#exercise-loading-indicator{position:fixed;bottom:0;right:0;font-size:1.2rem;padding:.2rem .75rem;border:1px solid var(--exercise-gray);background-color:var(--exercise-cap-bg);border-top-left-radius:5px}#exercise-loading-indicator>.spinner-grow{min-width:1rem}.exercise-loading-details+.exercise-loading-details:before{content:"/ "}@media only screen and (max-width: 576px){#exercise-loading-indicator{font-size:.8rem;padding:.1rem .5rem}#exercise-loading-indicator>.spinner-grow{min-width:.66rem}#exercise-loading-indicator .gap-2{gap:.2rem!important}#exercise-loading-indicator .spinner-grow{--bs-spinner-width: .66rem;--bs-spinner-height: .66rem}}.btn.btn-exercise-editor:disabled,.btn.btn-exercise-editor.disabled,.btn-exercise-editor fieldset:disabled .btn{transition:opacity .5s}.card.exercise-editor .card-header a.btn{--bs-btn-padding-x: .5rem;--bs-btn-padding-y: .15rem;--bs-btn-font-size: .75rem}.quarto-dark .card.exercise-editor .card-header .btn.btn-outline-dark{--bs-btn-color: #f8f8f8;--bs-btn-border-color: #f8f8f8;--bs-btn-hover-color: #000;--bs-btn-hover-bg: #f8f8f8;--bs-btn-hover-border-color: #f8f8f8;--bs-btn-focus-shadow-rgb: 248, 248, 248;--bs-btn-active-color: #000;--bs-btn-active-bg: #f8f8f8;--bs-btn-active-border-color: #f8f8f8;--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);--bs-btn-disabled-color: #f8f8f8;--bs-btn-disabled-bg: transparent;--bs-btn-disabled-border-color: #f8f8f8;--bs-btn-bg: transparent;--bs-gradient: none}.card.exercise-editor{--exercise-min-lines: 0;--exercise-max-lines: infinity;--exercise-font-size: var(--bs-body-font-size, 1rem)}.card.exercise-editor .card-header{padding:.5rem 1rem;background-color:var(--exercise-cap-bg);border-bottom:1px solid rgba(0,0,0,.175)}.card.exercise-editor .cm-editor{color:var(--exercise-code-block-color);background-color:var(--exercise-code-block-bg);max-height:calc(var(--exercise-max-lines) * 1.4 * var(--exercise-font-size) + 8px)}.card.exercise-editor .cm-content{caret-color:var(--exercise-code-block-color)}.card.exercise-editor .cm-cursor,.card.exercise-editor .cm-dropCursor{border-left-color:var(--exercise-code-block-color)}.card.exercise-editor .cm-focused .cm-selectionBackgroundm .cm-selectionBackground,.card.exercise-editor .cm-content ::selection{background-color:rgba(var(--exercise-primary-rgb),.1)}.card.exercise-editor .cm-activeLine{background-color:var(--exercise-line-bg)}.card.exercise-editor .cm-activeLineGutter{background-color:var(--exercise-line-gutter-bg)}.card.exercise-editor .cm-gutters{background-color:var(--exercise-cap-bg);color:var(--exercise-main-color);border-right:1px solid var(--exercise-gray)}.card.exercise-editor .cm-content,.card.exercise-editor .cm-gutter{min-height:calc(var(--exercise-min-lines) * 1.4 * var(--exercise-font-size) + 8px)}.card.exercise-editor .cm-scroller{line-height:1.4;overflow:auto}:root{--exercise-editor-hl-al: var(--quarto-hl-al-color, #AD0000);--exercise-editor-hl-an: var(--quarto-hl-an-color, #5E5E5E);--exercise-editor-hl-at: var(--quarto-hl-at-color, #657422);--exercise-editor-hl-bn: var(--quarto-hl-bn-color, #AD0000);--exercise-editor-hl-ch: var(--quarto-hl-ch-color, #20794D);--exercise-editor-hl-co: var(--quarto-hl-co-color, #5E5E5E);--exercise-editor-hl-cv: var(--quarto-hl-cv-color, #5E5E5E);--exercise-editor-hl-cn: var(--quarto-hl-cn-color, #8f5902);--exercise-editor-hl-cf: var(--quarto-hl-cf-color, #003B4F);--exercise-editor-hl-dt: var(--quarto-hl-dt-color, #AD0000);--exercise-editor-hl-dv: var(--quarto-hl-dv-color, #AD0000);--exercise-editor-hl-do: var(--quarto-hl-do-color, #5E5E5E);--exercise-editor-hl-er: var(--quarto-hl-er-color, #AD0000);--exercise-editor-hl-fl: var(--quarto-hl-fl-color, #AD0000);--exercise-editor-hl-fu: var(--quarto-hl-fu-color, #4758AB);--exercise-editor-hl-im: var(--quarto-hl-im-color, #00769E);--exercise-editor-hl-in: var(--quarto-hl-in-color, #5E5E5E);--exercise-editor-hl-kw: var(--quarto-hl-kw-color, #003B4F);--exercise-editor-hl-op: var(--quarto-hl-op-color, #5E5E5E);--exercise-editor-hl-ot: var(--quarto-hl-ot-color, #003B4F);--exercise-editor-hl-pp: var(--quarto-hl-pp-color, #AD0000);--exercise-editor-hl-sc: var(--quarto-hl-sc-color, #5E5E5E);--exercise-editor-hl-ss: var(--quarto-hl-ss-color, #20794D);--exercise-editor-hl-st: var(--quarto-hl-st-color, #20794D);--exercise-editor-hl-va: var(--quarto-hl-va-color, #111111);--exercise-editor-hl-vs: var(--quarto-hl-vs-color, #20794D);--exercise-editor-hl-wa: var(--quarto-hl-wa-color, #5E5E5E)}*[data-bs-theme=dark]{--exercise-editor-hl-al: var(--quarto-hl-al-color, #f07178);--exercise-editor-hl-an: var(--quarto-hl-an-color, #d4d0ab);--exercise-editor-hl-at: var(--quarto-hl-at-color, #00e0e0);--exercise-editor-hl-bn: var(--quarto-hl-bn-color, #d4d0ab);--exercise-editor-hl-bu: var(--quarto-hl-bu-color, #abe338);--exercise-editor-hl-ch: var(--quarto-hl-ch-color, #abe338);--exercise-editor-hl-co: var(--quarto-hl-co-color, #f8f8f2);--exercise-editor-hl-cv: var(--quarto-hl-cv-color, #ffd700);--exercise-editor-hl-cn: var(--quarto-hl-cn-color, #ffd700);--exercise-editor-hl-cf: var(--quarto-hl-cf-color, #ffa07a);--exercise-editor-hl-dt: var(--quarto-hl-dt-color, #ffa07a);--exercise-editor-hl-dv: var(--quarto-hl-dv-color, #d4d0ab);--exercise-editor-hl-do: var(--quarto-hl-do-color, #f8f8f2);--exercise-editor-hl-er: var(--quarto-hl-er-color, #f07178);--exercise-editor-hl-ex: var(--quarto-hl-ex-color, #00e0e0);--exercise-editor-hl-fl: var(--quarto-hl-fl-color, #d4d0ab);--exercise-editor-hl-fu: var(--quarto-hl-fu-color, #ffa07a);--exercise-editor-hl-im: var(--quarto-hl-im-color, #abe338);--exercise-editor-hl-in: var(--quarto-hl-in-color, #d4d0ab);--exercise-editor-hl-kw: var(--quarto-hl-kw-color, #ffa07a);--exercise-editor-hl-op: var(--quarto-hl-op-color, #ffa07a);--exercise-editor-hl-ot: var(--quarto-hl-ot-color, #00e0e0);--exercise-editor-hl-pp: var(--quarto-hl-pp-color, #dcc6e0);--exercise-editor-hl-re: var(--quarto-hl-re-color, #00e0e0);--exercise-editor-hl-sc: var(--quarto-hl-sc-color, #abe338);--exercise-editor-hl-ss: var(--quarto-hl-ss-color, #abe338);--exercise-editor-hl-st: var(--quarto-hl-st-color, #abe338);--exercise-editor-hl-va: var(--quarto-hl-va-color, #00e0e0);--exercise-editor-hl-vs: var(--quarto-hl-vs-color, #abe338);--exercise-editor-hl-wa: var(--quarto-hl-wa-color, #dcc6e0)}pre>code.sourceCode span.tok-keyword,.exercise-editor-body>.cm-editor span.tok-keyword{color:var(--exercise-editor-hl-kw)}pre>code.sourceCode span.tok-operator,.exercise-editor-body>.cm-editor span.tok-operator{color:var(--exercise-editor-hl-op)}pre>code.sourceCode span.tok-definitionOperator,.exercise-editor-body>.cm-editor span.tok-definitionOperator{color:var(--exercise-editor-hl-ot)}pre>code.sourceCode span.tok-compareOperator,.exercise-editor-body>.cm-editor span.tok-compareOperator{color:var(--exercise-editor-hl-ot)}pre>code.sourceCode span.tok-attributeName,.exercise-editor-body>.cm-editor span.tok-attributeName{color:var(--exercise-editor-hl-at)}pre>code.sourceCode span.tok-controlKeyword,.exercise-editor-body>.cm-editor span.tok-controlKeyword{color:var(--exercise-editor-hl-cf)}pre>code.sourceCode span.tok-comment,.exercise-editor-body>.cm-editor span.tok-comment{color:var(--exercise-editor-hl-co)}pre>code.sourceCode span.tok-string,.exercise-editor-body>.cm-editor span.tok-string{color:var(--exercise-editor-hl-st)}pre>code.sourceCode span.tok-string2,.exercise-editor-body>.cm-editor span.tok-string2{color:var(--exercise-editor-hl-ss)}pre>code.sourceCode span.tok-variableName,.exercise-editor-body>.cm-editor span.tok-variableName{color:var(--exercise-editor-hl-va)}pre>code.sourceCode span.tok-bool,pre>code.sourceCode span.tok-literal,pre>code.sourceCode span.tok-separator,.exercise-editor-body>.cm-editor span.tok-bool,.exercise-editor-body>.cm-editor span.tok-literal,.exercise-editor-body>.cm-editor span.tok-separator{color:var(--exercise-editor-hl-cn)}pre>code.sourceCode span.tok-bool,pre>code.sourceCode span.tok-literal,.exercise-editor-body>.cm-editor span.tok-bool,.exercise-editor-body>.cm-editor span.tok-literal{color:var(--exercise-editor-hl-cn)}pre>code.sourceCode span.tok-number,pre>code.sourceCode span.tok-integer,.exercise-editor-body>.cm-editor span.tok-number,.exercise-editor-body>.cm-editor span.tok-integer{color:var(--exercise-editor-hl-dv)}pre>code.sourceCode span.tok-function-variableName,.exercise-editor-body>.cm-editor span.tok-function-variableName{color:var(--exercise-editor-hl-fu)}pre>code.sourceCode span.tok-function-attributeName,.exercise-editor-body>.cm-editor span.tok-function-attributeName{color:var(--exercise-editor-hl-at)}div.exercise-cell-output.cell-output-stdout pre code,div.exercise-cell-output.cell-output-stderr pre code{white-space:pre-wrap;word-wrap:break-word}div.exercise-cell-output.cell-output-stderr pre code{color:var(--exercise-editor-hl-er, #AD0000)}div.cell-output-pyodide table{border:none;margin:0 auto 1em}div.cell-output-pyodide thead{border-bottom:1px solid var(--exercise-main-color)}div.cell-output-pyodide td,div.cell-output-pyodide th,div.cell-output-pyodide tr{padding:.5em;line-height:normal}div.cell-output-pyodide th{font-weight:700}div.cell-output-display canvas{background-color:#fff}.tab-pane>.exercise-tab-pane-header+div.webr-ojs-exercise{margin-top:1em}.alert .exercise-feedback p:last-child{margin-bottom:0}.alert.exercise-grade{animation-duration:.25s;animation-name:exercise-grade-slidein}@keyframes exercise-grade-slidein{0%{transform:translateY(10px);opacity:0}to{transform:translateY(0);opacity:1}}.alert.exercise-grade p:last-child{margin-bottom:0}.alert.exercise-grade pre{white-space:pre-wrap;color:inherit}.observablehq pre>code.sourceCode{white-space:pre;position:relative}.observablehq div.sourceCode{margin:1em 0!important}.observablehq pre.sourceCode{margin:0!important}@media screen{.observablehq div.sourceCode{overflow:auto}}@media print{.observablehq pre>code.sourceCode{white-space:pre-wrap}.observablehq pre>code.sourceCode>span{text-indent:-5em;padding-left:5em}}.reveal .d-none{display:none!important}.reveal .d-flex{display:flex!important}.reveal .card.exercise-editor .justify-content-between{justify-content:space-between!important}.reveal .card.exercise-editor .align-items-center{align-items:center!important}.reveal .card.exercise-editor .gap-1{gap:.25rem!important}.reveal .card.exercise-editor .gap-2{gap:.5rem!important}.reveal .card.exercise-editor .gap-3{gap:.75rem!important}.reveal .card.exercise-editor{--exercise-font-size: 1.3rem;margin:1rem 0;border:1px solid rgba(0,0,0,.175);border-radius:.375rem;font-size:var(--exercise-font-size);overflow:hidden}.reveal .card.exercise-editor .card-header{padding:.5rem 1rem;background-color:var(--exercise-cap-bg);border-bottom:1px solid rgba(0,0,0,.175)}.reveal .cell-output-webr.cell-output-display,.reveal .cell-output-pyodide.cell-output-display{text-align:center}.quarto-light .reveal .btn.btn-exercise-editor.btn-primary{--exercise-btn-bg: var(--bs-btn-bg, #0d6efd);--exercise-btn-color: var(--bs-btn-color, #ffffff);--exercise-btn-border-color: var(--bs-btn-border-color, #0d6efd);--exercise-btn-hover-border-color: var(--bs-btn-hover-border-color, #0b5ed7);--exercise-btn-hover-bg: var(--bs-btn-hover-bg, #0b5ed7);--exercise-btn-hover-color: var(--bs-btn-hover-color, #ffffff)}.quarto-dark .reveal .btn.btn-exercise-editor.btn-primary{--exercise-btn-bg: var(--bs-btn-bg, #375a7f);--exercise-btn-color: var(--bs-btn-color, #ffffff);--exercise-btn-border-color: var(--bs-btn-border-color, #375a7f);--exercise-btn-hover-border-color: var(--bs-btn-hover-border-color, #2c4866);--exercise-btn-hover-bg: var(--bs-btn-hover-bg, #2c4866);--exercise-btn-hover-color: var(--bs-btn-hover-color, #ffffff)}.quarto-light .reveal .btn.btn-exercise-editor.btn-outline-dark{--exercise-btn-bg: var(--bs-btn-bg, transparent);--exercise-btn-color: var(--bs-btn-color, #333);--exercise-btn-border-color: var(--bs-btn-border-color, #333);--exercise-btn-hover-border-color: var(--bs-btn-hover-border-color, #333);--exercise-btn-hover-bg: var(--bs-btn-hover-bg, #333);--exercise-btn-hover-color: var(--bs-btn-hover-color, #ffffff)}.quarto-dark .reveal .btn.btn-exercise-editor.btn-outline-dark{--exercise-btn-bg: var(--bs-btn-bg, transparent);--exercise-btn-color: var(--bs-btn-color, #f8f8f8);--exercise-btn-border-color: var(--bs-btn-border-color, #f8f8f8);--exercise-btn-hover-border-color: var(--bs-btn-hover-border-color, #f8f8f8);--exercise-btn-hover-bg: var(--bs-btn-hover-bg, #f8f8f8);--exercise-btn-hover-color: var(--bs-btn-hover-color, #000000)}@media only screen and (max-width: 576px){:not(.reveal) .card-header .btn-exercise-editor>.btn-label-exercise-editor{max-width:0px;margin-left:-4px;overflow:hidden;transition:max-width .2s ease-in,margin-left .05s ease-out .2s}:not(.reveal) .card-header .btn-exercise-editor:hover>.btn-label-exercise-editor{position:inherit;max-width:80px;margin-left:0;transition:max-width .2s ease-out .05s,margin-left .05s ease-in}}.reveal .card.exercise-editor .btn-group{border-radius:.375rem;position:relative;display:inline-flex;vertical-align:middle}.reveal .card.exercise-editor .btn-group>.btn{position:relative;flex:1 1 auto}.reveal .card.exercise-editor .btn-group>:not(.btn-check:first-child)+.btn,.reveal .card.exercise-editor .btn-group>.btn-group:not(:first-child){margin-left:-1px}.reveal .card.exercise-editor .btn-group>.btn:not(:last-child):not(.dropdown-toggle),.reveal .card.exercise-editor .btn-group>.btn.dropdown-toggle-split:first-child,.reveal .card.exercise-editor .btn-group>.btn-group:not(:last-child)>.btn{border-top-right-radius:0;border-bottom-right-radius:0}.reveal .card.exercise-editor .btn-group>.btn:nth-child(n+3),.reveal .card.exercise-editor .btn-group>:not(.btn-check)+.btn,.reveal .card.exercise-editor .btn-group>.btn-group:not(:first-child)>.btn{border-top-left-radius:0;border-bottom-left-radius:0}.reveal .btn.btn-exercise-editor{display:inline-block;padding:.25rem .5rem;font-size:1rem;color:var(--exercise-btn-color);background-color:var(--exercise-btn-bg);text-align:center;text-decoration:none;vertical-align:middle;cursor:pointer;user-select:none;border:1px solid var(--exercise-btn-border-color);border-radius:.375rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}.reveal .btn.btn-exercise-editor:hover{color:var(--exercise-btn-hover-color);background-color:var(--exercise-btn-hover-bg);border-color:var(--exercise-btn-hover-border-color)}.reveal .btn.btn-exercise-editor:disabled,.reveal .btn.btn-exercise-editor.disabled,.reveal .btn-exercise-editor fieldset:disabled .btn{pointer-events:none;opacity:.65}.reveal .card.exercise-editor .spinner-grow{background-color:currentcolor;opacity:0;display:inline-block;width:1.5rem;height:1.5rem;vertical-align:-.125em;border-radius:50%;animation:.75s linear infinite spinner-grow}.reveal .cell-output-container pre code{overflow:auto;max-height:initial}.reveal .alert.exercise-grade{font-size:.55em;position:relative;padding:1rem;margin:1rem 0;border-radius:.25rem;color:var(--exercise-alert-color);background-color:var(--exercise-alert-bg);border:1px solid var(--exercise-alert-border-color)}.reveal .alert.exercise-grade .alert-link{font-weight:700;color:var(--exercise-alert-link-color)}.quarto-light .reveal .exercise-grade.alert-info{--exercise-alert-color: #055160;--exercise-alert-bg: #cff4fc;--exercise-alert-border-color: #9eeaf9;--exercise-alert-link-color: #055160}.quarto-light .reveal .exercise-grade.alert-success{--exercise-alert-color: #0a3622;--exercise-alert-bg: #d1e7dd;--exercise-alert-border-color: #a3cfbb;--exercise-alert-link-color: #0a3622}.quarto-light .reveal .exercise-grade.alert-warning{--exercise-alert-color: #664d03;--exercise-alert-bg: #fff3cd;--exercise-alert-border-color: #ffe69c;--exercise-alert-link-color: #664d03}.quarto-light .reveal .exercise-grade.alert-danger{--exercise-alert-color: #58151c;--exercise-alert-bg: #f8d7da;--exercise-alert-border-color: #f1aeb5;--exercise-alert-link-color: #58151c}.quarto-dark .reveal .exercise-grade.alert-info{--exercise-alert-color: #ffffff;--exercise-alert-bg: #3498db;--exercise-alert-border-color: #3498db;--exercise-alert-link-color: #ffffff}.quarto-dark .reveal .exercise-grade.alert-success{--exercise-alert-color: #ffffff;--exercise-alert-bg: #00bc8c;--exercise-alert-border-color: #00bc8c;--exercise-alert-link-color: #ffffff}.quarto-dark .reveal .exercise-grade.alert-warning{--exercise-alert-color: #ffffff;--exercise-alert-bg: #f39c12;--exercise-alert-border-color: #f39c12;--exercise-alert-link-color: #ffffff}.quarto-dark .reveal .exercise-grade.alert-danger{--exercise-alert-color: #ffffff;--exercise-alert-bg: #e74c3c;--exercise-alert-border-color: #e74c3c;--exercise-alert-link-color: #ffffff} diff --git a/_site/worksheets/_extensions/r-wasm/live/resources/live-runtime.js b/_site/worksheets/_extensions/r-wasm/live/resources/live-runtime.js new file mode 100644 index 0000000..6ef7945 --- /dev/null +++ b/_site/worksheets/_extensions/r-wasm/live/resources/live-runtime.js @@ -0,0 +1,131 @@ +var vO=Object.defineProperty;var ci=(i=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(i,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):i)(function(i){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+i+'" is not supported')});var jt=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),xO=(i,e)=>{for(var t in e)vO(i,t,{get:e[t],enumerable:!0})};var iO=jt((RP,Uk)=>{Uk.exports=` + + +`});var nO=jt((EP,Fk)=>{Fk.exports=` + + + +`});var rO=jt((AP,Hk)=>{Hk.exports=` + +`});var sO=jt((QP,Gk)=>{Gk.exports=` + +`});var fO=jt((sC,Kk)=>{Kk.exports="CmltcG9ydCBweW9kaWRlICMgdHlwZTogaWdub3JlW2F0dHItZGVmaW5lZF0KaW1wb3J0IHN5cwoKIyBDbGVhbnVwIGFueSBsZWZ0b3ZlciBtYXRwbG90bGliIHBsb3RzCnRyeToKICBpbXBvcnQgbWF0cGxvdGxpYi5weXBsb3QgYXMgcGx0CiAgcGx0LmNsb3NlKCJhbGwiKQogIHBsdC5yY1BhcmFtc1siZmlndXJlLmZpZ3NpemUiXSA9ICh3aWR0aCwgaGVpZ2h0KSAjIHR5cGU6IGlnbm9yZVthdHRyLWRlZmluZWRdCiAgcGx0LnJjUGFyYW1zWyJmaWd1cmUuZHBpIl0gPSBkcGkgIyB0eXBlOiBpZ25vcmVbYXR0ci1kZWZpbmVkXQpleGNlcHQgTW9kdWxlTm90Rm91bmRFcnJvcjoKICBwYXNzCgpmcm9tIElQeXRob24udXRpbHMgaW1wb3J0IGNhcHR1cmUKZnJvbSBJUHl0aG9uLmRpc3BsYXkgaW1wb3J0IGRpc3BsYXkKZnJvbSBJUHl0aG9uLmNvcmUuaW50ZXJhY3RpdmVzaGVsbCBpbXBvcnQgSW50ZXJhY3RpdmVTaGVsbApJbnRlcmFjdGl2ZVNoZWxsKCkuaW5zdGFuY2UoKQoKd2l0aCBjYXB0dXJlLmNhcHR1cmVfb3V0cHV0KCkgYXMgb3V0cHV0OgogIHZhbHVlID0gTm9uZQogIHRyeToKICAgIHZhbHVlID0gYXdhaXQgcHlvZGlkZS5jb2RlLmV2YWxfY29kZV9hc3luYyhjb2RlLCBnbG9iYWxzID0gZW52aXJvbm1lbnQpICMgdHlwZTogaWdub3JlW2F0dHItZGVmaW5lZF0KICBleGNlcHQgRXhjZXB0aW9uIGFzIGVycjoKICAgIHByaW50KGVyciwgZmlsZT1zeXMuc3RkZXJyKQogIGlmICh2YWx1ZSBpcyBub3QgTm9uZSk6CiAgICBkaXNwbGF5KHZhbHVlKQoKewogICJ2YWx1ZSI6IHZhbHVlLAogICJzdGRvdXQiOiBvdXRwdXQuc3Rkb3V0LAogICJzdGRlcnIiOiBvdXRwdXQuc3RkZXJyLAogICJvdXRwdXRzIjogb3V0cHV0Lm91dHB1dHMsCn0K"});var yO=jt((MC,nS)=>{nS.exports="IyBDcmVhdGUgZW52aXJvbm1lbnQgdG8gaG9sZCB2YXJpYWJsZXMgZXhwb3J0ZWQgd2l0aCBvanNfZGVmaW5lCi53ZWJyX29qcyA8LSBuZXcuZW52KCkKb2pzX2RlZmluZSA8LSBmdW5jdGlvbiguLi4pIHsKICBhcmdzIDwtIGxpc3QoLi4uKQogIG5hbWVzKGFyZ3MpIDwtIHF1b3RlKG1hdGNoLmNhbGwoZXhwYW5kLmRvdHM9VFJVRSlbMTpsZW5ndGgoYXJncykgKyAxXSkKICAud2Vicl9vanMgPDwtIGxpc3QyZW52KGFyZ3MsIGVudmlyID0gLndlYnJfb2pzKQp9CgojIHdlYlIgZ3JhcGhpY3MgZGV2aWNlIHNldHRpbmdzCm9wdGlvbnMod2Vici5maWcud2lkdGggPSA3LCB3ZWJyLmZpZy5oZWlnaHQgPSA1KQppZiAod2Vicjo6ZXZhbF9qcygndHlwZW9mIE9mZnNjcmVlbkNhbnZhcyAhPT0gInVuZGVmaW5lZCInKSkgewogIG9wdGlvbnMoZGV2aWNlID0gZnVuY3Rpb24oLi4uKSB7CiAgICBhcmdzIDwtIGxpc3QoYmcgPSAid2hpdGUiLCAuLi4pCiAgICBhcmdzIDwtIGFyZ3NbIWR1cGxpY2F0ZWQobmFtZXMoYXJncykpXQogICAgZG8uY2FsbCh3ZWJyOjpjYW52YXMsIGFyZ3MpCiAgfSkKfQoKIyBDdXN0b20gcGFnZXIgZm9yIGRpc3BsYXlpbmcgZS5nLiBoZWxwIHBhZ2VzCm9wdGlvbnMocGFnZXIgPSBmdW5jdGlvbihmaWxlcywgLi4uKSB7CiAgd3JpdGVMaW5lcyhnc3ViKCIuW1xiXSIsICIiLCByZWFkTGluZXMoZmlsZXMpKSkKfSkKCiMgQ3VzdG9tIHZhbHVlIGhhbmRsZXIgYW5kIHJlbmRlcmluZyBmb3IgZXZhbHVhdGUgYW5kIGtuaXRyCm9wdGlvbnMoIndlYnIuZXZhbHVhdGUuaGFuZGxlciIgPSBldmFsdWF0ZTo6bmV3X291dHB1dF9oYW5kbGVyKAogIHZhbHVlID0gZnVuY3Rpb24oeCwgdmlzaWJsZSkgewogICAga25pdF9vcHRpb25zID0gbGlzdChzY3JlZW5zaG90LmZvcmNlID0gRkFMU0UpCiAgICByZXMgPC0gaWYgKHZpc2libGUpIHsKICAgICAgd2l0aFZpc2libGUoCiAgICAgICAga25pdHI6OmtuaXRfcHJpbnQoCiAgICAgICAgICBpZiAoaW5oZXJpdHMoeCwgImRhdGEuZnJhbWUiKSkgewogICAgICAgICAgICBzd2l0Y2goCiAgICAgICAgICAgICAgZ2V0T3B0aW9uKCJ3ZWJyLnJlbmRlci5kZiIsICJkZWZhdWx0IiksCiAgICAgICAgICAgICAgImthYmxlIiA9IGtuaXRyOjprYWJsZSh4KSwKICAgICAgICAgICAgICAiZHQiID0gRFQ6OmRhdGF0YWJsZSh4KSwKICAgICAgICAgICAgICAicGFnZWQtdGFibGUiID0gcm1hcmtkb3duOjpwYWdlZF90YWJsZSh4KSwKICAgICAgICAgICAgICAiZ3QiID0gZ3Q6Omd0KHgpLAogICAgICAgICAgICAgICJndC1pbnRlcmFjdGl2ZSIgPSBndDo6b3B0X2ludGVyYWN0aXZlKGd0OjpndCh4KSksCiAgICAgICAgICAgICAgInJlYWN0YWJsZSIgPSByZWFjdGFibGU6OnJlYWN0YWJsZSh4KSwKICAgICAgICAgICAgICB4CiAgICAgICAgICAgICkKICAgICAgICAgIH0gZWxzZSB4LAogICAgICAgIG9wdGlvbnMgPSBrbml0X29wdGlvbnMpCiAgICAgICkKICAgIH0gZWxzZSBsaXN0KHZhbHVlID0geCwgdmlzaWJsZSA9IEZBTFNFKQogICAgcmVzJGNsYXNzIDwtIGNsYXNzKHJlcyR2YWx1ZSkKICAgIGNsYXNzKHJlcykgPC0gInJlc3VsdCIKICAgIHJlcwogIH0KKSkKCiMgQWRkaXRpb25hbCBwYWNrYWdlIG9wdGlvbnMKb3B0aW9ucyhrbml0ci50YWJsZS5mb3JtYXQgPSAiaHRtbCIpCm9wdGlvbnMocmdsLnByaW50Umdsd2lkZ2V0ID0gVFJVRSkKCiMgRGVmYXVsdCBleGVyY2lzZSBncmFkZXIKIyBUT0RPOiBoYW5kbGUgZXJyb3JfY2hlY2sgJiBjb2RlX2NoZWNrIHN0YWdlcwpvcHRpb25zKHdlYnIuZXhlcmNpc2UuY2hlY2tlciA9IGZ1bmN0aW9uKAogIGxhYmVsLCB1c2VyX2NvZGUsIHNvbHV0aW9uX2NvZGUsIGNoZWNrX2NvZGUsIGVudmlyX3Jlc3VsdCwgZXZhbHVhdGVfcmVzdWx0LAogIGVudmlyX3ByZXAsIGxhc3RfdmFsdWUsIGVuZ2luZSwgc3RhZ2UsIC4uLgopIHsKICAjIFNldHVwIGVudmlyb25tZW50CiAgLmxhYmVsIDwtIGxhYmVsCiAgLnVzZXJfY29kZSA8LSB1c2VyX2NvZGUKICAuc29sdXRpb25fY29kZSA8LSBzb2x1dGlvbl9jb2RlCiAgLmNoZWNrX2NvZGUgPC0gY2hlY2tfY29kZQogIC5lbnZpcl9yZXN1bHQgPC0gZW52aXJfcmVzdWx0CiAgLmV2YWx1YXRlX3Jlc3VsdCA8LSBldmFsdWF0ZV9yZXN1bHQKICAuZW52aXJfcHJlcCA8LSBlbnZpcl9wcmVwCiAgLmxhc3RfdmFsdWUgPC0gbGFzdF92YWx1ZQogIC5yZXN1bHQgPC0gbGFzdF92YWx1ZQogIC51c2VyIDwtIGxhc3RfdmFsdWUKICAuZW5naW5lIDwtIGVuZ2luZQogIC5zdGFnZSA8LSBzdGFnZQoKICBpZiAoaXMubnVsbCguY2hlY2tfY29kZSkpIHsKICAgICMgTm8gZ3JhZGluZyBjb2RlLCBzbyBqdXN0IHNraXAgZ3JhZGluZwogICAgcmV0dXJuKGludmlzaWJsZShOVUxMKSkKICB9CgogIHRyeUNhdGNoKHsKICAgICMgUGFyc2UgcHJvdmlkZWQgY2hlY2sgY29kZQogICAgcGFyc2VkX2NoZWNrX2NvZGUgPC0gcGFyc2UodGV4dCA9IGNoZWNrX2NvZGUpCgogICAgIyBFdmFsdWF0ZSBwcm92aWRlZCBjaGVjayBjb2RlCiAgICBldmFsKHBhcnNlZF9jaGVja19jb2RlKQogIH0sIGVycm9yID0gZnVuY3Rpb24oZSkgewogICAgbGlzdCgKICAgICAgbWVzc2FnZSA9IHBhc3RlMCgiRXJyb3IgaW4gY2hlY2tpbmcgY29kZSBmb3IgYCIsIGxhYmVsLCAiYDogIiwgZSRtZXNzYWdlKSwKICAgICAgY29ycmVjdCA9IEZBTFNFLAogICAgICBsb2NhdGlvbiA9ICJhcHBlbmQiLAogICAgICB0eXBlID0gIndhcm5pbmciCiAgICApCiAgfSkKfSkK"});var bO=jt((_C,rS)=>{rS.exports="aW1wb3J0IHN5cwppbXBvcnQgb3MKaW1wb3J0IHB5b2RpZGVfaHR0cCAgIyB0eXBlOiBpZ25vcmVbYXR0ci1kZWZpbmVkXQpweW9kaWRlX2h0dHAucGF0Y2hfYWxsKCkKc3lzLnBhdGguaW5zZXJ0KDAsICIvcHlvZGlkZS8iKQpvcy5ta2Rpcihvcy5wYXRoLmV4cGFuZHVzZXIoIn4vLm1hdHBsb3RsaWIiKSkKZiA9IG9wZW4ob3MucGF0aC5leHBhbmR1c2VyKCJ+Ly5tYXRwbG90bGliL21hdHBsb3RsaWJyYyIpLCAiYSIpCmYud3JpdGUoImJhY2tlbmQ6IG1vZHVsZTovL21hdHBsb3RsaWJfZGlzcGxheSIpCmYuY2xvc2UoKQo="});var wO=jt((DC,sS)=>{sS.exports="IyBCYXNlZCBvbiBweW9kaWRlL21hdHBsb3RsaWJfcHlvZGlkZS9odG1sNV9jYW52YXNfYmFja2VuZC5weQojIE1vZGlmaWVkIGZvciBPZmZzY3JlZW5DYW52YXMgcmVuZGVyaW5nIHVuZGVyIFdlYiBXb3JrZXIKIyBMaWNlbnNlOiBNb3ppbGxhIFB1YmxpYyBMaWNlbnNlIFZlcnNpb24gMi4wCgppbXBvcnQgbWF0aAppbXBvcnQgbnVtcHkgYXMgbnAKZnJvbSBtYXRwbG90bGliLmJhY2tlbmRfYmFzZXMgaW1wb3J0ICgKICAgIEZpZ3VyZUNhbnZhc0Jhc2UsCiAgICBGaWd1cmVNYW5hZ2VyQmFzZSwKICAgIFJlbmRlcmVyQmFzZSwKICAgIEdyYXBoaWNzQ29udGV4dEJhc2UsCiAgICBfQmFja2VuZCwKKQpmcm9tIG1hdHBsb3RsaWIuY2Jvb2sgaW1wb3J0IG1heGRpY3QKZnJvbSBtYXRwbG90bGliLmZvbnRfbWFuYWdlciBpbXBvcnQgZmluZGZvbnQKZnJvbSBtYXRwbG90bGliLmZ0MmZvbnQgaW1wb3J0IExPQURfTk9fSElOVElORywgRlQyRm9udApmcm9tIG1hdHBsb3RsaWIubWF0aHRleHQgaW1wb3J0IE1hdGhUZXh0UGFyc2VyCmZyb20gbWF0cGxvdGxpYi5jb2xvcnMgaW1wb3J0IGNvbG9yQ29udmVydGVyLCByZ2IyaGV4CmZyb20gbWF0cGxvdGxpYi5wYXRoIGltcG9ydCBQYXRoCmZyb20gbWF0cGxvdGxpYi50cmFuc2Zvcm1zIGltcG9ydCBBZmZpbmUyRApmcm9tIElQeXRob24uZGlzcGxheSBpbXBvcnQgZGlzcGxheQpmcm9tIGpzIGltcG9ydCBJbWFnZURhdGEsIE9mZnNjcmVlbkNhbnZhcyAjIHR5cGU6IGlnbm9yZVthdHRyLWRlZmluZWRdCmZyb20gcHlvZGlkZS5mZmkgaW1wb3J0IGNyZWF0ZV9wcm94eSAjIHR5cGU6IGlnbm9yZVthdHRyLWRlZmluZWRdCmltcG9ydCBsb2dnaW5nCgpfY2Fwc3R5bGVfZCA9IHsicHJvamVjdGluZyI6ICJzcXVhcmUiLCAiYnV0dCI6ICJidXR0IiwgInJvdW5kIjogInJvdW5kIn0KbG9nZ2luZy5nZXRMb2dnZXIoJ21hdHBsb3RsaWIuZm9udF9tYW5hZ2VyJykuZGlzYWJsZWQgPSBUcnVlCgpjbGFzcyBSaWNoSW1hZ2VCaXRtYXBPdXRwdXQoKToKICAgIGRlZiBfX2luaXRfXyhzZWxmLCBmaWd1cmUpOgogICAgICAgIHNlbGYuaW1hZ2UgPSBmaWd1cmUuX2ltYWdlYml0bWFwCiAgICAgICAgc2VsZi50aXRsZSA9IGZpZ3VyZS5fdGl0bGUKCiAgICBkZWYgX3JlcHJfbWltZWJ1bmRsZV8oc2VsZiwgaW5jbHVkZSwgZXhjbHVkZSk6CiAgICAgICAgcmV0dXJuIHsgImFwcGxpY2F0aW9uL2h0bWwtaW1hZ2ViaXRtYXAiOiBzZWxmLmltYWdlIH0sIHsgInRpdGxlIjogc2VsZi50aXRsZSB9CgpjbGFzcyBGaWd1cmVDYW52YXNXb3JrZXIoRmlndXJlQ2FudmFzQmFzZSk6CiAgICBkZWYgX19pbml0X18oc2VsZiwgKmFyZ3MsICoqa3dhcmdzKToKICAgICAgICBGaWd1cmVDYW52YXNCYXNlLl9faW5pdF9fKHNlbGYsICphcmdzLCAqKmt3YXJncykKICAgICAgICBzZWxmLl9pZGxlX3NjaGVkdWxlZCA9IEZhbHNlCiAgICAgICAgc2VsZi5faWQgPSAibWF0cGxvdGxpYl8iICsgaGV4KGlkKHNlbGYpKVsyOl0KICAgICAgICBzZWxmLl90aXRsZSA9ICIiCiAgICAgICAgc2VsZi5fcmF0aW8gPSAyCgogICAgICAgIHdpZHRoLCBoZWlnaHQgPSBzZWxmLmdldF93aWR0aF9oZWlnaHQoKQogICAgICAgIHdpZHRoICo9IHNlbGYuX3JhdGlvCiAgICAgICAgaGVpZ2h0ICo9IHNlbGYuX3JhdGlvCgogICAgICAgIHNlbGYuX2NhbnZhcyA9IE9mZnNjcmVlbkNhbnZhcy5uZXcod2lkdGgsIGhlaWdodCkKICAgICAgICBzZWxmLl9jb250ZXh0ID0gc2VsZi5fY2FudmFzLmdldENvbnRleHQoIjJkIikKICAgICAgICBzZWxmLl9pbWFnZWJpdG1hcCA9IE5vbmUKCiAgICBkZWYgc2hvdyhzZWxmLCAqYXJncywgKiprd2FyZ3MpOgogICAgICAgIHNlbGYuY2xvc2UoKQogICAgICAgIHNlbGYuZHJhdygpCiAgICAgICAgc2VsZi5faW1hZ2ViaXRtYXAgPSBzZWxmLl9jYW52YXMudHJhbnNmZXJUb0ltYWdlQml0bWFwKCkKICAgICAgICBkaXNwbGF5KFJpY2hJbWFnZUJpdG1hcE91dHB1dChzZWxmKSkKCiAgICBkZWYgZHJhdyhzZWxmKToKICAgICAgICBzZWxmLl9pZGxlX3NjaGVkdWxlZCA9IFRydWUKICAgICAgICBvcmlnX2RwaSA9IHNlbGYuZmlndXJlLmRwaQogICAgICAgIGlmIHNlbGYuX3JhdGlvICE9IDE6CiAgICAgICAgICAgIHNlbGYuZmlndXJlLmRwaSAqPSBzZWxmLl9yYXRpbwogICAgICAgIHRyeToKICAgICAgICAgICAgd2lkdGgsIGhlaWdodCA9IHNlbGYuZ2V0X3dpZHRoX2hlaWdodCgpCiAgICAgICAgICAgIGlmIHNlbGYuX2NhbnZhcyBpcyBOb25lOgogICAgICAgICAgICAgICAgcmV0dXJuCiAgICAgICAgICAgIHJlbmRlcmVyID0gUmVuZGVyZXJIVE1MQ2FudmFzV29ya2VyKHNlbGYuX2NvbnRleHQsIHdpZHRoLCBoZWlnaHQsIHNlbGYuZmlndXJlLmRwaSwgc2VsZikKICAgICAgICAgICAgc2VsZi5maWd1cmUuZHJhdyhyZW5kZXJlcikKICAgICAgICBleGNlcHQgRXhjZXB0aW9uIGFzIGU6CiAgICAgICAgICAgIHJhaXNlIFJ1bnRpbWVFcnJvcigiUmVuZGVyaW5nIGZhaWxlZCIpIGZyb20gZQogICAgICAgIGZpbmFsbHk6CiAgICAgICAgICAgIHNlbGYuZmlndXJlLmRwaSA9IG9yaWdfZHBpCiAgICAgICAgICAgIHNlbGYuX2lkbGVfc2NoZWR1bGVkID0gRmFsc2UKCiAgICBkZWYgc2V0X3dpbmRvd190aXRsZShzZWxmLCB0aXRsZSk6CiAgICAgICAgc2VsZi5fdGl0bGUgPSB0aXRsZQoKICAgIGRlZiBjbG9zZShzZWxmKToKICAgICAgICBpZiAoc2VsZi5faW1hZ2ViaXRtYXApOgogICAgICAgICAgICBzZWxmLl9pbWFnZWJpdG1hcC5jbG9zZSgpCiAgICAgICAgICAgIHNlbGYuX2ltYWdlYml0bWFwID0gTm9uZQoKICAgIGRlZiBkZXN0cm95KHNlbGYsICphcmdzLCAqKmt3YXJncyk6CiAgICAgICAgc2VsZi5jbG9zZSgpCgpjbGFzcyBHcmFwaGljc0NvbnRleHRIVE1MQ2FudmFzKEdyYXBoaWNzQ29udGV4dEJhc2UpOgogICAgZGVmIF9faW5pdF9fKHNlbGYsIHJlbmRlcmVyKToKICAgICAgICBzdXBlcigpLl9faW5pdF9fKCkKICAgICAgICBzZWxmLnN0cm9rZSA9IFRydWUKICAgICAgICBzZWxmLnJlbmRlcmVyID0gcmVuZGVyZXIKCiAgICBkZWYgcmVzdG9yZShzZWxmKToKICAgICAgICBzZWxmLnJlbmRlcmVyLmN0eC5yZXN0b3JlKCkKCiAgICBkZWYgc2V0X2NhcHN0eWxlKHNlbGYsIGNzKToKICAgICAgICBpZiBjcyBpbiBbImJ1dHQiLCAicm91bmQiLCAicHJvamVjdGluZyJdOgogICAgICAgICAgICBzZWxmLl9jYXBzdHlsZSA9IGNzCiAgICAgICAgICAgIHNlbGYucmVuZGVyZXIuY3R4LmxpbmVDYXAgPSBfY2Fwc3R5bGVfZFtjc10KICAgICAgICBlbHNlOgogICAgICAgICAgICByYWlzZSBWYWx1ZUVycm9yKGYiVW5yZWNvZ25pemVkIGNhcCBzdHlsZS4gRm91bmQge2NzfSIpCgogICAgZGVmIHNldF9jbGlwX3JlY3RhbmdsZShzZWxmLCByZWN0YW5nbGUpOgogICAgICAgIHNlbGYucmVuZGVyZXIuY3R4LnNhdmUoKQogICAgICAgIGlmIG5vdCByZWN0YW5nbGU6CiAgICAgICAgICAgIHNlbGYucmVuZGVyZXIuY3R4LnJlc3RvcmUoKQogICAgICAgICAgICByZXR1cm4KICAgICAgICB4LCB5LCB3LCBoID0gbnAucm91bmQocmVjdGFuZ2xlLmJvdW5kcykKICAgICAgICBzZWxmLnJlbmRlcmVyLmN0eC5iZWdpblBhdGgoKQogICAgICAgIHNlbGYucmVuZGVyZXIuY3R4LnJlY3QoeCwgc2VsZi5yZW5kZXJlci5oZWlnaHQgLSB5IC0gaCwgdywgaCkKICAgICAgICBzZWxmLnJlbmRlcmVyLmN0eC5jbGlwKCkKCiAgICBkZWYgc2V0X2NsaXBfcGF0aChzZWxmLCBwYXRoKToKICAgICAgICBzZWxmLnJlbmRlcmVyLmN0eC5zYXZlKCkKICAgICAgICBpZiBub3QgcGF0aDoKICAgICAgICAgICAgc2VsZi5yZW5kZXJlci5jdHgucmVzdG9yZSgpCiAgICAgICAgICAgIHJldHVybgogICAgICAgIHRwYXRoLCBhZmZpbmUgPSBwYXRoLmdldF90cmFuc2Zvcm1lZF9wYXRoX2FuZF9hZmZpbmUoKQogICAgICAgIGFmZmluZSA9IGFmZmluZSArIEFmZmluZTJEKCkuc2NhbGUoMSwgLTEpLnRyYW5zbGF0ZSgwLCBzZWxmLnJlbmRlcmVyLmhlaWdodCkKICAgICAgICBzZWxmLnJlbmRlcmVyLl9wYXRoX2hlbHBlcihzZWxmLnJlbmRlcmVyLmN0eCwgdHBhdGgsIGFmZmluZSkKICAgICAgICBzZWxmLnJlbmRlcmVyLmN0eC5jbGlwKCkKCiAgICBkZWYgc2V0X2Rhc2hlcyhzZWxmLCBkYXNoX29mZnNldCwgZGFzaF9saXN0KToKICAgICAgICBzZWxmLl9kYXNoZXMgPSBkYXNoX29mZnNldCwgZGFzaF9saXN0CiAgICAgICAgaWYgZGFzaF9vZmZzZXQgaXMgbm90IE5vbmU6CiAgICAgICAgICAgIHNlbGYucmVuZGVyZXIuY3R4LmxpbmVEYXNoT2Zmc2V0ID0gZGFzaF9vZmZzZXQKICAgICAgICBpZiBkYXNoX2xpc3QgaXMgTm9uZToKICAgICAgICAgICAgc2VsZi5yZW5kZXJlci5jdHguc2V0TGluZURhc2goW10pCiAgICAgICAgZWxzZToKICAgICAgICAgICAgZGxuID0gbnAuYXNhcnJheShkYXNoX2xpc3QpCiAgICAgICAgICAgIGRsID0gbGlzdChzZWxmLnJlbmRlcmVyLnBvaW50c190b19waXhlbHMoZGxuKSkKICAgICAgICAgICAgc2VsZi5yZW5kZXJlci5jdHguc2V0TGluZURhc2goZGwpCgogICAgZGVmIHNldF9qb2luc3R5bGUoc2VsZiwganMpOgogICAgICAgIGlmIGpzIGluIFsibWl0ZXIiLCAicm91bmQiLCAiYmV2ZWwiXToKICAgICAgICAgICAgc2VsZi5fam9pbnN0eWxlID0ganMKICAgICAgICAgICAgc2VsZi5yZW5kZXJlci5jdHgubGluZUpvaW4gPSBqcwogICAgICAgIGVsc2U6CiAgICAgICAgICAgIHJhaXNlIFZhbHVlRXJyb3IoZiJVbnJlY29nbml6ZWQgam9pbiBzdHlsZS4gRm91bmQge2pzfSIpCgogICAgZGVmIHNldF9saW5ld2lkdGgoc2VsZiwgdyk6CiAgICAgICAgc2VsZi5zdHJva2UgPSB3ICE9IDAKICAgICAgICBzZWxmLl9saW5ld2lkdGggPSBmbG9hdCh3KQogICAgICAgIHNlbGYucmVuZGVyZXIuY3R4LmxpbmVXaWR0aCA9IHNlbGYucmVuZGVyZXIucG9pbnRzX3RvX3BpeGVscyhmbG9hdCh3KSkKCmNsYXNzIFJlbmRlcmVySFRNTENhbnZhc1dvcmtlcihSZW5kZXJlckJhc2UpOgogICAgZGVmIF9faW5pdF9fKHNlbGYsIGN0eCwgd2lkdGgsIGhlaWdodCwgZHBpLCBmaWcpOgogICAgICAgIHN1cGVyKCkuX19pbml0X18oKQogICAgICAgIHNlbGYuZmlnID0gZmlnCiAgICAgICAgc2VsZi5jdHggPSBjdHgKICAgICAgICBzZWxmLndpZHRoID0gd2lkdGgKICAgICAgICBzZWxmLmhlaWdodCA9IGhlaWdodAogICAgICAgIHNlbGYuY3R4LndpZHRoID0gc2VsZi53aWR0aAogICAgICAgIHNlbGYuY3R4LmhlaWdodCA9IHNlbGYuaGVpZ2h0CiAgICAgICAgc2VsZi5kcGkgPSBkcGkKICAgICAgICBzZWxmLmZvbnRkID0gbWF4ZGljdCg1MCkKICAgICAgICBzZWxmLm1hdGh0ZXh0X3BhcnNlciA9IE1hdGhUZXh0UGFyc2VyKCJiaXRtYXAiKQoKICAgICAgICAjIEtlZXAgdGhlIHN0YXRlIG9mIGZvbnRmYWNlcyB0aGF0IGFyZSBsb2FkaW5nCiAgICAgICAgc2VsZi5mb250c19sb2FkaW5nID0ge30KCiAgICBkZWYgbmV3X2djKHNlbGYpOgogICAgICAgIHJldHVybiBHcmFwaGljc0NvbnRleHRIVE1MQ2FudmFzKHJlbmRlcmVyPXNlbGYpCgogICAgZGVmIHBvaW50c190b19waXhlbHMoc2VsZiwgcG9pbnRzKToKICAgICAgICByZXR1cm4gKHBvaW50cyAvIDcyLjApICogc2VsZi5kcGkKCiAgICBkZWYgX21hdHBsb3RsaWJfY29sb3JfdG9fQ1NTKHNlbGYsIGNvbG9yLCBhbHBoYSwgYWxwaGFfb3ZlcnJpZGVzLCBpc19SR0I9VHJ1ZSk6CiAgICAgICAgaWYgbm90IGlzX1JHQjoKICAgICAgICAgICAgUiwgRywgQiwgYWxwaGEgPSBjb2xvckNvbnZlcnRlci50b19yZ2JhKGNvbG9yKQogICAgICAgICAgICBjb2xvciA9IChSLCBHLCBCKQoKICAgICAgICBpZiAobGVuKGNvbG9yKSA9PSA0KSBhbmQgKGFscGhhIGlzIE5vbmUpOgogICAgICAgICAgICBhbHBoYSA9IGNvbG9yWzNdCgogICAgICAgIGlmIGFscGhhIGlzIE5vbmU6CiAgICAgICAgICAgIENTU19jb2xvciA9IHJnYjJoZXgoY29sb3JbOjNdKQoKICAgICAgICBlbHNlOgogICAgICAgICAgICBSID0gaW50KGNvbG9yWzBdICogMjU1KQogICAgICAgICAgICBHID0gaW50KGNvbG9yWzFdICogMjU1KQogICAgICAgICAgICBCID0gaW50KGNvbG9yWzJdICogMjU1KQogICAgICAgICAgICBpZiBsZW4oY29sb3IpID09IDMgb3IgYWxwaGFfb3ZlcnJpZGVzOgogICAgICAgICAgICAgICAgQ1NTX2NvbG9yID0gZiIiInJnYmEoe1I6ZH0sIHtHOmR9LCB7QjpkfSwge2FscGhhOi4zZ30pIiIiCiAgICAgICAgICAgIGVsc2U6CiAgICAgICAgICAgICAgICBDU1NfY29sb3IgPSAiIiJyZ2JhKHs6ZH0sIHs6ZH0sIHs6ZH0sIHs6LjNnfSkiIiIuZm9ybWF0KAogICAgICAgICAgICAgICAgICAgIFIsIEcsIEIsIGNvbG9yWzNdCiAgICAgICAgICAgICAgICApCgogICAgICAgIHJldHVybiBDU1NfY29sb3IKCiAgICBkZWYgX3NldF9zdHlsZShzZWxmLCBnYywgcmdiRmFjZT1Ob25lKToKICAgICAgICBpZiByZ2JGYWNlIGlzIG5vdCBOb25lOgogICAgICAgICAgICBzZWxmLmN0eC5maWxsU3R5bGUgPSBzZWxmLl9tYXRwbG90bGliX2NvbG9yX3RvX0NTUygKICAgICAgICAgICAgICAgIHJnYkZhY2UsIGdjLmdldF9hbHBoYSgpLCBnYy5nZXRfZm9yY2VkX2FscGhhKCkKICAgICAgICAgICAgKQoKICAgICAgICBpZiBnYy5nZXRfY2Fwc3R5bGUoKToKICAgICAgICAgICAgc2VsZi5jdHgubGluZUNhcCA9IF9jYXBzdHlsZV9kW2djLmdldF9jYXBzdHlsZSgpXQoKICAgICAgICBzZWxmLmN0eC5zdHJva2VTdHlsZSA9IHNlbGYuX21hdHBsb3RsaWJfY29sb3JfdG9fQ1NTKAogICAgICAgICAgICBnYy5nZXRfcmdiKCksIGdjLmdldF9hbHBoYSgpLCBnYy5nZXRfZm9yY2VkX2FscGhhKCkKICAgICAgICApCgogICAgICAgIHNlbGYuY3R4LmxpbmVXaWR0aCA9IHNlbGYucG9pbnRzX3RvX3BpeGVscyhnYy5nZXRfbGluZXdpZHRoKCkpCgogICAgZGVmIF9wYXRoX2hlbHBlcihzZWxmLCBjdHgsIHBhdGgsIHRyYW5zZm9ybSwgY2xpcD1Ob25lKToKICAgICAgICBjdHguYmVnaW5QYXRoKCkKICAgICAgICBmb3IgcG9pbnRzLCBjb2RlIGluIHBhdGguaXRlcl9zZWdtZW50cyh0cmFuc2Zvcm0sIHJlbW92ZV9uYW5zPVRydWUsIGNsaXA9Y2xpcCk6CiAgICAgICAgICAgIGlmIGNvZGUgPT0gUGF0aC5NT1ZFVE86CiAgICAgICAgICAgICAgICBjdHgubW92ZVRvKHBvaW50c1swXSwgcG9pbnRzWzFdKQogICAgICAgICAgICBlbGlmIGNvZGUgPT0gUGF0aC5MSU5FVE86CiAgICAgICAgICAgICAgICBjdHgubGluZVRvKHBvaW50c1swXSwgcG9pbnRzWzFdKQogICAgICAgICAgICBlbGlmIGNvZGUgPT0gUGF0aC5DVVJWRTM6CiAgICAgICAgICAgICAgICBjdHgucXVhZHJhdGljQ3VydmVUbygqcG9pbnRzKQogICAgICAgICAgICBlbGlmIGNvZGUgPT0gUGF0aC5DVVJWRTQ6CiAgICAgICAgICAgICAgICBjdHguYmV6aWVyQ3VydmVUbygqcG9pbnRzKQogICAgICAgICAgICBlbGlmIGNvZGUgPT0gUGF0aC5DTE9TRVBPTFk6CiAgICAgICAgICAgICAgICBjdHguY2xvc2VQYXRoKCkKCiAgICBkZWYgZHJhd19wYXRoKHNlbGYsIGdjLCBwYXRoLCB0cmFuc2Zvcm0sIHJnYkZhY2U9Tm9uZSk6CiAgICAgICAgc2VsZi5fc2V0X3N0eWxlKGdjLCByZ2JGYWNlKQogICAgICAgIGlmIHJnYkZhY2UgaXMgTm9uZSBhbmQgZ2MuZ2V0X2hhdGNoKCkgaXMgTm9uZToKICAgICAgICAgICAgZmlndXJlX2NsaXAgPSAoMCwgMCwgc2VsZi53aWR0aCwgc2VsZi5oZWlnaHQpCiAgICAgICAgZWxzZToKICAgICAgICAgICAgZmlndXJlX2NsaXAgPSBOb25lCgogICAgICAgIHRyYW5zZm9ybSArPSBBZmZpbmUyRCgpLnNjYWxlKDEsIC0xKS50cmFuc2xhdGUoMCwgc2VsZi5oZWlnaHQpCiAgICAgICAgc2VsZi5fcGF0aF9oZWxwZXIoc2VsZi5jdHgsIHBhdGgsIHRyYW5zZm9ybSwgZmlndXJlX2NsaXApCgogICAgICAgIGlmIHJnYkZhY2UgaXMgbm90IE5vbmU6CiAgICAgICAgICAgIHNlbGYuY3R4LmZpbGwoKQogICAgICAgICAgICBzZWxmLmN0eC5maWxsU3R5bGUgPSAiIzAwMDAwMCIKCiAgICAgICAgaWYgZ2Muc3Ryb2tlOgogICAgICAgICAgICBzZWxmLmN0eC5zdHJva2UoKQoKICAgIGRlZiBkcmF3X21hcmtlcnMoc2VsZiwgZ2MsIG1hcmtlcl9wYXRoLCBtYXJrZXJfdHJhbnMsIHBhdGgsIHRyYW5zLCByZ2JGYWNlPU5vbmUpOgogICAgICAgIHN1cGVyKCkuZHJhd19tYXJrZXJzKGdjLCBtYXJrZXJfcGF0aCwgbWFya2VyX3RyYW5zLCBwYXRoLCB0cmFucywgcmdiRmFjZSkKCiAgICBkZWYgX2dldF9mb250KHNlbGYsIHByb3ApOgogICAgICAgIGtleSA9IGhhc2gocHJvcCkKICAgICAgICBmb250X3ZhbHVlID0gc2VsZi5mb250ZC5nZXQoa2V5KQogICAgICAgIGlmIGZvbnRfdmFsdWUgaXMgTm9uZToKICAgICAgICAgICAgZm5hbWUgPSBmaW5kZm9udChwcm9wKQogICAgICAgICAgICBmb250X3ZhbHVlID0gc2VsZi5mb250ZC5nZXQoZm5hbWUpCiAgICAgICAgICAgIGlmIGZvbnRfdmFsdWUgaXMgTm9uZToKICAgICAgICAgICAgICAgIGZvbnQgPSBGVDJGb250KHN0cihmbmFtZSkpCiAgICAgICAgICAgICAgICBmb250X2ZpbGVfbmFtZSA9IGZuYW1lW2ZuYW1lLnJmaW5kKCIvIikgKyAxIDpdCiAgICAgICAgICAgICAgICBmb250X3ZhbHVlID0gZm9udCwgZm9udF9maWxlX25hbWUKICAgICAgICAgICAgICAgIHNlbGYuZm9udGRbZm5hbWVdID0gZm9udF92YWx1ZQogICAgICAgICAgICBzZWxmLmZvbnRkW2tleV0gPSBmb250X3ZhbHVlCiAgICAgICAgZm9udCwgZm9udF9maWxlX25hbWUgPSBmb250X3ZhbHVlCiAgICAgICAgZm9udC5jbGVhcigpCiAgICAgICAgZm9udC5zZXRfc2l6ZShwcm9wLmdldF9zaXplX2luX3BvaW50cygpLCBzZWxmLmRwaSkKICAgICAgICByZXR1cm4gZm9udCwgZm9udF9maWxlX25hbWUKCiAgICBkZWYgZ2V0X3RleHRfd2lkdGhfaGVpZ2h0X2Rlc2NlbnQoc2VsZiwgcywgcHJvcCwgaXNtYXRoKToKICAgICAgICB3OiBmbG9hdAogICAgICAgIGg6IGZsb2F0CiAgICAgICAgaWYgaXNtYXRoOgogICAgICAgICAgICBpbWFnZSwgZCA9IHNlbGYubWF0aHRleHRfcGFyc2VyLnBhcnNlKHMsIHNlbGYuZHBpLCBwcm9wKQogICAgICAgICAgICBpbWFnZV9hcnIgPSBucC5hc2FycmF5KGltYWdlKQogICAgICAgICAgICBoLCB3ID0gaW1hZ2VfYXJyLnNoYXBlCiAgICAgICAgZWxzZToKICAgICAgICAgICAgZm9udCwgXyA9IHNlbGYuX2dldF9mb250KHByb3ApCiAgICAgICAgICAgIGZvbnQuc2V0X3RleHQocywgMC4wLCBmbGFncz1MT0FEX05PX0hJTlRJTkcpCiAgICAgICAgICAgIHcsIGggPSBmb250LmdldF93aWR0aF9oZWlnaHQoKQogICAgICAgICAgICB3IC89IDY0LjAKICAgICAgICAgICAgaCAvPSA2NC4wCiAgICAgICAgICAgIGQgPSBmb250LmdldF9kZXNjZW50KCkgLyA2NC4wCiAgICAgICAgcmV0dXJuIHcsIGgsIGQKCiAgICBkZWYgX2RyYXdfbWF0aF90ZXh0KHNlbGYsIGdjLCB4LCB5LCBzLCBwcm9wLCBhbmdsZSk6CiAgICAgICAgcmdiYSwgZGVzY2VudCA9IHNlbGYubWF0aHRleHRfcGFyc2VyLnRvX3JnYmEoCiAgICAgICAgICAgIHMsIGdjLmdldF9yZ2IoKSwgc2VsZi5kcGksIHByb3AuZ2V0X3NpemVfaW5fcG9pbnRzKCkKICAgICAgICApCiAgICAgICAgaGVpZ2h0LCB3aWR0aCwgXyA9IHJnYmEuc2hhcGUKICAgICAgICBhbmdsZSA9IG1hdGgucmFkaWFucyhhbmdsZSkKICAgICAgICBpZiBhbmdsZSAhPSAwOgogICAgICAgICAgICBzZWxmLmN0eC5zYXZlKCkKICAgICAgICAgICAgc2VsZi5jdHgudHJhbnNsYXRlKHgsIHkpCiAgICAgICAgICAgIHNlbGYuY3R4LnJvdGF0ZSgtYW5nbGUpCiAgICAgICAgICAgIHNlbGYuY3R4LnRyYW5zbGF0ZSgteCwgLXkpCiAgICAgICAgc2VsZi5kcmF3X2ltYWdlKGdjLCB4LCAteSAtIGRlc2NlbnQsIG5wLmZsaXB1ZChyZ2JhKSkKICAgICAgICBpZiBhbmdsZSAhPSAwOgogICAgICAgICAgICBzZWxmLmN0eC5yZXN0b3JlKCkKCiAgICBkZWYgZHJhd19pbWFnZShzZWxmLCBnYywgeCwgeSwgaW0sIHRyYW5zZm9ybT1Ob25lKToKICAgICAgICBpbXBvcnQgbnVtcHkgYXMgbnAKICAgICAgICBpbSA9IG5wLmZsaXB1ZChpbSkKICAgICAgICBoLCB3LCBkID0gaW0uc2hhcGUKICAgICAgICB5ID0gc2VsZi5jdHguaGVpZ2h0IC0geSAtIGgKICAgICAgICBpbSA9IG5wLnJhdmVsKG5wLnVpbnQ4KG5wLnJlc2hhcGUoaW0sIChoICogdyAqIGQsIC0xKSkpKS50b2J5dGVzKCkKICAgICAgICBwaXhlbHNfcHJveHkgPSBjcmVhdGVfcHJveHkoaW0pCiAgICAgICAgcGl4ZWxzX2J1ZiA9IHBpeGVsc19wcm94eS5nZXRCdWZmZXIoInU4Y2xhbXBlZCIpCiAgICAgICAgaW1nX2RhdGEgPSBJbWFnZURhdGEubmV3KHBpeGVsc19idWYuZGF0YSwgdywgaCkKICAgICAgICBzZWxmLmN0eC5zYXZlKCkKICAgICAgICBpbl9tZW1vcnlfY2FudmFzID0gT2Zmc2NyZWVuQ2FudmFzLm5ldyh3LCBoKQogICAgICAgIGluX21lbW9yeV9jYW52YXNfY29udGV4dCA9IGluX21lbW9yeV9jYW52YXMuZ2V0Q29udGV4dCgiMmQiKQogICAgICAgIGluX21lbW9yeV9jYW52YXNfY29udGV4dC5wdXRJbWFnZURhdGEoaW1nX2RhdGEsIDAsIDApCiAgICAgICAgc2VsZi5jdHguZHJhd0ltYWdlKGluX21lbW9yeV9jYW52YXMsIHgsIHksIHcsIGgpCiAgICAgICAgc2VsZi5jdHgucmVzdG9yZSgpCiAgICAgICAgcGl4ZWxzX3Byb3h5LmRlc3Ryb3koKQogICAgICAgIHBpeGVsc19idWYucmVsZWFzZSgpCgogICAgZGVmIGRyYXdfdGV4dChzZWxmLCBnYywgeCwgeSwgcywgcHJvcCwgYW5nbGUsIGlzbWF0aD1GYWxzZSwgbXRleHQ9Tm9uZSk6CiAgICAgICAgaWYgaXNtYXRoOgogICAgICAgICAgICBzZWxmLl9kcmF3X21hdGhfdGV4dChnYywgeCwgeSwgcywgcHJvcCwgYW5nbGUpCiAgICAgICAgICAgIHJldHVybgoKICAgICAgICBhbmdsZSA9IG1hdGgucmFkaWFucyhhbmdsZSkKICAgICAgICB3aWR0aCwgaGVpZ2h0LCBkZXNjZW50ID0gc2VsZi5nZXRfdGV4dF93aWR0aF9oZWlnaHRfZGVzY2VudChzLCBwcm9wLCBpc21hdGgpCiAgICAgICAgeCAtPSBtYXRoLnNpbihhbmdsZSkgKiBkZXNjZW50CiAgICAgICAgeSAtPSBtYXRoLmNvcyhhbmdsZSkgKiBkZXNjZW50IC0gc2VsZi5jdHguaGVpZ2h0CiAgICAgICAgZm9udF9zaXplID0gc2VsZi5wb2ludHNfdG9fcGl4ZWxzKHByb3AuZ2V0X3NpemVfaW5fcG9pbnRzKCkpCgogICAgICAgIGZvbnRfcHJvcGVydHlfc3RyaW5nID0gInt9IHt9IHs6LjNnfXB4IHt9LCB7fSIuZm9ybWF0KAogICAgICAgICAgICBwcm9wLmdldF9zdHlsZSgpLAogICAgICAgICAgICBwcm9wLmdldF93ZWlnaHQoKSwKICAgICAgICAgICAgZm9udF9zaXplLAogICAgICAgICAgICBwcm9wLmdldF9uYW1lKCksCiAgICAgICAgICAgIHByb3AuZ2V0X2ZhbWlseSgpWzBdLAogICAgICAgICkKICAgICAgICBpZiBhbmdsZSAhPSAwOgogICAgICAgICAgICBzZWxmLmN0eC5zYXZlKCkKICAgICAgICAgICAgc2VsZi5jdHgudHJhbnNsYXRlKHgsIHkpCiAgICAgICAgICAgIHNlbGYuY3R4LnJvdGF0ZSgtYW5nbGUpCiAgICAgICAgICAgIHNlbGYuY3R4LnRyYW5zbGF0ZSgteCwgLXkpCiAgICAgICAgc2VsZi5jdHguZm9udCA9IGZvbnRfcHJvcGVydHlfc3RyaW5nCiAgICAgICAgc2VsZi5jdHguZmlsbFN0eWxlID0gc2VsZi5fbWF0cGxvdGxpYl9jb2xvcl90b19DU1MoCiAgICAgICAgICAgIGdjLmdldF9yZ2IoKSwgZ2MuZ2V0X2FscGhhKCksIGdjLmdldF9mb3JjZWRfYWxwaGEoKQogICAgICAgICkKICAgICAgICBzZWxmLmN0eC5maWxsVGV4dChzLCB4LCB5KQogICAgICAgIHNlbGYuY3R4LmZpbGxTdHlsZSA9ICIjMDAwMDAwIgogICAgICAgIGlmIGFuZ2xlICE9IDA6CiAgICAgICAgICAgIHNlbGYuY3R4LnJlc3RvcmUoKQoKY2xhc3MgRmlndXJlTWFuYWdlckhUTUxDYW52YXMoRmlndXJlTWFuYWdlckJhc2UpOgogICAgZGVmIF9faW5pdF9fKHNlbGYsIGNhbnZhcywgbnVtKToKICAgICAgICBzdXBlcigpLl9faW5pdF9fKGNhbnZhcywgbnVtKQogICAgICAgIHNlbGYuc2V0X3dpbmRvd190aXRsZSgiRmlndXJlICVkIiAlIG51bSkKCiAgICBkZWYgc2hvdyhzZWxmLCAqYXJncywgKiprd2FyZ3MpOgogICAgICAgIHNlbGYuY2FudmFzLnNob3coKmFyZ3MsICoqa3dhcmdzKQoKICAgIGRlZiBkZXN0cm95KHNlbGYsICphcmdzLCAqKmt3YXJncyk6CiAgICAgICAgc2VsZi5jYW52YXMuZGVzdHJveSgqYXJncywgKiprd2FyZ3MpCgogICAgZGVmIHJlc2l6ZShzZWxmLCB3LCBoKToKICAgICAgICBwYXNzCgogICAgZGVmIHNldF93aW5kb3dfdGl0bGUoc2VsZiwgdGl0bGUpOgogICAgICAgIHNlbGYuY2FudmFzLnNldF93aW5kb3dfdGl0bGUodGl0bGUpCgoKQF9CYWNrZW5kLmV4cG9ydApjbGFzcyBfQmFja2VuZFdhc21Db3JlQWdnKF9CYWNrZW5kKToKICAgIEZpZ3VyZUNhbnZhcyA9IEZpZ3VyZUNhbnZhc1dvcmtlcgogICAgRmlndXJlTWFuYWdlciA9IEZpZ3VyZU1hbmFnZXJIVE1MQ2FudmFzCgogICAgQHN0YXRpY21ldGhvZAogICAgZGVmIHNob3coKmFyZ3MsICoqa3dhcmdzKToKICAgICAgICBmcm9tIG1hdHBsb3RsaWIgaW1wb3J0IHB5cGxvdCBhcyBwbHQKICAgICAgICBwbHQuZ2NmKCkuY2FudmFzLnNob3coKmFyZ3MsICoqa3dhcmdzKQoKICAgIEBzdGF0aWNtZXRob2QKICAgIGRlZiBkZXN0cm95KCphcmdzLCAqKmt3YXJncyk6CiAgICAgICAgZnJvbSBtYXRwbG90bGliIGltcG9ydCBweXBsb3QgYXMgcGx0CiAgICAgICAgcGx0LmdjZigpLmNhbnZhcy5kZXN0cm95KCphcmdzLCAqKmt3YXJncykK"});var Ka={};xO(Ka,{ChannelType:()=>Qt,Console:()=>M0,Shelter:()=>Ba,WebR:()=>Uf,WebRChannelError:()=>pt,WebRError:()=>di,WebRPayloadError:()=>Bn,WebRWorkerError:()=>wf,isRCall:()=>gs,isRCharacter:()=>Ui,isRComplex:()=>R0,isRDouble:()=>C0,isREnvironment:()=>S0,isRFunction:()=>Os,isRInteger:()=>P0,isRList:()=>ot,isRLogical:()=>T0,isRNull:()=>Re,isRObject:()=>ee,isRPairlist:()=>k0,isRRaw:()=>Ja,isRSymbol:()=>x0});var kO=Object.create,pf=Object.defineProperty,SO=Object.getOwnPropertyDescriptor,TO=Object.getOwnPropertyNames,PO=Object.getPrototypeOf,CO=Object.prototype.hasOwnProperty,Bi=(i=>typeof ci<"u"?ci:typeof Proxy<"u"?new Proxy(i,{get:(e,t)=>(typeof ci<"u"?ci:e)[t]}):i)(function(i){if(typeof ci<"u")return ci.apply(this,arguments);throw new Error('Dynamic require of "'+i+'" is not supported')}),ke=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),RO=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of TO(e))!CO.call(i,r)&&r!==t&&pf(i,r,{get:()=>e[r],enumerable:!(n=SO(e,r))||n.enumerable});return i},Xi=(i,e,t)=>(t=i!=null?kO(PO(i)):{},RO(e||!i||!i.__esModule?pf(t,"default",{value:i,enumerable:!0}):t,i)),Xa=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},k=(i,e,t)=>(Xa(i,e,"read from private field"),t?t.call(i):e.get(i)),L=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},me=(i,e,t,n)=>(Xa(i,e,"write to private field"),n?n.call(i,t):e.set(i,t),t);var Je=(i,e,t)=>(Xa(i,e,"access private method"),t),cs=ke(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.getUint64=i.getInt64=i.setInt64=i.setUint64=i.UINT32_MAX=void 0,i.UINT32_MAX=4294967295;function e(s,o,a){let l=a/4294967296,h=a;s.setUint32(o,l),s.setUint32(o+4,h)}i.setUint64=e;function t(s,o,a){let l=Math.floor(a/4294967296),h=a;s.setUint32(o,l),s.setUint32(o+4,h)}i.setInt64=t;function n(s,o){let a=s.getInt32(o),l=s.getUint32(o+4);return a*4294967296+l}i.getInt64=n;function r(s,o){let a=s.getUint32(o),l=s.getUint32(o+4);return a*4294967296+l}i.getUint64=r}),Wa=ke(i=>{"use strict";var e,t,n;Object.defineProperty(i,"__esModule",{value:!0}),i.utf8DecodeTD=i.TEXT_DECODER_THRESHOLD=i.utf8DecodeJs=i.utf8EncodeTE=i.TEXT_ENCODER_THRESHOLD=i.utf8EncodeJs=i.utf8Count=void 0;var r=cs(),s=(typeof process>"u"||((e=process==null?void 0:process.env)===null||e===void 0?void 0:e.TEXT_ENCODING)!=="never")&&typeof TextEncoder<"u"&&typeof TextDecoder<"u";function o(p){let g=p.length,O=0,y=0;for(;y=55296&&v<=56319&&y>6&31|192;else{if(w>=55296&&w<=56319&&x>18&7|240,g[v++]=w>>12&63|128,g[v++]=w>>6&63|128):(g[v++]=w>>12&15|224,g[v++]=w>>6&63|128)}else{g[v++]=w;continue}g[v++]=w&63|128}}i.utf8EncodeJs=a;var l=s?new TextEncoder:void 0;i.TEXT_ENCODER_THRESHOLD=s?typeof process<"u"&&((t=process==null?void 0:process.env)===null||t===void 0?void 0:t.TEXT_ENCODING)!=="force"?200:0:r.UINT32_MAX;function h(p,g,O){g.set(l.encode(p),O)}function c(p,g,O){l.encodeInto(p,g.subarray(O))}i.utf8EncodeTE=l!=null&&l.encodeInto?c:h;var f=4096;function u(p,g,O){let y=g,v=y+O,x=[],w="";for(;y65535&&(V-=65536,x.push(V>>>10&1023|55296),V=56320|V&1023),x.push(V)}else x.push(P);x.length>=f&&(w+=String.fromCharCode(...x),x.length=0)}return x.length>0&&(w+=String.fromCharCode(...x)),w}i.utf8DecodeJs=u;var d=s?new TextDecoder:null;i.TEXT_DECODER_THRESHOLD=s?typeof process<"u"&&((n=process==null?void 0:process.env)===null||n===void 0?void 0:n.TEXT_DECODER)!=="force"?200:0:r.UINT32_MAX;function m(p,g,O){let y=p.subarray(g,g+O);return d.decode(y)}i.utf8DecodeTD=m}),mf=ke(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.ExtData=void 0;var e=class{constructor(t,n){this.type=t,this.data=n}};i.ExtData=e}),Ia=ke(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.DecodeError=void 0;var e=class extends Error{constructor(t){super(t);let n=Object.create(e.prototype);Object.setPrototypeOf(this,n),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:e.name})}};i.DecodeError=e}),gf=ke(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.timestampExtension=i.decodeTimestampExtension=i.decodeTimestampToTimeSpec=i.encodeTimestampExtension=i.encodeDateToTimeSpec=i.encodeTimeSpecToTimestamp=i.EXT_TIMESTAMP=void 0;var e=Ia(),t=cs();i.EXT_TIMESTAMP=-1;var n=4294967296-1,r=17179869184-1;function s({sec:c,nsec:f}){if(c>=0&&f>=0&&c<=r)if(f===0&&c<=n){let u=new Uint8Array(4);return new DataView(u.buffer).setUint32(0,c),u}else{let u=c/4294967296,d=c&4294967295,m=new Uint8Array(8),p=new DataView(m.buffer);return p.setUint32(0,f<<2|u&3),p.setUint32(4,d),m}else{let u=new Uint8Array(12),d=new DataView(u.buffer);return d.setUint32(0,f),(0,t.setInt64)(d,4,c),u}}i.encodeTimeSpecToTimestamp=s;function o(c){let f=c.getTime(),u=Math.floor(f/1e3),d=(f-u*1e3)*1e6,m=Math.floor(d/1e9);return{sec:u+m,nsec:d-m*1e9}}i.encodeDateToTimeSpec=o;function a(c){if(c instanceof Date){let f=o(c);return s(f)}else return null}i.encodeTimestampExtension=a;function l(c){let f=new DataView(c.buffer,c.byteOffset,c.byteLength);switch(c.byteLength){case 4:return{sec:f.getUint32(0),nsec:0};case 8:{let u=f.getUint32(0),d=f.getUint32(4),m=(u&3)*4294967296+d,p=u>>>2;return{sec:m,nsec:p}}case 12:{let u=(0,t.getInt64)(f,4),d=f.getUint32(0);return{sec:u,nsec:d}}default:throw new e.DecodeError(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${c.length}`)}}i.decodeTimestampToTimeSpec=l;function h(c){let f=l(c);return new Date(f.sec*1e3+f.nsec/1e6)}i.decodeTimestampExtension=h,i.timestampExtension={type:i.EXT_TIMESTAMP,encode:a,decode:h}}),Na=ke(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.ExtensionCodec=void 0;var e=mf(),t=gf(),n=class{constructor(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(t.timestampExtension)}register({type:r,encode:s,decode:o}){if(r>=0)this.encoders[r]=s,this.decoders[r]=o;else{let a=1+r;this.builtInEncoders[a]=s,this.builtInDecoders[a]=o}}tryToEncode(r,s){for(let o=0;o{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.createDataView=i.ensureUint8Array=void 0;function e(n){return n instanceof Uint8Array?n:ArrayBuffer.isView(n)?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):n instanceof ArrayBuffer?new Uint8Array(n):Uint8Array.from(n)}i.ensureUint8Array=e;function t(n){if(n instanceof ArrayBuffer)return new DataView(n);let r=e(n);return new DataView(r.buffer,r.byteOffset,r.byteLength)}i.createDataView=t}),yf=ke(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.Encoder=i.DEFAULT_INITIAL_BUFFER_SIZE=i.DEFAULT_MAX_DEPTH=void 0;var e=Wa(),t=Na(),n=cs(),r=Of();i.DEFAULT_MAX_DEPTH=100,i.DEFAULT_INITIAL_BUFFER_SIZE=2048;var s=class{constructor(o=t.ExtensionCodec.defaultCodec,a=void 0,l=i.DEFAULT_MAX_DEPTH,h=i.DEFAULT_INITIAL_BUFFER_SIZE,c=!1,f=!1,u=!1,d=!1){this.extensionCodec=o,this.context=a,this.maxDepth=l,this.initialBufferSize=h,this.sortKeys=c,this.forceFloat32=f,this.ignoreUndefined=u,this.forceIntegerToFloat=d,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}reinitializeState(){this.pos=0}encodeSharedRef(o){return this.reinitializeState(),this.doEncode(o,1),this.bytes.subarray(0,this.pos)}encode(o){return this.reinitializeState(),this.doEncode(o,1),this.bytes.slice(0,this.pos)}doEncode(o,a){if(a>this.maxDepth)throw new Error(`Too deep objects in depth ${a}`);o==null?this.encodeNil():typeof o=="boolean"?this.encodeBoolean(o):typeof o=="number"?this.encodeNumber(o):typeof o=="string"?this.encodeString(o):this.encodeObject(o,a)}ensureBufferSizeToWrite(o){let a=this.pos+o;this.view.byteLength=0?o<128?this.writeU8(o):o<256?(this.writeU8(204),this.writeU8(o)):o<65536?(this.writeU8(205),this.writeU16(o)):o<4294967296?(this.writeU8(206),this.writeU32(o)):(this.writeU8(207),this.writeU64(o)):o>=-32?this.writeU8(224|o+32):o>=-128?(this.writeU8(208),this.writeI8(o)):o>=-32768?(this.writeU8(209),this.writeI16(o)):o>=-2147483648?(this.writeU8(210),this.writeI32(o)):(this.writeU8(211),this.writeI64(o)):this.forceFloat32?(this.writeU8(202),this.writeF32(o)):(this.writeU8(203),this.writeF64(o))}writeStringHeader(o){if(o<32)this.writeU8(160+o);else if(o<256)this.writeU8(217),this.writeU8(o);else if(o<65536)this.writeU8(218),this.writeU16(o);else if(o<4294967296)this.writeU8(219),this.writeU32(o);else throw new Error(`Too long string: ${o} bytes in UTF-8`)}encodeString(o){if(o.length>e.TEXT_ENCODER_THRESHOLD){let a=(0,e.utf8Count)(o);this.ensureBufferSizeToWrite(5+a),this.writeStringHeader(a),(0,e.utf8EncodeTE)(o,this.bytes,this.pos),this.pos+=a}else{let a=(0,e.utf8Count)(o);this.ensureBufferSizeToWrite(5+a),this.writeStringHeader(a),(0,e.utf8EncodeJs)(o,this.bytes,this.pos),this.pos+=a}}encodeObject(o,a){let l=this.extensionCodec.tryToEncode(o,this.context);if(l!=null)this.encodeExtension(l);else if(Array.isArray(o))this.encodeArray(o,a);else if(ArrayBuffer.isView(o))this.encodeBinary(o);else if(typeof o=="object")this.encodeMap(o,a);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(o)}`)}encodeBinary(o){let a=o.byteLength;if(a<256)this.writeU8(196),this.writeU8(a);else if(a<65536)this.writeU8(197),this.writeU16(a);else if(a<4294967296)this.writeU8(198),this.writeU32(a);else throw new Error(`Too large binary: ${a}`);let l=(0,r.ensureUint8Array)(o);this.writeU8a(l)}encodeArray(o,a){let l=o.length;if(l<16)this.writeU8(144+l);else if(l<65536)this.writeU8(220),this.writeU16(l);else if(l<4294967296)this.writeU8(221),this.writeU32(l);else throw new Error(`Too large array: ${l}`);for(let h of o)this.doEncode(h,a+1)}countWithoutUndefined(o,a){let l=0;for(let h of a)o[h]!==void 0&&l++;return l}encodeMap(o,a){let l=Object.keys(o);this.sortKeys&&l.sort();let h=this.ignoreUndefined?this.countWithoutUndefined(o,l):l.length;if(h<16)this.writeU8(128+h);else if(h<65536)this.writeU8(222),this.writeU16(h);else if(h<4294967296)this.writeU8(223),this.writeU32(h);else throw new Error(`Too large map object: ${h}`);for(let c of l){let f=o[c];this.ignoreUndefined&&f===void 0||(this.encodeString(c),this.doEncode(f,a+1))}}encodeExtension(o){let a=o.data.length;if(a===1)this.writeU8(212);else if(a===2)this.writeU8(213);else if(a===4)this.writeU8(214);else if(a===8)this.writeU8(215);else if(a===16)this.writeU8(216);else if(a<256)this.writeU8(199),this.writeU8(a);else if(a<65536)this.writeU8(200),this.writeU16(a);else if(a<4294967296)this.writeU8(201),this.writeU32(a);else throw new Error(`Too large extension object: ${a}`);this.writeI8(o.type),this.writeU8a(o.data)}writeU8(o){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,o),this.pos++}writeU8a(o){let a=o.length;this.ensureBufferSizeToWrite(a),this.bytes.set(o,this.pos),this.pos+=a}writeI8(o){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,o),this.pos++}writeU16(o){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,o),this.pos+=2}writeI16(o){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,o),this.pos+=2}writeU32(o){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,o),this.pos+=4}writeI32(o){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,o),this.pos+=4}writeF32(o){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,o),this.pos+=4}writeF64(o){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,o),this.pos+=8}writeU64(o){this.ensureBufferSizeToWrite(8),(0,n.setUint64)(this.view,this.pos,o),this.pos+=8}writeI64(o){this.ensureBufferSizeToWrite(8),(0,n.setInt64)(this.view,this.pos,o),this.pos+=8}};i.Encoder=s}),EO=ke(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.encode=void 0;var e=yf(),t={};function n(r,s=t){return new e.Encoder(s.extensionCodec,s.context,s.maxDepth,s.initialBufferSize,s.sortKeys,s.forceFloat32,s.ignoreUndefined,s.forceIntegerToFloat).encodeSharedRef(r)}i.encode=n}),AO=ke(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.prettyByte=void 0;function e(t){return`${t<0?"-":""}0x${Math.abs(t).toString(16).padStart(2,"0")}`}i.prettyByte=e}),QO=ke(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.CachedKeyDecoder=void 0;var e=Wa(),t=16,n=16,r=class{constructor(s=t,o=n){this.maxKeyLength=s,this.maxLengthPerKey=o,this.hit=0,this.miss=0,this.caches=[];for(let a=0;a0&&s<=this.maxKeyLength}find(s,o,a){let l=this.caches[a-1];e:for(let h of l){let c=h.bytes;for(let f=0;f=this.maxLengthPerKey?a[Math.random()*a.length|0]=l:a.push(l)}decode(s,o,a){let l=this.find(s,o,a);if(l!=null)return this.hit++,l;this.miss++;let h=(0,e.utf8DecodeJs)(s,o,a),c=Uint8Array.prototype.slice.call(s,o,o+a);return this.store(c,h),h}};i.CachedKeyDecoder=r}),ja=ke(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.Decoder=i.DataViewIndexOutOfBoundsError=void 0;var e=AO(),t=Na(),n=cs(),r=Wa(),s=Of(),o=QO(),a=Ia(),l=p=>{let g=typeof p;return g==="string"||g==="number"},h=-1,c=new DataView(new ArrayBuffer(0)),f=new Uint8Array(c.buffer);i.DataViewIndexOutOfBoundsError=(()=>{try{c.getInt8(0)}catch(p){return p.constructor}throw new Error("never reached")})();var u=new i.DataViewIndexOutOfBoundsError("Insufficient data"),d=new o.CachedKeyDecoder,m=class{constructor(p=t.ExtensionCodec.defaultCodec,g=void 0,O=n.UINT32_MAX,y=n.UINT32_MAX,v=n.UINT32_MAX,x=n.UINT32_MAX,w=n.UINT32_MAX,P=d){this.extensionCodec=p,this.context=g,this.maxStrLength=O,this.maxBinLength=y,this.maxArrayLength=v,this.maxMapLength=x,this.maxExtLength=w,this.keyDecoder=P,this.totalPos=0,this.pos=0,this.view=c,this.bytes=f,this.headByte=h,this.stack=[]}reinitializeState(){this.totalPos=0,this.headByte=h,this.stack.length=0}setBuffer(p){this.bytes=(0,s.ensureUint8Array)(p),this.view=(0,s.createDataView)(this.bytes),this.pos=0}appendBuffer(p){if(this.headByte===h&&!this.hasRemaining(1))this.setBuffer(p);else{let g=this.bytes.subarray(this.pos),O=(0,s.ensureUint8Array)(p),y=new Uint8Array(g.length+O.length);y.set(g),y.set(O,g.length),this.setBuffer(y)}}hasRemaining(p){return this.view.byteLength-this.pos>=p}createExtraByteError(p){let{view:g,pos:O}=this;return new RangeError(`Extra ${g.byteLength-O} of ${g.byteLength} byte(s) found at buffer[${p}]`)}decode(p){this.reinitializeState(),this.setBuffer(p);let g=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return g}*decodeMulti(p){for(this.reinitializeState(),this.setBuffer(p);this.hasRemaining(1);)yield this.doDecodeSync()}async decodeAsync(p){let g=!1,O;for await(let w of p){if(g)throw this.createExtraByteError(this.totalPos);this.appendBuffer(w);try{O=this.doDecodeSync(),g=!0}catch(P){if(!(P instanceof i.DataViewIndexOutOfBoundsError))throw P}this.totalPos+=this.pos}if(g){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return O}let{headByte:y,pos:v,totalPos:x}=this;throw new RangeError(`Insufficient data in parsing ${(0,e.prettyByte)(y)} at ${x} (${v} in the current buffer)`)}decodeArrayStream(p){return this.decodeMultiAsync(p,!0)}decodeStream(p){return this.decodeMultiAsync(p,!1)}async*decodeMultiAsync(p,g){let O=g,y=-1;for await(let v of p){if(g&&y===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(v),O&&(y=this.readArraySize(),O=!1,this.complete());try{for(;yield this.doDecodeSync(),--y!==0;);}catch(x){if(!(x instanceof i.DataViewIndexOutOfBoundsError))throw x}this.totalPos+=this.pos}}doDecodeSync(){e:for(;;){let p=this.readHeadByte(),g;if(p>=224)g=p-256;else if(p<192)if(p<128)g=p;else if(p<144){let y=p-128;if(y!==0){this.pushMapState(y),this.complete();continue e}else g={}}else if(p<160){let y=p-144;if(y!==0){this.pushArrayState(y),this.complete();continue e}else g=[]}else{let y=p-160;g=this.decodeUtf8String(y,0)}else if(p===192)g=null;else if(p===194)g=!1;else if(p===195)g=!0;else if(p===202)g=this.readF32();else if(p===203)g=this.readF64();else if(p===204)g=this.readU8();else if(p===205)g=this.readU16();else if(p===206)g=this.readU32();else if(p===207)g=this.readU64();else if(p===208)g=this.readI8();else if(p===209)g=this.readI16();else if(p===210)g=this.readI32();else if(p===211)g=this.readI64();else if(p===217){let y=this.lookU8();g=this.decodeUtf8String(y,1)}else if(p===218){let y=this.lookU16();g=this.decodeUtf8String(y,2)}else if(p===219){let y=this.lookU32();g=this.decodeUtf8String(y,4)}else if(p===220){let y=this.readU16();if(y!==0){this.pushArrayState(y),this.complete();continue e}else g=[]}else if(p===221){let y=this.readU32();if(y!==0){this.pushArrayState(y),this.complete();continue e}else g=[]}else if(p===222){let y=this.readU16();if(y!==0){this.pushMapState(y),this.complete();continue e}else g={}}else if(p===223){let y=this.readU32();if(y!==0){this.pushMapState(y),this.complete();continue e}else g={}}else if(p===196){let y=this.lookU8();g=this.decodeBinary(y,1)}else if(p===197){let y=this.lookU16();g=this.decodeBinary(y,2)}else if(p===198){let y=this.lookU32();g=this.decodeBinary(y,4)}else if(p===212)g=this.decodeExtension(1,0);else if(p===213)g=this.decodeExtension(2,0);else if(p===214)g=this.decodeExtension(4,0);else if(p===215)g=this.decodeExtension(8,0);else if(p===216)g=this.decodeExtension(16,0);else if(p===199){let y=this.lookU8();g=this.decodeExtension(y,1)}else if(p===200){let y=this.lookU16();g=this.decodeExtension(y,2)}else if(p===201){let y=this.lookU32();g=this.decodeExtension(y,4)}else throw new a.DecodeError(`Unrecognized type byte: ${(0,e.prettyByte)(p)}`);this.complete();let O=this.stack;for(;O.length>0;){let y=O[O.length-1];if(y.type===0)if(y.array[y.position]=g,y.position++,y.position===y.size)O.pop(),g=y.array;else continue e;else if(y.type===1){if(!l(g))throw new a.DecodeError("The type of key must be string or number but "+typeof g);if(g==="__proto__")throw new a.DecodeError("The key __proto__ is not allowed");y.key=g,y.type=2;continue e}else if(y.map[y.key]=g,y.readCount++,y.readCount===y.size)O.pop(),g=y.map;else{y.key=null,y.type=1;continue e}}return g}}readHeadByte(){return this.headByte===h&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=h}readArraySize(){let p=this.readHeadByte();switch(p){case 220:return this.readU16();case 221:return this.readU32();default:{if(p<160)return p-144;throw new a.DecodeError(`Unrecognized array type byte: ${(0,e.prettyByte)(p)}`)}}}pushMapState(p){if(p>this.maxMapLength)throw new a.DecodeError(`Max length exceeded: map length (${p}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.push({type:1,size:p,key:null,readCount:0,map:{}})}pushArrayState(p){if(p>this.maxArrayLength)throw new a.DecodeError(`Max length exceeded: array length (${p}) > maxArrayLength (${this.maxArrayLength})`);this.stack.push({type:0,size:p,array:new Array(p),position:0})}decodeUtf8String(p,g){var O;if(p>this.maxStrLength)throw new a.DecodeError(`Max length exceeded: UTF-8 byte length (${p}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLengthr.TEXT_DECODER_THRESHOLD?v=(0,r.utf8DecodeTD)(this.bytes,y,p):v=(0,r.utf8DecodeJs)(this.bytes,y,p),this.pos+=g+p,v}stateIsMapKey(){return this.stack.length>0?this.stack[this.stack.length-1].type===1:!1}decodeBinary(p,g){if(p>this.maxBinLength)throw new a.DecodeError(`Max length exceeded: bin length (${p}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(p+g))throw u;let O=this.pos+g,y=this.bytes.subarray(O,O+p);return this.pos+=g+p,y}decodeExtension(p,g){if(p>this.maxExtLength)throw new a.DecodeError(`Max length exceeded: ext length (${p}) > maxExtLength (${this.maxExtLength})`);let O=this.view.getInt8(this.pos+g),y=this.decodeBinary(p,g+1);return this.extensionCodec.decode(y,O,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){let p=this.view.getUint8(this.pos);return this.pos++,p}readI8(){let p=this.view.getInt8(this.pos);return this.pos++,p}readU16(){let p=this.view.getUint16(this.pos);return this.pos+=2,p}readI16(){let p=this.view.getInt16(this.pos);return this.pos+=2,p}readU32(){let p=this.view.getUint32(this.pos);return this.pos+=4,p}readI32(){let p=this.view.getInt32(this.pos);return this.pos+=4,p}readU64(){let p=(0,n.getUint64)(this.view,this.pos);return this.pos+=8,p}readI64(){let p=(0,n.getInt64)(this.view,this.pos);return this.pos+=8,p}readF32(){let p=this.view.getFloat32(this.pos);return this.pos+=4,p}readF64(){let p=this.view.getFloat64(this.pos);return this.pos+=8,p}};i.Decoder=m}),bf=ke(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.decodeMulti=i.decode=i.defaultDecodeOptions=void 0;var e=ja();i.defaultDecodeOptions={};function t(r,s=i.defaultDecodeOptions){return new e.Decoder(s.extensionCodec,s.context,s.maxStrLength,s.maxBinLength,s.maxArrayLength,s.maxMapLength,s.maxExtLength).decode(r)}i.decode=t;function n(r,s=i.defaultDecodeOptions){return new e.Decoder(s.extensionCodec,s.context,s.maxStrLength,s.maxBinLength,s.maxArrayLength,s.maxMapLength,s.maxExtLength).decodeMulti(r)}i.decodeMulti=n}),MO=ke(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.ensureAsyncIterable=i.asyncIterableFromStream=i.isAsyncIterable=void 0;function e(s){return s[Symbol.asyncIterator]!=null}i.isAsyncIterable=e;function t(s){if(s==null)throw new Error("Assertion Failure: value must not be null nor undefined")}async function*n(s){let o=s.getReader();try{for(;;){let{done:a,value:l}=await o.read();if(a)return;t(l),yield l}}finally{o.releaseLock()}}i.asyncIterableFromStream=n;function r(s){return e(s)?s:n(s)}i.ensureAsyncIterable=r}),_O=ke(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.decodeStream=i.decodeMultiStream=i.decodeArrayStream=i.decodeAsync=void 0;var e=ja(),t=MO(),n=bf();async function r(l,h=n.defaultDecodeOptions){let c=(0,t.ensureAsyncIterable)(l);return new e.Decoder(h.extensionCodec,h.context,h.maxStrLength,h.maxBinLength,h.maxArrayLength,h.maxMapLength,h.maxExtLength).decodeAsync(c)}i.decodeAsync=r;function s(l,h=n.defaultDecodeOptions){let c=(0,t.ensureAsyncIterable)(l);return new e.Decoder(h.extensionCodec,h.context,h.maxStrLength,h.maxBinLength,h.maxArrayLength,h.maxMapLength,h.maxExtLength).decodeArrayStream(c)}i.decodeArrayStream=s;function o(l,h=n.defaultDecodeOptions){let c=(0,t.ensureAsyncIterable)(l);return new e.Decoder(h.extensionCodec,h.context,h.maxStrLength,h.maxBinLength,h.maxArrayLength,h.maxMapLength,h.maxExtLength).decodeStream(c)}i.decodeMultiStream=o;function a(l,h=n.defaultDecodeOptions){return o(l,h)}i.decodeStream=a}),za=ke(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.decodeTimestampExtension=i.encodeTimestampExtension=i.decodeTimestampToTimeSpec=i.encodeTimeSpecToTimestamp=i.encodeDateToTimeSpec=i.EXT_TIMESTAMP=i.ExtData=i.ExtensionCodec=i.Encoder=i.DataViewIndexOutOfBoundsError=i.DecodeError=i.Decoder=i.decodeStream=i.decodeMultiStream=i.decodeArrayStream=i.decodeAsync=i.decodeMulti=i.decode=i.encode=void 0;var e=EO();Object.defineProperty(i,"encode",{enumerable:!0,get:function(){return e.encode}});var t=bf();Object.defineProperty(i,"decode",{enumerable:!0,get:function(){return t.decode}}),Object.defineProperty(i,"decodeMulti",{enumerable:!0,get:function(){return t.decodeMulti}});var n=_O();Object.defineProperty(i,"decodeAsync",{enumerable:!0,get:function(){return n.decodeAsync}}),Object.defineProperty(i,"decodeArrayStream",{enumerable:!0,get:function(){return n.decodeArrayStream}}),Object.defineProperty(i,"decodeMultiStream",{enumerable:!0,get:function(){return n.decodeMultiStream}}),Object.defineProperty(i,"decodeStream",{enumerable:!0,get:function(){return n.decodeStream}});var r=ja();Object.defineProperty(i,"Decoder",{enumerable:!0,get:function(){return r.Decoder}}),Object.defineProperty(i,"DataViewIndexOutOfBoundsError",{enumerable:!0,get:function(){return r.DataViewIndexOutOfBoundsError}});var s=Ia();Object.defineProperty(i,"DecodeError",{enumerable:!0,get:function(){return s.DecodeError}});var o=yf();Object.defineProperty(i,"Encoder",{enumerable:!0,get:function(){return o.Encoder}});var a=Na();Object.defineProperty(i,"ExtensionCodec",{enumerable:!0,get:function(){return a.ExtensionCodec}});var l=mf();Object.defineProperty(i,"ExtData",{enumerable:!0,get:function(){return l.ExtData}});var h=gf();Object.defineProperty(i,"EXT_TIMESTAMP",{enumerable:!0,get:function(){return h.EXT_TIMESTAMP}}),Object.defineProperty(i,"encodeDateToTimeSpec",{enumerable:!0,get:function(){return h.encodeDateToTimeSpec}}),Object.defineProperty(i,"encodeTimeSpecToTimestamp",{enumerable:!0,get:function(){return h.encodeTimeSpecToTimestamp}}),Object.defineProperty(i,"decodeTimestampToTimeSpec",{enumerable:!0,get:function(){return h.decodeTimestampToTimeSpec}}),Object.defineProperty(i,"encodeTimestampExtension",{enumerable:!0,get:function(){return h.encodeTimestampExtension}}),Object.defineProperty(i,"decodeTimestampExtension",{enumerable:!0,get:function(){return h.decodeTimestampExtension}})}),di=class extends Error{constructor(i){super(i),this.name=this.constructor.name,Object.setPrototypeOf(this,new.target.prototype)}},wf=class extends di{},pt=class extends di{},Bn=class extends di{},Ie=typeof process<"u"&&process.release&&process.release.name==="node",ga;if(globalThis.document)ga=i=>new Promise((e,t)=>{let n=document.createElement("script");n.src=i,n.onload=()=>e(),n.onerror=t,document.head.appendChild(n)});else if(globalThis.importScripts)ga=async i=>{try{globalThis.importScripts(i)}catch(e){if(e instanceof TypeError)await Promise.resolve().then(()=>Xi(Bi(i)));else throw e}};else if(Ie)ga=async i=>{let e=(await Promise.resolve().then(()=>Xi(Bi("path")))).default;await Promise.resolve().then(()=>Xi(Bi(e.resolve(i))))};else throw new di("Cannot determine runtime environment");var T={};function DO(i){Object.keys(i).forEach(e=>T._free(i[e]))}var mt={null:0,symbol:1,pairlist:2,closure:3,environment:4,promise:5,call:6,special:7,builtin:8,string:9,logical:10,integer:13,double:14,complex:15,character:16,dots:17,any:18,list:19,expression:20,bytecode:21,pointer:22,weakref:23,raw:24,s4:25,new:30,free:31,function:99};function vf(i){return!!i&&typeof i=="object"&&Object.keys(mt).includes(i.type)}function fs(i){return!!i&&typeof i=="object"&&"re"in i&&"im"in i}function Yr(i){return T._Rf_protect(Mt(i)),i}function ae(i,e){return T._Rf_protect(Mt(i)),++e.n,i}function $O(i){let e=T._malloc(4);return T._R_ProtectWithIndex(Mt(i),e),{loc:T.getValue(e,"i32"),ptr:e}}function VO(i){T._Rf_unprotect(1),T._free(i.ptr)}function LO(i,e){return T._R_Reprotect(Mt(i),e.loc),i}function Oe(i){T._Rf_unprotect(i)}function af(i,e,t){T._Rf_defineVar(Mt(e),Mt(t),Mt(i))}function lf(i,e){let t={},n={n:0};try{let r=new Tf(e);ae(r,n),t.code=T.allocateUTF8(i);let s=T._R_ParseEvalString(t.code,r.ptr);return z.wrap(s)}finally{DO(t),Oe(n.n)}}function us(i,e){return T.getWasmTableEntry(T.GOT.ffi_safe_eval.value)(Mt(i),Mt(e))}var qO=new WeakMap;function BO(i,e){return qO.set(i,e),i}var XO=63;function xf(){let i=Array.from({length:4},WO).join("-");if(i.length!==XO)throw new Error("comlink internal error: UUID has the wrong length");return i}function WO(){let i=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16),e=15-i.length;return e>0&&(i=Array.from({length:e},()=>0).join("")+i),i}function Mt(i){return rs(i)?i.ptr:i}function pi(i,e){if(T._TYPEOF(i.ptr)!==mt[e])throw new Error(`Unexpected object type "${i.type()}" when expecting type "${e}"`)}function kf(i){if(vf(i))return new(_f(i.type))(i);if(i&&typeof i=="object"&&"type"in i&&i.type==="null")return new Sf;if(i===null)return new Ni({type:"logical",names:null,values:[null]});if(typeof i=="boolean")return new Ni(i);if(typeof i=="number")return new ps(i);if(typeof i=="string")return new zt(i);if(fs(i))return new Fa(i);if(ArrayBuffer.isView(i)||i instanceof ArrayBuffer)return new Ha(i);if(Array.isArray(i))return IO(i);if(typeof i=="object")return Xn.fromObject(i);throw new Error("Robj construction for this JS object is not yet supported")}function IO(i){let e={n:0};if(i.every(t=>t&&typeof t=="object"&&!rs(t)&&!fs(t))){let t=i,n=t.every(s=>Object.keys(s).filter(o=>!Object.keys(t[0]).includes(o)).length===0&&Object.keys(t[0]).filter(o=>!Object.keys(s).includes(o)).length===0),r=t.every(s=>Object.values(s).every(o=>$f(o)||Df(o)));if(n&&r)return Xn.fromD3(t)}if(i.every(t=>typeof t=="boolean"||t===null))return new Ni(i);if(i.every(t=>typeof t=="number"||t===null))return new ps(i);if(i.every(t=>typeof t=="string"||t===null))return new zt(i);try{let t=new ui([new gt("c"),...i]);return ae(t,e),t.eval()}finally{Oe(e.n)}}var ye=class{constructor(i){this.ptr=i}type(){let i=T._TYPEOF(this.ptr);return Object.keys(mt).find(e=>mt[e]===i)}},_n,Zr,Wi=class extends ye{constructor(i){if(!(i instanceof ye))return kf(i);super(i.ptr),L(this,_n)}static wrap(i){let e=T._TYPEOF(i),t=Object.keys(mt)[Object.values(mt).indexOf(e)];return new(_f(t))(new ye(i))}get[Symbol.toStringTag](){return`RObject:${this.type()}`}static getPersistentObject(i){return xe[i]}getPropertyValue(i){return this[i]}inspect(){lf(".Internal(inspect(x))",{x:this})}isNull(){return T._TYPEOF(this.ptr)===mt.null}isNa(){try{let i=lf("is.na(x)",{x:this});return Yr(i),i.toBoolean()}finally{Oe(1)}}isUnbound(){return this.ptr===xe.unboundValue.ptr}attrs(){return ds.wrap(T._ATTRIB(this.ptr))}class(){let i={n:0},e=new ui([new gt("class"),this]);ae(e,i);try{return e.eval()}finally{Oe(i.n)}}setNames(i){let e;if(i===null)e=xe.null;else if(Array.isArray(i)&&i.every(t=>typeof t=="string"||t===null))e=new zt(i);else throw new Error("Argument to setNames must be null or an Array of strings or null");return T._Rf_setAttrib(this.ptr,xe.namesSymbol.ptr,e.ptr),this}names(){let i=zt.wrap(T._Rf_getAttrib(this.ptr,xe.namesSymbol.ptr));return i.isNull()?null:i.toArray()}includes(i){let e=this.names();return e&&e.includes(i)}toJs(i={depth:0},e=1){throw new Error("This R object cannot be converted to JS")}subset(i){return Je(this,_n,Zr).call(this,i,xe.bracketSymbol.ptr)}get(i){return Je(this,_n,Zr).call(this,i,xe.bracket2Symbol.ptr)}getDollar(i){return Je(this,_n,Zr).call(this,i,xe.dollarSymbol.ptr)}pluck(...i){let e=$O(xe.null);try{let t=(r,s)=>{let o=r.get(s);return LO(o,e)},n=i.reduce(t,this);return n.isNull()?void 0:n}finally{VO(e)}}set(i,e){let t={n:0};try{let n=new Wi(i);ae(n,t);let r=new Wi(e);ae(r,t);let s=new gt("[[<-"),o=T._Rf_lang4(s.ptr,this.ptr,n.ptr,r.ptr);return ae(o,t),Wi.wrap(us(o,xe.baseEnv))}finally{Oe(t.n)}}static getMethods(i){let e=new Set,t=i;do Object.getOwnPropertyNames(t).map(n=>e.add(n));while(t=Object.getPrototypeOf(t));return[...e.keys()].filter(n=>typeof i[n]=="function")}},z=Wi;_n=new WeakSet,Zr=function(i,e){let t={n:0};try{let n=new Wi(i);ae(n,t);let r=T._Rf_lang3(e,this.ptr,n.ptr);return ae(r,t),Wi.wrap(us(r,xe.baseEnv))}finally{Oe(t.n)}};var Sf=class extends z{constructor(){return super(new ye(T.getValue(T._R_NilValue,"*"))),this}toJs(){return{type:"null"}}},gt=class extends z{constructor(i){if(i instanceof ye){pi(i,"symbol"),super(i);return}let e=T.allocateUTF8(i);try{super(new ye(T._Rf_install(e)))}finally{T._free(e)}}toJs(){let i=this.toObject();return{type:"symbol",printname:i.printname,symvalue:i.symvalue,internal:i.internal}}toObject(){return{printname:this.printname().isUnbound()?null:this.printname().toString(),symvalue:this.symvalue().isUnbound()?null:this.symvalue().ptr,internal:this.internal().isNull()?null:this.internal().ptr}}toString(){return this.printname().toString()}printname(){return Ua.wrap(T._PRINTNAME(this.ptr))}symvalue(){return z.wrap(T._SYMVALUE(this.ptr))}internal(){return z.wrap(T._INTERNAL(this.ptr))}},ds=class extends z{constructor(i){if(i instanceof ye)return pi(i,"pairlist"),super(i),this;let e={n:0};try{let{names:t,values:n}=zi(i),r=ds.wrap(T._Rf_allocList(n.length));ae(r,e);for(let[s,o]=[0,r];!o.isNull();[s,o]=[s+1,o.cdr()])o.setcar(new z(n[s]));r.setNames(t),super(r)}finally{Oe(e.n)}}get length(){return this.toArray().length}toArray(i={depth:1}){return this.toJs(i).values}toObject({allowDuplicateKey:i=!0,allowEmptyKey:e=!1,depth:t=-1}={}){let n=this.entries({depth:t}),r=n.map(([s])=>s);if(!i&&new Set(r).size!==r.length)throw new Error("Duplicate key when converting pairlist without allowDuplicateKey enabled");if(!e&&r.some(s=>!s))throw new Error("Empty or null key when converting pairlist without allowEmptyKey enabled");return Object.fromEntries(n.filter((s,o)=>n.findIndex(a=>a[0]===s[0])===o))}entries(i={depth:1}){let e=this.toJs(i);return e.values.map((t,n)=>[e.names?e.names[n]:null,t])}toJs(i={depth:0},e=1){let t=[],n=!1,r=[];for(let s=this;!s.isNull();s=s.cdr()){let o=s.tag();o.isNull()?t.push(""):(n=!0,t.push(o.toString())),i.depth&&e>=i.depth?r.push(s.car()):r.push(s.car().toJs(i,e+1))}return{type:"pairlist",names:n?t:null,values:r}}includes(i){return i in this.toObject()}setcar(i){T._SETCAR(this.ptr,i.ptr)}car(){return z.wrap(T._CAR(this.ptr))}cdr(){return z.wrap(T._CDR(this.ptr))}tag(){return z.wrap(T._TAG(this.ptr))}},ui=class extends z{constructor(i){if(i instanceof ye)return pi(i,"call"),super(i),this;let e={n:0};try{let{values:t}=zi(i),n=t.map(s=>ae(new z(s),e)),r=ui.wrap(T._Rf_allocVector(mt.call,t.length));ae(r,e);for(let[s,o]=[0,r];!o.isNull();[s,o]=[s+1,o.cdr()])o.setcar(n[s]);super(r)}finally{Oe(e.n)}}setcar(i){T._SETCAR(this.ptr,i.ptr)}car(){return z.wrap(T._CAR(this.ptr))}cdr(){return z.wrap(T._CDR(this.ptr))}eval(){return T.webr.evalR(this,{env:xe.baseEnv})}capture(i={}){return T.webr.captureR(this,i)}deparse(){let i={n:0};try{let e=T._Rf_lang2(new gt("deparse1").ptr,T._Rf_lang2(new gt("quote").ptr,this.ptr));ae(e,i);let t=zt.wrap(us(e,xe.baseEnv));return ae(t,i),t.toString()}finally{Oe(i.n)}}},ya=class extends z{constructor(i,e=null){if(i instanceof ye){if(pi(i,"list"),super(i),e){if(e.length!==this.length)throw new Error("Can't construct named `RList`. Supplied `names` must be the same length as the list.");this.setNames(e)}return this}let t={n:0};try{let n=zi(i),r=T._Rf_allocVector(mt.list,n.values.length);ae(r,t),n.values.forEach((o,a)=>{T._SET_VECTOR_ELT(r,a,new z(o).ptr)});let s=e||n.names;if(s&&s.length!==n.values.length)throw new Error("Can't construct named `RList`. Supplied `names` must be the same length as the list.");z.wrap(r).setNames(s),super(new ye(r))}finally{Oe(t.n)}}get length(){return T._LENGTH(this.ptr)}isDataFrame(){let i=ds.wrap(T._ATTRIB(this.ptr)).get("class");return!i.isNull()&&i.toArray().includes("data.frame")}toArray(i={depth:1}){return this.toJs(i).values}toObject({allowDuplicateKey:i=!0,allowEmptyKey:e=!1,depth:t=-1}={}){let n=this.entries({depth:t}),r=n.map(([s])=>s);if(!i&&new Set(r).size!==r.length)throw new Error("Duplicate key when converting list without allowDuplicateKey enabled");if(!e&&r.some(s=>!s))throw new Error("Empty or null key when converting list without allowEmptyKey enabled");return Object.fromEntries(n.filter((s,o)=>n.findIndex(a=>a[0]===s[0])===o))}toD3(){if(!this.isDataFrame())throw new Error("Can't convert R list object to D3 format. Object must be of class 'data.frame'.");return this.entries().reduce((i,e)=>(e[1].forEach((t,n)=>i[n]=Object.assign(i[n]||{},{[e[0]]:t})),i),[])}entries(i={depth:-1}){let e=this.toJs(i);return this.isDataFrame()&&i.depth<0&&(e.values=e.values.map(t=>t.toArray())),e.values.map((t,n)=>[e.names?e.names[n]:null,t])}toJs(i={depth:0},e=1){return{type:"list",names:this.names(),values:[...Array(this.length).keys()].map(t=>i.depth&&e>=i.depth?this.get(t+1):this.get(t+1).toJs(i,e+1))}}},Xn=class extends ya{constructor(i){if(i instanceof ye){if(super(i),!this.isDataFrame())throw new Error("Can't construct `RDataFrame`. Supplied R object is not a `data.frame`.");return this}return Xn.fromObject(i)}static fromObject(i){let{names:e,values:t}=zi(i),n={n:0};try{let r=!!e&&e.length>0&&e.every(o=>o),s=t.length>0&&t.every(o=>Array.isArray(o)||ArrayBuffer.isView(o)||o instanceof ArrayBuffer);if(r&&s){let o=t,a=o.every(h=>h.length===o[0].length),l=o.every(h=>$f(h[0])||Df(h[0]));if(a&&l){let h=new ya({type:"list",names:e,values:o.map(f=>kf(f))});ae(h,n);let c=new ui([new gt("as.data.frame"),h]);return ae(c,n),new Xn(c.eval())}}}finally{Oe(n.n)}throw new Error("Can't construct `data.frame`. Source object is not eligible.")}static fromD3(i){return this.fromObject(Object.fromEntries(Object.keys(i[0]).map(e=>[e,i.map(t=>t[e])])))}},Gr=class extends z{exec(...i){let e={n:0};try{let t=new ui([this,...i]);return ae(t,e),t.eval()}finally{Oe(e.n)}}capture(i={},...e){let t={n:0};try{let n=new ui([this,...e]);return ae(n,t),n.capture(i)}finally{Oe(t.n)}}},Ua=class extends z{constructor(i){if(i instanceof ye){pi(i,"string"),super(i);return}let e=T.allocateUTF8(i);try{super(new ye(T._Rf_mkChar(e)))}finally{T._free(e)}}toString(){return T.UTF8ToString(T._R_CHAR(this.ptr))}toJs(){return{type:"string",value:this.toString()}}},Tf=class extends z{constructor(i={}){if(i instanceof ye)return pi(i,"environment"),super(i),this;let e=0;try{let{names:t,values:n}=zi(i),r=Yr(T._R_NewEnv(xe.globalEnv.ptr,0,0));++e,n.forEach((s,o)=>{let a=t?t[o]:null;if(!a)throw new Error("Can't create object in new environment with empty symbol name");let l=new gt(a),h=Yr(new z(s));try{af(r,l,h)}finally{Oe(1)}}),super(new ye(r))}finally{Oe(e)}}ls(i=!1,e=!0){return zt.wrap(T._R_lsInternal3(this.ptr,Number(i),Number(e))).toArray()}bind(i,e){let t=new gt(i),n=Yr(new z(e));try{af(this,t,n)}finally{Oe(1)}}names(){return this.ls(!0,!0)}frame(){return z.wrap(T._FRAME(this.ptr))}subset(i){if(typeof i=="number")throw new Error("Object of type environment is not subsettable");return this.getDollar(i)}toObject({depth:i=-1}={}){let e=this.names();return Object.fromEntries([...Array(e.length).keys()].map(t=>{let n=this.getDollar(e[t]);return[e[t],i<0?n:n.toJs({depth:i})]}))}toJs(i={depth:0},e=1){let t=this.names(),n=[...Array(t.length).keys()].map(r=>i.depth&&e>=i.depth?this.getDollar(t[r]):this.getDollar(t[r]).toJs(i,e+1));return{type:"environment",names:t,values:n}}},ji=class extends z{constructor(i,e,t){if(i instanceof ye)return pi(i,e),super(i),this;let n={n:0};try{let{names:r,values:s}=zi(i),o=T._Rf_allocVector(mt[e],s.length);ae(o,n),s.forEach(t(o)),z.wrap(o).setNames(r),super(new ye(o))}finally{Oe(n.n)}}get length(){return T._LENGTH(this.ptr)}get(i){return super.get(i)}subset(i){return super.subset(i)}getDollar(){throw new Error("$ operator is invalid for atomic vectors")}detectMissing(){let i={n:0};try{let e=T._Rf_lang2(new gt("is.na").ptr,this.ptr);ae(e,i);let t=Ni.wrap(us(e,xe.baseEnv));ae(t,i);let n=t.toTypedArray();return Array.from(n).map(r=>!!r)}finally{Oe(i.n)}}toArray(){let i=this.toTypedArray();return this.detectMissing().map((e,t)=>e?null:i[t])}toObject({allowDuplicateKey:i=!0,allowEmptyKey:e=!1}={}){let t=this.entries(),n=t.map(([r])=>r);if(!i&&new Set(n).size!==n.length)throw new Error("Duplicate key when converting atomic vector without allowDuplicateKey enabled");if(!e&&n.some(r=>!r))throw new Error("Empty or null key when converting atomic vector without allowEmptyKey enabled");return Object.fromEntries(t.filter((r,s)=>t.findIndex(o=>o[0]===r[0])===s))}entries(){let i=this.toArray(),e=this.names();return i.map((t,n)=>[e?e[n]:null,t])}toJs(){return{type:this.type(),names:this.names(),values:this.toArray()}}},ba,Pf=class extends ji{constructor(i){super(i,"logical",k(Pf,ba))}getBoolean(i){return this.get(i).toArray()[0]}toBoolean(){if(this.length!==1)throw new Error("Can't convert atomic vector of length > 1 to a scalar JS value");let i=this.getBoolean(1);if(i===null)throw new Error("Can't convert missing value `NA` to a JS boolean");return i}toTypedArray(){return new Int32Array(T.HEAP32.subarray(T._LOGICAL(this.ptr)/4,T._LOGICAL(this.ptr)/4+this.length))}toArray(){let i=this.toTypedArray();return this.detectMissing().map((e,t)=>e?null:!!i[t])}},Ni=Pf;ba=new WeakMap,L(Ni,ba,i=>{let e=T._LOGICAL(i),t=T.getValue(T._R_NaInt,"i32");return(n,r)=>{T.setValue(e+4*r,n===null?t:!!n,"i32")}});var wa,Cf=class extends ji{constructor(i){super(i,"integer",k(Cf,wa))}getNumber(i){return this.get(i).toArray()[0]}toNumber(){if(this.length!==1)throw new Error("Can't convert atomic vector of length > 1 to a scalar JS value");let i=this.getNumber(1);if(i===null)throw new Error("Can't convert missing value `NA` to a JS number");return i}toTypedArray(){return new Int32Array(T.HEAP32.subarray(T._INTEGER(this.ptr)/4,T._INTEGER(this.ptr)/4+this.length))}},Rf=Cf;wa=new WeakMap,L(Rf,wa,i=>{let e=T._INTEGER(i),t=T.getValue(T._R_NaInt,"i32");return(n,r)=>{T.setValue(e+4*r,n===null?t:Math.round(Number(n)),"i32")}});var va,Ef=class extends ji{constructor(i){super(i,"double",k(Ef,va))}getNumber(i){return this.get(i).toArray()[0]}toNumber(){if(this.length!==1)throw new Error("Can't convert atomic vector of length > 1 to a scalar JS value");let i=this.getNumber(1);if(i===null)throw new Error("Can't convert missing value `NA` to a JS number");return i}toTypedArray(){return new Float64Array(T.HEAPF64.subarray(T._REAL(this.ptr)/8,T._REAL(this.ptr)/8+this.length))}},ps=Ef;va=new WeakMap,L(ps,va,i=>{let e=T._REAL(i),t=T.getValue(T._R_NaReal,"double");return(n,r)=>{T.setValue(e+8*r,n===null?t:n,"double")}});var xa,Af=class extends ji{constructor(i){super(i,"complex",k(Af,xa))}getComplex(i){return this.get(i).toArray()[0]}toComplex(){if(this.length!==1)throw new Error("Can't convert atomic vector of length > 1 to a scalar JS value");let i=this.getComplex(1);if(i===null)throw new Error("Can't convert missing value `NA` to a JS object");return i}toTypedArray(){return new Float64Array(T.HEAPF64.subarray(T._COMPLEX(this.ptr)/8,T._COMPLEX(this.ptr)/8+2*this.length))}toArray(){let i=this.toTypedArray();return this.detectMissing().map((e,t)=>e?null:{re:i[2*t],im:i[2*t+1]})}},Fa=Af;xa=new WeakMap,L(Fa,xa,i=>{let e=T._COMPLEX(i),t=T.getValue(T._R_NaReal,"double");return(n,r)=>{T.setValue(e+8*(2*r),n===null?t:n.re,"double"),T.setValue(e+8*(2*r+1),n===null?t:n.im,"double")}});var ka,Qf=class extends ji{constructor(i){super(i,"character",k(Qf,ka))}getString(i){return this.get(i).toArray()[0]}toString(){if(this.length!==1)throw new Error("Can't convert atomic vector of length > 1 to a scalar JS value");let i=this.getString(1);if(i===null)throw new Error("Can't convert missing value `NA` to a JS string");return i}toTypedArray(){return new Uint32Array(T.HEAPU32.subarray(T._STRING_PTR(this.ptr)/4,T._STRING_PTR(this.ptr)/4+this.length))}toArray(){return this.detectMissing().map((i,e)=>i?null:T.UTF8ToString(T._R_CHAR(T._STRING_ELT(this.ptr,e))))}},zt=Qf;ka=new WeakMap,L(zt,ka,i=>(e,t)=>{e===null?T._SET_STRING_ELT(i,t,xe.naString.ptr):T._SET_STRING_ELT(i,t,new Ua(e).ptr)});var Sa,Mf=class extends ji{constructor(i){i instanceof ArrayBuffer&&(i=new Uint8Array(i)),super(i,"raw",k(Mf,Sa))}getNumber(i){return this.get(i).toArray()[0]}toNumber(){if(this.length!==1)throw new Error("Can't convert atomic vector of length > 1 to a scalar JS value");let i=this.getNumber(1);if(i===null)throw new Error("Can't convert missing value `NA` to a JS number");return i}toTypedArray(){return new Uint8Array(T.HEAPU8.subarray(T._RAW(this.ptr),T._RAW(this.ptr)+this.length))}},Ha=Mf;Sa=new WeakMap,L(Ha,Sa,i=>{let e=T._RAW(i);return(t,n)=>{T.setValue(e+n,Number(t),"i8")}});function zi(i){return vf(i)?i:Array.isArray(i)||ArrayBuffer.isView(i)?{names:null,values:i}:i&&typeof i=="object"&&!fs(i)?{names:Object.keys(i),values:Object.values(i)}:{names:null,values:[i]}}function _f(i){let e={object:z,null:Sf,symbol:gt,pairlist:ds,closure:Gr,environment:Tf,call:ui,special:Gr,builtin:Gr,string:Ua,logical:Ni,integer:Rf,double:ps,complex:Fa,character:zt,list:ya,raw:Ha,function:Gr,dataframe:Xn};return i in e?e[i]:z}function rs(i){return i instanceof z}function Df(i){let e=["logical","integer","double","complex","character"];return rs(i)&&e.includes(i.type())||rs(i)&&i.isNa()}function $f(i){return i===null||typeof i=="number"||typeof i=="boolean"||typeof i=="string"||fs(i)}var xe;function ms(){let i={resolve:()=>{},reject:()=>{},promise:Promise.resolve()},e=new Promise((t,n)=>{i.resolve=t,i.reject=n});return i.promise=e,i}function NO(i){return new Promise(e=>setTimeout(e,i))}function Ut(i,e,t,...n){return i==null||jO(i)?i:i instanceof ArrayBuffer?new Uint8Array(i):e(i)?t(i,...n):Array.isArray(i)||ArrayBuffer.isView(i)?i.map(r=>Ut(r,e,t,...n)):i instanceof ye?i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([r,s])=>[r,Ut(s,e,t,...n)])):i}function Ga(i,e){let t=new XMLHttpRequest;t.open("get",i,!0),t.onload=()=>{let n=new Worker(URL.createObjectURL(new Blob([t.responseText])));e(n)},t.send()}function Ya(i){if(Ie)return!1;let e=new URL(location.href),t=new URL(i,location.origin);return!(e.host===t.host&&e.port===t.port&&e.protocol===t.protocol)}function jO(i){return typeof ImageBitmap<"u"&&i instanceof ImageBitmap}var zO=Xi(za()),UO=new TextEncoder;async function FO(i,e,t){try{let{taskId:n,sizeBuffer:r,dataBuffer:s,signalBuffer:o}=e,a=(0,zO.encode)(t),l=a.length<=s.length;if(Atomics.store(r,0,a.length),Atomics.store(r,1,+l),!l){let[h,c]=HO(i);s.set(UO.encode(h)),await hf(o,n),s=(await c).dataBuffer}s.set(a),Atomics.store(r,1,1),await hf(o,n)}catch(n){console.warn(n)}}function HO(i){let e=xf();return[e,new Promise(t=>{Ie?i.once("message",n=>{!n.id||n.id!==e||t(n)}):i.addEventListener("message",function n(r){!r.data||!r.data.id||r.data.id!==e||(i.removeEventListener("message",n),t(r.data))}),i.start&&i.start()})]}async function hf(i,e){let t=(e>>1)%32,n=1;for(;Atomics.compareExchange(i,t+1,0,e)!==0;)await NO(n),n<32&&(n*=2);Atomics.or(i,0,1<{k(this,At).push(i)}))};function GO(i,e){return Vf({type:"request",data:{uuid:xf(),msg:i}},e)}function Pa(i,e,t){return Vf({type:"response",data:{uuid:i,resp:e}},t)}function Vf(i,e){return e&&BO(i,e),i}function YO(i){let e=new wf(i.obj.message);return i.obj.name!=="Error"&&(e.name=i.obj.name),e.stack=i.obj.stack,e}function ZO(i){return!!i&&typeof i=="object"&&"payloadType"in i&&"obj"in i}function Lf(i){return ZO(i)&&i.payloadType==="ptr"}var Dn,Za=class{constructor(){this.inputQueue=new Oa,this.outputQueue=new Oa,this.systemQueue=new Oa,L(this,Dn,new Map)}async read(){return await this.outputQueue.get()}async flush(){let i=[];for(;!this.outputQueue.isEmpty();)i.push(await this.read());return i}async readSystem(){return await this.systemQueue.get()}write(i){this.inputQueue.put(i)}async request(i,e){let t=GO(i,e),{resolve:n,reject:r,promise:s}=ms();return k(this,Dn).set(t.data.uuid,{resolve:n,reject:r}),this.write(t),s}putClosedMessage(){this.outputQueue.put({type:"closed"})}resolveResponse(i){let e=i.data.uuid,t=k(this,Dn).get(e);if(t){let n=i.data.resp;k(this,Dn).delete(e),n.payloadType==="err"?t.reject(YO(n)):t.resolve(n)}else console.warn("Can't find request.")}};Dn=new WeakMap;var cS=Xi(za()),fS=new TextDecoder("utf-8"),JO,KO,e0,t0,i0;JO=new WeakMap,KO=new WeakMap,e0=new WeakMap,t0=new WeakMap,i0=new WeakMap;var uS=new Int32Array(new ArrayBuffer(4));Ie&&(globalThis.Worker=Bi("worker_threads").Worker);var $n,Ca,qf,Kr,cf=class extends Za{constructor(i){super(),L(this,Ca),L(this,$n,void 0),this.close=()=>{},L(this,Kr,async(t,n)=>{if(!(!n||!n.type))switch(n.type){case"resolve":me(this,$n,new Int32Array(n.data)),this.resolve();return;case"response":this.resolveResponse(n);return;case"system":this.systemQueue.put(n.data);return;default:this.outputQueue.put(n);return;case"sync-request":{let r=n,s=r.data.msg,o=r.data.reqData;switch(s.type){case"read":{let a=await this.inputQueue.get();await FO(t,o,a);break}default:throw new pt(`Unsupported request type '${s.type}'.`)}return}case"request":throw new pt("Can't send messages of type 'request' from a worker. Please Use 'sync-request' instead.")}});let e=t=>{Je(this,Ca,qf).call(this,t),this.close=()=>{t.terminate(),this.putClosedMessage()};let n={type:"init",data:{config:i,channelType:Qt.SharedArrayBuffer}};t.postMessage(n)};if(Ya(i.baseUrl))Ga(`${i.baseUrl}webr-worker.js`,t=>e(t));else{let t=new Worker(`${i.baseUrl}webr-worker.js`);e(t)}({resolve:this.resolve,promise:this.initialised}=ms())}interrupt(){if(!k(this,$n))throw new pt("Failed attempt to interrupt before initialising interruptBuffer");this.inputQueue.reset(),k(this,$n)[0]=1}};$n=new WeakMap,Ca=new WeakSet,qf=function(i){Ie?i.on("message",e=>{k(this,Kr).call(this,i,e)}):i.onmessage=e=>k(this,Kr).call(this,i,e.data)},Kr=new WeakMap;var n0,r0,s0,o0;n0=new WeakMap,r0=new WeakMap,s0=new WeakMap,o0=new WeakMap;var dS=Xi(za());Ie&&(globalThis.Worker=Bi("worker_threads").Worker);var Ln,Ii,qn,Ra,Bf,Ea,ff,Aa,Xf,es,a0=class extends Za{constructor(i){super(),L(this,Ra),L(this,Ea),L(this,Aa),this.close=()=>{},L(this,Ln,new Map),L(this,Ii,void 0),L(this,qn,!1),L(this,es,(t,n)=>{if(!(!n||!n.type))switch(n.type){case"resolve":this.resolve();return;case"response":this.resolveResponse(n);return;case"system":this.systemQueue.put(n.data);return;default:this.outputQueue.put(n);return;case"sync-request":{let r=n.data;k(this,Ln).set(r.data.uuid,r.data.msg);return}case"request":throw new pt("Can't send messages of type 'request' from a worker.Use service worker fetch request instead.")}}),console.warn("The ServiceWorker communication channel is deprecated and will be removed in a future version of webR. Consider using the PostMessage channel instead. If blocking input is required (for example, `browser()`) the SharedArrayBuffer channel should be used. See https://docs.r-wasm.org/webr/latest/serving.html for further information.");let e=t=>{Je(this,Aa,Xf).call(this,t),this.close=()=>{t.terminate(),this.putClosedMessage()},Je(this,Ra,Bf).call(this,`${i.serviceWorkerUrl}webr-serviceworker.js`).then(n=>{let r={type:"init",data:{config:i,channelType:Qt.ServiceWorker,clientId:n,location:window.location.href}};t.postMessage(r)})};if(Ya(i.serviceWorkerUrl))Ga(`${i.serviceWorkerUrl}webr-worker.js`,t=>e(t));else{let t=new Worker(`${i.serviceWorkerUrl}webr-worker.js`);e(t)}({resolve:this.resolve,promise:this.initialised}=ms())}activeRegistration(){var i;if(!((i=k(this,Ii))!=null&&i.active))throw new pt("Attempted to obtain a non-existent active registration.");return k(this,Ii).active}interrupt(){me(this,qn,!0)}};Ln=new WeakMap,Ii=new WeakMap,qn=new WeakMap,Ra=new WeakSet,Bf=async function(i){me(this,Ii,await navigator.serviceWorker.register(i)),await navigator.serviceWorker.ready,window.addEventListener("beforeunload",()=>{var t;(t=k(this,Ii))==null||t.unregister()});let e=await new Promise(t=>{navigator.serviceWorker.addEventListener("message",function n(r){r.data.type==="registration-successful"&&(navigator.serviceWorker.removeEventListener("message",n),t(r.data.clientId))}),this.activeRegistration().postMessage({type:"register-client-main"})});return navigator.serviceWorker.addEventListener("message",t=>{Je(this,Ea,ff).call(this,t)}),e},Ea=new WeakSet,ff=async function(i){if(i.data.type==="request"){let e=i.data.data,t=k(this,Ln).get(e);if(!t)throw new pt("Request not found during service worker XHR request");switch(k(this,Ln).delete(e),t.type){case"read":{let n=await this.inputQueue.get();this.activeRegistration().postMessage({type:"wasm-webr-fetch-response",uuid:e,response:Pa(e,n)});break}case"interrupt":{let n=k(this,qn);this.activeRegistration().postMessage({type:"wasm-webr-fetch-response",uuid:e,response:Pa(e,n)}),this.inputQueue.reset(),me(this,qn,!1);break}default:throw new pt(`Unsupported request type '${t.type}'.`)}return}},Aa=new WeakSet,Xf=function(i){Ie?i.on("message",e=>{k(this,es).call(this,i,e)}):i.onmessage=e=>k(this,es).call(this,i,e.data)},es=new WeakMap;var l0,h0,c0,f0,u0,d0;l0=new WeakMap,h0=new WeakMap,c0=new WeakMap,f0=new WeakMap,u0=new WeakMap,d0=new WeakMap;Ie&&(globalThis.Worker=Bi("worker_threads").Worker);var Vn,Qa,Wf,ts,uf=class extends Za{constructor(i){super(),L(this,Qa),this.close=()=>{},L(this,Vn,void 0),L(this,ts,async(t,n)=>{if(!(!n||!n.type))switch(n.type){case"resolve":this.resolve();return;case"response":this.resolveResponse(n);return;case"system":this.systemQueue.put(n.data);return;default:this.outputQueue.put(n);return;case"request":{let r=n,s=r.data.msg;switch(s.type){case"read":{let o=await this.inputQueue.get();if(k(this,Vn)){let a=Pa(r.data.uuid,o);k(this,Vn).postMessage(a)}break}default:throw new pt(`Unsupported request type '${s.type}'.`)}return}case"sync-request":throw new pt("Can't send messages of type 'sync-request' in PostMessage mode. Use 'request' instead.")}});let e=t=>{me(this,Vn,t),Je(this,Qa,Wf).call(this,t),this.close=()=>t.terminate();let n={type:"init",data:{config:i,channelType:Qt.PostMessage}};t.postMessage(n)};if(Ya(i.baseUrl))Ga(`${i.baseUrl}webr-worker.js`,t=>e(t));else{let t=new Worker(`${i.baseUrl}webr-worker.js`);e(t)}({resolve:this.resolve,promise:this.initialised}=ms())}interrupt(){console.error("Interrupting R execution is not available when using the PostMessage channel")}};Vn=new WeakMap,Qa=new WeakSet,Wf=function(i){Ie?i.on("message",e=>{k(this,ts).call(this,i,e)}):i.onmessage=e=>k(this,ts).call(this,i,e.data)},ts=new WeakMap;var p0,m0,g0,O0,y0;p0=new WeakMap,m0=new WeakMap,g0=new WeakMap,O0=new WeakMap,y0=new WeakMap;var Qt={Automatic:0,SharedArrayBuffer:1,ServiceWorker:2,PostMessage:3};function b0(i){switch(i.channelType){case Qt.SharedArrayBuffer:return new cf(i);case Qt.ServiceWorker:return new a0(i);case Qt.PostMessage:return new uf(i);case Qt.Automatic:default:return typeof SharedArrayBuffer<"u"?new cf(i):new uf(i)}}var w0=Ie?__dirname+"/":"https://webr.r-wasm.org/v0.4.0/",v0="https://repo.r-wasm.org",If="0.4.0";function ee(i){return!!i&&(typeof i=="object"||typeof i=="function")&&"payloadType"in i&&Lf(i._payload)}function Re(i){return ee(i)&&i._payload.obj.type==="null"}function x0(i){return ee(i)&&i._payload.obj.type==="symbol"}function k0(i){return ee(i)&&i._payload.obj.type==="pairlist"}function S0(i){return ee(i)&&i._payload.obj.type==="environment"}function T0(i){return ee(i)&&i._payload.obj.type==="logical"}function P0(i){return ee(i)&&i._payload.obj.type==="integer"}function C0(i){return ee(i)&&i._payload.obj.type==="double"}function R0(i){return ee(i)&&i._payload.obj.type==="complex"}function Ui(i){return ee(i)&&i._payload.obj.type==="character"}function ot(i){return ee(i)&&i._payload.obj.type==="list"}function Ja(i){return ee(i)&&i._payload.obj.type==="raw"}function gs(i){return ee(i)&&i._payload.obj.type==="call"}function Os(i){var e;return!!(ee(i)&&(e=i._payload.obj.methods)!=null&&e.includes("exec"))}function E0(){}function A0(i,e){return async function*(){let t={type:"callRObjectMethod",data:{payload:e._payload,prop:"getPropertyValue",args:[{payloadType:"raw",obj:"length"}],shelter:void 0}},n=await i.request(t);if(typeof n.obj!="number")throw new di("Cannot iterate over object, unexpected type for length property.");for(let r=1;r<=n.obj;r++)yield e.get(r)}}function Nf(i,e,t){return async(...n)=>{let r=n.map(a=>ee(a)?a._payload:{obj:Ut(a,ee,l=>l._payload),payloadType:"raw"}),s={type:"callRObjectMethod",data:{payload:t,prop:e,args:r}},o=await i.request(s);switch(o.payloadType){case"ptr":return fi(i,o);case"raw":return Ut(o,Lf,(a,l)=>fi(l,a),i).obj}}}async function Q0(i,e,t,...n){let r={type:"newRObject",data:{objType:e,args:Ut(n,ee,o=>o._payload),shelter:t}},s=await i.request(r);switch(s.payloadType){case"raw":throw new Bn("Unexpected raw payload type returned from newRObject");case"ptr":return fi(i,s)}}function fi(i,e){var t;let n=new Proxy((t=e.obj.methods)!=null&&t.includes("exec")?Object.assign(E0,{...e}):e,{get:(r,s)=>{var o;if(s==="_payload")return e;if(s===Symbol.asyncIterator)return A0(i,n);if((o=e.obj.methods)!=null&&o.includes(s.toString()))return Nf(i,s.toString(),e)},apply:async(r,s,o)=>{let a=await fi(i,e).exec(...o);return Os(a)?a:a.toJs()}});return n}function Ve(i,e,t){return new Proxy(z,{construct:(n,r)=>Q0(i,t,e,...r),get:(n,r)=>Nf(i,r.toString())})}var ss,os,as,ls,hs,Ma,_a,Da,$a,Va,La,jf,M0=class{constructor(i={},e={REnv:{R_HOME:"/usr/lib/R",FONTCONFIG_PATH:"/etc/fonts",R_ENABLE_JIT:"0"}}){L(this,La),L(this,ss,void 0),L(this,os,void 0),L(this,as,void 0),L(this,ls,void 0),L(this,hs,void 0),L(this,Ma,t=>{console.log(t)}),L(this,_a,t=>{console.error(t)}),L(this,Da,t=>{let n=prompt(t);n&&this.stdin(`${n} +`)}),L(this,$a,t=>{if(Ie)throw new Error("Plotting with HTML canvas is not yet supported under Node");this.canvas.getContext("2d").drawImage(t,0,0)}),L(this,Va,()=>{if(Ie)throw new Error("Plotting with HTML canvas is not yet supported under Node");this.canvas.getContext("2d").clearRect(0,0,this.canvas.width,this.canvas.height)}),this.webR=new Uf(e),Ie||(this.canvas=document.createElement("canvas"),this.canvas.setAttribute("width","1008"),this.canvas.setAttribute("height","1008")),me(this,ss,i.stdout||k(this,Ma)),me(this,os,i.stderr||k(this,_a)),me(this,as,i.prompt||k(this,Da)),me(this,ls,i.canvasImage||k(this,$a)),me(this,hs,i.canvasNewPage||k(this,Va)),this.webR.evalRVoid("options(device=webr::canvas)")}stdin(i){this.webR.writeConsole(i)}interrupt(){this.webR.interrupt()}run(){Je(this,La,jf).call(this)}};ss=new WeakMap,os=new WeakMap,as=new WeakMap,ls=new WeakMap,hs=new WeakMap,Ma=new WeakMap,_a=new WeakMap,Da=new WeakMap,$a=new WeakMap,Va=new WeakMap,La=new WeakSet,jf=async function(){for(;;){let i=await this.webR.read();switch(i.type){case"stdout":k(this,ss).call(this,i.data);break;case"stderr":k(this,os).call(this,i.data);break;case"prompt":k(this,as).call(this,i.data);break;case"canvas":i.data.event==="canvasImage"?k(this,ls).call(this,i.data.image):i.data.event==="canvasNewPage"&&k(this,hs).call(this);break;case"closed":return;default:console.warn(`Unhandled output type for webR Console: ${i.type}.`)}}};var _0={FONTCONFIG_PATH:"/etc/fonts",R_HOME:"/usr/lib/R",R_ENABLE_JIT:"0",WEBR:"1",WEBR_VERSION:If},df={RArgs:[],REnv:_0,baseUrl:w0,serviceWorkerUrl:"",repoUrl:v0,homedir:"/home/web_user",interactive:!0,channelType:Qt.Automatic,createLazyFilesystem:!0},ne,is,qa,zf,Uf=class{constructor(i={}){L(this,qa),L(this,ne,void 0),L(this,is,void 0),this.version=If,this.FS={lookupPath:async t=>{let n={type:"lookupPath",data:{path:t}};return(await k(this,ne).request(n)).obj},mkdir:async t=>{let n={type:"mkdir",data:{path:t}};return(await k(this,ne).request(n)).obj},mount:async(t,n,r)=>{let s={type:"mount",data:{type:t,options:n,mountpoint:r}};await k(this,ne).request(s)},syncfs:async t=>{let n={type:"syncfs",data:{populate:t}};await k(this,ne).request(n)},readFile:async(t,n)=>{let r={type:"readFile",data:{path:t,flags:n}};return(await k(this,ne).request(r)).obj},rmdir:async t=>{let n={type:"rmdir",data:{path:t}};await k(this,ne).request(n)},writeFile:async(t,n,r)=>{let s={type:"writeFile",data:{path:t,data:n,flags:r}};await k(this,ne).request(s)},unlink:async t=>{let n={type:"unlink",data:{path:t}};await k(this,ne).request(n)},unmount:async t=>{let n={type:"unmount",data:{path:t}};await k(this,ne).request(n)}};let e={...df,...i,REnv:{...df.REnv,...i.REnv}};me(this,ne,b0(e)),this.objs={},this.Shelter=D0(k(this,ne)),me(this,is,k(this,ne).initialised.then(async()=>{this.globalShelter=await new this.Shelter,this.RObject=this.globalShelter.RObject,this.RLogical=this.globalShelter.RLogical,this.RInteger=this.globalShelter.RInteger,this.RDouble=this.globalShelter.RDouble,this.RComplex=this.globalShelter.RComplex,this.RCharacter=this.globalShelter.RCharacter,this.RRaw=this.globalShelter.RRaw,this.RList=this.globalShelter.RList,this.RDataFrame=this.globalShelter.RDataFrame,this.RPairlist=this.globalShelter.RPairlist,this.REnvironment=this.globalShelter.REnvironment,this.RSymbol=this.globalShelter.RSymbol,this.RString=this.globalShelter.RString,this.RCall=this.globalShelter.RCall,this.objs={baseEnv:await this.RObject.getPersistentObject("baseEnv"),globalEnv:await this.RObject.getPersistentObject("globalEnv"),null:await this.RObject.getPersistentObject("null"),true:await this.RObject.getPersistentObject("true"),false:await this.RObject.getPersistentObject("false"),na:await this.RObject.getPersistentObject("na")},Je(this,qa,zf).call(this)}))}async init(){return k(this,is)}close(){k(this,ne).close()}async read(){return await k(this,ne).read()}async flush(){return await k(this,ne).flush()}write(i){k(this,ne).write(i)}writeConsole(i){this.write({type:"stdin",data:i+` +`})}interrupt(){k(this,ne).interrupt()}async installPackages(i,e){let t=Object.assign({quiet:!1,mount:!0},e),n={type:"installPackages",data:{name:i,options:t}};await k(this,ne).request(n)}async destroy(i){await this.globalShelter.destroy(i)}async evalR(i,e){return this.globalShelter.evalR(i,e)}async evalRVoid(i,e){return this.evalRRaw(i,"void",e)}async evalRBoolean(i,e){return this.evalRRaw(i,"boolean",e)}async evalRNumber(i,e){return this.evalRRaw(i,"number",e)}async evalRString(i,e){return this.evalRRaw(i,"string",e)}async evalRRaw(i,e,t={}){let n=Ut(t,ee,o=>o._payload),r={type:"evalRRaw",data:{code:i,options:n,outputType:e}},s=await k(this,ne).request(r);switch(s.payloadType){case"raw":return s.obj;case"ptr":throw new Bn("Unexpected ptr payload type returned from evalRVoid")}}async invokeWasmFunction(i,...e){let t={type:"invokeWasmFunction",data:{ptr:i,args:e}};return(await k(this,ne).request(t)).obj}};ne=new WeakMap,is=new WeakMap,qa=new WeakSet,zf=async function(){for(;;){let i=await k(this,ne).readSystem();switch(i.type){case"setTimeoutWasm":setTimeout((e,t)=>{this.invokeWasmFunction(e,...t)},i.data.delay,i.data.ptr,i.data.args);break;case"console.log":console.log(i.data);break;case"console.warn":console.warn(i.data);break;case"console.error":console.error(i.data);break;default:throw new di("Unknown system message type `"+i.type+"`")}}};var se,Z,ns,Ba=class{constructor(i){L(this,se,""),L(this,Z,void 0),L(this,ns,!1),me(this,Z,i)}async init(){if(k(this,ns))return;let i={type:"newShelter"},e=await k(this,Z).request(i);me(this,se,e.obj),this.RObject=Ve(k(this,Z),k(this,se),"object"),this.RLogical=Ve(k(this,Z),k(this,se),"logical"),this.RInteger=Ve(k(this,Z),k(this,se),"integer"),this.RDouble=Ve(k(this,Z),k(this,se),"double"),this.RComplex=Ve(k(this,Z),k(this,se),"complex"),this.RCharacter=Ve(k(this,Z),k(this,se),"character"),this.RRaw=Ve(k(this,Z),k(this,se),"raw"),this.RList=Ve(k(this,Z),k(this,se),"list"),this.RDataFrame=Ve(k(this,Z),k(this,se),"dataframe"),this.RPairlist=Ve(k(this,Z),k(this,se),"pairlist"),this.REnvironment=Ve(k(this,Z),k(this,se),"environment"),this.RSymbol=Ve(k(this,Z),k(this,se),"symbol"),this.RString=Ve(k(this,Z),k(this,se),"string"),this.RCall=Ve(k(this,Z),k(this,se),"call"),me(this,ns,!0)}async purge(){let i={type:"shelterPurge",data:k(this,se)};await k(this,Z).request(i)}async destroy(i){let e={type:"shelterDestroy",data:{id:k(this,se),obj:i._payload}};await k(this,Z).request(e)}async size(){let i={type:"shelterSize",data:k(this,se)};return(await k(this,Z).request(i)).obj}async evalR(i,e={}){let t=Ut(e,ee,s=>s._payload),n={type:"evalR",data:{code:i,options:t,shelter:k(this,se)}},r=await k(this,Z).request(n);switch(r.payloadType){case"raw":throw new Bn("Unexpected payload type returned from evalR");default:return fi(k(this,Z),r)}}async captureR(i,e={}){let t=Ut(e,ee,s=>s._payload),n={type:"captureR",data:{code:i,options:t,shelter:k(this,se)}},r=await k(this,Z).request(n);switch(r.payloadType){case"ptr":throw new Bn("Unexpected payload type returned from evalR");case"raw":{let s=r.obj,o=fi(k(this,Z),s.result),a=s.output,l=s.images;for(let h=0;h{let e=new Ba(i);return await e.init(),e}})}var Hf=Symbol("Comlink.proxy"),il=Symbol("Comlink.endpoint"),$0=Symbol("Comlink.releaseProxy"),el=Symbol("Comlink.finalizer"),bs=Symbol("Comlink.thrown"),Gf=i=>typeof i=="object"&&i!==null||typeof i=="function",V0={canHandle:i=>Gf(i)&&i[Hf],serialize(i){let{port1:e,port2:t}=new MessageChannel;return ks(i,e),[t,[t]]},deserialize(i){return i.start(),Wn(i)}},L0={canHandle:i=>Gf(i)&&bs in i,serialize({value:i}){let e;return i instanceof Error?e={isError:!0,value:{message:i.message,name:i.name,stack:i.stack}}:e={isError:!1,value:i},[e,[]]},deserialize(i){throw i.isError?Object.assign(new Error(i.value.message),i.value):i.value}},gi=new Map([["proxy",V0],["throw",L0]]);function q0(i,e){for(let t of i)if(e===t||t==="*"||t instanceof RegExp&&t.test(e))return!0;return!1}function ks(i,e=globalThis,t=["*"]){e.addEventListener("message",function n(r){if(!r||!r.data)return;if(!q0(t,r.origin)){console.warn(`Invalid origin '${r.origin}' for comlink proxy`);return}let{id:s,type:o,path:a}=Object.assign({path:[]},r.data),l=(r.data.argumentList||[]).map(mi),h;try{let c=a.slice(0,-1).reduce((u,d)=>u[d],i),f=a.reduce((u,d)=>u[d],i);switch(o){case"GET":h=f;break;case"SET":c[a.slice(-1)[0]]=mi(r.data.value),h=!0;break;case"APPLY":h=f.apply(c,l);break;case"CONSTRUCT":{let u=new f(...l);h=j0(u)}break;case"ENDPOINT":{let{port1:u,port2:d}=new MessageChannel;ks(i,d),h=N0(u,[u])}break;case"RELEASE":h=void 0;break;default:return}}catch(c){h={value:c,[bs]:0}}Promise.resolve(h).catch(c=>({value:c,[bs]:0})).then(c=>{let[f,u]=xs(c);e.postMessage(Object.assign(Object.assign({},f),{id:s}),u),o==="RELEASE"&&(e.removeEventListener("message",n),Yf(e),el in i&&typeof i[el]=="function"&&i[el]())}).catch(c=>{let[f,u]=xs({value:new TypeError("Unserializable return value"),[bs]:0});e.postMessage(Object.assign(Object.assign({},f),{id:s}),u)})}),e.start&&e.start()}function B0(i){return i.constructor.name==="MessagePort"}function Yf(i){B0(i)&&i.close()}function Wn(i,e){return tl(i,[],e)}function ys(i){if(i)throw new Error("Proxy has been released and is not useable")}function Zf(i){return Fi(i,{type:"RELEASE"}).then(()=>{Yf(i)})}var ws=new WeakMap,vs="FinalizationRegistry"in globalThis&&new FinalizationRegistry(i=>{let e=(ws.get(i)||0)-1;ws.set(i,e),e===0&&Zf(i)});function X0(i,e){let t=(ws.get(e)||0)+1;ws.set(e,t),vs&&vs.register(i,e,i)}function W0(i){vs&&vs.unregister(i)}function tl(i,e=[],t=function(){}){let n=!1,r=new Proxy(t,{get(s,o){if(ys(n),o===$0)return()=>{W0(r),Zf(i),n=!0};if(o==="then"){if(e.length===0)return{then:()=>r};let a=Fi(i,{type:"GET",path:e.map(l=>l.toString())}).then(mi);return a.then.bind(a)}return tl(i,[...e,o])},set(s,o,a){ys(n);let[l,h]=xs(a);return Fi(i,{type:"SET",path:[...e,o].map(c=>c.toString()),value:l},h).then(mi)},apply(s,o,a){ys(n);let l=e[e.length-1];if(l===il)return Fi(i,{type:"ENDPOINT"}).then(mi);if(l==="bind")return tl(i,e.slice(0,-1));let[h,c]=Ff(a);return Fi(i,{type:"APPLY",path:e.map(f=>f.toString()),argumentList:h},c).then(mi)},construct(s,o){ys(n);let[a,l]=Ff(o);return Fi(i,{type:"CONSTRUCT",path:e.map(h=>h.toString()),argumentList:a},l).then(mi)}});return X0(r,i),r}function I0(i){return Array.prototype.concat.apply([],i)}function Ff(i){let e=i.map(xs);return[e.map(t=>t[0]),I0(e.map(t=>t[1]))]}var Jf=new WeakMap;function N0(i,e){return Jf.set(i,e),i}function j0(i){return Object.assign(i,{[Hf]:!0})}function xs(i){for(let[e,t]of gi)if(t.canHandle(i)){let[n,r]=t.serialize(i);return[{type:"HANDLER",name:e,value:n},r]}return[{type:"RAW",value:i},Jf.get(i)||[]]}function mi(i){switch(i.type){case"HANDLER":return gi.get(i.name).deserialize(i.value);case"RAW":return i.value}}function Fi(i,e,t){return new Promise(n=>{let r=z0();i.addEventListener("message",function s(o){!o.data||!o.data.id||o.data.id!==r||(i.removeEventListener("message",s),n(o.data))}),i.start&&i.start(),i.postMessage(Object.assign({id:r},e),t)})}function z0(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}var Hi=[],Ke=class{constructor(e){this.isRunning=!1;this.isDestroyed=!1;Hi.push(this),e?this.callbacks=e:this.callbacks={busyCallback:()=>{},idleCallback:()=>{},runningCallback:()=>{},finishedCallback:()=>{}}}running(){this.isRunning=!0,Hi.forEach(e=>e.callbacks.busyCallback()),this.callbacks.runningCallback()}finished(){this.isRunning=!1,this.callbacks.finishedCallback(),this.status().busy||Hi.forEach(e=>e.callbacks.idleCallback())}status(){let e=this.isRunning,t=this.isDestroyed,n=Hi.some(r=>r.isRunning);return{running:e,busy:n,destroyed:t}}destroy(){this.isDestroyed=!0;let e=Hi.indexOf(this);Hi.splice(e,1)}};var W=class i{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=en(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),Yi.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=en(this,e,t);let n=[];return this.decompose(e,t,n,0),Yi.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new bi(this),s=new bi(e);for(let o=t,a=t;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}iter(e=1){return new bi(this,e)}iterRange(e,t=this.length){return new Cs(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(t=this.lines+1);let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Rs(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?i.empty:e.length<=32?new Ne(e):Yi.from(Ne.split(e,[]))}},Ne=class i extends W{constructor(e,t=U0(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let s=0;;s++){let o=this.text[s],a=r+o.length;if((t?n:a)>=e)return new rl(r,a,n,o);r=a+1,n++}}decompose(e,t,n,r){let s=e<=0&&t>=this.length?this:new i(eu(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let o=n.pop(),a=Ps(s.text,o.text.slice(),0,s.length);if(a.length<=32)n.push(new i(a,o.length+s.length));else{let l=a.length>>1;n.push(new i(a.slice(0,l)),new i(a.slice(l)))}}else n.push(s)}replace(e,t,n){if(!(n instanceof i))return super.replace(e,t,n);[e,t]=en(this,e,t);let r=Ps(this.text,Ps(n.text,eu(this.text,0,e)),t),s=this.length+n.length-(t-e);return r.length<=32?new i(r,s):Yi.from(i.split(r,[]),s)}sliceString(e,t=this.length,n=` +`){[e,t]=en(this,e,t);let r="";for(let s=0,o=0;s<=t&&oe&&o&&(r+=n),es&&(r+=a.slice(Math.max(0,e-s),t-s)),s=l+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],r=-1;for(let s of e)n.push(s),r+=s.length+1,n.length==32&&(t.push(new i(n,r)),n=[],r=-1);return r>-1&&t.push(new i(n,r)),t}},Yi=class i extends W{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,r){for(let s=0;;s++){let o=this.children[s],a=r+o.length,l=n+o.lines-1;if((t?l:a)>=e)return o.lineInner(e,t,n,r);r=a+1,n=l+1}}decompose(e,t,n,r){for(let s=0,o=0;o<=t&&s=o){let h=r&((o<=e?1:0)|(l>=t?2:0));o>=e&&l<=t&&!h?n.push(a):a.decompose(e-o,t-o,n,h)}o=l+1}}replace(e,t,n){if([e,t]=en(this,e,t),n.lines=s&&t<=a){let l=o.replace(e-s,t-s,n),h=this.lines-o.lines+l.lines;if(l.lines>4&&l.lines>h>>6){let c=this.children.slice();return c[r]=l,new i(c,this.length-(t-e)+n.length)}return super.replace(s,a,l)}s=a+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n=` +`){[e,t]=en(this,e,t);let r="";for(let s=0,o=0;se&&s&&(r+=n),eo&&(r+=a.sliceString(e-o,t-o,n)),o=l+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof i))return 0;let n=0,[r,s,o,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,s+=t){if(r==o||s==a)return n;let l=this.children[r],h=e.children[s];if(l!=h)return n+l.scanIdentical(h,t);n+=l.length+1}}static from(e,t=e.reduce((n,r)=>n+r.length+1,-1)){let n=0;for(let d of e)n+=d.lines;if(n<32){let d=[];for(let m of e)m.flatten(d);return new Ne(d,t)}let r=Math.max(32,n>>5),s=r<<1,o=r>>1,a=[],l=0,h=-1,c=[];function f(d){let m;if(d.lines>s&&d instanceof i)for(let p of d.children)f(p);else d.lines>o&&(l>o||!l)?(u(),a.push(d)):d instanceof Ne&&l&&(m=c[c.length-1])instanceof Ne&&d.lines+m.lines<=32?(l+=d.lines,h+=d.length+1,c[c.length-1]=new Ne(m.text.concat(d.text),m.length+1+d.length)):(l+d.lines>r&&u(),l+=d.lines,h+=d.length+1,c.push(d))}function u(){l!=0&&(a.push(c.length==1?c[0]:i.from(c,h)),h=-1,l=c.length=0)}for(let d of e)f(d);return u(),a.length==1?a[0]:new i(a,t)}};W.empty=new Ne([""],0);function U0(i){let e=-1;for(let t of i)e+=t.length+1;return e}function Ps(i,e,t=0,n=1e9){for(let r=0,s=0,o=!0;s=t&&(l>n&&(a=a.slice(0,n-r)),r0?1:(e instanceof Ne?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],s=this.offsets[n],o=s>>1,a=r instanceof Ne?r.text.length:r.children.length;if(o==(t>0?a:0)){if(n==0)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=` +`,this;e--}else if(r instanceof Ne){let l=r.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,l.length>Math.max(0,e))return this.value=e==0?l:t>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=r.children[o+(t<0?-1:0)];e>l.length?(e-=l.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(l),this.offsets.push(t>0?1:(l instanceof Ne?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},Cs=class{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new bi(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}},Rs=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<"u"&&(W.prototype[Symbol.iterator]=function(){return this.iter()},bi.prototype[Symbol.iterator]=Cs.prototype[Symbol.iterator]=Rs.prototype[Symbol.iterator]=function(){return this});var rl=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}};function en(i,e,t){return e=Math.max(0,Math.min(i.length,e)),[e,Math.max(e,Math.min(i.length,t))]}var Zi="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(i=>i?parseInt(i,36):1);for(let i=1;ii)return Zi[e-1]<=i;return!1}function tu(i){return i>=127462&&i<=127487}var iu=8205;function ue(i,e,t=!0,n=!0){return(t?lu:H0)(i,e,n)}function lu(i,e,t){if(e==i.length)return e;e&&hu(i.charCodeAt(e))&&cu(i.charCodeAt(e-1))&&e--;let n=ce(i,e);for(e+=Ee(n);e=0&&tu(ce(i,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function H0(i,e,t){for(;e>0;){let n=lu(i,e-2,t);if(n=56320&&i<57344}function cu(i){return i>=55296&&i<56320}function ce(i,e){let t=i.charCodeAt(e);if(!cu(t)||e+1==i.length)return t;let n=i.charCodeAt(e+1);return hu(n)?(t-55296<<10)+(n-56320)+65536:t}function Fn(i){return i<=65535?String.fromCharCode(i):(i-=65536,String.fromCharCode((i>>10)+55296,(i&1023)+56320))}function Ee(i){return i<65536?1:2}var sl=/\r\n?|\n/,ge=function(i){return i[i.Simple=0]="Simple",i[i.TrackDel=1]="TrackDel",i[i.TrackBefore=2]="TrackBefore",i[i.TrackAfter=3]="TrackAfter",i}(ge||(ge={})),_t=class i{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return s+(e-r);s+=a}else{if(n!=ge.Simple&&h>=e&&(n==ge.TrackDel&&re||n==ge.TrackBefore&&re))return null;if(h>e||h==e&&t<0&&!a)return e==r||t<0?s:s+l;s+=l}r=h}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,t=e){for(let n=0,r=0;n=0&&r<=t&&a>=e)return rt?"cover":!0;r=a}return!1}toString(){let e="";for(let t=0;t=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new i(e)}static create(e){return new i(e)}},Ae=class i extends _t{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return ol(this,(t,n,r,s,o)=>e=e.replace(r,r+(n-t),o),!1),e}mapDesc(e,t=!1){return al(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let r=0,s=0;r=0){t[r]=a,t[r+1]=o;let l=r>>1;for(;n.length0&&Ft(n,t,s.text),s.forward(c),a+=c}let h=e[o++];for(;a>1].toJSON()))}return e}static of(e,t,n){let r=[],s=[],o=0,a=null;function l(c=!1){if(!c&&!r.length)return;ou||f<0||u>t)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${t})`);let m=d?typeof d=="string"?W.of(d.split(n||sl)):d:W.empty,p=m.length;if(f==u&&p==0)return;fo&&Se(r,f-o,-1),Se(r,u-f,p),Ft(s,r,m),o=u}}return h(e),l(!a),a}static empty(e){return new i(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let r=0;ra&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;n.length=0&&t<=0&&t==i[r+1]?i[r]+=e:e==0&&i[r]==0?i[r+1]+=t:n?(i[r]+=e,i[r+1]+=t):i.push(e,t)}function Ft(i,e,t){if(t.length==0)return;let n=e.length-2>>1;if(n>1])),!(t||o==i.sections.length||i.sections[o+1]<0);)a=i.sections[o++],l=i.sections[o++];e(r,h,s,c,f),r=h,s=c}}}function al(i,e,t,n=!1){let r=[],s=n?[]:null,o=new wi(i),a=new wi(e);for(let l=-1;;)if(o.ins==-1&&a.ins==-1){let h=Math.min(o.len,a.len);Se(r,h,-1),o.forward(h),a.forward(h)}else if(a.ins>=0&&(o.ins<0||l==o.i||o.off==0&&(a.len=0&&l=0){let h=0,c=o.len;for(;c;)if(a.ins==-1){let f=Math.min(c,a.len);h+=f,c-=f,a.forward(f)}else if(a.ins==0&&a.lenl||o.ins>=0&&o.len>l)&&(a||n.length>h),s.forward2(l),o.forward(l)}}}}var wi=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?W.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?W.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},Gi=class i{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let n,r;return this.empty?n=r=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),n==this.from&&r==this.to?this:new i(n,r,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return S.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return S.range(this.anchor,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return S.range(e.anchor,e.head)}static create(e,t,n){return new i(e,t,n)}},S=class i{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:i.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;ne.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new i(e.ranges.map(t=>Gi.fromJSON(t)),e.main)}static single(e,t=e){return new i([i.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,r=0;re?8:0)|s)}static normalized(e,t=0){let n=e[t];e.sort((r,s)=>r.from-s.from),t=e.indexOf(n);for(let r=1;rs.head?i.range(l,a):i.range(a,l))}}return new i(e,t)}};function uu(i,e){for(let t of i.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}var Ol=0,A=class i{constructor(e,t,n,r,s){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=Ol++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new i(e.combine||(t=>t),e.compareInput||((t,n)=>t===n),e.compare||(e.combine?(t,n)=>t===n:yl),!!e.static,e.enables)}of(e){return new Ji([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ji(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ji(e,this,2,t)}from(e,t){return t||(t=n=>n),this.compute([e],n=>t(n.field(e)))}};function yl(i,e){return i==e||i.length==e.length&&i.every((t,n)=>t===e[n])}var Ji=class{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=Ol++}dynamicSlot(e){var t;let n=this.value,r=this.facet.compareInput,s=this.id,o=e[s]>>1,a=this.type==2,l=!1,h=!1,c=[];for(let f of this.dependencies)f=="doc"?l=!0:f=="selection"?h=!0:((t=e[f.id])!==null&&t!==void 0?t:1)&1||c.push(e[f.id]);return{create(f){return f.values[o]=n(f),1},update(f,u){if(l&&u.docChanged||h&&(u.docChanged||u.selection)||ll(f,c)){let d=n(f);if(a?!nu(d,f.values[o],r):!r(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,m=u.config.address[s];if(m!=null){let p=Qs(u,m);if(this.dependencies.every(g=>g instanceof A?u.facet(g)===f.facet(g):g instanceof te?u.field(g,!1)==f.field(g,!1):!0)||(a?nu(d=n(f),p,r):r(d=n(f),p)))return f.values[o]=p,0}else d=n(f);return f.values[o]=d,1}}}};function nu(i,e,t){if(i.length!=e.length)return!1;for(let n=0;ni[l.id]),r=t.map(l=>l.type),s=n.filter(l=>!(l&1)),o=i[e.id]>>1;function a(l){let h=[];for(let c=0;cn===r),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(ru).find(n=>n.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:n=>(n.values[t]=this.create(n),1),update:(n,r)=>{let s=n.values[t],o=this.updateF(s,r);return this.compareF(s,o)?0:(n.values[t]=o,1)},reconfigure:(n,r)=>r.config.address[this.id]!=null?(n.values[t]=r.field(this),0):(n.values[t]=this.create(n),1)}}init(e){return[this,ru.of({field:this,create:e})]}get extension(){return this}},Oi={lowest:4,low:3,default:2,high:1,highest:0};function In(i){return e=>new Es(e,i)}var Qe={highest:In(Oi.highest),high:In(Oi.high),default:In(Oi.default),low:In(Oi.low),lowest:In(Oi.lowest)},Es=class{constructor(e,t){this.inner=e,this.prec=t}},Dt=class i{of(e){return new jn(this,e)}reconfigure(e){return i.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}},jn=class{constructor(e,t){this.compartment=e,this.inner=t}},As=class i{constructor(e,t,n,r,s,o){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,n){let r=[],s=Object.create(null),o=new Map;for(let u of Y0(e,t,o))u instanceof te?r.push(u):(s[u.facet.id]||(s[u.facet.id]=[])).push(u);let a=Object.create(null),l=[],h=[];for(let u of r)a[u.id]=h.length<<1,h.push(d=>u.slot(d));let c=n?.config.facets;for(let u in s){let d=s[u],m=d[0].facet,p=c&&c[u]||[];if(d.every(g=>g.type==0))if(a[m.id]=l.length<<1|1,yl(p,d))l.push(n.facet(m));else{let g=m.combine(d.map(O=>O.value));l.push(n&&m.compare(g,n.facet(m))?n.facet(m):g)}else{for(let g of d)g.type==0?(a[g.id]=l.length<<1|1,l.push(g.value)):(a[g.id]=h.length<<1,h.push(O=>g.dynamicSlot(O)));a[m.id]=h.length<<1,h.push(g=>G0(g,m,d))}}let f=h.map(u=>u(a));return new i(e,o,f,a,l,s)}};function Y0(i,e,t){let n=[[],[],[],[],[]],r=new Map;function s(o,a){let l=r.get(o);if(l!=null){if(l<=a)return;let h=n[l].indexOf(o);h>-1&&n[l].splice(h,1),o instanceof jn&&t.delete(o.compartment)}if(r.set(o,a),Array.isArray(o))for(let h of o)s(h,a);else if(o instanceof jn){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),s(h,a)}else if(o instanceof Es)s(o.inner,o.prec);else if(o instanceof te)n[a].push(o),o.provides&&s(o.provides,a);else if(o instanceof Ji)n[a].push(o),o.facet.extensions&&s(o.facet.extensions,Oi.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(h,a)}}return s(i,Oi.default),n.reduce((o,a)=>o.concat(a))}function Nn(i,e){if(e&1)return 2;let t=e>>1,n=i.status[t];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;i.status[t]=4;let r=i.computeSlot(i,i.config.dynamicSlots[t]);return i.status[t]=2|r}function Qs(i,e){return e&1?i.config.staticValues[e>>1]:i.values[e>>1]}var du=A.define(),hl=A.define({combine:i=>i.some(e=>e),static:!0}),pu=A.define({combine:i=>i.length?i[0]:void 0,static:!0}),mu=A.define(),gu=A.define(),Ou=A.define(),yu=A.define({combine:i=>i.length?i[0]:!1}),Le=class{constructor(e,t){this.type=e,this.value=t}static define(){return new cl}},cl=class{of(e){return new Le(this,e)}},fl=class{constructor(e){this.map=e}of(e){return new _(this,e)}},_=class i{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new i(this.type,t)}is(e){return this.type==e}static define(e={}){return new fl(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let s=r.map(t);s&&n.push(s)}return n}};_.reconfigure=_.define();_.appendConfig=_.define();var fe=class i{constructor(e,t,n,r,s,o){this.startState=e,this.changes=t,this.selection=n,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,n&&uu(n,t.newLength),s.some(a=>a.type==i.time)||(this.annotations=s.concat(i.time.of(Date.now())))}static create(e,t,n,r,s,o){return new i(e,t,n,r,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(i.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}};fe.time=Le.define();fe.userEvent=Le.define();fe.addToHistory=Le.define();fe.remote=Le.define();function Z0(i,e){let t=[];for(let n=0,r=0;;){let s,o;if(n=i[n]))s=i[n++],o=i[n++];else if(r=0;r--){let s=n[r](i);s instanceof fe?i=s:Array.isArray(s)&&s.length==1&&s[0]instanceof fe?i=s[0]:i=wu(e,Ki(s),!1)}return i}function K0(i){let e=i.startState,t=e.facet(Ou),n=i;for(let r=t.length-1;r>=0;r--){let s=t[r](i);s&&Object.keys(s).length&&(n=bu(n,ul(e,s,i.changes.newLength),!0))}return n==i?i:fe.create(e,i.changes,i.selection,n.effects,n.annotations,n.scrollIntoView)}var ey=[];function Ki(i){return i==null?ey:Array.isArray(i)?i:[i]}var F=function(i){return i[i.Word=0]="Word",i[i.Space=1]="Space",i[i.Other=2]="Other",i}(F||(F={})),ty=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,dl;try{dl=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function iy(i){if(dl)return dl.test(i);for(let e=0;e"\x80"&&(t.toUpperCase()!=t.toLowerCase()||ty.test(t)))return!0}return!1}function ny(i){return e=>{if(!/\S/.test(e))return F.Space;if(iy(e))return F.Word;for(let t=0;t-1)return F.Word;return F.Other}}var N=class i{constructor(e,t,n,r,s,o){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let a=0;ar.set(h,l)),t=null),r.set(a.value.compartment,a.value.extension)):a.is(_.reconfigure)?(t=null,n=a.value):a.is(_.appendConfig)&&(t=null,n=Ki(n).concat(a.value));let s;t?s=e.startState.values.slice():(t=As.resolve(n,r,this),s=new i(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(l,h)=>h.reconfigure(l,this),null).values);let o=e.startState.facet(hl)?e.newSelection:e.newSelection.asSingle();new i(t,e.newDoc,o,s,(a,l)=>l.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:S.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),s=[n.range],o=Ki(n.effects);for(let a=1;ao.spec.fromJSON(a,l)))}}return i.create({doc:e.doc,selection:S.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=As.resolve(e.extensions||[],new Map),n=e.doc instanceof W?e.doc:W.of((e.doc||"").split(t.staticFacet(i.lineSeparator)||sl)),r=e.selection?e.selection instanceof S?e.selection:S.single(e.selection.anchor,e.selection.head):S.single(0);return uu(r,n.length),t.staticFacet(hl)||(r=r.asSingle()),new i(t,n,r,t.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(i.tabSize)}get lineBreak(){return this.facet(i.lineSeparator)||` +`}get readOnly(){return this.facet(yu)}phrase(e,...t){for(let n of this.facet(i.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(n,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>t.length?n:t[s-1]})),e}languageDataAt(e,t,n=-1){let r=[];for(let s of this.facet(du))for(let o of s(this,t,n))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){return ny(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-n,a=e-n;for(;o>0;){let l=ue(t,o,!1);if(s(t.slice(l,o))!=F.Word)break;o=l}for(;ai.length?i[0]:4});N.lineSeparator=pu;N.readOnly=yu;N.phrases=A.define({compare(i,e){let t=Object.keys(i),n=Object.keys(e);return t.length==n.length&&t.every(r=>i[r]==e[r])}});N.languageData=du;N.changeFilter=mu;N.transactionFilter=gu;N.transactionExtender=Ou;Dt.reconfigure=_.define();function Te(i,e,t={}){let n={};for(let r of i)for(let s of Object.keys(r)){let o=r[s],a=n[s];if(a===void 0)n[s]=o;else if(!(a===o||o===void 0))if(Object.hasOwnProperty.call(t,s))n[s]=t[s](a,o);else throw new Error("Config merge conflict for field "+s)}for(let r in e)n[r]===void 0&&(n[r]=e[r]);return n}var at=class{eq(e){return this==e}range(e,t=e){return zn.create(e,t,this)}};at.prototype.startSide=at.prototype.endSide=0;at.prototype.point=!1;at.prototype.mapMode=ge.TrackDel;var zn=class i{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new i(e,t,n)}};function pl(i,e){return i.from-e.from||i.value.startSide-e.value.startSide}var ml=class i{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let s=n?this.to:this.from;for(let o=r,a=s.length;;){if(o==a)return o;let l=o+a>>1,h=s[l]-e||(n?this.value[l].endSide:this.value[l].startSide)-t;if(l==o)return h>=0?o:a;h>=0?a=l:o=l+1}}between(e,t,n,r){for(let s=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,s);sd||u==d&&h.startSide>0&&h.endSide<=0)continue;(d-u||h.endSide-h.startSide)<0||(o<0&&(o=u),h.point&&(a=Math.max(a,d-u)),n.push(h),r.push(u-o),s.push(d-o))}return{mapped:n.length?new i(r,s,n,a):null,pos:o}}},j=class i{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(e,t,n,r){return new i(e,t,n,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:r=0,filterTo:s=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(n&&(t=t.slice().sort(pl)),this.isEmpty)return t.length?i.of(t):this;let a=new Ms(this,null,-1).goto(0),l=0,h=[],c=new lt;for(;a.value||l=0){let f=t[l++];c.addInner(f.from,f.to,f.value)||h.push(f)}else a.rangeIndex==1&&a.chunkIndexthis.chunkEnd(a.chunkIndex)||sa.to||s=s&&e<=s+o.length&&o.between(s,e-s,t-s,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return Un.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Un.from(e).goto(t)}static compare(e,t,n,r,s=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),a=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),l=su(o,a,n),h=new yi(o,l,s),c=new yi(a,l,s);n.iterGaps((f,u,d)=>ou(h,f,c,u,d,r)),n.empty&&n.length==0&&ou(h,0,c,0,0,r)}static eq(e,t,n=0,r){r==null&&(r=999999999);let s=e.filter(c=>!c.isEmpty&&t.indexOf(c)<0),o=t.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let a=su(s,o),l=new yi(s,a,0).goto(n),h=new yi(o,a,0).goto(n);for(;;){if(l.to!=h.to||!gl(l.active,h.active)||l.point&&(!h.point||!l.point.eq(h.point)))return!1;if(l.to>r)return!0;l.next(),h.next()}}static spans(e,t,n,r,s=-1){let o=new yi(e,null,s).goto(t),a=t,l=o.openStart;for(;;){let h=Math.min(o.to,n);if(o.point){let c=o.activeForPoint(o.to),f=o.pointFroma&&(r.span(a,h,o.active,l),l=o.openEnd(h));if(o.to>n)return l+(o.point&&o.to>n?1:0);a=o.to,o.next()}}static of(e,t=!1){let n=new lt;for(let r of e instanceof zn?[e]:t?ry(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(e){if(!e.length)return i.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let r=e[n];r!=i.empty;r=r.nextLayer)t=new i(r.chunkPos,r.chunk,t,Math.max(r.maxPoint,t.maxPoint));return t}};j.empty=new j([],[],null,-1);function ry(i){if(i.length>1)for(let e=i[0],t=1;t0)return i.slice().sort(pl);e=n}return i}j.empty.nextLayer=j.empty;var lt=class i{finishChunk(e){this.chunks.push(new ml(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new i)).add(e,t,n)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(j.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=j.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}};function su(i,e,t){let n=new Map;for(let s of i)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=n&&r.push(new Ms(o,t,n,s));return r.length==1?r[0]:new i(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let n=this.heap.length>>1;n>=0;n--)nl(this.heap,n);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let n=this.heap.length>>1;n>=0;n--)nl(this.heap,n);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),nl(this.heap,0)}}};function nl(i,e){for(let t=i[e];;){let n=(e<<1)+1;if(n>=i.length)break;let r=i[n];if(n+1=0&&(r=i[n+1],n++),t.compare(r)<0)break;i[n]=t,i[e]=r,e=n}}var yi=class{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Un.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Ss(this.active,e),Ss(this.activeTo,e),Ss(this.activeRank,e),this.minActive=au(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:s}=this.cursor;for(;t0;)t++;Ts(this.active,t,n),Ts(this.activeTo,t,r),Ts(this.activeRank,t,s),e&&Ts(e,t,this.cursor.from),this.minActive=au(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&Ss(n,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&n[r]=0&&!(this.activeRank[n]e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}};function ou(i,e,t,n,r,s){i.goto(e),t.goto(n);let o=n+r,a=n,l=n-e;for(;;){let h=i.to+l-t.to||i.endSide-t.endSide,c=h<0?i.to+l:t.to,f=Math.min(c,o);if(i.point||t.point?i.point&&t.point&&(i.point==t.point||i.point.eq(t.point))&&gl(i.activeForPoint(i.to),t.activeForPoint(t.to))||s.comparePoint(a,f,i.point,t.point):f>a&&!gl(i.active,t.active)&&s.compareRange(a,f,i.active,t.active),c>o)break;a=c,h<=0&&i.next(),h>=0&&t.next()}}function gl(i,e){if(i.length!=e.length)return!1;for(let t=0;t=e;n--)i[n+1]=i[n];i[e]=t}function au(i,e){let t=-1,n=1e9;for(let r=0;r=e)return r;if(r==i.length)break;s+=i.charCodeAt(r)==9?t-s%t:1,r=ue(i,r)}return n===!0?-1:i.length}var bl="\u037C",vu=typeof Symbol>"u"?"__"+bl:Symbol.for(bl),wl=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),xu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},et=class{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,a,l,h){let c=[],f=/^@(\w+)\b/.exec(o[0]),u=f&&f[1]=="keyframes";if(f&&a==null)return l.push(o[0]+";");for(let d in a){let m=a[d];if(/&/.test(d))s(d.split(/,\s*/).map(p=>o.map(g=>p.replace(/&/,g))).reduce((p,g)=>p.concat(g)),m,l);else if(m&&typeof m=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");s(r(d),m,c,u)}else m!=null&&c.push(d.replace(/_.*/,"").replace(/[A-Z]/g,p=>"-"+p.toLowerCase())+": "+m+";")}(c.length||u)&&l.push((n&&!f&&!h?o.map(n):o).join(", ")+" {"+c.join(" ")+"}")}for(let o in e)s(r(o),e[o],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let e=xu[vu]||1;return xu[vu]=e+1,bl+e.toString(36)}static mount(e,t,n){let r=e[wl],s=n&&n.nonce;r?s&&r.setNonce(s):r=new vl(e,s),r.mount(Array.isArray(t)?t:[t],e)}},ku=new Map,vl=class{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let s=ku.get(n);if(s)return e[wl]=s;this.sheet=new r.CSSStyleSheet,ku.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[wl]=this}mount(e,t){let n=this.sheet,r=0,s=0;for(let o=0;o-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,a),n)for(let h=0;h",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},sy=typeof navigator<"u"&&/Mac/.test(navigator.platform),oy=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(de=0;de<10;de++)Vt[48+de]=Vt[96+de]=String(de);var de;for(de=1;de<=24;de++)Vt[de+111]="F"+de;var de;for(de=65;de<=90;de++)Vt[de]=String.fromCharCode(de+32),tn[de]=String.fromCharCode(de);var de;for(Ds in Vt)tn.hasOwnProperty(Ds)||(tn[Ds]=Vt[Ds]);var Ds;function Su(i){var e=sy&&i.metaKey&&i.shiftKey&&!i.ctrlKey&&!i.altKey||oy&&i.shiftKey&&i.key&&i.key.length==1||i.key=="Unidentified",t=!e&&i.key||(i.shiftKey?tn:Vt)[i.keyCode]||i.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function ar(i){let e;return i.nodeType==11?e=i.getSelection?i:i.ownerDocument:e=i,e.getSelection()}function El(i,e){return e?i==e||i.contains(e.nodeType!=1?e.parentNode:e):!1}function ay(i){let e=i.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function js(i,e){if(!e.anchorNode)return!1;try{return El(i,e.anchorNode)}catch{return!1}}function lr(i){return i.nodeType==3?ki(i,0,i.nodeValue.length).getClientRects():i.nodeType==1?i.getClientRects():[]}function er(i,e,t,n){return t?Tu(i,e,t,n,-1)||Tu(i,e,t,n,1):!1}function xi(i){for(var e=0;;e++)if(i=i.previousSibling,!i)return e}function Ys(i){return i.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(i.nodeName)}function Tu(i,e,t,n,r){for(;;){if(i==t&&e==n)return!0;if(e==(r<0?0:Lt(i))){if(i.nodeName=="DIV")return!1;let s=i.parentNode;if(!s||s.nodeType!=1)return!1;e=xi(i)+(r<0?0:1),i=s}else if(i.nodeType==1){if(i=i.childNodes[e+(r<0?-1:0)],i.nodeType==1&&i.contentEditable=="false")return!1;e=r<0?Lt(i):0}else return!1}}function Lt(i){return i.nodeType==3?i.nodeValue.length:i.childNodes.length}function yh(i,e){let t=e?i.left:i.right;return{left:t,right:t,top:i.top,bottom:i.bottom}}function ly(i){let e=i.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:i.innerWidth,top:0,bottom:i.innerHeight}}function fd(i,e){let t=e.width/i.offsetWidth,n=e.height/i.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-i.offsetWidth)<1)&&(t=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-i.offsetHeight)<1)&&(n=1),{scaleX:t,scaleY:n}}function hy(i,e,t,n,r,s,o,a){let l=i.ownerDocument,h=l.defaultView||window;for(let c=i,f=!1;c&&!f;)if(c.nodeType==1){let u,d=c==l.body,m=1,p=1;if(d)u=ly(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(f=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let y=c.getBoundingClientRect();({scaleX:m,scaleY:p}=fd(c,y)),u={left:y.left,right:y.left+c.clientWidth*m,top:y.top,bottom:y.top+c.clientHeight*p}}let g=0,O=0;if(r=="nearest")e.top0&&e.bottom>u.bottom+O&&(O=e.bottom-u.bottom+O+o)):e.bottom>u.bottom&&(O=e.bottom-u.bottom+o,t<0&&e.top-O0&&e.right>u.right+g&&(g=e.right-u.right+g+s)):e.right>u.right&&(g=e.right-u.right+s,t<0&&e.leftt.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.assignedSlot||t.parentNode}else if(t.nodeType==11)t=t.host;else break;return null}var Al=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?Lt(t):0),n,Math.min(e.focusOffset,n?Lt(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}},nn=null;function ud(i){if(i.setActive)return i.setActive();if(nn)return i.focus(nn);let e=[];for(let t=i;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(i.focus(nn==null?{get preventScroll(){return nn={preventScroll:!0},!0}}:void 0),!nn){nn=!1;for(let t=0;tMath.max(1,i.scrollHeight-i.clientHeight-4)}function md(i,e){for(let t=i,n=e;;){if(t.nodeType==3&&n>0)return{node:t,offset:n};if(t.nodeType==1&&n>0){if(t.contentEditable=="false")return null;t=t.childNodes[n-1],n=Lt(t)}else if(t.parentNode&&!Ys(t))n=xi(t),t=t.parentNode;else return null}}function gd(i,e){for(let t=i,n=e;;){if(t.nodeType==3&&nt)return f.domBoundsAround(e,t,h);if(u>=e&&r==-1&&(r=l,s=h),h>t&&f.dom.parentNode==this.dom){o=l,a=c;break}c=u,h=u+f.breakAfter}return{from:s,to:a<0?n+this.length:a,startDOM:(r?this.children[r-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,n=bh){this.markDirty();for(let r=e;rthis.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}};function Od(i,e,t,n,r,s,o,a,l){let{children:h}=i,c=h.length?h[e]:null,f=s.length?s[s.length-1]:null,u=f?f.breakAfter:o;if(!(e==n&&c&&!o&&!u&&s.length<2&&c.merge(t,r,s.length?f:null,t==0,a,l))){if(n0&&(!o&&s.length&&c.merge(t,c.length,s[0],!1,a,0)?c.breakAfter=s.shift().breakAfter:(t2),Q={mac:Au||/Mac/.test(qe.platform),windows:/Win/.test(qe.platform),linux:/Linux|X11/.test(qe.platform),ie:fo,ie_version:bd?Ql.documentMode||6:_l?+_l[1]:Ml?+Ml[1]:0,gecko:Ru,gecko_version:Ru?+(/Firefox\/(\d+)/.exec(qe.userAgent)||[0,0])[1]:0,chrome:!!xl,chrome_version:xl?+xl[1]:0,ios:Au,android:/Android\b/.test(qe.userAgent),webkit:Eu,safari:wd,webkit_version:Eu?+(/\bAppleWebKit\/(\d+)/.exec(qe.userAgent)||[0,0])[1]:0,tabSize:Ql.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"},dy=256,vt=class i extends J{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,n){return this.flags&8||n&&(!(n instanceof i)||this.length-(t-e)+n.length>dy||n.flags&8)?!1:(this.text=this.text.slice(0,e)+(n?n.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new i(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new Me(this.dom,e)}domBoundsAround(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return py(this.dom,e,t)}},Zt=class i extends J{constructor(e,t=[],n=0){super(),this.mark=e,this.children=t,this.length=n;for(let r of t)r.setParent(this)}setAttrs(e){if(dd(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,n,r,s,o){return n&&(!(n instanceof i&&n.mark.eq(this.mark))||e&&s<=0||te&&t.push(n=e&&(r=s),n=l,s++}let o=this.length-e;return this.length=e,r>-1&&(this.children.length=r,this.markDirty()),new i(this.mark,t,o)}domAtPos(e){return vd(this,e)}coordsAt(e,t){return kd(this,e,t)}};function py(i,e,t){let n=i.nodeValue.length;e>n&&(e=n);let r=e,s=e,o=0;e==0&&t<0||e==n&&t>=0?Q.chrome||Q.gecko||(e?(r--,o=1):s=0)?0:a.length-1];return Q.safari&&!o&&l.width==0&&(l=Array.prototype.find.call(a,h=>h.width)||l),o?yh(l,o<0):l||null}var hr=class i extends J{static create(e,t,n){return new i(e,t,n)}constructor(e,t,n){super(),this.widget=e,this.length=t,this.side=n,this.prevWidget=null}split(e){let t=i.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,n,r,s,o){return n&&(!(n instanceof i)||!this.widget.compare(n.widget)||e>0&&s<=0||t0)?Me.before(this.dom):Me.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);if(n)return n;let r=this.dom.getClientRects(),s=null;if(!r.length)return null;let o=this.side?this.side<0:e>0;for(let a=o?r.length-1:0;s=r[a],!(e>0?a==0:a==r.length-1||s.top0?Me.before(this.dom):Me.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return W.empty}get isHidden(){return!0}};vt.prototype.children=hr.prototype.children=cr.prototype.children=bh;function vd(i,e){let t=i.dom,{children:n}=i,r=0;for(let s=0;rs&&e0;s--){let o=n[s-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let s=r;s0&&e instanceof Zt&&r.length&&(n=r[r.length-1])instanceof Zt&&n.mark.eq(e.mark)?xd(n,e.children[0],t-1):(r.push(e),e.setParent(i)),i.length+=e.length}function kd(i,e,t){let n=null,r=-1,s=null,o=-1;function a(h,c){for(let f=0,u=0;f=c&&(d.children.length?a(d,c-u):(!s||s.isHidden&&t>0)&&(m>c||u==m&&d.getSide()>0)?(s=d,o=c-u):(u-1?1:0)!=r.length-(t&&r.indexOf(t)>-1?1:0))return!1;for(let s of n)if(s!=t&&(r.indexOf(s)==-1||i[s]!==e[s]))return!1;return!0}function $l(i,e,t){let n=!1;if(e)for(let r in e)t&&r in t||(n=!0,r=="style"?i.style.cssText="":i.removeAttribute(r));if(t)for(let r in t)e&&e[r]==t[r]||(n=!0,r=="style"?i.style.cssText=t[r]:i.setAttribute(r,t[r]));return n}function gy(i){let e=Object.create(null);for(let t=0;t0&&this.children[n-1].length==0;)this.children[--n].destroy();return this.children.length=n,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){Js(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){xd(this,e,t)}addLineDeco(e){let t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=Dl(t,this.attrs||{})),n&&(this.attrs=Dl({class:n},this.attrs||{}))}domAtPos(e){return vd(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var n;this.dom?this.flags&4&&(dd(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&($l(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let r=this.dom.lastChild;for(;r&&J.get(r)instanceof Zt;)r=r.lastChild;if(!r||!this.length||r.nodeName!="BR"&&((n=J.get(r))===null||n===void 0?void 0:n.isEditable)==!1&&(!Q.ios||!this.children.some(s=>s instanceof vt))){let s=document.createElement("BR");s.cmIgnore=!0,this.dom.appendChild(s)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let n of this.children){if(!(n instanceof vt)||/[^ -~]/.test(n.text))return null;let r=lr(n.dom);if(r.length!=1)return null;e+=r[0].width,t=r[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let n=kd(this,e,t);if(!this.children.length&&n&&this.parent){let{heightOracle:r}=this.parent.view.viewState,s=n.bottom-n.top;if(Math.abs(s-r.lineHeight)<2&&r.textHeight=t){if(s instanceof i)return s;if(o>t)break}r=o+s.breakAfter}return null}},vi=class i extends J{constructor(e,t,n){super(),this.widget=e,this.length=t,this.deco=n,this.breakAfter=0,this.prevWidget=null}merge(e,t,n,r,s,o){return n&&(!(n instanceof i)||!this.widget.compare(n.widget)||e>0&&s<=0||t0}},Be=class{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}},_e=function(i){return i[i.Text=0]="Text",i[i.WidgetBefore=1]="WidgetBefore",i[i.WidgetAfter=2]="WidgetAfter",i[i.WidgetRange=3]="WidgetRange",i}(_e||(_e={})),M=class extends at{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new fr(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new Jt(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:s,end:o}=Sd(e,t);n=(s?t?-3e8:-1:5e8)-1,r=(o?t?2e8:1:-6e8)+1}return new Jt(e,n,r,t,e.widget||null,!0)}static line(e){return new ur(e)}static set(e,t=!1){return j.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};M.none=j.empty;var fr=class i extends M{constructor(e){let{start:t,end:n}=Sd(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,n;return this==e||e instanceof i&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((n=e.attrs)===null||n===void 0?void 0:n.class))&&Js(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}};fr.prototype.point=!1;var ur=class i extends M{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof i&&this.spec.class==e.spec.class&&Js(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}};ur.prototype.mapMode=ge.TrackBefore;ur.prototype.point=!0;var Jt=class i extends M{constructor(e,t,n,r,s,o){super(t,n,s,e),this.block=r,this.isReplace=o,this.mapMode=r?t<=0?ge.TrackBefore:ge.TrackAfter:ge.TrackDel}get type(){return this.startSide!=this.endSide?_e.WidgetRange:this.startSide<=0?_e.WidgetBefore:_e.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof i&&Oy(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}};Jt.prototype.point=!0;function Sd(i,e=!1){let{inclusiveStart:t,inclusiveEnd:n}=i;return t==null&&(t=i.inclusive),n==null&&(n=i.inclusive),{start:t??e,end:n??e}}function Oy(i,e){return i==e||!!(i&&e&&i.compare(e))}function Vl(i,e,t,n=0){let r=t.length-1;r>=0&&t[r]+n>=i?t[r]=Math.max(t[r],e):t.push(i,e)}var tr=class i{constructor(e,t,n,r){this.doc=e,this.pos=t,this.end=n,this.disallowBlockEffectsFor=r,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof vi&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new be),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append($s(new cr(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof vi)&&this.getLine()}buildText(e,t,n){for(;e>0;){if(this.textOff==this.text.length){let{value:s,lineBreak:o,done:a}=this.cursor.next(this.skip);if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=s,this.textOff=0}let r=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-n)),this.getLine().append($s(new vt(this.text.slice(this.textOff,this.textOff+r)),t),n),this.atCursorPos=!0,this.textOff+=r,e-=r,n=0}}span(e,t,n,r){this.buildText(t-e,n,r),this.pos=t,this.openStart<0&&(this.openStart=r)}point(e,t,n,r,s,o){if(this.disallowBlockEffectsFor[o]&&n instanceof Jt){if(n.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let a=t-e;if(n instanceof Jt)if(n.block)n.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new vi(n.widget||Kt.block,a,n));else{let l=hr.create(n.widget||Kt.inline,a,a?0:n.startSide),h=this.atCursorPos&&!l.isEditable&&s<=r.length&&(e0),c=!l.isEditable&&(er.length||n.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!h&&!l.isEditable&&(this.pendingBuffer=0),this.flushBuffer(r),h&&(f.append($s(new cr(1),r),s),s=r.length+Math.max(0,s-r.length)),f.append($s(l,r),s),this.atCursorPos=c,this.pendingBuffer=c?er.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=r.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);a&&(this.textOff+a<=this.text.length?this.textOff+=a:(this.skip+=a-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=s)}static build(e,t,n,r,s){let o=new i(e,t,n,s);return o.openEnd=j.spans(r,t,n,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}};function $s(i,e){for(let t of e)i=new Zt(t,[i],i.length);return i}var Kt=class extends Be{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}};Kt.inline=new Kt("span");Kt.block=new Kt("div");var H=function(i){return i[i.LTR=0]="LTR",i[i.RTL=1]="RTL",i}(H||(H={})),Si=H.LTR,wh=H.RTL;function Td(i){let e=[];for(let t=0;t=t){if(a.level==n)return o;(s<0||(r!=0?r<0?a.fromt:e[s].level>a.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}};function Cd(i,e){if(i.length!=e.length)return!1;for(let t=0;t=0;p-=3)if(Ot[p+1]==-d){let g=Ot[p+2],O=g&2?r:g&4?g&1?s:r:0;O&&(Y[f]=Y[Ot[p]]=O),a=p;break}}else{if(Ot.length==189)break;Ot[a++]=f,Ot[a++]=u,Ot[a++]=l}else if((m=Y[f])==2||m==1){let p=m==r;l=p?0:1;for(let g=a-3;g>=0;g-=3){let O=Ot[g+2];if(O&2)break;if(p)Ot[g+2]|=2;else{if(O&4)break;Ot[g+2]|=4}}}}}function ky(i,e,t,n){for(let r=0,s=n;r<=t.length;r++){let o=r?t[r-1].to:i,a=rl;)m==g&&(m=t[--p].from,g=p?t[p-1].to:i),Y[--m]=d;l=c}else s=h,l++}}}function ql(i,e,t,n,r,s,o){let a=n%2?2:1;if(n%2==r%2)for(let l=e,h=0;ll&&o.push(new bt(l,p.from,d));let g=p.direction==Si!=!(d%2);Bl(i,g?n+1:n,r,p.inner,p.from,p.to,o),l=p.to}m=p.to}else{if(m==t||(c?Y[m]!=a:Y[m]==a))break;m++}u?ql(i,l,m,n+1,r,u,o):le;){let c=!0,f=!1;if(!h||l>s[h-1].to){let p=Y[l-1];p!=a&&(c=!1,f=p==16)}let u=!c&&a==1?[]:null,d=c?n:n+1,m=l;e:for(;;)if(h&&m==s[h-1].to){if(f)break e;let p=s[--h];if(!c)for(let g=p.from,O=h;;){if(g==e)break e;if(O&&s[O-1].to==g)g=s[--O].from;else{if(Y[g-1]==a)break e;break}}if(u)u.push(p);else{p.toY.length;)Y[Y.length]=256;let n=[],r=e==Si?0:1;return Bl(i,r,r,t,0,i.length,n),n}function Rd(i){return[new bt(0,i,0)]}var Ed="";function Ty(i,e,t,n,r){var s;let o=n.head-i.from,a=bt.find(e,o,(s=n.bidiLevel)!==null&&s!==void 0?s:-1,n.assoc),l=e[a],h=l.side(r,t);if(o==h){let u=a+=r?1:-1;if(u<0||u>=e.length)return null;l=e[a=u],o=l.side(!r,t),h=l.side(r,t)}let c=ue(i.text,o,l.forward(r,t));(cl.to)&&(c=h),Ed=i.text.slice(Math.min(o,c),Math.max(o,c));let f=a==(r?e.length-1:0)?null:e[a+(r?1:-1)];return f&&c==h&&f.level+(r?0:1)i.some(e=>e)}),Ld=A.define({combine:i=>i.some(e=>e)}),qd=A.define(),ir=class i{constructor(e,t="nearest",n="nearest",r=5,s=5,o=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new i(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new i(S.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},Vs=_.define({map:(i,e)=>i.map(e)}),Bd=_.define();function we(i,e,t){let n=i.facet(_d);n.length?n[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}var Ht=A.define({combine:i=>i.length?i[0]:!0}),Cy=0,Gn=A.define(),re=class i{constructor(e,t,n,r,s){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.extension=s(this)}static define(e,t){let{eventHandlers:n,eventObservers:r,provide:s,decorations:o}=t||{};return new i(Cy++,e,n,r,a=>{let l=[Gn.of(a)];return o&&l.push(dr.of(h=>{let c=h.plugin(a);return c?o(c):M.none})),s&&l.push(s(a)),l})}static fromClass(e,t){return i.define(n=>new e(n),t)}},nr=class{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(n){if(we(t.state,n,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){we(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(n){we(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}},Xd=A.define(),vh=A.define(),dr=A.define(),Wd=A.define(),xh=A.define(),Id=A.define();function Mu(i,e){let t=i.state.facet(Id);if(!t.length)return t;let n=t.map(s=>s instanceof Function?s(i):s),r=[];return j.spans(n,e.from,e.to,{point(){},span(s,o,a,l){let h=s-e.from,c=o-e.from,f=r;for(let u=a.length-1;u>=0;u--,l--){let d=a[u].spec.bidiIsolate,m;if(d==null&&(d=Py(e.text,h,c)),l>0&&f.length&&(m=f[f.length-1]).to==h&&m.direction==d)m.to=c,f=m.inner;else{let p={from:h,to:c,direction:d,inner:[]};f.push(p),f=p.inner}}}}),r}var Nd=A.define();function jd(i){let e=0,t=0,n=0,r=0;for(let s of i.state.facet(Nd)){let o=s(i);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(n=Math.max(n,o.top)),o.bottom!=null&&(r=Math.max(r,o.bottom)))}return{left:e,right:t,top:n,bottom:r}}var Yn=A.define(),wt=class i{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(e){return new i(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toAc)break;s+=2}if(!l)return n;new i(l.fromA,l.toA,l.fromB,l.toB).addToSet(n),o=l.toA,a=l.toB}}},Ks=class i{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=Ae.empty(this.startState.doc.length);for(let s of n)this.changes=this.changes.compose(s.changes);let r=[];this.changes.iterChangedRanges((s,o,a,l)=>r.push(new wt(s,o,a,l))),this.changedRanges=r}static create(e,t,n){return new i(e,t,n)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}},eo=class extends J{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=M.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new be],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new wt(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:h,toA:c})=>cthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?r=this.domChanged.newSel.head:!Dy(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let s=r>-1?Ey(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:h,to:c}=this.hasComposition;n=new wt(h,c,e.changes.mapPos(h,-1),e.changes.mapPos(c,1)).addToSet(n.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(Q.ie||Q.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,a=this.updateDeco(),l=My(o,a,e.changes);return n=wt.extendWithRanges(n,l),!(this.flags&7)&&n.length==0?!1:(this.updateInner(n,e.startState.doc.length,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,n){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,n);let{observer:r}=this.view;r.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=Q.chrome||Q.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||r.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let s=[];if(this.view.viewport.from||this.view.viewport.to=0?r[o]:null;if(!a)break;let{fromA:l,toA:h,fromB:c,toB:f}=a,u,d,m,p;if(n&&n.range.fromBc){let x=tr.build(this.view.state.doc,c,n.range.fromB,this.decorations,this.dynamicDecorationMap),w=tr.build(this.view.state.doc,n.range.toB,f,this.decorations,this.dynamicDecorationMap);d=x.breakAtStart,m=x.openStart,p=w.openEnd;let P=this.compositionView(n);w.breakAtStart?P.breakAfter=1:w.content.length&&P.merge(P.length,P.length,w.content[0],!1,w.openStart,0)&&(P.breakAfter=w.content[0].breakAfter,w.content.shift()),x.content.length&&P.merge(0,0,x.content[x.content.length-1],!0,0,x.openEnd)&&x.content.pop(),u=x.content.concat(P).concat(w.content)}else({content:u,breakAtStart:d,openStart:m,openEnd:p}=tr.build(this.view.state.doc,c,f,this.decorations,this.dynamicDecorationMap));let{i:g,off:O}=s.findPos(h,1),{i:y,off:v}=s.findPos(l,-1);Od(this,y,v,g,O,u,d,m,p)}n&&this.fixCompositionDOM(n)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let n of t.effects)n.is(Bd)&&(this.editContextFormatting=n.value)}compositionView(e){let t=new vt(e.text.nodeValue);t.flags|=8;for(let{deco:r}of e.marks)t=new Zt(r,[t],t.length);let n=new be;return n.append(t,0),n}fixCompositionDOM(e){let t=(s,o)=>{o.flags|=8|(o.children.some(l=>l.flags&7)?1:0),this.markedForComposition.add(o);let a=J.get(s);a&&a!=o&&(a.dom=null),o.setDOM(s)},n=this.childPos(e.range.fromB,1),r=this.children[n.i];t(e.line,r);for(let s=e.marks.length-1;s>=-1;s--)n=r.childPos(n.off,1),r=r.children[n.i],t(s>=0?e.marks[s].node:e.text,r)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let n=this.view.root.activeElement,r=n==this.dom,s=!r&&js(this.dom,this.view.observer.selectionRange)&&!(n&&this.dom.contains(n));if(!(r||t||s))return;let o=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,l=this.moveToLine(this.domAtPos(a.anchor)),h=a.empty?l:this.moveToLine(this.domAtPos(a.head));if(Q.gecko&&a.empty&&!this.hasComposition&&Ry(l)){let f=document.createTextNode("");this.view.observer.ignore(()=>l.node.insertBefore(f,l.node.childNodes[l.offset]||null)),l=h=new Me(f,0),o=!0}let c=this.view.observer.selectionRange;(o||!c.focusNode||(!er(l.node,l.offset,c.anchorNode,c.anchorOffset)||!er(h.node,h.offset,c.focusNode,c.focusOffset))&&!this.suppressWidgetCursorChange(c,a))&&(this.view.observer.ignore(()=>{Q.android&&Q.chrome&&this.dom.contains(c.focusNode)&&_y(c.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=ar(this.view.root);if(f)if(a.empty){if(Q.gecko){let u=Ay(l.node,l.offset);if(u&&u!=3){let d=(u==1?md:gd)(l.node,l.offset);d&&(l=new Me(d.node,d.offset))}}f.collapse(l.node,l.offset),a.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=a.bidiLevel)}else if(f.extend){f.collapse(l.node,l.offset);try{f.extend(h.node,h.offset)}catch{}}else{let u=document.createRange();a.anchor>a.head&&([l,h]=[h,l]),u.setEnd(h.node,h.offset),u.setStart(l.node,l.offset),f.removeAllRanges(),f.addRange(u)}s&&this.view.root.activeElement==this.dom&&(this.dom.blur(),n&&n.focus())}),this.view.observer.setSelectionRange(l,h)),this.impreciseAnchor=l.precise?null:new Me(c.anchorNode,c.anchorOffset),this.impreciseHead=h.precise?null:new Me(c.focusNode,c.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&er(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=ar(e.root),{anchorNode:r,anchorOffset:s}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let o=be.find(this,t.head);if(!o)return;let a=o.posAtStart;if(t.head==a||t.head==a+o.length)return;let l=this.coordsAt(t.head,-1),h=this.coordsAt(t.head,1);if(!l||!h||l.bottom>h.top)return;let c=this.domAtPos(t.head+t.assoc);n.collapse(c.node,c.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=t.from&&n.collapse(r,s)}moveToLine(e){let t=this.dom,n;if(e.node!=t)return e;for(let r=e.offset;!n&&r=0;r--){let s=J.get(t.childNodes[r]);s instanceof be&&(n=s.domAtPos(s.length))}return n?new Me(n.node,n.offset,!0):e}nearest(e){for(let t=e;t;){let n=J.get(t);if(n&&n.rootView==this)return n;t=t.parentNode}return null}posFromDOM(e,t){let n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}domAtPos(e){let{i:t,off:n}=this.childCursor().findPos(e,-1);for(;t=0;o--){let a=this.children[o],l=s-a.breakAfter,h=l-a.length;if(le||a.covers(1))&&(!n||a instanceof be&&!(n instanceof be&&t>=0)))n=a,r=h;else if(n&&h==e&&l==e&&a instanceof vi&&Math.abs(t)<2){if(a.deco.startSide<0)break;o&&(n=null)}s=h}return n?n.coordsAt(e-r,t):null}coordsForChar(e){let{i:t,off:n}=this.childPos(e,1),r=this.children[t];if(!(r instanceof be))return null;for(;r.children.length;){let{i:a,off:l}=r.childPos(n,1);for(;;a++){if(a==r.children.length)return null;if((r=r.children[a]).length)break}n=l}if(!(r instanceof vt))return null;let s=ue(r.text,n);if(s==n)return null;let o=ki(r.dom,n,s).getClientRects();for(let a=0;aMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==H.LTR;for(let h=0,c=0;cr)break;if(h>=n){let d=f.dom.getBoundingClientRect();if(t.push(d.height),o){let m=f.dom.lastChild,p=m?lr(m):[];if(p.length){let g=p[p.length-1],O=l?g.right-d.left:d.right-g.left;O>a&&(a=O,this.minWidth=s,this.minWidthFrom=h,this.minWidthTo=u)}}}h=u+f.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?H.RTL:H.LTR}measureTextSize(){for(let s of this.children)if(s instanceof be){let o=s.measureTextSize();if(o)return o}let e=document.createElement("div"),t,n,r;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let s=lr(e.firstChild)[0];t=e.getBoundingClientRect().height,n=s?s.width/27:7,r=s?s.height:t,e.remove()}),{lineHeight:t,charWidth:n,textHeight:r}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new Zs(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let s=r==t.viewports.length?null:t.viewports[r],o=s?s.from-1:this.length;if(o>n){let a=(t.lineBlockAt(o).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(M.replace({widget:new to(a),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!s)break;n=s.to+1}return M.set(e)}updateDeco(){let e=1,t=this.view.state.facet(dr).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),n=!1,r=this.view.state.facet(Wd).map((s,o)=>{let a=typeof s=="function";return a&&(n=!0),a?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(j.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];et.anchor?-1:1),r;if(!n)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,r.left),top:Math.min(n.top,r.top),right:Math.max(n.right,r.right),bottom:Math.max(n.bottom,r.bottom)});let s=jd(this.view),o={left:n.left-s.left,top:n.top-s.top,right:n.right+s.right,bottom:n.bottom+s.bottom},{offsetWidth:a,offsetHeight:l}=this.view.scrollDOM;hy(this.view.scrollDOM,o,t.head{ne.from&&(t=!0)}),t}function $y(i,e,t=1){let n=i.charCategorizer(e),r=i.doc.lineAt(e),s=e-r.from;if(r.length==0)return S.cursor(e);s==0?t=1:s==r.length&&(t=-1);let o=s,a=s;t<0?o=ue(r.text,s,!1):a=ue(r.text,s);let l=n(r.text.slice(o,a));for(;o>0;){let h=ue(r.text,o,!1);if(n(r.text.slice(h,o))!=l)break;o=h}for(;ai?e.left-i:Math.max(0,i-e.right)}function Ly(i,e){return e.top>i?e.top-i:Math.max(0,i-e.bottom)}function kl(i,e){return i.tope.top+1}function _u(i,e){return ei.bottom?{top:i.top,left:i.left,right:i.right,bottom:e}:i}function Wl(i,e,t){let n,r,s,o,a=!1,l,h,c,f;for(let m=i.firstChild;m;m=m.nextSibling){let p=lr(m);for(let g=0;gv||o==v&&s>y){n=m,r=O,s=y,o=v;let x=v?t0?g0)}y==0?t>O.bottom&&(!c||c.bottomO.top)&&(h=m,f=O):c&&kl(c,O)?c=Du(c,O.bottom):f&&kl(f,O)&&(f=_u(f,O.top))}}if(c&&c.bottom>=t?(n=l,r=c):f&&f.top<=t&&(n=h,r=f),!n)return{node:i,offset:0};let u=Math.max(r.left,Math.min(r.right,e));if(n.nodeType==3)return $u(n,u,t);if(a&&n.contentEditable!="false")return Wl(n,u,t);let d=Array.prototype.indexOf.call(i.childNodes,n)+(e>=(r.left+r.right)/2?1:0);return{node:i,offset:d}}function $u(i,e,t){let n=i.nodeValue.length,r=-1,s=1e9,o=0;for(let a=0;at?c.top-t:t-c.bottom)-1;if(c.left-1<=e&&c.right+1>=e&&f=(c.left+c.right)/2,d=u;if((Q.chrome||Q.gecko)&&ki(i,a).getBoundingClientRect().left==c.right&&(d=!u),f<=0)return{node:i,offset:a+(d?1:0)};r=a+(d?1:0),s=f}}}return{node:i,offset:r>-1?r:o>0?i.nodeValue.length:0}}function Ud(i,e,t,n=-1){var r,s;let o=i.contentDOM.getBoundingClientRect(),a=o.top+i.viewState.paddingTop,l,{docHeight:h}=i.viewState,{x:c,y:f}=e,u=f-a;if(u<0)return 0;if(u>h)return i.state.doc.length;for(let x=i.viewState.heightOracle.textHeight/2,w=!1;l=i.elementAtHeight(u),l.type!=_e.Text;)for(;u=n>0?l.bottom+x:l.top-x,!(u>=0&&u<=h);){if(w)return t?null:0;w=!0,n=-n}f=a+u;let d=l.from;if(di.viewport.to)return i.viewport.to==i.state.doc.length?i.state.doc.length:t?null:Vu(i,o,l,c,f);let m=i.dom.ownerDocument,p=i.root.elementFromPoint?i.root:m,g=p.elementFromPoint(c,f);g&&!i.contentDOM.contains(g)&&(g=null),g||(c=Math.max(o.left+1,Math.min(o.right-1,c)),g=p.elementFromPoint(c,f),g&&!i.contentDOM.contains(g)&&(g=null));let O,y=-1;if(g&&((r=i.docView.nearest(g))===null||r===void 0?void 0:r.isEditable)!=!1){if(m.caretPositionFromPoint){let x=m.caretPositionFromPoint(c,f);x&&({offsetNode:O,offset:y}=x)}else if(m.caretRangeFromPoint){let x=m.caretRangeFromPoint(c,f);x&&({startContainer:O,startOffset:y}=x,(!i.contentDOM.contains(O)||Q.safari&&qy(O,y,c)||Q.chrome&&By(O,y,c))&&(O=void 0))}}if(!O||!i.docView.dom.contains(O)){let x=be.find(i.docView,d);if(!x)return u>l.top+l.height/2?l.to:l.from;({node:O,offset:y}=Wl(x.dom,c,f))}let v=i.docView.nearest(O);if(!v)return null;if(v.isWidget&&((s=v.dom)===null||s===void 0?void 0:s.nodeType)==1){let x=v.dom.getBoundingClientRect();return e.yi.defaultLineHeight*1.5){let a=i.viewState.heightOracle.textHeight,l=Math.floor((r-t.top-(i.defaultLineHeight-a)*.5)/a);s+=l*i.viewState.heightOracle.lineLength}let o=i.state.sliceDoc(t.from,t.to);return t.from+_s(o,s,i.state.tabSize)}function qy(i,e,t){let n;if(i.nodeType!=3||e!=(n=i.nodeValue.length))return!1;for(let r=i.nextSibling;r;r=r.nextSibling)if(r.nodeType!=1||r.nodeName!="BR")return!1;return ki(i,n-1,n).getBoundingClientRect().left>t}function By(i,e,t){if(e!=0)return!1;for(let r=i;;){let s=r.parentNode;if(!s||s.nodeType!=1||s.firstChild!=r)return!1;if(s.classList.contains("cm-line"))break;r=s}let n=i.nodeType==1?i.getBoundingClientRect():ki(i,0,Math.max(i.nodeValue.length,1)).getBoundingClientRect();return t-n.left>5}function Il(i,e){let t=i.lineBlockAt(e);if(Array.isArray(t.type)){for(let n of t.type)if(n.to>e||n.to==e&&(n.to==t.to||n.type==_e.Text))return n}return t}function Xy(i,e,t,n){let r=Il(i,e.head),s=!n||r.type!=_e.Text||!(i.lineWrapping||r.widgetLineBreaks)?null:i.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(s){let o=i.dom.getBoundingClientRect(),a=i.textDirectionAt(r.from),l=i.posAtCoords({x:t==(a==H.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(l!=null)return S.cursor(l,t?-1:1)}return S.cursor(t?r.to:r.from,t?-1:1)}function Lu(i,e,t,n){let r=i.state.doc.lineAt(e.head),s=i.bidiSpans(r),o=i.textDirectionAt(r.from);for(let a=e,l=null;;){let h=Ty(r,s,o,a,t),c=Ed;if(!h){if(r.number==(t?i.state.doc.lines:1))return a;c=` +`,r=i.state.doc.line(r.number+(t?1:-1)),s=i.bidiSpans(r),h=i.visualLineSide(r,!t)}if(l){if(!l(c))return a}else{if(!n)return h;l=n(c)}a=h}}function Wy(i,e,t){let n=i.state.charCategorizer(e),r=n(t);return s=>{let o=n(s);return r==F.Space&&(r=o),r==o}}function Iy(i,e,t,n){let r=e.head,s=t?1:-1;if(r==(t?i.state.doc.length:0))return S.cursor(r,e.assoc);let o=e.goalColumn,a,l=i.contentDOM.getBoundingClientRect(),h=i.coordsAtPos(r,e.assoc||-1),c=i.documentTop;if(h)o==null&&(o=h.left-l.left),a=s<0?h.top:h.bottom;else{let d=i.viewState.lineBlockAt(r);o==null&&(o=Math.min(l.right-l.left,i.defaultCharacterWidth*(r-d.from))),a=(s<0?d.top:d.bottom)+c}let f=l.left+o,u=n??i.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let m=a+(u+d)*s,p=Ud(i,{x:f,y:m},!1,s);if(ml.bottom||(s<0?pr)){let g=i.docView.coordsForChar(p),O=!g||m{if(e>s&&er(i)),t.from,e.head>t.from?-1:1);return n==t.from?t:S.cursor(n,nnull),Q.gecko&&nb(e.contentDOM.ownerDocument)}handleEvent(e){!Gy(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,t){let n=this.handlers[e];if(n){for(let r of n.observers)r(this.view,t);for(let r of n.handlers){if(t.defaultPrevented)break;if(r(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=Ny(e),n=this.handlers,r=this.view.contentDOM;for(let s in t)if(s!="scroll"){let o=!t[s].handlers.length,a=n[s];a&&o!=!a.handlers.length&&(r.removeEventListener(s,this.handleEvent),a=null),a||r.addEventListener(s,this.handleEvent,{passive:o})}for(let s in n)s!="scroll"&&!t[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&Hd.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Q.android&&Q.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return Q.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=Fd.find(n=>n.keyCode==e.keyCode))&&!e.ctrlKey||jy.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from0?!0:Q.safari&&!Q.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function qu(i,e){return(t,n)=>{try{return e.call(i,n,t)}catch(r){we(t.state,r)}}}function Ny(i){let e=Object.create(null);function t(n){return e[n]||(e[n]={observers:[],handlers:[]})}for(let n of i){let r=n.spec;if(r&&r.domEventHandlers)for(let s in r.domEventHandlers){let o=r.domEventHandlers[s];o&&t(s).handlers.push(qu(n.value,o))}if(r&&r.domEventObservers)for(let s in r.domEventObservers){let o=r.domEventObservers[s];o&&t(s).observers.push(qu(n.value,o))}}for(let n in ht)t(n).handlers.push(ht[n]);for(let n in it)t(n).observers.push(it[n]);return e}var Fd=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],jy="dthko",Hd=[16,17,18,20,91,92,224,225],Ls=6;function qs(i){return Math.max(0,i)*.7+8}function zy(i,e){return Math.max(Math.abs(i.clientX-e.clientX),Math.abs(i.clientY-e.clientY))}var jl=class{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=cy(e.contentDOM),this.atoms=e.state.facet(xh).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(N.allowMultipleSelections)&&Uy(e,t),this.dragging=Hy(e,t)&&Jd(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){var t;if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&zy(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,s=((t=this.scrollParent)===null||t===void 0?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},o=jd(this.view);e.clientX-o.left<=s.left+Ls?n=-qs(s.left-e.clientX):e.clientX+o.right>=s.right-Ls&&(n=qs(e.clientX-s.right)),e.clientY-o.top<=s.top+Ls?r=-qs(s.top-e.clientY):e.clientY+o.bottom>=s.bottom-Ls&&(r=qs(e.clientY-s.bottom)),this.setScrollSpeed(n,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let n=0;nt.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function Uy(i,e){let t=i.state.facet(Ad);return t.length?t[0](e):Q.mac?e.metaKey:e.ctrlKey}function Fy(i,e){let t=i.state.facet(Qd);return t.length?t[0](e):Q.mac?!e.altKey:!e.ctrlKey}function Hy(i,e){let{main:t}=i.state.selection;if(t.empty)return!1;let n=ar(i.root);if(!n||n.rangeCount==0)return!0;let r=n.getRangeAt(0).getClientRects();for(let s=0;s=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function Gy(i,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,n;t!=i.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(n=J.get(t))&&n.ignoreEvent(e))return!1;return!0}var ht=Object.create(null),it=Object.create(null),Gd=Q.ie&&Q.ie_version<15||Q.ios&&Q.webkit_version<604;function Yy(i){let e=i.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{i.focus(),t.remove(),Yd(i,t.value)},50)}function Yd(i,e){let{state:t}=i,n,r=1,s=t.toText(e),o=s.lines==t.selection.ranges.length;if(zl!=null&&t.selection.ranges.every(l=>l.empty)&&zl==s.toString()){let l=-1;n=t.changeByRange(h=>{let c=t.doc.lineAt(h.from);if(c.from==l)return{range:h};l=c.from;let f=t.toText((o?s.line(r++).text:e)+t.lineBreak);return{changes:{from:c.from,insert:f},range:S.cursor(h.from+f.length)}})}else o?n=t.changeByRange(l=>{let h=s.line(r++);return{changes:{from:l.from,to:l.to,insert:h.text},range:S.cursor(l.from+h.length)}}):n=t.replaceSelection(s);i.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}it.scroll=i=>{i.inputState.lastScrollTop=i.scrollDOM.scrollTop,i.inputState.lastScrollLeft=i.scrollDOM.scrollLeft};ht.keydown=(i,e)=>(i.inputState.setSelectionOrigin("select"),e.keyCode==27&&i.inputState.tabFocusMode!=0&&(i.inputState.tabFocusMode=Date.now()+2e3),!1);it.touchstart=(i,e)=>{i.inputState.lastTouchTime=Date.now(),i.inputState.setSelectionOrigin("select.pointer")};it.touchmove=i=>{i.inputState.setSelectionOrigin("select.pointer")};ht.mousedown=(i,e)=>{if(i.observer.flush(),i.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let n of i.state.facet(Md))if(t=n(i,e),t)break;if(!t&&e.button==0&&(t=Ky(i,e)),t){let n=!i.hasFocus;i.inputState.startMouseSelection(new jl(i,e,t,n)),n&&i.observer.ignore(()=>{ud(i.contentDOM);let s=i.root.activeElement;s&&!s.contains(i.contentDOM)&&s.blur()});let r=i.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}return!1};function Bu(i,e,t,n){if(n==1)return S.cursor(e,t);if(n==2)return $y(i.state,e,t);{let r=be.find(i.docView,e),s=i.state.doc.lineAt(r?r.posAtEnd:e),o=r?r.posAtStart:s.from,a=r?r.posAtEnd:s.to;return ai>=e.top&&i<=e.bottom,Xu=(i,e,t)=>Zd(e,t)&&i>=t.left&&i<=t.right;function Zy(i,e,t,n){let r=be.find(i.docView,e);if(!r)return 1;let s=e-r.posAtStart;if(s==0)return 1;if(s==r.length)return-1;let o=r.coordsAt(s,-1);if(o&&Xu(t,n,o))return-1;let a=r.coordsAt(s,1);return a&&Xu(t,n,a)?1:o&&Zd(n,o)?-1:1}function Wu(i,e){let t=i.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:Zy(i,t,e.clientX,e.clientY)}}var Jy=Q.ie&&Q.ie_version<=11,Iu=null,Nu=0,ju=0;function Jd(i){if(!Jy)return i.detail;let e=Iu,t=ju;return Iu=i,ju=Date.now(),Nu=!e||t>Date.now()-400&&Math.abs(e.clientX-i.clientX)<2&&Math.abs(e.clientY-i.clientY)<2?(Nu+1)%3:1}function Ky(i,e){let t=Wu(i,e),n=Jd(e),r=i.state.selection;return{update(s){s.docChanged&&(t.pos=s.changes.mapPos(t.pos),r=r.map(s.changes))},get(s,o,a){let l=Wu(i,s),h,c=Bu(i,l.pos,l.bias,n);if(t.pos!=l.pos&&!o){let f=Bu(i,t.pos,t.bias,n),u=Math.min(f.from,c.from),d=Math.max(f.to,c.to);c=u1&&(h=eb(r,l.pos))?h:a?r.addRange(c):S.create([c])}}}function eb(i,e){for(let t=0;t=e)return S.create(i.ranges.slice(0,t).concat(i.ranges.slice(t+1)),i.mainIndex==t?0:i.mainIndex-(i.mainIndex>t?1:0))}return null}ht.dragstart=(i,e)=>{let{selection:{main:t}}=i.state;if(e.target.draggable){let r=i.docView.nearest(e.target);if(r&&r.isWidget){let s=r.posAtStart,o=s+r.length;(s>=t.to||o<=t.from)&&(t=S.range(s,o))}}let{inputState:n}=i;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",i.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove"),!1};ht.dragend=i=>(i.inputState.draggedContent=null,!1);function zu(i,e,t,n){if(!t)return;let r=i.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=i.inputState,o=n&&s&&Fy(i,e)?{from:s.from,to:s.to}:null,a={from:r,insert:t},l=i.state.changes(o?[o,a]:a);i.focus(),i.dispatch({changes:l,selection:{anchor:l.mapPos(r,-1),head:l.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"}),i.inputState.draggedContent=null}ht.drop=(i,e)=>{if(!e.dataTransfer)return!1;if(i.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let n=Array(t.length),r=0,s=()=>{++r==t.length&&zu(i,e,n.filter(o=>o!=null).join(i.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(n[o]=a.result),s()},a.readAsText(t[o])}return!0}else{let n=e.dataTransfer.getData("Text");if(n)return zu(i,e,n,!0),!0}return!1};ht.paste=(i,e)=>{if(i.state.readOnly)return!0;i.observer.flush();let t=Gd?null:e.clipboardData;return t?(Yd(i,t.getData("text/plain")||t.getData("text/uri-list")),!0):(Yy(i),!1)};function tb(i,e){let t=i.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=e,n.focus(),n.selectionEnd=e.length,n.selectionStart=0,setTimeout(()=>{n.remove(),i.focus()},50)}function ib(i){let e=[],t=[],n=!1;for(let r of i.selection.ranges)r.empty||(e.push(i.sliceDoc(r.from,r.to)),t.push(r));if(!e.length){let r=-1;for(let{from:s}of i.selection.ranges){let o=i.doc.lineAt(s);o.number>r&&(e.push(o.text),t.push({from:o.from,to:Math.min(i.doc.length,o.to+1)})),r=o.number}n=!0}return{text:e.join(i.lineBreak),ranges:t,linewise:n}}var zl=null;ht.copy=ht.cut=(i,e)=>{let{text:t,ranges:n,linewise:r}=ib(i.state);if(!t&&!r)return!1;zl=r?t:null,e.type=="cut"&&!i.state.readOnly&&i.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let s=Gd?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",t),!0):(tb(i,t),!1)};var Kd=Le.define();function ep(i,e){let t=[];for(let n of i.facet($d)){let r=n(i,e);r&&t.push(r)}return t?i.update({effects:t,annotations:Kd.of(!0)}):null}function tp(i){setTimeout(()=>{let e=i.hasFocus;if(e!=i.inputState.notifiedFocused){let t=ep(i.state,e);t?i.dispatch(t):i.update([])}},10)}it.focus=i=>{i.inputState.lastFocusTime=Date.now(),!i.scrollDOM.scrollTop&&(i.inputState.lastScrollTop||i.inputState.lastScrollLeft)&&(i.scrollDOM.scrollTop=i.inputState.lastScrollTop,i.scrollDOM.scrollLeft=i.inputState.lastScrollLeft),tp(i)};it.blur=i=>{i.observer.clearSelectionRange(),tp(i)};it.compositionstart=it.compositionupdate=i=>{i.observer.editContext||(i.inputState.compositionFirstChange==null&&(i.inputState.compositionFirstChange=!0),i.inputState.composing<0&&(i.inputState.composing=0))};it.compositionend=i=>{i.observer.editContext||(i.inputState.composing=-1,i.inputState.compositionEndedAt=Date.now(),i.inputState.compositionPendingKey=!0,i.inputState.compositionPendingChange=i.observer.pendingRecords().length>0,i.inputState.compositionFirstChange=null,Q.chrome&&Q.android?i.observer.flushSoon():i.inputState.compositionPendingChange?Promise.resolve().then(()=>i.observer.flush()):setTimeout(()=>{i.inputState.composing<0&&i.docView.hasComposition&&i.update([])},50))};it.contextmenu=i=>{i.inputState.lastContextMenu=Date.now()};ht.beforeinput=(i,e)=>{var t;let n;if(Q.chrome&&Q.android&&(n=Fd.find(r=>r.inputType==e.inputType))&&(i.observer.delayAndroidKey(n.key,n.keyCode),n.key=="Backspace"||n.key=="Delete")){let r=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var s;(((s=window.visualViewport)===null||s===void 0?void 0:s.height)||0)>r+10&&i.hasFocus&&(i.contentDOM.blur(),i.focus())},100)}return Q.ios&&e.inputType=="deleteContentForward"&&i.observer.flushSoon(),Q.safari&&e.inputType=="insertText"&&i.inputState.composing>=0&&setTimeout(()=>it.compositionend(i,e),20),!1};var Uu=new Set;function nb(i){Uu.has(i)||(Uu.add(i),i.addEventListener("copy",()=>{}),i.addEventListener("cut",()=>{}))}var Fu=["pre-wrap","normal","pre-line","break-spaces"],Ul=class{constructor(e){this.lineWrapping=e,this.doc=W.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Fu.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n-1,l=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=s,l){this.heightSamples={};for(let h=0;h0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>Us&&(e.heightChanged=!0),this.height=t)}replace(e,t,n){return i.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let s=this,o=n.doc;for(let a=r.length-1;a>=0;a--){let{fromA:l,toA:h,fromB:c,toB:f}=r[a],u=s.lineAt(l,K.ByPosNoHeight,n.setDoc(t),0,0),d=u.to>=h?u:s.lineAt(h,K.ByPosNoHeight,n,0,0);for(f+=d.to-h,h=d.to;a>0&&u.from<=r[a-1].toA;)l=r[a-1].fromA,c=r[a-1].fromB,a--,ls*2){let a=e[t-1];a.break?e.splice(--t,1,a.left,null,a.right):e.splice(--t,1,a.left,a.right),n+=1+a.break,r-=a.size}else if(s>r*2){let a=e[n];a.break?e.splice(n,1,a.left,null,a.right):e.splice(n,1,a.left,a.right),n+=2+a.break,s-=a.size}else break;else if(r=s&&o(this.blockAt(0,n,r,s))}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setHeight(e,r.heights[r.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}},tt=class i extends io{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,n,r){return new yt(r,this.length,n,this.height,this.breaks)}replace(e,t,n){let r=n[0];return n.length==1&&(r instanceof i||r instanceof Yt&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof Yt?r=new i(r.length,this.height):r.height=this.height,this.outdated||(r.outdated=!1),r):je.of(n)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setHeight(e,r.heights[r.index++]):(n||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}},Yt=class i extends je{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,s=r-n+1,o,a=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*s);o=l/s,this.length>s+1&&(a=(this.height-l)/(this.length-s-1))}else o=this.height/s;return{firstLine:n,lastLine:r,perLine:o,perChar:a}}blockAt(e,t,n,r){let{firstLine:s,lastLine:o,perLine:a,perChar:l}=this.heightMetrics(t,r);if(t.lineWrapping){let h=r+(e0){let s=n[n.length-1];s instanceof i?n[n.length-1]=new i(s.length+r):n.push(null,new i(r-1))}if(e>0){let s=n[0];s instanceof i?n[0]=new i(e+s.length):n.unshift(new i(e-1),null)}return je.of(n)}decomposeLeft(e,t){t.push(new i(e-1),null)}decomposeRight(e,t){t.push(null,new i(this.length-e-1))}updateHeight(e,t=0,n=!1,r){let s=t+this.length;if(r&&r.from<=t+this.length&&r.more){let o=[],a=Math.max(t,r.from),l=-1;for(r.from>t&&o.push(new i(r.from-t-1).updateHeight(e,t));a<=s&&r.more;){let c=e.doc.lineAt(a).length;o.length&&o.push(null);let f=r.heights[r.index++];l==-1?l=f:Math.abs(f-l)>=Us&&(l=-2);let u=new tt(c,f);u.outdated=!1,o.push(u),a+=c+1}a<=s&&o.push(null,new i(s-a).updateHeight(e,a));let h=je.of(o);return(l<0||Math.abs(h.height-this.height)>=Us||Math.abs(l-this.heightMetrics(e,t).perLine)>=Us)&&(e.heightChanged=!0),h}else(n||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},Hl=class extends je{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,t,n,r){let s=n+this.left.height;return ea))return h;let c=t==K.ByPosNoHeight?K.ByPosNoHeight:K.ByPos;return l?h.join(this.right.lineAt(a,c,n,o,a)):this.left.lineAt(a,c,n,r,s).join(h)}forEachLine(e,t,n,r,s,o){let a=r+this.left.height,l=s+this.left.length+this.break;if(this.break)e=l&&this.right.forEachLine(e,t,n,a,l,o);else{let h=this.lineAt(l,K.ByPos,n,r,s);e=e&&h.from<=t&&o(h),t>h.to&&this.right.forEachLine(h.to+1,t,n,a,l,o)}}replace(e,t,n){let r=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let a of n)s.push(a);if(e>0&&Hu(s,o-1),t=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e2*t.size||t.size>2*e.size?je.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:s,right:o}=this,a=t+s.length+this.break,l=null;return r&&r.from<=t+s.length&&r.more?l=s=s.updateHeight(e,t,n,r):s.updateHeight(e,t,n),r&&r.from<=a+o.length&&r.more?l=o=o.updateHeight(e,a,n,r):o.updateHeight(e,a,n),l?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}};function Hu(i,e){let t,n;i[e]==null&&(t=i[e-1])instanceof Yt&&(n=i[e+1])instanceof Yt&&i.splice(e-1,3,new Yt(t.length+1+n.length))}var rb=5,Gl=class i{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let n=Math.min(t,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof tt?r.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new tt(n-this.pos,-1)),this.writtenTo=n,t>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e=rb)&&this.addLineDeco(r,s,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new tt(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let n=new Yt(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof tt)return e;let t=new tt(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof tt)&&!this.isCovered?this.nodes.push(new tt(0,-1)):(this.writtenToc.clientHeight||c.scrollWidth>c.clientWidth)&&f.overflow!="visible"){let u=c.getBoundingClientRect();s=Math.max(s,u.left),o=Math.min(o,u.right),a=Math.max(a,u.top),l=h==i.parentNode?u.bottom:Math.min(l,u.bottom)}h=f.position=="absolute"||f.position=="fixed"?c.offsetParent:c.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:s-t.left,right:Math.max(s,o)-t.left,top:a-(t.top+e),bottom:Math.max(a,l)-(t.top+e)}}function ab(i,e){let t=i.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}var rr=class{constructor(e,t,n){this.from=e,this.to=t,this.size=n}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;ntypeof n!="function"&&n.class=="cm-lineWrapping");this.heightOracle=new Ul(t),this.stateDeco=e.facet(dr).filter(n=>typeof n!="function"),this.heightMap=je.empty().applyChanges(this.stateDeco,W.empty,this.heightOracle.setDoc(e.doc),[new wt(0,0,0,e.doc.length)]);for(let n=0;n<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());n++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=M.set(this.lineGaps.map(n=>n.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some(({from:s,to:o})=>r>=s&&r<=o)){let{from:s,to:o}=this.lineBlockAt(r);e.push(new rn(s,o))}}return this.viewports=e.sort((n,r)=>n.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Gu:new Jl(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Zn(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet(dr).filter(c=>typeof c!="function");let r=e.changedRanges,s=wt.extendWithRanges(r,sb(n,this.stateDeco,e?e.changes:Ae.empty(this.state.doc.length))),o=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),this.heightMap.height!=o&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let l=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.headl.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,t));let h=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,e.flags|=this.updateForViewport(),(h||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(Ld)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,s=n.whiteSpace;this.defaultTextDirection=n.direction=="rtl"?H.RTL:H.LTR;let o=this.heightOracle.mustRefreshForWrapping(s),a=t.getBoundingClientRect(),l=o||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let h=0,c=0;if(a.width&&a.height){let{scaleX:x,scaleY:w}=fd(t,a);(x>.005&&Math.abs(this.scaleX-x)>.005||w>.005&&Math.abs(this.scaleY-w)>.005)&&(this.scaleX=x,this.scaleY=w,h|=8,o=l=!0)}let f=(parseInt(n.paddingTop)||0)*this.scaleY,u=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=u)&&(this.paddingTop=f,this.paddingBottom=u,h|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=8);let d=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=d&&(this.scrollAnchorHeight=-1,this.scrollTop=d),this.scrolledToBottom=pd(e.scrollDOM);let m=(this.printing?ab:ob)(t,this.paddingTop),p=m.top-this.pixelViewport.top,g=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let O=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(O!=this.inView&&(this.inView=O,O&&(l=!0)),!this.inView&&!this.scrollTarget)return 0;let y=a.width;if((this.contentDOMWidth!=y||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,h|=8),l){let x=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(x)&&(o=!0),o||r.lineWrapping&&Math.abs(y-this.contentDOMWidth)>r.charWidth){let{lineHeight:w,charWidth:P,textHeight:C}=e.docView.measureTextSize();o=w>0&&r.refresh(s,w,P,C,y/P,x),o&&(e.docView.minWidth=0,h|=8)}p>0&&g>0?c=Math.max(p,g):p<0&&g<0&&(c=Math.min(p,g)),r.heightChanged=!1;for(let w of this.viewports){let P=w.from==this.viewport.from?x:e.docView.measureVisibleLineHeights(w);this.heightMap=(o?je.empty().applyChanges(this.stateDeco,W.empty,this.heightOracle,[new wt(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new Fl(w.from,P))}r.heightChanged&&(h|=2)}let v=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return v&&(h&2&&(h|=this.updateScaler()),this.viewport=this.getViewport(c,this.scrollTarget),h|=this.updateForViewport()),(h&2||v)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:a}=this,l=new rn(r.lineAt(o-n*1e3,K.ByHeight,s,0,0).from,r.lineAt(a+(1-n)*1e3,K.ByHeight,s,0,0).to);if(t){let{head:h}=t.range;if(hl.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=r.lineAt(h,K.ByPos,s,0,0),u;t.y=="center"?u=(f.top+f.bottom)/2-c/2:t.y=="start"||t.y=="nearest"&&h=a+Math.max(10,Math.min(n,250)))&&r>o-2*1e3&&s>1,o=r<<1;if(this.defaultTextDirection!=H.LTR&&!n)return[];let a=[],l=(c,f,u,d)=>{if(f-cc&&OO.from>=u.from&&O.to<=u.to&&Math.abs(O.from-c)O.fromy));if(!g){if(fO.from<=f&&O.to>=f)){let O=t.moveToLineBoundary(S.cursor(f),!1,!0).head;O>c&&(f=O)}g=new rr(c,f,this.gapSize(u,c,f,d))}a.push(g)},h=c=>{if(c.lengthc.from&&l(c.from,d,c,f),mt.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];j.spans(e,this.viewport.from,this.viewport.to,{span(r,s){t.push({from:r,to:s})},point(){}},20);let n=t.length!=this.visibleRanges.length||this.visibleRanges.some((r,s)=>r.from!=t[s].from||r.to!=t[s].to);return this.visibleRanges=t,n?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Zn(this.heightMap.lineAt(e,K.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||Zn(this.heightMap.lineAt(this.scaler.fromDOM(e),K.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return Zn(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}},rn=class{constructor(e,t){this.from=e,this.to=t}};function lb(i,e,t){let n=[],r=i,s=0;return j.spans(t,i,e,{span(){},point(o,a){o>r&&(n.push({from:r,to:o}),s+=o-r),r=a}},20),r=1)return e[e.length-1].to;let n=Math.floor(i*t);for(let r=0;;r++){let{from:s,to:o}=e[r],a=o-s;if(n<=a)return s+n;n-=a}}function Xs(i,e){let t=0;for(let{from:n,to:r}of i.ranges){if(e<=r){t+=e-n;break}t+=r-n}return t/i.total}function hb(i,e){for(let t of i)if(e(t))return t}var Gu={toDOM(i){return i},fromDOM(i){return i},scale:1,eq(i){return i==this}},Jl=class i{constructor(e,t,n){let r=0,s=0,o=0;this.viewports=n.map(({from:a,to:l})=>{let h=t.lineAt(a,K.ByPos,e,0,0).top,c=t.lineAt(l,K.ByPos,e,0,0).bottom;return r+=c-h,{from:a,to:l,top:h,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let a of this.viewports)a.domTop=o+(a.top-s)*this.scale,o=a.domBottom=a.domTop+(a.bottom-a.top),s=a.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let s=tt.from==e.viewports[n].from&&t.to==e.viewports[n].to):!1}};function Zn(i,e){if(e.scale==1)return i;let t=e.toDOM(i.top),n=e.toDOM(i.bottom);return new yt(i.from,i.length,t,n-t,Array.isArray(i._content)?i._content.map(r=>Zn(r,e)):i._content)}var Ws=A.define({combine:i=>i.join(" ")}),Kl=A.define({combine:i=>i.indexOf(!0)>-1}),eh=et.newName(),ip=et.newName(),np=et.newName(),rp={"&light":"."+ip,"&dark":"."+np};function th(i,e,t){return new et(e,{finish(n){return/&/.test(n)?n.replace(/&\w*/,r=>{if(r=="&")return i;if(!t||!t[r])throw new RangeError(`Unsupported selector: ${r}`);return t[r]}):i+" "+n}})}var cb=th("."+eh,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},rp),Jn="\uFFFF",ih=class{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(N.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Jn}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let s=this.text.length;this.readNode(r);let o=r.nextSibling;if(o==t)break;let a=J.get(r),l=J.get(o);(a&&l?a.breakAfter:(a?a.breakAfter:Ys(r))||Ys(o)&&(r.nodeName!="BR"||r.cmIgnore)&&this.text.length>s)&&this.lineBreak(),r=o}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,a;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(a=r.exec(t))&&(s=a.index,o=a[0].length),this.append(t.slice(n,s<0?t.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=o-1);n=s+o}}readNode(e){if(e.cmIgnore)return;let t=J.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let r=n.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(fb(e,n.node,n.offset)?t:0))}};function fb(i,e,t){for(;;){if(!e||t-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,n,0))){let a=s||o?[]:pb(e),l=new ih(a,e.state);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=mb(a,this.bounds.from)}else{let a=e.observer.selectionRange,l=s&&s.node==a.focusNode&&s.offset==a.focusOffset||!El(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),h=o&&o.node==a.anchorNode&&o.offset==a.anchorOffset||!El(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),c=e.viewport;if((Q.ios||Q.chrome)&&e.state.selection.main.empty&&l!=h&&(c.from>0||c.toDate.now()-100?i.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:a}=e.bounds,l=r.from,h=null;(s===8||Q.android&&e.text.length=r.from&&t.to<=r.to&&(t.from!=r.from||t.to!=r.to)&&r.to-r.from-(t.to-t.from)<=4?t={from:r.from,to:r.to,insert:i.state.doc.slice(r.from,t.from).append(t.insert).append(i.state.doc.slice(t.to,r.to))}:(Q.mac||Q.android)&&t&&t.from==t.to&&t.from==r.head-1&&/^\. ?$/.test(t.insert.toString())&&i.contentDOM.getAttribute("autocorrect")=="off"?(n&&t.insert.length==2&&(n=S.single(n.main.anchor-1,n.main.head-1)),t={from:r.from,to:r.to,insert:W.of([" "])}):Q.chrome&&t&&t.from==t.to&&t.from==r.head&&t.insert.toString()==` + `&&i.lineWrapping&&(n&&(n=S.single(n.main.anchor-1,n.main.head-1)),t={from:r.from,to:r.to,insert:W.of([" "])}),t)return op(i,t,n,s);if(n&&!n.main.eq(r)){let o=!1,a="select";return i.inputState.lastSelectionTime>Date.now()-50&&(i.inputState.lastSelectionOrigin=="select"&&(o=!0),a=i.inputState.lastSelectionOrigin),i.dispatch({selection:n,scrollIntoView:o,userEvent:a}),!0}else return!1}function op(i,e,t,n=-1){if(Q.ios&&i.inputState.flushIOSKey(e))return!0;let r=i.state.selection.main;if(Q.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&i.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&an(i.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||n==8&&e.insert.lengthr.head)&&an(i.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&an(i.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();i.inputState.composing>=0&&i.inputState.composing++;let o,a=()=>o||(o=ub(i,e,t));return i.state.facet(Dd).some(l=>l(i,e.from,e.to,s,a))||i.dispatch(a()),!0}function ub(i,e,t){let n,r=i.state,s=r.selection.main;if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&i.inputState.composing<0){let a=s.frome.to?r.sliceDoc(e.to,s.to):"";n=r.replaceSelection(i.state.toText(a+e.insert.sliceString(0,void 0,i.state.lineBreak)+l))}else{let a=r.changes(e),l=t&&t.main.to<=a.newLength?t.main:void 0;if(r.selection.ranges.length>1&&i.inputState.composing>=0&&e.to<=s.to&&e.to>=s.to-10){let h=i.state.sliceDoc(e.from,e.to),c,f=t&&zd(i,t.main.head);if(f){let m=e.insert.length-(e.to-e.from);c={from:f.from,to:f.to-m}}else c=i.state.doc.lineAt(s.head);let u=s.to-e.to,d=s.to-s.from;n=r.changeByRange(m=>{if(m.from==s.from&&m.to==s.to)return{changes:a,range:l||m.map(a)};let p=m.to-u,g=p-h.length;if(m.to-m.from!=d||i.state.sliceDoc(g,p)!=h||m.to>=c.from&&m.from<=c.to)return{range:m};let O=r.changes({from:g,to:p,insert:e.insert}),y=m.to-s.to;return{changes:O,range:l?S.range(Math.max(0,l.anchor+y),Math.max(0,l.head+y)):m.map(O)}})}else n={changes:a,selection:l&&r.selection.replaceRange(l)}}let o="input.type";return(i.composing||i.inputState.compositionPendingChange&&i.inputState.compositionEndedAt>Date.now()-50)&&(i.inputState.compositionPendingChange=!1,o+=".compose",i.inputState.compositionFirstChange&&(o+=".start",i.inputState.compositionFirstChange=!1)),r.update(n,{userEvent:o,scrollIntoView:!0})}function db(i,e,t,n){let r=Math.min(i.length,e.length),s=0;for(;s0&&a>0&&i.charCodeAt(o-1)==e.charCodeAt(a-1);)o--,a--;if(n=="end"){let l=Math.max(0,s-Math.min(o,a));t-=o+l-s}if(o=o?s-t:0;s-=l,a=s+(a-o),o=s}else if(a=a?s-t:0;s-=l,o=s+(o-a),a=s}return{from:s,toA:o,toB:a}}function pb(i){let e=[];if(i.root.activeElement!=i.contentDOM)return e;let{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:s}=i.observer.selectionRange;return t&&(e.push(new ro(t,n)),(r!=t||s!=n)&&e.push(new ro(r,s))),e}function mb(i,e){if(i.length==0)return null;let t=i[0].pos,n=i.length==2?i[1].pos:t;return t>-1&&n>-1?S.single(t+e,n+e):null}var gb={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Tl=Q.ie&&Q.ie_version<=11,rh=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Al,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let n of t)this.queue.push(n);(Q.ie&&Q.ie_version<=11||Q.ios&&e.composing)&&t.some(n=>n.type=="childList"&&n.removedNodes.length||n.type=="characterData"&&n.oldValue.length>n.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&e.constructor.EDIT_CONTEXT!==!1&&!(Q.chrome&&Q.chrome_version<126)&&(this.editContext=new sh(e),e.state.facet(Ht)&&(e.contentDOM.editContext=this.editContext.editContext)),Tl&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){e.type=="change"&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(Ht)?n.root.activeElement!=this.dom:!js(n.dom,r))return;let s=r.anchorNode&&n.docView.nearest(r.anchorNode);if(s&&s.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(Q.ie&&Q.ie_version<=11||Q.android&&Q.chrome)&&!n.state.selection.main.empty&&r.focusNode&&er(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=ar(e.root);if(!t)return!1;let n=Q.safari&&e.root.nodeType==11&&ay(this.dom.ownerDocument)==this.dom&&Ob(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=js(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&an(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(r=!0),t==-1?{from:t,to:n}=o:(t=Math.min(o.from,t),n=Math.max(o.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&js(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new nh(this.view,e,t,n);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,r=sp(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let n=Yu(t,e.previousSibling||e.target.previousSibling,-1),r=Yu(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener("change",this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener("change",this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Ht)!=e.state.facet(Ht)&&(e.view.contentDOM.editContext=e.state.facet(Ht)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(n=this.resizeScroll)===null||n===void 0||n.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}};function Yu(i,e,t){for(;e;){let n=J.get(e);if(n&&n.parent==i)return n;let r=e.parentNode;e=r!=i.dom?r:t>0?e.nextSibling:e.previousSibling}return null}function Zu(i,e){let t=e.startContainer,n=e.startOffset,r=e.endContainer,s=e.endOffset,o=i.docView.domAtPos(i.state.selection.main.anchor);return er(o.node,o.offset,r,s)&&([t,n,r,s]=[r,s,t,n]),{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:s}}function Ob(i,e){if(e.getComposedRanges){let r=e.getComposedRanges(i.root)[0];if(r)return Zu(i,r)}let t=null;function n(r){r.preventDefault(),r.stopImmediatePropagation(),t=r.getTargetRanges()[0]}return i.contentDOM.addEventListener("beforeinput",n,!0),i.dom.ownerDocument.execCommand("indent"),i.contentDOM.removeEventListener("beforeinput",n,!0),t?Zu(i,t):null}var sh=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});t.addEventListener("textupdate",n=>{let{anchor:r}=e.state.selection.main,s={from:this.toEditorPos(n.updateRangeStart),to:this.toEditorPos(n.updateRangeEnd),insert:W.of(n.text.split(` +`))};s.from==this.from&&rthis.to&&(s.to=r),!(s.from==s.to&&!s.insert.length)&&(this.pendingContextChange=s,op(e,s,S.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd))),this.pendingContextChange&&this.revertPending(e.state))}),t.addEventListener("characterboundsupdate",n=>{let r=[],s=null;for(let o=this.toEditorPos(n.rangeStart),a=this.toEditorPos(n.rangeEnd);o{let r=[];for(let s of n.getTextFormats()){let o=s.underlineStyle,a=s.underlineThickness;if(o!="None"&&a!="None"){let l=`text-decoration: underline ${o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${a=="Thin"?1:2}px`;r.push(M.mark({attributes:{style:l}}).range(this.toEditorPos(s.rangeStart),this.toEditorPos(s.rangeEnd)))}}e.dispatch({effects:Bd.of(M.set(r))})}),t.addEventListener("compositionstart",()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)}),t.addEventListener("compositionend",()=>{e.inputState.composing=-1,e.inputState.compositionFirstChange=null}),this.measureReq={read:n=>{this.editContext.updateControlBounds(n.contentDOM.getBoundingClientRect());let r=ar(n.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,o,a,l,h)=>{if(n)return;let c=h.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(h)){r=this.pendingContextChange=null,t+=c;return}else r=null,this.revertPending(e.state);if(s+=t,o+=t,o<=this.from)this.from+=c,this.to+=c;else if(sthis.to||this.to-this.from+h.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),h.toString()),this.to+=c}t+=c}),r&&!n&&this.revertPending(e.state),!n}update(e){!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.resetRange(e.state),this.editContext.updateText(0,this.editContext.text.length,e.state.doc.sliceString(this.from,this.to)),this.setSelection(e.state)):(e.docChanged||e.selectionSet)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.to+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to1e4*3)}toEditorPos(e){return e+this.from}toContextPos(e){return e-this.from}},E=class i{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(n=>n.forEach(r=>t(r,this)))||(n=>this.update(n)),this.dispatch=this.dispatch.bind(this),this._root=e.root||fy(e.parent)||document,this.viewState=new no(e.state||N.create(e)),e.scrollTo&&e.scrollTo.is(Vs)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Gn).map(n=>new nr(n));for(let n of this.plugins)n.update(this);this.observer=new rh(this),this.inputState=new Nl(this),this.inputState.ensureHandlers(this.plugins),this.docView=new eo(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure()}dispatch(...e){let t=e.length==1&&e[0]instanceof fe?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,n=!1,r,s=this.state;for(let u of e){if(u.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=u.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,a=0,l=null;e.some(u=>u.annotation(Kd))?(this.inputState.notifiedFocused=o,a=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,l=ep(s,o),l||(a=1));let h=this.observer.delayedAndroidKey,c=null;if(h?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(c=null)):this.observer.clear(),s.facet(N.phrases)!=this.state.facet(N.phrases))return this.setState(s);r=Ks.create(this,s,e),r.flags|=a;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let u of e){if(f&&(f=f.map(u.changes)),u.scrollIntoView){let{main:d}=u.state.selection;f=new ir(d.empty?d:S.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of u.effects)d.is(Vs)&&(f=d.value.clip(this.state))}this.viewState.update(r,f),this.bidiCache=so.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(Yn)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(Ws)!=r.state.facet(Ws)&&(this.viewState.mustMeasureContent=!0),(t||n||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let u of this.state.facet(Xl))try{u(r)}catch(d){we(this.state,d,"update listener")}(l||c)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),c&&!sp(this,c)&&h.force&&an(this.contentDOM,h.key,h.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let n of this.plugins)n.destroy(this);this.viewState=new no(e),this.plugins=e.facet(Gn).map(n=>new nr(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView.destroy(),this.docView=new eo(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Gn),n=e.state.facet(Gn);if(t!=n){let r=[];for(let s of n){let o=t.indexOf(s);if(o<0)r.push(new nr(s));else{let a=this.plugins[o];a.mustUpdate=e,r.push(a)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.scrollDOM,r=n.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(o<0)if(pd(n))s=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(r);s=d.from,o=d.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let h=[];l&4||([this.measureRequests,h]=[h,this.measureRequests]);let c=h.map(d=>{try{return d.read(this)}catch(m){return we(this.state,m),Ju}}),f=Ks.create(this,this.state,[]),u=!1;f.flags|=l,t?t.flags|=l:t=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),u=this.docView.update(f),u&&this.docViewUpdate());for(let d=0;d1||m<-1){r=r+m,n.scrollTop=r/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let a of this.state.facet(Xl))a(t)}get themeClasses(){return eh+" "+(this.state.facet(Kl)?np:ip)+" "+this.state.facet(Ws)}updateAttrs(){let e=Ku(this,Xd,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(Ht)?"true":"false",class:"cm-content",style:`${Q.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Ku(this,vh,t);let n=this.observer.ignore(()=>{let r=$l(this.contentDOM,this.contentAttrs,t),s=$l(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let r of n.effects)if(r.is(i.announce)){t&&(this.announceDOM.textContent=""),t=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(Yn);let e=this.state.facet(i.cspNonce);et.mount(this.root,this.styleModules.concat(cb).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;tn.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return Sl(this,e,Lu(this,e,t,n))}moveByGroup(e,t){return Sl(this,e,Lu(this,e,t,n=>Wy(this,e.head,n)))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),s=n[t?n.length-1:0];return S.cursor(s.side(t,r)+e.from,s.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return Xy(this,e,t,n)}moveVertically(e,t,n){return Sl(this,e,Iy(this,e,t,n))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),Ud(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let r=this.state.doc.lineAt(e),s=this.bidiSpans(r),o=s[bt.find(s,e-r.from,-1,t)];return yh(n,o.dir==H.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(Vd)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>yb)return Rd(e.length);let t=this.textDirectionAt(e.from),n;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t&&(s.fresh||Cd(s.isolates,n=Mu(this,e))))return s.order;n||(n=Mu(this,e));let r=Sy(e.text,t,n);return this.bidiCache.push(new so(e.from,e.to,t,n,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Q.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{ud(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Vs.of(new ir(typeof e=="number"?S.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return Vs.of(new ir(S.cursor(n.from),"start","start",n.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return re.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return re.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=et.newName(),r=[Ws.of(n),Yn.of(th(`.${n}`,e))];return t&&t.dark&&r.push(Kl.of(!0)),r}static baseTheme(e){return Qe.lowest(Yn.of(th("."+eh,e,rp)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),r=n&&J.get(n)||J.get(e);return((t=r?.rootView)===null||t===void 0?void 0:t.view)||null}};E.styleModule=Yn;E.inputHandler=Dd;E.scrollHandler=qd;E.focusChangeEffect=$d;E.perLineTextDirection=Vd;E.exceptionSink=_d;E.updateListener=Xl;E.editable=Ht;E.mouseSelectionStyle=Md;E.dragMovesSelection=Qd;E.clickAddsSelectionRange=Ad;E.decorations=dr;E.outerDecorations=Wd;E.atomicRanges=xh;E.bidiIsolatedRanges=Id;E.scrollMargins=Nd;E.darkTheme=Kl;E.cspNonce=A.define({combine:i=>i.length?i[0]:""});E.contentAttributes=vh;E.editorAttributes=Xd;E.lineWrapping=E.contentAttributes.of({class:"cm-lineWrapping"});E.announce=_.define();var yb=4096,Ju={},so=class i{constructor(e,t,n,r,s,o){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=s,this.order=o}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let n=[],r=e.length?e[e.length-1].dir:H.LTR;for(let s=Math.max(0,e.length-10);s=0;r--){let s=n[r],o=typeof s=="function"?s(i):s;o&&Dl(o,t)}return t}var bb=Q.mac?"mac":Q.windows?"win":Q.linux?"linux":"key";function wb(i,e){let t=i.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,s,o,a;for(let l=0;ln.concat(r),[]))),t}function lp(i,e,t){return hp(ap(i.state),e,i,t)}var Gt=null,xb=4e3;function kb(i,e=bb){let t=Object.create(null),n=Object.create(null),r=(o,a)=>{let l=n[o];if(l==null)n[o]=a;else if(l!=a)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,a,l,h,c)=>{var f,u;let d=t[o]||(t[o]=Object.create(null)),m=a.split(/ (?!$)/).map(O=>wb(O,e));for(let O=1;O{let x=Gt={view:v,prefix:y,scope:o};return setTimeout(()=>{Gt==x&&(Gt=null)},xb),!0}]})}let p=m.join(" ");r(p,!1);let g=d[p]||(d[p]={preventDefault:!1,stopPropagation:!1,run:((u=(f=d._any)===null||f===void 0?void 0:f.run)===null||u===void 0?void 0:u.slice())||[]});l&&g.run.push(l),h&&(g.preventDefault=!0),c&&(g.stopPropagation=!0)};for(let o of i){let a=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let h of a){let c=t[h]||(t[h]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let u in c)c[u].run.push(d=>f(d,oh))}let l=o[e]||o.key;if(l)for(let h of a)s(h,l,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(h,"Shift-"+l,o.shift,o.preventDefault,o.stopPropagation)}return t}var oh=null;function hp(i,e,t,n){oh=e;let r=Su(e),s=ce(r,0),o=Ee(s)==r.length&&r!=" ",a="",l=!1,h=!1,c=!1;Gt&&Gt.view==t&&Gt.scope==n&&(a=Gt.prefix+" ",Hd.indexOf(e.keyCode)<0&&(h=!0,Gt=null));let f=new Set,u=g=>{if(g){for(let O of g.run)if(!f.has(O)&&(f.add(O),O(t)))return g.stopPropagation&&(c=!0),!0;g.preventDefault&&(g.stopPropagation&&(c=!0),h=!0)}return!1},d=i[n],m,p;return d&&(u(d[a+Is(r,e,!o)])?l=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Q.windows&&e.ctrlKey&&e.altKey)&&(m=Vt[e.keyCode])&&m!=r?(u(d[a+Is(m,e,!0)])||e.shiftKey&&(p=tn[e.keyCode])!=r&&p!=m&&u(d[a+Is(p,e,!1)]))&&(l=!0):o&&e.shiftKey&&u(d[a+Is(r,e,!0)])&&(l=!0),!l&&u(d._any)&&(l=!0)),h&&(l=!0),l&&c&&e.stopPropagation(),oh=null,l}var pr=class i{constructor(e,t,n,r,s){this.className=e,this.left=t,this.top=n,this.width=r,this.height=s}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,n){if(n.empty){let r=e.coordsAtPos(n.head,n.assoc||1);if(!r)return[];let s=cp(e);return[new i(t,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return Sb(e,t,n)}};function cp(i){let e=i.scrollDOM.getBoundingClientRect();return{left:(i.textDirection==H.LTR?e.left:e.right-i.scrollDOM.clientWidth*i.scaleX)-i.scrollDOM.scrollLeft*i.scaleX,top:e.top-i.scrollDOM.scrollTop*i.scaleY}}function td(i,e,t,n){let r=i.coordsAtPos(e,t*2);if(!r)return n;let s=i.dom.getBoundingClientRect(),o=(r.top+r.bottom)/2,a=i.posAtCoords({x:s.left+1,y:o}),l=i.posAtCoords({x:s.right-1,y:o});return a==null||l==null?n:{from:Math.max(n.from,Math.min(a,l)),to:Math.min(n.to,Math.max(a,l))}}function Sb(i,e,t){if(t.to<=i.viewport.from||t.from>=i.viewport.to)return[];let n=Math.max(t.from,i.viewport.from),r=Math.min(t.to,i.viewport.to),s=i.textDirection==H.LTR,o=i.contentDOM,a=o.getBoundingClientRect(),l=cp(i),h=o.querySelector(".cm-line"),c=h&&window.getComputedStyle(h),f=a.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),u=a.right-(c?parseInt(c.paddingRight):0),d=Il(i,n),m=Il(i,r),p=d.type==_e.Text?d:null,g=m.type==_e.Text?m:null;if(p&&(i.lineWrapping||d.widgetLineBreaks)&&(p=td(i,n,1,p)),g&&(i.lineWrapping||m.widgetLineBreaks)&&(g=td(i,r,-1,g)),p&&g&&p.from==g.from&&p.to==g.to)return y(v(t.from,t.to,p));{let w=p?v(t.from,null,p):x(d,!1),P=g?v(null,t.to,g):x(m,!0),C=[];return(p||d).to<(g||m).from-(p&&g?1:0)||d.widgetLineBreaks>1&&w.bottom+i.defaultLineHeight/2q&&I.from=De)break;pe>ie&&X(Math.max(Ye,ie),w==null&&Ye<=q,Math.min(pe,De),P==null&&pe>=G,We.dir)}if(ie=$e.to+1,ie>=De)break}return V.length==0&&X(q,w==null,G,P==null,i.textDirection),{top:D,bottom:B,horizontal:V}}function x(w,P){let C=a.top+(P?w.top:w.bottom);return{top:C,bottom:C,horizontal:[]}}}function Tb(i,e){return i.constructor==e.constructor&&i.eq(e)}var ah=class{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(Fs)!=e.state.facet(Fs)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(Fs);for(;t!Tb(t,this.drawn[n]))){let t=this.dom.firstChild,n=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[n].constructor&&r.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(r.draw(),t);for(;t;){let r=t.nextSibling;t.remove(),t=r}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}},Fs=A.define();function fp(i){return[re.define(e=>new ah(e,i)),Fs.of(i)]}var up=!Q.ios,mr=A.define({combine(i){return Te(i,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function dp(i={}){return[mr.of(i),Pb,Cb,Rb,Ld.of(!0)]}function pp(i){return i.startState.facet(mr)!=i.state.facet(mr)}var Pb=fp({above:!0,markers(i){let{state:e}=i,t=e.facet(mr),n=[];for(let r of e.selection.ranges){let s=r==e.selection.main;if(r.empty?!s||up:t.drawRangeCursor){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=r.empty?r:S.cursor(r.head,r.head>r.anchor?-1:1);for(let l of pr.forRange(i,o,a))n.push(l)}}return n},update(i,e){i.transactions.some(n=>n.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=pp(i);return t&&id(i.state,e),i.docChanged||i.selectionSet||t},mount(i,e){id(e.state,i)},class:"cm-cursorLayer"});function id(i,e){e.style.animationDuration=i.facet(mr).cursorBlinkRate+"ms"}var Cb=fp({above:!1,markers(i){return i.state.selection.ranges.map(e=>e.empty?[]:pr.forRange(i,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(i,e){return i.docChanged||i.selectionSet||i.viewportChanged||pp(i)},class:"cm-selectionLayer"}),lh={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};up&&(lh[".cm-line"].caretColor=lh[".cm-content"].caretColor="transparent !important");var Rb=Qe.highest(E.theme(lh)),mp=_.define({map(i,e){return i==null?null:e.mapPos(i)}}),Kn=te.define({create(){return null},update(i,e){return i!=null&&(i=e.changes.mapPos(i)),e.effects.reduce((t,n)=>n.is(mp)?n.value:t,i)}}),Eb=re.fromClass(class{constructor(i){this.view=i,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(i){var e;let t=i.state.field(Kn);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(i.startState.field(Kn)!=t||i.docChanged||i.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:i}=this,e=i.state.field(Kn),t=e!=null&&i.coordsAtPos(e);if(!t)return null;let n=i.scrollDOM.getBoundingClientRect();return{left:t.left-n.left+i.scrollDOM.scrollLeft*i.scaleX,top:t.top-n.top+i.scrollDOM.scrollTop*i.scaleY,height:t.bottom-t.top}}drawCursor(i){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;i?(this.cursor.style.left=i.left/e+"px",this.cursor.style.top=i.top/t+"px",this.cursor.style.height=i.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(i){this.view.state.field(Kn)!=i&&this.view.dispatch({effects:mp.of(i)})}},{eventObservers:{dragover(i){this.setDropPos(this.view.posAtCoords({x:i.clientX,y:i.clientY}))},dragleave(i){(i.target==this.view.contentDOM||!this.view.contentDOM.contains(i.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function gp(){return[Kn,Eb]}function nd(i,e,t,n,r){e.lastIndex=0;for(let s=i.iterRange(t,n),o=t,a;!s.next().done;o+=s.value.length)if(!s.lineBreak)for(;a=e.exec(s.value);)r(o+a.index,a)}function Ab(i,e){let t=i.visibleRanges;if(t.length==1&&t[0].from==i.viewport.from&&t[0].to==i.viewport.to)return t;let n=[];for(let{from:r,to:s}of t)r=Math.max(i.state.doc.lineAt(r).from,r-e),s=Math.min(i.state.doc.lineAt(s).to,s+e),n.length&&n[n.length-1].to>=r?n[n.length-1].to=s:n.push({from:r,to:s});return n}var hh=class{constructor(e){let{regexp:t,decoration:n,decorate:r,boundary:s,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,r)this.addMatch=(a,l,h,c)=>r(c,h,h+a[0].length,a,l);else if(typeof n=="function")this.addMatch=(a,l,h,c)=>{let f=n(a,l,h);f&&c(h,h+a[0].length,f)};else if(n)this.addMatch=(a,l,h,c)=>c(h,h+a[0].length,n);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=o}createDeco(e){let t=new lt,n=t.add.bind(t);for(let{from:r,to:s}of Ab(e,this.maxLength))nd(e.state.doc,this.regexp,r,s,(o,a)=>this.addMatch(a,e,o,n));return t.finish()}updateDeco(e,t){let n=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((s,o,a,l)=>{l>e.view.viewport.from&&a1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),n,r):t}updateRange(e,t,n,r){for(let s of e.visibleRanges){let o=Math.max(s.from,n),a=Math.min(s.to,r);if(a>o){let l=e.state.doc.lineAt(o),h=l.tol.from;o--)if(this.boundary.test(l.text[o-1-l.from])){c=o;break}for(;au.push(O.range(p,g));if(l==h)for(this.regexp.lastIndex=c-l.from;(d=this.regexp.exec(l.text))&&d.indexthis.addMatch(g,e,p,m));t=t.update({filterFrom:c,filterTo:f,filter:(p,g)=>pf,add:u})}}return t}},ch=/x/.unicode!=null?"gu":"g",Qb=new RegExp(`[\0-\b +-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,ch),Mb={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},Pl=null;function _b(){var i;if(Pl==null&&typeof document<"u"&&document.body){let e=document.body.style;Pl=((i=e.tabSize)!==null&&i!==void 0?i:e.MozTabSize)!=null}return Pl||!1}var Hs=A.define({combine(i){let e=Te(i,{render:null,specialChars:Qb,addSpecialChars:null});return(e.replaceTabs=!_b())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,ch)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,ch)),e}});function Op(i={}){return[Hs.of(i),Db()]}var rd=null;function Db(){return rd||(rd=re.fromClass(class{constructor(i){this.view=i,this.decorations=M.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(i.state.facet(Hs)),this.decorations=this.decorator.createDeco(i)}makeDecorator(i){return new hh({regexp:i.specialChars,decoration:(e,t,n)=>{let{doc:r}=t.state,s=ce(e[0],0);if(s==9){let o=r.lineAt(n),a=t.state.tabSize,l=$t(o.text,a,n-o.from);return M.replace({widget:new uh((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=M.replace({widget:new fh(i,s)}))},boundary:i.replaceTabs?void 0:/[^]/})}update(i){let e=i.state.facet(Hs);i.startState.facet(Hs)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(i.view)):this.decorations=this.decorator.updateDeco(i,this.decorations)}},{decorations:i=>i.decorations}))}var $b="\u2022";function Vb(i){return i>=32?$b:i==10?"\u2424":String.fromCharCode(9216+i)}var fh=class extends Be{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=Vb(this.code),n=e.state.phrase("Control character")+" "+(Mb[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,n,t);if(r)return r;let s=document.createElement("span");return s.textContent=t,s.title=n,s.setAttribute("aria-label",n),s.className="cm-specialChar",s}ignoreEvent(){return!1}},uh=class extends Be{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}};function yp(){return qb}var Lb=M.line({class:"cm-activeLine"}),qb=re.fromClass(class{constructor(i){this.decorations=this.getDeco(i)}update(i){(i.docChanged||i.selectionSet)&&(this.decorations=this.getDeco(i.view))}getDeco(i){let e=-1,t=[];for(let n of i.state.selection.ranges){let r=i.lineBlockAt(n.head);r.from>e&&(t.push(Lb.range(r.from)),e=r.from)}return M.set(t)}},{decorations:i=>i.decorations});var dh=2e3;function Bb(i,e,t){let n=Math.min(e.line,t.line),r=Math.max(e.line,t.line),s=[];if(e.off>dh||t.off>dh||e.col<0||t.col<0){let o=Math.min(e.off,t.off),a=Math.max(e.off,t.off);for(let l=n;l<=r;l++){let h=i.doc.line(l);h.length<=a&&s.push(S.range(h.from+o,h.to+a))}}else{let o=Math.min(e.col,t.col),a=Math.max(e.col,t.col);for(let l=n;l<=r;l++){let h=i.doc.line(l),c=_s(h.text,o,i.tabSize,!0);if(c<0)s.push(S.cursor(h.to));else{let f=_s(h.text,a,i.tabSize);s.push(S.range(h.from+c,h.from+f))}}}return s}function Xb(i,e){let t=i.coordsAtPos(i.viewport.from);return t?Math.round(Math.abs((t.left-e)/i.defaultCharacterWidth)):-1}function sd(i,e){let t=i.posAtCoords({x:e.clientX,y:e.clientY},!1),n=i.state.doc.lineAt(t),r=t-n.from,s=r>dh?-1:r==n.length?Xb(i,e.clientX):$t(n.text,i.state.tabSize,t-n.from);return{line:n.number,col:s,off:r}}function Wb(i,e){let t=sd(i,e),n=i.state.selection;return t?{update(r){if(r.docChanged){let s=r.changes.mapPos(r.startState.doc.line(t.line).from),o=r.state.doc.lineAt(s);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},n=n.map(r.changes)}},get(r,s,o){let a=sd(i,r);if(!a)return n;let l=Bb(i.state,t,a);return l.length?o?S.create(l.concat(n.ranges)):S.create(l):n}}:null}function bp(i){let e=i?.eventFilter||(t=>t.altKey&&t.button==0);return E.mouseSelectionStyle.of((t,n)=>e(n)?Wb(t,n):null)}var Ib={Alt:[18,i=>!!i.altKey],Control:[17,i=>!!i.ctrlKey],Shift:[16,i=>!!i.shiftKey],Meta:[91,i=>!!i.metaKey]},Nb={style:"cursor: crosshair"};function wp(i={}){let[e,t]=Ib[i.key||"Alt"],n=re.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==e||t(r))},keyup(r){(r.keyCode==e||!t(r))&&this.set(!1)},mousemove(r){this.set(t(r))}}});return[n,E.contentAttributes.of(r=>{var s;return!((s=r.plugin(n))===null||s===void 0)&&s.isDown?Nb:null})]}var Hn="-10000px",oo=class{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=n(o,s))}update(e,t){var n;let r=e.state.facet(this.facet),s=r.filter(l=>l);if(r===this.input){for(let l of this.tooltipViews)l.update&&l.update(e);return!1}let o=[],a=t?[]:null;for(let l=0;lt[h]=l),t.length=a.length),this.input=r,this.tooltips=s,this.tooltipViews=o,!0}};function jb(i){let{win:e}=i;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}var Cl=A.define({combine:i=>{var e,t,n;return{position:Q.ios?"absolute":((e=i.find(r=>r.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=i.find(r=>r.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((n=i.find(r=>r.tooltipSpace))===null||n===void 0?void 0:n.tooltipSpace)||jb}}}),od=new WeakMap,kh=re.fromClass(class{constructor(i){this.view=i,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=i.state.facet(Cl);this.position=e.position,this.parent=e.parent,this.classes=i.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new oo(i,gr,(t,n)=>this.createTooltip(t,n),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),i.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let i of this.manager.tooltipViews)this.intersectionObserver.observe(i.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(i){i.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(i,this.above);e&&this.observeIntersection();let t=e||i.geometryChanged,n=i.state.facet(Cl);if(n.position!=this.position&&!this.madeAbsolute){this.position=n.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;t=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(i,e){let t=i.create(this.view),n=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),i.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",t.dom.appendChild(r)}return t.dom.style.position=this.position,t.dom.style.top=Hn,t.dom.style.left="0px",this.container.insertBefore(t.dom,n),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var i,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let n of this.manager.tooltipViews)n.dom.remove(),(i=n.destroy)===null||i===void 0||i.call(n);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let i=this.view.dom.getBoundingClientRect(),e=1,t=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:r}=this.manager.tooltipViews[0];if(Q.gecko)n=r.offsetParent!=this.container.ownerDocument.body;else if(r.style.top==Hn&&r.style.left=="0px"){let s=r.getBoundingClientRect();n=Math.abs(s.top+1e4)>1||Math.abs(s.left)>1}}if(n||this.position=="absolute")if(this.parent){let r=this.parent.getBoundingClientRect();r.width&&r.height&&(e=r.width/this.parent.offsetWidth,t=r.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);return{editor:i,parent:this.parent?this.container.getBoundingClientRect():i,pos:this.manager.tooltips.map((r,s)=>{let o=this.manager.tooltipViews[s];return o.getCoords?o.getCoords(r.pos):this.view.coordsAtPos(r.pos)}),size:this.manager.tooltipViews.map(({dom:r})=>r.getBoundingClientRect()),space:this.view.state.facet(Cl).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(i){var e;if(i.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let a of this.manager.tooltipViews)a.dom.style.position="absolute"}let{editor:t,space:n,scaleX:r,scaleY:s}=i,o=[];for(let a=0;a=Math.min(t.bottom,n.bottom)||f.rightMath.min(t.right,n.right)+.1){c.style.top=Hn;continue}let d=l.arrow?h.dom.querySelector(".cm-tooltip-arrow"):null,m=d?7:0,p=u.right-u.left,g=(e=od.get(h))!==null&&e!==void 0?e:u.bottom-u.top,O=h.offset||Ub,y=this.view.textDirection==H.LTR,v=u.width>n.right-n.left?y?n.left:n.right-u.width:y?Math.min(f.left-(d?14:0)+O.x,n.right-p):Math.max(n.left,f.left-p+(d?14:0)-O.x),x=this.above[a];!l.strictSide&&(x?f.top-(u.bottom-u.top)-O.yn.bottom)&&x==n.bottom-f.bottom>f.top-n.top&&(x=this.above[a]=!x);let w=(x?f.top-n.top:n.bottom-f.bottom)-m;if(wv&&D.topP&&(P=x?D.top-g-2-m:D.bottom+m+2);if(this.position=="absolute"?(c.style.top=(P-i.parent.top)/s+"px",c.style.left=(v-i.parent.left)/r+"px"):(c.style.top=P/s+"px",c.style.left=v/r+"px"),d){let D=f.left+(y?O.x:-O.x)-(v+14-7);d.style.left=D/r+"px"}h.overlap!==!0&&o.push({left:v,top:P,right:C,bottom:P+g}),c.classList.toggle("cm-tooltip-above",x),c.classList.toggle("cm-tooltip-below",!x),h.positioned&&h.positioned(i.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let i of this.manager.tooltipViews)i.dom.style.top=Hn}},{eventObservers:{scroll(){this.maybeMeasure()}}}),zb=E.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),Ub={x:0,y:0},gr=A.define({enables:[kh,zb]}),ao=A.define({combine:i=>i.reduce((e,t)=>e.concat(t),[])}),lo=class i{static create(e){return new i(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new oo(e,ao,(t,n)=>this.createHostedView(t,n),t=>t.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let r=n[e];if(r!==void 0){if(t===void 0)t=r;else if(t!==r)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}},Fb=gr.compute([ao],i=>{let e=i.facet(ao);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var n;return(n=t.end)!==null&&n!==void 0?n:t.pos})),create:lo.create,above:e[0].above,arrow:e.some(t=>t.arrow)}}),ph=class{constructor(e,t,n,r,s){this.view=e,this.source=t,this.field=n,this.setHover=r,this.hoverTime=s,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;ea.bottom||t.xa.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(r)).find(c=>c.from<=r&&c.to>=r),h=l&&l.dir==H.RTL?-1:1;s=t.x{this.pending==a&&(this.pending=null,l&&!(Array.isArray(l)&&!l.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])}))},l=>we(e.state,l,"hover tooltip"))}else o&&!(Array.isArray(o)&&!o.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(kh),t=e?e.manager.tooltips.findIndex(n=>n.create==lo.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,n;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:s}=this;if(r.length&&s&&!Hb(s.dom,e)||this.pending){let{pos:o}=r[0]||this.pending,a=(n=(t=r[0])===null||t===void 0?void 0:t.end)!==null&&n!==void 0?n:o;(o==a?this.view.posAtCoords(this.lastMove)!=o:!Gb(this.view,o,a,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:n}=this;n&&n.dom.contains(e.relatedTarget)?this.watchTooltipLeave(n.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}},Ns=4;function Hb(i,e){let t=i.getBoundingClientRect();return e.clientX>=t.left-Ns&&e.clientX<=t.right+Ns&&e.clientY>=t.top-Ns&&e.clientY<=t.bottom+Ns}function Gb(i,e,t,n,r,s){let o=i.scrollDOM.getBoundingClientRect(),a=i.documentTop+i.documentPadding.top+i.contentHeight;if(o.left>n||o.rightr||Math.min(o.bottom,a)=e&&l<=t}function vp(i,e={}){let t=_.define(),n=te.define({create(){return[]},update(r,s){if(r.length&&(e.hideOnChange&&(s.docChanged||s.selection)?r=[]:e.hideOn&&(r=r.filter(o=>!e.hideOn(s,o))),s.docChanged)){let o=[];for(let a of r){let l=s.changes.mapPos(a.pos,-1,ge.TrackDel);if(l!=null){let h=Object.assign(Object.create(null),a);h.pos=l,h.end!=null&&(h.end=s.changes.mapPos(h.end)),o.push(h)}}r=o}for(let o of s.effects)o.is(t)&&(r=o.value),o.is(Yb)&&(r=[]);return r},provide:r=>ao.from(r)});return[n,re.define(r=>new ph(r,i,n,t,e.hoverTime||300)),Fb]}function Sh(i,e){let t=i.plugin(kh);if(!t)return null;let n=t.manager.tooltips.indexOf(e);return n<0?null:t.manager.tooltipViews[n]}var Yb=_.define();var ad=A.define({combine(i){let e,t;for(let n of i)e=e||n.topContainer,t=t||n.bottomContainer;return{topContainer:e,bottomContainer:t}}});function Pi(i,e){let t=i.plugin(xp),n=t?t.specs.indexOf(e):-1;return n>-1?t.panels[n]:null}var xp=re.fromClass(class{constructor(i){this.input=i.state.facet(Ti),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(i));let e=i.state.facet(ad);this.top=new sn(i,!0,e.topContainer),this.bottom=new sn(i,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(i){let e=i.state.facet(ad);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new sn(i.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new sn(i.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=i.state.facet(Ti);if(t!=this.input){let n=t.filter(l=>l),r=[],s=[],o=[],a=[];for(let l of n){let h=this.specs.indexOf(l),c;h<0?(c=l(i.view),a.push(c)):(c=this.panels[h],c.update&&c.update(i)),r.push(c),(c.top?s:o).push(c)}this.specs=n,this.panels=r,this.top.sync(s),this.bottom.sync(o);for(let l of a)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let n of this.panels)n.update&&n.update(i)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:i=>E.scrollMargins.of(e=>{let t=e.plugin(i);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})}),sn=class{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=ld(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=ld(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}};function ld(i){let e=i.nextSibling;return i.remove(),e}var Ti=A.define({enables:xp}),ze=class extends at{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};ze.prototype.elementClass="";ze.prototype.toDOM=void 0;ze.prototype.mapMode=ge.TrackBefore;ze.prototype.startSide=ze.prototype.endSide=-1;ze.prototype.point=!0;var Gs=A.define(),Zb={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>j.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},sr=A.define();function Th(i){return[kp(),sr.of(Object.assign(Object.assign({},Zb),i))]}var mh=A.define({combine:i=>i.some(e=>e)});function kp(i){let e=[Jb];return i&&i.fixed===!1&&e.push(mh.of(!0)),e}var Jb=re.fromClass(class{constructor(i){this.view=i,this.prevViewport=i.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=i.state.facet(sr).map(e=>new ho(i,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!i.state.facet(mh),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),i.scrollDOM.insertBefore(this.dom,i.contentDOM)}update(i){if(this.updateGutters(i)){let e=this.prevViewport,t=i.view.viewport,n=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(n<(t.to-t.from)*.8)}i.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(mh)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=i.view.viewport}syncGutters(i){let e=this.dom.nextSibling;i&&this.dom.remove();let t=j.iter(this.view.state.facet(Gs),this.view.viewport.from),n=[],r=this.gutters.map(s=>new Oh(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(n.length&&(n=[]),Array.isArray(s.type)){let o=!0;for(let a of s.type)if(a.type==_e.Text&&o){gh(t,n,a.from);for(let l of r)l.line(this.view,a,n);o=!1}else if(a.widget)for(let l of r)l.widget(this.view,a)}else if(s.type==_e.Text){gh(t,n,s.from);for(let o of r)o.line(this.view,s,n)}else if(s.widget)for(let o of r)o.widget(this.view,s);for(let s of r)s.finish();i&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(i){let e=i.startState.facet(sr),t=i.state.facet(sr),n=i.docChanged||i.heightChanged||i.viewportChanged||!j.eq(i.startState.facet(Gs),i.state.facet(Gs),i.view.viewport.from,i.view.viewport.to);if(e==t)for(let r of this.gutters)r.update(i)&&(n=!0);else{n=!0;let r=[];for(let s of t){let o=e.indexOf(s);o<0?r.push(new ho(this.view,s)):(this.gutters[o].update(i),r.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)this.dom.appendChild(s.dom);this.gutters=r}return n}destroy(){for(let i of this.gutters)i.destroy();this.dom.remove()}},{provide:i=>E.scrollMargins.of(e=>{let t=e.plugin(i);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==H.LTR?{left:t.dom.offsetWidth*e.scaleX}:{right:t.dom.offsetWidth*e.scaleX}})});function hd(i){return Array.isArray(i)?i:[i]}function gh(i,e,t){for(;i.value&&i.from<=t;)i.from==t&&e.push(i.value),i.next()}var Oh=class{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=j.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:r}=this,s=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==r.elements.length){let a=new co(e,o,s,n);r.elements.push(a),r.dom.appendChild(a.dom)}else r.elements[this.i].update(e,o,s,n);this.height=t.bottom,this.i++}line(e,t,n){let r=[];gh(this.cursor,r,t.from),n.length&&(r=r.concat(n));let s=this.gutter.config.lineMarker(e,t,r);s&&r.unshift(s);let o=this.gutter;r.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,r)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t);n&&this.addElement(e,t,[n])}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}},ho=class{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let n in t.domEventHandlers)this.dom.addEventListener(n,r=>{let s=r.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let l=s.getBoundingClientRect();o=(l.top+l.bottom)/2}else o=r.clientY;let a=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[n](e,a,r)&&r.preventDefault()});this.markers=hd(t.markers(e)),t.initialSpacer&&(this.spacer=new co(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=hd(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],e);r!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[r])}let n=e.view.viewport;return!j.eq(this.markers,t,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}},co=class{constructor(e,t,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,r)}update(e,t,n,r){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),Kb(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let n="cm-gutterElement",r=this.dom.firstChild;for(let s=0,o=0;;){let a=o,l=ss(a,l,h)||o(a,l,h):o}return n}})}}),or=class extends ze{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};function Rl(i,e){return i.state.facet(on).formatNumber(e,i.state)}var tw=sr.compute([on],i=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(ew)},lineMarker(e,t,n){return n.some(r=>r.toDOM)?null:new or(Rl(e,e.state.doc.lineAt(t.from).number))},widgetMarker:()=>null,lineMarkerChange:e=>e.startState.facet(on)!=e.state.facet(on),initialSpacer(e){return new or(Rl(e,cd(e.state.doc.lines)))},updateSpacer(e,t){let n=Rl(t.view,cd(t.view.state.doc.lines));return n==e.number?e:new or(n)},domEventHandlers:i.facet(on).domEventHandlers}));function Sp(i={}){return[on.of(i),kp(),tw]}function cd(i){let e=9;for(;e{let e=[],t=-1;for(let n of i.selection.ranges){let r=i.doc.lineAt(n.head).from;r>t&&(t=r,e.push(iw.range(r)))}return j.of(e)});function Tp(){return nw}var rw=0,Or=class{constructor(e,t){this.from=e,this.to=t}},$=class{constructor(e={}){this.id=rw++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Pe.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};$.closedBy=new $({deserialize:i=>i.split(" ")});$.openedBy=new $({deserialize:i=>i.split(" ")});$.group=new $({deserialize:i=>i.split(" ")});$.isolate=new $({deserialize:i=>{if(i&&i!="rtl"&&i!="ltr"&&i!="auto")throw new RangeError("Invalid value for isolate: "+i);return i||"auto"}});$.contextHash=new $({perNode:!0});$.lookAhead=new $({perNode:!0});$.mounted=new $({perNode:!0});var ln=class{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}static get(e){return e&&e.props&&e.props[$.mounted.id]}},sw=Object.create(null),Pe=class i{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):sw,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new i(e.name||"",t,e.id,n);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop($.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(" "))t[r]=e[n];return n=>{for(let r=n.prop($.group),s=-1;s<(r?r.length:0);s++){let o=t[s<0?n.name:r[s]];if(o)return o}}}};Pe.none=new Pe("",Object.create(null),0,8);var yr=class i{constructor(e){this.types=e;for(let t=0;t0;for(let l=this.cursor(o|oe.IncludeAnonymous);;){let h=!1;if(l.from<=s&&l.to>=r&&(!a&&l.type.isAnonymous||t(l)!==!1)){if(l.firstChild())continue;h=!0}for(;h&&n&&(a||!l.type.isAnonymous)&&n(l),!l.nextSibling();){if(!l.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Mh(Pe.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new i(this.type,t,n,r,this.propValues),e.makeTree||((t,n,r)=>new i(Pe.none,t,n,r)))}static build(e){return aw(e)}};le.empty=new le(Pe.none,[],[],0);var Ph=class i{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new i(this.buffer,this.index)}},ei=class i{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return Pe.none}toString(){let e=[];for(let t=0;t0));l=o[l+3]);return a}slice(e,t,n){let r=this.buffer,s=new Uint16Array(t-e),o=0;for(let a=e,l=0;a=e&&te;case 1:return t<=e&&n>e;case 2:return n>e;case 4:return!0}}function br(i,e,t,n){for(var r;i.from==i.to||(t<1?i.from>=e:i.from>e)||(t>-1?i.to<=e:i.to0?a.length:-1;e!=h;e+=t){let c=a[e],f=l[e]+o.from;if(Ep(r,n,f,f+c.length)){if(c instanceof ei){if(s&oe.ExcludeBuffers)continue;let u=c.findChild(0,c.buffer.length,t,n-f,r);if(u>-1)return new Ci(new Rh(o,c,e,f),null,u)}else if(s&oe.IncludeAnonymous||!c.type.isAnonymous||Qh(c)){let u;if(!(s&oe.IgnoreMounts)&&(u=ln.get(c))&&!u.overlay)return new i(u.tree,f,e,o);let d=new i(c,f,e,o);return s&oe.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?c.children.length-1:0,t,n,r)}}}if(s&oe.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,n=0){let r;if(!(n&oe.IgnoreOverlays)&&(r=ln.get(this._tree))&&r.overlay){let s=e-this.from;for(let{from:o,to:a}of r.overlay)if((t>0?o<=s:o=s:a>s))return new i(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function Cp(i,e,t,n){let r=i.cursor(),s=[];if(!r.firstChild())return s;if(t!=null){for(let o=!1;!o;)if(o=r.type.is(t),!r.nextSibling())return s}for(;;){if(n!=null&&r.type.is(n))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return n==null?s:[]}}function Ch(i,e,t=e.length-1){for(let n=i.parent;t>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[t]&&e[t]!=n.name)return!1;t--}}return!0}var Rh=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},Ci=class i extends mo{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,n);return s<0?null:new i(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,n=0){if(n&oe.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new i(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new i(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new i(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,s=n.buffer[this.index+3];if(s>r){let o=n.buffer[this.index+1];e.push(n.slice(r,s,o)),t.push(0)}return new le(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function Ap(i){if(!i.length)return null;let e=0,t=i[0];for(let s=1;st.from||o.to=e){let a=new nt(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[n])).push(br(a,e,t,!1))}}return r?Ap(r):n}var wr=class{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof nt)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof nt?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&oe.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&oe.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&oe.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let r=n<0?0:this.stack[n]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{let r=t.buffer[this.index+3];if(r<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(r)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index-1)for(let s=t+e,o=e<0?-1:n._tree.children.length;s!=o;s+=e){let a=n._tree.children[s];if(this.mode&oe.IncludeAnonymous||a instanceof ei||!a.type.isAnonymous||Qh(a))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;t=o,n=s+1;break e}r=this.stack[--s]}for(let r=n;r=0;s--){if(s<0)return Ch(this.node,e,r);let o=n[t.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}};function Qh(i){return i.children.some(e=>e instanceof ei||!e.type.isAnonymous||Qh(e))}function aw(i){var e;let{buffer:t,nodeSet:n,maxBufferLength:r=1024,reused:s=[],minRepeatType:o=n.types.length}=i,a=Array.isArray(t)?new Ph(t,t.length):t,l=n.types,h=0,c=0;function f(w,P,C,D,B,V){let{id:X,start:q,end:G,size:I}=a,ie=c;for(;I<0;)if(a.next(),I==-1){let pe=s[X];C.push(pe),D.push(q-w);return}else if(I==-3){h=X;return}else if(I==-4){c=X;return}else throw new RangeError(`Unrecognized record size: ${I}`);let De=l[X],$e,We,Ye=q-w;if(G-q<=r&&(We=g(a.pos-P,B))){let pe=new Uint16Array(We.size-We.skip),Ze=a.pos-We.size,dt=pe.length;for(;a.pos>Ze;)dt=O(We.start,pe,dt);$e=new ei(pe,G-We.start,n),Ye=We.start-w}else{let pe=a.pos-I;a.next();let Ze=[],dt=[],hi=X>=o?X:-1,qi=0,Hr=G;for(;a.pos>pe;)hi>=0&&a.id==hi&&a.size>=0?(a.end<=Hr-r&&(m(Ze,dt,q,qi,a.end,Hr,hi,ie),qi=Ze.length,Hr=a.end),a.next()):V>2500?u(q,pe,Ze,dt):f(q,pe,Ze,dt,hi,V+1);if(hi>=0&&qi>0&&qi-1&&qi>0){let of=d(De);$e=Mh(De,Ze,dt,0,Ze.length,0,G-q,of,of)}else $e=p(De,Ze,dt,G-q,ie-G)}C.push($e),D.push(Ye)}function u(w,P,C,D){let B=[],V=0,X=-1;for(;a.pos>P;){let{id:q,start:G,end:I,size:ie}=a;if(ie>4)a.next();else{if(X>-1&&G=0;I-=3)q[ie++]=B[I],q[ie++]=B[I+1]-G,q[ie++]=B[I+2]-G,q[ie++]=ie;C.push(new ei(q,B[2]-G,n)),D.push(G-w)}}function d(w){return(P,C,D)=>{let B=0,V=P.length-1,X,q;if(V>=0&&(X=P[V])instanceof le){if(!V&&X.type==w&&X.length==D)return X;(q=X.prop($.lookAhead))&&(B=C[V]+X.length+q)}return p(w,P,C,D,B)}}function m(w,P,C,D,B,V,X,q){let G=[],I=[];for(;w.length>D;)G.push(w.pop()),I.push(P.pop()+C-B);w.push(p(n.types[X],G,I,V-B,q-V)),P.push(B-C)}function p(w,P,C,D,B=0,V){if(h){let X=[$.contextHash,h];V=V?[X].concat(V):[X]}if(B>25){let X=[$.lookAhead,B];V=V?[X].concat(V):[X]}return new le(w,P,C,D,V)}function g(w,P){let C=a.fork(),D=0,B=0,V=0,X=C.end-r,q={size:0,start:0,skip:0};e:for(let G=C.pos-w;C.pos>G;){let I=C.size;if(C.id==P&&I>=0){q.size=D,q.start=B,q.skip=V,V+=4,D+=4,C.next();continue}let ie=C.pos-I;if(I<0||ie=o?4:0,$e=C.start;for(C.next();C.pos>ie;){if(C.size<0)if(C.size==-3)De+=4;else break e;else C.id>=o&&(De+=4);C.next()}B=$e,D+=I,V+=De}return(P<0||D==w)&&(q.size=D,q.start=B,q.skip=V),q.size>4?q:void 0}function O(w,P,C){let{id:D,start:B,end:V,size:X}=a;if(a.next(),X>=0&&D4){let G=a.pos-(X-4);for(;a.pos>G;)C=O(w,P,C)}P[--C]=q,P[--C]=V-w,P[--C]=B-w,P[--C]=D}else X==-3?h=D:X==-4&&(c=D);return C}let y=[],v=[];for(;a.pos>0;)f(i.start||0,i.bufferStart||0,y,v,-1,0);let x=(e=i.length)!==null&&e!==void 0?e:y.length?v[0]+y[0].length:0;return new le(l[i.topID],y.reverse(),v.reverse(),x)}var Rp=new WeakMap;function po(i,e){if(!i.isAnonymous||e instanceof ei||e.type!=i)return 1;let t=Rp.get(e);if(t==null){t=1;for(let n of e.children){if(n.type!=i||!(n instanceof le)){t=1;break}t+=po(i,n)}Rp.set(e,t)}return t}function Mh(i,e,t,n,r,s,o,a,l){let h=0;for(let m=n;m=c)break;P+=C}if(v==x+1){if(P>c){let C=m[x];d(C.children,C.positions,0,C.children.length,p[x]+y);continue}f.push(m[x])}else{let C=p[v-1]+m[v-1].length-w;f.push(Mh(i,m,p,x,v,w,C,null,l))}u.push(w+y-s)}}return d(e,t,n,r,0),(a||l)(f,u,o)}var go=class{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof Ci?this.setBuffer(e.context.buffer,e.index,t):e instanceof nt&&this.map.set(e.tree,t)}get(e){return e instanceof Ci?this.getBuffer(e.context.buffer,e.index):e instanceof nt?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}},Ri=class i{constructor(e,t,n,r,s=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],n=!1){let r=[new i(0,e.length,e,0,!1,n)];for(let s of t)s.to>e.length&&r.push(s);return r}static applyChanges(e,t,n=128){if(!t.length)return e;let r=[],s=1,o=e.length?e[0]:null;for(let a=0,l=0,h=0;;a++){let c=a=n)for(;o&&o.from=u.from||f<=u.to||h){let d=Math.max(u.from,l)-h,m=Math.min(u.to,f)-h;u=d>=m?null:new i(d,m,u.tree,u.offset+h,a>0,!!c)}if(u&&r.push(u),o.to>f)break;o=snew Or(r.from,r.to)):[new Or(0,0)]:[new Or(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let s=r.advance();if(s)return s}}},Ah=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}};var pT=new $({perNode:!0});var lw=0,Tt=class i{constructor(e,t,n){this.set=e,this.base=t,this.modified=n,this.id=lw++}static define(e){if(e?.base)throw new Error("Can not derive from a modified tag");let t=new i([],null,[]);if(t.set.push(t),e)for(let n of e.set)t.set.push(n);return t}static defineModifier(){let e=new wo;return t=>t.modified.indexOf(e)>-1?t:wo.get(t.base||t,t.modified.concat(e).sort((n,r)=>n.id-r.id))}},hw=0,wo=class i{constructor(){this.instances=[],this.id=hw++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(a=>a.base==e&&cw(t,a.modified));if(n)return n;let r=[],s=new Tt(r,e,t);for(let a of t)a.instances.push(s);let o=fw(t);for(let a of e.set)if(!a.modified.length)for(let l of o)r.push(i.get(a,l));return s}};function cw(i,e){return i.length==e.length&&i.every((t,n)=>t==e[n])}function fw(i){let e=[[]];for(let t=0;tn.length-t.length)}function fn(i){let e=Object.create(null);for(let t in i){let n=i[t];Array.isArray(n)||(n=[n]);for(let r of t.split(" "))if(r){let s=[],o=2,a=r;for(let f=0;;){if(a=="..."&&f>0&&f+3==r.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!u)throw new RangeError("Invalid path: "+r);if(s.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==r.length)break;let d=r[f++];if(f==r.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+r);a=r.slice(f)}let l=s.length-1,h=s[l];if(!h)throw new RangeError("Invalid path: "+r);let c=new cn(n,o,l>0?s.slice(0,l):null);e[h]=c.sort(e[h])}}return _p.add(e)}var _p=new $,cn=class{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=r;for(let a of s)for(let l of a.set){let h=t[l.id];if(h){o=o?o+" "+h:h;break}}return o},scope:n}}function uw(i,e){let t=null;for(let n of i){let r=n.style(e);r&&(t=t?t+" "+r:r)}return t}function Vh(i,e,t,n=0,r=i.length){let s=new Dh(n,Array.isArray(e)?e:[e],t);s.highlightRange(i.cursor(),n,r,"",s.highlighters),s.flush(r)}function Lh(i,e,t,n,r,s=0,o=i.length){let a=s;function l(h,c){if(!(h<=a)){for(let f=i.slice(a,h),u=0;;){let d=f.indexOf(` +`,u),m=d<0?f.length:d;if(m>u&&n(f.slice(u,m),c),d<0)break;r(),u=d+1}a=h}}Vh(e,t,(h,c,f)=>{l(h,""),l(c,f)},s,o),l(o,"")}var Dh=class{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,s){let{type:o,from:a,to:l}=e;if(a>=n||l<=t)return;o.isTop&&(s=this.highlighters.filter(d=>!d.scope||d.scope(o)));let h=r,c=dw(e)||cn.empty,f=uw(s,c.tags);if(f&&(h&&(h+=" "),h+=f,c.mode==1&&(r+=(r?" ":"")+f)),this.startSpan(Math.max(t,a),h),c.opaque)return;let u=e.tree&&e.tree.prop($.mounted);if(u&&u.overlay){let d=e.node.enter(u.overlay[0].from+a,1),m=this.highlighters.filter(g=>!g.scope||g.scope(u.tree.type)),p=e.firstChild();for(let g=0,O=a;;g++){let y=g=v||!e.nextSibling())););if(!y||v>n)break;O=y.to+a,O>t&&(this.highlightRange(d.cursor(),Math.max(t,y.from+a),Math.min(n,O),"",m),this.startSpan(Math.min(n,O),h))}p&&e.parent()}else if(e.firstChild()){u&&(r="");do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,r,s),this.startSpan(Math.min(n,e.to),h)}while(e.nextSibling());e.parent()}}};function dw(i){let e=i.type.prop(_p);for(;e&&e.context&&!i.matchContext(e.context);)e=e.next;return e||null}var R=Tt.define,Oo=R(),ti=R(),Qp=R(ti),Mp=R(ti),ii=R(),yo=R(ii),_h=R(ii),St=R(),Ei=R(St),xt=R(),kt=R(),$h=R(),vr=R($h),bo=R(),b={comment:Oo,lineComment:R(Oo),blockComment:R(Oo),docComment:R(Oo),name:ti,variableName:R(ti),typeName:Qp,tagName:R(Qp),propertyName:Mp,attributeName:R(Mp),className:R(ti),labelName:R(ti),namespace:R(ti),macroName:R(ti),literal:ii,string:yo,docString:R(yo),character:R(yo),attributeValue:R(yo),number:_h,integer:R(_h),float:R(_h),bool:R(ii),regexp:R(ii),escape:R(ii),color:R(ii),url:R(ii),keyword:xt,self:R(xt),null:R(xt),atom:R(xt),unit:R(xt),modifier:R(xt),operatorKeyword:R(xt),controlKeyword:R(xt),definitionKeyword:R(xt),moduleKeyword:R(xt),operator:kt,derefOperator:R(kt),arithmeticOperator:R(kt),logicOperator:R(kt),bitwiseOperator:R(kt),compareOperator:R(kt),updateOperator:R(kt),definitionOperator:R(kt),typeOperator:R(kt),controlOperator:R(kt),punctuation:$h,separator:R($h),bracket:vr,angleBracket:R(vr),squareBracket:R(vr),paren:R(vr),brace:R(vr),content:St,heading:Ei,heading1:R(Ei),heading2:R(Ei),heading3:R(Ei),heading4:R(Ei),heading5:R(Ei),heading6:R(Ei),contentSeparator:R(St),list:R(St),quote:R(St),emphasis:R(St),strong:R(St),link:R(St),monospace:R(St),strikethrough:R(St),inserted:R(),deleted:R(),changed:R(),invalid:R(),meta:bo,documentMeta:R(bo),annotation:R(bo),processingInstruction:R(bo),definition:Tt.defineModifier(),constant:Tt.defineModifier(),function:Tt.defineModifier(),standard:Tt.defineModifier(),local:Tt.defineModifier(),special:Tt.defineModifier()},OT=xr([{tag:b.link,class:"tok-link"},{tag:b.heading,class:"tok-heading"},{tag:b.emphasis,class:"tok-emphasis"},{tag:b.strong,class:"tok-strong"},{tag:b.keyword,class:"tok-keyword"},{tag:b.atom,class:"tok-atom"},{tag:b.bool,class:"tok-bool"},{tag:b.url,class:"tok-url"},{tag:b.labelName,class:"tok-labelName"},{tag:b.inserted,class:"tok-inserted"},{tag:b.deleted,class:"tok-deleted"},{tag:b.literal,class:"tok-literal"},{tag:b.string,class:"tok-string"},{tag:b.number,class:"tok-number"},{tag:[b.regexp,b.escape,b.special(b.string)],class:"tok-string2"},{tag:b.variableName,class:"tok-variableName"},{tag:b.local(b.variableName),class:"tok-variableName tok-local"},{tag:b.definition(b.variableName),class:"tok-variableName tok-definition"},{tag:b.special(b.variableName),class:"tok-variableName2"},{tag:b.definition(b.propertyName),class:"tok-propertyName tok-definition"},{tag:b.typeName,class:"tok-typeName"},{tag:b.namespace,class:"tok-namespace"},{tag:b.className,class:"tok-className"},{tag:b.macroName,class:"tok-macroName"},{tag:b.propertyName,class:"tok-propertyName"},{tag:b.operator,class:"tok-operator"},{tag:b.comment,class:"tok-comment"},{tag:b.meta,class:"tok-meta"},{tag:b.invalid,class:"tok-invalid"},{tag:b.punctuation,class:"tok-punctuation"}]);var qh,un=new $;function pw(i){return A.define({combine:i?e=>e.concat(i):void 0})}var mw=new $,Ue=class{constructor(e,t,n=[],r=""){this.data=e,this.name=r,N.prototype.hasOwnProperty("tree")||Object.defineProperty(N.prototype,"tree",{get(){return he(this)}}),this.parser=t,this.extension=[ni.of(this),N.languageData.of((s,o,a)=>{let l=Dp(s,o,a),h=l.type.prop(un);if(!h)return[];let c=s.facet(h),f=l.type.prop(mw);if(f){let u=l.resolve(o-l.from,a);for(let d of f)if(d.test(u,s)){let m=s.facet(d.facet);return d.type=="replace"?m:m.concat(c)}}return c})].concat(n)}isActiveAt(e,t,n=-1){return Dp(e,t,n).type.prop(un)==this.data}findRegions(e){let t=e.facet(ni);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(s,o)=>{if(s.prop(un)==this.data){n.push({from:o,to:o+s.length});return}let a=s.prop($.mounted);if(a){if(a.tree.prop(un)==this.data){if(a.overlay)for(let l of a.overlay)n.push({from:l.from+o,to:l.to+o});else n.push({from:o,to:o+s.length});return}else if(a.overlay){let l=n.length;if(r(a.tree,a.overlay[0].from+o),n.length>l)return}}for(let l=0;ln.isTop?t:void 0)]}),e.name)}configure(e,t){return new i(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function he(i){let e=i.field(Ue.state,!1);return e?e.tree:le.empty}var Ih=class{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},kr=null,Nh=class i{constructor(e,t,n=[],r,s,o,a,l){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=s,this.viewport=o,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new i(e,t,[],le.empty,0,n,[],null)}startParse(){return this.parser.startParse(new Ih(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=le.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Ri.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=kr;kr=this;try{return e()}finally{kr=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=$p(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:r,treeLen:s,viewport:o,skipped:a}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((h,c,f,u)=>l.push({fromA:h,toA:c,fromB:f,toB:u})),n=Ri.applyChanges(n,l),r=le.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){a=[];for(let h of this.skipped){let c=e.mapPos(h.from,1),f=e.mapPos(h.to,-1);ce.from&&(this.fragments=$p(this.fragments,r,s),this.skipped.splice(n--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends hn{createParse(t,n,r){let s=r[0].from,o=r[r.length-1].to;return{parsedPos:s,advance(){let l=kr;if(l){for(let h of r)l.tempSkipped.push(h);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=o,new le(Pe.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return kr}};function $p(i,e,t){return Ri.applyChanges(i,[{fromA:e,toA:t,fromB:e,toB:t}])}var Tr=class i{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new i(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=Nh.create(e.facet(ni).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new i(n)}};Ue.state=te.define({create:Tr.init,update(i,e){for(let t of e.effects)if(t.is(Ue.setState))return t.value;return e.startState.facet(ni)!=e.state.facet(ni)?Tr.init(e.state):i.apply(e)}});var Xp=i=>{let e=setTimeout(()=>i(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Xp=i=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(i,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});var Bh=typeof navigator<"u"&&(!((qh=navigator.scheduling)===null||qh===void 0)&&qh.isInputPending)?()=>navigator.scheduling.isInputPending():null,gw=re.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Ue.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Ue.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Xp(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndr+1e3,l=s.context.work(()=>Bh&&Bh()||Date.now()>o,r+(a?0:1e5));this.chunkBudget-=Date.now()-t,(l||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Ue.setState.of(new Tr(s.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>we(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),ni=A.define({combine(i){return i.length?i[0]:null},enables:i=>[Ue.state,gw,E.contentAttributes.compute([i],e=>{let t=e.facet(i);return t&&t.name?{"data-language":t.name}:{}})]}),pn=class{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}};var Ow=A.define(),mn=A.define({combine:i=>{if(!i.length)return" ";let e=i[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(i[0]));return e}});function Pr(i){let e=i.facet(mn);return e.charCodeAt(0)==9?i.tabSize*e.length:e.length}function gn(i,e){let t="",n=i.tabSize,r=i.facet(mn)[0];if(r==" "){for(;e>=n;)t+=" ",e-=n;r=" "}for(let s=0;s=e?yw(i,t,e):null}var Ai=class{constructor(e,t={}){this.state=e,this.options=t,this.unit=Pr(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=n.from&&r<=n.to?s&&r==e?{text:"",from:e}:(t<0?r-1&&(s+=o-this.countColumn(n,n.search(/\S|$/))),s}countColumn(e,t=e.length){return $t(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let o=s(r);if(o>-1)return o}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},Cr=new $;function yw(i,e,t){let n=e.resolveStack(t),r=n.node.enterUnfinishedNodesBefore(t);if(r!=n.node){let s=[];for(let o=r;o!=n.node;o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)n={node:s[o],next:n}}return Wp(n,i,t)}function Wp(i,e,t){for(let n=i;n;n=n.next){let r=ww(n.node);if(r)return r(jh.create(e,t,n))}return 0}function bw(i){return i.pos==i.options.simulateBreak&&i.options.simulateDoubleBreak}function ww(i){let e=i.type.prop(Cr);if(e)return e;let t=i.firstChild,n;if(t&&(n=t.type.prop($.closedBy))){let r=i.lastChild,s=r&&n.indexOf(r.name)>-1;return o=>Ip(o,!0,1,void 0,s&&!bw(o)?r.from:void 0)}return i.parent==null?vw:null}function vw(){return 0}var jh=class i extends Ai{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new i(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(xw(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return Wp(this.context.next,this.base,this.pos)}};function xw(i,e){for(let t=e;t;t=t.parent)if(i==t)return!0;return!1}function kw(i){let e=i.node,t=e.childAfter(e.from),n=e.lastChild;if(!t)return null;let r=i.options.simulateBreak,s=i.state.doc.lineAt(t.from),o=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let a=t.to;;){let l=e.childAfter(a);if(!l||l==n)return null;if(!l.type.isSkipped)return l.fromIp(n,e,t,i)}function Ip(i,e,t,n,r){let s=i.textAfter,o=s.match(/^\s*/)[0].length,a=n&&s.slice(o,o+n.length)==n||r==i.pos+o,l=e?kw(i):null;return l?a?i.column(l.from):i.column(l.to):i.baseIndent+(a?0:i.unit*t)}var Sw=200;function Np(){return N.transactionFilter.of(i=>{if(!i.docChanged||!i.isUserEvent("input.type")&&!i.isUserEvent("input.complete"))return i;let e=i.startState.languageDataAt("indentOnInput",i.startState.selection.main.head);if(!e.length)return i;let t=i.newDoc,{head:n}=i.newSelection.main,r=t.lineAt(n);if(n>r.from+Sw)return i;let s=t.sliceString(r.from,n);if(!e.some(h=>h.test(s)))return i;let{state:o}=i,a=-1,l=[];for(let{head:h}of o.selection.ranges){let c=o.doc.lineAt(h);if(c.from==a)continue;a=c.from;let f=So(o,c.from);if(f==null)continue;let u=/^\s*/.exec(c.text)[0],d=gn(o,f);u!=d&&l.push({from:c.from,to:c.from+u.length,insert:d})}return l.length?[i,{changes:l,sequential:!0}]:i})}var Tw=A.define(),Rr=new $;function To(i){let e=i.firstChild,t=i.lastChild;return e&&e.tot)continue;if(s&&a.from=e&&h.to>t&&(s=h)}}return s}function Cw(i){let e=i.lastChild;return e&&e.to==i.to&&e.type.isError}function vo(i,e,t){for(let n of i.facet(Tw)){let r=n(i,e,t);if(r)return r}return Pw(i,e,t)}function jp(i,e){let t=e.mapPos(i.from,1),n=e.mapPos(i.to,-1);return t>=n?void 0:{from:t,to:n}}var Po=_.define({map:jp}),Er=_.define({map:jp});function zp(i){let e=[];for(let{head:t}of i.state.selection.ranges)e.some(n=>n.from<=t&&n.to>=t)||e.push(i.lineBlockAt(t));return e}var Qi=te.define({create(){return M.none},update(i,e){i=i.map(e.changes);for(let t of e.effects)if(t.is(Po)&&!Rw(i,t.value.from,t.value.to)){let{preparePlaceholder:n}=e.state.facet(Yh),r=n?M.replace({widget:new zh(n(e.state,t.value))}):Vp;i=i.update({add:[r.range(t.value.from,t.value.to)]})}else t.is(Er)&&(i=i.update({filter:(n,r)=>t.value.from!=n||t.value.to!=r,filterFrom:t.value.from,filterTo:t.value.to}));if(e.selection){let t=!1,{head:n}=e.selection.main;i.between(n,n,(r,s)=>{rn&&(t=!0)}),t&&(i=i.update({filterFrom:n,filterTo:n,filter:(r,s)=>s<=n||r>=n}))}return i},provide:i=>E.decorations.from(i),toJSON(i,e){let t=[];return i.between(0,e.doc.length,(n,r)=>{t.push(n,r)}),t},fromJSON(i){if(!Array.isArray(i)||i.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t{(!r||r.from>s)&&(r={from:s,to:o})}),r}function Rw(i,e,t){let n=!1;return i.between(e,e,(r,s)=>{r==e&&s==t&&(n=!0)}),n}function Up(i,e){return i.field(Qi,!1)?e:e.concat(_.appendConfig.of(Gp()))}var Ew=i=>{for(let e of zp(i)){let t=vo(i.state,e.from,e.to);if(t)return i.dispatch({effects:Up(i.state,[Po.of(t),Fp(i,t)])}),!0}return!1},Aw=i=>{if(!i.state.field(Qi,!1))return!1;let e=[];for(let t of zp(i)){let n=xo(i.state,t.from,t.to);n&&e.push(Er.of(n),Fp(i,n,!1))}return e.length&&i.dispatch({effects:e}),e.length>0};function Fp(i,e,t=!0){let n=i.state.doc.lineAt(e.from).number,r=i.state.doc.lineAt(e.to).number;return E.announce.of(`${i.state.phrase(t?"Folded lines":"Unfolded lines")} ${n} ${i.state.phrase("to")} ${r}.`)}var Qw=i=>{let{state:e}=i,t=[];for(let n=0;n{let e=i.state.field(Qi,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,i.state.doc.length,(n,r)=>{t.push(Er.of({from:n,to:r}))}),i.dispatch({effects:t}),!0};var Hp=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:Ew},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:Aw},{key:"Ctrl-Alt-[",run:Qw},{key:"Ctrl-Alt-]",run:Mw}],_w={placeholderDOM:null,preparePlaceholder:null,placeholderText:"\u2026"},Yh=A.define({combine(i){return Te(i,_w)}});function Gp(i){let e=[Qi,$w];return i&&e.push(Yh.of(i)),e}function Yp(i,e){let{state:t}=i,n=t.facet(Yh),r=o=>{let a=i.lineBlockAt(i.posAtDOM(o.target)),l=xo(i.state,a.from,a.to);l&&i.dispatch({effects:Er.of(l)}),o.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(i,r,e);let s=document.createElement("span");return s.textContent=n.placeholderText,s.setAttribute("aria-label",t.phrase("folded code")),s.title=t.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=r,s}var Vp=M.replace({widget:new class extends Be{toDOM(i){return Yp(i,null)}}}),zh=class extends Be{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Yp(e,this.value)}},Dw={openText:"\u2304",closedText:"\u203A",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1},Sr=class extends ze{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}};function Zp(i={}){let e=Object.assign(Object.assign({},Dw),i),t=new Sr(e,!0),n=new Sr(e,!1),r=re.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(ni)!=o.state.facet(ni)||o.startState.field(Qi,!1)!=o.state.field(Qi,!1)||he(o.startState)!=he(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let a=new lt;for(let l of o.viewportLineBlocks){let h=xo(o.state,l.from,l.to)?n:vo(o.state,l.from,l.to)?t:null;h&&a.add(l.from,l.from,h)}return a.finish()}}),{domEventHandlers:s}=e;return[r,Th({class:"cm-foldGutter",markers(o){var a;return((a=o.plugin(r))===null||a===void 0?void 0:a.markers)||j.empty},initialSpacer(){return new Sr(e,!1)},domEventHandlers:Object.assign(Object.assign({},s),{click:(o,a,l)=>{if(s.click&&s.click(o,a,l))return!0;let h=xo(o.state,a.from,a.to);if(h)return o.dispatch({effects:Er.of(h)}),!0;let c=vo(o.state,a.from,a.to);return c?(o.dispatch({effects:Po.of(c)}),!0):!1}})}),Gp()]}var $w=E.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}}),ko=class i{constructor(e,t){this.specs=e;let n;function r(a){let l=et.newName();return(n||(n=Object.create(null)))["."+l]=a,l}let s=typeof t.all=="string"?t.all:t.all?r(t.all):void 0,o=t.scope;this.scope=o instanceof Ue?a=>a.prop(un)==o.data:o?a=>a==o:void 0,this.style=xr(e.map(a=>({tag:a.tag,class:a.class||r(Object.assign({},a,{tag:null}))})),{all:s}).style,this.module=n?new et(n):null,this.themeType=t.themeType}static define(e,t){return new i(e,t||{})}},Uh=A.define(),Jp=A.define({combine(i){return i.length?[i[0]]:null}});function Xh(i){let e=i.facet(Uh);return e.length?e:i.facet(Jp)}function Ar(i,e){let t=[Vw],n;return i instanceof ko&&(i.module&&t.push(E.styleModule.of(i.module)),n=i.themeType),e?.fallback?t.push(Jp.of(i)):n?t.push(Uh.computeN([E.darkTheme],r=>r.facet(E.darkTheme)==(n=="dark")?[i]:[])):t.push(Uh.of(i)),t}var Fh=class{constructor(e){this.markCache=Object.create(null),this.tree=he(e.state),this.decorations=this.buildDeco(e,Xh(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=he(e.state),n=Xh(e.state),r=n!=Xh(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=s.to)}buildDeco(e,t){if(!t||!this.tree.length)return M.none;let n=new lt;for(let{from:r,to:s}of e.visibleRanges)Vh(this.tree,t,(o,a,l)=>{n.add(o,a,this.markCache[l]||(this.markCache[l]=M.mark({class:l})))},r,s);return n.finish()}},Vw=Qe.high(re.fromClass(Fh,{decorations:i=>i.decorations})),Kp=ko.define([{tag:b.meta,color:"#404740"},{tag:b.link,textDecoration:"underline"},{tag:b.heading,textDecoration:"underline",fontWeight:"bold"},{tag:b.emphasis,fontStyle:"italic"},{tag:b.strong,fontWeight:"bold"},{tag:b.strikethrough,textDecoration:"line-through"},{tag:b.keyword,color:"#708"},{tag:[b.atom,b.bool,b.url,b.contentSeparator,b.labelName],color:"#219"},{tag:[b.literal,b.inserted],color:"#164"},{tag:[b.string,b.deleted],color:"#a11"},{tag:[b.regexp,b.escape,b.special(b.string)],color:"#e40"},{tag:b.definition(b.variableName),color:"#00f"},{tag:b.local(b.variableName),color:"#30a"},{tag:[b.typeName,b.namespace],color:"#085"},{tag:b.className,color:"#167"},{tag:[b.special(b.variableName),b.macroName],color:"#256"},{tag:b.definition(b.propertyName),color:"#00c"},{tag:b.comment,color:"#940"},{tag:b.invalid,color:"#f00"}]),Lw=E.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),em=1e4,tm="()[]{}",im=A.define({combine(i){return Te(i,{afterCursor:!0,brackets:tm,maxScanDistance:em,renderMatch:Xw})}}),qw=M.mark({class:"cm-matchingBracket"}),Bw=M.mark({class:"cm-nonmatchingBracket"});function Xw(i){let e=[],t=i.matched?qw:Bw;return e.push(t.range(i.start.from,i.start.to)),i.end&&e.push(t.range(i.end.from,i.end.to)),e}var Ww=te.define({create(){return M.none},update(i,e){if(!e.docChanged&&!e.selection)return i;let t=[],n=e.state.facet(im);for(let r of e.state.selection.ranges){if(!r.empty)continue;let s=ct(e.state,r.head,-1,n)||r.head>0&&ct(e.state,r.head-1,1,n)||n.afterCursor&&(ct(e.state,r.head,1,n)||r.headE.decorations.from(i)}),Iw=[Ww,Lw];function nm(i={}){return[im.of(i),Iw]}var Nw=new $;function Hh(i,e,t){let n=i.prop(e<0?$.openedBy:$.closedBy);if(n)return n;if(i.name.length==1){let r=t.indexOf(i.name);if(r>-1&&r%2==(e<0?1:0))return[t[r+e]]}return null}function Gh(i){let e=i.type.prop(Nw);return e?e(i.node):i}function ct(i,e,t,n={}){let r=n.maxScanDistance||em,s=n.brackets||tm,o=he(i),a=o.resolveInner(e,t);for(let l=a;l;l=l.parent){let h=Hh(l.type,t,s);if(h&&l.from0?e>=c.from&&ec.from&&e<=c.to))return jw(i,e,t,l,c,h,s)}}return zw(i,e,t,o,a.type,r,s)}function jw(i,e,t,n,r,s,o){let a=n.parent,l={from:r.from,to:r.to},h=0,c=a?.cursor();if(c&&(t<0?c.childBefore(n.from):c.childAfter(n.to)))do if(t<0?c.to<=n.from:c.from>=n.to){if(h==0&&s.indexOf(c.type.name)>-1&&c.from0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},c=i.doc.iterRange(e,t>0?i.doc.length:0),f=0;for(let u=0;!c.next().done&&u<=s;){let d=c.value;t<0&&(u+=d.length);let m=e+u*t;for(let p=t>0?0:d.length-1,g=t>0?d.length:-1;p!=g;p+=t){let O=o.indexOf(d[p]);if(!(O<0||n.resolveInner(m+p,1).type!=r))if(O%2==0==t>0)f++;else{if(f==1)return{start:h,end:{from:m+p,to:m+p+1},matched:O>>1==l>>1};f--}}t>0&&(u+=d.length)}return c.done?{start:h,matched:!1}:null}var Uw=Object.create(null),Lp=[Pe.none];var qp=[],Bp=Object.create(null),Fw=Object.create(null);for(let[i,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Fw[i]=Hw(Uw,e);function Wh(i,e){qp.indexOf(i)>-1||(qp.push(i),console.warn(e))}function Hw(i,e){let t=[];for(let a of e.split(" ")){let l=[];for(let h of a.split(".")){let c=i[h]||b[h];c?typeof c=="function"?l.length?l=l.map(c):Wh(h,`Modifier ${h} used at start of tag`):l.length?Wh(h,`Tag ${h} used as modifier`):l=Array.isArray(c)?c:[c]:Wh(h,`Unknown highlighting tag ${h}`)}for(let h of l)t.push(h)}if(!t.length)return 0;let n=e.replace(/ /g,"_"),r=n+" "+t.map(a=>a.id),s=Bp[r];if(s)return s.id;let o=Bp[r]=Pe.define({id:Lp.length,name:n,props:[fn({[n]:t})]});return Lp.push(o),o.id}var TT={rtl:M.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:H.RTL}),ltr:M.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:H.LTR}),auto:M.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})};var Gw=i=>{let{state:e}=i,t=e.doc.lineAt(e.selection.main.from),n=nc(i.state,t.from);return n.line?Yw(i):n.block?Jw(i):!1};function ic(i,e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=i(e,t);return r?(n(t.update(r)),!0):!1}}var Yw=ic(tv,0);var Zw=ic(fm,0);var Jw=ic((i,e)=>fm(i,e,ev(e)),0);function nc(i,e){let t=i.languageDataAt("commentTokens",e);return t.length?t[0]:{}}var Qr=50;function Kw(i,{open:e,close:t},n,r){let s=i.sliceDoc(n-Qr,n),o=i.sliceDoc(r,r+Qr),a=/\s*$/.exec(s)[0].length,l=/^\s*/.exec(o)[0].length,h=s.length-a;if(s.slice(h-e.length,h)==e&&o.slice(l,l+t.length)==t)return{open:{pos:n-a,margin:a&&1},close:{pos:r+l,margin:l&&1}};let c,f;r-n<=2*Qr?c=f=i.sliceDoc(n,r):(c=i.sliceDoc(n,n+Qr),f=i.sliceDoc(r-Qr,r));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,m=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(m,m+t.length)==t?{open:{pos:n+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:r-d-t.length,margin:/\s/.test(f.charAt(m-1))?1:0}}:null}function ev(i){let e=[];for(let t of i.selection.ranges){let n=i.doc.lineAt(t.from),r=t.to<=n.to?n:i.doc.lineAt(t.to),s=e.length-1;s>=0&&e[s].to>n.from?e[s].to=r.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:r.to})}return e}function fm(i,e,t=e.selection.ranges){let n=t.map(s=>nc(e,s.from).block);if(!n.every(s=>s))return null;let r=t.map((s,o)=>Kw(e,n[o],s.from,s.to));if(i!=2&&!r.every(s=>s))return{changes:e.changes(t.map((s,o)=>r[o]?[]:[{from:s.from,insert:n[o].open+" "},{from:s.to,insert:" "+n[o].close}]))};if(i!=1&&r.some(s=>s)){let s=[];for(let o=0,a;or&&(s==o||o>f.from)){r=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,m=f.text.slice(u,u+h.length)==h?u:-1;us.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:a,token:l,indent:h,empty:c,single:f}of n)(f||!c)&&s.push({from:a.from+h,insert:l+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(i!=1&&n.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:a,token:l}of n)if(a>=0){let h=o.from+a,c=h+l.length;o.text[c-o.from]==" "&&c++,s.push({from:h,to:c})}return{changes:s}}return null}var Jh=Le.define(),iv=Le.define(),nv=A.define(),um=A.define({combine(i){return Te(i,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),dm=te.define({create(){return _i.empty},update(i,e){let t=e.state.facet(um),n=e.annotation(Jh);if(n){let l=ft.fromTransaction(e,n.selection),h=n.side,c=h==0?i.undone:i.done;return l?c=Ro(c,c.length,t.minDepth,l):c=Om(c,e.startState.selection),new _i(h==0?n.rest:c,h==0?c:n.rest)}let r=e.annotation(iv);if((r=="full"||r=="before")&&(i=i.isolate()),e.annotation(fe.addToHistory)===!1)return e.changes.empty?i:i.addMapping(e.changes.desc);let s=ft.fromTransaction(e),o=e.annotation(fe.time),a=e.annotation(fe.userEvent);return s?i=i.addChanges(s,o,a,t,e):e.selection&&(i=i.addSelection(e.startState.selection,o,a,t.newGroupDelay)),(r=="full"||r=="after")&&(i=i.isolate()),i},toJSON(i){return{done:i.done.map(e=>e.toJSON()),undone:i.undone.map(e=>e.toJSON())}},fromJSON(i){return new _i(i.done.map(ft.fromJSON),i.undone.map(ft.fromJSON))}});function pm(i={}){return[dm,um.of(i),E.domEventHandlers({beforeinput(e,t){let n=e.inputType=="historyUndo"?mm:e.inputType=="historyRedo"?Kh:null;return n?(e.preventDefault(),n(t)):!1}})]}function Eo(i,e){return function({state:t,dispatch:n}){if(!e&&t.readOnly)return!1;let r=t.field(dm,!1);if(!r)return!1;let s=r.pop(i,t,e);return s?(n(s),!0):!1}}var mm=Eo(0,!1),Kh=Eo(1,!1),rv=Eo(0,!0),sv=Eo(1,!0);var ft=class i{constructor(e,t,n,r,s){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=s}setSelAfter(e){return new i(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new i(e.changes&&Ae.fromJSON(e.changes),[],e.mapped&&_t.fromJSON(e.mapped),e.startSelection&&S.fromJSON(e.startSelection),e.selectionsAfter.map(S.fromJSON))}static fromTransaction(e,t){let n=rt;for(let r of e.startState.facet(nv)){let s=r(e);s.length&&(n=n.concat(s))}return!n.length&&e.changes.empty?null:new i(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,rt)}static selection(e){return new i(void 0,rt,void 0,void 0,e)}};function Ro(i,e,t,n){let r=e+1>t+20?e-t-1:0,s=i.slice(r,e);return s.push(n),s}function ov(i,e){let t=[],n=!1;return i.iterChangedRanges((r,s)=>t.push(r,s)),e.iterChangedRanges((r,s,o,a)=>{for(let l=0;l=h&&o<=c&&(n=!0)}}),n}function av(i,e){return i.ranges.length==e.ranges.length&&i.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length===0}function gm(i,e){return i.length?e.length?i.concat(e):i:e}var rt=[],lv=200;function Om(i,e){if(i.length){let t=i[i.length-1],n=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-lv));return n.length&&n[n.length-1].eq(e)?i:(n.push(e),Ro(i,i.length-1,1e9,t.setSelAfter(n)))}else return[ft.selection([e])]}function hv(i){let e=i[i.length-1],t=i.slice();return t[i.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Zh(i,e){if(!i.length)return i;let t=i.length,n=rt;for(;t;){let r=cv(i[t-1],e,n);if(r.changes&&!r.changes.empty||r.effects.length){let s=i.slice(0,t);return s[t-1]=r,s}else e=r.mapped,t--,n=r.selectionsAfter}return n.length?[ft.selection(n)]:rt}function cv(i,e,t){let n=gm(i.selectionsAfter.length?i.selectionsAfter.map(a=>a.map(e)):rt,t);if(!i.changes)return ft.selection(n);let r=i.changes.map(e),s=e.mapDesc(i.changes,!0),o=i.mapped?i.mapped.composeDesc(s):s;return new ft(r,_.mapEffects(i.effects,e),o,i.startSelection.map(s),n)}var fv=/^(input\.type|delete)($|\.)/,_i=class i{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new i(this.done,this.undone):this}addChanges(e,t,n,r,s){let o=this.done,a=o[o.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!n||fv.test(n))&&(!a.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?i.moveByChar(t,e):Ao(t,e))}function Ce(i){return i.textDirectionAt(i.state.selection.main.head)==H.LTR}var wm=i=>bm(i,!Ce(i)),vm=i=>bm(i,Ce(i));function xm(i,e){return ut(i,t=>t.empty?i.moveByGroup(t,e):Ao(t,e))}var uv=i=>xm(i,!Ce(i)),dv=i=>xm(i,Ce(i));var DT=typeof Intl<"u"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"word"}):null;function pv(i,e,t){if(e.type.prop(t))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(i.sliceDoc(e.from,e.to)))||e.firstChild}function Qo(i,e,t){let n=he(i).resolveInner(e.head),r=t?$.closedBy:$.openedBy;for(let l=e.head;;){let h=t?n.childAfter(l):n.childBefore(l);if(!h)break;pv(i,h,r)?n=h:l=t?h.to:h.from}let s=n.type.prop(r),o,a;return s&&(o=t?ct(i,n.from,1):ct(i,n.to,-1))&&o.matched?a=t?o.end.to:o.end.from:a=t?n.to:n.from,S.cursor(a,t?-1:1)}var mv=i=>ut(i,e=>Qo(i.state,e,!Ce(i))),gv=i=>ut(i,e=>Qo(i.state,e,Ce(i)));function km(i,e){return ut(i,t=>{if(!t.empty)return Ao(t,e);let n=i.moveVertically(t,e);return n.head!=t.head?n:i.moveToLineBoundary(t,e)})}var Sm=i=>km(i,!1),Tm=i=>km(i,!0);function Pm(i){let e=i.scrollDOM.clientHeighto.empty?i.moveVertically(o,e,t.height):Ao(o,e));if(r.eq(n.selection))return!1;let s;if(t.selfScroll){let o=i.coordsAtPos(n.selection.main.head),a=i.scrollDOM.getBoundingClientRect(),l=a.top+t.marginTop,h=a.bottom-t.marginBottom;o&&o.top>l&&o.bottomCm(i,!1),ec=i=>Cm(i,!0);function ri(i,e,t){let n=i.lineBlockAt(e.head),r=i.moveToLineBoundary(e,t);if(r.head==e.head&&r.head!=(t?n.to:n.from)&&(r=i.moveToLineBoundary(e,t,!1)),!t&&r.head==n.from&&n.length){let s=/^\s*/.exec(i.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;s&&e.head!=n.from+s&&(r=S.cursor(n.from+s))}return r}var Ov=i=>ut(i,e=>ri(i,e,!0)),yv=i=>ut(i,e=>ri(i,e,!1)),bv=i=>ut(i,e=>ri(i,e,!Ce(i))),wv=i=>ut(i,e=>ri(i,e,Ce(i))),vv=i=>ut(i,e=>S.cursor(i.lineBlockAt(e.head).from,1)),xv=i=>ut(i,e=>S.cursor(i.lineBlockAt(e.head).to,-1));function kv(i,e,t){let n=!1,r=On(i.selection,s=>{let o=ct(i,s.head,-1)||ct(i,s.head,1)||s.head>0&&ct(i,s.head-1,1)||s.headkv(i,e,!1);function st(i,e){let t=On(i.state.selection,n=>{let r=e(n);return S.range(n.anchor,r.head,r.goalColumn,r.bidiLevel||void 0)});return t.eq(i.state.selection)?!1:(i.dispatch(Pt(i.state,t)),!0)}function Rm(i,e){return st(i,t=>i.moveByChar(t,e))}var Em=i=>Rm(i,!Ce(i)),Am=i=>Rm(i,Ce(i));function Qm(i,e){return st(i,t=>i.moveByGroup(t,e))}var Tv=i=>Qm(i,!Ce(i)),Pv=i=>Qm(i,Ce(i));var Cv=i=>st(i,e=>Qo(i.state,e,!Ce(i))),Rv=i=>st(i,e=>Qo(i.state,e,Ce(i)));function Mm(i,e){return st(i,t=>i.moveVertically(t,e))}var _m=i=>Mm(i,!1),Dm=i=>Mm(i,!0);function $m(i,e){return st(i,t=>i.moveVertically(t,e,Pm(i).height))}var sm=i=>$m(i,!1),om=i=>$m(i,!0),Ev=i=>st(i,e=>ri(i,e,!0)),Av=i=>st(i,e=>ri(i,e,!1)),Qv=i=>st(i,e=>ri(i,e,!Ce(i))),Mv=i=>st(i,e=>ri(i,e,Ce(i))),_v=i=>st(i,e=>S.cursor(i.lineBlockAt(e.head).from)),Dv=i=>st(i,e=>S.cursor(i.lineBlockAt(e.head).to)),am=({state:i,dispatch:e})=>(e(Pt(i,{anchor:0})),!0),lm=({state:i,dispatch:e})=>(e(Pt(i,{anchor:i.doc.length})),!0),hm=({state:i,dispatch:e})=>(e(Pt(i,{anchor:i.selection.main.anchor,head:0})),!0),cm=({state:i,dispatch:e})=>(e(Pt(i,{anchor:i.selection.main.anchor,head:i.doc.length})),!0),$v=({state:i,dispatch:e})=>(e(i.update({selection:{anchor:0,head:i.doc.length},userEvent:"select"})),!0),Vv=({state:i,dispatch:e})=>{let t=Mo(i).map(({from:n,to:r})=>S.range(n,Math.min(r+1,i.doc.length)));return e(i.update({selection:S.create(t),userEvent:"select"})),!0},Lv=({state:i,dispatch:e})=>{let t=On(i.selection,n=>{var r;let s=he(i).resolveStack(n.from,1);for(let o=s;o;o=o.next){let{node:a}=o;if((a.from=n.to||a.to>n.to&&a.from<=n.from)&&(!((r=a.parent)===null||r===void 0)&&r.parent))return S.range(a.to,a.from)}return n});return e(Pt(i,t)),!0},qv=({state:i,dispatch:e})=>{let t=i.selection,n=null;return t.ranges.length>1?n=S.create([t.main]):t.main.empty||(n=S.create([S.cursor(t.main.head)])),n?(e(Pt(i,n)),!0):!1};function Mr(i,e){if(i.state.readOnly)return!1;let t="delete.selection",{state:n}=i,r=n.changeByRange(s=>{let{from:o,to:a}=s;if(o==a){let l=e(s);lo&&(t="delete.forward",l=Co(i,l,!0)),o=Math.min(o,l),a=Math.max(a,l)}else o=Co(i,o,!1),a=Co(i,a,!0);return o==a?{range:s}:{changes:{from:o,to:a},range:S.cursor(o,or(i)))n.between(e,e,(r,s)=>{re&&(e=t?s:r)});return e}var Vm=(i,e,t)=>Mr(i,n=>{let r=n.from,{state:s}=i,o=s.doc.lineAt(r),a,l;if(t&&!e&&r>o.from&&rVm(i,!1,!0);var Lm=i=>Vm(i,!0,!1),qm=(i,e)=>Mr(i,t=>{let n=t.head,{state:r}=i,s=r.doc.lineAt(n),o=r.charCategorizer(n);for(let a=null;;){if(n==(e?s.to:s.from)){n==t.head&&s.number!=(e?r.doc.lines:1)&&(n+=e?1:-1);break}let l=ue(s.text,n-s.from,e)+s.from,h=s.text.slice(Math.min(n,l)-s.from,Math.max(n,l)-s.from),c=o(h);if(a!=null&&c!=a)break;(h!=" "||n!=t.head)&&(a=c),n=l}return n}),Bm=i=>qm(i,!1),Bv=i=>qm(i,!0),Xv=i=>Mr(i,e=>{let t=i.lineBlockAt(e.head).to;return e.headMr(i,e=>{let t=i.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),Iv=i=>Mr(i,e=>{let t=i.moveToLineBoundary(e,!0).head;return e.head{if(i.readOnly)return!1;let t=i.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:W.of(["",""])},range:S.cursor(n.from)}));return e(i.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},jv=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let t=i.changeByRange(n=>{if(!n.empty||n.from==0||n.from==i.doc.length)return{range:n};let r=n.from,s=i.doc.lineAt(r),o=r==s.from?r-1:ue(s.text,r-s.from,!1)+s.from,a=r==s.to?r+1:ue(s.text,r-s.from,!0)+s.from;return{changes:{from:o,to:a,insert:i.doc.slice(r,a).append(i.doc.slice(o,r))},range:S.cursor(a)}});return t.changes.empty?!1:(e(i.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Mo(i){let e=[],t=-1;for(let n of i.selection.ranges){let r=i.doc.lineAt(n.from),s=i.doc.lineAt(n.to);if(!n.empty&&n.to==s.from&&(s=i.doc.lineAt(n.to-1)),t>=r.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(n)}else e.push({from:r.from,to:s.to,ranges:[n]});t=s.number+1}return e}function Xm(i,e,t){if(i.readOnly)return!1;let n=[],r=[];for(let s of Mo(i)){if(t?s.to==i.doc.length:s.from==0)continue;let o=i.doc.lineAt(t?s.to+1:s.from-1),a=o.length+1;if(t){n.push({from:s.to,to:o.to},{from:s.from,insert:o.text+i.lineBreak});for(let l of s.ranges)r.push(S.range(Math.min(i.doc.length,l.anchor+a),Math.min(i.doc.length,l.head+a)))}else{n.push({from:o.from,to:s.from},{from:s.to,insert:i.lineBreak+o.text});for(let l of s.ranges)r.push(S.range(l.anchor-a,l.head-a))}}return n.length?(e(i.update({changes:n,scrollIntoView:!0,selection:S.create(r,i.selection.mainIndex),userEvent:"move.line"})),!0):!1}var zv=({state:i,dispatch:e})=>Xm(i,e,!1),Uv=({state:i,dispatch:e})=>Xm(i,e,!0);function Wm(i,e,t){if(i.readOnly)return!1;let n=[];for(let r of Mo(i))t?n.push({from:r.from,insert:i.doc.slice(r.from,r.to)+i.lineBreak}):n.push({from:r.to,insert:i.lineBreak+i.doc.slice(r.from,r.to)});return e(i.update({changes:n,scrollIntoView:!0,userEvent:"input.copyline"})),!0}var Fv=({state:i,dispatch:e})=>Wm(i,e,!1),Hv=({state:i,dispatch:e})=>Wm(i,e,!0),Gv=i=>{if(i.state.readOnly)return!1;let{state:e}=i,t=e.changes(Mo(e).map(({from:r,to:s})=>(r>0?r--:s{let s;if(i.lineWrapping){let o=i.lineBlockAt(r.head),a=i.coordsAtPos(r.head,r.assoc||1);a&&(s=o.bottom+i.documentTop-a.bottom+i.defaultLineHeight/2)}return i.moveVertically(r,!0,s)}).map(t);return i.dispatch({changes:t,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Yv(i,e){if(/\(\)|\[\]|\{\}/.test(i.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=he(i).resolveInner(e),n=t.childBefore(e),r=t.childAfter(e),s;return n&&r&&n.to<=e&&r.from>=e&&(s=n.type.prop($.closedBy))&&s.indexOf(r.name)>-1&&i.doc.lineAt(n.to).from==i.doc.lineAt(r.from).from&&!/\S/.test(i.sliceDoc(n.to,r.from))?{from:n.to,to:r.from}:null}var Zv=Im(!1),Jv=Im(!0);function Im(i){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{let{from:s,to:o}=r,a=e.doc.lineAt(s),l=!i&&s==o&&Yv(e,s);i&&(s=o=(o<=a.to?a:e.doc.lineAt(o)).to);let h=new Ai(e,{simulateBreak:s,simulateDoubleBreak:!!l}),c=So(h,s);for(c==null&&(c=$t(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));oa.from&&s{let r=[];for(let o=n.from;o<=n.to;){let a=i.doc.lineAt(o);a.number>t&&(n.empty||n.to>a.from)&&(e(a,r,n),t=a.number),o=a.to+1}let s=i.changes(r);return{changes:r,range:S.range(s.mapPos(n.anchor,1),s.mapPos(n.head,1))}})}var Kv=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let t=Object.create(null),n=new Ai(i,{overrideIndentation:s=>{let o=t[s];return o??-1}}),r=rc(i,(s,o,a)=>{let l=So(n,s.from);if(l==null)return;/\S/.test(s.text)||(l=0);let h=/^\s*/.exec(s.text)[0],c=gn(i,l);(h!=c||a.fromi.readOnly?!1:(e(i.update(rc(i,(t,n)=>{n.push({from:t.from,insert:i.facet(mn)})}),{userEvent:"input.indent"})),!0),tx=({state:i,dispatch:e})=>i.readOnly?!1:(e(i.update(rc(i,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let s=$t(r,i.tabSize),o=0,a=gn(i,Math.max(0,s-Pr(i)));for(;o(i.setTabFocusMode(),!0);var nx=[{key:"Ctrl-b",run:wm,shift:Em,preventDefault:!0},{key:"Ctrl-f",run:vm,shift:Am},{key:"Ctrl-p",run:Sm,shift:_m},{key:"Ctrl-n",run:Tm,shift:Dm},{key:"Ctrl-a",run:vv,shift:_v},{key:"Ctrl-e",run:xv,shift:Dv},{key:"Ctrl-d",run:Lm},{key:"Ctrl-h",run:tc},{key:"Ctrl-k",run:Xv},{key:"Ctrl-Alt-h",run:Bm},{key:"Ctrl-o",run:Nv},{key:"Ctrl-t",run:jv},{key:"Ctrl-v",run:ec}],rx=[{key:"ArrowLeft",run:wm,shift:Em,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:uv,shift:Tv,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:bv,shift:Qv,preventDefault:!0},{key:"ArrowRight",run:vm,shift:Am,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:dv,shift:Pv,preventDefault:!0},{mac:"Cmd-ArrowRight",run:wv,shift:Mv,preventDefault:!0},{key:"ArrowUp",run:Sm,shift:_m,preventDefault:!0},{mac:"Cmd-ArrowUp",run:am,shift:hm},{mac:"Ctrl-ArrowUp",run:rm,shift:sm},{key:"ArrowDown",run:Tm,shift:Dm,preventDefault:!0},{mac:"Cmd-ArrowDown",run:lm,shift:cm},{mac:"Ctrl-ArrowDown",run:ec,shift:om},{key:"PageUp",run:rm,shift:sm},{key:"PageDown",run:ec,shift:om},{key:"Home",run:yv,shift:Av,preventDefault:!0},{key:"Mod-Home",run:am,shift:hm},{key:"End",run:Ov,shift:Ev,preventDefault:!0},{key:"Mod-End",run:lm,shift:cm},{key:"Enter",run:Zv},{key:"Mod-a",run:$v},{key:"Backspace",run:tc,shift:tc},{key:"Delete",run:Lm},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Bm},{key:"Mod-Delete",mac:"Alt-Delete",run:Bv},{mac:"Mod-Backspace",run:Wv},{mac:"Mod-Delete",run:Iv}].concat(nx.map(i=>({mac:i.key,run:i.run,shift:i.shift}))),Nm=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:mv,shift:Cv},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:gv,shift:Rv},{key:"Alt-ArrowUp",run:zv},{key:"Shift-Alt-ArrowUp",run:Fv},{key:"Alt-ArrowDown",run:Uv},{key:"Shift-Alt-ArrowDown",run:Hv},{key:"Escape",run:qv},{key:"Mod-Enter",run:Jv},{key:"Alt-l",mac:"Ctrl-l",run:Vv},{key:"Mod-i",run:Lv,preventDefault:!0},{key:"Mod-[",run:tx},{key:"Mod-]",run:ex},{key:"Mod-Alt-\\",run:Kv},{key:"Shift-Mod-k",run:Gv},{key:"Shift-Mod-\\",run:Sv},{key:"Mod-/",run:Gw},{key:"Alt-A",run:Zw},{key:"Ctrl-m",mac:"Shift-Alt-m",run:ix}].concat(rx);function U(){var i=arguments[0];typeof i=="string"&&(i=document.createElement(i));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=t[n];typeof r=="string"?i.setAttribute(n,r):r!=null&&(i[n]=r)}e++}for(;ei.normalize("NFKD"):i=>i,oi=class{constructor(e,t,n=0,r=e.length,s,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=s?a=>s(zm(a)):zm,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return ce(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Fn(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Ee(e);let r=this.normalize(t);for(let s=0,o=n;;s++){let a=r.charCodeAt(s),l=this.match(a,o,this.bufferPos+this.bufferStart);if(s==r.length-1){if(l)return this.value=l,this;break}o==n&&sthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=qo(this.text,r+(n==r?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(nthis.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=n||r.to<=t){let a=new i(t,e.sliceString(t,n));return sc.set(e,a),a}if(r.from==t&&r.to==n)return r;let{text:s,from:o}=r;return o>t&&(s=e.sliceString(t,o)+s,o=t),r.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let n=this.flat.from+t.index,r=n+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this.matchPos=qo(this.text,r+(n==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Vo.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<"u"&&($o.prototype[Symbol.iterator]=Lo.prototype[Symbol.iterator]=function(){return this});function sx(i){try{return new RegExp(i,fc),!0}catch{return!1}}function qo(i,e){if(e>=i.length)return e;let t=i.lineAt(e),n;for(;e=56320&&n<57344;)e++;return e}function oc(i){let e=String(i.state.doc.lineAt(i.state.selection.main.head).number),t=U("input",{class:"cm-textfield",name:"line",value:e}),n=U("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),i.dispatch({effects:Bo.of(!1)}),i.focus()):s.keyCode==13&&(s.preventDefault(),r())},onsubmit:s=>{s.preventDefault(),r()}},U("label",i.state.phrase("Go to line"),": ",t)," ",U("button",{class:"cm-button",type:"submit"},i.state.phrase("go")));function r(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!s)return;let{state:o}=i,a=o.doc.lineAt(o.selection.main.head),[,l,h,c,f]=s,u=c?+c.slice(1):0,d=h?+h:a.number;if(h&&f){let g=d/100;l&&(g=g*(l=="-"?-1:1)+a.number/o.doc.lines),d=Math.round(o.doc.lines*g)}else h&&l&&(d=d*(l=="-"?-1:1)+a.number);let m=o.doc.line(Math.max(1,Math.min(o.doc.lines,d))),p=S.cursor(m.from+Math.max(0,Math.min(u,m.length)));i.dispatch({effects:[Bo.of(!1),E.scrollIntoView(p.from,{y:"center"})],selection:p}),i.focus()}return{dom:n}}var Bo=_.define(),Um=te.define({create(){return!0},update(i,e){for(let t of e.effects)t.is(Bo)&&(i=t.value);return i},provide:i=>Ti.from(i,e=>e?oc:null)}),ox=i=>{let e=Pi(i,oc);if(!e){let t=[Bo.of(!0)];i.state.field(Um,!1)==null&&t.push(_.appendConfig.of([Um,ax])),i.dispatch({effects:t}),e=Pi(i,oc)}return e&&e.dom.querySelector("input").select(),!0},ax=E.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),lx={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Ym=A.define({combine(i){return Te(i,lx,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function Zm(i){let e=[dx,ux];return i&&e.push(Ym.of(i)),e}var hx=M.mark({class:"cm-selectionMatch"}),cx=M.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Fm(i,e,t,n){return(t==0||i(e.sliceDoc(t-1,t))!=F.Word)&&(n==e.doc.length||i(e.sliceDoc(n,n+1))!=F.Word)}function fx(i,e,t,n){return i(e.sliceDoc(t,t+1))==F.Word&&i(e.sliceDoc(n-1,n))==F.Word}var ux=re.fromClass(class{constructor(i){this.decorations=this.getDeco(i)}update(i){(i.selectionSet||i.docChanged||i.viewportChanged)&&(this.decorations=this.getDeco(i.view))}getDeco(i){let e=i.state.facet(Ym),{state:t}=i,n=t.selection;if(n.ranges.length>1)return M.none;let r=n.main,s,o=null;if(r.empty){if(!e.highlightWordAroundCursor)return M.none;let l=t.wordAt(r.head);if(!l)return M.none;o=t.charCategorizer(r.head),s=t.sliceDoc(l.from,l.to)}else{let l=r.to-r.from;if(l200)return M.none;if(e.wholeWords){if(s=t.sliceDoc(r.from,r.to),o=t.charCategorizer(r.head),!(Fm(o,t,r.from,r.to)&&fx(o,t,r.from,r.to)))return M.none}else if(s=t.sliceDoc(r.from,r.to),!s)return M.none}let a=[];for(let l of i.visibleRanges){let h=new oi(t.doc,s,l.from,l.to);for(;!h.next().done;){let{from:c,to:f}=h.value;if((!o||Fm(o,t,c,f))&&(r.empty&&c<=r.from&&f>=r.to?a.push(cx.range(c,f)):(c>=r.to||f<=r.from)&&a.push(hx.range(c,f)),a.length>e.maxMatches))return M.none}}return M.set(a)}},{decorations:i=>i.decorations}),dx=E.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),px=({state:i,dispatch:e})=>{let{selection:t}=i,n=S.create(t.ranges.map(r=>i.wordAt(r.head)||S.cursor(r.head)),t.mainIndex);return n.eq(t)?!1:(e(i.update({selection:n})),!0)};function mx(i,e){let{main:t,ranges:n}=i.selection,r=i.wordAt(t.head),s=r&&r.from==t.from&&r.to==t.to;for(let o=!1,a=new oi(i.doc,e,n[n.length-1].to);;)if(a.next(),a.done){if(o)return null;a=new oi(i.doc,e,0,Math.max(0,n[n.length-1].from-1)),o=!0}else{if(o&&n.some(l=>l.from==a.value.from))continue;if(s){let l=i.wordAt(a.value.from);if(!l||l.from!=a.value.from||l.to!=a.value.to)continue}return a.value}}var gx=({state:i,dispatch:e})=>{let{ranges:t}=i.selection;if(t.some(s=>s.from===s.to))return px({state:i,dispatch:e});let n=i.sliceDoc(t[0].from,t[0].to);if(i.selection.ranges.some(s=>i.sliceDoc(s.from,s.to)!=n))return!1;let r=mx(i,n);return r?(e(i.update({selection:i.selection.addRange(S.range(r.from,r.to),!1),effects:E.scrollIntoView(r.to)})),!0):!1},wn=A.define({combine(i){return Te(i,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new cc(e),scrollToMatch:e=>E.scrollIntoView(e)})}});var Xo=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||sx(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,n)=>n=="n"?` +`:n=="r"?"\r":n=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new lc(this):new ac(this)}getCursor(e,t=0,n){let r=e.doc?e:N.create({doc:e});return n==null&&(n=r.doc.length),this.regexp?bn(this,r,t,n):yn(this,r,t,n)}},Wo=class{constructor(e){this.spec=e}};function yn(i,e,t,n){return new oi(e.doc,i.unquoted,t,n,i.caseSensitive?void 0:r=>r.toLowerCase(),i.wholeWord?Ox(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function Ox(i,e){return(t,n,r,s)=>((s>t||s+r.length=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let s=yn(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}};function bn(i,e,t,n){return new $o(e.doc,i.search,{ignoreCase:!i.caseSensitive,test:i.wholeWord?yx(e.charCategorizer(e.selection.main.head)):void 0},t,n)}function Io(i,e){return i.slice(ue(i,e,!1),e)}function No(i,e){return i.slice(e,ue(i,e))}function yx(i){return(e,t,n)=>!n[0].length||(i(Io(n.input,n.index))!=F.Word||i(No(n.input,n.index))!=F.Word)&&(i(No(n.input,n.index+n[0].length))!=F.Word||i(Io(n.input,n.index+n[0].length))!=F.Word)}var lc=class extends Wo{nextMatch(e,t,n){let r=bn(this.spec,e,n,e.doc.length).next();return r.done&&(r=bn(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let s=Math.max(t,n-r*1e4),o=bn(this.spec,e,s,n),a=null;for(;!o.next().done;)a=o.value;if(a&&(s==t||a.from>s+10))return a;if(s==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(t,n)=>n=="$"?"$":n=="&"?e.match[0]:n!="0"&&+n=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let s=bn(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}},Dr=_.define(),uc=_.define(),si=te.define({create(i){return new _r(hc(i).create(),null)},update(i,e){for(let t of e.effects)t.is(Dr)?i=new _r(t.value.create(),i.panel):t.is(uc)&&(i=new _r(i.query,t.value?dc:null));return i},provide:i=>Ti.from(i,e=>e.panel)});var _r=class{constructor(e,t){this.query=e,this.panel=t}},bx=M.mark({class:"cm-searchMatch"}),wx=M.mark({class:"cm-searchMatch cm-searchMatch-selected"}),vx=re.fromClass(class{constructor(i){this.view=i,this.decorations=this.highlight(i.state.field(si))}update(i){let e=i.state.field(si);(e!=i.startState.field(si)||i.docChanged||i.selectionSet||i.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:i,panel:e}){if(!e||!i.spec.valid)return M.none;let{view:t}=this,n=new lt;for(let r=0,s=t.visibleRanges,o=s.length;rs[r+1].from-2*250;)l=s[++r].to;i.highlight(t.state,a,l,(h,c)=>{let f=t.state.selection.ranges.some(u=>u.from==h&&u.to==c);n.add(h,c,f?wx:bx)})}return n.finish()}},{decorations:i=>i.decorations});function $r(i){return e=>{let t=e.state.field(si,!1);return t&&t.query.spec.valid?i(e,t):eg(e)}}var jo=$r((i,{query:e})=>{let{to:t}=i.state.selection.main,n=e.nextMatch(i.state,t,t);if(!n)return!1;let r=S.single(n.from,n.to),s=i.state.facet(wn);return i.dispatch({selection:r,effects:[pc(i,n),s.scrollToMatch(r.main,i)],userEvent:"select.search"}),Km(i),!0}),zo=$r((i,{query:e})=>{let{state:t}=i,{from:n}=t.selection.main,r=e.prevMatch(t,n,n);if(!r)return!1;let s=S.single(r.from,r.to),o=i.state.facet(wn);return i.dispatch({selection:s,effects:[pc(i,r),o.scrollToMatch(s.main,i)],userEvent:"select.search"}),Km(i),!0}),xx=$r((i,{query:e})=>{let t=e.matchAll(i.state,1e3);return!t||!t.length?!1:(i.dispatch({selection:S.create(t.map(n=>S.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),kx=({state:i,dispatch:e})=>{let t=i.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:n,to:r}=t.main,s=[],o=0;for(let a=new oi(i.doc,i.sliceDoc(n,r));!a.next().done;){if(s.length>1e3)return!1;a.value.from==n&&(o=s.length),s.push(S.range(a.value.from,a.value.to))}return e(i.update({selection:S.create(s,o),userEvent:"select.search.matches"})),!0},Hm=$r((i,{query:e})=>{let{state:t}=i,{from:n,to:r}=t.selection.main;if(t.readOnly)return!1;let s=e.nextMatch(t,n,n);if(!s)return!1;let o=[],a,l,h=[];if(s.from==n&&s.to==r&&(l=t.toText(e.getReplacement(s)),o.push({from:s.from,to:s.to,insert:l}),s=e.nextMatch(t,s.from,s.to),h.push(E.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(n).number)+"."))),s){let c=o.length==0||o[0].from>=s.to?0:s.to-s.from-l.length;a=S.single(s.from-c,s.to-c),h.push(pc(i,s)),h.push(t.facet(wn).scrollToMatch(a.main,i))}return i.dispatch({changes:o,selection:a,effects:h,userEvent:"input.replace"}),!0}),Sx=$r((i,{query:e})=>{if(i.state.readOnly)return!1;let t=e.matchAll(i.state,1e9).map(r=>{let{from:s,to:o}=r;return{from:s,to:o,insert:e.getReplacement(r)}});if(!t.length)return!1;let n=i.state.phrase("replaced $ matches",t.length)+".";return i.dispatch({changes:t,effects:E.announce.of(n),userEvent:"input.replace.all"}),!0});function dc(i){return i.state.facet(wn).createPanel(i)}function hc(i,e){var t,n,r,s,o;let a=i.selection.main,l=a.empty||a.to>a.from+100?"":i.sliceDoc(a.from,a.to);if(e&&!l)return e;let h=i.facet(wn);return new Xo({search:((t=e?.literal)!==null&&t!==void 0?t:h.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(n=e?.caseSensitive)!==null&&n!==void 0?n:h.caseSensitive,literal:(r=e?.literal)!==null&&r!==void 0?r:h.literal,regexp:(s=e?.regexp)!==null&&s!==void 0?s:h.regexp,wholeWord:(o=e?.wholeWord)!==null&&o!==void 0?o:h.wholeWord})}function Jm(i){let e=Pi(i,dc);return e&&e.dom.querySelector("[main-field]")}function Km(i){let e=Jm(i);e&&e==i.root.activeElement&&e.select()}var eg=i=>{let e=i.state.field(si,!1);if(e&&e.panel){let t=Jm(i);if(t&&t!=i.root.activeElement){let n=hc(i.state,e.query.spec);n.valid&&i.dispatch({effects:Dr.of(n)}),t.focus(),t.select()}}else i.dispatch({effects:[uc.of(!0),e?Dr.of(hc(i.state,e.query.spec)):_.appendConfig.of(Px)]});return!0},tg=i=>{let e=i.state.field(si,!1);if(!e||!e.panel)return!1;let t=Pi(i,dc);return t&&t.dom.contains(i.root.activeElement)&&i.focus(),i.dispatch({effects:uc.of(!1)}),!0},ig=[{key:"Mod-f",run:eg,scope:"editor search-panel"},{key:"F3",run:jo,shift:zo,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:jo,shift:zo,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:tg,scope:"editor search-panel"},{key:"Mod-Shift-l",run:kx},{key:"Mod-Alt-g",run:ox},{key:"Mod-d",run:gx,preventDefault:!0}],cc=class{constructor(e){this.view=e;let t=this.query=e.state.field(si).query.spec;this.commit=this.commit.bind(this),this.searchField=U("input",{value:t.search,placeholder:Fe(e,"Find"),"aria-label":Fe(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=U("input",{value:t.replace,placeholder:Fe(e,"Replace"),"aria-label":Fe(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=U("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=U("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=U("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function n(r,s,o){return U("button",{class:"cm-button",name:r,onclick:s,type:"button"},o)}this.dom=U("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,n("next",()=>jo(e),[Fe(e,"next")]),n("prev",()=>zo(e),[Fe(e,"previous")]),n("select",()=>xx(e),[Fe(e,"all")]),U("label",null,[this.caseField,Fe(e,"match case")]),U("label",null,[this.reField,Fe(e,"regexp")]),U("label",null,[this.wordField,Fe(e,"by word")]),...e.state.readOnly?[]:[U("br"),this.replaceField,n("replace",()=>Hm(e),[Fe(e,"replace")]),n("replaceAll",()=>Sx(e),[Fe(e,"replace all")])],U("button",{name:"close",onclick:()=>tg(e),"aria-label":Fe(e,"close"),type:"button"},["\xD7"])])}commit(){let e=new Xo({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Dr.of(e)}))}keydown(e){lp(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?zo:jo)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Hm(this.view))}update(e){for(let t of e.transactions)for(let n of t.effects)n.is(Dr)&&!n.value.eq(this.query)&&this.setQuery(n.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(wn).top}};function Fe(i,e){return i.state.phrase(e)}var _o=30,Do=/[\s\.,:;?!]/;function pc(i,{from:e,to:t}){let n=i.state.doc.lineAt(e),r=i.state.doc.lineAt(t).to,s=Math.max(n.from,e-_o),o=Math.min(r,t+_o),a=i.state.sliceDoc(s,o);if(s!=n.from){for(let l=0;l<_o;l++)if(!Do.test(a[l+1])&&Do.test(a[l])){a=a.slice(l);break}}if(o!=r){for(let l=a.length-1;l>a.length-_o;l--)if(!Do.test(a[l-1])&&Do.test(a[l])){a=a.slice(0,l);break}}return E.announce.of(`${i.state.phrase("current match")}. ${a} ${i.state.phrase("on line")} ${n.number}.`)}var Tx=E.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Px=[si,Qe.low(vx),Tx];var Fo=class{constructor(e,t,n){this.state=e,this.pos=t,this.explicit=n,this.abortListeners=[]}tokenBefore(e){let t=he(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),s=r.search(ug(e,!1));return s<0?null:{from:n+s,to:this.pos,text:r.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,t){e=="abort"&&this.abortListeners&&this.abortListeners.push(t)}};function ng(i){let e=Object.keys(i).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function Cx(i){let e=Object.create(null),t=Object.create(null);for(let{label:r}of i){e[r[0]]=!0;for(let s=1;stypeof r=="string"?{label:r}:r),[t,n]=e.every(r=>/^\w+$/.test(r.label))?[/\w*$/,/\w+$/]:Cx(e);return r=>{let s=r.matchBefore(n);return s||r.explicit?{from:s?s.from:r.pos,options:e,validFor:t}:null}}function fg(i,e){return t=>{for(let n=he(t.state).resolveInner(t.pos,-1);n;n=n.parent){if(i.indexOf(n.name)>-1)return null;if(n.type.isTop)break}return e(t)}}var Ho=class{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}};function ai(i){return i.selection.main.from}function ug(i,e){var t;let{source:n}=i,r=e&&n[0]!="^",s=n[n.length-1]!="$";return!r&&!s?i:new RegExp(`${r?"^":""}(?:${n})${s?"$":""}`,(t=i.flags)!==null&&t!==void 0?t:i.ignoreCase?"i":"")}var Rc=Le.define();function Rx(i,e,t,n){let{main:r}=i.selection,s=t-r.from,o=n-r.from;return Object.assign(Object.assign({},i.changeByRange(a=>a!=r&&t!=n&&i.sliceDoc(a.from+s,a.from+o)!=i.sliceDoc(t,n)?{range:a}:{changes:{from:a.from+s,to:n==r.from?a.to:a.from+o,insert:e},range:S.cursor(a.from+s+e.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}var rg=new WeakMap;function Ex(i){if(!Array.isArray(i))return i;let e=rg.get(i);return e||rg.set(i,e=Cc(i)),e}var Go=_.define(),Vr=_.define(),Oc=class{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t=48&&w<=57||w>=97&&w<=122?2:w>=65&&w<=90?1:0:(P=Fn(w))!=P.toLowerCase()?1:P!=P.toUpperCase()?2:0;(!y||C==1&&g||x==0&&C!=0)&&(t[f]==w||n[f]==w&&(u=!0)?o[f++]=y:o.length&&(O=!1)),x=C,y+=Ee(w)}return f==l&&o[0]==0&&O?this.result(-100+(u?-200:0),o,e):d==l&&m==0?this.ret(-200-e.length+(p==e.length?0:-100),[0,p]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):d==l?this.ret(-900-e.length,[m,p]):f==l?this.result(-100+(u?-200:0)+-700+(O?0:-1100),o,e):t.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],s=0;for(let o of t){let a=o+(this.astral?Ee(ce(n,o)):1);s&&r[s-1]==o?r[s-1]=a:(r[s++]=o,r[s++]=a)}return this.ret(e-n.length,r)}},yc=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Ax,filterStrict:!1,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>sg(e(n),t(n)),optionClass:(e,t)=>n=>sg(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function sg(i,e){return i?e?i+" "+e:i:e}function Ax(i,e,t,n,r,s){let o=i.textDirection==H.RTL,a=o,l=!1,h="top",c,f,u=e.left-r.left,d=r.right-e.right,m=n.right-n.left,p=n.bottom-n.top;if(a&&u=p||y>e.top?c=t.bottom-e.top:(h="bottom",c=e.bottom-t.top)}let g=(e.bottom-e.top)/s.offsetHeight,O=(e.right-e.left)/s.offsetWidth;return{style:`${h}: ${c/g}px; max-width: ${f/O}px`,class:"cm-completionInfo-"+(l?o?"left-narrow":"right-narrow":a?"left":"right")}}function Qx(i){let e=i.addToOptions.slice();return i.icons&&e.push({render(t){let n=document.createElement("div");return n.classList.add("cm-completionIcon"),t.type&&n.classList.add(...t.type.split(/\s+/g).map(r=>"cm-completionIcon-"+r)),n.setAttribute("aria-hidden","true"),n},position:20}),e.push({render(t,n,r,s){let o=document.createElement("span");o.className="cm-completionLabel";let a=t.displayLabel||t.label,l=0;for(let h=0;hl&&o.appendChild(document.createTextNode(a.slice(l,c)));let u=o.appendChild(document.createElement("span"));u.appendChild(document.createTextNode(a.slice(c,f))),u.className="cm-completionMatchedText",l=f}return lt.position-n.position).map(t=>t.render)}function mc(i,e,t){if(i<=t)return{from:0,to:i};if(e<0&&(e=0),e<=i>>1){let r=Math.floor(e/t);return{from:r*t,to:(r+1)*t}}let n=Math.floor((i-e)/t);return{from:i-(n+1)*t,to:i-n*t}}var bc=class{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let r=e.state.field(t),{options:s,selected:o}=r.open,a=e.state.facet(ve);this.optionContent=Qx(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=mc(s.length,o,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",l=>{let{options:h}=e.state.field(t).open;for(let c=l.target,f;c&&c!=this.dom;c=c.parentNode)if(c.nodeName=="LI"&&(f=/-(\d+)$/.exec(c.id))&&+f[1]{let h=e.state.field(this.stateField,!1);h&&h.tooltip&&e.state.facet(ve).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:Vr.of(null)})}),this.showOptions(s,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let n=e.state.field(this.stateField),r=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=r){let{options:s,selected:o,disabled:a}=n.open;(!r.open||r.open.options!=s)&&(this.range=mc(s.length,o,e.state.facet(ve).maxRenderedOptions),this.showOptions(s,n.id)),this.updateSel(),a!=((t=r.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let n of this.currentClass.split(" "))n&&this.dom.classList.remove(n);for(let n of t.split(" "))n&&this.dom.classList.add(n);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected=this.range.to)&&(this.range=mc(t.options.length,t.selected,this.view.state.facet(ve).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:n}=t.options[t.selected],{info:r}=n;if(!r)return;let s=typeof r=="string"?document.createTextNode(r):r(n);if(!s)return;"then"in s?s.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o,n)}).catch(o=>we(this.view.state,o,"completion info")):this.addInfoPane(s,n)}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:r,destroy:s}=e;n.appendChild(r),this.infoDestroy=s||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)n.nodeName!="LI"||!n.id?r--:r==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&n.removeAttribute("aria-selected");return t&&_x(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),s=this.space;if(!s){let o=this.dom.ownerDocument.defaultView||window;s={left:0,top:0,right:o.innerWidth,bottom:o.innerHeight}}return r.top>Math.min(s.bottom,t.bottom)-10||r.bottomn.from||n.from==0))if(s=u,typeof h!="string"&&h.header)r.appendChild(h.header(h));else{let d=r.appendChild(document.createElement("completion-section"));d.textContent=u}}let c=r.appendChild(document.createElement("li"));c.id=t+"-"+o,c.setAttribute("role","option");let f=this.optionClass(a);f&&(c.className=f);for(let u of this.optionContent){let d=u(a,this.view.state,this.view,l);d&&c.appendChild(d)}}return n.from&&r.classList.add("cm-completionListIncompleteTop"),n.tonew bc(t,i,e)}function _x(i,e){let t=i.getBoundingClientRect(),n=e.getBoundingClientRect(),r=t.height/i.offsetHeight;n.topt.bottom&&(i.scrollTop+=(n.bottom-t.bottom)/r)}function og(i){return(i.boost||0)*100+(i.apply?10:0)+(i.info?5:0)+(i.type?1:0)}function Dx(i,e){let t=[],n=null,r=h=>{t.push(h);let{section:c}=h.completion;if(c){n||(n=[]);let f=typeof c=="string"?c:c.name;n.some(u=>u.name==f)||n.push(typeof c=="string"?{name:f}:c)}},s=e.facet(ve);for(let h of i)if(h.hasResult()){let c=h.result.getMatch;if(h.result.filter===!1)for(let f of h.result.options)r(new Ho(f,h.source,c?c(f):[],1e9-t.length));else{let f=e.sliceDoc(h.from,h.to),u,d=s.filterStrict?new yc(f):new Oc(f);for(let m of h.result.options)if(u=d.match(m.label)){let p=m.displayLabel?c?c(m,u.matched):[]:u.matched;r(new Ho(m,h.source,p,u.score+(m.boost||0)))}}}if(n){let h=Object.create(null),c=0,f=(u,d)=>{var m,p;return((m=u.rank)!==null&&m!==void 0?m:1e9)-((p=d.rank)!==null&&p!==void 0?p:1e9)||(u.namef.score-c.score||l(c.completion,f.completion))){let c=h.completion;!a||a.label!=c.label||a.detail!=c.detail||a.type!=null&&c.type!=null&&a.type!=c.type||a.apply!=c.apply||a.boost!=c.boost?o.push(h):og(h.completion)>og(a)&&(o[o.length-1]=h),a=h.completion}return o}var wc=class i{constructor(e,t,n,r,s,o){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=s,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new i(this.options,ag(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,r,s){let o=Dx(e,t);if(!o.length)return r&&e.some(l=>l.state==1)?new i(r.options,r.attrs,r.tooltip,r.timestamp,r.selected,!0):null;let a=t.facet(ve).selectOnOpen?0:-1;if(r&&r.selected!=a&&r.selected!=-1){let l=r.options[r.selected].completion;for(let h=0;hh.hasResult()?Math.min(l,h.from):l,1e8),create:Xx,above:s.aboveCursor},r?r.timestamp:Date.now(),a,!1)}map(e){return new i(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}},vc=class i{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new i(qx,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,n=t.facet(ve),s=(n.override||t.languageDataAt("autocomplete",ai(t)).map(Ex)).map(a=>(this.active.find(h=>h.source==a)||new Ct(a,this.active.some(h=>h.state!=0)?1:0)).update(e,n));s.length==this.active.length&&s.every((a,l)=>a==this.active[l])&&(s=this.active);let o=this.open;o&&e.docChanged&&(o=o.map(e.changes)),e.selection||s.some(a=>a.hasResult()&&e.changes.touchesRange(a.from,a.to))||!$x(s,this.active)?o=wc.build(s,t,this.id,o,n):o&&o.disabled&&!s.some(a=>a.state==1)&&(o=null),!o&&s.every(a=>a.state!=1)&&s.some(a=>a.hasResult())&&(s=s.map(a=>a.hasResult()?new Ct(a.source,0):a));for(let a of e.effects)a.is(pg)&&(o=o&&o.setSelected(a.value,this.id));return s==this.active&&o==this.open?this:new i(s,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?Vx:Lx}};function $x(i,e){if(i==e)return!0;for(let t=0,n=0;;){for(;t-1&&(t["aria-activedescendant"]=i+"-"+e),t}var qx=[];function xc(i,e){if(i.isUserEvent("input.complete")){let t=i.annotation(Rc);if(t&&e.activateOnCompletion(t))return"input"}return i.isUserEvent("input.type")?"input":i.isUserEvent("delete.backward")?"delete":null}var Ct=class i{constructor(e,t,n=-1){this.source=e,this.state=t,this.explicitPos=n}hasResult(){return!1}update(e,t){let n=xc(e,t),r=this;n?r=r.handleUserEvent(e,n,t):e.docChanged?r=r.handleChange(e):e.selection&&r.state!=0&&(r=new i(r.source,0));for(let s of e.effects)if(s.is(Go))r=new i(r.source,1,s.value?ai(e.state):-1);else if(s.is(Vr))r=new i(r.source,0);else if(s.is(dg))for(let o of s.value)o.source==r.source&&(r=o);return r}handleUserEvent(e,t,n){return t=="delete"||!n.activateOnTyping?this.map(e.changes):new i(this.source,1)}handleChange(e){return e.changes.touchesRange(ai(e.startState))?new i(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new i(this.source,this.state,e.mapPos(this.explicitPos))}},Yo=class i extends Ct{constructor(e,t,n,r,s){super(e,2,t),this.result=n,this.from=r,this.to=s}hasResult(){return!0}handleUserEvent(e,t,n){var r;let s=this.result;s.map&&!e.changes.empty&&(s=s.map(s,e.changes));let o=e.changes.mapPos(this.from),a=e.changes.mapPos(this.to,1),l=ai(e.state);if((this.explicitPos<0?l<=o:la||!s||t=="delete"&&ai(e.startState)==this.from)return new Ct(this.source,t=="input"&&n.activateOnTyping?1:0);let h=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return Bx(s.validFor,e.state,o,a)?new i(this.source,h,s,o,a):s.update&&(s=s.update(s,o,a,new Fo(e.state,l,h>=0)))?new i(this.source,h,s,s.from,(r=s.to)!==null&&r!==void 0?r:ai(e.state)):new Ct(this.source,1,h)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new Ct(this.source,0):this.map(e.changes)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new i(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new Ct(this.source,0)}};function Bx(i,e,t,n){if(!i)return!1;let r=e.sliceDoc(t,n);return typeof i=="function"?i(r,t,n,e):ug(i,!0).test(r)}var dg=_.define({map(i,e){return i.map(t=>t.map(e))}}),pg=_.define(),Xe=te.define({create(){return vc.start()},update(i,e){return i.update(e)},provide:i=>[gr.from(i,e=>e.tooltip),E.contentAttributes.from(i,e=>e.attrs)]});function Ec(i,e){let t=e.completion.apply||e.completion.label,n=i.state.field(Xe).active.find(r=>r.source==e.source);return n instanceof Yo?(typeof t=="string"?i.dispatch(Object.assign(Object.assign({},Rx(i.state,t,n.from,n.to)),{annotations:Rc.of(e.completion)})):t(i,e.completion,n.from,n.to),!0):!1}var Xx=Mx(Xe,Ec);function Uo(i,e="option"){return t=>{let n=t.state.field(Xe,!1);if(!n||!n.open||n.open.disabled||Date.now()-n.open.timestamp-1?n.open.selected+r*(i?1:-1):i?0:o-1;return a<0?a=e=="page"?0:o-1:a>=o&&(a=e=="page"?o-1:0),t.dispatch({effects:pg.of(a)}),!0}}var Wx=i=>{let e=i.state.field(Xe,!1);return i.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampi.state.field(Xe,!1)?(i.dispatch({effects:Go.of(!0)}),!0):!1,Nx=i=>{let e=i.state.field(Xe,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(i.dispatch({effects:Vr.of(null)}),!0)},kc=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},jx=50,zx=1e3,Ux=re.fromClass(class{constructor(i){this.view=i,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of i.state.field(Xe).active)e.state==1&&this.startQuery(e)}update(i){let e=i.state.field(Xe),t=i.state.facet(ve);if(!i.selectionSet&&!i.docChanged&&i.startState.field(Xe)==e)return;let n=i.transactions.some(s=>(s.selection||s.docChanged)&&!xc(s,t));for(let s=0;sjx&&Date.now()-o.time>zx){for(let a of o.context.abortListeners)try{a()}catch(l){we(this.view.state,l)}o.context.abortListeners=null,this.running.splice(s--,1)}else o.updates.push(...i.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),i.transactions.some(s=>s.effects.some(o=>o.is(Go)))&&(this.pendingStart=!0);let r=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(s=>s.state==1&&!this.running.some(o=>o.active.source==s.source))?setTimeout(()=>this.startUpdate(),r):-1,this.composing!=0)for(let s of i.transactions)xc(s,t)=="input"?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:i}=this.view,e=i.field(Xe);for(let t of e.active)t.state==1&&!this.running.some(n=>n.active.source==t.source)&&this.startQuery(t)}startQuery(i){let{state:e}=this.view,t=ai(e),n=new Fo(e,t,i.explicitPos==t),r=new kc(i,n);this.running.push(r),Promise.resolve(i.source(n)).then(s=>{r.context.aborted||(r.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:Vr.of(null)}),we(this.view.state,s)})}scheduleAccept(){this.running.every(i=>i.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(ve).updateSyncTime))}accept(){var i;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(ve);for(let n=0;no.source==r.active.source);if(s&&s.state==1)if(r.done==null){let o=new Ct(r.active.source,0);for(let a of r.updates)o=o.update(a,t);o.state!=1&&e.push(o)}else this.startQuery(s)}e.length&&this.view.dispatch({effects:dg.of(e)})}},{eventHandlers:{blur(i){let e=this.view.state.field(Xe,!1);if(e&&e.tooltip&&this.view.state.facet(ve).closeOnBlur){let t=e.open&&Sh(this.view,e.open.tooltip);(!t||!t.dom.contains(i.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Vr.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Go.of(!1)}),20),this.composing=0}}}),Fx=typeof navigator=="object"&&/Win/.test(navigator.platform),Hx=Qe.highest(E.domEventHandlers({keydown(i,e){let t=e.state.field(Xe,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||i.key.length>1||i.ctrlKey&&!(Fx&&i.altKey)||i.metaKey)return!1;let n=t.open.options[t.open.selected],r=t.active.find(o=>o.source==n.source),s=n.completion.commitCharacters||r.result.commitCharacters;return s&&s.indexOf(i.key)>-1&&Ec(e,n),!1}})),mg=E.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xB7\xB7\xB7"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'\u0192'"}},".cm-completionIcon-class":{"&:after":{content:"'\u25CB'"}},".cm-completionIcon-interface":{"&:after":{content:"'\u25CC'"}},".cm-completionIcon-variable":{"&:after":{content:"'\u{1D465}'"}},".cm-completionIcon-constant":{"&:after":{content:"'\u{1D436}'"}},".cm-completionIcon-type":{"&:after":{content:"'\u{1D461}'"}},".cm-completionIcon-enum":{"&:after":{content:"'\u222A'"}},".cm-completionIcon-property":{"&:after":{content:"'\u25A1'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\u{1F511}\uFE0E'"}},".cm-completionIcon-namespace":{"&:after":{content:"'\u25A2'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),Sc=class{constructor(e,t,n,r){this.field=e,this.line=t,this.from=n,this.to=r}},Tc=class i{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(e){let t=e.mapPos(this.from,-1,ge.TrackDel),n=e.mapPos(this.to,1,ge.TrackDel);return t==null||n==null?null:new i(this.field,t,n)}},Pc=class i{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],r=[t],s=e.doc.lineAt(t),o=/^\s*/.exec(s.text)[0];for(let l of this.lines){if(n.length){let h=o,c=/^\t*/.exec(l)[0].length;for(let f=0;fnew Tc(l.field,r[l.line]+l.from,r[l.line]+l.to));return{text:n,ranges:a}}static parse(e){let t=[],n=[],r=[],s;for(let o of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(o);){let a=s[1]?+s[1]:null,l=s[2]||s[3]||"",h=-1,c=l.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f=h&&u.field++}r.push(new Sc(h,n.length,s.index,s.index+c.length)),o=o.slice(0,s.index)+l+o.slice(s.index+s[0].length)}o=o.replace(/\\([{}])/g,(a,l,h)=>{for(let c of r)c.line==n.length&&c.from>h&&(c.from--,c.to--);return l}),n.push(o)}return new i(n,r)}},Gx=M.widget({widget:new class extends Be{toDOM(){let i=document.createElement("span");return i.className="cm-snippetFieldPosition",i}ignoreEvent(){return!1}}}),Yx=M.mark({class:"cm-snippetField"}),vn=class i{constructor(e,t){this.ranges=e,this.active=t,this.deco=M.set(e.map(n=>(n.from==n.to?Gx:Yx).range(n.from,n.to)))}map(e){let t=[];for(let n of this.ranges){let r=n.map(e);if(!r)return null;t.push(r)}return new i(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(n=>n.field==this.active&&n.from<=t.from&&n.to>=t.to))}},Br=_.define({map(i,e){return i&&i.map(e)}}),Zx=_.define(),Lr=te.define({create(){return null},update(i,e){for(let t of e.effects){if(t.is(Br))return t.value;if(t.is(Zx)&&i)return new vn(i.ranges,t.value)}return i&&e.docChanged&&(i=i.map(e.changes)),i&&e.selection&&!i.selectionInsideField(e.selection)&&(i=null),i},provide:i=>E.decorations.from(i,e=>e?e.deco:M.none)});function Ac(i,e){return S.create(i.filter(t=>t.field==e).map(t=>S.range(t.from,t.to)))}function Jx(i){let e=Pc.parse(i);return(t,n,r,s)=>{let{text:o,ranges:a}=e.instantiate(t.state,r),l={changes:{from:r,to:s,insert:W.of(o)},scrollIntoView:!0,annotations:n?[Rc.of(n),fe.userEvent.of("input.complete")]:void 0};if(a.length&&(l.selection=Ac(a,0)),a.some(h=>h.field>0)){let h=new vn(a,0),c=l.effects=[Br.of(h)];t.state.field(Lr,!1)===void 0&&c.push(_.appendConfig.of([Lr,n1,r1,mg]))}t.dispatch(t.state.update(l))}}function gg(i){return({state:e,dispatch:t})=>{let n=e.field(Lr,!1);if(!n||i<0&&n.active==0)return!1;let r=n.active+i,s=i>0&&!n.ranges.some(o=>o.field==r+i);return t(e.update({selection:Ac(n.ranges,r),effects:Br.of(s?null:new vn(n.ranges,r)),scrollIntoView:!0})),!0}}var Kx=({state:i,dispatch:e})=>i.field(Lr,!1)?(e(i.update({effects:Br.of(null)})),!0):!1,e1=gg(1),t1=gg(-1);var i1=[{key:"Tab",run:e1,shift:t1},{key:"Escape",run:Kx}],lg=A.define({combine(i){return i.length?i[0]:i1}}),n1=Qe.highest(qt.compute([lg],i=>i.facet(lg)));function Rt(i,e){return Object.assign(Object.assign({},e),{apply:Jx(i)})}var r1=E.domEventHandlers({mousedown(i,e){let t=e.state.field(Lr,!1),n;if(!t||(n=e.posAtCoords({x:i.clientX,y:i.clientY}))==null)return!1;let r=t.ranges.find(s=>s.from<=n&&s.to>=n);return!r||r.field==t.active?!1:(e.dispatch({selection:Ac(t.ranges,r.field),effects:Br.of(t.ranges.some(s=>s.field>r.field)?new vn(t.ranges,r.field):null),scrollIntoView:!0}),!0)}});var qr={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Di=_.define({map(i,e){let t=e.mapPos(i,-1,ge.TrackAfter);return t??void 0}}),Qc=new class extends at{};Qc.startSide=1;Qc.endSide=-1;var Og=te.define({create(){return j.empty},update(i,e){if(i=i.map(e.changes),e.selection){let t=e.state.doc.lineAt(e.selection.main.head);i=i.update({filter:n=>n>=t.from&&n<=t.to})}for(let t of e.effects)t.is(Di)&&(i=i.update({add:[Qc.range(t.value,t.value+1)]}));return i}});function yg(){return[o1,Og]}var gc="()[]{}<>";function bg(i){for(let e=0;e{if((s1?i.composing:i.compositionStarted)||i.state.readOnly)return!1;let r=i.state.selection.main;if(n.length>2||n.length==2&&Ee(ce(n,0))==1||e!=r.from||t!=r.to)return!1;let s=l1(i.state,n);return s?(i.dispatch(s),!0):!1}),a1=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let n=wg(i,i.selection.main.head).brackets||qr.brackets,r=null,s=i.changeByRange(o=>{if(o.empty){let a=h1(i.doc,o.head);for(let l of n)if(l==a&&Zo(i.doc,o.head)==bg(ce(l,0)))return{changes:{from:o.head-l.length,to:o.head+l.length},range:S.cursor(o.head-l.length)}}return{range:r=o}});return r||e(i.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},vg=[{key:"Backspace",run:a1}];function l1(i,e){let t=wg(i,i.selection.main.head),n=t.brackets||qr.brackets;for(let r of n){let s=bg(ce(r,0));if(e==r)return s==r?u1(i,r,n.indexOf(r+r+r)>-1,t):c1(i,r,s,t.before||qr.before);if(e==s&&xg(i,i.selection.main.from))return f1(i,r,s)}return null}function xg(i,e){let t=!1;return i.field(Og).between(0,i.doc.length,n=>{n==e&&(t=!0)}),t}function Zo(i,e){let t=i.sliceString(e,e+2);return t.slice(0,Ee(ce(t,0)))}function h1(i,e){let t=i.sliceString(e-2,e);return Ee(ce(t,0))==t.length?t:t.slice(1)}function c1(i,e,t,n){let r=null,s=i.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:Di.of(o.to+e.length),range:S.range(o.anchor+e.length,o.head+e.length)};let a=Zo(i.doc,o.head);return!a||/\s/.test(a)||n.indexOf(a)>-1?{changes:{insert:e+t,from:o.head},effects:Di.of(o.head+e.length),range:S.cursor(o.head+e.length)}:{range:r=o}});return r?null:i.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function f1(i,e,t){let n=null,r=i.changeByRange(s=>s.empty&&Zo(i.doc,s.head)==t?{changes:{from:s.head,to:s.head+t.length,insert:t},range:S.cursor(s.head+t.length)}:n={range:s});return n?null:i.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function u1(i,e,t,n){let r=n.stringPrefixes||qr.stringPrefixes,s=null,o=i.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:e,from:a.to}],effects:Di.of(a.to+e.length),range:S.range(a.anchor+e.length,a.head+e.length)};let l=a.head,h=Zo(i.doc,l),c;if(h==e){if(hg(i,l))return{changes:{insert:e+e,from:l},effects:Di.of(l+e.length),range:S.cursor(l+e.length)};if(xg(i,l)){let u=t&&i.sliceDoc(l,l+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:l,to:l+u.length,insert:u},range:S.cursor(l+u.length)}}}else{if(t&&i.sliceDoc(l-2*e.length,l)==e+e&&(c=cg(i,l-2*e.length,r))>-1&&hg(i,c))return{changes:{insert:e+e+e+e,from:l},effects:Di.of(l+e.length),range:S.cursor(l+e.length)};if(i.charCategorizer(l)(h)!=F.Word&&cg(i,l,r)>-1&&!d1(i,l,e,r))return{changes:{insert:e+e,from:l},effects:Di.of(l+e.length),range:S.cursor(l+e.length)}}return{range:s=a}});return s?null:i.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function hg(i,e){let t=he(i).resolveInner(e+1);return t.parent&&t.from==e}function d1(i,e,t,n){let r=he(i).resolveInner(e,-1),s=n.reduce((o,a)=>Math.max(o,a.length),0);for(let o=0;o<5;o++){let a=i.sliceDoc(r.from,Math.min(r.to,r.from+t.length+s)),l=a.indexOf(t);if(!l||l>-1&&n.indexOf(a.slice(0,l))>-1){let c=r.firstChild;for(;c&&c.from==r.from&&c.to-c.from>t.length+l;){if(i.sliceDoc(c.to-t.length,c.to)==t)return!1;c=c.firstChild}return!0}let h=r.to==e&&r.parent;if(!h)break;r=h}return!1}function cg(i,e,t){let n=i.charCategorizer(e);if(n(i.sliceDoc(e-1,e))!=F.Word)return e;for(let r of t){let s=e-r.length;if(i.sliceDoc(s,e)==r&&n(i.sliceDoc(s-1,s))!=F.Word)return s}return-1}function Xr(i={}){return[Hx,Xe,ve.of(i),Ux,p1,mg]}var Mc=[{key:"Ctrl-Space",run:Ix},{key:"Escape",run:Nx},{key:"ArrowDown",run:Uo(!0)},{key:"ArrowUp",run:Uo(!1)},{key:"PageDown",run:Uo(!0,"page")},{key:"PageUp",run:Uo(!1,"page")},{key:"Enter",run:Wx}],p1=Qe.highest(qt.computeN([ve],i=>i.facet(ve).defaultKeymap?[Mc]:[]));var _c=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},$i=class i{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let r=e,s=n.facet(Wr).markerFilter;s&&(r=s(r,n));let o=M.set(r.map(a=>a.from==a.to||a.from==a.to-1&&n.doc.lineAt(a.from).to==a.from?M.widget({widget:new Dc(a),diagnostic:a}).range(a.from):M.mark({attributes:{class:"cm-lintRange cm-lintRange-"+a.severity+(a.markClass?" "+a.markClass:"")},diagnostic:a}).range(a.from,a.to)),!0);return new i(o,t,xn(o))}};function xn(i,e=null,t=0){let n=null;return i.between(t,1e9,(r,s,{spec:o})=>{if(!(e&&o.diagnostic!=e))return n=new _c(r,s,o.diagnostic),!1}),n}function m1(i,e){let t=e.pos,n=e.end||t,r=i.state.facet(Wr).hideOn(i,t,n);if(r!=null)return r;let s=i.startState.doc.lineAt(e.pos);return!!(i.effects.some(o=>o.is(Sg))||i.changes.touchesRange(s.from,Math.max(s.to,n)))}function g1(i,e){return i.field(He,!1)?e:e.concat(_.appendConfig.of(S1))}var Sg=_.define(),$c=_.define(),Tg=_.define(),He=te.define({create(){return new $i(M.none,null,null)},update(i,e){if(e.docChanged&&i.diagnostics.size){let t=i.diagnostics.map(e.changes),n=null,r=i.panel;if(i.selected){let s=e.changes.mapPos(i.selected.from,1);n=xn(t,i.selected.diagnostic,s)||xn(t,null,s)}!t.size&&r&&e.state.facet(Wr).autoPanel&&(r=null),i=new $i(t,r,n)}for(let t of e.effects)if(t.is(Sg)){let n=e.state.facet(Wr).autoPanel?t.value.length?Ir.open:null:i.panel;i=$i.init(t.value,n,e.state)}else t.is($c)?i=new $i(i.diagnostics,t.value?Ir.open:null,i.selected):t.is(Tg)&&(i=new $i(i.diagnostics,i.panel,t.value));return i},provide:i=>[Ti.from(i,e=>e.panel),E.decorations.from(i,e=>e.diagnostics)]});var O1=M.mark({class:"cm-lintRange cm-lintRange-active"});function y1(i,e,t){let{diagnostics:n}=i.state.field(He),r=[],s=2e8,o=0;n.between(e-(t<0?1:0),e+(t>0?1:0),(l,h,{spec:c})=>{e>=l&&e<=h&&(l==h||(e>l||t>0)&&(eRg(i,t,!1)))}var w1=i=>{let e=i.state.field(He,!1);(!e||!e.panel)&&i.dispatch({effects:g1(i.state,[$c.of(!0)])});let t=Pi(i,Ir.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},kg=i=>{let e=i.state.field(He,!1);return!e||!e.panel?!1:(i.dispatch({effects:$c.of(!1)}),!0)},v1=i=>{let e=i.state.field(He,!1);if(!e)return!1;let t=i.state.selection.main,n=e.diagnostics.iter(t.to+1);return!n.value&&(n=e.diagnostics.iter(0),!n.value||n.from==t.from&&n.to==t.to)?!1:(i.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0}),!0)};var Pg=[{key:"Mod-Shift-m",run:w1,preventDefault:!0},{key:"F8",run:v1}];var Wr=A.define({combine(i){return Object.assign({sources:i.map(e=>e.source).filter(e=>e!=null)},Te(i.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t}))}});function Cg(i){let e=[];if(i)e:for(let{name:t}of i){for(let n=0;ns.toLowerCase()==r.toLowerCase())){e.push(r);continue e}}e.push("")}return e}function Rg(i,e,t){var n;let r=t?Cg(e.actions):[];return U("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},U("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(i):e.message),(n=e.actions)===null||n===void 0?void 0:n.map((s,o)=>{let a=!1,l=u=>{if(u.preventDefault(),a)return;a=!0;let d=xn(i.state.field(He).diagnostics,e);d&&s.apply(i,d.from,d.to)},{name:h}=s,c=r[o]?h.indexOf(r[o]):-1,f=c<0?h:[h.slice(0,c),U("u",h.slice(c,c+1)),h.slice(c+1)];return U("button",{type:"button",class:"cm-diagnosticAction",onclick:l,onmousedown:l,"aria-label":` Action: ${h}${c<0?"":` (access key "${r[o]})"`}.`},f)}),e.source&&U("div",{class:"cm-diagnosticSource"},e.source))}var Dc=class extends Be{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return U("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}},Ko=class{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=Rg(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}},Ir=class i{constructor(e){this.view=e,this.items=[];let t=r=>{if(r.keyCode==27)kg(this.view),this.view.focus();else if(r.keyCode==38||r.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(r.keyCode==40||r.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(r.keyCode==36)this.moveSelection(0);else if(r.keyCode==35)this.moveSelection(this.items.length-1);else if(r.keyCode==13)this.view.focus();else if(r.keyCode>=65&&r.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=Cg(s.actions);for(let a=0;a{for(let s=0;skg(this.view)},"\xD7")),this.update()}get selectedIndex(){let e=this.view.state.field(He).selected;if(!e)return-1;for(let t=0;t{let h=-1,c;for(let f=n;fn&&(this.items.splice(n,h-n),r=!0)),t&&c.diagnostic==t.diagnostic?c.dom.hasAttribute("aria-selected")||(c.dom.setAttribute("aria-selected","true"),s=c):c.dom.hasAttribute("aria-selected")&&c.dom.removeAttribute("aria-selected"),n++});n({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:o,panel:a})=>{let l=a.height/this.list.offsetHeight;o.topa.bottom&&(this.list.scrollTop+=(o.bottom-a.bottom)/l)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let n=e;e=n.nextSibling,n.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(He),n=xn(t.diagnostics,this.items[e].diagnostic);n&&this.view.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0,effects:Tg.of(n)})}static open(e){return new i(e)}};function x1(i,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(i)}')`}function Jo(i){return x1(``,'width="6" height="3"')}var k1=E.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Jo("#d11")},".cm-lintRange-warning":{backgroundImage:Jo("orange")},".cm-lintRange-info":{backgroundImage:Jo("#999")},".cm-lintRange-hint":{backgroundImage:Jo("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});var S1=[He,E.decorations.compute([He],i=>{let{selected:e,panel:t}=i.field(He);return!e||!t||e.from==e.to?M.none:M.set([O1.range(e.from,e.to)])}),vp(y1,{hideOn:m1}),k1];var Eg=[Sp(),Tp(),Op(),pm(),Zp(),dp(),gp(),N.allowMultipleSelections.of(!0),Np(),Ar(Kp,{fallback:!0}),nm(),yg(),Xr(),bp(),wp(),yp(),Zm(),qt.of([...vg,...Nm,...ig,...ym,...Hp,...Mc,...Pg])];var qc=class i{constructor(e,t,n,r,s,o,a,l,h,c=0,f){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=s,this.score=o,this.buffer=a,this.bufferBase=l,this.curContext=h,this.lookAhead=c,this.parent=f}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let r=e.parser.context;return new i(e,[],t,n,n,0,[],0,r?new ea(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,r=e&65535,{parser:s}=this.p;this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSizea;)this.stack.pop();this.reduceContext(r,l)}storeNode(e,t,n,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&o.buffer[a-4]==0&&o.buffer[a-1]>-1){if(t==n)return;if(o.buffer[a-2]>=t){o.buffer[a-2]=n;return}}}if(!s||this.pos==n)this.buffer.push(e,t,n,r);else{let o=this.buffer.length;if(o>0&&this.buffer[o-4]!=0)for(;o>0&&this.buffer[o-2]>n;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4);this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=n,this.buffer[o+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let s=e,{parser:o}=this.p;(r>this.pos||t<=o.maxNode)&&(this.pos=r,o.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,n),this.shiftContext(t,n),t<=o.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new i(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new Bc(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let r=[];for(let s=0,o;sl&1&&a==o)||r.push(t[s],o)}t=r}let n=[];for(let r=0;r>19,r=t&65535,s=this.stack.length-n*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,s)=>{if(!t.includes(r))return t.push(r),e.allActions(r,o=>{if(!(o&393216))if(o&65536){let a=(o>>19)-s;if(a>1){let l=o&65535,h=this.stack.length-a*3;if(h>=0&&e.getGoto(this.stack[h],l,!1)>=0)return a<<19|65536|l}}else{let a=n(o,s+1);if(a!=null)return a}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},ea=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},Bc=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}},Xc=class i{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new i(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new i(this.stack,this.pos,this.index)}};function Nr(i,e=Uint16Array){if(typeof i!="string")return i;let t=null;for(let n=0,r=0;n=92&&o--,o>=34&&o--;let l=o-32;if(l>=46&&(l-=46,a=!0),s+=l,a)break;s*=46}t?t[r++]=s:t=new e(s)}return t}var kn=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},Ag=new kn,Wc=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Ag,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,s=this.pos+e;for(;sn.to:s>=n.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-n.to,n=o}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t=this.chunk2Pos&&na.to&&(this.chunk2=this.chunk2.slice(0,a.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=Ag,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}},li=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;$g(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};li.prototype.contextual=li.prototype.fallback=li.prototype.extend=!1;var Ic=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e=="string"?Nr(e):e}token(e,t){let n=e.pos,r=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if($g(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;e.reset(o,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}};Ic.prototype.contextual=li.prototype.fallback=li.prototype.extend=!1;var Vi=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function $g(i,e,t,n,r,s){let o=0,a=1<0){let m=i[d];if(l.allows(m)&&(e.token.value==-1||e.token.value==m||P1(m,e.token.value,r,s))){e.acceptToken(m);break}}let c=e.next,f=0,u=i[o+2];if(e.next<0&&u>f&&i[h+u*3-3]==65535){o=i[h+u*3-1];continue e}for(;f>1,m=h+d+(d<<1),p=i[m],g=i[m+1]||65536;if(c=g)f=d+1;else{o=i[m+2],e.advance();continue e}}break}}function Qg(i,e,t){for(let n=e,r;(r=i[n])!=65535;n++)if(r==t)return n-e;return-1}function P1(i,e,t,n){let r=Qg(t,n,e);return r<0||Qg(t,n,i)e)&&!n.type.isError)return t<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(i.length,Math.max(n.from+1,e+25));if(t<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return t<0?0:i.length}}var Nc=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Mg(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Mg(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=o,null;if(s instanceof le){if(o==e){if(o=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+s.length}}},jc=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new kn)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:s}=r,o=r.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,l=0;for(let h=0;hf.end+25&&(l=Math.max(f.lookAhead,l)),f.value!=0)){let u=t;if(f.extended>-1&&(t=this.addActions(e,f.extended,f.end,t)),t=this.addActions(e,f.value,f.end,t),!c.extend&&(n=f,t>u))break}}for(;this.actions.length>t;)this.actions.pop();return l&&e.setLookAhead(l),!n&&e.pos==this.stream.end&&(n=new kn,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new kn,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:s}=n.p;for(let o=0;o=0&&n.p.parser.dialect.allows(a>>1)){a&1?e.extended=a>>1:e.value=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let s=0;se.bufferLength*4?new Nc(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;ot)n.push(a);else{if(this.advanceStack(a,n,e))continue;{r||(r=[],s=[]),r.push(a);let l=this.tokens.getMainToken(a);s.push(l.value,l.end)}}break}}if(!n.length){let o=r&&C1(r);if(o)return Ge&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw Ge&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,n);if(o)return Ge&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(n.length>o)for(n.sort((a,l)=>l.score-a.score);n.length>o;)n.pop();n.some(a=>a.reducePos>t)&&this.recovering--}else if(n.length>1){e:for(let o=0;o500&&h.buffer.length>500)if((a.score-h.score||a.buffer.length-h.buffer.length)>0)n.splice(l--,1);else{n.splice(o--,1);continue e}}}n.length>12&&n.splice(12,n.length-12)}this.minStackPos=n[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let h=e.curContext&&e.curContext.tracker.strict,c=h?e.curContext.hash:0;for(let f=this.fragments.nodeAt(r);f;){let u=this.parser.nodeSet.types[f.type.id]==f.type?s.getGoto(e.state,f.type.id):-1;if(u>-1&&f.length&&(!h||(f.prop($.contextHash)||0)==c))return e.useNode(f,u),Ge&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(f.type.id)})`),!0;if(!(f instanceof le)||f.children.length==0||f.positions[0]>0)break;let d=f.children[0];if(d instanceof le&&f.positions[0]==0)f=d;else break}}let a=s.stateSlot(e.state,4);if(a>0)return e.reduce(a),Ge&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(a&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let h=0;hr?t.push(m):n.push(m)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return _g(e,t),!0}}runRecovery(e,t,n){let r=null,s=!1;for(let o=0;o ":"";if(a.deadEnd&&(s||(s=!0,a.restart(),Ge&&console.log(c+this.stackID(a)+" (restarted)"),this.advanceFully(a,n))))continue;let f=a.split(),u=c;for(let d=0;f.forceReduce()&&d<10&&(Ge&&console.log(u+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,n));d++)Ge&&(u=this.stackID(f)+" -> ");for(let d of a.recoverByInsert(l))Ge&&console.log(c+this.stackID(d)+" (via recover-insert)"),this.advanceFully(d,n);this.stream.end>a.pos?(h==a.pos&&(h++,l=0),a.recoverByDelete(l,h),Ge&&console.log(c+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),_g(a,n)):(!r||r.scorei,ta=class{constructor(e){this.start=e.start,this.shift=e.shift||Lc,this.reduce=e.reduce||Lc,this.reuse=e.reuse||Lc,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},Sn=class i extends hn{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let a=0;ae.topRules[a][1]),r=[];for(let a=0;a=0)s(c,l,a[h++]);else{let f=a[h+-c];for(let u=-c;u>0;u--)s(a[h++],l,f);h++}}}this.nodeSet=new yr(t.map((a,l)=>Pe.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:r[l],top:n.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=1024;let o=Nr(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;atypeof a=="number"?new li(o,a):a),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new zc(this,e,t,n);for(let s of this.wrappers)r=s(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let o=r[s++],a=o&1,l=r[s++];if(a&&n)return l;for(let h=s+(o>>1);s0}validAction(e,t){return!!this.allActions(e,n=>n==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=Bt(this.data,s+2);else break;r=t(Bt(this.data,s+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=Bt(this.data,n+2);else break;if(!(this.data[n+2]&1)){let r=this.data[n+1];t.some((s,o)=>o&1&&s==r)||t.push(this.data[n],r)}}return t}configure(e){let t=Object.assign(Object.create(i.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(n=>{let r=e.tokenizers.find(s=>s.from==n);return r?r.to:n})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,r)=>{let s=e.specializers.find(a=>a.from==n.external);if(!s)return n;let o=Object.assign(Object.assign({},n),{external:s.to});return t.specializers[r]=Dg(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let s of e.split(" ")){let o=t.indexOf(s);o>=0&&(n[o]=!0)}let r=null;for(let s=0;sn)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scorei.external(t,n)<<1|e}return i.get}var R1=fn({"repeat while for if else return break next in":b.controlKeyword,"Logical!":b.bool,function:b.definitionKeyword,"FunctionCall/Identifier FunctionCall/String":b.function(b.variableName),"NamedArg!":b.function(b.attributeName),Comment:b.lineComment,"Numeric Integer Complex Inf":b.number,"SpecialConstant!":b.literal,String:b.string,"ArithOp MatrixOp":b.arithmeticOperator,BitOp:b.bitwiseOperator,CompareOp:b.compareOperator,"ExtractionOp NamespaceOp":b.operator,AssignmentOperator:b.definitionOperator,"...":b.punctuation,"( )":b.paren,"[ ]":b.squareBracket,"{ }":b.brace,$:b.derefOperator,", ;":b.separator}),E1={__proto__:null,TRUE:12,T:14,FALSE:18,F:20,NULL:30,NA:34,Inf:38,NaN:42,function:46,"...":50,return:60,break:64,next:68,if:80,else:82,repeat:86,while:90,for:94,in:96},ia=Sn.deserialize({version:14,states:"7dOYQPOOOOQO'#Dx'#DxOOQO'#Dw'#DwO$aQPO'#DwOOQO'#Dy'#DyO(]QPO'#DvOOQO'#Dv'#DvOOQO'#Cx'#CxO*UQPO'#CwO,YQPO'#DmO/rQPO'#DaO1kQPO'#D`OOQO'#Dz'#DzOOQO'#Du'#DuQYQPOOOOQO'#Ca'#CaOOQO'#Cd'#CdOOQO'#Cj'#CjOOQO'#Cl'#ClOOQO'#Cn'#CnOOQO'#Cp'#CpO1|QPO'#CrO2RQPO'#DTO!bQPO'#DWO2WQPO'#DYO2]QPO'#D[O3oQPO'#DROOQO,59l,59lO3yQPO'#DoOOQO'#Do'#DoO*UQPO,59cOOQO'#DP'#DPOOQO,59c,59cO5fQPO'#CyO5kQPO'#C{O7XQPO'#C}O8uQPO,59yO:ZQQO,59yOOQO'#Dd'#DdOOQO'#De'#DeOOQO'#Df'#DfOOQO'#Dg'#DgOOQO'#Dh'#DhOOQO'#Di'#DiOOQO'#Dj'#DjOOQO'#Dk'#DkOOQO'#Dl'#DlOYQPO,59}OYQPO,59}OYQPO,59}OYQPO,59}OYQPO,59}OYQPO,59}OYQPO,59}OYQPO,59}OYQPO,59}OOQO'#Db'#DbOYQPO,59zOOQO-E7k-E7kO:bQPO'#CtO!bQPO,59^OYQPO,59oOOQO,59r,59rOYQPO,59tOYQPO,59vO:mQPO'#DwO:tQPO'#DvO:{QPO'#ESO;VQPO'#ESO;aQPO,59mO;fQPO'#ESOOQO-E7m-E7mOOQO1G.}1G.}O;nQPO,59eO;uQPO,59gO;zQPO,59iOkQQO'#DvO@gQQO'#EUO@qQQO1G/eO@vQQO'#DaODcQPO1G/iODmQPO1G/iOH`QPO1G/iOHgQPO1G/iOLSQPO1G/iOL^QPO1G/iO! aQPO1G/iO!!WQPO1G/iO!$tQPO1G/iO!(dQPO1G/fO!*]QPO'#D}OYQPO'#D}O!*hQPO,59`O!*`QPO'#D}OOQO1G.x1G.xO!*mQPO1G/ZO!*tQPO1G/`O!*{QPO1G/bOOQO,59n,59nO!+SQPO'#DpO!+ZQPO,5:nO!+cQPO,5:nOOQO1G/X1G/XO!+mQPO1G/POOQO1G/P1G/POOQO1G/R1G/ROOQO1G/T1G/TOYQPO'#DqO!+tQPO,5:pOOQO7+%P7+%PO!+|QQO,5:pOOQO,59b,59bO!,UQPO'#DnO!,^QPO,5:iO!,fQPO,5:iOOQO1G.z1G.zO!bQPO7+$uO!bQPO7+$zOYQPO7+$|O!,pQPO,5:[O!,zQPO,5:[OOQO,5:[,5:[OOQO-E7n-E7nO!-UQPO1G0YOOQO7+$k7+$kO!-^QPO,5:]OOQO-E7o-E7oO!-hQQO,5:]O!/fQQO1G/iO!/pQQO1G/iO!1qQQO1G/iO!1xQQO1G/iO!3sQQO1G/iO!3}QQO1G/iO!5`QQO1G/iO!6VQQO1G/iO!6|QQO1G/iO!7TQQO1G/fO!7[QPO,5:YOYQPO,5:YOOQO,5:Y,5:YOOQO-E7l-E7lO!7gQPO1G0TO!9iQPO<SO!;}QQO<YO!s$lO!{!xX~P*fO!{#dO~O!{!nX~P-lO!pjOR!ViS!ViU!ViV!ViX!ViY!ViZ!Vi[!Vi]!Vi_!Via!Vic!Vie!Vig!Vix!Vi{!Vi}!Vi!P!Vi!f!Vi!u!Vi!w!Vi!z!Vi#S!Vi#T!Vi#U!Vi#V!Vi#W!Vi#X!Vi#Y!Vi#Z!Vi#[!Vi#]!Vi#^!Vi#_!Vi#`!Vi#a!Vi#b!Vi#c!Vi#d!Vi#e!Vi#f!Vi#g!Vi#h!Vin!Vip!Vir!Vi!t!Vi!o!Vi!s!Vi!y!Vi!Q!Vi~O#Q!Vi#R!Vi~P@}O#QvO#RvO~P@}O!pjO#QvO#RvO#SwO#TwOR!ViS!ViU!ViV!ViX!ViY!ViZ!Vi[!Vi]!Vi_!Via!Vic!Vie!Vig!Vix!Vi{!Vi}!Vi!P!Vi!f!Vi!u!Vi!w!Vi!z!Vi#V!Vi#W!Vi#X!Vi#Y!Vi#Z!Vi#[!Vi#]!Vi#^!Vi#_!Vi#`!Vi#a!Vi#b!Vi#c!Vi#d!Vi#e!Vi#f!Vi#g!Vi#h!Vin!Vip!Vir!Vi!t!Vi!o!Vi!s!Vi!y!Vi!Q!Vi~O#U!Vi~PDwO#UxO~PDwO!pjO#QvO#RvO#SwO#TwO#UxO#VyO#WyO#XyO#a|O#b|O#c|O#d|OR!ViS!ViU!ViV!ViX!ViY!ViZ!Vi[!Vi]!Vi_!Via!Vic!Vie!Vig!Vix!Vi{!Vi}!Vi!P!Vi!f!Vi!u!Vi!w!Vi!z!Vi#[!Vi#]!Vi#^!Vi#_!Vi#`!Vi#e!Vi#f!Vi#g!Vi#h!Vin!Vip!Vir!Vi!t!Vi!o!Vi!s!Vi!y!Vi!Q!Vi~O#Y!Vi#Z!Vi~PHnO#YzO#ZzO~PHnO!pjO#QvO#RvO#SwO#TwO#UxO#VyO#WyO#XyOR!ViS!ViU!ViV!ViX!ViY!ViZ!Vi[!Vi]!Vi_!Via!Vic!Vie!Vig!Vix!Vi{!Vi}!Vi!P!Vi!f!Vi!u!Vi!w!Vi!z!Vi#e!Vi#f!Vi#g!Vi#h!Vin!Vip!Vir!Vi!t!Vi!o!Vi!s!Vi!y!Vi!Q!Vi~O#Y!Vi#Z!Vi#[!Vi#]!Vi#^!Vi#_!Vi#`!Vi#a!Vi#b!Vi#c!Vi#d!Vi~PLhO#YzO#ZzO#[{O#]{O#^{O#_{O#`{O#a|O#b|O#c|O#d|O~PLhO!pjO#QvO#RvO#SwO#TwO#UxO#VyO#WyO#XyO#YzO#ZzO#[{O#]{O#^{O#_{O#`{O#a|O#b|O#c|O#d|O#e}O#f}O!w!Vi!z!Vi#g!Vi#h!Vi!s!Vi~OR!ViS!ViU!ViV!ViX!ViY!ViZ!Vi[!Vi]!Vi_!Via!Vic!Vie!Vig!Vix!Vi{!Vi}!Vi!P!Vi!f!Vi!u!Vin!Vip!Vir!Vi!t!Vi!o!Vi!y!Vi!Q!Vi~P!!}O!pjO!w!Si!z!Si#Q!Si#R!Si#S!Si#T!Si#U!Si#V!Si#W!Si#X!Si#Y!Si#Z!Si#[!Si#]!Si#^!Si#_!Si#`!Si#a!Si#b!Si#c!Si#d!Si#e!Si#f!Si#g!Si#h!Si!s!Si~OR!SiS!SiU!SiV!SiX!SiY!SiZ!Si[!Si]!Si_!Sia!Sic!Sie!Sig!Six!Si{!Si}!Si!P!Si!f!Si!u!Sin!Sip!Sir!Si!t!Si!o!Si!y!Si!Q!Si~P!&mO!r#fO!s#gO!o!qX~O!o#jO~O!o#kO~P*fO!o#lO~P*fO!Q#mO~P*fOi#pO~P2bO!s#YO!o!va~O!s#YO!o!va~P*fO!o#sO~P*fO!s#bO!y!xa~O!s$lO!{!xa~OR$ROi$TO~O!s#gO!o!qa~O!s#gO!o!qa~P*fO!o!da!s!da~P*fO!o!da!s!da~PYO!s#YO!o!vi~O!s!ea!y!ea~P*fO!s!ea!{!ea~P*fO!pjO!s!Vi!w!Vi!z!Vi!{!Vi#S!Vi#T!Vi#U!Vi#V!Vi#W!Vi#X!Vi#Y!Vi#Z!Vi#[!Vi#]!Vi#^!Vi#_!Vi#`!Vi#a!Vi#b!Vi#c!Vi#d!Vi#e!Vi#f!Vi#g!Vi#h!Vi~O#Q!Vi#R!Vi~P!-rO#QvO#RvO~P!-rO!pjO#QvO#RvO#SwO#TwO!s!Vi!w!Vi!z!Vi!{!Vi#V!Vi#W!Vi#X!Vi#Y!Vi#Z!Vi#[!Vi#]!Vi#^!Vi#_!Vi#`!Vi#a!Vi#b!Vi#c!Vi#d!Vi#e!Vi#f!Vi#g!Vi#h!Vi~O#U!Vi~P!/zO#UxO~P!/zO!pjO#QvO#RvO#SwO#TwO#UxO#VyO#WyO#XyO#a|O#b|O#c|O#d|O!s!Vi!w!Vi!z!Vi!{!Vi#[!Vi#]!Vi#^!Vi#_!Vi#`!Vi#e!Vi#f!Vi#g!Vi#h!Vi~O#Y!Vi#Z!Vi~P!2PO#YzO#ZzO~P!2PO!pjO#QvO#RvO#SwO#TwO#UxO#VyO#WyO#XyO!s!Vi!w!Vi!z!Vi!{!Vi#e!Vi#f!Vi#g!Vi#h!Vi~O#Y!Vi#Z!Vi#[!Vi#]!Vi#^!Vi#_!Vi#`!Vi#a!Vi#b!Vi#c!Vi#d!Vi~P!4XO#YzO#ZzO#[{O#]{O#^{O#_{O#`{O#a|O#b|O#c|O#d|O~P!4XO!{!Vi~P!!}O!{!Si~P!&mO!r#fO!o!ba!s!ba~O!s#gO!o!qi~Oy$]O!pwy!wwy!zwy#Qwy#Rwy#Swy#Twy#Uwy#Vwy#Wwy#Xwy#Ywy#Zwy#[wy#]wy#^wy#_wy#`wy#awy#bwy#cwy#dwy#ewy#fwy#gwy#hwy!swy~ORwySwyUwyVwyXwyYwyZwy[wy]wy_wyawycwyewygwyxwy{wy}wy!Pwy!fwy!uwynwypwyrwy!twy!owy!ywy!Qwy~P!7oO!o$^O~P*fO!o!di!s!di~P*fO!o!bi!s!bi~P*fO!{wy~P!7oO!o$mO~P*fO!p$pO~O",goto:"7}!yPPPPP!zPP!zPPPPP#vP#vP#vP#vP$rP%nP%q%w'Y(]P(]P(]P(a(g)e*b$rPP$rP$rP$rPP(g$r*h+f$r+l,d-Y-|.n/[/v0f1O1f1l1w1}2ZPPP2e4}5y6u5y4}PP7qPPPP7tP7w!sPOW^jntu!P!Q!R!S!T!U!V!W!X!Z!_!a!b!f!k#Q#Y#b#m#o$S$b$c$d$e$f$g$h$i$j$k$l$p!sSOW^jntu!P!Q!R!S!T!U!V!W!X!Z!_!a!b!f!k#Q#Y#b#m#o$S$b$c$d$e$f$g$h$i$j$k$l$p!s[OW^jntu!P!Q!R!S!T!U!V!W!X!Z!_!a!b!f!k#Q#Y#b#m#o$S$b$c$d$e$f$g$h$i$j$k$l$pR!^eQ#Q!]R$S#g!r[OW^jntu!P!Q!R!S!T!U!V!W!X!Z!_!a!b!f!k#Q#Y#b#m#o$S$b$c$d$e$f$g$h$i$j$k$l$pQ!`gQ#T!^Q$W#kQ$X#lQ$_$mQ$`$]R$a$^#RWOW^gjntu!P!Q!R!S!T!U!V!W!X!Z!^!_!a!b!f!k#Q#Y#b#k#l#m#o$S$]$^$b$c$d$e$f$g$h$i$j$k$l$m$pTmWnQpWR!jn!YYOW^jnt!P!Q!R!S!T!U!V!W!X!Z!_!a!b!f!k#Q#Y#b#m#o$S$pi!tu$b$c$d$e$f$g$h$i$j$k$l!ukRXl!c!e!n!p!r!u!v!w!x!y!z!{!|!}#O#U#V#W#[#^#i#n#t#v#w#x#y#z#{#|#}$O$P$Q$Y$Z$[$oQ!fjR#o#Y!YZOW^jnt!P!Q!R!S!T!U!V!W!X!Z!_!a!b!f!k#Q#Y#b#m#o$S$pi$nu$b$c$d$e$f$g$h$i$j$k$lQ!ZZR$k$n!Q!PXl!e!n!v!w!x!y!z!{!|!}#U#V#W#[#^#i#n#t$Y$Z$[$oe$b!r#v#x#y#z#{#|#}$O$P!O!QXl!e!n!w!x!y!z!{!|!}#U#V#W#[#^#i#n#t$Y$Z$[$oc$c!r#v#y#z#{#|#}$O$P|!RXl!e!n!x!y!z!{!|!}#U#V#W#[#^#i#n#t$Y$Z$[$oa$d!r#v#z#{#|#}$O$Pz!SXl!e!n!y!z!{!|!}#U#V#W#[#^#i#n#t$Y$Z$[$o_$e!r#v#{#|#}$O$Pv!TXl!e!n!z!|!}#U#V#W#[#^#i#n#t$Y$Z$[$oZ$f!r#v#|$O$Pt!UXl!e!n!|!}#U#V#W#[#^#i#n#t$Y$Z$[$oX$g!r#v$O$Px!VXl!e!n!y!z!|!}#U#V#W#[#^#i#n#t$Y$Z$[$o]$h!r#v#{#|$O$Pr!WXl!e!n!}#U#V#W#[#^#i#n#t$Y$Z$[$oV$i!r#v$Pp!XXl!e!n#U#V#W#[#^#i#n#t$Y$Z$[$oT$j!r#vQ^OR![^S#h#P#SS$U#h$VR$V#iQnWR!inU#Z!e!f!hS#q#Z#rR#r#[Q#c!nQ#e!rT#u#c#eSXO^SlWnQ!ejQ!ntQ!ruQ!u!PQ!v!QQ!w!RQ!x!SQ!y!TQ!z!UQ!{!VQ!|!WQ!}!XQ#O!ZQ#U!_Q#V!aQ#W!bQ#[!fQ#^!kQ#i#QQ#n#YQ#t#bQ#v$lQ#w$bQ#x$cQ#y$dQ#z$eQ#{$fQ#|$gQ#}$hQ$O$iQ$P$jQ$Q$kQ$Y#mQ$Z#oQ$[$SR$o$p!s]OW^jntu!P!Q!R!S!T!U!V!W!X!Z!_!a!b!f!k#Q#Y#b#m#o$S$b$c$d$e$f$g$h$i$j$k$l$p!sUOW^jntu!P!Q!R!S!T!U!V!W!X!Z!_!a!b!f!k#Q#Y#b#m#o$S$b$c$d$e$f$g$h$i$j$k$l$p!sQOW^jntu!P!Q!R!S!T!U!V!W!X!Z!_!a!b!f!k#Q#Y#b#m#o$S$b$c$d$e$f$g$h$i$j$k$l$pR#R!]R!gjQ!otR!su",nodeNames:"\u26A0 Comment Script Identifier Integer True TRUE T False FALSE F Numeric String Complex Null NULL NA NA Inf Inf NaN NaN FunctionDeclaration function ParamList ... NamedArg Block BlockOpenBrace ReturnStatement return BreakStatement break NextStatement next BlockCloseBrace FunctionCall ArgList NamedArg IfStatement if else RepeatStatement repeat WhileStatement while ForStatement for in IndexStatement VariableAssignment Assignable AssignmentOperator BinaryStatement NamespaceOp ExtractionOp ArithOp ArithOp ArithOp CompareOp MatrixOp LogicOp LogicOp",maxTerm:116,nodeProps:[["group",-11,3,22,27,36,39,42,44,46,49,50,53,"Expression",-4,4,11,12,13,"Constant Expression",-2,5,8,"Constant Expression Logical",-4,14,16,18,20,"Expression SpecialConstant"]],propSources:[R1],skippedNodes:[0,1],repeatNodeCount:5,tokenData:"6[~RzX^#upq#uqr$jrs$ust%itu%tuv%yvw'twx(Rxy(pyz(uz{(z{|)P|})U}!O)Z!O!P)p!P!Q.b!Q!R.g!R![0^![!]2x!^!_3]!_!`4O!`!a4]!b!c4h!c!}*|!}#O4m#P#Q4z#Q#R5X#R#S*|#S#T5^#T#o*|#o#p5s#p#q5x#q#r6V#y#z#u$f$g#u#BY#BZ#u$IS$I_#u$I|$JO#u$JT$JU#u$KV$KW#u&FU&FV#u~#zY!h~X^#upq#u#y#z#u$f$g#u#BY#BZ#u$IS$I_#u$I|$JO#u$JT$JU#u$KV$KW#u&FU&FV#u~$mP!_!`$p~$uO#]~~$zU[~OY$uZr$urs%^s#O$u#O#P%c#P~$u~%cO[~~%fPO~$u~%nQP~OY%iZ~%i~%yO#S~~%|Uuv&`z{&e!P!Q&p#]#^&{#c#d'^#l#m'i~&eO#X~~&hPuv&k~&pO#b~~&sPuv&v~&{O#a~~'OP#b#c'R~'UPuv'X~'^O#`~~'aPuv'd~'iO#c~~'lPuv'o~'tO#d~~'yP#g~vw'|~(RO#h~~(WU[~OY(RZw(Rwx%^x#O(R#O#P(j#P~(R~(mPO~(R~(uO!p~~(zO!o~~)PO#V~~)UO#Y~~)ZO!s~~)`P#Z~!`!a)c~)hP!}~!`!a)k~)pO#P~~)uTR~!O!P*U!Q![+b!c!}*|#R#S*|#T#o*|~*ZZR~O!O*|!O!P*|!P!Q*|!Q![*|![!c*|!c!}*|!}#R*|#R#S*|#S#T*|#T#o*|#o~*|~+RTR~!O!P*|!Q![*|!c!}*|#R#S*|#T#o*|~+iZZ~R~!O!P*|!Q![+b!c!g*|!g!h,[!h!}*|#R#S*|#T#X*|#X#Y,[#Y#]*|#]#^-z#^#o*|~,aVR~{|,v}!O,v!O!P*|!Q![-^!c!}*|#R#S*|#T#o*|~,yP!Q![,|~-RQZ~!Q![,|#]#^-X~-^O]~~-eVZ~R~!O!P*|!Q![-^!c!}*|#R#S*|#T#]*|#]#^-z#^#o*|~.RT]~R~!O!P*|!Q![*|!c!}*|#R#S*|#T#o*|~.gO#W~~.lWZ~!O!P/U!Q![0^!g!h0u!n!o0X!z!{1g#X#Y0u#]#^-X#l#m1g~/ZTZ~!Q![/j!g!h/{!n!o0X#X#Y/{#]#^-X~/oSZ~!Q![/j!g!h/{#X#Y/{#]#^-X~0OR{|,v}!O,v!Q![,|~0^OS~~0cUZ~!O!P/U!Q![0^!g!h0u!n!o0X#X#Y0u#]#^-X~0xR{|1R}!O1R!Q![1X~1UP!Q![1X~1^RZ~!Q![1X!n!o0X#]#^-X~1jU!O!P1|!Q![2`!c!i2`!r!s/{#T#Z2`#d#e/{~2PT!Q![1|!c!i1|!r!s/{#T#Z1|#d#e/{~2cV!O!P1|!Q![2`!c!i2`!n!o0X!r!s/{#T#Z2`#d#e/{~2{P![!]3O~3TP#Q~![!]3W~3]O#R~~3`R}!O3i!^!_3n!_!`3y~3nO!|~~3qP}!O3t~3yO#O~~4OO#_~~4TP!r~!_!`4W~4]O#[~~4`P!_!`4c~4hO#^~~4mO#T~~4rP!w~!}#O4u~4zO!z~R5PP!yP#P#Q5SQ5XO!{Q~5^O#U~~5aQO#S5g#T~5g~5jRO#S5g#S#T%^#T~5g~5xO!u~~5}P#e~#p#q6Q~6VO#f~~6[O!t~",tokenizers:[0,1],topRules:{Script:[0,2]},specialized:[{term:3,get:i=>E1[i]||-1}],tokenPrec:0});var A1=1,Xg=194,Wg=195,Q1=196,Vg=197,M1=198,_1=199,D1=200,$1=2,Ig=3,Lg=201,V1=24,L1=25,q1=49,B1=50,X1=55,W1=56,I1=57,N1=59,j1=60,z1=61,U1=62,F1=63,H1=65,G1=238,Y1=71,Z1=241,J1=242,K1=243,ek=244,tk=245,ik=246,nk=247,rk=248,Ng=72,sk=249,ok=250,ak=251,lk=252,hk=253,ck=254,fk=255,uk=256,dk=73,pk=77,mk=263,gk=112,Ok=130,yk=151,bk=152,wk=155,Li=10,jr=13,Yc=32,sa=9,Zc=35,vk=40,xk=46,Gc=123,qg=125,jg=39,zg=34,kk=92,Sk=111,Tk=120,Pk=78,Ck=117,Rk=85,Ek=new Set([L1,q1,B1,mk,H1,Ok,W1,I1,G1,U1,F1,Ng,dk,pk,j1,z1,yk,bk,wk,gk]);function Fc(i){return i==Li||i==jr}function Hc(i){return i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102}var Ak=new Vi((i,e)=>{let t;if(i.next<0)i.acceptToken(_1);else if(e.context.flags&na)Fc(i.next)&&i.acceptToken(M1,1);else if(((t=i.peek(-1))<0||Fc(t))&&e.canShift(Vg)){let n=0;for(;i.next==Yc||i.next==sa;)i.advance(),n++;(i.next==Li||i.next==jr||i.next==Zc)&&i.acceptToken(Vg,-n)}else Fc(i.next)&&i.acceptToken(Q1,1)},{contextual:!0}),Qk=new Vi((i,e)=>{let t=e.context;if(t.flags)return;let n=i.peek(-1);if(n==Li||n==jr){let r=0,s=0;for(;;){if(i.next==Yc)r++;else if(i.next==sa)r+=8-r%8;else break;i.advance(),s++}r!=t.indent&&i.next!=Li&&i.next!=jr&&i.next!=Zc&&(r[i,e|Ug])),Dk=new ta({start:Mk,reduce(i,e,t,n){return i.flags&na&&Ek.has(e)||(e==Y1||e==Ng)&&i.flags&Ug?i.parent:i},shift(i,e,t,n){return e==Xg?new ra(i,_k(n.read(n.pos,t.pos)),0):e==Wg?i.parent:e==V1||e==X1||e==N1||e==Ig?new ra(i,0,na):Bg.has(e)?new ra(i,0,Bg.get(e)|i.flags&na):i},hash(i){return i.hash}}),$k=new Vi(i=>{for(let e=0;e<5;e++){if(i.next!="print".charCodeAt(e))return;i.advance()}if(!/\w/.test(String.fromCharCode(i.next)))for(let e=0;;e++){let t=i.peek(e);if(!(t==Yc||t==sa)){t!=vk&&t!=xk&&t!=Li&&t!=jr&&t!=Zc&&i.acceptToken(A1);return}}}),Vk=new Vi((i,e)=>{let{flags:t}=e.context,n=t&Xt?zg:jg,r=(t&Wt)>0,s=!(t&It),o=(t&Nt)>0,a=i.pos;for(;!(i.next<0);)if(o&&i.next==Gc)if(i.peek(1)==Gc)i.advance(2);else{if(i.pos==a){i.acceptToken(Ig,1);return}break}else if(s&&i.next==kk){if(i.pos==a){i.advance();let l=i.next;l>=0&&(i.advance(),Lk(i,l)),i.acceptToken($1);return}break}else if(i.next==n&&(!r||i.peek(1)==n&&i.peek(2)==n)){if(i.pos==a){i.acceptToken(Lg,r?3:1);return}break}else if(i.next==Li){if(r)i.advance();else if(i.pos==a){i.acceptToken(Lg);return}break}else i.advance();i.pos>a&&i.acceptToken(D1)});function Lk(i,e){if(e==Sk)for(let t=0;t<2&&i.next>=48&&i.next<=55;t++)i.advance();else if(e==Tk)for(let t=0;t<2&&Hc(i.next);t++)i.advance();else if(e==Ck)for(let t=0;t<4&&Hc(i.next);t++)i.advance();else if(e==Rk)for(let t=0;t<8&&Hc(i.next);t++)i.advance();else if(e==Pk&&i.next==Gc){for(i.advance();i.next>=0&&i.next!=qg&&i.next!=jg&&i.next!=zg&&i.next!=Li;)i.advance();i.next==qg&&i.advance()}}var qk=fn({'async "*" "**" FormatConversion FormatSpec':b.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":b.controlKeyword,"in not and or is del":b.operatorKeyword,"from def class global nonlocal lambda":b.definitionKeyword,import:b.moduleKeyword,"with as print":b.keyword,Boolean:b.bool,None:b.null,VariableName:b.variableName,"CallExpression/VariableName":b.function(b.variableName),"FunctionDefinition/VariableName":b.function(b.definition(b.variableName)),"ClassDefinition/VariableName":b.definition(b.className),PropertyName:b.propertyName,"CallExpression/MemberExpression/PropertyName":b.function(b.propertyName),Comment:b.lineComment,Number:b.number,String:b.string,FormatString:b.special(b.string),Escape:b.escape,UpdateOp:b.updateOperator,"ArithOp!":b.arithmeticOperator,BitOp:b.bitwiseOperator,CompareOp:b.compareOperator,AssignOp:b.definitionOperator,Ellipsis:b.punctuation,At:b.meta,"( )":b.paren,"[ ]":b.squareBracket,"{ }":b.brace,".":b.derefOperator,", ;":b.separator}),Bk={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},oa=Sn.deserialize({version:14,states:"##jO`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5QQdO'#DoOOQS,5:Y,5:YO5eQdO'#HdOOQS,5:],5:]O5rQ!fO,5:]O5wQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8gQdO,59bO8lQdO,59bO8sQdO,59jO8zQdO'#HTO:QQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:iQdO,59aO'vQdO,59aO:wQdO,59aOOQS,59y,59yO:|QdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;[QdO,5:QO;aQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;rQdO,5:UO;wQdO,5:WOOOW'#Fy'#FyO;|OWO,5:aOOQS,5:a,5:aOOOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!/RQtO1G.|O!/YQtO1G.|O1lQdO1G.|O!/uQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!/|QdO1G/eO!0^QdO1G/eO!0fQdO1G/fO'vQdO'#H[O!0kQdO'#H[O!0pQtO1G.{O!1QQdO,59iO!2WQdO,5=zO!2hQdO,5=zO!2pQdO1G/mO!2uQtO1G/mOOQS1G/l1G/lO!3VQdO,5=uO!3|QdO,5=uO0rQdO1G/qO!4kQdO1G/sO!4pQtO1G/sO!5QQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!5bQdO'#HxO0rQdO'#HxO!5sQdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!6RQ#xO1G2zO!6rQtO1G2zO'vQdO,5kOOQS1G1`1G1`O!7xQdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!7}QdO'#FrO!8YQdO,59oO!8bQdO1G/XO!8lQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!9]QdO'#GtOOQS,5jO!;QQdO,5>jO1XQdO,5>jO!;cQdO,5>iOOQS-E:R-E:RO!;hQdO1G0lO!;sQdO1G0lO!;xQdO,5>lO!lO!hO!<|QdO,5>hO!=_QdO'#EpO0rQdO1G0tO!=jQdO1G0tO!=oQgO1G0zO!AmQgO1G0}O!EhQdO,5>oO!ErQdO,5>oO!EzQtO,5>oO0rQdO1G1PO!FUQdO1G1PO4iQdO1G1UO!!sQdO1G1WOOQV,5;a,5;aO!FZQfO,5;aO!F`QgO1G1QO!JaQdO'#GZO4iQdO1G1QO4iQdO1G1QO!JqQdO,5>pO!KOQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!KWQdO'#FSO!KiQ!fO1G1WO!KqQdO1G1WOOQV1G1]1G1]O4iQdO1G1]O!KvQdO1G1]O!LOQdO'#F^OOQV1G1b1G1bO!#WQtO1G1bPOOO1G2v1G2vP!LTOSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!LYQdO,5=|O!LmQdO,5=|OOQS1G/u1G/uO!LuQdO,5>PO!MVQdO,5>PO!M_QdO,5>PO!MrQdO,5>PO!NSQdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!8bQdO7+$pO# uQdO1G.|O# |QdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO#!TQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO#!eQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO#!jQdO7+%PO#!rQdO7+%QO#!wQdO1G3fOOQS7+%X7+%XO##XQdO1G3fO##aQdO7+%XOOQS,5<_,5<_O'vQdO,5<_O##fQdO1G3aOOQS-E9q-E9qO#$]QdO7+%]OOQS7+%_7+%_O#$kQdO1G3aO#%YQdO7+%_O#%_QdO1G3gO#%oQdO1G3gO#%wQdO7+%]O#%|QdO,5>dO#&gQdO,5>dO#&gQdO,5>dOOQS'#Dx'#DxO#&xO&jO'#DzO#'TO`O'#HyOOOW1G3}1G3}O#'YQdO1G3}O#'bQdO1G3}O#'mQ#xO7+(fO#(^QtO1G2UP#(wQdO'#GOOOQS,5bQdO,5gQdO1G4OOOQS-E9y-E9yO#?QQdO1G4OOe,5>eOOOW7+)i7+)iO#?nQdO7+)iO#?vQdO1G2zO#@aQdO1G2zP'vQdO'#FuO0rQdO<mO#AtQdO,5>mOOQS1G0v1G0vOOQS<rO#KZQdO,5>rOOQS,5>r,5>rO#KfQdO,5>qO#KwQdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<VAN>VO$ WQdO<cAN>cO0rQdO1G1|O$ hQtO1G1|P$ rQdO'#FvOOQS1G2R1G2RP$!PQdO'#F{O$!^QdO7+)jO$!wQdO,5>gOOOO-E9z-E9zOOOW<tO$4dQdO,5>tO1XQdO,5vO$)VQdO,5>vOOQS1G1p1G1pO$8[QtO,5<[OOQU7+'P7+'PO$+cQdO1G/iO$)VQdO,5wO$8jQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$)VQdO'#GdO$8rQdO1G4bO$8|QdO1G4bO$9UQdO1G4bOOQS7+%T7+%TO$9dQdO1G1tO$9rQtO'#FaO$9yQdO,5<}OOQS,5<},5<}O$:XQdO1G4cOOQS-E:a-E:aO$)VQdO,5<|O$:`QdO,5<|O$:eQdO7+)|OOQS-E:`-E:`O$:oQdO7+)|O$)VQdO,5m>pPP'Z'ZPP?PPP'Z'ZPP'Z'Z'Z'Z'Z?T?}'ZP@QP@WD_G{HPPHSH^Hb'ZPPPHeHn'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPHtIQIYPIaIgPIaPIaIaPPPIaPKuPLOLYL`KuPIaLiPIaPLpLvPLzM`M}NhLzLzNnN{LzLzLzLz! a! g! j! o! r! |!!S!!`!!r!!x!#S!#Y!#v!#|!$S!$^!$d!$j!$|!%W!%^!%d!%n!%t!%z!&Q!&W!&^!&h!&n!&x!'O!'X!'_!'n!'v!(Q!(XPPPPPPPPPPP!(_!(b!(h!(q!({!)WPPPPPPPPPPPP!-z!/`!3`!6pPP!6x!7X!7b!8Z!8Q!8d!8j!8m!8p!8s!8{!9lPPPPPPPPPPPPPPPPP!9o!9s!9yP!:_!:c!:o!:x!;U!;l!;o!;r!;x!_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To+PZS_&n`OY*xYZ%TZ]*x]^%T^#o*x#o#p+r#p#q*x#q#r+r#r;'S*x;'S;=`,^<%lO*x_+wTS_OY+rZ]+r^;'S+r;'S;=`,W<%lO+r_,ZP;=`<%l+ro,aP;=`<%l*xj,kV%rQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-XT!xY&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-oV%lQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.]V&n`&ZZOw%Twx.rx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.wV&n`Ow%Twx/^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/eT&n`&]ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/{ThZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc0cTgR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk0yXVZ&n`Oz%Tz{1f{!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk1mVaR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk2ZV%oZ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc2wTzR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To3_W%pZ&n`O!_%T!_!`-Q!`!a3w!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Td4OT&{S&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk4fX!fQ&n`O!O%T!O!P5R!P!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5WV&n`O!O%T!O!P5m!P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5tT!rZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti6[a!hX&n`O!Q%T!Q![6T![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S6T#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti7fZ&n`O{%T{|8X|}%T}!O8X!O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8^V&n`O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8z]!hX&n`O!Q%T!Q![8s![!l%T!l!m9s!m#R%T#R#S8s#S#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti9zT!hX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk:bX%qR&n`O!P%T!P!Q:}!Q!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj;UV%sQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti;ro!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!d%T!d!e?q!e!g%T!g!h7a!h!l%T!l!m9s!m!q%T!q!rA]!r!z%T!z!{Bq!{#R%T#R#S>_#S#U%T#U#V?q#V#X%T#X#Y7a#Y#^%T#^#_9s#_#c%T#c#dA]#d#l%T#l#mBq#m#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti=xV&n`O!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti>fc!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S>_#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti?vY&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti@mY!hX&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiAbX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBUX!hX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBv]&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiCv]!hX&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToDvV{_&n`O!_%T!_!`E]!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TcEdT%{R&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkEzT#gZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkFbXmR&n`O!^%T!^!_F}!_!`([!`!a([!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjGUV%mQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkGrV%zZ&n`O!_%T!_!`([!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkH`WmR&n`O!_%T!_!`([!`!aHx!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjIPV%nQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkIoV_Q#}P&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToJ_]&n`&YS%uZO!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoKZP;=`<%lJUoKge&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!tJU!t!uLx!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#gLx#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoMRa&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUkN_V&n`&`ZOr%TrsNts#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkNyV&n`Or%Trs! `s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! gT&n`&bZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! }V&n`&_ZOw%Twx!!dx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!!iV&n`Ow%Twx!#Ox#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!#VT&n`&aZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!#oe&n`&YS%uZOr%Trs!%Qsw%Twx!&px!Q%T!Q![JU![!c%T!c!tJU!t!u!(`!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#g!(`#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!%XV&n`&dZOr%Trs!%ns#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!%sV&n`Or%Trs!&Ys#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&aT&n`&fZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&wV&n`&cZOw%Twx!'^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!'cV&n`Ow%Twx!'xx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!(PT&n`&eZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!(ia&n`&YS%uZOr%Trs!)nsw%Twx!+^x!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!)uV&n`&hZOr%Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[$k,Qk,Ak,Vk,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:i=>Bk[i]||-1}],tokenPrec:7652});var zr=xr([{tag:b.keyword,class:"tok-keyword"},{tag:b.operator,class:"tok-operator"},{tag:b.definitionOperator,class:"tok-definitionOperator"},{tag:b.compareOperator,class:"tok-compareOperator"},{tag:b.attributeName,class:"tok-attributeName"},{tag:b.controlKeyword,class:"tok-controlKeyword"},{tag:b.comment,class:"tok-comment"},{tag:b.string,class:"tok-string"},{tag:b.regexp,class:"tok-string2"},{tag:b.variableName,class:"tok-variableName"},{tag:b.bool,class:"tok-bool"},{tag:b.separator,class:"tok-separator"},{tag:b.literal,class:"tok-literal"},{tag:[b.number,b.integer],class:"tok-number"},{tag:b.function(b.variableName),class:"tok-function-variableName"},{tag:b.function(b.attributeName),class:"tok-function-attributeName"}]);function Tn(i){let e=document.createElement("code");e.className="sourceCode r";function t(r,s){let o=document.createTextNode(r);if(s){let a=document.createElement("span");a.appendChild(o),a.className=s,o=a}e.appendChild(o)}function n(){e.appendChild(document.createTextNode(` +`))}return Lh(i,ia.parse(i),zr,t,n),e}function Pn(i){let e=document.createElement("code");e.className="sourceCode python";function t(r,s){let o=document.createTextNode(r);if(s){let a=document.createElement("span");a.appendChild(o),a.className=s,o=a}e.appendChild(o)}function n(){e.appendChild(document.createTextNode(` +`))}return Lh(i,oa.parse(i),zr,t,n),e}function Jc(i,e,t,n){if(typeof t=="number"&&(t=t.toLocaleString()),i.textContent.includes(e)){let r=!1;for(let s of i.children)r||=Jc(s,e,t,n);if(!r)switch(i.textContent=i.textContent.replaceAll(e,()=>t),n){case"none":break;case"r":i.innerHTML=Tn(i.textContent).innerHTML;break;case"python":i.innerHTML=Pn(i.textContent).innerHTML;break;default:throw new Error(`Can't highlight interpolation, unknown language \`${n}\`.`)}return!0}return!1}var Fg=new go,Zg=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function aa(i){return(e,t,n)=>{if(n)return!1;let r=e.node.getChild("VariableName");return r&&t(r,i),!0}}var Xk={FunctionDefinition:aa("function"),ClassDefinition:aa("class"),ForStatement(i,e,t){if(t){for(let n=i.node.firstChild;n;n=n.nextSibling)if(n.name=="VariableName")e(n,"variable");else if(n.name=="in")break}},ImportStatement(i,e){var t,n;let{node:r}=i,s=((t=r.firstChild)===null||t===void 0?void 0:t.name)=="from";for(let o=r.getChild("import");o;o=o.nextSibling)o.name=="VariableName"&&((n=o.nextSibling)===null||n===void 0?void 0:n.name)!="as"&&e(o,s?"variable":"namespace")},AssignStatement(i,e){for(let t=i.node.firstChild;t;t=t.nextSibling)if(t.name=="VariableName")e(t,"variable");else if(t.name==":"||t.name=="AssignOp")break},ParamList(i,e){for(let t=null,n=i.node.firstChild;n;n=n.nextSibling)n.name=="VariableName"&&(!t||!/\*|AssignOp/.test(t.name))&&e(n,"variable"),t=n},CapturePattern:aa("variable"),AsPattern:aa("variable"),__proto__:null};function Jg(i,e){let t=Fg.get(e);if(t)return t;let n=[],r=!0;function s(o,a){let l=i.sliceString(o.from,o.to);n.push({label:l,type:a})}return e.cursor(oe.IncludeAnonymous).iterate(o=>{if(o.name){let a=Xk[o.name];if(a&&a(o,s,r)||!r&&Zg.has(o.name))return!1;r=!1}else if(o.to-o.from>8192){for(let a of Jg(i,o.node))n.push(a);return!1}}),Fg.set(e,n),n}var Hg=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,Kg=["String","FormatString","Comment","PropertyName"];function Wk(i){let e=he(i.state).resolveInner(i.pos,-1);if(Kg.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&Hg.test(i.state.sliceDoc(e.from,e.to));if(!t&&!i.explicit)return null;let n=[];for(let r=e;r;r=r.parent)Zg.has(r.name)&&(n=n.concat(Jg(i.state.doc,r)));return{options:n,from:t?e.from:i.pos,validFor:Hg}}var Ik=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(i=>({label:i,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(i=>({label:i,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(i=>({label:i,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(i=>({label:i,type:"function"}))),Nk=[Rt("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),Rt("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),Rt("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),Rt("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),Rt(`if \${}: + +`,{label:"if",detail:"block",type:"keyword"}),Rt("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),Rt("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),Rt("import ${module}",{label:"import",detail:"statement",type:"keyword"}),Rt("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],jk=fg(Kg,Cc(Ik.concat(Nk)));function Gg(i){let{node:e,pos:t}=i,n=i.lineIndent(t,-1),r=null;for(;;){let s=e.childBefore(t);if(s)if(s.name=="Comment")t=s.from;else if(s.name=="Body")i.baseIndentFor(s)+i.unit<=n&&(r=s),e=s;else if(s.type.is("Statement"))e=s;else break;else break}return r}function Yg(i,e){let t=i.baseIndentFor(e),n=i.lineAt(i.pos,-1),r=n.from+n.text.length;return/^\s*($|#)/.test(n.text)&&i.node.tot?null:t+i.unit}var Kc=dn.define({name:"python",parser:oa.configure({props:[Cr.add({Body:i=>{var e;let t=Gg(i);return(e=Yg(i,t||i.node))!==null&&e!==void 0?e:i.continue()},IfStatement:i=>/^\s*(else:|elif )/.test(i.textAfter)?i.baseIndent:i.continue(),"ForStatement WhileStatement":i=>/^\s*else:/.test(i.textAfter)?i.baseIndent:i.continue(),TryStatement:i=>/^\s*(except |finally:|else:)/.test(i.textAfter)?i.baseIndent:i.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":Mi({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":Mi({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":Mi({closing:"]"}),"String FormatString":()=>null,Script:i=>{var e;let t=Gg(i);return(e=t&&Yg(i,t))!==null&&e!==void 0?e:i.continue()}}),Rr.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":To,Body:(i,e)=>({from:i.from+1,to:i.to-(i.to==e.doc.length?0:1)})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:)$/}});function eO(){return new pn(Kc,[Kc.data.of({autocomplete:Wk}),Kc.data.of({autocomplete:jk})])}var zk=dn.define({parser:ia.configure({props:[Cr.add({Block:Mi({closing:"}"}),"ParamList ArgList":Mi({closing:")"})}),Rr.add({Block:To})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"']},commentTokens:{line:"#"}}});function tO(){return new pn(zk)}var Yk={"arrow-repeat":iO(),"exclamation-circle":nO(),lightbulb:rO(),play:sO()};function Zk(){let i=document.querySelectorAll(".tab-content > .tab-pane");Array.from(i).forEach(t=>{t.innerHTML.trim()==""&&(t.classList.add("d-none"),document.querySelector(`.nav-item > a[data-bs-target="#${t.id}"]`)?.parentElement?.classList.add("d-none"))});let e=document.querySelectorAll(".tab-content");Array.from(e).forEach(t=>{if(Array.from(t.children).reduce((r,s)=>s.classList.contains("d-none")?r:r+1,0)==1){let r=t.querySelector(".tab-pane:not(.d-none)"),s=t.parentElement;s.appendChild(r),s.querySelector(".nav.nav-tabs").remove(),t.remove()}})}var la=class{constructor(e,t){if(typeof e!="string")throw new Error("Can't create editor, `code` must be a string.");this.container=document.createElement("div"),this.initialCode=e,this.options=Object.assign({autorun:!1,completion:!0,runbutton:!0,startover:!0,persist:!1},t),this.storageKey=`editor-${window.location.href}#${this.options.id}`;let n=[Eg,this.languageExtensions(),E.updateListener.of(a=>this.onViewUpdate(a))];if(this.options.persist){let a=window.localStorage.getItem(this.storageKey);a&&(e=a)}this.state=N.create({doc:e,extensions:n}),this.view=new E({state:this.state});let r=this.render(),s=String(t["min-lines"]||0),o=String(t["max-lines"])||"infinity";r.style.setProperty("--exercise-min-lines",s),r.style.setProperty("--exercise-max-lines",o),this.container.oninput=a=>this.onInput(a),this.container.appendChild(r),this.container.value={code:this.options.autorun?e:null,options:this.options},this.container.value.indicator=this.indicator=new Ke({runningCallback:()=>{Array.from(this.container.getElementsByClassName("exercise-editor-eval-indicator")).forEach(a=>a.classList.remove("d-none"))},finishedCallback:()=>{Array.from(this.container.getElementsByClassName("exercise-editor-eval-indicator")).forEach(a=>a.classList.add("d-none"))},busyCallback:()=>{Array.from(this.container.getElementsByClassName("exercise-editor-btn-run-code")).forEach(a=>a.classList.add("disabled"))},idleCallback:()=>{Array.from(this.container.getElementsByClassName("exercise-editor-btn-run-code")).forEach(a=>a.classList.remove("disabled"))}})}onInput(e){if(this.options.runbutton&&!e.detail.commit){e.preventDefault(),e.stopImmediatePropagation();return}this.container.value.code=this.view.state.doc.toString(),"code"in e.detail&&(this.container.value.code=e.detail.code),this.options.persist&&window.localStorage.setItem(this.storageKey,this.container.value.code)}onViewUpdate(e){e.docChanged&&this.container.dispatchEvent(new CustomEvent("input",{detail:{commit:!1}}))}renderButton(e){let t=document.createElement("a"),n=document.createElement("span");return t.className=`d-flex align-items-center gap-1 btn btn-exercise-editor ${e.className} text-nowrap`,t.setAttribute("role","button"),t.setAttribute("aria-label",e.text),n.className="btn-label-exercise-editor",n.innerText=e.text,t.innerHTML=Yk[e.icon],t.appendChild(n),t.onclick=e.onclick||null,t.onkeydown=e.onclick||null,t}renderButtonGroup(e){let t=document.createElement("div");return t.className="btn-group btn-group-exercise-editor btn-group-sm",e.forEach(n=>t.appendChild(n)),t}renderSpinner(){let e=document.createElement("div");return e.className="exercise-editor-eval-indicator spinner-grow spinner-grow-sm",e.setAttribute("role","status"),e}renderHintButton(e,t){return Array.from(e).reduceRight((n,r,s,o)=>this.renderButton({text:s===0?"Show Hint":"Next Hint",icon:"lightbulb",className:"btn-outline-dark btn-sm",onclick:function(){s>0&&o[s-1].classList.add("d-none"),r.classList.remove("d-none"),n?this.replaceWith(n):this.remove()}}),t)}renderSolutionButton(e,t){return this.renderButton({text:"Show Solution",icon:"exclamation-circle",className:"btn-exercise-solution btn-outline-dark btn-sm",onclick:function(){t&&t.forEach(n=>n.classList.add("d-none")),Array.from(e).forEach(n=>{n.classList.remove("d-none")}),this.remove()}})}renderHintsTabset(e,t){let n=new Set;e.forEach(s=>{let o=s.parentElement;o.id.includes("tabset-")&&n.add(o)});let r=new Set;return t.forEach(s=>{let o=s.parentElement;o.id.includes("tabset-")&&r.add(o)}),n.forEach(s=>{let o=document.createElement("div");o.className="d-flex justify-content-between exercise-tab-pane-header";let a=s.querySelectorAll(`.exercise-hint[data-exercise="${this.options.exercise}"]`);o.appendChild(this.renderHintButton(a,null)),s.prepend(o)}),r.forEach(s=>{let o=document.createElement("div");o.className="d-flex justify-content-between exercise-tab-pane-header";let a=s.querySelectorAll(`.exercise-solution[data-exercise="${this.options.exercise}"]`);o.appendChild(this.renderSolutionButton(a,null)),s.prepend(o)}),null}renderHints(){let e=document.querySelectorAll(`.d-none.exercise-hint[data-exercise="${this.options.exercise}"]`),t=document.querySelectorAll(`.d-none.exercise-solution[data-exercise="${this.options.exercise}"]`),n=Array.from(e).some(s=>s.parentElement.id.includes("tabset-"))||Array.from(t).some(s=>s.parentElement.id.includes("tabset-")),r=null;if(n)this.renderHintsTabset(e,t);else{let s;t.length>0&&(s=this.renderSolutionButton(t,e)),r=this.renderHintButton(e,s)}return Zk(),r}render(){let e=document.createElement("div"),t=document.createElement("div"),n=document.createElement("div");e.className="card exercise-editor my-3",t.className="card-header exercise-editor-header d-flex justify-content-between",n.className="card-body exercise-editor-body p-0";let r=document.createElement("div");r.className="d-flex align-items-center gap-3";let s=document.createElement("div");s.innerHTML="caption"in this.options?this.options.caption:this.defaultCaption,r.appendChild(s);let o=[];this.options.startover&&o.push(this.renderButton({text:"Start Over",icon:"arrow-repeat",className:"btn-outline-dark",onclick:()=>{if(this.view.dispatch({changes:{from:0,to:this.view.state.doc.length,insert:this.initialCode}}),this.options.runbutton){let c=this.options.autorun?this.initialCode:null;this.container.dispatchEvent(new CustomEvent("input",{detail:{code:c,commit:!0}}))}}}));let a=this.renderHints();a&&o.push(a),o.length>0&&r.appendChild(this.renderButtonGroup(o)),t.appendChild(r);let l=document.createElement("div");l.className="d-flex align-items-center gap-3";let h=[];return this.options.runbutton&&h.push(this.renderButton({text:"Run Code",icon:"play",className:"btn-primary disabled exercise-editor-btn-run-code",onclick:()=>{this.container.dispatchEvent(new CustomEvent("input",{detail:{commit:!0}}))}})),l.appendChild(this.renderSpinner()),h.length>0&&l.appendChild(this.renderButtonGroup(h)),t.appendChild(l),e.appendChild(t),n.appendChild(this.view.dom),e.appendChild(n),e}},ha=class extends la{constructor(e,t,n){super(t,n),this.webRPromise=e,this.completionMethods=this.setupCompletion()}languageExtensions(){let e=new Dt,t=new Dt;return[Ar(zr),Xr({override:[(...n)=>this.doCompletion(...n)]}),e.of(tO()),t.of(N.tabSize.of(2)),Qe.high(qt.of([{key:"Mod-Enter",run:()=>(this.container.dispatchEvent(new CustomEvent("input",{detail:{commit:!0}})),!0)},{key:"Mod-Shift-m",run:()=>(this.view.dispatch({changes:{from:0,to:this.view.state.doc.length,insert:this.view.state.doc.toString().trimEnd()+" |> "}}),!0)}]))]}render(){return this.defaultCaption="R Code",super.render()}async setupCompletion(){let e=await this.webRPromise;return await e.evalRVoid("rc.settings(func=TRUE, fuzzy=TRUE)"),{assignLineBuffer:await e.evalR("utils:::.assignLinebuffer"),assignToken:await e.evalR("utils:::.assignToken"),assignStart:await e.evalR("utils:::.assignStart"),assignEnd:await e.evalR("utils:::.assignEnd"),completeToken:await e.evalR("utils:::.completeToken"),retrieveCompletions:await e.evalR("utils:::.retrieveCompletions")}}async doCompletion(e){if(!this.options.completion)return null;let t=await this.completionMethods,n=e.state.doc.lineAt(e.state.selection.main.head).text,{from:r,to:s,text:o}=e.matchBefore(/[a-zA-Z0-9_.:]*/)??{from:0,to:0,text:""};if(r===s&&!e.explicit)return null;await t.assignLineBuffer(n.replace(/\)+$/,"")),await t.assignToken(o),await t.assignStart(r+1),await t.assignEnd(s+1),await t.completeToken();let l=(await t.retrieveCompletions()).values.map(h=>{if(!h)throw new Error("Missing values in completion result.");return{label:h,boost:h.endsWith("=")?10:0}});return{from:r,options:l}}},ca=class extends la{constructor(e,t,n){super(t,n),this.pyodidePromise=e}render(){return this.defaultCaption="Python Code",super.render()}languageExtensions(){let e=new Dt,t=new Dt,n=[Ar(zr),e.of(eO()),t.of(N.tabSize.of(2)),Qe.high(qt.of([{key:"Mod-Enter",run:()=>(this.container.dispatchEvent(new CustomEvent("input",{detail:{commit:!0}})),!0)}]))];return this.options.completion||n.push(Xr({override:[(...r)=>null]})),n}};function Cn(i){for(var e="",t=new Uint8Array(i),n=t.byteLength,r=0;rString.fromCharCode(parseInt(t,16))))}function aO(i){return decodeURIComponent(atob(i).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join(""))}function ef(i){return typeof ImageBitmap<"u"&&i instanceof ImageBitmap}function Ur(i,e,t,...n){return i==null||ef(i)||i instanceof ArrayBuffer||ArrayBuffer.isView(i)?i:e(i)?t(i,...n):Array.isArray(i)?i.map(r=>Ur(r,e,t,...n)):typeof i=="object"?Object.fromEntries(Object.entries(i).map(([r,s])=>[r,Ur(s,e,t,...n)])):i}function fa(i){for(let e of i.getElementsByTagName("script"))if(!e.type||e.type=="text/javascript"||e.type=="module"){let t=document.createElement("script");e.async&&(t.async=e.async),e.crossOrigin&&(t.crossOrigin=e.crossOrigin),e.defer&&(t.defer=e.async),e.integrity&&(t.integrity=e.integrity),e.src&&(t.src=e.src),e.text&&(t.text=e.text),e.type&&(t.type=e.type),e.parentNode.replaceChild(t,e)}}function lO(i){return new Promise(function(e,t){var n=document.createElement("script");n.onload=()=>e(i),n.onerror=()=>t(`Can't load script: "${i}".`),n.async=!0,n.src=i,document.getElementsByTagName("head")[0].appendChild(n)})}function hO(i){let e=i.replace(/\/+/g,"/").split("/"),t=[];for(let n of e)n==="."||n===""||(n===".."?t.pop():t.push(n));return t.join("/")}var cO=[];async function Fr(i){let e=await i.toJs({depth:-1}),t=await Promise.all(e.names.map(async(n,r)=>[n,await e.values[r].toString()]));return Object.fromEntries(t)}async function tf(i,e){let t=await i.toJs({depth:-1});return await Promise.all(t.values.map(async n=>({[e]:await n.toString()})))}async function nf(i){let e=await i.toJs({depth:-1});return await Promise.all(e.values.map(t=>Fr(t)))}async function Jk(i){if(!(await(await i.class()).toArray()).includes("html_dependency"))throw new Error("Can't interpret R object of class `${classes}` as HTML dependency.");let t=await i.get("attachment"),n=await i.get("head"),r=await i.get("meta"),s=await(await i.get("name")).toString(),o=await i.get("package"),a=await i.get("restyle"),l=await i.get("script"),h=await i.get("src"),c=await i.get("stylesheet"),f=await(await i.get("version")).toString(),u={attachment:[],head:Re(n)?void 0:await n.toString(),meta:[],name:s,pkg:Re(o)?void 0:await o.toString(),restyle:Re(a)?void 0:await a.toBoolean(),script:[],src:{},stylesheet:[],version:f};if(Ui(h)?u.src={file:await h.toString()}:ot(h)&&(u.src=await Fr(h)),!Re(r)){let d=await r.toObject();u.meta=await Promise.all(Object.entries(d).map(async([m,p])=>({name:m,content:await p.toString()})))}if(Ui(c))u.stylesheet=(await c.toArray()).map(d=>({href:d}));else if(ot(c)){let d=await c.toJs({depth:-1});d.names?d.names.includes("href")?u.stylesheet=[await Fr(c)]:u.stylesheet=await nf(c):u.stylesheet=await tf(c,"href")}if(Ui(l))u.script=(await l.toArray()).map(d=>({src:d}));else if(ot(l)){let d=await l.toJs({depth:-1});d.names?d.names.includes("src")?u.script=[await Fr(l)]:u.script=await nf(l):u.script=await tf(l,"src")}if(Ui(t))u.attachment=(await t.toArray()).map((d,m)=>({key:(m+1).toString(),href:d}));else if(ot(t)){let d=await t.toJs({depth:-1});d.names?d.names.includes("href")?(u.attachment=[await Fr(t)],u.attachment[0].key="1"):(u.attachment=await nf(t),u.attachment.forEach((m,p)=>{m.key=(p+1).toString()})):(u.attachment=await tf(t,"href"),u.attachment.forEach((m,p)=>{m.key=(p+1).toString()}))}return u}async function rf(i,e){let t=await Jk(e),n=t.pkg?await i.evalRString(`find.package("${t.pkg}")`):"";if(t.name in cO)return!1;if(cO[t.name]=t.version,t.head){let r=document.createElement("div");r.innerHTML=t.head,r.childNodes.forEach(s=>document.head.appendChild(s))}if(t.meta&&t.meta.forEach(async r=>{let s=document.createElement("meta");Object.entries(r).map(([o,a])=>{s.setAttribute(o,a||"")}),document.head.appendChild(s)}),t.stylesheet&&t.stylesheet.forEach(async r=>{let s=document.createElement("link");if(t.src.file){let o=await i.FS.readFile(`${n}/${t.src.file}/${r.href}`);r.href=`data:text/css;base64,${Cn(o)}`}else r.href=`${t.src.href}/${r.href}`;r.rel||(s.rel="stylesheet"),r.type||(s.type="text/css"),Object.entries(r).map(([o,a])=>{s.setAttribute(o,a||"")}),document.head.appendChild(s)}),t.script){let r=t.script.map(async s=>{let o=document.createElement("script");if(t.src.file){let l=await i.FS.readFile(`${n}/${t.src.file}/${s.src}`);s.src=`data:text/javascript;base64,${Cn(l)}`}else s.src=`${t.src.href}/${s.src}`;o.async=!1,Object.entries(s).map(([l,h])=>{l==="async"&&(o.async=h==="true"),o.setAttribute(l,h||"")});let a=new Promise((l,h)=>{o.onload=()=>l(null),o.onerror=c=>h(c)});return document.head.appendChild(o),a});await Promise.allSettled(r)}return!0}var Rn=class{constructor(e,t){this.manager=e;let n=t.options;!n.exercise||n.envir==="global"?(this.labels={prep:n.envir,result:n.envir,grading:n.envir,solution:n.envir,global:"global"},this.discard=!1):(this.labels={prep:`${n.envir}-prep`,result:`${n.envir}-result`,grading:`${n.envir}-grading`,solution:`${n.envir}-solution`,global:"global"},this.discard=n.envir===`exercise-env-${n.exercise}`)}get(e="global"){return this.manager.get(this.labels[e])}bind(e,t,n="global"){return this.manager.bind(e,t,this.labels[n])}create(e,t){return this.manager.create(this.labels[e],this.labels[t],this.discard)}destroy(e){return this.manager.destroy(this.labels[e])}},En=class i{constructor(e){this.env={};this.shelter=new e.Shelter,this.env.global=Promise.resolve().then(()=>e.objs.globalEnv)}static#e;static instance(e){return i.#e||(i.#e=new i(e)),i.#e}async toR(e){if(!e||ee(e))return e;let t=await this.shelter;if(e.constructor===Object)try{return await new t.RObject(e)}catch(n){let r=n;if(!r.message.includes("Can't construct `data.frame`"))throw r;return await new t.RList(Object.fromEntries(await Promise.all(Object.entries(e).map(async([s,o])=>[s,await this.toR(o)]))))}if(e.constructor===Array)try{return await new t.RObject(e)}catch(n){let r=n;if(!r.message.includes("Can't construct `data.frame`"))throw r;return await new t.RList(await Promise.all(e.map(s=>this.toR(s))))}return e}async get(e="global"){let t=await this.shelter;return e in this.env||(this.env[e]=t.evalR("new.env(parent = globalenv())")),await this.env[e]}async bind(e,t,n="global"){let r=await this.get(n);t=await this.toR(t),await r.bind(e,t)}async create(e,t,n=!0){if(e===t||e==="global")return this.get(e);if(e in this.env){if(!n)return this.get(e);await this.destroy(e)}let r=await this.shelter,s=await this.get(t);return this.env[e]=r.evalR("new.env(parent = parent)",{env:{parent:s}}),await this.env[e]}async destroy(e){if(e=="global"||!(e in this.env))return;let t=await this.shelter,n=await this.env[e];try{await t.destroy(n)}catch(r){let s=r;if(!s.message.includes("Can't find object in shelter."))throw s}delete this.env[e]}},An=class i{constructor(e){this.env={};this.pyodide=e,this.env.global=Promise.resolve().then(()=>e.toPy({}))}static#e;static instance(e){return i.#e||(i.#e=new i(e)),i.#e}async get(e="global"){return e in this.env||(this.env[e]=this.pyodide.toPy({})),await this.env[e]}async bind(e,t,n="global"){let r=await this.get(n),s=await this.pyodide.toPy({environment:r,key:e,value:t});await this.pyodide.runPythonAsync("environment[key] = value",{locals:s}),s.destroy()}async create(e,t,n=!0){if(e===t||e==="global")return this.get(e);n&&e in this.env&&await this.destroy(e);let r=await this.get(e),s=await this.get(t),o=await this.pyodide.toPy({target:r,parent:s});return await this.pyodide.runPythonAsync("target.update(parent)",{locals:o}),o.destroy(),await this.env[e]}async destroy(e){if(e=="global"||!(e in this.env))return;await(await this.env[e]).destroy(),delete this.env[e]}};var ua=class{constructor(e,t){this.container=this.newContainer(),this.nullResult={result:null,evaluate_result:null,evaluator:this},this.container.value=this.nullResult,this.webR=e,this.context=t,this.shelter=new e.Shelter,this.envManager=new Rn(En.instance(e),t),this.context.code&&(this.context.code=this.context.code.replace(/\n\n+$/,` +`)),this.options=Object.assign({envir:"global",eval:!0,echo:!1,warning:!0,error:!0,include:!0,output:!0,timelimit:30},t.options)}newContainer(){let e=document.createElement("div");return e.classList.add("cell-output-container"),e.classList.add("cell-output-container-webr"),e}async purge(){(await this.shelter).purge()}getSetupCode(){let e=this.options.exercise,t=document.querySelectorAll(`script[type="exercise-setup-${e}-contents"]`);if(t.length>0)return t.length>1&&console.warn(`Multiple \`setup\` blocks found for exercise "${e}", using the first.`),JSON.parse(atob(t[0].textContent)).code}async process(e){if(!this.options.eval){this.container=this.asSourceHTML(this.context.code),this.container.value=this.nullResult;return}if(this.options.exercise&&this.context.code&&this.context.code.match(/_{6}_*/g)){this.container.value.result=null;return}let t=this.context.indicator;this.context.indicator||(t=new Ke),t.running();try{await Promise.all(Object.entries(e).map(async([l,h])=>{await this.envManager.bind(l,h,"prep")}));let n=this.getSetupCode();await this.evaluate(n,"prep"),await this.envManager.create("result","prep");let r=await this.evaluate(this.context.code,"result");if(!r)this.container.value.result=null;else if(this.options.output==="asis"){let l=await r.toArray(),h=await l[l.length-1].get("value");this.container.innerHTML=await h.toString()}else if(this.container=await this.asHtml(r),!this.options.output){let l=this.container.value;this.container=this.newContainer(),this.container.value=l}let s=await this.envManager.get("result"),a=await(await this.webR.objs.globalEnv.get(".webr_ojs")).toObject({depth:-1});typeof this.options.define=="string"?a[this.options.define]=await s.get(this.options.define):this.options.define&&Object.assign(a,Object.fromEntries(await Promise.all(this.options.define.map(async l=>{let h=await s.get(l);return[l,h]})))),Object.keys(a).forEach(async l=>{let h=await this.asOjs(a[l]);window._ojs.ojsConnector.mainModule._scope.has(l)?window._ojs.ojsConnector.mainModule.redefine(l,()=>h):window._ojs.ojsConnector.define(l)(h)}),await this.webR.evalRVoid("rm(list = ls(.webr_ojs), envir = .webr_ojs)")}finally{this.purge(),t.finished(),this.context.indicator||t.destroy()}}async evaluate(e,t,n=this.options){return e==null?null:(await(await this.shelter).captureR(` + setTimeLimit(elapsed = timelimit) + on.exit(setTimeLimit(elapsed = Inf)) + eval_result <- evaluate::evaluate( + code, + envir = envir, + keep_message = warning, + keep_warning = warning, + stop_on_error = error, + filename = "User code", + output_handler = getOption("webr.evaluate.handler") + ) + knitr:::merge_low_plot(eval_result) + `,{env:{code:e,timelimit:Number(n.timelimit),envir:await this.envManager.get(t),warning:n.warning,error:n.error?0:1}})).result}asSourceHTML(e){let t=document.createElement("div"),n=document.createElement("pre");t.className="sourceCode",n.className="sourceCode r";let r=Tn(e);return n.appendChild(r),t.appendChild(n),t}async asHtml(e,t=this.options){let n=[],r=this.newContainer();r.value=this.nullResult;let s=()=>{if(t.echo&&n.length){let m=document.createElement("div"),p=document.createElement("pre");m.className="sourceCode",p.className="sourceCode r";let g=Tn(n.join(""));p.appendChild(g),m.appendChild(p),r.appendChild(m)}n.length=0},o=m=>{let p=document.createElement("div");p.className="exercise-cell-output cell-output cell-output-webr cell-output-stdout",p.innerHTML=`
${m}
`,t.output&&(s(),r.appendChild(p))},a=m=>{let p=document.createElement("div");p.className="exercise-cell-output cell-output cell-output-webr cell-output-stderr",p.innerHTML=`
${m}
`,t.output&&(s(),r.appendChild(p))},l=m=>{let p=document.createElement("canvas");p.width=m.width,p.height=m.height,p.className="img-fluid figure-img",p.style.width=`${2*m.width/3}px`,p.getContext("bitmaprenderer").transferFromImageBitmap(m);let g=document.createElement("div");g.className="cell-output-display cell-output-webr",g.appendChild(p),t.output&&(s(),r.appendChild(g))},h=async(m,p,g)=>{if(t.output){s();let O=await u.evalR("format(cnd, backtrace = FALSE)",{env:{cnd:m}}),y=await O.names(),v="",x="";if(y&&y.includes("message")){let P=await m.get("message"),C=await m.get("call");x=await gs(C)?` in \`${await C.deparse()}\``:": ",v=`${g}: ${await P.toString()}`}else v=await O.toString();let w=document.createElement("div");w.innerHTML=` +
+
+
+
R ${g}${x}
+
+
+

+          
+
+ `,w.querySelector(".callout-body pre").appendChild(document.createTextNode(v)),r.appendChild(w)}},c=async m=>{if(t.output){let p=await m.toString(),g=await(await m.attrs()).get("knit_meta"),O=document.createElement("div");if(O.className="cell-output cell-output-webr",O.innerHTML=p,fa(O),s(),r.appendChild(O),ot(g)){let y=await g.toArray();for(let v=0;v{if(t.output){let g=document.createElement("div"),O=document.createElement("img");g.className="cell-output-display cell-output-pyodide",O.src=`data:${m};base64, ${p}`,g.appendChild(O),r.appendChild(g)}},u=await this.shelter,d=await e.toArray();for(let m=0;m{try{let o=await this.webR.evalRNumber('72 * getOption("webr.fig.width")'),a=await this.webR.evalRNumber('72 * getOption("webr.fig.height")'),l=[],h=typeof OffscreenCanvas<"u";h||this.webR.evalRVoid(` + while (dev.cur() > 1) dev.off() + options(device = function() { + png(file = "/tmp/.webr-plot.png", width = width, height = height) + }) + `,{env:{width:o,height:a}});let c=await r.capture({withAutoprint:!0,captureGraphics:h?{width:o,height:a}:!1},...s);if(h)l=c.images;else{let f=await this.webR.evalR(` + while (dev.cur() > 1) dev.off() + filename <- "/tmp/.webr-plot.png" + if (file.exists(filename)) { + filesize <- file.info(filename)[["size"]] + readBin(filename, "raw", n = filesize) + } else NULL + `);if(Ja(f)){let u=await f.toTypedArray(),d=document.createElement("img");d.src=`data:image/png;base64, ${Cn(u)}`,l=[d]}}if(l.length){let f=await this.asOjs(l[l.length-1]);return f.value=await this.asOjs(c.result),f}return await this.asOjs(c.result)}finally{this.webR.globalShelter.purge()}};switch(r._payload.obj.type){case"null":return null;case"character":if((await(await r.class()).toArray()).includes("knit_asis")){let o=await r.toString(),a=await(await r.attrs()).get("knit_meta"),l=document.createElement("div");if(l.className="cell-output",l.innerHTML=o,ot(a)){let h=await a.toArray();for(let c=0;c{window.HTMLWidgets.staticRender()},250),l}case"logical":case"double":case"raw":case"integer":return await r.toArray();case"list":{let o=await(await r.attrs()).get("class");if(!Re(o)&&(await o.toArray()).includes("data.frame"))return await r.toD3()}case"environment":case"pairlist":{let s={},o=await r.toJs({depth:-1});for(let a=0;a0)return t.length>1&&console.warn(`Multiple \`setup\` blocks found for exercise "${e}", using the first.`),JSON.parse(atob(t[0].textContent)).code}async process(e){if(!this.options.eval){this.container=this.asSourceHTML(this.context.code),this.container.value=this.nullResult;return}if(this.options.exercise&&this.context.code&&this.context.code.match(/_{6}_*/g)){this.container.value.result=null;return}let t=this.context.indicator;this.context.indicator||(t=new Ke),t.running();try{await Promise.all(Object.entries(e).map(async([a,l])=>{await this.envManager.bind(a,l,"prep")}));let n=this.getSetupCode();await this.evaluate(n,"prep"),await this.envManager.create("result","prep");let r=await this.evaluate(this.context.code,"result");if(!r)this.container.value.result=null;else if(this.options.output==="asis")this.container.innerHTML=await r.stdout;else if(this.container=await this.asHtml(r),!this.options.output){let a=this.container.value;this.container=this.newContainer(),this.container.value=a}let s=await this.envManager.get("result"),o={};typeof this.options.define=="string"?o[this.options.define]=await s.get(this.options.define):this.options.define&&Object.assign(o,Object.fromEntries(await Promise.all(this.options.define.map(async a=>{let l=await s.get(a);return[a,l]})))),Object.keys(o).forEach(async a=>{let l=await this.asOjs(o[a]);window._ojs.ojsConnector.mainModule._scope.has(a)?window._ojs.ojsConnector.mainModule.redefine(a,()=>l):window._ojs.ojsConnector.define(a)(l)})}finally{t.finished(),this.context.indicator||t.destroy()}}async evaluate(e,t,n=this.options){if(e==null)return null;await this.pyodide.loadPackagesFromImports(e);let[r,s,o]=[7,5,100];"fig-width"in this.options&&(r=Number(this.options["fig-width"])),"fig-height"in this.options&&(s=Number(this.options["fig-height"])),"fig-dpi"in this.options&&(o=Number(this.options["fig-dpi"]));let a=await this.pyodide.toPy({code:e,dpi:o,width:r,height:s,environment:await this.envManager.get(t)}),l=await this.pyodide.runPythonAsync(atob(fO()),{locals:a});a.destroy();let h=await l.get("value"),c=await l.get("stdout"),f=await l.get("stderr"),u=await l.get("outputs");return{value:h,stdout:c,stderr:f,outputs:u}}asSourceHTML(e){let t=document.createElement("div"),n=document.createElement("pre");t.className="sourceCode",n.className="sourceCode python";let r=Pn(e);return n.appendChild(r),t.appendChild(n),t}async asOjs(e){return Object.getOwnPropertyNames(e).includes("toJs")?e.toJs():e}async asHtml(e,t=this.options){let n=this.newContainer();if(n.value=this.nullResult,!e)return n;let r=h=>{if(h.width<=1&&h.height<=1)return;let c=document.createElement("canvas");c.width=h.width,c.height=h.height,c.className="img-fluid figure-img",c.style.width=`${2*h.width/3}px`,c.getContext("bitmaprenderer").transferFromImageBitmap(h);let f=document.createElement("div");f.className="cell-output-display cell-output-pyodide",f.appendChild(c),t.output&&n.appendChild(f)},s=h=>{if(t.output){let c=document.createElement("div");c.appendChild(document.createTextNode(h)),c.className="cell-output cell-output-pyodide",c.innerHTML=`
${c.innerHTML}
`,n.appendChild(c)}},o=async h=>{let c=await this.pyodide.runPythonAsync(` + import ipywidgets as widgets + import json + json.dumps(widgets.Widget.get_manager_state()) + `);Qn||(Qn=document.createElement("script"),Qn.type="application/vnd.jupyter.widget-state+json",Qn=document.body.appendChild(Qn),await lO("https://cdn.jsdelivr.net/npm/@jupyter-widgets/html-manager@1.0.11/dist/embed.js")),Qn.innerHTML=c;let f=await this.pyodide.toPy({widget:h}),u=await this.pyodide.runPythonAsync(` + import json + json.dumps(widget) + `,{locals:f});f.destroy();let d=document.createElement("script");d.type="application/vnd.jupyter.widget-view+json",d.innerHTML=u,n.appendChild(d),dispatchEvent(new Event("load"))},a=async h=>{if(t.output){let c=document.createElement("div");c.className="cell-output cell-output-pyodide",c.innerHTML=h,fa(c),n.appendChild(c)}},l=async(h,c)=>{if(t.output){let f=document.createElement("div"),u=document.createElement("img");f.className="cell-output-display cell-output-pyodide",u.src=`data:${h};base64, ${c}`,f.appendChild(u),n.appendChild(f)}};if(t.echo){let h=document.createElement("div"),c=document.createElement("pre");h.className="sourceCode",c.className="sourceCode python";let f=Pn(this.context.code);c.appendChild(f),h.appendChild(c),n.appendChild(h)}if(e.stdout){let h=document.createElement("div");h.className="exercise-cell-output cell-output cell-output-pyodide cell-output-stdout",h.innerHTML="
",h.querySelector("code").textContent=e.stdout,n.appendChild(h)}if(e.stderr){let h=document.createElement("div");h.className="exercise-cell-output cell-output cell-output-pyodide cell-output-stderr",h.innerHTML="
",h.querySelector("code").textContent=e.stderr,n.appendChild(h)}for(let h=0;h0)return t.length>1&&console.warn(`Multiple \`check\` blocks found for exercise "${e}", using the first.`),JSON.parse(atob(t[0].textContent)).code}};var pa=class extends Mn{constructor(e){super(e),this.webR=this.evaluator.webR}async gradeExercise(){let e=this.context.code;if(!e)return null;let t=await this.blankCheck(e);if(!Re(t))return await this.feedbackAsHtmlAlert(t);if(t=await this.parseCheck(e),!Re(t))return await this.feedbackAsHtmlAlert(t);let n=this.context.indicator;this.context.indicator||(n=new Ke),n.running();try{if(t=await this.evaluateExercise(),Re(t))return null;let r=await this.evaluator.asHtml(t,this.options),s=await r.value.result,o=await(await s.class()).toArray();if(o.includes("gradethis_graded")||o.includes("gradethis_feedback"))return await this.feedbackAsHtmlAlert(s);if(ot(s)){let a=await s.get("message"),l=await s.get("correct");if(!Re(a)&&!Re(l))return await this.feedbackAsHtmlAlert(s)}return r}finally{n.finished(),this.context.indicator||n.destroy()}}async parseCheck(e,t){let n=await this.evaluator.shelter;try{return await n.evalR("parse(text = user_code)",{env:{user_code:e}}),this.evaluator.webR.objs.null}catch{return await new n.RList({message:await n.evalR(`htmltools::HTML(" + It looks like this might not be valid R code. + R cannot determine how to turn your text into a complete command. + You may have forgotten to fill in a blank, + to remove an underscore, to include a comma between arguments, + or to close an opening ", ', ( + or { with a matching ", ', + ) or }. + ")`),correct:!1,location:"append",type:"error"})}finally{n.purge()}}async blankCheck(e){let t=await this.evaluator.shelter;return e.match(/_{6}_*/g)?await new t.RList({message:"Please replace ______ with valid code.",correct:!1,location:"append",type:"info"}):this.evaluator.webR.objs.null}async evaluateSolution(){let e=this.evaluator.options.exercise,t=document.querySelectorAll(`.exercise-solution[data-exercise="${e}"] > code.solution-code`);if(t.length>0){t.length>1&&console.warn(`Multiple solutions found for exercise "${e}", using first solution.`);let n=await this.evaluator.shelter;await this.envManager.create("solution","prep");let r=await this.envManager.get("solution"),s=t[0].textContent,o=await n.evalR(s,{env:r});return{envir:r,code:s,result:o}}return null}async evaluateExercise(){await this.envManager.create("grading","result");let e=await this.evaluator.shelter;try{let t=await this.envManager.get("result"),n=this.evaluator.container.value.evaluate_result,r=await this.envManager.get("prep"),s=this.evaluator.container.value.result,o={user_code:this.context.code,stage:"check",engine:"r",label:this.context.options.exercise||this.webR.objs.null,check_code:this.getCheckingAlgorithm()||this.webR.objs.null,envir_result:t,evaluate_result:n,envir_prep:r,last_value:s,solution_code:this.webR.objs.null,solution_code_all:this.webR.objs.null,envir_solution:this.webR.objs.null,solution:this.webR.objs.null},a=await this.evaluateSolution();a&&(o.solution_code=a.code,o.solution_code_all=[a.code],o.envir_solution=a.envir,o.solution=a.result);let l=await new e.RList(o);await this.envManager.bind(".checker_args",l,"grading");let h={...this.options};return h.error=!1,h.output=!0,await this.evaluator.evaluate(`.checker <- getOption('webr.exercise.checker') + environment(.checker) <- environment() + do.call(.checker, .checker_args)`,"grading",h)}finally{e.purge()}}async feedbackAsHtmlAlert(e){let t=await this.evaluator.shelter,n=document.createElement("div"),r=await e.get("type"),s=await e.get("correct");switch(n.classList.add("alert"),n.classList.add("exercise-grade"),await r.toString()){case"success":n.classList.add("alert-success");break;case"info":n.classList.add("alert-info");break;case"warning":n.classList.add("alert-warning");break;case"error":case"danger":n.classList.add("alert-danger");break;default:{let u=await s.toArray();u.length>0&&u[0]?n.classList.add("alert-success"):n.classList.add("alert-danger")}}let o=document.createElement("span");o.className="exercise-feedback";let a=await e.get("message");a=(await t.captureR("knitr::knit_print(grade$message)",{env:{grade:e}})).result;let h=await a.toString(),c=document.createElement("div");c.innerHTML=h,n.append(...c.childNodes);let f=await e.get("error");if(!Re(f)){a=await f.get("message"),h=await a.toString();let u=await f.get("call"),d=await f.get("gradethis_call"),m=document.createElement("p"),p=document.createElement("pre");p.appendChild(document.createTextNode(`Error: ${h}`)),m.appendChild(p),n.appendChild(m);let g=document.createElement("details");p=document.createElement("pre"),p.appendChild(document.createTextNode(await u.toString())),g.appendChild(p),p=document.createElement("pre"),p.appendChild(document.createTextNode(await d.toString())),g.appendChild(p),n.appendChild(g)}return n}};var ma=class extends Mn{constructor(e){super(e),this.pyodide=this.evaluator.pyodide}async gradeExercise(){let e=this.context.code;if(!e)return null;let t=await this.blankCheck(e);if(t)return await this.feedbackAsHtmlAlert(t);if(t=await this.parseCheck(e),t)return await this.feedbackAsHtmlAlert(t);let n=this.context.indicator;this.context.indicator||(n=new Ke),n.running();try{let r=await this.evaluateExercise();if(!r.value)return null;let s=await this.evaluator.asHtml(r,this.options),o=await s.value.result.value,a,l;return await o.type==="dict"&&(a=await o.get("message"),l=await o.get("correct")),a&&l!==void 0?await this.feedbackAsHtmlAlert(o):s}finally{n.finished(),this.context.indicator||n.destroy()}}async parseCheck(e,t){try{return await this.pyodide.runPythonAsync(` + from ast import parse + parse(user_code) + `,{locals:await this.pyodide.toPy({user_code:e})}),null}catch{return await this.pyodide.toPy({message:` + It looks like this might not be valid Python code. + Python cannot determine how to turn your text into a complete command. + Your code may be indented incorrectly, or you may have forgotten to + fill in a blank, to remove an underscore, to include a comma between + arguments, or to close an opening ", ', + ( or { with a matching ", + ', ) or }. + `,correct:!1,location:"append",type:"error"})}}async blankCheck(e){return e.match(/_{6}_*/g)?await this.pyodide.toPy({message:"Please replace ______ with valid code.",correct:!1,location:"append",type:"info"}):null}async evaluateSolution(){let e=this.evaluator.options.exercise,t=document.querySelectorAll(`.exercise-solution[data-exercise="${e}"] > code.solution-code`);if(t.length>0){t.length>1&&console.warn(`Multiple solutions found for exercise "${e}", using first solution.`),await this.envManager.create("solution","prep");let n=await this.envManager.get("solution"),r=t[0].textContent,s=await this.pyodide.runPythonAsync(r,{globals:n});return{envir:n,code:r,result:s}}return null}async evaluateExercise(){await this.envManager.create("grading","result");let e=await this.envManager.get("result"),t=this.evaluator.container.value.evaluate_result,n=await this.envManager.get("prep"),r=this.evaluator.container.value.result.value,s={user_code:this.context.code,stage:"check",engine:"python",label:this.context.options.exercise,check_code:this.getCheckingAlgorithm(),envir_result:e,evaluate_result:t,envir_prep:n,last_value:r,result:r,solution_code:null,solution_code_all:null,envir_solution:null,solution:null},o=await this.evaluateSolution();o&&(s.solution_code=o.code,s.solution_code_all=[o.code],s.envir_solution=o.envir,s.solution=o.result);let a=await this.pyodide.toPy(s);await this.envManager.bind("_checker_env",a,"grading"),a.destroy();let l={...this.options};return l.error=!1,l.output=!0,await this.evaluator.evaluate(` + import pyodide + feedback = None + if (_checker_env["check_code"]): + try: + feedback = pyodide.code.eval_code( + _checker_env["check_code"], + globals = globals(), + locals = _checker_env + ) + except Exception as error: + feedback = { + 'correct': False, + 'message': 'Error while checking \`{}\`: "{}"'.format(_checker_env["label"], error), + 'type': 'error' + } + feedback + `,"grading",l)}async feedbackAsHtmlAlert(e){let t=document.createElement("div"),n=await e.get("type"),r=await e.get("correct"),s=await e.get("message");switch(t.classList.add("alert"),t.classList.add("exercise-grade"),n){case"success":t.classList.add("alert-success");break;case"info":t.classList.add("alert-info");break;case"warning":t.classList.add("alert-warning");break;case"error":case"danger":t.classList.add("alert-danger");break;default:t.classList.add(r?"alert-success":"alert-danger")}let o=document.createElement("span");return o.className="exercise-feedback",o.innerHTML=s,t.appendChild(o),t}};function eS(i){return i&&i[Symbol.toStringTag]=="PyProxy"}function uO(i){return i&&!!i[il]}function tS(i){return i&&typeof i=="object"&&"_comlinkProxy"in i&&"ptr"in i}function iS(i){return i&&i[Symbol.toStringTag]=="Map"}function sf(i){if(uO(i))return!0;if(i==null||i instanceof ArrayBuffer||ArrayBuffer.isView(i))return!1;if(i instanceof Array)return i.some(e=>sf(e));if(typeof i=="object")return Object.entries(i).some(([e,t])=>sf(t))}var dO={},pO={canHandle:eS,serialize(i){let e=self.pyodide._module.PyProxy_getPtr(i);dO[e]=i;let{port1:t,port2:n}=new MessageChannel;return ks(i,t),[[n,e],[n]]},deserialize([i,e]){i.start();let t=Wn(i);return new Proxy(t,{get:(r,s)=>s==="_ptr"?e:r[s]})}},mO={canHandle:sf,serialize(i){return[Ur(i,uO,e=>({_comlinkProxy:!0,ptr:e._ptr})),[]]},deserialize(i){return Ur(i,tS,e=>dO[e.ptr])}},gO={canHandle:ef,serialize(i){if(i.width==0&&i.height==0){let e=new OffscreenCanvas(1,1);e.getContext("2d"),i=e.transferToImageBitmap()}return[i,[i]]},deserialize(i){return i}},OO={canHandle:iS,serialize(i){return[Object.fromEntries(i.entries()),[]]},deserialize(i){return i}};async function oS(i,e){return await i.evalRVoid('options("webr.render.df" = x)',{env:{x:e.render_df||"default"}}),await i.evalRVoid(atob(yO()))}async function aS(i){await i.runPythonAsync(atob(bO()));let e=atob(wO());await i.FS.mkdir("/pyodide"),await i.FS.writeFile("/pyodide/matplotlib_display.py",e)}async function lS(i){let e=new URL("./pyodide-worker.js",import.meta.url),t=new Worker(e,{type:"module"}),r=await Wn(t).init(i);return gi.set("PyProxy",pO),gi.set("Comlink",mO),gi.set("ImageBitmap",gO),gi.set("Map",OO),r}window._exercise_ojs_runtime={PyodideExerciseEditor:ca,PyodideEvaluator:da,PyodideEnvironment:An,PyodideGrader:ma,WebR:Ka,WebRExerciseEditor:ha,WebREvaluator:ua,WebRGrader:pa,WebREnvironment:En,highlightR:Tn,highlightPython:Pn,interpolate:Jc,setupR:oS,setupPython:aS,startPyodideWorker:lS,b64Encode:oO,b64Decode:aO,collapsePath:hO};export{An as PyodideEnvironment,da as PyodideEvaluator,ca as PyodideExerciseEditor,ma as PyodideGrader,Ka as WebR,En as WebREnvironment,ua as WebREvaluator,ha as WebRExerciseEditor,pa as WebRGrader,aO as b64Decode,oO as b64Encode,hO as collapsePath,Pn as highlightPython,Tn as highlightR,Jc as interpolate,aS as setupPython,oS as setupR,lS as startPyodideWorker}; +/*! Bundled license information: + +comlink/dist/esm/comlink.mjs: + (** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: Apache-2.0 + *) +*/ diff --git a/_site/worksheets/_extensions/r-wasm/live/resources/pyodide-worker.js b/_site/worksheets/_extensions/r-wasm/live/resources/pyodide-worker.js new file mode 100644 index 0000000..e5ec99b --- /dev/null +++ b/_site/worksheets/_extensions/r-wasm/live/resources/pyodide-worker.js @@ -0,0 +1,18 @@ +var je=Object.create;var U=Object.defineProperty;var Be=Object.getOwnPropertyDescriptor;var ze=Object.getOwnPropertyNames;var We=Object.getPrototypeOf,Ve=Object.prototype.hasOwnProperty;var x=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var qe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ye=(e,t)=>{for(var r in t)U(e,r,{get:t[r],enumerable:!0})},Ge=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of ze(t))!Ve.call(e,a)&&a!==r&&U(e,a,{get:()=>t[a],enumerable:!(o=Be(t,a))||o.enumerable});return e};var Je=(e,t,r)=>(r=e!=null?je(We(e)):{},Ge(t||!e||!e.__esModule?U(r,"default",{value:e,enumerable:!0}):r,e));var ae=qe(()=>{});var M={};Ye(M,{createEndpoint:()=>R,expose:()=>k,finalizer:()=>T,proxy:()=>I,proxyMarker:()=>B,releaseProxy:()=>ee,transfer:()=>oe,transferHandlers:()=>v,windowEndpoint:()=>nt,wrap:()=>A});var B=Symbol("Comlink.proxy"),R=Symbol("Comlink.endpoint"),ee=Symbol("Comlink.releaseProxy"),T=Symbol("Comlink.finalizer"),C=Symbol("Comlink.thrown"),te=e=>typeof e=="object"&&e!==null||typeof e=="function",Xe={canHandle:e=>te(e)&&e[B],serialize(e){let{port1:t,port2:r}=new MessageChannel;return k(e,t),[r,[r]]},deserialize(e){return e.start(),A(e)}},Ke={canHandle:e=>te(e)&&C in e,serialize({value:e}){let t;return e instanceof Error?t={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:t={isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},v=new Map([["proxy",Xe],["throw",Ke]]);function Qe(e,t){for(let r of e)if(t===r||r==="*"||r instanceof RegExp&&r.test(t))return!0;return!1}function k(e,t=globalThis,r=["*"]){t.addEventListener("message",function o(a){if(!a||!a.data)return;if(!Qe(r,a.origin)){console.warn(`Invalid origin '${a.origin}' for comlink proxy`);return}let{id:i,type:n,path:l}=Object.assign({path:[]},a.data),s=(a.data.argumentList||[]).map(E),u;try{let c=l.slice(0,-1).reduce((p,y)=>p[y],e),f=l.reduce((p,y)=>p[y],e);switch(n){case"GET":u=f;break;case"SET":c[l.slice(-1)[0]]=E(a.data.value),u=!0;break;case"APPLY":u=f.apply(c,s);break;case"CONSTRUCT":{let p=new f(...s);u=I(p)}break;case"ENDPOINT":{let{port1:p,port2:y}=new MessageChannel;k(e,y),u=oe(p,[p])}break;case"RELEASE":u=void 0;break;default:return}}catch(c){u={value:c,[C]:0}}Promise.resolve(u).catch(c=>({value:c,[C]:0})).then(c=>{let[f,p]=N(c);t.postMessage(Object.assign(Object.assign({},f),{id:i}),p),n==="RELEASE"&&(t.removeEventListener("message",o),re(t),T in e&&typeof e[T]=="function"&&e[T]())}).catch(c=>{let[f,p]=N({value:new TypeError("Unserializable return value"),[C]:0});t.postMessage(Object.assign(Object.assign({},f),{id:i}),p)})}),t.start&&t.start()}function Ze(e){return e.constructor.name==="MessagePort"}function re(e){Ze(e)&&e.close()}function A(e,t){return j(e,[],t)}function F(e){if(e)throw new Error("Proxy has been released and is not useable")}function ne(e){return P(e,{type:"RELEASE"}).then(()=>{re(e)})}var L=new WeakMap,_="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{let t=(L.get(e)||0)-1;L.set(e,t),t===0&&ne(e)});function et(e,t){let r=(L.get(t)||0)+1;L.set(t,r),_&&_.register(e,t,e)}function tt(e){_&&_.unregister(e)}function j(e,t=[],r=function(){}){let o=!1,a=new Proxy(r,{get(i,n){if(F(o),n===ee)return()=>{tt(a),ne(e),o=!0};if(n==="then"){if(t.length===0)return{then:()=>a};let l=P(e,{type:"GET",path:t.map(s=>s.toString())}).then(E);return l.then.bind(l)}return j(e,[...t,n])},set(i,n,l){F(o);let[s,u]=N(l);return P(e,{type:"SET",path:[...t,n].map(c=>c.toString()),value:s},u).then(E)},apply(i,n,l){F(o);let s=t[t.length-1];if(s===R)return P(e,{type:"ENDPOINT"}).then(E);if(s==="bind")return j(e,t.slice(0,-1));let[u,c]=Z(l);return P(e,{type:"APPLY",path:t.map(f=>f.toString()),argumentList:u},c).then(E)},construct(i,n){F(o);let[l,s]=Z(n);return P(e,{type:"CONSTRUCT",path:t.map(u=>u.toString()),argumentList:l},s).then(E)}});return et(a,e),a}function rt(e){return Array.prototype.concat.apply([],e)}function Z(e){let t=e.map(N);return[t.map(r=>r[0]),rt(t.map(r=>r[1]))]}var ie=new WeakMap;function oe(e,t){return ie.set(e,t),e}function I(e){return Object.assign(e,{[B]:!0})}function nt(e,t=globalThis,r="*"){return{postMessage:(o,a)=>e.postMessage(o,r,a),addEventListener:t.addEventListener.bind(t),removeEventListener:t.removeEventListener.bind(t)}}function N(e){for(let[t,r]of v)if(r.canHandle(e)){let[o,a]=r.serialize(e);return[{type:"HANDLER",name:t,value:o},a]}return[{type:"RAW",value:e},ie.get(e)||[]]}function E(e){switch(e.type){case"HANDLER":return v.get(e.name).deserialize(e.value);case"RAW":return e.value}}function P(e,t,r){return new Promise(o=>{let a=it();e.addEventListener("message",function i(n){!n.data||!n.data.id||n.data.id!==a||(e.removeEventListener("message",i),o(n.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:a},t),r)})}function it(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}var ot=Object.create,V=Object.defineProperty,at=Object.getOwnPropertyDescriptor,st=Object.getOwnPropertyNames,ct=Object.getPrototypeOf,lt=Object.prototype.hasOwnProperty,d=(e,t)=>V(e,"name",{value:t,configurable:!0}),le=(e=>typeof x<"u"?x:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof x<"u"?x:t)[r]}):e)(function(e){if(typeof x<"u")return x.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')}),ue=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ut=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of st(t))!lt.call(e,a)&&a!==r&&V(e,a,{get:()=>t[a],enumerable:!(o=at(t,a))||o.enumerable});return e},ft=(e,t,r)=>(r=e!=null?ot(ct(e)):{},ut(t||!e||!e.__esModule?V(r,"default",{value:e,enumerable:!0}):r,e)),pt=ue((e,t)=>{(function(r,o){"use strict";typeof define=="function"&&define.amd?define("stackframe",[],o):typeof e=="object"?t.exports=o():r.StackFrame=o()})(e,function(){"use strict";function r(m){return!isNaN(parseFloat(m))&&isFinite(m)}d(r,"_isNumber");function o(m){return m.charAt(0).toUpperCase()+m.substring(1)}d(o,"_capitalize");function a(m){return function(){return this[m]}}d(a,"_getter");var i=["isConstructor","isEval","isNative","isToplevel"],n=["columnNumber","lineNumber"],l=["fileName","functionName","source"],s=["args"],u=["evalOrigin"],c=i.concat(n,l,s,u);function f(m){if(m)for(var g=0;g{(function(r,o){"use strict";typeof define=="function"&&define.amd?define("error-stack-parser",["stackframe"],o):typeof e=="object"?t.exports=o(pt()):r.ErrorStackParser=o(r.StackFrame)})(e,d(function(r){"use strict";var o=/(^|@)\S+:\d+/,a=/^\s*at .*(\S+:\d+|\(native\))/m,i=/^(eval@)?(\[native code])?$/;return{parse:d(function(n){if(typeof n.stacktrace<"u"||typeof n["opera#sourceloc"]<"u")return this.parseOpera(n);if(n.stack&&n.stack.match(a))return this.parseV8OrIE(n);if(n.stack)return this.parseFFOrSafari(n);throw new Error("Cannot parse given Error object")},"ErrorStackParser$$parse"),extractLocation:d(function(n){if(n.indexOf(":")===-1)return[n];var l=/(.+?)(?::(\d+))?(?::(\d+))?$/,s=l.exec(n.replace(/[()]/g,""));return[s[1],s[2]||void 0,s[3]||void 0]},"ErrorStackParser$$extractLocation"),parseV8OrIE:d(function(n){var l=n.stack.split(` +`).filter(function(s){return!!s.match(a)},this);return l.map(function(s){s.indexOf("(eval ")>-1&&(s=s.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var u=s.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),c=u.match(/ (\(.+\)$)/);u=c?u.replace(c[0],""):u;var f=this.extractLocation(c?c[1]:u),p=c&&u||void 0,y=["eval",""].indexOf(f[0])>-1?void 0:f[0];return new r({functionName:p,fileName:y,lineNumber:f[1],columnNumber:f[2],source:s})},this)},"ErrorStackParser$$parseV8OrIE"),parseFFOrSafari:d(function(n){var l=n.stack.split(` +`).filter(function(s){return!s.match(i)},this);return l.map(function(s){if(s.indexOf(" > eval")>-1&&(s=s.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),s.indexOf("@")===-1&&s.indexOf(":")===-1)return new r({functionName:s});var u=/((.*".+"[^@]*)?[^@]*)(?:@)/,c=s.match(u),f=c&&c[1]?c[1]:void 0,p=this.extractLocation(s.replace(u,""));return new r({functionName:f,fileName:p[0],lineNumber:p[1],columnNumber:p[2],source:s})},this)},"ErrorStackParser$$parseFFOrSafari"),parseOpera:d(function(n){return!n.stacktrace||n.message.indexOf(` +`)>-1&&n.message.split(` +`).length>n.stacktrace.split(` +`).length?this.parseOpera9(n):n.stack?this.parseOpera11(n):this.parseOpera10(n)},"ErrorStackParser$$parseOpera"),parseOpera9:d(function(n){for(var l=/Line (\d+).*script (?:in )?(\S+)/i,s=n.message.split(` +`),u=[],c=2,f=s.length;c/,"$2").replace(/\([^)]*\)/g,"")||void 0,y;f.match(/\(([^)]*)\)/)&&(y=f.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var h=y===void 0||y==="[arguments not available]"?void 0:y.split(",");return new r({functionName:p,args:h,fileName:c[0],lineNumber:c[1],columnNumber:c[2],source:s})},this)},"ErrorStackParser$$parseOpera11")}},"ErrorStackParser"))}),dt=ft(mt()),w=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&typeof process.browser>"u",fe=w&&typeof module<"u"&&typeof module.exports<"u"&&typeof le<"u"&&typeof __dirname<"u",yt=w&&!fe,gt=typeof Deno<"u",pe=!w&&!gt,ht=pe&&typeof window=="object"&&typeof document=="object"&&typeof document.createElement=="function"&&typeof sessionStorage=="object"&&typeof importScripts!="function",wt=pe&&typeof importScripts=="function"&&typeof self=="object",Tt=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Chrome")==-1&&navigator.userAgent.indexOf("Safari")>-1,me,z,de,se,q;async function Y(){if(!w||(me=(await import("node:url")).default,se=await import("node:fs"),q=await import("node:fs/promises"),de=(await import("node:vm")).default,z=await import("node:path"),G=z.sep,typeof le<"u"))return;let e=se,t=await import("node:crypto"),r=await Promise.resolve().then(()=>Je(ae(),1)),o=await import("node:child_process"),a={fs:e,crypto:t,ws:r,child_process:o};globalThis.require=function(i){return a[i]}}d(Y,"initNodeModules");function ye(e,t){return z.resolve(t||".",e)}d(ye,"node_resolvePath");function ge(e,t){return t===void 0&&(t=location),new URL(e,t).toString()}d(ge,"browser_resolvePath");var W;w?W=ye:W=ge;var G;w||(G="/");function he(e,t){return e.startsWith("file://")&&(e=e.slice(7)),e.includes("://")?{response:fetch(e)}:{binary:q.readFile(e).then(r=>new Uint8Array(r.buffer,r.byteOffset,r.byteLength))}}d(he,"node_getBinaryResponse");function we(e,t){let r=new URL(e,location);return{response:fetch(r,t?{integrity:t}:{})}}d(we,"browser_getBinaryResponse");var D;w?D=he:D=we;async function ve(e,t){let{response:r,binary:o}=D(e,t);if(o)return o;let a=await r;if(!a.ok)throw new Error(`Failed to load '${e}': request failed.`);return new Uint8Array(await a.arrayBuffer())}d(ve,"loadBinaryFile");var $;if(ht)$=d(async e=>await import(e),"loadScript");else if(wt)$=d(async e=>{try{globalThis.importScripts(e)}catch(t){if(t instanceof TypeError)await import(e);else throw t}},"loadScript");else if(w)$=be;else throw new Error("Cannot determine runtime environment");async function be(e){e.startsWith("file://")&&(e=e.slice(7)),e.includes("://")?de.runInThisContext(await(await fetch(e)).text()):await import(me.pathToFileURL(e).href)}d(be,"nodeLoadScript");async function xe(e){if(w){await Y();let t=await q.readFile(e,{encoding:"utf8"});return JSON.parse(t)}else return await(await fetch(e)).json()}d(xe,"loadLockFile");async function Ee(){if(fe)return __dirname;let e;try{throw new Error}catch(o){e=o}let t=dt.default.parse(e)[0].fileName;if(yt){let o=await import("node:path");return(await import("node:url")).fileURLToPath(o.dirname(t))}let r=t.lastIndexOf(G);if(r===-1)throw new Error("Could not extract indexURL path from pyodide module location");return t.slice(0,r)}d(Ee,"calculateDirname");function ke(e){let t=e.FS,r=e.FS.filesystems.MEMFS,o=e.PATH,a={DIR_MODE:16895,FILE_MODE:33279,mount:function(i){if(!i.opts.fileSystemHandle)throw new Error("opts.fileSystemHandle is required");return r.mount.apply(null,arguments)},syncfs:async(i,n,l)=>{try{let s=a.getLocalSet(i),u=await a.getRemoteSet(i),c=n?u:s,f=n?s:u;await a.reconcile(i,c,f),l(null)}catch(s){l(s)}},getLocalSet:i=>{let n=Object.create(null);function l(c){return c!=="."&&c!==".."}d(l,"isRealDir");function s(c){return f=>o.join2(c,f)}d(s,"toAbsolute");let u=t.readdir(i.mountpoint).filter(l).map(s(i.mountpoint));for(;u.length;){let c=u.pop(),f=t.stat(c);t.isDir(f.mode)&&u.push.apply(u,t.readdir(c).filter(l).map(s(c))),n[c]={timestamp:f.mtime,mode:f.mode}}return{type:"local",entries:n}},getRemoteSet:async i=>{let n=Object.create(null),l=await vt(i.opts.fileSystemHandle);for(let[s,u]of l)s!=="."&&(n[o.join2(i.mountpoint,s)]={timestamp:u.kind==="file"?(await u.getFile()).lastModifiedDate:new Date,mode:u.kind==="file"?a.FILE_MODE:a.DIR_MODE});return{type:"remote",entries:n,handles:l}},loadLocalEntry:i=>{let n=t.lookupPath(i).node,l=t.stat(i);if(t.isDir(l.mode))return{timestamp:l.mtime,mode:l.mode};if(t.isFile(l.mode))return n.contents=r.getFileDataAsTypedArray(n),{timestamp:l.mtime,mode:l.mode,contents:n.contents};throw new Error("node type not supported")},storeLocalEntry:(i,n)=>{if(t.isDir(n.mode))t.mkdirTree(i,n.mode);else if(t.isFile(n.mode))t.writeFile(i,n.contents,{canOwn:!0});else throw new Error("node type not supported");t.chmod(i,n.mode),t.utime(i,n.timestamp,n.timestamp)},removeLocalEntry:i=>{var n=t.stat(i);t.isDir(n.mode)?t.rmdir(i):t.isFile(n.mode)&&t.unlink(i)},loadRemoteEntry:async i=>{if(i.kind==="file"){let n=await i.getFile();return{contents:new Uint8Array(await n.arrayBuffer()),mode:a.FILE_MODE,timestamp:n.lastModifiedDate}}else{if(i.kind==="directory")return{mode:a.DIR_MODE,timestamp:new Date};throw new Error("unknown kind: "+i.kind)}},storeRemoteEntry:async(i,n,l)=>{let s=i.get(o.dirname(n)),u=t.isFile(l.mode)?await s.getFileHandle(o.basename(n),{create:!0}):await s.getDirectoryHandle(o.basename(n),{create:!0});if(u.kind==="file"){let c=await u.createWritable();await c.write(l.contents),await c.close()}i.set(n,u)},removeRemoteEntry:async(i,n)=>{await i.get(o.dirname(n)).removeEntry(o.basename(n)),i.delete(n)},reconcile:async(i,n,l)=>{let s=0,u=[];Object.keys(n.entries).forEach(function(p){let y=n.entries[p],h=l.entries[p];(!h||t.isFile(y.mode)&&y.timestamp.getTime()>h.timestamp.getTime())&&(u.push(p),s++)}),u.sort();let c=[];if(Object.keys(l.entries).forEach(function(p){n.entries[p]||(c.push(p),s++)}),c.sort().reverse(),!s)return;let f=n.type==="remote"?n.handles:l.handles;for(let p of u){let y=o.normalize(p.replace(i.mountpoint,"/")).substring(1);if(l.type==="local"){let h=f.get(y),m=await a.loadRemoteEntry(h);a.storeLocalEntry(p,m)}else{let h=a.loadLocalEntry(p);await a.storeRemoteEntry(f,y,h)}}for(let p of c)if(l.type==="local")a.removeLocalEntry(p);else{let y=o.normalize(p.replace(i.mountpoint,"/")).substring(1);await a.removeRemoteEntry(f,y)}}};e.FS.filesystems.NATIVEFS_ASYNC=a}d(ke,"initializeNativeFS");var vt=d(async e=>{let t=[];async function r(a){for await(let i of a.values())t.push(i),i.kind==="directory"&&await r(i)}d(r,"collect"),await r(e);let o=new Map;o.set(".",e);for(let a of t){let i=(await e.resolve(a)).join("/");o.set(i,a)}return o},"getFsHandles");function Pe(e){let t={noImageDecoding:!0,noAudioDecoding:!0,noWasmDecoding:!1,preRun:Ce(e),quit(r,o){throw t.exited={status:r,toThrow:o},o},print:e.stdout,printErr:e.stderr,arguments:e.args,API:{config:e},locateFile:r=>e.indexURL+r,instantiateWasm:Le(e.indexURL)};return t}d(Pe,"createSettings");function Se(e){return function(t){let r="/";try{t.FS.mkdirTree(e)}catch(o){console.error(`Error occurred while making a home directory '${e}':`),console.error(o),console.error(`Using '${r}' for a home directory instead`),e=r}t.FS.chdir(e)}}d(Se,"createHomeDirectory");function Oe(e){return function(t){Object.assign(t.ENV,e)}}d(Oe,"setEnvironment");function Fe(e){return t=>{for(let r of e)t.FS.mkdirTree(r),t.FS.mount(t.FS.filesystems.NODEFS,{root:r},r)}}d(Fe,"mountLocalDirectories");function Te(e){let t=ve(e);return r=>{let o=r._py_version_major(),a=r._py_version_minor();r.FS.mkdirTree("/lib"),r.FS.mkdirTree(`/lib/python${o}.${a}/site-packages`),r.addRunDependency("install-stdlib"),t.then(i=>{r.FS.writeFile(`/lib/python${o}${a}.zip`,i)}).catch(i=>{console.error("Error occurred while installing the standard library:"),console.error(i)}).finally(()=>{r.removeRunDependency("install-stdlib")})}}d(Te,"installStdlib");function Ce(e){let t;return e.stdLibURL!=null?t=e.stdLibURL:t=e.indexURL+"python_stdlib.zip",[Te(t),Se(e.env.HOME),Oe(e.env),Fe(e._node_mounts),ke]}d(Ce,"getFileSystemInitializationFuncs");function Le(e){let{binary:t,response:r}=D(e+"pyodide.asm.wasm");return function(o,a){return async function(){try{let i;r?i=await WebAssembly.instantiateStreaming(r,o):i=await WebAssembly.instantiate(await t,o);let{instance:n,module:l}=i;typeof WasmOffsetConverter<"u"&&(wasmOffsetConverter=new WasmOffsetConverter(wasmBinary,l)),a(n,l)}catch(i){console.warn("wasm instantiation failed!"),console.warn(i)}}(),{}}}d(Le,"getInstantiateWasmFunc");var ce="0.26.1";async function J(e={}){await Y();let t=e.indexURL||await Ee();t=W(t),t.endsWith("/")||(t+="/"),e.indexURL=t;let r={fullStdLib:!1,jsglobals:globalThis,stdin:globalThis.prompt?globalThis.prompt:void 0,lockFileURL:t+"pyodide-lock.json",args:[],_node_mounts:[],env:{},packageCacheDir:t,packages:[],enableRunUntilComplete:!1},o=Object.assign(r,e);o.env.HOME||(o.env.HOME="/home/pyodide");let a=Pe(o),i=a.API;if(i.lockFilePromise=xe(o.lockFileURL),typeof _createPyodideModule!="function"){let c=`${o.indexURL}pyodide.asm.js`;await $(c)}let n;if(e._loadSnapshot){let c=await e._loadSnapshot;ArrayBuffer.isView(c)?n=c:n=new Uint8Array(c),a.noInitialRun=!0,a.INITIAL_MEMORY=n.length}let l=await _createPyodideModule(a);if(a.exited)throw a.exited.toThrow;if(e.pyproxyToStringRepr&&i.setPyProxyToStringMethod(!0),i.version!==ce)throw new Error(`Pyodide version does not match: '${ce}' <==> '${i.version}'. If you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.`);l.locateFile=c=>{throw new Error("Didn't expect to load any more file_packager files!")};let s;n&&(s=i.restoreSnapshot(n));let u=i.finalizeBootstrap(s);return i.sys.path.insert(0,i.config.env.HOME),u.version.includes("dev")||i.setCdnUrl(`https://cdn.jsdelivr.net/pyodide/v${u.version}/full/`),i._pyodide.set_excepthook(),await i.packageIndexReady,i.initializeStreams(o.stdin,o.stdout,o.stderr),u}d(J,"loadPyodide");function X(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap}function S(e,t,r,...o){return e==null||X(e)||e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e:t(e)?r(e,...o):Array.isArray(e)?e.map(a=>S(a,t,r,...o)):typeof e=="object"?Object.fromEntries(Object.entries(e).map(([a,i])=>[a,S(i,t,r,...o)])):e}function bt(e){return e&&e[Symbol.toStringTag]=="PyProxy"}function _e(e){return e&&!!e[R]}function xt(e){return e&&typeof e=="object"&&"_comlinkProxy"in e&&"ptr"in e}function Et(e){return e&&e[Symbol.toStringTag]=="Map"}function K(e){if(_e(e))return!0;if(e==null||e instanceof ArrayBuffer||ArrayBuffer.isView(e))return!1;if(e instanceof Array)return e.some(t=>K(t));if(typeof e=="object")return Object.entries(e).some(([t,r])=>K(r))}var Ne={},Re={canHandle:bt,serialize(e){let t=self.pyodide._module.PyProxy_getPtr(e);Ne[t]=e;let{port1:r,port2:o}=new MessageChannel;return k(e,r),[[o,t],[o]]},deserialize([e,t]){e.start();let r=A(e);return new Proxy(r,{get:(a,i)=>i==="_ptr"?t:a[i]})}},Ae={canHandle:K,serialize(e){return[S(e,_e,t=>({_comlinkProxy:!0,ptr:t._ptr})),[]]},deserialize(e){return S(e,xt,t=>Ne[t.ptr])}},Ie={canHandle:X,serialize(e){if(e.width==0&&e.height==0){let t=new OffscreenCanvas(1,1);t.getContext("2d"),e=t.transferToImageBitmap()}return[e,[e]]},deserialize(e){return e}},Me={canHandle:Et,serialize(e){return[Object.fromEntries(e.entries()),[]]},deserialize(e){return e}};var kt={mkdir(e){self.pyodide._FS.mkdir(e)},writeFile(e,t){self.pyodide._FS.writeFile(e,t)}};async function Pt(e){return self.pyodide=await J(e),self.pyodide.registerComlink(M),self.pyodide._FS=self.pyodide.FS,self.pyodide.FS=kt,v.set("PyProxy",Re),v.set("Comlink",Ae),v.set("ImageBitmap",Ie),v.set("Map",Me),I(self.pyodide)}k({init:Pt}); +/*! Bundled license information: + +comlink/dist/esm/comlink.mjs: + (** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: Apache-2.0 + *) +*/ diff --git a/_site/worksheets/_extensions/r-wasm/live/resources/tinyyaml.lua b/_site/worksheets/_extensions/r-wasm/live/resources/tinyyaml.lua new file mode 100644 index 0000000..6dd0fd3 --- /dev/null +++ b/_site/worksheets/_extensions/r-wasm/live/resources/tinyyaml.lua @@ -0,0 +1,883 @@ +------------------------------------------------------------------------------- +-- tinyyaml - YAML subset parser +-- https://github.com/api7/lua-tinyyaml +-- +-- MIT License +-- +-- Copyright (c) 2017 peposso +-- +-- Permission is hereby granted, free of charge, to any person obtaining a copy +-- of this software and associated documentation files (the "Software"), to deal +-- in the Software without restriction, including without limitation the rights +-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +-- copies of the Software, and to permit persons to whom the Software is +-- furnished to do so, subject to the following conditions: +-- +-- The above copyright notice and this permission notice shall be included in all +-- copies or substantial portions of the Software. +-- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +-- SOFTWARE. +------------------------------------------------------------------------------- + +local table = table +local string = string +local schar = string.char +local ssub, gsub = string.sub, string.gsub +local sfind, smatch = string.find, string.match +local tinsert, tconcat, tremove = table.insert, table.concat, table.remove +local setmetatable = setmetatable +local pairs = pairs +local rawget = rawget +local type = type +local tonumber = tonumber +local math = math +local getmetatable = getmetatable +local error = error +local end_symbol = "..." +local end_break_symbol = "...\n" + +local UNESCAPES = { + ['0'] = "\x00", z = "\x00", N = "\x85", + a = "\x07", b = "\x08", t = "\x09", + n = "\x0a", v = "\x0b", f = "\x0c", + r = "\x0d", e = "\x1b", ['\\'] = '\\', +}; + +------------------------------------------------------------------------------- +-- utils +local function select(list, pred) + local selected = {} + for i = 0, #list do + local v = list[i] + if v and pred(v, i) then + tinsert(selected, v) + end + end + return selected +end + +local function startswith(haystack, needle) + return ssub(haystack, 1, #needle) == needle +end + +local function ltrim(str) + return smatch(str, "^%s*(.-)$") +end + +local function rtrim(str) + return smatch(str, "^(.-)%s*$") +end + +local function trim(str) + return smatch(str, "^%s*(.-)%s*$") +end + +------------------------------------------------------------------------------- +-- Implementation. +-- +local class = {__meta={}} +function class.__meta.__call(cls, ...) + local self = setmetatable({}, cls) + if cls.__init then + cls.__init(self, ...) + end + return self +end + +function class.def(base, typ, cls) + base = base or class + local mt = {__metatable=base, __index=base} + for k, v in pairs(base.__meta) do mt[k] = v end + cls = setmetatable(cls or {}, mt) + cls.__index = cls + cls.__metatable = cls + cls.__type = typ + cls.__meta = mt + return cls +end + + +local types = { + null = class:def('null'), + map = class:def('map'), + omap = class:def('omap'), + pairs = class:def('pairs'), + set = class:def('set'), + seq = class:def('seq'), + timestamp = class:def('timestamp'), +} + +local Null = types.null +function Null.__tostring() return 'yaml.null' end +function Null.isnull(v) + if v == nil then return true end + if type(v) == 'table' and getmetatable(v) == Null then return true end + return false +end +local null = Null() + +function types.timestamp:__init(y, m, d, h, i, s, f, z) + self.year = tonumber(y) + self.month = tonumber(m) + self.day = tonumber(d) + self.hour = tonumber(h or 0) + self.minute = tonumber(i or 0) + self.second = tonumber(s or 0) + if type(f) == 'string' and sfind(f, '^%d+$') then + self.fraction = tonumber(f) * 10 ^ (3 - #f) + elseif f then + self.fraction = f + else + self.fraction = 0 + end + self.timezone = z +end + +function types.timestamp:__tostring() + return string.format( + '%04d-%02d-%02dT%02d:%02d:%02d.%03d%s', + self.year, self.month, self.day, + self.hour, self.minute, self.second, self.fraction, + self:gettz()) +end + +function types.timestamp:gettz() + if not self.timezone then + return '' + end + if self.timezone == 0 then + return 'Z' + end + local sign = self.timezone > 0 + local z = sign and self.timezone or -self.timezone + local zh = math.floor(z) + local zi = (z - zh) * 60 + return string.format( + '%s%02d:%02d', sign and '+' or '-', zh, zi) +end + + +local function countindent(line) + local _, j = sfind(line, '^%s+') + if not j then + return 0, line + end + return j, ssub(line, j+1) +end + +local Parser = { + timestamps=true,-- parse timestamps as objects instead of strings +} + +function Parser:parsestring(line, stopper) + stopper = stopper or '' + local q = ssub(line, 1, 1) + if q == ' ' or q == '\t' then + return self:parsestring(ssub(line, 2)) + end + if q == "'" then + local i = sfind(line, "'", 2, true) + if not i then + return nil, line + end + -- Unescape repeated single quotes. + while i < #line and ssub(line, i+1, i+1) == "'" do + i = sfind(line, "'", i + 2, true) + if not i then + return nil, line + end + end + return ssub(line, 2, i-1):gsub("''", "'"), ssub(line, i+1) + end + if q == '"' then + local i, buf = 2, '' + while i < #line do + local c = ssub(line, i, i) + if c == '\\' then + local n = ssub(line, i+1, i+1) + if UNESCAPES[n] ~= nil then + buf = buf..UNESCAPES[n] + elseif n == 'x' then + local h = ssub(i+2,i+3) + if sfind(h, '^[0-9a-fA-F]$') then + buf = buf..schar(tonumber(h, 16)) + i = i + 2 + else + buf = buf..'x' + end + else + buf = buf..n + end + i = i + 1 + elseif c == q then + break + else + buf = buf..c + end + i = i + 1 + end + return buf, ssub(line, i+1) + end + if q == '{' or q == '[' then -- flow style + return nil, line + end + if q == '|' or q == '>' then -- block + return nil, line + end + if q == '-' or q == ':' then + if ssub(line, 2, 2) == ' ' or ssub(line, 2, 2) == '\n' or #line == 1 then + return nil, line + end + end + + if line == "*" then + error("did not find expected alphabetic or numeric character") + end + + local buf = '' + while #line > 0 do + local c = ssub(line, 1, 1) + if sfind(stopper, c, 1, true) then + break + elseif c == ':' and (ssub(line, 2, 2) == ' ' or ssub(line, 2, 2) == '\n' or #line == 1) then + break + elseif c == '#' and (ssub(buf, #buf, #buf) == ' ') then + break + else + buf = buf..c + end + line = ssub(line, 2) + end + buf = rtrim(buf) + local val = tonumber(buf) or buf + return val, line +end + +local function isemptyline(line) + return line == '' or sfind(line, '^%s*$') or sfind(line, '^%s*#') +end + +local function equalsline(line, needle) + return startswith(line, needle) and isemptyline(ssub(line, #needle+1)) +end + +local function compactifyemptylines(lines) + -- Appends empty lines as "\n" to the end of the nearest preceding non-empty line + local compactified = {} + local lastline = {} + for i = 1, #lines do + local line = lines[i] + if isemptyline(line) then + if #compactified > 0 and i < #lines then + tinsert(lastline, "\n") + end + else + if #lastline > 0 then + tinsert(compactified, tconcat(lastline, "")) + end + lastline = {line} + end + end + if #lastline > 0 then + tinsert(compactified, tconcat(lastline, "")) + end + return compactified +end + +local function checkdupekey(map, key) + if rawget(map, key) ~= nil then + -- print("found a duplicate key '"..key.."' in line: "..line) + local suffix = 1 + while rawget(map, key..'_'..suffix) do + suffix = suffix + 1 + end + key = key ..'_'..suffix + end + return key +end + + +function Parser:parseflowstyle(line, lines) + local stack = {} + while true do + if #line == 0 then + if #lines == 0 then + break + else + line = tremove(lines, 1) + end + end + local c = ssub(line, 1, 1) + if c == '#' then + line = '' + elseif c == ' ' or c == '\t' or c == '\r' or c == '\n' then + line = ssub(line, 2) + elseif c == '{' or c == '[' then + tinsert(stack, {v={},t=c}) + line = ssub(line, 2) + elseif c == ':' then + local s = tremove(stack) + tinsert(stack, {v=s.v, t=':'}) + line = ssub(line, 2) + elseif c == ',' then + local value = tremove(stack) + if value.t == ':' or value.t == '{' or value.t == '[' then error() end + if stack[#stack].t == ':' then + -- map + local key = tremove(stack) + key.v = checkdupekey(stack[#stack].v, key.v) + stack[#stack].v[key.v] = value.v + elseif stack[#stack].t == '{' then + -- set + stack[#stack].v[value.v] = true + elseif stack[#stack].t == '[' then + -- seq + tinsert(stack[#stack].v, value.v) + end + line = ssub(line, 2) + elseif c == '}' then + if stack[#stack].t == '{' then + if #stack == 1 then break end + stack[#stack].t = '}' + line = ssub(line, 2) + else + line = ','..line + end + elseif c == ']' then + if stack[#stack].t == '[' then + if #stack == 1 then break end + stack[#stack].t = ']' + line = ssub(line, 2) + else + line = ','..line + end + else + local s, rest = self:parsestring(line, ',{}[]') + if not s then + error('invalid flowstyle line: '..line) + end + tinsert(stack, {v=s, t='s'}) + line = rest + end + end + return stack[1].v, line +end + +function Parser:parseblockstylestring(line, lines, indent) + if #lines == 0 then + error("failed to find multi-line scalar content") + end + local s = {} + local firstindent = -1 + local endline = -1 + for i = 1, #lines do + local ln = lines[i] + local idt = countindent(ln) + if idt <= indent then + break + end + if ln == '' then + tinsert(s, '') + else + if firstindent == -1 then + firstindent = idt + elseif idt < firstindent then + break + end + tinsert(s, ssub(ln, firstindent + 1)) + end + endline = i + end + + local striptrailing = true + local sep = '\n' + local newlineatend = true + if line == '|' then + striptrailing = true + sep = '\n' + newlineatend = true + elseif line == '|+' then + striptrailing = false + sep = '\n' + newlineatend = true + elseif line == '|-' then + striptrailing = true + sep = '\n' + newlineatend = false + elseif line == '>' then + striptrailing = true + sep = ' ' + newlineatend = true + elseif line == '>+' then + striptrailing = false + sep = ' ' + newlineatend = true + elseif line == '>-' then + striptrailing = true + sep = ' ' + newlineatend = false + else + error('invalid blockstyle string:'..line) + end + + if #s == 0 then + return "" + end + + local _, eonl = s[#s]:gsub('\n', '\n') + s[#s] = rtrim(s[#s]) + if striptrailing then + eonl = 0 + end + if newlineatend then + eonl = eonl + 1 + end + for i = endline, 1, -1 do + tremove(lines, i) + end + return tconcat(s, sep)..string.rep('\n', eonl) +end + +function Parser:parsetimestamp(line) + local _, p1, y, m, d = sfind(line, '^(%d%d%d%d)%-(%d%d)%-(%d%d)') + if not p1 then + return nil, line + end + if p1 == #line then + return types.timestamp(y, m, d), '' + end + local _, p2, h, i, s = sfind(line, '^[Tt ](%d+):(%d+):(%d+)', p1+1) + if not p2 then + return types.timestamp(y, m, d), ssub(line, p1+1) + end + if p2 == #line then + return types.timestamp(y, m, d, h, i, s), '' + end + local _, p3, f = sfind(line, '^%.(%d+)', p2+1) + if not p3 then + p3 = p2 + f = 0 + end + local zc = ssub(line, p3+1, p3+1) + local _, p4, zs, z = sfind(line, '^ ?([%+%-])(%d+)', p3+1) + if p4 then + z = tonumber(z) + local _, p5, zi = sfind(line, '^:(%d+)', p4+1) + if p5 then + z = z + tonumber(zi) / 60 + end + z = zs == '-' and -tonumber(z) or tonumber(z) + elseif zc == 'Z' then + p4 = p3 + 1 + z = 0 + else + p4 = p3 + z = false + end + return types.timestamp(y, m, d, h, i, s, f, z), ssub(line, p4+1) +end + +function Parser:parsescalar(line, lines, indent) + line = trim(line) + line = gsub(line, '^%s*#.*$', '') -- comment only -> '' + line = gsub(line, '^%s*', '') -- trim head spaces + + if line == '' or line == '~' then + return null + end + + if self.timestamps then + local ts, _ = self:parsetimestamp(line) + if ts then + return ts + end + end + + local s, _ = self:parsestring(line) + -- startswith quote ... string + -- not startswith quote ... maybe string + if s and (startswith(line, '"') or startswith(line, "'")) then + return s + end + + if startswith('!', line) then -- unexpected tagchar + error('unsupported line: '..line) + end + + if equalsline(line, '{}') then + return {} + end + if equalsline(line, '[]') then + return {} + end + + if startswith(line, '{') or startswith(line, '[') then + return self:parseflowstyle(line, lines) + end + + if startswith(line, '|') or startswith(line, '>') then + return self:parseblockstylestring(line, lines, indent) + end + + -- Regular unquoted string + line = gsub(line, '%s*#.*$', '') -- trim tail comment + local v = line + if v == 'null' or v == 'Null' or v == 'NULL'then + return null + elseif v == 'true' or v == 'True' or v == 'TRUE' then + return true + elseif v == 'false' or v == 'False' or v == 'FALSE' then + return false + elseif v == '.inf' or v == '.Inf' or v == '.INF' then + return math.huge + elseif v == '+.inf' or v == '+.Inf' or v == '+.INF' then + return math.huge + elseif v == '-.inf' or v == '-.Inf' or v == '-.INF' then + return -math.huge + elseif v == '.nan' or v == '.NaN' or v == '.NAN' then + return 0 / 0 + elseif sfind(v, '^[%+%-]?[0-9]+$') or sfind(v, '^[%+%-]?[0-9]+%.$')then + return tonumber(v) -- : int + elseif sfind(v, '^[%+%-]?[0-9]+%.[0-9]+$') then + return tonumber(v) + end + return s or v +end + +function Parser:parseseq(line, lines, indent) + local seq = setmetatable({}, types.seq) + if line ~= '' then + error() + end + while #lines > 0 do + -- Check for a new document + line = lines[1] + if startswith(line, '---') then + while #lines > 0 and not startswith(lines, '---') do + tremove(lines, 1) + end + return seq + end + + -- Check the indent level + local level = countindent(line) + if level < indent then + return seq + elseif level > indent then + error("found bad indenting in line: ".. line) + end + + local i, j = sfind(line, '%-%s+') + if not i then + i, j = sfind(line, '%-$') + if not i then + return seq + end + end + local rest = ssub(line, j+1) + + if sfind(rest, '^[^\'\"%s]*:%s*$') or sfind(rest, '^[^\'\"%s]*:%s+.') then + -- Inline nested hash + -- There are two patterns need to match as inline nested hash + -- first one should have no other characters except whitespace after `:` + -- and the second one should have characters besides whitespace after `:` + -- + -- value: + -- - foo: + -- bar: 1 + -- + -- and + -- + -- value: + -- - foo: bar + -- + -- And there is one pattern should not be matched, where there is no space after `:` + -- in below, `foo:bar` should be parsed into a single string + -- + -- value: + -- - foo:bar + local indent2 = j or 0 + lines[1] = string.rep(' ', indent2)..rest + tinsert(seq, self:parsemap('', lines, indent2)) + elseif sfind(rest, '^%-%s+') then + -- Inline nested seq + local indent2 = j or 0 + lines[1] = string.rep(' ', indent2)..rest + tinsert(seq, self:parseseq('', lines, indent2)) + elseif isemptyline(rest) then + tremove(lines, 1) + if #lines == 0 then + tinsert(seq, null) + return seq + end + if sfind(lines[1], '^%s*%-') then + local nextline = lines[1] + local indent2 = countindent(nextline) + if indent2 == indent then + -- Null seqay entry + tinsert(seq, null) + else + tinsert(seq, self:parseseq('', lines, indent2)) + end + else + -- - # comment + -- key: value + local nextline = lines[1] + local indent2 = countindent(nextline) + tinsert(seq, self:parsemap('', lines, indent2)) + end + elseif line == "*" then + error("did not find expected alphabetic or numeric character") + elseif rest then + -- Array entry with a value + local nextline = lines[1] + local indent2 = countindent(nextline) + tremove(lines, 1) + tinsert(seq, self:parsescalar(rest, lines, indent2)) + end + end + return seq +end + +function Parser:parseset(line, lines, indent) + if not isemptyline(line) then + error('not seq line: '..line) + end + local set = setmetatable({}, types.set) + while #lines > 0 do + -- Check for a new document + line = lines[1] + if startswith(line, '---') then + while #lines > 0 and not startswith(lines, '---') do + tremove(lines, 1) + end + return set + end + + -- Check the indent level + local level = countindent(line) + if level < indent then + return set + elseif level > indent then + error("found bad indenting in line: ".. line) + end + + local i, j = sfind(line, '%?%s+') + if not i then + i, j = sfind(line, '%?$') + if not i then + return set + end + end + local rest = ssub(line, j+1) + + if sfind(rest, '^[^\'\"%s]*:') then + -- Inline nested hash + local indent2 = j or 0 + lines[1] = string.rep(' ', indent2)..rest + set[self:parsemap('', lines, indent2)] = true + elseif sfind(rest, '^%s+$') then + tremove(lines, 1) + if #lines == 0 then + tinsert(set, null) + return set + end + if sfind(lines[1], '^%s*%?') then + local indent2 = countindent(lines[1]) + if indent2 == indent then + -- Null array entry + set[null] = true + else + set[self:parseseq('', lines, indent2)] = true + end + end + + elseif rest then + tremove(lines, 1) + set[self:parsescalar(rest, lines)] = true + else + error("failed to classify line: "..line) + end + end + return set +end + +function Parser:parsemap(line, lines, indent) + if not isemptyline(line) then + error('not map line: '..line) + end + local map = setmetatable({}, types.map) + while #lines > 0 do + -- Check for a new document + line = lines[1] + if line == end_symbol or line == end_break_symbol then + for i, _ in ipairs(lines) do + lines[i] = nil + end + return map + end + + if startswith(line, '---') then + while #lines > 0 and not startswith(lines, '---') do + tremove(lines, 1) + end + return map + end + + -- Check the indent level + local level, _ = countindent(line) + if level < indent then + return map + elseif level > indent then + error("found bad indenting in line: ".. line) + end + + -- Find the key + local key + local s, rest = self:parsestring(line) + + -- Quoted keys + if s and startswith(rest, ':') then + local sc = self:parsescalar(s, {}, 0) + if sc and type(sc) ~= 'string' then + key = sc + else + key = s + end + line = ssub(rest, 2) + else + error("failed to classify line: "..line) + end + + key = checkdupekey(map, key) + line = ltrim(line) + + if ssub(line, 1, 1) == '!' then + -- ignore type + local rh = ltrim(ssub(line, 3)) + local typename = smatch(rh, '^!?[^%s]+') + line = ltrim(ssub(rh, #typename+1)) + end + + if not isemptyline(line) then + tremove(lines, 1) + line = ltrim(line) + map[key] = self:parsescalar(line, lines, indent) + else + -- An indent + tremove(lines, 1) + if #lines == 0 then + map[key] = null + return map; + end + if sfind(lines[1], '^%s*%-') then + local indent2 = countindent(lines[1]) + map[key] = self:parseseq('', lines, indent2) + elseif sfind(lines[1], '^%s*%?') then + local indent2 = countindent(lines[1]) + map[key] = self:parseset('', lines, indent2) + else + local indent2 = countindent(lines[1]) + if indent >= indent2 then + -- Null hash entry + map[key] = null + else + map[key] = self:parsemap('', lines, indent2) + end + end + end + end + return map +end + + +-- : (list)->dict +function Parser:parsedocuments(lines) + lines = compactifyemptylines(lines) + + if sfind(lines[1], '^%%YAML') then tremove(lines, 1) end + + local root = {} + local in_document = false + while #lines > 0 do + local line = lines[1] + -- Do we have a document header? + local docright; + if sfind(line, '^%-%-%-') then + -- Handle scalar documents + docright = ssub(line, 4) + tremove(lines, 1) + in_document = true + end + if docright then + if (not sfind(docright, '^%s+$') and + not sfind(docright, '^%s+#')) then + tinsert(root, self:parsescalar(docright, lines)) + end + elseif #lines == 0 or startswith(line, '---') then + -- A naked document + tinsert(root, null) + while #lines > 0 and not sfind(lines[1], '---') do + tremove(lines, 1) + end + in_document = false + -- XXX The final '-+$' is to look for -- which ends up being an + -- error later. + elseif not in_document and #root > 0 then + -- only the first document can be explicit + error('parse error: '..line) + elseif sfind(line, '^%s*%-') then + -- An array at the root + tinsert(root, self:parseseq('', lines, 0)) + elseif sfind(line, '^%s*[^%s]') then + -- A hash at the root + local level = countindent(line) + tinsert(root, self:parsemap('', lines, level)) + else + -- Shouldn't get here. @lines have whitespace-only lines + -- stripped, and previous match is a line with any + -- non-whitespace. So this clause should only be reachable via + -- a perlbug where \s is not symmetric with \S + + -- uncoverable statement + error('parse error: '..line) + end + end + if #root > 1 and Null.isnull(root[1]) then + tremove(root, 1) + return root + end + return root +end + +--- Parse yaml string into table. +function Parser:parse(source) + local lines = {} + for line in string.gmatch(source .. '\n', '(.-)\r?\n') do + tinsert(lines, line) + end + + local docs = self:parsedocuments(lines) + if #docs == 1 then + return docs[1] + end + + return docs +end + +local function parse(source, options) + local options = options or {} + local parser = setmetatable (options, {__index=Parser}) + return parser:parse(source) +end + +return { + version = 0.1, + parse = parse, +} diff --git a/_site/worksheets/_extensions/r-wasm/live/templates/interpolate.ojs b/_site/worksheets/_extensions/r-wasm/live/templates/interpolate.ojs new file mode 100644 index 0000000..6987b7a --- /dev/null +++ b/_site/worksheets/_extensions/r-wasm/live/templates/interpolate.ojs @@ -0,0 +1,16 @@ +{ + const { interpolate } = window._exercise_ojs_runtime; + const block_id = "{{block_id}}"; + const language = "{{language}}"; + const def_map = {{def_map}}; + const elem = document.getElementById(`interpolate-${block_id}`); + + // Store original templated HTML for reference in future reactive updates + if (!elem.origHTML) elem.origHTML = elem.innerHTML; + + // Interpolate reactive OJS variables into established HTML element + elem.innerHTML = elem.origHTML; + Object.keys(def_map).forEach((def) => + interpolate(elem, "${" + def + "}", def_map[def], language) + ); +} diff --git a/_site/worksheets/_extensions/r-wasm/live/templates/pyodide-editor.ojs b/_site/worksheets/_extensions/r-wasm/live/templates/pyodide-editor.ojs new file mode 100644 index 0000000..cf6e36a --- /dev/null +++ b/_site/worksheets/_extensions/r-wasm/live/templates/pyodide-editor.ojs @@ -0,0 +1,16 @@ +viewof _pyodide_editor_{{block_id}} = { + const { PyodideExerciseEditor, b64Decode } = window._exercise_ojs_runtime; + + const scriptContent = document.querySelector(`script[type=\"pyodide-{{block_id}}-contents\"]`).textContent; + const block = JSON.parse(b64Decode(scriptContent)); + + const options = Object.assign({ id: `pyodide-{{block_id}}-contents` }, block.attr); + const editor = new PyodideExerciseEditor( + pyodideOjs.pyodidePromise, + block.code, + options + ); + + return editor.container; +} +_pyodide_value_{{block_id}} = pyodideOjs.process(_pyodide_editor_{{block_id}}, {{block_input}}); diff --git a/_site/worksheets/_extensions/r-wasm/live/templates/pyodide-evaluate.ojs b/_site/worksheets/_extensions/r-wasm/live/templates/pyodide-evaluate.ojs new file mode 100644 index 0000000..5575240 --- /dev/null +++ b/_site/worksheets/_extensions/r-wasm/live/templates/pyodide-evaluate.ojs @@ -0,0 +1,41 @@ +_pyodide_value_{{block_id}} = { + const { highlightPython, b64Decode} = window._exercise_ojs_runtime; + + const scriptContent = document.querySelector(`script[type=\"pyodide-{{block_id}}-contents\"]`).textContent; + const block = JSON.parse(b64Decode(scriptContent)); + + // Default evaluation configuration + const options = Object.assign({ + id: "pyodide-{{block_id}}-contents", + echo: true, + output: true + }, block.attr); + + // Evaluate the provided Python code + const result = pyodideOjs.process({code: block.code, options}, {{block_input}}); + + // Early yield while we wait for the first evaluation and render + if (options.output && !("{{block_id}}" in pyodideOjs.renderedOjs)) { + const container = document.createElement("div"); + const spinner = document.createElement("div"); + + if (options.echo) { + // Show output as highlighted source + const preElem = document.createElement("pre"); + container.className = "sourceCode"; + preElem.className = "sourceCode python"; + preElem.appendChild(highlightPython(block.code)); + spinner.className = "spinner-grow spinner-grow-sm m-2 position-absolute top-0 end-0"; + preElem.appendChild(spinner); + container.appendChild(preElem); + } else { + spinner.className = "spinner-border spinner-border-sm"; + container.appendChild(spinner); + } + + yield container; + } + + pyodideOjs.renderedOjs["{{block_id}}"] = true; + yield await result; +} diff --git a/_site/worksheets/_extensions/r-wasm/live/templates/pyodide-exercise.ojs b/_site/worksheets/_extensions/r-wasm/live/templates/pyodide-exercise.ojs new file mode 100644 index 0000000..9cd450b --- /dev/null +++ b/_site/worksheets/_extensions/r-wasm/live/templates/pyodide-exercise.ojs @@ -0,0 +1,30 @@ +viewof _pyodide_editor_{{block_id}} = { + const { PyodideExerciseEditor, b64Decode } = window._exercise_ojs_runtime; + + const scriptContent = document.querySelector(`script[type=\"pyodide-{{block_id}}-contents\"]`).textContent; + const block = JSON.parse(b64Decode(scriptContent)); + + // Default exercise configuration + const options = Object.assign( + { + id: "pyodide-{{block_id}}-contents", + envir: `exercise-env-${block.attr.exercise}`, + error: false, + caption: 'Exercise', + }, + block.attr + ); + + const editor = new PyodideExerciseEditor(pyodideOjs.pyodidePromise, block.code, options); + return editor.container; +} +viewof _pyodide_value_{{block_id}} = pyodideOjs.process(_pyodide_editor_{{block_id}}, {{block_input}}); +_pyodide_feedback_{{block_id}} = { + const { PyodideGrader } = window._exercise_ojs_runtime; + const emptyFeedback = document.createElement('div'); + + const grader = new PyodideGrader(_pyodide_value_{{block_id}}.evaluator); + const feedback = await grader.gradeExercise(); + if (!feedback) return emptyFeedback; + return feedback; +} diff --git a/_site/worksheets/_extensions/r-wasm/live/templates/pyodide-setup.ojs b/_site/worksheets/_extensions/r-wasm/live/templates/pyodide-setup.ojs new file mode 100644 index 0000000..a99dfb3 --- /dev/null +++ b/_site/worksheets/_extensions/r-wasm/live/templates/pyodide-setup.ojs @@ -0,0 +1,129 @@ +pyodideOjs = { + const { + PyodideEvaluator, + PyodideEnvironmentManager, + setupPython, + startPyodideWorker, + b64Decode, + collapsePath, + } = window._exercise_ojs_runtime; + + const statusContainer = document.getElementById("exercise-loading-status"); + const indicatorContainer = document.getElementById("exercise-loading-indicator"); + indicatorContainer.classList.remove("d-none"); + + let statusText = document.createElement("div") + statusText.classList = "exercise-loading-details"; + statusText = statusContainer.appendChild(statusText); + statusText.textContent = `Initialise`; + + // Hoist indicator out from final slide when running under reveal + const revealStatus = document.querySelector(".reveal .exercise-loading-indicator"); + if (revealStatus) { + revealStatus.remove(); + document.querySelector(".reveal > .slides").appendChild(revealStatus); + } + + // Make any reveal slides with live cells scrollable + document.querySelectorAll(".reveal .exercise-cell").forEach((el) => { + el.closest('section.slide').classList.add("scrollable"); + }) + + // Pyodide supplemental data and options + const dataContent = document.querySelector(`script[type=\"pyodide-data\"]`).textContent; + const data = JSON.parse(b64Decode(dataContent)); + + // Grab list of resources to be downloaded + const filesContent = document.querySelector(`script[type=\"vfs-file\"]`).textContent; + const files = JSON.parse(b64Decode(filesContent)); + + let pyodidePromise = (async () => { + statusText.textContent = `Downloading Pyodide`; + const pyodide = await startPyodideWorker(data.options); + + statusText.textContent = `Downloading package: micropip`; + await pyodide.loadPackage("micropip"); + const micropip = await pyodide.pyimport("micropip"); + await data.packages.pkgs.map((pkg) => () => { + statusText.textContent = `Downloading package: ${pkg}`; + return micropip.install(pkg); + }).reduce((cur, next) => cur.then(next), Promise.resolve()); + await micropip.destroy(); + + // Download and install resources + await files.map((file) => async () => { + const name = file.substring(file.lastIndexOf('/') + 1); + statusText.textContent = `Downloading resource: ${name}`; + const response = await fetch(file); + if (!response.ok) { + throw new Error(`Can't download \`${file}\`. Error ${response.status}: "${response.statusText}".`); + } + const data = await response.arrayBuffer(); + + // Store URLs in the cwd without any subdirectory structure + if (file.includes("://")) { + file = name; + } + + // Collapse higher directory structure + file = collapsePath(file); + + // Create directory tree, ignoring "directory exists" VFS errors + const parts = file.split('/').slice(0, -1); + let path = ''; + while (parts.length > 0) { + path += parts.shift() + '/'; + try { + await pyodide.FS.mkdir(path); + } catch (e) { + if (e.name !== "ErrnoError") throw e; + if (e.errno !== 20) { + const errorTextPtr = await pyodide._module._strerror(e.errno); + const errorText = await pyodide._module.UTF8ToString(errorTextPtr); + throw new Error(`Filesystem Error ${e.errno} "${errorText}".`); + } + } + } + + // Write this file to the VFS + try { + return await pyodide.FS.writeFile(file, new Uint8Array(data)); + } catch (e) { + if (e.name !== "ErrnoError") throw e; + const errorTextPtr = await pyodide._module._strerror(e.errno); + const errorText = await pyodide._module.UTF8ToString(errorTextPtr); + throw new Error(`Filesystem Error ${e.errno} "${errorText}".`); + } + }).reduce((cur, next) => cur.then(next), Promise.resolve()); + + statusText.textContent = `Pyodide environment setup`; + await setupPython(pyodide); + + statusText.remove(); + if (statusContainer.children.length == 0) { + statusContainer.parentNode.remove(); + } + return pyodide; + })().catch((err) => { + statusText.style.color = "var(--exercise-editor-hl-er, #AD0000)"; + statusText.textContent = err.message; + //indicatorContainer.querySelector(".spinner-grow").classList.add("d-none"); + throw err; + }); + + // Keep track of initial OJS block render + const renderedOjs = {}; + + const process = async (context, inputs) => { + const pyodide = await pyodidePromise; + const evaluator = new PyodideEvaluator(pyodide, context); + await evaluator.process(inputs); + return evaluator.container; + } + + return { + pyodidePromise, + renderedOjs, + process, + }; +} diff --git a/_site/worksheets/_extensions/r-wasm/live/templates/webr-editor.ojs b/_site/worksheets/_extensions/r-wasm/live/templates/webr-editor.ojs new file mode 100644 index 0000000..efa6e74 --- /dev/null +++ b/_site/worksheets/_extensions/r-wasm/live/templates/webr-editor.ojs @@ -0,0 +1,11 @@ +viewof _webr_editor_{{block_id}} = { + const { WebRExerciseEditor, b64Decode } = window._exercise_ojs_runtime; + const scriptContent = document.querySelector(`script[type=\"webr-{{block_id}}-contents\"]`).textContent; + const block = JSON.parse(b64Decode(scriptContent)); + + const options = Object.assign({ id: `webr-{{block_id}}-contents` }, block.attr); + const editor = new WebRExerciseEditor(webROjs.webRPromise, block.code, options); + + return editor.container; +} +_webr_value_{{block_id}} = webROjs.process(_webr_editor_{{block_id}}, {{block_input}}); diff --git a/_site/worksheets/_extensions/r-wasm/live/templates/webr-evaluate.ojs b/_site/worksheets/_extensions/r-wasm/live/templates/webr-evaluate.ojs new file mode 100644 index 0000000..614bcfe --- /dev/null +++ b/_site/worksheets/_extensions/r-wasm/live/templates/webr-evaluate.ojs @@ -0,0 +1,40 @@ +_webr_value_{{block_id}} = { + const { highlightR, b64Decode } = window._exercise_ojs_runtime; + const scriptContent = document.querySelector(`script[type=\"webr-{{block_id}}-contents\"]`).textContent; + const block = JSON.parse(b64Decode(scriptContent)); + + // Default evaluation configuration + const options = Object.assign({ + id: "webr-{{block_id}}-contents", + echo: true, + output: true + }, block.attr); + + // Evaluate the provided R code + const result = webROjs.process({code: block.code, options}, {{block_input}}); + + // Early yield while we wait for the first evaluation and render + if (options.output && !("{{block_id}}" in webROjs.renderedOjs)) { + const container = document.createElement("div"); + const spinner = document.createElement("div"); + + if (options.echo) { + // Show output as highlighted source + const preElem = document.createElement("pre"); + container.className = "sourceCode"; + preElem.className = "sourceCode r"; + preElem.appendChild(highlightR(block.code)); + spinner.className = "spinner-grow spinner-grow-sm m-2 position-absolute top-0 end-0"; + preElem.appendChild(spinner); + container.appendChild(preElem); + } else { + spinner.className = "spinner-border spinner-border-sm"; + container.appendChild(spinner); + } + + yield container; + } + + webROjs.renderedOjs["{{block_id}}"] = true; + yield await result; +} diff --git a/_site/worksheets/_extensions/r-wasm/live/templates/webr-exercise.ojs b/_site/worksheets/_extensions/r-wasm/live/templates/webr-exercise.ojs new file mode 100644 index 0000000..3884990 --- /dev/null +++ b/_site/worksheets/_extensions/r-wasm/live/templates/webr-exercise.ojs @@ -0,0 +1,29 @@ +viewof _webr_editor_{{block_id}} = { + const { WebRExerciseEditor, b64Decode } = window._exercise_ojs_runtime; + const scriptContent = document.querySelector(`script[type=\"webr-{{block_id}}-contents\"]`).textContent; + const block = JSON.parse(b64Decode(scriptContent)); + + // Default exercise configuration + const options = Object.assign( + { + id: "webr-{{block_id}}-contents", + envir: `exercise-env-${block.attr.exercise}`, + error: false, + caption: 'Exercise', + }, + block.attr + ); + + const editor = new WebRExerciseEditor(webROjs.webRPromise, block.code, options); + return editor.container; +} +viewof _webr_value_{{block_id}} = webROjs.process(_webr_editor_{{block_id}}, {{block_input}}); +_webr_feedback_{{block_id}} = { + const { WebRGrader } = window._exercise_ojs_runtime; + const emptyFeedback = document.createElement('div'); + + const grader = new WebRGrader(_webr_value_{{block_id}}.evaluator); + const feedback = await grader.gradeExercise(); + if (!feedback) return emptyFeedback; + return feedback; +} diff --git a/_site/worksheets/_extensions/r-wasm/live/templates/webr-setup.ojs b/_site/worksheets/_extensions/r-wasm/live/templates/webr-setup.ojs new file mode 100644 index 0000000..099847a --- /dev/null +++ b/_site/worksheets/_extensions/r-wasm/live/templates/webr-setup.ojs @@ -0,0 +1,127 @@ +webROjs = { + const { WebR, ChannelType } = window._exercise_ojs_runtime.WebR; + const { + WebREvaluator, + WebREnvironmentManager, + setupR, + b64Decode, + collapsePath + } = window._exercise_ojs_runtime; + + const statusContainer = document.getElementById("exercise-loading-status"); + const indicatorContainer = document.getElementById("exercise-loading-indicator"); + indicatorContainer.classList.remove("d-none"); + + let statusText = document.createElement("div") + statusText.classList = "exercise-loading-details"; + statusText = statusContainer.appendChild(statusText); + statusText.textContent = `Initialise`; + + // Hoist indicator out from final slide when running under reveal + const revealStatus = document.querySelector(".reveal .exercise-loading-indicator"); + if (revealStatus) { + revealStatus.remove(); + document.querySelector(".reveal > .slides").appendChild(revealStatus); + } + + // Make any reveal slides with live cells scrollable + document.querySelectorAll(".reveal .exercise-cell").forEach((el) => { + el.closest('section.slide').classList.add("scrollable"); + }) + + // webR supplemental data and options + const dataContent = document.querySelector(`script[type=\"webr-data\"]`).textContent; + const data = JSON.parse(b64Decode(dataContent)); + + // Grab list of resources to be downloaded + const filesContent = document.querySelector(`script[type=\"vfs-file\"]`).textContent; + const files = JSON.parse(b64Decode(filesContent)); + + // Use PostMessage channel for async communication + // We do not expect to take nested prompt input in Quarto Live cells + data.options.channelType = ChannelType.PostMessage; + + // Initialise webR and setup for R code evaluation + let webRPromise = (async (webR) => { + statusText.textContent = `Downloading webR`; + await webR.init(); + + // Install provided list of packages + // Ensure webR default repo is included + data.packages.repos.push("https://repo.r-wasm.org") + await data.packages.pkgs.map((pkg) => () => { + statusText.textContent = `Downloading package: ${pkg}`; + return webR.evalRVoid(` + webr::install(pkg, repos = repos) + library(pkg, character.only = TRUE) + `, { env: { + pkg: pkg, + repos: data.packages.repos, + }}); + }).reduce((cur, next) => cur.then(next), Promise.resolve()); + + // Download and install resources + await files.map((file) => async () => { + const name = file.substring(file.lastIndexOf('/') + 1); + statusText.textContent = `Downloading resource: ${name}`; + const response = await fetch(file); + if (!response.ok) { + throw new Error(`Can't download \`${file}\`. Error ${response.status}: "${response.statusText}".`); + } + const data = await response.arrayBuffer(); + + // Store URLs in the cwd without any subdirectory structure + if (file.includes("://")) { + file = name; + } + + // Collapse higher directory structure + file = collapsePath(file); + + // Create directory tree, ignoring "directory exists" VFS errors + const parts = file.split('/').slice(0, -1); + let path = ''; + while (parts.length > 0) { + path += parts.shift() + '/'; + try { + await webR.FS.mkdir(path); + } catch (e) { + if (!e.message.includes("FS error")) { + throw e; + } + } + } + + // Write this file to the VFS + return await webR.FS.writeFile(file, new Uint8Array(data)); + }).reduce((cur, next) => cur.then(next), Promise.resolve()); + + statusText.textContent = `Installing webR shims`; + await webR.evalRVoid(`webr::shim_install()`); + + statusText.textContent = `WebR environment setup`; + await setupR(webR, data); + + statusText.remove(); + if (statusContainer.children.length == 0) { + statusContainer.parentNode.remove(); + } + return webR; + })(new WebR(data.options)); + + // Keep track of initial OJS block render + const renderedOjs = {}; + + const process = async (context, inputs) => { + const webR = await webRPromise; + const evaluator = new WebREvaluator(webR, context) + await evaluator.process(inputs); + return evaluator.container; + } + + return { + process, + webRPromise, + renderedOjs, + }; +} diff --git a/_site/worksheets/_extensions/r-wasm/live/templates/webr-widget.ojs b/_site/worksheets/_extensions/r-wasm/live/templates/webr-widget.ojs new file mode 100644 index 0000000..b41a3c2 --- /dev/null +++ b/_site/worksheets/_extensions/r-wasm/live/templates/webr-widget.ojs @@ -0,0 +1,10 @@ +{ + // Wait for output to be written to the DOM, then trigger widget rendering + await _webr_value_{{block_id}}; + if (window.HTMLWidgets) { + window.HTMLWidgets.staticRender(); + } + if (window.PagedTableDoc) { + window.PagedTableDoc.initAll(); + } +} diff --git a/_site/worksheets/aesthetic-mappings.html b/_site/worksheets/aesthetic-mappings.html new file mode 100644 index 0000000..82bc8fa --- /dev/null +++ b/_site/worksheets/aesthetic-mappings.html @@ -0,0 +1,1113 @@ + + + + + + + + + + +Aesthetic mappings + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+

Aesthetic mappings

+
+ + + +
+ +
+
Author
+
+

Claus O. Wilke

+
+
+ + + +
+ + + +
+ + +
+

Introduction

+

In this worksheet, we will discuss a core concept of ggplot, the mapping of data values onto aesthetics.

+

First we need to load the required R packages. Please wait a moment until the live R session is fully set up and all packages are loaded.

+
+
+
+ +
+ +
+
+

Next we set up the data.

+
+
+
+ +
+ +
+
+

We will first work with the dataset temps_houston which contains the average temperature for each day of the year for Houston, TX.

+
+
+
+ +
+ +
+
+
+
+

Basic use of ggplot

+

In the most basic use of ggplot, we call the ggplot() function with a dataset and an aesthetic mapping (created with aes()), and then we add a geom, such as geom_line() to draw lines or geom_point() to draw points.

+

Try this for yourself. Map the column day_of_year onto the x axis and the column temperature onto the y axis, and use geom_line() to display the data.

+
+
+
+ +
+ +
+
+
+
+
+
+ +
+
+Solution +
+
+
+
+
+
ggplot(temps_houston, aes(x = day_of_year, y = temperature)) +
+  geom_line()
+
+
+
+
+

Try again. Now use geom_point() instead of geom_line().

+
+
+
+ +
+ +
+
+
+
+
+
+ +
+
+Solution +
+
+
+
+
+
ggplot(temps_houston, aes(x = day_of_year, y = temperature)) +
+  geom_point()
+
+
+
+
+

And now swap which column you map to x and which to y.

+
+
+
+ +
+ +
+
+
+
+
+
+ +
+
+Solution +
+
+
+
+
+
ggplot(temps_houston, aes(x = temperature, y = day_of_year)) +
+  geom_point()
+
+
+
+
+
+
+

More complex geoms

+

You can use other geoms to make different types of plots. For example, geom_boxplot() will make boxplots. For boxplots, we frequently want categorical data on the x or y axis. For example, we might want a separate boxplot for each month. Try this out. Puth month on the x axis, temperature on the y axis, and use geom_boxplot().

+
+
+
+ +
+ +
+
+
+
+
+
+ +
+
+Hint +
+
+
+
+
+
ggplot(temps_houston, aes(x = month, y = temperature)) +
+  ___()
+
+
+
+
+
+
+
+
+ +
+
+Solution +
+
+
+
+
+
ggplot(temps_houston, aes(x = month, y = temperature)) +
+  geom_boxplot()
+
+
+
+
+

Now put the month on the y axis and the temperature on the x axis.

+
+
+
+ +
+ +
+
+
+
+
+
+ +
+
+Hint +
+
+
+
+
+
ggplot(temps_houston, aes(x = ___, y = ___)) +
+  geom_boxplot()
+
+
+
+
+
+
+
+
+ +
+
+Solution +
+
+
+
+
+
ggplot(temps_houston, aes(x = temperature, y = month)) +
+  geom_boxplot()
+
+
+
+
+
+
+

Adding color

+

Next we will be working with the dataset temperatures, which is similar to temps_houston but contains data for three more locations.

+
+
+
+ +
+ +
+
+

Make a line plot of temperature against day_of_year, using the color aesthetic to color the lines by location.

+
+
+
+ +
+ +
+
+
+
+
+
+ +
+
+Hint +
+
+
+
+
+
ggplot(temperatures, aes(x = day_of_year, y = temperature, color = ___)) +
+  geom_line()
+
+
+
+
+
+
+
+
+ +
+
+Solution +
+
+
+
+
+
ggplot(temperatures, aes(x = day_of_year, y = temperature, color = location)) +
+  geom_line()
+
+
+
+
+

Try again, this time using location as the location along the y axis and temperature for the color. This plot looks better with geom_point() than geom_line(). (Try it out to see why. Also, try geom_point(size = 5) to create larger points.)

+
+
+
+ +
+ +
+
+
+
+
+
+ +
+
+Hint +
+
+
+
+
+
ggplot(temperatures, aes(x = ___, y = ___, color = ___)) +
+  geom_point()
+
+
+
+
+
+
+
+
+ +
+
+Solution +
+
+
+
+
+
ggplot(temperatures, aes(x = day_of_year, y = location, color = temperature)) +
+  geom_point()
+
+
+
+
+
+
+

Using the fill aesthetic

+

Some geoms use a fill aesthetic, which is similar to color but applies to shaded areas. (color applies to lines and points.) For example, we can use the fill aesthetic with geom_boxplot() to color the interior of the box. Try this yourself. Plot month on x, temperature on y, and color the interior of the box by location.

+
+
+
+ +
+ +
+
+
+
+
+
+ +
+
+Hint +
+
+
+
+
+
ggplot(temperatures, aes(x = month, y = ___, fill = ___)) +
+  geom_boxplot()
+
+
+
+
+
+
+
+
+ +
+
+Solution +
+
+
+
+
+
ggplot(temperatures, aes(x = month, y = temperature, fill = location)) +
+  geom_boxplot()
+
+
+
+
+

Can you color the lines of the boxplot by location and the interior by month? Try it.

+
+
+
+ +
+ +
+
+
+
+
+
+ +
+
+Hint +
+
+
+
+
+
ggplot(temperatures, aes(x = month, y = temperature, color = ___, fill = ___)) +
+  geom_boxplot()
+
+
+
+
+
+
+
+
+ +
+
+Solution +
+
+
+
+
+
ggplot(temperatures, aes(x = month, y = temperature, color = location, fill = month)) +
+  geom_boxplot()
+
+
+
+
+
+
+

Using aesthetics as parameters

+

Many of the aesthetics (such as color, fill, and also size to change line size or point thickness) can be used as parameters inside a geom rather than inside an aes() statement. The difference is that when you use an aesthetic as a parameter, you specify a specific value, such as color = "blue", rather than a mapping, such as aes(color = location). Notice the difference: Inside the aes() function, we don’t actually specify the specific color values, ggplot does that for us. We only say that we want the data values of the location column to correspond to different colors. (We will learn later how to tell ggplot to use specific colors in this mapping.)

+

Try this with the boxplot example from the previous section. Map location onto the fill aesthetic but set the color of the lines to "navyblue".

+
+
+
+ +
+ +
+
+
+
+
+
+ +
+
+Hint +
+
+
+
+
+
ggplot(temperatures, aes(x = month, y = temperature, fill = ___)) +
+  geom_boxplot(color = ___)
+
+
+
+
+
+
+
+
+ +
+
+Solution +
+
+
+
+
+
ggplot(temperatures, aes(x = month, y = temperature, fill = location)) +
+  geom_boxplot(color = "navyblue")
+
+
+
+
+

Now do the reverse. Map location onto the line colors but fill the box with the color "navyblue".

+
+
+
+ +
+ +
+
+
+
+
+
+ +
+
+Hint +
+
+
+
+
+
ggplot(temperatures, aes(x = month, y = temperature, color = ___)) +
+  geom_boxplot(fill = ___)
+
+
+
+
+
+
+
+
+ +
+
+Solution +
+
+
+
+
+
ggplot(temperatures, aes(x = month, y = temperature, color = location)) +
+  geom_boxplot(fill = "navyblue")
+
+
+
+
+ + +
+
+ +
+
+ +
+
+ +
+ +
+ + + + +
+ + + + + \ No newline at end of file diff --git a/_site/worksheets/aesthetic-mappings.qmd b/_site/worksheets/aesthetic-mappings.qmd index d2c2386..01dfce2 100644 --- a/_site/worksheets/aesthetic-mappings.qmd +++ b/_site/worksheets/aesthetic-mappings.qmd @@ -5,20 +5,26 @@ format: live-html engine: knitr --- -{{< include ../_extensions/r-wasm/live/_knitr.qmd >}} +{{< include ./_extensions/r-wasm/live/_knitr.qmd >}} ## Introduction In this worksheet, we will discuss a core concept of ggplot, the mapping of data values onto aesthetics. -First we need to load the required R packages and the data. Please run this code to ensure the subsequent exercises work. +First we need to load the required R packages. Please wait a moment until the live R session is fully set up and all packages are loaded. ```{webr} #| warning: false -# load required library +#| edit: false library(tidyverse) +library(DT) +``` + +Next we set up the data. -# data prep +```{webr} +#| edit: false +#| warning: false temperatures <- read_csv("https://wilkelab.org/SDS375/datasets/tempnormals.csv") |> mutate( location = factor( @@ -32,7 +38,9 @@ temps_houston <- filter(temperatures, location == "Houston") We will first work with the dataset `temps_houston` which contains the average temperature for each day of the year for Houston, TX. ```{webr} -temps_houston +#| edit: false +#| autorun: true +datatable(temps_houston) ``` ## Basic use of ggplot @@ -148,9 +156,12 @@ ggplot(temps_houston, aes(x = temperature, y = month)) + ## Adding color -Next we will be working with the dataset `temperatures`, which is similar to `temps_houston` but contains data for three more locations: +Next we will be working with the dataset `temperatures`, which is similar to `temps_houston` but contains data for three more locations. + ```{webr} -temperatures +#| edit: false +#| autorun: true +datatable(temperatures) ``` Make a line plot of `temperature` against `day_of_year`, using the `color` aesthetic to color the lines by location. diff --git a/_site/worksheets/aesthetic-mappings_files/libs/bootstrap/bootstrap-icons.css b/_site/worksheets/aesthetic-mappings_files/libs/bootstrap/bootstrap-icons.css new file mode 100644 index 0000000..285e444 --- /dev/null +++ b/_site/worksheets/aesthetic-mappings_files/libs/bootstrap/bootstrap-icons.css @@ -0,0 +1,2078 @@ +/*! + * Bootstrap Icons v1.11.1 (https://icons.getbootstrap.com/) + * Copyright 2019-2023 The Bootstrap Authors + * Licensed under MIT (https://github.com/twbs/icons/blob/main/LICENSE) + */ + +@font-face { + font-display: block; + font-family: "bootstrap-icons"; + src: +url("./bootstrap-icons.woff?2820a3852bdb9a5832199cc61cec4e65") format("woff"); +} + +.bi::before, +[class^="bi-"]::before, +[class*=" bi-"]::before { + display: inline-block; + font-family: bootstrap-icons !important; + font-style: normal; + font-weight: normal !important; + font-variant: normal; + text-transform: none; + line-height: 1; + vertical-align: -.125em; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.bi-123::before { content: "\f67f"; } +.bi-alarm-fill::before { content: "\f101"; } +.bi-alarm::before { content: "\f102"; } +.bi-align-bottom::before { content: "\f103"; } +.bi-align-center::before { content: "\f104"; } +.bi-align-end::before { content: "\f105"; } +.bi-align-middle::before { content: "\f106"; } +.bi-align-start::before { content: "\f107"; } +.bi-align-top::before { content: "\f108"; } +.bi-alt::before { content: "\f109"; } +.bi-app-indicator::before { content: "\f10a"; } +.bi-app::before { content: "\f10b"; } +.bi-archive-fill::before { content: "\f10c"; } +.bi-archive::before { content: "\f10d"; } +.bi-arrow-90deg-down::before { content: "\f10e"; } +.bi-arrow-90deg-left::before { content: "\f10f"; } +.bi-arrow-90deg-right::before { content: "\f110"; } +.bi-arrow-90deg-up::before { content: "\f111"; } +.bi-arrow-bar-down::before { content: "\f112"; } +.bi-arrow-bar-left::before { content: "\f113"; } +.bi-arrow-bar-right::before { content: "\f114"; } +.bi-arrow-bar-up::before { content: "\f115"; } +.bi-arrow-clockwise::before { content: "\f116"; } +.bi-arrow-counterclockwise::before { content: "\f117"; } +.bi-arrow-down-circle-fill::before { content: "\f118"; } +.bi-arrow-down-circle::before { content: "\f119"; } +.bi-arrow-down-left-circle-fill::before { content: "\f11a"; } +.bi-arrow-down-left-circle::before { content: "\f11b"; } +.bi-arrow-down-left-square-fill::before { content: "\f11c"; } +.bi-arrow-down-left-square::before { content: "\f11d"; } +.bi-arrow-down-left::before { content: "\f11e"; } +.bi-arrow-down-right-circle-fill::before { content: "\f11f"; } +.bi-arrow-down-right-circle::before { content: "\f120"; } +.bi-arrow-down-right-square-fill::before { content: "\f121"; } +.bi-arrow-down-right-square::before { content: "\f122"; } +.bi-arrow-down-right::before { content: "\f123"; } +.bi-arrow-down-short::before { content: "\f124"; } +.bi-arrow-down-square-fill::before { content: "\f125"; } +.bi-arrow-down-square::before { content: "\f126"; } +.bi-arrow-down-up::before { content: "\f127"; } +.bi-arrow-down::before { content: "\f128"; } +.bi-arrow-left-circle-fill::before { content: "\f129"; } +.bi-arrow-left-circle::before { content: "\f12a"; } +.bi-arrow-left-right::before { content: "\f12b"; } +.bi-arrow-left-short::before { content: "\f12c"; } +.bi-arrow-left-square-fill::before { content: "\f12d"; } +.bi-arrow-left-square::before { content: "\f12e"; } +.bi-arrow-left::before { content: "\f12f"; } +.bi-arrow-repeat::before { content: "\f130"; } +.bi-arrow-return-left::before { content: "\f131"; } +.bi-arrow-return-right::before { content: "\f132"; } +.bi-arrow-right-circle-fill::before { content: "\f133"; } +.bi-arrow-right-circle::before { content: "\f134"; } +.bi-arrow-right-short::before { content: "\f135"; } +.bi-arrow-right-square-fill::before { content: "\f136"; } +.bi-arrow-right-square::before { content: "\f137"; } +.bi-arrow-right::before { content: "\f138"; } +.bi-arrow-up-circle-fill::before { content: "\f139"; } +.bi-arrow-up-circle::before { content: "\f13a"; } +.bi-arrow-up-left-circle-fill::before { content: "\f13b"; } +.bi-arrow-up-left-circle::before { content: "\f13c"; } +.bi-arrow-up-left-square-fill::before { content: "\f13d"; } +.bi-arrow-up-left-square::before { content: "\f13e"; } +.bi-arrow-up-left::before { content: "\f13f"; } +.bi-arrow-up-right-circle-fill::before { content: "\f140"; } +.bi-arrow-up-right-circle::before { content: "\f141"; } +.bi-arrow-up-right-square-fill::before { content: "\f142"; } +.bi-arrow-up-right-square::before { content: "\f143"; } +.bi-arrow-up-right::before { content: "\f144"; } +.bi-arrow-up-short::before { content: "\f145"; } +.bi-arrow-up-square-fill::before { content: "\f146"; } +.bi-arrow-up-square::before { content: "\f147"; } +.bi-arrow-up::before { content: "\f148"; } +.bi-arrows-angle-contract::before { content: "\f149"; } +.bi-arrows-angle-expand::before { content: "\f14a"; } +.bi-arrows-collapse::before { content: "\f14b"; } +.bi-arrows-expand::before { content: "\f14c"; } +.bi-arrows-fullscreen::before { content: "\f14d"; } +.bi-arrows-move::before { content: "\f14e"; } +.bi-aspect-ratio-fill::before { content: "\f14f"; } +.bi-aspect-ratio::before { content: "\f150"; } +.bi-asterisk::before { content: "\f151"; } +.bi-at::before { content: "\f152"; } +.bi-award-fill::before { content: "\f153"; } +.bi-award::before { content: "\f154"; } +.bi-back::before { content: "\f155"; } +.bi-backspace-fill::before { content: "\f156"; } +.bi-backspace-reverse-fill::before { content: "\f157"; } +.bi-backspace-reverse::before { content: "\f158"; } +.bi-backspace::before { content: "\f159"; } +.bi-badge-3d-fill::before { content: "\f15a"; } +.bi-badge-3d::before { content: "\f15b"; } +.bi-badge-4k-fill::before { content: "\f15c"; } +.bi-badge-4k::before { content: "\f15d"; } +.bi-badge-8k-fill::before { content: "\f15e"; } +.bi-badge-8k::before { content: "\f15f"; } +.bi-badge-ad-fill::before { content: "\f160"; } +.bi-badge-ad::before { content: "\f161"; } +.bi-badge-ar-fill::before { content: "\f162"; } +.bi-badge-ar::before { content: "\f163"; } +.bi-badge-cc-fill::before { content: "\f164"; } +.bi-badge-cc::before { content: "\f165"; } +.bi-badge-hd-fill::before { content: "\f166"; } +.bi-badge-hd::before { content: "\f167"; } +.bi-badge-tm-fill::before { content: "\f168"; } +.bi-badge-tm::before { content: "\f169"; } +.bi-badge-vo-fill::before { content: "\f16a"; } +.bi-badge-vo::before { content: "\f16b"; } +.bi-badge-vr-fill::before { content: "\f16c"; } +.bi-badge-vr::before { content: "\f16d"; } +.bi-badge-wc-fill::before { content: "\f16e"; } +.bi-badge-wc::before { content: "\f16f"; } +.bi-bag-check-fill::before { content: "\f170"; } +.bi-bag-check::before { content: "\f171"; } +.bi-bag-dash-fill::before { content: "\f172"; } +.bi-bag-dash::before { content: "\f173"; } +.bi-bag-fill::before { content: "\f174"; } +.bi-bag-plus-fill::before { content: "\f175"; } +.bi-bag-plus::before { content: "\f176"; } +.bi-bag-x-fill::before { content: "\f177"; } +.bi-bag-x::before { content: "\f178"; } +.bi-bag::before { content: "\f179"; } +.bi-bar-chart-fill::before { content: "\f17a"; } +.bi-bar-chart-line-fill::before { content: "\f17b"; } +.bi-bar-chart-line::before { content: "\f17c"; } +.bi-bar-chart-steps::before { content: "\f17d"; } +.bi-bar-chart::before { content: "\f17e"; } +.bi-basket-fill::before { content: "\f17f"; } +.bi-basket::before { content: "\f180"; } +.bi-basket2-fill::before { content: "\f181"; } +.bi-basket2::before { content: "\f182"; } +.bi-basket3-fill::before { content: "\f183"; } +.bi-basket3::before { content: "\f184"; } +.bi-battery-charging::before { content: "\f185"; } +.bi-battery-full::before { content: "\f186"; } +.bi-battery-half::before { content: "\f187"; } +.bi-battery::before { content: "\f188"; } +.bi-bell-fill::before { content: "\f189"; } +.bi-bell::before { content: "\f18a"; } +.bi-bezier::before { content: "\f18b"; } +.bi-bezier2::before { content: "\f18c"; } +.bi-bicycle::before { content: "\f18d"; } +.bi-binoculars-fill::before { content: "\f18e"; } +.bi-binoculars::before { content: "\f18f"; } +.bi-blockquote-left::before { content: "\f190"; } +.bi-blockquote-right::before { content: "\f191"; } +.bi-book-fill::before { content: "\f192"; } +.bi-book-half::before { content: "\f193"; } +.bi-book::before { content: "\f194"; } +.bi-bookmark-check-fill::before { content: "\f195"; } +.bi-bookmark-check::before { content: "\f196"; } +.bi-bookmark-dash-fill::before { content: "\f197"; } +.bi-bookmark-dash::before { content: "\f198"; } +.bi-bookmark-fill::before { content: "\f199"; } +.bi-bookmark-heart-fill::before { content: "\f19a"; } +.bi-bookmark-heart::before { content: "\f19b"; } +.bi-bookmark-plus-fill::before { content: "\f19c"; } +.bi-bookmark-plus::before { content: "\f19d"; } +.bi-bookmark-star-fill::before { content: "\f19e"; } +.bi-bookmark-star::before { content: "\f19f"; } +.bi-bookmark-x-fill::before { content: "\f1a0"; } +.bi-bookmark-x::before { content: "\f1a1"; } +.bi-bookmark::before { content: "\f1a2"; } +.bi-bookmarks-fill::before { content: "\f1a3"; } +.bi-bookmarks::before { content: "\f1a4"; } +.bi-bookshelf::before { content: "\f1a5"; } +.bi-bootstrap-fill::before { content: "\f1a6"; } +.bi-bootstrap-reboot::before { content: "\f1a7"; } +.bi-bootstrap::before { content: "\f1a8"; } +.bi-border-all::before { content: "\f1a9"; } +.bi-border-bottom::before { content: "\f1aa"; } +.bi-border-center::before { content: "\f1ab"; } +.bi-border-inner::before { content: "\f1ac"; } +.bi-border-left::before { content: "\f1ad"; } +.bi-border-middle::before { content: "\f1ae"; } +.bi-border-outer::before { content: "\f1af"; } +.bi-border-right::before { content: "\f1b0"; } +.bi-border-style::before { content: "\f1b1"; } +.bi-border-top::before { content: "\f1b2"; } +.bi-border-width::before { content: "\f1b3"; } +.bi-border::before { content: "\f1b4"; } +.bi-bounding-box-circles::before { content: "\f1b5"; } +.bi-bounding-box::before { content: "\f1b6"; } +.bi-box-arrow-down-left::before { content: "\f1b7"; } +.bi-box-arrow-down-right::before { content: "\f1b8"; } +.bi-box-arrow-down::before { content: "\f1b9"; } +.bi-box-arrow-in-down-left::before { content: "\f1ba"; } +.bi-box-arrow-in-down-right::before { content: "\f1bb"; } +.bi-box-arrow-in-down::before { content: "\f1bc"; } +.bi-box-arrow-in-left::before { content: "\f1bd"; } +.bi-box-arrow-in-right::before { content: "\f1be"; } +.bi-box-arrow-in-up-left::before { content: "\f1bf"; } +.bi-box-arrow-in-up-right::before { content: "\f1c0"; } +.bi-box-arrow-in-up::before { content: "\f1c1"; } +.bi-box-arrow-left::before { content: "\f1c2"; } +.bi-box-arrow-right::before { content: "\f1c3"; } +.bi-box-arrow-up-left::before { content: "\f1c4"; } +.bi-box-arrow-up-right::before { content: "\f1c5"; } +.bi-box-arrow-up::before { content: "\f1c6"; } +.bi-box-seam::before { content: "\f1c7"; } +.bi-box::before { content: "\f1c8"; } +.bi-braces::before { content: "\f1c9"; } +.bi-bricks::before { content: "\f1ca"; } +.bi-briefcase-fill::before { content: "\f1cb"; } +.bi-briefcase::before { content: "\f1cc"; } +.bi-brightness-alt-high-fill::before { content: "\f1cd"; } +.bi-brightness-alt-high::before { content: "\f1ce"; } +.bi-brightness-alt-low-fill::before { content: "\f1cf"; } +.bi-brightness-alt-low::before { content: "\f1d0"; } +.bi-brightness-high-fill::before { content: "\f1d1"; } +.bi-brightness-high::before { content: "\f1d2"; } +.bi-brightness-low-fill::before { content: "\f1d3"; } +.bi-brightness-low::before { content: "\f1d4"; } +.bi-broadcast-pin::before { content: "\f1d5"; } +.bi-broadcast::before { content: "\f1d6"; } +.bi-brush-fill::before { content: "\f1d7"; } +.bi-brush::before { content: "\f1d8"; } +.bi-bucket-fill::before { content: "\f1d9"; } +.bi-bucket::before { content: "\f1da"; } +.bi-bug-fill::before { content: "\f1db"; } +.bi-bug::before { content: "\f1dc"; } +.bi-building::before { content: "\f1dd"; } +.bi-bullseye::before { content: "\f1de"; } +.bi-calculator-fill::before { content: "\f1df"; } +.bi-calculator::before { content: "\f1e0"; } +.bi-calendar-check-fill::before { content: "\f1e1"; } +.bi-calendar-check::before { content: "\f1e2"; } +.bi-calendar-date-fill::before { content: "\f1e3"; } +.bi-calendar-date::before { content: "\f1e4"; } +.bi-calendar-day-fill::before { content: "\f1e5"; } +.bi-calendar-day::before { content: "\f1e6"; } +.bi-calendar-event-fill::before { content: "\f1e7"; } +.bi-calendar-event::before { content: "\f1e8"; } +.bi-calendar-fill::before { content: "\f1e9"; } +.bi-calendar-minus-fill::before { content: "\f1ea"; } +.bi-calendar-minus::before { content: "\f1eb"; } +.bi-calendar-month-fill::before { content: "\f1ec"; } +.bi-calendar-month::before { content: "\f1ed"; } +.bi-calendar-plus-fill::before { content: "\f1ee"; } +.bi-calendar-plus::before { content: "\f1ef"; } +.bi-calendar-range-fill::before { content: "\f1f0"; } +.bi-calendar-range::before { content: "\f1f1"; } +.bi-calendar-week-fill::before { content: "\f1f2"; } +.bi-calendar-week::before { content: "\f1f3"; } +.bi-calendar-x-fill::before { content: "\f1f4"; } +.bi-calendar-x::before { content: "\f1f5"; } +.bi-calendar::before { content: "\f1f6"; } +.bi-calendar2-check-fill::before { content: "\f1f7"; } +.bi-calendar2-check::before { content: "\f1f8"; } +.bi-calendar2-date-fill::before { content: "\f1f9"; } +.bi-calendar2-date::before { content: "\f1fa"; } +.bi-calendar2-day-fill::before { content: "\f1fb"; } +.bi-calendar2-day::before { content: "\f1fc"; } +.bi-calendar2-event-fill::before { content: "\f1fd"; } +.bi-calendar2-event::before { content: "\f1fe"; } +.bi-calendar2-fill::before { content: "\f1ff"; } +.bi-calendar2-minus-fill::before { content: "\f200"; } +.bi-calendar2-minus::before { content: "\f201"; } +.bi-calendar2-month-fill::before { content: "\f202"; } +.bi-calendar2-month::before { content: "\f203"; } +.bi-calendar2-plus-fill::before { content: "\f204"; } +.bi-calendar2-plus::before { content: "\f205"; } +.bi-calendar2-range-fill::before { content: "\f206"; } +.bi-calendar2-range::before { content: "\f207"; } +.bi-calendar2-week-fill::before { content: "\f208"; } +.bi-calendar2-week::before { content: "\f209"; } +.bi-calendar2-x-fill::before { content: "\f20a"; } +.bi-calendar2-x::before { content: "\f20b"; } +.bi-calendar2::before { content: "\f20c"; } +.bi-calendar3-event-fill::before { content: "\f20d"; } +.bi-calendar3-event::before { content: "\f20e"; } +.bi-calendar3-fill::before { content: "\f20f"; } +.bi-calendar3-range-fill::before { content: "\f210"; } +.bi-calendar3-range::before { content: "\f211"; } +.bi-calendar3-week-fill::before { content: "\f212"; } +.bi-calendar3-week::before { content: "\f213"; } +.bi-calendar3::before { content: "\f214"; } +.bi-calendar4-event::before { content: "\f215"; } +.bi-calendar4-range::before { content: "\f216"; } +.bi-calendar4-week::before { content: "\f217"; } +.bi-calendar4::before { content: "\f218"; } +.bi-camera-fill::before { content: "\f219"; } +.bi-camera-reels-fill::before { content: "\f21a"; } +.bi-camera-reels::before { content: "\f21b"; } +.bi-camera-video-fill::before { content: "\f21c"; } +.bi-camera-video-off-fill::before { content: "\f21d"; } +.bi-camera-video-off::before { content: "\f21e"; } +.bi-camera-video::before { content: "\f21f"; } +.bi-camera::before { content: "\f220"; } +.bi-camera2::before { content: "\f221"; } +.bi-capslock-fill::before { content: "\f222"; } +.bi-capslock::before { content: "\f223"; } +.bi-card-checklist::before { content: "\f224"; } +.bi-card-heading::before { content: "\f225"; } +.bi-card-image::before { content: "\f226"; } +.bi-card-list::before { content: "\f227"; } +.bi-card-text::before { content: "\f228"; } +.bi-caret-down-fill::before { content: "\f229"; } +.bi-caret-down-square-fill::before { content: "\f22a"; } +.bi-caret-down-square::before { content: "\f22b"; } +.bi-caret-down::before { content: "\f22c"; } +.bi-caret-left-fill::before { content: "\f22d"; } +.bi-caret-left-square-fill::before { content: "\f22e"; } +.bi-caret-left-square::before { content: "\f22f"; } +.bi-caret-left::before { content: "\f230"; } +.bi-caret-right-fill::before { content: "\f231"; } +.bi-caret-right-square-fill::before { content: "\f232"; } +.bi-caret-right-square::before { content: "\f233"; } +.bi-caret-right::before { content: "\f234"; } +.bi-caret-up-fill::before { content: "\f235"; } +.bi-caret-up-square-fill::before { content: "\f236"; } +.bi-caret-up-square::before { content: "\f237"; } +.bi-caret-up::before { content: "\f238"; } +.bi-cart-check-fill::before { content: "\f239"; } +.bi-cart-check::before { content: "\f23a"; } +.bi-cart-dash-fill::before { content: "\f23b"; } +.bi-cart-dash::before { content: "\f23c"; } +.bi-cart-fill::before { content: "\f23d"; } +.bi-cart-plus-fill::before { content: "\f23e"; } +.bi-cart-plus::before { content: "\f23f"; } +.bi-cart-x-fill::before { content: "\f240"; } +.bi-cart-x::before { content: "\f241"; } +.bi-cart::before { content: "\f242"; } +.bi-cart2::before { content: "\f243"; } +.bi-cart3::before { content: "\f244"; } +.bi-cart4::before { content: "\f245"; } +.bi-cash-stack::before { content: "\f246"; } +.bi-cash::before { content: "\f247"; } +.bi-cast::before { content: "\f248"; } +.bi-chat-dots-fill::before { content: "\f249"; } +.bi-chat-dots::before { content: "\f24a"; } +.bi-chat-fill::before { content: "\f24b"; } +.bi-chat-left-dots-fill::before { content: "\f24c"; } +.bi-chat-left-dots::before { content: "\f24d"; } +.bi-chat-left-fill::before { content: "\f24e"; } +.bi-chat-left-quote-fill::before { content: "\f24f"; } +.bi-chat-left-quote::before { content: "\f250"; } +.bi-chat-left-text-fill::before { content: "\f251"; } +.bi-chat-left-text::before { content: "\f252"; } +.bi-chat-left::before { content: "\f253"; } +.bi-chat-quote-fill::before { content: "\f254"; } +.bi-chat-quote::before { content: "\f255"; } +.bi-chat-right-dots-fill::before { content: "\f256"; } +.bi-chat-right-dots::before { content: "\f257"; } +.bi-chat-right-fill::before { content: "\f258"; } +.bi-chat-right-quote-fill::before { content: "\f259"; } +.bi-chat-right-quote::before { content: "\f25a"; } +.bi-chat-right-text-fill::before { content: "\f25b"; } +.bi-chat-right-text::before { content: "\f25c"; } +.bi-chat-right::before { content: "\f25d"; } +.bi-chat-square-dots-fill::before { content: "\f25e"; } +.bi-chat-square-dots::before { content: "\f25f"; } +.bi-chat-square-fill::before { content: "\f260"; } +.bi-chat-square-quote-fill::before { content: "\f261"; } +.bi-chat-square-quote::before { content: "\f262"; } +.bi-chat-square-text-fill::before { content: "\f263"; } +.bi-chat-square-text::before { content: "\f264"; } +.bi-chat-square::before { content: "\f265"; } +.bi-chat-text-fill::before { content: "\f266"; } +.bi-chat-text::before { content: "\f267"; } +.bi-chat::before { content: "\f268"; } +.bi-check-all::before { content: "\f269"; } +.bi-check-circle-fill::before { content: "\f26a"; } +.bi-check-circle::before { content: "\f26b"; } +.bi-check-square-fill::before { content: "\f26c"; } +.bi-check-square::before { content: "\f26d"; } +.bi-check::before { content: "\f26e"; } +.bi-check2-all::before { content: "\f26f"; } +.bi-check2-circle::before { content: "\f270"; } +.bi-check2-square::before { content: "\f271"; } +.bi-check2::before { content: "\f272"; } +.bi-chevron-bar-contract::before { content: "\f273"; } +.bi-chevron-bar-down::before { content: "\f274"; } +.bi-chevron-bar-expand::before { content: "\f275"; } +.bi-chevron-bar-left::before { content: "\f276"; } +.bi-chevron-bar-right::before { content: "\f277"; } +.bi-chevron-bar-up::before { content: "\f278"; } +.bi-chevron-compact-down::before { content: "\f279"; } +.bi-chevron-compact-left::before { content: "\f27a"; } +.bi-chevron-compact-right::before { content: "\f27b"; } +.bi-chevron-compact-up::before { content: "\f27c"; } +.bi-chevron-contract::before { content: "\f27d"; } +.bi-chevron-double-down::before { content: "\f27e"; } +.bi-chevron-double-left::before { content: "\f27f"; } +.bi-chevron-double-right::before { content: "\f280"; } +.bi-chevron-double-up::before { content: "\f281"; } +.bi-chevron-down::before { content: "\f282"; } +.bi-chevron-expand::before { content: "\f283"; } +.bi-chevron-left::before { content: "\f284"; } +.bi-chevron-right::before { content: "\f285"; } +.bi-chevron-up::before { content: "\f286"; } +.bi-circle-fill::before { content: "\f287"; } +.bi-circle-half::before { content: "\f288"; } +.bi-circle-square::before { content: "\f289"; } +.bi-circle::before { content: "\f28a"; } +.bi-clipboard-check::before { content: "\f28b"; } +.bi-clipboard-data::before { content: "\f28c"; } +.bi-clipboard-minus::before { content: "\f28d"; } +.bi-clipboard-plus::before { content: "\f28e"; } +.bi-clipboard-x::before { content: "\f28f"; } +.bi-clipboard::before { content: "\f290"; } +.bi-clock-fill::before { content: "\f291"; } +.bi-clock-history::before { content: "\f292"; } +.bi-clock::before { content: "\f293"; } +.bi-cloud-arrow-down-fill::before { content: "\f294"; } +.bi-cloud-arrow-down::before { content: "\f295"; } +.bi-cloud-arrow-up-fill::before { content: "\f296"; } +.bi-cloud-arrow-up::before { content: "\f297"; } +.bi-cloud-check-fill::before { content: "\f298"; } +.bi-cloud-check::before { content: "\f299"; } +.bi-cloud-download-fill::before { content: "\f29a"; } +.bi-cloud-download::before { content: "\f29b"; } +.bi-cloud-drizzle-fill::before { content: "\f29c"; } +.bi-cloud-drizzle::before { content: "\f29d"; } +.bi-cloud-fill::before { content: "\f29e"; } +.bi-cloud-fog-fill::before { content: "\f29f"; } +.bi-cloud-fog::before { content: "\f2a0"; } +.bi-cloud-fog2-fill::before { content: "\f2a1"; } +.bi-cloud-fog2::before { content: "\f2a2"; } +.bi-cloud-hail-fill::before { content: "\f2a3"; } +.bi-cloud-hail::before { content: "\f2a4"; } +.bi-cloud-haze-fill::before { content: "\f2a6"; } +.bi-cloud-haze::before { content: "\f2a7"; } +.bi-cloud-haze2-fill::before { content: "\f2a8"; } +.bi-cloud-lightning-fill::before { content: "\f2a9"; } +.bi-cloud-lightning-rain-fill::before { content: "\f2aa"; } +.bi-cloud-lightning-rain::before { content: "\f2ab"; } +.bi-cloud-lightning::before { content: "\f2ac"; } +.bi-cloud-minus-fill::before { content: "\f2ad"; } +.bi-cloud-minus::before { content: "\f2ae"; } +.bi-cloud-moon-fill::before { content: "\f2af"; } +.bi-cloud-moon::before { content: "\f2b0"; } +.bi-cloud-plus-fill::before { content: "\f2b1"; } +.bi-cloud-plus::before { content: "\f2b2"; } +.bi-cloud-rain-fill::before { content: "\f2b3"; } +.bi-cloud-rain-heavy-fill::before { content: "\f2b4"; } +.bi-cloud-rain-heavy::before { content: "\f2b5"; } +.bi-cloud-rain::before { content: "\f2b6"; } +.bi-cloud-slash-fill::before { content: "\f2b7"; } +.bi-cloud-slash::before { content: "\f2b8"; } +.bi-cloud-sleet-fill::before { content: "\f2b9"; } +.bi-cloud-sleet::before { content: "\f2ba"; } +.bi-cloud-snow-fill::before { content: "\f2bb"; } +.bi-cloud-snow::before { content: "\f2bc"; } +.bi-cloud-sun-fill::before { content: "\f2bd"; } +.bi-cloud-sun::before { content: "\f2be"; } +.bi-cloud-upload-fill::before { content: "\f2bf"; } +.bi-cloud-upload::before { content: "\f2c0"; } +.bi-cloud::before { content: "\f2c1"; } +.bi-clouds-fill::before { content: "\f2c2"; } +.bi-clouds::before { content: "\f2c3"; } +.bi-cloudy-fill::before { content: "\f2c4"; } +.bi-cloudy::before { content: "\f2c5"; } +.bi-code-slash::before { content: "\f2c6"; } +.bi-code-square::before { content: "\f2c7"; } +.bi-code::before { content: "\f2c8"; } +.bi-collection-fill::before { content: "\f2c9"; } +.bi-collection-play-fill::before { content: "\f2ca"; } +.bi-collection-play::before { content: "\f2cb"; } +.bi-collection::before { content: "\f2cc"; } +.bi-columns-gap::before { content: "\f2cd"; } +.bi-columns::before { content: "\f2ce"; } +.bi-command::before { content: "\f2cf"; } +.bi-compass-fill::before { content: "\f2d0"; } +.bi-compass::before { content: "\f2d1"; } +.bi-cone-striped::before { content: "\f2d2"; } +.bi-cone::before { content: "\f2d3"; } +.bi-controller::before { content: "\f2d4"; } +.bi-cpu-fill::before { content: "\f2d5"; } +.bi-cpu::before { content: "\f2d6"; } +.bi-credit-card-2-back-fill::before { content: "\f2d7"; } +.bi-credit-card-2-back::before { content: "\f2d8"; } +.bi-credit-card-2-front-fill::before { content: "\f2d9"; } +.bi-credit-card-2-front::before { content: "\f2da"; } +.bi-credit-card-fill::before { content: "\f2db"; } +.bi-credit-card::before { content: "\f2dc"; } +.bi-crop::before { content: "\f2dd"; } +.bi-cup-fill::before { content: "\f2de"; } +.bi-cup-straw::before { content: "\f2df"; } +.bi-cup::before { content: "\f2e0"; } +.bi-cursor-fill::before { content: "\f2e1"; } +.bi-cursor-text::before { content: "\f2e2"; } +.bi-cursor::before { content: "\f2e3"; } +.bi-dash-circle-dotted::before { content: "\f2e4"; } +.bi-dash-circle-fill::before { content: "\f2e5"; } +.bi-dash-circle::before { content: "\f2e6"; } +.bi-dash-square-dotted::before { content: "\f2e7"; } +.bi-dash-square-fill::before { content: "\f2e8"; } +.bi-dash-square::before { content: "\f2e9"; } +.bi-dash::before { content: "\f2ea"; } +.bi-diagram-2-fill::before { content: "\f2eb"; } +.bi-diagram-2::before { content: "\f2ec"; } +.bi-diagram-3-fill::before { content: "\f2ed"; } +.bi-diagram-3::before { content: "\f2ee"; } +.bi-diamond-fill::before { content: "\f2ef"; } +.bi-diamond-half::before { content: "\f2f0"; } +.bi-diamond::before { content: "\f2f1"; } +.bi-dice-1-fill::before { content: "\f2f2"; } +.bi-dice-1::before { content: "\f2f3"; } +.bi-dice-2-fill::before { content: "\f2f4"; } +.bi-dice-2::before { content: "\f2f5"; } +.bi-dice-3-fill::before { content: "\f2f6"; } +.bi-dice-3::before { content: "\f2f7"; } +.bi-dice-4-fill::before { content: "\f2f8"; } +.bi-dice-4::before { content: "\f2f9"; } +.bi-dice-5-fill::before { content: "\f2fa"; } +.bi-dice-5::before { content: "\f2fb"; } +.bi-dice-6-fill::before { content: "\f2fc"; } +.bi-dice-6::before { content: "\f2fd"; } +.bi-disc-fill::before { content: "\f2fe"; } +.bi-disc::before { content: "\f2ff"; } +.bi-discord::before { content: "\f300"; } +.bi-display-fill::before { content: "\f301"; } +.bi-display::before { content: "\f302"; } +.bi-distribute-horizontal::before { content: "\f303"; } +.bi-distribute-vertical::before { content: "\f304"; } +.bi-door-closed-fill::before { content: "\f305"; } +.bi-door-closed::before { content: "\f306"; } +.bi-door-open-fill::before { content: "\f307"; } +.bi-door-open::before { content: "\f308"; } +.bi-dot::before { content: "\f309"; } +.bi-download::before { content: "\f30a"; } +.bi-droplet-fill::before { content: "\f30b"; } +.bi-droplet-half::before { content: "\f30c"; } +.bi-droplet::before { content: "\f30d"; } +.bi-earbuds::before { content: "\f30e"; } +.bi-easel-fill::before { content: "\f30f"; } +.bi-easel::before { content: "\f310"; } +.bi-egg-fill::before { content: "\f311"; } +.bi-egg-fried::before { content: "\f312"; } +.bi-egg::before { content: "\f313"; } +.bi-eject-fill::before { content: "\f314"; } +.bi-eject::before { content: "\f315"; } +.bi-emoji-angry-fill::before { content: "\f316"; } +.bi-emoji-angry::before { content: "\f317"; } +.bi-emoji-dizzy-fill::before { content: "\f318"; } +.bi-emoji-dizzy::before { content: "\f319"; } +.bi-emoji-expressionless-fill::before { content: "\f31a"; } +.bi-emoji-expressionless::before { content: "\f31b"; } +.bi-emoji-frown-fill::before { content: "\f31c"; } +.bi-emoji-frown::before { content: "\f31d"; } +.bi-emoji-heart-eyes-fill::before { content: "\f31e"; } +.bi-emoji-heart-eyes::before { content: "\f31f"; } +.bi-emoji-laughing-fill::before { content: "\f320"; } +.bi-emoji-laughing::before { content: "\f321"; } +.bi-emoji-neutral-fill::before { content: "\f322"; } +.bi-emoji-neutral::before { content: "\f323"; } +.bi-emoji-smile-fill::before { content: "\f324"; } +.bi-emoji-smile-upside-down-fill::before { content: "\f325"; } +.bi-emoji-smile-upside-down::before { content: "\f326"; } +.bi-emoji-smile::before { content: "\f327"; } +.bi-emoji-sunglasses-fill::before { content: "\f328"; } +.bi-emoji-sunglasses::before { content: "\f329"; } +.bi-emoji-wink-fill::before { content: "\f32a"; } +.bi-emoji-wink::before { content: "\f32b"; } +.bi-envelope-fill::before { content: "\f32c"; } +.bi-envelope-open-fill::before { content: "\f32d"; } +.bi-envelope-open::before { content: "\f32e"; } +.bi-envelope::before { content: "\f32f"; } +.bi-eraser-fill::before { content: "\f330"; } +.bi-eraser::before { content: "\f331"; } +.bi-exclamation-circle-fill::before { content: "\f332"; } +.bi-exclamation-circle::before { content: "\f333"; } +.bi-exclamation-diamond-fill::before { content: "\f334"; } +.bi-exclamation-diamond::before { content: "\f335"; } +.bi-exclamation-octagon-fill::before { content: "\f336"; } +.bi-exclamation-octagon::before { content: "\f337"; } +.bi-exclamation-square-fill::before { content: "\f338"; } +.bi-exclamation-square::before { content: "\f339"; } +.bi-exclamation-triangle-fill::before { content: "\f33a"; } +.bi-exclamation-triangle::before { content: "\f33b"; } +.bi-exclamation::before { content: "\f33c"; } +.bi-exclude::before { content: "\f33d"; } +.bi-eye-fill::before { content: "\f33e"; } +.bi-eye-slash-fill::before { content: "\f33f"; } +.bi-eye-slash::before { content: "\f340"; } +.bi-eye::before { content: "\f341"; } +.bi-eyedropper::before { content: "\f342"; } +.bi-eyeglasses::before { content: "\f343"; } +.bi-facebook::before { content: "\f344"; } +.bi-file-arrow-down-fill::before { content: "\f345"; } +.bi-file-arrow-down::before { content: "\f346"; } +.bi-file-arrow-up-fill::before { content: "\f347"; } +.bi-file-arrow-up::before { content: "\f348"; } +.bi-file-bar-graph-fill::before { content: "\f349"; } +.bi-file-bar-graph::before { content: "\f34a"; } +.bi-file-binary-fill::before { content: "\f34b"; } +.bi-file-binary::before { content: "\f34c"; } +.bi-file-break-fill::before { content: "\f34d"; } +.bi-file-break::before { content: "\f34e"; } +.bi-file-check-fill::before { content: "\f34f"; } +.bi-file-check::before { content: "\f350"; } +.bi-file-code-fill::before { content: "\f351"; } +.bi-file-code::before { content: "\f352"; } +.bi-file-diff-fill::before { content: "\f353"; } +.bi-file-diff::before { content: "\f354"; } +.bi-file-earmark-arrow-down-fill::before { content: "\f355"; } +.bi-file-earmark-arrow-down::before { content: "\f356"; } +.bi-file-earmark-arrow-up-fill::before { content: "\f357"; } +.bi-file-earmark-arrow-up::before { content: "\f358"; } +.bi-file-earmark-bar-graph-fill::before { content: "\f359"; } +.bi-file-earmark-bar-graph::before { content: "\f35a"; } +.bi-file-earmark-binary-fill::before { content: "\f35b"; } +.bi-file-earmark-binary::before { content: "\f35c"; } +.bi-file-earmark-break-fill::before { content: "\f35d"; } +.bi-file-earmark-break::before { content: "\f35e"; } +.bi-file-earmark-check-fill::before { content: "\f35f"; } +.bi-file-earmark-check::before { content: "\f360"; } +.bi-file-earmark-code-fill::before { content: "\f361"; } +.bi-file-earmark-code::before { content: "\f362"; } +.bi-file-earmark-diff-fill::before { content: "\f363"; } +.bi-file-earmark-diff::before { content: "\f364"; } +.bi-file-earmark-easel-fill::before { content: "\f365"; } +.bi-file-earmark-easel::before { content: "\f366"; } +.bi-file-earmark-excel-fill::before { content: "\f367"; } +.bi-file-earmark-excel::before { content: "\f368"; } +.bi-file-earmark-fill::before { content: "\f369"; } +.bi-file-earmark-font-fill::before { content: "\f36a"; } +.bi-file-earmark-font::before { content: "\f36b"; } +.bi-file-earmark-image-fill::before { content: "\f36c"; } +.bi-file-earmark-image::before { content: "\f36d"; } +.bi-file-earmark-lock-fill::before { content: "\f36e"; } +.bi-file-earmark-lock::before { content: "\f36f"; } +.bi-file-earmark-lock2-fill::before { content: "\f370"; } +.bi-file-earmark-lock2::before { content: "\f371"; } +.bi-file-earmark-medical-fill::before { content: "\f372"; } +.bi-file-earmark-medical::before { content: "\f373"; } +.bi-file-earmark-minus-fill::before { content: "\f374"; } +.bi-file-earmark-minus::before { content: "\f375"; } +.bi-file-earmark-music-fill::before { content: "\f376"; } +.bi-file-earmark-music::before { content: "\f377"; } +.bi-file-earmark-person-fill::before { content: "\f378"; } +.bi-file-earmark-person::before { content: "\f379"; } +.bi-file-earmark-play-fill::before { content: "\f37a"; } +.bi-file-earmark-play::before { content: "\f37b"; } +.bi-file-earmark-plus-fill::before { content: "\f37c"; } +.bi-file-earmark-plus::before { content: "\f37d"; } +.bi-file-earmark-post-fill::before { content: "\f37e"; } +.bi-file-earmark-post::before { content: "\f37f"; } +.bi-file-earmark-ppt-fill::before { content: "\f380"; } +.bi-file-earmark-ppt::before { content: "\f381"; } +.bi-file-earmark-richtext-fill::before { content: "\f382"; } +.bi-file-earmark-richtext::before { content: "\f383"; } +.bi-file-earmark-ruled-fill::before { content: "\f384"; } +.bi-file-earmark-ruled::before { content: "\f385"; } +.bi-file-earmark-slides-fill::before { content: "\f386"; } +.bi-file-earmark-slides::before { content: "\f387"; } +.bi-file-earmark-spreadsheet-fill::before { content: "\f388"; } +.bi-file-earmark-spreadsheet::before { content: "\f389"; } +.bi-file-earmark-text-fill::before { content: "\f38a"; } +.bi-file-earmark-text::before { content: "\f38b"; } +.bi-file-earmark-word-fill::before { content: "\f38c"; } +.bi-file-earmark-word::before { content: "\f38d"; } +.bi-file-earmark-x-fill::before { content: "\f38e"; } +.bi-file-earmark-x::before { content: "\f38f"; } +.bi-file-earmark-zip-fill::before { content: "\f390"; } +.bi-file-earmark-zip::before { content: "\f391"; } +.bi-file-earmark::before { content: "\f392"; } +.bi-file-easel-fill::before { content: "\f393"; } +.bi-file-easel::before { content: "\f394"; } +.bi-file-excel-fill::before { content: "\f395"; } +.bi-file-excel::before { content: "\f396"; } +.bi-file-fill::before { content: "\f397"; } +.bi-file-font-fill::before { content: "\f398"; } +.bi-file-font::before { content: "\f399"; } +.bi-file-image-fill::before { content: "\f39a"; } +.bi-file-image::before { content: "\f39b"; } +.bi-file-lock-fill::before { content: "\f39c"; } +.bi-file-lock::before { content: "\f39d"; } +.bi-file-lock2-fill::before { content: "\f39e"; } +.bi-file-lock2::before { content: "\f39f"; } +.bi-file-medical-fill::before { content: "\f3a0"; } +.bi-file-medical::before { content: "\f3a1"; } +.bi-file-minus-fill::before { content: "\f3a2"; } +.bi-file-minus::before { content: "\f3a3"; } +.bi-file-music-fill::before { content: "\f3a4"; } +.bi-file-music::before { content: "\f3a5"; } +.bi-file-person-fill::before { content: "\f3a6"; } +.bi-file-person::before { content: "\f3a7"; } +.bi-file-play-fill::before { content: "\f3a8"; } +.bi-file-play::before { content: "\f3a9"; } +.bi-file-plus-fill::before { content: "\f3aa"; } +.bi-file-plus::before { content: "\f3ab"; } +.bi-file-post-fill::before { content: "\f3ac"; } +.bi-file-post::before { content: "\f3ad"; } +.bi-file-ppt-fill::before { content: "\f3ae"; } +.bi-file-ppt::before { content: "\f3af"; } +.bi-file-richtext-fill::before { content: "\f3b0"; } +.bi-file-richtext::before { content: "\f3b1"; } +.bi-file-ruled-fill::before { content: "\f3b2"; } +.bi-file-ruled::before { content: "\f3b3"; } +.bi-file-slides-fill::before { content: "\f3b4"; } +.bi-file-slides::before { content: "\f3b5"; } +.bi-file-spreadsheet-fill::before { content: "\f3b6"; } +.bi-file-spreadsheet::before { content: "\f3b7"; } +.bi-file-text-fill::before { content: "\f3b8"; } +.bi-file-text::before { content: "\f3b9"; } +.bi-file-word-fill::before { content: "\f3ba"; } +.bi-file-word::before { content: "\f3bb"; } +.bi-file-x-fill::before { content: "\f3bc"; } +.bi-file-x::before { content: "\f3bd"; } +.bi-file-zip-fill::before { content: "\f3be"; } +.bi-file-zip::before { content: "\f3bf"; } +.bi-file::before { content: "\f3c0"; } +.bi-files-alt::before { content: "\f3c1"; } +.bi-files::before { content: "\f3c2"; } +.bi-film::before { content: "\f3c3"; } +.bi-filter-circle-fill::before { content: "\f3c4"; } +.bi-filter-circle::before { content: "\f3c5"; } +.bi-filter-left::before { content: "\f3c6"; } +.bi-filter-right::before { content: "\f3c7"; } +.bi-filter-square-fill::before { content: "\f3c8"; } +.bi-filter-square::before { content: "\f3c9"; } +.bi-filter::before { content: "\f3ca"; } +.bi-flag-fill::before { content: "\f3cb"; } +.bi-flag::before { content: "\f3cc"; } +.bi-flower1::before { content: "\f3cd"; } +.bi-flower2::before { content: "\f3ce"; } +.bi-flower3::before { content: "\f3cf"; } +.bi-folder-check::before { content: "\f3d0"; } +.bi-folder-fill::before { content: "\f3d1"; } +.bi-folder-minus::before { content: "\f3d2"; } +.bi-folder-plus::before { content: "\f3d3"; } +.bi-folder-symlink-fill::before { content: "\f3d4"; } +.bi-folder-symlink::before { content: "\f3d5"; } +.bi-folder-x::before { content: "\f3d6"; } +.bi-folder::before { content: "\f3d7"; } +.bi-folder2-open::before { content: "\f3d8"; } +.bi-folder2::before { content: "\f3d9"; } +.bi-fonts::before { content: "\f3da"; } +.bi-forward-fill::before { content: "\f3db"; } +.bi-forward::before { content: "\f3dc"; } +.bi-front::before { content: "\f3dd"; } +.bi-fullscreen-exit::before { content: "\f3de"; } +.bi-fullscreen::before { content: "\f3df"; } +.bi-funnel-fill::before { content: "\f3e0"; } +.bi-funnel::before { content: "\f3e1"; } +.bi-gear-fill::before { content: "\f3e2"; } +.bi-gear-wide-connected::before { content: "\f3e3"; } +.bi-gear-wide::before { content: "\f3e4"; } +.bi-gear::before { content: "\f3e5"; } +.bi-gem::before { content: "\f3e6"; } +.bi-geo-alt-fill::before { content: "\f3e7"; } +.bi-geo-alt::before { content: "\f3e8"; } +.bi-geo-fill::before { content: "\f3e9"; } +.bi-geo::before { content: "\f3ea"; } +.bi-gift-fill::before { content: "\f3eb"; } +.bi-gift::before { content: "\f3ec"; } +.bi-github::before { content: "\f3ed"; } +.bi-globe::before { content: "\f3ee"; } +.bi-globe2::before { content: "\f3ef"; } +.bi-google::before { content: "\f3f0"; } +.bi-graph-down::before { content: "\f3f1"; } +.bi-graph-up::before { content: "\f3f2"; } +.bi-grid-1x2-fill::before { content: "\f3f3"; } +.bi-grid-1x2::before { content: "\f3f4"; } +.bi-grid-3x2-gap-fill::before { content: "\f3f5"; } +.bi-grid-3x2-gap::before { content: "\f3f6"; } +.bi-grid-3x2::before { content: "\f3f7"; } +.bi-grid-3x3-gap-fill::before { content: "\f3f8"; } +.bi-grid-3x3-gap::before { content: "\f3f9"; } +.bi-grid-3x3::before { content: "\f3fa"; } +.bi-grid-fill::before { content: "\f3fb"; } +.bi-grid::before { content: "\f3fc"; } +.bi-grip-horizontal::before { content: "\f3fd"; } +.bi-grip-vertical::before { content: "\f3fe"; } +.bi-hammer::before { content: "\f3ff"; } +.bi-hand-index-fill::before { content: "\f400"; } +.bi-hand-index-thumb-fill::before { content: "\f401"; } +.bi-hand-index-thumb::before { content: "\f402"; } +.bi-hand-index::before { content: "\f403"; } +.bi-hand-thumbs-down-fill::before { content: "\f404"; } +.bi-hand-thumbs-down::before { content: "\f405"; } +.bi-hand-thumbs-up-fill::before { content: "\f406"; } +.bi-hand-thumbs-up::before { content: "\f407"; } +.bi-handbag-fill::before { content: "\f408"; } +.bi-handbag::before { content: "\f409"; } +.bi-hash::before { content: "\f40a"; } +.bi-hdd-fill::before { content: "\f40b"; } +.bi-hdd-network-fill::before { content: "\f40c"; } +.bi-hdd-network::before { content: "\f40d"; } +.bi-hdd-rack-fill::before { content: "\f40e"; } +.bi-hdd-rack::before { content: "\f40f"; } +.bi-hdd-stack-fill::before { content: "\f410"; } +.bi-hdd-stack::before { content: "\f411"; } +.bi-hdd::before { content: "\f412"; } +.bi-headphones::before { content: "\f413"; } +.bi-headset::before { content: "\f414"; } +.bi-heart-fill::before { content: "\f415"; } +.bi-heart-half::before { content: "\f416"; } +.bi-heart::before { content: "\f417"; } +.bi-heptagon-fill::before { content: "\f418"; } +.bi-heptagon-half::before { content: "\f419"; } +.bi-heptagon::before { content: "\f41a"; } +.bi-hexagon-fill::before { content: "\f41b"; } +.bi-hexagon-half::before { content: "\f41c"; } +.bi-hexagon::before { content: "\f41d"; } +.bi-hourglass-bottom::before { content: "\f41e"; } +.bi-hourglass-split::before { content: "\f41f"; } +.bi-hourglass-top::before { content: "\f420"; } +.bi-hourglass::before { content: "\f421"; } +.bi-house-door-fill::before { content: "\f422"; } +.bi-house-door::before { content: "\f423"; } +.bi-house-fill::before { content: "\f424"; } +.bi-house::before { content: "\f425"; } +.bi-hr::before { content: "\f426"; } +.bi-hurricane::before { content: "\f427"; } +.bi-image-alt::before { content: "\f428"; } +.bi-image-fill::before { content: "\f429"; } +.bi-image::before { content: "\f42a"; } +.bi-images::before { content: "\f42b"; } +.bi-inbox-fill::before { content: "\f42c"; } +.bi-inbox::before { content: "\f42d"; } +.bi-inboxes-fill::before { content: "\f42e"; } +.bi-inboxes::before { content: "\f42f"; } +.bi-info-circle-fill::before { content: "\f430"; } +.bi-info-circle::before { content: "\f431"; } +.bi-info-square-fill::before { content: "\f432"; } +.bi-info-square::before { content: "\f433"; } +.bi-info::before { content: "\f434"; } +.bi-input-cursor-text::before { content: "\f435"; } +.bi-input-cursor::before { content: "\f436"; } +.bi-instagram::before { content: "\f437"; } +.bi-intersect::before { content: "\f438"; } +.bi-journal-album::before { content: "\f439"; } +.bi-journal-arrow-down::before { content: "\f43a"; } +.bi-journal-arrow-up::before { content: "\f43b"; } +.bi-journal-bookmark-fill::before { content: "\f43c"; } +.bi-journal-bookmark::before { content: "\f43d"; } +.bi-journal-check::before { content: "\f43e"; } +.bi-journal-code::before { content: "\f43f"; } +.bi-journal-medical::before { content: "\f440"; } +.bi-journal-minus::before { content: "\f441"; } +.bi-journal-plus::before { content: "\f442"; } +.bi-journal-richtext::before { content: "\f443"; } +.bi-journal-text::before { content: "\f444"; } +.bi-journal-x::before { content: "\f445"; } +.bi-journal::before { content: "\f446"; } +.bi-journals::before { content: "\f447"; } +.bi-joystick::before { content: "\f448"; } +.bi-justify-left::before { content: "\f449"; } +.bi-justify-right::before { content: "\f44a"; } +.bi-justify::before { content: "\f44b"; } +.bi-kanban-fill::before { content: "\f44c"; } +.bi-kanban::before { content: "\f44d"; } +.bi-key-fill::before { content: "\f44e"; } +.bi-key::before { content: "\f44f"; } +.bi-keyboard-fill::before { content: "\f450"; } +.bi-keyboard::before { content: "\f451"; } +.bi-ladder::before { content: "\f452"; } +.bi-lamp-fill::before { content: "\f453"; } +.bi-lamp::before { content: "\f454"; } +.bi-laptop-fill::before { content: "\f455"; } +.bi-laptop::before { content: "\f456"; } +.bi-layer-backward::before { content: "\f457"; } +.bi-layer-forward::before { content: "\f458"; } +.bi-layers-fill::before { content: "\f459"; } +.bi-layers-half::before { content: "\f45a"; } +.bi-layers::before { content: "\f45b"; } +.bi-layout-sidebar-inset-reverse::before { content: "\f45c"; } +.bi-layout-sidebar-inset::before { content: "\f45d"; } +.bi-layout-sidebar-reverse::before { content: "\f45e"; } +.bi-layout-sidebar::before { content: "\f45f"; } +.bi-layout-split::before { content: "\f460"; } +.bi-layout-text-sidebar-reverse::before { content: "\f461"; } +.bi-layout-text-sidebar::before { content: "\f462"; } +.bi-layout-text-window-reverse::before { content: "\f463"; } +.bi-layout-text-window::before { content: "\f464"; } +.bi-layout-three-columns::before { content: "\f465"; } +.bi-layout-wtf::before { content: "\f466"; } +.bi-life-preserver::before { content: "\f467"; } +.bi-lightbulb-fill::before { content: "\f468"; } +.bi-lightbulb-off-fill::before { content: "\f469"; } +.bi-lightbulb-off::before { content: "\f46a"; } +.bi-lightbulb::before { content: "\f46b"; } +.bi-lightning-charge-fill::before { content: "\f46c"; } +.bi-lightning-charge::before { content: "\f46d"; } +.bi-lightning-fill::before { content: "\f46e"; } +.bi-lightning::before { content: "\f46f"; } +.bi-link-45deg::before { content: "\f470"; } +.bi-link::before { content: "\f471"; } +.bi-linkedin::before { content: "\f472"; } +.bi-list-check::before { content: "\f473"; } +.bi-list-nested::before { content: "\f474"; } +.bi-list-ol::before { content: "\f475"; } +.bi-list-stars::before { content: "\f476"; } +.bi-list-task::before { content: "\f477"; } +.bi-list-ul::before { content: "\f478"; } +.bi-list::before { content: "\f479"; } +.bi-lock-fill::before { content: "\f47a"; } +.bi-lock::before { content: "\f47b"; } +.bi-mailbox::before { content: "\f47c"; } +.bi-mailbox2::before { content: "\f47d"; } +.bi-map-fill::before { content: "\f47e"; } +.bi-map::before { content: "\f47f"; } +.bi-markdown-fill::before { content: "\f480"; } +.bi-markdown::before { content: "\f481"; } +.bi-mask::before { content: "\f482"; } +.bi-megaphone-fill::before { content: "\f483"; } +.bi-megaphone::before { content: "\f484"; } +.bi-menu-app-fill::before { content: "\f485"; } +.bi-menu-app::before { content: "\f486"; } +.bi-menu-button-fill::before { content: "\f487"; } +.bi-menu-button-wide-fill::before { content: "\f488"; } +.bi-menu-button-wide::before { content: "\f489"; } +.bi-menu-button::before { content: "\f48a"; } +.bi-menu-down::before { content: "\f48b"; } +.bi-menu-up::before { content: "\f48c"; } +.bi-mic-fill::before { content: "\f48d"; } +.bi-mic-mute-fill::before { content: "\f48e"; } +.bi-mic-mute::before { content: "\f48f"; } +.bi-mic::before { content: "\f490"; } +.bi-minecart-loaded::before { content: "\f491"; } +.bi-minecart::before { content: "\f492"; } +.bi-moisture::before { content: "\f493"; } +.bi-moon-fill::before { content: "\f494"; } +.bi-moon-stars-fill::before { content: "\f495"; } +.bi-moon-stars::before { content: "\f496"; } +.bi-moon::before { content: "\f497"; } +.bi-mouse-fill::before { content: "\f498"; } +.bi-mouse::before { content: "\f499"; } +.bi-mouse2-fill::before { content: "\f49a"; } +.bi-mouse2::before { content: "\f49b"; } +.bi-mouse3-fill::before { content: "\f49c"; } +.bi-mouse3::before { content: "\f49d"; } +.bi-music-note-beamed::before { content: "\f49e"; } +.bi-music-note-list::before { content: "\f49f"; } +.bi-music-note::before { content: "\f4a0"; } +.bi-music-player-fill::before { content: "\f4a1"; } +.bi-music-player::before { content: "\f4a2"; } +.bi-newspaper::before { content: "\f4a3"; } +.bi-node-minus-fill::before { content: "\f4a4"; } +.bi-node-minus::before { content: "\f4a5"; } +.bi-node-plus-fill::before { content: "\f4a6"; } +.bi-node-plus::before { content: "\f4a7"; } +.bi-nut-fill::before { content: "\f4a8"; } +.bi-nut::before { content: "\f4a9"; } +.bi-octagon-fill::before { content: "\f4aa"; } +.bi-octagon-half::before { content: "\f4ab"; } +.bi-octagon::before { content: "\f4ac"; } +.bi-option::before { content: "\f4ad"; } +.bi-outlet::before { content: "\f4ae"; } +.bi-paint-bucket::before { content: "\f4af"; } +.bi-palette-fill::before { content: "\f4b0"; } +.bi-palette::before { content: "\f4b1"; } +.bi-palette2::before { content: "\f4b2"; } +.bi-paperclip::before { content: "\f4b3"; } +.bi-paragraph::before { content: "\f4b4"; } +.bi-patch-check-fill::before { content: "\f4b5"; } +.bi-patch-check::before { content: "\f4b6"; } +.bi-patch-exclamation-fill::before { content: "\f4b7"; } +.bi-patch-exclamation::before { content: "\f4b8"; } +.bi-patch-minus-fill::before { content: "\f4b9"; } +.bi-patch-minus::before { content: "\f4ba"; } +.bi-patch-plus-fill::before { content: "\f4bb"; } +.bi-patch-plus::before { content: "\f4bc"; } +.bi-patch-question-fill::before { content: "\f4bd"; } +.bi-patch-question::before { content: "\f4be"; } +.bi-pause-btn-fill::before { content: "\f4bf"; } +.bi-pause-btn::before { content: "\f4c0"; } +.bi-pause-circle-fill::before { content: "\f4c1"; } +.bi-pause-circle::before { content: "\f4c2"; } +.bi-pause-fill::before { content: "\f4c3"; } +.bi-pause::before { content: "\f4c4"; } +.bi-peace-fill::before { content: "\f4c5"; } +.bi-peace::before { content: "\f4c6"; } +.bi-pen-fill::before { content: "\f4c7"; } +.bi-pen::before { content: "\f4c8"; } +.bi-pencil-fill::before { content: "\f4c9"; } +.bi-pencil-square::before { content: "\f4ca"; } +.bi-pencil::before { content: "\f4cb"; } +.bi-pentagon-fill::before { content: "\f4cc"; } +.bi-pentagon-half::before { content: "\f4cd"; } +.bi-pentagon::before { content: "\f4ce"; } +.bi-people-fill::before { content: "\f4cf"; } +.bi-people::before { content: "\f4d0"; } +.bi-percent::before { content: "\f4d1"; } +.bi-person-badge-fill::before { content: "\f4d2"; } +.bi-person-badge::before { content: "\f4d3"; } +.bi-person-bounding-box::before { content: "\f4d4"; } +.bi-person-check-fill::before { content: "\f4d5"; } +.bi-person-check::before { content: "\f4d6"; } +.bi-person-circle::before { content: "\f4d7"; } +.bi-person-dash-fill::before { content: "\f4d8"; } +.bi-person-dash::before { content: "\f4d9"; } +.bi-person-fill::before { content: "\f4da"; } +.bi-person-lines-fill::before { content: "\f4db"; } +.bi-person-plus-fill::before { content: "\f4dc"; } +.bi-person-plus::before { content: "\f4dd"; } +.bi-person-square::before { content: "\f4de"; } +.bi-person-x-fill::before { content: "\f4df"; } +.bi-person-x::before { content: "\f4e0"; } +.bi-person::before { content: "\f4e1"; } +.bi-phone-fill::before { content: "\f4e2"; } +.bi-phone-landscape-fill::before { content: "\f4e3"; } +.bi-phone-landscape::before { content: "\f4e4"; } +.bi-phone-vibrate-fill::before { content: "\f4e5"; } +.bi-phone-vibrate::before { content: "\f4e6"; } +.bi-phone::before { content: "\f4e7"; } +.bi-pie-chart-fill::before { content: "\f4e8"; } +.bi-pie-chart::before { content: "\f4e9"; } +.bi-pin-angle-fill::before { content: "\f4ea"; } +.bi-pin-angle::before { content: "\f4eb"; } +.bi-pin-fill::before { content: "\f4ec"; } +.bi-pin::before { content: "\f4ed"; } +.bi-pip-fill::before { content: "\f4ee"; } +.bi-pip::before { content: "\f4ef"; } +.bi-play-btn-fill::before { content: "\f4f0"; } +.bi-play-btn::before { content: "\f4f1"; } +.bi-play-circle-fill::before { content: "\f4f2"; } +.bi-play-circle::before { content: "\f4f3"; } +.bi-play-fill::before { content: "\f4f4"; } +.bi-play::before { content: "\f4f5"; } +.bi-plug-fill::before { content: "\f4f6"; } +.bi-plug::before { content: "\f4f7"; } +.bi-plus-circle-dotted::before { content: "\f4f8"; } +.bi-plus-circle-fill::before { content: "\f4f9"; } +.bi-plus-circle::before { content: "\f4fa"; } +.bi-plus-square-dotted::before { content: "\f4fb"; } +.bi-plus-square-fill::before { content: "\f4fc"; } +.bi-plus-square::before { content: "\f4fd"; } +.bi-plus::before { content: "\f4fe"; } +.bi-power::before { content: "\f4ff"; } +.bi-printer-fill::before { content: "\f500"; } +.bi-printer::before { content: "\f501"; } +.bi-puzzle-fill::before { content: "\f502"; } +.bi-puzzle::before { content: "\f503"; } +.bi-question-circle-fill::before { content: "\f504"; } +.bi-question-circle::before { content: "\f505"; } +.bi-question-diamond-fill::before { content: "\f506"; } +.bi-question-diamond::before { content: "\f507"; } +.bi-question-octagon-fill::before { content: "\f508"; } +.bi-question-octagon::before { content: "\f509"; } +.bi-question-square-fill::before { content: "\f50a"; } +.bi-question-square::before { content: "\f50b"; } +.bi-question::before { content: "\f50c"; } +.bi-rainbow::before { content: "\f50d"; } +.bi-receipt-cutoff::before { content: "\f50e"; } +.bi-receipt::before { content: "\f50f"; } +.bi-reception-0::before { content: "\f510"; } +.bi-reception-1::before { content: "\f511"; } +.bi-reception-2::before { content: "\f512"; } +.bi-reception-3::before { content: "\f513"; } +.bi-reception-4::before { content: "\f514"; } +.bi-record-btn-fill::before { content: "\f515"; } +.bi-record-btn::before { content: "\f516"; } +.bi-record-circle-fill::before { content: "\f517"; } +.bi-record-circle::before { content: "\f518"; } +.bi-record-fill::before { content: "\f519"; } +.bi-record::before { content: "\f51a"; } +.bi-record2-fill::before { content: "\f51b"; } +.bi-record2::before { content: "\f51c"; } +.bi-reply-all-fill::before { content: "\f51d"; } +.bi-reply-all::before { content: "\f51e"; } +.bi-reply-fill::before { content: "\f51f"; } +.bi-reply::before { content: "\f520"; } +.bi-rss-fill::before { content: "\f521"; } +.bi-rss::before { content: "\f522"; } +.bi-rulers::before { content: "\f523"; } +.bi-save-fill::before { content: "\f524"; } +.bi-save::before { content: "\f525"; } +.bi-save2-fill::before { content: "\f526"; } +.bi-save2::before { content: "\f527"; } +.bi-scissors::before { content: "\f528"; } +.bi-screwdriver::before { content: "\f529"; } +.bi-search::before { content: "\f52a"; } +.bi-segmented-nav::before { content: "\f52b"; } +.bi-server::before { content: "\f52c"; } +.bi-share-fill::before { content: "\f52d"; } +.bi-share::before { content: "\f52e"; } +.bi-shield-check::before { content: "\f52f"; } +.bi-shield-exclamation::before { content: "\f530"; } +.bi-shield-fill-check::before { content: "\f531"; } +.bi-shield-fill-exclamation::before { content: "\f532"; } +.bi-shield-fill-minus::before { content: "\f533"; } +.bi-shield-fill-plus::before { content: "\f534"; } +.bi-shield-fill-x::before { content: "\f535"; } +.bi-shield-fill::before { content: "\f536"; } +.bi-shield-lock-fill::before { content: "\f537"; } +.bi-shield-lock::before { content: "\f538"; } +.bi-shield-minus::before { content: "\f539"; } +.bi-shield-plus::before { content: "\f53a"; } +.bi-shield-shaded::before { content: "\f53b"; } +.bi-shield-slash-fill::before { content: "\f53c"; } +.bi-shield-slash::before { content: "\f53d"; } +.bi-shield-x::before { content: "\f53e"; } +.bi-shield::before { content: "\f53f"; } +.bi-shift-fill::before { content: "\f540"; } +.bi-shift::before { content: "\f541"; } +.bi-shop-window::before { content: "\f542"; } +.bi-shop::before { content: "\f543"; } +.bi-shuffle::before { content: "\f544"; } +.bi-signpost-2-fill::before { content: "\f545"; } +.bi-signpost-2::before { content: "\f546"; } +.bi-signpost-fill::before { content: "\f547"; } +.bi-signpost-split-fill::before { content: "\f548"; } +.bi-signpost-split::before { content: "\f549"; } +.bi-signpost::before { content: "\f54a"; } +.bi-sim-fill::before { content: "\f54b"; } +.bi-sim::before { content: "\f54c"; } +.bi-skip-backward-btn-fill::before { content: "\f54d"; } +.bi-skip-backward-btn::before { content: "\f54e"; } +.bi-skip-backward-circle-fill::before { content: "\f54f"; } +.bi-skip-backward-circle::before { content: "\f550"; } +.bi-skip-backward-fill::before { content: "\f551"; } +.bi-skip-backward::before { content: "\f552"; } +.bi-skip-end-btn-fill::before { content: "\f553"; } +.bi-skip-end-btn::before { content: "\f554"; } +.bi-skip-end-circle-fill::before { content: "\f555"; } +.bi-skip-end-circle::before { content: "\f556"; } +.bi-skip-end-fill::before { content: "\f557"; } +.bi-skip-end::before { content: "\f558"; } +.bi-skip-forward-btn-fill::before { content: "\f559"; } +.bi-skip-forward-btn::before { content: "\f55a"; } +.bi-skip-forward-circle-fill::before { content: "\f55b"; } +.bi-skip-forward-circle::before { content: "\f55c"; } +.bi-skip-forward-fill::before { content: "\f55d"; } +.bi-skip-forward::before { content: "\f55e"; } +.bi-skip-start-btn-fill::before { content: "\f55f"; } +.bi-skip-start-btn::before { content: "\f560"; } +.bi-skip-start-circle-fill::before { content: "\f561"; } +.bi-skip-start-circle::before { content: "\f562"; } +.bi-skip-start-fill::before { content: "\f563"; } +.bi-skip-start::before { content: "\f564"; } +.bi-slack::before { content: "\f565"; } +.bi-slash-circle-fill::before { content: "\f566"; } +.bi-slash-circle::before { content: "\f567"; } +.bi-slash-square-fill::before { content: "\f568"; } +.bi-slash-square::before { content: "\f569"; } +.bi-slash::before { content: "\f56a"; } +.bi-sliders::before { content: "\f56b"; } +.bi-smartwatch::before { content: "\f56c"; } +.bi-snow::before { content: "\f56d"; } +.bi-snow2::before { content: "\f56e"; } +.bi-snow3::before { content: "\f56f"; } +.bi-sort-alpha-down-alt::before { content: "\f570"; } +.bi-sort-alpha-down::before { content: "\f571"; } +.bi-sort-alpha-up-alt::before { content: "\f572"; } +.bi-sort-alpha-up::before { content: "\f573"; } +.bi-sort-down-alt::before { content: "\f574"; } +.bi-sort-down::before { content: "\f575"; } +.bi-sort-numeric-down-alt::before { content: "\f576"; } +.bi-sort-numeric-down::before { content: "\f577"; } +.bi-sort-numeric-up-alt::before { content: "\f578"; } +.bi-sort-numeric-up::before { content: "\f579"; } +.bi-sort-up-alt::before { content: "\f57a"; } +.bi-sort-up::before { content: "\f57b"; } +.bi-soundwave::before { content: "\f57c"; } +.bi-speaker-fill::before { content: "\f57d"; } +.bi-speaker::before { content: "\f57e"; } +.bi-speedometer::before { content: "\f57f"; } +.bi-speedometer2::before { content: "\f580"; } +.bi-spellcheck::before { content: "\f581"; } +.bi-square-fill::before { content: "\f582"; } +.bi-square-half::before { content: "\f583"; } +.bi-square::before { content: "\f584"; } +.bi-stack::before { content: "\f585"; } +.bi-star-fill::before { content: "\f586"; } +.bi-star-half::before { content: "\f587"; } +.bi-star::before { content: "\f588"; } +.bi-stars::before { content: "\f589"; } +.bi-stickies-fill::before { content: "\f58a"; } +.bi-stickies::before { content: "\f58b"; } +.bi-sticky-fill::before { content: "\f58c"; } +.bi-sticky::before { content: "\f58d"; } +.bi-stop-btn-fill::before { content: "\f58e"; } +.bi-stop-btn::before { content: "\f58f"; } +.bi-stop-circle-fill::before { content: "\f590"; } +.bi-stop-circle::before { content: "\f591"; } +.bi-stop-fill::before { content: "\f592"; } +.bi-stop::before { content: "\f593"; } +.bi-stoplights-fill::before { content: "\f594"; } +.bi-stoplights::before { content: "\f595"; } +.bi-stopwatch-fill::before { content: "\f596"; } +.bi-stopwatch::before { content: "\f597"; } +.bi-subtract::before { content: "\f598"; } +.bi-suit-club-fill::before { content: "\f599"; } +.bi-suit-club::before { content: "\f59a"; } +.bi-suit-diamond-fill::before { content: "\f59b"; } +.bi-suit-diamond::before { content: "\f59c"; } +.bi-suit-heart-fill::before { content: "\f59d"; } +.bi-suit-heart::before { content: "\f59e"; } +.bi-suit-spade-fill::before { content: "\f59f"; } +.bi-suit-spade::before { content: "\f5a0"; } +.bi-sun-fill::before { content: "\f5a1"; } +.bi-sun::before { content: "\f5a2"; } +.bi-sunglasses::before { content: "\f5a3"; } +.bi-sunrise-fill::before { content: "\f5a4"; } +.bi-sunrise::before { content: "\f5a5"; } +.bi-sunset-fill::before { content: "\f5a6"; } +.bi-sunset::before { content: "\f5a7"; } +.bi-symmetry-horizontal::before { content: "\f5a8"; } +.bi-symmetry-vertical::before { content: "\f5a9"; } +.bi-table::before { content: "\f5aa"; } +.bi-tablet-fill::before { content: "\f5ab"; } +.bi-tablet-landscape-fill::before { content: "\f5ac"; } +.bi-tablet-landscape::before { content: "\f5ad"; } +.bi-tablet::before { content: "\f5ae"; } +.bi-tag-fill::before { content: "\f5af"; } +.bi-tag::before { content: "\f5b0"; } +.bi-tags-fill::before { content: "\f5b1"; } +.bi-tags::before { content: "\f5b2"; } +.bi-telegram::before { content: "\f5b3"; } +.bi-telephone-fill::before { content: "\f5b4"; } +.bi-telephone-forward-fill::before { content: "\f5b5"; } +.bi-telephone-forward::before { content: "\f5b6"; } +.bi-telephone-inbound-fill::before { content: "\f5b7"; } +.bi-telephone-inbound::before { content: "\f5b8"; } +.bi-telephone-minus-fill::before { content: "\f5b9"; } +.bi-telephone-minus::before { content: "\f5ba"; } +.bi-telephone-outbound-fill::before { content: "\f5bb"; } +.bi-telephone-outbound::before { content: "\f5bc"; } +.bi-telephone-plus-fill::before { content: "\f5bd"; } +.bi-telephone-plus::before { content: "\f5be"; } +.bi-telephone-x-fill::before { content: "\f5bf"; } +.bi-telephone-x::before { content: "\f5c0"; } +.bi-telephone::before { content: "\f5c1"; } +.bi-terminal-fill::before { content: "\f5c2"; } +.bi-terminal::before { content: "\f5c3"; } +.bi-text-center::before { content: "\f5c4"; } +.bi-text-indent-left::before { content: "\f5c5"; } +.bi-text-indent-right::before { content: "\f5c6"; } +.bi-text-left::before { content: "\f5c7"; } +.bi-text-paragraph::before { content: "\f5c8"; } +.bi-text-right::before { content: "\f5c9"; } +.bi-textarea-resize::before { content: "\f5ca"; } +.bi-textarea-t::before { content: "\f5cb"; } +.bi-textarea::before { content: "\f5cc"; } +.bi-thermometer-half::before { content: "\f5cd"; } +.bi-thermometer-high::before { content: "\f5ce"; } +.bi-thermometer-low::before { content: "\f5cf"; } +.bi-thermometer-snow::before { content: "\f5d0"; } +.bi-thermometer-sun::before { content: "\f5d1"; } +.bi-thermometer::before { content: "\f5d2"; } +.bi-three-dots-vertical::before { content: "\f5d3"; } +.bi-three-dots::before { content: "\f5d4"; } +.bi-toggle-off::before { content: "\f5d5"; } +.bi-toggle-on::before { content: "\f5d6"; } +.bi-toggle2-off::before { content: "\f5d7"; } +.bi-toggle2-on::before { content: "\f5d8"; } +.bi-toggles::before { content: "\f5d9"; } +.bi-toggles2::before { content: "\f5da"; } +.bi-tools::before { content: "\f5db"; } +.bi-tornado::before { content: "\f5dc"; } +.bi-trash-fill::before { content: "\f5dd"; } +.bi-trash::before { content: "\f5de"; } +.bi-trash2-fill::before { content: "\f5df"; } +.bi-trash2::before { content: "\f5e0"; } +.bi-tree-fill::before { content: "\f5e1"; } +.bi-tree::before { content: "\f5e2"; } +.bi-triangle-fill::before { content: "\f5e3"; } +.bi-triangle-half::before { content: "\f5e4"; } +.bi-triangle::before { content: "\f5e5"; } +.bi-trophy-fill::before { content: "\f5e6"; } +.bi-trophy::before { content: "\f5e7"; } +.bi-tropical-storm::before { content: "\f5e8"; } +.bi-truck-flatbed::before { content: "\f5e9"; } +.bi-truck::before { content: "\f5ea"; } +.bi-tsunami::before { content: "\f5eb"; } +.bi-tv-fill::before { content: "\f5ec"; } +.bi-tv::before { content: "\f5ed"; } +.bi-twitch::before { content: "\f5ee"; } +.bi-twitter::before { content: "\f5ef"; } +.bi-type-bold::before { content: "\f5f0"; } +.bi-type-h1::before { content: "\f5f1"; } +.bi-type-h2::before { content: "\f5f2"; } +.bi-type-h3::before { content: "\f5f3"; } +.bi-type-italic::before { content: "\f5f4"; } +.bi-type-strikethrough::before { content: "\f5f5"; } +.bi-type-underline::before { content: "\f5f6"; } +.bi-type::before { content: "\f5f7"; } +.bi-ui-checks-grid::before { content: "\f5f8"; } +.bi-ui-checks::before { content: "\f5f9"; } +.bi-ui-radios-grid::before { content: "\f5fa"; } +.bi-ui-radios::before { content: "\f5fb"; } +.bi-umbrella-fill::before { content: "\f5fc"; } +.bi-umbrella::before { content: "\f5fd"; } +.bi-union::before { content: "\f5fe"; } +.bi-unlock-fill::before { content: "\f5ff"; } +.bi-unlock::before { content: "\f600"; } +.bi-upc-scan::before { content: "\f601"; } +.bi-upc::before { content: "\f602"; } +.bi-upload::before { content: "\f603"; } +.bi-vector-pen::before { content: "\f604"; } +.bi-view-list::before { content: "\f605"; } +.bi-view-stacked::before { content: "\f606"; } +.bi-vinyl-fill::before { content: "\f607"; } +.bi-vinyl::before { content: "\f608"; } +.bi-voicemail::before { content: "\f609"; } +.bi-volume-down-fill::before { content: "\f60a"; } +.bi-volume-down::before { content: "\f60b"; } +.bi-volume-mute-fill::before { content: "\f60c"; } +.bi-volume-mute::before { content: "\f60d"; } +.bi-volume-off-fill::before { content: "\f60e"; } +.bi-volume-off::before { content: "\f60f"; } +.bi-volume-up-fill::before { content: "\f610"; } +.bi-volume-up::before { content: "\f611"; } +.bi-vr::before { content: "\f612"; } +.bi-wallet-fill::before { content: "\f613"; } +.bi-wallet::before { content: "\f614"; } +.bi-wallet2::before { content: "\f615"; } +.bi-watch::before { content: "\f616"; } +.bi-water::before { content: "\f617"; } +.bi-whatsapp::before { content: "\f618"; } +.bi-wifi-1::before { content: "\f619"; } +.bi-wifi-2::before { content: "\f61a"; } +.bi-wifi-off::before { content: "\f61b"; } +.bi-wifi::before { content: "\f61c"; } +.bi-wind::before { content: "\f61d"; } +.bi-window-dock::before { content: "\f61e"; } +.bi-window-sidebar::before { content: "\f61f"; } +.bi-window::before { content: "\f620"; } +.bi-wrench::before { content: "\f621"; } +.bi-x-circle-fill::before { content: "\f622"; } +.bi-x-circle::before { content: "\f623"; } +.bi-x-diamond-fill::before { content: "\f624"; } +.bi-x-diamond::before { content: "\f625"; } +.bi-x-octagon-fill::before { content: "\f626"; } +.bi-x-octagon::before { content: "\f627"; } +.bi-x-square-fill::before { content: "\f628"; } +.bi-x-square::before { content: "\f629"; } +.bi-x::before { content: "\f62a"; } +.bi-youtube::before { content: "\f62b"; } +.bi-zoom-in::before { content: "\f62c"; } +.bi-zoom-out::before { content: "\f62d"; } +.bi-bank::before { content: "\f62e"; } +.bi-bank2::before { content: "\f62f"; } +.bi-bell-slash-fill::before { content: "\f630"; } +.bi-bell-slash::before { content: "\f631"; } +.bi-cash-coin::before { content: "\f632"; } +.bi-check-lg::before { content: "\f633"; } +.bi-coin::before { content: "\f634"; } +.bi-currency-bitcoin::before { content: "\f635"; } +.bi-currency-dollar::before { content: "\f636"; } +.bi-currency-euro::before { content: "\f637"; } +.bi-currency-exchange::before { content: "\f638"; } +.bi-currency-pound::before { content: "\f639"; } +.bi-currency-yen::before { content: "\f63a"; } +.bi-dash-lg::before { content: "\f63b"; } +.bi-exclamation-lg::before { content: "\f63c"; } +.bi-file-earmark-pdf-fill::before { content: "\f63d"; } +.bi-file-earmark-pdf::before { content: "\f63e"; } +.bi-file-pdf-fill::before { content: "\f63f"; } +.bi-file-pdf::before { content: "\f640"; } +.bi-gender-ambiguous::before { content: "\f641"; } +.bi-gender-female::before { content: "\f642"; } +.bi-gender-male::before { content: "\f643"; } +.bi-gender-trans::before { content: "\f644"; } +.bi-headset-vr::before { content: "\f645"; } +.bi-info-lg::before { content: "\f646"; } +.bi-mastodon::before { content: "\f647"; } +.bi-messenger::before { content: "\f648"; } +.bi-piggy-bank-fill::before { content: "\f649"; } +.bi-piggy-bank::before { content: "\f64a"; } +.bi-pin-map-fill::before { content: "\f64b"; } +.bi-pin-map::before { content: "\f64c"; } +.bi-plus-lg::before { content: "\f64d"; } +.bi-question-lg::before { content: "\f64e"; } +.bi-recycle::before { content: "\f64f"; } +.bi-reddit::before { content: "\f650"; } +.bi-safe-fill::before { content: "\f651"; } +.bi-safe2-fill::before { content: "\f652"; } +.bi-safe2::before { content: "\f653"; } +.bi-sd-card-fill::before { content: "\f654"; } +.bi-sd-card::before { content: "\f655"; } +.bi-skype::before { content: "\f656"; } +.bi-slash-lg::before { content: "\f657"; } +.bi-translate::before { content: "\f658"; } +.bi-x-lg::before { content: "\f659"; } +.bi-safe::before { content: "\f65a"; } +.bi-apple::before { content: "\f65b"; } +.bi-microsoft::before { content: "\f65d"; } +.bi-windows::before { content: "\f65e"; } +.bi-behance::before { content: "\f65c"; } +.bi-dribbble::before { content: "\f65f"; } +.bi-line::before { content: "\f660"; } +.bi-medium::before { content: "\f661"; } +.bi-paypal::before { content: "\f662"; } +.bi-pinterest::before { content: "\f663"; } +.bi-signal::before { content: "\f664"; } +.bi-snapchat::before { content: "\f665"; } +.bi-spotify::before { content: "\f666"; } +.bi-stack-overflow::before { content: "\f667"; } +.bi-strava::before { content: "\f668"; } +.bi-wordpress::before { content: "\f669"; } +.bi-vimeo::before { content: "\f66a"; } +.bi-activity::before { content: "\f66b"; } +.bi-easel2-fill::before { content: "\f66c"; } +.bi-easel2::before { content: "\f66d"; } +.bi-easel3-fill::before { content: "\f66e"; } +.bi-easel3::before { content: "\f66f"; } +.bi-fan::before { content: "\f670"; } +.bi-fingerprint::before { content: "\f671"; } +.bi-graph-down-arrow::before { content: "\f672"; } +.bi-graph-up-arrow::before { content: "\f673"; } +.bi-hypnotize::before { content: "\f674"; } +.bi-magic::before { content: "\f675"; } +.bi-person-rolodex::before { content: "\f676"; } +.bi-person-video::before { content: "\f677"; } +.bi-person-video2::before { content: "\f678"; } +.bi-person-video3::before { content: "\f679"; } +.bi-person-workspace::before { content: "\f67a"; } +.bi-radioactive::before { content: "\f67b"; } +.bi-webcam-fill::before { content: "\f67c"; } +.bi-webcam::before { content: "\f67d"; } +.bi-yin-yang::before { content: "\f67e"; } +.bi-bandaid-fill::before { content: "\f680"; } +.bi-bandaid::before { content: "\f681"; } +.bi-bluetooth::before { content: "\f682"; } +.bi-body-text::before { content: "\f683"; } +.bi-boombox::before { content: "\f684"; } +.bi-boxes::before { content: "\f685"; } +.bi-dpad-fill::before { content: "\f686"; } +.bi-dpad::before { content: "\f687"; } +.bi-ear-fill::before { content: "\f688"; } +.bi-ear::before { content: "\f689"; } +.bi-envelope-check-fill::before { content: "\f68b"; } +.bi-envelope-check::before { content: "\f68c"; } +.bi-envelope-dash-fill::before { content: "\f68e"; } +.bi-envelope-dash::before { content: "\f68f"; } +.bi-envelope-exclamation-fill::before { content: "\f691"; } +.bi-envelope-exclamation::before { content: "\f692"; } +.bi-envelope-plus-fill::before { content: "\f693"; } +.bi-envelope-plus::before { content: "\f694"; } +.bi-envelope-slash-fill::before { content: "\f696"; } +.bi-envelope-slash::before { content: "\f697"; } +.bi-envelope-x-fill::before { content: "\f699"; } +.bi-envelope-x::before { content: "\f69a"; } +.bi-explicit-fill::before { content: "\f69b"; } +.bi-explicit::before { content: "\f69c"; } +.bi-git::before { content: "\f69d"; } +.bi-infinity::before { content: "\f69e"; } +.bi-list-columns-reverse::before { content: "\f69f"; } +.bi-list-columns::before { content: "\f6a0"; } +.bi-meta::before { content: "\f6a1"; } +.bi-nintendo-switch::before { content: "\f6a4"; } +.bi-pc-display-horizontal::before { content: "\f6a5"; } +.bi-pc-display::before { content: "\f6a6"; } +.bi-pc-horizontal::before { content: "\f6a7"; } +.bi-pc::before { content: "\f6a8"; } +.bi-playstation::before { content: "\f6a9"; } +.bi-plus-slash-minus::before { content: "\f6aa"; } +.bi-projector-fill::before { content: "\f6ab"; } +.bi-projector::before { content: "\f6ac"; } +.bi-qr-code-scan::before { content: "\f6ad"; } +.bi-qr-code::before { content: "\f6ae"; } +.bi-quora::before { content: "\f6af"; } +.bi-quote::before { content: "\f6b0"; } +.bi-robot::before { content: "\f6b1"; } +.bi-send-check-fill::before { content: "\f6b2"; } +.bi-send-check::before { content: "\f6b3"; } +.bi-send-dash-fill::before { content: "\f6b4"; } +.bi-send-dash::before { content: "\f6b5"; } +.bi-send-exclamation-fill::before { content: "\f6b7"; } +.bi-send-exclamation::before { content: "\f6b8"; } +.bi-send-fill::before { content: "\f6b9"; } +.bi-send-plus-fill::before { content: "\f6ba"; } +.bi-send-plus::before { content: "\f6bb"; } +.bi-send-slash-fill::before { content: "\f6bc"; } +.bi-send-slash::before { content: "\f6bd"; } +.bi-send-x-fill::before { content: "\f6be"; } +.bi-send-x::before { content: "\f6bf"; } +.bi-send::before { content: "\f6c0"; } +.bi-steam::before { content: "\f6c1"; } +.bi-terminal-dash::before { content: "\f6c3"; } +.bi-terminal-plus::before { content: "\f6c4"; } +.bi-terminal-split::before { content: "\f6c5"; } +.bi-ticket-detailed-fill::before { content: "\f6c6"; } +.bi-ticket-detailed::before { content: "\f6c7"; } +.bi-ticket-fill::before { content: "\f6c8"; } +.bi-ticket-perforated-fill::before { content: "\f6c9"; } +.bi-ticket-perforated::before { content: "\f6ca"; } +.bi-ticket::before { content: "\f6cb"; } +.bi-tiktok::before { content: "\f6cc"; } +.bi-window-dash::before { content: "\f6cd"; } +.bi-window-desktop::before { content: "\f6ce"; } +.bi-window-fullscreen::before { content: "\f6cf"; } +.bi-window-plus::before { content: "\f6d0"; } +.bi-window-split::before { content: "\f6d1"; } +.bi-window-stack::before { content: "\f6d2"; } +.bi-window-x::before { content: "\f6d3"; } +.bi-xbox::before { content: "\f6d4"; } +.bi-ethernet::before { content: "\f6d5"; } +.bi-hdmi-fill::before { content: "\f6d6"; } +.bi-hdmi::before { content: "\f6d7"; } +.bi-usb-c-fill::before { content: "\f6d8"; } +.bi-usb-c::before { content: "\f6d9"; } +.bi-usb-fill::before { content: "\f6da"; } +.bi-usb-plug-fill::before { content: "\f6db"; } +.bi-usb-plug::before { content: "\f6dc"; } +.bi-usb-symbol::before { content: "\f6dd"; } +.bi-usb::before { content: "\f6de"; } +.bi-boombox-fill::before { content: "\f6df"; } +.bi-displayport::before { content: "\f6e1"; } +.bi-gpu-card::before { content: "\f6e2"; } +.bi-memory::before { content: "\f6e3"; } +.bi-modem-fill::before { content: "\f6e4"; } +.bi-modem::before { content: "\f6e5"; } +.bi-motherboard-fill::before { content: "\f6e6"; } +.bi-motherboard::before { content: "\f6e7"; } +.bi-optical-audio-fill::before { content: "\f6e8"; } +.bi-optical-audio::before { content: "\f6e9"; } +.bi-pci-card::before { content: "\f6ea"; } +.bi-router-fill::before { content: "\f6eb"; } +.bi-router::before { content: "\f6ec"; } +.bi-thunderbolt-fill::before { content: "\f6ef"; } +.bi-thunderbolt::before { content: "\f6f0"; } +.bi-usb-drive-fill::before { content: "\f6f1"; } +.bi-usb-drive::before { content: "\f6f2"; } +.bi-usb-micro-fill::before { content: "\f6f3"; } +.bi-usb-micro::before { content: "\f6f4"; } +.bi-usb-mini-fill::before { content: "\f6f5"; } +.bi-usb-mini::before { content: "\f6f6"; } +.bi-cloud-haze2::before { content: "\f6f7"; } +.bi-device-hdd-fill::before { content: "\f6f8"; } +.bi-device-hdd::before { content: "\f6f9"; } +.bi-device-ssd-fill::before { content: "\f6fa"; } +.bi-device-ssd::before { content: "\f6fb"; } +.bi-displayport-fill::before { content: "\f6fc"; } +.bi-mortarboard-fill::before { content: "\f6fd"; } +.bi-mortarboard::before { content: "\f6fe"; } +.bi-terminal-x::before { content: "\f6ff"; } +.bi-arrow-through-heart-fill::before { content: "\f700"; } +.bi-arrow-through-heart::before { content: "\f701"; } +.bi-badge-sd-fill::before { content: "\f702"; } +.bi-badge-sd::before { content: "\f703"; } +.bi-bag-heart-fill::before { content: "\f704"; } +.bi-bag-heart::before { content: "\f705"; } +.bi-balloon-fill::before { content: "\f706"; } +.bi-balloon-heart-fill::before { content: "\f707"; } +.bi-balloon-heart::before { content: "\f708"; } +.bi-balloon::before { content: "\f709"; } +.bi-box2-fill::before { content: "\f70a"; } +.bi-box2-heart-fill::before { content: "\f70b"; } +.bi-box2-heart::before { content: "\f70c"; } +.bi-box2::before { content: "\f70d"; } +.bi-braces-asterisk::before { content: "\f70e"; } +.bi-calendar-heart-fill::before { content: "\f70f"; } +.bi-calendar-heart::before { content: "\f710"; } +.bi-calendar2-heart-fill::before { content: "\f711"; } +.bi-calendar2-heart::before { content: "\f712"; } +.bi-chat-heart-fill::before { content: "\f713"; } +.bi-chat-heart::before { content: "\f714"; } +.bi-chat-left-heart-fill::before { content: "\f715"; } +.bi-chat-left-heart::before { content: "\f716"; } +.bi-chat-right-heart-fill::before { content: "\f717"; } +.bi-chat-right-heart::before { content: "\f718"; } +.bi-chat-square-heart-fill::before { content: "\f719"; } +.bi-chat-square-heart::before { content: "\f71a"; } +.bi-clipboard-check-fill::before { content: "\f71b"; } +.bi-clipboard-data-fill::before { content: "\f71c"; } +.bi-clipboard-fill::before { content: "\f71d"; } +.bi-clipboard-heart-fill::before { content: "\f71e"; } +.bi-clipboard-heart::before { content: "\f71f"; } +.bi-clipboard-minus-fill::before { content: "\f720"; } +.bi-clipboard-plus-fill::before { content: "\f721"; } +.bi-clipboard-pulse::before { content: "\f722"; } +.bi-clipboard-x-fill::before { content: "\f723"; } +.bi-clipboard2-check-fill::before { content: "\f724"; } +.bi-clipboard2-check::before { content: "\f725"; } +.bi-clipboard2-data-fill::before { content: "\f726"; } +.bi-clipboard2-data::before { content: "\f727"; } +.bi-clipboard2-fill::before { content: "\f728"; } +.bi-clipboard2-heart-fill::before { content: "\f729"; } +.bi-clipboard2-heart::before { content: "\f72a"; } +.bi-clipboard2-minus-fill::before { content: "\f72b"; } +.bi-clipboard2-minus::before { content: "\f72c"; } +.bi-clipboard2-plus-fill::before { content: "\f72d"; } +.bi-clipboard2-plus::before { content: "\f72e"; } +.bi-clipboard2-pulse-fill::before { content: "\f72f"; } +.bi-clipboard2-pulse::before { content: "\f730"; } +.bi-clipboard2-x-fill::before { content: "\f731"; } +.bi-clipboard2-x::before { content: "\f732"; } +.bi-clipboard2::before { content: "\f733"; } +.bi-emoji-kiss-fill::before { content: "\f734"; } +.bi-emoji-kiss::before { content: "\f735"; } +.bi-envelope-heart-fill::before { content: "\f736"; } +.bi-envelope-heart::before { content: "\f737"; } +.bi-envelope-open-heart-fill::before { content: "\f738"; } +.bi-envelope-open-heart::before { content: "\f739"; } +.bi-envelope-paper-fill::before { content: "\f73a"; } +.bi-envelope-paper-heart-fill::before { content: "\f73b"; } +.bi-envelope-paper-heart::before { content: "\f73c"; } +.bi-envelope-paper::before { content: "\f73d"; } +.bi-filetype-aac::before { content: "\f73e"; } +.bi-filetype-ai::before { content: "\f73f"; } +.bi-filetype-bmp::before { content: "\f740"; } +.bi-filetype-cs::before { content: "\f741"; } +.bi-filetype-css::before { content: "\f742"; } +.bi-filetype-csv::before { content: "\f743"; } +.bi-filetype-doc::before { content: "\f744"; } +.bi-filetype-docx::before { content: "\f745"; } +.bi-filetype-exe::before { content: "\f746"; } +.bi-filetype-gif::before { content: "\f747"; } +.bi-filetype-heic::before { content: "\f748"; } +.bi-filetype-html::before { content: "\f749"; } +.bi-filetype-java::before { content: "\f74a"; } +.bi-filetype-jpg::before { content: "\f74b"; } +.bi-filetype-js::before { content: "\f74c"; } +.bi-filetype-jsx::before { content: "\f74d"; } +.bi-filetype-key::before { content: "\f74e"; } +.bi-filetype-m4p::before { content: "\f74f"; } +.bi-filetype-md::before { content: "\f750"; } +.bi-filetype-mdx::before { content: "\f751"; } +.bi-filetype-mov::before { content: "\f752"; } +.bi-filetype-mp3::before { content: "\f753"; } +.bi-filetype-mp4::before { content: "\f754"; } +.bi-filetype-otf::before { content: "\f755"; } +.bi-filetype-pdf::before { content: "\f756"; } +.bi-filetype-php::before { content: "\f757"; } +.bi-filetype-png::before { content: "\f758"; } +.bi-filetype-ppt::before { content: "\f75a"; } +.bi-filetype-psd::before { content: "\f75b"; } +.bi-filetype-py::before { content: "\f75c"; } +.bi-filetype-raw::before { content: "\f75d"; } +.bi-filetype-rb::before { content: "\f75e"; } +.bi-filetype-sass::before { content: "\f75f"; } +.bi-filetype-scss::before { content: "\f760"; } +.bi-filetype-sh::before { content: "\f761"; } +.bi-filetype-svg::before { content: "\f762"; } +.bi-filetype-tiff::before { content: "\f763"; } +.bi-filetype-tsx::before { content: "\f764"; } +.bi-filetype-ttf::before { content: "\f765"; } +.bi-filetype-txt::before { content: "\f766"; } +.bi-filetype-wav::before { content: "\f767"; } +.bi-filetype-woff::before { content: "\f768"; } +.bi-filetype-xls::before { content: "\f76a"; } +.bi-filetype-xml::before { content: "\f76b"; } +.bi-filetype-yml::before { content: "\f76c"; } +.bi-heart-arrow::before { content: "\f76d"; } +.bi-heart-pulse-fill::before { content: "\f76e"; } +.bi-heart-pulse::before { content: "\f76f"; } +.bi-heartbreak-fill::before { content: "\f770"; } +.bi-heartbreak::before { content: "\f771"; } +.bi-hearts::before { content: "\f772"; } +.bi-hospital-fill::before { content: "\f773"; } +.bi-hospital::before { content: "\f774"; } +.bi-house-heart-fill::before { content: "\f775"; } +.bi-house-heart::before { content: "\f776"; } +.bi-incognito::before { content: "\f777"; } +.bi-magnet-fill::before { content: "\f778"; } +.bi-magnet::before { content: "\f779"; } +.bi-person-heart::before { content: "\f77a"; } +.bi-person-hearts::before { content: "\f77b"; } +.bi-phone-flip::before { content: "\f77c"; } +.bi-plugin::before { content: "\f77d"; } +.bi-postage-fill::before { content: "\f77e"; } +.bi-postage-heart-fill::before { content: "\f77f"; } +.bi-postage-heart::before { content: "\f780"; } +.bi-postage::before { content: "\f781"; } +.bi-postcard-fill::before { content: "\f782"; } +.bi-postcard-heart-fill::before { content: "\f783"; } +.bi-postcard-heart::before { content: "\f784"; } +.bi-postcard::before { content: "\f785"; } +.bi-search-heart-fill::before { content: "\f786"; } +.bi-search-heart::before { content: "\f787"; } +.bi-sliders2-vertical::before { content: "\f788"; } +.bi-sliders2::before { content: "\f789"; } +.bi-trash3-fill::before { content: "\f78a"; } +.bi-trash3::before { content: "\f78b"; } +.bi-valentine::before { content: "\f78c"; } +.bi-valentine2::before { content: "\f78d"; } +.bi-wrench-adjustable-circle-fill::before { content: "\f78e"; } +.bi-wrench-adjustable-circle::before { content: "\f78f"; } +.bi-wrench-adjustable::before { content: "\f790"; } +.bi-filetype-json::before { content: "\f791"; } +.bi-filetype-pptx::before { content: "\f792"; } +.bi-filetype-xlsx::before { content: "\f793"; } +.bi-1-circle-fill::before { content: "\f796"; } +.bi-1-circle::before { content: "\f797"; } +.bi-1-square-fill::before { content: "\f798"; } +.bi-1-square::before { content: "\f799"; } +.bi-2-circle-fill::before { content: "\f79c"; } +.bi-2-circle::before { content: "\f79d"; } +.bi-2-square-fill::before { content: "\f79e"; } +.bi-2-square::before { content: "\f79f"; } +.bi-3-circle-fill::before { content: "\f7a2"; } +.bi-3-circle::before { content: "\f7a3"; } +.bi-3-square-fill::before { content: "\f7a4"; } +.bi-3-square::before { content: "\f7a5"; } +.bi-4-circle-fill::before { content: "\f7a8"; } +.bi-4-circle::before { content: "\f7a9"; } +.bi-4-square-fill::before { content: "\f7aa"; } +.bi-4-square::before { content: "\f7ab"; } +.bi-5-circle-fill::before { content: "\f7ae"; } +.bi-5-circle::before { content: "\f7af"; } +.bi-5-square-fill::before { content: "\f7b0"; } +.bi-5-square::before { content: "\f7b1"; } +.bi-6-circle-fill::before { content: "\f7b4"; } +.bi-6-circle::before { content: "\f7b5"; } +.bi-6-square-fill::before { content: "\f7b6"; } +.bi-6-square::before { content: "\f7b7"; } +.bi-7-circle-fill::before { content: "\f7ba"; } +.bi-7-circle::before { content: "\f7bb"; } +.bi-7-square-fill::before { content: "\f7bc"; } +.bi-7-square::before { content: "\f7bd"; } +.bi-8-circle-fill::before { content: "\f7c0"; } +.bi-8-circle::before { content: "\f7c1"; } +.bi-8-square-fill::before { content: "\f7c2"; } +.bi-8-square::before { content: "\f7c3"; } +.bi-9-circle-fill::before { content: "\f7c6"; } +.bi-9-circle::before { content: "\f7c7"; } +.bi-9-square-fill::before { content: "\f7c8"; } +.bi-9-square::before { content: "\f7c9"; } +.bi-airplane-engines-fill::before { content: "\f7ca"; } +.bi-airplane-engines::before { content: "\f7cb"; } +.bi-airplane-fill::before { content: "\f7cc"; } +.bi-airplane::before { content: "\f7cd"; } +.bi-alexa::before { content: "\f7ce"; } +.bi-alipay::before { content: "\f7cf"; } +.bi-android::before { content: "\f7d0"; } +.bi-android2::before { content: "\f7d1"; } +.bi-box-fill::before { content: "\f7d2"; } +.bi-box-seam-fill::before { content: "\f7d3"; } +.bi-browser-chrome::before { content: "\f7d4"; } +.bi-browser-edge::before { content: "\f7d5"; } +.bi-browser-firefox::before { content: "\f7d6"; } +.bi-browser-safari::before { content: "\f7d7"; } +.bi-c-circle-fill::before { content: "\f7da"; } +.bi-c-circle::before { content: "\f7db"; } +.bi-c-square-fill::before { content: "\f7dc"; } +.bi-c-square::before { content: "\f7dd"; } +.bi-capsule-pill::before { content: "\f7de"; } +.bi-capsule::before { content: "\f7df"; } +.bi-car-front-fill::before { content: "\f7e0"; } +.bi-car-front::before { content: "\f7e1"; } +.bi-cassette-fill::before { content: "\f7e2"; } +.bi-cassette::before { content: "\f7e3"; } +.bi-cc-circle-fill::before { content: "\f7e6"; } +.bi-cc-circle::before { content: "\f7e7"; } +.bi-cc-square-fill::before { content: "\f7e8"; } +.bi-cc-square::before { content: "\f7e9"; } +.bi-cup-hot-fill::before { content: "\f7ea"; } +.bi-cup-hot::before { content: "\f7eb"; } +.bi-currency-rupee::before { content: "\f7ec"; } +.bi-dropbox::before { content: "\f7ed"; } +.bi-escape::before { content: "\f7ee"; } +.bi-fast-forward-btn-fill::before { content: "\f7ef"; } +.bi-fast-forward-btn::before { content: "\f7f0"; } +.bi-fast-forward-circle-fill::before { content: "\f7f1"; } +.bi-fast-forward-circle::before { content: "\f7f2"; } +.bi-fast-forward-fill::before { content: "\f7f3"; } +.bi-fast-forward::before { content: "\f7f4"; } +.bi-filetype-sql::before { content: "\f7f5"; } +.bi-fire::before { content: "\f7f6"; } +.bi-google-play::before { content: "\f7f7"; } +.bi-h-circle-fill::before { content: "\f7fa"; } +.bi-h-circle::before { content: "\f7fb"; } +.bi-h-square-fill::before { content: "\f7fc"; } +.bi-h-square::before { content: "\f7fd"; } +.bi-indent::before { content: "\f7fe"; } +.bi-lungs-fill::before { content: "\f7ff"; } +.bi-lungs::before { content: "\f800"; } +.bi-microsoft-teams::before { content: "\f801"; } +.bi-p-circle-fill::before { content: "\f804"; } +.bi-p-circle::before { content: "\f805"; } +.bi-p-square-fill::before { content: "\f806"; } +.bi-p-square::before { content: "\f807"; } +.bi-pass-fill::before { content: "\f808"; } +.bi-pass::before { content: "\f809"; } +.bi-prescription::before { content: "\f80a"; } +.bi-prescription2::before { content: "\f80b"; } +.bi-r-circle-fill::before { content: "\f80e"; } +.bi-r-circle::before { content: "\f80f"; } +.bi-r-square-fill::before { content: "\f810"; } +.bi-r-square::before { content: "\f811"; } +.bi-repeat-1::before { content: "\f812"; } +.bi-repeat::before { content: "\f813"; } +.bi-rewind-btn-fill::before { content: "\f814"; } +.bi-rewind-btn::before { content: "\f815"; } +.bi-rewind-circle-fill::before { content: "\f816"; } +.bi-rewind-circle::before { content: "\f817"; } +.bi-rewind-fill::before { content: "\f818"; } +.bi-rewind::before { content: "\f819"; } +.bi-train-freight-front-fill::before { content: "\f81a"; } +.bi-train-freight-front::before { content: "\f81b"; } +.bi-train-front-fill::before { content: "\f81c"; } +.bi-train-front::before { content: "\f81d"; } +.bi-train-lightrail-front-fill::before { content: "\f81e"; } +.bi-train-lightrail-front::before { content: "\f81f"; } +.bi-truck-front-fill::before { content: "\f820"; } +.bi-truck-front::before { content: "\f821"; } +.bi-ubuntu::before { content: "\f822"; } +.bi-unindent::before { content: "\f823"; } +.bi-unity::before { content: "\f824"; } +.bi-universal-access-circle::before { content: "\f825"; } +.bi-universal-access::before { content: "\f826"; } +.bi-virus::before { content: "\f827"; } +.bi-virus2::before { content: "\f828"; } +.bi-wechat::before { content: "\f829"; } +.bi-yelp::before { content: "\f82a"; } +.bi-sign-stop-fill::before { content: "\f82b"; } +.bi-sign-stop-lights-fill::before { content: "\f82c"; } +.bi-sign-stop-lights::before { content: "\f82d"; } +.bi-sign-stop::before { content: "\f82e"; } +.bi-sign-turn-left-fill::before { content: "\f82f"; } +.bi-sign-turn-left::before { content: "\f830"; } +.bi-sign-turn-right-fill::before { content: "\f831"; } +.bi-sign-turn-right::before { content: "\f832"; } +.bi-sign-turn-slight-left-fill::before { content: "\f833"; } +.bi-sign-turn-slight-left::before { content: "\f834"; } +.bi-sign-turn-slight-right-fill::before { content: "\f835"; } +.bi-sign-turn-slight-right::before { content: "\f836"; } +.bi-sign-yield-fill::before { content: "\f837"; } +.bi-sign-yield::before { content: "\f838"; } +.bi-ev-station-fill::before { content: "\f839"; } +.bi-ev-station::before { content: "\f83a"; } +.bi-fuel-pump-diesel-fill::before { content: "\f83b"; } +.bi-fuel-pump-diesel::before { content: "\f83c"; } +.bi-fuel-pump-fill::before { content: "\f83d"; } +.bi-fuel-pump::before { content: "\f83e"; } +.bi-0-circle-fill::before { content: "\f83f"; } +.bi-0-circle::before { content: "\f840"; } +.bi-0-square-fill::before { content: "\f841"; } +.bi-0-square::before { content: "\f842"; } +.bi-rocket-fill::before { content: "\f843"; } +.bi-rocket-takeoff-fill::before { content: "\f844"; } +.bi-rocket-takeoff::before { content: "\f845"; } +.bi-rocket::before { content: "\f846"; } +.bi-stripe::before { content: "\f847"; } +.bi-subscript::before { content: "\f848"; } +.bi-superscript::before { content: "\f849"; } +.bi-trello::before { content: "\f84a"; } +.bi-envelope-at-fill::before { content: "\f84b"; } +.bi-envelope-at::before { content: "\f84c"; } +.bi-regex::before { content: "\f84d"; } +.bi-text-wrap::before { content: "\f84e"; } +.bi-sign-dead-end-fill::before { content: "\f84f"; } +.bi-sign-dead-end::before { content: "\f850"; } +.bi-sign-do-not-enter-fill::before { content: "\f851"; } +.bi-sign-do-not-enter::before { content: "\f852"; } +.bi-sign-intersection-fill::before { content: "\f853"; } +.bi-sign-intersection-side-fill::before { content: "\f854"; } +.bi-sign-intersection-side::before { content: "\f855"; } +.bi-sign-intersection-t-fill::before { content: "\f856"; } +.bi-sign-intersection-t::before { content: "\f857"; } +.bi-sign-intersection-y-fill::before { content: "\f858"; } +.bi-sign-intersection-y::before { content: "\f859"; } +.bi-sign-intersection::before { content: "\f85a"; } +.bi-sign-merge-left-fill::before { content: "\f85b"; } +.bi-sign-merge-left::before { content: "\f85c"; } +.bi-sign-merge-right-fill::before { content: "\f85d"; } +.bi-sign-merge-right::before { content: "\f85e"; } +.bi-sign-no-left-turn-fill::before { content: "\f85f"; } +.bi-sign-no-left-turn::before { content: "\f860"; } +.bi-sign-no-parking-fill::before { content: "\f861"; } +.bi-sign-no-parking::before { content: "\f862"; } +.bi-sign-no-right-turn-fill::before { content: "\f863"; } +.bi-sign-no-right-turn::before { content: "\f864"; } +.bi-sign-railroad-fill::before { content: "\f865"; } +.bi-sign-railroad::before { content: "\f866"; } +.bi-building-add::before { content: "\f867"; } +.bi-building-check::before { content: "\f868"; } +.bi-building-dash::before { content: "\f869"; } +.bi-building-down::before { content: "\f86a"; } +.bi-building-exclamation::before { content: "\f86b"; } +.bi-building-fill-add::before { content: "\f86c"; } +.bi-building-fill-check::before { content: "\f86d"; } +.bi-building-fill-dash::before { content: "\f86e"; } +.bi-building-fill-down::before { content: "\f86f"; } +.bi-building-fill-exclamation::before { content: "\f870"; } +.bi-building-fill-gear::before { content: "\f871"; } +.bi-building-fill-lock::before { content: "\f872"; } +.bi-building-fill-slash::before { content: "\f873"; } +.bi-building-fill-up::before { content: "\f874"; } +.bi-building-fill-x::before { content: "\f875"; } +.bi-building-fill::before { content: "\f876"; } +.bi-building-gear::before { content: "\f877"; } +.bi-building-lock::before { content: "\f878"; } +.bi-building-slash::before { content: "\f879"; } +.bi-building-up::before { content: "\f87a"; } +.bi-building-x::before { content: "\f87b"; } +.bi-buildings-fill::before { content: "\f87c"; } +.bi-buildings::before { content: "\f87d"; } +.bi-bus-front-fill::before { content: "\f87e"; } +.bi-bus-front::before { content: "\f87f"; } +.bi-ev-front-fill::before { content: "\f880"; } +.bi-ev-front::before { content: "\f881"; } +.bi-globe-americas::before { content: "\f882"; } +.bi-globe-asia-australia::before { content: "\f883"; } +.bi-globe-central-south-asia::before { content: "\f884"; } +.bi-globe-europe-africa::before { content: "\f885"; } +.bi-house-add-fill::before { content: "\f886"; } +.bi-house-add::before { content: "\f887"; } +.bi-house-check-fill::before { content: "\f888"; } +.bi-house-check::before { content: "\f889"; } +.bi-house-dash-fill::before { content: "\f88a"; } +.bi-house-dash::before { content: "\f88b"; } +.bi-house-down-fill::before { content: "\f88c"; } +.bi-house-down::before { content: "\f88d"; } +.bi-house-exclamation-fill::before { content: "\f88e"; } +.bi-house-exclamation::before { content: "\f88f"; } +.bi-house-gear-fill::before { content: "\f890"; } +.bi-house-gear::before { content: "\f891"; } +.bi-house-lock-fill::before { content: "\f892"; } +.bi-house-lock::before { content: "\f893"; } +.bi-house-slash-fill::before { content: "\f894"; } +.bi-house-slash::before { content: "\f895"; } +.bi-house-up-fill::before { content: "\f896"; } +.bi-house-up::before { content: "\f897"; } +.bi-house-x-fill::before { content: "\f898"; } +.bi-house-x::before { content: "\f899"; } +.bi-person-add::before { content: "\f89a"; } +.bi-person-down::before { content: "\f89b"; } +.bi-person-exclamation::before { content: "\f89c"; } +.bi-person-fill-add::before { content: "\f89d"; } +.bi-person-fill-check::before { content: "\f89e"; } +.bi-person-fill-dash::before { content: "\f89f"; } +.bi-person-fill-down::before { content: "\f8a0"; } +.bi-person-fill-exclamation::before { content: "\f8a1"; } +.bi-person-fill-gear::before { content: "\f8a2"; } +.bi-person-fill-lock::before { content: "\f8a3"; } +.bi-person-fill-slash::before { content: "\f8a4"; } +.bi-person-fill-up::before { content: "\f8a5"; } +.bi-person-fill-x::before { content: "\f8a6"; } +.bi-person-gear::before { content: "\f8a7"; } +.bi-person-lock::before { content: "\f8a8"; } +.bi-person-slash::before { content: "\f8a9"; } +.bi-person-up::before { content: "\f8aa"; } +.bi-scooter::before { content: "\f8ab"; } +.bi-taxi-front-fill::before { content: "\f8ac"; } +.bi-taxi-front::before { content: "\f8ad"; } +.bi-amd::before { content: "\f8ae"; } +.bi-database-add::before { content: "\f8af"; } +.bi-database-check::before { content: "\f8b0"; } +.bi-database-dash::before { content: "\f8b1"; } +.bi-database-down::before { content: "\f8b2"; } +.bi-database-exclamation::before { content: "\f8b3"; } +.bi-database-fill-add::before { content: "\f8b4"; } +.bi-database-fill-check::before { content: "\f8b5"; } +.bi-database-fill-dash::before { content: "\f8b6"; } +.bi-database-fill-down::before { content: "\f8b7"; } +.bi-database-fill-exclamation::before { content: "\f8b8"; } +.bi-database-fill-gear::before { content: "\f8b9"; } +.bi-database-fill-lock::before { content: "\f8ba"; } +.bi-database-fill-slash::before { content: "\f8bb"; } +.bi-database-fill-up::before { content: "\f8bc"; } +.bi-database-fill-x::before { content: "\f8bd"; } +.bi-database-fill::before { content: "\f8be"; } +.bi-database-gear::before { content: "\f8bf"; } +.bi-database-lock::before { content: "\f8c0"; } +.bi-database-slash::before { content: "\f8c1"; } +.bi-database-up::before { content: "\f8c2"; } +.bi-database-x::before { content: "\f8c3"; } +.bi-database::before { content: "\f8c4"; } +.bi-houses-fill::before { content: "\f8c5"; } +.bi-houses::before { content: "\f8c6"; } +.bi-nvidia::before { content: "\f8c7"; } +.bi-person-vcard-fill::before { content: "\f8c8"; } +.bi-person-vcard::before { content: "\f8c9"; } +.bi-sina-weibo::before { content: "\f8ca"; } +.bi-tencent-qq::before { content: "\f8cb"; } +.bi-wikipedia::before { content: "\f8cc"; } +.bi-alphabet-uppercase::before { content: "\f2a5"; } +.bi-alphabet::before { content: "\f68a"; } +.bi-amazon::before { content: "\f68d"; } +.bi-arrows-collapse-vertical::before { content: "\f690"; } +.bi-arrows-expand-vertical::before { content: "\f695"; } +.bi-arrows-vertical::before { content: "\f698"; } +.bi-arrows::before { content: "\f6a2"; } +.bi-ban-fill::before { content: "\f6a3"; } +.bi-ban::before { content: "\f6b6"; } +.bi-bing::before { content: "\f6c2"; } +.bi-cake::before { content: "\f6e0"; } +.bi-cake2::before { content: "\f6ed"; } +.bi-cookie::before { content: "\f6ee"; } +.bi-copy::before { content: "\f759"; } +.bi-crosshair::before { content: "\f769"; } +.bi-crosshair2::before { content: "\f794"; } +.bi-emoji-astonished-fill::before { content: "\f795"; } +.bi-emoji-astonished::before { content: "\f79a"; } +.bi-emoji-grimace-fill::before { content: "\f79b"; } +.bi-emoji-grimace::before { content: "\f7a0"; } +.bi-emoji-grin-fill::before { content: "\f7a1"; } +.bi-emoji-grin::before { content: "\f7a6"; } +.bi-emoji-surprise-fill::before { content: "\f7a7"; } +.bi-emoji-surprise::before { content: "\f7ac"; } +.bi-emoji-tear-fill::before { content: "\f7ad"; } +.bi-emoji-tear::before { content: "\f7b2"; } +.bi-envelope-arrow-down-fill::before { content: "\f7b3"; } +.bi-envelope-arrow-down::before { content: "\f7b8"; } +.bi-envelope-arrow-up-fill::before { content: "\f7b9"; } +.bi-envelope-arrow-up::before { content: "\f7be"; } +.bi-feather::before { content: "\f7bf"; } +.bi-feather2::before { content: "\f7c4"; } +.bi-floppy-fill::before { content: "\f7c5"; } +.bi-floppy::before { content: "\f7d8"; } +.bi-floppy2-fill::before { content: "\f7d9"; } +.bi-floppy2::before { content: "\f7e4"; } +.bi-gitlab::before { content: "\f7e5"; } +.bi-highlighter::before { content: "\f7f8"; } +.bi-marker-tip::before { content: "\f802"; } +.bi-nvme-fill::before { content: "\f803"; } +.bi-nvme::before { content: "\f80c"; } +.bi-opencollective::before { content: "\f80d"; } +.bi-pci-card-network::before { content: "\f8cd"; } +.bi-pci-card-sound::before { content: "\f8ce"; } +.bi-radar::before { content: "\f8cf"; } +.bi-send-arrow-down-fill::before { content: "\f8d0"; } +.bi-send-arrow-down::before { content: "\f8d1"; } +.bi-send-arrow-up-fill::before { content: "\f8d2"; } +.bi-send-arrow-up::before { content: "\f8d3"; } +.bi-sim-slash-fill::before { content: "\f8d4"; } +.bi-sim-slash::before { content: "\f8d5"; } +.bi-sourceforge::before { content: "\f8d6"; } +.bi-substack::before { content: "\f8d7"; } +.bi-threads-fill::before { content: "\f8d8"; } +.bi-threads::before { content: "\f8d9"; } +.bi-transparency::before { content: "\f8da"; } +.bi-twitter-x::before { content: "\f8db"; } +.bi-type-h4::before { content: "\f8dc"; } +.bi-type-h5::before { content: "\f8dd"; } +.bi-type-h6::before { content: "\f8de"; } +.bi-backpack-fill::before { content: "\f8df"; } +.bi-backpack::before { content: "\f8e0"; } +.bi-backpack2-fill::before { content: "\f8e1"; } +.bi-backpack2::before { content: "\f8e2"; } +.bi-backpack3-fill::before { content: "\f8e3"; } +.bi-backpack3::before { content: "\f8e4"; } +.bi-backpack4-fill::before { content: "\f8e5"; } +.bi-backpack4::before { content: "\f8e6"; } +.bi-brilliance::before { content: "\f8e7"; } +.bi-cake-fill::before { content: "\f8e8"; } +.bi-cake2-fill::before { content: "\f8e9"; } +.bi-duffle-fill::before { content: "\f8ea"; } +.bi-duffle::before { content: "\f8eb"; } +.bi-exposure::before { content: "\f8ec"; } +.bi-gender-neuter::before { content: "\f8ed"; } +.bi-highlights::before { content: "\f8ee"; } +.bi-luggage-fill::before { content: "\f8ef"; } +.bi-luggage::before { content: "\f8f0"; } +.bi-mailbox-flag::before { content: "\f8f1"; } +.bi-mailbox2-flag::before { content: "\f8f2"; } +.bi-noise-reduction::before { content: "\f8f3"; } +.bi-passport-fill::before { content: "\f8f4"; } +.bi-passport::before { content: "\f8f5"; } +.bi-person-arms-up::before { content: "\f8f6"; } +.bi-person-raised-hand::before { content: "\f8f7"; } +.bi-person-standing-dress::before { content: "\f8f8"; } +.bi-person-standing::before { content: "\f8f9"; } +.bi-person-walking::before { content: "\f8fa"; } +.bi-person-wheelchair::before { content: "\f8fb"; } +.bi-shadows::before { content: "\f8fc"; } +.bi-suitcase-fill::before { content: "\f8fd"; } +.bi-suitcase-lg-fill::before { content: "\f8fe"; } +.bi-suitcase-lg::before { content: "\f8ff"; } +.bi-suitcase::before { content: "\f900"; } +.bi-suitcase2-fill::before { content: "\f901"; } +.bi-suitcase2::before { content: "\f902"; } +.bi-vignette::before { content: "\f903"; } diff --git a/_site/worksheets/aesthetic-mappings_files/libs/bootstrap/bootstrap-icons.woff b/_site/worksheets/aesthetic-mappings_files/libs/bootstrap/bootstrap-icons.woff new file mode 100644 index 0000000..dbeeb05 Binary files /dev/null and b/_site/worksheets/aesthetic-mappings_files/libs/bootstrap/bootstrap-icons.woff differ diff --git a/_site/worksheets/aesthetic-mappings_files/libs/bootstrap/bootstrap.min.css b/_site/worksheets/aesthetic-mappings_files/libs/bootstrap/bootstrap.min.css new file mode 100644 index 0000000..eb5daa3 --- /dev/null +++ b/_site/worksheets/aesthetic-mappings_files/libs/bootstrap/bootstrap.min.css @@ -0,0 +1,12 @@ +/*! + * Bootstrap v5.3.1 (https://getbootstrap.com/) + * Copyright 2011-2023 The Bootstrap Authors + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + */:root,[data-bs-theme=light]{--bs-blue: #0d6efd;--bs-indigo: #6610f2;--bs-purple: #6f42c1;--bs-pink: #d63384;--bs-red: #dc3545;--bs-orange: #fd7e14;--bs-yellow: #ffc107;--bs-green: #198754;--bs-teal: #20c997;--bs-cyan: #0dcaf0;--bs-black: #000;--bs-white: #ffffff;--bs-gray: #6c757d;--bs-gray-dark: #343a40;--bs-gray-100: #f8f9fa;--bs-gray-200: #e9ecef;--bs-gray-300: #dee2e6;--bs-gray-400: #ced4da;--bs-gray-500: #adb5bd;--bs-gray-600: #6c757d;--bs-gray-700: #495057;--bs-gray-800: #343a40;--bs-gray-900: #212529;--bs-default: #dee2e6;--bs-primary: #0d6efd;--bs-secondary: #6c757d;--bs-success: #198754;--bs-info: #0dcaf0;--bs-warning: #ffc107;--bs-danger: #dc3545;--bs-light: #f8f9fa;--bs-dark: #212529;--bs-default-rgb: 222, 226, 230;--bs-primary-rgb: 13, 110, 253;--bs-secondary-rgb: 108, 117, 125;--bs-success-rgb: 25, 135, 84;--bs-info-rgb: 13, 202, 240;--bs-warning-rgb: 255, 193, 7;--bs-danger-rgb: 220, 53, 69;--bs-light-rgb: 248, 249, 250;--bs-dark-rgb: 33, 37, 41;--bs-primary-text-emphasis: #052c65;--bs-secondary-text-emphasis: #2b2f32;--bs-success-text-emphasis: #0a3622;--bs-info-text-emphasis: #055160;--bs-warning-text-emphasis: #664d03;--bs-danger-text-emphasis: #58151c;--bs-light-text-emphasis: #495057;--bs-dark-text-emphasis: #495057;--bs-primary-bg-subtle: #cfe2ff;--bs-secondary-bg-subtle: #e2e3e5;--bs-success-bg-subtle: #d1e7dd;--bs-info-bg-subtle: #cff4fc;--bs-warning-bg-subtle: #fff3cd;--bs-danger-bg-subtle: #f8d7da;--bs-light-bg-subtle: #fcfcfd;--bs-dark-bg-subtle: #ced4da;--bs-primary-border-subtle: #9ec5fe;--bs-secondary-border-subtle: #c4c8cb;--bs-success-border-subtle: #a3cfbb;--bs-info-border-subtle: #9eeaf9;--bs-warning-border-subtle: #ffe69c;--bs-danger-border-subtle: #f1aeb5;--bs-light-border-subtle: #e9ecef;--bs-dark-border-subtle: #adb5bd;--bs-white-rgb: 255, 255, 255;--bs-black-rgb: 0, 0, 0;--bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));--bs-root-font-size: 17px;--bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--bs-body-font-size:1rem;--bs-body-font-weight: 400;--bs-body-line-height: 1.5;--bs-body-color: #212529;--bs-body-color-rgb: 33, 37, 41;--bs-body-bg: #ffffff;--bs-body-bg-rgb: 255, 255, 255;--bs-emphasis-color: #000;--bs-emphasis-color-rgb: 0, 0, 0;--bs-secondary-color: rgba(33, 37, 41, 0.75);--bs-secondary-color-rgb: 33, 37, 41;--bs-secondary-bg: #e9ecef;--bs-secondary-bg-rgb: 233, 236, 239;--bs-tertiary-color: rgba(33, 37, 41, 0.5);--bs-tertiary-color-rgb: 33, 37, 41;--bs-tertiary-bg: #f8f9fa;--bs-tertiary-bg-rgb: 248, 249, 250;--bs-heading-color: inherit;--bs-link-color: #0d6efd;--bs-link-color-rgb: 13, 110, 253;--bs-link-decoration: underline;--bs-link-hover-color: #0a58ca;--bs-link-hover-color-rgb: 10, 88, 202;--bs-code-color: #7d12ba;--bs-highlight-bg: #fff3cd;--bs-border-width: 1px;--bs-border-style: solid;--bs-border-color: #dee2e6;--bs-border-color-translucent: rgba(0, 0, 0, 0.175);--bs-border-radius: 0.375rem;--bs-border-radius-sm: 0.25rem;--bs-border-radius-lg: 0.5rem;--bs-border-radius-xl: 1rem;--bs-border-radius-xxl: 2rem;--bs-border-radius-2xl: var(--bs-border-radius-xxl);--bs-border-radius-pill: 50rem;--bs-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);--bs-box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);--bs-box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);--bs-box-shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.075);--bs-focus-ring-width: 0.25rem;--bs-focus-ring-opacity: 0.25;--bs-focus-ring-color: rgba(13, 110, 253, 0.25);--bs-form-valid-color: #198754;--bs-form-valid-border-color: #198754;--bs-form-invalid-color: #dc3545;--bs-form-invalid-border-color: #dc3545}[data-bs-theme=dark]{color-scheme:dark;--bs-body-color: #dee2e6;--bs-body-color-rgb: 222, 226, 230;--bs-body-bg: #212529;--bs-body-bg-rgb: 33, 37, 41;--bs-emphasis-color: #ffffff;--bs-emphasis-color-rgb: 255, 255, 255;--bs-secondary-color: rgba(222, 226, 230, 0.75);--bs-secondary-color-rgb: 222, 226, 230;--bs-secondary-bg: #343a40;--bs-secondary-bg-rgb: 52, 58, 64;--bs-tertiary-color: rgba(222, 226, 230, 0.5);--bs-tertiary-color-rgb: 222, 226, 230;--bs-tertiary-bg: #2b3035;--bs-tertiary-bg-rgb: 43, 48, 53;--bs-primary-text-emphasis: #6ea8fe;--bs-secondary-text-emphasis: #a7acb1;--bs-success-text-emphasis: #75b798;--bs-info-text-emphasis: #6edff6;--bs-warning-text-emphasis: #ffda6a;--bs-danger-text-emphasis: #ea868f;--bs-light-text-emphasis: #f8f9fa;--bs-dark-text-emphasis: #dee2e6;--bs-primary-bg-subtle: #031633;--bs-secondary-bg-subtle: #161719;--bs-success-bg-subtle: #051b11;--bs-info-bg-subtle: #032830;--bs-warning-bg-subtle: #332701;--bs-danger-bg-subtle: #2c0b0e;--bs-light-bg-subtle: #343a40;--bs-dark-bg-subtle: #1a1d20;--bs-primary-border-subtle: #084298;--bs-secondary-border-subtle: #41464b;--bs-success-border-subtle: #0f5132;--bs-info-border-subtle: #087990;--bs-warning-border-subtle: #997404;--bs-danger-border-subtle: #842029;--bs-light-border-subtle: #495057;--bs-dark-border-subtle: #343a40;--bs-heading-color: inherit;--bs-link-color: #6ea8fe;--bs-link-hover-color: #8bb9fe;--bs-link-color-rgb: 110, 168, 254;--bs-link-hover-color-rgb: 139, 185, 254;--bs-code-color: white;--bs-border-color: #495057;--bs-border-color-translucent: rgba(255, 255, 255, 0.15);--bs-form-valid-color: #75b798;--bs-form-valid-border-color: #75b798;--bs-form-invalid-color: #ea868f;--bs-form-invalid-border-color: #ea868f}*,*::before,*::after{box-sizing:border-box}:root{font-size:var(--bs-root-font-size)}body{margin:0;font-family:var(--bs-body-font-family);font-size:var(--bs-body-font-size);font-weight:var(--bs-body-font-weight);line-height:var(--bs-body-line-height);color:var(--bs-body-color);text-align:var(--bs-body-text-align);background-color:var(--bs-body-bg);-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0)}hr{margin:1rem 0;color:inherit;border:0;border-top:1px solid;opacity:.25}h6,.h6,h5,.h5,h4,.h4,h3,.h3,h2,.h2,h1,.h1{margin-top:0;margin-bottom:.5rem;font-weight:500;line-height:1.2;color:var(--bs-heading-color)}h1,.h1{font-size:calc(1.325rem + 0.9vw)}@media(min-width: 1200px){h1,.h1{font-size:2rem}}h2,.h2{font-size:calc(1.29rem + 0.48vw)}@media(min-width: 1200px){h2,.h2{font-size:1.65rem}}h3,.h3{font-size:calc(1.27rem + 0.24vw)}@media(min-width: 1200px){h3,.h3{font-size:1.45rem}}h4,.h4{font-size:1.25rem}h5,.h5{font-size:1.1rem}h6,.h6{font-size:1rem}p{margin-top:0;margin-bottom:1rem}abbr[title]{text-decoration:underline dotted;-webkit-text-decoration:underline dotted;-moz-text-decoration:underline dotted;-ms-text-decoration:underline dotted;-o-text-decoration:underline dotted;cursor:help;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}ol,ul{padding-left:2rem}ol,ul,dl{margin-top:0;margin-bottom:1rem}ol ol,ul ul,ol ul,ul ol{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem;padding:.625rem 1.25rem;border-left:.25rem solid #e9ecef}blockquote p:last-child,blockquote ul:last-child,blockquote ol:last-child{margin-bottom:0}b,strong{font-weight:bolder}small,.small{font-size:0.875em}mark,.mark{padding:.1875em;background-color:var(--bs-highlight-bg)}sub,sup{position:relative;font-size:0.75em;line-height:0;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}a{color:rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1));text-decoration:underline;-webkit-text-decoration:underline;-moz-text-decoration:underline;-ms-text-decoration:underline;-o-text-decoration:underline}a:hover{--bs-link-color-rgb: var(--bs-link-hover-color-rgb)}a:not([href]):not([class]),a:not([href]):not([class]):hover{color:inherit;text-decoration:none}pre,code,kbd,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{display:block;margin-top:0;margin-bottom:1rem;overflow:auto;font-size:0.875em;color:#000;background-color:#f8f9fa;padding:.5rem;border:1px solid var(--bs-border-color, #dee2e6);border-radius:.375rem}pre code{background-color:rgba(0,0,0,0);font-size:inherit;color:inherit;word-break:normal}code{font-size:0.875em;color:var(--bs-code-color);background-color:#f8f9fa;border-radius:.375rem;padding:.125rem .25rem;word-wrap:break-word}a>code{color:inherit}kbd{padding:.4rem .4rem;font-size:0.875em;color:#fff;background-color:#212529;border-radius:.25rem}kbd kbd{padding:0;font-size:1em}figure{margin:0 0 1rem}img,svg{vertical-align:middle}table{caption-side:bottom;border-collapse:collapse}caption{padding-top:.5rem;padding-bottom:.5rem;color:rgba(33,37,41,.75);text-align:left}th{text-align:inherit;text-align:-webkit-match-parent}thead,tbody,tfoot,tr,td,th{border-color:inherit;border-style:solid;border-width:0}label{display:inline-block}button{border-radius:0}button:focus:not(:focus-visible){outline:0}input,button,select,optgroup,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}select:disabled{opacity:1}[list]:not([type=date]):not([type=datetime-local]):not([type=month]):not([type=week]):not([type=time])::-webkit-calendar-picker-indicator{display:none !important}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button:not(:disabled),[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled){cursor:pointer}::-moz-focus-inner{padding:0;border-style:none}textarea{resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{float:left;width:100%;padding:0;margin-bottom:.5rem;font-size:calc(1.275rem + 0.3vw);line-height:inherit}@media(min-width: 1200px){legend{font-size:1.5rem}}legend+*{clear:left}::-webkit-datetime-edit-fields-wrapper,::-webkit-datetime-edit-text,::-webkit-datetime-edit-minute,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-year-field{padding:0}::-webkit-inner-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-color-swatch-wrapper{padding:0}::file-selector-button{font:inherit;-webkit-appearance:button}output{display:inline-block}iframe{border:0}summary{display:list-item;cursor:pointer}progress{vertical-align:baseline}[hidden]{display:none !important}.lead{font-size:1.25rem;font-weight:300}.display-1{font-size:calc(1.625rem + 4.5vw);font-weight:300;line-height:1.2}@media(min-width: 1200px){.display-1{font-size:5rem}}.display-2{font-size:calc(1.575rem + 3.9vw);font-weight:300;line-height:1.2}@media(min-width: 1200px){.display-2{font-size:4.5rem}}.display-3{font-size:calc(1.525rem + 3.3vw);font-weight:300;line-height:1.2}@media(min-width: 1200px){.display-3{font-size:4rem}}.display-4{font-size:calc(1.475rem + 2.7vw);font-weight:300;line-height:1.2}@media(min-width: 1200px){.display-4{font-size:3.5rem}}.display-5{font-size:calc(1.425rem + 2.1vw);font-weight:300;line-height:1.2}@media(min-width: 1200px){.display-5{font-size:3rem}}.display-6{font-size:calc(1.375rem + 1.5vw);font-weight:300;line-height:1.2}@media(min-width: 1200px){.display-6{font-size:2.5rem}}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none}.list-inline-item{display:inline-block}.list-inline-item:not(:last-child){margin-right:.5rem}.initialism{font-size:0.875em;text-transform:uppercase}.blockquote{margin-bottom:1rem;font-size:1.25rem}.blockquote>:last-child{margin-bottom:0}.blockquote-footer{margin-top:-1rem;margin-bottom:1rem;font-size:0.875em;color:#6c757d}.blockquote-footer::before{content:"— "}.img-fluid{max-width:100%;height:auto}.img-thumbnail{padding:.25rem;background-color:#fff;border:1px solid #dee2e6;border-radius:.375rem;max-width:100%;height:auto}.figure{display:inline-block}.figure-img{margin-bottom:.5rem;line-height:1}.figure-caption{font-size:0.875em;color:rgba(33,37,41,.75)}.container,.container-fluid,.container-xxl,.container-xl,.container-lg,.container-md,.container-sm{--bs-gutter-x: 1.5rem;--bs-gutter-y: 0;width:100%;padding-right:calc(var(--bs-gutter-x)*.5);padding-left:calc(var(--bs-gutter-x)*.5);margin-right:auto;margin-left:auto}@media(min-width: 576px){.container-sm,.container{max-width:540px}}@media(min-width: 768px){.container-md,.container-sm,.container{max-width:720px}}@media(min-width: 992px){.container-lg,.container-md,.container-sm,.container{max-width:960px}}@media(min-width: 1200px){.container-xl,.container-lg,.container-md,.container-sm,.container{max-width:1140px}}@media(min-width: 1400px){.container-xxl,.container-xl,.container-lg,.container-md,.container-sm,.container{max-width:1320px}}:root{--bs-breakpoint-xs: 0;--bs-breakpoint-sm: 576px;--bs-breakpoint-md: 768px;--bs-breakpoint-lg: 992px;--bs-breakpoint-xl: 1200px;--bs-breakpoint-xxl: 1400px}.grid{display:grid;grid-template-rows:repeat(var(--bs-rows, 1), 1fr);grid-template-columns:repeat(var(--bs-columns, 12), 1fr);gap:var(--bs-gap, 1.5rem)}.grid .g-col-1{grid-column:auto/span 1}.grid .g-col-2{grid-column:auto/span 2}.grid .g-col-3{grid-column:auto/span 3}.grid .g-col-4{grid-column:auto/span 4}.grid .g-col-5{grid-column:auto/span 5}.grid .g-col-6{grid-column:auto/span 6}.grid .g-col-7{grid-column:auto/span 7}.grid .g-col-8{grid-column:auto/span 8}.grid .g-col-9{grid-column:auto/span 9}.grid .g-col-10{grid-column:auto/span 10}.grid .g-col-11{grid-column:auto/span 11}.grid .g-col-12{grid-column:auto/span 12}.grid .g-start-1{grid-column-start:1}.grid .g-start-2{grid-column-start:2}.grid .g-start-3{grid-column-start:3}.grid .g-start-4{grid-column-start:4}.grid .g-start-5{grid-column-start:5}.grid .g-start-6{grid-column-start:6}.grid .g-start-7{grid-column-start:7}.grid .g-start-8{grid-column-start:8}.grid .g-start-9{grid-column-start:9}.grid .g-start-10{grid-column-start:10}.grid .g-start-11{grid-column-start:11}@media(min-width: 576px){.grid .g-col-sm-1{grid-column:auto/span 1}.grid .g-col-sm-2{grid-column:auto/span 2}.grid .g-col-sm-3{grid-column:auto/span 3}.grid .g-col-sm-4{grid-column:auto/span 4}.grid .g-col-sm-5{grid-column:auto/span 5}.grid .g-col-sm-6{grid-column:auto/span 6}.grid .g-col-sm-7{grid-column:auto/span 7}.grid .g-col-sm-8{grid-column:auto/span 8}.grid .g-col-sm-9{grid-column:auto/span 9}.grid .g-col-sm-10{grid-column:auto/span 10}.grid .g-col-sm-11{grid-column:auto/span 11}.grid .g-col-sm-12{grid-column:auto/span 12}.grid .g-start-sm-1{grid-column-start:1}.grid .g-start-sm-2{grid-column-start:2}.grid .g-start-sm-3{grid-column-start:3}.grid .g-start-sm-4{grid-column-start:4}.grid .g-start-sm-5{grid-column-start:5}.grid .g-start-sm-6{grid-column-start:6}.grid .g-start-sm-7{grid-column-start:7}.grid .g-start-sm-8{grid-column-start:8}.grid .g-start-sm-9{grid-column-start:9}.grid .g-start-sm-10{grid-column-start:10}.grid .g-start-sm-11{grid-column-start:11}}@media(min-width: 768px){.grid .g-col-md-1{grid-column:auto/span 1}.grid .g-col-md-2{grid-column:auto/span 2}.grid .g-col-md-3{grid-column:auto/span 3}.grid .g-col-md-4{grid-column:auto/span 4}.grid .g-col-md-5{grid-column:auto/span 5}.grid .g-col-md-6{grid-column:auto/span 6}.grid .g-col-md-7{grid-column:auto/span 7}.grid .g-col-md-8{grid-column:auto/span 8}.grid .g-col-md-9{grid-column:auto/span 9}.grid .g-col-md-10{grid-column:auto/span 10}.grid .g-col-md-11{grid-column:auto/span 11}.grid .g-col-md-12{grid-column:auto/span 12}.grid .g-start-md-1{grid-column-start:1}.grid .g-start-md-2{grid-column-start:2}.grid .g-start-md-3{grid-column-start:3}.grid .g-start-md-4{grid-column-start:4}.grid .g-start-md-5{grid-column-start:5}.grid .g-start-md-6{grid-column-start:6}.grid .g-start-md-7{grid-column-start:7}.grid .g-start-md-8{grid-column-start:8}.grid .g-start-md-9{grid-column-start:9}.grid .g-start-md-10{grid-column-start:10}.grid .g-start-md-11{grid-column-start:11}}@media(min-width: 992px){.grid .g-col-lg-1{grid-column:auto/span 1}.grid .g-col-lg-2{grid-column:auto/span 2}.grid .g-col-lg-3{grid-column:auto/span 3}.grid .g-col-lg-4{grid-column:auto/span 4}.grid .g-col-lg-5{grid-column:auto/span 5}.grid .g-col-lg-6{grid-column:auto/span 6}.grid .g-col-lg-7{grid-column:auto/span 7}.grid .g-col-lg-8{grid-column:auto/span 8}.grid .g-col-lg-9{grid-column:auto/span 9}.grid .g-col-lg-10{grid-column:auto/span 10}.grid .g-col-lg-11{grid-column:auto/span 11}.grid .g-col-lg-12{grid-column:auto/span 12}.grid .g-start-lg-1{grid-column-start:1}.grid .g-start-lg-2{grid-column-start:2}.grid .g-start-lg-3{grid-column-start:3}.grid .g-start-lg-4{grid-column-start:4}.grid .g-start-lg-5{grid-column-start:5}.grid .g-start-lg-6{grid-column-start:6}.grid .g-start-lg-7{grid-column-start:7}.grid .g-start-lg-8{grid-column-start:8}.grid .g-start-lg-9{grid-column-start:9}.grid .g-start-lg-10{grid-column-start:10}.grid .g-start-lg-11{grid-column-start:11}}@media(min-width: 1200px){.grid .g-col-xl-1{grid-column:auto/span 1}.grid .g-col-xl-2{grid-column:auto/span 2}.grid .g-col-xl-3{grid-column:auto/span 3}.grid .g-col-xl-4{grid-column:auto/span 4}.grid .g-col-xl-5{grid-column:auto/span 5}.grid .g-col-xl-6{grid-column:auto/span 6}.grid .g-col-xl-7{grid-column:auto/span 7}.grid .g-col-xl-8{grid-column:auto/span 8}.grid .g-col-xl-9{grid-column:auto/span 9}.grid .g-col-xl-10{grid-column:auto/span 10}.grid .g-col-xl-11{grid-column:auto/span 11}.grid .g-col-xl-12{grid-column:auto/span 12}.grid .g-start-xl-1{grid-column-start:1}.grid .g-start-xl-2{grid-column-start:2}.grid .g-start-xl-3{grid-column-start:3}.grid .g-start-xl-4{grid-column-start:4}.grid .g-start-xl-5{grid-column-start:5}.grid .g-start-xl-6{grid-column-start:6}.grid .g-start-xl-7{grid-column-start:7}.grid .g-start-xl-8{grid-column-start:8}.grid .g-start-xl-9{grid-column-start:9}.grid .g-start-xl-10{grid-column-start:10}.grid .g-start-xl-11{grid-column-start:11}}@media(min-width: 1400px){.grid .g-col-xxl-1{grid-column:auto/span 1}.grid .g-col-xxl-2{grid-column:auto/span 2}.grid .g-col-xxl-3{grid-column:auto/span 3}.grid .g-col-xxl-4{grid-column:auto/span 4}.grid .g-col-xxl-5{grid-column:auto/span 5}.grid .g-col-xxl-6{grid-column:auto/span 6}.grid .g-col-xxl-7{grid-column:auto/span 7}.grid .g-col-xxl-8{grid-column:auto/span 8}.grid .g-col-xxl-9{grid-column:auto/span 9}.grid .g-col-xxl-10{grid-column:auto/span 10}.grid .g-col-xxl-11{grid-column:auto/span 11}.grid .g-col-xxl-12{grid-column:auto/span 12}.grid .g-start-xxl-1{grid-column-start:1}.grid .g-start-xxl-2{grid-column-start:2}.grid .g-start-xxl-3{grid-column-start:3}.grid .g-start-xxl-4{grid-column-start:4}.grid .g-start-xxl-5{grid-column-start:5}.grid .g-start-xxl-6{grid-column-start:6}.grid .g-start-xxl-7{grid-column-start:7}.grid .g-start-xxl-8{grid-column-start:8}.grid .g-start-xxl-9{grid-column-start:9}.grid .g-start-xxl-10{grid-column-start:10}.grid .g-start-xxl-11{grid-column-start:11}}.table{--bs-table-color-type: initial;--bs-table-bg-type: initial;--bs-table-color-state: initial;--bs-table-bg-state: initial;--bs-table-color: #212529;--bs-table-bg: #ffffff;--bs-table-border-color: #dee2e6;--bs-table-accent-bg: transparent;--bs-table-striped-color: #212529;--bs-table-striped-bg: rgba(0, 0, 0, 0.05);--bs-table-active-color: #212529;--bs-table-active-bg: rgba(0, 0, 0, 0.1);--bs-table-hover-color: #212529;--bs-table-hover-bg: rgba(0, 0, 0, 0.075);width:100%;margin-bottom:1rem;vertical-align:top;border-color:var(--bs-table-border-color)}.table>:not(caption)>*>*{padding:.5rem .5rem;color:var(--bs-table-color-state, var(--bs-table-color-type, var(--bs-table-color)));background-color:var(--bs-table-bg);border-bottom-width:1px;box-shadow:inset 0 0 0 9999px var(--bs-table-bg-state, var(--bs-table-bg-type, var(--bs-table-accent-bg)))}.table>tbody{vertical-align:inherit}.table>thead{vertical-align:bottom}.table-group-divider{border-top:calc(1px*2) solid #9ba5ae}.caption-top{caption-side:top}.table-sm>:not(caption)>*>*{padding:.25rem .25rem}.table-bordered>:not(caption)>*{border-width:1px 0}.table-bordered>:not(caption)>*>*{border-width:0 1px}.table-borderless>:not(caption)>*>*{border-bottom-width:0}.table-borderless>:not(:first-child){border-top-width:0}.table-striped>tbody>tr:nth-of-type(odd)>*{--bs-table-color-type: var(--bs-table-striped-color);--bs-table-bg-type: var(--bs-table-striped-bg)}.table-striped-columns>:not(caption)>tr>:nth-child(even){--bs-table-color-type: var(--bs-table-striped-color);--bs-table-bg-type: var(--bs-table-striped-bg)}.table-active{--bs-table-color-state: var(--bs-table-active-color);--bs-table-bg-state: var(--bs-table-active-bg)}.table-hover>tbody>tr:hover>*{--bs-table-color-state: var(--bs-table-hover-color);--bs-table-bg-state: var(--bs-table-hover-bg)}.table-primary{--bs-table-color: #000;--bs-table-bg: #cfe2ff;--bs-table-border-color: #bacbe6;--bs-table-striped-bg: #c5d7f2;--bs-table-striped-color: #000;--bs-table-active-bg: #bacbe6;--bs-table-active-color: #000;--bs-table-hover-bg: #bfd1ec;--bs-table-hover-color: #000;color:var(--bs-table-color);border-color:var(--bs-table-border-color)}.table-secondary{--bs-table-color: #000;--bs-table-bg: #e2e3e5;--bs-table-border-color: #cbccce;--bs-table-striped-bg: #d7d8da;--bs-table-striped-color: #000;--bs-table-active-bg: #cbccce;--bs-table-active-color: #000;--bs-table-hover-bg: #d1d2d4;--bs-table-hover-color: #000;color:var(--bs-table-color);border-color:var(--bs-table-border-color)}.table-success{--bs-table-color: #000;--bs-table-bg: #d1e7dd;--bs-table-border-color: #bcd0c7;--bs-table-striped-bg: #c7dbd2;--bs-table-striped-color: #000;--bs-table-active-bg: #bcd0c7;--bs-table-active-color: #000;--bs-table-hover-bg: #c1d6cc;--bs-table-hover-color: #000;color:var(--bs-table-color);border-color:var(--bs-table-border-color)}.table-info{--bs-table-color: #000;--bs-table-bg: #cff4fc;--bs-table-border-color: #badce3;--bs-table-striped-bg: #c5e8ef;--bs-table-striped-color: #000;--bs-table-active-bg: #badce3;--bs-table-active-color: #000;--bs-table-hover-bg: #bfe2e9;--bs-table-hover-color: #000;color:var(--bs-table-color);border-color:var(--bs-table-border-color)}.table-warning{--bs-table-color: #000;--bs-table-bg: #fff3cd;--bs-table-border-color: #e6dbb9;--bs-table-striped-bg: #f2e7c3;--bs-table-striped-color: #000;--bs-table-active-bg: #e6dbb9;--bs-table-active-color: #000;--bs-table-hover-bg: #ece1be;--bs-table-hover-color: #000;color:var(--bs-table-color);border-color:var(--bs-table-border-color)}.table-danger{--bs-table-color: #000;--bs-table-bg: #f8d7da;--bs-table-border-color: #dfc2c4;--bs-table-striped-bg: #eccccf;--bs-table-striped-color: #000;--bs-table-active-bg: #dfc2c4;--bs-table-active-color: #000;--bs-table-hover-bg: #e5c7ca;--bs-table-hover-color: #000;color:var(--bs-table-color);border-color:var(--bs-table-border-color)}.table-light{--bs-table-color: #000;--bs-table-bg: #f8f9fa;--bs-table-border-color: #dfe0e1;--bs-table-striped-bg: #ecedee;--bs-table-striped-color: #000;--bs-table-active-bg: #dfe0e1;--bs-table-active-color: #000;--bs-table-hover-bg: #e5e6e7;--bs-table-hover-color: #000;color:var(--bs-table-color);border-color:var(--bs-table-border-color)}.table-dark{--bs-table-color: #ffffff;--bs-table-bg: #212529;--bs-table-border-color: #373b3e;--bs-table-striped-bg: #2c3034;--bs-table-striped-color: #ffffff;--bs-table-active-bg: #373b3e;--bs-table-active-color: #ffffff;--bs-table-hover-bg: #323539;--bs-table-hover-color: #ffffff;color:var(--bs-table-color);border-color:var(--bs-table-border-color)}.table-responsive{overflow-x:auto;-webkit-overflow-scrolling:touch}@media(max-width: 575.98px){.table-responsive-sm{overflow-x:auto;-webkit-overflow-scrolling:touch}}@media(max-width: 767.98px){.table-responsive-md{overflow-x:auto;-webkit-overflow-scrolling:touch}}@media(max-width: 991.98px){.table-responsive-lg{overflow-x:auto;-webkit-overflow-scrolling:touch}}@media(max-width: 1199.98px){.table-responsive-xl{overflow-x:auto;-webkit-overflow-scrolling:touch}}@media(max-width: 1399.98px){.table-responsive-xxl{overflow-x:auto;-webkit-overflow-scrolling:touch}}.form-label,.shiny-input-container .control-label{margin-bottom:.5rem}.col-form-label{padding-top:calc(0.375rem + 1px);padding-bottom:calc(0.375rem + 1px);margin-bottom:0;font-size:inherit;line-height:1.5}.col-form-label-lg{padding-top:calc(0.5rem + 1px);padding-bottom:calc(0.5rem + 1px);font-size:1.25rem}.col-form-label-sm{padding-top:calc(0.25rem + 1px);padding-bottom:calc(0.25rem + 1px);font-size:0.875rem}.form-text{margin-top:.25rem;font-size:0.875em;color:rgba(33,37,41,.75)}.form-control{display:block;width:100%;padding:.375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:#212529;appearance:none;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;-o-appearance:none;background-color:#fff;background-clip:padding-box;border:1px solid #dee2e6;border-radius:.375rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media(prefers-reduced-motion: reduce){.form-control{transition:none}}.form-control[type=file]{overflow:hidden}.form-control[type=file]:not(:disabled):not([readonly]){cursor:pointer}.form-control:focus{color:#212529;background-color:#fff;border-color:#86b7fe;outline:0;box-shadow:0 0 0 .25rem rgba(13,110,253,.25)}.form-control::-webkit-date-and-time-value{min-width:85px;height:1.5em;margin:0}.form-control::-webkit-datetime-edit{display:block;padding:0}.form-control::placeholder{color:rgba(33,37,41,.75);opacity:1}.form-control:disabled{background-color:#e9ecef;opacity:1}.form-control::file-selector-button{padding:.375rem .75rem;margin:-0.375rem -0.75rem;margin-inline-end:.75rem;color:#212529;background-color:#f8f9fa;pointer-events:none;border-color:inherit;border-style:solid;border-width:0;border-inline-end-width:1px;border-radius:0;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media(prefers-reduced-motion: reduce){.form-control::file-selector-button{transition:none}}.form-control:hover:not(:disabled):not([readonly])::file-selector-button{background-color:#e9ecef}.form-control-plaintext{display:block;width:100%;padding:.375rem 0;margin-bottom:0;line-height:1.5;color:#212529;background-color:rgba(0,0,0,0);border:solid rgba(0,0,0,0);border-width:1px 0}.form-control-plaintext:focus{outline:0}.form-control-plaintext.form-control-sm,.form-control-plaintext.form-control-lg{padding-right:0;padding-left:0}.form-control-sm{min-height:calc(1.5em + 0.5rem + calc(1px * 2));padding:.25rem .5rem;font-size:0.875rem;border-radius:.25rem}.form-control-sm::file-selector-button{padding:.25rem .5rem;margin:-0.25rem -0.5rem;margin-inline-end:.5rem}.form-control-lg{min-height:calc(1.5em + 1rem + calc(1px * 2));padding:.5rem 1rem;font-size:1.25rem;border-radius:.5rem}.form-control-lg::file-selector-button{padding:.5rem 1rem;margin:-0.5rem -1rem;margin-inline-end:1rem}textarea.form-control{min-height:calc(1.5em + 0.75rem + calc(1px * 2))}textarea.form-control-sm{min-height:calc(1.5em + 0.5rem + calc(1px * 2))}textarea.form-control-lg{min-height:calc(1.5em + 1rem + calc(1px * 2))}.form-control-color{width:3rem;height:calc(1.5em + 0.75rem + calc(1px * 2));padding:.375rem}.form-control-color:not(:disabled):not([readonly]){cursor:pointer}.form-control-color::-moz-color-swatch{border:0 !important;border-radius:.375rem}.form-control-color::-webkit-color-swatch{border:0 !important;border-radius:.375rem}.form-control-color.form-control-sm{height:calc(1.5em + 0.5rem + calc(1px * 2))}.form-control-color.form-control-lg{height:calc(1.5em + 1rem + calc(1px * 2))}.form-select{--bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");display:block;width:100%;padding:.375rem 2.25rem .375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:#212529;appearance:none;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;-o-appearance:none;background-color:#fff;background-image:var(--bs-form-select-bg-img),var(--bs-form-select-bg-icon, none);background-repeat:no-repeat;background-position:right .75rem center;background-size:16px 12px;border:1px solid #dee2e6;border-radius:.375rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media(prefers-reduced-motion: reduce){.form-select{transition:none}}.form-select:focus{border-color:#86b7fe;outline:0;box-shadow:0 0 0 .25rem rgba(13,110,253,.25)}.form-select[multiple],.form-select[size]:not([size="1"]){padding-right:.75rem;background-image:none}.form-select:disabled{background-color:#e9ecef}.form-select:-moz-focusring{color:rgba(0,0,0,0);text-shadow:0 0 0 #212529}.form-select-sm{padding-top:.25rem;padding-bottom:.25rem;padding-left:.5rem;font-size:0.875rem;border-radius:.25rem}.form-select-lg{padding-top:.5rem;padding-bottom:.5rem;padding-left:1rem;font-size:1.25rem;border-radius:.5rem}[data-bs-theme=dark] .form-select{--bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23dee2e6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e")}.form-check,.shiny-input-container .checkbox,.shiny-input-container .radio{display:block;min-height:1.5rem;padding-left:0;margin-bottom:.125rem}.form-check .form-check-input,.form-check .shiny-input-container .checkbox input,.form-check .shiny-input-container .radio input,.shiny-input-container .checkbox .form-check-input,.shiny-input-container .checkbox .shiny-input-container .checkbox input,.shiny-input-container .checkbox .shiny-input-container .radio input,.shiny-input-container .radio .form-check-input,.shiny-input-container .radio .shiny-input-container .checkbox input,.shiny-input-container .radio .shiny-input-container .radio input{float:left;margin-left:0}.form-check-reverse{padding-right:0;padding-left:0;text-align:right}.form-check-reverse .form-check-input{float:right;margin-right:0;margin-left:0}.form-check-input,.shiny-input-container .checkbox input,.shiny-input-container .checkbox-inline input,.shiny-input-container .radio input,.shiny-input-container .radio-inline input{--bs-form-check-bg: #ffffff;width:1em;height:1em;margin-top:.25em;vertical-align:top;appearance:none;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;-o-appearance:none;background-color:var(--bs-form-check-bg);background-image:var(--bs-form-check-bg-image);background-repeat:no-repeat;background-position:center;background-size:contain;border:1px solid #dee2e6;print-color-adjust:exact}.form-check-input[type=checkbox],.shiny-input-container .checkbox input[type=checkbox],.shiny-input-container .checkbox-inline input[type=checkbox],.shiny-input-container .radio input[type=checkbox],.shiny-input-container .radio-inline input[type=checkbox]{border-radius:.25em}.form-check-input[type=radio],.shiny-input-container .checkbox input[type=radio],.shiny-input-container .checkbox-inline input[type=radio],.shiny-input-container .radio input[type=radio],.shiny-input-container .radio-inline input[type=radio]{border-radius:50%}.form-check-input:active,.shiny-input-container .checkbox input:active,.shiny-input-container .checkbox-inline input:active,.shiny-input-container .radio input:active,.shiny-input-container .radio-inline input:active{filter:brightness(90%)}.form-check-input:focus,.shiny-input-container .checkbox input:focus,.shiny-input-container .checkbox-inline input:focus,.shiny-input-container .radio input:focus,.shiny-input-container .radio-inline input:focus{border-color:#86b7fe;outline:0;box-shadow:0 0 0 .25rem rgba(13,110,253,.25)}.form-check-input:checked,.shiny-input-container .checkbox input:checked,.shiny-input-container .checkbox-inline input:checked,.shiny-input-container .radio input:checked,.shiny-input-container .radio-inline input:checked{background-color:#0d6efd;border-color:#0d6efd}.form-check-input:checked[type=checkbox],.shiny-input-container .checkbox input:checked[type=checkbox],.shiny-input-container .checkbox-inline input:checked[type=checkbox],.shiny-input-container .radio input:checked[type=checkbox],.shiny-input-container .radio-inline input:checked[type=checkbox]{--bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e")}.form-check-input:checked[type=radio],.shiny-input-container .checkbox input:checked[type=radio],.shiny-input-container .checkbox-inline input:checked[type=radio],.shiny-input-container .radio input:checked[type=radio],.shiny-input-container .radio-inline input:checked[type=radio]{--bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23ffffff'/%3e%3c/svg%3e")}.form-check-input[type=checkbox]:indeterminate,.shiny-input-container .checkbox input[type=checkbox]:indeterminate,.shiny-input-container .checkbox-inline input[type=checkbox]:indeterminate,.shiny-input-container .radio input[type=checkbox]:indeterminate,.shiny-input-container .radio-inline input[type=checkbox]:indeterminate{background-color:#0d6efd;border-color:#0d6efd;--bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10h8'/%3e%3c/svg%3e")}.form-check-input:disabled,.shiny-input-container .checkbox input:disabled,.shiny-input-container .checkbox-inline input:disabled,.shiny-input-container .radio input:disabled,.shiny-input-container .radio-inline input:disabled{pointer-events:none;filter:none;opacity:.5}.form-check-input[disabled]~.form-check-label,.form-check-input[disabled]~span,.form-check-input:disabled~.form-check-label,.form-check-input:disabled~span,.shiny-input-container .checkbox input[disabled]~.form-check-label,.shiny-input-container .checkbox input[disabled]~span,.shiny-input-container .checkbox input:disabled~.form-check-label,.shiny-input-container .checkbox input:disabled~span,.shiny-input-container .checkbox-inline input[disabled]~.form-check-label,.shiny-input-container .checkbox-inline input[disabled]~span,.shiny-input-container .checkbox-inline input:disabled~.form-check-label,.shiny-input-container .checkbox-inline input:disabled~span,.shiny-input-container .radio input[disabled]~.form-check-label,.shiny-input-container .radio input[disabled]~span,.shiny-input-container .radio input:disabled~.form-check-label,.shiny-input-container .radio input:disabled~span,.shiny-input-container .radio-inline input[disabled]~.form-check-label,.shiny-input-container .radio-inline input[disabled]~span,.shiny-input-container .radio-inline input:disabled~.form-check-label,.shiny-input-container .radio-inline input:disabled~span{cursor:default;opacity:.5}.form-check-label,.shiny-input-container .checkbox label,.shiny-input-container .checkbox-inline label,.shiny-input-container .radio label,.shiny-input-container .radio-inline label{cursor:pointer}.form-switch{padding-left:2.5em}.form-switch .form-check-input{--bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%280, 0, 0, 0.25%29'/%3e%3c/svg%3e");width:2em;margin-left:-2.5em;background-image:var(--bs-form-switch-bg);background-position:left center;border-radius:2em;transition:background-position .15s ease-in-out}@media(prefers-reduced-motion: reduce){.form-switch .form-check-input{transition:none}}.form-switch .form-check-input:focus{--bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%2386b7fe'/%3e%3c/svg%3e")}.form-switch .form-check-input:checked{background-position:right center;--bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e")}.form-switch.form-check-reverse{padding-right:2.5em;padding-left:0}.form-switch.form-check-reverse .form-check-input{margin-right:-2.5em;margin-left:0}.form-check-inline{display:inline-block;margin-right:1rem}.btn-check{position:absolute;clip:rect(0, 0, 0, 0);pointer-events:none}.btn-check[disabled]+.btn,.btn-check:disabled+.btn{pointer-events:none;filter:none;opacity:.65}[data-bs-theme=dark] .form-switch .form-check-input:not(:checked):not(:focus){--bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%28255, 255, 255, 0.25%29'/%3e%3c/svg%3e")}.form-range{width:100%;height:1.5rem;padding:0;appearance:none;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;-o-appearance:none;background-color:rgba(0,0,0,0)}.form-range:focus{outline:0}.form-range:focus::-webkit-slider-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .25rem rgba(13,110,253,.25)}.form-range:focus::-moz-range-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .25rem rgba(13,110,253,.25)}.form-range::-moz-focus-outer{border:0}.form-range::-webkit-slider-thumb{width:1rem;height:1rem;margin-top:-0.25rem;appearance:none;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;-o-appearance:none;background-color:#0d6efd;border:0;border-radius:1rem;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media(prefers-reduced-motion: reduce){.form-range::-webkit-slider-thumb{transition:none}}.form-range::-webkit-slider-thumb:active{background-color:#b6d4fe}.form-range::-webkit-slider-runnable-track{width:100%;height:.5rem;color:rgba(0,0,0,0);cursor:pointer;background-color:#f8f9fa;border-color:rgba(0,0,0,0);border-radius:1rem}.form-range::-moz-range-thumb{width:1rem;height:1rem;appearance:none;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;-o-appearance:none;background-color:#0d6efd;border:0;border-radius:1rem;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media(prefers-reduced-motion: reduce){.form-range::-moz-range-thumb{transition:none}}.form-range::-moz-range-thumb:active{background-color:#b6d4fe}.form-range::-moz-range-track{width:100%;height:.5rem;color:rgba(0,0,0,0);cursor:pointer;background-color:#f8f9fa;border-color:rgba(0,0,0,0);border-radius:1rem}.form-range:disabled{pointer-events:none}.form-range:disabled::-webkit-slider-thumb{background-color:rgba(33,37,41,.75)}.form-range:disabled::-moz-range-thumb{background-color:rgba(33,37,41,.75)}.form-floating{position:relative}.form-floating>.form-control,.form-floating>.form-control-plaintext,.form-floating>.form-select{height:calc(3.5rem + calc(1px * 2));min-height:calc(3.5rem + calc(1px * 2));line-height:1.25}.form-floating>label{position:absolute;top:0;left:0;z-index:2;height:100%;padding:1rem .75rem;overflow:hidden;text-align:start;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;border:1px solid rgba(0,0,0,0);transform-origin:0 0;transition:opacity .1s ease-in-out,transform .1s ease-in-out}@media(prefers-reduced-motion: reduce){.form-floating>label{transition:none}}.form-floating>.form-control,.form-floating>.form-control-plaintext{padding:1rem .75rem}.form-floating>.form-control::placeholder,.form-floating>.form-control-plaintext::placeholder{color:rgba(0,0,0,0)}.form-floating>.form-control:focus,.form-floating>.form-control:not(:placeholder-shown),.form-floating>.form-control-plaintext:focus,.form-floating>.form-control-plaintext:not(:placeholder-shown){padding-top:1.625rem;padding-bottom:.625rem}.form-floating>.form-control:-webkit-autofill,.form-floating>.form-control-plaintext:-webkit-autofill{padding-top:1.625rem;padding-bottom:.625rem}.form-floating>.form-select{padding-top:1.625rem;padding-bottom:.625rem}.form-floating>.form-control:focus~label,.form-floating>.form-control:not(:placeholder-shown)~label,.form-floating>.form-control-plaintext~label,.form-floating>.form-select~label{color:rgba(var(--bs-body-color-rgb), 0.65);transform:scale(0.85) translateY(-0.5rem) translateX(0.15rem)}.form-floating>.form-control:focus~label::after,.form-floating>.form-control:not(:placeholder-shown)~label::after,.form-floating>.form-control-plaintext~label::after,.form-floating>.form-select~label::after{position:absolute;inset:1rem .375rem;z-index:-1;height:1.5em;content:"";background-color:#fff;border-radius:.375rem}.form-floating>.form-control:-webkit-autofill~label{color:rgba(var(--bs-body-color-rgb), 0.65);transform:scale(0.85) translateY(-0.5rem) translateX(0.15rem)}.form-floating>.form-control-plaintext~label{border-width:1px 0}.form-floating>:disabled~label,.form-floating>.form-control:disabled~label{color:#6c757d}.form-floating>:disabled~label::after,.form-floating>.form-control:disabled~label::after{background-color:#e9ecef}.input-group{position:relative;display:flex;display:-webkit-flex;flex-wrap:wrap;-webkit-flex-wrap:wrap;align-items:stretch;-webkit-align-items:stretch;width:100%}.input-group>.form-control,.input-group>.form-select,.input-group>.form-floating{position:relative;flex:1 1 auto;-webkit-flex:1 1 auto;width:1%;min-width:0}.input-group>.form-control:focus,.input-group>.form-select:focus,.input-group>.form-floating:focus-within{z-index:5}.input-group .btn{position:relative;z-index:2}.input-group .btn:focus{z-index:5}.input-group-text{display:flex;display:-webkit-flex;align-items:center;-webkit-align-items:center;padding:.375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:center;white-space:nowrap;background-color:#f8f9fa;border:1px solid #dee2e6;border-radius:.375rem}.input-group-lg>.form-control,.input-group-lg>.form-select,.input-group-lg>.input-group-text,.input-group-lg>.btn{padding:.5rem 1rem;font-size:1.25rem;border-radius:.5rem}.input-group-sm>.form-control,.input-group-sm>.form-select,.input-group-sm>.input-group-text,.input-group-sm>.btn{padding:.25rem .5rem;font-size:0.875rem;border-radius:.25rem}.input-group-lg>.form-select,.input-group-sm>.form-select{padding-right:3rem}.input-group:not(.has-validation)>:not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating),.input-group:not(.has-validation)>.dropdown-toggle:nth-last-child(n+3),.input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-control,.input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-select{border-top-right-radius:0;border-bottom-right-radius:0}.input-group.has-validation>:nth-last-child(n+3):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating),.input-group.has-validation>.dropdown-toggle:nth-last-child(n+4),.input-group.has-validation>.form-floating:nth-last-child(n+3)>.form-control,.input-group.has-validation>.form-floating:nth-last-child(n+3)>.form-select{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>:not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback){margin-left:calc(1px*-1);border-top-left-radius:0;border-bottom-left-radius:0}.input-group>.form-floating:not(:first-child)>.form-control,.input-group>.form-floating:not(:first-child)>.form-select{border-top-left-radius:0;border-bottom-left-radius:0}.valid-feedback{display:none;width:100%;margin-top:.25rem;font-size:0.875em;color:#198754}.valid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:0.875rem;color:#fff;background-color:#198754;border-radius:.375rem}.was-validated :valid~.valid-feedback,.was-validated :valid~.valid-tooltip,.is-valid~.valid-feedback,.is-valid~.valid-tooltip{display:block}.was-validated .form-control:valid,.form-control.is-valid{border-color:#198754;padding-right:calc(1.5em + 0.75rem);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right calc(0.375em + 0.1875rem) center;background-size:calc(0.75em + 0.375rem) calc(0.75em + 0.375rem)}.was-validated .form-control:valid:focus,.form-control.is-valid:focus{border-color:#198754;box-shadow:0 0 0 .25rem rgba(25,135,84,.25)}.was-validated textarea.form-control:valid,textarea.form-control.is-valid{padding-right:calc(1.5em + 0.75rem);background-position:top calc(0.375em + 0.1875rem) right calc(0.375em + 0.1875rem)}.was-validated .form-select:valid,.form-select.is-valid{border-color:#198754}.was-validated .form-select:valid:not([multiple]):not([size]),.was-validated .form-select:valid:not([multiple])[size="1"],.form-select.is-valid:not([multiple]):not([size]),.form-select.is-valid:not([multiple])[size="1"]{--bs-form-select-bg-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");padding-right:4.125rem;background-position:right .75rem center,center right 2.25rem;background-size:16px 12px,calc(0.75em + 0.375rem) calc(0.75em + 0.375rem)}.was-validated .form-select:valid:focus,.form-select.is-valid:focus{border-color:#198754;box-shadow:0 0 0 .25rem rgba(25,135,84,.25)}.was-validated .form-control-color:valid,.form-control-color.is-valid{width:calc(3rem + calc(1.5em + 0.75rem))}.was-validated .form-check-input:valid,.form-check-input.is-valid{border-color:#198754}.was-validated .form-check-input:valid:checked,.form-check-input.is-valid:checked{background-color:#198754}.was-validated .form-check-input:valid:focus,.form-check-input.is-valid:focus{box-shadow:0 0 0 .25rem rgba(25,135,84,.25)}.was-validated .form-check-input:valid~.form-check-label,.form-check-input.is-valid~.form-check-label{color:#198754}.form-check-inline .form-check-input~.valid-feedback{margin-left:.5em}.was-validated .input-group>.form-control:not(:focus):valid,.input-group>.form-control:not(:focus).is-valid,.was-validated .input-group>.form-select:not(:focus):valid,.input-group>.form-select:not(:focus).is-valid,.was-validated .input-group>.form-floating:not(:focus-within):valid,.input-group>.form-floating:not(:focus-within).is-valid{z-index:3}.invalid-feedback{display:none;width:100%;margin-top:.25rem;font-size:0.875em;color:#dc3545}.invalid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:0.875rem;color:#fff;background-color:#dc3545;border-radius:.375rem}.was-validated :invalid~.invalid-feedback,.was-validated :invalid~.invalid-tooltip,.is-invalid~.invalid-feedback,.is-invalid~.invalid-tooltip{display:block}.was-validated .form-control:invalid,.form-control.is-invalid{border-color:#dc3545;padding-right:calc(1.5em + 0.75rem);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right calc(0.375em + 0.1875rem) center;background-size:calc(0.75em + 0.375rem) calc(0.75em + 0.375rem)}.was-validated .form-control:invalid:focus,.form-control.is-invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .25rem rgba(220,53,69,.25)}.was-validated textarea.form-control:invalid,textarea.form-control.is-invalid{padding-right:calc(1.5em + 0.75rem);background-position:top calc(0.375em + 0.1875rem) right calc(0.375em + 0.1875rem)}.was-validated .form-select:invalid,.form-select.is-invalid{border-color:#dc3545}.was-validated .form-select:invalid:not([multiple]):not([size]),.was-validated .form-select:invalid:not([multiple])[size="1"],.form-select.is-invalid:not([multiple]):not([size]),.form-select.is-invalid:not([multiple])[size="1"]{--bs-form-select-bg-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");padding-right:4.125rem;background-position:right .75rem center,center right 2.25rem;background-size:16px 12px,calc(0.75em + 0.375rem) calc(0.75em + 0.375rem)}.was-validated .form-select:invalid:focus,.form-select.is-invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .25rem rgba(220,53,69,.25)}.was-validated .form-control-color:invalid,.form-control-color.is-invalid{width:calc(3rem + calc(1.5em + 0.75rem))}.was-validated .form-check-input:invalid,.form-check-input.is-invalid{border-color:#dc3545}.was-validated .form-check-input:invalid:checked,.form-check-input.is-invalid:checked{background-color:#dc3545}.was-validated .form-check-input:invalid:focus,.form-check-input.is-invalid:focus{box-shadow:0 0 0 .25rem rgba(220,53,69,.25)}.was-validated .form-check-input:invalid~.form-check-label,.form-check-input.is-invalid~.form-check-label{color:#dc3545}.form-check-inline .form-check-input~.invalid-feedback{margin-left:.5em}.was-validated .input-group>.form-control:not(:focus):invalid,.input-group>.form-control:not(:focus).is-invalid,.was-validated .input-group>.form-select:not(:focus):invalid,.input-group>.form-select:not(:focus).is-invalid,.was-validated .input-group>.form-floating:not(:focus-within):invalid,.input-group>.form-floating:not(:focus-within).is-invalid{z-index:4}.btn{--bs-btn-padding-x: 0.75rem;--bs-btn-padding-y: 0.375rem;--bs-btn-font-family: ;--bs-btn-font-size:1rem;--bs-btn-font-weight: 400;--bs-btn-line-height: 1.5;--bs-btn-color: #212529;--bs-btn-bg: transparent;--bs-btn-border-width: 1px;--bs-btn-border-color: transparent;--bs-btn-border-radius: 0.375rem;--bs-btn-hover-border-color: transparent;--bs-btn-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075);--bs-btn-disabled-opacity: 0.65;--bs-btn-focus-box-shadow: 0 0 0 0.25rem rgba(var(--bs-btn-focus-shadow-rgb), .5);display:inline-block;padding:var(--bs-btn-padding-y) var(--bs-btn-padding-x);font-family:var(--bs-btn-font-family);font-size:var(--bs-btn-font-size);font-weight:var(--bs-btn-font-weight);line-height:var(--bs-btn-line-height);color:var(--bs-btn-color);text-align:center;text-decoration:none;-webkit-text-decoration:none;-moz-text-decoration:none;-ms-text-decoration:none;-o-text-decoration:none;vertical-align:middle;cursor:pointer;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;border:var(--bs-btn-border-width) solid var(--bs-btn-border-color);border-radius:var(--bs-btn-border-radius);background-color:var(--bs-btn-bg);transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media(prefers-reduced-motion: reduce){.btn{transition:none}}.btn:hover{color:var(--bs-btn-hover-color);background-color:var(--bs-btn-hover-bg);border-color:var(--bs-btn-hover-border-color)}.btn-check+.btn:hover{color:var(--bs-btn-color);background-color:var(--bs-btn-bg);border-color:var(--bs-btn-border-color)}.btn:focus-visible{color:var(--bs-btn-hover-color);background-color:var(--bs-btn-hover-bg);border-color:var(--bs-btn-hover-border-color);outline:0;box-shadow:var(--bs-btn-focus-box-shadow)}.btn-check:focus-visible+.btn{border-color:var(--bs-btn-hover-border-color);outline:0;box-shadow:var(--bs-btn-focus-box-shadow)}.btn-check:checked+.btn,:not(.btn-check)+.btn:active,.btn:first-child:active,.btn.active,.btn.show{color:var(--bs-btn-active-color);background-color:var(--bs-btn-active-bg);border-color:var(--bs-btn-active-border-color)}.btn-check:checked+.btn:focus-visible,:not(.btn-check)+.btn:active:focus-visible,.btn:first-child:active:focus-visible,.btn.active:focus-visible,.btn.show:focus-visible{box-shadow:var(--bs-btn-focus-box-shadow)}.btn:disabled,.btn.disabled,fieldset:disabled .btn{color:var(--bs-btn-disabled-color);pointer-events:none;background-color:var(--bs-btn-disabled-bg);border-color:var(--bs-btn-disabled-border-color);opacity:var(--bs-btn-disabled-opacity)}.btn-default{--bs-btn-color: #000;--bs-btn-bg: #dee2e6;--bs-btn-border-color: #dee2e6;--bs-btn-hover-color: #000;--bs-btn-hover-bg: #e3e6ea;--bs-btn-hover-border-color: #e1e5e9;--bs-btn-focus-shadow-rgb: 189, 192, 196;--bs-btn-active-color: #000;--bs-btn-active-bg: #e5e8eb;--bs-btn-active-border-color: #e1e5e9;--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color: #000;--bs-btn-disabled-bg: #dee2e6;--bs-btn-disabled-border-color: #dee2e6}.btn-primary{--bs-btn-color: #ffffff;--bs-btn-bg: #0d6efd;--bs-btn-border-color: #0d6efd;--bs-btn-hover-color: #ffffff;--bs-btn-hover-bg: #0b5ed7;--bs-btn-hover-border-color: #0a58ca;--bs-btn-focus-shadow-rgb: 49, 132, 253;--bs-btn-active-color: #ffffff;--bs-btn-active-bg: #0a58ca;--bs-btn-active-border-color: #0a53be;--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color: #ffffff;--bs-btn-disabled-bg: #0d6efd;--bs-btn-disabled-border-color: #0d6efd}.btn-secondary{--bs-btn-color: #ffffff;--bs-btn-bg: #6c757d;--bs-btn-border-color: #6c757d;--bs-btn-hover-color: #ffffff;--bs-btn-hover-bg: #5c636a;--bs-btn-hover-border-color: #565e64;--bs-btn-focus-shadow-rgb: 130, 138, 145;--bs-btn-active-color: #ffffff;--bs-btn-active-bg: #565e64;--bs-btn-active-border-color: #51585e;--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color: #ffffff;--bs-btn-disabled-bg: #6c757d;--bs-btn-disabled-border-color: #6c757d}.btn-success{--bs-btn-color: #ffffff;--bs-btn-bg: #198754;--bs-btn-border-color: #198754;--bs-btn-hover-color: #ffffff;--bs-btn-hover-bg: #157347;--bs-btn-hover-border-color: #146c43;--bs-btn-focus-shadow-rgb: 60, 153, 110;--bs-btn-active-color: #ffffff;--bs-btn-active-bg: #146c43;--bs-btn-active-border-color: #13653f;--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color: #ffffff;--bs-btn-disabled-bg: #198754;--bs-btn-disabled-border-color: #198754}.btn-info{--bs-btn-color: #000;--bs-btn-bg: #0dcaf0;--bs-btn-border-color: #0dcaf0;--bs-btn-hover-color: #000;--bs-btn-hover-bg: #31d2f2;--bs-btn-hover-border-color: #25cff2;--bs-btn-focus-shadow-rgb: 11, 172, 204;--bs-btn-active-color: #000;--bs-btn-active-bg: #3dd5f3;--bs-btn-active-border-color: #25cff2;--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color: #000;--bs-btn-disabled-bg: #0dcaf0;--bs-btn-disabled-border-color: #0dcaf0}.btn-warning{--bs-btn-color: #000;--bs-btn-bg: #ffc107;--bs-btn-border-color: #ffc107;--bs-btn-hover-color: #000;--bs-btn-hover-bg: #ffca2c;--bs-btn-hover-border-color: #ffc720;--bs-btn-focus-shadow-rgb: 217, 164, 6;--bs-btn-active-color: #000;--bs-btn-active-bg: #ffcd39;--bs-btn-active-border-color: #ffc720;--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color: #000;--bs-btn-disabled-bg: #ffc107;--bs-btn-disabled-border-color: #ffc107}.btn-danger{--bs-btn-color: #ffffff;--bs-btn-bg: #dc3545;--bs-btn-border-color: #dc3545;--bs-btn-hover-color: #ffffff;--bs-btn-hover-bg: #bb2d3b;--bs-btn-hover-border-color: #b02a37;--bs-btn-focus-shadow-rgb: 225, 83, 97;--bs-btn-active-color: #ffffff;--bs-btn-active-bg: #b02a37;--bs-btn-active-border-color: #a52834;--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color: #ffffff;--bs-btn-disabled-bg: #dc3545;--bs-btn-disabled-border-color: #dc3545}.btn-light{--bs-btn-color: #000;--bs-btn-bg: #f8f9fa;--bs-btn-border-color: #f8f9fa;--bs-btn-hover-color: #000;--bs-btn-hover-bg: #d3d4d5;--bs-btn-hover-border-color: #c6c7c8;--bs-btn-focus-shadow-rgb: 211, 212, 213;--bs-btn-active-color: #000;--bs-btn-active-bg: #c6c7c8;--bs-btn-active-border-color: #babbbc;--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color: #000;--bs-btn-disabled-bg: #f8f9fa;--bs-btn-disabled-border-color: #f8f9fa}.btn-dark{--bs-btn-color: #ffffff;--bs-btn-bg: #212529;--bs-btn-border-color: #212529;--bs-btn-hover-color: #ffffff;--bs-btn-hover-bg: #424649;--bs-btn-hover-border-color: #373b3e;--bs-btn-focus-shadow-rgb: 66, 70, 73;--bs-btn-active-color: #ffffff;--bs-btn-active-bg: #4d5154;--bs-btn-active-border-color: #373b3e;--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color: #ffffff;--bs-btn-disabled-bg: #212529;--bs-btn-disabled-border-color: #212529}.btn-outline-default{--bs-btn-color: #dee2e6;--bs-btn-border-color: #dee2e6;--bs-btn-hover-color: #000;--bs-btn-hover-bg: #dee2e6;--bs-btn-hover-border-color: #dee2e6;--bs-btn-focus-shadow-rgb: 222, 226, 230;--bs-btn-active-color: #000;--bs-btn-active-bg: #dee2e6;--bs-btn-active-border-color: #dee2e6;--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color: #dee2e6;--bs-btn-disabled-bg: transparent;--bs-btn-disabled-border-color: #dee2e6;--bs-btn-bg: transparent;--bs-gradient: none}.btn-outline-primary{--bs-btn-color: #0d6efd;--bs-btn-border-color: #0d6efd;--bs-btn-hover-color: #ffffff;--bs-btn-hover-bg: #0d6efd;--bs-btn-hover-border-color: #0d6efd;--bs-btn-focus-shadow-rgb: 13, 110, 253;--bs-btn-active-color: #ffffff;--bs-btn-active-bg: #0d6efd;--bs-btn-active-border-color: #0d6efd;--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color: #0d6efd;--bs-btn-disabled-bg: transparent;--bs-btn-disabled-border-color: #0d6efd;--bs-btn-bg: transparent;--bs-gradient: none}.btn-outline-secondary{--bs-btn-color: #6c757d;--bs-btn-border-color: #6c757d;--bs-btn-hover-color: #ffffff;--bs-btn-hover-bg: #6c757d;--bs-btn-hover-border-color: #6c757d;--bs-btn-focus-shadow-rgb: 108, 117, 125;--bs-btn-active-color: #ffffff;--bs-btn-active-bg: #6c757d;--bs-btn-active-border-color: #6c757d;--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color: #6c757d;--bs-btn-disabled-bg: transparent;--bs-btn-disabled-border-color: #6c757d;--bs-btn-bg: transparent;--bs-gradient: none}.btn-outline-success{--bs-btn-color: #198754;--bs-btn-border-color: #198754;--bs-btn-hover-color: #ffffff;--bs-btn-hover-bg: #198754;--bs-btn-hover-border-color: #198754;--bs-btn-focus-shadow-rgb: 25, 135, 84;--bs-btn-active-color: #ffffff;--bs-btn-active-bg: #198754;--bs-btn-active-border-color: #198754;--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color: #198754;--bs-btn-disabled-bg: transparent;--bs-btn-disabled-border-color: #198754;--bs-btn-bg: transparent;--bs-gradient: none}.btn-outline-info{--bs-btn-color: #0dcaf0;--bs-btn-border-color: #0dcaf0;--bs-btn-hover-color: #000;--bs-btn-hover-bg: #0dcaf0;--bs-btn-hover-border-color: #0dcaf0;--bs-btn-focus-shadow-rgb: 13, 202, 240;--bs-btn-active-color: #000;--bs-btn-active-bg: #0dcaf0;--bs-btn-active-border-color: #0dcaf0;--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color: #0dcaf0;--bs-btn-disabled-bg: transparent;--bs-btn-disabled-border-color: #0dcaf0;--bs-btn-bg: transparent;--bs-gradient: none}.btn-outline-warning{--bs-btn-color: #ffc107;--bs-btn-border-color: #ffc107;--bs-btn-hover-color: #000;--bs-btn-hover-bg: #ffc107;--bs-btn-hover-border-color: #ffc107;--bs-btn-focus-shadow-rgb: 255, 193, 7;--bs-btn-active-color: #000;--bs-btn-active-bg: #ffc107;--bs-btn-active-border-color: #ffc107;--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color: #ffc107;--bs-btn-disabled-bg: transparent;--bs-btn-disabled-border-color: #ffc107;--bs-btn-bg: transparent;--bs-gradient: none}.btn-outline-danger{--bs-btn-color: #dc3545;--bs-btn-border-color: #dc3545;--bs-btn-hover-color: #ffffff;--bs-btn-hover-bg: #dc3545;--bs-btn-hover-border-color: #dc3545;--bs-btn-focus-shadow-rgb: 220, 53, 69;--bs-btn-active-color: #ffffff;--bs-btn-active-bg: #dc3545;--bs-btn-active-border-color: #dc3545;--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color: #dc3545;--bs-btn-disabled-bg: transparent;--bs-btn-disabled-border-color: #dc3545;--bs-btn-bg: transparent;--bs-gradient: none}.btn-outline-light{--bs-btn-color: #f8f9fa;--bs-btn-border-color: #f8f9fa;--bs-btn-hover-color: #000;--bs-btn-hover-bg: #f8f9fa;--bs-btn-hover-border-color: #f8f9fa;--bs-btn-focus-shadow-rgb: 248, 249, 250;--bs-btn-active-color: #000;--bs-btn-active-bg: #f8f9fa;--bs-btn-active-border-color: #f8f9fa;--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color: #f8f9fa;--bs-btn-disabled-bg: transparent;--bs-btn-disabled-border-color: #f8f9fa;--bs-btn-bg: transparent;--bs-gradient: none}.btn-outline-dark{--bs-btn-color: #212529;--bs-btn-border-color: #212529;--bs-btn-hover-color: #ffffff;--bs-btn-hover-bg: #212529;--bs-btn-hover-border-color: #212529;--bs-btn-focus-shadow-rgb: 33, 37, 41;--bs-btn-active-color: #ffffff;--bs-btn-active-bg: #212529;--bs-btn-active-border-color: #212529;--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color: #212529;--bs-btn-disabled-bg: transparent;--bs-btn-disabled-border-color: #212529;--bs-btn-bg: transparent;--bs-gradient: none}.btn-link{--bs-btn-font-weight: 400;--bs-btn-color: #0d6efd;--bs-btn-bg: transparent;--bs-btn-border-color: transparent;--bs-btn-hover-color: #0a58ca;--bs-btn-hover-border-color: transparent;--bs-btn-active-color: #0a58ca;--bs-btn-active-border-color: transparent;--bs-btn-disabled-color: #6c757d;--bs-btn-disabled-border-color: transparent;--bs-btn-box-shadow: 0 0 0 #000;--bs-btn-focus-shadow-rgb: 49, 132, 253;text-decoration:underline;-webkit-text-decoration:underline;-moz-text-decoration:underline;-ms-text-decoration:underline;-o-text-decoration:underline}.btn-link:focus-visible{color:var(--bs-btn-color)}.btn-link:hover{color:var(--bs-btn-hover-color)}.btn-lg,.btn-group-lg>.btn{--bs-btn-padding-y: 0.5rem;--bs-btn-padding-x: 1rem;--bs-btn-font-size:1.25rem;--bs-btn-border-radius: 0.5rem}.btn-sm,.btn-group-sm>.btn{--bs-btn-padding-y: 0.25rem;--bs-btn-padding-x: 0.5rem;--bs-btn-font-size:0.875rem;--bs-btn-border-radius: 0.25rem}.fade{transition:opacity .15s linear}@media(prefers-reduced-motion: reduce){.fade{transition:none}}.fade:not(.show){opacity:0}.collapse:not(.show){display:none}.collapsing{height:0;overflow:hidden;transition:height .2s ease}@media(prefers-reduced-motion: reduce){.collapsing{transition:none}}.collapsing.collapse-horizontal{width:0;height:auto;transition:width .35s ease}@media(prefers-reduced-motion: reduce){.collapsing.collapse-horizontal{transition:none}}.dropup,.dropend,.dropdown,.dropstart,.dropup-center,.dropdown-center{position:relative}.dropdown-toggle{white-space:nowrap}.dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid;border-right:.3em solid rgba(0,0,0,0);border-bottom:0;border-left:.3em solid rgba(0,0,0,0)}.dropdown-toggle:empty::after{margin-left:0}.dropdown-menu{--bs-dropdown-zindex: 1000;--bs-dropdown-min-width: 10rem;--bs-dropdown-padding-x: 0;--bs-dropdown-padding-y: 0.5rem;--bs-dropdown-spacer: 0.125rem;--bs-dropdown-font-size:1rem;--bs-dropdown-color: #212529;--bs-dropdown-bg: #ffffff;--bs-dropdown-border-color: rgba(0, 0, 0, 0.175);--bs-dropdown-border-radius: 0.375rem;--bs-dropdown-border-width: 1px;--bs-dropdown-inner-border-radius: calc(0.375rem - 1px);--bs-dropdown-divider-bg: rgba(0, 0, 0, 0.175);--bs-dropdown-divider-margin-y: 0.5rem;--bs-dropdown-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);--bs-dropdown-link-color: #212529;--bs-dropdown-link-hover-color: #212529;--bs-dropdown-link-hover-bg: #f8f9fa;--bs-dropdown-link-active-color: #ffffff;--bs-dropdown-link-active-bg: #0d6efd;--bs-dropdown-link-disabled-color: rgba(33, 37, 41, 0.5);--bs-dropdown-item-padding-x: 1rem;--bs-dropdown-item-padding-y: 0.25rem;--bs-dropdown-header-color: #6c757d;--bs-dropdown-header-padding-x: 1rem;--bs-dropdown-header-padding-y: 0.5rem;position:absolute;z-index:var(--bs-dropdown-zindex);display:none;min-width:var(--bs-dropdown-min-width);padding:var(--bs-dropdown-padding-y) var(--bs-dropdown-padding-x);margin:0;font-size:var(--bs-dropdown-font-size);color:var(--bs-dropdown-color);text-align:left;list-style:none;background-color:var(--bs-dropdown-bg);background-clip:padding-box;border:var(--bs-dropdown-border-width) solid var(--bs-dropdown-border-color);border-radius:var(--bs-dropdown-border-radius)}.dropdown-menu[data-bs-popper]{top:100%;left:0;margin-top:var(--bs-dropdown-spacer)}.dropdown-menu-start{--bs-position: start}.dropdown-menu-start[data-bs-popper]{right:auto;left:0}.dropdown-menu-end{--bs-position: end}.dropdown-menu-end[data-bs-popper]{right:0;left:auto}@media(min-width: 576px){.dropdown-menu-sm-start{--bs-position: start}.dropdown-menu-sm-start[data-bs-popper]{right:auto;left:0}.dropdown-menu-sm-end{--bs-position: end}.dropdown-menu-sm-end[data-bs-popper]{right:0;left:auto}}@media(min-width: 768px){.dropdown-menu-md-start{--bs-position: start}.dropdown-menu-md-start[data-bs-popper]{right:auto;left:0}.dropdown-menu-md-end{--bs-position: end}.dropdown-menu-md-end[data-bs-popper]{right:0;left:auto}}@media(min-width: 992px){.dropdown-menu-lg-start{--bs-position: start}.dropdown-menu-lg-start[data-bs-popper]{right:auto;left:0}.dropdown-menu-lg-end{--bs-position: end}.dropdown-menu-lg-end[data-bs-popper]{right:0;left:auto}}@media(min-width: 1200px){.dropdown-menu-xl-start{--bs-position: start}.dropdown-menu-xl-start[data-bs-popper]{right:auto;left:0}.dropdown-menu-xl-end{--bs-position: end}.dropdown-menu-xl-end[data-bs-popper]{right:0;left:auto}}@media(min-width: 1400px){.dropdown-menu-xxl-start{--bs-position: start}.dropdown-menu-xxl-start[data-bs-popper]{right:auto;left:0}.dropdown-menu-xxl-end{--bs-position: end}.dropdown-menu-xxl-end[data-bs-popper]{right:0;left:auto}}.dropup .dropdown-menu[data-bs-popper]{top:auto;bottom:100%;margin-top:0;margin-bottom:var(--bs-dropdown-spacer)}.dropup .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:0;border-right:.3em solid rgba(0,0,0,0);border-bottom:.3em solid;border-left:.3em solid rgba(0,0,0,0)}.dropup .dropdown-toggle:empty::after{margin-left:0}.dropend .dropdown-menu[data-bs-popper]{top:0;right:auto;left:100%;margin-top:0;margin-left:var(--bs-dropdown-spacer)}.dropend .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid rgba(0,0,0,0);border-right:0;border-bottom:.3em solid rgba(0,0,0,0);border-left:.3em solid}.dropend .dropdown-toggle:empty::after{margin-left:0}.dropend .dropdown-toggle::after{vertical-align:0}.dropstart .dropdown-menu[data-bs-popper]{top:0;right:100%;left:auto;margin-top:0;margin-right:var(--bs-dropdown-spacer)}.dropstart .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:""}.dropstart .dropdown-toggle::after{display:none}.dropstart .dropdown-toggle::before{display:inline-block;margin-right:.255em;vertical-align:.255em;content:"";border-top:.3em solid rgba(0,0,0,0);border-right:.3em solid;border-bottom:.3em solid rgba(0,0,0,0)}.dropstart .dropdown-toggle:empty::after{margin-left:0}.dropstart .dropdown-toggle::before{vertical-align:0}.dropdown-divider{height:0;margin:var(--bs-dropdown-divider-margin-y) 0;overflow:hidden;border-top:1px solid var(--bs-dropdown-divider-bg);opacity:1}.dropdown-item{display:block;width:100%;padding:var(--bs-dropdown-item-padding-y) var(--bs-dropdown-item-padding-x);clear:both;font-weight:400;color:var(--bs-dropdown-link-color);text-align:inherit;text-decoration:none;-webkit-text-decoration:none;-moz-text-decoration:none;-ms-text-decoration:none;-o-text-decoration:none;white-space:nowrap;background-color:rgba(0,0,0,0);border:0;border-radius:var(--bs-dropdown-item-border-radius, 0)}.dropdown-item:hover,.dropdown-item:focus{color:var(--bs-dropdown-link-hover-color);background-color:var(--bs-dropdown-link-hover-bg)}.dropdown-item.active,.dropdown-item:active{color:var(--bs-dropdown-link-active-color);text-decoration:none;background-color:var(--bs-dropdown-link-active-bg)}.dropdown-item.disabled,.dropdown-item:disabled{color:var(--bs-dropdown-link-disabled-color);pointer-events:none;background-color:rgba(0,0,0,0)}.dropdown-menu.show{display:block}.dropdown-header{display:block;padding:var(--bs-dropdown-header-padding-y) var(--bs-dropdown-header-padding-x);margin-bottom:0;font-size:0.875rem;color:var(--bs-dropdown-header-color);white-space:nowrap}.dropdown-item-text{display:block;padding:var(--bs-dropdown-item-padding-y) var(--bs-dropdown-item-padding-x);color:var(--bs-dropdown-link-color)}.dropdown-menu-dark{--bs-dropdown-color: #dee2e6;--bs-dropdown-bg: #343a40;--bs-dropdown-border-color: rgba(0, 0, 0, 0.175);--bs-dropdown-box-shadow: ;--bs-dropdown-link-color: #dee2e6;--bs-dropdown-link-hover-color: #ffffff;--bs-dropdown-divider-bg: rgba(0, 0, 0, 0.175);--bs-dropdown-link-hover-bg: rgba(255, 255, 255, 0.15);--bs-dropdown-link-active-color: #ffffff;--bs-dropdown-link-active-bg: #0d6efd;--bs-dropdown-link-disabled-color: #adb5bd;--bs-dropdown-header-color: #adb5bd}.btn-group,.btn-group-vertical{position:relative;display:inline-flex;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;flex:1 1 auto;-webkit-flex:1 1 auto}.btn-group>.btn-check:checked+.btn,.btn-group>.btn-check:focus+.btn,.btn-group>.btn:hover,.btn-group>.btn:focus,.btn-group>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn-check:checked+.btn,.btn-group-vertical>.btn-check:focus+.btn,.btn-group-vertical>.btn:hover,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn.active{z-index:1}.btn-toolbar{display:flex;display:-webkit-flex;flex-wrap:wrap;-webkit-flex-wrap:wrap;justify-content:flex-start;-webkit-justify-content:flex-start}.btn-toolbar .input-group{width:auto}.btn-group{border-radius:.375rem}.btn-group>:not(.btn-check:first-child)+.btn,.btn-group>.btn-group:not(:first-child){margin-left:calc(1px*-1)}.btn-group>.btn:not(:last-child):not(.dropdown-toggle),.btn-group>.btn.dropdown-toggle-split:first-child,.btn-group>.btn-group:not(:last-child)>.btn{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:nth-child(n+3),.btn-group>:not(.btn-check)+.btn,.btn-group>.btn-group:not(:first-child)>.btn{border-top-left-radius:0;border-bottom-left-radius:0}.dropdown-toggle-split{padding-right:.5625rem;padding-left:.5625rem}.dropdown-toggle-split::after,.dropup .dropdown-toggle-split::after,.dropend .dropdown-toggle-split::after{margin-left:0}.dropstart .dropdown-toggle-split::before{margin-right:0}.btn-sm+.dropdown-toggle-split,.btn-group-sm>.btn+.dropdown-toggle-split{padding-right:.375rem;padding-left:.375rem}.btn-lg+.dropdown-toggle-split,.btn-group-lg>.btn+.dropdown-toggle-split{padding-right:.75rem;padding-left:.75rem}.btn-group-vertical{flex-direction:column;-webkit-flex-direction:column;align-items:flex-start;-webkit-align-items:flex-start;justify-content:center;-webkit-justify-content:center}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group{width:100%}.btn-group-vertical>.btn:not(:first-child),.btn-group-vertical>.btn-group:not(:first-child){margin-top:calc(1px*-1)}.btn-group-vertical>.btn:not(:last-child):not(.dropdown-toggle),.btn-group-vertical>.btn-group:not(:last-child)>.btn{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn~.btn,.btn-group-vertical>.btn-group:not(:first-child)>.btn{border-top-left-radius:0;border-top-right-radius:0}.nav{--bs-nav-link-padding-x: 1rem;--bs-nav-link-padding-y: 0.5rem;--bs-nav-link-font-weight: ;--bs-nav-link-color: #0d6efd;--bs-nav-link-hover-color: #0a58ca;--bs-nav-link-disabled-color: rgba(33, 37, 41, 0.75);display:flex;display:-webkit-flex;flex-wrap:wrap;-webkit-flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none}.nav-link{display:block;padding:var(--bs-nav-link-padding-y) var(--bs-nav-link-padding-x);font-size:var(--bs-nav-link-font-size);font-weight:var(--bs-nav-link-font-weight);color:var(--bs-nav-link-color);text-decoration:none;-webkit-text-decoration:none;-moz-text-decoration:none;-ms-text-decoration:none;-o-text-decoration:none;background:none;border:0;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out}@media(prefers-reduced-motion: reduce){.nav-link{transition:none}}.nav-link:hover,.nav-link:focus{color:var(--bs-nav-link-hover-color)}.nav-link:focus-visible{outline:0;box-shadow:0 0 0 .25rem rgba(13,110,253,.25)}.nav-link.disabled,.nav-link:disabled{color:var(--bs-nav-link-disabled-color);pointer-events:none;cursor:default}.nav-tabs{--bs-nav-tabs-border-width: 1px;--bs-nav-tabs-border-color: #dee2e6;--bs-nav-tabs-border-radius: 0.375rem;--bs-nav-tabs-link-hover-border-color: #e9ecef #e9ecef #dee2e6;--bs-nav-tabs-link-active-color: #000;--bs-nav-tabs-link-active-bg: #ffffff;--bs-nav-tabs-link-active-border-color: #dee2e6 #dee2e6 #ffffff;border-bottom:var(--bs-nav-tabs-border-width) solid var(--bs-nav-tabs-border-color)}.nav-tabs .nav-link{margin-bottom:calc(-1*var(--bs-nav-tabs-border-width));border:var(--bs-nav-tabs-border-width) solid rgba(0,0,0,0);border-top-left-radius:var(--bs-nav-tabs-border-radius);border-top-right-radius:var(--bs-nav-tabs-border-radius)}.nav-tabs .nav-link:hover,.nav-tabs .nav-link:focus{isolation:isolate;border-color:var(--bs-nav-tabs-link-hover-border-color)}.nav-tabs .nav-link.active,.nav-tabs .nav-item.show .nav-link{color:var(--bs-nav-tabs-link-active-color);background-color:var(--bs-nav-tabs-link-active-bg);border-color:var(--bs-nav-tabs-link-active-border-color)}.nav-tabs .dropdown-menu{margin-top:calc(-1*var(--bs-nav-tabs-border-width));border-top-left-radius:0;border-top-right-radius:0}.nav-pills{--bs-nav-pills-border-radius: 0.375rem;--bs-nav-pills-link-active-color: #ffffff;--bs-nav-pills-link-active-bg: #0d6efd}.nav-pills .nav-link{border-radius:var(--bs-nav-pills-border-radius)}.nav-pills .nav-link.active,.nav-pills .show>.nav-link{color:var(--bs-nav-pills-link-active-color);background-color:var(--bs-nav-pills-link-active-bg)}.nav-underline{--bs-nav-underline-gap: 1rem;--bs-nav-underline-border-width: 0.125rem;--bs-nav-underline-link-active-color: #000;gap:var(--bs-nav-underline-gap)}.nav-underline .nav-link{padding-right:0;padding-left:0;border-bottom:var(--bs-nav-underline-border-width) solid rgba(0,0,0,0)}.nav-underline .nav-link:hover,.nav-underline .nav-link:focus{border-bottom-color:currentcolor}.nav-underline .nav-link.active,.nav-underline .show>.nav-link{font-weight:700;color:var(--bs-nav-underline-link-active-color);border-bottom-color:currentcolor}.nav-fill>.nav-link,.nav-fill .nav-item{flex:1 1 auto;-webkit-flex:1 1 auto;text-align:center}.nav-justified>.nav-link,.nav-justified .nav-item{flex-basis:0;-webkit-flex-basis:0;flex-grow:1;-webkit-flex-grow:1;text-align:center}.nav-fill .nav-item .nav-link,.nav-justified .nav-item .nav-link{width:100%}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.navbar{--bs-navbar-padding-x: 0;--bs-navbar-padding-y: 0.5rem;--bs-navbar-color: #fdfefe;--bs-navbar-hover-color: rgba(253, 254, 255, 0.8);--bs-navbar-disabled-color: rgba(253, 254, 254, 0.75);--bs-navbar-active-color: #fdfeff;--bs-navbar-brand-padding-y: 0.3125rem;--bs-navbar-brand-margin-end: 1rem;--bs-navbar-brand-font-size: 1.25rem;--bs-navbar-brand-color: #fdfefe;--bs-navbar-brand-hover-color: #fdfeff;--bs-navbar-nav-link-padding-x: 0.5rem;--bs-navbar-toggler-padding-y: 0.25;--bs-navbar-toggler-padding-x: 0;--bs-navbar-toggler-font-size: 1.25rem;--bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23fdfefe' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");--bs-navbar-toggler-border-color: rgba(253, 254, 254, 0);--bs-navbar-toggler-border-radius: 0.375rem;--bs-navbar-toggler-focus-width: 0.25rem;--bs-navbar-toggler-transition: box-shadow 0.15s ease-in-out;position:relative;display:flex;display:-webkit-flex;flex-wrap:wrap;-webkit-flex-wrap:wrap;align-items:center;-webkit-align-items:center;justify-content:space-between;-webkit-justify-content:space-between;padding:var(--bs-navbar-padding-y) var(--bs-navbar-padding-x)}.navbar>.container,.navbar>.container-fluid,.navbar>.container-sm,.navbar>.container-md,.navbar>.container-lg,.navbar>.container-xl,.navbar>.container-xxl{display:flex;display:-webkit-flex;flex-wrap:inherit;-webkit-flex-wrap:inherit;align-items:center;-webkit-align-items:center;justify-content:space-between;-webkit-justify-content:space-between}.navbar-brand{padding-top:var(--bs-navbar-brand-padding-y);padding-bottom:var(--bs-navbar-brand-padding-y);margin-right:var(--bs-navbar-brand-margin-end);font-size:var(--bs-navbar-brand-font-size);color:var(--bs-navbar-brand-color);text-decoration:none;-webkit-text-decoration:none;-moz-text-decoration:none;-ms-text-decoration:none;-o-text-decoration:none;white-space:nowrap}.navbar-brand:hover,.navbar-brand:focus{color:var(--bs-navbar-brand-hover-color)}.navbar-nav{--bs-nav-link-padding-x: 0;--bs-nav-link-padding-y: 0.5rem;--bs-nav-link-font-weight: ;--bs-nav-link-color: var(--bs-navbar-color);--bs-nav-link-hover-color: var(--bs-navbar-hover-color);--bs-nav-link-disabled-color: var(--bs-navbar-disabled-color);display:flex;display:-webkit-flex;flex-direction:column;-webkit-flex-direction:column;padding-left:0;margin-bottom:0;list-style:none}.navbar-nav .nav-link.active,.navbar-nav .nav-link.show{color:var(--bs-navbar-active-color)}.navbar-nav .dropdown-menu{position:static}.navbar-text{padding-top:.5rem;padding-bottom:.5rem;color:var(--bs-navbar-color)}.navbar-text a,.navbar-text a:hover,.navbar-text a:focus{color:var(--bs-navbar-active-color)}.navbar-collapse{flex-basis:100%;-webkit-flex-basis:100%;flex-grow:1;-webkit-flex-grow:1;align-items:center;-webkit-align-items:center}.navbar-toggler{padding:var(--bs-navbar-toggler-padding-y) var(--bs-navbar-toggler-padding-x);font-size:var(--bs-navbar-toggler-font-size);line-height:1;color:var(--bs-navbar-color);background-color:rgba(0,0,0,0);border:var(--bs-border-width) solid var(--bs-navbar-toggler-border-color);border-radius:var(--bs-navbar-toggler-border-radius);transition:var(--bs-navbar-toggler-transition)}@media(prefers-reduced-motion: reduce){.navbar-toggler{transition:none}}.navbar-toggler:hover{text-decoration:none}.navbar-toggler:focus{text-decoration:none;outline:0;box-shadow:0 0 0 var(--bs-navbar-toggler-focus-width)}.navbar-toggler-icon{display:inline-block;width:1.5em;height:1.5em;vertical-align:middle;background-image:var(--bs-navbar-toggler-icon-bg);background-repeat:no-repeat;background-position:center;background-size:100%}.navbar-nav-scroll{max-height:var(--bs-scroll-height, 75vh);overflow-y:auto}@media(min-width: 576px){.navbar-expand-sm{flex-wrap:nowrap;-webkit-flex-wrap:nowrap;justify-content:flex-start;-webkit-justify-content:flex-start}.navbar-expand-sm .navbar-nav{flex-direction:row;-webkit-flex-direction:row}.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-sm .navbar-nav .nav-link{padding-right:var(--bs-navbar-nav-link-padding-x);padding-left:var(--bs-navbar-nav-link-padding-x)}.navbar-expand-sm .navbar-nav-scroll{overflow:visible}.navbar-expand-sm .navbar-collapse{display:flex !important;display:-webkit-flex !important;flex-basis:auto;-webkit-flex-basis:auto}.navbar-expand-sm .navbar-toggler{display:none}.navbar-expand-sm .offcanvas{position:static;z-index:auto;flex-grow:1;-webkit-flex-grow:1;width:auto !important;height:auto !important;visibility:visible !important;background-color:rgba(0,0,0,0) !important;border:0 !important;transform:none !important;transition:none}.navbar-expand-sm .offcanvas .offcanvas-header{display:none}.navbar-expand-sm .offcanvas .offcanvas-body{display:flex;display:-webkit-flex;flex-grow:0;-webkit-flex-grow:0;padding:0;overflow-y:visible}}@media(min-width: 768px){.navbar-expand-md{flex-wrap:nowrap;-webkit-flex-wrap:nowrap;justify-content:flex-start;-webkit-justify-content:flex-start}.navbar-expand-md .navbar-nav{flex-direction:row;-webkit-flex-direction:row}.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-md .navbar-nav .nav-link{padding-right:var(--bs-navbar-nav-link-padding-x);padding-left:var(--bs-navbar-nav-link-padding-x)}.navbar-expand-md .navbar-nav-scroll{overflow:visible}.navbar-expand-md .navbar-collapse{display:flex !important;display:-webkit-flex !important;flex-basis:auto;-webkit-flex-basis:auto}.navbar-expand-md .navbar-toggler{display:none}.navbar-expand-md .offcanvas{position:static;z-index:auto;flex-grow:1;-webkit-flex-grow:1;width:auto !important;height:auto !important;visibility:visible !important;background-color:rgba(0,0,0,0) !important;border:0 !important;transform:none !important;transition:none}.navbar-expand-md .offcanvas .offcanvas-header{display:none}.navbar-expand-md .offcanvas .offcanvas-body{display:flex;display:-webkit-flex;flex-grow:0;-webkit-flex-grow:0;padding:0;overflow-y:visible}}@media(min-width: 992px){.navbar-expand-lg{flex-wrap:nowrap;-webkit-flex-wrap:nowrap;justify-content:flex-start;-webkit-justify-content:flex-start}.navbar-expand-lg .navbar-nav{flex-direction:row;-webkit-flex-direction:row}.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-lg .navbar-nav .nav-link{padding-right:var(--bs-navbar-nav-link-padding-x);padding-left:var(--bs-navbar-nav-link-padding-x)}.navbar-expand-lg .navbar-nav-scroll{overflow:visible}.navbar-expand-lg .navbar-collapse{display:flex !important;display:-webkit-flex !important;flex-basis:auto;-webkit-flex-basis:auto}.navbar-expand-lg .navbar-toggler{display:none}.navbar-expand-lg .offcanvas{position:static;z-index:auto;flex-grow:1;-webkit-flex-grow:1;width:auto !important;height:auto !important;visibility:visible !important;background-color:rgba(0,0,0,0) !important;border:0 !important;transform:none !important;transition:none}.navbar-expand-lg .offcanvas .offcanvas-header{display:none}.navbar-expand-lg .offcanvas .offcanvas-body{display:flex;display:-webkit-flex;flex-grow:0;-webkit-flex-grow:0;padding:0;overflow-y:visible}}@media(min-width: 1200px){.navbar-expand-xl{flex-wrap:nowrap;-webkit-flex-wrap:nowrap;justify-content:flex-start;-webkit-justify-content:flex-start}.navbar-expand-xl .navbar-nav{flex-direction:row;-webkit-flex-direction:row}.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xl .navbar-nav .nav-link{padding-right:var(--bs-navbar-nav-link-padding-x);padding-left:var(--bs-navbar-nav-link-padding-x)}.navbar-expand-xl .navbar-nav-scroll{overflow:visible}.navbar-expand-xl .navbar-collapse{display:flex !important;display:-webkit-flex !important;flex-basis:auto;-webkit-flex-basis:auto}.navbar-expand-xl .navbar-toggler{display:none}.navbar-expand-xl .offcanvas{position:static;z-index:auto;flex-grow:1;-webkit-flex-grow:1;width:auto !important;height:auto !important;visibility:visible !important;background-color:rgba(0,0,0,0) !important;border:0 !important;transform:none !important;transition:none}.navbar-expand-xl .offcanvas .offcanvas-header{display:none}.navbar-expand-xl .offcanvas .offcanvas-body{display:flex;display:-webkit-flex;flex-grow:0;-webkit-flex-grow:0;padding:0;overflow-y:visible}}@media(min-width: 1400px){.navbar-expand-xxl{flex-wrap:nowrap;-webkit-flex-wrap:nowrap;justify-content:flex-start;-webkit-justify-content:flex-start}.navbar-expand-xxl .navbar-nav{flex-direction:row;-webkit-flex-direction:row}.navbar-expand-xxl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xxl .navbar-nav .nav-link{padding-right:var(--bs-navbar-nav-link-padding-x);padding-left:var(--bs-navbar-nav-link-padding-x)}.navbar-expand-xxl .navbar-nav-scroll{overflow:visible}.navbar-expand-xxl .navbar-collapse{display:flex !important;display:-webkit-flex !important;flex-basis:auto;-webkit-flex-basis:auto}.navbar-expand-xxl .navbar-toggler{display:none}.navbar-expand-xxl .offcanvas{position:static;z-index:auto;flex-grow:1;-webkit-flex-grow:1;width:auto !important;height:auto !important;visibility:visible !important;background-color:rgba(0,0,0,0) !important;border:0 !important;transform:none !important;transition:none}.navbar-expand-xxl .offcanvas .offcanvas-header{display:none}.navbar-expand-xxl .offcanvas .offcanvas-body{display:flex;display:-webkit-flex;flex-grow:0;-webkit-flex-grow:0;padding:0;overflow-y:visible}}.navbar-expand{flex-wrap:nowrap;-webkit-flex-wrap:nowrap;justify-content:flex-start;-webkit-justify-content:flex-start}.navbar-expand .navbar-nav{flex-direction:row;-webkit-flex-direction:row}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.navbar-expand .navbar-nav .nav-link{padding-right:var(--bs-navbar-nav-link-padding-x);padding-left:var(--bs-navbar-nav-link-padding-x)}.navbar-expand .navbar-nav-scroll{overflow:visible}.navbar-expand .navbar-collapse{display:flex !important;display:-webkit-flex !important;flex-basis:auto;-webkit-flex-basis:auto}.navbar-expand .navbar-toggler{display:none}.navbar-expand .offcanvas{position:static;z-index:auto;flex-grow:1;-webkit-flex-grow:1;width:auto !important;height:auto !important;visibility:visible !important;background-color:rgba(0,0,0,0) !important;border:0 !important;transform:none !important;transition:none}.navbar-expand .offcanvas .offcanvas-header{display:none}.navbar-expand .offcanvas .offcanvas-body{display:flex;display:-webkit-flex;flex-grow:0;-webkit-flex-grow:0;padding:0;overflow-y:visible}.navbar-dark,.navbar[data-bs-theme=dark]{--bs-navbar-color: #fdfefe;--bs-navbar-hover-color: rgba(253, 254, 255, 0.8);--bs-navbar-disabled-color: rgba(253, 254, 254, 0.75);--bs-navbar-active-color: #fdfeff;--bs-navbar-brand-color: #fdfefe;--bs-navbar-brand-hover-color: #fdfeff;--bs-navbar-toggler-border-color: rgba(253, 254, 254, 0);--bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23fdfefe' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}[data-bs-theme=dark] .navbar-toggler-icon{--bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23fdfefe' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}.card{--bs-card-spacer-y: 1rem;--bs-card-spacer-x: 1rem;--bs-card-title-spacer-y: 0.5rem;--bs-card-title-color: ;--bs-card-subtitle-color: ;--bs-card-border-width: 1px;--bs-card-border-color: rgba(0, 0, 0, 0.175);--bs-card-border-radius: 0.375rem;--bs-card-box-shadow: ;--bs-card-inner-border-radius: calc(0.375rem - 1px);--bs-card-cap-padding-y: 0.5rem;--bs-card-cap-padding-x: 1rem;--bs-card-cap-bg: rgba(33, 37, 41, 0.03);--bs-card-cap-color: ;--bs-card-height: ;--bs-card-color: ;--bs-card-bg: #ffffff;--bs-card-img-overlay-padding: 1rem;--bs-card-group-margin: 0.75rem;position:relative;display:flex;display:-webkit-flex;flex-direction:column;-webkit-flex-direction:column;min-width:0;height:var(--bs-card-height);color:var(--bs-body-color);word-wrap:break-word;background-color:var(--bs-card-bg);background-clip:border-box;border:var(--bs-card-border-width) solid var(--bs-card-border-color);border-radius:var(--bs-card-border-radius)}.card>hr{margin-right:0;margin-left:0}.card>.list-group{border-top:inherit;border-bottom:inherit}.card>.list-group:first-child{border-top-width:0;border-top-left-radius:var(--bs-card-inner-border-radius);border-top-right-radius:var(--bs-card-inner-border-radius)}.card>.list-group:last-child{border-bottom-width:0;border-bottom-right-radius:var(--bs-card-inner-border-radius);border-bottom-left-radius:var(--bs-card-inner-border-radius)}.card>.card-header+.list-group,.card>.list-group+.card-footer{border-top:0}.card-body{flex:1 1 auto;-webkit-flex:1 1 auto;padding:var(--bs-card-spacer-y) var(--bs-card-spacer-x);color:var(--bs-card-color)}.card-title{margin-bottom:var(--bs-card-title-spacer-y);color:var(--bs-card-title-color)}.card-subtitle{margin-top:calc(-0.5*var(--bs-card-title-spacer-y));margin-bottom:0;color:var(--bs-card-subtitle-color)}.card-text:last-child{margin-bottom:0}.card-link+.card-link{margin-left:var(--bs-card-spacer-x)}.card-header{padding:var(--bs-card-cap-padding-y) var(--bs-card-cap-padding-x);margin-bottom:0;color:var(--bs-card-cap-color);background-color:var(--bs-card-cap-bg);border-bottom:var(--bs-card-border-width) solid var(--bs-card-border-color)}.card-header:first-child{border-radius:var(--bs-card-inner-border-radius) var(--bs-card-inner-border-radius) 0 0}.card-footer{padding:var(--bs-card-cap-padding-y) var(--bs-card-cap-padding-x);color:var(--bs-card-cap-color);background-color:var(--bs-card-cap-bg);border-top:var(--bs-card-border-width) solid var(--bs-card-border-color)}.card-footer:last-child{border-radius:0 0 var(--bs-card-inner-border-radius) var(--bs-card-inner-border-radius)}.card-header-tabs{margin-right:calc(-0.5*var(--bs-card-cap-padding-x));margin-bottom:calc(-1*var(--bs-card-cap-padding-y));margin-left:calc(-0.5*var(--bs-card-cap-padding-x));border-bottom:0}.card-header-tabs .nav-link.active{background-color:var(--bs-card-bg);border-bottom-color:var(--bs-card-bg)}.card-header-pills{margin-right:calc(-0.5*var(--bs-card-cap-padding-x));margin-left:calc(-0.5*var(--bs-card-cap-padding-x))}.card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:var(--bs-card-img-overlay-padding);border-radius:var(--bs-card-inner-border-radius)}.card-img,.card-img-top,.card-img-bottom{width:100%}.card-img,.card-img-top{border-top-left-radius:var(--bs-card-inner-border-radius);border-top-right-radius:var(--bs-card-inner-border-radius)}.card-img,.card-img-bottom{border-bottom-right-radius:var(--bs-card-inner-border-radius);border-bottom-left-radius:var(--bs-card-inner-border-radius)}.card-group>.card{margin-bottom:var(--bs-card-group-margin)}@media(min-width: 576px){.card-group{display:flex;display:-webkit-flex;flex-flow:row wrap;-webkit-flex-flow:row wrap}.card-group>.card{flex:1 0 0%;-webkit-flex:1 0 0%;margin-bottom:0}.card-group>.card+.card{margin-left:0;border-left:0}.card-group>.card:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.card-group>.card:not(:last-child) .card-img-top,.card-group>.card:not(:last-child) .card-header{border-top-right-radius:0}.card-group>.card:not(:last-child) .card-img-bottom,.card-group>.card:not(:last-child) .card-footer{border-bottom-right-radius:0}.card-group>.card:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.card-group>.card:not(:first-child) .card-img-top,.card-group>.card:not(:first-child) .card-header{border-top-left-radius:0}.card-group>.card:not(:first-child) .card-img-bottom,.card-group>.card:not(:first-child) .card-footer{border-bottom-left-radius:0}}.accordion{--bs-accordion-color: #212529;--bs-accordion-bg: #ffffff;--bs-accordion-transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, border-radius 0.15s ease;--bs-accordion-border-color: #dee2e6;--bs-accordion-border-width: 1px;--bs-accordion-border-radius: 0.375rem;--bs-accordion-inner-border-radius: calc(0.375rem - 1px);--bs-accordion-btn-padding-x: 1.25rem;--bs-accordion-btn-padding-y: 1rem;--bs-accordion-btn-color: #212529;--bs-accordion-btn-bg: #ffffff;--bs-accordion-btn-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23212529'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");--bs-accordion-btn-icon-width: 1.25rem;--bs-accordion-btn-icon-transform: rotate(-180deg);--bs-accordion-btn-icon-transition: transform 0.2s ease-in-out;--bs-accordion-btn-active-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23052c65'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");--bs-accordion-btn-focus-border-color: #86b7fe;--bs-accordion-btn-focus-box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);--bs-accordion-body-padding-x: 1.25rem;--bs-accordion-body-padding-y: 1rem;--bs-accordion-active-color: #052c65;--bs-accordion-active-bg: #cfe2ff}.accordion-button{position:relative;display:flex;display:-webkit-flex;align-items:center;-webkit-align-items:center;width:100%;padding:var(--bs-accordion-btn-padding-y) var(--bs-accordion-btn-padding-x);font-size:1rem;color:var(--bs-accordion-btn-color);text-align:left;background-color:var(--bs-accordion-btn-bg);border:0;border-radius:0;overflow-anchor:none;transition:var(--bs-accordion-transition)}@media(prefers-reduced-motion: reduce){.accordion-button{transition:none}}.accordion-button:not(.collapsed){color:var(--bs-accordion-active-color);background-color:var(--bs-accordion-active-bg);box-shadow:inset 0 calc(-1*var(--bs-accordion-border-width)) 0 var(--bs-accordion-border-color)}.accordion-button:not(.collapsed)::after{background-image:var(--bs-accordion-btn-active-icon);transform:var(--bs-accordion-btn-icon-transform)}.accordion-button::after{flex-shrink:0;-webkit-flex-shrink:0;width:var(--bs-accordion-btn-icon-width);height:var(--bs-accordion-btn-icon-width);margin-left:auto;content:"";background-image:var(--bs-accordion-btn-icon);background-repeat:no-repeat;background-size:var(--bs-accordion-btn-icon-width);transition:var(--bs-accordion-btn-icon-transition)}@media(prefers-reduced-motion: reduce){.accordion-button::after{transition:none}}.accordion-button:hover{z-index:2}.accordion-button:focus{z-index:3;border-color:var(--bs-accordion-btn-focus-border-color);outline:0;box-shadow:var(--bs-accordion-btn-focus-box-shadow)}.accordion-header{margin-bottom:0}.accordion-item{color:var(--bs-accordion-color);background-color:var(--bs-accordion-bg);border:var(--bs-accordion-border-width) solid var(--bs-accordion-border-color)}.accordion-item:first-of-type{border-top-left-radius:var(--bs-accordion-border-radius);border-top-right-radius:var(--bs-accordion-border-radius)}.accordion-item:first-of-type .accordion-button{border-top-left-radius:var(--bs-accordion-inner-border-radius);border-top-right-radius:var(--bs-accordion-inner-border-radius)}.accordion-item:not(:first-of-type){border-top:0}.accordion-item:last-of-type{border-bottom-right-radius:var(--bs-accordion-border-radius);border-bottom-left-radius:var(--bs-accordion-border-radius)}.accordion-item:last-of-type .accordion-button.collapsed{border-bottom-right-radius:var(--bs-accordion-inner-border-radius);border-bottom-left-radius:var(--bs-accordion-inner-border-radius)}.accordion-item:last-of-type .accordion-collapse{border-bottom-right-radius:var(--bs-accordion-border-radius);border-bottom-left-radius:var(--bs-accordion-border-radius)}.accordion-body{padding:var(--bs-accordion-body-padding-y) var(--bs-accordion-body-padding-x)}.accordion-flush .accordion-collapse{border-width:0}.accordion-flush .accordion-item{border-right:0;border-left:0;border-radius:0}.accordion-flush .accordion-item:first-child{border-top:0}.accordion-flush .accordion-item:last-child{border-bottom:0}.accordion-flush .accordion-item .accordion-button,.accordion-flush .accordion-item .accordion-button.collapsed{border-radius:0}[data-bs-theme=dark] .accordion-button::after{--bs-accordion-btn-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236ea8fe'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");--bs-accordion-btn-active-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236ea8fe'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e")}.breadcrumb{--bs-breadcrumb-padding-x: 0;--bs-breadcrumb-padding-y: 0;--bs-breadcrumb-margin-bottom: 1rem;--bs-breadcrumb-bg: ;--bs-breadcrumb-border-radius: ;--bs-breadcrumb-divider-color: rgba(33, 37, 41, 0.75);--bs-breadcrumb-item-padding-x: 0.5rem;--bs-breadcrumb-item-active-color: rgba(33, 37, 41, 0.75);display:flex;display:-webkit-flex;flex-wrap:wrap;-webkit-flex-wrap:wrap;padding:var(--bs-breadcrumb-padding-y) var(--bs-breadcrumb-padding-x);margin-bottom:var(--bs-breadcrumb-margin-bottom);font-size:var(--bs-breadcrumb-font-size);list-style:none;background-color:var(--bs-breadcrumb-bg);border-radius:var(--bs-breadcrumb-border-radius)}.breadcrumb-item+.breadcrumb-item{padding-left:var(--bs-breadcrumb-item-padding-x)}.breadcrumb-item+.breadcrumb-item::before{float:left;padding-right:var(--bs-breadcrumb-item-padding-x);color:var(--bs-breadcrumb-divider-color);content:var(--bs-breadcrumb-divider, ">") /* rtl: var(--bs-breadcrumb-divider, ">") */}.breadcrumb-item.active{color:var(--bs-breadcrumb-item-active-color)}.pagination{--bs-pagination-padding-x: 0.75rem;--bs-pagination-padding-y: 0.375rem;--bs-pagination-font-size:1rem;--bs-pagination-color: #0d6efd;--bs-pagination-bg: #ffffff;--bs-pagination-border-width: 1px;--bs-pagination-border-color: #dee2e6;--bs-pagination-border-radius: 0.375rem;--bs-pagination-hover-color: #0a58ca;--bs-pagination-hover-bg: #f8f9fa;--bs-pagination-hover-border-color: #dee2e6;--bs-pagination-focus-color: #0a58ca;--bs-pagination-focus-bg: #e9ecef;--bs-pagination-focus-box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);--bs-pagination-active-color: #ffffff;--bs-pagination-active-bg: #0d6efd;--bs-pagination-active-border-color: #0d6efd;--bs-pagination-disabled-color: rgba(33, 37, 41, 0.75);--bs-pagination-disabled-bg: #e9ecef;--bs-pagination-disabled-border-color: #dee2e6;display:flex;display:-webkit-flex;padding-left:0;list-style:none}.page-link{position:relative;display:block;padding:var(--bs-pagination-padding-y) var(--bs-pagination-padding-x);font-size:var(--bs-pagination-font-size);color:var(--bs-pagination-color);text-decoration:none;-webkit-text-decoration:none;-moz-text-decoration:none;-ms-text-decoration:none;-o-text-decoration:none;background-color:var(--bs-pagination-bg);border:var(--bs-pagination-border-width) solid var(--bs-pagination-border-color);transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media(prefers-reduced-motion: reduce){.page-link{transition:none}}.page-link:hover{z-index:2;color:var(--bs-pagination-hover-color);background-color:var(--bs-pagination-hover-bg);border-color:var(--bs-pagination-hover-border-color)}.page-link:focus{z-index:3;color:var(--bs-pagination-focus-color);background-color:var(--bs-pagination-focus-bg);outline:0;box-shadow:var(--bs-pagination-focus-box-shadow)}.page-link.active,.active>.page-link{z-index:3;color:var(--bs-pagination-active-color);background-color:var(--bs-pagination-active-bg);border-color:var(--bs-pagination-active-border-color)}.page-link.disabled,.disabled>.page-link{color:var(--bs-pagination-disabled-color);pointer-events:none;background-color:var(--bs-pagination-disabled-bg);border-color:var(--bs-pagination-disabled-border-color)}.page-item:not(:first-child) .page-link{margin-left:calc(1px*-1)}.page-item:first-child .page-link{border-top-left-radius:var(--bs-pagination-border-radius);border-bottom-left-radius:var(--bs-pagination-border-radius)}.page-item:last-child .page-link{border-top-right-radius:var(--bs-pagination-border-radius);border-bottom-right-radius:var(--bs-pagination-border-radius)}.pagination-lg{--bs-pagination-padding-x: 1.5rem;--bs-pagination-padding-y: 0.75rem;--bs-pagination-font-size:1.25rem;--bs-pagination-border-radius: 0.5rem}.pagination-sm{--bs-pagination-padding-x: 0.5rem;--bs-pagination-padding-y: 0.25rem;--bs-pagination-font-size:0.875rem;--bs-pagination-border-radius: 0.25rem}.badge{--bs-badge-padding-x: 0.65em;--bs-badge-padding-y: 0.35em;--bs-badge-font-size:0.75em;--bs-badge-font-weight: 700;--bs-badge-color: #ffffff;--bs-badge-border-radius: 0.375rem;display:inline-block;padding:var(--bs-badge-padding-y) var(--bs-badge-padding-x);font-size:var(--bs-badge-font-size);font-weight:var(--bs-badge-font-weight);line-height:1;color:var(--bs-badge-color);text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:var(--bs-badge-border-radius)}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.alert{--bs-alert-bg: transparent;--bs-alert-padding-x: 1rem;--bs-alert-padding-y: 1rem;--bs-alert-margin-bottom: 1rem;--bs-alert-color: inherit;--bs-alert-border-color: transparent;--bs-alert-border: 1px solid var(--bs-alert-border-color);--bs-alert-border-radius: 0.375rem;--bs-alert-link-color: inherit;position:relative;padding:var(--bs-alert-padding-y) var(--bs-alert-padding-x);margin-bottom:var(--bs-alert-margin-bottom);color:var(--bs-alert-color);background-color:var(--bs-alert-bg);border:var(--bs-alert-border);border-radius:var(--bs-alert-border-radius)}.alert-heading{color:inherit}.alert-link{font-weight:700;color:var(--bs-alert-link-color)}.alert-dismissible{padding-right:3rem}.alert-dismissible .btn-close{position:absolute;top:0;right:0;z-index:2;padding:1.25rem 1rem}.alert-default{--bs-alert-color: var(--bs-default-text-emphasis);--bs-alert-bg: var(--bs-default-bg-subtle);--bs-alert-border-color: var(--bs-default-border-subtle);--bs-alert-link-color: var(--bs-default-text-emphasis)}.alert-primary{--bs-alert-color: var(--bs-primary-text-emphasis);--bs-alert-bg: var(--bs-primary-bg-subtle);--bs-alert-border-color: var(--bs-primary-border-subtle);--bs-alert-link-color: var(--bs-primary-text-emphasis)}.alert-secondary{--bs-alert-color: var(--bs-secondary-text-emphasis);--bs-alert-bg: var(--bs-secondary-bg-subtle);--bs-alert-border-color: var(--bs-secondary-border-subtle);--bs-alert-link-color: var(--bs-secondary-text-emphasis)}.alert-success{--bs-alert-color: var(--bs-success-text-emphasis);--bs-alert-bg: var(--bs-success-bg-subtle);--bs-alert-border-color: var(--bs-success-border-subtle);--bs-alert-link-color: var(--bs-success-text-emphasis)}.alert-info{--bs-alert-color: var(--bs-info-text-emphasis);--bs-alert-bg: var(--bs-info-bg-subtle);--bs-alert-border-color: var(--bs-info-border-subtle);--bs-alert-link-color: var(--bs-info-text-emphasis)}.alert-warning{--bs-alert-color: var(--bs-warning-text-emphasis);--bs-alert-bg: var(--bs-warning-bg-subtle);--bs-alert-border-color: var(--bs-warning-border-subtle);--bs-alert-link-color: var(--bs-warning-text-emphasis)}.alert-danger{--bs-alert-color: var(--bs-danger-text-emphasis);--bs-alert-bg: var(--bs-danger-bg-subtle);--bs-alert-border-color: var(--bs-danger-border-subtle);--bs-alert-link-color: var(--bs-danger-text-emphasis)}.alert-light{--bs-alert-color: var(--bs-light-text-emphasis);--bs-alert-bg: var(--bs-light-bg-subtle);--bs-alert-border-color: var(--bs-light-border-subtle);--bs-alert-link-color: var(--bs-light-text-emphasis)}.alert-dark{--bs-alert-color: var(--bs-dark-text-emphasis);--bs-alert-bg: var(--bs-dark-bg-subtle);--bs-alert-border-color: var(--bs-dark-border-subtle);--bs-alert-link-color: var(--bs-dark-text-emphasis)}@keyframes progress-bar-stripes{0%{background-position-x:1rem}}.progress,.progress-stacked{--bs-progress-height: 1rem;--bs-progress-font-size:0.75rem;--bs-progress-bg: #e9ecef;--bs-progress-border-radius: 0.375rem;--bs-progress-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.075);--bs-progress-bar-color: #ffffff;--bs-progress-bar-bg: #0d6efd;--bs-progress-bar-transition: width 0.6s ease;display:flex;display:-webkit-flex;height:var(--bs-progress-height);overflow:hidden;font-size:var(--bs-progress-font-size);background-color:var(--bs-progress-bg);border-radius:var(--bs-progress-border-radius)}.progress-bar{display:flex;display:-webkit-flex;flex-direction:column;-webkit-flex-direction:column;justify-content:center;-webkit-justify-content:center;overflow:hidden;color:var(--bs-progress-bar-color);text-align:center;white-space:nowrap;background-color:var(--bs-progress-bar-bg);transition:var(--bs-progress-bar-transition)}@media(prefers-reduced-motion: reduce){.progress-bar{transition:none}}.progress-bar-striped{background-image:linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-size:var(--bs-progress-height) var(--bs-progress-height)}.progress-stacked>.progress{overflow:visible}.progress-stacked>.progress>.progress-bar{width:100%}.progress-bar-animated{animation:1s linear infinite progress-bar-stripes}@media(prefers-reduced-motion: reduce){.progress-bar-animated{animation:none}}.list-group{--bs-list-group-color: #212529;--bs-list-group-bg: #ffffff;--bs-list-group-border-color: #dee2e6;--bs-list-group-border-width: 1px;--bs-list-group-border-radius: 0.375rem;--bs-list-group-item-padding-x: 1rem;--bs-list-group-item-padding-y: 0.5rem;--bs-list-group-action-color: rgba(33, 37, 41, 0.75);--bs-list-group-action-hover-color: #000;--bs-list-group-action-hover-bg: #f8f9fa;--bs-list-group-action-active-color: #212529;--bs-list-group-action-active-bg: #e9ecef;--bs-list-group-disabled-color: rgba(33, 37, 41, 0.75);--bs-list-group-disabled-bg: #ffffff;--bs-list-group-active-color: #ffffff;--bs-list-group-active-bg: #0d6efd;--bs-list-group-active-border-color: #0d6efd;display:flex;display:-webkit-flex;flex-direction:column;-webkit-flex-direction:column;padding-left:0;margin-bottom:0;border-radius:var(--bs-list-group-border-radius)}.list-group-numbered{list-style-type:none;counter-reset:section}.list-group-numbered>.list-group-item::before{content:counters(section, ".") ". ";counter-increment:section}.list-group-item-action{width:100%;color:var(--bs-list-group-action-color);text-align:inherit}.list-group-item-action:hover,.list-group-item-action:focus{z-index:1;color:var(--bs-list-group-action-hover-color);text-decoration:none;background-color:var(--bs-list-group-action-hover-bg)}.list-group-item-action:active{color:var(--bs-list-group-action-active-color);background-color:var(--bs-list-group-action-active-bg)}.list-group-item{position:relative;display:block;padding:var(--bs-list-group-item-padding-y) var(--bs-list-group-item-padding-x);color:var(--bs-list-group-color);text-decoration:none;-webkit-text-decoration:none;-moz-text-decoration:none;-ms-text-decoration:none;-o-text-decoration:none;background-color:var(--bs-list-group-bg);border:var(--bs-list-group-border-width) solid var(--bs-list-group-border-color)}.list-group-item:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.list-group-item:last-child{border-bottom-right-radius:inherit;border-bottom-left-radius:inherit}.list-group-item.disabled,.list-group-item:disabled{color:var(--bs-list-group-disabled-color);pointer-events:none;background-color:var(--bs-list-group-disabled-bg)}.list-group-item.active{z-index:2;color:var(--bs-list-group-active-color);background-color:var(--bs-list-group-active-bg);border-color:var(--bs-list-group-active-border-color)}.list-group-item+.list-group-item{border-top-width:0}.list-group-item+.list-group-item.active{margin-top:calc(-1*var(--bs-list-group-border-width));border-top-width:var(--bs-list-group-border-width)}.list-group-horizontal{flex-direction:row;-webkit-flex-direction:row}.list-group-horizontal>.list-group-item:first-child:not(:last-child){border-bottom-left-radius:var(--bs-list-group-border-radius);border-top-right-radius:0}.list-group-horizontal>.list-group-item:last-child:not(:first-child){border-top-right-radius:var(--bs-list-group-border-radius);border-bottom-left-radius:0}.list-group-horizontal>.list-group-item.active{margin-top:0}.list-group-horizontal>.list-group-item+.list-group-item{border-top-width:var(--bs-list-group-border-width);border-left-width:0}.list-group-horizontal>.list-group-item+.list-group-item.active{margin-left:calc(-1*var(--bs-list-group-border-width));border-left-width:var(--bs-list-group-border-width)}@media(min-width: 576px){.list-group-horizontal-sm{flex-direction:row;-webkit-flex-direction:row}.list-group-horizontal-sm>.list-group-item:first-child:not(:last-child){border-bottom-left-radius:var(--bs-list-group-border-radius);border-top-right-radius:0}.list-group-horizontal-sm>.list-group-item:last-child:not(:first-child){border-top-right-radius:var(--bs-list-group-border-radius);border-bottom-left-radius:0}.list-group-horizontal-sm>.list-group-item.active{margin-top:0}.list-group-horizontal-sm>.list-group-item+.list-group-item{border-top-width:var(--bs-list-group-border-width);border-left-width:0}.list-group-horizontal-sm>.list-group-item+.list-group-item.active{margin-left:calc(-1*var(--bs-list-group-border-width));border-left-width:var(--bs-list-group-border-width)}}@media(min-width: 768px){.list-group-horizontal-md{flex-direction:row;-webkit-flex-direction:row}.list-group-horizontal-md>.list-group-item:first-child:not(:last-child){border-bottom-left-radius:var(--bs-list-group-border-radius);border-top-right-radius:0}.list-group-horizontal-md>.list-group-item:last-child:not(:first-child){border-top-right-radius:var(--bs-list-group-border-radius);border-bottom-left-radius:0}.list-group-horizontal-md>.list-group-item.active{margin-top:0}.list-group-horizontal-md>.list-group-item+.list-group-item{border-top-width:var(--bs-list-group-border-width);border-left-width:0}.list-group-horizontal-md>.list-group-item+.list-group-item.active{margin-left:calc(-1*var(--bs-list-group-border-width));border-left-width:var(--bs-list-group-border-width)}}@media(min-width: 992px){.list-group-horizontal-lg{flex-direction:row;-webkit-flex-direction:row}.list-group-horizontal-lg>.list-group-item:first-child:not(:last-child){border-bottom-left-radius:var(--bs-list-group-border-radius);border-top-right-radius:0}.list-group-horizontal-lg>.list-group-item:last-child:not(:first-child){border-top-right-radius:var(--bs-list-group-border-radius);border-bottom-left-radius:0}.list-group-horizontal-lg>.list-group-item.active{margin-top:0}.list-group-horizontal-lg>.list-group-item+.list-group-item{border-top-width:var(--bs-list-group-border-width);border-left-width:0}.list-group-horizontal-lg>.list-group-item+.list-group-item.active{margin-left:calc(-1*var(--bs-list-group-border-width));border-left-width:var(--bs-list-group-border-width)}}@media(min-width: 1200px){.list-group-horizontal-xl{flex-direction:row;-webkit-flex-direction:row}.list-group-horizontal-xl>.list-group-item:first-child:not(:last-child){border-bottom-left-radius:var(--bs-list-group-border-radius);border-top-right-radius:0}.list-group-horizontal-xl>.list-group-item:last-child:not(:first-child){border-top-right-radius:var(--bs-list-group-border-radius);border-bottom-left-radius:0}.list-group-horizontal-xl>.list-group-item.active{margin-top:0}.list-group-horizontal-xl>.list-group-item+.list-group-item{border-top-width:var(--bs-list-group-border-width);border-left-width:0}.list-group-horizontal-xl>.list-group-item+.list-group-item.active{margin-left:calc(-1*var(--bs-list-group-border-width));border-left-width:var(--bs-list-group-border-width)}}@media(min-width: 1400px){.list-group-horizontal-xxl{flex-direction:row;-webkit-flex-direction:row}.list-group-horizontal-xxl>.list-group-item:first-child:not(:last-child){border-bottom-left-radius:var(--bs-list-group-border-radius);border-top-right-radius:0}.list-group-horizontal-xxl>.list-group-item:last-child:not(:first-child){border-top-right-radius:var(--bs-list-group-border-radius);border-bottom-left-radius:0}.list-group-horizontal-xxl>.list-group-item.active{margin-top:0}.list-group-horizontal-xxl>.list-group-item+.list-group-item{border-top-width:var(--bs-list-group-border-width);border-left-width:0}.list-group-horizontal-xxl>.list-group-item+.list-group-item.active{margin-left:calc(-1*var(--bs-list-group-border-width));border-left-width:var(--bs-list-group-border-width)}}.list-group-flush{border-radius:0}.list-group-flush>.list-group-item{border-width:0 0 var(--bs-list-group-border-width)}.list-group-flush>.list-group-item:last-child{border-bottom-width:0}.list-group-item-default{--bs-list-group-color: var(--bs-default-text-emphasis);--bs-list-group-bg: var(--bs-default-bg-subtle);--bs-list-group-border-color: var(--bs-default-border-subtle);--bs-list-group-action-hover-color: var(--bs-emphasis-color);--bs-list-group-action-hover-bg: var(--bs-default-border-subtle);--bs-list-group-action-active-color: var(--bs-emphasis-color);--bs-list-group-action-active-bg: var(--bs-default-border-subtle);--bs-list-group-active-color: var(--bs-default-bg-subtle);--bs-list-group-active-bg: var(--bs-default-text-emphasis);--bs-list-group-active-border-color: var(--bs-default-text-emphasis)}.list-group-item-primary{--bs-list-group-color: var(--bs-primary-text-emphasis);--bs-list-group-bg: var(--bs-primary-bg-subtle);--bs-list-group-border-color: var(--bs-primary-border-subtle);--bs-list-group-action-hover-color: var(--bs-emphasis-color);--bs-list-group-action-hover-bg: var(--bs-primary-border-subtle);--bs-list-group-action-active-color: var(--bs-emphasis-color);--bs-list-group-action-active-bg: var(--bs-primary-border-subtle);--bs-list-group-active-color: var(--bs-primary-bg-subtle);--bs-list-group-active-bg: var(--bs-primary-text-emphasis);--bs-list-group-active-border-color: var(--bs-primary-text-emphasis)}.list-group-item-secondary{--bs-list-group-color: var(--bs-secondary-text-emphasis);--bs-list-group-bg: var(--bs-secondary-bg-subtle);--bs-list-group-border-color: var(--bs-secondary-border-subtle);--bs-list-group-action-hover-color: var(--bs-emphasis-color);--bs-list-group-action-hover-bg: var(--bs-secondary-border-subtle);--bs-list-group-action-active-color: var(--bs-emphasis-color);--bs-list-group-action-active-bg: var(--bs-secondary-border-subtle);--bs-list-group-active-color: var(--bs-secondary-bg-subtle);--bs-list-group-active-bg: var(--bs-secondary-text-emphasis);--bs-list-group-active-border-color: var(--bs-secondary-text-emphasis)}.list-group-item-success{--bs-list-group-color: var(--bs-success-text-emphasis);--bs-list-group-bg: var(--bs-success-bg-subtle);--bs-list-group-border-color: var(--bs-success-border-subtle);--bs-list-group-action-hover-color: var(--bs-emphasis-color);--bs-list-group-action-hover-bg: var(--bs-success-border-subtle);--bs-list-group-action-active-color: var(--bs-emphasis-color);--bs-list-group-action-active-bg: var(--bs-success-border-subtle);--bs-list-group-active-color: var(--bs-success-bg-subtle);--bs-list-group-active-bg: var(--bs-success-text-emphasis);--bs-list-group-active-border-color: var(--bs-success-text-emphasis)}.list-group-item-info{--bs-list-group-color: var(--bs-info-text-emphasis);--bs-list-group-bg: var(--bs-info-bg-subtle);--bs-list-group-border-color: var(--bs-info-border-subtle);--bs-list-group-action-hover-color: var(--bs-emphasis-color);--bs-list-group-action-hover-bg: var(--bs-info-border-subtle);--bs-list-group-action-active-color: var(--bs-emphasis-color);--bs-list-group-action-active-bg: var(--bs-info-border-subtle);--bs-list-group-active-color: var(--bs-info-bg-subtle);--bs-list-group-active-bg: var(--bs-info-text-emphasis);--bs-list-group-active-border-color: var(--bs-info-text-emphasis)}.list-group-item-warning{--bs-list-group-color: var(--bs-warning-text-emphasis);--bs-list-group-bg: var(--bs-warning-bg-subtle);--bs-list-group-border-color: var(--bs-warning-border-subtle);--bs-list-group-action-hover-color: var(--bs-emphasis-color);--bs-list-group-action-hover-bg: var(--bs-warning-border-subtle);--bs-list-group-action-active-color: var(--bs-emphasis-color);--bs-list-group-action-active-bg: var(--bs-warning-border-subtle);--bs-list-group-active-color: var(--bs-warning-bg-subtle);--bs-list-group-active-bg: var(--bs-warning-text-emphasis);--bs-list-group-active-border-color: var(--bs-warning-text-emphasis)}.list-group-item-danger{--bs-list-group-color: var(--bs-danger-text-emphasis);--bs-list-group-bg: var(--bs-danger-bg-subtle);--bs-list-group-border-color: var(--bs-danger-border-subtle);--bs-list-group-action-hover-color: var(--bs-emphasis-color);--bs-list-group-action-hover-bg: var(--bs-danger-border-subtle);--bs-list-group-action-active-color: var(--bs-emphasis-color);--bs-list-group-action-active-bg: var(--bs-danger-border-subtle);--bs-list-group-active-color: var(--bs-danger-bg-subtle);--bs-list-group-active-bg: var(--bs-danger-text-emphasis);--bs-list-group-active-border-color: var(--bs-danger-text-emphasis)}.list-group-item-light{--bs-list-group-color: var(--bs-light-text-emphasis);--bs-list-group-bg: var(--bs-light-bg-subtle);--bs-list-group-border-color: var(--bs-light-border-subtle);--bs-list-group-action-hover-color: var(--bs-emphasis-color);--bs-list-group-action-hover-bg: var(--bs-light-border-subtle);--bs-list-group-action-active-color: var(--bs-emphasis-color);--bs-list-group-action-active-bg: var(--bs-light-border-subtle);--bs-list-group-active-color: var(--bs-light-bg-subtle);--bs-list-group-active-bg: var(--bs-light-text-emphasis);--bs-list-group-active-border-color: var(--bs-light-text-emphasis)}.list-group-item-dark{--bs-list-group-color: var(--bs-dark-text-emphasis);--bs-list-group-bg: var(--bs-dark-bg-subtle);--bs-list-group-border-color: var(--bs-dark-border-subtle);--bs-list-group-action-hover-color: var(--bs-emphasis-color);--bs-list-group-action-hover-bg: var(--bs-dark-border-subtle);--bs-list-group-action-active-color: var(--bs-emphasis-color);--bs-list-group-action-active-bg: var(--bs-dark-border-subtle);--bs-list-group-active-color: var(--bs-dark-bg-subtle);--bs-list-group-active-bg: var(--bs-dark-text-emphasis);--bs-list-group-active-border-color: var(--bs-dark-text-emphasis)}.btn-close{--bs-btn-close-color: #000;--bs-btn-close-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e");--bs-btn-close-opacity: 0.5;--bs-btn-close-hover-opacity: 0.75;--bs-btn-close-focus-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);--bs-btn-close-focus-opacity: 1;--bs-btn-close-disabled-opacity: 0.25;--bs-btn-close-white-filter: invert(1) grayscale(100%) brightness(200%);box-sizing:content-box;width:1em;height:1em;padding:.25em .25em;color:var(--bs-btn-close-color);background:rgba(0,0,0,0) var(--bs-btn-close-bg) center/1em auto no-repeat;border:0;border-radius:.375rem;opacity:var(--bs-btn-close-opacity)}.btn-close:hover{color:var(--bs-btn-close-color);text-decoration:none;opacity:var(--bs-btn-close-hover-opacity)}.btn-close:focus{outline:0;box-shadow:var(--bs-btn-close-focus-shadow);opacity:var(--bs-btn-close-focus-opacity)}.btn-close:disabled,.btn-close.disabled{pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;opacity:var(--bs-btn-close-disabled-opacity)}.btn-close-white{filter:var(--bs-btn-close-white-filter)}[data-bs-theme=dark] .btn-close{filter:var(--bs-btn-close-white-filter)}.toast{--bs-toast-zindex: 1090;--bs-toast-padding-x: 0.75rem;--bs-toast-padding-y: 0.5rem;--bs-toast-spacing: 1.5rem;--bs-toast-max-width: 350px;--bs-toast-font-size:0.875rem;--bs-toast-color: ;--bs-toast-bg: rgba(255, 255, 255, 0.85);--bs-toast-border-width: 1px;--bs-toast-border-color: rgba(0, 0, 0, 0.175);--bs-toast-border-radius: 0.375rem;--bs-toast-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);--bs-toast-header-color: rgba(33, 37, 41, 0.75);--bs-toast-header-bg: rgba(255, 255, 255, 0.85);--bs-toast-header-border-color: rgba(0, 0, 0, 0.175);width:var(--bs-toast-max-width);max-width:100%;font-size:var(--bs-toast-font-size);color:var(--bs-toast-color);pointer-events:auto;background-color:var(--bs-toast-bg);background-clip:padding-box;border:var(--bs-toast-border-width) solid var(--bs-toast-border-color);box-shadow:var(--bs-toast-box-shadow);border-radius:var(--bs-toast-border-radius)}.toast.showing{opacity:0}.toast:not(.show){display:none}.toast-container{--bs-toast-zindex: 1090;position:absolute;z-index:var(--bs-toast-zindex);width:max-content;width:-webkit-max-content;width:-moz-max-content;width:-ms-max-content;width:-o-max-content;max-width:100%;pointer-events:none}.toast-container>:not(:last-child){margin-bottom:var(--bs-toast-spacing)}.toast-header{display:flex;display:-webkit-flex;align-items:center;-webkit-align-items:center;padding:var(--bs-toast-padding-y) var(--bs-toast-padding-x);color:var(--bs-toast-header-color);background-color:var(--bs-toast-header-bg);background-clip:padding-box;border-bottom:var(--bs-toast-border-width) solid var(--bs-toast-header-border-color);border-top-left-radius:calc(var(--bs-toast-border-radius) - var(--bs-toast-border-width));border-top-right-radius:calc(var(--bs-toast-border-radius) - var(--bs-toast-border-width))}.toast-header .btn-close{margin-right:calc(-0.5*var(--bs-toast-padding-x));margin-left:var(--bs-toast-padding-x)}.toast-body{padding:var(--bs-toast-padding-x);word-wrap:break-word}.modal{--bs-modal-zindex: 1055;--bs-modal-width: 500px;--bs-modal-padding: 1rem;--bs-modal-margin: 0.5rem;--bs-modal-color: ;--bs-modal-bg: #ffffff;--bs-modal-border-color: rgba(0, 0, 0, 0.175);--bs-modal-border-width: 1px;--bs-modal-border-radius: 0.5rem;--bs-modal-box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);--bs-modal-inner-border-radius: calc(0.5rem - 1px);--bs-modal-header-padding-x: 1rem;--bs-modal-header-padding-y: 1rem;--bs-modal-header-padding: 1rem 1rem;--bs-modal-header-border-color: #dee2e6;--bs-modal-header-border-width: 1px;--bs-modal-title-line-height: 1.5;--bs-modal-footer-gap: 0.5rem;--bs-modal-footer-bg: ;--bs-modal-footer-border-color: #dee2e6;--bs-modal-footer-border-width: 1px;position:fixed;top:0;left:0;z-index:var(--bs-modal-zindex);display:none;width:100%;height:100%;overflow-x:hidden;overflow-y:auto;outline:0}.modal-dialog{position:relative;width:auto;margin:var(--bs-modal-margin);pointer-events:none}.modal.fade .modal-dialog{transition:transform .3s ease-out;transform:translate(0, -50px)}@media(prefers-reduced-motion: reduce){.modal.fade .modal-dialog{transition:none}}.modal.show .modal-dialog{transform:none}.modal.modal-static .modal-dialog{transform:scale(1.02)}.modal-dialog-scrollable{height:calc(100% - var(--bs-modal-margin)*2)}.modal-dialog-scrollable .modal-content{max-height:100%;overflow:hidden}.modal-dialog-scrollable .modal-body{overflow-y:auto}.modal-dialog-centered{display:flex;display:-webkit-flex;align-items:center;-webkit-align-items:center;min-height:calc(100% - var(--bs-modal-margin)*2)}.modal-content{position:relative;display:flex;display:-webkit-flex;flex-direction:column;-webkit-flex-direction:column;width:100%;color:var(--bs-modal-color);pointer-events:auto;background-color:var(--bs-modal-bg);background-clip:padding-box;border:var(--bs-modal-border-width) solid var(--bs-modal-border-color);border-radius:var(--bs-modal-border-radius);outline:0}.modal-backdrop{--bs-backdrop-zindex: 1050;--bs-backdrop-bg: #000;--bs-backdrop-opacity: 0.5;position:fixed;top:0;left:0;z-index:var(--bs-backdrop-zindex);width:100vw;height:100vh;background-color:var(--bs-backdrop-bg)}.modal-backdrop.fade{opacity:0}.modal-backdrop.show{opacity:var(--bs-backdrop-opacity)}.modal-header{display:flex;display:-webkit-flex;flex-shrink:0;-webkit-flex-shrink:0;align-items:center;-webkit-align-items:center;justify-content:space-between;-webkit-justify-content:space-between;padding:var(--bs-modal-header-padding);border-bottom:var(--bs-modal-header-border-width) solid var(--bs-modal-header-border-color);border-top-left-radius:var(--bs-modal-inner-border-radius);border-top-right-radius:var(--bs-modal-inner-border-radius)}.modal-header .btn-close{padding:calc(var(--bs-modal-header-padding-y)*.5) calc(var(--bs-modal-header-padding-x)*.5);margin:calc(-0.5*var(--bs-modal-header-padding-y)) calc(-0.5*var(--bs-modal-header-padding-x)) calc(-0.5*var(--bs-modal-header-padding-y)) auto}.modal-title{margin-bottom:0;line-height:var(--bs-modal-title-line-height)}.modal-body{position:relative;flex:1 1 auto;-webkit-flex:1 1 auto;padding:var(--bs-modal-padding)}.modal-footer{display:flex;display:-webkit-flex;flex-shrink:0;-webkit-flex-shrink:0;flex-wrap:wrap;-webkit-flex-wrap:wrap;align-items:center;-webkit-align-items:center;justify-content:flex-end;-webkit-justify-content:flex-end;padding:calc(var(--bs-modal-padding) - var(--bs-modal-footer-gap)*.5);background-color:var(--bs-modal-footer-bg);border-top:var(--bs-modal-footer-border-width) solid var(--bs-modal-footer-border-color);border-bottom-right-radius:var(--bs-modal-inner-border-radius);border-bottom-left-radius:var(--bs-modal-inner-border-radius)}.modal-footer>*{margin:calc(var(--bs-modal-footer-gap)*.5)}@media(min-width: 576px){.modal{--bs-modal-margin: 1.75rem;--bs-modal-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15)}.modal-dialog{max-width:var(--bs-modal-width);margin-right:auto;margin-left:auto}.modal-sm{--bs-modal-width: 300px}}@media(min-width: 992px){.modal-lg,.modal-xl{--bs-modal-width: 800px}}@media(min-width: 1200px){.modal-xl{--bs-modal-width: 1140px}}.modal-fullscreen{width:100vw;max-width:none;height:100%;margin:0}.modal-fullscreen .modal-content{height:100%;border:0;border-radius:0}.modal-fullscreen .modal-header,.modal-fullscreen .modal-footer{border-radius:0}.modal-fullscreen .modal-body{overflow-y:auto}@media(max-width: 575.98px){.modal-fullscreen-sm-down{width:100vw;max-width:none;height:100%;margin:0}.modal-fullscreen-sm-down .modal-content{height:100%;border:0;border-radius:0}.modal-fullscreen-sm-down .modal-header,.modal-fullscreen-sm-down .modal-footer{border-radius:0}.modal-fullscreen-sm-down .modal-body{overflow-y:auto}}@media(max-width: 767.98px){.modal-fullscreen-md-down{width:100vw;max-width:none;height:100%;margin:0}.modal-fullscreen-md-down .modal-content{height:100%;border:0;border-radius:0}.modal-fullscreen-md-down .modal-header,.modal-fullscreen-md-down .modal-footer{border-radius:0}.modal-fullscreen-md-down .modal-body{overflow-y:auto}}@media(max-width: 991.98px){.modal-fullscreen-lg-down{width:100vw;max-width:none;height:100%;margin:0}.modal-fullscreen-lg-down .modal-content{height:100%;border:0;border-radius:0}.modal-fullscreen-lg-down .modal-header,.modal-fullscreen-lg-down .modal-footer{border-radius:0}.modal-fullscreen-lg-down .modal-body{overflow-y:auto}}@media(max-width: 1199.98px){.modal-fullscreen-xl-down{width:100vw;max-width:none;height:100%;margin:0}.modal-fullscreen-xl-down .modal-content{height:100%;border:0;border-radius:0}.modal-fullscreen-xl-down .modal-header,.modal-fullscreen-xl-down .modal-footer{border-radius:0}.modal-fullscreen-xl-down .modal-body{overflow-y:auto}}@media(max-width: 1399.98px){.modal-fullscreen-xxl-down{width:100vw;max-width:none;height:100%;margin:0}.modal-fullscreen-xxl-down .modal-content{height:100%;border:0;border-radius:0}.modal-fullscreen-xxl-down .modal-header,.modal-fullscreen-xxl-down .modal-footer{border-radius:0}.modal-fullscreen-xxl-down .modal-body{overflow-y:auto}}.tooltip{--bs-tooltip-zindex: 1080;--bs-tooltip-max-width: 200px;--bs-tooltip-padding-x: 0.5rem;--bs-tooltip-padding-y: 0.25rem;--bs-tooltip-margin: ;--bs-tooltip-font-size:0.875rem;--bs-tooltip-color: #ffffff;--bs-tooltip-bg: #000;--bs-tooltip-border-radius: 0.375rem;--bs-tooltip-opacity: 0.9;--bs-tooltip-arrow-width: 0.8rem;--bs-tooltip-arrow-height: 0.4rem;z-index:var(--bs-tooltip-zindex);display:block;margin:var(--bs-tooltip-margin);font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue","Noto Sans","Liberation Sans",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;white-space:normal;word-spacing:normal;line-break:auto;font-size:var(--bs-tooltip-font-size);word-wrap:break-word;opacity:0}.tooltip.show{opacity:var(--bs-tooltip-opacity)}.tooltip .tooltip-arrow{display:block;width:var(--bs-tooltip-arrow-width);height:var(--bs-tooltip-arrow-height)}.tooltip .tooltip-arrow::before{position:absolute;content:"";border-color:rgba(0,0,0,0);border-style:solid}.bs-tooltip-top .tooltip-arrow,.bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow{bottom:calc(-1*var(--bs-tooltip-arrow-height))}.bs-tooltip-top .tooltip-arrow::before,.bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow::before{top:-1px;border-width:var(--bs-tooltip-arrow-height) calc(var(--bs-tooltip-arrow-width)*.5) 0;border-top-color:var(--bs-tooltip-bg)}.bs-tooltip-end .tooltip-arrow,.bs-tooltip-auto[data-popper-placement^=right] .tooltip-arrow{left:calc(-1*var(--bs-tooltip-arrow-height));width:var(--bs-tooltip-arrow-height);height:var(--bs-tooltip-arrow-width)}.bs-tooltip-end .tooltip-arrow::before,.bs-tooltip-auto[data-popper-placement^=right] .tooltip-arrow::before{right:-1px;border-width:calc(var(--bs-tooltip-arrow-width)*.5) var(--bs-tooltip-arrow-height) calc(var(--bs-tooltip-arrow-width)*.5) 0;border-right-color:var(--bs-tooltip-bg)}.bs-tooltip-bottom .tooltip-arrow,.bs-tooltip-auto[data-popper-placement^=bottom] .tooltip-arrow{top:calc(-1*var(--bs-tooltip-arrow-height))}.bs-tooltip-bottom .tooltip-arrow::before,.bs-tooltip-auto[data-popper-placement^=bottom] .tooltip-arrow::before{bottom:-1px;border-width:0 calc(var(--bs-tooltip-arrow-width)*.5) var(--bs-tooltip-arrow-height);border-bottom-color:var(--bs-tooltip-bg)}.bs-tooltip-start .tooltip-arrow,.bs-tooltip-auto[data-popper-placement^=left] .tooltip-arrow{right:calc(-1*var(--bs-tooltip-arrow-height));width:var(--bs-tooltip-arrow-height);height:var(--bs-tooltip-arrow-width)}.bs-tooltip-start .tooltip-arrow::before,.bs-tooltip-auto[data-popper-placement^=left] .tooltip-arrow::before{left:-1px;border-width:calc(var(--bs-tooltip-arrow-width)*.5) 0 calc(var(--bs-tooltip-arrow-width)*.5) var(--bs-tooltip-arrow-height);border-left-color:var(--bs-tooltip-bg)}.tooltip-inner{max-width:var(--bs-tooltip-max-width);padding:var(--bs-tooltip-padding-y) var(--bs-tooltip-padding-x);color:var(--bs-tooltip-color);text-align:center;background-color:var(--bs-tooltip-bg);border-radius:var(--bs-tooltip-border-radius)}.popover{--bs-popover-zindex: 1070;--bs-popover-max-width: 276px;--bs-popover-font-size:0.875rem;--bs-popover-bg: #ffffff;--bs-popover-border-width: 1px;--bs-popover-border-color: rgba(0, 0, 0, 0.175);--bs-popover-border-radius: 0.5rem;--bs-popover-inner-border-radius: calc(0.5rem - 1px);--bs-popover-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);--bs-popover-header-padding-x: 1rem;--bs-popover-header-padding-y: 0.5rem;--bs-popover-header-font-size:1rem;--bs-popover-header-color: inherit;--bs-popover-header-bg: #e9ecef;--bs-popover-body-padding-x: 1rem;--bs-popover-body-padding-y: 1rem;--bs-popover-body-color: #212529;--bs-popover-arrow-width: 1rem;--bs-popover-arrow-height: 0.5rem;--bs-popover-arrow-border: var(--bs-popover-border-color);z-index:var(--bs-popover-zindex);display:block;max-width:var(--bs-popover-max-width);font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue","Noto Sans","Liberation Sans",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;white-space:normal;word-spacing:normal;line-break:auto;font-size:var(--bs-popover-font-size);word-wrap:break-word;background-color:var(--bs-popover-bg);background-clip:padding-box;border:var(--bs-popover-border-width) solid var(--bs-popover-border-color);border-radius:var(--bs-popover-border-radius)}.popover .popover-arrow{display:block;width:var(--bs-popover-arrow-width);height:var(--bs-popover-arrow-height)}.popover .popover-arrow::before,.popover .popover-arrow::after{position:absolute;display:block;content:"";border-color:rgba(0,0,0,0);border-style:solid;border-width:0}.bs-popover-top>.popover-arrow,.bs-popover-auto[data-popper-placement^=top]>.popover-arrow{bottom:calc(-1*(var(--bs-popover-arrow-height)) - var(--bs-popover-border-width))}.bs-popover-top>.popover-arrow::before,.bs-popover-auto[data-popper-placement^=top]>.popover-arrow::before,.bs-popover-top>.popover-arrow::after,.bs-popover-auto[data-popper-placement^=top]>.popover-arrow::after{border-width:var(--bs-popover-arrow-height) calc(var(--bs-popover-arrow-width)*.5) 0}.bs-popover-top>.popover-arrow::before,.bs-popover-auto[data-popper-placement^=top]>.popover-arrow::before{bottom:0;border-top-color:var(--bs-popover-arrow-border)}.bs-popover-top>.popover-arrow::after,.bs-popover-auto[data-popper-placement^=top]>.popover-arrow::after{bottom:var(--bs-popover-border-width);border-top-color:var(--bs-popover-bg)}.bs-popover-end>.popover-arrow,.bs-popover-auto[data-popper-placement^=right]>.popover-arrow{left:calc(-1*(var(--bs-popover-arrow-height)) - var(--bs-popover-border-width));width:var(--bs-popover-arrow-height);height:var(--bs-popover-arrow-width)}.bs-popover-end>.popover-arrow::before,.bs-popover-auto[data-popper-placement^=right]>.popover-arrow::before,.bs-popover-end>.popover-arrow::after,.bs-popover-auto[data-popper-placement^=right]>.popover-arrow::after{border-width:calc(var(--bs-popover-arrow-width)*.5) var(--bs-popover-arrow-height) calc(var(--bs-popover-arrow-width)*.5) 0}.bs-popover-end>.popover-arrow::before,.bs-popover-auto[data-popper-placement^=right]>.popover-arrow::before{left:0;border-right-color:var(--bs-popover-arrow-border)}.bs-popover-end>.popover-arrow::after,.bs-popover-auto[data-popper-placement^=right]>.popover-arrow::after{left:var(--bs-popover-border-width);border-right-color:var(--bs-popover-bg)}.bs-popover-bottom>.popover-arrow,.bs-popover-auto[data-popper-placement^=bottom]>.popover-arrow{top:calc(-1*(var(--bs-popover-arrow-height)) - var(--bs-popover-border-width))}.bs-popover-bottom>.popover-arrow::before,.bs-popover-auto[data-popper-placement^=bottom]>.popover-arrow::before,.bs-popover-bottom>.popover-arrow::after,.bs-popover-auto[data-popper-placement^=bottom]>.popover-arrow::after{border-width:0 calc(var(--bs-popover-arrow-width)*.5) var(--bs-popover-arrow-height)}.bs-popover-bottom>.popover-arrow::before,.bs-popover-auto[data-popper-placement^=bottom]>.popover-arrow::before{top:0;border-bottom-color:var(--bs-popover-arrow-border)}.bs-popover-bottom>.popover-arrow::after,.bs-popover-auto[data-popper-placement^=bottom]>.popover-arrow::after{top:var(--bs-popover-border-width);border-bottom-color:var(--bs-popover-bg)}.bs-popover-bottom .popover-header::before,.bs-popover-auto[data-popper-placement^=bottom] .popover-header::before{position:absolute;top:0;left:50%;display:block;width:var(--bs-popover-arrow-width);margin-left:calc(-0.5*var(--bs-popover-arrow-width));content:"";border-bottom:var(--bs-popover-border-width) solid var(--bs-popover-header-bg)}.bs-popover-start>.popover-arrow,.bs-popover-auto[data-popper-placement^=left]>.popover-arrow{right:calc(-1*(var(--bs-popover-arrow-height)) - var(--bs-popover-border-width));width:var(--bs-popover-arrow-height);height:var(--bs-popover-arrow-width)}.bs-popover-start>.popover-arrow::before,.bs-popover-auto[data-popper-placement^=left]>.popover-arrow::before,.bs-popover-start>.popover-arrow::after,.bs-popover-auto[data-popper-placement^=left]>.popover-arrow::after{border-width:calc(var(--bs-popover-arrow-width)*.5) 0 calc(var(--bs-popover-arrow-width)*.5) var(--bs-popover-arrow-height)}.bs-popover-start>.popover-arrow::before,.bs-popover-auto[data-popper-placement^=left]>.popover-arrow::before{right:0;border-left-color:var(--bs-popover-arrow-border)}.bs-popover-start>.popover-arrow::after,.bs-popover-auto[data-popper-placement^=left]>.popover-arrow::after{right:var(--bs-popover-border-width);border-left-color:var(--bs-popover-bg)}.popover-header{padding:var(--bs-popover-header-padding-y) var(--bs-popover-header-padding-x);margin-bottom:0;font-size:var(--bs-popover-header-font-size);color:var(--bs-popover-header-color);background-color:var(--bs-popover-header-bg);border-bottom:var(--bs-popover-border-width) solid var(--bs-popover-border-color);border-top-left-radius:var(--bs-popover-inner-border-radius);border-top-right-radius:var(--bs-popover-inner-border-radius)}.popover-header:empty{display:none}.popover-body{padding:var(--bs-popover-body-padding-y) var(--bs-popover-body-padding-x);color:var(--bs-popover-body-color)}.carousel{position:relative}.carousel.pointer-event{touch-action:pan-y;-webkit-touch-action:pan-y;-moz-touch-action:pan-y;-ms-touch-action:pan-y;-o-touch-action:pan-y}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner::after{display:block;clear:both;content:""}.carousel-item{position:relative;display:none;float:left;width:100%;margin-right:-100%;backface-visibility:hidden;-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;-ms-backface-visibility:hidden;-o-backface-visibility:hidden;transition:transform .6s ease-in-out}@media(prefers-reduced-motion: reduce){.carousel-item{transition:none}}.carousel-item.active,.carousel-item-next,.carousel-item-prev{display:block}.carousel-item-next:not(.carousel-item-start),.active.carousel-item-end{transform:translateX(100%)}.carousel-item-prev:not(.carousel-item-end),.active.carousel-item-start{transform:translateX(-100%)}.carousel-fade .carousel-item{opacity:0;transition-property:opacity;transform:none}.carousel-fade .carousel-item.active,.carousel-fade .carousel-item-next.carousel-item-start,.carousel-fade .carousel-item-prev.carousel-item-end{z-index:1;opacity:1}.carousel-fade .active.carousel-item-start,.carousel-fade .active.carousel-item-end{z-index:0;opacity:0;transition:opacity 0s .6s}@media(prefers-reduced-motion: reduce){.carousel-fade .active.carousel-item-start,.carousel-fade .active.carousel-item-end{transition:none}}.carousel-control-prev,.carousel-control-next{position:absolute;top:0;bottom:0;z-index:1;display:flex;display:-webkit-flex;align-items:center;-webkit-align-items:center;justify-content:center;-webkit-justify-content:center;width:15%;padding:0;color:#fff;text-align:center;background:none;border:0;opacity:.5;transition:opacity .15s ease}@media(prefers-reduced-motion: reduce){.carousel-control-prev,.carousel-control-next{transition:none}}.carousel-control-prev:hover,.carousel-control-prev:focus,.carousel-control-next:hover,.carousel-control-next:focus{color:#fff;text-decoration:none;outline:0;opacity:.9}.carousel-control-prev{left:0}.carousel-control-next{right:0}.carousel-control-prev-icon,.carousel-control-next-icon{display:inline-block;width:2rem;height:2rem;background-repeat:no-repeat;background-position:50%;background-size:100% 100%}.carousel-control-prev-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z'/%3e%3c/svg%3e")}.carousel-control-next-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e")}.carousel-indicators{position:absolute;right:0;bottom:0;left:0;z-index:2;display:flex;display:-webkit-flex;justify-content:center;-webkit-justify-content:center;padding:0;margin-right:15%;margin-bottom:1rem;margin-left:15%}.carousel-indicators [data-bs-target]{box-sizing:content-box;flex:0 1 auto;-webkit-flex:0 1 auto;width:30px;height:3px;padding:0;margin-right:3px;margin-left:3px;text-indent:-999px;cursor:pointer;background-color:#fff;background-clip:padding-box;border:0;border-top:10px solid rgba(0,0,0,0);border-bottom:10px solid rgba(0,0,0,0);opacity:.5;transition:opacity .6s ease}@media(prefers-reduced-motion: reduce){.carousel-indicators [data-bs-target]{transition:none}}.carousel-indicators .active{opacity:1}.carousel-caption{position:absolute;right:15%;bottom:1.25rem;left:15%;padding-top:1.25rem;padding-bottom:1.25rem;color:#fff;text-align:center}.carousel-dark .carousel-control-prev-icon,.carousel-dark .carousel-control-next-icon{filter:invert(1) grayscale(100)}.carousel-dark .carousel-indicators [data-bs-target]{background-color:#000}.carousel-dark .carousel-caption{color:#000}[data-bs-theme=dark] .carousel .carousel-control-prev-icon,[data-bs-theme=dark] .carousel .carousel-control-next-icon,[data-bs-theme=dark].carousel .carousel-control-prev-icon,[data-bs-theme=dark].carousel .carousel-control-next-icon{filter:invert(1) grayscale(100)}[data-bs-theme=dark] .carousel .carousel-indicators [data-bs-target],[data-bs-theme=dark].carousel .carousel-indicators [data-bs-target]{background-color:#000}[data-bs-theme=dark] .carousel .carousel-caption,[data-bs-theme=dark].carousel .carousel-caption{color:#000}.spinner-grow,.spinner-border{display:inline-block;width:var(--bs-spinner-width);height:var(--bs-spinner-height);vertical-align:var(--bs-spinner-vertical-align);border-radius:50%;animation:var(--bs-spinner-animation-speed) linear infinite var(--bs-spinner-animation-name)}@keyframes spinner-border{to{transform:rotate(360deg) /* rtl:ignore */}}.spinner-border{--bs-spinner-width: 2rem;--bs-spinner-height: 2rem;--bs-spinner-vertical-align: -0.125em;--bs-spinner-border-width: 0.25em;--bs-spinner-animation-speed: 0.75s;--bs-spinner-animation-name: spinner-border;border:var(--bs-spinner-border-width) solid currentcolor;border-right-color:rgba(0,0,0,0)}.spinner-border-sm{--bs-spinner-width: 1rem;--bs-spinner-height: 1rem;--bs-spinner-border-width: 0.2em}@keyframes spinner-grow{0%{transform:scale(0)}50%{opacity:1;transform:none}}.spinner-grow{--bs-spinner-width: 2rem;--bs-spinner-height: 2rem;--bs-spinner-vertical-align: -0.125em;--bs-spinner-animation-speed: 0.75s;--bs-spinner-animation-name: spinner-grow;background-color:currentcolor;opacity:0}.spinner-grow-sm{--bs-spinner-width: 1rem;--bs-spinner-height: 1rem}@media(prefers-reduced-motion: reduce){.spinner-border,.spinner-grow{--bs-spinner-animation-speed: 1.5s}}.offcanvas,.offcanvas-xxl,.offcanvas-xl,.offcanvas-lg,.offcanvas-md,.offcanvas-sm{--bs-offcanvas-zindex: 1045;--bs-offcanvas-width: 400px;--bs-offcanvas-height: 30vh;--bs-offcanvas-padding-x: 1rem;--bs-offcanvas-padding-y: 1rem;--bs-offcanvas-color: #212529;--bs-offcanvas-bg: #ffffff;--bs-offcanvas-border-width: 1px;--bs-offcanvas-border-color: rgba(0, 0, 0, 0.175);--bs-offcanvas-box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);--bs-offcanvas-transition: transform 0.3s ease-in-out;--bs-offcanvas-title-line-height: 1.5}@media(max-width: 575.98px){.offcanvas-sm{position:fixed;bottom:0;z-index:var(--bs-offcanvas-zindex);display:flex;display:-webkit-flex;flex-direction:column;-webkit-flex-direction:column;max-width:100%;color:var(--bs-offcanvas-color);visibility:hidden;background-color:var(--bs-offcanvas-bg);background-clip:padding-box;outline:0;transition:var(--bs-offcanvas-transition)}}@media(max-width: 575.98px)and (prefers-reduced-motion: reduce){.offcanvas-sm{transition:none}}@media(max-width: 575.98px){.offcanvas-sm.offcanvas-start{top:0;left:0;width:var(--bs-offcanvas-width);border-right:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(-100%)}.offcanvas-sm.offcanvas-end{top:0;right:0;width:var(--bs-offcanvas-width);border-left:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(100%)}.offcanvas-sm.offcanvas-top{top:0;right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-bottom:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(-100%)}.offcanvas-sm.offcanvas-bottom{right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-top:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(100%)}.offcanvas-sm.showing,.offcanvas-sm.show:not(.hiding){transform:none}.offcanvas-sm.showing,.offcanvas-sm.hiding,.offcanvas-sm.show{visibility:visible}}@media(min-width: 576px){.offcanvas-sm{--bs-offcanvas-height: auto;--bs-offcanvas-border-width: 0;background-color:rgba(0,0,0,0) !important}.offcanvas-sm .offcanvas-header{display:none}.offcanvas-sm .offcanvas-body{display:flex;display:-webkit-flex;flex-grow:0;-webkit-flex-grow:0;padding:0;overflow-y:visible;background-color:rgba(0,0,0,0) !important}}@media(max-width: 767.98px){.offcanvas-md{position:fixed;bottom:0;z-index:var(--bs-offcanvas-zindex);display:flex;display:-webkit-flex;flex-direction:column;-webkit-flex-direction:column;max-width:100%;color:var(--bs-offcanvas-color);visibility:hidden;background-color:var(--bs-offcanvas-bg);background-clip:padding-box;outline:0;transition:var(--bs-offcanvas-transition)}}@media(max-width: 767.98px)and (prefers-reduced-motion: reduce){.offcanvas-md{transition:none}}@media(max-width: 767.98px){.offcanvas-md.offcanvas-start{top:0;left:0;width:var(--bs-offcanvas-width);border-right:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(-100%)}.offcanvas-md.offcanvas-end{top:0;right:0;width:var(--bs-offcanvas-width);border-left:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(100%)}.offcanvas-md.offcanvas-top{top:0;right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-bottom:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(-100%)}.offcanvas-md.offcanvas-bottom{right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-top:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(100%)}.offcanvas-md.showing,.offcanvas-md.show:not(.hiding){transform:none}.offcanvas-md.showing,.offcanvas-md.hiding,.offcanvas-md.show{visibility:visible}}@media(min-width: 768px){.offcanvas-md{--bs-offcanvas-height: auto;--bs-offcanvas-border-width: 0;background-color:rgba(0,0,0,0) !important}.offcanvas-md .offcanvas-header{display:none}.offcanvas-md .offcanvas-body{display:flex;display:-webkit-flex;flex-grow:0;-webkit-flex-grow:0;padding:0;overflow-y:visible;background-color:rgba(0,0,0,0) !important}}@media(max-width: 991.98px){.offcanvas-lg{position:fixed;bottom:0;z-index:var(--bs-offcanvas-zindex);display:flex;display:-webkit-flex;flex-direction:column;-webkit-flex-direction:column;max-width:100%;color:var(--bs-offcanvas-color);visibility:hidden;background-color:var(--bs-offcanvas-bg);background-clip:padding-box;outline:0;transition:var(--bs-offcanvas-transition)}}@media(max-width: 991.98px)and (prefers-reduced-motion: reduce){.offcanvas-lg{transition:none}}@media(max-width: 991.98px){.offcanvas-lg.offcanvas-start{top:0;left:0;width:var(--bs-offcanvas-width);border-right:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(-100%)}.offcanvas-lg.offcanvas-end{top:0;right:0;width:var(--bs-offcanvas-width);border-left:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(100%)}.offcanvas-lg.offcanvas-top{top:0;right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-bottom:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(-100%)}.offcanvas-lg.offcanvas-bottom{right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-top:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(100%)}.offcanvas-lg.showing,.offcanvas-lg.show:not(.hiding){transform:none}.offcanvas-lg.showing,.offcanvas-lg.hiding,.offcanvas-lg.show{visibility:visible}}@media(min-width: 992px){.offcanvas-lg{--bs-offcanvas-height: auto;--bs-offcanvas-border-width: 0;background-color:rgba(0,0,0,0) !important}.offcanvas-lg .offcanvas-header{display:none}.offcanvas-lg .offcanvas-body{display:flex;display:-webkit-flex;flex-grow:0;-webkit-flex-grow:0;padding:0;overflow-y:visible;background-color:rgba(0,0,0,0) !important}}@media(max-width: 1199.98px){.offcanvas-xl{position:fixed;bottom:0;z-index:var(--bs-offcanvas-zindex);display:flex;display:-webkit-flex;flex-direction:column;-webkit-flex-direction:column;max-width:100%;color:var(--bs-offcanvas-color);visibility:hidden;background-color:var(--bs-offcanvas-bg);background-clip:padding-box;outline:0;transition:var(--bs-offcanvas-transition)}}@media(max-width: 1199.98px)and (prefers-reduced-motion: reduce){.offcanvas-xl{transition:none}}@media(max-width: 1199.98px){.offcanvas-xl.offcanvas-start{top:0;left:0;width:var(--bs-offcanvas-width);border-right:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(-100%)}.offcanvas-xl.offcanvas-end{top:0;right:0;width:var(--bs-offcanvas-width);border-left:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(100%)}.offcanvas-xl.offcanvas-top{top:0;right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-bottom:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(-100%)}.offcanvas-xl.offcanvas-bottom{right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-top:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(100%)}.offcanvas-xl.showing,.offcanvas-xl.show:not(.hiding){transform:none}.offcanvas-xl.showing,.offcanvas-xl.hiding,.offcanvas-xl.show{visibility:visible}}@media(min-width: 1200px){.offcanvas-xl{--bs-offcanvas-height: auto;--bs-offcanvas-border-width: 0;background-color:rgba(0,0,0,0) !important}.offcanvas-xl .offcanvas-header{display:none}.offcanvas-xl .offcanvas-body{display:flex;display:-webkit-flex;flex-grow:0;-webkit-flex-grow:0;padding:0;overflow-y:visible;background-color:rgba(0,0,0,0) !important}}@media(max-width: 1399.98px){.offcanvas-xxl{position:fixed;bottom:0;z-index:var(--bs-offcanvas-zindex);display:flex;display:-webkit-flex;flex-direction:column;-webkit-flex-direction:column;max-width:100%;color:var(--bs-offcanvas-color);visibility:hidden;background-color:var(--bs-offcanvas-bg);background-clip:padding-box;outline:0;transition:var(--bs-offcanvas-transition)}}@media(max-width: 1399.98px)and (prefers-reduced-motion: reduce){.offcanvas-xxl{transition:none}}@media(max-width: 1399.98px){.offcanvas-xxl.offcanvas-start{top:0;left:0;width:var(--bs-offcanvas-width);border-right:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(-100%)}.offcanvas-xxl.offcanvas-end{top:0;right:0;width:var(--bs-offcanvas-width);border-left:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(100%)}.offcanvas-xxl.offcanvas-top{top:0;right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-bottom:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(-100%)}.offcanvas-xxl.offcanvas-bottom{right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-top:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(100%)}.offcanvas-xxl.showing,.offcanvas-xxl.show:not(.hiding){transform:none}.offcanvas-xxl.showing,.offcanvas-xxl.hiding,.offcanvas-xxl.show{visibility:visible}}@media(min-width: 1400px){.offcanvas-xxl{--bs-offcanvas-height: auto;--bs-offcanvas-border-width: 0;background-color:rgba(0,0,0,0) !important}.offcanvas-xxl .offcanvas-header{display:none}.offcanvas-xxl .offcanvas-body{display:flex;display:-webkit-flex;flex-grow:0;-webkit-flex-grow:0;padding:0;overflow-y:visible;background-color:rgba(0,0,0,0) !important}}.offcanvas{position:fixed;bottom:0;z-index:var(--bs-offcanvas-zindex);display:flex;display:-webkit-flex;flex-direction:column;-webkit-flex-direction:column;max-width:100%;color:var(--bs-offcanvas-color);visibility:hidden;background-color:var(--bs-offcanvas-bg);background-clip:padding-box;outline:0;transition:var(--bs-offcanvas-transition)}@media(prefers-reduced-motion: reduce){.offcanvas{transition:none}}.offcanvas.offcanvas-start{top:0;left:0;width:var(--bs-offcanvas-width);border-right:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(-100%)}.offcanvas.offcanvas-end{top:0;right:0;width:var(--bs-offcanvas-width);border-left:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(100%)}.offcanvas.offcanvas-top{top:0;right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-bottom:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(-100%)}.offcanvas.offcanvas-bottom{right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-top:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(100%)}.offcanvas.showing,.offcanvas.show:not(.hiding){transform:none}.offcanvas.showing,.offcanvas.hiding,.offcanvas.show{visibility:visible}.offcanvas-backdrop{position:fixed;top:0;left:0;z-index:1040;width:100vw;height:100vh;background-color:#000}.offcanvas-backdrop.fade{opacity:0}.offcanvas-backdrop.show{opacity:.5}.offcanvas-header{display:flex;display:-webkit-flex;align-items:center;-webkit-align-items:center;justify-content:space-between;-webkit-justify-content:space-between;padding:var(--bs-offcanvas-padding-y) var(--bs-offcanvas-padding-x)}.offcanvas-header .btn-close{padding:calc(var(--bs-offcanvas-padding-y)*.5) calc(var(--bs-offcanvas-padding-x)*.5);margin-top:calc(-0.5*var(--bs-offcanvas-padding-y));margin-right:calc(-0.5*var(--bs-offcanvas-padding-x));margin-bottom:calc(-0.5*var(--bs-offcanvas-padding-y))}.offcanvas-title{margin-bottom:0;line-height:var(--bs-offcanvas-title-line-height)}.offcanvas-body{flex-grow:1;-webkit-flex-grow:1;padding:var(--bs-offcanvas-padding-y) var(--bs-offcanvas-padding-x);overflow-y:auto}.placeholder{display:inline-block;min-height:1em;vertical-align:middle;cursor:wait;background-color:currentcolor;opacity:.5}.placeholder.btn::before{display:inline-block;content:""}.placeholder-xs{min-height:.6em}.placeholder-sm{min-height:.8em}.placeholder-lg{min-height:1.2em}.placeholder-glow .placeholder{animation:placeholder-glow 2s ease-in-out infinite}@keyframes placeholder-glow{50%{opacity:.2}}.placeholder-wave{mask-image:linear-gradient(130deg, #000 55%, rgba(0, 0, 0, 0.8) 75%, #000 95%);-webkit-mask-image:linear-gradient(130deg, #000 55%, rgba(0, 0, 0, 0.8) 75%, #000 95%);mask-size:200% 100%;-webkit-mask-size:200% 100%;animation:placeholder-wave 2s linear infinite}@keyframes placeholder-wave{100%{mask-position:-200% 0%;-webkit-mask-position:-200% 0%}}.clearfix::after{display:block;clear:both;content:""}.text-bg-default{color:#000 !important;background-color:RGBA(var(--bs-default-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-primary{color:#fff !important;background-color:RGBA(var(--bs-primary-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-secondary{color:#fff !important;background-color:RGBA(var(--bs-secondary-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-success{color:#fff !important;background-color:RGBA(var(--bs-success-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-info{color:#000 !important;background-color:RGBA(var(--bs-info-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-warning{color:#000 !important;background-color:RGBA(var(--bs-warning-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-danger{color:#fff !important;background-color:RGBA(var(--bs-danger-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-light{color:#000 !important;background-color:RGBA(var(--bs-light-rgb), var(--bs-bg-opacity, 1)) !important}.text-bg-dark{color:#fff !important;background-color:RGBA(var(--bs-dark-rgb), var(--bs-bg-opacity, 1)) !important}.link-default{color:RGBA(var(--bs-default-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-default-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-default:hover,.link-default:focus{color:RGBA(229, 232, 235, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(229, 232, 235, var(--bs-link-underline-opacity, 1)) !important}.link-primary{color:RGBA(var(--bs-primary-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-primary-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-primary:hover,.link-primary:focus{color:RGBA(10, 88, 202, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(10, 88, 202, var(--bs-link-underline-opacity, 1)) !important}.link-secondary{color:RGBA(var(--bs-secondary-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-secondary-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-secondary:hover,.link-secondary:focus{color:RGBA(86, 94, 100, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(86, 94, 100, var(--bs-link-underline-opacity, 1)) !important}.link-success{color:RGBA(var(--bs-success-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-success-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-success:hover,.link-success:focus{color:RGBA(20, 108, 67, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(20, 108, 67, var(--bs-link-underline-opacity, 1)) !important}.link-info{color:RGBA(var(--bs-info-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-info-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-info:hover,.link-info:focus{color:RGBA(61, 213, 243, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(61, 213, 243, var(--bs-link-underline-opacity, 1)) !important}.link-warning{color:RGBA(var(--bs-warning-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-warning-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-warning:hover,.link-warning:focus{color:RGBA(255, 205, 57, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(255, 205, 57, var(--bs-link-underline-opacity, 1)) !important}.link-danger{color:RGBA(var(--bs-danger-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-danger-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-danger:hover,.link-danger:focus{color:RGBA(176, 42, 55, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(176, 42, 55, var(--bs-link-underline-opacity, 1)) !important}.link-light{color:RGBA(var(--bs-light-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-light-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-light:hover,.link-light:focus{color:RGBA(249, 250, 251, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(249, 250, 251, var(--bs-link-underline-opacity, 1)) !important}.link-dark{color:RGBA(var(--bs-dark-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-dark-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-dark:hover,.link-dark:focus{color:RGBA(26, 30, 33, var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(26, 30, 33, var(--bs-link-underline-opacity, 1)) !important}.link-body-emphasis{color:RGBA(var(--bs-emphasis-color-rgb), var(--bs-link-opacity, 1)) !important;text-decoration-color:RGBA(var(--bs-emphasis-color-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-body-emphasis:hover,.link-body-emphasis:focus{color:RGBA(var(--bs-emphasis-color-rgb), var(--bs-link-opacity, 0.75)) !important;text-decoration-color:RGBA(var(--bs-emphasis-color-rgb), var(--bs-link-underline-opacity, 0.75)) !important}.focus-ring:focus{outline:0;box-shadow:var(--bs-focus-ring-x, 0) var(--bs-focus-ring-y, 0) var(--bs-focus-ring-blur, 0) var(--bs-focus-ring-width) var(--bs-focus-ring-color)}.icon-link{display:inline-flex;gap:.375rem;align-items:center;-webkit-align-items:center;text-decoration-color:rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 0.5));text-underline-offset:.25em;backface-visibility:hidden;-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;-ms-backface-visibility:hidden;-o-backface-visibility:hidden}.icon-link>.bi{flex-shrink:0;-webkit-flex-shrink:0;width:1em;height:1em;fill:currentcolor;transition:.2s ease-in-out transform}@media(prefers-reduced-motion: reduce){.icon-link>.bi{transition:none}}.icon-link-hover:hover>.bi,.icon-link-hover:focus-visible>.bi{transform:var(--bs-icon-link-transform, translate3d(0.25em, 0, 0))}.ratio{position:relative;width:100%}.ratio::before{display:block;padding-top:var(--bs-aspect-ratio);content:""}.ratio>*{position:absolute;top:0;left:0;width:100%;height:100%}.ratio-1x1{--bs-aspect-ratio: 100%}.ratio-4x3{--bs-aspect-ratio: 75%}.ratio-16x9{--bs-aspect-ratio: 56.25%}.ratio-21x9{--bs-aspect-ratio: 42.8571428571%}.fixed-top{position:fixed;top:0;right:0;left:0;z-index:1030}.fixed-bottom{position:fixed;right:0;bottom:0;left:0;z-index:1030}.sticky-top{position:sticky;top:0;z-index:1020}.sticky-bottom{position:sticky;bottom:0;z-index:1020}@media(min-width: 576px){.sticky-sm-top{position:sticky;top:0;z-index:1020}.sticky-sm-bottom{position:sticky;bottom:0;z-index:1020}}@media(min-width: 768px){.sticky-md-top{position:sticky;top:0;z-index:1020}.sticky-md-bottom{position:sticky;bottom:0;z-index:1020}}@media(min-width: 992px){.sticky-lg-top{position:sticky;top:0;z-index:1020}.sticky-lg-bottom{position:sticky;bottom:0;z-index:1020}}@media(min-width: 1200px){.sticky-xl-top{position:sticky;top:0;z-index:1020}.sticky-xl-bottom{position:sticky;bottom:0;z-index:1020}}@media(min-width: 1400px){.sticky-xxl-top{position:sticky;top:0;z-index:1020}.sticky-xxl-bottom{position:sticky;bottom:0;z-index:1020}}.hstack{display:flex;display:-webkit-flex;flex-direction:row;-webkit-flex-direction:row;align-items:center;-webkit-align-items:center;align-self:stretch;-webkit-align-self:stretch}.vstack{display:flex;display:-webkit-flex;flex:1 1 auto;-webkit-flex:1 1 auto;flex-direction:column;-webkit-flex-direction:column;align-self:stretch;-webkit-align-self:stretch}.visually-hidden,.visually-hidden-focusable:not(:focus):not(:focus-within){width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.visually-hidden:not(caption),.visually-hidden-focusable:not(:focus):not(:focus-within):not(caption){position:absolute !important}.stretched-link::after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;content:""}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vr{display:inline-block;align-self:stretch;-webkit-align-self:stretch;width:1px;min-height:1em;background-color:currentcolor;opacity:.25}.align-baseline{vertical-align:baseline !important}.align-top{vertical-align:top !important}.align-middle{vertical-align:middle !important}.align-bottom{vertical-align:bottom !important}.align-text-bottom{vertical-align:text-bottom !important}.align-text-top{vertical-align:text-top !important}.float-start{float:left !important}.float-end{float:right !important}.float-none{float:none !important}.object-fit-contain{object-fit:contain !important}.object-fit-cover{object-fit:cover !important}.object-fit-fill{object-fit:fill !important}.object-fit-scale{object-fit:scale-down !important}.object-fit-none{object-fit:none !important}.opacity-0{opacity:0 !important}.opacity-25{opacity:.25 !important}.opacity-50{opacity:.5 !important}.opacity-75{opacity:.75 !important}.opacity-100{opacity:1 !important}.overflow-auto{overflow:auto !important}.overflow-hidden{overflow:hidden !important}.overflow-visible{overflow:visible !important}.overflow-scroll{overflow:scroll !important}.overflow-x-auto{overflow-x:auto !important}.overflow-x-hidden{overflow-x:hidden !important}.overflow-x-visible{overflow-x:visible !important}.overflow-x-scroll{overflow-x:scroll !important}.overflow-y-auto{overflow-y:auto !important}.overflow-y-hidden{overflow-y:hidden !important}.overflow-y-visible{overflow-y:visible !important}.overflow-y-scroll{overflow-y:scroll !important}.d-inline{display:inline !important}.d-inline-block{display:inline-block !important}.d-block{display:block !important}.d-grid{display:grid !important}.d-inline-grid{display:inline-grid !important}.d-table{display:table !important}.d-table-row{display:table-row !important}.d-table-cell{display:table-cell !important}.d-flex{display:flex !important}.d-inline-flex{display:inline-flex !important}.d-none{display:none !important}.shadow{box-shadow:0 .5rem 1rem rgba(0,0,0,.15) !important}.shadow-sm{box-shadow:0 .125rem .25rem rgba(0,0,0,.075) !important}.shadow-lg{box-shadow:0 1rem 3rem rgba(0,0,0,.175) !important}.shadow-none{box-shadow:none !important}.focus-ring-default{--bs-focus-ring-color: rgba(var(--bs-default-rgb), var(--bs-focus-ring-opacity))}.focus-ring-primary{--bs-focus-ring-color: rgba(var(--bs-primary-rgb), var(--bs-focus-ring-opacity))}.focus-ring-secondary{--bs-focus-ring-color: rgba(var(--bs-secondary-rgb), var(--bs-focus-ring-opacity))}.focus-ring-success{--bs-focus-ring-color: rgba(var(--bs-success-rgb), var(--bs-focus-ring-opacity))}.focus-ring-info{--bs-focus-ring-color: rgba(var(--bs-info-rgb), var(--bs-focus-ring-opacity))}.focus-ring-warning{--bs-focus-ring-color: rgba(var(--bs-warning-rgb), var(--bs-focus-ring-opacity))}.focus-ring-danger{--bs-focus-ring-color: rgba(var(--bs-danger-rgb), var(--bs-focus-ring-opacity))}.focus-ring-light{--bs-focus-ring-color: rgba(var(--bs-light-rgb), var(--bs-focus-ring-opacity))}.focus-ring-dark{--bs-focus-ring-color: rgba(var(--bs-dark-rgb), var(--bs-focus-ring-opacity))}.position-static{position:static !important}.position-relative{position:relative !important}.position-absolute{position:absolute !important}.position-fixed{position:fixed !important}.position-sticky{position:sticky !important}.top-0{top:0 !important}.top-50{top:50% !important}.top-100{top:100% !important}.bottom-0{bottom:0 !important}.bottom-50{bottom:50% !important}.bottom-100{bottom:100% !important}.start-0{left:0 !important}.start-50{left:50% !important}.start-100{left:100% !important}.end-0{right:0 !important}.end-50{right:50% !important}.end-100{right:100% !important}.translate-middle{transform:translate(-50%, -50%) !important}.translate-middle-x{transform:translateX(-50%) !important}.translate-middle-y{transform:translateY(-50%) !important}.border{border:var(--bs-border-width) var(--bs-border-style) var(--bs-border-color) !important}.border-0{border:0 !important}.border-top{border-top:var(--bs-border-width) var(--bs-border-style) var(--bs-border-color) !important}.border-top-0{border-top:0 !important}.border-end{border-right:var(--bs-border-width) var(--bs-border-style) var(--bs-border-color) !important}.border-end-0{border-right:0 !important}.border-bottom{border-bottom:var(--bs-border-width) var(--bs-border-style) var(--bs-border-color) !important}.border-bottom-0{border-bottom:0 !important}.border-start{border-left:var(--bs-border-width) var(--bs-border-style) var(--bs-border-color) !important}.border-start-0{border-left:0 !important}.border-default{--bs-border-opacity: 1;border-color:rgba(var(--bs-default-rgb), var(--bs-border-opacity)) !important}.border-primary{--bs-border-opacity: 1;border-color:rgba(var(--bs-primary-rgb), var(--bs-border-opacity)) !important}.border-secondary{--bs-border-opacity: 1;border-color:rgba(var(--bs-secondary-rgb), var(--bs-border-opacity)) !important}.border-success{--bs-border-opacity: 1;border-color:rgba(var(--bs-success-rgb), var(--bs-border-opacity)) !important}.border-info{--bs-border-opacity: 1;border-color:rgba(var(--bs-info-rgb), var(--bs-border-opacity)) !important}.border-warning{--bs-border-opacity: 1;border-color:rgba(var(--bs-warning-rgb), var(--bs-border-opacity)) !important}.border-danger{--bs-border-opacity: 1;border-color:rgba(var(--bs-danger-rgb), var(--bs-border-opacity)) !important}.border-light{--bs-border-opacity: 1;border-color:rgba(var(--bs-light-rgb), var(--bs-border-opacity)) !important}.border-dark{--bs-border-opacity: 1;border-color:rgba(var(--bs-dark-rgb), var(--bs-border-opacity)) !important}.border-black{--bs-border-opacity: 1;border-color:rgba(var(--bs-black-rgb), var(--bs-border-opacity)) !important}.border-white{--bs-border-opacity: 1;border-color:rgba(var(--bs-white-rgb), var(--bs-border-opacity)) !important}.border-primary-subtle{border-color:var(--bs-primary-border-subtle) !important}.border-secondary-subtle{border-color:var(--bs-secondary-border-subtle) !important}.border-success-subtle{border-color:var(--bs-success-border-subtle) !important}.border-info-subtle{border-color:var(--bs-info-border-subtle) !important}.border-warning-subtle{border-color:var(--bs-warning-border-subtle) !important}.border-danger-subtle{border-color:var(--bs-danger-border-subtle) !important}.border-light-subtle{border-color:var(--bs-light-border-subtle) !important}.border-dark-subtle{border-color:var(--bs-dark-border-subtle) !important}.border-1{border-width:1px !important}.border-2{border-width:2px !important}.border-3{border-width:3px !important}.border-4{border-width:4px !important}.border-5{border-width:5px !important}.border-opacity-10{--bs-border-opacity: 0.1}.border-opacity-25{--bs-border-opacity: 0.25}.border-opacity-50{--bs-border-opacity: 0.5}.border-opacity-75{--bs-border-opacity: 0.75}.border-opacity-100{--bs-border-opacity: 1}.w-25{width:25% !important}.w-50{width:50% !important}.w-75{width:75% !important}.w-100{width:100% !important}.w-auto{width:auto !important}.mw-100{max-width:100% !important}.vw-100{width:100vw !important}.min-vw-100{min-width:100vw !important}.h-25{height:25% !important}.h-50{height:50% !important}.h-75{height:75% !important}.h-100{height:100% !important}.h-auto{height:auto !important}.mh-100{max-height:100% !important}.vh-100{height:100vh !important}.min-vh-100{min-height:100vh !important}.flex-fill{flex:1 1 auto !important}.flex-row{flex-direction:row !important}.flex-column{flex-direction:column !important}.flex-row-reverse{flex-direction:row-reverse !important}.flex-column-reverse{flex-direction:column-reverse !important}.flex-grow-0{flex-grow:0 !important}.flex-grow-1{flex-grow:1 !important}.flex-shrink-0{flex-shrink:0 !important}.flex-shrink-1{flex-shrink:1 !important}.flex-wrap{flex-wrap:wrap !important}.flex-nowrap{flex-wrap:nowrap !important}.flex-wrap-reverse{flex-wrap:wrap-reverse !important}.justify-content-start{justify-content:flex-start !important}.justify-content-end{justify-content:flex-end !important}.justify-content-center{justify-content:center !important}.justify-content-between{justify-content:space-between !important}.justify-content-around{justify-content:space-around !important}.justify-content-evenly{justify-content:space-evenly !important}.align-items-start{align-items:flex-start !important}.align-items-end{align-items:flex-end !important}.align-items-center{align-items:center !important}.align-items-baseline{align-items:baseline !important}.align-items-stretch{align-items:stretch !important}.align-content-start{align-content:flex-start !important}.align-content-end{align-content:flex-end !important}.align-content-center{align-content:center !important}.align-content-between{align-content:space-between !important}.align-content-around{align-content:space-around !important}.align-content-stretch{align-content:stretch !important}.align-self-auto{align-self:auto !important}.align-self-start{align-self:flex-start !important}.align-self-end{align-self:flex-end !important}.align-self-center{align-self:center !important}.align-self-baseline{align-self:baseline !important}.align-self-stretch{align-self:stretch !important}.order-first{order:-1 !important}.order-0{order:0 !important}.order-1{order:1 !important}.order-2{order:2 !important}.order-3{order:3 !important}.order-4{order:4 !important}.order-5{order:5 !important}.order-last{order:6 !important}.m-0{margin:0 !important}.m-1{margin:.25rem !important}.m-2{margin:.5rem !important}.m-3{margin:1rem !important}.m-4{margin:1.5rem !important}.m-5{margin:3rem !important}.m-auto{margin:auto !important}.mx-0{margin-right:0 !important;margin-left:0 !important}.mx-1{margin-right:.25rem !important;margin-left:.25rem !important}.mx-2{margin-right:.5rem !important;margin-left:.5rem !important}.mx-3{margin-right:1rem !important;margin-left:1rem !important}.mx-4{margin-right:1.5rem !important;margin-left:1.5rem !important}.mx-5{margin-right:3rem !important;margin-left:3rem !important}.mx-auto{margin-right:auto !important;margin-left:auto !important}.my-0{margin-top:0 !important;margin-bottom:0 !important}.my-1{margin-top:.25rem !important;margin-bottom:.25rem !important}.my-2{margin-top:.5rem !important;margin-bottom:.5rem !important}.my-3{margin-top:1rem !important;margin-bottom:1rem !important}.my-4{margin-top:1.5rem !important;margin-bottom:1.5rem !important}.my-5{margin-top:3rem !important;margin-bottom:3rem !important}.my-auto{margin-top:auto !important;margin-bottom:auto !important}.mt-0{margin-top:0 !important}.mt-1{margin-top:.25rem !important}.mt-2{margin-top:.5rem !important}.mt-3{margin-top:1rem !important}.mt-4{margin-top:1.5rem !important}.mt-5{margin-top:3rem !important}.mt-auto{margin-top:auto !important}.me-0{margin-right:0 !important}.me-1{margin-right:.25rem !important}.me-2{margin-right:.5rem !important}.me-3{margin-right:1rem !important}.me-4{margin-right:1.5rem !important}.me-5{margin-right:3rem !important}.me-auto{margin-right:auto !important}.mb-0{margin-bottom:0 !important}.mb-1{margin-bottom:.25rem !important}.mb-2{margin-bottom:.5rem !important}.mb-3{margin-bottom:1rem !important}.mb-4{margin-bottom:1.5rem !important}.mb-5{margin-bottom:3rem !important}.mb-auto{margin-bottom:auto !important}.ms-0{margin-left:0 !important}.ms-1{margin-left:.25rem !important}.ms-2{margin-left:.5rem !important}.ms-3{margin-left:1rem !important}.ms-4{margin-left:1.5rem !important}.ms-5{margin-left:3rem !important}.ms-auto{margin-left:auto !important}.p-0{padding:0 !important}.p-1{padding:.25rem !important}.p-2{padding:.5rem !important}.p-3{padding:1rem !important}.p-4{padding:1.5rem !important}.p-5{padding:3rem !important}.px-0{padding-right:0 !important;padding-left:0 !important}.px-1{padding-right:.25rem !important;padding-left:.25rem !important}.px-2{padding-right:.5rem !important;padding-left:.5rem !important}.px-3{padding-right:1rem !important;padding-left:1rem !important}.px-4{padding-right:1.5rem !important;padding-left:1.5rem !important}.px-5{padding-right:3rem !important;padding-left:3rem !important}.py-0{padding-top:0 !important;padding-bottom:0 !important}.py-1{padding-top:.25rem !important;padding-bottom:.25rem !important}.py-2{padding-top:.5rem !important;padding-bottom:.5rem !important}.py-3{padding-top:1rem !important;padding-bottom:1rem !important}.py-4{padding-top:1.5rem !important;padding-bottom:1.5rem !important}.py-5{padding-top:3rem !important;padding-bottom:3rem !important}.pt-0{padding-top:0 !important}.pt-1{padding-top:.25rem !important}.pt-2{padding-top:.5rem !important}.pt-3{padding-top:1rem !important}.pt-4{padding-top:1.5rem !important}.pt-5{padding-top:3rem !important}.pe-0{padding-right:0 !important}.pe-1{padding-right:.25rem !important}.pe-2{padding-right:.5rem !important}.pe-3{padding-right:1rem !important}.pe-4{padding-right:1.5rem !important}.pe-5{padding-right:3rem !important}.pb-0{padding-bottom:0 !important}.pb-1{padding-bottom:.25rem !important}.pb-2{padding-bottom:.5rem !important}.pb-3{padding-bottom:1rem !important}.pb-4{padding-bottom:1.5rem !important}.pb-5{padding-bottom:3rem !important}.ps-0{padding-left:0 !important}.ps-1{padding-left:.25rem !important}.ps-2{padding-left:.5rem !important}.ps-3{padding-left:1rem !important}.ps-4{padding-left:1.5rem !important}.ps-5{padding-left:3rem !important}.gap-0{gap:0 !important}.gap-1{gap:.25rem !important}.gap-2{gap:.5rem !important}.gap-3{gap:1rem !important}.gap-4{gap:1.5rem !important}.gap-5{gap:3rem !important}.row-gap-0{row-gap:0 !important}.row-gap-1{row-gap:.25rem !important}.row-gap-2{row-gap:.5rem !important}.row-gap-3{row-gap:1rem !important}.row-gap-4{row-gap:1.5rem !important}.row-gap-5{row-gap:3rem !important}.column-gap-0{column-gap:0 !important}.column-gap-1{column-gap:.25rem !important}.column-gap-2{column-gap:.5rem !important}.column-gap-3{column-gap:1rem !important}.column-gap-4{column-gap:1.5rem !important}.column-gap-5{column-gap:3rem !important}.font-monospace{font-family:var(--bs-font-monospace) !important}.fs-1{font-size:calc(1.325rem + 0.9vw) !important}.fs-2{font-size:calc(1.29rem + 0.48vw) !important}.fs-3{font-size:calc(1.27rem + 0.24vw) !important}.fs-4{font-size:1.25rem !important}.fs-5{font-size:1.1rem !important}.fs-6{font-size:1rem !important}.fst-italic{font-style:italic !important}.fst-normal{font-style:normal !important}.fw-lighter{font-weight:lighter !important}.fw-light{font-weight:300 !important}.fw-normal{font-weight:400 !important}.fw-medium{font-weight:500 !important}.fw-semibold{font-weight:600 !important}.fw-bold{font-weight:700 !important}.fw-bolder{font-weight:bolder !important}.lh-1{line-height:1 !important}.lh-sm{line-height:1.25 !important}.lh-base{line-height:1.5 !important}.lh-lg{line-height:2 !important}.text-start{text-align:left !important}.text-end{text-align:right !important}.text-center{text-align:center !important}.text-decoration-none{text-decoration:none !important}.text-decoration-underline{text-decoration:underline !important}.text-decoration-line-through{text-decoration:line-through !important}.text-lowercase{text-transform:lowercase !important}.text-uppercase{text-transform:uppercase !important}.text-capitalize{text-transform:capitalize !important}.text-wrap{white-space:normal !important}.text-nowrap{white-space:nowrap !important}.text-break{word-wrap:break-word !important;word-break:break-word !important}.text-default{--bs-text-opacity: 1;color:rgba(var(--bs-default-rgb), var(--bs-text-opacity)) !important}.text-primary{--bs-text-opacity: 1;color:rgba(var(--bs-primary-rgb), var(--bs-text-opacity)) !important}.text-secondary{--bs-text-opacity: 1;color:rgba(var(--bs-secondary-rgb), var(--bs-text-opacity)) !important}.text-success{--bs-text-opacity: 1;color:rgba(var(--bs-success-rgb), var(--bs-text-opacity)) !important}.text-info{--bs-text-opacity: 1;color:rgba(var(--bs-info-rgb), var(--bs-text-opacity)) !important}.text-warning{--bs-text-opacity: 1;color:rgba(var(--bs-warning-rgb), var(--bs-text-opacity)) !important}.text-danger{--bs-text-opacity: 1;color:rgba(var(--bs-danger-rgb), var(--bs-text-opacity)) !important}.text-light{--bs-text-opacity: 1;color:rgba(var(--bs-light-rgb), var(--bs-text-opacity)) !important}.text-dark{--bs-text-opacity: 1;color:rgba(var(--bs-dark-rgb), var(--bs-text-opacity)) !important}.text-black{--bs-text-opacity: 1;color:rgba(var(--bs-black-rgb), var(--bs-text-opacity)) !important}.text-white{--bs-text-opacity: 1;color:rgba(var(--bs-white-rgb), var(--bs-text-opacity)) !important}.text-body{--bs-text-opacity: 1;color:rgba(var(--bs-body-color-rgb), var(--bs-text-opacity)) !important}.text-muted{--bs-text-opacity: 1;color:var(--bs-secondary-color) !important}.text-black-50{--bs-text-opacity: 1;color:rgba(0,0,0,.5) !important}.text-white-50{--bs-text-opacity: 1;color:rgba(255,255,255,.5) !important}.text-body-secondary{--bs-text-opacity: 1;color:var(--bs-secondary-color) !important}.text-body-tertiary{--bs-text-opacity: 1;color:var(--bs-tertiary-color) !important}.text-body-emphasis{--bs-text-opacity: 1;color:var(--bs-emphasis-color) !important}.text-reset{--bs-text-opacity: 1;color:inherit !important}.text-opacity-25{--bs-text-opacity: 0.25}.text-opacity-50{--bs-text-opacity: 0.5}.text-opacity-75{--bs-text-opacity: 0.75}.text-opacity-100{--bs-text-opacity: 1}.text-primary-emphasis{color:var(--bs-primary-text-emphasis) !important}.text-secondary-emphasis{color:var(--bs-secondary-text-emphasis) !important}.text-success-emphasis{color:var(--bs-success-text-emphasis) !important}.text-info-emphasis{color:var(--bs-info-text-emphasis) !important}.text-warning-emphasis{color:var(--bs-warning-text-emphasis) !important}.text-danger-emphasis{color:var(--bs-danger-text-emphasis) !important}.text-light-emphasis{color:var(--bs-light-text-emphasis) !important}.text-dark-emphasis{color:var(--bs-dark-text-emphasis) !important}.link-opacity-10{--bs-link-opacity: 0.1}.link-opacity-10-hover:hover{--bs-link-opacity: 0.1}.link-opacity-25{--bs-link-opacity: 0.25}.link-opacity-25-hover:hover{--bs-link-opacity: 0.25}.link-opacity-50{--bs-link-opacity: 0.5}.link-opacity-50-hover:hover{--bs-link-opacity: 0.5}.link-opacity-75{--bs-link-opacity: 0.75}.link-opacity-75-hover:hover{--bs-link-opacity: 0.75}.link-opacity-100{--bs-link-opacity: 1}.link-opacity-100-hover:hover{--bs-link-opacity: 1}.link-offset-1{text-underline-offset:.125em !important}.link-offset-1-hover:hover{text-underline-offset:.125em !important}.link-offset-2{text-underline-offset:.25em !important}.link-offset-2-hover:hover{text-underline-offset:.25em !important}.link-offset-3{text-underline-offset:.375em !important}.link-offset-3-hover:hover{text-underline-offset:.375em !important}.link-underline-default{--bs-link-underline-opacity: 1;text-decoration-color:rgba(var(--bs-default-rgb), var(--bs-link-underline-opacity)) !important}.link-underline-primary{--bs-link-underline-opacity: 1;text-decoration-color:rgba(var(--bs-primary-rgb), var(--bs-link-underline-opacity)) !important}.link-underline-secondary{--bs-link-underline-opacity: 1;text-decoration-color:rgba(var(--bs-secondary-rgb), var(--bs-link-underline-opacity)) !important}.link-underline-success{--bs-link-underline-opacity: 1;text-decoration-color:rgba(var(--bs-success-rgb), var(--bs-link-underline-opacity)) !important}.link-underline-info{--bs-link-underline-opacity: 1;text-decoration-color:rgba(var(--bs-info-rgb), var(--bs-link-underline-opacity)) !important}.link-underline-warning{--bs-link-underline-opacity: 1;text-decoration-color:rgba(var(--bs-warning-rgb), var(--bs-link-underline-opacity)) !important}.link-underline-danger{--bs-link-underline-opacity: 1;text-decoration-color:rgba(var(--bs-danger-rgb), var(--bs-link-underline-opacity)) !important}.link-underline-light{--bs-link-underline-opacity: 1;text-decoration-color:rgba(var(--bs-light-rgb), var(--bs-link-underline-opacity)) !important}.link-underline-dark{--bs-link-underline-opacity: 1;text-decoration-color:rgba(var(--bs-dark-rgb), var(--bs-link-underline-opacity)) !important}.link-underline{--bs-link-underline-opacity: 1;text-decoration-color:rgba(var(--bs-link-color-rgb), var(--bs-link-underline-opacity, 1)) !important}.link-underline-opacity-0{--bs-link-underline-opacity: 0}.link-underline-opacity-0-hover:hover{--bs-link-underline-opacity: 0}.link-underline-opacity-10{--bs-link-underline-opacity: 0.1}.link-underline-opacity-10-hover:hover{--bs-link-underline-opacity: 0.1}.link-underline-opacity-25{--bs-link-underline-opacity: 0.25}.link-underline-opacity-25-hover:hover{--bs-link-underline-opacity: 0.25}.link-underline-opacity-50{--bs-link-underline-opacity: 0.5}.link-underline-opacity-50-hover:hover{--bs-link-underline-opacity: 0.5}.link-underline-opacity-75{--bs-link-underline-opacity: 0.75}.link-underline-opacity-75-hover:hover{--bs-link-underline-opacity: 0.75}.link-underline-opacity-100{--bs-link-underline-opacity: 1}.link-underline-opacity-100-hover:hover{--bs-link-underline-opacity: 1}.bg-default{--bs-bg-opacity: 1;background-color:rgba(var(--bs-default-rgb), var(--bs-bg-opacity)) !important}.bg-primary{--bs-bg-opacity: 1;background-color:rgba(var(--bs-primary-rgb), var(--bs-bg-opacity)) !important}.bg-secondary{--bs-bg-opacity: 1;background-color:rgba(var(--bs-secondary-rgb), var(--bs-bg-opacity)) !important}.bg-success{--bs-bg-opacity: 1;background-color:rgba(var(--bs-success-rgb), var(--bs-bg-opacity)) !important}.bg-info{--bs-bg-opacity: 1;background-color:rgba(var(--bs-info-rgb), var(--bs-bg-opacity)) !important}.bg-warning{--bs-bg-opacity: 1;background-color:rgba(var(--bs-warning-rgb), var(--bs-bg-opacity)) !important}.bg-danger{--bs-bg-opacity: 1;background-color:rgba(var(--bs-danger-rgb), var(--bs-bg-opacity)) !important}.bg-light{--bs-bg-opacity: 1;background-color:rgba(var(--bs-light-rgb), var(--bs-bg-opacity)) !important}.bg-dark{--bs-bg-opacity: 1;background-color:rgba(var(--bs-dark-rgb), var(--bs-bg-opacity)) !important}.bg-black{--bs-bg-opacity: 1;background-color:rgba(var(--bs-black-rgb), var(--bs-bg-opacity)) !important}.bg-white{--bs-bg-opacity: 1;background-color:rgba(var(--bs-white-rgb), var(--bs-bg-opacity)) !important}.bg-body{--bs-bg-opacity: 1;background-color:rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important}.bg-transparent{--bs-bg-opacity: 1;background-color:rgba(0,0,0,0) !important}.bg-body-secondary{--bs-bg-opacity: 1;background-color:rgba(var(--bs-secondary-bg-rgb), var(--bs-bg-opacity)) !important}.bg-body-tertiary{--bs-bg-opacity: 1;background-color:rgba(var(--bs-tertiary-bg-rgb), var(--bs-bg-opacity)) !important}.bg-opacity-10{--bs-bg-opacity: 0.1}.bg-opacity-25{--bs-bg-opacity: 0.25}.bg-opacity-50{--bs-bg-opacity: 0.5}.bg-opacity-75{--bs-bg-opacity: 0.75}.bg-opacity-100{--bs-bg-opacity: 1}.bg-primary-subtle{background-color:var(--bs-primary-bg-subtle) !important}.bg-secondary-subtle{background-color:var(--bs-secondary-bg-subtle) !important}.bg-success-subtle{background-color:var(--bs-success-bg-subtle) !important}.bg-info-subtle{background-color:var(--bs-info-bg-subtle) !important}.bg-warning-subtle{background-color:var(--bs-warning-bg-subtle) !important}.bg-danger-subtle{background-color:var(--bs-danger-bg-subtle) !important}.bg-light-subtle{background-color:var(--bs-light-bg-subtle) !important}.bg-dark-subtle{background-color:var(--bs-dark-bg-subtle) !important}.bg-gradient{background-image:var(--bs-gradient) !important}.user-select-all{user-select:all !important}.user-select-auto{user-select:auto !important}.user-select-none{user-select:none !important}.pe-none{pointer-events:none !important}.pe-auto{pointer-events:auto !important}.rounded{border-radius:var(--bs-border-radius) !important}.rounded-0{border-radius:0 !important}.rounded-1{border-radius:var(--bs-border-radius-sm) !important}.rounded-2{border-radius:var(--bs-border-radius) !important}.rounded-3{border-radius:var(--bs-border-radius-lg) !important}.rounded-4{border-radius:var(--bs-border-radius-xl) !important}.rounded-5{border-radius:var(--bs-border-radius-xxl) !important}.rounded-circle{border-radius:50% !important}.rounded-pill{border-radius:var(--bs-border-radius-pill) !important}.rounded-top{border-top-left-radius:var(--bs-border-radius) !important;border-top-right-radius:var(--bs-border-radius) !important}.rounded-top-0{border-top-left-radius:0 !important;border-top-right-radius:0 !important}.rounded-top-1{border-top-left-radius:var(--bs-border-radius-sm) !important;border-top-right-radius:var(--bs-border-radius-sm) !important}.rounded-top-2{border-top-left-radius:var(--bs-border-radius) !important;border-top-right-radius:var(--bs-border-radius) !important}.rounded-top-3{border-top-left-radius:var(--bs-border-radius-lg) !important;border-top-right-radius:var(--bs-border-radius-lg) !important}.rounded-top-4{border-top-left-radius:var(--bs-border-radius-xl) !important;border-top-right-radius:var(--bs-border-radius-xl) !important}.rounded-top-5{border-top-left-radius:var(--bs-border-radius-xxl) !important;border-top-right-radius:var(--bs-border-radius-xxl) !important}.rounded-top-circle{border-top-left-radius:50% !important;border-top-right-radius:50% !important}.rounded-top-pill{border-top-left-radius:var(--bs-border-radius-pill) !important;border-top-right-radius:var(--bs-border-radius-pill) !important}.rounded-end{border-top-right-radius:var(--bs-border-radius) !important;border-bottom-right-radius:var(--bs-border-radius) !important}.rounded-end-0{border-top-right-radius:0 !important;border-bottom-right-radius:0 !important}.rounded-end-1{border-top-right-radius:var(--bs-border-radius-sm) !important;border-bottom-right-radius:var(--bs-border-radius-sm) !important}.rounded-end-2{border-top-right-radius:var(--bs-border-radius) !important;border-bottom-right-radius:var(--bs-border-radius) !important}.rounded-end-3{border-top-right-radius:var(--bs-border-radius-lg) !important;border-bottom-right-radius:var(--bs-border-radius-lg) !important}.rounded-end-4{border-top-right-radius:var(--bs-border-radius-xl) !important;border-bottom-right-radius:var(--bs-border-radius-xl) !important}.rounded-end-5{border-top-right-radius:var(--bs-border-radius-xxl) !important;border-bottom-right-radius:var(--bs-border-radius-xxl) !important}.rounded-end-circle{border-top-right-radius:50% !important;border-bottom-right-radius:50% !important}.rounded-end-pill{border-top-right-radius:var(--bs-border-radius-pill) !important;border-bottom-right-radius:var(--bs-border-radius-pill) !important}.rounded-bottom{border-bottom-right-radius:var(--bs-border-radius) !important;border-bottom-left-radius:var(--bs-border-radius) !important}.rounded-bottom-0{border-bottom-right-radius:0 !important;border-bottom-left-radius:0 !important}.rounded-bottom-1{border-bottom-right-radius:var(--bs-border-radius-sm) !important;border-bottom-left-radius:var(--bs-border-radius-sm) !important}.rounded-bottom-2{border-bottom-right-radius:var(--bs-border-radius) !important;border-bottom-left-radius:var(--bs-border-radius) !important}.rounded-bottom-3{border-bottom-right-radius:var(--bs-border-radius-lg) !important;border-bottom-left-radius:var(--bs-border-radius-lg) !important}.rounded-bottom-4{border-bottom-right-radius:var(--bs-border-radius-xl) !important;border-bottom-left-radius:var(--bs-border-radius-xl) !important}.rounded-bottom-5{border-bottom-right-radius:var(--bs-border-radius-xxl) !important;border-bottom-left-radius:var(--bs-border-radius-xxl) !important}.rounded-bottom-circle{border-bottom-right-radius:50% !important;border-bottom-left-radius:50% !important}.rounded-bottom-pill{border-bottom-right-radius:var(--bs-border-radius-pill) !important;border-bottom-left-radius:var(--bs-border-radius-pill) !important}.rounded-start{border-bottom-left-radius:var(--bs-border-radius) !important;border-top-left-radius:var(--bs-border-radius) !important}.rounded-start-0{border-bottom-left-radius:0 !important;border-top-left-radius:0 !important}.rounded-start-1{border-bottom-left-radius:var(--bs-border-radius-sm) !important;border-top-left-radius:var(--bs-border-radius-sm) !important}.rounded-start-2{border-bottom-left-radius:var(--bs-border-radius) !important;border-top-left-radius:var(--bs-border-radius) !important}.rounded-start-3{border-bottom-left-radius:var(--bs-border-radius-lg) !important;border-top-left-radius:var(--bs-border-radius-lg) !important}.rounded-start-4{border-bottom-left-radius:var(--bs-border-radius-xl) !important;border-top-left-radius:var(--bs-border-radius-xl) !important}.rounded-start-5{border-bottom-left-radius:var(--bs-border-radius-xxl) !important;border-top-left-radius:var(--bs-border-radius-xxl) !important}.rounded-start-circle{border-bottom-left-radius:50% !important;border-top-left-radius:50% !important}.rounded-start-pill{border-bottom-left-radius:var(--bs-border-radius-pill) !important;border-top-left-radius:var(--bs-border-radius-pill) !important}.visible{visibility:visible !important}.invisible{visibility:hidden !important}.z-n1{z-index:-1 !important}.z-0{z-index:0 !important}.z-1{z-index:1 !important}.z-2{z-index:2 !important}.z-3{z-index:3 !important}@media(min-width: 576px){.float-sm-start{float:left !important}.float-sm-end{float:right !important}.float-sm-none{float:none !important}.object-fit-sm-contain{object-fit:contain !important}.object-fit-sm-cover{object-fit:cover !important}.object-fit-sm-fill{object-fit:fill !important}.object-fit-sm-scale{object-fit:scale-down !important}.object-fit-sm-none{object-fit:none !important}.d-sm-inline{display:inline !important}.d-sm-inline-block{display:inline-block !important}.d-sm-block{display:block !important}.d-sm-grid{display:grid !important}.d-sm-inline-grid{display:inline-grid !important}.d-sm-table{display:table !important}.d-sm-table-row{display:table-row !important}.d-sm-table-cell{display:table-cell !important}.d-sm-flex{display:flex !important}.d-sm-inline-flex{display:inline-flex !important}.d-sm-none{display:none !important}.flex-sm-fill{flex:1 1 auto !important}.flex-sm-row{flex-direction:row !important}.flex-sm-column{flex-direction:column !important}.flex-sm-row-reverse{flex-direction:row-reverse !important}.flex-sm-column-reverse{flex-direction:column-reverse !important}.flex-sm-grow-0{flex-grow:0 !important}.flex-sm-grow-1{flex-grow:1 !important}.flex-sm-shrink-0{flex-shrink:0 !important}.flex-sm-shrink-1{flex-shrink:1 !important}.flex-sm-wrap{flex-wrap:wrap !important}.flex-sm-nowrap{flex-wrap:nowrap !important}.flex-sm-wrap-reverse{flex-wrap:wrap-reverse !important}.justify-content-sm-start{justify-content:flex-start !important}.justify-content-sm-end{justify-content:flex-end !important}.justify-content-sm-center{justify-content:center !important}.justify-content-sm-between{justify-content:space-between !important}.justify-content-sm-around{justify-content:space-around !important}.justify-content-sm-evenly{justify-content:space-evenly !important}.align-items-sm-start{align-items:flex-start !important}.align-items-sm-end{align-items:flex-end !important}.align-items-sm-center{align-items:center !important}.align-items-sm-baseline{align-items:baseline !important}.align-items-sm-stretch{align-items:stretch !important}.align-content-sm-start{align-content:flex-start !important}.align-content-sm-end{align-content:flex-end !important}.align-content-sm-center{align-content:center !important}.align-content-sm-between{align-content:space-between !important}.align-content-sm-around{align-content:space-around !important}.align-content-sm-stretch{align-content:stretch !important}.align-self-sm-auto{align-self:auto !important}.align-self-sm-start{align-self:flex-start !important}.align-self-sm-end{align-self:flex-end !important}.align-self-sm-center{align-self:center !important}.align-self-sm-baseline{align-self:baseline !important}.align-self-sm-stretch{align-self:stretch !important}.order-sm-first{order:-1 !important}.order-sm-0{order:0 !important}.order-sm-1{order:1 !important}.order-sm-2{order:2 !important}.order-sm-3{order:3 !important}.order-sm-4{order:4 !important}.order-sm-5{order:5 !important}.order-sm-last{order:6 !important}.m-sm-0{margin:0 !important}.m-sm-1{margin:.25rem !important}.m-sm-2{margin:.5rem !important}.m-sm-3{margin:1rem !important}.m-sm-4{margin:1.5rem !important}.m-sm-5{margin:3rem !important}.m-sm-auto{margin:auto !important}.mx-sm-0{margin-right:0 !important;margin-left:0 !important}.mx-sm-1{margin-right:.25rem !important;margin-left:.25rem !important}.mx-sm-2{margin-right:.5rem !important;margin-left:.5rem !important}.mx-sm-3{margin-right:1rem !important;margin-left:1rem !important}.mx-sm-4{margin-right:1.5rem !important;margin-left:1.5rem !important}.mx-sm-5{margin-right:3rem !important;margin-left:3rem !important}.mx-sm-auto{margin-right:auto !important;margin-left:auto !important}.my-sm-0{margin-top:0 !important;margin-bottom:0 !important}.my-sm-1{margin-top:.25rem !important;margin-bottom:.25rem !important}.my-sm-2{margin-top:.5rem !important;margin-bottom:.5rem !important}.my-sm-3{margin-top:1rem !important;margin-bottom:1rem !important}.my-sm-4{margin-top:1.5rem !important;margin-bottom:1.5rem !important}.my-sm-5{margin-top:3rem !important;margin-bottom:3rem !important}.my-sm-auto{margin-top:auto !important;margin-bottom:auto !important}.mt-sm-0{margin-top:0 !important}.mt-sm-1{margin-top:.25rem !important}.mt-sm-2{margin-top:.5rem !important}.mt-sm-3{margin-top:1rem !important}.mt-sm-4{margin-top:1.5rem !important}.mt-sm-5{margin-top:3rem !important}.mt-sm-auto{margin-top:auto !important}.me-sm-0{margin-right:0 !important}.me-sm-1{margin-right:.25rem !important}.me-sm-2{margin-right:.5rem !important}.me-sm-3{margin-right:1rem !important}.me-sm-4{margin-right:1.5rem !important}.me-sm-5{margin-right:3rem !important}.me-sm-auto{margin-right:auto !important}.mb-sm-0{margin-bottom:0 !important}.mb-sm-1{margin-bottom:.25rem !important}.mb-sm-2{margin-bottom:.5rem !important}.mb-sm-3{margin-bottom:1rem !important}.mb-sm-4{margin-bottom:1.5rem !important}.mb-sm-5{margin-bottom:3rem !important}.mb-sm-auto{margin-bottom:auto !important}.ms-sm-0{margin-left:0 !important}.ms-sm-1{margin-left:.25rem !important}.ms-sm-2{margin-left:.5rem !important}.ms-sm-3{margin-left:1rem !important}.ms-sm-4{margin-left:1.5rem !important}.ms-sm-5{margin-left:3rem !important}.ms-sm-auto{margin-left:auto !important}.p-sm-0{padding:0 !important}.p-sm-1{padding:.25rem !important}.p-sm-2{padding:.5rem !important}.p-sm-3{padding:1rem !important}.p-sm-4{padding:1.5rem !important}.p-sm-5{padding:3rem !important}.px-sm-0{padding-right:0 !important;padding-left:0 !important}.px-sm-1{padding-right:.25rem !important;padding-left:.25rem !important}.px-sm-2{padding-right:.5rem !important;padding-left:.5rem !important}.px-sm-3{padding-right:1rem !important;padding-left:1rem !important}.px-sm-4{padding-right:1.5rem !important;padding-left:1.5rem !important}.px-sm-5{padding-right:3rem !important;padding-left:3rem !important}.py-sm-0{padding-top:0 !important;padding-bottom:0 !important}.py-sm-1{padding-top:.25rem !important;padding-bottom:.25rem !important}.py-sm-2{padding-top:.5rem !important;padding-bottom:.5rem !important}.py-sm-3{padding-top:1rem !important;padding-bottom:1rem !important}.py-sm-4{padding-top:1.5rem !important;padding-bottom:1.5rem !important}.py-sm-5{padding-top:3rem !important;padding-bottom:3rem !important}.pt-sm-0{padding-top:0 !important}.pt-sm-1{padding-top:.25rem !important}.pt-sm-2{padding-top:.5rem !important}.pt-sm-3{padding-top:1rem !important}.pt-sm-4{padding-top:1.5rem !important}.pt-sm-5{padding-top:3rem !important}.pe-sm-0{padding-right:0 !important}.pe-sm-1{padding-right:.25rem !important}.pe-sm-2{padding-right:.5rem !important}.pe-sm-3{padding-right:1rem !important}.pe-sm-4{padding-right:1.5rem !important}.pe-sm-5{padding-right:3rem !important}.pb-sm-0{padding-bottom:0 !important}.pb-sm-1{padding-bottom:.25rem !important}.pb-sm-2{padding-bottom:.5rem !important}.pb-sm-3{padding-bottom:1rem !important}.pb-sm-4{padding-bottom:1.5rem !important}.pb-sm-5{padding-bottom:3rem !important}.ps-sm-0{padding-left:0 !important}.ps-sm-1{padding-left:.25rem !important}.ps-sm-2{padding-left:.5rem !important}.ps-sm-3{padding-left:1rem !important}.ps-sm-4{padding-left:1.5rem !important}.ps-sm-5{padding-left:3rem !important}.gap-sm-0{gap:0 !important}.gap-sm-1{gap:.25rem !important}.gap-sm-2{gap:.5rem !important}.gap-sm-3{gap:1rem !important}.gap-sm-4{gap:1.5rem !important}.gap-sm-5{gap:3rem !important}.row-gap-sm-0{row-gap:0 !important}.row-gap-sm-1{row-gap:.25rem !important}.row-gap-sm-2{row-gap:.5rem !important}.row-gap-sm-3{row-gap:1rem !important}.row-gap-sm-4{row-gap:1.5rem !important}.row-gap-sm-5{row-gap:3rem !important}.column-gap-sm-0{column-gap:0 !important}.column-gap-sm-1{column-gap:.25rem !important}.column-gap-sm-2{column-gap:.5rem !important}.column-gap-sm-3{column-gap:1rem !important}.column-gap-sm-4{column-gap:1.5rem !important}.column-gap-sm-5{column-gap:3rem !important}.text-sm-start{text-align:left !important}.text-sm-end{text-align:right !important}.text-sm-center{text-align:center !important}}@media(min-width: 768px){.float-md-start{float:left !important}.float-md-end{float:right !important}.float-md-none{float:none !important}.object-fit-md-contain{object-fit:contain !important}.object-fit-md-cover{object-fit:cover !important}.object-fit-md-fill{object-fit:fill !important}.object-fit-md-scale{object-fit:scale-down !important}.object-fit-md-none{object-fit:none !important}.d-md-inline{display:inline !important}.d-md-inline-block{display:inline-block !important}.d-md-block{display:block !important}.d-md-grid{display:grid !important}.d-md-inline-grid{display:inline-grid !important}.d-md-table{display:table !important}.d-md-table-row{display:table-row !important}.d-md-table-cell{display:table-cell !important}.d-md-flex{display:flex !important}.d-md-inline-flex{display:inline-flex !important}.d-md-none{display:none !important}.flex-md-fill{flex:1 1 auto !important}.flex-md-row{flex-direction:row !important}.flex-md-column{flex-direction:column !important}.flex-md-row-reverse{flex-direction:row-reverse !important}.flex-md-column-reverse{flex-direction:column-reverse !important}.flex-md-grow-0{flex-grow:0 !important}.flex-md-grow-1{flex-grow:1 !important}.flex-md-shrink-0{flex-shrink:0 !important}.flex-md-shrink-1{flex-shrink:1 !important}.flex-md-wrap{flex-wrap:wrap !important}.flex-md-nowrap{flex-wrap:nowrap !important}.flex-md-wrap-reverse{flex-wrap:wrap-reverse !important}.justify-content-md-start{justify-content:flex-start !important}.justify-content-md-end{justify-content:flex-end !important}.justify-content-md-center{justify-content:center !important}.justify-content-md-between{justify-content:space-between !important}.justify-content-md-around{justify-content:space-around !important}.justify-content-md-evenly{justify-content:space-evenly !important}.align-items-md-start{align-items:flex-start !important}.align-items-md-end{align-items:flex-end !important}.align-items-md-center{align-items:center !important}.align-items-md-baseline{align-items:baseline !important}.align-items-md-stretch{align-items:stretch !important}.align-content-md-start{align-content:flex-start !important}.align-content-md-end{align-content:flex-end !important}.align-content-md-center{align-content:center !important}.align-content-md-between{align-content:space-between !important}.align-content-md-around{align-content:space-around !important}.align-content-md-stretch{align-content:stretch !important}.align-self-md-auto{align-self:auto !important}.align-self-md-start{align-self:flex-start !important}.align-self-md-end{align-self:flex-end !important}.align-self-md-center{align-self:center !important}.align-self-md-baseline{align-self:baseline !important}.align-self-md-stretch{align-self:stretch !important}.order-md-first{order:-1 !important}.order-md-0{order:0 !important}.order-md-1{order:1 !important}.order-md-2{order:2 !important}.order-md-3{order:3 !important}.order-md-4{order:4 !important}.order-md-5{order:5 !important}.order-md-last{order:6 !important}.m-md-0{margin:0 !important}.m-md-1{margin:.25rem !important}.m-md-2{margin:.5rem !important}.m-md-3{margin:1rem !important}.m-md-4{margin:1.5rem !important}.m-md-5{margin:3rem !important}.m-md-auto{margin:auto !important}.mx-md-0{margin-right:0 !important;margin-left:0 !important}.mx-md-1{margin-right:.25rem !important;margin-left:.25rem !important}.mx-md-2{margin-right:.5rem !important;margin-left:.5rem !important}.mx-md-3{margin-right:1rem !important;margin-left:1rem !important}.mx-md-4{margin-right:1.5rem !important;margin-left:1.5rem !important}.mx-md-5{margin-right:3rem !important;margin-left:3rem !important}.mx-md-auto{margin-right:auto !important;margin-left:auto !important}.my-md-0{margin-top:0 !important;margin-bottom:0 !important}.my-md-1{margin-top:.25rem !important;margin-bottom:.25rem !important}.my-md-2{margin-top:.5rem !important;margin-bottom:.5rem !important}.my-md-3{margin-top:1rem !important;margin-bottom:1rem !important}.my-md-4{margin-top:1.5rem !important;margin-bottom:1.5rem !important}.my-md-5{margin-top:3rem !important;margin-bottom:3rem !important}.my-md-auto{margin-top:auto !important;margin-bottom:auto !important}.mt-md-0{margin-top:0 !important}.mt-md-1{margin-top:.25rem !important}.mt-md-2{margin-top:.5rem !important}.mt-md-3{margin-top:1rem !important}.mt-md-4{margin-top:1.5rem !important}.mt-md-5{margin-top:3rem !important}.mt-md-auto{margin-top:auto !important}.me-md-0{margin-right:0 !important}.me-md-1{margin-right:.25rem !important}.me-md-2{margin-right:.5rem !important}.me-md-3{margin-right:1rem !important}.me-md-4{margin-right:1.5rem !important}.me-md-5{margin-right:3rem !important}.me-md-auto{margin-right:auto !important}.mb-md-0{margin-bottom:0 !important}.mb-md-1{margin-bottom:.25rem !important}.mb-md-2{margin-bottom:.5rem !important}.mb-md-3{margin-bottom:1rem !important}.mb-md-4{margin-bottom:1.5rem !important}.mb-md-5{margin-bottom:3rem !important}.mb-md-auto{margin-bottom:auto !important}.ms-md-0{margin-left:0 !important}.ms-md-1{margin-left:.25rem !important}.ms-md-2{margin-left:.5rem !important}.ms-md-3{margin-left:1rem !important}.ms-md-4{margin-left:1.5rem !important}.ms-md-5{margin-left:3rem !important}.ms-md-auto{margin-left:auto !important}.p-md-0{padding:0 !important}.p-md-1{padding:.25rem !important}.p-md-2{padding:.5rem !important}.p-md-3{padding:1rem !important}.p-md-4{padding:1.5rem !important}.p-md-5{padding:3rem !important}.px-md-0{padding-right:0 !important;padding-left:0 !important}.px-md-1{padding-right:.25rem !important;padding-left:.25rem !important}.px-md-2{padding-right:.5rem !important;padding-left:.5rem !important}.px-md-3{padding-right:1rem !important;padding-left:1rem !important}.px-md-4{padding-right:1.5rem !important;padding-left:1.5rem !important}.px-md-5{padding-right:3rem !important;padding-left:3rem !important}.py-md-0{padding-top:0 !important;padding-bottom:0 !important}.py-md-1{padding-top:.25rem !important;padding-bottom:.25rem !important}.py-md-2{padding-top:.5rem !important;padding-bottom:.5rem !important}.py-md-3{padding-top:1rem !important;padding-bottom:1rem !important}.py-md-4{padding-top:1.5rem !important;padding-bottom:1.5rem !important}.py-md-5{padding-top:3rem !important;padding-bottom:3rem !important}.pt-md-0{padding-top:0 !important}.pt-md-1{padding-top:.25rem !important}.pt-md-2{padding-top:.5rem !important}.pt-md-3{padding-top:1rem !important}.pt-md-4{padding-top:1.5rem !important}.pt-md-5{padding-top:3rem !important}.pe-md-0{padding-right:0 !important}.pe-md-1{padding-right:.25rem !important}.pe-md-2{padding-right:.5rem !important}.pe-md-3{padding-right:1rem !important}.pe-md-4{padding-right:1.5rem !important}.pe-md-5{padding-right:3rem !important}.pb-md-0{padding-bottom:0 !important}.pb-md-1{padding-bottom:.25rem !important}.pb-md-2{padding-bottom:.5rem !important}.pb-md-3{padding-bottom:1rem !important}.pb-md-4{padding-bottom:1.5rem !important}.pb-md-5{padding-bottom:3rem !important}.ps-md-0{padding-left:0 !important}.ps-md-1{padding-left:.25rem !important}.ps-md-2{padding-left:.5rem !important}.ps-md-3{padding-left:1rem !important}.ps-md-4{padding-left:1.5rem !important}.ps-md-5{padding-left:3rem !important}.gap-md-0{gap:0 !important}.gap-md-1{gap:.25rem !important}.gap-md-2{gap:.5rem !important}.gap-md-3{gap:1rem !important}.gap-md-4{gap:1.5rem !important}.gap-md-5{gap:3rem !important}.row-gap-md-0{row-gap:0 !important}.row-gap-md-1{row-gap:.25rem !important}.row-gap-md-2{row-gap:.5rem !important}.row-gap-md-3{row-gap:1rem !important}.row-gap-md-4{row-gap:1.5rem !important}.row-gap-md-5{row-gap:3rem !important}.column-gap-md-0{column-gap:0 !important}.column-gap-md-1{column-gap:.25rem !important}.column-gap-md-2{column-gap:.5rem !important}.column-gap-md-3{column-gap:1rem !important}.column-gap-md-4{column-gap:1.5rem !important}.column-gap-md-5{column-gap:3rem !important}.text-md-start{text-align:left !important}.text-md-end{text-align:right !important}.text-md-center{text-align:center !important}}@media(min-width: 992px){.float-lg-start{float:left !important}.float-lg-end{float:right !important}.float-lg-none{float:none !important}.object-fit-lg-contain{object-fit:contain !important}.object-fit-lg-cover{object-fit:cover !important}.object-fit-lg-fill{object-fit:fill !important}.object-fit-lg-scale{object-fit:scale-down !important}.object-fit-lg-none{object-fit:none !important}.d-lg-inline{display:inline !important}.d-lg-inline-block{display:inline-block !important}.d-lg-block{display:block !important}.d-lg-grid{display:grid !important}.d-lg-inline-grid{display:inline-grid !important}.d-lg-table{display:table !important}.d-lg-table-row{display:table-row !important}.d-lg-table-cell{display:table-cell !important}.d-lg-flex{display:flex !important}.d-lg-inline-flex{display:inline-flex !important}.d-lg-none{display:none !important}.flex-lg-fill{flex:1 1 auto !important}.flex-lg-row{flex-direction:row !important}.flex-lg-column{flex-direction:column !important}.flex-lg-row-reverse{flex-direction:row-reverse !important}.flex-lg-column-reverse{flex-direction:column-reverse !important}.flex-lg-grow-0{flex-grow:0 !important}.flex-lg-grow-1{flex-grow:1 !important}.flex-lg-shrink-0{flex-shrink:0 !important}.flex-lg-shrink-1{flex-shrink:1 !important}.flex-lg-wrap{flex-wrap:wrap !important}.flex-lg-nowrap{flex-wrap:nowrap !important}.flex-lg-wrap-reverse{flex-wrap:wrap-reverse !important}.justify-content-lg-start{justify-content:flex-start !important}.justify-content-lg-end{justify-content:flex-end !important}.justify-content-lg-center{justify-content:center !important}.justify-content-lg-between{justify-content:space-between !important}.justify-content-lg-around{justify-content:space-around !important}.justify-content-lg-evenly{justify-content:space-evenly !important}.align-items-lg-start{align-items:flex-start !important}.align-items-lg-end{align-items:flex-end !important}.align-items-lg-center{align-items:center !important}.align-items-lg-baseline{align-items:baseline !important}.align-items-lg-stretch{align-items:stretch !important}.align-content-lg-start{align-content:flex-start !important}.align-content-lg-end{align-content:flex-end !important}.align-content-lg-center{align-content:center !important}.align-content-lg-between{align-content:space-between !important}.align-content-lg-around{align-content:space-around !important}.align-content-lg-stretch{align-content:stretch !important}.align-self-lg-auto{align-self:auto !important}.align-self-lg-start{align-self:flex-start !important}.align-self-lg-end{align-self:flex-end !important}.align-self-lg-center{align-self:center !important}.align-self-lg-baseline{align-self:baseline !important}.align-self-lg-stretch{align-self:stretch !important}.order-lg-first{order:-1 !important}.order-lg-0{order:0 !important}.order-lg-1{order:1 !important}.order-lg-2{order:2 !important}.order-lg-3{order:3 !important}.order-lg-4{order:4 !important}.order-lg-5{order:5 !important}.order-lg-last{order:6 !important}.m-lg-0{margin:0 !important}.m-lg-1{margin:.25rem !important}.m-lg-2{margin:.5rem !important}.m-lg-3{margin:1rem !important}.m-lg-4{margin:1.5rem !important}.m-lg-5{margin:3rem !important}.m-lg-auto{margin:auto !important}.mx-lg-0{margin-right:0 !important;margin-left:0 !important}.mx-lg-1{margin-right:.25rem !important;margin-left:.25rem !important}.mx-lg-2{margin-right:.5rem !important;margin-left:.5rem !important}.mx-lg-3{margin-right:1rem !important;margin-left:1rem !important}.mx-lg-4{margin-right:1.5rem !important;margin-left:1.5rem !important}.mx-lg-5{margin-right:3rem !important;margin-left:3rem !important}.mx-lg-auto{margin-right:auto !important;margin-left:auto !important}.my-lg-0{margin-top:0 !important;margin-bottom:0 !important}.my-lg-1{margin-top:.25rem !important;margin-bottom:.25rem !important}.my-lg-2{margin-top:.5rem !important;margin-bottom:.5rem !important}.my-lg-3{margin-top:1rem !important;margin-bottom:1rem !important}.my-lg-4{margin-top:1.5rem !important;margin-bottom:1.5rem !important}.my-lg-5{margin-top:3rem !important;margin-bottom:3rem !important}.my-lg-auto{margin-top:auto !important;margin-bottom:auto !important}.mt-lg-0{margin-top:0 !important}.mt-lg-1{margin-top:.25rem !important}.mt-lg-2{margin-top:.5rem !important}.mt-lg-3{margin-top:1rem !important}.mt-lg-4{margin-top:1.5rem !important}.mt-lg-5{margin-top:3rem !important}.mt-lg-auto{margin-top:auto !important}.me-lg-0{margin-right:0 !important}.me-lg-1{margin-right:.25rem !important}.me-lg-2{margin-right:.5rem !important}.me-lg-3{margin-right:1rem !important}.me-lg-4{margin-right:1.5rem !important}.me-lg-5{margin-right:3rem !important}.me-lg-auto{margin-right:auto !important}.mb-lg-0{margin-bottom:0 !important}.mb-lg-1{margin-bottom:.25rem !important}.mb-lg-2{margin-bottom:.5rem !important}.mb-lg-3{margin-bottom:1rem !important}.mb-lg-4{margin-bottom:1.5rem !important}.mb-lg-5{margin-bottom:3rem !important}.mb-lg-auto{margin-bottom:auto !important}.ms-lg-0{margin-left:0 !important}.ms-lg-1{margin-left:.25rem !important}.ms-lg-2{margin-left:.5rem !important}.ms-lg-3{margin-left:1rem !important}.ms-lg-4{margin-left:1.5rem !important}.ms-lg-5{margin-left:3rem !important}.ms-lg-auto{margin-left:auto !important}.p-lg-0{padding:0 !important}.p-lg-1{padding:.25rem !important}.p-lg-2{padding:.5rem !important}.p-lg-3{padding:1rem !important}.p-lg-4{padding:1.5rem !important}.p-lg-5{padding:3rem !important}.px-lg-0{padding-right:0 !important;padding-left:0 !important}.px-lg-1{padding-right:.25rem !important;padding-left:.25rem !important}.px-lg-2{padding-right:.5rem !important;padding-left:.5rem !important}.px-lg-3{padding-right:1rem !important;padding-left:1rem !important}.px-lg-4{padding-right:1.5rem !important;padding-left:1.5rem !important}.px-lg-5{padding-right:3rem !important;padding-left:3rem !important}.py-lg-0{padding-top:0 !important;padding-bottom:0 !important}.py-lg-1{padding-top:.25rem !important;padding-bottom:.25rem !important}.py-lg-2{padding-top:.5rem !important;padding-bottom:.5rem !important}.py-lg-3{padding-top:1rem !important;padding-bottom:1rem !important}.py-lg-4{padding-top:1.5rem !important;padding-bottom:1.5rem !important}.py-lg-5{padding-top:3rem !important;padding-bottom:3rem !important}.pt-lg-0{padding-top:0 !important}.pt-lg-1{padding-top:.25rem !important}.pt-lg-2{padding-top:.5rem !important}.pt-lg-3{padding-top:1rem !important}.pt-lg-4{padding-top:1.5rem !important}.pt-lg-5{padding-top:3rem !important}.pe-lg-0{padding-right:0 !important}.pe-lg-1{padding-right:.25rem !important}.pe-lg-2{padding-right:.5rem !important}.pe-lg-3{padding-right:1rem !important}.pe-lg-4{padding-right:1.5rem !important}.pe-lg-5{padding-right:3rem !important}.pb-lg-0{padding-bottom:0 !important}.pb-lg-1{padding-bottom:.25rem !important}.pb-lg-2{padding-bottom:.5rem !important}.pb-lg-3{padding-bottom:1rem !important}.pb-lg-4{padding-bottom:1.5rem !important}.pb-lg-5{padding-bottom:3rem !important}.ps-lg-0{padding-left:0 !important}.ps-lg-1{padding-left:.25rem !important}.ps-lg-2{padding-left:.5rem !important}.ps-lg-3{padding-left:1rem !important}.ps-lg-4{padding-left:1.5rem !important}.ps-lg-5{padding-left:3rem !important}.gap-lg-0{gap:0 !important}.gap-lg-1{gap:.25rem !important}.gap-lg-2{gap:.5rem !important}.gap-lg-3{gap:1rem !important}.gap-lg-4{gap:1.5rem !important}.gap-lg-5{gap:3rem !important}.row-gap-lg-0{row-gap:0 !important}.row-gap-lg-1{row-gap:.25rem !important}.row-gap-lg-2{row-gap:.5rem !important}.row-gap-lg-3{row-gap:1rem !important}.row-gap-lg-4{row-gap:1.5rem !important}.row-gap-lg-5{row-gap:3rem !important}.column-gap-lg-0{column-gap:0 !important}.column-gap-lg-1{column-gap:.25rem !important}.column-gap-lg-2{column-gap:.5rem !important}.column-gap-lg-3{column-gap:1rem !important}.column-gap-lg-4{column-gap:1.5rem !important}.column-gap-lg-5{column-gap:3rem !important}.text-lg-start{text-align:left !important}.text-lg-end{text-align:right !important}.text-lg-center{text-align:center !important}}@media(min-width: 1200px){.float-xl-start{float:left !important}.float-xl-end{float:right !important}.float-xl-none{float:none !important}.object-fit-xl-contain{object-fit:contain !important}.object-fit-xl-cover{object-fit:cover !important}.object-fit-xl-fill{object-fit:fill !important}.object-fit-xl-scale{object-fit:scale-down !important}.object-fit-xl-none{object-fit:none !important}.d-xl-inline{display:inline !important}.d-xl-inline-block{display:inline-block !important}.d-xl-block{display:block !important}.d-xl-grid{display:grid !important}.d-xl-inline-grid{display:inline-grid !important}.d-xl-table{display:table !important}.d-xl-table-row{display:table-row !important}.d-xl-table-cell{display:table-cell !important}.d-xl-flex{display:flex !important}.d-xl-inline-flex{display:inline-flex !important}.d-xl-none{display:none !important}.flex-xl-fill{flex:1 1 auto !important}.flex-xl-row{flex-direction:row !important}.flex-xl-column{flex-direction:column !important}.flex-xl-row-reverse{flex-direction:row-reverse !important}.flex-xl-column-reverse{flex-direction:column-reverse !important}.flex-xl-grow-0{flex-grow:0 !important}.flex-xl-grow-1{flex-grow:1 !important}.flex-xl-shrink-0{flex-shrink:0 !important}.flex-xl-shrink-1{flex-shrink:1 !important}.flex-xl-wrap{flex-wrap:wrap !important}.flex-xl-nowrap{flex-wrap:nowrap !important}.flex-xl-wrap-reverse{flex-wrap:wrap-reverse !important}.justify-content-xl-start{justify-content:flex-start !important}.justify-content-xl-end{justify-content:flex-end !important}.justify-content-xl-center{justify-content:center !important}.justify-content-xl-between{justify-content:space-between !important}.justify-content-xl-around{justify-content:space-around !important}.justify-content-xl-evenly{justify-content:space-evenly !important}.align-items-xl-start{align-items:flex-start !important}.align-items-xl-end{align-items:flex-end !important}.align-items-xl-center{align-items:center !important}.align-items-xl-baseline{align-items:baseline !important}.align-items-xl-stretch{align-items:stretch !important}.align-content-xl-start{align-content:flex-start !important}.align-content-xl-end{align-content:flex-end !important}.align-content-xl-center{align-content:center !important}.align-content-xl-between{align-content:space-between !important}.align-content-xl-around{align-content:space-around !important}.align-content-xl-stretch{align-content:stretch !important}.align-self-xl-auto{align-self:auto !important}.align-self-xl-start{align-self:flex-start !important}.align-self-xl-end{align-self:flex-end !important}.align-self-xl-center{align-self:center !important}.align-self-xl-baseline{align-self:baseline !important}.align-self-xl-stretch{align-self:stretch !important}.order-xl-first{order:-1 !important}.order-xl-0{order:0 !important}.order-xl-1{order:1 !important}.order-xl-2{order:2 !important}.order-xl-3{order:3 !important}.order-xl-4{order:4 !important}.order-xl-5{order:5 !important}.order-xl-last{order:6 !important}.m-xl-0{margin:0 !important}.m-xl-1{margin:.25rem !important}.m-xl-2{margin:.5rem !important}.m-xl-3{margin:1rem !important}.m-xl-4{margin:1.5rem !important}.m-xl-5{margin:3rem !important}.m-xl-auto{margin:auto !important}.mx-xl-0{margin-right:0 !important;margin-left:0 !important}.mx-xl-1{margin-right:.25rem !important;margin-left:.25rem !important}.mx-xl-2{margin-right:.5rem !important;margin-left:.5rem !important}.mx-xl-3{margin-right:1rem !important;margin-left:1rem !important}.mx-xl-4{margin-right:1.5rem !important;margin-left:1.5rem !important}.mx-xl-5{margin-right:3rem !important;margin-left:3rem !important}.mx-xl-auto{margin-right:auto !important;margin-left:auto !important}.my-xl-0{margin-top:0 !important;margin-bottom:0 !important}.my-xl-1{margin-top:.25rem !important;margin-bottom:.25rem !important}.my-xl-2{margin-top:.5rem !important;margin-bottom:.5rem !important}.my-xl-3{margin-top:1rem !important;margin-bottom:1rem !important}.my-xl-4{margin-top:1.5rem !important;margin-bottom:1.5rem !important}.my-xl-5{margin-top:3rem !important;margin-bottom:3rem !important}.my-xl-auto{margin-top:auto !important;margin-bottom:auto !important}.mt-xl-0{margin-top:0 !important}.mt-xl-1{margin-top:.25rem !important}.mt-xl-2{margin-top:.5rem !important}.mt-xl-3{margin-top:1rem !important}.mt-xl-4{margin-top:1.5rem !important}.mt-xl-5{margin-top:3rem !important}.mt-xl-auto{margin-top:auto !important}.me-xl-0{margin-right:0 !important}.me-xl-1{margin-right:.25rem !important}.me-xl-2{margin-right:.5rem !important}.me-xl-3{margin-right:1rem !important}.me-xl-4{margin-right:1.5rem !important}.me-xl-5{margin-right:3rem !important}.me-xl-auto{margin-right:auto !important}.mb-xl-0{margin-bottom:0 !important}.mb-xl-1{margin-bottom:.25rem !important}.mb-xl-2{margin-bottom:.5rem !important}.mb-xl-3{margin-bottom:1rem !important}.mb-xl-4{margin-bottom:1.5rem !important}.mb-xl-5{margin-bottom:3rem !important}.mb-xl-auto{margin-bottom:auto !important}.ms-xl-0{margin-left:0 !important}.ms-xl-1{margin-left:.25rem !important}.ms-xl-2{margin-left:.5rem !important}.ms-xl-3{margin-left:1rem !important}.ms-xl-4{margin-left:1.5rem !important}.ms-xl-5{margin-left:3rem !important}.ms-xl-auto{margin-left:auto !important}.p-xl-0{padding:0 !important}.p-xl-1{padding:.25rem !important}.p-xl-2{padding:.5rem !important}.p-xl-3{padding:1rem !important}.p-xl-4{padding:1.5rem !important}.p-xl-5{padding:3rem !important}.px-xl-0{padding-right:0 !important;padding-left:0 !important}.px-xl-1{padding-right:.25rem !important;padding-left:.25rem !important}.px-xl-2{padding-right:.5rem !important;padding-left:.5rem !important}.px-xl-3{padding-right:1rem !important;padding-left:1rem !important}.px-xl-4{padding-right:1.5rem !important;padding-left:1.5rem !important}.px-xl-5{padding-right:3rem !important;padding-left:3rem !important}.py-xl-0{padding-top:0 !important;padding-bottom:0 !important}.py-xl-1{padding-top:.25rem !important;padding-bottom:.25rem !important}.py-xl-2{padding-top:.5rem !important;padding-bottom:.5rem !important}.py-xl-3{padding-top:1rem !important;padding-bottom:1rem !important}.py-xl-4{padding-top:1.5rem !important;padding-bottom:1.5rem !important}.py-xl-5{padding-top:3rem !important;padding-bottom:3rem !important}.pt-xl-0{padding-top:0 !important}.pt-xl-1{padding-top:.25rem !important}.pt-xl-2{padding-top:.5rem !important}.pt-xl-3{padding-top:1rem !important}.pt-xl-4{padding-top:1.5rem !important}.pt-xl-5{padding-top:3rem !important}.pe-xl-0{padding-right:0 !important}.pe-xl-1{padding-right:.25rem !important}.pe-xl-2{padding-right:.5rem !important}.pe-xl-3{padding-right:1rem !important}.pe-xl-4{padding-right:1.5rem !important}.pe-xl-5{padding-right:3rem !important}.pb-xl-0{padding-bottom:0 !important}.pb-xl-1{padding-bottom:.25rem !important}.pb-xl-2{padding-bottom:.5rem !important}.pb-xl-3{padding-bottom:1rem !important}.pb-xl-4{padding-bottom:1.5rem !important}.pb-xl-5{padding-bottom:3rem !important}.ps-xl-0{padding-left:0 !important}.ps-xl-1{padding-left:.25rem !important}.ps-xl-2{padding-left:.5rem !important}.ps-xl-3{padding-left:1rem !important}.ps-xl-4{padding-left:1.5rem !important}.ps-xl-5{padding-left:3rem !important}.gap-xl-0{gap:0 !important}.gap-xl-1{gap:.25rem !important}.gap-xl-2{gap:.5rem !important}.gap-xl-3{gap:1rem !important}.gap-xl-4{gap:1.5rem !important}.gap-xl-5{gap:3rem !important}.row-gap-xl-0{row-gap:0 !important}.row-gap-xl-1{row-gap:.25rem !important}.row-gap-xl-2{row-gap:.5rem !important}.row-gap-xl-3{row-gap:1rem !important}.row-gap-xl-4{row-gap:1.5rem !important}.row-gap-xl-5{row-gap:3rem !important}.column-gap-xl-0{column-gap:0 !important}.column-gap-xl-1{column-gap:.25rem !important}.column-gap-xl-2{column-gap:.5rem !important}.column-gap-xl-3{column-gap:1rem !important}.column-gap-xl-4{column-gap:1.5rem !important}.column-gap-xl-5{column-gap:3rem !important}.text-xl-start{text-align:left !important}.text-xl-end{text-align:right !important}.text-xl-center{text-align:center !important}}@media(min-width: 1400px){.float-xxl-start{float:left !important}.float-xxl-end{float:right !important}.float-xxl-none{float:none !important}.object-fit-xxl-contain{object-fit:contain !important}.object-fit-xxl-cover{object-fit:cover !important}.object-fit-xxl-fill{object-fit:fill !important}.object-fit-xxl-scale{object-fit:scale-down !important}.object-fit-xxl-none{object-fit:none !important}.d-xxl-inline{display:inline !important}.d-xxl-inline-block{display:inline-block !important}.d-xxl-block{display:block !important}.d-xxl-grid{display:grid !important}.d-xxl-inline-grid{display:inline-grid !important}.d-xxl-table{display:table !important}.d-xxl-table-row{display:table-row !important}.d-xxl-table-cell{display:table-cell !important}.d-xxl-flex{display:flex !important}.d-xxl-inline-flex{display:inline-flex !important}.d-xxl-none{display:none !important}.flex-xxl-fill{flex:1 1 auto !important}.flex-xxl-row{flex-direction:row !important}.flex-xxl-column{flex-direction:column !important}.flex-xxl-row-reverse{flex-direction:row-reverse !important}.flex-xxl-column-reverse{flex-direction:column-reverse !important}.flex-xxl-grow-0{flex-grow:0 !important}.flex-xxl-grow-1{flex-grow:1 !important}.flex-xxl-shrink-0{flex-shrink:0 !important}.flex-xxl-shrink-1{flex-shrink:1 !important}.flex-xxl-wrap{flex-wrap:wrap !important}.flex-xxl-nowrap{flex-wrap:nowrap !important}.flex-xxl-wrap-reverse{flex-wrap:wrap-reverse !important}.justify-content-xxl-start{justify-content:flex-start !important}.justify-content-xxl-end{justify-content:flex-end !important}.justify-content-xxl-center{justify-content:center !important}.justify-content-xxl-between{justify-content:space-between !important}.justify-content-xxl-around{justify-content:space-around !important}.justify-content-xxl-evenly{justify-content:space-evenly !important}.align-items-xxl-start{align-items:flex-start !important}.align-items-xxl-end{align-items:flex-end !important}.align-items-xxl-center{align-items:center !important}.align-items-xxl-baseline{align-items:baseline !important}.align-items-xxl-stretch{align-items:stretch !important}.align-content-xxl-start{align-content:flex-start !important}.align-content-xxl-end{align-content:flex-end !important}.align-content-xxl-center{align-content:center !important}.align-content-xxl-between{align-content:space-between !important}.align-content-xxl-around{align-content:space-around !important}.align-content-xxl-stretch{align-content:stretch !important}.align-self-xxl-auto{align-self:auto !important}.align-self-xxl-start{align-self:flex-start !important}.align-self-xxl-end{align-self:flex-end !important}.align-self-xxl-center{align-self:center !important}.align-self-xxl-baseline{align-self:baseline !important}.align-self-xxl-stretch{align-self:stretch !important}.order-xxl-first{order:-1 !important}.order-xxl-0{order:0 !important}.order-xxl-1{order:1 !important}.order-xxl-2{order:2 !important}.order-xxl-3{order:3 !important}.order-xxl-4{order:4 !important}.order-xxl-5{order:5 !important}.order-xxl-last{order:6 !important}.m-xxl-0{margin:0 !important}.m-xxl-1{margin:.25rem !important}.m-xxl-2{margin:.5rem !important}.m-xxl-3{margin:1rem !important}.m-xxl-4{margin:1.5rem !important}.m-xxl-5{margin:3rem !important}.m-xxl-auto{margin:auto !important}.mx-xxl-0{margin-right:0 !important;margin-left:0 !important}.mx-xxl-1{margin-right:.25rem !important;margin-left:.25rem !important}.mx-xxl-2{margin-right:.5rem !important;margin-left:.5rem !important}.mx-xxl-3{margin-right:1rem !important;margin-left:1rem !important}.mx-xxl-4{margin-right:1.5rem !important;margin-left:1.5rem !important}.mx-xxl-5{margin-right:3rem !important;margin-left:3rem !important}.mx-xxl-auto{margin-right:auto !important;margin-left:auto !important}.my-xxl-0{margin-top:0 !important;margin-bottom:0 !important}.my-xxl-1{margin-top:.25rem !important;margin-bottom:.25rem !important}.my-xxl-2{margin-top:.5rem !important;margin-bottom:.5rem !important}.my-xxl-3{margin-top:1rem !important;margin-bottom:1rem !important}.my-xxl-4{margin-top:1.5rem !important;margin-bottom:1.5rem !important}.my-xxl-5{margin-top:3rem !important;margin-bottom:3rem !important}.my-xxl-auto{margin-top:auto !important;margin-bottom:auto !important}.mt-xxl-0{margin-top:0 !important}.mt-xxl-1{margin-top:.25rem !important}.mt-xxl-2{margin-top:.5rem !important}.mt-xxl-3{margin-top:1rem !important}.mt-xxl-4{margin-top:1.5rem !important}.mt-xxl-5{margin-top:3rem !important}.mt-xxl-auto{margin-top:auto !important}.me-xxl-0{margin-right:0 !important}.me-xxl-1{margin-right:.25rem !important}.me-xxl-2{margin-right:.5rem !important}.me-xxl-3{margin-right:1rem !important}.me-xxl-4{margin-right:1.5rem !important}.me-xxl-5{margin-right:3rem !important}.me-xxl-auto{margin-right:auto !important}.mb-xxl-0{margin-bottom:0 !important}.mb-xxl-1{margin-bottom:.25rem !important}.mb-xxl-2{margin-bottom:.5rem !important}.mb-xxl-3{margin-bottom:1rem !important}.mb-xxl-4{margin-bottom:1.5rem !important}.mb-xxl-5{margin-bottom:3rem !important}.mb-xxl-auto{margin-bottom:auto !important}.ms-xxl-0{margin-left:0 !important}.ms-xxl-1{margin-left:.25rem !important}.ms-xxl-2{margin-left:.5rem !important}.ms-xxl-3{margin-left:1rem !important}.ms-xxl-4{margin-left:1.5rem !important}.ms-xxl-5{margin-left:3rem !important}.ms-xxl-auto{margin-left:auto !important}.p-xxl-0{padding:0 !important}.p-xxl-1{padding:.25rem !important}.p-xxl-2{padding:.5rem !important}.p-xxl-3{padding:1rem !important}.p-xxl-4{padding:1.5rem !important}.p-xxl-5{padding:3rem !important}.px-xxl-0{padding-right:0 !important;padding-left:0 !important}.px-xxl-1{padding-right:.25rem !important;padding-left:.25rem !important}.px-xxl-2{padding-right:.5rem !important;padding-left:.5rem !important}.px-xxl-3{padding-right:1rem !important;padding-left:1rem !important}.px-xxl-4{padding-right:1.5rem !important;padding-left:1.5rem !important}.px-xxl-5{padding-right:3rem !important;padding-left:3rem !important}.py-xxl-0{padding-top:0 !important;padding-bottom:0 !important}.py-xxl-1{padding-top:.25rem !important;padding-bottom:.25rem !important}.py-xxl-2{padding-top:.5rem !important;padding-bottom:.5rem !important}.py-xxl-3{padding-top:1rem !important;padding-bottom:1rem !important}.py-xxl-4{padding-top:1.5rem !important;padding-bottom:1.5rem !important}.py-xxl-5{padding-top:3rem !important;padding-bottom:3rem !important}.pt-xxl-0{padding-top:0 !important}.pt-xxl-1{padding-top:.25rem !important}.pt-xxl-2{padding-top:.5rem !important}.pt-xxl-3{padding-top:1rem !important}.pt-xxl-4{padding-top:1.5rem !important}.pt-xxl-5{padding-top:3rem !important}.pe-xxl-0{padding-right:0 !important}.pe-xxl-1{padding-right:.25rem !important}.pe-xxl-2{padding-right:.5rem !important}.pe-xxl-3{padding-right:1rem !important}.pe-xxl-4{padding-right:1.5rem !important}.pe-xxl-5{padding-right:3rem !important}.pb-xxl-0{padding-bottom:0 !important}.pb-xxl-1{padding-bottom:.25rem !important}.pb-xxl-2{padding-bottom:.5rem !important}.pb-xxl-3{padding-bottom:1rem !important}.pb-xxl-4{padding-bottom:1.5rem !important}.pb-xxl-5{padding-bottom:3rem !important}.ps-xxl-0{padding-left:0 !important}.ps-xxl-1{padding-left:.25rem !important}.ps-xxl-2{padding-left:.5rem !important}.ps-xxl-3{padding-left:1rem !important}.ps-xxl-4{padding-left:1.5rem !important}.ps-xxl-5{padding-left:3rem !important}.gap-xxl-0{gap:0 !important}.gap-xxl-1{gap:.25rem !important}.gap-xxl-2{gap:.5rem !important}.gap-xxl-3{gap:1rem !important}.gap-xxl-4{gap:1.5rem !important}.gap-xxl-5{gap:3rem !important}.row-gap-xxl-0{row-gap:0 !important}.row-gap-xxl-1{row-gap:.25rem !important}.row-gap-xxl-2{row-gap:.5rem !important}.row-gap-xxl-3{row-gap:1rem !important}.row-gap-xxl-4{row-gap:1.5rem !important}.row-gap-xxl-5{row-gap:3rem !important}.column-gap-xxl-0{column-gap:0 !important}.column-gap-xxl-1{column-gap:.25rem !important}.column-gap-xxl-2{column-gap:.5rem !important}.column-gap-xxl-3{column-gap:1rem !important}.column-gap-xxl-4{column-gap:1.5rem !important}.column-gap-xxl-5{column-gap:3rem !important}.text-xxl-start{text-align:left !important}.text-xxl-end{text-align:right !important}.text-xxl-center{text-align:center !important}}.bg-default{color:#000}.bg-primary{color:#fff}.bg-secondary{color:#fff}.bg-success{color:#fff}.bg-info{color:#000}.bg-warning{color:#000}.bg-danger{color:#fff}.bg-light{color:#000}.bg-dark{color:#fff}@media(min-width: 1200px){.fs-1{font-size:2rem !important}.fs-2{font-size:1.65rem !important}.fs-3{font-size:1.45rem !important}}@media print{.d-print-inline{display:inline !important}.d-print-inline-block{display:inline-block !important}.d-print-block{display:block !important}.d-print-grid{display:grid !important}.d-print-inline-grid{display:inline-grid !important}.d-print-table{display:table !important}.d-print-table-row{display:table-row !important}.d-print-table-cell{display:table-cell !important}.d-print-flex{display:flex !important}.d-print-inline-flex{display:inline-flex !important}.d-print-none{display:none !important}}:root{--bslib-spacer: 1rem;--bslib-mb-spacer: var(--bslib-spacer, 1rem)}.bslib-mb-spacing{margin-bottom:var(--bslib-mb-spacer)}.bslib-gap-spacing{gap:var(--bslib-mb-spacer)}.bslib-gap-spacing>.bslib-mb-spacing,.bslib-gap-spacing>.form-group,.bslib-gap-spacing>p,.bslib-gap-spacing>pre{margin-bottom:0}.html-fill-container>.html-fill-item.bslib-mb-spacing{margin-bottom:0}.tab-content>.tab-pane.html-fill-container{display:none}.tab-content>.active.html-fill-container{display:flex}.tab-content.html-fill-container{padding:0}.bg-blue{--bslib-color-bg: #0d6efd;--bslib-color-fg: #ffffff;background-color:var(--bslib-color-bg);color:var(--bslib-color-fg)}.text-blue{--bslib-color-fg: #0d6efd;color:var(--bslib-color-fg)}.bg-indigo{--bslib-color-bg: #6610f2;--bslib-color-fg: #ffffff;background-color:var(--bslib-color-bg);color:var(--bslib-color-fg)}.text-indigo{--bslib-color-fg: #6610f2;color:var(--bslib-color-fg)}.bg-purple{--bslib-color-bg: #6f42c1;--bslib-color-fg: #ffffff;background-color:var(--bslib-color-bg);color:var(--bslib-color-fg)}.text-purple{--bslib-color-fg: #6f42c1;color:var(--bslib-color-fg)}.bg-pink{--bslib-color-bg: #d63384;--bslib-color-fg: #ffffff;background-color:var(--bslib-color-bg);color:var(--bslib-color-fg)}.text-pink{--bslib-color-fg: #d63384;color:var(--bslib-color-fg)}.bg-red{--bslib-color-bg: #dc3545;--bslib-color-fg: #ffffff;background-color:var(--bslib-color-bg);color:var(--bslib-color-fg)}.text-red{--bslib-color-fg: #dc3545;color:var(--bslib-color-fg)}.bg-orange{--bslib-color-bg: #fd7e14;--bslib-color-fg: #000;background-color:var(--bslib-color-bg);color:var(--bslib-color-fg)}.text-orange{--bslib-color-fg: #fd7e14;color:var(--bslib-color-fg)}.bg-yellow{--bslib-color-bg: #ffc107;--bslib-color-fg: #000;background-color:var(--bslib-color-bg);color:var(--bslib-color-fg)}.text-yellow{--bslib-color-fg: #ffc107;color:var(--bslib-color-fg)}.bg-green{--bslib-color-bg: #198754;--bslib-color-fg: #ffffff;background-color:var(--bslib-color-bg);color:var(--bslib-color-fg)}.text-green{--bslib-color-fg: #198754;color:var(--bslib-color-fg)}.bg-teal{--bslib-color-bg: #20c997;--bslib-color-fg: #000;background-color:var(--bslib-color-bg);color:var(--bslib-color-fg)}.text-teal{--bslib-color-fg: #20c997;color:var(--bslib-color-fg)}.bg-cyan{--bslib-color-bg: #0dcaf0;--bslib-color-fg: #000;background-color:var(--bslib-color-bg);color:var(--bslib-color-fg)}.text-cyan{--bslib-color-fg: #0dcaf0;color:var(--bslib-color-fg)}.text-default{--bslib-color-fg: #dee2e6}.bg-default{--bslib-color-bg: #dee2e6;--bslib-color-fg: #000}.text-primary{--bslib-color-fg: #0d6efd}.bg-primary{--bslib-color-bg: #0d6efd;--bslib-color-fg: #ffffff}.text-secondary{--bslib-color-fg: #6c757d}.bg-secondary{--bslib-color-bg: #6c757d;--bslib-color-fg: #ffffff}.text-success{--bslib-color-fg: #198754}.bg-success{--bslib-color-bg: #198754;--bslib-color-fg: #ffffff}.text-info{--bslib-color-fg: #0dcaf0}.bg-info{--bslib-color-bg: #0dcaf0;--bslib-color-fg: #000}.text-warning{--bslib-color-fg: #ffc107}.bg-warning{--bslib-color-bg: #ffc107;--bslib-color-fg: #000}.text-danger{--bslib-color-fg: #dc3545}.bg-danger{--bslib-color-bg: #dc3545;--bslib-color-fg: #ffffff}.text-light{--bslib-color-fg: #f8f9fa}.bg-light{--bslib-color-bg: #f8f9fa;--bslib-color-fg: #000}.text-dark{--bslib-color-fg: #212529}.bg-dark{--bslib-color-bg: #212529;--bslib-color-fg: #ffffff}.bg-gradient-blue-indigo{--bslib-color-fg: #ffffff;--bslib-color-bg: #3148f9;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0d6efd var(--bg-gradient-start, 36%), #6610f2 var(--bg-gradient-end, 180%)) #3148f9;color:#fff}.bg-gradient-blue-purple{--bslib-color-fg: #ffffff;--bslib-color-bg: #345ce5;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0d6efd var(--bg-gradient-start, 36%), #6f42c1 var(--bg-gradient-end, 180%)) #345ce5;color:#fff}.bg-gradient-blue-pink{--bslib-color-fg: #ffffff;--bslib-color-bg: #5d56cd;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0d6efd var(--bg-gradient-start, 36%), #d63384 var(--bg-gradient-end, 180%)) #5d56cd;color:#fff}.bg-gradient-blue-red{--bslib-color-fg: #ffffff;--bslib-color-bg: #6057b3;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0d6efd var(--bg-gradient-start, 36%), #dc3545 var(--bg-gradient-end, 180%)) #6057b3;color:#fff}.bg-gradient-blue-orange{--bslib-color-fg: #ffffff;--bslib-color-bg: #6d74a0;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0d6efd var(--bg-gradient-start, 36%), #fd7e14 var(--bg-gradient-end, 180%)) #6d74a0;color:#fff}.bg-gradient-blue-yellow{--bslib-color-fg: #000;--bslib-color-bg: #6e8f9b;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0d6efd var(--bg-gradient-start, 36%), #ffc107 var(--bg-gradient-end, 180%)) #6e8f9b;color:#000}.bg-gradient-blue-green{--bslib-color-fg: #ffffff;--bslib-color-bg: #1278b9;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0d6efd var(--bg-gradient-start, 36%), #198754 var(--bg-gradient-end, 180%)) #1278b9;color:#fff}.bg-gradient-blue-teal{--bslib-color-fg: #000;--bslib-color-bg: #1592d4;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0d6efd var(--bg-gradient-start, 36%), #20c997 var(--bg-gradient-end, 180%)) #1592d4;color:#000}.bg-gradient-blue-cyan{--bslib-color-fg: #000;--bslib-color-bg: #0d93f8;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0d6efd var(--bg-gradient-start, 36%), #0dcaf0 var(--bg-gradient-end, 180%)) #0d93f8;color:#000}.bg-gradient-indigo-blue{--bslib-color-fg: #ffffff;--bslib-color-bg: #4236f6;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6610f2 var(--bg-gradient-start, 36%), #0d6efd var(--bg-gradient-end, 180%)) #4236f6;color:#fff}.bg-gradient-indigo-purple{--bslib-color-fg: #ffffff;--bslib-color-bg: #6a24de;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6610f2 var(--bg-gradient-start, 36%), #6f42c1 var(--bg-gradient-end, 180%)) #6a24de;color:#fff}.bg-gradient-indigo-pink{--bslib-color-fg: #ffffff;--bslib-color-bg: #931ec6;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6610f2 var(--bg-gradient-start, 36%), #d63384 var(--bg-gradient-end, 180%)) #931ec6;color:#fff}.bg-gradient-indigo-red{--bslib-color-fg: #ffffff;--bslib-color-bg: #951fad;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6610f2 var(--bg-gradient-start, 36%), #dc3545 var(--bg-gradient-end, 180%)) #951fad;color:#fff}.bg-gradient-indigo-orange{--bslib-color-fg: #ffffff;--bslib-color-bg: #a23c99;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6610f2 var(--bg-gradient-start, 36%), #fd7e14 var(--bg-gradient-end, 180%)) #a23c99;color:#fff}.bg-gradient-indigo-yellow{--bslib-color-fg: #ffffff;--bslib-color-bg: #a35794;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6610f2 var(--bg-gradient-start, 36%), #ffc107 var(--bg-gradient-end, 180%)) #a35794;color:#fff}.bg-gradient-indigo-green{--bslib-color-fg: #ffffff;--bslib-color-bg: #4740b3;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6610f2 var(--bg-gradient-start, 36%), #198754 var(--bg-gradient-end, 180%)) #4740b3;color:#fff}.bg-gradient-indigo-teal{--bslib-color-fg: #ffffff;--bslib-color-bg: #4a5ace;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6610f2 var(--bg-gradient-start, 36%), #20c997 var(--bg-gradient-end, 180%)) #4a5ace;color:#fff}.bg-gradient-indigo-cyan{--bslib-color-fg: #ffffff;--bslib-color-bg: #425af1;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6610f2 var(--bg-gradient-start, 36%), #0dcaf0 var(--bg-gradient-end, 180%)) #425af1;color:#fff}.bg-gradient-purple-blue{--bslib-color-fg: #ffffff;--bslib-color-bg: #4854d9;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6f42c1 var(--bg-gradient-start, 36%), #0d6efd var(--bg-gradient-end, 180%)) #4854d9;color:#fff}.bg-gradient-purple-indigo{--bslib-color-fg: #ffffff;--bslib-color-bg: #6b2ed5;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6f42c1 var(--bg-gradient-start, 36%), #6610f2 var(--bg-gradient-end, 180%)) #6b2ed5;color:#fff}.bg-gradient-purple-pink{--bslib-color-fg: #ffffff;--bslib-color-bg: #983ca9;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6f42c1 var(--bg-gradient-start, 36%), #d63384 var(--bg-gradient-end, 180%)) #983ca9;color:#fff}.bg-gradient-purple-red{--bslib-color-fg: #ffffff;--bslib-color-bg: #9b3d8f;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6f42c1 var(--bg-gradient-start, 36%), #dc3545 var(--bg-gradient-end, 180%)) #9b3d8f;color:#fff}.bg-gradient-purple-orange{--bslib-color-fg: #ffffff;--bslib-color-bg: #a85a7c;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6f42c1 var(--bg-gradient-start, 36%), #fd7e14 var(--bg-gradient-end, 180%)) #a85a7c;color:#fff}.bg-gradient-purple-yellow{--bslib-color-fg: #000;--bslib-color-bg: #a97577;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6f42c1 var(--bg-gradient-start, 36%), #ffc107 var(--bg-gradient-end, 180%)) #a97577;color:#000}.bg-gradient-purple-green{--bslib-color-fg: #ffffff;--bslib-color-bg: #4d5e95;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6f42c1 var(--bg-gradient-start, 36%), #198754 var(--bg-gradient-end, 180%)) #4d5e95;color:#fff}.bg-gradient-purple-teal{--bslib-color-fg: #ffffff;--bslib-color-bg: #4f78b0;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6f42c1 var(--bg-gradient-start, 36%), #20c997 var(--bg-gradient-end, 180%)) #4f78b0;color:#fff}.bg-gradient-purple-cyan{--bslib-color-fg: #000;--bslib-color-bg: #4878d4;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6f42c1 var(--bg-gradient-start, 36%), #0dcaf0 var(--bg-gradient-end, 180%)) #4878d4;color:#000}.bg-gradient-pink-blue{--bslib-color-fg: #ffffff;--bslib-color-bg: #864bb4;background:linear-gradient(var(--bg-gradient-deg, 140deg), #d63384 var(--bg-gradient-start, 36%), #0d6efd var(--bg-gradient-end, 180%)) #864bb4;color:#fff}.bg-gradient-pink-indigo{--bslib-color-fg: #ffffff;--bslib-color-bg: #a925b0;background:linear-gradient(var(--bg-gradient-deg, 140deg), #d63384 var(--bg-gradient-start, 36%), #6610f2 var(--bg-gradient-end, 180%)) #a925b0;color:#fff}.bg-gradient-pink-purple{--bslib-color-fg: #ffffff;--bslib-color-bg: #ad399c;background:linear-gradient(var(--bg-gradient-deg, 140deg), #d63384 var(--bg-gradient-start, 36%), #6f42c1 var(--bg-gradient-end, 180%)) #ad399c;color:#fff}.bg-gradient-pink-red{--bslib-color-fg: #ffffff;--bslib-color-bg: #d8346b;background:linear-gradient(var(--bg-gradient-deg, 140deg), #d63384 var(--bg-gradient-start, 36%), #dc3545 var(--bg-gradient-end, 180%)) #d8346b;color:#fff}.bg-gradient-pink-orange{--bslib-color-fg: #000;--bslib-color-bg: #e65157;background:linear-gradient(var(--bg-gradient-deg, 140deg), #d63384 var(--bg-gradient-start, 36%), #fd7e14 var(--bg-gradient-end, 180%)) #e65157;color:#000}.bg-gradient-pink-yellow{--bslib-color-fg: #000;--bslib-color-bg: #e66c52;background:linear-gradient(var(--bg-gradient-deg, 140deg), #d63384 var(--bg-gradient-start, 36%), #ffc107 var(--bg-gradient-end, 180%)) #e66c52;color:#000}.bg-gradient-pink-green{--bslib-color-fg: #ffffff;--bslib-color-bg: #8a5571;background:linear-gradient(var(--bg-gradient-deg, 140deg), #d63384 var(--bg-gradient-start, 36%), #198754 var(--bg-gradient-end, 180%)) #8a5571;color:#fff}.bg-gradient-pink-teal{--bslib-color-fg: #000;--bslib-color-bg: #8d6f8c;background:linear-gradient(var(--bg-gradient-deg, 140deg), #d63384 var(--bg-gradient-start, 36%), #20c997 var(--bg-gradient-end, 180%)) #8d6f8c;color:#000}.bg-gradient-pink-cyan{--bslib-color-fg: #000;--bslib-color-bg: #866faf;background:linear-gradient(var(--bg-gradient-deg, 140deg), #d63384 var(--bg-gradient-start, 36%), #0dcaf0 var(--bg-gradient-end, 180%)) #866faf;color:#000}.bg-gradient-red-blue{--bslib-color-fg: #ffffff;--bslib-color-bg: #894c8f;background:linear-gradient(var(--bg-gradient-deg, 140deg), #dc3545 var(--bg-gradient-start, 36%), #0d6efd var(--bg-gradient-end, 180%)) #894c8f;color:#fff}.bg-gradient-red-indigo{--bslib-color-fg: #ffffff;--bslib-color-bg: #ad268a;background:linear-gradient(var(--bg-gradient-deg, 140deg), #dc3545 var(--bg-gradient-start, 36%), #6610f2 var(--bg-gradient-end, 180%)) #ad268a;color:#fff}.bg-gradient-red-purple{--bslib-color-fg: #ffffff;--bslib-color-bg: #b03a77;background:linear-gradient(var(--bg-gradient-deg, 140deg), #dc3545 var(--bg-gradient-start, 36%), #6f42c1 var(--bg-gradient-end, 180%)) #b03a77;color:#fff}.bg-gradient-red-pink{--bslib-color-fg: #ffffff;--bslib-color-bg: #da345e;background:linear-gradient(var(--bg-gradient-deg, 140deg), #dc3545 var(--bg-gradient-start, 36%), #d63384 var(--bg-gradient-end, 180%)) #da345e;color:#fff}.bg-gradient-red-orange{--bslib-color-fg: #000;--bslib-color-bg: #e95231;background:linear-gradient(var(--bg-gradient-deg, 140deg), #dc3545 var(--bg-gradient-start, 36%), #fd7e14 var(--bg-gradient-end, 180%)) #e95231;color:#000}.bg-gradient-red-yellow{--bslib-color-fg: #000;--bslib-color-bg: #ea6d2c;background:linear-gradient(var(--bg-gradient-deg, 140deg), #dc3545 var(--bg-gradient-start, 36%), #ffc107 var(--bg-gradient-end, 180%)) #ea6d2c;color:#000}.bg-gradient-red-green{--bslib-color-fg: #ffffff;--bslib-color-bg: #8e564b;background:linear-gradient(var(--bg-gradient-deg, 140deg), #dc3545 var(--bg-gradient-start, 36%), #198754 var(--bg-gradient-end, 180%)) #8e564b;color:#fff}.bg-gradient-red-teal{--bslib-color-fg: #000;--bslib-color-bg: #917066;background:linear-gradient(var(--bg-gradient-deg, 140deg), #dc3545 var(--bg-gradient-start, 36%), #20c997 var(--bg-gradient-end, 180%)) #917066;color:#000}.bg-gradient-red-cyan{--bslib-color-fg: #000;--bslib-color-bg: #897189;background:linear-gradient(var(--bg-gradient-deg, 140deg), #dc3545 var(--bg-gradient-start, 36%), #0dcaf0 var(--bg-gradient-end, 180%)) #897189;color:#000}.bg-gradient-orange-blue{--bslib-color-fg: #000;--bslib-color-bg: #9d7871;background:linear-gradient(var(--bg-gradient-deg, 140deg), #fd7e14 var(--bg-gradient-start, 36%), #0d6efd var(--bg-gradient-end, 180%)) #9d7871;color:#000}.bg-gradient-orange-indigo{--bslib-color-fg: #000;--bslib-color-bg: #c1526d;background:linear-gradient(var(--bg-gradient-deg, 140deg), #fd7e14 var(--bg-gradient-start, 36%), #6610f2 var(--bg-gradient-end, 180%)) #c1526d;color:#000}.bg-gradient-orange-purple{--bslib-color-fg: #000;--bslib-color-bg: #c46659;background:linear-gradient(var(--bg-gradient-deg, 140deg), #fd7e14 var(--bg-gradient-start, 36%), #6f42c1 var(--bg-gradient-end, 180%)) #c46659;color:#000}.bg-gradient-orange-pink{--bslib-color-fg: #000;--bslib-color-bg: #ed6041;background:linear-gradient(var(--bg-gradient-deg, 140deg), #fd7e14 var(--bg-gradient-start, 36%), #d63384 var(--bg-gradient-end, 180%)) #ed6041;color:#000}.bg-gradient-orange-red{--bslib-color-fg: #000;--bslib-color-bg: #f06128;background:linear-gradient(var(--bg-gradient-deg, 140deg), #fd7e14 var(--bg-gradient-start, 36%), #dc3545 var(--bg-gradient-end, 180%)) #f06128;color:#000}.bg-gradient-orange-yellow{--bslib-color-fg: #000;--bslib-color-bg: #fe990f;background:linear-gradient(var(--bg-gradient-deg, 140deg), #fd7e14 var(--bg-gradient-start, 36%), #ffc107 var(--bg-gradient-end, 180%)) #fe990f;color:#000}.bg-gradient-orange-green{--bslib-color-fg: #000;--bslib-color-bg: #a2822e;background:linear-gradient(var(--bg-gradient-deg, 140deg), #fd7e14 var(--bg-gradient-start, 36%), #198754 var(--bg-gradient-end, 180%)) #a2822e;color:#000}.bg-gradient-orange-teal{--bslib-color-fg: #000;--bslib-color-bg: #a59c48;background:linear-gradient(var(--bg-gradient-deg, 140deg), #fd7e14 var(--bg-gradient-start, 36%), #20c997 var(--bg-gradient-end, 180%)) #a59c48;color:#000}.bg-gradient-orange-cyan{--bslib-color-fg: #000;--bslib-color-bg: #9d9c6c;background:linear-gradient(var(--bg-gradient-deg, 140deg), #fd7e14 var(--bg-gradient-start, 36%), #0dcaf0 var(--bg-gradient-end, 180%)) #9d9c6c;color:#000}.bg-gradient-yellow-blue{--bslib-color-fg: #000;--bslib-color-bg: #9ea069;background:linear-gradient(var(--bg-gradient-deg, 140deg), #ffc107 var(--bg-gradient-start, 36%), #0d6efd var(--bg-gradient-end, 180%)) #9ea069;color:#000}.bg-gradient-yellow-indigo{--bslib-color-fg: #000;--bslib-color-bg: #c27a65;background:linear-gradient(var(--bg-gradient-deg, 140deg), #ffc107 var(--bg-gradient-start, 36%), #6610f2 var(--bg-gradient-end, 180%)) #c27a65;color:#000}.bg-gradient-yellow-purple{--bslib-color-fg: #000;--bslib-color-bg: #c58e51;background:linear-gradient(var(--bg-gradient-deg, 140deg), #ffc107 var(--bg-gradient-start, 36%), #6f42c1 var(--bg-gradient-end, 180%)) #c58e51;color:#000}.bg-gradient-yellow-pink{--bslib-color-fg: #000;--bslib-color-bg: #ef8839;background:linear-gradient(var(--bg-gradient-deg, 140deg), #ffc107 var(--bg-gradient-start, 36%), #d63384 var(--bg-gradient-end, 180%)) #ef8839;color:#000}.bg-gradient-yellow-red{--bslib-color-fg: #000;--bslib-color-bg: #f18920;background:linear-gradient(var(--bg-gradient-deg, 140deg), #ffc107 var(--bg-gradient-start, 36%), #dc3545 var(--bg-gradient-end, 180%)) #f18920;color:#000}.bg-gradient-yellow-orange{--bslib-color-fg: #000;--bslib-color-bg: #fea60c;background:linear-gradient(var(--bg-gradient-deg, 140deg), #ffc107 var(--bg-gradient-start, 36%), #fd7e14 var(--bg-gradient-end, 180%)) #fea60c;color:#000}.bg-gradient-yellow-green{--bslib-color-fg: #000;--bslib-color-bg: #a3aa26;background:linear-gradient(var(--bg-gradient-deg, 140deg), #ffc107 var(--bg-gradient-start, 36%), #198754 var(--bg-gradient-end, 180%)) #a3aa26;color:#000}.bg-gradient-yellow-teal{--bslib-color-fg: #000;--bslib-color-bg: #a6c441;background:linear-gradient(var(--bg-gradient-deg, 140deg), #ffc107 var(--bg-gradient-start, 36%), #20c997 var(--bg-gradient-end, 180%)) #a6c441;color:#000}.bg-gradient-yellow-cyan{--bslib-color-fg: #000;--bslib-color-bg: #9ec564;background:linear-gradient(var(--bg-gradient-deg, 140deg), #ffc107 var(--bg-gradient-start, 36%), #0dcaf0 var(--bg-gradient-end, 180%)) #9ec564;color:#000}.bg-gradient-green-blue{--bslib-color-fg: #ffffff;--bslib-color-bg: #147d98;background:linear-gradient(var(--bg-gradient-deg, 140deg), #198754 var(--bg-gradient-start, 36%), #0d6efd var(--bg-gradient-end, 180%)) #147d98;color:#fff}.bg-gradient-green-indigo{--bslib-color-fg: #ffffff;--bslib-color-bg: #385793;background:linear-gradient(var(--bg-gradient-deg, 140deg), #198754 var(--bg-gradient-start, 36%), #6610f2 var(--bg-gradient-end, 180%)) #385793;color:#fff}.bg-gradient-green-purple{--bslib-color-fg: #ffffff;--bslib-color-bg: #3b6b80;background:linear-gradient(var(--bg-gradient-deg, 140deg), #198754 var(--bg-gradient-start, 36%), #6f42c1 var(--bg-gradient-end, 180%)) #3b6b80;color:#fff}.bg-gradient-green-pink{--bslib-color-fg: #ffffff;--bslib-color-bg: #656567;background:linear-gradient(var(--bg-gradient-deg, 140deg), #198754 var(--bg-gradient-start, 36%), #d63384 var(--bg-gradient-end, 180%)) #656567;color:#fff}.bg-gradient-green-red{--bslib-color-fg: #ffffff;--bslib-color-bg: #67664e;background:linear-gradient(var(--bg-gradient-deg, 140deg), #198754 var(--bg-gradient-start, 36%), #dc3545 var(--bg-gradient-end, 180%)) #67664e;color:#fff}.bg-gradient-green-orange{--bslib-color-fg: #000;--bslib-color-bg: #74833a;background:linear-gradient(var(--bg-gradient-deg, 140deg), #198754 var(--bg-gradient-start, 36%), #fd7e14 var(--bg-gradient-end, 180%)) #74833a;color:#000}.bg-gradient-green-yellow{--bslib-color-fg: #000;--bslib-color-bg: #759e35;background:linear-gradient(var(--bg-gradient-deg, 140deg), #198754 var(--bg-gradient-start, 36%), #ffc107 var(--bg-gradient-end, 180%)) #759e35;color:#000}.bg-gradient-green-teal{--bslib-color-fg: #000;--bslib-color-bg: #1ca16f;background:linear-gradient(var(--bg-gradient-deg, 140deg), #198754 var(--bg-gradient-start, 36%), #20c997 var(--bg-gradient-end, 180%)) #1ca16f;color:#000}.bg-gradient-green-cyan{--bslib-color-fg: #000;--bslib-color-bg: #14a292;background:linear-gradient(var(--bg-gradient-deg, 140deg), #198754 var(--bg-gradient-start, 36%), #0dcaf0 var(--bg-gradient-end, 180%)) #14a292;color:#000}.bg-gradient-teal-blue{--bslib-color-fg: #000;--bslib-color-bg: #18a5c0;background:linear-gradient(var(--bg-gradient-deg, 140deg), #20c997 var(--bg-gradient-start, 36%), #0d6efd var(--bg-gradient-end, 180%)) #18a5c0;color:#000}.bg-gradient-teal-indigo{--bslib-color-fg: #000;--bslib-color-bg: #3c7fbb;background:linear-gradient(var(--bg-gradient-deg, 140deg), #20c997 var(--bg-gradient-start, 36%), #6610f2 var(--bg-gradient-end, 180%)) #3c7fbb;color:#000}.bg-gradient-teal-purple{--bslib-color-fg: #000;--bslib-color-bg: #4093a8;background:linear-gradient(var(--bg-gradient-deg, 140deg), #20c997 var(--bg-gradient-start, 36%), #6f42c1 var(--bg-gradient-end, 180%)) #4093a8;color:#000}.bg-gradient-teal-pink{--bslib-color-fg: #000;--bslib-color-bg: #698d8f;background:linear-gradient(var(--bg-gradient-deg, 140deg), #20c997 var(--bg-gradient-start, 36%), #d63384 var(--bg-gradient-end, 180%)) #698d8f;color:#000}.bg-gradient-teal-red{--bslib-color-fg: #000;--bslib-color-bg: #6b8e76;background:linear-gradient(var(--bg-gradient-deg, 140deg), #20c997 var(--bg-gradient-start, 36%), #dc3545 var(--bg-gradient-end, 180%)) #6b8e76;color:#000}.bg-gradient-teal-orange{--bslib-color-fg: #000;--bslib-color-bg: #78ab63;background:linear-gradient(var(--bg-gradient-deg, 140deg), #20c997 var(--bg-gradient-start, 36%), #fd7e14 var(--bg-gradient-end, 180%)) #78ab63;color:#000}.bg-gradient-teal-yellow{--bslib-color-fg: #000;--bslib-color-bg: #79c65d;background:linear-gradient(var(--bg-gradient-deg, 140deg), #20c997 var(--bg-gradient-start, 36%), #ffc107 var(--bg-gradient-end, 180%)) #79c65d;color:#000}.bg-gradient-teal-green{--bslib-color-fg: #000;--bslib-color-bg: #1daf7c;background:linear-gradient(var(--bg-gradient-deg, 140deg), #20c997 var(--bg-gradient-start, 36%), #198754 var(--bg-gradient-end, 180%)) #1daf7c;color:#000}.bg-gradient-teal-cyan{--bslib-color-fg: #000;--bslib-color-bg: #18c9bb;background:linear-gradient(var(--bg-gradient-deg, 140deg), #20c997 var(--bg-gradient-start, 36%), #0dcaf0 var(--bg-gradient-end, 180%)) #18c9bb;color:#000}.bg-gradient-cyan-blue{--bslib-color-fg: #000;--bslib-color-bg: #0da5f5;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0dcaf0 var(--bg-gradient-start, 36%), #0d6efd var(--bg-gradient-end, 180%)) #0da5f5;color:#000}.bg-gradient-cyan-indigo{--bslib-color-fg: #000;--bslib-color-bg: #3180f1;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0dcaf0 var(--bg-gradient-start, 36%), #6610f2 var(--bg-gradient-end, 180%)) #3180f1;color:#000}.bg-gradient-cyan-purple{--bslib-color-fg: #000;--bslib-color-bg: #3494dd;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0dcaf0 var(--bg-gradient-start, 36%), #6f42c1 var(--bg-gradient-end, 180%)) #3494dd;color:#000}.bg-gradient-cyan-pink{--bslib-color-fg: #000;--bslib-color-bg: #5d8ec5;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0dcaf0 var(--bg-gradient-start, 36%), #d63384 var(--bg-gradient-end, 180%)) #5d8ec5;color:#000}.bg-gradient-cyan-red{--bslib-color-fg: #000;--bslib-color-bg: #608eac;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0dcaf0 var(--bg-gradient-start, 36%), #dc3545 var(--bg-gradient-end, 180%)) #608eac;color:#000}.bg-gradient-cyan-orange{--bslib-color-fg: #000;--bslib-color-bg: #6dac98;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0dcaf0 var(--bg-gradient-start, 36%), #fd7e14 var(--bg-gradient-end, 180%)) #6dac98;color:#000}.bg-gradient-cyan-yellow{--bslib-color-fg: #000;--bslib-color-bg: #6ec693;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0dcaf0 var(--bg-gradient-start, 36%), #ffc107 var(--bg-gradient-end, 180%)) #6ec693;color:#000}.bg-gradient-cyan-green{--bslib-color-fg: #000;--bslib-color-bg: #12afb2;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0dcaf0 var(--bg-gradient-start, 36%), #198754 var(--bg-gradient-end, 180%)) #12afb2;color:#000}.bg-gradient-cyan-teal{--bslib-color-fg: #000;--bslib-color-bg: #15cacc;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0dcaf0 var(--bg-gradient-start, 36%), #20c997 var(--bg-gradient-end, 180%)) #15cacc;color:#000}.tab-content>.tab-pane.html-fill-container{display:none}.tab-content>.active.html-fill-container{display:flex}.tab-content.html-fill-container{padding:0}:root{--bslib-spacer: 1rem;--bslib-mb-spacer: var(--bslib-spacer, 1rem)}.bslib-mb-spacing{margin-bottom:var(--bslib-mb-spacer)}.bslib-gap-spacing{gap:var(--bslib-mb-spacer)}.bslib-gap-spacing>.bslib-mb-spacing,.bslib-gap-spacing>.form-group,.bslib-gap-spacing>p,.bslib-gap-spacing>pre{margin-bottom:0}.html-fill-container>.html-fill-item.bslib-mb-spacing{margin-bottom:0}.bg-blue{--bslib-color-bg: #0d6efd;--bslib-color-fg: #ffffff;background-color:var(--bslib-color-bg);color:var(--bslib-color-fg)}.text-blue{--bslib-color-fg: #0d6efd;color:var(--bslib-color-fg)}.bg-indigo{--bslib-color-bg: #6610f2;--bslib-color-fg: #ffffff;background-color:var(--bslib-color-bg);color:var(--bslib-color-fg)}.text-indigo{--bslib-color-fg: #6610f2;color:var(--bslib-color-fg)}.bg-purple{--bslib-color-bg: #6f42c1;--bslib-color-fg: #ffffff;background-color:var(--bslib-color-bg);color:var(--bslib-color-fg)}.text-purple{--bslib-color-fg: #6f42c1;color:var(--bslib-color-fg)}.bg-pink{--bslib-color-bg: #d63384;--bslib-color-fg: #ffffff;background-color:var(--bslib-color-bg);color:var(--bslib-color-fg)}.text-pink{--bslib-color-fg: #d63384;color:var(--bslib-color-fg)}.bg-red{--bslib-color-bg: #dc3545;--bslib-color-fg: #ffffff;background-color:var(--bslib-color-bg);color:var(--bslib-color-fg)}.text-red{--bslib-color-fg: #dc3545;color:var(--bslib-color-fg)}.bg-orange{--bslib-color-bg: #fd7e14;--bslib-color-fg: #000;background-color:var(--bslib-color-bg);color:var(--bslib-color-fg)}.text-orange{--bslib-color-fg: #fd7e14;color:var(--bslib-color-fg)}.bg-yellow{--bslib-color-bg: #ffc107;--bslib-color-fg: #000;background-color:var(--bslib-color-bg);color:var(--bslib-color-fg)}.text-yellow{--bslib-color-fg: #ffc107;color:var(--bslib-color-fg)}.bg-green{--bslib-color-bg: #198754;--bslib-color-fg: #ffffff;background-color:var(--bslib-color-bg);color:var(--bslib-color-fg)}.text-green{--bslib-color-fg: #198754;color:var(--bslib-color-fg)}.bg-teal{--bslib-color-bg: #20c997;--bslib-color-fg: #000;background-color:var(--bslib-color-bg);color:var(--bslib-color-fg)}.text-teal{--bslib-color-fg: #20c997;color:var(--bslib-color-fg)}.bg-cyan{--bslib-color-bg: #0dcaf0;--bslib-color-fg: #000;background-color:var(--bslib-color-bg);color:var(--bslib-color-fg)}.text-cyan{--bslib-color-fg: #0dcaf0;color:var(--bslib-color-fg)}.text-default{--bslib-color-fg: #dee2e6}.bg-default{--bslib-color-bg: #dee2e6;--bslib-color-fg: #000}.text-primary{--bslib-color-fg: #0d6efd}.bg-primary{--bslib-color-bg: #0d6efd;--bslib-color-fg: #ffffff}.text-secondary{--bslib-color-fg: #6c757d}.bg-secondary{--bslib-color-bg: #6c757d;--bslib-color-fg: #ffffff}.text-success{--bslib-color-fg: #198754}.bg-success{--bslib-color-bg: #198754;--bslib-color-fg: #ffffff}.text-info{--bslib-color-fg: #0dcaf0}.bg-info{--bslib-color-bg: #0dcaf0;--bslib-color-fg: #000}.text-warning{--bslib-color-fg: #ffc107}.bg-warning{--bslib-color-bg: #ffc107;--bslib-color-fg: #000}.text-danger{--bslib-color-fg: #dc3545}.bg-danger{--bslib-color-bg: #dc3545;--bslib-color-fg: #ffffff}.text-light{--bslib-color-fg: #f8f9fa}.bg-light{--bslib-color-bg: #f8f9fa;--bslib-color-fg: #000}.text-dark{--bslib-color-fg: #212529}.bg-dark{--bslib-color-bg: #212529;--bslib-color-fg: #ffffff}.bg-gradient-blue-indigo{--bslib-color-fg: #ffffff;--bslib-color-bg: #3148f9;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0d6efd var(--bg-gradient-start, 36%), #6610f2 var(--bg-gradient-end, 180%)) #3148f9;color:#fff}.bg-gradient-blue-purple{--bslib-color-fg: #ffffff;--bslib-color-bg: #345ce5;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0d6efd var(--bg-gradient-start, 36%), #6f42c1 var(--bg-gradient-end, 180%)) #345ce5;color:#fff}.bg-gradient-blue-pink{--bslib-color-fg: #ffffff;--bslib-color-bg: #5d56cd;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0d6efd var(--bg-gradient-start, 36%), #d63384 var(--bg-gradient-end, 180%)) #5d56cd;color:#fff}.bg-gradient-blue-red{--bslib-color-fg: #ffffff;--bslib-color-bg: #6057b3;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0d6efd var(--bg-gradient-start, 36%), #dc3545 var(--bg-gradient-end, 180%)) #6057b3;color:#fff}.bg-gradient-blue-orange{--bslib-color-fg: #ffffff;--bslib-color-bg: #6d74a0;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0d6efd var(--bg-gradient-start, 36%), #fd7e14 var(--bg-gradient-end, 180%)) #6d74a0;color:#fff}.bg-gradient-blue-yellow{--bslib-color-fg: #000;--bslib-color-bg: #6e8f9b;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0d6efd var(--bg-gradient-start, 36%), #ffc107 var(--bg-gradient-end, 180%)) #6e8f9b;color:#000}.bg-gradient-blue-green{--bslib-color-fg: #ffffff;--bslib-color-bg: #1278b9;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0d6efd var(--bg-gradient-start, 36%), #198754 var(--bg-gradient-end, 180%)) #1278b9;color:#fff}.bg-gradient-blue-teal{--bslib-color-fg: #000;--bslib-color-bg: #1592d4;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0d6efd var(--bg-gradient-start, 36%), #20c997 var(--bg-gradient-end, 180%)) #1592d4;color:#000}.bg-gradient-blue-cyan{--bslib-color-fg: #000;--bslib-color-bg: #0d93f8;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0d6efd var(--bg-gradient-start, 36%), #0dcaf0 var(--bg-gradient-end, 180%)) #0d93f8;color:#000}.bg-gradient-indigo-blue{--bslib-color-fg: #ffffff;--bslib-color-bg: #4236f6;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6610f2 var(--bg-gradient-start, 36%), #0d6efd var(--bg-gradient-end, 180%)) #4236f6;color:#fff}.bg-gradient-indigo-purple{--bslib-color-fg: #ffffff;--bslib-color-bg: #6a24de;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6610f2 var(--bg-gradient-start, 36%), #6f42c1 var(--bg-gradient-end, 180%)) #6a24de;color:#fff}.bg-gradient-indigo-pink{--bslib-color-fg: #ffffff;--bslib-color-bg: #931ec6;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6610f2 var(--bg-gradient-start, 36%), #d63384 var(--bg-gradient-end, 180%)) #931ec6;color:#fff}.bg-gradient-indigo-red{--bslib-color-fg: #ffffff;--bslib-color-bg: #951fad;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6610f2 var(--bg-gradient-start, 36%), #dc3545 var(--bg-gradient-end, 180%)) #951fad;color:#fff}.bg-gradient-indigo-orange{--bslib-color-fg: #ffffff;--bslib-color-bg: #a23c99;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6610f2 var(--bg-gradient-start, 36%), #fd7e14 var(--bg-gradient-end, 180%)) #a23c99;color:#fff}.bg-gradient-indigo-yellow{--bslib-color-fg: #ffffff;--bslib-color-bg: #a35794;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6610f2 var(--bg-gradient-start, 36%), #ffc107 var(--bg-gradient-end, 180%)) #a35794;color:#fff}.bg-gradient-indigo-green{--bslib-color-fg: #ffffff;--bslib-color-bg: #4740b3;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6610f2 var(--bg-gradient-start, 36%), #198754 var(--bg-gradient-end, 180%)) #4740b3;color:#fff}.bg-gradient-indigo-teal{--bslib-color-fg: #ffffff;--bslib-color-bg: #4a5ace;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6610f2 var(--bg-gradient-start, 36%), #20c997 var(--bg-gradient-end, 180%)) #4a5ace;color:#fff}.bg-gradient-indigo-cyan{--bslib-color-fg: #ffffff;--bslib-color-bg: #425af1;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6610f2 var(--bg-gradient-start, 36%), #0dcaf0 var(--bg-gradient-end, 180%)) #425af1;color:#fff}.bg-gradient-purple-blue{--bslib-color-fg: #ffffff;--bslib-color-bg: #4854d9;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6f42c1 var(--bg-gradient-start, 36%), #0d6efd var(--bg-gradient-end, 180%)) #4854d9;color:#fff}.bg-gradient-purple-indigo{--bslib-color-fg: #ffffff;--bslib-color-bg: #6b2ed5;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6f42c1 var(--bg-gradient-start, 36%), #6610f2 var(--bg-gradient-end, 180%)) #6b2ed5;color:#fff}.bg-gradient-purple-pink{--bslib-color-fg: #ffffff;--bslib-color-bg: #983ca9;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6f42c1 var(--bg-gradient-start, 36%), #d63384 var(--bg-gradient-end, 180%)) #983ca9;color:#fff}.bg-gradient-purple-red{--bslib-color-fg: #ffffff;--bslib-color-bg: #9b3d8f;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6f42c1 var(--bg-gradient-start, 36%), #dc3545 var(--bg-gradient-end, 180%)) #9b3d8f;color:#fff}.bg-gradient-purple-orange{--bslib-color-fg: #ffffff;--bslib-color-bg: #a85a7c;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6f42c1 var(--bg-gradient-start, 36%), #fd7e14 var(--bg-gradient-end, 180%)) #a85a7c;color:#fff}.bg-gradient-purple-yellow{--bslib-color-fg: #000;--bslib-color-bg: #a97577;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6f42c1 var(--bg-gradient-start, 36%), #ffc107 var(--bg-gradient-end, 180%)) #a97577;color:#000}.bg-gradient-purple-green{--bslib-color-fg: #ffffff;--bslib-color-bg: #4d5e95;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6f42c1 var(--bg-gradient-start, 36%), #198754 var(--bg-gradient-end, 180%)) #4d5e95;color:#fff}.bg-gradient-purple-teal{--bslib-color-fg: #ffffff;--bslib-color-bg: #4f78b0;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6f42c1 var(--bg-gradient-start, 36%), #20c997 var(--bg-gradient-end, 180%)) #4f78b0;color:#fff}.bg-gradient-purple-cyan{--bslib-color-fg: #000;--bslib-color-bg: #4878d4;background:linear-gradient(var(--bg-gradient-deg, 140deg), #6f42c1 var(--bg-gradient-start, 36%), #0dcaf0 var(--bg-gradient-end, 180%)) #4878d4;color:#000}.bg-gradient-pink-blue{--bslib-color-fg: #ffffff;--bslib-color-bg: #864bb4;background:linear-gradient(var(--bg-gradient-deg, 140deg), #d63384 var(--bg-gradient-start, 36%), #0d6efd var(--bg-gradient-end, 180%)) #864bb4;color:#fff}.bg-gradient-pink-indigo{--bslib-color-fg: #ffffff;--bslib-color-bg: #a925b0;background:linear-gradient(var(--bg-gradient-deg, 140deg), #d63384 var(--bg-gradient-start, 36%), #6610f2 var(--bg-gradient-end, 180%)) #a925b0;color:#fff}.bg-gradient-pink-purple{--bslib-color-fg: #ffffff;--bslib-color-bg: #ad399c;background:linear-gradient(var(--bg-gradient-deg, 140deg), #d63384 var(--bg-gradient-start, 36%), #6f42c1 var(--bg-gradient-end, 180%)) #ad399c;color:#fff}.bg-gradient-pink-red{--bslib-color-fg: #ffffff;--bslib-color-bg: #d8346b;background:linear-gradient(var(--bg-gradient-deg, 140deg), #d63384 var(--bg-gradient-start, 36%), #dc3545 var(--bg-gradient-end, 180%)) #d8346b;color:#fff}.bg-gradient-pink-orange{--bslib-color-fg: #000;--bslib-color-bg: #e65157;background:linear-gradient(var(--bg-gradient-deg, 140deg), #d63384 var(--bg-gradient-start, 36%), #fd7e14 var(--bg-gradient-end, 180%)) #e65157;color:#000}.bg-gradient-pink-yellow{--bslib-color-fg: #000;--bslib-color-bg: #e66c52;background:linear-gradient(var(--bg-gradient-deg, 140deg), #d63384 var(--bg-gradient-start, 36%), #ffc107 var(--bg-gradient-end, 180%)) #e66c52;color:#000}.bg-gradient-pink-green{--bslib-color-fg: #ffffff;--bslib-color-bg: #8a5571;background:linear-gradient(var(--bg-gradient-deg, 140deg), #d63384 var(--bg-gradient-start, 36%), #198754 var(--bg-gradient-end, 180%)) #8a5571;color:#fff}.bg-gradient-pink-teal{--bslib-color-fg: #000;--bslib-color-bg: #8d6f8c;background:linear-gradient(var(--bg-gradient-deg, 140deg), #d63384 var(--bg-gradient-start, 36%), #20c997 var(--bg-gradient-end, 180%)) #8d6f8c;color:#000}.bg-gradient-pink-cyan{--bslib-color-fg: #000;--bslib-color-bg: #866faf;background:linear-gradient(var(--bg-gradient-deg, 140deg), #d63384 var(--bg-gradient-start, 36%), #0dcaf0 var(--bg-gradient-end, 180%)) #866faf;color:#000}.bg-gradient-red-blue{--bslib-color-fg: #ffffff;--bslib-color-bg: #894c8f;background:linear-gradient(var(--bg-gradient-deg, 140deg), #dc3545 var(--bg-gradient-start, 36%), #0d6efd var(--bg-gradient-end, 180%)) #894c8f;color:#fff}.bg-gradient-red-indigo{--bslib-color-fg: #ffffff;--bslib-color-bg: #ad268a;background:linear-gradient(var(--bg-gradient-deg, 140deg), #dc3545 var(--bg-gradient-start, 36%), #6610f2 var(--bg-gradient-end, 180%)) #ad268a;color:#fff}.bg-gradient-red-purple{--bslib-color-fg: #ffffff;--bslib-color-bg: #b03a77;background:linear-gradient(var(--bg-gradient-deg, 140deg), #dc3545 var(--bg-gradient-start, 36%), #6f42c1 var(--bg-gradient-end, 180%)) #b03a77;color:#fff}.bg-gradient-red-pink{--bslib-color-fg: #ffffff;--bslib-color-bg: #da345e;background:linear-gradient(var(--bg-gradient-deg, 140deg), #dc3545 var(--bg-gradient-start, 36%), #d63384 var(--bg-gradient-end, 180%)) #da345e;color:#fff}.bg-gradient-red-orange{--bslib-color-fg: #000;--bslib-color-bg: #e95231;background:linear-gradient(var(--bg-gradient-deg, 140deg), #dc3545 var(--bg-gradient-start, 36%), #fd7e14 var(--bg-gradient-end, 180%)) #e95231;color:#000}.bg-gradient-red-yellow{--bslib-color-fg: #000;--bslib-color-bg: #ea6d2c;background:linear-gradient(var(--bg-gradient-deg, 140deg), #dc3545 var(--bg-gradient-start, 36%), #ffc107 var(--bg-gradient-end, 180%)) #ea6d2c;color:#000}.bg-gradient-red-green{--bslib-color-fg: #ffffff;--bslib-color-bg: #8e564b;background:linear-gradient(var(--bg-gradient-deg, 140deg), #dc3545 var(--bg-gradient-start, 36%), #198754 var(--bg-gradient-end, 180%)) #8e564b;color:#fff}.bg-gradient-red-teal{--bslib-color-fg: #000;--bslib-color-bg: #917066;background:linear-gradient(var(--bg-gradient-deg, 140deg), #dc3545 var(--bg-gradient-start, 36%), #20c997 var(--bg-gradient-end, 180%)) #917066;color:#000}.bg-gradient-red-cyan{--bslib-color-fg: #000;--bslib-color-bg: #897189;background:linear-gradient(var(--bg-gradient-deg, 140deg), #dc3545 var(--bg-gradient-start, 36%), #0dcaf0 var(--bg-gradient-end, 180%)) #897189;color:#000}.bg-gradient-orange-blue{--bslib-color-fg: #000;--bslib-color-bg: #9d7871;background:linear-gradient(var(--bg-gradient-deg, 140deg), #fd7e14 var(--bg-gradient-start, 36%), #0d6efd var(--bg-gradient-end, 180%)) #9d7871;color:#000}.bg-gradient-orange-indigo{--bslib-color-fg: #000;--bslib-color-bg: #c1526d;background:linear-gradient(var(--bg-gradient-deg, 140deg), #fd7e14 var(--bg-gradient-start, 36%), #6610f2 var(--bg-gradient-end, 180%)) #c1526d;color:#000}.bg-gradient-orange-purple{--bslib-color-fg: #000;--bslib-color-bg: #c46659;background:linear-gradient(var(--bg-gradient-deg, 140deg), #fd7e14 var(--bg-gradient-start, 36%), #6f42c1 var(--bg-gradient-end, 180%)) #c46659;color:#000}.bg-gradient-orange-pink{--bslib-color-fg: #000;--bslib-color-bg: #ed6041;background:linear-gradient(var(--bg-gradient-deg, 140deg), #fd7e14 var(--bg-gradient-start, 36%), #d63384 var(--bg-gradient-end, 180%)) #ed6041;color:#000}.bg-gradient-orange-red{--bslib-color-fg: #000;--bslib-color-bg: #f06128;background:linear-gradient(var(--bg-gradient-deg, 140deg), #fd7e14 var(--bg-gradient-start, 36%), #dc3545 var(--bg-gradient-end, 180%)) #f06128;color:#000}.bg-gradient-orange-yellow{--bslib-color-fg: #000;--bslib-color-bg: #fe990f;background:linear-gradient(var(--bg-gradient-deg, 140deg), #fd7e14 var(--bg-gradient-start, 36%), #ffc107 var(--bg-gradient-end, 180%)) #fe990f;color:#000}.bg-gradient-orange-green{--bslib-color-fg: #000;--bslib-color-bg: #a2822e;background:linear-gradient(var(--bg-gradient-deg, 140deg), #fd7e14 var(--bg-gradient-start, 36%), #198754 var(--bg-gradient-end, 180%)) #a2822e;color:#000}.bg-gradient-orange-teal{--bslib-color-fg: #000;--bslib-color-bg: #a59c48;background:linear-gradient(var(--bg-gradient-deg, 140deg), #fd7e14 var(--bg-gradient-start, 36%), #20c997 var(--bg-gradient-end, 180%)) #a59c48;color:#000}.bg-gradient-orange-cyan{--bslib-color-fg: #000;--bslib-color-bg: #9d9c6c;background:linear-gradient(var(--bg-gradient-deg, 140deg), #fd7e14 var(--bg-gradient-start, 36%), #0dcaf0 var(--bg-gradient-end, 180%)) #9d9c6c;color:#000}.bg-gradient-yellow-blue{--bslib-color-fg: #000;--bslib-color-bg: #9ea069;background:linear-gradient(var(--bg-gradient-deg, 140deg), #ffc107 var(--bg-gradient-start, 36%), #0d6efd var(--bg-gradient-end, 180%)) #9ea069;color:#000}.bg-gradient-yellow-indigo{--bslib-color-fg: #000;--bslib-color-bg: #c27a65;background:linear-gradient(var(--bg-gradient-deg, 140deg), #ffc107 var(--bg-gradient-start, 36%), #6610f2 var(--bg-gradient-end, 180%)) #c27a65;color:#000}.bg-gradient-yellow-purple{--bslib-color-fg: #000;--bslib-color-bg: #c58e51;background:linear-gradient(var(--bg-gradient-deg, 140deg), #ffc107 var(--bg-gradient-start, 36%), #6f42c1 var(--bg-gradient-end, 180%)) #c58e51;color:#000}.bg-gradient-yellow-pink{--bslib-color-fg: #000;--bslib-color-bg: #ef8839;background:linear-gradient(var(--bg-gradient-deg, 140deg), #ffc107 var(--bg-gradient-start, 36%), #d63384 var(--bg-gradient-end, 180%)) #ef8839;color:#000}.bg-gradient-yellow-red{--bslib-color-fg: #000;--bslib-color-bg: #f18920;background:linear-gradient(var(--bg-gradient-deg, 140deg), #ffc107 var(--bg-gradient-start, 36%), #dc3545 var(--bg-gradient-end, 180%)) #f18920;color:#000}.bg-gradient-yellow-orange{--bslib-color-fg: #000;--bslib-color-bg: #fea60c;background:linear-gradient(var(--bg-gradient-deg, 140deg), #ffc107 var(--bg-gradient-start, 36%), #fd7e14 var(--bg-gradient-end, 180%)) #fea60c;color:#000}.bg-gradient-yellow-green{--bslib-color-fg: #000;--bslib-color-bg: #a3aa26;background:linear-gradient(var(--bg-gradient-deg, 140deg), #ffc107 var(--bg-gradient-start, 36%), #198754 var(--bg-gradient-end, 180%)) #a3aa26;color:#000}.bg-gradient-yellow-teal{--bslib-color-fg: #000;--bslib-color-bg: #a6c441;background:linear-gradient(var(--bg-gradient-deg, 140deg), #ffc107 var(--bg-gradient-start, 36%), #20c997 var(--bg-gradient-end, 180%)) #a6c441;color:#000}.bg-gradient-yellow-cyan{--bslib-color-fg: #000;--bslib-color-bg: #9ec564;background:linear-gradient(var(--bg-gradient-deg, 140deg), #ffc107 var(--bg-gradient-start, 36%), #0dcaf0 var(--bg-gradient-end, 180%)) #9ec564;color:#000}.bg-gradient-green-blue{--bslib-color-fg: #ffffff;--bslib-color-bg: #147d98;background:linear-gradient(var(--bg-gradient-deg, 140deg), #198754 var(--bg-gradient-start, 36%), #0d6efd var(--bg-gradient-end, 180%)) #147d98;color:#fff}.bg-gradient-green-indigo{--bslib-color-fg: #ffffff;--bslib-color-bg: #385793;background:linear-gradient(var(--bg-gradient-deg, 140deg), #198754 var(--bg-gradient-start, 36%), #6610f2 var(--bg-gradient-end, 180%)) #385793;color:#fff}.bg-gradient-green-purple{--bslib-color-fg: #ffffff;--bslib-color-bg: #3b6b80;background:linear-gradient(var(--bg-gradient-deg, 140deg), #198754 var(--bg-gradient-start, 36%), #6f42c1 var(--bg-gradient-end, 180%)) #3b6b80;color:#fff}.bg-gradient-green-pink{--bslib-color-fg: #ffffff;--bslib-color-bg: #656567;background:linear-gradient(var(--bg-gradient-deg, 140deg), #198754 var(--bg-gradient-start, 36%), #d63384 var(--bg-gradient-end, 180%)) #656567;color:#fff}.bg-gradient-green-red{--bslib-color-fg: #ffffff;--bslib-color-bg: #67664e;background:linear-gradient(var(--bg-gradient-deg, 140deg), #198754 var(--bg-gradient-start, 36%), #dc3545 var(--bg-gradient-end, 180%)) #67664e;color:#fff}.bg-gradient-green-orange{--bslib-color-fg: #000;--bslib-color-bg: #74833a;background:linear-gradient(var(--bg-gradient-deg, 140deg), #198754 var(--bg-gradient-start, 36%), #fd7e14 var(--bg-gradient-end, 180%)) #74833a;color:#000}.bg-gradient-green-yellow{--bslib-color-fg: #000;--bslib-color-bg: #759e35;background:linear-gradient(var(--bg-gradient-deg, 140deg), #198754 var(--bg-gradient-start, 36%), #ffc107 var(--bg-gradient-end, 180%)) #759e35;color:#000}.bg-gradient-green-teal{--bslib-color-fg: #000;--bslib-color-bg: #1ca16f;background:linear-gradient(var(--bg-gradient-deg, 140deg), #198754 var(--bg-gradient-start, 36%), #20c997 var(--bg-gradient-end, 180%)) #1ca16f;color:#000}.bg-gradient-green-cyan{--bslib-color-fg: #000;--bslib-color-bg: #14a292;background:linear-gradient(var(--bg-gradient-deg, 140deg), #198754 var(--bg-gradient-start, 36%), #0dcaf0 var(--bg-gradient-end, 180%)) #14a292;color:#000}.bg-gradient-teal-blue{--bslib-color-fg: #000;--bslib-color-bg: #18a5c0;background:linear-gradient(var(--bg-gradient-deg, 140deg), #20c997 var(--bg-gradient-start, 36%), #0d6efd var(--bg-gradient-end, 180%)) #18a5c0;color:#000}.bg-gradient-teal-indigo{--bslib-color-fg: #000;--bslib-color-bg: #3c7fbb;background:linear-gradient(var(--bg-gradient-deg, 140deg), #20c997 var(--bg-gradient-start, 36%), #6610f2 var(--bg-gradient-end, 180%)) #3c7fbb;color:#000}.bg-gradient-teal-purple{--bslib-color-fg: #000;--bslib-color-bg: #4093a8;background:linear-gradient(var(--bg-gradient-deg, 140deg), #20c997 var(--bg-gradient-start, 36%), #6f42c1 var(--bg-gradient-end, 180%)) #4093a8;color:#000}.bg-gradient-teal-pink{--bslib-color-fg: #000;--bslib-color-bg: #698d8f;background:linear-gradient(var(--bg-gradient-deg, 140deg), #20c997 var(--bg-gradient-start, 36%), #d63384 var(--bg-gradient-end, 180%)) #698d8f;color:#000}.bg-gradient-teal-red{--bslib-color-fg: #000;--bslib-color-bg: #6b8e76;background:linear-gradient(var(--bg-gradient-deg, 140deg), #20c997 var(--bg-gradient-start, 36%), #dc3545 var(--bg-gradient-end, 180%)) #6b8e76;color:#000}.bg-gradient-teal-orange{--bslib-color-fg: #000;--bslib-color-bg: #78ab63;background:linear-gradient(var(--bg-gradient-deg, 140deg), #20c997 var(--bg-gradient-start, 36%), #fd7e14 var(--bg-gradient-end, 180%)) #78ab63;color:#000}.bg-gradient-teal-yellow{--bslib-color-fg: #000;--bslib-color-bg: #79c65d;background:linear-gradient(var(--bg-gradient-deg, 140deg), #20c997 var(--bg-gradient-start, 36%), #ffc107 var(--bg-gradient-end, 180%)) #79c65d;color:#000}.bg-gradient-teal-green{--bslib-color-fg: #000;--bslib-color-bg: #1daf7c;background:linear-gradient(var(--bg-gradient-deg, 140deg), #20c997 var(--bg-gradient-start, 36%), #198754 var(--bg-gradient-end, 180%)) #1daf7c;color:#000}.bg-gradient-teal-cyan{--bslib-color-fg: #000;--bslib-color-bg: #18c9bb;background:linear-gradient(var(--bg-gradient-deg, 140deg), #20c997 var(--bg-gradient-start, 36%), #0dcaf0 var(--bg-gradient-end, 180%)) #18c9bb;color:#000}.bg-gradient-cyan-blue{--bslib-color-fg: #000;--bslib-color-bg: #0da5f5;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0dcaf0 var(--bg-gradient-start, 36%), #0d6efd var(--bg-gradient-end, 180%)) #0da5f5;color:#000}.bg-gradient-cyan-indigo{--bslib-color-fg: #000;--bslib-color-bg: #3180f1;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0dcaf0 var(--bg-gradient-start, 36%), #6610f2 var(--bg-gradient-end, 180%)) #3180f1;color:#000}.bg-gradient-cyan-purple{--bslib-color-fg: #000;--bslib-color-bg: #3494dd;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0dcaf0 var(--bg-gradient-start, 36%), #6f42c1 var(--bg-gradient-end, 180%)) #3494dd;color:#000}.bg-gradient-cyan-pink{--bslib-color-fg: #000;--bslib-color-bg: #5d8ec5;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0dcaf0 var(--bg-gradient-start, 36%), #d63384 var(--bg-gradient-end, 180%)) #5d8ec5;color:#000}.bg-gradient-cyan-red{--bslib-color-fg: #000;--bslib-color-bg: #608eac;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0dcaf0 var(--bg-gradient-start, 36%), #dc3545 var(--bg-gradient-end, 180%)) #608eac;color:#000}.bg-gradient-cyan-orange{--bslib-color-fg: #000;--bslib-color-bg: #6dac98;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0dcaf0 var(--bg-gradient-start, 36%), #fd7e14 var(--bg-gradient-end, 180%)) #6dac98;color:#000}.bg-gradient-cyan-yellow{--bslib-color-fg: #000;--bslib-color-bg: #6ec693;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0dcaf0 var(--bg-gradient-start, 36%), #ffc107 var(--bg-gradient-end, 180%)) #6ec693;color:#000}.bg-gradient-cyan-green{--bslib-color-fg: #000;--bslib-color-bg: #12afb2;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0dcaf0 var(--bg-gradient-start, 36%), #198754 var(--bg-gradient-end, 180%)) #12afb2;color:#000}.bg-gradient-cyan-teal{--bslib-color-fg: #000;--bslib-color-bg: #15cacc;background:linear-gradient(var(--bg-gradient-deg, 140deg), #0dcaf0 var(--bg-gradient-start, 36%), #20c997 var(--bg-gradient-end, 180%)) #15cacc;color:#000}:root{--bslib-value-box-shadow: none;--bslib-value-box-border-width-auto-yes: var(--bslib-value-box-border-width-baseline);--bslib-value-box-border-width-auto-no: 0;--bslib-value-box-border-width-baseline: 1px}.bslib-value-box{border-width:var(--bslib-value-box-border-width-auto-no, var(--bslib-value-box-border-width-baseline));container-name:bslib-value-box;container-type:inline-size}.bslib-value-box.card{box-shadow:var(--bslib-value-box-shadow)}.bslib-value-box.border-auto{border-width:var(--bslib-value-box-border-width-auto-yes, var(--bslib-value-box-border-width-baseline))}.bslib-value-box.default{--bslib-value-box-bg-default: var(--bs-card-bg, #ffffff);--bslib-value-box-border-color-default: var(--bs-card-border-color, rgba(0, 0, 0, 0.175));color:var(--bslib-value-box-color);background-color:var(--bslib-value-box-bg, var(--bslib-value-box-bg-default));border-color:var(--bslib-value-box-border-color, var(--bslib-value-box-border-color-default))}.bslib-value-box .value-box-grid{display:grid;grid-template-areas:"left right";align-items:center;overflow:hidden}.bslib-value-box .value-box-showcase{height:100%;max-height:var(---bslib-value-box-showcase-max-h, 100%)}.bslib-value-box .value-box-showcase,.bslib-value-box .value-box-showcase>.html-fill-item{width:100%}.bslib-value-box[data-full-screen=true] .value-box-showcase{max-height:var(---bslib-value-box-showcase-max-h-fs, 100%)}@media screen and (min-width: 575.98px){@container bslib-value-box (max-width: 300px){.bslib-value-box:not(.showcase-bottom) .value-box-grid{grid-template-columns:1fr !important;grid-template-rows:auto auto;grid-template-areas:"top" "bottom"}.bslib-value-box:not(.showcase-bottom) .value-box-grid .value-box-showcase{grid-area:top !important}.bslib-value-box:not(.showcase-bottom) .value-box-grid .value-box-area{grid-area:bottom !important;justify-content:end}}}.bslib-value-box .value-box-area{justify-content:center;padding:1.5rem 1rem;font-size:.9rem;font-weight:500}.bslib-value-box .value-box-area *{margin-bottom:0;margin-top:0}.bslib-value-box .value-box-title{font-size:1rem;margin-top:0;margin-bottom:.5rem;font-weight:500;line-height:1.2}.bslib-value-box .value-box-title:empty::after{content:" "}.bslib-value-box .value-box-value{font-size:calc(1.29rem + 0.48vw);margin-top:0;margin-bottom:.5rem;font-weight:500;line-height:1.2}@media(min-width: 1200px){.bslib-value-box .value-box-value{font-size:1.65rem}}.bslib-value-box .value-box-value:empty::after{content:" "}.bslib-value-box .value-box-showcase{align-items:center;justify-content:center;margin-top:auto;margin-bottom:auto;padding:1rem}.bslib-value-box .value-box-showcase .bi,.bslib-value-box .value-box-showcase .fa,.bslib-value-box .value-box-showcase .fab,.bslib-value-box .value-box-showcase .fas,.bslib-value-box .value-box-showcase .far{opacity:.85;min-width:50px;max-width:125%}.bslib-value-box .value-box-showcase .bi,.bslib-value-box .value-box-showcase .fa,.bslib-value-box .value-box-showcase .fab,.bslib-value-box .value-box-showcase .fas,.bslib-value-box .value-box-showcase .far{font-size:4rem}.bslib-value-box.showcase-top-right .value-box-grid{grid-template-columns:1fr var(---bslib-value-box-showcase-w, 50%)}.bslib-value-box.showcase-top-right .value-box-grid .value-box-showcase{grid-area:right;margin-left:auto;align-self:start;align-items:end;padding-left:0;padding-bottom:0}.bslib-value-box.showcase-top-right .value-box-grid .value-box-area{grid-area:left;align-self:end}.bslib-value-box.showcase-top-right[data-full-screen=true] .value-box-grid{grid-template-columns:auto var(---bslib-value-box-showcase-w-fs, 1fr)}.bslib-value-box.showcase-top-right[data-full-screen=true] .value-box-grid>div{align-self:center}.bslib-value-box.showcase-top-right:not([data-full-screen=true]) .value-box-showcase{margin-top:0}@container bslib-value-box (max-width: 300px){.bslib-value-box.showcase-top-right:not([data-full-screen=true]) .value-box-grid .value-box-showcase{padding-left:1rem}}.bslib-value-box.showcase-left-center .value-box-grid{grid-template-columns:var(---bslib-value-box-showcase-w, 30%) auto}.bslib-value-box.showcase-left-center[data-full-screen=true] .value-box-grid{grid-template-columns:var(---bslib-value-box-showcase-w-fs, 1fr) auto}.bslib-value-box.showcase-left-center:not([data-fill-screen=true]) .value-box-grid .value-box-showcase{grid-area:left}.bslib-value-box.showcase-left-center:not([data-fill-screen=true]) .value-box-grid .value-box-area{grid-area:right}.bslib-value-box.showcase-bottom .value-box-grid{grid-template-columns:1fr;grid-template-rows:1fr var(---bslib-value-box-showcase-h, auto);grid-template-areas:"top" "bottom";overflow:hidden}.bslib-value-box.showcase-bottom .value-box-grid .value-box-showcase{grid-area:bottom;padding:0;margin:0}.bslib-value-box.showcase-bottom .value-box-grid .value-box-area{grid-area:top}.bslib-value-box.showcase-bottom[data-full-screen=true] .value-box-grid{grid-template-rows:1fr var(---bslib-value-box-showcase-h-fs, 2fr)}.bslib-value-box.showcase-bottom[data-full-screen=true] .value-box-grid .value-box-showcase{padding:1rem}[data-bs-theme=dark] .bslib-value-box{--bslib-value-box-shadow: 0 0.5rem 1rem rgb(0 0 0 / 50%)}@media(min-width: 576px){.nav:not(.nav-hidden){display:flex !important;display:-webkit-flex !important}.nav:not(.nav-hidden):not(.nav-stacked):not(.flex-column){float:none !important}.nav:not(.nav-hidden):not(.nav-stacked):not(.flex-column)>.bslib-nav-spacer{margin-left:auto !important}.nav:not(.nav-hidden):not(.nav-stacked):not(.flex-column)>.form-inline{margin-top:auto;margin-bottom:auto}.nav:not(.nav-hidden).nav-stacked{flex-direction:column;-webkit-flex-direction:column;height:100%}.nav:not(.nav-hidden).nav-stacked>.bslib-nav-spacer{margin-top:auto !important}}.bslib-card{overflow:auto}.bslib-card .card-body+.card-body{padding-top:0}.bslib-card .card-body{overflow:auto}.bslib-card .card-body p{margin-top:0}.bslib-card .card-body p:last-child{margin-bottom:0}.bslib-card .card-body{max-height:var(--bslib-card-body-max-height, none)}.bslib-card[data-full-screen=true]>.card-body{max-height:var(--bslib-card-body-max-height-full-screen, none)}.bslib-card .card-header .form-group{margin-bottom:0}.bslib-card .card-header .selectize-control{margin-bottom:0}.bslib-card .card-header .selectize-control .item{margin-right:1.15rem}.bslib-card .card-footer{margin-top:auto}.bslib-card .bslib-navs-card-title{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center}.bslib-card .bslib-navs-card-title .nav{margin-left:auto}.bslib-card .bslib-sidebar-layout:not([data-bslib-sidebar-border=true]){border:none}.bslib-card .bslib-sidebar-layout:not([data-bslib-sidebar-border-radius=true]){border-top-left-radius:0;border-top-right-radius:0}[data-full-screen=true]{position:fixed;inset:3.5rem 1rem 1rem;height:auto !important;max-height:none !important;width:auto !important;z-index:1070}.bslib-full-screen-enter{display:none;position:absolute;bottom:var(--bslib-full-screen-enter-bottom, 0.2rem);right:var(--bslib-full-screen-enter-right, 0);top:var(--bslib-full-screen-enter-top);left:var(--bslib-full-screen-enter-left);color:var(--bslib-color-fg, var(--bs-card-color));background-color:var(--bslib-color-bg, var(--bs-card-bg, var(--bs-body-bg)));border:var(--bs-card-border-width) solid var(--bslib-color-fg, var(--bs-card-border-color));box-shadow:0 2px 4px rgba(0,0,0,.15);margin:.2rem .4rem;padding:.55rem !important;font-size:.8rem;cursor:pointer;opacity:.7;z-index:1070}.bslib-full-screen-enter:hover{opacity:1}.card[data-full-screen=false]:hover>*>.bslib-full-screen-enter{display:block}.bslib-has-full-screen .card:hover>*>.bslib-full-screen-enter{display:none}@media(max-width: 575.98px){.bslib-full-screen-enter{display:none !important}}.bslib-full-screen-exit{position:relative;top:1.35rem;font-size:.9rem;cursor:pointer;text-decoration:none;display:flex;float:right;margin-right:2.15rem;align-items:center;color:rgba(var(--bs-body-bg-rgb), 0.8)}.bslib-full-screen-exit:hover{color:rgba(var(--bs-body-bg-rgb), 1)}.bslib-full-screen-exit svg{margin-left:.5rem;font-size:1.5rem}#bslib-full-screen-overlay{position:fixed;inset:0;background-color:rgba(var(--bs-body-color-rgb), 0.6);backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);z-index:1069;animation:bslib-full-screen-overlay-enter 400ms cubic-bezier(0.6, 0.02, 0.65, 1) forwards}@keyframes bslib-full-screen-overlay-enter{0%{opacity:0}100%{opacity:1}}.bslib-grid{display:grid !important;gap:var(--bslib-spacer, 1rem);height:var(--bslib-grid-height)}.bslib-grid.grid{grid-template-columns:repeat(var(--bs-columns, 12), minmax(0, 1fr));grid-template-rows:unset;grid-auto-rows:var(--bslib-grid--row-heights);--bslib-grid--row-heights--xs: unset;--bslib-grid--row-heights--sm: unset;--bslib-grid--row-heights--md: unset;--bslib-grid--row-heights--lg: unset;--bslib-grid--row-heights--xl: unset;--bslib-grid--row-heights--xxl: unset}.bslib-grid.grid.bslib-grid--row-heights--xs{--bslib-grid--row-heights: var(--bslib-grid--row-heights--xs)}@media(min-width: 576px){.bslib-grid.grid.bslib-grid--row-heights--sm{--bslib-grid--row-heights: var(--bslib-grid--row-heights--sm)}}@media(min-width: 768px){.bslib-grid.grid.bslib-grid--row-heights--md{--bslib-grid--row-heights: var(--bslib-grid--row-heights--md)}}@media(min-width: 992px){.bslib-grid.grid.bslib-grid--row-heights--lg{--bslib-grid--row-heights: var(--bslib-grid--row-heights--lg)}}@media(min-width: 1200px){.bslib-grid.grid.bslib-grid--row-heights--xl{--bslib-grid--row-heights: var(--bslib-grid--row-heights--xl)}}@media(min-width: 1400px){.bslib-grid.grid.bslib-grid--row-heights--xxl{--bslib-grid--row-heights: var(--bslib-grid--row-heights--xxl)}}.bslib-grid>*>.shiny-input-container{width:100%}.bslib-grid-item{grid-column:auto/span 1}@media(max-width: 767.98px){.bslib-grid-item{grid-column:1/-1}}@media(max-width: 575.98px){.bslib-grid{grid-template-columns:1fr !important;height:var(--bslib-grid-height-mobile)}.bslib-grid.grid{height:unset !important;grid-auto-rows:var(--bslib-grid--row-heights--xs, auto)}}.accordion .accordion-header{font-size:calc(1.29rem + 0.48vw);margin-top:0;margin-bottom:.5rem;font-weight:500;line-height:1.2;color:var(--bs-heading-color);margin-bottom:0}@media(min-width: 1200px){.accordion .accordion-header{font-size:1.65rem}}.accordion .accordion-icon:not(:empty){margin-right:.75rem;display:flex}.accordion .accordion-button:not(.collapsed){box-shadow:none}.accordion .accordion-button:not(.collapsed):focus{box-shadow:var(--bs-accordion-btn-focus-box-shadow)}.navbar+.container-fluid:has(>.tab-content>.tab-pane.active.html-fill-container),.navbar+.container-sm:has(>.tab-content>.tab-pane.active.html-fill-container),.navbar+.container-md:has(>.tab-content>.tab-pane.active.html-fill-container),.navbar+.container-lg:has(>.tab-content>.tab-pane.active.html-fill-container),.navbar+.container-xl:has(>.tab-content>.tab-pane.active.html-fill-container),.navbar+.container-xxl:has(>.tab-content>.tab-pane.active.html-fill-container){padding-left:0;padding-right:0}.navbar+.container-fluid>.tab-content>.tab-pane.active.html-fill-container,.navbar+.container-sm>.tab-content>.tab-pane.active.html-fill-container,.navbar+.container-md>.tab-content>.tab-pane.active.html-fill-container,.navbar+.container-lg>.tab-content>.tab-pane.active.html-fill-container,.navbar+.container-xl>.tab-content>.tab-pane.active.html-fill-container,.navbar+.container-xxl>.tab-content>.tab-pane.active.html-fill-container{padding:var(--bslib-spacer, 1rem);gap:var(--bslib-spacer, 1rem)}.navbar+.container-fluid>.tab-content>.tab-pane.active.html-fill-container:has(>.bslib-sidebar-layout:only-child),.navbar+.container-sm>.tab-content>.tab-pane.active.html-fill-container:has(>.bslib-sidebar-layout:only-child),.navbar+.container-md>.tab-content>.tab-pane.active.html-fill-container:has(>.bslib-sidebar-layout:only-child),.navbar+.container-lg>.tab-content>.tab-pane.active.html-fill-container:has(>.bslib-sidebar-layout:only-child),.navbar+.container-xl>.tab-content>.tab-pane.active.html-fill-container:has(>.bslib-sidebar-layout:only-child),.navbar+.container-xxl>.tab-content>.tab-pane.active.html-fill-container:has(>.bslib-sidebar-layout:only-child){padding:0}.navbar+.container-fluid>.tab-content>.tab-pane.active.html-fill-container>.bslib-sidebar-layout:only-child:not([data-bslib-sidebar-border=true]),.navbar+.container-sm>.tab-content>.tab-pane.active.html-fill-container>.bslib-sidebar-layout:only-child:not([data-bslib-sidebar-border=true]),.navbar+.container-md>.tab-content>.tab-pane.active.html-fill-container>.bslib-sidebar-layout:only-child:not([data-bslib-sidebar-border=true]),.navbar+.container-lg>.tab-content>.tab-pane.active.html-fill-container>.bslib-sidebar-layout:only-child:not([data-bslib-sidebar-border=true]),.navbar+.container-xl>.tab-content>.tab-pane.active.html-fill-container>.bslib-sidebar-layout:only-child:not([data-bslib-sidebar-border=true]),.navbar+.container-xxl>.tab-content>.tab-pane.active.html-fill-container>.bslib-sidebar-layout:only-child:not([data-bslib-sidebar-border=true]){border-left:none;border-right:none;border-bottom:none}.navbar+.container-fluid>.tab-content>.tab-pane.active.html-fill-container>.bslib-sidebar-layout:only-child:not([data-bslib-sidebar-border-radius=true]),.navbar+.container-sm>.tab-content>.tab-pane.active.html-fill-container>.bslib-sidebar-layout:only-child:not([data-bslib-sidebar-border-radius=true]),.navbar+.container-md>.tab-content>.tab-pane.active.html-fill-container>.bslib-sidebar-layout:only-child:not([data-bslib-sidebar-border-radius=true]),.navbar+.container-lg>.tab-content>.tab-pane.active.html-fill-container>.bslib-sidebar-layout:only-child:not([data-bslib-sidebar-border-radius=true]),.navbar+.container-xl>.tab-content>.tab-pane.active.html-fill-container>.bslib-sidebar-layout:only-child:not([data-bslib-sidebar-border-radius=true]),.navbar+.container-xxl>.tab-content>.tab-pane.active.html-fill-container>.bslib-sidebar-layout:only-child:not([data-bslib-sidebar-border-radius=true]){border-radius:0}.navbar+div>.bslib-sidebar-layout{border-top:var(--bslib-sidebar-border)}html{height:100%}.bslib-page-fill{width:100%;height:100%;margin:0;padding:var(--bslib-spacer, 1rem);gap:var(--bslib-spacer, 1rem)}@media(max-width: 575.98px){.bslib-page-fill{height:var(--bslib-page-fill-mobile-height, auto)}}:root{--bslib-page-sidebar-title-bg: #517699;--bslib-page-sidebar-title-color: #ffffff}.bslib-page-title{background-color:var(--bslib-page-sidebar-title-bg);color:var(--bslib-page-sidebar-title-color);font-size:1.25rem;font-weight:300;padding:var(--bslib-spacer, 1rem);padding-left:1.5rem;margin-bottom:0;border-bottom:1px solid #dee2e6}.bslib-sidebar-layout{--bslib-sidebar-transition-duration: 500ms;--bslib-sidebar-transition-easing-x: cubic-bezier(0.8, 0.78, 0.22, 1.07);--bslib-sidebar-border: var(--bs-card-border-width, 1px) solid var(--bs-card-border-color, rgba(0, 0, 0, 0.175));--bslib-sidebar-border-radius: var(--bs-border-radius);--bslib-sidebar-vert-border: var(--bs-card-border-width, 1px) solid var(--bs-card-border-color, rgba(0, 0, 0, 0.175));--bslib-sidebar-bg: rgba(var(--bs-emphasis-color-rgb, 0, 0, 0), 0.05);--bslib-sidebar-fg: var(--bs-emphasis-color, black);--bslib-sidebar-main-fg: var(--bs-card-color, var(--bs-body-color));--bslib-sidebar-main-bg: var(--bs-card-bg, var(--bs-body-bg));--bslib-sidebar-toggle-bg: rgba(var(--bs-emphasis-color-rgb, 0, 0, 0), 0.1);--bslib-sidebar-padding: calc(var(--bslib-spacer) * 1.5);--bslib-sidebar-icon-size: var(--bslib-spacer, 1rem);--bslib-sidebar-icon-button-size: calc(var(--bslib-sidebar-icon-size, 1rem) * 2);--bslib-sidebar-padding-icon: calc(var(--bslib-sidebar-icon-button-size, 2rem) * 1.5);--bslib-collapse-toggle-border-radius: var(--bs-border-radius, 0.375rem);--bslib-collapse-toggle-transform: 0deg;--bslib-sidebar-toggle-transition-easing: cubic-bezier(1, 0, 0, 1);--bslib-collapse-toggle-right-transform: 180deg;--bslib-sidebar-column-main: minmax(0, 1fr);display:grid !important;grid-template-columns:min(100% - var(--bslib-sidebar-icon-size),var(--bslib-sidebar-width, 250px)) var(--bslib-sidebar-column-main);position:relative;transition:grid-template-columns ease-in-out var(--bslib-sidebar-transition-duration);border:var(--bslib-sidebar-border);border-radius:var(--bslib-sidebar-border-radius)}@media(prefers-reduced-motion: reduce){.bslib-sidebar-layout{transition:none}}.bslib-sidebar-layout[data-bslib-sidebar-border=false]{border:none}.bslib-sidebar-layout[data-bslib-sidebar-border-radius=false]{border-radius:initial}.bslib-sidebar-layout>.main,.bslib-sidebar-layout>.sidebar{grid-row:1/2;border-radius:inherit;overflow:auto}.bslib-sidebar-layout>.main{grid-column:2/3;border-top-left-radius:0;border-bottom-left-radius:0;padding:var(--bslib-sidebar-padding);transition:padding var(--bslib-sidebar-transition-easing-x) var(--bslib-sidebar-transition-duration);color:var(--bslib-sidebar-main-fg);background-color:var(--bslib-sidebar-main-bg)}.bslib-sidebar-layout>.sidebar{grid-column:1/2;width:100%;height:100%;border-right:var(--bslib-sidebar-vert-border);border-top-right-radius:0;border-bottom-right-radius:0;color:var(--bslib-sidebar-fg);background-color:var(--bslib-sidebar-bg);backdrop-filter:blur(5px)}.bslib-sidebar-layout>.sidebar>.sidebar-content{display:flex;flex-direction:column;gap:var(--bslib-spacer, 1rem);padding:var(--bslib-sidebar-padding);padding-top:var(--bslib-sidebar-padding-icon)}.bslib-sidebar-layout>.sidebar>.sidebar-content>:last-child:not(.sidebar-title){margin-bottom:0}.bslib-sidebar-layout>.sidebar>.sidebar-content>.accordion{margin-left:calc(-1*var(--bslib-sidebar-padding));margin-right:calc(-1*var(--bslib-sidebar-padding))}.bslib-sidebar-layout>.sidebar>.sidebar-content>.accordion:last-child{margin-bottom:calc(-1*var(--bslib-sidebar-padding))}.bslib-sidebar-layout>.sidebar>.sidebar-content>.accordion:not(:last-child){margin-bottom:1rem}.bslib-sidebar-layout>.sidebar>.sidebar-content>.accordion .accordion-body{display:flex;flex-direction:column}.bslib-sidebar-layout>.sidebar>.sidebar-content>.accordion:not(:first-child) .accordion-item:first-child{border-top:var(--bs-accordion-border-width) solid var(--bs-accordion-border-color)}.bslib-sidebar-layout>.sidebar>.sidebar-content>.accordion:not(:last-child) .accordion-item:last-child{border-bottom:var(--bs-accordion-border-width) solid var(--bs-accordion-border-color)}.bslib-sidebar-layout>.sidebar>.sidebar-content.has-accordion>.sidebar-title{border-bottom:none;padding-bottom:0}.bslib-sidebar-layout>.sidebar .shiny-input-container{width:100%}.bslib-sidebar-layout[data-bslib-sidebar-open=always]>.sidebar>.sidebar-content{padding-top:var(--bslib-sidebar-padding)}.bslib-sidebar-layout>.collapse-toggle{grid-row:1/2;grid-column:1/2;display:inline-flex;align-items:center;position:absolute;right:calc(var(--bslib-sidebar-icon-size));top:calc(var(--bslib-sidebar-icon-size, 1rem)/2);border:none;border-radius:var(--bslib-collapse-toggle-border-radius);height:var(--bslib-sidebar-icon-button-size, 2rem);width:var(--bslib-sidebar-icon-button-size, 2rem);display:flex;align-items:center;justify-content:center;padding:0;color:var(--bslib-sidebar-fg);background-color:unset;transition:color var(--bslib-sidebar-transition-easing-x) var(--bslib-sidebar-transition-duration),top var(--bslib-sidebar-transition-easing-x) var(--bslib-sidebar-transition-duration),right var(--bslib-sidebar-transition-easing-x) var(--bslib-sidebar-transition-duration),left var(--bslib-sidebar-transition-easing-x) var(--bslib-sidebar-transition-duration)}.bslib-sidebar-layout>.collapse-toggle:hover{background-color:var(--bslib-sidebar-toggle-bg)}.bslib-sidebar-layout>.collapse-toggle>.collapse-icon{opacity:.8;width:var(--bslib-sidebar-icon-size);height:var(--bslib-sidebar-icon-size);transform:rotateY(var(--bslib-collapse-toggle-transform));transition:transform var(--bslib-sidebar-toggle-transition-easing) var(--bslib-sidebar-transition-duration)}.bslib-sidebar-layout>.collapse-toggle:hover>.collapse-icon{opacity:1}.bslib-sidebar-layout .sidebar-title{font-size:1.25rem;line-height:1.25;margin-top:0;margin-bottom:1rem;padding-bottom:1rem;border-bottom:var(--bslib-sidebar-border)}.bslib-sidebar-layout.sidebar-right{grid-template-columns:var(--bslib-sidebar-column-main) min(100% - var(--bslib-sidebar-icon-size),var(--bslib-sidebar-width, 250px))}.bslib-sidebar-layout.sidebar-right>.main{grid-column:1/2;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:inherit;border-bottom-left-radius:inherit}.bslib-sidebar-layout.sidebar-right>.sidebar{grid-column:2/3;border-right:none;border-left:var(--bslib-sidebar-vert-border);border-top-left-radius:0;border-bottom-left-radius:0}.bslib-sidebar-layout.sidebar-right>.collapse-toggle{grid-column:2/3;left:var(--bslib-sidebar-icon-size);right:unset;border:var(--bslib-collapse-toggle-border)}.bslib-sidebar-layout.sidebar-right>.collapse-toggle>.collapse-icon{transform:rotateY(var(--bslib-collapse-toggle-right-transform))}.bslib-sidebar-layout.sidebar-collapsed{--bslib-collapse-toggle-transform: 180deg;--bslib-collapse-toggle-right-transform: 0deg;--bslib-sidebar-vert-border: none;grid-template-columns:0 minmax(0, 1fr)}.bslib-sidebar-layout.sidebar-collapsed.sidebar-right{grid-template-columns:minmax(0, 1fr) 0}.bslib-sidebar-layout.sidebar-collapsed:not(.transitioning)>.sidebar>*{display:none}.bslib-sidebar-layout.sidebar-collapsed>.main{border-radius:inherit}.bslib-sidebar-layout.sidebar-collapsed:not(.sidebar-right)>.main{padding-left:var(--bslib-sidebar-padding-icon)}.bslib-sidebar-layout.sidebar-collapsed.sidebar-right>.main{padding-right:var(--bslib-sidebar-padding-icon)}.bslib-sidebar-layout.sidebar-collapsed>.collapse-toggle{color:var(--bslib-sidebar-main-fg);top:calc(var(--bslib-sidebar-overlap-counter, 0)*(var(--bslib-sidebar-icon-size) + var(--bslib-sidebar-padding)) + var(--bslib-sidebar-icon-size, 1rem)/2);right:calc(-2.5*var(--bslib-sidebar-icon-size) - var(--bs-card-border-width, 1px))}.bslib-sidebar-layout.sidebar-collapsed.sidebar-right>.collapse-toggle{left:calc(-2.5*var(--bslib-sidebar-icon-size) - var(--bs-card-border-width, 1px));right:unset}@media(min-width: 576px){.bslib-sidebar-layout.transitioning>.sidebar>.sidebar-content{display:none}}@media(max-width: 575.98px){.bslib-sidebar-layout[data-bslib-sidebar-open=desktop]{--bslib-sidebar-js-init-collapsed: true}.bslib-sidebar-layout>.sidebar,.bslib-sidebar-layout.sidebar-right>.sidebar{border:none}.bslib-sidebar-layout>.main,.bslib-sidebar-layout.sidebar-right>.main{grid-column:1/3}.bslib-sidebar-layout[data-bslib-sidebar-open=always]{display:block !important}.bslib-sidebar-layout[data-bslib-sidebar-open=always]>.sidebar{max-height:var(--bslib-sidebar-max-height-mobile);overflow-y:auto;border-top:var(--bslib-sidebar-vert-border)}.bslib-sidebar-layout:not([data-bslib-sidebar-open=always]){grid-template-columns:100% 0}.bslib-sidebar-layout:not([data-bslib-sidebar-open=always]):not(.sidebar-collapsed)>.sidebar{z-index:1}.bslib-sidebar-layout:not([data-bslib-sidebar-open=always]):not(.sidebar-collapsed)>.collapse-toggle{z-index:1}.bslib-sidebar-layout:not([data-bslib-sidebar-open=always]).sidebar-right{grid-template-columns:0 100%}.bslib-sidebar-layout:not([data-bslib-sidebar-open=always]).sidebar-collapsed{grid-template-columns:0 100%}.bslib-sidebar-layout:not([data-bslib-sidebar-open=always]).sidebar-collapsed.sidebar-right{grid-template-columns:100% 0}.bslib-sidebar-layout:not([data-bslib-sidebar-open=always]):not(.sidebar-right)>.main{padding-left:var(--bslib-sidebar-padding-icon)}.bslib-sidebar-layout:not([data-bslib-sidebar-open=always]).sidebar-right>.main{padding-right:var(--bslib-sidebar-padding-icon)}.bslib-sidebar-layout:not([data-bslib-sidebar-open=always])>.main{opacity:0;transition:opacity var(--bslib-sidebar-transition-easing-x) var(--bslib-sidebar-transition-duration)}.bslib-sidebar-layout:not([data-bslib-sidebar-open=always]).sidebar-collapsed>.main{opacity:1}}.html-fill-container{display:flex;flex-direction:column;min-height:0;min-width:0}.html-fill-container>.html-fill-item{flex:1 1 auto;min-height:0;min-width:0}.html-fill-container>:not(.html-fill-item){flex:0 0 auto}.tippy-box[data-theme~=quarto]{background-color:#fff;border:solid 1px #dee2e6;border-radius:.375rem;color:#212529;font-size:.875rem}.tippy-box[data-theme~=quarto]>.tippy-backdrop{background-color:#fff}.tippy-box[data-theme~=quarto]>.tippy-arrow:after,.tippy-box[data-theme~=quarto]>.tippy-svg-arrow:after{content:"";position:absolute;z-index:-1}.tippy-box[data-theme~=quarto]>.tippy-arrow:after{border-color:rgba(0,0,0,0);border-style:solid}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-6px}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-6px}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-6px}.tippy-box[data-placement^=left]>.tippy-arrow:before{right:-6px}.tippy-box[data-theme~=quarto][data-placement^=top]>.tippy-arrow:before{border-top-color:#fff}.tippy-box[data-theme~=quarto][data-placement^=top]>.tippy-arrow:after{border-top-color:#dee2e6;border-width:7px 7px 0;top:17px;left:1px}.tippy-box[data-theme~=quarto][data-placement^=top]>.tippy-svg-arrow>svg{top:16px}.tippy-box[data-theme~=quarto][data-placement^=top]>.tippy-svg-arrow:after{top:17px}.tippy-box[data-theme~=quarto][data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:#fff;bottom:16px}.tippy-box[data-theme~=quarto][data-placement^=bottom]>.tippy-arrow:after{border-bottom-color:#dee2e6;border-width:0 7px 7px;bottom:17px;left:1px}.tippy-box[data-theme~=quarto][data-placement^=bottom]>.tippy-svg-arrow>svg{bottom:15px}.tippy-box[data-theme~=quarto][data-placement^=bottom]>.tippy-svg-arrow:after{bottom:17px}.tippy-box[data-theme~=quarto][data-placement^=left]>.tippy-arrow:before{border-left-color:#fff}.tippy-box[data-theme~=quarto][data-placement^=left]>.tippy-arrow:after{border-left-color:#dee2e6;border-width:7px 0 7px 7px;left:17px;top:1px}.tippy-box[data-theme~=quarto][data-placement^=left]>.tippy-svg-arrow>svg{left:11px}.tippy-box[data-theme~=quarto][data-placement^=left]>.tippy-svg-arrow:after{left:12px}.tippy-box[data-theme~=quarto][data-placement^=right]>.tippy-arrow:before{border-right-color:#fff;right:16px}.tippy-box[data-theme~=quarto][data-placement^=right]>.tippy-arrow:after{border-width:7px 7px 7px 0;right:17px;top:1px;border-right-color:#dee2e6}.tippy-box[data-theme~=quarto][data-placement^=right]>.tippy-svg-arrow>svg{right:11px}.tippy-box[data-theme~=quarto][data-placement^=right]>.tippy-svg-arrow:after{right:12px}.tippy-box[data-theme~=quarto]>.tippy-svg-arrow{fill:#212529}.tippy-box[data-theme~=quarto]>.tippy-svg-arrow:after{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMCA2czEuNzk2LS4wMTMgNC42Ny0zLjYxNUM1Ljg1MS45IDYuOTMuMDA2IDggMGMxLjA3LS4wMDYgMi4xNDguODg3IDMuMzQzIDIuMzg1QzE0LjIzMyA2LjAwNSAxNiA2IDE2IDZIMHoiIGZpbGw9InJnYmEoMCwgOCwgMTYsIDAuMikiLz48L3N2Zz4=);background-size:16px 6px;width:16px;height:6px}.top-right{position:absolute;top:1em;right:1em}.visually-hidden{border:0;clip:rect(0 0 0 0);height:auto;margin:0;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none !important}.zindex-bottom{z-index:-1 !important}figure.figure{display:block}.quarto-layout-panel{margin-bottom:1em}.quarto-layout-panel>figure{width:100%}.quarto-layout-panel>figure>figcaption,.quarto-layout-panel>.panel-caption{margin-top:10pt}.quarto-layout-panel>.table-caption{margin-top:0px}.table-caption p{margin-bottom:.5em}.quarto-layout-row{display:flex;flex-direction:row;align-items:flex-start}.quarto-layout-valign-top{align-items:flex-start}.quarto-layout-valign-bottom{align-items:flex-end}.quarto-layout-valign-center{align-items:center}.quarto-layout-cell{position:relative;margin-right:20px}.quarto-layout-cell:last-child{margin-right:0}.quarto-layout-cell figure,.quarto-layout-cell>p{margin:.2em}.quarto-layout-cell img{max-width:100%}.quarto-layout-cell .html-widget{width:100% !important}.quarto-layout-cell div figure p{margin:0}.quarto-layout-cell figure{display:block;margin-inline-start:0;margin-inline-end:0}.quarto-layout-cell table{display:inline-table}.quarto-layout-cell-subref figcaption,figure .quarto-layout-row figure figcaption{text-align:center;font-style:italic}.quarto-figure{position:relative;margin-bottom:1em}.quarto-figure>figure{width:100%;margin-bottom:0}.quarto-figure-left>figure>p,.quarto-figure-left>figure>div{text-align:left}.quarto-figure-center>figure>p,.quarto-figure-center>figure>div{text-align:center}.quarto-figure-right>figure>p,.quarto-figure-right>figure>div{text-align:right}.quarto-figure>figure>div.cell-annotation,.quarto-figure>figure>div code{text-align:left}figure>p:empty{display:none}figure>p:first-child{margin-top:0;margin-bottom:0}figure>figcaption.quarto-float-caption-bottom{margin-bottom:.5em}figure>figcaption.quarto-float-caption-top{margin-top:.5em}div[id^=tbl-]{position:relative}.quarto-figure>.anchorjs-link{position:absolute;top:.6em;right:.5em}div[id^=tbl-]>.anchorjs-link{position:absolute;top:.7em;right:.3em}.quarto-figure:hover>.anchorjs-link,div[id^=tbl-]:hover>.anchorjs-link,h2:hover>.anchorjs-link,.h2:hover>.anchorjs-link,h3:hover>.anchorjs-link,.h3:hover>.anchorjs-link,h4:hover>.anchorjs-link,.h4:hover>.anchorjs-link,h5:hover>.anchorjs-link,.h5:hover>.anchorjs-link,h6:hover>.anchorjs-link,.h6:hover>.anchorjs-link,.reveal-anchorjs-link>.anchorjs-link{opacity:1}#title-block-header{margin-block-end:1rem;position:relative;margin-top:-1px}#title-block-header .abstract{margin-block-start:1rem}#title-block-header .abstract .abstract-title{font-weight:600}#title-block-header a{text-decoration:none}#title-block-header .author,#title-block-header .date,#title-block-header .doi{margin-block-end:.2rem}#title-block-header .quarto-title-block>div{display:flex}#title-block-header .quarto-title-block>div>h1,#title-block-header .quarto-title-block>div>.h1{flex-grow:1}#title-block-header .quarto-title-block>div>button{flex-shrink:0;height:2.25rem;margin-top:0}@media(min-width: 992px){#title-block-header .quarto-title-block>div>button{margin-top:5px}}tr.header>th>p:last-of-type{margin-bottom:0px}table,table.table{margin-top:.5rem;margin-bottom:.5rem}caption,.table-caption{padding-top:.5rem;padding-bottom:.5rem;text-align:center}figure.quarto-float-tbl figcaption.quarto-float-caption-top{margin-top:.5rem;margin-bottom:.25rem;text-align:center}figure.quarto-float-tbl figcaption.quarto-float-caption-bottom{padding-top:.25rem;margin-bottom:.5rem;text-align:center}.utterances{max-width:none;margin-left:-8px}iframe{margin-bottom:1em}details{margin-bottom:1em}details[show]{margin-bottom:0}details>summary{color:rgba(33,37,41,.75)}details>summary>p:only-child{display:inline}pre.sourceCode,code.sourceCode{position:relative}dd code:not(.sourceCode),p code:not(.sourceCode){white-space:pre-wrap}code{white-space:pre}@media print{code{white-space:pre-wrap}}pre>code{display:block}pre>code.sourceCode{white-space:pre}pre>code.sourceCode>span>a:first-child::before{text-decoration:none}pre.code-overflow-wrap>code.sourceCode{white-space:pre-wrap}pre.code-overflow-scroll>code.sourceCode{white-space:pre}code a:any-link{color:inherit;text-decoration:none}code a:hover{color:inherit;text-decoration:underline}ul.task-list{padding-left:1em}[data-tippy-root]{display:inline-block}.tippy-content .footnote-back{display:none}.footnote-back{margin-left:.2em}.tippy-content{overflow-x:auto}.quarto-embedded-source-code{display:none}.quarto-unresolved-ref{font-weight:600}.quarto-cover-image{max-width:35%;float:right;margin-left:30px}.cell-output-display .widget-subarea{margin-bottom:1em}.cell-output-display:not(.no-overflow-x),.knitsql-table:not(.no-overflow-x){overflow-x:auto}.panel-input{margin-bottom:1em}.panel-input>div,.panel-input>div>div{display:inline-block;vertical-align:top;padding-right:12px}.panel-input>p:last-child{margin-bottom:0}.layout-sidebar{margin-bottom:1em}.layout-sidebar .tab-content{border:none}.tab-content>.page-columns.active{display:grid}div.sourceCode>iframe{width:100%;height:300px;margin-bottom:-0.5em}a{text-underline-offset:3px}div.ansi-escaped-output{font-family:monospace;display:block}/*! +* +* ansi colors from IPython notebook's +* +* we also add `bright-[color]-` synonyms for the `-[color]-intense` classes since +* that seems to be what ansi_up emits +* +*/.ansi-black-fg{color:#3e424d}.ansi-black-bg{background-color:#3e424d}.ansi-black-intense-black,.ansi-bright-black-fg{color:#282c36}.ansi-black-intense-black,.ansi-bright-black-bg{background-color:#282c36}.ansi-red-fg{color:#e75c58}.ansi-red-bg{background-color:#e75c58}.ansi-red-intense-red,.ansi-bright-red-fg{color:#b22b31}.ansi-red-intense-red,.ansi-bright-red-bg{background-color:#b22b31}.ansi-green-fg{color:#00a250}.ansi-green-bg{background-color:#00a250}.ansi-green-intense-green,.ansi-bright-green-fg{color:#007427}.ansi-green-intense-green,.ansi-bright-green-bg{background-color:#007427}.ansi-yellow-fg{color:#ddb62b}.ansi-yellow-bg{background-color:#ddb62b}.ansi-yellow-intense-yellow,.ansi-bright-yellow-fg{color:#b27d12}.ansi-yellow-intense-yellow,.ansi-bright-yellow-bg{background-color:#b27d12}.ansi-blue-fg{color:#208ffb}.ansi-blue-bg{background-color:#208ffb}.ansi-blue-intense-blue,.ansi-bright-blue-fg{color:#0065ca}.ansi-blue-intense-blue,.ansi-bright-blue-bg{background-color:#0065ca}.ansi-magenta-fg{color:#d160c4}.ansi-magenta-bg{background-color:#d160c4}.ansi-magenta-intense-magenta,.ansi-bright-magenta-fg{color:#a03196}.ansi-magenta-intense-magenta,.ansi-bright-magenta-bg{background-color:#a03196}.ansi-cyan-fg{color:#60c6c8}.ansi-cyan-bg{background-color:#60c6c8}.ansi-cyan-intense-cyan,.ansi-bright-cyan-fg{color:#258f8f}.ansi-cyan-intense-cyan,.ansi-bright-cyan-bg{background-color:#258f8f}.ansi-white-fg{color:#c5c1b4}.ansi-white-bg{background-color:#c5c1b4}.ansi-white-intense-white,.ansi-bright-white-fg{color:#a1a6b2}.ansi-white-intense-white,.ansi-bright-white-bg{background-color:#a1a6b2}.ansi-default-inverse-fg{color:#fff}.ansi-default-inverse-bg{background-color:#000}.ansi-bold{font-weight:bold}.ansi-underline{text-decoration:underline}:root{--quarto-body-bg: #ffffff;--quarto-body-color: #212529;--quarto-text-muted: rgba(33, 37, 41, 0.75);--quarto-border-color: #dee2e6;--quarto-border-width: 1px;--quarto-border-radius: 0.375rem}table.gt_table{color:var(--quarto-body-color);font-size:1em;width:100%;background-color:rgba(0,0,0,0);border-top-width:inherit;border-bottom-width:inherit;border-color:var(--quarto-border-color)}table.gt_table th.gt_column_spanner_outer{color:var(--quarto-body-color);background-color:rgba(0,0,0,0);border-top-width:inherit;border-bottom-width:inherit;border-color:var(--quarto-border-color)}table.gt_table th.gt_col_heading{color:var(--quarto-body-color);font-weight:bold;background-color:rgba(0,0,0,0)}table.gt_table thead.gt_col_headings{border-bottom:1px solid currentColor;border-top-width:inherit;border-top-color:var(--quarto-border-color)}table.gt_table thead.gt_col_headings:not(:first-child){border-top-width:1px;border-top-color:var(--quarto-border-color)}table.gt_table td.gt_row{border-bottom-width:1px;border-bottom-color:var(--quarto-border-color);border-top-width:0px}table.gt_table tbody.gt_table_body{border-top-width:1px;border-bottom-width:1px;border-bottom-color:var(--quarto-border-color);border-top-color:currentColor}div.columns{display:initial;gap:initial}div.column{display:inline-block;overflow-x:initial;vertical-align:top;width:50%}.code-annotation-tip-content{word-wrap:break-word}.code-annotation-container-hidden{display:none !important}dl.code-annotation-container-grid{display:grid;grid-template-columns:min-content auto}dl.code-annotation-container-grid dt{grid-column:1}dl.code-annotation-container-grid dd{grid-column:2}pre.sourceCode.code-annotation-code{padding-right:0}code.sourceCode .code-annotation-anchor{z-index:100;position:relative;float:right;background-color:rgba(0,0,0,0)}input[type=checkbox]{margin-right:.5ch}:root{--mermaid-bg-color: #ffffff;--mermaid-edge-color: #6c757d;--mermaid-node-fg-color: #212529;--mermaid-fg-color: #212529;--mermaid-fg-color--lighter: #383f45;--mermaid-fg-color--lightest: #4e5862;--mermaid-font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica Neue, Noto Sans, Liberation Sans, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;--mermaid-label-bg-color: #ffffff;--mermaid-label-fg-color: #0d6efd;--mermaid-node-bg-color: rgba(13, 110, 253, 0.1);--mermaid-node-fg-color: #212529}@media print{:root{font-size:11pt}#quarto-sidebar,#TOC,.nav-page{display:none}.page-columns .content{grid-column-start:page-start}.fixed-top{position:relative}.panel-caption,.figure-caption,figcaption{color:#666}}.code-copy-button{position:absolute;top:0;right:0;border:0;margin-top:5px;margin-right:5px;background-color:rgba(0,0,0,0);z-index:3}.code-copy-button:focus{outline:none}.code-copy-button-tooltip{font-size:.75em}pre.sourceCode:hover>.code-copy-button>.bi::before{display:inline-block;height:1rem;width:1rem;content:"";vertical-align:-0.125em;background-image:url('data:image/svg+xml,');background-repeat:no-repeat;background-size:1rem 1rem}pre.sourceCode:hover>.code-copy-button-checked>.bi::before{background-image:url('data:image/svg+xml,')}pre.sourceCode:hover>.code-copy-button:hover>.bi::before{background-image:url('data:image/svg+xml,')}pre.sourceCode:hover>.code-copy-button-checked:hover>.bi::before{background-image:url('data:image/svg+xml,')}main ol ol,main ul ul,main ol ul,main ul ol{margin-bottom:1em}ul>li:not(:has(>p))>ul,ol>li:not(:has(>p))>ul,ul>li:not(:has(>p))>ol,ol>li:not(:has(>p))>ol{margin-bottom:0}ul>li:not(:has(>p))>ul>li:has(>p),ol>li:not(:has(>p))>ul>li:has(>p),ul>li:not(:has(>p))>ol>li:has(>p),ol>li:not(:has(>p))>ol>li:has(>p){margin-top:1rem}body{margin:0}main.page-columns>header>h1.title,main.page-columns>header>.title.h1{margin-bottom:0}@media(min-width: 992px){body .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset] 35px [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(500px, calc(850px - 3em)) [body-content-end] 1.5em [body-end] 35px [body-end-outset] minmax(75px, 145px) [page-end-inset] 35px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.fullcontent:not(.floating):not(.docked) .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset] 35px [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(500px, calc(850px - 3em)) [body-content-end] 1.5em [body-end] 35px [body-end-outset] 35px [page-end-inset page-end] 5fr [screen-end-inset] 1.5em}body.slimcontent:not(.floating):not(.docked) .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset] 35px [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(500px, calc(850px - 3em)) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(0px, 200px) [page-end-inset] 35px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.listing:not(.floating):not(.docked) .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start] minmax(50px, 100px) [page-start-inset] 50px [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(500px, calc(850px - 3em)) [body-content-end] 3em [body-end] 50px [body-end-outset] minmax(0px, 250px) [page-end-inset] minmax(50px, 100px) [page-end] 1fr [screen-end-inset] 1.5em [screen-end]}body:not(.floating):not(.docked) .page-columns.toc-left{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] 35px [page-start-inset] minmax(0px, 175px) [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(450px, calc(800px - 3em)) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(0px, 200px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body:not(.floating):not(.docked) .page-columns.toc-left .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] 35px [page-start-inset] minmax(0px, 175px) [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(450px, calc(800px - 3em)) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(0px, 200px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] minmax(25px, 50px) [page-start-inset] minmax(50px, 150px) [body-start-outset] minmax(25px, 50px) [body-start] 1.5em [body-content-start] minmax(500px, calc(800px - 3em)) [body-content-end] 1.5em [body-end] minmax(25px, 50px) [body-end-outset] minmax(50px, 150px) [page-end-inset] minmax(25px, 50px) [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start] minmax(50px, 100px) [page-start-inset] 50px [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(500px, calc(1000px - 3em)) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(50px, 100px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked.fullcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start] minmax(50px, 100px) [page-start-inset] 50px [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(500px, calc(1000px - 3em)) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating.fullcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] 50px [page-start-inset] minmax(50px, 150px) [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(500px, calc(800px - 3em)) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked.slimcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start] minmax(50px, 100px) [page-start-inset] 50px [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(450px, calc(750px - 3em)) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(0px, 200px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked.listing .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start] minmax(50px, 100px) [page-start-inset] 50px [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(500px, calc(1000px - 3em)) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(0px, 200px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating.slimcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] 50px [page-start-inset] minmax(50px, 150px) [body-start-outset] 50px [body-start] 1.5em [body-content-start] minmax(450px, calc(750px - 3em)) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(50px, 150px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating.listing .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] minmax(25px, 50px) [page-start-inset] minmax(50px, 150px) [body-start-outset] minmax(25px, 50px) [body-start] 1.5em [body-content-start] minmax(500px, calc(800px - 3em)) [body-content-end] 1.5em [body-end] minmax(25px, 50px) [body-end-outset] minmax(50px, 150px) [page-end-inset] minmax(25px, 50px) [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}}@media(max-width: 991.98px){body .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset] 5fr [body-start] 1.5em [body-content-start] minmax(500px, calc(800px - 3em)) [body-content-end] 1.5em [body-end] 35px [body-end-outset] minmax(75px, 145px) [page-end-inset] 35px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.fullcontent:not(.floating):not(.docked) .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset] 5fr [body-start] 1.5em [body-content-start] minmax(500px, calc(800px - 3em)) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.slimcontent:not(.floating):not(.docked) .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset] 5fr [body-start] 1.5em [body-content-start] minmax(500px, calc(800px - 3em)) [body-content-end] 1.5em [body-end] 35px [body-end-outset] minmax(75px, 145px) [page-end-inset] 35px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.listing:not(.floating):not(.docked) .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset] 5fr [body-start] 1.5em [body-content-start] minmax(500px, calc(1250px - 3em)) [body-content-end body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body:not(.floating):not(.docked) .page-columns.toc-left{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] 35px [page-start-inset] minmax(0px, 145px) [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(450px, calc(800px - 3em)) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body:not(.floating):not(.docked) .page-columns.toc-left .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start] 35px [page-start-inset] minmax(0px, 145px) [body-start-outset] 35px [body-start] 1.5em [body-content-start] minmax(450px, calc(800px - 3em)) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset body-start-outset body-start] 1.5em [body-content-start] minmax(500px, calc(750px - 3em)) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(75px, 150px) [page-end-inset] 25px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(500px, calc(750px - 3em)) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(25px, 50px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked.fullcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(500px, calc(1000px - 3em)) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating.fullcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset body-start-outset body-start] 1em [body-content-start] minmax(500px, calc(800px - 3em)) [body-content-end] 1.5em [body-end body-end-outset page-end-inset page-end] 4fr [screen-end-inset] 1.5em [screen-end]}body.docked.slimcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(500px, calc(750px - 3em)) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(25px, 50px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.docked.listing .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(500px, calc(750px - 3em)) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(25px, 50px) [page-end-inset] 50px [page-end] 5fr [screen-end-inset] 1.5em [screen-end]}body.floating.slimcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset body-start-outset body-start] 1em [body-content-start] minmax(500px, calc(750px - 3em)) [body-content-end] 1.5em [body-end] 35px [body-end-outset] minmax(75px, 145px) [page-end-inset] 35px [page-end] 4fr [screen-end-inset] 1.5em [screen-end]}body.floating.listing .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset] 5fr [page-start page-start-inset body-start-outset body-start] 1em [body-content-start] minmax(500px, calc(750px - 3em)) [body-content-end] 1.5em [body-end] 50px [body-end-outset] minmax(75px, 150px) [page-end-inset] 25px [page-end] 4fr [screen-end-inset] 1.5em [screen-end]}}@media(max-width: 767.98px){body .page-columns,body.fullcontent:not(.floating):not(.docked) .page-columns,body.slimcontent:not(.floating):not(.docked) .page-columns,body.docked .page-columns,body.docked.slimcontent .page-columns,body.docked.fullcontent .page-columns,body.floating .page-columns,body.floating.slimcontent .page-columns,body.floating.fullcontent .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(0px, 1fr) [body-content-end body-end body-end-outset page-end-inset page-end screen-end-inset] 1.5em [screen-end]}body:not(.floating):not(.docked) .page-columns.toc-left{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(0px, 1fr) [body-content-end body-end body-end-outset page-end-inset page-end screen-end-inset] 1.5em [screen-end]}body:not(.floating):not(.docked) .page-columns.toc-left .page-columns{display:grid;gap:0;grid-template-columns:[screen-start] 1.5em [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(0px, 1fr) [body-content-end body-end body-end-outset page-end-inset page-end screen-end-inset] 1.5em [screen-end]}nav[role=doc-toc]{display:none}}body,.page-row-navigation{grid-template-rows:[page-top] max-content [contents-top] max-content [contents-bottom] max-content [page-bottom]}.page-rows-contents{grid-template-rows:[content-top] minmax(max-content, 1fr) [content-bottom] minmax(60px, max-content) [page-bottom]}.page-full{grid-column:screen-start/screen-end !important}.page-columns>*{grid-column:body-content-start/body-content-end}.page-columns.column-page>*{grid-column:page-start/page-end}.page-columns.column-page-left .page-columns.page-full>*,.page-columns.column-page-left>*{grid-column:page-start/body-content-end}.page-columns.column-page-right .page-columns.page-full>*,.page-columns.column-page-right>*{grid-column:body-content-start/page-end}.page-rows{grid-auto-rows:auto}.header{grid-column:screen-start/screen-end;grid-row:page-top/contents-top}#quarto-content{padding:0;grid-column:screen-start/screen-end;grid-row:contents-top/contents-bottom}body.floating .sidebar.sidebar-navigation{grid-column:page-start/body-start;grid-row:content-top/page-bottom}body.docked .sidebar.sidebar-navigation{grid-column:screen-start/body-start;grid-row:content-top/page-bottom}.sidebar.toc-left{grid-column:page-start/body-start;grid-row:content-top/page-bottom}.sidebar.margin-sidebar{grid-column:body-end/page-end;grid-row:content-top/page-bottom}.page-columns .content{grid-column:body-content-start/body-content-end;grid-row:content-top/content-bottom;align-content:flex-start}.page-columns .page-navigation{grid-column:body-content-start/body-content-end;grid-row:content-bottom/page-bottom}.page-columns .footer{grid-column:screen-start/screen-end;grid-row:contents-bottom/page-bottom}.page-columns .column-body{grid-column:body-content-start/body-content-end}.page-columns .column-body-fullbleed{grid-column:body-start/body-end}.page-columns .column-body-outset{grid-column:body-start-outset/body-end-outset;z-index:998;opacity:.999}.page-columns .column-body-outset table{background:#fff}.page-columns .column-body-outset-left{grid-column:body-start-outset/body-content-end;z-index:998;opacity:.999}.page-columns .column-body-outset-left table{background:#fff}.page-columns .column-body-outset-right{grid-column:body-content-start/body-end-outset;z-index:998;opacity:.999}.page-columns .column-body-outset-right table{background:#fff}.page-columns .column-page{grid-column:page-start/page-end;z-index:998;opacity:.999}.page-columns .column-page table{background:#fff}.page-columns .column-page-inset{grid-column:page-start-inset/page-end-inset;z-index:998;opacity:.999}.page-columns .column-page-inset table{background:#fff}.page-columns .column-page-inset-left{grid-column:page-start-inset/body-content-end;z-index:998;opacity:.999}.page-columns .column-page-inset-left table{background:#fff}.page-columns .column-page-inset-right{grid-column:body-content-start/page-end-inset;z-index:998;opacity:.999}.page-columns .column-page-inset-right figcaption table{background:#fff}.page-columns .column-page-left{grid-column:page-start/body-content-end;z-index:998;opacity:.999}.page-columns .column-page-left table{background:#fff}.page-columns .column-page-right{grid-column:body-content-start/page-end;z-index:998;opacity:.999}.page-columns .column-page-right figcaption table{background:#fff}#quarto-content.page-columns #quarto-margin-sidebar,#quarto-content.page-columns #quarto-sidebar{z-index:1}@media(max-width: 991.98px){#quarto-content.page-columns #quarto-margin-sidebar.collapse,#quarto-content.page-columns #quarto-sidebar.collapse,#quarto-content.page-columns #quarto-margin-sidebar.collapsing,#quarto-content.page-columns #quarto-sidebar.collapsing{z-index:1055}}#quarto-content.page-columns main.column-page,#quarto-content.page-columns main.column-page-right,#quarto-content.page-columns main.column-page-left{z-index:0}.page-columns .column-screen-inset{grid-column:screen-start-inset/screen-end-inset;z-index:998;opacity:.999}.page-columns .column-screen-inset table{background:#fff}.page-columns .column-screen-inset-left{grid-column:screen-start-inset/body-content-end;z-index:998;opacity:.999}.page-columns .column-screen-inset-left table{background:#fff}.page-columns .column-screen-inset-right{grid-column:body-content-start/screen-end-inset;z-index:998;opacity:.999}.page-columns .column-screen-inset-right table{background:#fff}.page-columns .column-screen{grid-column:screen-start/screen-end;z-index:998;opacity:.999}.page-columns .column-screen table{background:#fff}.page-columns .column-screen-left{grid-column:screen-start/body-content-end;z-index:998;opacity:.999}.page-columns .column-screen-left table{background:#fff}.page-columns .column-screen-right{grid-column:body-content-start/screen-end;z-index:998;opacity:.999}.page-columns .column-screen-right table{background:#fff}.page-columns .column-screen-inset-shaded{grid-column:screen-start/screen-end;padding:1em;background:#f8f9fa;z-index:998;opacity:.999;margin-bottom:1em}.zindex-content{z-index:998;opacity:.999}.zindex-modal{z-index:1055;opacity:.999}.zindex-over-content{z-index:999;opacity:.999}img.img-fluid.column-screen,img.img-fluid.column-screen-inset-shaded,img.img-fluid.column-screen-inset,img.img-fluid.column-screen-inset-left,img.img-fluid.column-screen-inset-right,img.img-fluid.column-screen-left,img.img-fluid.column-screen-right{width:100%}@media(min-width: 992px){.margin-caption,div.aside,aside:not(.footnotes):not(.sidebar),.column-margin{grid-column:body-end/page-end !important;z-index:998}.column-sidebar{grid-column:page-start/body-start !important;z-index:998}.column-leftmargin{grid-column:screen-start-inset/body-start !important;z-index:998}.no-row-height{height:1em;overflow:visible}}@media(max-width: 991.98px){.margin-caption,div.aside,aside:not(.footnotes):not(.sidebar),.column-margin{grid-column:body-end/page-end !important;z-index:998}.no-row-height{height:1em;overflow:visible}.page-columns.page-full{overflow:visible}.page-columns.toc-left .margin-caption,.page-columns.toc-left div.aside,.page-columns.toc-left aside:not(.footnotes):not(.sidebar),.page-columns.toc-left .column-margin{grid-column:body-content-start/body-content-end !important;z-index:998;opacity:.999}.page-columns.toc-left .no-row-height{height:initial;overflow:initial}}@media(max-width: 767.98px){.margin-caption,div.aside,aside:not(.footnotes):not(.sidebar),.column-margin{grid-column:body-content-start/body-content-end !important;z-index:998;opacity:.999}.no-row-height{height:initial;overflow:initial}#quarto-margin-sidebar{display:none}#quarto-sidebar-toc-left{display:none}.hidden-sm{display:none}}.panel-grid{display:grid;grid-template-rows:repeat(1, 1fr);grid-template-columns:repeat(24, 1fr);gap:1em}.panel-grid .g-col-1{grid-column:auto/span 1}.panel-grid .g-col-2{grid-column:auto/span 2}.panel-grid .g-col-3{grid-column:auto/span 3}.panel-grid .g-col-4{grid-column:auto/span 4}.panel-grid .g-col-5{grid-column:auto/span 5}.panel-grid .g-col-6{grid-column:auto/span 6}.panel-grid .g-col-7{grid-column:auto/span 7}.panel-grid .g-col-8{grid-column:auto/span 8}.panel-grid .g-col-9{grid-column:auto/span 9}.panel-grid .g-col-10{grid-column:auto/span 10}.panel-grid .g-col-11{grid-column:auto/span 11}.panel-grid .g-col-12{grid-column:auto/span 12}.panel-grid .g-col-13{grid-column:auto/span 13}.panel-grid .g-col-14{grid-column:auto/span 14}.panel-grid .g-col-15{grid-column:auto/span 15}.panel-grid .g-col-16{grid-column:auto/span 16}.panel-grid .g-col-17{grid-column:auto/span 17}.panel-grid .g-col-18{grid-column:auto/span 18}.panel-grid .g-col-19{grid-column:auto/span 19}.panel-grid .g-col-20{grid-column:auto/span 20}.panel-grid .g-col-21{grid-column:auto/span 21}.panel-grid .g-col-22{grid-column:auto/span 22}.panel-grid .g-col-23{grid-column:auto/span 23}.panel-grid .g-col-24{grid-column:auto/span 24}.panel-grid .g-start-1{grid-column-start:1}.panel-grid .g-start-2{grid-column-start:2}.panel-grid .g-start-3{grid-column-start:3}.panel-grid .g-start-4{grid-column-start:4}.panel-grid .g-start-5{grid-column-start:5}.panel-grid .g-start-6{grid-column-start:6}.panel-grid .g-start-7{grid-column-start:7}.panel-grid .g-start-8{grid-column-start:8}.panel-grid .g-start-9{grid-column-start:9}.panel-grid .g-start-10{grid-column-start:10}.panel-grid .g-start-11{grid-column-start:11}.panel-grid .g-start-12{grid-column-start:12}.panel-grid .g-start-13{grid-column-start:13}.panel-grid .g-start-14{grid-column-start:14}.panel-grid .g-start-15{grid-column-start:15}.panel-grid .g-start-16{grid-column-start:16}.panel-grid .g-start-17{grid-column-start:17}.panel-grid .g-start-18{grid-column-start:18}.panel-grid .g-start-19{grid-column-start:19}.panel-grid .g-start-20{grid-column-start:20}.panel-grid .g-start-21{grid-column-start:21}.panel-grid .g-start-22{grid-column-start:22}.panel-grid .g-start-23{grid-column-start:23}@media(min-width: 576px){.panel-grid .g-col-sm-1{grid-column:auto/span 1}.panel-grid .g-col-sm-2{grid-column:auto/span 2}.panel-grid .g-col-sm-3{grid-column:auto/span 3}.panel-grid .g-col-sm-4{grid-column:auto/span 4}.panel-grid .g-col-sm-5{grid-column:auto/span 5}.panel-grid .g-col-sm-6{grid-column:auto/span 6}.panel-grid .g-col-sm-7{grid-column:auto/span 7}.panel-grid .g-col-sm-8{grid-column:auto/span 8}.panel-grid .g-col-sm-9{grid-column:auto/span 9}.panel-grid .g-col-sm-10{grid-column:auto/span 10}.panel-grid .g-col-sm-11{grid-column:auto/span 11}.panel-grid .g-col-sm-12{grid-column:auto/span 12}.panel-grid .g-col-sm-13{grid-column:auto/span 13}.panel-grid .g-col-sm-14{grid-column:auto/span 14}.panel-grid .g-col-sm-15{grid-column:auto/span 15}.panel-grid .g-col-sm-16{grid-column:auto/span 16}.panel-grid .g-col-sm-17{grid-column:auto/span 17}.panel-grid .g-col-sm-18{grid-column:auto/span 18}.panel-grid .g-col-sm-19{grid-column:auto/span 19}.panel-grid .g-col-sm-20{grid-column:auto/span 20}.panel-grid .g-col-sm-21{grid-column:auto/span 21}.panel-grid .g-col-sm-22{grid-column:auto/span 22}.panel-grid .g-col-sm-23{grid-column:auto/span 23}.panel-grid .g-col-sm-24{grid-column:auto/span 24}.panel-grid .g-start-sm-1{grid-column-start:1}.panel-grid .g-start-sm-2{grid-column-start:2}.panel-grid .g-start-sm-3{grid-column-start:3}.panel-grid .g-start-sm-4{grid-column-start:4}.panel-grid .g-start-sm-5{grid-column-start:5}.panel-grid .g-start-sm-6{grid-column-start:6}.panel-grid .g-start-sm-7{grid-column-start:7}.panel-grid .g-start-sm-8{grid-column-start:8}.panel-grid .g-start-sm-9{grid-column-start:9}.panel-grid .g-start-sm-10{grid-column-start:10}.panel-grid .g-start-sm-11{grid-column-start:11}.panel-grid .g-start-sm-12{grid-column-start:12}.panel-grid .g-start-sm-13{grid-column-start:13}.panel-grid .g-start-sm-14{grid-column-start:14}.panel-grid .g-start-sm-15{grid-column-start:15}.panel-grid .g-start-sm-16{grid-column-start:16}.panel-grid .g-start-sm-17{grid-column-start:17}.panel-grid .g-start-sm-18{grid-column-start:18}.panel-grid .g-start-sm-19{grid-column-start:19}.panel-grid .g-start-sm-20{grid-column-start:20}.panel-grid .g-start-sm-21{grid-column-start:21}.panel-grid .g-start-sm-22{grid-column-start:22}.panel-grid .g-start-sm-23{grid-column-start:23}}@media(min-width: 768px){.panel-grid .g-col-md-1{grid-column:auto/span 1}.panel-grid .g-col-md-2{grid-column:auto/span 2}.panel-grid .g-col-md-3{grid-column:auto/span 3}.panel-grid .g-col-md-4{grid-column:auto/span 4}.panel-grid .g-col-md-5{grid-column:auto/span 5}.panel-grid .g-col-md-6{grid-column:auto/span 6}.panel-grid .g-col-md-7{grid-column:auto/span 7}.panel-grid .g-col-md-8{grid-column:auto/span 8}.panel-grid .g-col-md-9{grid-column:auto/span 9}.panel-grid .g-col-md-10{grid-column:auto/span 10}.panel-grid .g-col-md-11{grid-column:auto/span 11}.panel-grid .g-col-md-12{grid-column:auto/span 12}.panel-grid .g-col-md-13{grid-column:auto/span 13}.panel-grid .g-col-md-14{grid-column:auto/span 14}.panel-grid .g-col-md-15{grid-column:auto/span 15}.panel-grid .g-col-md-16{grid-column:auto/span 16}.panel-grid .g-col-md-17{grid-column:auto/span 17}.panel-grid .g-col-md-18{grid-column:auto/span 18}.panel-grid .g-col-md-19{grid-column:auto/span 19}.panel-grid .g-col-md-20{grid-column:auto/span 20}.panel-grid .g-col-md-21{grid-column:auto/span 21}.panel-grid .g-col-md-22{grid-column:auto/span 22}.panel-grid .g-col-md-23{grid-column:auto/span 23}.panel-grid .g-col-md-24{grid-column:auto/span 24}.panel-grid .g-start-md-1{grid-column-start:1}.panel-grid .g-start-md-2{grid-column-start:2}.panel-grid .g-start-md-3{grid-column-start:3}.panel-grid .g-start-md-4{grid-column-start:4}.panel-grid .g-start-md-5{grid-column-start:5}.panel-grid .g-start-md-6{grid-column-start:6}.panel-grid .g-start-md-7{grid-column-start:7}.panel-grid .g-start-md-8{grid-column-start:8}.panel-grid .g-start-md-9{grid-column-start:9}.panel-grid .g-start-md-10{grid-column-start:10}.panel-grid .g-start-md-11{grid-column-start:11}.panel-grid .g-start-md-12{grid-column-start:12}.panel-grid .g-start-md-13{grid-column-start:13}.panel-grid .g-start-md-14{grid-column-start:14}.panel-grid .g-start-md-15{grid-column-start:15}.panel-grid .g-start-md-16{grid-column-start:16}.panel-grid .g-start-md-17{grid-column-start:17}.panel-grid .g-start-md-18{grid-column-start:18}.panel-grid .g-start-md-19{grid-column-start:19}.panel-grid .g-start-md-20{grid-column-start:20}.panel-grid .g-start-md-21{grid-column-start:21}.panel-grid .g-start-md-22{grid-column-start:22}.panel-grid .g-start-md-23{grid-column-start:23}}@media(min-width: 992px){.panel-grid .g-col-lg-1{grid-column:auto/span 1}.panel-grid .g-col-lg-2{grid-column:auto/span 2}.panel-grid .g-col-lg-3{grid-column:auto/span 3}.panel-grid .g-col-lg-4{grid-column:auto/span 4}.panel-grid .g-col-lg-5{grid-column:auto/span 5}.panel-grid .g-col-lg-6{grid-column:auto/span 6}.panel-grid .g-col-lg-7{grid-column:auto/span 7}.panel-grid .g-col-lg-8{grid-column:auto/span 8}.panel-grid .g-col-lg-9{grid-column:auto/span 9}.panel-grid .g-col-lg-10{grid-column:auto/span 10}.panel-grid .g-col-lg-11{grid-column:auto/span 11}.panel-grid .g-col-lg-12{grid-column:auto/span 12}.panel-grid .g-col-lg-13{grid-column:auto/span 13}.panel-grid .g-col-lg-14{grid-column:auto/span 14}.panel-grid .g-col-lg-15{grid-column:auto/span 15}.panel-grid .g-col-lg-16{grid-column:auto/span 16}.panel-grid .g-col-lg-17{grid-column:auto/span 17}.panel-grid .g-col-lg-18{grid-column:auto/span 18}.panel-grid .g-col-lg-19{grid-column:auto/span 19}.panel-grid .g-col-lg-20{grid-column:auto/span 20}.panel-grid .g-col-lg-21{grid-column:auto/span 21}.panel-grid .g-col-lg-22{grid-column:auto/span 22}.panel-grid .g-col-lg-23{grid-column:auto/span 23}.panel-grid .g-col-lg-24{grid-column:auto/span 24}.panel-grid .g-start-lg-1{grid-column-start:1}.panel-grid .g-start-lg-2{grid-column-start:2}.panel-grid .g-start-lg-3{grid-column-start:3}.panel-grid .g-start-lg-4{grid-column-start:4}.panel-grid .g-start-lg-5{grid-column-start:5}.panel-grid .g-start-lg-6{grid-column-start:6}.panel-grid .g-start-lg-7{grid-column-start:7}.panel-grid .g-start-lg-8{grid-column-start:8}.panel-grid .g-start-lg-9{grid-column-start:9}.panel-grid .g-start-lg-10{grid-column-start:10}.panel-grid .g-start-lg-11{grid-column-start:11}.panel-grid .g-start-lg-12{grid-column-start:12}.panel-grid .g-start-lg-13{grid-column-start:13}.panel-grid .g-start-lg-14{grid-column-start:14}.panel-grid .g-start-lg-15{grid-column-start:15}.panel-grid .g-start-lg-16{grid-column-start:16}.panel-grid .g-start-lg-17{grid-column-start:17}.panel-grid .g-start-lg-18{grid-column-start:18}.panel-grid .g-start-lg-19{grid-column-start:19}.panel-grid .g-start-lg-20{grid-column-start:20}.panel-grid .g-start-lg-21{grid-column-start:21}.panel-grid .g-start-lg-22{grid-column-start:22}.panel-grid .g-start-lg-23{grid-column-start:23}}@media(min-width: 1200px){.panel-grid .g-col-xl-1{grid-column:auto/span 1}.panel-grid .g-col-xl-2{grid-column:auto/span 2}.panel-grid .g-col-xl-3{grid-column:auto/span 3}.panel-grid .g-col-xl-4{grid-column:auto/span 4}.panel-grid .g-col-xl-5{grid-column:auto/span 5}.panel-grid .g-col-xl-6{grid-column:auto/span 6}.panel-grid .g-col-xl-7{grid-column:auto/span 7}.panel-grid .g-col-xl-8{grid-column:auto/span 8}.panel-grid .g-col-xl-9{grid-column:auto/span 9}.panel-grid .g-col-xl-10{grid-column:auto/span 10}.panel-grid .g-col-xl-11{grid-column:auto/span 11}.panel-grid .g-col-xl-12{grid-column:auto/span 12}.panel-grid .g-col-xl-13{grid-column:auto/span 13}.panel-grid .g-col-xl-14{grid-column:auto/span 14}.panel-grid .g-col-xl-15{grid-column:auto/span 15}.panel-grid .g-col-xl-16{grid-column:auto/span 16}.panel-grid .g-col-xl-17{grid-column:auto/span 17}.panel-grid .g-col-xl-18{grid-column:auto/span 18}.panel-grid .g-col-xl-19{grid-column:auto/span 19}.panel-grid .g-col-xl-20{grid-column:auto/span 20}.panel-grid .g-col-xl-21{grid-column:auto/span 21}.panel-grid .g-col-xl-22{grid-column:auto/span 22}.panel-grid .g-col-xl-23{grid-column:auto/span 23}.panel-grid .g-col-xl-24{grid-column:auto/span 24}.panel-grid .g-start-xl-1{grid-column-start:1}.panel-grid .g-start-xl-2{grid-column-start:2}.panel-grid .g-start-xl-3{grid-column-start:3}.panel-grid .g-start-xl-4{grid-column-start:4}.panel-grid .g-start-xl-5{grid-column-start:5}.panel-grid .g-start-xl-6{grid-column-start:6}.panel-grid .g-start-xl-7{grid-column-start:7}.panel-grid .g-start-xl-8{grid-column-start:8}.panel-grid .g-start-xl-9{grid-column-start:9}.panel-grid .g-start-xl-10{grid-column-start:10}.panel-grid .g-start-xl-11{grid-column-start:11}.panel-grid .g-start-xl-12{grid-column-start:12}.panel-grid .g-start-xl-13{grid-column-start:13}.panel-grid .g-start-xl-14{grid-column-start:14}.panel-grid .g-start-xl-15{grid-column-start:15}.panel-grid .g-start-xl-16{grid-column-start:16}.panel-grid .g-start-xl-17{grid-column-start:17}.panel-grid .g-start-xl-18{grid-column-start:18}.panel-grid .g-start-xl-19{grid-column-start:19}.panel-grid .g-start-xl-20{grid-column-start:20}.panel-grid .g-start-xl-21{grid-column-start:21}.panel-grid .g-start-xl-22{grid-column-start:22}.panel-grid .g-start-xl-23{grid-column-start:23}}@media(min-width: 1400px){.panel-grid .g-col-xxl-1{grid-column:auto/span 1}.panel-grid .g-col-xxl-2{grid-column:auto/span 2}.panel-grid .g-col-xxl-3{grid-column:auto/span 3}.panel-grid .g-col-xxl-4{grid-column:auto/span 4}.panel-grid .g-col-xxl-5{grid-column:auto/span 5}.panel-grid .g-col-xxl-6{grid-column:auto/span 6}.panel-grid .g-col-xxl-7{grid-column:auto/span 7}.panel-grid .g-col-xxl-8{grid-column:auto/span 8}.panel-grid .g-col-xxl-9{grid-column:auto/span 9}.panel-grid .g-col-xxl-10{grid-column:auto/span 10}.panel-grid .g-col-xxl-11{grid-column:auto/span 11}.panel-grid .g-col-xxl-12{grid-column:auto/span 12}.panel-grid .g-col-xxl-13{grid-column:auto/span 13}.panel-grid .g-col-xxl-14{grid-column:auto/span 14}.panel-grid .g-col-xxl-15{grid-column:auto/span 15}.panel-grid .g-col-xxl-16{grid-column:auto/span 16}.panel-grid .g-col-xxl-17{grid-column:auto/span 17}.panel-grid .g-col-xxl-18{grid-column:auto/span 18}.panel-grid .g-col-xxl-19{grid-column:auto/span 19}.panel-grid .g-col-xxl-20{grid-column:auto/span 20}.panel-grid .g-col-xxl-21{grid-column:auto/span 21}.panel-grid .g-col-xxl-22{grid-column:auto/span 22}.panel-grid .g-col-xxl-23{grid-column:auto/span 23}.panel-grid .g-col-xxl-24{grid-column:auto/span 24}.panel-grid .g-start-xxl-1{grid-column-start:1}.panel-grid .g-start-xxl-2{grid-column-start:2}.panel-grid .g-start-xxl-3{grid-column-start:3}.panel-grid .g-start-xxl-4{grid-column-start:4}.panel-grid .g-start-xxl-5{grid-column-start:5}.panel-grid .g-start-xxl-6{grid-column-start:6}.panel-grid .g-start-xxl-7{grid-column-start:7}.panel-grid .g-start-xxl-8{grid-column-start:8}.panel-grid .g-start-xxl-9{grid-column-start:9}.panel-grid .g-start-xxl-10{grid-column-start:10}.panel-grid .g-start-xxl-11{grid-column-start:11}.panel-grid .g-start-xxl-12{grid-column-start:12}.panel-grid .g-start-xxl-13{grid-column-start:13}.panel-grid .g-start-xxl-14{grid-column-start:14}.panel-grid .g-start-xxl-15{grid-column-start:15}.panel-grid .g-start-xxl-16{grid-column-start:16}.panel-grid .g-start-xxl-17{grid-column-start:17}.panel-grid .g-start-xxl-18{grid-column-start:18}.panel-grid .g-start-xxl-19{grid-column-start:19}.panel-grid .g-start-xxl-20{grid-column-start:20}.panel-grid .g-start-xxl-21{grid-column-start:21}.panel-grid .g-start-xxl-22{grid-column-start:22}.panel-grid .g-start-xxl-23{grid-column-start:23}}main{margin-top:1em;margin-bottom:1em}h1,.h1,h2,.h2{color:inherit;margin-top:2rem;margin-bottom:1rem;font-weight:600}h1.title,.title.h1{margin-top:0}main.content>section:first-of-type>h2:first-child,main.content>section:first-of-type>.h2:first-child{margin-top:0}h2,.h2{border-bottom:1px solid #dee2e6;padding-bottom:.5rem}h3,.h3{font-weight:600}h3,.h3,h4,.h4{opacity:.9;margin-top:1.5rem}h5,.h5,h6,.h6{opacity:.9}.header-section-number{color:#5a6570}.nav-link.active .header-section-number{color:inherit}mark,.mark{padding:0em}.panel-caption,.figure-caption,.subfigure-caption,.table-caption,figcaption,caption{font-size:.9rem;color:#5a6570}.quarto-layout-cell[data-ref-parent] caption{color:#5a6570}.column-margin figcaption,.margin-caption,div.aside,aside,.column-margin{color:#5a6570;font-size:.825rem}.panel-caption.margin-caption{text-align:inherit}.column-margin.column-container p{margin-bottom:0}.column-margin.column-container>*:not(.collapse):first-child{padding-bottom:.5em;display:block}.column-margin.column-container>*:not(.collapse):not(:first-child){padding-top:.5em;padding-bottom:.5em;display:block}.column-margin.column-container>*.collapse:not(.show){display:none}@media(min-width: 768px){.column-margin.column-container .callout-margin-content:first-child{margin-top:4.5em}.column-margin.column-container .callout-margin-content-simple:first-child{margin-top:3.5em}}.margin-caption>*{padding-top:.5em;padding-bottom:.5em}@media(max-width: 767.98px){.quarto-layout-row{flex-direction:column}}.nav-tabs .nav-item{margin-top:1px;cursor:pointer}.tab-content{margin-top:0px;border-left:#dee2e6 1px solid;border-right:#dee2e6 1px solid;border-bottom:#dee2e6 1px solid;margin-left:0;padding:1em;margin-bottom:1em}@media(max-width: 767.98px){.layout-sidebar{margin-left:0;margin-right:0}}.panel-sidebar,.panel-sidebar .form-control,.panel-input,.panel-input .form-control,.selectize-dropdown{font-size:.9rem}.panel-sidebar .form-control,.panel-input .form-control{padding-top:.1rem}.tab-pane div.sourceCode{margin-top:0px}.tab-pane>p{padding-top:0}.tab-pane>p:nth-child(1){padding-top:0}.tab-pane>p:last-child{margin-bottom:0}.tab-pane>pre:last-child{margin-bottom:0}.tab-content>.tab-pane:not(.active){display:none !important}div.sourceCode{background-color:rgba(233,236,239,.65);border:1px solid rgba(233,236,239,.65);border-radius:.375rem}pre.sourceCode{background-color:rgba(0,0,0,0)}pre.sourceCode{border:none;font-size:.875em;overflow:visible !important;padding:.4em}.callout pre.sourceCode{padding-left:0}div.sourceCode{overflow-y:hidden}.callout div.sourceCode{margin-left:initial}.blockquote{font-size:inherit;padding-left:1rem;padding-right:1.5rem;color:#5a6570}.blockquote h1:first-child,.blockquote .h1:first-child,.blockquote h2:first-child,.blockquote .h2:first-child,.blockquote h3:first-child,.blockquote .h3:first-child,.blockquote h4:first-child,.blockquote .h4:first-child,.blockquote h5:first-child,.blockquote .h5:first-child{margin-top:0}pre{background-color:initial;padding:initial;border:initial}p pre code:not(.sourceCode),li pre code:not(.sourceCode),pre code:not(.sourceCode){background-color:initial}p code:not(.sourceCode),li code:not(.sourceCode),td code:not(.sourceCode){background-color:#f8f9fa;padding:.2em}nav p code:not(.sourceCode),nav li code:not(.sourceCode),nav td code:not(.sourceCode){background-color:rgba(0,0,0,0);padding:0}td code:not(.sourceCode){white-space:pre-wrap}#quarto-embedded-source-code-modal>.modal-dialog{max-width:1000px;padding-left:1.75rem;padding-right:1.75rem}#quarto-embedded-source-code-modal>.modal-dialog>.modal-content>.modal-body{padding:0}#quarto-embedded-source-code-modal>.modal-dialog>.modal-content>.modal-body div.sourceCode{margin:0;padding:.2rem .2rem;border-radius:0px;border:none}#quarto-embedded-source-code-modal>.modal-dialog>.modal-content>.modal-header{padding:.7rem}.code-tools-button{font-size:1rem;padding:.15rem .15rem;margin-left:5px;color:rgba(33,37,41,.75);background-color:rgba(0,0,0,0);transition:initial;cursor:pointer}.code-tools-button>.bi::before{display:inline-block;height:1rem;width:1rem;content:"";vertical-align:-0.125em;background-image:url('data:image/svg+xml,');background-repeat:no-repeat;background-size:1rem 1rem}.code-tools-button:hover>.bi::before{background-image:url('data:image/svg+xml,')}#quarto-embedded-source-code-modal .code-copy-button>.bi::before{background-image:url('data:image/svg+xml,')}#quarto-embedded-source-code-modal .code-copy-button-checked>.bi::before{background-image:url('data:image/svg+xml,')}.sidebar{will-change:top;transition:top 200ms linear;position:sticky;overflow-y:auto;padding-top:1.2em;max-height:100vh}.sidebar.toc-left,.sidebar.margin-sidebar{top:0px;padding-top:1em}.sidebar.quarto-banner-title-block-sidebar>*{padding-top:1.65em}figure .quarto-notebook-link{margin-top:.5em}.quarto-notebook-link{font-size:.75em;color:rgba(33,37,41,.75);margin-bottom:1em;text-decoration:none;display:block}.quarto-notebook-link:hover{text-decoration:underline;color:#0d6efd}.quarto-notebook-link::before{display:inline-block;height:.75rem;width:.75rem;margin-bottom:0em;margin-right:.25em;content:"";vertical-align:-0.125em;background-image:url('data:image/svg+xml,');background-repeat:no-repeat;background-size:.75rem .75rem}.toc-actions i.bi,.quarto-code-links i.bi,.quarto-other-links i.bi,.quarto-alternate-notebooks i.bi,.quarto-alternate-formats i.bi{margin-right:.4em;font-size:.8rem}.quarto-other-links-text-target .quarto-code-links i.bi,.quarto-other-links-text-target .quarto-other-links i.bi{margin-right:.2em}.quarto-other-formats-text-target .quarto-alternate-formats i.bi{margin-right:.1em}.toc-actions i.bi.empty,.quarto-code-links i.bi.empty,.quarto-other-links i.bi.empty,.quarto-alternate-notebooks i.bi.empty,.quarto-alternate-formats i.bi.empty{padding-left:1em}.quarto-notebook h2,.quarto-notebook .h2{border-bottom:none}.quarto-notebook .cell-container{display:flex}.quarto-notebook .cell-container .cell{flex-grow:4}.quarto-notebook .cell-container .cell-decorator{padding-top:1.5em;padding-right:1em;text-align:right}.quarto-notebook .cell-container.code-fold .cell-decorator{padding-top:3em}.quarto-notebook .cell-code code{white-space:pre-wrap}.quarto-notebook .cell .cell-output-stderr pre code,.quarto-notebook .cell .cell-output-stdout pre code{white-space:pre-wrap;overflow-wrap:anywhere}.toc-actions,.quarto-alternate-formats,.quarto-other-links,.quarto-code-links,.quarto-alternate-notebooks{padding-left:0em}.sidebar .toc-actions a,.sidebar .quarto-alternate-formats a,.sidebar .quarto-other-links a,.sidebar .quarto-code-links a,.sidebar .quarto-alternate-notebooks a,.sidebar nav[role=doc-toc] a{text-decoration:none}.sidebar .toc-actions a:hover,.sidebar .quarto-other-links a:hover,.sidebar .quarto-code-links a:hover,.sidebar .quarto-alternate-formats a:hover,.sidebar .quarto-alternate-notebooks a:hover{color:#0d6efd}.sidebar .toc-actions h2,.sidebar .toc-actions .h2,.sidebar .quarto-code-links h2,.sidebar .quarto-code-links .h2,.sidebar .quarto-other-links h2,.sidebar .quarto-other-links .h2,.sidebar .quarto-alternate-notebooks h2,.sidebar .quarto-alternate-notebooks .h2,.sidebar .quarto-alternate-formats h2,.sidebar .quarto-alternate-formats .h2,.sidebar nav[role=doc-toc]>h2,.sidebar nav[role=doc-toc]>.h2{font-weight:500;margin-bottom:.2rem;margin-top:.3rem;font-family:inherit;border-bottom:0;padding-bottom:0;padding-top:0px}.sidebar .toc-actions>h2,.sidebar .toc-actions>.h2,.sidebar .quarto-code-links>h2,.sidebar .quarto-code-links>.h2,.sidebar .quarto-other-links>h2,.sidebar .quarto-other-links>.h2,.sidebar .quarto-alternate-notebooks>h2,.sidebar .quarto-alternate-notebooks>.h2,.sidebar .quarto-alternate-formats>h2,.sidebar .quarto-alternate-formats>.h2{font-size:.8rem}.sidebar nav[role=doc-toc]>h2,.sidebar nav[role=doc-toc]>.h2{font-size:.875rem}.sidebar nav[role=doc-toc]>ul a{border-left:1px solid #e9ecef;padding-left:.6rem}.sidebar .toc-actions h2>ul a,.sidebar .toc-actions .h2>ul a,.sidebar .quarto-code-links h2>ul a,.sidebar .quarto-code-links .h2>ul a,.sidebar .quarto-other-links h2>ul a,.sidebar .quarto-other-links .h2>ul a,.sidebar .quarto-alternate-notebooks h2>ul a,.sidebar .quarto-alternate-notebooks .h2>ul a,.sidebar .quarto-alternate-formats h2>ul a,.sidebar .quarto-alternate-formats .h2>ul a{border-left:none;padding-left:.6rem}.sidebar .toc-actions ul a:empty,.sidebar .quarto-code-links ul a:empty,.sidebar .quarto-other-links ul a:empty,.sidebar .quarto-alternate-notebooks ul a:empty,.sidebar .quarto-alternate-formats ul a:empty,.sidebar nav[role=doc-toc]>ul a:empty{display:none}.sidebar .toc-actions ul,.sidebar .quarto-code-links ul,.sidebar .quarto-other-links ul,.sidebar .quarto-alternate-notebooks ul,.sidebar .quarto-alternate-formats ul{padding-left:0;list-style:none}.sidebar nav[role=doc-toc] ul{list-style:none;padding-left:0;list-style:none}.sidebar nav[role=doc-toc]>ul{margin-left:.45em}.quarto-margin-sidebar nav[role=doc-toc]{padding-left:.5em}.sidebar .toc-actions>ul,.sidebar .quarto-code-links>ul,.sidebar .quarto-other-links>ul,.sidebar .quarto-alternate-notebooks>ul,.sidebar .quarto-alternate-formats>ul{font-size:.8rem}.sidebar nav[role=doc-toc]>ul{font-size:.875rem}.sidebar .toc-actions ul li a,.sidebar .quarto-code-links ul li a,.sidebar .quarto-other-links ul li a,.sidebar .quarto-alternate-notebooks ul li a,.sidebar .quarto-alternate-formats ul li a,.sidebar nav[role=doc-toc]>ul li a{line-height:1.1rem;padding-bottom:.2rem;padding-top:.2rem;color:inherit}.sidebar nav[role=doc-toc] ul>li>ul>li>a{padding-left:1.2em}.sidebar nav[role=doc-toc] ul>li>ul>li>ul>li>a{padding-left:2.4em}.sidebar nav[role=doc-toc] ul>li>ul>li>ul>li>ul>li>a{padding-left:3.6em}.sidebar nav[role=doc-toc] ul>li>ul>li>ul>li>ul>li>ul>li>a{padding-left:4.8em}.sidebar nav[role=doc-toc] ul>li>ul>li>ul>li>ul>li>ul>li>ul>li>a{padding-left:6em}.sidebar nav[role=doc-toc] ul>li>a.active,.sidebar nav[role=doc-toc] ul>li>ul>li>a.active{border-left:1px solid #0d6efd;color:#0d6efd !important}.sidebar nav[role=doc-toc] ul>li>a:hover,.sidebar nav[role=doc-toc] ul>li>ul>li>a:hover{color:#0d6efd !important}kbd,.kbd{color:#212529;background-color:#f8f9fa;border:1px solid;border-radius:5px;border-color:#dee2e6}.quarto-appendix-contents div.hanging-indent{margin-left:0em}.quarto-appendix-contents div.hanging-indent div.csl-entry{margin-left:1em;text-indent:-1em}.citation a,.footnote-ref{text-decoration:none}.footnotes ol{padding-left:1em}.tippy-content>*{margin-bottom:.7em}.tippy-content>*:last-child{margin-bottom:0}.callout{margin-top:1.25rem;margin-bottom:1.25rem;border-radius:.375rem;overflow-wrap:break-word}.callout .callout-title-container{overflow-wrap:anywhere}.callout.callout-style-simple{padding:.4em .7em;border-left:5px solid;border-right:1px solid #dee2e6;border-top:1px solid #dee2e6;border-bottom:1px solid #dee2e6}.callout.callout-style-default{border-left:5px solid;border-right:1px solid #dee2e6;border-top:1px solid #dee2e6;border-bottom:1px solid #dee2e6}.callout .callout-body-container{flex-grow:1}.callout.callout-style-simple .callout-body{font-size:.9rem;font-weight:400}.callout.callout-style-default .callout-body{font-size:.9rem;font-weight:400}.callout:not(.no-icon).callout-titled.callout-style-simple .callout-body{padding-left:1.6em}.callout.callout-titled>.callout-header{padding-top:.2em;margin-bottom:-0.2em}.callout.callout-style-simple>div.callout-header{border-bottom:none;font-size:.9rem;font-weight:600;opacity:75%}.callout.callout-style-default>div.callout-header{border-bottom:none;font-weight:600;opacity:85%;font-size:.9rem;padding-left:.5em;padding-right:.5em}.callout.callout-style-default .callout-body{padding-left:.5em;padding-right:.5em}.callout.callout-style-default .callout-body>:first-child{padding-top:.5rem;margin-top:0}.callout>div.callout-header[data-bs-toggle=collapse]{cursor:pointer}.callout.callout-style-default .callout-header[aria-expanded=false],.callout.callout-style-default .callout-header[aria-expanded=true]{padding-top:0px;margin-bottom:0px;align-items:center}.callout.callout-titled .callout-body>:last-child:not(.sourceCode),.callout.callout-titled .callout-body>div>:last-child:not(.sourceCode){padding-bottom:.5rem;margin-bottom:0}.callout:not(.callout-titled) .callout-body>:first-child,.callout:not(.callout-titled) .callout-body>div>:first-child{margin-top:.25rem}.callout:not(.callout-titled) .callout-body>:last-child,.callout:not(.callout-titled) .callout-body>div>:last-child{margin-bottom:.2rem}.callout.callout-style-simple .callout-icon::before,.callout.callout-style-simple .callout-toggle::before{height:1rem;width:1rem;display:inline-block;content:"";background-repeat:no-repeat;background-size:1rem 1rem}.callout.callout-style-default .callout-icon::before,.callout.callout-style-default .callout-toggle::before{height:.9rem;width:.9rem;display:inline-block;content:"";background-repeat:no-repeat;background-size:.9rem .9rem}.callout.callout-style-default .callout-toggle::before{margin-top:5px}.callout .callout-btn-toggle .callout-toggle::before{transition:transform .2s linear}.callout .callout-header[aria-expanded=false] .callout-toggle::before{transform:rotate(-90deg)}.callout .callout-header[aria-expanded=true] .callout-toggle::before{transform:none}.callout.callout-style-simple:not(.no-icon) div.callout-icon-container{padding-top:.2em;padding-right:.55em}.callout.callout-style-default:not(.no-icon) div.callout-icon-container{padding-top:.1em;padding-right:.35em}.callout.callout-style-default:not(.no-icon) div.callout-title-container{margin-top:-1px}.callout.callout-style-default.callout-caution:not(.no-icon) div.callout-icon-container{padding-top:.3em;padding-right:.35em}.callout>.callout-body>.callout-icon-container>.no-icon,.callout>.callout-header>.callout-icon-container>.no-icon{display:none}div.callout.callout{border-left-color:rgba(33,37,41,.75)}div.callout.callout-style-default>.callout-header{background-color:rgba(33,37,41,.75)}div.callout-note.callout{border-left-color:#0d6efd}div.callout-note.callout-style-default>.callout-header{background-color:#e7f1ff}div.callout-note:not(.callout-titled) .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-note.callout-titled .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-note .callout-toggle::before{background-image:url('data:image/svg+xml,')}div.callout-tip.callout{border-left-color:#198754}div.callout-tip.callout-style-default>.callout-header{background-color:#e8f3ee}div.callout-tip:not(.callout-titled) .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-tip.callout-titled .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-tip .callout-toggle::before{background-image:url('data:image/svg+xml,')}div.callout-warning.callout{border-left-color:#ffc107}div.callout-warning.callout-style-default>.callout-header{background-color:#fff9e6}div.callout-warning:not(.callout-titled) .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-warning.callout-titled .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-warning .callout-toggle::before{background-image:url('data:image/svg+xml,')}div.callout-caution.callout{border-left-color:#fd7e14}div.callout-caution.callout-style-default>.callout-header{background-color:#fff2e8}div.callout-caution:not(.callout-titled) .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-caution.callout-titled .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-caution .callout-toggle::before{background-image:url('data:image/svg+xml,')}div.callout-important.callout{border-left-color:#dc3545}div.callout-important.callout-style-default>.callout-header{background-color:#fcebec}div.callout-important:not(.callout-titled) .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-important.callout-titled .callout-icon::before{background-image:url('data:image/svg+xml,');}div.callout-important .callout-toggle::before{background-image:url('data:image/svg+xml,')}.quarto-toggle-container{display:flex;align-items:center}.quarto-reader-toggle .bi::before,.quarto-color-scheme-toggle .bi::before{display:inline-block;height:1rem;width:1rem;content:"";background-repeat:no-repeat;background-size:1rem 1rem}.sidebar-navigation{padding-left:20px}.navbar{background-color:#517699;color:#fdfefe}.navbar .quarto-color-scheme-toggle:not(.alternate) .bi::before{background-image:url('data:image/svg+xml,')}.navbar .quarto-color-scheme-toggle.alternate .bi::before{background-image:url('data:image/svg+xml,')}.sidebar-navigation .quarto-color-scheme-toggle:not(.alternate) .bi::before{background-image:url('data:image/svg+xml,')}.sidebar-navigation .quarto-color-scheme-toggle.alternate .bi::before{background-image:url('data:image/svg+xml,')}.quarto-sidebar-toggle{border-color:#dee2e6;border-bottom-left-radius:.375rem;border-bottom-right-radius:.375rem;border-style:solid;border-width:1px;overflow:hidden;border-top-width:0px;padding-top:0px !important}.quarto-sidebar-toggle-title{cursor:pointer;padding-bottom:2px;margin-left:.25em;text-align:center;font-weight:400;font-size:.775em}#quarto-content .quarto-sidebar-toggle{background:#fafafa}#quarto-content .quarto-sidebar-toggle-title{color:#212529}.quarto-sidebar-toggle-icon{color:#dee2e6;margin-right:.5em;float:right;transition:transform .2s ease}.quarto-sidebar-toggle-icon::before{padding-top:5px}.quarto-sidebar-toggle.expanded .quarto-sidebar-toggle-icon{transform:rotate(-180deg)}.quarto-sidebar-toggle.expanded .quarto-sidebar-toggle-title{border-bottom:solid #dee2e6 1px}.quarto-sidebar-toggle-contents{background-color:#fff;padding-right:10px;padding-left:10px;margin-top:0px !important;transition:max-height .5s ease}.quarto-sidebar-toggle.expanded .quarto-sidebar-toggle-contents{padding-top:1em;padding-bottom:10px}@media(max-width: 767.98px){.sidebar-menu-container{padding-bottom:5em}}.quarto-sidebar-toggle:not(.expanded) .quarto-sidebar-toggle-contents{padding-top:0px !important;padding-bottom:0px}nav[role=doc-toc]{z-index:1020}#quarto-sidebar>*,nav[role=doc-toc]>*{transition:opacity .1s ease,border .1s ease}#quarto-sidebar.slow>*,nav[role=doc-toc].slow>*{transition:opacity .4s ease,border .4s ease}.quarto-color-scheme-toggle:not(.alternate).top-right .bi::before{background-image:url('data:image/svg+xml,')}.quarto-color-scheme-toggle.alternate.top-right .bi::before{background-image:url('data:image/svg+xml,')}#quarto-appendix.default{border-top:1px solid #dee2e6}#quarto-appendix.default{background-color:#fff;padding-top:1.5em;margin-top:2em;z-index:998}#quarto-appendix.default .quarto-appendix-heading{margin-top:0;line-height:1.4em;font-weight:600;opacity:.9;border-bottom:none;margin-bottom:0}#quarto-appendix.default .footnotes ol,#quarto-appendix.default .footnotes ol li>p:last-of-type,#quarto-appendix.default .quarto-appendix-contents>p:last-of-type{margin-bottom:0}#quarto-appendix.default .footnotes ol{margin-left:.5em}#quarto-appendix.default .quarto-appendix-secondary-label{margin-bottom:.4em}#quarto-appendix.default .quarto-appendix-bibtex{font-size:.7em;padding:1em;border:solid 1px #dee2e6;margin-bottom:1em}#quarto-appendix.default .quarto-appendix-bibtex code.sourceCode{white-space:pre-wrap}#quarto-appendix.default .quarto-appendix-citeas{font-size:.9em;padding:1em;border:solid 1px #dee2e6;margin-bottom:1em}#quarto-appendix.default .quarto-appendix-heading{font-size:1em !important}#quarto-appendix.default *[role=doc-endnotes]>ol,#quarto-appendix.default .quarto-appendix-contents>*:not(h2):not(.h2){font-size:.9em}#quarto-appendix.default section{padding-bottom:1.5em}#quarto-appendix.default section *[role=doc-endnotes],#quarto-appendix.default section>*:not(a){opacity:.9;word-wrap:break-word}.btn.btn-quarto,div.cell-output-display .btn-quarto{--bs-btn-color: #fefefe;--bs-btn-bg: #6c757d;--bs-btn-border-color: #6c757d;--bs-btn-hover-color: #fefefe;--bs-btn-hover-bg: #828a91;--bs-btn-hover-border-color: #7b838a;--bs-btn-focus-shadow-rgb: 130, 138, 144;--bs-btn-active-color: #000;--bs-btn-active-bg: #899197;--bs-btn-active-border-color: #7b838a;--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color: #ffffff;--bs-btn-disabled-bg: #6c757d;--bs-btn-disabled-border-color: #6c757d}nav.quarto-secondary-nav.color-navbar{background-color:#517699;color:#fdfefe}nav.quarto-secondary-nav.color-navbar h1,nav.quarto-secondary-nav.color-navbar .h1,nav.quarto-secondary-nav.color-navbar .quarto-btn-toggle{color:#fdfefe}@media(max-width: 991.98px){body.nav-sidebar .quarto-title-banner{margin-bottom:0;padding-bottom:1em}body.nav-sidebar #title-block-header{margin-block-end:0}}p.subtitle{margin-top:.25em;margin-bottom:.5em}code a:any-link{color:inherit;text-decoration-color:#6c757d}/*! light */div.observablehq table thead tr th{background-color:var(--bs-body-bg)}input,button,select,optgroup,textarea{background-color:var(--bs-body-bg)}.code-annotated .code-copy-button{margin-right:1.25em;margin-top:0;padding-bottom:0;padding-top:3px}.code-annotation-gutter-bg{background-color:#fff}.code-annotation-gutter{background-color:rgba(233,236,239,.65)}.code-annotation-gutter,.code-annotation-gutter-bg{height:100%;width:calc(20px + .5em);position:absolute;top:0;right:0}dl.code-annotation-container-grid dt{margin-right:1em;margin-top:.25rem}dl.code-annotation-container-grid dt{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;color:#383f45;border:solid #383f45 1px;border-radius:50%;height:22px;width:22px;line-height:22px;font-size:11px;text-align:center;vertical-align:middle;text-decoration:none}dl.code-annotation-container-grid dt[data-target-cell]{cursor:pointer}dl.code-annotation-container-grid dt[data-target-cell].code-annotation-active{color:#fff;border:solid #aaa 1px;background-color:#aaa}pre.code-annotation-code{padding-top:0;padding-bottom:0}pre.code-annotation-code code{z-index:3}#code-annotation-line-highlight-gutter{width:100%;border-top:solid rgba(170,170,170,.2666666667) 1px;border-bottom:solid rgba(170,170,170,.2666666667) 1px;z-index:2;background-color:rgba(170,170,170,.1333333333)}#code-annotation-line-highlight{margin-left:-4em;width:calc(100% + 4em);border-top:solid rgba(170,170,170,.2666666667) 1px;border-bottom:solid rgba(170,170,170,.2666666667) 1px;z-index:2;background-color:rgba(170,170,170,.1333333333)}code.sourceCode .code-annotation-anchor.code-annotation-active{background-color:var(--quarto-hl-normal-color, #aaaaaa);border:solid var(--quarto-hl-normal-color, #aaaaaa) 1px;color:#e9ecef;font-weight:bolder}code.sourceCode .code-annotation-anchor{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;color:var(--quarto-hl-co-color);border:solid var(--quarto-hl-co-color) 1px;border-radius:50%;height:18px;width:18px;font-size:9px;margin-top:2px}code.sourceCode button.code-annotation-anchor{padding:2px;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none}code.sourceCode a.code-annotation-anchor{line-height:18px;text-align:center;vertical-align:middle;cursor:default;text-decoration:none}@media print{.page-columns .column-screen-inset{grid-column:page-start-inset/page-end-inset;z-index:998;opacity:.999}.page-columns .column-screen-inset table{background:#fff}.page-columns .column-screen-inset-left{grid-column:page-start-inset/body-content-end;z-index:998;opacity:.999}.page-columns .column-screen-inset-left table{background:#fff}.page-columns .column-screen-inset-right{grid-column:body-content-start/page-end-inset;z-index:998;opacity:.999}.page-columns .column-screen-inset-right table{background:#fff}.page-columns .column-screen{grid-column:page-start/page-end;z-index:998;opacity:.999}.page-columns .column-screen table{background:#fff}.page-columns .column-screen-left{grid-column:page-start/body-content-end;z-index:998;opacity:.999}.page-columns .column-screen-left table{background:#fff}.page-columns .column-screen-right{grid-column:body-content-start/page-end;z-index:998;opacity:.999}.page-columns .column-screen-right table{background:#fff}.page-columns .column-screen-inset-shaded{grid-column:page-start-inset/page-end-inset;padding:1em;background:#f8f9fa;z-index:998;opacity:.999;margin-bottom:1em}}.quarto-video{margin-bottom:1em}.table{border-top:1px solid #d3d8dc;border-bottom:1px solid #d3d8dc}.table>thead{border-top-width:0;border-bottom:1px solid #9ba5ae}.table a{word-break:break-word}.table>:not(caption)>*>*{background-color:unset;color:unset}#quarto-document-content .crosstalk-input .checkbox input[type=checkbox],#quarto-document-content .crosstalk-input .checkbox-inline input[type=checkbox]{position:unset;margin-top:unset;margin-left:unset}#quarto-document-content .row{margin-left:unset;margin-right:unset}.quarto-xref{white-space:nowrap}#quarto-draft-alert{margin-top:0px;margin-bottom:0px;padding:.3em;text-align:center;font-size:.9em}#quarto-draft-alert i{margin-right:.3em}a.external:after{content:"";background-image:url('data:image/svg+xml,');background-size:contain;background-repeat:no-repeat;background-position:center center;margin-left:.2em;padding-right:.75em}div.sourceCode code a.external:after{content:none}a.external:after:hover{cursor:pointer}.quarto-ext-icon{display:inline-block;font-size:.75em;padding-left:.3em}.code-with-filename .code-with-filename-file{margin-bottom:0;padding-bottom:2px;padding-top:2px;padding-left:.7em;border:var(--quarto-border-width) solid var(--quarto-border-color);border-radius:var(--quarto-border-radius);border-bottom:0;border-bottom-left-radius:0%;border-bottom-right-radius:0%}.code-with-filename div.sourceCode,.reveal .code-with-filename div.sourceCode{margin-top:0;border-top-left-radius:0%;border-top-right-radius:0%}.code-with-filename .code-with-filename-file pre{margin-bottom:0}.code-with-filename .code-with-filename-file{background-color:rgba(219,219,219,.8)}.quarto-dark .code-with-filename .code-with-filename-file{background-color:#555}.code-with-filename .code-with-filename-file strong{font-weight:400}.quarto-title-banner{margin-bottom:1em;color:#fdfefe;background:#517699}.quarto-title-banner a{color:#fdfefe}.quarto-title-banner h1,.quarto-title-banner .h1,.quarto-title-banner h2,.quarto-title-banner .h2{color:#fdfefe}.quarto-title-banner .code-tools-button{color:#b9dcdc}.quarto-title-banner .code-tools-button:hover{color:#fdfefe}.quarto-title-banner .code-tools-button>.bi::before{background-image:url('data:image/svg+xml,')}.quarto-title-banner .code-tools-button:hover>.bi::before{background-image:url('data:image/svg+xml,')}.quarto-title-banner .quarto-title .title{font-weight:600}.quarto-title-banner .quarto-categories{margin-top:.75em}@media(min-width: 992px){.quarto-title-banner{padding-top:2.5em;padding-bottom:2.5em}}@media(max-width: 991.98px){.quarto-title-banner{padding-top:1em;padding-bottom:1em}}@media(max-width: 767.98px){body.hypothesis-enabled #title-block-header>*{padding-right:20px}}main.quarto-banner-title-block>section:first-child>h2,main.quarto-banner-title-block>section:first-child>.h2,main.quarto-banner-title-block>section:first-child>h3,main.quarto-banner-title-block>section:first-child>.h3,main.quarto-banner-title-block>section:first-child>h4,main.quarto-banner-title-block>section:first-child>.h4{margin-top:0}.quarto-title .quarto-categories{display:flex;flex-wrap:wrap;row-gap:.5em;column-gap:.4em;padding-bottom:.5em;margin-top:.75em}.quarto-title .quarto-categories .quarto-category{padding:.25em .75em;font-size:.65em;text-transform:uppercase;border:solid 1px;border-radius:.375rem;opacity:.6}.quarto-title .quarto-categories .quarto-category a{color:inherit}.quarto-title-meta-container{display:grid;grid-template-columns:1fr auto}.quarto-title-meta-column-end{display:flex;flex-direction:column;padding-left:1em}.quarto-title-meta-column-end a .bi{margin-right:.3em}#title-block-header.quarto-title-block.default .quarto-title-meta{display:grid;grid-template-columns:repeat(2, 1fr);grid-column-gap:1em}#title-block-header.quarto-title-block.default .quarto-title .title{margin-bottom:0}#title-block-header.quarto-title-block.default .quarto-title-author-orcid img{margin-top:-0.2em;height:.8em;width:.8em}#title-block-header.quarto-title-block.default .quarto-title-author-email{opacity:.7}#title-block-header.quarto-title-block.default .quarto-description p:last-of-type{margin-bottom:0}#title-block-header.quarto-title-block.default .quarto-title-meta-contents p,#title-block-header.quarto-title-block.default .quarto-title-authors p,#title-block-header.quarto-title-block.default .quarto-title-affiliations p{margin-bottom:.1em}#title-block-header.quarto-title-block.default .quarto-title-meta-heading{text-transform:uppercase;margin-top:1em;font-size:.8em;opacity:.8;font-weight:400}#title-block-header.quarto-title-block.default .quarto-title-meta-contents{font-size:.9em}#title-block-header.quarto-title-block.default .quarto-title-meta-contents p.affiliation:last-of-type{margin-bottom:.1em}#title-block-header.quarto-title-block.default p.affiliation{margin-bottom:.1em}#title-block-header.quarto-title-block.default .keywords,#title-block-header.quarto-title-block.default .description,#title-block-header.quarto-title-block.default .abstract{margin-top:0}#title-block-header.quarto-title-block.default .keywords>p,#title-block-header.quarto-title-block.default .description>p,#title-block-header.quarto-title-block.default .abstract>p{font-size:.9em}#title-block-header.quarto-title-block.default .keywords>p:last-of-type,#title-block-header.quarto-title-block.default .description>p:last-of-type,#title-block-header.quarto-title-block.default .abstract>p:last-of-type{margin-bottom:0}#title-block-header.quarto-title-block.default .keywords .block-title,#title-block-header.quarto-title-block.default .description .block-title,#title-block-header.quarto-title-block.default .abstract .block-title{margin-top:1em;text-transform:uppercase;font-size:.8em;opacity:.8;font-weight:400}#title-block-header.quarto-title-block.default .quarto-title-meta-author{display:grid;grid-template-columns:minmax(max-content, 1fr) 1fr;grid-column-gap:1em}.quarto-title-tools-only{display:flex;justify-content:right} diff --git a/_site/worksheets/aesthetic-mappings_files/libs/bootstrap/bootstrap.min.js b/_site/worksheets/aesthetic-mappings_files/libs/bootstrap/bootstrap.min.js new file mode 100644 index 0000000..e8f21f7 --- /dev/null +++ b/_site/worksheets/aesthetic-mappings_files/libs/bootstrap/bootstrap.min.js @@ -0,0 +1,7 @@ +/*! + * Bootstrap v5.3.1 (https://getbootstrap.com/) + * Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).bootstrap=e()}(this,(function(){"use strict";const t=new Map,e={set(e,i,n){t.has(e)||t.set(e,new Map);const s=t.get(e);s.has(i)||0===s.size?s.set(i,n):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(s.keys())[0]}.`)},get:(e,i)=>t.has(e)&&t.get(e).get(i)||null,remove(e,i){if(!t.has(e))return;const n=t.get(e);n.delete(i),0===n.size&&t.delete(e)}},i="transitionend",n=t=>(t&&window.CSS&&window.CSS.escape&&(t=t.replace(/#([^\s"#']+)/g,((t,e)=>`#${CSS.escape(e)}`))),t),s=t=>{t.dispatchEvent(new Event(i))},o=t=>!(!t||"object"!=typeof t)&&(void 0!==t.jquery&&(t=t[0]),void 0!==t.nodeType),r=t=>o(t)?t.jquery?t[0]:t:"string"==typeof t&&t.length>0?document.querySelector(n(t)):null,a=t=>{if(!o(t)||0===t.getClientRects().length)return!1;const e="visible"===getComputedStyle(t).getPropertyValue("visibility"),i=t.closest("details:not([open])");if(!i)return e;if(i!==t){const e=t.closest("summary");if(e&&e.parentNode!==i)return!1;if(null===e)return!1}return e},l=t=>!t||t.nodeType!==Node.ELEMENT_NODE||!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled")),c=t=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){const e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?c(t.parentNode):null},h=()=>{},d=t=>{t.offsetHeight},u=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,f=[],p=()=>"rtl"===document.documentElement.dir,m=t=>{var e;e=()=>{const e=u();if(e){const i=t.NAME,n=e.fn[i];e.fn[i]=t.jQueryInterface,e.fn[i].Constructor=t,e.fn[i].noConflict=()=>(e.fn[i]=n,t.jQueryInterface)}},"loading"===document.readyState?(f.length||document.addEventListener("DOMContentLoaded",(()=>{for(const t of f)t()})),f.push(e)):e()},g=(t,e=[],i=t)=>"function"==typeof t?t(...e):i,_=(t,e,n=!0)=>{if(!n)return void g(t);const o=(t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:i}=window.getComputedStyle(t);const n=Number.parseFloat(e),s=Number.parseFloat(i);return n||s?(e=e.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(i))):0})(e)+5;let r=!1;const a=({target:n})=>{n===e&&(r=!0,e.removeEventListener(i,a),g(t))};e.addEventListener(i,a),setTimeout((()=>{r||s(e)}),o)},b=(t,e,i,n)=>{const s=t.length;let o=t.indexOf(e);return-1===o?!i&&n?t[s-1]:t[0]:(o+=i?1:-1,n&&(o=(o+s)%s),t[Math.max(0,Math.min(o,s-1))])},v=/[^.]*(?=\..*)\.|.*/,y=/\..*/,w=/::\d+$/,A={};let E=1;const T={mouseenter:"mouseover",mouseleave:"mouseout"},C=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function O(t,e){return e&&`${e}::${E++}`||t.uidEvent||E++}function x(t){const e=O(t);return t.uidEvent=e,A[e]=A[e]||{},A[e]}function k(t,e,i=null){return Object.values(t).find((t=>t.callable===e&&t.delegationSelector===i))}function L(t,e,i){const n="string"==typeof e,s=n?i:e||i;let o=I(t);return C.has(o)||(o=t),[n,s,o]}function S(t,e,i,n,s){if("string"!=typeof e||!t)return;let[o,r,a]=L(e,i,n);if(e in T){const t=t=>function(e){if(!e.relatedTarget||e.relatedTarget!==e.delegateTarget&&!e.delegateTarget.contains(e.relatedTarget))return t.call(this,e)};r=t(r)}const l=x(t),c=l[a]||(l[a]={}),h=k(c,r,o?i:null);if(h)return void(h.oneOff=h.oneOff&&s);const d=O(r,e.replace(v,"")),u=o?function(t,e,i){return function n(s){const o=t.querySelectorAll(e);for(let{target:r}=s;r&&r!==this;r=r.parentNode)for(const a of o)if(a===r)return P(s,{delegateTarget:r}),n.oneOff&&N.off(t,s.type,e,i),i.apply(r,[s])}}(t,i,r):function(t,e){return function i(n){return P(n,{delegateTarget:t}),i.oneOff&&N.off(t,n.type,e),e.apply(t,[n])}}(t,r);u.delegationSelector=o?i:null,u.callable=r,u.oneOff=s,u.uidEvent=d,c[d]=u,t.addEventListener(a,u,o)}function D(t,e,i,n,s){const o=k(e[i],n,s);o&&(t.removeEventListener(i,o,Boolean(s)),delete e[i][o.uidEvent])}function $(t,e,i,n){const s=e[i]||{};for(const[o,r]of Object.entries(s))o.includes(n)&&D(t,e,i,r.callable,r.delegationSelector)}function I(t){return t=t.replace(y,""),T[t]||t}const N={on(t,e,i,n){S(t,e,i,n,!1)},one(t,e,i,n){S(t,e,i,n,!0)},off(t,e,i,n){if("string"!=typeof e||!t)return;const[s,o,r]=L(e,i,n),a=r!==e,l=x(t),c=l[r]||{},h=e.startsWith(".");if(void 0===o){if(h)for(const i of Object.keys(l))$(t,l,i,e.slice(1));for(const[i,n]of Object.entries(c)){const s=i.replace(w,"");a&&!e.includes(s)||D(t,l,r,n.callable,n.delegationSelector)}}else{if(!Object.keys(c).length)return;D(t,l,r,o,s?i:null)}},trigger(t,e,i){if("string"!=typeof e||!t)return null;const n=u();let s=null,o=!0,r=!0,a=!1;e!==I(e)&&n&&(s=n.Event(e,i),n(t).trigger(s),o=!s.isPropagationStopped(),r=!s.isImmediatePropagationStopped(),a=s.isDefaultPrevented());const l=P(new Event(e,{bubbles:o,cancelable:!0}),i);return a&&l.preventDefault(),r&&t.dispatchEvent(l),l.defaultPrevented&&s&&s.preventDefault(),l}};function P(t,e={}){for(const[i,n]of Object.entries(e))try{t[i]=n}catch(e){Object.defineProperty(t,i,{configurable:!0,get:()=>n})}return t}function M(t){if("true"===t)return!0;if("false"===t)return!1;if(t===Number(t).toString())return Number(t);if(""===t||"null"===t)return null;if("string"!=typeof t)return t;try{return JSON.parse(decodeURIComponent(t))}catch(e){return t}}function j(t){return t.replace(/[A-Z]/g,(t=>`-${t.toLowerCase()}`))}const F={setDataAttribute(t,e,i){t.setAttribute(`data-bs-${j(e)}`,i)},removeDataAttribute(t,e){t.removeAttribute(`data-bs-${j(e)}`)},getDataAttributes(t){if(!t)return{};const e={},i=Object.keys(t.dataset).filter((t=>t.startsWith("bs")&&!t.startsWith("bsConfig")));for(const n of i){let i=n.replace(/^bs/,"");i=i.charAt(0).toLowerCase()+i.slice(1,i.length),e[i]=M(t.dataset[n])}return e},getDataAttribute:(t,e)=>M(t.getAttribute(`data-bs-${j(e)}`))};class H{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(t){return t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t}_mergeConfigObj(t,e){const i=o(e)?F.getDataAttribute(e,"config"):{};return{...this.constructor.Default,..."object"==typeof i?i:{},...o(e)?F.getDataAttributes(e):{},..."object"==typeof t?t:{}}}_typeCheckConfig(t,e=this.constructor.DefaultType){for(const[n,s]of Object.entries(e)){const e=t[n],r=o(e)?"element":null==(i=e)?`${i}`:Object.prototype.toString.call(i).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(s).test(r))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${n}" provided type "${r}" but expected type "${s}".`)}var i}}class W extends H{constructor(t,i){super(),(t=r(t))&&(this._element=t,this._config=this._getConfig(i),e.set(this._element,this.constructor.DATA_KEY,this))}dispose(){e.remove(this._element,this.constructor.DATA_KEY),N.off(this._element,this.constructor.EVENT_KEY);for(const t of Object.getOwnPropertyNames(this))this[t]=null}_queueCallback(t,e,i=!0){_(t,e,i)}_getConfig(t){return t=this._mergeConfigObj(t,this._element),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}static getInstance(t){return e.get(r(t),this.DATA_KEY)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||new this(t,"object"==typeof e?e:null)}static get VERSION(){return"5.3.1"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(t){return`${t}${this.EVENT_KEY}`}}const B=t=>{let e=t.getAttribute("data-bs-target");if(!e||"#"===e){let i=t.getAttribute("href");if(!i||!i.includes("#")&&!i.startsWith("."))return null;i.includes("#")&&!i.startsWith("#")&&(i=`#${i.split("#")[1]}`),e=i&&"#"!==i?i.trim():null}return n(e)},z={find:(t,e=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(e,t)),findOne:(t,e=document.documentElement)=>Element.prototype.querySelector.call(e,t),children:(t,e)=>[].concat(...t.children).filter((t=>t.matches(e))),parents(t,e){const i=[];let n=t.parentNode.closest(e);for(;n;)i.push(n),n=n.parentNode.closest(e);return i},prev(t,e){let i=t.previousElementSibling;for(;i;){if(i.matches(e))return[i];i=i.previousElementSibling}return[]},next(t,e){let i=t.nextElementSibling;for(;i;){if(i.matches(e))return[i];i=i.nextElementSibling}return[]},focusableChildren(t){const e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map((t=>`${t}:not([tabindex^="-"])`)).join(",");return this.find(e,t).filter((t=>!l(t)&&a(t)))},getSelectorFromElement(t){const e=B(t);return e&&z.findOne(e)?e:null},getElementFromSelector(t){const e=B(t);return e?z.findOne(e):null},getMultipleElementsFromSelector(t){const e=B(t);return e?z.find(e):[]}},R=(t,e="hide")=>{const i=`click.dismiss${t.EVENT_KEY}`,n=t.NAME;N.on(document,i,`[data-bs-dismiss="${n}"]`,(function(i){if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),l(this))return;const s=z.getElementFromSelector(this)||this.closest(`.${n}`);t.getOrCreateInstance(s)[e]()}))},q=".bs.alert",V=`close${q}`,K=`closed${q}`;class Q extends W{static get NAME(){return"alert"}close(){if(N.trigger(this._element,V).defaultPrevented)return;this._element.classList.remove("show");const t=this._element.classList.contains("fade");this._queueCallback((()=>this._destroyElement()),this._element,t)}_destroyElement(){this._element.remove(),N.trigger(this._element,K),this.dispose()}static jQueryInterface(t){return this.each((function(){const e=Q.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}R(Q,"close"),m(Q);const X='[data-bs-toggle="button"]';class Y extends W{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(t){return this.each((function(){const e=Y.getOrCreateInstance(this);"toggle"===t&&e[t]()}))}}N.on(document,"click.bs.button.data-api",X,(t=>{t.preventDefault();const e=t.target.closest(X);Y.getOrCreateInstance(e).toggle()})),m(Y);const U=".bs.swipe",G=`touchstart${U}`,J=`touchmove${U}`,Z=`touchend${U}`,tt=`pointerdown${U}`,et=`pointerup${U}`,it={endCallback:null,leftCallback:null,rightCallback:null},nt={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class st extends H{constructor(t,e){super(),this._element=t,t&&st.isSupported()&&(this._config=this._getConfig(e),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return it}static get DefaultType(){return nt}static get NAME(){return"swipe"}dispose(){N.off(this._element,U)}_start(t){this._supportPointerEvents?this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX):this._deltaX=t.touches[0].clientX}_end(t){this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX-this._deltaX),this._handleSwipe(),g(this._config.endCallback)}_move(t){this._deltaX=t.touches&&t.touches.length>1?0:t.touches[0].clientX-this._deltaX}_handleSwipe(){const t=Math.abs(this._deltaX);if(t<=40)return;const e=t/this._deltaX;this._deltaX=0,e&&g(e>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(N.on(this._element,tt,(t=>this._start(t))),N.on(this._element,et,(t=>this._end(t))),this._element.classList.add("pointer-event")):(N.on(this._element,G,(t=>this._start(t))),N.on(this._element,J,(t=>this._move(t))),N.on(this._element,Z,(t=>this._end(t))))}_eventIsPointerPenTouch(t){return this._supportPointerEvents&&("pen"===t.pointerType||"touch"===t.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const ot=".bs.carousel",rt=".data-api",at="next",lt="prev",ct="left",ht="right",dt=`slide${ot}`,ut=`slid${ot}`,ft=`keydown${ot}`,pt=`mouseenter${ot}`,mt=`mouseleave${ot}`,gt=`dragstart${ot}`,_t=`load${ot}${rt}`,bt=`click${ot}${rt}`,vt="carousel",yt="active",wt=".active",At=".carousel-item",Et=wt+At,Tt={ArrowLeft:ht,ArrowRight:ct},Ct={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},Ot={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class xt extends W{constructor(t,e){super(t,e),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=z.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===vt&&this.cycle()}static get Default(){return Ct}static get DefaultType(){return Ot}static get NAME(){return"carousel"}next(){this._slide(at)}nextWhenVisible(){!document.hidden&&a(this._element)&&this.next()}prev(){this._slide(lt)}pause(){this._isSliding&&s(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval((()=>this.nextWhenVisible()),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?N.one(this._element,ut,(()=>this.cycle())):this.cycle())}to(t){const e=this._getItems();if(t>e.length-1||t<0)return;if(this._isSliding)return void N.one(this._element,ut,(()=>this.to(t)));const i=this._getItemIndex(this._getActive());if(i===t)return;const n=t>i?at:lt;this._slide(n,e[t])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(t){return t.defaultInterval=t.interval,t}_addEventListeners(){this._config.keyboard&&N.on(this._element,ft,(t=>this._keydown(t))),"hover"===this._config.pause&&(N.on(this._element,pt,(()=>this.pause())),N.on(this._element,mt,(()=>this._maybeEnableCycle()))),this._config.touch&&st.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const t of z.find(".carousel-item img",this._element))N.on(t,gt,(t=>t.preventDefault()));const t={leftCallback:()=>this._slide(this._directionToOrder(ct)),rightCallback:()=>this._slide(this._directionToOrder(ht)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout((()=>this._maybeEnableCycle()),500+this._config.interval))}};this._swipeHelper=new st(this._element,t)}_keydown(t){if(/input|textarea/i.test(t.target.tagName))return;const e=Tt[t.key];e&&(t.preventDefault(),this._slide(this._directionToOrder(e)))}_getItemIndex(t){return this._getItems().indexOf(t)}_setActiveIndicatorElement(t){if(!this._indicatorsElement)return;const e=z.findOne(wt,this._indicatorsElement);e.classList.remove(yt),e.removeAttribute("aria-current");const i=z.findOne(`[data-bs-slide-to="${t}"]`,this._indicatorsElement);i&&(i.classList.add(yt),i.setAttribute("aria-current","true"))}_updateInterval(){const t=this._activeElement||this._getActive();if(!t)return;const e=Number.parseInt(t.getAttribute("data-bs-interval"),10);this._config.interval=e||this._config.defaultInterval}_slide(t,e=null){if(this._isSliding)return;const i=this._getActive(),n=t===at,s=e||b(this._getItems(),i,n,this._config.wrap);if(s===i)return;const o=this._getItemIndex(s),r=e=>N.trigger(this._element,e,{relatedTarget:s,direction:this._orderToDirection(t),from:this._getItemIndex(i),to:o});if(r(dt).defaultPrevented)return;if(!i||!s)return;const a=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(o),this._activeElement=s;const l=n?"carousel-item-start":"carousel-item-end",c=n?"carousel-item-next":"carousel-item-prev";s.classList.add(c),d(s),i.classList.add(l),s.classList.add(l),this._queueCallback((()=>{s.classList.remove(l,c),s.classList.add(yt),i.classList.remove(yt,c,l),this._isSliding=!1,r(ut)}),i,this._isAnimated()),a&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return z.findOne(Et,this._element)}_getItems(){return z.find(At,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(t){return p()?t===ct?lt:at:t===ct?at:lt}_orderToDirection(t){return p()?t===lt?ct:ht:t===lt?ht:ct}static jQueryInterface(t){return this.each((function(){const e=xt.getOrCreateInstance(this,t);if("number"!=typeof t){if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}else e.to(t)}))}}N.on(document,bt,"[data-bs-slide], [data-bs-slide-to]",(function(t){const e=z.getElementFromSelector(this);if(!e||!e.classList.contains(vt))return;t.preventDefault();const i=xt.getOrCreateInstance(e),n=this.getAttribute("data-bs-slide-to");return n?(i.to(n),void i._maybeEnableCycle()):"next"===F.getDataAttribute(this,"slide")?(i.next(),void i._maybeEnableCycle()):(i.prev(),void i._maybeEnableCycle())})),N.on(window,_t,(()=>{const t=z.find('[data-bs-ride="carousel"]');for(const e of t)xt.getOrCreateInstance(e)})),m(xt);const kt=".bs.collapse",Lt=`show${kt}`,St=`shown${kt}`,Dt=`hide${kt}`,$t=`hidden${kt}`,It=`click${kt}.data-api`,Nt="show",Pt="collapse",Mt="collapsing",jt=`:scope .${Pt} .${Pt}`,Ft='[data-bs-toggle="collapse"]',Ht={parent:null,toggle:!0},Wt={parent:"(null|element)",toggle:"boolean"};class Bt extends W{constructor(t,e){super(t,e),this._isTransitioning=!1,this._triggerArray=[];const i=z.find(Ft);for(const t of i){const e=z.getSelectorFromElement(t),i=z.find(e).filter((t=>t===this._element));null!==e&&i.length&&this._triggerArray.push(t)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return Ht}static get DefaultType(){return Wt}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let t=[];if(this._config.parent&&(t=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter((t=>t!==this._element)).map((t=>Bt.getOrCreateInstance(t,{toggle:!1})))),t.length&&t[0]._isTransitioning)return;if(N.trigger(this._element,Lt).defaultPrevented)return;for(const e of t)e.hide();const e=this._getDimension();this._element.classList.remove(Pt),this._element.classList.add(Mt),this._element.style[e]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const i=`scroll${e[0].toUpperCase()+e.slice(1)}`;this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove(Mt),this._element.classList.add(Pt,Nt),this._element.style[e]="",N.trigger(this._element,St)}),this._element,!0),this._element.style[e]=`${this._element[i]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(N.trigger(this._element,Dt).defaultPrevented)return;const t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,d(this._element),this._element.classList.add(Mt),this._element.classList.remove(Pt,Nt);for(const t of this._triggerArray){const e=z.getElementFromSelector(t);e&&!this._isShown(e)&&this._addAriaAndCollapsedClass([t],!1)}this._isTransitioning=!0,this._element.style[t]="",this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove(Mt),this._element.classList.add(Pt),N.trigger(this._element,$t)}),this._element,!0)}_isShown(t=this._element){return t.classList.contains(Nt)}_configAfterMerge(t){return t.toggle=Boolean(t.toggle),t.parent=r(t.parent),t}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const t=this._getFirstLevelChildren(Ft);for(const e of t){const t=z.getElementFromSelector(e);t&&this._addAriaAndCollapsedClass([e],this._isShown(t))}}_getFirstLevelChildren(t){const e=z.find(jt,this._config.parent);return z.find(t,this._config.parent).filter((t=>!e.includes(t)))}_addAriaAndCollapsedClass(t,e){if(t.length)for(const i of t)i.classList.toggle("collapsed",!e),i.setAttribute("aria-expanded",e)}static jQueryInterface(t){const e={};return"string"==typeof t&&/show|hide/.test(t)&&(e.toggle=!1),this.each((function(){const i=Bt.getOrCreateInstance(this,e);if("string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t]()}}))}}N.on(document,It,Ft,(function(t){("A"===t.target.tagName||t.delegateTarget&&"A"===t.delegateTarget.tagName)&&t.preventDefault();for(const t of z.getMultipleElementsFromSelector(this))Bt.getOrCreateInstance(t,{toggle:!1}).toggle()})),m(Bt);var zt="top",Rt="bottom",qt="right",Vt="left",Kt="auto",Qt=[zt,Rt,qt,Vt],Xt="start",Yt="end",Ut="clippingParents",Gt="viewport",Jt="popper",Zt="reference",te=Qt.reduce((function(t,e){return t.concat([e+"-"+Xt,e+"-"+Yt])}),[]),ee=[].concat(Qt,[Kt]).reduce((function(t,e){return t.concat([e,e+"-"+Xt,e+"-"+Yt])}),[]),ie="beforeRead",ne="read",se="afterRead",oe="beforeMain",re="main",ae="afterMain",le="beforeWrite",ce="write",he="afterWrite",de=[ie,ne,se,oe,re,ae,le,ce,he];function ue(t){return t?(t.nodeName||"").toLowerCase():null}function fe(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function pe(t){return t instanceof fe(t).Element||t instanceof Element}function me(t){return t instanceof fe(t).HTMLElement||t instanceof HTMLElement}function ge(t){return"undefined"!=typeof ShadowRoot&&(t instanceof fe(t).ShadowRoot||t instanceof ShadowRoot)}const _e={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];me(s)&&ue(s)&&(Object.assign(s.style,i),Object.keys(n).forEach((function(t){var e=n[t];!1===e?s.removeAttribute(t):s.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach((function(t){var n=e.elements[t],s=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce((function(t,e){return t[e]="",t}),{});me(n)&&ue(n)&&(Object.assign(n.style,o),Object.keys(s).forEach((function(t){n.removeAttribute(t)})))}))}},requires:["computeStyles"]};function be(t){return t.split("-")[0]}var ve=Math.max,ye=Math.min,we=Math.round;function Ae(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function Ee(){return!/^((?!chrome|android).)*safari/i.test(Ae())}function Te(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=t.getBoundingClientRect(),s=1,o=1;e&&me(t)&&(s=t.offsetWidth>0&&we(n.width)/t.offsetWidth||1,o=t.offsetHeight>0&&we(n.height)/t.offsetHeight||1);var r=(pe(t)?fe(t):window).visualViewport,a=!Ee()&&i,l=(n.left+(a&&r?r.offsetLeft:0))/s,c=(n.top+(a&&r?r.offsetTop:0))/o,h=n.width/s,d=n.height/o;return{width:h,height:d,top:c,right:l+h,bottom:c+d,left:l,x:l,y:c}}function Ce(t){var e=Te(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function Oe(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&ge(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function xe(t){return fe(t).getComputedStyle(t)}function ke(t){return["table","td","th"].indexOf(ue(t))>=0}function Le(t){return((pe(t)?t.ownerDocument:t.document)||window.document).documentElement}function Se(t){return"html"===ue(t)?t:t.assignedSlot||t.parentNode||(ge(t)?t.host:null)||Le(t)}function De(t){return me(t)&&"fixed"!==xe(t).position?t.offsetParent:null}function $e(t){for(var e=fe(t),i=De(t);i&&ke(i)&&"static"===xe(i).position;)i=De(i);return i&&("html"===ue(i)||"body"===ue(i)&&"static"===xe(i).position)?e:i||function(t){var e=/firefox/i.test(Ae());if(/Trident/i.test(Ae())&&me(t)&&"fixed"===xe(t).position)return null;var i=Se(t);for(ge(i)&&(i=i.host);me(i)&&["html","body"].indexOf(ue(i))<0;){var n=xe(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(t)||e}function Ie(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Ne(t,e,i){return ve(t,ye(e,i))}function Pe(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Me(t,e){return e.reduce((function(e,i){return e[i]=t,e}),{})}const je={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,i=t.state,n=t.name,s=t.options,o=i.elements.arrow,r=i.modifiersData.popperOffsets,a=be(i.placement),l=Ie(a),c=[Vt,qt].indexOf(a)>=0?"height":"width";if(o&&r){var h=function(t,e){return Pe("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Me(t,Qt))}(s.padding,i),d=Ce(o),u="y"===l?zt:Vt,f="y"===l?Rt:qt,p=i.rects.reference[c]+i.rects.reference[l]-r[l]-i.rects.popper[c],m=r[l]-i.rects.reference[l],g=$e(o),_=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,b=p/2-m/2,v=h[u],y=_-d[c]-h[f],w=_/2-d[c]/2+b,A=Ne(v,w,y),E=l;i.modifiersData[n]=((e={})[E]=A,e.centerOffset=A-w,e)}},effect:function(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&Oe(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Fe(t){return t.split("-")[1]}var He={top:"auto",right:"auto",bottom:"auto",left:"auto"};function We(t){var e,i=t.popper,n=t.popperRect,s=t.placement,o=t.variation,r=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,h=t.roundOffsets,d=t.isFixed,u=r.x,f=void 0===u?0:u,p=r.y,m=void 0===p?0:p,g="function"==typeof h?h({x:f,y:m}):{x:f,y:m};f=g.x,m=g.y;var _=r.hasOwnProperty("x"),b=r.hasOwnProperty("y"),v=Vt,y=zt,w=window;if(c){var A=$e(i),E="clientHeight",T="clientWidth";A===fe(i)&&"static"!==xe(A=Le(i)).position&&"absolute"===a&&(E="scrollHeight",T="scrollWidth"),(s===zt||(s===Vt||s===qt)&&o===Yt)&&(y=Rt,m-=(d&&A===w&&w.visualViewport?w.visualViewport.height:A[E])-n.height,m*=l?1:-1),s!==Vt&&(s!==zt&&s!==Rt||o!==Yt)||(v=qt,f-=(d&&A===w&&w.visualViewport?w.visualViewport.width:A[T])-n.width,f*=l?1:-1)}var C,O=Object.assign({position:a},c&&He),x=!0===h?function(t,e){var i=t.x,n=t.y,s=e.devicePixelRatio||1;return{x:we(i*s)/s||0,y:we(n*s)/s||0}}({x:f,y:m},fe(i)):{x:f,y:m};return f=x.x,m=x.y,l?Object.assign({},O,((C={})[y]=b?"0":"",C[v]=_?"0":"",C.transform=(w.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",C)):Object.assign({},O,((e={})[y]=b?m+"px":"",e[v]=_?f+"px":"",e.transform="",e))}const Be={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,i=t.options,n=i.gpuAcceleration,s=void 0===n||n,o=i.adaptive,r=void 0===o||o,a=i.roundOffsets,l=void 0===a||a,c={placement:be(e.placement),variation:Fe(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,We(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:r,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,We(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}};var ze={passive:!0};const Re={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,n=t.options,s=n.scroll,o=void 0===s||s,r=n.resize,a=void 0===r||r,l=fe(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach((function(t){t.addEventListener("scroll",i.update,ze)})),a&&l.addEventListener("resize",i.update,ze),function(){o&&c.forEach((function(t){t.removeEventListener("scroll",i.update,ze)})),a&&l.removeEventListener("resize",i.update,ze)}},data:{}};var qe={left:"right",right:"left",bottom:"top",top:"bottom"};function Ve(t){return t.replace(/left|right|bottom|top/g,(function(t){return qe[t]}))}var Ke={start:"end",end:"start"};function Qe(t){return t.replace(/start|end/g,(function(t){return Ke[t]}))}function Xe(t){var e=fe(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ye(t){return Te(Le(t)).left+Xe(t).scrollLeft}function Ue(t){var e=xe(t),i=e.overflow,n=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+s+n)}function Ge(t){return["html","body","#document"].indexOf(ue(t))>=0?t.ownerDocument.body:me(t)&&Ue(t)?t:Ge(Se(t))}function Je(t,e){var i;void 0===e&&(e=[]);var n=Ge(t),s=n===(null==(i=t.ownerDocument)?void 0:i.body),o=fe(n),r=s?[o].concat(o.visualViewport||[],Ue(n)?n:[]):n,a=e.concat(r);return s?a:a.concat(Je(Se(r)))}function Ze(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function ti(t,e,i){return e===Gt?Ze(function(t,e){var i=fe(t),n=Le(t),s=i.visualViewport,o=n.clientWidth,r=n.clientHeight,a=0,l=0;if(s){o=s.width,r=s.height;var c=Ee();(c||!c&&"fixed"===e)&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:r,x:a+Ye(t),y:l}}(t,i)):pe(e)?function(t,e){var i=Te(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}(e,i):Ze(function(t){var e,i=Le(t),n=Xe(t),s=null==(e=t.ownerDocument)?void 0:e.body,o=ve(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),r=ve(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-n.scrollLeft+Ye(t),l=-n.scrollTop;return"rtl"===xe(s||i).direction&&(a+=ve(i.clientWidth,s?s.clientWidth:0)-o),{width:o,height:r,x:a,y:l}}(Le(t)))}function ei(t){var e,i=t.reference,n=t.element,s=t.placement,o=s?be(s):null,r=s?Fe(s):null,a=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(o){case zt:e={x:a,y:i.y-n.height};break;case Rt:e={x:a,y:i.y+i.height};break;case qt:e={x:i.x+i.width,y:l};break;case Vt:e={x:i.x-n.width,y:l};break;default:e={x:i.x,y:i.y}}var c=o?Ie(o):null;if(null!=c){var h="y"===c?"height":"width";switch(r){case Xt:e[c]=e[c]-(i[h]/2-n[h]/2);break;case Yt:e[c]=e[c]+(i[h]/2-n[h]/2)}}return e}function ii(t,e){void 0===e&&(e={});var i=e,n=i.placement,s=void 0===n?t.placement:n,o=i.strategy,r=void 0===o?t.strategy:o,a=i.boundary,l=void 0===a?Ut:a,c=i.rootBoundary,h=void 0===c?Gt:c,d=i.elementContext,u=void 0===d?Jt:d,f=i.altBoundary,p=void 0!==f&&f,m=i.padding,g=void 0===m?0:m,_=Pe("number"!=typeof g?g:Me(g,Qt)),b=u===Jt?Zt:Jt,v=t.rects.popper,y=t.elements[p?b:u],w=function(t,e,i,n){var s="clippingParents"===e?function(t){var e=Je(Se(t)),i=["absolute","fixed"].indexOf(xe(t).position)>=0&&me(t)?$e(t):t;return pe(i)?e.filter((function(t){return pe(t)&&Oe(t,i)&&"body"!==ue(t)})):[]}(t):[].concat(e),o=[].concat(s,[i]),r=o[0],a=o.reduce((function(e,i){var s=ti(t,i,n);return e.top=ve(s.top,e.top),e.right=ye(s.right,e.right),e.bottom=ye(s.bottom,e.bottom),e.left=ve(s.left,e.left),e}),ti(t,r,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}(pe(y)?y:y.contextElement||Le(t.elements.popper),l,h,r),A=Te(t.elements.reference),E=ei({reference:A,element:v,strategy:"absolute",placement:s}),T=Ze(Object.assign({},v,E)),C=u===Jt?T:A,O={top:w.top-C.top+_.top,bottom:C.bottom-w.bottom+_.bottom,left:w.left-C.left+_.left,right:C.right-w.right+_.right},x=t.modifiersData.offset;if(u===Jt&&x){var k=x[s];Object.keys(O).forEach((function(t){var e=[qt,Rt].indexOf(t)>=0?1:-1,i=[zt,Rt].indexOf(t)>=0?"y":"x";O[t]+=k[i]*e}))}return O}function ni(t,e){void 0===e&&(e={});var i=e,n=i.placement,s=i.boundary,o=i.rootBoundary,r=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=void 0===l?ee:l,h=Fe(n),d=h?a?te:te.filter((function(t){return Fe(t)===h})):Qt,u=d.filter((function(t){return c.indexOf(t)>=0}));0===u.length&&(u=d);var f=u.reduce((function(e,i){return e[i]=ii(t,{placement:i,boundary:s,rootBoundary:o,padding:r})[be(i)],e}),{});return Object.keys(f).sort((function(t,e){return f[t]-f[e]}))}const si={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var s=i.mainAxis,o=void 0===s||s,r=i.altAxis,a=void 0===r||r,l=i.fallbackPlacements,c=i.padding,h=i.boundary,d=i.rootBoundary,u=i.altBoundary,f=i.flipVariations,p=void 0===f||f,m=i.allowedAutoPlacements,g=e.options.placement,_=be(g),b=l||(_!==g&&p?function(t){if(be(t)===Kt)return[];var e=Ve(t);return[Qe(t),e,Qe(e)]}(g):[Ve(g)]),v=[g].concat(b).reduce((function(t,i){return t.concat(be(i)===Kt?ni(e,{placement:i,boundary:h,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:m}):i)}),[]),y=e.rects.reference,w=e.rects.popper,A=new Map,E=!0,T=v[0],C=0;C=0,S=L?"width":"height",D=ii(e,{placement:O,boundary:h,rootBoundary:d,altBoundary:u,padding:c}),$=L?k?qt:Vt:k?Rt:zt;y[S]>w[S]&&($=Ve($));var I=Ve($),N=[];if(o&&N.push(D[x]<=0),a&&N.push(D[$]<=0,D[I]<=0),N.every((function(t){return t}))){T=O,E=!1;break}A.set(O,N)}if(E)for(var P=function(t){var e=v.find((function(e){var i=A.get(e);if(i)return i.slice(0,t).every((function(t){return t}))}));if(e)return T=e,"break"},M=p?3:1;M>0&&"break"!==P(M);M--);e.placement!==T&&(e.modifiersData[n]._skip=!0,e.placement=T,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function oi(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function ri(t){return[zt,qt,Rt,Vt].some((function(e){return t[e]>=0}))}const ai={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,i=t.name,n=e.rects.reference,s=e.rects.popper,o=e.modifiersData.preventOverflow,r=ii(e,{elementContext:"reference"}),a=ii(e,{altBoundary:!0}),l=oi(r,n),c=oi(a,s,o),h=ri(l),d=ri(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":d})}},li={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,i=t.options,n=t.name,s=i.offset,o=void 0===s?[0,0]:s,r=ee.reduce((function(t,i){return t[i]=function(t,e,i){var n=be(t),s=[Vt,zt].indexOf(n)>=0?-1:1,o="function"==typeof i?i(Object.assign({},e,{placement:t})):i,r=o[0],a=o[1];return r=r||0,a=(a||0)*s,[Vt,qt].indexOf(n)>=0?{x:a,y:r}:{x:r,y:a}}(i,e.rects,o),t}),{}),a=r[e.placement],l=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=r}},ci={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,i=t.name;e.modifiersData[i]=ei({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},hi={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name,s=i.mainAxis,o=void 0===s||s,r=i.altAxis,a=void 0!==r&&r,l=i.boundary,c=i.rootBoundary,h=i.altBoundary,d=i.padding,u=i.tether,f=void 0===u||u,p=i.tetherOffset,m=void 0===p?0:p,g=ii(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:h}),_=be(e.placement),b=Fe(e.placement),v=!b,y=Ie(_),w="x"===y?"y":"x",A=e.modifiersData.popperOffsets,E=e.rects.reference,T=e.rects.popper,C="function"==typeof m?m(Object.assign({},e.rects,{placement:e.placement})):m,O="number"==typeof C?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),x=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,k={x:0,y:0};if(A){if(o){var L,S="y"===y?zt:Vt,D="y"===y?Rt:qt,$="y"===y?"height":"width",I=A[y],N=I+g[S],P=I-g[D],M=f?-T[$]/2:0,j=b===Xt?E[$]:T[$],F=b===Xt?-T[$]:-E[$],H=e.elements.arrow,W=f&&H?Ce(H):{width:0,height:0},B=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},z=B[S],R=B[D],q=Ne(0,E[$],W[$]),V=v?E[$]/2-M-q-z-O.mainAxis:j-q-z-O.mainAxis,K=v?-E[$]/2+M+q+R+O.mainAxis:F+q+R+O.mainAxis,Q=e.elements.arrow&&$e(e.elements.arrow),X=Q?"y"===y?Q.clientTop||0:Q.clientLeft||0:0,Y=null!=(L=null==x?void 0:x[y])?L:0,U=I+K-Y,G=Ne(f?ye(N,I+V-Y-X):N,I,f?ve(P,U):P);A[y]=G,k[y]=G-I}if(a){var J,Z="x"===y?zt:Vt,tt="x"===y?Rt:qt,et=A[w],it="y"===w?"height":"width",nt=et+g[Z],st=et-g[tt],ot=-1!==[zt,Vt].indexOf(_),rt=null!=(J=null==x?void 0:x[w])?J:0,at=ot?nt:et-E[it]-T[it]-rt+O.altAxis,lt=ot?et+E[it]+T[it]-rt-O.altAxis:st,ct=f&&ot?function(t,e,i){var n=Ne(t,e,i);return n>i?i:n}(at,et,lt):Ne(f?at:nt,et,f?lt:st);A[w]=ct,k[w]=ct-et}e.modifiersData[n]=k}},requiresIfExists:["offset"]};function di(t,e,i){void 0===i&&(i=!1);var n,s,o=me(e),r=me(e)&&function(t){var e=t.getBoundingClientRect(),i=we(e.width)/t.offsetWidth||1,n=we(e.height)/t.offsetHeight||1;return 1!==i||1!==n}(e),a=Le(e),l=Te(t,r,i),c={scrollLeft:0,scrollTop:0},h={x:0,y:0};return(o||!o&&!i)&&(("body"!==ue(e)||Ue(a))&&(c=(n=e)!==fe(n)&&me(n)?{scrollLeft:(s=n).scrollLeft,scrollTop:s.scrollTop}:Xe(n)),me(e)?((h=Te(e,!0)).x+=e.clientLeft,h.y+=e.clientTop):a&&(h.x=Ye(a))),{x:l.left+c.scrollLeft-h.x,y:l.top+c.scrollTop-h.y,width:l.width,height:l.height}}function ui(t){var e=new Map,i=new Set,n=[];function s(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!i.has(t)){var n=e.get(t);n&&s(n)}})),n.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){i.has(t.name)||s(t)})),n}var fi={placement:"bottom",modifiers:[],strategy:"absolute"};function pi(){for(var t=arguments.length,e=new Array(t),i=0;iNumber.parseInt(t,10))):"function"==typeof t?e=>t(e,this._element):t}_getPopperConfig(){const t={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(F.setDataAttribute(this._menu,"popper","static"),t.modifiers=[{name:"applyStyles",enabled:!1}]),{...t,...g(this._config.popperConfig,[t])}}_selectMenuItem({key:t,target:e}){const i=z.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter((t=>a(t)));i.length&&b(i,e,t===Ti,!i.includes(e)).focus()}static jQueryInterface(t){return this.each((function(){const e=qi.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}static clearMenus(t){if(2===t.button||"keyup"===t.type&&"Tab"!==t.key)return;const e=z.find(Ni);for(const i of e){const e=qi.getInstance(i);if(!e||!1===e._config.autoClose)continue;const n=t.composedPath(),s=n.includes(e._menu);if(n.includes(e._element)||"inside"===e._config.autoClose&&!s||"outside"===e._config.autoClose&&s)continue;if(e._menu.contains(t.target)&&("keyup"===t.type&&"Tab"===t.key||/input|select|option|textarea|form/i.test(t.target.tagName)))continue;const o={relatedTarget:e._element};"click"===t.type&&(o.clickEvent=t),e._completeHide(o)}}static dataApiKeydownHandler(t){const e=/input|textarea/i.test(t.target.tagName),i="Escape"===t.key,n=[Ei,Ti].includes(t.key);if(!n&&!i)return;if(e&&!i)return;t.preventDefault();const s=this.matches(Ii)?this:z.prev(this,Ii)[0]||z.next(this,Ii)[0]||z.findOne(Ii,t.delegateTarget.parentNode),o=qi.getOrCreateInstance(s);if(n)return t.stopPropagation(),o.show(),void o._selectMenuItem(t);o._isShown()&&(t.stopPropagation(),o.hide(),s.focus())}}N.on(document,Si,Ii,qi.dataApiKeydownHandler),N.on(document,Si,Pi,qi.dataApiKeydownHandler),N.on(document,Li,qi.clearMenus),N.on(document,Di,qi.clearMenus),N.on(document,Li,Ii,(function(t){t.preventDefault(),qi.getOrCreateInstance(this).toggle()})),m(qi);const Vi="backdrop",Ki="show",Qi=`mousedown.bs.${Vi}`,Xi={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},Yi={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class Ui extends H{constructor(t){super(),this._config=this._getConfig(t),this._isAppended=!1,this._element=null}static get Default(){return Xi}static get DefaultType(){return Yi}static get NAME(){return Vi}show(t){if(!this._config.isVisible)return void g(t);this._append();const e=this._getElement();this._config.isAnimated&&d(e),e.classList.add(Ki),this._emulateAnimation((()=>{g(t)}))}hide(t){this._config.isVisible?(this._getElement().classList.remove(Ki),this._emulateAnimation((()=>{this.dispose(),g(t)}))):g(t)}dispose(){this._isAppended&&(N.off(this._element,Qi),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const t=document.createElement("div");t.className=this._config.className,this._config.isAnimated&&t.classList.add("fade"),this._element=t}return this._element}_configAfterMerge(t){return t.rootElement=r(t.rootElement),t}_append(){if(this._isAppended)return;const t=this._getElement();this._config.rootElement.append(t),N.on(t,Qi,(()=>{g(this._config.clickCallback)})),this._isAppended=!0}_emulateAnimation(t){_(t,this._getElement(),this._config.isAnimated)}}const Gi=".bs.focustrap",Ji=`focusin${Gi}`,Zi=`keydown.tab${Gi}`,tn="backward",en={autofocus:!0,trapElement:null},nn={autofocus:"boolean",trapElement:"element"};class sn extends H{constructor(t){super(),this._config=this._getConfig(t),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return en}static get DefaultType(){return nn}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),N.off(document,Gi),N.on(document,Ji,(t=>this._handleFocusin(t))),N.on(document,Zi,(t=>this._handleKeydown(t))),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,N.off(document,Gi))}_handleFocusin(t){const{trapElement:e}=this._config;if(t.target===document||t.target===e||e.contains(t.target))return;const i=z.focusableChildren(e);0===i.length?e.focus():this._lastTabNavDirection===tn?i[i.length-1].focus():i[0].focus()}_handleKeydown(t){"Tab"===t.key&&(this._lastTabNavDirection=t.shiftKey?tn:"forward")}}const on=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",rn=".sticky-top",an="padding-right",ln="margin-right";class cn{constructor(){this._element=document.body}getWidth(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}hide(){const t=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,an,(e=>e+t)),this._setElementAttributes(on,an,(e=>e+t)),this._setElementAttributes(rn,ln,(e=>e-t))}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,an),this._resetElementAttributes(on,an),this._resetElementAttributes(rn,ln)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(t,e,i){const n=this.getWidth();this._applyManipulationCallback(t,(t=>{if(t!==this._element&&window.innerWidth>t.clientWidth+n)return;this._saveInitialAttribute(t,e);const s=window.getComputedStyle(t).getPropertyValue(e);t.style.setProperty(e,`${i(Number.parseFloat(s))}px`)}))}_saveInitialAttribute(t,e){const i=t.style.getPropertyValue(e);i&&F.setDataAttribute(t,e,i)}_resetElementAttributes(t,e){this._applyManipulationCallback(t,(t=>{const i=F.getDataAttribute(t,e);null!==i?(F.removeDataAttribute(t,e),t.style.setProperty(e,i)):t.style.removeProperty(e)}))}_applyManipulationCallback(t,e){if(o(t))e(t);else for(const i of z.find(t,this._element))e(i)}}const hn=".bs.modal",dn=`hide${hn}`,un=`hidePrevented${hn}`,fn=`hidden${hn}`,pn=`show${hn}`,mn=`shown${hn}`,gn=`resize${hn}`,_n=`click.dismiss${hn}`,bn=`mousedown.dismiss${hn}`,vn=`keydown.dismiss${hn}`,yn=`click${hn}.data-api`,wn="modal-open",An="show",En="modal-static",Tn={backdrop:!0,focus:!0,keyboard:!0},Cn={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class On extends W{constructor(t,e){super(t,e),this._dialog=z.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new cn,this._addEventListeners()}static get Default(){return Tn}static get DefaultType(){return Cn}static get NAME(){return"modal"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||this._isTransitioning||N.trigger(this._element,pn,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(wn),this._adjustDialog(),this._backdrop.show((()=>this._showElement(t))))}hide(){this._isShown&&!this._isTransitioning&&(N.trigger(this._element,dn).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(An),this._queueCallback((()=>this._hideModal()),this._element,this._isAnimated())))}dispose(){N.off(window,hn),N.off(this._dialog,hn),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new Ui({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new sn({trapElement:this._element})}_showElement(t){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const e=z.findOne(".modal-body",this._dialog);e&&(e.scrollTop=0),d(this._element),this._element.classList.add(An),this._queueCallback((()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,N.trigger(this._element,mn,{relatedTarget:t})}),this._dialog,this._isAnimated())}_addEventListeners(){N.on(this._element,vn,(t=>{"Escape"===t.key&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())})),N.on(window,gn,(()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()})),N.on(this._element,bn,(t=>{N.one(this._element,_n,(e=>{this._element===t.target&&this._element===e.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition())}))}))}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide((()=>{document.body.classList.remove(wn),this._resetAdjustments(),this._scrollBar.reset(),N.trigger(this._element,fn)}))}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(N.trigger(this._element,un).defaultPrevented)return;const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._element.style.overflowY;"hidden"===e||this._element.classList.contains(En)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(En),this._queueCallback((()=>{this._element.classList.remove(En),this._queueCallback((()=>{this._element.style.overflowY=e}),this._dialog)}),this._dialog),this._element.focus())}_adjustDialog(){const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._scrollBar.getWidth(),i=e>0;if(i&&!t){const t=p()?"paddingLeft":"paddingRight";this._element.style[t]=`${e}px`}if(!i&&t){const t=p()?"paddingRight":"paddingLeft";this._element.style[t]=`${e}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(t,e){return this.each((function(){const i=On.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t](e)}}))}}N.on(document,yn,'[data-bs-toggle="modal"]',(function(t){const e=z.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&t.preventDefault(),N.one(e,pn,(t=>{t.defaultPrevented||N.one(e,fn,(()=>{a(this)&&this.focus()}))}));const i=z.findOne(".modal.show");i&&On.getInstance(i).hide(),On.getOrCreateInstance(e).toggle(this)})),R(On),m(On);const xn=".bs.offcanvas",kn=".data-api",Ln=`load${xn}${kn}`,Sn="show",Dn="showing",$n="hiding",In=".offcanvas.show",Nn=`show${xn}`,Pn=`shown${xn}`,Mn=`hide${xn}`,jn=`hidePrevented${xn}`,Fn=`hidden${xn}`,Hn=`resize${xn}`,Wn=`click${xn}${kn}`,Bn=`keydown.dismiss${xn}`,zn={backdrop:!0,keyboard:!0,scroll:!1},Rn={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class qn extends W{constructor(t,e){super(t,e),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return zn}static get DefaultType(){return Rn}static get NAME(){return"offcanvas"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||N.trigger(this._element,Nn,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._backdrop.show(),this._config.scroll||(new cn).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(Dn),this._queueCallback((()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(Sn),this._element.classList.remove(Dn),N.trigger(this._element,Pn,{relatedTarget:t})}),this._element,!0))}hide(){this._isShown&&(N.trigger(this._element,Mn).defaultPrevented||(this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add($n),this._backdrop.hide(),this._queueCallback((()=>{this._element.classList.remove(Sn,$n),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new cn).reset(),N.trigger(this._element,Fn)}),this._element,!0)))}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const t=Boolean(this._config.backdrop);return new Ui({className:"offcanvas-backdrop",isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?()=>{"static"!==this._config.backdrop?this.hide():N.trigger(this._element,jn)}:null})}_initializeFocusTrap(){return new sn({trapElement:this._element})}_addEventListeners(){N.on(this._element,Bn,(t=>{"Escape"===t.key&&(this._config.keyboard?this.hide():N.trigger(this._element,jn))}))}static jQueryInterface(t){return this.each((function(){const e=qn.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}N.on(document,Wn,'[data-bs-toggle="offcanvas"]',(function(t){const e=z.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&t.preventDefault(),l(this))return;N.one(e,Fn,(()=>{a(this)&&this.focus()}));const i=z.findOne(In);i&&i!==e&&qn.getInstance(i).hide(),qn.getOrCreateInstance(e).toggle(this)})),N.on(window,Ln,(()=>{for(const t of z.find(In))qn.getOrCreateInstance(t).show()})),N.on(window,Hn,(()=>{for(const t of z.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(t).position&&qn.getOrCreateInstance(t).hide()})),R(qn),m(qn);const Vn={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Kn=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Qn=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,Xn=(t,e)=>{const i=t.nodeName.toLowerCase();return e.includes(i)?!Kn.has(i)||Boolean(Qn.test(t.nodeValue)):e.filter((t=>t instanceof RegExp)).some((t=>t.test(i)))},Yn={allowList:Vn,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
"},Un={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},Gn={entry:"(string|element|function|null)",selector:"(string|element)"};class Jn extends H{constructor(t){super(),this._config=this._getConfig(t)}static get Default(){return Yn}static get DefaultType(){return Un}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map((t=>this._resolvePossibleFunction(t))).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(t){return this._checkContent(t),this._config.content={...this._config.content,...t},this}toHtml(){const t=document.createElement("div");t.innerHTML=this._maybeSanitize(this._config.template);for(const[e,i]of Object.entries(this._config.content))this._setContent(t,i,e);const e=t.children[0],i=this._resolvePossibleFunction(this._config.extraClass);return i&&e.classList.add(...i.split(" ")),e}_typeCheckConfig(t){super._typeCheckConfig(t),this._checkContent(t.content)}_checkContent(t){for(const[e,i]of Object.entries(t))super._typeCheckConfig({selector:e,entry:i},Gn)}_setContent(t,e,i){const n=z.findOne(i,t);n&&((e=this._resolvePossibleFunction(e))?o(e)?this._putElementInTemplate(r(e),n):this._config.html?n.innerHTML=this._maybeSanitize(e):n.textContent=e:n.remove())}_maybeSanitize(t){return this._config.sanitize?function(t,e,i){if(!t.length)return t;if(i&&"function"==typeof i)return i(t);const n=(new window.DOMParser).parseFromString(t,"text/html"),s=[].concat(...n.body.querySelectorAll("*"));for(const t of s){const i=t.nodeName.toLowerCase();if(!Object.keys(e).includes(i)){t.remove();continue}const n=[].concat(...t.attributes),s=[].concat(e["*"]||[],e[i]||[]);for(const e of n)Xn(e,s)||t.removeAttribute(e.nodeName)}return n.body.innerHTML}(t,this._config.allowList,this._config.sanitizeFn):t}_resolvePossibleFunction(t){return g(t,[this])}_putElementInTemplate(t,e){if(this._config.html)return e.innerHTML="",void e.append(t);e.textContent=t.textContent}}const Zn=new Set(["sanitize","allowList","sanitizeFn"]),ts="fade",es="show",is=".modal",ns="hide.bs.modal",ss="hover",os="focus",rs={AUTO:"auto",TOP:"top",RIGHT:p()?"left":"right",BOTTOM:"bottom",LEFT:p()?"right":"left"},as={allowList:Vn,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'',title:"",trigger:"hover focus"},ls={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class cs extends W{constructor(t,e){if(void 0===vi)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(t,e),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return as}static get DefaultType(){return ls}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),N.off(this._element.closest(is),ns,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const t=N.trigger(this._element,this.constructor.eventName("show")),e=(c(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(t.defaultPrevented||!e)return;this._disposePopper();const i=this._getTipElement();this._element.setAttribute("aria-describedby",i.getAttribute("id"));const{container:n}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(n.append(i),N.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(i),i.classList.add(es),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))N.on(t,"mouseover",h);this._queueCallback((()=>{N.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1}),this.tip,this._isAnimated())}hide(){if(this._isShown()&&!N.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented){if(this._getTipElement().classList.remove(es),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))N.off(t,"mouseover",h);this._activeTrigger.click=!1,this._activeTrigger[os]=!1,this._activeTrigger[ss]=!1,this._isHovered=null,this._queueCallback((()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),N.trigger(this._element,this.constructor.eventName("hidden")))}),this.tip,this._isAnimated())}}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(t){const e=this._getTemplateFactory(t).toHtml();if(!e)return null;e.classList.remove(ts,es),e.classList.add(`bs-${this.constructor.NAME}-auto`);const i=(t=>{do{t+=Math.floor(1e6*Math.random())}while(document.getElementById(t));return t})(this.constructor.NAME).toString();return e.setAttribute("id",i),this._isAnimated()&&e.classList.add(ts),e}setContent(t){this._newContent=t,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(t){return this._templateFactory?this._templateFactory.changeContent(t):this._templateFactory=new Jn({...this._config,content:t,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{".tooltip-inner":this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(t){return this.constructor.getOrCreateInstance(t.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(ts)}_isShown(){return this.tip&&this.tip.classList.contains(es)}_createPopper(t){const e=g(this._config.placement,[this,t,this._element]),i=rs[e.toUpperCase()];return bi(this._element,t,this._getPopperConfig(i))}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map((t=>Number.parseInt(t,10))):"function"==typeof t?e=>t(e,this._element):t}_resolvePossibleFunction(t){return g(t,[this._element])}_getPopperConfig(t){const e={placement:t,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:t=>{this._getTipElement().setAttribute("data-popper-placement",t.state.placement)}}]};return{...e,...g(this._config.popperConfig,[e])}}_setListeners(){const t=this._config.trigger.split(" ");for(const e of t)if("click"===e)N.on(this._element,this.constructor.eventName("click"),this._config.selector,(t=>{this._initializeOnDelegatedTarget(t).toggle()}));else if("manual"!==e){const t=e===ss?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),i=e===ss?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");N.on(this._element,t,this._config.selector,(t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusin"===t.type?os:ss]=!0,e._enter()})),N.on(this._element,i,this._config.selector,(t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusout"===t.type?os:ss]=e._element.contains(t.relatedTarget),e._leave()}))}this._hideModalHandler=()=>{this._element&&this.hide()},N.on(this._element.closest(is),ns,this._hideModalHandler)}_fixTitle(){const t=this._element.getAttribute("title");t&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",t),this._element.setAttribute("data-bs-original-title",t),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout((()=>{this._isHovered&&this.show()}),this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout((()=>{this._isHovered||this.hide()}),this._config.delay.hide))}_setTimeout(t,e){clearTimeout(this._timeout),this._timeout=setTimeout(t,e)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(t){const e=F.getDataAttributes(this._element);for(const t of Object.keys(e))Zn.has(t)&&delete e[t];return t={...e,..."object"==typeof t&&t?t:{}},t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t.container=!1===t.container?document.body:r(t.container),"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),t}_getDelegateConfig(){const t={};for(const[e,i]of Object.entries(this._config))this.constructor.Default[e]!==i&&(t[e]=i);return t.selector=!1,t.trigger="manual",t}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(t){return this.each((function(){const e=cs.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}}m(cs);const hs={...cs.Default,content:"",offset:[0,8],placement:"right",template:'',trigger:"click"},ds={...cs.DefaultType,content:"(null|string|element|function)"};class us extends cs{static get Default(){return hs}static get DefaultType(){return ds}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{".popover-header":this._getTitle(),".popover-body":this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(t){return this.each((function(){const e=us.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}}m(us);const fs=".bs.scrollspy",ps=`activate${fs}`,ms=`click${fs}`,gs=`load${fs}.data-api`,_s="active",bs="[href]",vs=".nav-link",ys=`${vs}, .nav-item > ${vs}, .list-group-item`,ws={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},As={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class Es extends W{constructor(t,e){super(t,e),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return ws}static get DefaultType(){return As}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const t of this._observableSections.values())this._observer.observe(t)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(t){return t.target=r(t.target)||document.body,t.rootMargin=t.offset?`${t.offset}px 0px -30%`:t.rootMargin,"string"==typeof t.threshold&&(t.threshold=t.threshold.split(",").map((t=>Number.parseFloat(t)))),t}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(N.off(this._config.target,ms),N.on(this._config.target,ms,bs,(t=>{const e=this._observableSections.get(t.target.hash);if(e){t.preventDefault();const i=this._rootElement||window,n=e.offsetTop-this._element.offsetTop;if(i.scrollTo)return void i.scrollTo({top:n,behavior:"smooth"});i.scrollTop=n}})))}_getNewObserver(){const t={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver((t=>this._observerCallback(t)),t)}_observerCallback(t){const e=t=>this._targetLinks.get(`#${t.target.id}`),i=t=>{this._previousScrollData.visibleEntryTop=t.target.offsetTop,this._process(e(t))},n=(this._rootElement||document.documentElement).scrollTop,s=n>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=n;for(const o of t){if(!o.isIntersecting){this._activeTarget=null,this._clearActiveClass(e(o));continue}const t=o.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(s&&t){if(i(o),!n)return}else s||t||i(o)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const t=z.find(bs,this._config.target);for(const e of t){if(!e.hash||l(e))continue;const t=z.findOne(decodeURI(e.hash),this._element);a(t)&&(this._targetLinks.set(decodeURI(e.hash),e),this._observableSections.set(e.hash,t))}}_process(t){this._activeTarget!==t&&(this._clearActiveClass(this._config.target),this._activeTarget=t,t.classList.add(_s),this._activateParents(t),N.trigger(this._element,ps,{relatedTarget:t}))}_activateParents(t){if(t.classList.contains("dropdown-item"))z.findOne(".dropdown-toggle",t.closest(".dropdown")).classList.add(_s);else for(const e of z.parents(t,".nav, .list-group"))for(const t of z.prev(e,ys))t.classList.add(_s)}_clearActiveClass(t){t.classList.remove(_s);const e=z.find(`${bs}.${_s}`,t);for(const t of e)t.classList.remove(_s)}static jQueryInterface(t){return this.each((function(){const e=Es.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}))}}N.on(window,gs,(()=>{for(const t of z.find('[data-bs-spy="scroll"]'))Es.getOrCreateInstance(t)})),m(Es);const Ts=".bs.tab",Cs=`hide${Ts}`,Os=`hidden${Ts}`,xs=`show${Ts}`,ks=`shown${Ts}`,Ls=`click${Ts}`,Ss=`keydown${Ts}`,Ds=`load${Ts}`,$s="ArrowLeft",Is="ArrowRight",Ns="ArrowUp",Ps="ArrowDown",Ms="Home",js="End",Fs="active",Hs="fade",Ws="show",Bs=":not(.dropdown-toggle)",zs='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',Rs=`.nav-link${Bs}, .list-group-item${Bs}, [role="tab"]${Bs}, ${zs}`,qs=`.${Fs}[data-bs-toggle="tab"], .${Fs}[data-bs-toggle="pill"], .${Fs}[data-bs-toggle="list"]`;class Vs extends W{constructor(t){super(t),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),N.on(this._element,Ss,(t=>this._keydown(t))))}static get NAME(){return"tab"}show(){const t=this._element;if(this._elemIsActive(t))return;const e=this._getActiveElem(),i=e?N.trigger(e,Cs,{relatedTarget:t}):null;N.trigger(t,xs,{relatedTarget:e}).defaultPrevented||i&&i.defaultPrevented||(this._deactivate(e,t),this._activate(t,e))}_activate(t,e){t&&(t.classList.add(Fs),this._activate(z.getElementFromSelector(t)),this._queueCallback((()=>{"tab"===t.getAttribute("role")?(t.removeAttribute("tabindex"),t.setAttribute("aria-selected",!0),this._toggleDropDown(t,!0),N.trigger(t,ks,{relatedTarget:e})):t.classList.add(Ws)}),t,t.classList.contains(Hs)))}_deactivate(t,e){t&&(t.classList.remove(Fs),t.blur(),this._deactivate(z.getElementFromSelector(t)),this._queueCallback((()=>{"tab"===t.getAttribute("role")?(t.setAttribute("aria-selected",!1),t.setAttribute("tabindex","-1"),this._toggleDropDown(t,!1),N.trigger(t,Os,{relatedTarget:e})):t.classList.remove(Ws)}),t,t.classList.contains(Hs)))}_keydown(t){if(![$s,Is,Ns,Ps,Ms,js].includes(t.key))return;t.stopPropagation(),t.preventDefault();const e=this._getChildren().filter((t=>!l(t)));let i;if([Ms,js].includes(t.key))i=e[t.key===Ms?0:e.length-1];else{const n=[Is,Ps].includes(t.key);i=b(e,t.target,n,!0)}i&&(i.focus({preventScroll:!0}),Vs.getOrCreateInstance(i).show())}_getChildren(){return z.find(Rs,this._parent)}_getActiveElem(){return this._getChildren().find((t=>this._elemIsActive(t)))||null}_setInitialAttributes(t,e){this._setAttributeIfNotExists(t,"role","tablist");for(const t of e)this._setInitialAttributesOnChild(t)}_setInitialAttributesOnChild(t){t=this._getInnerElement(t);const e=this._elemIsActive(t),i=this._getOuterElement(t);t.setAttribute("aria-selected",e),i!==t&&this._setAttributeIfNotExists(i,"role","presentation"),e||t.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(t,"role","tab"),this._setInitialAttributesOnTargetPanel(t)}_setInitialAttributesOnTargetPanel(t){const e=z.getElementFromSelector(t);e&&(this._setAttributeIfNotExists(e,"role","tabpanel"),t.id&&this._setAttributeIfNotExists(e,"aria-labelledby",`${t.id}`))}_toggleDropDown(t,e){const i=this._getOuterElement(t);if(!i.classList.contains("dropdown"))return;const n=(t,n)=>{const s=z.findOne(t,i);s&&s.classList.toggle(n,e)};n(".dropdown-toggle",Fs),n(".dropdown-menu",Ws),i.setAttribute("aria-expanded",e)}_setAttributeIfNotExists(t,e,i){t.hasAttribute(e)||t.setAttribute(e,i)}_elemIsActive(t){return t.classList.contains(Fs)}_getInnerElement(t){return t.matches(Rs)?t:z.findOne(Rs,t)}_getOuterElement(t){return t.closest(".nav-item, .list-group-item")||t}static jQueryInterface(t){return this.each((function(){const e=Vs.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}))}}N.on(document,Ls,zs,(function(t){["A","AREA"].includes(this.tagName)&&t.preventDefault(),l(this)||Vs.getOrCreateInstance(this).show()})),N.on(window,Ds,(()=>{for(const t of z.find(qs))Vs.getOrCreateInstance(t)})),m(Vs);const Ks=".bs.toast",Qs=`mouseover${Ks}`,Xs=`mouseout${Ks}`,Ys=`focusin${Ks}`,Us=`focusout${Ks}`,Gs=`hide${Ks}`,Js=`hidden${Ks}`,Zs=`show${Ks}`,to=`shown${Ks}`,eo="hide",io="show",no="showing",so={animation:"boolean",autohide:"boolean",delay:"number"},oo={animation:!0,autohide:!0,delay:5e3};class ro extends W{constructor(t,e){super(t,e),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return oo}static get DefaultType(){return so}static get NAME(){return"toast"}show(){N.trigger(this._element,Zs).defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add("fade"),this._element.classList.remove(eo),d(this._element),this._element.classList.add(io,no),this._queueCallback((()=>{this._element.classList.remove(no),N.trigger(this._element,to),this._maybeScheduleHide()}),this._element,this._config.animation))}hide(){this.isShown()&&(N.trigger(this._element,Gs).defaultPrevented||(this._element.classList.add(no),this._queueCallback((()=>{this._element.classList.add(eo),this._element.classList.remove(no,io),N.trigger(this._element,Js)}),this._element,this._config.animation)))}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(io),super.dispose()}isShown(){return this._element.classList.contains(io)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout((()=>{this.hide()}),this._config.delay)))}_onInteraction(t,e){switch(t.type){case"mouseover":case"mouseout":this._hasMouseInteraction=e;break;case"focusin":case"focusout":this._hasKeyboardInteraction=e}if(e)return void this._clearTimeout();const i=t.relatedTarget;this._element===i||this._element.contains(i)||this._maybeScheduleHide()}_setListeners(){N.on(this._element,Qs,(t=>this._onInteraction(t,!0))),N.on(this._element,Xs,(t=>this._onInteraction(t,!1))),N.on(this._element,Ys,(t=>this._onInteraction(t,!0))),N.on(this._element,Us,(t=>this._onInteraction(t,!1)))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(t){return this.each((function(){const e=ro.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}return R(ro),m(ro),{Alert:Q,Button:Y,Carousel:xt,Collapse:Bt,Dropdown:qi,Modal:On,Offcanvas:qn,Popover:us,ScrollSpy:Es,Tab:Vs,Toast:ro,Tooltip:cs}})); +//# sourceMappingURL=bootstrap.bundle.min.js.map \ No newline at end of file diff --git a/_site/worksheets/aesthetic-mappings_files/libs/clipboard/clipboard.min.js b/_site/worksheets/aesthetic-mappings_files/libs/clipboard/clipboard.min.js new file mode 100644 index 0000000..1103f81 --- /dev/null +++ b/_site/worksheets/aesthetic-mappings_files/libs/clipboard/clipboard.min.js @@ -0,0 +1,7 @@ +/*! + * clipboard.js v2.0.11 + * https://clipboardjs.com/ + * + * Licensed MIT © Zeno Rocha + */ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return n={686:function(t,e,n){"use strict";n.d(e,{default:function(){return b}});var e=n(279),i=n.n(e),e=n(370),u=n.n(e),e=n(817),r=n.n(e);function c(t){try{return document.execCommand(t)}catch(t){return}}var a=function(t){t=r()(t);return c("cut"),t};function o(t,e){var n,o,t=(n=t,o="rtl"===document.documentElement.getAttribute("dir"),(t=document.createElement("textarea")).style.fontSize="12pt",t.style.border="0",t.style.padding="0",t.style.margin="0",t.style.position="absolute",t.style[o?"right":"left"]="-9999px",o=window.pageYOffset||document.documentElement.scrollTop,t.style.top="".concat(o,"px"),t.setAttribute("readonly",""),t.value=n,t);return e.container.appendChild(t),e=r()(t),c("copy"),t.remove(),e}var f=function(t){var e=1.callout,.webr-ojs-exercise.exercise-hint>.callout{margin:-1rem;border:0}#exercise-loading-indicator{position:fixed;bottom:0;right:0;font-size:1.2rem;padding:.2rem .75rem;border:1px solid var(--exercise-gray);background-color:var(--exercise-cap-bg);border-top-left-radius:5px}#exercise-loading-indicator>.spinner-grow{min-width:1rem}.exercise-loading-details+.exercise-loading-details:before{content:"/ "}@media only screen and (max-width: 576px){#exercise-loading-indicator{font-size:.8rem;padding:.1rem .5rem}#exercise-loading-indicator>.spinner-grow{min-width:.66rem}#exercise-loading-indicator .gap-2{gap:.2rem!important}#exercise-loading-indicator .spinner-grow{--bs-spinner-width: .66rem;--bs-spinner-height: .66rem}}.btn.btn-exercise-editor:disabled,.btn.btn-exercise-editor.disabled,.btn-exercise-editor fieldset:disabled .btn{transition:opacity .5s}.card.exercise-editor .card-header a.btn{--bs-btn-padding-x: .5rem;--bs-btn-padding-y: .15rem;--bs-btn-font-size: .75rem}.quarto-dark .card.exercise-editor .card-header .btn.btn-outline-dark{--bs-btn-color: #f8f8f8;--bs-btn-border-color: #f8f8f8;--bs-btn-hover-color: #000;--bs-btn-hover-bg: #f8f8f8;--bs-btn-hover-border-color: #f8f8f8;--bs-btn-focus-shadow-rgb: 248, 248, 248;--bs-btn-active-color: #000;--bs-btn-active-bg: #f8f8f8;--bs-btn-active-border-color: #f8f8f8;--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);--bs-btn-disabled-color: #f8f8f8;--bs-btn-disabled-bg: transparent;--bs-btn-disabled-border-color: #f8f8f8;--bs-btn-bg: transparent;--bs-gradient: none}.card.exercise-editor{--exercise-min-lines: 0;--exercise-max-lines: infinity;--exercise-font-size: var(--bs-body-font-size, 1rem)}.card.exercise-editor .card-header{padding:.5rem 1rem;background-color:var(--exercise-cap-bg);border-bottom:1px solid rgba(0,0,0,.175)}.card.exercise-editor .cm-editor{color:var(--exercise-code-block-color);background-color:var(--exercise-code-block-bg);max-height:calc(var(--exercise-max-lines) * 1.4 * var(--exercise-font-size) + 8px)}.card.exercise-editor .cm-content{caret-color:var(--exercise-code-block-color)}.card.exercise-editor .cm-cursor,.card.exercise-editor .cm-dropCursor{border-left-color:var(--exercise-code-block-color)}.card.exercise-editor .cm-focused .cm-selectionBackgroundm .cm-selectionBackground,.card.exercise-editor .cm-content ::selection{background-color:rgba(var(--exercise-primary-rgb),.1)}.card.exercise-editor .cm-activeLine{background-color:var(--exercise-line-bg)}.card.exercise-editor .cm-activeLineGutter{background-color:var(--exercise-line-gutter-bg)}.card.exercise-editor .cm-gutters{background-color:var(--exercise-cap-bg);color:var(--exercise-main-color);border-right:1px solid var(--exercise-gray)}.card.exercise-editor .cm-content,.card.exercise-editor .cm-gutter{min-height:calc(var(--exercise-min-lines) * 1.4 * var(--exercise-font-size) + 8px)}.card.exercise-editor .cm-scroller{line-height:1.4;overflow:auto}:root{--exercise-editor-hl-al: var(--quarto-hl-al-color, #AD0000);--exercise-editor-hl-an: var(--quarto-hl-an-color, #5E5E5E);--exercise-editor-hl-at: var(--quarto-hl-at-color, #657422);--exercise-editor-hl-bn: var(--quarto-hl-bn-color, #AD0000);--exercise-editor-hl-ch: var(--quarto-hl-ch-color, #20794D);--exercise-editor-hl-co: var(--quarto-hl-co-color, #5E5E5E);--exercise-editor-hl-cv: var(--quarto-hl-cv-color, #5E5E5E);--exercise-editor-hl-cn: var(--quarto-hl-cn-color, #8f5902);--exercise-editor-hl-cf: var(--quarto-hl-cf-color, #003B4F);--exercise-editor-hl-dt: var(--quarto-hl-dt-color, #AD0000);--exercise-editor-hl-dv: var(--quarto-hl-dv-color, #AD0000);--exercise-editor-hl-do: var(--quarto-hl-do-color, #5E5E5E);--exercise-editor-hl-er: var(--quarto-hl-er-color, #AD0000);--exercise-editor-hl-fl: var(--quarto-hl-fl-color, #AD0000);--exercise-editor-hl-fu: var(--quarto-hl-fu-color, #4758AB);--exercise-editor-hl-im: var(--quarto-hl-im-color, #00769E);--exercise-editor-hl-in: var(--quarto-hl-in-color, #5E5E5E);--exercise-editor-hl-kw: var(--quarto-hl-kw-color, #003B4F);--exercise-editor-hl-op: var(--quarto-hl-op-color, #5E5E5E);--exercise-editor-hl-ot: var(--quarto-hl-ot-color, #003B4F);--exercise-editor-hl-pp: var(--quarto-hl-pp-color, #AD0000);--exercise-editor-hl-sc: var(--quarto-hl-sc-color, #5E5E5E);--exercise-editor-hl-ss: var(--quarto-hl-ss-color, #20794D);--exercise-editor-hl-st: var(--quarto-hl-st-color, #20794D);--exercise-editor-hl-va: var(--quarto-hl-va-color, #111111);--exercise-editor-hl-vs: var(--quarto-hl-vs-color, #20794D);--exercise-editor-hl-wa: var(--quarto-hl-wa-color, #5E5E5E)}*[data-bs-theme=dark]{--exercise-editor-hl-al: var(--quarto-hl-al-color, #f07178);--exercise-editor-hl-an: var(--quarto-hl-an-color, #d4d0ab);--exercise-editor-hl-at: var(--quarto-hl-at-color, #00e0e0);--exercise-editor-hl-bn: var(--quarto-hl-bn-color, #d4d0ab);--exercise-editor-hl-bu: var(--quarto-hl-bu-color, #abe338);--exercise-editor-hl-ch: var(--quarto-hl-ch-color, #abe338);--exercise-editor-hl-co: var(--quarto-hl-co-color, #f8f8f2);--exercise-editor-hl-cv: var(--quarto-hl-cv-color, #ffd700);--exercise-editor-hl-cn: var(--quarto-hl-cn-color, #ffd700);--exercise-editor-hl-cf: var(--quarto-hl-cf-color, #ffa07a);--exercise-editor-hl-dt: var(--quarto-hl-dt-color, #ffa07a);--exercise-editor-hl-dv: var(--quarto-hl-dv-color, #d4d0ab);--exercise-editor-hl-do: var(--quarto-hl-do-color, #f8f8f2);--exercise-editor-hl-er: var(--quarto-hl-er-color, #f07178);--exercise-editor-hl-ex: var(--quarto-hl-ex-color, #00e0e0);--exercise-editor-hl-fl: var(--quarto-hl-fl-color, #d4d0ab);--exercise-editor-hl-fu: var(--quarto-hl-fu-color, #ffa07a);--exercise-editor-hl-im: var(--quarto-hl-im-color, #abe338);--exercise-editor-hl-in: var(--quarto-hl-in-color, #d4d0ab);--exercise-editor-hl-kw: var(--quarto-hl-kw-color, #ffa07a);--exercise-editor-hl-op: var(--quarto-hl-op-color, #ffa07a);--exercise-editor-hl-ot: var(--quarto-hl-ot-color, #00e0e0);--exercise-editor-hl-pp: var(--quarto-hl-pp-color, #dcc6e0);--exercise-editor-hl-re: var(--quarto-hl-re-color, #00e0e0);--exercise-editor-hl-sc: var(--quarto-hl-sc-color, #abe338);--exercise-editor-hl-ss: var(--quarto-hl-ss-color, #abe338);--exercise-editor-hl-st: var(--quarto-hl-st-color, #abe338);--exercise-editor-hl-va: var(--quarto-hl-va-color, #00e0e0);--exercise-editor-hl-vs: var(--quarto-hl-vs-color, #abe338);--exercise-editor-hl-wa: var(--quarto-hl-wa-color, #dcc6e0)}pre>code.sourceCode span.tok-keyword,.exercise-editor-body>.cm-editor span.tok-keyword{color:var(--exercise-editor-hl-kw)}pre>code.sourceCode span.tok-operator,.exercise-editor-body>.cm-editor span.tok-operator{color:var(--exercise-editor-hl-op)}pre>code.sourceCode span.tok-definitionOperator,.exercise-editor-body>.cm-editor span.tok-definitionOperator{color:var(--exercise-editor-hl-ot)}pre>code.sourceCode span.tok-compareOperator,.exercise-editor-body>.cm-editor span.tok-compareOperator{color:var(--exercise-editor-hl-ot)}pre>code.sourceCode span.tok-attributeName,.exercise-editor-body>.cm-editor span.tok-attributeName{color:var(--exercise-editor-hl-at)}pre>code.sourceCode span.tok-controlKeyword,.exercise-editor-body>.cm-editor span.tok-controlKeyword{color:var(--exercise-editor-hl-cf)}pre>code.sourceCode span.tok-comment,.exercise-editor-body>.cm-editor span.tok-comment{color:var(--exercise-editor-hl-co)}pre>code.sourceCode span.tok-string,.exercise-editor-body>.cm-editor span.tok-string{color:var(--exercise-editor-hl-st)}pre>code.sourceCode span.tok-string2,.exercise-editor-body>.cm-editor span.tok-string2{color:var(--exercise-editor-hl-ss)}pre>code.sourceCode span.tok-variableName,.exercise-editor-body>.cm-editor span.tok-variableName{color:var(--exercise-editor-hl-va)}pre>code.sourceCode span.tok-bool,pre>code.sourceCode span.tok-literal,pre>code.sourceCode span.tok-separator,.exercise-editor-body>.cm-editor span.tok-bool,.exercise-editor-body>.cm-editor span.tok-literal,.exercise-editor-body>.cm-editor span.tok-separator{color:var(--exercise-editor-hl-cn)}pre>code.sourceCode span.tok-bool,pre>code.sourceCode span.tok-literal,.exercise-editor-body>.cm-editor span.tok-bool,.exercise-editor-body>.cm-editor span.tok-literal{color:var(--exercise-editor-hl-cn)}pre>code.sourceCode span.tok-number,pre>code.sourceCode span.tok-integer,.exercise-editor-body>.cm-editor span.tok-number,.exercise-editor-body>.cm-editor span.tok-integer{color:var(--exercise-editor-hl-dv)}pre>code.sourceCode span.tok-function-variableName,.exercise-editor-body>.cm-editor span.tok-function-variableName{color:var(--exercise-editor-hl-fu)}pre>code.sourceCode span.tok-function-attributeName,.exercise-editor-body>.cm-editor span.tok-function-attributeName{color:var(--exercise-editor-hl-at)}div.exercise-cell-output.cell-output-stdout pre code,div.exercise-cell-output.cell-output-stderr pre code{white-space:pre-wrap;word-wrap:break-word}div.exercise-cell-output.cell-output-stderr pre code{color:var(--exercise-editor-hl-er, #AD0000)}div.cell-output-pyodide table{border:none;margin:0 auto 1em}div.cell-output-pyodide thead{border-bottom:1px solid var(--exercise-main-color)}div.cell-output-pyodide td,div.cell-output-pyodide th,div.cell-output-pyodide tr{padding:.5em;line-height:normal}div.cell-output-pyodide th{font-weight:700}div.cell-output-display canvas{background-color:#fff}.tab-pane>.exercise-tab-pane-header+div.webr-ojs-exercise{margin-top:1em}.alert .exercise-feedback p:last-child{margin-bottom:0}.alert.exercise-grade{animation-duration:.25s;animation-name:exercise-grade-slidein}@keyframes exercise-grade-slidein{0%{transform:translateY(10px);opacity:0}to{transform:translateY(0);opacity:1}}.alert.exercise-grade p:last-child{margin-bottom:0}.alert.exercise-grade pre{white-space:pre-wrap;color:inherit}.observablehq pre>code.sourceCode{white-space:pre;position:relative}.observablehq div.sourceCode{margin:1em 0!important}.observablehq pre.sourceCode{margin:0!important}@media screen{.observablehq div.sourceCode{overflow:auto}}@media print{.observablehq pre>code.sourceCode{white-space:pre-wrap}.observablehq pre>code.sourceCode>span{text-indent:-5em;padding-left:5em}}.reveal .d-none{display:none!important}.reveal .d-flex{display:flex!important}.reveal .card.exercise-editor .justify-content-between{justify-content:space-between!important}.reveal .card.exercise-editor .align-items-center{align-items:center!important}.reveal .card.exercise-editor .gap-1{gap:.25rem!important}.reveal .card.exercise-editor .gap-2{gap:.5rem!important}.reveal .card.exercise-editor .gap-3{gap:.75rem!important}.reveal .card.exercise-editor{--exercise-font-size: 1.3rem;margin:1rem 0;border:1px solid rgba(0,0,0,.175);border-radius:.375rem;font-size:var(--exercise-font-size);overflow:hidden}.reveal .card.exercise-editor .card-header{padding:.5rem 1rem;background-color:var(--exercise-cap-bg);border-bottom:1px solid rgba(0,0,0,.175)}.reveal .cell-output-webr.cell-output-display,.reveal .cell-output-pyodide.cell-output-display{text-align:center}.quarto-light .reveal .btn.btn-exercise-editor.btn-primary{--exercise-btn-bg: var(--bs-btn-bg, #0d6efd);--exercise-btn-color: var(--bs-btn-color, #ffffff);--exercise-btn-border-color: var(--bs-btn-border-color, #0d6efd);--exercise-btn-hover-border-color: var(--bs-btn-hover-border-color, #0b5ed7);--exercise-btn-hover-bg: var(--bs-btn-hover-bg, #0b5ed7);--exercise-btn-hover-color: var(--bs-btn-hover-color, #ffffff)}.quarto-dark .reveal .btn.btn-exercise-editor.btn-primary{--exercise-btn-bg: var(--bs-btn-bg, #375a7f);--exercise-btn-color: var(--bs-btn-color, #ffffff);--exercise-btn-border-color: var(--bs-btn-border-color, #375a7f);--exercise-btn-hover-border-color: var(--bs-btn-hover-border-color, #2c4866);--exercise-btn-hover-bg: var(--bs-btn-hover-bg, #2c4866);--exercise-btn-hover-color: var(--bs-btn-hover-color, #ffffff)}.quarto-light .reveal .btn.btn-exercise-editor.btn-outline-dark{--exercise-btn-bg: var(--bs-btn-bg, transparent);--exercise-btn-color: var(--bs-btn-color, #333);--exercise-btn-border-color: var(--bs-btn-border-color, #333);--exercise-btn-hover-border-color: var(--bs-btn-hover-border-color, #333);--exercise-btn-hover-bg: var(--bs-btn-hover-bg, #333);--exercise-btn-hover-color: var(--bs-btn-hover-color, #ffffff)}.quarto-dark .reveal .btn.btn-exercise-editor.btn-outline-dark{--exercise-btn-bg: var(--bs-btn-bg, transparent);--exercise-btn-color: var(--bs-btn-color, #f8f8f8);--exercise-btn-border-color: var(--bs-btn-border-color, #f8f8f8);--exercise-btn-hover-border-color: var(--bs-btn-hover-border-color, #f8f8f8);--exercise-btn-hover-bg: var(--bs-btn-hover-bg, #f8f8f8);--exercise-btn-hover-color: var(--bs-btn-hover-color, #000000)}@media only screen and (max-width: 576px){:not(.reveal) .card-header .btn-exercise-editor>.btn-label-exercise-editor{max-width:0px;margin-left:-4px;overflow:hidden;transition:max-width .2s ease-in,margin-left .05s ease-out .2s}:not(.reveal) .card-header .btn-exercise-editor:hover>.btn-label-exercise-editor{position:inherit;max-width:80px;margin-left:0;transition:max-width .2s ease-out .05s,margin-left .05s ease-in}}.reveal .card.exercise-editor .btn-group{border-radius:.375rem;position:relative;display:inline-flex;vertical-align:middle}.reveal .card.exercise-editor .btn-group>.btn{position:relative;flex:1 1 auto}.reveal .card.exercise-editor .btn-group>:not(.btn-check:first-child)+.btn,.reveal .card.exercise-editor .btn-group>.btn-group:not(:first-child){margin-left:-1px}.reveal .card.exercise-editor .btn-group>.btn:not(:last-child):not(.dropdown-toggle),.reveal .card.exercise-editor .btn-group>.btn.dropdown-toggle-split:first-child,.reveal .card.exercise-editor .btn-group>.btn-group:not(:last-child)>.btn{border-top-right-radius:0;border-bottom-right-radius:0}.reveal .card.exercise-editor .btn-group>.btn:nth-child(n+3),.reveal .card.exercise-editor .btn-group>:not(.btn-check)+.btn,.reveal .card.exercise-editor .btn-group>.btn-group:not(:first-child)>.btn{border-top-left-radius:0;border-bottom-left-radius:0}.reveal .btn.btn-exercise-editor{display:inline-block;padding:.25rem .5rem;font-size:1rem;color:var(--exercise-btn-color);background-color:var(--exercise-btn-bg);text-align:center;text-decoration:none;vertical-align:middle;cursor:pointer;user-select:none;border:1px solid var(--exercise-btn-border-color);border-radius:.375rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}.reveal .btn.btn-exercise-editor:hover{color:var(--exercise-btn-hover-color);background-color:var(--exercise-btn-hover-bg);border-color:var(--exercise-btn-hover-border-color)}.reveal .btn.btn-exercise-editor:disabled,.reveal .btn.btn-exercise-editor.disabled,.reveal .btn-exercise-editor fieldset:disabled .btn{pointer-events:none;opacity:.65}.reveal .card.exercise-editor .spinner-grow{background-color:currentcolor;opacity:0;display:inline-block;width:1.5rem;height:1.5rem;vertical-align:-.125em;border-radius:50%;animation:.75s linear infinite spinner-grow}.reveal .cell-output-container pre code{overflow:auto;max-height:initial}.reveal .alert.exercise-grade{font-size:.55em;position:relative;padding:1rem;margin:1rem 0;border-radius:.25rem;color:var(--exercise-alert-color);background-color:var(--exercise-alert-bg);border:1px solid var(--exercise-alert-border-color)}.reveal .alert.exercise-grade .alert-link{font-weight:700;color:var(--exercise-alert-link-color)}.quarto-light .reveal .exercise-grade.alert-info{--exercise-alert-color: #055160;--exercise-alert-bg: #cff4fc;--exercise-alert-border-color: #9eeaf9;--exercise-alert-link-color: #055160}.quarto-light .reveal .exercise-grade.alert-success{--exercise-alert-color: #0a3622;--exercise-alert-bg: #d1e7dd;--exercise-alert-border-color: #a3cfbb;--exercise-alert-link-color: #0a3622}.quarto-light .reveal .exercise-grade.alert-warning{--exercise-alert-color: #664d03;--exercise-alert-bg: #fff3cd;--exercise-alert-border-color: #ffe69c;--exercise-alert-link-color: #664d03}.quarto-light .reveal .exercise-grade.alert-danger{--exercise-alert-color: #58151c;--exercise-alert-bg: #f8d7da;--exercise-alert-border-color: #f1aeb5;--exercise-alert-link-color: #58151c}.quarto-dark .reveal .exercise-grade.alert-info{--exercise-alert-color: #ffffff;--exercise-alert-bg: #3498db;--exercise-alert-border-color: #3498db;--exercise-alert-link-color: #ffffff}.quarto-dark .reveal .exercise-grade.alert-success{--exercise-alert-color: #ffffff;--exercise-alert-bg: #00bc8c;--exercise-alert-border-color: #00bc8c;--exercise-alert-link-color: #ffffff}.quarto-dark .reveal .exercise-grade.alert-warning{--exercise-alert-color: #ffffff;--exercise-alert-bg: #f39c12;--exercise-alert-border-color: #f39c12;--exercise-alert-link-color: #ffffff}.quarto-dark .reveal .exercise-grade.alert-danger{--exercise-alert-color: #ffffff;--exercise-alert-bg: #e74c3c;--exercise-alert-border-color: #e74c3c;--exercise-alert-link-color: #ffffff} diff --git a/_site/worksheets/aesthetic-mappings_files/libs/quarto-contrib/live-runtime/live-runtime.js b/_site/worksheets/aesthetic-mappings_files/libs/quarto-contrib/live-runtime/live-runtime.js new file mode 100644 index 0000000..6ef7945 --- /dev/null +++ b/_site/worksheets/aesthetic-mappings_files/libs/quarto-contrib/live-runtime/live-runtime.js @@ -0,0 +1,131 @@ +var vO=Object.defineProperty;var ci=(i=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(i,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):i)(function(i){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+i+'" is not supported')});var jt=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),xO=(i,e)=>{for(var t in e)vO(i,t,{get:e[t],enumerable:!0})};var iO=jt((RP,Uk)=>{Uk.exports=` + + +`});var nO=jt((EP,Fk)=>{Fk.exports=` + + + +`});var rO=jt((AP,Hk)=>{Hk.exports=` + +`});var sO=jt((QP,Gk)=>{Gk.exports=` + +`});var fO=jt((sC,Kk)=>{Kk.exports="CmltcG9ydCBweW9kaWRlICMgdHlwZTogaWdub3JlW2F0dHItZGVmaW5lZF0KaW1wb3J0IHN5cwoKIyBDbGVhbnVwIGFueSBsZWZ0b3ZlciBtYXRwbG90bGliIHBsb3RzCnRyeToKICBpbXBvcnQgbWF0cGxvdGxpYi5weXBsb3QgYXMgcGx0CiAgcGx0LmNsb3NlKCJhbGwiKQogIHBsdC5yY1BhcmFtc1siZmlndXJlLmZpZ3NpemUiXSA9ICh3aWR0aCwgaGVpZ2h0KSAjIHR5cGU6IGlnbm9yZVthdHRyLWRlZmluZWRdCiAgcGx0LnJjUGFyYW1zWyJmaWd1cmUuZHBpIl0gPSBkcGkgIyB0eXBlOiBpZ25vcmVbYXR0ci1kZWZpbmVkXQpleGNlcHQgTW9kdWxlTm90Rm91bmRFcnJvcjoKICBwYXNzCgpmcm9tIElQeXRob24udXRpbHMgaW1wb3J0IGNhcHR1cmUKZnJvbSBJUHl0aG9uLmRpc3BsYXkgaW1wb3J0IGRpc3BsYXkKZnJvbSBJUHl0aG9uLmNvcmUuaW50ZXJhY3RpdmVzaGVsbCBpbXBvcnQgSW50ZXJhY3RpdmVTaGVsbApJbnRlcmFjdGl2ZVNoZWxsKCkuaW5zdGFuY2UoKQoKd2l0aCBjYXB0dXJlLmNhcHR1cmVfb3V0cHV0KCkgYXMgb3V0cHV0OgogIHZhbHVlID0gTm9uZQogIHRyeToKICAgIHZhbHVlID0gYXdhaXQgcHlvZGlkZS5jb2RlLmV2YWxfY29kZV9hc3luYyhjb2RlLCBnbG9iYWxzID0gZW52aXJvbm1lbnQpICMgdHlwZTogaWdub3JlW2F0dHItZGVmaW5lZF0KICBleGNlcHQgRXhjZXB0aW9uIGFzIGVycjoKICAgIHByaW50KGVyciwgZmlsZT1zeXMuc3RkZXJyKQogIGlmICh2YWx1ZSBpcyBub3QgTm9uZSk6CiAgICBkaXNwbGF5KHZhbHVlKQoKewogICJ2YWx1ZSI6IHZhbHVlLAogICJzdGRvdXQiOiBvdXRwdXQuc3Rkb3V0LAogICJzdGRlcnIiOiBvdXRwdXQuc3RkZXJyLAogICJvdXRwdXRzIjogb3V0cHV0Lm91dHB1dHMsCn0K"});var yO=jt((MC,nS)=>{nS.exports="IyBDcmVhdGUgZW52aXJvbm1lbnQgdG8gaG9sZCB2YXJpYWJsZXMgZXhwb3J0ZWQgd2l0aCBvanNfZGVmaW5lCi53ZWJyX29qcyA8LSBuZXcuZW52KCkKb2pzX2RlZmluZSA8LSBmdW5jdGlvbiguLi4pIHsKICBhcmdzIDwtIGxpc3QoLi4uKQogIG5hbWVzKGFyZ3MpIDwtIHF1b3RlKG1hdGNoLmNhbGwoZXhwYW5kLmRvdHM9VFJVRSlbMTpsZW5ndGgoYXJncykgKyAxXSkKICAud2Vicl9vanMgPDwtIGxpc3QyZW52KGFyZ3MsIGVudmlyID0gLndlYnJfb2pzKQp9CgojIHdlYlIgZ3JhcGhpY3MgZGV2aWNlIHNldHRpbmdzCm9wdGlvbnMod2Vici5maWcud2lkdGggPSA3LCB3ZWJyLmZpZy5oZWlnaHQgPSA1KQppZiAod2Vicjo6ZXZhbF9qcygndHlwZW9mIE9mZnNjcmVlbkNhbnZhcyAhPT0gInVuZGVmaW5lZCInKSkgewogIG9wdGlvbnMoZGV2aWNlID0gZnVuY3Rpb24oLi4uKSB7CiAgICBhcmdzIDwtIGxpc3QoYmcgPSAid2hpdGUiLCAuLi4pCiAgICBhcmdzIDwtIGFyZ3NbIWR1cGxpY2F0ZWQobmFtZXMoYXJncykpXQogICAgZG8uY2FsbCh3ZWJyOjpjYW52YXMsIGFyZ3MpCiAgfSkKfQoKIyBDdXN0b20gcGFnZXIgZm9yIGRpc3BsYXlpbmcgZS5nLiBoZWxwIHBhZ2VzCm9wdGlvbnMocGFnZXIgPSBmdW5jdGlvbihmaWxlcywgLi4uKSB7CiAgd3JpdGVMaW5lcyhnc3ViKCIuW1xiXSIsICIiLCByZWFkTGluZXMoZmlsZXMpKSkKfSkKCiMgQ3VzdG9tIHZhbHVlIGhhbmRsZXIgYW5kIHJlbmRlcmluZyBmb3IgZXZhbHVhdGUgYW5kIGtuaXRyCm9wdGlvbnMoIndlYnIuZXZhbHVhdGUuaGFuZGxlciIgPSBldmFsdWF0ZTo6bmV3X291dHB1dF9oYW5kbGVyKAogIHZhbHVlID0gZnVuY3Rpb24oeCwgdmlzaWJsZSkgewogICAga25pdF9vcHRpb25zID0gbGlzdChzY3JlZW5zaG90LmZvcmNlID0gRkFMU0UpCiAgICByZXMgPC0gaWYgKHZpc2libGUpIHsKICAgICAgd2l0aFZpc2libGUoCiAgICAgICAga25pdHI6OmtuaXRfcHJpbnQoCiAgICAgICAgICBpZiAoaW5oZXJpdHMoeCwgImRhdGEuZnJhbWUiKSkgewogICAgICAgICAgICBzd2l0Y2goCiAgICAgICAgICAgICAgZ2V0T3B0aW9uKCJ3ZWJyLnJlbmRlci5kZiIsICJkZWZhdWx0IiksCiAgICAgICAgICAgICAgImthYmxlIiA9IGtuaXRyOjprYWJsZSh4KSwKICAgICAgICAgICAgICAiZHQiID0gRFQ6OmRhdGF0YWJsZSh4KSwKICAgICAgICAgICAgICAicGFnZWQtdGFibGUiID0gcm1hcmtkb3duOjpwYWdlZF90YWJsZSh4KSwKICAgICAgICAgICAgICAiZ3QiID0gZ3Q6Omd0KHgpLAogICAgICAgICAgICAgICJndC1pbnRlcmFjdGl2ZSIgPSBndDo6b3B0X2ludGVyYWN0aXZlKGd0OjpndCh4KSksCiAgICAgICAgICAgICAgInJlYWN0YWJsZSIgPSByZWFjdGFibGU6OnJlYWN0YWJsZSh4KSwKICAgICAgICAgICAgICB4CiAgICAgICAgICAgICkKICAgICAgICAgIH0gZWxzZSB4LAogICAgICAgIG9wdGlvbnMgPSBrbml0X29wdGlvbnMpCiAgICAgICkKICAgIH0gZWxzZSBsaXN0KHZhbHVlID0geCwgdmlzaWJsZSA9IEZBTFNFKQogICAgcmVzJGNsYXNzIDwtIGNsYXNzKHJlcyR2YWx1ZSkKICAgIGNsYXNzKHJlcykgPC0gInJlc3VsdCIKICAgIHJlcwogIH0KKSkKCiMgQWRkaXRpb25hbCBwYWNrYWdlIG9wdGlvbnMKb3B0aW9ucyhrbml0ci50YWJsZS5mb3JtYXQgPSAiaHRtbCIpCm9wdGlvbnMocmdsLnByaW50Umdsd2lkZ2V0ID0gVFJVRSkKCiMgRGVmYXVsdCBleGVyY2lzZSBncmFkZXIKIyBUT0RPOiBoYW5kbGUgZXJyb3JfY2hlY2sgJiBjb2RlX2NoZWNrIHN0YWdlcwpvcHRpb25zKHdlYnIuZXhlcmNpc2UuY2hlY2tlciA9IGZ1bmN0aW9uKAogIGxhYmVsLCB1c2VyX2NvZGUsIHNvbHV0aW9uX2NvZGUsIGNoZWNrX2NvZGUsIGVudmlyX3Jlc3VsdCwgZXZhbHVhdGVfcmVzdWx0LAogIGVudmlyX3ByZXAsIGxhc3RfdmFsdWUsIGVuZ2luZSwgc3RhZ2UsIC4uLgopIHsKICAjIFNldHVwIGVudmlyb25tZW50CiAgLmxhYmVsIDwtIGxhYmVsCiAgLnVzZXJfY29kZSA8LSB1c2VyX2NvZGUKICAuc29sdXRpb25fY29kZSA8LSBzb2x1dGlvbl9jb2RlCiAgLmNoZWNrX2NvZGUgPC0gY2hlY2tfY29kZQogIC5lbnZpcl9yZXN1bHQgPC0gZW52aXJfcmVzdWx0CiAgLmV2YWx1YXRlX3Jlc3VsdCA8LSBldmFsdWF0ZV9yZXN1bHQKICAuZW52aXJfcHJlcCA8LSBlbnZpcl9wcmVwCiAgLmxhc3RfdmFsdWUgPC0gbGFzdF92YWx1ZQogIC5yZXN1bHQgPC0gbGFzdF92YWx1ZQogIC51c2VyIDwtIGxhc3RfdmFsdWUKICAuZW5naW5lIDwtIGVuZ2luZQogIC5zdGFnZSA8LSBzdGFnZQoKICBpZiAoaXMubnVsbCguY2hlY2tfY29kZSkpIHsKICAgICMgTm8gZ3JhZGluZyBjb2RlLCBzbyBqdXN0IHNraXAgZ3JhZGluZwogICAgcmV0dXJuKGludmlzaWJsZShOVUxMKSkKICB9CgogIHRyeUNhdGNoKHsKICAgICMgUGFyc2UgcHJvdmlkZWQgY2hlY2sgY29kZQogICAgcGFyc2VkX2NoZWNrX2NvZGUgPC0gcGFyc2UodGV4dCA9IGNoZWNrX2NvZGUpCgogICAgIyBFdmFsdWF0ZSBwcm92aWRlZCBjaGVjayBjb2RlCiAgICBldmFsKHBhcnNlZF9jaGVja19jb2RlKQogIH0sIGVycm9yID0gZnVuY3Rpb24oZSkgewogICAgbGlzdCgKICAgICAgbWVzc2FnZSA9IHBhc3RlMCgiRXJyb3IgaW4gY2hlY2tpbmcgY29kZSBmb3IgYCIsIGxhYmVsLCAiYDogIiwgZSRtZXNzYWdlKSwKICAgICAgY29ycmVjdCA9IEZBTFNFLAogICAgICBsb2NhdGlvbiA9ICJhcHBlbmQiLAogICAgICB0eXBlID0gIndhcm5pbmciCiAgICApCiAgfSkKfSkK"});var bO=jt((_C,rS)=>{rS.exports="aW1wb3J0IHN5cwppbXBvcnQgb3MKaW1wb3J0IHB5b2RpZGVfaHR0cCAgIyB0eXBlOiBpZ25vcmVbYXR0ci1kZWZpbmVkXQpweW9kaWRlX2h0dHAucGF0Y2hfYWxsKCkKc3lzLnBhdGguaW5zZXJ0KDAsICIvcHlvZGlkZS8iKQpvcy5ta2Rpcihvcy5wYXRoLmV4cGFuZHVzZXIoIn4vLm1hdHBsb3RsaWIiKSkKZiA9IG9wZW4ob3MucGF0aC5leHBhbmR1c2VyKCJ+Ly5tYXRwbG90bGliL21hdHBsb3RsaWJyYyIpLCAiYSIpCmYud3JpdGUoImJhY2tlbmQ6IG1vZHVsZTovL21hdHBsb3RsaWJfZGlzcGxheSIpCmYuY2xvc2UoKQo="});var wO=jt((DC,sS)=>{sS.exports="IyBCYXNlZCBvbiBweW9kaWRlL21hdHBsb3RsaWJfcHlvZGlkZS9odG1sNV9jYW52YXNfYmFja2VuZC5weQojIE1vZGlmaWVkIGZvciBPZmZzY3JlZW5DYW52YXMgcmVuZGVyaW5nIHVuZGVyIFdlYiBXb3JrZXIKIyBMaWNlbnNlOiBNb3ppbGxhIFB1YmxpYyBMaWNlbnNlIFZlcnNpb24gMi4wCgppbXBvcnQgbWF0aAppbXBvcnQgbnVtcHkgYXMgbnAKZnJvbSBtYXRwbG90bGliLmJhY2tlbmRfYmFzZXMgaW1wb3J0ICgKICAgIEZpZ3VyZUNhbnZhc0Jhc2UsCiAgICBGaWd1cmVNYW5hZ2VyQmFzZSwKICAgIFJlbmRlcmVyQmFzZSwKICAgIEdyYXBoaWNzQ29udGV4dEJhc2UsCiAgICBfQmFja2VuZCwKKQpmcm9tIG1hdHBsb3RsaWIuY2Jvb2sgaW1wb3J0IG1heGRpY3QKZnJvbSBtYXRwbG90bGliLmZvbnRfbWFuYWdlciBpbXBvcnQgZmluZGZvbnQKZnJvbSBtYXRwbG90bGliLmZ0MmZvbnQgaW1wb3J0IExPQURfTk9fSElOVElORywgRlQyRm9udApmcm9tIG1hdHBsb3RsaWIubWF0aHRleHQgaW1wb3J0IE1hdGhUZXh0UGFyc2VyCmZyb20gbWF0cGxvdGxpYi5jb2xvcnMgaW1wb3J0IGNvbG9yQ29udmVydGVyLCByZ2IyaGV4CmZyb20gbWF0cGxvdGxpYi5wYXRoIGltcG9ydCBQYXRoCmZyb20gbWF0cGxvdGxpYi50cmFuc2Zvcm1zIGltcG9ydCBBZmZpbmUyRApmcm9tIElQeXRob24uZGlzcGxheSBpbXBvcnQgZGlzcGxheQpmcm9tIGpzIGltcG9ydCBJbWFnZURhdGEsIE9mZnNjcmVlbkNhbnZhcyAjIHR5cGU6IGlnbm9yZVthdHRyLWRlZmluZWRdCmZyb20gcHlvZGlkZS5mZmkgaW1wb3J0IGNyZWF0ZV9wcm94eSAjIHR5cGU6IGlnbm9yZVthdHRyLWRlZmluZWRdCmltcG9ydCBsb2dnaW5nCgpfY2Fwc3R5bGVfZCA9IHsicHJvamVjdGluZyI6ICJzcXVhcmUiLCAiYnV0dCI6ICJidXR0IiwgInJvdW5kIjogInJvdW5kIn0KbG9nZ2luZy5nZXRMb2dnZXIoJ21hdHBsb3RsaWIuZm9udF9tYW5hZ2VyJykuZGlzYWJsZWQgPSBUcnVlCgpjbGFzcyBSaWNoSW1hZ2VCaXRtYXBPdXRwdXQoKToKICAgIGRlZiBfX2luaXRfXyhzZWxmLCBmaWd1cmUpOgogICAgICAgIHNlbGYuaW1hZ2UgPSBmaWd1cmUuX2ltYWdlYml0bWFwCiAgICAgICAgc2VsZi50aXRsZSA9IGZpZ3VyZS5fdGl0bGUKCiAgICBkZWYgX3JlcHJfbWltZWJ1bmRsZV8oc2VsZiwgaW5jbHVkZSwgZXhjbHVkZSk6CiAgICAgICAgcmV0dXJuIHsgImFwcGxpY2F0aW9uL2h0bWwtaW1hZ2ViaXRtYXAiOiBzZWxmLmltYWdlIH0sIHsgInRpdGxlIjogc2VsZi50aXRsZSB9CgpjbGFzcyBGaWd1cmVDYW52YXNXb3JrZXIoRmlndXJlQ2FudmFzQmFzZSk6CiAgICBkZWYgX19pbml0X18oc2VsZiwgKmFyZ3MsICoqa3dhcmdzKToKICAgICAgICBGaWd1cmVDYW52YXNCYXNlLl9faW5pdF9fKHNlbGYsICphcmdzLCAqKmt3YXJncykKICAgICAgICBzZWxmLl9pZGxlX3NjaGVkdWxlZCA9IEZhbHNlCiAgICAgICAgc2VsZi5faWQgPSAibWF0cGxvdGxpYl8iICsgaGV4KGlkKHNlbGYpKVsyOl0KICAgICAgICBzZWxmLl90aXRsZSA9ICIiCiAgICAgICAgc2VsZi5fcmF0aW8gPSAyCgogICAgICAgIHdpZHRoLCBoZWlnaHQgPSBzZWxmLmdldF93aWR0aF9oZWlnaHQoKQogICAgICAgIHdpZHRoICo9IHNlbGYuX3JhdGlvCiAgICAgICAgaGVpZ2h0ICo9IHNlbGYuX3JhdGlvCgogICAgICAgIHNlbGYuX2NhbnZhcyA9IE9mZnNjcmVlbkNhbnZhcy5uZXcod2lkdGgsIGhlaWdodCkKICAgICAgICBzZWxmLl9jb250ZXh0ID0gc2VsZi5fY2FudmFzLmdldENvbnRleHQoIjJkIikKICAgICAgICBzZWxmLl9pbWFnZWJpdG1hcCA9IE5vbmUKCiAgICBkZWYgc2hvdyhzZWxmLCAqYXJncywgKiprd2FyZ3MpOgogICAgICAgIHNlbGYuY2xvc2UoKQogICAgICAgIHNlbGYuZHJhdygpCiAgICAgICAgc2VsZi5faW1hZ2ViaXRtYXAgPSBzZWxmLl9jYW52YXMudHJhbnNmZXJUb0ltYWdlQml0bWFwKCkKICAgICAgICBkaXNwbGF5KFJpY2hJbWFnZUJpdG1hcE91dHB1dChzZWxmKSkKCiAgICBkZWYgZHJhdyhzZWxmKToKICAgICAgICBzZWxmLl9pZGxlX3NjaGVkdWxlZCA9IFRydWUKICAgICAgICBvcmlnX2RwaSA9IHNlbGYuZmlndXJlLmRwaQogICAgICAgIGlmIHNlbGYuX3JhdGlvICE9IDE6CiAgICAgICAgICAgIHNlbGYuZmlndXJlLmRwaSAqPSBzZWxmLl9yYXRpbwogICAgICAgIHRyeToKICAgICAgICAgICAgd2lkdGgsIGhlaWdodCA9IHNlbGYuZ2V0X3dpZHRoX2hlaWdodCgpCiAgICAgICAgICAgIGlmIHNlbGYuX2NhbnZhcyBpcyBOb25lOgogICAgICAgICAgICAgICAgcmV0dXJuCiAgICAgICAgICAgIHJlbmRlcmVyID0gUmVuZGVyZXJIVE1MQ2FudmFzV29ya2VyKHNlbGYuX2NvbnRleHQsIHdpZHRoLCBoZWlnaHQsIHNlbGYuZmlndXJlLmRwaSwgc2VsZikKICAgICAgICAgICAgc2VsZi5maWd1cmUuZHJhdyhyZW5kZXJlcikKICAgICAgICBleGNlcHQgRXhjZXB0aW9uIGFzIGU6CiAgICAgICAgICAgIHJhaXNlIFJ1bnRpbWVFcnJvcigiUmVuZGVyaW5nIGZhaWxlZCIpIGZyb20gZQogICAgICAgIGZpbmFsbHk6CiAgICAgICAgICAgIHNlbGYuZmlndXJlLmRwaSA9IG9yaWdfZHBpCiAgICAgICAgICAgIHNlbGYuX2lkbGVfc2NoZWR1bGVkID0gRmFsc2UKCiAgICBkZWYgc2V0X3dpbmRvd190aXRsZShzZWxmLCB0aXRsZSk6CiAgICAgICAgc2VsZi5fdGl0bGUgPSB0aXRsZQoKICAgIGRlZiBjbG9zZShzZWxmKToKICAgICAgICBpZiAoc2VsZi5faW1hZ2ViaXRtYXApOgogICAgICAgICAgICBzZWxmLl9pbWFnZWJpdG1hcC5jbG9zZSgpCiAgICAgICAgICAgIHNlbGYuX2ltYWdlYml0bWFwID0gTm9uZQoKICAgIGRlZiBkZXN0cm95KHNlbGYsICphcmdzLCAqKmt3YXJncyk6CiAgICAgICAgc2VsZi5jbG9zZSgpCgpjbGFzcyBHcmFwaGljc0NvbnRleHRIVE1MQ2FudmFzKEdyYXBoaWNzQ29udGV4dEJhc2UpOgogICAgZGVmIF9faW5pdF9fKHNlbGYsIHJlbmRlcmVyKToKICAgICAgICBzdXBlcigpLl9faW5pdF9fKCkKICAgICAgICBzZWxmLnN0cm9rZSA9IFRydWUKICAgICAgICBzZWxmLnJlbmRlcmVyID0gcmVuZGVyZXIKCiAgICBkZWYgcmVzdG9yZShzZWxmKToKICAgICAgICBzZWxmLnJlbmRlcmVyLmN0eC5yZXN0b3JlKCkKCiAgICBkZWYgc2V0X2NhcHN0eWxlKHNlbGYsIGNzKToKICAgICAgICBpZiBjcyBpbiBbImJ1dHQiLCAicm91bmQiLCAicHJvamVjdGluZyJdOgogICAgICAgICAgICBzZWxmLl9jYXBzdHlsZSA9IGNzCiAgICAgICAgICAgIHNlbGYucmVuZGVyZXIuY3R4LmxpbmVDYXAgPSBfY2Fwc3R5bGVfZFtjc10KICAgICAgICBlbHNlOgogICAgICAgICAgICByYWlzZSBWYWx1ZUVycm9yKGYiVW5yZWNvZ25pemVkIGNhcCBzdHlsZS4gRm91bmQge2NzfSIpCgogICAgZGVmIHNldF9jbGlwX3JlY3RhbmdsZShzZWxmLCByZWN0YW5nbGUpOgogICAgICAgIHNlbGYucmVuZGVyZXIuY3R4LnNhdmUoKQogICAgICAgIGlmIG5vdCByZWN0YW5nbGU6CiAgICAgICAgICAgIHNlbGYucmVuZGVyZXIuY3R4LnJlc3RvcmUoKQogICAgICAgICAgICByZXR1cm4KICAgICAgICB4LCB5LCB3LCBoID0gbnAucm91bmQocmVjdGFuZ2xlLmJvdW5kcykKICAgICAgICBzZWxmLnJlbmRlcmVyLmN0eC5iZWdpblBhdGgoKQogICAgICAgIHNlbGYucmVuZGVyZXIuY3R4LnJlY3QoeCwgc2VsZi5yZW5kZXJlci5oZWlnaHQgLSB5IC0gaCwgdywgaCkKICAgICAgICBzZWxmLnJlbmRlcmVyLmN0eC5jbGlwKCkKCiAgICBkZWYgc2V0X2NsaXBfcGF0aChzZWxmLCBwYXRoKToKICAgICAgICBzZWxmLnJlbmRlcmVyLmN0eC5zYXZlKCkKICAgICAgICBpZiBub3QgcGF0aDoKICAgICAgICAgICAgc2VsZi5yZW5kZXJlci5jdHgucmVzdG9yZSgpCiAgICAgICAgICAgIHJldHVybgogICAgICAgIHRwYXRoLCBhZmZpbmUgPSBwYXRoLmdldF90cmFuc2Zvcm1lZF9wYXRoX2FuZF9hZmZpbmUoKQogICAgICAgIGFmZmluZSA9IGFmZmluZSArIEFmZmluZTJEKCkuc2NhbGUoMSwgLTEpLnRyYW5zbGF0ZSgwLCBzZWxmLnJlbmRlcmVyLmhlaWdodCkKICAgICAgICBzZWxmLnJlbmRlcmVyLl9wYXRoX2hlbHBlcihzZWxmLnJlbmRlcmVyLmN0eCwgdHBhdGgsIGFmZmluZSkKICAgICAgICBzZWxmLnJlbmRlcmVyLmN0eC5jbGlwKCkKCiAgICBkZWYgc2V0X2Rhc2hlcyhzZWxmLCBkYXNoX29mZnNldCwgZGFzaF9saXN0KToKICAgICAgICBzZWxmLl9kYXNoZXMgPSBkYXNoX29mZnNldCwgZGFzaF9saXN0CiAgICAgICAgaWYgZGFzaF9vZmZzZXQgaXMgbm90IE5vbmU6CiAgICAgICAgICAgIHNlbGYucmVuZGVyZXIuY3R4LmxpbmVEYXNoT2Zmc2V0ID0gZGFzaF9vZmZzZXQKICAgICAgICBpZiBkYXNoX2xpc3QgaXMgTm9uZToKICAgICAgICAgICAgc2VsZi5yZW5kZXJlci5jdHguc2V0TGluZURhc2goW10pCiAgICAgICAgZWxzZToKICAgICAgICAgICAgZGxuID0gbnAuYXNhcnJheShkYXNoX2xpc3QpCiAgICAgICAgICAgIGRsID0gbGlzdChzZWxmLnJlbmRlcmVyLnBvaW50c190b19waXhlbHMoZGxuKSkKICAgICAgICAgICAgc2VsZi5yZW5kZXJlci5jdHguc2V0TGluZURhc2goZGwpCgogICAgZGVmIHNldF9qb2luc3R5bGUoc2VsZiwganMpOgogICAgICAgIGlmIGpzIGluIFsibWl0ZXIiLCAicm91bmQiLCAiYmV2ZWwiXToKICAgICAgICAgICAgc2VsZi5fam9pbnN0eWxlID0ganMKICAgICAgICAgICAgc2VsZi5yZW5kZXJlci5jdHgubGluZUpvaW4gPSBqcwogICAgICAgIGVsc2U6CiAgICAgICAgICAgIHJhaXNlIFZhbHVlRXJyb3IoZiJVbnJlY29nbml6ZWQgam9pbiBzdHlsZS4gRm91bmQge2pzfSIpCgogICAgZGVmIHNldF9saW5ld2lkdGgoc2VsZiwgdyk6CiAgICAgICAgc2VsZi5zdHJva2UgPSB3ICE9IDAKICAgICAgICBzZWxmLl9saW5ld2lkdGggPSBmbG9hdCh3KQogICAgICAgIHNlbGYucmVuZGVyZXIuY3R4LmxpbmVXaWR0aCA9IHNlbGYucmVuZGVyZXIucG9pbnRzX3RvX3BpeGVscyhmbG9hdCh3KSkKCmNsYXNzIFJlbmRlcmVySFRNTENhbnZhc1dvcmtlcihSZW5kZXJlckJhc2UpOgogICAgZGVmIF9faW5pdF9fKHNlbGYsIGN0eCwgd2lkdGgsIGhlaWdodCwgZHBpLCBmaWcpOgogICAgICAgIHN1cGVyKCkuX19pbml0X18oKQogICAgICAgIHNlbGYuZmlnID0gZmlnCiAgICAgICAgc2VsZi5jdHggPSBjdHgKICAgICAgICBzZWxmLndpZHRoID0gd2lkdGgKICAgICAgICBzZWxmLmhlaWdodCA9IGhlaWdodAogICAgICAgIHNlbGYuY3R4LndpZHRoID0gc2VsZi53aWR0aAogICAgICAgIHNlbGYuY3R4LmhlaWdodCA9IHNlbGYuaGVpZ2h0CiAgICAgICAgc2VsZi5kcGkgPSBkcGkKICAgICAgICBzZWxmLmZvbnRkID0gbWF4ZGljdCg1MCkKICAgICAgICBzZWxmLm1hdGh0ZXh0X3BhcnNlciA9IE1hdGhUZXh0UGFyc2VyKCJiaXRtYXAiKQoKICAgICAgICAjIEtlZXAgdGhlIHN0YXRlIG9mIGZvbnRmYWNlcyB0aGF0IGFyZSBsb2FkaW5nCiAgICAgICAgc2VsZi5mb250c19sb2FkaW5nID0ge30KCiAgICBkZWYgbmV3X2djKHNlbGYpOgogICAgICAgIHJldHVybiBHcmFwaGljc0NvbnRleHRIVE1MQ2FudmFzKHJlbmRlcmVyPXNlbGYpCgogICAgZGVmIHBvaW50c190b19waXhlbHMoc2VsZiwgcG9pbnRzKToKICAgICAgICByZXR1cm4gKHBvaW50cyAvIDcyLjApICogc2VsZi5kcGkKCiAgICBkZWYgX21hdHBsb3RsaWJfY29sb3JfdG9fQ1NTKHNlbGYsIGNvbG9yLCBhbHBoYSwgYWxwaGFfb3ZlcnJpZGVzLCBpc19SR0I9VHJ1ZSk6CiAgICAgICAgaWYgbm90IGlzX1JHQjoKICAgICAgICAgICAgUiwgRywgQiwgYWxwaGEgPSBjb2xvckNvbnZlcnRlci50b19yZ2JhKGNvbG9yKQogICAgICAgICAgICBjb2xvciA9IChSLCBHLCBCKQoKICAgICAgICBpZiAobGVuKGNvbG9yKSA9PSA0KSBhbmQgKGFscGhhIGlzIE5vbmUpOgogICAgICAgICAgICBhbHBoYSA9IGNvbG9yWzNdCgogICAgICAgIGlmIGFscGhhIGlzIE5vbmU6CiAgICAgICAgICAgIENTU19jb2xvciA9IHJnYjJoZXgoY29sb3JbOjNdKQoKICAgICAgICBlbHNlOgogICAgICAgICAgICBSID0gaW50KGNvbG9yWzBdICogMjU1KQogICAgICAgICAgICBHID0gaW50KGNvbG9yWzFdICogMjU1KQogICAgICAgICAgICBCID0gaW50KGNvbG9yWzJdICogMjU1KQogICAgICAgICAgICBpZiBsZW4oY29sb3IpID09IDMgb3IgYWxwaGFfb3ZlcnJpZGVzOgogICAgICAgICAgICAgICAgQ1NTX2NvbG9yID0gZiIiInJnYmEoe1I6ZH0sIHtHOmR9LCB7QjpkfSwge2FscGhhOi4zZ30pIiIiCiAgICAgICAgICAgIGVsc2U6CiAgICAgICAgICAgICAgICBDU1NfY29sb3IgPSAiIiJyZ2JhKHs6ZH0sIHs6ZH0sIHs6ZH0sIHs6LjNnfSkiIiIuZm9ybWF0KAogICAgICAgICAgICAgICAgICAgIFIsIEcsIEIsIGNvbG9yWzNdCiAgICAgICAgICAgICAgICApCgogICAgICAgIHJldHVybiBDU1NfY29sb3IKCiAgICBkZWYgX3NldF9zdHlsZShzZWxmLCBnYywgcmdiRmFjZT1Ob25lKToKICAgICAgICBpZiByZ2JGYWNlIGlzIG5vdCBOb25lOgogICAgICAgICAgICBzZWxmLmN0eC5maWxsU3R5bGUgPSBzZWxmLl9tYXRwbG90bGliX2NvbG9yX3RvX0NTUygKICAgICAgICAgICAgICAgIHJnYkZhY2UsIGdjLmdldF9hbHBoYSgpLCBnYy5nZXRfZm9yY2VkX2FscGhhKCkKICAgICAgICAgICAgKQoKICAgICAgICBpZiBnYy5nZXRfY2Fwc3R5bGUoKToKICAgICAgICAgICAgc2VsZi5jdHgubGluZUNhcCA9IF9jYXBzdHlsZV9kW2djLmdldF9jYXBzdHlsZSgpXQoKICAgICAgICBzZWxmLmN0eC5zdHJva2VTdHlsZSA9IHNlbGYuX21hdHBsb3RsaWJfY29sb3JfdG9fQ1NTKAogICAgICAgICAgICBnYy5nZXRfcmdiKCksIGdjLmdldF9hbHBoYSgpLCBnYy5nZXRfZm9yY2VkX2FscGhhKCkKICAgICAgICApCgogICAgICAgIHNlbGYuY3R4LmxpbmVXaWR0aCA9IHNlbGYucG9pbnRzX3RvX3BpeGVscyhnYy5nZXRfbGluZXdpZHRoKCkpCgogICAgZGVmIF9wYXRoX2hlbHBlcihzZWxmLCBjdHgsIHBhdGgsIHRyYW5zZm9ybSwgY2xpcD1Ob25lKToKICAgICAgICBjdHguYmVnaW5QYXRoKCkKICAgICAgICBmb3IgcG9pbnRzLCBjb2RlIGluIHBhdGguaXRlcl9zZWdtZW50cyh0cmFuc2Zvcm0sIHJlbW92ZV9uYW5zPVRydWUsIGNsaXA9Y2xpcCk6CiAgICAgICAgICAgIGlmIGNvZGUgPT0gUGF0aC5NT1ZFVE86CiAgICAgICAgICAgICAgICBjdHgubW92ZVRvKHBvaW50c1swXSwgcG9pbnRzWzFdKQogICAgICAgICAgICBlbGlmIGNvZGUgPT0gUGF0aC5MSU5FVE86CiAgICAgICAgICAgICAgICBjdHgubGluZVRvKHBvaW50c1swXSwgcG9pbnRzWzFdKQogICAgICAgICAgICBlbGlmIGNvZGUgPT0gUGF0aC5DVVJWRTM6CiAgICAgICAgICAgICAgICBjdHgucXVhZHJhdGljQ3VydmVUbygqcG9pbnRzKQogICAgICAgICAgICBlbGlmIGNvZGUgPT0gUGF0aC5DVVJWRTQ6CiAgICAgICAgICAgICAgICBjdHguYmV6aWVyQ3VydmVUbygqcG9pbnRzKQogICAgICAgICAgICBlbGlmIGNvZGUgPT0gUGF0aC5DTE9TRVBPTFk6CiAgICAgICAgICAgICAgICBjdHguY2xvc2VQYXRoKCkKCiAgICBkZWYgZHJhd19wYXRoKHNlbGYsIGdjLCBwYXRoLCB0cmFuc2Zvcm0sIHJnYkZhY2U9Tm9uZSk6CiAgICAgICAgc2VsZi5fc2V0X3N0eWxlKGdjLCByZ2JGYWNlKQogICAgICAgIGlmIHJnYkZhY2UgaXMgTm9uZSBhbmQgZ2MuZ2V0X2hhdGNoKCkgaXMgTm9uZToKICAgICAgICAgICAgZmlndXJlX2NsaXAgPSAoMCwgMCwgc2VsZi53aWR0aCwgc2VsZi5oZWlnaHQpCiAgICAgICAgZWxzZToKICAgICAgICAgICAgZmlndXJlX2NsaXAgPSBOb25lCgogICAgICAgIHRyYW5zZm9ybSArPSBBZmZpbmUyRCgpLnNjYWxlKDEsIC0xKS50cmFuc2xhdGUoMCwgc2VsZi5oZWlnaHQpCiAgICAgICAgc2VsZi5fcGF0aF9oZWxwZXIoc2VsZi5jdHgsIHBhdGgsIHRyYW5zZm9ybSwgZmlndXJlX2NsaXApCgogICAgICAgIGlmIHJnYkZhY2UgaXMgbm90IE5vbmU6CiAgICAgICAgICAgIHNlbGYuY3R4LmZpbGwoKQogICAgICAgICAgICBzZWxmLmN0eC5maWxsU3R5bGUgPSAiIzAwMDAwMCIKCiAgICAgICAgaWYgZ2Muc3Ryb2tlOgogICAgICAgICAgICBzZWxmLmN0eC5zdHJva2UoKQoKICAgIGRlZiBkcmF3X21hcmtlcnMoc2VsZiwgZ2MsIG1hcmtlcl9wYXRoLCBtYXJrZXJfdHJhbnMsIHBhdGgsIHRyYW5zLCByZ2JGYWNlPU5vbmUpOgogICAgICAgIHN1cGVyKCkuZHJhd19tYXJrZXJzKGdjLCBtYXJrZXJfcGF0aCwgbWFya2VyX3RyYW5zLCBwYXRoLCB0cmFucywgcmdiRmFjZSkKCiAgICBkZWYgX2dldF9mb250KHNlbGYsIHByb3ApOgogICAgICAgIGtleSA9IGhhc2gocHJvcCkKICAgICAgICBmb250X3ZhbHVlID0gc2VsZi5mb250ZC5nZXQoa2V5KQogICAgICAgIGlmIGZvbnRfdmFsdWUgaXMgTm9uZToKICAgICAgICAgICAgZm5hbWUgPSBmaW5kZm9udChwcm9wKQogICAgICAgICAgICBmb250X3ZhbHVlID0gc2VsZi5mb250ZC5nZXQoZm5hbWUpCiAgICAgICAgICAgIGlmIGZvbnRfdmFsdWUgaXMgTm9uZToKICAgICAgICAgICAgICAgIGZvbnQgPSBGVDJGb250KHN0cihmbmFtZSkpCiAgICAgICAgICAgICAgICBmb250X2ZpbGVfbmFtZSA9IGZuYW1lW2ZuYW1lLnJmaW5kKCIvIikgKyAxIDpdCiAgICAgICAgICAgICAgICBmb250X3ZhbHVlID0gZm9udCwgZm9udF9maWxlX25hbWUKICAgICAgICAgICAgICAgIHNlbGYuZm9udGRbZm5hbWVdID0gZm9udF92YWx1ZQogICAgICAgICAgICBzZWxmLmZvbnRkW2tleV0gPSBmb250X3ZhbHVlCiAgICAgICAgZm9udCwgZm9udF9maWxlX25hbWUgPSBmb250X3ZhbHVlCiAgICAgICAgZm9udC5jbGVhcigpCiAgICAgICAgZm9udC5zZXRfc2l6ZShwcm9wLmdldF9zaXplX2luX3BvaW50cygpLCBzZWxmLmRwaSkKICAgICAgICByZXR1cm4gZm9udCwgZm9udF9maWxlX25hbWUKCiAgICBkZWYgZ2V0X3RleHRfd2lkdGhfaGVpZ2h0X2Rlc2NlbnQoc2VsZiwgcywgcHJvcCwgaXNtYXRoKToKICAgICAgICB3OiBmbG9hdAogICAgICAgIGg6IGZsb2F0CiAgICAgICAgaWYgaXNtYXRoOgogICAgICAgICAgICBpbWFnZSwgZCA9IHNlbGYubWF0aHRleHRfcGFyc2VyLnBhcnNlKHMsIHNlbGYuZHBpLCBwcm9wKQogICAgICAgICAgICBpbWFnZV9hcnIgPSBucC5hc2FycmF5KGltYWdlKQogICAgICAgICAgICBoLCB3ID0gaW1hZ2VfYXJyLnNoYXBlCiAgICAgICAgZWxzZToKICAgICAgICAgICAgZm9udCwgXyA9IHNlbGYuX2dldF9mb250KHByb3ApCiAgICAgICAgICAgIGZvbnQuc2V0X3RleHQocywgMC4wLCBmbGFncz1MT0FEX05PX0hJTlRJTkcpCiAgICAgICAgICAgIHcsIGggPSBmb250LmdldF93aWR0aF9oZWlnaHQoKQogICAgICAgICAgICB3IC89IDY0LjAKICAgICAgICAgICAgaCAvPSA2NC4wCiAgICAgICAgICAgIGQgPSBmb250LmdldF9kZXNjZW50KCkgLyA2NC4wCiAgICAgICAgcmV0dXJuIHcsIGgsIGQKCiAgICBkZWYgX2RyYXdfbWF0aF90ZXh0KHNlbGYsIGdjLCB4LCB5LCBzLCBwcm9wLCBhbmdsZSk6CiAgICAgICAgcmdiYSwgZGVzY2VudCA9IHNlbGYubWF0aHRleHRfcGFyc2VyLnRvX3JnYmEoCiAgICAgICAgICAgIHMsIGdjLmdldF9yZ2IoKSwgc2VsZi5kcGksIHByb3AuZ2V0X3NpemVfaW5fcG9pbnRzKCkKICAgICAgICApCiAgICAgICAgaGVpZ2h0LCB3aWR0aCwgXyA9IHJnYmEuc2hhcGUKICAgICAgICBhbmdsZSA9IG1hdGgucmFkaWFucyhhbmdsZSkKICAgICAgICBpZiBhbmdsZSAhPSAwOgogICAgICAgICAgICBzZWxmLmN0eC5zYXZlKCkKICAgICAgICAgICAgc2VsZi5jdHgudHJhbnNsYXRlKHgsIHkpCiAgICAgICAgICAgIHNlbGYuY3R4LnJvdGF0ZSgtYW5nbGUpCiAgICAgICAgICAgIHNlbGYuY3R4LnRyYW5zbGF0ZSgteCwgLXkpCiAgICAgICAgc2VsZi5kcmF3X2ltYWdlKGdjLCB4LCAteSAtIGRlc2NlbnQsIG5wLmZsaXB1ZChyZ2JhKSkKICAgICAgICBpZiBhbmdsZSAhPSAwOgogICAgICAgICAgICBzZWxmLmN0eC5yZXN0b3JlKCkKCiAgICBkZWYgZHJhd19pbWFnZShzZWxmLCBnYywgeCwgeSwgaW0sIHRyYW5zZm9ybT1Ob25lKToKICAgICAgICBpbXBvcnQgbnVtcHkgYXMgbnAKICAgICAgICBpbSA9IG5wLmZsaXB1ZChpbSkKICAgICAgICBoLCB3LCBkID0gaW0uc2hhcGUKICAgICAgICB5ID0gc2VsZi5jdHguaGVpZ2h0IC0geSAtIGgKICAgICAgICBpbSA9IG5wLnJhdmVsKG5wLnVpbnQ4KG5wLnJlc2hhcGUoaW0sIChoICogdyAqIGQsIC0xKSkpKS50b2J5dGVzKCkKICAgICAgICBwaXhlbHNfcHJveHkgPSBjcmVhdGVfcHJveHkoaW0pCiAgICAgICAgcGl4ZWxzX2J1ZiA9IHBpeGVsc19wcm94eS5nZXRCdWZmZXIoInU4Y2xhbXBlZCIpCiAgICAgICAgaW1nX2RhdGEgPSBJbWFnZURhdGEubmV3KHBpeGVsc19idWYuZGF0YSwgdywgaCkKICAgICAgICBzZWxmLmN0eC5zYXZlKCkKICAgICAgICBpbl9tZW1vcnlfY2FudmFzID0gT2Zmc2NyZWVuQ2FudmFzLm5ldyh3LCBoKQogICAgICAgIGluX21lbW9yeV9jYW52YXNfY29udGV4dCA9IGluX21lbW9yeV9jYW52YXMuZ2V0Q29udGV4dCgiMmQiKQogICAgICAgIGluX21lbW9yeV9jYW52YXNfY29udGV4dC5wdXRJbWFnZURhdGEoaW1nX2RhdGEsIDAsIDApCiAgICAgICAgc2VsZi5jdHguZHJhd0ltYWdlKGluX21lbW9yeV9jYW52YXMsIHgsIHksIHcsIGgpCiAgICAgICAgc2VsZi5jdHgucmVzdG9yZSgpCiAgICAgICAgcGl4ZWxzX3Byb3h5LmRlc3Ryb3koKQogICAgICAgIHBpeGVsc19idWYucmVsZWFzZSgpCgogICAgZGVmIGRyYXdfdGV4dChzZWxmLCBnYywgeCwgeSwgcywgcHJvcCwgYW5nbGUsIGlzbWF0aD1GYWxzZSwgbXRleHQ9Tm9uZSk6CiAgICAgICAgaWYgaXNtYXRoOgogICAgICAgICAgICBzZWxmLl9kcmF3X21hdGhfdGV4dChnYywgeCwgeSwgcywgcHJvcCwgYW5nbGUpCiAgICAgICAgICAgIHJldHVybgoKICAgICAgICBhbmdsZSA9IG1hdGgucmFkaWFucyhhbmdsZSkKICAgICAgICB3aWR0aCwgaGVpZ2h0LCBkZXNjZW50ID0gc2VsZi5nZXRfdGV4dF93aWR0aF9oZWlnaHRfZGVzY2VudChzLCBwcm9wLCBpc21hdGgpCiAgICAgICAgeCAtPSBtYXRoLnNpbihhbmdsZSkgKiBkZXNjZW50CiAgICAgICAgeSAtPSBtYXRoLmNvcyhhbmdsZSkgKiBkZXNjZW50IC0gc2VsZi5jdHguaGVpZ2h0CiAgICAgICAgZm9udF9zaXplID0gc2VsZi5wb2ludHNfdG9fcGl4ZWxzKHByb3AuZ2V0X3NpemVfaW5fcG9pbnRzKCkpCgogICAgICAgIGZvbnRfcHJvcGVydHlfc3RyaW5nID0gInt9IHt9IHs6LjNnfXB4IHt9LCB7fSIuZm9ybWF0KAogICAgICAgICAgICBwcm9wLmdldF9zdHlsZSgpLAogICAgICAgICAgICBwcm9wLmdldF93ZWlnaHQoKSwKICAgICAgICAgICAgZm9udF9zaXplLAogICAgICAgICAgICBwcm9wLmdldF9uYW1lKCksCiAgICAgICAgICAgIHByb3AuZ2V0X2ZhbWlseSgpWzBdLAogICAgICAgICkKICAgICAgICBpZiBhbmdsZSAhPSAwOgogICAgICAgICAgICBzZWxmLmN0eC5zYXZlKCkKICAgICAgICAgICAgc2VsZi5jdHgudHJhbnNsYXRlKHgsIHkpCiAgICAgICAgICAgIHNlbGYuY3R4LnJvdGF0ZSgtYW5nbGUpCiAgICAgICAgICAgIHNlbGYuY3R4LnRyYW5zbGF0ZSgteCwgLXkpCiAgICAgICAgc2VsZi5jdHguZm9udCA9IGZvbnRfcHJvcGVydHlfc3RyaW5nCiAgICAgICAgc2VsZi5jdHguZmlsbFN0eWxlID0gc2VsZi5fbWF0cGxvdGxpYl9jb2xvcl90b19DU1MoCiAgICAgICAgICAgIGdjLmdldF9yZ2IoKSwgZ2MuZ2V0X2FscGhhKCksIGdjLmdldF9mb3JjZWRfYWxwaGEoKQogICAgICAgICkKICAgICAgICBzZWxmLmN0eC5maWxsVGV4dChzLCB4LCB5KQogICAgICAgIHNlbGYuY3R4LmZpbGxTdHlsZSA9ICIjMDAwMDAwIgogICAgICAgIGlmIGFuZ2xlICE9IDA6CiAgICAgICAgICAgIHNlbGYuY3R4LnJlc3RvcmUoKQoKY2xhc3MgRmlndXJlTWFuYWdlckhUTUxDYW52YXMoRmlndXJlTWFuYWdlckJhc2UpOgogICAgZGVmIF9faW5pdF9fKHNlbGYsIGNhbnZhcywgbnVtKToKICAgICAgICBzdXBlcigpLl9faW5pdF9fKGNhbnZhcywgbnVtKQogICAgICAgIHNlbGYuc2V0X3dpbmRvd190aXRsZSgiRmlndXJlICVkIiAlIG51bSkKCiAgICBkZWYgc2hvdyhzZWxmLCAqYXJncywgKiprd2FyZ3MpOgogICAgICAgIHNlbGYuY2FudmFzLnNob3coKmFyZ3MsICoqa3dhcmdzKQoKICAgIGRlZiBkZXN0cm95KHNlbGYsICphcmdzLCAqKmt3YXJncyk6CiAgICAgICAgc2VsZi5jYW52YXMuZGVzdHJveSgqYXJncywgKiprd2FyZ3MpCgogICAgZGVmIHJlc2l6ZShzZWxmLCB3LCBoKToKICAgICAgICBwYXNzCgogICAgZGVmIHNldF93aW5kb3dfdGl0bGUoc2VsZiwgdGl0bGUpOgogICAgICAgIHNlbGYuY2FudmFzLnNldF93aW5kb3dfdGl0bGUodGl0bGUpCgoKQF9CYWNrZW5kLmV4cG9ydApjbGFzcyBfQmFja2VuZFdhc21Db3JlQWdnKF9CYWNrZW5kKToKICAgIEZpZ3VyZUNhbnZhcyA9IEZpZ3VyZUNhbnZhc1dvcmtlcgogICAgRmlndXJlTWFuYWdlciA9IEZpZ3VyZU1hbmFnZXJIVE1MQ2FudmFzCgogICAgQHN0YXRpY21ldGhvZAogICAgZGVmIHNob3coKmFyZ3MsICoqa3dhcmdzKToKICAgICAgICBmcm9tIG1hdHBsb3RsaWIgaW1wb3J0IHB5cGxvdCBhcyBwbHQKICAgICAgICBwbHQuZ2NmKCkuY2FudmFzLnNob3coKmFyZ3MsICoqa3dhcmdzKQoKICAgIEBzdGF0aWNtZXRob2QKICAgIGRlZiBkZXN0cm95KCphcmdzLCAqKmt3YXJncyk6CiAgICAgICAgZnJvbSBtYXRwbG90bGliIGltcG9ydCBweXBsb3QgYXMgcGx0CiAgICAgICAgcGx0LmdjZigpLmNhbnZhcy5kZXN0cm95KCphcmdzLCAqKmt3YXJncykK"});var Ka={};xO(Ka,{ChannelType:()=>Qt,Console:()=>M0,Shelter:()=>Ba,WebR:()=>Uf,WebRChannelError:()=>pt,WebRError:()=>di,WebRPayloadError:()=>Bn,WebRWorkerError:()=>wf,isRCall:()=>gs,isRCharacter:()=>Ui,isRComplex:()=>R0,isRDouble:()=>C0,isREnvironment:()=>S0,isRFunction:()=>Os,isRInteger:()=>P0,isRList:()=>ot,isRLogical:()=>T0,isRNull:()=>Re,isRObject:()=>ee,isRPairlist:()=>k0,isRRaw:()=>Ja,isRSymbol:()=>x0});var kO=Object.create,pf=Object.defineProperty,SO=Object.getOwnPropertyDescriptor,TO=Object.getOwnPropertyNames,PO=Object.getPrototypeOf,CO=Object.prototype.hasOwnProperty,Bi=(i=>typeof ci<"u"?ci:typeof Proxy<"u"?new Proxy(i,{get:(e,t)=>(typeof ci<"u"?ci:e)[t]}):i)(function(i){if(typeof ci<"u")return ci.apply(this,arguments);throw new Error('Dynamic require of "'+i+'" is not supported')}),ke=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),RO=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of TO(e))!CO.call(i,r)&&r!==t&&pf(i,r,{get:()=>e[r],enumerable:!(n=SO(e,r))||n.enumerable});return i},Xi=(i,e,t)=>(t=i!=null?kO(PO(i)):{},RO(e||!i||!i.__esModule?pf(t,"default",{value:i,enumerable:!0}):t,i)),Xa=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},k=(i,e,t)=>(Xa(i,e,"read from private field"),t?t.call(i):e.get(i)),L=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},me=(i,e,t,n)=>(Xa(i,e,"write to private field"),n?n.call(i,t):e.set(i,t),t);var Je=(i,e,t)=>(Xa(i,e,"access private method"),t),cs=ke(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.getUint64=i.getInt64=i.setInt64=i.setUint64=i.UINT32_MAX=void 0,i.UINT32_MAX=4294967295;function e(s,o,a){let l=a/4294967296,h=a;s.setUint32(o,l),s.setUint32(o+4,h)}i.setUint64=e;function t(s,o,a){let l=Math.floor(a/4294967296),h=a;s.setUint32(o,l),s.setUint32(o+4,h)}i.setInt64=t;function n(s,o){let a=s.getInt32(o),l=s.getUint32(o+4);return a*4294967296+l}i.getInt64=n;function r(s,o){let a=s.getUint32(o),l=s.getUint32(o+4);return a*4294967296+l}i.getUint64=r}),Wa=ke(i=>{"use strict";var e,t,n;Object.defineProperty(i,"__esModule",{value:!0}),i.utf8DecodeTD=i.TEXT_DECODER_THRESHOLD=i.utf8DecodeJs=i.utf8EncodeTE=i.TEXT_ENCODER_THRESHOLD=i.utf8EncodeJs=i.utf8Count=void 0;var r=cs(),s=(typeof process>"u"||((e=process==null?void 0:process.env)===null||e===void 0?void 0:e.TEXT_ENCODING)!=="never")&&typeof TextEncoder<"u"&&typeof TextDecoder<"u";function o(p){let g=p.length,O=0,y=0;for(;y=55296&&v<=56319&&y>6&31|192;else{if(w>=55296&&w<=56319&&x>18&7|240,g[v++]=w>>12&63|128,g[v++]=w>>6&63|128):(g[v++]=w>>12&15|224,g[v++]=w>>6&63|128)}else{g[v++]=w;continue}g[v++]=w&63|128}}i.utf8EncodeJs=a;var l=s?new TextEncoder:void 0;i.TEXT_ENCODER_THRESHOLD=s?typeof process<"u"&&((t=process==null?void 0:process.env)===null||t===void 0?void 0:t.TEXT_ENCODING)!=="force"?200:0:r.UINT32_MAX;function h(p,g,O){g.set(l.encode(p),O)}function c(p,g,O){l.encodeInto(p,g.subarray(O))}i.utf8EncodeTE=l!=null&&l.encodeInto?c:h;var f=4096;function u(p,g,O){let y=g,v=y+O,x=[],w="";for(;y65535&&(V-=65536,x.push(V>>>10&1023|55296),V=56320|V&1023),x.push(V)}else x.push(P);x.length>=f&&(w+=String.fromCharCode(...x),x.length=0)}return x.length>0&&(w+=String.fromCharCode(...x)),w}i.utf8DecodeJs=u;var d=s?new TextDecoder:null;i.TEXT_DECODER_THRESHOLD=s?typeof process<"u"&&((n=process==null?void 0:process.env)===null||n===void 0?void 0:n.TEXT_DECODER)!=="force"?200:0:r.UINT32_MAX;function m(p,g,O){let y=p.subarray(g,g+O);return d.decode(y)}i.utf8DecodeTD=m}),mf=ke(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.ExtData=void 0;var e=class{constructor(t,n){this.type=t,this.data=n}};i.ExtData=e}),Ia=ke(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.DecodeError=void 0;var e=class extends Error{constructor(t){super(t);let n=Object.create(e.prototype);Object.setPrototypeOf(this,n),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:e.name})}};i.DecodeError=e}),gf=ke(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.timestampExtension=i.decodeTimestampExtension=i.decodeTimestampToTimeSpec=i.encodeTimestampExtension=i.encodeDateToTimeSpec=i.encodeTimeSpecToTimestamp=i.EXT_TIMESTAMP=void 0;var e=Ia(),t=cs();i.EXT_TIMESTAMP=-1;var n=4294967296-1,r=17179869184-1;function s({sec:c,nsec:f}){if(c>=0&&f>=0&&c<=r)if(f===0&&c<=n){let u=new Uint8Array(4);return new DataView(u.buffer).setUint32(0,c),u}else{let u=c/4294967296,d=c&4294967295,m=new Uint8Array(8),p=new DataView(m.buffer);return p.setUint32(0,f<<2|u&3),p.setUint32(4,d),m}else{let u=new Uint8Array(12),d=new DataView(u.buffer);return d.setUint32(0,f),(0,t.setInt64)(d,4,c),u}}i.encodeTimeSpecToTimestamp=s;function o(c){let f=c.getTime(),u=Math.floor(f/1e3),d=(f-u*1e3)*1e6,m=Math.floor(d/1e9);return{sec:u+m,nsec:d-m*1e9}}i.encodeDateToTimeSpec=o;function a(c){if(c instanceof Date){let f=o(c);return s(f)}else return null}i.encodeTimestampExtension=a;function l(c){let f=new DataView(c.buffer,c.byteOffset,c.byteLength);switch(c.byteLength){case 4:return{sec:f.getUint32(0),nsec:0};case 8:{let u=f.getUint32(0),d=f.getUint32(4),m=(u&3)*4294967296+d,p=u>>>2;return{sec:m,nsec:p}}case 12:{let u=(0,t.getInt64)(f,4),d=f.getUint32(0);return{sec:u,nsec:d}}default:throw new e.DecodeError(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${c.length}`)}}i.decodeTimestampToTimeSpec=l;function h(c){let f=l(c);return new Date(f.sec*1e3+f.nsec/1e6)}i.decodeTimestampExtension=h,i.timestampExtension={type:i.EXT_TIMESTAMP,encode:a,decode:h}}),Na=ke(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.ExtensionCodec=void 0;var e=mf(),t=gf(),n=class{constructor(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(t.timestampExtension)}register({type:r,encode:s,decode:o}){if(r>=0)this.encoders[r]=s,this.decoders[r]=o;else{let a=1+r;this.builtInEncoders[a]=s,this.builtInDecoders[a]=o}}tryToEncode(r,s){for(let o=0;o{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.createDataView=i.ensureUint8Array=void 0;function e(n){return n instanceof Uint8Array?n:ArrayBuffer.isView(n)?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):n instanceof ArrayBuffer?new Uint8Array(n):Uint8Array.from(n)}i.ensureUint8Array=e;function t(n){if(n instanceof ArrayBuffer)return new DataView(n);let r=e(n);return new DataView(r.buffer,r.byteOffset,r.byteLength)}i.createDataView=t}),yf=ke(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.Encoder=i.DEFAULT_INITIAL_BUFFER_SIZE=i.DEFAULT_MAX_DEPTH=void 0;var e=Wa(),t=Na(),n=cs(),r=Of();i.DEFAULT_MAX_DEPTH=100,i.DEFAULT_INITIAL_BUFFER_SIZE=2048;var s=class{constructor(o=t.ExtensionCodec.defaultCodec,a=void 0,l=i.DEFAULT_MAX_DEPTH,h=i.DEFAULT_INITIAL_BUFFER_SIZE,c=!1,f=!1,u=!1,d=!1){this.extensionCodec=o,this.context=a,this.maxDepth=l,this.initialBufferSize=h,this.sortKeys=c,this.forceFloat32=f,this.ignoreUndefined=u,this.forceIntegerToFloat=d,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}reinitializeState(){this.pos=0}encodeSharedRef(o){return this.reinitializeState(),this.doEncode(o,1),this.bytes.subarray(0,this.pos)}encode(o){return this.reinitializeState(),this.doEncode(o,1),this.bytes.slice(0,this.pos)}doEncode(o,a){if(a>this.maxDepth)throw new Error(`Too deep objects in depth ${a}`);o==null?this.encodeNil():typeof o=="boolean"?this.encodeBoolean(o):typeof o=="number"?this.encodeNumber(o):typeof o=="string"?this.encodeString(o):this.encodeObject(o,a)}ensureBufferSizeToWrite(o){let a=this.pos+o;this.view.byteLength=0?o<128?this.writeU8(o):o<256?(this.writeU8(204),this.writeU8(o)):o<65536?(this.writeU8(205),this.writeU16(o)):o<4294967296?(this.writeU8(206),this.writeU32(o)):(this.writeU8(207),this.writeU64(o)):o>=-32?this.writeU8(224|o+32):o>=-128?(this.writeU8(208),this.writeI8(o)):o>=-32768?(this.writeU8(209),this.writeI16(o)):o>=-2147483648?(this.writeU8(210),this.writeI32(o)):(this.writeU8(211),this.writeI64(o)):this.forceFloat32?(this.writeU8(202),this.writeF32(o)):(this.writeU8(203),this.writeF64(o))}writeStringHeader(o){if(o<32)this.writeU8(160+o);else if(o<256)this.writeU8(217),this.writeU8(o);else if(o<65536)this.writeU8(218),this.writeU16(o);else if(o<4294967296)this.writeU8(219),this.writeU32(o);else throw new Error(`Too long string: ${o} bytes in UTF-8`)}encodeString(o){if(o.length>e.TEXT_ENCODER_THRESHOLD){let a=(0,e.utf8Count)(o);this.ensureBufferSizeToWrite(5+a),this.writeStringHeader(a),(0,e.utf8EncodeTE)(o,this.bytes,this.pos),this.pos+=a}else{let a=(0,e.utf8Count)(o);this.ensureBufferSizeToWrite(5+a),this.writeStringHeader(a),(0,e.utf8EncodeJs)(o,this.bytes,this.pos),this.pos+=a}}encodeObject(o,a){let l=this.extensionCodec.tryToEncode(o,this.context);if(l!=null)this.encodeExtension(l);else if(Array.isArray(o))this.encodeArray(o,a);else if(ArrayBuffer.isView(o))this.encodeBinary(o);else if(typeof o=="object")this.encodeMap(o,a);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(o)}`)}encodeBinary(o){let a=o.byteLength;if(a<256)this.writeU8(196),this.writeU8(a);else if(a<65536)this.writeU8(197),this.writeU16(a);else if(a<4294967296)this.writeU8(198),this.writeU32(a);else throw new Error(`Too large binary: ${a}`);let l=(0,r.ensureUint8Array)(o);this.writeU8a(l)}encodeArray(o,a){let l=o.length;if(l<16)this.writeU8(144+l);else if(l<65536)this.writeU8(220),this.writeU16(l);else if(l<4294967296)this.writeU8(221),this.writeU32(l);else throw new Error(`Too large array: ${l}`);for(let h of o)this.doEncode(h,a+1)}countWithoutUndefined(o,a){let l=0;for(let h of a)o[h]!==void 0&&l++;return l}encodeMap(o,a){let l=Object.keys(o);this.sortKeys&&l.sort();let h=this.ignoreUndefined?this.countWithoutUndefined(o,l):l.length;if(h<16)this.writeU8(128+h);else if(h<65536)this.writeU8(222),this.writeU16(h);else if(h<4294967296)this.writeU8(223),this.writeU32(h);else throw new Error(`Too large map object: ${h}`);for(let c of l){let f=o[c];this.ignoreUndefined&&f===void 0||(this.encodeString(c),this.doEncode(f,a+1))}}encodeExtension(o){let a=o.data.length;if(a===1)this.writeU8(212);else if(a===2)this.writeU8(213);else if(a===4)this.writeU8(214);else if(a===8)this.writeU8(215);else if(a===16)this.writeU8(216);else if(a<256)this.writeU8(199),this.writeU8(a);else if(a<65536)this.writeU8(200),this.writeU16(a);else if(a<4294967296)this.writeU8(201),this.writeU32(a);else throw new Error(`Too large extension object: ${a}`);this.writeI8(o.type),this.writeU8a(o.data)}writeU8(o){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,o),this.pos++}writeU8a(o){let a=o.length;this.ensureBufferSizeToWrite(a),this.bytes.set(o,this.pos),this.pos+=a}writeI8(o){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,o),this.pos++}writeU16(o){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,o),this.pos+=2}writeI16(o){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,o),this.pos+=2}writeU32(o){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,o),this.pos+=4}writeI32(o){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,o),this.pos+=4}writeF32(o){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,o),this.pos+=4}writeF64(o){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,o),this.pos+=8}writeU64(o){this.ensureBufferSizeToWrite(8),(0,n.setUint64)(this.view,this.pos,o),this.pos+=8}writeI64(o){this.ensureBufferSizeToWrite(8),(0,n.setInt64)(this.view,this.pos,o),this.pos+=8}};i.Encoder=s}),EO=ke(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.encode=void 0;var e=yf(),t={};function n(r,s=t){return new e.Encoder(s.extensionCodec,s.context,s.maxDepth,s.initialBufferSize,s.sortKeys,s.forceFloat32,s.ignoreUndefined,s.forceIntegerToFloat).encodeSharedRef(r)}i.encode=n}),AO=ke(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.prettyByte=void 0;function e(t){return`${t<0?"-":""}0x${Math.abs(t).toString(16).padStart(2,"0")}`}i.prettyByte=e}),QO=ke(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.CachedKeyDecoder=void 0;var e=Wa(),t=16,n=16,r=class{constructor(s=t,o=n){this.maxKeyLength=s,this.maxLengthPerKey=o,this.hit=0,this.miss=0,this.caches=[];for(let a=0;a0&&s<=this.maxKeyLength}find(s,o,a){let l=this.caches[a-1];e:for(let h of l){let c=h.bytes;for(let f=0;f=this.maxLengthPerKey?a[Math.random()*a.length|0]=l:a.push(l)}decode(s,o,a){let l=this.find(s,o,a);if(l!=null)return this.hit++,l;this.miss++;let h=(0,e.utf8DecodeJs)(s,o,a),c=Uint8Array.prototype.slice.call(s,o,o+a);return this.store(c,h),h}};i.CachedKeyDecoder=r}),ja=ke(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.Decoder=i.DataViewIndexOutOfBoundsError=void 0;var e=AO(),t=Na(),n=cs(),r=Wa(),s=Of(),o=QO(),a=Ia(),l=p=>{let g=typeof p;return g==="string"||g==="number"},h=-1,c=new DataView(new ArrayBuffer(0)),f=new Uint8Array(c.buffer);i.DataViewIndexOutOfBoundsError=(()=>{try{c.getInt8(0)}catch(p){return p.constructor}throw new Error("never reached")})();var u=new i.DataViewIndexOutOfBoundsError("Insufficient data"),d=new o.CachedKeyDecoder,m=class{constructor(p=t.ExtensionCodec.defaultCodec,g=void 0,O=n.UINT32_MAX,y=n.UINT32_MAX,v=n.UINT32_MAX,x=n.UINT32_MAX,w=n.UINT32_MAX,P=d){this.extensionCodec=p,this.context=g,this.maxStrLength=O,this.maxBinLength=y,this.maxArrayLength=v,this.maxMapLength=x,this.maxExtLength=w,this.keyDecoder=P,this.totalPos=0,this.pos=0,this.view=c,this.bytes=f,this.headByte=h,this.stack=[]}reinitializeState(){this.totalPos=0,this.headByte=h,this.stack.length=0}setBuffer(p){this.bytes=(0,s.ensureUint8Array)(p),this.view=(0,s.createDataView)(this.bytes),this.pos=0}appendBuffer(p){if(this.headByte===h&&!this.hasRemaining(1))this.setBuffer(p);else{let g=this.bytes.subarray(this.pos),O=(0,s.ensureUint8Array)(p),y=new Uint8Array(g.length+O.length);y.set(g),y.set(O,g.length),this.setBuffer(y)}}hasRemaining(p){return this.view.byteLength-this.pos>=p}createExtraByteError(p){let{view:g,pos:O}=this;return new RangeError(`Extra ${g.byteLength-O} of ${g.byteLength} byte(s) found at buffer[${p}]`)}decode(p){this.reinitializeState(),this.setBuffer(p);let g=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return g}*decodeMulti(p){for(this.reinitializeState(),this.setBuffer(p);this.hasRemaining(1);)yield this.doDecodeSync()}async decodeAsync(p){let g=!1,O;for await(let w of p){if(g)throw this.createExtraByteError(this.totalPos);this.appendBuffer(w);try{O=this.doDecodeSync(),g=!0}catch(P){if(!(P instanceof i.DataViewIndexOutOfBoundsError))throw P}this.totalPos+=this.pos}if(g){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return O}let{headByte:y,pos:v,totalPos:x}=this;throw new RangeError(`Insufficient data in parsing ${(0,e.prettyByte)(y)} at ${x} (${v} in the current buffer)`)}decodeArrayStream(p){return this.decodeMultiAsync(p,!0)}decodeStream(p){return this.decodeMultiAsync(p,!1)}async*decodeMultiAsync(p,g){let O=g,y=-1;for await(let v of p){if(g&&y===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(v),O&&(y=this.readArraySize(),O=!1,this.complete());try{for(;yield this.doDecodeSync(),--y!==0;);}catch(x){if(!(x instanceof i.DataViewIndexOutOfBoundsError))throw x}this.totalPos+=this.pos}}doDecodeSync(){e:for(;;){let p=this.readHeadByte(),g;if(p>=224)g=p-256;else if(p<192)if(p<128)g=p;else if(p<144){let y=p-128;if(y!==0){this.pushMapState(y),this.complete();continue e}else g={}}else if(p<160){let y=p-144;if(y!==0){this.pushArrayState(y),this.complete();continue e}else g=[]}else{let y=p-160;g=this.decodeUtf8String(y,0)}else if(p===192)g=null;else if(p===194)g=!1;else if(p===195)g=!0;else if(p===202)g=this.readF32();else if(p===203)g=this.readF64();else if(p===204)g=this.readU8();else if(p===205)g=this.readU16();else if(p===206)g=this.readU32();else if(p===207)g=this.readU64();else if(p===208)g=this.readI8();else if(p===209)g=this.readI16();else if(p===210)g=this.readI32();else if(p===211)g=this.readI64();else if(p===217){let y=this.lookU8();g=this.decodeUtf8String(y,1)}else if(p===218){let y=this.lookU16();g=this.decodeUtf8String(y,2)}else if(p===219){let y=this.lookU32();g=this.decodeUtf8String(y,4)}else if(p===220){let y=this.readU16();if(y!==0){this.pushArrayState(y),this.complete();continue e}else g=[]}else if(p===221){let y=this.readU32();if(y!==0){this.pushArrayState(y),this.complete();continue e}else g=[]}else if(p===222){let y=this.readU16();if(y!==0){this.pushMapState(y),this.complete();continue e}else g={}}else if(p===223){let y=this.readU32();if(y!==0){this.pushMapState(y),this.complete();continue e}else g={}}else if(p===196){let y=this.lookU8();g=this.decodeBinary(y,1)}else if(p===197){let y=this.lookU16();g=this.decodeBinary(y,2)}else if(p===198){let y=this.lookU32();g=this.decodeBinary(y,4)}else if(p===212)g=this.decodeExtension(1,0);else if(p===213)g=this.decodeExtension(2,0);else if(p===214)g=this.decodeExtension(4,0);else if(p===215)g=this.decodeExtension(8,0);else if(p===216)g=this.decodeExtension(16,0);else if(p===199){let y=this.lookU8();g=this.decodeExtension(y,1)}else if(p===200){let y=this.lookU16();g=this.decodeExtension(y,2)}else if(p===201){let y=this.lookU32();g=this.decodeExtension(y,4)}else throw new a.DecodeError(`Unrecognized type byte: ${(0,e.prettyByte)(p)}`);this.complete();let O=this.stack;for(;O.length>0;){let y=O[O.length-1];if(y.type===0)if(y.array[y.position]=g,y.position++,y.position===y.size)O.pop(),g=y.array;else continue e;else if(y.type===1){if(!l(g))throw new a.DecodeError("The type of key must be string or number but "+typeof g);if(g==="__proto__")throw new a.DecodeError("The key __proto__ is not allowed");y.key=g,y.type=2;continue e}else if(y.map[y.key]=g,y.readCount++,y.readCount===y.size)O.pop(),g=y.map;else{y.key=null,y.type=1;continue e}}return g}}readHeadByte(){return this.headByte===h&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=h}readArraySize(){let p=this.readHeadByte();switch(p){case 220:return this.readU16();case 221:return this.readU32();default:{if(p<160)return p-144;throw new a.DecodeError(`Unrecognized array type byte: ${(0,e.prettyByte)(p)}`)}}}pushMapState(p){if(p>this.maxMapLength)throw new a.DecodeError(`Max length exceeded: map length (${p}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.push({type:1,size:p,key:null,readCount:0,map:{}})}pushArrayState(p){if(p>this.maxArrayLength)throw new a.DecodeError(`Max length exceeded: array length (${p}) > maxArrayLength (${this.maxArrayLength})`);this.stack.push({type:0,size:p,array:new Array(p),position:0})}decodeUtf8String(p,g){var O;if(p>this.maxStrLength)throw new a.DecodeError(`Max length exceeded: UTF-8 byte length (${p}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLengthr.TEXT_DECODER_THRESHOLD?v=(0,r.utf8DecodeTD)(this.bytes,y,p):v=(0,r.utf8DecodeJs)(this.bytes,y,p),this.pos+=g+p,v}stateIsMapKey(){return this.stack.length>0?this.stack[this.stack.length-1].type===1:!1}decodeBinary(p,g){if(p>this.maxBinLength)throw new a.DecodeError(`Max length exceeded: bin length (${p}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(p+g))throw u;let O=this.pos+g,y=this.bytes.subarray(O,O+p);return this.pos+=g+p,y}decodeExtension(p,g){if(p>this.maxExtLength)throw new a.DecodeError(`Max length exceeded: ext length (${p}) > maxExtLength (${this.maxExtLength})`);let O=this.view.getInt8(this.pos+g),y=this.decodeBinary(p,g+1);return this.extensionCodec.decode(y,O,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){let p=this.view.getUint8(this.pos);return this.pos++,p}readI8(){let p=this.view.getInt8(this.pos);return this.pos++,p}readU16(){let p=this.view.getUint16(this.pos);return this.pos+=2,p}readI16(){let p=this.view.getInt16(this.pos);return this.pos+=2,p}readU32(){let p=this.view.getUint32(this.pos);return this.pos+=4,p}readI32(){let p=this.view.getInt32(this.pos);return this.pos+=4,p}readU64(){let p=(0,n.getUint64)(this.view,this.pos);return this.pos+=8,p}readI64(){let p=(0,n.getInt64)(this.view,this.pos);return this.pos+=8,p}readF32(){let p=this.view.getFloat32(this.pos);return this.pos+=4,p}readF64(){let p=this.view.getFloat64(this.pos);return this.pos+=8,p}};i.Decoder=m}),bf=ke(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.decodeMulti=i.decode=i.defaultDecodeOptions=void 0;var e=ja();i.defaultDecodeOptions={};function t(r,s=i.defaultDecodeOptions){return new e.Decoder(s.extensionCodec,s.context,s.maxStrLength,s.maxBinLength,s.maxArrayLength,s.maxMapLength,s.maxExtLength).decode(r)}i.decode=t;function n(r,s=i.defaultDecodeOptions){return new e.Decoder(s.extensionCodec,s.context,s.maxStrLength,s.maxBinLength,s.maxArrayLength,s.maxMapLength,s.maxExtLength).decodeMulti(r)}i.decodeMulti=n}),MO=ke(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.ensureAsyncIterable=i.asyncIterableFromStream=i.isAsyncIterable=void 0;function e(s){return s[Symbol.asyncIterator]!=null}i.isAsyncIterable=e;function t(s){if(s==null)throw new Error("Assertion Failure: value must not be null nor undefined")}async function*n(s){let o=s.getReader();try{for(;;){let{done:a,value:l}=await o.read();if(a)return;t(l),yield l}}finally{o.releaseLock()}}i.asyncIterableFromStream=n;function r(s){return e(s)?s:n(s)}i.ensureAsyncIterable=r}),_O=ke(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.decodeStream=i.decodeMultiStream=i.decodeArrayStream=i.decodeAsync=void 0;var e=ja(),t=MO(),n=bf();async function r(l,h=n.defaultDecodeOptions){let c=(0,t.ensureAsyncIterable)(l);return new e.Decoder(h.extensionCodec,h.context,h.maxStrLength,h.maxBinLength,h.maxArrayLength,h.maxMapLength,h.maxExtLength).decodeAsync(c)}i.decodeAsync=r;function s(l,h=n.defaultDecodeOptions){let c=(0,t.ensureAsyncIterable)(l);return new e.Decoder(h.extensionCodec,h.context,h.maxStrLength,h.maxBinLength,h.maxArrayLength,h.maxMapLength,h.maxExtLength).decodeArrayStream(c)}i.decodeArrayStream=s;function o(l,h=n.defaultDecodeOptions){let c=(0,t.ensureAsyncIterable)(l);return new e.Decoder(h.extensionCodec,h.context,h.maxStrLength,h.maxBinLength,h.maxArrayLength,h.maxMapLength,h.maxExtLength).decodeStream(c)}i.decodeMultiStream=o;function a(l,h=n.defaultDecodeOptions){return o(l,h)}i.decodeStream=a}),za=ke(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.decodeTimestampExtension=i.encodeTimestampExtension=i.decodeTimestampToTimeSpec=i.encodeTimeSpecToTimestamp=i.encodeDateToTimeSpec=i.EXT_TIMESTAMP=i.ExtData=i.ExtensionCodec=i.Encoder=i.DataViewIndexOutOfBoundsError=i.DecodeError=i.Decoder=i.decodeStream=i.decodeMultiStream=i.decodeArrayStream=i.decodeAsync=i.decodeMulti=i.decode=i.encode=void 0;var e=EO();Object.defineProperty(i,"encode",{enumerable:!0,get:function(){return e.encode}});var t=bf();Object.defineProperty(i,"decode",{enumerable:!0,get:function(){return t.decode}}),Object.defineProperty(i,"decodeMulti",{enumerable:!0,get:function(){return t.decodeMulti}});var n=_O();Object.defineProperty(i,"decodeAsync",{enumerable:!0,get:function(){return n.decodeAsync}}),Object.defineProperty(i,"decodeArrayStream",{enumerable:!0,get:function(){return n.decodeArrayStream}}),Object.defineProperty(i,"decodeMultiStream",{enumerable:!0,get:function(){return n.decodeMultiStream}}),Object.defineProperty(i,"decodeStream",{enumerable:!0,get:function(){return n.decodeStream}});var r=ja();Object.defineProperty(i,"Decoder",{enumerable:!0,get:function(){return r.Decoder}}),Object.defineProperty(i,"DataViewIndexOutOfBoundsError",{enumerable:!0,get:function(){return r.DataViewIndexOutOfBoundsError}});var s=Ia();Object.defineProperty(i,"DecodeError",{enumerable:!0,get:function(){return s.DecodeError}});var o=yf();Object.defineProperty(i,"Encoder",{enumerable:!0,get:function(){return o.Encoder}});var a=Na();Object.defineProperty(i,"ExtensionCodec",{enumerable:!0,get:function(){return a.ExtensionCodec}});var l=mf();Object.defineProperty(i,"ExtData",{enumerable:!0,get:function(){return l.ExtData}});var h=gf();Object.defineProperty(i,"EXT_TIMESTAMP",{enumerable:!0,get:function(){return h.EXT_TIMESTAMP}}),Object.defineProperty(i,"encodeDateToTimeSpec",{enumerable:!0,get:function(){return h.encodeDateToTimeSpec}}),Object.defineProperty(i,"encodeTimeSpecToTimestamp",{enumerable:!0,get:function(){return h.encodeTimeSpecToTimestamp}}),Object.defineProperty(i,"decodeTimestampToTimeSpec",{enumerable:!0,get:function(){return h.decodeTimestampToTimeSpec}}),Object.defineProperty(i,"encodeTimestampExtension",{enumerable:!0,get:function(){return h.encodeTimestampExtension}}),Object.defineProperty(i,"decodeTimestampExtension",{enumerable:!0,get:function(){return h.decodeTimestampExtension}})}),di=class extends Error{constructor(i){super(i),this.name=this.constructor.name,Object.setPrototypeOf(this,new.target.prototype)}},wf=class extends di{},pt=class extends di{},Bn=class extends di{},Ie=typeof process<"u"&&process.release&&process.release.name==="node",ga;if(globalThis.document)ga=i=>new Promise((e,t)=>{let n=document.createElement("script");n.src=i,n.onload=()=>e(),n.onerror=t,document.head.appendChild(n)});else if(globalThis.importScripts)ga=async i=>{try{globalThis.importScripts(i)}catch(e){if(e instanceof TypeError)await Promise.resolve().then(()=>Xi(Bi(i)));else throw e}};else if(Ie)ga=async i=>{let e=(await Promise.resolve().then(()=>Xi(Bi("path")))).default;await Promise.resolve().then(()=>Xi(Bi(e.resolve(i))))};else throw new di("Cannot determine runtime environment");var T={};function DO(i){Object.keys(i).forEach(e=>T._free(i[e]))}var mt={null:0,symbol:1,pairlist:2,closure:3,environment:4,promise:5,call:6,special:7,builtin:8,string:9,logical:10,integer:13,double:14,complex:15,character:16,dots:17,any:18,list:19,expression:20,bytecode:21,pointer:22,weakref:23,raw:24,s4:25,new:30,free:31,function:99};function vf(i){return!!i&&typeof i=="object"&&Object.keys(mt).includes(i.type)}function fs(i){return!!i&&typeof i=="object"&&"re"in i&&"im"in i}function Yr(i){return T._Rf_protect(Mt(i)),i}function ae(i,e){return T._Rf_protect(Mt(i)),++e.n,i}function $O(i){let e=T._malloc(4);return T._R_ProtectWithIndex(Mt(i),e),{loc:T.getValue(e,"i32"),ptr:e}}function VO(i){T._Rf_unprotect(1),T._free(i.ptr)}function LO(i,e){return T._R_Reprotect(Mt(i),e.loc),i}function Oe(i){T._Rf_unprotect(i)}function af(i,e,t){T._Rf_defineVar(Mt(e),Mt(t),Mt(i))}function lf(i,e){let t={},n={n:0};try{let r=new Tf(e);ae(r,n),t.code=T.allocateUTF8(i);let s=T._R_ParseEvalString(t.code,r.ptr);return z.wrap(s)}finally{DO(t),Oe(n.n)}}function us(i,e){return T.getWasmTableEntry(T.GOT.ffi_safe_eval.value)(Mt(i),Mt(e))}var qO=new WeakMap;function BO(i,e){return qO.set(i,e),i}var XO=63;function xf(){let i=Array.from({length:4},WO).join("-");if(i.length!==XO)throw new Error("comlink internal error: UUID has the wrong length");return i}function WO(){let i=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16),e=15-i.length;return e>0&&(i=Array.from({length:e},()=>0).join("")+i),i}function Mt(i){return rs(i)?i.ptr:i}function pi(i,e){if(T._TYPEOF(i.ptr)!==mt[e])throw new Error(`Unexpected object type "${i.type()}" when expecting type "${e}"`)}function kf(i){if(vf(i))return new(_f(i.type))(i);if(i&&typeof i=="object"&&"type"in i&&i.type==="null")return new Sf;if(i===null)return new Ni({type:"logical",names:null,values:[null]});if(typeof i=="boolean")return new Ni(i);if(typeof i=="number")return new ps(i);if(typeof i=="string")return new zt(i);if(fs(i))return new Fa(i);if(ArrayBuffer.isView(i)||i instanceof ArrayBuffer)return new Ha(i);if(Array.isArray(i))return IO(i);if(typeof i=="object")return Xn.fromObject(i);throw new Error("Robj construction for this JS object is not yet supported")}function IO(i){let e={n:0};if(i.every(t=>t&&typeof t=="object"&&!rs(t)&&!fs(t))){let t=i,n=t.every(s=>Object.keys(s).filter(o=>!Object.keys(t[0]).includes(o)).length===0&&Object.keys(t[0]).filter(o=>!Object.keys(s).includes(o)).length===0),r=t.every(s=>Object.values(s).every(o=>$f(o)||Df(o)));if(n&&r)return Xn.fromD3(t)}if(i.every(t=>typeof t=="boolean"||t===null))return new Ni(i);if(i.every(t=>typeof t=="number"||t===null))return new ps(i);if(i.every(t=>typeof t=="string"||t===null))return new zt(i);try{let t=new ui([new gt("c"),...i]);return ae(t,e),t.eval()}finally{Oe(e.n)}}var ye=class{constructor(i){this.ptr=i}type(){let i=T._TYPEOF(this.ptr);return Object.keys(mt).find(e=>mt[e]===i)}},_n,Zr,Wi=class extends ye{constructor(i){if(!(i instanceof ye))return kf(i);super(i.ptr),L(this,_n)}static wrap(i){let e=T._TYPEOF(i),t=Object.keys(mt)[Object.values(mt).indexOf(e)];return new(_f(t))(new ye(i))}get[Symbol.toStringTag](){return`RObject:${this.type()}`}static getPersistentObject(i){return xe[i]}getPropertyValue(i){return this[i]}inspect(){lf(".Internal(inspect(x))",{x:this})}isNull(){return T._TYPEOF(this.ptr)===mt.null}isNa(){try{let i=lf("is.na(x)",{x:this});return Yr(i),i.toBoolean()}finally{Oe(1)}}isUnbound(){return this.ptr===xe.unboundValue.ptr}attrs(){return ds.wrap(T._ATTRIB(this.ptr))}class(){let i={n:0},e=new ui([new gt("class"),this]);ae(e,i);try{return e.eval()}finally{Oe(i.n)}}setNames(i){let e;if(i===null)e=xe.null;else if(Array.isArray(i)&&i.every(t=>typeof t=="string"||t===null))e=new zt(i);else throw new Error("Argument to setNames must be null or an Array of strings or null");return T._Rf_setAttrib(this.ptr,xe.namesSymbol.ptr,e.ptr),this}names(){let i=zt.wrap(T._Rf_getAttrib(this.ptr,xe.namesSymbol.ptr));return i.isNull()?null:i.toArray()}includes(i){let e=this.names();return e&&e.includes(i)}toJs(i={depth:0},e=1){throw new Error("This R object cannot be converted to JS")}subset(i){return Je(this,_n,Zr).call(this,i,xe.bracketSymbol.ptr)}get(i){return Je(this,_n,Zr).call(this,i,xe.bracket2Symbol.ptr)}getDollar(i){return Je(this,_n,Zr).call(this,i,xe.dollarSymbol.ptr)}pluck(...i){let e=$O(xe.null);try{let t=(r,s)=>{let o=r.get(s);return LO(o,e)},n=i.reduce(t,this);return n.isNull()?void 0:n}finally{VO(e)}}set(i,e){let t={n:0};try{let n=new Wi(i);ae(n,t);let r=new Wi(e);ae(r,t);let s=new gt("[[<-"),o=T._Rf_lang4(s.ptr,this.ptr,n.ptr,r.ptr);return ae(o,t),Wi.wrap(us(o,xe.baseEnv))}finally{Oe(t.n)}}static getMethods(i){let e=new Set,t=i;do Object.getOwnPropertyNames(t).map(n=>e.add(n));while(t=Object.getPrototypeOf(t));return[...e.keys()].filter(n=>typeof i[n]=="function")}},z=Wi;_n=new WeakSet,Zr=function(i,e){let t={n:0};try{let n=new Wi(i);ae(n,t);let r=T._Rf_lang3(e,this.ptr,n.ptr);return ae(r,t),Wi.wrap(us(r,xe.baseEnv))}finally{Oe(t.n)}};var Sf=class extends z{constructor(){return super(new ye(T.getValue(T._R_NilValue,"*"))),this}toJs(){return{type:"null"}}},gt=class extends z{constructor(i){if(i instanceof ye){pi(i,"symbol"),super(i);return}let e=T.allocateUTF8(i);try{super(new ye(T._Rf_install(e)))}finally{T._free(e)}}toJs(){let i=this.toObject();return{type:"symbol",printname:i.printname,symvalue:i.symvalue,internal:i.internal}}toObject(){return{printname:this.printname().isUnbound()?null:this.printname().toString(),symvalue:this.symvalue().isUnbound()?null:this.symvalue().ptr,internal:this.internal().isNull()?null:this.internal().ptr}}toString(){return this.printname().toString()}printname(){return Ua.wrap(T._PRINTNAME(this.ptr))}symvalue(){return z.wrap(T._SYMVALUE(this.ptr))}internal(){return z.wrap(T._INTERNAL(this.ptr))}},ds=class extends z{constructor(i){if(i instanceof ye)return pi(i,"pairlist"),super(i),this;let e={n:0};try{let{names:t,values:n}=zi(i),r=ds.wrap(T._Rf_allocList(n.length));ae(r,e);for(let[s,o]=[0,r];!o.isNull();[s,o]=[s+1,o.cdr()])o.setcar(new z(n[s]));r.setNames(t),super(r)}finally{Oe(e.n)}}get length(){return this.toArray().length}toArray(i={depth:1}){return this.toJs(i).values}toObject({allowDuplicateKey:i=!0,allowEmptyKey:e=!1,depth:t=-1}={}){let n=this.entries({depth:t}),r=n.map(([s])=>s);if(!i&&new Set(r).size!==r.length)throw new Error("Duplicate key when converting pairlist without allowDuplicateKey enabled");if(!e&&r.some(s=>!s))throw new Error("Empty or null key when converting pairlist without allowEmptyKey enabled");return Object.fromEntries(n.filter((s,o)=>n.findIndex(a=>a[0]===s[0])===o))}entries(i={depth:1}){let e=this.toJs(i);return e.values.map((t,n)=>[e.names?e.names[n]:null,t])}toJs(i={depth:0},e=1){let t=[],n=!1,r=[];for(let s=this;!s.isNull();s=s.cdr()){let o=s.tag();o.isNull()?t.push(""):(n=!0,t.push(o.toString())),i.depth&&e>=i.depth?r.push(s.car()):r.push(s.car().toJs(i,e+1))}return{type:"pairlist",names:n?t:null,values:r}}includes(i){return i in this.toObject()}setcar(i){T._SETCAR(this.ptr,i.ptr)}car(){return z.wrap(T._CAR(this.ptr))}cdr(){return z.wrap(T._CDR(this.ptr))}tag(){return z.wrap(T._TAG(this.ptr))}},ui=class extends z{constructor(i){if(i instanceof ye)return pi(i,"call"),super(i),this;let e={n:0};try{let{values:t}=zi(i),n=t.map(s=>ae(new z(s),e)),r=ui.wrap(T._Rf_allocVector(mt.call,t.length));ae(r,e);for(let[s,o]=[0,r];!o.isNull();[s,o]=[s+1,o.cdr()])o.setcar(n[s]);super(r)}finally{Oe(e.n)}}setcar(i){T._SETCAR(this.ptr,i.ptr)}car(){return z.wrap(T._CAR(this.ptr))}cdr(){return z.wrap(T._CDR(this.ptr))}eval(){return T.webr.evalR(this,{env:xe.baseEnv})}capture(i={}){return T.webr.captureR(this,i)}deparse(){let i={n:0};try{let e=T._Rf_lang2(new gt("deparse1").ptr,T._Rf_lang2(new gt("quote").ptr,this.ptr));ae(e,i);let t=zt.wrap(us(e,xe.baseEnv));return ae(t,i),t.toString()}finally{Oe(i.n)}}},ya=class extends z{constructor(i,e=null){if(i instanceof ye){if(pi(i,"list"),super(i),e){if(e.length!==this.length)throw new Error("Can't construct named `RList`. Supplied `names` must be the same length as the list.");this.setNames(e)}return this}let t={n:0};try{let n=zi(i),r=T._Rf_allocVector(mt.list,n.values.length);ae(r,t),n.values.forEach((o,a)=>{T._SET_VECTOR_ELT(r,a,new z(o).ptr)});let s=e||n.names;if(s&&s.length!==n.values.length)throw new Error("Can't construct named `RList`. Supplied `names` must be the same length as the list.");z.wrap(r).setNames(s),super(new ye(r))}finally{Oe(t.n)}}get length(){return T._LENGTH(this.ptr)}isDataFrame(){let i=ds.wrap(T._ATTRIB(this.ptr)).get("class");return!i.isNull()&&i.toArray().includes("data.frame")}toArray(i={depth:1}){return this.toJs(i).values}toObject({allowDuplicateKey:i=!0,allowEmptyKey:e=!1,depth:t=-1}={}){let n=this.entries({depth:t}),r=n.map(([s])=>s);if(!i&&new Set(r).size!==r.length)throw new Error("Duplicate key when converting list without allowDuplicateKey enabled");if(!e&&r.some(s=>!s))throw new Error("Empty or null key when converting list without allowEmptyKey enabled");return Object.fromEntries(n.filter((s,o)=>n.findIndex(a=>a[0]===s[0])===o))}toD3(){if(!this.isDataFrame())throw new Error("Can't convert R list object to D3 format. Object must be of class 'data.frame'.");return this.entries().reduce((i,e)=>(e[1].forEach((t,n)=>i[n]=Object.assign(i[n]||{},{[e[0]]:t})),i),[])}entries(i={depth:-1}){let e=this.toJs(i);return this.isDataFrame()&&i.depth<0&&(e.values=e.values.map(t=>t.toArray())),e.values.map((t,n)=>[e.names?e.names[n]:null,t])}toJs(i={depth:0},e=1){return{type:"list",names:this.names(),values:[...Array(this.length).keys()].map(t=>i.depth&&e>=i.depth?this.get(t+1):this.get(t+1).toJs(i,e+1))}}},Xn=class extends ya{constructor(i){if(i instanceof ye){if(super(i),!this.isDataFrame())throw new Error("Can't construct `RDataFrame`. Supplied R object is not a `data.frame`.");return this}return Xn.fromObject(i)}static fromObject(i){let{names:e,values:t}=zi(i),n={n:0};try{let r=!!e&&e.length>0&&e.every(o=>o),s=t.length>0&&t.every(o=>Array.isArray(o)||ArrayBuffer.isView(o)||o instanceof ArrayBuffer);if(r&&s){let o=t,a=o.every(h=>h.length===o[0].length),l=o.every(h=>$f(h[0])||Df(h[0]));if(a&&l){let h=new ya({type:"list",names:e,values:o.map(f=>kf(f))});ae(h,n);let c=new ui([new gt("as.data.frame"),h]);return ae(c,n),new Xn(c.eval())}}}finally{Oe(n.n)}throw new Error("Can't construct `data.frame`. Source object is not eligible.")}static fromD3(i){return this.fromObject(Object.fromEntries(Object.keys(i[0]).map(e=>[e,i.map(t=>t[e])])))}},Gr=class extends z{exec(...i){let e={n:0};try{let t=new ui([this,...i]);return ae(t,e),t.eval()}finally{Oe(e.n)}}capture(i={},...e){let t={n:0};try{let n=new ui([this,...e]);return ae(n,t),n.capture(i)}finally{Oe(t.n)}}},Ua=class extends z{constructor(i){if(i instanceof ye){pi(i,"string"),super(i);return}let e=T.allocateUTF8(i);try{super(new ye(T._Rf_mkChar(e)))}finally{T._free(e)}}toString(){return T.UTF8ToString(T._R_CHAR(this.ptr))}toJs(){return{type:"string",value:this.toString()}}},Tf=class extends z{constructor(i={}){if(i instanceof ye)return pi(i,"environment"),super(i),this;let e=0;try{let{names:t,values:n}=zi(i),r=Yr(T._R_NewEnv(xe.globalEnv.ptr,0,0));++e,n.forEach((s,o)=>{let a=t?t[o]:null;if(!a)throw new Error("Can't create object in new environment with empty symbol name");let l=new gt(a),h=Yr(new z(s));try{af(r,l,h)}finally{Oe(1)}}),super(new ye(r))}finally{Oe(e)}}ls(i=!1,e=!0){return zt.wrap(T._R_lsInternal3(this.ptr,Number(i),Number(e))).toArray()}bind(i,e){let t=new gt(i),n=Yr(new z(e));try{af(this,t,n)}finally{Oe(1)}}names(){return this.ls(!0,!0)}frame(){return z.wrap(T._FRAME(this.ptr))}subset(i){if(typeof i=="number")throw new Error("Object of type environment is not subsettable");return this.getDollar(i)}toObject({depth:i=-1}={}){let e=this.names();return Object.fromEntries([...Array(e.length).keys()].map(t=>{let n=this.getDollar(e[t]);return[e[t],i<0?n:n.toJs({depth:i})]}))}toJs(i={depth:0},e=1){let t=this.names(),n=[...Array(t.length).keys()].map(r=>i.depth&&e>=i.depth?this.getDollar(t[r]):this.getDollar(t[r]).toJs(i,e+1));return{type:"environment",names:t,values:n}}},ji=class extends z{constructor(i,e,t){if(i instanceof ye)return pi(i,e),super(i),this;let n={n:0};try{let{names:r,values:s}=zi(i),o=T._Rf_allocVector(mt[e],s.length);ae(o,n),s.forEach(t(o)),z.wrap(o).setNames(r),super(new ye(o))}finally{Oe(n.n)}}get length(){return T._LENGTH(this.ptr)}get(i){return super.get(i)}subset(i){return super.subset(i)}getDollar(){throw new Error("$ operator is invalid for atomic vectors")}detectMissing(){let i={n:0};try{let e=T._Rf_lang2(new gt("is.na").ptr,this.ptr);ae(e,i);let t=Ni.wrap(us(e,xe.baseEnv));ae(t,i);let n=t.toTypedArray();return Array.from(n).map(r=>!!r)}finally{Oe(i.n)}}toArray(){let i=this.toTypedArray();return this.detectMissing().map((e,t)=>e?null:i[t])}toObject({allowDuplicateKey:i=!0,allowEmptyKey:e=!1}={}){let t=this.entries(),n=t.map(([r])=>r);if(!i&&new Set(n).size!==n.length)throw new Error("Duplicate key when converting atomic vector without allowDuplicateKey enabled");if(!e&&n.some(r=>!r))throw new Error("Empty or null key when converting atomic vector without allowEmptyKey enabled");return Object.fromEntries(t.filter((r,s)=>t.findIndex(o=>o[0]===r[0])===s))}entries(){let i=this.toArray(),e=this.names();return i.map((t,n)=>[e?e[n]:null,t])}toJs(){return{type:this.type(),names:this.names(),values:this.toArray()}}},ba,Pf=class extends ji{constructor(i){super(i,"logical",k(Pf,ba))}getBoolean(i){return this.get(i).toArray()[0]}toBoolean(){if(this.length!==1)throw new Error("Can't convert atomic vector of length > 1 to a scalar JS value");let i=this.getBoolean(1);if(i===null)throw new Error("Can't convert missing value `NA` to a JS boolean");return i}toTypedArray(){return new Int32Array(T.HEAP32.subarray(T._LOGICAL(this.ptr)/4,T._LOGICAL(this.ptr)/4+this.length))}toArray(){let i=this.toTypedArray();return this.detectMissing().map((e,t)=>e?null:!!i[t])}},Ni=Pf;ba=new WeakMap,L(Ni,ba,i=>{let e=T._LOGICAL(i),t=T.getValue(T._R_NaInt,"i32");return(n,r)=>{T.setValue(e+4*r,n===null?t:!!n,"i32")}});var wa,Cf=class extends ji{constructor(i){super(i,"integer",k(Cf,wa))}getNumber(i){return this.get(i).toArray()[0]}toNumber(){if(this.length!==1)throw new Error("Can't convert atomic vector of length > 1 to a scalar JS value");let i=this.getNumber(1);if(i===null)throw new Error("Can't convert missing value `NA` to a JS number");return i}toTypedArray(){return new Int32Array(T.HEAP32.subarray(T._INTEGER(this.ptr)/4,T._INTEGER(this.ptr)/4+this.length))}},Rf=Cf;wa=new WeakMap,L(Rf,wa,i=>{let e=T._INTEGER(i),t=T.getValue(T._R_NaInt,"i32");return(n,r)=>{T.setValue(e+4*r,n===null?t:Math.round(Number(n)),"i32")}});var va,Ef=class extends ji{constructor(i){super(i,"double",k(Ef,va))}getNumber(i){return this.get(i).toArray()[0]}toNumber(){if(this.length!==1)throw new Error("Can't convert atomic vector of length > 1 to a scalar JS value");let i=this.getNumber(1);if(i===null)throw new Error("Can't convert missing value `NA` to a JS number");return i}toTypedArray(){return new Float64Array(T.HEAPF64.subarray(T._REAL(this.ptr)/8,T._REAL(this.ptr)/8+this.length))}},ps=Ef;va=new WeakMap,L(ps,va,i=>{let e=T._REAL(i),t=T.getValue(T._R_NaReal,"double");return(n,r)=>{T.setValue(e+8*r,n===null?t:n,"double")}});var xa,Af=class extends ji{constructor(i){super(i,"complex",k(Af,xa))}getComplex(i){return this.get(i).toArray()[0]}toComplex(){if(this.length!==1)throw new Error("Can't convert atomic vector of length > 1 to a scalar JS value");let i=this.getComplex(1);if(i===null)throw new Error("Can't convert missing value `NA` to a JS object");return i}toTypedArray(){return new Float64Array(T.HEAPF64.subarray(T._COMPLEX(this.ptr)/8,T._COMPLEX(this.ptr)/8+2*this.length))}toArray(){let i=this.toTypedArray();return this.detectMissing().map((e,t)=>e?null:{re:i[2*t],im:i[2*t+1]})}},Fa=Af;xa=new WeakMap,L(Fa,xa,i=>{let e=T._COMPLEX(i),t=T.getValue(T._R_NaReal,"double");return(n,r)=>{T.setValue(e+8*(2*r),n===null?t:n.re,"double"),T.setValue(e+8*(2*r+1),n===null?t:n.im,"double")}});var ka,Qf=class extends ji{constructor(i){super(i,"character",k(Qf,ka))}getString(i){return this.get(i).toArray()[0]}toString(){if(this.length!==1)throw new Error("Can't convert atomic vector of length > 1 to a scalar JS value");let i=this.getString(1);if(i===null)throw new Error("Can't convert missing value `NA` to a JS string");return i}toTypedArray(){return new Uint32Array(T.HEAPU32.subarray(T._STRING_PTR(this.ptr)/4,T._STRING_PTR(this.ptr)/4+this.length))}toArray(){return this.detectMissing().map((i,e)=>i?null:T.UTF8ToString(T._R_CHAR(T._STRING_ELT(this.ptr,e))))}},zt=Qf;ka=new WeakMap,L(zt,ka,i=>(e,t)=>{e===null?T._SET_STRING_ELT(i,t,xe.naString.ptr):T._SET_STRING_ELT(i,t,new Ua(e).ptr)});var Sa,Mf=class extends ji{constructor(i){i instanceof ArrayBuffer&&(i=new Uint8Array(i)),super(i,"raw",k(Mf,Sa))}getNumber(i){return this.get(i).toArray()[0]}toNumber(){if(this.length!==1)throw new Error("Can't convert atomic vector of length > 1 to a scalar JS value");let i=this.getNumber(1);if(i===null)throw new Error("Can't convert missing value `NA` to a JS number");return i}toTypedArray(){return new Uint8Array(T.HEAPU8.subarray(T._RAW(this.ptr),T._RAW(this.ptr)+this.length))}},Ha=Mf;Sa=new WeakMap,L(Ha,Sa,i=>{let e=T._RAW(i);return(t,n)=>{T.setValue(e+n,Number(t),"i8")}});function zi(i){return vf(i)?i:Array.isArray(i)||ArrayBuffer.isView(i)?{names:null,values:i}:i&&typeof i=="object"&&!fs(i)?{names:Object.keys(i),values:Object.values(i)}:{names:null,values:[i]}}function _f(i){let e={object:z,null:Sf,symbol:gt,pairlist:ds,closure:Gr,environment:Tf,call:ui,special:Gr,builtin:Gr,string:Ua,logical:Ni,integer:Rf,double:ps,complex:Fa,character:zt,list:ya,raw:Ha,function:Gr,dataframe:Xn};return i in e?e[i]:z}function rs(i){return i instanceof z}function Df(i){let e=["logical","integer","double","complex","character"];return rs(i)&&e.includes(i.type())||rs(i)&&i.isNa()}function $f(i){return i===null||typeof i=="number"||typeof i=="boolean"||typeof i=="string"||fs(i)}var xe;function ms(){let i={resolve:()=>{},reject:()=>{},promise:Promise.resolve()},e=new Promise((t,n)=>{i.resolve=t,i.reject=n});return i.promise=e,i}function NO(i){return new Promise(e=>setTimeout(e,i))}function Ut(i,e,t,...n){return i==null||jO(i)?i:i instanceof ArrayBuffer?new Uint8Array(i):e(i)?t(i,...n):Array.isArray(i)||ArrayBuffer.isView(i)?i.map(r=>Ut(r,e,t,...n)):i instanceof ye?i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([r,s])=>[r,Ut(s,e,t,...n)])):i}function Ga(i,e){let t=new XMLHttpRequest;t.open("get",i,!0),t.onload=()=>{let n=new Worker(URL.createObjectURL(new Blob([t.responseText])));e(n)},t.send()}function Ya(i){if(Ie)return!1;let e=new URL(location.href),t=new URL(i,location.origin);return!(e.host===t.host&&e.port===t.port&&e.protocol===t.protocol)}function jO(i){return typeof ImageBitmap<"u"&&i instanceof ImageBitmap}var zO=Xi(za()),UO=new TextEncoder;async function FO(i,e,t){try{let{taskId:n,sizeBuffer:r,dataBuffer:s,signalBuffer:o}=e,a=(0,zO.encode)(t),l=a.length<=s.length;if(Atomics.store(r,0,a.length),Atomics.store(r,1,+l),!l){let[h,c]=HO(i);s.set(UO.encode(h)),await hf(o,n),s=(await c).dataBuffer}s.set(a),Atomics.store(r,1,1),await hf(o,n)}catch(n){console.warn(n)}}function HO(i){let e=xf();return[e,new Promise(t=>{Ie?i.once("message",n=>{!n.id||n.id!==e||t(n)}):i.addEventListener("message",function n(r){!r.data||!r.data.id||r.data.id!==e||(i.removeEventListener("message",n),t(r.data))}),i.start&&i.start()})]}async function hf(i,e){let t=(e>>1)%32,n=1;for(;Atomics.compareExchange(i,t+1,0,e)!==0;)await NO(n),n<32&&(n*=2);Atomics.or(i,0,1<{k(this,At).push(i)}))};function GO(i,e){return Vf({type:"request",data:{uuid:xf(),msg:i}},e)}function Pa(i,e,t){return Vf({type:"response",data:{uuid:i,resp:e}},t)}function Vf(i,e){return e&&BO(i,e),i}function YO(i){let e=new wf(i.obj.message);return i.obj.name!=="Error"&&(e.name=i.obj.name),e.stack=i.obj.stack,e}function ZO(i){return!!i&&typeof i=="object"&&"payloadType"in i&&"obj"in i}function Lf(i){return ZO(i)&&i.payloadType==="ptr"}var Dn,Za=class{constructor(){this.inputQueue=new Oa,this.outputQueue=new Oa,this.systemQueue=new Oa,L(this,Dn,new Map)}async read(){return await this.outputQueue.get()}async flush(){let i=[];for(;!this.outputQueue.isEmpty();)i.push(await this.read());return i}async readSystem(){return await this.systemQueue.get()}write(i){this.inputQueue.put(i)}async request(i,e){let t=GO(i,e),{resolve:n,reject:r,promise:s}=ms();return k(this,Dn).set(t.data.uuid,{resolve:n,reject:r}),this.write(t),s}putClosedMessage(){this.outputQueue.put({type:"closed"})}resolveResponse(i){let e=i.data.uuid,t=k(this,Dn).get(e);if(t){let n=i.data.resp;k(this,Dn).delete(e),n.payloadType==="err"?t.reject(YO(n)):t.resolve(n)}else console.warn("Can't find request.")}};Dn=new WeakMap;var cS=Xi(za()),fS=new TextDecoder("utf-8"),JO,KO,e0,t0,i0;JO=new WeakMap,KO=new WeakMap,e0=new WeakMap,t0=new WeakMap,i0=new WeakMap;var uS=new Int32Array(new ArrayBuffer(4));Ie&&(globalThis.Worker=Bi("worker_threads").Worker);var $n,Ca,qf,Kr,cf=class extends Za{constructor(i){super(),L(this,Ca),L(this,$n,void 0),this.close=()=>{},L(this,Kr,async(t,n)=>{if(!(!n||!n.type))switch(n.type){case"resolve":me(this,$n,new Int32Array(n.data)),this.resolve();return;case"response":this.resolveResponse(n);return;case"system":this.systemQueue.put(n.data);return;default:this.outputQueue.put(n);return;case"sync-request":{let r=n,s=r.data.msg,o=r.data.reqData;switch(s.type){case"read":{let a=await this.inputQueue.get();await FO(t,o,a);break}default:throw new pt(`Unsupported request type '${s.type}'.`)}return}case"request":throw new pt("Can't send messages of type 'request' from a worker. Please Use 'sync-request' instead.")}});let e=t=>{Je(this,Ca,qf).call(this,t),this.close=()=>{t.terminate(),this.putClosedMessage()};let n={type:"init",data:{config:i,channelType:Qt.SharedArrayBuffer}};t.postMessage(n)};if(Ya(i.baseUrl))Ga(`${i.baseUrl}webr-worker.js`,t=>e(t));else{let t=new Worker(`${i.baseUrl}webr-worker.js`);e(t)}({resolve:this.resolve,promise:this.initialised}=ms())}interrupt(){if(!k(this,$n))throw new pt("Failed attempt to interrupt before initialising interruptBuffer");this.inputQueue.reset(),k(this,$n)[0]=1}};$n=new WeakMap,Ca=new WeakSet,qf=function(i){Ie?i.on("message",e=>{k(this,Kr).call(this,i,e)}):i.onmessage=e=>k(this,Kr).call(this,i,e.data)},Kr=new WeakMap;var n0,r0,s0,o0;n0=new WeakMap,r0=new WeakMap,s0=new WeakMap,o0=new WeakMap;var dS=Xi(za());Ie&&(globalThis.Worker=Bi("worker_threads").Worker);var Ln,Ii,qn,Ra,Bf,Ea,ff,Aa,Xf,es,a0=class extends Za{constructor(i){super(),L(this,Ra),L(this,Ea),L(this,Aa),this.close=()=>{},L(this,Ln,new Map),L(this,Ii,void 0),L(this,qn,!1),L(this,es,(t,n)=>{if(!(!n||!n.type))switch(n.type){case"resolve":this.resolve();return;case"response":this.resolveResponse(n);return;case"system":this.systemQueue.put(n.data);return;default:this.outputQueue.put(n);return;case"sync-request":{let r=n.data;k(this,Ln).set(r.data.uuid,r.data.msg);return}case"request":throw new pt("Can't send messages of type 'request' from a worker.Use service worker fetch request instead.")}}),console.warn("The ServiceWorker communication channel is deprecated and will be removed in a future version of webR. Consider using the PostMessage channel instead. If blocking input is required (for example, `browser()`) the SharedArrayBuffer channel should be used. See https://docs.r-wasm.org/webr/latest/serving.html for further information.");let e=t=>{Je(this,Aa,Xf).call(this,t),this.close=()=>{t.terminate(),this.putClosedMessage()},Je(this,Ra,Bf).call(this,`${i.serviceWorkerUrl}webr-serviceworker.js`).then(n=>{let r={type:"init",data:{config:i,channelType:Qt.ServiceWorker,clientId:n,location:window.location.href}};t.postMessage(r)})};if(Ya(i.serviceWorkerUrl))Ga(`${i.serviceWorkerUrl}webr-worker.js`,t=>e(t));else{let t=new Worker(`${i.serviceWorkerUrl}webr-worker.js`);e(t)}({resolve:this.resolve,promise:this.initialised}=ms())}activeRegistration(){var i;if(!((i=k(this,Ii))!=null&&i.active))throw new pt("Attempted to obtain a non-existent active registration.");return k(this,Ii).active}interrupt(){me(this,qn,!0)}};Ln=new WeakMap,Ii=new WeakMap,qn=new WeakMap,Ra=new WeakSet,Bf=async function(i){me(this,Ii,await navigator.serviceWorker.register(i)),await navigator.serviceWorker.ready,window.addEventListener("beforeunload",()=>{var t;(t=k(this,Ii))==null||t.unregister()});let e=await new Promise(t=>{navigator.serviceWorker.addEventListener("message",function n(r){r.data.type==="registration-successful"&&(navigator.serviceWorker.removeEventListener("message",n),t(r.data.clientId))}),this.activeRegistration().postMessage({type:"register-client-main"})});return navigator.serviceWorker.addEventListener("message",t=>{Je(this,Ea,ff).call(this,t)}),e},Ea=new WeakSet,ff=async function(i){if(i.data.type==="request"){let e=i.data.data,t=k(this,Ln).get(e);if(!t)throw new pt("Request not found during service worker XHR request");switch(k(this,Ln).delete(e),t.type){case"read":{let n=await this.inputQueue.get();this.activeRegistration().postMessage({type:"wasm-webr-fetch-response",uuid:e,response:Pa(e,n)});break}case"interrupt":{let n=k(this,qn);this.activeRegistration().postMessage({type:"wasm-webr-fetch-response",uuid:e,response:Pa(e,n)}),this.inputQueue.reset(),me(this,qn,!1);break}default:throw new pt(`Unsupported request type '${t.type}'.`)}return}},Aa=new WeakSet,Xf=function(i){Ie?i.on("message",e=>{k(this,es).call(this,i,e)}):i.onmessage=e=>k(this,es).call(this,i,e.data)},es=new WeakMap;var l0,h0,c0,f0,u0,d0;l0=new WeakMap,h0=new WeakMap,c0=new WeakMap,f0=new WeakMap,u0=new WeakMap,d0=new WeakMap;Ie&&(globalThis.Worker=Bi("worker_threads").Worker);var Vn,Qa,Wf,ts,uf=class extends Za{constructor(i){super(),L(this,Qa),this.close=()=>{},L(this,Vn,void 0),L(this,ts,async(t,n)=>{if(!(!n||!n.type))switch(n.type){case"resolve":this.resolve();return;case"response":this.resolveResponse(n);return;case"system":this.systemQueue.put(n.data);return;default:this.outputQueue.put(n);return;case"request":{let r=n,s=r.data.msg;switch(s.type){case"read":{let o=await this.inputQueue.get();if(k(this,Vn)){let a=Pa(r.data.uuid,o);k(this,Vn).postMessage(a)}break}default:throw new pt(`Unsupported request type '${s.type}'.`)}return}case"sync-request":throw new pt("Can't send messages of type 'sync-request' in PostMessage mode. Use 'request' instead.")}});let e=t=>{me(this,Vn,t),Je(this,Qa,Wf).call(this,t),this.close=()=>t.terminate();let n={type:"init",data:{config:i,channelType:Qt.PostMessage}};t.postMessage(n)};if(Ya(i.baseUrl))Ga(`${i.baseUrl}webr-worker.js`,t=>e(t));else{let t=new Worker(`${i.baseUrl}webr-worker.js`);e(t)}({resolve:this.resolve,promise:this.initialised}=ms())}interrupt(){console.error("Interrupting R execution is not available when using the PostMessage channel")}};Vn=new WeakMap,Qa=new WeakSet,Wf=function(i){Ie?i.on("message",e=>{k(this,ts).call(this,i,e)}):i.onmessage=e=>k(this,ts).call(this,i,e.data)},ts=new WeakMap;var p0,m0,g0,O0,y0;p0=new WeakMap,m0=new WeakMap,g0=new WeakMap,O0=new WeakMap,y0=new WeakMap;var Qt={Automatic:0,SharedArrayBuffer:1,ServiceWorker:2,PostMessage:3};function b0(i){switch(i.channelType){case Qt.SharedArrayBuffer:return new cf(i);case Qt.ServiceWorker:return new a0(i);case Qt.PostMessage:return new uf(i);case Qt.Automatic:default:return typeof SharedArrayBuffer<"u"?new cf(i):new uf(i)}}var w0=Ie?__dirname+"/":"https://webr.r-wasm.org/v0.4.0/",v0="https://repo.r-wasm.org",If="0.4.0";function ee(i){return!!i&&(typeof i=="object"||typeof i=="function")&&"payloadType"in i&&Lf(i._payload)}function Re(i){return ee(i)&&i._payload.obj.type==="null"}function x0(i){return ee(i)&&i._payload.obj.type==="symbol"}function k0(i){return ee(i)&&i._payload.obj.type==="pairlist"}function S0(i){return ee(i)&&i._payload.obj.type==="environment"}function T0(i){return ee(i)&&i._payload.obj.type==="logical"}function P0(i){return ee(i)&&i._payload.obj.type==="integer"}function C0(i){return ee(i)&&i._payload.obj.type==="double"}function R0(i){return ee(i)&&i._payload.obj.type==="complex"}function Ui(i){return ee(i)&&i._payload.obj.type==="character"}function ot(i){return ee(i)&&i._payload.obj.type==="list"}function Ja(i){return ee(i)&&i._payload.obj.type==="raw"}function gs(i){return ee(i)&&i._payload.obj.type==="call"}function Os(i){var e;return!!(ee(i)&&(e=i._payload.obj.methods)!=null&&e.includes("exec"))}function E0(){}function A0(i,e){return async function*(){let t={type:"callRObjectMethod",data:{payload:e._payload,prop:"getPropertyValue",args:[{payloadType:"raw",obj:"length"}],shelter:void 0}},n=await i.request(t);if(typeof n.obj!="number")throw new di("Cannot iterate over object, unexpected type for length property.");for(let r=1;r<=n.obj;r++)yield e.get(r)}}function Nf(i,e,t){return async(...n)=>{let r=n.map(a=>ee(a)?a._payload:{obj:Ut(a,ee,l=>l._payload),payloadType:"raw"}),s={type:"callRObjectMethod",data:{payload:t,prop:e,args:r}},o=await i.request(s);switch(o.payloadType){case"ptr":return fi(i,o);case"raw":return Ut(o,Lf,(a,l)=>fi(l,a),i).obj}}}async function Q0(i,e,t,...n){let r={type:"newRObject",data:{objType:e,args:Ut(n,ee,o=>o._payload),shelter:t}},s=await i.request(r);switch(s.payloadType){case"raw":throw new Bn("Unexpected raw payload type returned from newRObject");case"ptr":return fi(i,s)}}function fi(i,e){var t;let n=new Proxy((t=e.obj.methods)!=null&&t.includes("exec")?Object.assign(E0,{...e}):e,{get:(r,s)=>{var o;if(s==="_payload")return e;if(s===Symbol.asyncIterator)return A0(i,n);if((o=e.obj.methods)!=null&&o.includes(s.toString()))return Nf(i,s.toString(),e)},apply:async(r,s,o)=>{let a=await fi(i,e).exec(...o);return Os(a)?a:a.toJs()}});return n}function Ve(i,e,t){return new Proxy(z,{construct:(n,r)=>Q0(i,t,e,...r),get:(n,r)=>Nf(i,r.toString())})}var ss,os,as,ls,hs,Ma,_a,Da,$a,Va,La,jf,M0=class{constructor(i={},e={REnv:{R_HOME:"/usr/lib/R",FONTCONFIG_PATH:"/etc/fonts",R_ENABLE_JIT:"0"}}){L(this,La),L(this,ss,void 0),L(this,os,void 0),L(this,as,void 0),L(this,ls,void 0),L(this,hs,void 0),L(this,Ma,t=>{console.log(t)}),L(this,_a,t=>{console.error(t)}),L(this,Da,t=>{let n=prompt(t);n&&this.stdin(`${n} +`)}),L(this,$a,t=>{if(Ie)throw new Error("Plotting with HTML canvas is not yet supported under Node");this.canvas.getContext("2d").drawImage(t,0,0)}),L(this,Va,()=>{if(Ie)throw new Error("Plotting with HTML canvas is not yet supported under Node");this.canvas.getContext("2d").clearRect(0,0,this.canvas.width,this.canvas.height)}),this.webR=new Uf(e),Ie||(this.canvas=document.createElement("canvas"),this.canvas.setAttribute("width","1008"),this.canvas.setAttribute("height","1008")),me(this,ss,i.stdout||k(this,Ma)),me(this,os,i.stderr||k(this,_a)),me(this,as,i.prompt||k(this,Da)),me(this,ls,i.canvasImage||k(this,$a)),me(this,hs,i.canvasNewPage||k(this,Va)),this.webR.evalRVoid("options(device=webr::canvas)")}stdin(i){this.webR.writeConsole(i)}interrupt(){this.webR.interrupt()}run(){Je(this,La,jf).call(this)}};ss=new WeakMap,os=new WeakMap,as=new WeakMap,ls=new WeakMap,hs=new WeakMap,Ma=new WeakMap,_a=new WeakMap,Da=new WeakMap,$a=new WeakMap,Va=new WeakMap,La=new WeakSet,jf=async function(){for(;;){let i=await this.webR.read();switch(i.type){case"stdout":k(this,ss).call(this,i.data);break;case"stderr":k(this,os).call(this,i.data);break;case"prompt":k(this,as).call(this,i.data);break;case"canvas":i.data.event==="canvasImage"?k(this,ls).call(this,i.data.image):i.data.event==="canvasNewPage"&&k(this,hs).call(this);break;case"closed":return;default:console.warn(`Unhandled output type for webR Console: ${i.type}.`)}}};var _0={FONTCONFIG_PATH:"/etc/fonts",R_HOME:"/usr/lib/R",R_ENABLE_JIT:"0",WEBR:"1",WEBR_VERSION:If},df={RArgs:[],REnv:_0,baseUrl:w0,serviceWorkerUrl:"",repoUrl:v0,homedir:"/home/web_user",interactive:!0,channelType:Qt.Automatic,createLazyFilesystem:!0},ne,is,qa,zf,Uf=class{constructor(i={}){L(this,qa),L(this,ne,void 0),L(this,is,void 0),this.version=If,this.FS={lookupPath:async t=>{let n={type:"lookupPath",data:{path:t}};return(await k(this,ne).request(n)).obj},mkdir:async t=>{let n={type:"mkdir",data:{path:t}};return(await k(this,ne).request(n)).obj},mount:async(t,n,r)=>{let s={type:"mount",data:{type:t,options:n,mountpoint:r}};await k(this,ne).request(s)},syncfs:async t=>{let n={type:"syncfs",data:{populate:t}};await k(this,ne).request(n)},readFile:async(t,n)=>{let r={type:"readFile",data:{path:t,flags:n}};return(await k(this,ne).request(r)).obj},rmdir:async t=>{let n={type:"rmdir",data:{path:t}};await k(this,ne).request(n)},writeFile:async(t,n,r)=>{let s={type:"writeFile",data:{path:t,data:n,flags:r}};await k(this,ne).request(s)},unlink:async t=>{let n={type:"unlink",data:{path:t}};await k(this,ne).request(n)},unmount:async t=>{let n={type:"unmount",data:{path:t}};await k(this,ne).request(n)}};let e={...df,...i,REnv:{...df.REnv,...i.REnv}};me(this,ne,b0(e)),this.objs={},this.Shelter=D0(k(this,ne)),me(this,is,k(this,ne).initialised.then(async()=>{this.globalShelter=await new this.Shelter,this.RObject=this.globalShelter.RObject,this.RLogical=this.globalShelter.RLogical,this.RInteger=this.globalShelter.RInteger,this.RDouble=this.globalShelter.RDouble,this.RComplex=this.globalShelter.RComplex,this.RCharacter=this.globalShelter.RCharacter,this.RRaw=this.globalShelter.RRaw,this.RList=this.globalShelter.RList,this.RDataFrame=this.globalShelter.RDataFrame,this.RPairlist=this.globalShelter.RPairlist,this.REnvironment=this.globalShelter.REnvironment,this.RSymbol=this.globalShelter.RSymbol,this.RString=this.globalShelter.RString,this.RCall=this.globalShelter.RCall,this.objs={baseEnv:await this.RObject.getPersistentObject("baseEnv"),globalEnv:await this.RObject.getPersistentObject("globalEnv"),null:await this.RObject.getPersistentObject("null"),true:await this.RObject.getPersistentObject("true"),false:await this.RObject.getPersistentObject("false"),na:await this.RObject.getPersistentObject("na")},Je(this,qa,zf).call(this)}))}async init(){return k(this,is)}close(){k(this,ne).close()}async read(){return await k(this,ne).read()}async flush(){return await k(this,ne).flush()}write(i){k(this,ne).write(i)}writeConsole(i){this.write({type:"stdin",data:i+` +`})}interrupt(){k(this,ne).interrupt()}async installPackages(i,e){let t=Object.assign({quiet:!1,mount:!0},e),n={type:"installPackages",data:{name:i,options:t}};await k(this,ne).request(n)}async destroy(i){await this.globalShelter.destroy(i)}async evalR(i,e){return this.globalShelter.evalR(i,e)}async evalRVoid(i,e){return this.evalRRaw(i,"void",e)}async evalRBoolean(i,e){return this.evalRRaw(i,"boolean",e)}async evalRNumber(i,e){return this.evalRRaw(i,"number",e)}async evalRString(i,e){return this.evalRRaw(i,"string",e)}async evalRRaw(i,e,t={}){let n=Ut(t,ee,o=>o._payload),r={type:"evalRRaw",data:{code:i,options:n,outputType:e}},s=await k(this,ne).request(r);switch(s.payloadType){case"raw":return s.obj;case"ptr":throw new Bn("Unexpected ptr payload type returned from evalRVoid")}}async invokeWasmFunction(i,...e){let t={type:"invokeWasmFunction",data:{ptr:i,args:e}};return(await k(this,ne).request(t)).obj}};ne=new WeakMap,is=new WeakMap,qa=new WeakSet,zf=async function(){for(;;){let i=await k(this,ne).readSystem();switch(i.type){case"setTimeoutWasm":setTimeout((e,t)=>{this.invokeWasmFunction(e,...t)},i.data.delay,i.data.ptr,i.data.args);break;case"console.log":console.log(i.data);break;case"console.warn":console.warn(i.data);break;case"console.error":console.error(i.data);break;default:throw new di("Unknown system message type `"+i.type+"`")}}};var se,Z,ns,Ba=class{constructor(i){L(this,se,""),L(this,Z,void 0),L(this,ns,!1),me(this,Z,i)}async init(){if(k(this,ns))return;let i={type:"newShelter"},e=await k(this,Z).request(i);me(this,se,e.obj),this.RObject=Ve(k(this,Z),k(this,se),"object"),this.RLogical=Ve(k(this,Z),k(this,se),"logical"),this.RInteger=Ve(k(this,Z),k(this,se),"integer"),this.RDouble=Ve(k(this,Z),k(this,se),"double"),this.RComplex=Ve(k(this,Z),k(this,se),"complex"),this.RCharacter=Ve(k(this,Z),k(this,se),"character"),this.RRaw=Ve(k(this,Z),k(this,se),"raw"),this.RList=Ve(k(this,Z),k(this,se),"list"),this.RDataFrame=Ve(k(this,Z),k(this,se),"dataframe"),this.RPairlist=Ve(k(this,Z),k(this,se),"pairlist"),this.REnvironment=Ve(k(this,Z),k(this,se),"environment"),this.RSymbol=Ve(k(this,Z),k(this,se),"symbol"),this.RString=Ve(k(this,Z),k(this,se),"string"),this.RCall=Ve(k(this,Z),k(this,se),"call"),me(this,ns,!0)}async purge(){let i={type:"shelterPurge",data:k(this,se)};await k(this,Z).request(i)}async destroy(i){let e={type:"shelterDestroy",data:{id:k(this,se),obj:i._payload}};await k(this,Z).request(e)}async size(){let i={type:"shelterSize",data:k(this,se)};return(await k(this,Z).request(i)).obj}async evalR(i,e={}){let t=Ut(e,ee,s=>s._payload),n={type:"evalR",data:{code:i,options:t,shelter:k(this,se)}},r=await k(this,Z).request(n);switch(r.payloadType){case"raw":throw new Bn("Unexpected payload type returned from evalR");default:return fi(k(this,Z),r)}}async captureR(i,e={}){let t=Ut(e,ee,s=>s._payload),n={type:"captureR",data:{code:i,options:t,shelter:k(this,se)}},r=await k(this,Z).request(n);switch(r.payloadType){case"ptr":throw new Bn("Unexpected payload type returned from evalR");case"raw":{let s=r.obj,o=fi(k(this,Z),s.result),a=s.output,l=s.images;for(let h=0;h{let e=new Ba(i);return await e.init(),e}})}var Hf=Symbol("Comlink.proxy"),il=Symbol("Comlink.endpoint"),$0=Symbol("Comlink.releaseProxy"),el=Symbol("Comlink.finalizer"),bs=Symbol("Comlink.thrown"),Gf=i=>typeof i=="object"&&i!==null||typeof i=="function",V0={canHandle:i=>Gf(i)&&i[Hf],serialize(i){let{port1:e,port2:t}=new MessageChannel;return ks(i,e),[t,[t]]},deserialize(i){return i.start(),Wn(i)}},L0={canHandle:i=>Gf(i)&&bs in i,serialize({value:i}){let e;return i instanceof Error?e={isError:!0,value:{message:i.message,name:i.name,stack:i.stack}}:e={isError:!1,value:i},[e,[]]},deserialize(i){throw i.isError?Object.assign(new Error(i.value.message),i.value):i.value}},gi=new Map([["proxy",V0],["throw",L0]]);function q0(i,e){for(let t of i)if(e===t||t==="*"||t instanceof RegExp&&t.test(e))return!0;return!1}function ks(i,e=globalThis,t=["*"]){e.addEventListener("message",function n(r){if(!r||!r.data)return;if(!q0(t,r.origin)){console.warn(`Invalid origin '${r.origin}' for comlink proxy`);return}let{id:s,type:o,path:a}=Object.assign({path:[]},r.data),l=(r.data.argumentList||[]).map(mi),h;try{let c=a.slice(0,-1).reduce((u,d)=>u[d],i),f=a.reduce((u,d)=>u[d],i);switch(o){case"GET":h=f;break;case"SET":c[a.slice(-1)[0]]=mi(r.data.value),h=!0;break;case"APPLY":h=f.apply(c,l);break;case"CONSTRUCT":{let u=new f(...l);h=j0(u)}break;case"ENDPOINT":{let{port1:u,port2:d}=new MessageChannel;ks(i,d),h=N0(u,[u])}break;case"RELEASE":h=void 0;break;default:return}}catch(c){h={value:c,[bs]:0}}Promise.resolve(h).catch(c=>({value:c,[bs]:0})).then(c=>{let[f,u]=xs(c);e.postMessage(Object.assign(Object.assign({},f),{id:s}),u),o==="RELEASE"&&(e.removeEventListener("message",n),Yf(e),el in i&&typeof i[el]=="function"&&i[el]())}).catch(c=>{let[f,u]=xs({value:new TypeError("Unserializable return value"),[bs]:0});e.postMessage(Object.assign(Object.assign({},f),{id:s}),u)})}),e.start&&e.start()}function B0(i){return i.constructor.name==="MessagePort"}function Yf(i){B0(i)&&i.close()}function Wn(i,e){return tl(i,[],e)}function ys(i){if(i)throw new Error("Proxy has been released and is not useable")}function Zf(i){return Fi(i,{type:"RELEASE"}).then(()=>{Yf(i)})}var ws=new WeakMap,vs="FinalizationRegistry"in globalThis&&new FinalizationRegistry(i=>{let e=(ws.get(i)||0)-1;ws.set(i,e),e===0&&Zf(i)});function X0(i,e){let t=(ws.get(e)||0)+1;ws.set(e,t),vs&&vs.register(i,e,i)}function W0(i){vs&&vs.unregister(i)}function tl(i,e=[],t=function(){}){let n=!1,r=new Proxy(t,{get(s,o){if(ys(n),o===$0)return()=>{W0(r),Zf(i),n=!0};if(o==="then"){if(e.length===0)return{then:()=>r};let a=Fi(i,{type:"GET",path:e.map(l=>l.toString())}).then(mi);return a.then.bind(a)}return tl(i,[...e,o])},set(s,o,a){ys(n);let[l,h]=xs(a);return Fi(i,{type:"SET",path:[...e,o].map(c=>c.toString()),value:l},h).then(mi)},apply(s,o,a){ys(n);let l=e[e.length-1];if(l===il)return Fi(i,{type:"ENDPOINT"}).then(mi);if(l==="bind")return tl(i,e.slice(0,-1));let[h,c]=Ff(a);return Fi(i,{type:"APPLY",path:e.map(f=>f.toString()),argumentList:h},c).then(mi)},construct(s,o){ys(n);let[a,l]=Ff(o);return Fi(i,{type:"CONSTRUCT",path:e.map(h=>h.toString()),argumentList:a},l).then(mi)}});return X0(r,i),r}function I0(i){return Array.prototype.concat.apply([],i)}function Ff(i){let e=i.map(xs);return[e.map(t=>t[0]),I0(e.map(t=>t[1]))]}var Jf=new WeakMap;function N0(i,e){return Jf.set(i,e),i}function j0(i){return Object.assign(i,{[Hf]:!0})}function xs(i){for(let[e,t]of gi)if(t.canHandle(i)){let[n,r]=t.serialize(i);return[{type:"HANDLER",name:e,value:n},r]}return[{type:"RAW",value:i},Jf.get(i)||[]]}function mi(i){switch(i.type){case"HANDLER":return gi.get(i.name).deserialize(i.value);case"RAW":return i.value}}function Fi(i,e,t){return new Promise(n=>{let r=z0();i.addEventListener("message",function s(o){!o.data||!o.data.id||o.data.id!==r||(i.removeEventListener("message",s),n(o.data))}),i.start&&i.start(),i.postMessage(Object.assign({id:r},e),t)})}function z0(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}var Hi=[],Ke=class{constructor(e){this.isRunning=!1;this.isDestroyed=!1;Hi.push(this),e?this.callbacks=e:this.callbacks={busyCallback:()=>{},idleCallback:()=>{},runningCallback:()=>{},finishedCallback:()=>{}}}running(){this.isRunning=!0,Hi.forEach(e=>e.callbacks.busyCallback()),this.callbacks.runningCallback()}finished(){this.isRunning=!1,this.callbacks.finishedCallback(),this.status().busy||Hi.forEach(e=>e.callbacks.idleCallback())}status(){let e=this.isRunning,t=this.isDestroyed,n=Hi.some(r=>r.isRunning);return{running:e,busy:n,destroyed:t}}destroy(){this.isDestroyed=!0;let e=Hi.indexOf(this);Hi.splice(e,1)}};var W=class i{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=en(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),Yi.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=en(this,e,t);let n=[];return this.decompose(e,t,n,0),Yi.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new bi(this),s=new bi(e);for(let o=t,a=t;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}iter(e=1){return new bi(this,e)}iterRange(e,t=this.length){return new Cs(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(t=this.lines+1);let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Rs(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?i.empty:e.length<=32?new Ne(e):Yi.from(Ne.split(e,[]))}},Ne=class i extends W{constructor(e,t=U0(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let s=0;;s++){let o=this.text[s],a=r+o.length;if((t?n:a)>=e)return new rl(r,a,n,o);r=a+1,n++}}decompose(e,t,n,r){let s=e<=0&&t>=this.length?this:new i(eu(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let o=n.pop(),a=Ps(s.text,o.text.slice(),0,s.length);if(a.length<=32)n.push(new i(a,o.length+s.length));else{let l=a.length>>1;n.push(new i(a.slice(0,l)),new i(a.slice(l)))}}else n.push(s)}replace(e,t,n){if(!(n instanceof i))return super.replace(e,t,n);[e,t]=en(this,e,t);let r=Ps(this.text,Ps(n.text,eu(this.text,0,e)),t),s=this.length+n.length-(t-e);return r.length<=32?new i(r,s):Yi.from(i.split(r,[]),s)}sliceString(e,t=this.length,n=` +`){[e,t]=en(this,e,t);let r="";for(let s=0,o=0;s<=t&&oe&&o&&(r+=n),es&&(r+=a.slice(Math.max(0,e-s),t-s)),s=l+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],r=-1;for(let s of e)n.push(s),r+=s.length+1,n.length==32&&(t.push(new i(n,r)),n=[],r=-1);return r>-1&&t.push(new i(n,r)),t}},Yi=class i extends W{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,r){for(let s=0;;s++){let o=this.children[s],a=r+o.length,l=n+o.lines-1;if((t?l:a)>=e)return o.lineInner(e,t,n,r);r=a+1,n=l+1}}decompose(e,t,n,r){for(let s=0,o=0;o<=t&&s=o){let h=r&((o<=e?1:0)|(l>=t?2:0));o>=e&&l<=t&&!h?n.push(a):a.decompose(e-o,t-o,n,h)}o=l+1}}replace(e,t,n){if([e,t]=en(this,e,t),n.lines=s&&t<=a){let l=o.replace(e-s,t-s,n),h=this.lines-o.lines+l.lines;if(l.lines>4&&l.lines>h>>6){let c=this.children.slice();return c[r]=l,new i(c,this.length-(t-e)+n.length)}return super.replace(s,a,l)}s=a+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n=` +`){[e,t]=en(this,e,t);let r="";for(let s=0,o=0;se&&s&&(r+=n),eo&&(r+=a.sliceString(e-o,t-o,n)),o=l+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof i))return 0;let n=0,[r,s,o,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,s+=t){if(r==o||s==a)return n;let l=this.children[r],h=e.children[s];if(l!=h)return n+l.scanIdentical(h,t);n+=l.length+1}}static from(e,t=e.reduce((n,r)=>n+r.length+1,-1)){let n=0;for(let d of e)n+=d.lines;if(n<32){let d=[];for(let m of e)m.flatten(d);return new Ne(d,t)}let r=Math.max(32,n>>5),s=r<<1,o=r>>1,a=[],l=0,h=-1,c=[];function f(d){let m;if(d.lines>s&&d instanceof i)for(let p of d.children)f(p);else d.lines>o&&(l>o||!l)?(u(),a.push(d)):d instanceof Ne&&l&&(m=c[c.length-1])instanceof Ne&&d.lines+m.lines<=32?(l+=d.lines,h+=d.length+1,c[c.length-1]=new Ne(m.text.concat(d.text),m.length+1+d.length)):(l+d.lines>r&&u(),l+=d.lines,h+=d.length+1,c.push(d))}function u(){l!=0&&(a.push(c.length==1?c[0]:i.from(c,h)),h=-1,l=c.length=0)}for(let d of e)f(d);return u(),a.length==1?a[0]:new i(a,t)}};W.empty=new Ne([""],0);function U0(i){let e=-1;for(let t of i)e+=t.length+1;return e}function Ps(i,e,t=0,n=1e9){for(let r=0,s=0,o=!0;s=t&&(l>n&&(a=a.slice(0,n-r)),r0?1:(e instanceof Ne?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],s=this.offsets[n],o=s>>1,a=r instanceof Ne?r.text.length:r.children.length;if(o==(t>0?a:0)){if(n==0)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=` +`,this;e--}else if(r instanceof Ne){let l=r.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,l.length>Math.max(0,e))return this.value=e==0?l:t>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=r.children[o+(t<0?-1:0)];e>l.length?(e-=l.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(l),this.offsets.push(t>0?1:(l instanceof Ne?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},Cs=class{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new bi(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}},Rs=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<"u"&&(W.prototype[Symbol.iterator]=function(){return this.iter()},bi.prototype[Symbol.iterator]=Cs.prototype[Symbol.iterator]=Rs.prototype[Symbol.iterator]=function(){return this});var rl=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}};function en(i,e,t){return e=Math.max(0,Math.min(i.length,e)),[e,Math.max(e,Math.min(i.length,t))]}var Zi="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(i=>i?parseInt(i,36):1);for(let i=1;ii)return Zi[e-1]<=i;return!1}function tu(i){return i>=127462&&i<=127487}var iu=8205;function ue(i,e,t=!0,n=!0){return(t?lu:H0)(i,e,n)}function lu(i,e,t){if(e==i.length)return e;e&&hu(i.charCodeAt(e))&&cu(i.charCodeAt(e-1))&&e--;let n=ce(i,e);for(e+=Ee(n);e=0&&tu(ce(i,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function H0(i,e,t){for(;e>0;){let n=lu(i,e-2,t);if(n=56320&&i<57344}function cu(i){return i>=55296&&i<56320}function ce(i,e){let t=i.charCodeAt(e);if(!cu(t)||e+1==i.length)return t;let n=i.charCodeAt(e+1);return hu(n)?(t-55296<<10)+(n-56320)+65536:t}function Fn(i){return i<=65535?String.fromCharCode(i):(i-=65536,String.fromCharCode((i>>10)+55296,(i&1023)+56320))}function Ee(i){return i<65536?1:2}var sl=/\r\n?|\n/,ge=function(i){return i[i.Simple=0]="Simple",i[i.TrackDel=1]="TrackDel",i[i.TrackBefore=2]="TrackBefore",i[i.TrackAfter=3]="TrackAfter",i}(ge||(ge={})),_t=class i{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return s+(e-r);s+=a}else{if(n!=ge.Simple&&h>=e&&(n==ge.TrackDel&&re||n==ge.TrackBefore&&re))return null;if(h>e||h==e&&t<0&&!a)return e==r||t<0?s:s+l;s+=l}r=h}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,t=e){for(let n=0,r=0;n=0&&r<=t&&a>=e)return rt?"cover":!0;r=a}return!1}toString(){let e="";for(let t=0;t=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new i(e)}static create(e){return new i(e)}},Ae=class i extends _t{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return ol(this,(t,n,r,s,o)=>e=e.replace(r,r+(n-t),o),!1),e}mapDesc(e,t=!1){return al(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let r=0,s=0;r=0){t[r]=a,t[r+1]=o;let l=r>>1;for(;n.length0&&Ft(n,t,s.text),s.forward(c),a+=c}let h=e[o++];for(;a>1].toJSON()))}return e}static of(e,t,n){let r=[],s=[],o=0,a=null;function l(c=!1){if(!c&&!r.length)return;ou||f<0||u>t)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${t})`);let m=d?typeof d=="string"?W.of(d.split(n||sl)):d:W.empty,p=m.length;if(f==u&&p==0)return;fo&&Se(r,f-o,-1),Se(r,u-f,p),Ft(s,r,m),o=u}}return h(e),l(!a),a}static empty(e){return new i(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let r=0;ra&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;n.length=0&&t<=0&&t==i[r+1]?i[r]+=e:e==0&&i[r]==0?i[r+1]+=t:n?(i[r]+=e,i[r+1]+=t):i.push(e,t)}function Ft(i,e,t){if(t.length==0)return;let n=e.length-2>>1;if(n>1])),!(t||o==i.sections.length||i.sections[o+1]<0);)a=i.sections[o++],l=i.sections[o++];e(r,h,s,c,f),r=h,s=c}}}function al(i,e,t,n=!1){let r=[],s=n?[]:null,o=new wi(i),a=new wi(e);for(let l=-1;;)if(o.ins==-1&&a.ins==-1){let h=Math.min(o.len,a.len);Se(r,h,-1),o.forward(h),a.forward(h)}else if(a.ins>=0&&(o.ins<0||l==o.i||o.off==0&&(a.len=0&&l=0){let h=0,c=o.len;for(;c;)if(a.ins==-1){let f=Math.min(c,a.len);h+=f,c-=f,a.forward(f)}else if(a.ins==0&&a.lenl||o.ins>=0&&o.len>l)&&(a||n.length>h),s.forward2(l),o.forward(l)}}}}var wi=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?W.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?W.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},Gi=class i{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let n,r;return this.empty?n=r=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),n==this.from&&r==this.to?this:new i(n,r,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return S.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return S.range(this.anchor,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return S.range(e.anchor,e.head)}static create(e,t,n){return new i(e,t,n)}},S=class i{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:i.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;ne.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new i(e.ranges.map(t=>Gi.fromJSON(t)),e.main)}static single(e,t=e){return new i([i.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,r=0;re?8:0)|s)}static normalized(e,t=0){let n=e[t];e.sort((r,s)=>r.from-s.from),t=e.indexOf(n);for(let r=1;rs.head?i.range(l,a):i.range(a,l))}}return new i(e,t)}};function uu(i,e){for(let t of i.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}var Ol=0,A=class i{constructor(e,t,n,r,s){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=Ol++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new i(e.combine||(t=>t),e.compareInput||((t,n)=>t===n),e.compare||(e.combine?(t,n)=>t===n:yl),!!e.static,e.enables)}of(e){return new Ji([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ji(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ji(e,this,2,t)}from(e,t){return t||(t=n=>n),this.compute([e],n=>t(n.field(e)))}};function yl(i,e){return i==e||i.length==e.length&&i.every((t,n)=>t===e[n])}var Ji=class{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=Ol++}dynamicSlot(e){var t;let n=this.value,r=this.facet.compareInput,s=this.id,o=e[s]>>1,a=this.type==2,l=!1,h=!1,c=[];for(let f of this.dependencies)f=="doc"?l=!0:f=="selection"?h=!0:((t=e[f.id])!==null&&t!==void 0?t:1)&1||c.push(e[f.id]);return{create(f){return f.values[o]=n(f),1},update(f,u){if(l&&u.docChanged||h&&(u.docChanged||u.selection)||ll(f,c)){let d=n(f);if(a?!nu(d,f.values[o],r):!r(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,m=u.config.address[s];if(m!=null){let p=Qs(u,m);if(this.dependencies.every(g=>g instanceof A?u.facet(g)===f.facet(g):g instanceof te?u.field(g,!1)==f.field(g,!1):!0)||(a?nu(d=n(f),p,r):r(d=n(f),p)))return f.values[o]=p,0}else d=n(f);return f.values[o]=d,1}}}};function nu(i,e,t){if(i.length!=e.length)return!1;for(let n=0;ni[l.id]),r=t.map(l=>l.type),s=n.filter(l=>!(l&1)),o=i[e.id]>>1;function a(l){let h=[];for(let c=0;cn===r),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(ru).find(n=>n.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:n=>(n.values[t]=this.create(n),1),update:(n,r)=>{let s=n.values[t],o=this.updateF(s,r);return this.compareF(s,o)?0:(n.values[t]=o,1)},reconfigure:(n,r)=>r.config.address[this.id]!=null?(n.values[t]=r.field(this),0):(n.values[t]=this.create(n),1)}}init(e){return[this,ru.of({field:this,create:e})]}get extension(){return this}},Oi={lowest:4,low:3,default:2,high:1,highest:0};function In(i){return e=>new Es(e,i)}var Qe={highest:In(Oi.highest),high:In(Oi.high),default:In(Oi.default),low:In(Oi.low),lowest:In(Oi.lowest)},Es=class{constructor(e,t){this.inner=e,this.prec=t}},Dt=class i{of(e){return new jn(this,e)}reconfigure(e){return i.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}},jn=class{constructor(e,t){this.compartment=e,this.inner=t}},As=class i{constructor(e,t,n,r,s,o){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,n){let r=[],s=Object.create(null),o=new Map;for(let u of Y0(e,t,o))u instanceof te?r.push(u):(s[u.facet.id]||(s[u.facet.id]=[])).push(u);let a=Object.create(null),l=[],h=[];for(let u of r)a[u.id]=h.length<<1,h.push(d=>u.slot(d));let c=n?.config.facets;for(let u in s){let d=s[u],m=d[0].facet,p=c&&c[u]||[];if(d.every(g=>g.type==0))if(a[m.id]=l.length<<1|1,yl(p,d))l.push(n.facet(m));else{let g=m.combine(d.map(O=>O.value));l.push(n&&m.compare(g,n.facet(m))?n.facet(m):g)}else{for(let g of d)g.type==0?(a[g.id]=l.length<<1|1,l.push(g.value)):(a[g.id]=h.length<<1,h.push(O=>g.dynamicSlot(O)));a[m.id]=h.length<<1,h.push(g=>G0(g,m,d))}}let f=h.map(u=>u(a));return new i(e,o,f,a,l,s)}};function Y0(i,e,t){let n=[[],[],[],[],[]],r=new Map;function s(o,a){let l=r.get(o);if(l!=null){if(l<=a)return;let h=n[l].indexOf(o);h>-1&&n[l].splice(h,1),o instanceof jn&&t.delete(o.compartment)}if(r.set(o,a),Array.isArray(o))for(let h of o)s(h,a);else if(o instanceof jn){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),s(h,a)}else if(o instanceof Es)s(o.inner,o.prec);else if(o instanceof te)n[a].push(o),o.provides&&s(o.provides,a);else if(o instanceof Ji)n[a].push(o),o.facet.extensions&&s(o.facet.extensions,Oi.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(h,a)}}return s(i,Oi.default),n.reduce((o,a)=>o.concat(a))}function Nn(i,e){if(e&1)return 2;let t=e>>1,n=i.status[t];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;i.status[t]=4;let r=i.computeSlot(i,i.config.dynamicSlots[t]);return i.status[t]=2|r}function Qs(i,e){return e&1?i.config.staticValues[e>>1]:i.values[e>>1]}var du=A.define(),hl=A.define({combine:i=>i.some(e=>e),static:!0}),pu=A.define({combine:i=>i.length?i[0]:void 0,static:!0}),mu=A.define(),gu=A.define(),Ou=A.define(),yu=A.define({combine:i=>i.length?i[0]:!1}),Le=class{constructor(e,t){this.type=e,this.value=t}static define(){return new cl}},cl=class{of(e){return new Le(this,e)}},fl=class{constructor(e){this.map=e}of(e){return new _(this,e)}},_=class i{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new i(this.type,t)}is(e){return this.type==e}static define(e={}){return new fl(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let s=r.map(t);s&&n.push(s)}return n}};_.reconfigure=_.define();_.appendConfig=_.define();var fe=class i{constructor(e,t,n,r,s,o){this.startState=e,this.changes=t,this.selection=n,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,n&&uu(n,t.newLength),s.some(a=>a.type==i.time)||(this.annotations=s.concat(i.time.of(Date.now())))}static create(e,t,n,r,s,o){return new i(e,t,n,r,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(i.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}};fe.time=Le.define();fe.userEvent=Le.define();fe.addToHistory=Le.define();fe.remote=Le.define();function Z0(i,e){let t=[];for(let n=0,r=0;;){let s,o;if(n=i[n]))s=i[n++],o=i[n++];else if(r=0;r--){let s=n[r](i);s instanceof fe?i=s:Array.isArray(s)&&s.length==1&&s[0]instanceof fe?i=s[0]:i=wu(e,Ki(s),!1)}return i}function K0(i){let e=i.startState,t=e.facet(Ou),n=i;for(let r=t.length-1;r>=0;r--){let s=t[r](i);s&&Object.keys(s).length&&(n=bu(n,ul(e,s,i.changes.newLength),!0))}return n==i?i:fe.create(e,i.changes,i.selection,n.effects,n.annotations,n.scrollIntoView)}var ey=[];function Ki(i){return i==null?ey:Array.isArray(i)?i:[i]}var F=function(i){return i[i.Word=0]="Word",i[i.Space=1]="Space",i[i.Other=2]="Other",i}(F||(F={})),ty=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,dl;try{dl=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function iy(i){if(dl)return dl.test(i);for(let e=0;e"\x80"&&(t.toUpperCase()!=t.toLowerCase()||ty.test(t)))return!0}return!1}function ny(i){return e=>{if(!/\S/.test(e))return F.Space;if(iy(e))return F.Word;for(let t=0;t-1)return F.Word;return F.Other}}var N=class i{constructor(e,t,n,r,s,o){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let a=0;ar.set(h,l)),t=null),r.set(a.value.compartment,a.value.extension)):a.is(_.reconfigure)?(t=null,n=a.value):a.is(_.appendConfig)&&(t=null,n=Ki(n).concat(a.value));let s;t?s=e.startState.values.slice():(t=As.resolve(n,r,this),s=new i(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(l,h)=>h.reconfigure(l,this),null).values);let o=e.startState.facet(hl)?e.newSelection:e.newSelection.asSingle();new i(t,e.newDoc,o,s,(a,l)=>l.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:S.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),s=[n.range],o=Ki(n.effects);for(let a=1;ao.spec.fromJSON(a,l)))}}return i.create({doc:e.doc,selection:S.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=As.resolve(e.extensions||[],new Map),n=e.doc instanceof W?e.doc:W.of((e.doc||"").split(t.staticFacet(i.lineSeparator)||sl)),r=e.selection?e.selection instanceof S?e.selection:S.single(e.selection.anchor,e.selection.head):S.single(0);return uu(r,n.length),t.staticFacet(hl)||(r=r.asSingle()),new i(t,n,r,t.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(i.tabSize)}get lineBreak(){return this.facet(i.lineSeparator)||` +`}get readOnly(){return this.facet(yu)}phrase(e,...t){for(let n of this.facet(i.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(n,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>t.length?n:t[s-1]})),e}languageDataAt(e,t,n=-1){let r=[];for(let s of this.facet(du))for(let o of s(this,t,n))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){return ny(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-n,a=e-n;for(;o>0;){let l=ue(t,o,!1);if(s(t.slice(l,o))!=F.Word)break;o=l}for(;ai.length?i[0]:4});N.lineSeparator=pu;N.readOnly=yu;N.phrases=A.define({compare(i,e){let t=Object.keys(i),n=Object.keys(e);return t.length==n.length&&t.every(r=>i[r]==e[r])}});N.languageData=du;N.changeFilter=mu;N.transactionFilter=gu;N.transactionExtender=Ou;Dt.reconfigure=_.define();function Te(i,e,t={}){let n={};for(let r of i)for(let s of Object.keys(r)){let o=r[s],a=n[s];if(a===void 0)n[s]=o;else if(!(a===o||o===void 0))if(Object.hasOwnProperty.call(t,s))n[s]=t[s](a,o);else throw new Error("Config merge conflict for field "+s)}for(let r in e)n[r]===void 0&&(n[r]=e[r]);return n}var at=class{eq(e){return this==e}range(e,t=e){return zn.create(e,t,this)}};at.prototype.startSide=at.prototype.endSide=0;at.prototype.point=!1;at.prototype.mapMode=ge.TrackDel;var zn=class i{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new i(e,t,n)}};function pl(i,e){return i.from-e.from||i.value.startSide-e.value.startSide}var ml=class i{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let s=n?this.to:this.from;for(let o=r,a=s.length;;){if(o==a)return o;let l=o+a>>1,h=s[l]-e||(n?this.value[l].endSide:this.value[l].startSide)-t;if(l==o)return h>=0?o:a;h>=0?a=l:o=l+1}}between(e,t,n,r){for(let s=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,s);sd||u==d&&h.startSide>0&&h.endSide<=0)continue;(d-u||h.endSide-h.startSide)<0||(o<0&&(o=u),h.point&&(a=Math.max(a,d-u)),n.push(h),r.push(u-o),s.push(d-o))}return{mapped:n.length?new i(r,s,n,a):null,pos:o}}},j=class i{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(e,t,n,r){return new i(e,t,n,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:r=0,filterTo:s=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(n&&(t=t.slice().sort(pl)),this.isEmpty)return t.length?i.of(t):this;let a=new Ms(this,null,-1).goto(0),l=0,h=[],c=new lt;for(;a.value||l=0){let f=t[l++];c.addInner(f.from,f.to,f.value)||h.push(f)}else a.rangeIndex==1&&a.chunkIndexthis.chunkEnd(a.chunkIndex)||sa.to||s=s&&e<=s+o.length&&o.between(s,e-s,t-s,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return Un.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Un.from(e).goto(t)}static compare(e,t,n,r,s=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),a=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),l=su(o,a,n),h=new yi(o,l,s),c=new yi(a,l,s);n.iterGaps((f,u,d)=>ou(h,f,c,u,d,r)),n.empty&&n.length==0&&ou(h,0,c,0,0,r)}static eq(e,t,n=0,r){r==null&&(r=999999999);let s=e.filter(c=>!c.isEmpty&&t.indexOf(c)<0),o=t.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let a=su(s,o),l=new yi(s,a,0).goto(n),h=new yi(o,a,0).goto(n);for(;;){if(l.to!=h.to||!gl(l.active,h.active)||l.point&&(!h.point||!l.point.eq(h.point)))return!1;if(l.to>r)return!0;l.next(),h.next()}}static spans(e,t,n,r,s=-1){let o=new yi(e,null,s).goto(t),a=t,l=o.openStart;for(;;){let h=Math.min(o.to,n);if(o.point){let c=o.activeForPoint(o.to),f=o.pointFroma&&(r.span(a,h,o.active,l),l=o.openEnd(h));if(o.to>n)return l+(o.point&&o.to>n?1:0);a=o.to,o.next()}}static of(e,t=!1){let n=new lt;for(let r of e instanceof zn?[e]:t?ry(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(e){if(!e.length)return i.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let r=e[n];r!=i.empty;r=r.nextLayer)t=new i(r.chunkPos,r.chunk,t,Math.max(r.maxPoint,t.maxPoint));return t}};j.empty=new j([],[],null,-1);function ry(i){if(i.length>1)for(let e=i[0],t=1;t0)return i.slice().sort(pl);e=n}return i}j.empty.nextLayer=j.empty;var lt=class i{finishChunk(e){this.chunks.push(new ml(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new i)).add(e,t,n)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(j.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=j.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}};function su(i,e,t){let n=new Map;for(let s of i)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=n&&r.push(new Ms(o,t,n,s));return r.length==1?r[0]:new i(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let n=this.heap.length>>1;n>=0;n--)nl(this.heap,n);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let n=this.heap.length>>1;n>=0;n--)nl(this.heap,n);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),nl(this.heap,0)}}};function nl(i,e){for(let t=i[e];;){let n=(e<<1)+1;if(n>=i.length)break;let r=i[n];if(n+1=0&&(r=i[n+1],n++),t.compare(r)<0)break;i[n]=t,i[e]=r,e=n}}var yi=class{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Un.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Ss(this.active,e),Ss(this.activeTo,e),Ss(this.activeRank,e),this.minActive=au(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:s}=this.cursor;for(;t0;)t++;Ts(this.active,t,n),Ts(this.activeTo,t,r),Ts(this.activeRank,t,s),e&&Ts(e,t,this.cursor.from),this.minActive=au(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&Ss(n,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&n[r]=0&&!(this.activeRank[n]e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}};function ou(i,e,t,n,r,s){i.goto(e),t.goto(n);let o=n+r,a=n,l=n-e;for(;;){let h=i.to+l-t.to||i.endSide-t.endSide,c=h<0?i.to+l:t.to,f=Math.min(c,o);if(i.point||t.point?i.point&&t.point&&(i.point==t.point||i.point.eq(t.point))&&gl(i.activeForPoint(i.to),t.activeForPoint(t.to))||s.comparePoint(a,f,i.point,t.point):f>a&&!gl(i.active,t.active)&&s.compareRange(a,f,i.active,t.active),c>o)break;a=c,h<=0&&i.next(),h>=0&&t.next()}}function gl(i,e){if(i.length!=e.length)return!1;for(let t=0;t=e;n--)i[n+1]=i[n];i[e]=t}function au(i,e){let t=-1,n=1e9;for(let r=0;r=e)return r;if(r==i.length)break;s+=i.charCodeAt(r)==9?t-s%t:1,r=ue(i,r)}return n===!0?-1:i.length}var bl="\u037C",vu=typeof Symbol>"u"?"__"+bl:Symbol.for(bl),wl=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),xu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},et=class{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,a,l,h){let c=[],f=/^@(\w+)\b/.exec(o[0]),u=f&&f[1]=="keyframes";if(f&&a==null)return l.push(o[0]+";");for(let d in a){let m=a[d];if(/&/.test(d))s(d.split(/,\s*/).map(p=>o.map(g=>p.replace(/&/,g))).reduce((p,g)=>p.concat(g)),m,l);else if(m&&typeof m=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");s(r(d),m,c,u)}else m!=null&&c.push(d.replace(/_.*/,"").replace(/[A-Z]/g,p=>"-"+p.toLowerCase())+": "+m+";")}(c.length||u)&&l.push((n&&!f&&!h?o.map(n):o).join(", ")+" {"+c.join(" ")+"}")}for(let o in e)s(r(o),e[o],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let e=xu[vu]||1;return xu[vu]=e+1,bl+e.toString(36)}static mount(e,t,n){let r=e[wl],s=n&&n.nonce;r?s&&r.setNonce(s):r=new vl(e,s),r.mount(Array.isArray(t)?t:[t],e)}},ku=new Map,vl=class{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let s=ku.get(n);if(s)return e[wl]=s;this.sheet=new r.CSSStyleSheet,ku.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[wl]=this}mount(e,t){let n=this.sheet,r=0,s=0;for(let o=0;o-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,a),n)for(let h=0;h",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},sy=typeof navigator<"u"&&/Mac/.test(navigator.platform),oy=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(de=0;de<10;de++)Vt[48+de]=Vt[96+de]=String(de);var de;for(de=1;de<=24;de++)Vt[de+111]="F"+de;var de;for(de=65;de<=90;de++)Vt[de]=String.fromCharCode(de+32),tn[de]=String.fromCharCode(de);var de;for(Ds in Vt)tn.hasOwnProperty(Ds)||(tn[Ds]=Vt[Ds]);var Ds;function Su(i){var e=sy&&i.metaKey&&i.shiftKey&&!i.ctrlKey&&!i.altKey||oy&&i.shiftKey&&i.key&&i.key.length==1||i.key=="Unidentified",t=!e&&i.key||(i.shiftKey?tn:Vt)[i.keyCode]||i.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function ar(i){let e;return i.nodeType==11?e=i.getSelection?i:i.ownerDocument:e=i,e.getSelection()}function El(i,e){return e?i==e||i.contains(e.nodeType!=1?e.parentNode:e):!1}function ay(i){let e=i.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function js(i,e){if(!e.anchorNode)return!1;try{return El(i,e.anchorNode)}catch{return!1}}function lr(i){return i.nodeType==3?ki(i,0,i.nodeValue.length).getClientRects():i.nodeType==1?i.getClientRects():[]}function er(i,e,t,n){return t?Tu(i,e,t,n,-1)||Tu(i,e,t,n,1):!1}function xi(i){for(var e=0;;e++)if(i=i.previousSibling,!i)return e}function Ys(i){return i.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(i.nodeName)}function Tu(i,e,t,n,r){for(;;){if(i==t&&e==n)return!0;if(e==(r<0?0:Lt(i))){if(i.nodeName=="DIV")return!1;let s=i.parentNode;if(!s||s.nodeType!=1)return!1;e=xi(i)+(r<0?0:1),i=s}else if(i.nodeType==1){if(i=i.childNodes[e+(r<0?-1:0)],i.nodeType==1&&i.contentEditable=="false")return!1;e=r<0?Lt(i):0}else return!1}}function Lt(i){return i.nodeType==3?i.nodeValue.length:i.childNodes.length}function yh(i,e){let t=e?i.left:i.right;return{left:t,right:t,top:i.top,bottom:i.bottom}}function ly(i){let e=i.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:i.innerWidth,top:0,bottom:i.innerHeight}}function fd(i,e){let t=e.width/i.offsetWidth,n=e.height/i.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-i.offsetWidth)<1)&&(t=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-i.offsetHeight)<1)&&(n=1),{scaleX:t,scaleY:n}}function hy(i,e,t,n,r,s,o,a){let l=i.ownerDocument,h=l.defaultView||window;for(let c=i,f=!1;c&&!f;)if(c.nodeType==1){let u,d=c==l.body,m=1,p=1;if(d)u=ly(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(f=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let y=c.getBoundingClientRect();({scaleX:m,scaleY:p}=fd(c,y)),u={left:y.left,right:y.left+c.clientWidth*m,top:y.top,bottom:y.top+c.clientHeight*p}}let g=0,O=0;if(r=="nearest")e.top0&&e.bottom>u.bottom+O&&(O=e.bottom-u.bottom+O+o)):e.bottom>u.bottom&&(O=e.bottom-u.bottom+o,t<0&&e.top-O0&&e.right>u.right+g&&(g=e.right-u.right+g+s)):e.right>u.right&&(g=e.right-u.right+s,t<0&&e.leftt.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.assignedSlot||t.parentNode}else if(t.nodeType==11)t=t.host;else break;return null}var Al=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?Lt(t):0),n,Math.min(e.focusOffset,n?Lt(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}},nn=null;function ud(i){if(i.setActive)return i.setActive();if(nn)return i.focus(nn);let e=[];for(let t=i;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(i.focus(nn==null?{get preventScroll(){return nn={preventScroll:!0},!0}}:void 0),!nn){nn=!1;for(let t=0;tMath.max(1,i.scrollHeight-i.clientHeight-4)}function md(i,e){for(let t=i,n=e;;){if(t.nodeType==3&&n>0)return{node:t,offset:n};if(t.nodeType==1&&n>0){if(t.contentEditable=="false")return null;t=t.childNodes[n-1],n=Lt(t)}else if(t.parentNode&&!Ys(t))n=xi(t),t=t.parentNode;else return null}}function gd(i,e){for(let t=i,n=e;;){if(t.nodeType==3&&nt)return f.domBoundsAround(e,t,h);if(u>=e&&r==-1&&(r=l,s=h),h>t&&f.dom.parentNode==this.dom){o=l,a=c;break}c=u,h=u+f.breakAfter}return{from:s,to:a<0?n+this.length:a,startDOM:(r?this.children[r-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,n=bh){this.markDirty();for(let r=e;rthis.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}};function Od(i,e,t,n,r,s,o,a,l){let{children:h}=i,c=h.length?h[e]:null,f=s.length?s[s.length-1]:null,u=f?f.breakAfter:o;if(!(e==n&&c&&!o&&!u&&s.length<2&&c.merge(t,r,s.length?f:null,t==0,a,l))){if(n0&&(!o&&s.length&&c.merge(t,c.length,s[0],!1,a,0)?c.breakAfter=s.shift().breakAfter:(t2),Q={mac:Au||/Mac/.test(qe.platform),windows:/Win/.test(qe.platform),linux:/Linux|X11/.test(qe.platform),ie:fo,ie_version:bd?Ql.documentMode||6:_l?+_l[1]:Ml?+Ml[1]:0,gecko:Ru,gecko_version:Ru?+(/Firefox\/(\d+)/.exec(qe.userAgent)||[0,0])[1]:0,chrome:!!xl,chrome_version:xl?+xl[1]:0,ios:Au,android:/Android\b/.test(qe.userAgent),webkit:Eu,safari:wd,webkit_version:Eu?+(/\bAppleWebKit\/(\d+)/.exec(qe.userAgent)||[0,0])[1]:0,tabSize:Ql.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"},dy=256,vt=class i extends J{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,n){return this.flags&8||n&&(!(n instanceof i)||this.length-(t-e)+n.length>dy||n.flags&8)?!1:(this.text=this.text.slice(0,e)+(n?n.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new i(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new Me(this.dom,e)}domBoundsAround(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return py(this.dom,e,t)}},Zt=class i extends J{constructor(e,t=[],n=0){super(),this.mark=e,this.children=t,this.length=n;for(let r of t)r.setParent(this)}setAttrs(e){if(dd(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,n,r,s,o){return n&&(!(n instanceof i&&n.mark.eq(this.mark))||e&&s<=0||te&&t.push(n=e&&(r=s),n=l,s++}let o=this.length-e;return this.length=e,r>-1&&(this.children.length=r,this.markDirty()),new i(this.mark,t,o)}domAtPos(e){return vd(this,e)}coordsAt(e,t){return kd(this,e,t)}};function py(i,e,t){let n=i.nodeValue.length;e>n&&(e=n);let r=e,s=e,o=0;e==0&&t<0||e==n&&t>=0?Q.chrome||Q.gecko||(e?(r--,o=1):s=0)?0:a.length-1];return Q.safari&&!o&&l.width==0&&(l=Array.prototype.find.call(a,h=>h.width)||l),o?yh(l,o<0):l||null}var hr=class i extends J{static create(e,t,n){return new i(e,t,n)}constructor(e,t,n){super(),this.widget=e,this.length=t,this.side=n,this.prevWidget=null}split(e){let t=i.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,n,r,s,o){return n&&(!(n instanceof i)||!this.widget.compare(n.widget)||e>0&&s<=0||t0)?Me.before(this.dom):Me.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);if(n)return n;let r=this.dom.getClientRects(),s=null;if(!r.length)return null;let o=this.side?this.side<0:e>0;for(let a=o?r.length-1:0;s=r[a],!(e>0?a==0:a==r.length-1||s.top0?Me.before(this.dom):Me.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return W.empty}get isHidden(){return!0}};vt.prototype.children=hr.prototype.children=cr.prototype.children=bh;function vd(i,e){let t=i.dom,{children:n}=i,r=0;for(let s=0;rs&&e0;s--){let o=n[s-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let s=r;s0&&e instanceof Zt&&r.length&&(n=r[r.length-1])instanceof Zt&&n.mark.eq(e.mark)?xd(n,e.children[0],t-1):(r.push(e),e.setParent(i)),i.length+=e.length}function kd(i,e,t){let n=null,r=-1,s=null,o=-1;function a(h,c){for(let f=0,u=0;f=c&&(d.children.length?a(d,c-u):(!s||s.isHidden&&t>0)&&(m>c||u==m&&d.getSide()>0)?(s=d,o=c-u):(u-1?1:0)!=r.length-(t&&r.indexOf(t)>-1?1:0))return!1;for(let s of n)if(s!=t&&(r.indexOf(s)==-1||i[s]!==e[s]))return!1;return!0}function $l(i,e,t){let n=!1;if(e)for(let r in e)t&&r in t||(n=!0,r=="style"?i.style.cssText="":i.removeAttribute(r));if(t)for(let r in t)e&&e[r]==t[r]||(n=!0,r=="style"?i.style.cssText=t[r]:i.setAttribute(r,t[r]));return n}function gy(i){let e=Object.create(null);for(let t=0;t0&&this.children[n-1].length==0;)this.children[--n].destroy();return this.children.length=n,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){Js(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){xd(this,e,t)}addLineDeco(e){let t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=Dl(t,this.attrs||{})),n&&(this.attrs=Dl({class:n},this.attrs||{}))}domAtPos(e){return vd(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var n;this.dom?this.flags&4&&(dd(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&($l(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let r=this.dom.lastChild;for(;r&&J.get(r)instanceof Zt;)r=r.lastChild;if(!r||!this.length||r.nodeName!="BR"&&((n=J.get(r))===null||n===void 0?void 0:n.isEditable)==!1&&(!Q.ios||!this.children.some(s=>s instanceof vt))){let s=document.createElement("BR");s.cmIgnore=!0,this.dom.appendChild(s)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let n of this.children){if(!(n instanceof vt)||/[^ -~]/.test(n.text))return null;let r=lr(n.dom);if(r.length!=1)return null;e+=r[0].width,t=r[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let n=kd(this,e,t);if(!this.children.length&&n&&this.parent){let{heightOracle:r}=this.parent.view.viewState,s=n.bottom-n.top;if(Math.abs(s-r.lineHeight)<2&&r.textHeight=t){if(s instanceof i)return s;if(o>t)break}r=o+s.breakAfter}return null}},vi=class i extends J{constructor(e,t,n){super(),this.widget=e,this.length=t,this.deco=n,this.breakAfter=0,this.prevWidget=null}merge(e,t,n,r,s,o){return n&&(!(n instanceof i)||!this.widget.compare(n.widget)||e>0&&s<=0||t0}},Be=class{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}},_e=function(i){return i[i.Text=0]="Text",i[i.WidgetBefore=1]="WidgetBefore",i[i.WidgetAfter=2]="WidgetAfter",i[i.WidgetRange=3]="WidgetRange",i}(_e||(_e={})),M=class extends at{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new fr(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new Jt(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:s,end:o}=Sd(e,t);n=(s?t?-3e8:-1:5e8)-1,r=(o?t?2e8:1:-6e8)+1}return new Jt(e,n,r,t,e.widget||null,!0)}static line(e){return new ur(e)}static set(e,t=!1){return j.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};M.none=j.empty;var fr=class i extends M{constructor(e){let{start:t,end:n}=Sd(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,n;return this==e||e instanceof i&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((n=e.attrs)===null||n===void 0?void 0:n.class))&&Js(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}};fr.prototype.point=!1;var ur=class i extends M{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof i&&this.spec.class==e.spec.class&&Js(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}};ur.prototype.mapMode=ge.TrackBefore;ur.prototype.point=!0;var Jt=class i extends M{constructor(e,t,n,r,s,o){super(t,n,s,e),this.block=r,this.isReplace=o,this.mapMode=r?t<=0?ge.TrackBefore:ge.TrackAfter:ge.TrackDel}get type(){return this.startSide!=this.endSide?_e.WidgetRange:this.startSide<=0?_e.WidgetBefore:_e.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof i&&Oy(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}};Jt.prototype.point=!0;function Sd(i,e=!1){let{inclusiveStart:t,inclusiveEnd:n}=i;return t==null&&(t=i.inclusive),n==null&&(n=i.inclusive),{start:t??e,end:n??e}}function Oy(i,e){return i==e||!!(i&&e&&i.compare(e))}function Vl(i,e,t,n=0){let r=t.length-1;r>=0&&t[r]+n>=i?t[r]=Math.max(t[r],e):t.push(i,e)}var tr=class i{constructor(e,t,n,r){this.doc=e,this.pos=t,this.end=n,this.disallowBlockEffectsFor=r,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof vi&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new be),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append($s(new cr(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof vi)&&this.getLine()}buildText(e,t,n){for(;e>0;){if(this.textOff==this.text.length){let{value:s,lineBreak:o,done:a}=this.cursor.next(this.skip);if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=s,this.textOff=0}let r=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-n)),this.getLine().append($s(new vt(this.text.slice(this.textOff,this.textOff+r)),t),n),this.atCursorPos=!0,this.textOff+=r,e-=r,n=0}}span(e,t,n,r){this.buildText(t-e,n,r),this.pos=t,this.openStart<0&&(this.openStart=r)}point(e,t,n,r,s,o){if(this.disallowBlockEffectsFor[o]&&n instanceof Jt){if(n.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let a=t-e;if(n instanceof Jt)if(n.block)n.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new vi(n.widget||Kt.block,a,n));else{let l=hr.create(n.widget||Kt.inline,a,a?0:n.startSide),h=this.atCursorPos&&!l.isEditable&&s<=r.length&&(e0),c=!l.isEditable&&(er.length||n.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!h&&!l.isEditable&&(this.pendingBuffer=0),this.flushBuffer(r),h&&(f.append($s(new cr(1),r),s),s=r.length+Math.max(0,s-r.length)),f.append($s(l,r),s),this.atCursorPos=c,this.pendingBuffer=c?er.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=r.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);a&&(this.textOff+a<=this.text.length?this.textOff+=a:(this.skip+=a-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=s)}static build(e,t,n,r,s){let o=new i(e,t,n,s);return o.openEnd=j.spans(r,t,n,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}};function $s(i,e){for(let t of e)i=new Zt(t,[i],i.length);return i}var Kt=class extends Be{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}};Kt.inline=new Kt("span");Kt.block=new Kt("div");var H=function(i){return i[i.LTR=0]="LTR",i[i.RTL=1]="RTL",i}(H||(H={})),Si=H.LTR,wh=H.RTL;function Td(i){let e=[];for(let t=0;t=t){if(a.level==n)return o;(s<0||(r!=0?r<0?a.fromt:e[s].level>a.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}};function Cd(i,e){if(i.length!=e.length)return!1;for(let t=0;t=0;p-=3)if(Ot[p+1]==-d){let g=Ot[p+2],O=g&2?r:g&4?g&1?s:r:0;O&&(Y[f]=Y[Ot[p]]=O),a=p;break}}else{if(Ot.length==189)break;Ot[a++]=f,Ot[a++]=u,Ot[a++]=l}else if((m=Y[f])==2||m==1){let p=m==r;l=p?0:1;for(let g=a-3;g>=0;g-=3){let O=Ot[g+2];if(O&2)break;if(p)Ot[g+2]|=2;else{if(O&4)break;Ot[g+2]|=4}}}}}function ky(i,e,t,n){for(let r=0,s=n;r<=t.length;r++){let o=r?t[r-1].to:i,a=rl;)m==g&&(m=t[--p].from,g=p?t[p-1].to:i),Y[--m]=d;l=c}else s=h,l++}}}function ql(i,e,t,n,r,s,o){let a=n%2?2:1;if(n%2==r%2)for(let l=e,h=0;ll&&o.push(new bt(l,p.from,d));let g=p.direction==Si!=!(d%2);Bl(i,g?n+1:n,r,p.inner,p.from,p.to,o),l=p.to}m=p.to}else{if(m==t||(c?Y[m]!=a:Y[m]==a))break;m++}u?ql(i,l,m,n+1,r,u,o):le;){let c=!0,f=!1;if(!h||l>s[h-1].to){let p=Y[l-1];p!=a&&(c=!1,f=p==16)}let u=!c&&a==1?[]:null,d=c?n:n+1,m=l;e:for(;;)if(h&&m==s[h-1].to){if(f)break e;let p=s[--h];if(!c)for(let g=p.from,O=h;;){if(g==e)break e;if(O&&s[O-1].to==g)g=s[--O].from;else{if(Y[g-1]==a)break e;break}}if(u)u.push(p);else{p.toY.length;)Y[Y.length]=256;let n=[],r=e==Si?0:1;return Bl(i,r,r,t,0,i.length,n),n}function Rd(i){return[new bt(0,i,0)]}var Ed="";function Ty(i,e,t,n,r){var s;let o=n.head-i.from,a=bt.find(e,o,(s=n.bidiLevel)!==null&&s!==void 0?s:-1,n.assoc),l=e[a],h=l.side(r,t);if(o==h){let u=a+=r?1:-1;if(u<0||u>=e.length)return null;l=e[a=u],o=l.side(!r,t),h=l.side(r,t)}let c=ue(i.text,o,l.forward(r,t));(cl.to)&&(c=h),Ed=i.text.slice(Math.min(o,c),Math.max(o,c));let f=a==(r?e.length-1:0)?null:e[a+(r?1:-1)];return f&&c==h&&f.level+(r?0:1)i.some(e=>e)}),Ld=A.define({combine:i=>i.some(e=>e)}),qd=A.define(),ir=class i{constructor(e,t="nearest",n="nearest",r=5,s=5,o=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new i(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new i(S.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},Vs=_.define({map:(i,e)=>i.map(e)}),Bd=_.define();function we(i,e,t){let n=i.facet(_d);n.length?n[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}var Ht=A.define({combine:i=>i.length?i[0]:!0}),Cy=0,Gn=A.define(),re=class i{constructor(e,t,n,r,s){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.extension=s(this)}static define(e,t){let{eventHandlers:n,eventObservers:r,provide:s,decorations:o}=t||{};return new i(Cy++,e,n,r,a=>{let l=[Gn.of(a)];return o&&l.push(dr.of(h=>{let c=h.plugin(a);return c?o(c):M.none})),s&&l.push(s(a)),l})}static fromClass(e,t){return i.define(n=>new e(n),t)}},nr=class{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(n){if(we(t.state,n,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){we(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(n){we(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}},Xd=A.define(),vh=A.define(),dr=A.define(),Wd=A.define(),xh=A.define(),Id=A.define();function Mu(i,e){let t=i.state.facet(Id);if(!t.length)return t;let n=t.map(s=>s instanceof Function?s(i):s),r=[];return j.spans(n,e.from,e.to,{point(){},span(s,o,a,l){let h=s-e.from,c=o-e.from,f=r;for(let u=a.length-1;u>=0;u--,l--){let d=a[u].spec.bidiIsolate,m;if(d==null&&(d=Py(e.text,h,c)),l>0&&f.length&&(m=f[f.length-1]).to==h&&m.direction==d)m.to=c,f=m.inner;else{let p={from:h,to:c,direction:d,inner:[]};f.push(p),f=p.inner}}}}),r}var Nd=A.define();function jd(i){let e=0,t=0,n=0,r=0;for(let s of i.state.facet(Nd)){let o=s(i);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(n=Math.max(n,o.top)),o.bottom!=null&&(r=Math.max(r,o.bottom)))}return{left:e,right:t,top:n,bottom:r}}var Yn=A.define(),wt=class i{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(e){return new i(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toAc)break;s+=2}if(!l)return n;new i(l.fromA,l.toA,l.fromB,l.toB).addToSet(n),o=l.toA,a=l.toB}}},Ks=class i{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=Ae.empty(this.startState.doc.length);for(let s of n)this.changes=this.changes.compose(s.changes);let r=[];this.changes.iterChangedRanges((s,o,a,l)=>r.push(new wt(s,o,a,l))),this.changedRanges=r}static create(e,t,n){return new i(e,t,n)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}},eo=class extends J{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=M.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new be],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new wt(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:h,toA:c})=>cthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?r=this.domChanged.newSel.head:!Dy(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let s=r>-1?Ey(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:h,to:c}=this.hasComposition;n=new wt(h,c,e.changes.mapPos(h,-1),e.changes.mapPos(c,1)).addToSet(n.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(Q.ie||Q.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,a=this.updateDeco(),l=My(o,a,e.changes);return n=wt.extendWithRanges(n,l),!(this.flags&7)&&n.length==0?!1:(this.updateInner(n,e.startState.doc.length,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,n){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,n);let{observer:r}=this.view;r.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=Q.chrome||Q.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||r.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let s=[];if(this.view.viewport.from||this.view.viewport.to=0?r[o]:null;if(!a)break;let{fromA:l,toA:h,fromB:c,toB:f}=a,u,d,m,p;if(n&&n.range.fromBc){let x=tr.build(this.view.state.doc,c,n.range.fromB,this.decorations,this.dynamicDecorationMap),w=tr.build(this.view.state.doc,n.range.toB,f,this.decorations,this.dynamicDecorationMap);d=x.breakAtStart,m=x.openStart,p=w.openEnd;let P=this.compositionView(n);w.breakAtStart?P.breakAfter=1:w.content.length&&P.merge(P.length,P.length,w.content[0],!1,w.openStart,0)&&(P.breakAfter=w.content[0].breakAfter,w.content.shift()),x.content.length&&P.merge(0,0,x.content[x.content.length-1],!0,0,x.openEnd)&&x.content.pop(),u=x.content.concat(P).concat(w.content)}else({content:u,breakAtStart:d,openStart:m,openEnd:p}=tr.build(this.view.state.doc,c,f,this.decorations,this.dynamicDecorationMap));let{i:g,off:O}=s.findPos(h,1),{i:y,off:v}=s.findPos(l,-1);Od(this,y,v,g,O,u,d,m,p)}n&&this.fixCompositionDOM(n)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let n of t.effects)n.is(Bd)&&(this.editContextFormatting=n.value)}compositionView(e){let t=new vt(e.text.nodeValue);t.flags|=8;for(let{deco:r}of e.marks)t=new Zt(r,[t],t.length);let n=new be;return n.append(t,0),n}fixCompositionDOM(e){let t=(s,o)=>{o.flags|=8|(o.children.some(l=>l.flags&7)?1:0),this.markedForComposition.add(o);let a=J.get(s);a&&a!=o&&(a.dom=null),o.setDOM(s)},n=this.childPos(e.range.fromB,1),r=this.children[n.i];t(e.line,r);for(let s=e.marks.length-1;s>=-1;s--)n=r.childPos(n.off,1),r=r.children[n.i],t(s>=0?e.marks[s].node:e.text,r)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let n=this.view.root.activeElement,r=n==this.dom,s=!r&&js(this.dom,this.view.observer.selectionRange)&&!(n&&this.dom.contains(n));if(!(r||t||s))return;let o=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,l=this.moveToLine(this.domAtPos(a.anchor)),h=a.empty?l:this.moveToLine(this.domAtPos(a.head));if(Q.gecko&&a.empty&&!this.hasComposition&&Ry(l)){let f=document.createTextNode("");this.view.observer.ignore(()=>l.node.insertBefore(f,l.node.childNodes[l.offset]||null)),l=h=new Me(f,0),o=!0}let c=this.view.observer.selectionRange;(o||!c.focusNode||(!er(l.node,l.offset,c.anchorNode,c.anchorOffset)||!er(h.node,h.offset,c.focusNode,c.focusOffset))&&!this.suppressWidgetCursorChange(c,a))&&(this.view.observer.ignore(()=>{Q.android&&Q.chrome&&this.dom.contains(c.focusNode)&&_y(c.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=ar(this.view.root);if(f)if(a.empty){if(Q.gecko){let u=Ay(l.node,l.offset);if(u&&u!=3){let d=(u==1?md:gd)(l.node,l.offset);d&&(l=new Me(d.node,d.offset))}}f.collapse(l.node,l.offset),a.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=a.bidiLevel)}else if(f.extend){f.collapse(l.node,l.offset);try{f.extend(h.node,h.offset)}catch{}}else{let u=document.createRange();a.anchor>a.head&&([l,h]=[h,l]),u.setEnd(h.node,h.offset),u.setStart(l.node,l.offset),f.removeAllRanges(),f.addRange(u)}s&&this.view.root.activeElement==this.dom&&(this.dom.blur(),n&&n.focus())}),this.view.observer.setSelectionRange(l,h)),this.impreciseAnchor=l.precise?null:new Me(c.anchorNode,c.anchorOffset),this.impreciseHead=h.precise?null:new Me(c.focusNode,c.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&er(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=ar(e.root),{anchorNode:r,anchorOffset:s}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let o=be.find(this,t.head);if(!o)return;let a=o.posAtStart;if(t.head==a||t.head==a+o.length)return;let l=this.coordsAt(t.head,-1),h=this.coordsAt(t.head,1);if(!l||!h||l.bottom>h.top)return;let c=this.domAtPos(t.head+t.assoc);n.collapse(c.node,c.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=t.from&&n.collapse(r,s)}moveToLine(e){let t=this.dom,n;if(e.node!=t)return e;for(let r=e.offset;!n&&r=0;r--){let s=J.get(t.childNodes[r]);s instanceof be&&(n=s.domAtPos(s.length))}return n?new Me(n.node,n.offset,!0):e}nearest(e){for(let t=e;t;){let n=J.get(t);if(n&&n.rootView==this)return n;t=t.parentNode}return null}posFromDOM(e,t){let n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}domAtPos(e){let{i:t,off:n}=this.childCursor().findPos(e,-1);for(;t=0;o--){let a=this.children[o],l=s-a.breakAfter,h=l-a.length;if(le||a.covers(1))&&(!n||a instanceof be&&!(n instanceof be&&t>=0)))n=a,r=h;else if(n&&h==e&&l==e&&a instanceof vi&&Math.abs(t)<2){if(a.deco.startSide<0)break;o&&(n=null)}s=h}return n?n.coordsAt(e-r,t):null}coordsForChar(e){let{i:t,off:n}=this.childPos(e,1),r=this.children[t];if(!(r instanceof be))return null;for(;r.children.length;){let{i:a,off:l}=r.childPos(n,1);for(;;a++){if(a==r.children.length)return null;if((r=r.children[a]).length)break}n=l}if(!(r instanceof vt))return null;let s=ue(r.text,n);if(s==n)return null;let o=ki(r.dom,n,s).getClientRects();for(let a=0;aMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==H.LTR;for(let h=0,c=0;cr)break;if(h>=n){let d=f.dom.getBoundingClientRect();if(t.push(d.height),o){let m=f.dom.lastChild,p=m?lr(m):[];if(p.length){let g=p[p.length-1],O=l?g.right-d.left:d.right-g.left;O>a&&(a=O,this.minWidth=s,this.minWidthFrom=h,this.minWidthTo=u)}}}h=u+f.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?H.RTL:H.LTR}measureTextSize(){for(let s of this.children)if(s instanceof be){let o=s.measureTextSize();if(o)return o}let e=document.createElement("div"),t,n,r;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let s=lr(e.firstChild)[0];t=e.getBoundingClientRect().height,n=s?s.width/27:7,r=s?s.height:t,e.remove()}),{lineHeight:t,charWidth:n,textHeight:r}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new Zs(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let s=r==t.viewports.length?null:t.viewports[r],o=s?s.from-1:this.length;if(o>n){let a=(t.lineBlockAt(o).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(M.replace({widget:new to(a),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!s)break;n=s.to+1}return M.set(e)}updateDeco(){let e=1,t=this.view.state.facet(dr).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),n=!1,r=this.view.state.facet(Wd).map((s,o)=>{let a=typeof s=="function";return a&&(n=!0),a?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(j.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];et.anchor?-1:1),r;if(!n)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,r.left),top:Math.min(n.top,r.top),right:Math.max(n.right,r.right),bottom:Math.max(n.bottom,r.bottom)});let s=jd(this.view),o={left:n.left-s.left,top:n.top-s.top,right:n.right+s.right,bottom:n.bottom+s.bottom},{offsetWidth:a,offsetHeight:l}=this.view.scrollDOM;hy(this.view.scrollDOM,o,t.head{ne.from&&(t=!0)}),t}function $y(i,e,t=1){let n=i.charCategorizer(e),r=i.doc.lineAt(e),s=e-r.from;if(r.length==0)return S.cursor(e);s==0?t=1:s==r.length&&(t=-1);let o=s,a=s;t<0?o=ue(r.text,s,!1):a=ue(r.text,s);let l=n(r.text.slice(o,a));for(;o>0;){let h=ue(r.text,o,!1);if(n(r.text.slice(h,o))!=l)break;o=h}for(;ai?e.left-i:Math.max(0,i-e.right)}function Ly(i,e){return e.top>i?e.top-i:Math.max(0,i-e.bottom)}function kl(i,e){return i.tope.top+1}function _u(i,e){return ei.bottom?{top:i.top,left:i.left,right:i.right,bottom:e}:i}function Wl(i,e,t){let n,r,s,o,a=!1,l,h,c,f;for(let m=i.firstChild;m;m=m.nextSibling){let p=lr(m);for(let g=0;gv||o==v&&s>y){n=m,r=O,s=y,o=v;let x=v?t0?g0)}y==0?t>O.bottom&&(!c||c.bottomO.top)&&(h=m,f=O):c&&kl(c,O)?c=Du(c,O.bottom):f&&kl(f,O)&&(f=_u(f,O.top))}}if(c&&c.bottom>=t?(n=l,r=c):f&&f.top<=t&&(n=h,r=f),!n)return{node:i,offset:0};let u=Math.max(r.left,Math.min(r.right,e));if(n.nodeType==3)return $u(n,u,t);if(a&&n.contentEditable!="false")return Wl(n,u,t);let d=Array.prototype.indexOf.call(i.childNodes,n)+(e>=(r.left+r.right)/2?1:0);return{node:i,offset:d}}function $u(i,e,t){let n=i.nodeValue.length,r=-1,s=1e9,o=0;for(let a=0;at?c.top-t:t-c.bottom)-1;if(c.left-1<=e&&c.right+1>=e&&f=(c.left+c.right)/2,d=u;if((Q.chrome||Q.gecko)&&ki(i,a).getBoundingClientRect().left==c.right&&(d=!u),f<=0)return{node:i,offset:a+(d?1:0)};r=a+(d?1:0),s=f}}}return{node:i,offset:r>-1?r:o>0?i.nodeValue.length:0}}function Ud(i,e,t,n=-1){var r,s;let o=i.contentDOM.getBoundingClientRect(),a=o.top+i.viewState.paddingTop,l,{docHeight:h}=i.viewState,{x:c,y:f}=e,u=f-a;if(u<0)return 0;if(u>h)return i.state.doc.length;for(let x=i.viewState.heightOracle.textHeight/2,w=!1;l=i.elementAtHeight(u),l.type!=_e.Text;)for(;u=n>0?l.bottom+x:l.top-x,!(u>=0&&u<=h);){if(w)return t?null:0;w=!0,n=-n}f=a+u;let d=l.from;if(di.viewport.to)return i.viewport.to==i.state.doc.length?i.state.doc.length:t?null:Vu(i,o,l,c,f);let m=i.dom.ownerDocument,p=i.root.elementFromPoint?i.root:m,g=p.elementFromPoint(c,f);g&&!i.contentDOM.contains(g)&&(g=null),g||(c=Math.max(o.left+1,Math.min(o.right-1,c)),g=p.elementFromPoint(c,f),g&&!i.contentDOM.contains(g)&&(g=null));let O,y=-1;if(g&&((r=i.docView.nearest(g))===null||r===void 0?void 0:r.isEditable)!=!1){if(m.caretPositionFromPoint){let x=m.caretPositionFromPoint(c,f);x&&({offsetNode:O,offset:y}=x)}else if(m.caretRangeFromPoint){let x=m.caretRangeFromPoint(c,f);x&&({startContainer:O,startOffset:y}=x,(!i.contentDOM.contains(O)||Q.safari&&qy(O,y,c)||Q.chrome&&By(O,y,c))&&(O=void 0))}}if(!O||!i.docView.dom.contains(O)){let x=be.find(i.docView,d);if(!x)return u>l.top+l.height/2?l.to:l.from;({node:O,offset:y}=Wl(x.dom,c,f))}let v=i.docView.nearest(O);if(!v)return null;if(v.isWidget&&((s=v.dom)===null||s===void 0?void 0:s.nodeType)==1){let x=v.dom.getBoundingClientRect();return e.yi.defaultLineHeight*1.5){let a=i.viewState.heightOracle.textHeight,l=Math.floor((r-t.top-(i.defaultLineHeight-a)*.5)/a);s+=l*i.viewState.heightOracle.lineLength}let o=i.state.sliceDoc(t.from,t.to);return t.from+_s(o,s,i.state.tabSize)}function qy(i,e,t){let n;if(i.nodeType!=3||e!=(n=i.nodeValue.length))return!1;for(let r=i.nextSibling;r;r=r.nextSibling)if(r.nodeType!=1||r.nodeName!="BR")return!1;return ki(i,n-1,n).getBoundingClientRect().left>t}function By(i,e,t){if(e!=0)return!1;for(let r=i;;){let s=r.parentNode;if(!s||s.nodeType!=1||s.firstChild!=r)return!1;if(s.classList.contains("cm-line"))break;r=s}let n=i.nodeType==1?i.getBoundingClientRect():ki(i,0,Math.max(i.nodeValue.length,1)).getBoundingClientRect();return t-n.left>5}function Il(i,e){let t=i.lineBlockAt(e);if(Array.isArray(t.type)){for(let n of t.type)if(n.to>e||n.to==e&&(n.to==t.to||n.type==_e.Text))return n}return t}function Xy(i,e,t,n){let r=Il(i,e.head),s=!n||r.type!=_e.Text||!(i.lineWrapping||r.widgetLineBreaks)?null:i.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(s){let o=i.dom.getBoundingClientRect(),a=i.textDirectionAt(r.from),l=i.posAtCoords({x:t==(a==H.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(l!=null)return S.cursor(l,t?-1:1)}return S.cursor(t?r.to:r.from,t?-1:1)}function Lu(i,e,t,n){let r=i.state.doc.lineAt(e.head),s=i.bidiSpans(r),o=i.textDirectionAt(r.from);for(let a=e,l=null;;){let h=Ty(r,s,o,a,t),c=Ed;if(!h){if(r.number==(t?i.state.doc.lines:1))return a;c=` +`,r=i.state.doc.line(r.number+(t?1:-1)),s=i.bidiSpans(r),h=i.visualLineSide(r,!t)}if(l){if(!l(c))return a}else{if(!n)return h;l=n(c)}a=h}}function Wy(i,e,t){let n=i.state.charCategorizer(e),r=n(t);return s=>{let o=n(s);return r==F.Space&&(r=o),r==o}}function Iy(i,e,t,n){let r=e.head,s=t?1:-1;if(r==(t?i.state.doc.length:0))return S.cursor(r,e.assoc);let o=e.goalColumn,a,l=i.contentDOM.getBoundingClientRect(),h=i.coordsAtPos(r,e.assoc||-1),c=i.documentTop;if(h)o==null&&(o=h.left-l.left),a=s<0?h.top:h.bottom;else{let d=i.viewState.lineBlockAt(r);o==null&&(o=Math.min(l.right-l.left,i.defaultCharacterWidth*(r-d.from))),a=(s<0?d.top:d.bottom)+c}let f=l.left+o,u=n??i.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let m=a+(u+d)*s,p=Ud(i,{x:f,y:m},!1,s);if(ml.bottom||(s<0?pr)){let g=i.docView.coordsForChar(p),O=!g||m{if(e>s&&er(i)),t.from,e.head>t.from?-1:1);return n==t.from?t:S.cursor(n,nnull),Q.gecko&&nb(e.contentDOM.ownerDocument)}handleEvent(e){!Gy(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,t){let n=this.handlers[e];if(n){for(let r of n.observers)r(this.view,t);for(let r of n.handlers){if(t.defaultPrevented)break;if(r(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=Ny(e),n=this.handlers,r=this.view.contentDOM;for(let s in t)if(s!="scroll"){let o=!t[s].handlers.length,a=n[s];a&&o!=!a.handlers.length&&(r.removeEventListener(s,this.handleEvent),a=null),a||r.addEventListener(s,this.handleEvent,{passive:o})}for(let s in n)s!="scroll"&&!t[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&Hd.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Q.android&&Q.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return Q.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=Fd.find(n=>n.keyCode==e.keyCode))&&!e.ctrlKey||jy.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from0?!0:Q.safari&&!Q.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function qu(i,e){return(t,n)=>{try{return e.call(i,n,t)}catch(r){we(t.state,r)}}}function Ny(i){let e=Object.create(null);function t(n){return e[n]||(e[n]={observers:[],handlers:[]})}for(let n of i){let r=n.spec;if(r&&r.domEventHandlers)for(let s in r.domEventHandlers){let o=r.domEventHandlers[s];o&&t(s).handlers.push(qu(n.value,o))}if(r&&r.domEventObservers)for(let s in r.domEventObservers){let o=r.domEventObservers[s];o&&t(s).observers.push(qu(n.value,o))}}for(let n in ht)t(n).handlers.push(ht[n]);for(let n in it)t(n).observers.push(it[n]);return e}var Fd=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],jy="dthko",Hd=[16,17,18,20,91,92,224,225],Ls=6;function qs(i){return Math.max(0,i)*.7+8}function zy(i,e){return Math.max(Math.abs(i.clientX-e.clientX),Math.abs(i.clientY-e.clientY))}var jl=class{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=cy(e.contentDOM),this.atoms=e.state.facet(xh).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(N.allowMultipleSelections)&&Uy(e,t),this.dragging=Hy(e,t)&&Jd(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){var t;if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&zy(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,s=((t=this.scrollParent)===null||t===void 0?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},o=jd(this.view);e.clientX-o.left<=s.left+Ls?n=-qs(s.left-e.clientX):e.clientX+o.right>=s.right-Ls&&(n=qs(e.clientX-s.right)),e.clientY-o.top<=s.top+Ls?r=-qs(s.top-e.clientY):e.clientY+o.bottom>=s.bottom-Ls&&(r=qs(e.clientY-s.bottom)),this.setScrollSpeed(n,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let n=0;nt.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function Uy(i,e){let t=i.state.facet(Ad);return t.length?t[0](e):Q.mac?e.metaKey:e.ctrlKey}function Fy(i,e){let t=i.state.facet(Qd);return t.length?t[0](e):Q.mac?!e.altKey:!e.ctrlKey}function Hy(i,e){let{main:t}=i.state.selection;if(t.empty)return!1;let n=ar(i.root);if(!n||n.rangeCount==0)return!0;let r=n.getRangeAt(0).getClientRects();for(let s=0;s=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function Gy(i,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,n;t!=i.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(n=J.get(t))&&n.ignoreEvent(e))return!1;return!0}var ht=Object.create(null),it=Object.create(null),Gd=Q.ie&&Q.ie_version<15||Q.ios&&Q.webkit_version<604;function Yy(i){let e=i.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{i.focus(),t.remove(),Yd(i,t.value)},50)}function Yd(i,e){let{state:t}=i,n,r=1,s=t.toText(e),o=s.lines==t.selection.ranges.length;if(zl!=null&&t.selection.ranges.every(l=>l.empty)&&zl==s.toString()){let l=-1;n=t.changeByRange(h=>{let c=t.doc.lineAt(h.from);if(c.from==l)return{range:h};l=c.from;let f=t.toText((o?s.line(r++).text:e)+t.lineBreak);return{changes:{from:c.from,insert:f},range:S.cursor(h.from+f.length)}})}else o?n=t.changeByRange(l=>{let h=s.line(r++);return{changes:{from:l.from,to:l.to,insert:h.text},range:S.cursor(l.from+h.length)}}):n=t.replaceSelection(s);i.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}it.scroll=i=>{i.inputState.lastScrollTop=i.scrollDOM.scrollTop,i.inputState.lastScrollLeft=i.scrollDOM.scrollLeft};ht.keydown=(i,e)=>(i.inputState.setSelectionOrigin("select"),e.keyCode==27&&i.inputState.tabFocusMode!=0&&(i.inputState.tabFocusMode=Date.now()+2e3),!1);it.touchstart=(i,e)=>{i.inputState.lastTouchTime=Date.now(),i.inputState.setSelectionOrigin("select.pointer")};it.touchmove=i=>{i.inputState.setSelectionOrigin("select.pointer")};ht.mousedown=(i,e)=>{if(i.observer.flush(),i.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let n of i.state.facet(Md))if(t=n(i,e),t)break;if(!t&&e.button==0&&(t=Ky(i,e)),t){let n=!i.hasFocus;i.inputState.startMouseSelection(new jl(i,e,t,n)),n&&i.observer.ignore(()=>{ud(i.contentDOM);let s=i.root.activeElement;s&&!s.contains(i.contentDOM)&&s.blur()});let r=i.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}return!1};function Bu(i,e,t,n){if(n==1)return S.cursor(e,t);if(n==2)return $y(i.state,e,t);{let r=be.find(i.docView,e),s=i.state.doc.lineAt(r?r.posAtEnd:e),o=r?r.posAtStart:s.from,a=r?r.posAtEnd:s.to;return ai>=e.top&&i<=e.bottom,Xu=(i,e,t)=>Zd(e,t)&&i>=t.left&&i<=t.right;function Zy(i,e,t,n){let r=be.find(i.docView,e);if(!r)return 1;let s=e-r.posAtStart;if(s==0)return 1;if(s==r.length)return-1;let o=r.coordsAt(s,-1);if(o&&Xu(t,n,o))return-1;let a=r.coordsAt(s,1);return a&&Xu(t,n,a)?1:o&&Zd(n,o)?-1:1}function Wu(i,e){let t=i.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:Zy(i,t,e.clientX,e.clientY)}}var Jy=Q.ie&&Q.ie_version<=11,Iu=null,Nu=0,ju=0;function Jd(i){if(!Jy)return i.detail;let e=Iu,t=ju;return Iu=i,ju=Date.now(),Nu=!e||t>Date.now()-400&&Math.abs(e.clientX-i.clientX)<2&&Math.abs(e.clientY-i.clientY)<2?(Nu+1)%3:1}function Ky(i,e){let t=Wu(i,e),n=Jd(e),r=i.state.selection;return{update(s){s.docChanged&&(t.pos=s.changes.mapPos(t.pos),r=r.map(s.changes))},get(s,o,a){let l=Wu(i,s),h,c=Bu(i,l.pos,l.bias,n);if(t.pos!=l.pos&&!o){let f=Bu(i,t.pos,t.bias,n),u=Math.min(f.from,c.from),d=Math.max(f.to,c.to);c=u1&&(h=eb(r,l.pos))?h:a?r.addRange(c):S.create([c])}}}function eb(i,e){for(let t=0;t=e)return S.create(i.ranges.slice(0,t).concat(i.ranges.slice(t+1)),i.mainIndex==t?0:i.mainIndex-(i.mainIndex>t?1:0))}return null}ht.dragstart=(i,e)=>{let{selection:{main:t}}=i.state;if(e.target.draggable){let r=i.docView.nearest(e.target);if(r&&r.isWidget){let s=r.posAtStart,o=s+r.length;(s>=t.to||o<=t.from)&&(t=S.range(s,o))}}let{inputState:n}=i;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",i.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove"),!1};ht.dragend=i=>(i.inputState.draggedContent=null,!1);function zu(i,e,t,n){if(!t)return;let r=i.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=i.inputState,o=n&&s&&Fy(i,e)?{from:s.from,to:s.to}:null,a={from:r,insert:t},l=i.state.changes(o?[o,a]:a);i.focus(),i.dispatch({changes:l,selection:{anchor:l.mapPos(r,-1),head:l.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"}),i.inputState.draggedContent=null}ht.drop=(i,e)=>{if(!e.dataTransfer)return!1;if(i.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let n=Array(t.length),r=0,s=()=>{++r==t.length&&zu(i,e,n.filter(o=>o!=null).join(i.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(n[o]=a.result),s()},a.readAsText(t[o])}return!0}else{let n=e.dataTransfer.getData("Text");if(n)return zu(i,e,n,!0),!0}return!1};ht.paste=(i,e)=>{if(i.state.readOnly)return!0;i.observer.flush();let t=Gd?null:e.clipboardData;return t?(Yd(i,t.getData("text/plain")||t.getData("text/uri-list")),!0):(Yy(i),!1)};function tb(i,e){let t=i.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=e,n.focus(),n.selectionEnd=e.length,n.selectionStart=0,setTimeout(()=>{n.remove(),i.focus()},50)}function ib(i){let e=[],t=[],n=!1;for(let r of i.selection.ranges)r.empty||(e.push(i.sliceDoc(r.from,r.to)),t.push(r));if(!e.length){let r=-1;for(let{from:s}of i.selection.ranges){let o=i.doc.lineAt(s);o.number>r&&(e.push(o.text),t.push({from:o.from,to:Math.min(i.doc.length,o.to+1)})),r=o.number}n=!0}return{text:e.join(i.lineBreak),ranges:t,linewise:n}}var zl=null;ht.copy=ht.cut=(i,e)=>{let{text:t,ranges:n,linewise:r}=ib(i.state);if(!t&&!r)return!1;zl=r?t:null,e.type=="cut"&&!i.state.readOnly&&i.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let s=Gd?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",t),!0):(tb(i,t),!1)};var Kd=Le.define();function ep(i,e){let t=[];for(let n of i.facet($d)){let r=n(i,e);r&&t.push(r)}return t?i.update({effects:t,annotations:Kd.of(!0)}):null}function tp(i){setTimeout(()=>{let e=i.hasFocus;if(e!=i.inputState.notifiedFocused){let t=ep(i.state,e);t?i.dispatch(t):i.update([])}},10)}it.focus=i=>{i.inputState.lastFocusTime=Date.now(),!i.scrollDOM.scrollTop&&(i.inputState.lastScrollTop||i.inputState.lastScrollLeft)&&(i.scrollDOM.scrollTop=i.inputState.lastScrollTop,i.scrollDOM.scrollLeft=i.inputState.lastScrollLeft),tp(i)};it.blur=i=>{i.observer.clearSelectionRange(),tp(i)};it.compositionstart=it.compositionupdate=i=>{i.observer.editContext||(i.inputState.compositionFirstChange==null&&(i.inputState.compositionFirstChange=!0),i.inputState.composing<0&&(i.inputState.composing=0))};it.compositionend=i=>{i.observer.editContext||(i.inputState.composing=-1,i.inputState.compositionEndedAt=Date.now(),i.inputState.compositionPendingKey=!0,i.inputState.compositionPendingChange=i.observer.pendingRecords().length>0,i.inputState.compositionFirstChange=null,Q.chrome&&Q.android?i.observer.flushSoon():i.inputState.compositionPendingChange?Promise.resolve().then(()=>i.observer.flush()):setTimeout(()=>{i.inputState.composing<0&&i.docView.hasComposition&&i.update([])},50))};it.contextmenu=i=>{i.inputState.lastContextMenu=Date.now()};ht.beforeinput=(i,e)=>{var t;let n;if(Q.chrome&&Q.android&&(n=Fd.find(r=>r.inputType==e.inputType))&&(i.observer.delayAndroidKey(n.key,n.keyCode),n.key=="Backspace"||n.key=="Delete")){let r=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var s;(((s=window.visualViewport)===null||s===void 0?void 0:s.height)||0)>r+10&&i.hasFocus&&(i.contentDOM.blur(),i.focus())},100)}return Q.ios&&e.inputType=="deleteContentForward"&&i.observer.flushSoon(),Q.safari&&e.inputType=="insertText"&&i.inputState.composing>=0&&setTimeout(()=>it.compositionend(i,e),20),!1};var Uu=new Set;function nb(i){Uu.has(i)||(Uu.add(i),i.addEventListener("copy",()=>{}),i.addEventListener("cut",()=>{}))}var Fu=["pre-wrap","normal","pre-line","break-spaces"],Ul=class{constructor(e){this.lineWrapping=e,this.doc=W.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Fu.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n-1,l=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=s,l){this.heightSamples={};for(let h=0;h0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>Us&&(e.heightChanged=!0),this.height=t)}replace(e,t,n){return i.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let s=this,o=n.doc;for(let a=r.length-1;a>=0;a--){let{fromA:l,toA:h,fromB:c,toB:f}=r[a],u=s.lineAt(l,K.ByPosNoHeight,n.setDoc(t),0,0),d=u.to>=h?u:s.lineAt(h,K.ByPosNoHeight,n,0,0);for(f+=d.to-h,h=d.to;a>0&&u.from<=r[a-1].toA;)l=r[a-1].fromA,c=r[a-1].fromB,a--,ls*2){let a=e[t-1];a.break?e.splice(--t,1,a.left,null,a.right):e.splice(--t,1,a.left,a.right),n+=1+a.break,r-=a.size}else if(s>r*2){let a=e[n];a.break?e.splice(n,1,a.left,null,a.right):e.splice(n,1,a.left,a.right),n+=2+a.break,s-=a.size}else break;else if(r=s&&o(this.blockAt(0,n,r,s))}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setHeight(e,r.heights[r.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}},tt=class i extends io{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,n,r){return new yt(r,this.length,n,this.height,this.breaks)}replace(e,t,n){let r=n[0];return n.length==1&&(r instanceof i||r instanceof Yt&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof Yt?r=new i(r.length,this.height):r.height=this.height,this.outdated||(r.outdated=!1),r):je.of(n)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setHeight(e,r.heights[r.index++]):(n||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}},Yt=class i extends je{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,s=r-n+1,o,a=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*s);o=l/s,this.length>s+1&&(a=(this.height-l)/(this.length-s-1))}else o=this.height/s;return{firstLine:n,lastLine:r,perLine:o,perChar:a}}blockAt(e,t,n,r){let{firstLine:s,lastLine:o,perLine:a,perChar:l}=this.heightMetrics(t,r);if(t.lineWrapping){let h=r+(e0){let s=n[n.length-1];s instanceof i?n[n.length-1]=new i(s.length+r):n.push(null,new i(r-1))}if(e>0){let s=n[0];s instanceof i?n[0]=new i(e+s.length):n.unshift(new i(e-1),null)}return je.of(n)}decomposeLeft(e,t){t.push(new i(e-1),null)}decomposeRight(e,t){t.push(null,new i(this.length-e-1))}updateHeight(e,t=0,n=!1,r){let s=t+this.length;if(r&&r.from<=t+this.length&&r.more){let o=[],a=Math.max(t,r.from),l=-1;for(r.from>t&&o.push(new i(r.from-t-1).updateHeight(e,t));a<=s&&r.more;){let c=e.doc.lineAt(a).length;o.length&&o.push(null);let f=r.heights[r.index++];l==-1?l=f:Math.abs(f-l)>=Us&&(l=-2);let u=new tt(c,f);u.outdated=!1,o.push(u),a+=c+1}a<=s&&o.push(null,new i(s-a).updateHeight(e,a));let h=je.of(o);return(l<0||Math.abs(h.height-this.height)>=Us||Math.abs(l-this.heightMetrics(e,t).perLine)>=Us)&&(e.heightChanged=!0),h}else(n||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},Hl=class extends je{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,t,n,r){let s=n+this.left.height;return ea))return h;let c=t==K.ByPosNoHeight?K.ByPosNoHeight:K.ByPos;return l?h.join(this.right.lineAt(a,c,n,o,a)):this.left.lineAt(a,c,n,r,s).join(h)}forEachLine(e,t,n,r,s,o){let a=r+this.left.height,l=s+this.left.length+this.break;if(this.break)e=l&&this.right.forEachLine(e,t,n,a,l,o);else{let h=this.lineAt(l,K.ByPos,n,r,s);e=e&&h.from<=t&&o(h),t>h.to&&this.right.forEachLine(h.to+1,t,n,a,l,o)}}replace(e,t,n){let r=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let a of n)s.push(a);if(e>0&&Hu(s,o-1),t=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e2*t.size||t.size>2*e.size?je.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:s,right:o}=this,a=t+s.length+this.break,l=null;return r&&r.from<=t+s.length&&r.more?l=s=s.updateHeight(e,t,n,r):s.updateHeight(e,t,n),r&&r.from<=a+o.length&&r.more?l=o=o.updateHeight(e,a,n,r):o.updateHeight(e,a,n),l?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}};function Hu(i,e){let t,n;i[e]==null&&(t=i[e-1])instanceof Yt&&(n=i[e+1])instanceof Yt&&i.splice(e-1,3,new Yt(t.length+1+n.length))}var rb=5,Gl=class i{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let n=Math.min(t,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof tt?r.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new tt(n-this.pos,-1)),this.writtenTo=n,t>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e=rb)&&this.addLineDeco(r,s,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new tt(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let n=new Yt(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof tt)return e;let t=new tt(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof tt)&&!this.isCovered?this.nodes.push(new tt(0,-1)):(this.writtenToc.clientHeight||c.scrollWidth>c.clientWidth)&&f.overflow!="visible"){let u=c.getBoundingClientRect();s=Math.max(s,u.left),o=Math.min(o,u.right),a=Math.max(a,u.top),l=h==i.parentNode?u.bottom:Math.min(l,u.bottom)}h=f.position=="absolute"||f.position=="fixed"?c.offsetParent:c.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:s-t.left,right:Math.max(s,o)-t.left,top:a-(t.top+e),bottom:Math.max(a,l)-(t.top+e)}}function ab(i,e){let t=i.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}var rr=class{constructor(e,t,n){this.from=e,this.to=t,this.size=n}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;ntypeof n!="function"&&n.class=="cm-lineWrapping");this.heightOracle=new Ul(t),this.stateDeco=e.facet(dr).filter(n=>typeof n!="function"),this.heightMap=je.empty().applyChanges(this.stateDeco,W.empty,this.heightOracle.setDoc(e.doc),[new wt(0,0,0,e.doc.length)]);for(let n=0;n<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());n++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=M.set(this.lineGaps.map(n=>n.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some(({from:s,to:o})=>r>=s&&r<=o)){let{from:s,to:o}=this.lineBlockAt(r);e.push(new rn(s,o))}}return this.viewports=e.sort((n,r)=>n.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Gu:new Jl(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Zn(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet(dr).filter(c=>typeof c!="function");let r=e.changedRanges,s=wt.extendWithRanges(r,sb(n,this.stateDeco,e?e.changes:Ae.empty(this.state.doc.length))),o=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),this.heightMap.height!=o&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let l=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.headl.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,t));let h=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,e.flags|=this.updateForViewport(),(h||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(Ld)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,s=n.whiteSpace;this.defaultTextDirection=n.direction=="rtl"?H.RTL:H.LTR;let o=this.heightOracle.mustRefreshForWrapping(s),a=t.getBoundingClientRect(),l=o||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let h=0,c=0;if(a.width&&a.height){let{scaleX:x,scaleY:w}=fd(t,a);(x>.005&&Math.abs(this.scaleX-x)>.005||w>.005&&Math.abs(this.scaleY-w)>.005)&&(this.scaleX=x,this.scaleY=w,h|=8,o=l=!0)}let f=(parseInt(n.paddingTop)||0)*this.scaleY,u=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=u)&&(this.paddingTop=f,this.paddingBottom=u,h|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=8);let d=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=d&&(this.scrollAnchorHeight=-1,this.scrollTop=d),this.scrolledToBottom=pd(e.scrollDOM);let m=(this.printing?ab:ob)(t,this.paddingTop),p=m.top-this.pixelViewport.top,g=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let O=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(O!=this.inView&&(this.inView=O,O&&(l=!0)),!this.inView&&!this.scrollTarget)return 0;let y=a.width;if((this.contentDOMWidth!=y||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,h|=8),l){let x=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(x)&&(o=!0),o||r.lineWrapping&&Math.abs(y-this.contentDOMWidth)>r.charWidth){let{lineHeight:w,charWidth:P,textHeight:C}=e.docView.measureTextSize();o=w>0&&r.refresh(s,w,P,C,y/P,x),o&&(e.docView.minWidth=0,h|=8)}p>0&&g>0?c=Math.max(p,g):p<0&&g<0&&(c=Math.min(p,g)),r.heightChanged=!1;for(let w of this.viewports){let P=w.from==this.viewport.from?x:e.docView.measureVisibleLineHeights(w);this.heightMap=(o?je.empty().applyChanges(this.stateDeco,W.empty,this.heightOracle,[new wt(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new Fl(w.from,P))}r.heightChanged&&(h|=2)}let v=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return v&&(h&2&&(h|=this.updateScaler()),this.viewport=this.getViewport(c,this.scrollTarget),h|=this.updateForViewport()),(h&2||v)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:a}=this,l=new rn(r.lineAt(o-n*1e3,K.ByHeight,s,0,0).from,r.lineAt(a+(1-n)*1e3,K.ByHeight,s,0,0).to);if(t){let{head:h}=t.range;if(hl.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=r.lineAt(h,K.ByPos,s,0,0),u;t.y=="center"?u=(f.top+f.bottom)/2-c/2:t.y=="start"||t.y=="nearest"&&h=a+Math.max(10,Math.min(n,250)))&&r>o-2*1e3&&s>1,o=r<<1;if(this.defaultTextDirection!=H.LTR&&!n)return[];let a=[],l=(c,f,u,d)=>{if(f-cc&&OO.from>=u.from&&O.to<=u.to&&Math.abs(O.from-c)O.fromy));if(!g){if(fO.from<=f&&O.to>=f)){let O=t.moveToLineBoundary(S.cursor(f),!1,!0).head;O>c&&(f=O)}g=new rr(c,f,this.gapSize(u,c,f,d))}a.push(g)},h=c=>{if(c.lengthc.from&&l(c.from,d,c,f),mt.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];j.spans(e,this.viewport.from,this.viewport.to,{span(r,s){t.push({from:r,to:s})},point(){}},20);let n=t.length!=this.visibleRanges.length||this.visibleRanges.some((r,s)=>r.from!=t[s].from||r.to!=t[s].to);return this.visibleRanges=t,n?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Zn(this.heightMap.lineAt(e,K.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||Zn(this.heightMap.lineAt(this.scaler.fromDOM(e),K.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return Zn(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}},rn=class{constructor(e,t){this.from=e,this.to=t}};function lb(i,e,t){let n=[],r=i,s=0;return j.spans(t,i,e,{span(){},point(o,a){o>r&&(n.push({from:r,to:o}),s+=o-r),r=a}},20),r=1)return e[e.length-1].to;let n=Math.floor(i*t);for(let r=0;;r++){let{from:s,to:o}=e[r],a=o-s;if(n<=a)return s+n;n-=a}}function Xs(i,e){let t=0;for(let{from:n,to:r}of i.ranges){if(e<=r){t+=e-n;break}t+=r-n}return t/i.total}function hb(i,e){for(let t of i)if(e(t))return t}var Gu={toDOM(i){return i},fromDOM(i){return i},scale:1,eq(i){return i==this}},Jl=class i{constructor(e,t,n){let r=0,s=0,o=0;this.viewports=n.map(({from:a,to:l})=>{let h=t.lineAt(a,K.ByPos,e,0,0).top,c=t.lineAt(l,K.ByPos,e,0,0).bottom;return r+=c-h,{from:a,to:l,top:h,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let a of this.viewports)a.domTop=o+(a.top-s)*this.scale,o=a.domBottom=a.domTop+(a.bottom-a.top),s=a.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let s=tt.from==e.viewports[n].from&&t.to==e.viewports[n].to):!1}};function Zn(i,e){if(e.scale==1)return i;let t=e.toDOM(i.top),n=e.toDOM(i.bottom);return new yt(i.from,i.length,t,n-t,Array.isArray(i._content)?i._content.map(r=>Zn(r,e)):i._content)}var Ws=A.define({combine:i=>i.join(" ")}),Kl=A.define({combine:i=>i.indexOf(!0)>-1}),eh=et.newName(),ip=et.newName(),np=et.newName(),rp={"&light":"."+ip,"&dark":"."+np};function th(i,e,t){return new et(e,{finish(n){return/&/.test(n)?n.replace(/&\w*/,r=>{if(r=="&")return i;if(!t||!t[r])throw new RangeError(`Unsupported selector: ${r}`);return t[r]}):i+" "+n}})}var cb=th("."+eh,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},rp),Jn="\uFFFF",ih=class{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(N.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Jn}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let s=this.text.length;this.readNode(r);let o=r.nextSibling;if(o==t)break;let a=J.get(r),l=J.get(o);(a&&l?a.breakAfter:(a?a.breakAfter:Ys(r))||Ys(o)&&(r.nodeName!="BR"||r.cmIgnore)&&this.text.length>s)&&this.lineBreak(),r=o}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,a;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(a=r.exec(t))&&(s=a.index,o=a[0].length),this.append(t.slice(n,s<0?t.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=o-1);n=s+o}}readNode(e){if(e.cmIgnore)return;let t=J.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let r=n.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(fb(e,n.node,n.offset)?t:0))}};function fb(i,e,t){for(;;){if(!e||t-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,n,0))){let a=s||o?[]:pb(e),l=new ih(a,e.state);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=mb(a,this.bounds.from)}else{let a=e.observer.selectionRange,l=s&&s.node==a.focusNode&&s.offset==a.focusOffset||!El(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),h=o&&o.node==a.anchorNode&&o.offset==a.anchorOffset||!El(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),c=e.viewport;if((Q.ios||Q.chrome)&&e.state.selection.main.empty&&l!=h&&(c.from>0||c.toDate.now()-100?i.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:a}=e.bounds,l=r.from,h=null;(s===8||Q.android&&e.text.length=r.from&&t.to<=r.to&&(t.from!=r.from||t.to!=r.to)&&r.to-r.from-(t.to-t.from)<=4?t={from:r.from,to:r.to,insert:i.state.doc.slice(r.from,t.from).append(t.insert).append(i.state.doc.slice(t.to,r.to))}:(Q.mac||Q.android)&&t&&t.from==t.to&&t.from==r.head-1&&/^\. ?$/.test(t.insert.toString())&&i.contentDOM.getAttribute("autocorrect")=="off"?(n&&t.insert.length==2&&(n=S.single(n.main.anchor-1,n.main.head-1)),t={from:r.from,to:r.to,insert:W.of([" "])}):Q.chrome&&t&&t.from==t.to&&t.from==r.head&&t.insert.toString()==` + `&&i.lineWrapping&&(n&&(n=S.single(n.main.anchor-1,n.main.head-1)),t={from:r.from,to:r.to,insert:W.of([" "])}),t)return op(i,t,n,s);if(n&&!n.main.eq(r)){let o=!1,a="select";return i.inputState.lastSelectionTime>Date.now()-50&&(i.inputState.lastSelectionOrigin=="select"&&(o=!0),a=i.inputState.lastSelectionOrigin),i.dispatch({selection:n,scrollIntoView:o,userEvent:a}),!0}else return!1}function op(i,e,t,n=-1){if(Q.ios&&i.inputState.flushIOSKey(e))return!0;let r=i.state.selection.main;if(Q.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&i.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&an(i.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||n==8&&e.insert.lengthr.head)&&an(i.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&an(i.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();i.inputState.composing>=0&&i.inputState.composing++;let o,a=()=>o||(o=ub(i,e,t));return i.state.facet(Dd).some(l=>l(i,e.from,e.to,s,a))||i.dispatch(a()),!0}function ub(i,e,t){let n,r=i.state,s=r.selection.main;if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&i.inputState.composing<0){let a=s.frome.to?r.sliceDoc(e.to,s.to):"";n=r.replaceSelection(i.state.toText(a+e.insert.sliceString(0,void 0,i.state.lineBreak)+l))}else{let a=r.changes(e),l=t&&t.main.to<=a.newLength?t.main:void 0;if(r.selection.ranges.length>1&&i.inputState.composing>=0&&e.to<=s.to&&e.to>=s.to-10){let h=i.state.sliceDoc(e.from,e.to),c,f=t&&zd(i,t.main.head);if(f){let m=e.insert.length-(e.to-e.from);c={from:f.from,to:f.to-m}}else c=i.state.doc.lineAt(s.head);let u=s.to-e.to,d=s.to-s.from;n=r.changeByRange(m=>{if(m.from==s.from&&m.to==s.to)return{changes:a,range:l||m.map(a)};let p=m.to-u,g=p-h.length;if(m.to-m.from!=d||i.state.sliceDoc(g,p)!=h||m.to>=c.from&&m.from<=c.to)return{range:m};let O=r.changes({from:g,to:p,insert:e.insert}),y=m.to-s.to;return{changes:O,range:l?S.range(Math.max(0,l.anchor+y),Math.max(0,l.head+y)):m.map(O)}})}else n={changes:a,selection:l&&r.selection.replaceRange(l)}}let o="input.type";return(i.composing||i.inputState.compositionPendingChange&&i.inputState.compositionEndedAt>Date.now()-50)&&(i.inputState.compositionPendingChange=!1,o+=".compose",i.inputState.compositionFirstChange&&(o+=".start",i.inputState.compositionFirstChange=!1)),r.update(n,{userEvent:o,scrollIntoView:!0})}function db(i,e,t,n){let r=Math.min(i.length,e.length),s=0;for(;s0&&a>0&&i.charCodeAt(o-1)==e.charCodeAt(a-1);)o--,a--;if(n=="end"){let l=Math.max(0,s-Math.min(o,a));t-=o+l-s}if(o=o?s-t:0;s-=l,a=s+(a-o),o=s}else if(a=a?s-t:0;s-=l,o=s+(o-a),a=s}return{from:s,toA:o,toB:a}}function pb(i){let e=[];if(i.root.activeElement!=i.contentDOM)return e;let{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:s}=i.observer.selectionRange;return t&&(e.push(new ro(t,n)),(r!=t||s!=n)&&e.push(new ro(r,s))),e}function mb(i,e){if(i.length==0)return null;let t=i[0].pos,n=i.length==2?i[1].pos:t;return t>-1&&n>-1?S.single(t+e,n+e):null}var gb={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Tl=Q.ie&&Q.ie_version<=11,rh=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Al,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let n of t)this.queue.push(n);(Q.ie&&Q.ie_version<=11||Q.ios&&e.composing)&&t.some(n=>n.type=="childList"&&n.removedNodes.length||n.type=="characterData"&&n.oldValue.length>n.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&e.constructor.EDIT_CONTEXT!==!1&&!(Q.chrome&&Q.chrome_version<126)&&(this.editContext=new sh(e),e.state.facet(Ht)&&(e.contentDOM.editContext=this.editContext.editContext)),Tl&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){e.type=="change"&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(Ht)?n.root.activeElement!=this.dom:!js(n.dom,r))return;let s=r.anchorNode&&n.docView.nearest(r.anchorNode);if(s&&s.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(Q.ie&&Q.ie_version<=11||Q.android&&Q.chrome)&&!n.state.selection.main.empty&&r.focusNode&&er(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=ar(e.root);if(!t)return!1;let n=Q.safari&&e.root.nodeType==11&&ay(this.dom.ownerDocument)==this.dom&&Ob(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=js(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&an(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(r=!0),t==-1?{from:t,to:n}=o:(t=Math.min(o.from,t),n=Math.max(o.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&js(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new nh(this.view,e,t,n);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,r=sp(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let n=Yu(t,e.previousSibling||e.target.previousSibling,-1),r=Yu(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener("change",this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener("change",this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Ht)!=e.state.facet(Ht)&&(e.view.contentDOM.editContext=e.state.facet(Ht)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(n=this.resizeScroll)===null||n===void 0||n.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}};function Yu(i,e,t){for(;e;){let n=J.get(e);if(n&&n.parent==i)return n;let r=e.parentNode;e=r!=i.dom?r:t>0?e.nextSibling:e.previousSibling}return null}function Zu(i,e){let t=e.startContainer,n=e.startOffset,r=e.endContainer,s=e.endOffset,o=i.docView.domAtPos(i.state.selection.main.anchor);return er(o.node,o.offset,r,s)&&([t,n,r,s]=[r,s,t,n]),{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:s}}function Ob(i,e){if(e.getComposedRanges){let r=e.getComposedRanges(i.root)[0];if(r)return Zu(i,r)}let t=null;function n(r){r.preventDefault(),r.stopImmediatePropagation(),t=r.getTargetRanges()[0]}return i.contentDOM.addEventListener("beforeinput",n,!0),i.dom.ownerDocument.execCommand("indent"),i.contentDOM.removeEventListener("beforeinput",n,!0),t?Zu(i,t):null}var sh=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});t.addEventListener("textupdate",n=>{let{anchor:r}=e.state.selection.main,s={from:this.toEditorPos(n.updateRangeStart),to:this.toEditorPos(n.updateRangeEnd),insert:W.of(n.text.split(` +`))};s.from==this.from&&rthis.to&&(s.to=r),!(s.from==s.to&&!s.insert.length)&&(this.pendingContextChange=s,op(e,s,S.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd))),this.pendingContextChange&&this.revertPending(e.state))}),t.addEventListener("characterboundsupdate",n=>{let r=[],s=null;for(let o=this.toEditorPos(n.rangeStart),a=this.toEditorPos(n.rangeEnd);o{let r=[];for(let s of n.getTextFormats()){let o=s.underlineStyle,a=s.underlineThickness;if(o!="None"&&a!="None"){let l=`text-decoration: underline ${o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${a=="Thin"?1:2}px`;r.push(M.mark({attributes:{style:l}}).range(this.toEditorPos(s.rangeStart),this.toEditorPos(s.rangeEnd)))}}e.dispatch({effects:Bd.of(M.set(r))})}),t.addEventListener("compositionstart",()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)}),t.addEventListener("compositionend",()=>{e.inputState.composing=-1,e.inputState.compositionFirstChange=null}),this.measureReq={read:n=>{this.editContext.updateControlBounds(n.contentDOM.getBoundingClientRect());let r=ar(n.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,o,a,l,h)=>{if(n)return;let c=h.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(h)){r=this.pendingContextChange=null,t+=c;return}else r=null,this.revertPending(e.state);if(s+=t,o+=t,o<=this.from)this.from+=c,this.to+=c;else if(sthis.to||this.to-this.from+h.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),h.toString()),this.to+=c}t+=c}),r&&!n&&this.revertPending(e.state),!n}update(e){!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.resetRange(e.state),this.editContext.updateText(0,this.editContext.text.length,e.state.doc.sliceString(this.from,this.to)),this.setSelection(e.state)):(e.docChanged||e.selectionSet)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.to+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to1e4*3)}toEditorPos(e){return e+this.from}toContextPos(e){return e-this.from}},E=class i{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(n=>n.forEach(r=>t(r,this)))||(n=>this.update(n)),this.dispatch=this.dispatch.bind(this),this._root=e.root||fy(e.parent)||document,this.viewState=new no(e.state||N.create(e)),e.scrollTo&&e.scrollTo.is(Vs)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Gn).map(n=>new nr(n));for(let n of this.plugins)n.update(this);this.observer=new rh(this),this.inputState=new Nl(this),this.inputState.ensureHandlers(this.plugins),this.docView=new eo(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure()}dispatch(...e){let t=e.length==1&&e[0]instanceof fe?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,n=!1,r,s=this.state;for(let u of e){if(u.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=u.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,a=0,l=null;e.some(u=>u.annotation(Kd))?(this.inputState.notifiedFocused=o,a=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,l=ep(s,o),l||(a=1));let h=this.observer.delayedAndroidKey,c=null;if(h?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(c=null)):this.observer.clear(),s.facet(N.phrases)!=this.state.facet(N.phrases))return this.setState(s);r=Ks.create(this,s,e),r.flags|=a;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let u of e){if(f&&(f=f.map(u.changes)),u.scrollIntoView){let{main:d}=u.state.selection;f=new ir(d.empty?d:S.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of u.effects)d.is(Vs)&&(f=d.value.clip(this.state))}this.viewState.update(r,f),this.bidiCache=so.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(Yn)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(Ws)!=r.state.facet(Ws)&&(this.viewState.mustMeasureContent=!0),(t||n||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let u of this.state.facet(Xl))try{u(r)}catch(d){we(this.state,d,"update listener")}(l||c)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),c&&!sp(this,c)&&h.force&&an(this.contentDOM,h.key,h.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let n of this.plugins)n.destroy(this);this.viewState=new no(e),this.plugins=e.facet(Gn).map(n=>new nr(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView.destroy(),this.docView=new eo(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Gn),n=e.state.facet(Gn);if(t!=n){let r=[];for(let s of n){let o=t.indexOf(s);if(o<0)r.push(new nr(s));else{let a=this.plugins[o];a.mustUpdate=e,r.push(a)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.scrollDOM,r=n.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(o<0)if(pd(n))s=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(r);s=d.from,o=d.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let h=[];l&4||([this.measureRequests,h]=[h,this.measureRequests]);let c=h.map(d=>{try{return d.read(this)}catch(m){return we(this.state,m),Ju}}),f=Ks.create(this,this.state,[]),u=!1;f.flags|=l,t?t.flags|=l:t=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),u=this.docView.update(f),u&&this.docViewUpdate());for(let d=0;d1||m<-1){r=r+m,n.scrollTop=r/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let a of this.state.facet(Xl))a(t)}get themeClasses(){return eh+" "+(this.state.facet(Kl)?np:ip)+" "+this.state.facet(Ws)}updateAttrs(){let e=Ku(this,Xd,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(Ht)?"true":"false",class:"cm-content",style:`${Q.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Ku(this,vh,t);let n=this.observer.ignore(()=>{let r=$l(this.contentDOM,this.contentAttrs,t),s=$l(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let r of n.effects)if(r.is(i.announce)){t&&(this.announceDOM.textContent=""),t=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(Yn);let e=this.state.facet(i.cspNonce);et.mount(this.root,this.styleModules.concat(cb).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;tn.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return Sl(this,e,Lu(this,e,t,n))}moveByGroup(e,t){return Sl(this,e,Lu(this,e,t,n=>Wy(this,e.head,n)))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),s=n[t?n.length-1:0];return S.cursor(s.side(t,r)+e.from,s.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return Xy(this,e,t,n)}moveVertically(e,t,n){return Sl(this,e,Iy(this,e,t,n))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),Ud(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let r=this.state.doc.lineAt(e),s=this.bidiSpans(r),o=s[bt.find(s,e-r.from,-1,t)];return yh(n,o.dir==H.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(Vd)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>yb)return Rd(e.length);let t=this.textDirectionAt(e.from),n;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t&&(s.fresh||Cd(s.isolates,n=Mu(this,e))))return s.order;n||(n=Mu(this,e));let r=Sy(e.text,t,n);return this.bidiCache.push(new so(e.from,e.to,t,n,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Q.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{ud(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Vs.of(new ir(typeof e=="number"?S.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return Vs.of(new ir(S.cursor(n.from),"start","start",n.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return re.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return re.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=et.newName(),r=[Ws.of(n),Yn.of(th(`.${n}`,e))];return t&&t.dark&&r.push(Kl.of(!0)),r}static baseTheme(e){return Qe.lowest(Yn.of(th("."+eh,e,rp)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),r=n&&J.get(n)||J.get(e);return((t=r?.rootView)===null||t===void 0?void 0:t.view)||null}};E.styleModule=Yn;E.inputHandler=Dd;E.scrollHandler=qd;E.focusChangeEffect=$d;E.perLineTextDirection=Vd;E.exceptionSink=_d;E.updateListener=Xl;E.editable=Ht;E.mouseSelectionStyle=Md;E.dragMovesSelection=Qd;E.clickAddsSelectionRange=Ad;E.decorations=dr;E.outerDecorations=Wd;E.atomicRanges=xh;E.bidiIsolatedRanges=Id;E.scrollMargins=Nd;E.darkTheme=Kl;E.cspNonce=A.define({combine:i=>i.length?i[0]:""});E.contentAttributes=vh;E.editorAttributes=Xd;E.lineWrapping=E.contentAttributes.of({class:"cm-lineWrapping"});E.announce=_.define();var yb=4096,Ju={},so=class i{constructor(e,t,n,r,s,o){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=s,this.order=o}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let n=[],r=e.length?e[e.length-1].dir:H.LTR;for(let s=Math.max(0,e.length-10);s=0;r--){let s=n[r],o=typeof s=="function"?s(i):s;o&&Dl(o,t)}return t}var bb=Q.mac?"mac":Q.windows?"win":Q.linux?"linux":"key";function wb(i,e){let t=i.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,s,o,a;for(let l=0;ln.concat(r),[]))),t}function lp(i,e,t){return hp(ap(i.state),e,i,t)}var Gt=null,xb=4e3;function kb(i,e=bb){let t=Object.create(null),n=Object.create(null),r=(o,a)=>{let l=n[o];if(l==null)n[o]=a;else if(l!=a)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,a,l,h,c)=>{var f,u;let d=t[o]||(t[o]=Object.create(null)),m=a.split(/ (?!$)/).map(O=>wb(O,e));for(let O=1;O{let x=Gt={view:v,prefix:y,scope:o};return setTimeout(()=>{Gt==x&&(Gt=null)},xb),!0}]})}let p=m.join(" ");r(p,!1);let g=d[p]||(d[p]={preventDefault:!1,stopPropagation:!1,run:((u=(f=d._any)===null||f===void 0?void 0:f.run)===null||u===void 0?void 0:u.slice())||[]});l&&g.run.push(l),h&&(g.preventDefault=!0),c&&(g.stopPropagation=!0)};for(let o of i){let a=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let h of a){let c=t[h]||(t[h]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let u in c)c[u].run.push(d=>f(d,oh))}let l=o[e]||o.key;if(l)for(let h of a)s(h,l,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(h,"Shift-"+l,o.shift,o.preventDefault,o.stopPropagation)}return t}var oh=null;function hp(i,e,t,n){oh=e;let r=Su(e),s=ce(r,0),o=Ee(s)==r.length&&r!=" ",a="",l=!1,h=!1,c=!1;Gt&&Gt.view==t&&Gt.scope==n&&(a=Gt.prefix+" ",Hd.indexOf(e.keyCode)<0&&(h=!0,Gt=null));let f=new Set,u=g=>{if(g){for(let O of g.run)if(!f.has(O)&&(f.add(O),O(t)))return g.stopPropagation&&(c=!0),!0;g.preventDefault&&(g.stopPropagation&&(c=!0),h=!0)}return!1},d=i[n],m,p;return d&&(u(d[a+Is(r,e,!o)])?l=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Q.windows&&e.ctrlKey&&e.altKey)&&(m=Vt[e.keyCode])&&m!=r?(u(d[a+Is(m,e,!0)])||e.shiftKey&&(p=tn[e.keyCode])!=r&&p!=m&&u(d[a+Is(p,e,!1)]))&&(l=!0):o&&e.shiftKey&&u(d[a+Is(r,e,!0)])&&(l=!0),!l&&u(d._any)&&(l=!0)),h&&(l=!0),l&&c&&e.stopPropagation(),oh=null,l}var pr=class i{constructor(e,t,n,r,s){this.className=e,this.left=t,this.top=n,this.width=r,this.height=s}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,n){if(n.empty){let r=e.coordsAtPos(n.head,n.assoc||1);if(!r)return[];let s=cp(e);return[new i(t,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return Sb(e,t,n)}};function cp(i){let e=i.scrollDOM.getBoundingClientRect();return{left:(i.textDirection==H.LTR?e.left:e.right-i.scrollDOM.clientWidth*i.scaleX)-i.scrollDOM.scrollLeft*i.scaleX,top:e.top-i.scrollDOM.scrollTop*i.scaleY}}function td(i,e,t,n){let r=i.coordsAtPos(e,t*2);if(!r)return n;let s=i.dom.getBoundingClientRect(),o=(r.top+r.bottom)/2,a=i.posAtCoords({x:s.left+1,y:o}),l=i.posAtCoords({x:s.right-1,y:o});return a==null||l==null?n:{from:Math.max(n.from,Math.min(a,l)),to:Math.min(n.to,Math.max(a,l))}}function Sb(i,e,t){if(t.to<=i.viewport.from||t.from>=i.viewport.to)return[];let n=Math.max(t.from,i.viewport.from),r=Math.min(t.to,i.viewport.to),s=i.textDirection==H.LTR,o=i.contentDOM,a=o.getBoundingClientRect(),l=cp(i),h=o.querySelector(".cm-line"),c=h&&window.getComputedStyle(h),f=a.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),u=a.right-(c?parseInt(c.paddingRight):0),d=Il(i,n),m=Il(i,r),p=d.type==_e.Text?d:null,g=m.type==_e.Text?m:null;if(p&&(i.lineWrapping||d.widgetLineBreaks)&&(p=td(i,n,1,p)),g&&(i.lineWrapping||m.widgetLineBreaks)&&(g=td(i,r,-1,g)),p&&g&&p.from==g.from&&p.to==g.to)return y(v(t.from,t.to,p));{let w=p?v(t.from,null,p):x(d,!1),P=g?v(null,t.to,g):x(m,!0),C=[];return(p||d).to<(g||m).from-(p&&g?1:0)||d.widgetLineBreaks>1&&w.bottom+i.defaultLineHeight/2q&&I.from=De)break;pe>ie&&X(Math.max(Ye,ie),w==null&&Ye<=q,Math.min(pe,De),P==null&&pe>=G,We.dir)}if(ie=$e.to+1,ie>=De)break}return V.length==0&&X(q,w==null,G,P==null,i.textDirection),{top:D,bottom:B,horizontal:V}}function x(w,P){let C=a.top+(P?w.top:w.bottom);return{top:C,bottom:C,horizontal:[]}}}function Tb(i,e){return i.constructor==e.constructor&&i.eq(e)}var ah=class{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(Fs)!=e.state.facet(Fs)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(Fs);for(;t!Tb(t,this.drawn[n]))){let t=this.dom.firstChild,n=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[n].constructor&&r.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(r.draw(),t);for(;t;){let r=t.nextSibling;t.remove(),t=r}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}},Fs=A.define();function fp(i){return[re.define(e=>new ah(e,i)),Fs.of(i)]}var up=!Q.ios,mr=A.define({combine(i){return Te(i,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function dp(i={}){return[mr.of(i),Pb,Cb,Rb,Ld.of(!0)]}function pp(i){return i.startState.facet(mr)!=i.state.facet(mr)}var Pb=fp({above:!0,markers(i){let{state:e}=i,t=e.facet(mr),n=[];for(let r of e.selection.ranges){let s=r==e.selection.main;if(r.empty?!s||up:t.drawRangeCursor){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=r.empty?r:S.cursor(r.head,r.head>r.anchor?-1:1);for(let l of pr.forRange(i,o,a))n.push(l)}}return n},update(i,e){i.transactions.some(n=>n.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=pp(i);return t&&id(i.state,e),i.docChanged||i.selectionSet||t},mount(i,e){id(e.state,i)},class:"cm-cursorLayer"});function id(i,e){e.style.animationDuration=i.facet(mr).cursorBlinkRate+"ms"}var Cb=fp({above:!1,markers(i){return i.state.selection.ranges.map(e=>e.empty?[]:pr.forRange(i,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(i,e){return i.docChanged||i.selectionSet||i.viewportChanged||pp(i)},class:"cm-selectionLayer"}),lh={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};up&&(lh[".cm-line"].caretColor=lh[".cm-content"].caretColor="transparent !important");var Rb=Qe.highest(E.theme(lh)),mp=_.define({map(i,e){return i==null?null:e.mapPos(i)}}),Kn=te.define({create(){return null},update(i,e){return i!=null&&(i=e.changes.mapPos(i)),e.effects.reduce((t,n)=>n.is(mp)?n.value:t,i)}}),Eb=re.fromClass(class{constructor(i){this.view=i,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(i){var e;let t=i.state.field(Kn);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(i.startState.field(Kn)!=t||i.docChanged||i.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:i}=this,e=i.state.field(Kn),t=e!=null&&i.coordsAtPos(e);if(!t)return null;let n=i.scrollDOM.getBoundingClientRect();return{left:t.left-n.left+i.scrollDOM.scrollLeft*i.scaleX,top:t.top-n.top+i.scrollDOM.scrollTop*i.scaleY,height:t.bottom-t.top}}drawCursor(i){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;i?(this.cursor.style.left=i.left/e+"px",this.cursor.style.top=i.top/t+"px",this.cursor.style.height=i.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(i){this.view.state.field(Kn)!=i&&this.view.dispatch({effects:mp.of(i)})}},{eventObservers:{dragover(i){this.setDropPos(this.view.posAtCoords({x:i.clientX,y:i.clientY}))},dragleave(i){(i.target==this.view.contentDOM||!this.view.contentDOM.contains(i.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function gp(){return[Kn,Eb]}function nd(i,e,t,n,r){e.lastIndex=0;for(let s=i.iterRange(t,n),o=t,a;!s.next().done;o+=s.value.length)if(!s.lineBreak)for(;a=e.exec(s.value);)r(o+a.index,a)}function Ab(i,e){let t=i.visibleRanges;if(t.length==1&&t[0].from==i.viewport.from&&t[0].to==i.viewport.to)return t;let n=[];for(let{from:r,to:s}of t)r=Math.max(i.state.doc.lineAt(r).from,r-e),s=Math.min(i.state.doc.lineAt(s).to,s+e),n.length&&n[n.length-1].to>=r?n[n.length-1].to=s:n.push({from:r,to:s});return n}var hh=class{constructor(e){let{regexp:t,decoration:n,decorate:r,boundary:s,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,r)this.addMatch=(a,l,h,c)=>r(c,h,h+a[0].length,a,l);else if(typeof n=="function")this.addMatch=(a,l,h,c)=>{let f=n(a,l,h);f&&c(h,h+a[0].length,f)};else if(n)this.addMatch=(a,l,h,c)=>c(h,h+a[0].length,n);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=o}createDeco(e){let t=new lt,n=t.add.bind(t);for(let{from:r,to:s}of Ab(e,this.maxLength))nd(e.state.doc,this.regexp,r,s,(o,a)=>this.addMatch(a,e,o,n));return t.finish()}updateDeco(e,t){let n=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((s,o,a,l)=>{l>e.view.viewport.from&&a1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),n,r):t}updateRange(e,t,n,r){for(let s of e.visibleRanges){let o=Math.max(s.from,n),a=Math.min(s.to,r);if(a>o){let l=e.state.doc.lineAt(o),h=l.tol.from;o--)if(this.boundary.test(l.text[o-1-l.from])){c=o;break}for(;au.push(O.range(p,g));if(l==h)for(this.regexp.lastIndex=c-l.from;(d=this.regexp.exec(l.text))&&d.indexthis.addMatch(g,e,p,m));t=t.update({filterFrom:c,filterTo:f,filter:(p,g)=>pf,add:u})}}return t}},ch=/x/.unicode!=null?"gu":"g",Qb=new RegExp(`[\0-\b +-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,ch),Mb={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},Pl=null;function _b(){var i;if(Pl==null&&typeof document<"u"&&document.body){let e=document.body.style;Pl=((i=e.tabSize)!==null&&i!==void 0?i:e.MozTabSize)!=null}return Pl||!1}var Hs=A.define({combine(i){let e=Te(i,{render:null,specialChars:Qb,addSpecialChars:null});return(e.replaceTabs=!_b())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,ch)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,ch)),e}});function Op(i={}){return[Hs.of(i),Db()]}var rd=null;function Db(){return rd||(rd=re.fromClass(class{constructor(i){this.view=i,this.decorations=M.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(i.state.facet(Hs)),this.decorations=this.decorator.createDeco(i)}makeDecorator(i){return new hh({regexp:i.specialChars,decoration:(e,t,n)=>{let{doc:r}=t.state,s=ce(e[0],0);if(s==9){let o=r.lineAt(n),a=t.state.tabSize,l=$t(o.text,a,n-o.from);return M.replace({widget:new uh((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=M.replace({widget:new fh(i,s)}))},boundary:i.replaceTabs?void 0:/[^]/})}update(i){let e=i.state.facet(Hs);i.startState.facet(Hs)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(i.view)):this.decorations=this.decorator.updateDeco(i,this.decorations)}},{decorations:i=>i.decorations}))}var $b="\u2022";function Vb(i){return i>=32?$b:i==10?"\u2424":String.fromCharCode(9216+i)}var fh=class extends Be{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=Vb(this.code),n=e.state.phrase("Control character")+" "+(Mb[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,n,t);if(r)return r;let s=document.createElement("span");return s.textContent=t,s.title=n,s.setAttribute("aria-label",n),s.className="cm-specialChar",s}ignoreEvent(){return!1}},uh=class extends Be{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}};function yp(){return qb}var Lb=M.line({class:"cm-activeLine"}),qb=re.fromClass(class{constructor(i){this.decorations=this.getDeco(i)}update(i){(i.docChanged||i.selectionSet)&&(this.decorations=this.getDeco(i.view))}getDeco(i){let e=-1,t=[];for(let n of i.state.selection.ranges){let r=i.lineBlockAt(n.head);r.from>e&&(t.push(Lb.range(r.from)),e=r.from)}return M.set(t)}},{decorations:i=>i.decorations});var dh=2e3;function Bb(i,e,t){let n=Math.min(e.line,t.line),r=Math.max(e.line,t.line),s=[];if(e.off>dh||t.off>dh||e.col<0||t.col<0){let o=Math.min(e.off,t.off),a=Math.max(e.off,t.off);for(let l=n;l<=r;l++){let h=i.doc.line(l);h.length<=a&&s.push(S.range(h.from+o,h.to+a))}}else{let o=Math.min(e.col,t.col),a=Math.max(e.col,t.col);for(let l=n;l<=r;l++){let h=i.doc.line(l),c=_s(h.text,o,i.tabSize,!0);if(c<0)s.push(S.cursor(h.to));else{let f=_s(h.text,a,i.tabSize);s.push(S.range(h.from+c,h.from+f))}}}return s}function Xb(i,e){let t=i.coordsAtPos(i.viewport.from);return t?Math.round(Math.abs((t.left-e)/i.defaultCharacterWidth)):-1}function sd(i,e){let t=i.posAtCoords({x:e.clientX,y:e.clientY},!1),n=i.state.doc.lineAt(t),r=t-n.from,s=r>dh?-1:r==n.length?Xb(i,e.clientX):$t(n.text,i.state.tabSize,t-n.from);return{line:n.number,col:s,off:r}}function Wb(i,e){let t=sd(i,e),n=i.state.selection;return t?{update(r){if(r.docChanged){let s=r.changes.mapPos(r.startState.doc.line(t.line).from),o=r.state.doc.lineAt(s);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},n=n.map(r.changes)}},get(r,s,o){let a=sd(i,r);if(!a)return n;let l=Bb(i.state,t,a);return l.length?o?S.create(l.concat(n.ranges)):S.create(l):n}}:null}function bp(i){let e=i?.eventFilter||(t=>t.altKey&&t.button==0);return E.mouseSelectionStyle.of((t,n)=>e(n)?Wb(t,n):null)}var Ib={Alt:[18,i=>!!i.altKey],Control:[17,i=>!!i.ctrlKey],Shift:[16,i=>!!i.shiftKey],Meta:[91,i=>!!i.metaKey]},Nb={style:"cursor: crosshair"};function wp(i={}){let[e,t]=Ib[i.key||"Alt"],n=re.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==e||t(r))},keyup(r){(r.keyCode==e||!t(r))&&this.set(!1)},mousemove(r){this.set(t(r))}}});return[n,E.contentAttributes.of(r=>{var s;return!((s=r.plugin(n))===null||s===void 0)&&s.isDown?Nb:null})]}var Hn="-10000px",oo=class{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=n(o,s))}update(e,t){var n;let r=e.state.facet(this.facet),s=r.filter(l=>l);if(r===this.input){for(let l of this.tooltipViews)l.update&&l.update(e);return!1}let o=[],a=t?[]:null;for(let l=0;lt[h]=l),t.length=a.length),this.input=r,this.tooltips=s,this.tooltipViews=o,!0}};function jb(i){let{win:e}=i;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}var Cl=A.define({combine:i=>{var e,t,n;return{position:Q.ios?"absolute":((e=i.find(r=>r.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=i.find(r=>r.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((n=i.find(r=>r.tooltipSpace))===null||n===void 0?void 0:n.tooltipSpace)||jb}}}),od=new WeakMap,kh=re.fromClass(class{constructor(i){this.view=i,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=i.state.facet(Cl);this.position=e.position,this.parent=e.parent,this.classes=i.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new oo(i,gr,(t,n)=>this.createTooltip(t,n),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),i.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let i of this.manager.tooltipViews)this.intersectionObserver.observe(i.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(i){i.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(i,this.above);e&&this.observeIntersection();let t=e||i.geometryChanged,n=i.state.facet(Cl);if(n.position!=this.position&&!this.madeAbsolute){this.position=n.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;t=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(i,e){let t=i.create(this.view),n=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),i.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",t.dom.appendChild(r)}return t.dom.style.position=this.position,t.dom.style.top=Hn,t.dom.style.left="0px",this.container.insertBefore(t.dom,n),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var i,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let n of this.manager.tooltipViews)n.dom.remove(),(i=n.destroy)===null||i===void 0||i.call(n);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let i=this.view.dom.getBoundingClientRect(),e=1,t=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:r}=this.manager.tooltipViews[0];if(Q.gecko)n=r.offsetParent!=this.container.ownerDocument.body;else if(r.style.top==Hn&&r.style.left=="0px"){let s=r.getBoundingClientRect();n=Math.abs(s.top+1e4)>1||Math.abs(s.left)>1}}if(n||this.position=="absolute")if(this.parent){let r=this.parent.getBoundingClientRect();r.width&&r.height&&(e=r.width/this.parent.offsetWidth,t=r.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);return{editor:i,parent:this.parent?this.container.getBoundingClientRect():i,pos:this.manager.tooltips.map((r,s)=>{let o=this.manager.tooltipViews[s];return o.getCoords?o.getCoords(r.pos):this.view.coordsAtPos(r.pos)}),size:this.manager.tooltipViews.map(({dom:r})=>r.getBoundingClientRect()),space:this.view.state.facet(Cl).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(i){var e;if(i.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let a of this.manager.tooltipViews)a.dom.style.position="absolute"}let{editor:t,space:n,scaleX:r,scaleY:s}=i,o=[];for(let a=0;a=Math.min(t.bottom,n.bottom)||f.rightMath.min(t.right,n.right)+.1){c.style.top=Hn;continue}let d=l.arrow?h.dom.querySelector(".cm-tooltip-arrow"):null,m=d?7:0,p=u.right-u.left,g=(e=od.get(h))!==null&&e!==void 0?e:u.bottom-u.top,O=h.offset||Ub,y=this.view.textDirection==H.LTR,v=u.width>n.right-n.left?y?n.left:n.right-u.width:y?Math.min(f.left-(d?14:0)+O.x,n.right-p):Math.max(n.left,f.left-p+(d?14:0)-O.x),x=this.above[a];!l.strictSide&&(x?f.top-(u.bottom-u.top)-O.yn.bottom)&&x==n.bottom-f.bottom>f.top-n.top&&(x=this.above[a]=!x);let w=(x?f.top-n.top:n.bottom-f.bottom)-m;if(wv&&D.topP&&(P=x?D.top-g-2-m:D.bottom+m+2);if(this.position=="absolute"?(c.style.top=(P-i.parent.top)/s+"px",c.style.left=(v-i.parent.left)/r+"px"):(c.style.top=P/s+"px",c.style.left=v/r+"px"),d){let D=f.left+(y?O.x:-O.x)-(v+14-7);d.style.left=D/r+"px"}h.overlap!==!0&&o.push({left:v,top:P,right:C,bottom:P+g}),c.classList.toggle("cm-tooltip-above",x),c.classList.toggle("cm-tooltip-below",!x),h.positioned&&h.positioned(i.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let i of this.manager.tooltipViews)i.dom.style.top=Hn}},{eventObservers:{scroll(){this.maybeMeasure()}}}),zb=E.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),Ub={x:0,y:0},gr=A.define({enables:[kh,zb]}),ao=A.define({combine:i=>i.reduce((e,t)=>e.concat(t),[])}),lo=class i{static create(e){return new i(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new oo(e,ao,(t,n)=>this.createHostedView(t,n),t=>t.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let r=n[e];if(r!==void 0){if(t===void 0)t=r;else if(t!==r)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}},Fb=gr.compute([ao],i=>{let e=i.facet(ao);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var n;return(n=t.end)!==null&&n!==void 0?n:t.pos})),create:lo.create,above:e[0].above,arrow:e.some(t=>t.arrow)}}),ph=class{constructor(e,t,n,r,s){this.view=e,this.source=t,this.field=n,this.setHover=r,this.hoverTime=s,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;ea.bottom||t.xa.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(r)).find(c=>c.from<=r&&c.to>=r),h=l&&l.dir==H.RTL?-1:1;s=t.x{this.pending==a&&(this.pending=null,l&&!(Array.isArray(l)&&!l.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])}))},l=>we(e.state,l,"hover tooltip"))}else o&&!(Array.isArray(o)&&!o.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(kh),t=e?e.manager.tooltips.findIndex(n=>n.create==lo.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,n;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:s}=this;if(r.length&&s&&!Hb(s.dom,e)||this.pending){let{pos:o}=r[0]||this.pending,a=(n=(t=r[0])===null||t===void 0?void 0:t.end)!==null&&n!==void 0?n:o;(o==a?this.view.posAtCoords(this.lastMove)!=o:!Gb(this.view,o,a,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:n}=this;n&&n.dom.contains(e.relatedTarget)?this.watchTooltipLeave(n.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}},Ns=4;function Hb(i,e){let t=i.getBoundingClientRect();return e.clientX>=t.left-Ns&&e.clientX<=t.right+Ns&&e.clientY>=t.top-Ns&&e.clientY<=t.bottom+Ns}function Gb(i,e,t,n,r,s){let o=i.scrollDOM.getBoundingClientRect(),a=i.documentTop+i.documentPadding.top+i.contentHeight;if(o.left>n||o.rightr||Math.min(o.bottom,a)=e&&l<=t}function vp(i,e={}){let t=_.define(),n=te.define({create(){return[]},update(r,s){if(r.length&&(e.hideOnChange&&(s.docChanged||s.selection)?r=[]:e.hideOn&&(r=r.filter(o=>!e.hideOn(s,o))),s.docChanged)){let o=[];for(let a of r){let l=s.changes.mapPos(a.pos,-1,ge.TrackDel);if(l!=null){let h=Object.assign(Object.create(null),a);h.pos=l,h.end!=null&&(h.end=s.changes.mapPos(h.end)),o.push(h)}}r=o}for(let o of s.effects)o.is(t)&&(r=o.value),o.is(Yb)&&(r=[]);return r},provide:r=>ao.from(r)});return[n,re.define(r=>new ph(r,i,n,t,e.hoverTime||300)),Fb]}function Sh(i,e){let t=i.plugin(kh);if(!t)return null;let n=t.manager.tooltips.indexOf(e);return n<0?null:t.manager.tooltipViews[n]}var Yb=_.define();var ad=A.define({combine(i){let e,t;for(let n of i)e=e||n.topContainer,t=t||n.bottomContainer;return{topContainer:e,bottomContainer:t}}});function Pi(i,e){let t=i.plugin(xp),n=t?t.specs.indexOf(e):-1;return n>-1?t.panels[n]:null}var xp=re.fromClass(class{constructor(i){this.input=i.state.facet(Ti),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(i));let e=i.state.facet(ad);this.top=new sn(i,!0,e.topContainer),this.bottom=new sn(i,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(i){let e=i.state.facet(ad);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new sn(i.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new sn(i.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=i.state.facet(Ti);if(t!=this.input){let n=t.filter(l=>l),r=[],s=[],o=[],a=[];for(let l of n){let h=this.specs.indexOf(l),c;h<0?(c=l(i.view),a.push(c)):(c=this.panels[h],c.update&&c.update(i)),r.push(c),(c.top?s:o).push(c)}this.specs=n,this.panels=r,this.top.sync(s),this.bottom.sync(o);for(let l of a)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let n of this.panels)n.update&&n.update(i)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:i=>E.scrollMargins.of(e=>{let t=e.plugin(i);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})}),sn=class{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=ld(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=ld(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}};function ld(i){let e=i.nextSibling;return i.remove(),e}var Ti=A.define({enables:xp}),ze=class extends at{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};ze.prototype.elementClass="";ze.prototype.toDOM=void 0;ze.prototype.mapMode=ge.TrackBefore;ze.prototype.startSide=ze.prototype.endSide=-1;ze.prototype.point=!0;var Gs=A.define(),Zb={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>j.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},sr=A.define();function Th(i){return[kp(),sr.of(Object.assign(Object.assign({},Zb),i))]}var mh=A.define({combine:i=>i.some(e=>e)});function kp(i){let e=[Jb];return i&&i.fixed===!1&&e.push(mh.of(!0)),e}var Jb=re.fromClass(class{constructor(i){this.view=i,this.prevViewport=i.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=i.state.facet(sr).map(e=>new ho(i,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!i.state.facet(mh),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),i.scrollDOM.insertBefore(this.dom,i.contentDOM)}update(i){if(this.updateGutters(i)){let e=this.prevViewport,t=i.view.viewport,n=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(n<(t.to-t.from)*.8)}i.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(mh)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=i.view.viewport}syncGutters(i){let e=this.dom.nextSibling;i&&this.dom.remove();let t=j.iter(this.view.state.facet(Gs),this.view.viewport.from),n=[],r=this.gutters.map(s=>new Oh(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(n.length&&(n=[]),Array.isArray(s.type)){let o=!0;for(let a of s.type)if(a.type==_e.Text&&o){gh(t,n,a.from);for(let l of r)l.line(this.view,a,n);o=!1}else if(a.widget)for(let l of r)l.widget(this.view,a)}else if(s.type==_e.Text){gh(t,n,s.from);for(let o of r)o.line(this.view,s,n)}else if(s.widget)for(let o of r)o.widget(this.view,s);for(let s of r)s.finish();i&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(i){let e=i.startState.facet(sr),t=i.state.facet(sr),n=i.docChanged||i.heightChanged||i.viewportChanged||!j.eq(i.startState.facet(Gs),i.state.facet(Gs),i.view.viewport.from,i.view.viewport.to);if(e==t)for(let r of this.gutters)r.update(i)&&(n=!0);else{n=!0;let r=[];for(let s of t){let o=e.indexOf(s);o<0?r.push(new ho(this.view,s)):(this.gutters[o].update(i),r.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)this.dom.appendChild(s.dom);this.gutters=r}return n}destroy(){for(let i of this.gutters)i.destroy();this.dom.remove()}},{provide:i=>E.scrollMargins.of(e=>{let t=e.plugin(i);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==H.LTR?{left:t.dom.offsetWidth*e.scaleX}:{right:t.dom.offsetWidth*e.scaleX}})});function hd(i){return Array.isArray(i)?i:[i]}function gh(i,e,t){for(;i.value&&i.from<=t;)i.from==t&&e.push(i.value),i.next()}var Oh=class{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=j.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:r}=this,s=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==r.elements.length){let a=new co(e,o,s,n);r.elements.push(a),r.dom.appendChild(a.dom)}else r.elements[this.i].update(e,o,s,n);this.height=t.bottom,this.i++}line(e,t,n){let r=[];gh(this.cursor,r,t.from),n.length&&(r=r.concat(n));let s=this.gutter.config.lineMarker(e,t,r);s&&r.unshift(s);let o=this.gutter;r.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,r)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t);n&&this.addElement(e,t,[n])}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}},ho=class{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let n in t.domEventHandlers)this.dom.addEventListener(n,r=>{let s=r.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let l=s.getBoundingClientRect();o=(l.top+l.bottom)/2}else o=r.clientY;let a=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[n](e,a,r)&&r.preventDefault()});this.markers=hd(t.markers(e)),t.initialSpacer&&(this.spacer=new co(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=hd(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],e);r!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[r])}let n=e.view.viewport;return!j.eq(this.markers,t,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}},co=class{constructor(e,t,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,r)}update(e,t,n,r){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),Kb(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let n="cm-gutterElement",r=this.dom.firstChild;for(let s=0,o=0;;){let a=o,l=ss(a,l,h)||o(a,l,h):o}return n}})}}),or=class extends ze{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};function Rl(i,e){return i.state.facet(on).formatNumber(e,i.state)}var tw=sr.compute([on],i=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(ew)},lineMarker(e,t,n){return n.some(r=>r.toDOM)?null:new or(Rl(e,e.state.doc.lineAt(t.from).number))},widgetMarker:()=>null,lineMarkerChange:e=>e.startState.facet(on)!=e.state.facet(on),initialSpacer(e){return new or(Rl(e,cd(e.state.doc.lines)))},updateSpacer(e,t){let n=Rl(t.view,cd(t.view.state.doc.lines));return n==e.number?e:new or(n)},domEventHandlers:i.facet(on).domEventHandlers}));function Sp(i={}){return[on.of(i),kp(),tw]}function cd(i){let e=9;for(;e{let e=[],t=-1;for(let n of i.selection.ranges){let r=i.doc.lineAt(n.head).from;r>t&&(t=r,e.push(iw.range(r)))}return j.of(e)});function Tp(){return nw}var rw=0,Or=class{constructor(e,t){this.from=e,this.to=t}},$=class{constructor(e={}){this.id=rw++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Pe.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};$.closedBy=new $({deserialize:i=>i.split(" ")});$.openedBy=new $({deserialize:i=>i.split(" ")});$.group=new $({deserialize:i=>i.split(" ")});$.isolate=new $({deserialize:i=>{if(i&&i!="rtl"&&i!="ltr"&&i!="auto")throw new RangeError("Invalid value for isolate: "+i);return i||"auto"}});$.contextHash=new $({perNode:!0});$.lookAhead=new $({perNode:!0});$.mounted=new $({perNode:!0});var ln=class{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}static get(e){return e&&e.props&&e.props[$.mounted.id]}},sw=Object.create(null),Pe=class i{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):sw,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new i(e.name||"",t,e.id,n);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop($.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(" "))t[r]=e[n];return n=>{for(let r=n.prop($.group),s=-1;s<(r?r.length:0);s++){let o=t[s<0?n.name:r[s]];if(o)return o}}}};Pe.none=new Pe("",Object.create(null),0,8);var yr=class i{constructor(e){this.types=e;for(let t=0;t0;for(let l=this.cursor(o|oe.IncludeAnonymous);;){let h=!1;if(l.from<=s&&l.to>=r&&(!a&&l.type.isAnonymous||t(l)!==!1)){if(l.firstChild())continue;h=!0}for(;h&&n&&(a||!l.type.isAnonymous)&&n(l),!l.nextSibling();){if(!l.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Mh(Pe.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new i(this.type,t,n,r,this.propValues),e.makeTree||((t,n,r)=>new i(Pe.none,t,n,r)))}static build(e){return aw(e)}};le.empty=new le(Pe.none,[],[],0);var Ph=class i{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new i(this.buffer,this.index)}},ei=class i{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return Pe.none}toString(){let e=[];for(let t=0;t0));l=o[l+3]);return a}slice(e,t,n){let r=this.buffer,s=new Uint16Array(t-e),o=0;for(let a=e,l=0;a=e&&te;case 1:return t<=e&&n>e;case 2:return n>e;case 4:return!0}}function br(i,e,t,n){for(var r;i.from==i.to||(t<1?i.from>=e:i.from>e)||(t>-1?i.to<=e:i.to0?a.length:-1;e!=h;e+=t){let c=a[e],f=l[e]+o.from;if(Ep(r,n,f,f+c.length)){if(c instanceof ei){if(s&oe.ExcludeBuffers)continue;let u=c.findChild(0,c.buffer.length,t,n-f,r);if(u>-1)return new Ci(new Rh(o,c,e,f),null,u)}else if(s&oe.IncludeAnonymous||!c.type.isAnonymous||Qh(c)){let u;if(!(s&oe.IgnoreMounts)&&(u=ln.get(c))&&!u.overlay)return new i(u.tree,f,e,o);let d=new i(c,f,e,o);return s&oe.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?c.children.length-1:0,t,n,r)}}}if(s&oe.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,n=0){let r;if(!(n&oe.IgnoreOverlays)&&(r=ln.get(this._tree))&&r.overlay){let s=e-this.from;for(let{from:o,to:a}of r.overlay)if((t>0?o<=s:o=s:a>s))return new i(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function Cp(i,e,t,n){let r=i.cursor(),s=[];if(!r.firstChild())return s;if(t!=null){for(let o=!1;!o;)if(o=r.type.is(t),!r.nextSibling())return s}for(;;){if(n!=null&&r.type.is(n))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return n==null?s:[]}}function Ch(i,e,t=e.length-1){for(let n=i.parent;t>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[t]&&e[t]!=n.name)return!1;t--}}return!0}var Rh=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},Ci=class i extends mo{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,n);return s<0?null:new i(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,n=0){if(n&oe.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new i(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new i(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new i(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,s=n.buffer[this.index+3];if(s>r){let o=n.buffer[this.index+1];e.push(n.slice(r,s,o)),t.push(0)}return new le(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function Ap(i){if(!i.length)return null;let e=0,t=i[0];for(let s=1;st.from||o.to=e){let a=new nt(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[n])).push(br(a,e,t,!1))}}return r?Ap(r):n}var wr=class{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof nt)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof nt?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&oe.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&oe.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&oe.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let r=n<0?0:this.stack[n]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{let r=t.buffer[this.index+3];if(r<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(r)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index-1)for(let s=t+e,o=e<0?-1:n._tree.children.length;s!=o;s+=e){let a=n._tree.children[s];if(this.mode&oe.IncludeAnonymous||a instanceof ei||!a.type.isAnonymous||Qh(a))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;t=o,n=s+1;break e}r=this.stack[--s]}for(let r=n;r=0;s--){if(s<0)return Ch(this.node,e,r);let o=n[t.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}};function Qh(i){return i.children.some(e=>e instanceof ei||!e.type.isAnonymous||Qh(e))}function aw(i){var e;let{buffer:t,nodeSet:n,maxBufferLength:r=1024,reused:s=[],minRepeatType:o=n.types.length}=i,a=Array.isArray(t)?new Ph(t,t.length):t,l=n.types,h=0,c=0;function f(w,P,C,D,B,V){let{id:X,start:q,end:G,size:I}=a,ie=c;for(;I<0;)if(a.next(),I==-1){let pe=s[X];C.push(pe),D.push(q-w);return}else if(I==-3){h=X;return}else if(I==-4){c=X;return}else throw new RangeError(`Unrecognized record size: ${I}`);let De=l[X],$e,We,Ye=q-w;if(G-q<=r&&(We=g(a.pos-P,B))){let pe=new Uint16Array(We.size-We.skip),Ze=a.pos-We.size,dt=pe.length;for(;a.pos>Ze;)dt=O(We.start,pe,dt);$e=new ei(pe,G-We.start,n),Ye=We.start-w}else{let pe=a.pos-I;a.next();let Ze=[],dt=[],hi=X>=o?X:-1,qi=0,Hr=G;for(;a.pos>pe;)hi>=0&&a.id==hi&&a.size>=0?(a.end<=Hr-r&&(m(Ze,dt,q,qi,a.end,Hr,hi,ie),qi=Ze.length,Hr=a.end),a.next()):V>2500?u(q,pe,Ze,dt):f(q,pe,Ze,dt,hi,V+1);if(hi>=0&&qi>0&&qi-1&&qi>0){let of=d(De);$e=Mh(De,Ze,dt,0,Ze.length,0,G-q,of,of)}else $e=p(De,Ze,dt,G-q,ie-G)}C.push($e),D.push(Ye)}function u(w,P,C,D){let B=[],V=0,X=-1;for(;a.pos>P;){let{id:q,start:G,end:I,size:ie}=a;if(ie>4)a.next();else{if(X>-1&&G=0;I-=3)q[ie++]=B[I],q[ie++]=B[I+1]-G,q[ie++]=B[I+2]-G,q[ie++]=ie;C.push(new ei(q,B[2]-G,n)),D.push(G-w)}}function d(w){return(P,C,D)=>{let B=0,V=P.length-1,X,q;if(V>=0&&(X=P[V])instanceof le){if(!V&&X.type==w&&X.length==D)return X;(q=X.prop($.lookAhead))&&(B=C[V]+X.length+q)}return p(w,P,C,D,B)}}function m(w,P,C,D,B,V,X,q){let G=[],I=[];for(;w.length>D;)G.push(w.pop()),I.push(P.pop()+C-B);w.push(p(n.types[X],G,I,V-B,q-V)),P.push(B-C)}function p(w,P,C,D,B=0,V){if(h){let X=[$.contextHash,h];V=V?[X].concat(V):[X]}if(B>25){let X=[$.lookAhead,B];V=V?[X].concat(V):[X]}return new le(w,P,C,D,V)}function g(w,P){let C=a.fork(),D=0,B=0,V=0,X=C.end-r,q={size:0,start:0,skip:0};e:for(let G=C.pos-w;C.pos>G;){let I=C.size;if(C.id==P&&I>=0){q.size=D,q.start=B,q.skip=V,V+=4,D+=4,C.next();continue}let ie=C.pos-I;if(I<0||ie=o?4:0,$e=C.start;for(C.next();C.pos>ie;){if(C.size<0)if(C.size==-3)De+=4;else break e;else C.id>=o&&(De+=4);C.next()}B=$e,D+=I,V+=De}return(P<0||D==w)&&(q.size=D,q.start=B,q.skip=V),q.size>4?q:void 0}function O(w,P,C){let{id:D,start:B,end:V,size:X}=a;if(a.next(),X>=0&&D4){let G=a.pos-(X-4);for(;a.pos>G;)C=O(w,P,C)}P[--C]=q,P[--C]=V-w,P[--C]=B-w,P[--C]=D}else X==-3?h=D:X==-4&&(c=D);return C}let y=[],v=[];for(;a.pos>0;)f(i.start||0,i.bufferStart||0,y,v,-1,0);let x=(e=i.length)!==null&&e!==void 0?e:y.length?v[0]+y[0].length:0;return new le(l[i.topID],y.reverse(),v.reverse(),x)}var Rp=new WeakMap;function po(i,e){if(!i.isAnonymous||e instanceof ei||e.type!=i)return 1;let t=Rp.get(e);if(t==null){t=1;for(let n of e.children){if(n.type!=i||!(n instanceof le)){t=1;break}t+=po(i,n)}Rp.set(e,t)}return t}function Mh(i,e,t,n,r,s,o,a,l){let h=0;for(let m=n;m=c)break;P+=C}if(v==x+1){if(P>c){let C=m[x];d(C.children,C.positions,0,C.children.length,p[x]+y);continue}f.push(m[x])}else{let C=p[v-1]+m[v-1].length-w;f.push(Mh(i,m,p,x,v,w,C,null,l))}u.push(w+y-s)}}return d(e,t,n,r,0),(a||l)(f,u,o)}var go=class{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof Ci?this.setBuffer(e.context.buffer,e.index,t):e instanceof nt&&this.map.set(e.tree,t)}get(e){return e instanceof Ci?this.getBuffer(e.context.buffer,e.index):e instanceof nt?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}},Ri=class i{constructor(e,t,n,r,s=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],n=!1){let r=[new i(0,e.length,e,0,!1,n)];for(let s of t)s.to>e.length&&r.push(s);return r}static applyChanges(e,t,n=128){if(!t.length)return e;let r=[],s=1,o=e.length?e[0]:null;for(let a=0,l=0,h=0;;a++){let c=a=n)for(;o&&o.from=u.from||f<=u.to||h){let d=Math.max(u.from,l)-h,m=Math.min(u.to,f)-h;u=d>=m?null:new i(d,m,u.tree,u.offset+h,a>0,!!c)}if(u&&r.push(u),o.to>f)break;o=snew Or(r.from,r.to)):[new Or(0,0)]:[new Or(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let s=r.advance();if(s)return s}}},Ah=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}};var pT=new $({perNode:!0});var lw=0,Tt=class i{constructor(e,t,n){this.set=e,this.base=t,this.modified=n,this.id=lw++}static define(e){if(e?.base)throw new Error("Can not derive from a modified tag");let t=new i([],null,[]);if(t.set.push(t),e)for(let n of e.set)t.set.push(n);return t}static defineModifier(){let e=new wo;return t=>t.modified.indexOf(e)>-1?t:wo.get(t.base||t,t.modified.concat(e).sort((n,r)=>n.id-r.id))}},hw=0,wo=class i{constructor(){this.instances=[],this.id=hw++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(a=>a.base==e&&cw(t,a.modified));if(n)return n;let r=[],s=new Tt(r,e,t);for(let a of t)a.instances.push(s);let o=fw(t);for(let a of e.set)if(!a.modified.length)for(let l of o)r.push(i.get(a,l));return s}};function cw(i,e){return i.length==e.length&&i.every((t,n)=>t==e[n])}function fw(i){let e=[[]];for(let t=0;tn.length-t.length)}function fn(i){let e=Object.create(null);for(let t in i){let n=i[t];Array.isArray(n)||(n=[n]);for(let r of t.split(" "))if(r){let s=[],o=2,a=r;for(let f=0;;){if(a=="..."&&f>0&&f+3==r.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!u)throw new RangeError("Invalid path: "+r);if(s.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==r.length)break;let d=r[f++];if(f==r.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+r);a=r.slice(f)}let l=s.length-1,h=s[l];if(!h)throw new RangeError("Invalid path: "+r);let c=new cn(n,o,l>0?s.slice(0,l):null);e[h]=c.sort(e[h])}}return _p.add(e)}var _p=new $,cn=class{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=r;for(let a of s)for(let l of a.set){let h=t[l.id];if(h){o=o?o+" "+h:h;break}}return o},scope:n}}function uw(i,e){let t=null;for(let n of i){let r=n.style(e);r&&(t=t?t+" "+r:r)}return t}function Vh(i,e,t,n=0,r=i.length){let s=new Dh(n,Array.isArray(e)?e:[e],t);s.highlightRange(i.cursor(),n,r,"",s.highlighters),s.flush(r)}function Lh(i,e,t,n,r,s=0,o=i.length){let a=s;function l(h,c){if(!(h<=a)){for(let f=i.slice(a,h),u=0;;){let d=f.indexOf(` +`,u),m=d<0?f.length:d;if(m>u&&n(f.slice(u,m),c),d<0)break;r(),u=d+1}a=h}}Vh(e,t,(h,c,f)=>{l(h,""),l(c,f)},s,o),l(o,"")}var Dh=class{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,s){let{type:o,from:a,to:l}=e;if(a>=n||l<=t)return;o.isTop&&(s=this.highlighters.filter(d=>!d.scope||d.scope(o)));let h=r,c=dw(e)||cn.empty,f=uw(s,c.tags);if(f&&(h&&(h+=" "),h+=f,c.mode==1&&(r+=(r?" ":"")+f)),this.startSpan(Math.max(t,a),h),c.opaque)return;let u=e.tree&&e.tree.prop($.mounted);if(u&&u.overlay){let d=e.node.enter(u.overlay[0].from+a,1),m=this.highlighters.filter(g=>!g.scope||g.scope(u.tree.type)),p=e.firstChild();for(let g=0,O=a;;g++){let y=g=v||!e.nextSibling())););if(!y||v>n)break;O=y.to+a,O>t&&(this.highlightRange(d.cursor(),Math.max(t,y.from+a),Math.min(n,O),"",m),this.startSpan(Math.min(n,O),h))}p&&e.parent()}else if(e.firstChild()){u&&(r="");do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,r,s),this.startSpan(Math.min(n,e.to),h)}while(e.nextSibling());e.parent()}}};function dw(i){let e=i.type.prop(_p);for(;e&&e.context&&!i.matchContext(e.context);)e=e.next;return e||null}var R=Tt.define,Oo=R(),ti=R(),Qp=R(ti),Mp=R(ti),ii=R(),yo=R(ii),_h=R(ii),St=R(),Ei=R(St),xt=R(),kt=R(),$h=R(),vr=R($h),bo=R(),b={comment:Oo,lineComment:R(Oo),blockComment:R(Oo),docComment:R(Oo),name:ti,variableName:R(ti),typeName:Qp,tagName:R(Qp),propertyName:Mp,attributeName:R(Mp),className:R(ti),labelName:R(ti),namespace:R(ti),macroName:R(ti),literal:ii,string:yo,docString:R(yo),character:R(yo),attributeValue:R(yo),number:_h,integer:R(_h),float:R(_h),bool:R(ii),regexp:R(ii),escape:R(ii),color:R(ii),url:R(ii),keyword:xt,self:R(xt),null:R(xt),atom:R(xt),unit:R(xt),modifier:R(xt),operatorKeyword:R(xt),controlKeyword:R(xt),definitionKeyword:R(xt),moduleKeyword:R(xt),operator:kt,derefOperator:R(kt),arithmeticOperator:R(kt),logicOperator:R(kt),bitwiseOperator:R(kt),compareOperator:R(kt),updateOperator:R(kt),definitionOperator:R(kt),typeOperator:R(kt),controlOperator:R(kt),punctuation:$h,separator:R($h),bracket:vr,angleBracket:R(vr),squareBracket:R(vr),paren:R(vr),brace:R(vr),content:St,heading:Ei,heading1:R(Ei),heading2:R(Ei),heading3:R(Ei),heading4:R(Ei),heading5:R(Ei),heading6:R(Ei),contentSeparator:R(St),list:R(St),quote:R(St),emphasis:R(St),strong:R(St),link:R(St),monospace:R(St),strikethrough:R(St),inserted:R(),deleted:R(),changed:R(),invalid:R(),meta:bo,documentMeta:R(bo),annotation:R(bo),processingInstruction:R(bo),definition:Tt.defineModifier(),constant:Tt.defineModifier(),function:Tt.defineModifier(),standard:Tt.defineModifier(),local:Tt.defineModifier(),special:Tt.defineModifier()},OT=xr([{tag:b.link,class:"tok-link"},{tag:b.heading,class:"tok-heading"},{tag:b.emphasis,class:"tok-emphasis"},{tag:b.strong,class:"tok-strong"},{tag:b.keyword,class:"tok-keyword"},{tag:b.atom,class:"tok-atom"},{tag:b.bool,class:"tok-bool"},{tag:b.url,class:"tok-url"},{tag:b.labelName,class:"tok-labelName"},{tag:b.inserted,class:"tok-inserted"},{tag:b.deleted,class:"tok-deleted"},{tag:b.literal,class:"tok-literal"},{tag:b.string,class:"tok-string"},{tag:b.number,class:"tok-number"},{tag:[b.regexp,b.escape,b.special(b.string)],class:"tok-string2"},{tag:b.variableName,class:"tok-variableName"},{tag:b.local(b.variableName),class:"tok-variableName tok-local"},{tag:b.definition(b.variableName),class:"tok-variableName tok-definition"},{tag:b.special(b.variableName),class:"tok-variableName2"},{tag:b.definition(b.propertyName),class:"tok-propertyName tok-definition"},{tag:b.typeName,class:"tok-typeName"},{tag:b.namespace,class:"tok-namespace"},{tag:b.className,class:"tok-className"},{tag:b.macroName,class:"tok-macroName"},{tag:b.propertyName,class:"tok-propertyName"},{tag:b.operator,class:"tok-operator"},{tag:b.comment,class:"tok-comment"},{tag:b.meta,class:"tok-meta"},{tag:b.invalid,class:"tok-invalid"},{tag:b.punctuation,class:"tok-punctuation"}]);var qh,un=new $;function pw(i){return A.define({combine:i?e=>e.concat(i):void 0})}var mw=new $,Ue=class{constructor(e,t,n=[],r=""){this.data=e,this.name=r,N.prototype.hasOwnProperty("tree")||Object.defineProperty(N.prototype,"tree",{get(){return he(this)}}),this.parser=t,this.extension=[ni.of(this),N.languageData.of((s,o,a)=>{let l=Dp(s,o,a),h=l.type.prop(un);if(!h)return[];let c=s.facet(h),f=l.type.prop(mw);if(f){let u=l.resolve(o-l.from,a);for(let d of f)if(d.test(u,s)){let m=s.facet(d.facet);return d.type=="replace"?m:m.concat(c)}}return c})].concat(n)}isActiveAt(e,t,n=-1){return Dp(e,t,n).type.prop(un)==this.data}findRegions(e){let t=e.facet(ni);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(s,o)=>{if(s.prop(un)==this.data){n.push({from:o,to:o+s.length});return}let a=s.prop($.mounted);if(a){if(a.tree.prop(un)==this.data){if(a.overlay)for(let l of a.overlay)n.push({from:l.from+o,to:l.to+o});else n.push({from:o,to:o+s.length});return}else if(a.overlay){let l=n.length;if(r(a.tree,a.overlay[0].from+o),n.length>l)return}}for(let l=0;ln.isTop?t:void 0)]}),e.name)}configure(e,t){return new i(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function he(i){let e=i.field(Ue.state,!1);return e?e.tree:le.empty}var Ih=class{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},kr=null,Nh=class i{constructor(e,t,n=[],r,s,o,a,l){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=s,this.viewport=o,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new i(e,t,[],le.empty,0,n,[],null)}startParse(){return this.parser.startParse(new Ih(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=le.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Ri.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=kr;kr=this;try{return e()}finally{kr=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=$p(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:r,treeLen:s,viewport:o,skipped:a}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((h,c,f,u)=>l.push({fromA:h,toA:c,fromB:f,toB:u})),n=Ri.applyChanges(n,l),r=le.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){a=[];for(let h of this.skipped){let c=e.mapPos(h.from,1),f=e.mapPos(h.to,-1);ce.from&&(this.fragments=$p(this.fragments,r,s),this.skipped.splice(n--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends hn{createParse(t,n,r){let s=r[0].from,o=r[r.length-1].to;return{parsedPos:s,advance(){let l=kr;if(l){for(let h of r)l.tempSkipped.push(h);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=o,new le(Pe.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return kr}};function $p(i,e,t){return Ri.applyChanges(i,[{fromA:e,toA:t,fromB:e,toB:t}])}var Tr=class i{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new i(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=Nh.create(e.facet(ni).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new i(n)}};Ue.state=te.define({create:Tr.init,update(i,e){for(let t of e.effects)if(t.is(Ue.setState))return t.value;return e.startState.facet(ni)!=e.state.facet(ni)?Tr.init(e.state):i.apply(e)}});var Xp=i=>{let e=setTimeout(()=>i(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Xp=i=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(i,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});var Bh=typeof navigator<"u"&&(!((qh=navigator.scheduling)===null||qh===void 0)&&qh.isInputPending)?()=>navigator.scheduling.isInputPending():null,gw=re.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Ue.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Ue.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Xp(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndr+1e3,l=s.context.work(()=>Bh&&Bh()||Date.now()>o,r+(a?0:1e5));this.chunkBudget-=Date.now()-t,(l||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Ue.setState.of(new Tr(s.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>we(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),ni=A.define({combine(i){return i.length?i[0]:null},enables:i=>[Ue.state,gw,E.contentAttributes.compute([i],e=>{let t=e.facet(i);return t&&t.name?{"data-language":t.name}:{}})]}),pn=class{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}};var Ow=A.define(),mn=A.define({combine:i=>{if(!i.length)return" ";let e=i[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(i[0]));return e}});function Pr(i){let e=i.facet(mn);return e.charCodeAt(0)==9?i.tabSize*e.length:e.length}function gn(i,e){let t="",n=i.tabSize,r=i.facet(mn)[0];if(r==" "){for(;e>=n;)t+=" ",e-=n;r=" "}for(let s=0;s=e?yw(i,t,e):null}var Ai=class{constructor(e,t={}){this.state=e,this.options=t,this.unit=Pr(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=n.from&&r<=n.to?s&&r==e?{text:"",from:e}:(t<0?r-1&&(s+=o-this.countColumn(n,n.search(/\S|$/))),s}countColumn(e,t=e.length){return $t(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let o=s(r);if(o>-1)return o}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},Cr=new $;function yw(i,e,t){let n=e.resolveStack(t),r=n.node.enterUnfinishedNodesBefore(t);if(r!=n.node){let s=[];for(let o=r;o!=n.node;o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)n={node:s[o],next:n}}return Wp(n,i,t)}function Wp(i,e,t){for(let n=i;n;n=n.next){let r=ww(n.node);if(r)return r(jh.create(e,t,n))}return 0}function bw(i){return i.pos==i.options.simulateBreak&&i.options.simulateDoubleBreak}function ww(i){let e=i.type.prop(Cr);if(e)return e;let t=i.firstChild,n;if(t&&(n=t.type.prop($.closedBy))){let r=i.lastChild,s=r&&n.indexOf(r.name)>-1;return o=>Ip(o,!0,1,void 0,s&&!bw(o)?r.from:void 0)}return i.parent==null?vw:null}function vw(){return 0}var jh=class i extends Ai{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new i(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(xw(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return Wp(this.context.next,this.base,this.pos)}};function xw(i,e){for(let t=e;t;t=t.parent)if(i==t)return!0;return!1}function kw(i){let e=i.node,t=e.childAfter(e.from),n=e.lastChild;if(!t)return null;let r=i.options.simulateBreak,s=i.state.doc.lineAt(t.from),o=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let a=t.to;;){let l=e.childAfter(a);if(!l||l==n)return null;if(!l.type.isSkipped)return l.fromIp(n,e,t,i)}function Ip(i,e,t,n,r){let s=i.textAfter,o=s.match(/^\s*/)[0].length,a=n&&s.slice(o,o+n.length)==n||r==i.pos+o,l=e?kw(i):null;return l?a?i.column(l.from):i.column(l.to):i.baseIndent+(a?0:i.unit*t)}var Sw=200;function Np(){return N.transactionFilter.of(i=>{if(!i.docChanged||!i.isUserEvent("input.type")&&!i.isUserEvent("input.complete"))return i;let e=i.startState.languageDataAt("indentOnInput",i.startState.selection.main.head);if(!e.length)return i;let t=i.newDoc,{head:n}=i.newSelection.main,r=t.lineAt(n);if(n>r.from+Sw)return i;let s=t.sliceString(r.from,n);if(!e.some(h=>h.test(s)))return i;let{state:o}=i,a=-1,l=[];for(let{head:h}of o.selection.ranges){let c=o.doc.lineAt(h);if(c.from==a)continue;a=c.from;let f=So(o,c.from);if(f==null)continue;let u=/^\s*/.exec(c.text)[0],d=gn(o,f);u!=d&&l.push({from:c.from,to:c.from+u.length,insert:d})}return l.length?[i,{changes:l,sequential:!0}]:i})}var Tw=A.define(),Rr=new $;function To(i){let e=i.firstChild,t=i.lastChild;return e&&e.tot)continue;if(s&&a.from=e&&h.to>t&&(s=h)}}return s}function Cw(i){let e=i.lastChild;return e&&e.to==i.to&&e.type.isError}function vo(i,e,t){for(let n of i.facet(Tw)){let r=n(i,e,t);if(r)return r}return Pw(i,e,t)}function jp(i,e){let t=e.mapPos(i.from,1),n=e.mapPos(i.to,-1);return t>=n?void 0:{from:t,to:n}}var Po=_.define({map:jp}),Er=_.define({map:jp});function zp(i){let e=[];for(let{head:t}of i.state.selection.ranges)e.some(n=>n.from<=t&&n.to>=t)||e.push(i.lineBlockAt(t));return e}var Qi=te.define({create(){return M.none},update(i,e){i=i.map(e.changes);for(let t of e.effects)if(t.is(Po)&&!Rw(i,t.value.from,t.value.to)){let{preparePlaceholder:n}=e.state.facet(Yh),r=n?M.replace({widget:new zh(n(e.state,t.value))}):Vp;i=i.update({add:[r.range(t.value.from,t.value.to)]})}else t.is(Er)&&(i=i.update({filter:(n,r)=>t.value.from!=n||t.value.to!=r,filterFrom:t.value.from,filterTo:t.value.to}));if(e.selection){let t=!1,{head:n}=e.selection.main;i.between(n,n,(r,s)=>{rn&&(t=!0)}),t&&(i=i.update({filterFrom:n,filterTo:n,filter:(r,s)=>s<=n||r>=n}))}return i},provide:i=>E.decorations.from(i),toJSON(i,e){let t=[];return i.between(0,e.doc.length,(n,r)=>{t.push(n,r)}),t},fromJSON(i){if(!Array.isArray(i)||i.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t{(!r||r.from>s)&&(r={from:s,to:o})}),r}function Rw(i,e,t){let n=!1;return i.between(e,e,(r,s)=>{r==e&&s==t&&(n=!0)}),n}function Up(i,e){return i.field(Qi,!1)?e:e.concat(_.appendConfig.of(Gp()))}var Ew=i=>{for(let e of zp(i)){let t=vo(i.state,e.from,e.to);if(t)return i.dispatch({effects:Up(i.state,[Po.of(t),Fp(i,t)])}),!0}return!1},Aw=i=>{if(!i.state.field(Qi,!1))return!1;let e=[];for(let t of zp(i)){let n=xo(i.state,t.from,t.to);n&&e.push(Er.of(n),Fp(i,n,!1))}return e.length&&i.dispatch({effects:e}),e.length>0};function Fp(i,e,t=!0){let n=i.state.doc.lineAt(e.from).number,r=i.state.doc.lineAt(e.to).number;return E.announce.of(`${i.state.phrase(t?"Folded lines":"Unfolded lines")} ${n} ${i.state.phrase("to")} ${r}.`)}var Qw=i=>{let{state:e}=i,t=[];for(let n=0;n{let e=i.state.field(Qi,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,i.state.doc.length,(n,r)=>{t.push(Er.of({from:n,to:r}))}),i.dispatch({effects:t}),!0};var Hp=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:Ew},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:Aw},{key:"Ctrl-Alt-[",run:Qw},{key:"Ctrl-Alt-]",run:Mw}],_w={placeholderDOM:null,preparePlaceholder:null,placeholderText:"\u2026"},Yh=A.define({combine(i){return Te(i,_w)}});function Gp(i){let e=[Qi,$w];return i&&e.push(Yh.of(i)),e}function Yp(i,e){let{state:t}=i,n=t.facet(Yh),r=o=>{let a=i.lineBlockAt(i.posAtDOM(o.target)),l=xo(i.state,a.from,a.to);l&&i.dispatch({effects:Er.of(l)}),o.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(i,r,e);let s=document.createElement("span");return s.textContent=n.placeholderText,s.setAttribute("aria-label",t.phrase("folded code")),s.title=t.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=r,s}var Vp=M.replace({widget:new class extends Be{toDOM(i){return Yp(i,null)}}}),zh=class extends Be{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Yp(e,this.value)}},Dw={openText:"\u2304",closedText:"\u203A",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1},Sr=class extends ze{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}};function Zp(i={}){let e=Object.assign(Object.assign({},Dw),i),t=new Sr(e,!0),n=new Sr(e,!1),r=re.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(ni)!=o.state.facet(ni)||o.startState.field(Qi,!1)!=o.state.field(Qi,!1)||he(o.startState)!=he(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let a=new lt;for(let l of o.viewportLineBlocks){let h=xo(o.state,l.from,l.to)?n:vo(o.state,l.from,l.to)?t:null;h&&a.add(l.from,l.from,h)}return a.finish()}}),{domEventHandlers:s}=e;return[r,Th({class:"cm-foldGutter",markers(o){var a;return((a=o.plugin(r))===null||a===void 0?void 0:a.markers)||j.empty},initialSpacer(){return new Sr(e,!1)},domEventHandlers:Object.assign(Object.assign({},s),{click:(o,a,l)=>{if(s.click&&s.click(o,a,l))return!0;let h=xo(o.state,a.from,a.to);if(h)return o.dispatch({effects:Er.of(h)}),!0;let c=vo(o.state,a.from,a.to);return c?(o.dispatch({effects:Po.of(c)}),!0):!1}})}),Gp()]}var $w=E.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}}),ko=class i{constructor(e,t){this.specs=e;let n;function r(a){let l=et.newName();return(n||(n=Object.create(null)))["."+l]=a,l}let s=typeof t.all=="string"?t.all:t.all?r(t.all):void 0,o=t.scope;this.scope=o instanceof Ue?a=>a.prop(un)==o.data:o?a=>a==o:void 0,this.style=xr(e.map(a=>({tag:a.tag,class:a.class||r(Object.assign({},a,{tag:null}))})),{all:s}).style,this.module=n?new et(n):null,this.themeType=t.themeType}static define(e,t){return new i(e,t||{})}},Uh=A.define(),Jp=A.define({combine(i){return i.length?[i[0]]:null}});function Xh(i){let e=i.facet(Uh);return e.length?e:i.facet(Jp)}function Ar(i,e){let t=[Vw],n;return i instanceof ko&&(i.module&&t.push(E.styleModule.of(i.module)),n=i.themeType),e?.fallback?t.push(Jp.of(i)):n?t.push(Uh.computeN([E.darkTheme],r=>r.facet(E.darkTheme)==(n=="dark")?[i]:[])):t.push(Uh.of(i)),t}var Fh=class{constructor(e){this.markCache=Object.create(null),this.tree=he(e.state),this.decorations=this.buildDeco(e,Xh(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=he(e.state),n=Xh(e.state),r=n!=Xh(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=s.to)}buildDeco(e,t){if(!t||!this.tree.length)return M.none;let n=new lt;for(let{from:r,to:s}of e.visibleRanges)Vh(this.tree,t,(o,a,l)=>{n.add(o,a,this.markCache[l]||(this.markCache[l]=M.mark({class:l})))},r,s);return n.finish()}},Vw=Qe.high(re.fromClass(Fh,{decorations:i=>i.decorations})),Kp=ko.define([{tag:b.meta,color:"#404740"},{tag:b.link,textDecoration:"underline"},{tag:b.heading,textDecoration:"underline",fontWeight:"bold"},{tag:b.emphasis,fontStyle:"italic"},{tag:b.strong,fontWeight:"bold"},{tag:b.strikethrough,textDecoration:"line-through"},{tag:b.keyword,color:"#708"},{tag:[b.atom,b.bool,b.url,b.contentSeparator,b.labelName],color:"#219"},{tag:[b.literal,b.inserted],color:"#164"},{tag:[b.string,b.deleted],color:"#a11"},{tag:[b.regexp,b.escape,b.special(b.string)],color:"#e40"},{tag:b.definition(b.variableName),color:"#00f"},{tag:b.local(b.variableName),color:"#30a"},{tag:[b.typeName,b.namespace],color:"#085"},{tag:b.className,color:"#167"},{tag:[b.special(b.variableName),b.macroName],color:"#256"},{tag:b.definition(b.propertyName),color:"#00c"},{tag:b.comment,color:"#940"},{tag:b.invalid,color:"#f00"}]),Lw=E.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),em=1e4,tm="()[]{}",im=A.define({combine(i){return Te(i,{afterCursor:!0,brackets:tm,maxScanDistance:em,renderMatch:Xw})}}),qw=M.mark({class:"cm-matchingBracket"}),Bw=M.mark({class:"cm-nonmatchingBracket"});function Xw(i){let e=[],t=i.matched?qw:Bw;return e.push(t.range(i.start.from,i.start.to)),i.end&&e.push(t.range(i.end.from,i.end.to)),e}var Ww=te.define({create(){return M.none},update(i,e){if(!e.docChanged&&!e.selection)return i;let t=[],n=e.state.facet(im);for(let r of e.state.selection.ranges){if(!r.empty)continue;let s=ct(e.state,r.head,-1,n)||r.head>0&&ct(e.state,r.head-1,1,n)||n.afterCursor&&(ct(e.state,r.head,1,n)||r.headE.decorations.from(i)}),Iw=[Ww,Lw];function nm(i={}){return[im.of(i),Iw]}var Nw=new $;function Hh(i,e,t){let n=i.prop(e<0?$.openedBy:$.closedBy);if(n)return n;if(i.name.length==1){let r=t.indexOf(i.name);if(r>-1&&r%2==(e<0?1:0))return[t[r+e]]}return null}function Gh(i){let e=i.type.prop(Nw);return e?e(i.node):i}function ct(i,e,t,n={}){let r=n.maxScanDistance||em,s=n.brackets||tm,o=he(i),a=o.resolveInner(e,t);for(let l=a;l;l=l.parent){let h=Hh(l.type,t,s);if(h&&l.from0?e>=c.from&&ec.from&&e<=c.to))return jw(i,e,t,l,c,h,s)}}return zw(i,e,t,o,a.type,r,s)}function jw(i,e,t,n,r,s,o){let a=n.parent,l={from:r.from,to:r.to},h=0,c=a?.cursor();if(c&&(t<0?c.childBefore(n.from):c.childAfter(n.to)))do if(t<0?c.to<=n.from:c.from>=n.to){if(h==0&&s.indexOf(c.type.name)>-1&&c.from0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},c=i.doc.iterRange(e,t>0?i.doc.length:0),f=0;for(let u=0;!c.next().done&&u<=s;){let d=c.value;t<0&&(u+=d.length);let m=e+u*t;for(let p=t>0?0:d.length-1,g=t>0?d.length:-1;p!=g;p+=t){let O=o.indexOf(d[p]);if(!(O<0||n.resolveInner(m+p,1).type!=r))if(O%2==0==t>0)f++;else{if(f==1)return{start:h,end:{from:m+p,to:m+p+1},matched:O>>1==l>>1};f--}}t>0&&(u+=d.length)}return c.done?{start:h,matched:!1}:null}var Uw=Object.create(null),Lp=[Pe.none];var qp=[],Bp=Object.create(null),Fw=Object.create(null);for(let[i,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Fw[i]=Hw(Uw,e);function Wh(i,e){qp.indexOf(i)>-1||(qp.push(i),console.warn(e))}function Hw(i,e){let t=[];for(let a of e.split(" ")){let l=[];for(let h of a.split(".")){let c=i[h]||b[h];c?typeof c=="function"?l.length?l=l.map(c):Wh(h,`Modifier ${h} used at start of tag`):l.length?Wh(h,`Tag ${h} used as modifier`):l=Array.isArray(c)?c:[c]:Wh(h,`Unknown highlighting tag ${h}`)}for(let h of l)t.push(h)}if(!t.length)return 0;let n=e.replace(/ /g,"_"),r=n+" "+t.map(a=>a.id),s=Bp[r];if(s)return s.id;let o=Bp[r]=Pe.define({id:Lp.length,name:n,props:[fn({[n]:t})]});return Lp.push(o),o.id}var TT={rtl:M.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:H.RTL}),ltr:M.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:H.LTR}),auto:M.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})};var Gw=i=>{let{state:e}=i,t=e.doc.lineAt(e.selection.main.from),n=nc(i.state,t.from);return n.line?Yw(i):n.block?Jw(i):!1};function ic(i,e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=i(e,t);return r?(n(t.update(r)),!0):!1}}var Yw=ic(tv,0);var Zw=ic(fm,0);var Jw=ic((i,e)=>fm(i,e,ev(e)),0);function nc(i,e){let t=i.languageDataAt("commentTokens",e);return t.length?t[0]:{}}var Qr=50;function Kw(i,{open:e,close:t},n,r){let s=i.sliceDoc(n-Qr,n),o=i.sliceDoc(r,r+Qr),a=/\s*$/.exec(s)[0].length,l=/^\s*/.exec(o)[0].length,h=s.length-a;if(s.slice(h-e.length,h)==e&&o.slice(l,l+t.length)==t)return{open:{pos:n-a,margin:a&&1},close:{pos:r+l,margin:l&&1}};let c,f;r-n<=2*Qr?c=f=i.sliceDoc(n,r):(c=i.sliceDoc(n,n+Qr),f=i.sliceDoc(r-Qr,r));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,m=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(m,m+t.length)==t?{open:{pos:n+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:r-d-t.length,margin:/\s/.test(f.charAt(m-1))?1:0}}:null}function ev(i){let e=[];for(let t of i.selection.ranges){let n=i.doc.lineAt(t.from),r=t.to<=n.to?n:i.doc.lineAt(t.to),s=e.length-1;s>=0&&e[s].to>n.from?e[s].to=r.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:r.to})}return e}function fm(i,e,t=e.selection.ranges){let n=t.map(s=>nc(e,s.from).block);if(!n.every(s=>s))return null;let r=t.map((s,o)=>Kw(e,n[o],s.from,s.to));if(i!=2&&!r.every(s=>s))return{changes:e.changes(t.map((s,o)=>r[o]?[]:[{from:s.from,insert:n[o].open+" "},{from:s.to,insert:" "+n[o].close}]))};if(i!=1&&r.some(s=>s)){let s=[];for(let o=0,a;or&&(s==o||o>f.from)){r=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,m=f.text.slice(u,u+h.length)==h?u:-1;us.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:a,token:l,indent:h,empty:c,single:f}of n)(f||!c)&&s.push({from:a.from+h,insert:l+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(i!=1&&n.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:a,token:l}of n)if(a>=0){let h=o.from+a,c=h+l.length;o.text[c-o.from]==" "&&c++,s.push({from:h,to:c})}return{changes:s}}return null}var Jh=Le.define(),iv=Le.define(),nv=A.define(),um=A.define({combine(i){return Te(i,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),dm=te.define({create(){return _i.empty},update(i,e){let t=e.state.facet(um),n=e.annotation(Jh);if(n){let l=ft.fromTransaction(e,n.selection),h=n.side,c=h==0?i.undone:i.done;return l?c=Ro(c,c.length,t.minDepth,l):c=Om(c,e.startState.selection),new _i(h==0?n.rest:c,h==0?c:n.rest)}let r=e.annotation(iv);if((r=="full"||r=="before")&&(i=i.isolate()),e.annotation(fe.addToHistory)===!1)return e.changes.empty?i:i.addMapping(e.changes.desc);let s=ft.fromTransaction(e),o=e.annotation(fe.time),a=e.annotation(fe.userEvent);return s?i=i.addChanges(s,o,a,t,e):e.selection&&(i=i.addSelection(e.startState.selection,o,a,t.newGroupDelay)),(r=="full"||r=="after")&&(i=i.isolate()),i},toJSON(i){return{done:i.done.map(e=>e.toJSON()),undone:i.undone.map(e=>e.toJSON())}},fromJSON(i){return new _i(i.done.map(ft.fromJSON),i.undone.map(ft.fromJSON))}});function pm(i={}){return[dm,um.of(i),E.domEventHandlers({beforeinput(e,t){let n=e.inputType=="historyUndo"?mm:e.inputType=="historyRedo"?Kh:null;return n?(e.preventDefault(),n(t)):!1}})]}function Eo(i,e){return function({state:t,dispatch:n}){if(!e&&t.readOnly)return!1;let r=t.field(dm,!1);if(!r)return!1;let s=r.pop(i,t,e);return s?(n(s),!0):!1}}var mm=Eo(0,!1),Kh=Eo(1,!1),rv=Eo(0,!0),sv=Eo(1,!0);var ft=class i{constructor(e,t,n,r,s){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=s}setSelAfter(e){return new i(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new i(e.changes&&Ae.fromJSON(e.changes),[],e.mapped&&_t.fromJSON(e.mapped),e.startSelection&&S.fromJSON(e.startSelection),e.selectionsAfter.map(S.fromJSON))}static fromTransaction(e,t){let n=rt;for(let r of e.startState.facet(nv)){let s=r(e);s.length&&(n=n.concat(s))}return!n.length&&e.changes.empty?null:new i(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,rt)}static selection(e){return new i(void 0,rt,void 0,void 0,e)}};function Ro(i,e,t,n){let r=e+1>t+20?e-t-1:0,s=i.slice(r,e);return s.push(n),s}function ov(i,e){let t=[],n=!1;return i.iterChangedRanges((r,s)=>t.push(r,s)),e.iterChangedRanges((r,s,o,a)=>{for(let l=0;l=h&&o<=c&&(n=!0)}}),n}function av(i,e){return i.ranges.length==e.ranges.length&&i.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length===0}function gm(i,e){return i.length?e.length?i.concat(e):i:e}var rt=[],lv=200;function Om(i,e){if(i.length){let t=i[i.length-1],n=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-lv));return n.length&&n[n.length-1].eq(e)?i:(n.push(e),Ro(i,i.length-1,1e9,t.setSelAfter(n)))}else return[ft.selection([e])]}function hv(i){let e=i[i.length-1],t=i.slice();return t[i.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Zh(i,e){if(!i.length)return i;let t=i.length,n=rt;for(;t;){let r=cv(i[t-1],e,n);if(r.changes&&!r.changes.empty||r.effects.length){let s=i.slice(0,t);return s[t-1]=r,s}else e=r.mapped,t--,n=r.selectionsAfter}return n.length?[ft.selection(n)]:rt}function cv(i,e,t){let n=gm(i.selectionsAfter.length?i.selectionsAfter.map(a=>a.map(e)):rt,t);if(!i.changes)return ft.selection(n);let r=i.changes.map(e),s=e.mapDesc(i.changes,!0),o=i.mapped?i.mapped.composeDesc(s):s;return new ft(r,_.mapEffects(i.effects,e),o,i.startSelection.map(s),n)}var fv=/^(input\.type|delete)($|\.)/,_i=class i{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new i(this.done,this.undone):this}addChanges(e,t,n,r,s){let o=this.done,a=o[o.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!n||fv.test(n))&&(!a.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?i.moveByChar(t,e):Ao(t,e))}function Ce(i){return i.textDirectionAt(i.state.selection.main.head)==H.LTR}var wm=i=>bm(i,!Ce(i)),vm=i=>bm(i,Ce(i));function xm(i,e){return ut(i,t=>t.empty?i.moveByGroup(t,e):Ao(t,e))}var uv=i=>xm(i,!Ce(i)),dv=i=>xm(i,Ce(i));var DT=typeof Intl<"u"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"word"}):null;function pv(i,e,t){if(e.type.prop(t))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(i.sliceDoc(e.from,e.to)))||e.firstChild}function Qo(i,e,t){let n=he(i).resolveInner(e.head),r=t?$.closedBy:$.openedBy;for(let l=e.head;;){let h=t?n.childAfter(l):n.childBefore(l);if(!h)break;pv(i,h,r)?n=h:l=t?h.to:h.from}let s=n.type.prop(r),o,a;return s&&(o=t?ct(i,n.from,1):ct(i,n.to,-1))&&o.matched?a=t?o.end.to:o.end.from:a=t?n.to:n.from,S.cursor(a,t?-1:1)}var mv=i=>ut(i,e=>Qo(i.state,e,!Ce(i))),gv=i=>ut(i,e=>Qo(i.state,e,Ce(i)));function km(i,e){return ut(i,t=>{if(!t.empty)return Ao(t,e);let n=i.moveVertically(t,e);return n.head!=t.head?n:i.moveToLineBoundary(t,e)})}var Sm=i=>km(i,!1),Tm=i=>km(i,!0);function Pm(i){let e=i.scrollDOM.clientHeighto.empty?i.moveVertically(o,e,t.height):Ao(o,e));if(r.eq(n.selection))return!1;let s;if(t.selfScroll){let o=i.coordsAtPos(n.selection.main.head),a=i.scrollDOM.getBoundingClientRect(),l=a.top+t.marginTop,h=a.bottom-t.marginBottom;o&&o.top>l&&o.bottomCm(i,!1),ec=i=>Cm(i,!0);function ri(i,e,t){let n=i.lineBlockAt(e.head),r=i.moveToLineBoundary(e,t);if(r.head==e.head&&r.head!=(t?n.to:n.from)&&(r=i.moveToLineBoundary(e,t,!1)),!t&&r.head==n.from&&n.length){let s=/^\s*/.exec(i.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;s&&e.head!=n.from+s&&(r=S.cursor(n.from+s))}return r}var Ov=i=>ut(i,e=>ri(i,e,!0)),yv=i=>ut(i,e=>ri(i,e,!1)),bv=i=>ut(i,e=>ri(i,e,!Ce(i))),wv=i=>ut(i,e=>ri(i,e,Ce(i))),vv=i=>ut(i,e=>S.cursor(i.lineBlockAt(e.head).from,1)),xv=i=>ut(i,e=>S.cursor(i.lineBlockAt(e.head).to,-1));function kv(i,e,t){let n=!1,r=On(i.selection,s=>{let o=ct(i,s.head,-1)||ct(i,s.head,1)||s.head>0&&ct(i,s.head-1,1)||s.headkv(i,e,!1);function st(i,e){let t=On(i.state.selection,n=>{let r=e(n);return S.range(n.anchor,r.head,r.goalColumn,r.bidiLevel||void 0)});return t.eq(i.state.selection)?!1:(i.dispatch(Pt(i.state,t)),!0)}function Rm(i,e){return st(i,t=>i.moveByChar(t,e))}var Em=i=>Rm(i,!Ce(i)),Am=i=>Rm(i,Ce(i));function Qm(i,e){return st(i,t=>i.moveByGroup(t,e))}var Tv=i=>Qm(i,!Ce(i)),Pv=i=>Qm(i,Ce(i));var Cv=i=>st(i,e=>Qo(i.state,e,!Ce(i))),Rv=i=>st(i,e=>Qo(i.state,e,Ce(i)));function Mm(i,e){return st(i,t=>i.moveVertically(t,e))}var _m=i=>Mm(i,!1),Dm=i=>Mm(i,!0);function $m(i,e){return st(i,t=>i.moveVertically(t,e,Pm(i).height))}var sm=i=>$m(i,!1),om=i=>$m(i,!0),Ev=i=>st(i,e=>ri(i,e,!0)),Av=i=>st(i,e=>ri(i,e,!1)),Qv=i=>st(i,e=>ri(i,e,!Ce(i))),Mv=i=>st(i,e=>ri(i,e,Ce(i))),_v=i=>st(i,e=>S.cursor(i.lineBlockAt(e.head).from)),Dv=i=>st(i,e=>S.cursor(i.lineBlockAt(e.head).to)),am=({state:i,dispatch:e})=>(e(Pt(i,{anchor:0})),!0),lm=({state:i,dispatch:e})=>(e(Pt(i,{anchor:i.doc.length})),!0),hm=({state:i,dispatch:e})=>(e(Pt(i,{anchor:i.selection.main.anchor,head:0})),!0),cm=({state:i,dispatch:e})=>(e(Pt(i,{anchor:i.selection.main.anchor,head:i.doc.length})),!0),$v=({state:i,dispatch:e})=>(e(i.update({selection:{anchor:0,head:i.doc.length},userEvent:"select"})),!0),Vv=({state:i,dispatch:e})=>{let t=Mo(i).map(({from:n,to:r})=>S.range(n,Math.min(r+1,i.doc.length)));return e(i.update({selection:S.create(t),userEvent:"select"})),!0},Lv=({state:i,dispatch:e})=>{let t=On(i.selection,n=>{var r;let s=he(i).resolveStack(n.from,1);for(let o=s;o;o=o.next){let{node:a}=o;if((a.from=n.to||a.to>n.to&&a.from<=n.from)&&(!((r=a.parent)===null||r===void 0)&&r.parent))return S.range(a.to,a.from)}return n});return e(Pt(i,t)),!0},qv=({state:i,dispatch:e})=>{let t=i.selection,n=null;return t.ranges.length>1?n=S.create([t.main]):t.main.empty||(n=S.create([S.cursor(t.main.head)])),n?(e(Pt(i,n)),!0):!1};function Mr(i,e){if(i.state.readOnly)return!1;let t="delete.selection",{state:n}=i,r=n.changeByRange(s=>{let{from:o,to:a}=s;if(o==a){let l=e(s);lo&&(t="delete.forward",l=Co(i,l,!0)),o=Math.min(o,l),a=Math.max(a,l)}else o=Co(i,o,!1),a=Co(i,a,!0);return o==a?{range:s}:{changes:{from:o,to:a},range:S.cursor(o,or(i)))n.between(e,e,(r,s)=>{re&&(e=t?s:r)});return e}var Vm=(i,e,t)=>Mr(i,n=>{let r=n.from,{state:s}=i,o=s.doc.lineAt(r),a,l;if(t&&!e&&r>o.from&&rVm(i,!1,!0);var Lm=i=>Vm(i,!0,!1),qm=(i,e)=>Mr(i,t=>{let n=t.head,{state:r}=i,s=r.doc.lineAt(n),o=r.charCategorizer(n);for(let a=null;;){if(n==(e?s.to:s.from)){n==t.head&&s.number!=(e?r.doc.lines:1)&&(n+=e?1:-1);break}let l=ue(s.text,n-s.from,e)+s.from,h=s.text.slice(Math.min(n,l)-s.from,Math.max(n,l)-s.from),c=o(h);if(a!=null&&c!=a)break;(h!=" "||n!=t.head)&&(a=c),n=l}return n}),Bm=i=>qm(i,!1),Bv=i=>qm(i,!0),Xv=i=>Mr(i,e=>{let t=i.lineBlockAt(e.head).to;return e.headMr(i,e=>{let t=i.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),Iv=i=>Mr(i,e=>{let t=i.moveToLineBoundary(e,!0).head;return e.head{if(i.readOnly)return!1;let t=i.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:W.of(["",""])},range:S.cursor(n.from)}));return e(i.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},jv=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let t=i.changeByRange(n=>{if(!n.empty||n.from==0||n.from==i.doc.length)return{range:n};let r=n.from,s=i.doc.lineAt(r),o=r==s.from?r-1:ue(s.text,r-s.from,!1)+s.from,a=r==s.to?r+1:ue(s.text,r-s.from,!0)+s.from;return{changes:{from:o,to:a,insert:i.doc.slice(r,a).append(i.doc.slice(o,r))},range:S.cursor(a)}});return t.changes.empty?!1:(e(i.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Mo(i){let e=[],t=-1;for(let n of i.selection.ranges){let r=i.doc.lineAt(n.from),s=i.doc.lineAt(n.to);if(!n.empty&&n.to==s.from&&(s=i.doc.lineAt(n.to-1)),t>=r.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(n)}else e.push({from:r.from,to:s.to,ranges:[n]});t=s.number+1}return e}function Xm(i,e,t){if(i.readOnly)return!1;let n=[],r=[];for(let s of Mo(i)){if(t?s.to==i.doc.length:s.from==0)continue;let o=i.doc.lineAt(t?s.to+1:s.from-1),a=o.length+1;if(t){n.push({from:s.to,to:o.to},{from:s.from,insert:o.text+i.lineBreak});for(let l of s.ranges)r.push(S.range(Math.min(i.doc.length,l.anchor+a),Math.min(i.doc.length,l.head+a)))}else{n.push({from:o.from,to:s.from},{from:s.to,insert:i.lineBreak+o.text});for(let l of s.ranges)r.push(S.range(l.anchor-a,l.head-a))}}return n.length?(e(i.update({changes:n,scrollIntoView:!0,selection:S.create(r,i.selection.mainIndex),userEvent:"move.line"})),!0):!1}var zv=({state:i,dispatch:e})=>Xm(i,e,!1),Uv=({state:i,dispatch:e})=>Xm(i,e,!0);function Wm(i,e,t){if(i.readOnly)return!1;let n=[];for(let r of Mo(i))t?n.push({from:r.from,insert:i.doc.slice(r.from,r.to)+i.lineBreak}):n.push({from:r.to,insert:i.lineBreak+i.doc.slice(r.from,r.to)});return e(i.update({changes:n,scrollIntoView:!0,userEvent:"input.copyline"})),!0}var Fv=({state:i,dispatch:e})=>Wm(i,e,!1),Hv=({state:i,dispatch:e})=>Wm(i,e,!0),Gv=i=>{if(i.state.readOnly)return!1;let{state:e}=i,t=e.changes(Mo(e).map(({from:r,to:s})=>(r>0?r--:s{let s;if(i.lineWrapping){let o=i.lineBlockAt(r.head),a=i.coordsAtPos(r.head,r.assoc||1);a&&(s=o.bottom+i.documentTop-a.bottom+i.defaultLineHeight/2)}return i.moveVertically(r,!0,s)}).map(t);return i.dispatch({changes:t,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Yv(i,e){if(/\(\)|\[\]|\{\}/.test(i.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=he(i).resolveInner(e),n=t.childBefore(e),r=t.childAfter(e),s;return n&&r&&n.to<=e&&r.from>=e&&(s=n.type.prop($.closedBy))&&s.indexOf(r.name)>-1&&i.doc.lineAt(n.to).from==i.doc.lineAt(r.from).from&&!/\S/.test(i.sliceDoc(n.to,r.from))?{from:n.to,to:r.from}:null}var Zv=Im(!1),Jv=Im(!0);function Im(i){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{let{from:s,to:o}=r,a=e.doc.lineAt(s),l=!i&&s==o&&Yv(e,s);i&&(s=o=(o<=a.to?a:e.doc.lineAt(o)).to);let h=new Ai(e,{simulateBreak:s,simulateDoubleBreak:!!l}),c=So(h,s);for(c==null&&(c=$t(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));oa.from&&s{let r=[];for(let o=n.from;o<=n.to;){let a=i.doc.lineAt(o);a.number>t&&(n.empty||n.to>a.from)&&(e(a,r,n),t=a.number),o=a.to+1}let s=i.changes(r);return{changes:r,range:S.range(s.mapPos(n.anchor,1),s.mapPos(n.head,1))}})}var Kv=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let t=Object.create(null),n=new Ai(i,{overrideIndentation:s=>{let o=t[s];return o??-1}}),r=rc(i,(s,o,a)=>{let l=So(n,s.from);if(l==null)return;/\S/.test(s.text)||(l=0);let h=/^\s*/.exec(s.text)[0],c=gn(i,l);(h!=c||a.fromi.readOnly?!1:(e(i.update(rc(i,(t,n)=>{n.push({from:t.from,insert:i.facet(mn)})}),{userEvent:"input.indent"})),!0),tx=({state:i,dispatch:e})=>i.readOnly?!1:(e(i.update(rc(i,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let s=$t(r,i.tabSize),o=0,a=gn(i,Math.max(0,s-Pr(i)));for(;o(i.setTabFocusMode(),!0);var nx=[{key:"Ctrl-b",run:wm,shift:Em,preventDefault:!0},{key:"Ctrl-f",run:vm,shift:Am},{key:"Ctrl-p",run:Sm,shift:_m},{key:"Ctrl-n",run:Tm,shift:Dm},{key:"Ctrl-a",run:vv,shift:_v},{key:"Ctrl-e",run:xv,shift:Dv},{key:"Ctrl-d",run:Lm},{key:"Ctrl-h",run:tc},{key:"Ctrl-k",run:Xv},{key:"Ctrl-Alt-h",run:Bm},{key:"Ctrl-o",run:Nv},{key:"Ctrl-t",run:jv},{key:"Ctrl-v",run:ec}],rx=[{key:"ArrowLeft",run:wm,shift:Em,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:uv,shift:Tv,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:bv,shift:Qv,preventDefault:!0},{key:"ArrowRight",run:vm,shift:Am,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:dv,shift:Pv,preventDefault:!0},{mac:"Cmd-ArrowRight",run:wv,shift:Mv,preventDefault:!0},{key:"ArrowUp",run:Sm,shift:_m,preventDefault:!0},{mac:"Cmd-ArrowUp",run:am,shift:hm},{mac:"Ctrl-ArrowUp",run:rm,shift:sm},{key:"ArrowDown",run:Tm,shift:Dm,preventDefault:!0},{mac:"Cmd-ArrowDown",run:lm,shift:cm},{mac:"Ctrl-ArrowDown",run:ec,shift:om},{key:"PageUp",run:rm,shift:sm},{key:"PageDown",run:ec,shift:om},{key:"Home",run:yv,shift:Av,preventDefault:!0},{key:"Mod-Home",run:am,shift:hm},{key:"End",run:Ov,shift:Ev,preventDefault:!0},{key:"Mod-End",run:lm,shift:cm},{key:"Enter",run:Zv},{key:"Mod-a",run:$v},{key:"Backspace",run:tc,shift:tc},{key:"Delete",run:Lm},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Bm},{key:"Mod-Delete",mac:"Alt-Delete",run:Bv},{mac:"Mod-Backspace",run:Wv},{mac:"Mod-Delete",run:Iv}].concat(nx.map(i=>({mac:i.key,run:i.run,shift:i.shift}))),Nm=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:mv,shift:Cv},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:gv,shift:Rv},{key:"Alt-ArrowUp",run:zv},{key:"Shift-Alt-ArrowUp",run:Fv},{key:"Alt-ArrowDown",run:Uv},{key:"Shift-Alt-ArrowDown",run:Hv},{key:"Escape",run:qv},{key:"Mod-Enter",run:Jv},{key:"Alt-l",mac:"Ctrl-l",run:Vv},{key:"Mod-i",run:Lv,preventDefault:!0},{key:"Mod-[",run:tx},{key:"Mod-]",run:ex},{key:"Mod-Alt-\\",run:Kv},{key:"Shift-Mod-k",run:Gv},{key:"Shift-Mod-\\",run:Sv},{key:"Mod-/",run:Gw},{key:"Alt-A",run:Zw},{key:"Ctrl-m",mac:"Shift-Alt-m",run:ix}].concat(rx);function U(){var i=arguments[0];typeof i=="string"&&(i=document.createElement(i));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=t[n];typeof r=="string"?i.setAttribute(n,r):r!=null&&(i[n]=r)}e++}for(;ei.normalize("NFKD"):i=>i,oi=class{constructor(e,t,n=0,r=e.length,s,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=s?a=>s(zm(a)):zm,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return ce(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Fn(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Ee(e);let r=this.normalize(t);for(let s=0,o=n;;s++){let a=r.charCodeAt(s),l=this.match(a,o,this.bufferPos+this.bufferStart);if(s==r.length-1){if(l)return this.value=l,this;break}o==n&&sthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=qo(this.text,r+(n==r?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(nthis.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=n||r.to<=t){let a=new i(t,e.sliceString(t,n));return sc.set(e,a),a}if(r.from==t&&r.to==n)return r;let{text:s,from:o}=r;return o>t&&(s=e.sliceString(t,o)+s,o=t),r.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let n=this.flat.from+t.index,r=n+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this.matchPos=qo(this.text,r+(n==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Vo.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<"u"&&($o.prototype[Symbol.iterator]=Lo.prototype[Symbol.iterator]=function(){return this});function sx(i){try{return new RegExp(i,fc),!0}catch{return!1}}function qo(i,e){if(e>=i.length)return e;let t=i.lineAt(e),n;for(;e=56320&&n<57344;)e++;return e}function oc(i){let e=String(i.state.doc.lineAt(i.state.selection.main.head).number),t=U("input",{class:"cm-textfield",name:"line",value:e}),n=U("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),i.dispatch({effects:Bo.of(!1)}),i.focus()):s.keyCode==13&&(s.preventDefault(),r())},onsubmit:s=>{s.preventDefault(),r()}},U("label",i.state.phrase("Go to line"),": ",t)," ",U("button",{class:"cm-button",type:"submit"},i.state.phrase("go")));function r(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!s)return;let{state:o}=i,a=o.doc.lineAt(o.selection.main.head),[,l,h,c,f]=s,u=c?+c.slice(1):0,d=h?+h:a.number;if(h&&f){let g=d/100;l&&(g=g*(l=="-"?-1:1)+a.number/o.doc.lines),d=Math.round(o.doc.lines*g)}else h&&l&&(d=d*(l=="-"?-1:1)+a.number);let m=o.doc.line(Math.max(1,Math.min(o.doc.lines,d))),p=S.cursor(m.from+Math.max(0,Math.min(u,m.length)));i.dispatch({effects:[Bo.of(!1),E.scrollIntoView(p.from,{y:"center"})],selection:p}),i.focus()}return{dom:n}}var Bo=_.define(),Um=te.define({create(){return!0},update(i,e){for(let t of e.effects)t.is(Bo)&&(i=t.value);return i},provide:i=>Ti.from(i,e=>e?oc:null)}),ox=i=>{let e=Pi(i,oc);if(!e){let t=[Bo.of(!0)];i.state.field(Um,!1)==null&&t.push(_.appendConfig.of([Um,ax])),i.dispatch({effects:t}),e=Pi(i,oc)}return e&&e.dom.querySelector("input").select(),!0},ax=E.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),lx={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Ym=A.define({combine(i){return Te(i,lx,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function Zm(i){let e=[dx,ux];return i&&e.push(Ym.of(i)),e}var hx=M.mark({class:"cm-selectionMatch"}),cx=M.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Fm(i,e,t,n){return(t==0||i(e.sliceDoc(t-1,t))!=F.Word)&&(n==e.doc.length||i(e.sliceDoc(n,n+1))!=F.Word)}function fx(i,e,t,n){return i(e.sliceDoc(t,t+1))==F.Word&&i(e.sliceDoc(n-1,n))==F.Word}var ux=re.fromClass(class{constructor(i){this.decorations=this.getDeco(i)}update(i){(i.selectionSet||i.docChanged||i.viewportChanged)&&(this.decorations=this.getDeco(i.view))}getDeco(i){let e=i.state.facet(Ym),{state:t}=i,n=t.selection;if(n.ranges.length>1)return M.none;let r=n.main,s,o=null;if(r.empty){if(!e.highlightWordAroundCursor)return M.none;let l=t.wordAt(r.head);if(!l)return M.none;o=t.charCategorizer(r.head),s=t.sliceDoc(l.from,l.to)}else{let l=r.to-r.from;if(l200)return M.none;if(e.wholeWords){if(s=t.sliceDoc(r.from,r.to),o=t.charCategorizer(r.head),!(Fm(o,t,r.from,r.to)&&fx(o,t,r.from,r.to)))return M.none}else if(s=t.sliceDoc(r.from,r.to),!s)return M.none}let a=[];for(let l of i.visibleRanges){let h=new oi(t.doc,s,l.from,l.to);for(;!h.next().done;){let{from:c,to:f}=h.value;if((!o||Fm(o,t,c,f))&&(r.empty&&c<=r.from&&f>=r.to?a.push(cx.range(c,f)):(c>=r.to||f<=r.from)&&a.push(hx.range(c,f)),a.length>e.maxMatches))return M.none}}return M.set(a)}},{decorations:i=>i.decorations}),dx=E.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),px=({state:i,dispatch:e})=>{let{selection:t}=i,n=S.create(t.ranges.map(r=>i.wordAt(r.head)||S.cursor(r.head)),t.mainIndex);return n.eq(t)?!1:(e(i.update({selection:n})),!0)};function mx(i,e){let{main:t,ranges:n}=i.selection,r=i.wordAt(t.head),s=r&&r.from==t.from&&r.to==t.to;for(let o=!1,a=new oi(i.doc,e,n[n.length-1].to);;)if(a.next(),a.done){if(o)return null;a=new oi(i.doc,e,0,Math.max(0,n[n.length-1].from-1)),o=!0}else{if(o&&n.some(l=>l.from==a.value.from))continue;if(s){let l=i.wordAt(a.value.from);if(!l||l.from!=a.value.from||l.to!=a.value.to)continue}return a.value}}var gx=({state:i,dispatch:e})=>{let{ranges:t}=i.selection;if(t.some(s=>s.from===s.to))return px({state:i,dispatch:e});let n=i.sliceDoc(t[0].from,t[0].to);if(i.selection.ranges.some(s=>i.sliceDoc(s.from,s.to)!=n))return!1;let r=mx(i,n);return r?(e(i.update({selection:i.selection.addRange(S.range(r.from,r.to),!1),effects:E.scrollIntoView(r.to)})),!0):!1},wn=A.define({combine(i){return Te(i,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new cc(e),scrollToMatch:e=>E.scrollIntoView(e)})}});var Xo=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||sx(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,n)=>n=="n"?` +`:n=="r"?"\r":n=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new lc(this):new ac(this)}getCursor(e,t=0,n){let r=e.doc?e:N.create({doc:e});return n==null&&(n=r.doc.length),this.regexp?bn(this,r,t,n):yn(this,r,t,n)}},Wo=class{constructor(e){this.spec=e}};function yn(i,e,t,n){return new oi(e.doc,i.unquoted,t,n,i.caseSensitive?void 0:r=>r.toLowerCase(),i.wholeWord?Ox(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function Ox(i,e){return(t,n,r,s)=>((s>t||s+r.length=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let s=yn(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}};function bn(i,e,t,n){return new $o(e.doc,i.search,{ignoreCase:!i.caseSensitive,test:i.wholeWord?yx(e.charCategorizer(e.selection.main.head)):void 0},t,n)}function Io(i,e){return i.slice(ue(i,e,!1),e)}function No(i,e){return i.slice(e,ue(i,e))}function yx(i){return(e,t,n)=>!n[0].length||(i(Io(n.input,n.index))!=F.Word||i(No(n.input,n.index))!=F.Word)&&(i(No(n.input,n.index+n[0].length))!=F.Word||i(Io(n.input,n.index+n[0].length))!=F.Word)}var lc=class extends Wo{nextMatch(e,t,n){let r=bn(this.spec,e,n,e.doc.length).next();return r.done&&(r=bn(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let s=Math.max(t,n-r*1e4),o=bn(this.spec,e,s,n),a=null;for(;!o.next().done;)a=o.value;if(a&&(s==t||a.from>s+10))return a;if(s==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(t,n)=>n=="$"?"$":n=="&"?e.match[0]:n!="0"&&+n=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let s=bn(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}},Dr=_.define(),uc=_.define(),si=te.define({create(i){return new _r(hc(i).create(),null)},update(i,e){for(let t of e.effects)t.is(Dr)?i=new _r(t.value.create(),i.panel):t.is(uc)&&(i=new _r(i.query,t.value?dc:null));return i},provide:i=>Ti.from(i,e=>e.panel)});var _r=class{constructor(e,t){this.query=e,this.panel=t}},bx=M.mark({class:"cm-searchMatch"}),wx=M.mark({class:"cm-searchMatch cm-searchMatch-selected"}),vx=re.fromClass(class{constructor(i){this.view=i,this.decorations=this.highlight(i.state.field(si))}update(i){let e=i.state.field(si);(e!=i.startState.field(si)||i.docChanged||i.selectionSet||i.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:i,panel:e}){if(!e||!i.spec.valid)return M.none;let{view:t}=this,n=new lt;for(let r=0,s=t.visibleRanges,o=s.length;rs[r+1].from-2*250;)l=s[++r].to;i.highlight(t.state,a,l,(h,c)=>{let f=t.state.selection.ranges.some(u=>u.from==h&&u.to==c);n.add(h,c,f?wx:bx)})}return n.finish()}},{decorations:i=>i.decorations});function $r(i){return e=>{let t=e.state.field(si,!1);return t&&t.query.spec.valid?i(e,t):eg(e)}}var jo=$r((i,{query:e})=>{let{to:t}=i.state.selection.main,n=e.nextMatch(i.state,t,t);if(!n)return!1;let r=S.single(n.from,n.to),s=i.state.facet(wn);return i.dispatch({selection:r,effects:[pc(i,n),s.scrollToMatch(r.main,i)],userEvent:"select.search"}),Km(i),!0}),zo=$r((i,{query:e})=>{let{state:t}=i,{from:n}=t.selection.main,r=e.prevMatch(t,n,n);if(!r)return!1;let s=S.single(r.from,r.to),o=i.state.facet(wn);return i.dispatch({selection:s,effects:[pc(i,r),o.scrollToMatch(s.main,i)],userEvent:"select.search"}),Km(i),!0}),xx=$r((i,{query:e})=>{let t=e.matchAll(i.state,1e3);return!t||!t.length?!1:(i.dispatch({selection:S.create(t.map(n=>S.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),kx=({state:i,dispatch:e})=>{let t=i.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:n,to:r}=t.main,s=[],o=0;for(let a=new oi(i.doc,i.sliceDoc(n,r));!a.next().done;){if(s.length>1e3)return!1;a.value.from==n&&(o=s.length),s.push(S.range(a.value.from,a.value.to))}return e(i.update({selection:S.create(s,o),userEvent:"select.search.matches"})),!0},Hm=$r((i,{query:e})=>{let{state:t}=i,{from:n,to:r}=t.selection.main;if(t.readOnly)return!1;let s=e.nextMatch(t,n,n);if(!s)return!1;let o=[],a,l,h=[];if(s.from==n&&s.to==r&&(l=t.toText(e.getReplacement(s)),o.push({from:s.from,to:s.to,insert:l}),s=e.nextMatch(t,s.from,s.to),h.push(E.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(n).number)+"."))),s){let c=o.length==0||o[0].from>=s.to?0:s.to-s.from-l.length;a=S.single(s.from-c,s.to-c),h.push(pc(i,s)),h.push(t.facet(wn).scrollToMatch(a.main,i))}return i.dispatch({changes:o,selection:a,effects:h,userEvent:"input.replace"}),!0}),Sx=$r((i,{query:e})=>{if(i.state.readOnly)return!1;let t=e.matchAll(i.state,1e9).map(r=>{let{from:s,to:o}=r;return{from:s,to:o,insert:e.getReplacement(r)}});if(!t.length)return!1;let n=i.state.phrase("replaced $ matches",t.length)+".";return i.dispatch({changes:t,effects:E.announce.of(n),userEvent:"input.replace.all"}),!0});function dc(i){return i.state.facet(wn).createPanel(i)}function hc(i,e){var t,n,r,s,o;let a=i.selection.main,l=a.empty||a.to>a.from+100?"":i.sliceDoc(a.from,a.to);if(e&&!l)return e;let h=i.facet(wn);return new Xo({search:((t=e?.literal)!==null&&t!==void 0?t:h.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(n=e?.caseSensitive)!==null&&n!==void 0?n:h.caseSensitive,literal:(r=e?.literal)!==null&&r!==void 0?r:h.literal,regexp:(s=e?.regexp)!==null&&s!==void 0?s:h.regexp,wholeWord:(o=e?.wholeWord)!==null&&o!==void 0?o:h.wholeWord})}function Jm(i){let e=Pi(i,dc);return e&&e.dom.querySelector("[main-field]")}function Km(i){let e=Jm(i);e&&e==i.root.activeElement&&e.select()}var eg=i=>{let e=i.state.field(si,!1);if(e&&e.panel){let t=Jm(i);if(t&&t!=i.root.activeElement){let n=hc(i.state,e.query.spec);n.valid&&i.dispatch({effects:Dr.of(n)}),t.focus(),t.select()}}else i.dispatch({effects:[uc.of(!0),e?Dr.of(hc(i.state,e.query.spec)):_.appendConfig.of(Px)]});return!0},tg=i=>{let e=i.state.field(si,!1);if(!e||!e.panel)return!1;let t=Pi(i,dc);return t&&t.dom.contains(i.root.activeElement)&&i.focus(),i.dispatch({effects:uc.of(!1)}),!0},ig=[{key:"Mod-f",run:eg,scope:"editor search-panel"},{key:"F3",run:jo,shift:zo,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:jo,shift:zo,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:tg,scope:"editor search-panel"},{key:"Mod-Shift-l",run:kx},{key:"Mod-Alt-g",run:ox},{key:"Mod-d",run:gx,preventDefault:!0}],cc=class{constructor(e){this.view=e;let t=this.query=e.state.field(si).query.spec;this.commit=this.commit.bind(this),this.searchField=U("input",{value:t.search,placeholder:Fe(e,"Find"),"aria-label":Fe(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=U("input",{value:t.replace,placeholder:Fe(e,"Replace"),"aria-label":Fe(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=U("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=U("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=U("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function n(r,s,o){return U("button",{class:"cm-button",name:r,onclick:s,type:"button"},o)}this.dom=U("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,n("next",()=>jo(e),[Fe(e,"next")]),n("prev",()=>zo(e),[Fe(e,"previous")]),n("select",()=>xx(e),[Fe(e,"all")]),U("label",null,[this.caseField,Fe(e,"match case")]),U("label",null,[this.reField,Fe(e,"regexp")]),U("label",null,[this.wordField,Fe(e,"by word")]),...e.state.readOnly?[]:[U("br"),this.replaceField,n("replace",()=>Hm(e),[Fe(e,"replace")]),n("replaceAll",()=>Sx(e),[Fe(e,"replace all")])],U("button",{name:"close",onclick:()=>tg(e),"aria-label":Fe(e,"close"),type:"button"},["\xD7"])])}commit(){let e=new Xo({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Dr.of(e)}))}keydown(e){lp(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?zo:jo)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Hm(this.view))}update(e){for(let t of e.transactions)for(let n of t.effects)n.is(Dr)&&!n.value.eq(this.query)&&this.setQuery(n.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(wn).top}};function Fe(i,e){return i.state.phrase(e)}var _o=30,Do=/[\s\.,:;?!]/;function pc(i,{from:e,to:t}){let n=i.state.doc.lineAt(e),r=i.state.doc.lineAt(t).to,s=Math.max(n.from,e-_o),o=Math.min(r,t+_o),a=i.state.sliceDoc(s,o);if(s!=n.from){for(let l=0;l<_o;l++)if(!Do.test(a[l+1])&&Do.test(a[l])){a=a.slice(l);break}}if(o!=r){for(let l=a.length-1;l>a.length-_o;l--)if(!Do.test(a[l-1])&&Do.test(a[l])){a=a.slice(0,l);break}}return E.announce.of(`${i.state.phrase("current match")}. ${a} ${i.state.phrase("on line")} ${n.number}.`)}var Tx=E.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Px=[si,Qe.low(vx),Tx];var Fo=class{constructor(e,t,n){this.state=e,this.pos=t,this.explicit=n,this.abortListeners=[]}tokenBefore(e){let t=he(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),s=r.search(ug(e,!1));return s<0?null:{from:n+s,to:this.pos,text:r.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,t){e=="abort"&&this.abortListeners&&this.abortListeners.push(t)}};function ng(i){let e=Object.keys(i).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function Cx(i){let e=Object.create(null),t=Object.create(null);for(let{label:r}of i){e[r[0]]=!0;for(let s=1;stypeof r=="string"?{label:r}:r),[t,n]=e.every(r=>/^\w+$/.test(r.label))?[/\w*$/,/\w+$/]:Cx(e);return r=>{let s=r.matchBefore(n);return s||r.explicit?{from:s?s.from:r.pos,options:e,validFor:t}:null}}function fg(i,e){return t=>{for(let n=he(t.state).resolveInner(t.pos,-1);n;n=n.parent){if(i.indexOf(n.name)>-1)return null;if(n.type.isTop)break}return e(t)}}var Ho=class{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}};function ai(i){return i.selection.main.from}function ug(i,e){var t;let{source:n}=i,r=e&&n[0]!="^",s=n[n.length-1]!="$";return!r&&!s?i:new RegExp(`${r?"^":""}(?:${n})${s?"$":""}`,(t=i.flags)!==null&&t!==void 0?t:i.ignoreCase?"i":"")}var Rc=Le.define();function Rx(i,e,t,n){let{main:r}=i.selection,s=t-r.from,o=n-r.from;return Object.assign(Object.assign({},i.changeByRange(a=>a!=r&&t!=n&&i.sliceDoc(a.from+s,a.from+o)!=i.sliceDoc(t,n)?{range:a}:{changes:{from:a.from+s,to:n==r.from?a.to:a.from+o,insert:e},range:S.cursor(a.from+s+e.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}var rg=new WeakMap;function Ex(i){if(!Array.isArray(i))return i;let e=rg.get(i);return e||rg.set(i,e=Cc(i)),e}var Go=_.define(),Vr=_.define(),Oc=class{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t=48&&w<=57||w>=97&&w<=122?2:w>=65&&w<=90?1:0:(P=Fn(w))!=P.toLowerCase()?1:P!=P.toUpperCase()?2:0;(!y||C==1&&g||x==0&&C!=0)&&(t[f]==w||n[f]==w&&(u=!0)?o[f++]=y:o.length&&(O=!1)),x=C,y+=Ee(w)}return f==l&&o[0]==0&&O?this.result(-100+(u?-200:0),o,e):d==l&&m==0?this.ret(-200-e.length+(p==e.length?0:-100),[0,p]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):d==l?this.ret(-900-e.length,[m,p]):f==l?this.result(-100+(u?-200:0)+-700+(O?0:-1100),o,e):t.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],s=0;for(let o of t){let a=o+(this.astral?Ee(ce(n,o)):1);s&&r[s-1]==o?r[s-1]=a:(r[s++]=o,r[s++]=a)}return this.ret(e-n.length,r)}},yc=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Ax,filterStrict:!1,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>sg(e(n),t(n)),optionClass:(e,t)=>n=>sg(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function sg(i,e){return i?e?i+" "+e:i:e}function Ax(i,e,t,n,r,s){let o=i.textDirection==H.RTL,a=o,l=!1,h="top",c,f,u=e.left-r.left,d=r.right-e.right,m=n.right-n.left,p=n.bottom-n.top;if(a&&u=p||y>e.top?c=t.bottom-e.top:(h="bottom",c=e.bottom-t.top)}let g=(e.bottom-e.top)/s.offsetHeight,O=(e.right-e.left)/s.offsetWidth;return{style:`${h}: ${c/g}px; max-width: ${f/O}px`,class:"cm-completionInfo-"+(l?o?"left-narrow":"right-narrow":a?"left":"right")}}function Qx(i){let e=i.addToOptions.slice();return i.icons&&e.push({render(t){let n=document.createElement("div");return n.classList.add("cm-completionIcon"),t.type&&n.classList.add(...t.type.split(/\s+/g).map(r=>"cm-completionIcon-"+r)),n.setAttribute("aria-hidden","true"),n},position:20}),e.push({render(t,n,r,s){let o=document.createElement("span");o.className="cm-completionLabel";let a=t.displayLabel||t.label,l=0;for(let h=0;hl&&o.appendChild(document.createTextNode(a.slice(l,c)));let u=o.appendChild(document.createElement("span"));u.appendChild(document.createTextNode(a.slice(c,f))),u.className="cm-completionMatchedText",l=f}return lt.position-n.position).map(t=>t.render)}function mc(i,e,t){if(i<=t)return{from:0,to:i};if(e<0&&(e=0),e<=i>>1){let r=Math.floor(e/t);return{from:r*t,to:(r+1)*t}}let n=Math.floor((i-e)/t);return{from:i-(n+1)*t,to:i-n*t}}var bc=class{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let r=e.state.field(t),{options:s,selected:o}=r.open,a=e.state.facet(ve);this.optionContent=Qx(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=mc(s.length,o,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",l=>{let{options:h}=e.state.field(t).open;for(let c=l.target,f;c&&c!=this.dom;c=c.parentNode)if(c.nodeName=="LI"&&(f=/-(\d+)$/.exec(c.id))&&+f[1]{let h=e.state.field(this.stateField,!1);h&&h.tooltip&&e.state.facet(ve).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:Vr.of(null)})}),this.showOptions(s,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let n=e.state.field(this.stateField),r=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=r){let{options:s,selected:o,disabled:a}=n.open;(!r.open||r.open.options!=s)&&(this.range=mc(s.length,o,e.state.facet(ve).maxRenderedOptions),this.showOptions(s,n.id)),this.updateSel(),a!=((t=r.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let n of this.currentClass.split(" "))n&&this.dom.classList.remove(n);for(let n of t.split(" "))n&&this.dom.classList.add(n);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected=this.range.to)&&(this.range=mc(t.options.length,t.selected,this.view.state.facet(ve).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:n}=t.options[t.selected],{info:r}=n;if(!r)return;let s=typeof r=="string"?document.createTextNode(r):r(n);if(!s)return;"then"in s?s.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o,n)}).catch(o=>we(this.view.state,o,"completion info")):this.addInfoPane(s,n)}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:r,destroy:s}=e;n.appendChild(r),this.infoDestroy=s||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)n.nodeName!="LI"||!n.id?r--:r==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&n.removeAttribute("aria-selected");return t&&_x(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),s=this.space;if(!s){let o=this.dom.ownerDocument.defaultView||window;s={left:0,top:0,right:o.innerWidth,bottom:o.innerHeight}}return r.top>Math.min(s.bottom,t.bottom)-10||r.bottomn.from||n.from==0))if(s=u,typeof h!="string"&&h.header)r.appendChild(h.header(h));else{let d=r.appendChild(document.createElement("completion-section"));d.textContent=u}}let c=r.appendChild(document.createElement("li"));c.id=t+"-"+o,c.setAttribute("role","option");let f=this.optionClass(a);f&&(c.className=f);for(let u of this.optionContent){let d=u(a,this.view.state,this.view,l);d&&c.appendChild(d)}}return n.from&&r.classList.add("cm-completionListIncompleteTop"),n.tonew bc(t,i,e)}function _x(i,e){let t=i.getBoundingClientRect(),n=e.getBoundingClientRect(),r=t.height/i.offsetHeight;n.topt.bottom&&(i.scrollTop+=(n.bottom-t.bottom)/r)}function og(i){return(i.boost||0)*100+(i.apply?10:0)+(i.info?5:0)+(i.type?1:0)}function Dx(i,e){let t=[],n=null,r=h=>{t.push(h);let{section:c}=h.completion;if(c){n||(n=[]);let f=typeof c=="string"?c:c.name;n.some(u=>u.name==f)||n.push(typeof c=="string"?{name:f}:c)}},s=e.facet(ve);for(let h of i)if(h.hasResult()){let c=h.result.getMatch;if(h.result.filter===!1)for(let f of h.result.options)r(new Ho(f,h.source,c?c(f):[],1e9-t.length));else{let f=e.sliceDoc(h.from,h.to),u,d=s.filterStrict?new yc(f):new Oc(f);for(let m of h.result.options)if(u=d.match(m.label)){let p=m.displayLabel?c?c(m,u.matched):[]:u.matched;r(new Ho(m,h.source,p,u.score+(m.boost||0)))}}}if(n){let h=Object.create(null),c=0,f=(u,d)=>{var m,p;return((m=u.rank)!==null&&m!==void 0?m:1e9)-((p=d.rank)!==null&&p!==void 0?p:1e9)||(u.namef.score-c.score||l(c.completion,f.completion))){let c=h.completion;!a||a.label!=c.label||a.detail!=c.detail||a.type!=null&&c.type!=null&&a.type!=c.type||a.apply!=c.apply||a.boost!=c.boost?o.push(h):og(h.completion)>og(a)&&(o[o.length-1]=h),a=h.completion}return o}var wc=class i{constructor(e,t,n,r,s,o){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=s,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new i(this.options,ag(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,r,s){let o=Dx(e,t);if(!o.length)return r&&e.some(l=>l.state==1)?new i(r.options,r.attrs,r.tooltip,r.timestamp,r.selected,!0):null;let a=t.facet(ve).selectOnOpen?0:-1;if(r&&r.selected!=a&&r.selected!=-1){let l=r.options[r.selected].completion;for(let h=0;hh.hasResult()?Math.min(l,h.from):l,1e8),create:Xx,above:s.aboveCursor},r?r.timestamp:Date.now(),a,!1)}map(e){return new i(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}},vc=class i{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new i(qx,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,n=t.facet(ve),s=(n.override||t.languageDataAt("autocomplete",ai(t)).map(Ex)).map(a=>(this.active.find(h=>h.source==a)||new Ct(a,this.active.some(h=>h.state!=0)?1:0)).update(e,n));s.length==this.active.length&&s.every((a,l)=>a==this.active[l])&&(s=this.active);let o=this.open;o&&e.docChanged&&(o=o.map(e.changes)),e.selection||s.some(a=>a.hasResult()&&e.changes.touchesRange(a.from,a.to))||!$x(s,this.active)?o=wc.build(s,t,this.id,o,n):o&&o.disabled&&!s.some(a=>a.state==1)&&(o=null),!o&&s.every(a=>a.state!=1)&&s.some(a=>a.hasResult())&&(s=s.map(a=>a.hasResult()?new Ct(a.source,0):a));for(let a of e.effects)a.is(pg)&&(o=o&&o.setSelected(a.value,this.id));return s==this.active&&o==this.open?this:new i(s,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?Vx:Lx}};function $x(i,e){if(i==e)return!0;for(let t=0,n=0;;){for(;t-1&&(t["aria-activedescendant"]=i+"-"+e),t}var qx=[];function xc(i,e){if(i.isUserEvent("input.complete")){let t=i.annotation(Rc);if(t&&e.activateOnCompletion(t))return"input"}return i.isUserEvent("input.type")?"input":i.isUserEvent("delete.backward")?"delete":null}var Ct=class i{constructor(e,t,n=-1){this.source=e,this.state=t,this.explicitPos=n}hasResult(){return!1}update(e,t){let n=xc(e,t),r=this;n?r=r.handleUserEvent(e,n,t):e.docChanged?r=r.handleChange(e):e.selection&&r.state!=0&&(r=new i(r.source,0));for(let s of e.effects)if(s.is(Go))r=new i(r.source,1,s.value?ai(e.state):-1);else if(s.is(Vr))r=new i(r.source,0);else if(s.is(dg))for(let o of s.value)o.source==r.source&&(r=o);return r}handleUserEvent(e,t,n){return t=="delete"||!n.activateOnTyping?this.map(e.changes):new i(this.source,1)}handleChange(e){return e.changes.touchesRange(ai(e.startState))?new i(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new i(this.source,this.state,e.mapPos(this.explicitPos))}},Yo=class i extends Ct{constructor(e,t,n,r,s){super(e,2,t),this.result=n,this.from=r,this.to=s}hasResult(){return!0}handleUserEvent(e,t,n){var r;let s=this.result;s.map&&!e.changes.empty&&(s=s.map(s,e.changes));let o=e.changes.mapPos(this.from),a=e.changes.mapPos(this.to,1),l=ai(e.state);if((this.explicitPos<0?l<=o:la||!s||t=="delete"&&ai(e.startState)==this.from)return new Ct(this.source,t=="input"&&n.activateOnTyping?1:0);let h=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return Bx(s.validFor,e.state,o,a)?new i(this.source,h,s,o,a):s.update&&(s=s.update(s,o,a,new Fo(e.state,l,h>=0)))?new i(this.source,h,s,s.from,(r=s.to)!==null&&r!==void 0?r:ai(e.state)):new Ct(this.source,1,h)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new Ct(this.source,0):this.map(e.changes)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new i(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new Ct(this.source,0)}};function Bx(i,e,t,n){if(!i)return!1;let r=e.sliceDoc(t,n);return typeof i=="function"?i(r,t,n,e):ug(i,!0).test(r)}var dg=_.define({map(i,e){return i.map(t=>t.map(e))}}),pg=_.define(),Xe=te.define({create(){return vc.start()},update(i,e){return i.update(e)},provide:i=>[gr.from(i,e=>e.tooltip),E.contentAttributes.from(i,e=>e.attrs)]});function Ec(i,e){let t=e.completion.apply||e.completion.label,n=i.state.field(Xe).active.find(r=>r.source==e.source);return n instanceof Yo?(typeof t=="string"?i.dispatch(Object.assign(Object.assign({},Rx(i.state,t,n.from,n.to)),{annotations:Rc.of(e.completion)})):t(i,e.completion,n.from,n.to),!0):!1}var Xx=Mx(Xe,Ec);function Uo(i,e="option"){return t=>{let n=t.state.field(Xe,!1);if(!n||!n.open||n.open.disabled||Date.now()-n.open.timestamp-1?n.open.selected+r*(i?1:-1):i?0:o-1;return a<0?a=e=="page"?0:o-1:a>=o&&(a=e=="page"?o-1:0),t.dispatch({effects:pg.of(a)}),!0}}var Wx=i=>{let e=i.state.field(Xe,!1);return i.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampi.state.field(Xe,!1)?(i.dispatch({effects:Go.of(!0)}),!0):!1,Nx=i=>{let e=i.state.field(Xe,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(i.dispatch({effects:Vr.of(null)}),!0)},kc=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},jx=50,zx=1e3,Ux=re.fromClass(class{constructor(i){this.view=i,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of i.state.field(Xe).active)e.state==1&&this.startQuery(e)}update(i){let e=i.state.field(Xe),t=i.state.facet(ve);if(!i.selectionSet&&!i.docChanged&&i.startState.field(Xe)==e)return;let n=i.transactions.some(s=>(s.selection||s.docChanged)&&!xc(s,t));for(let s=0;sjx&&Date.now()-o.time>zx){for(let a of o.context.abortListeners)try{a()}catch(l){we(this.view.state,l)}o.context.abortListeners=null,this.running.splice(s--,1)}else o.updates.push(...i.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),i.transactions.some(s=>s.effects.some(o=>o.is(Go)))&&(this.pendingStart=!0);let r=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(s=>s.state==1&&!this.running.some(o=>o.active.source==s.source))?setTimeout(()=>this.startUpdate(),r):-1,this.composing!=0)for(let s of i.transactions)xc(s,t)=="input"?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:i}=this.view,e=i.field(Xe);for(let t of e.active)t.state==1&&!this.running.some(n=>n.active.source==t.source)&&this.startQuery(t)}startQuery(i){let{state:e}=this.view,t=ai(e),n=new Fo(e,t,i.explicitPos==t),r=new kc(i,n);this.running.push(r),Promise.resolve(i.source(n)).then(s=>{r.context.aborted||(r.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:Vr.of(null)}),we(this.view.state,s)})}scheduleAccept(){this.running.every(i=>i.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(ve).updateSyncTime))}accept(){var i;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(ve);for(let n=0;no.source==r.active.source);if(s&&s.state==1)if(r.done==null){let o=new Ct(r.active.source,0);for(let a of r.updates)o=o.update(a,t);o.state!=1&&e.push(o)}else this.startQuery(s)}e.length&&this.view.dispatch({effects:dg.of(e)})}},{eventHandlers:{blur(i){let e=this.view.state.field(Xe,!1);if(e&&e.tooltip&&this.view.state.facet(ve).closeOnBlur){let t=e.open&&Sh(this.view,e.open.tooltip);(!t||!t.dom.contains(i.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Vr.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Go.of(!1)}),20),this.composing=0}}}),Fx=typeof navigator=="object"&&/Win/.test(navigator.platform),Hx=Qe.highest(E.domEventHandlers({keydown(i,e){let t=e.state.field(Xe,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||i.key.length>1||i.ctrlKey&&!(Fx&&i.altKey)||i.metaKey)return!1;let n=t.open.options[t.open.selected],r=t.active.find(o=>o.source==n.source),s=n.completion.commitCharacters||r.result.commitCharacters;return s&&s.indexOf(i.key)>-1&&Ec(e,n),!1}})),mg=E.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xB7\xB7\xB7"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'\u0192'"}},".cm-completionIcon-class":{"&:after":{content:"'\u25CB'"}},".cm-completionIcon-interface":{"&:after":{content:"'\u25CC'"}},".cm-completionIcon-variable":{"&:after":{content:"'\u{1D465}'"}},".cm-completionIcon-constant":{"&:after":{content:"'\u{1D436}'"}},".cm-completionIcon-type":{"&:after":{content:"'\u{1D461}'"}},".cm-completionIcon-enum":{"&:after":{content:"'\u222A'"}},".cm-completionIcon-property":{"&:after":{content:"'\u25A1'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\u{1F511}\uFE0E'"}},".cm-completionIcon-namespace":{"&:after":{content:"'\u25A2'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),Sc=class{constructor(e,t,n,r){this.field=e,this.line=t,this.from=n,this.to=r}},Tc=class i{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(e){let t=e.mapPos(this.from,-1,ge.TrackDel),n=e.mapPos(this.to,1,ge.TrackDel);return t==null||n==null?null:new i(this.field,t,n)}},Pc=class i{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],r=[t],s=e.doc.lineAt(t),o=/^\s*/.exec(s.text)[0];for(let l of this.lines){if(n.length){let h=o,c=/^\t*/.exec(l)[0].length;for(let f=0;fnew Tc(l.field,r[l.line]+l.from,r[l.line]+l.to));return{text:n,ranges:a}}static parse(e){let t=[],n=[],r=[],s;for(let o of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(o);){let a=s[1]?+s[1]:null,l=s[2]||s[3]||"",h=-1,c=l.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f=h&&u.field++}r.push(new Sc(h,n.length,s.index,s.index+c.length)),o=o.slice(0,s.index)+l+o.slice(s.index+s[0].length)}o=o.replace(/\\([{}])/g,(a,l,h)=>{for(let c of r)c.line==n.length&&c.from>h&&(c.from--,c.to--);return l}),n.push(o)}return new i(n,r)}},Gx=M.widget({widget:new class extends Be{toDOM(){let i=document.createElement("span");return i.className="cm-snippetFieldPosition",i}ignoreEvent(){return!1}}}),Yx=M.mark({class:"cm-snippetField"}),vn=class i{constructor(e,t){this.ranges=e,this.active=t,this.deco=M.set(e.map(n=>(n.from==n.to?Gx:Yx).range(n.from,n.to)))}map(e){let t=[];for(let n of this.ranges){let r=n.map(e);if(!r)return null;t.push(r)}return new i(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(n=>n.field==this.active&&n.from<=t.from&&n.to>=t.to))}},Br=_.define({map(i,e){return i&&i.map(e)}}),Zx=_.define(),Lr=te.define({create(){return null},update(i,e){for(let t of e.effects){if(t.is(Br))return t.value;if(t.is(Zx)&&i)return new vn(i.ranges,t.value)}return i&&e.docChanged&&(i=i.map(e.changes)),i&&e.selection&&!i.selectionInsideField(e.selection)&&(i=null),i},provide:i=>E.decorations.from(i,e=>e?e.deco:M.none)});function Ac(i,e){return S.create(i.filter(t=>t.field==e).map(t=>S.range(t.from,t.to)))}function Jx(i){let e=Pc.parse(i);return(t,n,r,s)=>{let{text:o,ranges:a}=e.instantiate(t.state,r),l={changes:{from:r,to:s,insert:W.of(o)},scrollIntoView:!0,annotations:n?[Rc.of(n),fe.userEvent.of("input.complete")]:void 0};if(a.length&&(l.selection=Ac(a,0)),a.some(h=>h.field>0)){let h=new vn(a,0),c=l.effects=[Br.of(h)];t.state.field(Lr,!1)===void 0&&c.push(_.appendConfig.of([Lr,n1,r1,mg]))}t.dispatch(t.state.update(l))}}function gg(i){return({state:e,dispatch:t})=>{let n=e.field(Lr,!1);if(!n||i<0&&n.active==0)return!1;let r=n.active+i,s=i>0&&!n.ranges.some(o=>o.field==r+i);return t(e.update({selection:Ac(n.ranges,r),effects:Br.of(s?null:new vn(n.ranges,r)),scrollIntoView:!0})),!0}}var Kx=({state:i,dispatch:e})=>i.field(Lr,!1)?(e(i.update({effects:Br.of(null)})),!0):!1,e1=gg(1),t1=gg(-1);var i1=[{key:"Tab",run:e1,shift:t1},{key:"Escape",run:Kx}],lg=A.define({combine(i){return i.length?i[0]:i1}}),n1=Qe.highest(qt.compute([lg],i=>i.facet(lg)));function Rt(i,e){return Object.assign(Object.assign({},e),{apply:Jx(i)})}var r1=E.domEventHandlers({mousedown(i,e){let t=e.state.field(Lr,!1),n;if(!t||(n=e.posAtCoords({x:i.clientX,y:i.clientY}))==null)return!1;let r=t.ranges.find(s=>s.from<=n&&s.to>=n);return!r||r.field==t.active?!1:(e.dispatch({selection:Ac(t.ranges,r.field),effects:Br.of(t.ranges.some(s=>s.field>r.field)?new vn(t.ranges,r.field):null),scrollIntoView:!0}),!0)}});var qr={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Di=_.define({map(i,e){let t=e.mapPos(i,-1,ge.TrackAfter);return t??void 0}}),Qc=new class extends at{};Qc.startSide=1;Qc.endSide=-1;var Og=te.define({create(){return j.empty},update(i,e){if(i=i.map(e.changes),e.selection){let t=e.state.doc.lineAt(e.selection.main.head);i=i.update({filter:n=>n>=t.from&&n<=t.to})}for(let t of e.effects)t.is(Di)&&(i=i.update({add:[Qc.range(t.value,t.value+1)]}));return i}});function yg(){return[o1,Og]}var gc="()[]{}<>";function bg(i){for(let e=0;e{if((s1?i.composing:i.compositionStarted)||i.state.readOnly)return!1;let r=i.state.selection.main;if(n.length>2||n.length==2&&Ee(ce(n,0))==1||e!=r.from||t!=r.to)return!1;let s=l1(i.state,n);return s?(i.dispatch(s),!0):!1}),a1=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let n=wg(i,i.selection.main.head).brackets||qr.brackets,r=null,s=i.changeByRange(o=>{if(o.empty){let a=h1(i.doc,o.head);for(let l of n)if(l==a&&Zo(i.doc,o.head)==bg(ce(l,0)))return{changes:{from:o.head-l.length,to:o.head+l.length},range:S.cursor(o.head-l.length)}}return{range:r=o}});return r||e(i.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},vg=[{key:"Backspace",run:a1}];function l1(i,e){let t=wg(i,i.selection.main.head),n=t.brackets||qr.brackets;for(let r of n){let s=bg(ce(r,0));if(e==r)return s==r?u1(i,r,n.indexOf(r+r+r)>-1,t):c1(i,r,s,t.before||qr.before);if(e==s&&xg(i,i.selection.main.from))return f1(i,r,s)}return null}function xg(i,e){let t=!1;return i.field(Og).between(0,i.doc.length,n=>{n==e&&(t=!0)}),t}function Zo(i,e){let t=i.sliceString(e,e+2);return t.slice(0,Ee(ce(t,0)))}function h1(i,e){let t=i.sliceString(e-2,e);return Ee(ce(t,0))==t.length?t:t.slice(1)}function c1(i,e,t,n){let r=null,s=i.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:Di.of(o.to+e.length),range:S.range(o.anchor+e.length,o.head+e.length)};let a=Zo(i.doc,o.head);return!a||/\s/.test(a)||n.indexOf(a)>-1?{changes:{insert:e+t,from:o.head},effects:Di.of(o.head+e.length),range:S.cursor(o.head+e.length)}:{range:r=o}});return r?null:i.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function f1(i,e,t){let n=null,r=i.changeByRange(s=>s.empty&&Zo(i.doc,s.head)==t?{changes:{from:s.head,to:s.head+t.length,insert:t},range:S.cursor(s.head+t.length)}:n={range:s});return n?null:i.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function u1(i,e,t,n){let r=n.stringPrefixes||qr.stringPrefixes,s=null,o=i.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:e,from:a.to}],effects:Di.of(a.to+e.length),range:S.range(a.anchor+e.length,a.head+e.length)};let l=a.head,h=Zo(i.doc,l),c;if(h==e){if(hg(i,l))return{changes:{insert:e+e,from:l},effects:Di.of(l+e.length),range:S.cursor(l+e.length)};if(xg(i,l)){let u=t&&i.sliceDoc(l,l+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:l,to:l+u.length,insert:u},range:S.cursor(l+u.length)}}}else{if(t&&i.sliceDoc(l-2*e.length,l)==e+e&&(c=cg(i,l-2*e.length,r))>-1&&hg(i,c))return{changes:{insert:e+e+e+e,from:l},effects:Di.of(l+e.length),range:S.cursor(l+e.length)};if(i.charCategorizer(l)(h)!=F.Word&&cg(i,l,r)>-1&&!d1(i,l,e,r))return{changes:{insert:e+e,from:l},effects:Di.of(l+e.length),range:S.cursor(l+e.length)}}return{range:s=a}});return s?null:i.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function hg(i,e){let t=he(i).resolveInner(e+1);return t.parent&&t.from==e}function d1(i,e,t,n){let r=he(i).resolveInner(e,-1),s=n.reduce((o,a)=>Math.max(o,a.length),0);for(let o=0;o<5;o++){let a=i.sliceDoc(r.from,Math.min(r.to,r.from+t.length+s)),l=a.indexOf(t);if(!l||l>-1&&n.indexOf(a.slice(0,l))>-1){let c=r.firstChild;for(;c&&c.from==r.from&&c.to-c.from>t.length+l;){if(i.sliceDoc(c.to-t.length,c.to)==t)return!1;c=c.firstChild}return!0}let h=r.to==e&&r.parent;if(!h)break;r=h}return!1}function cg(i,e,t){let n=i.charCategorizer(e);if(n(i.sliceDoc(e-1,e))!=F.Word)return e;for(let r of t){let s=e-r.length;if(i.sliceDoc(s,e)==r&&n(i.sliceDoc(s-1,s))!=F.Word)return s}return-1}function Xr(i={}){return[Hx,Xe,ve.of(i),Ux,p1,mg]}var Mc=[{key:"Ctrl-Space",run:Ix},{key:"Escape",run:Nx},{key:"ArrowDown",run:Uo(!0)},{key:"ArrowUp",run:Uo(!1)},{key:"PageDown",run:Uo(!0,"page")},{key:"PageUp",run:Uo(!1,"page")},{key:"Enter",run:Wx}],p1=Qe.highest(qt.computeN([ve],i=>i.facet(ve).defaultKeymap?[Mc]:[]));var _c=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},$i=class i{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let r=e,s=n.facet(Wr).markerFilter;s&&(r=s(r,n));let o=M.set(r.map(a=>a.from==a.to||a.from==a.to-1&&n.doc.lineAt(a.from).to==a.from?M.widget({widget:new Dc(a),diagnostic:a}).range(a.from):M.mark({attributes:{class:"cm-lintRange cm-lintRange-"+a.severity+(a.markClass?" "+a.markClass:"")},diagnostic:a}).range(a.from,a.to)),!0);return new i(o,t,xn(o))}};function xn(i,e=null,t=0){let n=null;return i.between(t,1e9,(r,s,{spec:o})=>{if(!(e&&o.diagnostic!=e))return n=new _c(r,s,o.diagnostic),!1}),n}function m1(i,e){let t=e.pos,n=e.end||t,r=i.state.facet(Wr).hideOn(i,t,n);if(r!=null)return r;let s=i.startState.doc.lineAt(e.pos);return!!(i.effects.some(o=>o.is(Sg))||i.changes.touchesRange(s.from,Math.max(s.to,n)))}function g1(i,e){return i.field(He,!1)?e:e.concat(_.appendConfig.of(S1))}var Sg=_.define(),$c=_.define(),Tg=_.define(),He=te.define({create(){return new $i(M.none,null,null)},update(i,e){if(e.docChanged&&i.diagnostics.size){let t=i.diagnostics.map(e.changes),n=null,r=i.panel;if(i.selected){let s=e.changes.mapPos(i.selected.from,1);n=xn(t,i.selected.diagnostic,s)||xn(t,null,s)}!t.size&&r&&e.state.facet(Wr).autoPanel&&(r=null),i=new $i(t,r,n)}for(let t of e.effects)if(t.is(Sg)){let n=e.state.facet(Wr).autoPanel?t.value.length?Ir.open:null:i.panel;i=$i.init(t.value,n,e.state)}else t.is($c)?i=new $i(i.diagnostics,t.value?Ir.open:null,i.selected):t.is(Tg)&&(i=new $i(i.diagnostics,i.panel,t.value));return i},provide:i=>[Ti.from(i,e=>e.panel),E.decorations.from(i,e=>e.diagnostics)]});var O1=M.mark({class:"cm-lintRange cm-lintRange-active"});function y1(i,e,t){let{diagnostics:n}=i.state.field(He),r=[],s=2e8,o=0;n.between(e-(t<0?1:0),e+(t>0?1:0),(l,h,{spec:c})=>{e>=l&&e<=h&&(l==h||(e>l||t>0)&&(eRg(i,t,!1)))}var w1=i=>{let e=i.state.field(He,!1);(!e||!e.panel)&&i.dispatch({effects:g1(i.state,[$c.of(!0)])});let t=Pi(i,Ir.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},kg=i=>{let e=i.state.field(He,!1);return!e||!e.panel?!1:(i.dispatch({effects:$c.of(!1)}),!0)},v1=i=>{let e=i.state.field(He,!1);if(!e)return!1;let t=i.state.selection.main,n=e.diagnostics.iter(t.to+1);return!n.value&&(n=e.diagnostics.iter(0),!n.value||n.from==t.from&&n.to==t.to)?!1:(i.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0}),!0)};var Pg=[{key:"Mod-Shift-m",run:w1,preventDefault:!0},{key:"F8",run:v1}];var Wr=A.define({combine(i){return Object.assign({sources:i.map(e=>e.source).filter(e=>e!=null)},Te(i.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t}))}});function Cg(i){let e=[];if(i)e:for(let{name:t}of i){for(let n=0;ns.toLowerCase()==r.toLowerCase())){e.push(r);continue e}}e.push("")}return e}function Rg(i,e,t){var n;let r=t?Cg(e.actions):[];return U("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},U("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(i):e.message),(n=e.actions)===null||n===void 0?void 0:n.map((s,o)=>{let a=!1,l=u=>{if(u.preventDefault(),a)return;a=!0;let d=xn(i.state.field(He).diagnostics,e);d&&s.apply(i,d.from,d.to)},{name:h}=s,c=r[o]?h.indexOf(r[o]):-1,f=c<0?h:[h.slice(0,c),U("u",h.slice(c,c+1)),h.slice(c+1)];return U("button",{type:"button",class:"cm-diagnosticAction",onclick:l,onmousedown:l,"aria-label":` Action: ${h}${c<0?"":` (access key "${r[o]})"`}.`},f)}),e.source&&U("div",{class:"cm-diagnosticSource"},e.source))}var Dc=class extends Be{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return U("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}},Ko=class{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=Rg(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}},Ir=class i{constructor(e){this.view=e,this.items=[];let t=r=>{if(r.keyCode==27)kg(this.view),this.view.focus();else if(r.keyCode==38||r.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(r.keyCode==40||r.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(r.keyCode==36)this.moveSelection(0);else if(r.keyCode==35)this.moveSelection(this.items.length-1);else if(r.keyCode==13)this.view.focus();else if(r.keyCode>=65&&r.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=Cg(s.actions);for(let a=0;a{for(let s=0;skg(this.view)},"\xD7")),this.update()}get selectedIndex(){let e=this.view.state.field(He).selected;if(!e)return-1;for(let t=0;t{let h=-1,c;for(let f=n;fn&&(this.items.splice(n,h-n),r=!0)),t&&c.diagnostic==t.diagnostic?c.dom.hasAttribute("aria-selected")||(c.dom.setAttribute("aria-selected","true"),s=c):c.dom.hasAttribute("aria-selected")&&c.dom.removeAttribute("aria-selected"),n++});n({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:o,panel:a})=>{let l=a.height/this.list.offsetHeight;o.topa.bottom&&(this.list.scrollTop+=(o.bottom-a.bottom)/l)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let n=e;e=n.nextSibling,n.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(He),n=xn(t.diagnostics,this.items[e].diagnostic);n&&this.view.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0,effects:Tg.of(n)})}static open(e){return new i(e)}};function x1(i,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(i)}')`}function Jo(i){return x1(``,'width="6" height="3"')}var k1=E.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Jo("#d11")},".cm-lintRange-warning":{backgroundImage:Jo("orange")},".cm-lintRange-info":{backgroundImage:Jo("#999")},".cm-lintRange-hint":{backgroundImage:Jo("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});var S1=[He,E.decorations.compute([He],i=>{let{selected:e,panel:t}=i.field(He);return!e||!t||e.from==e.to?M.none:M.set([O1.range(e.from,e.to)])}),vp(y1,{hideOn:m1}),k1];var Eg=[Sp(),Tp(),Op(),pm(),Zp(),dp(),gp(),N.allowMultipleSelections.of(!0),Np(),Ar(Kp,{fallback:!0}),nm(),yg(),Xr(),bp(),wp(),yp(),Zm(),qt.of([...vg,...Nm,...ig,...ym,...Hp,...Mc,...Pg])];var qc=class i{constructor(e,t,n,r,s,o,a,l,h,c=0,f){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=s,this.score=o,this.buffer=a,this.bufferBase=l,this.curContext=h,this.lookAhead=c,this.parent=f}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let r=e.parser.context;return new i(e,[],t,n,n,0,[],0,r?new ea(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,r=e&65535,{parser:s}=this.p;this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSizea;)this.stack.pop();this.reduceContext(r,l)}storeNode(e,t,n,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&o.buffer[a-4]==0&&o.buffer[a-1]>-1){if(t==n)return;if(o.buffer[a-2]>=t){o.buffer[a-2]=n;return}}}if(!s||this.pos==n)this.buffer.push(e,t,n,r);else{let o=this.buffer.length;if(o>0&&this.buffer[o-4]!=0)for(;o>0&&this.buffer[o-2]>n;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4);this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=n,this.buffer[o+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let s=e,{parser:o}=this.p;(r>this.pos||t<=o.maxNode)&&(this.pos=r,o.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,n),this.shiftContext(t,n),t<=o.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new i(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new Bc(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let r=[];for(let s=0,o;sl&1&&a==o)||r.push(t[s],o)}t=r}let n=[];for(let r=0;r>19,r=t&65535,s=this.stack.length-n*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,s)=>{if(!t.includes(r))return t.push(r),e.allActions(r,o=>{if(!(o&393216))if(o&65536){let a=(o>>19)-s;if(a>1){let l=o&65535,h=this.stack.length-a*3;if(h>=0&&e.getGoto(this.stack[h],l,!1)>=0)return a<<19|65536|l}}else{let a=n(o,s+1);if(a!=null)return a}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},ea=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},Bc=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}},Xc=class i{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new i(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new i(this.stack,this.pos,this.index)}};function Nr(i,e=Uint16Array){if(typeof i!="string")return i;let t=null;for(let n=0,r=0;n=92&&o--,o>=34&&o--;let l=o-32;if(l>=46&&(l-=46,a=!0),s+=l,a)break;s*=46}t?t[r++]=s:t=new e(s)}return t}var kn=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},Ag=new kn,Wc=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Ag,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,s=this.pos+e;for(;sn.to:s>=n.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-n.to,n=o}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t=this.chunk2Pos&&na.to&&(this.chunk2=this.chunk2.slice(0,a.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=Ag,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}},li=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;$g(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};li.prototype.contextual=li.prototype.fallback=li.prototype.extend=!1;var Ic=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e=="string"?Nr(e):e}token(e,t){let n=e.pos,r=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if($g(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;e.reset(o,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}};Ic.prototype.contextual=li.prototype.fallback=li.prototype.extend=!1;var Vi=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function $g(i,e,t,n,r,s){let o=0,a=1<0){let m=i[d];if(l.allows(m)&&(e.token.value==-1||e.token.value==m||P1(m,e.token.value,r,s))){e.acceptToken(m);break}}let c=e.next,f=0,u=i[o+2];if(e.next<0&&u>f&&i[h+u*3-3]==65535){o=i[h+u*3-1];continue e}for(;f>1,m=h+d+(d<<1),p=i[m],g=i[m+1]||65536;if(c=g)f=d+1;else{o=i[m+2],e.advance();continue e}}break}}function Qg(i,e,t){for(let n=e,r;(r=i[n])!=65535;n++)if(r==t)return n-e;return-1}function P1(i,e,t,n){let r=Qg(t,n,e);return r<0||Qg(t,n,i)e)&&!n.type.isError)return t<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(i.length,Math.max(n.from+1,e+25));if(t<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return t<0?0:i.length}}var Nc=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Mg(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Mg(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=o,null;if(s instanceof le){if(o==e){if(o=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+s.length}}},jc=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new kn)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:s}=r,o=r.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,l=0;for(let h=0;hf.end+25&&(l=Math.max(f.lookAhead,l)),f.value!=0)){let u=t;if(f.extended>-1&&(t=this.addActions(e,f.extended,f.end,t)),t=this.addActions(e,f.value,f.end,t),!c.extend&&(n=f,t>u))break}}for(;this.actions.length>t;)this.actions.pop();return l&&e.setLookAhead(l),!n&&e.pos==this.stream.end&&(n=new kn,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new kn,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:s}=n.p;for(let o=0;o=0&&n.p.parser.dialect.allows(a>>1)){a&1?e.extended=a>>1:e.value=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let s=0;se.bufferLength*4?new Nc(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;ot)n.push(a);else{if(this.advanceStack(a,n,e))continue;{r||(r=[],s=[]),r.push(a);let l=this.tokens.getMainToken(a);s.push(l.value,l.end)}}break}}if(!n.length){let o=r&&C1(r);if(o)return Ge&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw Ge&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,n);if(o)return Ge&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(n.length>o)for(n.sort((a,l)=>l.score-a.score);n.length>o;)n.pop();n.some(a=>a.reducePos>t)&&this.recovering--}else if(n.length>1){e:for(let o=0;o500&&h.buffer.length>500)if((a.score-h.score||a.buffer.length-h.buffer.length)>0)n.splice(l--,1);else{n.splice(o--,1);continue e}}}n.length>12&&n.splice(12,n.length-12)}this.minStackPos=n[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let h=e.curContext&&e.curContext.tracker.strict,c=h?e.curContext.hash:0;for(let f=this.fragments.nodeAt(r);f;){let u=this.parser.nodeSet.types[f.type.id]==f.type?s.getGoto(e.state,f.type.id):-1;if(u>-1&&f.length&&(!h||(f.prop($.contextHash)||0)==c))return e.useNode(f,u),Ge&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(f.type.id)})`),!0;if(!(f instanceof le)||f.children.length==0||f.positions[0]>0)break;let d=f.children[0];if(d instanceof le&&f.positions[0]==0)f=d;else break}}let a=s.stateSlot(e.state,4);if(a>0)return e.reduce(a),Ge&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(a&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let h=0;hr?t.push(m):n.push(m)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return _g(e,t),!0}}runRecovery(e,t,n){let r=null,s=!1;for(let o=0;o ":"";if(a.deadEnd&&(s||(s=!0,a.restart(),Ge&&console.log(c+this.stackID(a)+" (restarted)"),this.advanceFully(a,n))))continue;let f=a.split(),u=c;for(let d=0;f.forceReduce()&&d<10&&(Ge&&console.log(u+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,n));d++)Ge&&(u=this.stackID(f)+" -> ");for(let d of a.recoverByInsert(l))Ge&&console.log(c+this.stackID(d)+" (via recover-insert)"),this.advanceFully(d,n);this.stream.end>a.pos?(h==a.pos&&(h++,l=0),a.recoverByDelete(l,h),Ge&&console.log(c+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),_g(a,n)):(!r||r.scorei,ta=class{constructor(e){this.start=e.start,this.shift=e.shift||Lc,this.reduce=e.reduce||Lc,this.reuse=e.reuse||Lc,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},Sn=class i extends hn{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let a=0;ae.topRules[a][1]),r=[];for(let a=0;a=0)s(c,l,a[h++]);else{let f=a[h+-c];for(let u=-c;u>0;u--)s(a[h++],l,f);h++}}}this.nodeSet=new yr(t.map((a,l)=>Pe.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:r[l],top:n.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=1024;let o=Nr(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;atypeof a=="number"?new li(o,a):a),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new zc(this,e,t,n);for(let s of this.wrappers)r=s(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let o=r[s++],a=o&1,l=r[s++];if(a&&n)return l;for(let h=s+(o>>1);s0}validAction(e,t){return!!this.allActions(e,n=>n==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=Bt(this.data,s+2);else break;r=t(Bt(this.data,s+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=Bt(this.data,n+2);else break;if(!(this.data[n+2]&1)){let r=this.data[n+1];t.some((s,o)=>o&1&&s==r)||t.push(this.data[n],r)}}return t}configure(e){let t=Object.assign(Object.create(i.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(n=>{let r=e.tokenizers.find(s=>s.from==n);return r?r.to:n})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,r)=>{let s=e.specializers.find(a=>a.from==n.external);if(!s)return n;let o=Object.assign(Object.assign({},n),{external:s.to});return t.specializers[r]=Dg(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let s of e.split(" ")){let o=t.indexOf(s);o>=0&&(n[o]=!0)}let r=null;for(let s=0;sn)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scorei.external(t,n)<<1|e}return i.get}var R1=fn({"repeat while for if else return break next in":b.controlKeyword,"Logical!":b.bool,function:b.definitionKeyword,"FunctionCall/Identifier FunctionCall/String":b.function(b.variableName),"NamedArg!":b.function(b.attributeName),Comment:b.lineComment,"Numeric Integer Complex Inf":b.number,"SpecialConstant!":b.literal,String:b.string,"ArithOp MatrixOp":b.arithmeticOperator,BitOp:b.bitwiseOperator,CompareOp:b.compareOperator,"ExtractionOp NamespaceOp":b.operator,AssignmentOperator:b.definitionOperator,"...":b.punctuation,"( )":b.paren,"[ ]":b.squareBracket,"{ }":b.brace,$:b.derefOperator,", ;":b.separator}),E1={__proto__:null,TRUE:12,T:14,FALSE:18,F:20,NULL:30,NA:34,Inf:38,NaN:42,function:46,"...":50,return:60,break:64,next:68,if:80,else:82,repeat:86,while:90,for:94,in:96},ia=Sn.deserialize({version:14,states:"7dOYQPOOOOQO'#Dx'#DxOOQO'#Dw'#DwO$aQPO'#DwOOQO'#Dy'#DyO(]QPO'#DvOOQO'#Dv'#DvOOQO'#Cx'#CxO*UQPO'#CwO,YQPO'#DmO/rQPO'#DaO1kQPO'#D`OOQO'#Dz'#DzOOQO'#Du'#DuQYQPOOOOQO'#Ca'#CaOOQO'#Cd'#CdOOQO'#Cj'#CjOOQO'#Cl'#ClOOQO'#Cn'#CnOOQO'#Cp'#CpO1|QPO'#CrO2RQPO'#DTO!bQPO'#DWO2WQPO'#DYO2]QPO'#D[O3oQPO'#DROOQO,59l,59lO3yQPO'#DoOOQO'#Do'#DoO*UQPO,59cOOQO'#DP'#DPOOQO,59c,59cO5fQPO'#CyO5kQPO'#C{O7XQPO'#C}O8uQPO,59yO:ZQQO,59yOOQO'#Dd'#DdOOQO'#De'#DeOOQO'#Df'#DfOOQO'#Dg'#DgOOQO'#Dh'#DhOOQO'#Di'#DiOOQO'#Dj'#DjOOQO'#Dk'#DkOOQO'#Dl'#DlOYQPO,59}OYQPO,59}OYQPO,59}OYQPO,59}OYQPO,59}OYQPO,59}OYQPO,59}OYQPO,59}OYQPO,59}OOQO'#Db'#DbOYQPO,59zOOQO-E7k-E7kO:bQPO'#CtO!bQPO,59^OYQPO,59oOOQO,59r,59rOYQPO,59tOYQPO,59vO:mQPO'#DwO:tQPO'#DvO:{QPO'#ESO;VQPO'#ESO;aQPO,59mO;fQPO'#ESOOQO-E7m-E7mOOQO1G.}1G.}O;nQPO,59eO;uQPO,59gO;zQPO,59iOkQQO'#DvO@gQQO'#EUO@qQQO1G/eO@vQQO'#DaODcQPO1G/iODmQPO1G/iOH`QPO1G/iOHgQPO1G/iOLSQPO1G/iOL^QPO1G/iO! aQPO1G/iO!!WQPO1G/iO!$tQPO1G/iO!(dQPO1G/fO!*]QPO'#D}OYQPO'#D}O!*hQPO,59`O!*`QPO'#D}OOQO1G.x1G.xO!*mQPO1G/ZO!*tQPO1G/`O!*{QPO1G/bOOQO,59n,59nO!+SQPO'#DpO!+ZQPO,5:nO!+cQPO,5:nOOQO1G/X1G/XO!+mQPO1G/POOQO1G/P1G/POOQO1G/R1G/ROOQO1G/T1G/TOYQPO'#DqO!+tQPO,5:pOOQO7+%P7+%PO!+|QQO,5:pOOQO,59b,59bO!,UQPO'#DnO!,^QPO,5:iO!,fQPO,5:iOOQO1G.z1G.zO!bQPO7+$uO!bQPO7+$zOYQPO7+$|O!,pQPO,5:[O!,zQPO,5:[OOQO,5:[,5:[OOQO-E7n-E7nO!-UQPO1G0YOOQO7+$k7+$kO!-^QPO,5:]OOQO-E7o-E7oO!-hQQO,5:]O!/fQQO1G/iO!/pQQO1G/iO!1qQQO1G/iO!1xQQO1G/iO!3sQQO1G/iO!3}QQO1G/iO!5`QQO1G/iO!6VQQO1G/iO!6|QQO1G/iO!7TQQO1G/fO!7[QPO,5:YOYQPO,5:YOOQO,5:Y,5:YOOQO-E7l-E7lO!7gQPO1G0TO!9iQPO<SO!;}QQO<YO!s$lO!{!xX~P*fO!{#dO~O!{!nX~P-lO!pjOR!ViS!ViU!ViV!ViX!ViY!ViZ!Vi[!Vi]!Vi_!Via!Vic!Vie!Vig!Vix!Vi{!Vi}!Vi!P!Vi!f!Vi!u!Vi!w!Vi!z!Vi#S!Vi#T!Vi#U!Vi#V!Vi#W!Vi#X!Vi#Y!Vi#Z!Vi#[!Vi#]!Vi#^!Vi#_!Vi#`!Vi#a!Vi#b!Vi#c!Vi#d!Vi#e!Vi#f!Vi#g!Vi#h!Vin!Vip!Vir!Vi!t!Vi!o!Vi!s!Vi!y!Vi!Q!Vi~O#Q!Vi#R!Vi~P@}O#QvO#RvO~P@}O!pjO#QvO#RvO#SwO#TwOR!ViS!ViU!ViV!ViX!ViY!ViZ!Vi[!Vi]!Vi_!Via!Vic!Vie!Vig!Vix!Vi{!Vi}!Vi!P!Vi!f!Vi!u!Vi!w!Vi!z!Vi#V!Vi#W!Vi#X!Vi#Y!Vi#Z!Vi#[!Vi#]!Vi#^!Vi#_!Vi#`!Vi#a!Vi#b!Vi#c!Vi#d!Vi#e!Vi#f!Vi#g!Vi#h!Vin!Vip!Vir!Vi!t!Vi!o!Vi!s!Vi!y!Vi!Q!Vi~O#U!Vi~PDwO#UxO~PDwO!pjO#QvO#RvO#SwO#TwO#UxO#VyO#WyO#XyO#a|O#b|O#c|O#d|OR!ViS!ViU!ViV!ViX!ViY!ViZ!Vi[!Vi]!Vi_!Via!Vic!Vie!Vig!Vix!Vi{!Vi}!Vi!P!Vi!f!Vi!u!Vi!w!Vi!z!Vi#[!Vi#]!Vi#^!Vi#_!Vi#`!Vi#e!Vi#f!Vi#g!Vi#h!Vin!Vip!Vir!Vi!t!Vi!o!Vi!s!Vi!y!Vi!Q!Vi~O#Y!Vi#Z!Vi~PHnO#YzO#ZzO~PHnO!pjO#QvO#RvO#SwO#TwO#UxO#VyO#WyO#XyOR!ViS!ViU!ViV!ViX!ViY!ViZ!Vi[!Vi]!Vi_!Via!Vic!Vie!Vig!Vix!Vi{!Vi}!Vi!P!Vi!f!Vi!u!Vi!w!Vi!z!Vi#e!Vi#f!Vi#g!Vi#h!Vin!Vip!Vir!Vi!t!Vi!o!Vi!s!Vi!y!Vi!Q!Vi~O#Y!Vi#Z!Vi#[!Vi#]!Vi#^!Vi#_!Vi#`!Vi#a!Vi#b!Vi#c!Vi#d!Vi~PLhO#YzO#ZzO#[{O#]{O#^{O#_{O#`{O#a|O#b|O#c|O#d|O~PLhO!pjO#QvO#RvO#SwO#TwO#UxO#VyO#WyO#XyO#YzO#ZzO#[{O#]{O#^{O#_{O#`{O#a|O#b|O#c|O#d|O#e}O#f}O!w!Vi!z!Vi#g!Vi#h!Vi!s!Vi~OR!ViS!ViU!ViV!ViX!ViY!ViZ!Vi[!Vi]!Vi_!Via!Vic!Vie!Vig!Vix!Vi{!Vi}!Vi!P!Vi!f!Vi!u!Vin!Vip!Vir!Vi!t!Vi!o!Vi!y!Vi!Q!Vi~P!!}O!pjO!w!Si!z!Si#Q!Si#R!Si#S!Si#T!Si#U!Si#V!Si#W!Si#X!Si#Y!Si#Z!Si#[!Si#]!Si#^!Si#_!Si#`!Si#a!Si#b!Si#c!Si#d!Si#e!Si#f!Si#g!Si#h!Si!s!Si~OR!SiS!SiU!SiV!SiX!SiY!SiZ!Si[!Si]!Si_!Sia!Sic!Sie!Sig!Six!Si{!Si}!Si!P!Si!f!Si!u!Sin!Sip!Sir!Si!t!Si!o!Si!y!Si!Q!Si~P!&mO!r#fO!s#gO!o!qX~O!o#jO~O!o#kO~P*fO!o#lO~P*fO!Q#mO~P*fOi#pO~P2bO!s#YO!o!va~O!s#YO!o!va~P*fO!o#sO~P*fO!s#bO!y!xa~O!s$lO!{!xa~OR$ROi$TO~O!s#gO!o!qa~O!s#gO!o!qa~P*fO!o!da!s!da~P*fO!o!da!s!da~PYO!s#YO!o!vi~O!s!ea!y!ea~P*fO!s!ea!{!ea~P*fO!pjO!s!Vi!w!Vi!z!Vi!{!Vi#S!Vi#T!Vi#U!Vi#V!Vi#W!Vi#X!Vi#Y!Vi#Z!Vi#[!Vi#]!Vi#^!Vi#_!Vi#`!Vi#a!Vi#b!Vi#c!Vi#d!Vi#e!Vi#f!Vi#g!Vi#h!Vi~O#Q!Vi#R!Vi~P!-rO#QvO#RvO~P!-rO!pjO#QvO#RvO#SwO#TwO!s!Vi!w!Vi!z!Vi!{!Vi#V!Vi#W!Vi#X!Vi#Y!Vi#Z!Vi#[!Vi#]!Vi#^!Vi#_!Vi#`!Vi#a!Vi#b!Vi#c!Vi#d!Vi#e!Vi#f!Vi#g!Vi#h!Vi~O#U!Vi~P!/zO#UxO~P!/zO!pjO#QvO#RvO#SwO#TwO#UxO#VyO#WyO#XyO#a|O#b|O#c|O#d|O!s!Vi!w!Vi!z!Vi!{!Vi#[!Vi#]!Vi#^!Vi#_!Vi#`!Vi#e!Vi#f!Vi#g!Vi#h!Vi~O#Y!Vi#Z!Vi~P!2PO#YzO#ZzO~P!2PO!pjO#QvO#RvO#SwO#TwO#UxO#VyO#WyO#XyO!s!Vi!w!Vi!z!Vi!{!Vi#e!Vi#f!Vi#g!Vi#h!Vi~O#Y!Vi#Z!Vi#[!Vi#]!Vi#^!Vi#_!Vi#`!Vi#a!Vi#b!Vi#c!Vi#d!Vi~P!4XO#YzO#ZzO#[{O#]{O#^{O#_{O#`{O#a|O#b|O#c|O#d|O~P!4XO!{!Vi~P!!}O!{!Si~P!&mO!r#fO!o!ba!s!ba~O!s#gO!o!qi~Oy$]O!pwy!wwy!zwy#Qwy#Rwy#Swy#Twy#Uwy#Vwy#Wwy#Xwy#Ywy#Zwy#[wy#]wy#^wy#_wy#`wy#awy#bwy#cwy#dwy#ewy#fwy#gwy#hwy!swy~ORwySwyUwyVwyXwyYwyZwy[wy]wy_wyawycwyewygwyxwy{wy}wy!Pwy!fwy!uwynwypwyrwy!twy!owy!ywy!Qwy~P!7oO!o$^O~P*fO!o!di!s!di~P*fO!o!bi!s!bi~P*fO!{wy~P!7oO!o$mO~P*fO!p$pO~O",goto:"7}!yPPPPP!zPP!zPPPPP#vP#vP#vP#vP$rP%nP%q%w'Y(]P(]P(]P(a(g)e*b$rPP$rP$rP$rPP(g$r*h+f$r+l,d-Y-|.n/[/v0f1O1f1l1w1}2ZPPP2e4}5y6u5y4}PP7qPPPP7tP7w!sPOW^jntu!P!Q!R!S!T!U!V!W!X!Z!_!a!b!f!k#Q#Y#b#m#o$S$b$c$d$e$f$g$h$i$j$k$l$p!sSOW^jntu!P!Q!R!S!T!U!V!W!X!Z!_!a!b!f!k#Q#Y#b#m#o$S$b$c$d$e$f$g$h$i$j$k$l$p!s[OW^jntu!P!Q!R!S!T!U!V!W!X!Z!_!a!b!f!k#Q#Y#b#m#o$S$b$c$d$e$f$g$h$i$j$k$l$pR!^eQ#Q!]R$S#g!r[OW^jntu!P!Q!R!S!T!U!V!W!X!Z!_!a!b!f!k#Q#Y#b#m#o$S$b$c$d$e$f$g$h$i$j$k$l$pQ!`gQ#T!^Q$W#kQ$X#lQ$_$mQ$`$]R$a$^#RWOW^gjntu!P!Q!R!S!T!U!V!W!X!Z!^!_!a!b!f!k#Q#Y#b#k#l#m#o$S$]$^$b$c$d$e$f$g$h$i$j$k$l$m$pTmWnQpWR!jn!YYOW^jnt!P!Q!R!S!T!U!V!W!X!Z!_!a!b!f!k#Q#Y#b#m#o$S$pi!tu$b$c$d$e$f$g$h$i$j$k$l!ukRXl!c!e!n!p!r!u!v!w!x!y!z!{!|!}#O#U#V#W#[#^#i#n#t#v#w#x#y#z#{#|#}$O$P$Q$Y$Z$[$oQ!fjR#o#Y!YZOW^jnt!P!Q!R!S!T!U!V!W!X!Z!_!a!b!f!k#Q#Y#b#m#o$S$pi$nu$b$c$d$e$f$g$h$i$j$k$lQ!ZZR$k$n!Q!PXl!e!n!v!w!x!y!z!{!|!}#U#V#W#[#^#i#n#t$Y$Z$[$oe$b!r#v#x#y#z#{#|#}$O$P!O!QXl!e!n!w!x!y!z!{!|!}#U#V#W#[#^#i#n#t$Y$Z$[$oc$c!r#v#y#z#{#|#}$O$P|!RXl!e!n!x!y!z!{!|!}#U#V#W#[#^#i#n#t$Y$Z$[$oa$d!r#v#z#{#|#}$O$Pz!SXl!e!n!y!z!{!|!}#U#V#W#[#^#i#n#t$Y$Z$[$o_$e!r#v#{#|#}$O$Pv!TXl!e!n!z!|!}#U#V#W#[#^#i#n#t$Y$Z$[$oZ$f!r#v#|$O$Pt!UXl!e!n!|!}#U#V#W#[#^#i#n#t$Y$Z$[$oX$g!r#v$O$Px!VXl!e!n!y!z!|!}#U#V#W#[#^#i#n#t$Y$Z$[$o]$h!r#v#{#|$O$Pr!WXl!e!n!}#U#V#W#[#^#i#n#t$Y$Z$[$oV$i!r#v$Pp!XXl!e!n#U#V#W#[#^#i#n#t$Y$Z$[$oT$j!r#vQ^OR![^S#h#P#SS$U#h$VR$V#iQnWR!inU#Z!e!f!hS#q#Z#rR#r#[Q#c!nQ#e!rT#u#c#eSXO^SlWnQ!ejQ!ntQ!ruQ!u!PQ!v!QQ!w!RQ!x!SQ!y!TQ!z!UQ!{!VQ!|!WQ!}!XQ#O!ZQ#U!_Q#V!aQ#W!bQ#[!fQ#^!kQ#i#QQ#n#YQ#t#bQ#v$lQ#w$bQ#x$cQ#y$dQ#z$eQ#{$fQ#|$gQ#}$hQ$O$iQ$P$jQ$Q$kQ$Y#mQ$Z#oQ$[$SR$o$p!s]OW^jntu!P!Q!R!S!T!U!V!W!X!Z!_!a!b!f!k#Q#Y#b#m#o$S$b$c$d$e$f$g$h$i$j$k$l$p!sUOW^jntu!P!Q!R!S!T!U!V!W!X!Z!_!a!b!f!k#Q#Y#b#m#o$S$b$c$d$e$f$g$h$i$j$k$l$p!sQOW^jntu!P!Q!R!S!T!U!V!W!X!Z!_!a!b!f!k#Q#Y#b#m#o$S$b$c$d$e$f$g$h$i$j$k$l$pR#R!]R!gjQ!otR!su",nodeNames:"\u26A0 Comment Script Identifier Integer True TRUE T False FALSE F Numeric String Complex Null NULL NA NA Inf Inf NaN NaN FunctionDeclaration function ParamList ... NamedArg Block BlockOpenBrace ReturnStatement return BreakStatement break NextStatement next BlockCloseBrace FunctionCall ArgList NamedArg IfStatement if else RepeatStatement repeat WhileStatement while ForStatement for in IndexStatement VariableAssignment Assignable AssignmentOperator BinaryStatement NamespaceOp ExtractionOp ArithOp ArithOp ArithOp CompareOp MatrixOp LogicOp LogicOp",maxTerm:116,nodeProps:[["group",-11,3,22,27,36,39,42,44,46,49,50,53,"Expression",-4,4,11,12,13,"Constant Expression",-2,5,8,"Constant Expression Logical",-4,14,16,18,20,"Expression SpecialConstant"]],propSources:[R1],skippedNodes:[0,1],repeatNodeCount:5,tokenData:"6[~RzX^#upq#uqr$jrs$ust%itu%tuv%yvw'twx(Rxy(pyz(uz{(z{|)P|})U}!O)Z!O!P)p!P!Q.b!Q!R.g!R![0^![!]2x!^!_3]!_!`4O!`!a4]!b!c4h!c!}*|!}#O4m#P#Q4z#Q#R5X#R#S*|#S#T5^#T#o*|#o#p5s#p#q5x#q#r6V#y#z#u$f$g#u#BY#BZ#u$IS$I_#u$I|$JO#u$JT$JU#u$KV$KW#u&FU&FV#u~#zY!h~X^#upq#u#y#z#u$f$g#u#BY#BZ#u$IS$I_#u$I|$JO#u$JT$JU#u$KV$KW#u&FU&FV#u~$mP!_!`$p~$uO#]~~$zU[~OY$uZr$urs%^s#O$u#O#P%c#P~$u~%cO[~~%fPO~$u~%nQP~OY%iZ~%i~%yO#S~~%|Uuv&`z{&e!P!Q&p#]#^&{#c#d'^#l#m'i~&eO#X~~&hPuv&k~&pO#b~~&sPuv&v~&{O#a~~'OP#b#c'R~'UPuv'X~'^O#`~~'aPuv'd~'iO#c~~'lPuv'o~'tO#d~~'yP#g~vw'|~(RO#h~~(WU[~OY(RZw(Rwx%^x#O(R#O#P(j#P~(R~(mPO~(R~(uO!p~~(zO!o~~)PO#V~~)UO#Y~~)ZO!s~~)`P#Z~!`!a)c~)hP!}~!`!a)k~)pO#P~~)uTR~!O!P*U!Q![+b!c!}*|#R#S*|#T#o*|~*ZZR~O!O*|!O!P*|!P!Q*|!Q![*|![!c*|!c!}*|!}#R*|#R#S*|#S#T*|#T#o*|#o~*|~+RTR~!O!P*|!Q![*|!c!}*|#R#S*|#T#o*|~+iZZ~R~!O!P*|!Q![+b!c!g*|!g!h,[!h!}*|#R#S*|#T#X*|#X#Y,[#Y#]*|#]#^-z#^#o*|~,aVR~{|,v}!O,v!O!P*|!Q![-^!c!}*|#R#S*|#T#o*|~,yP!Q![,|~-RQZ~!Q![,|#]#^-X~-^O]~~-eVZ~R~!O!P*|!Q![-^!c!}*|#R#S*|#T#]*|#]#^-z#^#o*|~.RT]~R~!O!P*|!Q![*|!c!}*|#R#S*|#T#o*|~.gO#W~~.lWZ~!O!P/U!Q![0^!g!h0u!n!o0X!z!{1g#X#Y0u#]#^-X#l#m1g~/ZTZ~!Q![/j!g!h/{!n!o0X#X#Y/{#]#^-X~/oSZ~!Q![/j!g!h/{#X#Y/{#]#^-X~0OR{|,v}!O,v!Q![,|~0^OS~~0cUZ~!O!P/U!Q![0^!g!h0u!n!o0X#X#Y0u#]#^-X~0xR{|1R}!O1R!Q![1X~1UP!Q![1X~1^RZ~!Q![1X!n!o0X#]#^-X~1jU!O!P1|!Q![2`!c!i2`!r!s/{#T#Z2`#d#e/{~2PT!Q![1|!c!i1|!r!s/{#T#Z1|#d#e/{~2cV!O!P1|!Q![2`!c!i2`!n!o0X!r!s/{#T#Z2`#d#e/{~2{P![!]3O~3TP#Q~![!]3W~3]O#R~~3`R}!O3i!^!_3n!_!`3y~3nO!|~~3qP}!O3t~3yO#O~~4OO#_~~4TP!r~!_!`4W~4]O#[~~4`P!_!`4c~4hO#^~~4mO#T~~4rP!w~!}#O4u~4zO!z~R5PP!yP#P#Q5SQ5XO!{Q~5^O#U~~5aQO#S5g#T~5g~5jRO#S5g#S#T%^#T~5g~5xO!u~~5}P#e~#p#q6Q~6VO#f~~6[O!t~",tokenizers:[0,1],topRules:{Script:[0,2]},specialized:[{term:3,get:i=>E1[i]||-1}],tokenPrec:0});var A1=1,Xg=194,Wg=195,Q1=196,Vg=197,M1=198,_1=199,D1=200,$1=2,Ig=3,Lg=201,V1=24,L1=25,q1=49,B1=50,X1=55,W1=56,I1=57,N1=59,j1=60,z1=61,U1=62,F1=63,H1=65,G1=238,Y1=71,Z1=241,J1=242,K1=243,ek=244,tk=245,ik=246,nk=247,rk=248,Ng=72,sk=249,ok=250,ak=251,lk=252,hk=253,ck=254,fk=255,uk=256,dk=73,pk=77,mk=263,gk=112,Ok=130,yk=151,bk=152,wk=155,Li=10,jr=13,Yc=32,sa=9,Zc=35,vk=40,xk=46,Gc=123,qg=125,jg=39,zg=34,kk=92,Sk=111,Tk=120,Pk=78,Ck=117,Rk=85,Ek=new Set([L1,q1,B1,mk,H1,Ok,W1,I1,G1,U1,F1,Ng,dk,pk,j1,z1,yk,bk,wk,gk]);function Fc(i){return i==Li||i==jr}function Hc(i){return i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102}var Ak=new Vi((i,e)=>{let t;if(i.next<0)i.acceptToken(_1);else if(e.context.flags&na)Fc(i.next)&&i.acceptToken(M1,1);else if(((t=i.peek(-1))<0||Fc(t))&&e.canShift(Vg)){let n=0;for(;i.next==Yc||i.next==sa;)i.advance(),n++;(i.next==Li||i.next==jr||i.next==Zc)&&i.acceptToken(Vg,-n)}else Fc(i.next)&&i.acceptToken(Q1,1)},{contextual:!0}),Qk=new Vi((i,e)=>{let t=e.context;if(t.flags)return;let n=i.peek(-1);if(n==Li||n==jr){let r=0,s=0;for(;;){if(i.next==Yc)r++;else if(i.next==sa)r+=8-r%8;else break;i.advance(),s++}r!=t.indent&&i.next!=Li&&i.next!=jr&&i.next!=Zc&&(r[i,e|Ug])),Dk=new ta({start:Mk,reduce(i,e,t,n){return i.flags&na&&Ek.has(e)||(e==Y1||e==Ng)&&i.flags&Ug?i.parent:i},shift(i,e,t,n){return e==Xg?new ra(i,_k(n.read(n.pos,t.pos)),0):e==Wg?i.parent:e==V1||e==X1||e==N1||e==Ig?new ra(i,0,na):Bg.has(e)?new ra(i,0,Bg.get(e)|i.flags&na):i},hash(i){return i.hash}}),$k=new Vi(i=>{for(let e=0;e<5;e++){if(i.next!="print".charCodeAt(e))return;i.advance()}if(!/\w/.test(String.fromCharCode(i.next)))for(let e=0;;e++){let t=i.peek(e);if(!(t==Yc||t==sa)){t!=vk&&t!=xk&&t!=Li&&t!=jr&&t!=Zc&&i.acceptToken(A1);return}}}),Vk=new Vi((i,e)=>{let{flags:t}=e.context,n=t&Xt?zg:jg,r=(t&Wt)>0,s=!(t&It),o=(t&Nt)>0,a=i.pos;for(;!(i.next<0);)if(o&&i.next==Gc)if(i.peek(1)==Gc)i.advance(2);else{if(i.pos==a){i.acceptToken(Ig,1);return}break}else if(s&&i.next==kk){if(i.pos==a){i.advance();let l=i.next;l>=0&&(i.advance(),Lk(i,l)),i.acceptToken($1);return}break}else if(i.next==n&&(!r||i.peek(1)==n&&i.peek(2)==n)){if(i.pos==a){i.acceptToken(Lg,r?3:1);return}break}else if(i.next==Li){if(r)i.advance();else if(i.pos==a){i.acceptToken(Lg);return}break}else i.advance();i.pos>a&&i.acceptToken(D1)});function Lk(i,e){if(e==Sk)for(let t=0;t<2&&i.next>=48&&i.next<=55;t++)i.advance();else if(e==Tk)for(let t=0;t<2&&Hc(i.next);t++)i.advance();else if(e==Ck)for(let t=0;t<4&&Hc(i.next);t++)i.advance();else if(e==Rk)for(let t=0;t<8&&Hc(i.next);t++)i.advance();else if(e==Pk&&i.next==Gc){for(i.advance();i.next>=0&&i.next!=qg&&i.next!=jg&&i.next!=zg&&i.next!=Li;)i.advance();i.next==qg&&i.advance()}}var qk=fn({'async "*" "**" FormatConversion FormatSpec':b.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":b.controlKeyword,"in not and or is del":b.operatorKeyword,"from def class global nonlocal lambda":b.definitionKeyword,import:b.moduleKeyword,"with as print":b.keyword,Boolean:b.bool,None:b.null,VariableName:b.variableName,"CallExpression/VariableName":b.function(b.variableName),"FunctionDefinition/VariableName":b.function(b.definition(b.variableName)),"ClassDefinition/VariableName":b.definition(b.className),PropertyName:b.propertyName,"CallExpression/MemberExpression/PropertyName":b.function(b.propertyName),Comment:b.lineComment,Number:b.number,String:b.string,FormatString:b.special(b.string),Escape:b.escape,UpdateOp:b.updateOperator,"ArithOp!":b.arithmeticOperator,BitOp:b.bitwiseOperator,CompareOp:b.compareOperator,AssignOp:b.definitionOperator,Ellipsis:b.punctuation,At:b.meta,"( )":b.paren,"[ ]":b.squareBracket,"{ }":b.brace,".":b.derefOperator,", ;":b.separator}),Bk={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},oa=Sn.deserialize({version:14,states:"##jO`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5QQdO'#DoOOQS,5:Y,5:YO5eQdO'#HdOOQS,5:],5:]O5rQ!fO,5:]O5wQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8gQdO,59bO8lQdO,59bO8sQdO,59jO8zQdO'#HTO:QQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:iQdO,59aO'vQdO,59aO:wQdO,59aOOQS,59y,59yO:|QdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;[QdO,5:QO;aQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;rQdO,5:UO;wQdO,5:WOOOW'#Fy'#FyO;|OWO,5:aOOQS,5:a,5:aOOOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!/RQtO1G.|O!/YQtO1G.|O1lQdO1G.|O!/uQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!/|QdO1G/eO!0^QdO1G/eO!0fQdO1G/fO'vQdO'#H[O!0kQdO'#H[O!0pQtO1G.{O!1QQdO,59iO!2WQdO,5=zO!2hQdO,5=zO!2pQdO1G/mO!2uQtO1G/mOOQS1G/l1G/lO!3VQdO,5=uO!3|QdO,5=uO0rQdO1G/qO!4kQdO1G/sO!4pQtO1G/sO!5QQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!5bQdO'#HxO0rQdO'#HxO!5sQdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!6RQ#xO1G2zO!6rQtO1G2zO'vQdO,5kOOQS1G1`1G1`O!7xQdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!7}QdO'#FrO!8YQdO,59oO!8bQdO1G/XO!8lQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!9]QdO'#GtOOQS,5jO!;QQdO,5>jO1XQdO,5>jO!;cQdO,5>iOOQS-E:R-E:RO!;hQdO1G0lO!;sQdO1G0lO!;xQdO,5>lO!lO!hO!<|QdO,5>hO!=_QdO'#EpO0rQdO1G0tO!=jQdO1G0tO!=oQgO1G0zO!AmQgO1G0}O!EhQdO,5>oO!ErQdO,5>oO!EzQtO,5>oO0rQdO1G1PO!FUQdO1G1PO4iQdO1G1UO!!sQdO1G1WOOQV,5;a,5;aO!FZQfO,5;aO!F`QgO1G1QO!JaQdO'#GZO4iQdO1G1QO4iQdO1G1QO!JqQdO,5>pO!KOQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!KWQdO'#FSO!KiQ!fO1G1WO!KqQdO1G1WOOQV1G1]1G1]O4iQdO1G1]O!KvQdO1G1]O!LOQdO'#F^OOQV1G1b1G1bO!#WQtO1G1bPOOO1G2v1G2vP!LTOSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!LYQdO,5=|O!LmQdO,5=|OOQS1G/u1G/uO!LuQdO,5>PO!MVQdO,5>PO!M_QdO,5>PO!MrQdO,5>PO!NSQdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!8bQdO7+$pO# uQdO1G.|O# |QdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO#!TQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO#!eQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO#!jQdO7+%PO#!rQdO7+%QO#!wQdO1G3fOOQS7+%X7+%XO##XQdO1G3fO##aQdO7+%XOOQS,5<_,5<_O'vQdO,5<_O##fQdO1G3aOOQS-E9q-E9qO#$]QdO7+%]OOQS7+%_7+%_O#$kQdO1G3aO#%YQdO7+%_O#%_QdO1G3gO#%oQdO1G3gO#%wQdO7+%]O#%|QdO,5>dO#&gQdO,5>dO#&gQdO,5>dOOQS'#Dx'#DxO#&xO&jO'#DzO#'TO`O'#HyOOOW1G3}1G3}O#'YQdO1G3}O#'bQdO1G3}O#'mQ#xO7+(fO#(^QtO1G2UP#(wQdO'#GOOOQS,5bQdO,5gQdO1G4OOOQS-E9y-E9yO#?QQdO1G4OOe,5>eOOOW7+)i7+)iO#?nQdO7+)iO#?vQdO1G2zO#@aQdO1G2zP'vQdO'#FuO0rQdO<mO#AtQdO,5>mOOQS1G0v1G0vOOQS<rO#KZQdO,5>rOOQS,5>r,5>rO#KfQdO,5>qO#KwQdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<VAN>VO$ WQdO<cAN>cO0rQdO1G1|O$ hQtO1G1|P$ rQdO'#FvOOQS1G2R1G2RP$!PQdO'#F{O$!^QdO7+)jO$!wQdO,5>gOOOO-E9z-E9zOOOW<tO$4dQdO,5>tO1XQdO,5vO$)VQdO,5>vOOQS1G1p1G1pO$8[QtO,5<[OOQU7+'P7+'PO$+cQdO1G/iO$)VQdO,5wO$8jQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$)VQdO'#GdO$8rQdO1G4bO$8|QdO1G4bO$9UQdO1G4bOOQS7+%T7+%TO$9dQdO1G1tO$9rQtO'#FaO$9yQdO,5<}OOQS,5<},5<}O$:XQdO1G4cOOQS-E:a-E:aO$)VQdO,5<|O$:`QdO,5<|O$:eQdO7+)|OOQS-E:`-E:`O$:oQdO7+)|O$)VQdO,5m>pPP'Z'ZPP?PPP'Z'ZPP'Z'Z'Z'Z'Z?T?}'ZP@QP@WD_G{HPPHSH^Hb'ZPPPHeHn'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPHtIQIYPIaIgPIaPIaIaPPPIaPKuPLOLYL`KuPIaLiPIaPLpLvPLzM`M}NhLzLzNnN{LzLzLzLz! a! g! j! o! r! |!!S!!`!!r!!x!#S!#Y!#v!#|!$S!$^!$d!$j!$|!%W!%^!%d!%n!%t!%z!&Q!&W!&^!&h!&n!&x!'O!'X!'_!'n!'v!(Q!(XPPPPPPPPPPP!(_!(b!(h!(q!({!)WPPPPPPPPPPPP!-z!/`!3`!6pPP!6x!7X!7b!8Z!8Q!8d!8j!8m!8p!8s!8{!9lPPPPPPPPPPPPPPPPP!9o!9s!9yP!:_!:c!:o!:x!;U!;l!;o!;r!;x!_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To+PZS_&n`OY*xYZ%TZ]*x]^%T^#o*x#o#p+r#p#q*x#q#r+r#r;'S*x;'S;=`,^<%lO*x_+wTS_OY+rZ]+r^;'S+r;'S;=`,W<%lO+r_,ZP;=`<%l+ro,aP;=`<%l*xj,kV%rQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-XT!xY&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-oV%lQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.]V&n`&ZZOw%Twx.rx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.wV&n`Ow%Twx/^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/eT&n`&]ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/{ThZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc0cTgR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk0yXVZ&n`Oz%Tz{1f{!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk1mVaR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk2ZV%oZ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc2wTzR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To3_W%pZ&n`O!_%T!_!`-Q!`!a3w!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Td4OT&{S&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk4fX!fQ&n`O!O%T!O!P5R!P!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5WV&n`O!O%T!O!P5m!P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5tT!rZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti6[a!hX&n`O!Q%T!Q![6T![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S6T#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti7fZ&n`O{%T{|8X|}%T}!O8X!O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8^V&n`O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8z]!hX&n`O!Q%T!Q![8s![!l%T!l!m9s!m#R%T#R#S8s#S#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti9zT!hX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk:bX%qR&n`O!P%T!P!Q:}!Q!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj;UV%sQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti;ro!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!d%T!d!e?q!e!g%T!g!h7a!h!l%T!l!m9s!m!q%T!q!rA]!r!z%T!z!{Bq!{#R%T#R#S>_#S#U%T#U#V?q#V#X%T#X#Y7a#Y#^%T#^#_9s#_#c%T#c#dA]#d#l%T#l#mBq#m#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti=xV&n`O!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti>fc!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S>_#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti?vY&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti@mY!hX&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiAbX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBUX!hX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBv]&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiCv]!hX&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToDvV{_&n`O!_%T!_!`E]!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TcEdT%{R&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkEzT#gZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkFbXmR&n`O!^%T!^!_F}!_!`([!`!a([!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjGUV%mQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkGrV%zZ&n`O!_%T!_!`([!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkH`WmR&n`O!_%T!_!`([!`!aHx!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjIPV%nQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkIoV_Q#}P&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToJ_]&n`&YS%uZO!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoKZP;=`<%lJUoKge&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!tJU!t!uLx!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#gLx#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoMRa&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUkN_V&n`&`ZOr%TrsNts#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkNyV&n`Or%Trs! `s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! gT&n`&bZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! }V&n`&_ZOw%Twx!!dx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!!iV&n`Ow%Twx!#Ox#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!#VT&n`&aZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!#oe&n`&YS%uZOr%Trs!%Qsw%Twx!&px!Q%T!Q![JU![!c%T!c!tJU!t!u!(`!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#g!(`#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!%XV&n`&dZOr%Trs!%ns#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!%sV&n`Or%Trs!&Ys#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&aT&n`&fZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&wV&n`&cZOw%Twx!'^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!'cV&n`Ow%Twx!'xx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!(PT&n`&eZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!(ia&n`&YS%uZOr%Trs!)nsw%Twx!+^x!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!)uV&n`&hZOr%Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[$k,Qk,Ak,Vk,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:i=>Bk[i]||-1}],tokenPrec:7652});var zr=xr([{tag:b.keyword,class:"tok-keyword"},{tag:b.operator,class:"tok-operator"},{tag:b.definitionOperator,class:"tok-definitionOperator"},{tag:b.compareOperator,class:"tok-compareOperator"},{tag:b.attributeName,class:"tok-attributeName"},{tag:b.controlKeyword,class:"tok-controlKeyword"},{tag:b.comment,class:"tok-comment"},{tag:b.string,class:"tok-string"},{tag:b.regexp,class:"tok-string2"},{tag:b.variableName,class:"tok-variableName"},{tag:b.bool,class:"tok-bool"},{tag:b.separator,class:"tok-separator"},{tag:b.literal,class:"tok-literal"},{tag:[b.number,b.integer],class:"tok-number"},{tag:b.function(b.variableName),class:"tok-function-variableName"},{tag:b.function(b.attributeName),class:"tok-function-attributeName"}]);function Tn(i){let e=document.createElement("code");e.className="sourceCode r";function t(r,s){let o=document.createTextNode(r);if(s){let a=document.createElement("span");a.appendChild(o),a.className=s,o=a}e.appendChild(o)}function n(){e.appendChild(document.createTextNode(` +`))}return Lh(i,ia.parse(i),zr,t,n),e}function Pn(i){let e=document.createElement("code");e.className="sourceCode python";function t(r,s){let o=document.createTextNode(r);if(s){let a=document.createElement("span");a.appendChild(o),a.className=s,o=a}e.appendChild(o)}function n(){e.appendChild(document.createTextNode(` +`))}return Lh(i,oa.parse(i),zr,t,n),e}function Jc(i,e,t,n){if(typeof t=="number"&&(t=t.toLocaleString()),i.textContent.includes(e)){let r=!1;for(let s of i.children)r||=Jc(s,e,t,n);if(!r)switch(i.textContent=i.textContent.replaceAll(e,()=>t),n){case"none":break;case"r":i.innerHTML=Tn(i.textContent).innerHTML;break;case"python":i.innerHTML=Pn(i.textContent).innerHTML;break;default:throw new Error(`Can't highlight interpolation, unknown language \`${n}\`.`)}return!0}return!1}var Fg=new go,Zg=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function aa(i){return(e,t,n)=>{if(n)return!1;let r=e.node.getChild("VariableName");return r&&t(r,i),!0}}var Xk={FunctionDefinition:aa("function"),ClassDefinition:aa("class"),ForStatement(i,e,t){if(t){for(let n=i.node.firstChild;n;n=n.nextSibling)if(n.name=="VariableName")e(n,"variable");else if(n.name=="in")break}},ImportStatement(i,e){var t,n;let{node:r}=i,s=((t=r.firstChild)===null||t===void 0?void 0:t.name)=="from";for(let o=r.getChild("import");o;o=o.nextSibling)o.name=="VariableName"&&((n=o.nextSibling)===null||n===void 0?void 0:n.name)!="as"&&e(o,s?"variable":"namespace")},AssignStatement(i,e){for(let t=i.node.firstChild;t;t=t.nextSibling)if(t.name=="VariableName")e(t,"variable");else if(t.name==":"||t.name=="AssignOp")break},ParamList(i,e){for(let t=null,n=i.node.firstChild;n;n=n.nextSibling)n.name=="VariableName"&&(!t||!/\*|AssignOp/.test(t.name))&&e(n,"variable"),t=n},CapturePattern:aa("variable"),AsPattern:aa("variable"),__proto__:null};function Jg(i,e){let t=Fg.get(e);if(t)return t;let n=[],r=!0;function s(o,a){let l=i.sliceString(o.from,o.to);n.push({label:l,type:a})}return e.cursor(oe.IncludeAnonymous).iterate(o=>{if(o.name){let a=Xk[o.name];if(a&&a(o,s,r)||!r&&Zg.has(o.name))return!1;r=!1}else if(o.to-o.from>8192){for(let a of Jg(i,o.node))n.push(a);return!1}}),Fg.set(e,n),n}var Hg=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,Kg=["String","FormatString","Comment","PropertyName"];function Wk(i){let e=he(i.state).resolveInner(i.pos,-1);if(Kg.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&Hg.test(i.state.sliceDoc(e.from,e.to));if(!t&&!i.explicit)return null;let n=[];for(let r=e;r;r=r.parent)Zg.has(r.name)&&(n=n.concat(Jg(i.state.doc,r)));return{options:n,from:t?e.from:i.pos,validFor:Hg}}var Ik=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(i=>({label:i,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(i=>({label:i,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(i=>({label:i,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(i=>({label:i,type:"function"}))),Nk=[Rt("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),Rt("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),Rt("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),Rt("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),Rt(`if \${}: + +`,{label:"if",detail:"block",type:"keyword"}),Rt("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),Rt("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),Rt("import ${module}",{label:"import",detail:"statement",type:"keyword"}),Rt("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],jk=fg(Kg,Cc(Ik.concat(Nk)));function Gg(i){let{node:e,pos:t}=i,n=i.lineIndent(t,-1),r=null;for(;;){let s=e.childBefore(t);if(s)if(s.name=="Comment")t=s.from;else if(s.name=="Body")i.baseIndentFor(s)+i.unit<=n&&(r=s),e=s;else if(s.type.is("Statement"))e=s;else break;else break}return r}function Yg(i,e){let t=i.baseIndentFor(e),n=i.lineAt(i.pos,-1),r=n.from+n.text.length;return/^\s*($|#)/.test(n.text)&&i.node.tot?null:t+i.unit}var Kc=dn.define({name:"python",parser:oa.configure({props:[Cr.add({Body:i=>{var e;let t=Gg(i);return(e=Yg(i,t||i.node))!==null&&e!==void 0?e:i.continue()},IfStatement:i=>/^\s*(else:|elif )/.test(i.textAfter)?i.baseIndent:i.continue(),"ForStatement WhileStatement":i=>/^\s*else:/.test(i.textAfter)?i.baseIndent:i.continue(),TryStatement:i=>/^\s*(except |finally:|else:)/.test(i.textAfter)?i.baseIndent:i.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":Mi({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":Mi({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":Mi({closing:"]"}),"String FormatString":()=>null,Script:i=>{var e;let t=Gg(i);return(e=t&&Yg(i,t))!==null&&e!==void 0?e:i.continue()}}),Rr.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":To,Body:(i,e)=>({from:i.from+1,to:i.to-(i.to==e.doc.length?0:1)})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:)$/}});function eO(){return new pn(Kc,[Kc.data.of({autocomplete:Wk}),Kc.data.of({autocomplete:jk})])}var zk=dn.define({parser:ia.configure({props:[Cr.add({Block:Mi({closing:"}"}),"ParamList ArgList":Mi({closing:")"})}),Rr.add({Block:To})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"']},commentTokens:{line:"#"}}});function tO(){return new pn(zk)}var Yk={"arrow-repeat":iO(),"exclamation-circle":nO(),lightbulb:rO(),play:sO()};function Zk(){let i=document.querySelectorAll(".tab-content > .tab-pane");Array.from(i).forEach(t=>{t.innerHTML.trim()==""&&(t.classList.add("d-none"),document.querySelector(`.nav-item > a[data-bs-target="#${t.id}"]`)?.parentElement?.classList.add("d-none"))});let e=document.querySelectorAll(".tab-content");Array.from(e).forEach(t=>{if(Array.from(t.children).reduce((r,s)=>s.classList.contains("d-none")?r:r+1,0)==1){let r=t.querySelector(".tab-pane:not(.d-none)"),s=t.parentElement;s.appendChild(r),s.querySelector(".nav.nav-tabs").remove(),t.remove()}})}var la=class{constructor(e,t){if(typeof e!="string")throw new Error("Can't create editor, `code` must be a string.");this.container=document.createElement("div"),this.initialCode=e,this.options=Object.assign({autorun:!1,completion:!0,runbutton:!0,startover:!0,persist:!1},t),this.storageKey=`editor-${window.location.href}#${this.options.id}`;let n=[Eg,this.languageExtensions(),E.updateListener.of(a=>this.onViewUpdate(a))];if(this.options.persist){let a=window.localStorage.getItem(this.storageKey);a&&(e=a)}this.state=N.create({doc:e,extensions:n}),this.view=new E({state:this.state});let r=this.render(),s=String(t["min-lines"]||0),o=String(t["max-lines"])||"infinity";r.style.setProperty("--exercise-min-lines",s),r.style.setProperty("--exercise-max-lines",o),this.container.oninput=a=>this.onInput(a),this.container.appendChild(r),this.container.value={code:this.options.autorun?e:null,options:this.options},this.container.value.indicator=this.indicator=new Ke({runningCallback:()=>{Array.from(this.container.getElementsByClassName("exercise-editor-eval-indicator")).forEach(a=>a.classList.remove("d-none"))},finishedCallback:()=>{Array.from(this.container.getElementsByClassName("exercise-editor-eval-indicator")).forEach(a=>a.classList.add("d-none"))},busyCallback:()=>{Array.from(this.container.getElementsByClassName("exercise-editor-btn-run-code")).forEach(a=>a.classList.add("disabled"))},idleCallback:()=>{Array.from(this.container.getElementsByClassName("exercise-editor-btn-run-code")).forEach(a=>a.classList.remove("disabled"))}})}onInput(e){if(this.options.runbutton&&!e.detail.commit){e.preventDefault(),e.stopImmediatePropagation();return}this.container.value.code=this.view.state.doc.toString(),"code"in e.detail&&(this.container.value.code=e.detail.code),this.options.persist&&window.localStorage.setItem(this.storageKey,this.container.value.code)}onViewUpdate(e){e.docChanged&&this.container.dispatchEvent(new CustomEvent("input",{detail:{commit:!1}}))}renderButton(e){let t=document.createElement("a"),n=document.createElement("span");return t.className=`d-flex align-items-center gap-1 btn btn-exercise-editor ${e.className} text-nowrap`,t.setAttribute("role","button"),t.setAttribute("aria-label",e.text),n.className="btn-label-exercise-editor",n.innerText=e.text,t.innerHTML=Yk[e.icon],t.appendChild(n),t.onclick=e.onclick||null,t.onkeydown=e.onclick||null,t}renderButtonGroup(e){let t=document.createElement("div");return t.className="btn-group btn-group-exercise-editor btn-group-sm",e.forEach(n=>t.appendChild(n)),t}renderSpinner(){let e=document.createElement("div");return e.className="exercise-editor-eval-indicator spinner-grow spinner-grow-sm",e.setAttribute("role","status"),e}renderHintButton(e,t){return Array.from(e).reduceRight((n,r,s,o)=>this.renderButton({text:s===0?"Show Hint":"Next Hint",icon:"lightbulb",className:"btn-outline-dark btn-sm",onclick:function(){s>0&&o[s-1].classList.add("d-none"),r.classList.remove("d-none"),n?this.replaceWith(n):this.remove()}}),t)}renderSolutionButton(e,t){return this.renderButton({text:"Show Solution",icon:"exclamation-circle",className:"btn-exercise-solution btn-outline-dark btn-sm",onclick:function(){t&&t.forEach(n=>n.classList.add("d-none")),Array.from(e).forEach(n=>{n.classList.remove("d-none")}),this.remove()}})}renderHintsTabset(e,t){let n=new Set;e.forEach(s=>{let o=s.parentElement;o.id.includes("tabset-")&&n.add(o)});let r=new Set;return t.forEach(s=>{let o=s.parentElement;o.id.includes("tabset-")&&r.add(o)}),n.forEach(s=>{let o=document.createElement("div");o.className="d-flex justify-content-between exercise-tab-pane-header";let a=s.querySelectorAll(`.exercise-hint[data-exercise="${this.options.exercise}"]`);o.appendChild(this.renderHintButton(a,null)),s.prepend(o)}),r.forEach(s=>{let o=document.createElement("div");o.className="d-flex justify-content-between exercise-tab-pane-header";let a=s.querySelectorAll(`.exercise-solution[data-exercise="${this.options.exercise}"]`);o.appendChild(this.renderSolutionButton(a,null)),s.prepend(o)}),null}renderHints(){let e=document.querySelectorAll(`.d-none.exercise-hint[data-exercise="${this.options.exercise}"]`),t=document.querySelectorAll(`.d-none.exercise-solution[data-exercise="${this.options.exercise}"]`),n=Array.from(e).some(s=>s.parentElement.id.includes("tabset-"))||Array.from(t).some(s=>s.parentElement.id.includes("tabset-")),r=null;if(n)this.renderHintsTabset(e,t);else{let s;t.length>0&&(s=this.renderSolutionButton(t,e)),r=this.renderHintButton(e,s)}return Zk(),r}render(){let e=document.createElement("div"),t=document.createElement("div"),n=document.createElement("div");e.className="card exercise-editor my-3",t.className="card-header exercise-editor-header d-flex justify-content-between",n.className="card-body exercise-editor-body p-0";let r=document.createElement("div");r.className="d-flex align-items-center gap-3";let s=document.createElement("div");s.innerHTML="caption"in this.options?this.options.caption:this.defaultCaption,r.appendChild(s);let o=[];this.options.startover&&o.push(this.renderButton({text:"Start Over",icon:"arrow-repeat",className:"btn-outline-dark",onclick:()=>{if(this.view.dispatch({changes:{from:0,to:this.view.state.doc.length,insert:this.initialCode}}),this.options.runbutton){let c=this.options.autorun?this.initialCode:null;this.container.dispatchEvent(new CustomEvent("input",{detail:{code:c,commit:!0}}))}}}));let a=this.renderHints();a&&o.push(a),o.length>0&&r.appendChild(this.renderButtonGroup(o)),t.appendChild(r);let l=document.createElement("div");l.className="d-flex align-items-center gap-3";let h=[];return this.options.runbutton&&h.push(this.renderButton({text:"Run Code",icon:"play",className:"btn-primary disabled exercise-editor-btn-run-code",onclick:()=>{this.container.dispatchEvent(new CustomEvent("input",{detail:{commit:!0}}))}})),l.appendChild(this.renderSpinner()),h.length>0&&l.appendChild(this.renderButtonGroup(h)),t.appendChild(l),e.appendChild(t),n.appendChild(this.view.dom),e.appendChild(n),e}},ha=class extends la{constructor(e,t,n){super(t,n),this.webRPromise=e,this.completionMethods=this.setupCompletion()}languageExtensions(){let e=new Dt,t=new Dt;return[Ar(zr),Xr({override:[(...n)=>this.doCompletion(...n)]}),e.of(tO()),t.of(N.tabSize.of(2)),Qe.high(qt.of([{key:"Mod-Enter",run:()=>(this.container.dispatchEvent(new CustomEvent("input",{detail:{commit:!0}})),!0)},{key:"Mod-Shift-m",run:()=>(this.view.dispatch({changes:{from:0,to:this.view.state.doc.length,insert:this.view.state.doc.toString().trimEnd()+" |> "}}),!0)}]))]}render(){return this.defaultCaption="R Code",super.render()}async setupCompletion(){let e=await this.webRPromise;return await e.evalRVoid("rc.settings(func=TRUE, fuzzy=TRUE)"),{assignLineBuffer:await e.evalR("utils:::.assignLinebuffer"),assignToken:await e.evalR("utils:::.assignToken"),assignStart:await e.evalR("utils:::.assignStart"),assignEnd:await e.evalR("utils:::.assignEnd"),completeToken:await e.evalR("utils:::.completeToken"),retrieveCompletions:await e.evalR("utils:::.retrieveCompletions")}}async doCompletion(e){if(!this.options.completion)return null;let t=await this.completionMethods,n=e.state.doc.lineAt(e.state.selection.main.head).text,{from:r,to:s,text:o}=e.matchBefore(/[a-zA-Z0-9_.:]*/)??{from:0,to:0,text:""};if(r===s&&!e.explicit)return null;await t.assignLineBuffer(n.replace(/\)+$/,"")),await t.assignToken(o),await t.assignStart(r+1),await t.assignEnd(s+1),await t.completeToken();let l=(await t.retrieveCompletions()).values.map(h=>{if(!h)throw new Error("Missing values in completion result.");return{label:h,boost:h.endsWith("=")?10:0}});return{from:r,options:l}}},ca=class extends la{constructor(e,t,n){super(t,n),this.pyodidePromise=e}render(){return this.defaultCaption="Python Code",super.render()}languageExtensions(){let e=new Dt,t=new Dt,n=[Ar(zr),e.of(eO()),t.of(N.tabSize.of(2)),Qe.high(qt.of([{key:"Mod-Enter",run:()=>(this.container.dispatchEvent(new CustomEvent("input",{detail:{commit:!0}})),!0)}]))];return this.options.completion||n.push(Xr({override:[(...r)=>null]})),n}};function Cn(i){for(var e="",t=new Uint8Array(i),n=t.byteLength,r=0;rString.fromCharCode(parseInt(t,16))))}function aO(i){return decodeURIComponent(atob(i).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join(""))}function ef(i){return typeof ImageBitmap<"u"&&i instanceof ImageBitmap}function Ur(i,e,t,...n){return i==null||ef(i)||i instanceof ArrayBuffer||ArrayBuffer.isView(i)?i:e(i)?t(i,...n):Array.isArray(i)?i.map(r=>Ur(r,e,t,...n)):typeof i=="object"?Object.fromEntries(Object.entries(i).map(([r,s])=>[r,Ur(s,e,t,...n)])):i}function fa(i){for(let e of i.getElementsByTagName("script"))if(!e.type||e.type=="text/javascript"||e.type=="module"){let t=document.createElement("script");e.async&&(t.async=e.async),e.crossOrigin&&(t.crossOrigin=e.crossOrigin),e.defer&&(t.defer=e.async),e.integrity&&(t.integrity=e.integrity),e.src&&(t.src=e.src),e.text&&(t.text=e.text),e.type&&(t.type=e.type),e.parentNode.replaceChild(t,e)}}function lO(i){return new Promise(function(e,t){var n=document.createElement("script");n.onload=()=>e(i),n.onerror=()=>t(`Can't load script: "${i}".`),n.async=!0,n.src=i,document.getElementsByTagName("head")[0].appendChild(n)})}function hO(i){let e=i.replace(/\/+/g,"/").split("/"),t=[];for(let n of e)n==="."||n===""||(n===".."?t.pop():t.push(n));return t.join("/")}var cO=[];async function Fr(i){let e=await i.toJs({depth:-1}),t=await Promise.all(e.names.map(async(n,r)=>[n,await e.values[r].toString()]));return Object.fromEntries(t)}async function tf(i,e){let t=await i.toJs({depth:-1});return await Promise.all(t.values.map(async n=>({[e]:await n.toString()})))}async function nf(i){let e=await i.toJs({depth:-1});return await Promise.all(e.values.map(t=>Fr(t)))}async function Jk(i){if(!(await(await i.class()).toArray()).includes("html_dependency"))throw new Error("Can't interpret R object of class `${classes}` as HTML dependency.");let t=await i.get("attachment"),n=await i.get("head"),r=await i.get("meta"),s=await(await i.get("name")).toString(),o=await i.get("package"),a=await i.get("restyle"),l=await i.get("script"),h=await i.get("src"),c=await i.get("stylesheet"),f=await(await i.get("version")).toString(),u={attachment:[],head:Re(n)?void 0:await n.toString(),meta:[],name:s,pkg:Re(o)?void 0:await o.toString(),restyle:Re(a)?void 0:await a.toBoolean(),script:[],src:{},stylesheet:[],version:f};if(Ui(h)?u.src={file:await h.toString()}:ot(h)&&(u.src=await Fr(h)),!Re(r)){let d=await r.toObject();u.meta=await Promise.all(Object.entries(d).map(async([m,p])=>({name:m,content:await p.toString()})))}if(Ui(c))u.stylesheet=(await c.toArray()).map(d=>({href:d}));else if(ot(c)){let d=await c.toJs({depth:-1});d.names?d.names.includes("href")?u.stylesheet=[await Fr(c)]:u.stylesheet=await nf(c):u.stylesheet=await tf(c,"href")}if(Ui(l))u.script=(await l.toArray()).map(d=>({src:d}));else if(ot(l)){let d=await l.toJs({depth:-1});d.names?d.names.includes("src")?u.script=[await Fr(l)]:u.script=await nf(l):u.script=await tf(l,"src")}if(Ui(t))u.attachment=(await t.toArray()).map((d,m)=>({key:(m+1).toString(),href:d}));else if(ot(t)){let d=await t.toJs({depth:-1});d.names?d.names.includes("href")?(u.attachment=[await Fr(t)],u.attachment[0].key="1"):(u.attachment=await nf(t),u.attachment.forEach((m,p)=>{m.key=(p+1).toString()})):(u.attachment=await tf(t,"href"),u.attachment.forEach((m,p)=>{m.key=(p+1).toString()}))}return u}async function rf(i,e){let t=await Jk(e),n=t.pkg?await i.evalRString(`find.package("${t.pkg}")`):"";if(t.name in cO)return!1;if(cO[t.name]=t.version,t.head){let r=document.createElement("div");r.innerHTML=t.head,r.childNodes.forEach(s=>document.head.appendChild(s))}if(t.meta&&t.meta.forEach(async r=>{let s=document.createElement("meta");Object.entries(r).map(([o,a])=>{s.setAttribute(o,a||"")}),document.head.appendChild(s)}),t.stylesheet&&t.stylesheet.forEach(async r=>{let s=document.createElement("link");if(t.src.file){let o=await i.FS.readFile(`${n}/${t.src.file}/${r.href}`);r.href=`data:text/css;base64,${Cn(o)}`}else r.href=`${t.src.href}/${r.href}`;r.rel||(s.rel="stylesheet"),r.type||(s.type="text/css"),Object.entries(r).map(([o,a])=>{s.setAttribute(o,a||"")}),document.head.appendChild(s)}),t.script){let r=t.script.map(async s=>{let o=document.createElement("script");if(t.src.file){let l=await i.FS.readFile(`${n}/${t.src.file}/${s.src}`);s.src=`data:text/javascript;base64,${Cn(l)}`}else s.src=`${t.src.href}/${s.src}`;o.async=!1,Object.entries(s).map(([l,h])=>{l==="async"&&(o.async=h==="true"),o.setAttribute(l,h||"")});let a=new Promise((l,h)=>{o.onload=()=>l(null),o.onerror=c=>h(c)});return document.head.appendChild(o),a});await Promise.allSettled(r)}return!0}var Rn=class{constructor(e,t){this.manager=e;let n=t.options;!n.exercise||n.envir==="global"?(this.labels={prep:n.envir,result:n.envir,grading:n.envir,solution:n.envir,global:"global"},this.discard=!1):(this.labels={prep:`${n.envir}-prep`,result:`${n.envir}-result`,grading:`${n.envir}-grading`,solution:`${n.envir}-solution`,global:"global"},this.discard=n.envir===`exercise-env-${n.exercise}`)}get(e="global"){return this.manager.get(this.labels[e])}bind(e,t,n="global"){return this.manager.bind(e,t,this.labels[n])}create(e,t){return this.manager.create(this.labels[e],this.labels[t],this.discard)}destroy(e){return this.manager.destroy(this.labels[e])}},En=class i{constructor(e){this.env={};this.shelter=new e.Shelter,this.env.global=Promise.resolve().then(()=>e.objs.globalEnv)}static#e;static instance(e){return i.#e||(i.#e=new i(e)),i.#e}async toR(e){if(!e||ee(e))return e;let t=await this.shelter;if(e.constructor===Object)try{return await new t.RObject(e)}catch(n){let r=n;if(!r.message.includes("Can't construct `data.frame`"))throw r;return await new t.RList(Object.fromEntries(await Promise.all(Object.entries(e).map(async([s,o])=>[s,await this.toR(o)]))))}if(e.constructor===Array)try{return await new t.RObject(e)}catch(n){let r=n;if(!r.message.includes("Can't construct `data.frame`"))throw r;return await new t.RList(await Promise.all(e.map(s=>this.toR(s))))}return e}async get(e="global"){let t=await this.shelter;return e in this.env||(this.env[e]=t.evalR("new.env(parent = globalenv())")),await this.env[e]}async bind(e,t,n="global"){let r=await this.get(n);t=await this.toR(t),await r.bind(e,t)}async create(e,t,n=!0){if(e===t||e==="global")return this.get(e);if(e in this.env){if(!n)return this.get(e);await this.destroy(e)}let r=await this.shelter,s=await this.get(t);return this.env[e]=r.evalR("new.env(parent = parent)",{env:{parent:s}}),await this.env[e]}async destroy(e){if(e=="global"||!(e in this.env))return;let t=await this.shelter,n=await this.env[e];try{await t.destroy(n)}catch(r){let s=r;if(!s.message.includes("Can't find object in shelter."))throw s}delete this.env[e]}},An=class i{constructor(e){this.env={};this.pyodide=e,this.env.global=Promise.resolve().then(()=>e.toPy({}))}static#e;static instance(e){return i.#e||(i.#e=new i(e)),i.#e}async get(e="global"){return e in this.env||(this.env[e]=this.pyodide.toPy({})),await this.env[e]}async bind(e,t,n="global"){let r=await this.get(n),s=await this.pyodide.toPy({environment:r,key:e,value:t});await this.pyodide.runPythonAsync("environment[key] = value",{locals:s}),s.destroy()}async create(e,t,n=!0){if(e===t||e==="global")return this.get(e);n&&e in this.env&&await this.destroy(e);let r=await this.get(e),s=await this.get(t),o=await this.pyodide.toPy({target:r,parent:s});return await this.pyodide.runPythonAsync("target.update(parent)",{locals:o}),o.destroy(),await this.env[e]}async destroy(e){if(e=="global"||!(e in this.env))return;await(await this.env[e]).destroy(),delete this.env[e]}};var ua=class{constructor(e,t){this.container=this.newContainer(),this.nullResult={result:null,evaluate_result:null,evaluator:this},this.container.value=this.nullResult,this.webR=e,this.context=t,this.shelter=new e.Shelter,this.envManager=new Rn(En.instance(e),t),this.context.code&&(this.context.code=this.context.code.replace(/\n\n+$/,` +`)),this.options=Object.assign({envir:"global",eval:!0,echo:!1,warning:!0,error:!0,include:!0,output:!0,timelimit:30},t.options)}newContainer(){let e=document.createElement("div");return e.classList.add("cell-output-container"),e.classList.add("cell-output-container-webr"),e}async purge(){(await this.shelter).purge()}getSetupCode(){let e=this.options.exercise,t=document.querySelectorAll(`script[type="exercise-setup-${e}-contents"]`);if(t.length>0)return t.length>1&&console.warn(`Multiple \`setup\` blocks found for exercise "${e}", using the first.`),JSON.parse(atob(t[0].textContent)).code}async process(e){if(!this.options.eval){this.container=this.asSourceHTML(this.context.code),this.container.value=this.nullResult;return}if(this.options.exercise&&this.context.code&&this.context.code.match(/_{6}_*/g)){this.container.value.result=null;return}let t=this.context.indicator;this.context.indicator||(t=new Ke),t.running();try{await Promise.all(Object.entries(e).map(async([l,h])=>{await this.envManager.bind(l,h,"prep")}));let n=this.getSetupCode();await this.evaluate(n,"prep"),await this.envManager.create("result","prep");let r=await this.evaluate(this.context.code,"result");if(!r)this.container.value.result=null;else if(this.options.output==="asis"){let l=await r.toArray(),h=await l[l.length-1].get("value");this.container.innerHTML=await h.toString()}else if(this.container=await this.asHtml(r),!this.options.output){let l=this.container.value;this.container=this.newContainer(),this.container.value=l}let s=await this.envManager.get("result"),a=await(await this.webR.objs.globalEnv.get(".webr_ojs")).toObject({depth:-1});typeof this.options.define=="string"?a[this.options.define]=await s.get(this.options.define):this.options.define&&Object.assign(a,Object.fromEntries(await Promise.all(this.options.define.map(async l=>{let h=await s.get(l);return[l,h]})))),Object.keys(a).forEach(async l=>{let h=await this.asOjs(a[l]);window._ojs.ojsConnector.mainModule._scope.has(l)?window._ojs.ojsConnector.mainModule.redefine(l,()=>h):window._ojs.ojsConnector.define(l)(h)}),await this.webR.evalRVoid("rm(list = ls(.webr_ojs), envir = .webr_ojs)")}finally{this.purge(),t.finished(),this.context.indicator||t.destroy()}}async evaluate(e,t,n=this.options){return e==null?null:(await(await this.shelter).captureR(` + setTimeLimit(elapsed = timelimit) + on.exit(setTimeLimit(elapsed = Inf)) + eval_result <- evaluate::evaluate( + code, + envir = envir, + keep_message = warning, + keep_warning = warning, + stop_on_error = error, + filename = "User code", + output_handler = getOption("webr.evaluate.handler") + ) + knitr:::merge_low_plot(eval_result) + `,{env:{code:e,timelimit:Number(n.timelimit),envir:await this.envManager.get(t),warning:n.warning,error:n.error?0:1}})).result}asSourceHTML(e){let t=document.createElement("div"),n=document.createElement("pre");t.className="sourceCode",n.className="sourceCode r";let r=Tn(e);return n.appendChild(r),t.appendChild(n),t}async asHtml(e,t=this.options){let n=[],r=this.newContainer();r.value=this.nullResult;let s=()=>{if(t.echo&&n.length){let m=document.createElement("div"),p=document.createElement("pre");m.className="sourceCode",p.className="sourceCode r";let g=Tn(n.join(""));p.appendChild(g),m.appendChild(p),r.appendChild(m)}n.length=0},o=m=>{let p=document.createElement("div");p.className="exercise-cell-output cell-output cell-output-webr cell-output-stdout",p.innerHTML=`
${m}
`,t.output&&(s(),r.appendChild(p))},a=m=>{let p=document.createElement("div");p.className="exercise-cell-output cell-output cell-output-webr cell-output-stderr",p.innerHTML=`
${m}
`,t.output&&(s(),r.appendChild(p))},l=m=>{let p=document.createElement("canvas");p.width=m.width,p.height=m.height,p.className="img-fluid figure-img",p.style.width=`${2*m.width/3}px`,p.getContext("bitmaprenderer").transferFromImageBitmap(m);let g=document.createElement("div");g.className="cell-output-display cell-output-webr",g.appendChild(p),t.output&&(s(),r.appendChild(g))},h=async(m,p,g)=>{if(t.output){s();let O=await u.evalR("format(cnd, backtrace = FALSE)",{env:{cnd:m}}),y=await O.names(),v="",x="";if(y&&y.includes("message")){let P=await m.get("message"),C=await m.get("call");x=await gs(C)?` in \`${await C.deparse()}\``:": ",v=`${g}: ${await P.toString()}`}else v=await O.toString();let w=document.createElement("div");w.innerHTML=` +
+
+
+
R ${g}${x}
+
+
+

+          
+
+ `,w.querySelector(".callout-body pre").appendChild(document.createTextNode(v)),r.appendChild(w)}},c=async m=>{if(t.output){let p=await m.toString(),g=await(await m.attrs()).get("knit_meta"),O=document.createElement("div");if(O.className="cell-output cell-output-webr",O.innerHTML=p,fa(O),s(),r.appendChild(O),ot(g)){let y=await g.toArray();for(let v=0;v{if(t.output){let g=document.createElement("div"),O=document.createElement("img");g.className="cell-output-display cell-output-pyodide",O.src=`data:${m};base64, ${p}`,g.appendChild(O),r.appendChild(g)}},u=await this.shelter,d=await e.toArray();for(let m=0;m{try{let o=await this.webR.evalRNumber('72 * getOption("webr.fig.width")'),a=await this.webR.evalRNumber('72 * getOption("webr.fig.height")'),l=[],h=typeof OffscreenCanvas<"u";h||this.webR.evalRVoid(` + while (dev.cur() > 1) dev.off() + options(device = function() { + png(file = "/tmp/.webr-plot.png", width = width, height = height) + }) + `,{env:{width:o,height:a}});let c=await r.capture({withAutoprint:!0,captureGraphics:h?{width:o,height:a}:!1},...s);if(h)l=c.images;else{let f=await this.webR.evalR(` + while (dev.cur() > 1) dev.off() + filename <- "/tmp/.webr-plot.png" + if (file.exists(filename)) { + filesize <- file.info(filename)[["size"]] + readBin(filename, "raw", n = filesize) + } else NULL + `);if(Ja(f)){let u=await f.toTypedArray(),d=document.createElement("img");d.src=`data:image/png;base64, ${Cn(u)}`,l=[d]}}if(l.length){let f=await this.asOjs(l[l.length-1]);return f.value=await this.asOjs(c.result),f}return await this.asOjs(c.result)}finally{this.webR.globalShelter.purge()}};switch(r._payload.obj.type){case"null":return null;case"character":if((await(await r.class()).toArray()).includes("knit_asis")){let o=await r.toString(),a=await(await r.attrs()).get("knit_meta"),l=document.createElement("div");if(l.className="cell-output",l.innerHTML=o,ot(a)){let h=await a.toArray();for(let c=0;c{window.HTMLWidgets.staticRender()},250),l}case"logical":case"double":case"raw":case"integer":return await r.toArray();case"list":{let o=await(await r.attrs()).get("class");if(!Re(o)&&(await o.toArray()).includes("data.frame"))return await r.toD3()}case"environment":case"pairlist":{let s={},o=await r.toJs({depth:-1});for(let a=0;a0)return t.length>1&&console.warn(`Multiple \`setup\` blocks found for exercise "${e}", using the first.`),JSON.parse(atob(t[0].textContent)).code}async process(e){if(!this.options.eval){this.container=this.asSourceHTML(this.context.code),this.container.value=this.nullResult;return}if(this.options.exercise&&this.context.code&&this.context.code.match(/_{6}_*/g)){this.container.value.result=null;return}let t=this.context.indicator;this.context.indicator||(t=new Ke),t.running();try{await Promise.all(Object.entries(e).map(async([a,l])=>{await this.envManager.bind(a,l,"prep")}));let n=this.getSetupCode();await this.evaluate(n,"prep"),await this.envManager.create("result","prep");let r=await this.evaluate(this.context.code,"result");if(!r)this.container.value.result=null;else if(this.options.output==="asis")this.container.innerHTML=await r.stdout;else if(this.container=await this.asHtml(r),!this.options.output){let a=this.container.value;this.container=this.newContainer(),this.container.value=a}let s=await this.envManager.get("result"),o={};typeof this.options.define=="string"?o[this.options.define]=await s.get(this.options.define):this.options.define&&Object.assign(o,Object.fromEntries(await Promise.all(this.options.define.map(async a=>{let l=await s.get(a);return[a,l]})))),Object.keys(o).forEach(async a=>{let l=await this.asOjs(o[a]);window._ojs.ojsConnector.mainModule._scope.has(a)?window._ojs.ojsConnector.mainModule.redefine(a,()=>l):window._ojs.ojsConnector.define(a)(l)})}finally{t.finished(),this.context.indicator||t.destroy()}}async evaluate(e,t,n=this.options){if(e==null)return null;await this.pyodide.loadPackagesFromImports(e);let[r,s,o]=[7,5,100];"fig-width"in this.options&&(r=Number(this.options["fig-width"])),"fig-height"in this.options&&(s=Number(this.options["fig-height"])),"fig-dpi"in this.options&&(o=Number(this.options["fig-dpi"]));let a=await this.pyodide.toPy({code:e,dpi:o,width:r,height:s,environment:await this.envManager.get(t)}),l=await this.pyodide.runPythonAsync(atob(fO()),{locals:a});a.destroy();let h=await l.get("value"),c=await l.get("stdout"),f=await l.get("stderr"),u=await l.get("outputs");return{value:h,stdout:c,stderr:f,outputs:u}}asSourceHTML(e){let t=document.createElement("div"),n=document.createElement("pre");t.className="sourceCode",n.className="sourceCode python";let r=Pn(e);return n.appendChild(r),t.appendChild(n),t}async asOjs(e){return Object.getOwnPropertyNames(e).includes("toJs")?e.toJs():e}async asHtml(e,t=this.options){let n=this.newContainer();if(n.value=this.nullResult,!e)return n;let r=h=>{if(h.width<=1&&h.height<=1)return;let c=document.createElement("canvas");c.width=h.width,c.height=h.height,c.className="img-fluid figure-img",c.style.width=`${2*h.width/3}px`,c.getContext("bitmaprenderer").transferFromImageBitmap(h);let f=document.createElement("div");f.className="cell-output-display cell-output-pyodide",f.appendChild(c),t.output&&n.appendChild(f)},s=h=>{if(t.output){let c=document.createElement("div");c.appendChild(document.createTextNode(h)),c.className="cell-output cell-output-pyodide",c.innerHTML=`
${c.innerHTML}
`,n.appendChild(c)}},o=async h=>{let c=await this.pyodide.runPythonAsync(` + import ipywidgets as widgets + import json + json.dumps(widgets.Widget.get_manager_state()) + `);Qn||(Qn=document.createElement("script"),Qn.type="application/vnd.jupyter.widget-state+json",Qn=document.body.appendChild(Qn),await lO("https://cdn.jsdelivr.net/npm/@jupyter-widgets/html-manager@1.0.11/dist/embed.js")),Qn.innerHTML=c;let f=await this.pyodide.toPy({widget:h}),u=await this.pyodide.runPythonAsync(` + import json + json.dumps(widget) + `,{locals:f});f.destroy();let d=document.createElement("script");d.type="application/vnd.jupyter.widget-view+json",d.innerHTML=u,n.appendChild(d),dispatchEvent(new Event("load"))},a=async h=>{if(t.output){let c=document.createElement("div");c.className="cell-output cell-output-pyodide",c.innerHTML=h,fa(c),n.appendChild(c)}},l=async(h,c)=>{if(t.output){let f=document.createElement("div"),u=document.createElement("img");f.className="cell-output-display cell-output-pyodide",u.src=`data:${h};base64, ${c}`,f.appendChild(u),n.appendChild(f)}};if(t.echo){let h=document.createElement("div"),c=document.createElement("pre");h.className="sourceCode",c.className="sourceCode python";let f=Pn(this.context.code);c.appendChild(f),h.appendChild(c),n.appendChild(h)}if(e.stdout){let h=document.createElement("div");h.className="exercise-cell-output cell-output cell-output-pyodide cell-output-stdout",h.innerHTML="
",h.querySelector("code").textContent=e.stdout,n.appendChild(h)}if(e.stderr){let h=document.createElement("div");h.className="exercise-cell-output cell-output cell-output-pyodide cell-output-stderr",h.innerHTML="
",h.querySelector("code").textContent=e.stderr,n.appendChild(h)}for(let h=0;h0)return t.length>1&&console.warn(`Multiple \`check\` blocks found for exercise "${e}", using the first.`),JSON.parse(atob(t[0].textContent)).code}};var pa=class extends Mn{constructor(e){super(e),this.webR=this.evaluator.webR}async gradeExercise(){let e=this.context.code;if(!e)return null;let t=await this.blankCheck(e);if(!Re(t))return await this.feedbackAsHtmlAlert(t);if(t=await this.parseCheck(e),!Re(t))return await this.feedbackAsHtmlAlert(t);let n=this.context.indicator;this.context.indicator||(n=new Ke),n.running();try{if(t=await this.evaluateExercise(),Re(t))return null;let r=await this.evaluator.asHtml(t,this.options),s=await r.value.result,o=await(await s.class()).toArray();if(o.includes("gradethis_graded")||o.includes("gradethis_feedback"))return await this.feedbackAsHtmlAlert(s);if(ot(s)){let a=await s.get("message"),l=await s.get("correct");if(!Re(a)&&!Re(l))return await this.feedbackAsHtmlAlert(s)}return r}finally{n.finished(),this.context.indicator||n.destroy()}}async parseCheck(e,t){let n=await this.evaluator.shelter;try{return await n.evalR("parse(text = user_code)",{env:{user_code:e}}),this.evaluator.webR.objs.null}catch{return await new n.RList({message:await n.evalR(`htmltools::HTML(" + It looks like this might not be valid R code. + R cannot determine how to turn your text into a complete command. + You may have forgotten to fill in a blank, + to remove an underscore, to include a comma between arguments, + or to close an opening ", ', ( + or { with a matching ", ', + ) or }. + ")`),correct:!1,location:"append",type:"error"})}finally{n.purge()}}async blankCheck(e){let t=await this.evaluator.shelter;return e.match(/_{6}_*/g)?await new t.RList({message:"Please replace ______ with valid code.",correct:!1,location:"append",type:"info"}):this.evaluator.webR.objs.null}async evaluateSolution(){let e=this.evaluator.options.exercise,t=document.querySelectorAll(`.exercise-solution[data-exercise="${e}"] > code.solution-code`);if(t.length>0){t.length>1&&console.warn(`Multiple solutions found for exercise "${e}", using first solution.`);let n=await this.evaluator.shelter;await this.envManager.create("solution","prep");let r=await this.envManager.get("solution"),s=t[0].textContent,o=await n.evalR(s,{env:r});return{envir:r,code:s,result:o}}return null}async evaluateExercise(){await this.envManager.create("grading","result");let e=await this.evaluator.shelter;try{let t=await this.envManager.get("result"),n=this.evaluator.container.value.evaluate_result,r=await this.envManager.get("prep"),s=this.evaluator.container.value.result,o={user_code:this.context.code,stage:"check",engine:"r",label:this.context.options.exercise||this.webR.objs.null,check_code:this.getCheckingAlgorithm()||this.webR.objs.null,envir_result:t,evaluate_result:n,envir_prep:r,last_value:s,solution_code:this.webR.objs.null,solution_code_all:this.webR.objs.null,envir_solution:this.webR.objs.null,solution:this.webR.objs.null},a=await this.evaluateSolution();a&&(o.solution_code=a.code,o.solution_code_all=[a.code],o.envir_solution=a.envir,o.solution=a.result);let l=await new e.RList(o);await this.envManager.bind(".checker_args",l,"grading");let h={...this.options};return h.error=!1,h.output=!0,await this.evaluator.evaluate(`.checker <- getOption('webr.exercise.checker') + environment(.checker) <- environment() + do.call(.checker, .checker_args)`,"grading",h)}finally{e.purge()}}async feedbackAsHtmlAlert(e){let t=await this.evaluator.shelter,n=document.createElement("div"),r=await e.get("type"),s=await e.get("correct");switch(n.classList.add("alert"),n.classList.add("exercise-grade"),await r.toString()){case"success":n.classList.add("alert-success");break;case"info":n.classList.add("alert-info");break;case"warning":n.classList.add("alert-warning");break;case"error":case"danger":n.classList.add("alert-danger");break;default:{let u=await s.toArray();u.length>0&&u[0]?n.classList.add("alert-success"):n.classList.add("alert-danger")}}let o=document.createElement("span");o.className="exercise-feedback";let a=await e.get("message");a=(await t.captureR("knitr::knit_print(grade$message)",{env:{grade:e}})).result;let h=await a.toString(),c=document.createElement("div");c.innerHTML=h,n.append(...c.childNodes);let f=await e.get("error");if(!Re(f)){a=await f.get("message"),h=await a.toString();let u=await f.get("call"),d=await f.get("gradethis_call"),m=document.createElement("p"),p=document.createElement("pre");p.appendChild(document.createTextNode(`Error: ${h}`)),m.appendChild(p),n.appendChild(m);let g=document.createElement("details");p=document.createElement("pre"),p.appendChild(document.createTextNode(await u.toString())),g.appendChild(p),p=document.createElement("pre"),p.appendChild(document.createTextNode(await d.toString())),g.appendChild(p),n.appendChild(g)}return n}};var ma=class extends Mn{constructor(e){super(e),this.pyodide=this.evaluator.pyodide}async gradeExercise(){let e=this.context.code;if(!e)return null;let t=await this.blankCheck(e);if(t)return await this.feedbackAsHtmlAlert(t);if(t=await this.parseCheck(e),t)return await this.feedbackAsHtmlAlert(t);let n=this.context.indicator;this.context.indicator||(n=new Ke),n.running();try{let r=await this.evaluateExercise();if(!r.value)return null;let s=await this.evaluator.asHtml(r,this.options),o=await s.value.result.value,a,l;return await o.type==="dict"&&(a=await o.get("message"),l=await o.get("correct")),a&&l!==void 0?await this.feedbackAsHtmlAlert(o):s}finally{n.finished(),this.context.indicator||n.destroy()}}async parseCheck(e,t){try{return await this.pyodide.runPythonAsync(` + from ast import parse + parse(user_code) + `,{locals:await this.pyodide.toPy({user_code:e})}),null}catch{return await this.pyodide.toPy({message:` + It looks like this might not be valid Python code. + Python cannot determine how to turn your text into a complete command. + Your code may be indented incorrectly, or you may have forgotten to + fill in a blank, to remove an underscore, to include a comma between + arguments, or to close an opening ", ', + ( or { with a matching ", + ', ) or }. + `,correct:!1,location:"append",type:"error"})}}async blankCheck(e){return e.match(/_{6}_*/g)?await this.pyodide.toPy({message:"Please replace ______ with valid code.",correct:!1,location:"append",type:"info"}):null}async evaluateSolution(){let e=this.evaluator.options.exercise,t=document.querySelectorAll(`.exercise-solution[data-exercise="${e}"] > code.solution-code`);if(t.length>0){t.length>1&&console.warn(`Multiple solutions found for exercise "${e}", using first solution.`),await this.envManager.create("solution","prep");let n=await this.envManager.get("solution"),r=t[0].textContent,s=await this.pyodide.runPythonAsync(r,{globals:n});return{envir:n,code:r,result:s}}return null}async evaluateExercise(){await this.envManager.create("grading","result");let e=await this.envManager.get("result"),t=this.evaluator.container.value.evaluate_result,n=await this.envManager.get("prep"),r=this.evaluator.container.value.result.value,s={user_code:this.context.code,stage:"check",engine:"python",label:this.context.options.exercise,check_code:this.getCheckingAlgorithm(),envir_result:e,evaluate_result:t,envir_prep:n,last_value:r,result:r,solution_code:null,solution_code_all:null,envir_solution:null,solution:null},o=await this.evaluateSolution();o&&(s.solution_code=o.code,s.solution_code_all=[o.code],s.envir_solution=o.envir,s.solution=o.result);let a=await this.pyodide.toPy(s);await this.envManager.bind("_checker_env",a,"grading"),a.destroy();let l={...this.options};return l.error=!1,l.output=!0,await this.evaluator.evaluate(` + import pyodide + feedback = None + if (_checker_env["check_code"]): + try: + feedback = pyodide.code.eval_code( + _checker_env["check_code"], + globals = globals(), + locals = _checker_env + ) + except Exception as error: + feedback = { + 'correct': False, + 'message': 'Error while checking \`{}\`: "{}"'.format(_checker_env["label"], error), + 'type': 'error' + } + feedback + `,"grading",l)}async feedbackAsHtmlAlert(e){let t=document.createElement("div"),n=await e.get("type"),r=await e.get("correct"),s=await e.get("message");switch(t.classList.add("alert"),t.classList.add("exercise-grade"),n){case"success":t.classList.add("alert-success");break;case"info":t.classList.add("alert-info");break;case"warning":t.classList.add("alert-warning");break;case"error":case"danger":t.classList.add("alert-danger");break;default:t.classList.add(r?"alert-success":"alert-danger")}let o=document.createElement("span");return o.className="exercise-feedback",o.innerHTML=s,t.appendChild(o),t}};function eS(i){return i&&i[Symbol.toStringTag]=="PyProxy"}function uO(i){return i&&!!i[il]}function tS(i){return i&&typeof i=="object"&&"_comlinkProxy"in i&&"ptr"in i}function iS(i){return i&&i[Symbol.toStringTag]=="Map"}function sf(i){if(uO(i))return!0;if(i==null||i instanceof ArrayBuffer||ArrayBuffer.isView(i))return!1;if(i instanceof Array)return i.some(e=>sf(e));if(typeof i=="object")return Object.entries(i).some(([e,t])=>sf(t))}var dO={},pO={canHandle:eS,serialize(i){let e=self.pyodide._module.PyProxy_getPtr(i);dO[e]=i;let{port1:t,port2:n}=new MessageChannel;return ks(i,t),[[n,e],[n]]},deserialize([i,e]){i.start();let t=Wn(i);return new Proxy(t,{get:(r,s)=>s==="_ptr"?e:r[s]})}},mO={canHandle:sf,serialize(i){return[Ur(i,uO,e=>({_comlinkProxy:!0,ptr:e._ptr})),[]]},deserialize(i){return Ur(i,tS,e=>dO[e.ptr])}},gO={canHandle:ef,serialize(i){if(i.width==0&&i.height==0){let e=new OffscreenCanvas(1,1);e.getContext("2d"),i=e.transferToImageBitmap()}return[i,[i]]},deserialize(i){return i}},OO={canHandle:iS,serialize(i){return[Object.fromEntries(i.entries()),[]]},deserialize(i){return i}};async function oS(i,e){return await i.evalRVoid('options("webr.render.df" = x)',{env:{x:e.render_df||"default"}}),await i.evalRVoid(atob(yO()))}async function aS(i){await i.runPythonAsync(atob(bO()));let e=atob(wO());await i.FS.mkdir("/pyodide"),await i.FS.writeFile("/pyodide/matplotlib_display.py",e)}async function lS(i){let e=new URL("./pyodide-worker.js",import.meta.url),t=new Worker(e,{type:"module"}),r=await Wn(t).init(i);return gi.set("PyProxy",pO),gi.set("Comlink",mO),gi.set("ImageBitmap",gO),gi.set("Map",OO),r}window._exercise_ojs_runtime={PyodideExerciseEditor:ca,PyodideEvaluator:da,PyodideEnvironment:An,PyodideGrader:ma,WebR:Ka,WebRExerciseEditor:ha,WebREvaluator:ua,WebRGrader:pa,WebREnvironment:En,highlightR:Tn,highlightPython:Pn,interpolate:Jc,setupR:oS,setupPython:aS,startPyodideWorker:lS,b64Encode:oO,b64Decode:aO,collapsePath:hO};export{An as PyodideEnvironment,da as PyodideEvaluator,ca as PyodideExerciseEditor,ma as PyodideGrader,Ka as WebR,En as WebREnvironment,ua as WebREvaluator,ha as WebRExerciseEditor,pa as WebRGrader,aO as b64Decode,oO as b64Encode,hO as collapsePath,Pn as highlightPython,Tn as highlightR,Jc as interpolate,aS as setupPython,oS as setupR,lS as startPyodideWorker}; +/*! Bundled license information: + +comlink/dist/esm/comlink.mjs: + (** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: Apache-2.0 + *) +*/ diff --git a/_site/worksheets/aesthetic-mappings_files/libs/quarto-contrib/live-runtime/pyodide-worker.js b/_site/worksheets/aesthetic-mappings_files/libs/quarto-contrib/live-runtime/pyodide-worker.js new file mode 100644 index 0000000..e5ec99b --- /dev/null +++ b/_site/worksheets/aesthetic-mappings_files/libs/quarto-contrib/live-runtime/pyodide-worker.js @@ -0,0 +1,18 @@ +var je=Object.create;var U=Object.defineProperty;var Be=Object.getOwnPropertyDescriptor;var ze=Object.getOwnPropertyNames;var We=Object.getPrototypeOf,Ve=Object.prototype.hasOwnProperty;var x=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var qe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ye=(e,t)=>{for(var r in t)U(e,r,{get:t[r],enumerable:!0})},Ge=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of ze(t))!Ve.call(e,a)&&a!==r&&U(e,a,{get:()=>t[a],enumerable:!(o=Be(t,a))||o.enumerable});return e};var Je=(e,t,r)=>(r=e!=null?je(We(e)):{},Ge(t||!e||!e.__esModule?U(r,"default",{value:e,enumerable:!0}):r,e));var ae=qe(()=>{});var M={};Ye(M,{createEndpoint:()=>R,expose:()=>k,finalizer:()=>T,proxy:()=>I,proxyMarker:()=>B,releaseProxy:()=>ee,transfer:()=>oe,transferHandlers:()=>v,windowEndpoint:()=>nt,wrap:()=>A});var B=Symbol("Comlink.proxy"),R=Symbol("Comlink.endpoint"),ee=Symbol("Comlink.releaseProxy"),T=Symbol("Comlink.finalizer"),C=Symbol("Comlink.thrown"),te=e=>typeof e=="object"&&e!==null||typeof e=="function",Xe={canHandle:e=>te(e)&&e[B],serialize(e){let{port1:t,port2:r}=new MessageChannel;return k(e,t),[r,[r]]},deserialize(e){return e.start(),A(e)}},Ke={canHandle:e=>te(e)&&C in e,serialize({value:e}){let t;return e instanceof Error?t={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:t={isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},v=new Map([["proxy",Xe],["throw",Ke]]);function Qe(e,t){for(let r of e)if(t===r||r==="*"||r instanceof RegExp&&r.test(t))return!0;return!1}function k(e,t=globalThis,r=["*"]){t.addEventListener("message",function o(a){if(!a||!a.data)return;if(!Qe(r,a.origin)){console.warn(`Invalid origin '${a.origin}' for comlink proxy`);return}let{id:i,type:n,path:l}=Object.assign({path:[]},a.data),s=(a.data.argumentList||[]).map(E),u;try{let c=l.slice(0,-1).reduce((p,y)=>p[y],e),f=l.reduce((p,y)=>p[y],e);switch(n){case"GET":u=f;break;case"SET":c[l.slice(-1)[0]]=E(a.data.value),u=!0;break;case"APPLY":u=f.apply(c,s);break;case"CONSTRUCT":{let p=new f(...s);u=I(p)}break;case"ENDPOINT":{let{port1:p,port2:y}=new MessageChannel;k(e,y),u=oe(p,[p])}break;case"RELEASE":u=void 0;break;default:return}}catch(c){u={value:c,[C]:0}}Promise.resolve(u).catch(c=>({value:c,[C]:0})).then(c=>{let[f,p]=N(c);t.postMessage(Object.assign(Object.assign({},f),{id:i}),p),n==="RELEASE"&&(t.removeEventListener("message",o),re(t),T in e&&typeof e[T]=="function"&&e[T]())}).catch(c=>{let[f,p]=N({value:new TypeError("Unserializable return value"),[C]:0});t.postMessage(Object.assign(Object.assign({},f),{id:i}),p)})}),t.start&&t.start()}function Ze(e){return e.constructor.name==="MessagePort"}function re(e){Ze(e)&&e.close()}function A(e,t){return j(e,[],t)}function F(e){if(e)throw new Error("Proxy has been released and is not useable")}function ne(e){return P(e,{type:"RELEASE"}).then(()=>{re(e)})}var L=new WeakMap,_="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{let t=(L.get(e)||0)-1;L.set(e,t),t===0&&ne(e)});function et(e,t){let r=(L.get(t)||0)+1;L.set(t,r),_&&_.register(e,t,e)}function tt(e){_&&_.unregister(e)}function j(e,t=[],r=function(){}){let o=!1,a=new Proxy(r,{get(i,n){if(F(o),n===ee)return()=>{tt(a),ne(e),o=!0};if(n==="then"){if(t.length===0)return{then:()=>a};let l=P(e,{type:"GET",path:t.map(s=>s.toString())}).then(E);return l.then.bind(l)}return j(e,[...t,n])},set(i,n,l){F(o);let[s,u]=N(l);return P(e,{type:"SET",path:[...t,n].map(c=>c.toString()),value:s},u).then(E)},apply(i,n,l){F(o);let s=t[t.length-1];if(s===R)return P(e,{type:"ENDPOINT"}).then(E);if(s==="bind")return j(e,t.slice(0,-1));let[u,c]=Z(l);return P(e,{type:"APPLY",path:t.map(f=>f.toString()),argumentList:u},c).then(E)},construct(i,n){F(o);let[l,s]=Z(n);return P(e,{type:"CONSTRUCT",path:t.map(u=>u.toString()),argumentList:l},s).then(E)}});return et(a,e),a}function rt(e){return Array.prototype.concat.apply([],e)}function Z(e){let t=e.map(N);return[t.map(r=>r[0]),rt(t.map(r=>r[1]))]}var ie=new WeakMap;function oe(e,t){return ie.set(e,t),e}function I(e){return Object.assign(e,{[B]:!0})}function nt(e,t=globalThis,r="*"){return{postMessage:(o,a)=>e.postMessage(o,r,a),addEventListener:t.addEventListener.bind(t),removeEventListener:t.removeEventListener.bind(t)}}function N(e){for(let[t,r]of v)if(r.canHandle(e)){let[o,a]=r.serialize(e);return[{type:"HANDLER",name:t,value:o},a]}return[{type:"RAW",value:e},ie.get(e)||[]]}function E(e){switch(e.type){case"HANDLER":return v.get(e.name).deserialize(e.value);case"RAW":return e.value}}function P(e,t,r){return new Promise(o=>{let a=it();e.addEventListener("message",function i(n){!n.data||!n.data.id||n.data.id!==a||(e.removeEventListener("message",i),o(n.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:a},t),r)})}function it(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}var ot=Object.create,V=Object.defineProperty,at=Object.getOwnPropertyDescriptor,st=Object.getOwnPropertyNames,ct=Object.getPrototypeOf,lt=Object.prototype.hasOwnProperty,d=(e,t)=>V(e,"name",{value:t,configurable:!0}),le=(e=>typeof x<"u"?x:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof x<"u"?x:t)[r]}):e)(function(e){if(typeof x<"u")return x.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')}),ue=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ut=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of st(t))!lt.call(e,a)&&a!==r&&V(e,a,{get:()=>t[a],enumerable:!(o=at(t,a))||o.enumerable});return e},ft=(e,t,r)=>(r=e!=null?ot(ct(e)):{},ut(t||!e||!e.__esModule?V(r,"default",{value:e,enumerable:!0}):r,e)),pt=ue((e,t)=>{(function(r,o){"use strict";typeof define=="function"&&define.amd?define("stackframe",[],o):typeof e=="object"?t.exports=o():r.StackFrame=o()})(e,function(){"use strict";function r(m){return!isNaN(parseFloat(m))&&isFinite(m)}d(r,"_isNumber");function o(m){return m.charAt(0).toUpperCase()+m.substring(1)}d(o,"_capitalize");function a(m){return function(){return this[m]}}d(a,"_getter");var i=["isConstructor","isEval","isNative","isToplevel"],n=["columnNumber","lineNumber"],l=["fileName","functionName","source"],s=["args"],u=["evalOrigin"],c=i.concat(n,l,s,u);function f(m){if(m)for(var g=0;g{(function(r,o){"use strict";typeof define=="function"&&define.amd?define("error-stack-parser",["stackframe"],o):typeof e=="object"?t.exports=o(pt()):r.ErrorStackParser=o(r.StackFrame)})(e,d(function(r){"use strict";var o=/(^|@)\S+:\d+/,a=/^\s*at .*(\S+:\d+|\(native\))/m,i=/^(eval@)?(\[native code])?$/;return{parse:d(function(n){if(typeof n.stacktrace<"u"||typeof n["opera#sourceloc"]<"u")return this.parseOpera(n);if(n.stack&&n.stack.match(a))return this.parseV8OrIE(n);if(n.stack)return this.parseFFOrSafari(n);throw new Error("Cannot parse given Error object")},"ErrorStackParser$$parse"),extractLocation:d(function(n){if(n.indexOf(":")===-1)return[n];var l=/(.+?)(?::(\d+))?(?::(\d+))?$/,s=l.exec(n.replace(/[()]/g,""));return[s[1],s[2]||void 0,s[3]||void 0]},"ErrorStackParser$$extractLocation"),parseV8OrIE:d(function(n){var l=n.stack.split(` +`).filter(function(s){return!!s.match(a)},this);return l.map(function(s){s.indexOf("(eval ")>-1&&(s=s.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var u=s.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),c=u.match(/ (\(.+\)$)/);u=c?u.replace(c[0],""):u;var f=this.extractLocation(c?c[1]:u),p=c&&u||void 0,y=["eval",""].indexOf(f[0])>-1?void 0:f[0];return new r({functionName:p,fileName:y,lineNumber:f[1],columnNumber:f[2],source:s})},this)},"ErrorStackParser$$parseV8OrIE"),parseFFOrSafari:d(function(n){var l=n.stack.split(` +`).filter(function(s){return!s.match(i)},this);return l.map(function(s){if(s.indexOf(" > eval")>-1&&(s=s.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),s.indexOf("@")===-1&&s.indexOf(":")===-1)return new r({functionName:s});var u=/((.*".+"[^@]*)?[^@]*)(?:@)/,c=s.match(u),f=c&&c[1]?c[1]:void 0,p=this.extractLocation(s.replace(u,""));return new r({functionName:f,fileName:p[0],lineNumber:p[1],columnNumber:p[2],source:s})},this)},"ErrorStackParser$$parseFFOrSafari"),parseOpera:d(function(n){return!n.stacktrace||n.message.indexOf(` +`)>-1&&n.message.split(` +`).length>n.stacktrace.split(` +`).length?this.parseOpera9(n):n.stack?this.parseOpera11(n):this.parseOpera10(n)},"ErrorStackParser$$parseOpera"),parseOpera9:d(function(n){for(var l=/Line (\d+).*script (?:in )?(\S+)/i,s=n.message.split(` +`),u=[],c=2,f=s.length;c/,"$2").replace(/\([^)]*\)/g,"")||void 0,y;f.match(/\(([^)]*)\)/)&&(y=f.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var h=y===void 0||y==="[arguments not available]"?void 0:y.split(",");return new r({functionName:p,args:h,fileName:c[0],lineNumber:c[1],columnNumber:c[2],source:s})},this)},"ErrorStackParser$$parseOpera11")}},"ErrorStackParser"))}),dt=ft(mt()),w=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&typeof process.browser>"u",fe=w&&typeof module<"u"&&typeof module.exports<"u"&&typeof le<"u"&&typeof __dirname<"u",yt=w&&!fe,gt=typeof Deno<"u",pe=!w&&!gt,ht=pe&&typeof window=="object"&&typeof document=="object"&&typeof document.createElement=="function"&&typeof sessionStorage=="object"&&typeof importScripts!="function",wt=pe&&typeof importScripts=="function"&&typeof self=="object",Tt=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Chrome")==-1&&navigator.userAgent.indexOf("Safari")>-1,me,z,de,se,q;async function Y(){if(!w||(me=(await import("node:url")).default,se=await import("node:fs"),q=await import("node:fs/promises"),de=(await import("node:vm")).default,z=await import("node:path"),G=z.sep,typeof le<"u"))return;let e=se,t=await import("node:crypto"),r=await Promise.resolve().then(()=>Je(ae(),1)),o=await import("node:child_process"),a={fs:e,crypto:t,ws:r,child_process:o};globalThis.require=function(i){return a[i]}}d(Y,"initNodeModules");function ye(e,t){return z.resolve(t||".",e)}d(ye,"node_resolvePath");function ge(e,t){return t===void 0&&(t=location),new URL(e,t).toString()}d(ge,"browser_resolvePath");var W;w?W=ye:W=ge;var G;w||(G="/");function he(e,t){return e.startsWith("file://")&&(e=e.slice(7)),e.includes("://")?{response:fetch(e)}:{binary:q.readFile(e).then(r=>new Uint8Array(r.buffer,r.byteOffset,r.byteLength))}}d(he,"node_getBinaryResponse");function we(e,t){let r=new URL(e,location);return{response:fetch(r,t?{integrity:t}:{})}}d(we,"browser_getBinaryResponse");var D;w?D=he:D=we;async function ve(e,t){let{response:r,binary:o}=D(e,t);if(o)return o;let a=await r;if(!a.ok)throw new Error(`Failed to load '${e}': request failed.`);return new Uint8Array(await a.arrayBuffer())}d(ve,"loadBinaryFile");var $;if(ht)$=d(async e=>await import(e),"loadScript");else if(wt)$=d(async e=>{try{globalThis.importScripts(e)}catch(t){if(t instanceof TypeError)await import(e);else throw t}},"loadScript");else if(w)$=be;else throw new Error("Cannot determine runtime environment");async function be(e){e.startsWith("file://")&&(e=e.slice(7)),e.includes("://")?de.runInThisContext(await(await fetch(e)).text()):await import(me.pathToFileURL(e).href)}d(be,"nodeLoadScript");async function xe(e){if(w){await Y();let t=await q.readFile(e,{encoding:"utf8"});return JSON.parse(t)}else return await(await fetch(e)).json()}d(xe,"loadLockFile");async function Ee(){if(fe)return __dirname;let e;try{throw new Error}catch(o){e=o}let t=dt.default.parse(e)[0].fileName;if(yt){let o=await import("node:path");return(await import("node:url")).fileURLToPath(o.dirname(t))}let r=t.lastIndexOf(G);if(r===-1)throw new Error("Could not extract indexURL path from pyodide module location");return t.slice(0,r)}d(Ee,"calculateDirname");function ke(e){let t=e.FS,r=e.FS.filesystems.MEMFS,o=e.PATH,a={DIR_MODE:16895,FILE_MODE:33279,mount:function(i){if(!i.opts.fileSystemHandle)throw new Error("opts.fileSystemHandle is required");return r.mount.apply(null,arguments)},syncfs:async(i,n,l)=>{try{let s=a.getLocalSet(i),u=await a.getRemoteSet(i),c=n?u:s,f=n?s:u;await a.reconcile(i,c,f),l(null)}catch(s){l(s)}},getLocalSet:i=>{let n=Object.create(null);function l(c){return c!=="."&&c!==".."}d(l,"isRealDir");function s(c){return f=>o.join2(c,f)}d(s,"toAbsolute");let u=t.readdir(i.mountpoint).filter(l).map(s(i.mountpoint));for(;u.length;){let c=u.pop(),f=t.stat(c);t.isDir(f.mode)&&u.push.apply(u,t.readdir(c).filter(l).map(s(c))),n[c]={timestamp:f.mtime,mode:f.mode}}return{type:"local",entries:n}},getRemoteSet:async i=>{let n=Object.create(null),l=await vt(i.opts.fileSystemHandle);for(let[s,u]of l)s!=="."&&(n[o.join2(i.mountpoint,s)]={timestamp:u.kind==="file"?(await u.getFile()).lastModifiedDate:new Date,mode:u.kind==="file"?a.FILE_MODE:a.DIR_MODE});return{type:"remote",entries:n,handles:l}},loadLocalEntry:i=>{let n=t.lookupPath(i).node,l=t.stat(i);if(t.isDir(l.mode))return{timestamp:l.mtime,mode:l.mode};if(t.isFile(l.mode))return n.contents=r.getFileDataAsTypedArray(n),{timestamp:l.mtime,mode:l.mode,contents:n.contents};throw new Error("node type not supported")},storeLocalEntry:(i,n)=>{if(t.isDir(n.mode))t.mkdirTree(i,n.mode);else if(t.isFile(n.mode))t.writeFile(i,n.contents,{canOwn:!0});else throw new Error("node type not supported");t.chmod(i,n.mode),t.utime(i,n.timestamp,n.timestamp)},removeLocalEntry:i=>{var n=t.stat(i);t.isDir(n.mode)?t.rmdir(i):t.isFile(n.mode)&&t.unlink(i)},loadRemoteEntry:async i=>{if(i.kind==="file"){let n=await i.getFile();return{contents:new Uint8Array(await n.arrayBuffer()),mode:a.FILE_MODE,timestamp:n.lastModifiedDate}}else{if(i.kind==="directory")return{mode:a.DIR_MODE,timestamp:new Date};throw new Error("unknown kind: "+i.kind)}},storeRemoteEntry:async(i,n,l)=>{let s=i.get(o.dirname(n)),u=t.isFile(l.mode)?await s.getFileHandle(o.basename(n),{create:!0}):await s.getDirectoryHandle(o.basename(n),{create:!0});if(u.kind==="file"){let c=await u.createWritable();await c.write(l.contents),await c.close()}i.set(n,u)},removeRemoteEntry:async(i,n)=>{await i.get(o.dirname(n)).removeEntry(o.basename(n)),i.delete(n)},reconcile:async(i,n,l)=>{let s=0,u=[];Object.keys(n.entries).forEach(function(p){let y=n.entries[p],h=l.entries[p];(!h||t.isFile(y.mode)&&y.timestamp.getTime()>h.timestamp.getTime())&&(u.push(p),s++)}),u.sort();let c=[];if(Object.keys(l.entries).forEach(function(p){n.entries[p]||(c.push(p),s++)}),c.sort().reverse(),!s)return;let f=n.type==="remote"?n.handles:l.handles;for(let p of u){let y=o.normalize(p.replace(i.mountpoint,"/")).substring(1);if(l.type==="local"){let h=f.get(y),m=await a.loadRemoteEntry(h);a.storeLocalEntry(p,m)}else{let h=a.loadLocalEntry(p);await a.storeRemoteEntry(f,y,h)}}for(let p of c)if(l.type==="local")a.removeLocalEntry(p);else{let y=o.normalize(p.replace(i.mountpoint,"/")).substring(1);await a.removeRemoteEntry(f,y)}}};e.FS.filesystems.NATIVEFS_ASYNC=a}d(ke,"initializeNativeFS");var vt=d(async e=>{let t=[];async function r(a){for await(let i of a.values())t.push(i),i.kind==="directory"&&await r(i)}d(r,"collect"),await r(e);let o=new Map;o.set(".",e);for(let a of t){let i=(await e.resolve(a)).join("/");o.set(i,a)}return o},"getFsHandles");function Pe(e){let t={noImageDecoding:!0,noAudioDecoding:!0,noWasmDecoding:!1,preRun:Ce(e),quit(r,o){throw t.exited={status:r,toThrow:o},o},print:e.stdout,printErr:e.stderr,arguments:e.args,API:{config:e},locateFile:r=>e.indexURL+r,instantiateWasm:Le(e.indexURL)};return t}d(Pe,"createSettings");function Se(e){return function(t){let r="/";try{t.FS.mkdirTree(e)}catch(o){console.error(`Error occurred while making a home directory '${e}':`),console.error(o),console.error(`Using '${r}' for a home directory instead`),e=r}t.FS.chdir(e)}}d(Se,"createHomeDirectory");function Oe(e){return function(t){Object.assign(t.ENV,e)}}d(Oe,"setEnvironment");function Fe(e){return t=>{for(let r of e)t.FS.mkdirTree(r),t.FS.mount(t.FS.filesystems.NODEFS,{root:r},r)}}d(Fe,"mountLocalDirectories");function Te(e){let t=ve(e);return r=>{let o=r._py_version_major(),a=r._py_version_minor();r.FS.mkdirTree("/lib"),r.FS.mkdirTree(`/lib/python${o}.${a}/site-packages`),r.addRunDependency("install-stdlib"),t.then(i=>{r.FS.writeFile(`/lib/python${o}${a}.zip`,i)}).catch(i=>{console.error("Error occurred while installing the standard library:"),console.error(i)}).finally(()=>{r.removeRunDependency("install-stdlib")})}}d(Te,"installStdlib");function Ce(e){let t;return e.stdLibURL!=null?t=e.stdLibURL:t=e.indexURL+"python_stdlib.zip",[Te(t),Se(e.env.HOME),Oe(e.env),Fe(e._node_mounts),ke]}d(Ce,"getFileSystemInitializationFuncs");function Le(e){let{binary:t,response:r}=D(e+"pyodide.asm.wasm");return function(o,a){return async function(){try{let i;r?i=await WebAssembly.instantiateStreaming(r,o):i=await WebAssembly.instantiate(await t,o);let{instance:n,module:l}=i;typeof WasmOffsetConverter<"u"&&(wasmOffsetConverter=new WasmOffsetConverter(wasmBinary,l)),a(n,l)}catch(i){console.warn("wasm instantiation failed!"),console.warn(i)}}(),{}}}d(Le,"getInstantiateWasmFunc");var ce="0.26.1";async function J(e={}){await Y();let t=e.indexURL||await Ee();t=W(t),t.endsWith("/")||(t+="/"),e.indexURL=t;let r={fullStdLib:!1,jsglobals:globalThis,stdin:globalThis.prompt?globalThis.prompt:void 0,lockFileURL:t+"pyodide-lock.json",args:[],_node_mounts:[],env:{},packageCacheDir:t,packages:[],enableRunUntilComplete:!1},o=Object.assign(r,e);o.env.HOME||(o.env.HOME="/home/pyodide");let a=Pe(o),i=a.API;if(i.lockFilePromise=xe(o.lockFileURL),typeof _createPyodideModule!="function"){let c=`${o.indexURL}pyodide.asm.js`;await $(c)}let n;if(e._loadSnapshot){let c=await e._loadSnapshot;ArrayBuffer.isView(c)?n=c:n=new Uint8Array(c),a.noInitialRun=!0,a.INITIAL_MEMORY=n.length}let l=await _createPyodideModule(a);if(a.exited)throw a.exited.toThrow;if(e.pyproxyToStringRepr&&i.setPyProxyToStringMethod(!0),i.version!==ce)throw new Error(`Pyodide version does not match: '${ce}' <==> '${i.version}'. If you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.`);l.locateFile=c=>{throw new Error("Didn't expect to load any more file_packager files!")};let s;n&&(s=i.restoreSnapshot(n));let u=i.finalizeBootstrap(s);return i.sys.path.insert(0,i.config.env.HOME),u.version.includes("dev")||i.setCdnUrl(`https://cdn.jsdelivr.net/pyodide/v${u.version}/full/`),i._pyodide.set_excepthook(),await i.packageIndexReady,i.initializeStreams(o.stdin,o.stdout,o.stderr),u}d(J,"loadPyodide");function X(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap}function S(e,t,r,...o){return e==null||X(e)||e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e:t(e)?r(e,...o):Array.isArray(e)?e.map(a=>S(a,t,r,...o)):typeof e=="object"?Object.fromEntries(Object.entries(e).map(([a,i])=>[a,S(i,t,r,...o)])):e}function bt(e){return e&&e[Symbol.toStringTag]=="PyProxy"}function _e(e){return e&&!!e[R]}function xt(e){return e&&typeof e=="object"&&"_comlinkProxy"in e&&"ptr"in e}function Et(e){return e&&e[Symbol.toStringTag]=="Map"}function K(e){if(_e(e))return!0;if(e==null||e instanceof ArrayBuffer||ArrayBuffer.isView(e))return!1;if(e instanceof Array)return e.some(t=>K(t));if(typeof e=="object")return Object.entries(e).some(([t,r])=>K(r))}var Ne={},Re={canHandle:bt,serialize(e){let t=self.pyodide._module.PyProxy_getPtr(e);Ne[t]=e;let{port1:r,port2:o}=new MessageChannel;return k(e,r),[[o,t],[o]]},deserialize([e,t]){e.start();let r=A(e);return new Proxy(r,{get:(a,i)=>i==="_ptr"?t:a[i]})}},Ae={canHandle:K,serialize(e){return[S(e,_e,t=>({_comlinkProxy:!0,ptr:t._ptr})),[]]},deserialize(e){return S(e,xt,t=>Ne[t.ptr])}},Ie={canHandle:X,serialize(e){if(e.width==0&&e.height==0){let t=new OffscreenCanvas(1,1);t.getContext("2d"),e=t.transferToImageBitmap()}return[e,[e]]},deserialize(e){return e}},Me={canHandle:Et,serialize(e){return[Object.fromEntries(e.entries()),[]]},deserialize(e){return e}};var kt={mkdir(e){self.pyodide._FS.mkdir(e)},writeFile(e,t){self.pyodide._FS.writeFile(e,t)}};async function Pt(e){return self.pyodide=await J(e),self.pyodide.registerComlink(M),self.pyodide._FS=self.pyodide.FS,self.pyodide.FS=kt,v.set("PyProxy",Re),v.set("Comlink",Ae),v.set("ImageBitmap",Ie),v.set("Map",Me),I(self.pyodide)}k({init:Pt}); +/*! Bundled license information: + +comlink/dist/esm/comlink.mjs: + (** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: Apache-2.0 + *) +*/ diff --git a/_site/worksheets/aesthetic-mappings_files/libs/quarto-html/anchor.min.js b/_site/worksheets/aesthetic-mappings_files/libs/quarto-html/anchor.min.js new file mode 100644 index 0000000..5ac814d --- /dev/null +++ b/_site/worksheets/aesthetic-mappings_files/libs/quarto-html/anchor.min.js @@ -0,0 +1,9 @@ +// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat +// +// AnchorJS - v5.0.0 - 2023-01-18 +// https://www.bryanbraun.com/anchorjs/ +// Copyright (c) 2023 Bryan Braun; Licensed MIT +// +// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat +!function(A,e){"use strict";"function"==typeof define&&define.amd?define([],e):"object"==typeof module&&module.exports?module.exports=e():(A.AnchorJS=e(),A.anchors=new A.AnchorJS)}(globalThis,function(){"use strict";return function(A){function u(A){A.icon=Object.prototype.hasOwnProperty.call(A,"icon")?A.icon:"",A.visible=Object.prototype.hasOwnProperty.call(A,"visible")?A.visible:"hover",A.placement=Object.prototype.hasOwnProperty.call(A,"placement")?A.placement:"right",A.ariaLabel=Object.prototype.hasOwnProperty.call(A,"ariaLabel")?A.ariaLabel:"Anchor",A.class=Object.prototype.hasOwnProperty.call(A,"class")?A.class:"",A.base=Object.prototype.hasOwnProperty.call(A,"base")?A.base:"",A.truncate=Object.prototype.hasOwnProperty.call(A,"truncate")?Math.floor(A.truncate):64,A.titleText=Object.prototype.hasOwnProperty.call(A,"titleText")?A.titleText:""}function d(A){var e;if("string"==typeof A||A instanceof String)e=[].slice.call(document.querySelectorAll(A));else{if(!(Array.isArray(A)||A instanceof NodeList))throw new TypeError("The selector provided to AnchorJS was invalid.");e=[].slice.call(A)}return e}this.options=A||{},this.elements=[],u(this.options),this.add=function(A){var e,t,o,i,n,s,a,r,l,c,h,p=[];if(u(this.options),0!==(e=d(A=A||"h2, h3, h4, h5, h6")).length){for(null===document.head.querySelector("style.anchorjs")&&((A=document.createElement("style")).className="anchorjs",A.appendChild(document.createTextNode("")),void 0===(h=document.head.querySelector('[rel="stylesheet"],style'))?document.head.appendChild(A):document.head.insertBefore(A,h),A.sheet.insertRule(".anchorjs-link{opacity:0;text-decoration:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}",A.sheet.cssRules.length),A.sheet.insertRule(":hover>.anchorjs-link,.anchorjs-link:focus{opacity:1}",A.sheet.cssRules.length),A.sheet.insertRule("[data-anchorjs-icon]::after{content:attr(data-anchorjs-icon)}",A.sheet.cssRules.length),A.sheet.insertRule('@font-face{font-family:anchorjs-icons;src:url(data:n/a;base64,AAEAAAALAIAAAwAwT1MvMg8yG2cAAAE4AAAAYGNtYXDp3gC3AAABpAAAAExnYXNwAAAAEAAAA9wAAAAIZ2x5ZlQCcfwAAAH4AAABCGhlYWQHFvHyAAAAvAAAADZoaGVhBnACFwAAAPQAAAAkaG10eASAADEAAAGYAAAADGxvY2EACACEAAAB8AAAAAhtYXhwAAYAVwAAARgAAAAgbmFtZQGOH9cAAAMAAAAAunBvc3QAAwAAAAADvAAAACAAAQAAAAEAAHzE2p9fDzz1AAkEAAAAAADRecUWAAAAANQA6R8AAAAAAoACwAAAAAgAAgAAAAAAAAABAAADwP/AAAACgAAA/9MCrQABAAAAAAAAAAAAAAAAAAAAAwABAAAAAwBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAMCQAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAg//0DwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAAIAAAACgAAxAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADAAAAAIAAgAAgAAACDpy//9//8AAAAg6cv//f///+EWNwADAAEAAAAAAAAAAAAAAAAACACEAAEAAAAAAAAAAAAAAAAxAAACAAQARAKAAsAAKwBUAAABIiYnJjQ3NzY2MzIWFxYUBwcGIicmNDc3NjQnJiYjIgYHBwYUFxYUBwYGIwciJicmNDc3NjIXFhQHBwYUFxYWMzI2Nzc2NCcmNDc2MhcWFAcHBgYjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAAADACWAAEAAAAAAAEACAAAAAEAAAAAAAIAAwAIAAEAAAAAAAMACAAAAAEAAAAAAAQACAAAAAEAAAAAAAUAAQALAAEAAAAAAAYACAAAAAMAAQQJAAEAEAAMAAMAAQQJAAIABgAcAAMAAQQJAAMAEAAMAAMAAQQJAAQAEAAMAAMAAQQJAAUAAgAiAAMAAQQJAAYAEAAMYW5jaG9yanM0MDBAAGEAbgBjAGgAbwByAGoAcwA0ADAAMABAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAP) format("truetype")}',A.sheet.cssRules.length)),h=document.querySelectorAll("[id]"),t=[].map.call(h,function(A){return A.id}),i=0;i\]./()*\\\n\t\b\v\u00A0]/g,"-").replace(/-{2,}/g,"-").substring(0,this.options.truncate).replace(/^-+|-+$/gm,"").toLowerCase()},this.hasAnchorJSLink=function(A){var e=A.firstChild&&-1<(" "+A.firstChild.className+" ").indexOf(" anchorjs-link "),A=A.lastChild&&-1<(" "+A.lastChild.className+" ").indexOf(" anchorjs-link ");return e||A||!1}}}); +// @license-end \ No newline at end of file diff --git a/_site/worksheets/aesthetic-mappings_files/libs/quarto-html/popper.min.js b/_site/worksheets/aesthetic-mappings_files/libs/quarto-html/popper.min.js new file mode 100644 index 0000000..e3726d7 --- /dev/null +++ b/_site/worksheets/aesthetic-mappings_files/libs/quarto-html/popper.min.js @@ -0,0 +1,6 @@ +/** + * @popperjs/core v2.11.7 - MIT License + */ + +!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).Popper={})}(this,(function(e){"use strict";function t(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function n(e){return e instanceof t(e).Element||e instanceof Element}function r(e){return e instanceof t(e).HTMLElement||e instanceof HTMLElement}function o(e){return"undefined"!=typeof ShadowRoot&&(e instanceof t(e).ShadowRoot||e instanceof ShadowRoot)}var i=Math.max,a=Math.min,s=Math.round;function f(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function c(){return!/^((?!chrome|android).)*safari/i.test(f())}function p(e,o,i){void 0===o&&(o=!1),void 0===i&&(i=!1);var a=e.getBoundingClientRect(),f=1,p=1;o&&r(e)&&(f=e.offsetWidth>0&&s(a.width)/e.offsetWidth||1,p=e.offsetHeight>0&&s(a.height)/e.offsetHeight||1);var u=(n(e)?t(e):window).visualViewport,l=!c()&&i,d=(a.left+(l&&u?u.offsetLeft:0))/f,h=(a.top+(l&&u?u.offsetTop:0))/p,m=a.width/f,v=a.height/p;return{width:m,height:v,top:h,right:d+m,bottom:h+v,left:d,x:d,y:h}}function u(e){var n=t(e);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function l(e){return e?(e.nodeName||"").toLowerCase():null}function d(e){return((n(e)?e.ownerDocument:e.document)||window.document).documentElement}function h(e){return p(d(e)).left+u(e).scrollLeft}function m(e){return t(e).getComputedStyle(e)}function v(e){var t=m(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function y(e,n,o){void 0===o&&(o=!1);var i,a,f=r(n),c=r(n)&&function(e){var t=e.getBoundingClientRect(),n=s(t.width)/e.offsetWidth||1,r=s(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(n),m=d(n),y=p(e,c,o),g={scrollLeft:0,scrollTop:0},b={x:0,y:0};return(f||!f&&!o)&&(("body"!==l(n)||v(m))&&(g=(i=n)!==t(i)&&r(i)?{scrollLeft:(a=i).scrollLeft,scrollTop:a.scrollTop}:u(i)),r(n)?((b=p(n,!0)).x+=n.clientLeft,b.y+=n.clientTop):m&&(b.x=h(m))),{x:y.left+g.scrollLeft-b.x,y:y.top+g.scrollTop-b.y,width:y.width,height:y.height}}function g(e){var t=p(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function b(e){return"html"===l(e)?e:e.assignedSlot||e.parentNode||(o(e)?e.host:null)||d(e)}function x(e){return["html","body","#document"].indexOf(l(e))>=0?e.ownerDocument.body:r(e)&&v(e)?e:x(b(e))}function w(e,n){var r;void 0===n&&(n=[]);var o=x(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=t(o),s=i?[a].concat(a.visualViewport||[],v(o)?o:[]):o,f=n.concat(s);return i?f:f.concat(w(b(s)))}function O(e){return["table","td","th"].indexOf(l(e))>=0}function j(e){return r(e)&&"fixed"!==m(e).position?e.offsetParent:null}function E(e){for(var n=t(e),i=j(e);i&&O(i)&&"static"===m(i).position;)i=j(i);return i&&("html"===l(i)||"body"===l(i)&&"static"===m(i).position)?n:i||function(e){var t=/firefox/i.test(f());if(/Trident/i.test(f())&&r(e)&&"fixed"===m(e).position)return null;var n=b(e);for(o(n)&&(n=n.host);r(n)&&["html","body"].indexOf(l(n))<0;){var i=m(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||n}var D="top",A="bottom",L="right",P="left",M="auto",k=[D,A,L,P],W="start",B="end",H="viewport",T="popper",R=k.reduce((function(e,t){return e.concat([t+"-"+W,t+"-"+B])}),[]),S=[].concat(k,[M]).reduce((function(e,t){return e.concat([t,t+"-"+W,t+"-"+B])}),[]),V=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function q(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}function C(e){return e.split("-")[0]}function N(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&o(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function I(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function _(e,r,o){return r===H?I(function(e,n){var r=t(e),o=d(e),i=r.visualViewport,a=o.clientWidth,s=o.clientHeight,f=0,p=0;if(i){a=i.width,s=i.height;var u=c();(u||!u&&"fixed"===n)&&(f=i.offsetLeft,p=i.offsetTop)}return{width:a,height:s,x:f+h(e),y:p}}(e,o)):n(r)?function(e,t){var n=p(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(r,o):I(function(e){var t,n=d(e),r=u(e),o=null==(t=e.ownerDocument)?void 0:t.body,a=i(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=i(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),f=-r.scrollLeft+h(e),c=-r.scrollTop;return"rtl"===m(o||n).direction&&(f+=i(n.clientWidth,o?o.clientWidth:0)-a),{width:a,height:s,x:f,y:c}}(d(e)))}function F(e,t,o,s){var f="clippingParents"===t?function(e){var t=w(b(e)),o=["absolute","fixed"].indexOf(m(e).position)>=0&&r(e)?E(e):e;return n(o)?t.filter((function(e){return n(e)&&N(e,o)&&"body"!==l(e)})):[]}(e):[].concat(t),c=[].concat(f,[o]),p=c[0],u=c.reduce((function(t,n){var r=_(e,n,s);return t.top=i(r.top,t.top),t.right=a(r.right,t.right),t.bottom=a(r.bottom,t.bottom),t.left=i(r.left,t.left),t}),_(e,p,s));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function U(e){return e.split("-")[1]}function z(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function X(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?C(o):null,a=o?U(o):null,s=n.x+n.width/2-r.width/2,f=n.y+n.height/2-r.height/2;switch(i){case D:t={x:s,y:n.y-r.height};break;case A:t={x:s,y:n.y+n.height};break;case L:t={x:n.x+n.width,y:f};break;case P:t={x:n.x-r.width,y:f};break;default:t={x:n.x,y:n.y}}var c=i?z(i):null;if(null!=c){var p="y"===c?"height":"width";switch(a){case W:t[c]=t[c]-(n[p]/2-r[p]/2);break;case B:t[c]=t[c]+(n[p]/2-r[p]/2)}}return t}function Y(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function G(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function J(e,t){void 0===t&&(t={});var r=t,o=r.placement,i=void 0===o?e.placement:o,a=r.strategy,s=void 0===a?e.strategy:a,f=r.boundary,c=void 0===f?"clippingParents":f,u=r.rootBoundary,l=void 0===u?H:u,h=r.elementContext,m=void 0===h?T:h,v=r.altBoundary,y=void 0!==v&&v,g=r.padding,b=void 0===g?0:g,x=Y("number"!=typeof b?b:G(b,k)),w=m===T?"reference":T,O=e.rects.popper,j=e.elements[y?w:m],E=F(n(j)?j:j.contextElement||d(e.elements.popper),c,l,s),P=p(e.elements.reference),M=X({reference:P,element:O,strategy:"absolute",placement:i}),W=I(Object.assign({},O,M)),B=m===T?W:P,R={top:E.top-B.top+x.top,bottom:B.bottom-E.bottom+x.bottom,left:E.left-B.left+x.left,right:B.right-E.right+x.right},S=e.modifiersData.offset;if(m===T&&S){var V=S[i];Object.keys(R).forEach((function(e){var t=[L,A].indexOf(e)>=0?1:-1,n=[D,A].indexOf(e)>=0?"y":"x";R[e]+=V[n]*t}))}return R}var K={placement:"bottom",modifiers:[],strategy:"absolute"};function Q(){for(var e=arguments.length,t=new Array(e),n=0;n=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[P,L].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,i),e}),{}),s=a[t.placement],f=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=f,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}},se={left:"right",right:"left",bottom:"top",top:"bottom"};function fe(e){return e.replace(/left|right|bottom|top/g,(function(e){return se[e]}))}var ce={start:"end",end:"start"};function pe(e){return e.replace(/start|end/g,(function(e){return ce[e]}))}function ue(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,f=n.allowedAutoPlacements,c=void 0===f?S:f,p=U(r),u=p?s?R:R.filter((function(e){return U(e)===p})):k,l=u.filter((function(e){return c.indexOf(e)>=0}));0===l.length&&(l=u);var d=l.reduce((function(t,n){return t[n]=J(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[C(n)],t}),{});return Object.keys(d).sort((function(e,t){return d[e]-d[t]}))}var le={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0===a||a,f=n.fallbackPlacements,c=n.padding,p=n.boundary,u=n.rootBoundary,l=n.altBoundary,d=n.flipVariations,h=void 0===d||d,m=n.allowedAutoPlacements,v=t.options.placement,y=C(v),g=f||(y===v||!h?[fe(v)]:function(e){if(C(e)===M)return[];var t=fe(e);return[pe(e),t,pe(t)]}(v)),b=[v].concat(g).reduce((function(e,n){return e.concat(C(n)===M?ue(t,{placement:n,boundary:p,rootBoundary:u,padding:c,flipVariations:h,allowedAutoPlacements:m}):n)}),[]),x=t.rects.reference,w=t.rects.popper,O=new Map,j=!0,E=b[0],k=0;k=0,S=R?"width":"height",V=J(t,{placement:B,boundary:p,rootBoundary:u,altBoundary:l,padding:c}),q=R?T?L:P:T?A:D;x[S]>w[S]&&(q=fe(q));var N=fe(q),I=[];if(i&&I.push(V[H]<=0),s&&I.push(V[q]<=0,V[N]<=0),I.every((function(e){return e}))){E=B,j=!1;break}O.set(B,I)}if(j)for(var _=function(e){var t=b.find((function(t){var n=O.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return E=t,"break"},F=h?3:1;F>0;F--){if("break"===_(F))break}t.placement!==E&&(t.modifiersData[r]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function de(e,t,n){return i(e,a(t,n))}var he={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,s=void 0===o||o,f=n.altAxis,c=void 0!==f&&f,p=n.boundary,u=n.rootBoundary,l=n.altBoundary,d=n.padding,h=n.tether,m=void 0===h||h,v=n.tetherOffset,y=void 0===v?0:v,b=J(t,{boundary:p,rootBoundary:u,padding:d,altBoundary:l}),x=C(t.placement),w=U(t.placement),O=!w,j=z(x),M="x"===j?"y":"x",k=t.modifiersData.popperOffsets,B=t.rects.reference,H=t.rects.popper,T="function"==typeof y?y(Object.assign({},t.rects,{placement:t.placement})):y,R="number"==typeof T?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),S=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,V={x:0,y:0};if(k){if(s){var q,N="y"===j?D:P,I="y"===j?A:L,_="y"===j?"height":"width",F=k[j],X=F+b[N],Y=F-b[I],G=m?-H[_]/2:0,K=w===W?B[_]:H[_],Q=w===W?-H[_]:-B[_],Z=t.elements.arrow,$=m&&Z?g(Z):{width:0,height:0},ee=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},te=ee[N],ne=ee[I],re=de(0,B[_],$[_]),oe=O?B[_]/2-G-re-te-R.mainAxis:K-re-te-R.mainAxis,ie=O?-B[_]/2+G+re+ne+R.mainAxis:Q+re+ne+R.mainAxis,ae=t.elements.arrow&&E(t.elements.arrow),se=ae?"y"===j?ae.clientTop||0:ae.clientLeft||0:0,fe=null!=(q=null==S?void 0:S[j])?q:0,ce=F+ie-fe,pe=de(m?a(X,F+oe-fe-se):X,F,m?i(Y,ce):Y);k[j]=pe,V[j]=pe-F}if(c){var ue,le="x"===j?D:P,he="x"===j?A:L,me=k[M],ve="y"===M?"height":"width",ye=me+b[le],ge=me-b[he],be=-1!==[D,P].indexOf(x),xe=null!=(ue=null==S?void 0:S[M])?ue:0,we=be?ye:me-B[ve]-H[ve]-xe+R.altAxis,Oe=be?me+B[ve]+H[ve]-xe-R.altAxis:ge,je=m&&be?function(e,t,n){var r=de(e,t,n);return r>n?n:r}(we,me,Oe):de(m?we:ye,me,m?Oe:ge);k[M]=je,V[M]=je-me}t.modifiersData[r]=V}},requiresIfExists:["offset"]};var me={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=C(n.placement),f=z(s),c=[P,L].indexOf(s)>=0?"height":"width";if(i&&a){var p=function(e,t){return Y("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:G(e,k))}(o.padding,n),u=g(i),l="y"===f?D:P,d="y"===f?A:L,h=n.rects.reference[c]+n.rects.reference[f]-a[f]-n.rects.popper[c],m=a[f]-n.rects.reference[f],v=E(i),y=v?"y"===f?v.clientHeight||0:v.clientWidth||0:0,b=h/2-m/2,x=p[l],w=y-u[c]-p[d],O=y/2-u[c]/2+b,j=de(x,O,w),M=f;n.modifiersData[r]=((t={})[M]=j,t.centerOffset=j-O,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&N(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ve(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function ye(e){return[D,L,A,P].some((function(t){return e[t]>=0}))}var ge={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=J(t,{elementContext:"reference"}),s=J(t,{altBoundary:!0}),f=ve(a,r),c=ve(s,o,i),p=ye(f),u=ye(c);t.modifiersData[n]={referenceClippingOffsets:f,popperEscapeOffsets:c,isReferenceHidden:p,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":u})}},be=Z({defaultModifiers:[ee,te,oe,ie]}),xe=[ee,te,oe,ie,ae,le,he,me,ge],we=Z({defaultModifiers:xe});e.applyStyles=ie,e.arrow=me,e.computeStyles=oe,e.createPopper=we,e.createPopperLite=be,e.defaultModifiers=xe,e.detectOverflow=J,e.eventListeners=ee,e.flip=le,e.hide=ge,e.offset=ae,e.popperGenerator=Z,e.popperOffsets=te,e.preventOverflow=he,Object.defineProperty(e,"__esModule",{value:!0})})); + diff --git a/_site/worksheets/aesthetic-mappings_files/libs/quarto-html/quarto-syntax-highlighting.css b/_site/worksheets/aesthetic-mappings_files/libs/quarto-html/quarto-syntax-highlighting.css new file mode 100644 index 0000000..b30ce57 --- /dev/null +++ b/_site/worksheets/aesthetic-mappings_files/libs/quarto-html/quarto-syntax-highlighting.css @@ -0,0 +1,205 @@ +/* quarto syntax highlight colors */ +:root { + --quarto-hl-ot-color: #003B4F; + --quarto-hl-at-color: #657422; + --quarto-hl-ss-color: #20794D; + --quarto-hl-an-color: #5E5E5E; + --quarto-hl-fu-color: #4758AB; + --quarto-hl-st-color: #20794D; + --quarto-hl-cf-color: #003B4F; + --quarto-hl-op-color: #5E5E5E; + --quarto-hl-er-color: #AD0000; + --quarto-hl-bn-color: #AD0000; + --quarto-hl-al-color: #AD0000; + --quarto-hl-va-color: #111111; + --quarto-hl-bu-color: inherit; + --quarto-hl-ex-color: inherit; + --quarto-hl-pp-color: #AD0000; + --quarto-hl-in-color: #5E5E5E; + --quarto-hl-vs-color: #20794D; + --quarto-hl-wa-color: #5E5E5E; + --quarto-hl-do-color: #5E5E5E; + --quarto-hl-im-color: #00769E; + --quarto-hl-ch-color: #20794D; + --quarto-hl-dt-color: #AD0000; + --quarto-hl-fl-color: #AD0000; + --quarto-hl-co-color: #5E5E5E; + --quarto-hl-cv-color: #5E5E5E; + --quarto-hl-cn-color: #8f5902; + --quarto-hl-sc-color: #5E5E5E; + --quarto-hl-dv-color: #AD0000; + --quarto-hl-kw-color: #003B4F; +} + +/* other quarto variables */ +:root { + --quarto-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; +} + +pre > code.sourceCode > span { + color: #003B4F; +} + +code span { + color: #003B4F; +} + +code.sourceCode > span { + color: #003B4F; +} + +div.sourceCode, +div.sourceCode pre.sourceCode { + color: #003B4F; +} + +code span.ot { + color: #003B4F; + font-style: inherit; +} + +code span.at { + color: #657422; + font-style: inherit; +} + +code span.ss { + color: #20794D; + font-style: inherit; +} + +code span.an { + color: #5E5E5E; + font-style: inherit; +} + +code span.fu { + color: #4758AB; + font-style: inherit; +} + +code span.st { + color: #20794D; + font-style: inherit; +} + +code span.cf { + color: #003B4F; + font-weight: bold; + font-style: inherit; +} + +code span.op { + color: #5E5E5E; + font-style: inherit; +} + +code span.er { + color: #AD0000; + font-style: inherit; +} + +code span.bn { + color: #AD0000; + font-style: inherit; +} + +code span.al { + color: #AD0000; + font-style: inherit; +} + +code span.va { + color: #111111; + font-style: inherit; +} + +code span.bu { + font-style: inherit; +} + +code span.ex { + font-style: inherit; +} + +code span.pp { + color: #AD0000; + font-style: inherit; +} + +code span.in { + color: #5E5E5E; + font-style: inherit; +} + +code span.vs { + color: #20794D; + font-style: inherit; +} + +code span.wa { + color: #5E5E5E; + font-style: italic; +} + +code span.do { + color: #5E5E5E; + font-style: italic; +} + +code span.im { + color: #00769E; + font-style: inherit; +} + +code span.ch { + color: #20794D; + font-style: inherit; +} + +code span.dt { + color: #AD0000; + font-style: inherit; +} + +code span.fl { + color: #AD0000; + font-style: inherit; +} + +code span.co { + color: #5E5E5E; + font-style: inherit; +} + +code span.cv { + color: #5E5E5E; + font-style: italic; +} + +code span.cn { + color: #8f5902; + font-style: inherit; +} + +code span.sc { + color: #5E5E5E; + font-style: inherit; +} + +code span.dv { + color: #AD0000; + font-style: inherit; +} + +code span.kw { + color: #003B4F; + font-weight: bold; + font-style: inherit; +} + +.prevent-inlining { + content: " { + // Find any conflicting margin elements and add margins to the + // top to prevent overlap + const marginChildren = window.document.querySelectorAll( + ".column-margin.column-container > *, .margin-caption, .aside" + ); + + let lastBottom = 0; + for (const marginChild of marginChildren) { + if (marginChild.offsetParent !== null) { + // clear the top margin so we recompute it + marginChild.style.marginTop = null; + const top = marginChild.getBoundingClientRect().top + window.scrollY; + if (top < lastBottom) { + const marginChildStyle = window.getComputedStyle(marginChild); + const marginBottom = parseFloat(marginChildStyle["marginBottom"]); + const margin = lastBottom - top + marginBottom; + marginChild.style.marginTop = `${margin}px`; + } + const styles = window.getComputedStyle(marginChild); + const marginTop = parseFloat(styles["marginTop"]); + lastBottom = top + marginChild.getBoundingClientRect().height + marginTop; + } + } +}; + +window.document.addEventListener("DOMContentLoaded", function (_event) { + // Recompute the position of margin elements anytime the body size changes + if (window.ResizeObserver) { + const resizeObserver = new window.ResizeObserver( + throttle(() => { + layoutMarginEls(); + if ( + window.document.body.getBoundingClientRect().width < 990 && + isReaderMode() + ) { + quartoToggleReader(); + } + }, 50) + ); + resizeObserver.observe(window.document.body); + } + + const tocEl = window.document.querySelector('nav.toc-active[role="doc-toc"]'); + const sidebarEl = window.document.getElementById("quarto-sidebar"); + const leftTocEl = window.document.getElementById("quarto-sidebar-toc-left"); + const marginSidebarEl = window.document.getElementById( + "quarto-margin-sidebar" + ); + // function to determine whether the element has a previous sibling that is active + const prevSiblingIsActiveLink = (el) => { + const sibling = el.previousElementSibling; + if (sibling && sibling.tagName === "A") { + return sibling.classList.contains("active"); + } else { + return false; + } + }; + + // fire slideEnter for bootstrap tab activations (for htmlwidget resize behavior) + function fireSlideEnter(e) { + const event = window.document.createEvent("Event"); + event.initEvent("slideenter", true, true); + window.document.dispatchEvent(event); + } + const tabs = window.document.querySelectorAll('a[data-bs-toggle="tab"]'); + tabs.forEach((tab) => { + tab.addEventListener("shown.bs.tab", fireSlideEnter); + }); + + // fire slideEnter for tabby tab activations (for htmlwidget resize behavior) + document.addEventListener("tabby", fireSlideEnter, false); + + // Track scrolling and mark TOC links as active + // get table of contents and sidebar (bail if we don't have at least one) + const tocLinks = tocEl + ? [...tocEl.querySelectorAll("a[data-scroll-target]")] + : []; + const makeActive = (link) => tocLinks[link].classList.add("active"); + const removeActive = (link) => tocLinks[link].classList.remove("active"); + const removeAllActive = () => + [...Array(tocLinks.length).keys()].forEach((link) => removeActive(link)); + + // activate the anchor for a section associated with this TOC entry + tocLinks.forEach((link) => { + link.addEventListener("click", () => { + if (link.href.indexOf("#") !== -1) { + const anchor = link.href.split("#")[1]; + const heading = window.document.querySelector( + `[data-anchor-id="${anchor}"]` + ); + if (heading) { + // Add the class + heading.classList.add("reveal-anchorjs-link"); + + // function to show the anchor + const handleMouseout = () => { + heading.classList.remove("reveal-anchorjs-link"); + heading.removeEventListener("mouseout", handleMouseout); + }; + + // add a function to clear the anchor when the user mouses out of it + heading.addEventListener("mouseout", handleMouseout); + } + } + }); + }); + + const sections = tocLinks.map((link) => { + const target = link.getAttribute("data-scroll-target"); + if (target.startsWith("#")) { + return window.document.getElementById(decodeURI(`${target.slice(1)}`)); + } else { + return window.document.querySelector(decodeURI(`${target}`)); + } + }); + + const sectionMargin = 200; + let currentActive = 0; + // track whether we've initialized state the first time + let init = false; + + const updateActiveLink = () => { + // The index from bottom to top (e.g. reversed list) + let sectionIndex = -1; + if ( + window.innerHeight + window.pageYOffset >= + window.document.body.offsetHeight + ) { + // This is the no-scroll case where last section should be the active one + sectionIndex = 0; + } else { + // This finds the last section visible on screen that should be made active + sectionIndex = [...sections].reverse().findIndex((section) => { + if (section) { + return window.pageYOffset >= section.offsetTop - sectionMargin; + } else { + return false; + } + }); + } + if (sectionIndex > -1) { + const current = sections.length - sectionIndex - 1; + if (current !== currentActive) { + removeAllActive(); + currentActive = current; + makeActive(current); + if (init) { + window.dispatchEvent(sectionChanged); + } + init = true; + } + } + }; + + const inHiddenRegion = (top, bottom, hiddenRegions) => { + for (const region of hiddenRegions) { + if (top <= region.bottom && bottom >= region.top) { + return true; + } + } + return false; + }; + + const categorySelector = "header.quarto-title-block .quarto-category"; + const activateCategories = (href) => { + // Find any categories + // Surround them with a link pointing back to: + // #category=Authoring + try { + const categoryEls = window.document.querySelectorAll(categorySelector); + for (const categoryEl of categoryEls) { + const categoryText = categoryEl.textContent; + if (categoryText) { + const link = `${href}#category=${encodeURIComponent(categoryText)}`; + const linkEl = window.document.createElement("a"); + linkEl.setAttribute("href", link); + for (const child of categoryEl.childNodes) { + linkEl.append(child); + } + categoryEl.appendChild(linkEl); + } + } + } catch { + // Ignore errors + } + }; + function hasTitleCategories() { + return window.document.querySelector(categorySelector) !== null; + } + + function offsetRelativeUrl(url) { + const offset = getMeta("quarto:offset"); + return offset ? offset + url : url; + } + + function offsetAbsoluteUrl(url) { + const offset = getMeta("quarto:offset"); + const baseUrl = new URL(offset, window.location); + + const projRelativeUrl = url.replace(baseUrl, ""); + if (projRelativeUrl.startsWith("/")) { + return projRelativeUrl; + } else { + return "/" + projRelativeUrl; + } + } + + // read a meta tag value + function getMeta(metaName) { + const metas = window.document.getElementsByTagName("meta"); + for (let i = 0; i < metas.length; i++) { + if (metas[i].getAttribute("name") === metaName) { + return metas[i].getAttribute("content"); + } + } + return ""; + } + + async function findAndActivateCategories() { + const currentPagePath = offsetAbsoluteUrl(window.location.href); + const response = await fetch(offsetRelativeUrl("listings.json")); + if (response.status == 200) { + return response.json().then(function (listingPaths) { + const listingHrefs = []; + for (const listingPath of listingPaths) { + const pathWithoutLeadingSlash = listingPath.listing.substring(1); + for (const item of listingPath.items) { + if ( + item === currentPagePath || + item === currentPagePath + "index.html" + ) { + // Resolve this path against the offset to be sure + // we already are using the correct path to the listing + // (this adjusts the listing urls to be rooted against + // whatever root the page is actually running against) + const relative = offsetRelativeUrl(pathWithoutLeadingSlash); + const baseUrl = window.location; + const resolvedPath = new URL(relative, baseUrl); + listingHrefs.push(resolvedPath.pathname); + break; + } + } + } + + // Look up the tree for a nearby linting and use that if we find one + const nearestListing = findNearestParentListing( + offsetAbsoluteUrl(window.location.pathname), + listingHrefs + ); + if (nearestListing) { + activateCategories(nearestListing); + } else { + // See if the referrer is a listing page for this item + const referredRelativePath = offsetAbsoluteUrl(document.referrer); + const referrerListing = listingHrefs.find((listingHref) => { + const isListingReferrer = + listingHref === referredRelativePath || + listingHref === referredRelativePath + "index.html"; + return isListingReferrer; + }); + + if (referrerListing) { + // Try to use the referrer if possible + activateCategories(referrerListing); + } else if (listingHrefs.length > 0) { + // Otherwise, just fall back to the first listing + activateCategories(listingHrefs[0]); + } + } + }); + } + } + if (hasTitleCategories()) { + findAndActivateCategories(); + } + + const findNearestParentListing = (href, listingHrefs) => { + if (!href || !listingHrefs) { + return undefined; + } + // Look up the tree for a nearby linting and use that if we find one + const relativeParts = href.substring(1).split("/"); + while (relativeParts.length > 0) { + const path = relativeParts.join("/"); + for (const listingHref of listingHrefs) { + if (listingHref.startsWith(path)) { + return listingHref; + } + } + relativeParts.pop(); + } + + return undefined; + }; + + const manageSidebarVisiblity = (el, placeholderDescriptor) => { + let isVisible = true; + let elRect; + + return (hiddenRegions) => { + if (el === null) { + return; + } + + // Find the last element of the TOC + const lastChildEl = el.lastElementChild; + + if (lastChildEl) { + // Converts the sidebar to a menu + const convertToMenu = () => { + for (const child of el.children) { + child.style.opacity = 0; + child.style.overflow = "hidden"; + child.style.pointerEvents = "none"; + } + + nexttick(() => { + const toggleContainer = window.document.createElement("div"); + toggleContainer.style.width = "100%"; + toggleContainer.classList.add("zindex-over-content"); + toggleContainer.classList.add("quarto-sidebar-toggle"); + toggleContainer.classList.add("headroom-target"); // Marks this to be managed by headeroom + toggleContainer.id = placeholderDescriptor.id; + toggleContainer.style.position = "fixed"; + + const toggleIcon = window.document.createElement("i"); + toggleIcon.classList.add("quarto-sidebar-toggle-icon"); + toggleIcon.classList.add("bi"); + toggleIcon.classList.add("bi-caret-down-fill"); + + const toggleTitle = window.document.createElement("div"); + const titleEl = window.document.body.querySelector( + placeholderDescriptor.titleSelector + ); + if (titleEl) { + toggleTitle.append( + titleEl.textContent || titleEl.innerText, + toggleIcon + ); + } + toggleTitle.classList.add("zindex-over-content"); + toggleTitle.classList.add("quarto-sidebar-toggle-title"); + toggleContainer.append(toggleTitle); + + const toggleContents = window.document.createElement("div"); + toggleContents.classList = el.classList; + toggleContents.classList.add("zindex-over-content"); + toggleContents.classList.add("quarto-sidebar-toggle-contents"); + for (const child of el.children) { + if (child.id === "toc-title") { + continue; + } + + const clone = child.cloneNode(true); + clone.style.opacity = 1; + clone.style.pointerEvents = null; + clone.style.display = null; + toggleContents.append(clone); + } + toggleContents.style.height = "0px"; + const positionToggle = () => { + // position the element (top left of parent, same width as parent) + if (!elRect) { + elRect = el.getBoundingClientRect(); + } + toggleContainer.style.left = `${elRect.left}px`; + toggleContainer.style.top = `${elRect.top}px`; + toggleContainer.style.width = `${elRect.width}px`; + }; + positionToggle(); + + toggleContainer.append(toggleContents); + el.parentElement.prepend(toggleContainer); + + // Process clicks + let tocShowing = false; + // Allow the caller to control whether this is dismissed + // when it is clicked (e.g. sidebar navigation supports + // opening and closing the nav tree, so don't dismiss on click) + const clickEl = placeholderDescriptor.dismissOnClick + ? toggleContainer + : toggleTitle; + + const closeToggle = () => { + if (tocShowing) { + toggleContainer.classList.remove("expanded"); + toggleContents.style.height = "0px"; + tocShowing = false; + } + }; + + // Get rid of any expanded toggle if the user scrolls + window.document.addEventListener( + "scroll", + throttle(() => { + closeToggle(); + }, 50) + ); + + // Handle positioning of the toggle + window.addEventListener( + "resize", + throttle(() => { + elRect = undefined; + positionToggle(); + }, 50) + ); + + window.addEventListener("quarto-hrChanged", () => { + elRect = undefined; + }); + + // Process the click + clickEl.onclick = () => { + if (!tocShowing) { + toggleContainer.classList.add("expanded"); + toggleContents.style.height = null; + tocShowing = true; + } else { + closeToggle(); + } + }; + }); + }; + + // Converts a sidebar from a menu back to a sidebar + const convertToSidebar = () => { + for (const child of el.children) { + child.style.opacity = 1; + child.style.overflow = null; + child.style.pointerEvents = null; + } + + const placeholderEl = window.document.getElementById( + placeholderDescriptor.id + ); + if (placeholderEl) { + placeholderEl.remove(); + } + + el.classList.remove("rollup"); + }; + + if (isReaderMode()) { + convertToMenu(); + isVisible = false; + } else { + // Find the top and bottom o the element that is being managed + const elTop = el.offsetTop; + const elBottom = + elTop + lastChildEl.offsetTop + lastChildEl.offsetHeight; + + if (!isVisible) { + // If the element is current not visible reveal if there are + // no conflicts with overlay regions + if (!inHiddenRegion(elTop, elBottom, hiddenRegions)) { + convertToSidebar(); + isVisible = true; + } + } else { + // If the element is visible, hide it if it conflicts with overlay regions + // and insert a placeholder toggle (or if we're in reader mode) + if (inHiddenRegion(elTop, elBottom, hiddenRegions)) { + convertToMenu(); + isVisible = false; + } + } + } + } + }; + }; + + const tabEls = document.querySelectorAll('a[data-bs-toggle="tab"]'); + for (const tabEl of tabEls) { + const id = tabEl.getAttribute("data-bs-target"); + if (id) { + const columnEl = document.querySelector( + `${id} .column-margin, .tabset-margin-content` + ); + if (columnEl) + tabEl.addEventListener("shown.bs.tab", function (event) { + const el = event.srcElement; + if (el) { + const visibleCls = `${el.id}-margin-content`; + // walk up until we find a parent tabset + let panelTabsetEl = el.parentElement; + while (panelTabsetEl) { + if (panelTabsetEl.classList.contains("panel-tabset")) { + break; + } + panelTabsetEl = panelTabsetEl.parentElement; + } + + if (panelTabsetEl) { + const prevSib = panelTabsetEl.previousElementSibling; + if ( + prevSib && + prevSib.classList.contains("tabset-margin-container") + ) { + const childNodes = prevSib.querySelectorAll( + ".tabset-margin-content" + ); + for (const childEl of childNodes) { + if (childEl.classList.contains(visibleCls)) { + childEl.classList.remove("collapse"); + } else { + childEl.classList.add("collapse"); + } + } + } + } + } + + layoutMarginEls(); + }); + } + } + + // Manage the visibility of the toc and the sidebar + const marginScrollVisibility = manageSidebarVisiblity(marginSidebarEl, { + id: "quarto-toc-toggle", + titleSelector: "#toc-title", + dismissOnClick: true, + }); + const sidebarScrollVisiblity = manageSidebarVisiblity(sidebarEl, { + id: "quarto-sidebarnav-toggle", + titleSelector: ".title", + dismissOnClick: false, + }); + let tocLeftScrollVisibility; + if (leftTocEl) { + tocLeftScrollVisibility = manageSidebarVisiblity(leftTocEl, { + id: "quarto-lefttoc-toggle", + titleSelector: "#toc-title", + dismissOnClick: true, + }); + } + + // Find the first element that uses formatting in special columns + const conflictingEls = window.document.body.querySelectorAll( + '[class^="column-"], [class*=" column-"], aside, [class*="margin-caption"], [class*=" margin-caption"], [class*="margin-ref"], [class*=" margin-ref"]' + ); + + // Filter all the possibly conflicting elements into ones + // the do conflict on the left or ride side + const arrConflictingEls = Array.from(conflictingEls); + const leftSideConflictEls = arrConflictingEls.filter((el) => { + if (el.tagName === "ASIDE") { + return false; + } + return Array.from(el.classList).find((className) => { + return ( + className !== "column-body" && + className.startsWith("column-") && + !className.endsWith("right") && + !className.endsWith("container") && + className !== "column-margin" + ); + }); + }); + const rightSideConflictEls = arrConflictingEls.filter((el) => { + if (el.tagName === "ASIDE") { + return true; + } + + const hasMarginCaption = Array.from(el.classList).find((className) => { + return className == "margin-caption"; + }); + if (hasMarginCaption) { + return true; + } + + return Array.from(el.classList).find((className) => { + return ( + className !== "column-body" && + !className.endsWith("container") && + className.startsWith("column-") && + !className.endsWith("left") + ); + }); + }); + + const kOverlapPaddingSize = 10; + function toRegions(els) { + return els.map((el) => { + const boundRect = el.getBoundingClientRect(); + const top = + boundRect.top + + document.documentElement.scrollTop - + kOverlapPaddingSize; + return { + top, + bottom: top + el.scrollHeight + 2 * kOverlapPaddingSize, + }; + }); + } + + let hasObserved = false; + const visibleItemObserver = (els) => { + let visibleElements = [...els]; + const intersectionObserver = new IntersectionObserver( + (entries, _observer) => { + entries.forEach((entry) => { + if (entry.isIntersecting) { + if (visibleElements.indexOf(entry.target) === -1) { + visibleElements.push(entry.target); + } + } else { + visibleElements = visibleElements.filter((visibleEntry) => { + return visibleEntry !== entry; + }); + } + }); + + if (!hasObserved) { + hideOverlappedSidebars(); + } + hasObserved = true; + }, + {} + ); + els.forEach((el) => { + intersectionObserver.observe(el); + }); + + return { + getVisibleEntries: () => { + return visibleElements; + }, + }; + }; + + const rightElementObserver = visibleItemObserver(rightSideConflictEls); + const leftElementObserver = visibleItemObserver(leftSideConflictEls); + + const hideOverlappedSidebars = () => { + marginScrollVisibility(toRegions(rightElementObserver.getVisibleEntries())); + sidebarScrollVisiblity(toRegions(leftElementObserver.getVisibleEntries())); + if (tocLeftScrollVisibility) { + tocLeftScrollVisibility( + toRegions(leftElementObserver.getVisibleEntries()) + ); + } + }; + + window.quartoToggleReader = () => { + // Applies a slow class (or removes it) + // to update the transition speed + const slowTransition = (slow) => { + const manageTransition = (id, slow) => { + const el = document.getElementById(id); + if (el) { + if (slow) { + el.classList.add("slow"); + } else { + el.classList.remove("slow"); + } + } + }; + + manageTransition("TOC", slow); + manageTransition("quarto-sidebar", slow); + }; + const readerMode = !isReaderMode(); + setReaderModeValue(readerMode); + + // If we're entering reader mode, slow the transition + if (readerMode) { + slowTransition(readerMode); + } + highlightReaderToggle(readerMode); + hideOverlappedSidebars(); + + // If we're exiting reader mode, restore the non-slow transition + if (!readerMode) { + slowTransition(!readerMode); + } + }; + + const highlightReaderToggle = (readerMode) => { + const els = document.querySelectorAll(".quarto-reader-toggle"); + if (els) { + els.forEach((el) => { + if (readerMode) { + el.classList.add("reader"); + } else { + el.classList.remove("reader"); + } + }); + } + }; + + const setReaderModeValue = (val) => { + if (window.location.protocol !== "file:") { + window.localStorage.setItem("quarto-reader-mode", val); + } else { + localReaderMode = val; + } + }; + + const isReaderMode = () => { + if (window.location.protocol !== "file:") { + return window.localStorage.getItem("quarto-reader-mode") === "true"; + } else { + return localReaderMode; + } + }; + let localReaderMode = null; + + const tocOpenDepthStr = tocEl?.getAttribute("data-toc-expanded"); + const tocOpenDepth = tocOpenDepthStr ? Number(tocOpenDepthStr) : 1; + + // Walk the TOC and collapse/expand nodes + // Nodes are expanded if: + // - they are top level + // - they have children that are 'active' links + // - they are directly below an link that is 'active' + const walk = (el, depth) => { + // Tick depth when we enter a UL + if (el.tagName === "UL") { + depth = depth + 1; + } + + // It this is active link + let isActiveNode = false; + if (el.tagName === "A" && el.classList.contains("active")) { + isActiveNode = true; + } + + // See if there is an active child to this element + let hasActiveChild = false; + for (child of el.children) { + hasActiveChild = walk(child, depth) || hasActiveChild; + } + + // Process the collapse state if this is an UL + if (el.tagName === "UL") { + if (tocOpenDepth === -1 && depth > 1) { + // toc-expand: false + el.classList.add("collapse"); + } else if ( + depth <= tocOpenDepth || + hasActiveChild || + prevSiblingIsActiveLink(el) + ) { + el.classList.remove("collapse"); + } else { + el.classList.add("collapse"); + } + + // untick depth when we leave a UL + depth = depth - 1; + } + return hasActiveChild || isActiveNode; + }; + + // walk the TOC and expand / collapse any items that should be shown + if (tocEl) { + updateActiveLink(); + walk(tocEl, 0); + } + + // Throttle the scroll event and walk peridiocally + window.document.addEventListener( + "scroll", + throttle(() => { + if (tocEl) { + updateActiveLink(); + walk(tocEl, 0); + } + if (!isReaderMode()) { + hideOverlappedSidebars(); + } + }, 5) + ); + window.addEventListener( + "resize", + throttle(() => { + if (tocEl) { + updateActiveLink(); + walk(tocEl, 0); + } + if (!isReaderMode()) { + hideOverlappedSidebars(); + } + }, 10) + ); + hideOverlappedSidebars(); + highlightReaderToggle(isReaderMode()); +}); + +// grouped tabsets +window.addEventListener("pageshow", (_event) => { + function getTabSettings() { + const data = localStorage.getItem("quarto-persistent-tabsets-data"); + if (!data) { + localStorage.setItem("quarto-persistent-tabsets-data", "{}"); + return {}; + } + if (data) { + return JSON.parse(data); + } + } + + function setTabSettings(data) { + localStorage.setItem( + "quarto-persistent-tabsets-data", + JSON.stringify(data) + ); + } + + function setTabState(groupName, groupValue) { + const data = getTabSettings(); + data[groupName] = groupValue; + setTabSettings(data); + } + + function toggleTab(tab, active) { + const tabPanelId = tab.getAttribute("aria-controls"); + const tabPanel = document.getElementById(tabPanelId); + if (active) { + tab.classList.add("active"); + tabPanel.classList.add("active"); + } else { + tab.classList.remove("active"); + tabPanel.classList.remove("active"); + } + } + + function toggleAll(selectedGroup, selectorsToSync) { + for (const [thisGroup, tabs] of Object.entries(selectorsToSync)) { + const active = selectedGroup === thisGroup; + for (const tab of tabs) { + toggleTab(tab, active); + } + } + } + + function findSelectorsToSyncByLanguage() { + const result = {}; + const tabs = Array.from( + document.querySelectorAll(`div[data-group] a[id^='tabset-']`) + ); + for (const item of tabs) { + const div = item.parentElement.parentElement.parentElement; + const group = div.getAttribute("data-group"); + if (!result[group]) { + result[group] = {}; + } + const selectorsToSync = result[group]; + const value = item.innerHTML; + if (!selectorsToSync[value]) { + selectorsToSync[value] = []; + } + selectorsToSync[value].push(item); + } + return result; + } + + function setupSelectorSync() { + const selectorsToSync = findSelectorsToSyncByLanguage(); + Object.entries(selectorsToSync).forEach(([group, tabSetsByValue]) => { + Object.entries(tabSetsByValue).forEach(([value, items]) => { + items.forEach((item) => { + item.addEventListener("click", (_event) => { + setTabState(group, value); + toggleAll(value, selectorsToSync[group]); + }); + }); + }); + }); + return selectorsToSync; + } + + const selectorsToSync = setupSelectorSync(); + for (const [group, selectedName] of Object.entries(getTabSettings())) { + const selectors = selectorsToSync[group]; + // it's possible that stale state gives us empty selections, so we explicitly check here. + if (selectors) { + toggleAll(selectedName, selectors); + } + } +}); + +function throttle(func, wait) { + let waiting = false; + return function () { + if (!waiting) { + func.apply(this, arguments); + waiting = true; + setTimeout(function () { + waiting = false; + }, wait); + } + }; +} + +function nexttick(func) { + return setTimeout(func, 0); +} diff --git a/_site/worksheets/aesthetic-mappings_files/libs/quarto-html/tippy.css b/_site/worksheets/aesthetic-mappings_files/libs/quarto-html/tippy.css new file mode 100644 index 0000000..e6ae635 --- /dev/null +++ b/_site/worksheets/aesthetic-mappings_files/libs/quarto-html/tippy.css @@ -0,0 +1 @@ +.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1} \ No newline at end of file diff --git a/_site/worksheets/aesthetic-mappings_files/libs/quarto-html/tippy.umd.min.js b/_site/worksheets/aesthetic-mappings_files/libs/quarto-html/tippy.umd.min.js new file mode 100644 index 0000000..ca292be --- /dev/null +++ b/_site/worksheets/aesthetic-mappings_files/libs/quarto-html/tippy.umd.min.js @@ -0,0 +1,2 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@popperjs/core")):"function"==typeof define&&define.amd?define(["@popperjs/core"],t):(e=e||self).tippy=t(e.Popper)}(this,(function(e){"use strict";var t={passive:!0,capture:!0},n=function(){return document.body};function r(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function o(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function i(e,t){return"function"==typeof e?e.apply(void 0,t):e}function a(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function s(e,t){var n=Object.assign({},e);return t.forEach((function(e){delete n[e]})),n}function u(e){return[].concat(e)}function c(e,t){-1===e.indexOf(t)&&e.push(t)}function p(e){return e.split("-")[0]}function f(e){return[].slice.call(e)}function l(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function d(){return document.createElement("div")}function v(e){return["Element","Fragment"].some((function(t){return o(e,t)}))}function m(e){return o(e,"MouseEvent")}function g(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function h(e){return v(e)?[e]:function(e){return o(e,"NodeList")}(e)?f(e):Array.isArray(e)?e:f(document.querySelectorAll(e))}function b(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function y(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function w(e){var t,n=u(e)[0];return null!=n&&null!=(t=n.ownerDocument)&&t.body?n.ownerDocument:document}function E(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function O(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var x={isTouch:!1},C=0;function T(){x.isTouch||(x.isTouch=!0,window.performance&&document.addEventListener("mousemove",A))}function A(){var e=performance.now();e-C<20&&(x.isTouch=!1,document.removeEventListener("mousemove",A)),C=e}function L(){var e=document.activeElement;if(g(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var D=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto,R=Object.assign({appendTo:n,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),k=Object.keys(R);function P(e){var t=(e.plugins||[]).reduce((function(t,n){var r,o=n.name,i=n.defaultValue;o&&(t[o]=void 0!==e[o]?e[o]:null!=(r=R[o])?r:i);return t}),{});return Object.assign({},e,t)}function j(e,t){var n=Object.assign({},t,{content:i(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(P(Object.assign({},R,{plugins:t}))):k).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},R.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function M(e,t){e.innerHTML=t}function V(e){var t=d();return!0===e?t.className="tippy-arrow":(t.className="tippy-svg-arrow",v(e)?t.appendChild(e):M(t,e)),t}function I(e,t){v(t.content)?(M(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?M(e,t.content):e.textContent=t.content)}function S(e){var t=e.firstElementChild,n=f(t.children);return{box:t,content:n.find((function(e){return e.classList.contains("tippy-content")})),arrow:n.find((function(e){return e.classList.contains("tippy-arrow")||e.classList.contains("tippy-svg-arrow")})),backdrop:n.find((function(e){return e.classList.contains("tippy-backdrop")}))}}function N(e){var t=d(),n=d();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=d();function o(n,r){var o=S(t),i=o.box,a=o.content,s=o.arrow;r.theme?i.setAttribute("data-theme",r.theme):i.removeAttribute("data-theme"),"string"==typeof r.animation?i.setAttribute("data-animation",r.animation):i.removeAttribute("data-animation"),r.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia"),i.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?i.setAttribute("role",r.role):i.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||I(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(i.removeChild(s),i.appendChild(V(r.arrow))):i.appendChild(V(r.arrow)):s&&i.removeChild(s)}return r.className="tippy-content",r.setAttribute("data-state","hidden"),I(r,e.props),t.appendChild(n),n.appendChild(r),o(e.props,e.props),{popper:t,onUpdate:o}}N.$$tippy=!0;var B=1,H=[],U=[];function _(o,s){var v,g,h,C,T,A,L,k,M=j(o,Object.assign({},R,P(l(s)))),V=!1,I=!1,N=!1,_=!1,F=[],W=a(we,M.interactiveDebounce),X=B++,Y=(k=M.plugins).filter((function(e,t){return k.indexOf(e)===t})),$={id:X,reference:o,popper:d(),popperInstance:null,props:M,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:Y,clearDelayTimeouts:function(){clearTimeout(v),clearTimeout(g),cancelAnimationFrame(h)},setProps:function(e){if($.state.isDestroyed)return;ae("onBeforeUpdate",[$,e]),be();var t=$.props,n=j(o,Object.assign({},t,l(e),{ignoreAttributes:!0}));$.props=n,he(),t.interactiveDebounce!==n.interactiveDebounce&&(ce(),W=a(we,n.interactiveDebounce));t.triggerTarget&&!n.triggerTarget?u(t.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):n.triggerTarget&&o.removeAttribute("aria-expanded");ue(),ie(),J&&J(t,n);$.popperInstance&&(Ce(),Ae().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));ae("onAfterUpdate",[$,e])},setContent:function(e){$.setProps({content:e})},show:function(){var e=$.state.isVisible,t=$.state.isDestroyed,o=!$.state.isEnabled,a=x.isTouch&&!$.props.touch,s=r($.props.duration,0,R.duration);if(e||t||o||a)return;if(te().hasAttribute("disabled"))return;if(ae("onShow",[$],!1),!1===$.props.onShow($))return;$.state.isVisible=!0,ee()&&(z.style.visibility="visible");ie(),de(),$.state.isMounted||(z.style.transition="none");if(ee()){var u=re(),p=u.box,f=u.content;b([p,f],0)}A=function(){var e;if($.state.isVisible&&!_){if(_=!0,z.offsetHeight,z.style.transition=$.props.moveTransition,ee()&&$.props.animation){var t=re(),n=t.box,r=t.content;b([n,r],s),y([n,r],"visible")}se(),ue(),c(U,$),null==(e=$.popperInstance)||e.forceUpdate(),ae("onMount",[$]),$.props.animation&&ee()&&function(e,t){me(e,t)}(s,(function(){$.state.isShown=!0,ae("onShown",[$])}))}},function(){var e,t=$.props.appendTo,r=te();e=$.props.interactive&&t===n||"parent"===t?r.parentNode:i(t,[r]);e.contains(z)||e.appendChild(z);$.state.isMounted=!0,Ce()}()},hide:function(){var e=!$.state.isVisible,t=$.state.isDestroyed,n=!$.state.isEnabled,o=r($.props.duration,1,R.duration);if(e||t||n)return;if(ae("onHide",[$],!1),!1===$.props.onHide($))return;$.state.isVisible=!1,$.state.isShown=!1,_=!1,V=!1,ee()&&(z.style.visibility="hidden");if(ce(),ve(),ie(!0),ee()){var i=re(),a=i.box,s=i.content;$.props.animation&&(b([a,s],o),y([a,s],"hidden"))}se(),ue(),$.props.animation?ee()&&function(e,t){me(e,(function(){!$.state.isVisible&&z.parentNode&&z.parentNode.contains(z)&&t()}))}(o,$.unmount):$.unmount()},hideWithInteractivity:function(e){ne().addEventListener("mousemove",W),c(H,W),W(e)},enable:function(){$.state.isEnabled=!0},disable:function(){$.hide(),$.state.isEnabled=!1},unmount:function(){$.state.isVisible&&$.hide();if(!$.state.isMounted)return;Te(),Ae().forEach((function(e){e._tippy.unmount()})),z.parentNode&&z.parentNode.removeChild(z);U=U.filter((function(e){return e!==$})),$.state.isMounted=!1,ae("onHidden",[$])},destroy:function(){if($.state.isDestroyed)return;$.clearDelayTimeouts(),$.unmount(),be(),delete o._tippy,$.state.isDestroyed=!0,ae("onDestroy",[$])}};if(!M.render)return $;var q=M.render($),z=q.popper,J=q.onUpdate;z.setAttribute("data-tippy-root",""),z.id="tippy-"+$.id,$.popper=z,o._tippy=$,z._tippy=$;var G=Y.map((function(e){return e.fn($)})),K=o.hasAttribute("aria-expanded");return he(),ue(),ie(),ae("onCreate",[$]),M.showOnCreate&&Le(),z.addEventListener("mouseenter",(function(){$.props.interactive&&$.state.isVisible&&$.clearDelayTimeouts()})),z.addEventListener("mouseleave",(function(){$.props.interactive&&$.props.trigger.indexOf("mouseenter")>=0&&ne().addEventListener("mousemove",W)})),$;function Q(){var e=$.props.touch;return Array.isArray(e)?e:[e,0]}function Z(){return"hold"===Q()[0]}function ee(){var e;return!(null==(e=$.props.render)||!e.$$tippy)}function te(){return L||o}function ne(){var e=te().parentNode;return e?w(e):document}function re(){return S(z)}function oe(e){return $.state.isMounted&&!$.state.isVisible||x.isTouch||C&&"focus"===C.type?0:r($.props.delay,e?0:1,R.delay)}function ie(e){void 0===e&&(e=!1),z.style.pointerEvents=$.props.interactive&&!e?"":"none",z.style.zIndex=""+$.props.zIndex}function ae(e,t,n){var r;(void 0===n&&(n=!0),G.forEach((function(n){n[e]&&n[e].apply(n,t)})),n)&&(r=$.props)[e].apply(r,t)}function se(){var e=$.props.aria;if(e.content){var t="aria-"+e.content,n=z.id;u($.props.triggerTarget||o).forEach((function(e){var r=e.getAttribute(t);if($.state.isVisible)e.setAttribute(t,r?r+" "+n:n);else{var o=r&&r.replace(n,"").trim();o?e.setAttribute(t,o):e.removeAttribute(t)}}))}}function ue(){!K&&$.props.aria.expanded&&u($.props.triggerTarget||o).forEach((function(e){$.props.interactive?e.setAttribute("aria-expanded",$.state.isVisible&&e===te()?"true":"false"):e.removeAttribute("aria-expanded")}))}function ce(){ne().removeEventListener("mousemove",W),H=H.filter((function(e){return e!==W}))}function pe(e){if(!x.isTouch||!N&&"mousedown"!==e.type){var t=e.composedPath&&e.composedPath()[0]||e.target;if(!$.props.interactive||!O(z,t)){if(u($.props.triggerTarget||o).some((function(e){return O(e,t)}))){if(x.isTouch)return;if($.state.isVisible&&$.props.trigger.indexOf("click")>=0)return}else ae("onClickOutside",[$,e]);!0===$.props.hideOnClick&&($.clearDelayTimeouts(),$.hide(),I=!0,setTimeout((function(){I=!1})),$.state.isMounted||ve())}}}function fe(){N=!0}function le(){N=!1}function de(){var e=ne();e.addEventListener("mousedown",pe,!0),e.addEventListener("touchend",pe,t),e.addEventListener("touchstart",le,t),e.addEventListener("touchmove",fe,t)}function ve(){var e=ne();e.removeEventListener("mousedown",pe,!0),e.removeEventListener("touchend",pe,t),e.removeEventListener("touchstart",le,t),e.removeEventListener("touchmove",fe,t)}function me(e,t){var n=re().box;function r(e){e.target===n&&(E(n,"remove",r),t())}if(0===e)return t();E(n,"remove",T),E(n,"add",r),T=r}function ge(e,t,n){void 0===n&&(n=!1),u($.props.triggerTarget||o).forEach((function(r){r.addEventListener(e,t,n),F.push({node:r,eventType:e,handler:t,options:n})}))}function he(){var e;Z()&&(ge("touchstart",ye,{passive:!0}),ge("touchend",Ee,{passive:!0})),(e=$.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(ge(e,ye),e){case"mouseenter":ge("mouseleave",Ee);break;case"focus":ge(D?"focusout":"blur",Oe);break;case"focusin":ge("focusout",Oe)}}))}function be(){F.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,o=e.options;t.removeEventListener(n,r,o)})),F=[]}function ye(e){var t,n=!1;if($.state.isEnabled&&!xe(e)&&!I){var r="focus"===(null==(t=C)?void 0:t.type);C=e,L=e.currentTarget,ue(),!$.state.isVisible&&m(e)&&H.forEach((function(t){return t(e)})),"click"===e.type&&($.props.trigger.indexOf("mouseenter")<0||V)&&!1!==$.props.hideOnClick&&$.state.isVisible?n=!0:Le(e),"click"===e.type&&(V=!n),n&&!r&&De(e)}}function we(e){var t=e.target,n=te().contains(t)||z.contains(t);"mousemove"===e.type&&n||function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,o=e.popperState,i=e.props.interactiveBorder,a=p(o.placement),s=o.modifiersData.offset;if(!s)return!0;var u="bottom"===a?s.top.y:0,c="top"===a?s.bottom.y:0,f="right"===a?s.left.x:0,l="left"===a?s.right.x:0,d=t.top-r+u>i,v=r-t.bottom-c>i,m=t.left-n+f>i,g=n-t.right-l>i;return d||v||m||g}))}(Ae().concat(z).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:M}:null})).filter(Boolean),e)&&(ce(),De(e))}function Ee(e){xe(e)||$.props.trigger.indexOf("click")>=0&&V||($.props.interactive?$.hideWithInteractivity(e):De(e))}function Oe(e){$.props.trigger.indexOf("focusin")<0&&e.target!==te()||$.props.interactive&&e.relatedTarget&&z.contains(e.relatedTarget)||De(e)}function xe(e){return!!x.isTouch&&Z()!==e.type.indexOf("touch")>=0}function Ce(){Te();var t=$.props,n=t.popperOptions,r=t.placement,i=t.offset,a=t.getReferenceClientRect,s=t.moveTransition,u=ee()?S(z).arrow:null,c=a?{getBoundingClientRect:a,contextElement:a.contextElement||te()}:o,p=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(ee()){var n=re().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}}];ee()&&u&&p.push({name:"arrow",options:{element:u,padding:3}}),p.push.apply(p,(null==n?void 0:n.modifiers)||[]),$.popperInstance=e.createPopper(c,z,Object.assign({},n,{placement:r,onFirstUpdate:A,modifiers:p}))}function Te(){$.popperInstance&&($.popperInstance.destroy(),$.popperInstance=null)}function Ae(){return f(z.querySelectorAll("[data-tippy-root]"))}function Le(e){$.clearDelayTimeouts(),e&&ae("onTrigger",[$,e]),de();var t=oe(!0),n=Q(),r=n[0],o=n[1];x.isTouch&&"hold"===r&&o&&(t=o),t?v=setTimeout((function(){$.show()}),t):$.show()}function De(e){if($.clearDelayTimeouts(),ae("onUntrigger",[$,e]),$.state.isVisible){if(!($.props.trigger.indexOf("mouseenter")>=0&&$.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&V)){var t=oe(!1);t?g=setTimeout((function(){$.state.isVisible&&$.hide()}),t):h=requestAnimationFrame((function(){$.hide()}))}}else ve()}}function F(e,n){void 0===n&&(n={});var r=R.plugins.concat(n.plugins||[]);document.addEventListener("touchstart",T,t),window.addEventListener("blur",L);var o=Object.assign({},n,{plugins:r}),i=h(e).reduce((function(e,t){var n=t&&_(t,o);return n&&e.push(n),e}),[]);return v(e)?i[0]:i}F.defaultProps=R,F.setDefaultProps=function(e){Object.keys(e).forEach((function(t){R[t]=e[t]}))},F.currentInput=x;var W=Object.assign({},e.applyStyles,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}}),X={mouseover:"mouseenter",focusin:"focus",click:"click"};var Y={name:"animateFill",defaultValue:!1,fn:function(e){var t;if(null==(t=e.props.render)||!t.$$tippy)return{};var n=S(e.popper),r=n.box,o=n.content,i=e.props.animateFill?function(){var e=d();return e.className="tippy-backdrop",y([e],"hidden"),e}():null;return{onCreate:function(){i&&(r.insertBefore(i,r.firstElementChild),r.setAttribute("data-animatefill",""),r.style.overflow="hidden",e.setProps({arrow:!1,animation:"shift-away"}))},onMount:function(){if(i){var e=r.style.transitionDuration,t=Number(e.replace("ms",""));o.style.transitionDelay=Math.round(t/10)+"ms",i.style.transitionDuration=e,y([i],"visible")}},onShow:function(){i&&(i.style.transitionDuration="0ms")},onHide:function(){i&&y([i],"hidden")}}}};var $={clientX:0,clientY:0},q=[];function z(e){var t=e.clientX,n=e.clientY;$={clientX:t,clientY:n}}var J={name:"followCursor",defaultValue:!1,fn:function(e){var t=e.reference,n=w(e.props.triggerTarget||t),r=!1,o=!1,i=!0,a=e.props;function s(){return"initial"===e.props.followCursor&&e.state.isVisible}function u(){n.addEventListener("mousemove",f)}function c(){n.removeEventListener("mousemove",f)}function p(){r=!0,e.setProps({getReferenceClientRect:null}),r=!1}function f(n){var r=!n.target||t.contains(n.target),o=e.props.followCursor,i=n.clientX,a=n.clientY,s=t.getBoundingClientRect(),u=i-s.left,c=a-s.top;!r&&e.props.interactive||e.setProps({getReferenceClientRect:function(){var e=t.getBoundingClientRect(),n=i,r=a;"initial"===o&&(n=e.left+u,r=e.top+c);var s="horizontal"===o?e.top:r,p="vertical"===o?e.right:n,f="horizontal"===o?e.bottom:r,l="vertical"===o?e.left:n;return{width:p-l,height:f-s,top:s,right:p,bottom:f,left:l}}})}function l(){e.props.followCursor&&(q.push({instance:e,doc:n}),function(e){e.addEventListener("mousemove",z)}(n))}function d(){0===(q=q.filter((function(t){return t.instance!==e}))).filter((function(e){return e.doc===n})).length&&function(e){e.removeEventListener("mousemove",z)}(n)}return{onCreate:l,onDestroy:d,onBeforeUpdate:function(){a=e.props},onAfterUpdate:function(t,n){var i=n.followCursor;r||void 0!==i&&a.followCursor!==i&&(d(),i?(l(),!e.state.isMounted||o||s()||u()):(c(),p()))},onMount:function(){e.props.followCursor&&!o&&(i&&(f($),i=!1),s()||u())},onTrigger:function(e,t){m(t)&&($={clientX:t.clientX,clientY:t.clientY}),o="focus"===t.type},onHidden:function(){e.props.followCursor&&(p(),c(),i=!0)}}}};var G={name:"inlinePositioning",defaultValue:!1,fn:function(e){var t,n=e.reference;var r=-1,o=!1,i=[],a={name:"tippyInlinePositioning",enabled:!0,phase:"afterWrite",fn:function(o){var a=o.state;e.props.inlinePositioning&&(-1!==i.indexOf(a.placement)&&(i=[]),t!==a.placement&&-1===i.indexOf(a.placement)&&(i.push(a.placement),e.setProps({getReferenceClientRect:function(){return function(e){return function(e,t,n,r){if(n.length<2||null===e)return t;if(2===n.length&&r>=0&&n[0].left>n[1].right)return n[r]||t;switch(e){case"top":case"bottom":var o=n[0],i=n[n.length-1],a="top"===e,s=o.top,u=i.bottom,c=a?o.left:i.left,p=a?o.right:i.right;return{top:s,bottom:u,left:c,right:p,width:p-c,height:u-s};case"left":case"right":var f=Math.min.apply(Math,n.map((function(e){return e.left}))),l=Math.max.apply(Math,n.map((function(e){return e.right}))),d=n.filter((function(t){return"left"===e?t.left===f:t.right===l})),v=d[0].top,m=d[d.length-1].bottom;return{top:v,bottom:m,left:f,right:l,width:l-f,height:m-v};default:return t}}(p(e),n.getBoundingClientRect(),f(n.getClientRects()),r)}(a.placement)}})),t=a.placement)}};function s(){var t;o||(t=function(e,t){var n;return{popperOptions:Object.assign({},e.popperOptions,{modifiers:[].concat(((null==(n=e.popperOptions)?void 0:n.modifiers)||[]).filter((function(e){return e.name!==t.name})),[t])})}}(e.props,a),o=!0,e.setProps(t),o=!1)}return{onCreate:s,onAfterUpdate:s,onTrigger:function(t,n){if(m(n)){var o=f(e.reference.getClientRects()),i=o.find((function(e){return e.left-2<=n.clientX&&e.right+2>=n.clientX&&e.top-2<=n.clientY&&e.bottom+2>=n.clientY})),a=o.indexOf(i);r=a>-1?a:r}},onHidden:function(){r=-1}}}};var K={name:"sticky",defaultValue:!1,fn:function(e){var t=e.reference,n=e.popper;function r(t){return!0===e.props.sticky||e.props.sticky===t}var o=null,i=null;function a(){var s=r("reference")?(e.popperInstance?e.popperInstance.state.elements.reference:t).getBoundingClientRect():null,u=r("popper")?n.getBoundingClientRect():null;(s&&Q(o,s)||u&&Q(i,u))&&e.popperInstance&&e.popperInstance.update(),o=s,i=u,e.state.isMounted&&requestAnimationFrame(a)}return{onMount:function(){e.props.sticky&&a()}}}};function Q(e,t){return!e||!t||(e.top!==t.top||e.right!==t.right||e.bottom!==t.bottom||e.left!==t.left)}return F.setDefaultProps({plugins:[Y,J,G,K],render:N}),F.createSingleton=function(e,t){var n;void 0===t&&(t={});var r,o=e,i=[],a=[],c=t.overrides,p=[],f=!1;function l(){a=o.map((function(e){return u(e.props.triggerTarget||e.reference)})).reduce((function(e,t){return e.concat(t)}),[])}function v(){i=o.map((function(e){return e.reference}))}function m(e){o.forEach((function(t){e?t.enable():t.disable()}))}function g(e){return o.map((function(t){var n=t.setProps;return t.setProps=function(o){n(o),t.reference===r&&e.setProps(o)},function(){t.setProps=n}}))}function h(e,t){var n=a.indexOf(t);if(t!==r){r=t;var s=(c||[]).concat("content").reduce((function(e,t){return e[t]=o[n].props[t],e}),{});e.setProps(Object.assign({},s,{getReferenceClientRect:"function"==typeof s.getReferenceClientRect?s.getReferenceClientRect:function(){var e;return null==(e=i[n])?void 0:e.getBoundingClientRect()}}))}}m(!1),v(),l();var b={fn:function(){return{onDestroy:function(){m(!0)},onHidden:function(){r=null},onClickOutside:function(e){e.props.showOnCreate&&!f&&(f=!0,r=null)},onShow:function(e){e.props.showOnCreate&&!f&&(f=!0,h(e,i[0]))},onTrigger:function(e,t){h(e,t.currentTarget)}}}},y=F(d(),Object.assign({},s(t,["overrides"]),{plugins:[b].concat(t.plugins||[]),triggerTarget:a,popperOptions:Object.assign({},t.popperOptions,{modifiers:[].concat((null==(n=t.popperOptions)?void 0:n.modifiers)||[],[W])})})),w=y.show;y.show=function(e){if(w(),!r&&null==e)return h(y,i[0]);if(!r||null!=e){if("number"==typeof e)return i[e]&&h(y,i[e]);if(o.indexOf(e)>=0){var t=e.reference;return h(y,t)}return i.indexOf(e)>=0?h(y,e):void 0}},y.showNext=function(){var e=i[0];if(!r)return y.show(0);var t=i.indexOf(r);y.show(i[t+1]||e)},y.showPrevious=function(){var e=i[i.length-1];if(!r)return y.show(e);var t=i.indexOf(r),n=i[t-1]||e;y.show(n)};var E=y.setProps;return y.setProps=function(e){c=e.overrides||c,E(e)},y.setInstances=function(e){m(!0),p.forEach((function(e){return e()})),o=e,m(!1),v(),l(),p=g(y),y.setProps({triggerTarget:a})},p=g(y),y},F.delegate=function(e,n){var r=[],o=[],i=!1,a=n.target,c=s(n,["target"]),p=Object.assign({},c,{trigger:"manual",touch:!1}),f=Object.assign({touch:R.touch},c,{showOnCreate:!0}),l=F(e,p);function d(e){if(e.target&&!i){var t=e.target.closest(a);if(t){var r=t.getAttribute("data-tippy-trigger")||n.trigger||R.trigger;if(!t._tippy&&!("touchstart"===e.type&&"boolean"==typeof f.touch||"touchstart"!==e.type&&r.indexOf(X[e.type])<0)){var s=F(t,f);s&&(o=o.concat(s))}}}}function v(e,t,n,o){void 0===o&&(o=!1),e.addEventListener(t,n,o),r.push({node:e,eventType:t,handler:n,options:o})}return u(l).forEach((function(e){var n=e.destroy,a=e.enable,s=e.disable;e.destroy=function(e){void 0===e&&(e=!0),e&&o.forEach((function(e){e.destroy()})),o=[],r.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,o=e.options;t.removeEventListener(n,r,o)})),r=[],n()},e.enable=function(){a(),o.forEach((function(e){return e.enable()})),i=!1},e.disable=function(){s(),o.forEach((function(e){return e.disable()})),i=!0},function(e){var n=e.reference;v(n,"touchstart",d,t),v(n,"mouseover",d),v(n,"focusin",d),v(n,"click",d)}(e)})),l},F.hideAll=function(e){var t=void 0===e?{}:e,n=t.exclude,r=t.duration;U.forEach((function(e){var t=!1;if(n&&(t=g(n)?e.reference===n:e.popper===n.popper),!t){var o=e.props.duration;e.setProps({duration:r}),e.hide(),e.state.isDestroyed||e.setProps({duration:o})}}))},F.roundArrow='',F})); + diff --git a/_site/worksheets/aesthetic-mappings_files/libs/quarto-ojs/quarto-ojs-runtime.js b/_site/worksheets/aesthetic-mappings_files/libs/quarto-ojs/quarto-ojs-runtime.js new file mode 100644 index 0000000..7d21a9f --- /dev/null +++ b/_site/worksheets/aesthetic-mappings_files/libs/quarto-ojs/quarto-ojs-runtime.js @@ -0,0 +1,24005 @@ +// quarto-ojs-runtime v0.0.18 Copyright 2024 undefined +var EOL = {}, + EOF = {}, + QUOTE = 34, + NEWLINE = 10, + RETURN = 13; + +function objectConverter(columns) { + return new Function("d", "return {" + columns.map(function(name, i) { + return JSON.stringify(name) + ": d[" + i + "] || \"\""; + }).join(",") + "}"); +} + +function customConverter(columns, f) { + var object = objectConverter(columns); + return function(row, i) { + return f(object(row), i, columns); + }; +} + +// Compute unique columns in order of discovery. +function inferColumns(rows) { + var columnSet = Object.create(null), + columns = []; + + rows.forEach(function(row) { + for (var column in row) { + if (!(column in columnSet)) { + columns.push(columnSet[column] = column); + } + } + }); + + return columns; +} + +function pad$1(value, width) { + var s = value + "", length = s.length; + return length < width ? new Array(width - length + 1).join(0) + s : s; +} + +function formatYear$1(year) { + return year < 0 ? "-" + pad$1(-year, 6) + : year > 9999 ? "+" + pad$1(year, 6) + : pad$1(year, 4); +} + +function formatDate$2(date) { + var hours = date.getUTCHours(), + minutes = date.getUTCMinutes(), + seconds = date.getUTCSeconds(), + milliseconds = date.getUTCMilliseconds(); + return isNaN(date) ? "Invalid Date" + : formatYear$1(date.getUTCFullYear()) + "-" + pad$1(date.getUTCMonth() + 1, 2) + "-" + pad$1(date.getUTCDate(), 2) + + (milliseconds ? "T" + pad$1(hours, 2) + ":" + pad$1(minutes, 2) + ":" + pad$1(seconds, 2) + "." + pad$1(milliseconds, 3) + "Z" + : seconds ? "T" + pad$1(hours, 2) + ":" + pad$1(minutes, 2) + ":" + pad$1(seconds, 2) + "Z" + : minutes || hours ? "T" + pad$1(hours, 2) + ":" + pad$1(minutes, 2) + "Z" + : ""); +} + +function dsv$1(delimiter) { + var reFormat = new RegExp("[\"" + delimiter + "\n\r]"), + DELIMITER = delimiter.charCodeAt(0); + + function parse(text, f) { + var convert, columns, rows = parseRows(text, function(row, i) { + if (convert) return convert(row, i - 1); + columns = row, convert = f ? customConverter(row, f) : objectConverter(row); + }); + rows.columns = columns || []; + return rows; + } + + function parseRows(text, f) { + var rows = [], // output rows + N = text.length, + I = 0, // current character index + n = 0, // current line number + t, // current token + eof = N <= 0, // current token followed by EOF? + eol = false; // current token followed by EOL? + + // Strip the trailing newline. + if (text.charCodeAt(N - 1) === NEWLINE) --N; + if (text.charCodeAt(N - 1) === RETURN) --N; + + function token() { + if (eof) return EOF; + if (eol) return eol = false, EOL; + + // Unescape quotes. + var i, j = I, c; + if (text.charCodeAt(j) === QUOTE) { + while (I++ < N && text.charCodeAt(I) !== QUOTE || text.charCodeAt(++I) === QUOTE); + if ((i = I) >= N) eof = true; + else if ((c = text.charCodeAt(I++)) === NEWLINE) eol = true; + else if (c === RETURN) { eol = true; if (text.charCodeAt(I) === NEWLINE) ++I; } + return text.slice(j + 1, i - 1).replace(/""/g, "\""); + } + + // Find next delimiter or newline. + while (I < N) { + if ((c = text.charCodeAt(i = I++)) === NEWLINE) eol = true; + else if (c === RETURN) { eol = true; if (text.charCodeAt(I) === NEWLINE) ++I; } + else if (c !== DELIMITER) continue; + return text.slice(j, i); + } + + // Return last token before EOF. + return eof = true, text.slice(j, N); + } + + while ((t = token()) !== EOF) { + var row = []; + while (t !== EOL && t !== EOF) row.push(t), t = token(); + if (f && (row = f(row, n++)) == null) continue; + rows.push(row); + } + + return rows; + } + + function preformatBody(rows, columns) { + return rows.map(function(row) { + return columns.map(function(column) { + return formatValue(row[column]); + }).join(delimiter); + }); + } + + function format(rows, columns) { + if (columns == null) columns = inferColumns(rows); + return [columns.map(formatValue).join(delimiter)].concat(preformatBody(rows, columns)).join("\n"); + } + + function formatBody(rows, columns) { + if (columns == null) columns = inferColumns(rows); + return preformatBody(rows, columns).join("\n"); + } + + function formatRows(rows) { + return rows.map(formatRow).join("\n"); + } + + function formatRow(row) { + return row.map(formatValue).join(delimiter); + } + + function formatValue(value) { + return value == null ? "" + : value instanceof Date ? formatDate$2(value) + : reFormat.test(value += "") ? "\"" + value.replace(/"/g, "\"\"") + "\"" + : value; + } + + return { + parse: parse, + parseRows: parseRows, + format: format, + formatBody: formatBody, + formatRows: formatRows, + formatRow: formatRow, + formatValue: formatValue + }; +} + +var csv = dsv$1(","); + +var csvParse = csv.parse; +var csvParseRows = csv.parseRows; + +var tsv = dsv$1("\t"); + +var tsvParse = tsv.parse; +var tsvParseRows = tsv.parseRows; + +function autoType(object) { + for (var key in object) { + var value = object[key].trim(), number, m; + if (!value) value = null; + else if (value === "true") value = true; + else if (value === "false") value = false; + else if (value === "NaN") value = NaN; + else if (!isNaN(number = +value)) value = number; + else if (m = value.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/)) { + if (fixtz && !!m[4] && !m[7]) value = value.replace(/-/g, "/").replace(/T/, " "); + value = new Date(value); + } + else continue; + object[key] = value; + } + return object; +} + +// https://github.com/d3/d3-dsv/issues/45 +const fixtz = new Date("2019-01-01T00:00").getHours() || new Date("2019-07-01T00:00").getHours(); + +function dependency(name, version, main) { + return { + resolve(path = main) { + return `${name}@${version}/${path}`; + } + }; +} + +const d3 = dependency("d3", "7.8.5", "dist/d3.min.js"); +const inputs = dependency("@observablehq/inputs", "0.10.6", "dist/inputs.min.js"); +const plot = dependency("@observablehq/plot", "0.6.11", "dist/plot.umd.min.js"); +const graphviz = dependency("@observablehq/graphviz", "0.2.1", "dist/graphviz.min.js"); +const highlight = dependency("@observablehq/highlight.js", "2.0.0", "highlight.min.js"); +const katex = dependency("@observablehq/katex", "0.11.1", "dist/katex.min.js"); +const lodash = dependency("lodash", "4.17.21", "lodash.min.js"); +const htl = dependency("htl", "0.3.1", "dist/htl.min.js"); +const jszip = dependency("jszip", "3.10.1", "dist/jszip.min.js"); +const marked = dependency("marked", "0.3.12", "marked.min.js"); +const sql = dependency("sql.js", "1.8.0", "dist/sql-wasm.js"); +const vega = dependency("vega", "5.22.1", "build/vega.min.js"); +const vegalite = dependency("vega-lite", "5.6.0", "build/vega-lite.min.js"); +const vegaliteApi = dependency("vega-lite-api", "5.0.0", "build/vega-lite-api.min.js"); +const arrow4 = dependency("apache-arrow", "4.0.1", "Arrow.es2015.min.js"); +const arrow9 = dependency("apache-arrow", "9.0.0", "+esm"); +const arrow11 = dependency("apache-arrow", "11.0.0", "+esm"); +const arquero = dependency("arquero", "4.8.8", "dist/arquero.min.js"); +const topojson = dependency("topojson-client", "3.1.0", "dist/topojson-client.min.js"); +const exceljs = dependency("exceljs", "4.3.0", "dist/exceljs.min.js"); +const mermaid$1 = dependency("mermaid", "9.2.2", "dist/mermaid.min.js"); +const leaflet$1 = dependency("leaflet", "1.9.3", "dist/leaflet.js"); +const duckdb = dependency("@duckdb/duckdb-wasm", "1.24.0", "+esm"); + +const metas = new Map; +const queue$1 = []; +const map$2 = queue$1.map; +const some = queue$1.some; +const hasOwnProperty$2 = queue$1.hasOwnProperty; +const identifierRe = /^((?:@[^/@]+\/)?[^/@]+)(?:@([^/]+))?(?:\/(.*))?$/; +const versionRe = /^\d+\.\d+\.\d+(-[\w-.+]+)?$/; +const extensionRe = /(?:\.[^/]*|\/)$/; + +class RequireError extends Error { + constructor(message) { + super(message); + } +} + +RequireError.prototype.name = RequireError.name; + +function parseIdentifier(identifier) { + const match = identifierRe.exec(identifier); + return match && { + name: match[1], + version: match[2], + path: match[3] + }; +} + +function resolveFrom(origin = "https://cdn.jsdelivr.net/npm/", mains = ["unpkg", "jsdelivr", "browser", "main"]) { + if (!/\/$/.test(origin)) throw new Error("origin lacks trailing slash"); + + function main(meta) { + for (const key of mains) { + let value = meta[key]; + if (typeof value === "string") { + if (value.startsWith("./")) value = value.slice(2); + return extensionRe.test(value) ? value : `${value}.js`; + } + } + } + + function resolveMeta(target) { + const url = `${origin}${target.name}${target.version ? `@${target.version}` : ""}/package.json`; + let meta = metas.get(url); + if (!meta) metas.set(url, meta = fetch(url).then(response => { + if (!response.ok) throw new RequireError("unable to load package.json"); + if (response.redirected && !metas.has(response.url)) metas.set(response.url, meta); + return response.json(); + })); + return meta; + } + + return async function resolve(name, base) { + if (name.startsWith(origin)) name = name.substring(origin.length); + if (/^(\w+:)|\/\//i.test(name)) return name; + if (/^[.]{0,2}\//i.test(name)) return new URL(name, base == null ? location : base).href; + if (!name.length || /^[\s._]/.test(name) || /\s$/.test(name)) throw new RequireError("illegal name"); + const target = parseIdentifier(name); + if (!target) return `${origin}${name}`; + if (!target.version && base != null && base.startsWith(origin)) { + const meta = await resolveMeta(parseIdentifier(base.substring(origin.length))); + target.version = meta.dependencies && meta.dependencies[target.name] || meta.peerDependencies && meta.peerDependencies[target.name]; + } + if (target.path && !extensionRe.test(target.path)) target.path += ".js"; + if (target.path && target.version && versionRe.test(target.version)) return `${origin}${target.name}@${target.version}/${target.path}`; + const meta = await resolveMeta(target); + return `${origin}${meta.name}@${meta.version}/${target.path || main(meta) || "index.js"}`; + }; +} + +var require = requireFrom(resolveFrom()); +let requestsInFlight = 0; +let prevDefine = undefined; + +function requireFrom(resolver) { + const cache = new Map; + const requireBase = requireRelative(null); + + function requireAbsolute(url) { + if (typeof url !== "string") return url; + let module = cache.get(url); + if (!module) cache.set(url, module = new Promise((resolve, reject) => { + const script = document.createElement("script"); + script.onload = () => { + try { resolve(queue$1.pop()(requireRelative(url))); } + catch (error) { reject(new RequireError("invalid module")); } + script.remove(); + requestsInFlight--; + if (requestsInFlight === 0) { + window.define = prevDefine; + } + }; + script.onerror = () => { + reject(new RequireError("unable to load module")); + script.remove(); + requestsInFlight--; + if (requestsInFlight === 0) { + window.define = prevDefine; + } + }; + script.async = true; + script.src = url; + if (requestsInFlight === 0) { + prevDefine = window.define; + window.define = define; + } + requestsInFlight++; + + document.head.appendChild(script); + })); + return module; + } + + function requireRelative(base) { + return name => Promise.resolve(resolver(name, base)).then(requireAbsolute); + } + + function requireAlias(aliases) { + return requireFrom((name, base) => { + if (name in aliases) { + name = aliases[name], base = null; + if (typeof name !== "string") return name; + } + return resolver(name, base); + }); + } + + function require(name) { + return arguments.length > 1 + ? Promise.all(map$2.call(arguments, requireBase)).then(merge$1) + : requireBase(name); + } + + require.alias = requireAlias; + require.resolve = resolver; + + return require; +} + +function merge$1(modules) { + const o = {}; + for (const m of modules) { + for (const k in m) { + if (hasOwnProperty$2.call(m, k)) { + if (m[k] == null) Object.defineProperty(o, k, {get: getter(m, k)}); + else o[k] = m[k]; + } + } + } + return o; +} + +function getter(object, name) { + return () => object[name]; +} + +function isbuiltin(name) { + name = name + ""; + return name === "exports" || name === "module"; +} + +function define(name, dependencies, factory) { + const n = arguments.length; + if (n < 2) factory = name, dependencies = []; + else if (n < 3) factory = dependencies, dependencies = typeof name === "string" ? [] : name; + queue$1.push(some.call(dependencies, isbuiltin) ? require => { + const exports = {}; + const module = {exports}; + return Promise.all(map$2.call(dependencies, name => { + name = name + ""; + return name === "exports" ? exports : name === "module" ? module : require(name); + })).then(dependencies => { + factory.apply(null, dependencies); + return module.exports; + }); + } : require => { + return Promise.all(map$2.call(dependencies, require)).then(dependencies => { + return typeof factory === "function" ? factory.apply(null, dependencies) : factory; + }); + }); +} + +define.amd = {}; + +// TODO Allow this to be overridden using the Library’s resolver. +const cdn = "https://cdn.observableusercontent.com/npm/"; + +let requireDefault = require; + +function setDefaultRequire(require) { + requireDefault = require; +} + +function requirer(resolver) { + return resolver == null ? requireDefault : requireFrom(resolver); +} + +function fromEntries(obj) { + const result = {}; + for (const [key, value] of obj) { + result[key] = value; + } + return result; +} + +async function SQLite(require) { + const [init, dist] = await Promise.all([require(sql.resolve()), require.resolve(sql.resolve("dist/"))]); + return init({locateFile: file => `${dist}${file}`}); +} + +class SQLiteDatabaseClient { + constructor(db) { + Object.defineProperties(this, { + _db: {value: db} + }); + } + static async open(source) { + const [SQL, buffer] = await Promise.all([SQLite(requireDefault), Promise.resolve(source).then(load$1)]); + return new SQLiteDatabaseClient(new SQL.Database(buffer)); + } + async query(query, params) { + return await exec(this._db, query, params); + } + async queryRow(query, params) { + return (await this.query(query, params))[0] || null; + } + async explain(query, params) { + const rows = await this.query(`EXPLAIN QUERY PLAN ${query}`, params); + return element$1("pre", {className: "observablehq--inspect"}, [ + text$2(rows.map(row => row.detail).join("\n")) + ]); + } + async describeTables({schema} = {}) { + return this.query(`SELECT NULLIF(schema, 'main') AS schema, name FROM pragma_table_list() WHERE type = 'table'${schema == null ? "" : ` AND schema = ?`} AND name NOT LIKE 'sqlite_%' ORDER BY schema, name`, schema == null ? [] : [schema]); + } + async describeColumns({schema, table} = {}) { + if (table == null) throw new Error(`missing table`); + const rows = await this.query(`SELECT name, type, "notnull" FROM pragma_table_info(?${schema == null ? "" : `, ?`}) ORDER BY cid`, schema == null ? [table] : [table, schema]); + if (!rows.length) throw new Error(`table not found: ${table}`); + return rows.map(({name, type, notnull}) => ({name, type: sqliteType(type), databaseType: type, nullable: !notnull})); + } + async describe(object) { + const rows = await (object === undefined + ? this.query(`SELECT name FROM sqlite_master WHERE type = 'table'`) + : this.query(`SELECT * FROM pragma_table_info(?)`, [object])); + if (!rows.length) throw new Error("Not found"); + const {columns} = rows; + return element$1("table", {value: rows}, [ + element$1("thead", [element$1("tr", columns.map(c => element$1("th", [text$2(c)])))]), + element$1("tbody", rows.map(r => element$1("tr", columns.map(c => element$1("td", [text$2(r[c])]))))) + ]); + } + async sql() { + return this.query(...this.queryTag.apply(this, arguments)); + } + queryTag(strings, ...params) { + return [strings.join("?"), params]; + } +} + +Object.defineProperty(SQLiteDatabaseClient.prototype, "dialect", { + value: "sqlite" +}); + +// https://www.sqlite.org/datatype3.html +function sqliteType(type) { + switch (type) { + case "NULL": + return "null"; + case "INT": + case "INTEGER": + case "TINYINT": + case "SMALLINT": + case "MEDIUMINT": + case "BIGINT": + case "UNSIGNED BIG INT": + case "INT2": + case "INT8": + return "integer"; + case "TEXT": + case "CLOB": + return "string"; + case "REAL": + case "DOUBLE": + case "DOUBLE PRECISION": + case "FLOAT": + case "NUMERIC": + return "number"; + case "BLOB": + return "buffer"; + case "DATE": + case "DATETIME": + return "string"; // TODO convert strings to Date instances in sql.js + default: + return /^(?:(?:(?:VARYING|NATIVE) )?CHARACTER|(?:N|VAR|NVAR)CHAR)\(/.test(type) ? "string" + : /^(?:DECIMAL|NUMERIC)\(/.test(type) ? "number" + : "other"; + } +} + +function load$1(source) { + return typeof source === "string" ? fetch(source).then(load$1) + : source instanceof Response || source instanceof Blob ? source.arrayBuffer().then(load$1) + : source instanceof ArrayBuffer ? new Uint8Array(source) + : source; +} + +async function exec(db, query, params) { + const [result] = await db.exec(query, params); + if (!result) return []; + const {columns, values} = result; + const rows = values.map(row => fromEntries(row.map((value, i) => [columns[i], value]))); + rows.columns = columns; + return rows; +} + +function element$1(name, props, children) { + if (arguments.length === 2) children = props, props = undefined; + const element = document.createElement(name); + if (props !== undefined) for (const p in props) element[p] = props[p]; + if (children !== undefined) for (const c of children) element.appendChild(c); + return element; +} + +function text$2(value) { + return document.createTextNode(value); +} + +function ascending(a, b) { + return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN; +} + +function descending(a, b) { + return a == null || b == null ? NaN + : b < a ? -1 + : b > a ? 1 + : b >= a ? 0 + : NaN; +} + +function bisector(f) { + let compare1, compare2, delta; + + // If an accessor is specified, promote it to a comparator. In this case we + // can test whether the search value is (self-) comparable. We can’t do this + // for a comparator (except for specific, known comparators) because we can’t + // tell if the comparator is symmetric, and an asymmetric comparator can’t be + // used to test whether a single value is comparable. + if (f.length !== 2) { + compare1 = ascending; + compare2 = (d, x) => ascending(f(d), x); + delta = (d, x) => f(d) - x; + } else { + compare1 = f === ascending || f === descending ? f : zero; + compare2 = f; + delta = f; + } + + function left(a, x, lo = 0, hi = a.length) { + if (lo < hi) { + if (compare1(x, x) !== 0) return hi; + do { + const mid = (lo + hi) >>> 1; + if (compare2(a[mid], x) < 0) lo = mid + 1; + else hi = mid; + } while (lo < hi); + } + return lo; + } + + function right(a, x, lo = 0, hi = a.length) { + if (lo < hi) { + if (compare1(x, x) !== 0) return hi; + do { + const mid = (lo + hi) >>> 1; + if (compare2(a[mid], x) <= 0) lo = mid + 1; + else hi = mid; + } while (lo < hi); + } + return lo; + } + + function center(a, x, lo = 0, hi = a.length) { + const i = left(a, x, lo, hi - 1); + return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i; + } + + return {left, center, right}; +} + +function zero() { + return 0; +} + +function number(x) { + return x === null ? NaN : +x; +} + +bisector(ascending); +bisector(number).center; + +function greatest(values, compare = ascending) { + let max; + let defined = false; + if (compare.length === 1) { + let maxValue; + for (const element of values) { + const value = compare(element); + if (defined + ? ascending(value, maxValue) > 0 + : ascending(value, value) === 0) { + max = element; + maxValue = value; + defined = true; + } + } + } else { + for (const value of values) { + if (defined + ? compare(value, max) > 0 + : compare(value, value) === 0) { + max = value; + defined = true; + } + } + } + return max; +} + +function reverse(values) { + if (typeof values[Symbol.iterator] !== "function") throw new TypeError("values is not iterable"); + return Array.from(values).reverse(); +} + +function isArqueroTable(value) { + // Arquero tables have a `toArrowBuffer` function + return value && typeof value.toArrowBuffer === "function"; +} + +// Returns true if the vaue is an Apache Arrow table. This uses a “duck” test +// (instead of strict instanceof) because we want it to work with a range of +// Apache Arrow versions at least 7.0.0 or above. +// https://arrow.apache.org/docs/7.0/js/classes/Arrow_dom.Table.html +function isArrowTable(value) { + return ( + value && + typeof value.getChild === "function" && + typeof value.toArray === "function" && + value.schema && + Array.isArray(value.schema.fields) + ); +} + +function getArrowTableSchema(table) { + return table.schema.fields.map(getArrowFieldSchema); +} + +function getArrowFieldSchema(field) { + return { + name: field.name, + type: getArrowType(field.type), + nullable: field.nullable, + databaseType: String(field.type) + }; +} + +// https://github.com/apache/arrow/blob/89f9a0948961f6e94f1ef5e4f310b707d22a3c11/js/src/enum.ts#L140-L141 +function getArrowType(type) { + switch (type.typeId) { + case 2: // Int + return "integer"; + case 3: // Float + case 7: // Decimal + return "number"; + case 4: // Binary + case 15: // FixedSizeBinary + return "buffer"; + case 5: // Utf8 + return "string"; + case 6: // Bool + return "boolean"; + case 8: // Date + case 9: // Time + case 10: // Timestamp + return "date"; + case 12: // List + case 16: // FixedSizeList + return "array"; + case 13: // Struct + case 14: // Union + return "object"; + case 11: // Interval + case 17: // Map + default: + return "other"; + } +} + +async function loadArrow() { + return await import(`${cdn}${arrow11.resolve()}`); +} + +// Adapted from https://observablehq.com/@cmudig/duckdb-client +// Copyright 2021 CMU Data Interaction Group +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +let promise; + +class DuckDBClient { + constructor(db) { + Object.defineProperties(this, { + _db: {value: db} + }); + } + + async queryStream(query, params) { + const connection = await this._db.connect(); + let reader, batch; + try { + if (params?.length > 0) { + const statement = await connection.prepare(query); + reader = await statement.send(...params); + } else { + reader = await connection.send(query); + } + batch = await reader.next(); + if (batch.done) throw new Error("missing first batch"); + } catch (error) { + await connection.close(); + throw error; + } + return { + schema: getArrowTableSchema(batch.value), + async *readRows() { + try { + while (!batch.done) { + yield batch.value.toArray(); + batch = await reader.next(); + } + } finally { + await connection.close(); + } + } + }; + } + + async query(query, params) { + const result = await this.queryStream(query, params); + const results = []; + for await (const rows of result.readRows()) { + for (const row of rows) { + results.push(row); + } + } + results.schema = result.schema; + return results; + } + + async queryRow(query, params) { + const result = await this.queryStream(query, params); + const reader = result.readRows(); + try { + const {done, value} = await reader.next(); + return done || !value.length ? null : value[0]; + } finally { + await reader.return(); + } + } + + async sql(strings, ...args) { + return await this.query(strings.join("?"), args); + } + + queryTag(strings, ...params) { + return [strings.join("?"), params]; + } + + escape(name) { + return `"${name}"`; + } + + async describeTables() { + const tables = await this.query(`SHOW TABLES`); + return tables.map(({name}) => ({name})); + } + + async describeColumns({table} = {}) { + const columns = await this.query(`DESCRIBE ${this.escape(table)}`); + return columns.map(({column_name, column_type, null: nullable}) => ({ + name: column_name, + type: getDuckDBType(column_type), + nullable: nullable !== "NO", + databaseType: column_type + })); + } + + static async of(sources = {}, config = {}) { + const db = await createDuckDB(); + if (config.query?.castTimestampToDate === undefined) { + config = {...config, query: {...config.query, castTimestampToDate: true}}; + } + if (config.query?.castBigIntToDouble === undefined) { + config = {...config, query: {...config.query, castBigIntToDouble: true}}; + } + await db.open(config); + await Promise.all( + Object.entries(sources).map(async ([name, source]) => { + if (source instanceof FileAttachment) { // bare file + await insertFile(db, name, source); + } else if (isArrowTable(source)) { // bare arrow table + await insertArrowTable(db, name, source); + } else if (Array.isArray(source)) { // bare array of objects + await insertArray(db, name, source); + } else if (isArqueroTable(source)) { + await insertArqueroTable(db, name, source); + } else if ("data" in source) { // data + options + const {data, ...options} = source; + if (isArrowTable(data)) { + await insertArrowTable(db, name, data, options); + } else { + await insertArray(db, name, data, options); + } + } else if ("file" in source) { // file + options + const {file, ...options} = source; + await insertFile(db, name, file, options); + } else { + throw new Error(`invalid source: ${source}`); + } + }) + ); + return new DuckDBClient(db); + } +} + +Object.defineProperty(DuckDBClient.prototype, "dialect", { + value: "duckdb" +}); + +async function insertFile(database, name, file, options) { + const url = await file.url(); + if (url.startsWith("blob:")) { + const buffer = await file.arrayBuffer(); + await database.registerFileBuffer(file.name, new Uint8Array(buffer)); + } else { + await database.registerFileURL(file.name, url, 4); // duckdb.DuckDBDataProtocol.HTTP + } + const connection = await database.connect(); + try { + switch (file.mimeType) { + case "text/csv": + case "text/tab-separated-values": { + return await connection.insertCSVFromPath(file.name, { + name, + schema: "main", + ...options + }).catch(async (error) => { + // If initial attempt to insert CSV resulted in a conversion + // error, try again, this time treating all columns as strings. + if (error.toString().includes("Could not convert")) { + return await insertUntypedCSV(connection, file, name); + } + throw error; + }); + } + case "application/json": + return await connection.insertJSONFromPath(file.name, { + name, + schema: "main", + ...options + }); + default: + if (/\.arrow$/i.test(file.name)) { + const buffer = new Uint8Array(await file.arrayBuffer()); + return await connection.insertArrowFromIPCStream(buffer, { + name, + schema: "main", + ...options + }); + } + if (/\.parquet$/i.test(file.name)) { + return await connection.query( + `CREATE VIEW '${name}' AS SELECT * FROM parquet_scan('${file.name}')` + ); + } + throw new Error(`unknown file type: ${file.mimeType}`); + } + } finally { + await connection.close(); + } +} + +async function insertUntypedCSV(connection, file, name) { + const statement = await connection.prepare( + `CREATE TABLE '${name}' AS SELECT * FROM read_csv_auto(?, ALL_VARCHAR=TRUE)` + ); + return await statement.send(file.name); +} + +async function insertArrowTable(database, name, table, options) { + const connection = await database.connect(); + try { + await connection.insertArrowTable(table, { + name, + schema: "main", + ...options + }); + } finally { + await connection.close(); + } +} + +async function insertArqueroTable(database, name, source) { + // TODO When we have stdlib versioning and can upgrade Arquero to version 5, + // we can then call source.toArrow() directly, with insertArrowTable() + const arrow = await loadArrow(); + const table = arrow.tableFromIPC(source.toArrowBuffer()); + return await insertArrowTable(database, name, table); +} + +async function insertArray(database, name, array, options) { + const arrow = await loadArrow(); + const table = arrow.tableFromJSON(array); + return await insertArrowTable(database, name, table, options); +} + +async function loadDuckDB() { + const module = await import(`${cdn}${duckdb.resolve()}`); + const bundle = await module.selectBundle({ + mvp: { + mainModule: `${cdn}${duckdb.resolve("dist/duckdb-mvp.wasm")}`, + mainWorker: `${cdn}${duckdb.resolve("dist/duckdb-browser-mvp.worker.js")}` + }, + eh: { + mainModule: `${cdn}${duckdb.resolve("dist/duckdb-eh.wasm")}`, + mainWorker: `${cdn}${duckdb.resolve("dist/duckdb-browser-eh.worker.js")}` + } + }); + const logger = new module.ConsoleLogger(); + return {module, bundle, logger}; +} + +async function createDuckDB() { + if (promise === undefined) promise = loadDuckDB(); + const {module, bundle, logger} = await promise; + const worker = await module.createWorker(bundle.mainWorker); + const db = new module.AsyncDuckDB(logger, worker); + await db.instantiate(bundle.mainModule); + return db; +} + +// https://duckdb.org/docs/sql/data_types/overview +function getDuckDBType(type) { + switch (type) { + case "BIGINT": + case "HUGEINT": + case "UBIGINT": + return "bigint"; + case "DOUBLE": + case "REAL": + case "FLOAT": + return "number"; + case "INTEGER": + case "SMALLINT": + case "TINYINT": + case "USMALLINT": + case "UINTEGER": + case "UTINYINT": + return "integer"; + case "BOOLEAN": + return "boolean"; + case "DATE": + case "TIMESTAMP": + case "TIMESTAMP WITH TIME ZONE": + return "date"; + case "VARCHAR": + case "UUID": + return "string"; + // case "BLOB": + // case "INTERVAL": + // case "TIME": + default: + if (/^DECIMAL\(/.test(type)) return "integer"; + return "other"; + } +} + +const nChecks = 20; // number of values to check in each array + +// We support two levels of DatabaseClient. The simplest DatabaseClient +// implements only the client.sql tagged template literal. More advanced +// DatabaseClients implement client.query and client.queryStream, which support +// streaming and abort, and the client.queryTag tagged template literal is used +// to translate the contents of a SQL cell or Table cell into the appropriate +// arguments for calling client.query or client.queryStream. For table cells, we +// additionally require client.describeColumns. The client.describeTables method +// is optional. +function isDatabaseClient(value, mode) { + return ( + value && + (typeof value.sql === "function" || + (typeof value.queryTag === "function" && + (typeof value.query === "function" || + typeof value.queryStream === "function"))) && + (mode !== "table" || typeof value.describeColumns === "function") && + value !== __query // don’t match our internal helper + ); +} + +// Returns true if the value is a typed array (for a single-column table), or if +// it’s an array. In the latter case, the elements of the array must be +// consistently typed: either plain objects or primitives or dates. +function isDataArray(value) { + return ( + (Array.isArray(value) && + (isQueryResultSetSchema(value.schema) || + isQueryResultSetColumns(value.columns) || + arrayContainsObjects(value) || + arrayContainsPrimitives(value) || + arrayContainsDates(value))) || + isTypedArray(value) + ); +} + +// Given an array, checks that the given value is an array that does not contain +// any primitive values (at least for the first few values that we check), and +// that the first object contains enumerable keys (see computeSchema for how we +// infer the columns). We assume that the contents of the table are homogenous, +// but we don’t currently enforce this. +// https://observablehq.com/@observablehq/database-client-specification#§1 +function arrayContainsObjects(value) { + const n = Math.min(nChecks, value.length); + for (let i = 0; i < n; ++i) { + const v = value[i]; + if (v === null || typeof v !== "object") return false; + } + return n > 0 && objectHasEnumerableKeys(value[0]); +} + +// Using a for-in loop here means that we can abort after finding at least one +// enumerable key (whereas Object.keys would require materializing the array of +// all keys, which would be considerably slower if the value has many keys!). +// This function assumes that value is an object; see arrayContainsObjects. +function objectHasEnumerableKeys(value) { + for (const _ in value) return true; + return false; +} + +function isQueryResultSetSchema(schemas) { + return ( + Array.isArray(schemas) && + schemas.every(isColumnSchema) + ); +} + +function isQueryResultSetColumns(columns) { + return (Array.isArray(columns) && columns.every((name) => typeof name === "string")); +} + +function isColumnSchema(schema) { + return schema && typeof schema.name === "string" && typeof schema.type === "string"; +} + +// Returns true if the value represents an array of primitives (i.e., a +// single-column table). This should only be passed values for which +// isDataArray returns true. +function arrayIsPrimitive(value) { + return ( + isTypedArray(value) || + arrayContainsPrimitives(value) || + arrayContainsDates(value) + ); +} + +// Given an array, checks that the first n elements are primitives (number, +// string, boolean, bigint) of a consistent type. +function arrayContainsPrimitives(value) { + const n = Math.min(nChecks, value.length); + if (!(n > 0)) return false; + let type; + let hasPrimitive = false; // ensure we encounter 1+ primitives + for (let i = 0; i < n; ++i) { + const v = value[i]; + if (v == null) continue; // ignore null and undefined + const t = typeof v; + if (type === undefined) { + switch (t) { + case "number": + case "boolean": + case "string": + case "bigint": + type = t; + break; + default: + return false; + } + } else if (t !== type) { + return false; + } + hasPrimitive = true; + } + return hasPrimitive; +} + +// Given an array, checks that the first n elements are dates. +function arrayContainsDates(value) { + const n = Math.min(nChecks, value.length); + if (!(n > 0)) return false; + let hasDate = false; // ensure we encounter 1+ dates + for (let i = 0; i < n; ++i) { + const v = value[i]; + if (v == null) continue; // ignore null and undefined + if (!(v instanceof Date)) return false; + hasDate = true; + } + return hasDate; +} + +function isTypedArray(value) { + return ( + value instanceof Int8Array || + value instanceof Int16Array || + value instanceof Int32Array || + value instanceof Uint8Array || + value instanceof Uint8ClampedArray || + value instanceof Uint16Array || + value instanceof Uint32Array || + value instanceof Float32Array || + value instanceof Float64Array + ); +} + +// __query is used by table cells; __query.sql is used by SQL cells. +const __query = Object.assign( + async (source, operations, invalidation, name) => { + source = await loadTableDataSource(await source, name); + if (isDatabaseClient(source)) return evaluateQuery(source, makeQueryTemplate(operations, source), invalidation); + if (isDataArray(source)) return __table(source, operations); + if (!source) throw new Error("missing data source"); + throw new Error("invalid data source"); + }, + { + sql(source, invalidation, name) { + return async function () { + return evaluateQuery(await loadSqlDataSource(await source, name), arguments, invalidation); + }; + } + } +); + +// We use a weak map to cache loaded data sources by key so that we don’t have +// to e.g. create separate SQLiteDatabaseClients every time we’re querying the +// same SQLite file attachment. Since this is a weak map, unused references will +// be garbage collected when they are no longer desired. Note: the name should +// be consistent, as it is not part of the cache key! +function sourceCache(loadSource) { + const cache = new WeakMap(); + return (source, name) => { + if (!source || typeof source !== "object") throw new Error("invalid data source"); + let promise = cache.get(source); + if (!promise || (isDataArray(source) && source.length !== promise._numRows)) { + // Warning: do not await here! We need to populate the cache synchronously. + promise = loadSource(source, name); + promise._numRows = source.length; // This will be undefined for DatabaseClients + cache.set(source, promise); + } + return promise; + }; +} + +const loadTableDataSource = sourceCache(async (source, name) => { + if (source instanceof FileAttachment) { + switch (source.mimeType) { + case "text/csv": return source.csv(); + case "text/tab-separated-values": return source.tsv(); + case "application/json": return source.json(); + case "application/x-sqlite3": return source.sqlite(); + } + if (/\.(arrow|parquet)$/i.test(source.name)) return loadDuckDBClient(source, name); + throw new Error(`unsupported file type: ${source.mimeType}`); + } + if (isArrowTable(source) || isArqueroTable(source)) return loadDuckDBClient(source, name); + if (isDataArray(source) && arrayIsPrimitive(source)) + return Array.from(source, (value) => ({value})); + return source; +}); + +const loadSqlDataSource = sourceCache(async (source, name) => { + if (source instanceof FileAttachment) { + switch (source.mimeType) { + case "text/csv": + case "text/tab-separated-values": + case "application/json": return loadDuckDBClient(source, name); + case "application/x-sqlite3": return source.sqlite(); + } + if (/\.(arrow|parquet)$/i.test(source.name)) return loadDuckDBClient(source, name); + throw new Error(`unsupported file type: ${source.mimeType}`); + } + if (isDataArray(source)) return loadDuckDBClient(await asArrowTable(source, name), name); + if (isArrowTable(source) || isArqueroTable(source)) return loadDuckDBClient(source, name); + return source; +}); + +async function asArrowTable(array, name) { + const arrow = await loadArrow(); + return arrayIsPrimitive(array) + ? arrow.tableFromArrays({[name]: array}) + : arrow.tableFromJSON(array); +} + +function loadDuckDBClient( + source, + name = source instanceof FileAttachment + ? getFileSourceName(source) + : "__table" +) { + return DuckDBClient.of({[name]: source}); +} + +function getFileSourceName(file) { + return file.name + .replace(/@\d+(?=\.|$)/, "") // strip Observable file version number + .replace(/\.\w+$/, ""); // strip file extension +} + +async function evaluateQuery(source, args, invalidation) { + if (!source) throw new Error("missing data source"); + + // If this DatabaseClient supports abort and streaming, use that. + if (typeof source.queryTag === "function") { + const abortController = new AbortController(); + const options = {signal: abortController.signal}; + invalidation.then(() => abortController.abort("invalidated")); + if (typeof source.queryStream === "function") { + return accumulateQuery( + source.queryStream(...source.queryTag.apply(source, args), options) + ); + } + if (typeof source.query === "function") { + return source.query(...source.queryTag.apply(source, args), options); + } + } + + // Otherwise, fallback to the basic sql tagged template literal. + if (typeof source.sql === "function") { + return source.sql.apply(source, args); + } + + // TODO: test if source is a file attachment, and support CSV etc. + throw new Error("source does not implement query, queryStream, or sql"); +} + +// Generator function that yields accumulated query results client.queryStream +async function* accumulateQuery(queryRequest) { + let then = performance.now(); + const queryResponse = await queryRequest; + const values = []; + values.done = false; + values.error = null; + values.schema = queryResponse.schema; + try { + for await (const rows of queryResponse.readRows()) { + if (performance.now() - then > 150 && values.length > 0) { + yield values; + then = performance.now(); + } + for (const value of rows) { + values.push(value); + } + } + values.done = true; + yield values; + } catch (error) { + values.error = error; + yield values; + } +} + +/** + * Returns a SQL query in the form [[parts], ...params] where parts is an array + * of sub-strings and params are the parameter values to be inserted between each + * sub-string. + */ +function makeQueryTemplate(operations, source) { + const escaper = + typeof source.escape === "function" ? source.escape : (i) => i; + const {select, from, filter, sort, slice} = operations; + if (!from.table) + throw new Error("missing from table"); + if (select.columns && select.columns.length === 0) + throw new Error("at least one column must be selected"); + const names = new Map(operations.names?.map(({column, name}) => [column, name])); + const columns = select.columns ? select.columns.map((column) => { + const override = names.get(column); + return override ? `${escaper(column)} AS ${escaper(override)}` : escaper(column); + }).join(", ") : "*"; + const args = [ + [`SELECT ${columns} FROM ${formatTable(from.table, escaper)}`] + ]; + for (let i = 0; i < filter.length; ++i) { + appendSql(i ? `\nAND ` : `\nWHERE `, args); + appendWhereEntry(filter[i], args, escaper); + } + for (let i = 0; i < sort.length; ++i) { + appendSql(i ? `, ` : `\nORDER BY `, args); + appendOrderBy(sort[i], args, escaper); + } + if (source.dialect === "mssql" || source.dialect === "oracle") { + if (slice.to !== null || slice.from !== null) { + if (!sort.length) { + if (!select.columns) + throw new Error( + "at least one column must be explicitly specified. Received '*'." + ); + appendSql(`\nORDER BY `, args); + appendOrderBy( + {column: select.columns[0], direction: "ASC"}, + args, + escaper + ); + } + appendSql(`\nOFFSET ${slice.from || 0} ROWS`, args); + appendSql( + `\nFETCH NEXT ${ + slice.to !== null ? slice.to - (slice.from || 0) : 1e9 + } ROWS ONLY`, + args + ); + } + } else { + if (slice.to !== null || slice.from !== null) { + appendSql( + `\nLIMIT ${slice.to !== null ? slice.to - (slice.from || 0) : 1e9}`, + args + ); + } + if (slice.from !== null) { + appendSql(` OFFSET ${slice.from}`, args); + } + } + return args; +} + +function formatTable(table, escaper) { + if (typeof table === "object") { // i.e., not a bare string specifier + let from = ""; + if (table.database != null) from += escaper(table.database) + "."; + if (table.schema != null) from += escaper(table.schema) + "."; + from += escaper(table.table); + return from; + } else { + return escaper(table); + } +} + +function appendSql(sql, args) { + const strings = args[0]; + strings[strings.length - 1] += sql; +} + +function appendOrderBy({column, direction}, args, escaper) { + appendSql(`${escaper(column)} ${direction.toUpperCase()}`, args); +} + +function appendWhereEntry({type, operands}, args, escaper) { + if (operands.length < 1) throw new Error("Invalid operand length"); + + // Unary operations + // We treat `v` and `nv` as `NULL` and `NOT NULL` unary operations in SQL, + // since the database already validates column types. + if (operands.length === 1 || type === "v" || type === "nv") { + appendOperand(operands[0], args, escaper); + switch (type) { + case "n": + case "nv": + appendSql(` IS NULL`, args); + return; + case "nn": + case "v": + appendSql(` IS NOT NULL`, args); + return; + default: + throw new Error("Invalid filter operation"); + } + } + + // Binary operations + if (operands.length === 2) { + if (["in", "nin"].includes(type)) ; else if (["c", "nc"].includes(type)) { + // TODO: Case (in)sensitive? + appendOperand(operands[0], args, escaper); + switch (type) { + case "c": + appendSql(` LIKE `, args); + break; + case "nc": + appendSql(` NOT LIKE `, args); + break; + } + appendOperand(likeOperand(operands[1]), args, escaper); + return; + } else { + appendOperand(operands[0], args, escaper); + switch (type) { + case "eq": + appendSql(` = `, args); + break; + case "ne": + appendSql(` <> `, args); + break; + case "gt": + appendSql(` > `, args); + break; + case "lt": + appendSql(` < `, args); + break; + case "gte": + appendSql(` >= `, args); + break; + case "lte": + appendSql(` <= `, args); + break; + default: + throw new Error("Invalid filter operation"); + } + appendOperand(operands[1], args, escaper); + return; + } + } + + // List operations + appendOperand(operands[0], args, escaper); + switch (type) { + case "in": + appendSql(` IN (`, args); + break; + case "nin": + appendSql(` NOT IN (`, args); + break; + default: + throw new Error("Invalid filter operation"); + } + appendListOperands(operands.slice(1), args); + appendSql(")", args); +} + +function appendOperand(o, args, escaper) { + if (o.type === "column") { + appendSql(escaper(o.value), args); + } else { + args.push(o.value); + args[0].push(""); + } +} + +// TODO: Support column operands here? +function appendListOperands(ops, args) { + let first = true; + for (const op of ops) { + if (first) first = false; + else appendSql(",", args); + args.push(op.value); + args[0].push(""); + } +} + +function likeOperand(operand) { + return {...operand, value: `%${operand.value}%`}; +} + +// Comparator function that moves null values (undefined, null, NaN) to the +// end of the array. +function defined(a, b) { + return (a == null || !(a >= a)) - (b == null || !(b >= b)); +} + +// Comparator function that sorts values in ascending order, with null values at +// the end. +function ascendingDefined(a, b) { + return defined(a, b) || (a < b ? -1 : a > b ? 1 : 0); +} + +// Comparator function that sorts values in descending order, with null values +// at the end. +function descendingDefined(a, b) { + return defined(a, b) || (a > b ? -1 : a < b ? 1 : 0); +} + +// Functions for checking type validity +const isValidNumber = (value) => typeof value === "number" && !Number.isNaN(value); +const isValidInteger = (value) => Number.isInteger(value) && !Number.isNaN(value); +const isValidString = (value) => typeof value === "string"; +const isValidBoolean = (value) => typeof value === "boolean"; +const isValidBigint = (value) => typeof value === "bigint"; +const isValidDate = (value) => value instanceof Date && !isNaN(value); +const isValidBuffer = (value) => value instanceof ArrayBuffer; +const isValidArray = (value) => Array.isArray(value); +const isValidObject = (value) => typeof value === "object" && value !== null; +const isValidOther = (value) => value != null; + +// Function to get the correct validity checking function based on type +function getTypeValidator(colType) { + switch (colType) { + case "string": + return isValidString; + case "bigint": + return isValidBigint; + case "boolean": + return isValidBoolean; + case "number": + return isValidNumber; + case "integer": + return isValidInteger; + case "date": + return isValidDate; + case "buffer": + return isValidBuffer; + case "array": + return isValidArray; + case "object": + return isValidObject; + case "other": + default: + return isValidOther; + } +} + +// Accepts dates in the form of ISOString and LocaleDateString, with or without time +const DATE_TEST = /^(([-+]\d{2})?\d{4}(-\d{2}(-\d{2}))|(\d{1,2})\/(\d{1,2})\/(\d{2,4}))([T ]\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/; + +function coerceToType(value, type) { + switch (type) { + case "string": + return typeof value === "string" || value == null ? value : String(value); + case "boolean": + if (typeof value === "string") { + const trimValue = value.trim().toLowerCase(); + return trimValue === "true" + ? true + : trimValue === "false" + ? false + : null; + } + return typeof value === "boolean" || value == null + ? value + : Boolean(value); + case "bigint": + return typeof value === "bigint" || value == null + ? value + : Number.isInteger(typeof value === "string" && !value.trim() ? NaN : +value) + ? BigInt(value) // eslint-disable-line no-undef + : undefined; + case "integer": // not a target type for coercion, but can be inferred + case "number": { + return typeof value === "number" + ? value + : value == null || (typeof value === "string" && !value.trim()) + ? NaN + : Number(value); + } + case "date": { + if (value instanceof Date || value == null) return value; + if (typeof value === "number") return new Date(value); + const trimValue = String(value).trim(); + if (typeof value === "string" && !trimValue) return null; + return new Date(DATE_TEST.test(trimValue) ? trimValue : NaN); + } + case "array": + case "object": + case "buffer": + case "other": + return value; + default: + throw new Error(`Unable to coerce to type: ${type}`); + } +} + +function getSchema(source) { + const {columns} = source; + let {schema} = source; + if (!isQueryResultSetSchema(schema)) { + schema = inferSchema(source, isQueryResultSetColumns(columns) ? columns : undefined); + return {schema, inferred: true}; + } + return {schema, inferred: false}; +} + +// This function infers a schema from the source data, if one doesn't already +// exist, and merges type assertions into that schema. If the schema was +// inferred or if there are type assertions, it then coerces the rows in the +// source data to the types specified in the schema. +function applyTypes(source, operations) { + const input = source; + let {schema, inferred} = getSchema(source); + const types = new Map(schema.map(({name, type}) => [name, type])); + if (operations.types) { + for (const {name, type} of operations.types) { + types.set(name, type); + // update schema with user-selected type + if (schema === input.schema) schema = schema.slice(); // copy on write + const colIndex = schema.findIndex((col) => col.name === name); + if (colIndex > -1) schema[colIndex] = {...schema[colIndex], type}; + } + source = source.map(d => coerceRow(d, types, schema)); + } else if (inferred) { + // Coerce data according to new schema, unless that happened due to + // operations.types, above. + source = source.map(d => coerceRow(d, types, schema)); + } + return {source, schema}; +} + +function applyNames(source, operations) { + if (!operations.names) return source; + const overridesByName = new Map(operations.names.map((n) => [n.column, n])); + return source.map((d) => + Object.fromEntries(Object.keys(d).map((k) => { + const override = overridesByName.get(k); + return [override?.name ?? k, d[k]]; + })) + ); +} + +// This function applies table cell operations to an in-memory table (array of +// objects); it should be equivalent to the corresponding SQL query. TODO Use +// DuckDBClient for data arrays, too, and then we wouldn’t need our own __table +// function to do table operations on in-memory data? +function __table(source, operations) { + const errors = new Map(); + const input = source; + const typed = applyTypes(source, operations); + source = typed.source; + let schema = typed.schema; + if (operations.derive) { + // Derived columns may depend on coerced values from the original data source, + // so we must evaluate derivations after the initial inference and coercion + // step. + const derivedSource = []; + operations.derive.map(({name, value}) => { + let columnErrors = []; + // Derived column formulas may reference renamed columns, so we must + // compute derivations on the renamed source. However, we don't modify the + // source itself with renamed names until after the other operations are + // applied, because operations like filter and sort reference original + // column names. + // TODO Allow derived columns to reference other derived columns. + applyNames(source, operations).map((row, index) => { + let resolved; + try { + // TODO Support referencing `index` and `rows` in the derive function. + resolved = value(row); + } catch (error) { + columnErrors.push({index, error}); + resolved = undefined; + } + if (derivedSource[index]) { + derivedSource[index] = {...derivedSource[index], [name]: resolved}; + } else { + derivedSource.push({[name]: resolved}); + } + }); + if (columnErrors.length) errors.set(name, columnErrors); + }); + // Since derived columns are untyped by default, we do a pass of type + // inference and coercion after computing the derived values. + const typedDerived = applyTypes(derivedSource, operations); + // Merge derived source and schema with the source dataset. + source = source.map((row, i) => ({...row, ...typedDerived.source[i]})); + schema = [...schema, ...typedDerived.schema]; + } + for (const {type, operands} of operations.filter) { + const [{value: column}] = operands; + const values = operands.slice(1).map(({value}) => value); + switch (type) { + // valid (matches the column type) + case "v": { + const [colType] = values; + const isValid = getTypeValidator(colType); + source = source.filter(d => isValid(d[column])); + break; + } + // not valid (doesn't match the column type) + case "nv": { + const [colType] = values; + const isValid = getTypeValidator(colType); + source = source.filter(d => !isValid(d[column])); + break; + } + case "eq": { + const [value] = values; + if (value instanceof Date) { + const time = +value; // compare as primitive + source = source.filter((d) => +d[column] === time); + } else { + source = source.filter((d) => d[column] === value); + } + break; + } + case "ne": { + const [value] = values; + source = source.filter((d) => d[column] !== value); + break; + } + case "c": { + const [value] = values; + source = source.filter( + (d) => typeof d[column] === "string" && d[column].includes(value) + ); + break; + } + case "nc": { + const [value] = values; + source = source.filter( + (d) => typeof d[column] === "string" && !d[column].includes(value) + ); + break; + } + case "in": { + const set = new Set(values); // TODO support dates? + source = source.filter((d) => set.has(d[column])); + break; + } + case "nin": { + const set = new Set(values); // TODO support dates? + source = source.filter((d) => !set.has(d[column])); + break; + } + case "n": { + source = source.filter((d) => d[column] == null); + break; + } + case "nn": { + source = source.filter((d) => d[column] != null); + break; + } + case "lt": { + const [value] = values; + source = source.filter((d) => d[column] < value); + break; + } + case "lte": { + const [value] = values; + source = source.filter((d) => d[column] <= value); + break; + } + case "gt": { + const [value] = values; + source = source.filter((d) => d[column] > value); + break; + } + case "gte": { + const [value] = values; + source = source.filter((d) => d[column] >= value); + break; + } + default: + throw new Error(`unknown filter type: ${type}`); + } + } + for (const {column, direction} of reverse(operations.sort)) { + const compare = direction === "desc" ? descendingDefined : ascendingDefined; + if (source === input) source = source.slice(); // defensive copy + source.sort((a, b) => compare(a[column], b[column])); + } + let {from, to} = operations.slice; + from = from == null ? 0 : Math.max(0, from); + to = to == null ? Infinity : Math.max(0, to); + if (from > 0 || to < Infinity) { + source = source.slice(Math.max(0, from), Math.max(0, to)); + } + // Preserve the schema for all columns. + let fullSchema = schema.slice(); + if (operations.select.columns) { + if (schema) { + const schemaByName = new Map(schema.map((s) => [s.name, s])); + schema = operations.select.columns.map((c) => schemaByName.get(c)); + } + source = source.map((d) => + Object.fromEntries(operations.select.columns.map((c) => [c, d[c]])) + ); + } + if (operations.names) { + const overridesByName = new Map(operations.names.map((n) => [n.column, n])); + if (schema) { + schema = schema.map((s) => { + const override = overridesByName.get(s.name); + return ({...s, ...(override ? {name: override.name} : null)}); + }); + } + if (fullSchema) { + fullSchema = fullSchema.map((s) => { + const override = overridesByName.get(s.name); + return ({...s, ...(override ? {name: override.name} : null)}); + }); + } + source = applyNames(source, operations); + } + if (source !== input) { + if (schema) source.schema = schema; + } + source.fullSchema = fullSchema; + source.errors = errors; + return source; +} + +function coerceRow(object, types, schema) { + const coerced = {}; + for (const col of schema) { + const type = types.get(col.name); + const value = object[col.name]; + coerced[col.name] = type === "raw" ? value : coerceToType(value, type); + } + return coerced; +} + +function createTypeCount() { + return { + boolean: 0, + integer: 0, + number: 0, + date: 0, + string: 0, + array: 0, + object: 0, + bigint: 0, + buffer: 0, + defined: 0 + }; +} + +// Caution: the order below matters! 🌶️ The first one that passes the ≥90% test +// should be the one that we chose, and therefore these types should be listed +// from most specific to least specific. +const types$2 = [ + "boolean", + "integer", + "number", + "date", + "bigint", + "array", + "object", + "buffer" + // Note: "other" and "string" are intentionally omitted; see below! +]; + +// We need to show *all* keys present in the array of Objects +function getAllKeys(rows) { + const keys = new Set(); + for (const row of rows) { + // avoid crash if row is null or undefined + if (row) { + // only enumerable properties + for (const key in row) { + // only own properties + if (Object.prototype.hasOwnProperty.call(row, key)) { + // unique properties, in the order they appear + keys.add(key); + } + } + } + } + return Array.from(keys); +} + +function inferSchema(source, columns = getAllKeys(source)) { + const schema = []; + const sampleSize = 100; + const sample = source.slice(0, sampleSize); + for (const col of columns) { + const colCount = createTypeCount(); + for (const d of sample) { + let value = d[col]; + if (value == null) continue; + const type = typeof value; + if (type !== "string") { + ++colCount.defined; + if (Array.isArray(value)) ++colCount.array; + else if (value instanceof Date) ++colCount.date; + else if (value instanceof ArrayBuffer) ++colCount.buffer; + else if (type === "number") { + ++colCount.number; + if (Number.isInteger(value)) ++colCount.integer; + } + // bigint, boolean, or object + else if (type in colCount) ++colCount[type]; + } else { + value = value.trim(); + if (!value) continue; + ++colCount.defined; + ++colCount.string; + if (/^(true|false)$/i.test(value)) { + ++colCount.boolean; + } else if (value && !isNaN(value)) { + ++colCount.number; + if (Number.isInteger(+value)) ++colCount.integer; + } else if (DATE_TEST.test(value)) ++colCount.date; + } + } + // Chose the non-string, non-other type with the greatest count that is also + // ≥90%; or if no such type meets that criterion, fallback to string if + // ≥90%; and lastly fallback to other. + const minCount = Math.max(1, colCount.defined * 0.9); + const type = + greatest(types$2, (type) => + colCount[type] >= minCount ? colCount[type] : NaN + ) ?? (colCount.string >= minCount ? "string" : "other"); + schema.push({ + name: col, + type: type, + inferred: type + }); + } + return schema; +} + +class Workbook { + constructor(workbook) { + Object.defineProperties(this, { + _: {value: workbook}, + sheetNames: { + value: workbook.worksheets.map((s) => s.name), + enumerable: true + } + }); + } + sheet(name, options) { + const sname = + typeof name === "number" + ? this.sheetNames[name] + : this.sheetNames.includes((name += "")) + ? name + : null; + if (sname == null) throw new Error(`Sheet not found: ${name}`); + const sheet = this._.getWorksheet(sname); + return extract(sheet, options); + } +} + +function extract(sheet, {range, headers} = {}) { + let [[c0, r0], [c1, r1]] = parseRange(range, sheet); + const headerRow = headers ? sheet._rows[r0++] : null; + let names = new Set(["#"]); + for (let n = c0; n <= c1; n++) { + const value = headerRow ? valueOf(headerRow.findCell(n + 1)) : null; + let name = (value && value + "") || toColumn(n); + while (names.has(name)) name += "_"; + names.add(name); + } + names = new Array(c0).concat(Array.from(names)); + + const output = new Array(r1 - r0 + 1); + for (let r = r0; r <= r1; r++) { + const row = (output[r - r0] = Object.create(null, {"#": {value: r + 1}})); + const _row = sheet.getRow(r + 1); + if (_row.hasValues) + for (let c = c0; c <= c1; c++) { + const value = valueOf(_row.findCell(c + 1)); + if (value != null) row[names[c + 1]] = value; + } + } + + output.columns = names.filter(() => true); // Filter sparse columns + return output; +} + +function valueOf(cell) { + if (!cell) return; + const {value} = cell; + if (value && typeof value === "object" && !(value instanceof Date)) { + if (value.formula || value.sharedFormula) { + return value.result && value.result.error ? NaN : value.result; + } + if (value.richText) { + return richText(value); + } + if (value.text) { + let {text} = value; + if (text.richText) text = richText(text); + return value.hyperlink && value.hyperlink !== text + ? `${value.hyperlink} ${text}` + : text; + } + return value; + } + return value; +} + +function richText(value) { + return value.richText.map((d) => d.text).join(""); +} + +function parseRange(specifier = ":", {columnCount, rowCount}) { + specifier += ""; + if (!specifier.match(/^[A-Z]*\d*:[A-Z]*\d*$/)) + throw new Error("Malformed range specifier"); + const [[c0 = 0, r0 = 0], [c1 = columnCount - 1, r1 = rowCount - 1]] = + specifier.split(":").map(fromCellReference); + return [ + [c0, r0], + [c1, r1] + ]; +} + +// Returns the default column name for a zero-based column index. +// For example: 0 -> "A", 1 -> "B", 25 -> "Z", 26 -> "AA", 27 -> "AB". +function toColumn(c) { + let sc = ""; + c++; + do { + sc = String.fromCharCode(64 + (c % 26 || 26)) + sc; + } while ((c = Math.floor((c - 1) / 26))); + return sc; +} + +// Returns the zero-based indexes from a cell reference. +// For example: "A1" -> [0, 0], "B2" -> [1, 1], "AA10" -> [26, 9]. +function fromCellReference(s) { + const [, sc, sr] = s.match(/^([A-Z]*)(\d*)$/); + let c = 0; + if (sc) + for (let i = 0; i < sc.length; i++) + c += Math.pow(26, sc.length - i - 1) * (sc.charCodeAt(i) - 64); + return [c ? c - 1 : undefined, sr ? +sr - 1 : undefined]; +} + +async function remote_fetch(file) { + const response = await fetch(await file.url()); + if (!response.ok) throw new Error(`Unable to load file: ${file.name}`); + return response; +} + +function enforceSchema(source, schema) { + const types = new Map(schema.map(({name, type}) => [name, type])); + return Object.assign(source.map(d => coerceRow(d, types, schema)), {schema}); +} + +async function dsv(file, delimiter, {array = false, typed = false} = {}) { + const text = await file.text(); + const parse = (delimiter === "\t" + ? (array ? tsvParseRows : tsvParse) + : (array ? csvParseRows : csvParse)); + if (typed === "auto" && !array) { + const source = parse(text); + return enforceSchema(source, inferSchema(source, source.columns)); + } + return parse(text, typed && autoType); +} + +class AbstractFile { + constructor(name, mimeType) { + Object.defineProperty(this, "name", {value: name, enumerable: true}); + if (mimeType !== undefined) Object.defineProperty(this, "mimeType", {value: mimeType + "", enumerable: true}); + } + async blob() { + return (await remote_fetch(this)).blob(); + } + async arrayBuffer() { + return (await remote_fetch(this)).arrayBuffer(); + } + async text() { + return (await remote_fetch(this)).text(); + } + async json() { + return (await remote_fetch(this)).json(); + } + async stream() { + return (await remote_fetch(this)).body; + } + async csv(options) { + return dsv(this, ",", options); + } + async tsv(options) { + return dsv(this, "\t", options); + } + async image(props) { + const url = await this.url(); + return new Promise((resolve, reject) => { + const i = new Image(); + if (new URL(url, document.baseURI).origin !== new URL(location).origin) { + i.crossOrigin = "anonymous"; + } + Object.assign(i, props); + i.onload = () => resolve(i); + i.onerror = () => reject(new Error(`Unable to load file: ${this.name}`)); + i.src = url; + }); + } + async arrow({version = 4} = {}) { + switch (version) { + case 4: { + const [Arrow, response] = await Promise.all([requireDefault(arrow4.resolve()), remote_fetch(this)]); + return Arrow.Table.from(response); + } + case 9: { + const [Arrow, response] = await Promise.all([import(`${cdn}${arrow9.resolve()}`), remote_fetch(this)]); + return Arrow.tableFromIPC(response); + } + case 11: { + const [Arrow, response] = await Promise.all([import(`${cdn}${arrow11.resolve()}`), remote_fetch(this)]); + return Arrow.tableFromIPC(response); + } + default: throw new Error(`unsupported arrow version: ${version}`); + } + } + async sqlite() { + return SQLiteDatabaseClient.open(remote_fetch(this)); + } + async zip() { + const [JSZip, buffer] = await Promise.all([requireDefault(jszip.resolve()), this.arrayBuffer()]); + return new ZipArchive(await JSZip.loadAsync(buffer)); + } + async xml(mimeType = "application/xml") { + return (new DOMParser).parseFromString(await this.text(), mimeType); + } + async html() { + return this.xml("text/html"); + } + async xlsx() { + const [ExcelJS, buffer] = await Promise.all([requireDefault(exceljs.resolve()), this.arrayBuffer()]); + return new Workbook(await new ExcelJS.Workbook().xlsx.load(buffer)); + } +} + +class FileAttachment extends AbstractFile { + constructor(url, name, mimeType) { + super(name, mimeType); + Object.defineProperty(this, "_url", {value: url}); + } + async url() { + return (await this._url) + ""; + } +} + +function NoFileAttachments(name) { + throw new Error(`File not found: ${name}`); +} + +function FileAttachments(resolve) { + return Object.assign( + name => { + const result = resolve(name += ""); + if (result == null) throw new Error(`File not found: ${name}`); + if (typeof result === "object" && "url" in result) { + const {url, mimeType} = result; + return new FileAttachment(url, name, mimeType); + } + return new FileAttachment(result, name); + }, + {prototype: FileAttachment.prototype} // instanceof + ); +} + +class ZipArchive { + constructor(archive) { + Object.defineProperty(this, "_", {value: archive}); + this.filenames = Object.keys(archive.files).filter(name => !archive.files[name].dir); + } + file(path) { + const object = this._.file(path += ""); + if (!object || object.dir) throw new Error(`file not found: ${path}`); + return new ZipArchiveEntry(object); + } +} + +class ZipArchiveEntry extends AbstractFile { + constructor(object) { + super(object.name); + Object.defineProperty(this, "_", {value: object}); + Object.defineProperty(this, "_url", {writable: true}); + } + async url() { + return this._url || (this._url = this.blob().then(URL.createObjectURL)); + } + async blob() { + return this._.async("blob"); + } + async arrayBuffer() { + return this._.async("arraybuffer"); + } + async text() { + return this._.async("text"); + } + async json() { + return JSON.parse(await this.text()); + } +} + +function canvas(width, height) { + var canvas = document.createElement("canvas"); + canvas.width = width; + canvas.height = height; + return canvas; +} + +function context2d(width, height, dpi) { + if (dpi == null) dpi = devicePixelRatio; + var canvas = document.createElement("canvas"); + canvas.width = width * dpi; + canvas.height = height * dpi; + canvas.style.width = width + "px"; + var context = canvas.getContext("2d"); + context.scale(dpi, dpi); + return context; +} + +function download(value, name = "untitled", label = "Save") { + const a = document.createElement("a"); + const b = a.appendChild(document.createElement("button")); + b.textContent = label; + a.download = name; + + async function reset() { + await new Promise(requestAnimationFrame); + URL.revokeObjectURL(a.href); + a.removeAttribute("href"); + b.textContent = label; + b.disabled = false; + } + + a.onclick = async event => { + b.disabled = true; + if (a.href) return reset(); // Already saved. + b.textContent = "Saving…"; + try { + const object = await (typeof value === "function" ? value() : value); + b.textContent = "Download"; + a.href = URL.createObjectURL(object); // eslint-disable-line require-atomic-updates + } catch (ignore) { + b.textContent = label; + } + if (event.eventPhase) return reset(); // Already downloaded. + b.disabled = false; + }; + + return a; +} + +var namespaces = { + math: "http://www.w3.org/1998/Math/MathML", + svg: "http://www.w3.org/2000/svg", + xhtml: "http://www.w3.org/1999/xhtml", + xlink: "http://www.w3.org/1999/xlink", + xml: "http://www.w3.org/XML/1998/namespace", + xmlns: "http://www.w3.org/2000/xmlns/" +}; + +function element(name, attributes) { + var prefix = name += "", i = prefix.indexOf(":"), value; + if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns") name = name.slice(i + 1); + var element = namespaces.hasOwnProperty(prefix) // eslint-disable-line no-prototype-builtins + ? document.createElementNS(namespaces[prefix], name) + : document.createElement(name); + if (attributes) for (var key in attributes) { + prefix = key, i = prefix.indexOf(":"), value = attributes[key]; + if (i >= 0 && (prefix = key.slice(0, i)) !== "xmlns") key = key.slice(i + 1); + if (namespaces.hasOwnProperty(prefix)) element.setAttributeNS(namespaces[prefix], key, value); // eslint-disable-line no-prototype-builtins + else element.setAttribute(key, value); + } + return element; +} + +function input$1(type) { + var input = document.createElement("input"); + if (type != null) input.type = type; + return input; +} + +function range$1(min, max, step) { + if (arguments.length === 1) max = min, min = null; + var input = document.createElement("input"); + input.min = min = min == null ? 0 : +min; + input.max = max = max == null ? 1 : +max; + input.step = step == null ? "any" : step = +step; + input.type = "range"; + return input; +} + +function select(values) { + var select = document.createElement("select"); + Array.prototype.forEach.call(values, function(value) { + var option = document.createElement("option"); + option.value = option.textContent = value; + select.appendChild(option); + }); + return select; +} + +function svg$1(width, height) { + var svg = document.createElementNS("http://www.w3.org/2000/svg", "svg"); + svg.setAttribute("viewBox", [0, 0, width, height]); + svg.setAttribute("width", width); + svg.setAttribute("height", height); + return svg; +} + +function text$1(value) { + return document.createTextNode(value); +} + +var count$1 = 0; + +function uid(name) { + return new Id("O-" + (name == null ? "" : name + "-") + ++count$1); +} + +function Id(id) { + this.id = id; + this.href = new URL(`#${id}`, location) + ""; +} + +Id.prototype.toString = function() { + return "url(" + this.href + ")"; +}; + +var DOM = /*#__PURE__*/Object.freeze({ +__proto__: null, +canvas: canvas, +context2d: context2d, +download: download, +element: element, +input: input$1, +range: range$1, +select: select, +svg: svg$1, +text: text$1, +uid: uid +}); + +function buffer(file) { + return new Promise(function(resolve, reject) { + var reader = new FileReader; + reader.onload = function() { resolve(reader.result); }; + reader.onerror = reject; + reader.readAsArrayBuffer(file); + }); +} + +function text(file) { + return new Promise(function(resolve, reject) { + var reader = new FileReader; + reader.onload = function() { resolve(reader.result); }; + reader.onerror = reject; + reader.readAsText(file); + }); +} + +function url(file) { + return new Promise(function(resolve, reject) { + var reader = new FileReader; + reader.onload = function() { resolve(reader.result); }; + reader.onerror = reject; + reader.readAsDataURL(file); + }); +} + +var Files = /*#__PURE__*/Object.freeze({ +__proto__: null, +buffer: buffer, +text: text, +url: url +}); + +function that() { + return this; +} + +function disposable(value, dispose) { + let done = false; + if (typeof dispose !== "function") { + throw new Error("dispose is not a function"); + } + return { + [Symbol.iterator]: that, + next: () => done ? {done: true} : (done = true, {done: false, value}), + return: () => (done = true, dispose(value), {done: true}), + throw: () => ({done: done = true}) + }; +} + +function* filter(iterator, test) { + var result, index = -1; + while (!(result = iterator.next()).done) { + if (test(result.value, ++index)) { + yield result.value; + } + } +} + +function observe(initialize) { + let stale = false; + let value; + let resolve; + const dispose = initialize(change); + + if (dispose != null && typeof dispose !== "function") { + throw new Error(typeof dispose.then === "function" + ? "async initializers are not supported" + : "initializer returned something, but not a dispose function"); + } + + function change(x) { + if (resolve) resolve(x), resolve = null; + else stale = true; + return value = x; + } + + function next() { + return {done: false, value: stale + ? (stale = false, Promise.resolve(value)) + : new Promise(_ => (resolve = _))}; + } + + return { + [Symbol.iterator]: that, + throw: () => ({done: true}), + return: () => (dispose != null && dispose(), {done: true}), + next + }; +} + +function input(input) { + return observe(function(change) { + var event = eventof(input), value = valueof$1(input); + function inputted() { change(valueof$1(input)); } + input.addEventListener(event, inputted); + if (value !== undefined) change(value); + return function() { input.removeEventListener(event, inputted); }; + }); +} + +function valueof$1(input) { + switch (input.type) { + case "range": + case "number": return input.valueAsNumber; + case "date": return input.valueAsDate; + case "checkbox": return input.checked; + case "file": return input.multiple ? input.files : input.files[0]; + case "select-multiple": return Array.from(input.selectedOptions, o => o.value); + default: return input.value; + } +} + +function eventof(input) { + switch (input.type) { + case "button": + case "submit": + case "checkbox": return "click"; + case "file": return "change"; + default: return "input"; + } +} + +function* map$1(iterator, transform) { + var result, index = -1; + while (!(result = iterator.next()).done) { + yield transform(result.value, ++index); + } +} + +function queue(initialize) { + let resolve; + const queue = []; + const dispose = initialize(push); + + if (dispose != null && typeof dispose !== "function") { + throw new Error(typeof dispose.then === "function" + ? "async initializers are not supported" + : "initializer returned something, but not a dispose function"); + } + + function push(x) { + queue.push(x); + if (resolve) resolve(queue.shift()), resolve = null; + return x; + } + + function next() { + return {done: false, value: queue.length + ? Promise.resolve(queue.shift()) + : new Promise(_ => (resolve = _))}; + } + + return { + [Symbol.iterator]: that, + throw: () => ({done: true}), + return: () => (dispose != null && dispose(), {done: true}), + next + }; +} + +function* range(start, stop, step) { + start = +start; + stop = +stop; + step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step; + var i = -1, n = Math.max(0, Math.ceil((stop - start) / step)) | 0; + while (++i < n) { + yield start + i * step; + } +} + +function valueAt(iterator, i) { + if (!isFinite(i = +i) || i < 0 || i !== i | 0) return; + var result, index = -1; + while (!(result = iterator.next()).done) { + if (++index === i) { + return result.value; + } + } +} + +function worker(source) { + const url = URL.createObjectURL(new Blob([source], {type: "text/javascript"})); + const worker = new Worker(url); + return disposable(worker, () => { + worker.terminate(); + URL.revokeObjectURL(url); + }); +} + +var Generators$1 = /*#__PURE__*/Object.freeze({ +__proto__: null, +disposable: disposable, +filter: filter, +input: input, +map: map$1, +observe: observe, +queue: queue, +range: range, +valueAt: valueAt, +worker: worker +}); + +function template(render, wrapper) { + return function(strings) { + var string = strings[0], + parts = [], part, + root = null, + node, nodes, + walker, + i, n, j, m, k = -1; + + // Concatenate the text using comments as placeholders. + for (i = 1, n = arguments.length; i < n; ++i) { + part = arguments[i]; + if (part instanceof Node) { + parts[++k] = part; + string += ""; + } else if (Array.isArray(part)) { + for (j = 0, m = part.length; j < m; ++j) { + node = part[j]; + if (node instanceof Node) { + if (root === null) { + parts[++k] = root = document.createDocumentFragment(); + string += ""; + } + root.appendChild(node); + } else { + root = null; + string += node; + } + } + root = null; + } else { + string += part; + } + string += strings[i]; + } + + // Render the text. + root = render(string); + + // Walk the rendered content to replace comment placeholders. + if (++k > 0) { + nodes = new Array(k); + walker = document.createTreeWalker(root, NodeFilter.SHOW_COMMENT, null, false); + while (walker.nextNode()) { + node = walker.currentNode; + if (/^o:/.test(node.nodeValue)) { + nodes[+node.nodeValue.slice(2)] = node; + } + } + for (i = 0; i < k; ++i) { + if (node = nodes[i]) { + node.parentNode.replaceChild(parts[i], node); + } + } + } + + // Is the rendered content + // … a parent of a single child? Detach and return the child. + // … a document fragment? Replace the fragment with an element. + // … some other node? Return it. + return root.childNodes.length === 1 ? root.removeChild(root.firstChild) + : root.nodeType === 11 ? ((node = wrapper()).appendChild(root), node) + : root; + }; +} + +const html$1 = template(function(string) { + var template = document.createElement("template"); + template.innerHTML = string.trim(); + return document.importNode(template.content, true); +}, function() { + return document.createElement("span"); +}); + +async function leaflet(require) { + const L = await require(leaflet$1.resolve()); + if (!L._style) { + const link = document.createElement("link"); + link.rel = "stylesheet"; + link.href = await require.resolve(leaflet$1.resolve("dist/leaflet.css")); + L._style = document.head.appendChild(link); + } + return L; +} + +function md(require) { + return require(marked.resolve()).then(function(marked) { + return template( + function(string) { + var root = document.createElement("div"); + root.innerHTML = marked(string, {langPrefix: ""}).trim(); + var code = root.querySelectorAll("pre code[class]"); + if (code.length > 0) { + require(highlight.resolve()).then(function(hl) { + code.forEach(function(block) { + function done() { + hl.highlightBlock(block); + block.parentNode.classList.add("observablehq--md-pre"); + } + if (hl.getLanguage(block.className)) { + done(); + } else { + require(highlight.resolve("async-languages/index.js")) + .then(index => { + if (index.has(block.className)) { + return require(highlight.resolve("async-languages/" + index.get(block.className))).then(language => { + hl.registerLanguage(block.className, language); + }); + } + }) + .then(done, done); + } + }); + }); + } + return root; + }, + function() { + return document.createElement("div"); + } + ); + }); +} + +async function mermaid(require) { + const mer = await require(mermaid$1.resolve()); + mer.initialize({securityLevel: "loose", theme: "neutral"}); + return function mermaid() { + const root = document.createElement("div"); + root.innerHTML = mer.render(uid().id, String.raw.apply(String, arguments)); + return root.removeChild(root.firstChild); + }; +} + +function Mutable(value) { + let change; + Object.defineProperties(this, { + generator: {value: observe(_ => void (change = _))}, + value: {get: () => value, set: x => change(value = x)} // eslint-disable-line no-setter-return + }); + if (value !== undefined) change(value); +} + +function* now() { + while (true) { + yield Date.now(); + } +} + +function delay(duration, value) { + return new Promise(function(resolve) { + setTimeout(function() { + resolve(value); + }, duration); + }); +} + +var timeouts = new Map; + +function timeout(now, time) { + var t = new Promise(function(resolve) { + timeouts.delete(time); + var delay = time - now; + if (!(delay > 0)) throw new Error("invalid time"); + if (delay > 0x7fffffff) throw new Error("too long to wait"); + setTimeout(resolve, delay); + }); + timeouts.set(time, t); + return t; +} + +function when(time, value) { + var now; + return (now = timeouts.get(time = +time)) ? now.then(() => value) + : (now = Date.now()) >= time ? Promise.resolve(value) + : timeout(now, time).then(() => value); +} + +function tick(duration, value) { + return when(Math.ceil((Date.now() + 1) / duration) * duration, value); +} + +var Promises = /*#__PURE__*/Object.freeze({ +__proto__: null, +delay: delay, +tick: tick, +when: when +}); + +function resolve(name, base) { + if (/^(\w+:)|\/\//i.test(name)) return name; + if (/^[.]{0,2}\//i.test(name)) return new URL(name, base == null ? location : base).href; + if (!name.length || /^[\s._]/.test(name) || /\s$/.test(name)) throw new Error("illegal name"); + return "https://unpkg.com/" + name; +} + +const svg = template(function(string) { + var root = document.createElementNS("http://www.w3.org/2000/svg", "g"); + root.innerHTML = string.trim(); + return root; +}, function() { + return document.createElementNS("http://www.w3.org/2000/svg", "g"); +}); + +var raw = String.raw; + +function style(href) { + return new Promise(function(resolve, reject) { + var link = document.createElement("link"); + link.rel = "stylesheet"; + link.href = href; + link.onerror = reject; + link.onload = resolve; + document.head.appendChild(link); + }); +} + +function tex(require) { + return Promise.all([ + require(katex.resolve()), + require.resolve(katex.resolve("dist/katex.min.css")).then(style) + ]).then(function(values) { + var katex = values[0], tex = renderer(); + + function renderer(options) { + return function() { + var root = document.createElement("div"); + katex.render(raw.apply(String, arguments), root, options); + return root.removeChild(root.firstChild); + }; + } + + tex.options = renderer; + tex.block = renderer({displayMode: true}); + return tex; + }); +} + +async function vl(require) { + const [v, vl, api] = await Promise.all([vega, vegalite, vegaliteApi].map(d => require(d.resolve()))); + return api.register(v, vl); +} + +function width() { + return observe(function(change) { + var width = change(document.body.clientWidth); + function resized() { + var w = document.body.clientWidth; + if (w !== width) change(width = w); + } + window.addEventListener("resize", resized); + return function() { + window.removeEventListener("resize", resized); + }; + }); +} + +const Library = Object.assign(Object.defineProperties(function Library(resolver) { + const require = requirer(resolver); + Object.defineProperties(this, properties({ + FileAttachment: () => NoFileAttachments, + Mutable: () => Mutable, + now, + width, + + // Tagged template literals + dot: () => require(graphviz.resolve()), + htl: () => require(htl.resolve()), + html: () => html$1, + md: () => md(require), + svg: () => svg, + tex: () => tex(require), + + // Recommended libraries + // https://observablehq.com/@observablehq/recommended-libraries + _: () => require(lodash.resolve()), + aq: () => require.alias({"apache-arrow": arrow4.resolve()})(arquero.resolve()), // TODO upgrade to apache-arrow@9 + Arrow: () => require(arrow4.resolve()), // TODO upgrade to apache-arrow@9 + d3: () => require(d3.resolve()), + DuckDBClient: () => DuckDBClient, + Inputs: () => require(inputs.resolve()).then(Inputs => ({...Inputs, file: Inputs.fileOf(AbstractFile)})), + L: () => leaflet(require), + mermaid: () => mermaid(require), + Plot: () => require(plot.resolve()), + __query: () => __query, + require: () => require, + resolve: () => resolve, // deprecated; use async require.resolve instead + SQLite: () => SQLite(require), + SQLiteDatabaseClient: () => SQLiteDatabaseClient, + topojson: () => require(topojson.resolve()), + vl: () => vl(require), + + // Sample datasets + // https://observablehq.com/@observablehq/sample-datasets + aapl: () => new FileAttachment("https://static.observableusercontent.com/files/3ccff97fd2d93da734e76829b2b066eafdaac6a1fafdec0faf6ebc443271cfc109d29e80dd217468fcb2aff1e6bffdc73f356cc48feb657f35378e6abbbb63b9").csv({typed: true}), + alphabet: () => new FileAttachment("https://static.observableusercontent.com/files/75d52e6c3130b1cae83cda89305e17b50f33e7420ef205587a135e8562bcfd22e483cf4fa2fb5df6dff66f9c5d19740be1cfaf47406286e2eb6574b49ffc685d").csv({typed: true}), + cars: () => new FileAttachment("https://static.observableusercontent.com/files/048ec3dfd528110c0665dfa363dd28bc516ffb7247231f3ab25005036717f5c4c232a5efc7bb74bc03037155cb72b1abe85a33d86eb9f1a336196030443be4f6").csv({typed: true}), + citywages: () => new FileAttachment("https://static.observableusercontent.com/files/39837ec5121fcc163131dbc2fe8c1a2e0b3423a5d1e96b5ce371e2ac2e20a290d78b71a4fb08b9fa6a0107776e17fb78af313b8ea70f4cc6648fad68ddf06f7a").csv({typed: true}), + diamonds: () => new FileAttachment("https://static.observableusercontent.com/files/87942b1f5d061a21fa4bb8f2162db44e3ef0f7391301f867ab5ba718b225a63091af20675f0bfe7f922db097b217b377135203a7eab34651e21a8d09f4e37252").csv({typed: true}), + flare: () => new FileAttachment("https://static.observableusercontent.com/files/a6b0d94a7f5828fd133765a934f4c9746d2010e2f342d335923991f31b14120de96b5cb4f160d509d8dc627f0107d7f5b5070d2516f01e4c862b5b4867533000").csv({typed: true}), + industries: () => new FileAttachment("https://static.observableusercontent.com/files/76f13741128340cc88798c0a0b7fa5a2df8370f57554000774ab8ee9ae785ffa2903010cad670d4939af3e9c17e5e18e7e05ed2b38b848ac2fc1a0066aa0005f").csv({typed: true}), + miserables: () => new FileAttachment("https://static.observableusercontent.com/files/31d904f6e21d42d4963ece9c8cc4fbd75efcbdc404bf511bc79906f0a1be68b5a01e935f65123670ed04e35ca8cae3c2b943f82bf8db49c5a67c85cbb58db052").json(), + olympians: () => new FileAttachment("https://static.observableusercontent.com/files/31ca24545a0603dce099d10ee89ee5ae72d29fa55e8fc7c9ffb5ded87ac83060d80f1d9e21f4ae8eb04c1e8940b7287d179fe8060d887fb1f055f430e210007c").csv({typed: true}), + penguins: () => new FileAttachment("https://static.observableusercontent.com/files/715db1223e067f00500780077febc6cebbdd90c151d3d78317c802732252052ab0e367039872ab9c77d6ef99e5f55a0724b35ddc898a1c99cb14c31a379af80a").csv({typed: true}), + pizza: () => new FileAttachment("https://static.observableusercontent.com/files/c653108ab176088cacbb338eaf2344c4f5781681702bd6afb55697a3f91b511c6686ff469f3e3a27c75400001a2334dbd39a4499fe46b50a8b3c278b7d2f7fb5").csv({typed: true}), + weather: () => new FileAttachment("https://static.observableusercontent.com/files/693a46b22b33db0f042728700e0c73e836fa13d55446df89120682d55339c6db7cc9e574d3d73f24ecc9bc7eb9ac9a1e7e104a1ee52c00aab1e77eb102913c1f").csv({typed: true}), + + // Note: these are namespace objects, and thus exposed directly rather than + // being wrapped in a function. This allows library.Generators to resolve, + // rather than needing module.value. + DOM, + Files, + Generators: Generators$1, + Promises + })); +}, { + resolve: { + get: () => requireDefault.resolve, + enumerable: true, + configurable: true + }, + require: { + get: () => requireDefault, + set: setDefaultRequire, + enumerable: true, + configurable: true + } +}), { + resolveFrom, + requireFrom +}); + +function properties(values) { + return Object.fromEntries(Object.entries(values).map(property)); +} + +function property([key, value]) { + return [key, ({value, writable: true, enumerable: true})]; +} + +// src/main.js +class PandocCodeDecorator { + constructor(node) { + this._node = node; + this._spans = []; + this.normalizeCodeRange(); + this.initializeEntryPoints(); + } + normalizeCodeRange() { + const n = this._node; + const lines = n.querySelectorAll("code > span"); + for (const line of lines) { + Array.from(line.childNodes).filter((n2) => n2.nodeType === n2.TEXT_NODE).forEach((n2) => { + const newSpan = document.createElement("span"); + newSpan.textContent = n2.wholeText; + n2.replaceWith(newSpan); + }); + } + } + initializeEntryPoints() { + const lines = this._node.querySelectorAll("code > span"); + let result = []; + let offset = this._node.parentElement.dataset.sourceOffset && -Number(this._node.parentElement.dataset.sourceOffset) || 0; + for (const line of lines) { + let lineNumber = Number(line.id.split("-").pop()); + let column = 1; + Array.from(line.childNodes).filter((n) => n.nodeType === n.ELEMENT_NODE && n.nodeName === "SPAN").forEach((n) => { + result.push({ + offset, + line: lineNumber, + column, + node: n + }); + offset += n.textContent.length; + column += n.textContent.length; + }); + offset += 1; + } + this._elementEntryPoints = result; + } + locateEntry(offset) { + let candidate; + if (offset === Infinity) + return void 0; + for (let i = 0; i < this._elementEntryPoints.length; ++i) { + const entry = this._elementEntryPoints[i]; + if (entry.offset > offset) { + return { entry: candidate, index: i - 1 }; + } + candidate = entry; + } + if (offset < candidate.offset + candidate.node.textContent.length) { + return { entry: candidate, index: this._elementEntryPoints.length - 1 }; + } else { + return void 0; + } + } + offsetToLineColumn(offset) { + let entry = this.locateEntry(offset); + if (entry === void 0) { + const entries = this._elementEntryPoints; + const last = entries[entries.length - 1]; + return { + line: last.line, + column: last.column + Math.min(last.node.textContent.length, offset - last.offset) + }; + } + return { + line: entry.entry.line, + column: entry.entry.column + offset - entry.entry.offset + }; + } + *spanSelection(start, end) { + this.ensureExactSpan(start, end); + const startEntry = this.locateEntry(start); + const endEntry = this.locateEntry(end); + if (startEntry === void 0) { + return; + } + const startIndex = startEntry.index; + const endIndex = endEntry && endEntry.index || this._elementEntryPoints.length; + for (let i = startIndex; i < endIndex; ++i) { + if (this._elementEntryPoints[i] !== void 0) { + yield this._elementEntryPoints[i]; + } + } + } + decorateSpan(start, end, classes) { + for (const entryPoint of this.spanSelection(start, end)) { + for (const cssClass of classes) { + entryPoint.node.classList.add(cssClass); + } + } + } + clearSpan(start, end, classes) { + for (const entryPoint of this.spanSelection(start, end)) { + for (const cssClass of classes) { + entryPoint.node.classList.remove(cssClass); + } + } + } + ensureExactSpan(start, end) { + const splitEntry = (entry, offset) => { + const newSpan = document.createElement("span"); + for (const cssClass of entry.node.classList) { + newSpan.classList.add(cssClass); + } + const beforeText = entry.node.textContent.slice(0, offset - entry.offset); + const afterText = entry.node.textContent.slice(offset - entry.offset); + entry.node.textContent = beforeText; + newSpan.textContent = afterText; + entry.node.after(newSpan); + this._elementEntryPoints.push({ + column: entry.column + offset - entry.offset, + line: entry.line, + node: newSpan, + offset + }); + this._elementEntryPoints.sort((a, b) => a.offset - b.offset); + }; + const startEntry = this.locateEntry(start); + if (startEntry !== void 0 && startEntry.entry !== void 0 && startEntry.entry.offset != start) { + splitEntry(startEntry.entry, start); + } + const endEntry = this.locateEntry(end); + if (endEntry !== void 0 && startEntry.entry !== void 0 && endEntry.entry.offset !== end) { + splitEntry(endEntry.entry, end); + } + } + clearSpan(start, end, classes) { + this.ensureExactSpan(start, end); + const startEntry = this.locateEntry(start); + const endEntry = this.locateEntry(end); + if (startEntry === void 0) { + return; + } + const startIndex = startEntry.index; + const endIndex = endEntry && endEntry.index || this._elementEntryPoints.length; + for (let i = startIndex; i < endIndex; ++i) { + for (const cssClass of classes) { + this._elementEntryPoints[i].node.classList.remove(cssClass); + } + } + } +} + +function dispatch(node, type, detail) { + detail = detail || {}; + var document = node.ownerDocument, event = document.defaultView.CustomEvent; + if (typeof event === "function") { + event = new event(type, {detail: detail}); + } else { + event = document.createEvent("Event"); + event.initEvent(type, false, false); + event.detail = detail; + } + node.dispatchEvent(event); +} + +// TODO https://twitter.com/mbostock/status/702737065121742848 +function isarray(value) { + return Array.isArray(value) + || value instanceof Int8Array + || value instanceof Int16Array + || value instanceof Int32Array + || value instanceof Uint8Array + || value instanceof Uint8ClampedArray + || value instanceof Uint16Array + || value instanceof Uint32Array + || value instanceof Float32Array + || value instanceof Float64Array; +} + +// Non-integer keys in arrays, e.g. [1, 2, 0.5: "value"]. +function isindex(key) { + return key === (key | 0) + ""; +} + +function inspectName(name) { + const n = document.createElement("span"); + n.className = "observablehq--cellname"; + n.textContent = `${name} = `; + return n; +} + +const symbolToString = Symbol.prototype.toString; + +// Symbols do not coerce to strings; they must be explicitly converted. +function formatSymbol(symbol) { + return symbolToString.call(symbol); +} + +const {getOwnPropertySymbols, prototype: {hasOwnProperty: hasOwnProperty$1}} = Object; +const {toStringTag} = Symbol; + +const FORBIDDEN = {}; + +const symbolsof = getOwnPropertySymbols; + +function isown(object, key) { + return hasOwnProperty$1.call(object, key); +} + +function tagof(object) { + return object[toStringTag] + || (object.constructor && object.constructor.name) + || "Object"; +} + +function valueof(object, key) { + try { + const value = object[key]; + if (value) value.constructor; // Test for SecurityError. + return value; + } catch (ignore) { + return FORBIDDEN; + } +} + +const SYMBOLS = [ + { symbol: "@@__IMMUTABLE_INDEXED__@@", name: "Indexed", modifier: true }, + { symbol: "@@__IMMUTABLE_KEYED__@@", name: "Keyed", modifier: true }, + { symbol: "@@__IMMUTABLE_LIST__@@", name: "List", arrayish: true }, + { symbol: "@@__IMMUTABLE_MAP__@@", name: "Map" }, + { + symbol: "@@__IMMUTABLE_ORDERED__@@", + name: "Ordered", + modifier: true, + prefix: true + }, + { symbol: "@@__IMMUTABLE_RECORD__@@", name: "Record" }, + { + symbol: "@@__IMMUTABLE_SET__@@", + name: "Set", + arrayish: true, + setish: true + }, + { symbol: "@@__IMMUTABLE_STACK__@@", name: "Stack", arrayish: true } +]; + +function immutableName(obj) { + try { + let symbols = SYMBOLS.filter(({ symbol }) => obj[symbol] === true); + if (!symbols.length) return; + + const name = symbols.find(s => !s.modifier); + const prefix = + name.name === "Map" && symbols.find(s => s.modifier && s.prefix); + + const arrayish = symbols.some(s => s.arrayish); + const setish = symbols.some(s => s.setish); + + return { + name: `${prefix ? prefix.name : ""}${name.name}`, + symbols, + arrayish: arrayish && !setish, + setish + }; + } catch (e) { + return null; + } +} + +const {getPrototypeOf, getOwnPropertyDescriptors} = Object; +const objectPrototype = getPrototypeOf({}); + +function inspectExpanded(object, _, name, proto) { + let arrayish = isarray(object); + let tag, fields, next, n; + + if (object instanceof Map) { + if (object instanceof object.constructor) { + tag = `Map(${object.size})`; + fields = iterateMap$1; + } else { // avoid incompatible receiver error for prototype + tag = "Map()"; + fields = iterateObject$1; + } + } else if (object instanceof Set) { + if (object instanceof object.constructor) { + tag = `Set(${object.size})`; + fields = iterateSet$1; + } else { // avoid incompatible receiver error for prototype + tag = "Set()"; + fields = iterateObject$1; + } + } else if (arrayish) { + tag = `${object.constructor.name}(${object.length})`; + fields = iterateArray$1; + } else if ((n = immutableName(object))) { + tag = `Immutable.${n.name}${n.name === "Record" ? "" : `(${object.size})`}`; + arrayish = n.arrayish; + fields = n.arrayish + ? iterateImArray$1 + : n.setish + ? iterateImSet$1 + : iterateImObject$1; + } else if (proto) { + tag = tagof(object); + fields = iterateProto; + } else { + tag = tagof(object); + fields = iterateObject$1; + } + + const span = document.createElement("span"); + span.className = "observablehq--expanded"; + if (name) { + span.appendChild(inspectName(name)); + } + const a = span.appendChild(document.createElement("a")); + a.innerHTML = ` + + `; + a.appendChild(document.createTextNode(`${tag}${arrayish ? " [" : " {"}`)); + a.addEventListener("mouseup", function(event) { + event.stopPropagation(); + replace(span, inspectCollapsed(object, null, name, proto)); + }); + + fields = fields(object); + for (let i = 0; !(next = fields.next()).done && i < 20; ++i) { + span.appendChild(next.value); + } + + if (!next.done) { + const a = span.appendChild(document.createElement("a")); + a.className = "observablehq--field"; + a.style.display = "block"; + a.appendChild(document.createTextNode(` … more`)); + a.addEventListener("mouseup", function(event) { + event.stopPropagation(); + span.insertBefore(next.value, span.lastChild.previousSibling); + for (let i = 0; !(next = fields.next()).done && i < 19; ++i) { + span.insertBefore(next.value, span.lastChild.previousSibling); + } + if (next.done) span.removeChild(span.lastChild.previousSibling); + dispatch(span, "load"); + }); + } + + span.appendChild(document.createTextNode(arrayish ? "]" : "}")); + + return span; +} + +function* iterateMap$1(map) { + for (const [key, value] of map) { + yield formatMapField$1(key, value); + } + yield* iterateObject$1(map); +} + +function* iterateSet$1(set) { + for (const value of set) { + yield formatSetField(value); + } + yield* iterateObject$1(set); +} + +function* iterateImSet$1(set) { + for (const value of set) { + yield formatSetField(value); + } +} + +function* iterateArray$1(array) { + for (let i = 0, n = array.length; i < n; ++i) { + if (i in array) { + yield formatField$1(i, valueof(array, i), "observablehq--index"); + } + } + for (const key in array) { + if (!isindex(key) && isown(array, key)) { + yield formatField$1(key, valueof(array, key), "observablehq--key"); + } + } + for (const symbol of symbolsof(array)) { + yield formatField$1( + formatSymbol(symbol), + valueof(array, symbol), + "observablehq--symbol" + ); + } +} + +function* iterateImArray$1(array) { + let i1 = 0; + for (const n = array.size; i1 < n; ++i1) { + yield formatField$1(i1, array.get(i1), true); + } +} + +function* iterateProto(object) { + for (const key in getOwnPropertyDescriptors(object)) { + yield formatField$1(key, valueof(object, key), "observablehq--key"); + } + for (const symbol of symbolsof(object)) { + yield formatField$1( + formatSymbol(symbol), + valueof(object, symbol), + "observablehq--symbol" + ); + } + + const proto = getPrototypeOf(object); + if (proto && proto !== objectPrototype) { + yield formatPrototype(proto); + } +} + +function* iterateObject$1(object) { + for (const key in object) { + if (isown(object, key)) { + yield formatField$1(key, valueof(object, key), "observablehq--key"); + } + } + for (const symbol of symbolsof(object)) { + yield formatField$1( + formatSymbol(symbol), + valueof(object, symbol), + "observablehq--symbol" + ); + } + + const proto = getPrototypeOf(object); + if (proto && proto !== objectPrototype) { + yield formatPrototype(proto); + } +} + +function* iterateImObject$1(object) { + for (const [key, value] of object) { + yield formatField$1(key, value, "observablehq--key"); + } +} + +function formatPrototype(value) { + const item = document.createElement("div"); + const span = item.appendChild(document.createElement("span")); + item.className = "observablehq--field"; + span.className = "observablehq--prototype-key"; + span.textContent = ` `; + item.appendChild(document.createTextNode(": ")); + item.appendChild(inspect(value, undefined, undefined, undefined, true)); + return item; +} + +function formatField$1(key, value, className) { + const item = document.createElement("div"); + const span = item.appendChild(document.createElement("span")); + item.className = "observablehq--field"; + span.className = className; + span.textContent = ` ${key}`; + item.appendChild(document.createTextNode(": ")); + item.appendChild(inspect(value)); + return item; +} + +function formatMapField$1(key, value) { + const item = document.createElement("div"); + item.className = "observablehq--field"; + item.appendChild(document.createTextNode(" ")); + item.appendChild(inspect(key)); + item.appendChild(document.createTextNode(" => ")); + item.appendChild(inspect(value)); + return item; +} + +function formatSetField(value) { + const item = document.createElement("div"); + item.className = "observablehq--field"; + item.appendChild(document.createTextNode(" ")); + item.appendChild(inspect(value)); + return item; +} + +function hasSelection(elem) { + const sel = window.getSelection(); + return ( + sel.type === "Range" && + (sel.containsNode(elem, true) || + sel.anchorNode.isSelfOrDescendant(elem) || + sel.focusNode.isSelfOrDescendant(elem)) + ); +} + +function inspectCollapsed(object, shallow, name, proto) { + let arrayish = isarray(object); + let tag, fields, next, n; + + if (object instanceof Map) { + if (object instanceof object.constructor) { + tag = `Map(${object.size})`; + fields = iterateMap; + } else { // avoid incompatible receiver error for prototype + tag = "Map()"; + fields = iterateObject; + } + } else if (object instanceof Set) { + if (object instanceof object.constructor) { + tag = `Set(${object.size})`; + fields = iterateSet; + } else { // avoid incompatible receiver error for prototype + tag = "Set()"; + fields = iterateObject; + } + } else if (arrayish) { + tag = `${object.constructor.name}(${object.length})`; + fields = iterateArray; + } else if ((n = immutableName(object))) { + tag = `Immutable.${n.name}${n.name === 'Record' ? '' : `(${object.size})`}`; + arrayish = n.arrayish; + fields = n.arrayish ? iterateImArray : n.setish ? iterateImSet : iterateImObject; + } else { + tag = tagof(object); + fields = iterateObject; + } + + if (shallow) { + const span = document.createElement("span"); + span.className = "observablehq--shallow"; + if (name) { + span.appendChild(inspectName(name)); + } + span.appendChild(document.createTextNode(tag)); + span.addEventListener("mouseup", function(event) { + if (hasSelection(span)) return; + event.stopPropagation(); + replace(span, inspectCollapsed(object)); + }); + return span; + } + + const span = document.createElement("span"); + span.className = "observablehq--collapsed"; + if (name) { + span.appendChild(inspectName(name)); + } + const a = span.appendChild(document.createElement("a")); + a.innerHTML = ` + + `; + a.appendChild(document.createTextNode(`${tag}${arrayish ? " [" : " {"}`)); + span.addEventListener("mouseup", function(event) { + if (hasSelection(span)) return; + event.stopPropagation(); + replace(span, inspectExpanded(object, null, name, proto)); + }, true); + + fields = fields(object); + for (let i = 0; !(next = fields.next()).done && i < 20; ++i) { + if (i > 0) span.appendChild(document.createTextNode(", ")); + span.appendChild(next.value); + } + + if (!next.done) span.appendChild(document.createTextNode(", …")); + span.appendChild(document.createTextNode(arrayish ? "]" : "}")); + + return span; +} + +function* iterateMap(map) { + for (const [key, value] of map) { + yield formatMapField(key, value); + } + yield* iterateObject(map); +} + +function* iterateSet(set) { + for (const value of set) { + yield inspect(value, true); + } + yield* iterateObject(set); +} + +function* iterateImSet(set) { + for (const value of set) { + yield inspect(value, true); + } +} + +function* iterateImArray(array) { + let i0 = -1, i1 = 0; + for (const n = array.size; i1 < n; ++i1) { + if (i1 > i0 + 1) yield formatEmpty(i1 - i0 - 1); + yield inspect(array.get(i1), true); + i0 = i1; + } + if (i1 > i0 + 1) yield formatEmpty(i1 - i0 - 1); +} + +function* iterateArray(array) { + let i0 = -1, i1 = 0; + for (const n = array.length; i1 < n; ++i1) { + if (i1 in array) { + if (i1 > i0 + 1) yield formatEmpty(i1 - i0 - 1); + yield inspect(valueof(array, i1), true); + i0 = i1; + } + } + if (i1 > i0 + 1) yield formatEmpty(i1 - i0 - 1); + for (const key in array) { + if (!isindex(key) && isown(array, key)) { + yield formatField(key, valueof(array, key), "observablehq--key"); + } + } + for (const symbol of symbolsof(array)) { + yield formatField(formatSymbol(symbol), valueof(array, symbol), "observablehq--symbol"); + } +} + +function* iterateObject(object) { + for (const key in object) { + if (isown(object, key)) { + yield formatField(key, valueof(object, key), "observablehq--key"); + } + } + for (const symbol of symbolsof(object)) { + yield formatField(formatSymbol(symbol), valueof(object, symbol), "observablehq--symbol"); + } +} + +function* iterateImObject(object) { + for (const [key, value] of object) { + yield formatField(key, value, "observablehq--key"); + } +} + +function formatEmpty(e) { + const span = document.createElement("span"); + span.className = "observablehq--empty"; + span.textContent = e === 1 ? "empty" : `empty × ${e}`; + return span; +} + +function formatField(key, value, className) { + const fragment = document.createDocumentFragment(); + const span = fragment.appendChild(document.createElement("span")); + span.className = className; + span.textContent = key; + fragment.appendChild(document.createTextNode(": ")); + fragment.appendChild(inspect(value, true)); + return fragment; +} + +function formatMapField(key, value) { + const fragment = document.createDocumentFragment(); + fragment.appendChild(inspect(key, true)); + fragment.appendChild(document.createTextNode(" => ")); + fragment.appendChild(inspect(value, true)); + return fragment; +} + +function format(date, fallback) { + if (!(date instanceof Date)) date = new Date(+date); + if (isNaN(date)) return typeof fallback === "function" ? fallback(date) : fallback; + const hours = date.getUTCHours(); + const minutes = date.getUTCMinutes(); + const seconds = date.getUTCSeconds(); + const milliseconds = date.getUTCMilliseconds(); + return `${formatYear(date.getUTCFullYear())}-${pad(date.getUTCMonth() + 1, 2)}-${pad(date.getUTCDate(), 2)}${ + hours || minutes || seconds || milliseconds ? `T${pad(hours, 2)}:${pad(minutes, 2)}${ + seconds || milliseconds ? `:${pad(seconds, 2)}${ + milliseconds ? `.${pad(milliseconds, 3)}` : `` + }` : `` + }Z` : `` + }`; +} + +function formatYear(year) { + return year < 0 ? `-${pad(-year, 6)}` + : year > 9999 ? `+${pad(year, 6)}` + : pad(year, 4); +} + +function pad(value, width) { + return `${value}`.padStart(width, "0"); +} + +function formatDate$1(date) { + return format(date, "Invalid Date"); +} + +var errorToString = Error.prototype.toString; + +function formatError(value) { + return value.stack || errorToString.call(value); +} + +var regExpToString = RegExp.prototype.toString; + +function formatRegExp(value) { + return regExpToString.call(value); +} + +/* eslint-disable no-control-regex */ +const NEWLINE_LIMIT = 20; + +function formatString(string, shallow, expanded, name) { + if (shallow === false) { + // String has fewer escapes displayed with double quotes + if (count(string, /["\n]/g) <= count(string, /`|\${/g)) { + const span = document.createElement("span"); + if (name) span.appendChild(inspectName(name)); + const textValue = span.appendChild(document.createElement("span")); + textValue.className = "observablehq--string"; + textValue.textContent = JSON.stringify(string); + return span; + } + const lines = string.split("\n"); + if (lines.length > NEWLINE_LIMIT && !expanded) { + const div = document.createElement("div"); + if (name) div.appendChild(inspectName(name)); + const textValue = div.appendChild(document.createElement("span")); + textValue.className = "observablehq--string"; + textValue.textContent = "`" + templatify(lines.slice(0, NEWLINE_LIMIT).join("\n")); + const splitter = div.appendChild(document.createElement("span")); + const truncatedCount = lines.length - NEWLINE_LIMIT; + splitter.textContent = `Show ${truncatedCount} truncated line${truncatedCount > 1 ? "s": ""}`; splitter.className = "observablehq--string-expand"; + splitter.addEventListener("mouseup", function (event) { + event.stopPropagation(); + replace(div, inspect(string, shallow, true, name)); + }); + return div; + } + const span = document.createElement("span"); + if (name) span.appendChild(inspectName(name)); + const textValue = span.appendChild(document.createElement("span")); + textValue.className = `observablehq--string${expanded ? " observablehq--expanded" : ""}`; + textValue.textContent = "`" + templatify(string) + "`"; + return span; + } + + const span = document.createElement("span"); + if (name) span.appendChild(inspectName(name)); + const textValue = span.appendChild(document.createElement("span")); + textValue.className = "observablehq--string"; + textValue.textContent = JSON.stringify(string.length > 100 ? + `${string.slice(0, 50)}…${string.slice(-49)}` : string); + return span; +} + +function templatify(string) { + return string.replace(/[\\`\x00-\x09\x0b-\x19]|\${/g, templatifyChar); +} + +function templatifyChar(char) { + var code = char.charCodeAt(0); + switch (code) { + case 0x8: return "\\b"; + case 0x9: return "\\t"; + case 0xb: return "\\v"; + case 0xc: return "\\f"; + case 0xd: return "\\r"; + } + return code < 0x10 ? "\\x0" + code.toString(16) + : code < 0x20 ? "\\x" + code.toString(16) + : "\\" + char; +} + +function count(string, re) { + var n = 0; + while (re.exec(string)) ++n; + return n; +} + +var toString$2 = Function.prototype.toString, + TYPE_ASYNC = {prefix: "async ƒ"}, + TYPE_ASYNC_GENERATOR = {prefix: "async ƒ*"}, + TYPE_CLASS = {prefix: "class"}, + TYPE_FUNCTION = {prefix: "ƒ"}, + TYPE_GENERATOR = {prefix: "ƒ*"}; + +function inspectFunction(f, name) { + var type, m, t = toString$2.call(f); + + switch (f.constructor && f.constructor.name) { + case "AsyncFunction": type = TYPE_ASYNC; break; + case "AsyncGeneratorFunction": type = TYPE_ASYNC_GENERATOR; break; + case "GeneratorFunction": type = TYPE_GENERATOR; break; + default: type = /^class\b/.test(t) ? TYPE_CLASS : TYPE_FUNCTION; break; + } + + // A class, possibly named. + // class Name + if (type === TYPE_CLASS) { + return formatFunction(type, "", name); + } + + // An arrow function with a single argument. + // foo => + // async foo => + if ((m = /^(?:async\s*)?(\w+)\s*=>/.exec(t))) { + return formatFunction(type, "(" + m[1] + ")", name); + } + + // An arrow function with parenthesized arguments. + // (…) + // async (…) + if ((m = /^(?:async\s*)?\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(t))) { + return formatFunction(type, m[1] ? "(" + m[1].replace(/\s*,\s*/g, ", ") + ")" : "()", name); + } + + // A function, possibly: async, generator, anonymous, simply arguments. + // function name(…) + // function* name(…) + // async function name(…) + // async function* name(…) + if ((m = /^(?:async\s*)?function(?:\s*\*)?(?:\s*\w+)?\s*\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(t))) { + return formatFunction(type, m[1] ? "(" + m[1].replace(/\s*,\s*/g, ", ") + ")" : "()", name); + } + + // Something else, like destructuring, comments or default values. + return formatFunction(type, "(…)", name); +} + +function formatFunction(type, args, cellname) { + var span = document.createElement("span"); + span.className = "observablehq--function"; + if (cellname) { + span.appendChild(inspectName(cellname)); + } + var spanType = span.appendChild(document.createElement("span")); + spanType.className = "observablehq--keyword"; + spanType.textContent = type.prefix; + span.appendChild(document.createTextNode(args)); + return span; +} + +const {prototype: {toString: toString$1}} = Object; + +function inspect(value, shallow, expand, name, proto) { + let type = typeof value; + switch (type) { + case "boolean": + case "undefined": { value += ""; break; } + case "number": { value = value === 0 && 1 / value < 0 ? "-0" : value + ""; break; } + case "bigint": { value = value + "n"; break; } + case "symbol": { value = formatSymbol(value); break; } + case "function": { return inspectFunction(value, name); } + case "string": { return formatString(value, shallow, expand, name); } + default: { + if (value === null) { type = null, value = "null"; break; } + if (value instanceof Date) { type = "date", value = formatDate$1(value); break; } + if (value === FORBIDDEN) { type = "forbidden", value = "[forbidden]"; break; } + switch (toString$1.call(value)) { + case "[object RegExp]": { type = "regexp", value = formatRegExp(value); break; } + case "[object Error]": // https://github.com/lodash/lodash/blob/master/isError.js#L26 + case "[object DOMException]": { type = "error", value = formatError(value); break; } + default: return (expand ? inspectExpanded : inspectCollapsed)(value, shallow, name, proto); + } + break; + } + } + const span = document.createElement("span"); + if (name) span.appendChild(inspectName(name)); + const n = span.appendChild(document.createElement("span")); + n.className = `observablehq--${type}`; + n.textContent = value; + return span; +} + +function replace(spanOld, spanNew) { + if (spanOld.classList.contains("observablehq--inspect")) spanNew.classList.add("observablehq--inspect"); + spanOld.parentNode.replaceChild(spanNew, spanOld); + dispatch(spanNew, "load"); +} + +const LOCATION_MATCH = /\s+\(\d+:\d+\)$/m; + +class Inspector { + constructor(node) { + if (!node) throw new Error("invalid node"); + this._node = node; + node.classList.add("observablehq"); + } + pending() { + const {_node} = this; + _node.classList.remove("observablehq--error"); + _node.classList.add("observablehq--running"); + } + fulfilled(value, name) { + const {_node} = this; + if (!isnode(value) || (value.parentNode && value.parentNode !== _node)) { + value = inspect(value, false, _node.firstChild // TODO Do this better. + && _node.firstChild.classList + && _node.firstChild.classList.contains("observablehq--expanded"), name); + value.classList.add("observablehq--inspect"); + } + _node.classList.remove("observablehq--running", "observablehq--error"); + if (_node.firstChild !== value) { + if (_node.firstChild) { + while (_node.lastChild !== _node.firstChild) _node.removeChild(_node.lastChild); + _node.replaceChild(value, _node.firstChild); + } else { + _node.appendChild(value); + } + } + dispatch(_node, "update"); + } + rejected(error, name) { + const {_node} = this; + _node.classList.remove("observablehq--running"); + _node.classList.add("observablehq--error"); + while (_node.lastChild) _node.removeChild(_node.lastChild); + var div = document.createElement("div"); + div.className = "observablehq--inspect"; + if (name) div.appendChild(inspectName(name)); + div.appendChild(document.createTextNode((error + "").replace(LOCATION_MATCH, ""))); + _node.appendChild(div); + dispatch(_node, "error", {error: error}); + } +} + +Inspector.into = function(container) { + if (typeof container === "string") { + container = document.querySelector(container); + if (container == null) throw new Error("container not found"); + } + return function() { + return new Inspector(container.appendChild(document.createElement("div"))); + }; +}; + +// Returns true if the given value is something that should be added to the DOM +// by the inspector, rather than being inspected. This deliberately excludes +// DocumentFragment since appending a fragment “dissolves” (mutates) the +// fragment, and we wish for the inspector to not have side-effects. Also, +// HTMLElement.prototype is an instanceof Element, but not an element! +function isnode(value) { + return (value instanceof Element || value instanceof Text) + && (value instanceof value.constructor); +} + +class RuntimeError extends Error { + constructor(message, input) { + super(message); + this.input = input; + } +} + +RuntimeError.prototype.name = "RuntimeError"; + +function generatorish(value) { + return value + && typeof value.next === "function" + && typeof value.return === "function"; +} + +function load(notebook, library, observer) { + if (typeof library == "function") observer = library, library = null; + if (typeof observer !== "function") throw new Error("invalid observer"); + if (library == null) library = new Library(); + + const {modules, id} = notebook; + const map = new Map; + const runtime = new Runtime(library); + const main = runtime_module(id); + + function runtime_module(id) { + let module = map.get(id); + if (!module) map.set(id, module = runtime.module()); + return module; + } + + for (const m of modules) { + const module = runtime_module(m.id); + let i = 0; + for (const v of m.variables) { + if (v.from) module.import(v.remote, v.name, runtime_module(v.from)); + else if (module === main) module.variable(observer(v, i, m.variables)).define(v.name, v.inputs, v.value); + else module.define(v.name, v.inputs, v.value); + ++i; + } + } + + return runtime; +} + +function constant(x) { + return () => x; +} + +function identity$1(x) { + return x; +} + +function rethrow(error) { + return () => { + throw error; + }; +} + +const prototype = Array.prototype; +const map = prototype.map; + +function noop() {} + +const TYPE_NORMAL = 1; // a normal variable +const TYPE_IMPLICIT = 2; // created on reference +const TYPE_DUPLICATE = 3; // created on duplicate definition + +const no_observer = Symbol("no-observer"); + +function Variable(type, module, observer, options) { + if (!observer) observer = no_observer; + Object.defineProperties(this, { + _observer: {value: observer, writable: true}, + _definition: {value: variable_undefined, writable: true}, + _duplicate: {value: undefined, writable: true}, + _duplicates: {value: undefined, writable: true}, + _indegree: {value: NaN, writable: true}, // The number of computing inputs. + _inputs: {value: [], writable: true}, + _invalidate: {value: noop, writable: true}, + _module: {value: module}, + _name: {value: null, writable: true}, + _outputs: {value: new Set, writable: true}, + _promise: {value: Promise.resolve(undefined), writable: true}, + _reachable: {value: observer !== no_observer, writable: true}, // Is this variable transitively visible? + _rejector: {value: variable_rejector(this)}, + _shadow: {value: initShadow(module, options)}, + _type: {value: type}, + _value: {value: undefined, writable: true}, + _version: {value: 0, writable: true} + }); +} + +Object.defineProperties(Variable.prototype, { + _pending: {value: variable_pending, writable: true, configurable: true}, + _fulfilled: {value: variable_fulfilled, writable: true, configurable: true}, + _rejected: {value: variable_rejected, writable: true, configurable: true}, + _resolve: {value: variable_resolve, writable: true, configurable: true}, + define: {value: variable_define, writable: true, configurable: true}, + delete: {value: variable_delete, writable: true, configurable: true}, + import: {value: variable_import, writable: true, configurable: true} +}); + +function initShadow(module, options) { + if (!options?.shadow) return null; + return new Map( + Object.entries(options.shadow) + .map(([name, definition]) => [name, (new Variable(TYPE_IMPLICIT, module)).define([], definition)]) + ); +} + +function variable_attach(variable) { + variable._module._runtime._dirty.add(variable); + variable._outputs.add(this); +} + +function variable_detach(variable) { + variable._module._runtime._dirty.add(variable); + variable._outputs.delete(this); +} + +function variable_undefined() { + throw variable_undefined; +} + +function variable_stale() { + throw variable_stale; +} + +function variable_rejector(variable) { + return (error) => { + if (error === variable_stale) throw error; + if (error === variable_undefined) throw new RuntimeError(`${variable._name} is not defined`, variable._name); + if (error instanceof Error && error.message) throw new RuntimeError(error.message, variable._name); + throw new RuntimeError(`${variable._name} could not be resolved`, variable._name); + }; +} + +function variable_duplicate(name) { + return () => { + throw new RuntimeError(`${name} is defined more than once`); + }; +} + +function variable_define(name, inputs, definition) { + switch (arguments.length) { + case 1: { + definition = name, name = inputs = null; + break; + } + case 2: { + definition = inputs; + if (typeof name === "string") inputs = null; + else inputs = name, name = null; + break; + } + } + return variable_defineImpl.call(this, + name == null ? null : String(name), + inputs == null ? [] : map.call(inputs, this._resolve, this), + typeof definition === "function" ? definition : constant(definition) + ); +} + +function variable_resolve(name) { + return this._shadow?.get(name) ?? this._module._resolve(name); +} + +function variable_defineImpl(name, inputs, definition) { + const scope = this._module._scope, runtime = this._module._runtime; + + this._inputs.forEach(variable_detach, this); + inputs.forEach(variable_attach, this); + this._inputs = inputs; + this._definition = definition; + this._value = undefined; + + // Is this an active variable (that may require disposal)? + if (definition === noop) runtime._variables.delete(this); + else runtime._variables.add(this); + + // Did the variable’s name change? Time to patch references! + if (name !== this._name || scope.get(name) !== this) { + let error, found; + + if (this._name) { // Did this variable previously have a name? + if (this._outputs.size) { // And did other variables reference this variable? + scope.delete(this._name); + found = this._module._resolve(this._name); + found._outputs = this._outputs, this._outputs = new Set; + found._outputs.forEach(function(output) { output._inputs[output._inputs.indexOf(this)] = found; }, this); + found._outputs.forEach(runtime._updates.add, runtime._updates); + runtime._dirty.add(found).add(this); + scope.set(this._name, found); + } else if ((found = scope.get(this._name)) === this) { // Do no other variables reference this variable? + scope.delete(this._name); // It’s safe to delete! + } else if (found._type === TYPE_DUPLICATE) { // Do other variables assign this name? + found._duplicates.delete(this); // This variable no longer assigns this name. + this._duplicate = undefined; + if (found._duplicates.size === 1) { // Is there now only one variable assigning this name? + found = found._duplicates.keys().next().value; // Any references are now fixed! + error = scope.get(this._name); + found._outputs = error._outputs, error._outputs = new Set; + found._outputs.forEach(function(output) { output._inputs[output._inputs.indexOf(error)] = found; }); + found._definition = found._duplicate, found._duplicate = undefined; + runtime._dirty.add(error).add(found); + runtime._updates.add(found); + scope.set(this._name, found); + } + } else { + throw new Error; + } + } + + if (this._outputs.size) throw new Error; + + if (name) { // Does this variable have a new name? + if (found = scope.get(name)) { // Do other variables reference or assign this name? + if (found._type === TYPE_DUPLICATE) { // Do multiple other variables already define this name? + this._definition = variable_duplicate(name), this._duplicate = definition; + found._duplicates.add(this); + } else if (found._type === TYPE_IMPLICIT) { // Are the variable references broken? + this._outputs = found._outputs, found._outputs = new Set; // Now they’re fixed! + this._outputs.forEach(function(output) { output._inputs[output._inputs.indexOf(found)] = this; }, this); + runtime._dirty.add(found).add(this); + scope.set(name, this); + } else { // Does another variable define this name? + found._duplicate = found._definition, this._duplicate = definition; // Now they’re duplicates. + error = new Variable(TYPE_DUPLICATE, this._module); + error._name = name; + error._definition = this._definition = found._definition = variable_duplicate(name); + error._outputs = found._outputs, found._outputs = new Set; + error._outputs.forEach(function(output) { output._inputs[output._inputs.indexOf(found)] = error; }); + error._duplicates = new Set([this, found]); + runtime._dirty.add(found).add(error); + runtime._updates.add(found).add(error); + scope.set(name, error); + } + } else { + scope.set(name, this); + } + } + + this._name = name; + } + + // If this redefined variable was previously evaluated, invalidate it. (If the + // variable was never evaluated, then the invalidated value could never have + // been exposed and we can avoid this extra work.) + if (this._version > 0) ++this._version; + + runtime._updates.add(this); + runtime._compute(); + return this; +} + +function variable_import(remote, name, module) { + if (arguments.length < 3) module = name, name = remote; + return variable_defineImpl.call(this, String(name), [module._resolve(String(remote))], identity$1); +} + +function variable_delete() { + return variable_defineImpl.call(this, null, [], noop); +} + +function variable_pending() { + if (this._observer.pending) this._observer.pending(); +} + +function variable_fulfilled(value) { + if (this._observer.fulfilled) this._observer.fulfilled(value, this._name); +} + +function variable_rejected(error) { + if (this._observer.rejected) this._observer.rejected(error, this._name); +} + +const variable_variable = Symbol("variable"); +const variable_invalidation = Symbol("invalidation"); +const variable_visibility = Symbol("visibility"); + +function Module(runtime, builtins = []) { + Object.defineProperties(this, { + _runtime: {value: runtime}, + _scope: {value: new Map}, + _builtins: {value: new Map([ + ["@variable", variable_variable], + ["invalidation", variable_invalidation], + ["visibility", variable_visibility], + ...builtins + ])}, + _source: {value: null, writable: true} + }); +} + +Object.defineProperties(Module.prototype, { + _resolve: {value: module_resolve, writable: true, configurable: true}, + redefine: {value: module_redefine, writable: true, configurable: true}, + define: {value: module_define, writable: true, configurable: true}, + derive: {value: module_derive, writable: true, configurable: true}, + import: {value: module_import, writable: true, configurable: true}, + value: {value: module_value, writable: true, configurable: true}, + variable: {value: module_variable, writable: true, configurable: true}, + builtin: {value: module_builtin, writable: true, configurable: true} +}); + +function module_redefine(name) { + const v = this._scope.get(name); + if (!v) throw new RuntimeError(`${name} is not defined`); + if (v._type === TYPE_DUPLICATE) throw new RuntimeError(`${name} is defined more than once`); + return v.define.apply(v, arguments); +} + +function module_define() { + const v = new Variable(TYPE_NORMAL, this); + return v.define.apply(v, arguments); +} + +function module_import() { + const v = new Variable(TYPE_NORMAL, this); + return v.import.apply(v, arguments); +} + +function module_variable(observer, options) { + return new Variable(TYPE_NORMAL, this, observer, options); +} + +async function module_value(name) { + let v = this._scope.get(name); + if (!v) throw new RuntimeError(`${name} is not defined`); + if (v._observer === no_observer) { + v = this.variable(true).define([name], identity$1); + try { + return await module_revalue(this._runtime, v); + } finally { + v.delete(); + } + } else { + return module_revalue(this._runtime, v); + } +} + +// If the variable is redefined before its value resolves, try again. +async function module_revalue(runtime, variable) { + await runtime._compute(); + try { + return await variable._promise; + } catch (error) { + if (error === variable_stale) return module_revalue(runtime, variable); + throw error; + } +} + +function module_derive(injects, injectModule) { + const map = new Map(); + const modules = new Set(); + const copies = []; + + // Given a module, derives an alias of that module with an initially-empty + // definition. The variables will be copied later in a second pass below. + function alias(source) { + let target = map.get(source); + if (target) return target; + target = new Module(source._runtime, source._builtins); + target._source = source; + map.set(source, target); + copies.push([target, source]); + modules.add(source); + return target; + } + + // Inject the given variables as reverse imports into the derived module. + const derive = alias(this); + for (const inject of injects) { + const {alias, name} = typeof inject === "object" ? inject : {name: inject}; + derive.import(name, alias == null ? name : alias, injectModule); + } + + // Iterate over all the variables (currently) in this module. If any + // represents an import-with (i.e., an import of a module with a _source), the + // transitive import-with must be copied, too, as direct injections may affect + // transitive injections. Note that an import-with can only be created with + // module.derive and hence it’s not possible for an import-with to be added + // later; therefore we only need to apply this check once, now. + for (const module of modules) { + for (const [name, variable] of module._scope) { + if (variable._definition === identity$1) { // import + if (module === this && derive._scope.has(name)) continue; // overridden by injection + const importedModule = variable._inputs[0]._module; + if (importedModule._source) alias(importedModule); + } + } + } + + // Finally, with the modules resolved, copy the variable definitions. + for (const [target, source] of copies) { + for (const [name, sourceVariable] of source._scope) { + const targetVariable = target._scope.get(name); + if (targetVariable && targetVariable._type !== TYPE_IMPLICIT) continue; // preserve injection + if (sourceVariable._definition === identity$1) { // import + const sourceInput = sourceVariable._inputs[0]; + const sourceModule = sourceInput._module; + target.import(sourceInput._name, name, map.get(sourceModule) || sourceModule); + } else { // non-import + target.define(name, sourceVariable._inputs.map(variable_name), sourceVariable._definition); + } + } + } + + return derive; +} + +function module_resolve(name) { + let variable = this._scope.get(name), value; + if (!variable) { + variable = new Variable(TYPE_IMPLICIT, this); + if (this._builtins.has(name)) { + variable.define(name, constant(this._builtins.get(name))); + } else if (this._runtime._builtin._scope.has(name)) { + variable.import(name, this._runtime._builtin); + } else { + try { + value = this._runtime._global(name); + } catch (error) { + return variable.define(name, rethrow(error)); + } + if (value === undefined) { + this._scope.set(variable._name = name, variable); + } else { + variable.define(name, constant(value)); + } + } + } + return variable; +} + +function module_builtin(name, value) { + this._builtins.set(name, value); +} + +function variable_name(variable) { + return variable._name; +} + +const frame = typeof requestAnimationFrame === "function" ? requestAnimationFrame + : typeof setImmediate === "function" ? setImmediate + : f => setTimeout(f, 0); + +function Runtime(builtins = new Library, global = window_global) { + const builtin = this.module(); + Object.defineProperties(this, { + _dirty: {value: new Set}, + _updates: {value: new Set}, + _precomputes: {value: [], writable: true}, + _computing: {value: null, writable: true}, + _init: {value: null, writable: true}, + _modules: {value: new Map}, + _variables: {value: new Set}, + _disposed: {value: false, writable: true}, + _builtin: {value: builtin}, + _global: {value: global} + }); + if (builtins) for (const name in builtins) { + (new Variable(TYPE_IMPLICIT, builtin)).define(name, [], builtins[name]); + } +} + +Object.defineProperties(Runtime.prototype, { + _precompute: {value: runtime_precompute, writable: true, configurable: true}, + _compute: {value: runtime_compute, writable: true, configurable: true}, + _computeSoon: {value: runtime_computeSoon, writable: true, configurable: true}, + _computeNow: {value: runtime_computeNow, writable: true, configurable: true}, + dispose: {value: runtime_dispose, writable: true, configurable: true}, + module: {value: runtime_module, writable: true, configurable: true}, + fileAttachments: {value: FileAttachments, writable: true, configurable: true}, + load: {value: load, writable: true, configurable: true} +}); + +function runtime_dispose() { + this._computing = Promise.resolve(); + this._disposed = true; + this._variables.forEach(v => { + v._invalidate(); + v._version = NaN; + }); +} + +function runtime_module(define, observer = noop) { + let module; + if (define === undefined) { + if (module = this._init) { + this._init = null; + return module; + } + return new Module(this); + } + module = this._modules.get(define); + if (module) return module; + this._init = module = new Module(this); + this._modules.set(define, module); + try { + define(this, observer); + } finally { + this._init = null; + } + return module; +} + +function runtime_precompute(callback) { + this._precomputes.push(callback); + this._compute(); +} + +function runtime_compute() { + return this._computing || (this._computing = this._computeSoon()); +} + +function runtime_computeSoon() { + return new Promise(frame).then(() => this._disposed ? undefined : this._computeNow()); +} + +async function runtime_computeNow() { + let queue = [], + variables, + variable, + precomputes = this._precomputes; + + // If there are any paused generators, resume them before computing so they + // can update (if synchronous) before computing downstream variables. + if (precomputes.length) { + this._precomputes = []; + for (const callback of precomputes) callback(); + await runtime_defer(3); + } + + // Compute the reachability of the transitive closure of dirty variables. + // Any newly-reachable variable must also be recomputed. + // Any no-longer-reachable variable must be terminated. + variables = new Set(this._dirty); + variables.forEach(function(variable) { + variable._inputs.forEach(variables.add, variables); + const reachable = variable_reachable(variable); + if (reachable > variable._reachable) { + this._updates.add(variable); + } else if (reachable < variable._reachable) { + variable._invalidate(); + } + variable._reachable = reachable; + }, this); + + // Compute the transitive closure of updating, reachable variables. + variables = new Set(this._updates); + variables.forEach(function(variable) { + if (variable._reachable) { + variable._indegree = 0; + variable._outputs.forEach(variables.add, variables); + } else { + variable._indegree = NaN; + variables.delete(variable); + } + }); + + this._computing = null; + this._updates.clear(); + this._dirty.clear(); + + // Compute the indegree of updating variables. + variables.forEach(function(variable) { + variable._outputs.forEach(variable_increment); + }); + + do { + // Identify the root variables (those with no updating inputs). + variables.forEach(function(variable) { + if (variable._indegree === 0) { + queue.push(variable); + } + }); + + // Compute the variables in topological order. + while (variable = queue.pop()) { + variable_compute(variable); + variable._outputs.forEach(postqueue); + variables.delete(variable); + } + + // Any remaining variables are circular, or depend on them. + variables.forEach(function(variable) { + if (variable_circular(variable)) { + variable_error(variable, new RuntimeError("circular definition")); + variable._outputs.forEach(variable_decrement); + variables.delete(variable); + } + }); + } while (variables.size); + + function postqueue(variable) { + if (--variable._indegree === 0) { + queue.push(variable); + } + } +} + +// We want to give generators, if they’re defined synchronously, a chance to +// update before computing downstream variables. This creates a synchronous +// promise chain of the given depth that we’ll await before recomputing +// downstream variables. +function runtime_defer(depth = 0) { + let p = Promise.resolve(); + for (let i = 0; i < depth; ++i) p = p.then(() => {}); + return p; +} + +function variable_circular(variable) { + const inputs = new Set(variable._inputs); + for (const i of inputs) { + if (i === variable) return true; + i._inputs.forEach(inputs.add, inputs); + } + return false; +} + +function variable_increment(variable) { + ++variable._indegree; +} + +function variable_decrement(variable) { + --variable._indegree; +} + +function variable_value(variable) { + return variable._promise.catch(variable._rejector); +} + +function variable_invalidator(variable) { + return new Promise(function(resolve) { + variable._invalidate = resolve; + }); +} + +function variable_intersector(invalidation, variable) { + let node = typeof IntersectionObserver === "function" && variable._observer && variable._observer._node; + let visible = !node, resolve = noop, reject = noop, promise, observer; + if (node) { + observer = new IntersectionObserver(([entry]) => (visible = entry.isIntersecting) && (promise = null, resolve())); + observer.observe(node); + invalidation.then(() => (observer.disconnect(), observer = null, reject())); + } + return function(value) { + if (visible) return Promise.resolve(value); + if (!observer) return Promise.reject(); + if (!promise) promise = new Promise((y, n) => (resolve = y, reject = n)); + return promise.then(() => value); + }; +} + +function variable_compute(variable) { + variable._invalidate(); + variable._invalidate = noop; + variable._pending(); + + const value0 = variable._value; + const version = ++variable._version; + + // Lazily-constructed invalidation variable; only constructed if referenced as an input. + let invalidation = null; + + // If the variable doesn’t have any inputs, we can optimize slightly. + const promise = variable._promise = (variable._inputs.length + ? Promise.all(variable._inputs.map(variable_value)).then(define) + : new Promise(resolve => resolve(variable._definition.call(value0)))) + .then(generate); + + // Compute the initial value of the variable. + function define(inputs) { + if (variable._version !== version) throw variable_stale; + + // Replace any reference to invalidation with the promise, lazily. + for (let i = 0, n = inputs.length; i < n; ++i) { + switch (inputs[i]) { + case variable_invalidation: { + inputs[i] = invalidation = variable_invalidator(variable); + break; + } + case variable_visibility: { + if (!invalidation) invalidation = variable_invalidator(variable); + inputs[i] = variable_intersector(invalidation, variable); + break; + } + case variable_variable: { + inputs[i] = variable; + break; + } + } + } + + return variable._definition.apply(value0, inputs); + } + + // If the value is a generator, then retrieve its first value, and dispose of + // the generator if the variable is invalidated. Note that the cell may + // already have been invalidated here, in which case we need to terminate the + // generator immediately! + function generate(value) { + if (variable._version !== version) throw variable_stale; + if (generatorish(value)) { + (invalidation || variable_invalidator(variable)).then(variable_return(value)); + return variable_generate(variable, version, value); + } + return value; + } + + promise.then((value) => { + variable._value = value; + variable._fulfilled(value); + }, (error) => { + if (error === variable_stale || variable._version !== version) return; + variable._value = undefined; + variable._rejected(error); + }); +} + +function variable_generate(variable, version, generator) { + const runtime = variable._module._runtime; + let currentValue; // so that yield resolves to the yielded value + + // Retrieve the next value from the generator; if successful, invoke the + // specified callback. The returned promise resolves to the yielded value, or + // to undefined if the generator is done. + function compute(onfulfilled) { + return new Promise(resolve => resolve(generator.next(currentValue))).then(({done, value}) => { + return done ? undefined : Promise.resolve(value).then(onfulfilled); + }); + } + + // Retrieve the next value from the generator; if successful, fulfill the + // variable, compute downstream variables, and schedule the next value to be + // pulled from the generator at the start of the next animation frame. If not + // successful, reject the variable, compute downstream variables, and return. + function recompute() { + const promise = compute((value) => { + if (variable._version !== version) throw variable_stale; + currentValue = value; + postcompute(value, promise).then(() => runtime._precompute(recompute)); + variable._fulfilled(value); + return value; + }); + promise.catch((error) => { + if (error === variable_stale || variable._version !== version) return; + postcompute(undefined, promise); + variable._rejected(error); + }); + } + + // After the generator fulfills or rejects, set its current value, promise, + // and schedule any downstream variables for update. + function postcompute(value, promise) { + variable._value = value; + variable._promise = promise; + variable._outputs.forEach(runtime._updates.add, runtime._updates); + return runtime._compute(); + } + + // When retrieving the first value from the generator, the promise graph is + // already established, so we only need to queue the next pull. + return compute((value) => { + if (variable._version !== version) throw variable_stale; + currentValue = value; + runtime._precompute(recompute); + return value; + }); +} + +function variable_error(variable, error) { + variable._invalidate(); + variable._invalidate = noop; + variable._pending(); + ++variable._version; + variable._indegree = NaN; + (variable._promise = Promise.reject(error)).catch(noop); + variable._value = undefined; + variable._rejected(error); +} + +function variable_return(generator) { + return function() { + generator.return(); + }; +} + +function variable_reachable(variable) { + if (variable._observer !== no_observer) return true; // Directly reachable. + const outputs = new Set(variable._outputs); + for (const output of outputs) { + if (output._observer !== no_observer) return true; + output._outputs.forEach(outputs.add, outputs); + } + return false; +} + +function window_global(name) { + return globalThis[name]; +} + +function renderHtml(string) { + const template = document.createElement("template"); + template.innerHTML = string; + return document.importNode(template.content, true); +} + +function renderSvg(string) { + const g = document.createElementNS("http://www.w3.org/2000/svg", "g"); + g.innerHTML = string; + return g; +} + +const html = Object.assign(hypertext(renderHtml, fragment => { + if (fragment.firstChild === null) return null; + if (fragment.firstChild === fragment.lastChild) return fragment.removeChild(fragment.firstChild); + const span = document.createElement("span"); + span.appendChild(fragment); + return span; +}), {fragment: hypertext(renderHtml, fragment => fragment)}); + +Object.assign(hypertext(renderSvg, g => { + if (g.firstChild === null) return null; + if (g.firstChild === g.lastChild) return g.removeChild(g.firstChild); + return g; +}), {fragment: hypertext(renderSvg, g => { + const fragment = document.createDocumentFragment(); + while (g.firstChild) fragment.appendChild(g.firstChild); + return fragment; +})}); + +const +CODE_TAB = 9, +CODE_LF = 10, +CODE_FF = 12, +CODE_CR = 13, +CODE_SPACE = 32, +CODE_UPPER_A = 65, +CODE_UPPER_Z = 90, +CODE_LOWER_A = 97, +CODE_LOWER_Z = 122, +CODE_LT = 60, +CODE_GT = 62, +CODE_SLASH = 47, +CODE_DASH = 45, +CODE_BANG = 33, +CODE_EQ = 61, +CODE_DQUOTE = 34, +CODE_SQUOTE = 39, +CODE_QUESTION = 63, +STATE_DATA = 1, +STATE_TAG_OPEN = 2, +STATE_END_TAG_OPEN = 3, +STATE_TAG_NAME = 4, +STATE_BOGUS_COMMENT = 5, +STATE_BEFORE_ATTRIBUTE_NAME = 6, +STATE_AFTER_ATTRIBUTE_NAME = 7, +STATE_ATTRIBUTE_NAME = 8, +STATE_BEFORE_ATTRIBUTE_VALUE = 9, +STATE_ATTRIBUTE_VALUE_DOUBLE_QUOTED = 10, +STATE_ATTRIBUTE_VALUE_SINGLE_QUOTED = 11, +STATE_ATTRIBUTE_VALUE_UNQUOTED = 12, +STATE_AFTER_ATTRIBUTE_VALUE_QUOTED = 13, +STATE_SELF_CLOSING_START_TAG = 14, +STATE_COMMENT_START = 15, +STATE_COMMENT_START_DASH = 16, +STATE_COMMENT = 17, +STATE_COMMENT_LESS_THAN_SIGN = 18, +STATE_COMMENT_LESS_THAN_SIGN_BANG = 19, +STATE_COMMENT_LESS_THAN_SIGN_BANG_DASH = 20, +STATE_COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH = 21, +STATE_COMMENT_END_DASH = 22, +STATE_COMMENT_END = 23, +STATE_COMMENT_END_BANG = 24, +STATE_MARKUP_DECLARATION_OPEN = 25, +STATE_RAWTEXT = 26, +STATE_RAWTEXT_LESS_THAN_SIGN = 27, +STATE_RAWTEXT_END_TAG_OPEN = 28, +STATE_RAWTEXT_END_TAG_NAME = 29, +SHOW_COMMENT = 128, +SHOW_ELEMENT = 1, +TYPE_COMMENT = 8, +TYPE_ELEMENT = 1, +NS_SVG = "http://www.w3.org/2000/svg", +NS_XLINK = "http://www.w3.org/1999/xlink", +NS_XML = "http://www.w3.org/XML/1998/namespace", +NS_XMLNS = "http://www.w3.org/2000/xmlns/"; + +const svgAdjustAttributes = new Map([ + "attributeName", + "attributeType", + "baseFrequency", + "baseProfile", + "calcMode", + "clipPathUnits", + "diffuseConstant", + "edgeMode", + "filterUnits", + "glyphRef", + "gradientTransform", + "gradientUnits", + "kernelMatrix", + "kernelUnitLength", + "keyPoints", + "keySplines", + "keyTimes", + "lengthAdjust", + "limitingConeAngle", + "markerHeight", + "markerUnits", + "markerWidth", + "maskContentUnits", + "maskUnits", + "numOctaves", + "pathLength", + "patternContentUnits", + "patternTransform", + "patternUnits", + "pointsAtX", + "pointsAtY", + "pointsAtZ", + "preserveAlpha", + "preserveAspectRatio", + "primitiveUnits", + "refX", + "refY", + "repeatCount", + "repeatDur", + "requiredExtensions", + "requiredFeatures", + "specularConstant", + "specularExponent", + "spreadMethod", + "startOffset", + "stdDeviation", + "stitchTiles", + "surfaceScale", + "systemLanguage", + "tableValues", + "targetX", + "targetY", + "textLength", + "viewBox", + "viewTarget", + "xChannelSelector", + "yChannelSelector", + "zoomAndPan" +].map(name => [name.toLowerCase(), name])); + +const svgForeignAttributes = new Map([ + ["xlink:actuate", NS_XLINK], + ["xlink:arcrole", NS_XLINK], + ["xlink:href", NS_XLINK], + ["xlink:role", NS_XLINK], + ["xlink:show", NS_XLINK], + ["xlink:title", NS_XLINK], + ["xlink:type", NS_XLINK], + ["xml:lang", NS_XML], + ["xml:space", NS_XML], + ["xmlns", NS_XMLNS], + ["xmlns:xlink", NS_XMLNS] +]); + +function hypertext(render, postprocess) { + return function({raw: strings}) { + let state = STATE_DATA; + let string = ""; + let tagNameStart; // either an open tag or an end tag + let tagName; // only open; beware nesting! used only for rawtext + let attributeNameStart; + let attributeNameEnd; + let nodeFilter = 0; + + for (let j = 0, m = arguments.length; j < m; ++j) { + const input = strings[j]; + + if (j > 0) { + const value = arguments[j]; + switch (state) { + case STATE_RAWTEXT: { + if (value != null) { + const text = `${value}`; + if (isEscapableRawText(tagName)) { + string += text.replace(/[<]/g, entity); + } else if (new RegExp(`/]`, "i").test(string.slice(-tagName.length - 2) + text)) { + throw new Error("unsafe raw text"); // appropriate end tag + } else { + string += text; + } + } + break; + } + case STATE_DATA: { + if (value == null) ; else if (value instanceof Node + || (typeof value !== "string" && value[Symbol.iterator]) + || (/(?:^|>)$/.test(strings[j - 1]) && /^(?:<|$)/.test(input))) { + string += ""; + nodeFilter |= SHOW_COMMENT; + } else { + string += `${value}`.replace(/[<&]/g, entity); + } + break; + } + case STATE_BEFORE_ATTRIBUTE_VALUE: { + state = STATE_ATTRIBUTE_VALUE_UNQUOTED; + let text; + if (/^[\s>]/.test(input)) { + if (value == null || value === false) { + string = string.slice(0, attributeNameStart - strings[j - 1].length); + break; + } + if (value === true || (text = `${value}`) === "") { + string += "''"; + break; + } + const name = strings[j - 1].slice(attributeNameStart, attributeNameEnd); + if ((name === "style" && isObjectLiteral(value)) || typeof value === "function") { + string += "::" + j; + nodeFilter |= SHOW_ELEMENT; + break; + } + } + if (text === undefined) text = `${value}`; + if (text === "") throw new Error("unsafe unquoted empty string"); + string += text.replace(/^['"]|[\s>&]/g, entity); + break; + } + case STATE_ATTRIBUTE_VALUE_UNQUOTED: { + string += `${value}`.replace(/[\s>&]/g, entity); + break; + } + case STATE_ATTRIBUTE_VALUE_SINGLE_QUOTED: { + string += `${value}`.replace(/['&]/g, entity); + break; + } + case STATE_ATTRIBUTE_VALUE_DOUBLE_QUOTED: { + string += `${value}`.replace(/["&]/g, entity); + break; + } + case STATE_BEFORE_ATTRIBUTE_NAME: { + if (isObjectLiteral(value)) { + string += "::" + j + "=''"; + nodeFilter |= SHOW_ELEMENT; + break; + } + throw new Error("invalid binding"); + } + case STATE_COMMENT: break; + default: throw new Error("invalid binding"); + } + } + + for (let i = 0, n = input.length; i < n; ++i) { + const code = input.charCodeAt(i); + + switch (state) { + case STATE_DATA: { + if (code === CODE_LT) { + state = STATE_TAG_OPEN; + } + break; + } + case STATE_TAG_OPEN: { + if (code === CODE_BANG) { + state = STATE_MARKUP_DECLARATION_OPEN; + } else if (code === CODE_SLASH) { + state = STATE_END_TAG_OPEN; + } else if (isAsciiAlphaCode(code)) { + tagNameStart = i, tagName = undefined; + state = STATE_TAG_NAME, --i; + } else if (code === CODE_QUESTION) { + state = STATE_BOGUS_COMMENT, --i; + } else { + state = STATE_DATA, --i; + } + break; + } + case STATE_END_TAG_OPEN: { + if (isAsciiAlphaCode(code)) { + state = STATE_TAG_NAME, --i; + } else if (code === CODE_GT) { + state = STATE_DATA; + } else { + state = STATE_BOGUS_COMMENT, --i; + } + break; + } + case STATE_TAG_NAME: { + if (isSpaceCode(code)) { + state = STATE_BEFORE_ATTRIBUTE_NAME; + tagName = lower(input, tagNameStart, i); + } else if (code === CODE_SLASH) { + state = STATE_SELF_CLOSING_START_TAG; + } else if (code === CODE_GT) { + tagName = lower(input, tagNameStart, i); + state = isRawText(tagName) ? STATE_RAWTEXT : STATE_DATA; + } + break; + } + case STATE_BEFORE_ATTRIBUTE_NAME: { + if (isSpaceCode(code)) ; else if (code === CODE_SLASH || code === CODE_GT) { + state = STATE_AFTER_ATTRIBUTE_NAME, --i; + } else if (code === CODE_EQ) { + state = STATE_ATTRIBUTE_NAME; + attributeNameStart = i + 1, attributeNameEnd = undefined; + } else { + state = STATE_ATTRIBUTE_NAME, --i; + attributeNameStart = i + 1, attributeNameEnd = undefined; + } + break; + } + case STATE_ATTRIBUTE_NAME: { + if (isSpaceCode(code) || code === CODE_SLASH || code === CODE_GT) { + state = STATE_AFTER_ATTRIBUTE_NAME, --i; + attributeNameEnd = i; + } else if (code === CODE_EQ) { + state = STATE_BEFORE_ATTRIBUTE_VALUE; + attributeNameEnd = i; + } + break; + } + case STATE_AFTER_ATTRIBUTE_NAME: { + if (isSpaceCode(code)) ; else if (code === CODE_SLASH) { + state = STATE_SELF_CLOSING_START_TAG; + } else if (code === CODE_EQ) { + state = STATE_BEFORE_ATTRIBUTE_VALUE; + } else if (code === CODE_GT) { + state = isRawText(tagName) ? STATE_RAWTEXT : STATE_DATA; + } else { + state = STATE_ATTRIBUTE_NAME, --i; + attributeNameStart = i + 1, attributeNameEnd = undefined; + } + break; + } + case STATE_BEFORE_ATTRIBUTE_VALUE: { + if (isSpaceCode(code)) ; else if (code === CODE_DQUOTE) { + state = STATE_ATTRIBUTE_VALUE_DOUBLE_QUOTED; + } else if (code === CODE_SQUOTE) { + state = STATE_ATTRIBUTE_VALUE_SINGLE_QUOTED; + } else if (code === CODE_GT) { + state = isRawText(tagName) ? STATE_RAWTEXT : STATE_DATA; + } else { + state = STATE_ATTRIBUTE_VALUE_UNQUOTED, --i; + } + break; + } + case STATE_ATTRIBUTE_VALUE_DOUBLE_QUOTED: { + if (code === CODE_DQUOTE) { + state = STATE_AFTER_ATTRIBUTE_VALUE_QUOTED; + } + break; + } + case STATE_ATTRIBUTE_VALUE_SINGLE_QUOTED: { + if (code === CODE_SQUOTE) { + state = STATE_AFTER_ATTRIBUTE_VALUE_QUOTED; + } + break; + } + case STATE_ATTRIBUTE_VALUE_UNQUOTED: { + if (isSpaceCode(code)) { + state = STATE_BEFORE_ATTRIBUTE_NAME; + } else if (code === CODE_GT) { + state = isRawText(tagName) ? STATE_RAWTEXT : STATE_DATA; + } + break; + } + case STATE_AFTER_ATTRIBUTE_VALUE_QUOTED: { + if (isSpaceCode(code)) { + state = STATE_BEFORE_ATTRIBUTE_NAME; + } else if (code === CODE_SLASH) { + state = STATE_SELF_CLOSING_START_TAG; + } else if (code === CODE_GT) { + state = isRawText(tagName) ? STATE_RAWTEXT : STATE_DATA; + } else { + state = STATE_BEFORE_ATTRIBUTE_NAME, --i; + } + break; + } + case STATE_SELF_CLOSING_START_TAG: { + if (code === CODE_GT) { + state = STATE_DATA; + } else { + state = STATE_BEFORE_ATTRIBUTE_NAME, --i; + } + break; + } + case STATE_BOGUS_COMMENT: { + if (code === CODE_GT) { + state = STATE_DATA; + } + break; + } + case STATE_COMMENT_START: { + if (code === CODE_DASH) { + state = STATE_COMMENT_START_DASH; + } else if (code === CODE_GT) { + state = STATE_DATA; + } else { + state = STATE_COMMENT, --i; + } + break; + } + case STATE_COMMENT_START_DASH: { + if (code === CODE_DASH) { + state = STATE_COMMENT_END; + } else if (code === CODE_GT) { + state = STATE_DATA; + } else { + state = STATE_COMMENT, --i; + } + break; + } + case STATE_COMMENT: { + if (code === CODE_LT) { + state = STATE_COMMENT_LESS_THAN_SIGN; + } else if (code === CODE_DASH) { + state = STATE_COMMENT_END_DASH; + } + break; + } + case STATE_COMMENT_LESS_THAN_SIGN: { + if (code === CODE_BANG) { + state = STATE_COMMENT_LESS_THAN_SIGN_BANG; + } else if (code !== CODE_LT) { + state = STATE_COMMENT, --i; + } + break; + } + case STATE_COMMENT_LESS_THAN_SIGN_BANG: { + if (code === CODE_DASH) { + state = STATE_COMMENT_LESS_THAN_SIGN_BANG_DASH; + } else { + state = STATE_COMMENT, --i; + } + break; + } + case STATE_COMMENT_LESS_THAN_SIGN_BANG_DASH: { + if (code === CODE_DASH) { + state = STATE_COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH; + } else { + state = STATE_COMMENT_END, --i; + } + break; + } + case STATE_COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH: { + state = STATE_COMMENT_END, --i; + break; + } + case STATE_COMMENT_END_DASH: { + if (code === CODE_DASH) { + state = STATE_COMMENT_END; + } else { + state = STATE_COMMENT, --i; + } + break; + } + case STATE_COMMENT_END: { + if (code === CODE_GT) { + state = STATE_DATA; + } else if (code === CODE_BANG) { + state = STATE_COMMENT_END_BANG; + } else if (code !== CODE_DASH) { + state = STATE_COMMENT, --i; + } + break; + } + case STATE_COMMENT_END_BANG: { + if (code === CODE_DASH) { + state = STATE_COMMENT_END_DASH; + } else if (code === CODE_GT) { + state = STATE_DATA; + } else { + state = STATE_COMMENT, --i; + } + break; + } + case STATE_MARKUP_DECLARATION_OPEN: { + if (code === CODE_DASH && input.charCodeAt(i + 1) === CODE_DASH) { + state = STATE_COMMENT_START, ++i; + } else { // Note: CDATA and DOCTYPE unsupported! + state = STATE_BOGUS_COMMENT, --i; + } + break; + } + case STATE_RAWTEXT: { + if (code === CODE_LT) { + state = STATE_RAWTEXT_LESS_THAN_SIGN; + } + break; + } + case STATE_RAWTEXT_LESS_THAN_SIGN: { + if (code === CODE_SLASH) { + state = STATE_RAWTEXT_END_TAG_OPEN; + } else { + state = STATE_RAWTEXT, --i; + } + break; + } + case STATE_RAWTEXT_END_TAG_OPEN: { + if (isAsciiAlphaCode(code)) { + tagNameStart = i; + state = STATE_RAWTEXT_END_TAG_NAME, --i; + } else { + state = STATE_RAWTEXT, --i; + } + break; + } + case STATE_RAWTEXT_END_TAG_NAME: { + if (isSpaceCode(code) && tagName === lower(input, tagNameStart, i)) { + state = STATE_BEFORE_ATTRIBUTE_NAME; + } else if (code === CODE_SLASH && tagName === lower(input, tagNameStart, i)) { + state = STATE_SELF_CLOSING_START_TAG; + } else if (code === CODE_GT && tagName === lower(input, tagNameStart, i)) { + state = STATE_DATA; + } else if (!isAsciiAlphaCode(code)) { + state = STATE_RAWTEXT, --i; + } + break; + } + default: { + state = undefined; + break; + } + } + } + + string += input; + } + + const root = render(string); + + const walker = document.createTreeWalker(root, nodeFilter, null, false); + const removeNodes = []; + while (walker.nextNode()) { + const node = walker.currentNode; + switch (node.nodeType) { + case TYPE_ELEMENT: { + const attributes = node.attributes; + for (let i = 0, n = attributes.length; i < n; ++i) { + const {name, value: currentValue} = attributes[i]; + if (/^::/.test(name)) { + const value = arguments[+name.slice(2)]; + removeAttribute(node, name), --i, --n; + for (const key in value) { + const subvalue = value[key]; + if (subvalue == null || subvalue === false) ; else if (typeof subvalue === "function") { + node[key] = subvalue; + } else if (key === "style" && isObjectLiteral(subvalue)) { + setStyles(node[key], subvalue); + } else { + setAttribute(node, key, subvalue === true ? "" : subvalue); + } + } + } else if (/^::/.test(currentValue)) { + const value = arguments[+currentValue.slice(2)]; + removeAttribute(node, name), --i, --n; + if (typeof value === "function") { + node[name] = value; + } else { // style + setStyles(node[name], value); + } + } + } + break; + } + case TYPE_COMMENT: { + if (/^::/.test(node.data)) { + const parent = node.parentNode; + const value = arguments[+node.data.slice(2)]; + if (value instanceof Node) { + parent.insertBefore(value, node); + } else if (typeof value !== "string" && value[Symbol.iterator]) { + if (value instanceof NodeList || value instanceof HTMLCollection) { + for (let i = value.length - 1, r = node; i >= 0; --i) { + r = parent.insertBefore(value[i], r); + } + } else { + for (const subvalue of value) { + if (subvalue == null) continue; + parent.insertBefore(subvalue instanceof Node ? subvalue : document.createTextNode(subvalue), node); + } + } + } else { + parent.insertBefore(document.createTextNode(value), node); + } + removeNodes.push(node); + } + break; + } + } + } + + for (const node of removeNodes) { + node.parentNode.removeChild(node); + } + + return postprocess(root); + }; +} + +function entity(character) { + return `&#${character.charCodeAt(0).toString()};`; +} + +function isAsciiAlphaCode(code) { + return (CODE_UPPER_A <= code && code <= CODE_UPPER_Z) + || (CODE_LOWER_A <= code && code <= CODE_LOWER_Z); +} + +function isSpaceCode(code) { + return code === CODE_TAB + || code === CODE_LF + || code === CODE_FF + || code === CODE_SPACE + || code === CODE_CR; // normalize newlines +} + +function isObjectLiteral(value) { + return value && value.toString === Object.prototype.toString; +} + +function isRawText(tagName) { + return tagName === "script" || tagName === "style" || isEscapableRawText(tagName); +} + +function isEscapableRawText(tagName) { + return tagName === "textarea" || tagName === "title"; +} + +function lower(input, start, end) { + return input.slice(start, end).toLowerCase(); +} + +function setAttribute(node, name, value) { + if (node.namespaceURI === NS_SVG) { + name = name.toLowerCase(); + name = svgAdjustAttributes.get(name) || name; + if (svgForeignAttributes.has(name)) { + node.setAttributeNS(svgForeignAttributes.get(name), name, value); + return; + } + } + node.setAttribute(name, value); +} + +function removeAttribute(node, name) { + if (node.namespaceURI === NS_SVG) { + name = name.toLowerCase(); + name = svgAdjustAttributes.get(name) || name; + if (svgForeignAttributes.has(name)) { + node.removeAttributeNS(svgForeignAttributes.get(name), name); + return; + } + } + node.removeAttribute(name); +} + +// We can’t use Object.assign because custom properties… +function setStyles(style, values) { + for (const name in values) { + const value = values[name]; + if (name.startsWith("--")) style.setProperty(name, value); + else style[name] = value; + } +} + +function length(x) { + return x == null ? null : typeof x === "number" ? `${x}px` : `${x}`; +} + +const bubbles = {bubbles: true}; + +function preventDefault(event) { + event.preventDefault(); +} + +function dispatchInput({currentTarget}) { + (currentTarget.form || currentTarget).dispatchEvent(new Event("input", bubbles)); +} + +function identity(x) { + return x; +} + +let nextId = 0; + +function newId() { + return `__ns__-${++nextId}`; +} + +function maybeLabel(label, input) { + if (!label) return; + label = html`