{"version":3,"file":"BDpVEuh3.mjs","names":["deepEqual","$.from_html","$.prop","$.child","child","reset","slot","set_attribute","template_effect","prop","from_html","append","elementqueries","layer","#watchlist","widths","attrs","el","j","w","attrstr","finalw","k","#stores","v","#busy","closest","target","#finddepth","currentdepth","targets","depth","#processwidths","m","id","#collecttargets","#boundRefresh","#mutationobserver","#hasInit","#activate","#gotoanchor","#subscribers","#activateRaw","store","#deactivate","eq","unsubscribe","opts","dateOffset","offset","dt","dateToISOWithTZ","randomid","ret","length","isBlank","str","isNotBlank","isNull","obj","isNotNull","disallowedKeys","pathSeperatorRegex","clone","objectOrArray","set","path","newRoot","root","newValue","currentParent","previousKey","previousValue","index","namedProp","quotedProp","whole","decompose","payload","itm","val","i","key","recompose","paths","toQuery","fromQuery","pair","isEmptyWithUncertainty","isEmpty","isPracticallyEmpty","isNotEmpty","equal","a","b","compared","keys","nonNullKeys","bkeys","get","defaultValue","extractors","extractor","directKey","stringify","data","seen","node","replacer","out","seenIndex","value","ensureString","ActiveStore","run","updater","fn","Store","ScreenReaderOnly","$$props","arialive","ariaatomic","span","$$anchor","toasts","toast","msgOrToast","resolvedType","stored","t","now"],"sources":["../../../../../../../node_modules/@txstate-mws/svelte-components/dist/actions/elementqueries.js","../../../../../../../node_modules/txstate-utils/lib-esm/date.js","../../../../../../../node_modules/txstate-utils/lib-esm/util.js","../../../../../../../node_modules/txstate-utils/lib-esm/prototypepollution.js","../../../../../../../node_modules/txstate-utils/lib-esm/object/common.js","../../../../../../../node_modules/txstate-utils/lib-esm/object/set.js","../../../../../../../node_modules/txstate-utils/lib-esm/object/decompose.js","../../../../../../../node_modules/txstate-utils/lib-esm/object/empty.js","../../../../../../../node_modules/txstate-utils/lib-esm/object/equal.js","../../../../../../../node_modules/txstate-utils/lib-esm/object/get.js","../../../../../../../node_modules/txstate-utils/lib-esm/array/extractors.js","../../../../../../../node_modules/txstate-utils/lib-esm/stringify.js","../../../../../../../node_modules/@txstate-mws/svelte-store/dist/activestore.js","../../../../../../../node_modules/@txstate-mws/svelte-store/dist/store.js","../../../../../../../node_modules/@txstate-mws/svelte-components/dist/components/ScreenReaderOnly.svelte","../../../../../../../node_modules/@txstate-mws/svelte-components/dist/stores/toasts.js"],"sourcesContent":["class ElementQueries {\n    #watchlist = [];\n    #busy = false;\n    #hasInit = false;\n    #mutationobserver;\n    #boundRefresh = this.refresh.bind(this);\n    #subscribers = 0;\n    #stores = new Map();\n    #processwidths() {\n        for (const layer of this.#watchlist) {\n            const widths = [];\n            const attrs = [];\n            for (const el of layer) {\n                widths.push(el.offsetWidth);\n                attrs.push(el.getAttribute('data-eq'));\n            }\n            for (let j = 0; j < layer.length; j++) {\n                const el = layer[j];\n                const w = widths[j];\n                let attrstr = '';\n                let finalw = 1600;\n                for (let k = 1600; k >= w && k > 700; k -= 100) {\n                    attrstr += `${k}px `;\n                    finalw = k;\n                }\n                for (let k = 700; k >= w; k -= 50) {\n                    attrstr += `${k}px `;\n                    finalw = k;\n                }\n                if (attrstr !== attrs[j])\n                    el.setAttribute('data-eq', attrstr);\n                if (this.#stores.has(el)) {\n                    this.#stores.get(el).update(v => v.width === finalw ? v : { ...v, width: finalw });\n                }\n            }\n        }\n        this.#busy = false;\n    }\n    #finddepth(target, currentdepth = 0) {\n        const closest = target.parentElement?.closest('.eq-parent');\n        if (!closest)\n            return currentdepth;\n        return this.#finddepth(closest, currentdepth + 1);\n    }\n    #collecttargets() {\n        this.#watchlist = [];\n        const targets = Array.from(document.querySelectorAll('.eq-parent'));\n        for (const target of targets) {\n            const depth = this.#finddepth(target);\n            if (!this.#watchlist[depth])\n                this.#watchlist[depth] = [target];\n            else\n                this.#watchlist[depth].push(target);\n        }\n    }\n    refresh() {\n        if (!this.#busy && this.#watchlist.length > 0) {\n            this.#busy = true;\n            requestAnimationFrame(this.#processwidths.bind(this));\n        }\n    }\n    #gotoanchor() {\n        // since we are dramatically resizing, we need to scroll to the proper place for an\n        // anchor tag\n        const m = document.location.hash.match(/^#([a-z][a-zA-Z0-9_:.\\-]*)$/iv);\n        if (m) {\n            const id = m[1];\n            requestAnimationFrame(() => { (document.getElementById(id) ?? document.querySelector(`[name=\"${id}\"]`))?.scrollIntoView(true); });\n        }\n    }\n    fullresync() {\n        this.#collecttargets();\n        this.refresh();\n    }\n    #activate() {\n        this.fullresync();\n        window.addEventListener('resize', this.#boundRefresh);\n        this.#mutationobserver = new MutationObserver(() => { this.fullresync(); });\n        this.#mutationobserver.observe(document.body, {\n            subtree: true,\n            childList: true,\n            attributeFilter: ['class', 'style']\n        });\n    }\n    #activateRaw() {\n        if (typeof window === 'undefined' || this.#hasInit)\n            return;\n        this.#hasInit = true;\n        if (['interactive', 'complete'].includes(document.readyState)) {\n            this.#activate();\n        }\n        else {\n            window.addEventListener('DOMContentLoaded', () => {\n                this.#activate();\n                this.#gotoanchor();\n            });\n        }\n    }\n    // if someone uses the library without svelte, they may just activate it once\n    // instead of faithfully subscribing and unsubscribing, so we'll add a subscriber that can't be\n    // decremented and it will stay activated forever\n    activate() {\n        this.#subscribers += 1;\n        this.#activateRaw();\n    }\n    #deactivate() {\n        if (this.#subscribers > 0 || typeof window === 'undefined')\n            return;\n        window.removeEventListener('resize', this.#boundRefresh);\n        this.#mutationobserver?.disconnect();\n        this.#hasInit = false;\n    }\n    subscribe(el, store) {\n        this.#subscribers += 1;\n        if (store)\n            this.#stores.set(el, store);\n        else\n            this.#stores.delete(el);\n        this.#activateRaw();\n        return () => {\n            this.#subscribers -= 1;\n            if (this.#subscribers === 0)\n                this.#deactivate();\n        };\n    }\n}\nexport const elementqueries = new ElementQueries();\nexport function eq(el, opts) {\n    el.classList.add('eq-parent');\n    let unsubscribe = elementqueries.subscribe(el, opts?.store);\n    return {\n        update(opts) {\n            unsubscribe();\n            unsubscribe = elementqueries.subscribe(el, opts?.store);\n        },\n        destroy() {\n            unsubscribe();\n        }\n    };\n}\n","/**\n * Return the date offset of the current device, e.g. '-0600'\n *\n * You might want to consider Intl.DateTimeFormat().resolvedOptions().timeZone which will\n * return e.g. 'America/Chicago'\n */\nfunction dateOffset(dt) {\n    const offset = dt.getTimezoneOffset();\n    if (offset === 0)\n        return 'Z';\n    const sign = offset < 0 ? '+' : '-';\n    return `${sign}${String(Math.floor(offset / 60)).padStart(2, '0')}${String(offset % 60).padStart(2, '0')}`;\n}\n/**\n * Convert a date to a string while retaining the timezone offset.\n *\n * For example, instead of converting to UTC and ending the string with a 'Z', like\n * JSON.stringify would do, this function will keep the timezone and append '-0600'\n * to signify that it was recorded on a device that was 6 hours off from UTC.\n */\nexport function dateToISOWithTZ(dt) {\n    return `${String(dt.getFullYear()).padStart(4, '0')}-${String(dt.getMonth() + 1).padStart(2, '0')}-${String(dt.getDate()).padStart(2, '0')}T${String(dt.getHours()).padStart(2, '0')}:${String(dt.getMinutes()).padStart(2, '0')}:${String(dt.getSeconds()).padStart(2, '0')}.${String(dt.getMilliseconds()).padStart(3, '0')}${dateOffset(dt)}`;\n}\n/**\n * This function may be passed to JSON.stringify's second parameter to make Date\n * objects stringify with their time zone offset in tact.\n *\n * JSON.stringify(someobj, stringifyDateWithTZ)\n */\nexport function stringifyDateWithTZ(key, value) {\n    if (value instanceof Date)\n        return dateToISOWithTZ(value);\n    return value;\n}\n/**\n * Recurse through an object to find Date objects and convert them to strings\n * with dateToISOWithTZ\n */\nexport function stringifyDates(obj) {\n    if (obj instanceof Date)\n        return dateToISOWithTZ(obj);\n    if (typeof obj === 'object' && obj != null) {\n        for (const [key, val] of Object.entries(obj)) {\n            ;\n            obj[key] = stringifyDates(val);\n        }\n    }\n    return obj;\n}\n","/**\n * returns a promise that will resolve in the specified number of\n * milliseconds\n */\nexport function sleep(milliseconds = 0) {\n    return new Promise(resolve => setTimeout(resolve, milliseconds));\n}\n/**\n * generates a random string guaranteed to start with an alpha\n * character, which makes it suitable for HTML `id` attribute\n */\nexport function randomid(length = 10) {\n    let ret = String.fromCharCode(97 + Math.floor(Math.random() * 26));\n    while (ret.length < length)\n        ret += Math.random().toString(36).slice(2);\n    return ret.slice(0, length);\n}\n/**\n * useful for checking for empty strings, though in modern javascript\n * optional chaining may be easier: if (!str?.trim().length) ...\n */\nexport function isBlank(str) {\n    return !str || !str.trim || str.trim().length === 0;\n}\n/**\n * useful for checking for empty strings, though in modern javascript\n * optional chaining may be easier: if (str?.trim().length) ...\n */\nexport function isNotBlank(str) {\n    return !isBlank(str);\n}\n/**\n * useful for chaining Array.filter(isTruthy).map when using typescript; the map\n * variable will no longer be marked as optional\n *\n * also see: isNotNull\n */\nexport function isTruthy(str) {\n    return Boolean(str);\n}\n/**\n * undefined and null both treated as null\n */\nexport function isNull(obj) {\n    return obj == null;\n}\n/**\n * undefined and null both treated as null\n */\nexport function isNotNull(obj) {\n    return obj != null;\n}\n/**\n * only checks for valid syntax\n */\nexport function isEmail(email) {\n    return !!email && /^[a-z0-9!#$%&'*+/=?^_‘{|}~-]+(\\.[a-z0-9!#$%&'*+/=?^_‘{|}~-]+)*@([a-z0-9]([a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9]([a-z0-9-]*[a-z0-9])?$/i.test(email);\n}\nexport function optionalString(str) {\n    return str == null ? undefined : String(str);\n}\nexport function printIf(...args) {\n    if (args.length === 1)\n        return args[0] == null ? '' : String(args[0]);\n    return args[0] && args[1] != null ? String(args[1]) : '';\n}\nexport function roundTo(num, digits = 0) {\n    const conversion = Math.pow(10, digits);\n    return Math.round((num + Number.EPSILON) * conversion) / conversion;\n}\nexport function bytesToHuman(bytes) {\n    if (!bytes)\n        return '0 bytes';\n    const scales = [' bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];\n    const scale = Math.min(5, Math.floor(Math.log(bytes) / Math.log(1024)));\n    return String(parseFloat((bytes / Math.pow(1024, scale)).toPrecision(3))) + scales[scale];\n}\n","export const disallowedKeys = new Set();\ndisallowedKeys.add('__proto__');\ndisallowedKeys.add('prototype');\ndisallowedKeys.add('constructor');\n","export const pathSeperatorRegex = /\\[\\s*(['\"])(.*?)\\1\\s*\\]|(?:^|\\.)\\s*([\\w/$-]+)\\s*(?=\\.|\\[|$)|\\[\\s*(-?\\d+)\\s*\\]/g;\n","import { disallowedKeys } from '../prototypepollution.js';\nimport { pathSeperatorRegex } from './common.js';\nconst clone = (objectOrArray) => Array.isArray(objectOrArray) ? Array.from(objectOrArray) : Object.assign({}, objectOrArray);\n/**\n * tiny non-mutating alternative to dot-prop or lodash.set that only\n * works with JSON-compatible objects\n *\n * accepts a generic to optionally set the output type, otherwise assumes\n * your mutation will not alter the object's type\n */\nexport function set(root, path, newValue) {\n    if (Array.isArray(path))\n        path = \"['\" + path.join(\"']['\") + \"']\";\n    const newRoot = root != null ? clone(root) : typeof path === 'number' || /^(\\[\\d+\\]|\\d+([.[]|$))/.test(path) ? [] : {};\n    if (path in newRoot || typeof path === 'number') {\n        // Just set it directly: no need to loop\n        newRoot[path] = newValue;\n        return newRoot;\n    }\n    let currentParent = newRoot;\n    let previousKey;\n    path.replace(pathSeperatorRegex, (whole, _quotationMark, quotedProp, namedProp, index) => {\n        if (previousKey) {\n            // Clone (or create) the object/array that we were just at: this lets us keep it attached to its parent.\n            const previousValue = currentParent[previousKey];\n            if (disallowedKeys.has(previousKey))\n                throw new Error('detected prototype pollution attempt');\n            currentParent[previousKey] = previousValue\n                ? clone(previousValue)\n                : index || !isNaN(Number(namedProp))\n                    ? []\n                    : {};\n            // Now advance\n            currentParent = currentParent[previousKey];\n        }\n        previousKey = namedProp || quotedProp || index;\n        return whole;\n    });\n    currentParent[previousKey] = newValue;\n    return newRoot;\n}\n","import { dateToISOWithTZ } from '../date.js';\nimport { isNotBlank } from '../util.js';\nimport { set } from './set.js';\nexport function decompose(payload) {\n    if (typeof payload !== 'object' || payload == null || payload instanceof Date)\n        return payload != null && (typeof payload !== 'string' || isNotBlank(payload)) ? [['', payload]] : [];\n    if (Array.isArray(payload)) {\n        return payload.flatMap((itm, i) => decompose(itm).map(([path, val]) => [i + (!path || path.startsWith('[') ? '' : '.') + path, val]));\n    }\n    else {\n        return Object.entries(payload).flatMap(([key, itm]) => decompose(itm).map(([path, val]) => [(key.includes('.') || !isNaN(Number(key)) ? '[\"' + key + '\"]' : key) + (!path || path.startsWith('[') ? '' : '.') + path, val]));\n    }\n}\nexport function recompose(paths) {\n    let ret;\n    for (const [key, val] of paths) {\n        ret = set(ret, key, val);\n    }\n    return ret ?? {};\n}\nexport function toQuery(payload) {\n    return decompose(payload)\n        .filter(([path, val]) => val != null)\n        .map(([path, val]) => [path, val instanceof Date ? dateToISOWithTZ(val) : typeof val === 'string' && val.length && (!isNaN(Number(val)) || ['true', 'false'].includes(val) || val.includes('\"')) ? '\"' + encodeURIComponent(val) + '\"' : String(val)])\n        .map(([path, val]) => encodeURIComponent(path) + '=' + encodeURIComponent(val))\n        .join('&');\n}\nexport function fromQuery(str) {\n    return recompose((str ?? '').split('&').filter(isNotBlank).map(pair => pair.split('=').map(decodeURIComponent))\n        .filter(([key, val]) => isNotBlank(val))\n        .map(([key, val]) => [key, /^\".*?\"$/.test(val) ? decodeURIComponent(val.slice(1, -1)) : val.length && !isNaN(Number(val)) ? Number(val) : ['true', 'false'].includes(val) ? val === 'true' : /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(.\\d{3})?(Z|[-+]\\d{2}:?\\d{2})$/.test(val) ? new Date(val) : val]));\n}\n","import { isBlank, isNotNull } from '../util.js';\nfunction isEmptyWithUncertainty(obj) {\n    if (obj == null)\n        return true;\n    if (obj instanceof Date)\n        return obj.getTime() === 0;\n    if (typeof obj === 'boolean')\n        return false;\n    if (typeof obj === 'function')\n        return false;\n    if (typeof obj === 'symbol')\n        return false;\n    if (typeof obj === 'bigint')\n        return false;\n    if (typeof obj === 'number')\n        return false;\n    if (typeof obj === 'string')\n        return isBlank(obj);\n    if (typeof obj.length === 'number')\n        return !obj.length;\n    if (typeof obj.size === 'number')\n        return !obj.size;\n    if (typeof obj.isEmpty === 'function')\n        return obj.isEmpty();\n    if (typeof obj.size === 'function')\n        return !obj.size();\n}\n/**\n * useful for checking if an object, string, or array is empty,\n * undefined, or null\n */\nexport function isEmpty(obj) {\n    const certainty = isEmptyWithUncertainty(obj);\n    if (certainty != null)\n        return certainty;\n    if (typeof obj === 'object')\n        return !Object.keys(obj).filter(k => isNotNull(obj[k])).length;\n    return !obj;\n}\n/**\n * Much the same as isEmpty but ignore blank properties\n *\n * { hello: undefined } => both isEmpty and isPracticallyEmpty return true\n * { hello: '' } => isEmpty returns false, isPracticallyEmpty returns true\n * { hello: ' ' } => isEmpty returns false, isPracticallyEmpty returns true\n */\nexport function isPracticallyEmpty(obj) {\n    const certainty = isEmptyWithUncertainty(obj);\n    if (certainty != null)\n        return certainty;\n    if (typeof obj === 'object')\n        return !Object.keys(obj).filter(k => !isPracticallyEmpty(obj[k])).length;\n    return !obj;\n}\n/**\n * useful for checking if an object, string, or array is empty,\n * undefined, or null\n */\nexport function isNotEmpty(obj) {\n    return !isEmpty(obj);\n}\n/**\n * useful for checking if an object, string, or array is empty,\n * undefined, or null\n */\nexport function isNotPracticallyEmpty(obj) {\n    return !isPracticallyEmpty(obj);\n}\n","export function equal(a, b, compared) {\n    if (a === b)\n        return true;\n    if (a && b && typeof a === 'object' && typeof b === 'object') {\n        if (a.constructor !== b.constructor)\n            return false;\n        compared ??= { a: new Set(), b: new Set() };\n        if (compared.a.has(a) && compared.b.has(b))\n            return true;\n        compared.a.add(a);\n        compared.b.add(b);\n        let length, i;\n        if (Array.isArray(a)) {\n            length = a.length;\n            if (length !== b.length)\n                return false;\n            for (i = length; i-- !== 0;) {\n                if (!equal(a[i], b[i], compared))\n                    return false;\n            }\n            return true;\n        }\n        if ((a instanceof Map) && (b instanceof Map)) {\n            if (a.size !== b.size)\n                return false;\n            for (i of a.entries()) {\n                if (!b.has(i[0]))\n                    return false;\n            }\n            for (i of a.entries()) {\n                if (!equal(i[1], b.get(i[0]), compared))\n                    return false;\n            }\n            return true;\n        }\n        if ((a instanceof Set) && (b instanceof Set)) {\n            if (a.size !== b.size)\n                return false;\n            for (i of a.entries()) {\n                if (!b.has(i[0]))\n                    return false;\n            }\n            return true;\n        }\n        if (typeof File !== 'undefined' && a instanceof File && b instanceof File) {\n            if (a.name !== b.name)\n                return false;\n            if (a.size !== b.size)\n                return false;\n            if (a.type !== b.type)\n                return false;\n            return true;\n        }\n        else if (typeof Blob !== 'undefined' && a instanceof Blob && b instanceof Blob) {\n            if (a.size !== b.size)\n                return false;\n            if (a.type !== b.type)\n                return false;\n            return true;\n        }\n        if (a.constructor === RegExp)\n            return a.source === b.source && a.flags === b.flags;\n        if (a.valueOf !== Object.prototype.valueOf)\n            return a.valueOf() === b.valueOf();\n        if (a.toString !== Object.prototype.toString)\n            return a.toString() === b.toString();\n        const keys = nonNullKeys(a);\n        length = keys.length;\n        const bkeys = nonNullKeys(b);\n        if (length !== bkeys.length)\n            return false;\n        for (i = length; i-- !== 0;) {\n            if (!Object.prototype.hasOwnProperty.call(b, keys[i]))\n                return false;\n        }\n        for (i = length; i-- !== 0;) {\n            const key = keys[i];\n            if (!equal(a[key], b[key], compared))\n                return false;\n        }\n        return true;\n    }\n    // true if both NaN, false otherwise\n    return a !== a && b !== b;\n}\nfunction nonNullKeys(a) {\n    const ret = [];\n    for (const k of Object.keys(a))\n        if (a[k] != null)\n            ret.push(k);\n    return ret;\n}\n","import { pathSeperatorRegex } from './common.js';\nexport function get(root, path, defaultValue) {\n    try {\n        if (root.toObject)\n            root = root.toObject();\n        if (Array.isArray(path))\n            path = \"['\" + path.join(\"']['\") + \"']\";\n        if (path in root || typeof path === 'number')\n            return root[path];\n        let obj = root;\n        path.replace(pathSeperatorRegex, (whole, _quotationMark, quotedProp, namedProp, index) => {\n            obj = obj[quotedProp || namedProp || index];\n            return whole;\n        });\n        return obj ?? defaultValue;\n    }\n    catch (err) {\n        return defaultValue;\n    }\n}\n/**\n * @deprecated use get()\n */\nexport const dotprop = get;\n","import { get } from '../object/index.js';\n/**\n * Used internally by `keyby`, `groupby`, and others to normalize the key argument and\n * determine how to extract the value from an object\n *\n * If the key is a string, the txstate-utils `get` function is used to extract the value\n * If the key is a function, the function is used to extract the value\n * If the key is a number or symbol, the value is extracted directly\n * If the key is undefined, the object itself is returned instead of having a value extracted\n */\nexport const extractors = {\n    undefined: () => {\n        return (obj) => obj;\n    },\n    function: (extractor) => {\n        return extractor;\n    },\n    number: directKey,\n    symbol: directKey,\n    string: (key) => {\n        return (obj) => get(obj, key);\n    }\n};\nfunction directKey(key) {\n    return (obj) => obj[key];\n}\n","/**\n * A stable stringify function that sorts object keys before stringifying\n * so that identical objects with different key ordering will stringify to identical\n * strings.\n *\n * If the object being stringified contains cycles, the deeper appearance\n * of the cycled object will be replaced with the string '__cycle__'\n */\nexport function stringify(data, replacer) {\n    if (typeof data === 'undefined')\n        return 'null';\n    const seen = [];\n    return (function stringify(node) {\n        if (typeof node?.toJSON === 'function') {\n            node = node.toJSON();\n        }\n        if (node === undefined)\n            return;\n        if (typeof node === 'number')\n            return isFinite(node) ? '' + node : 'null';\n        if (typeof node !== 'object')\n            return JSON.stringify(node, replacer);\n        let i, out;\n        if (Array.isArray(node)) {\n            out = '[';\n            for (i = 0; i < node.length; i++) {\n                if (i)\n                    out += ',';\n                out += stringify(node[i]) ?? 'null';\n            }\n            return out + ']';\n        }\n        if (node === null)\n            return 'null';\n        if (seen.includes(node)) {\n            return JSON.stringify('__cycle__');\n        }\n        const seenIndex = seen.push(node) - 1;\n        const keys = Object.keys(node).sort();\n        out = '';\n        for (i = 0; i < keys.length; i++) {\n            const key = keys[i];\n            const value = stringify(node[key]);\n            if (!value)\n                continue;\n            if (out)\n                out += ',';\n            out += JSON.stringify(key) + ':' + value;\n        }\n        seen.splice(seenIndex, 1);\n        return '{' + out + '}';\n    })(data);\n}\nexport function ensureString(data) {\n    return typeof data === 'string' ? data : stringify(data);\n}\n","export function isUsable(value) {\n    return !!value && typeof value.subscribe === 'function';\n}\nexport function isWritable(value) {\n    return isUsable(value) && typeof value.update === 'function';\n}\nexport function isSettable(value) {\n    return isWritable(value) && typeof value.set === 'function';\n}\n/**\n * An alternative to svelte's \"writable\" that does not check equality before notifying\n * subscribers. A writable will notify subscribers after a shallow equality check, which\n * does not work with mutated states:\n * store.update(v => { v.someprop = 'newvalue'; return v })\n *\n * With a writable, this line would NOT notify subscribers because the state will be compared\n * against itself and always found to be equal.\n *\n * An alternative to this store type is SafeStore, which will do a deep equality check but\n * clone data so that it is safe against mutations. It costs more CPU cycles but results in\n * fewer notifications to subscribers which could be an overall win.\n */\nexport class ActiveStore {\n    constructor(value) {\n        this.cleanups = [];\n        this.sourceInits = [];\n        this.sourcesInitialized = 0;\n        this.subscribers = new Map();\n        this.value = this.clone(value);\n    }\n    // this is here to support SafeStore: the regular store makes this a null-op, but\n    // SafeStore overrides the implementation to a deep clone operation\n    clone(value) {\n        return value;\n    }\n    // always returns false so that subscribers are notified on every `set` or `update`.\n    // Subclasses can override this for shallow or deep equality checks.\n    equal(a, b) {\n        return false;\n    }\n    set(value) {\n        if (!this.equal(value, this.value)) {\n            this.value = this.clone(value);\n            for (const [id, run] of this.subscribers) {\n                run(value);\n            }\n        }\n    }\n    update(updater) {\n        // we have to send the user's updater function a cloned value, because they might mutate it\n        this.set(updater(this.clone(this.value)));\n    }\n    subscribe(run) {\n        // if we previously had no listeners, then we will have unsubscribed from our sources\n        // and we need to re-subscribe so our new listener will get updates\n        if (this.subscribers.size === 0)\n            this.subscribeToSources();\n        // generate a random id for this subscriber, it makes unsubscription O(1) instead of O(n)\n        let id;\n        do {\n            id = Math.random().toString(32);\n        } while (this.subscribers.has(id));\n        // register our new subscriber to receive updates\n        this.subscribers.set(id, run);\n        // immediately send the current value to our new subscriber\n        run(this.clone(this.value));\n        // return an unsubscribe function\n        return () => {\n            this.subscribers.delete(id);\n            // if we have no listeners, stop listening to our sources for updates\n            // this makes it possible for us to be properly garbage collected\n            if (this.subscribers.size === 0)\n                this.unsubscribeFromSources();\n        };\n    }\n    /**\n     * Provided as a last ditch avenue to clean up memory after rogue subscribers forget\n     * to unsubscribe themselves. For example, in an SSR environment one could clear out\n     * global stores anytime a request finishes and no other requests are being processed.\n     */\n    clearSubscribers() {\n        this.subscribers.clear();\n        this.unsubscribeFromSources();\n    }\n    /**\n     * Stores that subscribe to external events should set it up with a start/stop mentality\n     * so that the external events can be unsubscribed when the store itself has no listeners\n     * to notify. This helps ensure unused stores can be garbage collected.\n     *\n     * To do this, pass registerSource a function that initializes the subscription to the external\n     * event, and returns a function that can unsubscribe from the external event. This parent\n     * class will take care of running those functions at appropriate times.\n     */\n    registerSource(fn) {\n        if (this.subscribers.size)\n            this.cleanups.push(fn());\n        this.sourceInits.push(fn);\n    }\n    /**\n     * Provided in case a child class has a need to change out the external resources\n     */\n    unregisterSources() {\n        this.unsubscribeFromSources();\n        this.sourceInits = [];\n    }\n    subscribeToSources() {\n        this.sourcesInitialized = 0;\n        for (const fn of this.sourceInits) {\n            this.sourcesInitialized++;\n            this.cleanups.push(fn());\n        }\n    }\n    unsubscribeFromSources() {\n        for (const fn of this.cleanups)\n            fn();\n        this.cleanups = [];\n    }\n}\n","import { equal as deepEqual } from 'txstate-utils';\nimport { ActiveStore } from './activestore.js';\n/**\n * An alternative to svelte's \"writable\" that also checks deep equality (fast-deep-equal) before\n * notifying subscribers. A writable will notify subscribers after a shallow equality check, which\n * only works for scalars.\n *\n * Note that this strategy is weak against mutable state updates:\n * store.update(v => { v.someprop = 'newvalue'; return v })\n *\n * This line would NOT notify subscribers because the state will be compared against\n * itself and always found to be equal. If you are making updates in a mutable fashion,\n * use a SafeStore instead.\n */\nexport class Store extends ActiveStore {\n    equal(a, b) {\n        return deepEqual(a, b);\n    }\n}\n","<!-- @component\n  This component is for adding text that can be read by screen readers while remaining invisible to regular users.\n  Useful for when aria-label isn't supported with the drawback that it can show up in copy/paste selections.\n-->\n<script lang=\"ts\">\n  /** An id to bind with the `<span>` used to implement this component. */\n  export let id: string | undefined = undefined\n  export let arialive: 'off' | 'assertive' | 'polite' | undefined = undefined\n  export let ariaatomic: boolean | 'false' | 'true' | undefined = undefined\n</script>\n\n<style>\n  .sr-only {\n    border: 0 !important;\n    clip: rect(1px, 1px, 1px, 1px) !important;\n    -webkit-clip-path: inset(50%) !important;\n      clip-path: inset(50%) !important;\n    height: 1px !important;\n    margin: -1px !important;\n    overflow: hidden !important;\n    padding: 0 !important;\n    position: absolute !important;\n    width: 1px !important;\n    white-space: nowrap !important;\n    font-size: 20px !important;\n    background: white !important;\n    color: black !important;\n  }\n</style>\n\n<span {id} class=\"sr-only\" aria-live={arialive} aria-atomic={ariaatomic}><slot/></span>\n","import { Store } from '@txstate-mws/svelte-store';\nimport { randomid } from 'txstate-utils';\nexport class ToastStore extends Store {\n    add(msgOrToast, type, ttlMs) {\n        const toast = typeof msgOrToast === 'string'\n            ? {\n                message: msgOrToast,\n                type,\n                ttlMs\n            }\n            : msgOrToast;\n        const resolvedType = toast.type ?? 'error';\n        const id = randomid();\n        const stored = {\n            id,\n            stamp: new Date(),\n            title: toast.title,\n            message: toast.message,\n            type: resolvedType,\n            suspended: false,\n            ttlMs: toast.ttlMs ?? (['error', 'warning'].includes(resolvedType) ? 8000 : 5000)\n        };\n        this.update(v => [...v.filter(t => t.message !== stored.message || t.title !== stored.title), stored]);\n        setTimeout(() => { this.clean(); }, stored.ttlMs);\n    }\n    close(id) {\n        this.update(v => v.filter(t => t.id !== id));\n    }\n    suspend(id) {\n        this.update(v => v.map(t => t.id !== id ? t : { ...t, suspended: true }));\n    }\n    resume(id) {\n        this.update(v => v.map(t => t.id !== id ? t : { ...t, suspended: false }));\n        setTimeout(() => { this.clean(); }, 100);\n    }\n    clean() {\n        const now = new Date().getTime();\n        this.update(v => v.some(t => t.suspended) ? v : v.filter(t => now - t.stamp.getTime() <= t.ttlMs));\n    }\n}\nexport const toasts = new ToastStore([]);\n"],"ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],"mappings":"A,8JA8HA,IAAaY,EAAiB,IAAI,KA9Hb,CACjB,GAAa,CAAC,EACd,GAAQ,GACR,GAAW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