diff --git a/package.json b/package.json
index 4d01e11..70fedad 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "lexicanter",
"productName": "Lexicanter",
- "version": "2.1.14",
+ "version": "2.1.15",
"description": "A lexicon management tool for constructed languages.",
"main": "src/index.js",
"scripts": {
diff --git a/src/app/layouts/Changelog.svelte b/src/app/layouts/Changelog.svelte
index bcf4b73..5dcea59 100644
--- a/src/app/layouts/Changelog.svelte
+++ b/src/app/layouts/Changelog.svelte
@@ -25,13 +25,20 @@
Patch 2.1.15
+
+ • Fixed a reported bug which caused the search fields in the lexicon and phrasebook to find no matches in certain cases.
+ • Changed the way that the app recognizes when changes have been made to the version of your file in the database.
+ • A few quality of life features related to the previous change, including the ability to see the local and online file version numbers in Settings.
+
Patch 2.1.14
• Fixed a bug with the orthography pattern replacement features which caused it to only replace the first instance of a pattern in each word.
• Added the ability to use ^
or #
as word-end characters in the orthography pattern replacement fields.
• Fixed a reported bug with the Illegals field of the Advanced Phonotactics word generator which caused that field not to save its contents.
- • Fixed a bug with database syncing which caused the setting to not save for files.
- • Files should now automatically detect when you have changes in the database on loading, and will prompt you to download the changes.
+ • Fixed a bug with database syncing which caused the setting to not save for files.
+ • Files should now automatically detect when you have changes in the database on loading, and will prompt you to download the changes.
Patch 2.1.13
diff --git a/src/app/layouts/File.svelte b/src/app/layouts/File.svelte index d41bae0..2bf4588 100644 --- a/src/app/layouts/File.svelte +++ b/src/app/layouts/File.svelte @@ -87,6 +87,9 @@ if (contents.hasOwnProperty('SaveLocation')) { $Language.SaveLocation = contents.SaveLocation; } + if (contents.hasOwnProperty('FileVersion')) { + $Language.FileVersion = contents.FileVersion + } errorMessage = 'There was a problem loading the alphabet from the file.' $Language.Alphabet = contents.Alphabet; @@ -155,9 +158,21 @@ if (verifyHash($dbid, $dbkey)) { const queryResult = await retrieveFromDatabase(contents.Name); if (queryResult !== false) { - if (JSON.stringify($Language.Lexicon) !== JSON.stringify(queryResult.Lexicon)) { + if (queryResult.FileVersion === undefined) { + vex.dialog.confirm({ + message: `The file in the database has no FileVersion number. Would you like to overwrite it with your local version?`, + yesText: 'Upload Local Version', + callback: (proceed) => { + if (proceed) { + saveFile(); + vex.dialog.alert('Saved and uploaded local file.') + } + } + }) + } else if ( parseInt($Language.FileVersion, 36) < parseInt(queryResult.FileVersion, 36) ) { vex.dialog.confirm({ - message: 'Detected changes to the file in the database. Would you like to download them?', + message: `Detected a newer version of the file in the database (local: ${$Language.FileVersion} | online: ${queryResult.FileVersion}). Would you like to download the changes?`, + yesText: 'Download Changes', callback: (proceed, download = queryResult) => { if (proceed) { $Language = download; diff --git a/src/app/layouts/Lexicon.svelte b/src/app/layouts/Lexicon.svelte index 538565f..1f40f6f 100644 --- a/src/app/layouts/Lexicon.svelte +++ b/src/app/layouts/Lexicon.svelte @@ -191,77 +191,75 @@ * or end of a word. Searches are combinative, and only * results which match all search input fields will be * selected as matches. - * @returns {any} */ function search_lex(): void { let words_search = $Language.CaseSensitive? searchWords.trim() : searchWords.toLowerCase().trim(); let definitions_search = searchDefinitions.toLowerCase().trim(); - let tags_search = searchTags.toLowerCase().trim()? searchTags.toLowerCase().trim().split(/\s+/g) : []; + let tags_search = searchTags.toLowerCase().trim(); keys = []; - if (!!words_search || !!definitions_search || !!tags_search[0] || !!lectFilter) { - // Turn l into a list of [search by word terms, search by def terms - let l = [[...words_search.split('|')], [...definitions_search.split('|')]]; + if (!!words_search || !!definitions_search || !!tags_search || !!lectFilter) { // if there is at least one search term for (let word in $Language.Lexicon) { - const w = '^' + word.replaceAll(/\s+/g, '^') + '^'; - let match = lectFilter? $Language.Lexicon[word].Senses.some(sense => sense.lects.includes(lectFilter)) : true; - if (!match) continue; - for (let a of l[0]) { - // words - if (!w.includes(a)) { + let entry = $Language.Lexicon[word]; + let match = true; + + // check lect filter + if ( !!lectFilter ) { + if ( !entry.Senses.some(sense => sense.lects.includes(lectFilter)) ) { match = false; + continue; } } - for (let a of l[1]) { - // definitions - let needs_exact_match = a[0] === '!'; - if (needs_exact_match) { - let pattern = `\\b${a.split('!')[1]}\\b`; - $Language.Lexicon[word].Senses.forEach(sense => { - if (!sense.definition.toLowerCase().match(pattern)) { - // no exact word match - match = false; - } - }); - } else if (!$Language.Lexicon[word].Senses.some(sense => sense.definition.toLowerCase().includes(a))) { - // no partial match + + // check word + if ( !!words_search ) { + if ( words_search[0] === '!') { // requires exact match + if (word !== words_search.split('!')[1]) { + match = false; + continue; + } + } else if ( !('^' + word.replaceAll(/\s+/g, '^') + '^').includes(words_search.replaceAll(/\s+/g, '^')) ) { + // searches for inexact match match = false; + continue; } } - if (!!$Language.Lexicon[word].Senses.some(sense => !!sense.tags[0])) { - // has at least one tag - let partial_tag_match = false; - let needs_exact_match = false; - let has_exact_match = false; - for (let tag of $Language.Lexicon[word].Senses.map(sense => sense.tags).flat()) { - for (let a of tags_search) { - // debug.log('`a` | `tag` : ' + a + ' | ' + tag, false) - // tags - if (a[0] === '!') { - needs_exact_match = true; - if (`!${tag}` === a) { - has_exact_match = true; - partial_tag_match = true; - } - } - if (`^${tag}^`.includes(a)) { - partial_tag_match = true; - } + + // check definitions + if ( !!definitions_search ) { + if ( definitions_search[0] === '!' ) { // requires exact match + if (!entry.Senses.some(sense => sense.definition === definitions_search.split('!')[1])) { + match = false; + continue; } - } - if (!!tags_search[0] && ((!partial_tag_match) || (needs_exact_match && !has_exact_match))) { + } else if (!entry.Senses.some(sense => sense.definition.replaceAll(/\s+/g, '^').toLowerCase().includes(definitions_search.replaceAll(/\s+/g, '^')))) { + // searches for inexact match match = false; + continue; } - } else { - // has no tags - if (!!tags_search[0]) { - match = false; // at least one tag as search term + } + + // check tags + if ( !!tags_search ) { + let tag_search_array = tags_search.split(/\s+/); + for (let tag_search of tag_search_array) { + if (tag_search[0] === '!') { // requires exact match (per tag basis) + if (!entry.Senses.some(sense => sense.tags.some(tag => tag.toLowerCase() === tag_search.split('!')[1]))) { + match = false; + continue; + } + } else if ( !entry.Senses.some(sense => sense.tags.some(tag => `^${tag.toLowerCase()}^`.includes(tag_search))) ) { + // searches for inexact match (per tag basis) + match = false; + continue; + } } } - if (match) { + + if ( match ) { keys = [...keys, word]; } } - if (!keys.length) keys = [null]; // Search was attempted, no results + if (!keys.length) {keys = [null]}; // Search was attempted, no results } } diff --git a/src/app/layouts/Phrasebook.svelte b/src/app/layouts/Phrasebook.svelte index 99c7280..ea399f6 100644 --- a/src/app/layouts/Phrasebook.svelte +++ b/src/app/layouts/Phrasebook.svelte @@ -42,16 +42,15 @@ let tagMatch = !tagsSearch const filterLect = lectFilter? !lectFilter : scope[entry].lects.includes(lectFilter); - if (term.includes(phrase_search)) + if (term.toLowerCase().includes(phrase_search.toLowerCase())) phraseMatch = true; - if (scope[entry].description.toLowerCase().includes(descript_search)) + if (scope[entry].description.toLowerCase().includes(descript_search.toLowerCase())) descriptMatch = true; if (!!tagsSearch) { - if (scope[entry].tags.some(tag => tagsSearch.includes(tag))) + if (scope[entry].tags.some(tag => tagsSearch.includes(tag.toLowerCase()))) tagMatch = true; } - for (let variant in scope[entry].variants) { let v_term = '^' + variant + '^'; if (v_term.includes(phrase_search)) diff --git a/src/app/layouts/Settings.svelte b/src/app/layouts/Settings.svelte index 7f0fc0f..d2ac316 100644 --- a/src/app/layouts/Settings.svelte +++ b/src/app/layouts/Settings.svelte @@ -1,5 +1,5 @@ \";\n unsubscribe = listen(window, 'message', (event) => {\n if (event.source === iframe.contentWindow)\n fn();\n });\n }\n else {\n iframe.src = 'about:blank';\n iframe.onload = () => {\n unsubscribe = listen(iframe.contentWindow, 'resize', fn);\n };\n }\n append(node, iframe);\n return () => {\n if (crossorigin) {\n unsubscribe();\n }\n else if (unsubscribe && iframe.contentWindow) {\n unsubscribe();\n }\n detach(iframe);\n };\n}\nfunction toggle_class(element, name, toggle) {\n element.classList[toggle ? 'add' : 'remove'](name);\n}\nfunction custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {\n const e = document.createEvent('CustomEvent');\n e.initCustomEvent(type, bubbles, cancelable, detail);\n return e;\n}\nfunction query_selector_all(selector, parent = document.body) {\n return Array.from(parent.querySelectorAll(selector));\n}\nfunction head_selector(nodeId, head) {\n const result = [];\n let started = 0;\n for (const node of head.childNodes) {\n if (node.nodeType === 8 /* comment node */) {\n const comment = node.textContent.trim();\n if (comment === `HEAD_${nodeId}_END`) {\n started -= 1;\n result.push(node);\n }\n else if (comment === `HEAD_${nodeId}_START`) {\n started += 1;\n result.push(node);\n }\n }\n else if (started > 0) {\n result.push(node);\n }\n }\n return result;\n}\nclass HtmlTag {\n constructor(is_svg = false) {\n this.is_svg = false;\n this.is_svg = is_svg;\n this.e = this.n = null;\n }\n c(html) {\n this.h(html);\n }\n m(html, target, anchor = null) {\n if (!this.e) {\n if (this.is_svg)\n this.e = svg_element(target.nodeName);\n else\n this.e = element(target.nodeName);\n this.t = target;\n this.c(html);\n }\n this.i(anchor);\n }\n h(html) {\n this.e.innerHTML = html;\n this.n = Array.from(this.e.childNodes);\n }\n i(anchor) {\n for (let i = 0; i < this.n.length; i += 1) {\n insert(this.t, this.n[i], anchor);\n }\n }\n p(html) {\n this.d();\n this.h(html);\n this.i(this.a);\n }\n d() {\n this.n.forEach(detach);\n }\n}\nclass HtmlTagHydration extends HtmlTag {\n constructor(claimed_nodes, is_svg = false) {\n super(is_svg);\n this.e = this.n = null;\n this.l = claimed_nodes;\n }\n c(html) {\n if (this.l) {\n this.n = this.l;\n }\n else {\n super.c(html);\n }\n }\n i(anchor) {\n for (let i = 0; i < this.n.length; i += 1) {\n insert_hydration(this.t, this.n[i], anchor);\n }\n }\n}\nfunction attribute_to_object(attributes) {\n const result = {};\n for (const attribute of attributes) {\n result[attribute.name] = attribute.value;\n }\n return result;\n}\nfunction get_custom_elements_slots(element) {\n const result = {};\n element.childNodes.forEach((node) => {\n result[node.slot || 'default'] = true;\n });\n return result;\n}\nfunction construct_svelte_component(component, props) {\n return new component(props);\n}\n\n// we need to store the information for multiple documents because a Svelte application could also contain iframes\n// https://github.com/sveltejs/svelte/issues/3624\nconst managed_styles = new Map();\nlet active = 0;\n// https://github.com/darkskyapp/string-hash/blob/master/index.js\nfunction hash(str) {\n let hash = 5381;\n let i = str.length;\n while (i--)\n hash = ((hash << 5) - hash) ^ str.charCodeAt(i);\n return hash >>> 0;\n}\nfunction create_style_information(doc, node) {\n const info = { stylesheet: append_empty_stylesheet(node), rules: {} };\n managed_styles.set(doc, info);\n return info;\n}\nfunction create_rule(node, a, b, duration, delay, ease, fn, uid = 0) {\n const step = 16.666 / duration;\n let keyframes = '{\\n';\n for (let p = 0; p <= 1; p += step) {\n const t = a + (b - a) * ease(p);\n keyframes += p * 100 + `%{${fn(t, 1 - t)}}\\n`;\n }\n const rule = keyframes + `100% {${fn(b, 1 - b)}}\\n}`;\n const name = `__svelte_${hash(rule)}_${uid}`;\n const doc = get_root_for_style(node);\n const { stylesheet, rules } = managed_styles.get(doc) || create_style_information(doc, node);\n if (!rules[name]) {\n rules[name] = true;\n stylesheet.insertRule(`@keyframes ${name} ${rule}`, stylesheet.cssRules.length);\n }\n const animation = node.style.animation || '';\n node.style.animation = `${animation ? `${animation}, ` : ''}${name} ${duration}ms linear ${delay}ms 1 both`;\n active += 1;\n return name;\n}\nfunction delete_rule(node, name) {\n const previous = (node.style.animation || '').split(', ');\n const next = previous.filter(name\n ? anim => anim.indexOf(name) < 0 // remove specific animation\n : anim => anim.indexOf('__svelte') === -1 // remove all Svelte animations\n );\n const deleted = previous.length - next.length;\n if (deleted) {\n node.style.animation = next.join(', ');\n active -= deleted;\n if (!active)\n clear_rules();\n }\n}\nfunction clear_rules() {\n raf(() => {\n if (active)\n return;\n managed_styles.forEach(info => {\n const { ownerNode } = info.stylesheet;\n // there is no ownerNode if it runs on jsdom.\n if (ownerNode)\n detach(ownerNode);\n });\n managed_styles.clear();\n });\n}\n\nfunction create_animation(node, from, fn, params) {\n if (!from)\n return noop;\n const to = node.getBoundingClientRect();\n if (from.left === to.left && from.right === to.right && from.top === to.top && from.bottom === to.bottom)\n return noop;\n const { delay = 0, duration = 300, easing = identity, \n // @ts-ignore todo: should this be separated from destructuring? Or start/end added to public api and documentation?\n start: start_time = now() + delay, \n // @ts-ignore todo:\n end = start_time + duration, tick = noop, css } = fn(node, { from, to }, params);\n let running = true;\n let started = false;\n let name;\n function start() {\n if (css) {\n name = create_rule(node, 0, 1, duration, delay, easing, css);\n }\n if (!delay) {\n started = true;\n }\n }\n function stop() {\n if (css)\n delete_rule(node, name);\n running = false;\n }\n loop(now => {\n if (!started && now >= start_time) {\n started = true;\n }\n if (started && now >= end) {\n tick(1, 0);\n stop();\n }\n if (!running) {\n return false;\n }\n if (started) {\n const p = now - start_time;\n const t = 0 + 1 * easing(p / duration);\n tick(t, 1 - t);\n }\n return true;\n });\n start();\n tick(0, 1);\n return stop;\n}\nfunction fix_position(node) {\n const style = getComputedStyle(node);\n if (style.position !== 'absolute' && style.position !== 'fixed') {\n const { width, height } = style;\n const a = node.getBoundingClientRect();\n node.style.position = 'absolute';\n node.style.width = width;\n node.style.height = height;\n add_transform(node, a);\n }\n}\nfunction add_transform(node, a) {\n const b = node.getBoundingClientRect();\n if (a.left !== b.left || a.top !== b.top) {\n const style = getComputedStyle(node);\n const transform = style.transform === 'none' ? '' : style.transform;\n node.style.transform = `${transform} translate(${a.left - b.left}px, ${a.top - b.top}px)`;\n }\n}\n\nlet current_component;\nfunction set_current_component(component) {\n current_component = component;\n}\nfunction get_current_component() {\n if (!current_component)\n throw new Error('Function called outside component initialization');\n return current_component;\n}\n/**\n * Schedules a callback to run immediately before the component is updated after any state change.\n *\n * The first time the callback runs will be before the initial `onMount`\n *\n * https://svelte.dev/docs#run-time-svelte-beforeupdate\n */\nfunction beforeUpdate(fn) {\n get_current_component().$$.before_update.push(fn);\n}\n/**\n * The `onMount` function schedules a callback to run as soon as the component has been mounted to the DOM.\n * It must be called during the component's initialisation (but doesn't need to live *inside* the component;\n * it can be called from an external module).\n *\n * `onMount` does not run inside a [server-side component](/docs#run-time-server-side-component-api).\n *\n * https://svelte.dev/docs#run-time-svelte-onmount\n */\nfunction onMount(fn) {\n get_current_component().$$.on_mount.push(fn);\n}\n/**\n * Schedules a callback to run immediately after the component has been updated.\n *\n * The first time the callback runs will be after the initial `onMount`\n */\nfunction afterUpdate(fn) {\n get_current_component().$$.after_update.push(fn);\n}\n/**\n * Schedules a callback to run immediately before the component is unmounted.\n *\n * Out of `onMount`, `beforeUpdate`, `afterUpdate` and `onDestroy`, this is the\n * only one that runs inside a server-side component.\n *\n * https://svelte.dev/docs#run-time-svelte-ondestroy\n */\nfunction onDestroy(fn) {\n get_current_component().$$.on_destroy.push(fn);\n}\n/**\n * Creates an event dispatcher that can be used to dispatch [component events](/docs#template-syntax-component-directives-on-eventname).\n * Event dispatchers are functions that can take two arguments: `name` and `detail`.\n *\n * Component events created with `createEventDispatcher` create a\n * [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent).\n * These events do not [bubble](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#Event_bubbling_and_capture).\n * The `detail` argument corresponds to the [CustomEvent.detail](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/detail)\n * property and can contain any type of data.\n *\n * https://svelte.dev/docs#run-time-svelte-createeventdispatcher\n */\nfunction createEventDispatcher() {\n const component = get_current_component();\n return (type, detail, { cancelable = false } = {}) => {\n const callbacks = component.$$.callbacks[type];\n if (callbacks) {\n // TODO are there situations where events could be dispatched\n // in a server (non-DOM) environment?\n const event = custom_event(type, detail, { cancelable });\n callbacks.slice().forEach(fn => {\n fn.call(component, event);\n });\n return !event.defaultPrevented;\n }\n return true;\n };\n}\n/**\n * Associates an arbitrary `context` object with the current component and the specified `key`\n * and returns that object. The context is then available to children of the component\n * (including slotted content) with `getContext`.\n *\n * Like lifecycle functions, this must be called during component initialisation.\n *\n * https://svelte.dev/docs#run-time-svelte-setcontext\n */\nfunction setContext(key, context) {\n get_current_component().$$.context.set(key, context);\n return context;\n}\n/**\n * Retrieves the context that belongs to the closest parent component with the specified `key`.\n * Must be called during component initialisation.\n *\n * https://svelte.dev/docs#run-time-svelte-getcontext\n */\nfunction getContext(key) {\n return get_current_component().$$.context.get(key);\n}\n/**\n * Retrieves the whole context map that belongs to the closest parent component.\n * Must be called during component initialisation. Useful, for example, if you\n * programmatically create a component and want to pass the existing context to it.\n *\n * https://svelte.dev/docs#run-time-svelte-getallcontexts\n */\nfunction getAllContexts() {\n return get_current_component().$$.context;\n}\n/**\n * Checks whether a given `key` has been set in the context of a parent component.\n * Must be called during component initialisation.\n *\n * https://svelte.dev/docs#run-time-svelte-hascontext\n */\nfunction hasContext(key) {\n return get_current_component().$$.context.has(key);\n}\n// TODO figure out if we still want to support\n// shorthand events, or if we want to implement\n// a real bubbling mechanism\nfunction bubble(component, event) {\n const callbacks = component.$$.callbacks[event.type];\n if (callbacks) {\n // @ts-ignore\n callbacks.slice().forEach(fn => fn.call(this, event));\n }\n}\n\nconst dirty_components = [];\nconst intros = { enabled: false };\nconst binding_callbacks = [];\nconst render_callbacks = [];\nconst flush_callbacks = [];\nconst resolved_promise = Promise.resolve();\nlet update_scheduled = false;\nfunction schedule_update() {\n if (!update_scheduled) {\n update_scheduled = true;\n resolved_promise.then(flush);\n }\n}\nfunction tick() {\n schedule_update();\n return resolved_promise;\n}\nfunction add_render_callback(fn) {\n render_callbacks.push(fn);\n}\nfunction add_flush_callback(fn) {\n flush_callbacks.push(fn);\n}\n// flush() calls callbacks in this order:\n// 1. All beforeUpdate callbacks, in order: parents before children\n// 2. All bind:this callbacks, in reverse order: children before parents.\n// 3. All afterUpdate callbacks, in order: parents before children. EXCEPT\n// for afterUpdates called during the initial onMount, which are called in\n// reverse order: children before parents.\n// Since callbacks might update component values, which could trigger another\n// call to flush(), the following steps guard against this:\n// 1. During beforeUpdate, any updated components will be added to the\n// dirty_components array and will cause a reentrant call to flush(). Because\n// the flush index is kept outside the function, the reentrant call will pick\n// up where the earlier call left off and go through all dirty components. The\n// current_component value is saved and restored so that the reentrant call will\n// not interfere with the \"parent\" flush() call.\n// 2. bind:this callbacks cannot trigger new flush() calls.\n// 3. During afterUpdate, any updated components will NOT have their afterUpdate\n// callback called a second time; the seen_callbacks set, outside the flush()\n// function, guarantees this behavior.\nconst seen_callbacks = new Set();\nlet flushidx = 0; // Do *not* move this inside the flush() function\nfunction flush() {\n // Do not reenter flush while dirty components are updated, as this can\n // result in an infinite loop. Instead, let the inner flush handle it.\n // Reentrancy is ok afterwards for bindings etc.\n if (flushidx !== 0) {\n return;\n }\n const saved_component = current_component;\n do {\n // first, call beforeUpdate functions\n // and update components\n try {\n while (flushidx < dirty_components.length) {\n const component = dirty_components[flushidx];\n flushidx++;\n set_current_component(component);\n update(component.$$);\n }\n }\n catch (e) {\n // reset dirty state to not end up in a deadlocked state and then rethrow\n dirty_components.length = 0;\n flushidx = 0;\n throw e;\n }\n set_current_component(null);\n dirty_components.length = 0;\n flushidx = 0;\n while (binding_callbacks.length)\n binding_callbacks.pop()();\n // then, once components are updated, call\n // afterUpdate functions. This may cause\n // subsequent updates...\n for (let i = 0; i < render_callbacks.length; i += 1) {\n const callback = render_callbacks[i];\n if (!seen_callbacks.has(callback)) {\n // ...so guard against infinite loops\n seen_callbacks.add(callback);\n callback();\n }\n }\n render_callbacks.length = 0;\n } while (dirty_components.length);\n while (flush_callbacks.length) {\n flush_callbacks.pop()();\n }\n update_scheduled = false;\n seen_callbacks.clear();\n set_current_component(saved_component);\n}\nfunction update($$) {\n if ($$.fragment !== null) {\n $$.update();\n run_all($$.before_update);\n const dirty = $$.dirty;\n $$.dirty = [-1];\n $$.fragment && $$.fragment.p($$.ctx, dirty);\n $$.after_update.forEach(add_render_callback);\n }\n}\n\nlet promise;\nfunction wait() {\n if (!promise) {\n promise = Promise.resolve();\n promise.then(() => {\n promise = null;\n });\n }\n return promise;\n}\nfunction dispatch(node, direction, kind) {\n node.dispatchEvent(custom_event(`${direction ? 'intro' : 'outro'}${kind}`));\n}\nconst outroing = new Set();\nlet outros;\nfunction group_outros() {\n outros = {\n r: 0,\n c: [],\n p: outros // parent group\n };\n}\nfunction check_outros() {\n if (!outros.r) {\n run_all(outros.c);\n }\n outros = outros.p;\n}\nfunction transition_in(block, local) {\n if (block && block.i) {\n outroing.delete(block);\n block.i(local);\n }\n}\nfunction transition_out(block, local, detach, callback) {\n if (block && block.o) {\n if (outroing.has(block))\n return;\n outroing.add(block);\n outros.c.push(() => {\n outroing.delete(block);\n if (callback) {\n if (detach)\n block.d(1);\n callback();\n }\n });\n block.o(local);\n }\n else if (callback) {\n callback();\n }\n}\nconst null_transition = { duration: 0 };\nfunction create_in_transition(node, fn, params) {\n const options = { direction: 'in' };\n let config = fn(node, params, options);\n let running = false;\n let animation_name;\n let task;\n let uid = 0;\n function cleanup() {\n if (animation_name)\n delete_rule(node, animation_name);\n }\n function go() {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n if (css)\n animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++);\n tick(0, 1);\n const start_time = now() + delay;\n const end_time = start_time + duration;\n if (task)\n task.abort();\n running = true;\n add_render_callback(() => dispatch(node, true, 'start'));\n task = loop(now => {\n if (running) {\n if (now >= end_time) {\n tick(1, 0);\n dispatch(node, true, 'end');\n cleanup();\n return running = false;\n }\n if (now >= start_time) {\n const t = easing((now - start_time) / duration);\n tick(t, 1 - t);\n }\n }\n return running;\n });\n }\n let started = false;\n return {\n start() {\n if (started)\n return;\n started = true;\n delete_rule(node);\n if (is_function(config)) {\n config = config(options);\n wait().then(go);\n }\n else {\n go();\n }\n },\n invalidate() {\n started = false;\n },\n end() {\n if (running) {\n cleanup();\n running = false;\n }\n }\n };\n}\nfunction create_out_transition(node, fn, params) {\n const options = { direction: 'out' };\n let config = fn(node, params, options);\n let running = true;\n let animation_name;\n const group = outros;\n group.r += 1;\n function go() {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n if (css)\n animation_name = create_rule(node, 1, 0, duration, delay, easing, css);\n const start_time = now() + delay;\n const end_time = start_time + duration;\n add_render_callback(() => dispatch(node, false, 'start'));\n loop(now => {\n if (running) {\n if (now >= end_time) {\n tick(0, 1);\n dispatch(node, false, 'end');\n if (!--group.r) {\n // this will result in `end()` being called,\n // so we don't need to clean up here\n run_all(group.c);\n }\n return false;\n }\n if (now >= start_time) {\n const t = easing((now - start_time) / duration);\n tick(1 - t, t);\n }\n }\n return running;\n });\n }\n if (is_function(config)) {\n wait().then(() => {\n // @ts-ignore\n config = config(options);\n go();\n });\n }\n else {\n go();\n }\n return {\n end(reset) {\n if (reset && config.tick) {\n config.tick(1, 0);\n }\n if (running) {\n if (animation_name)\n delete_rule(node, animation_name);\n running = false;\n }\n }\n };\n}\nfunction create_bidirectional_transition(node, fn, params, intro) {\n const options = { direction: 'both' };\n let config = fn(node, params, options);\n let t = intro ? 0 : 1;\n let running_program = null;\n let pending_program = null;\n let animation_name = null;\n function clear_animation() {\n if (animation_name)\n delete_rule(node, animation_name);\n }\n function init(program, duration) {\n const d = (program.b - t);\n duration *= Math.abs(d);\n return {\n a: t,\n b: program.b,\n d,\n duration,\n start: program.start,\n end: program.start + duration,\n group: program.group\n };\n }\n function go(b) {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n const program = {\n start: now() + delay,\n b\n };\n if (!b) {\n // @ts-ignore todo: improve typings\n program.group = outros;\n outros.r += 1;\n }\n if (running_program || pending_program) {\n pending_program = program;\n }\n else {\n // if this is an intro, and there's a delay, we need to do\n // an initial tick and/or apply CSS animation immediately\n if (css) {\n clear_animation();\n animation_name = create_rule(node, t, b, duration, delay, easing, css);\n }\n if (b)\n tick(0, 1);\n running_program = init(program, duration);\n add_render_callback(() => dispatch(node, b, 'start'));\n loop(now => {\n if (pending_program && now > pending_program.start) {\n running_program = init(pending_program, duration);\n pending_program = null;\n dispatch(node, running_program.b, 'start');\n if (css) {\n clear_animation();\n animation_name = create_rule(node, t, running_program.b, running_program.duration, 0, easing, config.css);\n }\n }\n if (running_program) {\n if (now >= running_program.end) {\n tick(t = running_program.b, 1 - t);\n dispatch(node, running_program.b, 'end');\n if (!pending_program) {\n // we're done\n if (running_program.b) {\n // intro — we can tidy up immediately\n clear_animation();\n }\n else {\n // outro — needs to be coordinated\n if (!--running_program.group.r)\n run_all(running_program.group.c);\n }\n }\n running_program = null;\n }\n else if (now >= running_program.start) {\n const p = now - running_program.start;\n t = running_program.a + running_program.d * easing(p / running_program.duration);\n tick(t, 1 - t);\n }\n }\n return !!(running_program || pending_program);\n });\n }\n }\n return {\n run(b) {\n if (is_function(config)) {\n wait().then(() => {\n // @ts-ignore\n config = config(options);\n go(b);\n });\n }\n else {\n go(b);\n }\n },\n end() {\n clear_animation();\n running_program = pending_program = null;\n }\n };\n}\n\nfunction handle_promise(promise, info) {\n const token = info.token = {};\n function update(type, index, key, value) {\n if (info.token !== token)\n return;\n info.resolved = value;\n let child_ctx = info.ctx;\n if (key !== undefined) {\n child_ctx = child_ctx.slice();\n child_ctx[key] = value;\n }\n const block = type && (info.current = type)(child_ctx);\n let needs_flush = false;\n if (info.block) {\n if (info.blocks) {\n info.blocks.forEach((block, i) => {\n if (i !== index && block) {\n group_outros();\n transition_out(block, 1, 1, () => {\n if (info.blocks[i] === block) {\n info.blocks[i] = null;\n }\n });\n check_outros();\n }\n });\n }\n else {\n info.block.d(1);\n }\n block.c();\n transition_in(block, 1);\n block.m(info.mount(), info.anchor);\n needs_flush = true;\n }\n info.block = block;\n if (info.blocks)\n info.blocks[index] = block;\n if (needs_flush) {\n flush();\n }\n }\n if (is_promise(promise)) {\n const current_component = get_current_component();\n promise.then(value => {\n set_current_component(current_component);\n update(info.then, 1, info.value, value);\n set_current_component(null);\n }, error => {\n set_current_component(current_component);\n update(info.catch, 2, info.error, error);\n set_current_component(null);\n if (!info.hasCatch) {\n throw error;\n }\n });\n // if we previously had a then/catch block, destroy it\n if (info.current !== info.pending) {\n update(info.pending, 0);\n return true;\n }\n }\n else {\n if (info.current !== info.then) {\n update(info.then, 1, info.value, promise);\n return true;\n }\n info.resolved = promise;\n }\n}\nfunction update_await_block_branch(info, ctx, dirty) {\n const child_ctx = ctx.slice();\n const { resolved } = info;\n if (info.current === info.then) {\n child_ctx[info.value] = resolved;\n }\n if (info.current === info.catch) {\n child_ctx[info.error] = resolved;\n }\n info.block.p(child_ctx, dirty);\n}\n\nconst globals = (typeof window !== 'undefined'\n ? window\n : typeof globalThis !== 'undefined'\n ? globalThis\n : global);\n\nfunction destroy_block(block, lookup) {\n block.d(1);\n lookup.delete(block.key);\n}\nfunction outro_and_destroy_block(block, lookup) {\n transition_out(block, 1, 1, () => {\n lookup.delete(block.key);\n });\n}\nfunction fix_and_destroy_block(block, lookup) {\n block.f();\n destroy_block(block, lookup);\n}\nfunction fix_and_outro_and_destroy_block(block, lookup) {\n block.f();\n outro_and_destroy_block(block, lookup);\n}\nfunction update_keyed_each(old_blocks, dirty, get_key, dynamic, ctx, list, lookup, node, destroy, create_each_block, next, get_context) {\n let o = old_blocks.length;\n let n = list.length;\n let i = o;\n const old_indexes = {};\n while (i--)\n old_indexes[old_blocks[i].key] = i;\n const new_blocks = [];\n const new_lookup = new Map();\n const deltas = new Map();\n i = n;\n while (i--) {\n const child_ctx = get_context(ctx, list, i);\n const key = get_key(child_ctx);\n let block = lookup.get(key);\n if (!block) {\n block = create_each_block(key, child_ctx);\n block.c();\n }\n else if (dynamic) {\n block.p(child_ctx, dirty);\n }\n new_lookup.set(key, new_blocks[i] = block);\n if (key in old_indexes)\n deltas.set(key, Math.abs(i - old_indexes[key]));\n }\n const will_move = new Set();\n const did_move = new Set();\n function insert(block) {\n transition_in(block, 1);\n block.m(node, next);\n lookup.set(block.key, block);\n next = block.first;\n n--;\n }\n while (o && n) {\n const new_block = new_blocks[n - 1];\n const old_block = old_blocks[o - 1];\n const new_key = new_block.key;\n const old_key = old_block.key;\n if (new_block === old_block) {\n // do nothing\n next = new_block.first;\n o--;\n n--;\n }\n else if (!new_lookup.has(old_key)) {\n // remove old block\n destroy(old_block, lookup);\n o--;\n }\n else if (!lookup.has(new_key) || will_move.has(new_key)) {\n insert(new_block);\n }\n else if (did_move.has(old_key)) {\n o--;\n }\n else if (deltas.get(new_key) > deltas.get(old_key)) {\n did_move.add(new_key);\n insert(new_block);\n }\n else {\n will_move.add(old_key);\n o--;\n }\n }\n while (o--) {\n const old_block = old_blocks[o];\n if (!new_lookup.has(old_block.key))\n destroy(old_block, lookup);\n }\n while (n)\n insert(new_blocks[n - 1]);\n return new_blocks;\n}\nfunction validate_each_keys(ctx, list, get_context, get_key) {\n const keys = new Set();\n for (let i = 0; i < list.length; i++) {\n const key = get_key(get_context(ctx, list, i));\n if (keys.has(key)) {\n throw new Error('Cannot have duplicate keys in a keyed each');\n }\n keys.add(key);\n }\n}\n\nfunction get_spread_update(levels, updates) {\n const update = {};\n const to_null_out = {};\n const accounted_for = { $$scope: 1 };\n let i = levels.length;\n while (i--) {\n const o = levels[i];\n const n = updates[i];\n if (n) {\n for (const key in o) {\n if (!(key in n))\n to_null_out[key] = 1;\n }\n for (const key in n) {\n if (!accounted_for[key]) {\n update[key] = n[key];\n accounted_for[key] = 1;\n }\n }\n levels[i] = n;\n }\n else {\n for (const key in o) {\n accounted_for[key] = 1;\n }\n }\n }\n for (const key in to_null_out) {\n if (!(key in update))\n update[key] = undefined;\n }\n return update;\n}\nfunction get_spread_object(spread_props) {\n return typeof spread_props === 'object' && spread_props !== null ? spread_props : {};\n}\n\n// source: https://html.spec.whatwg.org/multipage/indices.html\nconst boolean_attributes = new Set([\n 'allowfullscreen',\n 'allowpaymentrequest',\n 'async',\n 'autofocus',\n 'autoplay',\n 'checked',\n 'controls',\n 'default',\n 'defer',\n 'disabled',\n 'formnovalidate',\n 'hidden',\n 'inert',\n 'ismap',\n 'itemscope',\n 'loop',\n 'multiple',\n 'muted',\n 'nomodule',\n 'novalidate',\n 'open',\n 'playsinline',\n 'readonly',\n 'required',\n 'reversed',\n 'selected'\n]);\n\n/** regex of all html void element names */\nconst void_element_names = /^(?:area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/;\nfunction is_void(name) {\n return void_element_names.test(name) || name.toLowerCase() === '!doctype';\n}\n\nconst invalid_attribute_name_character = /[\\s'\">/=\\u{FDD0}-\\u{FDEF}\\u{FFFE}\\u{FFFF}\\u{1FFFE}\\u{1FFFF}\\u{2FFFE}\\u{2FFFF}\\u{3FFFE}\\u{3FFFF}\\u{4FFFE}\\u{4FFFF}\\u{5FFFE}\\u{5FFFF}\\u{6FFFE}\\u{6FFFF}\\u{7FFFE}\\u{7FFFF}\\u{8FFFE}\\u{8FFFF}\\u{9FFFE}\\u{9FFFF}\\u{AFFFE}\\u{AFFFF}\\u{BFFFE}\\u{BFFFF}\\u{CFFFE}\\u{CFFFF}\\u{DFFFE}\\u{DFFFF}\\u{EFFFE}\\u{EFFFF}\\u{FFFFE}\\u{FFFFF}\\u{10FFFE}\\u{10FFFF}]/u;\n// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\n// https://infra.spec.whatwg.org/#noncharacter\nfunction spread(args, attrs_to_add) {\n const attributes = Object.assign({}, ...args);\n if (attrs_to_add) {\n const classes_to_add = attrs_to_add.classes;\n const styles_to_add = attrs_to_add.styles;\n if (classes_to_add) {\n if (attributes.class == null) {\n attributes.class = classes_to_add;\n }\n else {\n attributes.class += ' ' + classes_to_add;\n }\n }\n if (styles_to_add) {\n if (attributes.style == null) {\n attributes.style = style_object_to_string(styles_to_add);\n }\n else {\n attributes.style = style_object_to_string(merge_ssr_styles(attributes.style, styles_to_add));\n }\n }\n }\n let str = '';\n Object.keys(attributes).forEach(name => {\n if (invalid_attribute_name_character.test(name))\n return;\n const value = attributes[name];\n if (value === true)\n str += ' ' + name;\n else if (boolean_attributes.has(name.toLowerCase())) {\n if (value)\n str += ' ' + name;\n }\n else if (value != null) {\n str += ` ${name}=\"${value}\"`;\n }\n });\n return str;\n}\nfunction merge_ssr_styles(style_attribute, style_directive) {\n const style_object = {};\n for (const individual_style of style_attribute.split(';')) {\n const colon_index = individual_style.indexOf(':');\n const name = individual_style.slice(0, colon_index).trim();\n const value = individual_style.slice(colon_index + 1).trim();\n if (!name)\n continue;\n style_object[name] = value;\n }\n for (const name in style_directive) {\n const value = style_directive[name];\n if (value) {\n style_object[name] = value;\n }\n else {\n delete style_object[name];\n }\n }\n return style_object;\n}\nconst ATTR_REGEX = /[&\"]/g;\nconst CONTENT_REGEX = /[&<]/g;\n/**\n * Note: this method is performance sensitive and has been optimized\n * https://github.com/sveltejs/svelte/pull/5701\n */\nfunction escape(value, is_attr = false) {\n const str = String(value);\n const pattern = is_attr ? ATTR_REGEX : CONTENT_REGEX;\n pattern.lastIndex = 0;\n let escaped = '';\n let last = 0;\n while (pattern.test(str)) {\n const i = pattern.lastIndex - 1;\n const ch = str[i];\n escaped += str.substring(last, i) + (ch === '&' ? '&' : (ch === '\"' ? '"' : '<'));\n last = i + 1;\n }\n return escaped + str.substring(last);\n}\nfunction escape_attribute_value(value) {\n // keep booleans, null, and undefined for the sake of `spread`\n const should_escape = typeof value === 'string' || (value && typeof value === 'object');\n return should_escape ? escape(value, true) : value;\n}\nfunction escape_object(obj) {\n const result = {};\n for (const key in obj) {\n result[key] = escape_attribute_value(obj[key]);\n }\n return result;\n}\nfunction each(items, fn) {\n let str = '';\n for (let i = 0; i < items.length; i += 1) {\n str += fn(items[i], i);\n }\n return str;\n}\nconst missing_component = {\n $$render: () => ''\n};\nfunction validate_component(component, name) {\n if (!component || !component.$$render) {\n if (name === 'svelte:component')\n name += ' this={...}';\n throw new Error(`<${name}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${name}>.`);\n }\n return component;\n}\nfunction debug(file, line, column, values) {\n console.log(`{@debug} ${file ? file + ' ' : ''}(${line}:${column})`); // eslint-disable-line no-console\n console.log(values); // eslint-disable-line no-console\n return '';\n}\nlet on_destroy;\nfunction create_ssr_component(fn) {\n function $$render(result, props, bindings, slots, context) {\n const parent_component = current_component;\n const $$ = {\n on_destroy,\n context: new Map(context || (parent_component ? parent_component.$$.context : [])),\n // these will be immediately discarded\n on_mount: [],\n before_update: [],\n after_update: [],\n callbacks: blank_object()\n };\n set_current_component({ $$ });\n const html = fn(result, props, bindings, slots);\n set_current_component(parent_component);\n return html;\n }\n return {\n render: (props = {}, { $$slots = {}, context = new Map() } = {}) => {\n on_destroy = [];\n const result = { title: '', head: '', css: new Set() };\n const html = $$render(result, props, {}, $$slots, context);\n run_all(on_destroy);\n return {\n html,\n css: {\n code: Array.from(result.css).map(css => css.code).join('\\n'),\n map: null // TODO\n },\n head: result.title + result.head\n };\n },\n $$render\n };\n}\nfunction add_attribute(name, value, boolean) {\n if (value == null || (boolean && !value))\n return '';\n const assignment = (boolean && value === true) ? '' : `=\"${escape(value, true)}\"`;\n return ` ${name}${assignment}`;\n}\nfunction add_classes(classes) {\n return classes ? ` class=\"${classes}\"` : '';\n}\nfunction style_object_to_string(style_object) {\n return Object.keys(style_object)\n .filter(key => style_object[key])\n .map(key => `${key}: ${escape_attribute_value(style_object[key])};`)\n .join(' ');\n}\nfunction add_styles(style_object) {\n const styles = style_object_to_string(style_object);\n return styles ? ` style=\"${styles}\"` : '';\n}\n\nfunction bind(component, name, callback) {\n const index = component.$$.props[name];\n if (index !== undefined) {\n component.$$.bound[index] = callback;\n callback(component.$$.ctx[index]);\n }\n}\nfunction create_component(block) {\n block && block.c();\n}\nfunction claim_component(block, parent_nodes) {\n block && block.l(parent_nodes);\n}\nfunction mount_component(component, target, anchor, customElement) {\n const { fragment, after_update } = component.$$;\n fragment && fragment.m(target, anchor);\n if (!customElement) {\n // onMount happens before the initial afterUpdate\n add_render_callback(() => {\n const new_on_destroy = component.$$.on_mount.map(run).filter(is_function);\n // if the component was destroyed immediately\n // it will update the `$$.on_destroy` reference to `null`.\n // the destructured on_destroy may still reference to the old array\n if (component.$$.on_destroy) {\n component.$$.on_destroy.push(...new_on_destroy);\n }\n else {\n // Edge case - component was destroyed immediately,\n // most likely as a result of a binding initialising\n run_all(new_on_destroy);\n }\n component.$$.on_mount = [];\n });\n }\n after_update.forEach(add_render_callback);\n}\nfunction destroy_component(component, detaching) {\n const $$ = component.$$;\n if ($$.fragment !== null) {\n run_all($$.on_destroy);\n $$.fragment && $$.fragment.d(detaching);\n // TODO null out other refs, including component.$$ (but need to\n // preserve final state?)\n $$.on_destroy = $$.fragment = null;\n $$.ctx = [];\n }\n}\nfunction make_dirty(component, i) {\n if (component.$$.dirty[0] === -1) {\n dirty_components.push(component);\n schedule_update();\n component.$$.dirty.fill(0);\n }\n component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31));\n}\nfunction init(component, options, instance, create_fragment, not_equal, props, append_styles, dirty = [-1]) {\n const parent_component = current_component;\n set_current_component(component);\n const $$ = component.$$ = {\n fragment: null,\n ctx: [],\n // state\n props,\n update: noop,\n not_equal,\n bound: blank_object(),\n // lifecycle\n on_mount: [],\n on_destroy: [],\n on_disconnect: [],\n before_update: [],\n after_update: [],\n context: new Map(options.context || (parent_component ? parent_component.$$.context : [])),\n // everything else\n callbacks: blank_object(),\n dirty,\n skip_bound: false,\n root: options.target || parent_component.$$.root\n };\n append_styles && append_styles($$.root);\n let ready = false;\n $$.ctx = instance\n ? instance(component, options.props || {}, (i, ret, ...rest) => {\n const value = rest.length ? rest[0] : ret;\n if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {\n if (!$$.skip_bound && $$.bound[i])\n $$.bound[i](value);\n if (ready)\n make_dirty(component, i);\n }\n return ret;\n })\n : [];\n $$.update();\n ready = true;\n run_all($$.before_update);\n // `false` as a special case of no DOM component\n $$.fragment = create_fragment ? create_fragment($$.ctx) : false;\n if (options.target) {\n if (options.hydrate) {\n start_hydrating();\n const nodes = children(options.target);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n $$.fragment && $$.fragment.l(nodes);\n nodes.forEach(detach);\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n $$.fragment && $$.fragment.c();\n }\n if (options.intro)\n transition_in(component.$$.fragment);\n mount_component(component, options.target, options.anchor, options.customElement);\n end_hydrating();\n flush();\n }\n set_current_component(parent_component);\n}\nlet SvelteElement;\nif (typeof HTMLElement === 'function') {\n SvelteElement = class extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n }\n connectedCallback() {\n const { on_mount } = this.$$;\n this.$$.on_disconnect = on_mount.map(run).filter(is_function);\n // @ts-ignore todo: improve typings\n for (const key in this.$$.slotted) {\n // @ts-ignore todo: improve typings\n this.appendChild(this.$$.slotted[key]);\n }\n }\n attributeChangedCallback(attr, _oldValue, newValue) {\n this[attr] = newValue;\n }\n disconnectedCallback() {\n run_all(this.$$.on_disconnect);\n }\n $destroy() {\n destroy_component(this, 1);\n this.$destroy = noop;\n }\n $on(type, callback) {\n // TODO should this delegate to addEventListener?\n if (!is_function(callback)) {\n return noop;\n }\n const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));\n callbacks.push(callback);\n return () => {\n const index = callbacks.indexOf(callback);\n if (index !== -1)\n callbacks.splice(index, 1);\n };\n }\n $set($$props) {\n if (this.$$set && !is_empty($$props)) {\n this.$$.skip_bound = true;\n this.$$set($$props);\n this.$$.skip_bound = false;\n }\n }\n };\n}\n/**\n * Base class for Svelte components. Used when dev=false.\n */\nclass SvelteComponent {\n $destroy() {\n destroy_component(this, 1);\n this.$destroy = noop;\n }\n $on(type, callback) {\n if (!is_function(callback)) {\n return noop;\n }\n const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));\n callbacks.push(callback);\n return () => {\n const index = callbacks.indexOf(callback);\n if (index !== -1)\n callbacks.splice(index, 1);\n };\n }\n $set($$props) {\n if (this.$$set && !is_empty($$props)) {\n this.$$.skip_bound = true;\n this.$$set($$props);\n this.$$.skip_bound = false;\n }\n }\n}\n\nfunction dispatch_dev(type, detail) {\n document.dispatchEvent(custom_event(type, Object.assign({ version: '3.55.1' }, detail), { bubbles: true }));\n}\nfunction append_dev(target, node) {\n dispatch_dev('SvelteDOMInsert', { target, node });\n append(target, node);\n}\nfunction append_hydration_dev(target, node) {\n dispatch_dev('SvelteDOMInsert', { target, node });\n append_hydration(target, node);\n}\nfunction insert_dev(target, node, anchor) {\n dispatch_dev('SvelteDOMInsert', { target, node, anchor });\n insert(target, node, anchor);\n}\nfunction insert_hydration_dev(target, node, anchor) {\n dispatch_dev('SvelteDOMInsert', { target, node, anchor });\n insert_hydration(target, node, anchor);\n}\nfunction detach_dev(node) {\n dispatch_dev('SvelteDOMRemove', { node });\n detach(node);\n}\nfunction detach_between_dev(before, after) {\n while (before.nextSibling && before.nextSibling !== after) {\n detach_dev(before.nextSibling);\n }\n}\nfunction detach_before_dev(after) {\n while (after.previousSibling) {\n detach_dev(after.previousSibling);\n }\n}\nfunction detach_after_dev(before) {\n while (before.nextSibling) {\n detach_dev(before.nextSibling);\n }\n}\nfunction listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation) {\n const modifiers = options === true ? ['capture'] : options ? Array.from(Object.keys(options)) : [];\n if (has_prevent_default)\n modifiers.push('preventDefault');\n if (has_stop_propagation)\n modifiers.push('stopPropagation');\n dispatch_dev('SvelteDOMAddEventListener', { node, event, handler, modifiers });\n const dispose = listen(node, event, handler, options);\n return () => {\n dispatch_dev('SvelteDOMRemoveEventListener', { node, event, handler, modifiers });\n dispose();\n };\n}\nfunction attr_dev(node, attribute, value) {\n attr(node, attribute, value);\n if (value == null)\n dispatch_dev('SvelteDOMRemoveAttribute', { node, attribute });\n else\n dispatch_dev('SvelteDOMSetAttribute', { node, attribute, value });\n}\nfunction prop_dev(node, property, value) {\n node[property] = value;\n dispatch_dev('SvelteDOMSetProperty', { node, property, value });\n}\nfunction dataset_dev(node, property, value) {\n node.dataset[property] = value;\n dispatch_dev('SvelteDOMSetDataset', { node, property, value });\n}\nfunction set_data_dev(text, data) {\n data = '' + data;\n if (text.wholeText === data)\n return;\n dispatch_dev('SvelteDOMSetData', { node: text, data });\n text.data = data;\n}\nfunction validate_each_argument(arg) {\n if (typeof arg !== 'string' && !(arg && typeof arg === 'object' && 'length' in arg)) {\n let msg = '{#each} only iterates over array-like objects.';\n if (typeof Symbol === 'function' && arg && Symbol.iterator in arg) {\n msg += ' You can use a spread to convert this iterable into an array.';\n }\n throw new Error(msg);\n }\n}\nfunction validate_slots(name, slot, keys) {\n for (const slot_key of Object.keys(slot)) {\n if (!~keys.indexOf(slot_key)) {\n console.warn(`<${name}> received an unexpected slot \"${slot_key}\".`);\n }\n }\n}\nfunction validate_dynamic_element(tag) {\n const is_string = typeof tag === 'string';\n if (tag && !is_string) {\n throw new Error('\"+(l.trim()?l:s)+\"
\"),c=Object.keys(this.toolsTags).reduce((function(e,t){var n;return e[t.toLowerCase()]=null!==(n=d.toolsTags[t].sanitizationConfig)&&void 0!==n?n:{},e}),{}),u=Object.assign({},c,o.getAllInlineToolsSanitizeConfig(),{br:{}}),(f=(0,y.clean)(l,u)).trim()&&f.trim()!==s&&v.default.isHTMLString(f)){e.next=28;break}return e.next=26,this.processText(s);case 26:e.next=30;break;case 28:return e.next=30,this.processText(f,!0);case 30:case\"end\":return e.stop()}}),e,this,[[12,17]])}))),function(e){return h.apply(this,arguments)})},{key:\"processText\",value:(p=(0,l.default)(r.default.mark((function e(t){var n,o,i,a,s,c,u,f=this,d=arguments;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=d.length>1&&void 0!==d[1]&&d[1],o=this.Editor,i=o.Caret,a=o.BlockManager,(s=n?this.processHTML(t):this.processPlain(t)).length){e.next=5;break}return e.abrupt(\"return\");case 5:if(1!==s.length){e.next=8;break}return s[0].isBlock?this.processSingleBlock(s.pop()):this.processInlinePaste(s.pop()),e.abrupt(\"return\");case 8:c=a.currentBlock&&a.currentBlock.tool.isDefault,u=c&&a.currentBlock.isEmpty,s.map(function(){var e=(0,l.default)(r.default.mark((function e(t,n){return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt(\"return\",f.insertBlock(t,0===n&&u));case 1:case\"end\":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),a.currentBlock&&i.setToBlock(a.currentBlock,i.positions.END);case 12:case\"end\":return e.stop()}}),e,this)}))),function(e){return p.apply(this,arguments)})},{key:\"setCallback\",value:function(){this.listeners.on(this.Editor.UI.nodes.holder,\"paste\",this.handlePasteEvent)}},{key:\"unsetCallback\",value:function(){this.listeners.off(this.Editor.UI.nodes.holder,\"paste\",this.handlePasteEvent)}},{key:\"processTools\",value:function(){var e=this.Editor.Tools.blockTools;Array.from(e.values()).forEach(this.processTool)}},{key:\"collectTagNames\",value:function(e){return g.isString(e)?[e]:g.isObject(e)?Object.keys(e):[]}},{key:\"getTagsConfig\",value:function(e){var t=this,n=e.pasteConfig.tags||[],o=[];n.forEach((function(n){var r=t.collectTagNames(n);o.push.apply(o,(0,s.default)(r)),r.forEach((function(o){if(Object.prototype.hasOwnProperty.call(t.toolsTags,o))g.log(\"Paste handler for «\".concat(e.name,\"» Tool on «\").concat(o,\"» tag is skipped \")+\"because it is already used by «\".concat(t.toolsTags[o].tool.name,\"» Tool.\"),\"warn\");else{var r=g.isObject(n)?n[o]:null;t.toolsTags[o.toUpperCase()]={tool:e,sanitizationConfig:r}}}))})),this.tagsByTool[e.name]=o.map((function(e){return e.toUpperCase()}))}},{key:\"getFilesConfig\",value:function(e){var t=e.pasteConfig.files,n=void 0===t?{}:t,o=n.extensions,r=n.mimeTypes;(o||r)&&(o&&!Array.isArray(o)&&(g.log(\"«extensions» property of the onDrop config for «\".concat(e.name,\"» Tool should be an array\")),o=[]),r&&!Array.isArray(r)&&(g.log(\"«mimeTypes» property of the onDrop config for «\".concat(e.name,\"» Tool should be an array\")),r=[]),r&&(r=r.filter((function(t){return!!g.isValidMimeType(t)||(g.log(\"MIME type value «\".concat(t,\"» for the «\").concat(e.name,\"» Tool is not a valid MIME type\"),\"warn\"),!1)}))),this.toolsFiles[e.name]={extensions:o||[],mimeTypes:r||[]})}},{key:\"getPatternsConfig\",value:function(e){var t=this;e.pasteConfig.patterns&&!g.isEmpty(e.pasteConfig.patterns)&&Object.entries(e.pasteConfig.patterns).forEach((function(n){var o=(0,i.default)(n,2),r=o[0],a=o[1];a instanceof RegExp||g.log(\"Pattern \".concat(a,\" for «\").concat(e.name,\"» Tool is skipped because it should be a Regexp instance.\"),\"warn\"),t.toolsPatterns.push({key:r,pattern:a,tool:e})}))}},{key:\"isNativeBehaviour\",value:function(e){return v.default.isNativeInput(e)}},{key:\"processFiles\",value:(d=(0,l.default)(r.default.mark((function e(t){var n,o,i,a,s=this;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.Editor.BlockManager,e.next=3,Promise.all(Array.from(t).map((function(e){return s.processFile(e)})));case 3:o=(o=e.sent).filter((function(e){return!!e})),i=n.currentBlock.tool.isDefault,a=i&&n.currentBlock.isEmpty,o.forEach((function(e,t){n.paste(e.type,e.event,0===t&&a)}));case 8:case\"end\":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:\"processFile\",value:(a=(0,l.default)(r.default.mark((function e(t){var n,o,a,s,l;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=g.getFileExtension(t),o=Object.entries(this.toolsFiles).find((function(e){var o=(0,i.default)(e,2),r=(o[0],o[1]),a=r.mimeTypes,s=r.extensions,l=t.type.split(\"/\"),c=(0,i.default)(l,2),u=c[0],f=c[1],d=s.find((function(e){return e.toLowerCase()===n.toLowerCase()})),p=a.find((function(e){var t=e.split(\"/\"),n=(0,i.default)(t,2),o=n[0],r=n[1];return o===u&&(r===f||\"*\"===r)}));return!!d||!!p}))){e.next=4;break}return e.abrupt(\"return\");case 4:return a=(0,i.default)(o,1),s=a[0],l=this.composePasteEvent(\"file\",{file:t}),e.abrupt(\"return\",{event:l,type:s});case 7:case\"end\":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:\"processHTML\",value:function(e){var t=this,n=this.Editor.Tools,o=v.default.make(\"DIV\");return o.innerHTML=e,this.getNodes(o).map((function(e){var o,r=n.defaultTool,i=!1;switch(e.nodeType){case Node.DOCUMENT_FRAGMENT_NODE:(o=v.default.make(\"div\")).appendChild(e);break;case Node.ELEMENT_NODE:o=e,i=!0,t.toolsTags[o.tagName]&&(r=t.toolsTags[o.tagName].tool)}var a=r.pasteConfig.tags.reduce((function(e,n){return t.collectTagNames(n).forEach((function(t){var o=g.isObject(n)?n[t]:null;e[t.toLowerCase()]=o||{}})),e}),{}),s=Object.assign({},a,r.baseSanitizeConfig);if(\"table\"===o.tagName.toLowerCase()){var l=(0,y.clean)(o.outerHTML,s);o=v.default.make(\"div\",void 0,{innerHTML:l}).firstChild}else o.innerHTML=(0,y.clean)(o.innerHTML,s);var c=t.composePasteEvent(\"tag\",{data:o});return{content:o,isBlock:i,tool:r.name,event:c}})).filter((function(e){var t=v.default.isEmpty(e.content),n=v.default.isSingleTag(e.content);return!t||n}))}},{key:\"processPlain\",value:function(e){var t=this,n=this.config.defaultBlock;if(!e)return[];var o=n;return e.split(/\\r?\\n/).filter((function(e){return e.trim()})).map((function(e){var n=v.default.make(\"div\");n.textContent=e;var r=t.composePasteEvent(\"tag\",{data:n});return{content:n,tool:o,isBlock:!1,event:r}}))}},{key:\"processSingleBlock\",value:(o=(0,l.default)(r.default.mark((function e(t){var n,o,i,a;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.Editor,o=n.Caret,i=n.BlockManager,(a=i.currentBlock)&&t.tool===a.name&&v.default.containsOnlyInlineElements(t.content.innerHTML)){e.next=5;break}return this.insertBlock(t,(null==a?void 0:a.tool.isDefault)&&a.isEmpty),e.abrupt(\"return\");case 5:o.insertContentAtCaretPosition(t.content.innerHTML);case 6:case\"end\":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:\"processInlinePaste\",value:(n=(0,l.default)(r.default.mark((function e(t){var n,o,i,a,s,l,c,u;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.Editor,o=n.BlockManager,i=n.Caret,a=t.content,!(o.currentBlock&&o.currentBlock.tool.isDefault&&a.textContent.length\n {lect}\n \n {pronunciations[lect].ipa}\n {#if pronunciations[lect].irregular}\n \n \n {/if}\n
\n {/each}\n {:else}\n\n {pronunciations.General.ipa}\n {#if pronunciations.General.irregular}\n
\n {/if}\n{/if}\n","export { identity as linear } from '../internal/index.mjs';\n\n/*\nAdapted from https://github.com/mattdesl\nDistributed under MIT License https://github.com/mattdesl/eases/blob/master/LICENSE.md\n*/\nfunction backInOut(t) {\n const s = 1.70158 * 1.525;\n if ((t *= 2) < 1)\n return 0.5 * (t * t * ((s + 1) * t - s));\n return 0.5 * ((t -= 2) * t * ((s + 1) * t + s) + 2);\n}\nfunction backIn(t) {\n const s = 1.70158;\n return t * t * ((s + 1) * t - s);\n}\nfunction backOut(t) {\n const s = 1.70158;\n return --t * t * ((s + 1) * t + s) + 1;\n}\nfunction bounceOut(t) {\n const a = 4.0 / 11.0;\n const b = 8.0 / 11.0;\n const c = 9.0 / 10.0;\n const ca = 4356.0 / 361.0;\n const cb = 35442.0 / 1805.0;\n const cc = 16061.0 / 1805.0;\n const t2 = t * t;\n return t < a\n ? 7.5625 * t2\n : t < b\n ? 9.075 * t2 - 9.9 * t + 3.4\n : t < c\n ? ca * t2 - cb * t + cc\n : 10.8 * t * t - 20.52 * t + 10.72;\n}\nfunction bounceInOut(t) {\n return t < 0.5\n ? 0.5 * (1.0 - bounceOut(1.0 - t * 2.0))\n : 0.5 * bounceOut(t * 2.0 - 1.0) + 0.5;\n}\nfunction bounceIn(t) {\n return 1.0 - bounceOut(1.0 - t);\n}\nfunction circInOut(t) {\n if ((t *= 2) < 1)\n return -0.5 * (Math.sqrt(1 - t * t) - 1);\n return 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);\n}\nfunction circIn(t) {\n return 1.0 - Math.sqrt(1.0 - t * t);\n}\nfunction circOut(t) {\n return Math.sqrt(1 - --t * t);\n}\nfunction cubicInOut(t) {\n return t < 0.5 ? 4.0 * t * t * t : 0.5 * Math.pow(2.0 * t - 2.0, 3.0) + 1.0;\n}\nfunction cubicIn(t) {\n return t * t * t;\n}\nfunction cubicOut(t) {\n const f = t - 1.0;\n return f * f * f + 1.0;\n}\nfunction elasticInOut(t) {\n return t < 0.5\n ? 0.5 *\n Math.sin(((+13.0 * Math.PI) / 2) * 2.0 * t) *\n Math.pow(2.0, 10.0 * (2.0 * t - 1.0))\n : 0.5 *\n Math.sin(((-13.0 * Math.PI) / 2) * (2.0 * t - 1.0 + 1.0)) *\n Math.pow(2.0, -10.0 * (2.0 * t - 1.0)) +\n 1.0;\n}\nfunction elasticIn(t) {\n return Math.sin((13.0 * t * Math.PI) / 2) * Math.pow(2.0, 10.0 * (t - 1.0));\n}\nfunction elasticOut(t) {\n return (Math.sin((-13.0 * (t + 1.0) * Math.PI) / 2) * Math.pow(2.0, -10.0 * t) + 1.0);\n}\nfunction expoInOut(t) {\n return t === 0.0 || t === 1.0\n ? t\n : t < 0.5\n ? +0.5 * Math.pow(2.0, 20.0 * t - 10.0)\n : -0.5 * Math.pow(2.0, 10.0 - t * 20.0) + 1.0;\n}\nfunction expoIn(t) {\n return t === 0.0 ? t : Math.pow(2.0, 10.0 * (t - 1.0));\n}\nfunction expoOut(t) {\n return t === 1.0 ? t : 1.0 - Math.pow(2.0, -10.0 * t);\n}\nfunction quadInOut(t) {\n t /= 0.5;\n if (t < 1)\n return 0.5 * t * t;\n t--;\n return -0.5 * (t * (t - 2) - 1);\n}\nfunction quadIn(t) {\n return t * t;\n}\nfunction quadOut(t) {\n return -t * (t - 2.0);\n}\nfunction quartInOut(t) {\n return t < 0.5\n ? +8.0 * Math.pow(t, 4.0)\n : -8.0 * Math.pow(t - 1.0, 4.0) + 1.0;\n}\nfunction quartIn(t) {\n return Math.pow(t, 4.0);\n}\nfunction quartOut(t) {\n return Math.pow(t - 1.0, 3.0) * (1.0 - t) + 1.0;\n}\nfunction quintInOut(t) {\n if ((t *= 2) < 1)\n return 0.5 * t * t * t * t * t;\n return 0.5 * ((t -= 2) * t * t * t * t + 2);\n}\nfunction quintIn(t) {\n return t * t * t * t * t;\n}\nfunction quintOut(t) {\n return --t * t * t * t * t + 1;\n}\nfunction sineInOut(t) {\n return -0.5 * (Math.cos(Math.PI * t) - 1);\n}\nfunction sineIn(t) {\n const v = Math.cos(t * Math.PI * 0.5);\n if (Math.abs(v) < 1e-14)\n return 1;\n else\n return 1 - v;\n}\nfunction sineOut(t) {\n return Math.sin((t * Math.PI) / 2);\n}\n\nexport { backIn, backInOut, backOut, bounceIn, bounceInOut, bounceOut, circIn, circInOut, circOut, cubicIn, cubicInOut, cubicOut, elasticIn, elasticInOut, elasticOut, expoIn, expoInOut, expoOut, quadIn, quadInOut, quadOut, quartIn, quartInOut, quartOut, quintIn, quintInOut, quintOut, sineIn, sineInOut, sineOut };\n","import { cubicInOut, linear, cubicOut } from '../easing/index.mjs';\nimport { is_function, assign } from '../internal/index.mjs';\n\n/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\n\nfunction blur(node, { delay = 0, duration = 400, easing = cubicInOut, amount = 5, opacity = 0 } = {}) {\n const style = getComputedStyle(node);\n const target_opacity = +style.opacity;\n const f = style.filter === 'none' ? '' : style.filter;\n const od = target_opacity * (1 - opacity);\n return {\n delay,\n duration,\n easing,\n css: (_t, u) => `opacity: ${target_opacity - (od * u)}; filter: ${f} blur(${u * amount}px);`\n };\n}\nfunction fade(node, { delay = 0, duration = 400, easing = linear } = {}) {\n const o = +getComputedStyle(node).opacity;\n return {\n delay,\n duration,\n easing,\n css: t => `opacity: ${t * o}`\n };\n}\nfunction fly(node, { delay = 0, duration = 400, easing = cubicOut, x = 0, y = 0, opacity = 0 } = {}) {\n const style = getComputedStyle(node);\n const target_opacity = +style.opacity;\n const transform = style.transform === 'none' ? '' : style.transform;\n const od = target_opacity * (1 - opacity);\n return {\n delay,\n duration,\n easing,\n css: (t, u) => `\n\t\t\ttransform: ${transform} translate(${(1 - t) * x}px, ${(1 - t) * y}px);\n\t\t\topacity: ${target_opacity - (od * u)}`\n };\n}\nfunction slide(node, { delay = 0, duration = 400, easing = cubicOut } = {}) {\n const style = getComputedStyle(node);\n const opacity = +style.opacity;\n const height = parseFloat(style.height);\n const padding_top = parseFloat(style.paddingTop);\n const padding_bottom = parseFloat(style.paddingBottom);\n const margin_top = parseFloat(style.marginTop);\n const margin_bottom = parseFloat(style.marginBottom);\n const border_top_width = parseFloat(style.borderTopWidth);\n const border_bottom_width = parseFloat(style.borderBottomWidth);\n return {\n delay,\n duration,\n easing,\n css: t => 'overflow: hidden;' +\n `opacity: ${Math.min(t * 20, 1) * opacity};` +\n `height: ${t * height}px;` +\n `padding-top: ${t * padding_top}px;` +\n `padding-bottom: ${t * padding_bottom}px;` +\n `margin-top: ${t * margin_top}px;` +\n `margin-bottom: ${t * margin_bottom}px;` +\n `border-top-width: ${t * border_top_width}px;` +\n `border-bottom-width: ${t * border_bottom_width}px;`\n };\n}\nfunction scale(node, { delay = 0, duration = 400, easing = cubicOut, start = 0, opacity = 0 } = {}) {\n const style = getComputedStyle(node);\n const target_opacity = +style.opacity;\n const transform = style.transform === 'none' ? '' : style.transform;\n const sd = 1 - start;\n const od = target_opacity * (1 - opacity);\n return {\n delay,\n duration,\n easing,\n css: (_t, u) => `\n\t\t\ttransform: ${transform} scale(${1 - (sd * u)});\n\t\t\topacity: ${target_opacity - (od * u)}\n\t\t`\n };\n}\nfunction draw(node, { delay = 0, speed, duration, easing = cubicInOut } = {}) {\n let len = node.getTotalLength();\n const style = getComputedStyle(node);\n if (style.strokeLinecap !== 'butt') {\n len += parseInt(style.strokeWidth);\n }\n if (duration === undefined) {\n if (speed === undefined) {\n duration = 800;\n }\n else {\n duration = len / speed;\n }\n }\n else if (typeof duration === 'function') {\n duration = duration(len);\n }\n return {\n delay,\n duration,\n easing,\n css: (_, u) => `\n\t\t\tstroke-dasharray: ${len};\n\t\t\tstroke-dashoffset: ${u * len};\n\t\t`\n };\n}\nfunction crossfade(_a) {\n var { fallback } = _a, defaults = __rest(_a, [\"fallback\"]);\n const to_receive = new Map();\n const to_send = new Map();\n function crossfade(from, node, params) {\n const { delay = 0, duration = d => Math.sqrt(d) * 30, easing = cubicOut } = assign(assign({}, defaults), params);\n const to = node.getBoundingClientRect();\n const dx = from.left - to.left;\n const dy = from.top - to.top;\n const dw = from.width / to.width;\n const dh = from.height / to.height;\n const d = Math.sqrt(dx * dx + dy * dy);\n const style = getComputedStyle(node);\n const transform = style.transform === 'none' ? '' : style.transform;\n const opacity = +style.opacity;\n return {\n delay,\n duration: is_function(duration) ? duration(d) : duration,\n easing,\n css: (t, u) => `\n\t\t\t\topacity: ${t * opacity};\n\t\t\t\ttransform-origin: top left;\n\t\t\t\ttransform: ${transform} translate(${u * dx}px,${u * dy}px) scale(${t + (1 - t) * dw}, ${t + (1 - t) * dh});\n\t\t\t`\n };\n }\n function transition(items, counterparts, intro) {\n return (node, params) => {\n items.set(params.key, {\n rect: node.getBoundingClientRect()\n });\n return () => {\n if (counterparts.has(params.key)) {\n const { rect } = counterparts.get(params.key);\n counterparts.delete(params.key);\n return crossfade(rect, node, params);\n }\n // if the node is disappearing altogether\n // (i.e. wasn't claimed by the other list)\n // then we need to supply an outro\n items.delete(params.key);\n return fallback && fallback(node, params, intro);\n };\n };\n }\n return [\n transition(to_send, to_receive, false),\n transition(to_receive, to_send, true)\n ];\n}\n\nexport { blur, crossfade, draw, fade, fly, scale, slide };\n","\n\n{#if data[0]}\n \n {#if show && !$hideDropdowns}\n \n {/if}\n{@html cell} | \n {/each}\n
{@html block.data.text}
\n {/if}\n {/each}\n'\n + (escaped ? code : escape(code, true))\n + '
\\n';\n }\n\n return ''\n + (escaped ? code : escape(code, true))\n + '
\\n';\n }\n\n /**\n * @param {string} quote\n */\n blockquote(quote) {\n return `\\n${quote}\\n`;\n }\n\n html(html) {\n return html;\n }\n\n /**\n * @param {string} text\n * @param {string} level\n * @param {string} raw\n * @param {any} slugger\n */\n heading(text, level, raw, slugger) {\n if (this.options.headerIds) {\n const id = this.options.headerPrefix + slugger.slug(raw);\n return `
${text}
\\n`;\n }\n\n /**\n * @param {string} header\n * @param {string} body\n */\n table(header, body) {\n if (body) body = `${body}`;\n\n return '${text}
`;\n }\n\n br() {\n return this.options.xhtml ? 'An error occurred:
'\n + escape(e.message + '', true)\n + '';\n if (async) {\n return Promise.resolve(msg);\n }\n if (callback) {\n callback(null, msg);\n return;\n }\n return msg;\n }\n\n if (async) {\n return Promise.reject(e);\n }\n if (callback) {\n callback(e);\n return;\n }\n throw e;\n };\n}\n\nfunction parseMarkdown(lexer, parser) {\n return (src, opt, callback) => {\n if (typeof opt === 'function') {\n callback = opt;\n opt = null;\n }\n\n const origOpt = { ...opt };\n opt = { ...marked.defaults, ...origOpt };\n const throwError = onError(opt.silent, opt.async, callback);\n\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n return throwError(new Error('marked(): input parameter is undefined or null'));\n }\n if (typeof src !== 'string') {\n return throwError(new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected'));\n }\n\n checkSanitizeDeprecation(opt);\n\n if (opt.hooks) {\n opt.hooks.options = opt;\n }\n\n if (callback) {\n const highlight = opt.highlight;\n let tokens;\n\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n tokens = lexer(src, opt);\n } catch (e) {\n return throwError(e);\n }\n\n const done = function(err) {\n let out;\n\n if (!err) {\n try {\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n out = parser(tokens, opt);\n if (opt.hooks) {\n out = opt.hooks.postprocess(out);\n }\n } catch (e) {\n err = e;\n }\n }\n\n opt.highlight = highlight;\n\n return err\n ? throwError(err)\n : callback(null, out);\n };\n\n if (!highlight || highlight.length < 3) {\n return done();\n }\n\n delete opt.highlight;\n\n if (!tokens.length) return done();\n\n let pending = 0;\n marked.walkTokens(tokens, function(token) {\n if (token.type === 'code') {\n pending++;\n setTimeout(() => {\n highlight(token.text, token.lang, function(err, code) {\n if (err) {\n return done(err);\n }\n if (code != null && code !== token.text) {\n token.text = code;\n token.escaped = true;\n }\n\n pending--;\n if (pending === 0) {\n done();\n }\n });\n }, 0);\n }\n });\n\n if (pending === 0) {\n done();\n }\n\n return;\n }\n\n if (opt.async) {\n return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src)\n .then(src => lexer(src, opt))\n .then(tokens => opt.walkTokens ? Promise.all(marked.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens)\n .then(tokens => parser(tokens, opt))\n .then(html => opt.hooks ? opt.hooks.postprocess(html) : html)\n .catch(throwError);\n }\n\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n const tokens = lexer(src, opt);\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n let html = parser(tokens, opt);\n if (opt.hooks) {\n html = opt.hooks.postprocess(html);\n }\n return html;\n } catch (e) {\n return throwError(e);\n }\n };\n}\n\n/**\n * Marked\n */\nfunction marked(src, opt, callback) {\n return parseMarkdown(Lexer.lex, Parser.parse)(src, opt, callback);\n}\n\n/**\n * Options\n */\n\nmarked.options =\nmarked.setOptions = function(opt) {\n marked.defaults = { ...marked.defaults, ...opt };\n changeDefaults(marked.defaults);\n return marked;\n};\n\nmarked.getDefaults = getDefaults;\n\nmarked.defaults = defaults;\n\n/**\n * Use Extension\n */\n\nmarked.use = function(...args) {\n const extensions = marked.defaults.extensions || { renderers: {}, childTokens: {} };\n\n args.forEach((pack) => {\n // copy options to new object\n const opts = { ...pack };\n\n // set async to true if it was set to true before\n opts.async = marked.defaults.async || opts.async || false;\n\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\n pack.extensions.forEach((ext) => {\n if (!ext.name) {\n throw new Error('extension name required');\n }\n if (ext.renderer) { // Renderer extensions\n const prevRenderer = extensions.renderers[ext.name];\n if (prevRenderer) {\n // Replace extension with func to run new extension but fall back if false\n extensions.renderers[ext.name] = function(...args) {\n let ret = ext.renderer.apply(this, args);\n if (ret === false) {\n ret = prevRenderer.apply(this, args);\n }\n return ret;\n };\n } else {\n extensions.renderers[ext.name] = ext.renderer;\n }\n }\n if (ext.tokenizer) { // Tokenizer Extensions\n if (!ext.level || (ext.level !== 'block' && ext.level !== 'inline')) {\n throw new Error(\"extension level must be 'block' or 'inline'\");\n }\n if (extensions[ext.level]) {\n extensions[ext.level].unshift(ext.tokenizer);\n } else {\n extensions[ext.level] = [ext.tokenizer];\n }\n if (ext.start) { // Function to check for start of token\n if (ext.level === 'block') {\n if (extensions.startBlock) {\n extensions.startBlock.push(ext.start);\n } else {\n extensions.startBlock = [ext.start];\n }\n } else if (ext.level === 'inline') {\n if (extensions.startInline) {\n extensions.startInline.push(ext.start);\n } else {\n extensions.startInline = [ext.start];\n }\n }\n }\n }\n if (ext.childTokens) { // Child tokens to be visited by walkTokens\n extensions.childTokens[ext.name] = ext.childTokens;\n }\n });\n opts.extensions = extensions;\n }\n\n // ==-- Parse \"overwrite\" extensions --== //\n if (pack.renderer) {\n const renderer = marked.defaults.renderer || new Renderer();\n for (const prop in pack.renderer) {\n const prevRenderer = renderer[prop];\n // Replace renderer with func to run extension, but fall back if false\n renderer[prop] = (...args) => {\n let ret = pack.renderer[prop].apply(renderer, args);\n if (ret === false) {\n ret = prevRenderer.apply(renderer, args);\n }\n return ret;\n };\n }\n opts.renderer = renderer;\n }\n if (pack.tokenizer) {\n const tokenizer = marked.defaults.tokenizer || new Tokenizer();\n for (const prop in pack.tokenizer) {\n const prevTokenizer = tokenizer[prop];\n // Replace tokenizer with func to run extension, but fall back if false\n tokenizer[prop] = (...args) => {\n let ret = pack.tokenizer[prop].apply(tokenizer, args);\n if (ret === false) {\n ret = prevTokenizer.apply(tokenizer, args);\n }\n return ret;\n };\n }\n opts.tokenizer = tokenizer;\n }\n\n // ==-- Parse Hooks extensions --== //\n if (pack.hooks) {\n const hooks = marked.defaults.hooks || new Hooks();\n for (const prop in pack.hooks) {\n const prevHook = hooks[prop];\n if (Hooks.passThroughHooks.has(prop)) {\n hooks[prop] = (arg) => {\n if (marked.defaults.async) {\n return Promise.resolve(pack.hooks[prop].call(hooks, arg)).then(ret => {\n return prevHook.call(hooks, ret);\n });\n }\n\n const ret = pack.hooks[prop].call(hooks, arg);\n return prevHook.call(hooks, ret);\n };\n } else {\n hooks[prop] = (...args) => {\n let ret = pack.hooks[prop].apply(hooks, args);\n if (ret === false) {\n ret = prevHook.apply(hooks, args);\n }\n return ret;\n };\n }\n }\n opts.hooks = hooks;\n }\n\n // ==-- Parse WalkTokens extensions --== //\n if (pack.walkTokens) {\n const walkTokens = marked.defaults.walkTokens;\n opts.walkTokens = function(token) {\n let values = [];\n values.push(pack.walkTokens.call(this, token));\n if (walkTokens) {\n values = values.concat(walkTokens.call(this, token));\n }\n return values;\n };\n }\n\n marked.setOptions(opts);\n });\n};\n\n/**\n * Run callback for every token\n */\n\nmarked.walkTokens = function(tokens, callback) {\n let values = [];\n for (const token of tokens) {\n values = values.concat(callback.call(marked, token));\n switch (token.type) {\n case 'table': {\n for (const cell of token.header) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n for (const row of token.rows) {\n for (const cell of row) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n }\n break;\n }\n case 'list': {\n values = values.concat(marked.walkTokens(token.items, callback));\n break;\n }\n default: {\n if (marked.defaults.extensions && marked.defaults.extensions.childTokens && marked.defaults.extensions.childTokens[token.type]) { // Walk any extensions\n marked.defaults.extensions.childTokens[token.type].forEach(function(childTokens) {\n values = values.concat(marked.walkTokens(token[childTokens], callback));\n });\n } else if (token.tokens) {\n values = values.concat(marked.walkTokens(token.tokens, callback));\n }\n }\n }\n }\n return values;\n};\n\n/**\n * Parse Inline\n * @param {string} src\n */\nmarked.parseInline = parseMarkdown(Lexer.lexInline, Parser.parseInline);\n\n/**\n * Expose\n */\nmarked.Parser = Parser;\nmarked.parser = Parser.parse;\nmarked.Renderer = Renderer;\nmarked.TextRenderer = TextRenderer;\nmarked.Lexer = Lexer;\nmarked.lexer = Lexer.lex;\nmarked.Tokenizer = Tokenizer;\nmarked.Slugger = Slugger;\nmarked.Hooks = Hooks;\nmarked.parse = marked;\n\nconst options = marked.options;\nconst setOptions = marked.setOptions;\nconst use = marked.use;\nconst walkTokens = marked.walkTokens;\nconst parseInline = marked.parseInline;\nconst parse = marked;\nconst parser = Parser.parse;\nconst lexer = Lexer.lex;\n\nexport { Hooks, Lexer, Parser, Renderer, Slugger, TextRenderer, Tokenizer, defaults, getDefaults, lexer, marked, options, parse, parseInline, parser, setOptions, use, walkTokens };\n","import { marked } from 'marked';\nexport function markdownToHtml(text: string): string {\n text = text.replaceAll(/__(.+)__/g, '$1'); // manually handle underlining\n text = marked.parse(text, { \n breaks: true, \n smartypants: true,\n });\n return text;\n}\n","
{word}
\n{/if}\n{#each $Language.Orthographies as ortho}\n {#if ortho.name !== 'Romanization' && ortho.display && (ortho.root === 'rom' || (ortho.lect in source.pronunciations))}\no.name === ortho.name).font}\n >{(()=>{\n const settings = parseRules($Language.Orthographies.find(o => o.name === ortho.name).rules);\n return applyRules(settings.rules, ortho.root === 'rom'? word : source.pronunciations[ortho.lect].ipa, settings.categories);\n })()}
\n {/if}\n{/each}\n\n","\n {Sense.lects.join(', ')}\n
\n {/if}\n{@html markdownToHtml(Sense.definition)}
\n {#if $Language.ShowInflection || showInflections}\n{entryAncestors}
\n {/if}\n {/each}\n{lect}
\nAdd new words on the left
\n {/each}\n\n {#if !!keys[0]} \n {!!keys[0]? keys.length : '0'} {(keys.length === 1 && !!keys[0])? 'Match' : 'Matches'}\n {:else} \n {Object.keys($Language.Lexicon).length} {Object.keys($Language.Lexicon).length === 1? 'Entry' : 'Entries'}\n {/if}\n
\nEntries
\n⦓ Internal ⦔
\nLexicon entries will appear here.
\n {/each}\n⦔ External ⦓
\nExternal-source etymology entries will appear here.
\n {/each}\nSelect an entry from the left to view and edit its etymology.
\n {/if}\nAncestors
\n{parent.name}
\n{parent.source}
\nThis entry has no ancestors.
\n {/each}\nDescendants
\n{child.name}
\n{child.source}
\nThis entry has no descendants.
\n {/each}\n {:else}\n {(()=>{\n console.log(tree);\n return ''\n })()}\n {/if}\n\n {@html markdownToHtml(\n language().Phrasebook[category()][phrase].description\n )}\n
\n {#if !!Object.keys(language().Phrasebook[category()][phrase].variants).length}\n⋲ ᴠᴀʀɪᴀɴᴛꜱ ⋺
\n {#each Array(Math.ceil(Object.keys(language().Phrasebook[category()][phrase].variants).length / 3)) as _, i}\n\n {@html markdownToHtml(\n language().Phrasebook[category()][phrase].variants[variant].description\n )}\n
\n\n Categories
\nCategories will appear here.
\n {/each}\n{lect}
\nCategory
\n \nClick the button below to add a variation for this phrase
\n {/each}\n \n{trial_completion}
\n{word}
\n${Lang().UseLects ? lect + ': ' : ''}${pronunciation.ipa}
`;\n });\n const senses = Lang().Lexicon[entry].Senses;\n senses.forEach(({ lects, definition, tags }, i) => {\n if (Lang().UseLects) text += `${lects.join(', ')}
`;\n text += `${markdownToHtml(definition)}
`;\n });\n if (current_column) {\n col2.innerHTML += `${entry}
${text}${entry}
${text}Document
\nSave your lexicon or open a previously saved one.
\n{loading_message}
\nExport and import your own copies of the lexicon file.
\nSelected location: {$Language.SaveLocation}
\n\n Lexicon Header Tags
\n\n Entries with these tags will be sorted separately at the top of the lexicon.\n
\nReference Language: {$referenceLanguage.Name}
\n \n {#if $Language.ShowEtymology}\n \n {/if}\n {/if}\n\n Evolve Language
\nExport Lexicon
\nHTML
\nImport Lexicon from CSV
\nImport Lexicon from Plain Text
\nCheck the Help tab to read about the plain text format Lexicanter can convert into lexicon entries.
\nAppearance Settings
Save Settings
If you wish, your files can be saved to an online database so that you can sync your files across multiple \n devices and the discord bot. To get your User ID and Key, please go to the Saturn's Sojourn discord server and use \n the command /account
.\n
Your ID and Key are saved to the app's internal settings, not to your file, but turning on uploading is saved per-file.
\nThis will overwrite the current file with the latest version of the file with the same name and User ID in the database.
\nLexicon Settings
Selected: {tag}
\n {#if !!tag}\n \n \n {/if}\nAdvanced Settings
{lect}
\n \n \n \n{relative}
\n \n{orthography.name}
\n\n Interested in testing the beta versions, talking about languages, or worldbuilding?
\n Join Saturn's Sojourn, \n the home of the Lexicanter on Discord!\n
\n Support the continued developement of the app as a patron,\n
\n\n or by buying me a coffee!\n
\n\nPatch 2.1.14
\n\n • Fixed a bug with the orthography pattern replacement features which caused it to only replace the first instance of a pattern in each word.
\n • Added the ability to use ^
or #
as word-end characters in the orthography pattern replacement fields.
\n • Fixed a reported bug with the Illegals field of the Advanced Phonotactics word generator which caused that field not to save its contents.
\n • Fixed a bug with database syncing which caused the setting to not save for files.\n • Files should now automatically detect when you have changes in the database on loading, and will prompt you to download the changes.\n
Patch 2.1.13
\n\n • Added an Illegals field to the Advanced Phonotactics word generator options.
\n • Added the Structures inputs to the Advanced Phonotactics word generator options and the corresponding syllable category syntax for this feature.
\n • (Finally) wrote the documentation on the word generator, which can be found in the Help tab.
\n
Patch 2.1.12
\n\n • Added a new default text to the Pronunciations field in the Phonology tab to better guide beginners.
\n • Added an indicator on entries in the lexicon tab to show if their pronunciation was manually edited and thus not automatically updated by pronunciation rules.
\n
Patch 2.1.11
\n\n • Added secondary location file saving, for those of you who want your lexicon files to save to another location on your computer every time you save.
\n • Added database syncing! Get your account credentials from the Lexicanter Discord bot, and then you can sync your files to the bot and between devices.
\n • A minor change to how app settings are saved. The old app settings files are now deprecated and will eventually no longer be supported.
\n
Patch 2.1.10
\n\n • New tooltips have been added throughout the app.
\n • New All Hallow's Eve 2023 theme in the Holiday collection!
\n
Patch 2.1.9
\n\n • Hot fix for a bug which caused data saved by the advanced word generator not to be loaded open re-opening a file.
\n • A new feature will be coming in 2.2 which requires a change to the way lexicon entries are formatted internally, which this update prepares for.
\n
New in 2.1
\n\n • Introduced a plain text import feature for convenient clonging on the move.
\n • Added a reference window for loading secondary files in read-only mode.
\n • Support for custom fonts via new Orthographies feature.
\n • Under-the-hood file structure adjustments and read logic improvements.
\n • New phonological evolution tools!
\n • An alternative type of word generator for more advanced syllable structures.
\n • The option to save theme preferences on a file-by-file basis.
\n • New themes: Magnolia by Saturnine, Crabapple by Maarz, and Eostre 2023 (a holiday theme released for beta users earlier this year).
\n • A number of bugs removed; probably some bugs added. Please report them if you find them!
\n
Patch 2.0.18
\n\n • By request, added a new dropdown to Tag inputs which allows you to select from pre-existing tags in your lexicon.
\n • By request, added a new Help tab. It hosts the same information as the wiki, but is accessible offline.
\n • The Settings, Changelog, and Help tabs, as well as the window control buttons, now use Material Icons. \n
\n
Patch 2.0.17
\n\n • Fixed an a reported bug with the inflections generation.
\n • Fixed an issue with tag searching.
\n • The font weight has been changed to an appropriate Book weight to improve readability on some systems and to many eyes.\n
\n
Patch 2.0.16
\n\n • Fixed a small bug with the new sound change engine.
\n
\n
Patch 2.0.15
\n\n • Fixed a reported bug with HTML export.
\n • Related to the above fix, technical limitations now prevent your theme from being exported with your HTML. Solutions are being investigated.\n
\n
Patch 2.0.14
\n\n • Fixed CSV export.
\n • Fixed a reported bug with HTML export.
\n • Fixed some reported and unreported issues with the sound change engine.
\n • There is now a text input designated for specifying categories for sound changes in an inflection group, to make everyone's life easier.
\n • Minor optimizations and performance improvements.\n
\n
Patch 2.0.13
\n\n • Linux support!\n
\n
Patch 2.0.12
\n\n • Fixed a reported bug which caused HTML export to fail. Expect expanded HTML export options in the future.
\n • Minor optimizations. \n
\n
Patch 2.0.11
\n\n • Fixed a reported bug which caused a semi-rare soft-crash in certain cases when dealing with multiple lects. Again.\n
\n
Patch 2.0.10
\n\n • Fixed a reported bug which caused a semi-rare soft-crash in certain cases when dealing with multiple lects.
\n • Fixed a reported bug which caused CSV import to fail, and improved CSV import options. \n
\n
Patch 2.0.9
\n\n • You can now write multple rules separated by a semicolon, which allows for multiple rules per table cell in the inflection tables.
\n • Fixed a reported bug which caused a soft crash when attempting to edit the last word in the lexicon if it had an inflections dropdown open.\n
\n
New in 2.0
\n\n • There is now a new sound change engine under the hood. Your old rules may no longer work; for assistance, you can contact the developer.
\n • Lexicon entries can now be separated into multiple Senses, each of which can have their own tags.
\n • There are new features accessible via new Advanced Settings. These include:
\n • New Lect features allow you to denote the ways your language may vary, particularly in semantics and pronunciation.
\n • New Inflection features, which include a new tab, which allows you to create inflectional paradigms for your language.
\n • New Etymology features, which include a new tab, allows you to create etymologies trees and view them in the lexicon.
\n • Check out the new wiki page \n or tutorial video for more in-depth information!
\n • New app icons by Lyiusa!
\n • New themes: Juniper by Saturnine, and Midnight and Bone by Maarz!\n
\n
Patch 1.11.4
\n\n • Fixed a reported bug causing markdown not to work in variant descriptions of phrases.\n
\n
Patch 1.11.3
\n\n • Fixed a reported bug causing the alphabetizer pre-check to send false alerts when certain combining diacritics on certain characters were in the alphabet in certain orders.\n
\n
Patch 1.11.2
\n\n • The app now saves backup versions of your files in case things go wrong.
\n • Fixed a reported bug that caused the app to sometimes exit too quickly and not save when autosave was enabled.\n
\n
Patch 1.11.1
\n\n • Fixed a reported bug causing the Ignore Diacritics setting to be ignored during alphabet checks when adding words to the lexicon.
\n
New in 1.11
\n\n • When you attempt to add a word to the lexicon, there is now an alert if the word contains characters (or polygraphs) not present in your alphabet.
\n • Fixed a reported bug causing external links in to not display correctly in the Lexicon tab specifically.
\n • Fixed a reported bug preventing the app from warning you that it will not save if there is no file name given.
\n • Fixed a minor bug with the Terminal theme when exported for HTML.
\n
New in 1.10
\n\n • Added three new themes: Pomegranate, Wisteria, and Terminal.
\n • The word entry panel in the Lexicon tab is now collapsible.
\n • The Phrasebook now has active overwrite protection to prevent you from deleting your work by mistake.
\n • You can now search for an exact whole-word match in definitions and tags fields by using !
as a prefix.
\n • For HTML exports, the appearance on mobile devices has been improved.
\n • Minor bug fixes for opening new windows from the File tab.
\n • Lots of uner-the-hood changes for the app's appearance in preparation for future features.
\n
Patch 1.9.5
\n\n • Fixed a bug causing app-quit to be impossible sometimes.
\n • Fixed some minor bugs with the styles.
\n • Fixed a bug causing monospace toggle in the docs tab to be undoable.
\n • Fixed a bug causing external hyperlinks not to use the preferred browser, and is some cases not open at all.
\n
Patch 1.9.4
\n\n • You can now hyperlink to entries in the lexicon. The link format is lex::word
.
\n • The documentation tab would previously not adjust to the width of the window. That has been fixed.
\n
New in 1.9
\n\n • Overhauled the Documentation tab, which now uses integrated EditorJS technology.
Markdown is no longer supported in this tab, \n in favor of the new WYSIWYG style with a toolbar visible when you highlight text.
\n • Note: The first time you load a file from an older version, there may be some formatting quirks. \n Most of these should sort themselves out after saving in the new version and re-loading. \n Please contact the developer if you run into persistent issues.
\n • Fixed a bug with the Open New Window button which caused it to fail to open new windows.
\n • The button to edit phrasebook entries has been change to right-click instead of left-click to\n make it more difficult to accidentally overwrite work in progress, and to allow for\n highlighting text.
\n • An HTML Docs-Only export option has been added.
\n
Patch 1.8.14
\n\n • Fixed a few minor bugs with markdown parsing.
\n • Added monospace markdown with ``this``
syntax.
\n • Fixed a reported bug which affected the orthography testing area.
\n
New in 1.8
\n\n • File storage has been migrated to make auto-save possible.
\n • Categories can now be defined and used in your Pronunciations rules. See the docs page for more info.
\n • Five new color themes: Light, Marine, Glade, Leatherbound, and Purple Maar (contributed by Maarz).
\n • You can now load in your own custom CSS color themes.
\n • Definitions, descriptions, and documentation sections now support simple markdown.
\n • There's a new space in the Phonology tab to test your pronunciation rules.
\n • Tag searches no longer require an exact match.
\n • Several minor bug fixes, including one reported about tables being editable in the HTML\n export.
\n
/
\n \n/
\nThe lexicon of {Language.Name} is empty.
\n {/each}\n{phones}
\n{inflection.tags.join(' ')}
/{inflection.filter}/
\n \n \n \n
\n \n {#each tabs as tab, i}\n\"+(l.trim()?l:s)+\"
\"),c=Object.keys(this.toolsTags).reduce((function(e,t){var n;return e[t.toLowerCase()]=null!==(n=d.toolsTags[t].sanitizationConfig)&&void 0!==n?n:{},e}),{}),u=Object.assign({},c,o.getAllInlineToolsSanitizeConfig(),{br:{}}),(f=(0,y.clean)(l,u)).trim()&&f.trim()!==s&&v.default.isHTMLString(f)){e.next=28;break}return e.next=26,this.processText(s);case 26:e.next=30;break;case 28:return e.next=30,this.processText(f,!0);case 30:case\"end\":return e.stop()}}),e,this,[[12,17]])}))),function(e){return h.apply(this,arguments)})},{key:\"processText\",value:(p=(0,l.default)(r.default.mark((function e(t){var n,o,i,a,s,c,u,f=this,d=arguments;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=d.length>1&&void 0!==d[1]&&d[1],o=this.Editor,i=o.Caret,a=o.BlockManager,(s=n?this.processHTML(t):this.processPlain(t)).length){e.next=5;break}return e.abrupt(\"return\");case 5:if(1!==s.length){e.next=8;break}return s[0].isBlock?this.processSingleBlock(s.pop()):this.processInlinePaste(s.pop()),e.abrupt(\"return\");case 8:c=a.currentBlock&&a.currentBlock.tool.isDefault,u=c&&a.currentBlock.isEmpty,s.map(function(){var e=(0,l.default)(r.default.mark((function e(t,n){return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt(\"return\",f.insertBlock(t,0===n&&u));case 1:case\"end\":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),a.currentBlock&&i.setToBlock(a.currentBlock,i.positions.END);case 12:case\"end\":return e.stop()}}),e,this)}))),function(e){return p.apply(this,arguments)})},{key:\"setCallback\",value:function(){this.listeners.on(this.Editor.UI.nodes.holder,\"paste\",this.handlePasteEvent)}},{key:\"unsetCallback\",value:function(){this.listeners.off(this.Editor.UI.nodes.holder,\"paste\",this.handlePasteEvent)}},{key:\"processTools\",value:function(){var e=this.Editor.Tools.blockTools;Array.from(e.values()).forEach(this.processTool)}},{key:\"collectTagNames\",value:function(e){return g.isString(e)?[e]:g.isObject(e)?Object.keys(e):[]}},{key:\"getTagsConfig\",value:function(e){var t=this,n=e.pasteConfig.tags||[],o=[];n.forEach((function(n){var r=t.collectTagNames(n);o.push.apply(o,(0,s.default)(r)),r.forEach((function(o){if(Object.prototype.hasOwnProperty.call(t.toolsTags,o))g.log(\"Paste handler for «\".concat(e.name,\"» Tool on «\").concat(o,\"» tag is skipped \")+\"because it is already used by «\".concat(t.toolsTags[o].tool.name,\"» Tool.\"),\"warn\");else{var r=g.isObject(n)?n[o]:null;t.toolsTags[o.toUpperCase()]={tool:e,sanitizationConfig:r}}}))})),this.tagsByTool[e.name]=o.map((function(e){return e.toUpperCase()}))}},{key:\"getFilesConfig\",value:function(e){var t=e.pasteConfig.files,n=void 0===t?{}:t,o=n.extensions,r=n.mimeTypes;(o||r)&&(o&&!Array.isArray(o)&&(g.log(\"«extensions» property of the onDrop config for «\".concat(e.name,\"» Tool should be an array\")),o=[]),r&&!Array.isArray(r)&&(g.log(\"«mimeTypes» property of the onDrop config for «\".concat(e.name,\"» Tool should be an array\")),r=[]),r&&(r=r.filter((function(t){return!!g.isValidMimeType(t)||(g.log(\"MIME type value «\".concat(t,\"» for the «\").concat(e.name,\"» Tool is not a valid MIME type\"),\"warn\"),!1)}))),this.toolsFiles[e.name]={extensions:o||[],mimeTypes:r||[]})}},{key:\"getPatternsConfig\",value:function(e){var t=this;e.pasteConfig.patterns&&!g.isEmpty(e.pasteConfig.patterns)&&Object.entries(e.pasteConfig.patterns).forEach((function(n){var o=(0,i.default)(n,2),r=o[0],a=o[1];a instanceof RegExp||g.log(\"Pattern \".concat(a,\" for «\").concat(e.name,\"» Tool is skipped because it should be a Regexp instance.\"),\"warn\"),t.toolsPatterns.push({key:r,pattern:a,tool:e})}))}},{key:\"isNativeBehaviour\",value:function(e){return v.default.isNativeInput(e)}},{key:\"processFiles\",value:(d=(0,l.default)(r.default.mark((function e(t){var n,o,i,a,s=this;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.Editor.BlockManager,e.next=3,Promise.all(Array.from(t).map((function(e){return s.processFile(e)})));case 3:o=(o=e.sent).filter((function(e){return!!e})),i=n.currentBlock.tool.isDefault,a=i&&n.currentBlock.isEmpty,o.forEach((function(e,t){n.paste(e.type,e.event,0===t&&a)}));case 8:case\"end\":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:\"processFile\",value:(a=(0,l.default)(r.default.mark((function e(t){var n,o,a,s,l;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=g.getFileExtension(t),o=Object.entries(this.toolsFiles).find((function(e){var o=(0,i.default)(e,2),r=(o[0],o[1]),a=r.mimeTypes,s=r.extensions,l=t.type.split(\"/\"),c=(0,i.default)(l,2),u=c[0],f=c[1],d=s.find((function(e){return e.toLowerCase()===n.toLowerCase()})),p=a.find((function(e){var t=e.split(\"/\"),n=(0,i.default)(t,2),o=n[0],r=n[1];return o===u&&(r===f||\"*\"===r)}));return!!d||!!p}))){e.next=4;break}return e.abrupt(\"return\");case 4:return a=(0,i.default)(o,1),s=a[0],l=this.composePasteEvent(\"file\",{file:t}),e.abrupt(\"return\",{event:l,type:s});case 7:case\"end\":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:\"processHTML\",value:function(e){var t=this,n=this.Editor.Tools,o=v.default.make(\"DIV\");return o.innerHTML=e,this.getNodes(o).map((function(e){var o,r=n.defaultTool,i=!1;switch(e.nodeType){case Node.DOCUMENT_FRAGMENT_NODE:(o=v.default.make(\"div\")).appendChild(e);break;case Node.ELEMENT_NODE:o=e,i=!0,t.toolsTags[o.tagName]&&(r=t.toolsTags[o.tagName].tool)}var a=r.pasteConfig.tags.reduce((function(e,n){return t.collectTagNames(n).forEach((function(t){var o=g.isObject(n)?n[t]:null;e[t.toLowerCase()]=o||{}})),e}),{}),s=Object.assign({},a,r.baseSanitizeConfig);if(\"table\"===o.tagName.toLowerCase()){var l=(0,y.clean)(o.outerHTML,s);o=v.default.make(\"div\",void 0,{innerHTML:l}).firstChild}else o.innerHTML=(0,y.clean)(o.innerHTML,s);var c=t.composePasteEvent(\"tag\",{data:o});return{content:o,isBlock:i,tool:r.name,event:c}})).filter((function(e){var t=v.default.isEmpty(e.content),n=v.default.isSingleTag(e.content);return!t||n}))}},{key:\"processPlain\",value:function(e){var t=this,n=this.config.defaultBlock;if(!e)return[];var o=n;return e.split(/\\r?\\n/).filter((function(e){return e.trim()})).map((function(e){var n=v.default.make(\"div\");n.textContent=e;var r=t.composePasteEvent(\"tag\",{data:n});return{content:n,tool:o,isBlock:!1,event:r}}))}},{key:\"processSingleBlock\",value:(o=(0,l.default)(r.default.mark((function e(t){var n,o,i,a;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.Editor,o=n.Caret,i=n.BlockManager,(a=i.currentBlock)&&t.tool===a.name&&v.default.containsOnlyInlineElements(t.content.innerHTML)){e.next=5;break}return this.insertBlock(t,(null==a?void 0:a.tool.isDefault)&&a.isEmpty),e.abrupt(\"return\");case 5:o.insertContentAtCaretPosition(t.content.innerHTML);case 6:case\"end\":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:\"processInlinePaste\",value:(n=(0,l.default)(r.default.mark((function e(t){var n,o,i,a,s,l,c,u;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.Editor,o=n.BlockManager,i=n.Caret,a=t.content,!(o.currentBlock&&o.currentBlock.tool.isDefault&&a.textContent.length\n {lect}\n \n {pronunciations[lect].ipa}\n {#if pronunciations[lect].irregular}\n \n \n {/if}\n
\n {/each}\n {:else}\n\n {pronunciations.General.ipa}\n {#if pronunciations.General.irregular}\n
\n {/if}\n{/if}\n","export { identity as linear } from '../internal/index.mjs';\n\n/*\nAdapted from https://github.com/mattdesl\nDistributed under MIT License https://github.com/mattdesl/eases/blob/master/LICENSE.md\n*/\nfunction backInOut(t) {\n const s = 1.70158 * 1.525;\n if ((t *= 2) < 1)\n return 0.5 * (t * t * ((s + 1) * t - s));\n return 0.5 * ((t -= 2) * t * ((s + 1) * t + s) + 2);\n}\nfunction backIn(t) {\n const s = 1.70158;\n return t * t * ((s + 1) * t - s);\n}\nfunction backOut(t) {\n const s = 1.70158;\n return --t * t * ((s + 1) * t + s) + 1;\n}\nfunction bounceOut(t) {\n const a = 4.0 / 11.0;\n const b = 8.0 / 11.0;\n const c = 9.0 / 10.0;\n const ca = 4356.0 / 361.0;\n const cb = 35442.0 / 1805.0;\n const cc = 16061.0 / 1805.0;\n const t2 = t * t;\n return t < a\n ? 7.5625 * t2\n : t < b\n ? 9.075 * t2 - 9.9 * t + 3.4\n : t < c\n ? ca * t2 - cb * t + cc\n : 10.8 * t * t - 20.52 * t + 10.72;\n}\nfunction bounceInOut(t) {\n return t < 0.5\n ? 0.5 * (1.0 - bounceOut(1.0 - t * 2.0))\n : 0.5 * bounceOut(t * 2.0 - 1.0) + 0.5;\n}\nfunction bounceIn(t) {\n return 1.0 - bounceOut(1.0 - t);\n}\nfunction circInOut(t) {\n if ((t *= 2) < 1)\n return -0.5 * (Math.sqrt(1 - t * t) - 1);\n return 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);\n}\nfunction circIn(t) {\n return 1.0 - Math.sqrt(1.0 - t * t);\n}\nfunction circOut(t) {\n return Math.sqrt(1 - --t * t);\n}\nfunction cubicInOut(t) {\n return t < 0.5 ? 4.0 * t * t * t : 0.5 * Math.pow(2.0 * t - 2.0, 3.0) + 1.0;\n}\nfunction cubicIn(t) {\n return t * t * t;\n}\nfunction cubicOut(t) {\n const f = t - 1.0;\n return f * f * f + 1.0;\n}\nfunction elasticInOut(t) {\n return t < 0.5\n ? 0.5 *\n Math.sin(((+13.0 * Math.PI) / 2) * 2.0 * t) *\n Math.pow(2.0, 10.0 * (2.0 * t - 1.0))\n : 0.5 *\n Math.sin(((-13.0 * Math.PI) / 2) * (2.0 * t - 1.0 + 1.0)) *\n Math.pow(2.0, -10.0 * (2.0 * t - 1.0)) +\n 1.0;\n}\nfunction elasticIn(t) {\n return Math.sin((13.0 * t * Math.PI) / 2) * Math.pow(2.0, 10.0 * (t - 1.0));\n}\nfunction elasticOut(t) {\n return (Math.sin((-13.0 * (t + 1.0) * Math.PI) / 2) * Math.pow(2.0, -10.0 * t) + 1.0);\n}\nfunction expoInOut(t) {\n return t === 0.0 || t === 1.0\n ? t\n : t < 0.5\n ? +0.5 * Math.pow(2.0, 20.0 * t - 10.0)\n : -0.5 * Math.pow(2.0, 10.0 - t * 20.0) + 1.0;\n}\nfunction expoIn(t) {\n return t === 0.0 ? t : Math.pow(2.0, 10.0 * (t - 1.0));\n}\nfunction expoOut(t) {\n return t === 1.0 ? t : 1.0 - Math.pow(2.0, -10.0 * t);\n}\nfunction quadInOut(t) {\n t /= 0.5;\n if (t < 1)\n return 0.5 * t * t;\n t--;\n return -0.5 * (t * (t - 2) - 1);\n}\nfunction quadIn(t) {\n return t * t;\n}\nfunction quadOut(t) {\n return -t * (t - 2.0);\n}\nfunction quartInOut(t) {\n return t < 0.5\n ? +8.0 * Math.pow(t, 4.0)\n : -8.0 * Math.pow(t - 1.0, 4.0) + 1.0;\n}\nfunction quartIn(t) {\n return Math.pow(t, 4.0);\n}\nfunction quartOut(t) {\n return Math.pow(t - 1.0, 3.0) * (1.0 - t) + 1.0;\n}\nfunction quintInOut(t) {\n if ((t *= 2) < 1)\n return 0.5 * t * t * t * t * t;\n return 0.5 * ((t -= 2) * t * t * t * t + 2);\n}\nfunction quintIn(t) {\n return t * t * t * t * t;\n}\nfunction quintOut(t) {\n return --t * t * t * t * t + 1;\n}\nfunction sineInOut(t) {\n return -0.5 * (Math.cos(Math.PI * t) - 1);\n}\nfunction sineIn(t) {\n const v = Math.cos(t * Math.PI * 0.5);\n if (Math.abs(v) < 1e-14)\n return 1;\n else\n return 1 - v;\n}\nfunction sineOut(t) {\n return Math.sin((t * Math.PI) / 2);\n}\n\nexport { backIn, backInOut, backOut, bounceIn, bounceInOut, bounceOut, circIn, circInOut, circOut, cubicIn, cubicInOut, cubicOut, elasticIn, elasticInOut, elasticOut, expoIn, expoInOut, expoOut, quadIn, quadInOut, quadOut, quartIn, quartInOut, quartOut, quintIn, quintInOut, quintOut, sineIn, sineInOut, sineOut };\n","import { cubicInOut, linear, cubicOut } from '../easing/index.mjs';\nimport { is_function, assign } from '../internal/index.mjs';\n\n/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\n\nfunction blur(node, { delay = 0, duration = 400, easing = cubicInOut, amount = 5, opacity = 0 } = {}) {\n const style = getComputedStyle(node);\n const target_opacity = +style.opacity;\n const f = style.filter === 'none' ? '' : style.filter;\n const od = target_opacity * (1 - opacity);\n return {\n delay,\n duration,\n easing,\n css: (_t, u) => `opacity: ${target_opacity - (od * u)}; filter: ${f} blur(${u * amount}px);`\n };\n}\nfunction fade(node, { delay = 0, duration = 400, easing = linear } = {}) {\n const o = +getComputedStyle(node).opacity;\n return {\n delay,\n duration,\n easing,\n css: t => `opacity: ${t * o}`\n };\n}\nfunction fly(node, { delay = 0, duration = 400, easing = cubicOut, x = 0, y = 0, opacity = 0 } = {}) {\n const style = getComputedStyle(node);\n const target_opacity = +style.opacity;\n const transform = style.transform === 'none' ? '' : style.transform;\n const od = target_opacity * (1 - opacity);\n return {\n delay,\n duration,\n easing,\n css: (t, u) => `\n\t\t\ttransform: ${transform} translate(${(1 - t) * x}px, ${(1 - t) * y}px);\n\t\t\topacity: ${target_opacity - (od * u)}`\n };\n}\nfunction slide(node, { delay = 0, duration = 400, easing = cubicOut } = {}) {\n const style = getComputedStyle(node);\n const opacity = +style.opacity;\n const height = parseFloat(style.height);\n const padding_top = parseFloat(style.paddingTop);\n const padding_bottom = parseFloat(style.paddingBottom);\n const margin_top = parseFloat(style.marginTop);\n const margin_bottom = parseFloat(style.marginBottom);\n const border_top_width = parseFloat(style.borderTopWidth);\n const border_bottom_width = parseFloat(style.borderBottomWidth);\n return {\n delay,\n duration,\n easing,\n css: t => 'overflow: hidden;' +\n `opacity: ${Math.min(t * 20, 1) * opacity};` +\n `height: ${t * height}px;` +\n `padding-top: ${t * padding_top}px;` +\n `padding-bottom: ${t * padding_bottom}px;` +\n `margin-top: ${t * margin_top}px;` +\n `margin-bottom: ${t * margin_bottom}px;` +\n `border-top-width: ${t * border_top_width}px;` +\n `border-bottom-width: ${t * border_bottom_width}px;`\n };\n}\nfunction scale(node, { delay = 0, duration = 400, easing = cubicOut, start = 0, opacity = 0 } = {}) {\n const style = getComputedStyle(node);\n const target_opacity = +style.opacity;\n const transform = style.transform === 'none' ? '' : style.transform;\n const sd = 1 - start;\n const od = target_opacity * (1 - opacity);\n return {\n delay,\n duration,\n easing,\n css: (_t, u) => `\n\t\t\ttransform: ${transform} scale(${1 - (sd * u)});\n\t\t\topacity: ${target_opacity - (od * u)}\n\t\t`\n };\n}\nfunction draw(node, { delay = 0, speed, duration, easing = cubicInOut } = {}) {\n let len = node.getTotalLength();\n const style = getComputedStyle(node);\n if (style.strokeLinecap !== 'butt') {\n len += parseInt(style.strokeWidth);\n }\n if (duration === undefined) {\n if (speed === undefined) {\n duration = 800;\n }\n else {\n duration = len / speed;\n }\n }\n else if (typeof duration === 'function') {\n duration = duration(len);\n }\n return {\n delay,\n duration,\n easing,\n css: (_, u) => `\n\t\t\tstroke-dasharray: ${len};\n\t\t\tstroke-dashoffset: ${u * len};\n\t\t`\n };\n}\nfunction crossfade(_a) {\n var { fallback } = _a, defaults = __rest(_a, [\"fallback\"]);\n const to_receive = new Map();\n const to_send = new Map();\n function crossfade(from, node, params) {\n const { delay = 0, duration = d => Math.sqrt(d) * 30, easing = cubicOut } = assign(assign({}, defaults), params);\n const to = node.getBoundingClientRect();\n const dx = from.left - to.left;\n const dy = from.top - to.top;\n const dw = from.width / to.width;\n const dh = from.height / to.height;\n const d = Math.sqrt(dx * dx + dy * dy);\n const style = getComputedStyle(node);\n const transform = style.transform === 'none' ? '' : style.transform;\n const opacity = +style.opacity;\n return {\n delay,\n duration: is_function(duration) ? duration(d) : duration,\n easing,\n css: (t, u) => `\n\t\t\t\topacity: ${t * opacity};\n\t\t\t\ttransform-origin: top left;\n\t\t\t\ttransform: ${transform} translate(${u * dx}px,${u * dy}px) scale(${t + (1 - t) * dw}, ${t + (1 - t) * dh});\n\t\t\t`\n };\n }\n function transition(items, counterparts, intro) {\n return (node, params) => {\n items.set(params.key, {\n rect: node.getBoundingClientRect()\n });\n return () => {\n if (counterparts.has(params.key)) {\n const { rect } = counterparts.get(params.key);\n counterparts.delete(params.key);\n return crossfade(rect, node, params);\n }\n // if the node is disappearing altogether\n // (i.e. wasn't claimed by the other list)\n // then we need to supply an outro\n items.delete(params.key);\n return fallback && fallback(node, params, intro);\n };\n };\n }\n return [\n transition(to_send, to_receive, false),\n transition(to_receive, to_send, true)\n ];\n}\n\nexport { blur, crossfade, draw, fade, fly, scale, slide };\n","\n\n{#if data[0]}\n \n {#if show && !$hideDropdowns}\n \n {/if}\n{@html cell} | \n {/each}\n
{@html block.data.text}
\n {/if}\n {/each}\n'\n + (escaped ? code : escape(code, true))\n + '
\\n';\n }\n\n return ''\n + (escaped ? code : escape(code, true))\n + '
\\n';\n }\n\n /**\n * @param {string} quote\n */\n blockquote(quote) {\n return `\\n${quote}\\n`;\n }\n\n html(html) {\n return html;\n }\n\n /**\n * @param {string} text\n * @param {string} level\n * @param {string} raw\n * @param {any} slugger\n */\n heading(text, level, raw, slugger) {\n if (this.options.headerIds) {\n const id = this.options.headerPrefix + slugger.slug(raw);\n return `
${text}
\\n`;\n }\n\n /**\n * @param {string} header\n * @param {string} body\n */\n table(header, body) {\n if (body) body = `${body}`;\n\n return '${text}
`;\n }\n\n br() {\n return this.options.xhtml ? 'An error occurred:
'\n + escape(e.message + '', true)\n + '';\n if (async) {\n return Promise.resolve(msg);\n }\n if (callback) {\n callback(null, msg);\n return;\n }\n return msg;\n }\n\n if (async) {\n return Promise.reject(e);\n }\n if (callback) {\n callback(e);\n return;\n }\n throw e;\n };\n}\n\nfunction parseMarkdown(lexer, parser) {\n return (src, opt, callback) => {\n if (typeof opt === 'function') {\n callback = opt;\n opt = null;\n }\n\n const origOpt = { ...opt };\n opt = { ...marked.defaults, ...origOpt };\n const throwError = onError(opt.silent, opt.async, callback);\n\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n return throwError(new Error('marked(): input parameter is undefined or null'));\n }\n if (typeof src !== 'string') {\n return throwError(new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected'));\n }\n\n checkSanitizeDeprecation(opt);\n\n if (opt.hooks) {\n opt.hooks.options = opt;\n }\n\n if (callback) {\n const highlight = opt.highlight;\n let tokens;\n\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n tokens = lexer(src, opt);\n } catch (e) {\n return throwError(e);\n }\n\n const done = function(err) {\n let out;\n\n if (!err) {\n try {\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n out = parser(tokens, opt);\n if (opt.hooks) {\n out = opt.hooks.postprocess(out);\n }\n } catch (e) {\n err = e;\n }\n }\n\n opt.highlight = highlight;\n\n return err\n ? throwError(err)\n : callback(null, out);\n };\n\n if (!highlight || highlight.length < 3) {\n return done();\n }\n\n delete opt.highlight;\n\n if (!tokens.length) return done();\n\n let pending = 0;\n marked.walkTokens(tokens, function(token) {\n if (token.type === 'code') {\n pending++;\n setTimeout(() => {\n highlight(token.text, token.lang, function(err, code) {\n if (err) {\n return done(err);\n }\n if (code != null && code !== token.text) {\n token.text = code;\n token.escaped = true;\n }\n\n pending--;\n if (pending === 0) {\n done();\n }\n });\n }, 0);\n }\n });\n\n if (pending === 0) {\n done();\n }\n\n return;\n }\n\n if (opt.async) {\n return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src)\n .then(src => lexer(src, opt))\n .then(tokens => opt.walkTokens ? Promise.all(marked.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens)\n .then(tokens => parser(tokens, opt))\n .then(html => opt.hooks ? opt.hooks.postprocess(html) : html)\n .catch(throwError);\n }\n\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src);\n }\n const tokens = lexer(src, opt);\n if (opt.walkTokens) {\n marked.walkTokens(tokens, opt.walkTokens);\n }\n let html = parser(tokens, opt);\n if (opt.hooks) {\n html = opt.hooks.postprocess(html);\n }\n return html;\n } catch (e) {\n return throwError(e);\n }\n };\n}\n\n/**\n * Marked\n */\nfunction marked(src, opt, callback) {\n return parseMarkdown(Lexer.lex, Parser.parse)(src, opt, callback);\n}\n\n/**\n * Options\n */\n\nmarked.options =\nmarked.setOptions = function(opt) {\n marked.defaults = { ...marked.defaults, ...opt };\n changeDefaults(marked.defaults);\n return marked;\n};\n\nmarked.getDefaults = getDefaults;\n\nmarked.defaults = defaults;\n\n/**\n * Use Extension\n */\n\nmarked.use = function(...args) {\n const extensions = marked.defaults.extensions || { renderers: {}, childTokens: {} };\n\n args.forEach((pack) => {\n // copy options to new object\n const opts = { ...pack };\n\n // set async to true if it was set to true before\n opts.async = marked.defaults.async || opts.async || false;\n\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\n pack.extensions.forEach((ext) => {\n if (!ext.name) {\n throw new Error('extension name required');\n }\n if (ext.renderer) { // Renderer extensions\n const prevRenderer = extensions.renderers[ext.name];\n if (prevRenderer) {\n // Replace extension with func to run new extension but fall back if false\n extensions.renderers[ext.name] = function(...args) {\n let ret = ext.renderer.apply(this, args);\n if (ret === false) {\n ret = prevRenderer.apply(this, args);\n }\n return ret;\n };\n } else {\n extensions.renderers[ext.name] = ext.renderer;\n }\n }\n if (ext.tokenizer) { // Tokenizer Extensions\n if (!ext.level || (ext.level !== 'block' && ext.level !== 'inline')) {\n throw new Error(\"extension level must be 'block' or 'inline'\");\n }\n if (extensions[ext.level]) {\n extensions[ext.level].unshift(ext.tokenizer);\n } else {\n extensions[ext.level] = [ext.tokenizer];\n }\n if (ext.start) { // Function to check for start of token\n if (ext.level === 'block') {\n if (extensions.startBlock) {\n extensions.startBlock.push(ext.start);\n } else {\n extensions.startBlock = [ext.start];\n }\n } else if (ext.level === 'inline') {\n if (extensions.startInline) {\n extensions.startInline.push(ext.start);\n } else {\n extensions.startInline = [ext.start];\n }\n }\n }\n }\n if (ext.childTokens) { // Child tokens to be visited by walkTokens\n extensions.childTokens[ext.name] = ext.childTokens;\n }\n });\n opts.extensions = extensions;\n }\n\n // ==-- Parse \"overwrite\" extensions --== //\n if (pack.renderer) {\n const renderer = marked.defaults.renderer || new Renderer();\n for (const prop in pack.renderer) {\n const prevRenderer = renderer[prop];\n // Replace renderer with func to run extension, but fall back if false\n renderer[prop] = (...args) => {\n let ret = pack.renderer[prop].apply(renderer, args);\n if (ret === false) {\n ret = prevRenderer.apply(renderer, args);\n }\n return ret;\n };\n }\n opts.renderer = renderer;\n }\n if (pack.tokenizer) {\n const tokenizer = marked.defaults.tokenizer || new Tokenizer();\n for (const prop in pack.tokenizer) {\n const prevTokenizer = tokenizer[prop];\n // Replace tokenizer with func to run extension, but fall back if false\n tokenizer[prop] = (...args) => {\n let ret = pack.tokenizer[prop].apply(tokenizer, args);\n if (ret === false) {\n ret = prevTokenizer.apply(tokenizer, args);\n }\n return ret;\n };\n }\n opts.tokenizer = tokenizer;\n }\n\n // ==-- Parse Hooks extensions --== //\n if (pack.hooks) {\n const hooks = marked.defaults.hooks || new Hooks();\n for (const prop in pack.hooks) {\n const prevHook = hooks[prop];\n if (Hooks.passThroughHooks.has(prop)) {\n hooks[prop] = (arg) => {\n if (marked.defaults.async) {\n return Promise.resolve(pack.hooks[prop].call(hooks, arg)).then(ret => {\n return prevHook.call(hooks, ret);\n });\n }\n\n const ret = pack.hooks[prop].call(hooks, arg);\n return prevHook.call(hooks, ret);\n };\n } else {\n hooks[prop] = (...args) => {\n let ret = pack.hooks[prop].apply(hooks, args);\n if (ret === false) {\n ret = prevHook.apply(hooks, args);\n }\n return ret;\n };\n }\n }\n opts.hooks = hooks;\n }\n\n // ==-- Parse WalkTokens extensions --== //\n if (pack.walkTokens) {\n const walkTokens = marked.defaults.walkTokens;\n opts.walkTokens = function(token) {\n let values = [];\n values.push(pack.walkTokens.call(this, token));\n if (walkTokens) {\n values = values.concat(walkTokens.call(this, token));\n }\n return values;\n };\n }\n\n marked.setOptions(opts);\n });\n};\n\n/**\n * Run callback for every token\n */\n\nmarked.walkTokens = function(tokens, callback) {\n let values = [];\n for (const token of tokens) {\n values = values.concat(callback.call(marked, token));\n switch (token.type) {\n case 'table': {\n for (const cell of token.header) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n for (const row of token.rows) {\n for (const cell of row) {\n values = values.concat(marked.walkTokens(cell.tokens, callback));\n }\n }\n break;\n }\n case 'list': {\n values = values.concat(marked.walkTokens(token.items, callback));\n break;\n }\n default: {\n if (marked.defaults.extensions && marked.defaults.extensions.childTokens && marked.defaults.extensions.childTokens[token.type]) { // Walk any extensions\n marked.defaults.extensions.childTokens[token.type].forEach(function(childTokens) {\n values = values.concat(marked.walkTokens(token[childTokens], callback));\n });\n } else if (token.tokens) {\n values = values.concat(marked.walkTokens(token.tokens, callback));\n }\n }\n }\n }\n return values;\n};\n\n/**\n * Parse Inline\n * @param {string} src\n */\nmarked.parseInline = parseMarkdown(Lexer.lexInline, Parser.parseInline);\n\n/**\n * Expose\n */\nmarked.Parser = Parser;\nmarked.parser = Parser.parse;\nmarked.Renderer = Renderer;\nmarked.TextRenderer = TextRenderer;\nmarked.Lexer = Lexer;\nmarked.lexer = Lexer.lex;\nmarked.Tokenizer = Tokenizer;\nmarked.Slugger = Slugger;\nmarked.Hooks = Hooks;\nmarked.parse = marked;\n\nconst options = marked.options;\nconst setOptions = marked.setOptions;\nconst use = marked.use;\nconst walkTokens = marked.walkTokens;\nconst parseInline = marked.parseInline;\nconst parse = marked;\nconst parser = Parser.parse;\nconst lexer = Lexer.lex;\n\nexport { Hooks, Lexer, Parser, Renderer, Slugger, TextRenderer, Tokenizer, defaults, getDefaults, lexer, marked, options, parse, parseInline, parser, setOptions, use, walkTokens };\n","import { marked } from 'marked';\nexport function markdownToHtml(text: string): string {\n text = text.replaceAll(/__(.+)__/g, '$1'); // manually handle underlining\n text = marked.parse(text, { \n breaks: true, \n smartypants: true,\n });\n return text;\n}\n","
{word}
\n{/if}\n{#each $Language.Orthographies as ortho}\n {#if ortho.name !== 'Romanization' && ortho.display && (ortho.root === 'rom' || (ortho.lect in source.pronunciations))}\no.name === ortho.name).font}\n >{(()=>{\n const settings = parseRules($Language.Orthographies.find(o => o.name === ortho.name).rules);\n return applyRules(settings.rules, ortho.root === 'rom'? word : source.pronunciations[ortho.lect].ipa, settings.categories);\n })()}
\n {/if}\n{/each}\n\n","\n {Sense.lects.join(', ')}\n
\n {/if}\n{@html markdownToHtml(Sense.definition)}
\n {#if $Language.ShowInflection || showInflections}\n{entryAncestors}
\n {/if}\n {/each}\n{lect}
\nAdd new words on the left
\n {/each}\n\n {#if !!keys[0]} \n {!!keys[0]? keys.length : '0'} {(keys.length === 1 && !!keys[0])? 'Match' : 'Matches'}\n {:else} \n {Object.keys($Language.Lexicon).length} {Object.keys($Language.Lexicon).length === 1? 'Entry' : 'Entries'}\n {/if}\n
\nEntries
\n⦓ Internal ⦔
\nLexicon entries will appear here.
\n {/each}\n⦔ External ⦓
\nExternal-source etymology entries will appear here.
\n {/each}\nSelect an entry from the left to view and edit its etymology.
\n {/if}\nAncestors
\n{parent.name}
\n{parent.source}
\nThis entry has no ancestors.
\n {/each}\nDescendants
\n{child.name}
\n{child.source}
\nThis entry has no descendants.
\n {/each}\n {:else}\n {(()=>{\n console.log(tree);\n return ''\n })()}\n {/if}\n\n {@html markdownToHtml(\n language().Phrasebook[category()][phrase].description\n )}\n
\n {#if !!Object.keys(language().Phrasebook[category()][phrase].variants).length}\n⋲ ᴠᴀʀɪᴀɴᴛꜱ ⋺
\n {#each Array(Math.ceil(Object.keys(language().Phrasebook[category()][phrase].variants).length / 3)) as _, i}\n\n {@html markdownToHtml(\n language().Phrasebook[category()][phrase].variants[variant].description\n )}\n
\n\n Categories
\nCategories will appear here.
\n {/each}\n{lect}
\nCategory
\n \nClick the button below to add a variation for this phrase
\n {/each}\n \n{trial_completion}
\n{word}
\n${Lang().UseLects ? lect + ': ' : ''}${pronunciation.ipa}
`;\n });\n const senses = Lang().Lexicon[entry].Senses;\n senses.forEach(({ lects, definition, tags }, i) => {\n if (Lang().UseLects) text += `${lects.join(', ')}
`;\n text += `${markdownToHtml(definition)}
`;\n });\n if (current_column) {\n col2.innerHTML += `${entry}
${text}${entry}
${text}Document
\nSave your lexicon or open a previously saved one.
\n{loading_message}
\nExport and import your own copies of the lexicon file.
\nSelected location: {$Language.SaveLocation}
\n\n Lexicon Header Tags
\n\n Entries with these tags will be sorted separately at the top of the lexicon.\n
\nReference Language: {$referenceLanguage.Name}
\n \n {#if $Language.ShowEtymology}\n \n {/if}\n {/if}\n\n Evolve Language
\nExport Lexicon
\nHTML
\nImport Lexicon from CSV
\nImport Lexicon from Plain Text
\nCheck the Help tab to read about the plain text format Lexicanter can convert into lexicon entries.
\nAppearance Settings
Save Settings
If you wish, your files can be saved to an online database so that you can sync your files across multiple \n devices and the discord bot. To get your User ID and Key, please go to the Saturn's Sojourn discord server and use \n the command /account
.\n
Your ID and Key are saved to the app's internal settings, not to your file, but turning on uploading is saved per-file.
\nThis will overwrite the current file with the latest version of the file with the same name and User ID in the database.
\nLexicon Settings
Selected: {tag}
\n {#if !!tag}\n \n \n {/if}\nAdvanced Settings
{lect}
\n \n \n \n{relative}
\n \n{orthography.name}
\n\n Interested in testing the beta versions, talking about languages, or worldbuilding?
\n Join Saturn's Sojourn, \n the home of the Lexicanter on Discord!\n
\n Support the continued developement of the app as a patron,\n
\n\n or by buying me a coffee!\n
\n\nPatch 2.1.15
\n\n • Fixed a reported bug which caused the search fields in the lexicon and phrasebook to find no matches in certain cases.\n
\n\nPatch 2.1.14
\n\n • Fixed a bug with the orthography pattern replacement features which caused it to only replace the first instance of a pattern in each word.
\n • Added the ability to use ^
or #
as word-end characters in the orthography pattern replacement fields.
\n • Fixed a reported bug with the Illegals field of the Advanced Phonotactics word generator which caused that field not to save its contents.
\n • Fixed a bug with database syncing which caused the setting to not save for files.
\n • Files should now automatically detect when you have changes in the database on loading, and will prompt you to download the changes.
\n
Patch 2.1.13
\n\n • Added an Illegals field to the Advanced Phonotactics word generator options.
\n • Added the Structures inputs to the Advanced Phonotactics word generator options and the corresponding syllable category syntax for this feature.
\n • (Finally) wrote the documentation on the word generator, which can be found in the Help tab.
\n
Patch 2.1.12
\n\n • Added a new default text to the Pronunciations field in the Phonology tab to better guide beginners.
\n • Added an indicator on entries in the lexicon tab to show if their pronunciation was manually edited and thus not automatically updated by pronunciation rules.
\n
Patch 2.1.11
\n\n • Added secondary location file saving, for those of you who want your lexicon files to save to another location on your computer every time you save.
\n • Added database syncing! Get your account credentials from the Lexicanter Discord bot, and then you can sync your files to the bot and between devices.
\n • A minor change to how app settings are saved. The old app settings files are now deprecated and will eventually no longer be supported.
\n
Patch 2.1.10
\n\n • New tooltips have been added throughout the app.
\n • New All Hallow's Eve 2023 theme in the Holiday collection!
\n
Patch 2.1.9
\n\n • Hot fix for a bug which caused data saved by the advanced word generator not to be loaded open re-opening a file.
\n • A new feature will be coming in 2.2 which requires a change to the way lexicon entries are formatted internally, which this update prepares for.
\n
New in 2.1
\n\n • Introduced a plain text import feature for convenient clonging on the move.
\n • Added a reference window for loading secondary files in read-only mode.
\n • Support for custom fonts via new Orthographies feature.
\n • Under-the-hood file structure adjustments and read logic improvements.
\n • New phonological evolution tools!
\n • An alternative type of word generator for more advanced syllable structures.
\n • The option to save theme preferences on a file-by-file basis.
\n • New themes: Magnolia by Saturnine, Crabapple by Maarz, and Eostre 2023 (a holiday theme released for beta users earlier this year).
\n • A number of bugs removed; probably some bugs added. Please report them if you find them!
\n
Patch 2.0.18
\n\n • By request, added a new dropdown to Tag inputs which allows you to select from pre-existing tags in your lexicon.
\n • By request, added a new Help tab. It hosts the same information as the wiki, but is accessible offline.
\n • The Settings, Changelog, and Help tabs, as well as the window control buttons, now use Material Icons. \n
\n
Patch 2.0.17
\n\n • Fixed an a reported bug with the inflections generation.
\n • Fixed an issue with tag searching.
\n • The font weight has been changed to an appropriate Book weight to improve readability on some systems and to many eyes.\n
\n
Patch 2.0.16
\n\n • Fixed a small bug with the new sound change engine.
\n
\n
Patch 2.0.15
\n\n • Fixed a reported bug with HTML export.
\n • Related to the above fix, technical limitations now prevent your theme from being exported with your HTML. Solutions are being investigated.\n
\n
Patch 2.0.14
\n\n • Fixed CSV export.
\n • Fixed a reported bug with HTML export.
\n • Fixed some reported and unreported issues with the sound change engine.
\n • There is now a text input designated for specifying categories for sound changes in an inflection group, to make everyone's life easier.
\n • Minor optimizations and performance improvements.\n
\n
Patch 2.0.13
\n\n • Linux support!\n
\n
Patch 2.0.12
\n\n • Fixed a reported bug which caused HTML export to fail. Expect expanded HTML export options in the future.
\n • Minor optimizations. \n
\n
Patch 2.0.11
\n\n • Fixed a reported bug which caused a semi-rare soft-crash in certain cases when dealing with multiple lects. Again.\n
\n
Patch 2.0.10
\n\n • Fixed a reported bug which caused a semi-rare soft-crash in certain cases when dealing with multiple lects.
\n • Fixed a reported bug which caused CSV import to fail, and improved CSV import options. \n
\n
Patch 2.0.9
\n\n • You can now write multple rules separated by a semicolon, which allows for multiple rules per table cell in the inflection tables.
\n • Fixed a reported bug which caused a soft crash when attempting to edit the last word in the lexicon if it had an inflections dropdown open.\n
\n
New in 2.0
\n\n • There is now a new sound change engine under the hood. Your old rules may no longer work; for assistance, you can contact the developer.
\n • Lexicon entries can now be separated into multiple Senses, each of which can have their own tags.
\n • There are new features accessible via new Advanced Settings. These include:
\n • New Lect features allow you to denote the ways your language may vary, particularly in semantics and pronunciation.
\n • New Inflection features, which include a new tab, which allows you to create inflectional paradigms for your language.
\n • New Etymology features, which include a new tab, allows you to create etymologies trees and view them in the lexicon.
\n • Check out the new wiki page \n or tutorial video for more in-depth information!
\n • New app icons by Lyiusa!
\n • New themes: Juniper by Saturnine, and Midnight and Bone by Maarz!\n
\n
Patch 1.11.4
\n\n • Fixed a reported bug causing markdown not to work in variant descriptions of phrases.\n
\n
Patch 1.11.3
\n\n • Fixed a reported bug causing the alphabetizer pre-check to send false alerts when certain combining diacritics on certain characters were in the alphabet in certain orders.\n
\n
Patch 1.11.2
\n\n • The app now saves backup versions of your files in case things go wrong.
\n • Fixed a reported bug that caused the app to sometimes exit too quickly and not save when autosave was enabled.\n
\n
Patch 1.11.1
\n\n • Fixed a reported bug causing the Ignore Diacritics setting to be ignored during alphabet checks when adding words to the lexicon.
\n
New in 1.11
\n\n • When you attempt to add a word to the lexicon, there is now an alert if the word contains characters (or polygraphs) not present in your alphabet.
\n • Fixed a reported bug causing external links in to not display correctly in the Lexicon tab specifically.
\n • Fixed a reported bug preventing the app from warning you that it will not save if there is no file name given.
\n • Fixed a minor bug with the Terminal theme when exported for HTML.
\n
New in 1.10
\n\n • Added three new themes: Pomegranate, Wisteria, and Terminal.
\n • The word entry panel in the Lexicon tab is now collapsible.
\n • The Phrasebook now has active overwrite protection to prevent you from deleting your work by mistake.
\n • You can now search for an exact whole-word match in definitions and tags fields by using !
as a prefix.
\n • For HTML exports, the appearance on mobile devices has been improved.
\n • Minor bug fixes for opening new windows from the File tab.
\n • Lots of uner-the-hood changes for the app's appearance in preparation for future features.
\n
Patch 1.9.5
\n\n • Fixed a bug causing app-quit to be impossible sometimes.
\n • Fixed some minor bugs with the styles.
\n • Fixed a bug causing monospace toggle in the docs tab to be undoable.
\n • Fixed a bug causing external hyperlinks not to use the preferred browser, and is some cases not open at all.
\n
Patch 1.9.4
\n\n • You can now hyperlink to entries in the lexicon. The link format is lex::word
.
\n • The documentation tab would previously not adjust to the width of the window. That has been fixed.
\n
New in 1.9
\n\n • Overhauled the Documentation tab, which now uses integrated EditorJS technology.
Markdown is no longer supported in this tab, \n in favor of the new WYSIWYG style with a toolbar visible when you highlight text.
\n • Note: The first time you load a file from an older version, there may be some formatting quirks. \n Most of these should sort themselves out after saving in the new version and re-loading. \n Please contact the developer if you run into persistent issues.
\n • Fixed a bug with the Open New Window button which caused it to fail to open new windows.
\n • The button to edit phrasebook entries has been change to right-click instead of left-click to\n make it more difficult to accidentally overwrite work in progress, and to allow for\n highlighting text.
\n • An HTML Docs-Only export option has been added.
\n
Patch 1.8.14
\n\n • Fixed a few minor bugs with markdown parsing.
\n • Added monospace markdown with ``this``
syntax.
\n • Fixed a reported bug which affected the orthography testing area.
\n
New in 1.8
\n\n • File storage has been migrated to make auto-save possible.
\n • Categories can now be defined and used in your Pronunciations rules. See the docs page for more info.
\n • Five new color themes: Light, Marine, Glade, Leatherbound, and Purple Maar (contributed by Maarz).
\n • You can now load in your own custom CSS color themes.
\n • Definitions, descriptions, and documentation sections now support simple markdown.
\n • There's a new space in the Phonology tab to test your pronunciation rules.
\n • Tag searches no longer require an exact match.
\n • Several minor bug fixes, including one reported about tables being editable in the HTML\n export.
\n
/
\n \n/
\nThe lexicon of {Language.Name} is empty.
\n {/each}\n{phones}
\n{inflection.tags.join(' ')}
/{inflection.filter}/
\n \n \n \n
\n \n {#each tabs as tab, i}\n