{ "version": 3, "sources": ["../../app/assets/shared/components/audio_player_playback_rate.js", "../../app/assets/shared/components/data_confirm.js", "../../app/assets/shared/components/input_type_number.js", "../../app/assets/shared/components/invalid_input.js", "../../app/assets/shared/components/query_diet.js", "../../app/assets/shared/components/submit_change_after_confirm.js", "../../app/assets/backend/components/click_link_inside.js", "../../app/assets/backend/components/comment.js", "../../../../shared/node_modules/flatpickr/dist/l10n/de.js", "../../app/assets/backend/components/file_input.js", "../../app/assets/backend/components/filter.js", "../../app/assets/backend/components/styled_alert.js", "../../../../shared/node_modules/unpoly/unpoly.js", "../../app/assets/shared/util/environment.js", "../../app/assets/shared/config/unpoly.js", "../../app/assets/backend/config/trix.js", "../../../../shared/node_modules/trix/dist/trix.esm.js", "../../../../shared/node_modules/@rails/activestorage/app/assets/javascripts/activestorage.esm.js", "../../app/assets/shared/components/active_storage.js", "../../../../shared/node_modules/wavesurfer.js/dist/wavesurfer.esm.js", "../../app/assets/shared/util/audio_player.js", "../../app/assets/shared/util/time.js", "../../app/assets/shared/components/audio_player.js", "import-glob:./shared/components/**/*.js", "../../../../shared/node_modules/wavesurfer.js/dist/plugins/record.esm.js", "../../app/assets/shared/util/audio_recorder.js", "../../app/assets/shared/util/duration.js", "../../app/assets/shared/components/audio_recorder.js", "../../app/assets/shared/util/application.js", "../../app/assets/shared/util/timeout.js", "../../app/assets/shared/components/flash_message.js", "import-glob:./backend/components/**/*.js", "../../app/assets/backend/components/confirm_unsaved_changes.js", "../../../../shared/node_modules/ismobilejs/src/isMobile.ts", "../../../../shared/node_modules/flatpickr/dist/esm/types/options.js", "../../../../shared/node_modules/flatpickr/dist/esm/l10n/default.js", "../../../../shared/node_modules/flatpickr/dist/esm/utils/index.js", "../../../../shared/node_modules/flatpickr/dist/esm/utils/dom.js", "../../../../shared/node_modules/flatpickr/dist/esm/utils/formatting.js", "../../../../shared/node_modules/flatpickr/dist/esm/utils/dates.js", "../../../../shared/node_modules/flatpickr/dist/esm/utils/polyfills.js", "../../../../shared/node_modules/flatpickr/dist/esm/index.js", "../../app/assets/backend/components/date_picker.js", "../../app/assets/backend/util/time_ago.js", "../../app/assets/backend/components/relative_time.js", "../../../../shared/node_modules/autosize/dist/autosize.esm.js", "../../app/assets/backend/util/insert_at_caret.js", "../../app/assets/backend/components/templatable.js", "../../app/assets/backend/components/textarea.js"], "sourcesContent": ["up.compiler('.audio-player-playback-rate', (element, { selector }) => {\n\n const playerElement = document.querySelector(selector)\n const field = element.querySelector('input')\n\n function init() {\n field.addEventListener('input', onInput)\n field.value = getPlayer().getPlaybackRate()\n updateLabel()\n }\n\n function onInput() {\n const rate = parseFloat(field.value)\n getPlayer().setPlaybackRate(rate)\n updateLabel()\n }\n\n function updateLabel() {\n element.dataset.value = parseFloat(field.value).toFixed(2)\n }\n\n function getPlayer() {\n return playerElement.getPlayerInstance()\n }\n\n init()\n\n})\n", "up.compiler('[data-confirm]', (element) => {\n\n function onClick(event) {\n const message = element.getAttribute('data-confirm')\n if (!confirm(message)) up.event.halt(event)\n }\n\n element.addEventListener('click', onClick)\n})\n", "up.compiler('input[type=\"number\"]', (element) => {\n\n // Number inputs allow incrementing/decrementing with arrow keys, and support exponential notation\n // (in some browsers even regular letters). We want neither.\n element.addEventListener('keydown', (event) => {\n const key = event.key\n if (key === 'ArrowUp' || key === 'ArrowDown' || (key.length === 1 && !event.ctrlKey && !event.altKey && !key.match(/[0-9\\-+,.]/))) {\n event.preventDefault()\n }\n })\n\n // Some browser (at least Firefox) will increment/decrement a number when using the mouse's scroll wheel\n // above a focused number input. Since this can lead to users changing values by accident, we want to avoid that.\n element.addEventListener('wheel', (event) => {\n if (element.matches(':focus')) {\n event.preventDefault()\n }\n })\n\n})\n", "const invalidClass = 'is-invalid'\nconst selector = ['input', 'textarea', 'select', '.radio-group']\n .map(target => `${target}.${invalidClass}`)\n .join(', ')\n\nup.compiler(selector, (element) => {\n const inputGroup = element.closest('.input-group')\n const formGroup = element.closest('.form-group')\n\n function setInputGroupInvalid(isInvalid) {\n inputGroup?.classList?.toggle(invalidClass, isInvalid)\n }\n\n function unsetOtherFormGroupFieldsInvalid() {\n if (formGroup) {\n Array.from(formGroup.querySelectorAll('.is-invalid')).forEach((element) => {\n element.classList.remove(invalidClass)\n })\n formGroup.querySelector('.invalid-feedback.d-block')?.classList?.remove('d-block')\n }\n }\n\n function unsetInvalid() {\n element.classList.remove(invalidClass)\n unsetOtherFormGroupFieldsInvalid()\n setInputGroupInvalid(false)\n }\n\n setInputGroupInvalid(true)\n element.addEventListener('input', unsetInvalid, { once: true })\n})\n", "up.macro('#query_diet', (element) => {\n\n element.removeAttribute('onclick')\n up.on(element, 'click', () => { element.remove() })\n\n})\n", "up.compiler('[submit-change-after-confirm]', (element, { message }) => {\n\n function onChange(_event) {\n if (!confirm(message)) {\n element.value = element.dataset.previousValue\n } else {\n element.dataset.previousValue = element.value\n up.submit(element)\n }\n }\n\n element.dataset.previousValue = element.value\n up.on(element, 'change', onChange)\n})\n", "// Like up-expand, but will follow the link as a browser action.\n// Intended for download links, where you do not want Unpoly to handle the link.\nup.compiler('[click-link-inside]', (element) => {\n\n element.addEventListener('click', (event) => {\n const linkInside = element.querySelector('a')\n const clickedLink = event.target.closest('a')\n\n if (linkInside && (!clickedLink || linkInside !== clickedLink)) {\n up.event.halt(event)\n linkInside.click()\n }\n })\n\n})\n", "up.compiler('.comment.-done', (element) => {\n\n element.addEventListener('click', () => {\n up.layer.open({\n mode: 'modal',\n size: 'small',\n content: element.innerHTML,\n })\n })\n element.style.cursor = 'zoom-in'\n element.title = 'Kommentar ist als erledigt gekennzeichnet.\\nKlicke, um den Text noch einmal zu lesen.'\n\n})\n", "(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.de = {}));\n}(this, (function (exports) { 'use strict';\n\n var fp = typeof window !== \"undefined\" && window.flatpickr !== undefined\n ? window.flatpickr\n : {\n l10ns: {},\n };\n var German = {\n weekdays: {\n shorthand: [\"So\", \"Mo\", \"Di\", \"Mi\", \"Do\", \"Fr\", \"Sa\"],\n longhand: [\n \"Sonntag\",\n \"Montag\",\n \"Dienstag\",\n \"Mittwoch\",\n \"Donnerstag\",\n \"Freitag\",\n \"Samstag\",\n ],\n },\n months: {\n shorthand: [\n \"Jan\",\n \"Feb\",\n \"M\u00E4r\",\n \"Apr\",\n \"Mai\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Okt\",\n \"Nov\",\n \"Dez\",\n ],\n longhand: [\n \"Januar\",\n \"Februar\",\n \"M\u00E4rz\",\n \"April\",\n \"Mai\",\n \"Juni\",\n \"Juli\",\n \"August\",\n \"September\",\n \"Oktober\",\n \"November\",\n \"Dezember\",\n ],\n },\n firstDayOfWeek: 1,\n weekAbbreviation: \"KW\",\n rangeSeparator: \" bis \",\n scrollTitle: \"Zum \u00C4ndern scrollen\",\n toggleTitle: \"Zum Umschalten klicken\",\n time_24hr: true,\n };\n fp.l10ns.de = German;\n var de = fp.l10ns;\n\n exports.German = German;\n exports.default = de;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n", "up.compiler('[file-input]', (element) => {\n\n const input = element.querySelector('input[type=\"file\"]')\n const button = element.querySelector('[file-input--button]')\n const filename = element.querySelector('[file-input--filename]')\n\n const previewImage = element.querySelector('[file-input--preview] img')\n\n function onDragOver(event) {\n event.preventDefault()\n }\n\n function onDrop(event) {\n event.preventDefault()\n input.files = event.dataTransfer.files\n onFilePicked()\n }\n\n function pickFile() {\n input.click()\n }\n\n function onFilePicked() {\n updateFilename()\n updatePreview()\n }\n\n function updateFilename() {\n const filenames = Array.from(input.files).map(file => file.name)\n filename.innerText = filenames.join(', ')\n }\n\n function updatePreview() {\n if (!previewImage) return\n\n if (input.files.length === 1) {\n const file = input.files[0]\n\n readImageAsDataURL(file).then((dataURL) => {\n previewImage.src = dataURL\n })\n } else {\n previewImage.src = '//:0'\n }\n }\n\n function readImageAsDataURL(file) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n reader.addEventListener('load', () => {\n resolve(reader.result)\n })\n reader.readAsDataURL(file)\n })\n }\n\n element.addEventListener('drop', onDrop)\n element.addEventListener('dragover', onDragOver)\n button.addEventListener('click', pickFile)\n input.addEventListener('change', onFilePicked)\n\n})\n", "up.compiler('[filter]', function(filterForm) {\n const resetButton = filterForm.querySelector('[filter--reset]')\n const queryInput = filterForm.querySelector('[filter--query]')\n resetButton.addEventListener('click', function() {\n queryInput.value = ''\n up.emit(queryInput, 'change')\n queryInput.focus()\n })\n})\n", "up.compiler('[styled-alert]', (element, { text }) => {\n\n function onClick() {\n const content = up.element.createFromSelector('div')\n\n up.element.affix(content, 'h4', { text: 'Hinweis' })\n\n text.split(/\\n+/).forEach((line) => up.element.affix(content, 'p', { text: line }))\n\n up.element.affix(content, 'button.btn.btn-light[type=\"button\"][up-dismiss]', { text: 'Schlie\u00DFen' })\n\n up.layer.open({\n mode: 'modal',\n size: 'small',\n content,\n })\n }\n\n element.addEventListener('click', onClick)\n\n})\n", "/******/ (() => { // webpackBootstrap\n/******/ \tvar __webpack_modules__ = ([\n/* 0 */,\n/* 1 */\n/***/ (() => {\n\nwindow.up = {\n version: '3.9.2'\n};\n\n\n/***/ }),\n/* 2 */\n/***/ (() => {\n\nup.mockable = function (originalFn) {\n if (window.jasmine) {\n let name = originalFn.name;\n let obj = { [name]: originalFn };\n let mockableFn = function () {\n return obj[name].apply(this, arguments);\n };\n mockableFn.mock = () => spyOn(obj, name);\n return mockableFn;\n }\n else {\n return originalFn;\n }\n};\n\n\n/***/ }),\n/* 3 */\n/***/ (() => {\n\nup.util = (function () {\n function noop() {\n }\n function asyncNoop() {\n return Promise.resolve();\n }\n function memoize(func) {\n let cachedValue, cached;\n return function (...args) {\n if (cached) {\n return cachedValue;\n }\n else {\n cached = true;\n return cachedValue = func.apply(this, args);\n }\n };\n }\n function normalizeURL(url, options) {\n options = newOptions(options, { host: 'cross-domain' });\n const parts = parseURL(url);\n let normalized = '';\n if (options.host === 'cross-domain') {\n options.host = isCrossOrigin(parts);\n }\n if (options.host) {\n normalized += parts.protocol + \"//\" + parts.host;\n }\n let { pathname } = parts;\n if (options.trailingSlash === false && pathname !== '/') {\n pathname = pathname.replace(/\\/$/, '');\n }\n normalized += pathname;\n if (options.search !== false) {\n normalized += parts.search;\n }\n if (options.hash !== false) {\n normalized += parts.hash;\n }\n return normalized;\n }\n function matchURLs(leftURL, rightURL, options) {\n return matchableURL(leftURL, options) === matchableURL(rightURL, options);\n }\n function matchableURL(url, options) {\n if (!url)\n return;\n return normalizeURL(url, { hash: false, trailingSlash: false, ...options });\n }\n function matchableURLPatternAtom(patternAtom) {\n if (patternAtom.endsWith('/'))\n return [patternAtom, patternAtom.slice(0, -1)];\n if (patternAtom.includes('/?'))\n return [patternAtom, patternAtom.replace('/?', '?')];\n if (patternAtom.endsWith('/*'))\n return [patternAtom, patternAtom.slice(0, -2), patternAtom.slice(0, -2) + '?*'];\n return patternAtom;\n }\n const APP_PROTOCOL = location.protocol;\n const APP_HOSTNAME = location.hostname;\n function isCrossOrigin(urlOrAnchor) {\n if (isString(urlOrAnchor) && (urlOrAnchor.indexOf('//') === -1)) {\n return false;\n }\n const parts = parseURL(urlOrAnchor);\n return (APP_HOSTNAME !== parts.hostname) || (APP_PROTOCOL !== parts.protocol);\n }\n function parseURL(url) {\n if (url.pathname) {\n return url;\n }\n let link = document.createElement('a');\n link.href = url;\n return link;\n }\n function normalizeMethod(method) {\n return method ? method.toUpperCase() : 'GET';\n }\n function methodAllowsPayload(method) {\n return (method !== 'GET') && (method !== 'HEAD');\n }\n function iteratee(block) {\n if (isString(block)) {\n return item => item[block];\n }\n else {\n return block;\n }\n }\n function map(list, block) {\n if (list.length === 0) {\n return [];\n }\n block = iteratee(block);\n let mapped = [];\n let i = 0;\n for (let item of list) {\n mapped.push(block(item, i++));\n }\n return mapped;\n }\n function mapObject(array, pairer) {\n const merger = function (object, pair) {\n object[pair[0]] = pair[1];\n return object;\n };\n return map(array, pairer).reduce(merger, {});\n }\n function each(array, block) {\n let i = 0;\n for (let item of array) {\n block(item, i++);\n }\n }\n function isNull(object) {\n return object === null;\n }\n function isUndefined(object) {\n return object === undefined;\n }\n const isDefined = negate(isUndefined);\n function isMissing(object) {\n return isUndefined(object) || isNull(object);\n }\n const isGiven = negate(isMissing);\n function isBlank(value) {\n if (isMissing(value)) {\n return true;\n }\n if (isObject(value) && value[isBlank.key]) {\n return value[isBlank.key]();\n }\n if (isString(value) || isList(value)) {\n return value.length === 0;\n }\n if (isOptions(value)) {\n return Object.keys(value).length === 0;\n }\n return false;\n }\n isBlank.key = 'up.util.isBlank';\n function presence(value, tester = isPresent) {\n if (tester(value)) {\n return value;\n }\n }\n const isPresent = negate(isBlank);\n function isFunction(object) {\n return typeof (object) === 'function';\n }\n function isString(object) {\n return (typeof (object) === 'string') || object instanceof String;\n }\n function isBoolean(object) {\n return (typeof (object) === 'boolean') || object instanceof Boolean;\n }\n function isNumber(object) {\n return (typeof (object) === 'number') || object instanceof Number;\n }\n function isOptions(object) {\n return (typeof (object) === 'object') && !isNull(object) && (isUndefined(object.constructor) || (object.constructor === Object));\n }\n function isObject(object) {\n const typeOfResult = typeof (object);\n return ((typeOfResult === 'object') && !isNull(object)) || (typeOfResult === 'function');\n }\n function isElement(object) {\n return object instanceof Element;\n }\n function isRegExp(object) {\n return object instanceof RegExp;\n }\n function isError(object) {\n return object instanceof Error;\n }\n function isJQuery(object) {\n return up.browser.canJQuery() && object instanceof jQuery;\n }\n function isElementish(object) {\n return !!(object && (object.addEventListener || object[0]?.addEventListener));\n }\n function isPromise(object) {\n return isObject(object) && isFunction(object.then);\n }\n const { isArray } = Array;\n function isFormData(object) {\n return object instanceof FormData;\n }\n function toArray(value) {\n return isArray(value) ? value : copyArrayLike(value);\n }\n function isList(value) {\n return isArray(value) ||\n isNodeList(value) ||\n isArguments(value) ||\n isJQuery(value) ||\n isHTMLCollection(value);\n }\n function isNodeList(value) {\n return value instanceof NodeList;\n }\n function isHTMLCollection(value) {\n return value instanceof HTMLCollection;\n }\n function isArguments(value) {\n return Object.prototype.toString.call(value) === '[object Arguments]';\n }\n function wrapList(value) {\n if (isList(value)) {\n return value;\n }\n else if (isMissing(value)) {\n return [];\n }\n else {\n return [value];\n }\n }\n function copy(value) {\n if (isObject(value) && value[copy.key]) {\n value = value[copy.key]();\n }\n else if (isList(value)) {\n value = copyArrayLike(value);\n }\n else if (isOptions(value)) {\n value = Object.assign({}, value);\n }\n return value;\n }\n function copyArrayLike(arrayLike) {\n return Array.prototype.slice.call(arrayLike);\n }\n copy.key = 'up.util.copy';\n Date.prototype[copy.key] = function () { return new Date(+this); };\n function merge(...sources) {\n return Object.assign({}, ...sources);\n }\n function mergeDefined(...sources) {\n const result = {};\n for (let source of sources) {\n if (source) {\n for (let key in source) {\n const value = source[key];\n if (isDefined(value)) {\n result[key] = value;\n }\n }\n }\n }\n return result;\n }\n function newOptions(object, defaults) {\n if (defaults) {\n return merge(defaults, object);\n }\n else if (object) {\n return copy(object);\n }\n else {\n return {};\n }\n }\n function parseArgIntoOptions(args, argKey) {\n let options = extractOptions(args);\n if (isDefined(args[0])) {\n options = copy(options);\n options[argKey] = args[0];\n }\n return options;\n }\n function findInList(list, tester) {\n tester = iteratee(tester);\n let match;\n for (let element of list) {\n if (tester(element)) {\n match = element;\n break;\n }\n }\n return match;\n }\n function some(list, tester) {\n return !!findResult(list, tester);\n }\n function findResult(list, tester) {\n tester = iteratee(tester);\n let i = 0;\n for (let item of list) {\n const result = tester(item, i++);\n if (result) {\n return result;\n }\n }\n }\n function every(list, tester) {\n tester = iteratee(tester);\n let match = true;\n let i = 0;\n for (let item of list) {\n if (!tester(item, i++)) {\n match = false;\n break;\n }\n }\n return match;\n }\n function compact(array) {\n return filterList(array, isGiven);\n }\n function compactObject(object) {\n return pickBy(object, isGiven);\n }\n function uniq(array) {\n if (array.length < 2) {\n return array;\n }\n return Array.from(new Set(array));\n }\n function uniqBy(array, mapper) {\n if (array.length < 2) {\n return array;\n }\n mapper = iteratee(mapper);\n const seenElements = new Set();\n return filterList(array, function (elem, index) {\n const mapped = mapper(elem, index);\n if (seenElements.has(mapped)) {\n return false;\n }\n else {\n seenElements.add(mapped);\n return true;\n }\n });\n }\n function filterList(list, tester) {\n tester = iteratee(tester);\n const matches = [];\n each(list, function (element, index) {\n if (tester(element, index)) {\n return matches.push(element);\n }\n });\n return matches;\n }\n function reject(list, tester) {\n tester = negate(iteratee(tester));\n return filterList(list, tester);\n }\n function intersect(array1, array2) {\n return filterList(array1, element => contains(array2, element));\n }\n function scheduleTimer(millis, callback) {\n return setTimeout(callback, millis);\n }\n function queueTask(task) {\n return setTimeout(task);\n }\n function last(value) {\n return value[value.length - 1];\n }\n function contains(value, subValue) {\n let indexOf = value.indexOf || Array.prototype.indexOf;\n return indexOf.call(value, subValue) >= 0;\n }\n function containsAll(values, subValues) {\n return every(subValues, (subValue) => contains(values, subValue));\n }\n function objectContains(object, subObject) {\n const reducedValue = pick(object, Object.keys(subObject));\n return isEqual(subObject, reducedValue);\n }\n function pick(object, keys) {\n const filtered = {};\n for (let key of keys) {\n if (key in object) {\n filtered[key] = object[key];\n }\n }\n return filtered;\n }\n function pickBy(object, tester) {\n tester = iteratee(tester);\n const filtered = {};\n for (let key in object) {\n const value = object[key];\n if (tester(value, key, object)) {\n filtered[key] = object[key];\n }\n }\n return filtered;\n }\n function omit(object, keys) {\n return pickBy(object, (_value, key) => !contains(keys, key));\n }\n function unresolvablePromise() {\n return new Promise(noop);\n }\n function remove(array, element) {\n const index = array.indexOf(element);\n if (index >= 0) {\n array.splice(index, 1);\n return element;\n }\n }\n function evalOption(value, ...args) {\n return isFunction(value) ? value(...args) : value;\n }\n function evalAutoOption(value, autoMeans, ...args) {\n value = evalOption(value, ...args);\n if (value === 'auto') {\n value = evalOption(autoMeans, ...args);\n }\n return value;\n }\n const ESCAPE_HTML_ENTITY_MAP = {\n \"&\": \"&\",\n \"<\": \"<\",\n \">\": \">\",\n '\"': '"',\n \"'\": '''\n };\n function escapeHTML(string) {\n return string.replace(/[&<>\"']/g, char => ESCAPE_HTML_ENTITY_MAP[char]);\n }\n function escapeRegExp(string) {\n return string.replace(/[\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n }\n function pluckKey(object, key) {\n const value = object[key];\n delete object[key];\n return value;\n }\n function renameKey(object, oldKey, newKey) {\n return object[newKey] = pluckKey(object, oldKey);\n }\n function extractLastArg(args, tester) {\n if (tester(last(args))) {\n return args.pop();\n }\n }\n function extractCallback(args) {\n return extractLastArg(args, isFunction);\n }\n function extractOptions(args) {\n return extractLastArg(args, isOptions) || {};\n }\n function identity(arg) {\n return arg;\n }\n function sequence(functions) {\n functions = compact(functions);\n return (...args) => map(functions, fn => fn(...args));\n }\n function flatten(array) {\n const flattened = [];\n for (let object of array) {\n if (isList(object)) {\n flattened.push(...object);\n }\n else {\n flattened.push(object);\n }\n }\n return flattened;\n }\n function flatMap(array, block) {\n return flatten(map(array, block));\n }\n function always(promise, callback = identity) {\n return promise.then(callback, callback);\n }\n function newDeferred() {\n let resolveFn;\n let rejectFn;\n const nativePromise = new Promise(function (givenResolve, givenReject) {\n resolveFn = givenResolve;\n rejectFn = givenReject;\n });\n nativePromise.resolve = resolveFn;\n nativePromise.reject = rejectFn;\n return nativePromise;\n }\n function isBasicObjectProperty(k) {\n return Object.prototype.hasOwnProperty(k);\n }\n function isEqual(a, b) {\n if (a?.valueOf) {\n a = a.valueOf();\n }\n if (b?.valueOf) {\n b = b.valueOf();\n }\n if (typeof (a) !== typeof (b)) {\n return false;\n }\n else if (isList(a) && isList(b)) {\n return isEqualList(a, b);\n }\n else if (isObject(a) && a[isEqual.key]) {\n return a[isEqual.key](b);\n }\n else if (isOptions(a) && isOptions(b)) {\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n if (isEqualList(aKeys, bKeys)) {\n return every(aKeys, aKey => isEqual(a[aKey], b[aKey]));\n }\n else {\n return false;\n }\n }\n else {\n return a === b;\n }\n }\n isEqual.key = 'up.util.isEqual';\n function isEqualList(a, b) {\n return (a.length === b.length) && every(a, (elem, index) => isEqual(elem, b[index]));\n }\n const PARSE_TOKEN_PATTERNS = {\n 'space/or': /\\s+(?:or\\s+)?/,\n 'or': /\\s+or\\s+/,\n 'comma': /\\s*,\\s*/\n };\n function parseTokens(value, options = {}) {\n if (isString(value)) {\n value = value.trim();\n if (options.json && /^\\[.*]$/.test(value)) {\n return JSON.parse(value);\n }\n else {\n let separator = options.separator || 'space/or';\n let pattern = PARSE_TOKEN_PATTERNS[separator];\n return value.split(pattern);\n }\n }\n else {\n return wrapList(value);\n }\n }\n function wrapValue(constructor, ...args) {\n return (args[0] instanceof constructor) ? args[0] : new constructor(...args);\n }\n let nextUid = 0;\n function uid() {\n return nextUid++;\n }\n function reverse(list) {\n return copy(list).reverse();\n }\n function replaceValue(value, matchValue, replacementValue) {\n if (value === matchValue) {\n return replacementValue;\n }\n else {\n return value;\n }\n }\n function renameKeys(object, renameKeyFn) {\n const renamed = {};\n for (let key in object) {\n renamed[renameKeyFn(key)] = object[key];\n }\n return renamed;\n }\n function camelToKebabCase(str) {\n return str.replace(/[A-Z]/g, char => '-' + char.toLowerCase());\n }\n function lowerCaseFirst(str) {\n return str[0].toLowerCase() + str.slice(1);\n }\n function upperCaseFirst(str) {\n return str[0].toUpperCase() + str.slice(1);\n }\n function defineDelegates(object, props, targetProvider) {\n for (let prop of props) {\n Object.defineProperty(object, prop, {\n get() {\n const target = targetProvider.call(this);\n let value = target[prop];\n if (isFunction(value)) {\n value = value.bind(target);\n }\n return value;\n },\n set(newValue) {\n const target = targetProvider.call(this);\n target[prop] = newValue;\n }\n });\n }\n }\n function stringifyArg(arg, placeholder = '%o') {\n let string;\n const maxLength = 200;\n if (placeholder === '%c') {\n return '';\n }\n if (placeholder === '%s' && isGiven(arg)) {\n arg = arg.toString();\n }\n if (isString(arg)) {\n string = arg.trim().replace(/[\\n\\r\\t ]+/g, ' ');\n if (placeholder === '%o') {\n string = JSON.stringify(string);\n }\n }\n else if (isUndefined(arg)) {\n string = 'undefined';\n }\n else if (isNumber(arg) || isFunction(arg)) {\n string = arg.toString();\n }\n else if (isArray(arg)) {\n string = `[${map(arg, stringifyArg).join(', ')}]`;\n }\n else if (isJQuery(arg)) {\n string = `$(${map(arg, stringifyArg).join(', ')})`;\n }\n else if (isElement(arg)) {\n string = `<${arg.tagName.toLowerCase()}`;\n for (let attr of ['id', 'up-id', 'name', 'class']) {\n let value = arg.getAttribute(attr);\n if (value) {\n string += ` ${attr}=\"${value}\"`;\n }\n }\n string += \">\";\n }\n else if (isRegExp(arg) || isError(arg)) {\n string = arg.toString();\n }\n else {\n try {\n string = JSON.stringify(arg);\n }\n catch (error) {\n if (error.name === 'TypeError') {\n string = '(circular structure)';\n }\n else {\n throw error;\n }\n }\n }\n if (string.length > maxLength) {\n string = `${string.substr(0, maxLength)}\u2026${last(string)}`;\n }\n return string;\n }\n const SPRINTF_PLACEHOLDERS = /%[oOdisfc]/g;\n function sprintf(message, ...args) {\n return message.replace(SPRINTF_PLACEHOLDERS, (placeholder) => stringifyArg(args.shift(), placeholder));\n }\n function negate(fn) {\n return function (...args) {\n return !fn(...args);\n };\n }\n function useMemoizeCacheEntry(cacheEntry) {\n if (cacheEntry.error) {\n throw cacheEntry.error;\n }\n else {\n return cacheEntry.value;\n }\n }\n function buildMemoizeCacheEntry(oldImpl, self, args) {\n try {\n return { value: oldImpl.apply(self, args) };\n }\n catch (e) {\n return { error: e };\n }\n }\n function memoizeMethod(object, propLiteral) {\n for (let prop in propLiteral) {\n let originalDescriptor = Object.getOwnPropertyDescriptor(object, prop);\n let oldImpl = originalDescriptor.value;\n let cachingImpl = function (...args) {\n let cache = this[`__${prop}MemoizeCache`] ||= {};\n let cacheKey = JSON.stringify(args);\n cache[cacheKey] ||= buildMemoizeCacheEntry(oldImpl, this, args);\n return useMemoizeCacheEntry(cache[cacheKey]);\n };\n object[prop] = cachingImpl;\n }\n }\n function safeStringifyJSON(value) {\n let json = JSON.stringify(value);\n return escapeHighASCII(json);\n }\n function escapeHighASCII(string) {\n let unicodeEscape = (char) => \"\\\\u\" + char.charCodeAt(0).toString(16).padStart(4, '0');\n return string.replace(/[^\\x00-\\x7F]/g, unicodeEscape);\n }\n function variant(source, changes = {}) {\n let variant = Object.create(source);\n Object.assign(variant, changes);\n return variant;\n }\n return {\n parseURL,\n normalizeURL,\n matchableURL,\n matchableURLPatternAtom,\n matchURLs,\n normalizeMethod,\n methodAllowsPayload,\n copy,\n merge,\n mergeDefined,\n options: newOptions,\n parseArgIntoOptions,\n each,\n map,\n flatMap,\n mapObject,\n findResult,\n some,\n every,\n find: findInList,\n filter: filterList,\n reject,\n intersect,\n compact,\n compactObject,\n uniq,\n uniqBy,\n last,\n isNull,\n isDefined,\n isUndefined,\n isGiven,\n isMissing,\n isPresent,\n isBlank,\n presence,\n isObject,\n isFunction,\n isString,\n isBoolean,\n isNumber,\n isElement,\n isJQuery,\n isElementish,\n isPromise,\n isOptions,\n isArray,\n isFormData,\n isList,\n isRegExp,\n timer: scheduleTimer,\n contains,\n containsAll,\n objectContains,\n toArray,\n pick,\n pickBy,\n omit,\n unresolvablePromise,\n remove,\n memoize,\n pluckKey,\n renameKey,\n extractOptions,\n extractCallback,\n noop,\n asyncNoop,\n identity,\n escapeHTML,\n escapeRegExp,\n sequence,\n evalOption,\n evalAutoOption,\n flatten,\n newDeferred,\n always,\n isBasicObjectProperty,\n isCrossOrigin,\n task: queueTask,\n isEqual,\n parseTokens,\n wrapList,\n wrapValue,\n uid,\n upperCaseFirst,\n lowerCaseFirst,\n delegate: defineDelegates,\n reverse,\n camelToKebabCase,\n replaceValue,\n sprintf,\n renameKeys,\n memoizeMethod,\n safeStringifyJSON,\n variant,\n };\n})();\n\n\n/***/ }),\n/* 4 */\n/***/ (() => {\n\nup.error = (function () {\n function fail(...args) {\n throw new up.Error(args);\n }\n function isCritical(error) {\n return (typeof error !== 'object') || ((error.name !== 'AbortError') && !(error instanceof up.RenderResult) && !(error instanceof up.Response));\n }\n function muteUncriticalRejection(promise) {\n return promise.catch(throwCritical);\n }\n function muteUncriticalSync(block) {\n try {\n return block();\n }\n catch (e) {\n throwCritical(e);\n }\n }\n function throwCritical(value) {\n if (isCritical(value)) {\n throw value;\n }\n }\n function report(error) {\n console.error('Uncaught %o', error);\n let event = new ErrorEvent('error', { error, message: 'Uncaught ' + error });\n window.dispatchEvent(event);\n }\n function guard(fn) {\n try {\n return fn();\n }\n catch (error) {\n report(error);\n }\n }\n function guardFn(fn) {\n return (...args) => guard(() => fn(...args));\n }\n return {\n fail,\n throwCritical,\n muteUncriticalRejection,\n muteUncriticalSync,\n guard,\n guardFn,\n };\n})();\nup.fail = up.error.fail;\n\n\n/***/ }),\n/* 5 */\n/***/ (() => {\n\nup.migrate = {\n config: {},\n};\n\n\n/***/ }),\n/* 6 */\n/***/ (() => {\n\nup.browser = (function () {\n const u = up.util;\n function submitForm(form) {\n form.submit();\n }\n function canPushState() {\n return up.protocol.initialRequestMethod() === 'GET';\n }\n function canJQuery() {\n return !!window.jQuery;\n }\n const canHasSelector = u.memoize(() => CSS.supports('selector(:has(*))'));\n function popCookie(name) {\n let value = document.cookie.match(new RegExp(name + \"=(\\\\w+)\"))?.[1];\n if (value) {\n document.cookie = name + '=;Max-Age=0;Path=/';\n return value;\n }\n }\n function assertConfirmed(options) {\n const confirmed = !options.confirm || window.confirm(options.confirm);\n if (!confirmed) {\n throw new up.Aborted('User canceled action');\n }\n return true;\n }\n return {\n submitForm,\n canPushState,\n canJQuery,\n assertConfirmed,\n popCookie,\n canHasSelector,\n };\n})();\n\n\n/***/ }),\n/* 7 */\n/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {\n\n__webpack_require__(8);\nup.element = (function () {\n const u = up.util;\n function first(...args) {\n const selector = args.pop();\n const root = args[0] || document;\n return root.querySelector(selector);\n }\n function subtree(root, selector) {\n const results = [];\n if (root.matches(selector)) {\n results.push(root);\n }\n results.push(...root.querySelectorAll(selector));\n return results;\n }\n function contains(root, selectorOrElement) {\n const element = getOne(selectorOrElement);\n return Node.prototype.contains.call(root, element);\n }\n function ancestor(element, selector) {\n return element.parentNode?.closest(selector);\n }\n function around(element, selector) {\n return getList(element.closest(selector), subtree(element, selector));\n }\n function getOne(...args) {\n const value = args.pop();\n if (u.isElement(value)) {\n return value;\n }\n else if (u.isString(value)) {\n return first(...args, value);\n }\n else if (u.isList(value)) {\n if (value.length > 1) {\n up.fail('up.element.get(): Cannot cast multiple elements (%o) to a single element', value);\n }\n return value[0];\n }\n else {\n return value;\n }\n }\n function getList(...args) {\n return u.flatMap(args, valueToList);\n }\n function valueToList(value) {\n if (u.isString(value)) {\n return document.querySelectorAll(value);\n }\n else {\n return u.wrapList(value);\n }\n }\n function hide(element) {\n element.setAttribute('hidden', '');\n }\n function show(element) {\n element.removeAttribute('hidden');\n if (element.style.display === 'none') {\n element.style.display = '';\n }\n }\n function toggle(element, newVisible) {\n if (newVisible == null) {\n newVisible = !isVisible(element);\n }\n (newVisible ? show : hide)(element);\n }\n function toggleAttr(element, attr, value, newPresent) {\n if (newPresent == null) {\n newPresent = !element.hasAttribute(attr);\n }\n if (newPresent) {\n return element.setAttribute(attr, value);\n }\n else {\n return element.removeAttribute(attr);\n }\n }\n function setAttrs(element, attrs) {\n for (let key in attrs) {\n const value = attrs[key];\n if (u.isGiven(value)) {\n element.setAttribute(key, value);\n }\n else {\n element.removeAttribute(key);\n }\n }\n }\n function setTemporaryAttrs(element, attrs) {\n const oldAttrs = {};\n for (let key of Object.keys(attrs)) {\n oldAttrs[key] = element.getAttribute(key);\n }\n setAttrs(element, attrs);\n return () => setAttrs(element, oldAttrs);\n }\n function metaContent(name) {\n const selector = \"meta\" + attrSelector('name', name);\n return first(selector)?.getAttribute('content');\n }\n function insertBefore(existingElement, newElement) {\n existingElement.insertAdjacentElement('beforebegin', newElement);\n }\n function createFromSelector(selector, attrs = {}) {\n let { includePath } = parseSelector(selector);\n let rootElement;\n let depthElement;\n let previousElement;\n for (let includeSegment of includePath) {\n let { tagName, id, classNames, attributes } = includeSegment;\n if (!tagName || tagName === '*') {\n tagName = 'div';\n }\n depthElement = document.createElement(tagName);\n if (!rootElement) {\n rootElement = depthElement;\n }\n if (id) {\n depthElement.id = id;\n }\n for (let className of classNames) {\n depthElement.classList.add(className);\n }\n for (let attributeName in attributes) {\n let attributeValue = attributes[attributeName];\n depthElement.setAttribute(attributeName, attributeValue || '');\n }\n previousElement?.appendChild(depthElement);\n previousElement = depthElement;\n }\n for (let key in attrs) {\n let value = attrs[key];\n if (key === 'class') {\n for (let klass of u.wrapList(value)) {\n rootElement.classList.add(klass);\n }\n }\n else if (key === 'style') {\n setInlineStyle(rootElement, value);\n }\n else if (key === 'text') {\n rootElement.textContent = value;\n }\n else if (key === 'content') {\n rootElement.innerHTML = value;\n }\n else {\n rootElement.setAttribute(key, value);\n }\n }\n return rootElement;\n }\n function parseSelector(selector) {\n let excludeRaw;\n const includeRaw = selector.replace(/:not\\([^)]+\\)/, function (match) {\n excludeRaw = match;\n return '';\n });\n const [includeSelectorWithoutAttrValues, attrValues] = removeAttrSelectorValues(includeRaw);\n const includeSegments = includeSelectorWithoutAttrValues.split(/[ >]+/);\n let includePath = includeSegments.map(function (depthSelector) {\n let parsed = {\n tagName: null,\n classNames: [],\n id: null,\n attributes: {}\n };\n depthSelector = depthSelector.replace(/^[\\w-*]+/, function (match) {\n parsed.tagName = match;\n return '';\n });\n depthSelector = depthSelector.replace(/#([\\w-]+)/, function (_match, id) {\n parsed.id = id;\n return '';\n });\n depthSelector = depthSelector.replace(/\\.([\\w-]+)/g, function (_match, className) {\n parsed.classNames.push(className);\n return '';\n });\n if (attrValues.length) {\n depthSelector = replaceAttrSelectors(depthSelector, function ({ name }) {\n parsed.attributes[name] = attrValues.shift();\n return '';\n });\n }\n if (depthSelector) {\n up.fail('Cannot parse selector: ' + selector);\n }\n return parsed;\n });\n return {\n includePath,\n includeRaw,\n excludeRaw,\n };\n }\n const ATTR_SELECTOR_PATTERN = /\\[([\\w-]+)(?:([~|^$*]?=)([\"'])?([^\\3\\]]*?)\\3)?]/g;\n function replaceAttrSelectors(string, replacement) {\n return string.replace(ATTR_SELECTOR_PATTERN, function (_match, name, operator, quote, value) {\n if (value) {\n value = value.replace(/\\\\([\\\\\"'])/, '$1');\n }\n return replacement({ name, operator, quote, value });\n });\n }\n function removeAttrSelectorValues(selector) {\n let values = [];\n selector = replaceAttrSelectors(selector, function ({ name, value }) {\n values.push(value);\n return `[${name}]`;\n });\n return [selector, values];\n }\n function affix(parent, ...args) {\n let position, selector;\n const attributes = u.extractOptions(args);\n if (args.length === 2) {\n [position, selector] = args;\n }\n else {\n position = 'beforeend';\n selector = args[0];\n }\n const element = createFromSelector(selector, attributes);\n parent.insertAdjacentElement(position, element);\n return element;\n }\n const SINGLETON_TAG_NAMES = ['HTML', 'BODY', 'HEAD', 'TITLE'];\n const isSingleton = up.mockable(element => element.matches(SINGLETON_TAG_NAMES.join()));\n function elementTagName(element) {\n return element.tagName.toLowerCase();\n }\n function attrSelector(attribute, value) {\n if (u.isGiven(value)) {\n value = value.replace(/\"/g, '\\\\\"');\n return `[${attribute}=\"${value}\"]`;\n }\n else {\n return `[${attribute}]`;\n }\n }\n function idSelector(id) {\n if (id.match(/^[a-z][a-z0-9\\-_]*$/i)) {\n return `#${id}`;\n }\n else {\n return attrSelector('id', id);\n }\n }\n function classSelector(klass) {\n klass = klass.replace(/[^\\w-]/g, '\\\\$&');\n return `.${klass}`;\n }\n function createBrokenDocumentFromHTML(html) {\n return new DOMParser().parseFromString(html, 'text/html');\n }\n function fixParserDamage(scriptish) {\n let clone = createFromHTML(scriptish.outerHTML);\n scriptish.replaceWith(clone);\n }\n function createFromHTML(html) {\n const range = document.createRange();\n range.setStart(document.body, 0);\n const fragment = range.createContextualFragment(html.trim());\n let elements = fragment.childNodes;\n if (elements.length !== 1) {\n throw new Error('HTML must have a single root element');\n }\n return elements[0];\n }\n function getRoot() {\n return document.documentElement;\n }\n function paint(element) {\n element.offsetHeight;\n }\n function concludeCSSTransition(element) {\n const undo = setTemporaryStyle(element, { transition: 'none' });\n paint(element);\n return undo;\n }\n function hasCSSTransition(styleHash) {\n const prop = styleHash['transition-property'];\n const duration = styleHash['transition-duration'];\n const noTransition = ((prop === 'none') || ((prop === 'all') && (duration === 0)));\n return !noTransition;\n }\n function fixedToAbsolute(element) {\n const elementRectAsFixed = element.getBoundingClientRect();\n element.style.position = 'absolute';\n const offsetParentRect = element.offsetParent.getBoundingClientRect();\n setInlineStyle(element, {\n left: (elementRectAsFixed.left - computedStyleNumber(element, 'margin-left') - offsetParentRect.left) + 'px',\n top: (elementRectAsFixed.top - computedStyleNumber(element, 'margin-top') - offsetParentRect.top) + 'px',\n right: '',\n bottom: ''\n });\n }\n function setMissingAttrs(element, attrs) {\n for (let key in attrs) {\n setMissingAttr(element, key, attrs[key]);\n }\n }\n function setMissingAttr(element, key, value) {\n if (u.isMissing(element.getAttribute(key))) {\n element.setAttribute(key, value);\n }\n }\n function unwrap(wrapper) {\n preservingFocus(function () {\n const parent = wrapper.parentNode;\n const wrappedNodes = u.toArray(wrapper.childNodes);\n u.each(wrappedNodes, wrappedNode => parent.insertBefore(wrappedNode, wrapper));\n parent.removeChild(wrapper);\n });\n }\n function wrapChildren(element) {\n let childNode;\n const wrapper = document.createElement('up-wrapper');\n while ((childNode = element.firstChild)) {\n wrapper.appendChild(childNode);\n }\n element.appendChild(wrapper);\n return wrapper;\n }\n function preservingFocus(fn) {\n const oldFocusElement = document.activeElement;\n try {\n return fn();\n }\n finally {\n if (oldFocusElement && oldFocusElement !== document.activeElement) {\n oldFocusElement.focus({ preventScroll: true });\n }\n }\n }\n function stringAttr(element, attribute) {\n let value = element.getAttribute(attribute);\n return u.replaceValue(value, null, undefined);\n }\n function booleanAttr(element, attribute, pass) {\n if (!element.hasAttribute(attribute))\n return;\n const value = stringAttr(element, attribute);\n switch (value) {\n case 'false': {\n return false;\n }\n case 'true':\n case '':\n case attribute: {\n return true;\n }\n default: {\n if (pass) {\n return value;\n }\n else {\n return true;\n }\n }\n }\n }\n function booleanOrStringAttr(element, attribute, trueValue = true) {\n let value = booleanAttr(element, attribute, true);\n return value === true ? trueValue : value;\n }\n function numberAttr(element, attribute) {\n let value = element.getAttribute(attribute);\n if (value) {\n value = value.replace(/_/g, '');\n if (value.match(/^-?[\\d.]+$/)) {\n return parseFloat(value);\n }\n }\n }\n function jsonAttr(element, attribute) {\n let json = element.getAttribute?.(attribute)?.trim();\n if (json) {\n return JSON.parse(json);\n }\n }\n function callbackAttr(link, attr, { exposedKeys = [], mainKey = 'event' } = {}) {\n let code = link.getAttribute(attr);\n if (code) {\n const callback = up.NonceableCallback.fromString(code).toFunction(mainKey, ...exposedKeys);\n return function (event) {\n const exposedValues = Object.values(u.pick(event, exposedKeys));\n return callback.call(link, event, ...exposedValues);\n };\n }\n }\n function closestAttr(element, attr, parseFn = stringAttr) {\n let match = element.closest('[' + attr + ']');\n if (match) {\n return parseFn(match, attr);\n }\n }\n function setTemporaryStyle(element, newStyles) {\n const oldStyles = inlineStyle(element, Object.keys(newStyles));\n setInlineStyle(element, newStyles);\n return () => setInlineStyle(element, oldStyles);\n }\n function addTemporaryClass(element, klass) {\n element.classList.add(klass);\n return () => element.classList.remove(klass);\n }\n function computedStyle(element, props) {\n const style = window.getComputedStyle(element);\n return extractFromStyleObject(style, props);\n }\n function computedStyleNumber(element, prop) {\n const rawValue = computedStyle(element, prop);\n if (u.isPresent(rawValue)) {\n return parseFloat(rawValue);\n }\n }\n function inlineStyle(element, props) {\n const { style } = element;\n return extractFromStyleObject(style, props);\n }\n function extractFromStyleObject(style, keyOrKeys) {\n if (up.migrate.loaded)\n keyOrKeys = up.migrate.fixStyleProps(keyOrKeys);\n if (u.isString(keyOrKeys)) {\n return style.getPropertyValue(keyOrKeys);\n }\n else {\n return u.mapObject(keyOrKeys, (key) => [key, style.getPropertyValue(key)]);\n }\n }\n function setInlineStyle(element, props, unit = '') {\n if (up.migrate.loaded)\n props = up.migrate.fixStyleProps(props, unit);\n if (u.isString(props)) {\n element.setAttribute('style', props);\n }\n else {\n const { style } = element;\n for (let key in props) {\n let value = props[key];\n style.setProperty(key, value + unit);\n }\n }\n }\n function isVisible(element) {\n return !!(element.offsetWidth || element.offsetHeight || element.getClientRects().length);\n }\n function isUpPrefixed(string) {\n return /^up-/.test(string);\n }\n function upAttrs(element) {\n let attrNames = u.filter(element.getAttributeNames(), isUpPrefixed);\n return u.mapObject(attrNames, (name) => [name, element.getAttribute(name)]);\n }\n function upClasses(element) {\n return u.filter(element.classList.values(), isUpPrefixed);\n }\n function cleanJQuery(element) {\n if (up.browser.canJQuery()) {\n jQuery(element).remove();\n }\n }\n function isEmpty(element) {\n return !element.children.length > 0 && !element.innerText.trim();\n }\n function crossOriginSelector(attr) {\n return `[${attr}*=\"//\"]:not([${attr}*=\"//${location.host}/\"])`;\n }\n function isIntersectingWindow(element, { margin = 0 } = {}) {\n const rect = up.Rect.fromElement(element);\n rect.grow(margin);\n return (rect.bottom > 0) && (rect.top < window.innerHeight) &&\n (rect.right > 0) && (rect.left < window.innerWidth);\n }\n function unionSelector(includes, excludes) {\n let selector = `:is(${includes.join()})`;\n if (u.isPresent(excludes))\n selector += `:not(${excludes.join()})`;\n return selector;\n }\n return {\n subtree,\n contains,\n closestAttr,\n ancestor,\n around,\n get: getOne,\n list: getList,\n toggle,\n hide,\n show,\n metaContent,\n insertBefore,\n createFromSelector,\n setAttrs,\n setTemporaryAttrs,\n affix,\n idSelector,\n classSelector,\n isSingleton,\n attrSelector,\n tagName: elementTagName,\n createBrokenDocumentFromHTML,\n fixParserDamage,\n createFromHTML,\n get root() { return getRoot(); },\n paint,\n concludeCSSTransition,\n hasCSSTransition,\n fixedToAbsolute,\n setMissingAttrs,\n setMissingAttr,\n unwrap,\n wrapChildren,\n attr: stringAttr,\n booleanAttr,\n numberAttr,\n jsonAttr,\n callbackAttr,\n booleanOrStringAttr,\n setTemporaryStyle,\n style: computedStyle,\n styleNumber: computedStyleNumber,\n inlineStyle,\n setStyle: setInlineStyle,\n isVisible,\n upAttrs,\n upClasses,\n toggleAttr,\n addTemporaryClass,\n cleanJQuery,\n parseSelector,\n isEmpty,\n crossOriginSelector,\n isIntersectingWindow,\n unionSelector,\n };\n})();\n\n\n/***/ }),\n/* 8 */\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n/***/ }),\n/* 9 */\n/***/ (() => {\n\nup.Error = class Error extends window.Error {\n constructor(message, props = {}) {\n if (Array.isArray(message)) {\n message = up.util.sprintf(...message);\n }\n super(message);\n let name = 'up.' + this.constructor.name;\n Object.assign(this, { name }, props);\n }\n};\n\n\n/***/ }),\n/* 10 */\n/***/ (() => {\n\nup.NotImplemented = class NotImplemented extends up.Error {\n};\n\n\n/***/ }),\n/* 11 */\n/***/ (() => {\n\nup.Aborted = class Aborted extends up.Error {\n constructor(message) {\n super(message, { name: 'AbortError' });\n }\n};\n\n\n/***/ }),\n/* 12 */\n/***/ (() => {\n\nup.CannotMatch = class CannotMatch extends up.Error {\n};\n\n\n/***/ }),\n/* 13 */\n/***/ (() => {\n\nup.CannotParse = class CannotParse extends up.Error {\n};\n\n\n/***/ }),\n/* 14 */\n/***/ (() => {\n\nup.CannotTarget = class CannotTarget extends up.Error {\n};\n\n\n/***/ }),\n/* 15 */\n/***/ (() => {\n\nup.Offline = class Offline extends up.Error {\n};\n\n\n/***/ }),\n/* 16 */\n/***/ (() => {\n\nconst u = up.util;\nup.Record = class Record {\n keys() {\n throw 'Return an array of keys';\n }\n defaults(_options) {\n return {};\n }\n constructor(options) {\n Object.assign(this, this.defaults(options), this.attributes(options));\n }\n attributes(source = this) {\n return u.pick(source, this.keys());\n }\n [u.copy.key]() {\n return u.variant(this);\n }\n [u.isEqual.key](other) {\n return (this.constructor === other.constructor) && u.isEqual(this.attributes(), other.attributes());\n }\n};\n\n\n/***/ }),\n/* 17 */\n/***/ (() => {\n\nconst u = up.util;\nconst e = up.element;\nup.Config = class Config {\n constructor(blueprintFn = (() => ({}))) {\n this._blueprintFn = blueprintFn;\n this.reset();\n document.addEventListener('up:framework:reset', () => this.reset());\n }\n reset() {\n Object.assign(this, this._blueprintFn());\n }\n matches(element, prop) {\n return element.matches(this.selector(prop));\n }\n selector(prop) {\n let includes = this[prop];\n let excludes = this['no' + u.upperCaseFirst(prop)];\n return e.unionSelector(includes, excludes);\n }\n selectorFn(prop) {\n return () => this.selector(prop);\n }\n};\n\n\n/***/ }),\n/* 18 */\n/***/ (() => {\n\nlet enabledKey = 'up.log.enabled';\nlet enabled = false;\ntry {\n enabled = !!sessionStorage?.getItem(enabledKey);\n}\ncatch {\n}\nup.LogConfig = class LogConfig extends up.Config {\n constructor() {\n super(() => ({\n banner: true,\n format: true,\n }));\n }\n get enabled() {\n return enabled;\n }\n set enabled(newEnabled) {\n enabled = newEnabled;\n try {\n sessionStorage?.setItem(enabledKey, newEnabled ? '1' : '');\n }\n catch {\n }\n }\n};\n\n\n/***/ }),\n/* 19 */\n/***/ (() => {\n\nconst u = up.util;\nconst e = up.element;\nup.OptionsParser = class OptionsParser {\n constructor(element, options, parserOptions = {}) {\n this._options = options;\n this._element = element;\n this._parserOptions = parserOptions;\n this._fail = parserOptions.fail;\n this._closest = parserOptions.closest;\n this._attrPrefix = parserOptions.attrPrefix || 'up-';\n this._defaults = parserOptions.defaults || {};\n }\n string(key, keyOptions) {\n this.parse(e.attr, key, keyOptions);\n }\n boolean(key, keyOptions) {\n this.parse(e.booleanAttr, key, keyOptions);\n }\n number(key, keyOptions) {\n this.parse(e.numberAttr, key, keyOptions);\n }\n booleanOrString(key, keyOptions) {\n this.parse(e.booleanOrStringAttr, key, keyOptions);\n }\n json(key, keyOptions) {\n this.parse(e.jsonAttr, key, keyOptions);\n }\n callback(key, keyOptions = {}) {\n let parser = (link, attr) => e.callbackAttr(link, attr, keyOptions);\n this.parse(parser, key, keyOptions);\n }\n parse(attrValueFn, key, keyOptions = {}) {\n const attrNames = u.wrapList(keyOptions.attr ?? this._attrNameForKey(key));\n let value = this._options[key];\n for (let attrName of attrNames) {\n value ??= this._parseFromAttr(attrValueFn, this._element, attrName);\n }\n value ??= keyOptions.default ?? this._defaults[key];\n let normalizeFn = keyOptions.normalize;\n if (normalizeFn) {\n value = normalizeFn(value);\n }\n if (u.isDefined(value)) {\n this._options[key] = value;\n }\n let failKey;\n if (this._fail && (failKey = up.fragment.failKey(key))) {\n const failAttrNames = u.compact(u.map(attrNames, (attrName) => this._deriveFailAttrName(attrName)));\n this.parse(attrValueFn, failKey, { ...keyOptions, attr: failAttrNames });\n }\n }\n include(optionsFn) {\n let fnResult = optionsFn(this._element, this._options, this._parserOptions);\n Object.assign(this._options, fnResult);\n }\n _parseFromAttr(attrValueFn, element, attrName) {\n if (this._closest) {\n return e.closestAttr(element, attrName, attrValueFn);\n }\n else {\n return attrValueFn(element, attrName);\n }\n }\n _deriveFailAttrName(attr) {\n return this._deriveFailAttrNameForPrefix(attr, this._attrPrefix + 'on-') ||\n this._deriveFailAttrNameForPrefix(attr, this._attrPrefix);\n }\n _deriveFailAttrNameForPrefix(attr, prefix) {\n if (attr.startsWith(prefix)) {\n return `${prefix}fail-${attr.substring(prefix.length)}`;\n }\n }\n _attrNameForKey(option) {\n return `${this._attrPrefix}${u.camelToKebabCase(option)}`;\n }\n};\n\n\n/***/ }),\n/* 20 */\n/***/ (() => {\n\nconst u = up.util;\nup.FIFOCache = class FIFOCache {\n constructor({ capacity = 10, normalizeKey = u.identity } = {}) {\n this._map = new Map();\n this._capacity = capacity;\n this._normalizeKey = normalizeKey;\n }\n get(key) {\n key = this._normalizeKey(key);\n return this._map.get(key);\n }\n set(key, value) {\n if (this._map.size === this._capacity) {\n let oldestKey = this._map.keys().next().value;\n this._map.delete(oldestKey);\n }\n key = this._normalizeKey(key);\n this._map.set(key, value);\n }\n clear() {\n this._map.clear();\n }\n};\n\n\n/***/ }),\n/* 21 */\n/***/ (() => {\n\nup.Rect = class Rect extends up.Record {\n keys() {\n return [\n 'left',\n 'top',\n 'width',\n 'height'\n ];\n }\n get bottom() {\n return this.top + this.height;\n }\n get right() {\n return this.left + this.width;\n }\n grow(padding) {\n this.left -= padding;\n this.top -= padding;\n this.width += padding * 2;\n this.height += padding * 2;\n }\n static fromElement(element) {\n return new (this)(element.getBoundingClientRect());\n }\n};\n\n\n/***/ }),\n/* 22 */\n/***/ (() => {\n\nconst e = up.element;\nconst SHIFT_CLASS = 'up-scrollbar-away';\nup.BodyShifter = class BodyShifter {\n constructor() {\n this._anchoredElements = new Set();\n this._stack = 0;\n this._cleaners = [];\n }\n lowerStack() {\n if (--this._stack === 0)\n this._unshiftNow();\n }\n raiseStack() {\n if (++this._stack === 1)\n this._shiftNow();\n }\n onAnchoredElementInserted(element) {\n this._anchoredElements.add(element);\n this._shiftElement(element, 'right');\n return () => this._anchoredElements.delete(element);\n }\n _isShifted() {\n return this._rootScrollbarWidth && this._stack > 0;\n }\n _shiftNow() {\n this._rootScrollbarWidth = up.viewport.rootScrollbarWidth();\n this._cleaners.push(e.setTemporaryStyle(e.root, {\n '--up-scrollbar-width': this._rootScrollbarWidth + 'px'\n }));\n this._shiftElement(document.body, 'padding-right');\n for (let element of this._anchoredElements) {\n this._shiftElement(element, 'right');\n }\n }\n _shiftElement(element, styleProp) {\n if (!this._isShifted())\n return;\n let originalValue = e.style(element, styleProp);\n this._cleaners.push(e.setTemporaryStyle(element, { ['--up-original-' + styleProp]: originalValue }), e.addTemporaryClass(element, SHIFT_CLASS));\n }\n _unshiftNow() {\n let cleaner;\n while (cleaner = this._cleaners.pop()) {\n cleaner();\n }\n }\n};\n\n\n/***/ }),\n/* 23 */\n/***/ (() => {\n\nconst u = up.util;\nup.Change = class Change {\n constructor(options) {\n this.options = options;\n }\n execute() {\n throw new up.NotImplemented();\n }\n onFinished(renderResult) {\n return this.options.onFinished?.(renderResult);\n }\n improveHistoryValue(existingValue, newValue) {\n if ((existingValue === false) || u.isString(existingValue)) {\n return existingValue;\n }\n else {\n return newValue;\n }\n }\n deriveFailOptions() {\n return up.RenderOptions.deriveFailOptions(this.options);\n }\n};\n\n\n/***/ }),\n/* 24 */\n/***/ (() => {\n\nconst u = up.util;\nconst e = up.element;\nup.Change.Addition = class Addition extends up.Change {\n constructor(options) {\n super(options);\n this._acceptLayer = options.acceptLayer;\n this._dismissLayer = options.dismissLayer;\n this._eventPlans = options.eventPlans || [];\n this._response = options.response;\n }\n handleLayerChangeRequests() {\n if (this.layer.isOverlay()) {\n this.tryAcceptLayerFromServer();\n this.abortWhenLayerClosed();\n this.layer.tryAcceptForLocation(this.responseOption());\n this.abortWhenLayerClosed();\n this.tryDismissLayerFromServer();\n this.abortWhenLayerClosed();\n this.layer.tryDismissForLocation(this.responseOption());\n this.abortWhenLayerClosed();\n }\n this.layer.asCurrent(() => {\n for (let eventPlan of this._eventPlans) {\n up.emit({ ...eventPlan, ...this.responseOption() });\n this.abortWhenLayerClosed();\n }\n });\n }\n tryAcceptLayerFromServer() {\n if (u.isDefined(this._acceptLayer) && this.layer.isOverlay()) {\n this.layer.accept(this._acceptLayer, this.responseOption());\n }\n }\n tryDismissLayerFromServer() {\n if (u.isDefined(this._dismissLayer) && this.layer.isOverlay()) {\n this.layer.dismiss(this._dismissLayer, this.responseOption());\n }\n }\n abortWhenLayerClosed(layer = this.layer) {\n if (layer.isClosed()) {\n throw new up.Aborted('Layer was closed');\n }\n }\n setSource({ oldElement, newElement, source }) {\n if (source === 'keep') {\n source = (oldElement && up.fragment.source(oldElement));\n }\n if (source) {\n e.setMissingAttr(newElement, 'up-source', up.fragment.normalizeSource(source));\n }\n }\n setTime({ newElement, time }) {\n e.setMissingAttr(newElement, 'up-time', time ? time.toUTCString() : false);\n }\n setETag({ newElement, etag }) {\n e.setMissingAttr(newElement, 'up-etag', etag || false);\n }\n setReloadAttrs(options) {\n this.setSource(options);\n this.setTime(options);\n this.setETag(options);\n }\n responseOption() {\n return { response: this._response };\n }\n executeSteps(steps, responseDoc, noneOptions) {\n return new up.Change.UpdateSteps({ steps, noneOptions }).execute(responseDoc);\n }\n};\n\n\n/***/ }),\n/* 25 */\n/***/ (() => {\n\nvar _a;\nconst u = up.util;\nup.RenderJob = (_a = class RenderJob {\n constructor(options) {\n this.options = options;\n }\n execute() {\n this._rendered = this._executePromise();\n return this;\n }\n async _executePromise() {\n try {\n this._guardRender();\n this.options = up.RenderOptions.preprocess(this.options);\n let result = await this._getChange().execute();\n this._handleResult(result);\n return result;\n }\n catch (resultOrError) {\n this._handleResult(resultOrError) || this._handleError(resultOrError);\n throw resultOrError;\n }\n }\n _handleResult(result) {\n if (result instanceof up.RenderResult) {\n let { onRendered, onFinished } = result.options;\n if (!result.none)\n up.error.guard(() => onRendered?.(result));\n let guardedOnFinished = function (result) {\n up.error.guard(() => onFinished?.(result));\n };\n this.finished.then(guardedOnFinished, u.noop);\n return true;\n }\n }\n _handleError(error) {\n let prefix = error instanceof up.Aborted ? 'Rendering was aborted' : 'Error while rendering';\n up.puts('up.render()', `${prefix}: ${error.name}: ${error.message}`);\n up.error.guard(() => this.options.onError?.(error));\n }\n get finished() {\n return this._awaitFinished();\n }\n async _awaitFinished() {\n try {\n let result = await this._rendered;\n return await result.finished;\n }\n catch (error) {\n if (error instanceof up.RenderResult) {\n throw await error.finished;\n }\n else {\n throw error;\n }\n }\n }\n _getChange() {\n if (this.options.url) {\n let onRequest = (request) => this._handleAbortOption(request);\n return new up.Change.FromURL({ ...this.options, onRequest });\n }\n else if (this.options.response) {\n let onRender = () => this._handleAbortOption(null);\n return new up.Change.FromResponse({ ...this.options, onRender });\n }\n else {\n let onRender = () => this._handleAbortOption(null);\n return new up.Change.FromContent({ ...this.options, onRender });\n }\n }\n _guardRender() {\n up.browser.assertConfirmed(this.options);\n let guardEvent = u.pluckKey(this.options, 'guardEvent');\n if (guardEvent) {\n guardEvent.renderOptions = this.options;\n if (up.emit(guardEvent, { target: this.options.origin }).defaultPrevented) {\n throw new up.Aborted(`Rendering was prevented by ${guardEvent.type} listener`);\n }\n }\n up.RenderOptions.assertContentGiven(this.options);\n }\n _handleAbortOption(request) {\n let { abort } = this.options;\n if (!abort || !up.network.isBusy())\n return;\n let { fragments, layer, origin, newLayer } = this._getChange().getPreflightProps();\n let abortOptions = {\n except: request,\n logOnce: ['up.render()', 'Change with { abort } option will abort other requests'],\n newLayer,\n origin,\n };\n if (abort === 'target') {\n up.fragment.abort(fragments, abortOptions);\n }\n else if (abort === 'layer') {\n up.fragment.abort({ ...abortOptions, layer });\n }\n else if (abort === 'all' || abort === true) {\n up.fragment.abort({ ...abortOptions, layer: 'any' });\n }\n else if (u.isFunction(abort)) {\n abort(abortOptions);\n }\n else {\n up.fragment.abort(abort, { ...abortOptions, layer });\n }\n }\n },\n (() => {\n u.delegate(_a.prototype, ['then', 'catch', 'finally'], function () { return this._rendered; });\n u.memoizeMethod(_a.prototype, {\n _awaitFinished: true,\n _getChange: true,\n });\n })(),\n _a);\n\n\n/***/ }),\n/* 26 */\n/***/ (() => {\n\nup.Change.Removal = class Removal extends up.Change {\n};\n\n\n/***/ }),\n/* 27 */\n/***/ (() => {\n\nup.Change.DestroyFragment = class DestroyFragment extends up.Change.Removal {\n constructor(options) {\n super(options);\n this._layer = up.layer.get(options) || up.layer.current;\n this._element = this.options.element;\n this._animation = this.options.animation;\n this._log = this.options.log;\n }\n execute() {\n this._parent = this._element.parentNode;\n up.fragment.markAsDestroying(this._element);\n if (up.motion.willAnimate(this._element, this._animation, this.options)) {\n this._destroyAfterAnimation();\n }\n else {\n this._destroyNow();\n }\n }\n async _destroyAfterAnimation() {\n this._emitDestroyed();\n await this._animate();\n this._wipe();\n this.onFinished();\n }\n _destroyNow() {\n this._wipe();\n this._emitDestroyed();\n this.onFinished();\n }\n _animate() {\n return up.motion.animate(this._element, this._animation, this.options);\n }\n _wipe() {\n this._layer.asCurrent(() => {\n up.fragment.abort(this._element);\n up.script.clean(this._element, { layer: this._layer });\n up.element.cleanJQuery(this._element);\n this._element.remove();\n });\n }\n _emitDestroyed() {\n up.fragment.emitDestroyed(this._element, { parent: this._parent, log: this._log });\n }\n};\n\n\n/***/ }),\n/* 28 */\n/***/ (() => {\n\nlet u = up.util;\nup.Change.OpenLayer = class OpenLayer extends up.Change.Addition {\n constructor(options) {\n super(options);\n this.target = options.target;\n this._origin = options.origin;\n this._baseLayer = options.baseLayer;\n }\n getPreflightProps() {\n return {\n mode: this.options.mode,\n context: this._buildLayer().context,\n origin: this.options.origin,\n target: this.target,\n layer: this._baseLayer,\n fragments: u.compact([up.fragment.get(':main', { layer: this._baseLayer })]),\n newLayer: true,\n };\n }\n execute(responseDoc, onApplicable) {\n this.responseDoc = responseDoc;\n this._matchPostflight();\n onApplicable();\n this._createOverlay();\n let unbindClosing = this.layer.on('up:layer:accepting up:layer:dimissing', this._renderOtherLayers.bind(this));\n try {\n this._renderOverlayContent();\n this._renderOtherLayers();\n return up.RenderResult.both(this._newOverlayResult, this._otherLayersResult);\n }\n finally {\n unbindClosing();\n }\n }\n _matchPostflight() {\n if (this.target === ':none') {\n this._content = document.createElement('up-none');\n }\n else {\n this._content = this.responseDoc.select(this.target);\n }\n if (!this._content || this._baseLayer.isClosed()) {\n throw new up.CannotMatch();\n }\n }\n _createOverlay() {\n up.puts('up.render()', `Opening element \"${this.target}\" in new overlay`);\n this._assertOpenEventEmitted();\n this.layer = this._buildLayer();\n this._baseLayer.peel({ history: !this.layer.history });\n up.layer.stack.push(this.layer);\n this.layer.createElements();\n this.layer.setupHandlers();\n }\n _renderOverlayContent() {\n this._handleHistory();\n this.handleLayerChangeRequests();\n this.responseDoc.commitElement(this._content);\n this.layer.setContent(this._content);\n this.setReloadAttrs({ newElement: this._content, source: this.options.source });\n this.responseDoc.finalizeElement(this._content);\n this._newOverlayResult = new up.RenderResult({\n layer: this.layer,\n fragments: [this._content],\n target: this.target,\n });\n up.hello(this.layer.element, { ...this.options, layer: this.layer });\n this._handleScroll();\n this._newOverlayResult.finished = this._finish();\n this.layer.opening = false;\n this._emitOpenedEvent();\n this.abortWhenLayerClosed();\n }\n _renderOtherLayers() {\n if (this._otherLayersResult)\n return;\n let otherLayerSteps = this._getHungrySteps().other;\n this._otherLayersResult = this.executeSteps(otherLayerSteps, this.responseDoc);\n }\n async _finish() {\n await this.layer.startOpenAnimation();\n this.abortWhenLayerClosed();\n this._handleFocus();\n return this._newOverlayResult;\n }\n _buildLayer() {\n const buildOptions = { ...this.options, opening: true };\n const beforeNew = optionsWithLayerDefaults => {\n return this.options = up.RenderOptions.finalize(optionsWithLayerDefaults);\n };\n return up.layer.build(buildOptions, beforeNew);\n }\n _handleHistory() {\n if (this.layer.history === 'auto') {\n this.layer.history = up.fragment.hasAutoHistory([this._content], this.layer);\n }\n let { parent } = this.layer;\n this.layer.history &&= parent.history;\n parent.saveHistory();\n this.layer.updateHistory(this.options);\n }\n _handleFocus() {\n this._baseLayer.overlayFocus?.moveToBack();\n this.layer.overlayFocus.moveToFront();\n const fragmentFocus = new up.FragmentFocus({\n fragment: this._content,\n layer: this.layer,\n autoMeans: ['autofocus', 'layer'],\n inputDevice: this.options.inputDevice,\n });\n fragmentFocus.process(this.options.focus);\n }\n _handleScroll() {\n const scrollingOptions = {\n ...this.options,\n fragment: this._content,\n layer: this.layer,\n autoMeans: ['hash', 'layer']\n };\n const scrolling = new up.FragmentScrolling(scrollingOptions);\n scrolling.process(this.options.scroll);\n }\n _assertOpenEventEmitted() {\n up.event.assertEmitted('up:layer:open', {\n origin: this._origin,\n baseLayer: this._baseLayer,\n layerOptions: this.options,\n log: \"Opening new overlay\"\n });\n }\n _emitOpenedEvent() {\n this.layer.emit('up:layer:opened', {\n origin: this._origin,\n callback: this.layer.callback('onOpened'),\n log: `Opened new ${this.layer}`\n });\n }\n _getHungrySteps() {\n return up.radio.hungrySteps(this._getEffectiveRenderOptions());\n }\n _getEffectiveRenderOptions() {\n return {\n ...this.options,\n layer: this.layer,\n history: this.layer.history,\n };\n }\n};\n\n\n/***/ }),\n/* 29 */\n/***/ (() => {\n\nvar _a;\nconst u = up.util;\nup.Change.UpdateLayer = (_a = class UpdateLayer extends up.Change.Addition {\n constructor(options) {\n options = up.RenderOptions.finalize(options);\n super(options);\n this.layer = options.layer;\n this.target = options.target;\n this._context = options.context;\n this._steps = up.fragment.parseTargetSteps(this.target, this.options);\n }\n getPreflightProps() {\n this._matchPreflight();\n return {\n layer: this.layer,\n mode: this.layer.mode,\n context: u.merge(this.layer.context, this._context),\n origin: this.options.origin,\n target: this._bestPreflightSelector(),\n fragments: this._getFragments(),\n newLayer: false,\n };\n }\n _bestPreflightSelector() {\n this._matchPreflight();\n return up.fragment.targetForSteps(this._steps);\n }\n _getFragments() {\n this._matchPreflight();\n return u.map(this._steps, 'oldElement');\n }\n execute(responseDoc, onApplicable) {\n this.responseDoc = responseDoc;\n this._matchPostflight();\n onApplicable();\n let unbindClosing = this.layer.on('up:layer:accepting up:layer:dimissing', this._renderOtherLayers.bind(this));\n try {\n this._renderCurrentLayer();\n this._renderOtherLayers();\n return up.RenderResult.both(this._currentLayerResult, this._otherLayersResult);\n }\n finally {\n unbindClosing();\n }\n }\n _renderCurrentLayer() {\n if (this._steps.length) {\n up.puts('up.render()', `Updating \"${this._bestPreflightSelector()}\" in ${this.layer}`);\n }\n this._setScrollAndFocusOptions();\n if (this.options.saveScroll) {\n up.viewport.saveScroll({ layer: this.layer });\n }\n if (this.options.saveFocus) {\n up.viewport.saveFocus({ layer: this.layer });\n }\n if (this.options.peel) {\n this.layer.peel({ history: !this._hasHistory() });\n }\n if (this.options.abort !== false) {\n up.fragment.abort(this._getFragments(), { reason: 'Fragment is being replaced' });\n }\n Object.assign(this.layer.context, this._context);\n if (this._hasHistory()) {\n this.layer.updateHistory(this.options);\n }\n this.handleLayerChangeRequests();\n this._currentLayerResult = this.executeSteps(this._steps, this.responseDoc, this.options);\n }\n _renderOtherLayers() {\n if (this._otherLayersResult)\n return;\n let otherLayerSteps = this._getHungrySteps().other;\n this._otherLayersResult = this.executeSteps(otherLayerSteps, this.responseDoc);\n }\n _matchPreflight() {\n this._matchOldElements();\n this._compressNestedSteps();\n }\n _matchPostflight() {\n this._matchOldElements();\n this._addHungryStepsOnCurrentLayer();\n this._compressNestedSteps();\n this._matchNewElements();\n }\n _addHungryStepsOnCurrentLayer() {\n this._steps.push(...this._getHungrySteps().current);\n }\n _matchOldElements() {\n this._steps = this._steps.filter((step) => {\n const finder = new up.FragmentFinder(u.pick(step, ['selector', 'origin', 'layer', 'match', 'preferOldElements']));\n step.oldElement ||= finder.find();\n if (step.oldElement) {\n return true;\n }\n else if (!step.maybe) {\n throw new up.CannotMatch();\n }\n });\n }\n _matchNewElements() {\n this._steps = this.responseDoc.selectSteps(this._steps);\n }\n _compressNestedSteps() {\n this._steps = up.fragment.compressNestedSteps(this._steps);\n }\n _getHungrySteps() {\n return up.radio.hungrySteps(this._getEffectiveRenderOptions());\n }\n _setScrollAndFocusOptions() {\n let focusCapsule = up.FocusCapsule.preserve(this.layer);\n this._steps.forEach((step, i) => {\n step.focusCapsule = focusCapsule;\n if (i > 0) {\n step.scroll = false;\n step.focus = false;\n }\n });\n }\n _hasHistory() {\n return u.evalAutoOption(this.options.history, this._hasAutoHistory.bind(this));\n }\n _hasAutoHistory() {\n const oldFragments = u.map(this._steps, 'oldElement');\n return up.fragment.hasAutoHistory(oldFragments, this.layer);\n }\n _getEffectiveRenderOptions() {\n return {\n ...this.options,\n layer: this.layer,\n history: this._hasHistory(),\n };\n }\n },\n (() => {\n u.memoizeMethod(_a.prototype, {\n _matchPreflight: true,\n _matchOldElements: true,\n _hasHistory: true,\n _getHungrySteps: true,\n });\n })(),\n _a);\n\n\n/***/ }),\n/* 30 */\n/***/ (() => {\n\nconst u = up.util;\nconst e = up.element;\nup.Change.UpdateSteps = class UpdateSteps extends up.Change.Addition {\n constructor(options) {\n super(options);\n this._noneOptions = options.noneOptions || {};\n this._steps = u.copy(options.steps);\n }\n execute(responseDoc) {\n this.responseDoc = responseDoc;\n this._steps = responseDoc.selectSteps(this._steps);\n this._steps = responseDoc.commitSteps(this._steps);\n if (!this._steps.length) {\n return this._executeNone();\n }\n this.renderResult = new up.RenderResult({\n layer: this._steps[0]?.layer,\n target: up.fragment.targetForSteps(this._steps),\n });\n this._steps.reverse();\n const motionEndPromises = this._steps.map(step => this._executeStep(step));\n this.renderResult.finished = this._finish(motionEndPromises);\n return this.renderResult;\n }\n _executeNone() {\n this._handleFocus(null, this._noneOptions);\n this._handleScroll(null, this._noneOptions);\n return up.RenderResult.buildNone();\n }\n async _finish(motionEndPromises) {\n await Promise.all(motionEndPromises);\n for (let step of this._steps) {\n this.abortWhenLayerClosed(step.layer);\n }\n return this.renderResult;\n }\n _addToResult(fragment) {\n let newFragments = fragment.matches('up-wrapper') ? fragment.children : [fragment];\n this.renderResult.fragments.unshift(...newFragments);\n }\n _executeStep(step) {\n this.setReloadAttrs(step);\n switch (step.placement) {\n case 'swap': {\n let keepPlan = this._findKeepPlan(step);\n if (keepPlan) {\n this._handleFocus(step.oldElement, step);\n this._handleScroll(step.oldElement, step);\n return Promise.resolve();\n }\n else {\n this._preserveKeepables(step);\n const parent = step.oldElement.parentNode;\n const morphOptions = {\n ...step,\n beforeStart() {\n up.fragment.markAsDestroying(step.oldElement);\n },\n afterInsert: () => {\n this._restoreKeepables(step);\n this.responseDoc.finalizeElement(step.newElement);\n this._unmarkKeepables(step);\n up.hello(step.newElement, step);\n this._addToResult(step.newElement);\n },\n beforeDetach: () => {\n up.script.clean(step.oldElement, { layer: step.layer });\n },\n afterDetach() {\n up.element.cleanJQuery();\n up.fragment.emitDestroyed(step.oldElement, { parent, log: false });\n },\n scrollNew: () => {\n this._handleFocus(step.newElement, step);\n this._handleScroll(step.newElement, step);\n }\n };\n return up.morph(step.oldElement, step.newElement, step.transition, morphOptions);\n }\n }\n case 'content': {\n let oldWrapper = e.wrapChildren(step.oldElement);\n let newWrapper = e.wrapChildren(step.newElement);\n let wrapperStep = {\n ...step,\n placement: 'swap',\n oldElement: oldWrapper,\n newElement: newWrapper,\n focus: false\n };\n return this._executeStep(wrapperStep).then(() => {\n e.unwrap(newWrapper);\n this._handleFocus(step.oldElement, step);\n });\n }\n case 'before':\n case 'after': {\n let wrapper = e.wrapChildren(step.newElement);\n let position = step.placement === 'before' ? 'afterbegin' : 'beforeend';\n step.oldElement.insertAdjacentElement(position, wrapper);\n this.responseDoc.finalizeElement(wrapper);\n up.hello(wrapper, step);\n this._addToResult(wrapper);\n this._handleFocus(wrapper, step);\n this._handleScroll(wrapper, step);\n return up.animate(wrapper, step.transition, step).then(() => e.unwrap(wrapper));\n }\n default: {\n up.fail('Unknown placement: %o', step.placement);\n }\n }\n }\n _findKeepPlan(options) {\n if (!options.useKeep) {\n return;\n }\n const { oldElement, newElement } = options;\n let doKeep = e.booleanAttr(oldElement, 'up-keep');\n if (!doKeep) {\n return;\n }\n let partner;\n let partnerSelector = up.fragment.toTarget(oldElement);\n const lookupOpts = { layer: options.layer };\n if (options.descendantsOnly) {\n partner = up.fragment.get(newElement, partnerSelector, lookupOpts);\n }\n else {\n partner = up.fragment.subtree(newElement, partnerSelector, lookupOpts)[0];\n }\n if (partner && e.booleanAttr(partner, 'up-keep') !== false) {\n const plan = {\n oldElement,\n newElement: partner,\n newData: up.script.data(partner),\n renderOptions: options,\n };\n if (!up.fragment.emitKeep(plan).defaultPrevented) {\n return plan;\n }\n }\n }\n _preserveKeepables(step) {\n const keepPlans = [];\n if (step.useKeep) {\n for (let keepable of step.oldElement.querySelectorAll('[up-keep]')) {\n let keepPlan = this._findKeepPlan({ ...step, oldElement: keepable, descendantsOnly: true });\n if (keepPlan) {\n const keepableClone = keepable.cloneNode(true);\n keepable.insertAdjacentElement('beforebegin', keepableClone);\n keepable.classList.add('up-keeping');\n up.script.disableSubtree(keepPlan.newElement);\n let viewports = up.viewport.subtree(keepPlan.oldElement);\n keepPlan.revivers = viewports.map(function (viewport) {\n let cursorProps = up.viewport.copyCursorProps(viewport);\n return () => up.viewport.copyCursorProps(cursorProps, viewport);\n });\n if (this._willChangeElement(document.body)) {\n keepPlan.newElement.replaceWith(keepable);\n }\n else {\n document.body.append(keepable);\n }\n keepPlans.push(keepPlan);\n }\n }\n }\n step.keepPlans = keepPlans;\n }\n _restoreKeepables(step) {\n for (let keepPlan of step.keepPlans) {\n keepPlan.newElement.replaceWith(keepPlan.oldElement);\n for (let reviver of keepPlan.revivers) {\n reviver();\n }\n }\n }\n _unmarkKeepables(step) {\n for (let keepPlan of step.keepPlans) {\n keepPlan.oldElement.classList.remove('up-keeping');\n }\n }\n _willChangeElement(element) {\n return u.some(this._steps, (step) => step.oldElement.contains(element));\n }\n _handleFocus(fragment, options) {\n const fragmentFocus = new up.FragmentFocus({\n ...options,\n fragment,\n autoMeans: up.fragment.config.autoFocus,\n });\n return fragmentFocus.process(options.focus);\n }\n _handleScroll(fragment, options) {\n const scrolling = new up.FragmentScrolling({\n ...options,\n fragment,\n autoMeans: up.fragment.config.autoScroll\n });\n return scrolling.process(options.scroll);\n }\n};\n\n\n/***/ }),\n/* 31 */\n/***/ (() => {\n\nconst u = up.util;\nup.Change.CloseLayer = class CloseLayer extends up.Change.Removal {\n constructor(options) {\n super(options);\n this._verb = options.verb;\n this._layer = up.layer.get(options);\n this._origin = options.origin;\n this._value = options.value;\n this._preventable = options.preventable ?? true;\n this._response = options.response;\n this._history = options.history ?? true;\n }\n execute() {\n if (!this._layer.isOpen()) {\n return Promise.resolve();\n }\n up.browser.assertConfirmed(this.options);\n if (this._emitCloseEvent().defaultPrevented && this._preventable) {\n throw new up.Aborted('Close event was prevented');\n }\n this._emitClosingEvent();\n up.fragment.abort({ reason: 'Layer is closing', layer: this._layer });\n const { parent } = this._layer;\n this._layer.peel();\n this._layer.stack.remove(this._layer);\n if (this._history) {\n parent.restoreHistory();\n }\n this._handleFocus(parent);\n this._layer.teardownHandlers();\n this._layer.destroyElements(this.options);\n this._emitClosedEvent(parent);\n }\n _emitCloseEvent() {\n let event = this._layer.emit(this._buildEvent(`up:layer:${this._verb}`), {\n callback: this._layer.callback(`on${u.upperCaseFirst(this._verb)}`),\n log: [`Will ${this._verb} ${this._layer} with value %o`, this._value]\n });\n this._value = event.value;\n return event;\n }\n _emitClosingEvent() {\n let event = this._buildEvent(`up:layer:${this._verb}ing`);\n this._layer.emit(event, { log: false });\n }\n _emitClosedEvent(formerParent) {\n const verbPast = `${this._verb}ed`;\n const verbPastUpperCaseFirst = u.upperCaseFirst(verbPast);\n return this._layer.emit(this._buildEvent(`up:layer:${verbPast}`), {\n baseLayer: formerParent,\n callback: this._layer.callback(`on${verbPastUpperCaseFirst}`),\n ensureBubbles: true,\n log: [`${verbPastUpperCaseFirst} ${this._layer} with value %o`, this._value]\n });\n }\n _buildEvent(name) {\n return up.event.build(name, {\n layer: this._layer,\n value: this._value,\n origin: this._origin,\n response: this._response,\n });\n }\n _handleFocus(formerParent) {\n this._layer.overlayFocus.teardown();\n formerParent.overlayFocus?.moveToFront();\n let newFocusElement = this._layer.origin || formerParent.element;\n up.focus(newFocusElement, { preventScroll: true });\n }\n};\n\n\n/***/ }),\n/* 32 */\n/***/ (() => {\n\nvar _a;\nconst u = up.util;\nup.Change.FromURL = (_a = class FromURL extends up.Change {\n execute() {\n let _newPageReason = this._newPageReason();\n if (_newPageReason) {\n up.puts('up.render()', _newPageReason);\n up.network.loadPage(this.options);\n return u.unresolvablePromise();\n }\n this.request = up.request(this._getRequestAttrs());\n this.options.onRequest?.(this.request);\n up.feedback.showAroundRequest(this.request, this.options);\n up.form.disableWhile(this.request, this.options);\n if (this.options.preload) {\n return this.request;\n }\n return u.always(this.request, responseOrError => this._onRequestSettled(responseOrError));\n }\n _newPageReason() {\n if (u.isCrossOrigin(this.options.url)) {\n return 'Loading cross-origin content in new page';\n }\n if (this.options.history && !up.browser.canPushState()) {\n return 'Loading content in new page to restore history support';\n }\n }\n _getRequestAttrs() {\n const successAttrs = this._preflightPropsForRenderOptions(this.options);\n const failAttrs = this._preflightPropsForRenderOptions(this.deriveFailOptions(), { optional: true });\n return {\n ...this.options,\n ...successAttrs,\n ...u.renameKeys(failAttrs, up.fragment.failKey)\n };\n }\n getPreflightProps() {\n return this._getRequestAttrs();\n }\n _preflightPropsForRenderOptions(renderOptions, requestAttributesOptions) {\n const preview = new up.Change.FromContent({ ...renderOptions, preview: true });\n return preview.getPreflightProps(requestAttributesOptions);\n }\n _onRequestSettled(response) {\n if (response instanceof up.Response) {\n return this._onRequestSettledWithResponse(response);\n }\n else {\n return this._onRequestSettledWithError(response);\n }\n }\n _onRequestSettledWithResponse(response) {\n return new up.Change.FromResponse({ ...this.options, response }).execute();\n }\n _onRequestSettledWithError(error) {\n if (error instanceof up.Offline) {\n this.request.emit('up:fragment:offline', {\n callback: this.options.onOffline,\n renderOptions: this.options,\n retry: (retryOptions) => up.render({ ...this.options, ...retryOptions }),\n log: ['Cannot load fragment from %s: %s', this.request.description, error.reason],\n });\n }\n throw error;\n }\n },\n (() => {\n u.memoizeMethod(_a.prototype, {\n _getRequestAttrs: true,\n });\n })(),\n _a);\n\n\n/***/ }),\n/* 33 */\n/***/ (() => {\n\nvar _a;\nconst u = up.util;\nup.Change.FromResponse = (_a = class FromResponse extends up.Change {\n constructor(options) {\n super(options);\n this._response = options.response;\n this._request = this._response.request;\n }\n execute() {\n if (up.fragment.config.skipResponse(this._loadedEventProps())) {\n this._skip();\n }\n else {\n this._request.assertEmitted('up:fragment:loaded', {\n ...this._loadedEventProps(),\n callback: this.options.onLoaded,\n log: ['Loaded fragment from %s', this._response.description],\n skip: () => this._skip()\n });\n }\n let fail = u.evalOption(this.options.fail, this._response) ?? !this._response.ok;\n if (fail) {\n throw this._updateContentFromResponse(this.deriveFailOptions());\n }\n return this._updateContentFromResponse(this.options);\n }\n _skip() {\n up.puts('up.render()', 'Skipping ' + this._response.description);\n this.options.target = ':none';\n this.options.failTarget = ':none';\n }\n _updateContentFromResponse(finalRenderOptions) {\n if (finalRenderOptions.failPrefixForced) {\n up.puts('up.render()', 'Rendering failed response using fail-prefixed options (https://unpoly.com/failed-responses)');\n }\n this._augmentOptionsFromResponse(finalRenderOptions);\n finalRenderOptions.meta = this._compilerPassMeta();\n let result = new up.Change.FromContent(finalRenderOptions).execute();\n result.finished = this.finish(result, finalRenderOptions);\n return result;\n }\n async finish(renderResult, originalRenderOptions) {\n renderResult = await renderResult.finished;\n if (up.fragment.shouldRevalidate(this._request, this._response, originalRenderOptions)) {\n renderResult = await this._revalidate(renderResult, originalRenderOptions);\n }\n return renderResult;\n }\n async _revalidate(renderResult, originalRenderOptions) {\n let inputTarget = originalRenderOptions.target;\n let effectiveTarget = renderResult.target;\n if (/:(before|after)/.test(inputTarget)) {\n up.warn('up.render()', 'Cannot revalidate cache when prepending/appending (target %s)', inputTarget);\n }\n else {\n up.puts('up.render()', 'Revalidating cached response for target \"%s\"', effectiveTarget);\n let verifyResult = await up.reload(effectiveTarget, {\n ...originalRenderOptions,\n preferOldElements: renderResult.fragments,\n layer: renderResult.layer,\n onFinished: null,\n scroll: false,\n focus: 'keep',\n transition: false,\n cache: false,\n confirm: false,\n feedback: false,\n abort: false,\n expiredResponse: this._response,\n });\n if (!verifyResult.none) {\n renderResult = verifyResult;\n }\n }\n return renderResult;\n }\n _loadedEventProps() {\n const { expiredResponse } = this.options;\n return {\n request: this._request,\n response: this._response,\n renderOptions: this.options,\n revalidating: !!expiredResponse,\n expiredResponse,\n };\n }\n _compilerPassMeta() {\n let meta = { revalidating: !!this.options.expiredResponse };\n up.migrate.processCompilerPassMeta?.(meta, this._response);\n return meta;\n }\n _augmentOptionsFromResponse(renderOptions) {\n const responseURL = this._response.url;\n let serverLocation = responseURL;\n let hash = this._request.hash;\n if (hash) {\n renderOptions.hash = hash;\n serverLocation += hash;\n }\n const isReloadable = (this._response.method === 'GET');\n if (isReloadable) {\n renderOptions.source = this.improveHistoryValue(renderOptions.source, responseURL);\n }\n else {\n renderOptions.source = this.improveHistoryValue(renderOptions.source, 'keep');\n renderOptions.history = !!renderOptions.location;\n }\n renderOptions.location = this.improveHistoryValue(renderOptions.location, serverLocation);\n renderOptions.title = this.improveHistoryValue(renderOptions.title, this._response.title);\n renderOptions.eventPlans = this._response.eventPlans;\n let serverTarget = this._response.target;\n if (serverTarget) {\n renderOptions.target = serverTarget;\n }\n renderOptions.acceptLayer = this._response.acceptLayer;\n renderOptions.dismissLayer = this._response.dismissLayer;\n renderOptions.document = this._response.text;\n if (this._response.none) {\n renderOptions.target = ':none';\n }\n renderOptions.context = u.merge(renderOptions.context, this._response.context);\n renderOptions.cspNonces = this._response.cspNonces;\n renderOptions.time ??= this._response.lastModified;\n renderOptions.etag ??= this._response.etag;\n }\n },\n (() => {\n u.memoizeMethod(_a.prototype, {\n _loadedEventProps: true,\n });\n })(),\n _a);\n\n\n/***/ }),\n/* 34 */\n/***/ (() => {\n\nvar _a;\nconst u = up.util;\nup.Change.FromContent = (_a = class FromContent extends up.Change {\n constructor(options) {\n super(options);\n this._origin = options.origin;\n this._preview = options.preview;\n this._layers = up.layer.getAll(options);\n }\n _getPlans() {\n let plans = [];\n this._filterLayers();\n this._improveOptionsFromResponseDoc();\n this._expandIntoPlans(plans, this._layers, this.options.target);\n this._expandIntoPlans(plans, this._layers, this.options.fallback);\n return plans;\n }\n _isRenderableLayer(layer) {\n return (layer === 'new') || layer.isOpen();\n }\n _filterLayers() {\n this._layers = u.filter(this._layers, this._isRenderableLayer);\n }\n _expandIntoPlans(plans, layers, targets) {\n for (let layer of layers) {\n for (let target of this._expandTargets(targets, layer)) {\n const props = { ...this.options, target, layer, defaultPlacement: this._defaultPlacement() };\n const change = layer === 'new' ? new up.Change.OpenLayer(props) : new up.Change.UpdateLayer(props);\n plans.push(change);\n }\n }\n }\n _expandTargets(targets, layer) {\n return up.fragment.expandTargets(targets, { layer, mode: this.options.mode, origin: this._origin });\n }\n execute() {\n if (this.options.preload) {\n return Promise.resolve();\n }\n return this._seekPlan(this._executePlan.bind(this)) || this._cannotMatchPostflightTarget();\n }\n _executePlan(matchedPlan) {\n let result = matchedPlan.execute(this._getResponseDoc(), this._onPlanApplicable.bind(this, matchedPlan));\n result.options = this.options;\n return result;\n }\n _isApplicablePlanError(error) {\n return !(error instanceof up.CannotMatch);\n }\n _onPlanApplicable(plan) {\n let primaryPlan = this._getPlans()[0];\n if (plan !== primaryPlan) {\n up.puts('up.render()', 'Could not match primary target \"%s\". Updating a fallback target \"%s\".', primaryPlan.target, plan.target);\n }\n let { assets } = this._getResponseDoc();\n if (assets) {\n up.script.assertAssetsOK(assets, plan.options);\n }\n this.options.onRender?.();\n }\n _getResponseDoc() {\n if (this._preview)\n return;\n const docOptions = u.pick(this.options, [\n 'target',\n 'content',\n 'fragment',\n 'document',\n 'html',\n 'cspNonces',\n 'origin',\n ]);\n up.migrate.handleResponseDocOptions?.(docOptions);\n if (this._defaultPlacement() === 'content') {\n docOptions.target = this._firstExpandedTarget(docOptions.target);\n }\n return new up.ResponseDoc(docOptions);\n }\n _improveOptionsFromResponseDoc() {\n if (this._preview)\n return;\n let responseDoc = this._getResponseDoc();\n if (this.options.fragment) {\n this.options.target ||= responseDoc.rootSelector();\n }\n this.options.title = this.improveHistoryValue(this.options.title, responseDoc.title);\n this.options.metaTags = this.improveHistoryValue(this.options.metaTags, responseDoc.metaTags);\n this.options.lang = this.improveHistoryValue(this.options.lang, responseDoc.lang);\n }\n _defaultPlacement() {\n if (!this.options.document && !this.options.fragment) {\n return 'content';\n }\n }\n _firstExpandedTarget(target) {\n let layer = this._layers[0] || up.layer.root;\n return this._expandTargets(target || ':main', layer)[0];\n }\n getPreflightProps(opts = {}) {\n const getPlanProps = plan => plan.getPreflightProps();\n return this._seekPlan(getPlanProps) || opts.optional || this._cannotMatchPreflightTarget();\n }\n _cannotMatchPreflightTarget() {\n this._cannotMatchTarget('Could not find target in current page');\n }\n _cannotMatchPostflightTarget() {\n this._cannotMatchTarget('Could not find common target in current page and response');\n }\n _cannotMatchTarget(reason) {\n if (this._getPlans().length) {\n const planTargets = u.uniq(u.map(this._getPlans(), 'target'));\n const humanizedLayerOption = up.layer.optionToString(this.options.layer);\n throw new up.CannotMatch([reason + \" (tried selectors %o in %s)\", planTargets, humanizedLayerOption]);\n }\n else if (this._layers.length === 0) {\n this._cannotMatchLayer();\n }\n else if (this.options.failPrefixForced) {\n throw new up.CannotMatch('No target selector given for failed responses (https://unpoly.com/failed-responses)');\n }\n else {\n throw new up.CannotMatch('No target selector given');\n }\n }\n _cannotMatchLayer() {\n throw new up.CannotMatch('Could not find a layer to render in. You may have passed an unmatchable layer reference, or a detached element.');\n }\n _seekPlan(fn) {\n for (let plan of this._getPlans()) {\n try {\n return fn(plan);\n }\n catch (error) {\n if (this._isApplicablePlanError(error)) {\n throw error;\n }\n }\n }\n }\n },\n (() => {\n u.memoizeMethod(_a.prototype, {\n _getPlans: true,\n _getResponseDoc: true,\n getPreflightProps: true,\n });\n })(),\n _a);\n\n\n/***/ }),\n/* 35 */\n/***/ (() => {\n\nconst u = up.util;\nup.CompilerPass = class CompilerPass {\n constructor(root, compilers, { layer, data, dataMap, meta }) {\n layer ||= up.layer.get(root) || up.layer.current;\n this._root = root;\n this._compilers = compilers;\n this._layer = layer;\n this._data = data;\n this._dataMap = dataMap;\n meta ||= {};\n meta.layer = layer;\n this._meta = meta;\n }\n run() {\n this._layer.asCurrent(() => {\n this.setCompileData();\n for (let compiler of this._compilers) {\n this._runCompiler(compiler);\n }\n });\n }\n setCompileData() {\n if (this._data) {\n this._root.upCompileData = this._data;\n }\n if (this._dataMap) {\n for (let selector in this._dataMap) {\n for (let match of this._select(selector)) {\n match.upCompileData = this._dataMap[selector];\n }\n }\n }\n }\n _runCompiler(compiler) {\n const matches = this._selectOnce(compiler);\n if (!matches.length) {\n return;\n }\n if (!compiler.isDefault) {\n up.puts('up.hello()', 'Compiling %d\u00D7 \"%s\" on %s', matches.length, compiler.selector, this._layer);\n }\n if (compiler.batch) {\n this._compileBatch(compiler, matches);\n }\n else {\n for (let match of matches) {\n this._compileOneElement(compiler, match);\n }\n }\n return up.migrate.postCompile?.(matches, compiler);\n }\n _compileOneElement(compiler, element) {\n const compileArgs = [element];\n if (compiler.length !== 1) {\n const data = up.script.data(element);\n compileArgs.push(data, this._meta);\n }\n const result = this._applyCompilerFunction(compiler, element, compileArgs);\n let destructorOrDestructors = this._destructorPresence(result);\n if (destructorOrDestructors) {\n up.destructor(element, destructorOrDestructors);\n }\n }\n _compileBatch(compiler, elements) {\n const compileArgs = [elements];\n if (compiler.length !== 1) {\n const dataList = u.map(elements, up.script.data);\n compileArgs.push(dataList, this._meta);\n }\n const result = this._applyCompilerFunction(compiler, elements, compileArgs);\n if (this._destructorPresence(result)) {\n up.fail('Compilers with { batch: true } cannot return destructors');\n }\n }\n _applyCompilerFunction(compiler, elementOrElements, compileArgs) {\n return up.error.guard(() => compiler.apply(elementOrElements, compileArgs));\n }\n _destructorPresence(result) {\n if (u.isFunction(result) || (u.isArray(result) && (u.every(result, u.isFunction)))) {\n return result;\n }\n }\n _select(selector) {\n return up.fragment.subtree(this._root, u.evalOption(selector), { layer: this._layer });\n }\n _selectOnce(compiler) {\n let matches = this._select(compiler.selector);\n return u.filter(matches, (element) => {\n let appliedCompilers = (element.upAppliedCompilers ||= new Set());\n if (!appliedCompilers.has(compiler)) {\n appliedCompilers.add(compiler);\n return true;\n }\n });\n }\n};\n\n\n/***/ }),\n/* 36 */\n/***/ (() => {\n\nconst u = up.util;\nconst e = up.element;\nup.CSSTransition = class CSSTransition {\n constructor(element, lastFrame, options) {\n this._element = element;\n this._lastFrame = lastFrame;\n this._lastFrameKeys = Object.keys(this._lastFrame);\n this._finishEvent = options.finishEvent;\n this._duration = options.duration;\n this._easing = options.easing;\n this._finished = false;\n }\n start() {\n if (this._lastFrameKeys.length === 0) {\n this._finished = true;\n return Promise.resolve();\n }\n this._deferred = u.newDeferred();\n this._pauseOldTransition();\n this._startTime = new Date();\n this._startFallbackTimer();\n this._listenToFinishEvent();\n this._listenToTransitionEnd();\n this._startMotion();\n return this._deferred;\n }\n _listenToFinishEvent() {\n if (this._finishEvent) {\n this._stopListenToFinishEvent = up.on(this._element, this._finishEvent, this._onFinishEvent.bind(this));\n }\n }\n _onFinishEvent(event) {\n event.stopPropagation();\n this._finish();\n }\n _startFallbackTimer() {\n const timingTolerance = 100;\n this._fallbackTimer = u.timer((this._duration + timingTolerance), () => this._finish());\n }\n _stopFallbackTimer() {\n clearTimeout(this._fallbackTimer);\n }\n _listenToTransitionEnd() {\n this._stopListenToTransitionEnd = up.on(this._element, 'transitionend', this._onTransitionEnd.bind(this));\n }\n _onTransitionEnd(event) {\n if (event.target !== this._element) {\n return;\n }\n const elapsed = new Date() - this._startTime;\n if (elapsed <= (0.25 * this._duration)) {\n return;\n }\n const completedProperty = event.propertyName;\n if (u.contains(this._lastFrameKeys, completedProperty)) {\n this._finish();\n }\n }\n _finish() {\n if (this._finished) {\n return;\n }\n this._finished = true;\n this._stopFallbackTimer();\n this._stopListenToFinishEvent?.();\n this._stopListenToTransitionEnd?.();\n e.concludeCSSTransition(this._element);\n this._resumeOldTransition();\n this._deferred.resolve();\n }\n _pauseOldTransition() {\n const oldTransition = e.style(this._element, [\n 'transition-property',\n 'transition-duration',\n 'transition-delay',\n 'transition-timing-function'\n ]);\n if (e.hasCSSTransition(oldTransition)) {\n if (oldTransition['transition-property'] !== 'all') {\n const oldTransitionProperties = oldTransition['transition-property'].split(/\\s*,\\s*/);\n const oldTransitionFrame = e.style(this._element, oldTransitionProperties);\n this._setOldTransitionTargetFrame = e.setTemporaryStyle(this._element, oldTransitionFrame);\n }\n this._setOldTransition = e.concludeCSSTransition(this._element);\n }\n }\n _resumeOldTransition() {\n this._setOldTransitionTargetFrame?.();\n this._setOldTransition?.();\n }\n _startMotion() {\n e.setStyle(this._element, {\n 'transition-property': this._lastFrameKeys.join(),\n 'transition-duration': `${this._duration}ms`,\n 'transition-timing-function': this._easing\n });\n e.setStyle(this._element, this._lastFrame);\n }\n};\n\n\n/***/ }),\n/* 37 */\n/***/ (() => {\n\nconst u = up.util;\nup.DestructorPass = class DestructorPass {\n constructor(fragment, options) {\n this._fragment = fragment;\n this._options = options;\n }\n run() {\n for (let cleanable of this._selectCleanables()) {\n let destructors = u.pluckKey(cleanable, 'upDestructors');\n if (destructors) {\n for (let destructor of destructors) {\n this._applyDestructorFunction(destructor, cleanable);\n }\n }\n cleanable.classList.remove('up-can-clean');\n }\n }\n _selectCleanables() {\n const selectOptions = { ...this._options, destroying: true };\n return up.fragment.subtree(this._fragment, '.up-can-clean', selectOptions);\n }\n _applyDestructorFunction(destructor, element) {\n up.error.guard(() => destructor(element));\n }\n};\n\n\n/***/ }),\n/* 38 */\n/***/ (() => {\n\nconst u = up.util;\nconst e = up.element;\nup.EventEmitter = class EventEmitter extends up.Record {\n keys() {\n return [\n 'target',\n 'event',\n 'baseLayer',\n 'callback',\n 'log',\n 'ensureBubbles',\n ];\n }\n emit() {\n this._logEmission();\n if (this.baseLayer) {\n this.baseLayer.asCurrent(() => this._dispatchEvent());\n }\n else {\n this._dispatchEvent();\n }\n return this.event;\n }\n _dispatchEvent() {\n this.target.dispatchEvent(this.event);\n if (this.ensureBubbles && !this.target.isConnected) {\n document.dispatchEvent(this.event);\n }\n up.error.guard(() => this.callback?.(this.event));\n }\n assertEmitted() {\n const event = this.emit();\n if (event.defaultPrevented) {\n throw new up.Aborted(`Event ${event.type} was prevented`);\n }\n }\n _logEmission() {\n if (!up.log.config.enabled) {\n return;\n }\n let message = this.log;\n let messageArgs;\n if (u.isArray(message)) {\n [message, ...messageArgs] = message;\n }\n else {\n messageArgs = [];\n }\n const { type } = this.event;\n if (u.isString(message)) {\n up.puts(type, message, ...messageArgs);\n }\n else if (message !== false) {\n up.puts(type, `Event ${type}`);\n }\n }\n static fromEmitArgs(args, defaults = {}) {\n let options = u.extractOptions(args);\n options = u.merge(defaults, options);\n if (u.isElementish(args[0])) {\n options.target = e.get(args.shift());\n }\n else if (args[0] instanceof up.Layer) {\n options.layer = args.shift();\n }\n let layer;\n if (u.isGiven(options.layer)) {\n layer = up.layer.get(options.layer);\n options.target ||= layer.element;\n options.baseLayer ||= layer;\n }\n if (options.baseLayer) {\n options.baseLayer = up.layer.get(options.baseLayer);\n }\n if (u.isString(options.target)) {\n options.target = up.fragment.get(options.target, { layer: options.layer });\n }\n else if (!options.target) {\n options.target = document;\n }\n if (args[0]?.preventDefault) {\n options.event = args[0];\n options.log ??= args[0].log;\n }\n else if (u.isString(args[0])) {\n options.event = up.event.build(args[0], options);\n }\n else {\n options.event = up.event.build(options);\n }\n return new (this)(options);\n }\n};\n\n\n/***/ }),\n/* 39 */\n/***/ (() => {\n\nconst u = up.util;\nup.EventListener = class EventListener extends up.Record {\n keys() {\n return [\n 'element',\n 'eventType',\n 'selector',\n 'callback',\n 'guard',\n 'baseLayer',\n 'passive',\n 'once',\n 'capture',\n 'beforeBoot',\n ];\n }\n constructor(attributes) {\n super(attributes);\n this._key = this.constructor._buildKey(attributes);\n this.isDefault = up.framework.evaling;\n this.beforeBoot ??= (this.eventType.indexOf('up:framework:') === 0);\n this.nativeCallback = this.nativeCallback.bind(this);\n }\n bind() {\n const map = (this.element.upEventListeners ||= {});\n if (map[this._key]) {\n up.fail('up.on(): The %o callback %o cannot be registered more than once', this.eventType, this.callback);\n }\n map[this._key] = this;\n this.element.addEventListener(...this._addListenerArg());\n }\n _addListenerArg() {\n let options = u.compactObject(u.pick(this, ['once', 'passive', 'capture']));\n return [this.eventType, this.nativeCallback, options];\n }\n unbind() {\n let map = this.element.upEventListeners;\n if (map) {\n delete map[this._key];\n }\n this.element.removeEventListener(...this._addListenerArg());\n }\n nativeCallback(event) {\n if (up.framework.beforeBoot && !this.beforeBoot) {\n return;\n }\n let element = event.target;\n if (this.selector) {\n element = element.closest(u.evalOption(this.selector));\n }\n if (this.guard && !this.guard(event)) {\n return;\n }\n if (element) {\n const args = [event, element];\n const expectedArgCount = this.callback.length;\n if (expectedArgCount !== 1 && expectedArgCount !== 2) {\n const data = up.script.data(element);\n args.push(data);\n }\n if (this.eventType === 'click' && element.disabled) {\n return;\n }\n const applyCallback = this.callback.bind(element, ...args);\n if (this.baseLayer) {\n this.baseLayer.asCurrent(applyCallback);\n }\n else {\n applyCallback();\n }\n }\n }\n static fromElement(attributes) {\n let map = attributes.element.upEventListeners;\n if (map) {\n const key = this._buildKey(attributes);\n return map[key];\n }\n }\n static _buildKey(attributes) {\n attributes.callback.upUid ||= u.uid();\n return [\n attributes.eventType,\n attributes.selector,\n attributes.callback.upUid\n ].join('|');\n }\n static allNonDefault(element) {\n let map = element.upEventListeners;\n if (map) {\n const listeners = Object.values(map);\n return u.reject(listeners, 'isDefault');\n }\n else {\n return [];\n }\n }\n};\n\n\n/***/ }),\n/* 40 */\n/***/ (() => {\n\nconst u = up.util;\nup.EventListenerGroup = class EventListenerGroup extends up.Record {\n keys() {\n return [\n 'elements',\n 'eventTypes',\n 'selector',\n 'callback',\n 'guard',\n 'baseLayer',\n 'passive',\n 'once',\n 'capture',\n 'beforeBoot',\n ];\n }\n bind() {\n const unbindFns = [];\n this._eachListenerAttributes(function (attrs) {\n const listener = new up.EventListener(attrs);\n listener.bind();\n return unbindFns.push(listener.unbind.bind(listener));\n });\n return u.sequence(unbindFns);\n }\n _eachListenerAttributes(fn) {\n for (let element of this.elements) {\n for (let eventType of this.eventTypes) {\n fn(this._listenerAttributes(element, eventType));\n }\n }\n }\n _listenerAttributes(element, eventType) {\n return { ...this.attributes(), element, eventType };\n }\n unbind() {\n this._eachListenerAttributes(function (attrs) {\n let listener = up.EventListener.fromElement(attrs);\n if (listener) {\n listener.unbind();\n }\n });\n }\n static fromBindArgs(args, defaults) {\n args = u.copy(args);\n const callback = args.pop();\n let elements;\n if (args[0].addEventListener) {\n elements = [args.shift()];\n }\n else if (u.isJQuery(args[0]) || (u.isList(args[0]) && args[0][0].addEventListener)) {\n elements = args.shift();\n }\n else {\n elements = [document];\n }\n let eventTypes = u.parseTokens(args.shift());\n let fixTypes = up.migrate.fixEventTypes;\n if (fixTypes) {\n eventTypes = fixTypes(eventTypes);\n }\n const options = u.extractOptions(args);\n const selector = args[0];\n const attributes = { elements, eventTypes, selector, callback, ...options, ...defaults };\n return new (this)(attributes);\n }\n};\n\n\n/***/ }),\n/* 41 */\n/***/ (() => {\n\nconst u = up.util;\nup.FieldWatcher = class FieldWatcher {\n constructor(root, options, callback) {\n this._options = options;\n this._root = root;\n this._scope = up.form.getScope(root);\n this._callback = callback;\n this._batch = options.batch;\n this._abortable = options.abortable;\n }\n start() {\n this._scheduledValues = null;\n this._processedValues = this._readFieldValues();\n this._currentTimer = null;\n this._callbackRunning = false;\n this._unbindFns = [];\n this._watchFieldsWithin(this._root);\n this._root.addEventListener('up:fragment:inserted', ({ target }) => {\n if (target !== this._root)\n this._watchFieldsWithin(target);\n });\n this._unbindFns.push(up.fragment.onAborted(this._scope, () => this._abort()));\n this._unbindFns.push(up.on(this._scope, 'reset', () => this._onFormReset()));\n }\n stop() {\n this._abort();\n for (let unbindFn of this._unbindFns)\n unbindFn();\n }\n _fieldOptions(field) {\n let rootOptions = u.copy(this._options);\n return up.form.watchOptions(field, rootOptions, { defaults: { event: 'input' } });\n }\n _watchFieldsWithin(container) {\n for (let field of up.form.fields(container)) {\n this._watchField(field);\n }\n }\n _watchField(field) {\n let fieldOptions = this._fieldOptions(field);\n this._unbindFns.push(up.on(field, fieldOptions.event, () => this._check(fieldOptions)));\n }\n _abort() {\n this._scheduledValues = null;\n }\n _scheduleValues(values, fieldOptions) {\n this._scheduledValues = values;\n this._scheduledFieldOptions = fieldOptions;\n let delay = fieldOptions.delay || 0;\n clearTimeout(this._currentTimer);\n this._currentTimer = u.timer(delay, () => {\n this._currentTimer = null;\n this._requestCallback();\n });\n }\n _isNewValues(values) {\n return !u.isEqual(values, this._processedValues) && !u.isEqual(this._scheduledValues, values);\n }\n async _requestCallback() {\n if (!this._scheduledValues)\n return;\n if (this._callbackRunning)\n return;\n if (this._currentTimer)\n return;\n if (!this._scope.isConnected)\n return;\n let fieldOptions = this._scheduledFieldOptions;\n const diff = this._changedValues(this._processedValues, this._scheduledValues);\n this._processedValues = this._scheduledValues;\n this._scheduledValues = null;\n this._callbackRunning = true;\n this._scheduledFieldOptions = null;\n let callbackOptions = { ...fieldOptions, disable: false };\n const callbackReturnValues = [];\n if (this._batch) {\n callbackReturnValues.push(this._runCallback(diff, callbackOptions));\n }\n else {\n for (let name in diff) {\n const value = diff[name];\n callbackReturnValues.push(this._runCallback(value, name, callbackOptions));\n }\n }\n if (u.some(callbackReturnValues, u.isPromise)) {\n let callbackDone = Promise.allSettled(callbackReturnValues);\n up.form.disableWhile(callbackDone, fieldOptions);\n await callbackDone;\n }\n this._callbackRunning = false;\n this._requestCallback();\n }\n _runCallback(...args) {\n return up.error.guard(() => this._callback(...args));\n }\n _changedValues(previous, next) {\n const changes = {};\n let keys = Object.keys(previous);\n keys = keys.concat(Object.keys(next));\n keys = u.uniq(keys);\n for (let key of keys) {\n const previousValue = previous[key];\n const nextValue = next[key];\n if (!u.isEqual(previousValue, nextValue)) {\n changes[key] = nextValue;\n }\n }\n return changes;\n }\n _readFieldValues() {\n return up.Params.fromContainer(this._root).toObject();\n }\n _check(fieldOptions = {}) {\n const values = this._readFieldValues();\n if (this._isNewValues(values)) {\n this._scheduleValues(values, fieldOptions);\n }\n }\n _onFormReset() {\n u.task(() => this._check());\n }\n};\n\n\n/***/ }),\n/* 42 */\n/***/ (() => {\n\nconst u = up.util;\nconst e = up.element;\nup.FormValidator = class FormValidator {\n constructor(form) {\n this._form = form;\n this._dirtySolutions = [];\n this._nextRenderTimer = null;\n this._rendering = false;\n this._resetNextRenderPromise();\n this._honorAbort();\n }\n _honorAbort() {\n up.fragment.onAborted(this._form, (event) => this._onAborted(event));\n }\n _onAborted(event) {\n if (this._dirtySolutions.length) {\n this._dirtySolutions = [];\n this._nextRenderPromise.reject(new up.Aborted(event.reason));\n this._resetNextRenderPromise();\n }\n }\n _resetNextRenderPromise() {\n this._nextRenderPromise = u.newDeferred();\n }\n watchContainer(fieldOrForm) {\n let { event } = this._originOptions(fieldOrForm);\n let guard = () => up.fragment.isAlive(fieldOrForm);\n let callback = () => up.error.muteUncriticalRejection(this.validate({ origin: fieldOrForm }));\n up.on(fieldOrForm, event, { guard }, callback);\n }\n validate(options = {}) {\n let solutions = this._getSolutions(options);\n this._dirtySolutions.push(...solutions);\n this._scheduleNextRender();\n return this._nextRenderPromise;\n }\n _getSolutions(options) {\n let solutions = this._getTargetSelectorSolutions(options)\n || this._getFieldSolutions(options)\n || this._getElementSolutions(options.origin);\n for (let solution of solutions) {\n solution.renderOptions = this._originOptions(solution.origin, options);\n solution.target = up.fragment.resolveOrigin(solution.target, solution);\n }\n return solutions;\n }\n _getFieldSolutions({ origin, ...options }) {\n if (up.form.isField(origin)) {\n return this._getValidateAttrSolutions(origin) || this._getFormGroupSolutions(origin, options);\n }\n }\n _getFormGroupSolutions(field, { formGroup = true }) {\n if (!formGroup)\n return;\n let solution = up.form.groupSolution(field);\n if (solution) {\n up.puts('up.validate()', 'Validating form group of field %o', field);\n return [solution];\n }\n }\n _getTargetSelectorSolutions({ target, origin }) {\n if (u.isString(target)) {\n up.puts('up.validate()', 'Validating target \"%s\"', target);\n let simpleSelectors = up.fragment.splitTarget(target);\n return u.compact(simpleSelectors.map(function (simpleSelector) {\n let element = up.fragment.get(simpleSelector, { origin });\n if (element) {\n return {\n element,\n target: simpleSelector,\n origin\n };\n }\n else {\n up.fail('Validation target \"%s\" does not match an element', simpleSelector);\n }\n }));\n }\n }\n _getElementSolutions(element) {\n up.puts('up.validate()', 'Validating element %o', element);\n return [{\n element,\n target: up.fragment.toTarget(element),\n origin: element\n }];\n }\n _getValidateAttrSolutions(field) {\n let containerWithAttr = field.closest('[up-validate]');\n if (containerWithAttr) {\n let target = e.booleanOrStringAttr(containerWithAttr, 'up-validate');\n return this._getTargetSelectorSolutions({ target, origin: field });\n }\n }\n _originOptions(element, overrideOptions) {\n return up.form.watchOptions(element, overrideOptions, { defaults: { event: 'change' } });\n }\n _scheduleNextRender() {\n let solutionDelays = this._dirtySolutions.map((solution) => solution.renderOptions.delay);\n let shortestDelay = Math.min(...solutionDelays) || 0;\n clearTimeout(this._nextRenderTimer);\n this._nextRenderTimer = u.timer(shortestDelay, () => {\n this._nextRenderTimer = null;\n this._renderDirtySolutions();\n });\n }\n _renderDirtySolutions() {\n up.error.muteUncriticalRejection(this._doRenderDirtySolutions());\n }\n async _doRenderDirtySolutions() {\n if (!this._dirtySolutions.length)\n return;\n if (this._rendering)\n return;\n if (this._nextRenderTimer)\n return;\n let dirtySolutions = this._dirtySolutions;\n this._dirtySolutions = [];\n let dirtyOrigins = u.map(dirtySolutions, 'origin');\n let dirtyFields = u.flatMap(dirtyOrigins, up.form.fields);\n let dirtyNames = u.uniq(u.map(dirtyFields, 'name'));\n let dataMap = this._buildDataMap(dirtySolutions);\n let dirtyRenderOptionsList = u.map(dirtySolutions, 'renderOptions');\n let options = u.mergeDefined(...dirtyRenderOptionsList, { dataMap }, up.form.destinationOptions(this._form));\n options.target = u.map(dirtySolutions, 'target').join(', ');\n options.feedback = u.some(dirtyRenderOptionsList, 'feedback');\n options.origin = this._form;\n options.focus ??= 'keep';\n options.failOptions = false;\n options.defaultMaybe = true;\n options.params = up.Params.merge(options.params, ...u.map(dirtyRenderOptionsList, 'params'));\n options.headers = u.merge(...u.map(dirtyRenderOptionsList, 'headers'));\n this._addValidateHeader(options.headers, dirtyNames);\n options.guardEvent = up.event.build('up:form:validate', {\n fields: dirtyFields,\n log: 'Validating form',\n params: options.params,\n form: this._form,\n });\n this._rendering = true;\n let renderingPromise = this._nextRenderPromise;\n this._resetNextRenderPromise();\n options.disable = false;\n for (let solution of dirtySolutions) {\n up.form.disableWhile(renderingPromise, {\n disable: solution.renderOptions.disable,\n origin: solution.origin,\n });\n }\n try {\n renderingPromise.resolve(up.render(options));\n await renderingPromise;\n }\n finally {\n this._rendering = false;\n this._renderDirtySolutions();\n }\n }\n _addValidateHeader(headers, names) {\n let key = up.protocol.headerize('validate');\n let value = names.join(' ');\n if (!value || value.length > up.protocol.config.maxHeaderSize)\n value = ':unknown';\n headers[key] = value;\n }\n _buildDataMap(solutions) {\n let dataMap = {};\n for (let solution of solutions) {\n let data = u.pluckKey(solution.renderOptions, 'data');\n let keepData = u.pluckKey(solution.renderOptions, 'keepData');\n if (keepData) {\n data = up.data(solution.element);\n }\n if (data) {\n dataMap[solution.target] = data;\n }\n }\n return dataMap;\n }\n static forElement(element) {\n let form = up.form.get(element);\n return form.upFormValidator ||= new this(form);\n }\n};\n\n\n/***/ }),\n/* 43 */\n/***/ (() => {\n\nup.FocusCapsule = class FocusCapsule {\n constructor(target, cursorProps) {\n this._target = target;\n this._cursorProps = cursorProps;\n }\n restore(layer, options) {\n let rediscoveredElement = up.fragment.get(this._target, { layer });\n if (rediscoveredElement) {\n up.viewport.copyCursorProps(this._cursorProps, rediscoveredElement);\n up.focus(rediscoveredElement, options);\n return true;\n }\n }\n static preserve(layer) {\n let focusedElement = up.viewport.focusedElementWithin(layer.element);\n if (!focusedElement)\n return;\n let target = up.fragment.tryToTarget(focusedElement);\n if (!target)\n return;\n const cursorProps = up.viewport.copyCursorProps(focusedElement);\n return new this(target, cursorProps);\n }\n};\n\n\n/***/ }),\n/* 44 */\n/***/ (() => {\n\nconst u = up.util;\nup.FragmentProcessor = class FragmentProcessor extends up.Record {\n keys() {\n return [\n 'fragment',\n 'autoMeans',\n 'origin',\n 'layer'\n ];\n }\n process(opt) {\n let preprocessed = this.preprocess(opt);\n return this.tryProcess(preprocessed);\n }\n preprocess(opt) {\n return u.parseTokens(opt, { separator: 'or' });\n }\n tryProcess(opt) {\n if (u.isArray(opt)) {\n return this.processArray(opt);\n }\n if (u.isFunction(opt)) {\n let result = up.error.guard(() => opt(this.fragment, this.attributes()));\n return this.tryProcess(result);\n }\n if (u.isElement(opt)) {\n return this.processElement(opt);\n }\n if (u.isString(opt)) {\n if (opt === 'auto') {\n return this.tryProcess(this.autoMeans);\n }\n let match = opt.match(/^(.+?)-if-(.+?)$/);\n if (match) {\n return this.resolveCondition(match[2]) && this.process(match[1]);\n }\n }\n return this.processPrimitive(opt);\n }\n processArray(array) {\n return u.find(array, opt => this.tryProcess(opt));\n }\n resolveCondition(condition) {\n if (condition === 'main') {\n return this.fragment && up.fragment.contains(this.fragment, ':main');\n }\n }\n findSelector(selector) {\n const lookupOpts = { layer: this.layer, origin: this.origin };\n let matchWithinFragment = this.fragment && up.fragment.get(this.fragment, selector, lookupOpts);\n let match = matchWithinFragment || up.fragment.get(selector, lookupOpts);\n if (match) {\n return match;\n }\n else {\n up.warn('up.render()', 'Could not find an element matching \"%s\"', selector);\n }\n }\n};\n\n\n/***/ }),\n/* 45 */\n/***/ (() => {\n\nconst u = up.util;\nconst DESCENDANT_SELECTOR = /^([^ >+(]+) (.+)$/;\nup.FragmentFinder = class FragmentFinder {\n constructor(options) {\n this._options = options;\n this._origin = options.origin;\n this._selector = options.selector;\n this._document = options.document || window.document;\n this._match = options.match ?? up.fragment.config.match;\n this._preferOldElements = options.preferOldElements;\n }\n find() {\n return this._findInPreferredElements() || this._findInRegion() || this._findFirst();\n }\n _findInPreferredElements() {\n if (this._preferOldElements) {\n return this._preferOldElements.find((preferOldElement) => this._document.contains(preferOldElement) && up.fragment.matches(preferOldElement, this._selector));\n }\n }\n _findInRegion() {\n if (this._match === 'region' && !up.fragment.containsMainPseudo(this._selector) && this._origin?.isConnected) {\n return this._findClosest() || this._findDescendantInRegion();\n }\n }\n _findClosest() {\n return up.fragment.closest(this._origin, this._selector, this._options);\n }\n _findDescendantInRegion() {\n let simpleSelectors = up.fragment.splitTarget(this._selector);\n return u.findResult(simpleSelectors, (simpleSelector) => {\n let parts = simpleSelector.match(DESCENDANT_SELECTOR);\n if (parts) {\n let parent = up.fragment.closest(this._origin, parts[1], this._options);\n if (parent) {\n return up.fragment.getDumb(parent, parts[2]);\n }\n }\n });\n }\n _findFirst() {\n return up.fragment.getDumb(this._document, this._selector, this._options);\n }\n};\n\n\n/***/ }),\n/* 46 */\n/***/ (() => {\n\nconst u = up.util;\nconst e = up.element;\nconst PREVENT_SCROLL_OPTIONS = { preventScroll: true };\nup.FragmentFocus = class FragmentFocus extends up.FragmentProcessor {\n keys() {\n return super.keys().concat([\n 'hash',\n 'focusCapsule',\n 'inputDevice',\n ]);\n }\n processPrimitive(opt) {\n switch (opt) {\n case 'keep':\n return this._restoreLostFocus();\n case 'restore':\n return this._restorePreviousFocusForLocation();\n case 'target':\n case true:\n return this._focusElement(this.fragment);\n case 'layer':\n return this._focusElement(this.layer.getFocusElement());\n case 'main':\n return this._focusSelector(':main');\n case 'hash':\n return this._focusHash();\n case 'autofocus':\n return this._autofocus();\n default:\n if (u.isString(opt)) {\n return this._focusSelector(opt);\n }\n }\n }\n processElement(element) {\n return this._focusElement(element);\n }\n resolveCondition(condition) {\n if (condition === 'lost') {\n return this._wasFocusLost();\n }\n else {\n return super.resolveCondition(condition);\n }\n }\n _focusSelector(selector) {\n let match = this.findSelector(selector);\n return this._focusElement(match);\n }\n _restoreLostFocus() {\n if (this._wasFocusLost()) {\n return this.focusCapsule?.restore(this.layer, PREVENT_SCROLL_OPTIONS);\n }\n }\n _restorePreviousFocusForLocation() {\n return up.viewport.restoreFocus({ layer: this.layer });\n }\n _autofocus() {\n let autofocusElement = this.fragment && e.subtree(this.fragment, '[autofocus]')[0];\n if (autofocusElement) {\n return this._focusElement(autofocusElement);\n }\n }\n _focusElement(element) {\n if (element) {\n up.focus(element, { force: true, ...PREVENT_SCROLL_OPTIONS, inputDevice: this.inputDevice });\n return true;\n }\n }\n _focusHash() {\n let hashTarget = up.viewport.firstHashTarget(this.hash, { layer: this.layer });\n if (hashTarget) {\n return this._focusElement(hashTarget);\n }\n }\n _wasFocusLost() {\n return !this.layer.hasFocus();\n }\n};\n\n\n/***/ }),\n/* 47 */\n/***/ (() => {\n\nconst e = up.element;\nup.FragmentPolling = class FragmentPolling {\n constructor(fragment) {\n this._options = up.radio.pollOptions(fragment);\n this._fragment = fragment;\n up.destructor(fragment, this._onFragmentDestroyed.bind(this));\n up.fragment.onAborted(fragment, this._onFragmentAborted.bind(this));\n this._state = 'initialized';\n this._abortable = true;\n this._loading = false;\n this._satisfyInterval();\n }\n static forFragment(fragment) {\n return fragment.upPolling ||= new this(fragment);\n }\n onPollAttributeObserved() {\n this._start();\n }\n _onFragmentDestroyed() {\n this._stop();\n }\n _start(options) {\n Object.assign(this._options, options);\n if (this._state !== 'started') {\n if (!up.fragment.isTargetable(this._fragment)) {\n up.warn('[up-poll]', 'Cannot poll untargetable fragment %o', this._fragment);\n return;\n }\n this._state = 'started';\n this._ensureEventsBound();\n this._scheduleRemainingTime();\n }\n }\n _stop() {\n if (this._state === 'started') {\n this._clearReloadTimer();\n this._state = 'stopped';\n this.unbindEvents?.();\n }\n }\n forceStart(options) {\n Object.assign(this._options, options);\n this.forceStarted = true;\n this._start();\n }\n forceStop() {\n this._stop();\n this.forceStarted = false;\n }\n _ensureEventsBound() {\n if (!this.unbindEvents) {\n this.unbindEvents = up.on('visibilitychange up:layer:opened up:layer:dismissed up:layer:accepted', this._onVisibilityChange.bind(this));\n }\n }\n _onVisibilityChange() {\n if (this._isFragmentVisible()) {\n this._scheduleRemainingTime();\n }\n else {\n }\n }\n _isFragmentVisible() {\n return (!document.hidden) &&\n (this._options.ifLayer === 'any' || this._isOnFrontLayer());\n }\n _clearReloadTimer() {\n clearTimeout(this.reloadTimer);\n this.reloadTimer = null;\n }\n _scheduleRemainingTime() {\n if (!this.reloadTimer && !this._loading) {\n this._clearReloadTimer();\n this.reloadTimer = setTimeout(this._onTimerReached.bind(this), this._getRemainingDelay());\n }\n }\n _onTimerReached() {\n this.reloadTimer = null;\n this._tryReload();\n }\n _tryReload() {\n if (this._state !== 'started') {\n return;\n }\n if (!this._isFragmentVisible()) {\n up.puts('[up-poll]', 'Will not poll hidden fragment');\n return;\n }\n this._reloadNow();\n }\n _getFullDelay() {\n return this._options.interval ?? e.numberAttr(this._fragment, 'up-interval') ?? up.radio.config.pollInterval;\n }\n _getRemainingDelay() {\n return Math.max(this._getFullDelay() - this._getFragmentAge(), 0);\n }\n _getFragmentAge() {\n return new Date() - this._lastAttempt;\n }\n _isOnFrontLayer() {\n this.layer ||= up.layer.get(this._fragment);\n return this.layer?.isFront?.();\n }\n _reloadNow() {\n this._clearReloadTimer();\n let oldAbortable = this._abortable;\n try {\n this._abortable = false;\n this._loading = true;\n up.reload(this._fragment, this._reloadOptions()).then(this._onReloadSuccess.bind(this), this._onReloadFailure.bind(this));\n }\n finally {\n this._abortable = oldAbortable;\n }\n }\n _reloadOptions() {\n let guardEvent = up.event.build('up:fragment:poll', { log: ['Polling fragment', this._fragment] });\n return { ...this._options, guardEvent };\n }\n _onFragmentAborted({ newLayer }) {\n if (this._abortable && !newLayer) {\n this._stop();\n }\n }\n _onReloadSuccess({ fragment }) {\n this._loading = false;\n this._satisfyInterval();\n if (fragment) {\n this._onFragmentSwapped(fragment);\n }\n else {\n this._scheduleRemainingTime();\n }\n }\n _onFragmentSwapped(newFragment) {\n this._stop();\n if (this.forceStarted && up.fragment.matches(this._fragment, newFragment)) {\n this.constructor.forFragment(newFragment).forceStart(this._options);\n }\n }\n _onReloadFailure(reason) {\n this._loading = false;\n this._satisfyInterval();\n this._scheduleRemainingTime();\n up.error.throwCritical(reason);\n }\n _satisfyInterval() {\n this._lastAttempt = new Date();\n }\n};\n\n\n/***/ }),\n/* 48 */\n/***/ (() => {\n\nconst u = up.util;\nup.FragmentScrolling = class FragmentScrolling extends up.FragmentProcessor {\n keys() {\n return super.keys().concat([\n 'hash',\n 'mode',\n 'revealTop',\n 'revealMax',\n 'revealSnap',\n 'scrollBehavior',\n ]);\n }\n processPrimitive(opt) {\n switch (opt) {\n case 'reset':\n return this._reset();\n case 'layer':\n return this._revealLayer();\n case 'main':\n return this._revealSelector(':main');\n case 'restore':\n return this._restore();\n case 'hash':\n return this.hash && up.viewport.revealHash(this.hash, this.attributes());\n case 'target':\n case 'reveal':\n case true:\n return this._revealElement(this.fragment);\n default:\n if (u.isString(opt)) {\n return this._revealSelector(opt);\n }\n }\n }\n processElement(element) {\n return this._revealElement(element);\n }\n _revealElement(element) {\n if (element) {\n up.reveal(element, this.attributes());\n return true;\n }\n }\n _revealSelector(selector) {\n let match = this.findSelector(selector);\n return this._revealElement(match);\n }\n _revealLayer() {\n return this._revealElement(this.layer.getBoxElement());\n }\n _reset() {\n up.viewport.resetScroll({ ...this.attributes(), around: this.fragment });\n return true;\n }\n _restore() {\n return up.viewport.restoreScroll({ ...this.attributes(), around: this.fragment });\n }\n};\n\n\n/***/ }),\n/* 49 */\n/***/ (() => {\n\nconst e = up.element;\nconst u = up.util;\nup.Layer = class Layer extends up.Record {\n keys() {\n return [\n 'element',\n 'stack',\n 'history',\n 'mode',\n 'context',\n 'lastScrollTops',\n 'lastFocusCapsules',\n ];\n }\n defaults() {\n return {\n context: {},\n lastScrollTops: up.viewport.newStateCache(),\n lastFocusCapsules: up.viewport.newStateCache()\n };\n }\n constructor(options = {}) {\n super(options);\n if (!this.mode) {\n throw \"missing { mode } option\";\n }\n }\n setupHandlers() {\n up.link.convertClicks(this);\n }\n teardownHandlers() { }\n mainTargets() {\n return up.layer.mainTargets(this.mode);\n }\n sync() {\n }\n accept() {\n throw new up.NotImplemented();\n }\n dismiss() {\n throw new up.NotImplemented();\n }\n peel(options) {\n this.stack.peel(this, options);\n }\n evalOption(option) {\n return u.evalOption(option, this);\n }\n isCurrent() {\n return this.stack.isCurrent(this);\n }\n isFront() {\n return this.stack.isFront(this);\n }\n isRoot() {\n return this.stack.isRoot(this);\n }\n isOverlay() {\n return this.stack.isOverlay(this);\n }\n isOpen() {\n return this.stack.isOpen(this);\n }\n isClosed() {\n return this.stack.isClosed(this);\n }\n get parent() {\n return this.stack.parentOf(this);\n }\n get child() {\n return this.stack.childOf(this);\n }\n get ancestors() {\n return this.stack.ancestorsOf(this);\n }\n get descendants() {\n return this.stack.descendantsOf(this);\n }\n get subtree() {\n return [this, ...this.descendants];\n }\n get index() {\n return this._index ??= this.stack.indexOf(this);\n }\n getContentElement() {\n return this.contentElement || this.element;\n }\n getBoxElement() {\n return this.boxElement || this.element;\n }\n getFocusElement() {\n return this.getBoxElement();\n }\n getFirstSwappableElement() {\n throw new up.NotImplemented();\n }\n contains(element) {\n return element.closest(up.layer.anySelector()) === this.element;\n }\n on(...args) {\n return this._buildEventListenerGroup(args).bind();\n }\n off(...args) {\n return this._buildEventListenerGroup(args).unbind();\n }\n _buildEventListenerGroup(args) {\n return up.EventListenerGroup.fromBindArgs(args, {\n guard: (event) => this._containsEventTarget(event),\n elements: [this.element],\n baseLayer: this\n });\n }\n _containsEventTarget(event) {\n return this.contains(event.target);\n }\n wasHitByMouseEvent({ clientX, clientY }) {\n const hittableElement = document.elementFromPoint(clientX, clientY);\n return !hittableElement || this.contains(hittableElement);\n }\n _buildEventEmitter(args) {\n return up.EventEmitter.fromEmitArgs(args, { layer: this });\n }\n emit(...args) {\n return this._buildEventEmitter(args).emit();\n }\n isDetached() {\n return !this.element.isConnected;\n }\n saveHistory() {\n if (this.history) {\n this.savedTitle = document.title;\n this.savedMetaTags = up.history.findMetaTags();\n this.savedLocation = up.history.location;\n this.savedLang = up.history.getLang();\n }\n }\n restoreHistory() {\n if (!this.showsLiveHistory()) {\n return;\n }\n if (this.savedLocation) {\n up.history.push(this.savedLocation);\n }\n if (this.savedTitle) {\n document.title = this.savedTitle;\n }\n if (this.savedMetaTags) {\n up.history.updateMetaTags(this.savedMetaTags);\n }\n if (u.isString(this.savedLang)) {\n up.history.updateLang(this.savedLang);\n }\n }\n asCurrent(fn) {\n return this.stack.asCurrent(this, fn);\n }\n updateHistory(options) {\n if (u.isString(options.location)) {\n this.location = options.location;\n }\n if (up.history.config.updateMetaTags && u.isList(options.metaTags)) {\n up.migrate?.warnOfHungryMetaTags?.(options.metaTags);\n this.metaTags = options.metaTags;\n }\n if (u.isString(options.title)) {\n this.title = options.title;\n }\n if (u.isString(options.lang)) {\n this.lang = options.lang;\n }\n }\n showsLiveHistory() {\n return this.history && this.isFront();\n }\n get title() {\n if (this.showsLiveHistory()) {\n return document.title;\n }\n else {\n return this.savedTitle;\n }\n }\n set title(title) {\n this.savedTitle = title;\n if (this.showsLiveHistory()) {\n document.title = title;\n }\n }\n get metaTags() {\n if (this.showsLiveHistory()) {\n return up.history.findMetaTags();\n }\n else {\n return this.savedMetaTags;\n }\n }\n set metaTags(metaTags) {\n this.savedMetaTags = metaTags;\n if (this.showsLiveHistory()) {\n up.history.updateMetaTags(metaTags);\n }\n }\n get lang() {\n if (this.showsLiveHistory()) {\n return up.history.getLang();\n }\n else {\n return this.savedLang;\n }\n }\n set lang(lang) {\n this.savedLang = lang;\n if (this.showsLiveHistory()) {\n up.history.updateLang(lang);\n }\n }\n get location() {\n if (this.showsLiveHistory()) {\n return up.history.location;\n }\n else {\n return this.savedLocation;\n }\n }\n set location(location) {\n const previousLocation = this.location;\n location = u.normalizeURL(location);\n if (previousLocation !== location || this.opening) {\n this.savedLocation = location;\n if (this.showsLiveHistory()) {\n up.history.push(location);\n }\n if (!this.opening) {\n this.emit('up:layer:location:changed', { location });\n }\n }\n }\n selector(part) {\n return this.constructor.selector(part);\n }\n static selector(_part) {\n throw new up.NotImplemented();\n }\n toString() {\n throw new up.NotImplemented();\n }\n affix(...args) {\n return e.affix(this.getFirstSwappableElement(), ...args);\n }\n [u.isEqual.key](other) {\n return (this.constructor === other.constructor) && (this.element === other.element);\n }\n hasFocus() {\n let focusedElement = document.activeElement;\n return focusedElement !== document.body && this.element.contains(focusedElement);\n }\n reset() {\n Object.assign(this, this.defaults());\n }\n};\n\n\n/***/ }),\n/* 50 */\n/***/ (() => {\n\nconst e = up.element;\nconst u = up.util;\nup.Layer.Overlay = class Overlay extends up.Layer {\n keys() {\n return super.keys().concat([\n 'position',\n 'align',\n 'size',\n 'origin',\n 'class',\n 'backdrop',\n 'openAnimation',\n 'closeAnimation',\n 'openDuration',\n 'closeDuration',\n 'openEasing',\n 'closeEasing',\n 'backdropOpenAnimation',\n 'backdropCloseAnimation',\n 'dismissable',\n 'dismissLabel',\n 'dismissAriaLabel',\n 'onOpened',\n 'onAccept',\n 'onAccepted',\n 'onDismiss',\n 'onDismissed',\n 'acceptEvent',\n 'dismissEvent',\n 'acceptLocation',\n 'dismissLocation',\n 'opening'\n ]);\n }\n constructor(options) {\n super(options);\n if (this.dismissable === true) {\n this.dismissable = ['button', 'key', 'outside'];\n }\n else if (this.dismissable === false) {\n this.dismissable = [];\n }\n else {\n this.dismissable = u.parseTokens(this.dismissable);\n }\n if (this.acceptLocation) {\n this.acceptLocation = new up.URLPattern(this.acceptLocation);\n }\n if (this.dismissLocation) {\n this.dismissLocation = new up.URLPattern(this.dismissLocation);\n }\n }\n callback(name) {\n let fn = this[name];\n if (fn) {\n return fn.bind(this);\n }\n }\n createElement(parentElement) {\n this.nesting ||= this._suggestVisualNesting();\n const elementAttrs = u.compactObject(u.pick(this, ['align', 'position', 'size', 'class', 'nesting']));\n this.element = this.affixPart(parentElement, null, elementAttrs);\n }\n createBackdropElement(parentElement) {\n this.backdropElement = this.affixPart(parentElement, 'backdrop');\n }\n createViewportElement(parentElement) {\n this.viewportElement = this.affixPart(parentElement, 'viewport', { 'up-viewport': '' });\n }\n createBoxElement(parentElement) {\n this.boxElement = this.affixPart(parentElement, 'box');\n }\n createContentElement(parentElement) {\n this.contentElement = this.affixPart(parentElement, 'content');\n }\n setContent(content) {\n this.contentElement.append(content);\n this.onContentSet();\n }\n onContentSet() {\n }\n createDismissElement(parentElement) {\n this.dismissElement = this.affixPart(parentElement, 'dismiss', {\n 'up-dismiss': '\":button\"',\n 'aria-label': this.dismissAriaLabel\n });\n return e.affix(this.dismissElement, 'span[aria-hidden=\"true\"]', { text: this.dismissLabel });\n }\n affixPart(parentElement, part, options = {}) {\n return e.affix(parentElement, this.selector(part), options);\n }\n static selector(part) {\n return u.compact(['up', this.mode, part]).join('-');\n }\n _suggestVisualNesting() {\n const { parent } = this;\n if (this.mode === parent.mode) {\n return 1 + parent._suggestVisualNesting();\n }\n else {\n return 0;\n }\n }\n setupHandlers() {\n super.setupHandlers();\n this.overlayFocus = new up.OverlayFocus(this);\n if (this._supportsDismissMethod('button')) {\n this.createDismissElement(this.getBoxElement());\n }\n if (this._supportsDismissMethod('outside')) {\n if (this.viewportElement) {\n up.on(this.viewportElement, 'up:click', event => {\n if (event.target === this.viewportElement) {\n this._onOutsideClicked(event, true);\n }\n });\n }\n else {\n this.unbindParentClicked = this.parent.on('up:click', (event, element) => {\n if (!up.layer.isWithinForeignOverlay(element)) {\n const originClicked = this.origin && this.origin.contains(element);\n this._onOutsideClicked(event, originClicked);\n }\n });\n }\n }\n if (this._supportsDismissMethod('key')) {\n this.unbindEscapePressed = up.event.onEscape(event => this.onEscapePressed(event));\n }\n this.registerClickCloser('up-accept', (value, closeOptions) => {\n this.accept(value, closeOptions);\n });\n this.registerClickCloser('up-dismiss', (value, closeOptions) => {\n this.dismiss(value, closeOptions);\n });\n up.migrate.registerLayerCloser?.(this);\n this._registerEventCloser(this.acceptEvent, this.accept);\n this._registerEventCloser(this.dismissEvent, this.dismiss);\n this.on('up:click', 'label[for]', (event, label) => this._onLabelClicked(event, label));\n }\n _onLabelClicked(event, label) {\n let id = label.getAttribute('for');\n let fieldSelector = up.form.fieldSelector(e.idSelector(id));\n let fieldsAnywhere = up.fragment.all(fieldSelector, { layer: 'any' });\n let fieldsInLayer = up.fragment.all(fieldSelector, { layer: this });\n if (fieldsAnywhere.length > 1 && fieldsInLayer[0] !== fieldsAnywhere[0]) {\n event.preventDefault();\n const field = fieldsInLayer[0];\n field.focus();\n if (field.matches('input[type=checkbox], input[type=radio]')) {\n field.click();\n }\n }\n }\n _onOutsideClicked(event, halt) {\n up.log.putsEvent(event);\n if (halt)\n up.event.halt(event);\n up.error.muteUncriticalSync(() => this.dismiss(':outside', { origin: event.target }));\n }\n onEscapePressed(event) {\n if (this.isFront()) {\n let field = up.form.focusedField();\n if (field) {\n field.blur();\n }\n else if (this._supportsDismissMethod('key')) {\n up.event.halt(event, { log: true });\n up.error.muteUncriticalSync(() => this.dismiss(':key'));\n }\n }\n }\n registerClickCloser(attribute, closeFn) {\n let selector = `[${attribute}]`;\n this.on('up:click', selector, function (event) {\n up.event.halt(event, { log: true });\n const origin = event.target.closest(selector);\n const value = e.jsonAttr(origin, attribute);\n const closeOptions = { origin };\n const parser = new up.OptionsParser(origin, closeOptions);\n parser.booleanOrString('animation');\n parser.string('easing');\n parser.number('duration');\n parser.string('confirm');\n up.error.muteUncriticalSync(() => closeFn(value, closeOptions));\n });\n }\n _registerEventCloser(eventTypes, closeFn) {\n if (!eventTypes) {\n return;\n }\n return this.on(eventTypes, event => {\n event.preventDefault();\n up.error.muteUncriticalSync(() => closeFn.call(this, event, { response: event.response }));\n });\n }\n tryAcceptForLocation(options) {\n this._tryCloseForLocation(this.acceptLocation, this.accept, options);\n }\n tryDismissForLocation(options) {\n this._tryCloseForLocation(this.dismissLocation, this.dismiss, options);\n }\n _tryCloseForLocation(urlPattern, closeFn, options) {\n let location, resolution;\n if (urlPattern && (location = this.location) && (resolution = urlPattern.recognize(location))) {\n const closeValue = { ...resolution, location };\n up.error.muteUncriticalSync(() => closeFn.call(this, closeValue, options));\n }\n }\n teardownHandlers() {\n super.teardownHandlers();\n this.unbindParentClicked?.();\n this.unbindEscapePressed?.();\n this.overlayFocus.teardown();\n }\n destroyElements(options) {\n const animation = () => this.startCloseAnimation(options);\n const onFinished = () => {\n this.onElementsRemoved();\n options.onFinished?.();\n };\n const destroyOptions = { ...options, animation, onFinished, log: false };\n up.destroy(this.element, destroyOptions);\n }\n onElementsRemoved() {\n }\n _startAnimation(options = {}) {\n const boxDone = up.animate(this.getBoxElement(), options.boxAnimation, options);\n let backdropDone;\n if (this.backdrop && !up.motion.isNone(options.boxAnimation)) {\n backdropDone = up.animate(this.backdropElement, options.backdropAnimation, options);\n }\n return Promise.all([boxDone, backdropDone]);\n }\n async startOpenAnimation(options = {}) {\n await this._startAnimation({\n boxAnimation: options.animation ?? this.evalOption(this.openAnimation),\n backdropAnimation: 'fade-in',\n easing: options.easing || this.openEasing,\n duration: options.duration || this.openDuration\n });\n this.wasEverVisible = true;\n }\n startCloseAnimation(options = {}) {\n return this._startAnimation({\n boxAnimation: this.wasEverVisible && (options.animation ?? this.evalOption(this.closeAnimation)),\n backdropAnimation: this.wasEverVisible && 'fade-out',\n easing: options.easing || this.closeEasing,\n duration: options.duration || this.closeDuration\n });\n }\n accept(value = null, options = {}) {\n return this._executeCloseChange('accept', value, options);\n }\n dismiss(value = null, options = {}) {\n return this._executeCloseChange('dismiss', value, options);\n }\n _supportsDismissMethod(method) {\n return u.contains(this.dismissable, method);\n }\n _executeCloseChange(verb, value, options) {\n options = { ...options, verb, value, layer: this };\n return new up.Change.CloseLayer(options).execute();\n }\n getFirstSwappableElement() {\n return this.getContentElement().children[0];\n }\n toString() {\n return `${this.mode} overlay`;\n }\n};\n\n\n/***/ }),\n/* 51 */\n/***/ (() => {\n\nup.Layer.OverlayWithTether = class OverlayWithTether extends up.Layer.Overlay {\n createElements() {\n if (!this.origin) {\n up.fail('Missing { origin } option');\n }\n this._tether = new up.Tether({\n anchor: this.origin,\n align: this.align,\n position: this.position\n });\n this.createElement(this._tether.parent);\n this.createContentElement(this.element);\n }\n onContentSet() {\n this._tether.start(this.element);\n }\n onElementsRemoved() {\n this._tether.stop();\n }\n sync() {\n if (this.isOpen()) {\n if (this.isDetached() || this._tether.isDetached()) {\n this.dismiss(':detached', {\n animation: false,\n preventable: false\n });\n }\n else {\n this._tether.sync();\n }\n }\n }\n};\n\n\n/***/ }),\n/* 52 */\n/***/ (() => {\n\nup.Layer.OverlayWithViewport = class OverlayWithViewport extends up.Layer.Overlay {\n static getParentElement() {\n return document.body;\n }\n createElements() {\n up.viewport.bodyShifter.raiseStack();\n this.createElement(this.constructor.getParentElement());\n if (this.backdrop) {\n this.createBackdropElement(this.element);\n }\n this.createViewportElement(this.element);\n this.createBoxElement(this.viewportElement);\n this.createContentElement(this.boxElement);\n }\n onElementsRemoved() {\n up.viewport.bodyShifter.lowerStack();\n }\n sync() {\n if (this.isDetached() && this.isOpen()) {\n this.constructor.getParentElement().appendChild(this.element);\n }\n }\n};\n\n\n/***/ }),\n/* 53 */\n/***/ (() => {\n\nvar _a;\nconst e = up.element;\nup.Layer.Root = (_a = class Root extends up.Layer {\n get element() {\n return e.root;\n }\n constructor(options) {\n super(options);\n this.setupHandlers();\n }\n getFirstSwappableElement() {\n return document.body;\n }\n static selector() {\n return 'html';\n }\n setupHandlers() {\n if (!this.element.upHandlersApplied) {\n this.element.upHandlersApplied = true;\n super.setupHandlers();\n }\n }\n sync() {\n this.setupHandlers();\n }\n accept() {\n this._cannotCloseRoot();\n }\n dismiss() {\n this._cannotCloseRoot();\n }\n _cannotCloseRoot() {\n up.fail('Cannot close the root layer');\n }\n toString() {\n return \"root layer\";\n }\n },\n _a.mode = 'root',\n _a);\n\n\n/***/ }),\n/* 54 */\n/***/ (() => {\n\nvar _a;\nup.Layer.Modal = (_a = class Modal extends up.Layer.OverlayWithViewport {\n },\n _a.mode = 'modal',\n _a);\n\n\n/***/ }),\n/* 55 */\n/***/ (() => {\n\nvar _a;\nup.Layer.Popup = (_a = class Popup extends up.Layer.OverlayWithTether {\n },\n _a.mode = 'popup',\n _a);\n\n\n/***/ }),\n/* 56 */\n/***/ (() => {\n\nvar _a;\nup.Layer.Drawer = (_a = class Drawer extends up.Layer.OverlayWithViewport {\n },\n _a.mode = 'drawer',\n _a);\n\n\n/***/ }),\n/* 57 */\n/***/ (() => {\n\nvar _a;\nup.Layer.Cover = (_a = class Cover extends up.Layer.OverlayWithViewport {\n },\n _a.mode = 'cover',\n _a);\n\n\n/***/ }),\n/* 58 */\n/***/ (() => {\n\nvar _a;\nconst u = up.util;\nconst e = up.element;\nup.LayerLookup = (_a = class LayerLookup {\n constructor(stack, options) {\n this._stack = stack;\n if (options.normalizeLayerOptions !== false) {\n up.layer.normalizeOptions(options);\n }\n this._options = options;\n this._values = u.parseTokens(options.layer);\n }\n all() {\n let results = u.flatMap(this._values, value => this._resolveValue(value));\n results = u.compact(results);\n results = u.uniq(results);\n return results;\n }\n static all(stack, ...args) {\n const options = u.parseArgIntoOptions(args, 'layer');\n const { layer } = options;\n if (layer instanceof up.Layer) {\n return [layer];\n }\n return new this(stack, options).all();\n }\n _forElement(element) {\n element = e.get(element);\n return u.find(this._stack.reversed(), layer => layer.contains(element));\n }\n _forIndex(value) {\n return this._stack.at(value);\n }\n _resolveValue(value) {\n if (value instanceof up.Layer) {\n return value;\n }\n if (u.isNumber(value)) {\n return this._forIndex(value);\n }\n if (/^\\d+$/.test(value)) {\n return this._forIndex(Number(value));\n }\n if (u.isElementish(value)) {\n return this._forElement(value);\n }\n switch (value) {\n case 'any':\n return [this._getBaseLayer(), ...this._stack.reversed()];\n case 'current':\n return this._getBaseLayer();\n case 'closest':\n return this._stack.selfAndAncestorsOf(this._getBaseLayer());\n case 'parent':\n return this._getBaseLayer().parent;\n case 'ancestor':\n case 'ancestors':\n return this._getBaseLayer().ancestors;\n case 'child':\n return this._getBaseLayer().child;\n case 'descendant':\n case 'descendants':\n return this._getBaseLayer().descendants;\n case 'subtree':\n return this._getBaseLayer().subtree;\n case 'new':\n return 'new';\n case 'root':\n return this._stack.root;\n case 'overlay':\n case 'overlays':\n return u.reverse(this._stack.overlays);\n case 'front':\n return this._stack.front;\n case 'origin':\n return this._getOriginLayer();\n default:\n return up.fail(\"Unknown { layer } option: %o\", value);\n }\n }\n _getOriginLayer() {\n let { origin, originLayer } = this._options;\n if (originLayer) {\n return originLayer;\n }\n if (origin) {\n return this._forElement(origin);\n }\n }\n _getBaseLayer() {\n let { baseLayer } = this._options;\n if (u.isString(baseLayer)) {\n const recursiveOptions = { ...this._options, baseLayer: this._stack.current, normalizeLayerOptions: false, layer: baseLayer };\n return this.constructor.all(this._stack, recursiveOptions)[0];\n }\n else {\n return baseLayer || this._getOriginLayer() || this._stack.current;\n }\n }\n },\n (() => {\n u.memoizeMethod(_a.prototype, {\n _getBaseLayer: true,\n _getOriginLayer: true,\n });\n })(),\n _a);\n\n\n/***/ }),\n/* 59 */\n/***/ (() => {\n\nconst u = up.util;\nup.LayerStack = class LayerStack {\n constructor() {\n this._currentOverrides = [];\n this.layers = [this._buildRoot()];\n }\n _buildRoot() {\n return up.layer.build({ mode: 'root', stack: this });\n }\n remove(layer) {\n u.remove(this.layers, layer);\n }\n peel(layer, options) {\n const descendants = u.reverse(layer.descendants);\n const dismissOptions = { ...options, preventable: false };\n for (let descendant of descendants) {\n descendant.dismiss(':peel', dismissOptions);\n }\n }\n reset() {\n this.peel(this.root, { animation: false });\n this._currentOverrides = [];\n this.root.reset();\n }\n isOpen(layer) {\n return u.contains(this.layers, layer);\n }\n isClosed(layer) {\n return !this.isOpen(layer);\n }\n parentOf(layer) {\n return this.layers[layer.index - 1];\n }\n childOf(layer) {\n return this.layers[layer.index + 1];\n }\n ancestorsOf(layer) {\n return u.reverse(this.layers.slice(0, layer.index));\n }\n selfAndAncestorsOf(layer) {\n return [layer, ...layer.ancestors];\n }\n descendantsOf(layer) {\n return this.layers.slice(layer.index + 1);\n }\n isRoot(layer) {\n return this.root === layer;\n }\n isOverlay(layer) {\n return this.root !== layer;\n }\n isCurrent(layer) {\n return this.current === layer;\n }\n isFront(layer) {\n return this.front === layer;\n }\n get(...args) {\n return this.getAll(...args)[0];\n }\n getAll(...args) {\n return up.LayerLookup.all(this, ...args);\n }\n sync() {\n for (let layer of this.layers) {\n layer.sync();\n }\n }\n asCurrent(layer, fn) {\n try {\n this._currentOverrides.push(layer);\n return fn();\n }\n finally {\n this._currentOverrides.pop();\n }\n }\n reversed() {\n return u.reverse(this.layers);\n }\n dismissOverlays(value = null, options = {}) {\n options.dismissable = false;\n for (let overlay of u.reverse(this.overlays)) {\n overlay.dismiss(value, options);\n }\n }\n at(index) {\n return this.layers[index];\n }\n indexOf(layer) {\n return this.layers.indexOf(layer);\n }\n get count() {\n return this.layers.length;\n }\n get root() {\n return this.layers[0];\n }\n get overlays() {\n return this.root.descendants;\n }\n get current() {\n return u.last(this._currentOverrides) || this.front;\n }\n get front() {\n return u.last(this.layers);\n }\n};\n\n\n/***/ }),\n/* 60 */\n/***/ (() => {\n\nconst u = up.util;\nup.LinkFeedbackURLs = class LinkFeedbackURLs {\n constructor(link) {\n this._isSafe = up.link.isSafe(link);\n if (this._isSafe) {\n const href = link.getAttribute('href');\n if (href && (href !== '#')) {\n this._href = u.matchableURL(href);\n }\n const upHREF = link.getAttribute('up-href');\n if (upHREF) {\n this._upHREF = u.matchableURL(upHREF);\n }\n const alias = link.getAttribute('up-alias');\n if (alias) {\n this._aliasPattern = new up.URLPattern(alias);\n }\n }\n }\n isCurrent(normalizedLocation) {\n if (!normalizedLocation) {\n return false;\n }\n return !!(this._href === normalizedLocation ||\n this._upHREF === normalizedLocation ||\n this._aliasPattern?.test?.(normalizedLocation, false));\n }\n};\n\n\n/***/ }),\n/* 61 */\n/***/ (() => {\n\nconst u = up.util;\nconst e = up.element;\nup.LinkFollowIntent = class LinkFollowIntent {\n constructor(link, callback) {\n this._link = link;\n this._callback = callback;\n this._on('mouseenter mousedown touchstart', (event) => this._scheduleCallback(event));\n this._on('mouseleave', () => this._unscheduleCallback());\n up.fragment.onAborted(this._link, () => this._unscheduleCallback());\n }\n _on(eventType, callback) {\n up.on(this._link, eventType, { passive: true }, callback);\n }\n _scheduleCallback(event) {\n if (!up.link.shouldFollowEvent(event, this._link))\n return;\n this._unscheduleCallback();\n const applyDelay = (event.type === 'mouseenter');\n if (applyDelay) {\n let delay = this._parseDelay();\n this._timer = u.timer(delay, () => this._runCallback(event));\n }\n else {\n this._runCallback(event);\n }\n }\n _unscheduleCallback() {\n clearTimeout(this._timer);\n up.network.abort((request) => (request.origin === this._link) && request.background);\n }\n _parseDelay() {\n return e.numberAttr(this._link, 'up-preload-delay') ?? up.link.config.preloadDelay;\n }\n _runCallback(event) {\n up.log.putsEvent(event);\n up.error.muteUncriticalRejection(this._callback());\n }\n};\n\n\n/***/ }),\n/* 62 */\n/***/ (() => {\n\nconst u = up.util;\nconst e = up.element;\nup.MotionController = class MotionController {\n constructor(name) {\n this._activeClass = `up-${name}`;\n this._selector = `.${this._activeClass}`;\n this.finishEvent = `up:${name}:finish`;\n this.finishCount = 0;\n this._clusterCount = 0;\n }\n startFunction(cluster, startMotion, memory = {}) {\n cluster = e.list(cluster);\n const mutedAnimator = () => up.error.muteUncriticalRejection(startMotion());\n memory.trackMotion = memory.trackMotion ?? up.motion.isEnabled();\n if (memory.trackMotion === false) {\n return mutedAnimator();\n }\n else {\n memory.trackMotion = false;\n this.finish(cluster);\n this._markCluster(cluster);\n let promise = this._whileForwardingFinishEvent(cluster, mutedAnimator);\n promise = promise.then(() => this._unmarkCluster(cluster));\n return promise;\n }\n }\n finish(elements) {\n this.finishCount++;\n if ((this._clusterCount === 0) || !up.motion.isEnabled()) {\n return;\n }\n elements = this._expandFinishRequest(elements);\n for (let element of elements) {\n this._finishOneElement(element);\n }\n return up.migrate.formerlyAsync?.('up.motion.finish()');\n }\n _expandFinishRequest(elements) {\n if (elements) {\n return u.flatMap(elements, el => e.list(el.closest(this._selector), el.querySelectorAll(this._selector)));\n }\n else {\n return document.querySelectorAll(this._selector);\n }\n }\n isActive(element) {\n return element.classList.contains(this._activeClass);\n }\n _finishOneElement(element) {\n this._emitFinishEvent(element);\n }\n _emitFinishEvent(element, eventAttrs = {}) {\n eventAttrs = { target: element, log: false, ...eventAttrs };\n return up.emit(this.finishEvent, eventAttrs);\n }\n _markCluster(cluster) {\n this._clusterCount++;\n this._toggleActive(cluster, true);\n }\n _unmarkCluster(cluster) {\n this._clusterCount--;\n this._toggleActive(cluster, false);\n }\n _toggleActive(cluster, isActive) {\n for (let element of cluster) {\n element.classList.toggle(this._activeClass, isActive);\n }\n }\n _whileForwardingFinishEvent(cluster, fn) {\n if (cluster.length < 2) {\n return fn();\n }\n const doForward = (event) => {\n if (!event.forwarded) {\n for (let element of cluster) {\n if (element !== event.target && this.isActive(element)) {\n this._emitFinishEvent(element, { forwarded: true });\n }\n }\n }\n };\n const unbindFinish = up.on(cluster, this.finishEvent, doForward);\n return fn().then(unbindFinish);\n }\n async reset() {\n await this.finish();\n this.finishCount = 0;\n this._clusterCount = 0;\n }\n};\n\n\n/***/ }),\n/* 63 */\n/***/ (() => {\n\nconst u = up.util;\nconst e = up.element;\nup.NonceableCallback = class NonceableCallback {\n constructor(script, nonce) {\n this.script = script;\n this.nonce = nonce;\n }\n static fromString(string) {\n let match = string.match(/^(nonce-([^\\s]+)\\s)?(.*)$/);\n return new this(match[3], match[2]);\n }\n toFunction(...argNames) {\n if (this.nonce) {\n let callbackThis = this;\n return function (...args) {\n return callbackThis._runAsNoncedFunction(this, argNames, args);\n };\n }\n else {\n return new Function(...argNames, this.script);\n }\n }\n toString() {\n return `nonce-${this.nonce} ${this.script}`;\n }\n _runAsNoncedFunction(thisArg, argNames, args) {\n let wrappedScript = `\n try {\n up.noncedEval.value = (function(${argNames.join()}) {\n ${this.script}\n }).apply(up.noncedEval.thisArg, up.noncedEval.args)\n } catch (error) {\n up.noncedEval.error = error\n }\n `;\n let script;\n try {\n up.noncedEval = { args, thisArg: thisArg };\n script = up.element.affix(document.body, 'script', { nonce: this.nonce, text: wrappedScript });\n if (up.noncedEval.error) {\n throw up.noncedEval.error;\n }\n else {\n return up.noncedEval.value;\n }\n }\n finally {\n up.noncedEval = undefined;\n if (script) {\n script.remove();\n }\n }\n }\n _allowedBy(allowedNonces) {\n return this.nonce && u.contains(allowedNonces, this.nonce);\n }\n static adoptNonces(element, allowedNonces) {\n if (!allowedNonces?.length) {\n return;\n }\n const getPageNonce = u.memoize(up.protocol.cspNonce);\n u.each(up.script.config.nonceableAttributes, (attribute) => {\n let matches = e.subtree(element, `[${attribute}^=\"nonce-\"]`);\n u.each(matches, (match) => {\n let attributeValue = match.getAttribute(attribute);\n let callback = this.fromString(attributeValue);\n let warn = (message, ...args) => up.log.warn('up.render()', `Cannot use callback [${attribute}=\"${attributeValue}\"]: ${message}`, ...args);\n if (!callback._allowedBy(allowedNonces)) {\n return warn(\"Callback's CSP nonce (%o) does not match response header (%o)\", callback.nonce, allowedNonces);\n }\n let pageNonce = getPageNonce();\n if (!pageNonce) {\n return warn(\"Current page's CSP nonce is unknown\");\n }\n callback.nonce = pageNonce;\n match.setAttribute(attribute, callback.toString());\n });\n });\n }\n};\n\n\n/***/ }),\n/* 64 */\n/***/ (() => {\n\nconst e = up.element;\nconst u = up.util;\nup.OverlayFocus = class OverlayFocus {\n constructor(layer) {\n this._layer = layer;\n this._focusElement = this._layer.getFocusElement();\n }\n moveToFront() {\n if (this._enabled) {\n return;\n }\n this._enabled = true;\n this._untrapFocus = up.on('focusin', event => this._onFocus(event));\n this._unsetAttrs = e.setTemporaryAttrs(this._focusElement, {\n 'tabindex': '0',\n 'role': 'dialog',\n 'aria-modal': 'true'\n });\n this._focusTrapBefore = e.affix(this._focusElement, 'beforebegin', 'up-focus-trap[tabindex=0]');\n this._focusTrapAfter = e.affix(this._focusElement, 'afterend', 'up-focus-trap[tabindex=0]');\n }\n moveToBack() {\n this.teardown();\n }\n teardown() {\n if (!this._enabled) {\n return;\n }\n this._enabled = false;\n this._untrapFocus();\n this._unsetAttrs();\n this._focusTrapBefore.remove();\n this._focusTrapAfter.remove();\n }\n _onFocus(event) {\n const { target } = event;\n if (this._processingFocusEvent || up.layer.isWithinForeignOverlay(target)) {\n return;\n }\n this._processingFocusEvent = true;\n if (target === this._focusTrapBefore) {\n this._focusEnd();\n }\n else if ((target === this._focusTrapAfter) || !this._layer.contains(target)) {\n this._focusStart();\n }\n this._processingFocusEvent = false;\n }\n _focusStart(focusOptions) {\n up.focus(this._focusElement, focusOptions);\n }\n _focusEnd() {\n this._focusLastDescendant(this._layer.getBoxElement()) || this._focusStart();\n }\n _focusLastDescendant(element) {\n for (let child of u.reverse(element.children)) {\n if (up.viewport.tryFocus(child) || this._focusLastDescendant(child)) {\n return true;\n }\n }\n }\n};\n\n\n/***/ }),\n/* 65 */\n/***/ (() => {\n\nconst u = up.util;\nconst e = up.element;\nup.Params = class Params {\n constructor(raw) {\n this.clear();\n this.addAll(raw);\n }\n clear() {\n this.entries = [];\n }\n [u.copy.key]() {\n return new up.Params(this);\n }\n toObject() {\n const obj = {};\n for (let entry of this.entries) {\n const { name, value } = entry;\n if (!u.isBasicObjectProperty(name)) {\n if (this._isArrayKey(name)) {\n obj[name] ||= [];\n obj[name].push(value);\n }\n else {\n obj[name] = value;\n }\n }\n }\n return obj;\n }\n toArray() {\n return this.entries;\n }\n toFormData() {\n const formData = new FormData();\n for (let entry of this.entries) {\n formData.append(entry.name, entry.value);\n }\n if (!formData.entries) {\n formData.originalArray = this.entries;\n }\n return formData;\n }\n toQuery() {\n let parts = u.map(this.entries, this._arrayEntryToQuery.bind(this));\n parts = u.compact(parts);\n return parts.join('&');\n }\n _arrayEntryToQuery(entry) {\n const { value } = entry;\n if (this._isBinaryValue(value)) {\n return;\n }\n let query = encodeURIComponent(entry.name);\n if (u.isGiven(value)) {\n query += \"=\";\n query += encodeURIComponent(value);\n }\n return query;\n }\n _isBinaryValue(value) {\n return value instanceof Blob;\n }\n hasBinaryValues() {\n const values = u.map(this.entries, 'value');\n return u.some(values, this._isBinaryValue);\n }\n toURL(base) {\n let parts = [base, this.toQuery()];\n parts = u.filter(parts, u.isPresent);\n const separator = u.contains(base, '?') ? '&' : '?';\n return parts.join(separator);\n }\n add(name, value) {\n this.entries.push({ name, value });\n }\n addAll(raw) {\n if (u.isMissing(raw)) {\n }\n else if (raw instanceof this.constructor) {\n this.entries.push(...raw.entries);\n }\n else if (u.isArray(raw)) {\n this.entries.push(...raw);\n }\n else if (u.isString(raw)) {\n this._addAllFromQuery(raw);\n }\n else if (u.isFormData(raw)) {\n this._addAllFromFormData(raw);\n }\n else if (u.isObject(raw)) {\n this._addAllFromObject(raw);\n }\n else {\n up.fail(\"Unsupport params type: %o\", raw);\n }\n }\n _addAllFromObject(object) {\n for (let key in object) {\n const value = object[key];\n const valueElements = u.isArray(value) ? value : [value];\n for (let valueElement of valueElements) {\n this.add(key, valueElement);\n }\n }\n }\n _addAllFromQuery(query) {\n for (let part of query.split('&')) {\n if (part) {\n let [name, value] = part.split('=');\n name = decodeURIComponent(name);\n if (u.isGiven(value)) {\n value = decodeURIComponent(value);\n }\n else {\n value = null;\n }\n this.add(name, value);\n }\n }\n }\n _addAllFromFormData(formData) {\n for (let value of formData.entries()) {\n this.add(...value);\n }\n }\n set(name, value) {\n this.delete(name);\n this.add(name, value);\n }\n delete(name) {\n this.entries = u.reject(this.entries, this._matchEntryFn(name));\n }\n _matchEntryFn(name) {\n return entry => entry.name === name;\n }\n get(name) {\n if (this._isArrayKey(name)) {\n return this.getAll(name);\n }\n else {\n return this.getFirst(name);\n }\n }\n getFirst(name) {\n const entry = u.find(this.entries, this._matchEntryFn(name));\n return entry?.value;\n }\n getAll(name) {\n if (this._isArrayKey(name)) {\n return this.getAll(name);\n }\n else {\n const entries = u.map(this.entries, this._matchEntryFn(name));\n return u.map(entries, 'value');\n }\n }\n _isArrayKey(key) {\n return key.endsWith('[]');\n }\n [u.isBlank.key]() {\n return this.entries.length === 0;\n }\n static fromForm(form) {\n return this.fromContainer(form);\n }\n static fromContainer(container) {\n let fields = up.form.fields(container);\n return this.fromFields(fields);\n }\n static fromFields(fields) {\n const params = new (this)();\n for (let field of u.wrapList(fields)) {\n params.addField(field);\n }\n return params;\n }\n addField(field) {\n field = e.get(field);\n let name = field.name;\n if (name && !field.disabled) {\n const { tagName } = field;\n const { type } = field;\n if (tagName === 'SELECT') {\n for (let option of field.querySelectorAll('option')) {\n if (option.selected) {\n this.add(name, option.value);\n }\n }\n }\n else if ((type === 'checkbox') || (type === 'radio')) {\n if (field.checked) {\n this.add(name, field.value);\n }\n }\n else if (type === 'file') {\n for (let file of field.files) {\n this.add(name, file);\n }\n }\n else {\n return this.add(name, field.value);\n }\n }\n }\n [u.isEqual.key](other) {\n return (this.constructor === other.constructor) && u.isEqual(this.entries, other.entries);\n }\n static fromURL(url) {\n const params = new (this)();\n const urlParts = u.parseURL(url);\n let query = urlParts.search;\n if (query) {\n query = query.replace(/^\\?/, '');\n params.addAll(query);\n }\n return params;\n }\n static stripURL(url) {\n return u.normalizeURL(url, { search: false });\n }\n static merge(...objects) {\n return objects.reduce(function (allParams, params) {\n allParams.addAll(params);\n return allParams;\n }, new up.Params());\n }\n};\n\n\n/***/ }),\n/* 66 */\n/***/ (() => {\n\nconst e = up.element;\nconst TRANSITION_DELAY = 300;\nup.ProgressBar = class ProgressBar {\n constructor() {\n this._step = 0;\n this._element = e.affix(document.body, 'up-progress-bar');\n this._element.style.transition = `width ${TRANSITION_DELAY}ms ease-out`;\n this._moveTo(0);\n up.element.paint(this._element);\n this._width = 31;\n this._nextStep();\n }\n _nextStep() {\n let diff;\n if (this._width < 80) {\n if (Math.random() < 0.15) {\n diff = 7 + (5 * Math.random());\n }\n else {\n diff = 1.5 + (0.5 * Math.random());\n }\n }\n else {\n diff = 0.13 * (100 - this._width) * Math.random();\n }\n this._moveTo(this._width + diff);\n this._step++;\n const nextStepDelay = TRANSITION_DELAY + (this._step * 40);\n this.timeout = setTimeout(this._nextStep.bind(this), nextStepDelay);\n }\n _moveTo(width) {\n this._width = width;\n this._element.style.width = `${width}vw`;\n }\n destroy() {\n clearTimeout(this.timeout);\n this._element.remove();\n }\n conclude() {\n clearTimeout(this.timeout);\n this._moveTo(100);\n setTimeout(this.destroy.bind(this), TRANSITION_DELAY);\n }\n};\n\n\n/***/ }),\n/* 67 */\n/***/ (() => {\n\nconst u = up.util;\nup.RenderOptions = (function () {\n const GLOBAL_DEFAULTS = {\n useHungry: true,\n useKeep: true,\n saveScroll: true,\n saveFocus: true,\n focus: 'keep',\n abort: 'target',\n failOptions: true,\n };\n const PRELOAD_OVERRIDES = {\n abort: false,\n confirm: false,\n feedback: false,\n cache: true,\n background: true,\n };\n const PREFLIGHT_KEYS = [\n 'url',\n 'method',\n 'origin',\n 'headers',\n 'params',\n 'cache',\n 'fallback',\n 'abort',\n 'abortable',\n 'confirm',\n 'feedback',\n 'origin',\n 'originLayer',\n 'baseLayer',\n 'fail',\n 'onError',\n ];\n const SHARED_KEYS = PREFLIGHT_KEYS.concat([\n 'keep',\n 'hungry',\n 'history',\n 'source',\n 'saveScroll',\n 'navigate',\n 'baseLayer',\n ]);\n const CONTENT_KEYS = [\n 'url',\n 'response',\n 'content',\n 'fragment',\n 'document',\n ];\n const LATE_KEYS = [\n 'history',\n 'focus',\n 'scroll',\n ];\n function navigateDefaults(options) {\n if (options.navigate) {\n return up.fragment.config.navigateOptions;\n }\n }\n function normalizeURL({ url }) {\n if (url) {\n return { url: u.normalizeURL(url) };\n }\n }\n function preloadOverrides(options) {\n if (options.preload) {\n return PRELOAD_OVERRIDES;\n }\n }\n function preprocess(options) {\n up.migrate.preprocessRenderOptions?.(options);\n const defaults = u.merge(GLOBAL_DEFAULTS, navigateDefaults(options));\n return u.merge(u.omit(defaults, LATE_KEYS), { defaults }, { inputDevice: up.event.inputDevice }, options, normalizeURL(options), rememberOriginLayer(options), preloadOverrides(options));\n }\n function rememberOriginLayer({ origin, originLayer }) {\n if (origin && !originLayer) {\n return {\n originLayer: up.layer.get(origin),\n };\n }\n }\n function finalize(preprocessedOptions, lateDefaults) {\n return u.merge(preprocessedOptions.defaults, lateDefaults, preprocessedOptions);\n }\n function assertContentGiven(options) {\n if (!u.some(CONTENT_KEYS, contentKey => u.isGiven(options[contentKey]))) {\n if (options.defaultToEmptyContent) {\n options.content = '';\n }\n else {\n up.fail('up.render() needs either { ' + CONTENT_KEYS.join(', ') + ' } option');\n }\n }\n }\n function failOverrides(options) {\n const overrides = {};\n for (let key in options) {\n const value = options[key];\n let unprefixed = up.fragment.successKey(key);\n if (unprefixed) {\n overrides[unprefixed] = value;\n }\n }\n return overrides;\n }\n function deriveFailOptions(preprocessedOptions) {\n let overrides = failOverrides(preprocessedOptions);\n let layers = rememberOriginLayer(overrides);\n if (preprocessedOptions.failOptions) {\n return {\n ...preprocessedOptions.defaults,\n ...u.pick(preprocessedOptions, SHARED_KEYS),\n ...overrides,\n ...layers,\n ...{ failPrefixForced: true }\n };\n }\n else {\n return {\n ...preprocessedOptions,\n ...overrides,\n ...layers,\n };\n }\n }\n return {\n preprocess,\n finalize,\n assertContentGiven,\n deriveFailOptions,\n lookupLayers: rememberOriginLayer,\n };\n})();\n\n\n/***/ }),\n/* 68 */\n/***/ (() => {\n\nup.RenderResult = class RenderResult extends up.Record {\n keys() {\n return [\n 'fragments',\n 'layer',\n 'target',\n 'options',\n 'finished',\n ];\n }\n defaults() {\n return {\n fragments: [],\n };\n }\n get none() {\n return !this.fragments.length;\n }\n get fragment() {\n return this.fragments[0];\n }\n static both(main, extension, mergeFinished = true) {\n if (!extension)\n return main;\n return new this({\n target: main.target,\n layer: main.layer,\n options: main.options,\n fragments: main.fragments.concat(extension.fragments),\n finished: (mergeFinished && this.mergeFinished(main, extension))\n });\n }\n static async mergeFinished(main, extension) {\n return this.both(await main.finished, await extension.finished, false);\n }\n static buildNone() {\n return new this({\n target: ':none',\n finished: Promise.resolve(),\n });\n }\n};\n\n\n/***/ }),\n/* 69 */\n/***/ (() => {\n\nvar _a;\nconst u = up.util;\nup.Request = (_a = class Request extends up.Record {\n keys() {\n return [\n 'method',\n 'url',\n 'hash',\n 'params',\n 'target',\n 'failTarget',\n 'headers',\n 'timeout',\n 'background',\n 'cache',\n 'expireCache',\n 'evictCache',\n 'layer',\n 'mode',\n 'context',\n 'failLayer',\n 'failMode',\n 'failContext',\n 'origin',\n 'fragments',\n 'builtAt',\n 'wrapMethod',\n 'contentType',\n 'payload',\n 'onLoading',\n 'fail',\n 'abortable',\n 'badResponseTime',\n ];\n }\n defaults() {\n return {\n state: 'new',\n abortable: true,\n headers: {},\n timeout: up.network.config.timeout,\n builtAt: new Date(),\n };\n }\n constructor(options) {\n super(options);\n this.params = new up.Params(this.params);\n if (this.wrapMethod == null) {\n this.wrapMethod = up.network.config.wrapMethod;\n }\n this._normalize();\n if ((this.target || this.layer || this.origin) && !options.basic) {\n const layerLookupOptions = { origin: this.origin };\n this.layer = up.layer.get(this.layer, layerLookupOptions);\n this.failLayer = up.layer.get(this.failLayer, layerLookupOptions);\n this.context ||= this.layer.context || {};\n this.failContext ||= this.failLayer?.context || {};\n this.mode ||= this.layer.mode;\n this.failMode ||= this.failLayer?.mode;\n }\n this.deferred = u.newDeferred();\n this.badResponseTime ??= u.evalOption(up.network.config.badResponseTime, this);\n this._setAutoHeaders();\n }\n get xhr() {\n return this._xhr ??= new XMLHttpRequest();\n }\n get fragments() {\n if (this._fragments) {\n return this._fragments;\n }\n else {\n let steps = up.fragment.parseTargetSteps(this.target);\n let selectors = u.map(steps, 'selector');\n let lookupOpts = { origin: this.origin, layer: this.layer };\n return u.compact(u.map(selectors, (selector) => up.fragment.get(selector, lookupOpts)));\n }\n }\n set fragments(value) {\n this._fragments = value;\n }\n get fragment() {\n return this.fragments?.[0];\n }\n _normalize() {\n this.method = u.normalizeMethod(this.method);\n this._extractHashFromURL();\n this._transferParamsToURL();\n this.url = u.normalizeURL(this.url);\n }\n _evictExpensiveAttrs() {\n u.task(() => {\n this.layer = undefined;\n this.failLayer = undefined;\n this.origin = undefined;\n this.fragments = undefined;\n });\n }\n _extractHashFromURL() {\n let match = this.url?.match(/^([^#]*)(#.+)$/);\n if (match) {\n this.url = match[1];\n return this.hash = match[2];\n }\n }\n _transferParamsToURL() {\n if (!this.url || this.allowsPayload() || u.isBlank(this.params)) {\n return;\n }\n this.url = this.params.toURL(this.url);\n this.params.clear();\n }\n isSafe() {\n return up.network.isSafeMethod(this.method);\n }\n allowsPayload() {\n return u.methodAllowsPayload(this.method);\n }\n will302RedirectWithGET() {\n return this.isSafe() || (this.method === 'POST');\n }\n willCache() {\n return u.evalAutoOption(this.cache, up.network.config.autoCache, this);\n }\n runQueuedCallbacks() {\n u.always(this, () => this._evictExpensiveAttrs());\n }\n load() {\n if (this.state !== 'new')\n return;\n if (this._emitLoad()) {\n this.state = 'loading';\n this._normalize();\n this.onLoading?.();\n this.expired = false;\n new up.Request.XHRRenderer(this).buildAndSend({\n onload: () => this._onXHRLoad(),\n onerror: () => this._onXHRError(),\n ontimeout: () => this._onXHRTimeout(),\n onabort: () => this._onXHRAbort()\n });\n return true;\n }\n else {\n this.abort({ reason: 'Prevented by event listener' });\n }\n }\n _emitLoad() {\n let event = this.emit('up:request:load', { log: ['Loading %s', this.description] });\n return !event.defaultPrevented;\n }\n loadPage() {\n up.network.abort();\n new up.Request.FormRenderer(this).buildAndSubmit();\n }\n _onXHRLoad() {\n const response = this._extractResponseFromXHR();\n const log = 'Loaded ' + response.description;\n this.emit('up:request:loaded', { request: response.request, response, log });\n this.respondWith(response);\n }\n _onXHRError() {\n this._setOfflineState('Network error');\n }\n _onXHRTimeout() {\n this._setOfflineState('Timeout');\n }\n _onXHRAbort() {\n this._setAbortedState();\n }\n abort({ reason } = {}) {\n if (this._setAbortedState(reason) && this._xhr) {\n this._xhr.abort();\n }\n }\n _setAbortedState(reason) {\n if (this._isSettled())\n return;\n let message = 'Aborted request to ' + this.description + (reason ? ': ' + reason : '');\n this.state = 'aborted';\n this.deferred.reject(new up.Aborted(message));\n this.emit('up:request:aborted', { log: message });\n return true;\n }\n _setOfflineState(reason) {\n if (this._isSettled())\n return;\n let message = 'Cannot load request to ' + this.description + (reason ? ': ' + reason : '');\n this.state = 'offline';\n this.emit('up:request:offline', { log: message });\n this.deferred.reject(new up.Offline(message));\n }\n respondWith(response) {\n this.response = response;\n if (this._isSettled())\n return;\n this.state = 'loaded';\n if (response.ok) {\n this.deferred.resolve(response);\n }\n else {\n this.deferred.reject(response);\n }\n }\n _isSettled() {\n return (this.state !== 'new') && (this.state !== 'loading') && (this.state !== 'tracking');\n }\n csrfHeader() {\n return up.protocol.csrfHeader();\n }\n csrfParam() {\n return up.protocol.csrfParam();\n }\n csrfToken() {\n if (!this.isSafe() && !this.isCrossOrigin()) {\n return up.protocol.csrfToken();\n }\n }\n isCrossOrigin() {\n return u.isCrossOrigin(this.url);\n }\n _extractResponseFromXHR() {\n const responseAttrs = {\n method: this.method,\n url: this.url,\n request: this,\n xhr: this.xhr,\n text: this.xhr.responseText,\n status: this.xhr.status,\n title: up.protocol.titleFromXHR(this.xhr),\n target: up.protocol.targetFromXHR(this.xhr),\n acceptLayer: up.protocol.acceptLayerFromXHR(this.xhr),\n dismissLayer: up.protocol.dismissLayerFromXHR(this.xhr),\n eventPlans: up.protocol.eventPlansFromXHR(this.xhr),\n context: up.protocol.contextFromXHR(this.xhr),\n expireCache: up.protocol.expireCacheFromXHR(this.xhr),\n evictCache: up.protocol.evictCacheFromXHR(this.xhr),\n fail: this.fail,\n };\n let methodFromResponse = up.protocol.methodFromXHR(this.xhr);\n let urlFromResponse = up.protocol.locationFromXHR(this.xhr);\n if (urlFromResponse) {\n if (!u.matchURLs(this.url, urlFromResponse)) {\n methodFromResponse ||= 'GET';\n }\n responseAttrs.url = urlFromResponse;\n }\n if (methodFromResponse) {\n responseAttrs.method = methodFromResponse;\n }\n return new up.Response(responseAttrs);\n }\n _buildEventEmitter(args) {\n return up.EventEmitter.fromEmitArgs(args, {\n layer: this.layer,\n request: this,\n origin: this.origin\n });\n }\n emit(...args) {\n return this._buildEventEmitter(args).emit();\n }\n assertEmitted(...args) {\n this._buildEventEmitter(args).assertEmitted();\n }\n get description() {\n return this.method + ' ' + this.url;\n }\n isPartOfSubtree(subtreeElements) {\n subtreeElements = u.wrapList(subtreeElements);\n return u.some(this.fragments, function (fragment) {\n return u.some(subtreeElements, (subtreeElement) => subtreeElement.contains(fragment));\n });\n }\n get age() {\n return new Date() - this.builtAt;\n }\n header(name) {\n return this.headers[name];\n }\n _setAutoHeaders() {\n for (let key of ['target', 'failTarget', 'mode', 'failMode', 'context', 'failContext']) {\n this._setPropertyHeader(key);\n }\n let csrfHeader, csrfToken;\n if ((csrfHeader = this.csrfHeader()) && (csrfToken = this.csrfToken())) {\n this._setAutoHeader(csrfHeader, csrfToken);\n }\n this._setAutoHeader(up.protocol.headerize('version'), up.version);\n }\n _setPropertyHeader(key) {\n this._setAutoHeader(up.protocol.headerize(key), this[key]);\n }\n _setAutoHeader(name, value) {\n if (u.isMissing(value)) {\n return;\n }\n if (u.isOptions(value) || u.isArray(value)) {\n value = u.safeStringifyJSON(value);\n }\n this.headers[name] = value;\n }\n mergeIfUnsent(trackingRequest) {\n if (this.state !== 'new')\n return;\n if (!this.target || !trackingRequest.target)\n return;\n let targetAtoms = up.fragment.splitTarget(this.target + ',' + trackingRequest.target);\n this.target = u.uniq(targetAtoms).join(', ');\n this._setPropertyHeader('target');\n this._fragments = u.uniq([...this.fragments, ...trackingRequest.fragments]);\n }\n static tester(condition, { except } = {}) {\n let testFn;\n if (u.isFunction(condition)) {\n testFn = condition;\n }\n else if (condition instanceof this) {\n testFn = (request) => condition === request;\n }\n else if (u.isString(condition)) {\n let pattern = new up.URLPattern(condition);\n testFn = (request) => pattern.test(request.url);\n }\n else {\n testFn = (_request) => condition;\n }\n if (except) {\n return (request) => !up.cache.willHaveSameResponse(request, except) && testFn(request);\n }\n else {\n return testFn;\n }\n }\n },\n (() => {\n u.delegate(_a.prototype, ['then', 'catch', 'finally'], function () { return this.deferred; });\n })(),\n _a);\n\n\n/***/ }),\n/* 70 */\n/***/ (() => {\n\nconst u = up.util;\nclass Route {\n constructor() {\n this.varyHeaders = new Set();\n this.requests = [];\n }\n matchBest(newRequest) {\n let matches = this.requests.filter((cachedRequest) => this.satisfies(cachedRequest, newRequest));\n return u.last(matches);\n }\n delete(request) {\n u.remove(this.requests, request);\n }\n put(request) {\n this.requests.push(request);\n }\n updateVary(response) {\n for (let headerName of response.varyHeaderNames) {\n this.varyHeaders.add(headerName);\n }\n }\n satisfies(cachedRequest, newRequest) {\n if (cachedRequest === newRequest)\n return true;\n return u.every(this.varyHeaders, (varyHeader) => {\n let cachedValue = cachedRequest.header(varyHeader);\n let newValue = newRequest.header(varyHeader);\n if (varyHeader === 'X-Up-Target' || varyHeader === 'X-Up-Fail-Target') {\n if (!cachedValue)\n return true;\n if (!newValue)\n return false;\n let cachedTokens = u.parseTokens(cachedValue, { separator: 'comma' });\n let newTokens = u.parseTokens(newValue, { separator: 'comma' });\n return u.containsAll(cachedTokens, newTokens);\n }\n else {\n return cachedValue === newValue;\n }\n });\n }\n}\nup.Request.Cache = class Cache {\n constructor() {\n this.reset();\n }\n reset() {\n this._routes = {};\n this._requests = [];\n }\n get(request) {\n request = this._wrap(request);\n let route = this._getRoute(request);\n let cachedRequest = route.matchBest(request);\n if (cachedRequest) {\n if (this._isUsable(cachedRequest)) {\n return cachedRequest;\n }\n else {\n this._delete(request, route);\n }\n }\n }\n async put(request) {\n request = this._wrap(request);\n let route = this._getRoute(request);\n let { response } = request;\n if (response)\n route.updateVary(response);\n let superseded = route.requests.filter((oldRequest) => route.satisfies(request, oldRequest));\n for (let r of superseded) {\n this._delete(r);\n }\n request.cacheRoute = route;\n route.put(request);\n this._requests.push(request);\n this._limitSize();\n }\n alias(existingCachedRequest, newRequest) {\n existingCachedRequest = this.get(existingCachedRequest);\n if (!existingCachedRequest)\n return;\n newRequest = this._wrap(newRequest);\n this.track(existingCachedRequest, newRequest, { force: true });\n this.put(newRequest);\n return newRequest;\n }\n async track(existingRequest, newRequest, options = {}) {\n newRequest.trackedRequest = existingRequest;\n newRequest.state = 'tracking';\n let value = await u.always(existingRequest);\n if (value instanceof up.Response) {\n if (options.force || existingRequest.cacheRoute.satisfies(existingRequest, newRequest)) {\n newRequest.fromCache = true;\n value = u.variant(value, { request: newRequest });\n newRequest.respondWith(value);\n u.delegate(newRequest, ['expired', 'state'], () => existingRequest);\n }\n else {\n delete newRequest.trackedRequest;\n newRequest.state = 'new';\n options.onIncompatible?.(newRequest);\n }\n }\n else {\n newRequest.state = existingRequest.state;\n newRequest.deferred.reject(value);\n }\n }\n willHaveSameResponse(existingRequest, newRequest) {\n return existingRequest === newRequest || existingRequest === newRequest.trackedRequest;\n }\n evict(condition = true, testerOptions) {\n this._eachMatch(condition, testerOptions, (request) => this._delete(request));\n }\n expire(condition = true, testerOptions) {\n this._eachMatch(condition, testerOptions, (request) => request.expired = true);\n }\n reindex(request) {\n this._delete(request);\n this.put(request);\n }\n _delete(request) {\n u.remove(this._requests, request);\n request.cacheRoute?.delete(request);\n delete request.cacheRoute;\n }\n _getRoute(request) {\n return request.cacheRoute || (this._routes[request.description] ||= new Route());\n }\n _isUsable(request) {\n return request.age < up.network.config.cacheEvictAge;\n }\n get _size() {\n return this._requests.length;\n }\n get _capacity() {\n return up.network.config.cacheSize;\n }\n _limitSize() {\n for (let i = 0; i < (this._size - this._capacity); i++) {\n this._delete(this._requests[0]);\n }\n }\n _eachMatch(condition = true, testerOptions, fn) {\n let tester = up.Request.tester(condition, testerOptions);\n let results = u.filter(this._requests, tester);\n u.each(results, fn);\n }\n _wrap(requestOrOptions) {\n return u.wrapValue(up.Request, requestOrOptions);\n }\n};\n\n\n/***/ }),\n/* 71 */\n/***/ (() => {\n\nconst u = up.util;\nup.Request.Queue = class Queue {\n constructor() {\n this.reset();\n }\n reset() {\n this._queuedRequests = [];\n this._currentRequests = [];\n this._emittedLate = false;\n }\n get allRequests() {\n return this._currentRequests.concat(this._queuedRequests);\n }\n asap(request) {\n request.runQueuedCallbacks();\n u.always(request, responseOrError => this._onRequestSettled(request, responseOrError));\n this._scheduleSlowTimer(request);\n this._queueRequest(request);\n queueMicrotask(() => this._poke());\n }\n promoteToForeground(request) {\n if (request.background) {\n request.background = false;\n this._scheduleSlowTimer(request);\n }\n }\n _scheduleSlowTimer(request) {\n let timeUntilLate = Math.max(request.badResponseTime - request.age, 0);\n u.timer(timeUntilLate, () => this._checkLate());\n }\n _getMaxConcurrency() {\n return u.evalOption(up.network.config.concurrency);\n }\n _hasConcurrencyLeft() {\n const maxConcurrency = this._getMaxConcurrency();\n return (maxConcurrency === -1) || (this._currentRequests.length < maxConcurrency);\n }\n isBusy() {\n return this._currentRequests.length > 0 || this._queuedRequests.length > 0;\n }\n _queueRequest(request) {\n this._queuedRequests.push(request);\n }\n _pluckNextRequest() {\n let request = u.find(this._queuedRequests, request => !request.background);\n request ||= this._queuedRequests[0];\n return u.remove(this._queuedRequests, request);\n }\n _sendRequestNow(request) {\n if (request.load()) {\n this._currentRequests.push(request);\n }\n }\n _onRequestSettled(request, responseOrError) {\n u.remove(this._currentRequests, request) || u.remove(this._queuedRequests, request);\n if ((responseOrError instanceof up.Response) && responseOrError.ok) {\n up.network.registerAliasForRedirect(request, responseOrError);\n }\n this._checkLate();\n queueMicrotask(() => this._poke());\n }\n _poke() {\n let request;\n if (this._hasConcurrencyLeft() && (request = this._pluckNextRequest())) {\n return this._sendRequestNow(request);\n }\n }\n abort(...args) {\n let options = u.extractOptions(args);\n let { except, reason, logOnce } = options;\n let conditions = args[0] ?? true;\n let tester = up.Request.tester(conditions, { except });\n for (let list of [this._currentRequests, this._queuedRequests]) {\n const abortableRequests = u.filter(list, tester);\n for (let abortableRequest of abortableRequests) {\n if (logOnce) {\n up.puts(...logOnce);\n logOnce = null;\n }\n abortableRequest.abort({ reason });\n u.remove(list, abortableRequest);\n }\n }\n }\n _checkLate() {\n const currentLate = this._isLate();\n if (this._emittedLate !== currentLate) {\n this._emittedLate = currentLate;\n if (currentLate) {\n up.emit('up:network:late', { log: 'Server is slow to respond' });\n }\n else {\n up.emit('up:network:recover', { log: 'Slow requests were loaded' });\n }\n }\n }\n _isLate() {\n const allForegroundRequests = u.reject(this.allRequests, 'background');\n const timerTolerance = 1;\n return u.some(allForegroundRequests, (request) => request.age >= (request.badResponseTime - timerTolerance));\n }\n};\n\n\n/***/ }),\n/* 72 */\n/***/ (() => {\n\nconst u = up.util;\nconst e = up.element;\nconst HTML_FORM_METHODS = ['GET', 'POST'];\nup.Request.FormRenderer = class FormRenderer {\n constructor(request) {\n this._request = request;\n }\n buildAndSubmit() {\n this.params = u.copy(this._request.params);\n let action = this._request.url;\n let { method } = this._request;\n const paramsFromQuery = up.Params.fromURL(action);\n this.params.addAll(paramsFromQuery);\n action = up.Params.stripURL(action);\n if (!u.contains(HTML_FORM_METHODS, method)) {\n method = up.protocol.wrapMethod(method, this.params);\n }\n this._form = e.affix(document.body, 'form.up-request-loader', { method, action });\n let contentType = this._request.contentType;\n if (contentType) {\n this._form.setAttribute('enctype', contentType);\n }\n let csrfParam, csrfToken;\n if ((csrfParam = this._request.csrfParam()) && (csrfToken = this._request.csrfToken())) {\n this.params.add(csrfParam, csrfToken);\n }\n u.each(this.params.toArray(), this._addField.bind(this));\n up.browser.submitForm(this._form);\n }\n _addField(attrs) {\n e.affix(this._form, 'input[type=hidden]', attrs);\n }\n};\n\n\n/***/ }),\n/* 73 */\n/***/ (() => {\n\nvar _a;\nconst CONTENT_TYPE_URL_ENCODED = 'application/x-www-form-urlencoded';\nconst CONTENT_TYPE_FORM_DATA = 'multipart/form-data';\nconst u = up.util;\nup.Request.XHRRenderer = (_a = class XHRRenderer {\n constructor(request) {\n this._request = request;\n }\n buildAndSend(handlers) {\n const xhr = this._request.xhr;\n this._params = u.copy(this._request.params);\n if (this._request.timeout) {\n xhr.timeout = this._request.timeout;\n }\n xhr.open(this._getMethod(), this._request.url);\n let contentType = this._getContentType();\n if (contentType) {\n xhr.setRequestHeader('Content-Type', contentType);\n }\n for (let headerName in this._request.headers) {\n let headerValue = this._request.headers[headerName];\n xhr.setRequestHeader(headerName, headerValue);\n }\n Object.assign(xhr, handlers);\n xhr.send(this._getPayload());\n }\n _getMethod() {\n let method = this._request.method;\n if (this._request.wrapMethod && !this._request.will302RedirectWithGET()) {\n method = up.protocol.wrapMethod(method, this._params);\n }\n return method;\n }\n _getContentType() {\n this._finalizePayload();\n return this._contentType;\n }\n _getPayload() {\n this._finalizePayload();\n return this._payload;\n }\n _finalizePayload() {\n this._payload = this._request.payload;\n this._contentType = this._request.contentType;\n if (!this._payload && this._request.allowsPayload()) {\n if (!this._contentType) {\n this._contentType = this._params.hasBinaryValues() ? CONTENT_TYPE_FORM_DATA : CONTENT_TYPE_URL_ENCODED;\n }\n if (this._contentType === CONTENT_TYPE_FORM_DATA) {\n this._contentType = null;\n this._payload = this._params.toFormData();\n }\n else {\n this._payload = this._params.toQuery().replace(/%20/g, '+');\n }\n }\n }\n },\n (() => {\n u.memoizeMethod(_a.prototype, {\n _finalizePayload: true,\n _getMethod: true,\n });\n })(),\n _a);\n\n\n/***/ }),\n/* 74 */\n/***/ (() => {\n\nconst u = up.util;\nup.Response = class Response extends up.Record {\n keys() {\n return [\n 'method',\n 'url',\n 'text',\n 'status',\n 'request',\n 'xhr',\n 'target',\n 'title',\n 'acceptLayer',\n 'dismissLayer',\n 'eventPlans',\n 'context',\n 'expireCache',\n 'evictCache',\n 'headers',\n 'loadedAt',\n 'fail',\n ];\n }\n defaults() {\n return {\n headers: {},\n loadedAt: new Date()\n };\n }\n get ok() {\n return !u.evalOption(this.fail ?? up.network.config.fail, this);\n }\n get none() {\n return !this.text;\n }\n header(name) {\n return this.headers[name] || this.xhr?.getResponseHeader(name);\n }\n get varyHeaderNames() {\n let varyHeaderValue = this.header('Vary');\n return u.parseTokens(varyHeaderValue, { separator: 'comma' });\n }\n get contentType() {\n return this.header('Content-Type');\n }\n get cspNonces() {\n return up.protocol.cspNoncesFromHeader(this.header('Content-Security-Policy') || this.header('Content-Security-Policy-Report-Only'));\n }\n get lastModified() {\n let header = this.header('Last-Modified');\n if (header) {\n return new Date(header);\n }\n }\n get etag() {\n return this.header('ETag');\n }\n get json() {\n return this.parsedJSON ||= JSON.parse(this.text);\n }\n get age() {\n let now = new Date();\n return now - this.loadedAt;\n }\n get expired() {\n return this.age > up.network.config.cacheExpireAge ||\n this.request.expired;\n }\n get description() {\n return `HTTP ${this.status} response to ${this.request.description}`;\n }\n};\n\n\n/***/ }),\n/* 75 */\n/***/ (() => {\n\nvar _a;\nconst u = up.util;\nconst e = up.element;\nconst FULL_DOCUMENT_PATTERN = /^\\s*<(html|!DOCTYPE)\\b/i;\nup.ResponseDoc = (_a = class ResponseDoc {\n constructor({ document, fragment, content, target, origin, cspNonces, match }) {\n if (document) {\n this._parseDocument(document);\n }\n else if (fragment) {\n this._parseFragment(fragment);\n }\n else {\n this._parseContent(content || '', target);\n }\n this._cspNonces = cspNonces;\n if (origin) {\n let originSelector = up.fragment.tryToTarget(origin);\n if (originSelector) {\n this._rediscoveredOrigin = this.select(originSelector);\n }\n }\n this._match = match;\n }\n _parseDocument(value) {\n if (value instanceof Document) {\n this._document = value;\n this._isFullDocument = true;\n }\n else if (u.isString(value)) {\n this._document = e.createBrokenDocumentFromHTML(value);\n this._isFullDocument = FULL_DOCUMENT_PATTERN.test(value);\n this._isDocumentBroken = true;\n }\n else {\n this._document = this._buildFauxDocument(value);\n this._isFullDocument = value.matches('html');\n }\n }\n _parseFragment(value) {\n let parsed = u.isString(value) ? e.createFromHTML(value) : value;\n this._document = this._buildFauxDocument(parsed);\n }\n _parseContent(value, target) {\n if (!target)\n up.fail(\"must pass a { target } when passing { content }\");\n let simplifiedTarget = u.map(up.fragment.parseTargetSteps(target), 'selector').join();\n const matchingElement = e.createFromSelector(simplifiedTarget);\n if (u.isString(value)) {\n matchingElement.innerHTML = value;\n }\n else {\n matchingElement.appendChild(value);\n }\n this._document = this._buildFauxDocument(matchingElement);\n }\n _buildFauxDocument(node) {\n let fauxDocument = document.createElement('up-document');\n fauxDocument.append(node);\n fauxDocument.documentElement = node;\n return fauxDocument;\n }\n rootSelector() {\n return up.fragment.toTarget(this._document.documentElement);\n }\n get title() {\n return this._fromHead(this._getTitleText);\n }\n _getHead() {\n if (this._isFullDocument) {\n return this._document.head;\n }\n }\n _fromHead(fn) {\n let head = this._getHead();\n return head && fn(head);\n }\n get metaTags() {\n return this._fromHead(up.history.findMetaTags);\n }\n get assets() {\n return this._fromHead(up.script.findAssets);\n }\n get lang() {\n if (this._isFullDocument) {\n return up.history.getLang(this._document);\n }\n }\n _getTitleText(head) {\n return head.querySelector('title')?.textContent;\n }\n select(selector) {\n let finder = new up.FragmentFinder({\n selector: selector,\n origin: this._rediscoveredOrigin,\n document: this._document,\n match: this._match,\n });\n return finder.find();\n }\n selectSteps(steps) {\n return steps.filter((step) => {\n return this._trySelectStep(step) || this._cannotMatchStep(step);\n });\n }\n commitSteps(steps) {\n return steps.filter((step) => this.commitElement(step.newElement));\n }\n _trySelectStep(step) {\n if (step.newElement) {\n return true;\n }\n let newElement = this.select(step.selector);\n if (!newElement) {\n return;\n }\n let { selectEvent } = step;\n if (selectEvent) {\n selectEvent.newFragment = newElement;\n selectEvent.renderOptions = step.originalRenderOptions;\n up.emit(step.oldElement, selectEvent, { callback: step.selectCallback });\n if (selectEvent.defaultPrevented) {\n return;\n }\n }\n step.newElement = newElement;\n return true;\n }\n _cannotMatchStep(step) {\n if (!step.maybe) {\n throw new up.CannotMatch();\n }\n }\n commitElement(element) {\n if (this._document.contains(element)) {\n if (!up.fragment.config.runScripts) {\n up.script.disableSubtree(element);\n }\n element.remove();\n return true;\n }\n }\n finalizeElement(element) {\n up.NonceableCallback.adoptNonces(element, this._cspNonces);\n if (this._isDocumentBroken) {\n let brokenElements = e.subtree(element, ':is(noscript,script,audio,video):not(.up-keeping, .up-keeping *)');\n u.each(brokenElements, e.fixParserDamage);\n }\n }\n },\n (() => {\n u.memoizeMethod(_a.prototype, {\n _getHead: true,\n });\n })(),\n _a);\n\n\n/***/ }),\n/* 76 */\n/***/ (() => {\n\nconst e = up.element;\nconst u = up.util;\nup.RevealMotion = class RevealMotion {\n constructor(element, options = {}) {\n this._element = element;\n this._viewport = e.get(options.viewport) || up.viewport.get(this._element);\n this._obstructionsLayer = up.layer.get(this._viewport);\n this._behavior = options.scrollBehavior ?? options.behavior ?? 'instant';\n const viewportConfig = up.viewport.config;\n this._snap = options.snap ?? options.revealSnap ?? viewportConfig.revealSnap;\n this._padding = options.padding ?? options.revealPadding ?? viewportConfig.revealPadding;\n this._top = options.top ?? options.revealTop ?? viewportConfig.revealTop;\n this._max = options.max ?? options.revealMax ?? viewportConfig.revealMax;\n this._topObstructionSelector = viewportConfig.selector('fixedTopSelectors');\n this._bottomObstructionSelector = viewportConfig.selector('fixedBottomSelectors');\n }\n start() {\n const viewportRect = this._getViewportRect(this._viewport);\n const elementRect = up.Rect.fromElement(this._element);\n if (this._max) {\n const maxPixels = u.evalOption(this._max, this._element);\n elementRect.height = Math.min(elementRect.height, maxPixels);\n }\n elementRect.grow(this._padding);\n this._substractObstructions(viewportRect);\n if (viewportRect.height < 0) {\n up.fail('Viewport has no visible area');\n }\n const originalScrollTop = this._viewport.scrollTop;\n let newScrollTop = originalScrollTop;\n if (this._top || (elementRect.height > viewportRect.height)) {\n const diff = elementRect.top - viewportRect.top;\n newScrollTop += diff;\n }\n else if (elementRect.top < viewportRect.top) {\n newScrollTop -= (viewportRect.top - elementRect.top);\n }\n else if (elementRect.bottom > viewportRect.bottom) {\n newScrollTop += (elementRect.bottom - viewportRect.bottom);\n }\n else {\n }\n if (u.isNumber(this._snap) && (newScrollTop < this._snap) && (elementRect.top < (0.5 * viewportRect.height))) {\n newScrollTop = 0;\n }\n if (newScrollTop !== originalScrollTop) {\n this._viewport.scrollTo({ top: newScrollTop, behavior: this._behavior });\n }\n }\n _getViewportRect() {\n if (up.viewport.isRoot(this._viewport)) {\n return new up.Rect({\n left: 0,\n top: 0,\n width: up.viewport.rootWidth(),\n height: up.viewport.rootHeight()\n });\n }\n else {\n return up.Rect.fromElement(this._viewport);\n }\n }\n _selectObstructions(selector) {\n let elements = up.fragment.all(selector, { layer: this._obstructionsLayer });\n return u.filter(elements, e.isVisible);\n }\n _substractObstructions(viewportRect) {\n for (let obstruction of this._selectObstructions(this._topObstructionSelector)) {\n let obstructionRect = up.Rect.fromElement(obstruction);\n let diff = obstructionRect.bottom - viewportRect.top;\n if (diff > 0) {\n viewportRect.top += diff;\n viewportRect.height -= diff;\n }\n }\n for (let obstruction of this._selectObstructions(this._bottomObstructionSelector)) {\n let obstructionRect = up.Rect.fromElement(obstruction);\n let diff = viewportRect.bottom - obstructionRect.top;\n if (diff > 0) {\n viewportRect.height -= diff;\n }\n }\n }\n};\n\n\n/***/ }),\n/* 77 */\n/***/ (() => {\n\nconst u = up.util;\nconst CSS_HAS_SUFFIX_PATTERN = /:has\\(([^)]+)\\)$/;\nup.Selector = class Selector {\n constructor(selector, elementOrDocument, options = {}) {\n this._filters = [];\n if (!options.destroying) {\n this._filters.push(up.fragment.isNotDestroying);\n }\n let matchingInExternalDocument = elementOrDocument && !document.contains(elementOrDocument);\n let expandTargetLayer;\n if (matchingInExternalDocument || options.layer === 'any') {\n expandTargetLayer = up.layer.root;\n }\n else {\n options.layer ??= u.presence(elementOrDocument, u.isElement);\n this._layers = up.layer.getAll(options);\n if (!this._layers.length)\n throw new up.CannotMatch([\"Unknown layer: %o\", options.layer]);\n this._filters.push(match => u.some(this._layers, layer => layer.contains(match)));\n expandTargetLayer = this._layers[0];\n }\n let expandedTargets = up.fragment.expandTargets(selector, { ...options, layer: expandTargetLayer });\n this._selectors = expandedTargets.map((target) => {\n if (!up.browser.canHasSelector()) {\n target = target.replace(CSS_HAS_SUFFIX_PATTERN, (match, descendantSelector) => {\n this._filters.push(element => element.querySelector(descendantSelector));\n return '';\n });\n }\n return target || '*';\n });\n this._unionSelector = this._selectors.join() || 'match-none';\n }\n matches(element) {\n return element.matches(this._unionSelector) && this._passesFilter(element);\n }\n closest(element) {\n let parentElement;\n if (this.matches(element)) {\n return element;\n }\n else if (parentElement = element.parentElement) {\n return this.closest(parentElement);\n }\n }\n _passesFilter(element) {\n return u.every(this._filters, filter => filter(element));\n }\n descendants(root = document) {\n const results = u.flatMap(this._selectors, selector => root.querySelectorAll(selector));\n return u.filter(results, element => this._passesFilter(element));\n }\n subtree(root) {\n const results = [];\n if (!(root instanceof Document) && this.matches(root)) {\n results.push(root);\n }\n results.push(...this.descendants(root));\n return results;\n }\n};\n\n\n/***/ }),\n/* 78 */\n/***/ (() => {\n\nconst u = up.util;\nconst e = up.element;\nup.Tether = class Tether {\n constructor(options) {\n up.migrate.handleTetherOptions?.(options);\n this._anchor = options.anchor;\n this._align = options.align;\n this._position = options.position;\n this._alignAxis = (this._position === 'top') || (this._position === 'bottom') ? 'horizontal' : 'vertical';\n this._viewport = up.viewport.get(this._anchor);\n this.parent = this._viewport === e.root ? document.body : this._viewport;\n this._syncOnScroll = !this._viewport.contains(this._anchor.offsetParent);\n }\n start(element) {\n this._element = element;\n this._element.style.position = 'absolute';\n this._setOffset(0, 0);\n this.sync();\n this._changeEventSubscription('on');\n }\n stop() {\n this._changeEventSubscription('off');\n }\n _changeEventSubscription(fn) {\n let doScheduleSync = this._scheduleSync.bind(this);\n up[fn](window, 'resize', doScheduleSync);\n if (this._syncOnScroll) {\n up[fn](this._viewport, 'scroll', doScheduleSync);\n }\n }\n _scheduleSync() {\n clearTimeout(this.syncTimer);\n return this.syncTimer = u.task(this.sync.bind(this));\n }\n isDetached() {\n return !this.parent.isConnected || !this._anchor.isConnected;\n }\n sync() {\n const elementBox = this._element.getBoundingClientRect();\n const elementMargin = {\n top: e.styleNumber(this._element, 'margin-top'),\n right: e.styleNumber(this._element, 'margin-right'),\n bottom: e.styleNumber(this._element, 'margin-bottom'),\n left: e.styleNumber(this._element, 'margin-left')\n };\n const anchorBox = this._anchor.getBoundingClientRect();\n let left;\n let top;\n switch (this._alignAxis) {\n case 'horizontal': {\n switch (this._position) {\n case 'top':\n top = anchorBox.top - elementMargin.bottom - elementBox.height;\n break;\n case 'bottom':\n top = anchorBox.top + anchorBox.height + elementMargin.top;\n break;\n }\n switch (this._align) {\n case 'left':\n left = anchorBox.left + elementMargin.left;\n break;\n case 'center':\n left = anchorBox.left + (0.5 * (anchorBox.width - elementBox.width));\n break;\n case 'right':\n left = (anchorBox.left + anchorBox.width) - elementBox.width - elementMargin.right;\n break;\n }\n break;\n }\n case 'vertical': {\n switch (this._align) {\n case 'top':\n top = anchorBox.top + elementMargin.top;\n break;\n case 'center':\n top = anchorBox.top + (0.5 * (anchorBox.height - elementBox.height));\n break;\n case 'bottom':\n top = (anchorBox.top + anchorBox.height) - elementBox.height - elementMargin.bottom;\n break;\n }\n switch (this._position) {\n case 'left':\n left = anchorBox.left - elementMargin.right - elementBox.width;\n break;\n case 'right':\n left = anchorBox.left + anchorBox.width + elementMargin.left;\n break;\n }\n break;\n }\n }\n if (u.isDefined(left) || u.isDefined(top)) {\n this._moveTo(left, top);\n }\n else {\n up.fail('Invalid tether constraints: %o', this._describeConstraints());\n }\n }\n _describeConstraints() {\n return { position: this._position, align: this._align };\n }\n _moveTo(targetLeft, targetTop) {\n const elementBox = this._element.getBoundingClientRect();\n this._setOffset((targetLeft - elementBox.left) + this.offsetLeft, (targetTop - elementBox.top) + this.offsetTop);\n }\n _setOffset(left, top) {\n this.offsetLeft = left;\n this.offsetTop = top;\n e.setStyle(this._element, { left, top }, 'px');\n }\n};\n\n\n/***/ }),\n/* 79 */\n/***/ (() => {\n\nconst u = up.util;\nup.URLPattern = class URLPattern {\n constructor(fullPattern) {\n this._groups = [];\n const positiveList = [];\n const negativeList = [];\n for (let pattern of u.parseTokens(fullPattern)) {\n if (pattern[0] === '-') {\n negativeList.push(pattern.substring(1));\n }\n else {\n positiveList.push(pattern);\n }\n }\n this._positiveRegexp = this._buildRegexp(positiveList, true);\n this._negativeRegexp = this._buildRegexp(negativeList, false);\n }\n _buildRegexp(list, capture) {\n if (!list.length) {\n return;\n }\n list = u.flatMap(list, u.matchableURLPatternAtom);\n list = list.map(u.escapeRegExp);\n let reCode = list.join('|');\n reCode = reCode.replace(/\\\\\\*/g, '.*?');\n reCode = reCode.replace(/(:|\\\\\\$)([a-z][\\w-]*)/ig, (match, type, name) => {\n if (type === '\\\\$') {\n if (capture) {\n this._groups.push({ name, cast: Number });\n }\n return '(\\\\d+)';\n }\n else {\n if (capture) {\n this._groups.push({ name, cast: String });\n }\n return '([^/?#]+)';\n }\n });\n return new RegExp('^(?:' + reCode + ')$');\n }\n test(url, doNormalize = true) {\n if (doNormalize) {\n url = u.matchableURL(url);\n }\n return this._positiveRegexp.test(url) && !this._isExcluded(url);\n }\n recognize(url, doNormalize = true) {\n if (doNormalize) {\n url = u.matchableURL(url);\n }\n let match = this._positiveRegexp.exec(url);\n if (match && !this._isExcluded(url)) {\n const resolution = {};\n this._groups.forEach((group, groupIndex) => {\n let value = match[groupIndex + 1];\n if (value) {\n return resolution[group.name] = group.cast(value);\n }\n });\n return resolution;\n }\n }\n _isExcluded(url) {\n return this._negativeRegexp?.test(url);\n }\n};\n\n\n/***/ }),\n/* 80 */\n/***/ (() => {\n\nup.framework = (function () {\n let readyState = 'evaling';\n function emitReset() {\n up.emit('up:framework:reset', { log: false });\n }\n function boot() {\n if (readyState !== 'configuring') {\n console.error('Unpoly has already booted');\n return;\n }\n let issue = supportIssue();\n if (!issue) {\n readyState = 'booting';\n up.emit('up:framework:boot', { log: false });\n readyState = 'booted';\n up.emit('up:framework:booted', { log: false });\n }\n else {\n console.error(\"Unpoly cannot boot: %s\", issue);\n }\n }\n function mustBootManually() {\n let unpolyScript = document.currentScript;\n if (unpolyScript?.async) {\n return true;\n }\n if (unpolyScript?.getAttribute('up-boot') === 'manual') {\n return true;\n }\n if (document.readyState === 'complete') {\n return true;\n }\n }\n function onEvaled() {\n up.emit('up:framework:evaled', { log: false });\n if (mustBootManually()) {\n console.debug('Call up.boot() after you have configured Unpoly');\n }\n else {\n document.addEventListener('DOMContentLoaded', boot);\n }\n readyState = 'configuring';\n }\n function startExtension() {\n if (readyState !== 'configuring') {\n throw new Error('Unpoly extensions must be loaded before booting');\n }\n readyState = 'evaling';\n }\n function stopExtension() {\n readyState = 'configuring';\n }\n function isSupported() {\n return !supportIssue();\n }\n function supportIssue() {\n for (let feature of ['URL', 'Proxy', 'Promise', 'DOMParser', 'FormData']) {\n if (!window[feature]) {\n return `Browser doesn't support the ${feature} API`;\n }\n }\n if (document.compatMode === 'BackCompat') {\n return 'Browser is in quirks mode (missing DOCTYPE?)';\n }\n }\n return {\n onEvaled,\n boot,\n startExtension,\n stopExtension,\n reset: emitReset,\n get evaling() { return readyState === 'evaling'; },\n get booted() { return readyState === 'booted'; },\n get beforeBoot() { return readyState !== 'booting' && readyState !== 'booted'; },\n isSupported,\n };\n})();\nup.boot = up.framework.boot;\n\n\n/***/ }),\n/* 81 */\n/***/ (() => {\n\nup.event = (function () {\n const u = up.util;\n const e = up.element;\n function reset() {\n for (let globalElement of [window, document, e.root, document.body]) {\n for (let listener of up.EventListener.allNonDefault(globalElement)) {\n listener.unbind();\n }\n }\n }\n function on(...args) {\n return buildListenerGroup(args).bind();\n }\n function off(...args) {\n return buildListenerGroup(args).unbind();\n }\n function buildListenerGroup(args, options) {\n return up.EventListenerGroup.fromBindArgs(args, options);\n }\n function buildEmitter(args) {\n return up.EventEmitter.fromEmitArgs(args);\n }\n function emit(...args) {\n return buildEmitter(args).emit();\n }\n function build(...args) {\n const props = u.extractOptions(args);\n const type = args[0] || props.type || up.fail('Missing event type');\n const event = new Event(type, { bubbles: true, cancelable: true });\n Object.assign(event, u.omit(props, ['type', 'target']));\n return event;\n }\n function assertEmitted(...args) {\n return buildEmitter(args).assertEmitted();\n }\n function onEscape(listener) {\n return on('keydown', function (event) {\n if (event.key === 'Escape') {\n return listener(event);\n }\n });\n }\n function halt(event, options = {}) {\n if (options.log)\n up.log.putsEvent(event);\n event.stopImmediatePropagation();\n event.preventDefault();\n }\n const keyModifiers = ['metaKey', 'shiftKey', 'ctrlKey', 'altKey'];\n function isUnmodified(event) {\n return (u.isUndefined(event.button) || (event.button === 0)) &&\n !u.some(keyModifiers, modifier => event[modifier]);\n }\n function isSyntheticClick(event) {\n return u.isMissing(event.clientX);\n }\n function fork(originalEvent, newType, copyKeys = []) {\n const newEvent = build(newType, u.pick(originalEvent, copyKeys));\n newEvent.originalEvent = originalEvent;\n ['stopPropagation', 'stopImmediatePropagation', 'preventDefault'].forEach(function (key) {\n const originalMethod = newEvent[key];\n return newEvent[key] = function () {\n originalEvent[key]();\n return originalMethod.call(newEvent);\n };\n });\n if (originalEvent.defaultPrevented) {\n newEvent.preventDefault();\n }\n return newEvent;\n }\n function executeEmitAttr(event, element) {\n if (!isUnmodified(event)) {\n return;\n }\n const eventType = e.attr(element, 'up-emit');\n const eventProps = e.jsonAttr(element, 'up-emit-props');\n const forkedEvent = fork(event, eventType);\n Object.assign(forkedEvent, eventProps);\n up.emit(element, forkedEvent);\n }\n on('up:click', '[up-emit]', executeEmitAttr);\n let inputDevices = ['unknown'];\n function getInputDevice() {\n return u.last(inputDevices);\n }\n function observeInputDevice(newModality) {\n inputDevices.push(newModality);\n setTimeout(() => inputDevices.pop());\n }\n on('keydown keyup', { capture: true }, () => observeInputDevice('key'));\n on('pointerdown pointerup', { capture: true }, () => observeInputDevice('pointer'));\n on('up:framework:reset', reset);\n return {\n on,\n off,\n build,\n emit,\n assertEmitted,\n onEscape,\n halt,\n isUnmodified,\n isSyntheticClick,\n fork,\n keyModifiers,\n get inputDevice() { return getInputDevice(); }\n };\n})();\nup.on = up.event.on;\nup.off = up.event.off;\nup.emit = up.event.emit;\n\n\n/***/ }),\n/* 82 */\n/***/ (() => {\n\nup.protocol = (function () {\n const u = up.util;\n const e = up.element;\n const headerize = function (camel) {\n const header = camel.replace(/(^.|[A-Z])/g, char => '-' + char.toUpperCase());\n return 'X-Up' + header;\n };\n const extractHeader = function (xhr, shortHeader, parseFn = u.identity) {\n let value = xhr.getResponseHeader(headerize(shortHeader));\n if (value) {\n return parseFn(value);\n }\n };\n function targetFromXHR(xhr) {\n return extractHeader(xhr, 'target');\n }\n function parseModifyCacheValue(value) {\n if (value === 'false') {\n return false;\n }\n else {\n return value;\n }\n }\n function evictCacheFromXHR(xhr) {\n return extractHeader(xhr, 'evictCache', parseModifyCacheValue);\n }\n function expireCacheFromXHR(xhr) {\n return extractHeader(xhr, 'expireCache') || up.migrate.clearCacheFromXHR?.(xhr);\n }\n function contextFromXHR(xhr) {\n return extractHeader(xhr, 'context', JSON.parse);\n }\n function methodFromXHR(xhr) {\n return extractHeader(xhr, 'method', u.normalizeMethod);\n }\n function titleFromXHR(xhr) {\n return up.migrate.titleFromXHR?.(xhr) ?? extractHeader(xhr, 'title', JSON.parse);\n }\n function eventPlansFromXHR(xhr) {\n return extractHeader(xhr, 'events', JSON.parse);\n }\n function acceptLayerFromXHR(xhr) {\n return extractHeader(xhr, 'acceptLayer', JSON.parse);\n }\n function dismissLayerFromXHR(xhr) {\n return extractHeader(xhr, 'dismissLayer', JSON.parse);\n }\n const initialRequestMethod = u.memoize(function () {\n return u.normalizeMethod(up.browser.popCookie('_up_method'));\n });\n function locationFromXHR(xhr) {\n return extractHeader(xhr, 'location') || xhr.responseURL;\n }\n const config = new up.Config(() => ({\n methodParam: '_method',\n csrfParam() { return e.metaContent('csrf-param'); },\n csrfToken() { return e.metaContent('csrf-token'); },\n cspNonce() { return e.metaContent('csp-nonce'); },\n csrfHeader: 'X-CSRF-Token',\n maxHeaderSize: 2048,\n }));\n function csrfHeader() {\n return u.evalOption(config.csrfHeader);\n }\n function csrfParam() {\n return u.evalOption(config.csrfParam);\n }\n function csrfToken() {\n return u.evalOption(config.csrfToken);\n }\n function cspNonce() {\n return u.evalOption(config.cspNonce);\n }\n function cspNoncesFromHeader(cspHeader) {\n let nonces = [];\n if (cspHeader) {\n let parts = cspHeader.split(/\\s*;\\s*/);\n for (let part of parts) {\n if (part.indexOf('script-src') === 0) {\n let noncePattern = /'nonce-([^']+)'/g;\n let match;\n while (match = noncePattern.exec(part)) {\n nonces.push(match[1]);\n }\n }\n }\n }\n return nonces;\n }\n function wrapMethod(method, params) {\n params.add(config.methodParam, method);\n return 'POST';\n }\n return {\n config,\n locationFromXHR,\n titleFromXHR,\n targetFromXHR,\n methodFromXHR,\n acceptLayerFromXHR,\n contextFromXHR,\n dismissLayerFromXHR,\n eventPlansFromXHR,\n expireCacheFromXHR,\n evictCacheFromXHR,\n csrfHeader,\n csrfParam,\n csrfToken,\n cspNonce,\n initialRequestMethod,\n headerize,\n wrapMethod,\n cspNoncesFromHeader,\n };\n})();\n\n\n/***/ }),\n/* 83 */\n/***/ (() => {\n\nup.log = (function () {\n const u = up.util;\n const config = new up.LogConfig();\n function printToStandard(...args) {\n if (config.enabled) {\n printToStream('log', ...args);\n }\n }\n const printToWarn = (...args) => printToStream('warn', ...args);\n const printToError = (...args) => printToStream('error', ...args);\n function printToStream(stream, trace, message, ...args) {\n printToStreamStyled(stream, trace, '', message, ...args);\n }\n function printToStreamStyled(stream, trace, customStyles, message, ...args) {\n if (message) {\n if (config.format) {\n console[stream](`%c${trace}%c ${message}`, 'color: #666666; padding: 1px 3px; border: 1px solid #bbbbbb; border-radius: 2px; font-size: 90%; display: inline-block;' + customStyles, '', ...args);\n }\n else {\n console[stream](`[${trace}] ${u.sprintf(message, ...args)}`);\n }\n }\n }\n function printUserEvent(event) {\n if (config.enabled) {\n event = event.originalEvent || event;\n let color = '#5566cc';\n printToStreamStyled('log', event.type, `color: white; border-color: ${color}; background-color: ${color}`, 'Interaction on %o', event.target);\n }\n }\n function printBanner() {\n if (!config.banner) {\n return;\n }\n const logo = \" __ _____ ___ ___ / /_ __\\n\" +\n `/ // / _ \\\\/ _ \\\\/ _ \\\\/ / // / ${up.version}\\n` +\n \"\\\\___/_//_/ .__/\\\\___/_/\\\\_. / \\n\" +\n \" / / / /\\n\\n\";\n let text = \"\";\n if (!up.migrate.loaded) {\n text += \"Load unpoly-migrate.js to polyfill deprecated APIs.\\n\\n\";\n }\n if (config.enabled) {\n text += \"Call `up.log.disable()` to disable logging for this session.\";\n }\n else {\n text += \"Call `up.log.enable()` to enable logging for this session.\";\n }\n const color = 'color: #777777';\n if (config.format) {\n console.log('%c' + logo + '%c' + text, 'font-family: monospace;' + color, color);\n }\n else {\n console.log(logo + text);\n }\n }\n up.on('up:framework:boot', printBanner);\n function enable() {\n config.enabled = true;\n }\n function disable() {\n config.enabled = false;\n }\n return {\n puts: printToStandard,\n putsEvent: printUserEvent,\n error: printToError,\n warn: printToWarn,\n config,\n enable,\n disable,\n };\n})();\nup.puts = up.log.puts;\nup.warn = up.log.warn;\n\n\n/***/ }),\n/* 84 */\n/***/ (() => {\n\nup.script = (function () {\n const u = up.util;\n const e = up.element;\n const config = new up.Config(() => ({\n assetSelectors: [\n 'link[rel=stylesheet]',\n 'script[src]',\n '[up-asset]'\n ],\n noAssetSelectors: [\n '[up-asset=false]',\n ],\n nonceableAttributes: [\n 'up-watch',\n 'up-on-accepted',\n 'up-on-dismissed',\n 'up-on-loaded',\n 'up-on-rendered',\n 'up-on-finished',\n 'up-on-error',\n 'up-on-offline',\n ],\n scriptSelectors: [\n 'script'\n ],\n noScriptSelectors: [\n 'script[type=\"application/ld+json\"]'\n ]\n }));\n const SYSTEM_MACRO_PRIORITIES = {\n '[up-back]': -100,\n '[up-clickable]': -200,\n '[up-drawer]': -200,\n '[up-modal]': -200,\n '[up-cover]': -200,\n '[up-popup]': -200,\n '[up-tooltip]': -200,\n '[up-dash]': -200,\n '[up-flashes]': -200,\n '[up-expand]': -300,\n '[data-method]': -400,\n '[data-confirm]': -400,\n };\n let registeredCompilers = [];\n let registeredMacros = [];\n function registerCompiler(...args) {\n registerProcessor(args);\n }\n function registerMacro(...args) {\n registerProcessor(args, { macro: true });\n }\n function registerAttrCompiler(...args) {\n let [attr, options, valueCallback] = parseProcessorArgs(args);\n let selector = `[${attr}]`;\n let callback = (element) => {\n let value = e.booleanOrStringAttr(element, attr, options.defaultValue);\n if (!value)\n return;\n return valueCallback(element, value);\n };\n registerProcessor([selector, options, callback]);\n }\n function detectSystemMacroPriority(macroSelector) {\n macroSelector = u.evalOption(macroSelector);\n for (let substr in SYSTEM_MACRO_PRIORITIES) {\n if (macroSelector.indexOf(substr) >= 0) {\n return SYSTEM_MACRO_PRIORITIES[substr];\n }\n }\n up.fail('Unregistered priority for system macro %o', macroSelector);\n }\n function registerProcessor(args, overrides = {}) {\n let processor = buildProcessor(args, overrides);\n if (processor.macro) {\n if (up.framework.evaling) {\n processor.priority ||= detectSystemMacroPriority(processor.selector);\n }\n insertProcessor(registeredMacros, processor);\n }\n else {\n insertProcessor(registeredCompilers, processor);\n }\n }\n const parseProcessorArgs = function (args) {\n const defaults = u.extractOptions(args);\n const selector = args.shift();\n const callback = args.pop();\n const options = { ...defaults, ...u.extractOptions(args) };\n return [selector, options, callback];\n };\n function buildProcessor(args, overrides) {\n let [selector, options, callback] = parseProcessorArgs(args);\n options = u.options(options, {\n selector,\n isDefault: up.framework.evaling,\n priority: 0,\n batch: false,\n });\n return Object.assign(callback, options, overrides);\n }\n function insertProcessor(queue, newCompiler) {\n let existingCompiler;\n let index = 0;\n while ((existingCompiler = queue[index]) && (existingCompiler.priority >= newCompiler.priority)) {\n index += 1;\n }\n queue.splice(index, 0, newCompiler);\n if (up.framework.booted) {\n if (newCompiler.priority === 0) {\n for (let layer of up.layer.stack) {\n compile(layer.element, { layer, compilers: [newCompiler] });\n }\n }\n else {\n up.puts('up.compiler()', 'Compiler %s was registered after booting Unpoly. Compiler will run for future fragments only.', newCompiler.selector);\n }\n }\n return newCompiler;\n }\n function compile(fragment, options) {\n up.emit(fragment, 'up:fragment:compile', { log: false });\n let compilers = options.compilers || registeredMacros.concat(registeredCompilers);\n const pass = new up.CompilerPass(fragment, compilers, options);\n pass.run();\n }\n function registerDestructor(element, destructor) {\n let destructors = element.upDestructors;\n if (!destructors) {\n destructors = [];\n element.upDestructors = destructors;\n element.classList.add('up-can-clean');\n }\n if (u.isArray(destructor)) {\n destructors.push(...destructor);\n }\n else {\n destructors.push(destructor);\n }\n }\n function hello(element, options = {}) {\n element = up.fragment.get(element, options);\n up.puts('up.hello()', \"Compiling fragment %o\", element);\n compile(element, options);\n up.fragment.emitInserted(element);\n return element;\n }\n function clean(fragment, options = {}) {\n new up.DestructorPass(fragment, options).run();\n }\n function readData(element) {\n element = up.fragment.get(element);\n return element.upData ||= buildData(element);\n }\n function buildData(element) {\n if (!element.getAttribute) {\n return {};\n }\n let rawJSON = element.getAttribute('up-data');\n let parsedJSON;\n if (rawJSON) {\n parsedJSON = JSON.parse(rawJSON);\n if (!u.isOptions(parsedJSON)) {\n return parsedJSON;\n }\n }\n return {\n ...element.dataset,\n ...parsedJSON,\n ...element.upCompileData,\n };\n }\n function findAssets(head = document.head) {\n return head.querySelectorAll(config.selector('assetSelectors'));\n }\n function assertAssetsOK(newAssets, renderOptions) {\n let oldAssets = findAssets();\n let oldHTML = u.map(oldAssets, 'outerHTML').join();\n let newHTML = u.map(newAssets, 'outerHTML').join();\n if (oldHTML !== newHTML) {\n up.event.assertEmitted('up:assets:changed', { oldAssets, newAssets, renderOptions });\n }\n }\n function disableScript(scriptElement) {\n scriptElement.type = 'up-disabled-script';\n }\n function disableScriptsInSubtree(root) {\n let selector = config.selector('scriptSelectors');\n u.each(e.subtree(root, selector), disableScript);\n }\n function reset() {\n registeredCompilers = u.filter(registeredCompilers, 'isDefault');\n registeredMacros = u.filter(registeredMacros, 'isDefault');\n }\n up.on('up:framework:reset', reset);\n return {\n config,\n compiler: registerCompiler,\n macro: registerMacro,\n attrCompiler: registerAttrCompiler,\n destructor: registerDestructor,\n hello,\n clean,\n data: readData,\n findAssets,\n assertAssetsOK,\n disableSubtree: disableScriptsInSubtree,\n };\n})();\nup.compiler = up.script.compiler;\nup.destructor = up.script.destructor;\nup.macro = up.script.macro;\nup.data = up.script.data;\nup.hello = up.script.hello;\nup.attribute = up.script.attrCompiler;\n\n\n/***/ }),\n/* 85 */\n/***/ (() => {\n\nup.history = (function () {\n const u = up.util;\n const e = up.element;\n const config = new up.Config(() => ({\n enabled: true,\n updateMetaTags: true,\n restoreTargets: ['body'],\n metaTagSelectors: [\n 'meta',\n 'link[rel=alternate]',\n 'link[rel=canonical]',\n 'link[rel=icon]',\n '[up-meta]',\n 'script[type=\"application/ld+json\"]',\n ],\n noMetaTagSelectors: [\n 'meta[http-equiv]',\n '[up-meta=false]',\n 'meta[name=csp-nonce]',\n ],\n }));\n let previousLocation;\n let nextPreviousLocation;\n function reset() {\n previousLocation = undefined;\n nextPreviousLocation = undefined;\n trackCurrentLocation();\n }\n function currentLocation() {\n return u.normalizeURL(location.href);\n }\n function trackCurrentLocation() {\n const url = currentLocation();\n if (nextPreviousLocation !== url) {\n previousLocation = nextPreviousLocation;\n nextPreviousLocation = url;\n }\n }\n trackCurrentLocation();\n function isLocation(url, options) {\n return u.matchURLs(url, location.href, { hash: true, ...options });\n }\n function replace(location, options = {}) {\n location = u.normalizeURL(location);\n if (manipulate('replaceState', location) && (options.event !== false)) {\n emitLocationChanged({ location, reason: 'replace', log: `Replaced state for ${location}` });\n }\n }\n function push(location) {\n location = u.normalizeURL(location);\n if (!isLocation(location) && manipulate('pushState', location)) {\n emitLocationChanged({ location, reason: 'push', log: `Advanced to location ${location}` });\n }\n }\n function emitLocationChanged(props) {\n let event = up.event.build('up:location:changed', props);\n up.migrate?.renamedProperty?.(event, 'url', 'location');\n up.emit(event);\n }\n function manipulate(method, url) {\n if (config.enabled) {\n const state = buildState();\n window.history[method](state, '', url);\n trackCurrentLocation();\n return true;\n }\n }\n function buildState() {\n return { up: {} };\n }\n function restoreStateOnPop(state) {\n if (!state?.up) {\n up.puts('popstate', 'Ignoring a history state not owned by Unpoly');\n return;\n }\n let location = currentLocation();\n up.error.muteUncriticalRejection(up.render({\n guardEvent: up.event.build('up:location:restore', { location, log: `Restoring location ${location}` }),\n url: location,\n target: config.restoreTargets,\n fail: false,\n history: true,\n location,\n peel: true,\n layer: 'root',\n cache: 'auto',\n revalidate: 'auto',\n saveScroll: false,\n scroll: ['restore', 'auto'],\n saveFocus: false,\n focus: ['restore', 'auto'],\n }));\n }\n function onPop(event) {\n trackCurrentLocation();\n let location = currentLocation();\n emitLocationChanged({ location, reason: 'pop', log: `Navigated to history entry ${location}` });\n up.viewport.saveFocus({ location: previousLocation });\n up.viewport.saveScroll({ location: previousLocation });\n restoreStateOnPop(event.state);\n }\n function register() {\n window.addEventListener('popstate', onPop);\n if (up.protocol.initialRequestMethod() === 'GET') {\n replace(currentLocation(), { event: false });\n }\n }\n up.on('up:framework:boot', function () {\n if ('jasmine' in window) {\n register();\n }\n else {\n setTimeout(register, 100);\n }\n });\n function findMetaTags(head = document.head) {\n return head.querySelectorAll(config.selector('metaTagSelectors'));\n }\n function updateMetaTags(newMetaTags) {\n let oldMetaTags = findMetaTags();\n for (let oldMetaTag of oldMetaTags) {\n oldMetaTag.remove();\n }\n for (let newMetaTag of newMetaTags) {\n document.head.append(newMetaTag);\n }\n }\n function getLang(doc = document) {\n let { documentElement } = doc;\n if (documentElement.matches('html')) {\n return doc.documentElement.lang;\n }\n }\n function updateLang(newLang) {\n e.toggleAttr(e.root, 'lang', newLang, !!newLang);\n }\n up.macro('[up-back]', function (link) {\n if (previousLocation) {\n e.setMissingAttrs(link, {\n 'up-href': previousLocation,\n 'up-scroll': 'restore'\n });\n link.removeAttribute('up-back');\n up.link.makeFollowable(link);\n }\n });\n up.on('up:framework:reset', reset);\n return {\n config,\n push,\n replace,\n get location() { return currentLocation(); },\n get previousLocation() { return previousLocation; },\n isLocation,\n findMetaTags,\n updateMetaTags,\n getLang,\n updateLang,\n };\n})();\n\n\n/***/ }),\n/* 86 */\n/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {\n\n__webpack_require__(87);\nconst u = up.util;\nconst e = up.element;\nup.fragment = (function () {\n function upTagName(element) {\n let tagName = e.tagName(element);\n if (tagName.startsWith('up-')) {\n return tagName;\n }\n }\n const config = new up.Config(() => ({\n badTargetClasses: [/^up-/],\n targetDerivers: [\n '[up-id]',\n '[id]',\n 'html',\n 'head',\n 'body',\n 'main',\n '[up-main]',\n upTagName,\n 'link[rel][type]',\n 'link[rel=preload][href]',\n 'link[rel=preconnect][href]',\n 'link[rel=prefetch][href]',\n 'link[rel]',\n 'meta[property]',\n '*[name]',\n 'form[action]',\n 'a[href]',\n '[class]',\n '[up-flashes]',\n 'form',\n ],\n verifyDerivedTarget: true,\n navigateOptions: {\n cache: 'auto',\n revalidate: 'auto',\n feedback: true,\n fallback: true,\n focus: 'auto',\n scroll: 'auto',\n history: 'auto',\n peel: true,\n },\n match: 'region',\n runScripts: true,\n autoHistoryTargets: [':main'],\n autoFocus: ['hash', 'autofocus', 'main-if-main', 'keep', 'target-if-lost'],\n autoScroll: ['hash', 'layer-if-main'],\n autoRevalidate: (response) => response.expired,\n skipResponse: defaultSkipResponse\n }));\n u.delegate(config, ['mainTargets'], () => up.layer.config.any);\n function defaultSkipResponse({ response, expiredResponse }) {\n return !response.text || response.text === expiredResponse?.text;\n }\n function sourceOf(element, options = {}) {\n element = getSmart(element, options);\n return e.closestAttr(element, 'up-source');\n }\n function normalizeSource(source) {\n return u.normalizeURL(source, { hash: false });\n }\n function timeOf(element) {\n let value = e.closestAttr(element, 'up-time');\n if (value && value !== 'false') {\n if (/^\\d+$/.test(value)) {\n value = Number(value) * 1000;\n }\n return new Date(value);\n }\n }\n function etagOf(element) {\n let value = e.closestAttr(element, 'up-etag');\n if (value && value !== 'false') {\n return value;\n }\n }\n const render = up.mockable((...args) => {\n let options = parseTargetAndOptions(args);\n return new up.RenderJob(options).execute();\n });\n const navigate = up.mockable((...args) => {\n const options = parseTargetAndOptions(args);\n return render({ ...options, navigate: true });\n });\n function emitFragmentInserted(element) {\n return up.emit(element, 'up:fragment:inserted', {\n log: ['Inserted fragment %o', element],\n });\n }\n function emitFragmentKeep(keepPlan) {\n let { oldElement, newElement: newFragment, newData, renderOptions } = keepPlan;\n const log = ['Keeping fragment %o', oldElement];\n const callback = e.callbackAttr(oldElement, 'up-on-keep', { exposedKeys: ['newFragment', 'newData'] });\n return up.emit(oldElement, 'up:fragment:keep', { newFragment, newData, renderOptions, log, callback });\n }\n function emitFragmentDestroyed(fragment, options) {\n const log = options.log ?? ['Destroyed fragment %o', fragment];\n const parent = options.parent || document;\n return up.emit(parent, 'up:fragment:destroyed', { fragment, parent, log });\n }\n function isNotDestroying(element) {\n return !element.closest('.up-destroying');\n }\n function isAlive(fragment) {\n return fragment.isConnected && isNotDestroying(fragment);\n }\n function getSmart(...args) {\n const options = u.extractOptions(args);\n const selector = args.pop();\n const root = args[0];\n if (u.isElementish(selector)) {\n return e.get(selector);\n }\n if (root) {\n return getDumb(root, selector, options);\n }\n return new up.FragmentFinder({\n selector,\n origin: options.origin,\n layer: options.layer,\n match: options.match,\n }).find();\n }\n function getDumb(...args) {\n return getAll(...args)[0];\n }\n function getAll(...args) {\n const options = u.extractOptions(args);\n let selectorString = args.pop();\n const root = args[0];\n if (u.isElement(selectorString)) {\n return [selectorString];\n }\n if (u.isList(selectorString)) {\n return selectorString;\n }\n let selector = new up.Selector(selectorString, root, options);\n return selector.descendants(root);\n }\n function getSubtree(element, selector, options = {}) {\n return new up.Selector(selector, element, options).subtree(element);\n }\n function contains(root, selectorOrElement) {\n if (u.isElement(selectorOrElement)) {\n return e.contains(root, selectorOrElement) && up.layer.get(root).contains(selectorOrElement);\n }\n else {\n return getSubtree(root, selectorOrElement).length > 0;\n }\n }\n function closest(element, selector, options) {\n return new up.Selector(selector, element, options).closest(element);\n }\n function destroy(...args) {\n const options = parseTargetAndOptions(args);\n if (options.element = getSmart(options.target, options)) {\n new up.Change.DestroyFragment(options).execute();\n }\n return up.migrate.formerlyAsync?.('up.destroy()');\n }\n function parseTargetAndOptions(args) {\n const options = u.parseArgIntoOptions(args, 'target');\n if (u.isElement(options.target)) {\n options.origin ||= options.target;\n }\n return options;\n }\n function markFragmentAsDestroying(element) {\n element.classList.add('up-destroying');\n element.setAttribute('aria-hidden', 'true');\n }\n function reload(...args) {\n const options = parseTargetAndOptions(args);\n options.target ||= ':main';\n const element = getSmart(options.target, options);\n options.url ||= sourceOf(element);\n options.headers = u.merge(options.headers, conditionalHeaders(element));\n if (options.keepData || e.booleanAttr(element, 'up-keep-data')) {\n options.data = up.data(element);\n }\n up.migrate.postprocessReloadOptions?.(options);\n return render(options);\n }\n function conditionalHeaders(element) {\n let headers = {};\n let time = timeOf(element);\n if (time) {\n headers['If-Modified-Since'] = time.toUTCString();\n }\n let etag = etagOf(element);\n if (etag) {\n headers['If-None-Match'] = etag;\n }\n return headers;\n }\n function visit(url, options) {\n return navigate({ ...options, url });\n }\n const KEY_PATTERN = /^(onFail|on|fail)?(.+)$/;\n function successKey(key) {\n let match = KEY_PATTERN.exec(key);\n if (match) {\n let [_, prefix, suffix] = match;\n switch (prefix) {\n case 'onFail':\n return 'on' + u.upperCaseFirst(suffix);\n case 'fail':\n return u.lowerCaseFirst(suffix);\n }\n }\n }\n function failKey(key) {\n let match = KEY_PATTERN.exec(key);\n if (match) {\n let [_, prefix, suffix] = match;\n switch (prefix) {\n case 'on':\n return 'onFail' + u.upperCaseFirst(suffix);\n case undefined:\n return 'fail' + u.upperCaseFirst(suffix);\n }\n }\n }\n function toTarget(element, options) {\n return u.presence(element, u.isString) || tryToTarget(element, options) || cannotTarget(element);\n }\n function isTargetable(element) {\n return !!tryToTarget(element);\n }\n function untargetableMessage(element) {\n return `Cannot derive good target selector from a <${e.tagName(element)}> element without identifying attributes. Try setting an [id] or configure up.fragment.config.targetDerivers.`;\n }\n function cannotTarget(element) {\n throw new up.CannotTarget(untargetableMessage(element));\n }\n function tryToTarget(element, options) {\n return u.findResult(config.targetDerivers, function (deriver) {\n let target = deriveTarget(element, deriver);\n if (target && isGoodTarget(target, element, options)) {\n return target;\n }\n });\n }\n function deriveTarget(element, deriver) {\n if (u.isFunction(deriver)) {\n return deriver(element);\n }\n else if (element.matches(deriver)) {\n try {\n return deriveTargetFromPattern(element, deriver);\n }\n catch (e) {\n if (e instanceof up.CannotParse) {\n return deriver;\n }\n else {\n throw e;\n }\n }\n }\n }\n function deriveTargetFromPattern(element, deriver) {\n let { includePath, excludeRaw } = up.element.parseSelector(deriver);\n if (includePath.length !== 1) {\n throw new up.CannotParse(deriver);\n }\n let { tagName, id, classNames, attributes } = includePath[0];\n let result = '';\n if (tagName === '*') {\n result += e.tagName(element);\n }\n else if (tagName) {\n result += tagName;\n }\n for (let className of classNames) {\n result += e.classSelector(className);\n }\n if (id) {\n result += e.idSelector(id);\n }\n for (let attributeName in attributes) {\n let attributeValue = attributes[attributeName] || element.getAttribute(attributeName);\n if (attributeName === 'id') {\n result += e.idSelector(attributeValue);\n }\n else if (attributeName === 'class') {\n for (let goodClass of goodClassesForTarget(element)) {\n result += e.classSelector(goodClass);\n }\n }\n else {\n result += e.attrSelector(attributeName, attributeValue);\n }\n }\n if (excludeRaw) {\n result += excludeRaw;\n }\n return result;\n }\n function isGoodTarget(target, element, options = {}) {\n return !isAlive(element) || !config.verifyDerivedTarget || up.fragment.get(target, { layer: element, ...options }) === element;\n }\n function matchesPattern(pattern, str) {\n if (u.isRegExp(pattern)) {\n return pattern.test(str);\n }\n else {\n return pattern === str;\n }\n }\n function goodClassesForTarget(element) {\n let isGood = (klass) => !u.some(config.badTargetClasses, (badTargetClass) => matchesPattern(badTargetClass, klass));\n return u.filter(element.classList, isGood);\n }\n const MAIN_PSEUDO = /:main\\b/;\n const LAYER_PSEUDO = /:layer\\b/;\n const ORIGIN_PSEUDO = /:origin\\b/;\n function containsMainPseudo(target) {\n return MAIN_PSEUDO.test(target);\n }\n function expandTargets(targets, options = {}) {\n const { layer } = options;\n if (layer !== 'new' && !(layer instanceof up.Layer)) {\n up.fail('Must pass an up.Layer as { layer } option, but got %o', layer);\n }\n targets = u.copy(u.wrapList(targets));\n const expanded = [];\n while (targets.length) {\n let target = targets.shift();\n if (target === true)\n target = ':main';\n if (containsMainPseudo(target)) {\n let mode = resolveMode(options);\n let replaced = up.layer.mainTargets(mode).map((mainTarget) => target.replace(MAIN_PSEUDO, mainTarget));\n targets.unshift(...replaced);\n }\n else if (LAYER_PSEUDO.test(target)) {\n if (layer === 'new' || layer.opening)\n continue;\n let firstSwappableTarget = toTarget(layer.getFirstSwappableElement(), options);\n targets.unshift(target.replace(LAYER_PSEUDO, firstSwappableTarget));\n }\n else if (u.isElementish(target)) {\n expanded.push(toTarget(target, options));\n }\n else if (u.isString(target)) {\n expanded.push(resolveOrigin(target, options));\n }\n }\n return u.uniq(expanded);\n }\n function resolveMode({ layer, mode }) {\n if (layer === 'new') {\n return mode || up.fail('Must pass a { mode } option together with { layer: \"new\" }');\n }\n else {\n return layer.mode;\n }\n }\n function modernResolveOrigin(target, { origin } = {}) {\n return target.replace(ORIGIN_PSEUDO, function (match) {\n if (origin) {\n return toTarget(origin);\n }\n else {\n up.fail('Missing { origin } element to resolve \"%s\" reference (found in %s)', match, target);\n }\n });\n }\n function resolveOrigin(...args) {\n return (up.migrate.resolveOrigin || modernResolveOrigin)(...args);\n }\n function splitTarget(target) {\n return u.parseTokens(target, { separator: 'comma' });\n }\n function parseTargetSteps(target, options = {}) {\n let defaultPlacement = options.defaultPlacement || 'swap';\n let defaultMaybe = options.defaultMaybe ?? false;\n let steps = [];\n let simpleSelectors = splitTarget(target);\n for (let selector of simpleSelectors) {\n if (selector === ':none')\n continue;\n let placement = defaultPlacement;\n let maybe = defaultMaybe;\n selector = selector.replace(/\\b::?(before|after)\\b/, (_match, customPlacement) => {\n placement = customPlacement;\n return '';\n });\n selector = selector.replace(/\\b:maybe\\b/, () => {\n maybe = true;\n return '';\n });\n const step = {\n ...options,\n selector,\n placement,\n maybe,\n originalRenderOptions: options,\n };\n steps.push(step);\n }\n return steps;\n }\n function hasAutoHistory(newFragments, layer) {\n let vanillaSelector = expandTargets(config.autoHistoryTargets, { layer }).join();\n for (let newFragment of newFragments) {\n if (e.subtree(newFragment, vanillaSelector).length) {\n return true;\n }\n }\n up.puts('up.render()', \"Will not auto-update history because fragment doesn't contain a selector from up.fragment.config.autoHistoryTargets\");\n return false;\n }\n function matches(element, selector, options = {}) {\n element = e.get(element);\n if (u.isElement(selector)) {\n let target = tryToTarget(selector);\n return target && element.matches(target);\n }\n else {\n return new up.Selector(selector, element, options).matches(element);\n }\n }\n function shouldRevalidate(request, response, options = {}) {\n return request.fromCache && u.evalAutoOption(options.revalidate, config.autoRevalidate, response);\n }\n function targetForSteps(steps) {\n let bestSteps = steps.filter((step) => !step.maybe || step.oldElement?.isConnected);\n let selectors = u.map(bestSteps, 'selector');\n return selectors.join(', ') || ':none';\n }\n function isContainedByRivalStep(steps, candidateStep) {\n return u.some(steps, function (rivalStep) {\n return (rivalStep !== candidateStep) &&\n ((rivalStep.placement === 'swap') || (rivalStep.placement === 'content')) &&\n rivalStep.oldElement.contains(candidateStep.oldElement);\n });\n }\n function compressNestedSteps(steps) {\n if (steps.length < 2)\n return steps;\n let compressed = u.uniqBy(steps, 'oldElement');\n compressed = u.reject(compressed, step => isContainedByRivalStep(compressed, step));\n return compressed;\n }\n function abort(...args) {\n let options = parseTargetAndOptions(args);\n let testFn;\n let { reason, newLayer } = options;\n let elements;\n if (options.target) {\n elements = getAll(options.target, options);\n testFn = (request) => request.isPartOfSubtree(elements);\n reason ||= 'Aborting requests within fragment';\n }\n else {\n let layers = up.layer.getAll(options);\n elements = u.map(layers, 'element');\n testFn = (request) => u.contains(layers, request.layer);\n reason ||= 'Aborting requests within ' + layers.join(', ');\n }\n let testFnWithAbortable = (request) => request.abortable && testFn(request);\n up.network.abort(testFnWithAbortable, { ...options, reason });\n for (let element of elements) {\n up.emit(element, 'up:fragment:aborted', { reason, newLayer, log: false });\n }\n }\n function onAborted(fragment, callback) {\n let guard = (event) => event.target.contains(fragment);\n let unsubscribe = up.on('up:fragment:aborted', { guard }, callback);\n up.destructor(fragment, unsubscribe);\n return unsubscribe;\n }\n function onFirstIntersect(origin, callback, { margin = 0 } = {}) {\n if (e.isIntersectingWindow(origin, { margin })) {\n callback();\n return;\n }\n function processIntersectEntries(entries) {\n for (let entry of entries) {\n if (entry.isIntersecting) {\n disconnect();\n callback();\n return;\n }\n }\n }\n let observer = new IntersectionObserver(processIntersectEntries, { rootMargin: `${margin}px` });\n let disconnect = () => observer.disconnect();\n observer.observe(origin);\n onAborted(origin, disconnect);\n }\n up.on('up:framework:boot', function () {\n const { documentElement } = document;\n documentElement.setAttribute('up-source', normalizeSource(location.href));\n up.hello(documentElement);\n if (!up.browser.canPushState()) {\n return up.warn('Cannot push history changes. Next fragment update will load in a new page.');\n }\n });\n return {\n config,\n reload,\n destroy,\n render,\n navigate,\n get: getSmart,\n getDumb,\n all: getAll,\n subtree: getSubtree,\n contains,\n closest,\n source: sourceOf,\n normalizeSource,\n visit,\n markAsDestroying: markFragmentAsDestroying,\n emitInserted: emitFragmentInserted,\n emitDestroyed: emitFragmentDestroyed,\n emitKeep: emitFragmentKeep,\n successKey,\n failKey,\n expandTargets,\n resolveOrigin,\n toTarget,\n tryToTarget,\n isTargetable,\n matches,\n hasAutoHistory,\n time: timeOf,\n etag: etagOf,\n shouldRevalidate,\n abort,\n onAborted,\n onFirstIntersect,\n splitTarget,\n parseTargetSteps,\n isAlive,\n isNotDestroying,\n targetForSteps,\n compressNestedSteps,\n containsMainPseudo,\n };\n})();\nup.reload = up.fragment.reload;\nup.destroy = up.fragment.destroy;\nup.render = up.fragment.render;\nup.navigate = up.fragment.navigate;\nup.visit = up.fragment.visit;\nu.delegate(up, ['context'], () => up.layer.current);\n\n\n/***/ }),\n/* 87 */\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n/***/ }),\n/* 88 */\n/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {\n\n__webpack_require__(89);\nup.viewport = (function () {\n const u = up.util;\n const e = up.element;\n const f = up.fragment;\n const config = new up.Config(() => ({\n viewportSelectors: ['[up-viewport]', '[up-fixed]'],\n fixedTopSelectors: ['[up-fixed~=top]'],\n fixedBottomSelectors: ['[up-fixed~=bottom]'],\n anchoredRightSelectors: ['[up-anchored~=right]', '[up-fixed~=top]', '[up-fixed~=bottom]', '[up-fixed~=right]'],\n revealSnap: 200,\n revealPadding: 0,\n revealTop: false,\n revealMax() { return 0.5 * window.innerHeight; },\n autoFocusVisible({ element, inputDevice }) { return inputDevice === 'key' || up.form.isField(element); }\n }));\n const bodyShifter = new up.BodyShifter();\n up.compiler(config.selectorFn('anchoredRightSelectors'), function (element) {\n return bodyShifter.onAnchoredElementInserted(element);\n });\n function reveal(element, options) {\n options = u.options(options);\n element = f.get(element, options);\n if (!(options.layer = up.layer.get(element))) {\n up.fail('Cannot reveal a detached element');\n }\n if (options.peel) {\n options.layer.peel();\n }\n const motion = new up.RevealMotion(element, options);\n motion.start();\n return up.migrate.formerlyAsync?.('up.reveal()') || true;\n }\n function doFocus(element, { preventScroll, force, inputDevice, focusVisible } = {}) {\n if (force) {\n if (!element.hasAttribute('tabindex') && element.tabIndex === -1) {\n element.setAttribute('tabindex', '-1');\n }\n }\n inputDevice ??= up.event.inputDevice;\n focusVisible ??= 'auto';\n focusVisible = u.evalAutoOption(focusVisible, config.autoFocusVisible, { element, inputDevice });\n element.focus({\n preventScroll: true,\n focusVisible,\n });\n removeFocusClasses(element);\n element.classList.add(focusVisible ? 'up-focus-visible' : 'up-focus-hidden');\n if (!preventScroll) {\n return reveal(element);\n }\n }\n function removeFocusClasses(element) {\n element?.classList.remove('up-focus-hidden', 'up-focus-visible');\n }\n up.on('focusin', function ({ relatedTarget }) {\n removeFocusClasses(relatedTarget);\n });\n function tryFocus(element, options) {\n doFocus(element, options);\n return element === document.activeElement;\n }\n function revealHash(hash = location.hash, options) {\n let match = firstHashTarget(hash, options);\n if (match) {\n return up.reveal(match, { top: true });\n }\n }\n function allSelector() {\n return [rootSelector(), ...config.viewportSelectors].join();\n }\n function closest(target, options = {}) {\n const element = f.get(target, options);\n return element.closest(allSelector());\n }\n function getSubtree(element, options = {}) {\n element = f.get(element, options);\n return e.subtree(element, allSelector());\n }\n function getAround(element, options = {}) {\n element = f.get(element, options);\n return e.around(element, allSelector());\n }\n function getAll(options = {}) {\n return f.all(allSelector(), options);\n }\n function rootSelector() {\n return getRoot().tagName;\n }\n function getRoot() {\n return document.scrollingElement;\n }\n function rootWidth() {\n return e.root.clientWidth;\n }\n function rootHeight() {\n return e.root.clientHeight;\n }\n function isRoot(element) {\n return element === getRoot();\n }\n function rootScrollbarWidth() {\n return window.innerWidth - rootWidth();\n }\n function scrollTopKey(viewport) {\n return up.fragment.tryToTarget(viewport);\n }\n function fixedElements(root = document) {\n const queryParts = ['[up-fixed]'].concat(config.fixedTopSelectors).concat(config.fixedBottomSelectors);\n return root.querySelectorAll(queryParts.join());\n }\n function saveScroll(...args) {\n const [viewports, options] = parseOptions(args);\n const location = options.location || options.layer.location;\n if (location) {\n const tops = getScrollTopsForSave(viewports);\n options.layer.lastScrollTops.set(location, tops);\n }\n }\n function getScrollTopsForSave(viewports) {\n let tops = {};\n for (let viewport of viewports) {\n let key = scrollTopKey(viewport);\n if (key) {\n tops[key] = viewport.scrollTop;\n }\n else {\n up.warn('up.viewport.saveScroll()', 'Cannot save scroll positions for untargetable viewport %o', viewport);\n }\n }\n return tops;\n }\n function restoreScroll(...args) {\n const [viewports, options] = parseOptions(args);\n const { location } = options.layer;\n const locationScrollTops = options.layer.lastScrollTops.get(location);\n if (locationScrollTops) {\n setScrollTops(viewports, locationScrollTops);\n up.puts('up.viewport.restoreScroll()', 'Restored scroll positions to %o', locationScrollTops);\n return true;\n }\n else {\n return false;\n }\n }\n function saveFocus(options = {}) {\n const layer = up.layer.get(options);\n const location = options.location || layer.location;\n if (location) {\n const focusCapsule = up.FocusCapsule.preserve(layer);\n layer.lastFocusCapsules.set(location, focusCapsule);\n }\n }\n function restoreFocus(options = {}) {\n const layer = up.layer.get(options);\n const location = options.location || layer.location;\n const locationCapsule = options.layer.lastFocusCapsules.get(location);\n if (locationCapsule && locationCapsule.restore(layer)) {\n up.puts('up.viewport.restoreFocus()', 'Restored focus to \"%s\"', locationCapsule.target);\n return true;\n }\n else {\n return false;\n }\n }\n function newStateCache() {\n return new up.FIFOCache({ capacity: 30, normalizeKey: u.matchableURL });\n }\n function parseOptions(args) {\n const options = u.copy(u.extractOptions(args));\n options.layer = up.layer.get(options);\n let viewports;\n if (args[0]) {\n viewports = [closest(args[0], options)];\n }\n else if (options.around) {\n viewports = getAround(options.around, options);\n }\n else {\n viewports = getAll(options);\n }\n return [viewports, options];\n }\n function resetScroll(...args) {\n const [viewports, _options] = parseOptions(args);\n setScrollTops(viewports, {});\n }\n function setScrollTops(viewports, tops) {\n for (let viewport of viewports) {\n const key = scrollTopKey(viewport);\n viewport.scrollTop = tops[key] || 0;\n }\n }\n function absolutize(element, options = {}) {\n const viewport = closest(element);\n const viewportRect = viewport.getBoundingClientRect();\n const originalRect = element.getBoundingClientRect();\n const boundsRect = new up.Rect({\n left: originalRect.left - viewportRect.left,\n top: originalRect.top - viewportRect.top,\n width: originalRect.width,\n height: originalRect.height\n });\n options.afterMeasure?.();\n e.setStyle(element, {\n position: element.style.position === 'static' ? 'static' : 'relative',\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto',\n width: '100%',\n height: '100%'\n });\n const bounds = e.createFromSelector('up-bounds');\n e.insertBefore(element, bounds);\n bounds.appendChild(element);\n const moveBounds = function (diffX, diffY) {\n boundsRect.left += diffX;\n boundsRect.top += diffY;\n return e.setStyle(bounds, boundsRect, 'px');\n };\n moveBounds(0, 0);\n const newElementRect = element.getBoundingClientRect();\n moveBounds(originalRect.left - newElementRect.left, originalRect.top - newElementRect.top);\n u.each(fixedElements(element), e.fixedToAbsolute);\n return {\n bounds,\n moveBounds\n };\n }\n function firstHashTarget(hash, options = {}) {\n if (hash = pureHash(hash)) {\n const selector = [\n e.attrSelector('id', hash),\n 'a' + e.attrSelector('name', hash)\n ].join();\n return f.get(selector, options);\n }\n }\n function pureHash(value) {\n return value?.replace(/^#/, '');\n }\n function focusedElementWithin(scopeElement) {\n const focusedElement = document.activeElement;\n if (up.fragment.contains(scopeElement, focusedElement)) {\n return focusedElement;\n }\n }\n const CURSOR_PROPS = ['selectionStart', 'selectionEnd', 'scrollLeft', 'scrollTop'];\n function copyCursorProps(from, to = {}) {\n for (let key of CURSOR_PROPS) {\n try {\n to[key] = from[key];\n }\n catch (error) {\n }\n }\n return to;\n }\n let userScrolled = false;\n up.on('scroll', { once: true, beforeBoot: true }, () => userScrolled = true);\n up.on('up:framework:boot', function () {\n u.task(function () {\n if (!userScrolled) {\n return revealHash();\n }\n });\n });\n up.on(window, 'hashchange', () => revealHash());\n return {\n reveal,\n revealHash,\n firstHashTarget,\n config,\n get: closest,\n subtree: getSubtree,\n around: getAround,\n get root() { return getRoot(); },\n rootWidth,\n rootHeight,\n isRoot,\n rootScrollbarWidth,\n saveScroll,\n restoreScroll,\n resetScroll,\n saveFocus,\n restoreFocus,\n absolutize,\n focus: doFocus,\n tryFocus,\n newStateCache,\n focusedElementWithin,\n copyCursorProps,\n bodyShifter,\n };\n})();\nup.focus = up.viewport.focus;\nup.reveal = up.viewport.reveal;\n\n\n/***/ }),\n/* 89 */\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n/***/ }),\n/* 90 */\n/***/ (() => {\n\nup.motion = (function () {\n const u = up.util;\n const e = up.element;\n let namedAnimations = {};\n let namedTransitions = {};\n const motionController = new up.MotionController('motion');\n const config = new up.Config(() => ({\n duration: 175,\n easing: 'ease',\n enabled: !matchMedia('(prefers-reduced-motion: reduce)').matches\n }));\n function pickDefault(registry) {\n return u.pickBy(registry, 'isDefault');\n }\n function reset() {\n motionController.reset();\n namedAnimations = pickDefault(namedAnimations);\n namedTransitions = pickDefault(namedTransitions);\n }\n function isEnabled() {\n return config.enabled;\n }\n function animate(element, animation, options) {\n element = up.fragment.get(element);\n options = u.options(options);\n let animationFn = findAnimationFn(animation);\n const willRun = willAnimate(element, animation, options);\n animationFn = up.error.guardFn(animationFn);\n if (willRun) {\n const runNow = () => animationFn(element, options);\n return motionController.startFunction(element, runNow, options);\n }\n else {\n return skipAnimate(element, animation);\n }\n }\n function willAnimate(element, animationOrTransition, options) {\n applyConfig(options);\n return isEnabled() && !isNone(animationOrTransition) && (options.duration > 0) && !e.isSingleton(element);\n }\n function skipAnimate(element, animation) {\n if (u.isOptions(animation)) {\n e.setStyle(element, animation);\n }\n return Promise.resolve();\n }\n function animateNow(element, lastFrame, options) {\n if (up.migrate.loaded)\n lastFrame = up.migrate.fixStyleProps(lastFrame);\n options = { ...options, finishEvent: motionController.finishEvent };\n const cssTransition = new up.CSSTransition(element, lastFrame, options);\n return cssTransition.start();\n }\n function applyConfig(options) {\n options.easing ??= config.easing;\n options.duration ??= config.duration;\n }\n function findNamedAnimation(name) {\n return namedAnimations[name] || up.fail(\"Unknown animation %o\", name);\n }\n function finish(element) {\n return motionController.finish(element);\n }\n function morph(oldElement, newElement, transitionObject, options) {\n options = u.options(options);\n applyConfig(options);\n oldElement = up.fragment.get(oldElement);\n newElement = up.fragment.get(newElement);\n let transitionFn = findTransitionFn(transitionObject);\n const willMorph = willAnimate(oldElement, transitionFn, options);\n transitionFn = up.error.guardFn(transitionFn);\n const beforeStart = u.pluckKey(options, 'beforeStart') || u.noop;\n const afterInsert = u.pluckKey(options, 'afterInsert') || u.noop;\n const beforeDetach = u.pluckKey(options, 'beforeDetach') || u.noop;\n const afterDetach = u.pluckKey(options, 'afterDetach') || u.noop;\n const scrollNew = u.pluckKey(options, 'scrollNew') || u.noop;\n beforeStart();\n if (willMorph) {\n if (motionController.isActive(oldElement) && (options.trackMotion === false)) {\n return transitionFn(oldElement, newElement, options);\n }\n up.puts('up.morph()', 'Morphing %o to %o with transition %O over %d ms', oldElement, newElement, transitionObject, options.duration);\n const viewport = up.viewport.get(oldElement);\n const scrollTopBeforeReveal = viewport.scrollTop;\n const oldRemote = up.viewport.absolutize(oldElement, {\n afterMeasure() {\n e.insertBefore(oldElement, newElement);\n afterInsert();\n }\n });\n const trackable = async function () {\n scrollNew();\n const scrollTopAfterReveal = viewport.scrollTop;\n oldRemote.moveBounds(0, scrollTopAfterReveal - scrollTopBeforeReveal);\n await transitionFn(oldElement, newElement, options);\n beforeDetach();\n oldRemote.bounds.remove();\n afterDetach();\n };\n return motionController.startFunction([oldElement, newElement], trackable, options);\n }\n else {\n beforeDetach();\n swapElementsDirectly(oldElement, newElement);\n afterInsert();\n afterDetach();\n scrollNew();\n return Promise.resolve();\n }\n }\n function findTransitionFn(object) {\n if (isNone(object)) {\n return undefined;\n }\n else if (u.isFunction(object)) {\n return object;\n }\n else if (u.isArray(object)) {\n return composeTransitionFn(...object);\n }\n else if (u.isString(object)) {\n let namedTransition;\n if (object.indexOf('/') >= 0) {\n return composeTransitionFn(...object.split('/'));\n }\n else if (namedTransition = namedTransitions[object]) {\n return findTransitionFn(namedTransition);\n }\n }\n else {\n up.fail(\"Unknown transition %o\", object);\n }\n }\n function composeTransitionFn(oldAnimation, newAnimation) {\n if (!isNone(oldAnimation) && !isNone(newAnimation)) {\n const oldAnimationFn = findAnimationFn(oldAnimation) || u.asyncNoop;\n const newAnimationFn = findAnimationFn(newAnimation) || u.asyncNoop;\n return (oldElement, newElement, options) => Promise.all([\n oldAnimationFn(oldElement, options),\n newAnimationFn(newElement, options)\n ]);\n }\n }\n function findAnimationFn(object) {\n if (isNone(object)) {\n return undefined;\n }\n else if (u.isFunction(object)) {\n return object;\n }\n else if (u.isString(object)) {\n return findNamedAnimation(object);\n }\n else if (u.isOptions(object)) {\n return (element, options) => animateNow(element, object, options);\n }\n else {\n up.fail('Unknown animation %o', object);\n }\n }\n const swapElementsDirectly = up.mockable(function (oldElement, newElement) {\n oldElement.replaceWith(newElement);\n });\n function motionOptions(element, options, parserOptions) {\n options = u.options(options);\n let parser = new up.OptionsParser(element, options, parserOptions);\n parser.booleanOrString('animation');\n parser.booleanOrString('transition');\n parser.string('easing');\n parser.number('duration');\n return options;\n }\n function registerTransition(name, transition) {\n const fn = findTransitionFn(transition);\n fn.isDefault = up.framework.evaling;\n namedTransitions[name] = fn;\n }\n function registerAnimation(name, animation) {\n const fn = findAnimationFn(animation);\n fn.isDefault = up.framework.evaling;\n namedAnimations[name] = fn;\n }\n up.on('up:framework:boot', function () {\n if (!isEnabled()) {\n up.puts('up.motion', 'Animations are disabled');\n }\n });\n function isNone(animationOrTransition) {\n return !animationOrTransition || animationOrTransition === 'none';\n }\n function registerOpacityAnimation(name, from, to) {\n registerAnimation(name, function (element, options) {\n element.style.opacity = 0;\n e.setStyle(element, { opacity: from });\n return animateNow(element, { opacity: to }, options);\n });\n }\n registerOpacityAnimation('fade-in', 0, 1);\n registerOpacityAnimation('fade-out', 1, 0);\n function translateCSS(dx, dy) {\n return { transform: `translate(${dx}px, ${dy}px)` };\n }\n function noTranslateCSS() {\n return { transform: '' };\n }\n function untranslatedBox(element) {\n e.setStyle(element, noTranslateCSS());\n return element.getBoundingClientRect();\n }\n function registerMoveAnimations(direction, boxToTransform) {\n const animationToName = `move-to-${direction}`;\n const animationFromName = `move-from-${direction}`;\n registerAnimation(animationToName, function (element, options) {\n const box = untranslatedBox(element);\n const transform = boxToTransform(box);\n return animateNow(element, transform, options);\n });\n registerAnimation(animationFromName, function (element, options) {\n const box = untranslatedBox(element);\n const transform = boxToTransform(box);\n e.setStyle(element, transform);\n return animateNow(element, noTranslateCSS(), options);\n });\n }\n registerMoveAnimations('top', function (box) {\n const travelDistance = box.top + box.height;\n return translateCSS(0, -travelDistance);\n });\n registerMoveAnimations('bottom', function (box) {\n const travelDistance = up.viewport.rootHeight() - box.top;\n return translateCSS(0, travelDistance);\n });\n registerMoveAnimations('left', function (box) {\n const travelDistance = box.left + box.width;\n return translateCSS(-travelDistance, 0);\n });\n registerMoveAnimations('right', function (box) {\n const travelDistance = up.viewport.rootWidth() - box.left;\n return translateCSS(travelDistance, 0);\n });\n registerTransition('cross-fade', ['fade-out', 'fade-in']);\n registerTransition('move-left', ['move-to-left', 'move-from-right']);\n registerTransition('move-right', ['move-to-right', 'move-from-left']);\n registerTransition('move-up', ['move-to-top', 'move-from-bottom']);\n registerTransition('move-down', ['move-to-bottom', 'move-from-top']);\n up.on('up:framework:reset', reset);\n return {\n morph,\n animate,\n finish,\n finishCount() { return motionController.finishCount; },\n transition: registerTransition,\n animation: registerAnimation,\n config,\n isEnabled,\n isNone,\n willAnimate,\n swapElementsDirectly,\n motionOptions,\n };\n})();\nup.transition = up.motion.transition;\nup.animation = up.motion.animation;\nup.morph = up.motion.morph;\nup.animate = up.motion.animate;\n\n\n/***/ }),\n/* 91 */\n/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {\n\n__webpack_require__(92);\nconst u = up.util;\nup.network = (function () {\n const config = new up.Config(() => ({\n concurrency: 6,\n wrapMethod: true,\n cacheSize: 70,\n cacheExpireAge: 15 * 1000,\n cacheEvictAge: 90 * 60 * 1000,\n badResponseTime: 400,\n fail(response) { return (response.status < 200 || response.status > 299) && response.status !== 304; },\n autoCache(request) { return request.isSafe(); },\n expireCache(request, _response) { return !request.isSafe(); },\n evictCache: false,\n progressBar: true,\n timeout: 90000,\n }));\n const queue = new up.Request.Queue();\n const cache = new up.Request.Cache();\n let progressBar = null;\n function reset() {\n abortRequests();\n queue.reset();\n cache.reset();\n progressBar?.destroy();\n progressBar = null;\n }\n function makeRequest(...args) {\n const options = parseRequestOptions(args);\n const request = new up.Request(options);\n processRequest(request);\n return request;\n }\n function parseRequestOptions(args) {\n const options = u.extractOptions(args);\n if (!options.url) {\n options.url = args[0];\n }\n up.migrate.handleRequestOptions?.(options);\n return options;\n }\n function processRequest(request) {\n useCachedRequest(request) || queueRequest(request);\n }\n function useCachedRequest(newRequest) {\n let cachedRequest;\n if (newRequest.willCache() && (cachedRequest = cache.get(newRequest))) {\n up.puts('up.request()', 'Re-using previous request to %s', newRequest.description);\n if (!newRequest.background) {\n queue.promoteToForeground(cachedRequest);\n }\n cachedRequest.mergeIfUnsent(newRequest);\n cache.track(cachedRequest, newRequest, { onIncompatible: processRequest });\n return true;\n }\n }\n function queueRequest(request) {\n handleCaching(request);\n queue.asap(request);\n return true;\n }\n function handleCaching(request) {\n if (request.willCache()) {\n cache.put(request);\n request.onLoading = () => cache.reindex(request);\n }\n u.always(request, function (responseOrError) {\n let expireCache = responseOrError.expireCache ?? request.expireCache ?? u.evalOption(config.expireCache, request, responseOrError);\n if (expireCache) {\n cache.expire(expireCache, { except: request });\n }\n let evictCache = responseOrError.evictCache ?? request.evictCache ?? u.evalOption(config.evictCache, request, responseOrError);\n if (evictCache) {\n cache.evict(evictCache, { except: request });\n }\n let hasCacheEntry = cache.get(request);\n let isResponse = responseOrError instanceof up.Response;\n let isNetworkError = !isResponse;\n let isSuccessResponse = isResponse && responseOrError.ok;\n let isErrorResponse = isResponse && !responseOrError.ok;\n let isEmptyResponse = isResponse && responseOrError.none;\n if (isErrorResponse) {\n cache.evict(request.url);\n }\n else if (isNetworkError || isEmptyResponse) {\n cache.evict(request);\n }\n else if (isSuccessResponse && hasCacheEntry) {\n cache.put(request);\n }\n });\n }\n function isBusy() {\n return queue.isBusy();\n }\n function loadPage(requestsAttrs) {\n new up.Request(requestsAttrs).loadPage();\n }\n function abortRequests(...args) {\n up.migrate.preprocessAbortArgs?.(args);\n queue.abort(...args);\n }\n function registerAliasForRedirect(request, response) {\n if (request.cache && response.url && request.url !== response.url) {\n const newRequest = u.variant(request, {\n method: response.method,\n url: response.url,\n cacheRoute: null,\n });\n cache.alias(request, newRequest);\n }\n }\n function isSafeMethod(method) {\n return u.contains(['GET', 'OPTIONS', 'HEAD'], u.normalizeMethod(method));\n }\n function onLate() {\n if (u.evalOption(config.progressBar)) {\n progressBar = new up.ProgressBar();\n }\n }\n function onRecover() {\n progressBar?.conclude();\n }\n up.on('up:network:late', onLate);\n up.on('up:network:recover', onRecover);\n up.on('up:framework:reset', reset);\n return {\n request: makeRequest,\n cache,\n isBusy,\n isSafeMethod,\n config,\n abort: abortRequests,\n registerAliasForRedirect,\n queue,\n loadPage,\n };\n})();\nup.request = up.network.request;\nup.cache = up.network.cache;\n\n\n/***/ }),\n/* 92 */\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n/***/ }),\n/* 93 */\n/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {\n\n__webpack_require__(94);\nconst u = up.util;\nconst e = up.element;\nup.layer = (function () {\n const LAYER_CLASSES = [\n up.Layer.Root,\n up.Layer.Modal,\n up.Layer.Popup,\n up.Layer.Drawer,\n up.Layer.Cover\n ];\n const config = new up.Config(function () {\n const newConfig = {\n mode: 'modal',\n any: {\n mainTargets: [\n \"[up-main='']\",\n 'main',\n ':layer'\n ]\n },\n root: {\n mainTargets: ['[up-main~=root]'],\n history: true\n },\n overlay: {\n mainTargets: ['[up-main~=overlay]'],\n openAnimation: 'fade-in',\n closeAnimation: 'fade-out',\n dismissLabel: '\u00D7',\n dismissAriaLabel: 'Dismiss dialog',\n dismissable: true,\n history: 'auto'\n },\n cover: {\n mainTargets: ['[up-main~=cover]']\n },\n drawer: {\n mainTargets: ['[up-main~=drawer]'],\n backdrop: true,\n position: 'left',\n size: 'medium',\n openAnimation(layer) {\n switch (layer.position) {\n case 'left': return 'move-from-left';\n case 'right': return 'move-from-right';\n }\n },\n closeAnimation(layer) {\n switch (layer.position) {\n case 'left': return 'move-to-left';\n case 'right': return 'move-to-right';\n }\n }\n },\n modal: {\n mainTargets: ['[up-main~=modal]'],\n backdrop: true,\n size: 'medium'\n },\n popup: {\n mainTargets: ['[up-main~=popup]'],\n position: 'bottom',\n size: 'medium',\n align: 'left',\n dismissable: 'outside key'\n },\n foreignOverlaySelectors: ['dialog']\n };\n for (let Class of LAYER_CLASSES) {\n newConfig[Class.mode].Class = Class;\n }\n return newConfig;\n });\n let stack = null;\n let handlers = [];\n function mainTargets(mode) {\n return u.flatMap(modeConfigs(mode), 'mainTargets');\n }\n function modeConfigs(mode) {\n if (mode === 'root') {\n return [config.root, config.any];\n }\n else {\n return [config[mode], config.overlay, config.any];\n }\n }\n function normalizeLayerOption(options) {\n if (options.layer instanceof up.Layer)\n return;\n up.migrate.handleLayerOptions?.(options);\n if (u.isGiven(options.layer)) {\n let match = String(options.layer).match(/^(new|shatter|swap)( (\\w+))?/);\n if (match) {\n options.layer = 'new';\n const openMethod = match[1];\n const shorthandMode = match[3];\n options.mode ||= shorthandMode || config.mode;\n if (openMethod === 'swap') {\n if (up.layer.isOverlay()) {\n options.baseLayer = 'parent';\n }\n }\n else if (openMethod === 'shatter') {\n options.baseLayer = 'root';\n }\n }\n }\n else if (options.mode) {\n options.layer = 'new';\n }\n else if (u.isElementish(options.target)) {\n options.layer = stack.get(options.target, { normalizeLayerOptions: false });\n }\n else if (options.origin) {\n options.layer = 'origin';\n }\n else {\n options.layer = 'current';\n }\n }\n function setBaseLayerOption(options) {\n if (options.baseLayer instanceof up.Layer)\n return;\n options.baseLayer = stack.get('current', { ...options, normalizeLayerOptions: false });\n }\n function normalizeOptions(options) {\n normalizeLayerOption(options);\n options.context ??= {};\n setBaseLayerOption(options);\n }\n function build(options, beforeNew) {\n const { mode } = options;\n const { Class } = config[mode];\n const configs = u.reverse(modeConfigs(mode));\n let handleDeprecatedConfig = up.migrate.handleLayerConfig;\n if (handleDeprecatedConfig) {\n configs.forEach(handleDeprecatedConfig);\n }\n options.openAnimation ??= u.pluckKey(options, 'animation');\n options = u.mergeDefined(...configs, { mode, stack }, options);\n if (beforeNew) {\n options = beforeNew(options);\n }\n return new Class(options);\n }\n function openCallbackAttr(link, attr) {\n return e.callbackAttr(link, attr, { exposedKeys: ['layer'] });\n }\n function closeCallbackAttr(link, attr) {\n return e.callbackAttr(link, attr, { exposedKeys: ['layer', 'value', 'response'] });\n }\n function reset() {\n stack.reset();\n handlers = u.filter(handlers, 'isDefault');\n }\n async function open(options) {\n options = u.options(options, {\n layer: 'new',\n defaultToEmptyContent: true,\n navigate: true\n });\n let result = await up.render(options);\n return result.layer;\n }\n function ask(options) {\n return new Promise(function (resolve, reject) {\n options = {\n ...options,\n onAccepted: (event) => resolve(event.value),\n onDismissed: (event) => reject(event.value)\n };\n open(options);\n });\n }\n function anySelector() {\n return u.map(LAYER_CLASSES, Class => Class.selector()).join();\n }\n function optionToString(option) {\n if (u.isString(option)) {\n return `layer \"${option}\"`;\n }\n else {\n return option.toString();\n }\n }\n function isWithinForeignOverlay(element) {\n let selector = config.selector('foreignOverlaySelectors');\n return !!(selector && element.closest(selector));\n }\n up.on('up:fragment:destroyed', function () {\n stack.sync();\n });\n up.on('up:framework:evaled', function () {\n stack = new up.LayerStack();\n });\n up.on('up:framework:reset', reset);\n const api = {\n config,\n mainTargets,\n open,\n build,\n ask,\n normalizeOptions,\n openCallbackAttr,\n closeCallbackAttr,\n anySelector,\n optionToString,\n get stack() { return stack.layers; },\n isWithinForeignOverlay\n };\n u.delegate(api, [\n 'get',\n 'getAll',\n 'root',\n 'overlays',\n 'current',\n 'front',\n 'sync',\n 'count',\n 'dismissOverlays'\n ], () => stack);\n u.delegate(api, [\n 'accept',\n 'dismiss',\n 'isRoot',\n 'isOverlay',\n 'isFront',\n 'on',\n 'off',\n 'emit',\n 'parent',\n 'history',\n 'location',\n 'mode',\n 'context',\n 'element',\n 'contains',\n 'size',\n 'affix'\n ], () => stack.current);\n return api;\n})();\n\n\n/***/ }),\n/* 94 */\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n/***/ }),\n/* 95 */\n/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {\n\n__webpack_require__(96);\nup.link = (function () {\n const u = up.util;\n const e = up.element;\n let lastMousedownTarget = null;\n const ATTRS_WITH_LOCAL_HTML = '[up-content], [up-fragment], [up-document]';\n const ATTRS_SUGGESTING_FOLLOW = `${ATTRS_WITH_LOCAL_HTML}, [up-target], [up-layer], [up-transition], [up-preload]`;\n const DEFAULT_INTERACTIVE_ELEMENT = 'a[href], button';\n const config = new up.Config(() => ({\n followSelectors: ['[up-follow]', `a:is(${ATTRS_SUGGESTING_FOLLOW})`],\n noFollowSelectors: ['[up-follow=false]', 'a[download]', 'a[target]', 'a[href^=\"javascript:\"]', 'a[href^=\"mailto:\"]', `a[href^=\"#\"]:not(${ATTRS_WITH_LOCAL_HTML})`, e.crossOriginSelector('href'), e.crossOriginSelector('up-href')],\n instantSelectors: ['[up-instant]'],\n noInstantSelectors: ['[up-instant=false]', '[onclick]'],\n preloadSelectors: ['[up-preload]'],\n noPreloadSelectors: ['[up-preload=false]'],\n clickableSelectors: ['[up-clickable]', '[up-follow]', '[up-emit]', '[up-accept]', '[up-dismiss]', `a:is(${ATTRS_SUGGESTING_FOLLOW})`],\n noClickableSelectors: ['[up-clickable=false]', DEFAULT_INTERACTIVE_ELEMENT],\n preloadDelay: 90,\n }));\n function isPreloadDisabled(link) {\n return !up.browser.canPushState() || !isFollowable(link) || !willCache(link);\n }\n function willCache(link) {\n const options = parseRequestOptions(link);\n if (options.url) {\n if (options.cache == null) {\n options.cache = 'auto';\n }\n options.basic = true;\n const request = new up.Request(options);\n return request.willCache();\n }\n }\n function reset() {\n lastMousedownTarget = null;\n }\n const follow = up.mockable(function (link, options, parserOptions) {\n return up.render(followOptions(link, options, parserOptions));\n });\n function parseRequestOptions(link, options, parserOptions) {\n options = u.options(options);\n const parser = new up.OptionsParser(link, options, { ...parserOptions, fail: false });\n options.url = followURL(link, options);\n options.method = followMethod(link, options);\n parser.json('headers');\n parser.json('params');\n parser.booleanOrString('cache');\n parser.booleanOrString('expireCache');\n parser.booleanOrString('evictCache');\n parser.booleanOrString('revalidate');\n parser.booleanOrString('abort');\n parser.boolean('abortable');\n parser.boolean('background');\n parser.string('contentType');\n parser.number('badResponseTime');\n parser.number('timeout');\n return options;\n }\n function followOptions(link, options, parserOptions) {\n link = up.fragment.get(link);\n options = u.options(options);\n const parser = new up.OptionsParser(link, options, { fail: true, ...parserOptions });\n parser.include(parseRequestOptions);\n parser.boolean('feedback');\n options.origin ||= link;\n parser.boolean('fail');\n parser.boolean('navigate', { default: true });\n parser.string('confirm', { attr: ['up-confirm', 'data-confirm'] });\n parser.string('target');\n parser.booleanOrString('fallback');\n parser.string('match');\n parser.string('content');\n parser.string('fragment');\n parser.string('document');\n parser.boolean('useKeep');\n parser.boolean('useHungry');\n parser.callback('onLoaded');\n parser.callback('onRendered', { mainKey: 'result' });\n parser.callback('onFinished', { mainKey: 'result' });\n parser.callback('onOffline', { mainKey: 'error' });\n parser.callback('onError', { mainKey: 'error' });\n parser.boolean('peel');\n parser.string('layer');\n parser.string('baseLayer');\n parser.json('context');\n parser.string('mode');\n parser.string('align');\n parser.string('position');\n parser.string('class');\n parser.string('size');\n parser.booleanOrString('dismissable');\n parser.parse(up.layer.openCallbackAttr, 'onOpened');\n parser.parse(up.layer.closeCallbackAttr, 'onAccepted');\n parser.parse(up.layer.closeCallbackAttr, 'onDismissed');\n parser.string('acceptEvent');\n parser.string('dismissEvent');\n parser.string('acceptLocation');\n parser.string('dismissLocation');\n parser.booleanOrString('history');\n parser.booleanOrString('focus');\n parser.boolean('saveScroll');\n parser.boolean('saveFocus');\n parser.booleanOrString('scroll');\n parser.boolean('revealTop');\n parser.number('revealMax');\n parser.number('revealPadding');\n parser.number('revealSnap');\n parser.string('scrollBehavior');\n parser.booleanOrString('history');\n parser.booleanOrString('location');\n parser.booleanOrString('title');\n parser.boolean('metaTags');\n parser.booleanOrString('lang');\n parser.include(up.motion.motionOptions);\n options.guardEvent ??= up.event.build('up:link:follow', { log: ['Following link %o', link] });\n return options;\n }\n function preload(link, options) {\n link = up.fragment.get(link);\n let issue = preloadIssue(link);\n if (issue) {\n return Promise.reject(new up.Error(issue));\n }\n const guardEvent = up.event.build('up:link:preload', { log: ['Preloading link %o', link] });\n return follow(link, {\n abortable: false,\n ...options,\n guardEvent,\n preload: true\n });\n }\n function preloadIssue(link) {\n if (!isSafe(link)) {\n return 'Will not preload an unsafe link';\n }\n }\n function followMethod(link, options = {}) {\n return u.normalizeMethod(options.method || link.getAttribute('up-method') || link.getAttribute('data-method'));\n }\n function followURL(link, options = {}) {\n const url = options.url || link.getAttribute('up-href') || link.getAttribute('href');\n if (url !== '#') {\n return url;\n }\n }\n function isFollowable(link) {\n link = up.fragment.get(link);\n return config.matches(link, 'followSelectors');\n }\n function makeFollowable(link) {\n if (!isFollowable(link)) {\n link.setAttribute('up-follow', '');\n }\n }\n function makeClickable(element) {\n let role = element.matches('a, [up-follow]') ? 'link' : 'button';\n e.setMissingAttrs(element, {\n tabindex: '0',\n role,\n 'up-clickable': ''\n });\n element.addEventListener('keydown', function (event) {\n if ((event.key === 'Enter') || (element.role === 'button' && event.key === 'Space')) {\n return forkEventAsUpClick(event);\n }\n });\n }\n up.macro(config.selectorFn('clickableSelectors'), makeClickable);\n function shouldFollowEvent(event, link) {\n if (event.defaultPrevented) {\n return false;\n }\n const betterTargetSelector = `a, [up-follow], ${up.form.fieldSelector()}`;\n const betterTarget = event.target.closest(betterTargetSelector);\n return !betterTarget || (betterTarget === link);\n }\n function isInstant(linkOrDescendant) {\n const element = linkOrDescendant.closest(config.selector('instantSelectors'));\n return element && !isInstantDisabled(element);\n }\n function isInstantDisabled(link) {\n return config.matches(link, 'noInstantSelectors') || config.matches(link, 'noFollowSelectors');\n }\n function convertClicks(layer) {\n layer.on('click', function (event, element) {\n if (!up.event.isUnmodified(event)) {\n return;\n }\n if (isInstant(element) && lastMousedownTarget) {\n up.event.halt(event);\n }\n else if (up.event.inputDevice === 'key' || up.event.isSyntheticClick(event) || (layer.wasHitByMouseEvent(event) && !didUserDragAway(event))) {\n forkEventAsUpClick(event);\n }\n return lastMousedownTarget = null;\n });\n layer.on('mousedown', function (event, element) {\n if (!up.event.isUnmodified(event)) {\n return;\n }\n lastMousedownTarget = event.target;\n if (isInstant(element)) {\n forkEventAsUpClick(event);\n }\n });\n }\n function didUserDragAway(clickEvent) {\n return lastMousedownTarget && (lastMousedownTarget !== clickEvent.target);\n }\n function forkEventAsUpClick(originalEvent) {\n let forwardedProps = ['clientX', 'clientY', 'button', ...up.event.keyModifiers];\n const newEvent = up.event.fork(originalEvent, 'up:click', forwardedProps);\n up.emit(originalEvent.target, newEvent, { log: false });\n }\n function isSafe(link) {\n const method = followMethod(link);\n return up.network.isSafeMethod(method);\n }\n function onLoadCondition(condition, link, callback) {\n switch (condition) {\n case 'insert':\n callback();\n break;\n case 'reveal': {\n let margin = e.numberAttr(link, 'up-intersect-margin');\n up.fragment.onFirstIntersect(link, callback, { margin });\n break;\n }\n case 'hover':\n new up.LinkFollowIntent(link, callback);\n break;\n case 'manual':\n break;\n }\n }\n function loadDeferred(link, options) {\n let guardEvent = up.event.build('up:deferred:load', { log: ['Loading deferred %o', link] });\n let forcedOptions = {\n navigate: false,\n guardEvent,\n ...options,\n };\n let defaults = {\n target: ':origin',\n cache: 'auto',\n revalidate: 'auto',\n feedback: true,\n };\n return follow(link, forcedOptions, { defaults });\n }\n up.attribute('up-defer', { defaultValue: 'insert' }, function (link, condition) {\n let doLoad = () => up.error.muteUncriticalRejection(loadDeferred(link));\n onLoadCondition(condition, link, doLoad);\n });\n up.on('up:click', config.selectorFn('followSelectors'), function (event, link) {\n if (shouldFollowEvent(event, link)) {\n up.event.halt(event, { log: true });\n up.focus(link, { preventScroll: true });\n up.error.muteUncriticalRejection(follow(link));\n }\n });\n up.attribute('up-expand', { defaultValue: 'a, [up-href]', macro: true }, function (area, childLinkSelector) {\n let childLink = e.get(area, childLinkSelector);\n if (childLink) {\n e.setMissingAttrs(area, {\n 'up-href': e.attr(childLink, 'href'),\n ...e.upAttrs(childLink)\n });\n area.classList.add(...e.upClasses(childLink));\n makeFollowable(area);\n }\n });\n up.compiler(config.selectorFn('preloadSelectors'), function (link) {\n if (!isPreloadDisabled(link)) {\n let doPreload = () => up.error.muteUncriticalRejection(preload(link));\n let condition = e.booleanOrStringAttr(link, 'up-preload', null) ?? 'hover';\n onLoadCondition(condition, link, doPreload);\n }\n });\n up.on('up:framework:reset', reset);\n return {\n follow,\n followOptions,\n requestOptions: parseRequestOptions,\n preload,\n makeFollowable,\n isSafe,\n isFollowable,\n shouldFollowEvent,\n convertClicks,\n config,\n loadDeferred,\n };\n})();\nup.follow = up.link.follow;\nup.deferred = { load: up.link.loadDeferred };\n\n\n/***/ }),\n/* 96 */\n/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n/***/ }),\n/* 97 */\n/***/ (() => {\n\nup.form = (function () {\n const u = up.util;\n const e = up.element;\n const config = new up.Config(() => ({\n groupSelectors: ['[up-form-group]', 'fieldset', 'label', 'form'],\n fieldSelectors: ['select', 'input:not([type=submit]):not([type=image])', 'button[type]:not([type=submit])', 'textarea'],\n submitSelectors: ['form:is([up-submit], [up-target], [up-layer], [up-transition])'],\n noSubmitSelectors: ['[up-submit=false]', '[target]', e.crossOriginSelector('action')],\n submitButtonSelectors: ['input[type=submit]', 'input[type=image]', 'button[type=submit]', 'button:not([type])'],\n watchInputEvents: ['input', 'change'],\n watchInputDelay: 0,\n watchChangeEvents: ['change'],\n }));\n function fieldSelector(suffix = '') {\n return config.fieldSelectors.map(field => field + suffix).join();\n }\n function isField(element) {\n return element.matches(fieldSelector());\n }\n function findFields(root) {\n root = e.get(root);\n let fields = e.subtree(root, fieldSelector());\n if (root.matches('form[id]')) {\n const outsideFieldSelector = fieldSelector(e.attrSelector('form', root.getAttribute('id')));\n const outsideFields = up.fragment.all(outsideFieldSelector, { layer: root });\n fields.push(...outsideFields);\n fields = u.uniq(fields);\n }\n return fields;\n }\n function findSubmitButtons(root) {\n return e.subtree(root, submitButtonSelector());\n }\n function isSubmitButton(element) {\n return element?.matches(submitButtonSelector());\n }\n function submitButtonSelector() {\n return config.selector('submitButtonSelectors');\n }\n const submit = up.mockable((form, options) => {\n return up.render(submitOptions(form, options));\n });\n function submitOptions(form, options, parserOptions) {\n form = getForm(form);\n options = u.options(options);\n let parser = new up.OptionsParser(form, options, parserOptions);\n parser.include(destinationOptions);\n parser.string('failTarget', { default: up.fragment.tryToTarget(form) });\n parser.booleanOrString('disable');\n options.guardEvent ||= up.event.build('up:form:submit', {\n submitButton: options.submitButton,\n log: 'Submitting form',\n params: options.params,\n form,\n });\n options.origin ||= up.viewport.focusedElementWithin(form) || options.submitButton || form;\n parser.include(up.link.followOptions);\n return options;\n }\n function watchOptions(field, options, parserOptions = {}) {\n options = u.options(options);\n let parser = new up.OptionsParser(field, options, { ...parserOptions, closest: true, attrPrefix: 'up-watch-' });\n parser.boolean('feedback');\n parser.booleanOrString('disable');\n parser.string('event');\n parser.number('delay');\n let config = up.form.config;\n if (options.event === 'input') {\n options.event = u.evalOption(config.watchInputEvents, field);\n options.delay ??= config.watchInputDelay;\n }\n else if (options.event === 'change') {\n options.event = u.evalOption(config.watchChangeEvents, field);\n }\n options.origin ||= field;\n return options;\n }\n function disableContainer(container) {\n let focusedElement = document.activeElement;\n let focusFallback;\n let controls = [...findFields(container), ...findSubmitButtons(container)];\n for (let control of controls) {\n if (control === focusedElement) {\n focusFallback = findGroup(focusedElement);\n }\n raiseDisableStack(control);\n }\n if (focusFallback) {\n up.focus(focusFallback, { force: true, preventScroll: true });\n }\n return function () {\n controls.forEach(lowerDisableStack);\n };\n }\n function raiseDisableStack(control) {\n if (!control.upDisableCount) {\n control.upDisableCount ||= 0;\n control.upOriginalDisabled = control.disabled;\n }\n control.upDisableCount++;\n control.disabled = true;\n }\n function lowerDisableStack(control) {\n if (control.upDisableCount) {\n if (!control.disabled) {\n control.upDisableCount = 0;\n }\n else {\n control.upDisableCount--;\n if (!control.upDisableCount) {\n control.disabled = control.upOriginalDisabled;\n }\n }\n }\n }\n function disableWhile(promise, options) {\n let undoDisable = handleDisableOption(options);\n u.always(promise, undoDisable);\n }\n function handleDisableOption({ disable, origin }) {\n if (!disable)\n return u.noop;\n let missingOption = (key) => { up.fail(\"Cannot process { disable: '%s' } option without { %s }\", disable, key); };\n let getOrigin = () => origin || missingOption('origin');\n let getOriginForm = () => getScope(getOrigin());\n let containers;\n if (disable === true) {\n containers = [getOriginForm()];\n }\n else if (u.isString(disable)) {\n containers = up.fragment.subtree(getOriginForm(), disable, { origin });\n }\n return u.sequence(containers.map(disableContainer));\n }\n function destinationOptions(form, options, parserOptions) {\n options = u.options(options);\n form = getForm(form);\n const parser = new up.OptionsParser(form, options, parserOptions);\n parser.string('contentType', { attr: 'enctype' });\n parser.json('headers');\n const params = up.Params.fromForm(form);\n const submitButton = (options.submitButton ??= findSubmitButtons(form)[0]);\n if (submitButton) {\n params.addField(submitButton);\n options.method ||= submitButton.getAttribute('formmethod');\n options.url ||= submitButton.getAttribute('formaction');\n }\n params.addAll(options.params);\n options.params = params;\n parser.string('url', { attr: 'action', default: up.fragment.source(form) });\n parser.string('method', {\n attr: ['up-method', 'data-method', 'method'],\n default: 'GET',\n normalize: u.normalizeMethod\n });\n if (options.method === 'GET') {\n options.url = up.Params.stripURL(options.url);\n }\n return options;\n }\n function watch(root, ...args) {\n root = up.element.get(root);\n const callback = u.extractCallback(args) || watchCallbackFromElement(root) || up.fail('No callback given for up.watch()');\n let options = u.extractOptions(args);\n const watcher = new up.FieldWatcher(root, options, callback);\n watcher.start();\n return () => watcher.stop();\n }\n function watchCallbackFromElement(element) {\n let rawCallback = element.getAttribute('up-watch');\n if (rawCallback) {\n return up.NonceableCallback.fromString(rawCallback).toFunction('value', 'name').bind(element);\n }\n }\n function autosubmit(target, options = {}) {\n const onChange = (_diff, renderOptions) => submit(target, renderOptions);\n return watch(target, { options, batch: true }, onChange);\n }\n function getGroupSelectors() {\n return up.migrate.migratedFormGroupSelectors?.() || config.groupSelectors;\n }\n function findGroup(field) {\n return findGroupSolution(field).element;\n }\n function findGroupSolution(field) {\n return u.findResult(getGroupSelectors(), function (groupSelector) {\n let group = field.closest(groupSelector);\n if (group) {\n let goodDerivedGroupTarget = up.fragment.tryToTarget(group);\n let goodDerivedFieldTarget = up.fragment.tryToTarget(field);\n let groupHasFieldTarget = goodDerivedFieldTarget && (group !== field) && `${groupSelector}:has(${goodDerivedFieldTarget})`;\n let target = goodDerivedGroupTarget || groupHasFieldTarget;\n if (target) {\n return {\n target,\n element: group,\n origin: field\n };\n }\n }\n });\n }\n function validate(...args) {\n let options = parseValidateArgs(...args);\n let validator = up.FormValidator.forElement(options.origin);\n return validator.validate(options);\n }\n function parseValidateArgs(originOrTarget, ...args) {\n const options = u.extractOptions(args);\n if (options.origin) {\n options.target ||= up.fragment.toTarget(originOrTarget);\n }\n else {\n options.origin ||= up.fragment.get(originOrTarget);\n }\n return options;\n }\n function switcherValues(field) {\n let value;\n let meta;\n if (field.matches('input[type=checkbox]')) {\n if (field.checked) {\n value = field.value;\n meta = ':checked';\n }\n else {\n meta = ':unchecked';\n }\n }\n else if (field.matches('input[type=radio]')) {\n const form = getScope(field);\n const groupName = field.getAttribute('name');\n const checkedButton = form.querySelector(`input[type=radio]${e.attrSelector('name', groupName)}:checked`);\n if (checkedButton) {\n meta = ':checked';\n value = checkedButton.value;\n }\n else {\n meta = ':unchecked';\n }\n }\n else {\n value = field.value;\n }\n const values = [];\n if (u.isPresent(value)) {\n values.push(value);\n values.push(':present');\n }\n else {\n values.push(':blank');\n }\n if (u.isPresent(meta)) {\n values.push(meta);\n }\n return values;\n }\n function switchTargets(switcher, options = {}) {\n const targetSelector = options.target || options.target || switcher.getAttribute('up-switch');\n const form = getScope(switcher);\n targetSelector || up.fail(\"No switch target given for %o\", switcher);\n const fieldValues = switcherValues(switcher);\n for (let target of up.fragment.all(form, targetSelector)) {\n switchTarget(target, fieldValues);\n }\n }\n const switchTarget = up.mockable(function (target, fieldValues) {\n let show;\n fieldValues ||= switcherValues(findSwitcherForTarget(target));\n let hideValues = target.getAttribute('up-hide-for');\n if (hideValues) {\n hideValues = parseSwitchTokens(hideValues);\n show = u.intersect(fieldValues, hideValues).length === 0;\n }\n else {\n let showValues = target.getAttribute('up-show-for');\n showValues = showValues ? parseSwitchTokens(showValues) : [':present', ':checked'];\n show = u.intersect(fieldValues, showValues).length > 0;\n }\n e.toggle(target, show);\n target.classList.add('up-switched');\n });\n function parseSwitchTokens(str) {\n return u.parseTokens(str, { json: true });\n }\n function findSwitcherForTarget(target) {\n const form = getScope(target);\n const switchers = form.querySelectorAll('[up-switch]');\n const switcher = u.find(switchers, function (switcher) {\n const targetSelector = switcher.getAttribute('up-switch');\n return target.matches(targetSelector);\n });\n return switcher || up.fail('Could not find [up-switch] field for %o', target);\n }\n function getForm(elementOrSelector, options = {}) {\n const element = up.fragment.get(elementOrSelector, options);\n return element.form || element.closest('form');\n }\n function getScope(element, options) {\n return getForm(element, options) || up.layer.get(element).element;\n }\n function focusedField() {\n return u.presence(document.activeElement, isField);\n }\n function isSubmittable(form) {\n form = up.fragment.get(form);\n return config.matches(form, 'submitSelectors');\n }\n up.on('submit', config.selectorFn('submitSelectors'), function (event, form) {\n if (event.defaultPrevented)\n return;\n const submitButton = u.presence(event.submitter, isSubmitButton);\n up.event.halt(event, { log: true });\n up.error.muteUncriticalRejection(submit(form, { submitButton }));\n });\n up.compiler(validatingFieldSelector, function (fieldOrForm) {\n let validator = up.FormValidator.forElement(fieldOrForm);\n validator.watchContainer(fieldOrForm);\n });\n function validatingFieldSelector() {\n let includes = config.fieldSelectors.map((selector) => `${selector}[up-validate], [up-validate] ${selector}`);\n let excludes = ['[up-validate=false]'];\n return e.unionSelector(includes, excludes);\n }\n up.compiler('[up-switch]', (switcher) => {\n switchTargets(switcher);\n });\n up.on('change', '[up-switch]', (_event, switcher) => {\n switchTargets(switcher);\n });\n up.compiler('[up-show-for]:not(.up-switched), [up-hide-for]:not(.up-switched)', (element) => {\n switchTarget(element);\n });\n up.attribute('up-watch', (formOrField) => watch(formOrField));\n up.attribute('up-autosubmit', (formOrField) => autosubmit(formOrField));\n return {\n config,\n submit,\n submitOptions,\n destinationOptions,\n watchOptions,\n isSubmittable,\n watch,\n validate,\n autosubmit,\n fieldSelector,\n fields: findFields,\n isField,\n submitButtons: findSubmitButtons,\n focusedField,\n switchTarget,\n disableWhile,\n disable: disableContainer,\n group: findGroup,\n groupSolution: findGroupSolution,\n groupSelectors: getGroupSelectors,\n get: getForm,\n getScope,\n };\n})();\nup.submit = up.form.submit;\nup.watch = up.form.watch;\nup.autosubmit = up.form.autosubmit;\nup.validate = up.form.validate;\n\n\n/***/ }),\n/* 98 */\n/***/ (() => {\n\nup.feedback = (function () {\n const u = up.util;\n const e = up.element;\n const config = new up.Config(() => ({\n currentClasses: ['up-current'],\n navSelectors: ['[up-nav]', 'nav'],\n noNavSelectors: ['[up-nav=false]'],\n }));\n function reset() {\n up.layer.root.feedbackLocation = null;\n }\n const CLASS_ACTIVE = 'up-active';\n const CLASS_LOADING = 'up-loading';\n const SELECTOR_LINK = 'a, [up-href]';\n function linkURLs(link) {\n return link.upFeedbackURLs ||= new up.LinkFeedbackURLs(link);\n }\n function updateFragment(fragment, { layer } = {}) {\n layer ||= up.layer.get(fragment);\n let layerLocation = getMatchableLayerLocation(layer);\n const navSelector = config.selector('navSelectors');\n const navLinkSelector = `${navSelector} :is(${SELECTOR_LINK}), ${navSelector}:is(${SELECTOR_LINK})`;\n const links = up.fragment.all(navLinkSelector, { layer });\n for (let link of links) {\n const isCurrent = linkURLs(link).isCurrent(layerLocation);\n for (let currentClass of config.currentClasses) {\n link.classList.toggle(currentClass, isCurrent);\n }\n e.toggleAttr(link, 'aria-current', 'page', isCurrent);\n }\n }\n function getMatchableLayerLocation(layer) {\n return layer.feedbackLocation || u.matchableURL(layer.location);\n }\n function findActivatableArea(element) {\n return e.ancestor(element, SELECTOR_LINK) || element;\n }\n function showAroundRequest(request, options) {\n if (!options.feedback) {\n return;\n }\n let clean = (fn) => u.always(request, fn);\n let activeElement = getActiveElementFromRenderOptions(request);\n if (activeElement) {\n clean(e.addTemporaryClass(activeElement, CLASS_ACTIVE));\n }\n for (let fragment of request.fragments) {\n clean(e.addTemporaryClass(fragment, CLASS_LOADING));\n }\n }\n function getActiveElementFromRenderOptions(request) {\n let activeElement = request.origin;\n if (activeElement) {\n return findActivatableArea(activeElement);\n }\n }\n function updateLayerIfLocationChanged(layer) {\n const processedLocation = layer.feedbackLocation;\n const layerLocation = getMatchableLayerLocation(layer.location);\n if (!processedLocation || (processedLocation !== layerLocation)) {\n layer.feedbackLocation = layerLocation;\n updateFragment(layer.element, { layer });\n }\n }\n function onBrowserLocationChanged() {\n const frontLayer = up.layer.front;\n if (frontLayer.showsLiveHistory()) {\n updateLayerIfLocationChanged(frontLayer);\n }\n }\n up.on('up:location:changed', (_event) => {\n onBrowserLocationChanged();\n });\n up.on('up:fragment:compile', (_event, newFragment) => {\n updateFragment(newFragment);\n });\n up.on('up:layer:location:changed', (event) => {\n updateLayerIfLocationChanged(event.layer);\n });\n up.on('up:framework:reset', reset);\n return {\n config,\n showAroundRequest,\n };\n})();\n\n\n/***/ }),\n/* 99 */\n/***/ (() => {\n\nup.radio = (function () {\n const e = up.element;\n const config = new up.Config(() => ({\n hungrySelectors: ['[up-hungry]'],\n noHungrySelectors: ['[up-hungry=false]'],\n pollInterval: 30000,\n }));\n function hungrySteps(renderOptions) {\n let { useHungry, origin, layer: renderLayer } = renderOptions;\n let steps = { current: [], other: [] };\n if (!useHungry)\n return steps;\n let hungrySelector = config.selector('hungrySelectors');\n const layerPreference = [renderLayer, ...renderLayer.ancestors, ...renderLayer.descendants];\n for (let elementLayer of layerPreference) {\n let hungries = up.fragment.all(elementLayer.element, hungrySelector, { layer: elementLayer });\n for (let element of hungries) {\n let selector = up.fragment.tryToTarget(element, { origin });\n if (!selector) {\n up.warn('[up-hungry]', 'Ignoring untargetable fragment %o', element);\n continue;\n }\n let ifLayer = e.attr(element, 'up-if-layer');\n let applicableLayers = ifLayer ? up.layer.getAll(ifLayer, { baseLayer: elementLayer }) : [elementLayer];\n let motionOptions = up.motion.motionOptions(element);\n let selectEvent = up.event.build('up:fragment:hungry', { log: false });\n let selectCallback = e.callbackAttr(element, 'up-on-hungry', { exposedKeys: ['newFragment', 'renderOptions'] });\n let step = {\n selector,\n oldElement: element,\n layer: elementLayer,\n origin,\n ...motionOptions,\n placement: 'swap',\n useKeep: true,\n maybe: true,\n selectEvent,\n selectCallback,\n originalRenderOptions: renderOptions,\n };\n if (applicableLayers.includes(renderLayer)) {\n let list = renderLayer === elementLayer ? steps.current : steps.other;\n list.push(step);\n }\n }\n }\n steps.other = up.fragment.compressNestedSteps(steps.other);\n return steps;\n }\n function startPolling(fragment, options = {}) {\n up.FragmentPolling.forFragment(fragment).forceStart(options);\n }\n function stopPolling(element) {\n up.FragmentPolling.forFragment(element).forceStop();\n }\n function pollOptions(fragment, options = {}) {\n const defaults = { background: true };\n const parser = new up.OptionsParser(fragment, options, { defaults });\n parser.number('interval', { default: config.pollInterval });\n parser.string('ifLayer', { default: 'front' });\n parser.include(up.link.requestOptions);\n return options;\n }\n up.attribute('up-poll', function (fragment) {\n up.FragmentPolling.forFragment(fragment).onPollAttributeObserved();\n });\n up.macro('[up-flashes]', function (fragment) {\n e.setMissingAttrs(fragment, {\n 'up-hungry': '',\n 'up-if-layer': 'subtree',\n 'up-keep': '',\n 'role': 'alert',\n });\n fragment.addEventListener('up:fragment:keep', function (event) {\n if (!e.isEmpty(event.newFragment))\n event.preventDefault();\n });\n });\n return {\n config,\n hungrySteps,\n startPolling,\n stopPolling,\n pollOptions,\n };\n})();\n\n\n/***/ }),\n/* 100 */\n/***/ (() => {\n\n(function () {\n const e = up.element;\n function isRails() {\n return window.Rails ||\n window.jQuery?.rails;\n }\n for (let feature of ['method', 'confirm']) {\n const upAttribute = `up-${feature}`;\n const dataAttribute = `data-${feature}`;\n up.macro(`a[${dataAttribute}]`, function (link) {\n if (isRails() && up.link.isFollowable(link)) {\n e.setMissingAttr(link, upAttribute, link.getAttribute(dataAttribute));\n link.removeAttribute(dataAttribute);\n }\n });\n }\n})();\n\n\n/***/ })\n/******/ \t]);\n/************************************************************************/\n/******/ \t// The module cache\n/******/ \tvar __webpack_module_cache__ = {};\n/******/ \t\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/ \t\t// Check if module is in cache\n/******/ \t\tvar cachedModule = __webpack_module_cache__[moduleId];\n/******/ \t\tif (cachedModule !== undefined) {\n/******/ \t\t\treturn cachedModule.exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = __webpack_module_cache__[moduleId] = {\n/******/ \t\t\t// no module.id needed\n/******/ \t\t\t// no module.loaded needed\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/ \t\n/******/ \t\t// Execute the module function\n/******/ \t\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n/******/ \t\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/ \t\n/************************************************************************/\n/******/ \t/* webpack/runtime/make namespace object */\n/******/ \t(() => {\n/******/ \t\t// define __esModule on exports\n/******/ \t\t__webpack_require__.r = (exports) => {\n/******/ \t\t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t\t}\n/******/ \t\t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t\t};\n/******/ \t})();\n/******/ \t\n/************************************************************************/\nvar __webpack_exports__ = {};\n// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.\n(() => {\n__webpack_require__(1);\n__webpack_require__(2);\n__webpack_require__(3);\n__webpack_require__(4);\n__webpack_require__(5);\n__webpack_require__(6);\n__webpack_require__(7);\n__webpack_require__(9);\n__webpack_require__(10);\n__webpack_require__(11);\n__webpack_require__(12);\n__webpack_require__(13);\n__webpack_require__(14);\n__webpack_require__(15);\n__webpack_require__(16);\n__webpack_require__(17);\n__webpack_require__(18);\n__webpack_require__(19);\n__webpack_require__(20);\n__webpack_require__(21);\n__webpack_require__(22);\n__webpack_require__(23);\n__webpack_require__(24);\n__webpack_require__(25);\n__webpack_require__(26);\n__webpack_require__(27);\n__webpack_require__(28);\n__webpack_require__(29);\n__webpack_require__(30);\n__webpack_require__(31);\n__webpack_require__(32);\n__webpack_require__(33);\n__webpack_require__(34);\n__webpack_require__(35);\n__webpack_require__(36);\n__webpack_require__(37);\n__webpack_require__(38);\n__webpack_require__(39);\n__webpack_require__(40);\n__webpack_require__(41);\n__webpack_require__(42);\n__webpack_require__(43);\n__webpack_require__(44);\n__webpack_require__(45);\n__webpack_require__(46);\n__webpack_require__(47);\n__webpack_require__(48);\n__webpack_require__(49);\n__webpack_require__(50);\n__webpack_require__(51);\n__webpack_require__(52);\n__webpack_require__(53);\n__webpack_require__(54);\n__webpack_require__(55);\n__webpack_require__(56);\n__webpack_require__(57);\n__webpack_require__(58);\n__webpack_require__(59);\n__webpack_require__(60);\n__webpack_require__(61);\n__webpack_require__(62);\n__webpack_require__(63);\n__webpack_require__(64);\n__webpack_require__(65);\n__webpack_require__(66);\n__webpack_require__(67);\n__webpack_require__(68);\n__webpack_require__(69);\n__webpack_require__(70);\n__webpack_require__(71);\n__webpack_require__(72);\n__webpack_require__(73);\n__webpack_require__(74);\n__webpack_require__(75);\n__webpack_require__(76);\n__webpack_require__(77);\n__webpack_require__(78);\n__webpack_require__(79);\n__webpack_require__(80);\n__webpack_require__(81);\n__webpack_require__(82);\n__webpack_require__(83);\n__webpack_require__(84);\n__webpack_require__(85);\n__webpack_require__(86);\n__webpack_require__(88);\n__webpack_require__(90);\n__webpack_require__(91);\n__webpack_require__(93);\n__webpack_require__(95);\n__webpack_require__(97);\n__webpack_require__(98);\n__webpack_require__(99);\n__webpack_require__(100);\nup.framework.onEvaled();\n\n})();\n\n/******/ })()\n;", "export default new class Environment {\n\n get toString() {\n return document.body.getAttribute('data-environment')\n }\n\n get isTest() {\n return this.toString === 'test'\n }\n\n get isDevelopment() {\n return this.toString === 'development'\n }\n\n get isFeatureSpec() {\n return this.isTest && typeof jasmine === 'undefined'\n }\n\n}()\n", "import environment from '../util/environment'\n\nup.layer.config.overlay.dismissAriaLabel = 'Schlie\u00DFen'\n\nup.layer.config.modal.dismissable = 'button key' // do not allow closing modals by clicking the backdrop\n\nup.layer.config.modal.openAnimation = 'modal-open'\nup.layer.config.modal.closeAnimation = 'modal-close'\n\nconst modalClosedStyles = { opacity: 0, transform: 'translateY(-2rem)' }\nconst modalOpenedStyles = { opacity: 1, transform: 'translateY(0)' }\n\nup.animation('modal-open', function(element, options) {\n up.element.setStyle(element, modalClosedStyles)\n return up.animate(element, modalOpenedStyles, options)\n})\n\nup.animation('modal-close', function(element, options) {\n up.element.setStyle(element, modalOpenedStyles)\n return up.animate(element, modalClosedStyles, options)\n})\n\nup.link.config.followSelectors.push('a[href]')\nup.link.config.instantSelectors.push('a[href]')\nup.link.config.noInstantSelectors.push('.btn:not(.btn-link), [no-instant]')\n\nup.fragment.config.runScripts = false\n\nup.feedback.config.currentClasses.push('active')\n\nup.form.config.submitSelectors.push('form')\n\nup.history.config.updateMetaTags = true\n\nup.motion.config.enabled = !environment.isTest\n\nup.network.config.progressBar = true\n\nup.on('up:network:late', () => { document.body.classList.add('-loading') })\nup.on('up:network:recover', () => { document.body.classList.remove('-loading') })\n\nup.on('up:request:offline', () => { alert('Du bist offline!\\n\\nBitte versuche es nochmal, wenn du wieder online bist.') })\n", "// We don't want the attachment functionality of the trix editor.\n// Therefore we remove the attachment-button and anything related with the attachment functionality.\n\nup.on(document, 'trix-initialize', function(event) {\n const toolbarElement = event.target.toolbarElement\n const disallowedActions = ['attachFiles']\n\n // Remove attachment button\n toolbarElement.querySelectorAll('.trix-button--icon').forEach(button => {\n const action = button.getAttribute('data-trix-action')\n if (disallowedActions.includes(action)) {\n button.parentNode.remove()\n }\n })\n})\n\n// Prevents any type of file accepting (e.g. via button or dragging the file into the editor)\n// (https://github.com/basecamp/trix#storing-attached-files)\nup.on(document, 'trix-file-accept', function(event) {\n event.preventDefault()\n})\n", "/*\nTrix 2.1.6\nCopyright \u00A9 2024 37signals, LLC\n */\nvar name = \"trix\";\nvar version = \"2.1.6\";\nvar description = \"A rich text editor for everyday writing\";\nvar main = \"dist/trix.umd.min.js\";\nvar module = \"dist/trix.esm.min.js\";\nvar style = \"dist/trix.css\";\nvar files = [\n\t\"dist/*.css\",\n\t\"dist/*.js\",\n\t\"dist/*.map\",\n\t\"src/{inspector,trix}/*.js\"\n];\nvar repository = {\n\ttype: \"git\",\n\turl: \"git+https://github.com/basecamp/trix.git\"\n};\nvar keywords = [\n\t\"rich text\",\n\t\"wysiwyg\",\n\t\"editor\"\n];\nvar author = \"37signals, LLC\";\nvar license = \"MIT\";\nvar bugs = {\n\turl: \"https://github.com/basecamp/trix/issues\"\n};\nvar homepage = \"https://trix-editor.org/\";\nvar devDependencies = {\n\t\"@babel/core\": \"^7.16.0\",\n\t\"@babel/preset-env\": \"^7.16.4\",\n\t\"@rollup/plugin-babel\": \"^5.3.0\",\n\t\"@rollup/plugin-commonjs\": \"^22.0.2\",\n\t\"@rollup/plugin-json\": \"^4.1.0\",\n\t\"@rollup/plugin-node-resolve\": \"^13.3.0\",\n\t\"@web/dev-server\": \"^0.1.34\",\n\t\"babel-eslint\": \"^10.1.0\",\n\tconcurrently: \"^7.4.0\",\n\teslint: \"^7.32.0\",\n\tesm: \"^3.2.25\",\n\tkarma: \"6.4.1\",\n\t\"karma-chrome-launcher\": \"3.2.0\",\n\t\"karma-qunit\": \"^4.1.2\",\n\t\"karma-sauce-launcher\": \"^4.3.6\",\n\t\"node-sass\": \"^7.0.1\",\n\tqunit: \"2.19.1\",\n\trangy: \"^1.3.0\",\n\trollup: \"^2.56.3\",\n\t\"rollup-plugin-includepaths\": \"^0.2.4\",\n\t\"rollup-plugin-terser\": \"^7.0.2\",\n\tsvgo: \"^2.8.0\",\n\twebdriverio: \"^7.19.5\"\n};\nvar resolutions = {\n\twebdriverio: \"^7.19.5\"\n};\nvar scripts = {\n\t\"build-css\": \"node-sass --functions=./assets/trix/stylesheets/functions assets/trix.scss dist/trix.css\",\n\t\"build-js\": \"rollup -c\",\n\t\"build-assets\": \"cp -f assets/*.html dist/\",\n\tbuild: \"yarn run build-js && yarn run build-css && yarn run build-assets\",\n\twatch: \"rollup -c -w\",\n\tlint: \"eslint .\",\n\tpretest: \"yarn run lint && yarn run build\",\n\ttest: \"karma start\",\n\tprerelease: \"yarn version && yarn test\",\n\trelease: \"npm adduser && npm publish\",\n\tpostrelease: \"git push && git push --tags\",\n\tdev: \"web-dev-server --app-index index.html --root-dir dist --node-resolve --open\",\n\tstart: \"yarn build-assets && concurrently --kill-others --names js,css,dev-server 'yarn watch' 'yarn build-css --watch' 'yarn dev'\"\n};\nvar _package = {\n\tname: name,\n\tversion: version,\n\tdescription: description,\n\tmain: main,\n\tmodule: module,\n\tstyle: style,\n\tfiles: files,\n\trepository: repository,\n\tkeywords: keywords,\n\tauthor: author,\n\tlicense: license,\n\tbugs: bugs,\n\thomepage: homepage,\n\tdevDependencies: devDependencies,\n\tresolutions: resolutions,\n\tscripts: scripts\n};\n\nconst attachmentSelector = \"[data-trix-attachment]\";\nconst attachments = {\n preview: {\n presentation: \"gallery\",\n caption: {\n name: true,\n size: true\n }\n },\n file: {\n caption: {\n size: true\n }\n }\n};\n\nconst attributes = {\n default: {\n tagName: \"div\",\n parse: false\n },\n quote: {\n tagName: \"blockquote\",\n nestable: true\n },\n heading1: {\n tagName: \"h1\",\n terminal: true,\n breakOnReturn: true,\n group: false\n },\n code: {\n tagName: \"pre\",\n terminal: true,\n htmlAttributes: [\"language\"],\n text: {\n plaintext: true\n }\n },\n bulletList: {\n tagName: \"ul\",\n parse: false\n },\n bullet: {\n tagName: \"li\",\n listAttribute: \"bulletList\",\n group: false,\n nestable: true,\n test(element) {\n return tagName$1(element.parentNode) === attributes[this.listAttribute].tagName;\n }\n },\n numberList: {\n tagName: \"ol\",\n parse: false\n },\n number: {\n tagName: \"li\",\n listAttribute: \"numberList\",\n group: false,\n nestable: true,\n test(element) {\n return tagName$1(element.parentNode) === attributes[this.listAttribute].tagName;\n }\n },\n attachmentGallery: {\n tagName: \"div\",\n exclusive: true,\n terminal: true,\n parse: false,\n group: false\n }\n};\nconst tagName$1 = element => {\n var _element$tagName;\n return element === null || element === void 0 || (_element$tagName = element.tagName) === null || _element$tagName === void 0 ? void 0 : _element$tagName.toLowerCase();\n};\n\nconst androidVersionMatch = navigator.userAgent.match(/android\\s([0-9]+.*Chrome)/i);\nconst androidVersion = androidVersionMatch && parseInt(androidVersionMatch[1]);\nvar browser$1 = {\n // Android emits composition events when moving the cursor through existing text\n // Introduced in Chrome 65: https://bugs.chromium.org/p/chromium/issues/detail?id=764439#c9\n composesExistingText: /Android.*Chrome/.test(navigator.userAgent),\n // Android 13, especially on Samsung keyboards, emits extra compositionend and beforeinput events\n // that can make the input handler lose the current selection or enter an infinite input -> render -> input\n // loop.\n recentAndroid: androidVersion && androidVersion > 12,\n samsungAndroid: androidVersion && navigator.userAgent.match(/Android.*SM-/),\n // IE 11 activates resizing handles on editable elements that have \"layout\"\n forcesObjectResizing: /Trident.*rv:11/.test(navigator.userAgent),\n // https://www.w3.org/TR/input-events-1/ + https://www.w3.org/TR/input-events-2/\n supportsInputEvents: typeof InputEvent !== \"undefined\" && [\"data\", \"getTargetRanges\", \"inputType\"].every(prop => prop in InputEvent.prototype)\n};\n\nvar css$3 = {\n attachment: \"attachment\",\n attachmentCaption: \"attachment__caption\",\n attachmentCaptionEditor: \"attachment__caption-editor\",\n attachmentMetadata: \"attachment__metadata\",\n attachmentMetadataContainer: \"attachment__metadata-container\",\n attachmentName: \"attachment__name\",\n attachmentProgress: \"attachment__progress\",\n attachmentSize: \"attachment__size\",\n attachmentToolbar: \"attachment__toolbar\",\n attachmentGallery: \"attachment-gallery\"\n};\n\nvar lang$1 = {\n attachFiles: \"Attach Files\",\n bold: \"Bold\",\n bullets: \"Bullets\",\n byte: \"Byte\",\n bytes: \"Bytes\",\n captionPlaceholder: \"Add a caption\u2026\",\n code: \"Code\",\n heading1: \"Heading\",\n indent: \"Increase Level\",\n italic: \"Italic\",\n link: \"Link\",\n numbers: \"Numbers\",\n outdent: \"Decrease Level\",\n quote: \"Quote\",\n redo: \"Redo\",\n remove: \"Remove\",\n strike: \"Strikethrough\",\n undo: \"Undo\",\n unlink: \"Unlink\",\n url: \"URL\",\n urlPlaceholder: \"Enter a URL\u2026\",\n GB: \"GB\",\n KB: \"KB\",\n MB: \"MB\",\n PB: \"PB\",\n TB: \"TB\"\n};\n\n/* eslint-disable\n no-case-declarations,\n*/\nconst sizes = [lang$1.bytes, lang$1.KB, lang$1.MB, lang$1.GB, lang$1.TB, lang$1.PB];\nvar file_size_formatting = {\n prefix: \"IEC\",\n precision: 2,\n formatter(number) {\n switch (number) {\n case 0:\n return \"0 \".concat(lang$1.bytes);\n case 1:\n return \"1 \".concat(lang$1.byte);\n default:\n let base;\n if (this.prefix === \"SI\") {\n base = 1000;\n } else if (this.prefix === \"IEC\") {\n base = 1024;\n }\n const exp = Math.floor(Math.log(number) / Math.log(base));\n const humanSize = number / Math.pow(base, exp);\n const string = humanSize.toFixed(this.precision);\n const withoutInsignificantZeros = string.replace(/0*$/, \"\").replace(/\\.$/, \"\");\n return \"\".concat(withoutInsignificantZeros, \" \").concat(sizes[exp]);\n }\n }\n};\n\nconst ZERO_WIDTH_SPACE = \"\\uFEFF\";\nconst NON_BREAKING_SPACE = \"\\u00A0\";\nconst OBJECT_REPLACEMENT_CHARACTER = \"\\uFFFC\";\n\nconst extend = function (properties) {\n for (const key in properties) {\n const value = properties[key];\n this[key] = value;\n }\n return this;\n};\n\nconst html = document.documentElement;\nconst match = html.matches;\nconst handleEvent = function (eventName) {\n let {\n onElement,\n matchingSelector,\n withCallback,\n inPhase,\n preventDefault,\n times\n } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const element = onElement ? onElement : html;\n const selector = matchingSelector;\n const useCapture = inPhase === \"capturing\";\n const handler = function (event) {\n if (times != null && --times === 0) {\n handler.destroy();\n }\n const target = findClosestElementFromNode(event.target, {\n matchingSelector: selector\n });\n if (target != null) {\n withCallback === null || withCallback === void 0 || withCallback.call(target, event, target);\n if (preventDefault) {\n event.preventDefault();\n }\n }\n };\n handler.destroy = () => element.removeEventListener(eventName, handler, useCapture);\n element.addEventListener(eventName, handler, useCapture);\n return handler;\n};\nconst handleEventOnce = function (eventName) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n options.times = 1;\n return handleEvent(eventName, options);\n};\nconst triggerEvent = function (eventName) {\n let {\n onElement,\n bubbles,\n cancelable,\n attributes\n } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const element = onElement != null ? onElement : html;\n bubbles = bubbles !== false;\n cancelable = cancelable !== false;\n const event = document.createEvent(\"Events\");\n event.initEvent(eventName, bubbles, cancelable);\n if (attributes != null) {\n extend.call(event, attributes);\n }\n return element.dispatchEvent(event);\n};\nconst elementMatchesSelector = function (element, selector) {\n if ((element === null || element === void 0 ? void 0 : element.nodeType) === 1) {\n return match.call(element, selector);\n }\n};\nconst findClosestElementFromNode = function (node) {\n let {\n matchingSelector,\n untilNode\n } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n while (node && node.nodeType !== Node.ELEMENT_NODE) {\n node = node.parentNode;\n }\n if (node == null) {\n return;\n }\n if (matchingSelector != null) {\n if (node.closest && untilNode == null) {\n return node.closest(matchingSelector);\n } else {\n while (node && node !== untilNode) {\n if (elementMatchesSelector(node, matchingSelector)) {\n return node;\n }\n node = node.parentNode;\n }\n }\n } else {\n return node;\n }\n};\nconst findInnerElement = function (element) {\n while ((_element = element) !== null && _element !== void 0 && _element.firstElementChild) {\n var _element;\n element = element.firstElementChild;\n }\n return element;\n};\nconst innerElementIsActive = element => document.activeElement !== element && elementContainsNode(element, document.activeElement);\nconst elementContainsNode = function (element, node) {\n if (!element || !node) {\n return;\n }\n while (node) {\n if (node === element) {\n return true;\n }\n node = node.parentNode;\n }\n};\nconst findNodeFromContainerAndOffset = function (container, offset) {\n if (!container) {\n return;\n }\n if (container.nodeType === Node.TEXT_NODE) {\n return container;\n } else if (offset === 0) {\n return container.firstChild != null ? container.firstChild : container;\n } else {\n return container.childNodes.item(offset - 1);\n }\n};\nconst findElementFromContainerAndOffset = function (container, offset) {\n const node = findNodeFromContainerAndOffset(container, offset);\n return findClosestElementFromNode(node);\n};\nconst findChildIndexOfNode = function (node) {\n var _node;\n if (!((_node = node) !== null && _node !== void 0 && _node.parentNode)) {\n return;\n }\n let childIndex = 0;\n node = node.previousSibling;\n while (node) {\n childIndex++;\n node = node.previousSibling;\n }\n return childIndex;\n};\nconst removeNode = node => {\n var _node$parentNode;\n return node === null || node === void 0 || (_node$parentNode = node.parentNode) === null || _node$parentNode === void 0 ? void 0 : _node$parentNode.removeChild(node);\n};\nconst walkTree = function (tree) {\n let {\n onlyNodesOfType,\n usingFilter,\n expandEntityReferences\n } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const whatToShow = (() => {\n switch (onlyNodesOfType) {\n case \"element\":\n return NodeFilter.SHOW_ELEMENT;\n case \"text\":\n return NodeFilter.SHOW_TEXT;\n case \"comment\":\n return NodeFilter.SHOW_COMMENT;\n default:\n return NodeFilter.SHOW_ALL;\n }\n })();\n return document.createTreeWalker(tree, whatToShow, usingFilter != null ? usingFilter : null, expandEntityReferences === true);\n};\nconst tagName = element => {\n var _element$tagName;\n return element === null || element === void 0 || (_element$tagName = element.tagName) === null || _element$tagName === void 0 ? void 0 : _element$tagName.toLowerCase();\n};\nconst makeElement = function (tag) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n let key, value;\n if (typeof tag === \"object\") {\n options = tag;\n tag = options.tagName;\n } else {\n options = {\n attributes: options\n };\n }\n const element = document.createElement(tag);\n if (options.editable != null) {\n if (options.attributes == null) {\n options.attributes = {};\n }\n options.attributes.contenteditable = options.editable;\n }\n if (options.attributes) {\n for (key in options.attributes) {\n value = options.attributes[key];\n element.setAttribute(key, value);\n }\n }\n if (options.style) {\n for (key in options.style) {\n value = options.style[key];\n element.style[key] = value;\n }\n }\n if (options.data) {\n for (key in options.data) {\n value = options.data[key];\n element.dataset[key] = value;\n }\n }\n if (options.className) {\n options.className.split(\" \").forEach(className => {\n element.classList.add(className);\n });\n }\n if (options.textContent) {\n element.textContent = options.textContent;\n }\n if (options.childNodes) {\n [].concat(options.childNodes).forEach(childNode => {\n element.appendChild(childNode);\n });\n }\n return element;\n};\nlet blockTagNames = undefined;\nconst getBlockTagNames = function () {\n if (blockTagNames != null) {\n return blockTagNames;\n }\n blockTagNames = [];\n for (const key in attributes) {\n const attributes$1 = attributes[key];\n if (attributes$1.tagName) {\n blockTagNames.push(attributes$1.tagName);\n }\n }\n return blockTagNames;\n};\nconst nodeIsBlockContainer = node => nodeIsBlockStartComment(node === null || node === void 0 ? void 0 : node.firstChild);\nconst nodeProbablyIsBlockContainer = function (node) {\n return getBlockTagNames().includes(tagName(node)) && !getBlockTagNames().includes(tagName(node.firstChild));\n};\nconst nodeIsBlockStart = function (node) {\n let {\n strict\n } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n strict: true\n };\n if (strict) {\n return nodeIsBlockStartComment(node);\n } else {\n return nodeIsBlockStartComment(node) || !nodeIsBlockStartComment(node.firstChild) && nodeProbablyIsBlockContainer(node);\n }\n};\nconst nodeIsBlockStartComment = node => nodeIsCommentNode(node) && (node === null || node === void 0 ? void 0 : node.data) === \"block\";\nconst nodeIsCommentNode = node => (node === null || node === void 0 ? void 0 : node.nodeType) === Node.COMMENT_NODE;\nconst nodeIsCursorTarget = function (node) {\n let {\n name\n } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!node) {\n return;\n }\n if (nodeIsTextNode(node)) {\n if (node.data === ZERO_WIDTH_SPACE) {\n if (name) {\n return node.parentNode.dataset.trixCursorTarget === name;\n } else {\n return true;\n }\n }\n } else {\n return nodeIsCursorTarget(node.firstChild);\n }\n};\nconst nodeIsAttachmentElement = node => elementMatchesSelector(node, attachmentSelector);\nconst nodeIsEmptyTextNode = node => nodeIsTextNode(node) && (node === null || node === void 0 ? void 0 : node.data) === \"\";\nconst nodeIsTextNode = node => (node === null || node === void 0 ? void 0 : node.nodeType) === Node.TEXT_NODE;\n\nconst input = {\n level2Enabled: true,\n getLevel() {\n if (this.level2Enabled && browser$1.supportsInputEvents) {\n return 2;\n } else {\n return 0;\n }\n },\n pickFiles(callback) {\n const input = makeElement(\"input\", {\n type: \"file\",\n multiple: true,\n hidden: true,\n id: this.fileInputId\n });\n input.addEventListener(\"change\", () => {\n callback(input.files);\n removeNode(input);\n });\n removeNode(document.getElementById(this.fileInputId));\n document.body.appendChild(input);\n input.click();\n }\n};\n\nvar key_names = {\n 8: \"backspace\",\n 9: \"tab\",\n 13: \"return\",\n 27: \"escape\",\n 37: \"left\",\n 39: \"right\",\n 46: \"delete\",\n 68: \"d\",\n 72: \"h\",\n 79: \"o\"\n};\n\nvar parser = {\n removeBlankTableCells: false,\n tableCellSeparator: \" | \",\n tableRowSeparator: \"\\n\"\n};\n\nvar text_attributes = {\n bold: {\n tagName: \"strong\",\n inheritable: true,\n parser(element) {\n const style = window.getComputedStyle(element);\n return style.fontWeight === \"bold\" || style.fontWeight >= 600;\n }\n },\n italic: {\n tagName: \"em\",\n inheritable: true,\n parser(element) {\n const style = window.getComputedStyle(element);\n return style.fontStyle === \"italic\";\n }\n },\n href: {\n groupTagName: \"a\",\n parser(element) {\n const matchingSelector = \"a:not(\".concat(attachmentSelector, \")\");\n const link = element.closest(matchingSelector);\n if (link) {\n return link.getAttribute(\"href\");\n }\n }\n },\n strike: {\n tagName: \"del\",\n inheritable: true\n },\n frozen: {\n style: {\n backgroundColor: \"highlight\"\n }\n }\n};\n\nvar toolbar = {\n getDefaultHTML() {\n return \"
\\n\\n