{"version":3,"file":"index.export.cjs","names":["ThermalPalettes","ThermalUnit","t","i18next","initLitI18n","LanguageDetector","pversion","createContext","i18next","LitElement","i18next","unsafeSVG","t","consume","createContext","CallbacksManager","ContextProvider","ThermalFileInstance","ThermalFileFailure","createContext","CallbacksManager","ContextProvider","ThermalFileFailure","ThermalFileReader","createRef","styleMap","ifDefined","ref","repeat","ThermalFileReader","TimeFormat","createContext","ContextProvider","createContext","CallbacksManager","ContextProvider","ThermalManager","createContext","CallbacksManager","ContextProvider","ThermalUnit","ThermalPalettes","createContext","ContextProvider","provide","property","i18next","createRef","ifDefined","nothing","t","cache","map","ref","state","property","LitElement","createRef","ref","nothing","state","computePosition","offset","flip","shift","arrow","autoUpdate","nothing","ref","unsafeSVG","property","LitElement","t","createRef","ref","nothing","property","state","createRef","LitElement","offset","flip","inline","shift","ref","classMap","ifDefined","queryAssignedElements","property","property","ifDefined","nothing","property","LitElement","property","nothing","unsafeSVG","property","state","state","property","property","nothing","property","state","LitElement","nothing","property","property","consume","consume","consume","consume","state","version","t","consume","state","nothing","property","state","nothing","t","state","consume","t","consume","t","consume","ThermalPalettes","consume","state","property","t","t","t","ifDefined","classMap","unsafeSVG","nothing","consume","state","property","consume","property","consume","thermalUnits","ThermalUnit","ifDefined","t","property","state","consume","createRef","ref","nothing","state","consume","property","styleMap","property","consume","state","classMap","nothing","state","property","createRef","ref","ifDefined","t","state","consume","ifDefined","t","state","consume","nothing","consume","state","property","createRef","ref","live","consume","guard","nothing","state","consume","t","property","t","state","consume","property","t","property","state","consume","state","property","createRef","ref","classMap","t","state","createRef","t","ifDefined","ref","property","state","createRef","ref","ifDefined","property","ifDefined","t","state","consume","format","nothing","createRef","ThermalFileFailure","nothing","ref","state","createRef","nothing","t","classMap","ref","property","createRef","when","ref","nothing","ifDefined","property","state","nothing","t","playbackSpeed","property","state","consume","createRef","nothing","ref","ifDefined","t","state","consume","property","property","nothing","property","state","state","consume","t","state","consume","property","createRef","AbstractAddTool","unsafeHTML","t","nothing","ref","property","state","createRef","nothing","ref","t","styleMap","state","consume","t","PointAnalysis","property","state","createRef","t","TimeFormat","nothing","ref","guard","state","property","consume","nothing","t","PointAnalysis","AbstractAreaAnalysis","property","consume","state","nothing","t","repeat","property","consume","state","nothing","map","availableAnalysisColors","property","state","ifDefined","property","state","t","ifDefined","property","state","createRef","t","ifDefined","property","state","LitElement","createRef","CallbacksManager","ref","property","provide","property","ifDefined","nothing","ThermalFileReader","t","repeat","property","state","provide","ifDefined","createRef","unsafeHTML","ref","ifDefined","nothing","t","property","state","provide","nothing","t","unsafeHTML","TimeFormat","state","consume","nothing","property","createRef","t","classMap","nothing","ref","format","consume","state","property","Output","BufferTarget","Mp4OutputFormat","VideoSampleSource","VideoSample","createRef","QUALITY_VERY_HIGH","property","state","nothing","Directive","t","nothing","t","directive","Directive","ifDefined","QUALITY_VERY_HIGH","QUALITY_HIGH","QUALITY_MEDIUM","QUALITY_LOW","QUALITY_VERY_LOW","directive","Directive","nothing","classMap","styleMap","ref","directive","Directive","nothing","ref","directive","createRef","ref","nothing","state","t","nothing","property","ifDefined","t","property","version","i18nWebcomponents"],"sources":["../../src/utils/converters/numberRangeConverter.ts","../../src/utils/converters/booleanConverter.ts","../../src/utils/converters/paletteConverter.ts","../../src/utils/converters/stringOrUndefinedConverter.ts","../../src/utils/converters/durationConverter.ts","../../src/utils/converters/unitConverter.ts","../../src/utils/converters/optionalNumberConverter.ts","../../src/utils/getContrastColor.ts","../../src/utils/icons.ts","../../../../node_modules/.pnpm/i18next@26.7.1_typescript@5.9.3/node_modules/i18next/dist/esm/i18next.js","../../src/translations/languages/en.ts","../../src/translations/languages/fr.ts","../../src/translations/languages/cs.ts","../../src/translations/languages/cy.ts","../../src/translations/languages/de.ts","../../src/translations/i18n.ts","../../package.json","../../src/styles/mode.ts","../../src/styles/defaultStyles.ts","../../src/translations/Languages.ts","../../src/translations/localeContext.ts","../../src/utils/shortId.ts","../../src/controllers/HierarchyUpdatesHub.ts","../../src/hierarchy/AbstractThermalElement.ts","../../src/controllers/AbstractReactiveController.ts","../../src/controllers/AbstractHierarchyController.ts","../../src/controllers/FileAnalysisSynchronisator.ts","../../src/controllers/FileAnalysisSynchronisators.ts","../../src/controllers/FileController.ts","../../src/controllers/FileLoadController.ts","../../src/controllers/GroupController.ts","../../src/controllers/GroupLoadController.ts","../../src/controllers/GroupListingController.ts","../../src/controllers/GroupAnalysisSyncController.ts","../../src/controllers/RegistryController.ts","../../src/hierarchy/providers/getters.ts","../../src/controllers/ManagerController.ts","../../src/controllers/ConfigController.ts","../../src/apps/AbstractApp.ts","../../src/ui/App.ts","../../src/ui/Bar.ts","../../src/ui/Btn.ts","../../src/ui/BtnGroup.ts","../../src/ui/Dialog.ts","../../src/ui/Dropdown.ts","../../src/ui/Dropin.ts","../../src/ui/Expandable.ts","../../src/ui/Field.ts","../../src/ui/Icon.ts","../../src/ui/Loading.ts","../../src/ui/Radio.ts","../../src/ui/Slot.ts","../../src/ui/Spinner.ts","../../src/ui/Tip.ts","../../src/hierarchy/consumers/AbstractManagerConsumer.ts","../../src/hierarchy/consumers/AbstractRegistryConsumer.ts","../../src/hierarchy/consumers/AbstractGroupConsumer.ts","../../src/hierarchy/abstraction/AbstractFileProvider.ts","../../src/hierarchy/abstraction/AbstractGroupProvider.ts","../../src/hierarchy/abstraction/AbstractManagerProvider.ts","../../src/hierarchy/abstraction/AbstractRegistryProvider.ts","../../src/hierarchy/consumers/AbstractFileConsumer.ts","../../src/controls/independent/AppInfoButton.ts","../../src/controls/independent/DisplayPanel.ts","../../src/controls/independent/ConfigDialog.ts","../../src/hierarchy/providers/FileCopy.ts","../../src/hierarchy/providers/FileProvider.ts","../../src/hierarchy/providers/GroupProvider.ts","../../src/hierarchy/providers/ManagerProvider.ts","../../src/hierarchy/providers/RegistryProvider.ts","../../src/controls/manager/ManagerExportPanel.ts","../../src/controls/manager/ManagerGraphSmoothSwitch.ts","../../src/controls/manager/ManagerImageSmoothSwitch.ts","../../src/controls/manager/AbstractPaletteSwitch.ts","../../src/controls/manager/ManagerPaletteButtons.ts","../../src/controls/manager/ManagerPaletteDropdown.ts","../../src/controls/manager/ManagerToolsBar.ts","../../src/controls/manager/ManagerAdvancedPaletteSwitch.ts","../../src/controls/manager/ManagerUnitSwitch.ts","../../src/controls/registry/RegistryRangeForm.ts","../../src/controls/registry/RegistryTicksBar.ts","../../src/controls/registry/RegistryRangeSlider.ts","../../src/controls/registry/RegistryHistogram.ts","../../src/controls/registry/RegistryRangeFullButton.ts","../../src/controls/registry/RegistryRangeAutoButton.ts","../../src/controls/registry/RegistryRangeDisplay.ts","../../src/controls/registry/RegistryOpacitySlider.ts","../../src/controls/group/GroupChartElement.ts","../../src/controls/group/GroupAnalysisSyncButton.ts","../../src/controls/group/GroupDownloadDropdown.ts","../../src/controls/group/GroupDownloadButtons.ts","../../src/controls/group/AbstractGroupDropin.ts","../../src/controls/group/GroupDropinElement.ts","../../src/controls/group/GroupDropinInput.ts","../../src/controls/file/buttons/AbstractFileButton.ts","../../src/controls/group/GroupRangePropagator.ts","../../src/utils/timelineTicks.ts","../../src/controls/group/GroupTimeline.ts","../../src/controls/file/FileCanvas.ts","../../src/controls/file/FileVideoExportButton.ts","../../src/controls/file/FilePlaybackSpeedDropdown.ts","../../src/controls/file/FileDownloadDropdown.ts","../../src/controls/file/buttons/FileButton.ts","../../src/controls/file/buttons/FileDropdown.ts","../../src/controls/file/buttons/FileLrcButton.ts","../../src/controls/file/buttons/FilePngButton.ts","../../src/controls/file/buttons/FileRangePropagator.ts","../../src/controls/file/analysis/FileAnalysisComplex.ts","../../src/controls/file/analysis/FileAnalysisDisplay.ts","../../src/controls/file/analysis/FileAnalysisEdit.ts","../../src/controls/file/analysis/FileAnalysisGraph.ts","../../src/controls/file/analysis/FileAnalysisRow.ts","../../src/controls/file/analysis/FileAnalysisTable.ts","../../src/controls/file/analysis/edit/analysisColorDropdown.ts","../../src/controls/file/analysis/edit/analysisNameInput.ts","../../src/controls/file/analysis/edit/editAreaTable.ts","../../src/controls/file/analysis/edit/editPointTable.ts","../../src/controls/file/analysis/chart/loader.ts","../../src/controls/file/analysis/chart/chart.ts","../../src/apps/AbstractSingleFileApp.ts","../../src/apps/ThermalFileApp.ts","../../src/apps/ThermalDropinApp.ts","../../src/apps/ThermalGroupApp.ts","../../src/utils/iife.ts","../../src/apps/AustralianApparentTemperature.ts","../../src/apps/ThermalSlottedApp.ts","../../src/controls/file/FileInfoButton.ts","../../src/controls/file/fileLabel.ts","../../src/controls/file/FileTimelineElement.ts","../../src/controls/file/video/ISingleVideoExportElement.ts","../../src/controls/file/video/internals/VideoRecorder.ts","../../src/controls/file/video/AbstractSingleVideoExport.ts","../../src/directives/DirectiveHelpers.ts","../../src/directives/AbstractThermalDirective.ts","../../src/directives/SlotOrNothing.ts","../../src/controls/file/video/directives/SingleVideoExportConfigDirective.ts","../../src/controls/file/video/directives/SingleVideoExportLayoutDirective.ts","../../src/controls/file/video/directives/SingleVideoExportProvidersDirective.ts","../../src/controls/file/video/FileVideoExportPanel.ts","../../src/renderers/FileDetail.ts","../../src/renderers/FileThumbnail.ts","../../src/iifeCatalog.ts","../../src/index.export.ts"],"sourcesContent":["export const numberRangeConverter = (\n    emptyValue: number,\n    min: number,\n    max: number\n) => {\n\n    const fromAttribute = (value: unknown) => {\n        if (\n            value === undefined \n            || value === null\n            || ( \n                typeof value === \"string\"\n                || typeof value === \"number\"\n            )\n        ) {\n            return emptyValue;\n        }\n\n        const valueNumber = Number(value);\n\n        if (isNaN(valueNumber)) {\n            return emptyValue;\n        }\n\n        if (valueNumber < min) {\n            return min;\n        }\n\n        if (valueNumber > max) {\n            return max;\n        }\n\n        return valueNumber;\n\n    }\n\n    const toAttribute = (value: number) => {\n        return String(value);\n    }\n\n    return {\n        fromAttribute,\n        toAttribute\n    }\n\n}","/**\n * \n * @deprecated Use the recommended boolean conventions by LIT.\n */\nexport const booleanConverter = (\n    emptyValue: boolean\n) => {\n\n    const fromAttribute = (\n        value: string|null\n    ) => {\n\n        if ( \n            value === undefined \n            || value === null\n            || value?.trim().length === 0 \n        ) {\n            return emptyValue;\n        }\n\n        return value === \"true\";\n\n    }\n\n    const toAttribute = (\n        value: boolean\n    ) => {\n        if ( value === true ) {\n            return \"true\";\n        }\n        return \"false\";\n    }\n\n    return {\n        fromAttribute,\n        toAttribute\n    }\n\n}","import type { AvailableThermalPalette} from \"@labirthermal/core\";\nimport { ThermalPalettes } from \"@labirthermal/core\";\n\n/** A unified converter for thermal palettes. Recommended usage:\n * @example\n * ```ts\n * import { paletteConverter } from \"path/to/paletteConverter\";\n * class MyComponent extends LitElement {\n *      @property({\n *          type: String,\n *          reflect: true,\n *          converter: paletteConverter,\n *      })\n *      public palette: AvailableThermalPalette = \"jet\";\n * }\n * ```\n *\n * Empty or invalid values fall back to `jet`, the default palette of the core manager.\n */\nexport const paletteConverter = {\n    fromAttribute: (value: unknown): AvailableThermalPalette => {\n        if ( \n            value === undefined\n            || value === null\n            || typeof value !== \"string\"\n            || value === \"\"\n            || !(value in ThermalPalettes)\n        ) {\n            return \"jet\";\n        }\n        return value as AvailableThermalPalette\n    },\n    toAttribute: (value: AvailableThermalPalette): string => value as string,\n};","export const stringOrUndefinedConverter = {\n\n    fromAttribute(value: unknown): string | undefined {\n        // All except strings is undefined\n        if ( typeof value !== \"string\" ) {\n            return undefined;\n        }\n        // Too short strings are undefined\n        const trimmed = (value as string ).trim();\n        if ( trimmed.length === 0 ) {\n            return undefined;\n        }\n        return trimmed;\n    },\n\n    toAttribute(value: string | undefined): string | undefined {\n        const trimmed = value?.trim();\n        return trimmed?.length ? trimmed : undefined;\n    }\n\n}","/** Converts a duration property indicated as string to millis and back */\nexport const durationConverter = {\n    fromAttribute: (value: string | null): number | undefined => {\n\n        if (value) {\n            const parts = value.split(':').map(Number);\n\n            if (parts.some(isNaN)) return undefined;\n\n            if (parts.length === 3) {\n                // Formát MM:SS:MS\n                const [minutes, seconds, milliseconds] = parts;\n                return minutes * 60000 + seconds * 1000 + milliseconds;\n            } else if (parts.length === 4) {\n                // Formát HH:MM:SS:MS\n                const [hours, minutes, seconds, milliseconds] = parts;\n                return hours * 3600000 + minutes * 60000 + seconds * 1000 + milliseconds;\n            }\n        }\n\n        return undefined;\n    },\n    toAttribute: (value: number | undefined): string | undefined => {\n\n        if (value !== undefined) {\n            const hours = Math.floor(value / 3600000);\n            const minutes = Math.floor((value % 3600000) / 60000);\n            const seconds = Math.floor((value % 60000) / 1000);\n            const milliseconds = value % 1000;\n\n            const formattedSeconds = String(seconds).padStart(2, '0'); // 00-59\n            const formattedMilliseconds = String(milliseconds).padStart(3, '0'); // 000-999\n\n            if (hours > 0) {\n                return `${hours}:${minutes}:${formattedSeconds}:${formattedMilliseconds}`;\n            }\n\n            return `${minutes}:${formattedSeconds}:${formattedMilliseconds}`;\n        }\n\n        return undefined;\n    }\n}","import { ThermalUnit } from \"@labirthermal/core\";\n\n/**\n * Normalize any value to a `ThermalUnit` key. The comparison is case-insensitive\n * and surrounding whitespace is ignored, so `\"f\"` and `\" F \"` both give `ThermalUnit.F`.\n *\n * @returns The unit key, or `undefined` when the value is missing or not a known unit.\n */\nexport const parseThermalUnit = (value: unknown): ThermalUnit | undefined => {\n    if (typeof value !== \"string\") {\n        return undefined;\n    }\n    const normalized = value.trim().toUpperCase();\n    return normalized in ThermalUnit\n        ? normalized as ThermalUnit\n        : undefined;\n}\n\n/**\n * A unified converter for the `unit` attribute.\n *\n * A missing or invalid attribute gives `undefined` (not a default unit), so that\n * the consumer can distinguish \"not set\" from an explicit value and pick the\n * default itself, for example by taking over the unit of an existing manager.\n *\n * @example\n * ```ts\n * @property({ type: String, reflect: true, converter: unitConverter })\n * public unit?: ThermalUnit;\n * ```\n */\nexport const unitConverter = {\n    fromAttribute: (value: string | null): ThermalUnit | undefined => parseThermalUnit(value),\n    toAttribute: (value: ThermalUnit | undefined): string | undefined => parseThermalUnit(value),\n};\n","/**\n * Converter for optional numeric attributes.\n *\n * Unlike Lit's built-in `type: Number`, which turns a removed attribute into\n * `null`, an empty attribute into `0` and an invalid one into `NaN`, this\n * converter gives `undefined` for all of them. A property value that is not a\n * finite number removes the reflected attribute.\n *\n * @example\n * ```ts\n * @property({ reflect: true, converter: optionalNumberConverter })\n * public from?: number;\n * ```\n */\nexport const optionalNumberConverter = {\n\n    fromAttribute(value: string | null): number | undefined {\n        if (typeof value !== \"string\") {\n            return undefined;\n        }\n        const trimmed = value.trim();\n        if (trimmed.length === 0) {\n            return undefined;\n        }\n        const parsed = Number(trimmed);\n        return Number.isFinite(parsed) ? parsed : undefined;\n    },\n\n    toAttribute(value: number | undefined): string | undefined {\n        return typeof value === \"number\" && Number.isFinite(value)\n            ? String(value)\n            : undefined;\n    }\n\n}\n","const contrastColors = new Map<string, \"#000000\" | \"#FFFFFF\">();\n\n/** Choose the higher WCAG contrast against an opaque CSS background color. */\nexport function getContrastColor(backgroundColor: string): \"#000000\" | \"#FFFFFF\" {\n    const cached = contrastColors.get(backgroundColor);\n    if (cached) {\n        return cached;\n    }\n\n    const probe = document.createElement(\"span\");\n    probe.style.color = backgroundColor;\n    if (!probe.style.color) {\n        throw new Error(`Invalid background color: ${backgroundColor}`);\n    }\n    probe.style.display = \"none\";\n    document.body.append(probe);\n    const normalized = getComputedStyle(probe).color;\n    probe.remove();\n\n    const match = normalized.match(/^rgba?\\(([\\d.]+),\\s*([\\d.]+),\\s*([\\d.]+)(?:,\\s*([\\d.]+))?\\)$/);\n    if (!match || (match[4] !== undefined && Number(match[4]) !== 1)) {\n        throw new Error(`Expected an opaque RGB background color: ${backgroundColor}`);\n    }\n\n    const linear = [Number(match[1]), Number(match[2]), Number(match[3])].map(channel => {\n        const srgb = channel / 255;\n        return srgb <= .04045 ? srgb / 12.92 : ((srgb + .055) / 1.055) ** 2.4;\n    });\n    const luminance = .2126 * linear[0] + .7152 * linear[1] + .0722 * linear[2];\n    const blackContrast = (luminance + .05) / .05;\n    const whiteContrast = 1.05 / (luminance + .05);\n    const result = blackContrast >= whiteContrast ? \"#000000\" : \"#FFFFFF\";\n    contrastColors.set(backgroundColor, result);\n    return result;\n}\n","import { html } from \"lit\";\n\n/**\n * Definice SVG ikon s jejich variantami\n * Každá ikona může mít více variant (outline, solid, mini, micro)\n * Použití: přidejte novou ikonu s jejími variantami zde\n */\nconst svg = {\n\n    lock: {\n        micro: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"currentColor\" class=\"size-4\">\n  <path fill-rule=\"evenodd\" d=\"M8 1a3.5 3.5 0 0 0-3.5 3.5V7A1.5 1.5 0 0 0 3 8.5v5A1.5 1.5 0 0 0 4.5 15h7a1.5 1.5 0 0 0 1.5-1.5v-5A1.5 1.5 0 0 0 11.5 7V4.5A3.5 3.5 0 0 0 8 1Zm2 6V4.5a2 2 0 1 0-4 0V7h4Z\" clip-rule=\"evenodd\" />\n</svg>\n`\n    },\n\n    document: {\n        outline: `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"size-6\">\n  <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z\" />\n</svg>`\n    },\n\n    eye: {\n        solid: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" class=\"size-6\">\n            <path d=\"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z\" />\n                <path fill-rule=\"evenodd\" d=\"M1.323 11.447C2.811 6.976 7.028 3.75 12.001 3.75c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113-1.487 4.471-5.705 7.697-10.677 7.697-4.97 0-9.186-3.223-10.675-7.69a1.762 1.762 0 0 1 0-1.113ZM17.25 12a5.25 5.25 0 1 1-10.5 0 5.25 5.25 0 0 1 10.5 0Z\" clip-rule=\"evenodd\" />\n        </svg>`\n    },\n\n    play: {\n        solid: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" class=\"size-6\">\n            <path fill-rule=\"evenodd\" d=\"M4.5 5.653c0-1.427 1.529-2.33 2.779-1.643l11.54 6.347c1.295.712 1.295 2.573 0 3.286L7.28 19.99c-1.25.687-2.779-.217-2.779-1.643V5.653Z\" clip-rule=\"evenodd\" />\n        </svg>`\n    },\n\n    pause: {\n        solid: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" class=\"size-6\">\n            <path fill-rule=\"evenodd\" d=\"M6.75 5.25a.75.75 0 0 1 .75-.75H9a.75.75 0 0 1 .75.75v13.5a.75.75 0 0 1-.75.75H7.5a.75.75 0 0 1-.75-.75V5.25Zm7.5 0A.75.75 0 0 1 15 4.5h1.5a.75.75 0 0 1 .75.75v13.5a.75.75 0 0 1-.75.75H15a.75.75 0 0 1-.75-.75V5.25Z\" clip-rule=\"evenodd\" />\n        </svg>`\n    },\n\n    info: {\n        mini: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" class=\"size-5\">\n            <path fill-rule=\"evenodd\" d=\"M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-7-4a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM9 9a.75.75 0 0 0 0 1.5h.253a.25.25 0 0 1 .244.304l-.459 2.066A1.75 1.75 0 0 0 10.747 15H11a.75.75 0 0 0 0-1.5h-.253a.25.25 0 0 1-.244-.304l.459-2.066A1.75 1.75 0 0 0 9.253 9H9Z\" clip-rule=\"evenodd\" />\n        </svg>`,\n        solid: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" class=\"size-6\">\n            <path fill-rule=\"evenodd\" d=\"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm8.706-1.442c1.146-.573 2.437.463 2.126 1.706l-.709 2.836.042-.02a.75.75 0 0 1 .67 1.34l-.04.022c-1.147.573-2.438-.463-2.127-1.706l.71-2.836-.042.02a.75.75 0 1 1-.671-1.34l.041-.022ZM12 9a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z\" clip-rule=\"evenodd\" />\n        </svg>`,\n        outline: `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"size-6\">\n  <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z\" />\n</svg>`\n    },\n\n    settings: {\n        solid: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" class=\"size-6\">\n  <path fill-rule=\"evenodd\" d=\"M11.078 2.25c-.917 0-1.699.663-1.85 1.567L9.05 4.889c-.02.12-.115.26-.297.348a7.493 7.493 0 0 0-.986.57c-.166.115-.334.126-.45.083L6.3 5.508a1.875 1.875 0 0 0-2.282.819l-.922 1.597a1.875 1.875 0 0 0 .432 2.385l.84.692c.095.078.17.229.154.43a7.598 7.598 0 0 0 0 1.139c.015.2-.059.352-.153.43l-.841.692a1.875 1.875 0 0 0-.432 2.385l.922 1.597a1.875 1.875 0 0 0 2.282.818l1.019-.382c.115-.043.283-.031.45.082.312.214.641.405.985.57.182.088.277.228.297.35l.178 1.071c.151.904.933 1.567 1.85 1.567h1.844c.916 0 1.699-.663 1.85-1.567l.178-1.072c.02-.12.114-.26.297-.349.344-.165.673-.356.985-.57.167-.114.335-.125.45-.082l1.02.382a1.875 1.875 0 0 0 2.28-.819l.923-1.597a1.875 1.875 0 0 0-.432-2.385l-.84-.692c-.095-.078-.17-.229-.154-.43a7.614 7.614 0 0 0 0-1.139c-.016-.2.059-.352.153-.43l.84-.692c.708-.582.891-1.59.433-2.385l-.922-1.597a1.875 1.875 0 0 0-2.282-.818l-1.02.382c-.114.043-.282.031-.449-.083a7.49 7.49 0 0 0-.985-.57c-.183-.087-.277-.227-.297-.348l-.179-1.072a1.875 1.875 0 0 0-1.85-1.567h-1.843ZM12 15.75a3.75 3.75 0 1 0 0-7.5 3.75 3.75 0 0 0 0 7.5Z\" clip-rule=\"evenodd\" />\n</svg>`,\n        outline: `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"size-6\">\n  <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z\" />\n  <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z\" />\n</svg>\n`\n    },\n\n    back: {\n        micro: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"currentColor\" class=\"size-4\">\n  <path fill-rule=\"evenodd\" d=\"M12.5 9.75A2.75 2.75 0 0 0 9.75 7H4.56l2.22 2.22a.75.75 0 1 1-1.06 1.06l-3.5-3.5a.75.75 0 0 1 0-1.06l3.5-3.5a.75.75 0 0 1 1.06 1.06L4.56 5.5h5.19a4.25 4.25 0 0 1 0 8.5h-1a.75.75 0 0 1 0-1.5h1a2.75 2.75 0 0 0 2.75-2.75Z\" clip-rule=\"evenodd\" />\n</svg>`\n    },\n\n    share: {\n        outline: `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"size-6\">\n            <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M7.217 10.907a2.25 2.25 0 1 0 0 2.186m0-2.186c.18.324.283.696.283 1.093s-.103.77-.283 1.093m0-2.186 9.566-5.314m-9.566 7.5 9.566 5.314m0 0a2.25 2.25 0 1 0 3.935 2.186 2.25 2.25 0 0 0-3.935-2.186Zm0-12.814a2.25 2.25 0 1 0 3.933-2.185 2.25 2.25 0 0 0-3.933 2.185Z\" />\n        </svg>`,\n        micro: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"currentColor\" class=\"size-4\">\n            <path d=\"M12 6a2 2 0 1 0-1.994-1.842L5.323 6.5a2 2 0 1 0 0 3l4.683 2.342a2 2 0 1 0 .67-1.342L5.995 8.158a2.03 2.03 0 0 0 0-.316L10.677 5.5c.353.311.816.5 1.323.5Z\" />\n        </svg>`,\n        mini: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" class=\"size-5\">\n            <path d=\"M13 4.5a2.5 2.5 0 1 1 .702 1.737L6.97 9.604a2.518 2.518 0 0 1 0 .792l6.733 3.367a2.5 2.5 0 1 1-.671 1.341l-6.733-3.367a2.5 2.5 0 1 1 0-3.475l6.733-3.366A2.52 2.52 0 0 1 13 4.5Z\" />\n        </svg>`\n    },\n    folder: {\n        outline: `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"size-6\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z\" /></svg>`,\n        micro: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"currentColor\" class=\"size-4\">\n        <path d=\"M2 3.5A1.5 1.5 0 0 1 3.5 2h2.879a1.5 1.5 0 0 1 1.06.44l1.122 1.12A1.5 1.5 0 0 0 9.62 4H12.5A1.5 1.5 0 0 1 14 5.5v1.401a2.986 2.986 0 0 0-1.5-.401h-9c-.546 0-1.059.146-1.5.401V3.5ZM2 9.5v3A1.5 1.5 0 0 0 3.5 14h9a1.5 1.5 0 0 0 1.5-1.5v-3A1.5 1.5 0 0 0 12.5 8h-9A1.5 1.5 0 0 0 2 9.5Z\" />\n        </svg>`\n    },\n    wifi: {\n        micro: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"currentColor\" class=\"size-4\">\n            <path fill-rule=\"evenodd\" d=\"M14.188 7.063a8.75 8.75 0 0 0-12.374 0 .75.75 0 0 1-1.061-1.06c4.003-4.004 10.493-4.004 14.496 0a.75.75 0 1 1-1.061 1.06Zm-2.121 2.121a5.75 5.75 0 0 0-8.132 0 .75.75 0 0 1-1.06-1.06 7.25 7.25 0 0 1 10.252 0 .75.75 0 0 1-1.06 1.06Zm-2.122 2.122a2.75 2.75 0 0 0-3.889 0 .75.75 0 1 1-1.06-1.061 4.25 4.25 0 0 1 6.01 0 .75.75 0 0 1-1.06 1.06Zm-2.828 1.06a1.25 1.25 0 0 1 1.768 0 .75.75 0 0 1 0 1.06l-.355.355a.75.75 0 0 1-1.06 0l-.354-.354a.75.75 0 0 1 0-1.06Z\" clip-rule=\"evenodd\" />\n        </svg>`\n    },\n    user: {\n        micro: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"currentColor\" class=\"size-4\">\n        <path fill-rule=\"evenodd\" d=\"M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0Zm-5-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM8 9c-1.825 0-3.422.977-4.295 2.437A5.49 5.49 0 0 0 8 13.5a5.49 5.49 0 0 0 4.294-2.063A4.997 4.997 0 0 0 8 9Z\" clip-rule=\"evenodd\" />\n        </svg>`\n    },\n    image: {\n        outline: `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"size-6\">\n        <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5Zm10.5-11.25h.008v.008h-.008V8.25Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z\" />\n        </svg>`,\n        micro: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"currentColor\" class=\"size-4\">\n        <path fill-rule=\"evenodd\" d=\"M2 4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4Zm10.5 5.707a.5.5 0 0 0-.146-.353l-1-1a.5.5 0 0 0-.708 0L9.354 9.646a.5.5 0 0 1-.708 0L6.354 7.354a.5.5 0 0 0-.708 0l-2 2a.5.5 0 0 0-.146.353V12a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5V9.707ZM12 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\" clip-rule=\"evenodd\" />\n        </svg>`\n    },\n    upwards: {\n        outline: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" class=\"size-6\">\n        <path fill-rule=\"evenodd\" d=\"M20.24 20.249a.75.75 0 0 0-.75-.75H8.989V5.56l2.47 2.47a.75.75 0 0 0 1.06-1.061l-3.75-3.75a.75.75 0 0 0-1.06 0l-3.75 3.75a.75.75 0 1 0 1.06 1.06l2.47-2.469V20.25c0 .414.335.75.75.75h11.25a.75.75 0 0 0 .75-.75Z\" clip-rule=\"evenodd\" />\n        </svg>`\n    },\n    copy: {\n        outline: `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"size-6\">\n            <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75\" />\n        </svg>`,\n        mini: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" class=\"size-5\">\n            <path d=\"M7 3.5A1.5 1.5 0 0 1 8.5 2h3.879a1.5 1.5 0 0 1 1.06.44l3.122 3.12A1.5 1.5 0 0 1 17 6.622V12.5a1.5 1.5 0 0 1-1.5 1.5h-1v-3.379a3 3 0 0 0-.879-2.121L10.5 5.379A3 3 0 0 0 8.379 4.5H7v-1Z\" />\n            <path d=\"M4.5 6A1.5 1.5 0 0 0 3 7.5v9A1.5 1.5 0 0 0 4.5 18h7a1.5 1.5 0 0 0 1.5-1.5v-5.879a1.5 1.5 0 0 0-.44-1.06L9.44 6.439A1.5 1.5 0 0 0 8.378 6H4.5Z\" />\n        </svg>`,\n    },\n    right: {\n        outline: `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"size-6\">\n            <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3\" />\n        </svg>`,\n        micro: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"currentColor\" class=\"size-4\">\n            <path fill-rule=\"evenodd\" d=\"M2 8a.75.75 0 0 1 .75-.75h8.69L8.22 4.03a.75.75 0 0 1 1.06-1.06l4.5 4.5a.75.75 0 0 1 0 1.06l-4.5 4.5a.75.75 0 0 1-1.06-1.06l3.22-3.22H2.75A.75.75 0 0 1 2 8Z\" clip-rule=\"evenodd\" />\n        </svg>`\n    },\n    trash: {\n        micro: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"currentColor\" class=\"size-4\">\n            <path fill-rule=\"evenodd\" d=\"M5 3.25V4H2.75a.75.75 0 0 0 0 1.5h.3l.815 8.15A1.5 1.5 0 0 0 5.357 15h5.285a1.5 1.5 0 0 0 1.493-1.35l.815-8.15h.3a.75.75 0 0 0 0-1.5H11v-.75A2.25 2.25 0 0 0 8.75 1h-1.5A2.25 2.25 0 0 0 5 3.25Zm2.25-.75a.75.75 0 0 0-.75.75V4h3v-.75a.75.75 0 0 0-.75-.75h-1.5ZM6.05 6a.75.75 0 0 1 .787.713l.275 5.5a.75.75 0 0 1-1.498.075l-.275-5.5A.75.75 0 0 1 6.05 6Zm3.9 0a.75.75 0 0 1 .712.787l-.275 5.5a.75.75 0 0 1-1.498-.075l.275-5.5a.75.75 0 0 1 .786-.711Z\" clip-rule=\"evenodd\" />\n        </svg>`\n    },\n    addfolder: {\n        micro: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"currentColor\" class=\"size-4\">\n        <path fill-rule=\"evenodd\" d=\"M3.5 2A1.5 1.5 0 0 0 2 3.5v9A1.5 1.5 0 0 0 3.5 14h9a1.5 1.5 0 0 0 1.5-1.5v-7A1.5 1.5 0 0 0 12.5 4H9.621a1.5 1.5 0 0 1-1.06-.44L7.439 2.44A1.5 1.5 0 0 0 6.38 2H3.5ZM8 6a.75.75 0 0 1 .75.75v1.5h1.5a.75.75 0 0 1 0 1.5h-1.5v1.5a.75.75 0 0 1-1.5 0v-1.5h-1.5a.75.75 0 0 1 0-1.5h1.5v-1.5A.75.75 0 0 1 8 6Z\" clip-rule=\"evenodd\" />\n        </svg>`\n    },\n    upload: {\n        micro: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"currentColor\" class=\"size-4\">\n            <path d=\"M7.25 10.25a.75.75 0 0 0 1.5 0V4.56l2.22 2.22a.75.75 0 1 0 1.06-1.06l-3.5-3.5a.75.75 0 0 0-1.06 0l-3.5 3.5a.75.75 0 0 0 1.06 1.06l2.22-2.22v5.69Z\" />\n            <path d=\"M3.5 9.75a.75.75 0 0 0-1.5 0v1.5A2.75 2.75 0 0 0 4.75 14h6.5A2.75 2.75 0 0 0 14 11.25v-1.5a.75.75 0 0 0-1.5 0v1.5c0 .69-.56 1.25-1.25 1.25h-6.5c-.69 0-1.25-.56-1.25-1.25v-1.5Z\" />\n        </svg>`\n    },\n    clock: {\n        outline: `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"size-6\">\n  <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z\" />\n</svg>`,\n    },\n    close: {\n        outline: `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"size-6\">\n            <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M6 18 18 6M6 6l12 12\" />\n        </svg>`,\n        micro: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"currentColor\" class=\"size-4\">\n        <path d=\"M5.28 4.22a.75.75 0 0 0-1.06 1.06L6.94 8l-2.72 2.72a.75.75 0 1 0 1.06 1.06L8 9.06l2.72 2.72a.75.75 0 1 0 1.06-1.06L9.06 8l2.72-2.72a.75.75 0 0 0-1.06-1.06L8 6.94 5.28 4.22Z\" />\n        </svg>`\n    },\n    edit: {\n        micro: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"currentColor\" class=\"size-4\">\n        <path d=\"M13.488 2.513a1.75 1.75 0 0 0-2.475 0L6.75 6.774a2.75 2.75 0 0 0-.596.892l-.848 2.047a.75.75 0 0 0 .98.98l2.047-.848a2.75 2.75 0 0 0 .892-.596l4.261-4.262a1.75 1.75 0 0 0 0-2.474Z\" />\n        <path d=\"M4.75 3.5c-.69 0-1.25.56-1.25 1.25v6.5c0 .69.56 1.25 1.25 1.25h6.5c.69 0 1.25-.56 1.25-1.25V9A.75.75 0 0 1 14 9v2.25A2.75 2.75 0 0 1 11.25 14h-6.5A2.75 2.75 0 0 1 2 11.25v-6.5A2.75 2.75 0 0 1 4.75 2H7a.75.75 0 0 1 0 1.5H4.75Z\" />\n        </svg>`\n    },\n    comment: {\n\n        micro: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"currentColor\" class=\"size-4\">\n            <path fill-rule=\"evenodd\" d=\"M1 8.74c0 .983.713 1.825 1.69 1.943.904.108 1.817.19 2.737.243.363.02.688.231.85.556l1.052 2.103a.75.75 0 0 0 1.342 0l1.052-2.103c.162-.325.487-.535.85-.556.92-.053 1.833-.134 2.738-.243.976-.118 1.689-.96 1.689-1.942V4.259c0-.982-.713-1.824-1.69-1.942a44.45 44.45 0 0 0-10.62 0C1.712 2.435 1 3.277 1 4.26v4.482Zm3-3.49a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5A.75.75 0 0 1 4 5.25ZM4.75 7a.75.75 0 0 0 0 1.5h2.5a.75.75 0 0 0 0-1.5h-2.5Z\" clip-rule=\"evenodd\" />\n        </svg>`\n\n    },\n    grid: {\n\n        solid: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" class=\"size-6\">\n            <path fill-rule=\"evenodd\" d=\"M3 6a3 3 0 0 1 3-3h2.25a3 3 0 0 1 3 3v2.25a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6Zm9.75 0a3 3 0 0 1 3-3H18a3 3 0 0 1 3 3v2.25a3 3 0 0 1-3 3h-2.25a3 3 0 0 1-3-3V6ZM3 15.75a3 3 0 0 1 3-3h2.25a3 3 0 0 1 3 3V18a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3v-2.25Zm9.75 0a3 3 0 0 1 3-3H18a3 3 0 0 1 3 3V18a3 3 0 0 1-3 3h-2.25a3 3 0 0 1-3-3v-2.25Z\" clip-rule=\"evenodd\" />\n        </svg>`,\n        micro: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"currentColor\" class=\"size-4\">\n            <path d=\"M3.5 2A1.5 1.5 0 0 0 2 3.5v2A1.5 1.5 0 0 0 3.5 7h2A1.5 1.5 0 0 0 7 5.5v-2A1.5 1.5 0 0 0 5.5 2h-2ZM3.5 9A1.5 1.5 0 0 0 2 10.5v2A1.5 1.5 0 0 0 3.5 14h2A1.5 1.5 0 0 0 7 12.5v-2A1.5 1.5 0 0 0 5.5 9h-2ZM9 3.5A1.5 1.5 0 0 1 10.5 2h2A1.5 1.5 0 0 1 14 3.5v2A1.5 1.5 0 0 1 12.5 7h-2A1.5 1.5 0 0 1 9 5.5v-2ZM10.5 9A1.5 1.5 0 0 0 9 10.5v2a1.5 1.5 0 0 0 1.5 1.5h2a1.5 1.5 0 0 0 1.5-1.5v-2A1.5 1.5 0 0 0 12.5 9h-2Z\" />\n        </svg>`\n\n    },\n\n    list: {\n\n        solid: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" class=\"size-6\">\n            <path fill-rule=\"evenodd\" d=\"M2.625 6.75a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0Zm4.875 0A.75.75 0 0 1 8.25 6h12a.75.75 0 0 1 0 1.5h-12a.75.75 0 0 1-.75-.75ZM2.625 12a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0ZM7.5 12a.75.75 0 0 1 .75-.75h12a.75.75 0 0 1 0 1.5h-12A.75.75 0 0 1 7.5 12Zm-4.875 5.25a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0Zm4.875 0a.75.75 0 0 1 .75-.75h12a.75.75 0 0 1 0 1.5h-12a.75.75 0 0 1-.75-.75Z\" clip-rule=\"evenodd\" />\n        </svg>`,\n        micro: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"currentColor\" class=\"size-4\">\n            <path d=\"M3 4.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM6.25 3a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5h-7ZM6.25 7.25a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5h-7ZM6.25 11.5a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5h-7ZM4 12.25a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM3 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z\" />\n        </svg>`\n\n    },\n    check: {\n        micro: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"currentColor\" class=\"size-4\">\n            <path fill-rule=\"evenodd\" d=\"M12.416 3.376a.75.75 0 0 1 .208 1.04l-5 7.5a.75.75 0 0 1-1.154.114l-3-3a.75.75 0 0 1 1.06-1.06l2.353 2.353 4.493-6.74a.75.75 0 0 1 1.04-.207Z\" clip-rule=\"evenodd\" />\n        </svg>`\n    },\n    \"check-circle\": {\n        micro: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"currentColor\" class=\"size-4\">\n  <path fill-rule=\"evenodd\" d=\"M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14Zm3.844-8.791a.75.75 0 0 0-1.188-.918l-3.7 4.79-1.649-1.833a.75.75 0 1 0-1.114 1.004l2.25 2.5a.75.75 0 0 0 1.15-.043l4.25-5.5Z\" clip-rule=\"evenodd\" />\n</svg>`\n    },\n    \"circle-dots\": {\n        micro: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"currentColor\" class=\"size-4\">\n  <path fill-rule=\"evenodd\" d=\"M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0ZM8 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM5.5 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm6 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z\" clip-rule=\"evenodd\" />\n</svg>`\n    },\n    save: {\n        outline: `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"size-6\">\n            <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M5 3h11l3 3v13H5V3Z\" />\n            <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M7 3v4h8V3M7 10h10M7 12h8\" />\n            <circle cx=\"17\" cy=\"15\" r=\"1.5\" stroke=\"currentColor\" fill=\"none\" />\n        </svg>`,\n        micro: `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"currentColor\" viewBox=\"0 0 16 16\" class=\"size-4\">\n            <path d=\"M2 2h9l3 3v8H2V2Zm2 1v3h6V3H4Zm0 4h8v1H4V7Zm0 2h6v1H4V9Zm8 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z\" />\n        </svg>`\n    },\n    restore: {\n        outline: `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"size-6\">\n            <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 15 3 9m0 0 6-6M3 9h12a6 6 0 0 1 0 12h-3\" />\n        </svg>`,\n        micro: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"currentColor\" className=\"size-4\">\n  <path fillRule=\"evenodd\" d=\"M6.25 12.5A2.75 2.75 0 0 0 9 9.75V4.56L6.78 6.78a.75.75 0 0 1-1.06-1.06l3.5-3.5a.75.75 0 0 1 1.06 0l3.5 3.5a.75.75 0 0 1-1.06 1.06L10.5 4.56v5.19a4.25 4.25 0 0 1-8.5 0v-1a.75.75 0 0 1 1.5 0v1a2.75 2.75 0 0 0 2.75 2.75Z\" clipRule=\"evenodd\" />\n</svg>`\n    },\n    unlink: {\n        outline: `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"size-6\">\n            <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M13.181 8.68a4.503 4.503 0 0 1 1.903 6.405m-9.768-2.782L3.56 14.06a4.5 4.5 0 0 0 6.364 6.365l3.129-3.129m5.614-5.615 1.757-1.757a4.5 4.5 0 0 0-6.364-6.365l-4.5 4.5c-.258.26-.479.541-.661.84m1.903 6.405a4.495 4.495 0 0 1-1.242-.88 4.483 4.483 0 0 1-1.062-1.683m6.587 2.345 5.907 5.907m-5.907-5.907L8.898 8.898M2.991 2.99 8.898 8.9\" />\n        </svg>`,\n        micro: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" class=\"size-5\">\n            <path fill-rule=\"evenodd\" d=\"M2.22 2.22a.75.75 0 0 1 1.06 0l4.46 4.46c.128-.178.272-.349.432-.508l3-3a4 4 0 0 1 5.657 5.656l-1.225 1.225a.75.75 0 1 1-1.06-1.06l1.224-1.225a2.5 2.5 0 0 0-3.536-3.536l-3 3a2.504 2.504 0 0 0-.406.533l2.59 2.59a2.49 2.49 0 0 0-.79-1.254.75.75 0 1 1 .977-1.138 3.997 3.997 0 0 1 1.306 3.886l4.871 4.87a.75.75 0 1 1-1.06 1.061l-5.177-5.177-.006-.005-4.134-4.134a.65.65 0 0 1-.005-.006L2.22 3.28a.75.75 0 0 1 0-1.06Zm3.237 7.727a.75.75 0 0 1 0 1.06l-1.225 1.225a2.5 2.5 0 0 0 3.536 3.536l1.879-1.879a.75.75 0 1 1 1.06 1.06L8.83 16.83a4 4 0 0 1-5.657-5.657l1.224-1.225a.75.75 0 0 1 1.06 0Z\" clip-rule=\"evenodd\" />\n        </svg>`\n    },\n    link: {\n        outline: `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"size-6\">\n            <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244\" />\n        </svg>`,\n        micro: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" class=\"size-5\">\n            <path d=\"M12.232 4.232a2.5 2.5 0 0 1 3.536 3.536l-1.225 1.224a.75.75 0 0 0 1.061 1.06l1.224-1.224a4 4 0 0 0-5.656-5.656l-3 3a4 4 0 0 0 .225 5.865.75.75 0 0 0 .977-1.138 2.5 2.5 0 0 1-.142-3.667l3-3Z\" />\n            <path d=\"M11.603 7.963a.75.75 0 0 0-.977 1.138 2.5 2.5 0 0 1 .142 3.667l-3 3a2.5 2.5 0 0 1-3.536-3.536l1.225-1.224a.75.75 0 0 0-1.061-1.06l-1.224 1.224a4 4 0 1 0 5.656 5.656l3-3a4 4 0 0 0-.225-5.865Z\" />\n        </svg>`\n    },\n    zoom: {\n        outline: `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"size-6\">\n            <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607ZM10.5 7.5v6m3-3h-6\" />\n        </svg>`,\n        micro: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"currentColor\" class=\"size-4\">\n            <path d=\"M6.25 8.75v-1h-1a.75.75 0 0 1 0-1.5h1v-1a.75.75 0 0 1 1.5 0v1h1a.75.75 0 0 1 0 1.5h-1v1a.75.75 0 0 1-1.5 0Z\" />\n            <path fill-rule=\"evenodd\" d=\"M7 12c1.11 0 2.136-.362 2.965-.974l2.755 2.754a.75.75 0 1 0 1.06-1.06l-2.754-2.755A5 5 0 1 0 7 12Zm0-1.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z\" clip-rule=\"evenodd\" />\n        </svg>`\n    },\n    adjustment: {\n        micro: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"currentColor\" class=\"size-4\">\n            <path d=\"M6.5 2.25a.75.75 0 0 0-1.5 0v3a.75.75 0 0 0 1.5 0V4.5h6.75a.75.75 0 0 0 0-1.5H6.5v-.75ZM11 6.5a.75.75 0 0 0-1.5 0v3a.75.75 0 0 0 1.5 0v-.75h2.25a.75.75 0 0 0 0-1.5H11V6.5ZM5.75 10a.75.75 0 0 1 .75.75v.75h6.75a.75.75 0 0 1 0 1.5H6.5v.75a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 .75-.75ZM2.75 7.25H8.5v1.5H2.75a.75.75 0 0 1 0-1.5ZM4 3H2.75a.75.75 0 0 0 0 1.5H4V3ZM2.75 11.5H4V13H2.75a.75.75 0 0 1 0-1.5Z\" />\n        </svg>`,\n        outline: `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"size-6\">\n            <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M10.5 6h9.75M10.5 6a1.5 1.5 0 1 1-3 0m3 0a1.5 1.5 0 1 0-3 0M3.75 6H7.5m3 12h9.75m-9.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-3.75 0H7.5m9-6h3.75m-3.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-9.75 0h9.75\" />\n        </svg>`\n    },\n    range: {\n        outline: `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"size-6\">\n            <g>\n                <line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\" stroke=\"currentColor\" stroke-width=\"1.5\"/>\n                <line x1=\"5\" y1=\"9\" x2=\"5\" y2=\"15\" stroke=\"currentColor\" stroke-width=\"2\"/>\n                <line x1=\"19\" y1=\"9\" x2=\"19\" y2=\"15\" stroke=\"currentColor\" stroke-width=\"2\"/>\n            </g>\n        </svg>`,\n        micro: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"none\" class=\"size-4\">\n            <g>\n                <line x1=\"3\" y1=\"8\" x2=\"13\" y2=\"8\" stroke=\"currentColor\" stroke-width=\"1\"/>\n                <line x1=\"3\" y1=\"6\" x2=\"3\" y2=\"10\" stroke=\"currentColor\" stroke-width=\"1.5\"/>\n                <line x1=\"13\" y1=\"6\" x2=\"13\" y2=\"10\" stroke=\"currentColor\" stroke-width=\"1.5\"/>\n            </g>\n        </svg>`,\n\n\n    },\n\n    bigger: {\n\n        mini: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" class=\"size-5\">\n  <path d=\"m13.28 7.78 3.22-3.22v2.69a.75.75 0 0 0 1.5 0v-4.5a.75.75 0 0 0-.75-.75h-4.5a.75.75 0 0 0 0 1.5h2.69l-3.22 3.22a.75.75 0 0 0 1.06 1.06ZM2 17.25v-4.5a.75.75 0 0 1 1.5 0v2.69l3.22-3.22a.75.75 0 0 1 1.06 1.06L4.56 16.5h2.69a.75.75 0 0 1 0 1.5h-4.5a.747.747 0 0 1-.75-.75ZM12.22 13.28l3.22 3.22h-2.69a.75.75 0 0 0 0 1.5h4.5a.747.747 0 0 0 .75-.75v-4.5a.75.75 0 0 0-1.5 0v2.69l-3.22-3.22a.75.75 0 1 0-1.06 1.06ZM3.5 4.56l3.22 3.22a.75.75 0 0 0 1.06-1.06L4.56 3.5h2.69a.75.75 0 0 0 0-1.5h-4.5a.75.75 0 0 0-.75.75v4.5a.75.75 0 0 0 1.5 0V4.56Z\" />\n</svg>\n`\n\n    },\n\n    smaller: {\n\n        mini: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" class=\"size-5\">\n  <path d=\"M3.28 2.22a.75.75 0 0 0-1.06 1.06L5.44 6.5H2.75a.75.75 0 0 0 0 1.5h4.5A.75.75 0 0 0 8 7.25v-4.5a.75.75 0 0 0-1.5 0v2.69L3.28 2.22ZM13.5 2.75a.75.75 0 0 0-1.5 0v4.5c0 .414.336.75.75.75h4.5a.75.75 0 0 0 0-1.5h-2.69l3.22-3.22a.75.75 0 0 0-1.06-1.06L13.5 5.44V2.75ZM3.28 17.78l3.22-3.22v2.69a.75.75 0 0 0 1.5 0v-4.5a.75.75 0 0 0-.75-.75h-4.5a.75.75 0 0 0 0 1.5h2.69l-3.22 3.22a.75.75 0 1 0 1.06 1.06ZM13.5 14.56l3.22 3.22a.75.75 0 1 0 1.06-1.06l-3.22-3.22h2.69a.75.75 0 0 0 0-1.5h-4.5a.75.75 0 0 0-.75.75v4.5a.75.75 0 0 0 1.5 0v-2.69Z\" />\n</svg>`\n\n    },\n\n    ellipsis: {\n\n        micro: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"currentColor\" class=\"size-4\">\n  <path d=\"M2 8a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0ZM6.5 8a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0ZM12.5 6.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z\" />\n</svg>`\n\n    },\n\n    download: {\n        micro: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"currentColor\" class=\"size-4\">\n  <path d=\"M8.75 2.75a.75.75 0 0 0-1.5 0v5.69L5.03 6.22a.75.75 0 0 0-1.06 1.06l3.5 3.5a.75.75 0 0 0 1.06 0l3.5-3.5a.75.75 0 0 0-1.06-1.06L8.75 8.44V2.75Z\" />\n  <path d=\"M3.5 9.75a.75.75 0 0 0-1.5 0v1.5A2.75 2.75 0 0 0 4.75 14h6.5A2.75 2.75 0 0 0 14 11.25v-1.5a.75.75 0 0 0-1.5 0v1.5c0 .69-.56 1.25-1.25 1.25h-6.5c-.69 0-1.25-.56-1.25-1.25v-1.5Z\" />\n</svg>`,\n        outline: `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"size-6\">\n  <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3\" />\n</svg>`\n    },\n    clipboard: {\n        outline: `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.8\" stroke=\"currentColor\" class=\"size-6\">\n  <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75 2.25 2.25 0 0 0-.1-.664m-5.8 0A2.251 2.251 0 0 1 13.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25ZM6.75 12h.008v.008H6.75V12Zm0 3h.008v.008H6.75V15Zm0 3h.008v.008H6.75V18Z\" />\n</svg>`\n    },\n    bulb: {\n        outline: `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"size-6\">\n  <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M12 18v-5.25m0 0a6.01 6.01 0 0 0 1.5-.189m-1.5.189a6.01 6.01 0 0 1-1.5-.189m3.75 7.478a12.06 12.06 0 0 1-4.5 0m3.75 2.383a14.406 14.406 0 0 1-3 0M14.25 18v-.192c0-.983.658-1.823 1.508-2.316a7.5 7.5 0 1 0-7.517 0c.85.493 1.509 1.333 1.509 2.316V18\" />\n</svg>`\n    },\n    reload: {\n        micro: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"currentColor\" class=\"size-4\">\n  <path fill-rule=\"evenodd\" d=\"M13.836 2.477a.75.75 0 0 1 .75.75v3.182a.75.75 0 0 1-.75.75h-3.182a.75.75 0 0 1 0-1.5h1.37l-.84-.841a4.5 4.5 0 0 0-7.08.932.75.75 0 0 1-1.3-.75 6 6 0 0 1 9.44-1.242l.842.84V3.227a.75.75 0 0 1 .75-.75Zm-.911 7.5A.75.75 0 0 1 13.199 11a6 6 0 0 1-9.44 1.241l-.84-.84v1.371a.75.75 0 0 1-1.5 0V9.591a.75.75 0 0 1 .75-.75H5.35a.75.75 0 0 1 0 1.5H3.98l.841.841a4.5 4.5 0 0 0 7.08-.932.75.75 0 0 1 1.025-.273Z\" clip-rule=\"evenodd\" />\n</svg>`\n    },\n    warning: {\n        outline: `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"size-6\">\n  <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z\" />\n</svg>`\n    },\n\n    move: {\n        mini: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" class=\"size-5\">\n  <path fill-rule=\"evenodd\" d=\"M3 4.25A2.25 2.25 0 0 1 5.25 2h5.5A2.25 2.25 0 0 1 13 4.25v2a.75.75 0 0 1-1.5 0v-2a.75.75 0 0 0-.75-.75h-5.5a.75.75 0 0 0-.75.75v11.5c0 .414.336.75.75.75h5.5a.75.75 0 0 0 .75-.75v-2a.75.75 0 0 1 1.5 0v2A2.25 2.25 0 0 1 10.75 18h-5.5A2.25 2.25 0 0 1 3 15.75V4.25Z\" clip-rule=\"evenodd\" />\n  <path fill-rule=\"evenodd\" d=\"M6 10a.75.75 0 0 1 .75-.75h9.546l-1.048-.943a.75.75 0 1 1 1.004-1.114l2.5 2.25a.75.75 0 0 1 0 1.114l-2.5 2.25a.75.75 0 1 1-1.004-1.114l1.048-.943H6.75A.75.75 0 0 1 6 10Z\" clip-rule=\"evenodd\" />\n</svg>`\n    }\n\n\n\n} as const;\n\n// Typ pro dostupné varianty konkrétní ikony\ntype AvailableVariants<T extends keyof typeof svg> = keyof typeof svg[T];\n\n/**\n * Základní funkce pro vykreslení ikony\n * @param name - název ikony (např. 'folder')\n * @param variant - varianta ikony (např. 'outline')\n * @param className - CSS třídy pro přidání\n * @param styles - inline styly\n */\nexport const icon = <T extends keyof typeof svg>(\n    name: T,\n    variant: AvailableVariants<T>,\n    className?: string,\n    styles?: string\n) => {\n    const iconSvg = svg[name][variant] as string;\n\n    if (!iconSvg) {\n        console.warn(`Icon variant \"${String(variant)}\" not found for icon \"${String(name)}\"`);\n        return html``;\n    }\n\n    // Modifikace SVG - přidání CSS tříd a stylů\n    let modifiedSvg = iconSvg;\n\n    if (className || styles) {\n        // Pokud má SVG existující class atribut, přidej k němu\n        if (modifiedSvg.includes('class=\"')) {\n            modifiedSvg = modifiedSvg.replace(\n                /class=\"([^\"]*)\"/,\n                `class=\"$1 ${className || ''}\"`\n            );\n        } else {\n            // Pokud nemá class atribut, přidej ho do prvního SVG tagu\n            modifiedSvg = modifiedSvg.replace(\n                /<svg([^>]*)>/,\n                `<svg$1 class=\"${className || ''}\">`\n            );\n        }\n\n        // Přidej styles pokud jsou specifikované\n        if (styles) {\n            if (modifiedSvg.includes('style=\"')) {\n                modifiedSvg = modifiedSvg.replace(\n                    /style=\"([^\"]*)\"/,\n                    `style=\"$1; ${styles}\"`\n                );\n            } else {\n                modifiedSvg = modifiedSvg.replace(\n                    /<svg([^>]*)>/,\n                    `<svg$1 style=\"${styles}\">`\n                );\n            }\n        }\n    }\n\n    // Použij html literal pro bezpečné vložení SVG\n    return modifiedSvg;\n}\n\n/**\n * Automatické generování objektu ikon z definice svg\n * Vytváří strukturu: icons.nazevIkony.varianta(className?, styles?)\n */\nconst createIcons = () => {\n    const result = {} as any; // eslint-disable-line @typescript-eslint/no-explicit-any \n\n    // Iterace přes všechny ikony\n    for (const iconName in svg) {\n        const iconKey = iconName as keyof typeof svg;\n        result[iconKey] = {};\n\n        // Iterace přes všechny varianty ikony\n        const iconVariants = svg[iconKey];\n        for (const variant in iconVariants) {\n            // Vytvoření funkce pro každou kombinaci ikona-varianta\n            result[iconKey][variant] = (className?: string, styles?: string) => {\n                return icon(iconName as keyof typeof svg, variant as unknown as keyof typeof svg[typeof iconKey], className, styles);\n            };\n        }\n    }\n\n    return result;\n}\n\n/**\n * TypeScript typ pro automaticky generovaný objekt ikon\n * Zajišťuje typovou bezpečnost - pouze existující ikony a jejich varianty\n */\ntype IconsType = {\n    [K in keyof typeof svg]: {\n        [V in keyof typeof svg[K]]: (className?: string, styles?: string) => string\n    }\n};\n\n/**\n * Exportovaný objekt ikon s typovou bezpečností\n * Použití: icons.folder.outline(\"my-class\", \"color: red\")\n */\nconst icons = createIcons() as IconsType;\n\nexport default icons;\n\n// Příklad použití:\n// icons.folder.outline(\"text-blue-500\", \"width: 24px; height: 24px\")\n\n","const isString = obj => typeof obj === 'string';\nconst defer = () => {\n  let res;\n  let rej;\n  const promise = new Promise((resolve, reject) => {\n    res = resolve;\n    rej = reject;\n  });\n  promise.resolve = res;\n  promise.reject = rej;\n  return promise;\n};\nconst makeString = object => {\n  if (object == null) return '';\n  return String(object);\n};\nconst isSafeLanguageCode = code => isString(code) && /^[A-Za-z0-9_@.-]{1,128}$/.test(code) && !code.includes('..') && !['__proto__', 'constructor', 'prototype'].includes(code);\nconst callbackApiOf = plugin => plugin?.callbackApi ?? plugin?.constructor?.callbackApi;\nconst copy = (a, s, t) => {\n  a.forEach(m => {\n    if (s[m]) t[m] = s[m];\n  });\n};\nconst lastOfPathSeparatorRegExp = /###/g;\nconst cleanKey = key => key && key.includes('###') ? key.replace(lastOfPathSeparatorRegExp, '.') : key;\nconst canNotTraverseDeeper = object => !object || isString(object);\nconst getLastOfPath = (object, path, Empty) => {\n  const stack = !isString(path) ? path : path.split('.');\n  let stackIndex = 0;\n  while (stackIndex < stack.length - 1) {\n    if (canNotTraverseDeeper(object)) return {};\n    const key = cleanKey(stack[stackIndex]);\n    if (!object[key] && Empty) object[key] = new Empty();\n    if (Object.prototype.hasOwnProperty.call(object, key)) {\n      object = object[key];\n    } else {\n      object = {};\n    }\n    ++stackIndex;\n  }\n  if (canNotTraverseDeeper(object)) return {};\n  return {\n    obj: object,\n    k: cleanKey(stack[stackIndex])\n  };\n};\nconst setPath = (object, path, newValue) => {\n  const {\n    obj,\n    k\n  } = getLastOfPath(object, path, Object);\n  if (obj !== undefined || path.length === 1) {\n    obj[k] = newValue;\n    return;\n  }\n  let e = path[path.length - 1];\n  let p = path.slice(0, path.length - 1);\n  let last = getLastOfPath(object, p, Object);\n  while (last.obj === undefined && p.length) {\n    e = `${p[p.length - 1]}.${e}`;\n    p = p.slice(0, p.length - 1);\n    last = getLastOfPath(object, p, Object);\n    if (last?.obj && typeof last.obj[`${last.k}.${e}`] !== 'undefined') {\n      last.obj = undefined;\n    }\n  }\n  last.obj[`${last.k}.${e}`] = newValue;\n};\nconst pushPath = (object, path, newValue, concat) => {\n  const {\n    obj,\n    k\n  } = getLastOfPath(object, path, Object);\n  obj[k] = obj[k] || [];\n  obj[k].push(newValue);\n};\nconst getPath = (object, path) => {\n  const {\n    obj,\n    k\n  } = getLastOfPath(object, path);\n  if (!obj) return undefined;\n  if (!Object.prototype.hasOwnProperty.call(obj, k)) return undefined;\n  return obj[k];\n};\nconst getPathWithDefaults = (data, defaultData, key) => {\n  const value = getPath(data, key);\n  if (value !== undefined) {\n    return value;\n  }\n  return getPath(defaultData, key);\n};\nconst deepExtend = (target, source, overwrite) => {\n  for (const prop in source) {\n    if (prop !== '__proto__' && prop !== 'constructor') {\n      if (Object.prototype.hasOwnProperty.call(target, prop)) {\n        if (isString(target[prop]) || target[prop] instanceof String || isString(source[prop]) || source[prop] instanceof String) {\n          if (overwrite) target[prop] = source[prop];\n        } else {\n          deepExtend(target[prop], source[prop], overwrite);\n        }\n      } else {\n        target[prop] = source[prop];\n      }\n    }\n  }\n  return target;\n};\nconst regexEscape = str => str.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\nconst _entityMap = {\n  '&': '&amp;',\n  '<': '&lt;',\n  '>': '&gt;',\n  '\"': '&quot;',\n  \"'\": '&#39;',\n  '/': '&#x2F;'\n};\nconst escape = data => {\n  if (isString(data)) {\n    return data.replace(/[&<>\"'\\/]/g, s => _entityMap[s]);\n  }\n  return data;\n};\nclass RegExpCache {\n  constructor(capacity) {\n    this.capacity = capacity;\n    this.regExpMap = new Map();\n    this.regExpQueue = [];\n  }\n  getRegExp(pattern) {\n    const regExpFromCache = this.regExpMap.get(pattern);\n    if (regExpFromCache !== undefined) {\n      return regExpFromCache;\n    }\n    const regExpNew = new RegExp(pattern);\n    if (this.regExpQueue.length === this.capacity) {\n      this.regExpMap.delete(this.regExpQueue.shift());\n    }\n    this.regExpMap.set(pattern, regExpNew);\n    this.regExpQueue.push(pattern);\n    return regExpNew;\n  }\n}\nconst chars = [' ', ',', '?', '!', ';'];\nconst looksLikeObjectPathRegExpCache = new RegExpCache(20);\nconst looksLikeObjectPath = (key, nsSeparator, keySeparator) => {\n  nsSeparator = nsSeparator || '';\n  keySeparator = keySeparator || '';\n  const possibleChars = chars.filter(c => !nsSeparator.includes(c) && !keySeparator.includes(c));\n  if (possibleChars.length === 0) return true;\n  const r = looksLikeObjectPathRegExpCache.getRegExp(`(${possibleChars.map(c => c === '?' ? '\\\\?' : c).join('|')})`);\n  let matched = !r.test(key);\n  if (!matched) {\n    const ki = key.indexOf(keySeparator);\n    if (ki > 0 && !r.test(key.substring(0, ki))) {\n      matched = true;\n    }\n  }\n  return matched;\n};\nconst deepFind = (obj, path, keySeparator = '.') => {\n  if (!obj) return undefined;\n  if (obj[path]) {\n    if (!Object.prototype.hasOwnProperty.call(obj, path)) return undefined;\n    return obj[path];\n  }\n  const tokens = path.split(keySeparator);\n  let current = obj;\n  for (let i = 0; i < tokens.length;) {\n    if (!current || typeof current !== 'object') {\n      return undefined;\n    }\n    let next;\n    let nextPath = '';\n    for (let j = i; j < tokens.length; ++j) {\n      if (j !== i) {\n        nextPath += keySeparator;\n      }\n      nextPath += tokens[j];\n      next = current[nextPath];\n      if ((typeof next === 'function' || nextPath === '__proto__') && !Object.prototype.hasOwnProperty.call(current, nextPath)) {\n        next = undefined;\n      }\n      if (next !== undefined) {\n        if (['string', 'number', 'boolean'].includes(typeof next) && j < tokens.length - 1) {\n          continue;\n        }\n        i += j - i + 1;\n        break;\n      }\n    }\n    current = next;\n  }\n  return current;\n};\nconst getCleanedCode = code => code?.replace(/_/g, '-');\n\nconst consoleLogger = {\n  type: 'logger',\n  log(args) {\n    this.output('log', args);\n  },\n  warn(args) {\n    this.output('warn', args);\n  },\n  error(args) {\n    this.output('error', args);\n  },\n  output(type, args) {\n    console?.[type]?.apply?.(console, args);\n  }\n};\nclass Logger {\n  constructor(concreteLogger, options = {}) {\n    this.init(concreteLogger, options);\n  }\n  init(concreteLogger, options = {}) {\n    this.prefix = options.prefix || 'i18next:';\n    this.logger = concreteLogger || consoleLogger;\n    this.options = options;\n    this.debug = options.debug;\n    this.seen = new Set();\n  }\n  log(...args) {\n    return this.forward(args, 'log', '', true);\n  }\n  warn(...args) {\n    return this.forward(args, 'warn', '', true);\n  }\n  error(...args) {\n    return this.forward(args, 'error', '');\n  }\n  deprecate(...args) {\n    return this.forward(args, 'warn', 'WARNING DEPRECATED: ', true);\n  }\n  once(key, lvl, ...args) {\n    if (!this.debug || this.seen.has(key) || this.seen.size >= 1000) return null;\n    this.seen.add(key);\n    return this[lvl](...args);\n  }\n  forward(args, lvl, prefix, debugOnly) {\n    if (debugOnly && !this.debug) return null;\n    args = args.map(a => isString(a) ? a.replace(/[\\r\\n\\x00-\\x1F\\x7F]/g, ' ') : a);\n    if (isString(args[0])) args[0] = `${prefix}${this.prefix} ${args[0]}`;\n    return this.logger[lvl](args);\n  }\n  create(moduleName) {\n    return new Logger(this.logger, {\n      ...{\n        prefix: `${this.prefix}:${moduleName}:`\n      },\n      ...this.options\n    });\n  }\n  clone(options) {\n    options = options || this.options;\n    options.prefix = options.prefix || this.prefix;\n    return new Logger(this.logger, options);\n  }\n}\nvar baseLogger = new Logger();\n\nclass EventEmitter {\n  constructor() {\n    this.observers = {};\n  }\n  on(events, listener) {\n    events.split(' ').forEach(event => {\n      if (!this.observers[event]) this.observers[event] = new Map();\n      const numListeners = this.observers[event].get(listener) || 0;\n      this.observers[event].set(listener, numListeners + 1);\n    });\n    return this;\n  }\n  off(events, listener) {\n    (typeof events === 'string' ? events.split(' ') : [events]).forEach(event => {\n      if (!this.observers[event]) return;\n      if (!listener) {\n        delete this.observers[event];\n        return;\n      }\n      this.observers[event].delete(listener);\n    });\n  }\n  once(event, listener) {\n    const wrapper = (...args) => {\n      listener(...args);\n      this.off(event, wrapper);\n    };\n    this.on(event, wrapper);\n    return this;\n  }\n  emit(event, ...args) {\n    if (this.observers[event]) {\n      const cloned = Array.from(this.observers[event].entries());\n      cloned.forEach(([observer, numTimesAdded]) => {\n        for (let i = 0; i < numTimesAdded; i++) {\n          observer(...args);\n        }\n      });\n    }\n    if (this.observers['*']) {\n      const cloned = Array.from(this.observers['*'].entries());\n      cloned.forEach(([observer, numTimesAdded]) => {\n        for (let i = 0; i < numTimesAdded; i++) {\n          observer(event, ...args);\n        }\n      });\n    }\n  }\n}\n\nconst nonEmptyBundles = new WeakSet();\nclass ResourceStore extends EventEmitter {\n  constructor(data, options = {\n    ns: ['translation'],\n    defaultNS: 'translation'\n  }) {\n    super();\n    this.data = data || {};\n    this.options = options;\n    this.logger = baseLogger.create('resourceStore');\n    if (this.options.keySeparator === undefined) {\n      this.options.keySeparator = '.';\n    }\n    if (this.options.ignoreJSONStructure === undefined) {\n      this.options.ignoreJSONStructure = true;\n    }\n  }\n  addNamespaces(ns) {\n    if (!this.options.ns.includes(ns)) {\n      this.options.ns.push(ns);\n    }\n  }\n  removeNamespaces(ns) {\n    const index = this.options.ns.indexOf(ns);\n    if (index > -1) {\n      this.options.ns.splice(index, 1);\n    }\n  }\n  deprecateDottedLng(method) {\n    this.logger.once(method, 'deprecate', `${method}: a dotted language ('en.translation.key') that carries the namespace and key is removed in v27; pass language, namespace and key as separate arguments`);\n  }\n  getResource(lng, ns, key, options = {}) {\n    const keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;\n    const ignoreJSONStructure = options.ignoreJSONStructure !== undefined ? options.ignoreJSONStructure : this.options.ignoreJSONStructure;\n    let path;\n    if (lng.includes('.')) {\n      this.deprecateDottedLng('getResource');\n      path = lng.split('.');\n    } else {\n      path = [lng, ns];\n      if (key) {\n        if (Array.isArray(key)) {\n          path.push(...key);\n        } else if (isString(key) && keySeparator) {\n          path.push(...key.split(keySeparator));\n        } else {\n          path.push(key);\n        }\n      }\n    }\n    const result = getPath(this.data, path);\n    if (result == null && !ns && !key && lng.includes('.')) {\n      lng = path[0];\n      ns = path[1];\n      key = path.slice(2).join('.');\n    }\n    if (result != null || !ignoreJSONStructure || !isString(key)) return result;\n    return deepFind(this.data?.[lng]?.[ns], key, keySeparator);\n  }\n  addResource(lng, ns, key, value, options = {\n    silent: false\n  }) {\n    const keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;\n    let path = [lng, ns];\n    if (key) path = path.concat(keySeparator ? key.split(keySeparator) : key);\n    if (lng.includes('.')) {\n      this.deprecateDottedLng('addResource');\n      path = lng.split('.');\n      value = ns;\n      ns = path[1];\n    }\n    this.addNamespaces(ns);\n    setPath(this.data, path, value);\n    if (!options.silent) this.emit('added', lng, ns, key, value);\n  }\n  addResources(lng, ns, resources, options = {\n    silent: false\n  }) {\n    for (const m in resources) {\n      if (isString(resources[m]) || Array.isArray(resources[m])) this.addResource(lng, ns, m, resources[m], {\n        silent: true\n      });\n    }\n    if (!options.silent) this.emit('added', lng, ns, resources);\n  }\n  addResourceBundle(lng, ns, resources, deep, overwrite, options = {\n    silent: false,\n    skipCopy: false\n  }) {\n    let path = [lng, ns];\n    if (lng.includes('.')) {\n      this.deprecateDottedLng('addResourceBundle');\n      path = lng.split('.');\n      deep = resources;\n      resources = ns;\n      ns = path[1];\n    }\n    this.addNamespaces(ns);\n    let pack = getPath(this.data, path) || {};\n    if (!options.skipCopy) resources = JSON.parse(JSON.stringify(resources));\n    if (deep) {\n      deepExtend(pack, resources, overwrite);\n    } else {\n      pack = {\n        ...pack,\n        ...resources\n      };\n    }\n    setPath(this.data, path, pack);\n    if (!options.silent) this.emit('added', lng, ns, resources);\n  }\n  removeResourceBundle(lng, ns) {\n    if (this.hasResourceBundle(lng, ns)) {\n      delete this.data[lng][ns];\n    }\n    this.removeNamespaces(ns);\n    this.emit('removed', lng, ns);\n  }\n  hasResourceBundle(lng, ns) {\n    return this.getResource(lng, ns) !== undefined;\n  }\n  getResourceBundle(lng, ns) {\n    if (!ns) ns = this.options.defaultNS;\n    return this.getResource(lng, ns);\n  }\n  getDataByLanguage(lng) {\n    return this.data[lng];\n  }\n  hasLanguageSomeTranslations(lng) {\n    const data = this.getDataByLanguage(lng);\n    const n = data && Object.keys(data) || [];\n    return !!n.find(v => {\n      const bundle = data[v];\n      if (nonEmptyBundles.has(bundle)) return true;\n      if (!bundle || Object.keys(bundle).length === 0) return false;\n      if (typeof bundle === 'object') nonEmptyBundles.add(bundle);\n      return true;\n    });\n  }\n  toJSON() {\n    return this.data;\n  }\n}\n\nvar postProcessor = {\n  processors: {},\n  addPostProcessor(module) {\n    this.processors[module.name] = module;\n  },\n  handle(processors, value, key, options, translator) {\n    processors.forEach(processor => {\n      value = this.processors[processor]?.process(value, key, options, translator) ?? value;\n    });\n    return value;\n  }\n};\n\nconst PATH_KEY = Symbol('i18next/PATH_KEY');\nfunction createProxy() {\n  const state = [];\n  const handler = Object.create(null);\n  let proxy;\n  handler.get = (target, key) => {\n    proxy?.revoke?.();\n    if (key === PATH_KEY) return state;\n    state.push(key);\n    proxy = Proxy.revocable(target, handler);\n    return proxy.proxy;\n  };\n  return Proxy.revocable(Object.create(null), handler).proxy;\n}\nfunction keysFromSelector(selector, opts) {\n  const {\n    [PATH_KEY]: path\n  } = selector(createProxy());\n  const keySeparator = opts?.keySeparator ?? '.';\n  const nsSeparator = opts?.nsSeparator ?? ':';\n  const strict = opts?.enableSelector === 'strict';\n  if (path.length > 1 && nsSeparator) {\n    const ns = opts?.ns;\n    const nsList = strict ? Array.isArray(ns) ? ns : ns ? [ns] : null : Array.isArray(ns) ? ns : null;\n    if (nsList) {\n      const candidates = strict ? nsList : nsList.length > 1 ? nsList.slice(1) : [];\n      if (candidates.includes(path[0])) {\n        return `${path[0]}${nsSeparator}${path.slice(1).join(keySeparator)}`;\n      }\n    }\n  }\n  return path.join(keySeparator);\n}\n\nconst shouldHandleAsObject = res => !isString(res) && typeof res !== 'boolean' && typeof res !== 'number';\nclass Translator extends EventEmitter {\n  constructor(services, options = {}) {\n    super();\n    copy(['resourceStore', 'languageUtils', 'pluralResolver', 'interpolator', 'backendConnector', 'i18nFormat', 'utils', 'ownPostProcessors'], services, this);\n    this.options = options;\n    if (this.options.keySeparator === undefined) {\n      this.options.keySeparator = '.';\n    }\n    this.logger = baseLogger.create('translator');\n    this.checkedLoadedFor = {};\n  }\n  changeLanguage(lng) {\n    if (lng) this.language = lng;\n  }\n  exists(key, o = {\n    interpolation: {}\n  }) {\n    const opt = {\n      ...o\n    };\n    if (key == null) return false;\n    const resolved = this.resolve(key, opt);\n    if (resolved?.res === undefined) return false;\n    const isObject = shouldHandleAsObject(resolved.res);\n    if (opt.returnObjects === false && isObject) {\n      return false;\n    }\n    return true;\n  }\n  extractFromKey(key, opt) {\n    let nsSeparator = opt.nsSeparator !== undefined ? opt.nsSeparator : this.options.nsSeparator;\n    if (nsSeparator === undefined) nsSeparator = ':';\n    const keySeparator = opt.keySeparator !== undefined ? opt.keySeparator : this.options.keySeparator;\n    let namespaces = opt.ns || this.options.defaultNS || [];\n    const wouldCheckForNsInKey = nsSeparator && key.includes(nsSeparator);\n    const seemsNaturalLanguage = !this.options.userDefinedKeySeparator && !opt.keySeparator && !this.options.userDefinedNsSeparator && !opt.nsSeparator && !looksLikeObjectPath(key, nsSeparator, keySeparator);\n    if (wouldCheckForNsInKey && !seemsNaturalLanguage) {\n      const m = key.match(this.interpolator.nestingRegexp);\n      if (m && m.length > 0) {\n        return {\n          key,\n          namespaces: isString(namespaces) ? [namespaces] : namespaces\n        };\n      }\n      const parts = key.split(nsSeparator);\n      if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.includes(parts[0])) namespaces = parts.shift();\n      key = parts.join(keySeparator);\n    }\n    return {\n      key,\n      namespaces: isString(namespaces) ? [namespaces] : namespaces\n    };\n  }\n  translate(keys, o, lastKey) {\n    let opt = typeof o === 'object' ? {\n      ...o\n    } : o;\n    if (typeof opt !== 'object' && this.options.overloadTranslationOptionHandler) {\n      opt = this.options.overloadTranslationOptionHandler(arguments);\n    }\n    if (typeof opt === 'object') opt = {\n      ...opt\n    };\n    if (!opt) opt = {};\n    if (keys == null) return '';\n    if (typeof keys === 'function') keys = keysFromSelector(keys, {\n      ...this.options,\n      ...opt\n    });\n    if (!Array.isArray(keys)) keys = [String(keys)];\n    keys = keys.map(k => typeof k === 'function' ? keysFromSelector(k, {\n      ...this.options,\n      ...opt\n    }) : String(k));\n    const returnDetails = opt.returnDetails !== undefined ? opt.returnDetails : this.options.returnDetails;\n    const keySeparator = opt.keySeparator !== undefined ? opt.keySeparator : this.options.keySeparator;\n    const {\n      key,\n      namespaces\n    } = this.extractFromKey(keys[keys.length - 1], opt);\n    const namespace = namespaces[namespaces.length - 1];\n    let nsSeparator = opt.nsSeparator !== undefined ? opt.nsSeparator : this.options.nsSeparator;\n    if (nsSeparator === undefined) nsSeparator = ':';\n    const lng = opt.lng || this.language;\n    const appendNamespaceToCIMode = opt.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;\n    if (lng?.toLowerCase() === 'cimode') {\n      if (appendNamespaceToCIMode) {\n        if (returnDetails) {\n          return {\n            res: `${namespace}${nsSeparator}${key}`,\n            usedKey: key,\n            exactUsedKey: key,\n            usedLng: lng,\n            usedNS: namespace,\n            usedParams: this.getUsedParamsDetails(opt)\n          };\n        }\n        return `${namespace}${nsSeparator}${key}`;\n      }\n      if (returnDetails) {\n        return {\n          res: key,\n          usedKey: key,\n          exactUsedKey: key,\n          usedLng: lng,\n          usedNS: namespace,\n          usedParams: this.getUsedParamsDetails(opt)\n        };\n      }\n      return key;\n    }\n    const resolved = this.resolve(keys, opt);\n    let res = resolved?.res;\n    const resUsedKey = resolved?.usedKey || key;\n    const resExactUsedKey = resolved?.exactUsedKey || key;\n    const noObject = ['[object Number]', '[object Function]', '[object RegExp]'];\n    const joinArrays = opt.joinArrays !== undefined ? opt.joinArrays : this.options.joinArrays;\n    const handleAsObjectInI18nFormat = !this.i18nFormat || this.i18nFormat.handleAsObject;\n    const needsPluralHandling = opt.count !== undefined && !isString(opt.count);\n    const hasDefaultValue = Translator.hasDefaultValue(opt);\n    const defaultValueSuffix = needsPluralHandling ? this.pluralResolver.getSuffix(lng, opt.count, opt) : '';\n    const defaultValueSuffixOrdinalFallback = opt.ordinal && needsPluralHandling ? this.pluralResolver.getSuffix(lng, opt.count, {\n      ordinal: false\n    }) : '';\n    const needsZeroSuffixLookup = needsPluralHandling && !opt.ordinal && opt.count === 0;\n    const defaultValue = needsZeroSuffixLookup && opt[`defaultValue${this.options.pluralSeparator}zero`] || opt[`defaultValue${defaultValueSuffix}`] || opt[`defaultValue${defaultValueSuffixOrdinalFallback}`] || opt.defaultValue;\n    let resForObjHndl = res;\n    if (handleAsObjectInI18nFormat && !res && hasDefaultValue) {\n      resForObjHndl = defaultValue;\n    }\n    const handleAsObject = shouldHandleAsObject(resForObjHndl);\n    const resType = Object.prototype.toString.apply(resForObjHndl);\n    if (handleAsObjectInI18nFormat && resForObjHndl && handleAsObject && !noObject.includes(resType) && !(isString(joinArrays) && Array.isArray(resForObjHndl))) {\n      if (!opt.returnObjects && !this.options.returnObjects) {\n        if (!this.options.returnedObjectHandler) {\n          this.logger.warn('accessing an object - but returnObjects options is not enabled!');\n          this.logger.once('returnedObject', 'deprecate', \"accessing an object without returnObjects returns a sentence about it today; from v27 t() returns the key, as for a missing key (returnedObjectHandler can keep today's text)\");\n        }\n        const r = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(resUsedKey, resForObjHndl, {\n          ...opt,\n          ns: namespaces\n        }) : `key '${key} (${this.language})' returned an object instead of string.`;\n        if (returnDetails) {\n          resolved.res = r;\n          resolved.usedParams = this.getUsedParamsDetails(opt);\n          return resolved;\n        }\n        return r;\n      }\n      if (keySeparator) {\n        const resTypeIsArray = Array.isArray(resForObjHndl);\n        const copy = resTypeIsArray ? [] : {};\n        const newKeyToUse = resTypeIsArray ? resExactUsedKey : resUsedKey;\n        for (const m in resForObjHndl) {\n          if (Object.prototype.hasOwnProperty.call(resForObjHndl, m)) {\n            const deepKey = `${newKeyToUse}${keySeparator}${m}`;\n            if (hasDefaultValue && !res) {\n              copy[m] = this.translate(deepKey, {\n                ...opt,\n                defaultValue: shouldHandleAsObject(defaultValue) ? defaultValue[m] : undefined,\n                ...{\n                  joinArrays: false,\n                  ns: namespaces\n                }\n              });\n            } else {\n              copy[m] = this.translate(deepKey, {\n                ...opt,\n                ...{\n                  joinArrays: false,\n                  ns: namespaces\n                }\n              });\n            }\n            if (copy[m] === deepKey) copy[m] = resForObjHndl[m];\n          }\n        }\n        res = copy;\n      }\n    } else if (handleAsObjectInI18nFormat && isString(joinArrays) && Array.isArray(res)) {\n      res = res.join(joinArrays);\n      if (res) res = this.extendTranslation(res, keys, opt, resolved, lastKey);\n    } else {\n      let usedDefault = false;\n      let usedKey = false;\n      if (!this.isValidLookup(res) && hasDefaultValue) {\n        usedDefault = true;\n        res = defaultValue;\n      }\n      if (!this.isValidLookup(res)) {\n        usedKey = true;\n        res = key;\n      }\n      const missingKeyNoValueFallbackToKey = opt.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey;\n      const resForMissing = missingKeyNoValueFallbackToKey && usedKey ? undefined : res;\n      const updateMissing = hasDefaultValue && defaultValue !== res && this.options.updateMissing;\n      if (usedKey || usedDefault || updateMissing) {\n        this.logger.log(updateMissing ? 'updateKey' : 'missingKey', lng, namespace, needsPluralHandling && !updateMissing ? `${key}${this.pluralResolver.getSuffix(lng, opt.count, opt)}` : key, updateMissing ? defaultValue : res);\n        if (keySeparator) {\n          const fk = this.resolve(key, {\n            ...opt,\n            keySeparator: false\n          });\n          if (fk && fk.res) this.logger.warn('Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.');\n        }\n        let lngs = [];\n        const fallbackLngs = this.languageUtils.getFallbackCodes(this.options.fallbackLng, opt.lng || this.language);\n        if (this.options.saveMissingTo === 'fallback' && fallbackLngs && fallbackLngs[0]) {\n          for (let i = 0; i < fallbackLngs.length; i++) {\n            lngs.push(fallbackLngs[i]);\n          }\n        } else if (this.options.saveMissingTo === 'all') {\n          lngs = this.languageUtils.toResolveHierarchy(opt.lng || this.language);\n        } else {\n          lngs.push(opt.lng || this.language);\n        }\n        const send = (l, k, specificDefaultValue) => {\n          const defaultForMissing = hasDefaultValue && specificDefaultValue !== res ? specificDefaultValue : resForMissing;\n          if (this.options.missingKeyHandler) {\n            this.options.missingKeyHandler(l, namespace, k, defaultForMissing, updateMissing, opt);\n          } else if (this.backendConnector?.saveMissing) {\n            this.backendConnector.saveMissing(l, namespace, k, defaultForMissing, updateMissing, opt, undefined, this.utils?.hasLoadedNamespace);\n          }\n          this.emit('missingKey', l, namespace, k, res);\n        };\n        if (this.options.saveMissing) {\n          if (this.options.saveMissingPlurals && needsPluralHandling) {\n            lngs.forEach(language => {\n              const suffixes = this.pluralResolver.getSuffixes(language, opt);\n              if (needsZeroSuffixLookup && opt[`defaultValue${this.options.pluralSeparator}zero`] && !suffixes.includes(`${this.options.pluralSeparator}zero`)) {\n                suffixes.push(`${this.options.pluralSeparator}zero`);\n              }\n              suffixes.forEach(suffix => {\n                send([language], key + suffix, opt[`defaultValue${suffix}`] || defaultValue);\n              });\n            });\n          } else {\n            send(lngs, key, defaultValue);\n          }\n        }\n      }\n      res = this.extendTranslation(res, keys, opt, resolved, lastKey);\n      if (usedKey && res === key && this.options.appendNamespaceToMissingKey) {\n        res = `${namespace}${nsSeparator}${key}`;\n      }\n      if ((usedKey || usedDefault) && this.options.parseMissingKeyHandler) {\n        res = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${namespace}${nsSeparator}${key}` : key, usedDefault ? res : undefined, opt);\n      }\n    }\n    if (returnDetails) {\n      resolved.res = res;\n      resolved.usedParams = this.getUsedParamsDetails(opt);\n      return resolved;\n    }\n    return res;\n  }\n  extendTranslation(res, key, opt, resolved, lastKey) {\n    if (this.i18nFormat?.parse) {\n      res = this.i18nFormat.parse(res, {\n        ...this.options.interpolation.defaultVariables,\n        ...opt\n      }, opt.lng || this.language || resolved.usedLng, resolved.usedNS, resolved.usedKey, {\n        resolved\n      });\n    } else if (!opt.skipInterpolation) {\n      if (opt.interpolation) this.interpolator.init({\n        ...opt,\n        ...{\n          interpolation: {\n            ...this.options.interpolation,\n            ...opt.interpolation\n          }\n        }\n      });\n      const skipOnVariables = isString(res) && (opt?.interpolation?.skipOnVariables !== undefined ? opt.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);\n      let nestBef;\n      if (skipOnVariables) {\n        const nb = res.match(this.interpolator.nestingRegexp);\n        nestBef = nb && nb.length;\n      }\n      let data = opt.replace && !isString(opt.replace) ? opt.replace : opt;\n      if (this.options.interpolation.defaultVariables) data = {\n        ...this.options.interpolation.defaultVariables,\n        ...data\n      };\n      res = this.interpolator.interpolate(res, data, opt.lng || this.language || resolved.usedLng, opt);\n      if (skipOnVariables) {\n        const na = res.match(this.interpolator.nestingRegexp);\n        const nestAft = na && na.length;\n        if (nestBef < nestAft) opt.nest = false;\n      }\n      if (!opt.lng && resolved && resolved.res) opt.lng = this.language || resolved.usedLng;\n      if (opt.nest !== false) res = this.interpolator.nest(res, (...args) => {\n        if (lastKey?.[0] === args[0] && !opt.context) {\n          this.logger.warn(`It seems you are nesting recursively key: ${args[0]} in key: ${key[0]}`);\n          return null;\n        }\n        return this.translate(...args, key);\n      }, opt);\n      if (opt.interpolation) this.interpolator.reset();\n    }\n    const postProcess = opt.postProcess || this.options.postProcess;\n    const postProcessorNames = isString(postProcess) ? [postProcess] : postProcess;\n    if (res != null && postProcessorNames?.length && opt.applyPostProcessor !== false) {\n      postProcessorNames.forEach(name => {\n        if (this.logger.debug && postProcessor.processors[name] && this.ownPostProcessors && !this.ownPostProcessors.has(name)) {\n          this.logger.once(name, 'deprecate', `postProcess: '${name}' was registered with use() on another i18next instance; from v27 post-processors are per instance, so call use() with it on this instance too`);\n        }\n      });\n      res = postProcessor.handle(postProcessorNames, res, key, this.options && this.options.postProcessPassResolved ? {\n        i18nResolved: {\n          ...resolved,\n          usedParams: this.getUsedParamsDetails(opt)\n        },\n        ...opt\n      } : opt, this);\n    }\n    return res;\n  }\n  resolve(keys, opt = {}) {\n    let found;\n    let usedKey;\n    let exactUsedKey;\n    let usedLng;\n    let usedNS;\n    if (isString(keys)) keys = [keys];\n    if (Array.isArray(keys)) keys = keys.map(k => typeof k === 'function' ? keysFromSelector(k, {\n      ...this.options,\n      ...opt\n    }) : k);\n    keys.forEach(k => {\n      if (this.isValidLookup(found)) return;\n      const extracted = this.extractFromKey(k, opt);\n      const key = extracted.key;\n      usedKey = key;\n      let namespaces = extracted.namespaces;\n      if (this.options.fallbackNS) namespaces = namespaces.concat(this.options.fallbackNS);\n      const needsPluralHandling = opt.count !== undefined && !isString(opt.count);\n      const needsZeroSuffixLookup = needsPluralHandling && !opt.ordinal && opt.count === 0;\n      const needsContextHandling = opt.context !== undefined && (isString(opt.context) || typeof opt.context === 'number') && opt.context !== '';\n      const codes = opt.lngs ? opt.lngs : this.languageUtils.toResolveHierarchy(opt.lng || this.language, opt.fallbackLng);\n      namespaces.forEach(ns => {\n        if (this.isValidLookup(found)) return;\n        usedNS = ns;\n        if (!this.checkedLoadedFor[`${codes[0]}-${ns}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(usedNS)) {\n          this.checkedLoadedFor[`${codes[0]}-${ns}`] = true;\n          this.logger.warn(`key \"${usedKey}\" for languages \"${codes.join(', ')}\" won't get resolved as namespace \"${usedNS}\" was not yet loaded`, 'This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!');\n        }\n        codes.forEach(code => {\n          if (this.isValidLookup(found)) return;\n          usedLng = code;\n          const finalKeys = [key];\n          if (this.i18nFormat?.addLookupKeys) {\n            this.i18nFormat.addLookupKeys(finalKeys, key, code, ns, opt);\n          } else {\n            let pluralSuffix;\n            if (needsPluralHandling) pluralSuffix = this.pluralResolver.getSuffix(code, opt.count, opt);\n            const zeroSuffix = `${this.options.pluralSeparator}zero`;\n            const ordinalPrefix = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;\n            if (needsPluralHandling) {\n              if (opt.ordinal && pluralSuffix.startsWith(ordinalPrefix)) {\n                finalKeys.push(key + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));\n              }\n              finalKeys.push(key + pluralSuffix);\n              if (needsZeroSuffixLookup) {\n                finalKeys.push(key + zeroSuffix);\n              }\n            }\n            if (needsContextHandling) {\n              const contextKey = `${key}${this.options.contextSeparator || '_'}${opt.context}`;\n              finalKeys.push(contextKey);\n              if (needsPluralHandling) {\n                if (opt.ordinal && pluralSuffix.startsWith(ordinalPrefix)) {\n                  finalKeys.push(contextKey + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));\n                }\n                finalKeys.push(contextKey + pluralSuffix);\n                if (needsZeroSuffixLookup) {\n                  finalKeys.push(contextKey + zeroSuffix);\n                }\n              }\n            }\n          }\n          let possibleKey;\n          while (possibleKey = finalKeys.pop()) {\n            if (!this.isValidLookup(found)) {\n              exactUsedKey = possibleKey;\n              found = this.getResource(code, ns, possibleKey, opt);\n            }\n          }\n        });\n      });\n    });\n    return {\n      res: found,\n      usedKey,\n      exactUsedKey,\n      usedLng,\n      usedNS\n    };\n  }\n  isValidLookup(res) {\n    return res !== undefined && !(!this.options.returnNull && res === null) && !(!this.options.returnEmptyString && res === '');\n  }\n  getResource(code, ns, key, options = {}) {\n    if (this.i18nFormat?.getResource) return this.i18nFormat.getResource(code, ns, key, options);\n    return this.resourceStore.getResource(code, ns, key, options);\n  }\n  getUsedParamsDetails(options = {}) {\n    const optionsKeys = ['defaultValue', 'ordinal', 'context', 'replace', 'lng', 'lngs', 'fallbackLng', 'ns', 'keySeparator', 'nsSeparator', 'returnObjects', 'returnDetails', 'joinArrays', 'postProcess', 'interpolation'];\n    const useOptionsReplaceForData = options.replace && !isString(options.replace);\n    let data = useOptionsReplaceForData ? options.replace : options;\n    if (useOptionsReplaceForData && typeof options.count !== 'undefined') {\n      data = {\n        ...data,\n        count: options.count\n      };\n    }\n    if (this.options.interpolation.defaultVariables) {\n      data = {\n        ...this.options.interpolation.defaultVariables,\n        ...data\n      };\n    }\n    if (!useOptionsReplaceForData) {\n      data = {\n        ...data\n      };\n      for (const key of optionsKeys) {\n        delete data[key];\n      }\n    }\n    return data;\n  }\n  static hasDefaultValue(options) {\n    const prefix = 'defaultValue';\n    for (const option in options) {\n      if (Object.prototype.hasOwnProperty.call(options, option) && option.startsWith(prefix) && undefined !== options[option]) {\n        return true;\n      }\n    }\n    return false;\n  }\n}\n\nclass LanguageUtil {\n  constructor(options) {\n    this.options = options;\n    this.supportedLngs = this.options.supportedLngs || false;\n    this.logger = baseLogger.create('languageUtils');\n    this.resolveHierarchyCache = {};\n  }\n  clearCache() {\n    this.resolveHierarchyCache = {};\n  }\n  getScriptPartFromCode(code) {\n    code = getCleanedCode(code);\n    if (!code || !code.includes('-')) return null;\n    const p = code.split('-');\n    if (p.length === 2) return null;\n    p.pop();\n    if (p[p.length - 1].toLowerCase() === 'x') return null;\n    return this.formatLanguageCode(p.join('-'));\n  }\n  getLanguagePartFromCode(code) {\n    code = getCleanedCode(code);\n    if (!code || !code.includes('-')) return code;\n    const p = code.split('-');\n    return this.formatLanguageCode(p[0]);\n  }\n  formatLanguageCode(code) {\n    if (isString(code) && code.includes('-')) {\n      let formattedCode;\n      try {\n        formattedCode = Intl.getCanonicalLocales(code)[0];\n      } catch (e) {}\n      if (formattedCode && this.options.lowerCaseLng) {\n        formattedCode = formattedCode.toLowerCase();\n      }\n      if (formattedCode) return formattedCode;\n      if (this.options.lowerCaseLng) {\n        return code.toLowerCase();\n      }\n      return code;\n    }\n    const formatted = this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code;\n    if (this.logger.debug && isString(code)) this.deprecateBareCode(code, formatted);\n    return formatted;\n  }\n  deprecateBareCode(code, formatted) {\n    let v27;\n    try {\n      v27 = Intl.getCanonicalLocales(code)[0];\n    } catch (e) {\n      return;\n    }\n    if (this.options.lowerCaseLng) v27 = v27.toLowerCase();\n    if (v27 === formatted) return;\n    this.logger.once(code, 'deprecate', `language code '${code}' is used as '${formatted}'; i18next v27 canonicalizes it to '${v27}', use '${v27}' in lng, fallbackLng, supportedLngs and the resources`);\n  }\n  isSupportedCode(code) {\n    if (this.options.load === 'languageOnly' || this.options.nonExplicitSupportedLngs) {\n      code = this.getLanguagePartFromCode(code);\n    }\n    return !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.includes(code);\n  }\n  getBestMatchFromCodes(codes) {\n    if (!codes) return null;\n    let found;\n    codes.forEach(code => {\n      if (found) return;\n      const cleanedLng = this.formatLanguageCode(code);\n      if (!this.options.supportedLngs || this.isSupportedCode(cleanedLng)) found = cleanedLng;\n    });\n    if (!found && this.options.supportedLngs) {\n      codes.forEach(code => {\n        if (found) return;\n        const lngScOnly = this.getScriptPartFromCode(code);\n        if (this.isSupportedCode(lngScOnly)) return found = lngScOnly;\n        const lngOnly = this.getLanguagePartFromCode(code);\n        if (this.isSupportedCode(lngOnly)) return found = lngOnly;\n        found = this.options.supportedLngs.find(supportedLng => {\n          if (supportedLng === lngOnly) return true;\n          if (!supportedLng.includes('-') && !lngOnly.includes('-')) return false;\n          if (supportedLng.includes('-') && !lngOnly.includes('-') && supportedLng.slice(0, supportedLng.indexOf('-')) === lngOnly) return true;\n          return false;\n        });\n      });\n    }\n    if (!found) found = this.getFallbackCodes(this.options.fallbackLng)[0];\n    return found;\n  }\n  getFallbackCodes(fallbacks, code) {\n    if (!fallbacks) return [];\n    if (typeof fallbacks === 'function') fallbacks = fallbacks(code);\n    if (isString(fallbacks)) fallbacks = [fallbacks];\n    if (Array.isArray(fallbacks)) return fallbacks;\n    if (!code) return fallbacks.default || [];\n    let found = fallbacks[code];\n    if (!found) found = fallbacks[this.getScriptPartFromCode(code)];\n    if (!found) found = fallbacks[this.formatLanguageCode(code)];\n    if (!found) found = fallbacks[this.getLanguagePartFromCode(code)];\n    if (!found) found = fallbacks.default;\n    return found || [];\n  }\n  toResolveHierarchy(code, fallbackCode) {\n    const fallbackLng = this.options.fallbackLng;\n    const fallbackLngKey = Array.isArray(fallbackLng) ? fallbackLng.join('|') : fallbackLng;\n    if (fallbackLngKey !== this._cachedFallbackLng) {\n      this.resolveHierarchyCache = {};\n      this._cachedFallbackLng = fallbackLngKey;\n    }\n    const hasCacheableFallback = fallbackCode === undefined || fallbackCode === false || isString(fallbackCode);\n    const usesUncacheableOptionsFallback = fallbackCode === undefined && typeof this.options.fallbackLng === 'function';\n    const cacheable = isString(code) && hasCacheableFallback && !usesUncacheableOptionsFallback;\n    let cacheKey = null;\n    if (cacheable) {\n      let fallbackCacheKey;\n      if (fallbackCode === undefined) fallbackCacheKey = 'undefined';else if (fallbackCode === false) fallbackCacheKey = 'boolean:false';else fallbackCacheKey = `string:${fallbackCode}`;\n      cacheKey = `${code.length}:${code}|${fallbackCacheKey}`;\n    }\n    if (cacheKey !== null) {\n      const cached = this.resolveHierarchyCache[cacheKey];\n      if (cached !== undefined) return cached.slice();\n    }\n    const fallbackCodes = this.getFallbackCodes((fallbackCode === false ? [] : fallbackCode) || this.options.fallbackLng || [], code);\n    const codes = [];\n    const addCode = c => {\n      if (!c) return;\n      if (this.isSupportedCode(c)) {\n        codes.push(c);\n      } else {\n        this.logger.warn(`rejecting language code not found in supportedLngs: ${c}`);\n      }\n    };\n    if (isString(code) && (code.includes('-') || code.includes('_'))) {\n      if (this.options.load !== 'languageOnly') addCode(this.formatLanguageCode(code));\n      if (this.options.load !== 'languageOnly' && this.options.load !== 'currentOnly') addCode(this.getScriptPartFromCode(code));\n      if (this.options.load !== 'currentOnly') addCode(this.getLanguagePartFromCode(code));\n    } else if (isString(code)) {\n      addCode(this.formatLanguageCode(code));\n    }\n    fallbackCodes.forEach(fc => {\n      const formattedFc = this.formatLanguageCode(fc);\n      if (!codes.includes(formattedFc)) addCode(formattedFc);\n    });\n    if (cacheKey !== null) {\n      this.resolveHierarchyCache[cacheKey] = codes;\n      return codes.slice();\n    }\n    return codes;\n  }\n}\n\nconst suffixesOrder = {\n  zero: 0,\n  one: 1,\n  two: 2,\n  few: 3,\n  many: 4,\n  other: 5\n};\nconst dummyRule = {\n  select: count => count === 1 ? 'one' : 'other',\n  resolvedOptions: () => ({\n    pluralCategories: ['one', 'other']\n  })\n};\nclass PluralResolver {\n  constructor(languageUtils, options = {}) {\n    this.languageUtils = languageUtils;\n    this.options = options;\n    this.logger = baseLogger.create('pluralResolver');\n    this.pluralRulesCache = {};\n  }\n  clearCache() {\n    this.pluralRulesCache = {};\n  }\n  getRule(code, options = {}) {\n    const cleanedCode = getCleanedCode(code === 'dev' ? 'en' : code);\n    const type = options.ordinal ? 'ordinal' : 'cardinal';\n    const cacheKey = JSON.stringify({\n      cleanedCode,\n      type\n    });\n    if (cacheKey in this.pluralRulesCache) {\n      return this.pluralRulesCache[cacheKey];\n    }\n    let rule;\n    try {\n      rule = new Intl.PluralRules(cleanedCode, {\n        type\n      });\n    } catch (err) {\n      if (typeof Intl === 'undefined') {\n        this.logger.error('No Intl support, please use an Intl polyfill!');\n        return dummyRule;\n      }\n      if (!code.match(/-|_/)) return dummyRule;\n      const lngPart = this.languageUtils.getLanguagePartFromCode(code);\n      rule = this.getRule(lngPart, options);\n    }\n    this.pluralRulesCache[cacheKey] = rule;\n    return rule;\n  }\n  needsPlural(code, options = {}) {\n    let rule = this.getRule(code, options);\n    if (!rule) rule = this.getRule('dev', options);\n    return rule?.resolvedOptions().pluralCategories.length > 1;\n  }\n  getPluralFormsOfKey(code, key, options = {}) {\n    return this.getSuffixes(code, options).map(suffix => `${key}${suffix}`);\n  }\n  getSuffixes(code, options = {}) {\n    let rule = this.getRule(code, options);\n    if (!rule) rule = this.getRule('dev', options);\n    if (!rule) return [];\n    return rule.resolvedOptions().pluralCategories.sort((pluralCategory1, pluralCategory2) => suffixesOrder[pluralCategory1] - suffixesOrder[pluralCategory2]).map(pluralCategory => `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ''}${pluralCategory}`);\n  }\n  getSuffix(code, count, options = {}) {\n    const rule = this.getRule(code, options);\n    if (rule) {\n      return `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ''}${rule.select(count)}`;\n    }\n    this.logger.warn(`no plural rule found for: ${code}`);\n    return this.getSuffix('dev', count, options);\n  }\n}\n\nconst deepFindWithDefaults = (data, defaultData, key, keySeparator = '.', ignoreJSONStructure = true) => {\n  let path = getPathWithDefaults(data, defaultData, key);\n  if (path == null && ignoreJSONStructure && isString(key)) {\n    path = deepFind(data, key, keySeparator);\n    if (path === undefined) path = deepFind(defaultData, key, keySeparator);\n  }\n  return path;\n};\nclass Interpolator {\n  constructor(options = {}) {\n    this.logger = baseLogger.create('interpolator');\n    this.options = options;\n    this.format = options?.interpolation?.format || (value => value);\n    this.init(options);\n  }\n  init(options = {}) {\n    if (!options.interpolation) options.interpolation = {\n      escapeValue: true\n    };\n    const {\n      escape: escape$1,\n      escapeValue,\n      useRawValueToEscape,\n      prefix,\n      prefixEscaped,\n      suffix,\n      suffixEscaped,\n      formatSeparator,\n      unescapeSuffix,\n      unescapePrefix,\n      nestingPrefix,\n      nestingPrefixEscaped,\n      nestingSuffix,\n      nestingSuffixEscaped,\n      nestingOptionsSeparator,\n      maxReplaces,\n      alwaysFormat\n    } = options.interpolation;\n    if (prefixEscaped || suffixEscaped || nestingPrefixEscaped || nestingSuffixEscaped) {\n      const names = Object.entries({\n        prefixEscaped,\n        suffixEscaped,\n        nestingPrefixEscaped,\n        nestingSuffixEscaped\n      }).filter(([, v]) => v).map(([k]) => k);\n      this.logger.once(names.join(), 'deprecate', `interpolation.${names.join(', interpolation.')}: the regex-escaped delimiter options are removed in v27; pass the literal delimiters as prefix, suffix, nestingPrefix and nestingSuffix`);\n    }\n    this.escape = escape$1 !== undefined ? escape$1 : escape;\n    this.escapeValue = escapeValue !== undefined ? escapeValue : true;\n    this.useRawValueToEscape = useRawValueToEscape !== undefined ? useRawValueToEscape : false;\n    this.prefix = prefix ? regexEscape(prefix) : prefixEscaped || '{{';\n    this.suffix = suffix ? regexEscape(suffix) : suffixEscaped || '}}';\n    this.formatSeparator = formatSeparator || ',';\n    this.unescapePrefix = unescapeSuffix ? '' : unescapePrefix ? regexEscape(unescapePrefix) : '-';\n    this.unescapeSuffix = this.unescapePrefix ? '' : unescapeSuffix ? regexEscape(unescapeSuffix) : '';\n    this.nestingPrefix = nestingPrefix ? regexEscape(nestingPrefix) : nestingPrefixEscaped || regexEscape('$t(');\n    this.nestingSuffix = nestingSuffix ? regexEscape(nestingSuffix) : nestingSuffixEscaped || regexEscape(')');\n    this.nestingOptionsSeparator = nestingOptionsSeparator || ',';\n    this.maxReplaces = maxReplaces || 1000;\n    this.alwaysFormat = alwaysFormat !== undefined ? alwaysFormat : false;\n    this.resetRegExp();\n  }\n  reset() {\n    if (this.options) this.init(this.options);\n  }\n  resetRegExp() {\n    const getOrResetRegExp = (existingRegExp, pattern) => {\n      if (existingRegExp?.source === pattern) {\n        existingRegExp.lastIndex = 0;\n        return existingRegExp;\n      }\n      return new RegExp(pattern, 'g');\n    };\n    this.regexp = getOrResetRegExp(this.regexp, `${this.prefix}(.+?)${this.suffix}`);\n    this.regexpUnescape = getOrResetRegExp(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`);\n    this.nestingRegexp = getOrResetRegExp(this.nestingRegexp, `${this.nestingPrefix}((?:[^()\"']|\"[^\"]*\"|'[^']*'|\\\\((?:[^()\"']|\"[^\"]*\"|'[^']*')*\\\\))*?)${this.nestingSuffix}`);\n  }\n  interpolate(str, data, lng, options) {\n    let match;\n    let value;\n    let replaces;\n    const original = str;\n    const defaultData = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {};\n    const handleFormat = key => {\n      if (!key.includes(this.formatSeparator)) {\n        const path = deepFindWithDefaults(data, defaultData, key, this.options.keySeparator, this.options.ignoreJSONStructure);\n        return this.alwaysFormat ? this.format(path, undefined, lng, {\n          ...options,\n          ...data,\n          interpolationkey: key\n        }) : path;\n      }\n      const p = key.split(this.formatSeparator);\n      const k = p.shift().trim();\n      const f = p.join(this.formatSeparator).trim();\n      return this.format(deepFindWithDefaults(data, defaultData, k, this.options.keySeparator, this.options.ignoreJSONStructure), f, lng, {\n        ...options,\n        ...data,\n        interpolationkey: k\n      });\n    };\n    this.resetRegExp();\n    if (!this.escapeValue && typeof str === 'string' && /\\$t\\([^)]*\\{[^}]*\\{\\{/.test(str)) {\n      this.logger.warn('nesting options string contains interpolated variables with escapeValue: false — ' + 'if any of those values are attacker-controlled they can inject additional ' + 'nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing ' + 'it to t(), or keep escapeValue: true.');\n    }\n    const missingInterpolationHandler = options?.missingInterpolationHandler || this.options.missingInterpolationHandler;\n    const skipOnVariables = options?.interpolation?.skipOnVariables !== undefined ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;\n    const todos = [{\n      regex: this.regexpUnescape,\n      safeValue: val => val\n    }, {\n      regex: this.regexp,\n      safeValue: val => {\n        if (!this.escapeValue) return val;\n        if (this.escape === escape && this.options?.interpolation?.escapeValue !== false && isString(val) && val.includes('/')) {\n          this.logger.once('/', 'deprecate', \"escapeValue renders '/' in a value as '&#x2F;' today; from v27 the default escape leaves '/' as it is\");\n        }\n        return this.escape(val);\n      }\n    }];\n    const unescapedValues = [];\n    let shift = 0;\n    todos.forEach(todo => {\n      replaces = 0;\n      while (match = todo.regex.exec(str)) {\n        const at = match.index - shift;\n        const written = unescapedValues.find(([start, end]) => at >= start && at < end);\n        if (written) {\n          todo.regex.lastIndex = written[1] + shift;\n          continue;\n        }\n        const matchedVar = match[1].trim();\n        value = handleFormat(matchedVar);\n        if (value === undefined) {\n          if (typeof missingInterpolationHandler === 'function') {\n            const temp = missingInterpolationHandler(str, match, options);\n            value = isString(temp) ? temp : '';\n          } else if (options && Object.prototype.hasOwnProperty.call(options, matchedVar)) {\n            value = '';\n          } else if (skipOnVariables) {\n            if (this.logger.debug) {\n              this.logger.once(`${original}\\u0000${match[0]}`, 'warn', `missed to pass in variable ${matchedVar} for interpolating ${original}`);\n            }\n            value = match[0];\n            continue;\n          } else {\n            this.logger.warn(`missed to pass in variable ${matchedVar} for interpolating ${str}`);\n            value = '';\n          }\n        } else if (!isString(value) && !this.useRawValueToEscape) {\n          value = makeString(value);\n        }\n        const safeValue = makeString(todo.safeValue(value));\n        str = str.slice(0, match.index) + safeValue + str.slice(match.index + match[0].length);\n        if (skipOnVariables) {\n          if (todo.regex === this.regexpUnescape) {\n            unescapedValues.push([match.index, match.index + safeValue.length]);\n          } else {\n            shift += safeValue.length - match[0].length;\n          }\n          todo.regex.lastIndex += safeValue.length;\n          todo.regex.lastIndex -= match[0].length;\n        } else {\n          todo.regex.lastIndex = 0;\n        }\n        replaces++;\n        if (replaces >= this.maxReplaces) {\n          break;\n        }\n      }\n    });\n    return str;\n  }\n  nest(str, fc, options = {}) {\n    let match;\n    let value;\n    let clonedOptions;\n    const handleHasOptions = (key, inheritedOptions) => {\n      const sep = this.nestingOptionsSeparator;\n      if (!key.includes(sep)) return key;\n      const c = key.split(new RegExp(`${regexEscape(sep)}[ ]*{`));\n      let optionsString = `{${c[1]}`;\n      key = c[0];\n      optionsString = this.interpolate(optionsString, clonedOptions);\n      const matchedSingleQuotes = optionsString.match(/'/g);\n      const matchedDoubleQuotes = optionsString.match(/\"/g);\n      if ((matchedSingleQuotes?.length ?? 0) % 2 === 0 && !matchedDoubleQuotes || (matchedDoubleQuotes?.length ?? 0) % 2 !== 0) {\n        optionsString = optionsString.replace(/'/g, '\"');\n      }\n      try {\n        clonedOptions = JSON.parse(optionsString);\n        if (inheritedOptions) clonedOptions = {\n          ...inheritedOptions,\n          ...clonedOptions\n        };\n      } catch (e) {\n        this.logger.warn(`failed parsing options string in nesting for key ${key}`, e);\n        return `${key}${sep}${optionsString}`;\n      }\n      if (clonedOptions.defaultValue && clonedOptions.defaultValue.includes(this.prefix)) delete clonedOptions.defaultValue;\n      return key;\n    };\n    const nestingRegexp = new RegExp(this.nestingRegexp);\n    let out = '';\n    let lastEnd = 0;\n    while (match = nestingRegexp.exec(str)) {\n      let formatters = [];\n      clonedOptions = {\n        ...options\n      };\n      clonedOptions = clonedOptions.replace && !isString(clonedOptions.replace) ? clonedOptions.replace : clonedOptions;\n      clonedOptions.applyPostProcessor = false;\n      delete clonedOptions.defaultValue;\n      const keyEndIndex = /{.*}/s.test(match[1]) ? match[1].lastIndexOf('}') + 1 : match[1].indexOf(this.formatSeparator);\n      if (keyEndIndex !== -1) {\n        formatters = match[1].slice(keyEndIndex).split(this.formatSeparator).map(elem => elem.trim()).filter(Boolean);\n        match[1] = match[1].slice(0, keyEndIndex);\n      }\n      value = fc(handleHasOptions.call(this, match[1].trim(), clonedOptions), clonedOptions);\n      if (value && match[0] === str && !isString(value)) return value;\n      if (!isString(value)) value = makeString(value);\n      if (!value) {\n        this.logger.warn(`missed to resolve ${match[1]} for nesting ${str}`);\n        value = '';\n      }\n      if (formatters.length) {\n        value = formatters.reduce((v, f) => this.format(v, f, options.lng, {\n          ...options,\n          interpolationkey: match[1].trim()\n        }), value.trim());\n      }\n      out += str.slice(lastEnd, match.index) + makeString(value);\n      lastEnd = nestingRegexp.lastIndex;\n      this.regexp.lastIndex = 0;\n    }\n    return lastEnd ? out + str.slice(lastEnd) : str;\n  }\n}\n\nconst parseFormatStr = formatStr => {\n  let formatName = formatStr.toLowerCase().trim();\n  const formatOptions = {};\n  if (formatStr.includes('(')) {\n    const p = formatStr.split('(');\n    formatName = p[0].toLowerCase().trim();\n    const optStr = p[1].slice(0, -1);\n    if (formatName === 'currency' && !optStr.includes(':')) {\n      if (!formatOptions.currency) formatOptions.currency = optStr.trim();\n    } else if (formatName === 'relativetime' && !optStr.includes(':')) {\n      if (!formatOptions.range) formatOptions.range = optStr.trim();\n    } else {\n      const opts = optStr.split(';');\n      opts.forEach(opt => {\n        if (opt) {\n          const [key, ...rest] = opt.split(':');\n          const val = rest.join(':').trim().replace(/^'+|'+$/g, '');\n          const trimmedKey = key.trim();\n          if (!formatOptions[trimmedKey]) formatOptions[trimmedKey] = val;\n          if (val === 'false') formatOptions[trimmedKey] = false;\n          if (val === 'true') formatOptions[trimmedKey] = true;\n          if (!isNaN(val)) formatOptions[trimmedKey] = parseInt(val, 10);\n        }\n      });\n    }\n  }\n  return {\n    formatName,\n    formatOptions\n  };\n};\nconst createCachedFormatter = fn => {\n  const cache = {};\n  return (v, l, o) => {\n    let optForCache = o;\n    if (o && o.interpolationkey && o.formatParams && o.formatParams[o.interpolationkey] && o[o.interpolationkey]) {\n      optForCache = {\n        ...optForCache,\n        [o.interpolationkey]: undefined\n      };\n    }\n    let key;\n    try {\n      key = l + JSON.stringify(optForCache);\n    } catch (e) {\n      return fn(getCleanedCode(l), o)(v);\n    }\n    let frm = cache[key];\n    if (!frm) {\n      frm = fn(getCleanedCode(l), o);\n      cache[key] = frm;\n    }\n    return frm(v);\n  };\n};\nconst createNonCachedFormatter = fn => (v, l, o) => fn(getCleanedCode(l), o)(v);\nclass Formatter {\n  constructor(options = {}) {\n    this.logger = baseLogger.create('formatter');\n    this.options = options;\n    this.init(options);\n  }\n  init(services, options = {\n    interpolation: {}\n  }) {\n    this.formatSeparator = options.interpolation.formatSeparator || ',';\n    const cf = options.cacheInBuiltFormats ? createCachedFormatter : createNonCachedFormatter;\n    this.formats = {\n      number: cf((lng, opt) => {\n        const formatter = new Intl.NumberFormat(lng, {\n          ...opt\n        });\n        return val => formatter.format(val);\n      }),\n      currency: cf((lng, opt) => {\n        const formatter = new Intl.NumberFormat(lng, {\n          ...opt,\n          style: 'currency'\n        });\n        return val => formatter.format(val);\n      }),\n      datetime: cf((lng, opt) => {\n        const formatter = new Intl.DateTimeFormat(lng, {\n          ...opt\n        });\n        return val => formatter.format(val);\n      }),\n      relativetime: cf((lng, opt) => {\n        const formatter = new Intl.RelativeTimeFormat(lng, {\n          ...opt\n        });\n        return val => formatter.format(val, opt.range || 'day');\n      }),\n      list: cf((lng, opt) => {\n        const formatter = new Intl.ListFormat(lng, {\n          ...opt\n        });\n        return val => formatter.format(val);\n      })\n    };\n  }\n  add(name, fc) {\n    this.formats[name.toLowerCase().trim()] = fc;\n  }\n  addCached(name, fc) {\n    this.formats[name.toLowerCase().trim()] = createCachedFormatter(fc);\n  }\n  format(value, format, lng, options = {}) {\n    if (!format) return value;\n    if (value == null) return value;\n    const rawFormats = format.split(this.formatSeparator);\n    const formats = [];\n    for (let i = 0; i < rawFormats.length; i++) {\n      let f = rawFormats[i];\n      while (f.indexOf('(') > -1 && !f.includes(')') && i + 1 < rawFormats.length) {\n        f = `${f}${this.formatSeparator}${rawFormats[++i]}`;\n      }\n      formats.push(f);\n    }\n    const result = formats.reduce((mem, f) => {\n      const {\n        formatName,\n        formatOptions\n      } = parseFormatStr(f);\n      if (this.formats[formatName]) {\n        let formatted = mem;\n        try {\n          const valOptions = options?.formatParams?.[options.interpolationkey] || {};\n          const l = valOptions.locale || valOptions.lng || options.locale || options.lng || lng;\n          formatted = this.formats[formatName](mem, l, {\n            ...formatOptions,\n            ...options,\n            ...valOptions\n          });\n        } catch (error) {\n          this.logger.warn(error);\n        }\n        return formatted;\n      } else {\n        this.logger.warn(`there was no format function for ${formatName}`);\n      }\n      return mem;\n    }, value);\n    return result;\n  }\n}\n\nconst removePending = (q, name) => {\n  if (q.pending[name] !== undefined) {\n    delete q.pending[name];\n    q.pendingCount--;\n  }\n};\nclass Connector extends EventEmitter {\n  constructor(backend, store, services, options = {}) {\n    super();\n    this.backend = backend;\n    this.store = store;\n    this.services = services;\n    this.languageUtils = services.languageUtils;\n    this.options = options;\n    this.logger = baseLogger.create('backendConnector');\n    this.waitingReads = [];\n    this.maxParallelReads = options.maxParallelReads || 10;\n    this.readingCalls = 0;\n    this.maxRetries = options.maxRetries >= 0 ? options.maxRetries : 5;\n    this.retryTimeout = options.retryTimeout >= 1 ? options.retryTimeout : 350;\n    this.state = {};\n    this.queue = [];\n    this.backend?.init?.(services, options.backend, options);\n    this.callbackApi = callbackApiOf(this.backend);\n    if (this.backend && this.callbackApi === undefined && (this.backend.read || this.backend.create)) {\n      this.logger.deprecate('backend: set callbackApi to declare the calling convention (true: read(language, namespace, callback) and create(languages, namespace, key, fallbackValue, callback, options); false: both return a promise or a value); guessing it from the number of parameters is deprecated');\n    }\n  }\n  queueLoad(languages, namespaces, options, callback) {\n    const toLoad = {};\n    const pending = {};\n    const toLoadLanguages = {};\n    const toLoadNamespaces = {};\n    languages.forEach(lng => {\n      let hasAllNamespaces = true;\n      namespaces.forEach(ns => {\n        const name = `${lng}|${ns}`;\n        if (!options.reload && this.store.hasResourceBundle(lng, ns)) {\n          this.state[name] = 2;\n        } else if (!options.reload && this.state[name] < 0) ; else if (this.state[name] === 1) {\n          if (pending[name] === undefined) pending[name] = true;\n        } else {\n          this.state[name] = 1;\n          hasAllNamespaces = false;\n          if (pending[name] === undefined) pending[name] = true;\n          if (toLoad[name] === undefined) toLoad[name] = true;\n          if (toLoadNamespaces[ns] === undefined) toLoadNamespaces[ns] = true;\n        }\n      });\n      if (!hasAllNamespaces) toLoadLanguages[lng] = true;\n    });\n    if (Object.keys(toLoad).length || Object.keys(pending).length) {\n      this.queue.push({\n        pending,\n        pendingCount: Object.keys(pending).length,\n        loaded: {},\n        errors: [],\n        callback\n      });\n    }\n    return {\n      toLoad: Object.keys(toLoad),\n      pending: Object.keys(pending),\n      toLoadLanguages: Object.keys(toLoadLanguages),\n      toLoadNamespaces: Object.keys(toLoadNamespaces)\n    };\n  }\n  loaded(name, err, data) {\n    const s = name.split('|');\n    const lng = s[0];\n    const ns = s[1];\n    if (err) this.emit('failedLoading', lng, ns, err);\n    if (!err && data) {\n      this.store.addResourceBundle(lng, ns, data, undefined, undefined, {\n        skipCopy: true\n      });\n    }\n    this.state[name] = err ? -1 : 2;\n    if (err && data) this.state[name] = 0;\n    const loaded = {};\n    this.queue.forEach(q => {\n      pushPath(q.loaded, [lng], ns);\n      removePending(q, name);\n      if (err) q.errors.push(err);\n      if (q.pendingCount === 0 && !q.done) {\n        Object.keys(q.loaded).forEach(l => {\n          if (!loaded[l]) loaded[l] = {};\n          const loadedKeys = q.loaded[l];\n          if (loadedKeys.length) {\n            loadedKeys.forEach(n => {\n              if (loaded[l][n] === undefined) loaded[l][n] = true;\n            });\n          }\n        });\n        q.done = true;\n        if (q.errors.length) {\n          q.callback(q.errors);\n        } else {\n          q.callback();\n        }\n      }\n    });\n    this.emit('loaded', loaded);\n    this.queue = this.queue.filter(q => !q.done);\n  }\n  read(lng, ns, fcName, tried = 0, wait = this.retryTimeout, callback) {\n    if (!lng.length) return callback(null, {});\n    if (this.readingCalls >= this.maxParallelReads) {\n      this.waitingReads.push({\n        lng,\n        ns,\n        fcName,\n        tried,\n        wait,\n        callback\n      });\n      return;\n    }\n    this.readingCalls++;\n    const resolver = (err, data) => {\n      this.readingCalls--;\n      if (this.waitingReads.length > 0) {\n        const next = this.waitingReads.shift();\n        this.read(next.lng, next.ns, next.fcName, next.tried, next.wait, next.callback);\n      }\n      if (err && data && tried < this.maxRetries) {\n        setTimeout(() => {\n          this.read(lng, ns, fcName, tried + 1, wait * 2, callback);\n        }, wait);\n        return;\n      }\n      callback(err, data);\n    };\n    const fc = this.backend[fcName].bind(this.backend);\n    if (this.callbackApi === false || this.callbackApi === undefined && fc.length === 2) {\n      try {\n        const r = fc(lng, ns);\n        if (r && typeof r.then === 'function') {\n          r.then(data => resolver(null, data)).catch(resolver);\n        } else {\n          resolver(null, r);\n        }\n      } catch (err) {\n        resolver(err);\n      }\n      return;\n    }\n    return fc(lng, ns, resolver);\n  }\n  prepareLoading(languages, namespaces, options = {}, callback) {\n    if (!this.backend) {\n      this.logger.warn('No backend was added via i18next.use. Will not load resources.');\n      return callback && callback();\n    }\n    if (isString(languages)) languages = this.languageUtils.toResolveHierarchy(languages);\n    if (isString(namespaces)) namespaces = [namespaces];\n    const toLoad = this.queueLoad(languages, namespaces, options, callback);\n    if (!toLoad.toLoad.length) {\n      if (!toLoad.pending.length) callback();\n      return null;\n    }\n    toLoad.toLoad.forEach(name => {\n      this.loadOne(name);\n    });\n  }\n  load(languages, namespaces, callback) {\n    this.prepareLoading(languages, namespaces, {}, callback);\n  }\n  reload(languages, namespaces, callback) {\n    this.prepareLoading(languages, namespaces, {\n      reload: true\n    }, callback);\n  }\n  noticeDevFallback(lng) {\n    if (lng !== 'dev' || !this.devIsDefaultFallback) return;\n    this.logger.once('dev', 'warn', \"language 'dev' is requested because fallbackLng is not set (its default is ['dev']); i18next v27 defaults to fallbackLng: false and loads and saves missing keys in the requested language instead. Set fallbackLng to your source language, or to 'dev' to keep this behavior\");\n  }\n  loadOne(name, prefix = '') {\n    const s = name.split('|');\n    const lng = s[0];\n    const ns = s[1];\n    this.noticeDevFallback(lng);\n    this.read(lng, ns, 'read', undefined, undefined, (err, data) => {\n      if (err) this.logger.warn(`${prefix}loading namespace ${ns} for language ${lng} failed`, err);\n      if (!err && data) this.logger.log(`${prefix}loaded namespace ${ns} for language ${lng}`, data);\n      this.loaded(name, err, data);\n    });\n  }\n  saveMissing(languages, namespace, key, fallbackValue, isUpdate, options = {}, clb = () => {}, hasLoadedNamespace = this.newestCloneHasLoadedNamespace || this.services?.utils?.hasLoadedNamespace) {\n    if (hasLoadedNamespace && !hasLoadedNamespace(namespace)) {\n      this.logger.warn(`did not save key \"${key}\" as the namespace \"${namespace}\" was not yet loaded`, 'This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!');\n      return;\n    }\n    if (key === undefined || key === null || key === '') return;\n    if (this.backend?.create) {\n      languages?.forEach?.(l => this.noticeDevFallback(l));\n      const opts = {\n        ...options,\n        isUpdate\n      };\n      const fc = this.backend.create.bind(this.backend);\n      if (this.callbackApi === false || this.callbackApi === undefined && fc.length < 6) {\n        try {\n          let r;\n          if (this.callbackApi === false || fc.length === 5) {\n            r = fc(languages, namespace, key, fallbackValue, opts);\n          } else {\n            r = fc(languages, namespace, key, fallbackValue);\n          }\n          if (r && typeof r.then === 'function') {\n            r.then(data => clb(null, data)).catch(clb);\n          } else {\n            clb(null, r);\n          }\n        } catch (err) {\n          clb(err);\n        }\n      } else {\n        fc(languages, namespace, key, fallbackValue, clb, opts);\n      }\n    }\n    if (!languages || !languages[0]) return;\n    this.store.addResource(languages[0], namespace, key, fallbackValue);\n  }\n}\n\nconst get = () => ({\n  debug: false,\n  initAsync: true,\n  ns: ['translation'],\n  defaultNS: ['translation'],\n  fallbackLng: ['dev'],\n  fallbackNS: false,\n  supportedLngs: false,\n  nonExplicitSupportedLngs: false,\n  load: 'all',\n  preload: false,\n  keySeparator: '.',\n  nsSeparator: ':',\n  pluralSeparator: '_',\n  contextSeparator: '_',\n  enableSelector: false,\n  partialBundledLanguages: false,\n  saveMissing: false,\n  updateMissing: false,\n  saveMissingTo: 'fallback',\n  saveMissingPlurals: true,\n  missingKeyHandler: false,\n  missingInterpolationHandler: false,\n  postProcess: false,\n  postProcessPassResolved: false,\n  returnNull: false,\n  returnEmptyString: true,\n  returnObjects: false,\n  joinArrays: false,\n  returnedObjectHandler: false,\n  parseMissingKeyHandler: false,\n  appendNamespaceToMissingKey: false,\n  appendNamespaceToCIMode: false,\n  overloadTranslationOptionHandler: args => {\n    let ret = {};\n    if (typeof args[1] === 'object') ret = args[1];\n    if (isString(args[1])) ret.defaultValue = args[1];\n    if (isString(args[2])) ret.tDescription = args[2];\n    if (typeof args[2] === 'object' || typeof args[3] === 'object') {\n      const options = args[3] || args[2];\n      Object.keys(options).forEach(key => {\n        ret[key] = options[key];\n      });\n    }\n    return ret;\n  },\n  interpolation: {\n    escapeValue: true,\n    prefix: '{{',\n    suffix: '}}',\n    formatSeparator: ',',\n    unescapePrefix: '-',\n    nestingPrefix: '$t(',\n    nestingSuffix: ')',\n    nestingOptionsSeparator: ',',\n    maxReplaces: 1000,\n    skipOnVariables: true\n  },\n  cacheInBuiltFormats: true\n});\nconst transformOptions = options => {\n  if (isString(options.ns)) options.ns = [options.ns];\n  if (isString(options.fallbackLng)) options.fallbackLng = [options.fallbackLng];\n  if (isString(options.fallbackNS)) options.fallbackNS = [options.fallbackNS];\n  if (options.supportedLngs && !options.supportedLngs.includes('cimode')) {\n    options.supportedLngs = options.supportedLngs.concat(['cimode']);\n  }\n  return options;\n};\n\nconst noop = () => {};\nlet loggerOwner;\nconst bindMemberFunctions = inst => {\n  const mems = Object.getOwnPropertyNames(Object.getPrototypeOf(inst));\n  mems.forEach(mem => {\n    if (typeof inst[mem] === 'function') {\n      inst[mem] = inst[mem].bind(inst);\n    }\n  });\n};\nclass I18n extends EventEmitter {\n  constructor(options = {}, callback) {\n    super();\n    this.options = transformOptions(options);\n    this.services = {\n      ownPostProcessors: new Set()\n    };\n    this.logger = baseLogger;\n    this.modules = {\n      external: []\n    };\n    bindMemberFunctions(this);\n    if (callback && !this.isInitialized && !options.isClone) {\n      if (!this.options.initAsync) {\n        this.init(options, callback);\n        return this;\n      }\n      setTimeout(() => {\n        this.init(options, callback);\n      }, 0);\n    }\n  }\n  init(options = {}, callback) {\n    this.isInitializing = true;\n    if (typeof options === 'function') {\n      callback = options;\n      options = {};\n    }\n    if (options.defaultNS == null && options.ns) {\n      if (isString(options.ns)) {\n        options.defaultNS = options.ns;\n      } else if (!options.ns.includes('translation')) {\n        options.defaultNS = options.ns[0];\n      }\n    }\n    const fallbackLngIsDefault = options.fallbackLng === undefined && this.options.fallbackLng === undefined;\n    const defOpts = get();\n    this.options = {\n      ...defOpts,\n      ...this.options,\n      ...transformOptions(options)\n    };\n    this.options.interpolation = {\n      ...defOpts.interpolation,\n      ...this.options.interpolation\n    };\n    if (options.keySeparator !== undefined) {\n      this.options.userDefinedKeySeparator = options.keySeparator;\n    }\n    if (options.nsSeparator !== undefined) {\n      this.options.userDefinedNsSeparator = options.nsSeparator;\n    }\n    if (typeof this.options.overloadTranslationOptionHandler !== 'function') {\n      this.options.overloadTranslationOptionHandler = defOpts.overloadTranslationOptionHandler;\n    }\n    const createClassOnDemand = ClassOrObject => {\n      if (!ClassOrObject) return null;\n      if (typeof ClassOrObject === 'function') return new ClassOrObject();\n      return ClassOrObject;\n    };\n    if (!this.options.isClone) {\n      if (loggerOwner && loggerOwner !== this && loggerOwner.modules.logger !== this.modules.logger) {\n        baseLogger.deprecate('init: this init() replaces the logger another i18next instance set with use(), as the logger is shared in v26; from v27 each instance keeps its own logger');\n      }\n      loggerOwner = this.modules.logger ? this : undefined;\n      if (this.modules.logger) {\n        baseLogger.init(createClassOnDemand(this.modules.logger), this.options);\n      } else {\n        baseLogger.init(null, this.options);\n      }\n      this.pendingWarnings?.forEach(msg => this.logger.warn(msg));\n      this.pendingWarnings = undefined;\n      let formatter;\n      if (this.modules.formatter) {\n        formatter = this.modules.formatter;\n      } else {\n        formatter = Formatter;\n      }\n      const lu = new LanguageUtil(this.options);\n      this.store = new ResourceStore(this.options.resources, this.options);\n      const s = this.services;\n      s.logger = baseLogger;\n      s.resourceStore = this.store;\n      s.languageUtils = lu;\n      s.pluralResolver = new PluralResolver(lu, {\n        prepend: this.options.pluralSeparator\n      });\n      if (formatter) {\n        s.formatter = createClassOnDemand(formatter);\n        if (s.formatter.init) s.formatter.init(s, this.options);\n        this.options.interpolation.format = s.formatter.format.bind(s.formatter);\n      }\n      s.interpolator = new Interpolator(this.options);\n      s.utils = {\n        hasLoadedNamespace: this.hasLoadedNamespace.bind(this),\n        reloadResources: this.reloadResources.bind(this)\n      };\n      s.backendConnector = new Connector(createClassOnDemand(this.modules.backend), s.resourceStore, s, this.options);\n      s.backendConnector.devIsDefaultFallback = fallbackLngIsDefault;\n      s.backendConnector.on('*', (event, ...args) => {\n        this.emit(event, ...args);\n      });\n      if (this.modules.languageDetector) {\n        s.languageDetector = createClassOnDemand(this.modules.languageDetector);\n        if (s.languageDetector.init) s.languageDetector.init(s, this.options.detection, this.options);\n        if (s.languageDetector.async && callbackApiOf(s.languageDetector) === undefined) {\n          this.logger.deprecate('languageDetector: set callbackApi to declare how the async detect() answers (true: detect(callback); false: detect() returns a promise); guessing it from the number of parameters is deprecated');\n        }\n      }\n      if (this.modules.i18nFormat) {\n        s.i18nFormat = createClassOnDemand(this.modules.i18nFormat);\n        if (s.i18nFormat.init) s.i18nFormat.init(this);\n      }\n      this.translator = new Translator(this.services, this.options);\n      this.translator.on('*', (event, ...args) => {\n        this.emit(event, ...args);\n      });\n      this.modules.external.forEach(m => {\n        if (m.init) m.init(this);\n      });\n    }\n    this.format = this.options.interpolation.format;\n    if (!callback) callback = noop;\n    if (this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {\n      const codes = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);\n      if (codes.length > 0 && codes[0] !== 'dev') this.options.lng = codes[0];\n    }\n    if (!this.services.languageDetector && !this.options.lng) {\n      this.logger.warn('init: no languageDetector is used and no lng is defined');\n    }\n    const storeApi = ['getResource', 'hasResourceBundle', 'getResourceBundle', 'getDataByLanguage'];\n    storeApi.forEach(fcName => {\n      this[fcName] = (...args) => this.store[fcName](...args);\n    });\n    const storeApiChained = ['addResource', 'addResources', 'addResourceBundle', 'removeResourceBundle'];\n    storeApiChained.forEach(fcName => {\n      this[fcName] = (...args) => {\n        this.store[fcName](...args);\n        return this;\n      };\n    });\n    const deferred = defer();\n    const load = () => {\n      const finish = (err, t) => {\n        this.isInitializing = false;\n        if (this.isInitialized && !this.initializedStoreOnce) this.logger.warn('init: i18next is already initialized. You should call init just once!');\n        this.isInitialized = true;\n        if (!this.options.isClone) this.logger.log('initialized', this.options);\n        this.emit('initialized', this.options);\n        deferred.resolve(t);\n        callback(err, t);\n      };\n      if ((this.languages || this.isLanguageChangingTo) && !this.isInitialized) return finish(null, this.t.bind(this));\n      this.changeLanguage(this.options.lng, finish);\n    };\n    if (this.options.resources || !this.options.initAsync) {\n      load();\n    } else {\n      setTimeout(load, 0);\n    }\n    return deferred;\n  }\n  loadResources(language, callback = noop) {\n    let usedCallback = callback;\n    const usedLng = isString(language) ? language : this.language;\n    if (typeof language === 'function') usedCallback = language;\n    if (!this.options.resources || this.options.partialBundledLanguages) {\n      if (usedLng?.toLowerCase() === 'cimode' && (!this.options.preload || this.options.preload.length === 0)) return usedCallback();\n      const toLoad = [];\n      const append = lng => {\n        if (!lng) return;\n        if (lng === 'cimode') return;\n        const lngs = this.services.languageUtils.toResolveHierarchy(lng);\n        lngs.forEach(l => {\n          if (l === 'cimode') return;\n          if (!toLoad.includes(l)) toLoad.push(l);\n        });\n      };\n      if (!usedLng) {\n        const fallbacks = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);\n        fallbacks.forEach(l => append(l));\n      } else {\n        append(usedLng);\n      }\n      this.options.preload?.forEach?.(l => append(l));\n      this.services.backendConnector.load(toLoad, this.options.ns, e => {\n        if (!e && !this.resolvedLanguage && this.language) this.setResolvedLanguage(this.language);\n        usedCallback(e);\n      });\n    } else {\n      usedCallback(null);\n    }\n  }\n  reloadResources(lngs, ns, callback) {\n    const deferred = defer();\n    if (typeof lngs === 'function') {\n      callback = lngs;\n      lngs = undefined;\n    }\n    if (typeof ns === 'function') {\n      callback = ns;\n      ns = undefined;\n    }\n    if (!lngs) {\n      const requested = Object.keys(this.services.backendConnector.state).map(name => name.split('|')[0]);\n      lngs = [...new Set([...(this.languages || []), ...requested])].filter(l => l !== 'cimode');\n    }\n    if (!ns) ns = this.options.ns;\n    if (!callback) callback = noop;\n    this.services.backendConnector.reload(lngs, ns, err => {\n      deferred.resolve();\n      callback(err);\n    });\n    return deferred;\n  }\n  use(module) {\n    if (!module) throw new Error('You are passing an undefined module! Please check the object you are passing to i18next.use()');\n    if (!module.type) throw new Error('You are passing a wrong module! Please check the object you are passing to i18next.use()');\n    const setModule = type => {\n      if (this.modules[type] && this.modules[type] !== module) {\n        const msg = `use: this ${type} replaces the ${type} passed to an earlier use() call; only one ${type} is used per instance`;\n        if (this.isInitializing || this.isInitialized) this.logger.warn(msg);else (this.pendingWarnings = this.pendingWarnings || []).push(msg);\n      }\n      this.modules[type] = module;\n    };\n    if (module.type === 'backend') {\n      setModule('backend');\n    }\n    if (module.type === 'logger' || module.log && module.warn && module.error) {\n      this.modules.logger = module;\n    }\n    if (module.type === 'languageDetector') {\n      setModule('languageDetector');\n    }\n    if (module.type === 'i18nFormat') {\n      setModule('i18nFormat');\n    }\n    if (module.type === 'postProcessor') {\n      postProcessor.addPostProcessor(module);\n      this.services.ownPostProcessors?.add(module.name);\n    }\n    if (module.type === 'formatter') {\n      setModule('formatter');\n    }\n    if (module.type === '3rdParty') {\n      this.modules.external.push(module);\n    }\n    return this;\n  }\n  hydrate(resources, lng) {\n    if (this.options.isClone) return this;\n    if (!this.services.resourceStore) {\n      this.logger.warn('hydrate: call init() first, the instance has no resource store yet');\n      return this;\n    }\n    if (resources && !this.initializedStoreOnce) {\n      this.services.resourceStore.data = resources;\n      Object.values(resources).forEach(lngResources => {\n        Object.keys(lngResources).forEach(ns => {\n          if (!this.options.ns.includes(ns)) this.options.ns.push(ns);\n        });\n      });\n      this.initializedStoreOnce = true;\n      this.isInitialized = true;\n    }\n    if (lng && !this.initializedLanguageOnce) {\n      this.changeLanguage(lng);\n      this.initializedLanguageOnce = true;\n    }\n    return this;\n  }\n  setResolvedLanguage(l) {\n    if (!l || !this.languages) return;\n    if (['cimode', 'dev'].includes(l)) return;\n    for (let li = 0; li < this.languages.length; li++) {\n      const lngInLngs = this.languages[li];\n      if (['cimode', 'dev'].includes(lngInLngs)) continue;\n      if (this.store.hasLanguageSomeTranslations(lngInLngs)) {\n        this.resolvedLanguage = lngInLngs;\n        break;\n      }\n    }\n    if (!this.resolvedLanguage && !this.languages.includes(l) && this.store.hasLanguageSomeTranslations(l)) {\n      this.resolvedLanguage = l;\n      this.languages.unshift(l);\n    }\n  }\n  changeLanguage(lng, callback) {\n    this.isLanguageChangingTo = lng;\n    const deferred = defer();\n    this.emit('languageChanging', lng);\n    const setLngProps = l => {\n      this.language = l;\n      this.languages = this.services.languageUtils.toResolveHierarchy(l);\n      this.resolvedLanguage = undefined;\n      this.setResolvedLanguage(l);\n    };\n    const done = (err, l) => {\n      if (l) {\n        if (this.isLanguageChangingTo === lng) {\n          setLngProps(l);\n          this.translator.changeLanguage(l);\n          this.isLanguageChangingTo = undefined;\n          this.emit('languageChanged', l);\n          this.logger.log('languageChanged', l);\n        }\n      } else {\n        this.isLanguageChangingTo = undefined;\n      }\n      deferred.resolve((...args) => this.t(...args));\n      if (callback) callback(err, (...args) => this.t(...args));\n    };\n    const setLng = lngs => {\n      if (!lng && !lngs && this.services.languageDetector) lngs = [];\n      const fl = isString(lngs) ? lngs : lngs && lngs[0];\n      const l = this.store.hasLanguageSomeTranslations(fl) ? fl : this.services.languageUtils.getBestMatchFromCodes(isString(lngs) ? [lngs] : lngs);\n      if (l && this.logger.debug && !isSafeLanguageCode(l)) {\n        const configured = [].concat(this.options.supportedLngs || [], this.services.languageUtils.getFallbackCodes(this.options.fallbackLng, l), this.options.preload || []);\n        if (!configured.includes(l) && !Object.prototype.hasOwnProperty.call(this.store.data, l)) {\n          this.logger.once(`lng:${l}`, 'deprecate', `changeLanguage: the language code '${l.slice(0, 64)}' comes from lng, changeLanguage() or the language detector and is not configured; from v27 such a code is refused unless it has only letters, digits, '-', '_', '@' and '.' (no '..'), at most 128 characters. Set supportedLngs, or check the code before passing it on`);\n        }\n      }\n      if (l) {\n        if (!this.language) {\n          setLngProps(l);\n        }\n        if (!this.translator.language) this.translator.changeLanguage(l);\n        this.services.languageDetector?.cacheUserLanguage?.(l);\n      }\n      this.loadResources(l, err => {\n        done(err, l);\n      });\n    };\n    if (!lng && this.services.languageDetector && !this.services.languageDetector.async) {\n      setLng(this.services.languageDetector.detect());\n    } else if (!lng && this.services.languageDetector && this.services.languageDetector.async) {\n      const callbackApi = callbackApiOf(this.services.languageDetector);\n      if (callbackApi === false || callbackApi === undefined && this.services.languageDetector.detect.length === 0) {\n        this.services.languageDetector.detect().then(setLng);\n      } else {\n        this.services.languageDetector.detect(setLng);\n      }\n    } else {\n      setLng(lng);\n    }\n    return deferred;\n  }\n  getFixedT(lng, ns, keyPrefix, fixedOpts) {\n    const scopeNs = fixedOpts?.scopeNs;\n    const fixedT = (key, opts, ...rest) => {\n      let o;\n      if (typeof opts !== 'object') {\n        o = this.options.overloadTranslationOptionHandler([key, opts].concat(rest));\n      } else {\n        o = {\n          ...opts\n        };\n      }\n      o.lng = o.lng || fixedT.lng;\n      o.lngs = o.lngs || fixedT.lngs;\n      const explicitCallNs = o.ns !== undefined && o.ns !== null;\n      o.ns = o.ns || fixedT.ns;\n      if (o.keyPrefix !== '') o.keyPrefix = o.keyPrefix || keyPrefix || fixedT.keyPrefix;\n      const selectorOpts = {\n        ...this.options,\n        ...o\n      };\n      if (Array.isArray(scopeNs) && !explicitCallNs) selectorOpts.ns = scopeNs;\n      if (typeof o.keyPrefix === 'function') o.keyPrefix = keysFromSelector(o.keyPrefix, selectorOpts);\n      const keySeparator = this.options.keySeparator || '.';\n      let resultKey;\n      if (o.keyPrefix && Array.isArray(key)) {\n        resultKey = key.map(k => {\n          if (typeof k === 'function') k = keysFromSelector(k, selectorOpts);\n          return `${o.keyPrefix}${keySeparator}${k}`;\n        });\n      } else {\n        if (typeof key === 'function') key = keysFromSelector(key, selectorOpts);\n        resultKey = o.keyPrefix ? `${o.keyPrefix}${keySeparator}${key}` : key;\n      }\n      return this.t(resultKey, o);\n    };\n    if (isString(lng)) {\n      fixedT.lng = lng;\n    } else {\n      fixedT.lngs = lng;\n    }\n    fixedT.ns = ns;\n    fixedT.keyPrefix = keyPrefix;\n    return fixedT;\n  }\n  t(...args) {\n    if (!this.translator) {\n      this.logger.warn('t: called before init(); returning an empty string');\n      return '';\n    }\n    return this.translator.translate(...args);\n  }\n  exists(...args) {\n    return this.translator?.exists(...args);\n  }\n  setDefaultNamespace(ns) {\n    this.options.defaultNS = ns;\n  }\n  hasLoadedNamespace(ns, options = {}) {\n    if (!this.isInitialized) {\n      this.logger.warn('hasLoadedNamespace: i18next was not initialized', this.languages);\n      return false;\n    }\n    if (!this.languages || !this.languages.length) {\n      this.logger.warn('hasLoadedNamespace: i18n.languages were undefined or empty', this.languages);\n      return false;\n    }\n    const lng = options.lng || this.resolvedLanguage || this.languages[0];\n    const fallbackLng = this.options ? this.options.fallbackLng : false;\n    const lastLng = this.languages[this.languages.length - 1];\n    if (lng.toLowerCase() === 'cimode') return true;\n    const loadNotPending = (l, n) => {\n      const loadState = this.services.backendConnector.state[`${l}|${n}`];\n      return loadState === -1 || loadState === 0 || loadState === 2;\n    };\n    if (options.precheck) {\n      const preResult = options.precheck(this, loadNotPending);\n      if (preResult !== undefined) return preResult;\n    }\n    if (this.hasResourceBundle(lng, ns)) return true;\n    if (!this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages) return true;\n    const {\n      languageUtils\n    } = this.services;\n    const loadLng = !options.lng ? lng : languageUtils.isSupportedCode(lng) && languageUtils.toResolveHierarchy(lng, false)[0];\n    if ((!loadLng || loadNotPending(loadLng, ns)) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;\n    return false;\n  }\n  loadNamespaces(ns, callback) {\n    const deferred = defer();\n    if (!this.options.ns) {\n      if (callback) callback();\n      return Promise.resolve();\n    }\n    if (isString(ns)) ns = [ns];\n    ns.forEach(n => {\n      if (!this.options.ns.includes(n)) this.options.ns.push(n);\n    });\n    this.loadResources(err => {\n      deferred.resolve();\n      if (callback) callback(err);\n    });\n    return deferred;\n  }\n  loadLanguages(lngs, callback) {\n    const deferred = defer();\n    if (isString(lngs)) lngs = [lngs];\n    const preloaded = this.options.preload || [];\n    const newLngs = lngs.filter(lng => !preloaded.includes(lng) && this.services.languageUtils.isSupportedCode(lng));\n    if (!newLngs.length) {\n      if (callback) callback();\n      return Promise.resolve();\n    }\n    this.options.preload = preloaded.concat(newLngs);\n    this.loadResources(err => {\n      deferred.resolve();\n      if (callback) callback(err);\n    });\n    return deferred;\n  }\n  dir(lng) {\n    if (!lng) lng = this.resolvedLanguage || (this.languages?.length > 0 ? this.languages[0] : this.language);\n    if (!lng) return 'ltr';\n    try {\n      const l = new Intl.Locale(lng);\n      if (l && l.getTextInfo) {\n        const ti = l.getTextInfo();\n        if (ti && ti.direction) return ti.direction;\n      }\n    } catch (e) {}\n    const rtlLngs = ['ar', 'shu', 'sqr', 'ssh', 'xaa', 'yhd', 'yud', 'aao', 'abh', 'abv', 'acm', 'acq', 'acw', 'acx', 'acy', 'adf', 'ads', 'aeb', 'aec', 'afb', 'ajp', 'apc', 'apd', 'arb', 'arq', 'ars', 'ary', 'arz', 'auz', 'avl', 'ayh', 'ayl', 'ayn', 'ayp', 'bbz', 'pga', 'he', 'iw', 'ps', 'pbt', 'pbu', 'pst', 'prp', 'prd', 'ug', 'ur', 'ydd', 'yds', 'yih', 'ji', 'yi', 'hbo', 'men', 'xmn', 'fa', 'jpr', 'peo', 'pes', 'prs', 'dv', 'sam', 'ckb'];\n    const languageUtils = this.services?.languageUtils || new LanguageUtil(get());\n    if (lng.toLowerCase().indexOf('-latn') > 1) return 'ltr';\n    return rtlLngs.includes(languageUtils.getLanguagePartFromCode(lng)) || lng.toLowerCase().indexOf('-arab') > 1 ? 'rtl' : 'ltr';\n  }\n  static createInstance(options = {}, callback) {\n    const instance = new I18n(options, callback);\n    instance.createInstance = I18n.createInstance;\n    return instance;\n  }\n  cloneInstance(options = {}, callback = noop) {\n    const forkResourceStore = options.forkResourceStore;\n    if (forkResourceStore) {\n      options = {\n        ...options\n      };\n      delete options.forkResourceStore;\n    }\n    const mergedOptions = {\n      ...this.options,\n      preload: false,\n      ...options,\n      ...{\n        isClone: true\n      }\n    };\n    const clone = new I18n(mergedOptions);\n    if (options.debug !== undefined || options.prefix !== undefined) {\n      clone.logger = clone.logger.clone(options);\n    }\n    const membersToCopy = ['store', 'services', 'language'];\n    membersToCopy.forEach(m => {\n      clone[m] = this[m];\n    });\n    clone.services = {\n      ...this.services\n    };\n    clone.services.utils = {\n      ...clone.services.utils,\n      hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone),\n      reloadResources: clone.reloadResources.bind(clone)\n    };\n    if (forkResourceStore) {\n      const copyData = obj => {\n        const copied = Array.isArray(obj) ? [...obj] : {\n          ...obj\n        };\n        Object.keys(copied).forEach(k => {\n          if (copied[k] && typeof copied[k] === 'object') copied[k] = copyData(copied[k]);\n        });\n        return copied;\n      };\n      const clonedData = copyData(this.store.data);\n      clone.store = new ResourceStore(clonedData, mergedOptions);\n      clone.services.resourceStore = clone.store;\n    }\n    if (options.interpolation) {\n      const defOpts = get();\n      const mergedInterpolation = {\n        ...defOpts.interpolation,\n        ...this.options.interpolation,\n        ...options.interpolation\n      };\n      const mergedForInterpolator = {\n        ...mergedOptions,\n        interpolation: mergedInterpolation\n      };\n      clone.services.interpolator = new Interpolator(mergedForInterpolator);\n    }\n    clone.translator = new Translator(clone.services, mergedOptions);\n    clone.translator.on('*', (event, ...args) => {\n      clone.emit(event, ...args);\n    });\n    clone.init(mergedOptions, callback);\n    clone.translator.options = mergedOptions;\n    clone.translator.backendConnector.newestCloneHasLoadedNamespace = clone.hasLoadedNamespace.bind(clone);\n    return clone;\n  }\n  toJSON() {\n    return {\n      options: this.options,\n      store: this.store,\n      language: this.language,\n      languages: this.languages,\n      resolvedLanguage: this.resolvedLanguage\n    };\n  }\n}\nconst instance = I18n.createInstance();\n\nconst createInstance = instance.createInstance;\nconst dir = instance.dir;\nconst init = instance.init;\nconst loadResources = instance.loadResources;\nconst reloadResources = instance.reloadResources;\nconst use = instance.use;\nconst changeLanguage = instance.changeLanguage;\nconst getFixedT = instance.getFixedT;\nconst t = instance.t;\nconst exists = instance.exists;\nconst setDefaultNamespace = instance.setDefaultNamespace;\nconst hasLoadedNamespace = instance.hasLoadedNamespace;\nconst loadNamespaces = instance.loadNamespaces;\nconst loadLanguages = instance.loadLanguages;\n\nexport { changeLanguage, createInstance, instance as default, dir, exists, getFixedT, hasLoadedNamespace, init, isSafeLanguageCode, keysFromSelector as keyFromSelector, loadLanguages, loadNamespaces, loadResources, reloadResources, setDefaultNamespace, t, use };\n","import type { Translation } from \"../Languages\";\n\nexport const en: Translation = {\n    moreoptions: \"More options\",\n    delete: \"Delete\",\n    create: \"Create\",\n    createfolder: \"Create a folder\",\n    createsubfolder: \"Create a subfolder\",\n    subfolder: \"Subfolder\",\n    display: \"Display\",\n    syncanalyses: \"Synchronise analyses\",\n    uploadedby: \"Uploaded by\",\n    uploadeddat: \"Uploaded at\",\n    overviewofyourfolders: \"Overview of your folders\",\n    content: \"Content\",\n\n    palette: \"Palette\",\n\n    layout_simple: \"Simple layout\",\n    layout_advanced: \"Evaluation layout\",\n    layout_nogui: \"No GUI\",\n    layout_lesson: \"Lesson layout\",\n\n    share: \"Share\",\n    fileloadingerror: \"File loading error\",\n    embedhint: \"To embed this block in another website, use the following code:\",\n    embedlibrary: \"Insert the library - once in HTML head\",\n    embedcomponent: \"Use the following code anywhere in HTML body\",\n    copy: \"Copy\",\n\n    remotefoldersbrowseraddfolderhint: \"If you add another folder in the storage, you will see additional evaluation options here.\",\n\n    loading: \"Loading\",\n    config: \"Settings\",\n\n    temperature: \"Temperature\",\n\n    file: \"File\",\n    upload: \"Upload\",\n    uploadafile: \"Upload a file\",\n    selectfile: \"Select a file\",\n    addfiles: \"Add file(s)\",\n    clear: \"Clear\",\n    dragorselectfile: \"Drag and drop an LRC file or select it from disk\",\n\n    detail: \"Detail\",\n\n    showeverything: \"Show everything\",\n\n\n    next: \"Next\",\n    prev: \"Previous\",\n    back: \"Back\",\n    close: \"Close\",\n    reload: \"Reload\",\n    open: \"Open\",\n\n    description: \"Description\",\n    author: \"Author\",\n    license: \"License\",\n    recordedat: \"Recorded at\",\n\n    displaysettings: \"Display settings\",\n    filerendering: \"File rendering\",\n    pixelated: \"Pixelated\",\n    smooth: \"Smooth\",\n    filerenderinghint: \"'Pixelated' mode disables antialising of the thermogram and enables you to see its pixels as they are.\",\n    adjusttimescale: \"Adjust temperature scale\",\n    automaticrange: \"Automatic range\",\n    fullrange: \"Full range\",\n    adjusttimescalehint: \"Adjust the time scale automatically (based on histogram) or set its values to the full range (min and max).\",\n\n    palettename: \"{{name}} palette\",\n    colourpalettehint: \"Select colour palette of thermal display.\",\n\n\n\n    fileinfo: \"File info\",\n    thermalfilename: \"IR file name\",\n    thermalfileurl: \"IR file URL\",\n    thermalfiledownload: \"Download the IR file\",\n    visiblefilename: \"Visual file name\",\n    visiblefileurl: \"Visual file URL\",\n    visiblefiledownload: \"Visual file download\",\n    togglevisibleimage: \"Switch IR / VIS image\",\n\n    time: \"Time\",\n    duration: \"Duration\",\n    resolution: \"Resolution\",\n    bytesize: \"Bytesize\",\n    minimaltemperature: \"Minimal temperature\",\n    maximaltemperature: \"Maximal temperature\",\n    filetype: \"File type\",\n    type: \"Type\",\n    supporteddevices: \"Supported devices\",\n\n\n    numfiles: \"{{num}} files\",\n\n    download: \"Download\",\n    downloadoriginalfiles: \"- individual files\",\n    downloadoriginalfileshint: \"Download all source IR files\",\n    downloadoriginalfile: \"- Original thermal file {{type}}\",\n    exportcurrentframeaspng: \"- Current frame\",\n    convertentiresequencetovideo: \"- Convert entire sequence to video\",\n    pngofindividualimages: \"- individual files\",\n    pngofindividualimageshint: \"Export all files individually.\",\n    pngofentiregroup: \"- group\",\n    pngofentiregrouphint: \"Export the entire group as one image\",\n    csvofanalysisdata: \"- analysis data\",\n    csvofanalysisdatahint: \"Table of temperatures in analyses\",\n    exportimagewidth: \"Exported image width\",\n    exportimagefontsize: \"Exported image font size\",\n    exportgroupname: \"Export group name\",\n    exportfilenames: \"Export file names\",\n    exportdimensions: \"Export dimensions\",\n    exportgroup: \"Export group\",\n    exportcontent: \"Export content\",\n    numberofcolumns: \"Number of columns\",\n    thermalscale: \"Thermal scale\",\n    thermalrange: \"Thermal range\",\n    filedate: \"File date\",\n\n    folder: \"Folder\",\n    folders: \"Folders\",\n\n    range: \"Range\",\n    info: \"Info\",\n    note: \"Note\",\n    group: \"Group\",\n    donotgroup: \"Do not group\",\n    groupby: \"Group {{era}}\",\n    groupped: \"groupped\",\n\n    showingfolder: \"Displaying the folder\",\n    showingfolders: \"Displaying folders\",\n    and: \"and\",\n    or: \"or\",\n    doyouwanttoadd: \"Do you want to diaplay also\",\n    youmayalsoadd: \"You may also display\",\n\n    bydays: \"by day\",\n    byhours: \"by hour\",\n    byweeks: \"by week\",\n    bymonths: \"by month\",\n    byyears: \"by year\",\n\n    play: \"Play\",\n    pause: \"Pause\",\n    stop: \"Stop\",\n    date: \"Date\",\n    frame: \"Frame\",\n    playbackspeed: \"Playback speed\",\n    graphlines: \"Graph lines\",\n    straightlines: \"Straight lines\",\n    smoothlines: \"Smooth lines\",\n    graphlineshint: \"'Smooth lines' can illustrate trends better, but are less precise. If you need to see exactly what is in the thermogram, use 'Straight lines'.\",\n\n    analysis: \"Analysis\",\n    analyses: \"Analyses\",\n    avg: \"AVG\",\n    min: \"MIN\",\n    max: \"MAX\",\n    size: \"Size\",\n    edit: \"Edit\",\n    editsth: \"Edit {{what}}\",\n    remove: \"Remove\",\n    addpoint: \"Add point\",\n    addellipsis: \"Add ellipsis\",\n    addrectangle: \"Add rectangle\",\n    analysishint: \"You may select area in the IR image to see its temperatures.\",\n    graph: \"Graph\",\n    graphhint1: \"Add analysis first to see the graph!\",\n    graphhint2: \"Click on an analysis <thermal-btn variant='background' interactive='false' tooltip='You can see them in the table above...'>value</thermal-btn> to see its graph here!\",\n\n    rectangle: \"rectangle\",\n    ellipsis: \"ellipsis\",\n    point: \"point\",\n    name: \"Name\",\n    color: \"Color\",\n    top: \"Top\",\n    left: \"Left\",\n    right: \"Right\",\n    bottom: \"Bottom\",\n    columns: \"{{num}} images in a row\",\n\n    fromto: \"From {{from}} to {{to}}\",\n    downloadgraphdataascsv: \"Download graph data as CSV\",\n\n    apparenttemperature: \"Apparent temperature\",\n    apparenttemperaturehint: \"This converter uses the apparent temperature model <a href='{{href}}' target='_blank'>Australian Apparent Temperature</a>.\",\n    airtemperature: \"Air temperature\",\n    relativeairhumidity: \"Relative air humidity\",\n    windspeed: \"Wind speed\",\n    inpercent: \"in percent\",\n\n    analysissync: \"Synchronise analyses\",\n\n    apparenttemperatureverbose: \"The thermometer shows {{t}} °C, but due to humidity and wind, it feels like {{app}} °C outside.\",\n    youfeelwarmer: \"The apparent temperature is {{diff}} °C higher than the air temperature.\",\n    youfeelcolder: \"The apparent temperature is {{diff}} °C lower than the air temperature.\",\n\n\n    inspecttemperatures: \"Inspect temperatures\",\n    usemousetoinspecttemperaturevalues: \"Use mouse to inspect temperature values.\",\n\n    editanalysis: \"Edit analysis\",\n    dragcornersofselectedanalysis: \"Drag corners of any selected analysis.\",\n\n    addpointanalysis: \"Add a point analysis\",\n    clickandaddpoint: \"Click on the IR image to add a point analysis\",\n\n    addrectangleanalysis: \"Add a rectangular analysis\",\n    clickandaddrectangle: \"Click and drag on the IR image to add a rectangular analysis.\",\n\n    addellipsisanalysis: \"Add an elyptical analysis\",\n    clickandaddellipsis: \"Click and drag on the thermogram to add an elyptical analysis.\",\n\n\n    tutorial: \"Tutorial\",\n    colourpalette: \"Colour palette\",\n    palettehint: \"Use the menu to change the colour palette.\",\n\n    remotefoldersbrowser: \"Remote folders browser\",\n\n    server: \"Server\",\n    networklog: \"Network Log\",\n    editfile: \"Edit File\",\n    editfolder: \"Edit Folder\",\n    editcomment: \"Edit Comment\",\n    user: \"User\",\n    griddisplay: \"Grid display\",\n    tabledisplay: \"Table display\",\n    deletefile: \"Delete File\",\n    deletefolder: \"Delete Folder\",\n    comments: \"Comments\",\n    deletecomment: \"Delete Comment\",\n    savecomment: \"Save Comment\",\n    addcomment: \"Add Comment\",\n    nocomments: \"No comments\",\n    savechanges: \"Save Changes\",\n    uploadfile: \"Upload File\",\n    compactview: \"Compact View\",\n    showdiscussion: \"Show Discussion\",\n    edittags: \"Edit Tags\",\n    availabletags: \"Available Tags\",\n    assignedtags: \"Assigned Tags\",\n    connectioninformation: \"Connection Information\",\n    serverurl: \"Server URL\",\n    servername: \"Server Name\",\n    login: \"Login\",\n    logout: \"Logout\",\n    password: \"Password\",\n    logoutmessage: \"Are you sure you want to log out?\",\n    loginerror: \"Unable to log in.\",\n    accessibletologgedinusers: \"This page is accessible only to logged-in users.\",\n\n    export: \"Export\",\n    exportvideo: \"Export Video\",\n    exportpng: \"Export Image\",\n\n    exportdonotclosewindowhint: \"Do not close this window, the file will download automatically.\",\n    exportencodingfile: \"Encoding video file...\",\n    exportrecordingframes: \"Recording frames...\",\n\n    histogram: \"Histogram\",\n    timeline: \"Timeline\",\n\n    exportwidth: \"Width\",\n    exportmargin: \"Margins\",\n    exportgap: \"Gap\",\n    exportgrahpheight: \"Graph height\",\n    videoquality: \"Video quality\",\n    imagecompression: \"Image compression\",\n\n    theme: \"Theme\",\n    light: \"Light\",\n    dark: \"Dark\",\n\n    foldermayhavefiles: \"Folder for files\",\n    foldermayhavesubfolders: \"Folder for subfolders\",\n}","import type { Translation } from \"../Languages\";\n\nexport const fr: Translation = {\n    moreoptions: \"Plus d'options\",\n    delete: \"Supprimer\",\n    create: \"Créer\",\n    createfolder: \"Créer un dossier\",\n    createsubfolder: \"Créer un sous-dossier\",\n    subfolder: \"Sous-dossier\",\n    display: \"Affichage\",\n    syncanalyses: \"Synchroniser les analyses\",\n    uploadedby: \"Téléversé par\",\n    uploadeddat: \"Téléversé le\",\n    overviewofyourfolders: \"Aperçu de vos dossiers\",\n    content: \"Contenu\",\n\n    palette: \"Palette\",\n\n    loading: \"Chargement\",\n    config: \"Einstellungen\",\n\n    temperature: \"Temperature\",\n\n    upload: \"Téléverser\",\n    uploadafile: \"Téléverser un fichier\",\n    selectfile: \"Sélectionner un fichier\",\n    addfiles: \"Ajouter un/des fichier(s)\",\n    clear: \"Effacer\",\n    dragorselectfile: \"Glissez-déposez un fichier LRC ou sélectionnez-le depuis le disque\",\n\n    share: \"Partager\",\n    fileloadingerror: \"Erreur de chargement du fichier\",\n    embedhint: \"Pour intégrer ce bloc dans un autre site Web, utilisez le code suivant :\",\n    embedlibrary: \"Insérez la bibliothèque – une seule fois dans l'en-tête HTML\",\n    embedcomponent: \"Utilisez le code suivant n'importe où dans le corps HTML\",\n    copy: \"Copier\",\n\n    remotefoldersbrowseraddfolderhint: \"Si vous ajoutez un autre dossier dans le référentiel, vous verrez ici des options d'évaluation supplémentaires.\",\n\n\n    file: \"fichier\",\n    detail: \"Détail\",\n\n    showeverything: \"Montrer tout\",\n\n    analysissync: \"Synchroniser les analyses\",\n\n    layout_simple: \"Disposition simple\",\n    layout_advanced: \"Disposition d'analyse\",\n    layout_nogui: \"Pas d'interface graphique\",\n    layout_lesson: \"Disposition de leçon\",\n\n\n    next: \"Avancer\",\n    prev: \"Rétourner\",\n    back: \"Au derriére\",\n    close: \"Fermer\",\n    reload: \"Recharger\",\n\n    open: \"Ouvrir\",\n\n    description: \"Description\",\n    author: \"Auteur\",\n    license: \"License\",\n    recordedat: \"Enrégistré à\",\n\n    displaysettings: \"Paramètres d'affichage\",\n    filerendering: \"Rendu de l'image\",\n    pixelated: \"Pixelisé\",\n    smooth: \"Lisse\",\n    filerenderinghint: \"Le mode 'Pixelisé' désactives le anticrénelage de l'image et monttres les pixels tels qu'ils sont.\",\n    adjusttimescale: \"Ajuster l'échelle de température\",\n    automaticrange: \"Gamme automatique\",\n    fullrange: \"Gamme compléte\",\n    adjusttimescalehint: \"Ajustez l'échelle de temps automatiquement (en fonction de l'histogramme) ou définissez ses valeurs sur la plage complète (min et max).\",\n\n    palettename: \"Palette {{name}}\",\n    colourpalettehint: \"Sélectionnez la palette de couleurs de l'affichage thermique.\",\n\n\n    fileinfo: \"Informations sur le fichier\",\n    thermalfilename: \"Nom du fichier IR\",\n    thermalfileurl: \"URL du fichier IR\",\n    thermalfiledownload: \"Télécharger le fichier IR\",\n    visiblefilename: \"Nom de l'image visuel\",\n    visiblefileurl: \"URL de l'image visuel\",\n    visiblefiledownload: \"Télécharger l'image visuel\",\n    togglevisibleimage: \"Commuter l'image IR / VIS\",\n\n    time: \"Temps\",\n    duration: \"Durée\",\n    resolution: \"Résolution\",\n    minimaltemperature: \"Température minimale\",\n    maximaltemperature: \"Température maximale\",\n    filetype: \"Genre du fichier\",\n    type: \"Genre\",\n    supporteddevices: \"Appareils compatibles\",\n    bytesize: \"Taille en octets\",\n\n    numfiles: \"{{num}} fichiers\",\n    download: \"Télécharger\",\n    downloadoriginalfiles: \"- fichiers individuels\",\n    downloadoriginalfileshint: \"Téléchargez tous les fichiers IR sources\",\n    downloadoriginalfile: \"- Fichier thermique original {{type}}\",\n    exportcurrentframeaspng: \"- Cadre actuel en tant qu'image\",\n    convertentiresequencetovideo: \"- Convertir la séquence entière en vidéo\",\n    pngofindividualimages: \"- fichiers individuels\",\n    pngofindividualimageshint: \"Exporter tous les fichiers individuellement.\",\n    pngofentiregroup: \"- groupe\",\n    pngofentiregrouphint: \"Exporter l'ensemble du groupe sous forme d'une seule image\",\n    csvofanalysisdata: \"- données d'analyse\",\n    csvofanalysisdatahint: \"Tableau des températures dans les analyses\",\n\n    exportimagewidth: \"Largeur de l'image exportée\",\n    exportimagefontsize: \"Taille de la police de l'image exportée\",\n    exportgroupname: \"Nom du groupe exporté\",\n    exportfilenames: \"Noms de fichiers exportés\",\n    exportdimensions: \"Dimensions d'exportation\",\n    exportgroup: \"Exporter le groupe\",\n    exportcontent: \"Exporter le contenu\",\n    numberofcolumns: \"Nombre de colonnes\",\n    thermalscale: \"Échelle thermique\",\n    thermalrange: \"Plage thermique\",\n    analyses: \"Analyses\",\n    filedate: \"Date du fichier\",\n\n    folder: \"Dossier\",\n    folders: \"Dossiers\",\n\n\n    range: \"Gamme\",\n    info: \"Info\",\n    note: \"Note\",\n    group: \"Groupe\",\n    donotgroup: \"Ne pas groupper\",\n    groupby: \"Groupe {{era}}\",\n    groupped: \"groupés\",\n\n    showingfolder: \"Affichage du dossier\",\n    showingfolders: \"Affichage des dossiers\",\n    and: \"et\",\n    or: \"ou\",\n    doyouwanttoadd: \"Voulez-vous afficher aussi\",\n    youmayalsoadd: \"Vous pouvez afficher aussi\",\n\n    bydays: \"par jour\",\n    byhours: \"par heure\",\n    byweeks: \"par semaine\",\n    bymonths: \"par mois\",\n    byyears: \"par année\",\n\n    play: \"Lecture\",\n    pause: \"Pause\",\n    stop: \"Arrêter\",\n    date: \"Date\",\n    frame: \"Image\",\n    playbackspeed: \"Vitesse de lecture\",\n    graphlines: \"Lignes graphiques\",\n    straightlines: \"Lignes droites\",\n    smoothlines: \"Lignes lisses\",\n    graphlineshint: \"Les « lignes lisses » peuvent mieux illustrer les tendances, mais sont moins précises. Si vous avez besoin de voir exactement ce qui se trouve sur le thermogramme, utilisez « Lignes droites ».\",\n\n\n\n    analysis: \"Analyse\",\n    avg: \"AVG\",\n    min: \"MIN\",\n    max: \"MAX\",\n    size: \"Taille\",\n    edit: \"Modifier\",\n    editsth: \"Modifier {{what}}\",\n    remove: \"Retirer\",\n    addpoint: \"Ajouter un point\",\n    addellipsis: \"Ajouter une ellipse\",\n    addrectangle: \"Ajouter un rectangle\",\n    analysishint: \"Vous pouvez sélectionner une zone dans l'image IR pour voir ses températures.\",\n    graph: \"Graphique\",\n    graphhint1: \"Ajoutez d'abord une analyse pour voir le graphique !\",\n    graphhint2: \"Cliquez sur une <thermal-btn variant='background' interactive='false' tooltip='Vous pouvez les voir dans le tableau ci-dessus...'>valeur</thermal-btn> d'analyse pour voir son graphique ici !\",\n\n    rectangle: \"rectangle\",\n    ellipsis: \"ellipse\",\n    point: \"point\",\n    name: \"Nom\",\n    color: \"Couleur\",\n    top: \"Côté supérieure\",\n    left: \"Côté gauche\",\n    right: \"Côté droite\",\n    bottom: \"Côté inférieure\",\n    columns: \"{{num}} images par ligne\",\n\n    fromto: \"De {{from}} à {{to}}\",\n    downloadgraphdataascsv: \"Télécharger les données graphiques au format CSV\",\n\n    apparenttemperature: \"Température ressentie\",\n    apparenttemperaturehint: \"Ce convertisseur utilise le modèle de température ressentie <a href='{{href}}' target='_blank'>Australian Apparent Temperature</a>.\",\n    airtemperature: \"Température de l'air\",\n    relativeairhumidity: \"Humidité relative de l'air\",\n    windspeed: \"Vitesse du vent\",\n    inpercent: \"en pourcentage\",\n\n    apparenttemperatureverbose: \"Le thermomètre indique {{t}} °C, mais en raison de l'humidité et du vent, la température ressentie est de {{app}} °C.\",\n    youfeelwarmer: \"La température ressentie est de {{diff}} °C supérieure à la température de l'air.\",\n    youfeelcolder: \"La température ressentie est de {{diff}} °C inférieure à la température de l'air.\",\n\n\n    inspecttemperatures: \"Inspecter les températures\",\n    usemousetoinspecttemperaturevalues: \"Utilisez la souris pour inspecter les valeurs de température.\",\n\n    editanalysis: \"Modifier l'analyse\",\n    dragcornersofselectedanalysis: \"Faites glisser les coins de l'analyse sélectionnée.\",\n\n    addpointanalysis: \"Ajouter une analyse de point\",\n    clickandaddpoint: \"Cliquez sur le thermogramme pour ajouter une analyse de point.\",\n\n    addrectangleanalysis: \"Ajouter une analyse rectangulaire\",\n    clickandaddrectangle: \"Cliquez et faites glisser sur le thermogramme pour ajouter une analyse rectangulaire.\",\n\n    addellipsisanalysis: \"Ajouter une analyse elliptique\",\n    clickandaddellipsis: \"Cliquez et faites glisser sur le thermogramme pour ajouter une analyse elliptique.\",\n\n    tutorial: \"Tutoriel\",\n    colourpalette: \"Palette\",\n    palettehint: \"Utilisez le menu pour changer le palette.\",\n\n    remotefoldersbrowser: \"Navigateur de dossiers distants\",\n\n\n    server: \"Serveur\",\n    networklog: \"Journal réseau\",\n    editfile: \"Modifier le fichier\",\n    editfolder: \"Modifier le dossier\",\n    editcomment: \"Modifier le commentaire\",\n    user: \"Utilisateur\",\n    griddisplay: \"Afficher en grille\",\n    tabledisplay: \"Afficher en tableau\",\n    deletefile: \"Supprimer le fichier\",\n    deletefolder: \"Supprimer le dossier\",\n    comments: \"Commentaires\",\n    deletecomment: \"Supprimer le commentaire\",\n    savecomment: \"Enregistrer le commentaire\",\n    addcomment: \"Ajouter un commentaire\",\n    nocomments: \"Aucun commentaire\",\n    savechanges: \"Enregistrer les modifications\",\n    uploadfile: \"Téléverser un fichier\",\n    compactview: \"Vue compacte\",\n    showdiscussion: \"Afficher la discussion\",\n    edittags: \"Modifier les tags\",\n    assignedtags: \"Tags assignés\",\n    availabletags: \"Tags disponibles\",\n    connectioninformation: \"Informations de connexion\",\n    serverurl: \"URL du serveur\",\n    servername: \"Nom du serveur\",\n    login: \"Connexion\",\n    logout: \"Déconnexion\",\n    password: \"Mot de passe\",\n    logoutmessage: \"Êtes-vous sûr de vouloir vous déconnecter ?\",\n    loginerror: \"Impossible de se connecter.\",\n    accessibletologgedinusers: \"Cette page est accessible uniquement aux utilisateurs connectés.\",\n\n    export: \"Exporter\",\n    exportvideo: \"Exporter la vidéo\",\n    exportpng: \"Exporter l'image\",\n\n    exportdonotclosewindowhint: \"Ne fermez pas cette fenêtre, le fichier sera téléchargé automatiquement.\",\n    exportencodingfile: \"Encodage du fichier vidéo...\",\n    exportrecordingframes: \"Enregistrement des images...\",\n\n    histogram: \"Histogramme\",\n    timeline: \"Chronologie\",\n\n    exportwidth: \"Largeur\",\n    exportmargin: \"Marges\",\n    exportgap: \"Espace\",\n    exportgrahpheight: \"Hauteur du graphique\",\n    videoquality: \"Qualité vidéo\",\n    imagecompression: \"Compression d'image\",\n\n    theme: \"Thème\",\n    light: \"Clair\",\n    dark: \"Sombre\",\n\n    foldermayhavefiles: \"Dossier pour les fichiers\",\n    foldermayhavesubfolders: \"Dossier pour les sous-dossiers\",\n\n}","import type { Translation } from \"../Languages\";\n\nexport const cs: Translation = {\n    moreoptions: \"Více možností\",\n    delete: \"Smazat\",\n    create: \"Vytvořit\",\n    createfolder: \"Vytvořit složku\",\n    createsubfolder: \"Vytvořit podsložku\",\n    subfolder: \"Podsložka\",\n    display: \"Zobrazení\",\n    syncanalyses: \"Synchronizovat analýzy\",\n    uploadedby: \"Nahráno uživatelem\",\n    uploadeddat: \"Nahráno dne\",\n    overviewofyourfolders: \"Přehled vašich složek\",\n    content: \"Obsah\",\n\n    palette: \"Paleta\",\n\n    loading: \"Načítám\",\n    config: \"Nastavení\",\n\n    layout_simple: \"Jednoduché rozvržení\",\n    layout_advanced: \"Analytické rozvržení\",\n    layout_nogui: \"Bez GUI\",\n    layout_lesson: \"Rozvržení lekce\",\n\n    share: \"Sdílet\",\n    fileloadingerror: \"Chyba při načítání souboru\",\n    embedhint: \"Chcete-li vložit tento blok na jinou webovou stránku, použijte následující kód:\",\n    embedlibrary: \"Vložte knihovnu – jednou v HTML hlavičce\",\n    embedcomponent: \"Použijte následující kód kdekoli v HTML těle\",\n    copy: \"Kopírovat\",\n\n    remotefoldersbrowseraddfolderhint: \"Pokud v úložišti přidáte další složku, uvidíte zde další možnosti vyhodnocení.\",\n\n    temperature: \"Teplota\",\n\n    upload: \"Nahrát\",\n    uploadafile: \"Nahrát soubor\",\n    selectfile: \"Vybrat soubor\",\n    addfiles: \"Přidat soubor(y)\",\n    clear: \"Smazat\",\n    dragorselectfile: \"Přetáhněte LRC soubor nebo jej vyberte z disku\",\n\n    file: \"soubor\",\n    detail: \"Detail\",\n\n    showeverything: \"Zobrazit vše\",\n\n    next: \"Další\",\n    prev: \"Předchozí\",\n    back: \"Zpět\",\n    close: \"Zavřít\",\n    reload: \"Načíst znovu\",\n    open: \"Otevřít\",\n\n    description: \"Popis\",\n    author: \"Autor\",\n    license: \"Licence\",\n    recordedat: \"Nahráno\",\n\n    displaysettings: \"Nastavení zobrazení\",\n    filerendering: \"Vykreslování termogramu\",\n    pixelated: \"Pixelované\",\n    smooth: \"Vyhlazené\",\n    filerenderinghint: \"Režim 'Pixelované' vypne vyhlazování a zobrazí pixely termogramu přesně tak, jak jsou\",\n    adjusttimescale: \"Teplotní rozsah\",\n    automaticrange: \"Automatický rozsah\",\n    fullrange: \"Plný rozsah\",\n    adjusttimescalehint: \"Nastavit teplotní škálu automaticky (nejčastější teploty z histogramu) anebo ji roztáhnout na minimální a maximální teploty.\",\n\n    palettename: \"Paleta {{name}}\",\n    colourpalettehint: \"Zvolte barevnou paletu\",\n\n    numfiles: \"{{num}} souborů\",\n\n    fileinfo: \"Informace o souboru\",\n    thermalfilename: \"Název IR souboru\",\n    thermalfileurl: \"URL IR souboru\",\n    thermalfiledownload: \"Stáhnout IR soubor\",\n    visiblefilename: \"Název visible souboru\",\n    visiblefileurl: \"URL visible souboru\",\n    visiblefiledownload: \"Stáhnout visible obrázek\",\n    togglevisibleimage: \"Přepnout IR / VIS obraz\",\n    time: \"Čas\",\n    duration: \"Délka sekvence\",\n    resolution: \"Rozlišení\",\n    bytesize: \"Bytů\",\n    minimaltemperature: \"Minimální teplota\",\n    maximaltemperature: \"Maximální teplota\",\n    filetype: \"Typ souboru\",\n    type: \"Typ\",\n    supporteddevices: \"Kompatibilní zařízení\",\n\n\n\n    download: \"Stáhnout\",\n    downloadoriginalfiles: \"- jednotlivé soubory\",\n    downloadoriginalfileshint: \"Stáhnout jednotlivé zdrojové termogramy\",\n    downloadoriginalfile: \"- Původní IR soubor {{type}}\",\n    exportcurrentframeaspng: \"- Aktuální snímek\",\n    convertentiresequencetovideo: \"- Převést celou sekvenci do videa\",\n    pngofindividualimages: \"- jednotlivé soubory\",\n    pngofindividualimageshint: \"Exportovat všechny soubor po jednom, každý do samostatného obrázku.\",\n    pngofentiregroup: \"- skupina\",\n    pngofentiregrouphint: \"Exportovat celou skupinu do 1 obrázku.\",\n    csvofanalysisdata: \"- data analýz\",\n    csvofanalysisdatahint: \"Tabulka s teplotami v aktuálně nastavených analýzách\",\n\n    exportimagewidth: \"Šířka exportovaných obrázků\",\n    exportimagefontsize: \"Velikost písma v exportovaných obrázcích\",\n    exportgroupname: \"Název skupiny\",\n    exportfilenames: \"Názvy souborů\",\n    exportdimensions: \"Rozměry exportu\",\n    exportgroup: \"Export skupiny\",\n    exportcontent: \"Obsah exportu\",\n    numberofcolumns: \"Počet sloupců\",\n    thermalscale: \"Teplotní škála\",\n    thermalrange: \"Teplotní rozsah\",\n    analyses: \"Analýzy\",\n    filedate: \"File date\",\n\n    folder: \"Složka\",\n    folders: \"Složky\",\n\n\n    range: \"Rozsah\",\n    info: \"Info\",\n    note: \"Pozn.\",\n    group: \"Skupina\",\n    donotgroup: \"Neseskupovat\",\n    groupby: \"Seskupit {{era}}\",\n\n    groupped: \"seskupené\",\n\n    showingfolder: \"Zobrazuji složku\",\n    showingfolders: \"Zobrazuji složky\",\n    and: \"a\",\n    or: \"či\",\n    doyouwanttoadd: \"Chcete přidat ještě\",\n    youmayalsoadd: \"Můžete přidat ještě\",\n\n    bydays: \"po dnech\",\n    byhours: \"po hodinách\",\n    byweeks: \"po týdnech\",\n    bymonths: \"po měsících\",\n    byyears: \"po rocích\",\n\n    play: \"Přehrát\",\n    pause: \"Pozastavit\",\n    stop: \"Stop\",\n    date: \"Datum\",\n    frame: \"Snímek\",\n    playbackspeed: \"Rychlost přehrávání\",\n    graphlines: \"Čáry v grafu\",\n    straightlines: \"Přímé linie\",\n    smoothlines: \"Hladké linie\",\n    graphlineshint: \"'Hladké linie' mohou lépe ilustrovat trendy, ale jsou méně přesné. Potřebujete-li vidět přesně to, co v termogramu je, zvolte 'Přímé linie'.\",\n\n\n    analysis: \"Analýza\",\n    avg: \"PRŮM\",\n    min: \"MIN\",\n    max: \"MAX\",\n    size: \"Velikost\",\n    edit: \"Upravit\",\n    editsth: \"Upravit {{what}}\",\n    remove: \"Odstranit\",\n    addpoint: \"Přidat bod\",\n    addellipsis: \"Přidat elipsu\",\n    addrectangle: \"Přidat obdélník\",\n    analysishint: \"Vyznačte oblast v termogramu a zde uvidíte přehled jejích teplot.\",\n    graph: \"Graf\",\n    graphhint1: \"Nejprve přidejte analýzu!\",\n    graphhint2: \"Pro zobrazení grafu klikněte na <thermal-btn variant='background' non-interactive tooltip='Najdete je v tabulce výše...'>hodnotu</thermal-btn> některé analýzy!\",\n\n    rectangle: \"obdélník\",\n    ellipsis: \"elipsu\",\n    point: \"bod\",\n    name: \"Název\",\n    color: \"Barva\",\n    top: \"Horní strana\",\n    left: \"Levá strana\",\n    right: \"Pravá strana\",\n    bottom: \"Spodní strana\",\n    columns: \"{{num}} souborů na řádku\",\n\n    fromto: \"Od {{from}} do {{to}}\",\n    downloadgraphdataascsv: \"Stáhnout data grafu jako CSV\",\n\n    analysissync: \"Synchronizovat analýzy\",\n\n\n    apparenttemperature: \"Pocitová teplota\",\n    apparenttemperaturehint: \"Tento převodník využívá model pocitové teploty <a href='{{href}}' target='_blank'>Australian Apparent Temperature</a>.\",\n    airtemperature: \"Teplota vzduchu\",\n    relativeairhumidity: \"Relativní vlhkost vzduchu\",\n    windspeed: \"Rychlost větru\",\n    inpercent: \"v procentech\",\n\n    apparenttemperatureverbose: \"Na teploměru vidíte {{t}} °C, ale vlivem vlhkosti a větru se venku cítíte jako by bylo {{app}} °C.\",\n\n    youfeelwarmer: \"Pocitová teplota je o {{diff}} °C vyšší než teplota vzduchu.\",\n    youfeelcolder: \"Pocitová teplota je o {{diff}} °C nižší než teplota vzduchu.\",\n\n\n    inspecttemperatures: \"Prohlížet teploty\",\n    usemousetoinspecttemperaturevalues: \"S pomocí kurzoru prohlížejte teploty v termogramu.\",\n\n    editanalysis: \"Upravit analýzu\",\n    dragcornersofselectedanalysis: \"Klikněte a táhněte roh aktivní analýzy.\",\n\n    addpointanalysis: \"Přidat bodovou analýzu\",\n    clickandaddpoint: \"Klikněte na termogram a přidejte bodovou analýzu.\",\n\n    addrectangleanalysis: \"Přidat obdélníkovou analýzu\",\n    clickandaddrectangle: \"Klikněte a táhněte na termogramu pro přidání obdélníkové analýzy.\",\n\n    addellipsisanalysis: \"Přidat eliptickou analýzu\",\n    clickandaddellipsis: \"Klikněte a táhněte na termogramu pro přidání eliptické analýzy.\",\n\n\n    tutorial: \"Tutorial\",\n    colourpalette: \"Barevná paleta\",\n    palettehint: \"Rozbalovací nabídka pro přepínání barevné palety.\",\n\n    remotefoldersbrowser: \"Prohlížeč vzdálených složek\",\n\n\n\n    server: \"Server\",\n    networklog: \"Síťový záznam\",\n    editfile: \"Upravit soubor\",\n    editfolder: \"Upravit složku\",\n    editcomment: \"Upravit komentář\",\n    user: \"Uživatel\",\n    griddisplay: \"Zobrazit jako mřížku\",\n    tabledisplay: \"Zobrazit jako tabulku\",\n    deletefile: \"Smazat soubor\",\n    deletefolder: \"Smazat složku\",\n    comments: \"Komentáře\",\n    deletecomment: \"Smazat komentář\",\n    savecomment: \"Uložit komentář\",\n    addcomment: \"Přidat komentář\",\n    nocomments: \"Žádné komentáře\",\n    savechanges: \"Uložit změny\",\n    uploadfile: \"Nahrát soubor\",\n    compactview: \"Kompaktní zobrazení\",\n    showdiscussion: \"Zobrazit diskuzi\",\n    edittags: \"Upravit štítky\",\n    availabletags: \"Dostupné štítky\",\n    assignedtags: \"Přiřazené štítky\",\n    connectioninformation: \"Informace o připojení\",\n    serverurl: \"URL serveru\",\n    servername: \"Název serveru\",\n    login: \"Přihlášení\",\n    logout: \"Odhlášení\",\n    password: \"Heslo\",\n    logoutmessage: \"Opravdu se chcete odhlásit?\",\n    loginerror: \"Nelze se přihlásit.\",\n    accessibletologgedinusers: \"Tato stránka je přístupná pouze přihlášeným uživatelům.\",\n\n\n    export: \"Export\",\n    exportvideo: \"Exportovat video\",\n    exportpng: \"Exportovat obrázek\",\n\n    exportdonotclosewindowhint: \"Nezavírejte toto okno, soubor se stáhne automaticky.\",\n    exportencodingfile: \"Enkóduji video soubor...\",\n    exportrecordingframes: \"Zaznamenávám snímky...\",\n\n    histogram: \"Histogram\",\n    timeline: \"Časová osa\",\n\n    exportwidth: \"Šířka \",\n    exportmargin: \"Okraje\",\n    exportgap: \"Mezera\",\n    exportgrahpheight: \"Výška grafu\",\n    videoquality: \"Kvalita videa\",\n    imagecompression: \"Komprese obrázku\",\n\n    theme: \"Motiv\",\n    light: \"Světlý\",\n    dark: \"Tmavý\",\n\n    foldermayhavefiles: \"Složka pro soubory\",\n    foldermayhavesubfolders: \"Složka pro podsložky\",\n}","import type { Translation } from \"../Languages\";\n\nexport const cy: Translation = {\n    moreoptions: \"Mwy o opsiynau\",\n    delete: \"Dileu\",\n    create: \"Creu\",\n    createfolder: \"Creu ffolder\",\n    createsubfolder: \"Creu is-ffolder\",\n    subfolder: \"Is-ffolder\",\n    display: \"Arddangos\",\n    syncanalyses: \"Cydamseru dadansoddiadau\",\n    uploadedby: \"Wedi'i lwytho i fyny gan\",\n    uploadeddat: \"Wedi'i lwytho i fyny ar\",\n    overviewofyourfolders: \"Trosolwg o'ch ffolderi\",\n    content: \"Cynnwys\",\n\n    palette: \"Palet\",\n\n    loading: \"Llwytho\",\n    config: \"Gosodiadau\",\n\n    temperature: \"Tymheredd\",\n\n    upload: \"Llwytho i fyny\",\n    uploadafile: \"Llwytho ffeil i fyny\",\n    selectfile: \"Dewis ffeil\",\n    addfiles: \"Ychwanegu ffeil(iau)\",\n    clear: \"Clirio\",\n    dragorselectfile: \"Llusgwch ffeil LRC neu dewiswch hi o'r ddisg\",\n\n    share: \"Rhannu\",\n    fileloadingerror: \"Gwall wrth lwytho'r ffeil\",\n    embedhint: \"I fewnosod y bloc hwn mewn gwefan arall, defnyddiwch y cod canlynol:\",\n    embedlibrary: \"Mewnosodwch y llyfrgell – unwaith yn pennyn HTML\",\n    embedcomponent: \"Defnyddiwch y cod canlynol yn unrhyw le yn y corff HTML\",\n    copy: \"Copïo\",\n\n    remotefoldersbrowseraddfolderhint: \"Os ychwanegwch ffolder arall yn y gadwrfa, fe welwch opsiynau gwerthuso ychwanegol yma.\",\n\n\n    analysissync: \"Cydamseru dadansoddiadau\",\n\n    file: \"ffeil\",\n    detail: \"Manylder\",\n\n    open: \"Agor\",\n\n    showeverything: \"Dangos popeth\",\n\n    layout_simple: \"Cynllun syml\",\n    layout_advanced: \"Cynllun dadansoddi\",\n    layout_nogui: \"Dim GUI\",\n    layout_lesson: \"Cynllun gwers\",\n\n\n    next: \"Nesaf\",\n    prev: \"Blaenorol\",\n    back: \"Yn ôl\",\n    close: \"Cau\",\n    reload: \"Ail-lwytho\",\n\n    description: \"Disgrifiad\",\n    author: \"Awdur\",\n    license: \"Trwydded\",\n    recordedat: \"Wedi recordio yn\",\n\n    displaysettings: \"Gosodiadau arddangos\",\n    filerendering: \"Rendro ffeil\",\n    pixelated: \"Picselaidd\",\n    smooth: \"Llyfn\",\n    filerenderinghint: \"Mae modd 'Picselaidd' yn analluogi gwrth-alwio'r delwedd isgoch ac yn eich galluogi i weld ei bicseli fel ag y maent.\",\n    adjusttimescale: \"Graddfa tymheredd\",\n    automaticrange: \"Ystod awtomatig\",\n    fullrange: \"Ystod llawn\",\n    adjusttimescalehint: \"Addaswch yr ystod thermol yn awtomatig neu cyflewch yr ystod i fand lawn.\",\n\n    palettename: \"Palet {{name}}\",\n    colourpalettehint: \"Dewiswch balet lliw o arddangos thermol.\",\n\n\n    fileinfo: \"Gwybodaeth ffeil\",\n    thermalfilename: \"Enw ffeil isgoch\",\n    thermalfileurl: \"URL ffeil isgoch\",\n    thermalfiledownload: \"Lawrlwythwch y ffeil isgoch\",\n    visiblefilename: \"Enw ffeil weledol\",\n    visiblefileurl: \"URL ffeil weledol\",\n    visiblefiledownload: \"Lawrlwythwch y ffeil weledol\",\n    togglevisibleimage: \"Newid delwedd IR/VIS\",\n    time: \"Amser\",\n    duration: \"Hyd\",\n    resolution: \"Datrysiad\",\n    bytesize: \"Maint\",\n    minimaltemperature: \"Tymheredd lleiaf\",\n    maximaltemperature: \"Tymheredd uchaf\",\n    filetype: \"Math o ffeil\",\n    type: \"Math\",\n    supporteddevices: \"Dyfeisiau a gefnogir\",\n\n    numfiles: \"{{num}} ffeil\",\n\n    download: \"Lawrlwythwch\",\n    downloadoriginalfiles: \"- ffeiliau thermol wreiddiol unigol\",\n    downloadoriginalfileshint: \"Lawrlwythwch ffeiliau isgoch unigol.\",\n    downloadoriginalfile: \"- Ffeil thermol wreiddiol {{type}}\",\n    exportcurrentframeaspng: \"- Ffrâm gyfredol fel delwedd\",\n    convertentiresequencetovideo: \"- Trosi dilyniant cyfan i fideo\",\n    pngofindividualimages: \"- ffeiliau unigol\",\n    pngofindividualimageshint: \"Allforio pob ffeil yn unigol.\",\n    pngofentiregroup: \"- grwp\",\n    pngofentiregrouphint: \"Allforio'r grŵp cyfan fel un ddelwedd\",\n    csvofanalysisdata: \"- data dadansoddi\",\n    csvofanalysisdatahint: \"Tabl tymheredd mewn dadansoddiadau\",\n\n    exportimagewidth: \"Lled delwedd wedi'i hallforio\",\n    exportimagefontsize: \"Maint ffont delwedd wedi'i hallforio\",\n    exportgroupname: \"Enw'r grŵp allforio\",\n    exportfilenames: \"Enwau'r ffeiliau allforio\",\n    exportdimensions: \"Dimensiynau allforio\",\n    exportgroup: \"Allforio'r grŵp\",\n    exportcontent: \"Allforio'r cynnwys\",\n    numberofcolumns: \"Nifer y colofnau\",\n    thermalscale: \"Graddfa thermol\",\n    thermalrange: \"Ystod thermol\",\n    analyses: \"Dadansoddiadau\",\n    filedate: \"Dyddiad y ffeil\",\n\n    folder: \"Ffolder\",\n    folders: \"Ffolderi\",\n\n\n    range: \"Ystod\",\n    info: \"Gwybodaeth\",\n    note: \"Nodyn\",\n    group: \"Grwp\",\n    donotgroup: \"Peidiwch â grwpio\",\n    groupby: \"grwpio {{era}}\",\n\n    groupped: \"wedi'u cetegoreiddio\",\n    showingfolder: \"Yn dangos y ffolder\",\n    showingfolders: \"Yn dangos y ffolderi\",\n    and: \"a\",\n    or: \"neu\",\n    doyouwanttoadd: \"Ydych chi eisiau arddangos hefyd\",\n    youmayalsoadd: \"Gallwch hefyd ddangos\",\n\n    bydays: \"yn ôl dydd\",\n    byhours: \"yn ôl awr\",\n    byweeks: \"yn ôl wythnos\",\n    bymonths: \"yn ôl mis\",\n    byyears: \"yn ôl blwyddyn\",\n\n    play: \"Chwarae\",\n    pause: \"Oedwch\",\n    stop: \"Stopio\",\n    date: \"Dyddiad\",\n    frame: \"Ffrâm\",\n    playbackspeed: \"Cyflymder chwarae\",\n    graphlines: \"Llinellau graff\",\n    straightlines: \"Llinellau syth\",\n    smoothlines: \"Llinellau llyfn\",\n    graphlineshint: \"Gall 'llinellau llyfn' ddangos tueddiadau'n well, ond maent yn llai manwl gywir. Os oes angen i chi weld yn union beth sydd yn y lliw thermol, defnyddiwch 'Llinellau syth'.\",\n\n\n\n    analysis: \"Dadansoddi\",\n    avg: \"Cyfartaledd\",\n    min: \"Lleiaf\",\n    max: \"Uchafswm\",\n    size: \"Maint\",\n    edit: \"Golygu\",\n    editsth: \"Golygu {{what}}\",\n    remove: \"Dileu\",\n    addpoint: \"Addio pwynt\",\n    addellipsis: \"Addio elips\",\n    addrectangle: \"Addio petryal\",\n    analysishint: \"Gallwch ddewis ardal yn y ddelwedd IR i weld ei thymhereddau.\",\n    graph: \"Graff\",\n    graphhint1: \"Addio ddadansoddiad yn gyntaf i weld y graff!\",\n    graphhint2: \"Cliciwch ar <thermal-btn variant='background' non-interactive  tooltip='Fe welwch nhw yn y tabl uchod...'>werth</thermal-btn> dadansoddiad i weld ei graff yma!\",\n\n    rectangle: \"petryal\",\n    ellipsis: \"elipsis\",\n    point: \"pwynt\",\n    name: \"Enw\",\n    color: \"Lliw\",\n    top: \"Ochr uchaf\",\n    left: \"Ochr chwith\",\n    right: \"Ochr dde\",\n    bottom: \"Ochr gwaelod\",\n    columns: \"{{num}} delwedd mewn rhes\",\n\n    fromto: \"O {{from}} i {{to}}\",\n    downloadgraphdataascsv: \"Lawrlwythwch data graff fel CSV\",\n\n    apparenttemperature: \"Tymheredd tebygol\",\n    apparenttemperaturehint: \"Mae'r trawsnewidydd hwn yn defnyddio'r model tymheredd tebygol <a href='{{href}}' target='_blank'>Australian Apparent Temperature</a>.\",\n    airtemperature: \"Tymheredd aer\",\n    relativeairhumidity: \"Lleithder cymharol aer\",\n    windspeed: \"Cyflymder gwynt\",\n    inpercent: \"mewn canran\",\n\n    apparenttemperatureverbose: \"Mae'r thermomedr yn dangos {{t}} °C, ond oherwydd lleithder a gwynt, mae'n teimlo fel {{app}} °C y tu allan.\",\n    youfeelwarmer: \"Mae'r tymheredd teimladol yn {{diff}} °C yn uwch na thymheredd yr aer.\",\n    youfeelcolder: \"Mae'r tymheredd teimladol yn {{diff}} °C yn is na thymheredd yr aer.\",\n\n\n\n    inspecttemperatures: \"Archwilio'r tymheredd\",\n    usemousetoinspecttemperaturevalues: \"Defnyddiwch y llygoden i archwilio gwerthoedd tymheredd.\",\n\n    editanalysis: \"Golygu dadansoddiad\",\n    dragcornersofselectedanalysis: \"Llusgwch gorneli'r dadansoddiad a ddewiswyd.\",\n\n    addpointanalysis: \"Adio dadansoddiad pwynt\",\n    clickandaddpoint: \"Cliciwch ar y delwedd isgoch i ychwanegu dadansoddiad pwynt.\",\n\n    addrectangleanalysis: \"Adio dadansoddiad petryal\",\n    clickandaddrectangle: \"Cliciwch a dragiwuch ar y delwedd isgoch i ychwanegu dadansoddiad petryal.\",\n\n    addellipsisanalysis: \"Adio dadansoddiad eliptig\",\n    clickandaddellipsis: \"Cliciwch a dragiwuch ar y delwedd isgoch i ychwanegu dadansoddiad eliptig.\",\n\n\n    tutorial: \"Tiwtorial\",\n\n    colourpalette: \"Palet lliw\",\n    palettehint: \"Defnyddiwch y gwymplen i newid y palet.\",\n\n    remotefoldersbrowser: \"Porwr o ffolderi anghysbell\",\n\n\n\n\n    server: \"Gweinydd\",\n    networklog: \"Log rhwydwaith\",\n    editfile: \"Golygu ffeil\",\n    editfolder: \"Golygu ffolder\",\n    editcomment: \"Golygu sylw\",\n    user: \"Defnyddiwr\",\n    griddisplay: \"Dangos fel grid\",\n    tabledisplay: \"Dangos fel tabl\",\n    deletefile: \"Dileu ffeil\",\n    deletefolder: \"Dileu ffolder\",\n    comments: \"Sylwadau\",\n    deletecomment: \"Dileu sylw\",\n    savecomment: \"Cadw sylw\",\n    addcomment: \"Ychwanegu sylw\",\n    nocomments: \"Dim sylwadau\",\n    savechanges: \"Cadw newidiadau\",\n    uploadfile: \"Uwchlwytho ffeil\",\n    compactview: \"Golwg gryno\",\n    showdiscussion: \"Dangos trafodaeth\",\n    edittags: \"Golygu tagiau\",\n    availabletags: \"Tagiau ar gael\",\n    assignedtags: \"Tagiau a neilltuwyd\",\n    connectioninformation: \"Gwybodaeth cysylltiad\",\n    serverurl: \"URL y gweinydd\",\n    servername: \"Enw'r gweinydd\",\n    login: \"Mewngofnodi\",\n    logout: \"Allgofnodi\",\n    password: \"Cyfrinair\",\n    logoutmessage: \"Ydych chi’n siŵr eich bod eisiau allgofnodi?\",\n    loginerror: \"Methu mewngofnodi.\",\n    accessibletologgedinusers: \"Mae'r dudalen hon ar gael i ddefnyddwyr sydd wedi mewngofnodi yn unig.\",\n\n    export: \"Allforio\",\n    exportvideo: \"Allforio fideo\",\n    exportpng: \"Allforio delwedd\",\n\n    exportdonotclosewindowhint: \"Peidiwch â chau'r ffenestr hon, bydd y ffeil yn cael ei lawrlwytho'n awtomatig.\",\n    exportencodingfile: \"Wrthi'n amgodio'r ffeil fideo...\",\n    exportrecordingframes: \"Wrthi'n cofnodi fframiau...\",\n\n    histogram: \"Histogram\",\n    timeline: \"Llinell amser\",\n\n    exportwidth: \"Lled\",\n    exportmargin: \"Ymylon\",\n    exportgap: \"Bwlch\",\n    exportgrahpheight: \"Uchder y graff\",\n    videoquality: \"Ansawdd fideo\",\n    imagecompression: \"Cywasgu delwedd\",\n\n    theme: \"Thema\",\n    light: \"Golau\",\n    dark: \"Tywyll\",\n\n    foldermayhavefiles: \"Ffolder ar gyfer ffeiliau\",\n    foldermayhavesubfolders: \"Ffolder ar gyfer is-ffolderi\",\n\n\n}","import type { Translation } from \"../Languages\";\n\nexport const de: Translation = {\n    moreoptions: \"Mehr Optionen\",\n    delete: \"Löschen\",\n    create: \"Erstellen\",\n    createfolder: \"Einen Ordner erstellen\",\n    createsubfolder: \"Einen Unterordner erstellen\",\n    subfolder: \"Unterordner\",\n    display: \"Anzeige\",\n    syncanalyses: \"Analysen synchronisieren\",\n    uploadedby: \"Hochgeladen von\",\n    uploadeddat: \"Hochgeladen am\",\n    overviewofyourfolders: \"Übersicht Ihrer Ordner\",\n    content: \"Inhalt\",\n\n    palette: \"Palette\",\n\n    loading: \"Loading\",\n    config: \"Paramètres\",\n\n    layout_simple: \"Einfaches Layout\",\n    layout_advanced: \"Analyse-Layout\",\n    layout_nogui: \"Kein GUI\",\n    layout_lesson: \"Lektions-Layout\",\n\n    share: \"Teilen\",\n    fileloadingerror: \"Fehler beim Laden der Datei\",\n    embedhint: \"Um diesen Block in eine andere Website einzubetten, verwenden Sie den folgenden Code:\",\n    embedlibrary: \"Bibliothek einfügen – einmal im HTML-Head\",\n    embedcomponent: \"Verwenden Sie den folgenden Code überall im HTML-Body\",\n    copy: \"Kopieren\",\n\n    remotefoldersbrowseraddfolderhint: \"Wenn Sie einen weiteren Ordner im Repository hinzufügen, werden Ihnen hier zusätzliche Auswertungsmöglichkeiten angezeigt.\",\n\n\n    temperature: \"Temperatur\",\n\n    upload: \"Hochladen\",\n    uploadafile: \"Datei hochladen\",\n    selectfile: \"Datei auswählen\",\n    addfiles: \"Datei(en) hinzufügen\",\n    clear: \"Löschen\",\n    dragorselectfile: \"Ziehen Sie eine LRC-Datei hierher oder wählen Sie sie von der Festplatte aus\",\n\n    analysissync: \"Analysen synchronisieren\",\n\n    file: \"Datei\",\n    detail: \"Detail\",\n\n    showeverything: \"Alles anzeigen\",\n\n\n    next: \"Weiter\",\n    prev: \"Zurück\",\n    back: \"Zurück\",\n    close: \"Schließen\",\n    reload: \"Neu laden\",\n\n    open: \"Öffnen\",\n\n    description: \"Beschreibung\",\n    author: \"Autor\",\n    license: \"Lizenz\",\n    recordedat: \"Aufgenommen am\",\n\n    displaysettings: \"Anzeigeeinstellungen\",\n    filerendering: \"Thermogramm-Wiedergabe\",\n    pixelated: \"Pixelig\",\n    smooth: \"Glatt\",\n    filerenderinghint: \"Der Modus 'Pixelig' deaktiviert das Glätten und zeigt die Pixel des Thermogramms exakt so, wie sie sind.\",\n    adjusttimescale: \"Temperaturbereich\",\n    automaticrange: \"Automatischer Bereich\",\n    fullrange: \"Voller Bereich\",\n    adjusttimescalehint: \"Temperaturskala automatisch (häufigste Temperaturen im Histogramm) oder auf die minimalen und maximalen Temperaturen erweitern.\",\n\n    palettename: \"Palette {{name}}\",\n    colourpalettehint: \"Wählen Sie eine Farbpalette\",\n\n    numfiles: \"{{num}} Dateien\",\n\n    fileinfo: \"Dateiinformationen\",\n    thermalfilename: \"Name der IR-Datei\",\n    thermalfileurl: \"URL der IR-Datei\",\n    thermalfiledownload: \"IR-Datei herunterladen\",\n    visiblefilename: \"Name der sichtbaren Datei\",\n    visiblefileurl: \"URL der sichtbaren Datei\",\n    visiblefiledownload: \"Sichtbares Bild herunterladen\",\n    togglevisibleimage: \"IR/VIS-Bild umschalten\",\n    time: \"Zeit\",\n    duration: \"Sequenzdauer\",\n    resolution: \"Auflösung\",\n    bytesize: \"Bytes\",\n    minimaltemperature: \"Minimale Temperatur\",\n    maximaltemperature: \"Maximale Temperatur\",\n    filetype: \"Dateityp\",\n    type: \"Typ\",\n    supporteddevices: \"Kompatible Geräte\",\n\n    download: \"Herunterladen\",\n    downloadoriginalfiles: \"- Einzelne Dateien\",\n    downloadoriginalfileshint: \"Laden Sie alle Original-IR-Dateien herunter\",\n    downloadoriginalfile: \"- Original-IR-Datei {{type}}\",\n    exportcurrentframeaspng: \"- Aktuelles Bild\",\n    convertentiresequencetovideo: \"- Gesamte Sequenz in Video umwandeln\",\n    pngofindividualimages: \"- Einzelne Dateien\",\n    pngofindividualimageshint: \"Exportieren Sie jede Datei einzeln als Bild.\",\n    pngofentiregroup: \"- Gruppe\",\n    pngofentiregrouphint: \"Exportieren Sie die gesamte Gruppe in eine einzelne Datei.\",\n    csvofanalysisdata: \"- Analysedaten\",\n    csvofanalysisdatahint: \"Tabelle mit Temperaturen aus den aktuell festgelegten Analysen\",\n\n    exportimagewidth: \"Exportierte Bildbreite\",\n    exportimagefontsize: \"Exportierte Bildschriftgröße\",\n    exportgroupname: \"Exportgruppenname\",\n    exportfilenames: \"Dateinamen exportieren\",\n    exportdimensions: \"Exportabmessungen\",\n    exportgroup: \"Gruppe exportieren\",\n    exportcontent: \"Inhalt exportieren\",\n    numberofcolumns: \"Anzahl der Spalten\",\n    thermalscale: \"Thermische Skala\",\n    thermalrange: \"Temperaturbereich\",\n    analyses: \"Analysen\",\n    filedate: \"Dateidatum\",\n\n    folder: \"Ordner\",\n    folders: \"Ordner\",\n\n    range: \"Bereich\",\n    info: \"Info\",\n    note: \"Hinweis\",\n    group: \"Gruppe\",\n    donotgroup: \"Nicht gruppieren\",\n    groupby: \"Gruppieren nach {{era}}\",\n    groupped: \"grupiert\",\n\n    showingfolder: \"Ordner anzeigen\",\n    showingfolders: \"Ordner anzeigen\",\n    and: \"und\",\n    or: \"oder\",\n    doyouwanttoadd: \"Möchten Sie auch anzeigen\",\n    youmayalsoadd: \"Sie können auch anzeigen\",\n\n    bydays: \"nach Tagen\",\n    byhours: \"nach Stunden\",\n    byweeks: \"nach Wochen\",\n    bymonths: \"nach Monaten\",\n    byyears: \"nach Jahren\",\n\n    play: \"Abspielen\",\n    pause: \"Pause\",\n    stop: \"Stopp\",\n    date: \"Datum\",\n    frame: \"Bild\",\n    playbackspeed: \"Abspielgeschwindigkeit\",\n    graphlines: \"Grafiklinien\",\n    straightlines: \"Gerade Linien\",\n    smoothlines: \"Glatte Linien\",\n    graphlineshint: \"'Glatte Linien' können Trends besser darstellen, sind jedoch weniger präzise. Wenn Sie genau sehen möchten, was im Thermogramm ist, wählen Sie 'Gerade Linien'.\",\n\n    analysis: \"Analyse\",\n    avg: \"MITTL\",\n    min: \"MIN\",\n    max: \"MAX\",\n    size: \"Größe\",\n    edit: \"Bearbeiten\",\n    editsth: \"{{what}} bearbeiten\",\n    remove: \"Entfernen\",\n    addpoint: \"Punkt hinzufügen\",\n    addellipsis: \"Ellipse hinzufügen\",\n    addrectangle: \"Rechteck hinzufügen\",\n    analysishint: \"Markieren Sie einen Bereich im Thermogramm, um hier eine Übersicht seiner Temperaturen zu sehen.\",\n    graph: \"Grafik\",\n    graphhint1: \"Fügen Sie zuerst eine Analyse hinzu!\",\n    graphhint2: \"Klicken Sie auf einen <thermal-btn variant='background' non-interactive tooltip='Sie finden sie in der obigen Tabelle...'>Wert</thermal-btn> einer Analyse, um hier die Grafik zu sehen!\",\n\n    rectangle: \"Rechteck\",\n    ellipsis: \"Ellipse\",\n    point: \"Punkt\",\n    name: \"Name\",\n    color: \"Farbe\",\n    top: \"Oben\",\n    left: \"Links\",\n    right: \"Rechts\",\n    bottom: \"Unten\",\n    columns: \"{{num}} Bilder in einer Reihe\",\n\n    fromto: \"Von {{from}} bis {{to}}\",\n    downloadgraphdataascsv: \"Grafikdaten als CSV herunterladen\",\n\n    apparenttemperature: \"Gefühlte Temperatur\",\n    apparenttemperaturehint: \"Dieser Konverter verwendet das Modell der gefühlten Temperatur <a href='{{href}}' target='_blank'>Australian Apparent Temperature</a>.\",\n    airtemperature: \"Lufttemperatur\",\n    relativeairhumidity: \"Relative Luftfeuchtigkeit\",\n    windspeed: \"Windgeschwindigkeit\",\n    inpercent: \"in Prozent\",\n\n    apparenttemperatureverbose: \"Das Thermometer zeigt {{t}} °C, aber durch Feuchtigkeit und Wind fühlt es sich wie {{app}} °C an.\",\n    youfeelwarmer: \"Die gefühlte Temperatur ist {{diff}} °C höher als die Lufttemperatur.\",\n    youfeelcolder: \"Die gefühlte Temperatur ist {{diff}} °C niedriger als die Lufttemperatur.\",\n\n\n\n    inspecttemperatures: \"Temperaturen inspizieren\",\n    usemousetoinspecttemperaturevalues: \"Verwenden Sie die Maus, um Temperaturwerte zu inspizieren.\",\n\n    editanalysis: \"Analyse bearbeiten\",\n    dragcornersofselectedanalysis: \"Ziehen Sie die Ecken der ausgewählten Analyse.\",\n\n    addpointanalysis: \"Punktanalyse hinzufügen\",\n    clickandaddpoint: \"Klicken Sie auf das Thermogramm, um eine Punktanalyse hinzuzufügen.\",\n\n    addrectangleanalysis: \"Rechteckanalyse hinzufügen\",\n    clickandaddrectangle: \"Klicken und ziehen Sie auf dem Thermogramm, um eine Rechteckanalyse hinzuzufügen.\",\n\n    addellipsisanalysis: \"Elliptische Analyse hinzufügen\",\n    clickandaddellipsis: \"Klicken und ziehen Sie auf dem Thermogramm, um eine elliptische Analyse hinzuzufügen.\",\n\n    tutorial: \"Tutorial\",\n    colourpalette: \"Farbpalette\",\n    palettehint: \"Dropdown-Menü zum Wechseln der Farbpalette.\",\n\n    remotefoldersbrowser: \"Browser für Remote-Ordner\",\n\n    server: \"Server\",\n    networklog: \"Netzwerkprotokoll\",\n    editfile: \"Datei bearbeiten\",\n    editfolder: \"Ordner bearbeiten\",\n    editcomment: \"Kommentar bearbeiten\",\n    user: \"Benutzer\",\n    griddisplay: \"Als Raster anzeigen\",\n    tabledisplay: \"Als Tabelle anzeigen\",\n    deletefile: \"Datei löschen\",\n    deletefolder: \"Ordner löschen\",\n    comments: \"Kommentare\",\n    deletecomment: \"Kommentar löschen\",\n    savecomment: \"Kommentar speichern\",\n    addcomment: \"Kommentar hinzufügen\",\n    nocomments: \"Keine Kommentare\",\n    savechanges: \"Änderungen speichern\",\n    uploadfile: \"Datei hochladen\",\n    compactview: \"Kompaktansicht\",\n    showdiscussion: \"Diskussion anzeigen\",\n    edittags: \"Tags bearbeiten\",\n    availabletags: \"Verfügbare Tags\",\n    assignedtags: \"Zugewiesene Tags\",\n    connectioninformation: \"Verbindungsinformationen\",\n    serverurl: \"Server-URL\",\n    servername: \"Servername\",\n    login: \"Anmelden\",\n    logout: \"Abmelden\",\n    password: \"Passwort\",\n    logoutmessage: \"Möchten Sie sich wirklich abmelden?\",\n    loginerror: \"Anmeldung nicht möglich.\",\n    accessibletologgedinusers: \"Diese Seite ist nur für angemeldete Benutzer zugänglich.\",\n\n\n    export: \"Export\",\n    exportvideo: \"Video exportieren\",\n    exportpng: \"Bild exportieren\",\n\n    exportdonotclosewindowhint: \"Schließen Sie dieses Fenster nicht, die Datei wird automatisch heruntergeladen.\",\n    exportencodingfile: \"Videodatei wird kodiert...\",\n    exportrecordingframes: \"Frames werden aufgezeichnet...\",\n\n    histogram: \"Histogramm\",\n    timeline: \"Zeitleiste\",\n\n    exportwidth: \"Breite\",\n    exportmargin: \"Ränder\",\n    exportgap: \"Abstand\",\n    exportgrahpheight: \"Grafikhöhe\",\n    videoquality: \"Videoqualität\",\n    imagecompression: \"Bildkompression\",\n\n    theme: \"Design\",\n    light: \"Hell\",\n    dark: \"Dunkel\",\n\n    foldermayhavefiles: \"Ordner für Dateien\",\n    foldermayhavesubfolders: \"Ordner für Unterordner\",\n}","import i18next from 'i18next';\nimport { initLitI18n } from 'lit-i18n';\nimport LanguageDetector from 'i18next-browser-languagedetector';\n\nimport { en } from './languages/en';\nimport { fr } from './languages/fr';\nimport { cs } from './languages/cs';\nimport { cy } from './languages/cy';\nimport { de } from './languages/de';\n\n/** initialise the I18n object */\ni18next\n    .use(initLitI18n)\n    .use(LanguageDetector)\n    .init(\n    {\n        // lng: 'de',\n        fallbackLng: \"en\",\n        resources: {\n            \n            cs: {\n                translation: cs,\n            },\n            cy: {\n                translation: cy\n            },\n            de: {\n                translation: de\n            },\n            en: {\n                translation: en,\n            },\n            fr: {\n                translation: fr,\n            },\n        },\n    }\n);\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n(window as any).i18next = i18next;\n\n/** i18n engine exported from the `@labirthermal/webcomponents` package */\nconst i18webcomponents = i18next;\n\nexport default i18webcomponents;","","\nconst mode = window.matchMedia( \"(prefers-color-scheme: dark)\" );\n\nexport const DARK_MODE_CLASS = \"thermal-dark-mode\";\n\nconst activateDrkMode = () => {\n    document.body.classList.add( DARK_MODE_CLASS );\n}\nconst deactivateDarkMode = () => {\n    document.body.classList.remove( DARK_MODE_CLASS );\n}\n\nexport const initialiseMode = () => {\n\n    if ( mode.matches ) {\n        activateDrkMode();\n    }\n\n    const handler = ( event: MediaQueryListEvent ) => {\n        if ( event.matches ) {\n            activateDrkMode();\n        } else {\n            deactivateDarkMode();\n        }\n    }\n\n\n    mode.addEventListener( \"change\", handler );\n    mode.addListener( handler );\n\n}","import {version as pversion} from \"../../package.json\";\nimport { DARK_MODE_CLASS } from \"./mode\";\n\n\nexport const appendStyles = () => {\n    const styles = document.createElement(\"link\");\n    styles.href = \"https://cdn.jsdelivr.net/npm/@labirthermal/webcomponents/dist/embed.css\"\n    document.head.appendChild( styles );\n}\n\nconst version = pversion.toString().replaceAll(\".\", \"-\");\nconst getStylesheetId = (scope: string) => {\n    return `labirthermal__${scope}__${version}`;\n}\n\n\nconst cssStyleIsAppended = (scope: string) => {\n    const element = document.getElementById(getStylesheetId(scope));\n    return element !== null;\n}\n\nconst appendHeadCss = (scope: string, styles: string) => {\n\n    if (!cssStyleIsAppended(scope)) {\n\n        const element = document.createElement(\"style\");\n        element.setAttribute(\"id\", getStylesheetId(scope));\n        element.innerHTML = styles;\n\n        document.head.appendChild(element);\n\n    }\n\n}\n\nexport const addInlineStyles = () => {\n\n    appendHeadCss(\"rootVariables\", `\n\n        :root {\n\n            /** Colors */\n            --thermal-foreground: black;\n            --thermal-background: white;\n\n            /** Primary - base */\n            --thermal-primary-base: blue;\n            --thermal-primary-base-dark: navy;\n            --thermal-primary-base-light: lightblue;\n\n            /** Primary */\n            --thermal-primary: var( --thermal-primary-base );\n            --thermal-primary-light: var( --thermal-primary-base-light );\n            --thermal-primary-dark: var( --thermal-primary-base-dark );\n\n            /** Slate -base */\n            --thermal-slate-base: #8e8c8f;\n            --thermal-slate-base-light: #dad7db;\n            --thermal-slate-base-dark: #49474a;\n\n            /** Slate */\n            --thermal-slate: var( --thermal-slate-base );\n            --thermal-slate-light: var( --thermal-slate-base-light );\n            --thermal-slate-dark: var( --thermal-slate-base-dark );\n\n            /** Gaps */\n            --thermal-gap-base: 16px;\n            --thermal-gap-sm: 17px;\n            --thermal-gap-md: 18px;\n            --thermal-gap-lg: 19px;\n            --thermal-gap-xl: 20px; \n            --thermal-gap: var( --thermal-gap-base );\n\n            /** Font sizes */\n            --thermal-fs-base: 16px;\n            --thermal-fs-sm: 16px;\n            --thermal-fs-md: 16px;\n            --thermal-fs-lg: 16px;\n            --thermal-fs-xl: 16px; \n            --thermal-fs: var( --thermal-fs-base );\n            --thermal-fs-small: calc( var( --thermal-fs ) * 0.9 );\n            --thermal-fs-large: calc( var( --thermal-fs ) * 1.2 );\n\n            /** Round corners */\n            --thermal-radius-base: 5px;\n            --thermal-radius-sm: 6px;\n            --thermal-radius-md: 7px;\n            --thermal-radius-lg: 8px;\n            --thermal-radius-xl: 9px;\n            --thermal-radius: var( --thermal-radius-base );\n\n            /** Shadows */\n            --thermal-shadow: 0px 0px 5px var( --thermal-slate-dark );\n            --thermal-shadow-none: 0px 0px 0px transparent;\n\n            --thermal-border-width: 1px;\n            --thermal-border-style: solid;\n        \n        }\n\n        :root {\n        \n            @media ( min-width: 640px ) {\n                --thermal-gap: var( --thermal-gap-sm );\n                --thermal-fs: var( --thermal-fs-sm );\n                --thermal-radius: var( --thermal-radius-sm );\n            }\n\n            @media ( min-width: 960px ) {\n                --thermal-gap: var( --thermal-gap-md );\n                --thermal-fs: var( --thermal-fs-md );\n                --thermal-radius: var( --thermal-radius-md );\n            }\n            \n            @media ( min-width: 1250px ) {\n                --thermal-gap: var( --thermal-gap-lg );\n                --thermal-fs: var( --thermal-fs-lg );\n                --thermal-radius: var( --thermal-radius-lg );\n            }\n\n            @media ( min-width: 1440px ) {\n                --thermal-gap: var( --thermal-gap-xl );\n                --thermal-fs: var( --thermal-fs-xl );\n                --thermal-radius: var( --thermal-radius-xl );\n            }\n        \n        }\n\n\n            \n        \n        ` );\n\n    appendHeadCss(\"darkModeOverrides\", `\n        \n            body.${DARK_MODE_CLASS} {\n\n                --thermal-primary: aqua;\n                --thermal-foreground: white;\n                --thermal-background: black;\n            \n                --thermal-primary-light: var( --thermal-primary-base-dark );\n                --thermal-primary-dark: var( --thermal-primary-base-light );\n\n                --thermal-slate-light: var( --thermal-slate-base-dark );\n                --thermal-slate-dark: var( --thermal-slate-base-light );\n            \n            }\n            \n        ` );\n\n    appendHeadCss( \"solarizedSkin\", `*[skin=\"solarized\"] {\n--thermal-foreground: #cef0faff;\n--thermal-background: #1d5766ff;\n\n--thermal-slate-dark: #39aaa1ff;\n--thermal-slate: #27888bff;\n--thermal-slate-light: #073642;\n\n--thermal-primary-dark: #defdffff;\n--thermal-primary: #9de9f3ff;\n--thermal-primary-light: #67bcddff;\n}` );\n\n    appendHeadCss( \"systemSkin\", `*[skin=\"system\"] {\n--thermal-foreground: buttontext;\n--thermal-background: field;\n        \n--thermal-slate: ButtonBorder;\n--thermal-slate-dark: GrayText;\n--thermal-slate-light: ButtonFace;\n\n--thermal-primary: accentcolor;\n--thermal-primary-dark: linktext;\n--thermal-primary-light: selecteditem;\n}` );\n\n    appendHeadCss( \"darkSkin\", `*[skin=\"dark\"] {\n--thermal-primary: aqua;\n--thermal-foreground: white;\n--thermal-background: black;\n\n--thermal-primary-light: var( --thermal-primary-base-dark );\n--thermal-primary-dark: var( --thermal-primary-base-light );\n\n--thermal-slate-light: var( --thermal-slate-base-dark );\n--thermal-slate-dark: var( --thermal-slate-base-light );\n}` );\n\n    appendHeadCss( \"darkHC\", `*[skin=\"darkhc\"] {\n--thermal-foreground: black;\n--thermal-background: white;\n        \n--thermal-slate: gray;\n--thermal-slate-dark: #454545;\n--thermal-slate-light: lightgray;\n\n--thermal-primary: blue;\n--thermal-primary-dark: navy;\n--thermal-primary-light: lightblue;\n\n}` );\n\n    appendHeadCss( \"narrowCorners\", `*[corners=\"narrow\"] {\n--thermal-radius: 0px;\n` );\n\n    appendHeadCss( \"lineStyles\", `*[lines=\"big\"] {\n--thermal-border-width: 3px;\n` );\n\n}\n\n\n","/**\n * Keys of all translation keys.\n * \n * In the comment is the englis version. Use only the keys in any t() function.\n */\nexport enum T {\n\n    moreoptions = \"moreoptions\",\n\n    loading = \"loading\",\n    config = \"config\",\n    temperature = \"temperature\",\n\n    upload = \"upload\",\n    uploadafile = \"uploadafile\",\n    selectfile = \"selectfile\",\n    addfiles = \"addfiles\",\n    clear = \"clear\",\n    dragorselectfile = \"dragorselectfile\",\n\n    share = \"share\",\n    fileloadingerror = \"fileloadingerror\",\n    embedhint = \"embedhint\",\n    embedlibrary = \"embedlibrary\",\n    embedcomponent = \"embedcomponent\",\n    copy = \"copy\",\n    create = \"create\",\n\n    remotefoldersbrowseraddfolderhint = \"remotefoldersbrowseraddfolderhint\",\n\n    file = \"file\",\n\n    layout_simple = \"layout_simple\",\n    layout_advanced = \"layout_advanced\",\n    layout_nogui = \"layout_nogui\",\n    layout_lesson = \"layout_lesson\",\n\n    /** Next */\n    next = \"next\",\n    /** Previous */\n    prev = \"prev\",\n    /** Back */\n    back = \"back\",\n    \n    /** Close */\n    close = \"close\",\n    open = \"open\",\n\n    detail = \"detail\",\n\n    showeverything = \"showeverything\",\n\n    palette = \"palette\",\n\n    /** Description */\n    description = \"description\",\n    /** Author */\n    author = \"author\",\n    /** License */\n    license = \"license\",\n    /** Recorded at */\n    recordedat = \"recordedat\",\n\n    /** Display settings */\n    displaysettings = \"displaysettings\",\n\n    /** File rendering */\n    filerendering = \"filerendering\",\n\n    /** Pixelated */\n    pixelated = \"pixelated\",\n\n    /** Smooth */\n    smooth = \"smooth\",\n\n    /** 'Pixelated' mode disables antialising of the thermogram and enables you to see its pixels as they are. */\n    filerenderinghint = \"filerenderinghint\",\n\n    /** Adjust time scale */\n    adjusttimescale = \"adjusttimescale\",\n\n    automaticrange = \"automaticrange\",\n    fullrange = \"fullrange\",\n\n    /** Adjust the time scale automatically (based on histogram) or set its values to the full range (min and max). */\n    adjusttimescalehint = \"adjusttimescalehint\",\n\n    /** Select colour palette of thermal display. */\n    colourpalettehint = \"colourpalettehint\",\n\n    /** Palette {name} */\n    palettename = \"palettename\",\n\n\n    /** File info */\n    fileinfo = \"fileinfo\",\n    /** IR file name */\n    thermalfilename = \"thermalfilename\",\n    /** IR file URL */\n    thermalfileurl = \"thermalfileurl\",\n    /** Download the IR file */\n    thermalfiledownload = \"thermalfiledownload\",\n    /** Visible file name */\n    visiblefilename = \"visiblefilename\",\n    /** Visible file URL */\n    visiblefileurl = \"visiblefileurl\",\n    /** Download visible file */\n    visiblefiledownload = \"visiblefiledownload\",\n\n    togglevisibleimage = \"togglevisibleimage\",\n\n    /** Time */\n    time = \"time\",\n    /** Duration */\n    duration = \"duration\",\n    /** Resolution */\n    resolution = \"resolution\",\n    /** Bytesize */\n    bytesize = \"bytesize\",\n    /** Minimal temperature */\n    minimaltemperature = \"minimaltemperature\",\n    /** Maximal temperature */\n    maximaltemperature = \"maximaltemperature\",\n\n    /** File type */\n    filetype = \"filetype\",\n    /** Type */\n    type = \"type\",\n    /** Supported devices */\n    supporteddevices = \"supporteddevices\",\n\n    numfiles = \"numfiles\",\n\n\n\n    download = \"download\",\n    downloadoriginalfiles = \"downloadoriginalfiles\",\n    downloadoriginalfileshint = \"downloadoriginalfileshint\",\n    downloadoriginalfile = \"downloadoriginalfile\",\n    exportcurrentframeaspng = \"exportcurrentframeaspng\",\n    convertentiresequencetovideo = \"convertentiresequencetovideo\",\n    pngofindividualimages = \"pngofindividualimages\",\n    pngofindividualimageshint = \"pngofindividualimageshint\",\n    pngofentiregroup = \"pngofentiregroup\",\n    pngofentiregrouphint = \"pngofentiregrouphint\",\n    csvofanalysisdata = \"csvofanalysisdata\",\n    csvofanalysisdatahint = \"csvofanalysisdatahint\",\n    exportimagewidth = \"exportimagewidth\",\n    exportimagefontsize = \"exportimagefontsize\",\n    exportgroupname = \"exportgroupname\",\n    exportfilenames = \"exportfilenames\",\n    numberofcolumns = \"numberofcolumns\",\n    exportdimensions = \"exportdimensions\",\n    exportgroup = \"exportgroup\",\n    thermalscale = \"thermalscale\",\n    thermalrange = \"thermalrange\",\n    filedate = \"filedate\",\n\n    folder = \"folder\",\n    folders = \"folders\",\n\n    showingfolder = \"showingfolder\",\n    showingfolders = \"showingfolders\",\n    and = \"and\",\n    or = \"or\",\n    doyouwanttoadd = \"doyouwanttoadd\",\n    youmayalsoadd = \"youmayalsoadd\",\n\n    range = \"range\",\n    info = \"info\",\n    note = \"note\",\n\n    group = \"group\",\n    donotgroup = \"donotgroup\",\n    groupby = \"groupby\",\n\n    groupped = \"groupped\",\n\n    bydays = \"bydays\",\n    byhours = \"byhours\",\n    byweeks = \"byweeks\",\n    bymonths = \"bymonths\",\n    byyears = \"byyears\",\n\n    play = \"play\",\n    pause = \"pause\",\n    stop = \"stop\",\n    date = \"date\",\n    frame = \"frame\",\n    playbackspeed = \"playbackspeed\",\n    graphlines = \"graphlines\",\n    straightlines = \"straightlines\",\n    smoothlines = \"smoothlines\",\n    graphlineshint = \"graphlineshint\",\n    reload = \"reload\",\n\n    analysis = \"analysis\",\n    analyses = \"analyses\",\n    avg = \"avg\",\n    min = \"min\",\n    max = \"max\",\n    size = \"size\",\n    edit = \"edit\",\n    editsth = \"editsth\",\n    remove = \"remove\",\n    addpoint = \"addpoint\",\n    addrectangle = \"addrectangle\",\n    addellipsis = \"addellipsis\",\n    analysishint = \"analysishint\",\n    graph = \"graph\",\n    graphhint1 = \"graphhint1\",\n    graphhint2 = \"graphhint2\",\n\n    rectangle = \"rectangle\",\n    ellipsis = \"ellipsis\",\n    point = \"point\",\n    name = \"name\",\n    color = \"color\",\n    top = \"top\",\n    left = \"left\",\n    right = \"right\",\n    bottom = \"bottom\",\n    columns = \"columns\",\n\n    fromto = \"fromto\",\n    downloadgraphdataascsv = \"downloadgraphdataascsv\",\n\n\n    apparenttemperature = \"apparenttemperature\",\n    airtemperature = \"airtemperature\",\n    relativeairhumidity = \"relativeairhumidity\",\n    windspeed = \"windspeed\",\n    inpercent = \"inpercent\",\n    apparenttemperatureverbose = \"apparenttemperatureverbose\",\n    youfeelwarmer = \"youfeelwarmer\",\n    youfeelcolder = \"youfeelcolder\",\n    apparenttemperaturehint = \"apparenttemperaturehint\",\n\n    analysissync = \"analysissync\",\n\n    /** Inspect tool */\n    inspecttemperatures = \"inspecttemperatures\",\n    usemousetoinspecttemperaturevalues = \"usemousetoinspecttemperaturevalues\",\n\n    /**  Edit analysis tool */\n    editanalysis = \"editanalysis\",\n    dragcornersofselectedanalysis = \"dragcornersofselectedanalysis\",\n\n    /** Add point tool */\n    addpointanalysis = \"addpointanalysis\",\n    clickandaddpoint = \"clickandaddpoint\",\n\n    /** Add rectangle tool */\n    addrectangleanalysis = \"addrectangleanalysis\",\n    clickandaddrectangle = \"clickandaddrectangle\",\n\n    /** Add ellipsis tool */\n    addellipsisanalysis = \"addellipsisanalysis\",\n    clickandaddellipsis = \"clickandaddellipsis\",\n\n\n\n    /** Tutorial */\n    tutorial = \"tutorial\",\n    /** Colour Palette */\n    colourpalette = \"colourpalette\",\n    /** Use the dropdown to change the palette */\n    palettehint = \"palettehint\",\n\n    remotefoldersbrowser = \"remotefoldersbrowser\",\n\n\n\n    /** Server */\n    server = \"server\",\n    networklog = \"networklog\",\n    editfile = \"editfile\",\n    editfolder = \"editfolder\",\n    editcomment = \"editcomment\",\n    user = \"user\",\n    griddisplay = \"griddisplay\",\n    tabledisplay = \"tabledisplay\",\n    deletefile = \"deletefile\",\n    deletefolder = \"deletefolder\",\n    comments = \"comments\",\n    deletecomment = \"deletecomment\",\n    savecomment = \"savecomment\",\n    addcomment = \"addcomment\",\n    nocomments = \"nocomments\",\n    savechanges = \"savechanges\",\n    uploadfile = \"uploadfile\",\n    compactview = \"compactview\",\n    showdiscussion = \"showdiscussion\",\n    edittags = \"edittags\",\n    assignedtags = \"assignedtags\",\n    availabletags = \"availabletags\",\n    connectioninformation = \"connectioninformation\",\n    serverurl = \"serverurl\",\n    servername = \"servername\",\n    login = \"login\",\n    logout = \"logout\",\n    logoutmessage = \"logoutmessage\",\n    loginerror = \"logineerror\",\n    password = \"password\",\n    accessibletologgedinusers = \"accessibletologgedinusers\",\n\n\n    display = \"display\",\n    content = \"content\",\n    syncanalyses = \"syncanalyses\",\n    overviewofyourfolders = \"overviewofyourfolders\",\n    uploadedby = \"uploadedby\",\n    uploadeddat = \"uploadeddat\",\n    createfolder = \"createfolder\",\n    subfolder = \"subfolder\",\n    createsubfolder = \"createsubfolder\",\n    delete = \"delete\",\n\n    export = \"export\",\n    \n    exportcontent = \"exportcontent\",\n    histogram = \"histogram\",\n    timeline = \"timeline\",\n    \n    exportwidth = \"exportwidth\",\n    exportmargin = \"exportmargin\",\n    exportgap = \"exportgap\",\n    exportgrahpheight = \"exportgrahpheight\",\n    imagecompression = \"imagecompression\",\n    videoquality = \"videoquality\",\n    exportvideo = \"exportvideo\",\n    exportpng = \"exportpng\",\n\n    exportrecordingframes = \"exportrecordingframes\",\n    exportencodingfile = \"exportencodingfile\",\n\n    exportdonotclosewindowhint = \"exportdonotclosewindowhint\",\n\n    theme = \"theme\",\n    light = \"light\",\n    dark = \"dark\",\n\n    foldermayhavefiles = \"foldermayhavefiles\",\n    foldermayhavesubfolders = \"foldermayhavesubfolders\",\n\n}\n\nexport default {\n    T: T\n}\n\nexport type Translation = {\n    [K in keyof typeof T]: string\n}\n\ntype LangDefinition = {\n    code: string,\n    name: string,\n    flag: string,\n    disabled?: true\n}\n\nexport const languages: LangDefinition[] = [\n    \n    {\n        code: \"cs\",\n        name: \"Čeština\",\n        flag: \"🇨🇿\"\n    },\n    {\n        code: \"cy\",\n        name: \"Cymraeg\",\n        flag: \"🏴󠁧󠁢󠁷󠁬󠁳󠁿\",\n        disabled: true\n    },\n    {\n        code: \"de\",\n        name: \"Deutsch\",\n        flag: \"🇩🇪\"\n    },\n    {\n        code: \"en\",\n        name: \"English\",\n        flag: \"🇬🇧\"\n    },\n    {\n        code: \"fr\",\n        name: \"Français\",\n        flag: \"🇫🇷\"\n    },\n    \n];\n\nexport const languagesObject = Object.fromEntries( languages.map( l => [l.code, l] ) );","import { createContext } from \"@lit/context\";\nimport i18next from \"i18next\";\n\nexport type Locales = \"en\"|\"cs\"|\"fr\"|\"cy\"|\"de\";\n\nexport const localeContext = createContext<Locales>(\"localeContext\");\n\nexport interface IWithlocale {\n    locale: Locales;\n}\n\nexport const initLocalesInTopLevelElement = ( element: IWithlocale ) => {\n    i18next.on( \"languageChanged\", locale => {\n        element.locale = locale as Locales;\n    } );\n    if ( element.locale === undefined ) {\n        element.locale = i18next.language as Locales;\n    } else {\n        i18next.changeLanguage( element.locale );\n    }\n}\n\nconst localeMap = {\n    cs: ['cs', 'cz', 'cs_CZ', 'cs_CS'],\n    fr: ['fr', 'fr_FR', 'fr_CA'],\n    de: ['de', 'de_DE', 'de_AT', 'de_CH'],\n    cy: ['cy', 'cy_GB', \"cy\"],\n    en: ['en', 'en_US', 'en_GB', 'en_CA', 'en_AU', 'en_NZ', 'en_IE', 'en_ZA']\n}\n\nexport const localeConverter = {\n    fromAttribute: (value: string) => {\n        let safe: string|undefined = undefined;\n        let index = 0;\n        while ( index < Object.keys( localeMap ).length && safe === undefined ) {\n            const key = Object.keys( localeMap )[index] as keyof typeof localeMap;\n            if ( localeMap[key].includes( value ) ) {\n                safe = key;\n            }\n            index++;\n        }\n        return safe ?? \"en\";\n    },\n    toAttribute: (value: string) => {\n        return value;\n    }\n}","/**\n * Generation of short, collision-free identifiers used instead of full-length UUIDs.\n *\n * The identifiers are only ever used at runtime (as map keys, DOM ids and log prefixes),\n * they are never persisted nor shared between pages. Therefore a short random string\n * is sufficient - and uniqueness within the current document is guaranteed by keeping\n * a registry of all identifiers issued so far.\n *\n * @module \\@labirthermal/webcomponents\n * @author Jan Jáchim <jachim@ntc.zcu.cz>\n */\n\n/** Alphabet used for the generated identifiers. Lowercase letters and digits only, so that the ids are safe to use in DOM ids, CSS selectors and slugs. */\nconst ALPHABET = \"abcdefghijklmnopqrstuvwxyz0123456789\";\n\n/** Default length of a generated identifier. 8 characters of the 36-letter alphabet give ~2.8e12 combinations. */\nconst DEFAULT_LENGTH = 8;\n\n/** All identifiers issued within the current document. Guarantees that no two identifiers ever collide. */\nconst issuedIds = new Set<string>();\n\n/** Fill the given array with random values, preferring the Web Crypto API and falling back to `Math.random`. */\nconst fillRandom = (buffer: Uint8Array): Uint8Array => {\n    const cryptoObject = typeof globalThis !== \"undefined\"\n        ? globalThis.crypto\n        : undefined;\n\n    if (cryptoObject && typeof cryptoObject.getRandomValues === \"function\") {\n        cryptoObject.getRandomValues(buffer);\n        return buffer;\n    }\n\n    for (let i = 0; i < buffer.length; i++) {\n        buffer[i] = Math.floor(Math.random() * 256);\n    }\n\n    return buffer;\n};\n\n/** Generate a random string of the given length using the {@link ALPHABET}. */\nconst randomString = (length: number): string => {\n    const buffer = fillRandom(new Uint8Array(length));\n    let result = \"\";\n    for (let i = 0; i < length; i++) {\n        result += ALPHABET[buffer[i] % ALPHABET.length];\n    }\n    return result;\n};\n\n/**\n * Generate a short identifier that is guaranteed to be unique within the current document.\n *\n * Should the random value happen to be taken already, a new one is generated. After\n * a few unsuccessful attempts the identifier is lengthened, so that the function\n * always terminates even when an extreme number of identifiers is in use.\n *\n * @param length The requested number of characters. Defaults to 8.\n * @returns A unique lowercase alphanumeric identifier.\n */\nexport const generateShortId = (\n    length: number = DEFAULT_LENGTH\n): string => {\n\n    const safeLength = Math.max(1, Math.floor(length));\n\n    let currentLength = safeLength;\n    let attempts = 0;\n\n    while (true) {\n\n        const candidate = randomString(currentLength);\n\n        if (!issuedIds.has(candidate)) {\n            issuedIds.add(candidate);\n            return candidate;\n        }\n\n        attempts++;\n\n        if (attempts % 5 === 0) {\n            currentLength++;\n        }\n    }\n};\n","import type { PropertyValues } from \"lit\";\nimport type { AbstractHierarchyController } from \"./AbstractHierarchyController\";\nimport type { AbstractThermalElement } from \"../hierarchy/AbstractThermalElement\";\n\n\n/** Perform updates in the hierarchy for all registered controllers */\nexport class HierarchyUpdatesHub {\n\n    private _controllers: AbstractHierarchyController<AbstractThermalElement>[] = [];\n\n    /** Zaregistruje controller do hubu */\n    public register<C extends AbstractHierarchyController<AbstractThermalElement>>(controller: C): C {\n        this._controllers.push(controller);\n        return controller;\n    }\n\n    /** Zavolá willUpdate na všech zaregistrovaných controllerech */\n    public willUpdate(changedProperties: PropertyValues<AbstractThermalElement>): void {\n        for (const controller of this._controllers) {\n            controller.hostWillUpdateWatcher?.(changedProperties);\n        }\n    }\n\n    /** Zavolá updated na všech zaregistrovaných controllerech */\n    public updated(changedProperties: PropertyValues<AbstractThermalElement>): void {\n        for (const controller of this._controllers) {\n            controller.hostUpdatedWatcher?.(changedProperties);\n        }\n    }\n\n\n}","import { consume } from \"@lit/context\";\nimport i18next, { t } from \"i18next\";\nimport type { PropertyValues } from \"lit\";\nimport { html, LitElement } from \"lit\";\nimport { unsafeSVG } from \"lit/directives/unsafe-svg.js\";\nimport { T } from \"../translations/Languages\";\nimport { localeContext } from \"../translations/localeContext\";\nimport { generateShortId } from \"../utils/shortId\";\nimport { HierarchyUpdatesHub } from \"../controllers/HierarchyUpdatesHub\";\n\n/** \n * All the webcomponents of \\@labirthermal/webcomponents (and its extensions) should be based on the abstract class `AbstractThermalElement`. \n * \n * Functionality:\n * - listens to the locale context for rerender\n * - is able to handle hierarchy controllers through the `HierarchyUpdatesHub` mechanism\n * - generates a short unique identifier (`UUID`) for each instance\n * - provides helpers such as:\n *   - `t` for translation\n *   - `i` for rendering SVG strings safely\n *   - `log` for standardized logging with tag name and UUID\n *   - `getUUID` for generating unique identifiers with a message\n * \n * @see {@link HierarchyUpdatesHub}\n * \n * @module @labirthermal/webcomponents\n * @author Jan Jáchim <jachim@ntc.zcu.cz>\n */\nexport abstract class AbstractThermalElement extends LitElement {\n\n    private _hierarchy?: HierarchyUpdatesHub;\n\n    /** \n     * Get the hierarchy for the purpose of managing updates using hierarchy controllers \n     * @see {@link HierarchyUpdatesHub}\n     * @internal\n     */\n    public initHierarchy(): HierarchyUpdatesHub {\n        if (!this._hierarchy) {\n            this._hierarchy = new HierarchyUpdatesHub();\n        }\n        return this._hierarchy;\n    }\n\n\n    // declare public requestUpdate\n\n    private _UUID?: string\n\n    /** \n     * A short identifier of this instance, generated lazily. \n     * It is guaranteed to be unique within the current document.\n     * @see {@link generateShortId}\n     */\n    public get UUID() {\n        if (this._UUID === undefined) {\n            this._UUID = generateShortId();\n        }\n        return this._UUID;\n    };\n\n    public getUUID(\n        msg: string\n    ): string {\n        return this.UUID + \"_\" + msg;\n    }\n\n    /** A standardised way to log messages to the console prepending this webcomponent's tag name and UUID for easier identification */\n    public log(...args: unknown[]) {\n        console.log(this.tagName, this.UUID, ...args);\n    }\n\n    static shadowRootOptions: ShadowRootInit = {\n        ...LitElement.shadowRootOptions,\n        mode: \"open\"\n    }\n\n    /** Consume the locale context for rerendering whenever a language changes globally. */\n    @consume({ context: localeContext, subscribe: true })\n    private _locale?: string;\n\n    /** Stable callback so the global language subscription can be removed on disconnect. */\n    private readonly languageChanged = (locale: string): void => {\n        this._locale = locale;\n    };\n\n    connectedCallback(): void {\n        super.connectedCallback();\n        // Sync the locale context from the global to this webcomponent\n        this._locale = i18next.language;\n        // Subscribe to global language changes to keep the locale context updated.\n        i18next.on(\"languageChanged\", this.languageChanged);\n    }\n\n    disconnectedCallback(): void {\n        // Unsubscribe from global language changes to avoid memory leaks\n        i18next.off(\"languageChanged\", this.languageChanged);\n        super.disconnectedCallback();\n    }\n\n    /** \n     * Renders an SVG string safely using the unsafeSVG directive \n     * @see {@link unsafeSVG}\n     */\n    protected i(str: string): unknown {\n        return html`${unsafeSVG(str)}`;\n    }\n\n    /** \n     * Returns a translated string \n     * @see {@link T}\n     */\n    public t(key: keyof typeof T): string {\n        return t(T[key]);\n    }\n\n    willUpdate(changedProperties: PropertyValues<AbstractThermalElement>): void {\n        super.willUpdate?.(changedProperties);\n        this._hierarchy?.willUpdate(changedProperties);\n    }\n\n    updated(changedProperties: PropertyValues<AbstractThermalElement>): void {\n        super.updated?.(changedProperties);\n        this._hierarchy?.updated(changedProperties);\n    }\n\n}\n","import type { ReactiveController } from \"lit\";\nimport type {  AbstractThermalElement } from \"../hierarchy/AbstractThermalElement\";\n\n\n/** \n * This is the abstract class for all reactive controllers from the `@labirthermal/webcomponents` package. \n * @module @labirthermal/webcomponents\n */\nexport abstract class AbstractReactiveController<T extends AbstractThermalElement> implements ReactiveController {\n\n    host: T;\n\n    /** Implement this method somehow to combine the host UUID and a unique marker of the controller. */\n    public abstract get UUID(): string;\n\n    constructor(host: T) {\n        this.host = host;\n        host.addController(this);\n    }\n\n    abstract hostConnected(): void;\n\n    abstract hostDisconnected(): void;\n\n    /** Logs anything using the host's logging mechanism. Adds the controller's className as the first argument. */\n    protected log(...args: any[]): void { // eslint-disable-line @typescript-eslint/no-explicit-any\n        this.host.log(\n            this.constructor.name,\n            ...args\n        );\n    }\n\n}","import type { PropertyDeclaration, PropertyValues } from \"lit\";\nimport { AbstractReactiveController } from \"./AbstractReactiveController\";\nimport type { AbstractThermalElement } from \"../hierarchy/AbstractThermalElement\";\n\n/** \n * Common internal state for host elements that should be only internal states. \n * @module @labirthermal/core\n * @author Jan Jáchim <jachim@zcu.cz>\n * @see {@link AbstractReactiveController}\n */\nexport const INTERNAL_STATE_DECLARATION: PropertyDeclaration = { reflect: false, state: true }\n\n/** \n * A declaration of the host property for the purpose of its reactive properties. \n * \n * Used in the static properties of the particular controller:\n * \n * ```ts\n * \n * export interface IElementWithMyController extends IBaseElement {\n *  aPublicProperty: string | undefined;\n * }\n * \n * export class MyController extends AbstractHierarchyController<IElementWithMyController> {\n * \n *  public static HOST_PROPERTIES: HostReactiveProperties<IElementWithMyController> = {\n *      aPublicProperty: { reflect: true, attribute: \"a-public-property\" }\n * }\n * \n * }\n * ```\n * \n * Once the reactive property is defined this way, it can be accessed from the outside this way:\n * \n * ```html\n * <my-element a-public-property=\"value\"></my-element>\n * ```\n * \n */\nexport type HostReactiveProperties<T> = {\n    [key in keyof T]: PropertyDeclaration;\n}\n\n/** \n * Abstract base class for controllers related to the hierarchy of `@labirthermal/core`.  \n * \n * This type of controllers has a special way of updating depending on the lifecycle of its host element.\n * \n * In the constructor of this controller, the constructor is added to the {@link HierarchyUpdatesHub} and therefore all the updates are trigged directly by the corresponding `willUpdate` and `updated` methods of the host.\n * \n * When working with various side effects and callbacks, it is important to split operations correctly in \n * - a) `hostWillUpdateWatcher` - for setting properties/states as side effects before render\n * - b) `hostUpdatedWatcher` - for binding listeners & other stuff after the host is rendered.\n * \n */\nexport abstract class AbstractHierarchyController<T extends AbstractThermalElement> extends AbstractReactiveController<T> {\n\n    constructor(host: T) {\n        super(host);\n        this.host.initHierarchy().register( this );\n    }\n\n    /** \n     * This method will be called automatically by the host element in its `willUpdate` method. \n     * @see {@link AbstractThermalElement}\n     */\n    abstract hostWillUpdateWatcher(value: PropertyValues<T>): void;\n\n    /** \n     * This method will be called automatically by the host element in its `updated` method. \n     * @see {@link AbstractThermalElement}*/\n    abstract hostUpdatedWatcher(value: PropertyValues<T>): void;\n\n    /** Retrieve the default slug from the host element, falling back to the element UUID. Should be called only in host connected. */\n    protected _getDefaultSlugFromHost(\n        primaryAttributeName: string\n    ): string {\n        return this.host.getAttribute(primaryAttributeName) ?? this.host.getAttribute(\"slug\") ?? this.UUID;\n    }\n    \n}","import type { ThermalFileInstance } from \"@labirthermal/core\";\nimport type { PropertyValues } from \"lit\";\nimport type { FileController, IElementWithFileController } from \"./FileController\";\n\nexport class FileAnalysisSynchronisator {\n\n    /** Lit.js is using null for removed attributes - we need normalize the value to either string or undefined. */\n    private static normalize(\n        value: string | null | undefined\n    ): string | undefined {\n        return value?.trim() || undefined;\n    }\n\n    private readonly _attribute: keyof IElementWithFileController;\n\n    private get _attributeValue(): string | undefined {\n        return this._controller.host[this._attribute] as string | undefined;\n    }\n\n    private set _attributeValue(value: string | undefined) {\n        if (value !== this._controller.host[this._attribute]) {\n            (this._controller.host[this._attribute] as string | undefined) = value;\n        }\n    }\n\n    private get _mountKey(): string {\n        return `${this._controller.UUID}_slot_${this._slotNumber}`;\n    }\n\n    private get _internalSerialized(): string | undefined {\n        return this._slotObject?.serialized as string | undefined;\n    }\n\n    private _fileObject?: ThermalFileInstance;\n\n    private get _slotObject() {\n        return this._fileObject?.slots.getSlot(this._slotNumber);\n    }\n\n    constructor(\n        private readonly _controller: FileController,\n        private readonly _slotNumber: number\n    ) {\n\n        this._attribute = `analysis${this._slotNumber}` as keyof IElementWithFileController;\n\n    }\n\n    /** Enables the listeners and internal objects necessary for synchronisation of the file analysis slot */\n    public fileAssigned(\n        instance: ThermalFileInstance,\n        coreWins: boolean = false\n    ): void {\n\n        this._fileObject = instance;\n\n        // Listener pro propagaci změn z jádra zpět do host atributu\n        instance.slots\n            .getOnSerializeManager(this._slotNumber)\n            ?.set(\n                this._controller.UUID,\n                value => {\n                    if (value !== this._attributeValue) {\n                        this._attributeValue = value;\n                    }\n                }\n            );\n\n        const syncAction = () => {\n            const attribute = FileAnalysisSynchronisator.normalize(this._attributeValue);\n\n            if (coreWins || attribute === undefined) {\n                this._attributeValue = this._slotObject?.serialized;\n            } else {\n                this._applyToCore(attribute);\n            }\n        };\n\n        // Pokud už soubor náhodou mounted je, aplikujeme hned:\n        if (instance.dom?.built) {\n            syncAction();\n        } else {\n            // Jinak počkáme na onMount z instance:\n            instance.onMount.set(this._mountKey, () => {\n                syncAction();\n            });\n        }\n\n    }\n\n    /** Deactivates the listeners and internal objects - stopping the synchronisation of analyses */\n    public fileUnassigned(): void {\n\n        this._fileObject?.slots\n            .getOnSerializeManager(this._slotNumber)\n            ?.delete(this._controller.UUID);\n\n        // Úklid listeneru z instance\n        this._fileObject?.onMount.delete(this._mountKey);\n\n        this._fileObject = undefined;\n\n    }\n\n    /** Looks for the changed attributes of the host and propagates them to internal state if necessary */\n    public handleHostUpdate(\n        changedValues: PropertyValues<typeof this._controller.host>\n    ): void {\n\n        if (changedValues.has(this._attribute)) {\n\n            const value = FileAnalysisSynchronisator.normalize(this._attributeValue);\n\n            if (this._internalSerialized !== value) {\n                // Pokud je soubor v DOMu, aplikujeme hned; pokud ne, onMount se o to postará\n                if (this._fileObject?.dom?.built) {\n                    this._applyToCore(value);\n                }\n            }\n\n        }\n    }\n\n    /** Very carrefully propagate the host attribute value to the analysis slot - this method manipulates the internal state of @labirthermal/core */\n    private _applyToCore(\n        value: string | undefined\n    ): void {\n\n        const file = this._fileObject;\n        if (!file) return;\n\n        const slot = this._slotObject;\n\n        if (value === undefined) {\n            if (slot) file.slots.removeSlotAndAnalysis(this._slotNumber);\n        } else if (slot) {\n            slot.recieveSerialized(value);\n\n            // Pokud slot už existoval (např. po remountu), zajistíme, že jeho DOM je v novém canvasLayer:\n            const canvasRoot = file.dom?.canvasLayer?.getLayerRoot();\n            if (canvasRoot && !canvasRoot.contains(slot.analysis.layerRoot)) {\n                canvasRoot.appendChild(slot.analysis.layerRoot);\n            }\n        } else {\n            file.slots.createAnalysisFromSerialized(value, this._slotNumber)?.setSelected();\n        }\n\n    }\n\n}","import type { PropertyValues } from \"lit\";\nimport { FileAnalysisSynchronisator } from \"./FileAnalysisSynchronisator\";\nimport type { FileController } from \"./FileController\";\nimport type { ThermalFileInstance } from \"@labirthermal/core\";\n\nexport class FileAnalysisSynchronisators {\n\n    private _synchronisators: FileAnalysisSynchronisator[] = [];\n\n    constructor(\n        private _controller: FileController\n    ) {\n\n        for ( let i = 1; i <= 7; i++ ) {\n            this._synchronisators.push(new FileAnalysisSynchronisator(this._controller, i));\n        }\n\n    }\n\n    private _forEach(\n        callback: (synchronisator: FileAnalysisSynchronisator) => void\n    ): void {\n\n        for ( const synchronisator of this._synchronisators ) {\n            callback(synchronisator);\n        }\n    }\n\n    /** Every synchronisator object will look into the changed properties and update its internal state accordingly */\n    public handleHostUpdate(\n        changedValues: PropertyValues<typeof this._controller.host>\n    ): void {\n        this._forEach(synchronisator => synchronisator.handleHostUpdate(changedValues));\n    }\n\n    /** Every synchronisator will be notified that a file has been assigned */\n    public handleFileAssigned(\n        instance: ThermalFileInstance,\n        coreWins: boolean = false\n    ): void {\n        this._forEach(synchronisator => synchronisator.fileAssigned( instance, coreWins ));\n    }\n\n    /** Every synchronisator will be notified that a file has been removed */\n    public handleFileUnassigned(): void {\n        this._forEach(synchronisator => synchronisator.fileUnassigned());\n    }\n\n}","import type { AbstractAnalysis, ThermalFileInstance, PlaybackSpeeds, ThermalFileFailure } from \"@labirthermal/core\";\nimport { CallbacksManager } from \"@labirthermal/core\";\nimport { FileAnalysisSynchronisators } from \"./FileAnalysisSynchronisators\";\nimport { ContextProvider, createContext } from \"@lit/context\";\nimport type { PropertyDeclaration, PropertyValueMap } from \"lit\";\nimport type { AbstractThermalElement } from \"../hierarchy/AbstractThermalElement\";\nimport type { HostReactiveProperties} from \"./AbstractHierarchyController\";\nimport { AbstractHierarchyController, INTERNAL_STATE_DECLARATION } from \"./AbstractHierarchyController\";\nimport type { GroupController } from \"./GroupController\";\nimport type { ManagerController } from \"./ManagerController\";\nimport type { RegistryController } from \"./RegistryController\";\n\ntype IHostProperties = {\n\n    managerController: ManagerController;\n    registryController: RegistryController;\n    groupController: GroupController;\n    fileController: FileController;\n\n\n    file?: ThermalFileInstance;\n    failure?: ThermalFileFailure;\n    loading: boolean;\n\n    ms: number;\n\n    playbackSpeed: PlaybackSpeeds;\n\n    analysis1?: string;\n    analysis2?: string;\n    analysis3?: string;\n    analysis4?: string;\n    analysis5?: string;\n    analysis6?: string;\n    analysis7?: string;\n\n    autoHighlight: boolean;\n\n}\n\nexport interface IElementWithFileController extends AbstractThermalElement, IHostProperties { }\n\n/** A crucial context for exporting the `FileController` object. */\nexport const fileControllerContext = createContext<FileController>(\"file-controller-context\");\n\n/** A crucial context exposing the `ThermalFileInstance` object from `FileController`. */\nexport const fileContext = createContext<ThermalFileInstance | undefined>(\"file-object-context\");\n\n/** Expose the file error value from the `FileController`. */\nexport const fileFailureContext = createContext<ThermalFileFailure | undefined>(\"file-failure-object\");\n\n/** Whether a file request is in progress; independent of readiness or an existing instance. */\nexport const fileLoadingContext = createContext<boolean>(\"file-loading\");\n\n/** File ready value from the `FileController` */\nexport const fileReadyContext = createContext<boolean>(\"file-ready-context\");\n\n/**. Current file MS value exposed as context. */\nexport const fileMsContext = createContext<number>(\"file-ms-context\");\n\n/** File time cursor indicvates the MS on which an arbitrary HTML may be recplaced. Undended to share across elements such as timeline ang graph. In those, the context shall be set on hover using `FileController.setFileTimeCursorPercentage()` */\nexport const fileTimeCursorContext = createContext<number | undefined>(\"file-time-cursor\");\n\n/** The `FileController` exposes the current file frame values as context. Current time is not possible to set by modification of this context. To change the current frame, it is necessary to use either:\n * - a) the `FileController.setMs()`\n * - b) the internal methods of `@labirthermal/core` `ThermalFileInstance[\"timeline\"]` methods such as play, pause, setTimeRelative etc..\n */\nexport type FileControllerCurrentFrameType = {\n    index: number;\n    ms: number;\n    time: string;\n    percentage: number;\n    absolute: number;\n};\nexport const fileCurrentFrameContext = createContext<FileControllerCurrentFrameType | undefined>(\"file-current-frame-context\");\n\n/** The duration of the file is exposed from the `FileController` with the value pre-calculated for consumers */\nexport type FileControllerDurationContextType = {\n    /** The file duration in ms */\n    ms: number;\n    /** The file formatted duration as string */\n    time: string;\n};\n\n/** Exposes the current file duration from `FileController` */\nexport const fileDurationContext = createContext<FileControllerDurationContextType | undefined>(\"file-duration-context\");\n\n/** Exposes the current playing state from `FileController`.  */\nexport const filePlayingContext = createContext<boolean>(\"file-playing-context\");\n\n/** Exposes the current playback speed value from `FileController`. */\nexport const filePlaybackSpeedContext = createContext<PlaybackSpeeds | undefined>(\"file-playback-speed\");\n\n/** Exposes the current recording state from `FileController`. */\nexport const fileRecordingContext = createContext<boolean>(\"file-is-recording-state\");\n\n/** Exposes the current may stop state from the `FileController` */\nexport const fileMayStopContext = createContext<boolean>(\"file-may-stop-state\");\n\n/** Exposes the array of current analyses from the `FileController` */\nexport const fileAnalysisListContext = createContext<AbstractAnalysis[]>(\"file-analysis-list\");\n\n\n\n/** Unified properties of an analysis attribute of the host webcomponent */\nconst ANALYSIS_STATE_DECLARATION: PropertyDeclaration = { type: String, reflect: true };\n\n/** The `FileController` is responsible for managing the state and interactions related to a file within the hierarchy. \n * \n * @author Jan Jáchim <jachim@zcu.cz>\n * @module @labirthermal/webcomponents\n*/\nexport class FileController extends AbstractHierarchyController<IElementWithFileController> {\n\n\n    private _UUID: string;\n\n    public get UUID(): string {\n        return this._UUID;\n    }\n\n    public static readonly HOST_PROPERTIES: HostReactiveProperties<IHostProperties> = {\n        managerController: INTERNAL_STATE_DECLARATION,\n        registryController: INTERNAL_STATE_DECLARATION,\n        groupController: INTERNAL_STATE_DECLARATION,\n        fileController: INTERNAL_STATE_DECLARATION,\n        file: INTERNAL_STATE_DECLARATION,\n        failure: INTERNAL_STATE_DECLARATION,\n        loading: INTERNAL_STATE_DECLARATION,\n        ms: { type: Number, reflect: true, attribute: \"ms\" },\n        playbackSpeed: { type: Number, reflect: true, attribute: \"speed\" },\n        analysis1: ANALYSIS_STATE_DECLARATION,\n        analysis2: ANALYSIS_STATE_DECLARATION,\n        analysis3: ANALYSIS_STATE_DECLARATION,\n        analysis4: ANALYSIS_STATE_DECLARATION,\n        analysis5: ANALYSIS_STATE_DECLARATION,\n        analysis6: ANALYSIS_STATE_DECLARATION,\n        analysis7: ANALYSIS_STATE_DECLARATION,\n        autoHighlight: { type: Boolean, reflect: true, attribute: \"autohighlight\" }\n    }\n\n    // Accessors to the host's file-related properties\n    public get fileObject() { return this.host.file; }\n    public get failure() { return this.host.failure; }\n    public get ms() { return this.host.ms; }\n    public get playbackSpeed() { return this.host.playbackSpeed; }\n    public get analysis1() { return this.host.analysis1; }\n    public get analysis2() { return this.host.analysis2; }\n    public get analysis3() { return this.host.analysis3; }\n    public get analysis4() { return this.host.analysis4; }\n    public get analysis5() { return this.host.analysis5; }\n    public get analysis6() { return this.host.analysis6; }\n    public get analysis7() { return this.host.analysis7; }\n    public get autoHighlight() { return this.host.autoHighlight; }\n\n    // Local state accessors\n    public get ready() { return this.readyContextProvider.value; }\n    public get recording() { return this.fileRecordingContextProvider.value; }\n    public get playing() { return this.filePlayingContextProvider.value; }\n    public get mayStop() { return this.fileMayStopContextProvider.value; }\n    public get cursor() { return this.fileCursorContextProvider.value; }\n    public get currentFrame() { return this.fileCurrentFrameContextProvider.value; }\n    public get analyses() { return this.fileAnalysesContextProvider.value; }\n    public get duration() { return this.fileDurationContextProvider.value; }\n\n    // Callbacks managers\n    public readonly onLoadingStart = new CallbacksManager<() => void>();\n    public readonly onSuccess = new CallbacksManager<(instance: ThermalFileInstance) => void>();\n    public readonly onFailure = new CallbacksManager<(error: ThermalFileFailure) => void>();\n\n\n\n    // Context providers\n\n    private fileControllerContextProvider: ContextProvider<typeof fileControllerContext, IElementWithFileController>;\n\n    private fileContextProvider: ContextProvider<typeof fileContext, IElementWithFileController>;\n\n    private fileFailureContextProvider: ContextProvider<typeof fileFailureContext, IElementWithFileController>;\n    private readonly loadingContextProvider: ContextProvider<typeof fileLoadingContext, IElementWithFileController>;\n\n    private readyContextProvider: ContextProvider<typeof fileReadyContext, IElementWithFileController>;\n\n    private fileDurationContextProvider: ContextProvider<typeof fileDurationContext, IElementWithFileController>;\n\n    private fileCurrentFrameContextProvider: ContextProvider<typeof fileCurrentFrameContext, IElementWithFileController>;\n\n    private fileCursorContextProvider: ContextProvider<typeof fileTimeCursorContext, IElementWithFileController>;\n\n    private fileMsContextProvider: ContextProvider<typeof fileMsContext, IElementWithFileController>;\n\n    private filePlaybackSpeedContextProvider: ContextProvider<typeof filePlaybackSpeedContext, IElementWithFileController>;\n\n    private filePlayingContextProvider: ContextProvider<typeof filePlayingContext, IElementWithFileController>;\n\n    private fileRecordingContextProvider: ContextProvider<typeof fileRecordingContext, IElementWithFileController>;\n\n    private fileMayStopContextProvider: ContextProvider<typeof fileMayStopContext, IElementWithFileController>;\n\n    private fileAnalysesContextProvider: ContextProvider<typeof fileAnalysisListContext, IElementWithFileController>;\n\n    \n    // Analysis synchronisation\n    private _analysisSynchronisators = new FileAnalysisSynchronisators(this); \n\n\n    private _propagateHighlightCache: (event: MouseEvent|FocusEvent) => void | undefined;\n    private _unpropagateHighlightCache: (event: MouseEvent|FocusEvent) => void | undefined;\n\n\n    constructor(\n        host: IElementWithFileController\n    ) {\n        super(host);\n        this._UUID = host.UUID + \"_file-controller\";\n\n        // Expose self as file context provider\n        this.fileControllerContextProvider = new ContextProvider(\n            this.host,\n            { context: fileControllerContext, initialValue: this }\n        );\n\n        // Create the file context provider\n        this.fileContextProvider = new ContextProvider(\n            this.host,\n            { context: fileContext }\n        );\n\n        this.fileFailureContextProvider = new ContextProvider(\n            this.host,\n            { context: fileFailureContext }\n        );\n\n        this.loadingContextProvider = new ContextProvider(\n            this.host,\n            { context: fileLoadingContext, initialValue: false }\n        );\n\n        this.readyContextProvider = new ContextProvider(\n            this.host,\n            { context: fileReadyContext, initialValue: false }\n        );\n\n        this.fileDurationContextProvider = new ContextProvider(\n            this.host,\n            { context: fileDurationContext }\n        );\n\n        this.fileCurrentFrameContextProvider = new ContextProvider(\n            this.host,\n            { context: fileCurrentFrameContext }\n        );\n\n        this.fileCursorContextProvider = new ContextProvider(\n            this.host,\n            { context: fileTimeCursorContext }\n        );\n\n        this.fileMsContextProvider = new ContextProvider(\n            this.host,\n            { context: fileMsContext }\n        );\n\n        this.filePlaybackSpeedContextProvider = new ContextProvider(\n            this.host,\n            { context: filePlaybackSpeedContext }\n        );\n\n        this.filePlayingContextProvider = new ContextProvider(\n            this.host,\n            { context: filePlayingContext }\n        );\n\n        this.fileRecordingContextProvider = new ContextProvider(\n            this.host,\n            { context: fileRecordingContext }\n        );\n\n        this.fileMayStopContextProvider = new ContextProvider(\n            this.host,\n            { context: fileMayStopContext }\n        );\n\n        this.fileAnalysesContextProvider = new ContextProvider(\n            this.host,\n            { context: fileAnalysisListContext, initialValue: [] }\n        );\n\n        this._propagateHighlightCache = () => this._propagateHighlight();\n        this._unpropagateHighlightCache = () => this._unpropagateHighlight();\n\n\n    }\n\n\n\n    hostConnected(): void {\n\n        // Register propagation events\n        this.host.addEventListener(\"mouseenter\", this._propagateHighlightCache);\n        this.host.addEventListener(\"focus\", this._propagateHighlightCache);\n        this.host.addEventListener(\"mouseleave\", this._unpropagateHighlightCache);\n        this.host.addEventListener(\"blur\", this._unpropagateHighlightCache);\n\n        // After moving, refresh the core links\n        if ( this._attached ) {\n            this._propagateContexts( this._attached );\n            this._bindListeners(this._attached, true);\n        }\n\n    }\n\n    hostDisconnected(): void {\n        \n        this.host.removeEventListener(\"mouseenter\", this._propagateHighlightCache);\n        this.host.removeEventListener(\"focus\", this._propagateHighlightCache);\n        this.host.removeEventListener(\"mouseleave\", this._unpropagateHighlightCache);\n        this.host.removeEventListener(\"blur\", this._unpropagateHighlightCache);\n\n        this._unpropagateHighlight();\n\n        if ( this._attached ) {\n            this._unbindListeners(this._attached);\n        }\n\n    }\n\n    hostWillUpdateWatcher(value: PropertyValueMap<IElementWithFileController>): void {\n        \n        // Update the file assignment\n        if (value.has(\"file\")) this._syncAssignment();\n\n        // Notify the analysis synchronisators about the host update\n        this._analysisSynchronisators.handleHostUpdate(value);\n\n        // Update the MS\n        if ( value.has(\"ms\")  ) {\n            this.setMs(this.host.ms);\n        }\n\n        // Update the playback speed\n        if ( value.has(\"playbackSpeed\") && this.host.file && this.host.file.timeline.isSequence ) {\n\n            if ( this.host.playbackSpeed !== this.host.file.timeline.playbackSpeed ) {\n                this.host.file.timeline.playbackSpeed = this.host.playbackSpeed;\n            }\n\n        }\n    }\n\n\n    hostUpdatedWatcher(): void {}\n\n    private _propagateContexts(\n        instance: ThermalFileInstance\n    ): void {\n        this.fileContextProvider.setValue(instance);\n        this.readyContextProvider.setValue(true);\n        this.fileDurationContextProvider.setValue({\n            ms: instance.timeline.duration,\n            time: instance.timeline.formatDuration(instance.timeline.duration)\n        });\n        this._propagateInstanceCurrentFrame(instance);\n        this._propagateInstanceAnalysesArray(instance);\n        this.fileMsContextProvider.setValue(instance.timeline.currentMs);\n        this.filePlaybackSpeedContextProvider.setValue(instance.timeline.playbackSpeed);\n        this.filePlayingContextProvider.setValue(instance.timeline.isPlaying);\n        this.fileMayStopContextProvider.setValue(instance.recording.mayStop);\n        this.fileRecordingContextProvider.setValue(instance.recording.value);\n    }\n\n    private _resetAllContexts(): void {\n        this.readyContextProvider.setValue(false);\n        this.fileDurationContextProvider.setValue(undefined);\n        this.fileCurrentFrameContextProvider.setValue(undefined);\n        this.fileAnalysesContextProvider.setValue([]);\n        this.fileContextProvider.setValue(undefined);\n        this.fileRecordingContextProvider.setValue(false);\n        this.filePlayingContextProvider.setValue(false);\n        this.fileMayStopContextProvider.setValue(true);\n        this.fileMsContextProvider.setValue(0);\n        this.fileCursorContextProvider.setValue(undefined);\n    }\n\n    private _attached?: ThermalFileInstance;\n\n    private _syncAssignment(): void {\n\n        const next = this.host.file;\n        \n        // Do nothing if file is the same\n        if ( next === this._attached ) return;\n\n        const previous = this._attached;\n\n        // If there is an attached instance, detach it first\n        if ( previous ) this._detach(previous);\n\n        // If there is a new instance, attach it\n        if ( next ) this._attach( next, previous !== undefined );\n\n        // If there is no new instance, reset all contexts\n        else { \n            this._resetAllContexts(); \n            this.host.ms = 0;\n        }\n\n    }\n\n    private _attach(\n        instance: ThermalFileInstance,\n        isReplacement: boolean\n    ): void {\n\n        this._attached = instance;\n\n        // Propagate the context\n        this.fileContextProvider.setValue(instance);\n\n        // Clear the failure\n        this.host.failure = undefined;\n        this.fileFailureContextProvider.setValue(undefined);\n\n        if ( this.host.playbackSpeed !== undefined ) {\n            instance.timeline.playbackSpeed = this.host.playbackSpeed;\n        }\n\n        this._propagateContexts(instance);\n        this._bindListeners(instance);\n\n        if ( !isReplacement && this.host.ms > 0 && instance.timeline.isSequence ) {\n            this.setMs(this.host.ms);\n        } else {\n            this.host.ms = instance.timeline.currentMs;\n        }\n\n        this.setLoading(false);\n        this.onSuccess.call(instance);\n\n\n    }\n\n\n    private _detach(\n        instance: ThermalFileInstance\n    ): void {\n\n        this._unbindListeners(instance);\n        this._unpropagateHighlight();\n\n        this._attached = undefined;\n\n        instance.unmountFromDom();\n\n    }\n\n\n\n    private _bindListeners(\n        instance: ThermalFileInstance,\n        coreWins: boolean = false\n    ): void {\n\n        // Add listeners for the instance's timeline events\n\n        instance.timeline.callbacksPlay.set(this.UUID, () => {\n            this.filePlayingContextProvider.setValue(true);\n        });\n\n        instance.timeline.callbacksPause.set(this.UUID, () => {\n            this.filePlayingContextProvider.setValue(false);\n        });\n\n        instance.timeline.callbacksStop?.set(this.UUID, () => {\n            this.filePlayingContextProvider.setValue(false);\n        });\n\n        instance.timeline.callbacksEnd?.set(this.UUID, () => {\n            this.filePlayingContextProvider.setValue(false);\n        });\n\n        // Frame changes\n        instance.timeline.callbacksChangeFrame.set(this.UUID, (frame) => {\n            const value = {\n                ms: frame.relative,\n                time: instance.timeline.currentTime,\n                percentage: instance.timeline.currentPercentage,\n                index: frame.index,\n                absolute: frame.absolute\n            };\n            this.fileCurrentFrameContextProvider.setValue(value);\n            this.host.ms = frame.relative;\n            this.fileMsContextProvider.setValue(frame.relative);\n        });\n\n        // Playback speed changes\n        instance.timeline.callbackdPlaybackSpeed.set(this.UUID, (speed) => {\n            this.host.playbackSpeed = speed;\n            this.filePlaybackSpeedContextProvider.setValue(speed);\n        });\n\n        // May stop changes\n        instance.recording.callbackMayStop.set(this.UUID, (value) => {\n            this.fileMayStopContextProvider.setValue(value);\n        });\n\n        // Recording\n        instance.recording.addListener(this.UUID, value => {\n            this.fileRecordingContextProvider.setValue(value);\n        });\n\n\n        // Analyses list listener\n        instance.analysis.addListener(this.UUID, value => {\n            this.fileAnalysesContextProvider.setValue(value);\n        });\n\n        \n\n        this._analysisSynchronisators.handleFileAssigned(instance, coreWins);\n\n    }\n\n\n    private _unbindListeners(instance: ThermalFileInstance): void {\n        instance.timeline.callbacksPlay.delete(this.UUID);\n        instance.timeline.callbacksPause.delete(this.UUID);\n        instance.timeline.callbacksStop.delete(this.UUID);\n        instance.timeline.callbacksEnd.delete(this.UUID);\n        instance.timeline.callbacksChangeFrame.delete(this.UUID);\n        instance.timeline.callbackdPlaybackSpeed.delete(this.UUID);\n        instance.recording.removeListener(this.UUID);\n        instance.recording.callbackMayStop?.delete(this.UUID);\n        instance.analysis.removeListener(this.UUID);\n\n        this._analysisSynchronisators.handleFileUnassigned();\n    }\n\n\n    /** \n     * This is crucial - once the instance is loaded or retrieved somewhere, all the magic happens. Existence of this method enables controller to change the instance at any time. \n     */\n    public receiveInstance(\n        instance: ThermalFileInstance\n    ): void {\n\n        // Store the instance in the host\n        this.host.file = instance;\n        this._syncAssignment();\n        this.setLoading(false);\n\n    }\n\n    public removeInstance(): void {\n\n        this.host.file = undefined;\n        this._syncAssignment();\n        this.setLoading(false);\n\n    }\n\n    public receiveFailure(failure: ThermalFileFailure): void {\n\n        this.removeInstance();\n        this.host.failure = failure;\n        this.fileFailureContextProvider.setValue( failure );\n        this.setLoading(false);\n        this.onFailure.call(failure);\n\n    }\n\n    private _propagateInstanceCurrentFrame(instance: ThermalFileInstance): void {\n\n        this.fileCurrentFrameContextProvider.setValue({\n            ms: instance.timeline.currentMs,\n            time: instance.timeline.currentTime,\n            percentage: instance.timeline.currentPercentage,\n            index: instance.timeline.currentStep.index,\n            absolute: instance.timeline.currentStep.absolute\n        });\n    }\n\n    private _propagateInstanceAnalysesArray(instance: ThermalFileInstance): void {\n        // Implement the propagation of other instance-related contexts here\n        this.fileAnalysesContextProvider.setValue(instance.analysis.layers.all);\n    }\n\n\n    // Setters of local states\n\n    public setTimeCursorPercentage(percentage: number | undefined): void {\n        if (percentage !== undefined && !Number.isFinite(percentage)) {\n            return;\n        }\n\n        const value = percentage === undefined\n            ? undefined\n            : Math.max(0, Math.min(percentage, 100));\n\n        if (value !== this.fileCursorContextProvider.value) {\n            this.fileCursorContextProvider.setValue(value);\n        }\n    }\n\n    public setTimePercentage(\n        percentage: number\n    ): void {\n        const file = this._attached;\n\n        if (!file?.timeline.isSequence) return;\n\n        const clampedPercentage = Math.max(\n            0,\n            Math.min(\n                percentage,\n                100\n            )\n        );\n\n        if ( clampedPercentage !== file.timeline.currentPercentage ) {\n            file.timeline.setValueByPercent(clampedPercentage);\n        }\n\n    }\n\n    public play(): void {\n        this._attached?.timeline.play();\n    }\n\n    public stop(): void {\n        this._attached?.timeline.stop();\n    }\n\n    public pause(): void {\n        this._attached?.timeline.pause();\n    }\n\n    public setMs(value: number): void {\n\n        const file = this._attached;\n\n        if (!file?.timeline.isSequence) return;\n\n        const clampedRelativeTime = Math.max(\n            0,\n            Math.min(\n                value,\n                file.timeline.duration\n            )\n        )\n\n        if ( clampedRelativeTime !== file.timeline.currentMs ) {\n            file.timeline.setRelativeTime(clampedRelativeTime);\n        }\n\n    }\n\n    /** Impose this file's highlight into the registry */\n    private _propagateHighlight() {\n        if (this.autoHighlight && this.fileObject) {\n            this.host.setAttribute(\"is-highlight\", \"true\");\n            this.host.registryController.setHighlight({\n                from: this.fileObject.min,\n                to: this.fileObject.max\n            })\n        }\n    }\n\n    /** Remove the highlight from the registry */\n    private _unpropagateHighlight() {\n        if (this.host.hasAttribute(\"is-highlight\")) {\n            this.host.removeAttribute(\"is-highlight\");\n            this.host.registryController.setHighlight(undefined);\n        }\n    }\n\n    public startLoading(): void {\n        this.host.failure = undefined;\n        this.fileFailureContextProvider.setValue(undefined);\n        this.setLoading(true);\n        this.onLoadingStart.call();\n        this.readyContextProvider.setValue(false);\n    }\n\n    /** Publishes loading independently of whether an old file is still available. */\n    private setLoading(loading: boolean): void {\n        if (this.host.loading !== loading) {\n            this.host.loading = loading;\n        }\n        this.loadingContextProvider.setValue(loading);\n    }\n\n    private endLoading(): void {\n        this.readyContextProvider.setValue(true);\n    }\n\n\n}\n\n\n","import type { ThermalGroup, ThermalRegistry } from \"@labirthermal/core\";\nimport { ThermalFileInstance, ThermalFileFailure } from \"@labirthermal/core\";\nimport type { PropertyValueMap } from \"lit\";\nimport type { AbstractThermalElement } from \"../hierarchy/AbstractThermalElement\";\nimport type { HostReactiveProperties } from \"./AbstractHierarchyController\";\nimport { AbstractHierarchyController } from \"./AbstractHierarchyController\";\nimport type { FileController } from \"./FileController\";\n\ntype IHostProperties = {\n\n    thermal: string | undefined,\n    visible: string | undefined\n\n}\n\n/** \n * An element that implements `FileLoadController` \n * @see {@link FileLoadController}\n */\nexport interface IElementWithFileLoadController extends AbstractThermalElement, IHostProperties {\n    fileController: FileController,\n    fileLoadController: FileLoadController\n}\n\n/** \n * When appended to an element with `FileController`, takes care of loading the file from the host attributes such as `thermal` and `visible`.\n * \n * The element using `FileLoadController` needs to implement `IElementWithFileLoadController`\n * \n * Public reactive properties of the host:\n * - `thermal`: The thermal file to be loaded.\n * - `visible`: The visibility setting for the thermal file.\n * \n * @see {@link FileLoadController.HOST_PROPERTIES}\n * \n * @module @labirthermal/webcomponents\n * @author Jan Jáchim <jachim@gmail.com>\n * */\nexport class FileLoadController extends AbstractHierarchyController<IElementWithFileLoadController> {\n\n    private _UUID: string;\n\n    public get UUID(): string {\n        return this._UUID;\n    }\n\n    private get group(): ThermalGroup {\n        return this.host.fileController.host.groupController.groupObject;\n    }\n\n    private get registry(): ThermalRegistry {\n        return this.group.registry;\n    }\n\n\n    public static readonly HOST_PROPERTIES: HostReactiveProperties<IHostProperties> = {\n        thermal: { type: String, reflect: true, attribute: \"thermal\" },\n        visible: { type: String, reflect: true, attribute: \"visible\" }\n    }\n\n    constructor(\n        host: IElementWithFileLoadController\n    ) {\n        super(host);\n        this._UUID = host.UUID;\n    }\n\n    hostWillUpdateWatcher(value: PropertyValueMap<IElementWithFileLoadController>): void {\n        if (value.has(\"thermal\") && this.host.thermal) {\n            this._load(this.host.thermal, this.host.visible);\n        }\n    }\n\n\n    hostUpdatedWatcher(): void {\n        // Do nothing for now\n    }\n    \n\n    hostConnected(): void {\n        // Do nothing for now\n    }\n\n\n    hostDisconnected(): void {\n        // Do nothing for now\n    }\n\n    private async _load(\n        lrc: string,\n        visible: string | undefined\n    ) {\n\n        // If there is a file already, remove it from the group\n        if (this.host.fileController.fileObject) {\n            this.group.files.removeFile(this.host.fileController.fileObject);\n        }\n\n        this.host.fileController.startLoading();\n\n        const result = this.registry.batch.request(\n            lrc,\n            visible,\n            this.group,\n            async (result) => {\n                if (result instanceof ThermalFileInstance) {\n                    this.host.fileController.receiveInstance(result);\n                } else if (result instanceof ThermalFileFailure) {\n                    this.host.fileController.receiveFailure(result);\n                }\n            }\n        );\n\n        return result;\n\n    }\n\n\n\n\n}","import type { ThermalGroup } from \"@labirthermal/core\";\nimport { CallbacksManager } from \"@labirthermal/core\";\nimport { ContextProvider, createContext } from \"@lit/context\";\nimport type { AbstractThermalElement } from \"../hierarchy/AbstractThermalElement\";\nimport type { HostReactiveProperties } from \"./AbstractHierarchyController\";\nimport { AbstractHierarchyController, INTERNAL_STATE_DECLARATION } from \"./AbstractHierarchyController\";\nimport type { ManagerController } from \"./ManagerController\";\nimport type { RegistryController } from \"./RegistryController\";\n\ntype IHostProperties = {\n\n    managerController: ManagerController;\n\n    registryController: RegistryController;\n\n    groupSlug: string;\n\n    groupObject: ThermalGroup;\n\n    groupController: GroupController;\n\n    autoclearGroup: boolean;\n\n}\n/**\n * Host properties required by the `GroupController`.\n * \n * @see {@link GroupController}\n * @see {@link GroupController.HOST_PROPERTIES}\n */\nexport interface IElementWithGroupController extends IHostProperties, AbstractThermalElement {}\n\n/**\n * Exposes the `GroupController` instance to the `AbstractGroupConsumer` elements.\n * @see {@link GroupController}\n * @module @labirthermal/webcomponents\n * @author Jan Jáchim <jachim@zcu.cz>\n */\nexport const groupControllerContext = createContext<GroupController>(\"group-controller-context\");\n\n/**\n * Exposes the internal `ThermalGroup` object from the `GroupController`.\n * \n * @see {@link GroupController}\n * @see {@link ThermalGroup}\n * @module @labirthermal/webcomponents\n * @author Jan Jáchim <jachim@zcu.cz>\n */\nexport const groupObjectContext = createContext<ThermalGroup>(\"group-object-context\");\n\nexport class GroupController extends AbstractHierarchyController<IElementWithGroupController> {\n    \n\n    private _UUID: string;\n\n    public get UUID(): string {\n        return this._UUID;\n    }\n\n    public static readonly HOST_PROPERTIES: HostReactiveProperties<IHostProperties> = {\n        managerController: INTERNAL_STATE_DECLARATION,\n        registryController: INTERNAL_STATE_DECLARATION,\n        groupSlug: { type: String, reflect: false, attribute: \"group-slug\" },\n        groupObject: INTERNAL_STATE_DECLARATION,\n        autoclearGroup: { type: Boolean, reflect: true, attribute: \"autoclear-group\"},\n        groupController: INTERNAL_STATE_DECLARATION\n    }\n\n    public get groupObject(): ThermalGroup {\n        return this.host.groupObject;\n    }\n\n    public get registryController(): RegistryController { return this.host.registryController; }\n\n    // Accessors to the host attributes\n    public get slug(): string { return this.host.groupSlug; }\n    public get autoclearGroup(): boolean { return this.host.autoclearGroup; }\n\n    // Context providers\n\n    private groupControllerContextProvider: ContextProvider<typeof groupControllerContext, IElementWithGroupController>;\n\n    private groupObjectContextProvider: ContextProvider<typeof groupObjectContext, IElementWithGroupController>;\n\n    public readonly onInternalObject = new CallbacksManager< (manager: ThermalGroup) => void >();\n\n\n    constructor(\n        host: IElementWithGroupController\n    ) {\n        super(host);\n        \n        this._UUID = host.UUID + \"_group-controller\";\n\n        this.groupControllerContextProvider = new ContextProvider(\n            this.host, \n            { context:  groupControllerContext, initialValue: this }\n        );\n\n        this.groupObjectContextProvider = new ContextProvider(\n            this.host,\n            { context: groupObjectContext }\n        );\n\n    }\n\n    hostConnected() {\n\n        const slug = this._getDefaultSlugFromHost( \"group-slug\" );\n        this.host.groupSlug = slug;\n\n        this.host.groupObject = this.host.registryController.addOrGetGroup(slug);\n        this.onInternalObject.call(this.host.groupObject);\n        \n        this.groupObjectContextProvider.setValue(this.host.groupObject);\n\n    }\n\n    hostDisconnected() {\n\n        if ( this.autoclearGroup && this.host.groupObject ) {\n            this.host.registryController.removeGroup(this.host.groupObject);\n        }\n\n    }\n\n    hostWillUpdateWatcher(): void {\n        // Do nothing\n    }\n\n    hostUpdatedWatcher(): void {\n        // Do nothing\n    }\n\n\n\n\n}\n","import type { ThermalGroup } from \"@labirthermal/core\";\nimport { ThermalFileFailure, ThermalFileReader } from \"@labirthermal/core\";\nimport type { PropertyValueMap } from \"lit\";\nimport type { AbstractThermalElement } from \"../hierarchy/AbstractThermalElement\";\nimport type { HostReactiveProperties } from \"./AbstractHierarchyController\";\nimport { AbstractHierarchyController } from \"./AbstractHierarchyController\";\nimport type { GroupController } from \"./GroupController\";\nimport type { GroupListingController } from \"./GroupListingController\";\n\ntype IHostProperties = {\n    /** \n     * The string of file requests for the `GroupLoadController`. Property name is `group-files`. Reactivity is defined by `GroupLoadController.HOST_PROPERTIES`. \n     * \n     * - Decoding of the attribute is handled internally by `GroupLoadController.decodeAttribute`.\n     * - Encoding of the the attribute can be done using `GroupLoadController.encodeAttribute`.\n     * \n     * How it works:\n     * - The `group-files` attribute takes the encoded list of file requests.\n     * - Whenever the `group-files` attribute changes, the `GroupLoadController` will load the files.\n     * - Internal changes to the files ARE NOT synced to the `group-files` attribute. Meaning: any internal state changes will not be reflected to the attribute. But the attribute change will always trigger the reload.\n     * \n     * Syntax:\n     * - Records (files) are separated by `;`.\n     * - Segments inside a record are separated by `|`.\n     * - Key and value of a segment are separated by `~`.\n     * - Keys: `thermal` (required), `visible` (optional), `label` (optional). Records without `thermal` are ignored.\n     * \n     * @example Single thermal file\n     * ```html\n     * <thermal-group-app group-files=\"thermal~./record.lrc\"></thermal-group-app>\n     * ```\n     * \n     * @example Two files, the first one with a visible image and a label, the second one with a label only\n     * ```html\n     * <thermal-group-app\n     *   group-files=\"thermal~./t1.lrc|visible~./v1.jpg|label~Pre-test;thermal~./t2.lrc|label~Post-test\">\n     * </thermal-group-app>\n     * ```\n     * \n     * @example Setting the property programmatically\n     * ```ts\n     * element.filesString = \"thermal~https://example.com/a.lrc|label~Motor;thermal~https://example.com/b.lrc\";\n     * ```\n     */\n    filesString?: string;\n};\n\n/** \n * An element with `GroupLoadController` needs to implement the host properties of a `GroupController`. To implement this controller properly, the class needs to have the following:\n * @example \n * ```ts\n * class MyClass extends AbstractThermalElement implements IElementWithGroupLoadController {\n * \n *     filesString?: string;\n * \n *     groupController: GroupController; // Created here or inherited from parent context\n *     groupListingController: GroupListingController; // Created here or inherited from parent context\n *     groupLoadController = new GroupLoadController(this);\n * \n * \n * }\n * ```\n */\nexport interface IElementWithGroupLoadController extends AbstractThermalElement, IHostProperties {\n    groupController: GroupController;\n    groupListingController: GroupListingController;\n    groupLoadController: GroupLoadController;\n}\n\n/** One file request - internal object for the purpose of `GroupLoadController` */\ntype GroupLoaderFileRequest = {\n    thermal: string,\n    visible?: string,\n    label?: string\n}\n\n\n/**\n * Reactive controller for loading thermal and visible files into a {@link ThermalGroup}\n * driven by the host element's `group-files` attribute.\n *\n * ### Functionality & Data Flow\n * - **Declarative & Reactive:** Watches the host property `filesString` (reflected from `group-files`).\n *   Whenever the attribute or property value changes, this controller parses the request string and loads\n *   all requested files through the registry's `FilesService`.\n * - **Unidirectional Synchronization:** Changes to the `group-files` attribute/property are propagated\n *   inward to the group's internal files collection. Subsequent runtime changes to the group (such as files\n *   added via drag-and-drop, deleted via UI, or reordered) are intentionally **NOT** reflected back to\n *   the attribute, preventing unwanted update loops.\n * - **Clearing on Empty:** If the attribute is removed or set to empty, all instances are removed from the group.\n * - **Backup & Listing Integration:** Automatically backs up file readers into the host's\n *   {@link GroupListingController} and restores them so that the group listing stays synchronized.\n *\n * ### Attribute Format (`group-files`)\n * The attribute encodes an array of file requests into a compact delimited string without requiring JSON:\n * - Records are delimited by `;` ({@link GroupLoadController.FILE_RECORD_SEPARATOR}).\n * - Key-value segments inside each record are delimited by `|` ({@link GroupLoadController.FILE_SEGMENT_SEPAROATOR}).\n * - Keys and values are separated by `~` ({@link GroupLoadController.FILE_COMPONENT_SEPAROATOR}).\n * - Recognized keys:\n *   - `thermal` (required): URL of the thermal file (`.lrc`).\n *   - `visible` (optional): URL of the corresponding visible spectrum image.\n *   - `label` (optional): Human-readable label assigned to the file instance.\n *\n * @example Format syntax\n * ```text\n * thermal~<url>[|visible~<url>][|label~<text>];thermal~<url>[|label~<text>]\n * ```\n *\n * @example Single file\n * ```html\n * <thermal-group-app group-files=\"thermal~./record.lrc|label~Engine\"></thermal-group-app>\n * ```\n *\n * @example Multiple files with visual pairs and labels\n * ```html\n * <thermal-group-app\n *   group-files=\"thermal~./t1.lrc|visible~./v1.jpg|label~Pre-test;thermal~./t2.lrc|label~Post-test\">\n * </thermal-group-app>\n * ```\n *\n * @example Programmatic encoding and decoding\n * ```ts\n * // Decode an attribute string to structured requests:\n * const requests = GroupLoadController.decodeAttribute(\"thermal~file.lrc|label~Motor\");\n *\n * // Encode structured requests back into an attribute string:\n * const attrValue = GroupLoadController.encodeFileRequests([\n *   { thermal: \"file1.lrc\", visible: \"file1.png\", label: \"Front\" },\n *   { thermal: \"file2.lrc\", label: \"Rear\" }\n * ]);\n * host.setAttribute(\"group-files\", attrValue!);\n * ```\n *\n * @see {@link IElementWithGroupLoadController} for host requirements.\n * @see {@link GroupListingController} for how the loaded files are displayed and ordered.\n */\nexport class GroupLoadController extends AbstractHierarchyController<IElementWithGroupLoadController> {\n    \n    private _UUID: string;\n\n    public get UUID(): string {\n        return this._UUID;\n    }\n\n    /** Necessary reactive properties of the host element needed by `GroupLoadController` */\n    public static readonly HOST_PROPERTIES: HostReactiveProperties<IHostProperties> = {\n        filesString: { type: String, reflect: true, attribute: \"group-files\" }\n    }\n\n    public static readonly FILE_RECORD_SEPARATOR = \";\";\n    public static readonly FILE_SEGMENT_SEPAROATOR = \"|\";\n    public static readonly FILE_COMPONENT_SEPAROATOR = \"~\";\n    public static readonly FILE_THERMAL_KEY = \"thermal\";\n    public static readonly FILE_VISIBLE_KEY = \"visible\";\n    public static readonly FILE_LABEL_KEY = \"label\";\n    public static readonly FILE_NOTE_KEY = \"note\";\n\n    private get group(): ThermalGroup {\n        return this.host.groupController.groupObject;\n    }\n\n    public errors: string[] = [];\n\n    /** Makes sure the value is either a non-empty string or undefined. */\n    private static stringOrUndefined(value?: string): string | undefined {\n        // if the value is a string, trim it\n        if (typeof value === \"string\") {\n            value = value.trim();\n        }\n        return value ?? undefined;\n    }\n\n    /** Encodes one attribute to a string segment. */\n    private static encodeAttribute(key: string, value?: string): string {\n        return `${key}${this.FILE_COMPONENT_SEPAROATOR}${value ?? \"\"}`;\n    }\n\n    /** Encodes a file request into a string suitable for the fileString attribute (publically known as `group-files`) */\n    private static encodeFileRequest(\n        thermalUrl: string,\n        visibleUrl?: string,\n        label?: string\n    ): string | undefined {\n\n        const thermal = this.stringOrUndefined(thermalUrl);\n        visibleUrl = this.stringOrUndefined(visibleUrl);\n        label = this.stringOrUndefined(label);\n\n        if (!thermal) {\n            return undefined;\n        }\n\n        if ( !visibleUrl || !label ) {\n            return this.encodeAttribute(this.FILE_THERMAL_KEY, thermalUrl);\n        }\n\n        let value = this.encodeAttribute(this.FILE_THERMAL_KEY, thermalUrl);\n\n        if (visibleUrl) {\n            value += this.FILE_SEGMENT_SEPAROATOR + this.encodeAttribute(this.FILE_VISIBLE_KEY, visibleUrl);\n        }\n        if (label) {\n            value += this.FILE_SEGMENT_SEPAROATOR + this.encodeAttribute(this.FILE_LABEL_KEY, label);\n        }\n\n        return value;\n\n    }\n\n    /** Encode multiple files into a string suitable for the public attribute `group-files` of a webcomponent with `GroupLoadController` */\n    public encodeFileRequests(\n        requests: GroupLoaderFileRequest[]\n    ): string | undefined {\n        if (!requests || requests.length === 0) {\n            return undefined;\n        }\n\n        return requests\n            .map(request => GroupLoadController.encodeFileRequest(request.thermal, request.visible, request.label))\n            .filter(encoded => encoded !== undefined)\n            .join(GroupLoadController.FILE_RECORD_SEPARATOR) || undefined;\n    }\n\n    /** Takes a string and convert it into an array of `GroupLoaderFileRequest` that can be used by `GroupLoadController._load( requests )` */\n    public static decodeAttribute(\n        value: string\n    ): GroupLoaderFileRequest[] {\n\n        return value\n            .split(GroupLoadController.FILE_RECORD_SEPARATOR)\n            .map( record => {\n\n                let thermal: string | undefined;\n                let visible: string | undefined;\n                let label: string | undefined;\n\n                record\n                    .trim()\n                    .split(GroupLoadController.FILE_SEGMENT_SEPAROATOR)\n                    .forEach(segment => {\n\n                        let [key, value] = segment.split(GroupLoadController.FILE_COMPONENT_SEPAROATOR);\n                        key = key.trim();\n                        value = value?.trim();\n\n                        switch(key) {\n                            case GroupLoadController.FILE_THERMAL_KEY:\n                                thermal = value;\n                                break;\n                            case GroupLoadController.FILE_VISIBLE_KEY:\n                                visible = value;\n                                break;\n                            case GroupLoadController.FILE_LABEL_KEY:\n                                label = value;\n                                break;\n                        }\n\n                    });\n\n                if ( !thermal ) {\n                    return undefined;\n                }\n\n                return { thermal, visible, label };\n\n            } )\n            .filter(item => item !== undefined) as GroupLoaderFileRequest[];\n\n    }\n\n    \n\n    constructor(\n        host: IElementWithGroupLoadController\n    ) {\n        super(host);\n\n        this._UUID = host.UUID + \"_group-load-controller\";\n\n    }\n\n\n    hostConnected(): void {\n        // this._loadFromAttributes();\n    }\n\n    hostDisconnected(): void {\n        // Do nothing for now\n    }\n\n    hostWillUpdateWatcher(value: PropertyValueMap<IElementWithGroupLoadController>): void {\n        if (value.has(\"filesString\")) {\n            this._loadFromAttributes();\n        }\n    }\n\n    hostUpdatedWatcher(): void {\n        // Do nothing for now\n    }\n\n    private _loadFromAttributes(): void {\n\n        const requests = this.host.filesString ? GroupLoadController.decodeAttribute(this.host.filesString) : [];\n        this._load( requests );\n        \n    }\n\n\n\n    \n    /** Loads the files  specified in the `requests` array. */\n    private async _load(\n        requests: GroupLoaderFileRequest[]\n    ) {\n\n        // If no files are requested, clear the group\n        if ( requests.length === 0 ) {\n            this.group.files.removeAllInstances();\n            return;\n        }\n\n        const registry = this.group.registry;\n        const service = registry.service;\n        this.errors = [];\n        registry.loading.markAsLoading();\n\n        try {\n            const results = await Promise.all(requests.map(async request => ({\n                result: await service.loadFile(request.thermal, request.visible),\n                label: request.label\n            })));\n\n            for (const item of results) {\n                if (item.result instanceof ThermalFileFailure) {\n                    this.errors.push(`${item.result.thermalUrl}: ${item.result.message}`);\n                }\n            }\n\n            const filteredResults = results.filter(\n                (item): item is { result: ThermalFileReader; label: string | undefined } =>\n                    item.result instanceof ThermalFileReader\n            );\n\n            this.host.groupListingController.backupReaders(filteredResults.map(item => item.result));\n            await this.host.groupListingController.restoreTheEntireBackup();\n\n            for (const file of this.group.files.value) {\n                const matchingResult = filteredResults.find(item => item.result === file.reader);\n                if (matchingResult?.label !== undefined) {\n                    file.setLabel(matchingResult.label);\n                }\n            }\n\n            await registry.postLoadedProcessing();\n            registry.range.applyMinmax();\n        } catch (error) {\n            this.errors.push(error instanceof Error ? error.message : String(error));\n        } finally {\n            registry.loading.markAsLoaded();\n            this.host.requestUpdate();\n        }\n\n    }\n\n\n}","import type { AbstractFileResult, ThermalFileInstance, ThermalGroup } from \"@labirthermal/core\";\nimport { ThermalFileReader, TimeFormat } from \"@labirthermal/core\";\nimport { css, html } from \"lit\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { createRef, ref } from \"lit/directives/ref.js\";\nimport { repeat } from \"lit/directives/repeat.js\";\nimport type { StyleInfo } from \"lit/directives/style-map.js\";\nimport { styleMap } from \"lit/directives/style-map.js\";\nimport type { AbstractThermalElement } from \"../hierarchy/AbstractThermalElement\";\nimport type { ThermalAppElement } from \"../ui/App\";\nimport type { HostReactiveProperties } from \"./AbstractHierarchyController\";\nimport { AbstractHierarchyController } from \"./AbstractHierarchyController\";\nimport type { FileController } from \"./FileController\";\nimport type { GroupController } from \"./GroupController\";\n\n/**\n * Indicates how to order the files in a group. Used by {@link GroupListingController}\n * @module @labirthermal/webcomponents\n * @author Jan Jáchim <jachim@zcu.cz>\n */\nexport enum GroupOrderby {\n    DATE = \"date\",\n    LABEL = \"label\",\n    MANUAL = \"manual\"\n}\n\n/**\n * Indicates how to order the files in a group. Used by {@link GroupListingController}\n * @module @labirthermal/webcomponents\n * @author Jan Jáchim <jachim@zcu.cz>\n */\nexport enum GroupOrdering {\n    ASC = \"asc\",\n    DESC = \"desc\"\n}\n\n/** @internal */\ninterface GroupListingRenderOptions {\n    allowFileChanges?: boolean;\n    onOpenDetail?: (instance: ThermalFileInstance) => void;\n    onCloseDetail?: () => void;\n}\n\ntype IHostProperties = {\n    orderby: GroupOrderby;\n    ordering: GroupOrdering;\n}\n\nexport interface IElementWithGroupListingController extends AbstractThermalElement, IHostProperties {\n    groupController: GroupController;\n    fileController: FileController;\n    groupListingController: GroupListingController;\n}\n\nexport class GroupListingController extends AbstractHierarchyController<IElementWithGroupListingController> {\n\n    private _UUID: string;\n\n    public get UUID(): string {\n        return this._UUID;\n    }\n\n    public static readonly HOST_PROPERTIES: HostReactiveProperties<IHostProperties> = {\n        orderby: {type: String, reflect: true, attribute: \"group-order-by\"},\n        ordering: {type: String, reflect: true, attribute: \"group-ordering\"}\n    };\n\n    private get group(): ThermalGroup {\n        return this.host.groupController.groupObject;\n    }\n\n    private backup: Set<ThermalFileReader> = new Set();\n\n    private readonly temperatureScaleRef = createRef<HTMLDivElement>();\n    private temperatureScaleWrapped = false;\n    private temperatureScaleSlot?: HTMLSlotElement;\n    private temperatureScaleObserver?: ResizeObserver;\n    private temperatureScaleFrame?: number;\n\n    public get hasBackup(): boolean {\n        return this.backup.size > 0;\n    }\n\n    public constructor(host: IElementWithGroupListingController) {\n        super(host);\n        this._UUID = host.UUID + \"_group-display-controller\";\n    }\n\n    public clearBackup(): void {\n        this.backup.clear();\n    }\n\n    public backupReadersFromInstances(\n        instances: ThermalFileInstance[]\n    ): void {\n        this.backup.clear();\n        instances.forEach(instance => this.backup.add(instance.reader));\n    }\n\n    public backupReaders(\n        readers: ThermalFileReader[]\n    ): void {\n        this.backup.clear();\n        readers.forEach(reader => this.backup.add(reader));\n\n        this.log( \"backup\", this.backup );\n    }\n\n\n\n    public async restoreTheEntireBackup(): Promise<void> {\n\n        // this.host.fileController.removeInstance();\n\n        return this.group.files.batchCreateInstances(Array.from(this.backup), true);\n\n    }\n\n    public async showOneAndBackup(\n        instance: ThermalFileInstance\n    ): Promise<void> {\n        const reader = instance.reader;\n        this.backup.clear();\n        this.backupReadersFromInstances(this.group.files.value);\n        this.host.fileController.host.registryController.setHighlight(undefined);\n        this.host.fileController.removeInstance();\n        this.group.files.removeAllInstances();\n        await reader.createInstance(this.group);\n    }\n\n    public static CLASS_TABLE: string = \"group-listing-table\";\n    public static CLASS_COLUMNS: string = \"group-listing-columns\";\n\n    public static readonly styles = css`\n        .group-listing {\n            display: grid;\n            width: 100%;\n            min-width: 0;\n            gap: 1em;\n            align-items: start;\n            grid-template-columns: repeat(var(--group-listing-columns, 3), minmax(0, 1fr));\n        }\n\n        .group-listing[data-layout=\"table\"] {\n            grid-template-columns: minmax(0, 1fr);\n            overflow-x: auto;\n        }\n\n        .group-listing .file-card {\n            display: grid;\n            min-width: 0;\n            box-sizing: border-box;\n            grid-template-columns: minmax(0, 1fr);\n            grid-template-areas: \"header\" \"canvas\" \"analysis\" \"timeline\";\n            background: var(--thermal-background);\n            border-radius: var(--thermal-radius) var(--thermal-radius) 0 0;\n        }\n\n        .group-listing[data-layout=\"grid\"] .file-media,\n        .group-listing[data-layout=\"grid\"] .file-details,\n        .group-listing[data-layout=\"grid\"] .file-details-content {\n            display: contents;\n        }\n\n        .file-card .file-header {\n            grid-area: header;\n            display: flex;\n            flex-wrap: wrap;\n            justify-content: flex-start;\n            align-items: center;\n            gap: .5em;\n            padding: .5em;\n            min-width: 0;\n            box-sizing: border-box;\n        }\n\n        .file-card .file-label {\n            cursor: pointer;\n            min-width: 0;\n            overflow-wrap: anywhere;\n        }\n\n        .file-card file-canvas {\n            grid-area: canvas;\n            min-width: 0;\n        }\n\n        .file-card file-timeline {\n            grid-area: timeline;\n            display: block;\n            min-width: 0;\n        }\n\n        .file-card .file-analysis {\n            grid-area: analysis;\n            min-width: 0;\n            box-sizing: border-box;\n        }\n\n        .group-listing[data-layout=\"table\"] .file-card {\n            grid-template-columns: var(--thermal-list-preview-width, 50%) minmax(0, 1fr);\n            grid-template-areas: \"media details\";\n            align-items: stretch;\n            background: transparent;\n        }\n\n        .group-listing[data-layout=\"table\"] .file-media {\n            grid-area: media;\n            min-width: 0;\n            padding: 0;\n        }\n\n        .group-listing[data-layout=\"table\"] .file-details {\n            grid-area: details;\n            position: relative;\n            min-width: 0;\n            min-height: 0;\n            background: var(--thermal-background);\n            border-radius: var(--thermal-radius) var(--thermal-radius) 0 0;\n        }\n\n        /* Only the media determines the row height; longer details scroll inside it. */\n        .group-listing[data-layout=\"table\"] .file-details-content {\n            position: absolute;\n            inset: 0;\n            display: flex;\n            flex-direction: column;\n            overflow: auto;\n        }\n\n        .group-listing[data-layout=\"table\"] .file-details-content > * {\n            flex: none;\n        }\n    `;\n\n    private _numColumns: number = 3;\n    private _asTable: boolean = false;\n    private _previewWidth: number = 50;\n\n    public setPreviewWidth(width: number): void {\n        if (!Number.isInteger(width) || width < 20 || width > 80) {\n            throw new RangeError(\"Preview width must be an integer from 20 to 80 percent.\");\n        }\n        this._previewWidth = width;\n        this.host.requestUpdate();\n    }\n\n    public setNumColumns(numColumns: number): void {\n        this._numColumns = numColumns;\n        this.host.requestUpdate();\n    }\n\n    public setAsTable(asTable: boolean): void {\n        this._asTable = asTable;\n        this.host.requestUpdate();\n    }\n\n    public renderListContainer(\n        children: unknown\n    ): unknown {\n\n        return html`\n            <div\n                class=\"group-listing\"\n                data-layout=${this._asTable ? \"table\" : \"grid\"}\n                style=${styleMap({\n                    \"--group-listing-columns\": String(this._numColumns),\n                    \"--thermal-list-preview-width\": `${this._previewWidth}%`\n                })}\n            >\n                ${children}\n            </div>\n        `;\n\n    }\n\n    private _renderButton(\n        icon: string,\n        iconStyle: string,\n        tooltip: string,\n        active: boolean,\n        onClick: () => void,\n        slot?: string\n    ): unknown {\n        return html`\n            <thermal-btn\n                icon=\"${icon}\"\n                iconStyle=\"${iconStyle}\"\n                tooltip=${ifDefined( active ? undefined : tooltip )}\n                variant=${active ? \"background\" : \"default\"}\n                @click=${onClick}\n                slot=${ifDefined(slot)}\n            >\n            </thermal-btn>\n        `;\n    }\n\n    public renderLayoutSwitch(\n        slot?: string\n    ): unknown {\n\n        return html`<thermal-btn-group>\n            ${this._renderButton(\n                \"list\",\n                \"micro\",\n                \"Switch to table view\",\n                this._asTable,\n                () => this.setAsTable(true),\n                slot\n            )}\n            ${this._renderButton(\n                \"grid\",\n                \"micro\",\n                \"Switch to grid view\",\n                !this._asTable,\n                () => this.setAsTable(false),\n                slot\n            )}\n        </thermal-btn-group>`;\n\n    }\n\n    public renderColumnsSlider(\n        slot?: string\n    ): unknown {\n\n        const min = this._asTable ? 20 : 1;\n        const max = this._asTable ? 80 : Math.min(3, this.group.files.value.length);\n        const value = this._asTable ? this._previewWidth : this._numColumns;\n        const label = this._asTable ? \"Šířka náhledu\" : \"Počet sloupců\";\n\n        const divStyles: StyleInfo = {\n            display: \"flex\",\n            flexDirection: \"column\",\n            fontSize: \"small\"\n        };\n\n        return html`<div slot=${ifDefined(slot)} style=${styleMap(divStyles)}>\n        <input type=\"range\" aria-label=${label} min=${min} max=${max} step=\"1\" .value=${String(value)} @input=${(e: Event) => {\n                const target = e.target as HTMLInputElement;\n                const next = parseInt(target.value, 10);\n                if (this._asTable) {\n                    this.setPreviewWidth(next);\n                } else {\n                    this.setNumColumns(next);\n                }\n            }}>\n        <div style=${styleMap({ textAlign: \"center\", fontSize: \".7em\",opacity: \".7\", marginTop: \"-0.2rem\" })}>${label}: ${value}${this._asTable ? \" %\" : \"\"}</div>\n        </div>`;\n\n    }\n\n\n\n\n    hostConnected(): void {\n        if (this.host.hasUpdated) {\n            this.host.requestUpdate();\n        }\n    }\n\n    hostDisconnected(): void {\n        this.disconnectTemperatureScale();\n    }\n\n    hostWillUpdateWatcher(): void {\n        // Do nothing\n    }\n\n    hostUpdatedWatcher(): void {\n        void this.observeTemperatureScale();\n    }\n\n    public renderTemperatureScale(): unknown {\n        return html`<div\n            ${ref(this.temperatureScaleRef)}\n            slot=${this.temperatureScaleWrapped ? \"pre-bar-wrap\" : \"pre-bar\"}\n            style=${styleMap({\n                flex: \"1 1 0\",\n                minWidth: \"0\",\n                boxSizing: \"border-box\",\n                width: this.temperatureScaleWrapped ? \"100%\" : undefined,\n                paddingLeft: this.temperatureScaleWrapped ? \"0\" : \"1em\"\n            })}\n        >\n            <registry-histogram height=\"15px\" ?expandable=${true}></registry-histogram>\n            <registry-range-slider height=\"10px\"></registry-range-slider>\n            <registry-ticks-bar></registry-ticks-bar>\n        </div>`;\n    }\n\n    private async observeTemperatureScale(): Promise<void> {\n        const scale = this.temperatureScaleRef.value;\n        const app = this.host.shadowRoot?.querySelector<ThermalAppElement>(\"thermal-app\");\n        if (!scale || !app || scale.parentElement !== app) {\n            this.disconnectTemperatureScale();\n            return;\n        }\n\n        await app.updateComplete;\n        if (!this.host.isConnected || this.temperatureScaleRef.value !== scale) {\n            return;\n        }\n\n        const slot = app.shadowRoot?.querySelector<HTMLSlotElement>('slot[name=\"pre-bar\"]');\n        if (!slot?.parentElement) {\n            return;\n        }\n        if (this.temperatureScaleSlot !== slot) {\n            this.disconnectTemperatureScale();\n            this.temperatureScaleSlot = slot;\n            this.temperatureScaleObserver = new ResizeObserver(this.scheduleTemperatureScaleLayout);\n            slot.addEventListener(\"slotchange\", this.observeTemperatureScaleItems);\n            this.observeTemperatureScaleItems();\n        } else {\n            this.scheduleTemperatureScaleLayout();\n        }\n    }\n\n    private readonly observeTemperatureScaleItems = (): void => {\n        const slot = this.temperatureScaleSlot;\n        const row = slot?.parentElement;\n        if (!slot || !row || !this.temperatureScaleObserver) {\n            return;\n        }\n        this.temperatureScaleObserver.disconnect();\n        this.temperatureScaleObserver.observe(row);\n        for (const item of slot.assignedElements({ flatten: true })) {\n            if (item !== this.temperatureScaleRef.value) {\n                this.temperatureScaleObserver.observe(item);\n            }\n        }\n        this.scheduleTemperatureScaleLayout();\n    };\n\n    private readonly scheduleTemperatureScaleLayout = (): void => {\n        if (!this.host.isConnected || this.temperatureScaleFrame !== undefined) {\n            return;\n        }\n        this.temperatureScaleFrame = requestAnimationFrame(() => {\n            this.temperatureScaleFrame = undefined;\n            this.updateTemperatureScaleLayout();\n        });\n    };\n\n    private updateTemperatureScaleLayout(): void {\n        const scale = this.temperatureScaleRef.value;\n        const slot = this.temperatureScaleSlot;\n        const row = slot?.parentElement;\n        if (!this.host.isConnected || !scale || !slot || !row) {\n            return;\n        }\n\n        const rowStyle = getComputedStyle(row);\n        const pixels = (value: string): number => parseFloat(value) || 0;\n        let available = row.getBoundingClientRect().width\n            - pixels(rowStyle.borderLeftWidth) - pixels(rowStyle.borderRightWidth)\n            - pixels(rowStyle.paddingLeft) - pixels(rowStyle.paddingRight);\n        const gap = pixels(rowStyle.columnGap);\n        for (const item of slot.assignedElements({ flatten: true })) {\n            if (item === scale) {\n                continue;\n            }\n            const style = getComputedStyle(item);\n            if (style.display !== \"none\") {\n                available -= item.getBoundingClientRect().width\n                    + pixels(style.marginLeft) + pixels(style.marginRight) + gap;\n            }\n        }\n        // Measure the prospective inline content width, even while the scale occupies its own row.\n        available -= pixels(getComputedStyle(scale).fontSize);\n        const wrapped = available < 200;\n        if (wrapped !== this.temperatureScaleWrapped) {\n            this.temperatureScaleWrapped = wrapped;\n            this.host.requestUpdate();\n        }\n    }\n\n    private disconnectTemperatureScale(): void {\n        this.temperatureScaleObserver?.disconnect();\n        this.temperatureScaleObserver = undefined;\n        this.temperatureScaleSlot?.removeEventListener(\"slotchange\", this.observeTemperatureScaleItems);\n        this.temperatureScaleSlot = undefined;\n        if (this.temperatureScaleFrame !== undefined) {\n            cancelAnimationFrame(this.temperatureScaleFrame);\n            this.temperatureScaleFrame = undefined;\n        }\n    }\n\n    private _orderFiles(): ThermalFileInstance[] {\n        const files = Array.from(this.group.files.value);\n\n        switch (this.host.orderby) {\n            case GroupOrderby.LABEL:\n                if (this.host.ordering === GroupOrdering.ASC) {\n                    files.sort((a, b) => (a.label ?? \"\").localeCompare(b.label ?? \"\"));\n                } else {\n                    files.sort((a, b) => (b.label ?? \"\").localeCompare(a.label ?? \"\"));\n                }\n                break;\n            case GroupOrderby.DATE:\n                if (this.host.ordering === GroupOrdering.ASC) {\n                    files.sort((a, b) => a.timestamp - b.timestamp);\n                } else {\n                    files.sort((a, b) => b.timestamp - a.timestamp);\n                }\n                break;\n        }\n\n        return files;\n\n    }\n\n    public renderList(\n        fileRendererFn: (file: ThermalFileInstance) => unknown,\n        emptyRendererFn?: () => unknown,\n    ): unknown {\n\n        if (this.group.files.value.length === 0) {\n            return emptyRendererFn?.();\n        }\n\n        return repeat(this._orderFiles(), file => file.id, fileRendererFn);\n\n    }\n\n    private async handleFileDropAdd(\n        results: AbstractFileResult[]\n    ) {\n\n        const fileReaders: ThermalFileReader[] = [];\n\n        for ( const result of results ) {\n            if ( result instanceof ThermalFileReader) {\n                fileReaders.push(result);\n                this.backup.add(result);\n            }\n        }\n\n        await this.group.files.batchCreateInstances(fileReaders, false);\n        \n\n    }\n\n    public renderListHeader(\n        slot?: string,\n        options: GroupListingRenderOptions = {}\n    ): unknown {\n\n        const divStyles: StyleInfo = {\n            display: \"flex\",\n            flexDirection: \"row\",\n            justifyContent: \"flex-start\",\n            alignItems: \"center\",\n            boxSizing: \"border-box\",\n            gap: \"0.5em\"\n        };\n\n        return html`<div slot=\"${ifDefined( slot )}\" style=${styleMap(divStyles)}>\n\n            <thermal-btn \n                variant=\"default\" \n                style=\"cursor: default; font-size: .9em;\"\n                icon=\"folder\"\n                iconStyle=\"micro\"\n                variant=\"background\" \n            >${options.allowFileChanges === false\n                ? `Počet souborů: ${this.group.files.value.length}`\n                : `${this.group.files.value.length} nahraných souborů`}</thermal-btn>\n\n            ${options.allowFileChanges === false ? undefined : html`<thermal-btn\n                tooltip=\"Smazat všechny soubory a nahrát nové\"\n                icon=\"trash\"\n                iconStyle=\"micro\"\n                variant=\"background\"\n                @click=${() => {\n                    this.host.fileController.host.registryController.setHighlight(undefined);\n                    this.clearBackup();\n                    this.group.files.removeAllInstances();\n                }}\n            ></thermal-btn>\n            <group-dropin-input \n                slot=\"bar-pre\"\n                variant=\"background\"\n                icon=\"upload\"\n                iconStyle=\"micro\"\n                tooltip=\"Nahrát další soubory\"\n                .onDrop=${async (results: AbstractFileResult[]) => {\n                    await this.handleFileDropAdd(results);\n                }}\n            ></group-dropin-input>`}\n            <group-download-dropdown \n                variant=\"background\"\n                icon=\"download\"\n                iconStyle=\"micro\"\n            >\n                <span slot=\"invoker\">Stáhnout skupinu</span>\n            </group-download-dropdown>\n            <div style=\"flex-grow: 1;\"></div>\n            ${this.renderLayoutSwitch()}\n            ${this.renderColumnsSlider()}\n        </div>`;\n\n    }\n\n    public renderThumbnail(\n        instance: ThermalFileInstance,\n        options: GroupListingRenderOptions = {}\n    ) {\n\n        const showDetail = () => {\n            if (options.onOpenDetail) {\n                options.onOpenDetail(instance);\n            } else {\n                this.showOneAndBackup(instance);\n            }\n        }\n\n        return html`<file-provider\n            class=\"file-card\"\n            .file=${instance}\n            @mouseenter=${() => {\n                this.host.groupController.registryController.setHighlight({\n                    from: instance.min,\n                    to: instance.max\n                })\n            }}\n            @mouseleave=${() => {\n                this.host.groupController.registryController.setHighlight(undefined);\n            }}\n        >\n            <div class=\"file-media\">\n                <file-canvas></file-canvas>\n                <file-timeline></file-timeline>\n            </div>\n            <div class=\"file-details\">\n                <div class=\"file-details-content\">\n                    <header class=\"file-header\">\n                        <div class=\"file-label\" @click=${showDetail}>\n                            <div>${TimeFormat.human(instance.timestamp)}</div>\n                            <div style=\"font-size: small; opacity: .5;\">${instance.fileName}</div>\n                        </div>\n\n                        <div style=\"flex-grow: 1;\"></div>\n                        ${options.allowFileChanges === false ? undefined : html`<thermal-btn\n                            tooltip=\"Smazat soubor\"\n                            icon=\"trash\"\n                            iconStyle=\"micro\"\n                            @click=${async () => {\n\n                                this.backup.delete(instance.reader);\n\n                                this.group.files.removeAllInstances();\n\n                                await this.restoreTheEntireBackup();\n\n                                this.host.requestUpdate();\n\n                            }}\n                        ></thermal-btn>`}\n                        <file-download-dropdown>\n                            <thermal-icon\n                                icon=\"download\"\n                                variant=\"micro\"\n                                slot=\"invoker\"\n                                style=\"width: 1.1em;\"\n                            ></thermal-icon>\n                        </file-download-dropdown>\n                        <thermal-btn\n                            icon=\"range\"\n                            iconStyle=\"outline\"\n                            @click=${() => {\n                                this.host.groupController.registryController.registryObject.range.imposeRange({\n                                    from: instance.min,\n                                    to: instance.max\n                                });\n                            }}\n                        ></thermal-btn>\n                        <thermal-btn\n                            tooltip=\"Zobrazit detail\"\n                            icon=\"eye\"\n                            iconStyle=\"solid\"\n                            @click=${showDetail}\n                        ></thermal-btn>\n                    </header>\n                    <div class=\"file-analysis\">\n                        <file-analysis-table\n                            table-mode=\"compact\"\n                            ?force-interactive=${true}\n                        ></file-analysis-table>\n                        <file-analysis-graph ?standalone=${true}></file-analysis-graph>\n                    </div>\n                </div>\n            </div>\n        </file-provider>`;\n\n    }\n\n    public renderDetailHeader(\n        instance: ThermalFileInstance,\n        slot?: string,\n        options: GroupListingRenderOptions = {}\n    ): unknown {\n\n        const divStyles: StyleInfo = {\n            display: \"flex\",\n            flexDirection: \"row\",\n            justifyContent: \"flex-start\",\n            alignItems: \"center\",\n            boxSizing: \"border-box\",\n            // background: \"var(--thermal-background)\",\n            // borderRadius: \"var(--thermal-radius)\",\n            // padding: \"0.5em\",\n            gap: \"0.5em\"\n        };\n\n        const isSingular = !options.onCloseDetail && this.backup.size <= 1;\n        const fileCount = options.onCloseDetail ? this.group.files.value.length : this.backup.size;\n\n        const backLabel = isSingular ? \"Zavřít\" : \"Zpět\";\n        const backTooltip = options.allowFileChanges === false\n            ? \"Zpět na seznam souborů\"\n            : isSingular ? \"Zavřít soubor a nahrát nový/é\" : `Zpět na Vašich ${ fileCount } souborů`;\n        const backIcon = isSingular ? \"close\" : \"back\";\n        const backIconStyle = isSingular ? \"micro\" : \"micro\";\n\n        return html`<div style=${styleMap(divStyles)} slot=${ifDefined(slot)}>\n\n            <thermal-btn \n                variant=\"background\" \n                tooltip=\"Název souboru\" \n                style=\"cursor: default; font-size: .9em;\"\n                icon=\"image\"\n                iconStyle=\"micro\"\n            >${instance.fileName}</thermal-btn>\n\n            <thermal-btn \n                variant=\"background\" \n                tooltip=\"Čas pořízení snímku\" \n                style=\"cursor: default; font-size: .9em;\"\n                icon=\"clock\"\n                iconStyle=\"outline\"\n            >${TimeFormat.human( instance.timestamp )}</thermal-btn>\n\n            <thermal-btn\n                icon=${backIcon}\n                iconStyle=${backIconStyle}\n                tooltip=\"${backTooltip}\"\n                variant=\"foreground\"\n                @click=${() => {\n                    if (options.onCloseDetail) {\n                        options.onCloseDetail();\n                    } else if ( this.backup.size <= 1 ) {\n                        this.group.files.removeAllInstances();\n                        this.host.fileController.removeInstance();\n                        this.host.requestUpdate();\n                    } else {\n                        this.restoreTheEntireBackup();\n                    }\n                }}\n            >${backLabel}</thermal-btn>\n            <file-info-button>\n                <thermal-btn \n                    slot=\"invoker\" \n                    icon=\"info\" \n                    iconStyle=\"solid\"\n                    variant=\"background\"\n                >Informace o souboru</thermal-btn>\n            </file-info-button>\n\n            <file-download-dropdown\n                icon=\"download\"\n                iconStyle=\"micro\"\n                variant=\"background\"\n            ></file-download-dropdown>\n\n        </div>`;\n    }\n\n    /** Assumes the contexts to be provided by the host element */\n    public renderDetailBody(): unknown {\n\n        const containerStyles: StyleInfo = {\n            display: \"grid\",\n            gridTemplateColumns: \"1fr 1fr\",\n            gap: \"1em\",\n            width: \"100%\"\n        };\n\n\n        return html`<div style=${styleMap(containerStyles)}>\n            <div>\n                <file-canvas></file-canvas>\n                <file-timeline></file-timeline>\n            </div>\n            <file-analysis-complex\n                table-mode=\"full\"\n                ?interactive-analysis=${true}\n                ?graph-activation-enabled=${true}\n            ></file-analysis-complex>\n        </div>`;\n    }\n\n\n\n\n}","import type { ThermalFileInstance, ThermalGroup } from \"@labirthermal/core\";\nimport { ContextProvider, createContext } from \"@lit/context\";\nimport type { PropertyDeclaration, PropertyValueMap } from \"lit\";\nimport type { AbstractThermalElement } from \"../hierarchy/AbstractThermalElement\";\nimport { stringOrUndefinedConverter } from \"../utils/converters/stringOrUndefinedConverter\";\nimport type { HostReactiveProperties } from \"./AbstractHierarchyController\";\nimport { AbstractHierarchyController } from \"./AbstractHierarchyController\";\nimport type { GroupController } from \"./GroupController\";\n\nconst SLOT_NUMBERS = [1, 2, 3, 4, 5, 6, 7] as const;\ntype SlotNumber = typeof SLOT_NUMBERS[number];\ntype AnalysisProperty = `analysis${SlotNumber}`;\n\ntype IHostProperties = {\n    groupAnalysisSyncOn: boolean;\n} & Record<AnalysisProperty, string | undefined>;\n\nexport interface IElementWithGroupAnalysisSyncController extends AbstractThermalElement, IHostProperties {\n    groupController: GroupController;\n}\n\nexport const groupAnalysisSyncContext = createContext<boolean>(\"group-analysis-sync-context\");\n\n/**\n * Binds analysis1-analysis7 to group slots while groupAnalysisSyncOn is true.\n * Initial nonempty host values win; otherwise existing file slots are adopted.\n * Later empty values delete slots. Analyses without slots are left untouched.\n */\nexport class GroupAnalysisSyncController extends AbstractHierarchyController<IElementWithGroupAnalysisSyncController> {\n\n    public get UUID(): string {\n        return this.host.UUID + \"_group-analysis-sync-controller\";\n    }\n\n    private static readonly ANALYSIS_PROPERTY_DECLARATION: PropertyDeclaration = {\n        type: String,\n        reflect: true,\n        converter: stringOrUndefinedConverter\n    };\n\n    public static readonly HOST_PROPERTIES: HostReactiveProperties<IHostProperties> = {\n        groupAnalysisSyncOn: { type: Boolean, reflect: true, attribute: \"group-analysis-sync-on\" },\n        analysis1: GroupAnalysisSyncController.ANALYSIS_PROPERTY_DECLARATION,\n        analysis2: GroupAnalysisSyncController.ANALYSIS_PROPERTY_DECLARATION,\n        analysis3: GroupAnalysisSyncController.ANALYSIS_PROPERTY_DECLARATION,\n        analysis4: GroupAnalysisSyncController.ANALYSIS_PROPERTY_DECLARATION,\n        analysis5: GroupAnalysisSyncController.ANALYSIS_PROPERTY_DECLARATION,\n        analysis6: GroupAnalysisSyncController.ANALYSIS_PROPERTY_DECLARATION,\n        analysis7: GroupAnalysisSyncController.ANALYSIS_PROPERTY_DECLARATION,\n    };\n\n    private readonly _onContextProvider: ContextProvider<typeof groupAnalysisSyncContext, IElementWithGroupAnalysisSyncController>;\n    private _group?: ThermalGroup;\n    private readonly _files = new Set<ThermalFileInstance>();\n    private readonly _values = new Map<SlotNumber, string | undefined>();\n    private readonly _fileValues = new Map<ThermalFileInstance, Map<SlotNumber, string | undefined>>();\n    private _applying = false;\n    private _changingCore = false;\n    private _initialized = false;\n\n    public get on(): boolean {\n        return this._onContextProvider.value;\n    }\n\n    constructor(host: IElementWithGroupAnalysisSyncController) {\n        super(host);\n        this._onContextProvider = new ContextProvider(this.host, {\n            context: groupAnalysisSyncContext,\n            initialValue: false\n        });\n    }\n\n    private _property(slot: SlotNumber): AnalysisProperty {\n        return `analysis${slot}`;\n    }\n\n    private _hostValue(slot: SlotNumber): string | undefined {\n        return this.host[this._property(slot)]?.trim() || undefined;\n    }\n\n    private _setOn(value: boolean): void {\n        this.host.groupAnalysisSyncOn = value;\n        this._onContextProvider.setValue(value);\n    }\n\n    hostConnected(): void {\n        this._group = this.host.groupController.groupObject;\n        const group = this._group;\n        group.analysisSync.addListener(this.UUID, value => {\n            if (this._changingCore) return;\n            this._setOn(value);\n            if (!value) {\n                this._initialized = false;\n                return;\n            }\n            // The core publishes \"on\" before assigning currentPointer.\n            queueMicrotask(() => {\n                if (this._group === group && this.on && group.analysisSync.value) {\n                    this._initialize();\n                }\n            });\n        });\n        group.files.addListener(this.UUID, () => this._syncFiles());\n        group.registry.onProcessingEnd.set(this.UUID, () => this.onLoaded());\n        this._setOn(this.host.groupAnalysisSyncOn || group.analysisSync.value);\n        this._syncFiles();\n        if (this.on) this._initialize();\n    }\n\n    hostDisconnected(): void {\n        this._group?.analysisSync.removeListener(this.UUID);\n        this._group?.files.removeListener(this.UUID);\n        this._group?.registry.onProcessingEnd.delete(this.UUID);\n        for (const file of this._files) this._unbindFile(file);\n        this._files.clear();\n        this._fileValues.clear();\n        this._group = undefined;\n        this._initialized = false;\n    }\n\n    hostWillUpdateWatcher(changed: PropertyValueMap<IElementWithGroupAnalysisSyncController>): void {\n        if (!this._group) return;\n        if (changed.has(\"groupAnalysisSyncOn\")) {\n            if (!this.host.groupAnalysisSyncOn) {\n                this.turnOff();\n                return;\n            }\n            if (!this.on || !this._initialized) this._initialize();\n        }\n    }\n\n    hostUpdatedWatcher(changed: PropertyValueMap<IElementWithGroupAnalysisSyncController>): void {\n        if (!this._group) return;\n        if (!this.on) return;\n        const slots = SLOT_NUMBERS.filter(slot =>\n            changed.has(this._property(slot)) && this._hostValue(slot) !== this._values.get(slot)\n        );\n        if (slots.length) this._applyHostValues(slots);\n    }\n\n    private _syncFiles(): void {\n        const group = this._group;\n        if (!group) return;\n        for (const file of this._files) {\n            if (!group.files.value.includes(file)) {\n                this._unbindFile(file);\n                this._files.delete(file);\n            }\n        }\n        for (const file of group.files.value) {\n            if (this._files.has(file)) continue;\n            this._files.add(file);\n            const values = new Map<SlotNumber, string | undefined>();\n            this._fileValues.set(file, values);\n            for (const slot of SLOT_NUMBERS) {\n                file.slots.getOnSerializeManager(slot)?.set(this.UUID, value => {\n                    const unchanged = values.has(slot) && values.get(slot) === value;\n                    values.set(slot, value);\n                    if (unchanged) return;\n                    if (!this.on || this._applying || file !== group.analysisSync.currentPointer) return;\n                    this._values.set(slot, value);\n                    this.host[this._property(slot)] = value;\n                });\n            }\n            file.onMount.set(this.UUID, () => this.onLoaded());\n        }\n        if (this.on) this.onLoaded();\n    }\n\n    private _unbindFile(file: ThermalFileInstance): void {\n        for (const slot of SLOT_NUMBERS) {\n            file.slots.getOnSerializeManager(slot)?.delete(this.UUID);\n        }\n        file.onMount.delete(this.UUID);\n        this._fileValues.delete(file);\n    }\n\n    private _getFirstInstanceWithAnalyses(): ThermalFileInstance | undefined {\n        return this._group?.files.value.find(file =>\n            SLOT_NUMBERS.some(slot => file.slots.hasSlot(slot))\n        );\n    }\n\n    private _initialize(): void {\n        const group = this._group;\n        if (!group) return;\n        this._setOn(true);\n        if (!this._initialized) {\n            const hasAttributes = SLOT_NUMBERS.some(slot => this._hostValue(slot) !== undefined);\n            const pointer = group.analysisSync.currentPointer;\n            const source = pointer && group.files.value.includes(pointer)\n                ? pointer\n                : this._getFirstInstanceWithAnalyses() ?? group.files.value[0];\n            if (!hasAttributes && source) this._analysesFromInstanceToGroup(source);\n            // Keep waiting if the group is empty and no host snapshot exists yet.\n            this._initialized = hasAttributes || source !== undefined;\n        }\n        this._enableCore();\n        if (this._initialized) this._applyHostValues(SLOT_NUMBERS);\n    }\n\n    private _enableCore(): void {\n        const group = this._group;\n        if (!group) return;\n        const pointer = group.analysisSync.currentPointer;\n        const source = pointer && group.files.value.includes(pointer)\n            ? pointer\n            : group.files.value.find(file => file.dom?.built) ?? group.files.value[0];\n        if (!source) {\n            group.analysisSync.setCurrentPointer(undefined);\n            return;\n        }\n        this._changingCore = true;\n        try {\n            if (!group.analysisSync.value) group.analysisSync.turnOn(source);\n            else if (source !== pointer) group.analysisSync.setCurrentPointer(source);\n        } finally {\n            this._changingCore = false;\n        }\n    }\n\n    private _applyHostValues(slots: readonly SlotNumber[]): void {\n        const group = this._group;\n        if (!group) return;\n        for (const slot of slots) this._values.set(slot, this._hostValue(slot));\n        this._applying = true;\n        const pointer = group.analysisSync.currentPointer;\n        // Apply once per mounted file, without core fan-out to unmounted files.\n        group.analysisSync.setCurrentPointer(undefined);\n        try {\n            for (const file of this._files) {\n                if (!file.dom?.built) continue;\n                for (const slot of slots) {\n                    this._applySlot(file, slot, this._values.get(slot));\n                    // Ignore delayed serialization echoes, including per-file coordinate clamping.\n                    this._fileValues.get(file)?.set(slot, file.slots.getSlot(slot)?.analysis.toSerialized());\n                }\n            }\n        } finally {\n            if (pointer && group.files.value.includes(pointer)) group.analysisSync.setCurrentPointer(pointer);\n            this._applying = false;\n        }\n    }\n\n    private _applySlot(file: ThermalFileInstance, slotNumber: SlotNumber, value: string | undefined): void {\n        const slot = file.slots.getSlot(slotNumber);\n        if (value === undefined) {\n            if (slot) file.slots.removeSlotAndAnalysis(slotNumber);\n            return;\n        }\n        const sameType = slot?.analysis.toSerialized().split(\";\")[1]?.trim() === value.split(\";\")[1]?.trim();\n        if (slot && sameType) {\n            if (!slot.analysis.serializedIsValid(value)) {\n                this.log(\"Invalid group analysis slot value\", slotNumber, file.id);\n                return;\n            }\n            if (slot.analysis.toSerialized() !== value) slot.recieveSerialized(value);\n            const root = file.dom?.canvasLayer?.getLayerRoot();\n            if (root && !root.contains(slot.analysis.layerRoot)) root.appendChild(slot.analysis.layerRoot);\n        } else if (!file.slots.createAnalysisFromSerialized(value, slotNumber)) {\n            this.log(\"Unable to create group analysis slot\", slotNumber, file.id);\n        }\n    }\n\n    public onLoaded(): void {\n        if (!this.on || this._applying) return;\n        if (!this._initialized) this._initialize();\n        else {\n            this._enableCore();\n            this._applyHostValues(SLOT_NUMBERS);\n        }\n    }\n\n    public _analysesFromInstanceToGroup(instance: ThermalFileInstance): void {\n        for (const slot of SLOT_NUMBERS) {\n            const value = instance.slots.getSlot(slot)?.analysis.toSerialized();\n            this._values.set(slot, value);\n            this.host[this._property(slot)] = value;\n        }\n    }\n\n    public turnOnOnFirstInstanceWithAnalyses(): void {\n        const instance = this._getFirstInstanceWithAnalyses();\n        if (instance) this.turnOn(instance);\n    }\n\n    public turnOnWithAttributeAnalyses(): void {\n        this._setOn(true);\n        this._initialized = true;\n        this._enableCore();\n        this._applyHostValues(SLOT_NUMBERS);\n    }\n\n    public turnOn(instance: ThermalFileInstance): void {\n        if (!this._group?.files.value.includes(instance)) {\n            this.log(\"Cannot synchronize analyses from a file outside the group\", instance.id);\n            return;\n        }\n        this._analysesFromInstanceToGroup(instance);\n        this._setOn(true);\n        this._initialized = true;\n        this._changingCore = true;\n        try {\n            this._group.analysisSync.turnOn(instance);\n        } finally {\n            this._changingCore = false;\n        }\n        this._applyHostValues(SLOT_NUMBERS);\n    }\n\n    public turnOff(): void {\n        this._setOn(false);\n        this._initialized = false;\n        this._changingCore = true;\n        try {\n            if (this._group?.analysisSync.value) this._group.analysisSync.turnOff();\n        } finally {\n            this._changingCore = false;\n        }\n    }\n}\n","import type { ThermalGroup, ThermalRangeOrUndefined, ThermalRegistry } from \"@labirthermal/core\";\nimport { CallbacksManager } from \"@labirthermal/core\";\nimport { ContextProvider, createContext } from \"@lit/context\";\nimport type { PropertyValues } from \"lit\";\nimport type { AbstractThermalElement } from \"../hierarchy/AbstractThermalElement\";\nimport type { HostReactiveProperties } from \"./AbstractHierarchyController\";\nimport { AbstractHierarchyController, INTERNAL_STATE_DECLARATION } from \"./AbstractHierarchyController\";\nimport type { ManagerController } from \"./ManagerController\";\nimport { optionalNumberConverter } from \"../utils/converters/optionalNumberConverter\";\n\ntype IHostProperties = {\n\n    /** \n     * This object is obligatory and it comes either from:\n     * - directly from the host's `ManagerController` instance - in case this `RegistryController` is on the same element as the `ManagerController`\n     * - from the `managerControllerContext` - for elements that are nested lower in the hierarchy, under an element with `ManagerController`\n     */\n    managerController: ManagerController;\n\n    registrySlug: string;\n\n    registryObject: ThermalRegistry;\n\n    registryController: RegistryController;\n\n    /** Aspect of IR / visible images. */\n    opacity: number;\n\n    /** Current minimum temperature in Celsius. This value is set internally by `@labirthermal/core`. */\n    min?: number;\n\n    /** Current maximum temperature in Celsius. This value is set internally by `@labirthermal/core`. */\n    max?: number;\n\n    /** Current range lower endpoint in the current unit.  */\n    from?: number;\n\n    /** Current range upper endpoint in the current unit. */\n    to?: number;\n\n    /** Current highlighted range in Celsius */\n    highlight?: ThermalRangeOrUndefined;\n\n    /** Whether the registry is currently loading. Controlled internally by `@labirthermal/core`. */\n    loading: boolean;\n\n}\n\nexport interface IElementWithRegistryController extends AbstractThermalElement, IHostProperties { }\n\n/** Exposes the current `RegistryController`. This is very important. */\nexport const registryControllerContext = createContext<RegistryController>(\"registry-controller-context\");\n\n/** Exposes the current `ThermalRegistry` object from the `RegistryController`. */\nexport const registryObjectContext = createContext<ThermalRegistry>(\"registry-object-context\");\n\n/** Exposes the current opacity value context from the `RegistryController`. */\nexport const registryOpacityContext = createContext<number>(\"registry-opacity\");\n\n/** Exposes the current range from value in Celsius from the `RegistryController`. */\nexport const registryRangeFromContext = createContext<undefined | number>(\"registry-range-from\");\n\n/** Exposes the current range to value in Celsius from the `RegistryController`. */\nexport const registryRangeToContext = createContext<undefined | number>(\"registry-range-to\");\n\n/** Exposes the current registry loading value from the `RegistryController`. */\nexport const registryLoadingContext = createContext<boolean>(\"registry-loading\");\n\n/** Exposes the current registry minimum in Celsius from the `RegistryController`. */\nexport const registryMinContext = createContext<number | undefined>(\"registry-min\");\n\n/** Exposes the current registry maximum in Celsius from the `RegistryController`. */\nexport const registryMaxContext = createContext<number | undefined>(\"registry-max\");\n\n/**\n * Highlight is an optional range of temperatures highlighted graphically on the thermal scale. It is used to indicate for example:\n * - what is the range of a file within min/max of the entire group\n * - what is the range of an analysis within the min/max of a file\n * - what is the min/max of a group of files within multiple groups of files\n *\n * This context is exposed by a registry provider. It need to be consumed manually.\n */\n\nexport const registryHighlightContext = createContext<ThermalRangeOrUndefined>(\"registry-highlight\");\n\n\nexport class RegistryController extends AbstractHierarchyController<IElementWithRegistryController> {\n\n    private _UUID: string;\n    private _syncedFrom: number | undefined;\n    private _syncedTo: number | undefined;\n    private _hasSyncedRange = false;\n\n    public get UUID(): string {\n        return this._UUID;\n    }\n\n    public static readonly HOST_PROPERTIES: HostReactiveProperties<IHostProperties> = {\n        managerController: INTERNAL_STATE_DECLARATION,\n        registrySlug: { type: String, reflect: false, attribute: \"registry-slug\" },\n        registryObject: INTERNAL_STATE_DECLARATION,\n        registryController: INTERNAL_STATE_DECLARATION,\n        opacity: { type: Number, reflect: true, attribute: \"opacity\" },\n        min: { type: Number, reflect: false, state: true },\n        max: { type: Number, reflect: false, state: true },\n        from: { type: Number, reflect: true, attribute: \"from\", converter: optionalNumberConverter },\n        to: { type: Number, reflect: true, attribute: \"to\", converter: optionalNumberConverter },\n        loading: { type: Boolean, attribute: \"is-loading\", reflect: true },\n        highlight: { type: Object, reflect: false, state: true },\n    }\n\n    public get registryObject(): ThermalRegistry {\n        return this.host.registryObject;\n    }\n\n    /** Callbacks called upon the internal registry object creation */\n    public readonly onInternalObject = new CallbacksManager< (manager: ThermalRegistry) => void >();\n\n\n    // Accessors to the host attributes\n\n    public get slug(): string { return this.host.registrySlug; }\n    public get opacity(): number { return this.host.opacity; }\n    public get min(): number | undefined { return this.host.min; }\n    public get max(): number | undefined { return this.host.max; }\n    public get from(): number | undefined { return this.host.from; }\n    public get to(): number | undefined { return this.host.to; }\n    public get loading(): boolean { return this.host.loading; }\n\n\n\n    // Context providers\n\n    private readonly registryControllerContextProvider: ContextProvider<typeof registryControllerContext, IElementWithRegistryController>;\n\n    private readonly registryObjectContextProvider: ContextProvider<typeof registryObjectContext, IElementWithRegistryController>;\n\n    private readonly opacityContextProvider: ContextProvider<typeof registryOpacityContext, IElementWithRegistryController>;\n\n    private readonly minContextProvider: ContextProvider<typeof registryMinContext, IElementWithRegistryController>;\n\n    private readonly maxContextProvider: ContextProvider<typeof registryMaxContext, IElementWithRegistryController>;\n\n    private readonly fromContextProvider: ContextProvider<typeof registryRangeFromContext, IElementWithRegistryController>;\n\n    private readonly toContextProvider: ContextProvider<typeof registryRangeToContext, IElementWithRegistryController>;\n\n    private readonly loadingContextProvider: ContextProvider<typeof registryLoadingContext, IElementWithRegistryController>;\n\n    private readonly highlightContextProvider: ContextProvider<typeof registryHighlightContext, IElementWithRegistryController>;\n\n\n\n    constructor(host: IElementWithRegistryController) {\n        super(host);\n\n        // host.addController(this);\n\n        this._UUID = host.UUID + \"_registry-controller\";\n\n        // Create the manager context provider for this registry controller\n        this.registryControllerContextProvider = new ContextProvider(\n            this.host,\n            {\n                context: registryControllerContext,\n                initialValue: this\n            }\n        );\n\n\n        // Create the registry core object\n        this.registryObjectContextProvider = new ContextProvider(\n            this.host,\n            { context: registryObjectContext }\n        );\n\n\n        // Create the opacity context provider\n        this.opacityContextProvider = new ContextProvider(\n            this.host,\n            { context: registryOpacityContext }\n        );\n\n        // Create the min context provider\n        this.minContextProvider = new ContextProvider(\n            this.host,\n            { context: registryMinContext }\n        );\n\n        // Create the max context provider\n        this.maxContextProvider = new ContextProvider(\n            this.host,\n            { context: registryMaxContext }\n        );\n\n        // Create the range from context provider\n        this.fromContextProvider = new ContextProvider(\n            this.host,\n            { context: registryRangeFromContext }\n        );\n\n        // Create the range to context provider\n        this.toContextProvider = new ContextProvider(\n            this.host,\n            { context: registryRangeToContext }\n        );\n\n        // Create the loading context provider\n        this.loadingContextProvider = new ContextProvider(\n            this.host,\n            { context: registryLoadingContext }\n        );\n\n        // Create the highlight context provider\n        this.highlightContextProvider = new ContextProvider(\n            this.host,\n            { context: registryHighlightContext }\n        );\n\n\n    }\n\n\n\n    hostConnected(): void {\n\n        const slug = this._getDefaultSlugFromHost(\"registry-slug\");\n        this.host.registrySlug = slug;\n\n        // Create the registry object for this element and store it in the host's registryObject property\n        this.host.registryObject = this.host.managerController.createRegistry(slug);\n        this.registryObjectContextProvider.setValue(this.host.registryObject);\n\n        this.onInternalObject.call(this.host.registryObject);\n\n\n        // Opacity\n\n        // Set the opacity default value\n        this.setOpacity(this.host.opacity ?? 1);\n\n        // Add the opacity listener\n        this.registryObject.opacity.addListener(this.UUID, this.setOpacity.bind(this));\n\n\n        // Minmax\n\n        // Add the minmax listener\n        this.registryObject.minmax.addListener(\n            this.UUID,\n            value => {\n\n                if (value === undefined) {\n                    this.host.min = undefined;\n                    this.host.max = undefined;\n                    this.minContextProvider.setValue(undefined);\n                    this.maxContextProvider.setValue(undefined);\n                } else {\n                    if (value.min !== this.host.min) { this.host.min = value.min; }\n                    if (value.max !== this.host.max) { this.host.max = value.max; }\n                    if (value.min !== this.minContextProvider.value) { this.minContextProvider.setValue(value.min); }\n                    if (value.max !== this.maxContextProvider.value) { this.maxContextProvider.setValue(value.max); }\n                }\n\n            }\n        );\n\n\n\n        // Range\n\n        // Add the range listener\n        this.registryObject.range.addListener(\n            this.UUID,\n            this._rangeListener.bind(this)\n        );\n\n        // Keep the public range attributes in sync when the manager unit changes.\n        this.host.managerController.managerObject.unit.addListener(\n            this.UUID,\n            this._unitListener.bind(this)\n        );\n\n\n        // Loading\n        this.registryObject.loading.addListener(this.UUID, this._loadingListener.bind(this));\n\n\n    }\n\n    hostDisconnected(): void {\n\n        this.registryObject.opacity.removeListener(this.UUID);\n        this.registryObject.minmax.removeListener(this.UUID);\n        this.registryObject.range.removeListener(this.UUID);\n        this.host.managerController.managerObject.unit.removeListener(this.UUID);\n        this.registryObject.loading.removeListener(this.UUID);\n\n    }\n\n    hostWillUpdateWatcher(\n        value: PropertyValues<IElementWithRegistryController>\n    ): void {\n\n        if (value.has(\"opacity\")) {\n            this.setOpacity(this.host.opacity ?? 1);\n        }\n\n        if ((value.has(\"from\") || value.has(\"to\")) && !this._isRangeSynced()) {\n\n            if (\n                this.host.from === undefined\n                || this.host.to === undefined\n            ) {\n                this._clearRange();\n            } else {\n                this.setRange(\n                    this.host.managerController.fromCurrentUnit(this.host.from),\n                    this.host.managerController.fromCurrentUnit(this.host.to)\n                );\n            }\n\n        }\n        \n    }\n\n    hostUpdatedWatcher(): void {\n        // Do nothing\n    }\n\n    public addOrGetGroup(\n        slug: string\n    ): ThermalGroup {\n        return this.registryObject.groups.addOrGetGroup(slug);\n    }\n\n    public removeGroup(\n        group: ThermalGroup\n    ): void {\n        this.registryObject.groups.removeGroup(group.id);\n    }\n\n\n    /**\n     * This is the recommended way to set the opacity. Calling this method will \n     * - update the context provider element's attribute `opacity`\n     * - set the internal value to `@labirthermal/core`\n     * - update the context provider\n     */\n    setOpacity(\n        value: number\n    ): void {\n\n        const safeValue = isNaN(value) ? 1 : Math.max(0, Math.min(1, value));\n\n        // Set the element attribute if different from the current value\n        if (this.host.opacity !== safeValue) {\n            this.host.opacity = safeValue;\n        }\n\n        // Set the inner value if different from the currrent one\n        if (this.registryObject && this.registryObject.opacity.value !== safeValue) {\n            this.registryObject.opacity.imposeOpacity(safeValue);\n        }\n\n        // Set the value to the context if different from the current value\n        if (this.opacityContextProvider.value !== safeValue) {\n            this.opacityContextProvider.setValue(safeValue);\n        }\n\n    }\n\n    /** \n     * Set the range of the registry in Celsius. The range needs to be within the registry's minimum and maximum bounds which are controlled internally by `@labirthermal/core`.\n     * The internal value of all contexts is in Celsius with an exception of the public attribute which is in the current unit.\n     */\n    setRange(\n        fromCelsius: number,\n        toCelsius: number\n    ): void {\n\n        // Set the range to the registry object if it has changed\n        if (\n            this.registryObject.range.value === undefined\n            || this.registryObject.range.value.from !== fromCelsius\n            || this.registryObject.range.value.to !== toCelsius\n        ) {\n            this.registryObject.range.imposeRange({ from: fromCelsius, to: toCelsius });\n        }\n\n        // Publish current-unit values to the attributes and Celsius values to contexts.\n        this._publishRange(this.registryObject.range.value);\n\n    }\n\n    /** Sets the range to the full span of the registry's bounds, if both minimum and maximum are defined. Internal units are Celsius. */\n    setRangeFull() {\n        if (this.host.min !== undefined && this.host.max !== undefined) {\n            this.setRange(this.host.min, this.host.max);\n        }\n    }\n\n    private _rangeListener(\n        value: ThermalRangeOrUndefined\n    ) {\n        this._publishRange(value);\n    }\n\n    private _unitListener(): void {\n        // Preserve attributes that were explicitly changed but have not reached the core yet.\n        if (this._isRangeSynced()) {\n            this._publishRange(this.registryObject.range.value);\n        }\n    }\n\n    private _isRangeSynced(): boolean {\n        return this._hasSyncedRange\n            && this.host.from === this._syncedFrom\n            && this.host.to === this._syncedTo;\n    }\n\n    private _publishRange(value: ThermalRangeOrUndefined): void {\n        if (value === undefined) {\n            this._clearRange();\n            return;\n        }\n\n        const from = this.host.managerController.toCurrentUnit(value.from);\n        const to = this.host.managerController.toCurrentUnit(value.to);\n\n        this._syncedFrom = from;\n        this._syncedTo = to;\n        this._hasSyncedRange = true;\n\n        if (this.host.from !== from) {\n            this.host.from = from;\n        }\n        if (this.host.to !== to) {\n            this.host.to = to;\n        }\n\n        if (this.fromContextProvider.value !== value.from) {\n            this.fromContextProvider.setValue(value.from);\n        }\n        if (this.toContextProvider.value !== value.to) {\n            this.toContextProvider.setValue(value.to);\n        }\n    }\n\n    private _clearRange() {\n        this._syncedFrom = undefined;\n        this._syncedTo = undefined;\n        this._hasSyncedRange = true;\n\n        this.host.from = undefined;\n        this.host.to = undefined;\n\n        if (this.fromContextProvider.value !== undefined) {\n            this.fromContextProvider.setValue(undefined);\n        }\n        if (this.toContextProvider.value !== undefined) {\n            this.toContextProvider.setValue(undefined);\n        }\n    }\n\n    private _loadingListener(\n        value: boolean\n    ) {\n\n        if (value !== this.host.loading) {\n            this.host.loading = value;\n        }\n\n        if (value !== this.loadingContextProvider.value) {\n            this.loadingContextProvider.setValue(value);\n        }\n\n    }\n\n    /** Set the highlight range for the registry. Internal units are Celsius. */\n    public setHighlight(valueInCelsius: ThermalRangeOrUndefined): void {\n        if (this.highlightContextProvider.value !== valueInCelsius) {\n            this.highlightContextProvider.setValue(valueInCelsius);\n        }\n    }\n\n\n\n}\n","import type { ThermalGroup, ThermalManagerOptions, ThermalRegistry } from \"@labirthermal/core\";\nimport { ThermalManager } from \"@labirthermal/core\";\n\nexport const defaultManager = new ThermalManager;\n\nexport const defaultRegistryKey = \"__internal_default_registry\";\n\nexport const defaultGroupyKey = \"__internal_default_group\";\n\ndeclare global {\n    interface Window { Thermal: {\n        managers: Map<string,ThermalManager>\n    }; }\n}\n\nwindow.Thermal = {\n    managers: new Map\n};\n\n// window.Thermal.managers = new Map;\nwindow.Thermal.managers.set( \"default\", defaultManager );\n\n/** Create or get a manager instance from the global window object. */\nexport const createOrGetManager = (\n    slug?: string,\n    options?: ThermalManagerOptions\n) => {\n\n    if ( slug === undefined ) {\n        return window.Thermal.managers.get( \"default\" )!;\n    } else if ( window.Thermal.managers.has( slug ) ) {\n        return window.Thermal.managers.get( slug )!;\n    } else {\n        const manager = new ThermalManager( undefined, options );\n        window.Thermal.managers.set( slug, manager );\n        return manager;\n    }\n    \n}\n\n/** Remove the manager along with all its contents. */\nexport const removeManager = (\n    manager: ThermalManager\n) => {\n\n    let slug: string|undefined = undefined;\n\n    window.Thermal.managers.forEach( ( m, key ) => {\n        if ( m.id === manager.id ) {\n            slug = key;\n        }\n    } );\n\n    console.log( \"removing\", manager );\n\n    if ( slug !== undefined ) {\n\n        console.log( \"found and removing\", slug );\n\n        const foundManager = window.Thermal.managers.get( slug );\n\n        if ( foundManager ) {\n\n            // Remove all objects internally\n            foundManager.registries.forEveryRegistry( registry => foundManager.registries.removeRegistry( registry.id ) );\n\n            // Delete the object from global key\n            window.Thermal.managers.delete( slug );\n\n        }\n\n    }\n    \n}\n\n\nexport const getDefaultRegistry = (\n    manager: ThermalManager\n) => {\n    return manager.registries.addOrGetRegistry(defaultRegistryKey);\n}\n\nexport const getDefaultGroup = (\n    registry: ThermalRegistry\n): ThermalGroup => {\n    return registry.groups.addOrGetGroup(defaultGroupyKey);\n}","import type { AvailableThermalPalette, ThermalManager, ThermalPaletteType, ThermalRegistry, ThermalTool } from \"@labirthermal/core\";\nimport { CallbacksManager, ThermalPalettes, ThermalUnit } from \"@labirthermal/core\";\nimport { ContextProvider, createContext } from \"@lit/context\";\nimport type { PropertyValues } from \"lit\";\nimport type { AbstractThermalElement } from \"../hierarchy/AbstractThermalElement\";\nimport { createOrGetManager } from \"../hierarchy/providers/getters\";\nimport { paletteConverter } from \"../utils/converters/paletteConverter\";\nimport { parseThermalUnit, unitConverter } from \"../utils/converters/unitConverter\";\nimport type { HostReactiveProperties } from \"./AbstractHierarchyController\";\nimport { AbstractHierarchyController, INTERNAL_STATE_DECLARATION } from \"./AbstractHierarchyController\";\nimport type { ThermalUnitDefinition } from \"@labirthermal/core\";\n\ninterface IHostProperties {\n\n    /** Element property for the manager slug. It is absolutely required. Recommended property name: manager-slug */\n    managerSlug: string;\n\n    /** Core manager object. Exposed in managerContext. */\n    managerObject: ThermalManager;\n\n    /** Manager controoller exposed as context. Recommended property */\n    managerController: ManagerController;\n\n    /** Element property for thermal palette. Converted internally to a rich value and exposed in managerPaletteContext.Recommended property name: palette */\n    palette: AvailableThermalPalette;\n\n    /** Advances palettes property from the host element. Exposed as managerAdvancedPalettesContext. Recommended property: advanced-palettes */\n    advancedPalettes: boolean;\n\n    /** Smooth thermograms flag accessed directly from the host element. Recommended property name: smooth-thermograms */\n    smoothThermograms: boolean;\n\n    /** Smooth graph flag accessed directly from the host element. Recommended property name: smooth-graph */\n    smoothGraph: boolean;\n\n    /** Tool property accessed from the host element. Exposed in the toolContext. Recommended property name: tool */\n    tool: keyof ThermalManager[\"tool\"][\"tools\"];\n\n    /** \n     * Thermal unit used for displaying values and reading user inputs in the webcomponents. Exposed in managerUnitContext. Recommended property name: unit\n     * \n     * `undefined` means the host did not set it: a shared manager then keeps its current unit, a new one uses Celsius.\n     * All internal values (core, contexts) stay in Celsius regardless of this unit.\n     */\n    unit: ThermalUnit | undefined\n\n}\n\nexport interface IElementWithManagerController extends AbstractThermalElement, IHostProperties {}\n\nexport type ManagerPaletteContextType = {\n    key: AvailableThermalPalette;\n    data: ThermalPaletteType;\n};\n\n/** Exposes the main manager controller with all its setters and direct access to the host element values. */\nexport const managerControllerContext = createContext<ManagerController>(\"manager-controller-context\");\n\nexport const managerContext = createContext<ThermalManager>(\"manager-instance\");\nexport const managerPaletteContext = createContext<ManagerPaletteContextType>(\"manager-palette-context\");\nexport const managerAdvancedPalettesContext = createContext<boolean>(\"manager-advanced-palettes-context\");\nexport const managerSmoothContext = createContext<boolean>(\"manager-smooth-context\");\nexport const managerGraphFunctionContext = createContext<boolean>(\"manager-graph-function-context\");\nexport const managerToolContext = createContext<ThermalTool>(\"manager-tool-context\");\nexport const managerInteractiveAnalysesContext = createContext<boolean>(\"manager-interactive-analysis-context\");\nexport const managerUnitContext = createContext<ThermalUnit>( \"manager-unit-context\" );\n\nexport class ManagerController extends AbstractHierarchyController<IElementWithManagerController> {\n\n    private _UUID: string;\n\n    public get UUID(): string {\n        return this._UUID;\n    }\n\n    public static readonly HOST_PROPERTIES: HostReactiveProperties<IHostProperties> = {\n        managerSlug: { type: String, reflect: false, attribute: \"manager-slug\" },\n        managerObject: INTERNAL_STATE_DECLARATION,\n        managerController: INTERNAL_STATE_DECLARATION,\n        palette: { type: String, reflect: true, attribute: \"palette\", converter: paletteConverter },\n        advancedPalettes: { reflect: true, attribute: \"advanced-palettes\", type: Boolean },\n        smoothThermograms: { reflect: true, attribute: \"smooth-thermograms\", type: Boolean},\n        smoothGraph: { reflect: true, attribute: \"smooth-graph\", type: Boolean },\n        tool: { type: String, reflect: true, attribute: \"tool\"},\n        unit: { type: String, reflect: true, attribute: \"unit\", converter: unitConverter }\n    }\n\n\n\n    /** Accessor to the manageer slug from the host */\n    public get slug(): string { return this.host.managerSlug; }\n\n\n    private readonly managerControllerContextProvider: ContextProvider<typeof managerControllerContext, IElementWithManagerController>;\n\n\n    /** Accessor to the manager object from the host */\n    public get managerObject(): ThermalManager { return this.host.managerObject; }\n\n    private readonly managerObjectContextPtovider: ContextProvider<typeof managerContext, IElementWithManagerController>;\n\n\n    /** Palette property value accessed from the host element */\n    public get palette(): AvailableThermalPalette { return this.host.palette; }\n\n    private readonly paletteContextProvider: ContextProvider<typeof managerPaletteContext, IElementWithManagerController>;\n\n\n    public readonly advancedPalettesContextProvider: ContextProvider<typeof managerAdvancedPalettesContext, IElementWithManagerController>;\n\n\n    /** Smooth thermograms flag accessed from the host element */\n    public get smoothThermograms(): boolean { return this.host.smoothThermograms; }\n\n    private readonly smoothThermogramsContextProvider: ContextProvider<typeof managerSmoothContext, IElementWithManagerController>;\n\n\n    /** Tool property accessed from the host element */\n    public get tool(): keyof ThermalManager[\"tool\"][\"tools\"] { return this.host.tool; }\n\n    public get toolObject(): ThermalTool { return this.managerObject.tool.value; }\n\n    private readonly toolContextProvider: ContextProvider<typeof managerToolContext, IElementWithManagerController>;\n\n\n    /** Graph smoothing flag accessed from the host element */\n    public get smoothGraph(): boolean { return this.host.smoothGraph; }\n\n    private readonly smoothGraphContextProvider: ContextProvider<typeof managerGraphFunctionContext, IElementWithManagerController>;\n\n    private readonly unitContextProvider: ContextProvider< typeof managerUnitContext, IElementWithManagerController>;\n\n    /** Callbacks called upon the internal registry object creation */\n    public readonly onInternalObject = new CallbacksManager< (manager: ThermalManager) => void >();\n\n    constructor(host: IElementWithManagerController) {\n\n        super(host);\n\n        this._UUID = host.UUID + \"_manager-controller\";\n\n        // Create the manager controller context provider\n        this.managerControllerContextProvider = new ContextProvider(\n            this.host,\n            {\n                context: managerControllerContext,\n                initialValue: this\n            }\n        )\n\n        // Create the manager object context provider\n        this.managerObjectContextPtovider = new ContextProvider(\n            this.host,\n            { context: managerContext }\n        );\n\n        // Create the palette context provider\n        this.paletteContextProvider = new ContextProvider(\n            this.host,\n            { context: managerPaletteContext }\n        );\n\n        // Create the advanced palettes context provider\n        this.advancedPalettesContextProvider = new ContextProvider(\n            this.host,\n            { context: managerAdvancedPalettesContext }\n        );\n\n        // Create the smooth thermograms context provider\n        this.smoothThermogramsContextProvider = new ContextProvider(\n            this.host,\n            { context: managerSmoothContext }\n        );\n\n        // Create the tool context provider\n        this.toolContextProvider = new ContextProvider(\n            this.host,\n            { context: managerToolContext }\n        );\n\n        // Create the smooth graph context provider\n        this.smoothGraphContextProvider = new ContextProvider(\n            this.host,\n            { context: managerGraphFunctionContext }\n        );\n\n        this.unitContextProvider = new ContextProvider(\n            this.host,\n            { context: managerUnitContext }\n        )\n\n        \n\n    }\n\n\n    hostConnected(): void {\n\n        // Make sure the slug is set for the host element\n        const slug = this._getDefaultSlugFromHost(\"manager-slug\");\n        this.host.managerSlug = slug;\n\n        // Values requested by the host; `undefined` unit means \"not set by the host\"\n        const requestedUnit = parseThermalUnit(this.host.unit);\n        const requestedPalette = paletteConverter.fromAttribute(this.host.palette);\n\n        // A manager with the same slug may already exist (shared by more providers)\n        const managerExisted = window.Thermal.managers.has(slug);\n\n        // Create or get the manager object and set it in the context provider.\n        // A new manager is created directly with the host's values, so it never exists with defaults.\n        this.host.managerObject = createOrGetManager(slug, {\n            unit: requestedUnit ?? ThermalUnit.C,\n            palette: requestedPalette\n        });\n        this.managerObjectContextPtovider.setValue(this.host.managerObject);\n\n        this.onInternalObject.call(this.host.managerObject);\n\n\n        // Unit\n\n        // Pick the initial unit:\n        // - the unit requested by the host always wins\n        // - without it, a shared manager keeps its current unit (another provider may have set it)\n        // - otherwise Celsius is the default\n        const initialUnit = requestedUnit\n            ?? (managerExisted ? this.managerObject.unit.value : ThermalUnit.C);\n\n        // Impose the unit to the host, the context and the core manager\n        this.setUnit(initialUnit);\n\n        // Follow the unit changes made in the core manager (e.g. by another provider of the same manager)\n        this.managerObject.unit.addListener(this.UUID, this.setUnit.bind(this));\n\n\n\n\n        // Palette\n\n        // Set the initial palette value\n        this.setPalette(requestedPalette);\n\n        // Add the palette listeners\n        this.managerObject.palette.addListener(this.UUID, this.setPalette.bind(this));\n\n\n        // Advanced palette\n\n        // Set the initial advanced palettes value\n        this.setAdvancedPalettes(this.host.advancedPalettes);\n\n\n        // Smooth thermograms flag\n\n        // Set the initial smooth thermograms value\n        this.setSmoothThermograms(this.host.smoothThermograms);\n\n        // Add the smooth thermograms listener\n        this.managerObject.smooth.addListener(this.UUID, this.setSmoothThermograms.bind(this));\n\n\n        // Smooth graph flag\n\n        // Set the initial smooth graph value\n        this.setSmoothGraph(this.host.smoothGraph);\n\n        // Add the listener to the internal property\n        this.managerObject.graphSmooth.addListener(this.UUID, this.setSmoothGraph.bind(this));\n\n\n        // Tool\n\n        // Set the initial tool value\n        this._setToolByKey(this.host.tool);\n\n        // Add the tool listener\n        this.managerObject.tool.addListener(this.UUID, this.setTool.bind(this));\n\n\n\n    }\n\n\n    hostDisconnected(): void {\n\n        this.managerObject.palette.removeListener(this.UUID);\n        this.managerObject.smooth.removeListener(this.UUID);\n        this.managerObject.graphSmooth.removeListener(this.UUID);\n        this.managerObject.tool.removeListener(this.UUID);\n        this.managerObject.unit.removeListener(this.UUID);\n\n    }\n\n    hostUpdate(): void {\n\n    }\n\n    hostWillUpdateWatcher(\n        value: PropertyValues<IElementWithManagerController>\n    ): void {\n\n        if (!value) return;\n\n        // If the palette property changed in the element, update it internally\n        if (value.has(\"palette\")) {\n            this.setPalette(this.host.palette);\n        }\n\n        // If the advanced paletttes flag changed in the element, update it internally\n        if (value.has(\"advancedPalettes\")) {\n            this.setAdvancedPalettes(this.host.advancedPalettes);\n        }\n\n        // If the smooth thermograms flag changed in the element, update it internally\n        if (value.has(\"smoothThermograms\")) {\n            this.setSmoothThermograms(this.host.smoothThermograms);\n        }\n\n        /// If the smooth graph option changed in the element, update it internally\n        if (value.has(\"smoothGraph\")) {\n            this.setSmoothGraph(this.host.smoothGraph);\n        }\n\n        // If the tool property changed in the element, update it internally\n        if (value.has(\"tool\")) {\n            this._setToolByKey(this.host.tool);\n        }\n\n        if (value.has(\"unit\")) {\n            this.setUnit(this.host.unit);\n        }\n\n    }\n\n\n    hostUpdatedWatcher(): void {\n        // Do nothing\n    }\n\n\n    /** \n     * Create or get a registry by its slug from the internal manager object. \n     */\n    public createRegistry(\n        slug: string\n    ): ThermalRegistry {\n        return this.managerObject.registries.addOrGetRegistry(slug);\n    }\n\n\n    private _paletteStringToContextValue(\n        palette: AvailableThermalPalette\n    ): ManagerPaletteContextType {\n\n        return {\n            key: palette,\n            data: ThermalPalettes[palette]\n        }\n    }\n\n\n    /** \n     * This is the recommended way to set the advanced palettes flag - updates the value in the context provider and the host element. All updates are performed only when the new value differs from the current one. \n     */\n    public setAdvancedPalettes(\n        value: boolean\n    ): void {\n\n        if (this.host.advancedPalettes !== value) {\n            this.host.advancedPalettes = value;\n        }\n\n        if (this.advancedPalettesContextProvider.value !== value) {\n            this.advancedPalettesContextProvider.setValue(value);\n        }\n\n    }\n\n\n    /** \n     * This is the recommended way to set the palette - updates the value in the core manager object, the context provider, and the host element. All updates are performed only when the new value differs from the current one. \n     */\n    public setPalette(\n        value: AvailableThermalPalette\n    ): void {\n\n        const sanitizedValue = paletteConverter.fromAttribute(value);\n\n        // If the internal value differs, set it\n        if (this.managerObject.palette.value !== sanitizedValue) {\n            this.managerObject.palette.setPalette(sanitizedValue);\n        }\n\n        if ( !this.paletteContextProvider.value ) {\n            this.paletteContextProvider.setValue(\n                this._paletteStringToContextValue(sanitizedValue)\n            );\n        } else if ( this.paletteContextProvider.value.key !== sanitizedValue ) {\n            this.paletteContextProvider.setValue(\n                this._paletteStringToContextValue(sanitizedValue)\n            );\n        }\n\n        // If the host's parameter differs, set it\n        if (this.host.palette !== sanitizedValue) {\n            this.host.palette = sanitizedValue;\n        }\n\n    }\n\n\n    /** \n     * This is the recommended way to set the smooth thermograms flag - updates the value in the core manager object, the context provider, and the host element. All updates are performed only when the new value differs from the current one. \n     */\n    public setSmoothThermograms(\n        value: boolean\n    ): void {\n\n        // If the host value differs, do change it\n        if (this.host.smoothThermograms !== value) {\n            this.host.smoothThermograms = value;\n        }\n\n        // If the context value differs, set it in the context provider\n        if (this.smoothThermogramsContextProvider.value !== value) {\n            this.smoothThermogramsContextProvider.setValue(value);\n        }\n\n        // If the internal manager object's value differs, set it\n        if (this.managerObject.smooth.value !== value) {\n            this.managerObject.smooth.setSmooth(value);\n        }\n\n    }\n\n\n    /** \n     * This is the recommended way to set the tool - updates the value in the core manager object, the context provider, and the host element. All updates are performed only when the new value differs from the current one. \n     */\n    public setTool(\n        value: ThermalTool\n    ): void {\n\n        // Make sure the value belongs to this manager's available tools\n        value = this._toolStringToObject(value.key);\n\n        // If the host's property differs from the new tool, update it\n        if (value && value.key !== this.host.tool) {\n            this.host.tool = value.key;\n        }\n\n        // If the context value differs, set it in the context provider\n        if (this.toolContextProvider.value !== value) {\n            this.toolContextProvider.setValue(value);\n        }\n\n        // If the internal manager object's value differs, set it\n        if (this.managerObject.tool.value !== value) {\n            this.managerObject.tool.selectTool(value);\n        }\n\n    }\n\n\n    private _setToolByKey(\n        value?: string\n    ): void {\n        const toolObject = this._toolStringToObject(value);\n        this.setTool(toolObject);\n    }\n\n\n    private _toolStringToObject(\n        value: string = \"inspect\"\n    ): ThermalTool {\n\n        const selectedTool = this.managerObject.tool.tools[value];\n\n        // If the invalid tool was selected, return the current tool instead\n        if (!selectedTool) {\n            return this.managerObject.tool.tools[\"inspect\"];\n        }\n\n        return selectedTool;\n\n    }\n\n\n    /**\n     * This is the recommended way to set the smooth graph option - updates the value and the context provider. All updates are performed only when the new value differs from the current one.\n     */\n    public setSmoothGraph(\n        value: boolean\n    ): void {\n\n        // If the host value differs, do change it\n        if (this.host.smoothGraph !== value) {\n            this.host.smoothGraph = value;\n        }\n\n        // If the context value differs, set it in the context provider\n        if (this.smoothGraphContextProvider.value !== value) {\n            this.smoothGraphContextProvider.setValue(value);\n        }\n\n        if ( this.managerObject.graphSmooth.value !== value ) {\n            this.managerObject.graphSmooth.setGraphSmooth(value);\n        }\n\n    }\n\n    /** \n     * This is the recommended way to set the unit - updates the value in the core manager object, the context provider, and the host element. All updates are performed only when the new value differs from the current one.\n     * \n     * The value is normalized case-insensitively; a missing or invalid value falls back to Celsius.\n     * The unit affects only the display and the user inputs. All internal values stay in Celsius.\n     */\n    public setUnit(\n        value: ThermalUnit | string | undefined\n    ): void {\n\n        const unit = parseThermalUnit(value) ?? ThermalUnit.C;\n\n        // If the value differs, set it to the property\n        if (this.host.unit !== unit) {\n            this.host.unit = unit;\n        }\n\n        // If the context differs, set it in context provider\n        if (this.unitContextProvider.value !== unit) {\n            this.unitContextProvider.setValue(unit);\n        }\n\n        // Impose the value internally\n        if (this.managerObject.unit.value !== unit) {\n            this.managerObject.unit.set(unit);\n        }\n    }\n\n    /** Format a single value in current unit and output it along with its unit symbol. */\n    public formatSingle(\n        valueInCurrentUnit: number\n    ): string {\n        return this.managerObject.unit.formatSingle(valueInCurrentUnit);\n    }\n\n    /** Format a range of values in the current unit and output it along with its unit symbol. */\n    public formatRange(\n        fromInCurrentUnit: number,\n        toInCurrentUnit: number\n    ): string {\n        return this.managerObject.unit.formatRange(fromInCurrentUnit, toInCurrentUnit);\n    }\n\n    /** Convert a value in Celsius unit to the current unit and return the number. */\n    public toCurrentUnit(\n        valueInCelsius: number\n    ): number {\n        return this.managerObject.unit.celsiusToCurrent(valueInCelsius);\n    }\n\n    /** Convert a value in the current unit to Celsius. */\n    public fromCurrentUnit(\n        valueInCurrentUnit: number\n    ): number {\n        return this.managerObject.unit.currentToCelsius(valueInCurrentUnit);\n    }\n\n    public get currentUnit(): ThermalUnitDefinition {\n        return this.managerObject.unit.current;\n    }\n\n}\n\n\n\n","import { ContextProvider, createContext } from \"@lit/context\";\nimport type { AbstractThermalElement } from \"../hierarchy/AbstractThermalElement\";\nimport { AbstractReactiveController } from \"./AbstractReactiveController\";\n\nexport interface PngExportSettings {\n    readonly width: number;\n    readonly fontSize: number;\n    readonly analyses: boolean;\n    readonly thermalScale: boolean;\n    readonly license: boolean;\n    readonly fileName: boolean;\n    readonly fileDate: boolean;\n}\n\nexport interface GroupExportSettings {\n    readonly groupName: boolean;\n    readonly columns: number;\n}\n\nexport interface ConfigSettings {\n    readonly export: {\n        readonly png: PngExportSettings;\n        readonly group: GroupExportSettings;\n    };\n    readonly visibility: {\n        readonly showAllOptions: boolean;\n    };\n}\n\n/** Exposes the general configuration context for the application. Setters are here. */\nexport const configContext = createContext<ConfigController>(\"config-context\");\n\n\n/** Handles the global configuration related to the PNG exports */\nexport class ConfigController extends AbstractReactiveController<AbstractThermalElement> {\n    \n    private readonly _UUID: string;\n    \n    public get UUID(): string {\n        return this._UUID;\n    }\n\n    private _settings: ConfigSettings = {\n        export: {\n            png: {\n                width: 1200,\n                fontSize: 20,\n                analyses: true,\n                thermalScale: true,\n                license: true,\n                fileName: false,\n                fileDate: true\n            },\n            group: {\n                groupName: true,\n                columns: 2\n            }\n        },\n        visibility: {\n            showAllOptions: false\n        }\n    };\n\n    private readonly contextProvider: ContextProvider<typeof configContext, AbstractThermalElement>;\n\n    constructor(host: AbstractThermalElement) {\n        super(host);\n\n        this._UUID = this.host.UUID + \"__config-controller\";\n\n        this.contextProvider = new ContextProvider(host, {\n            context: configContext,\n            initialValue: this\n        });\n    }\n\n    hostConnected(): void {}\n\n    hostDisconnected(): void {}\n\n    public get settings(): ConfigSettings {\n        return this._settings;\n    }\n\n        // --- PNG Export Settery ---\n\n    public setPngWidth(value: number): void {\n        const width = Math.max(100, value); // volitelná ochrana proti neplatným hodnotám\n        this._setPngSetting(\"width\", width);\n    }\n\n    public setPngFontSize(value: number): void {\n        const fontSize = Math.max(6, value);\n        this._setPngSetting(\"fontSize\", fontSize);\n    }\n\n    public setPngAnalyses(value: boolean): void {\n        this._setPngSetting(\"analyses\", value);\n    }\n\n    public setPngThermalScale(value: boolean): void {\n        this._setPngSetting(\"thermalScale\", value);\n    }\n\n    public setPngFileName(value: boolean): void {\n        this._setPngSetting(\"fileName\", value);\n    }\n\n    public setPngFileDate(value: boolean): void {\n        this._setPngSetting(\"fileDate\", value);\n    }\n\n    public setPngLicense(value: boolean): void {\n        this._setPngSetting(\"license\", value);\n    }\n\n    // --- Group Export Settery ---\n\n    public setGroupColumns(value: number): void {\n        const columns = Math.max(1, value);\n        this._setGroupSetting(\"columns\", columns);\n    }\n\n    public setGroupGroupName(value: boolean): void {\n        this._setGroupSetting(\"groupName\", value);\n    }\n\n    // --- Visibility ---\n\n    public setShowAllOptions(value: boolean): void {\n        this._settings = {\n            ...this._settings,\n            visibility: {\n                ...this._settings.visibility,\n                showAllOptions: value\n            }\n        };\n        this._publish();\n    }\n\n    private _setPngSetting<K extends keyof PngExportSettings>(\n        key: K,\n        value: PngExportSettings[K]\n    ): void {\n        this._settings = {\n            ...this._settings,\n            export: {\n                ...this._settings.export,\n                png: {\n                    ...this._settings.export.png,\n                    [key]: value\n                }\n            }\n        };\n        this._publish();\n    };\n\n    private _setGroupSetting<K extends keyof GroupExportSettings>(\n        key: K,\n        value: GroupExportSettings[K]\n    ): void {\n        this._settings = {\n            ...this._settings,\n            export: {\n                ...this._settings.export,\n                group: {\n                    ...this._settings.export.group,\n                    [key]: value\n                }\n            }\n        };\n        this._publish();\n    };\n\n\n    private _publish(): void {\n        this.contextProvider.setValue(this, true);\n    }\n}\n\n\n\n","import { provide } from \"@lit/context\";\nimport type { PropertyValues } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { ConfigController } from \"../controllers/ConfigController\";\nimport { AbstractThermalElement } from \"../hierarchy/AbstractThermalElement\";\nimport type { IWithlocale, Locales } from \"../translations/localeContext\";\nimport { initLocalesInTopLevelElement, localeContext, localeConverter } from \"../translations/localeContext\";\n\nexport abstract class AbstractApp extends AbstractThermalElement implements IWithlocale {\n\n    protected readonly configController = new ConfigController(this);\n\n    @provide({ context: localeContext })\n    @property({ reflect: true, converter: localeConverter })\n    public locale!: Locales;\n\n    @property({type: String, reflect: true, attribute: \"label\"})\n    public label?: string;\n\n    @property({type: String, reflect: true, attribute: \"author\"})\n    public author?: string;\n\n    @property({type: String, reflect: true, attribute: \"license\"})\n    public license?: string;\n\n    @property({type: Boolean, reflect: true, attribute: \"show-fullscreen\"})\n    public showFullscreen: boolean = false;\n\n    firstUpdated(_changedProperties: PropertyValues): void {\n        super.firstUpdated(_changedProperties);\n        initLocalesInTopLevelElement(this);\n    }\n\n}\n","import i18next, { t } from \"i18next\";\nimport type { PropertyValues } from \"lit\";\nimport { css, html, nothing } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { cache } from \"lit/directives/cache.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { map } from \"lit/directives/map.js\";\nimport type { Ref } from \"lit/directives/ref.js\";\nimport { createRef, ref } from \"lit/directives/ref.js\";\nimport { AbstractThermalElement } from \"../hierarchy/AbstractThermalElement\";\nimport { languagesObject, T } from \"../translations/Languages\";\nimport type { BtnVariants } from \"./Btn\";\n\n// @customElement(\"thermal-app\")\nexport class ThermalAppElement extends AbstractThermalElement {\n\n    @state()\n    language: string = i18next.language;\n\n    @state()\n    private _overflowCount: number = 0;\n\n    @state()\n    private _overflowOpen: boolean = false;\n\n    @state()\n    private _hasPre: boolean = false;\n\n    @state()\n    private _hasContent: boolean = false;\n\n    @state()\n    private _hasPreBar: boolean = false;\n\n    @state()\n    private _hasBarHeader: boolean = false;\n\n    @property({ type: String, reflect: true })\n    fullscreen: string = \"off\";\n\n    @property({ type: Boolean, reflect: true, attribute: \"show-fullscreen\" })\n    showFullscreen: boolean = false;\n\n    @property()\n    author?: string;\n\n    @property()\n    recorded?: string;\n\n    @property()\n    license?: string;\n\n    @property()\n    label?: string;\n\n    @property()\n    labelIcon?: string;\n    \n    @property()\n    labelIconStyle?: string;\n\n    @property()\n    labelTooltip?: string;\n\n    @property()\n    labelVariant: BtnVariants = \"foreground\";\n\n    @property({type: Object})\n    onlabel?: () => void;\n\n\n\n    protected headerRef: Ref<HTMLDivElement> = createRef();\n\n    protected contentRef: Ref<HTMLDivElement> = createRef();\n\n    protected barItemsRef: Ref<HTMLDivElement> = createRef();\n\n    /** Owns host resize observation; not reactive and released when disconnected. */\n    protected observer?: ResizeObserver;\n\n    /** Owns toolbar resize observation; recreated after the component reconnects. */\n    private _overflowObserver: ResizeObserver | null = null;\n\n    /** Pending overflow measurement, coalesced and cancelled when disconnected. */\n    private _rafId: number | null = null;\n\n    /** Final slot assignments from our last measurement, used to ignore self-induced slotchange events. */\n    private readonly _barSlotAssignments = new Map<string, Element[]>();\n\n    /** Stable callback so language changes do not accumulate subscriptions on reconnect. */\n    private readonly _handleLanguageChange = (language: string): void => {\n        this.language = language;\n    };\n\n    private _handleFullscreenChange = (): void => {\n        this.fullscreen = document.fullscreenElement === this ? \"on\" : \"off\";\n    };\n\n    connectedCallback(): void {\n        super.connectedCallback();\n\n        document.addEventListener(\"fullscreenchange\", this._handleFullscreenChange);\n        if (i18next.language !== undefined) {\n            this.language = i18next.language;\n        }\n        i18next.on(\"languageChanged\", this._handleLanguageChange);\n        this.requestUpdate();\n\n    }\n\n    disconnectedCallback(): void {\n        document.removeEventListener(\"fullscreenchange\", this._handleFullscreenChange);\n        i18next.off(\"languageChanged\", this._handleLanguageChange);\n        this.observer?.disconnect();\n        this.observer = undefined;\n        if (this._overflowObserver) {\n            this._overflowObserver.disconnect();\n            this._overflowObserver = null;\n        }\n        if (this._rafId !== null) {\n            cancelAnimationFrame(this._rafId);\n            this._rafId = null;\n        }\n        this._barSlotAssignments.clear();\n        super.disconnectedCallback();\n    }\n\n    private _toggleOverflow(): void {\n        this._overflowOpen = !this._overflowOpen;\n    }\n\n    private _setSlotFlag(name: string, has: boolean): void {\n        switch (name) {\n            case \"pre\":\n                this._hasPre = has;\n                break;\n            case \"content\":\n                this._hasContent = has;\n                break;\n            case \"pre-bar\":\n                this._hasPreBar = has;\n                break;\n            case \"bar-header\":\n                this._hasBarHeader = has;\n                break;\n        }\n    }\n\n    private _onSlotChange = (event: Event): void => {\n        const slot = event.target as HTMLSlotElement;\n        this._setSlotFlag(slot.name, slot.assignedElements({ flatten: true }).length > 0);\n    };\n\n    private _syncSlotFlags(): void {\n        const shadow = this.shadowRoot;\n        if (!shadow) return;\n\n        for (const name of [\"pre\", \"content\", \"pre-bar\", \"bar-header\"]) {\n            const slot = shadow.querySelector<HTMLSlotElement>(`slot[name=\"${name}\"]`);\n            const has = slot\n                ? slot.assignedElements({ flatten: true }).length > 0\n                : Array.from(this.children).some(child => {\n                    if (child.slot !== name) return false;\n                    return !(child instanceof HTMLSlotElement)\n                        || child.assignedElements({ flatten: true }).length > 0;\n                });\n            this._setSlotFlag(name, has);\n        }\n    }\n\n    willUpdate(changedProperties: PropertyValues): void {\n        super.willUpdate(changedProperties);\n        this._syncSlotFlags();\n    }\n\n    /** Ignores our own slot redistribution but measures externally changed toolbar contents. */\n    private _onBarSlotChange = (): void => {\n        for (const name of [\"bar-pre\", \"bar-post\", \"bar-overflow\"]) {\n            const current = this.shadowRoot?.querySelector<HTMLSlotElement>(`slot[name=\"${name}\"]`)\n                ?.assignedElements() ?? [];\n            const previous = this._barSlotAssignments.get(name);\n            if (!previous || previous.length !== current.length\n                || current.some((item, index) => item !== previous[index])) {\n                this._scheduleOverflowUpdate();\n                return;\n            }\n        }\n    };\n\n    private _scheduleOverflowUpdate(): void {\n        if (!this.isConnected || this._rafId !== null) return;\n        this._rafId = requestAnimationFrame(() => {\n            this._rafId = null;\n            if (!this.isConnected) return;\n            this._doOverflowUpdate();\n            for (const name of [\"bar-pre\", \"bar-post\", \"bar-overflow\"]) {\n                const items = this.shadowRoot?.querySelector<HTMLSlotElement>(`slot[name=\"${name}\"]`)\n                    ?.assignedElements() ?? [];\n                this._barSlotAssignments.set(name, items);\n            }\n        });\n    }\n\n    private _doOverflowUpdate(): void {\n        const shadow = this.shadowRoot;\n        if (!shadow) return;\n\n        // Step 1: Restore all overflow items to their original slots\n        const overflowSlot = shadow.querySelector('slot[name=\"bar-overflow\"]') as HTMLSlotElement | null;\n        if (overflowSlot) {\n            const items = [...overflowSlot.assignedElements()] as HTMLElement[];\n            for (const item of items) {\n                item.slot = item.dataset.originalSlot ?? \"bar-pre\";\n                delete item.dataset.originalSlot;\n            }\n        }\n\n        // Step 2: Measure all items (forces synchronous layout reflow)\n        const barItems = this.barItemsRef.value;\n        if (!barItems) return;\n\n        const preSlot = shadow.querySelector('slot[name=\"bar-pre\"]') as HTMLSlotElement | null;\n        const postSlot = shadow.querySelector('slot[name=\"bar-post\"]') as HTMLSlotElement | null;\n        const allItems = [\n            ...(preSlot?.assignedElements({ flatten: true }) ?? []),\n            ...(postSlot?.assignedElements({ flatten: true }) ?? []),\n        ] as HTMLElement[];\n\n        if (allItems.length === 0) {\n            this._overflowCount = 0;\n            this._overflowOpen = false;\n            return;\n        }\n\n        const GAP = 5;\n        const HAMBURGER_W = 44; // width of overflow toggle button + gap\n\n        // Calculate total width of all items\n        const totalItemsWidth = allItems.reduce(\n            (sum, el, i) => sum + el.offsetWidth + (i > 0 ? GAP : 0), 0\n        );\n        const containerWidth = barItems.offsetWidth;\n\n        if (totalItemsWidth <= containerWidth) {\n            // Everything fits\n            this._overflowCount = 0;\n            this._overflowOpen = false;\n            return;\n        }\n\n        // Find which items overflow (available = container - hamburger button)\n        const availableWidth = containerWidth - HAMBURGER_W;\n        let used = 0;\n        let firstOverflow = allItems.length;\n\n        for (let i = 0; i < allItems.length; i++) {\n            const itemWidth = allItems[i].offsetWidth + (i > 0 ? GAP : 0);\n            if (used + itemWidth > availableWidth) {\n                firstOverflow = i;\n                break;\n            }\n            used += itemWidth;\n        }\n\n        // Assign overflow items\n        for (let i = firstOverflow; i < allItems.length; i++) {\n            const item = allItems[i];\n            item.dataset.originalSlot = item.slot;\n            item.slot = \"bar-overflow\";\n        }\n\n        const newCount = allItems.length - firstOverflow;\n        this._overflowCount = newCount;\n        if (newCount === 0) {\n            this._overflowOpen = false;\n        }\n    }\n\n    toggleFullscreen() {\n        if (this.fullscreen === \"on\") {\n            this.fullscreen = \"off\";\n        } else {\n            this.fullscreen = \"on\";\n        }\n    }\n\n    updated(changedProperties: PropertyValues): void {\n        super.updated(changedProperties);\n        if (!this.isConnected) return;\n\n        if (\n            this.observer === undefined\n            && this.contentRef.value !== undefined\n        ) {\n\n            this.observer = new ResizeObserver(() => {\n                if (this.isConnected && this.fullscreen === \"off\" && this.contentRef.value) {\n                    this.contentRef.value.removeAttribute( \"style\" );\n                }\n            });\n            this.observer.observe(this);\n\n        }\n\n        // Set up overflow ResizeObserver once barItemsRef is available\n        if (!this._overflowObserver && this.barItemsRef.value) {\n            this._overflowObserver = new ResizeObserver(() => {\n                this._scheduleOverflowUpdate();\n            });\n            this._overflowObserver.observe(this.barItemsRef.value);\n            this._scheduleOverflowUpdate();\n        }\n\n    }\n\n\n    attributeChangedCallback(name: string, _old: string | null, value: string | null): void {\n        super.attributeChangedCallback(name, _old, value);\n\n        if (name === \"fullscreen\" && _old !== value) {\n            if (value === \"on\") {\n                if (document.fullscreenElement === this) return;\n                if (typeof this.requestFullscreen !== \"function\") {\n                    this.log(\"Fullscreen API is unavailable\");\n                    this.fullscreen = \"off\";\n                    return;\n                }\n                void this.requestFullscreen().catch(error => {\n                    this.log(\"Unable to enter fullscreen\", error);\n                    this._handleFullscreenChange();\n                });\n            } else if (value === \"off\" && _old !== null) {\n                if (document.fullscreenElement === this) {\n                    void document.exitFullscreen().catch(error => {\n                        this.log(\"Unable to exit fullscreen\", error);\n                        this._handleFullscreenChange();\n                    });\n                }\n            }\n        }\n\n    }\n\n\n    static styles = css`\n\n        :host {\n            font-family: sans-serif;\n            font-weight: normal;\n            font-size: var( --thermal-fs );\n            line-height: 1em;\n            color: var( --thermal-foreground );\n\n            display: block;\n\n            padding: calc( var( --thermal-gap ) / 3 );\n            background-color: var( --thermal-slate-light );\n            border: var(--thermal-border-width) var(--thermal-border-style) var( --thermal-slate );\n            border-radius: var( --thermal-radius );    \n            position: relative; \n        }\n\n        .bar {\n            padding-bottom: calc( var( --thermal-gap ) * 0.5 );\n            display: flex;\n            gap: 5px;\n            align-items: center;\n        }\n\n        .bar-label {\n            flex: 0 1 auto;\n            min-width: 50px;\n            overflow: hidden;\n            display: flex;\n            align-items: center;\n        }\n\n        .bar-header,\n        .pre-bar {\n            display: flex;\n            gap: 5px;\n            align-items: flex-start;\n        }\n\n        .pre-bar {\n            width: 100%;\n        }\n\n        .bar-header[hidden],\n        .pre-bar[hidden],\n        .pre[hidden] {\n            display: none;\n        }\n\n        .bar-items {\n            flex: 1 1 0;\n            min-width: 0;\n            display: flex;\n            gap: 5px;\n            align-items: center;\n            --thermal-direction: row;\n        }\n\n        .bar-items ::slotted([slot=\"bar-pre\"]),\n        .bar-items ::slotted([slot=\"bar-post\"]) {\n            flex-shrink: 0;\n        }\n\n        .bar-spacer {\n            flex: 1 1 0;\n            min-width: 0;\n        }\n\n        .bar-overflow-toggle {\n            flex-shrink: 0;\n            display: flex;\n            align-items: center;\n            justify-content: center;\n            background: none;\n            border: var(--thermal-border-width) var(--thermal-border-style) var(--thermal-slate);\n            border-radius: var(--thermal-radius);\n            color: var(--thermal-foreground);\n            cursor: pointer;\n            padding: 0.3em 0.5em;\n            line-height: 0;\n        }\n\n        .bar-overflow-toggle:hover {\n            background-color: var(--thermal-slate-light);\n        }\n\n        .bar-overflow-panel {\n            \n            display: flex;\n            flex-wrap: wrap;\n            gap: 5px;\n            align-items: center;\n            padding: calc( var(--thermal-gap) * 0.4 ) 0;\n            \n            border-top: var(--thermal-border-width) var(--thermal-border-style) var(--thermal-slate);\n            --thermal-direction: row;\n\n            padding: .3em;\n            \n            background: var(--thermal-slate);\n            border-radius: var(--thermal-radius);\n            \n            margin-bottom: .5em;\n\n            > slot > * {\n                width: 100%; \n            }\n\n        }\n\n        .bar-overflow-panel[hidden] {\n            display: none;\n        }\n\n        :host([fullscreen=\"on\"]) {\n            box-sizing: border-box;\n            width: 100vw;\n            height: 100vh;\n            overflow: auto;\n            padding: calc( var( --thermal-gap ) / 3 );\n            border: 0;\n            border-radius: 0;\n        }\n\n\n        .credits {\n\n            display: flex;\n            width: 100%;\n            flex-wrap: wrap;\n            font-size: calc( var(--thermal-fs-sm) * 0.8 );\n\n            & > div {\n                padding-top: calc( var(--thermal-gap) * .5 );\n                padding-right: var( --thermal-gap );\n            }\n        \n        }\n\n        .credits-field {\n            display: inline;\n            opacity: .5;\n        }\n\n        .credit-value {\n            display: inline;\n        }\n\n        .content {\n            width: 100%;\n            box-sizing: border-box;\n        }\n\n        .has-content {\n            margin-top: calc( var(--thermal-gap) * .5);\n            &::before {\n                opacity: .5;\n                font-size: calc( var(--thermal-fs-sm) * 0.8 );\n                display: block;\n                padding-bottom: calc( var(--thermal-gap) * .5);\n            }\n        }\n\n        .app-header {\n            position: sticky;\n            top: 0;\n            z-index: 9999;\n            background: var(--thermal-slate-light);\n            background: linear-gradient(var(--thermal-slate-light) calc(100% - 10px), transparent);\n        }\n    \n    `;\n\n\n\n    private renderLabel(): unknown {\n\n        const nonInteractive = !this.onlabel;\n\n        const slotInner = this.label\n            ? html`<thermal-btn\n    variant=\"${this.labelVariant}\"\n    ?non-interactive=${nonInteractive}\n    icon=${ifDefined(this.labelIcon)}\n    iconStyle=${ifDefined(this.labelIconStyle)}\n    tooltip=${ifDefined(this.labelTooltip)}\n    @click=${this.onlabel}\n>${this.label}</thermal-btn>`\n            : nothing;\n\n        return html`\n    <slot name=\"label\">\n        ${slotInner}\n    </slot>`;\n\n    }\n\n\n    private renderCreditField(label: string, value?: string): unknown {\n        if ( value === undefined || value.trim().length === 0 ) return nothing;\n        return html`<div>\n    <div class=\"credits-field\">${label}:</div>\n    <div class=\"credit-value\">${value}</div>\n</div>`;\n    }\n\n    private renderCredits(): unknown {\n\n        if ( this.author || this.license || this.recorded ) {\n\n            return html`<div class=\"credits\">\n    ${this.renderCreditField(t(T.recordedat), this.recorded)}\n    ${this.renderCreditField(t(T.author), this.author)}\n    ${this.renderCreditField(t(T.license), this.license)}\n</div>`;\n\n        }\n\n        return nothing;\n\n    }\n\n    private static readonly languages = [\n        \"en\",\n        \"cs\",\n        \"de\",\n        \"fr\",\n        \"cy\",\n    ];\n\n    private renderLanguageSwitcher(): unknown {\n\n        return html`<thermal-dropdown>\n    <span slot=\"invoker\">${this.language.toUpperCase()}</span>\n    ${cache( map( ThermalAppElement.languages, lang => html`<div slot=\"option\">\n        <thermal-btn\n            @click=${() => {\n                i18next.changeLanguage( lang );\n                this.language = lang;\n            }}\n        >${languagesObject[lang].flag} ${languagesObject[lang].name}</thermal-btn>\n    </div>` ) )}\n</thermal-dropdown>`;\n\n    }\n\n    private renderFullscreenButton(): unknown {\n\n        if ( this.showFullscreen === false ) {\n            return nothing;\n        }\n\n        return html`<thermal-btn\n    class=\"app-fullscreen-button\"\n    @click=${this.toggleFullscreen.bind(this)}\n    icon=${this.fullscreen === \"on\" ? \"smaller\" : \"bigger\"}\n    iconStyle=\"mini\"\n    tooltip=${this.fullscreen === \"on\" ? t(T.close) : \"Fullscreen\"}\n></thermal-btn>`;\n\n    }\n\n    private renderOverflowToggle(): unknown {\n\n        if ( this._overflowCount === 0 ) {\n            return nothing;\n        }\n\n        let icon = \"adjustment\";\n        let iconStyle = \"outline\";\n        let variant: BtnVariants = \"default\";\n\n        if ( this._overflowOpen ) {\n            icon = \"close\";\n            iconStyle = \"outline\";\n            variant = \"background\";\n        }\n\n        return html`<thermal-btn \n    @click=${this._toggleOverflow} \n    tooltip=\"${this.t(\"moreoptions\")}\" \n    icon=${icon} \n    iconStyle=${iconStyle} \n    variant=${variant}\n></thermal-btn>`;\n\n\n    }\n\n\n\n    protected render(): unknown {\n\n        return html`<header ${ref(this.headerRef)} class=\"app-header\">\n\n        <div class=\"bar\">\n\n            <div class=\"bar-label\">\n                ${ this.renderLabel() }\n            </div>\n\n            <div class=\"bar-header\" ?hidden=${!this._hasBarHeader}>\n                <slot name=\"bar-header\" @slotchange=${this._onSlotChange}></slot>\n            </div>\n\n            <div class=\"bar-items\" ${ref(this.barItemsRef)}>\n\n                <slot name=\"bar-pre\" @slotchange=${this._onBarSlotChange}></slot>\n                <div class=\"bar-spacer\"></div>\n                <slot name=\"bar-post\" @slotchange=${this._onBarSlotChange}></slot>\n\n                ${this.renderOverflowToggle()}\n\n            </div>\n\n            <slot name=\"close\"></slot>\n\n            ${this.renderFullscreenButton()}\n\n            ${this.renderLanguageSwitcher()}\n\n        </div>\n\n        <div class=\"bar-overflow-panel\" ?hidden=${this._overflowCount === 0 || !this._overflowOpen}>\n            <slot name=\"bar-overflow\" @slotchange=${this._onBarSlotChange}></slot>\n        </div>\n\n        <div class=\"pre\" ?hidden=${!this._hasPre}>\n            <slot name=\"pre\" @slotchange=${this._onSlotChange}></slot>\n        </div>\n\n        <div class=\"pre-bar\" ?hidden=${!this._hasPreBar}>\n            <slot name=\"pre-bar\" @slotchange=${this._onSlotChange}></slot>\n        </div>\n        <slot name=\"pre-bar-wrap\"></slot>\n\n    </header>\n\n    <div class=\"content\" part=\"app-content\" ${ref(this.contentRef)}>\n        <slot></slot>\n    </div>\n\n    <div class=\"post\">\n        <slot name=\"post\"></slot>\n    </div>\n\n    ${this.renderCredits()}\n\n    <div class=\"content ${this._hasContent ? \"has-content\" : \"\"}\">\n        <slot name=\"content\" @slotchange=${this._onSlotChange}></slot>\n    </div>\n`\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"thermal-app\": ThermalAppElement;\n    }\n}\n","import type { PropertyValueMap} from \"lit\";\nimport { LitElement, css, html, nothing } from \"lit\";\nimport { state } from 'lit/decorators.js';\nimport type { Ref} from \"lit/directives/ref.js\";\nimport { createRef, ref } from \"lit/directives/ref.js\";\n\nexport class ThermalBarElement extends LitElement {\n\n    static styles = css`\n\n        .container {\n            // width: 100%;\n            display: flex;\n            gap: 5px;\n            position: relative;\n        }\n\n\n        .ruler {\n            width: 100%;\n            position: absolute;\n            height: 0;\n            top: 0;\n            left: 0;\n        }\n\n        .ruler-item {}\n\n        .ruler-item__current {\n            border: var(--thermal-border-width) var(--thermal-border-style) transparent;\n            height: 0;\n            margin-top: -1px;\n            content: \"\";\n        }\n\n        .ruler-item__content {\n            border: var(--thermal-border-width) var(--thermal-border-style) red;\n            position: absolute;\n            display: none;\n        }\n\n\n        .content {\n            \n            display: flex;\n            gap: calc( 5px );\n            width: max-content;\n\n            align-items: center;\n        \n        }\n\n\n\n        .icon {\n            width: var( --thermal-gap );\n            line-height: 0;\n        }\n\n        .collapsed-menu {\n            --thermal-direction: column;\n            --thermal-collapsible-display: block !important;\n            --thermal-collapsible-width: 100%;\n            --thermal-collapsible-grow: 1;\n        }\n\n    `;\n\n    @state()\n    protected collapsed: boolean = false;\n\n    @state()\n    protected lastContentWidth!: number;\n\n    protected drawerRef: Ref<HTMLDivElement> = createRef();\n    protected contentRef: Ref<HTMLDivElement> = createRef();\n    protected rulerContentRef: Ref<HTMLDivElement> = createRef();\n\n    protected observer!: ResizeObserver;\n\n    connectedCallback(): void {\n\n        super.connectedCallback();\n\n    }\n\n    protected firstUpdated(_changedProperties: PropertyValueMap<this> | Map<PropertyKey, unknown>): void {\n        super.firstUpdated(_changedProperties);\n\n        this.hydrateObserver();\n\n    }\n\n\n    private hydrateObserver() {\n\n        if (this.drawerRef.value && this.observer === undefined) {\n\n            this.observer = new ResizeObserver((entries) => {\n\n                // if the bar is not collapsed, store the content width\n                if (this.collapsed === false) {\n                    const contentWidth = this.contentRef.value!.clientWidth;\n                    this.lastContentWidth = contentWidth;\n                }\n\n                const entry = entries[0];\n\n                // If content is larger, expand it\n                if (this.lastContentWidth < entry.contentRect.width) {\n                    if (this.collapsed) {\n                        this.collapsed = false;\n                    }\n                }\n\n                // If content is smaller, collapse it\n                else {\n                    if (this.collapsed === false) {\n                        this.collapsed = true;\n                    }\n                }\n\n            });\n\n\n            this.observer.observe(this.drawerRef.value);\n\n\n        }\n\n    }\n\n\n    disconnectedCallback(): void {\n        super.disconnectedCallback();\n        if (this.drawerRef.value) {\n            this.observer.unobserve(this.drawerRef.value);\n        }\n        if (this.observer) {\n            this.observer.disconnect();\n        }\n\n    }\n\n\n    protected render(): unknown {\n        return html`\n\n            <div class=\"container\">\n\n                <div class=\"ruler\">\n                    <div class=\"ruler-item ruler-item__current\" ${ref(this.drawerRef)}></div>\n                    <div class=\"ruler-item ruler-item__content\" ${ref(this.rulerContentRef)} style=\"width: ${this.lastContentWidth + 1}px\"></div>\n                </div>\n                <div class=\"content\" ${ref(this.contentRef)}>\n\n                    ${this.collapsed === false ? html`\n                        <slot></slot>    \n                    ` : nothing}\n                \n                </div>\n\n            </div>\n\n            ${this.collapsed ? html`\n                <thermal-dropdown class=\"collapsed-menu\">\n                    <div slot=\"invoker\" class=\"icon\">\n                    <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"size-6\">\n                        <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M10.5 6h9.75M10.5 6a1.5 1.5 0 1 1-3 0m3 0a1.5 1.5 0 1 0-3 0M3.75 6H7.5m3 12h9.75m-9.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-3.75 0H7.5m9-6h3.75m-3.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-9.75 0h9.75\" />\n                    </svg>\n                    </div>\n\n                    <slot slot=\"option\" stacked=\"true\"></slot>\n                </thermal-dropdown>\n            ` : nothing}\n        \n        `;\n    }\n\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"thermal-bar\": ThermalBarElement;\n    }\n}\n","import type { Placement} from '@floating-ui/dom';\nimport { arrow, autoUpdate, computePosition, flip, offset, shift } from '@floating-ui/dom';\nimport { css, html, nothing } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { ref } from \"lit/directives/ref.js\";\nimport { unsafeSVG } from \"lit/directives/unsafe-svg.js\";\nimport { AbstractThermalElement } from \"../hierarchy/AbstractThermalElement\";\nimport icons from \"../utils/icons\";\n\nexport type BtnVariants = \"primary\" | \"foreground\" | \"background\" | \"default\" | \"breadcrumb\";\n\nexport type BtnSizes = \"sm\" | \"md\" | \"lg\" | \"xl\";\n\nexport class ThermalBtnElement extends AbstractThermalElement {\n\n    @property({type: String, attribute: \"tooltip-placement\"})\n    public tooltipPlacement: Placement = \"top\";\n\n    @property( { type: String } )\n    public pre?: string;\n\n    @property({ type: String, attribute: true, reflect: true })\n    public variant?: BtnVariants;\n\n    @property({ type: String, attribute: true, reflect: true })\n    public size?: BtnSizes;\n\n    @property({type: String})\n    public icon?: string;\n\n    @property({type: String})\n    public iconStyle:string = \"outline\";\n\n    /** Disables the button: blocks clicks and keyboard activation and renders it dimmed. */\n    @property({ type: Boolean, reflect: true })\n    public disabled: boolean = false;\n\n    /** Renders the button as a static label without hover/focus feedback. */\n    @property({ type: Boolean, reflect: true, attribute: \"non-interactive\" })\n    public nonInteractive: boolean = false;\n\n    @property({type: Boolean, attribute: true, reflect: true})\n    public plain?: boolean;\n\n    @property({type: String})\n    public tooltip?: string;\n\n    @property({type: Number, reflect: true})\n    public tabindex: number = 0;\n\n    @property({type: String, attribute: \"badge\", reflect: true})\n    public badge?: string;\n\n    @property({type: String, reflect: true})\n    public align: string = \"center\";\n\n    private tooltipElement?: HTMLElement;\n    private arrowElement?: HTMLElement;\n    private cleanupAutoUpdate?: () => void;\n    private tooltipPositionSession = 0;\n\n    // timeout id for active highlight animation\n    private highlightTimeout?: number;\n\n    connectedCallback() {\n        super.connectedCallback();\n        // Capture phase runs before consumers' click listeners on the host,\n        // so a disabled button can stop them all.\n        this.addEventListener('click', this.handleClick, { capture: true });\n        this.addEventListener('keydown', this.handleKeydown);\n        if (this.tooltip) {\n            this.addTooltipListeners();\n        }\n    }\n\n    firstUpdated() {\n        // Ensure element is focusable\n        if (!this.hasAttribute('tabindex')) {\n            this.setAttribute('tabindex', '0');\n        }\n    }\n\n    updated(changedProperties: Map<string | number | symbol, unknown>) {\n        if (changedProperties.has('tooltip')) {\n            if (this.tooltip && this.isConnected) {\n                this.addTooltipListeners();\n            } else {\n                this.hideTooltip();\n                this.removeTooltipListeners();\n            }\n        }\n    }\n\n    private addTooltipListeners(): void {\n        this.addEventListener('mouseenter', this.showTooltip);\n        this.addEventListener('mouseleave', this.hideTooltip);\n        this.addEventListener('focus', this.showTooltip);\n        this.addEventListener('blur', this.hideTooltip);\n    }\n\n    private removeTooltipListeners(): void {\n        this.removeEventListener('mouseenter', this.showTooltip);\n        this.removeEventListener('mouseleave', this.hideTooltip);\n        this.removeEventListener('focus', this.showTooltip);\n        this.removeEventListener('blur', this.hideTooltip);\n    }\n\n    private removeTooltip() {\n        this.hideTooltip();\n        this.tooltipElement = undefined;\n        this.arrowElement = undefined;\n        this.removeTooltipListeners();\n    }\n\n    private stopTooltipPositioning(): void {\n        this.tooltipPositionSession++;\n        this.cleanupAutoUpdate?.();\n        this.cleanupAutoUpdate = undefined;\n    }\n\n    private showTooltip = () => {\n        const tooltipElement = this.tooltipElement;\n        const arrowElement = this.arrowElement;\n        if (!this.isConnected || !tooltipElement || !arrowElement) return;\n        this.stopTooltipPositioning();\n        tooltipElement.style.display = 'block';\n        tooltipElement.style.visibility = 'visible';\n        tooltipElement.style.opacity = '1';\n        const session = this.tooltipPositionSession;\n        let latestRequest = 0;\n        const updatePosition = async () => {\n            if (session !== this.tooltipPositionSession) return;\n            const request = ++latestRequest;\n            const { x, y, placement, middlewareData } = await computePosition(this, tooltipElement, {\n                placement: this.tooltipPlacement,\n                strategy: 'fixed',\n                middleware: [\n                    offset(6),\n                    flip(),\n                    shift({ padding: 8 }),\n                    arrow({ element: arrowElement })\n                ]\n            });\n            // Ignore stale results after hiding, replacing, or repositioning the tooltip.\n            if (!this.isConnected || session !== this.tooltipPositionSession || request !== latestRequest\n                || this.tooltipElement !== tooltipElement || this.arrowElement !== arrowElement) return;\n            Object.assign(tooltipElement.style, {\n                left: `${x}px`,\n                top: `${y}px`,\n            });\n            // Position arrow\n            const { x: arrowX, y: arrowY } = middlewareData.arrow || {};\n            const side = placement.split('-')[0];\n            const staticSide = {\n                top: 'bottom',\n                right: 'left',\n                bottom: 'top',\n                left: 'right',\n            }[side];\n            Object.assign(arrowElement.style, {\n                left: arrowX != null ? `${arrowX}px` : '',\n                top: arrowY != null ? `${arrowY}px` : '',\n                right: '',\n                bottom: '',\n                [staticSide as string]: '-4px',\n            });\n        };\n        this.cleanupAutoUpdate = autoUpdate(this, tooltipElement, updatePosition);\n    };\n\n    private hideTooltip = () => {\n        this.stopTooltipPositioning();\n        if (!this.tooltipElement) return;\n        this.tooltipElement.style.opacity = '0';\n        this.tooltipElement.style.visibility = 'hidden';\n        this.tooltipElement.style.display = 'none';\n    };\n\n    private handleClick = (event: MouseEvent) => {\n        // Prevent click if disabled\n        if (this.disabled) {\n            event.preventDefault();\n            event.stopImmediatePropagation();\n        }\n    };\n\n    private handleKeydown = (event: KeyboardEvent) => {\n        // Don't trigger click if disabled\n        if (this.disabled) return;\n        \n        // Trigger click on Enter or Space\n        if (event.key === 'Enter' || event.key === ' ') {\n            event.preventDefault();\n            this.click();\n        }\n    };\n\n    disconnectedCallback() {\n        this.removeTooltip();\n        super.disconnectedCallback();\n        this.removeEventListener('keydown', this.handleKeydown);\n        this.removeEventListener('click', this.handleClick, { capture: true });\n        // clear highlight if still pending\n        if (this.highlightTimeout) {\n            clearTimeout(this.highlightTimeout);\n            this.highlightTimeout = undefined;\n        }\n        this.classList.remove('highlight');\n    }\n\n    public static styles = css`\n\n        :host {\n\n            font-family: var( --thermal-font-family );\n            font-size: calc( var( --thermal-fs ) * .8);\n            line-height: var( --thermal-line-height );\n        \n            --color: var( --thermal-foreground );\n            --color-hover: var( --color );\n\n            --bg: var( --thermal-slate-light );\n            --bg-hover: var( --bg );\n\n            --border-width: var(--thermal-border-width);\n            --border-style: var(--thermal-border-style);\n            --border-color: var( --thermal-slate );\n            --border-color-hover: var( --border-color );\n\n            --radius: var( --custom-radius, var( --thermal-radius ) );\n            \n            --shadow: none;\n            --shadow-hover: var( --thermal-shadow );\n            \n            --padding: .5em .7em;\n            --icon-size: 1em;\n            --gap: .5em;\n            --opacity: 1;\n            --letter-spacing: normal;\n\n            --cursor: pointer;\n            --transition-duration: .15s;\n\n            --tooltip-bg: var(--thermal-foreground, black);\n            --tooltip-color: var( --thermal-background, white);\n            --tooltip-padding: 0.5em 0.75em;\n            --tooltip-border-radius: var(--thermal-radius, 4px);\n            --tooltip-font-size: 0.9em;\n            --tooltip-box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);\n\n        }\n\n\n\n        :host {\n            display: flex;\n            align-items: center;\n            justify-content: center;\n            flex-grow: 0;\n            gap: var(--gap);\n            vertical-align: middle;\n            \n            position: relative;\n\n            margin: 0;\n            padding: var(--padding);\n            width: fit-content;\n            box-sizing: border-box;\n\n            border-width: var( --border-width );\n            border-style: var( --border-style );\n            border-color: var( --border-color );\n            border-radius: var( --radius );\n            \n            background-color: var(--bg);\n            color: var(--color);\n\n            box-shadow: var( --shadow ); \n            \n            cursor: var( --cursor );\n            opacity: var( --opacity );\n            \n            --letter-spacing: var( --letter-spacing );\n            text-align: center;\n            white-space: nowrap;\n            vertical-align: middle;\n\n            transition: all var(--transition-duration) ease-in-out;\n\n            /* Focus styling */\n            outline: none;\n\n            \n        }\n\n        :host([align=\"left\"]) {\n            justify-content: flex-start;\n        }\n\n\n        :host(:focus),\n        :host(:focus-visible),\n        :host(:hover) {\n            outline: none;\n            box-shadow: var( --shadow-hover );\n            background-color: var(--bg-hover);\n            color: var(--color-hover);\n            border-color: var( --border-color-hover );\n        }\n\n        svg,\n        span {\n            vertical-align: middle;\n            display: inline-block;\n        }\n\n\n\n        :host([disabled]),\n        :host([disabled]:hover),\n        :host([disabled]:focus) {\n\n            cursor: not-allowed;\n            color: color-mix(in srgb, var(--color) 50%, transparent);\n            background: color-mix(in srgb, var(--bg) 50%, transparent);\n            border-color: color-mix(in srgb, var(--border-color) 50%, transparent);\n            --cursor: not-allowed;\n            --shadow: none;\n            --shadow-hover: none;\n        }\n\n\n        :host([non-interactive]),\n        :host([non-interactive]:hover),\n        :host([non-interactive]:focus) {\n            --shadow-hover: none;\n            --cursor: text;\n            --color-hover: var( --color );\n            --bg-hover: var( --bg );\n        }\n\n\n\n\n\n        :host([size=\"sm\"]),\n        :host([size=sm]) {\n            --padding: .1em .2em;\n            line-height: 1.2;\n            --letter-spacing: 0.5px;\n            font-size: .7em;\n        }\n\n        :host([size=\"lg\"]),\n        :host([size=lg]) {\n            --padding: .7em .9em;\n            line-height: 1.2;\n            font-size: 1em;\n        }\n\n        :host([size=\"xl\"]),\n        :host([size=xl]) {\n            line-height: 1.2;\n            font-size: 2em;\n        }\n\n        :host([plain]) {\n            --border-color: transparent;\n            --border-color-hover: transparent;\n            --border-width: 0px;\n            border: none !important;\n        }\n\n\n\n\n\n\n\n        :host([variant=\"primary\"]),\n        :host([variant=primary]) {\n            \n            --color: var( --thermal-background );\n            --color-hover: var( --thermal-background );\n            \n            --bg: var( --thermal-primary );\n            --bg-hover: var( --thermal-primary-dark );\n\n            --border-color: var( --thermal-slate );\n            \n            --shadow: none;\n            --shadow-hover: var( --thermal-shadow );\n\n        }\n\n        :host([variant=\"foreground\"]),\n        :host([variant=foreground]) {\n\n            --color: var( --thermal-background );\n            --color-hover: var( --thermal-background );\n            \n            --bg: var( --thermal-foreground );\n            --bg-hover: var( --thermal-slate-dark );\n\n            --border-color: var( --thermal-slate );\n            \n            --shadow: none;\n            --shadow-hover: var( --thermal-shadow );\n        }\n\n\n        :host([variant=\"background\"]),\n        :host([variant=background]) {\n\n            --color: var( --thermal-foreground );\n            --color-hover: var( --thermal-foreground );\n            \n            --bg: var( --thermal-background );\n            --bg-hover: var( --bg );\n\n            --border-color: var( --thermal-slate );\n            \n            --shadow: none;\n            --shadow-hover: var( --thermal-shadow );\n        }\n\n\n\n        :host([variant=\"text\"]),\n        :host([variant=text]) {\n\n            --bg: transparent;\n            --bg-hover: transparent;\n\n            --border-color: transparent;\n            --border-color-hover: transparent;\n\n            --border-width: 0px;\n            border: none !important;\n\n            --shadow: none;\n            --shadow-hover: none;\n\n            --padding: 0px;\n            --letter-spacing: normal;\n        }\n\n        \n\n\n\n        .btn-icon {\n            width: 1.3em;\n        }\n\n\n        /* Global tooltip styles */\n\n        .thermal-tooltip {\n            background-color: var(--tooltip-bg, #334155);\n            color: var(--tooltip-color, white);\n            padding: var(--tooltip-padding, 0.5em 0.75em);\n            border-radius: var(--tooltip-border-radius, 4px);\n            font-size: var(--tooltip-font-size, 1em);\n            box-shadow: var(--tooltip-box-shadow, 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06));\n            z-index: 9999;\n            pointer-events: none;\n            word-wrap: break-word;\n            font-size: calc( var( --thermal-fs ) * 0.8 );\n        }\n\n        .thermal-tooltip-arrow {\n            position: absolute;\n            width: 8px;\n            height: 8px;\n            background: inherit;\n            transform: rotate(45deg);\n        }\n\n        .prefix {\n            font-weight: bold;\n            padding-right: 0.25em;\n        }\n\n        .badge {\n            position: absolute;\n            top: 0;\n            right: 0;\n            width: .5em;\n            height: .5em;\n            background: red;\n            border-radius: 50%;\n        }\n\n        /* highlight animation for attention-grabbing effect */\n        @keyframes thermal-highlight {\n            0%,100% { transform: scale(1); }\n            50% { transform: scale(1.1); }\n        }\n        :host(.highlight) {\n            animation: thermal-highlight 0.4s ease-in-out infinite;\n            box-shadow: var(--thermal-shadow);\n        }\n\n    `;\n    private renderBadge(): unknown {\n        if ( !this.badge ) {\n            return nothing;\n        }\n        return html`<span class=\"badge\" style=\"background-color: ${this.badge}\"></span>`;\n    }\n\n    /**\n     * Apply a temporary highlight animation to the button. The animation\n     * will pulse the element with a gentle scale up/down effect for the\n     * specified duration (milliseconds).\n     */\n    public highlight(durationMs: number): void {\n        // ensure non-negative\n        if (durationMs <= 0) {\n            return;\n        }\n        // clear any existing highlighting first\n        if (this.highlightTimeout) {\n            clearTimeout(this.highlightTimeout);\n            this.highlightTimeout = undefined;\n        }\n\n        this.classList.add('highlight');\n\n        const cleanup = () => {\n            this.classList.remove('highlight');\n            if (this.highlightTimeout) {\n                clearTimeout(this.highlightTimeout);\n                this.highlightTimeout = undefined;\n            }\n            this.removeEventListener('mouseenter', cleanup);\n            this.removeEventListener('focus', cleanup);\n        };\n\n        // cancel highlight if user hovers or focuses the button\n        this.addEventListener('mouseenter', cleanup);\n        this.addEventListener('focus', cleanup);\n\n        this.highlightTimeout = window.setTimeout(cleanup, durationMs);\n    }\n\n    protected render(): unknown {\n        let icon: typeof nothing | string = nothing;\n        if (this.icon && this.icon in icons) {\n            const i = icons[this.icon as keyof typeof icons];\n            if (typeof i[this.iconStyle as keyof typeof i] === 'function') {\n                icon = (i[this.iconStyle as keyof typeof i] as CallableFunction)(\"btn-icon\");\n            }\n        }\n        // Tooltip rendering\n        let tooltipHtml: unknown = nothing;\n        if (this.tooltip) {\n            tooltipHtml = html`\n                <div\n                    class=\"thermal-tooltip\"\n                    style=\"display: none; position: fixed; top: 0; left: 0; visibility: hidden; opacity: 0; transition: opacity 0.2s ease-in-out;\"\n                    @mouseenter=${this.showTooltip}\n                    @mouseleave=${this.hideTooltip}\n                    @focus=${this.showTooltip}\n                    @blur=${this.hideTooltip}\n                    ${ref((el: Element | undefined) => { this.tooltipElement = el as HTMLElement; })}\n                >\n                    ${this.tooltip}\n                    <div class=\"thermal-tooltip-arrow\" ${ref((el: Element | undefined) => { this.arrowElement = el as HTMLElement; })}></div>\n                </div>\n            `;\n        }\n        return html`\n            ${unsafeSVG(icon)}${this.pre ? html`<span class=\"prefix\">${this.pre}</span>` : nothing}<slot></slot>\n            ${tooltipHtml}\n            ${this.renderBadge()}\n        `;\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"thermal-btn\": ThermalBtnElement;\n    }\n}\n","import { css, html } from \"lit\";\nimport { AbstractThermalElement } from \"../hierarchy/AbstractThermalElement\";\n\nexport class ThermalBtnGroupElement extends AbstractThermalElement {\n\n    static styles = css`\n    \n        :host {\n            display: block;\n        }\n\n        .btn-group {\n            display: flex;\n            flex-wrap: no-wrap;\n        }\n\n        ::slotted(thermal-btn:first-child) {\n\n            --custom-radius: var( --thermal-radius ) 0 0 var( --thermal-radius );\n            border-right: none !important;\n        \n        }\n\n        ::slotted(thermal-btn:last-child) {\n            --custom-radius: 0 var( --thermal-radius ) var( --thermal-radius ) 0;\n        }\n\n        ::slotted(thermal-btn:not(:first-child):not(:last-child)) {\n            --custom-radius: 0;\n            border-right: none !important;\n        }\n    \n    `;\n\n    protected render(): unknown {\n        return html`<div class=\"btn-group\"><slot></slot></div>`;\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"thermal-btn-group\": ThermalBtnGroupElement;\n    }\n}\n","import { t } from \"i18next\";\nimport { LitElement, css, html, nothing } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport type { Ref } from \"lit/directives/ref.js\";\nimport { createRef, ref } from \"lit/directives/ref.js\";\nimport { T } from \"../translations/Languages\";\n\nexport class ThermalDialogElement extends LitElement {\n\n    static shadowRootOptions: ShadowRootInit = {\n        ...LitElement.shadowRootOptions,\n        mode: \"open\"\n    }\n\n    @property( { type: String, reflect: false } )\n    public button: string = t(T.close);\n\n    protected dialogRef: Ref<HTMLDialogElement> = createRef();\n    protected closeButtonRef: Ref<HTMLButtonElement> = createRef();\n    protected invokerRef: Ref<HTMLSlotElement> = createRef();\n\n    @property({\n        type: Boolean, \n        reflect: true, \n        attribute: \"is-fullscreen\"\n    })\n    public isFullscreen: boolean = false;\n\n    @property( {type: String, reflect: true} )\n    public label?: string;\n\n    @property( { \n        type: Object\n    } )\n    public beforeClose?: () => Promise<boolean>;\n\n    @state()\n    private _open: boolean = false;\n\n    public get open(): boolean {\n        return this._open;\n    }\n\n    @property({\n        type: Object\n    })\n    public onCloseEveryTime?: () => void;\n\n    setClose() {\n        this.dialogRef.value?.close();\n        window.document.body.style.removeProperty(\"overflow-y\");\n        window.document.body.style.removeProperty( \"height\" );\n        this.removeAttribute(\"open\");\n        this._open = false;\n\n        if ( this.onCloseEveryTime ) {\n            this.onCloseEveryTime();\n        }\n    }\n\n    setOpen() {\n        this.dialogRef.value?.showModal();\n        window.document.body.style.overflowY = \"hidden\";\n        window.document.body.style.height = \"100vh\";\n        this.setAttribute(\"open\", \"true\");\n        this._open = true;\n    }\n\n    attributeChangedCallback(name: string, _old: string | null, value: string | null): void {\n\n        super.attributeChangedCallback( name, _old, value );\n\n        if ( name === \"open\") {\n\n            const val = value === \"true\";\n\n            if ( val ) {\n                this.setOpen();\n            } else {\n                this.setClose();\n            }\n\n        } \n\n    }\n\n    connectedCallback(): void {\n        super.connectedCallback();\n    }\n    \n    static styles = css`\n\n        :host {\n\n            display: contents;\n\n        }\n\n        .dialog {\n            background: var( --thermal-slate-light );\n            color: var( --thermal-foreground );\n            border-style: var( --thermal-border-style );\n            border-radius: var( --thermal-radius );\n            border-color: var( --thermal-slate );\n            border-width: var(--thermal-border-width);\n            padding: calc( var( --thermal-gap ) * 1.5 );\n            font-size: var( --thermal-fs-small );\n\n            &::backdrop {\n                backdrop-filter: blur(3px);\n            }\n\n            min-width: 150px;\n            box-sizing: border-box;\n\n            @media ( min-width: 300px ) {\n                min-width: 250px;\n            }\n\n            @media ( min-width: 600px ) {\n                min-width: 450px;\n            }\n        }\n\n        .dialog-header {\n            display: flex;\n            flex-wrap: nowrap;\n            justify-content: space-between; \n        }\n\n        .dialog-title {\n            margin: 0;\n            padding: 0;\n        }\n\n        .dialog-content {\n            padding: var( --thermal-gap ) 0;\n            white-space: normal;\n        }\n\n        .dialog-footer {\n\n            width: 100%;\n            display: flex;\n            justify-content: flex-end;\n            align-items: center;\n            gap: 10px;\n\n        }\n\n        \n\n        .dialog-close {\n\n            margin: 0;\n            padding: 0;\n            border: 0;\n            background: transparent;\n            color: var( --thermal-foreground );\n            cursor: pointer;\n\n            width: calc( var( --thermal-gap ) * 1.5);\n\n            &:hover {\n                color: var( --thermal-primary );\n            }\n        \n        }\n\n        :host([is-fullscreen=\"true\"][open]) .dialog {\n            width: 100vw;\n            height: 100vh;\n            overflow: hidden;\n            display: grid;\n            grid-template-rows: auto 1fr auto;\n\n            .dialog-content {\n                overflow: auto;\n            }\n        }\n\n        \n    \n    `;\n\n    render() {\n        return html`\n            <slot name=\"invoker\" ${ref( this.invokerRef )} @click=${this.setOpen}></slot>\n            <dialog ${ref( this.dialogRef )} class=\"dialog\">\n\n                <header class=\"dialog-header\">\n\n                    <h2 class=\"dialog-title\">${this.label}</h2>\n\n                    <button class=\"dialog-close\" ${ref( this.closeButtonRef )} @click=${this.setClose}>\n\n                            <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"size-6\">\n                                <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M6 18 18 6M6 6l12 12\" />\n                            </svg>\n\n                    </button>\n                \n                \n                </header>\n                \t\n                <div class=\"dialog-content\">\n                    ${this._open ? html`<slot name=\"content\"></slot>` : nothing}\n                </div>\n\n                <div class=\"dialog-footer\">\n                    <slot name=\"button\"></slot>\n                    <thermal-btn variant=\"foreground\" @click=${async() => {\n                        if ( this.beforeClose ) {\n                            const result = await this.beforeClose();\n                            if ( result ) {\n                                this.setClose();\n                            }\n                        } else {\n                            this.setClose();\n                        }\n                    }}>\n                        ${this.button}\n                    </thermal-btn>\n                </div>\n                \n            \n            </dialog>\n        `\n    }\n\n    public async closeFromTheOutside() {\n\n        if ( this.beforeClose ) {\n            const result = await this.beforeClose();\n            if ( result ) {\n                this.setClose();\n            }\n        } else {\n            this.setClose();\n        }\n\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"thermal-dialog\": ThermalDialogElement;\n    }\n}\n","import { computePosition, flip, inline, offset, shift } from \"@floating-ui/dom\";\nimport type { PropertyValueMap } from \"lit\";\nimport { LitElement, css, html } from \"lit\";\nimport { property, queryAssignedElements } from 'lit/decorators.js';\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport type { Ref } from \"lit/directives/ref.js\";\nimport { createRef, ref } from \"lit/directives/ref.js\";\nimport { AbstractThermalElement } from \"../hierarchy/AbstractThermalElement\";\nimport type { BtnSizes, BtnVariants } from \"./Btn\";\n\nexport class ThermalDropdownElement extends AbstractThermalElement {\n\n    static shadowRootOptions: ShadowRootInit = {\n        ...LitElement.shadowRootOptions,\n        // mode: \"open\"\n    }\n\n    @queryAssignedElements({ slot: 'option' })\n    _options!: Array<HTMLElement>;\n\n    protected dropdownRef: Ref<HTMLDialogElement> = createRef();\n    protected invokerRef: Ref<HTMLDialogElement> = createRef();\n    protected optionsRef: Ref<HTMLButtonElement> = createRef();\n\n    @property({ type: String, reflect: true })\n    public isOpen: string = \"close\";\n\n    @property({ type: String, reflect: true, attribute: true })\n    public interactive: \"on\" | \"off\" = \"on\";\n\n    @property({ type: String, reflect: true })\n    public variant?: BtnVariants;\n\n    @property({ type: String, reflect: true, attribute: true })\n    public size?: BtnSizes;\n\n    @property({ type: Boolean })\n    public plain?: boolean;\n\n    @property({ type: String, attribute: true })\n    public tooltip?: string;\n\n    @property({ type: String, reflect: true })\n    public icon?: string;\n\n    @property({ type: String, reflect: true })\n    public iconStyle?: string;\n\n    setOpen() {\n        this.isOpen = \"open\";\n    }\n\n    setClose() {\n        this.isOpen = \"close\";\n    }\n\n    toggle() {\n        if (this.interactive === \"off\") {\n            return;\n        }\n        if (this.isOpen === \"open\")\n            this.isOpen = \"close\";\n        else\n            this.isOpen = \"open\";\n    }\n\n    connectedCallback(): void {\n        super.connectedCallback();\n    }\n\n    disconnectedCallback(): void {\n        super.disconnectedCallback();\n    }\n\n    private placeOptions() {\n\n        if (!this.invokerRef.value || !this.optionsRef.value) {\n            return;\n        }\n\n        computePosition(this.invokerRef.value, this.optionsRef.value, {\n            middleware: [offset(2), flip(), inline(), shift()],\n            placement: \"bottom-start\",\n            strategy: \"fixed\"\n        })\n            .then(({ x, y }) => {\n\n                if (this.optionsRef.value) {\n                    this.optionsRef.value.style.left = `${x}px`;\n                    this.optionsRef.value.style.top = `${y}px`;\n                }\n\n            });\n\n    }\n\n    updated(_changedProperties: PropertyValueMap<this> | Map<PropertyKey, unknown>): void {\n        super.updated(_changedProperties);\n        if (_changedProperties.has(\"isOpen\")) {\n            this.placeOptions();\n        }\n\n    }\n\n    firstUpdated(_changedProperties: PropertyValueMap<this> | Map<PropertyKey, unknown>): void {\n        super.firstUpdated(_changedProperties);\n        this._options.forEach(option => {\n            option.childNodes.forEach(child => child.addEventListener(\"click\", () => {\n                this.setClose();\n            }));\n        });\n    }\n\n\n\n    attributeChangedCallback(name: string, _old: string | null, value: string | null): void {\n\n        super.attributeChangedCallback(name, _old, value);\n\n        if (name === \"isopen\") {\n            if (value === \"open\") {\n                this.optionsRef.value?.classList.add(\"dropdown-options__show\");\n                this.dropdownRef.value?.classList.add(\"dropdown__open\");\n            } else {\n                this.optionsRef.value?.classList.remove(\"dropdown-options__show\");\n                this.dropdownRef.value?.classList.remove(\"dropdown__open\");\n            }\n        }\n\n    }\n\n\n\n    static styles = css`\n\n        .mayNot {\n            opacity: .5;\n            cursor: not-allowed;\n        }\n\n        .dropdown {\n            width: max-content;\n        }\n\n        .dropdown-invoker {\n            width: max-content;\n            display: flex;\n        }\n\n        .dropdown-invoker-wrapper {\n            display: flex;\n            align-items: center;\n        }\n\n        .dropdown-invoker-wrapper-icon {\n            width: calc( var( --thermal-gap ) * .856 );\n            line-height: 0;\n            padding-left: calc( var( --thermal-gap ) * .5 );\n        }\n\n        .dropdown-options {\n\n            z-index: 9999;\n\n            width: max-content;\n            /** position: absolute; */\n            position: fixed;\n            top: 0;\n            left: 0;\n            \n            padding: 5px 10px;\n\n            border: var(--thermal-border-width) var(--thermal-border-style) var( --thermal-slate );\n            border-radius: var( --thermal-radius );\n\n            background-color: var( --thermal-slate-light );\n\n            box-shadow: var( --thermal-shadow );\n\n            display: none;\n\n            ::slotted( div:not(:last-child) ) {\n                margin-bottom: calc( var( --thermal-gap ) * .5 );\n            }\n\n        }\n\n        .dropdown-options__show {\n            display: block;\n        }\n\n        .clicker {\n            display: none;\n        }\n\n        .dropdown__open {\n        \n            .clicker {\n                z-index: 9998;\n                display: block;\n                position: fixed;\n                top: 0;\n                left: 0;\n                width: 100vw;\n                height: 100vh;\n            }\n        }\n\n        slot[name=\"option\"]::slotted(*) {\n\n            width: 100%;\n\n            margin-top: 5px;\n            margin-bottom: 5px;\n            width: 100%;\n\n        }\n\n\n    \n    `;\n\n    render() {\n\n        const invokerClasses = {\n            \"dropdown-invoker\": true,\n            may: this.interactive === \"on\",\n            mayNot: this.interactive === \"off\"\n        };\n\n        const disabled = this.interactive === \"off\";\n\n        return html`\n\n            <div class=\"dropdown\" ${ref(this.dropdownRef)}>\n                <thermal-btn \n                    ${ref(this.invokerRef)} \n                    class=\"${classMap(invokerClasses)}\" \n                    @click=${this.toggle.bind(this)} \n                    variant=${ifDefined(this.variant)}\n                    size=${ifDefined(this.size)}\n                    icon=\"${ifDefined(this.icon)}\"\n                    iconStyle=\"${ifDefined(this.iconStyle)}\"\n                    ?plain=${this.plain}\n                    ?disabled=${disabled}\n                    tooltip=\"${this.tooltip !== undefined ? this.tooltip : \"\"}\"\n                    part=\"invoker\"\n                >\n                    <div class=\"dropdown-invoker-wrapper\">\n                        <slot name=\"invoker\">\n                            <div>Dropdown</div>\n                        </slot>\n                        <div class=\"dropdown-invoker-wrapper-icon\">\n                        ${this.isOpen === \"close\"\n                ? html`<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n                                <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m19.5 8.25-7.5 7.5-7.5-7.5\" />\n                            </svg>`\n                : html`<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"size-6\">\n                                <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M6 18 18 6M6 6l12 12\" />\n                            </svg>`\n            }\n                        </div>\n                    </div>\n                </thermal-btn>\n                <div class=\"clicker\" @click=${this.setClose}></div>\n                <div class=\"dropdown-options\" ${ref(this.optionsRef)} >\n                    <slot name=\"option\"></slot>\n                </div>\n            \n            </div>\n        `;\n\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"thermal-dropdown\": ThermalDropdownElement;\n    }\n}\n","import type { CSSResultGroup} from \"lit\";\nimport { css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { AbstractThermalElement } from \"../hierarchy/AbstractThermalElement\";\n\nexport class ThermalDropinElement extends AbstractThermalElement {\n\n    @property({type: String})\n    public prompt?: string;\n\n    static styles?: CSSResultGroup | undefined = css`\n    \n        :host {\n            display: block;\n            box-sizing: border-box;\n\n            font-size: var(--thermal-fs);\n            color: var(--thermal-foreground);\n\n            \n\n            border: var(--thermal-border-width) var(--thermal-slate)var(--thermal-border-style);\n            border-radius: var(--thermal-radius);\n\n            transition: all .5s ease-in-out;\n\n            position: relative;\n            overflow: hidden;\n\n            cursor: pointer;\n            \n        }\n\n        .bg {\n            position: absolute;\n            width: 100%;\n            height: 100%;\n            top: 0;\n            left: 0;\n            transition: all .3s ease-in-out;\n\n            background: radial-gradient(circle, var(--thermal-slate-light) 0%, var(--thermal-slate) 100%);\n        }\n\n        .content {\n            position: relative;\n            z-index: 1;\n            width: 100%;\n            height: 100%;\n            display: flex;\n            align-items: center;\n            justify-content: center;\n\n            padding: var(--thermal-gap);\n            box-sizing: border-box;\n        }\n\n        :host {\n        \n            &:hover,\n            &:focus {\n            \n                .bg {\n                    transform: scale(1.05);\n                }\n            \n            }\n        \n        }\n\n        :host(:hover),\n        :host(:focus) {\n        \n            .bg {\n                transform: scale(1.05);\n            }\n\n        \n        }\n    \n    `;\n\n\n\n    protected render(): unknown {\n        return html`\n            <div class=\"bg\"></div>\n            <div class=\"content\">\n                <div>Thermal Dropin Component</div>\n            </div>\n        `;\n    }\n\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"thermal-dropin\": ThermalDropinElement;\n    }\n}\n","import type { CSSResultGroup } from \"lit\";\nimport { css, html, nothing } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { AbstractThermalElement } from \"../hierarchy/AbstractThermalElement\";\nimport type { BtnSizes, BtnVariants } from \"./Btn\";\n\nexport class ThermalExpandableElement extends AbstractThermalElement {\n\n    @property({ type: String})\n    public label?: string;\n\n    @property({ type: Boolean,attribute: \"close-icon\", reflect: true})\n    public closeIcon: boolean = false;\n\n    @property({ type: String, attribute: true, reflect: true })\n    public variant?: BtnVariants;\n\n    @property({ type: String, attribute: true, reflect: true})\n    public variantExpanded?: BtnVariants;\n\n    @property({ type: String, attribute: true, reflect: true })\n    public size?: BtnSizes;\n\n    @property({ type: String })\n    public icon?: string;\n\n    @property({ type: String })\n    public iconStyle: string = \"outline\";\n\n    @property({ type: Boolean, reflect: true })\n    public disabled: boolean = false;\n\n    @property({ type: Boolean, reflect: true, attribute: \"non-interactive\"})\n    public nonInteractive: boolean = false;\n\n    @property({ type: Boolean, attribute: true })\n    public plain: boolean = false;\n\n    @property({ type: String })\n    public tooltip?: string;\n\n    @property({ type: Boolean, reflect: true })\n    public expanded: boolean = false;\n\n    static styles?: CSSResultGroup | undefined = css`\n:host {\n    --color: var(--thermal-foreground);\n    --background: var(--thermal-slate-light);\n    --font-size: var(--thermal-fs);\n    --border-color: var(--thermal-slate);\n    --border-radius: var(--thermal-radius);\n    --display: block;\n    --position: relative;\n    --width: 100%;\n    --padding: var(--thermal-gap);\n    --spacing: var(--thermal-gap);\n    --box-shadow: none;\n\n    font-size: var(--font-size);\n    color: var(--color);\n}\n\naside.content {\n\n    display: none;\n    position: var(--position);\n\n    box-sizing: border-box;\n    width: var(--width);\n    box-sizing: border-box;\n\n    background: var(--background);\n    border: var(--thermal-border-width) var(--thermal-border-style) var(--border-color);\n    border-radius: var(--border-radius);\n    padding: var(--padding);\n    box-shadow: var(--box-shadow);\n\n}\n\n:host([expanded=\"true\"]) aside.content {\n    display: var(--display);\n    margin-top: var(--spacing);\n}\n\nthermal-icon {\n    display: inline-block;\n    width: 1em;\n    height: 1em;\n}\n`;\n\n    protected render(): unknown {\n\n        const variant = this.expanded && this.variantExpanded \n            ? this.variantExpanded \n            : this.variant;\n\n        return html`<thermal-btn\n    variant=${ifDefined( variant )}\n    size=${ifDefined( this.size )}\n    icon=${ifDefined( this.icon )}\n    iconStyle=${this.iconStyle}\n    ?disabled=${this.disabled}\n    ?plain=${this.plain}\n    tooltip=${ifDefined( this.tooltip )}\n    ?non-interactive=${this.nonInteractive}\n    @click=${() => this.expanded = !this.expanded}\n>${ifDefined(this.label)}${this.closeIcon && this.expanded ? html`<thermal-icon\n    icon=\"close\"\n    variant=\"micro\"\n></thermal-icon>` : nothing}</thermal-btn>\n<aside class=\"content\">\n    <slot></slot>\n</aside>\n`;\n\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"thermal-expandable\": ThermalExpandableElement;\n    }\n}\n","import { css, html, LitElement } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n\nexport class ThermalFieldElement extends LitElement {\n\n    @property({type: String})\n    public label!: string;\n\n    @property({type: String})\n    public hint?: string;\n\n    public static styles = css`\n    \n        :host {\n\n            display: table-row;\n            width: 100%;\n            font-size: var( --thermal-fs );\n\n        }\n\n        .cell {\n\n            display: table-cell;\n            padding: calc( var( --thermal-gap ) * .5 );\n        \n        }\n\n        .label {\n\n        }\n\n        .content {\n\n        }\n\n        .hint {\n            font-size: calc( var( --thermal-fs-sm ) * .75 );\n            padding-top: .5em;\n            opacity: .5;\n            max-width: 300px;\n        }\n\n    `;\n\n    protected render(): unknown {\n        return html`\n\n            <div class=\"cell\">${this.label}</div>\n\n            <div class=\"cell\">\n\n                <div class=\"content\">\n                    <slot></slot>\n                </div>\n\n                ${this.hint && html`\n                <div class=\"hint\">\n                    ${this.hint}\n                </div>`}\n\n            </div>\n        \n        `;\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"thermal-field\": ThermalFieldElement;\n    }\n}\n","import type { PropertyValues } from \"lit\";\nimport { html, nothing } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { unsafeSVG } from \"lit/directives/unsafe-svg.js\";\nimport { AbstractThermalElement } from \"../hierarchy/AbstractThermalElement\";\nimport icons from \"../utils/icons\";\n\n// Define the type for the icon factory functions\ntype IconFactory = Record<string, (classes?: string, css?: string) => string>;\n\nexport class ThermalIconElement extends AbstractThermalElement {\n\n\n    @property({ type: String, reflect: true })\n    public icon?: string;\n\n    @property({ type: String, reflect: true })\n    public variant?: string;\n\n    @property({ type: String, reflect: true })\n    public classes?: string;\n\n    @property({ type: String, reflect: true })\n    public css?: string;\n\n    @state()\n    protected element?: string;\n\n    connectedCallback(): void {\n        super.connectedCallback();\n\n        this.updateIcon();\n    }\n\n    updated(_changedProperties: PropertyValues): void {\n\n        super.updated(_changedProperties);\n        this.updateIcon();\n\n    }\n\n    protected updateIcon(): void {\n\n        if (\n            (this.icon === undefined || this.icon.trim() === \"\")\n            || (this.variant === undefined || this.variant.trim() === \"\")\n        ) {\n            this.element = undefined;\n            return;\n        } else {\n\n            const icon = this.icon && this.icon.trim() !== \"\"\n                ? this.icon\n                : false;\n            const factory = icons[icon as keyof typeof icons] as IconFactory;\n\n            if (factory) {\n\n                if (this.variant in factory) {\n                    const fn = factory[this.variant] as (classes?: string, css?: string) => string;\n                    this.element = fn(this.classes, this.css);\n                }\n\n            }\n\n        }\n\n    }\n\n    protected render(): unknown {\n\n        if (!this.element) {\n            return nothing;\n        } else {\n            return html`${unsafeSVG(this.element)}`;\n        }\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"thermal-icon\": ThermalIconElement;\n    }\n}\n","import type { CSSResultGroup, PropertyValues } from \"lit\";\nimport { css, html } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { AbstractThermalElement } from \"../hierarchy/AbstractThermalElement\";\n\nexport class ThermalPosterElement extends AbstractThermalElement {\n\n    @state()\n    protected loaded: boolean = false;\n\n    @property({ type: Boolean, reflect: true })\n    public loading: boolean = true;\n\n    @property({ type: String })\n    public icon?: string;\n\n    @property({ type: String })\n    public iconStyle?: string;\n\n    @property({ type: String })\n    public message?: string;\n\n    @property({ type: String })\n    public bordercolor: string = \"var(--thermal-slate)\";\n\n    @property({ type: String })\n    public bgcolor: string = \"var(--thermal-slate-light)\";\n\n    @property({ type: String })\n    public textcolor: string = \"var(--thermal-slate-dark)\";\n\n    protected updated(_changedProperties: PropertyValues): void {\n        super.updated(_changedProperties);\n        this.style.borderColor = this.bordercolor;\n        this.style.backgroundColor = this.bgcolor;\n        this.style.color = this.textcolor;\n    }\n\n    public static styles?: CSSResultGroup | undefined = css`\n    \n        :host {\n            font-size: var(--thermal-fs);\n            display: flex;\n            flex-direction: column;\n            align-items: center;\n            justify-content: center;\n            gap: .5em;\n            width: 100%;\n            min-height: 300px;\n\n            border: var(--thermal-border-width) dashed var(--thermal-slate);\n            border-radius: var(--thermal-radius);\n            \n            box-sizing: border-box;\n            padding: var(--thermal-gap);\n            color: var(--thermal-slate-dark);\n            background: var(--thermal-slate-light);\n            \n        }\n    \n    `;\n\n    protected render(): unknown {\n\n        const content = [];\n\n        if (this.loading) {\n            content.push(html`<thermal-spinner style=\"display: block\"></thermal-spinner>`);\n        } else {\n            content.push(html`<thermal-icon icon=\"${this.icon}\" variant=\"${this.iconStyle}\" style=\"height: 2em; aspect-ratio: 1 / 1; display: block;\"></thermal-icon>`);\n\n            if (this.message) {\n                content.push(html`<div>${this.message}</div>`);\n            }\n        }\n\n        content.push(html`<slot></slot>`);\n\n        return content;\n\n    }\n\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"thermal-loading\": ThermalPosterElement;\n    }\n}\n","import type { PropertyValues } from \"lit\";\nimport { css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { AbstractThermalElement } from \"../hierarchy/AbstractThermalElement\";\n\nexport class ThermalRadioElement extends AbstractThermalElement {\n\n    @property({ type: String, reflect: true })\n    public type: \"radio\" | \"checkbox\" = \"radio\";\n\n    @property({ type: Boolean, reflect: true })\n    public checked: boolean = false;\n\n    @property({ type: Function })\n    public onChange?: (checked: boolean) => void;\n\n    protected handleChange(event: Event): void {\n        const input = event.target as HTMLInputElement;\n        this.checked = input.checked;\n\n        if (this.onChange) {\n            this.onChange(this.checked);\n        }\n        \n        // Force re-render to update visual state\n        this.requestUpdate();\n    }\n\n    updated(changedProperties: PropertyValues<ThermalRadioElement>): void {\n        if (changedProperties.has('checked')) {\n            const input = this.shadowRoot?.querySelector('input') as HTMLInputElement;\n            if (input) {\n                input.checked = this.checked;\n            }\n        }\n    }\n\n    protected handleClick(event: Event): void {\n        event.preventDefault();\n        this.checked = !this.checked;\n        \n        if (this.onChange) {\n            this.onChange(this.checked);\n        }\n        \n        // Force re-render to update visual state\n        this.requestUpdate();\n    }\n\n    connectedCallback(): void {\n        super.connectedCallback();\n    }\n\n    public static styles = css`\n    \n        :host {\n            display: contents;\n            font-size: var(--thermal-fs);\n            color: var(--thermal-foreground);\n        }\n\n        .radio {\n\n            display: flex;\n            align-items: center;\n            gap: .25em;\n\n            cursor: pointer;\n\n            input,\n            span {\n                display: block;\n            }\n\n            span {\n                font-size: .8em;\n            }\n\n            input[type=\"radio\"] {\n                transform: translateY(-.15em);\n                pointer-events: none;\n            }\n        }\n\n        input {    \n            pointer-events: none;\n        }\n    \n    `;\n\n    render() {\n        return html`\n            <label class=\"radio\" @click=${this.handleClick}>\n                <input\n                    type=\"${this.type}\"\n                    checked=\"${this.checked}\"\n                />\n                <span><slot></slot></span>\n            </label>\n        `;\n    }\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"thermal-radio\": ThermalRadioElement;\n    }\n}\n","import { css, html, nothing } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { AbstractThermalElement } from \"../hierarchy/AbstractThermalElement\";\n\nexport class ThermalSlotElement extends AbstractThermalElement {\n\n    @property()\n    public label?: string;\n\n    @state()\n    private _slottedElements: Element[] = [];\n\n    protected get slottedElements() {\n        // Vrátí všechny děti tohoto elementu (obsah slotu)\n        return Array.from(this.children);\n    }\n\n    private handleSlotChange(e: Event) {\n        const slot = e.target as HTMLSlotElement;\n        this._slottedElements = slot.assignedElements();\n        this.requestUpdate();\n    }\n\n    public static styles = css`\n\n        :host {\n            font-size: var( --thermal-fs );\n        }\n    \n        h3 {\n\n            margin: 0 0 .5em 0;\n            padding: 0;\n            \n            font-weight: normal;\n            font-size: .7em;\n            text-transform: uppercase;\n\n            color: var(--thermal-slate);\n            \n            display: flex;\n            align-items: center;\n            gap: .5em;\n\n            &::after {\n                content: \"\";\n                flex: 1;\n                height: var(--thermal-border-width);\n                background: var(--thermal-slate-light);\n            }\n\n        }\n\n        .content {\n            display: flex;\n            flex-wrap: wrap;\n            gap: .5em;\n        }\n\n        :host(:hover) {\n            h3 {\n                color: var(--thermal-foreground);\n                &::after {\n                    background: var(--thermal-slate);\n                }\n            }\n\n\n        }\n    \n    `;\n\n\n    protected render(): unknown {\n\n        if ( this.slottedElements.length === 0 ) {\n            return nothing;\n        }\n\n        return html`<section>\n\n            ${this.label ? html`<h3>${this.label}</h3>` : nothing}\n            <div class=\"content\">\n                <slot @slotchange=${this.handleSlotChange}></slot>\n            </div>\n        </section>\n        `;\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"thermal-slot\": ThermalSlotElement;\n    }\n}\n","import { css, html, LitElement, nothing } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { AbstractThermalElement } from \"../hierarchy/AbstractThermalElement\";\n\nexport class ThermalSpinnerElement extends AbstractThermalElement {\n\n    @property({ type: String })\n    public message?: string;\n\n    @property({ type: String })\n    public color: string = \"var(--thermal-primary)\";\n\n    static shadowRootOptions: ShadowRootInit = {\n        ...LitElement.shadowRootOptions,\n        mode: \"open\"\n    }\n\n    static styles = css`\n        :host {\n            display: block;\n            width: 100%;\n            height: 100%;\n            position: relative;\n            text-align: center;\n        }\n        .spinner {\n            display: inline-block;\n            width: 50px;\n            height: 50px;\n            border: 5px solid var(--thermal-primary);\n            border-top-color: transparent;\n            border-radius: 50%;\n            animation: spin 1s linear infinite;\n        }\n        @keyframes spin {\n            0% {\n                transform: rotate(0deg);\n            }\n            100% {\n                transform: rotate(360deg);\n            }\n        }\n        .message {\n            margin-top: var(--thermal-gap);\n            color: var(--thermal-slate-dark);\n        }\n    `;\n    protected render() {\n        return html`\n            <div class=\"spinner\" style=\"border-color: ${this.color}; border-top-color: transparent;\"></div>\n            ${this.message ? html`<div class=\"message\">${this.message}</div>` : nothing}\n        `;\n    }\n\n    \n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"thermal-spinner\": ThermalSpinnerElement;\n    }\n}\n","import { css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { AbstractThermalElement } from \"../hierarchy/AbstractThermalElement\";\n\nexport class ThermalTipElement extends AbstractThermalElement {\n\n    @property({type: String})\n    public icon: string = \"bulb\";\n\n    @property({type: String})\n    public iconStyle: string = \"outline\";\n\n    static styles = css`\n:host {\n\n    --color: var(--thermal-foreground);\n    --background: var(--thermal-slate-light);\n    --font-size: var(--thermal-fs);\n    --border-color: var(--thermal-slate);\n    --icon-size: 1.5em;\n    --radius: var(--thermal-radius);\n    --padding: .5em;\n    --spacing: var(--thermal-gap);\n    --align-items: flex-start;\n\n    font-size: var(--font-size);\n    color: var(--color);\n    background: var(--background);\n    \n    border: var(--thermal-border-width) var(--thermal-border-style) var(--border-color);\n    border-radius: var(--radius);\n\n    width: 100%;\n    box-sizing: border-box;\n    padding: var(--padding);\n\n    display: flex;\n    align-items: var(--align-items);\n    gap: var(--spacing);\n\n}\n\nthermal-icon {\n    display: block;\n    width: var(--icon-size);\n    height: var(--icon-size);\n    color: var(--border-color);\n}\n\n:host( [variant=\"info\"] ) {\n    --background: #bed5fdff;\n    --color: #0e46a1;\n    --border-color: var(--color);\n}\n\n:host([variant=\"error\"]) {\n    --background: #e2b1b1ff;\n    --color: #a10e0e;\n    --border-color: var(--color);\n}\n`;\n\n\n    protected render(): unknown {\n        return html`<thermal-icon \n    icon=${this.icon} \n    variant=${this.iconStyle}\n></thermal-icon>\n<div class=\"tip-content\">\n    <slot></slot>\n</div>`;\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"thermal-tip\": ThermalTipElement;\n    }\n}\n","import type { ThermalManager } from \"@labirthermal/core\";\nimport { consume } from \"@lit/context\";\nimport { AbstractThermalElement } from \"../AbstractThermalElement\";\nimport type { ManagerController } from \"../../controllers/ManagerController\";\nimport { managerControllerContext } from \"../../controllers/ManagerController\";\n\n/**\n * A webcomponent consuming a `ThermalManager` exposed by a parent `ManagerController`.\n * \n * Subscribes to the `ManagerController` that is exposed by a parent. Typically, this can be either:\n * - a top-level app extending `AbstractApp` \n * - or a `ManagerProviderElement` nested lower within the component tree.\n * \n * For particular value access, this component can consume specialised contexts such as:\n * - `managerPaletteContext` for opacity values\n * - `managerAdvancedPaletteContext` for the actual thermal scale value\n * - `managerToolContext` for the starting value of the thermal scale\n * - etc.\n * \n * Whenever the value in any consumed context changes, this component will automatically update and rerender.\n * \n * If this component needs to manipulate the values, the recommanded way to do so is to use the methods of `ManagerController`.\n * \n * @see {@link ManagerController}\n * @see {@link ThermalManager}\n * \n * @example\n * ```js\nimport { AbstractManagerConsumer, managerPaletteContext } from \"@labirthermal/webcomponents\";\nimport { consume } from \"@lit/context\";\nclass MyComponent extends AbstractManagerConsumer {\n\n    // If the value changes in the context, this webcomponent will update\n    \\@consume({ context: managerToolContext, subscribe: true })\n    private toolValue!: ThermalTool;\n\n    // Set the tool value using the controller\n    private setTool(value: ThermalTool) {\n        this.managerController.setTool(value);\n    }\n\n    // Tool can also be set directly in the `ThermalManager`,\n    // but this is not recommended.\n    private setToolDirectly(value: ThermalTool) {\n        this.managerObject.tool.selectTool(value);\n    }\n\n}\n * ```\n * \n * @module \\@labirthermal/webcomponents\n * @author Jan Jáchim <jachim@zcu.cz>\n */\nexport abstract class AbstractManagerConsumer extends AbstractThermalElement {\n\n    /** Alias to the `ThermalManager` from the `ManagerController` */\n    public get managerObject(): ThermalManager {\n        return this.managerController.managerObject;\n    }\n\n    /**\n     * Inherited from the `ManagerController` context. This controller provides direct access to:\n     * - the `ThermalManager` instance\n     * - various methods to manipulate the manager's state\n     * @see {@link ManagerController}\n     * @see {@link ThermalManager}\n     */\n    @consume({ context: managerControllerContext, subscribe: true \n     })\n    public managerController!: ManagerController;\n\n}","import type { ThermalRegistry } from \"@labirthermal/core\";\nimport { consume } from \"@lit/context\";\nimport type { RegistryController } from \"../../controllers/RegistryController\";\nimport { registryControllerContext } from \"../../controllers/RegistryController\";\nimport { AbstractManagerConsumer } from \"./AbstractManagerConsumer\";\n\n/**\n * A webcomponent consuming a `ThermalRegistry` exposed by a parent `RegistryController`.\n * \n * Subscribes to the `RegistryController` that is exposed by a parent. Typically, this can be either:\n * - a top-level app extending `AbstractApp` \n * - or a `RegistryProviderElement` nested lower within the component tree.\n * \n * For particular value access, this component can consume specialised contexts such as:\n * - `registryOpacityContext` for opacity values\n * - `registryRangeToContext` for the actual thermal scale value\n * - `registryRangeFromContext` for the starting value of the thermal scale\n * - etc.\n * \n * Whenever the value in any consumed context changes, this component will automatically update and rerender.\n * \n * If this component needs to manipulate the values, the recommanded way to do so is to use the methods of `RegistryController`.\n * \n * @see {@link RegistryController}\n * @see {@link ThermalRegistry}\n * \n * @example\n * ```js\nimport { AbstractRegistryConsumer, registryOpacityContext } from \"@labirthermal/webcomponents\";\nimport { consume } from \"@lit/context\";\nclass MyComponent extends AbstractRegistryConsumer {\n\n    // If the value changes in the context, this webcomponent will update\n    \\@consume({ context: registryOpacityContext, subscribe: true })\n    private opacityValue!: number;\n\n    // Set the opacity calue using the controller\n    private setOpacityValue(value: number) {\n        this.registryController.setOpacity(value);\n    }\n\n    // Opacity can also be set directly in the `ThermalRegistry`,\n    // but this is not recommended.\n    private setOpacityValueDirectly(value: number) {\n        this.registryObject.opacity.setOpacity(value);\n    }\n\n}\n * ```\n * \n * @module \\@labirthermal/webcomponents\n * @author Jan Jáchim <jachim@zcu.cz>\n */\nexport abstract class AbstractRegistryConsumer extends AbstractManagerConsumer {\n\n    /** Alias to the `ThermalRegistry` from the `RegistryController` */\n    public get registryObject(): ThermalRegistry {\n        return this.registryController.registryObject;\n    }\n\n    /** \n     * Inherited `RegistryController` from the context. This controller provides a direct access to:\n     * - the @labirthermal/core `ThermalRegistry`\n     * - the properties and methods of `RegistryController` and the host\n     * @see {@link RegistryController}\n     * @see {@link ThermalRegistry}\n     */\n    @consume({ context: registryControllerContext, subscribe: true })\n    public registryController!: RegistryController;\n\n}","import type { ThermalGroup } from \"@labirthermal/core\";\nimport { consume } from \"@lit/context\";\nimport type {\n    GroupController\n} from \"../../controllers/GroupController\";\nimport {\n    groupControllerContext\n} from \"../../controllers/GroupController\";\nimport { AbstractRegistryConsumer } from \"./AbstractRegistryConsumer\";\n\n/**\n * A webcomponent consuming a `ThermalGroup` exposed by a parent `GroupController`.\n * \n * Subscribes to the `GroupController` that is exposed by a parent. Typically, this can be either:\n * - a top-level app extending `AbstractApp` \n * - or a `RegistryProviderElement` nested lower within the component tree.\n * \n * @see {@link GroupController}\n * @see {@link ThermalGroup}\n * \n * @example\n * ```js\nimport { AbstractGroupConsumer, registryOpacityContext } from \"@labirthermal/webcomponents\";\nimport { consume } from \"@lit/context\";\nclass MyComponent extends AbstractGroupConsumer {\n\n    // The `ThermalGroup` object does not have any value contexts\n    \n}\n * ```\n * \n * @module \\@labirthermal/webcomponents\n * @author Jan Jáchim <jachim@zcu.cz>\n */\nexport abstract class AbstractGroupConsumer extends AbstractRegistryConsumer {\n\n    /** Alias to the `ThermalGroup` object from the `groupController` */\n    public get groupObject(): ThermalGroup {\n        return this.groupController.groupObject;\n    }\n\n    /** \n     * Inherited `GroupController` from the context. This controller provides a direct access to:\n     * - the @labirthermal/core `ThermalGroup`\n     * - the properties and methods of `GroupController` and the host\n     * @see {@link GroupController}\n     * @see {@link ThermalGroup}\n     */\n    @consume({ context: groupControllerContext, subscribe: true })\n    groupController!: GroupController;\n\n}","import type { AbstractAnalysis, ThermalFileInstance, PlaybackSpeeds, ThermalFileFailure } from \"@labirthermal/core\";\nimport { html } from \"lit\";\nimport { AbstractGroupConsumer } from \"../consumers/AbstractGroupConsumer\";\nimport type { IElementWithFileController } from \"../../controllers/FileController\";\nimport { FileController } from \"../../controllers/FileController\";\n\nexport abstract class AbstractFileProvider extends AbstractGroupConsumer implements IElementWithFileController {\n\n    public static properties = {\n        ...FileController.HOST_PROPERTIES\n    };\n\n    public fileController: FileController = new FileController(this);\n\n    public file?: ThermalFileInstance;\n\n    public failure?: ThermalFileFailure;\n\n    /** Loading is managed and published by FileController, independently of file presence. */\n    public loading: boolean = false;\n\n    protected ready: boolean = false;\n\n    public ms: number = 0;\n\n    public playbackSpeed: PlaybackSpeeds = 1;\n\n    public recording: boolean = false;\n\n    public playing: boolean = false;\n\n    /** List of all analyses taken from the `ThermalFileInstance.analysis.layers.all` */\n    public analyses: AbstractAnalysis[] = [];\n\n\n    public analysis1?: string;\n    public analysis2?: string;\n    public analysis3?: string;\n    public analysis4?: string;\n    public analysis5?: string;\n    public analysis6?: string;\n    public analysis7?: string;\n\n    public autoHighlight: boolean = false;\n\n\n    /** Register instance callback listeners. @deprecated */\n    public recieveInstance(\n        instance: ThermalFileInstance\n    ) {\n\n        this.fileController.receiveInstance(instance);\n\n    }\n\n\n    /** @deprecated */\n    public removeInstance() {\n\n        this.fileController.removeInstance();\n\n    }\n\n\n    public deleteFile() {\n        if (this.file) {\n            this.removeInstance();\n        }\n    }\n\n\n    protected render(): unknown {\n        return html`\n            <slot></slot>\n            <slot name=\"mark\"></slot>\n            <slot name=\"analysis\"></slot>\n        `;\n    }\n\n}","import type { ThermalGroup } from \"@labirthermal/core\";\nimport { html } from \"lit\";\nimport { AbstractRegistryConsumer } from \"../consumers/AbstractRegistryConsumer\";\nimport type { IElementWithGroupController } from \"../../controllers/GroupController\";\nimport { GroupController } from \"../../controllers/GroupController\";\n\nexport abstract class AbstractGroupProvider extends AbstractRegistryConsumer implements IElementWithGroupController {\n\n    public static properties = {\n        ...GroupController.HOST_PROPERTIES,\n    };\n\n    public groupSlug!: string;\n\n    public groupController: GroupController = new GroupController(this)\n\n    public groupObject!: ThermalGroup;\n\n    public autoclearGroup: boolean = true;\n\n    protected render(): unknown {\n        return html`<slot></slot>`;\n    }\n\n}","import type { AvailableThermalPalette, ThermalManager, ThermalUnit } from \"@labirthermal/core\";\nimport { html } from \"lit\";\nimport type { IElementWithManagerController } from \"../../controllers/ManagerController\";\nimport { ManagerController } from \"../../controllers/ManagerController\";\nimport { AbstractThermalElement } from \"../AbstractThermalElement\";\nimport { removeManager } from \"../providers/getters\";\n\nexport abstract class AbstractManagerProvider extends AbstractThermalElement implements IElementWithManagerController {\n\n    public static properties = {\n        ...ManagerController.HOST_PROPERTIES\n    };\n\n    public managerSlug!: string;\n    public managerObject!: ThermalManager;\n    public managerController: ManagerController = new ManagerController(this);\n\n    public palette: AvailableThermalPalette = \"jet\";\n\n    public advancedPalettes: boolean = false;\n\n    public smoothThermograms: boolean = false;\n\n    public smoothGraph: boolean = false;\n\n    public tool!: keyof ThermalManager[\"tool\"][\"tools\"];\n\n    public autoclear: boolean = false;\n\n    public unit!: ThermalUnit;\n\n\n    disconnectedCallback(): void {\n        super.disconnectedCallback();\n\n        if (this.autoclear === true && this.managerObject !== undefined) {\n            removeManager(this.managerObject);\n        }\n    }\n\n    protected render(): unknown {\n        return html`<slot></slot>`;\n    }\n\n}","import type { ThermalRangeOrUndefined, ThermalRegistry } from \"@labirthermal/core\";\nimport { html } from \"lit\";\nimport { AbstractManagerConsumer } from \"../consumers/AbstractManagerConsumer\";\nimport type { IElementWithRegistryController } from \"../../controllers/RegistryController\";\nimport { RegistryController } from \"../../controllers/RegistryController\";\n\nexport abstract class AbstractRegistryProvider extends AbstractManagerConsumer implements IElementWithRegistryController {\n\n    public static properties = {\n        ...RegistryController.HOST_PROPERTIES,\n    };\n\n\n    registrySlug!: string;\n    registryObject!: ThermalRegistry;\n    registryController: RegistryController = new RegistryController(this);\n\n    public opacity: number = 1;\n\n    /** Current minimum temperature of the registry in Celsius. Set internally by `@labirthermal/core`. */\n    public min?: number;\n\n    /** Current maximum temperature of the registry in Celsius. Set internally by `@labirthermal/core`. */\n    public max?: number;\n\n    public from?: number;\n\n    public to?: number;\n\n    public loading: boolean = false;\n\n    public autoclear: boolean = false;\n\n    public highlight: ThermalRangeOrUndefined;\n\n    disconnectedCallback(): void {\n        super.disconnectedCallback();\n\n        if (this.autoclear === true && this.registryObject !== undefined) {\n            this.managerObject.registries.removeRegistry(this.registryObject.id);\n        }\n    }\n\n\n    protected render(): unknown {\n        return html`<slot></slot>`;\n    }\n\n\n}","import type { ThermalFileInstance, ThermalFileFailure } from \"@labirthermal/core\";\nimport { consume } from \"@lit/context\";\nimport { state } from \"lit/decorators.js\";\nimport type { FileController } from \"../../controllers/FileController\";\nimport { fileContext, fileControllerContext, fileFailureContext, fileLoadingContext, fileRecordingContext } from \"../../controllers/FileController\";\nimport { AbstractGroupConsumer } from \"./AbstractGroupConsumer\";\n\n/**\n * Abstract base class for web components that consume a file `ThermalFileInstance` and\n * related state from a parent `FileController`.\n *\n * The controller is typically provided by an ancestor application or file\n * provider. This class consumes the controller, current instance, loading and\n * recording states, and load failures. Subclasses can consume additional\n * contexts such as `fileMsContext` and `fileDurationContext` when needed.\n * Changes to subscribed contexts trigger reactive updates in the consuming\n * element.\n *\n * Use `FileController` methods for file operations such as changing the\n * playback position rather than modifying the instance directly.\n *\n * @see {@link AbstractGroupConsumer}\n * @see {@link FileController}\n * @see {@link ThermalFileInstance}\n *\n * @example\n * ```ts\n * import { consume } from \"@lit/context\";\n * import { AbstractFileConsumer, fileMsContext } from \"@labirthermal/webcomponents\";\n *\n * class MyComponent extends AbstractFileConsumer {\n *     @consume({ context: fileMsContext, subscribe: true })\n *     protected msValue!: number;\n *\n *     protected seekTo(percentage: number): void {\n *         this.fileController.setTimePercentage(percentage);\n *     }\n * }\n * ```\n *\n * @module \\@labirthermal/webcomponents\n * @author Jan Jáchim <jachim@zcu.cz>\n */\nexport abstract class AbstractFileConsumer extends AbstractGroupConsumer {\n\n    @consume({ context: fileControllerContext, subscribe: true })\n    public fileController!: FileController;\n\n    /**\n     * Returns a stable callback key unique to this consumer.\n     *\n     * @returns The consumer's UUID with an internal-callback suffix.\n     */\n    public getUUID() {\n        return `${this.UUID}__internal_callback`;\n    }\n\n    /** Consume the `FileController` context indicating whether the file is currently being loaded. */\n    @consume({ context: fileLoadingContext, subscribe: true })\n    @state()\n    protected fileIsLoading: boolean = false;\n\n    /** Consume the `FileController` context providing the actual file instance. */\n    @consume({ context: fileContext, subscribe: true })\n    @state()\n    public file?: ThermalFileInstance;\n\n    /** Consume the `FileController` context providing the failure information if the file loading fails. */\n    @consume({ context: fileFailureContext, subscribe: true })\n    @state()\n    protected failure?: ThermalFileFailure;\n\n    /** Consume the `FileController` context indicating whether the file is currently being recorded. */\n    @consume({ context: fileRecordingContext, subscribe: true })\n    @state()\n    protected fileIsRecording: boolean = false;\n\n\n\n    connectedCallback(): void {\n\n        super.connectedCallback();\n\n        // Add the callbacks to the parent file controller\n        this.hookCallbacks();\n\n    }\n\n    disconnectedCallback(): void {\n        super.disconnectedCallback();\n\n        // Remove the callbacks from the parent file controller\n        if ( this.fileController ) {\n            this.fileController.onSuccess.delete(this.UUID);\n            this.fileController.onFailure.delete(this.UUID);\n        }\n\n    }\n\n\n    /** Internal method binding the default callbacks to the parent `FileController`. */\n    private hookCallbacks() {\n\n        if ( this.fileController ) {\n\n            this.fileController.onSuccess.set(\n                this.UUID,\n                instance => {\n                    this.onInstanceCreated(instance);\n                }\n            );\n\n            this.fileController.onFailure.set(\n                this.UUID,\n                error => {\n                    this.onFailure(error);\n                }\n            );\n\n        } else {\n            throw new Error(\"Tento komponent není v souboru!\");\n        }\n    }\n\n\n    /**\n     * Handles a file instance after the parent `FileController` has loaded it\n     * successfully.\n     *\n     * @param instance The successfully loaded file instance.\n     */\n    public abstract onInstanceCreated(instance: ThermalFileInstance): void;\n\n    /**\n     * Handles a failure reported by the parent `FileController` while loading\n     * a file.\n     *\n     * @param error Details of the file-loading failure.\n     */\n    public abstract onFailure(error: ThermalFileFailure): void;\n\n}","import { css, html } from \"lit\";\nimport { version } from \"../../../package.json\";\nimport { AbstractThermalElement } from \"../../hierarchy/AbstractThermalElement\";\n\nexport class AppInfoButton extends AbstractThermalElement {\n\n    static styles = css`\n\n        .content {\n            color: var( --thermal-foreground );\n        }\n\n        hr {\n            border-top-color: currentcolor;\n            border-bottom-width: 0;\n        }\n\n        small {\n            opacity: .5;\n        }\n\n        a {\n            color: var( --thermal-primary );\n        }\n\n        .logo {\n            max-width: 200px;\n            margin: 0 auto;\n            padding: var( --thermal-gap ) 0;\n            svg {\n                width: 100%;\n                height: auto;\n            }\n        }\n\n        .row {\n\n            &:not(:last-child) {\n                padding-bottom: var( --thermal-gap );\n                padding-top: var( --thermal-gap );\n            }\n        \n        }\n\n        @media ( min-width: 700px ) {\n            .row {\n\n                display: flex;\n                flex-wrap: wrap;\n\n                margin: 0 calc( var( --thermal-gap ) * -1 );\n\n                & > div {\n\n                    box-sizing: border-box;\n                    width: 50%;\n                    padding: 0 var( --thermal-gap );\n\n                }\n            \n            }\n        \n        }\n    \n    `;\n\n    protected render(): unknown {\n        return html`\n            <thermal-dialog label=\"Thermal images in the browser\">\n                <thermal-btn slot=\"invoker\">About</thermal-btn>\n                <div slot=\"content\">\n                    <div class=\"content\">\n                        <div class=\"logo\">\n                            <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"531.66\" height=\"166.67\" viewBox=\"0 0 531.66 166.67\">\n                                <g id=\"Vrstva_2\" data-name=\"Vrstva 2\">\n                                    <g id=\"Podkres\">\n                                        <path\n                                            d=\"M286.47,78.12c-1.77-1.54-4.43-2.32-8-2.32H261.56V95.59H278.5c3.54,0,6.2-.78,8-2.36s2.66-4.14,2.66-7.68S288.25,79.66,286.47,78.12Z\" \n                                            fill=\"currentcolor\"\n                                            />\n                                        <path\n                                            d=\"M262,0,186,29.54h-.21V166.67h152V29.54H338ZM232.52,134.09H217.06V63.79h15.46Zm58.68,0a27.45,27.45,0,0,1-1.58-8c-.19-3.08-.49-6-.88-8.86-.53-3.67-1.64-6.36-3.35-8.07s-4.5-2.56-8.37-2.56H261.56v27.47H246.11V63.79H284a22.61,22.61,0,0,1,8.52,1.53A19.8,19.8,0,0,1,299,69.5a18.2,18.2,0,0,1,4.13,6.16,19.75,19.75,0,0,1,1.43,7.53A21.14,21.14,0,0,1,302,93.92a16.37,16.37,0,0,1-8.52,6.89v.2a11.89,11.89,0,0,1,4.73,2.41,13.28,13.28,0,0,1,3.05,3.84,17.8,17.8,0,0,1,1.72,4.87,42.51,42.51,0,0,1,.74,5.32c.07,1.12.13,2.43.2,3.94s.18,3,.35,4.63a30.6,30.6,0,0,0,.78,4.47,10.2,10.2,0,0,0,1.63,3.6Z\"\n                                            fill=\"currentcolor\"\n                                         />\n                                        <path d=\"M414,63.79v13H376.89V91.85H411v12H376.89v17.23H414.8v13H361.43V63.79Z\" fill=\"currentcolor\" />\n                                        <path\n                                            d=\"M459.89,127.59a14.43,14.43,0,0,1-6.45,6,23.53,23.53,0,0,1-19.05-.4,20,20,0,0,1-7.14-6,27.21,27.21,0,0,1-4.23-8.72,36.59,36.59,0,0,1-1.43-10.23A34.4,34.4,0,0,1,423,98.3a25.75,25.75,0,0,1,4.23-8.42,20.53,20.53,0,0,1,16.89-8.07,20,20,0,0,1,8.61,1.92,15,15,0,0,1,6.45,5.66h.2V63.79h14v70.3H460.09v-6.5Zm-.59-25.15a14.68,14.68,0,0,0-2-5.12,11.34,11.34,0,0,0-3.69-3.6,10.83,10.83,0,0,0-5.71-1.38,11.33,11.33,0,0,0-5.81,1.38,10.93,10.93,0,0,0-3.79,3.64,16.39,16.39,0,0,0-2.07,5.17,27.93,27.93,0,0,0-.64,6.06,25.91,25.91,0,0,0,.69,5.91,16,16,0,0,0,2.22,5.26,12,12,0,0,0,3.84,3.74,10.29,10.29,0,0,0,5.56,1.43,11.12,11.12,0,0,0,5.76-1.38,10.36,10.36,0,0,0,3.69-3.69,16.42,16.42,0,0,0,2-5.27,31.24,31.24,0,0,0,.59-6.1A30.51,30.51,0,0,0,459.3,102.44Z\" fill=\"currentcolor\" />\n                                        <path\n                                            d=\"M518.37,134.09V127h-.29a15.75,15.75,0,0,1-6.9,6.4,20.37,20.37,0,0,1-8.66,2,24.39,24.39,0,0,1-9.21-1.48,13.32,13.32,0,0,1-5.66-4.18,16.59,16.59,0,0,1-2.9-6.6,40.82,40.82,0,0,1-.84-8.61V83.19h14v28.75q0,6.3,2,9.4t7,3.1q5.72,0,8.27-3.4t2.56-11.17V83.19h14v50.9Z\" fill=\"currentcolor\"/>\n                                        <path d=\"M15.46,63.79v57.3H49.72v13H0V63.79Z\" fill=\"currentcolor\"/>\n                                        <path\n                                            d=\"M56.32,98.84a16.13,16.13,0,0,1,2.46-8.17,16.77,16.77,0,0,1,5.51-5.22,23.86,23.86,0,0,1,7.53-2.8,42.71,42.71,0,0,1,8.42-.84,57.28,57.28,0,0,1,7.78.54,23.87,23.87,0,0,1,7.19,2.12,14.2,14.2,0,0,1,5.31,4.38,12.23,12.23,0,0,1,2.07,7.43v26.49a53.68,53.68,0,0,0,.39,6.59,12.18,12.18,0,0,0,1.38,4.73H90.18a21.91,21.91,0,0,1-.64-2.41,20.76,20.76,0,0,1-.34-2.51A18.29,18.29,0,0,1,81.32,134a31.55,31.55,0,0,1-9.25,1.38,25,25,0,0,1-6.79-.89,15.64,15.64,0,0,1-5.52-2.75A13,13,0,0,1,56.07,127a15.91,15.91,0,0,1-1.33-6.79,14.81,14.81,0,0,1,1.53-7.14,12.72,12.72,0,0,1,3.94-4.48,17.47,17.47,0,0,1,5.51-2.51A58.91,58.91,0,0,1,72,104.75q3.15-.5,6.2-.79a36.91,36.91,0,0,0,5.42-.89,9.35,9.35,0,0,0,3.74-1.72,3.79,3.79,0,0,0,1.28-3.3,7.44,7.44,0,0,0-.74-3.59,5.45,5.45,0,0,0-2-2.07,7.7,7.7,0,0,0-2.85-1,22.69,22.69,0,0,0-3.5-.25,10.63,10.63,0,0,0-6.5,1.77c-1.57,1.19-2.49,3.15-2.75,5.91Zm32.29,10.34a6.25,6.25,0,0,1-2.22,1.23,22.33,22.33,0,0,1-2.85.74c-1,.2-2.09.36-3.2.49s-2.23.3-3.35.49a25.6,25.6,0,0,0-3.1.79,9.21,9.21,0,0,0-2.66,1.33,6.34,6.34,0,0,0-1.82,2.12,6.78,6.78,0,0,0-.69,3.25,6.61,6.61,0,0,0,.69,3.15,5.25,5.25,0,0,0,1.87,2,7.85,7.85,0,0,0,2.76,1,17.31,17.31,0,0,0,3.25.29,12.37,12.37,0,0,0,6.4-1.37,9.19,9.19,0,0,0,3.34-3.3,10.36,10.36,0,0,0,1.33-3.89,25.55,25.55,0,0,0,.25-3.15Z\" fill=\"currentcolor\"/>\n                                        <path\n                                            d=\"M127.4,63.79v25.6h.2a15,15,0,0,1,6.94-5.76,23.54,23.54,0,0,1,9.1-1.82A19.34,19.34,0,0,1,158,88.21a24.53,24.53,0,0,1,4.87,8.32,34.8,34.8,0,0,1,1.87,12.06,34.8,34.8,0,0,1-1.87,12.06A24.62,24.62,0,0,1,158,129a19.44,19.44,0,0,1-14.33,6.4,26.9,26.9,0,0,1-10-1.77,12.8,12.8,0,0,1-6.69-6h-.2v6.5H113.42V63.79ZM150,102.48a16.35,16.35,0,0,0-2.16-5.21,11.52,11.52,0,0,0-3.69-3.6,11.41,11.41,0,0,0-10.69,0,11.28,11.28,0,0,0-3.74,3.6,16.13,16.13,0,0,0-2.16,5.21,27.23,27.23,0,0,0-.69,6.21,26.72,26.72,0,0,0,.69,6.1,16.09,16.09,0,0,0,2.16,5.22,11.15,11.15,0,0,0,3.74,3.59,11.41,11.41,0,0,0,10.69,0,11.38,11.38,0,0,0,3.69-3.59,16.32,16.32,0,0,0,2.16-5.22,26.72,26.72,0,0,0,.69-6.1A27.23,27.23,0,0,0,150,102.48Z\" fill=\"currentcolor\" />\n                                    </g>\n                                </g>\n                            </svg>\n                    </div>\n                    \n                    <div style=\"text-align: center\">\n                        <p>A webapp reading thermal images from infrared cameras TIMI Edu.</p>\n                        <p>version ${version}</p>\n                    </div>\n\n\n                    <hr />\n\n                    <div class=\"row\">\n\n                        <div>\n                            <h3>Source code</h3>\n                            <p>\n                                <a href=\"https://github.com/moichim/labir\" target=\"_blank\">github.com/moichim/labir</a>\n                            </p>\n                        </div>\n\n\n                        <div>\n                            <h3>Authors</h3>\n                            <p>The code is being developed by the <a href=\"https://irt.zcu.cz/\" target=\"_blank\">Infrared technologies</a> research team at <a href=\"https://ntc.zcu.cz\" target=\"_blank\">NTC UWB</a> in Pilsen.</p>\n                        </div>\n\n                    </div>\n                </div>\n                </div>\n            </thermal-dialog>\n\n        `\n    }\n\n}","import { consume } from \"@lit/context\";\nimport { t } from \"i18next\";\nimport type { CSSResultGroup} from \"lit\";\nimport { css, html } from \"lit\";\nimport { state } from \"lit/decorators.js\";\nimport { AbstractThermalElement } from \"../../hierarchy/AbstractThermalElement\";\nimport type { ManagerController} from \"../../controllers/ManagerController\";\nimport { managerControllerContext } from \"../../controllers/ManagerController\";\nimport { managerAdvancedPalettesContext } from \"../../controllers/ManagerController\";\nimport { T } from \"../../translations/Languages\";\n\nexport class DisplayPanel extends AbstractThermalElement {\n\n    static styles?: CSSResultGroup | undefined = css`\n    \n        :host {\n            display: contents;\n        }\n    \n    `;\n\n    @consume({ context: managerAdvancedPalettesContext, subscribe: true })\n    @state()\n    advancedPalettes: boolean = false;\n\n    @consume({ context: managerControllerContext, subscribe: true })\n    @state()\n    managerController!: ManagerController;\n\n\n    protected render(): unknown {\n        return html`\n        <thermal-field label=\"${t(T.colourpalette)}\" hint=\"Zvolte, jaké chcete používat palety.\">\n            <thermal-btn-group>\n                <thermal-btn \n                    variant=\"${!this.advancedPalettes ? 'foreground' : 'default'}\"\n                    @click=${() => this.managerController.setAdvancedPalettes( false )}\n                    tooltip=\"IRON, JET, White hot, Black hot\"\n                >Základní</thermal-btn>\n                <thermal-btn \n                    variant=\"${this.advancedPalettes ? 'foreground' : 'default'}\"\n                    @click=${() => this.managerController.setAdvancedPalettes( true )}\n                    tooltip=\"Všechny dostupné palety\"\n                >Pokročilé</thermal-btn>\n            </thermal-btn-group>\n        </thermal-field>\n        <thermal-field label=\"${t(T.filerendering)}\" hint=\"${t(T.filerenderinghint)}\">\n            <manager-image-smooth-switch></manager-image-smooth-switch>\n        </thermal-field>\n        <thermal-field label=\"${t(T.graphlines)}\" hint=\"${t(T.graphlineshint)}\">\n            <manager-graph-smooth-switch></manager-graph-smooth-switch>\n        </thermal-field>\n        `;\n    }\n\n\n}","import { html } from \"lit\";\nimport { AbstractThermalElement } from \"../../hierarchy/AbstractThermalElement\";\n\nexport class ConfigDialog extends AbstractThermalElement {\n\n\n    protected render(): unknown {\n        return html`<thermal-dialog\n            label=\"Nastavení aplikace\"\n        >\n            <thermal-btn \n                slot=\"invoker\"\n                icon=\"settings\"\n                iconStyle=\"solid\"\n                tooltip=${this.t( \"config\" )}\n            ></thermal-btn>\n\n            <div slot=\"content\">\n                <manager-export-panel></manager-export-panel>\n                <display-panel></display-panel>\n            </div>\n        </thermal-dialog>`;\n    }\n\n\n\n}","import type { AvailableThermalPalette, ThermalFileInstance, PlaybackSpeeds, ThermalFileFailure, ThermalGroup, ThermalManager, ThermalRangeOrUndefined, ThermalRegistry, ThermalUnit } from \"@labirthermal/core\";\nimport type { CSSResultGroup, PropertyValues } from \"lit\";\nimport { css, html, nothing } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { AbstractThermalElement } from \"../AbstractThermalElement\";\nimport type { IElementWithFileController } from \"../../controllers/FileController\";\nimport { FileController } from \"../../controllers/FileController\";\nimport type { IElementWithGroupController } from \"../../controllers/GroupController\";\nimport { GroupController } from \"../../controllers/GroupController\";\nimport type { IElementWithManagerController} from \"../../controllers/ManagerController\";\nimport { ManagerController } from \"../../controllers/ManagerController\";\nimport type { IElementWithRegistryController} from \"../../controllers/RegistryController\";\nimport { RegistryController } from \"../../controllers/RegistryController\";\n\n/** \n * This element creates a completely isolated hierarchy tree for the given original file. The file is copied and all contexts are exposed independently of the original context.\n * \n * This element therefore implements all the hierarchy controllers, because the context is completely isolated from the parent:\n * - `ManagerController` and `ThermalManager`\n * - `RegistryController` and `ThermalRegistry`\n * - `GroupController` and `ThermalGroup`\n * - `FileController` and `ThermalFileInstance`\n * \n * @tag file-copy\n * \n * @param originalFile The original file instance to be copied.\n * @param withAnalyses Whether to copy the analyses from the original file.\n * \n * Initialisation of this element does not require any specification of slugs - they will be automatically generated from the original file.\n * \n * Whenever this element is disconnected, all the internal context is removed for good.\n * \n * @example\n * <file-copy .originalFile=\"path/to/original/file\">\n *  <file-canvas></file-canvas>\n * </file-copy>\n * \n * @module \\@labirthermal/webcomponents\n * @author Jan Jáchim <jachim@zcu.cz>\n * \n */\nexport class FileCopyElement \nextends AbstractThermalElement \nimplements \n    IElementWithManagerController, \n    IElementWithRegistryController, \n    IElementWithGroupController, \n    IElementWithFileController \n{\n\n    public static properties = {\n        ...ManagerController.HOST_PROPERTIES,\n        ...RegistryController.HOST_PROPERTIES,\n        ...GroupController.HOST_PROPERTIES,\n        ...FileController.HOST_PROPERTIES\n    };\n\n    @property({\n        type: Object,\n        attribute: false\n    })\n    public originalFile!: ThermalFileInstance;\n\n    /** Mirror the analyses of the original file to the copy. Changing the value at runtime copies or clears the analyses. */\n    @property({\n        type: Boolean,\n        attribute: false\n    })\n    public withAnalyses: boolean = true;\n\n    managerSlug!: string;\n    managerObject!: ThermalManager;\n    managerController: ManagerController = new ManagerController(this);\n    palette!: AvailableThermalPalette;\n    advancedPalettes: boolean = true;\n    smoothThermograms: boolean = false;\n    smoothGraph: boolean = false;\n    tool: string = \"edit\";\n    unit!: ThermalUnit;\n\n    registrySlug!: string;\n    registryObject!: ThermalRegistry;\n    registryController: RegistryController = new RegistryController(this);\n    opacity: number = 1;\n    /** Current minimum temperature of the registry in Celsius. Set internally by `@labirthermal/core`. */\n    min?: number | undefined;\n    /** Current maximum temperature of the registry in Celsius. Set internally by `@labirthermal/core`. */\n    max?: number | undefined;\n    from?: number | undefined;\n    to?: number | undefined;\n    highlight?: ThermalRangeOrUndefined;\n    loading: boolean = false;\n\n    groupSlug!: string;\n    groupObject!: ThermalGroup;\n    groupController: GroupController = new GroupController(this);\n    autoclearGroup: boolean = true;\n\n    fileController: FileController = new FileController(this);\n    file?: ThermalFileInstance | undefined;\n    failure?: ThermalFileFailure | undefined;\n    ms: number = 0;\n    playbackSpeed: PlaybackSpeeds = 1;\n    analysis1?: string | undefined;\n    analysis2?: string | undefined;\n    analysis3?: string | undefined;\n    analysis4?: string | undefined;\n    analysis5?: string | undefined;\n    analysis6?: string | undefined;\n    analysis7?: string | undefined;\n    autoHighlight: boolean = false;\n\n    @state()\n    private _canRenderChildren: boolean = false;\n\n\n\n\n\n    private _slugBase!: string;\n    private getSlugManager(): string { return this._slugBase + \"__copy-manager\"; }\n    private getSlugRegistry(): string { return this._slugBase + \"__copy-registry\"; }\n    private getSlugGroup(): string { return this._slugBase + \"__copy-group\"; }\n\n    connectedCallback(): void {\n\n        const originalFile = this.originalFile;\n\n        const slugBase = originalFile.thermalUrl + \"__\" + this.UUID;\n        this._slugBase = slugBase;\n\n        // Force override all slugs\n        this.setAttribute(\"manager-slug\", this.getSlugManager());\n        this.setAttribute(\"group-slug\", this.getSlugGroup());\n        this.setAttribute(\"registry-slug\", this.getSlugRegistry());\n\n        // Sync manager properties\n        this.palette = this.originalFile.group.registry.manager.palette.value;\n        this.opacity = this.originalFile.group.registry.opacity.value;\n        this.unit = this.originalFile.group.registry.manager.unit.value;\n\n        // Sync registry and group properties\n\n        // Sync file properties\n        this.ms = originalFile.timeline.currentMs;\n        if (this.withAnalyses) {\n            this.copyAnalysesFromParent();\n        }\n\n        // Now we shall create all internal objects based on the original file\n        super.connectedCallback();\n\n        this.originalFile.reader\n            .createInstance(this.groupObject)\n            .then(copiedInstance => {\n\n                if (! this.isConnected) return;\n\n                this.registryObject.postLoadedProcessing();\n                this.fileController.receiveInstance(copiedInstance);\n\n                const range = originalFile.group.registry.range.value;\n                if ( range ) this.registryObject?.range.imposeRange( range );\n\n                this._canRenderChildren = true;\n\n            });\n\n    }\n\n    disconnectedCallback(): void {\n        super.disconnectedCallback();\n        this._canRenderChildren = false;\n        this.fileController.removeInstance();\n        this.registryController.removeGroup(this.groupObject);\n        this.managerObject.registries.removeRegistry(this.registryObject.id);\n        window.Thermal.managers.delete(this.managerSlug);\n    }\n\n    /** Take the current analyses of the original file. The file controller propagates them to the copied file. */\n    public copyAnalysesFromParent(): void {\n        const slots = this.originalFile.slots;\n        this.analysis1 = slots.getSlot(1)?.serialized;\n        this.analysis2 = slots.getSlot(2)?.serialized;\n        this.analysis3 = slots.getSlot(3)?.serialized;\n        this.analysis4 = slots.getSlot(4)?.serialized;\n        this.analysis5 = slots.getSlot(5)?.serialized;\n        this.analysis6 = slots.getSlot(6)?.serialized;\n        this.analysis7 = slots.getSlot(7)?.serialized;\n    }\n\n    /** Remove all analyses from the copied file. */\n    public clearAnalyses(): void {\n        this.analysis1 = undefined;\n        this.analysis2 = undefined;\n        this.analysis3 = undefined;\n        this.analysis4 = undefined;\n        this.analysis5 = undefined;\n        this.analysis6 = undefined;\n        this.analysis7 = undefined;\n    }\n\n    updated(_changedProperties: PropertyValues<FileCopyElement>): void {\n        super.updated(_changedProperties);\n\n        // Skip the initial value - the connected callback has already handled it\n        if (_changedProperties.has(\"withAnalyses\") && _changedProperties.get(\"withAnalyses\") !== undefined) {\n            if (this.withAnalyses) this.copyAnalysesFromParent();\n            else this.clearAnalyses();\n        }\n    }\n\n    static styles?: CSSResultGroup | undefined = css`\n    \n        :host,\n        registry-provider,\n        group-provider {\n            display: contents;\n        }\n\n    `;\n\n\n    protected render(): unknown {\n        return html`${this._canRenderChildren ? html`<slot></slot>` : nothing}`;\n    }\n\n\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"file-copy\": FileCopyElement;\n    }\n}","import { AbstractFileProvider } from \"../abstraction/AbstractFileProvider\";\nimport type { IElementWithFileLoadController } from \"../../controllers/FileLoadController\";\nimport { FileLoadController } from \"../../controllers/FileLoadController\";\n\n/** \n * A webcomponent providing the file that is specified by its URL's.\n * \n * Exterior attributes are:\n * - `thermal`: the thermal file URL\n * - `visible`: the visible file URL\n * These are specified by the `FileLoadController` that is implemented here.\n * \n * All the standard contexts of `FileController` are being handled by the `AbstractFileProvider`.\n * \n * @tag file-provider\n * \n * @param thermal The URL of the thermal file.\n * @param visible The URL of the visible file.\n * \n * @example \n * <file-provider thermal=\"path/to/thermal/file\" visible=\"path/to/visible/file\">\n *  <file-canvas></file-canvas>\n * </file-provider>\n *\n * @module \\@labirthermal/webcomponents\n * @author Jan Jáchim <jachim@zcu.cz>\n */\nexport class FileProviderElement extends AbstractFileProvider implements IElementWithFileLoadController {\n\n    public static properties = {\n        ...AbstractFileProvider.properties,\n        ...FileLoadController.HOST_PROPERTIES\n    }\n\n    public fileLoadController: FileLoadController = new FileLoadController(this);\n\n    public thermal: string | undefined;\n    public visible: string | undefined;\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"file-provider\": FileProviderElement;\n    }\n}","import { AbstractGroupProvider } from \"../abstraction/AbstractGroupProvider\";\n\nexport class GroupProviderElement extends AbstractGroupProvider {}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"group-provider\": GroupProviderElement;\n    }\n}","import { AbstractManagerProvider } from \"../abstraction/AbstractManagerProvider\";\n\nexport class ManagerProviderElement extends AbstractManagerProvider {}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"manager-provider\": ManagerProviderElement;\n    }\n}","import { AbstractRegistryProvider } from \"../abstraction/AbstractRegistryProvider\";\n\nexport class RegistryProviderElement extends AbstractRegistryProvider {}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"registry-provider\": RegistryProviderElement;\n    }\n}","import { consume } from \"@lit/context\";\nimport { t } from \"i18next\";\nimport type { CSSResultGroup, PropertyValues } from \"lit\";\nimport { css, html, nothing } from \"lit\";\nimport { state } from \"lit/decorators.js\";\nimport { AbstractThermalElement } from \"../../hierarchy/AbstractThermalElement\";\nimport type { ConfigController } from \"../../controllers/ConfigController\";\nimport { configContext } from \"../../controllers/ConfigController\";\nimport { T } from \"../../translations/Languages\";\n\nexport class ManagerExportPanel extends AbstractThermalElement {\n\n    @state()\n    @consume({ context: configContext, subscribe: true })\n    protected configController?: ConfigController;\n\n\n\n    protected renderRow(\n        label: string,\n        content: ReturnType<typeof html>,\n        hint?: ReturnType<typeof html> | string\n    ) {\n        return html`<thermal-field label=\"${label}\">\n                <div>${content}</div>\n                ${hint ? hint : nothing}\n            </thermal-field>`;\n    }\n\n    protected renderGroup(\n        label: string,\n        content: ReturnType<typeof html>,\n    ) {\n        return html`<fieldset>\n            <legend>${label}</legend>\n            ${content}\n        </fieldset>`;\n    }\n\n    protected formatTip(\n        value?: ReturnType<typeof html> | string,\n    ) {\n        return value ? html`<div class=\"hint\">${value}</div>` : \"\";\n    }\n\n    protected renderCheckbox(\n        key: string,\n        label: string,\n        value: boolean,\n        onChange: (value: boolean) => void\n    ) {\n        const content = html`<input name=\"${key}\" type=\"checkbox\" ?checked=\"${value}\" @input=${(event: InputEvent) => {\n            const target = event.target as HTMLInputElement;\n            const value = target.checked;\n            onChange(value);\n        }}>`;\n        return html`<div>${content}<label for=\"${key}\">${label}</label></div>`;\n    }\n\n    protected renderSlider(\n        key: string,\n        label: string,\n        value: number,\n        unit: string,\n        min: number,\n        max: number,\n        step: number,\n        onChange: (value: number) => void,\n        hint?: ReturnType<typeof html> | string\n\n    ) {\n\n        const content = html`<input \n                name=\"${key}\"\n                value=\"${value}\"\n                min=\"${min}\"\n                max=\"${max}\"\n                step=\"${step}\"\n                type=\"range\"\n                @input=\"${(event: { target: { value: string } }) => {\n                const value = Math.min(max, Math.max(0, parseFloat(event.target.value)));\n                onChange(value);\n            }}\"\n            ></input>`;\n\n        const help = html`<strong>${value} ${unit}</strong> (${min} - ${max} ${unit})${hint ? \"<br />\" + hint : \"\"}`;\n        const tip = this.formatTip(help);\n\n        return this.renderRow(label, content, tip);\n    }\n\n\n\n    static styles?: CSSResultGroup | undefined = css`\n        \n            :host {\n                display: contents;\n            }\n\n            .hint {\n                font-size: calc( var( --thermal-fs-sm ) * .75 );\n                padding-top: .2em;\n            }\n\n            fieldset {\n                border: var(--thermal-border-width) var(--thermal-border-style) var(--thermal-slate);\n                border-radius: var(--thermal-radius);\n                margin-bottom: var(--thermal-gap);\n\n                legend {\n                    border-radius: var(--thermal-radius);\n                    border: var(--thermal-border-width) var(--thermal-border-style) var(--thermal-slate);\n                    padding: 0.3em 0.5em;\n                }\n\n            }\n\n            \n        \n        `;\n\n    updated(_changedProperties: PropertyValues): void {\n        super.updated(_changedProperties);\n\n        if (!this.configController || !_changedProperties.has(\"config\")) {\n            return;\n        }\n\n        const settings = this.configController.settings.export.png;\n        const values = [\n            [\"pngWidth\", settings.width],\n            [\"pngFs\", settings.fontSize]\n        ] as const;\n\n        for (const [key, value] of values) {\n            const element = this.shadowRoot?.querySelector(`input[name=\"${key}\"]`) as HTMLInputElement | null;\n            if (element && Number(element.value) !== value) {\n                element.value = value.toString();\n            }\n        }\n    }\n\n    protected render(): unknown {\n\n        if (!this.configController) {\n            return nothing;\n        }\n\n        const { png, group } = this.configController.settings.export;\n\n        return html`\n\n        ${this.renderGroup(t(T.exportcontent), html`\n            ${this.renderCheckbox(\"pngExportAnalyses\", t(T.analyses), png.analyses, value => this.configController!.setPngAnalyses(value))}\n            ${this.renderCheckbox(\"pngExportScale\", t(T.thermalscale), png.thermalScale, value => this.configController!.setPngThermalScale(value))}\n            ${this.renderCheckbox(\"pngExportFileName\", t(T.exportfilenames), png.fileName, value => this.configController!.setPngFileName(value))}\n            ${this.renderCheckbox(\"pngExportFileDate\", t(T.filedate), png.fileDate, value => this.configController!.setPngFileDate(value))}\n        ` )}\n\n        ${this.renderGroup(t(T.exportdimensions), html`\n            ${this.renderSlider(\"pngWidth\", t(T.exportimagewidth), png.width, \"px\", 500, 2000, 50, value => this.configController!.setPngWidth(value))}\n\n            ${this.renderSlider(\"pngFs\", t(T.exportimagefontsize), png.fontSize, \"px\", 10, 50, 1, value => this.configController!.setPngFontSize(value))}\n        ` )}\n\n        ${this.renderGroup(t(T.exportgroup), html`\n            ${this.renderCheckbox(\"pngExportGroupName\", t(T.exportgroupname), group.groupName, value => this.configController!.setGroupGroupName(value))}\n            ${this.renderSlider(\"pngColumns\", t(T.exportfilenames), group.columns, \"sloupců\", 1, 5, 1, value => this.configController!.setGroupColumns(value))}\n        ` )}\n\n        `;\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"manager-export-panel\": ManagerExportPanel;\n    }\n}","import { consume } from \"@lit/context\";\nimport { t } from \"i18next\";\nimport { css, html } from \"lit\";\nimport { AbstractManagerConsumer } from \"../../hierarchy/consumers/AbstractManagerConsumer\";\nimport { managerGraphFunctionContext } from \"../../controllers/ManagerController\";\nimport { T } from \"../../translations/Languages\";\n\nexport class ManagerGraphSmoothSwitch extends AbstractManagerConsumer {\n\n    @consume({context: managerGraphFunctionContext, subscribe: true})\n    smooth!: boolean;\n\n    public static styles = css`\n    \n        :host {\n            display: inline-block;\n        }\n\n    `;\n\n    protected render(): unknown {\n        return html`\n            <thermal-btn-group>\n                <thermal-btn\n                    variant=${this.smooth ? \"default\" : \"foreground\"}\n                    @click=${() => this.managerObject.graphSmooth.setGraphSmooth(false)}\n                >${t(T.straightlines)}</thermal-btn>\n                <thermal-btn\n                    variant=${this.smooth ? \"foreground\" : \"default\"}\n                    @click=${() => this.managerObject.graphSmooth.setGraphSmooth(true)}\n                >${t(T.smoothlines)}</thermal-btn>\n            </thermal-btn-group>\n        `;\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"manager-graph-smooth-switch\": ManagerGraphSmoothSwitch;\n    }\n}","import { consume } from \"@lit/context\";\nimport { t } from \"i18next\";\nimport { css, html } from \"lit\";\nimport { AbstractManagerConsumer } from \"../../hierarchy/consumers/AbstractManagerConsumer\";\nimport { managerSmoothContext } from \"../../controllers/ManagerController\";\nimport { T } from \"../../translations/Languages\";\n\nexport class ManagerImageSmoothSwitch extends AbstractManagerConsumer {\n\n    @consume({context: managerSmoothContext, subscribe: true})\n    smooth!: boolean;\n\n    public static styles = css`\n    \n        :host {\n            display: block;\n        }\n\n    `;\n\n    protected render(): unknown {\n        return html`<thermal-btn-group>\n            <thermal-btn\n    variant=${this.smooth ? \"default\" : \"foreground\"}\n    @click=${() => this.managerObject.smooth.setSmooth(false)}\n>${t(T.pixelated)}</thermal-btn>\n\n<thermal-btn\n    variant=${this.smooth ? \"foreground\" : \"default\"}\n    @click=${() => this.managerObject.smooth.setSmooth(true)}\n>${t(T.smooth)}</thermal-btn>\n        </thermal-btn-group>`;\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"manager-image-smooth-switch\": ManagerImageSmoothSwitch;\n    }\n}","import type { AvailableThermalPalette, ThermalPaletteType } from \"@labirthermal/core\";\nimport { ThermalPalettes } from \"@labirthermal/core\";\nimport { consume } from \"@lit/context\";\nimport type { PropertyValues } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { AbstractManagerConsumer } from \"../../hierarchy/consumers/AbstractManagerConsumer\";\nimport { managerAdvancedPalettesContext } from \"../../controllers/ManagerController\";\nimport { managerPaletteContext } from \"../../controllers/ManagerController\";\nimport type { ManagerPaletteContextType } from \"../../controllers/ManagerController\";\n\nexport abstract class AbstractPaletteSwitch extends AbstractManagerConsumer {\n\n    protected static BASIC_PALETTES = [\"iron\", \"jet\", \"white_hot\", \"black_hot\"];\n\n\n    @consume({ context: managerAdvancedPalettesContext, subscribe: true })\n    @state()\n    protected advancedPalettesContext: boolean = false;\n\n    @property({ type: Boolean, attribute: \"advanced-palettes\" })\n    public advancedPalettesProperty?: boolean;\n\n    @state()\n    protected palettes: ThermalPaletteType[] = [];\n\n    @consume({ context: managerPaletteContext, subscribe: true })\n    @state()\n    protected value!: ManagerPaletteContextType;\n\n    willUpdate(changedProperties: PropertyValues): void {\n        super.willUpdate(changedProperties);\n\n        const showAdvancedPalettes = this.advancedPalettesProperty ?? this.advancedPalettesContext;\n        const basicPalettes = AbstractPaletteSwitch.BASIC_PALETTES;\n        const optionsChanged = changedProperties.has(\"advancedPalettesContext\")\n            || changedProperties.has(\"advancedPalettesProperty\");\n\n        // Side effect of advanced palette options changing - derive the available palettes before rendering.\n        if (optionsChanged) {\n\n            if (showAdvancedPalettes) {\n                this.palettes = Object.values(ThermalPalettes);\n            } else {\n                \n                this.palettes = Object.entries(ThermalPalettes)\n                    .filter(([key]) => AbstractPaletteSwitch.BASIC_PALETTES.includes(key))\n                    .map(([, palette]) => palette);\n            }\n\n        }\n\n        // Side effect of palette or options changing - select iron if the supplied palette is excluded by basic mode.\n        if ((optionsChanged || changedProperties.has(\"value\"))\n            && this.value !== undefined\n            && !showAdvancedPalettes\n            && !basicPalettes.includes(this.value.key)) {\n            this.onSelect(\"iron\");\n        }\n\n\n\n    }\n\n\n    /** Handle user input events */\n    protected onSelect(palette: AvailableThermalPalette) {\n        this.managerObject.palette.setPalette(palette);\n    }\n\n\n}","import type { AvailableThermalPalette, ThermalPaletteType } from \"@labirthermal/core\";\nimport { t } from \"i18next\";\nimport { css, html } from \"lit\";\nimport { T } from \"../../translations/Languages\";\nimport { AbstractPaletteSwitch } from \"./AbstractPaletteSwitch\";\n\nexport class ManagerPaletteButtons extends AbstractPaletteSwitch {\n\n    static styles = css`\n:host {\n    display: flex;\n    width: content-width;\n    gap: 5px;\n}\n\n.palette {\n    width: calc( var( --thermal-gap ) * 2 );\n    height: calc( var( --thermal-fs ) * .8 );\n    border-radius: var( --thermal-fs-small );\n}`;\n\n    private paletteTemplate(\n        palette: ThermalPaletteType\n    ) {\n        return html`<span class=\"palette\" style=\"background:${palette.gradient}\"></span>`;\n    }\n\n    protected render(): unknown {\n\n        return this.palettes.map((palette => html`<thermal-btn \n    @click=${() => this.onSelect(palette.slug as AvailableThermalPalette)} \n    variant=\"${palette.name === this.managerObject.palette.currentPalette.name ? \"background\" : \"default\"}\"\n    tooltip=\"${t(T.palettename, { name: palette.name })}\"\n>\n    ${this.paletteTemplate(palette)}\n</thermal-btn>`));\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"manager-palette-buttons\": ManagerPaletteButtons;\n    }\n}\n","import type { AvailableThermalPalette, ThermalPaletteType } from \"@labirthermal/core\";\nimport { t } from \"i18next\";\nimport { css, html } from \"lit\";\nimport { T } from \"../../translations/Languages\";\nimport { AbstractPaletteSwitch } from \"./AbstractPaletteSwitch\";\n\nexport class ManagerPaletteDropdown extends AbstractPaletteSwitch {\n\n    static styles = css`\n\n    .palette {\n        display: block;\n        width: calc( var( --thermal-gap ) * 2 );\n        height: calc( var( --thermal-fs ) * .8 );\n        border-radius: var( --thermal-fs-small );\n    }\n\n    thermal-btn {\n        width: 100%;\n        justify-content: flex-start;\n    }\n\n    `;\n\n    protected paletteTemplate(\n        palette: ThermalPaletteType\n    ) {\n        return html`<span class=\"palette\" style=\"background:${palette.gradient}\"></span><span>${palette.name}</span>`;\n    }\n\n    protected render(): unknown {\n        return html`\n\n            <thermal-dropdown .tooltip=${t(T.colourpalette)}>\n                    <span slot=\"invoker\" class=\"palette\" style=\"background:${this.managerObject.palette.currentPalette.gradient}\"></span>\n\n                ${this.palettes.map( palette => html`\n                    <div slot=\"option\"><thermal-btn @click=${() => this.onSelect(palette.slug as AvailableThermalPalette)} variant=\"${palette.name === this.managerObject.palette.currentPalette.name ? \"background\" : \"default\"}\">\n                        ${this.paletteTemplate(palette)}\n                    </thermal-btn></div>\n                `)}\n            \n            </thermal-dropdown>\n\n            <slot></slot>\n\n        `;\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"manager-palette-dropdown\": ManagerPaletteDropdown;\n    }\n}","import type { ThermalTool } from \"@labirthermal/core\";\nimport { consume } from \"@lit/context\";\nimport { t } from \"i18next\";\nimport { css, html, nothing } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { classMap } from 'lit/directives/class-map.js';\nimport { unsafeSVG } from 'lit/directives/unsafe-svg.js';\nimport { AbstractManagerConsumer } from \"../../hierarchy/consumers/AbstractManagerConsumer\";\nimport { managerToolContext } from \"../../controllers/ManagerController\";\nimport { T } from \"../../translations/Languages\";\nimport type { Placement } from \"@floating-ui/dom\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\n\n\n/**\n * A standard toolbar that is either horizontal or vertical.\n */\nexport class ManagerToolBar extends AbstractManagerConsumer {\n\n    @consume({ context: managerToolContext, subscribe: true })\n    @state()\n    protected value!: ThermalTool;\n\n    @property({type: String, reflect: true, attribute: \"tooltip-placement\"})\n    public tooltipPlacement?: Placement;\n\n    /** Handle user input events */\n    protected onSelect(tool: ThermalTool) {\n        this.managerObject.tool.selectTool(tool);\n    }\n\n    static styles = css`\n:host {\n    display: flex;\n    font-size: var(--thermal-fs);\n    flex-direction: column;\n    gap: 0.25em;\n}\n\n:host([horizontal]) {\n    flex-direction: row;\n}\n\n.active {\n    color: var( --thermal-foreground );\n}\n\nthermal-btn {\n    width: 2.5em;\n    padding: 3px;\n    &:hover {\n        color: var(--thermal-primary);\n    }\n}`;\n\n\n    protected renderTool(\n        key: string,\n        tool: ThermalTool\n    ): unknown {\n        const classes = {\n            [key]: true,\n            button: true,\n            active: tool.key === this.value.key\n        };\n        return html`<thermal-btn \n    tooltip=${t(T[tool.name as keyof typeof T])}\n    tooltip-placement=\"${ifDefined( this.tooltipPlacement )}\"\n    class=${classMap(classes)} \n    @click=${() => { this.managerObject.tool.selectTool(tool) }}\n    variant=${tool.key === this.value.key ? \"background\" : \"default\"}\n>\n    ${unsafeSVG(tool.icon)}\n</thermal-btn>`\n    }\n\n\n    protected render(): unknown {\n\n        if (this.managerObject === undefined) {\n            return nothing;\n        }\n\n        return Object.entries(this.managerObject.tool.tools).map(([key, tool]) => {\n\n            return this.renderTool(key, tool);\n\n        });\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"manager-tool-bar\": ManagerToolBar;\n    }\n}","import { html } from \"lit\";\nimport { AbstractManagerConsumer, managerAdvancedPalettesContext } from \"../../index.export\";\nimport { consume } from \"@lit/context\";\n\nexport class ManagerAdvancedPaletteSwitch extends AbstractManagerConsumer {\n\n    @consume({context: managerAdvancedPalettesContext, subscribe: true})\n    private advancedPalettes!: boolean;\n\n    render() {\n        return html`<thermal-btn-group>\n            <thermal-btn\n                variant=\"${!this.advancedPalettes ? 'foreground' : 'default'}\"\n                @click=${() => {\n                    this.managerController.setAdvancedPalettes(false);\n                }}\n            >Základní palety</thermal-btn>\n            <thermal-btn\n                variant=\"${this.advancedPalettes ? 'foreground' : 'default'}\"\n                @click=${() => {\n                    this.managerController.setAdvancedPalettes(true);\n                }}\n            >Všechny palety</thermal-btn>\n        </thermal-btn-group>`;\n    }\n\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"manager-advanced-palette-switch\": ManagerAdvancedPaletteSwitch;\n    }\n}","import { html } from \"lit\";\nimport { AbstractManagerConsumer } from \"../../hierarchy/consumers/AbstractManagerConsumer\";\nimport type { ThermalUnit, ThermalUnitDefinition } from \"@labirthermal/core\";\nimport { property } from \"lit/decorators/property.js\";\nimport { consume } from \"@lit/context\";\nimport { managerUnitContext } from \"../../controllers/ManagerController\";\nimport type { BtnVariants } from \"../../ui/Btn\";\n\nexport class ManagerUnitSwitch extends AbstractManagerConsumer {\n\n    @property({ type: String, reflect: true, attribute: \"active-variant\" })\n    activeVariant: BtnVariants = \"foreground\";\n\n    @property({ type: String, reflect: true, attribute: \"default-variant\" })\n    defaultVariant: BtnVariants = \"default\";\n\n    @consume({ context: managerUnitContext, subscribe: true })\n    protected unit!: ThermalUnit;\n\n\n    private getUnit() {\n        return this.managerObject.unit;\n    }\n\n    private renderUnit(\n        definition: ThermalUnitDefinition\n    ){\n\n        const active = definition.key === this.getUnit().value;\n\n        const variant = active ? this.activeVariant : this.defaultVariant;\n\n        return html`<thermal-btn\n            variant=${variant}\n            ?non-interactive=${active}\n            tooltip=${definition.name}\n            @click=${() => this.getUnit().set(definition.key)}\n        >${definition.symbol}</thermal-btn>`;\n\n    }\n\n    render() {\n\n        const units = Object.values( this.getUnit().getUnits() ).map(unit => this.renderUnit(unit));\n\n\n        return html`<thermal-btn-group>${units}</thermal-btn-group>`;\n    }\n\n\n}","import type { ThermalMinmaxOrUndefined, ThermalRangeOrUndefined, ThermalRegistry } from \"@labirthermal/core\";\nimport { ThermalUnit, thermalUnits } from \"@labirthermal/core\";\nimport { consume } from \"@lit/context\";\nimport { t } from \"i18next\";\nimport { css, html } from \"lit\";\nimport type { CSSResultGroup, PropertyValues } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { managerUnitContext } from \"../../controllers/ManagerController\";\nimport { AbstractRegistryConsumer } from \"../../hierarchy/consumers/AbstractRegistryConsumer\";\nimport { T } from \"../../translations/Languages\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\n\n\n/**\n * Form control for editing a thermal registry's active range. It keeps its\n * inputs synchronized with registry range data and provides range presets,\n * bounded stepping, and rounding.\n *\n * All values, steps and rounding of the form are in the manager's current\n * unit. The registry always stays in degrees Celsius: incoming values are\n * converted for display and edited values are converted back to Celsius.\n *\n * @see AbstractRegistryConsumer\n * @see RegistryController\n */\nexport class RegistryRangeForm extends AbstractRegistryConsumer {\n\n    /**\n     * Whether to arrange the form controls in a stacked layout. Standard\n     * boolean attribute: presence of `stacked` (with any value, including\n     * `\"false\"`) means `true`, absence means `false`. Reflected to the\n     * `stacked` attribute; defaults to `false`.\n     */\n    @property({ type: Boolean, reflect: true })\n    public stacked: boolean = false;\n\n    /** The manager's current unit; Celsius is used until it is provided. */\n    @state()\n    @consume({ context: managerUnitContext, subscribe: true })\n    protected unit?: ThermalUnit;\n\n    /** Definition of the displayed unit. */\n    protected get unitDefinition() {\n        return thermalUnits[this.unit ?? ThermalUnit.C] ?? thermalUnits[ThermalUnit.C];\n    }\n\n    /** Convert a registry value in Celsius to the displayed unit. */\n    protected toDisplayed(celsius: number): number {\n        return this.unitDefinition.fromCelsius(celsius);\n    }\n\n    /** Convert a displayed value back to Celsius for the registry. */\n    protected toCelsius(displayed: number): number {\n        return this.unitDefinition.toCelsius(displayed);\n    }\n\n    /* The following values are in the displayed unit. */\n\n    /** The registry minimum in the displayed unit (not Celsius), or `undefined` until bounds are available. */\n    @state()\n    protected min: number | undefined;\n\n    /** The registry maximum in the displayed unit (not Celsius), or `undefined` until bounds are available. */\n    @state()\n    protected max: number | undefined;\n\n    /** The active range's lower endpoint, or `undefined` before synchronization. */\n    @state()\n    protected from: number | undefined;\n\n    /** The active range's upper endpoint, or `undefined` before synchronization. */\n    @state()\n    protected to: number | undefined;\n\n    /** The increment used by the endpoint step controls; defaults to `1`. */\n    @state()\n    protected step: number = 1;\n\n    /** Step sizes offered by the endpoint controls; defaults to `[0.01, 0.1, 0.5, 1, 5, 10]`. */\n    @state()\n    protected availableSteps: number[] = [0.01, 0.1, 0.5, 1, 5, 10];\n\n    /** Input text for each endpoint; both values default to empty strings. */\n    @state()\n    protected inputValues: { from: string; to: string } = { from: \"\", to: \"\" };\n\n    /** Whether a registry range is being applied; defaults to `false`. */\n    @state()\n    protected isUpdatingFromRegistry: boolean = false;\n\n    /** Timer used to debounce endpoint input updates; initially `undefined`. */\n    private debounceTimer: number | undefined;\n\n    /** The latest automatic range, or `undefined` until one is available. */\n    @state()\n    protected autoValue: ThermalRangeOrUndefined;\n\n    /** Registry currently observed by this form, initially unset. */\n    private subscribedRegistry?: ThermalRegistry;\n\n    /** Whether the automatic-range control is active; defaults to `false`. */\n    private autoRangeHovered: boolean = false;\n\n    connectedCallback(): void {\n        super.connectedCallback();\n        this.hydrate();\n    }\n\n    willUpdate(changedProperties: PropertyValues<this>): void {\n        super.willUpdate(changedProperties);\n        this.hydrate();\n\n        // Display the registry values again in the new unit\n        if ((changedProperties as PropertyValues).has(\"unit\") && this.subscribedRegistry) {\n            if (this.debounceTimer) {\n                // A pending edit was typed in the previous unit\n                clearTimeout(this.debounceTimer);\n                this.debounceTimer = undefined;\n            }\n            this.recieveMinmax(this.subscribedRegistry.minmax.value);\n            this.recieveRange(this.subscribedRegistry.range.value);\n        }\n    }\n\n    disconnectedCallback(): void {\n        super.disconnectedCallback();\n        this.dehydrate();\n        if (this.debounceTimer) {\n            clearTimeout(this.debounceTimer);\n        }\n    }\n\n    /**\n     * Synchronizes local form state with the current registry and subscribes to\n     * its range updates.\n     */\n    private hydrate(): void {\n        const registry = this.registryController?.registryObject;\n        if (registry === undefined || registry === this.subscribedRegistry) {\n            return;\n        }\n\n        // Replace any previous subscriptions before observing the new registry.\n        this.dehydrate();\n        this.subscribedRegistry = registry;\n\n        // Synchronize the initial values before listening for subsequent updates.\n        this.recieveMinmax(registry.minmax.value);\n        this.recieveRange(registry.range.value);\n        this.recieveAutoValue(registry.range.autoValue);\n\n        // Subscribe to bounds, active-range, and automatic-range changes.\n        registry.minmax.addListener(this.UUID, this.recieveMinmax);\n        registry.range.addListener(this.UUID, this.recieveRange);\n        registry.range.onAutoValueChanged.set(this.UUID, this.recieveAutoValue);\n    }\n\n    /**\n     * Removes this form's listeners from the subscribed registry and clears the\n     * subscription reference.\n     */\n    private dehydrate(): void {\n        const registry = this.subscribedRegistry;\n        if (registry === undefined) {\n            return;\n        }\n\n        // Remove every listener registered during hydration.\n        registry.minmax.removeListener(this.UUID);\n        registry.range.removeListener(this.UUID);\n        registry.range.onAutoValueChanged.delete(this.UUID);\n        this.subscribedRegistry = undefined;\n    }\n\n    /**\n     * Updates the displayed registry bounds and clears range inputs when bounds\n     * are unavailable.\n     *\n     * @param value The registry's current minimum and maximum, or `undefined`\n     * when unavailable.\n     */\n    private recieveMinmax = (value: ThermalMinmaxOrUndefined): void => {\n        if ( value ) {\n            const min = this.toDisplayed(value.min);\n            const max = this.toDisplayed(value.max);\n            if (this.min !== min ) this.min = min;\n            if (this.max !== max ) this.max = max;\n        } else {\n            // Clear range state when the registry no longer has known bounds.\n            this.min = undefined;\n            this.max = undefined;\n            this.from = undefined;\n            this.to = undefined;\n            this.inputValues = { from: \"\", to: \"\" };\n        }\n    }\n\n    /**\n     * Synchronizes the form's range values and input text with the registry.\n     *\n     * @param value The registry's active range, or `undefined` when no range is set.\n     */\n    private recieveRange = (value: ThermalRangeOrUndefined): void => {\n        // Prevent incoming registry values from being written back as user edits.\n        this.isUpdatingFromRegistry = true;\n\n        if ( value ) {\n            const from = this.toDisplayed(value.from);\n            const to = this.toDisplayed(value.to);\n            if (this.from !== from ) {\n                this.from = from;\n                this.inputValues = { ...this.inputValues, from: from.toFixed(2) };\n            }\n            if (this.to !== to ) {\n                this.to = to;\n                this.inputValues = { ...this.inputValues, to: to.toFixed(2) };\n            }\n        } else {\n            this.from = undefined;\n            this.to = undefined;\n            this.inputValues = { from: \"\", to: \"\" };\n        }\n\n        this.isUpdatingFromRegistry = false;\n    }\n\n    /**\n     * Stores the latest automatic range and refreshes its highlight when hovered.\n     *\n     * @param value The registry's current automatic range, or `undefined` when\n     * unavailable.\n     */\n    private recieveAutoValue = (value: ThermalRangeOrUndefined): void => {\n        this.autoValue = value;\n        if (this.autoRangeHovered) {\n            // Keep the preview in sync while its control remains active.\n            this.registryController.setHighlight(value);\n        }\n    }\n\n    /**\n     * Highlights the registry's full bounds while the full-range control is\n     * hovered or focused.\n     */\n    private handleFullRangeMouseEnter = (): void => {\n        const minmax = this.registryObject.minmax.value;\n        if (minmax !== undefined) {\n            this.registryController.setHighlight({ from: minmax.min, to: minmax.max });\n        }\n    }\n\n    /** Applies the registry's full minimum-to-maximum range. */\n    private handleFullRangeClick = (): void => {\n        this.registryObject.range.applyMinmax();\n    }\n\n    /** Highlights the automatic range while its control is hovered or focused. */\n    private handleAutoRangeMouseEnter = (): void => {\n        this.autoRangeHovered = true;\n        this.registryController.setHighlight(this.autoValue);\n    }\n\n    /** Applies the registry's automatically calculated range. */\n    private handleAutoRangeClick = (): void => {\n        this.registryObject.range.applyAuto();\n    }\n\n    /** Clears the automatic-range hover state and removes the registry highlight. */\n    private handleHighlightMouseLeave = (): void => {\n        this.autoRangeHovered = false;\n        this.registryController.setHighlight(undefined);\n    }\n\n    /**\n     * Updates the lower endpoint and imposes the resulting range on the registry\n     * when both endpoints are available.\n     *\n     * @param value The new lower endpoint in the displayed unit.\n     */\n    private updateFrom(value: number | undefined): void {\n        if (this.registryObject && value !== undefined && this.to !== undefined) {\n            this.from = value;\n            // The untouched endpoint is taken from the registry so that it is not altered by the conversion\n            this.registryObject.range.imposeRange({\n                from: this.toCelsius(value),\n                to: this.registryObject.range.value?.to ?? this.toCelsius(this.to)\n            });\n        }\n    }\n\n    /**\n     * Updates the upper endpoint and imposes the resulting range on the registry\n     * when both endpoints are available.\n     *\n     * @param value The new upper endpoint in the displayed unit.\n     */\n    private updateTo(value: number | undefined): void {\n        if (this.registryObject && value !== undefined && this.from !== undefined) {\n            this.to = value;\n            // The untouched endpoint is taken from the registry so that it is not altered by the conversion\n            this.registryObject.range.imposeRange({\n                from: this.registryObject.range.value?.from ?? this.toCelsius(this.from),\n                to: this.toCelsius(value)\n            });\n        }\n    }\n\n    /**\n     * Debounces input edits, validates the parsed value, and applies it to the\n     * selected endpoint.\n     *\n     * @param type The endpoint being edited.\n     * @param value The current text entered by the user.\n     */\n    private debouncedUpdate(type: 'from' | 'to', value: string): void {\n        if (this.debounceTimer) {\n            clearTimeout(this.debounceTimer);\n        }\n\n        this.debounceTimer = window.setTimeout(() => {\n            // Ignore delayed edits while synchronizing a registry update.\n            if (this.isUpdatingFromRegistry) return;\n\n            // Parse and validate the input before applying it to the registry.\n            const numValue = parseFloat(value);\n            if (isNaN(numValue)) return;\n\n            if (type === 'from' && this.isValidFromValue(numValue)) {\n                this.updateFrom(numValue);\n            } else if (type === 'to' && this.isValidToValue(numValue)) {\n                this.updateTo(numValue);\n            }\n        }, 300);\n    }\n\n    /**\n     * Checks whether a lower-endpoint value is within the known minimum and\n     * upper endpoint.\n     *\n     * @param value The candidate lower endpoint.\n     * @returns `true` if the value is valid; otherwise, `false`.\n     */\n    private isValidFromValue(value: number): boolean {\n        if (this.min !== undefined && value < this.min) return false;\n        if (this.to !== undefined && value > this.to) return false;\n        return true;\n    }\n\n    /**\n     * Checks whether an upper-endpoint value is within the known lower endpoint\n     * and maximum.\n     *\n     * @param value The candidate upper endpoint.\n     * @returns `true` if the value is valid; otherwise, `false`.\n     */\n    private isValidToValue(value: number): boolean {\n        if (this.max !== undefined && value > this.max) return false;\n        if (this.from !== undefined && value < this.from) return false;\n        return true;\n    }\n\n    /**\n     * Determines whether the lower endpoint can move one configured step in the\n     * given direction.\n     *\n     * @param direction The direction in which to step.\n     * @returns `true` if the stepped value is valid; otherwise, `false`.\n     */\n    private canStepFrom(direction: 'up' | 'down'): boolean {\n        if (this.from === undefined) return false;\n\n        const newValue = direction === 'up'\n            ? this.from + this.step\n            : this.from - this.step;\n\n        return this.isValidFromValue(newValue);\n    }\n\n    /**\n     * Determines whether the upper endpoint can move one configured step in the\n     * given direction.\n     *\n     * @param direction The direction in which to step.\n     * @returns `true` if the stepped value is valid; otherwise, `false`.\n     */\n    private canStepTo(direction: 'up' | 'down'): boolean {\n        if (this.to === undefined) return false;\n\n        const newValue = direction === 'up'\n            ? this.to + this.step\n            : this.to - this.step;\n\n        return this.isValidToValue(newValue);\n    }\n\n    /**\n     * Checks whether the registry minimum can replace the current lower endpoint.\n     *\n     * @returns `true` if the minimum can be applied; otherwise, `false`.\n     */\n    private canSetMin(): boolean {\n        return this.min !== undefined\n            && this.to !== undefined\n            && this.min <= this.to\n            && this.from !== this.min;\n    }\n\n    /**\n     * Checks whether the registry maximum can replace the current upper endpoint.\n     *\n     * @returns `true` if the maximum can be applied; otherwise, `false`.\n     */\n    private canSetMax(): boolean {\n        return this.max !== undefined\n            && this.from !== undefined\n            && this.max >= this.from\n            && this.to !== this.max;\n    }\n\n    /**\n     * Moves the lower endpoint by one configured step and applies the rounded\n     * value when valid.\n     *\n     * @param direction The direction in which to move the endpoint.\n     */\n    private stepFrom(direction: 'up' | 'down'): void {\n        if (this.from === undefined || !this.canStepFrom(direction)) return;\n\n        const newValue = direction === 'up'\n            ? this.from + this.step\n            : this.from - this.step;\n\n        // Round to two decimal places to avoid floating-point precision errors.\n        const roundedValue = parseFloat(newValue.toFixed(2));\n        this.inputValues.from = roundedValue.toFixed(2);\n        this.updateFrom(roundedValue);\n    }\n\n    /**\n     * Moves the upper endpoint by one configured step and applies the rounded\n     * value when valid.\n     *\n     * @param direction The direction in which to move the endpoint.\n     */\n    private stepTo(direction: 'up' | 'down'): void {\n        if (this.to === undefined || !this.canStepTo(direction)) return;\n\n        const newValue = direction === 'up'\n            ? this.to + this.step\n            : this.to - this.step;\n\n        // Round to two decimal places to avoid floating-point precision errors.\n        const roundedValue = parseFloat(newValue.toFixed(2));\n        this.inputValues.to = roundedValue.toFixed(2);\n        this.updateTo(roundedValue);\n    }\n\n    /** Sets the lower endpoint to the registry minimum when the range permits it. */\n    private setMinValue(): void {\n        if (!this.canSetMin() || this.min === undefined) return;\n\n        this.inputValues.from = this.min.toFixed(2);\n        this.updateFrom(this.min);\n    }\n\n    /** Sets the upper endpoint to the registry maximum when the range permits it. */\n    private setMaxValue(): void {\n        if (!this.canSetMax() || this.max === undefined) return;\n\n        this.inputValues.to = this.max.toFixed(2);\n        this.updateTo(this.max);\n    }\n\n    /**\n     * Sets the increment used when stepping range endpoints.\n     *\n     * @param newStep The step size to use.\n     */\n    private setStep(newStep: number): void {\n        this.step = newStep;\n    }\n\n    /**\n     * Rounds the selected range endpoint to the nearest valid integer and applies it.\n     *\n     * @param type The endpoint to round.\n     */\n    private roundToNearestInteger(type: 'from' | 'to'): void {\n        const currentValue = type === 'from' ? this.from : this.to;\n        if (currentValue === undefined) return;\n\n        const rounded = Math.round(currentValue);\n        let safeValue = rounded;\n\n        // Keep rounding inside the registry bounds when they are available.\n        if (type === \"from\" && rounded < this.min!) {\n            safeValue = Math.ceil( currentValue );\n        }\n\n        if (type === \"to\" && rounded > this.max!) {\n            safeValue = Math.floor( currentValue );\n        }\n\n        const isValid = type === 'from'\n            ? this.isValidFromValue(safeValue)\n            : this.isValidToValue(safeValue);\n\n        // Update the displayed value and registry only when the rounded value is valid.\n        if (isValid) {\n            if (type === 'from') {\n                this.inputValues.from = safeValue.toFixed(2);\n                this.updateFrom(safeValue);\n            } else {\n                this.inputValues.to = safeValue.toFixed(2);\n                this.updateTo(safeValue);\n            }\n        }\n    }\n\n    /**\n     * Returns step sizes that can move at least one current endpoint in either\n     * direction.\n     *\n     * @returns The available step sizes.\n     */\n    private getAvailableSteps(): number[] {\n        return this.availableSteps.filter(step => {\n            // Keep a step if either endpoint can move up or down by that amount.\n            const fromCanStep = this.from !== undefined && (\n                this.isValidFromValue(this.from + step) ||\n                this.isValidFromValue(this.from - step)\n            );\n            const toCanStep = this.to !== undefined && (\n                this.isValidToValue(this.to + step) ||\n                this.isValidToValue(this.to - step)\n            );\n            return fromCanStep || toCanStep;\n        });\n    }\n\n    /**\n     * Checks whether a defined value is an integer.\n     *\n     * @param value The value to check.\n     * @returns `true` if the value is an integer; otherwise, `false`.\n     */\n    private isWholeNumber(value: number | undefined): boolean {\n        return value !== undefined && Math.round(value) === value;\n    }\n\n    /**\n     * Parses endpoint input and clamps it to the currently valid range, falling\n     * back to the current value when input is empty or invalid.\n     *\n     * @param inputValue The text entered in the endpoint input.\n     * @param type The endpoint being validated.\n     * @returns The parsed, clamped value, or the current endpoint value.\n     */\n    private getClosestValidValue(inputValue: string, type: 'from' | 'to'): number | undefined {\n        // Preserve the current endpoint for empty input.\n        if (!inputValue.trim()) {\n            return type === 'from' ? this.from : this.to;\n        }\n\n        const numValue = parseFloat(inputValue);\n\n        // Preserve the current endpoint when the input cannot be parsed.\n        if (isNaN(numValue)) {\n            return type === 'from' ? this.from : this.to;\n        }\n\n        // Clamp the parsed value to the selected endpoint's valid bounds.\n        if (type === 'from') {\n            const minBound = this.min ?? Number.NEGATIVE_INFINITY;\n            const maxBound = this.to ?? Number.POSITIVE_INFINITY;\n\n            if (numValue < minBound) return minBound;\n            if (numValue > maxBound) return maxBound;\n            return numValue;\n        } else {\n            const minBound = this.from ?? Number.NEGATIVE_INFINITY;\n            const maxBound = this.max ?? Number.POSITIVE_INFINITY;\n\n            if (numValue < minBound) return minBound;\n            if (numValue > maxBound) return maxBound;\n            return numValue;\n        }\n    }\n\n    /**\n     * Normalizes an endpoint input on blur and applies the corrected value to\n     * the registry.\n     *\n     * @param type The endpoint whose input lost focus.\n     * @param inputValue The input text to normalize.\n     */\n    private handleInputBlur(type: 'from' | 'to', inputValue: string): void {\n        const correctedValue = this.getClosestValidValue(inputValue, type);\n\n        if (correctedValue !== undefined) {\n            // Update the displayed text with the normalized endpoint.\n            this.inputValues = {\n                ...this.inputValues,\n                [type]: correctedValue.toFixed(2) \n            };\n\n            // Apply the normalized endpoint to the registry.\n            if (type === 'from') {\n                this.updateFrom(correctedValue);\n            } else {\n                this.updateTo(correctedValue);\n            }\n        }\n    }\n\n\n    /** Styles the range inputs, step controls, and range preset buttons. */\n    static styles?: CSSResultGroup | undefined = css`\n\n        :host {\n            font-family: inherit;\n            font-style: normal;\n            font-size: var(--font-size);\n            display: flex !important;\n            flex-wrap: wrap;\n            flex-direction: var( --thermal-direction, row );\n            gap: .5em;\n        }\n\n        .fields {\n\n            display: flex;\n            flex-wrap: no-wrap;\n            gap: 0em;\n        \n        }\n\n        .fields__buttons {\n\n            thermal-btn {\n                min-height: 2em;\n                flex-grow: var(--thermal-collapsible-grow, 0);\n            }\n        \n        }\n\n        .fields__separated {\n            gap: .5em;\n        }\n\n\n        .separator {\n            width: .5em;\n            &.separator__line {\n                display: flex;\n                align-items: center;\n                &::after {\n                    content: \"\";\n                    display: block;\n                    height: var(--thermal-border-width);\n                    width: 100%;\n                    background: var( --thermal-slate );\n                }\n            }\n        }\n\n        .input-group {\n            position: relative;\n        }\n    \n        .input-group-inner {\n            display: flex;\n            align-items: stretch;\n            height: 2em;\n            position: relative;\n            z-index: 1;\n        }\n\n\n        .input-group-outer {\n            position: absolute;\n            z-index: 0;\n            text-align: center;\n            width: 100%;\n\n            font-size: .75em;\n            height: 2em;\n            background: var( --thermal-slate-light );\n\n            border: var(--thermal-border-width) var(--thermal-border-style) var( --thermal-slate );\n\n            opacity: 0;\n\n            transition: all .25s ease-in-out;\n\n            box-sizing: border-box;\n            display: flex;\n            align-items: center;\n            justify-content: center;\n            gap: .25em;\n\n            &.input-group-outer__top {\n                top: 3px;\n                padding-bottom: .5em;\n                border-radius: var( --thermal-radius ) var( --thermal-radius ) 0 0;\n            }\n\n            &.input-group-outer__bottom {\n                bottom: 3px;\n                padding-top: .5em;\n                border-radius: 0 0 var( --thermal-radius ) var( --thermal-radius );\n            }\n        }\n\n        .input-group:focus-within .input-group-outer {\n\n            opacity: 1;\n\n            &.input-group-outer__top {\n                top: -1.5em;\n            }\n\n            &.input-group-outer__bottom {\n                bottom: -1.5em;\n            }\n        }\n\n        .input-group.is-whole-number .input-group-outer__bottom {\n            opacity: 0;\n            bottom: 3px;\n        }\n\n        .input-group button,\n        .input-group aside,\n        .input-group input {\n\n            border: 0;\n            border-top: var(--thermal-border-width)var(--thermal-border-style) var( --thermal-slate );\n            border-bottom: var(--thermal-border-width)var(--thermal-border-style) var( --thermal-slate );\n\n            color: var( --thermal-foreground );\n            background: var( --thermal-background );\n            \n            font-family: inherit;\n            font-size: 1em;\n            line-height: 1em;\n\n            transition: all .25s ease-in-out;\n        \n        }\n\n        .input-group-inner input, \n        .input-group-inner aside {\n            display: block;\n            vertical-align: middle;\n        }\n\n        .input-group-inner aside {\n            display: flex;\n            align-items: center;\n            justify-content: center;\n            padding-left: .3em;\n        }\n\n        .input-group-inner input {\n\n            outline: 0;\n            padding: 0;\n            margin: 0;\n\n            text-align: right;\n\n            width: 3.5em;\n\n            &:hover,\n            &:focus {\n                color: var( --thermal-primary );\n            }\n\n            &::-webkit-outer-spin-button,\n            &::-webkit-inner-spin-button {\n                /* display: none; <- Crashes Chrome on hover */\n                -webkit-appearance: none;\n                margin: 0; /* <-- Apparently some margin are still there even though it's hidden */\n            }\n\n            &[type=number] {\n                -moz-appearance:textfield; /* Firefox */\n            }\n            \n        }\n\n        .input-group-inner > button {\n\n            cursor: pointer;\n\n            outline: 0;\n\n            display: flex;\n            align-items: center;\n            justify-content: center;\n\n            &.left {\n                border-right: var(--thermal-border-width)var(--thermal-border-style) var( --thermal-slate );\n            }\n\n            &.right {\n                border-left: var(--thermal-border-width)var(--thermal-border-style) var( --thermal-slate );\n            }\n\n            &:hover,\n            &:focus {\n                background: var( --thermal-slate-light );\n            }\n\n            &:disabled {\n                \n                cursor: not-allowed;\n                color: var( --thermal-slate-light );\n                \n                &:hover,\n                &:focus {\n                    background: var( --thermal-background );\n                }\n            }\n\n            &:first-child {\n                border-left: var(--thermal-border-width)var(--thermal-border-style) var( --thermal-slate );\n                border-radius: var( --thermal-radius ) 0 0 var( --thermal-radius );\n            }\n\n            &:last-child {\n                border-right: var(--thermal-border-width)var(--thermal-border-style) var( --thermal-slate );\n                border-radius: 0 var( --thermal-radius ) var( --thermal-radius ) 0;\n            }\n\n            svg {\n                display: block;\n            }\n        \n        }\n\n        .step-button {\n            \n            color: var( --thermal-slate ) !important;\n            cursor: pointer;\n            font-size: .7em;\n            padding: .2em .3em;\n            transition: all .25s ease-in-out;\n\n            background: transparent !important;\n            border: none !important;\n\n            &:hover:not(:disabled) {\n                color: var( --thermal-primary );\n            }\n\n            &.active {\n                font-weight: bold;\n                color: var( --thermal-foreground ) !important;\n            }\n\n            &:disabled {\n                opacity: 0.3;\n                cursor: not-allowed;\n            }\n        }\n\n        .round-button {\n            \n            color: var( --thermal-foreground );\n            cursor: pointer;\n            font-size: .8em;\n            padding: .3em .6em;\n            transition: all .25s ease-in-out;\n            border: 0 !important;\n            background: transparent !important;\n\n            &:hover:not(:disabled) {\n                color: var( --thermal-primary );\n            }\n\n            &:disabled {\n                opacity: 0.3;\n                cursor: not-allowed;\n            }\n        }\n    \n    `;\n\n    /**\n     * Renders one range endpoint input with its step controls and interaction\n     * handlers.\n     *\n     * @param type The endpoint represented by the input.\n     * @param before Optional content rendered before the input controls.\n     * @param after Optional content rendered after the input controls.\n     * @returns The Lit template for the endpoint input.\n     */\n    protected renderInput(\n        type: 'from' | 'to',\n        before: unknown = undefined,\n        after: unknown = undefined,\n    ): unknown {\n        const value = type === 'from' ? this.from : this.to;\n        const inputValue = this.inputValues[type];\n        const canStepDown = type === 'from' ? this.canStepFrom('down') : this.canStepTo('down');\n        const canStepUp = type === 'from' ? this.canStepFrom('up') : this.canStepTo('up');\n        const availableSteps = this.getAvailableSteps();\n        const isWhole = this.isWholeNumber(value);\n\n        return html`\n        <div class=\"input-group ${isWhole ? 'is-whole-number' : ''}\">\n            <div class=\"input-group-outer input-group-outer__top\">\n                ${availableSteps.map(stepValue => html`\n                    <button \n                        class=\"step-button ${stepValue === this.step ? 'active' : ''}\"\n                        ?disabled=${!availableSteps.includes(stepValue)}\n                        @click=${() => this.setStep(stepValue)}\n                    >\n                        ${stepValue}\n                    </button>\n                `)}\n            </div>\n            <div class=\"input-group-inner\">\n                ${before}\n                <button \n                    class=\"left\"\n                    ?disabled=${!canStepDown}\n                    @click=${() => type === 'from' ? this.stepFrom('down') : this.stepTo('down')}\n                >-</button>\n                <input\n                    .value=${inputValue}\n                    type=\"number\"\n                    step=${this.step}\n                    min=${ifDefined( type === 'from' ? this.min : this.from)}\n                    max=${ifDefined( type === 'from' ? this.to : this.max)}\n                    @input=${(e: InputEvent) => {\n                        const target = e.target as HTMLInputElement;\n                        this.inputValues = { ...this.inputValues, [type]: target.value };\n                        this.debouncedUpdate(type, target.value);\n                    }}\n                    @blur=${(e: FocusEvent) => {\n                        const target = e.target as HTMLInputElement;\n                        this.handleInputBlur(type, target.value);\n                    }}\n                    @keydown=${(e: KeyboardEvent) => {\n                        if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {\n                            e.preventDefault();\n                            const direction = e.key === 'ArrowUp' ? 'up' : 'down';\n                            if (type === 'from') {\n                                this.stepFrom(direction);\n                            } else {\n                                this.stepTo(direction);\n                            }\n                        }\n                    }}\n                ></input>\n                <aside>${this.unitDefinition.symbol}</aside>\n                <button \n                    class=\"right\"\n                    ?disabled=${!canStepUp}\n                    @click=${() => type === 'from' ? this.stepFrom('up') : this.stepTo('up')}\n                >+</button>\n                ${after}\n            </div>\n            <div class=\"input-group-outer input-group-outer__bottom\">\n                <button \n                    class=\"round-button\"\n                    @click=${() => this.roundToNearestInteger(type)}\n                >\n                    Zaokrouhlit\n                </button>\n            </div>\n        </div>\n        `;\n    }\n\n    protected render(): unknown {\n        return html`\n        <div class=\"fields\">\n\n            ${this.renderInput(\n                'from',\n                html`<button \n                    class=\"left\"\n                    ?disabled=${!this.canSetMin()}\n                    @click=${() => this.setMinValue()}\n                >\n                    <svg width=\"20\" height=\"16\" viewBox=\"0 0 20 16\" fill=\"none\">\n                        <line x1=\"5\" y1=\"2\" x2=\"5\" y2=\"14\" stroke=\"currentColor\" stroke-width=\"1\"/>\n                        <line x1=\"5\" y1=\"8\" x2=\"10\" y2=\"4\" stroke=\"currentColor\" stroke-width=\"1\"/>\n                        <line x1=\"5\" y1=\"8\" x2=\"10\" y2=\"12\" stroke=\"currentColor\" stroke-width=\"1\"/>\n                        <line x1=\"5\" y1=\"8\" x2=\"16\" y2=\"8\" stroke=\"currentColor\" stroke-width=\"1\"/>\n                    </svg>\n                </button>`,\n                undefined\n            )}\n            <div class=\"separator separator__line\"></div>\n            ${this.renderInput(\n                'to',\n                undefined,\n                html`<button \n                    class=\"right\"\n                    ?disabled=${!this.canSetMax()}\n                    @click=${() => this.setMaxValue()}\n                >\n                    <svg width=\"20\" height=\"16\" viewBox=\"0 0 20 16\" fill=\"none\">\n                        <line x1=\"15\" y1=\"2\" x2=\"15\" y2=\"14\" stroke=\"currentColor\" stroke-width=\"1\"/>\n                        <line x1=\"15\" y1=\"8\" x2=\"10\" y2=\"4\" stroke=\"currentColor\" stroke-width=\"1\"/>\n                        <line x1=\"15\" y1=\"8\" x2=\"10\" y2=\"12\" stroke=\"currentColor\" stroke-width=\"1\"/>\n                        <line x1=\"15\" y1=\"8\" x2=\"4\" y2=\"8\" stroke=\"currentColor\" stroke-width=\"1\"/>\n                    </svg>\n                </button>`\n            )}\n\n        </div>\n\n        <div class=\"fields fields__separated fields__buttons\">\n            <thermal-btn\n                tooltip=${t(T.fullrange)}\n                @click=${this.handleFullRangeClick}\n                @mouseenter=${this.handleFullRangeMouseEnter}\n                @mouseleave=${this.handleHighlightMouseLeave}\n                @focusin=${this.handleFullRangeMouseEnter}\n                @focusout=${this.handleHighlightMouseLeave}\n                style=\"padding: 0 0.5em; display: flex; align-items: center; justify-content: center;\"\n                ?disabled=${!this.canSetMin() && !this.canSetMax()}\n            >\n                <svg width=\"35\" height=\"16\" viewBox=\"0 0 35 16\" fill=\"none\" style=\"display: block;\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\">\n                    <!-- Minimum-bound icon. -->\n                    <line x1=\"3\" y1=\"2\" x2=\"3\" y2=\"14\" stroke=\"currentColor\" stroke-width=\"1\"/>\n                    <line x1=\"3\" y1=\"8\" x2=\"8\" y2=\"3\" stroke=\"currentColor\" stroke-width=\"1\"/>\n                    <line x1=\"3\" y1=\"8\" x2=\"8\" y2=\"13\" stroke=\"currentColor\" stroke-width=\"1\"/>\n                    <!-- Line connecting the endpoint arrows. -->\n                    <line x1=\"3\" y1=\"8\" x2=\"32\" y2=\"8\" stroke=\"currentColor\" stroke-width=\"1\"/>\n                    <!-- Maximum-bound icon. -->\n                    <line x1=\"32\" y1=\"2\" x2=\"32\" y2=\"14\" stroke=\"currentColor\" stroke-width=\"1\"/>\n                    <line x1=\"32\" y1=\"8\" x2=\"27\" y2=\"3\" stroke=\"currentColor\" stroke-width=\"1\"/>\n                    <line x1=\"32\" y1=\"8\" x2=\"27\" y2=\"13\" stroke=\"currentColor\" stroke-width=\"1\"/>\n                </svg>\n            </thermal-btn>\n            \n            <thermal-btn\n                tooltip=${t(T.automaticrange)}\n                @click=${this.handleAutoRangeClick}\n                @mouseenter=${this.handleAutoRangeMouseEnter}\n                @mouseleave=${this.handleHighlightMouseLeave}\n                @focusin=${this.handleAutoRangeMouseEnter}\n                @focusout=${this.handleHighlightMouseLeave}\n                ?disabled=${this.autoValue === undefined}\n                style=\"padding: 0 0.5em; display: flex; align-items: center; justify-content: center;\"\n            >\n                <svg width=\"56\" height=\"16\" viewBox=\"0 0 56 16\" fill=\"none\" style=\"display: block;\">\n                    <!-- All bars sorted by X coordinate - background (slate color) -->\n                    <rect x=\"2\" y=\"13\" width=\"2\" height=\"1\" fill=\"var(--thermal-slate)\"/>\n                    <rect x=\"4\" y=\"12\" width=\"2\" height=\"2\" fill=\"var(--thermal-slate)\"/>\n                    <rect x=\"6\" y=\"13\" width=\"2\" height=\"1\" fill=\"var(--thermal-slate)\"/>\n                    <rect x=\"8\" y=\"12\" width=\"2\" height=\"2\" fill=\"var(--thermal-slate)\"/>\n                    <rect x=\"10\" y=\"13\" width=\"2\" height=\"1\" fill=\"var(--thermal-slate)\"/>\n                    <rect x=\"12\" y=\"9\" width=\"2\" height=\"5\" fill=\"var(--thermal-slate)\"/>\n                    <rect x=\"14\" y=\"13\" width=\"2\" height=\"1\" fill=\"var(--thermal-slate)\"/>\n                    <rect x=\"16\" y=\"11\" width=\"2\" height=\"3\" fill=\"var(--thermal-slate)\"/>\n                    <rect x=\"18\" y=\"6\" width=\"2\" height=\"8\" fill=\"var(--thermal-slate)\"/>\n                    <rect x=\"20\" y=\"2\" width=\"2\" height=\"12\" fill=\"var(--thermal-slate)\"/>\n                    <rect x=\"22\" y=\"3\" width=\"2\" height=\"11\" fill=\"var(--thermal-slate)\"/>\n                    <rect x=\"24\" y=\"1\" width=\"2\" height=\"13\" fill=\"var(--thermal-slate)\"/>\n                    <rect x=\"26\" y=\"2\" width=\"2\" height=\"12\" fill=\"var(--thermal-slate)\"/>\n                    <rect x=\"28\" y=\"4\" width=\"2\" height=\"10\" fill=\"var(--thermal-slate)\"/>\n                    <rect x=\"30\" y=\"8\" width=\"2\" height=\"6\" fill=\"var(--thermal-slate)\"/>\n                    <rect x=\"32\" y=\"10\" width=\"2\" height=\"4\" fill=\"var(--thermal-slate)\"/>\n                    <rect x=\"34\" y=\"13\" width=\"2\" height=\"1\" fill=\"var(--thermal-slate)\"/>\n                    <rect x=\"36\" y=\"12\" width=\"2\" height=\"2\" fill=\"var(--thermal-slate)\"/>\n                    <rect x=\"38\" y=\"13\" width=\"2\" height=\"1\" fill=\"var(--thermal-slate)\"/>\n                    <rect x=\"40\" y=\"12\" width=\"2\" height=\"2\" fill=\"var(--thermal-slate)\"/>\n                    <rect x=\"42\" y=\"13\" width=\"2\" height=\"1\" fill=\"var(--thermal-slate)\"/>\n                    <rect x=\"44\" y=\"12\" width=\"2\" height=\"2\" fill=\"var(--thermal-slate)\"/>\n                    <rect x=\"46\" y=\"11\" width=\"2\" height=\"3\" fill=\"var(--thermal-slate)\"/>\n                    <rect x=\"48\" y=\"12\" width=\"2\" height=\"2\" fill=\"var(--thermal-slate)\"/>\n                    <rect x=\"50\" y=\"13\" width=\"2\" height=\"1\" fill=\"var(--thermal-slate)\"/>\n                    <rect x=\"52\" y=\"13\" width=\"2\" height=\"1\" fill=\"var(--thermal-slate)\"/>\n                    <!-- Highlighted section - foreground color (sorted by X) -->\n                    <rect x=\"18\" y=\"6\" width=\"2\" height=\"8\" fill=\"var(--thermal-foreground)\"/>\n                    <rect x=\"20\" y=\"2\" width=\"2\" height=\"12\" fill=\"var(--thermal-foreground)\"/>\n                    <rect x=\"22\" y=\"3\" width=\"2\" height=\"11\" fill=\"var(--thermal-foreground)\"/>\n                    <rect x=\"24\" y=\"1\" width=\"2\" height=\"13\" fill=\"var(--thermal-foreground)\"/>\n                    <rect x=\"26\" y=\"2\" width=\"2\" height=\"12\" fill=\"var(--thermal-foreground)\"/>\n                    <rect x=\"28\" y=\"4\" width=\"2\" height=\"10\" fill=\"var(--thermal-foreground)\"/>\n                    <!-- Bottom line with offset -->\n                    <line x1=\"17\" y1=\"15.5\" x2=\"31\" y2=\"15.5\" stroke=\"currentColor\" stroke-width=\"1\"/>\n                </svg>\n            </thermal-btn>\n        </div>\n\n        `;\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"registry-range-form\": RegistryRangeForm;\n    }\n}","import type { ThermalMinmaxOrUndefined, ThermalRangeOrUndefined, ThermalRegistry, ThermalUnit } from \"@labirthermal/core\";\nimport { consume } from \"@lit/context\";\nimport type { PropertyValues } from \"lit\";\nimport { css, html, nothing } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport type { Ref} from \"lit/directives/ref.js\";\nimport { createRef, ref } from \"lit/directives/ref.js\";\nimport { AbstractRegistryConsumer } from \"../../hierarchy/consumers/AbstractRegistryConsumer\";\nimport { registryHighlightContext } from \"../../controllers/RegistryController\";\nimport { managerUnitContext } from \"../../controllers/ManagerController\";\n\ntype TickType = {\n    percentage: number,\n    value: number\n}\n\nexport class RegistryTicksBar extends AbstractRegistryConsumer {\n\n    static TICK_WIDTH = 40;\n    static TICK_FIXED = 2;\n\n    protected ticksRef: Ref<HTMLDivElement> = createRef();\n\n    /** Owns DOM size observation; not reactive because the observer itself is not rendered. */\n    protected observer?: ResizeObserver;\n\n    /** Actual subscription target, retained to remove listeners even after the provided registry changes. */\n    private boundRegistry?: ThermalRegistry;\n\n    /** Actual observed DOM node, retained for cleanup and observer restoration after reconnecting. */\n    private observedTicks?: HTMLDivElement;\n\n    @state()\n    public ticksWidth: number = 0;\n\n    @consume({context: registryHighlightContext, subscribe: true})\n    protected highlight?: ThermalRangeOrUndefined;\n\n     /** The manager's current unit; Celsius is used until it is provided. */\n    @state()\n    @consume({ context: managerUnitContext, subscribe: true })\n    protected unit?: ThermalUnit;\n\n    @property({ type: String, reflect: true })\n    public placement: string = \"top\";\n\n    /** Registry minimum and maximum in Celsius. */\n    @state()\n    public minmax: ThermalMinmaxOrUndefined = undefined;\n\n    @state()\n    protected ticks: TickType[] = [];\n\n    protected containerRef: Ref<HTMLElement> = createRef();\n\n    connectedCallback(): void {\n        super.connectedCallback();\n        this.bindRegistry();\n        this.minmax = this.boundRegistry?.minmax.value;\n        this.ticksWidth = this.ticksRef.value?.clientWidth ?? 0;\n        this.requestUpdate();\n    }\n\n    disconnectedCallback(): void {\n        this.unbindRegistry();\n        this.disconnectObserver();\n        super.disconnectedCallback();\n    }\n\n    willUpdate(changedProperties: PropertyValues<RegistryTicksBar>): void {\n        super.willUpdate(changedProperties);\n\n        // Side effect of the provided registry changing - synchronize its range and subscriptions before rendering.\n        if (this.boundRegistry !== this.registryController?.registryObject && this.isConnected) {\n            this.bindRegistry();\n            this.minmax = this.boundRegistry?.minmax.value;\n        }\n\n        // Side effect of minmax or ticksWidth changing - derive tick positions and labels for the current render.\n        if (changedProperties.has(\"minmax\") || changedProperties.has(\"ticksWidth\")) {\n            this.calculateTicks(this.minmax, this.ticksWidth);\n        }\n    }\n\n    updated(changedProperties: PropertyValues<RegistryTicksBar>): void {\n        super.updated(changedProperties);\n        this.observeTicks();\n    }\n\n    /** Subscribes once to the current registry while connected, replacing the previous range listener. */\n    private bindRegistry(): void {\n        const registry = this.registryController?.registryObject;\n        if (!this.isConnected || registry === this.boundRegistry) {\n            return;\n        }\n        this.unbindRegistry();\n        this.boundRegistry = registry;\n        registry?.minmax.addListener(this.UUID, value => {\n            this.minmax = value;\n        });\n    }\n\n    /** Removes the listener from the actual subscribed registry rather than the current context value. */\n    private unbindRegistry(): void {\n        this.boundRegistry?.minmax.removeListener(this.UUID);\n        this.boundRegistry = undefined;\n    }\n\n    /** Observes the rendered ticks container and restores observation after reconnecting. */\n    private observeTicks(): void {\n        const ticks = this.isConnected ? this.ticksRef.value : undefined;\n        if (ticks === this.observedTicks) {\n            return;\n        }\n        this.disconnectObserver();\n        if (!ticks) {\n            return;\n        }\n        this.observedTicks = ticks;\n        this.observer = new ResizeObserver(entries => {\n            if (!this.isConnected || this.observedTicks !== ticks) {\n                return;\n            }\n            const entry = entries.find(entry => entry.target === ticks);\n            if (entry) {\n                this.ticksWidth = entry.contentRect.width;\n            }\n        });\n        this.observer.observe(ticks);\n    }\n\n    /** Releases observation without requiring the old node to remain in the Lit ref. */\n    private disconnectObserver(): void {\n        this.observer?.disconnect();\n        this.observer = undefined;\n        this.observedTicks = undefined;\n    }\n\n    protected clamp(input: number, min: number, max: number): number {\n        return input < min ? min : input > max ? max : input;\n    }\n\n\n    protected map(current: number, in_min: number, in_max: number, out_min: number, out_max: number): number {\n        const mapped: number = ((current - in_min) * (out_max - out_min)) / (in_max - in_min) + out_min;\n        return this.clamp(mapped, out_min, out_max);\n    }\n\n\n    protected calculateTicks(minmax: ThermalMinmaxOrUndefined, width: number) {\n        if (minmax === undefined) {\n            this.ticks = [];\n        } else {\n\n            const ticksPercentageBuffer = [0];\n\n            const numTicks = Math.floor(width / RegistryTicksBar.TICK_WIDTH) - 2;\n\n            const step = 100 / numTicks;\n\n            for (let i = 1; i < numTicks; i++) {\n\n                ticksPercentageBuffer.push(step * i);\n\n            }\n\n            ticksPercentageBuffer.push(100);\n\n            this.ticks = ticksPercentageBuffer.map(percent => this.calculateOneTick(minmax, percent) as TickType).filter(value => value !== undefined);\n\n        }\n    }\n\n\n    protected calculateOneTick(\n        minmax: ThermalMinmaxOrUndefined,\n        percent: number\n\n    ) {\n        if (minmax === undefined) {\n            return undefined;\n        } else {\n            const value = this.map(percent, 0, 100, minmax.min, minmax.max);\n            return {\n                percentage: percent,\n                value: value\n            } as TickType\n        }\n\n    }\n\n\n    static styles = css`\n\n        .container {\n            padding: 0 calc( var( --thermal-gap ) * .5 );\n            height: var( --thermal-fs );\n            \n        }\n\n        .skeleton {\n            height: 100%;\n            background: var( --thermal-slate-light );\n        }\n\n        .ready {\n            .skeleton {\n                display: none;\n            }\n        }\n\n        .ticks {\n            display: flex;\n            justify-content: space-between;\n            font-size: 10px;\n            width: 100%;\n            position: relative;\n            color: var( --thermal-slate-dark );\n            font-family: sans-serif;\n            height: 1em;\n        }\n\n        .tick {\n\n            position: relative;\n\n        }\n\n        .tick-marker {\n            display: block;\n            width: 1px;\n            height: 10px;\n            background: var(--thermal-slate);\n        }\n\n        .placement-top {\n            margin-top: 10x;\n            padding-bottom: var( --thermal-gap );\n        }\n\n        .placement-bottom {\n            .tick-marker {\n                height: 5px;\n                background: currentcolor;\n                position: absolute;\n                top: 12px;\n            }\n        }\n\n        .tick-value {\n\n            position: absolute;\n            width: 40px;\n            left: -20px;\n            text-align: center;\n        \n        }\n\n\n    `;\n\n\n    protected render(): unknown {\n\n        let highlightLeft: number | undefined = undefined;\n        let highlightWidth: number | undefined = undefined;\n\n        if ( this.minmax && this.highlight ) {\n\n            const min = this.minmax.min;\n            const minmax = this.minmax.max - min;\n\n            highlightLeft = (this.highlight.from - min) / minmax * 100;\n            highlightWidth = (this.highlight.to - min) / minmax * 100 - highlightLeft;\n\n        }\n\n        return html`\n\n            <div class=\"container ${this.minmax !== undefined ? \"ready\" : \"loading\"} placement-${this.placement}\" ${ref(this.containerRef)}>\n\n                <div class=\"skeleton\" data-video-ignore></div>\n\n                <div class=\"ticks\" ${ref(this.ticksRef)}>\n\n                    ${highlightLeft !== undefined && highlightWidth !== undefined\n                ? html`<div class=\"highlight\" style=\"position: absolute; top: 0px; height: 5px; left:${highlightLeft}%; width: ${highlightWidth}%; background-color: var(--thermal-foreground)\"></div>`\n                : nothing\n            }\n\n                    ${this.ticks.map(tick => {\n                return html`\n                    <div class=\"tick\" >\n                        <div class=\"tick-marker\"></div>\n                        <div class=\"tick-value\">\n                            ${this.managerController.toCurrentUnit( tick.value ).toFixed(RegistryTicksBar.TICK_FIXED)}\n                        </div>\n                    </div>\n                        `;\n            })}\n\n                </div>                \n\n            </div>\n        \n        `;\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"registry-ticks-bar\": RegistryTicksBar;\n    }\n}","import type { ThermalUnit } from \"@labirthermal/core\";\nimport { consume } from \"@lit/context\";\nimport type { PropertyValues } from \"lit\";\nimport { css, html } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { styleMap } from \"lit/directives/style-map.js\";\nimport type { ManagerPaletteContextType } from \"../../controllers/ManagerController\";\nimport { managerPaletteContext, managerUnitContext } from \"../../controllers/ManagerController\";\nimport type { RegistryController } from \"../../controllers/RegistryController\";\nimport {\n    registryLoadingContext,\n    registryMaxContext,\n    registryMinContext,\n    registryRangeFromContext,\n    registryRangeToContext,\n} from \"../../controllers/RegistryController\";\nimport { AbstractRegistryConsumer } from \"../../hierarchy/consumers/AbstractRegistryConsumer\";\n\ntype Handle = \"from\" | \"to\";\n\n/** A committed or previewed range. Both endpoints are in Celsius. */\ntype SliderRange = {\n    from: number;\n    to: number;\n};\n\n/** A validated Celsius range together with its registry bounds. */\ntype SliderValues = SliderRange & {\n    min: number;\n    max: number;\n};\n\n/** Captured pointer and registry snapshot used to detect obsolete drag previews. */\ntype DragSession = {\n    pointerId: number;\n    handle: Handle;\n    offsetPixels: number;\n    track: HTMLElement;\n    initialValues: SliderValues;\n    controller: RegistryController;\n};\n\n/**\n * Two-handle slider for the enclosing registry's temperature range.\n *\n * Bounds, committed endpoints, drag previews and all interaction calculations stay\n * in Celsius. Only tooltips and ARIA values use the manager's current display unit.\n *\n * Pointer movement previews a range locally; releasing the pointer commits it once.\n * Keyboard and wheel changes commit immediately. Left/right arrows and the wheel\n * step by 1% of the full interval; Home/End and up/down select the exact bounds.\n * Handles stop at the registry bounds and cannot cross each other.\n */\nexport class RegistryRangeSlider extends AbstractRegistryConsumer {\n\n    // Public configuration\n\n    /** Optional CSS height, overriding `--thermal-range-slider-height` (15px by default). */\n    @property({ type: String, reflect: true })\n    public height: string | null = null;\n\n    /**\n     * Tracks whole-style replacements so they do not erase the height override.\n     * @internal\n     */\n    @property({ type: String, attribute: \"style\" })\n    public heightStyle: string | null = null;\n\n    // Registry and manager context\n\n    /** Registry minimum in Celsius. */\n    @consume({ context: registryMinContext, subscribe: true })\n    @state()\n    public min?: number;\n\n    /** Registry maximum in Celsius. */\n    @consume({ context: registryMaxContext, subscribe: true })\n    @state()\n    public max?: number;\n\n    /** Committed lower endpoint in Celsius, received from the registry context. */\n    @consume({ context: registryRangeFromContext, subscribe: true })\n    @state()\n    public from?: number;\n\n    /** Committed upper endpoint in Celsius, received from the registry context. */\n    @consume({ context: registryRangeToContext, subscribe: true })\n    @state()\n    public to?: number;\n\n    /** Palette used for the selected interval and handle colors. */\n    @consume({ context: managerPaletteContext, subscribe: true })\n    @state()\n    protected palette?: ManagerPaletteContextType;\n\n    /** Loading replaces the controls with a skeleton and cancels any drag preview. */\n    @consume({ context: registryLoadingContext, subscribe: true })\n    @state()\n    protected loading = false;\n\n    /** Rerenders display values when the unit changes; Celsius state is unaffected. */\n    @state()\n    @consume({ context: managerUnitContext, subscribe: true })\n    protected unit?: ThermalUnit;\n\n    // Interaction state\n\n    /** Uncommitted pointer preview in Celsius. */\n    @state()\n    private draft?: SliderRange;\n\n    /** Last selected handle, also used for track-wheel events and equidistant clicks. */\n    @state()\n    private activeHandle: Handle = \"from\";\n\n    /** Active pointer capture and the Celsius values at the beginning of the drag. */\n    private drag?: DragSession;\n\n    // Lifecycle and layout\n\n    protected getClassName(): string {\n        return \"RangeSliderElement\";\n    }\n\n    /** Discards previews and releases pointer capture before leaving the document. */\n    disconnectedCallback(): void {\n        this.cancelDrag();\n        super.disconnectedCallback();\n    }\n\n    /** Reapplies the height override and invalidates drags after registry changes. */\n    willUpdate(changed: PropertyValues<this>): void {\n        super.willUpdate(changed);\n\n        // Context updates include protected properties, which are not part of `keyof this`.\n        const changes: ReadonlyMap<PropertyKey, unknown> = changed;\n        if (changes.has(\"height\") || changes.has(\"heightStyle\")) {\n            this.updateHeightOverride(changes.has(\"height\"));\n        }\n\n        const registryChanged = changes.has(\"min\")\n            || changes.has(\"max\")\n            || changes.has(\"from\")\n            || changes.has(\"to\")\n            || changes.has(\"loading\")\n            || changes.has(\"registryController\");\n\n        if (!registryChanged) {\n            return;\n        }\n\n        this.cancelDrag();\n\n        const hasAllValues = this.min !== undefined\n            && this.max !== undefined\n            && this.from !== undefined\n            && this.to !== undefined;\n\n        if (hasAllValues && !this.values) {\n            this.log(\"Invalid range slider values\", {\n                min: this.min,\n                max: this.max,\n                from: this.from,\n                to: this.to,\n            });\n        }\n    }\n\n    /** Validates CSS height; style-only changes must not repeat invalid-height logs. */\n    private updateHeightOverride(reportInvalidHeight: boolean): void {\n        const height = this.height?.trim();\n        const style = document.createElement(\"div\").style;\n        if (height) {\n            style.height = height;\n        }\n\n        const property = \"--_range-slider-attribute-height\";\n        const current = this.style.getPropertyValue(property);\n        const isUnsupportedHeight = /^(auto|inherit|initial|unset|revert|revert-layer|min-content|max-content|fit-content|stretch|contain)$/i.test(height ?? \"\");\n\n        if (height && style.height && !isUnsupportedHeight) {\n            if (current !== height) {\n                this.style.setProperty(property, height);\n            }\n        } else {\n            if (current) {\n                this.style.removeProperty(property);\n            }\n            if (height && reportInvalidHeight) {\n                this.log(\"Invalid range slider height\", { height: this.height });\n            }\n        }\n    }\n\n    // Celsius range calculations\n\n    /** Returns usable Celsius values; missing context or invalid data cannot drive a slider. */\n    private get values(): SliderValues | undefined {\n        const { min, max, from, to } = this;\n        if (min === undefined || max === undefined || from === undefined || to === undefined) {\n            return undefined;\n        }\n\n        const isFinite = [min, max, from, to, max - min].every(Number.isFinite);\n        const isWithinBounds = min <= from && from <= to && to <= max;\n        if (!isFinite || !isWithinBounds) {\n            return undefined;\n        }\n\n        return { min, max, from, to };\n    }\n\n    /** Maps a Celsius temperature to its track position; a constant interval starts at 0%. */\n    private percent(value: number, values: SliderValues): number {\n        return values.max === values.min ? 0 : (value - values.min) / (values.max - values.min) * 100;\n    }\n\n    /** Clamps one Celsius endpoint to the registry bound and the opposite handle. */\n    private constrain(handle: Handle, value: number, values: SliderValues, range: SliderRange): SliderRange {\n        if (handle === \"from\") {\n            return { from: Math.max(values.min, Math.min(range.to, value)), to: range.to };\n        }\n        return { from: range.from, to: Math.min(values.max, Math.max(range.from, value)) };\n    }\n\n    /**\n     * Commits a Celsius range; context subscriptions receive the validated core values.\n     * Never copy the controller's public display-unit endpoints back into local state:\n     * rounding during that conversion can move an exact endpoint outside its bound.\n     */\n    private commit(range: SliderRange): void {\n        this.cancelDrag();\n        if (range.from === this.from && range.to === this.to) {\n            return;\n        }\n\n        this.registryController.setRange(range.from, range.to);\n    }\n\n    /** Clears the session before releasing capture, which can fire `lostpointercapture`. */\n    private cancelDrag(): void {\n        const drag = this.drag;\n        this.drag = undefined;\n        this.draft = undefined;\n        if (drag?.track.hasPointerCapture(drag.pointerId)) {\n            drag.track.releasePointerCapture(drag.pointerId);\n        }\n    }\n\n    // Pointer interaction\n\n    /** Selects a handle, preserves the grab offset and starts a captured local preview. */\n    private pointerDown(event: PointerEvent): void {\n        const values = this.values;\n        if (!values || this.loading || values.min === values.max || this.drag || event.button !== 0) {\n            return;\n        }\n\n        const track = event.currentTarget;\n        const target = event.target;\n        if (!(track instanceof HTMLElement) || !(target instanceof HTMLElement)) {\n            return;\n        }\n\n        const rect = track.getBoundingClientRect();\n        if (rect.width === 0) {\n            return;\n        }\n\n        const pointerPercent = (event.clientX - rect.left) / rect.width * 100;\n        const clickedHandle = target.closest<HTMLElement>(\"[data-handle]\")?.dataset.handle;\n        let handle: Handle;\n        let offsetPixels = 0;\n\n        if (clickedHandle === \"from\" || clickedHandle === \"to\") {\n            handle = clickedHandle;\n            offsetPixels = event.clientX - rect.left - this.percent(values[handle], values) / 100 * rect.width;\n        } else {\n            const fromDistance = Math.abs(pointerPercent - this.percent(values.from, values));\n            const toDistance = Math.abs(pointerPercent - this.percent(values.to, values));\n\n            if (fromDistance === toDistance) {\n                handle = this.activeHandle;\n            } else {\n                handle = fromDistance < toDistance ? \"from\" : \"to\";\n            }\n        }\n\n        event.preventDefault();\n        this.activeHandle = handle;\n        track.querySelector<HTMLElement>(`[data-handle=\"${handle}\"]`)?.focus({ preventScroll: true });\n        this.draft = { from: values.from, to: values.to };\n        this.drag = {\n            pointerId: event.pointerId,\n            handle,\n            offsetPixels,\n            track,\n            initialValues: values,\n            controller: this.registryController,\n        };\n        track.setPointerCapture(event.pointerId);\n        this.pointerMove(event);\n    }\n\n    /** Updates only the Celsius draft, or cancels it if the captured registry state changed. */\n    private pointerMove(event: PointerEvent): void {\n        const drag = this.drag;\n        const values = this.values;\n        if (!drag || event.pointerId !== drag.pointerId) {\n            return;\n        }\n        if (!values || !this.draft || this.loading) {\n            this.cancelDrag();\n            return;\n        }\n\n        const registryChanged = this.registryController !== drag.controller\n            || values.min !== drag.initialValues.min\n            || values.max !== drag.initialValues.max\n            || values.from !== drag.initialValues.from\n            || values.to !== drag.initialValues.to;\n\n        if (registryChanged) {\n            this.cancelDrag();\n            return;\n        }\n\n        const rect = drag.track.getBoundingClientRect();\n        if (rect.width === 0) {\n            return;\n        }\n\n        const pointerFraction = (event.clientX - rect.left - drag.offsetPixels) / rect.width;\n        const fraction = Math.max(0, Math.min(1, pointerFraction));\n\n        // Use the original Celsius endpoint at each edge, not an interpolated approximation.\n        let value: number;\n        if (fraction === 0) {\n            value = values.min;\n        } else if (fraction === 1) {\n            value = values.max;\n        } else {\n            value = values.min + fraction * (values.max - values.min);\n        }\n\n        this.draft = this.constrain(drag.handle, value, values, this.draft);\n    }\n\n    /** Includes the release position before committing the final, clamped Celsius draft. */\n    private pointerUp(event: PointerEvent): void {\n        if (this.drag?.pointerId !== event.pointerId) {\n            return;\n        }\n\n        this.pointerMove(event);\n        const range = this.draft;\n        if (range) {\n            this.commit(range);\n        } else {\n            this.cancelDrag();\n        }\n    }\n\n    /** Pointer cancellation or lost capture must never commit a preview. */\n    private pointerCancel(event: PointerEvent): void {\n        if (this.drag?.pointerId === event.pointerId) {\n            this.cancelDrag();\n        }\n    }\n\n    // Keyboard and wheel interaction\n\n    /** Moves by 1% of the Celsius interval, or selects an exact bound with Home/End. */\n    private keyDown(event: KeyboardEvent, handle: Handle): void {\n        const values = this.values;\n        if (!values || this.loading || values.min === values.max) {\n            return;\n        }\n\n        const step = (values.max - values.min) / 100;\n        let value: number;\n        switch (event.key) {\n            case \"ArrowLeft\":\n                value = Number((values[handle] - step).toPrecision(15));\n                break;\n            case \"ArrowRight\":\n                value = Number((values[handle] + step).toPrecision(15));\n                break;\n            // Keep the existing horizontal slider's up/down shortcuts.\n            case \"ArrowUp\":\n            case \"Home\":\n                value = values.min;\n                break;\n            case \"ArrowDown\":\n            case \"End\":\n                value = values.max;\n                break;\n            default:\n                return;\n        }\n\n        event.preventDefault();\n        event.stopPropagation();\n        this.activeHandle = handle;\n        this.commit(this.constrain(handle, value, values, values));\n    }\n\n    /** Commits a 1% Celsius step per wheel direction; active drags take precedence. */\n    private wheel(event: WheelEvent, handle: Handle): void {\n        const values = this.values;\n        if (!values || this.loading || values.min === values.max || event.deltaY === 0 || this.drag) {\n            return;\n        }\n\n        event.preventDefault();\n        event.stopPropagation();\n        this.activeHandle = handle;\n\n        const step = Math.sign(event.deltaY) * (values.max - values.min) / 100;\n        const value = Number((values[handle] + step).toPrecision(15));\n        this.commit(this.constrain(handle, value, values, values));\n    }\n\n    // Rendering\n\n    /** Converts Celsius to the display unit only for ARIA values and the visible tooltip. */\n    private renderHandle(handle: Handle, values: SliderValues, range: SliderRange) {\n        const disabled = values.min === values.max;\n        const valueInCurrentUnit = this.managerController.toCurrentUnit(range[handle]);\n        const minimumInCurrentUnit = this.managerController.toCurrentUnit(handle === \"from\" ? values.min : range.from);\n        const maximumInCurrentUnit = this.managerController.toCurrentUnit(handle === \"from\" ? range.to : values.max);\n        const label = this.managerController.formatSingle(valueInCurrentUnit);\n        const background = handle === \"from\"\n            ? this.palette?.data.pixels[0]\n            : this.palette?.data.pixels[this.palette.data.pixels.length - 1];\n\n        return html`\n            <div class=\"handle-position ${this.activeHandle === handle ? \"active\" : \"\"}\"\n                style=${styleMap({ left: `${this.percent(range[handle], values)}%` })}>\n                <button type=\"button\" class=\"handle\" data-handle=${handle} role=\"slider\"\n                    aria-label=${this.t(handle === \"from\" ? \"minimaltemperature\" : \"maximaltemperature\")}\n                    aria-orientation=\"horizontal\"\n                    aria-valuemin=${minimumInCurrentUnit}\n                    aria-valuemax=${maximumInCurrentUnit}\n                    aria-valuenow=${valueInCurrentUnit}\n                    aria-valuetext=${label}\n                    ?disabled=${disabled}\n                    style=${styleMap({ background })}\n                    @focus=${() => { this.activeHandle = handle; }}\n                    @keydown=${(event: KeyboardEvent) => this.keyDown(event, handle)}\n                    @wheel=${(event: WheelEvent) => this.wheel(event, handle)}>\n                </button>\n                <span class=\"tooltip\" aria-hidden=\"true\">${label}</span>\n            </div>`;\n    }\n\n    static styles = css`\n        :host {\n            display: block;\n            box-sizing: content-box;\n            --_range-slider-attribute-height: initial;\n            height: var(--_range-slider-attribute-height, var(--thermal-range-slider-height, 15px));\n            padding-bottom: max(0px, calc(var(--thermal-gap) - 15px));\n            margin-bottom: -6px;\n        }\n\n        .container {\n            height: 100%;\n            padding: 0 calc(var(--thermal-gap) * .5);\n            color: var(--thermal-slate-dark);\n            font-size: 12px;\n        }\n\n        .slider-row {\n            display: flex;\n            align-items: center;\n            height: 100%;\n        }\n\n        .track {\n            position: relative;\n            flex: 1;\n            min-width: 0;\n            height: 100%;\n            background: var(--thermal-slate);\n            cursor: pointer;\n            touch-action: none;\n        }\n\n        .fill {\n            position: absolute;\n            height: 100%;\n            pointer-events: none;\n        }\n\n        .handle-position {\n            position: absolute;\n            top: 0;\n            height: 100%;\n            z-index: 20;\n        }\n\n        .handle-position.active {\n            z-index: 21;\n        }\n\n        .handle {\n            position: absolute;\n            top: 50%;\n            transform: translate(-50%, -50%);\n            box-sizing: border-box;\n            width: 14px;\n            height: calc(100% + 5px);\n            padding: 0;\n            border-radius: 0;\n            border: 2px solid var(--thermal-primary);\n            background: var(--thermal-background);\n            box-shadow: 0 0 5px var(--thermal-primary);\n            cursor: grab;\n            touch-action: none;\n        }\n\n        .handle:hover,\n        .handle:focus-visible {\n            box-shadow: 0 0 10px var(--thermal-primary);\n        }\n\n        .handle:focus-visible {\n            outline: 2px solid var(--thermal-primary);\n            outline-offset: 2px;\n        }\n\n        .handle:active {\n            cursor: grabbing;\n        }\n\n        .handle:disabled {\n            cursor: default;\n        }\n\n        .tooltip {\n            position: absolute;\n            transform: translate(-50%, -50%);\n            white-space: nowrap;\n            pointer-events: none;\n            top: calc(100% + 16.5px);\n            min-width: 40px;\n            height: 20px;\n            line-height: 20px;\n            text-align: center;\n            padding: 0 3px;\n            background: var(--thermal-slate-dark);\n            color: var(--thermal-background);\n            border: 1px solid var(--thermal-slate-dark);\n            border-radius: 3px;\n        }\n\n        .tooltip::before {\n            content: \"\";\n            position: absolute;\n            top: -4px;\n            left: calc(50% - 4px);\n            width: 7px;\n            height: 7px;\n            transform: rotate(45deg);\n            background: var(--thermal-slate-dark);\n        }\n\n        .skeleton {\n            height: 100%;\n            background: var(--thermal-slate);\n        }\n    `;\n\n    /** Renders the Celsius geometry with current-unit labels, or a loading placeholder. */\n    protected render(): unknown {\n        const values = this.values;\n        if (this.loading || !values) {\n            return html`\n                <div class=\"container loading\" aria-busy=${this.loading}>\n                    <div class=\"skeleton\"></div>\n                </div>\n                <slot></slot>\n            `;\n        }\n\n        const range = this.draft ?? values;\n        const left = this.percent(range.from, values);\n        const right = this.percent(range.to, values);\n\n        return html`\n            <div class=\"container ready\">\n                <div class=\"slider-row\">\n                    <div class=\"track\"\n                        @pointerdown=${this.pointerDown}\n                        @pointermove=${this.pointerMove}\n                        @pointerup=${this.pointerUp}\n                        @pointercancel=${this.pointerCancel}\n                        @lostpointercapture=${this.pointerCancel}\n                        @wheel=${(event: WheelEvent) => this.wheel(event, this.activeHandle)}>\n                        <div class=\"fill\" style=${styleMap({\n                            left: `${left}%`,\n                            width: `${right - left}%`,\n                            background: this.palette?.data.gradient,\n                        })}></div>\n                        ${this.renderHandle(\"from\", values, range)}\n                        ${this.renderHandle(\"to\", values, range)}\n                    </div>\n                </div>\n            </div>\n            <slot></slot>`;\n    }\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"registry-range-slider\": RegistryRangeSlider;\n    }\n}\n","import { css, html, nothing } from \"lit\";\n\nimport type { ThermalRegistry } from \"@labirthermal/core\";\nimport { property, state } from \"lit/decorators.js\";\nimport { AbstractRegistryConsumer } from \"../../hierarchy/consumers/AbstractRegistryConsumer\";\nimport { classMap } from \"lit/directives/class-map.js\";\n\nexport class RegistryHistogram extends AbstractRegistryConsumer {\n\n    @state()\n    protected histogram: ThermalRegistry[\"histogram\"][\"value\"] = [];\n\n    @property( { type: String, reflect: true } )\n    public height: string = \"calc( var( --thermal-gap ) * 1.5 )\";\n\n    @property({type: String, reflect: true })\n    public heightExpanded: string = \"400px\";\n\n    /** Enables click-to-expand when present; defaults to false and reflects as a boolean attribute. */\n    @property({ type: Boolean, reflect: true })\n    public expandable: boolean = false;\n\n    @state()\n    protected expanded: boolean = false;\n\n    @state()\n    protected loading: boolean = false;\n\n    @state()\n    protected error: boolean = false;\n\n    protected getClassName(): string {\n        return \"HistogramElement\";\n    }\n\n    connectedCallback(): void {\n        super.connectedCallback();\n        this.loading = this.registryObject.histogram.loading;\n        this.histogram = this.registryObject.histogram.value;\n\n        this.registryObject.histogram.addListener( this.UUID, value => {\n            this.histogram = value;\n        } );\n\n        this.registryObject.histogram.onCalculationStart.set( this.UUID, () => {\n            this.loading = true;\n            this.error = false;\n        } );\n\n        this.registryObject.histogram.onCalculationEnd.set( this.UUID, (success) => {\n            this.loading = false;\n            this.error = !success;\n        } );\n\n        this.registryObject.loading.addListener( this.UUID, value => {\n            if (value === true) {\n                this.loading = true;\n            }\n        })\n\n    }\n\n    disconnectedCallback(): void {\n        super.disconnectedCallback();\n        this.registryObject.loading.removeListener(this.UUID);\n        this.registryObject.histogram.removeListener( this.UUID );\n        this.registryObject.histogram.onCalculationStart.delete( this.UUID );\n        this.registryObject.histogram.onCalculationEnd.delete( this.UUID );\n    }\n\n    static styles = css`\n\n        @keyframes spinner {\n            0% {left: 0px; width: 0%;}\n            50% {left: 25%; width: 50%;}\n            100% {left: 100%; width: 0%;}\n        }\n\n        .container {\n            padding: 0 calc( var( --thermal-gap ) * .5 );\n            position: relative;\n\n            .spinner {\n                position: absolute;\n                top: 0;\n                left: 0;\n                width: 100%;\n                height: 100%;\n                display: none;\n                align-items: center;\n                justify-content: center;\n                \n\n                span {\n                    width: calc( 100% - var(--thermal-gap) );\n                    height: 6px;\n                    display: block;\n                    position: relative;\n                    overflow: hidden;\n                    border-radius: 3px;\n\n                    &::after {\n                        content: \"\";\n                        display: block;\n                        background: var(--thermal-slate-dark);\n                        position: absolute;\n                        opacity: .2;\n                        height: 100%;\n                        animation-name: spinner;\n                        animation-duration: 1s;\n                        animation-iteration-count: infinite;\n                        animation-timing-function: linear\n                    }\n                }\n\n            }\n\n            &.loading:not(.has-error) {\n\n                .spinner {\n                    display: flex;\n                }\n\n                .histogram {\n                    opacity: .8;\n                }\n            }\n\n        }\n\n        .histogram {\n            display: flex;\n            width: 100%;\n            background:  transparent;\n            transition: opacity .3s ease-in-out;\n\n            &.expandable {\n                transition: all .2s ease-in-out;\n                cursor: pointer;\n                &:hover {\n                    background: var(--thermal-background);\n                }\n            }\n        }\n\n        .histogram-bar {\n            flex-grow: 1;\n            position: relative;\n            height: 100%;\n\n            &:hover {\n                .histogram-bar-inner {\n                    background: var(--thermal-foreground);\n                }\n            }\n        }\n\n        .histogram-bar-inner {\n            position: absolute;\n            bottom: 0px;\n            left: 0px;\n            width: 100%;\n            background: var(--thermal-slate-dark);\n            transition: height .5s ease-in-out;\n        }\n\n        .error {\n            position: absolute;\n            top: 0;\n            left: 0;\n            width: 100%;\n            height: 100%;\n            background: var(--thermal-slate-light);\n            color: var(--thermal-slate);\n            display: flex;\n            align-items: center;\n            justify-content: center;\n            font-size: 10px;\n        }\n\n\n    `;\n\n    protected render(): unknown {\n\n        const isLoading = this.histogram.length > 0 && this.loading === false;\n\n        const containerClasses = {\n            \"container\": true,\n            \"ready\": isLoading,\n            \"loading\": !isLoading,\n            \"has-error\": this.error === true,\n            \"is-ok\": this.error !== true\n        };\n\n        const histogramClasses = {\n            \"histogram\": true,\n            \"expandable\": this.expandable === true\n        }\n\n        return html`\n\n            <div class=\"${classMap(containerClasses)}\">\n\n                <div class=\"${classMap(histogramClasses)}\" style=\"height: ${this.expanded ? this.heightExpanded: this.height}\" part=\"bg\" @click=${() => {\n                    if ( this.expandable === true ) {\n                        this.expanded = !this.expanded;\n                    }\n                }}>\n\n                    ${this.histogram.map( item => {\n\n                        return html`\n                            <div class=\"histogram-bar\" data-height=\"${item.height}\" data-percentage=\"${item.percentage}\" data-count=\"${item.count}\" data-from=\"${item.from}\" data-to=\"${item.to}\">\n                                <div style=\"height: ${item.height}%\" class=\"histogram-bar-inner\"></div>\n                            </div\n                        `;\n\n                    } )}\n\n                </div>\n\n                ${this.error === true\n                    ? html`<div class=\"error\">Unable to calculate the histogram</div>`\n                    : nothing\n                }\n\n                <div class=\"spinner\">\n                    <span></span>\n                </div>\n\n            </div>\n        \n        `;\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"registry-histogram\": RegistryHistogram;\n    }\n}","import type { ThermalUnit } from \"@labirthermal/core\";\nimport { consume } from \"@lit/context\";\nimport { t } from \"i18next\";\nimport { html } from \"lit\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport type { Ref} from \"lit/directives/ref.js\";\nimport { createRef, ref } from \"lit/directives/ref.js\";\nimport { managerUnitContext } from \"../../controllers/ManagerController\";\nimport { registryMaxContext, registryMinContext } from \"../../controllers/RegistryController\";\nimport { AbstractRegistryConsumer } from \"../../hierarchy/consumers/AbstractRegistryConsumer\";\nimport { T } from \"../../translations/Languages\";\nimport { state } from \"lit/decorators/state.js\";\n\nexport class RegistryRangeFullButton extends AbstractRegistryConsumer {\n\n    protected buttonRef: Ref<HTMLElement> = createRef();\n\n    @state()\n    @consume({ context: registryMinContext, subscribe: true })\n    private min?: number;\n\n    @state()\n    @consume({ context: registryMaxContext, subscribe: true })\n    private max?: number;\n\n    @state()\n    @consume({ context: managerUnitContext, subscribe: true })\n    private unit?: ThermalUnit;\n\n    /** Format Celsius bounds only when displaying them; interactions use the core bounds. */\n    private get value(): string | undefined {\n        const bounds = this.registryController?.registryObject.minmax.value;\n        const min = this.min ?? bounds?.min;\n        const max = this.max ?? bounds?.max;\n        if (min === undefined || max === undefined) return undefined;\n\n        return this.managerController.formatRange(\n            this.managerController.toCurrentUnit(min),\n            this.managerController.toCurrentUnit(max)\n        );\n    }\n\n    doAction() {\n        this.registryObject.range.applyMinmax();\n    }\n\n    mouseenter() {\n\n        if (this.registryObject.minmax.value !== undefined && this.registryController) {\n            this.registryController.setHighlight({\n                from: this.registryObject.minmax.value.min,\n                to: this.registryObject.minmax.value.max\n            });\n        }\n    }\n\n    mouseleave() {\n\n        if (this.registryController) {\n            this.registryController.setHighlight(undefined);\n        }\n\n    }\n\n    protected render(): unknown {\n        return html`<thermal-btn \n    ${ref(this.buttonRef)} \n    @click=${this.doAction} \n    @mouseenter=\"${this.mouseenter}\" \n    @mouseleave=\"${this.mouseleave}\"\n    @focus=\"${this.mouseenter}\"\n    @blur=\"${this.mouseleave}\"\n    tooltip=\"${ifDefined( this.value )}\"\n>${t(T.fullrange)}</thermal-btn>`;\n    }\n\n\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"registry-range-full-button\": RegistryRangeFullButton;\n    }\n}\n","import type { ThermalRangeOrUndefined, ThermalRegistry, ThermalUnit } from \"@labirthermal/core\";\nimport { consume } from \"@lit/context\";\nimport { t } from \"i18next\";\nimport { html, type PropertyValues } from \"lit\";\nimport { state } from \"lit/decorators.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { managerUnitContext } from \"../../controllers/ManagerController\";\nimport { AbstractRegistryConsumer } from \"../../hierarchy/consumers/AbstractRegistryConsumer\";\nimport { T } from \"../../translations/Languages\";\n\nexport class RegistryRangeAutoButton extends AbstractRegistryConsumer {\n\n    /** The auto range remains in Celsius until it is formatted for the tooltip. */\n    @state()\n    private autoRange: ThermalRangeOrUndefined;\n\n    @state()\n    @consume({ context: managerUnitContext, subscribe: true })\n    private unit?: ThermalUnit;\n\n    private boundRegistry?: ThermalRegistry;\n\n    connectedCallback(): void {\n        super.connectedCallback();\n        this.bindRegistry();\n    }\n\n    disconnectedCallback(): void {\n        this.unbindRegistry();\n        super.disconnectedCallback();\n    }\n\n    willUpdate(changedProperties: PropertyValues<this>): void {\n        super.willUpdate(changedProperties);\n        this.bindRegistry();\n    }\n\n    /** Follow the auto range itself and remove the listener from the original registry. */\n    private bindRegistry(): void {\n        const registry = this.registryController?.registryObject;\n        if (!this.isConnected || registry === this.boundRegistry) return;\n\n        this.unbindRegistry();\n        this.boundRegistry = registry;\n        this.autoRange = registry?.range.autoValue;\n        registry?.range.onAutoValueChanged.set(this.UUID, value => {\n            this.autoRange = value;\n        });\n    }\n\n    private unbindRegistry(): void {\n        this.boundRegistry?.range.onAutoValueChanged.delete(this.UUID);\n        this.boundRegistry = undefined;\n    }\n\n    private get value(): string | undefined {\n        if (!this.autoRange) return undefined;\n        return this.managerController.formatRange(\n            this.managerController.toCurrentUnit(this.autoRange.from),\n            this.managerController.toCurrentUnit(this.autoRange.to)\n        );\n    }\n\n    doAction() {\n        this.registryObject.range.applyAuto();\n    }\n\n    private onHighlight() {\n\n        if (this.registryController.registryObject.range.autoValue) {\n            this.registryController.setHighlight(this.registryController.registryObject.range.autoValue);\n        }\n\n    }\n\n    private onOut() {\n        this.registryController.setHighlight(undefined);\n    }\n\n    protected render(): unknown {\n        return html`<thermal-btn \n            @click=${this.doAction}\n            @mouseenter=${this.onHighlight}\n            @mouseleave=${this.onOut}\n            @focus=${this.onHighlight}\n            @blur=${this.onOut}\n            tooltip=\"${ifDefined( this.value )}\"\n        >${t(T.automaticrange)}</thermal-btn>`;\n    }\n\n    \n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"registry-range-auto-button\": RegistryRangeAutoButton;\n    }\n}","import { consume } from \"@lit/context\";\nimport { html, nothing } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { AbstractRegistryConsumer } from \"../../hierarchy/consumers/AbstractRegistryConsumer\";\nimport { registryRangeToContext } from \"../../controllers/RegistryController\";\nimport { registryRangeFromContext } from \"../../controllers/RegistryController\";\nimport type { ThermalUnit } from \"@labirthermal/core\";\nimport { managerUnitContext } from \"../../controllers/ManagerController\";\n\nexport class RegistryRangeDisplay extends AbstractRegistryConsumer {\n\n    @consume({ context: registryRangeFromContext, subscribe: true })\n    protected from?: number;\n\n    @consume({ context: registryRangeToContext, subscribe: true })\n    protected to?: number;\n\n    /** Rerenders the labels when the manager's display unit changes. */\n    @state()\n    @consume({ context: managerUnitContext, subscribe: true })\n    protected unit?: ThermalUnit;\n\n    @property({\n        type: String, reflect: true, attribute: true, converter: {\n            fromAttribute: (value: string) => {\n                return Math.round(parseFloat(value))\n            },\n            toAttribute: (value: number) => {\n                return value.toString();\n            }\n        }\n    })\n    public fixed: number = 2;\n\n    @property({ type: String, reflect: true, attribute: true })\n    public separator: string = \"-\";\n\n    protected render(): unknown {\n\n        if (this.from === undefined || this.to === undefined) {\n            return nothing;\n        }\n\n        const from = this.managerController.toCurrentUnit(this.from);\n        const to = this.managerController.toCurrentUnit(this.to);\n        const symbol = this.managerController.currentUnit.symbol;\n\n        return html`\n            <div>\n                <span>${from.toFixed(this.fixed)} ${symbol}</span>\n                <span>${this.separator}</span>\n                <span>${to.toFixed(this.fixed)} ${symbol}</span>\n            </div>\n        `;\n    }\n\n\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"registry-range-display\": RegistryRangeDisplay;\n    }\n}","import { consume } from \"@lit/context\";\nimport { css, html } from \"lit\";\nimport { live } from \"lit/directives/live.js\";\nimport type { Ref} from \"lit/directives/ref.js\";\nimport { createRef, ref } from \"lit/directives/ref.js\";\nimport { AbstractRegistryConsumer } from \"../../hierarchy/consumers/AbstractRegistryConsumer\";\nimport { registryOpacityContext } from \"../../controllers/RegistryController\";\n\nexport class RegistryOpacitySlider extends AbstractRegistryConsumer {\n\n    @consume({\n        context: registryOpacityContext, \n        subscribe: true\n    })\n    public value!: number;\n\n    protected containerRef: Ref<HTMLElement> = createRef();\n\n    /** Handle user input events */\n    handleUserChangeEvent( event: {target: {value: string}} ) {\n        const value = parseFloat( event.target.value );\n        this.registryObject.opacity.imposeOpacity( value );\n    }\n\n\n    static styles = css`\n\n        :host {\n        }\n\n        .thermal-opacity-handler {\n            display: block;\n            width: 100%;\n            max-width: 100px;\n            min-width: 75px;\n            cursor: pointer;\n            accent-color: var(--thermal-primary);\n            \n        }\n        \n        .thermal-opacity-container {\n            display: flex;\n            width: 100%;\n            align-items: space-between;\n            justify-content: space-between;\n            color: var( --thermal-slate-dark );\n            font-size: calc( var( --thermal-fs-sm ) * .7 );\n            max-width: 100px;\n            min-width: 75px;\n        }\n    \n    `;\n\n    protected render(): unknown {\n        return html`\n            <div ${ref(this.containerRef)}>\n                <input\n                    id=\"handler\"\n                    class=\"thermal-opacity-handler\"\n                    type=\"range\"\n                    min=\"0\"\n                    max=\"1\"\n                    step=\"0.01\"\n                    .value=${live(String(this.value))}\n                    @input=\"${this.handleUserChangeEvent}\"\n                />\n                <div class=\"thermal-opacity-container\">\n                    <div>VIS</div>\n                    <div>${this.value}</div>\n                    <div>IR</div>\n                </div>\n            </div>\n            <slot></slot>\n        `;\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"registry-opacity-slider\": RegistryOpacitySlider;\n    }\n}","/**\n * @license\n * Copyright 2014-2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { CSSResultGroup, PropertyValues } from 'lit';\nimport { css, html, nothing } from 'lit';\nimport { state } from 'lit/decorators.js';\nimport { guard } from 'lit/directives/guard.js';\n\nimport type { ThermalFileInstance, ThermalGroup, ThermalUnit } from '@labirthermal/core';\nimport { consume } from '@lit/context';\nimport { managerUnitContext } from '../../controllers/ManagerController';\nimport { AbstractGroupConsumer } from '../../hierarchy/consumers/AbstractGroupConsumer';\n\n\nexport class GroupChartElement extends AbstractGroupConsumer {\n\n    @state()\n    protected instances: ThermalFileInstance[] = [];\n\n    @state()\n    protected timeout?: NodeJS.Timeout;\n\n    @state()\n    protected data: [\n        string[],\n        ...[Date, ...number[]][]\n    ] | undefined;\n\n    @state()\n    protected colors?: string[];\n\n    @state()\n    protected on: boolean = false;\n\n    @state()\n    @consume({ context: managerUnitContext, subscribe: true })\n    protected unit?: ThermalUnit;\n\n    private boundGroup?: ThermalGroup;\n\n    connectedCallback(): void {\n        super.connectedCallback();\n        this.bindGroup();\n    }\n\n    disconnectedCallback(): void {\n        this.unbindGroup();\n        super.disconnectedCallback();\n    }\n\n    willUpdate(changedProperties: PropertyValues<this>): void {\n        super.willUpdate(changedProperties);\n        this.bindGroup();\n    }\n\n    /** Subscribe to the actual group and hydrate graphs that already exist. */\n    private bindGroup(): void {\n        const group = this.groupController?.groupObject;\n        if (!this.isConnected || group === this.boundGroup) return;\n\n        this.unbindGroup();\n        this.boundGroup = group;\n        this.receiveGraph(group?.analysisGraph.value);\n        if (!group) return;\n\n        group.files.addListener(this.UUID, () => group.analysisGraph.turnOn());\n        group.analysisGraph.addListener(this.UUID, this.receiveGraph);\n        group.analysisGraph.turnOn();\n    }\n\n    private unbindGroup(): void {\n        this.boundGroup?.files.removeListener(this.UUID);\n        this.boundGroup?.analysisGraph.removeListener(this.UUID);\n        this.boundGroup = undefined;\n    }\n\n    private readonly receiveGraph = (value: ThermalGroup[\"analysisGraph\"][\"value\"]): void => {\n        this.data = value?.data;\n        this.colors = value?.colors;\n        this.on = value !== undefined;\n    };\n\n    /** Copy the graph data and convert only temperatures, leaving core data in Celsius. */\n    private getChartData(): typeof this.data {\n        if (!this.data) return undefined;\n\n        const [header, ...rows] = this.data;\n        const converted: [Date, ...number[]][] = rows.map(([time, ...values]) => [\n            time,\n            ...values.map(value => Number.isFinite(value)\n                ? this.managerController.toCurrentUnit(value)\n                : value),\n        ]);\n        return [[...header], ...converted];\n    }\n\n    static styles?: CSSResultGroup | undefined = css`\n    \n        .wrapper {\n            transition: all 0.3s ease-in-out;\n            width: 100%;\n            overflow: hidden;\n        }\n\n        .on {\n            height: 300px;\n            border-bottom: 1px solid var( --thermalforeground );\n        }\n\n        .off {\n            height: 0px;\n        }\n\n    `;\n\n    download() {\n\n        const svg = this.shadowRoot?.querySelectorAll(\"thermal-chart\");\n\n        console.log(svg);\n\n    }\n\n\n    protected render(): unknown {\n\n\n        return html`\n            <div class=\"wrapper ${this.on ? \"on\" : \"off\"}\">\n\n                ${this.on === true ? html`\n                    <thermal-chart\n                        .data=${guard([this.data, this.unit], () => this.getChartData())}\n                        .options=${guard([this.colors, this.unit], () => ({\n                            colors: this.colors,\n                            legend: { position: 'bottom' },\n                            hAxis: { title: 'Time' },\n                            vAxis: { title: `Temperature ${this.managerController.currentUnit.symbol}` },\n                            chartArea: {\n                                width: '90%',\n                            },\n                        }))}\n                        type=\"line\"\n                        width=\"100%\"\n                        style=\"width: 100%;height: 300px\"\n                    ></thermal-chart>\n                ` : nothing}\n                \n            </div>\n        `;\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"group-chart\": GroupChartElement;\n    }\n}","import { t } from \"i18next\";\nimport type { CSSResultGroup } from \"lit\";\nimport { css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { AbstractGroupConsumer } from \"../../hierarchy/consumers/AbstractGroupConsumer\";\nimport { T } from \"../../translations/Languages\";\n\nexport class GroupAnalysisSyncButton extends AbstractGroupConsumer {\n\n    @property({ type: Boolean, reflect: true })\n    public on: boolean = false;\n\n    connectedCallback(): void {\n        super.connectedCallback();\n\n        if (this.on) {\n            const id = this.UUID + \"__initial\";\n            this.groupObject.files.addListener(id, value => {\n                if (value.length > 0) {\n                    this.groupObject.analysisSync.turnOn(value[0]);\n                    this.groupObject.files.removeListener(id);\n                }\n            });\n        } else {\n            this.on = this.groupObject.analysisSync.value;\n        }\n\n        this.groupObject.analysisSync.addListener(this.UUID, value => {\n            this.on = value;\n        });\n\n        this.addEventListener(\"click\", () => {\n            this.toggle();\n        });\n    }\n\n    public turnOn() {\n        if (this.groupObject.files.value.length > 0) {\n            this.groupObject.analysisSync.turnOn(this.groupObject.files.value[0]);\n        }\n    }\n\n    public turnOff() {\n        this.groupObject.analysisSync.turnOff();\n    }\n\n    public toggle() {\n        if (this.on) {\n            this.turnOff();\n        } else {\n            this.turnOn();\n        }\n    }\n\n    public static styles?: CSSResultGroup | undefined = css`\n    \n        :host {\n            font-size: var(--thermal-fs);\n            cursor: pointer;\n        }\n\n        :host(:hover) {\n            span {\n\n            }\n\n        }\n\n        :host([on=true]) {\n            span i {\n                background: var(--thermal-primary);\n            }\n        }\n\n        :host([on=false]) {\n            span i {\n                background: var(--thermal-slate);\n            }\n        }\n\n        span {\n            transition: all .3s ease-in-out;\n            display: inline-block;\n            width: .8em;\n            height: .8em;\n            border-radius: 50%;\n            border: var(--thermal-border-width) var(--thermal-border-style) var(--thermal-slate);\n            position: relative;\n            overflow: hidden;\n        }\n\n        i {\n            position: absolute;\n            top: 0;\n            left: 0;\n            width: 100%;\n            height: 100%;\n            border-radius: 50%;\n            border: 2px solid var(--thermal-background);\n            box-sizing: border-box;\n        }\n\n        input {\n            display: none;\n        }\n\n        div {\n            font-size: .9em;\n            pointer-events: visible;\n            display: inline-block;\n        }\n    \n    `;\n\n    public render(): unknown {\n        return html`  \n        <span><i></i></span>      \n        <div>${t(T.analysissync)}</div>\n        `;\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"group-analysis-sync-button\": GroupAnalysisSyncButton;\n    }\n}","import { consume } from \"@lit/context\";\nimport { t } from \"i18next\";\nimport type { CSSResultGroup } from \"lit\";\nimport { css, html } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { AbstractGroupConsumer } from \"../../hierarchy/consumers/AbstractGroupConsumer\";\nimport type { ConfigController } from \"../../controllers/ConfigController\";\nimport { configContext } from \"../../controllers/ConfigController\";\nimport { T } from \"../../translations/Languages\";\n\nexport class GroupDownloadDropdown extends AbstractGroupConsumer {\n\n    static styles?: CSSResultGroup | undefined = css`\n        thermal-btn {\n            text-align: left;\n        }\n    `;\n\n    @state()\n    @consume({ context: configContext, subscribe: true })\n    private configController?: ConfigController;\n\n    @property({ type: String, reflect: true })\n    public icon?: string;\n\n    @property({ type: String, reflect: true })\n    public iconStyle?: string;\n\n    @property({ type: String, reflect: true })\n    public variant?: string;\n\n    protected render(): unknown {\n\n        const png = this.configController?.settings.export.png;\n        const groupSettings = this.configController?.settings.export.group;\n        const dropdownClass = this.classList.contains( \"small\" ) ? \"small\" : \"\";\n\n        return html`\n        \n            <thermal-dropdown class=\"download ${dropdownClass}\" .variant=${this.variant} .icon=${this.icon} .iconStyle=${this.iconStyle}>\n            \n                <span slot=\"invoker\">${t(T.download)}</span>\n            \n                <thermal-btn \n                    slot=\"option\" \n                    pre=\"ZIP\" \n                    @click=${() => this.groupObject.files.downloadAllFiles()}\n                    tooltip=${t(T.downloadoriginalfileshint)}\n                    tooltip-placement=\"right\"\n                >\n                    ${t(T.downloadoriginalfiles)}\n                </thermal-btn>\n\n                <thermal-btn \n                    slot=\"option\" \n                    pre=\"PNG\" \n                    @click=${() => this.groupObject.forEveryInstance(instance => instance.export.downloadPng())}\n                    tooltip=${t(T.pngofindividualimageshint)}\n                    tooltip-placement=\"right\"\n                >\n                    ${t(T.pngofindividualimages)}\n                </thermal-btn>\n\n                <thermal-btn \n                    slot=\"option\"\n                    pre=\"PNG\" \n                    @click=${() => this.groupObject.analysisSync.png.downloadPng({\n                        columns: groupSettings?.columns ?? 3,\n                        showGroupName: groupSettings?.groupName ?? false,\n                        fontSize: png?.fontSize ?? 12,\n                        showAnalysis: png?.analyses ?? true,\n                        showFileDate: png?.fileDate ?? true,\n                        showFileName: png?.fileName ?? false,\n                        showThermalScale: png?.thermalScale ?? true,\n                        width: png?.width ?? 800,\n                        \n                    })}\n                    tooltip=\"${t(T.pngofentiregrouphint)}\"\n                    tooltip-placement=\"right\"\n                >\n                    ${t(T.pngofentiregroup)}\n                </thermal-btn>\n\n                <thermal-btn \n                    slot=\"option\" \n                    pre=\"CSV\" \n                    @click=${() => { this.groupObject.analysisSync.csv.downloadAsCsv() }}\n                    tooltip=${t(T.csvofanalysisdatahint)}\n                    tooltip-placement=\"right\"\n                >\n                    ${t(T.csvofanalysisdata)}\n                </thermal-btn>\n            \n            </thermal-dropdown>\n        \n        `;\n\n    }\n\n\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"group-download-dropdown\": GroupDownloadDropdown;\n    }\n}","import { consume } from \"@lit/context\";\nimport { t } from \"i18next\";\nimport type { CSSResultGroup } from \"lit\";\nimport { css, html } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { AbstractGroupConsumer } from \"../../hierarchy/consumers/AbstractGroupConsumer\";\nimport type { ConfigController } from \"../../controllers/ConfigController\";\nimport { configContext } from \"../../controllers/ConfigController\";\nimport { T } from \"../../translations/Languages\";\n\nexport class GroupDownloadButtons extends AbstractGroupConsumer {\n\n    @property({type: String})\n    public label?: string;\n\n    @state()\n    @consume({ context: configContext, subscribe: true })\n    protected configController?: ConfigController;\n\n    static styles?: CSSResultGroup | undefined = css`\n\n        :host {\n        \n            display: flex;\n            flex-direction: column;\n            gap: 5px;\n\n        }\n\n        button.default {\n            font-size: calc( var(--thermal-fs) * .8 );\n            color: var(--thermal-foreground);\n            border-color: var(--thermal-slate);\n            border-style: solid;\n            border-width: 1px;\n            border-radius: var( --thermal-radius );\n            background-color: var(--thermal-slate-light);\n            white-space: preserve nowrap;\n            &:hover {\n                cursor: pointer;\n                background: var(--thermal-background);\n            }\n        }\n    \n    `;\n\n\n    protected render(): unknown {\n\n        const png = this.configController?.settings.export.png;\n        const group = this.configController?.settings.export.group;\n\n        return html`\n        \n                <button class=\"default\" @click=${() => this.groupObject.files.downloadAllFiles()}>${t(T.downloadoriginalfiles)}</button>\n            \n                <button class=\"default\" @click=${() => this.groupObject.forEveryInstance(instance => instance.export.downloadPng())}>${t(T.pngofindividualimages)}</button>\n            \n            \n                <button class=\"default\" @click=${() => this.groupObject.analysisSync.png.downloadPng({\n                    columns: group?.columns,\n                    showAnalysis: png?.analyses,\n                    showFileDate: png?.fileDate,\n                    showFileName: png?.fileName,\n                    showThermalScale: png?.thermalScale,\n                    showGroupName: group?.groupName,\n                    label: this.label,\n                    fontSize: png?.fontSize\n        })}>${t(T.pngofentiregroup)}</button>\n            \n                <button class=\"default\" @click=${() => { this.groupObject.analysisSync.csv.downloadAsCsv() }}>${t(T.csvofanalysisdata)}</button>\n        \n        `;\n\n    }\n\n\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"group-download-buttons\": GroupDownloadButtons;\n    }\n}","import type { AbstractFileResult } from \"@labirthermal/core/src/loading/workers/AbstractFileResult\";\nimport { property, state } from \"lit/decorators.js\";\nimport { publicIpv4 } from \"public-ip\";\nimport { AbstractGroupConsumer } from \"../../hierarchy/consumers/AbstractGroupConsumer\";\n\nexport abstract class AbstractGroupDropin extends AbstractGroupConsumer {\n\n    @state()\n    ip?: string;\n\n    @property({ type: Function })\n    onDrop?: ( instances: AbstractFileResult[] ) => Promise<void>;\n\n    connectedCallback(): void {\n        super.connectedCallback();\n\n        publicIpv4().then( ip => this.ip = ip );\n\n    }\n\n    private _getUserInfo() {\n        return {\n            ip: this.ip,\n            userAgent: window.navigator.userAgent,\n            windowWidth: window.innerWidth,\n            windowHeight: window.innerHeight,\n            time: ( new Date() ).getTime()\n        }\n    }\n\n    public emitMultipleUpload(\n        fileNames?: string[] | undefined\n    ): void {\n\n        const event = new CustomEvent( \"multiple-upload\", {\n            bubbles: true,\n            cancelable: false,\n            detail: {\n                ...this._getUserInfo(),\n                fileNames\n            }\n        });\n        this.dispatchEvent( event );\n\n    }\n\n    protected emitSingleUpload(\n        fileName: string,\n        fileSize: number\n    ) {\n\n        const event = new CustomEvent('uploaded', {\n            bubbles: true,\n            cancelable: false,\n            detail: {\n                ...this._getUserInfo(),\n                fileName,\n                fileSize\n            }\n        });\n\n        this.dispatchEvent( event );\n    }\n\n}","import { t } from \"i18next\";\nimport type { PropertyValues } from \"lit\";\nimport { css, html } from \"lit\";\nimport { state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport type { Ref } from 'lit/directives/ref.js';\nimport { createRef, ref } from 'lit/directives/ref.js';\nimport { T } from \"../../translations/Languages\";\nimport { AbstractGroupDropin } from \"./AbstractGroupDropin\";\n\nexport class GroupDropinElement extends AbstractGroupDropin {\n\n    @state()\n    protected container: Ref<HTMLVideoElement> = createRef();\n\n    @state()\n    protected hover: boolean = false;\n\n    @state()\n    protected uploading: boolean = false;\n\n    protected firstUpdated(_changedProperties: PropertyValues): void {\n        super.firstUpdated(_changedProperties);\n\n        if (this.container.value !== undefined) {\n\n            const listener = this.managerObject.service.handleDropzone(this.container.value, true);\n\n            listener.onMouseEnter.add(this.UUID, () => {\n                console.log(\"mouseenter\");\n                this.hover = true;\n            });\n\n            listener.onMouseLeave.add(this.UUID, () => {\n                console.log(\"mouseleave\");\n                this.hover = false;\n            });\n\n            listener.onDrop.set(this.UUID, () => {\n                this.uploading = true;\n            });\n\n\n            listener.onProcessingEnd.add(this.UUID, async (results) => {\n\n                if ( this.onDrop !== undefined ) {\n                    await this.onDrop(results);\n                }\n\n                this.uploading = false;\n\n                return;\n\n            });\n\n        }\n\n    }\n\n\n    public static styles = css`\n\n        .container {\n            color: var(--thermal-foreground);\n        }\n\n        .dropin {\n            width: 100%;\n            aspect-ratio: 4 / 3;\n            max-height: 700px;\n            transition: background .5s ease-in-out;\n            border: var(--thermal-border-width) var(--thermal-border-style) var( --thermal-slate );\n            border-radius: var( --thermal-radius );\n            cursor: pointer;\n            background: var( --thermal-slate );\n            position: relative;\n            overflow: hidden;\n\n        }\n\n        .dropin-gradient {\n            position: absolute;\n            width: 100%;\n            height: 100%;\n            background: radial-gradient(circle, var(--thermal-slate-light) 0%, var(--thermal-slate) 100%);\n            opacity: 0;\n            transition: opacity .5s ease-in-out;\n        }\n\n        .hover,\n        .dropin:hover {\n            .dropin-gradient {\n                opacity: .5;\n            }\n        }\n\n        .dropin-content {\n            position: absolute;\n            top: 0;\n            left: 0;\n            width: 100%;\n            height: 100%;\n            display: flex;\n            flex-direction: column;\n            align-items: center;\n            justify-content: center;\n            gap: var( --thermal-gap );\n            transition: all .3s ease-in-out;\n        }\n\n        @-webkit-keyframes action {\n            0% { transform: translateY(0); }\n            100% { transform: translateY(-10px); }\n        }\n\n        @keyframes action {\n            0% { transform: translateY(0); }\n            100% { transform: translateY(-10px); }\n        }\n\n        .dropin-uploading {\n            transition: all .3s ease-in-out;\n            position: absolute;\n            \n            top: 0;\n            left: 0;\n            width: 100%;\n            height: 100%;\n\n            display: flex;\n            align-items: center;\n            justify-content: center;\n\n            transform: translateY(100px);\n            opacity: 0;\n\n            color: var(--thermal-foreground);\n\n            svg {\n                width: 100px;\n                -webkit-animation: action .5s infinite  alternate;\n                animation: action .5s infinite  alternate;\n            }\n\n        }\n\n        .dropin.uploading {\n            .dropin-content {\n                opacity: 0;\n                transform: translateY( -100px );\n            }\n            .dropin-uploading {\n                opacity: 1;\n                transform: translateY(0);\n            }\n        }\n\n    `;\n\n\n    render() {\n\n        const dropinClasses = {\n            dropin: true,\n            hover: this.hover,\n            uploading: this.uploading\n        }\n\n        return html`\n\n            <div class=\"container\">\n            \n                <div ${ref(this.container)} class=\"${classMap(dropinClasses)}\">\n\n                    <div class=\"dropin-gradient\"></div>\n\n                    <div class=\"dropin-content\">\n                        <div>${t(T.dragorselectfile)}</div>\n                        <thermal-btn \n                            variant=\"foreground\"\n                            icon=\"upload\"\n                            iconStyle=\"micro\"\n                        >${t(T.selectfile)}</thermal-btn>\n                    </div>\n\n                    <div class=\"dropin-uploading\">\n                        <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n                            <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5\" />\n                        </svg>\n                    </div>\n                \n                </div>\n\n            </div>\n        \n        `;\n\n    }\n\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"group-dropin-element\": GroupDropinElement;\n    }\n}","import type { DropinElementListener } from \"@labirthermal/core\";\nimport { t } from \"i18next\";\nimport type { PropertyValues } from \"lit\";\nimport { css, html } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport type { Ref } from 'lit/directives/ref.js';\nimport { createRef, ref } from 'lit/directives/ref.js';\nimport { T } from \"../../translations/Languages\";\nimport type { BtnVariants } from \"../../ui/Btn\";\nimport { AbstractGroupDropin } from \"./AbstractGroupDropin\";\n\nexport class GroupDropinInputElement extends AbstractGroupDropin {\n\n  @property({ type: String, reflect: true })\n  public icon?: string;\n\n  @property({ type: String, reflect: true })\n  public iconStyle?: string;\n\n  @property({ type: String, reflect: true })\n  public tooltip?: string;\n\n  @property({ type: String, reflect: true })\n  public variant?: BtnVariants;\n\n  @state()\n  protected container: Ref<HTMLVideoElement> = createRef();\n\n  @state()\n  protected hover: boolean = false;\n\n  @state()\n  protected uploading: boolean = false;\n\n  listener?: DropinElementListener;\n\n  public static styles = css`\n\n        .container {\n            display: none;\n        }\n\n        .dropin {\n            background: var( --thermal-slate );\n            width: 100%;\n            aspect-ratio: 4 / 3;\n        }\n\n        .hover {\n            background: var( --thermal-slate-light );\n        }\n\n        svg {\n            width: 1em;\n        }\n\n\n\n.lds-ellipsis,\n.lds-ellipsis div {\n  box-sizing: border-box;\n}\n.lds-ellipsis {\n  display: inline-block;\n  position: relative;\n  width: 21px;\n  height: 1em;\n}\n.lds-ellipsis div {\n  position: absolute;\n  top: 50%;\n  width: 5px;\n  height: 5px;\n  border-radius: 50%;\n  background: currentColor;\n  animation-timing-function: cubic-bezier(0, 1, 1, 0);\n}\n\n.lds-ellipsis div:nth-child(1) {\n  left: 0px;\n  animation: lds-ellipsis1 0.6s infinite;\n}\n\n.lds-ellipsis div:nth-child(2) {\n  left: 7px;\n  animation: lds-ellipsis2 0.6s infinite;\n}\n\n.lds-ellipsis div:nth-child(3) {\n  left: 14px;\n  animation: lds-ellipsis2 0.6s infinite;\n}\n\n.lds-ellipsis div:nth-child(4) {\n  left: 21px;\n  animation: lds-ellipsis3 0.6s infinite;\n}\n\n@keyframes lds-ellipsis1 {\n  0% {\n    transform: scale(0);\n  }\n  100% {\n    transform: scale(1);\n  }\n}\n@keyframes lds-ellipsis3 {\n  0% {\n    transform: scale(1);\n  }\n  100% {\n    transform: scale(0);\n  }\n}\n@keyframes lds-ellipsis2 {\n  0% {\n    transform: translate(0, 0);\n  }\n  100% {\n    transform: translate(0px, 0);\n  }\n}\n\n\n    \n    `;\n\n  protected firstUpdated(_changedProperties: PropertyValues): void {\n    super.firstUpdated(_changedProperties);\n\n    if (this.container.value !== undefined) {\n\n      this.listener = this.managerObject.service.handleDropzone(this.container.value, true);\n\n      this.listener.onMouseEnter.add(this.UUID, () => {\n        this.hover = true;\n      });\n\n      this.listener.onMouseLeave.add(this.UUID, () => {\n        this.hover = false;\n      });\n\n      this.listener.onDrop.set(this.UUID, () => {\n        this.uploading = true;\n      });\n\n\n      this.listener.onProcessingEnd.add(this.UUID, async (results) => {\n\n        if ( this.onDrop !== undefined ) {\n            await this.onDrop(results);\n        }\n\n        this.uploading = false;\n\n        return;\n\n      });\n\n    }\n\n  }\n\n  render() {\n\n    const title = this.uploading === false\n      ? t(T.uploadafile)\n      : html`<div class=\"lds-ellipsis\">\n                <div></div>\n                <div></div>\n                <div></div>\n                <div></div>\n            </div>`;\n\n    return html`\n            <thermal-btn \n              icon=\"${ifDefined( this.icon )}\"\n              iconStyle=\"${ifDefined( this.iconStyle )}\"\n              tooltip=\"${ifDefined( this.tooltip )}\"\n              variant=\"${ifDefined( this.variant )}\"\n            @click=\"${() => {\n        if (this.listener) {\n          this.listener.openFileDialog(true);\n        }\n      }}\"><slot>${title}</slot></thermal-btn>\n\n            <div class=\"container\">\n            \n                <div ${ref(this.container)}></div>\n\n            </div>\n        \n        `;\n\n  }\n\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"group-dropin-input\": GroupDropinInputElement;\n    }\n}","import type { CSSResultGroup } from \"lit\";\nimport { css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { createRef, ref } from \"lit/directives/ref.js\";\nimport { AbstractFileConsumer } from \"../../../hierarchy/consumers/AbstractFileConsumer\";\nimport type { BtnSizes, BtnVariants } from \"../../../ui/Btn\";\n\nexport abstract class AbstractFileButton extends AbstractFileConsumer {\n\n    @property({ type: String, reflect: false })\n    public variant?: BtnVariants;\n\n    @property({ type: String, reflect: true })\n    public size?: BtnSizes = \"sm\";\n\n    @property({ type: String})\n    public icon?: string;\n\n    @property({type: String})\n    public iconStyle?: string;\n\n    @property({ type: Boolean })\n    public plain: boolean = false;\n\n    protected abstract tooltip?: string;\n\n    protected ref = createRef<HTMLElement>();\n\n    abstract getDefaultLabel(): string;\n\n    abstract enter(): void;\n\n    abstract action(): void;\n\n    abstract leave(): void;\n\n    public onFailure(): void { }\n\n    private isWithinButton(target: EventTarget | null): boolean {\n        return target instanceof Node\n            && (this.contains(target) || this.renderRoot.contains(target));\n    }\n\n    private handleMouseOver = (event: MouseEvent): void => {\n        if (!this.isWithinButton(event.relatedTarget)) {\n            this.enter();\n        }\n    }\n\n    private handleMouseOut = (event: MouseEvent): void => {\n        if (!this.isWithinButton(event.relatedTarget)) {\n            this.leave();\n        }\n    }\n\n    private handleFocusIn = (event: FocusEvent): void => {\n        if (!this.isWithinButton(event.relatedTarget)) {\n            this.enter();\n        }\n    }\n\n    private handleFocusOut = (event: FocusEvent): void => {\n        if (!this.isWithinButton(event.relatedTarget)) {\n            this.leave();\n        }\n    }\n\n    static styles?: CSSResultGroup | undefined = css`\nslot {\n    display: content;\n}`;\n\n    protected render(): unknown {\n        return html`<slot \n    @click=${this.action} \n    @mouseover=${this.handleMouseOver}\n    @mouseout=${this.handleMouseOut}\n    @focusin=${this.handleFocusIn}\n    @focusout=${this.handleFocusOut}\n    ${ref(this.ref)}\n>\n    <thermal-btn \n        variant=${this.variant || \"default\"}\n        size=${this.size || \"sm\"}\n        ?plain=${this.plain}\n        class=\"default\"\n        tooltip=${ifDefined( this.tooltip )}\n        icon=${ifDefined(this.icon)}\n        iconStyle=${ifDefined(this.iconStyle)}\n    >${this.getDefaultLabel()}</thermal-btn>\n</slot>`;\n    }\n\n}","import type { ThermalGroup, ThermalMinmaxOrUndefined, ThermalUnit } from \"@labirthermal/core\";\nimport { consume } from \"@lit/context\";\nimport { t } from \"i18next\";\nimport { html, type PropertyValues } from \"lit\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { state } from \"lit/decorators/state.js\";\nimport { managerUnitContext } from \"../../controllers/ManagerController\";\nimport { AbstractGroupConsumer } from \"../../hierarchy/consumers/AbstractGroupConsumer\";\nimport { T } from \"../../translations/Languages\";\nimport { AbstractFileButton } from \"../file/buttons/AbstractFileButton\";\n\nexport class GroupRangePropagatorElement extends AbstractGroupConsumer {\n\n    public static styles = AbstractFileButton.styles;\n\n    /** Group bounds are kept in Celsius and formatted only when rendered. */\n    @state()\n    private minmax: ThermalMinmaxOrUndefined;\n\n    @state()\n    @consume({ context: managerUnitContext, subscribe: true })\n    private unit?: ThermalUnit;\n\n    private boundGroup?: ThermalGroup;\n\n    connectedCallback(): void {\n        super.connectedCallback();\n\n        this.onmouseenter = () => {\n\n            if (this.groupObject && this.groupObject.minmax.value && this.registryController) {\n                this.registryController.setHighlight({\n                    from: this.groupObject.minmax.value.min,\n                    to: this.groupObject.minmax.value.max\n                });\n            }\n\n        }\n\n        this.onmouseleave = () => {\n\n            if (this.registryController) {\n                this.registryController.setHighlight(undefined);\n            }\n\n        }\n\n        this.onclick = () => {\n            if (this.groupObject && this.groupObject.minmax.value) {\n                this.groupObject.registry.range.imposeRange({\n                    from: this.groupObject.minmax.value.min,\n                    to: this.groupObject.minmax.value.max\n                });\n            }\n        }\n\n        this.bindGroup();\n    }\n\n    disconnectedCallback(): void {\n        this.unbindGroup();\n        super.disconnectedCallback();\n    }\n\n    willUpdate(changedProperties: PropertyValues<this>): void {\n        super.willUpdate(changedProperties);\n        this.bindGroup();\n    }\n\n    /** Hydrate and subscribe to the group currently providing the Celsius bounds. */\n    private bindGroup(): void {\n        const group = this.groupController?.groupObject;\n        if (!this.isConnected || group === this.boundGroup) return;\n\n        this.unbindGroup();\n        this.boundGroup = group;\n        this.minmax = group?.minmax.value;\n        group?.minmax.addListener(this.UUID, value => {\n            this.minmax = value;\n        });\n    }\n\n    private unbindGroup(): void {\n        this.boundGroup?.minmax.removeListener(this.UUID);\n        this.boundGroup = undefined;\n    }\n\n    private get value(): string | undefined {\n        if (!this.minmax) return undefined;\n        return this.managerController.formatRange(\n            this.managerController.toCurrentUnit(this.minmax.min),\n            this.managerController.toCurrentUnit(this.minmax.max)\n        );\n    }\n\n    protected render(): unknown {\n        return html`\n            <slot>\n                <thermal-btn \n                    class=\"default\"\n                    icon=\"range\"\n                    iconStyle=\"solid\"\n                    tooltip=\"${ifDefined(this.value)}\"\n                >${t(T.range).toLowerCase()}</thermal-btn>\n            </slot>\n        `;\n    }\n\n\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"group-range-propagator\": GroupRangePropagatorElement;\n    }\n}","import { format } from \"date-fns\";\nimport { css, html, nothing } from \"lit\";\n\nenum TICK {\n    MINOR = \"minor\",\n    MAJOR = \"major\",\n    BOUND = \"bound\"\n}\n\n\nexport type Tick = {\n    ms: number,\n    percent: number,\n    type: TICK,\n    label: string\n}\n\n/** Available minute divisions */\ntype MinuteDivision = 2 | 4 | 6 | 12 | 30;\n\n/**\n * Format data into a tick value\n */\nconst tick = (\n    ms: number,\n    duration: number,\n    type: TICK\n): Tick => ({\n    ms,\n    percent: ms / duration * 100,\n    type,\n    label: format(ms, \"m:ss\")\n})\n\n\n/**\n * Take a minute interval, divide it into a given number of segments and return array of `Tick` objects:\n * - any number of TICK.MINOR for seconds\n * - one last TICK.MAJOR for minute end\n * All ticks are returned only when they are smaller than the overall duration.\n */\nconst processTickMinute = (\n    /** Milliseconds from which the minute starts */\n    from: number,\n    /** Milliseconds to which the minute ends */\n    to: number,\n    /** Number of divisions to which a minute shall be splitted */\n    count: MinuteDivision,\n    /** The overall duration of the entire timeline */\n    duration: number\n): Tick[] => {\n\n    const ticks: Tick[] = [];\n\n    let i = 1;\n\n    const partial = (to - from) / count;\n\n    while (i < count) {\n\n        const value = from + (i * partial);\n        if (value < duration) {\n            ticks.push(tick(\n                value,\n                duration,\n                TICK.MINOR\n            ));\n        }\n\n        i += 1;\n\n    }\n\n    if (to < duration) {\n        ticks.push(tick(to, duration, TICK.MAJOR));\n    }\n\n    return ticks;\n\n}\n\nconst minute = 60 * 1000;\nconst tickWidth = 50;\nconst tickPointerHeight = 3;\n\nexport const calculateTicks = (\n    /** Width of the element */\n    width: number,\n    /** Overall duration of the timeline in miliseconds */\n    duration: number\n): Tick[] => {\n\n    const numTicks = Math.floor(width / tickWidth);\n    const numMinutes = Math.floor(duration / (60 * 1000));\n\n    const ticksPerMinuteRaw = numTicks / numMinutes;\n\n    let ticksPerMinute: MinuteDivision = 2;\n\n    if (ticksPerMinuteRaw >= 2) ticksPerMinute = 4;\n    if (ticksPerMinuteRaw >= 6) ticksPerMinute = 6;\n    if (ticksPerMinuteRaw >= 12) ticksPerMinute = 12;\n    if (ticksPerMinuteRaw >= 30) ticksPerMinute = 30;\n\n    const ticks: Tick[] = [];\n\n    let from = 0;\n    let to = minute;\n\n    while ( from < duration ) {\n\n        // Process the minute\n        processTickMinute( \n            from, \n            to, \n            ticksPerMinute, \n            duration \n        ).forEach( tick => ticks.push(tick) );\n\n        // Add a minute\n        from += minute;\n        to += minute;\n\n    }\n\n    ticks.push( tick(0, duration, TICK.BOUND) );\n    ticks.push( tick(duration, duration, TICK.BOUND) );\n\n    return ticks;\n\n}\n\nconst renderTick = (tick: Tick) => {\n    return html`<div\n        class=\"tick tick-${tick.type}\"\n        style=\"left: ${tick.percent}%;\"\n    >\n        <div class=\"tick-pointer\"></div>\n        <div class=\"tick-label\">${tick.label}</div>\n    </div>`;\n}\n\nconst renderPointer = (\n    percent: number,\n    label: string,\n    type: \"pointer\"|\"primary\"\n) => {\n    return html`<div \n        class=\"indicator-cursor indicator-cursor__${type}\"\n        style=\"left: ${percent}%;\"\n        data-video-rerender\n    >\n        <div class=\"indicator-cursor-arrow\"></div>\n        <div class=\"indicator-cursor-label\">${label}</div>\n    </div>`;\n}\n\nexport const renderTicks = ( \n    duration: number,\n    ticks: Tick[],\n    currentMs: number,\n    pointerMs?: number\n) => {\n\n    const currentPercent = currentMs / duration * 100;\n\n    const pointerPercent = pointerMs !== undefined\n        ? pointerMs / duration * 100\n        : undefined;\n\n\n    return html`<div class=\"ticks\">\n        \n        ${ticks.map( renderTick )}\n\n        ${renderPointer( currentPercent, format(currentMs, \"m:ss:SSS\" ), \"primary\" )}\n\n        ${pointerMs !== undefined && pointerPercent !== undefined \n            ? renderPointer( pointerPercent, format( pointerMs, \"m:ss:SSS\" ), \"pointer\" )\n            : nothing\n        }\n\n    </div>`;\n}\n\nexport const ticksCss = css`\n\n    :host {\n\n            --tick-color: var( --thermal-slate );\n            --tick-opacity: 1;\n\n            --cursor-color: var( --thermal-primary );\n            --cursor-bg: var( --thermal-background );\n\n            --fs-sm: calc( var(--thermal-fs) * .7 );\n\n    }\n\n    .indicator-cursor {\n        position: absolute;\n        width: 0px;\n        right: 0;\n        font-size: var( --fs-sm );\n        z-index: 11;        \n    }\n\n        .indicator-cursor__primary {\n            --cursor-bg: var( --thermal-primary );\n            --cursor-color: white;\n        }\n\n        .indicator-cursor__pointer {\n            --cursor-bg: var( --thermal-foreground );\n            --cursor-color: white;\n\n            .indicator-cursor-arrow {\n                position: absolute;\n                top: calc( var( --thermal-fs ) * -1 - 6px);\n            }\n\n            .indicator-cursor-label {\n                position: absolute;\n                top: calc( var( --thermal-fs ) * -2 - 3px );\n            }\n        }\n\n        .indicator-cursor-arrow {\n            position: relative;\n            width: 6px;\n            height: 6px;\n            content: \"\";\n            background: var( --cursor-bg );\n            left: -4px;\n            rotate: 45deg;\n        }\n\n        .indicator-cursor-label {\n            position: relative;\n            top: -3px;\n            width: ${tickWidth}px;\n            left: -${tickWidth / 2}px;\n            background: var( --cursor-bg );\n            color: var(--cursor-color);\n            text-align: center;\n        }\n\n        .ticks {\n            width: 100%;\n            height: calc( var(--thermal-fs) + ${tickPointerHeight}px);\n            position: relative;\n        }\n\n\n        .ticks-horizontal-indent {\n            padding-left: ${tickWidth / 2}px;\n            padding-right: ${tickWidth / 2}px;\n            box-sizing: border-box;\n            width: 100%;\n        }\n\n        .tick {\n            position: absolute;\n            width: 0;\n            color: var( --tick-color );\n            opacity: var( --tick-opacity );\n            font-size: var( --fs-sm );\n        }\n\n        .tick-bound {\n\n            --tick-color: var( --thermal-foreground );\n\n            .tick-label {\n                background: var(--thermal-slate-dark);\n                color: var(--thermal-background);\n                position: relative;\n                top: -${tickPointerHeight}px;\n            }\n\n            .tick-pointer {\n                width: ${tickPointerHeight*2}px;\n                height: ${tickPointerHeight*2}px;\n                background: var( --thermal-slate-dark );\n                position: relative;\n                left: -${tickPointerHeight}px;\n                rotate: 45deg;\n            }\n            \n        }\n\n    .tick-major {\n        --tick-color: var( --thermal-slate-dark );\n    }\n\n    .tick-minor {\n        --tick-color: var( --thermal-slate );\n    }\n\n\n    .tick-pointer {\n            height: ${tickPointerHeight}px;\n            width: 1px;\n            content: \"\";\n            background-color: currentcolor;\n    }\n\n    .tick-label {\n            width: ${tickWidth}px;\n            position: relative;\n            left: -${tickWidth / 2}px;\n            text-align: center;\n            color: currentcolor;\n    }\n\n    \n\n`;","import type { ThermalFileInstance } from \"@labirthermal/core\";\nimport { ThermalFileFailure } from \"@labirthermal/core\";\nimport type { CSSResultGroup, PropertyValues } from \"lit\";\nimport { css, html, nothing } from \"lit\";\nimport { state } from \"lit/decorators.js\";\nimport type { Ref } from \"lit/directives/ref.js\";\nimport { createRef, ref } from \"lit/directives/ref.js\";\nimport { AbstractGroupConsumer } from \"../../hierarchy/consumers/AbstractGroupConsumer\";\nimport type { Tick } from \"../../utils/timelineTicks\";\nimport { calculateTicks, renderTicks, ticksCss } from \"../../utils/timelineTicks\";\n\n\n\nexport class GroupTimelineElement extends AbstractGroupConsumer {\n\n    public static TICK_WIDTH = 50;\n    public static TICK_POINTER_HEIGHT = 3;\n\n    @state()\n    longestDurationInMs?: number;\n\n    @state()\n    ms: number = 0;\n\n    @state()\n    pointerMs?: number;\n\n    @state()\n    playing: boolean = false;\n\n    @state()\n    instances: ThermalFileInstance[] = [];\n\n    @state()\n    has: boolean = false;\n\n    @state()\n    ticks: Tick[] = [];\n\n    protected timelineRef: Ref<HTMLDivElement> = createRef();\n    protected indicatorRef: Ref<HTMLDivElement> = createRef();\n\n    @state()\n    listener?: ReturnType<typeof setTimeout>;\n\n\n    connectedCallback(): void {\n\n        super.connectedCallback();\n\n        this.groupObject.registry.batch.onBatchComplete.set(\n            this.UUID,\n            this.onRegistryBatchEnded.bind(this)\n        );\n\n        this.groupObject.files.addListener(this.UUID, (value) => {\n            if ( this.listener !== undefined ) {\n                clearTimeout( this.listener );\n            }\n            this.listener = setTimeout( async () => {\n               this.onRegistryBatchEnded( value );\n            }, 0 );\n        });\n\n        this.groupObject.playback.addListener(this.UUID, value => this.ms = value);\n\n        this.groupObject.playback.onPlayingStatusChange.set(this.UUID, value => this.playing = value);\n\n        this.groupObject.playback.onHasAnyCallback.set(this.UUID, value => this.has = value);\n\n    }\n\n    updated(_changedProperties: PropertyValues): void {\n        super.updated(_changedProperties);\n\n\n        // Project the local status to the affected instances\n        if (_changedProperties.has(\"ms\")) {\n            if (this.ms !== undefined) {\n\n                if (this.ms !== this.groupObject.playback.value)\n                    this.groupObject.playback.setValueByRelativeMs(this.ms);\n\n                if (this.indicatorRef.value) {\n                    this.indicatorRef.value.style.width = this.msToPercent(this.ms) + \"%\";\n                }\n\n            }\n        }\n\n    }\n\n\n    protected onRegistryBatchEnded(\n        results: (ThermalFileInstance | ThermalFileFailure)[]\n    ): void {\n\n        let length = 0;\n\n        this.instances = results\n            .filter(result => {\n                if (result instanceof ThermalFileFailure)\n                    return false;\n                return result.group.id === this.groupObject.id\n            }) as ThermalFileInstance[];\n\n        this.instances.forEach(result => {\n\n            if (result.timeline.duration > length) {\n                length = result.timeline.duration;\n            }\n        });\n\n        this.longestDurationInMs = length;\n\n        setTimeout(() => {\n\n            const timeline = this.getTimelineElement();\n\n            if (timeline && this.longestDurationInMs !== undefined) {\n\n                this.calculateTicks(timeline.clientWidth, this.longestDurationInMs);\n\n\n                const resizeObserver = new ResizeObserver((entries) => {\n\n                    const e = entries[0];\n\n                    if (this.longestDurationInMs) {\n                        this.calculateTicks(e.contentRect.width, this.longestDurationInMs);\n                    }\n\n                });\n\n                resizeObserver.observe(timeline);\n\n            }\n\n        }, 0);\n\n\n\n    }\n\n\n\n    protected calculateTicks(\n        width: number,\n        duration: number\n    ) {\n        this.ticks = calculateTicks( width, duration );\n    }\n\n    protected forEveryAffectedInstance(fn: (instance: ThermalFileInstance) => void) {\n        this.instances.forEach(fn);\n    }\n\n    protected percentToMs(\n        percent: number\n    ) {\n\n        if (this.longestDurationInMs === undefined) {\n            return undefined;\n        }\n\n        return Math.floor(this.longestDurationInMs * (percent / 100));\n\n    }\n\n    protected msToPercent(\n        ms: number\n    ) {\n\n        if (this.longestDurationInMs === undefined) {\n            return undefined;\n        }\n\n        return (ms / this.longestDurationInMs) * 100;\n\n    }\n\n    protected getValueFromEvent(event: MouseEvent): {\n        ms: number | undefined,\n        percent: number\n    } {\n\n        const layerX = event.layerX;\n        const target = event.target as HTMLDivElement;\n        const layerWidth = target.clientWidth;\n\n        const percent = layerX / layerWidth * 100;\n\n        const ms = this.percentToMs(percent);\n\n        return { percent, ms }\n\n    }\n\n    protected handlePlayButtonClick() {\n        if (this.groupObject.playback.playing) {\n            this.groupObject.playback.stop();\n        } else {\n            this.groupObject.playback.play();\n        }\n    }\n\n    protected handleTimelineClick(event: MouseEvent) {\n        const layerX = event.layerX;\n        const target = event.target as HTMLDivElement;\n        const layerWidth = target.clientWidth;\n\n        const percent = layerX / layerWidth * 100;\n\n        const ms = this.percentToMs(percent);\n\n        if (ms) {\n            this.ms = ms;\n        }\n    }\n\n    protected handleTimelineEnter(event: MouseEvent) {\n        const { ms } = this.getValueFromEvent(event);\n        this.pointerMs = ms;\n    }\n\n    protected handleTimelineMove(event: MouseEvent) {\n        const { ms } = this.getValueFromEvent(event);\n        this.pointerMs = ms;\n    }\n\n    protected handleTimelineLeave() {\n        this.pointerMs = undefined;\n    }\n\n\n    static styles?: CSSResultGroup | undefined = css`\n\n\n        :host {\n\n            --tick-color: var( --thermal-slate );\n            --tick-opacity: 1;\n\n            --cursor-color: var( --thermal-primary );\n            --cursor-bg: var( --thermal-background );\n\n            --fs-sm: calc( var(--thermal-fs) * .7 );\n\n        }\n\n        .container {\n\n            padding-top: calc( var(--thermal-fs) + 6px);\n\n        }\n\n        .timeline {\n            width: 100%;\n            height: var( --thermal-fs );\n            position: relative;\n            cursor: pointer;\n            box-sizing: border-box;\n        }\n\n        .background {\n            width: 100%;\n            height: 100%;\n            background-color: var( --thermal-slate );\n            pointer-events: none;\n        }\n\n        .indicator {\n            height: 100%;\n            position: absolute;\n            content:\"\";\n            top: 0;\n            left: 0;\n            background-color: var( --thermal-primary );\n            pointer-events: none;\n        }\n\n\n        ${ticksCss}\n    \n    `;\n\n    protected getTimelineElement(): HTMLDivElement | null {\n        return this.renderRoot.querySelector(\".timeline\");\n    }\n\n\n    protected render(): unknown {\n\n        if (this.has === false) {\n            return nothing;\n        }\n\n        return html`<div class=\"container ticks-horizontal-indent\">\n\n            <div \n                class=\"timeline\" \n                ${ref(this.timelineRef)}\n                @click=${(event: MouseEvent) => this.handleTimelineClick(event)}\n                @mouseenter=${this.handleTimelineEnter}\n                @mouseleave=${this.handleTimelineLeave}\n                @mousemove=${this.handleTimelineMove}\n            >\n                <div class=\"background\"></div>\n                <div class=\"indicator\" ${ref(this.indicatorRef)}></div>\n            </div>\n\n            ${this.longestDurationInMs !== undefined \n                ? renderTicks( this.longestDurationInMs, this.ticks, this.ms, this.pointerMs )\n                : nothing\n            }\n\n        </div>`;\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"group-timeline\": GroupTimelineElement;\n    }\n}","import type { ThermalFileInstance } from \"@labirthermal/core\";\nimport { t } from \"i18next\";\nimport type { PropertyValues } from \"lit\";\nimport { css, html, nothing } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { classMap } from 'lit/directives/class-map.js';\nimport type { Ref } from 'lit/directives/ref.js';\nimport { createRef, ref } from 'lit/directives/ref.js';\nimport { AbstractFileConsumer } from \"../../hierarchy/consumers/AbstractFileConsumer\";\nimport { T } from \"../../translations/Languages\";\n\n/**\n * The component rendering the file canvas through `@labirthermal/core` functionality.\n * \n * Extends `AbstractFileConsumer`, therefore needs to be in a webcomponent providing the necessary contexts.\n * \n * @package @labirthermal/webcomponents\n * @author Jan Jáchim <jachim@ntc.zcu.cz>\n */\nexport class FileCanvasElement extends AbstractFileConsumer {\n\n    /** Dedicated core-owned mount target; must not contain any Lit-managed child parts. */\n    public container: Ref<HTMLDivElement> = createRef();\n\n    /** Actual DOM-mounted instance, retained for cleanup even before a pending file update completes. Not reactive. */\n    private mountedInstance?: ThermalFileInstance;\n\n    /** Indicates whether the component prefers to use GPU for rendering... */\n    @property({ type: Boolean, attribute: \"prefers-gpu\" })\n    public prefersGpu: boolean = true;\n\n    public onInstanceCreated(): void {\n        this.requestUpdate();\n    }\n\n    public onFailure(): void { }\n\n\n    connectedCallback(): void {\n        super.connectedCallback();\n        this.requestUpdate();\n    }\n\n\n\n    updated(_changedProperties: PropertyValues<FileCanvasElement>): void {\n\n        super.updated(_changedProperties);\n        \n        // Do nothing when the component is not connected or the container is not yet available.\n        if (!this.isConnected || !this.container.value) return;\n\n        // Synchronize the mount after rendering, including reconnection without a file property change.\n        if (this.mountedInstance !== this.file) {\n            this.unmountInstance();\n            if (this.file) {\n                this.file.setPreferWebGl(this.prefersGpu);\n                this.file.mountToDom(this.container.value);\n                this.mountedInstance = this.file;\n                this.file.draw();\n            }\n        } \n        // Apply GPU changes after rendering without drawing twice when a new file is mounted.\n        else if (_changedProperties.has(\"prefersGpu\") && this.mountedInstance) {\n            this.mountedInstance.setPreferWebGl(this.prefersGpu);\n            this.mountedInstance.draw();\n        }\n    }\n\n\n    /** Releases the actual mount rather than a possibly newer file context value. */\n    private unmountInstance(): void {\n        this.mountedInstance?.unmountFromDom();\n        this.mountedInstance = undefined;\n    }\n\n    public disconnectedCallback(): void {\n        this.unmountInstance();\n        super.disconnectedCallback();\n    }\n\n    public static readonly styles = css`\n\n        :host {\n            display: block;\n            width: 100%;\n            font-size: var( --thermal-fs );\n        }\n\n        :host,\n        .canvas-container {\n            box-sizing: border-box;\n        }\n\n        .canvas-container {\n\n            width: 100%;\n\n            background-color: var( --thermal-slate );\n            color: var( --thermal-background );\n\n            transition: color .3s ease-in-out, background-color .3s ease-in-out;\n\n            &.is-loading {\n\n                aspect-ratio: 4 / 3;\n                display: flex;\n                align-items: center;\n                justify-content: center;\n\n            }\n\n            &.is-loaded {\n        \n            }\n\n            &.is-success {\n\n            }\n\n            &.is-error {\n\n                display: flex;\n                align-items: center;\n                justify-content: center;\n                padding: var( --thermal-gap );\n                box-sizing: border-box;\n            }\n\n        }\n\n        \n\n        .error-wrapper {\n\n            display: flex;\n            gap: calc( var( --thermal-gap ) * 0.5 );\n            flex-wrap: wrap;\n            flex-direction: column;\n            align-items: center;\n            justify-content: center;\n\n            box-sizing: border-box;\n            width: 100%;\n            height: 100%;\n\n            border: 2px dashed currentcolor;\n            border-radius: var( --thermal-radius );\n\n            padding: var( --thermal-gap );\n\n            thermal-icon {\n                width: 2em;\n                height: 2em;\n            }\n\n            .error-message {\n                font-size: small;\n                opacity: .5;\n            }\n\n        }\n    `;\n\n    private renderPlaceholder() {\n\n        if (this.fileIsLoading === false) {\n            return nothing;\n        }\n\n        return html`<div class=\"file-canvas-loading\">\n    <thermal-spinner color=\"var(--thermal-background)\"></thermal-spinner>\n</div>`;\n\n    }\n\n    private renderError() {\n\n        if (this.failure === undefined) {\n            return nothing;\n        }\n\n        return html`<div class=\"error-wrapper\">\n    <thermal-icon \n        icon=\"warning\"\n        variant=\"outline\"\n    ></thermal-icon>\n\n    <div class=\"error-title\">\n        ${t(T.fileloadingerror)}\n    </div>\n    <div class=\"error-url\">\n        ${this.failure?.thermalUrl}\n    </div>\n    <div class=\"error-message\">\n        ${this.failure?.message}\n    </div>\n</div>`;\n\n    }\n\n    protected render(): unknown {\n\n        const isError = this.fileIsLoading === false && this.failure !== undefined;\n\n        const isSuccess = this.fileIsLoading === false && this.file !== undefined;\n\n        const classes = {\n            \"canvas-container\": true,\n            \"is-loading\": this.fileIsLoading,\n            \"is-loaded\": this.fileIsLoading === false,\n            \"is-success\": isSuccess,\n            \"is-error\": isError\n        } as const;\n\n        return html`<div class=${classMap(classes)} part=\"file-canvas-container\">\n    <div ${ref(this.container)}></div>\n    ${this.renderPlaceholder()}\n    ${this.renderError()}\n</div>`;\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"file-canvas\": FileCanvasElement;\n    }\n}\n","import { html, nothing } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport type { Ref } from \"lit/directives/ref.js\";\nimport { createRef, ref } from \"lit/directives/ref.js\";\nimport { when } from 'lit/directives/when.js';\nimport { AbstractFileConsumer } from \"../../hierarchy/consumers/AbstractFileConsumer\";\nimport { T } from \"../../translations/Languages\";\nimport type { BtnSizes, BtnVariants } from \"../../ui/Btn\";\nimport type { ThermalDialogElement } from \"../../ui/Dialog\";\nimport type { FileVideoExportPanel } from \"./video/FileVideoExportPanel\";\n\nexport class FileVideoExportButton extends AbstractFileConsumer {\n\n    @property({ type: String, reflect: true })\n    public variant?: BtnVariants;\n\n    @property({ type: String, reflect: true })\n    public size?: BtnSizes = \"md\";\n\n    @property({ type: String })\n    public icon?: string;\n\n    @property({ type: String })\n    public iconStyle?: string;\n\n    @property({ type: Boolean })\n    public plain?: boolean;\n\n    @property({ type: String, reflect: true })\n    public tooltip?: string;\n\n    @property({ type: String, reflect: true })\n    public label: string = \"Exportovat video\";\n\n    @property({ type: String, reflect: true })\n    public pre?: string;\n\n    private dialogRef: Ref<ThermalDialogElement> = createRef();\n    private panelRef?: Ref<FileVideoExportPanel> = createRef();\n\n    protected slug: string = this.UUID + \"__file-export\";\n\n    @state()\n    protected isOpen: boolean = false;\n\n\n\n    public onInstanceCreated(): void {}\n    public onFailure(): void {}\n\n\n    public renderDialog(): unknown {\n\n        const cnt = when(\n            this.isOpen,\n            () => html`<file-video-export-panel ${ref(this.panelRef)}></file-video-export-panel>`,\n            () => nothing\n        );\n\n        return html`<thermal-dialog\n            ${ref(this.dialogRef)}\n            label=\"${this.t(\"export\")}\"\n            ?is-fullscreen=${true}\n            .onCloseEveryTime=${() => {\n                this.isOpen = false;\n                return true;\n            }}\n        >\n\n            <div slot=\"content\" style=\"height: 100%;\">\n                ${cnt}\n            </div>\n\n            ${this.renderCurrentFrameExportButton()}\n\n            ${this.renderVideoExportButton()}\n        \n        </thermal-dialog>`;\n\n    }\n\n    private renderVideoExportButton(): unknown {\n\n        if (\n            !this.file\n            || (\n                this.file\n                && this.file.timeline.isSequence === false\n            )\n        ) {\n            return nothing;\n        }\n\n        return html`<thermal-btn\n                variant=\"primary\"\n                slot=\"button\"\n                icon=\"download\"\n                iconStyle=\"micro\"\n                @click=${() => {\n                if (this.panelRef?.value) {\n                    (this.panelRef?.value as FileVideoExportPanel).record();\n                }\n            }}\n            >${this.t(T.exportvideo)} (MP4)</thermal-btn>`;\n\n    }\n\n    private renderCurrentFrameExportButton(): unknown {\n\n        if (\n            !this.file\n        ) {\n            return nothing;\n        }\n\n        const label = this.file.timeline.isSequence\n            ? \"Současný snímek\"\n            : this.t(T.exportpng);\n\n        return html`<thermal-btn\n                variant=\"primary\"\n                slot=\"button\"\n                icon=\"download\"\n                iconStyle=\"micro\"\n                @click=${() => {\n                if (this.panelRef?.value) {\n                    (this.panelRef?.value as FileVideoExportPanel).currentFrame();\n                }\n            }}\n            >${label} (PNG)</thermal-btn>`;\n\n\n    }\n\n    public renderTriggerButton(): unknown {\n        return html`<thermal-btn\n            @click=${() => {\n                this.dialogRef.value?.setOpen();\n                this.isOpen = true;\n            }}\n            variant=${this.variant || \"default\"}\n            size=${this.size || \"md\"}\n            icon=${ifDefined(this.icon)}\n            iconStyle=${ifDefined(this.iconStyle)}\n            tooltip=${ifDefined(this.tooltip)}\n            pre=${ifDefined(this.pre)}\n            style=\"width: 100%; justify-content: flex-start;\"\n        >\n            ${this.label}\n        </thermal-btn>`;\n    }\n\n    protected render(): unknown {\n        return html`\n            ${this.renderDialog()}\n            ${this.renderTriggerButton()}\n        `\n    }\n\n\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"file-video-export-button\": FileVideoExportButton;\n    }\n}\n","import type { PlaybackSpeeds } from \"@labirthermal/core\";\nimport { playbackSpeed } from \"@labirthermal/core\";\nimport { consume } from \"@lit/context\";\nimport { t } from \"i18next\";\nimport { html, nothing } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { AbstractFileConsumer } from \"../../hierarchy/consumers/AbstractFileConsumer\";\nimport { filePlaybackSpeedContext } from \"../../controllers/FileController\";\nimport { T } from \"../../translations/Languages\";\nimport { ThermalDropdownElement } from \"../../ui/Dropdown\";\n\nexport class FilePlaybackSpeedDropdown extends AbstractFileConsumer {\n\n    @property({type: String, reflect: true})\n    public enabled: \"on\"|\"off\" = \"on\";\n\n    @state()\n    @consume({context: filePlaybackSpeedContext, subscribe: true})\n    protected playbackSpeed: PlaybackSpeeds = 1;\n    \n    public onInstanceCreated(): void {}\n\n    public onFailure(): void {}\n\n    protected handleEntryClick(\n        event: MouseEvent,\n        key: string\n    ): void {\n\n        // Impose the value\n        if ( this.file ) {\n            this.file.timeline.playbackSpeed = parseFloat(key) as keyof typeof playbackSpeed;\n        }\n\n        // Close the drondown\n        const target = event.target as HTMLElement;\n\n        if ( \n            target \n            && target.parentElement\n            && target.parentElement instanceof ThermalDropdownElement \n        ) {\n            target.parentElement.setClose();\n        }\n\n    }\n\n\n    protected renderEntry(\n        key: string\n    ): unknown {\n        return html`<thermal-btn\n            style=\"width: 100%;\"\n            slot=\"option\"\n            variant=\"${ this.playbackSpeed.toString() === key ? \"background\" : \"default\" }\"\n            @click=\"${(event: MouseEvent) => this.handleEntryClick( event, key )}\"\n        >\n            ${key}x\n        </thermal-btn>`;\n    }\n\n    protected render(): unknown {\n\n        if ( this.file === undefined ) {\n            return nothing;\n        }\n\n        return html`<thermal-dropdown \n            interactive=\"${this.enabled}\" \n            .tooltip=${t(T.playbackspeed)}\n        >\n\n            <div slot=\"invoker\" class=\"button\">\n                ${this.playbackSpeed}x\n            </div>\n\n            ${Object.entries( playbackSpeed ).map( ([key]) => {\n                return this.renderEntry( key );\n            } )}\n            \n        </thermal-dropdown>`\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"file-playback-speed-dropdown\": FilePlaybackSpeedDropdown;\n    }\n}\n","import type { ThermalFileInstance } from \"@labirthermal/core\";\nimport { consume } from \"@lit/context\";\nimport { t } from \"i18next\";\nimport { html, nothing } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { createRef, ref } from \"lit/directives/ref.js\";\nimport type { Ref } from \"lit/directives/ref.js\";\nimport { AbstractFileConsumer } from \"../../hierarchy/consumers/AbstractFileConsumer\";\nimport { configContext } from \"../../controllers/ConfigController\";\nimport type { ConfigController } from \"../../controllers/ConfigController\";\nimport { T } from \"../../translations/Languages\";\nimport type { ThermalDialogElement } from \"../../ui/Dialog\";\nimport type { ThermalDropdownElement } from \"../../ui/Dropdown\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\n\nexport class FileDownloadButton extends AbstractFileConsumer {\n\n    @state()\n    @consume({ context: configContext, subscribe: true })\n    protected configController?: ConfigController;\n\n    @state()\n    protected hasGraphs: boolean = false;\n\n    @property({ type: String, reflect: true })\n    public variant?: string;\n\n    @property({ type: String, reflect: true })\n    public icon?: string;\n\n    @property({ type: String, reflect: true })\n    public iconStyle?: string;\n\n    protected recordingGraphRef: Ref<ThermalDialogElement> = createRef();\n    protected dropdownRef: Ref<ThermalDropdownElement> = createRef();\n\n    public onInstanceCreated(instance: ThermalFileInstance): void {\n        instance.analysisData.onGraphsPresence.set(this.UUID, value => {\n            this.hasGraphs = value;\n        });\n        this.hasGraphs = instance.analysisData.hasActiveGraphs;\n    }\n\n    public onFailure(): void {\n        // throw new Error(\"Method not implemented.\");\n    }\n\n\n    protected render(): unknown {\n\n        if (this.file === undefined) {\n            return nothing;\n        }\n\n        return html`\n\n            <thermal-dropdown ${ref(this.dropdownRef)} class=\"download\"\n                icon=${ifDefined( this.icon )}\n                iconStyle=${ifDefined( this.iconStyle )}\n                variant=${ifDefined( this.variant )}\n            >\n\n                <slot name=\"invoker\" slot=\"invoker\">\n                    <div class=\"button\">\n                        ${this.file\n                ? t(T.download)\n                : \"...\"\n            }\n                    </div>\n                </slot>\n\n                <thermal-btn \n                    slot=\"option\"\n                    @click=\"${() => window.open(this.file!.thermalUrl)}\"\n                    pre=${this.file.reader.parser.extensions[0].extension.toUpperCase()}\n                    align=\"left\"\n                >\n                    ${t(T.downloadoriginalfile, { type: this.file.reader.parser.extensions[0].extension.toUpperCase() })}\n                </thermal-btn>\n\n                <thermal-btn \n                    slot=\"option\"\n                    @click=${() => this.file!.export.downloadPng({\n                        width: this.configController?.settings.export.png.width ?? 1350,\n                        fontSize: this.configController?.settings.export.png.fontSize,\n                        showAnalysis: this.configController?.settings.export.png.analyses,\n                        showThermalScale: this.configController?.settings.export.png.thermalScale,\n                        showFileDate: this.configController?.settings.export.png.fileDate,\n                        showFileName: this.configController?.settings.export.png.fileName\n                    })}\n                    pre=\"PNG\"\n                    align=\"left\"\n                >\n                    ${t(T.exportcurrentframeaspng)}\n                </thermal-btn>\n\n                <file-video-export-button \n                    pre=\"${this.file.timeline.isSequence ? \"MP4 / PNG\" : \"PNG\"}\" \n                    label=\"Pokročilý export\" \n                    slot=\"option\"\n                    style=\"width: 100%\"\n                ></file-video-export-button>\n\n\n\n                    ${this.hasGraphs === true\n                ? html`<thermal-btn \n                            slot=\"option\"\n                            @click=${() => this.file?.analysisData.downloadData()}\n                            pre=\"CSV\"\n                            align=\"left\"\n                    >\n                        ${t(T.csvofanalysisdata)}\n                    </thermal-btn>`\n                : nothing\n            }\n            \n            </thermal-dropdown>\n\n            <thermal-dialog \n                ${ref(this.recordingGraphRef)}\n                label=\"Export souboru do videa\"\n                button=\"Začít nahrávat\"\n                .beforeClose=${ async () => {\n                    this.file?.recording.recordEntireFile();\n                    return true;\n                }}\n            >\n\n                <div slot=\"content\">\n\n                    <p>Export probíhá tak, že sekvenci ve Vašem prohlížeči přehrajeme a zaznamenáme do video souboru.</p>\n\n                    <p>Součástí exportu <i>nejsou analýzy ani teplotní škála</i>.</p>\n\n                    <p><strong>Při nahrávání bude použito aktuální nastavení:</strong></p>\n\n                    <table>\n\n                        <tr>\n                            <td>Barevná paleta</td>\n                            <td>\n                                <manager-palette-dropdown></manager-palette-dropdown>\n                            </td>\n                        </tr>\n\n                        <tr>\n                            <td>Teplotní rozsah</td>\n                            <td>\n                                <registry-range-form></registry-range-form>\n                            </td>\n                        </tr>\n\n                        <tr>\n                            <td>Rychlost přehrávání</td>\n                            <td>\n                                <file-playback-speed-dropdown></file-playback-speed-dropdown>\n                            </td>\n                        </tr>\n\n                    </table>\n\n                    <p>Chcete zahájit nahrávání?</p>\n\n\n                </div>\n\n                <thermal-btn slot=\"button\" @click=${() => this.dropdownRef.value?.setClose()}>\n                    Zrušit\n                </thermal-btn>\n\n            </thermal-dialog>\n\n        \n        `\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"file-download-dropdown\": FileDownloadButton;\n    }\n}\n","import type { ThermalFileInstance } from \"@labirthermal/core\";\nimport { property } from \"lit/decorators.js\";\nimport { AbstractFileButton } from \"./AbstractFileButton\";\n\nexport class FileButtonElement extends AbstractFileButton {\n\n\n    public tooltip: undefined = undefined;\n\n    @property({type: String})\n    public label!: string;\n\n    @property({type: Object})\n    public onEnter?: (instance: ThermalFileInstance) => void;\n\n    @property({type: Object})\n    public onLeave?: (instance: ThermalFileInstance) => void;;\n\n    @property({type: Object})\n    public onAction?: (instance: ThermalFileInstance) => void;;\n\n    public onInstanceCreated(): void { }\n\n    public enter() { if (this.onEnter && this.file) this.onEnter(this.file); }\n    public leave() { if ( this.onLeave && this.file ) this.onLeave(this.file);  }\n\n    public action() {\n        if ( this.onAction && this.file ) {\n            this.onAction( this.file );\n        }\n\n    }\n\n    public getDefaultLabel(): string {\n        return this.label;\n    }\n\n    \n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"file-button\": FileButtonElement;\n    }\n}\n","import type { CSSResultGroup, PropertyValues } from \"lit\";\nimport { css, html, nothing } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { AbstractThermalElement } from \"../../../hierarchy/AbstractThermalElement\";\n\nexport class FileDropdown extends AbstractThermalElement {\n\n    @property({type: String, reflect: true})\n    label?: string;\n\n    @state()\n    protected expanded: boolean = false;\n\n    protected toggle()  { this.expanded = ! this.expanded; }\n    protected expand() { this.expanded = true; }\n    protected collapse() { this.expanded = false; }\n\n    updated(_changedProperties: PropertyValues): void {\n        super.updated(_changedProperties);\n        if ( _changedProperties.has( \"expanded\" ) ) {\n            if ( this.expanded === true ) {\n                this.classList.add( \"expanded\" );\n            } else {\n                this.classList.remove( \"expanded\" );\n            }\n\n        }\n    }\n\n\n    static styles?: CSSResultGroup | undefined = css`\n        :host {\n            \n        }\n\n        .container {\n            display: block;\n            position: relative;\n        }\n\n        .dropdown {\n\n            z-index: 999;\n\n            position: absolute;\n            right: 0px;\n            \n            box-sizing: border-box;\n            \n            overflow: hidden;\n            max-height: 0px;\n\n            > div {\n                padding: 5px; \n                background-color: var(--thermal-background);\n                border: var(--thermal-border-width) var(--thermal-border-style) var(--thermal-slate);\n                border-radius: var(--thermal-radius);\n\n                display: flex;\n                flex-direction: column;\n                gap: 5px;\n                align-items: flex-end;\n                justify-content: flex-end;\n\n            }\n\n        }\n\n\n        .backdrop {\n            display: none;\n            cursor: pointer;\n        }\n\n\n        button.default {\n            font-size: calc( var(--thermal-fs) * .8 );\n            color: var(--thermal-foreground);\n            border-color: var(--thermal-slate);\n            border-style: solid;\n            border-width: 1px;\n            border-radius: var( --thermal-radius );\n            background-color: var(--thermal-slate-light);\n            &:hover {\n                cursor: pointer;\n                background: var(--thermal-background);\n            }\n        }\n\n\n        :host(.expanded) .dropdown {\n\n            max-height: 500px;\n\n        }\n\n        :host(.expanded) .backdrop {\n\n            display: block;\n            position: fixed;\n            top: -100vh;\n            left: -100vw;\n            height: 200vh;\n            width: 200vw;\n            z-index: 998;\n\n        }\n\n\n\n    `;\n\n\n    protected render(): unknown {\n        return html`\n            <div class=\"backdrop\" @click=${() => this.collapse() }></div>\n            <div class=\"container\">\n                <thermal-btn variant=\"default\" size=\"sm\" icon=\"ellipsis\" iconStyle=\"micro\" @click=${() => { this.toggle() }}>${this.label ?? nothing}</thermal-btn>\n                <nav class=\"dropdown\">\n                    <div>\n                        <slot></slot>\n                    </div>\n                </nav>\n            </div>\n        `;\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"file-dropdown-elt\": FileDropdown;\n    }\n}\n","import { AbstractFileButton } from \"./AbstractFileButton\";\n\nexport class FileLrcButton extends AbstractFileButton {\n\n    tooltip: undefined = undefined;\n\n    public onInstanceCreated(): void { }\n\n    public enter() {}\n    public leave() {}\n\n    public action() {\n        if ( this.file ) {\n            const link = document.createElement( \"a\" );\n            link.href = this.file.thermalUrl;\n            link.download = this.file.fileName;\n            link.click();\n        }\n\n    }\n\n    public getDefaultLabel(): string {\n        return this.file?.reader.parser.extensions[ 0 ]?.extension ?? \"lrc\";\n    }\n\n    \n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"file-download-lrc\": FileLrcButton;\n    }\n}\n","import { consume } from \"@lit/context\";\nimport { state } from \"lit/decorators.js\";\nimport type { ConfigController } from \"../../../controllers/ConfigController\";\nimport { configContext } from \"../../../controllers/ConfigController\";\nimport { AbstractFileButton } from \"./AbstractFileButton\";\n\nexport class FilePngButton extends AbstractFileButton {\n\n    tooltip: undefined = undefined;\n\n    @state()\n    @consume({ context: configContext, subscribe: true })\n    protected configController?: ConfigController;\n\n    public onInstanceCreated(): void { }\n\n    public enter() { }\n    public leave() { }\n\n    public action() {\n        if (this.file) {\n            const png = this.configController?.settings.export.png;\n            this.file.export.downloadPng({\n                width: png?.width,\n                fontSize: png?.fontSize,\n                showAnalysis: png?.analyses,\n                showThermalScale: png?.thermalScale,\n                showFileName: png?.fileName,\n                showFileDate: png?.fileDate\n            });\n        }\n\n    }\n\n    public getDefaultLabel(): string {\n        return \"png\";\n    }\n\n\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"file-download-png\": FilePngButton;\n    }\n}\n","import type { ThermalFileInstance, ThermalUnit } from \"@labirthermal/core\";\nimport { consume } from \"@lit/context\";\nimport { t } from \"i18next\";\nimport type { PropertyValues } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { managerUnitContext } from \"../../../controllers/ManagerController\";\nimport { T } from \"../../../translations/Languages\";\nimport { AbstractFileButton } from \"./AbstractFileButton\";\n\nexport class FileRangePropagator extends AbstractFileButton {\n\n    @state()\n    @consume({ context: managerUnitContext, subscribe: true })\n    private unit?: ThermalUnit;\n\n    @property({ type: Boolean, reflect: true, attribute: \"hide-label\"})\n    public hideLabel: boolean = false;\n\n    private boundFile?: ThermalFileInstance;\n\n    connectedCallback(): void {\n        super.connectedCallback();\n        this.bindFile();\n    }\n\n    disconnectedCallback(): void {\n        this.unbindFile();\n        super.disconnectedCallback();\n    }\n\n    willUpdate(changedProperties: PropertyValues<this>): void {\n        super.willUpdate(changedProperties);\n        this.bindFile();\n    }\n\n    /** Metadata can change after filtering without replacing the file instance. */\n    private bindFile(): void {\n        if (!this.isConnected || this.file === this.boundFile) return;\n\n        this.unbindFile();\n        this.boundFile = this.file;\n        this.boundFile?.meta.onChange.set(this.UUID, () => this.requestUpdate());\n    }\n\n    private unbindFile(): void {\n        this.boundFile?.meta.onChange.delete(this.UUID);\n        this.boundFile = undefined;\n    }\n\n    /** The file bounds and all range interactions remain in Celsius. */\n    protected get tooltip(): string {\n        if (!this.file) return t(T.range);\n        return this.managerController.formatRange(\n            this.managerController.toCurrentUnit(this.file.min),\n            this.managerController.toCurrentUnit(this.file.max)\n        );\n    }\n\n    /** The file context and metadata listener provide the tooltip values. */\n    public onInstanceCreated(): void {}\n\n    enter() {\n\n        if ( this.registryController && this.file ) {\n            this.registryController.setHighlight({\n                from: this.file.min,\n                to: this.file.max\n            });\n        \n        }\n\n    }\n    leave() {\n\n        if (this.registryController) {\n            this.registryController.setHighlight(undefined);\n        }\n\n    }\n\n    action() {\n        if (this.file) {\n            this.file.group.registry.range.imposeRange({\n                from: this.file.min,\n                to: this.file.max\n            });\n        }\n    }\n\n    getDefaultLabel(): string {\n        if (this.hideLabel) return \"\";\n        return t(T.range).toLowerCase();\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"file-range-propagator\": FileRangePropagator;\n    }\n}\n","import type { AbstractAnalysis, ThermalFileInstance } from \"@labirthermal/core\";\nimport { AbstractAddTool } from \"@labirthermal/core\";\nimport { t } from \"i18next\";\nimport type { CSSResultGroup, PropertyValues } from \"lit\";\nimport { css, html, nothing } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport type { Ref } from \"lit/directives/ref.js\";\nimport { createRef, ref } from \"lit/directives/ref.js\";\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\nimport { AbstractFileConsumer } from \"../../../hierarchy/consumers/AbstractFileConsumer\";\nimport { T } from \"../../../translations/Languages\";\nimport type { AnalysisTableMode } from \"./AnalysisTableOptions\";\n\nexport class FileAnalysisComplexElement extends AbstractFileConsumer {\n\n    @property({ attribute: \"table-mode\" })\n    public tableMode: AnalysisTableMode = \"full\";\n\n    @property({ type: Boolean, reflect: true, attribute: \"interactive-analysis\" })\n    public interactiveAnalysis: boolean = false;\n\n    @property({ type: Boolean, attribute: \"graph-activation-enabled\", reflect: true })\n    public graphActivationEnabled: boolean = true;\n\n    @state()\n    protected mayHaveGraph: boolean = false;\n\n    @state()\n    protected hasAnalysis: boolean = false;\n\n    @state()\n    protected isDrawingAnalysis: boolean = false;\n\n    @state()\n    protected hasGraph: boolean = false;\n\n    protected graphRef: Ref<HTMLDivElement> = createRef();\n\n    @state()\n    protected graphWidth: number = 0;\n\n    @state()\n    protected graphHeight: number = 0;\n\n    protected observer?: ResizeObserver;\n\n    private boundFile?: ThermalFileInstance;\n    private readonly watchedAnalyses = new Set<AbstractAnalysis>();\n    private listenerLayer?: HTMLElement;\n    private observedGraph?: HTMLDivElement;\n\n    @property({ type: Boolean, reflect: true, attribute: \"hide-hint\" })\n    public hideHint: boolean = false;\n\n\n    connectedCallback(): void {\n        super.connectedCallback();\n        this.refreshFileState();\n        this.hydrate();\n        this.requestUpdate();\n    }\n\n    disconnectedCallback(): void {\n        this.dehydrate();\n        this.disconnectObserver();\n        super.disconnectedCallback();\n    }\n\n\n    public onInstanceCreated(): void {\n        this.requestUpdate();\n    }\n    \n    public onFailure(): void {}\n\n\n    /** Derives render state from the current file without registering listeners. */\n    private refreshFileState(): void {\n        this.mayHaveGraph = this.file?.timeline.isSequence ?? false;\n        this.hasAnalysis = (this.file?.analysis.value.length ?? 0) > 0;\n        this.hasGraph = this.file?.analysis.value.some(analysis => {\n            const { MIN, MAX, AVG } = analysis.graph.state;\n            return MIN || MAX || AVG;\n        }) ?? false;\n        if (!this.hasAnalysis) {\n            this.isDrawingAnalysis = false;\n        }\n    }\n\n    /** Binds the current file and its existing analyses, replacing subscriptions to the previous file. */\n    protected hydrate(): void {\n        const instance = this.file;\n        if (!this.isConnected || this.boundFile === instance) {\n            return;\n        }\n        this.dehydrate();\n        this.boundFile = instance;\n        if (!instance) {\n            return;\n        }\n\n        instance.analysis.addListener(this.UUID, analyses => {\n            this.syncAnalyses(analyses);\n            this.refreshFileState();\n        });\n        this.syncAnalyses(instance.analysis.value);\n    }\n\n    /** Keeps graph subscriptions and the pointer listener aligned with the current analysis list. */\n    private syncAnalyses(analyses: AbstractAnalysis[]): void {\n        for (const analysis of this.watchedAnalyses) {\n            if (!analyses.includes(analysis)) {\n                analysis.graph.onGraphActivation.delete(this.UUID);\n                this.watchedAnalyses.delete(analysis);\n            }\n        }\n        analyses.forEach(analysis => this.watchAnalysis(analysis));\n        const layer = analyses.length > 0\n            ? this.boundFile?.dom?.listenerLayer?.getLayerRoot()\n            : undefined;\n        if (layer !== this.listenerLayer) {\n            this.listenerLayer?.removeEventListener(\"pointerup\", this.pointerUpListener);\n            this.listenerLayer = layer;\n            this.listenerLayer?.addEventListener(\"pointerup\", this.pointerUpListener);\n        }\n    }\n\n    /** Observes graph activation once per analysis; rendering state is refreshed by external events. */\n    protected watchAnalysis(analysis: AbstractAnalysis): void {\n        if (this.watchedAnalyses.has(analysis)) {\n            return;\n        }\n        this.watchedAnalyses.add(analysis);\n        analysis.graph.onGraphActivation.set(this.UUID, () => {\n            this.refreshFileState();\n        });\n\n    }\n\n    private pointerUpListener = () => {\n        this.isDrawingAnalysis = false;\n    }\n\n    /** Removes file, analysis and pointer listeners from the actual subscribed objects. */\n    protected dehydrate(): void {\n        this.boundFile?.analysis.removeListener(this.UUID);\n        for (const analysis of this.watchedAnalyses) {\n            analysis.graph.onGraphActivation.delete(this.UUID);\n        }\n        this.watchedAnalyses.clear();\n        this.listenerLayer?.removeEventListener(\"pointerup\", this.pointerUpListener);\n        this.listenerLayer = undefined;\n        this.boundFile = undefined;\n    }\n\n    willUpdate(changedProperties: PropertyValues): void {\n        super.willUpdate(changedProperties);\n\n        // Side effect of file changing - derive analysis and graph presence before rendering the new file.\n        if (changedProperties.has(\"file\")) {\n            this.isDrawingAnalysis = false;\n            this.refreshFileState();\n        }\n    }\n\n    updated(changedProperties: PropertyValues): void {\n        super.updated(changedProperties);\n\n        // Rebind external listeners after rendering without scheduling another update.\n        if (changedProperties.has(\"file\")) {\n            this.hydrate();\n        }\n        this.observeGraph();\n    }\n\n    /** Observes the rendered graph container, including after reconnecting or replacing the DOM node. */\n    private observeGraph(): void {\n        const graph = this.isConnected ? this.graphRef.value : undefined;\n        if (graph === this.observedGraph) {\n            return;\n        }\n        this.disconnectObserver();\n        if (!graph) {\n            return;\n        }\n        this.observedGraph = graph;\n        this.observer = new ResizeObserver(entries => {\n            if (this.observedGraph !== graph || !this.isConnected) {\n                return;\n            }\n            const entry = entries.find(entry => entry.target === graph);\n            if (entry) {\n                this.graphWidth = entry.contentRect.width;\n                this.graphHeight = entry.contentRect.height;\n            }\n        });\n        this.observer.observe(graph);\n    }\n\n    /** Releases the observer even when Lit has already cleared the graph reference. */\n    private disconnectObserver(): void {\n        this.observer?.disconnect();\n        this.observer = undefined;\n        this.observedGraph = undefined;\n    }\n\n\n    protected renderButtons() {\n\n\n        const addTools = this.file !== undefined\n            ? Object.values(this.file.group.tool.tools).filter(tool => tool instanceof AbstractAddTool)\n            : [];\n\n\n        return html`\n            <div class=\"buttons\">\n                ${addTools.map(tool => {\n\n            return html`<thermal-btn @click=${() => {\n                    this.isDrawingAnalysis = true;\n                    this.file?.group.tool.selectTool(tool);\n                }}>\n                    <div style=\"display: flex; align-items: center; gap: 10px\">\n                        <div style=\"width: 1.5em; display: inline-block;\">\n                            ${unsafeHTML(tool.icon)}\n                        </div>\n                        <div>\n                            ${t(T[tool.name as keyof typeof T])}\n                        </div>\n                    </div>\n                </thermal-btn>`;\n\n        })\n            }\n            </div>\n\n            <slot></slot>\n        \n        `;\n\n    }\n\n    protected renderCurrentTooltip() {\n        return html`${t(T[this.managerObject.tool.value.description as keyof typeof T] )}`;\n    }\n\n    protected renderAddAnalysis() {\n\n        return html`<div class=\"addanalysis\">\n\n            ${!this.hideHint\n                ? html`<div>\n                    <strong>${t(T.analysis)}</strong>\n                </div>\n\n                <div>${t(T.analysishint)}</div>`\n                : nothing\n            }\n\n\n            ${this.isDrawingAnalysis === true\n                ? this.renderCurrentTooltip()\n                : this.renderButtons()\n            }\n        </div>`;\n\n    }\n\n\n    protected renderGraph() {\n\n        if (!this.mayHaveGraph) {\n            return nothing;\n        }\n\n        if (this.hasGraph === true) {\n            return html`\n            \n            <div class=\"graph\" ${ref(this.graphRef)}>\n                <file-analysis-graph graphWidth=${this.graphWidth} graphHeight=${this.graphHeight}></file-analysis-graph>\n            </div>`;\n        }\n\n        else {\n            if (this.hasAnalysis === true) {\n                return html`<div class=\"graph graph-prompt\">\n                    <div>\n                        <strong>${t(T.graph)}</strong>\n                    </div>\n                    <div class=\"hint\">${unsafeHTML( t(T.graphhint2) )}</div>\n                </div>`;\n            } else {\n                return html`<div class=\"graph graph-prompt\">\n                    <div>\n                        <strong>${t(T.graph)}</strong>\n                    </div>\n                    <div class=\"hint\">${t(T.graphhint1)}</div>\n                </div>`;\n            }\n        }\n\n\n    }\n\n\n\n    static styles?: CSSResultGroup | undefined = css`\n\n        :host {\n            display: block;\n            min-width: 0;\n            max-width: 100%;\n        }\n\n        .container {\n            height: 100%;\n            width: 100%;\n            color: var(--thermal-foreground);\n        }\n\n        .container.may {\n            display: flex;\n            flex-direction: column;\n            gap: var(--thermal-gap);\n\n            > * {\n                width: 100%;\n            }\n\n            .analysis {\n                height: calc( 50% - var(--thermal-gap));\n            }\n\n        }\n\n        .container.may-not {\n            .analysis {\n                height: 100%;\n            }\n        }\n\n        .analysis {\n            min-width: 0;\n        }\n    \n        .addanalysis {\n            padding: var(--thermal-gap);\n            border: var(--thermal-border-width) dashed var(--thermal-slate);\n            border-radius: var(--thermal-radius);\n            display: flex;\n            flex-direction: column;\n            align-items: center;\n            justify-content: center;\n            gap: var(--thermal-gap);\n            box-sizing: border-box;\n            width: 100%;\n            height: 100%;\n            text-align: center;\n        }\n\n        .graph {\n            height: 50%;\n        }\n\n        .graph-prompt {\n            padding: var(--thermal-gap);\n            border: var(--thermal-border-width) dashed var(--thermal-slate);\n            border-radius: var(--thermal-radius);\n            box-sizing: border-box;\n            display: flex;\n            flex-direction: column;\n            align-items: center;\n            justify-content: center;\n            gap: var(--thermal-gap);\n        }\n\n        .hint {\n            thermal-btn {\n                display: inline-block;\n                cursor: help;\n            }\n        }\n\n        .buttons {\n            display: flex;\n            align-items: center;\n            justify-content: center;\n            flex-wrap: wrap;\n            gap: 5px;\n        }\n\n        file-analysis-table {\n        }\n    \n    `;\n\n\n    protected render(): unknown {\n        return html`\n            <div class=\"container ${this.mayHaveGraph === true ? \"may\" : \"may-not\"}\">\n\n            <div class=\"analysis\">\n                ${this.hasAnalysis === false || this.isDrawingAnalysis === true\n                ? this.renderAddAnalysis()\n                : html`<file-analysis-table\n                    .tableMode=${this.tableMode}\n                    ?force-interactive=${this.interactiveAnalysis}\n                    ?graph-activation-disabled=${!this.graphActivationEnabled}\n                ></file-analysis-table>`\n            }\n            </div>\n            ${this.renderGraph()}\n\n            </div>\n\n        `;\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"file-analysis-complex\": FileAnalysisComplexElement;\n    }\n}\n","import type { AbstractAnalysis, ThermalFileInstance, ThermalUnit } from \"@labirthermal/core\";\nimport { t } from \"i18next\";\nimport type { PropertyValues } from \"lit\";\nimport { css, html, nothing } from \"lit\";\nimport { state } from \"lit/decorators.js\";\nimport type { Ref } from 'lit/directives/ref.js';\nimport { createRef, ref } from 'lit/directives/ref.js';\nimport type { StyleInfo } from \"lit/directives/style-map.js\";\nimport { styleMap } from \"lit/directives/style-map.js\";\nimport { AbstractFileConsumer } from \"../../../hierarchy/consumers/AbstractFileConsumer\";\nimport { T } from \"../../../translations/Languages\";\nimport { managerUnitContext } from \"../../../controllers/ManagerController\";\nimport { consume } from \"@lit/context\";\n\n/** Display the analysis state for the purpose of exporting. */\nexport class FileAnalysisDisplayElement extends AbstractFileConsumer {\n\n    protected container: Ref<HTMLDivElement> = createRef();\n\n    @state()\n    protected analysis: AbstractAnalysis[] = [];\n\n    private boundFile?: ThermalFileInstance;\n    private boundAnalyses = new Set<AbstractAnalysis>();\n\n    private readonly analysisValuesChanged = (): void => {\n        this.requestUpdate();\n    };\n\n    @state()\n    @consume({context: managerUnitContext, subscribe: true })\n    private unit!: ThermalUnit;\n\n    public onFailure(): void {}\n\n    public onInstanceCreated(): void {\n        this.requestUpdate();\n    }\n\n    connectedCallback(): void {\n        super.connectedCallback();\n        // Refresh the snapshot because analyses may have changed while disconnected.\n        if (this.file) {\n            this.analysis = this.file.analysis.value;\n        }\n\n        this.bindFile();\n        this.bindAnalysisValues();\n    }\n\n    disconnectedCallback(): void {\n        this.unbindFile();\n        super.disconnectedCallback();\n    }\n\n    willUpdate(changedProperties: PropertyValues<this>): void {\n        super.willUpdate(changedProperties);\n\n        // Side effect of file changing - mirror the analysis list before rendering, or clear it if no file is available.\n        if (changedProperties.has(\"file\")) {\n            this.analysis = this.file?.analysis.value ?? [];\n        }\n    }\n\n    updated(changedProperties: PropertyValues<this>): void {\n        super.updated(changedProperties);\n\n        // Rebind external listeners after rendering without changing reactive state in this hook.\n        if (changedProperties.has(\"file\")) {\n            this.bindFile();\n            this.bindAnalysisValues();\n        }\n    }\n\n    /**\n     * Observes analysis-list and frame changes on the current file while connected.\n     * Removes previous subscriptions and avoids registering twice for the same file.\n     */\n    private bindFile(): void {\n        if (!this.isConnected || this.boundFile === this.file) {\n            return;\n        }\n        this.unbindFile();\n        this.boundFile = this.file;\n        const file = this.boundFile;\n        if (!file) {\n            return;\n        }\n        file.analysis.addListener(this.UUID, analysis => {\n            this.analysis = analysis;\n            this.bindAnalysisValues();\n            this.requestUpdate();\n        });\n        file.timeline.onFrame.add(this.UUID, () => {\n            this.requestUpdate();\n        });\n    }\n\n    /** Removes both listeners from the actual subscribed file when replacing it or disconnecting. */\n    private unbindFile(): void {\n        this.boundFile?.analysis.removeListener(this.UUID);\n        this.boundFile?.timeline.onFrame.delete(this.UUID);\n        this.boundFile = undefined;\n        this.unbindAnalysisValues();\n    }\n\n    /**\n     * Keeps value-change subscriptions aligned with the analyses in the current table.\n     * The same listener ID is safe because each analysis owns its own callbacks manager.\n     */\n    private bindAnalysisValues(): void {\n        const nextAnalyses = new Set(this.analysis);\n\n        for (const analysis of this.boundAnalyses) {\n            if (!nextAnalyses.has(analysis)) {\n                analysis.onValues.delete(this.UUID);\n            }\n        }\n\n        for (const analysis of nextAnalyses) {\n            if (!this.boundAnalyses.has(analysis)) {\n                analysis.onValues.set(this.UUID, this.analysisValuesChanged);\n            }\n        }\n\n        this.boundAnalyses = nextAnalyses;\n    }\n\n    /** Removes value listeners from the exact analysis instances previously subscribed. */\n    private unbindAnalysisValues(): void {\n        for (const analysis of this.boundAnalyses) {\n            analysis.onValues.delete(this.UUID);\n        }\n        this.boundAnalyses.clear();\n    }\n\n    public static styles = css`\n    \n        .overflow {\n            overflow-x:auto;\n            width: 100%;\n        }\n\n        table {\n            display: table;\n            min-width: 100%;\n            border-collapse: collapse;\n            color: var( --thermal-foreground );\n            td, th {\n                padding: calc( var( --thermal-fs ) * .5 )\n            }\n\n            td {\n                border-top: var(--thermal-slate-light ) 1px solid;\n            }\n        }\n\n        th {\n            text-align: left;\n        }\n\n        th, td, button, thermal-btn {\n            font-size: var( --thermal-fs-sm );\n            font-size: 14px;\n        }\n\n        caption {\n            display: none !important;\n        }\n\n        file-analysis-table-row {\n            color: var( --thermal-foreground );\n            transition: background-color .2s ease-in-out;\n        }\n\n        file-analysis-table-row:not(:last-child) {\n            border-bottom: var(--thermal-border-width) dotted var( --thermal-foreground );\n        }\n\n        file-analysis-table-row[selected] {\n            background-color: var( --thermal-background );\n        }\n\n        .all {\n\n            &.interactive {\n                cursor: pointer;\n            }\n\n            &.interactive:hover {\n                color: var( --thermal-primary );\n            }\n\n            u, b, span {\n                display: inline-block;\n            }\n\n            u {\n                width: 10px;\n                height: 10px;\n                border-radius: 50%;\n                border: var(--thermal-border-width) var(--thermal-border-style) var( --thermal-slate );\n            }\n\n            &.yes u {\n                background-color: var( --thermal-slate-dark );\n            }\n\n            button {\n                margin: 0;\n                padding: 0;\n                border: 0;\n                background: transparent;\n                color: var( --thermal-primary );\n                text-transform: lowercase;\n                cursor: pointer;\n\n                &:hover,\n                &:focus {\n                    color: var( --thermal-primary-dark );\n                }\n            }\n\n        }\n\n        .analysis-name {\n            display: flex;\n            align-items: center;\n            gap: .5em;\n            strong,\n            span {\n                display: inline-block;\n            }\n\n            strong {\n                width: 1.5em;\n                height: 2px;\n            }\n        }\n\n\n\n    `;\n\n\n\n    protected render(): unknown {\n\n        if (this.analysis.length === 0 || this.file === undefined) {\n            return nothing;\n        }\n\n        return html`\n\n        <div class=\"overflow\" ${ref(this.container)}>\n\n            <table>\n\n                <caption data-video-ignore>Table of analysis currently set on the file ${this.file.fileName}.</caption>\n\n                <thead>\n\n                    <tr>\n                        <th></th>\n                        <th>${t(T.avg)}</th>\n                        <th>${t(T.min)}</th>\n                        <th>${t(T.max)}</th>\n                        <th>${t(T.size)}</th>\n                    </tr>\n                \n                </thead>\n\n                <tbody>\n\n                    ${this.analysis.map(\n            analysis => this.renderAnalysisRow(analysis)\n        )}\n                \n                </tbody>\n\n                </table>\n\n            </div>\n            \n        `;\n    }\n\n    private renderAnalysisRow(\n        analysis: AbstractAnalysis\n    ): unknown {\n\n        const state = analysis.graph.state;\n\n        const { MIN, MAX, AVG } = state;\n\n        return html`<tr>\n            <td class=\"analysis-name\">\n                <strong style=\"background: ${analysis.color};\"></strong>\n                <span>${analysis.name}</span>\n            </td>\n            ${this.renderAnalysisRowTemperatureCell(analysis.color, AVG, analysis.avg)}\n            ${this.renderAnalysisRowTemperatureCell(analysis.color, MIN, analysis.min)}\n            ${this.renderAnalysisRowTemperatureCell(analysis.color, MAX, analysis.max)}\n            <td>${analysis.width} x ${analysis.height} px</td>\n        </tr>`;\n\n    }\n\n    private renderAnalysisRowTemperatureCell(\n        color: string,\n        inGraph: boolean,\n        value?: number\n    ): unknown {\n\n        const style: StyleInfo = {\n            padding: \"4px 0px\"\n        };\n\n        if (inGraph) {\n            style.borderColor = color;\n            style.borderStyle = \"solid\";\n            style.borderWidth = \"2px\";\n            style.padding = \"2px 6px\"\n        }\n\n        let valueDisplay: string = \"-\";\n\n        if (value !== undefined) {\n            valueDisplay = this.managerController.formatSingle(\n                this.managerController.toCurrentUnit(value)\n            );\n        }\n\n        return html`\n            <td>\n                <span style=${styleMap(style)} data-video-dynamic>\n                    ${valueDisplay}\n                </span>\n            </td>\n        `\n\n\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"file-analysis-display\": FileAnalysisDisplayElement;\n    }\n}\n","import { property, state } from \"lit/decorators.js\";\nimport { AbstractThermalElement } from \"../../../hierarchy/AbstractThermalElement\";\nimport type { AbstractAnalysis, AbstractAreaAnalysis} from \"@labirthermal/core\";\nimport { PointAnalysis } from \"@labirthermal/core\";\nimport type { CSSResultGroup, PropertyValues } from \"lit\";\nimport { css, html } from \"lit\";\nimport { t } from \"i18next\";\nimport { T } from \"../../../translations/Languages\";\n\n/** Trigger the edit dialog for an analysis */\nexport class FileAnalisisEditDialog extends AbstractThermalElement {\n\n    @property({type: Object})\n    public analysis!: AbstractAnalysis;\n\n    @state()\n    protected name?: string;\n\n    @state()\n    protected type?: string;\n\n    willUpdate(changedProperties: PropertyValues): void {\n        super.willUpdate(changedProperties);\n\n        // Side effect of analysis changing - derive the dialog name and type before rendering.\n        if ( changedProperties.has( \"analysis\" ) ) {\n            this.name = this.analysis.name;\n            this.type = this.analysis.getType();\n        }\n\n    }\n\n    updated(changedProperties: PropertyValues): void {\n        super.updated(changedProperties);\n\n        // Rebind the name-change listener after rendering whenever the input analysis changes.\n        if ( changedProperties.has( \"analysis\" ) ) {\n            const oldAnalysis = changedProperties.get( \"analysis\" ) as AbstractAnalysis | undefined;\n            if ( oldAnalysis ) {\n                oldAnalysis.onSetName.delete( this.UUID );\n            }\n\n\n            this.analysis.onSetName.set(this.UUID, (value) => {\n                this.name = value;\n            });\n        }\n    }\n\n    static styles?: CSSResultGroup | undefined = css`\n    \n        :host {\n        \n            display: inline-block;\n\n        }\n\n    `;\n\n    protected render() {\n        return html`\n\n            <thermal-dialog label=\"${t(T.editsth, {what: t( T[this.type as keyof typeof T] )})}\">\n                <slot name=\"invoker\" slot=\"invoker\">\n                    <thermal-btn \n                        icon=\"settings\" \n                        iconStyle=\"solid\" \n                        size=\"md\" \n                        tooltip=\"${t(T.editsth, {what: this.analysis.name})}\"\n                    >\n                    </thermal-btn>\n                </slot>\n\n                <div slot=\"content\">\n                    ${ this.analysis instanceof PointAnalysis\n                        ? html`<edit-point .analysis=${this.analysis}></edit-point>`\n                        : html`<edit-area .analysis=${this.analysis as AbstractAreaAnalysis}></edit-area>`\n                     }\n                </div>\n\n            </thermal-dialog>\n        \n        `;\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"file-analysis-edit\": FileAnalisisEditDialog;\n    }\n}\n","import type { AnalysisDataStateValue, ThermalFileInstance, ThermalUnit } from \"@labirthermal/core\";\nimport { TimeFormat } from \"@labirthermal/core\";\nimport { consume } from \"@lit/context\";\nimport { t } from \"i18next\";\nimport type { PropertyValues } from \"lit\";\nimport { css, html, nothing } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { guard } from \"lit/directives/guard.js\";\nimport type { Ref } from \"lit/directives/ref.js\";\nimport { createRef, ref } from \"lit/directives/ref.js\";\nimport type { FileControllerCurrentFrameType } from \"../../../controllers/FileController\";\nimport { fileCurrentFrameContext, fileTimeCursorContext } from \"../../../controllers/FileController\";\nimport { managerGraphFunctionContext, managerUnitContext } from \"../../../controllers/ManagerController\";\nimport { AbstractFileConsumer } from \"../../../hierarchy/consumers/AbstractFileConsumer\";\nimport { T } from \"../../../translations/Languages\";\nimport type { ThermalChartElement } from \"./chart/chart\";\n\n/** High level component around `thermal-chart` that provides the functionality of a file analysis graph */\nexport class FileAnalysisGraphElement extends AbstractFileConsumer {\n\n    @state()\n    protected hydrated: boolean = false;\n\n    @property({type: Number, reflect: true})\n    public graphWidth: number = 0;\n\n    @property({type: Number, reflect: true})\n    public graphHeight: number = 0;\n\n    @property({ type: Boolean, reflect: true })\n    public hasDownloads: boolean = true;\n\n    @property({ type: Boolean, reflect: true })\n    public standalone: boolean = false;\n\n    container: Ref<HTMLDivElement> = createRef();\n\n    graphRef: Ref<ThermalChartElement> = createRef();\n\n    @state()\n    protected graphs: AnalysisDataStateValue = {\n        values: [[]],\n        colors: []\n    }\n\n    private chartDataSource?: AnalysisDataStateValue;\n    private chartDataUnit?: ThermalUnit;\n    private chartDataCache?: unknown[][];\n    private chartOptionsCache?: object;\n    private chartOptionsCacheKey?: string;\n    private boundFile?: ThermalFileInstance;\n    private observer?: ResizeObserver;\n    private observedContainer?: HTMLDivElement;\n\n    private readonly receiveGraphData = (value: AnalysisDataStateValue): void => {\n        this.graphs = value;\n    };\n\n    @consume({context: fileCurrentFrameContext, subscribe: true})\n    protected currentFrame?: FileControllerCurrentFrameType;\n\n    @consume({ context: fileTimeCursorContext, subscribe: true })\n    protected cursor: typeof fileTimeCursorContext[\"__context__\"];\n\n    @state()\n    protected shadowLeft: number = 0;\n\n    @state()\n    protected shadowTop: number = 0;\n\n    @state()\n    protected shadowWidth: number = 0;\n\n    @state()\n    protected shadowHeight: number = 0;\n\n    @consume( {context: managerGraphFunctionContext, subscribe: true} )\n    protected graphSmooth: boolean = false;\n\n    /** Current display unit. Graph data stay in Celsius and are converted only for the chart. */\n    @consume({ context: managerUnitContext, subscribe: true })\n    protected unit?: ThermalUnit;\n\n    public onInstanceCreated(instance: ThermalFileInstance): void {\n        this.graphs = instance.analysisData.value;\n        this.hydrated = true;\n        this.requestUpdate();\n    }\n\n\n    public connectedCallback(): void {\n        super.connectedCallback();\n\n        if ( this.file ) {\n            this.graphs = this.file.analysisData.value;\n            this.hydrated = true;\n        }\n        this.requestUpdate();\n    }\n\n    public disconnectedCallback(): void {\n        this.unbindFile();\n        this.disconnectObserver();\n        super.disconnectedCallback();\n    }\n\n    public onFailure(): void {\n        this.unbindFile();\n        this.disconnectObserver();\n    }\n\n    willUpdate(changedProperties: PropertyValues): void {\n        super.willUpdate(changedProperties);\n        // Side effect of file changing - derive graph data before rendering the new file.\n        if (changedProperties.has(\"file\")) {\n            this.graphs = this.file?.analysisData.value ?? { values: [[]], colors: [] };\n            this.hydrated = this.file !== undefined;\n        }\n    }\n\n    updated(changedProperties: PropertyValues): void {\n        super.updated(changedProperties);\n        // Bind after rendering so subscriptions and observers use the current DOM, including on reconnect.\n        this.bindFile();\n        this.toggleAttribute(\"data-has-graphs\", !!this.file?.timeline.isSequence && this.graphs.colors.length > 0);\n        this.observeContainer();\n    }\n\n    private bindFile(): void {\n        if (!this.isConnected || this.boundFile === this.file) {\n            return;\n        }\n        this.unbindFile();\n        this.boundFile = this.file;\n        this.boundFile?.analysisData.addListener(this.UUID, this.receiveGraphData);\n    }\n\n    private unbindFile(): void {\n        this.boundFile?.analysisData.removeListener(this.UUID);\n        this.boundFile = undefined;\n    }\n\n    private observeContainer(): void {\n        const container = this.isConnected && this.standalone ? this.container.value : undefined;\n        if (container === this.observedContainer) {\n            return;\n        }\n        this.disconnectObserver();\n        if (!container) {\n            return;\n        }\n        this.observedContainer = container;\n        this.observer = new ResizeObserver(entries => {\n            if (!this.isConnected || this.observedContainer !== container) {\n                return;\n            }\n            const entry = entries.find(entry => entry.target === container);\n            if (entry) {\n                this.graphWidth = entry.contentRect.width;\n                this.graphHeight = entry.contentRect.height;\n            }\n        });\n        this.observer.observe(container);\n    }\n\n    private disconnectObserver(): void {\n        this.observer?.disconnect();\n        this.observer = undefined;\n        this.observedContainer = undefined;\n    }\n\n    private readonly syncChartArea = (): void => {\n        const chart = this.graphRef.value;\n        if (chart) {\n            this.shadowLeft = chart.left;\n            this.shadowTop = chart.top;\n            this.shadowWidth = chart.w;\n            this.shadowHeight = chart.h;\n        }\n    };\n\n    protected downloadSVG = (svgEl: SVGElement, fileName: string) => {\n\n        // Add missing svg attributes\n        if (!svgEl.getAttribute('xmlns')) {\n            svgEl.setAttribute('xmlns', 'http://www.w3.org/2000/svg');\n        }\n\n        // Get the outer HTML of the element\n        const svgData = svgEl.outerHTML;\n\n        // Create blob and URL\n        const blob = new Blob([svgData], { type: 'image/svg+xml;charset=utf-8' });\n        const url = URL.createObjectURL(blob);\n\n        // Create a link and trigger the download\n        const a = document.createElement('a');\n        a.href = url;\n        a.download = fileName;\n        document.body.appendChild(a);\n        a.click();\n\n        // Clean up\n        document.body.removeChild(a);\n        URL.revokeObjectURL(url);\n    };\n\n    protected downloadPNG = (svgEl: SVGElement, fileName: string) => {\n\n        // Add missing svg attributes\n        if (!svgEl.getAttribute('xmlns')) {\n            svgEl.setAttribute('xmlns', 'http://www.w3.org/2000/svg');\n        }\n\n        // Get the outer HTML of the element\n        const svgData = svgEl.outerHTML;\n\n        // Create blob and URL\n        const blob = new Blob([svgData], { type: 'image/svg+xml;charset=utf-8' });\n        const url = URL.createObjectURL(blob);\n\n        const img = new Image();\n        img.onload = () => {\n            const canvas = document.createElement('canvas');\n            canvas.width = img.width;\n            canvas.height = img.height;\n            const ctx = canvas.getContext('2d');\n            ctx?.drawImage(img, 0, 0);\n\n            const pngUrl = canvas.toDataURL('image/png');\n\n            const a = document.createElement('a');\n            a.href = pngUrl;\n            a.download = fileName;\n            document.body.appendChild(a);\n            a.click();\n\n            document.body.removeChild(a);\n            URL.revokeObjectURL(url);\n        };\n\n        img.src = url;\n\n    }\n\n    private getChartData(): unknown[][] {\n        if (\n            this.chartDataSource === this.graphs\n            && this.chartDataUnit === this.unit\n            && this.chartDataCache\n        ) {\n            return this.chartDataCache;\n        }\n\n        const [headers, ...rows] = this.graphs.values;\n        // Without a manager (e.g. outside the hierarchy) values stay in Celsius\n        const unit = this.managerObject?.unit;\n\n        this.chartDataSource = this.graphs;\n        this.chartDataUnit = this.unit;\n        this.chartDataCache = [\n            [\n                { label: headers[0], type: \"number\" },\n                ...headers.slice(1).flatMap(label => [\n                    { label, type: \"number\" },\n                    { type: \"string\", role: \"tooltip\", p: { html: true } }\n                ])\n            ],\n            ...rows.map(row => {\n                const relativeTime = row[0].getTime();\n\n                return [\n                    relativeTime,\n                    ...row.slice(1).flatMap((value, index) => {\n                        // Missing values (gaps in the series) are passed through unchanged\n                        const isNumber = typeof value === \"number\" && Number.isFinite(value);\n                        const converted = isNumber && unit\n                            ? unit.celsiusToCurrent(value)\n                            : value;\n                        const formatted = !isNumber\n                            ? String(value)\n                            : unit\n                                ? unit.formatSingle(converted as number)\n                                : `${value} °C`;\n\n                        return [\n                            converted,\n                            `<div style=\"padding: 6px 8px\"><div>${this.escapeHtml(t(T.time))}: <strong>${TimeFormat.duration(relativeTime)}</strong></div><div>${this.escapeHtml(headers[index + 1])}: <strong>${this.escapeHtml(formatted)}</strong></div></div>`\n                        ];\n                    })\n                ];\n            })\n        ];\n\n        return this.chartDataCache;\n    }\n\n    private getChartOptions(): object {\n        const duration = this.file?.duration ?? 0;\n        const timeLabel = t(T.time);\n        const temperatureLabel = `${t(T.temperature)} ${this.managerObject?.unit.current.symbol ?? \"°C\"}`;\n        const key = JSON.stringify([\n            this.graphs.colors,\n            this.graphSmooth,\n            this.graphWidth,\n            this.graphHeight,\n            duration,\n            timeLabel,\n            temperatureLabel\n        ]);\n\n        if (this.chartOptionsCache && this.chartOptionsCacheKey === key) {\n            return this.chartOptionsCache;\n        }\n\n        this.chartOptionsCacheKey = key;\n        this.chartOptionsCache = {\n            colors: this.graphs.colors,\n            curveType: this.graphSmooth ? \"function\" : \"default\",\n            legend: { position: \"bottom\" },\n            hAxis: {\n                title: timeLabel,\n                ticks: this.getDurationAxisTicks(),\n                viewWindow: { min: 0, max: duration }\n            },\n            vAxis: { title: temperatureLabel },\n            tooltip: { isHtml: true },\n            width: this.graphWidth,\n            height: this.graphHeight,\n            chartArea: { width: \"80%\" },\n            backgroundColor: { fill: \"transparent\" }\n        };\n\n        return this.chartOptionsCache;\n    }\n\n    private getDurationAxisTicks(): { v: number, f: string }[] {\n        const duration = this.file?.duration ?? 0;\n\n        if (duration <= 0) {\n            return [];\n        }\n\n        const rawStep = duration / 5;\n        const magnitude = 10 ** Math.floor(Math.log10(rawStep));\n        const normalizedStep = rawStep / magnitude;\n        const step = (normalizedStep <= 1 ? 1 : normalizedStep <= 2 ? 2 : normalizedStep <= 5 ? 5 : 10) * magnitude;\n        const ticks: { v: number, f: string }[] = [];\n\n        for (let value = 0; value <= duration; value += step) {\n            ticks.push({ v: value, f: TimeFormat.duration(value) });\n        }\n\n        if (ticks[ticks.length - 1]?.v !== duration) {\n            ticks.push({ v: duration, f: TimeFormat.duration(duration) });\n        }\n\n        return ticks;\n    }\n\n    private escapeHtml(value: string): string {\n        return value.replace(/[&<>\"']/g, character => ({\n            \"&\": \"&amp;\",\n            \"<\": \"&lt;\",\n            \">\": \"&gt;\",\n            \"\\\"\": \"&quot;\",\n            \"'\": \"&#39;\"\n        })[character] ?? character);\n    }\n\n    private handleGraphClick = (relativeTimeMs: number): void => {\n        const file = this.file;\n        if (file?.timeline.isSequence) {\n            void file.timeline.setRelativeTime(this.nearestFrameTime(file.timeline.relativeSteps, relativeTimeMs));\n        }\n    }\n\n    /** The click position is continuous, while the timeline selects the previous frame. Snap to the nearest frame instead. */\n    private nearestFrameTime(steps: number[], relativeTimeMs: number): number {\n        return steps.reduce(\n            (nearest, step) => Math.abs(step - relativeTimeMs) < Math.abs(nearest - relativeTimeMs) ? step : nearest,\n            steps[0] ?? relativeTimeMs\n        );\n    }\n\n    private handleGraphHover = (percentage: number | undefined): void => {\n        this.fileController.setTimeCursorPercentage(percentage);\n    }\n\n    public static styles = css`\n\n        :host {\n            position: relative;\n        }\n\n        :host([standalone=\"\"]) {\n            display: block;\n            height: var(--thermal-analysis-graph-height, 12rem);\n            min-width: 0;\n            margin-top: .5em;\n        }\n\n        :host([standalone=\"\"]:not([data-has-graphs])) {\n            display: none;\n        }\n\n        :host([standalone=\"\"]) .chart-container {\n            height: 100%;\n            width: 100%;\n        }\n    \n        google-chart {\n            width: 100%;\n            height: 100%;\n        }\n\n        .download {\n            position: absolute;\n            right: 0;\n            top: 0;\n            display: flex;\n            gap: 0.25em;\n        }\n\n        thermal-icon {\n            width: .8em;\n            height: .8em;\n            vertical-align: middle;\n            margin-top: 1px;\n        }\n    `;\n\n    protected render(): unknown {\n\n        if (\n            this.file?.timeline.isSequence === false\n            || (this.standalone && (!this.file || this.graphs.colors.length === 0))\n        ) {\n            return nothing;\n        }\n\n        return html`\n\n            <div style=\"position: relative; background-color: white; border-radius: var(--thermal-radius); height: 100%;\">\n\n            \n\n            <div data-video-style style=\"position: absolute; top:${this.shadowTop}px; left: ${this.shadowLeft}px; width: ${this.shadowWidth}px; height: ${this.shadowHeight}px; pointer-events: none;\">\n            ${this.currentFrame && html`\n                <div data-video-style style=\"position: absolute; height: 100%; background-color: #eee; left: 0px; width: ${this.currentFrame.percentage}%\"></div>\n            `}\n\n                ${this.cursor !== undefined ? html`\n                    <div data-video-style style=\"position: absolute; height: 100%; width: 1px; background-color: black; left: ${this.cursor}%\"></div>\n                ` : nothing}\n            </div>\n        \n            <div class=\"chart-container\" ${ref(this.container)}>\n                ${this.graphs.colors.length > 0\n                ? html`<thermal-chart \n                        ${ref(this.graphRef)}\n                        data-video-svg\n                        type=\"line\" \n                        .data=${guard([this.graphs, this.unit], () => this.getChartData())}\n                        .onGraphClick=${this.handleGraphClick}\n                        .onGraphHover=${this.handleGraphHover}\n                        @google-chart-ready=${this.syncChartArea}\n                        .options=${guard([\n                            this.graphs.colors,\n                            this.graphSmooth,\n                            this.graphWidth,\n                            this.graphHeight,\n                            this.file?.duration,\n                            t(T.time),\n                            t(T.temperature),\n                            this.unit\n                        ], () => this.getChartOptions())}\n                        ></thermal-chart>`\n                : nothing\n            }\n            </div>\n\n            ${this.renderDownloads()}\n            \n\n            \n\n            </div>\n        \n        `\n    }\n\n\n    private renderDownloads() {\n\n        if ( !this.hasDownloads ) {\n            return nothing;\n        }\n\n        return html`<div class=\"download\">\n                <thermal-icon icon=\"download\" variant=\"micro\"></thermal-icon>\n                <thermal-btn\n                    size=\"sm\"\n                    @click=${() => {\n                        if ( this.graphRef.value ) {\n                            const svgData = this.graphRef.value.getRef()?.querySelector( 'svg' );\n                            if ( svgData ) {\n                                this.downloadSVG( svgData, \"graph.svg\" );\n                            }\n                        }\n                    }}\n                    variant=\"background\"\n                    plain\n                    tooltip=\"Stáhnout graf jako obrázek SVG\"\n                >SVG</thermal-btn>\n                <thermal-btn\n                    size=\"sm\"\n                    @click=${() => {\n                        if ( this.graphRef.value ) {\n                            const svgData = this.graphRef.value.getRef()?.querySelector( 'svg' );\n                            if ( svgData ) {\n                                this.downloadPNG( svgData, \"graph.png\" );\n                            }\n                        }\n                    }}\n                    variant=\"background\"\n                    plain\n                    tooltip=\"Stáhnout graf jako obrázek PNG\"\n                >PNG</thermal-btn>\n                <thermal-btn\n                    size=\"sm\"\n                    @click=${() => this.file?.analysisData.downloadData()}\n                    variant=\"background\"\n                    plain\n                    tooltip=\"${t(T.downloadgraphdataascsv)}\"\n                >CSV</thermal-btn>\n            </div>`;\n\n\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"file-analysis-graph\": FileAnalysisGraphElement;\n    }\n}\n","import { AbstractAreaAnalysis, PointAnalysis } from \"@labirthermal/core\";\nimport type { AbstractAnalysis, ThermalUnit } from \"@labirthermal/core\";\nimport { consume } from \"@lit/context\";\nimport { t } from \"i18next\";\nimport { css, html, nothing } from \"lit\";\nimport type { PropertyValues } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { AbstractThermalElement } from \"../../../hierarchy/AbstractThermalElement\";\nimport { registryControllerContext } from \"../../../controllers/RegistryController\";\nimport type { RegistryController } from \"../../../controllers/RegistryController\";\nimport { T } from \"../../../translations/Languages\";\nimport { getContrastColor } from \"../../../utils/getContrastColor\";\nimport type { AnalysisTableMode } from \"./AnalysisTableOptions\";\nimport { managerUnitContext } from \"../../../controllers/ManagerController\";\n\nexport class FileAnalysisRowElement extends AbstractThermalElement {\n\n    @property({ attribute: false })\n    public analysis?: AbstractAnalysis;\n\n    @property({ attribute: \"table-mode\" })\n    public tableMode: AnalysisTableMode = \"full\";\n\n    /** Prevents selecting this analysis. */\n    @property({ type: Boolean, attribute: \"selection-disabled\" })\n    public selectionDisabled: boolean = false;\n\n    /** Prevents editing and deleting this analysis, independently of selection. */\n    @property({ type: Boolean, attribute: \"edit-disabled\" })\n    public editDisabled: boolean = false;\n\n    /** Prevents toggling graph values from this row. */\n    @property({ type: Boolean, attribute: \"graph-activation-disabled\" })\n    public graphActivationDisabled: boolean = false;\n\n    /** Shows the action that applies the analysis range to the registry. */\n    @property({ type: Boolean, attribute: \"show-range-propagator\" })\n    public showRangePropagator: boolean = false;\n\n    @property({ type: Boolean, reflect: true })\n    protected selected: boolean = false;\n\n    @consume({ context: registryControllerContext, subscribe: true })\n    private registryController!: RegistryController;\n\n    @state()\n    @consume({context: managerUnitContext, subscribe: true})\n    private unit!: ThermalUnit;\n\n    /** Actual subscription target, retained so old listeners can be removed after analysis changes. Not reactive. */\n    private boundAnalysis?: AbstractAnalysis;\n    /** Tracks pointer presence to preserve highlighting while focus moves within the row. Not reactive. */\n    private hovered: boolean = false;\n    /** Tracks focus presence to preserve highlighting while the pointer leaves the row. Not reactive. */\n    private focused: boolean = false;\n\n    protected get allowsEdit(): boolean {\n        return !this.editDisabled;\n    }\n\n    private readonly refresh = () => {\n        this.selected = this.analysis?.selected ?? false;\n        this.requestUpdate();\n        if (this.hovered || this.focused) {\n            this.highlightAnalysis();\n        }\n\n    };\n\n    willUpdate(changedProperties: PropertyValues): void {\n        super.willUpdate(changedProperties);\n        // Side effect of analysis changing - synchronize selection before rendering and rebind analysis listeners.\n        if (changedProperties.has(\"analysis\")) {\n            this.selected = this.analysis?.selected ?? false;\n            this.bindAnalysis();\n        }\n    }\n\n    connectedCallback(): void {\n        super.connectedCallback();\n        // Refresh selection because it may have changed while disconnected, even without a new analysis reference.\n        this.selected = this.analysis?.selected ?? false;\n        this.bindAnalysis();\n        this.renderRoot.addEventListener(\"mouseover\", this.handleMouseOver);\n        this.renderRoot.addEventListener(\"mouseout\", this.handleMouseOut);\n        this.renderRoot.addEventListener(\"focusin\", this.handleFocusIn);\n        this.renderRoot.addEventListener(\"focusout\", this.handleFocusOut);\n    }\n\n    disconnectedCallback(): void {\n        this.unbindAnalysis();\n        if (this.hovered || this.focused) {\n            this.registryController.setHighlight(undefined);\n        }\n        this.hovered = false;\n        this.focused = false;\n        this.renderRoot.removeEventListener(\"mouseover\", this.handleMouseOver);\n        this.renderRoot.removeEventListener(\"mouseout\", this.handleMouseOut);\n        this.renderRoot.removeEventListener(\"focusin\", this.handleFocusIn);\n        this.renderRoot.removeEventListener(\"focusout\", this.handleFocusOut);\n        super.disconnectedCallback();\n    }\n\n    /** Replaces subscriptions to the previous analysis and refreshes the row when a new binding is established. */\n    private bindAnalysis(): void {\n        if (this.boundAnalysis === this.analysis || !this.isConnected) {\n            return;\n        }\n        this.unbindAnalysis();\n        this.boundAnalysis = this.analysis;\n        const analysis = this.boundAnalysis;\n        if (analysis) {\n            analysis.onSelected.set(this.UUID, this.refresh);\n            analysis.onDeselected.set(this.UUID, this.refresh);\n            analysis.onValues.set(this.UUID, this.refresh);\n            analysis.onSerializableChange.set(this.UUID, this.refresh);\n            analysis.onMoveOrResize.set(this.UUID, this.refresh);\n            analysis.onSetInitialColor.set(this.UUID, this.refresh);\n            analysis.onSetName.set(this.UUID, this.refresh);\n            analysis.graph.onGraphActivation.set(this.UUID, this.refresh);\n        }\n        this.refresh();\n    }\n\n    /** Removes all subscriptions from the actual bound analysis, not necessarily the current property value. */\n    private unbindAnalysis(): void {\n        const analysis = this.boundAnalysis;\n        if (analysis) {\n            analysis.onSelected.delete(this.UUID);\n            analysis.onDeselected.delete(this.UUID);\n            analysis.onValues.delete(this.UUID);\n            analysis.onSerializableChange.delete(this.UUID);\n            analysis.onMoveOrResize.delete(this.UUID);\n            analysis.onSetInitialColor.delete(this.UUID);\n            analysis.onSetName.delete(this.UUID);\n            analysis.graph.onGraphActivation.delete(this.UUID);\n        }\n        this.boundAnalysis = undefined;\n    }\n\n    private isWithinRow(target: EventTarget | null): boolean {\n        return target instanceof Node && this.renderRoot.contains(target);\n    }\n\n    private get range(): { from: number, to: number } | undefined {\n        const min = this.analysis?.min;\n        const max = this.analysis?.max;\n        if (min !== undefined && max !== undefined\n            && Number.isFinite(min) && Number.isFinite(max) && min <= max) {\n            return { from: min, to: max };\n        }\n        return undefined;\n    }\n\n    private highlightAnalysis(): void {\n        this.registryController.setHighlight(this.range);\n    }\n\n    private readonly handleMouseOver: EventListener = event => {\n        if (event instanceof MouseEvent && !this.isWithinRow(event.relatedTarget)) {\n            this.hovered = true;\n            this.highlightAnalysis();\n        }\n    };\n\n    private readonly handleMouseOut: EventListener = event => {\n        if (event instanceof MouseEvent && !this.isWithinRow(event.relatedTarget)) {\n            this.hovered = false;\n            if (!this.focused) {\n                this.registryController.setHighlight(undefined);\n            }\n        }\n    };\n\n    private readonly handleFocusIn: EventListener = event => {\n        if (event instanceof FocusEvent && !this.isWithinRow(event.relatedTarget)) {\n            this.focused = true;\n            this.highlightAnalysis();\n        }\n    };\n\n    private readonly handleFocusOut: EventListener = event => {\n        if (event instanceof FocusEvent && !this.isWithinRow(event.relatedTarget)) {\n            this.focused = false;\n            if (!this.hovered) {\n                this.registryController.setHighlight(undefined);\n            }\n        }\n    };\n\n    public static styles = css`\n        :host {\n            display: table-row;\n            white-space: nowrap;\n        }\n\n        td {\n            padding: .25em .5em;\n            color: var(--thermal-foreground);\n            font-size: var(--thermal-fs-sm);\n        }\n\n        td.compact {\n            padding: .25em;\n        }\n\n        .identity, .name, .actions {\n            display: inline-flex;\n            align-items: center;\n            gap: .5em;\n        }\n\n        .identity {\n            width: max-content;\n            min-width: 100%;\n            justify-content: space-between;\n        }\n\n        .name, .actions {\n            flex-shrink: 0;\n        }\n\n        .name {\n            min-width: 0;\n            color: inherit;\n            font: inherit;\n        }\n\n        button.name {\n            padding: 0;\n            border: 0;\n            background: transparent;\n            cursor: pointer;\n        }\n\n        button.name:hover {\n            color: var(--thermal-primary);\n        }\n\n        .color {\n            display: inline-block;\n            width: 1em;\n            height: 1em;\n            flex-shrink: 0;\n        }\n\n        .selection-indicator {\n            width: 10px;\n            height: 10px;\n            border-radius: 50%;\n            border: var(--thermal-border-width) var(--thermal-border-style) var(--thermal-slate);\n        }\n\n        :host([selected]) .selection-indicator {\n            background: var(--thermal-slate-dark);\n        }\n    `;\n\n    private renderActions(): unknown {\n        const analysis = this.analysis;\n        if (!analysis) {\n            return nothing;\n        }\n\n        const size = this.tableMode === \"compact\" ? \"sm\" : \"md\";\n\n        return html`<span class=\"actions\">\n            ${this.allowsEdit ? html`\n                <file-analysis-edit .analysis=${analysis}>\n                    <thermal-btn\n                        slot=\"invoker\"\n                        size=${size}\n                        icon=\"settings\"\n                        iconStyle=\"solid\"\n                        tooltip=${t(T.editsth, { what: analysis.name })}\n                    ></thermal-btn>\n                </file-analysis-edit>\n                <thermal-btn\n                    size=${size}\n                    icon=\"trash\"\n                    iconStyle=\"micro\"\n                    tooltip=\"${t(T.delete)} ${analysis.name}\"\n                    @click=${() => analysis.file.analysis.layers.removeAnalysis(analysis.key)}\n                ></thermal-btn>\n            ` : nothing}\n            ${this.showRangePropagator && !(analysis instanceof PointAnalysis) ? html`\n                <thermal-btn\n                    size=${size}\n                    icon=\"range\"\n                    iconStyle=\"outline\"\n                    tooltip=\"${t(T.range)}: ${analysis.name}\"\n                    ?disabled=${this.range === undefined}\n                    @click=${() => {\n                        const range = this.range;\n                        if (range) {\n                            analysis.file.group.registry.range.imposeRange(range);\n                        }\n                    }}\n                ></thermal-btn>\n            ` : nothing}\n        </span>`;\n    }\n\n    private renderName(): unknown {\n        const analysis = this.analysis;\n        if (!analysis) {\n            return nothing;\n        }\n        const label = html`\n            <span class=\"color\" aria-hidden=\"true\" style=\"background-color: ${analysis.initialColor}\"></span>\n            <span>${analysis.name}</span>\n        `;\n        return !this.selectionDisabled ? html`\n            <button\n                type=\"button\"\n                class=\"name\"\n                aria-pressed=${analysis.selected}\n                @click=${() => {\n                    if (analysis.selected) {\n                        analysis.setDeselected(true);\n                    } else {\n                        analysis.setSelected(false, true);\n                    }\n                }}\n            >\n                <span class=\"selection-indicator\" aria-hidden=\"true\"></span>\n                ${label}\n            </button>\n        ` : html`<span class=\"name\">${label}</span>`;\n    }\n\n    private renderValue(statistic: \"avg\" | \"min\" | \"max\"): unknown {\n        const analysis = this.analysis;\n        if (!analysis) {\n            return nothing;\n        }\n        const value = analysis[statistic];\n\n        const unit = this.registryController.registryObject.manager.unit;\n        \n        const text = value === undefined \n            ? \"-\" \n            : unit.formatSingle(\n                unit.celsiusToCurrent(value)\n            )\n        const active = analysis.graph.state[statistic === \"avg\" ? \"AVG\" : statistic === \"min\" ? \"MIN\" : \"MAX\"];\n        const canActivate = !this.graphActivationDisabled && analysis.file.timeline.isSequence\n            && (statistic === \"avg\" || analysis instanceof AbstractAreaAnalysis);\n        const background = active ? analysis.initialColor : \"transparent\";\n        const foreground = active ? getContrastColor(analysis.initialColor) : \"var(--thermal-foreground)\";\n\n        return html`<td class=${this.tableMode === \"compact\" ? \"compact\" : \"\"}>\n            ${canActivate ? html`\n                <thermal-btn\n                    size=${this.tableMode === \"compact\" ? \"sm\" : \"md\"}\n                    aria-pressed=${active}\n                    tooltip=\"${t(T.graph)}: ${t(T[statistic])}\"\n                    style=\"background-color: ${background}; color: ${foreground}; --bg: ${background}; --bg-hover: ${background}; --color: ${foreground}; --color-hover: ${foreground};\"\n                    @click=${() => {\n                        if (statistic === \"avg\") {\n                            analysis.graph.setAvgActivation(!active);\n                        } else if (statistic === \"min\") {\n                            analysis.graph.setMinActivation(!active);\n                        } else {\n                            analysis.graph.setMaxActivation(!active);\n                        }\n                    }}\n                >${text}</thermal-btn>\n            ` : text}\n        </td>`;\n    }\n\n    protected render(): unknown {\n        const analysis = this.analysis;\n        if (!analysis) {\n            return nothing;\n        }\n        const compact = this.tableMode === \"compact\";\n        const hasActions = this.allowsEdit || this.showRangePropagator;\n        const dimension = analysis instanceof AbstractAreaAnalysis\n            ? `${analysis.width}x${analysis.height}`\n            : \"1x1\";\n\n        return html`\n            <td class=${compact ? \"compact\" : \"\"}>\n                <span class=\"identity\">\n                    ${this.renderName()}\n                    ${compact && hasActions ? this.renderActions() : nothing}\n                </span>\n            </td>\n            ${this.renderValue(\"avg\")}\n            ${this.renderValue(\"min\")}\n            ${this.renderValue(\"max\")}\n            ${compact ? nothing : html`<td>${dimension}</td>`}\n            ${!compact && hasActions ? html`<td>${this.renderActions()}</td>` : nothing}\n        `;\n    }\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"file-analysis-table-row\": FileAnalysisRowElement;\n    }\n}\n","import type { AbstractAnalysis, ThermalFileInstance } from \"@labirthermal/core\";\nimport { consume } from \"@lit/context\";\nimport { t } from \"i18next\";\nimport type { PropertyValues } from \"lit\";\nimport { css, html, nothing } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { repeat } from \"lit/directives/repeat.js\";\nimport { fileAnalysisListContext } from \"../../../controllers/FileController\";\nimport { managerInteractiveAnalysesContext } from \"../../../controllers/ManagerController\";\nimport { AbstractFileConsumer } from \"../../../hierarchy/consumers/AbstractFileConsumer\";\nimport { T } from \"../../../translations/Languages\";\nimport type { AnalysisTableMode } from \"./AnalysisTableOptions\";\n\n/**\n * Table of the analyses of the enclosing file provider.\n *\n * The table is interactive when the manager context enables interactive\n * analyses or when the `force-interactive` attribute is present. Selection\n * and editing follow the interactivity unless opted out. The range\n * propagator and the opt-outs are independent boolean attributes that\n * default to `false`.\n */\nexport class FileAnalysisTableElement extends AbstractFileConsumer {\n\n    @property({ attribute: \"table-mode\" })\n    public tableMode: AnalysisTableMode = \"full\";\n\n    /** Shows the button applying the analysis MIN/MAX to the registry range, independently of interactivity. */\n    @property({ type: Boolean, attribute: \"show-range-propagator\" })\n    public showRangePropagator: boolean = false;\n\n    /** Disables selection of individual rows and select/deselect all, even when the table is interactive. */\n    @property({ type: Boolean, attribute: \"selection-disabled\" })\n    public selectionDisabled: boolean = false;\n\n    /** Hides editing and deletion actions, even when the table is interactive. */\n    @property({ type: Boolean, attribute: \"edit-disabled\" })\n    public editDisabled: boolean = false;\n\n    /** Disables toggling the graph lines from the value cells. */\n    @property({ type: Boolean, attribute: \"graph-activation-disabled\" })\n    public graphActivationDisabled: boolean = false;\n\n    /** Makes the table interactive regardless of the manager context. */\n    @property({ type: Boolean, attribute: \"force-interactive\" })\n    public forceInteractive: boolean = false;\n\n    /** Interactivity provided by the manager context only. */\n    @consume({ context: managerInteractiveAnalysesContext, subscribe: true })\n    @state()\n    protected interactiveFromContext: boolean = false;\n\n    @consume({ context: fileAnalysisListContext, subscribe: true })\n    @state()\n    protected analysis: AbstractAnalysis[] = [];\n\n    private boundFile?: ThermalFileInstance;\n\n    private readonly selectionChanged = () => this.requestUpdate();\n\n    protected get isInteractive(): boolean {\n        return this.interactiveFromContext || this.forceInteractive;\n    }\n\n    protected get allowsSelection(): boolean {\n        return this.isInteractive && !this.selectionDisabled;\n    }\n\n    protected get allowsEdit(): boolean {\n        return this.isInteractive && !this.editDisabled;\n    }\n\n    private get allSelected(): boolean {\n        return this.analysis.length > 0 && this.analysis.every(analysis => analysis.selected);\n    }\n\n    public onInstanceCreated(): void {\n        this.requestUpdate();\n    }\n\n    public onFailure(): void {\n        // Do nothing\n    }\n\n    connectedCallback(): void {\n        super.connectedCallback();\n        this.bindFile();\n    }\n\n    \n    disconnectedCallback(): void {\n        this.unbindFile();        \n        super.disconnectedCallback();\n    }\n\n    \n    updated(changedProperties: PropertyValues): void {\n        super.updated(changedProperties);\n        \n        /** Rebinds the selection listener when the provided file instance changes. */\n        if (changedProperties.has(\"file\")) {\n            this.bindFile();\n        }\n\n    }\n\n    /**\n     * Subscribes to selection changes on the current file.\n     * Avoids duplicate subscriptions and replaces any listener attached to a previous file.\n     */\n    private bindFile(): void {\n        if (this.boundFile === this.file || !this.isConnected) {\n            return;\n        }\n        this.unbindFile();\n        this.boundFile = this.file;\n        this.boundFile?.analysis.layers.onSelectionChange.set(this.UUID, this.selectionChanged);\n    }\n\n    /** Removes this component's selection listener from the file it is currently bound to. */\n    private unbindFile(): void {\n        this.boundFile?.analysis.layers.onSelectionChange.delete(this.UUID);\n        this.boundFile = undefined;\n    }\n\n    public static styles = css`\n        :host {\n            display: block;\n            width: 100%;\n            min-width: 0;\n            max-width: 100%;\n            contain: inline-size;\n            box-sizing: border-box;\n            color: var(--thermal-foreground);\n        }\n\n        .overflow {\n            width: 100%;\n            max-width: 100%;\n            min-width: 0;\n            box-sizing: border-box;\n            overflow-x: auto;\n            overflow-y: hidden;\n        }\n\n        table {\n            width: max-content;\n            min-width: 100%;\n            margin: 0;\n            table-layout: auto;\n            box-sizing: border-box;\n            border-collapse: collapse;\n            border: var(--thermal-border-width) var(--thermal-border-style) var(--thermal-slate);\n            font-size: var(--thermal-fs-sm);\n        }\n\n        th {\n            text-align: left;\n            white-space: nowrap;\n            padding: .5em;\n        }\n\n        table.compact th {\n            padding: .25em;\n        }\n\n        file-analysis-table-row:not(:last-child) {\n            border-bottom: var(--thermal-border-width) dotted var(--thermal-slate);\n        }\n\n        file-analysis-table-row[selected] {\n            background-color: var(--thermal-background);\n        }\n\n        .selection {\n            display: inline-flex;\n            align-items: center;\n            gap: .5em;\n            padding: 0;\n            border: 0;\n            background: transparent;\n            color: inherit;\n            font: inherit;\n            cursor: pointer;\n        }\n\n        .selection:hover {\n            color: var(--thermal-primary);\n        }\n\n        .selection-indicator {\n            width: 10px;\n            height: 10px;\n            border-radius: 50%;\n            border: var(--thermal-border-width) var(--thermal-border-style) var(--thermal-slate);\n        }\n\n        .selection[aria-pressed=\"true\"] .selection-indicator {\n            background: var(--thermal-slate-dark);\n        }\n    `;\n\n    protected render(): unknown {\n        if (this.file === undefined || this.analysis.length === 0) {\n            return nothing;\n        }\n\n        const compact = this.tableMode === \"compact\";\n\n        return html`\n            <div class=\"overflow\" tabindex=\"0\" role=\"region\" aria-label=${t(T.analysis)}>\n                <table class=${compact ? \"compact\" : \"full\"} aria-label=${t(T.analysis)}>\n                    <thead>\n                        <tr>\n                            <th scope=\"col\">\n                                ${this.allowsSelection ? html`\n                                    <button\n                                        type=\"button\"\n                                        class=\"selection\"\n                                        aria-pressed=${this.allSelected}\n                                        @click=${() => {\n                                            if (this.allSelected) {\n                                                this.file?.analysis.layers.deselectAll();\n                                            } else {\n                                                this.file?.analysis.layers.selectAll();\n                                            }\n                                        }}\n                                    >\n                                        <span class=\"selection-indicator\" aria-hidden=\"true\"></span>\n                                        ${t(T.analysis)}\n                                    </button>\n                                ` : t(T.analysis)}\n                            </th>\n                            <th scope=\"col\">${t(T.avg)}</th>\n                            <th scope=\"col\">${t(T.min)}</th>\n                            <th scope=\"col\">${t(T.max)}</th>\n                            ${compact ? nothing : html`<th scope=\"col\">${t(T.size)}</th>`}\n                            ${!compact && (this.allowsEdit || this.showRangePropagator)\n                                ? html`<th scope=\"col\"></th>`\n                                : nothing}\n                        </tr>\n                    </thead>\n                    <tbody>\n                        ${repeat(this.analysis, analysis => analysis.key, analysis => html`\n                            <file-analysis-table-row\n                                .analysis=${analysis}\n                                .tableMode=${this.tableMode}\n                                .selectionDisabled=${!this.allowsSelection}\n                                .editDisabled=${!this.allowsEdit}\n                                .graphActivationDisabled=${this.graphActivationDisabled}\n                                .showRangePropagator=${this.showRangePropagator}\n                            ></file-analysis-table-row>\n                        `)}\n                    </tbody>\n                </table>\n            </div>\n        `;\n    }\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"file-analysis-table\": FileAnalysisTableElement;\n    }\n}\n","import type { AbstractAnalysis } from \"@labirthermal/core\";\nimport { availableAnalysisColors } from \"@labirthermal/core\";\nimport type { CSSResultGroup, PropertyValues } from \"lit\";\nimport { css, html, nothing } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { map } from 'lit/directives/map.js';\nimport { AbstractThermalElement } from \"../../../../hierarchy/AbstractThermalElement\";\n\n/** \n * Render the dropdown for color selection of an analysis. Property `analysis` needs to be passed down from the parent component \n * @package \\@labirthermal/webcomponents\n * @author Jan Jáchim\n */  \nexport class AnalysisColorDropdown extends AbstractThermalElement {\n\n    @property({type: Object})\n    public analysis!: AbstractAnalysis;\n\n    @state()\n    protected color?: string;\n\n    willUpdate(_changedProperties: PropertyValues): void {\n        super.willUpdate(_changedProperties);\n\n        // Side effect of analysis changing - derive the displayed color before rendering.\n        if ( _changedProperties.has( \"analysis\" ) ) {\n\n            this.color = this.analysis.initialColor;\n\n        }\n\n\n\n    }\n\n\n    updated(_changedProperties: PropertyValues): void {\n        super.updated(_changedProperties);\n\n        // Rebind the color-change listener after rendering when the input analysis changes.\n        if ( _changedProperties.has( \"analysis\" ) ) {\n\n            const oldAnalysis = _changedProperties.get( \"analysis\" ) as AbstractAnalysis;\n\n            if ( oldAnalysis ) {\n                oldAnalysis.onSetInitialColor.delete( this.UUID );\n            }\n\n            this.analysis.onSetInitialColor.set( this.UUID, value => {\n                this.color = value;\n            } );\n\n        }\n    }\n\n\n    static styles?: CSSResultGroup | undefined = css`\n\n        thermal-dropdown div {\n            display: flex;\n            gap: 0.5em;\n            border-radius: var( --thermal-radius );\n            cursor: pointer;\n            align-items: center;\n        }\n\n        thermal-dropdown .option {\n            margin-bottom: 0px;\n            padding: 5px;\n        }\n\n        thermal-dropdown div i {\n            width: 1em;\n            height: 1em;\n            border-radius: 50%;\n        }\n\n        thermal-dropdown .option:hover {\n            background-color: var( --thermal-slate );\n        }\n    \n    `;\n\n    protected renderColor( value: string ) {\n        return html`<i style=\"background-color: ${value};\" aria-hidden=\"true\" aria-disabled=\"true\"></i><span>${value}</span>`;\n    }\n\n    protected render(): unknown {\n\n        if ( this.color === undefined ) {\n            return nothing;\n        }\n        return html`\n\n            <thermal-dropdown>\n                <div slot=\"invoker\">\n                    ${this.renderColor( this.color )}\n                </div>\n\n                ${map(availableAnalysisColors, color => html`\n                    <div class=\"option\" slot=\"option\" @click=${() => {this.analysis.setInitialColor( color )}}>\n                        ${this.renderColor( color )}\n                    </div>\n                `)}\n                    \n            </thermal-dropdown>\n\n        `;\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"analysis-color\": AnalysisColorDropdown;\n    }\n}\n","import type { AbstractAnalysis } from \"@labirthermal/core\";\nimport type { CSSResultGroup, PropertyValues } from \"lit\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { css, html } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { AbstractThermalElement } from \"../../../../hierarchy/AbstractThermalElement\";\n\n/** \n * Render the input for editing the analysis name. Property `analysis` needs to be passed down from the parent component \n * @package \\@labirthermal/webcomponents\n * @author Jan Jáchim\n */ \nexport class AnalysisNameInput extends AbstractThermalElement {\n\n    @property({type: Object})\n    public analysis!: AbstractAnalysis;\n\n    @state()\n    protected name?: string;\n\n    willUpdate(changedProperties: PropertyValues): void {\n        super.willUpdate(changedProperties);\n\n        // Side effect of analysis changing - derive the displayed name before rendering.\n        if ( changedProperties.has( \"analysis\" ) ) {\n            this.name = this.analysis.name;\n        }\n\n    }\n\n    updated(changedProperties: PropertyValues): void {\n        super.updated(changedProperties);\n\n        // Rebind the name-change listener after rendering when the input analysis changes.\n        if ( changedProperties.has( \"analysis\" ) ) {\n            const oldAnalysis = changedProperties.get( \"analysis\" ) as AbstractAnalysis | undefined;\n            oldAnalysis?.onSetName.delete(this.UUID);\n\n            this.analysis.onSetName.set(this.UUID, (value) => {\n                this.name = value;\n            });\n        }\n\n    }\n\n\n    static styles?: CSSResultGroup | undefined = css`\n\n    \n    `;\n\n    protected render(): unknown {\n        return html`\n\n            <input \n                type=\"text\"\n                value=${ifDefined( this.name )}\n                @change=${(event: InputEvent) => {\n                    const target = event.target as HTMLInputElement;\n                    const value = target.value !== \"\" \n                        ? target.value \n                        : this.analysis.nameInitial;\n                    this.analysis.setName( value )\n                }}\n            />\n\n        `;\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"analysis-name\": AnalysisNameInput;\n    }\n}\n","import type { AbstractAnalysis, AbstractAreaAnalysis } from \"@labirthermal/core\";\nimport { t } from \"i18next\";\nimport type { PropertyValues } from \"lit\";\nimport { css, html } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { AbstractThermalElement } from \"../../../../hierarchy/AbstractThermalElement\";\nimport { T } from \"../../../../translations/Languages\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\n\n/** \n * The full table and form for editing an area analysis properties. Enables editing of name, color and dimensions (top, left, width, height, right, bottom). Property `analysis` needs to be passed down from the parent component \n * @package \\@labirthermal/webcomponents\n * @author Jan Jáchim\n */ \nexport class AreaEditTable extends AbstractThermalElement {\n\n    @property({type: Object})\n    public analysis!: AbstractAreaAnalysis;\n\n    @state()\n    protected color?: string;\n\n    @state()\n    protected top?: number;\n\n    @state()\n    protected left?: number;\n\n    @state()\n    protected width?: number;\n\n    @state()\n    protected height?: number;\n\n    @state()\n    protected type?: string;\n\n    @state()\n    protected right?: number;\n\n    @state()\n    protected bottom?: number;\n\n    @state()\n    protected maxX?: number;\n\n    @state()\n    protected maxY?: number;\n\n\n\n    willUpdate(changedProperties: PropertyValues): void {\n        super.willUpdate(changedProperties);\n\n        // Side effect of analysis changing - derive the displayed geometry and file bounds before rendering.\n        if ( changedProperties.has( \"analysis\" ) ) {\n            const analysis = this.analysis;\n\n            this.top = analysis.top;\n            this.left = analysis.left;\n            this.width = analysis.width;\n            this.height = analysis.height;\n            this.right = analysis.left + analysis.width;\n            this.bottom = analysis.top + analysis.height;\n            this.maxX = analysis.file.width;\n            this.maxY = analysis.file.height;\n        }\n\n    }\n\n    updated(changedProperties: PropertyValues): void {\n        super.updated(changedProperties);\n\n        // Rebind the geometry-change listener after rendering whenever the input analysis changes.\n        if ( changedProperties.has( \"analysis\" ) ) {\n            const oldAnalysis = changedProperties.get( \"analysis\" ) as AbstractAnalysis | undefined;\n            if ( oldAnalysis ) {\n                oldAnalysis.onSerializableChange.delete( this.UUID );\n            }\n\n\n            this.analysis.onSerializableChange.set(this.UUID, (analysis) => {\n                this.top = analysis.top;\n                this.left = analysis.left;\n                this.width = analysis.width;\n                this.height = analysis.height;\n                this.right = analysis.left + analysis.width;\n                this.bottom = analysis.top + analysis.height;\n            });            \n        }\n    }\n\n    protected handleInput( event: InputEvent, callback: (value: number) => void ) { \n\n        const target = event.target as HTMLInputElement;\n\n        const value = parseInt( target.value );\n\n        if ( ! isNaN( value ) ) {\n            callback( value );\n            this.analysis.onMoveOrResize.call( this.analysis );\n        }\n\n\n    }\n\n\n    public static styles = css`\n    \n        .table {\n\n            display: table;\n            width: 100%;\n        \n        }\n    \n    `;\n\n    protected render() {\n        return html`\n\n            <div class=\"table\">\n\n                <thermal-field label=${t(T.name)}>\n                    <analysis-name .analysis=${this.analysis}></analysis-name>\n                </thermal-field>\n\n                <thermal-field label=${t(T.color)}>\n                    <analysis-color .analysis=${this.analysis}></analysis-color>\n                </thermal-field>\n\n                <thermal-field label=${t(T.left)}>\n                    <input \n                        name=\"left\" \n                        value=${ifDefined( this.left )} \n                        type=\"number\" \n                        step=\"1\" \n                        min=\"0\" \n                        max=${ifDefined( this.right !== undefined ? this.right - 1 : this.maxX )}\n                        @change=${ (event: InputEvent) => this.handleInput( event, value => { this.analysis.setLeft( value )} ) }\n                    />\n                </thermal-field>\n\n                <thermal-field label=${t(T.right)}>\n                    <input \n                        name=\"right\" \n                        value=${ifDefined( this.right )} \n                        type=\"number\" \n                        step=\"1\" \n                        min=${this.left !== undefined ? this.left + 1 : 0} \n                        max=${ ifDefined( this.maxX )}\n                        @change=${ (event: InputEvent) => this.handleInput( event, value => { this.analysis.setRight( value )} ) }\n                    />\n                </thermal-field>\n\n                <thermal-field label=${t(T.top)}>\n                    <input \n                        name=\"top\" \n                        value=${ifDefined( this.top )} \n                        type=\"number\" \n                        step=\"1\" \n                        min=\"0\"\n                        max=${ ifDefined( this.bottom !== undefined ? this.bottom - 1 : this.maxY )}\n                        @change=${ (event: InputEvent) => this.handleInput( event, value => { this.analysis.setTop( value )} ) }\n                    />\n                </thermal-field>\n\n                <thermal-field label=${t(T.bottom)}>\n                    <input \n                        name=\"bottom\" \n                        value=${ifDefined( this.bottom )} \n                        type=\"number\" \n                        step=\"1\" \n                        min=${this.top !== undefined ? this.top + 1 : 0 }\n                        max=${ifDefined( this.maxY )}\n                        @change=${ (event: InputEvent) => this.handleInput( event, value => { this.analysis.setBottom( value )} ) }\n                    />\n                </thermal-field>\n                \n\n            </div>\n    \n        \n        `;\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"edit-area\": AreaEditTable;\n    }\n}\n","import type { AbstractAnalysis, PointAnalysis } from \"@labirthermal/core\";\nimport { t } from \"i18next\";\nimport type { PropertyValues } from \"lit\";\nimport { css, html } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport type { Ref } from \"lit/directives/ref.js\";\nimport { createRef } from \"lit/directives/ref.js\";\nimport { AbstractThermalElement } from \"../../../../hierarchy/AbstractThermalElement\";\nimport { T } from \"../../../../translations/Languages\";\n\n/** \n * The full table and form for editing a point analysis properties. Enables editing of name, color and coordinates (top, left). Property `analysis` needs to be passed down from the parent component \n * @package \\@labirthermal/webcomponents\n * @author Jan Jáchim\n */ \nexport class EditpointTable extends AbstractThermalElement {\n\n    @property({type: Object})\n    public analysis!: PointAnalysis;\n\n    @state()\n    protected top?: number;\n\n    @state()\n    protected left?: number;\n\n    @state()\n    protected maxX!: number;\n\n    @state()\n    protected maxY!: number;\n\n    topInputRef: Ref<HTMLInputElement> = createRef();\n    leftInputRef: Ref<HTMLInputElement> = createRef();\n\n\n\n\n    willUpdate(changedProperties: PropertyValues): void {\n        super.willUpdate(changedProperties);\n\n        // Side effect of analysis changing - derive the displayed coordinates and file bounds before rendering.\n        if ( changedProperties.has( \"analysis\" ) ) {\n            const analysis = this.analysis;\n\n            this.top = analysis.top;\n            this.left = analysis.left;\n            this.maxX = analysis.file.width;\n            this.maxY = analysis.file.height;\n        }\n\n    }\n\n    updated(changedProperties: PropertyValues): void {\n        super.updated(changedProperties);\n\n        // Rebind the serialization listener after rendering whenever the input analysis changes.\n        if ( changedProperties.has( \"analysis\" ) ) {\n            const oldAnalysis = changedProperties.get( \"analysis\" ) as AbstractAnalysis | undefined;\n            if ( oldAnalysis ) {\n                oldAnalysis.onSerializableChange.delete( this.UUID );\n            }\n\n\n            this.analysis.onSerializableChange.set(this.UUID, (analysis) => {\n                this.top = analysis.top;\n                this.left = analysis.left;\n            });\n        }\n    }\n\n\n    public handleInput( event: InputEvent, callback: (value: number) => void ) {\n\n        const target = event.target as HTMLInputElement;\n\n        const value = parseInt( target.value );\n\n        if ( ! isNaN( value ) ) {\n            callback( value );\n            this.analysis.onMoveOrResize.call( this.analysis );\n        }\n\n    }\n\n    public static styles = css`\n    \n        .table {\n\n            display: table;\n            width: 100%;\n        \n        }\n    \n    `;\n\n    protected render() {\n        return html`\n\n            <div class=\"table\">\n\n                <thermal-field label=${t(T.name)}>\n                    <analysis-name .analysis=${this.analysis}></analysis-name>\n                </thermal-field>\n\n                <thermal-field label=${t(T.color)}>\n                    <analysis-color .analysis=${this.analysis}></analysis-color>\n                </thermal-field>\n\n                <thermal-field label=${t(T.top)} hint=${t(T.fromto, {from: 0, to: this.maxX})}>\n                    <input \n                        name=\"top\" \n                        value=${ifDefined( this.top )} \n                        type=\"number\" \n                        step=\"1\" \n                        min=\"0\" \n                        max=${this.maxY}\n                        @change=${ (event: InputEvent) => this.handleInput( event, value => { this.analysis.setTop( value )} ) }\n                    />\n                </thermal-field>\n\n                <thermal-field label=${t(T.left)} hint=${t(T.fromto, {from: 0, to: this.maxX})}>\n                    <input\n                        name=\"left\" \n                        value=${ifDefined( this.left )} \n                        type=\"number\" \n                        step=\"1\" \n                        min=\"0\" \n                        max=${this.maxX}\n                        @change=${ ( event: InputEvent ) => this.handleInput( event, value => {\n                            this.analysis.setLeft( value );\n                        } ) }\n                    />\n                </thermal-field>\n\n            </div>\n        \n        `;\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"edit-point\": EditpointTable;\n    }\n}\n","/**\n * @license\n * Copyright 2014-2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Promise that resolves when the gviz loader script is loaded, which\n * provides access to the Google Charts loading API.\n */\nconst loaderPromise: Promise<void> = new Promise((resolve, reject) => {\n  // Resolve immediately if the loader script has been added already and\n  // `google.charts.load` is available. Adding the loader script twice throws\n  // an error.\n  if (typeof google !== 'undefined' && google.charts &&\n      typeof google.charts.load === 'function') {\n    resolve();\n  } else {\n    // Try to find existing loader script.\n    let loaderScript: HTMLScriptElement|null = document.querySelector(\n        'script[src=\"https://www.gstatic.com/charts/loader.js\"]');\n    if (!loaderScript) {\n      // If the loader is not present, add it.\n      loaderScript = document.createElement('script');\n      // sv.safeScriptWithArgs(loaderScript);\n      // safeScriptEl.setSrc(loaderScript, trustedResourceUrl`https://www.gstatic.com/charts/loader.js`);\n\n      loaderScript.src = \"https://www.gstatic.com/charts/loader.js\";\n      document.head.appendChild(loaderScript);\n    }\n    loaderScript.addEventListener('load', resolve as () => void);\n    loaderScript.addEventListener('error', reject);\n  }\n});\n\ninterface LoadSettings {\n  version?: string;\n  packages?: string[];\n  language?: string;\n  mapsApiKey?: string;\n}\n\n/**\n * Loads Google Charts API with the selected settings or using defaults.\n *\n * The following settings are available:\n * - version: which version of library to load, default: 'current',\n * - packages: which chart packages to load, default: ['corechart'],\n * - language: what language to load library in, default: `lang` attribute on\n *   `<html>` or 'en' if not specified,\n * - mapsApiKey: key to use for maps API.\n */\nexport async function load(settings: LoadSettings = {}): Promise<void> {\n  await loaderPromise;\n  const {\n    version = 'current',\n    packages = ['corechart'],\n    language = document.documentElement.lang || 'en',\n    mapsApiKey,\n  } = settings;\n  return google.charts.load(version, {\n    'packages': packages,\n    'language': language,\n    'mapsApiKey': mapsApiKey,\n  });\n}\n\n/** Types that can be converted to `DataTable`. */\nexport type DataTableLike = unknown[][]|{cols: unknown[], rows?: unknown[][]}|\n                            google.visualization.DataTable;\n\n/**\n * Creates a DataTable object for use with a chart.\n *\n * Multiple different argument types are supported. This is because the\n * result of loading the JSON data URL is fed into this function for\n * DataTable construction and its format is unknown.\n *\n * The data argument can be one of a few options:\n *\n * - null/undefined: An empty DataTable is created. Columns must be added\n * - !DataTable: The object is simply returned\n * - {{cols: !Array, rows: !Array}}: A DataTable in object format\n * - {{cols: !Array}}: A DataTable in object format without rows\n * - !Array<!Array>: A DataTable in 2D array format\n *\n * Un-supported types:\n *\n * - Empty !Array<!Array>: (e.g. `[]`) While technically a valid data\n *   format, this is rejected as charts will not render empty DataTables.\n *   DataTables must at least have columns specified. An empty array is most\n *   likely due to a bug or bad data. If one wants an empty DataTable, pass\n *   no arguments.\n * - Anything else\n *\n * See <a\n * href=\"https://developers.google.com/chart/interactive/docs/reference#datatable-class\">the\n * docs</a> for more details.\n *\n * @param data The data which we should use to construct new DataTable object\n */\nexport async function dataTable(data: DataTableLike|undefined):\n    Promise<google.visualization.DataTable> {\n  // Ensure that `google.visualization` namespace is added to the document.\n  await load();\n  if (data == null) {\n    return new google.visualization.DataTable();\n  } else if ((data as google.visualization.DataTable).getNumberOfRows!) {\n    // Data is already a DataTable\n    return data as google.visualization.DataTable;\n  } else if ((data as {\n               cols: unknown[]\n             }).cols) {  // data.rows may also be specified\n    // Data is in the form of object DataTable structure\n    return new google.visualization.DataTable(data);\n  } else if ((data as unknown[][]).length > 0) {\n    // Data is in the form of a two dimensional array.\n    return google.visualization.arrayToDataTable(data as unknown[][]);\n  } else if ((data as unknown[][]).length === 0) {\n    // Chart data was empty.\n    // We throw instead of creating an empty DataTable because most\n    // (if not all) charts will render a sticky error in this situation.\n    throw new Error('Data was empty.');\n  }\n  throw new Error('Data format was not recognized.');\n}\n\n/**\n * Creates new `ChartWrapper`.\n * @param container Element in which the chart will be drawn\n */\nexport async function createChartWrapper(container: HTMLElement):\n    Promise<google.visualization.ChartWrapper> {\n  // Ensure that `google.visualization` namespace is added to the document.\n  await load();\n  // Typings suggest that `chartType` is required in `ChartSpecs`, but it works\n  // without it.\n  return new google.visualization.ChartWrapper(\n      {'container': container} as unknown as google.visualization.ChartSpecs);\n}","/**\n * @license\n * Copyright 2014-2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { css, html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { CallbacksManager } from '@labirthermal/core';\nimport type { Ref } from 'lit/directives/ref.js';\nimport { createRef, ref } from 'lit/directives/ref.js';\nimport type { DataTableLike } from './loader.js';\nimport { createChartWrapper, dataTable } from './loader.js';\n\nconst DEFAULT_EVENTS = ['ready', 'select'];\n\n/**\n * Constructor names for supported chart types.\n *\n * `ChartWrapper` expects a constructor name and assumes `google.visualization`\n *  as the default namespace.\n */\nconst CHART_TYPES: Record<string, string|undefined> = {\n  'area': 'AreaChart',\n  'bar': 'BarChart',\n  'md-bar': 'google.charts.Bar',\n  'bubble': 'BubbleChart',\n  'calendar': 'Calendar',\n  'candlestick': 'CandlestickChart',\n  'column': 'ColumnChart',\n  'combo': 'ComboChart',\n  'gantt': 'Gantt',\n  'gauge': 'Gauge',\n  'geo': 'GeoChart',\n  'histogram': 'Histogram',\n  'line': 'LineChart',\n  'md-line': 'google.charts.Line',\n  'org': 'OrgChart',\n  'pie': 'PieChart',\n  'sankey': 'Sankey',\n  'scatter': 'ScatterChart',\n  'md-scatter': 'google.charts.Scatter',\n  'stepped-area': 'SteppedAreaChart',\n  'table': 'Table',\n  'timeline': 'Timeline',\n  'treemap': 'TreeMap',\n  'wordtree': 'WordTree',\n};\n\n/**\n * `google-chart` encapsulates Google Charts as a web component, allowing you to\n * easily visualize data. From simple line charts to complex hierarchical tree\n * maps, the chart element provides a number of ready-to-use chart types.\n *\n * ```html\n * <google-chart\n *     type='pie'\n *     options='{\"title\": \"Distribution of days in 2001Q1\"}'\n *     cols='[{\"label\":\"Month\", \"type\":\"string\"}, {\"label\":\"Days\",\n *         \"type\":\"number\"}]' rows='[[\"Jan\", 31],[\"Feb\", 28],[\"Mar\", 31]]'>\n *   </google-chart>\n * ```\n *\n * Note: if you're passing JSON as attributes, single quotes are necessary to be\n * valid JSON. See\n * https://www.polymer-project.org/1.0/docs/devguide/properties#configuring-object-and-array-properties.\n *\n * Height and width are specified as style attributes:\n * ```css\n * google-chart {\n *   height: 300px;\n *   width: 50em;\n * }\n * ```\n *\n * Data can be provided in one of three ways:\n *\n * - Via the `cols` and `rows` attributes:\n *   ```\n *   cols='[{\"label\":\"Mth\", \"type\":\"string\"},{\"label\":\"Days\", \"type\":\"number\"}]'\n *   rows='[[\"Jan\", 31],[\"Feb\", 28],[\"Mar\", 31]]'\n *   ```\n *\n * - Via the `data` attribute, passing in the data directly:\n *   ```\n *   data='[[\"Month\", \"Days\"], [\"Jan\", 31], [\"Feb\", 28], [\"Mar\", 31]]'\n *   ```\n *\n * - Via the `data` attribute, passing in the URL to a resource containing the\n *   data, in JSON format:\n *   ```\n *   data='http://example.com/chart-data.json'\n *   ```\n *\n * - Via the `data` attribute, passing in a Google DataTable object:\n *   ```\n *   data='{{dataTable}}'\n *   ```\n *\n * - Via the `view` attribute, passing in a Google DataView object:\n *   ```\n *   view='{{dataView}}'\n *   ```\n *\n * You can display the charts in locales other than \"en\" by setting the `lang`\n * attribute on the `html` tag of your document:\n * ```\n * <html lang=\"ja\">\n * ```\n *\n * @demo demo/index.html\n */\nexport class ThermalChartElement extends LitElement {\n  /** @nocollapse */\n  static override styles = css`\n    :host {\n      display: -webkit-flex;\n      display: -ms-flex;\n      display: flex;\n      margin: 0;\n      padding: 0;\n      width: 400px;\n      height: 300px;\n    }\n\n    :host([hidden]) {\n      display: none;\n    }\n\n    :host([type=\"gauge\"]) {\n      width: 300px;\n      height: 300px;\n    }\n\n    #chartdiv {\n      width: 100%;\n    }\n\n    /* Workaround for slow initial ready event for tables. */\n    .google-visualization-table-loadtest {\n      padding-left: 6px;\n    }\n  `;\n\n  /**\n   * Fired after a chart type is rendered and ready for interaction.\n   *\n   * @event google-chart-ready\n   * @param {{chart: !Object}} detail The raw chart object.\n   */\n\n  /**\n   * Fired when the user makes a selection in the chart.\n   *\n   * @event google-chart-select\n   * @param {{chart: !Object}} detail The raw chart object.\n   */\n\n  /**\n   * Type of the chart.\n   *\n   * Should be one of:\n   * - `area`\n   * - `(md-)bar`\n   * - `bubble`\n   * - `calendar`\n   * - `candlestick`\n   * - `column`\n   * - `combo`\n   * - `gantt`\n   * - `gauge`\n   * - `geo`\n   * - `histogram`\n   * - `(md-)line`\n   * - `org`\n   * - `pie`\n   * - `sankey`\n   * - `(md-)scatter`\n   * - `stepped-area`\n   * - `table`\n   * - `timeline`\n   * - `treemap`\n   * - `wordtree`\n   *\n   * See <a\n   * href=\"https://google-developers.appspot.com/chart/interactive/docs/gallery\">Google\n   * Visualization API reference (Chart Gallery)</a> for details.\n   */\n  @property({type: String, reflect: true})\n  type = 'column';\n\n  /**\n   * Enumerates the chart events that should be fired.\n   *\n   * Charts support a variety of events. By default, this element only\n   * fires on `ready` and `select`. If you would like to be notified of\n   * other chart events, use this property to list them.\n   * Events `ready` and `select` are always fired.\n   *\n   * Changes to this property are _not_ observed. Events are attached only\n   * at chart construction time.\n   */\n  @property({type: Array})\n  events: string[] = [];\n\n  /**\n   * Sets the options for the chart.\n   *\n   * Example:\n   * ```\n   * {\n   *   title: \"Chart title goes here\",\n   *   hAxis: {title: \"Categories\"},\n   *   vAxis: {title: \"Values\", minValue: 0, maxValue: 2},\n   *   legend: \"none\"\n   * }\n   * ```\n   * See <a\n   * href=\"https://google-developers.appspot.com/chart/interactive/docs/gallery\">Google\n   * Visualization API reference (Chart Gallery)</a> for the options available\n   * to each chart type.\n   *\n   * Setting this property always redraws the chart. If you would like to make\n   * changes to a sub-property, be sure to reassign the property:\n   * ```\n   * const options = googleChart.options;\n   * options.vAxis.logScale = true;\n   * googleChart.options = options;\n   * ```\n   * (Note: Missing parent properties are not automatically created.)\n   */\n  @property({type: Object, hasChanged: () => true})\n  options: object|undefined = undefined;\n\n  /**\n   * Sets the data columns for this object.\n   *\n   * When specifying data with `cols` you must also specify `rows`, and\n   * not specify `data`.\n   *\n   * Example:\n   * <pre>[{label: \"Categories\", type: \"string\"},\n   *  {label: \"Value\", type: \"number\"}]</pre>\n   * See <a\n   * href=\"https://google-developers.appspot.com/chart/interactive/docs/reference#DataTable_addColumn\">Google\n   * Visualization API reference (addColumn)</a> for column definition format.\n   */\n  @property({type: Array})\n  cols: unknown[]|undefined = undefined;\n\n  /**\n   * Sets the data rows for this object.\n   *\n   * When specifying data with `rows` you must also specify `cols`, and\n   * not specify `data`.\n   *\n   * Example:\n   * <pre>[[\"Category 1\", 1.0],\n   *  [\"Category 2\", 1.1]]</pre>\n   * See <a\n   * href=\"https://google-developers.appspot.com/chart/interactive/docs/reference#addrow\">Google\n   * Visualization API reference (addRow)</a> for row format.\n   */\n  @property({type: Array})\n  rows: unknown[][]|undefined = undefined;\n\n  /**\n   * Sets the entire dataset for this object.\n   * Can be used to provide the data directly, or to provide a URL from\n   * which to request the data.\n   *\n   * The data format can be a two-dimensional array or the DataTable format\n   * expected by Google Charts.\n   * See <a\n   * href=\"https://google-developers.appspot.com/chart/interactive/docs/reference#DataTable\">Google\n   * Visualization API reference (DataTable constructor)</a> for data table\n   * format details.\n   *\n   * When specifying data with `data` you must not specify `cols` or `rows`.\n   *\n   * Example:\n   * ```\n   * [[\"Categories\", \"Value\"],\n   *  [\"Category 1\", 1.0],\n   *  [\"Category 2\", 1.1]]\n   * ```\n   */\n  // Note: type: String, because it is parsed manually in the observer.\n  @property({type: String})\n  data: DataTableLike|string|undefined = undefined;\n\n  /**\n   * Sets the entire dataset for this object to a Google DataView.\n   *\n   * See <a\n   * href=\"https://google-developers.appspot.com/chart/interactive/docs/reference#dataview-class\">Google\n   * Visualization API reference (DataView)</a> for details.\n   *\n   * When specifying data with `view` you must not specify `data`, `cols` or\n   * `rows`.\n   */\n  @property({type: Object})\n  view: google.visualization.DataView|undefined = undefined;\n\n  /**\n   * Selected datapoint(s) in the chart.\n   *\n   * An array of objects, each with a numeric row and/or column property.\n   * `row` and `column` are the zero-based row or column number of an item\n   * in the data table to select.\n   *\n   * To select a whole column, set row to null;\n   * to select a whole row, set column to null.\n   *\n   * Example:\n   * ```\n   * [{row:0,column:1}, {row:1, column:null}]\n   * ```\n   */\n  @property({type: Array})\n  selection: google.visualization.ChartSelection[]|undefined = undefined;\n\n  @property({attribute: false})\n  onGraphClick?: (relativeTimeMs: number) => void;\n\n  @property({attribute: false})\n  onGraphHover?: (percentage: number | undefined) => void;\n\n  /**\n   * Whether the chart is currently rendered.\n   * @export\n   */\n  drawn = false;\n\n  /**\n   * Internal data displayed on the chart.\n   */\n  // tslint:disable-next-line:enforce-name-casing\n  @property({type: Object}) _data: google.visualization.DataTable|\n      google.visualization.DataView|undefined = undefined;\n\n  /**\n   * Internal chart object.\n   */\n  chartWrapper: google.visualization.ChartWrapper|null = null;\n\n  private redrawTimeoutId: number|undefined = undefined;\n\n  /** Identifies the newest asynchronous conversion of the data property. */\n  private dataVersion = 0;\n\n  /** Prevents old data from being drawn with options for a newer data set. */\n  private dataPending = false;\n\n  protected chartRef: Ref<HTMLDivElement> = createRef();\n\n  protected override render() {\n    return html`\n      <div id=\"styles\"></div>\n      <div\n        ${ref(this.chartRef)}\n        id=\"chartdiv\"\n        @pointermove=${this.handleGraphPointerMove}\n        @pointerleave=${this.handleGraphPointerLeave}\n        @click=${this.handleGraphClickEvent}\n      ></div>\n    `;\n  }\n\n  private getGraphLayout(): {\n    getChartAreaBoundingBox: () => { left: number, top: number, width: number, height: number };\n    getBoundingBox?: (id: string) => { left: number, top: number, width: number, height: number };\n    getHAxisValue?: (position: number) => unknown;\n  } | undefined {\n    const chart = this.chartWrapper?.getChart() as (google.visualization.ChartBase & {\n      getChartLayoutInterface?: () => {\n        getChartAreaBoundingBox: () => { left: number, top: number, width: number, height: number };\n        getBoundingBox?: (id: string) => { left: number, top: number, width: number, height: number };\n        getHAxisValue?: (position: number) => unknown;\n      }\n    }) | undefined;\n\n    return chart?.getChartLayoutInterface?.();\n  }\n\n  private isGraphVisualizationPoint(\n    x: number,\n    y: number,\n    layout: NonNullable<ReturnType<ThermalChartElement[\"getGraphLayout\"]>>\n  ): boolean {\n    const chartArea = layout.getChartAreaBoundingBox();\n    const inChartArea =\n      chartArea.width > 0 &&\n      chartArea.height > 0 &&\n      x >= chartArea.left &&\n      x <= chartArea.left + chartArea.width &&\n      y >= chartArea.top &&\n      y <= chartArea.top + chartArea.height;\n\n    const axisLabels = layout.getBoundingBox?.(\"hAxis#0#labels\");\n    const axisBottom = Math.max(\n      chartArea.top + chartArea.height,\n      axisLabels ? axisLabels.top + axisLabels.height : 0\n    );\n    const inHorizontalAxis =\n      x >= chartArea.left &&\n      x <= chartArea.left + chartArea.width &&\n      y >= chartArea.top &&\n      y <= axisBottom;\n\n    return inChartArea || inHorizontalAxis;\n  }\n\n  private handleGraphPointerMove = (event: PointerEvent): void => {\n    const container = this.chartRef.value;\n    const layout = this.onGraphClick || this.onGraphHover\n      ? this.getGraphLayout()\n      : undefined;\n    const chartArea = layout?.getChartAreaBoundingBox();\n\n    if (!container || !layout || !chartArea) {\n      if (container) {\n        container.style.cursor = \"\";\n      }\n      this.onGraphHover?.(undefined);\n      return;\n    }\n\n    const bounds = container.getBoundingClientRect();\n    const x = event.clientX - bounds.left;\n    const y = event.clientY - bounds.top;\n    const inVisualization = this.isGraphVisualizationPoint(x, y, layout);\n\n    container.style.cursor = inVisualization && this.onGraphClick ? \"pointer\" : \"\";\n    this.onGraphHover?.(inVisualization\n      ? Math.max(0, Math.min(100, (x - chartArea.left) / chartArea.width * 100))\n      : undefined);\n  }\n\n  private handleGraphClickEvent = (event: MouseEvent): void => {\n    const container = this.chartRef.value;\n    const layout = this.getGraphLayout();\n\n    if (!container || !layout || !this.onGraphClick) {\n      return;\n    }\n\n    const bounds = container.getBoundingClientRect();\n    const x = event.clientX - bounds.left;\n    const y = event.clientY - bounds.top;\n    const chartArea = layout.getChartAreaBoundingBox();\n\n    if (\n      chartArea.width <= 0 ||\n      !this.isGraphVisualizationPoint(x, y, layout) ||\n      x < chartArea.left ||\n      x > chartArea.left + chartArea.width\n    ) {\n      return;\n    }\n\n    const relativeTimeMs = layout.getHAxisValue?.(x);\n    if (typeof relativeTimeMs === \"number\" && Number.isFinite(relativeTimeMs)) {\n      this.onGraphClick(relativeTimeMs);\n    }\n  }\n\n  private handleGraphPointerLeave = (): void => {\n    if (this.chartRef.value) {\n      this.chartRef.value.style.cursor = \"\";\n    }\n    this.onGraphHover?.(undefined);\n  }\n\n  public getRef() {\n    return this.chartRef.value;\n  }\n\n  public readonly onWrapper = new CallbacksManager<( wrapper: google.visualisation.ChartWrapper )=>void>();\n\n  @property({type: Number, reflect: true})\n  left: number = 0;\n\n  @property({type: Number, reflect: true})\n  top: number = 0;\n\n  @property({type: Number, reflect: true})\n  w: number = 0;\n  \n  @property({type: Number, reflect: true})\n  h: number = 0;\n\n  public visualisation?: google.visualisation;\n\n  protected override firstUpdated() {\n    createChartWrapper(this.shadowRoot!.getElementById('chartdiv')!)\n        .then(chartWrapper => {\n          this.chartWrapper = chartWrapper;\n          this.onWrapper.call( chartWrapper );\n          this.typeChanged();\n          google.visualization.events.addListener(chartWrapper, 'ready', () => {\n            this.drawn = true;\n            if (this.selection) {\n              this.selectionChanged();\n            }\n          });\n          google.visualization.events.addListener(\n              chartWrapper, 'select', () => {\n                const chart = chartWrapper.getChart();\n                const selection = chart?.getSelection() ?? [];\n                this.selection = selection;\n              });\n          this.propagateEvents(DEFAULT_EVENTS, chartWrapper);\n        });\n  }\n\n  protected override updated(changedProperties: Map<string, unknown>) {\n    if (changedProperties.has('type')) this.typeChanged();\n    if (changedProperties.has('rows') || changedProperties.has('cols')) {\n      this.rowsOrColumnsChanged();\n    }\n    if (changedProperties.has('data')) this.dataChanged();\n    if (changedProperties.has('view')) this.viewChanged();\n    if (changedProperties.has('_data') ||\n        changedProperties.has('options')) this.redraw();\n    if (changedProperties.has('selection')) this.selectionChanged();\n  }\n\n  /** Reacts to chart type change. */\n  private typeChanged() {\n    if (this.chartWrapper == null) return;\n    this.chartWrapper.setChartType(CHART_TYPES[this.type] || this.type);\n    const lastChart = this.chartWrapper.getChart();\n    google.visualization.events.addOneTimeListener(\n        this.chartWrapper, 'ready', () => {\n          // console.log( \"ready\", this.chartWrapper.visualization.ha.O );\n          // Ready event fires after `chartWrapper` is initialized.\n          const chart = this.chartWrapper!.getChart();\n          if (chart !== lastChart) {\n            this.propagateEvents(\n                this.events.filter(\n                    (eventName) => !DEFAULT_EVENTS.includes(eventName)),\n                chart);\n          }\n          const stylesDiv = this.shadowRoot!.getElementById('styles')!;\n          if (!stylesDiv.children.length) {\n            this.localizeGlobalStylesheets(stylesDiv);\n          }\n        });\n      \n    this.redraw();\n  }\n\n  /**\n   * Adds listeners to propagate events from the chart.\n   */\n  private propagateEvents(events: string[], eventTarget: unknown) {\n    for (const eventName of events) {\n      google.visualization.events.addListener(\n          eventTarget, eventName, (event: unknown) => {\n            this.dispatchEvent(new CustomEvent(`google-chart-${eventName}`, {\n              bubbles: true,\n              composed: true,\n              detail: {\n                // Events fire after `chartWrapper` is initialized.\n                chart: this.chartWrapper!.getChart(),\n                data: event,\n              }\n            }));\n          });\n    }\n  }\n\n  /** Sets the selectiton on the chart. */\n  private selectionChanged() {\n    if (this.chartWrapper == null) return;\n    const chart = this.chartWrapper.getChart();\n    if (chart == null) return;\n    if (chart.setSelection) {\n      // Workaround for timeline chart which emits select event on setSelection.\n      // See issue #256.\n      if (this.type === 'timeline') {\n        const oldSelection = JSON.stringify(chart.getSelection());\n        const newSelection = JSON.stringify(this.selection);\n        if (newSelection === oldSelection) return;\n      }\n      chart.setSelection(this.selection);\n    }\n  }\n\n  private cancelScheduledRedraw(): void {\n    if (this.redrawTimeoutId !== undefined) {\n      clearTimeout(this.redrawTimeoutId);\n      this.redrawTimeoutId = undefined;\n    }\n  }\n\n  /**\n   * Redraws the chart.\n   *\n   * Called automatically when data/type/selection attributes change.\n   * Call manually to handle view updates, page resizes, etc.\n   */\n  redraw() {\n    if (this.dataPending || this.chartWrapper == null || this._data == null) return;\n    // `ChartWrapper` can be initialized with `DataView` instead of `DataTable`.\n    this.chartWrapper.setDataTable(\n        this._data as google.visualization.DataTable);\n    this.chartWrapper.setOptions(this.options || {});\n\n    this.drawn = false;\n    this.cancelScheduledRedraw();\n    this.redrawTimeoutId = window.setTimeout(() => {\n      this.redrawTimeoutId = undefined;\n      // Drawing happens after `chartWrapper` is initialized.\n      this.chartWrapper!.draw();\n\n      // Update dimensions\n      const dimensions = this.chartWrapper.visualization.ha.O;\n\n      this.left = dimensions.left;\n      this.top = dimensions.top;\n      this.w = dimensions.width;\n      this.h = dimensions.height;\n\n    }, 5);\n  }\n\n  /**\n   * Returns the chart serialized as an image URI.\n   *\n   * Call this after the chart is drawn (`google-chart-ready` event).\n   */\n  get imageURI(): string|null {\n    if (this.chartWrapper == null) return null;\n    const chart = this.chartWrapper.getChart();\n    return chart && (chart as google.visualization.ChartBaseRenderable).getImageURI();\n  }\n\n  /** Handles changes to the `view` attribute. */\n  private viewChanged() {\n    if (!this.view) return;\n    this._data = this.view;\n  }\n\n  /** Handles changes to the rows & columns attributes. */\n  private async rowsOrColumnsChanged() {\n    const {rows, cols} = this;\n    if (!rows || !cols) return;\n    try {\n      const dt = await dataTable({cols});\n      dt.addRows(rows);\n      this._data = dt;\n    } catch (reason) {\n      this.shadowRoot!.getElementById('chartdiv')!.textContent = String(reason);\n    }\n  }\n\n  /**\n   * Handles changes to the `data` attribute.\n   */\n  private dataChanged() {\n    const version = ++this.dataVersion;\n    const data = this.data;\n    this.dataPending = !!data;\n    if (this.dataPending) this.cancelScheduledRedraw();\n    if (!data) {\n      return;\n    }\n\n    let dataPromise: Promise<DataTableLike>;\n    if (typeof data === 'string' || data instanceof String) {\n      const dataString = String(data);\n      try {\n        dataPromise = Promise.resolve(JSON.parse(dataString) as DataTableLike);\n      } catch {\n        // Load data asynchronously when the string is a URL, not JSON.\n        dataPromise = fetch(dataString).then(response => response.json());\n      }\n    } else {\n      dataPromise = Promise.resolve(data);\n    }\n\n    dataPromise.then(dataTable).then(converted => {\n      if (version === this.dataVersion && this.data === data) {\n        this.dataPending = false;\n        const unchanged = this._data === converted;\n        this._data = converted;\n        if (unchanged) this.redraw();\n      }\n    }).catch((reason: unknown) => {\n      console.error('Failed to prepare chart data:', reason);\n      if (version === this.dataVersion && this.data === data) {\n        this.dataPending = false;\n        this._data = undefined;\n        const chart = this.shadowRoot?.getElementById('chartdiv');\n        if (chart) chart.textContent = String(reason);\n      }\n    });\n  }\n\n  /**\n   * Queries global document head for Google Charts `link#load-css-*` and clones\n   * them into the local root's `div#styles` element for shadow dom support.\n   */\n  private localizeGlobalStylesheets(stylesDiv: HTMLElement) {\n    // Get all Google Charts stylesheets.\n    const stylesheets = Array.from(document.head.querySelectorAll(\n        'link[rel=\"stylesheet\"][type=\"text/css\"][id^=\"load-css-\"]'));\n\n    for (const stylesheet of stylesheets) {\n      // Clone necessary stylesheet attributes.\n      const clonedStylesheet = document.createElement('link');\n      clonedStylesheet.setAttribute('rel', 'stylesheet');\n      clonedStylesheet.setAttribute('type', 'text/css');\n      // `href` is always present.\n      clonedStylesheet.setAttribute('href', stylesheet.getAttribute('href')!);\n\n      stylesDiv.appendChild(clonedStylesheet);\n    }\n  }\n}\n\ndeclare global {\n  interface HTMLElementTagNameMap {\n    'thermal-chart': ThermalChartElement;\n  }\n}","import type { AvailableThermalPalette, PlaybackSpeeds, ThermalFileFailure, ThermalFileInstance, ThermalGroup, ThermalManager, ThermalRangeOrUndefined, ThermalRegistry, ThermalUnit } from \"@labirthermal/core\";\nimport { provide } from \"@lit/context\";\nimport { property } from \"lit/decorators.js\";\nimport type { IElementWithFileController } from \"../controllers/FileController\";\nimport { FileController } from \"../controllers/FileController\";\nimport type { IElementWithFileLoadController } from \"../controllers/FileLoadController\";\nimport { FileLoadController } from \"../controllers/FileLoadController\";\nimport type { IElementWithGroupController } from \"../controllers/GroupController\";\nimport { GroupController } from \"../controllers/GroupController\";\nimport type { IElementWithManagerController } from \"../controllers/ManagerController\";\nimport { ManagerController, managerInteractiveAnalysesContext } from \"../controllers/ManagerController\";\nimport type { IElementWithRegistryController } from \"../controllers/RegistryController\";\nimport { RegistryController } from \"../controllers/RegistryController\";\nimport { AbstractApp } from \"./AbstractApp\";\n\n\n/**\n * Common foundation for apps that handle a single thermal file loaded from the URL.\n */\nexport abstract class AbstractSingleFileAppElement \nextends AbstractApp \nimplements \n    IElementWithManagerController, \n    IElementWithRegistryController,\n    IElementWithGroupController,\n    IElementWithFileController,\n    IElementWithFileLoadController\n{\n\n    static properties = {\n            ...AbstractApp.properties,\n            ...ManagerController.HOST_PROPERTIES,\n            ...RegistryController.HOST_PROPERTIES,\n            ...GroupController.HOST_PROPERTIES,\n            ...FileController.HOST_PROPERTIES,\n            ...FileLoadController.HOST_PROPERTIES\n        };\n    \n        /** Enables selecting, editing and removing the analyses in the tables. Provided to all descendants. */\n        @provide({ context: managerInteractiveAnalysesContext })\n        @property({ type: Boolean, reflect: true, attribute: \"interactive-analysis\"})\n        interactiveAnalysis: boolean = true;\n    \n        // Manager controller properties\n        \n        managerSlug!: string;\n        managerObject!: ThermalManager;\n        managerController: ManagerController = new ManagerController(this);\n        palette: AvailableThermalPalette = \"jet\";\n        advancedPalettes: boolean = false;\n        smoothThermograms: boolean = false;\n        smoothGraph: boolean = false;\n        tool: string = \"inspect\";\n        unit!: ThermalUnit;\n    \n    \n        // Registry controller properties\n        \n        registrySlug!: string;\n        registryObject!: ThermalRegistry;\n        registryController: RegistryController = new RegistryController(this);\n        opacity: number = 1;\n        /** Current minimum temperature of the registry in Celsius. Set internally by `@labirthermal/core`. */\n        min?: number | undefined;\n        /** Current maximum temperature of the registry in Celsius. Set internally by `@labirthermal/core`. */\n        max?: number | undefined;\n        from?: number | undefined;\n        to?: number | undefined;\n        highlight?: ThermalRangeOrUndefined;\n        loading: boolean = false;\n    \n        // Group controller properties\n    \n        groupSlug!: string;\n        groupObject!: ThermalGroup;\n        groupController: GroupController = new GroupController(this);\n        autoclearGroup: boolean = true;\n    \n    \n        // File controller properties\n    \n        fileController: FileController = new FileController(this);\n        file?: ThermalFileInstance | undefined;\n        failure?: ThermalFileFailure | undefined;\n        ms: number = 0;\n        playbackSpeed: PlaybackSpeeds = 1;\n        analysis1?: string | undefined;\n        analysis2?: string | undefined;\n        analysis3?: string | undefined;\n        analysis4?: string | undefined;\n        analysis5?: string | undefined;\n        analysis6?: string | undefined;\n        analysis7?: string | undefined;\n        autoHighlight: boolean = false;\n    \n        // File load controller properties\n    \n        fileLoadController: FileLoadController = new FileLoadController(this);\n        thermal: string | undefined;\n        visible: string | undefined;\n\n\n}","import type { PropertyValues } from \"lit\";\nimport { css, html, nothing } from \"lit\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { AbstractSingleFileAppElement } from \"./AbstractSingleFileApp\";\n\nexport class ThermalFileAppElement extends AbstractSingleFileAppElement {\n\n    /** Observes the interactive layout's content width; released on disconnect. */\n    private layoutObserver?: ResizeObserver;\n\n    connectedCallback(): void {\n        super.connectedCallback();\n        if (this.hasUpdated) {\n            this.observeLayout();\n        }\n    }\n\n    firstUpdated(changedProperties: PropertyValues): void {\n        super.firstUpdated(changedProperties);\n        this.observeLayout();\n    }\n\n    disconnectedCallback(): void {\n        this.layoutObserver?.disconnect();\n        this.layoutObserver = undefined;\n        super.disconnectedCallback();\n    }\n\n    /** Applies responsive classes to the rendered layout without recreating its interactive children. */\n    private observeLayout(): void {\n        const layout = this.shadowRoot?.querySelector<HTMLDivElement>(\".layout\");\n        if (!layout || this.layoutObserver) {\n            return;\n        }\n        const observer = new ResizeObserver(entries => {\n            if (!this.isConnected || this.layoutObserver !== observer) {\n                return;\n            }\n            const entry = entries.find(entry => entry.target === layout);\n            if (entry) {\n                layout.classList.toggle(\"layout--stacked\", entry.contentRect.width < 700);\n                layout.classList.toggle(\"layout--compact\", entry.contentRect.width < 500);\n            }\n        });\n        this.layoutObserver = observer;\n        observer.observe(layout);\n    }\n\n    static styles = css`\n    \n        .layout {\n            display: grid;\n            grid-template-columns: min-content minmax(0, 1fr) minmax(0, 1fr);\n            grid-template-areas: \"tools viewer analysis\";\n            gap: 1em;\n            margin-top: 1em;\n        }\n\n        .layout > * {\n            min-width: 0;\n        }\n\n        manager-tool-bar {\n            grid-area: tools;\n            align-self: start;\n        }\n\n        .viewer {\n            grid-area: viewer;\n        }\n\n        file-analysis-complex {\n            grid-area: analysis;\n        }\n\n        .layout--stacked {\n            grid-template-columns: min-content minmax(0, 1fr);\n            grid-template-areas:\n                \"tools viewer\"\n                \"tools analysis\";\n        }\n\n        .layout--compact {\n            grid-template-columns: minmax(0, 1fr);\n            grid-template-areas:\n                \"tools\"\n                \"viewer\"\n                \"analysis\";\n        }\n\n        .layout--compact manager-tool-bar {\n            flex-direction: row;\n            flex-wrap: wrap;\n        }\n    \n    `;\n\n    \n    render() {\n        return html`<thermal-app \n            label=\"${ifDefined(this.label)}\" \n            author=\"${ifDefined(this.author)}\" \n            license=\"${ifDefined(this.license)}\" \n            .showfullscreen=${this.showFullscreen}\n        >\n\n            <file-download-dropdown slot=\"bar-pre\"></file-download-dropdown>\n            <file-info-button slot=\"bar-pre\"></file-info-button>\n\n            <manager-palette-dropdown slot=\"bar-pre\"></manager-palette-dropdown>\n            <manager-unit-switch slot=\"bar-pre\" default-variant=\"default\" active-variant=\"background\"></manager-unit-switch>\n            <registry-range-form slot=\"bar-pre\"></registry-range-form>\n            ${this.file && this.file.visibleUrl ? html`<registry-opacity-slider slot=\"bar-pre\"></registry-opacity-slider>` : nothing}\n\n            <registry-histogram slot=\"pre\" ?expandable=${true}></registry-histogram>\n            <registry-range-slider slot=\"pre\"></registry-range-slider>\n            <registry-ticks-bar slot=\"pre\"></registry-ticks-bar>\n\n            \n            <div class=\"layout\">\n                <manager-tool-bar></manager-tool-bar>\n                <div class=\"viewer\">\n                    <file-canvas></file-canvas>\n                    <file-timeline></file-timeline>\n                </div>\n                <file-analysis-complex></file-analysis-complex>\n            </div>\n            \n        </thermal-app>`;\n    }\n\n}","import type { AbstractFileResult, AvailableThermalPalette, PlaybackSpeeds, ThermalFileFailure, ThermalFileInstance, ThermalGroup, ThermalManager, ThermalRangeOrUndefined, ThermalRegistry, ThermalUnit } from \"@labirthermal/core\";\nimport { ThermalFileReader } from \"@labirthermal/core\";\nimport { provide } from \"@lit/context\";\nimport { t } from \"i18next\";\nimport type { PropertyValues } from \"lit\";\nimport { css, html } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { repeat } from \"lit/directives/repeat.js\";\nimport { publicIpv4 } from \"public-ip\";\nimport type { IElementWithFileController } from \"../controllers/FileController\";\nimport { FileController } from \"../controllers/FileController\";\nimport type { IElementWithGroupController } from \"../controllers/GroupController\";\nimport { GroupController } from \"../controllers/GroupController\";\nimport type { IElementWithGroupListingController } from \"../controllers/GroupListingController\";\nimport { GroupListingController, GroupOrderby, GroupOrdering } from \"../controllers/GroupListingController\";\nimport type { IElementWithManagerController } from \"../controllers/ManagerController\";\nimport { ManagerController } from \"../controllers/ManagerController\";\nimport type { IElementWithRegistryController } from \"../controllers/RegistryController\";\nimport { RegistryController } from \"../controllers/RegistryController\";\nimport { T } from \"../translations/Languages\";\nimport type { IWithlocale, Locales } from \"../translations/localeContext\";\nimport { localeContext, localeConverter } from \"../translations/localeContext\";\nimport { AbstractApp } from \"./AbstractApp\";\n\nenum Mode {\n    INPUT = \"input\",\n    LIST = \"list\",\n    DETAIL = \"detail\"\n}\n\nexport class ThermalDropinAppElement\n    extends AbstractApp\n    implements\n    IWithlocale,\n    IElementWithManagerController,\n    IElementWithRegistryController,\n    IElementWithGroupController,\n    IElementWithFileController,\n    IElementWithGroupListingController {\n\n    public static properties = {\n        ...ManagerController.HOST_PROPERTIES,\n        ...RegistryController.HOST_PROPERTIES,\n        ...GroupController.HOST_PROPERTIES,\n        ...FileController.HOST_PROPERTIES,\n        ...GroupListingController.HOST_PROPERTIES\n    }\n\n\n\n    managerSlug!: string;\n    managerObject!: ThermalManager;\n    palette: AvailableThermalPalette = \"jet\";\n    advancedPalettes: boolean = false;\n    smoothThermograms: boolean = false;\n    smoothGraph: boolean = false;\n    tool: string = \"inspect\";\n    unit!: ThermalUnit;\n    managerController: ManagerController = new ManagerController(this);\n\n    registrySlug!: string;\n    registryObject!: ThermalRegistry;\n    opacity: number = 1;\n    /** Current minimum temperature of the registry in Celsius. Set internally by `@labirthermal/core`. */\n    min?: number | undefined;\n    /** Current maximum temperature of the registry in Celsius. Set internally by `@labirthermal/core`. */\n    max?: number | undefined;\n    from?: number | undefined;\n    to?: number | undefined;\n    highlight?: ThermalRangeOrUndefined;\n    loading: boolean = false;\n    registryController: RegistryController = new RegistryController(this);\n\n    groupSlug!: string;\n    groupObject!: ThermalGroup;\n    autoclearGroup: boolean = false;\n    groupController: GroupController = new GroupController(this);\n\n\n    file?: ThermalFileInstance | undefined;\n    failure?: ThermalFileFailure | undefined;\n    ms: number = 0;\n    playbackSpeed: PlaybackSpeeds = 1;\n    analysis1?: string | undefined;\n    analysis2?: string | undefined;\n    analysis3?: string | undefined;\n    analysis4?: string | undefined;\n    analysis5?: string | undefined;\n    analysis6?: string | undefined;\n    analysis7?: string | undefined;\n    autoHighlight: boolean = false;\n    fileController: FileController = new FileController(this);\n\n    orderby: GroupOrderby = GroupOrderby.DATE;\n    ordering: GroupOrdering = GroupOrdering.ASC;\n    groupListingController: GroupListingController = new GroupListingController(this);\n\n    @property({ type: String, reflect: true })\n    displayMode: Mode = Mode.INPUT;\n\n    public get manager(): ThermalManager {\n        return this.managerObject;\n    }\n\n    @state()\n    protected ip?: string;\n\n    @state()\n    public toDisplay: ThermalFileInstance[] = [];\n\n    @provide({ context: localeContext })\n    @property({ reflect: true, converter: localeConverter })\n    public locale!: Locales;\n\n    connectedCallback(): void {\n        super.connectedCallback();\n        try {\n            publicIpv4().then(ip => this.ip = ip);\n        } catch (error) {\n            console.error(\"Failed to get public IPv4 address:\", error);\n        }\n\n        const listener = async (\n            files: ThermalFileInstance[]\n        ) => {\n\n            this.log(\"Files received in listener:\", files);\n\n            // Clear the timeout if exists\n            if (this.onValueChangeTimeout !== undefined) {\n                clearTimeout(this.onValueChangeTimeout);\n            }\n\n            // Set the new timeout to handle the value change\n            this.onValueChangeTimeout = setTimeout(async () => {\n                // Set the to display array of instances\n                this.toDisplay = files;\n\n            }, 0);\n\n        }\n\n        // Add the listener directly\n        this.groupObject?.files.addListener(\n            this.UUID,\n            listener.bind(this)\n        );\n\n        // Enqueue the listener for later usage\n        this.groupController.onInternalObject.set(\n            this.UUID,\n            group => {\n\n                group.files.addListener(\n                    this.UUID,\n                    listener.bind(this)\n                );\n\n            }\n        );\n    }\n\n    willUpdate(_changedProperties: PropertyValues<ThermalDropinAppElement>) {\n        super.willUpdate(_changedProperties);\n\n        // Side effect: update the display mode based on the number of instances to display\n        if (_changedProperties.has(\"toDisplay\")) {\n\n            if (this.toDisplay.length === 0) {\n                this.displayMode = Mode.INPUT;\n            } else if (this.toDisplay.length === 1) {\n                this.displayMode = Mode.DETAIL;\n                this.fileController.receiveInstance(this.toDisplay[0]);\n                this.postLoadedProcessingAndApplyMinmax();\n            } else if (this.toDisplay.length > 1) {\n                this.displayMode = Mode.LIST;\n                this.postLoadedProcessingAndApplyMinmax();\n            }\n        }\n    }\n\n    /**\n     * Postprocess the registry and reset its range to apply min and max values.\n     */\n    private async postLoadedProcessingAndApplyMinmax() {\n        await this.registryObject.postLoadedProcessing();\n        this.registryObject.range.applyMinmax();\n    }\n\n    private onValueChangeTimeout: ReturnType<typeof setTimeout> | undefined;\n\n    protected handleClear() {\n\n        if (this.groupObject !== undefined) {\n            this.fileController.removeInstance();\n            this.groupObject.files.removeAllInstances();\n            this.file = undefined;\n            this.requestUpdate();\n            this.analysis1 = undefined;\n            this.analysis2 = undefined;\n            this.analysis3 = undefined;\n            this.analysis4 = undefined;\n            this.analysis5 = undefined;\n            this.analysis6 = undefined;\n            this.analysis7 = undefined;\n        }\n\n    }\n\n\n    public static styles = css`\n        ${GroupListingController.styles}\n    \n        .layout {\n        \n            width: 100%;\n            display: grid;\n            grid-template-columns: auto 1fr;\n            gap: 1em;\n        \n        }\n\n        .layout-content {\n            min-width: 0;\n        }\n\n        manager-tool-bar {\n            height: 2em;\n        }\n\n    `;\n\n\n\n\n\n\n\n    public async handleDropAndClear(\n        results: AbstractFileResult[]\n    ) {\n\n        this.log(results);\n\n        // this.fileController.removeInstance();\n\n        // this.groupListingController.clearBackup();\n\n\n        const readers = results.filter(result => result instanceof ThermalFileReader);\n\n        this.groupListingController.backupReaders(readers);\n\n        this.groupListingController.restoreTheEntireBackup();\n    }\n\n\n    protected renderIntroScene() {\n\n        return html`\n            <group-dropin-element .onDrop=${this.handleDropAndClear.bind(this)}></group-dropin-element>\n        `;\n\n    }\n\n    protected renderLayout(\n        children: unknown\n    ) {\n        return html`\n        <div class=\"layout\">\n            <div style=\"width: 2em;\"></div>\n            <div class=\"layout-content\">${children}</div>\n        </div>\n        `;\n    }\n\n    protected renderHeader(): unknown[] {\n\n        const elements: unknown[] = [];\n\n        if (this.displayMode === Mode.INPUT) {\n\n            elements.push(html`<group-dropin-input \n                slot=\"bar-pre\"\n                variant=\"background\"\n                icon=\"upload\"\n                iconStyle=\"micro\"\n                tooltip=\"Vyberte soubory z disku\"\n                .onDrop=${this.handleDropAndClear.bind(this)}\n            ></group-dropin-input>` );\n\n        }\n\n\n        // Palette and thermal range is available whenever it is anything else than the input\n        if (this.displayMode !== Mode.INPUT) {\n\n            elements.push(html`\n            <manager-tool-bar slot=\"pre-bar\"></manager-tool-bar>\n            <manager-palette-dropdown slot=\"pre-bar\"></manager-palette-dropdown>\n            <manager-unit-switch slot=\"pre-bar\" active-variant=\"background\"></manager-unit-switch>\n            <registry-range-form slot=\"pre-bar\"></registry-range-form>\n            \n            ` );\n        }\n\n        if (this.displayMode === Mode.LIST) {\n            elements.push(html`${this.groupListingController.renderListHeader(\"bar-header\")}`);\n        }\n\n        if (this.displayMode === Mode.DETAIL) {\n            elements.push(html`${this.groupListingController.renderDetailHeader(this.groupObject.files.value[0], \"bar-pre\")}`);\n        }\n\n        if (this.displayMode !== Mode.INPUT) {\n\n            elements.push(html`<thermal-dialog label=\"${t(T.config)}\" slot=\"bar-pre\">\n                <thermal-btn slot=\"invoker\" tooltip=\"${t(T.config)}\" icon=\"settings\" iconStyle=\"solid\"></thermal-btn>\n                <div slot=\"content\">\n                    <table>\n                        <manager-export-panel></manager-export-panel>\n                        <display-panel></display-panel>\n                    </table>\n                </div>\n            </thermal-dialog>`);\n\n\n            elements.push(this.groupListingController.renderTemperatureScale());\n        }\n\n        return elements;\n\n    }\n\n    protected renderDetail() {\n\n        return this.renderLayout(this.groupListingController.renderDetailBody());\n\n    }\n\n    public renderList() {\n\n        const map = repeat(\n            this.toDisplay,\n            instance => instance.id,\n            instance => this.groupListingController.renderThumbnail(instance)\n        );\n\n        return this.renderLayout(\n            this.groupListingController.renderListContainer(map));\n    }\n\n\n    protected renderAuto() {\n\n        switch (this.displayMode) {\n\n            case Mode.INPUT:\n                return this.renderIntroScene();\n            case Mode.LIST:\n                return this.renderList();\n            case Mode.DETAIL:\n                return this.renderDetail();\n\n        }\n\n\n    }\n\n\n    protected render(): unknown {\n\n        try {\n\n            const label = this.label ?? \"LabIR Web Analyser\";\n\n            return html`<thermal-app \n                label=\"${label}\"\n                ?show-fullscreen=${true}\n            >\n\n                ${this.renderHeader()}\n\n                <slot name=\"bar-pre\" slot=\"bar-pre\"></slot>\n\n                ${this.renderAuto()}\n\n            </thermal-app>\n\n        `;\n\n        } catch (error) {\n\n            console.error(error);\n\n            return html`Stala se chyba`;\n\n        }\n\n    }\n\n}","import type { AvailableThermalPalette, PlaybackSpeeds, ThermalFileFailure, ThermalFileInstance, ThermalGroup, ThermalManager, ThermalRangeOrUndefined, ThermalRegistry, ThermalUnit } from \"@labirthermal/core\";\nimport { css, html } from \"lit\";\nimport type { IElementWithFileController } from \"../controllers/FileController\";\nimport { FileController } from \"../controllers/FileController\";\nimport type { IElementWithGroupController } from \"../controllers/GroupController\";\nimport { GroupController } from \"../controllers/GroupController\";\nimport type { IElementWithGroupListingController } from \"../controllers/GroupListingController\";\nimport { GroupListingController, GroupOrderby, GroupOrdering } from \"../controllers/GroupListingController\";\nimport type { IElementWithGroupLoadController } from \"../controllers/GroupLoadController\";\nimport { GroupLoadController } from \"../controllers/GroupLoadController\";\nimport type { IElementWithManagerController } from \"../controllers/ManagerController\";\nimport { ManagerController } from \"../controllers/ManagerController\";\nimport type { IElementWithRegistryController } from \"../controllers/RegistryController\";\nimport { RegistryController } from \"../controllers/RegistryController\";\nimport { AbstractApp } from \"./AbstractApp\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\n\n\nexport class ThermalGroupAppElement\n    extends AbstractApp\n    implements\n    IElementWithManagerController,\n    IElementWithRegistryController,\n    IElementWithGroupController,\n    IElementWithFileController,\n    IElementWithGroupListingController,\n    IElementWithGroupLoadController {\n    \n    \n\n    static properties = {\n        ...AbstractApp.properties,\n        ...ManagerController.HOST_PROPERTIES,\n        ...RegistryController.HOST_PROPERTIES,\n        ...GroupController.HOST_PROPERTIES,\n        ...FileController.HOST_PROPERTIES,\n        ...GroupLoadController.HOST_PROPERTIES\n    };\n\n\n    // Manager controller properties\n\n    managerSlug!: string;\n    managerObject!: ThermalManager;\n    managerController: ManagerController = new ManagerController(this);\n    palette: AvailableThermalPalette = \"jet\";\n    advancedPalettes: boolean = false;\n    smoothThermograms: boolean = false;\n    smoothGraph: boolean = false;\n    tool: string = \"inspect\";\n    unit!: ThermalUnit;\n\n    // Registry controller properties\n\n    registrySlug!: string;\n    registryObject!: ThermalRegistry;\n    registryController: RegistryController = new RegistryController(this);\n    opacity: number = 1;\n    /** Current minimum temperature of the registry in Celsius. Set internally by `@labirthermal/core`. */\n    min?: number | undefined;\n    /** Current maximum temperature of the registry in Celsius. Set internally by `@labirthermal/core`. */\n    max?: number | undefined;\n    from?: number | undefined;\n    to?: number | undefined;\n    highlight?: ThermalRangeOrUndefined;\n    loading: boolean = false;\n\n    // Group controller properties\n\n    groupSlug!: string;\n    groupObject!: ThermalGroup;\n    groupController: GroupController = new GroupController(this);\n    autoclearGroup: boolean = true;\n\n\n    // File controller properties\n\n    fileController: FileController = new FileController(this);\n    file?: ThermalFileInstance | undefined;\n    failure?: ThermalFileFailure | undefined;\n    ms: number = 0;\n    playbackSpeed: PlaybackSpeeds = 1;\n    analysis1?: string | undefined;\n    analysis2?: string | undefined;\n    analysis3?: string | undefined;\n    analysis4?: string | undefined;\n    analysis5?: string | undefined;\n    analysis6?: string | undefined;\n    analysis7?: string | undefined;\n    autoHighlight: boolean = false;\n\n    groupListingController: GroupListingController = new GroupListingController(this);\n    orderby: GroupOrderby = GroupOrderby.DATE;\n    ordering: GroupOrdering = GroupOrdering.ASC;\n\n    groupLoadController: GroupLoadController = new GroupLoadController(this);\n    filesString?: string | undefined;\n\n    private subscribedGroup?: ThermalGroup;\n\n    connectedCallback(): void {\n        super.connectedCallback();\n        this.subscribedGroup = this.groupObject;\n        this.subscribedGroup.files.addListener(this.UUID, () => {\n            if (this.file && !this.groupObject.files.value.includes(this.file)) {\n                this.fileController.removeInstance();\n            }\n            this.requestUpdate();\n        });\n    }\n\n    disconnectedCallback(): void {\n        this.subscribedGroup?.files.removeListener(this.UUID);\n        this.subscribedGroup = undefined;\n        super.disconnectedCallback();\n    }\n\n    private openDetail(instance: ThermalFileInstance): void {\n        this.registryController.setHighlight(undefined);\n        this.ms = instance.timeline.currentMs;\n        this.playbackSpeed = instance.timeline.playbackSpeed;\n        const analysisAttributes = [\"analysis1\", \"analysis2\", \"analysis3\", \"analysis4\", \"analysis5\", \"analysis6\", \"analysis7\"] as const;\n        analysisAttributes.forEach((attribute, index) => {\n            this[attribute] = instance.slots.getSlot(index + 1)?.serialized;\n        });\n        this.fileController.receiveInstance(instance);\n    }\n\n    private closeDetail(): void {\n        this.registryController.setHighlight(undefined);\n        this.fileController.removeInstance();\n    }\n\n    public static styles = css`\n        ${GroupListingController.styles}\n\n        .layout {\n            width: 100%;\n            display: grid;\n            grid-template-columns: 2em minmax(0, 1fr);\n            gap: 1em;\n        }\n\n        .layout-content {\n            min-width: 0;\n        }\n\n        manager-tool-bar {\n            height: 2em;\n        }\n    `;\n\n    protected render(): unknown {\n        const listingOptions = {\n            allowFileChanges: false,\n            onOpenDetail: (instance: ThermalFileInstance) => this.openDetail(instance),\n            onCloseDetail: () => this.closeDetail()\n        };\n        const hasFiles = this.groupObject?.files.value.length > 0;\n\n        return html`<thermal-app\n            label=${this.label ?? \"LabIR Web Analyser\"}\n            author=${ifDefined(this.author)}\n            license=${ifDefined(this.license)}\n            ?show-fullscreen=${this.showFullscreen}\n        >\n            ${hasFiles ? html`\n                <manager-tool-bar slot=\"pre-bar\"></manager-tool-bar>\n                <manager-palette-dropdown slot=\"pre-bar\"></manager-palette-dropdown>\n                <registry-range-form slot=\"pre-bar\"></registry-range-form>\n                ${this.file\n                    ? this.groupListingController.renderDetailHeader(this.file, \"bar-header\", listingOptions)\n                    : this.groupListingController.renderListHeader(\"bar-header\", listingOptions)}\n                <thermal-dialog label=${this.t(\"config\")} slot=\"bar-pre\">\n                    <thermal-btn slot=\"invoker\" tooltip=${this.t(\"config\")} icon=\"settings\" iconStyle=\"solid\"></thermal-btn>\n                    <div slot=\"content\">\n                        <table>\n                            <manager-export-panel></manager-export-panel>\n                            <display-panel></display-panel>\n                        </table>\n                    </div>\n                </thermal-dialog>\n                ${this.groupListingController.renderTemperatureScale()}\n            ` : undefined}\n            <slot name=\"bar-pre\" slot=\"bar-pre\"></slot>\n            ${this.groupLoadController.errors.map(message => html`<p role=\"alert\">${message}</p>`)}\n            <div class=\"layout\">\n                <div></div>\n                <div class=\"layout-content\">\n                    ${this.loading ? html`<p role=\"status\">${this.t(\"loading\")}</p>` : undefined}\n                    ${hasFiles\n                        ? this.file\n                            ? this.groupListingController.renderDetailBody()\n                            : this.groupListingController.renderListContainer(\n                                this.groupListingController.renderList(\n                                    instance => this.groupListingController.renderThumbnail(instance, listingOptions)\n                                )\n                            )\n                        : this.loading ? undefined : html`<p>Ve skupině nejsou žádné soubory.</p>`}\n                </div>\n            </div>\n        </thermal-app>`;\n    }\n}","type ComponentsCatalog = Record<string, CustomElementConstructor>;\n\n/**\n * Registers and defines all custom elements from a provided list\n * \n * @module @labirthermal/webcomponents\n * \n */\nexport const defineAllWebcomponents = (\n    name: string,\n    version: string,\n    catalog: ComponentsCatalog\n) => {\n\n    for ( const [tag, cls] of Object.entries( catalog ) ) {\n        defineWebcomponent( name, version, tag, cls );\n    }\n\n}\n\n/**\n * Registers a custom element and defines it right away.\n * \n * @module @labirthermal/webcomponents\n */\nexport const defineWebcomponent = (\n    name: string,\n    version: string,\n    tag: string,\n    cls: CustomElementConstructor\n) => {\n\n    if ( customElements.get( tag ) ) {\n        console.warn( name, version, \"🟥\", ...debugclsName( tag, cls ) );\n        return;\n    }\n\n    customElements.define( tag, cls );\n    console.info( name, version, \"✅\", ...debugclsName( tag, cls ) );\n\n}\n\nconst tagNameMaxLength = 50;\nconst tagline = \".........................................................\";\n\nconst debugclsName = (\n    tag: string,\n    cls: CustomElementConstructor\n) => {\n\n    const tagLength = tag.length;\n\n    if ( tagLength > tagNameMaxLength ) {\n        tag = tag.substring( 0, tagNameMaxLength - 3 ) + \"...\";\n    }\n\n    return [\n        tag,\n        tagline.substring( 0, tagNameMaxLength - tagLength ),\n        cls.name\n    ];\n\n}\n\n","import { provide } from \"@lit/context\";\nimport { t } from \"i18next\";\nimport type { CSSResultGroup, PropertyValues } from \"lit\";\nimport { css, html, nothing } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport type { Ref } from \"lit/directives/ref.js\";\nimport { createRef, ref } from \"lit/directives/ref.js\";\nimport { unsafeHTML } from \"lit/directives/unsafe-html.js\";\nimport { AbstractThermalElement } from \"../hierarchy/AbstractThermalElement\";\nimport { T } from \"../translations/Languages\";\nimport type { IWithlocale, Locales } from \"../translations/localeContext\";\nimport { initLocalesInTopLevelElement, localeContext, localeConverter } from \"../translations/localeContext\";\n\nenum VUNIT {\n    mps = \"mps\",\n    kph = \"kph\"\n}\n\nconst converters = {\n    fromAttribute(value: string | null) {\n\n        if (typeof value === \"string\") {\n            const trimmedValue = value.trim();\n            if (trimmedValue.length > 0) {\n                return parseFloat(trimmedValue);\n            } else {\n                return undefined;\n            }\n        } else {\n            return undefined;\n        }\n    },\n    toAttribute(value: number | undefined) {\n        if (value !== undefined) {\n            return value.toString();\n        } else {\n            return undefined;\n        }\n    },\n};\n\nexport class AatAppElement extends AbstractThermalElement implements IWithlocale {\n\n    tRef: Ref<HTMLInputElement> = createRef();\n    vRef: Ref<HTMLInputElement> = createRef();\n    vunitsRef: Ref<HTMLSelectElement> = createRef();\n    haRef: Ref<HTMLInputElement> = createRef();\n\n    /** Air temperature in degree celsius */\n    @property({ type: String, reflect: true, attribute: \"t\", converter: converters })\n    public temperature?: number;\n\n    /** Wind speed in m/s */\n    @property({ type: String, reflect: true, attribute: true, converter: converters })\n    public v?: number;\n\n    /** Air humidity in percent */\n    @property({ type: String, reflect: true, attribute: true, converter: converters })\n    public ha?: number;\n\n    /** Result apparent temperature */\n    @state()\n    protected ta?: number;\n\n    @property({ type: String, reflect: true, attribute: true })\n    public vunits: VUNIT = VUNIT.mps;\n\n    @provide({ context: localeContext })\n    @property({ reflect: true, converter: localeConverter })\n    public locale!: Locales;\n\n\n\n    protected kphToMps(kph: number): number {\n        return kph * 0.2778;\n    }\n\n\n\n    protected calculateE(\n        h: number,\n        t: number\n    ) {\n\n        return h * (6.105 / 100) * Math.exp(17.27 * t / (237.7 + t));\n\n    }\n\n    protected calculateTa(\n        t: number,\n        e: number,\n        v: number\n    ) {\n        return t + (0.33 * e) - (0.7 * v) - 4;\n    }\n\n\n    protected firstUpdated(_changedProperties: PropertyValues): void {\n        super.firstUpdated(_changedProperties);\n\n        initLocalesInTopLevelElement(this);\n\n        if (this.tRef.value) {\n            this.tRef.value.addEventListener(\"change\", event => {\n\n                const target = event.target as HTMLInputElement;\n                const value = parseFloat(target.value);\n\n                if (!isNaN(value)) {\n\n                    this.temperature = Math.min(100, Math.max(-275.4, value));\n\n                }\n\n            })\n        }\n\n        if (this.haRef.value) {\n            this.haRef.value.addEventListener(\"change\", event => {\n\n                const target = event.target as HTMLInputElement;\n                const value = parseFloat(target.value);\n\n                if (!isNaN(value)) {\n\n                    this.ha = Math.min(100, Math.max(0, value));\n\n                }\n\n            })\n        }\n\n        if (this.vRef.value) {\n            this.vRef.value.addEventListener(\"change\", event => {\n\n                const target = event.target as HTMLInputElement;\n                const value = parseFloat(target.value);\n\n                if (!isNaN(value)) {\n\n                    this.v = Math.max(0, value);\n\n                }\n\n            })\n        }\n    }\n\n\n    protected processValueChange(\n        _changedProperties: PropertyValues<AatAppElement>,\n        key: keyof AatAppElement,\n    ) {\n\n        if (_changedProperties.has(key)) {\n\n            const newValue: number | undefined = this[key] as number | undefined;\n\n            // Assign the new Value\n            const inputRef = this[`${key}Ref` as keyof this] as Ref<HTMLInputElement>;\n\n            // Propagate the value\n            if (inputRef.value) {\n\n                if (newValue !== undefined && newValue !== null) {\n                    inputRef.value.value = newValue.toString();\n                } else {\n                    inputRef.value.value = \"\";\n                }\n\n            }\n\n            this.recalculateVa();\n\n        }\n\n    }\n\n    protected recalculateVa() {\n        if (this.temperature !== undefined && this.ha !== undefined && this.v !== undefined) {\n\n            const v = this.vunits === VUNIT.mps\n                ? this.v\n                : this.kphToMps(this.v);\n\n            const e = this.calculateE(this.ha, this.temperature);\n            const ta = this.calculateTa(this.temperature, e, v);\n\n            this.ta = ta;\n\n        } else {\n            this.ta = undefined;\n        }\n    }\n\n    protected shouldUpdate(_changedProperties: PropertyValues<AatAppElement>): boolean {\n\n        super.shouldUpdate(_changedProperties);\n\n\n        // Validate the HA\n        if (this.ha) {\n            if (this.ha < 0) {\n                this.ha = 0;\n                if (this.haRef.value) {\n                    this.haRef.value.value = \"0\";\n                }\n\n            }\n\n            if (this.ha > 100) {\n                this.ha = 100;\n                if (this.haRef.value) {\n                    this.haRef.value.value = \"100\";\n                }\n            }\n        }\n\n        return true;\n    }\n\n    public willUpdate(_changedProperties: PropertyValues<AatAppElement>): void {\n        super.willUpdate(_changedProperties);\n\n        // Listen to values change\n        this.processValueChange(_changedProperties, \"temperature\");\n        this.processValueChange(_changedProperties, \"v\");\n        this.processValueChange(_changedProperties, \"ha\");\n\n\n        // Propagate the VUNITS change to the DOM\n        if (_changedProperties.has(\"vunits\")) {\n\n            if (this.vunitsRef.value) {\n                this.vunitsRef.value.value = this.vunits;\n                this.recalculateVa();\n            }\n\n        }\n    }\n\n\n    static styles?: CSSResultGroup | undefined = css`\n\n        .table {\n            display: table;\n            width: 100%;\n            border-collapse: collapse;\n        }\n    \n        .field {\n\n            width: 100%;\n            display: table-row;\n\n        }\n\n        .column {\n            display: table-cell;\n            padding: calc( var(--thermal-gap) * .5 );\n        }\n\n        .column__label {\n            text-align: right;\n        }\n\n        .column__value {\n        \n        }\n\n        .input_wrapper {\n\n            background: var( --thermal-background );\n\n            width: 200px;\n            padding: calc( var( --thermal-gap ) / 2 );\n\n            border-radius: var( --thermal-radius );\n        \n        }\n\n        input {\n\n            font-size: var(--thermal-fs);\n            width: 120px;\n            text-align: right;\n            border: 0;\n            border-bottom: 1px var(--thermal-border-style)var( --thermal-slate-light );\n            background: transparent;\n            color: var( --thermal-foreground );\n\n            -moz-appearance: textfield;\n\n            &:focus {\n                outline: 0;\n                border-bottom: 1px var(--thermal-border-style)var( --thermal-primary );\n            }\n        \n        }\n\n        select, option, input {\n            font-size: var(--thermal-fs);\n            color: var( --thermal-foreground );\n            background: var( --thermal-background );\n            border: var(--thermal-border-width) var(--thermal-border-style) var( --thermal-slate-light );\n            border-radius: var( --thermal-radius );\n        }\n\n\n\n        .result {\n\n            padding: calc(var(--thermal-gap) * .7);\n            border: var(--thermal-border-width) var(--thermal-border-style) var( --thermal-slate );\n            border-radius: var( --thermal-radius );\n            text-align: center;\n\n            & > p {\n                margin: 0;\n                padding: calc( var( --thermal-gap ) * .25 );\n            }\n\n        }\n\n        .result_value {\n            font-weight: bold;\n            font-size: calc( var(--thermal-fs) * 1.2 )\n        }\n\n        .result_label {\n        }\n\n        .result_comment {\n            font-size: calc( var(--thermal-fs) * .8 )\n        }\n\n        .tabindex {\n            border-radius: var( --thermal-radius );\n            &:focus {\n                outline: 3px var(--thermal-border-style)var(--thermal-primary);\n            }\n        }\n\n\n    `;\n\n\n    protected renderNumberField(\n        inputRef: Ref<HTMLInputElement>,\n        id: \"temperature\" | \"v\" | \"ha\",\n        label: string,\n        unit: string | ReturnType<typeof html> | typeof nothing,\n        value?: number,\n        min?: number,\n        max?: number,\n        step?: number,\n        hint?: string\n    ) {\n\n        const u = typeof unit === \"string\"\n            ? unsafeHTML(unit)\n            : unit;\n\n        return html`\n            <div class=\"field\">\n\n                <div class=\"column column__label\">\n                    <label for=${id}>\n                        ${label}\n                    </label>\n                </div>\n                <div class=\"column column__value\">\n\n                    <div class=\"input_wrapper\">\n                        <input \n                            ${ref(inputRef)} \n                            id=${id}\n                            name=${id}\n                            value=${ifDefined(value)}\n                            min=${ifDefined(min)}\n                            max=${ifDefined(max)}\n                            step=${ifDefined(step)}\n                            type=\"number\"\n                            @blur=${(event: InputEvent) => {\n\n                const target = event.target as HTMLInputElement;\n\n                const value = target.value.trim();\n\n                if (value === \"\" || value === undefined || value === null) {\n                    this[id] = undefined;\n                } else {\n                    this[id] = parseFloat(target.value);\n                }\n\n            }}\n                        ></input>\n                        <span>${u}</span>\n                    </div>\n\n                    ${hint\n                ? html`<label for=${id}>${hint}</label>`\n                : nothing\n            }\n\n                </div>\n\n            </div>\n\n            \n        `;\n\n    }\n\n    protected renderResult(\n        apparentTemperature: number,\n        temperature: number\n    ) {\n\n        const diff = apparentTemperature - temperature;\n\n        const prop = {\n            diff: Math.abs(diff).toFixed(2),\n            app: apparentTemperature.toFixed(2),\n            t: temperature\n        };\n\n        const summary = t(T.apparenttemperatureverbose, prop);\n\n        const comment = diff < 0\n            ? t(T.youfeelcolder, prop)\n            : t(T.youfeelwarmer, prop);\n\n        const result = apparentTemperature.toFixed(2);\n\n        return html`<div class=\"result\">\n\n            <p class=\"result_label\">${t(T.apparenttemperature)}</p>\n\n            <p class=\"result_value\">\n                ${result} °C\n            </p>\n\n            <p class=\"result_comment\">${summary}</p>\n\n            <p class=\"result_comment\">${comment}</p>\n        \n        </div>`;\n\n\n    }\n\n\n    protected render() {\n        return html`\n            <thermal-app \n                label=${t(T.apparenttemperature)} \n                author=\"LabIR Edu\" \n                license=\"CC BY-SA 4.0\"\n            >\n\n                <thermal-dialog label=${t(T.info)} slot=\"bar-pre\">\n                    <thermal-btn slot=\"invoker\">${t(T.info)}</thermal-btn>\n                    <div slot=\"content\">\n                        ${unsafeHTML(t(T.apparenttemperaturehint, { href: \"https://en.wikipedia.org/wiki/Wind_chill#Australian_apparent_temperature\" }))}\n                    </div>\n                </thermal-dialog>\n\n                ${this.t !== undefined || this.v !== undefined || this.ha !== undefined\n                ? html`<thermal-btn \n                slot=\"bar-pre\"\n                @click=${() => {\n                    this.temperature = undefined;\n                    this.ha = undefined;\n                    this.ta = undefined;\n                    this.v = undefined;\n                }}>Reset</thermal-btn>`\n                : nothing\n            }\n\n\n                <section class=\"table\">\n\n                ${this.renderNumberField(\n                this.tRef,\n                \"temperature\",\n                t(T.airtemperature),\n                \"°C\",\n                this.temperature,\n                -273.15,\n                100,\n                0.1\n            )}\n\n                ${this.renderNumberField(\n                this.vRef,\n                \"v\",\n                t(T.windspeed),\n                html`<select \n                    @change=${(event: InputEvent) => {\n                        const target = event.target as HTMLSelectElement;\n                        const value = target.value as VUNIT;\n                        this.vunits = value;\n                    }} \n                    value=${this.vunits}\n                    ${ref(this.vunitsRef)}\n                >\n                    <option value=\"mps\">m/s</option>\n                    <option value=\"kph\">km/h</option>\n                </select>`,\n                this.v,\n                0,\n                undefined,\n                0.1\n            )}\n\n                ${this.renderNumberField(\n                this.haRef,\n                \"ha\",\n                t(T.relativeairhumidity),\n                \"%\",\n                this.ha,\n                0,\n                100,\n                0.1\n            )}\n\n                </section>\n                <div  class=\"tabindex\" tabindex=\"0\">\n                ${this.ta !== undefined && this.temperature !== undefined\n                ? this.renderResult(this.ta, this.temperature)\n                : nothing\n            }\n                </div>\n                \n\n            </thermal-app>\n        `\n    }\n\n}","import { css, html } from \"lit\";\nimport { AbstractSingleFileAppElement } from \"./AbstractSingleFileApp\";\n\n/**\n * Places left and right slot content beside the canvas, sized to their content.\n * Top, bottom and unnamed slot content span the full width.\n */\nexport class ThermalSlottedAppElement extends AbstractSingleFileAppElement {\n\n    static styles = css`\n    \n        :host {\n            display: grid;\n            grid-template-columns: auto minmax(0, 1fr) auto;\n            grid-template-areas:\n                \"left top right\"\n                \"left viewer right\"\n                \"left bottom right\"\n                \"extra extra extra\";\n            align-items: start;\n        }\n\n        slot {\n            display: block;\n            min-width: 0;\n            grid-area: extra;\n        }\n\n        slot[name=\"top\"] {\n            grid-area: top;\n        }\n\n        slot[name=\"left\"] {\n            grid-area: left;\n        }\n\n        file-canvas {\n            grid-area: viewer;\n            min-width: 0;\n        }\n\n        slot[name=\"right\"] {\n            grid-area: right;\n        }\n\n        slot[name=\"bottom\"] {\n            grid-area: bottom;\n        }\n    \n    `;\n\n    \n    render() {\n        return html`\n            <slot name=\"top\"></slot>\n            <slot name=\"left\"></slot>\n            <file-canvas></file-canvas>\n            <slot name=\"right\"></slot>\n            <slot name=\"bottom\"></slot>\n            <slot></slot>\n        `;\n    }\n\n}\n\n","import type { ThermalUnit} from \"@labirthermal/core\";\nimport { TimeFormat } from \"@labirthermal/core\";\nimport { t } from \"i18next\";\nimport { css, html, nothing } from \"lit\";\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\nimport { AbstractFileConsumer } from \"../../hierarchy/consumers/AbstractFileConsumer\";\nimport { T } from \"../../translations/Languages\";\nimport { managerUnitContext } from \"../../controllers/ManagerController\";\nimport { consume } from \"@lit/context\";\nimport { state } from \"lit/decorators.js\";\n\nexport class FileInfoButton extends AbstractFileConsumer {\n\n    protected onFileLoaded(): void { }\n\n    public onInstanceCreated(): void { }\n\n    public onFailure(): void { }\n\n    /** Consume the current unit, because we need this component to rerender whenever the unit changes. */\n    @state()\n    @consume({ context: managerUnitContext, subscribe: true })\n    private unit!: ThermalUnit;\n\n    static styles = css`\n\n        table {\n            width: 100%;\n        }\n\n\n\n        td {\n            padding: calc( var( --thermal-gap ) * .5 ) 0;\n        }\n\n\n        tr:not(:last-child) {\n            td {\n                border-bottom: var(--thermal-border-width) solid var( --thermal-slate );\n            }\n        }\n\n        .small,\n        small {\n            font-size: calc( var( --thermal-fs-sm ) * .8 );\n        }\n\n        .opaque {\n            opacity: .5;\n        }\n\n        h2 {\n            font-size: calc( var( --thermal-fs ) * 1.4 );\n        }\n\n        h3 {\n            font-size: var( --thermal-fs-small );\n            margin: .2rem 0 .1rem 0;\n            padding: 0;\n            font-weight: normal;    \n        }\n\n        ul {\n            margin: 0;\n            padding: 0;\n            padding-left: var( --thermal-fs-small );\n        }\n\n        a {\n            color: var( --thermal-primary );\n        }\n\n        .download {\n            width: var( --thermal-fs );\n            display: inline-block;\n            margin-left: var( --thermal-gap );\n            transition: color .2s ease-in-out;\n\n            &:hover {\n                color: var( --thermal-foreground );\n            }\n        }\n    \n    `;\n\n    protected renderRow(\n        label: string,\n        value: string\n    ) {\n        return `<tr>\n            <td style=\"width: 110px\">${label}</td>\n            <td>${value}</td>\n        </tr>`;\n    }\n\n    protected renderNumericalRow(\n        label: string,\n        value: number,\n        fixed: number = 4,\n        unit?: string\n    ) {\n\n        const val = value.toFixed(fixed);\n        const output = unit !== undefined\n            ? val + \" \" + unit\n            : val;\n\n        return this.renderRow(label, output);\n    }\n\n    protected renderDownloadRow(\n        label: string,\n        text: string,\n        href: string,\n        title: string\n    ) {\n        return this.renderRow(\n            label,\n            `<span>${text}</span>\n            <a href=${href} target=\"_blank\" title=\"${title}\" class=\"download\">\n                <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" class=\"size-6\">\n                    <path fill-rule=\"evenodd\" d=\"M12 2.25a.75.75 0 0 1 .75.75v11.69l3.22-3.22a.75.75 0 1 1 1.06 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0l-4.5-4.5a.75.75 0 1 1 1.06-1.06l3.22 3.22V3a.75.75 0 0 1 .75-.75Zm-9 13.5a.75.75 0 0 1 .75.75v2.25a1.5 1.5 0 0 0 1.5 1.5h13.5a1.5 1.5 0 0 0 1.5-1.5V16.5a.75.75 0 0 1 1.5 0v2.25a3 3 0 0 1-3 3H5.25a3 3 0 0 1-3-3V16.5a.75.75 0 0 1 .75-.75Z\" clip-rule=\"evenodd\" />\n                </svg>\n            </a>`\n        );\n    }\n\n    protected render(): unknown {\n\n        if (!this.file) {\n            return nothing;\n        }\n\n        return html`\n            <thermal-dialog label=${t(T.fileinfo)}>\n                <slot name=\"invoker\" slot=\"invoker\">\n                    <thermal-btn\n                        tooltip=${t(T.fileinfo)}\n                        icon=\"info\"\n                        iconStyle=\"mini\"\n                    >\n                    </thermal-btn>\n                </slot>\n                <div slot=\"content\">\n\n                    <table>\n\n                        ${unsafeHTML(this.renderRow(t(T.thermalfilename), this.file.fileName))}\n\n                        ${unsafeHTML(this.renderDownloadRow(\n            t(T.thermalfileurl),\n            this.file.thermalUrl,\n            this.file.thermalUrl,\n            t(T.thermalfiledownload)\n        ))}\n\n                        ${this.file.visibleUrl\n                ? unsafeHTML(this.renderDownloadRow(\n                    t(T.visiblefileurl),\n                    this.file.visibleUrl,\n                    this.file.visibleUrl,\n                    t(T.visiblefiledownload)\n                ))\n                : nothing\n            }\n\n                        ${unsafeHTML(this.renderRow(\n                t(T.time),\n                TimeFormat.human(this.file.timestamp)\n            ))}\n\n                        ${unsafeHTML(this.renderNumericalRow(\n                t(T.duration),\n                this.file.duration,\n                0,\n                \"ms\"\n            ))}\n\n                        ${unsafeHTML(this.renderRow(\n                t(T.resolution),\n                `${this.file.width} x ${this.file.height}<small class=\"opaque\">${this.file.pixels.length} pixels</small>`\n            ))}\n\n                        ${unsafeHTML(this.renderNumericalRow(\n                t(T.bytesize),\n                this.file.bytesize,\n                0\n            ))}\n                        \n                        ${unsafeHTML(this.renderNumericalRow(\n                t(T.minimaltemperature),\n                this.managerController.toCurrentUnit(this.file.min),\n                2,\n                this.managerController.currentUnit.symbol\n            ))}\n\n                        ${unsafeHTML(this.renderNumericalRow(\n                t(T.maximaltemperature),\n                this.managerController.toCurrentUnit(this.file.max),\n                2,\n                this.managerController.currentUnit.symbol\n            ))}\n\n                        \n\n                    </table>\n\n                    <h2>${t(T.filetype)}</h2>\n                    <table>\n                    ${unsafeHTML(this.renderRow(\n                t(T.type),\n                this.file.reader.parser.name\n            ))}\n                    ${unsafeHTML(this.renderRow(\n                t(T.description),\n                this.file.reader.parser.description\n            ))}\n\n                    <tr>\n                        <td>${t(T.supporteddevices)}</td>\n                        <td><ul>${this.file.reader.parser.devices.map(device => html`<li>\n                            <h3><a href=\"${device.deviceUrl}\" target=\"_blank\">${device.deviceName}</a></h3>\n                            <div class=\"small\">${device.deviceDescription}</div>\n                            <div class=\"small\">Manufactured by <a href=\"${device.manufacturerUrl}\" target=\"_blank\">${device.manufacturer}</a></div>\n                        </li>` )}</ul></td>\n                    </tr>\n                    </table>\n                </div>\n            </thermal-dialog>\n        `\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"file-info-button\": FileInfoButton;\n    }\n}\n","import { css, nothing } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { AbstractFileConsumer } from \"../../hierarchy/consumers/AbstractFileConsumer\";\n\nexport class FileLabelElement extends AbstractFileConsumer {\n\n    @property({ type: String })\n    public label?: string;\n\n    public onInstanceCreated(): void { }\n\n    public onFailure(): void { }\n\n    static styles = css`\n        :host {\n            display: contents;\n        }\n\n    `;\n\n    protected render(): unknown {\n\n        if ( ! this.file ) {\n            return nothing;\n        }\n\n        return this.file.fileName;\n\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"file-label\": FileLabelElement;\n    }\n}\n","import type { ThermalFileInstance } from \"@labirthermal/core\";\nimport { consume } from \"@lit/context\";\nimport { format } from \"date-fns\";\nimport { t } from \"i18next\";\nimport type { PropertyValues } from \"lit\";\nimport { css, html, nothing } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport type { Ref} from \"lit/directives/ref.js\";\nimport { createRef, ref } from \"lit/directives/ref.js\";\nimport { AbstractFileConsumer } from \"../../hierarchy/consumers/AbstractFileConsumer\";\nimport type { FileControllerCurrentFrameType, FileControllerDurationContextType} from \"../../controllers/FileController\";\nimport { fileDurationContext, fileMayStopContext, fileCurrentFrameContext, filePlayingContext, fileTimeCursorContext } from \"../../controllers/FileController\";\nimport { T } from \"../../translations/Languages\";\nimport type { Tick} from \"../../utils/timelineTicks\";\nimport { calculateTicks, renderTicks, ticksCss } from \"../../utils/timelineTicks\";\n\nexport class FileTimelineElement extends AbstractFileConsumer {\n\n    @consume({ context: filePlayingContext, subscribe: true })\n    @state()\n    protected playing: boolean = false;\n\n    @consume({ context: fileCurrentFrameContext, subscribe: true })\n    @state()\n    protected currentFrame?: FileControllerCurrentFrameType;\n\n    @consume({ context: fileDurationContext, subscribe: true })\n    @state()\n    protected duration?: FileControllerDurationContextType;\n\n    @consume({ context: fileMayStopContext, subscribe: true })\n    @state()\n    protected mayStop: boolean = true;\n\n    @consume({ context: fileTimeCursorContext, subscribe: true })\n    protected cursor: typeof fileTimeCursorContext[\"__context__\"];\n\n    protected timelineRef: Ref<HTMLDivElement> = createRef()\n    protected barRef: Ref<HTMLDivElement> = createRef();\n    protected containerRef: Ref<HTMLElement> = createRef();\n\n    protected observer?: ResizeObserver;\n\n    private observedContainer?: HTMLElement;\n\n    /**\n     * Hides the playback controls when present. Defaults to `false` and\n     * reflects as a boolean attribute. Replaces `hasPlayButton` with inverted meaning.\n     */\n    @property({ type: Boolean, reflect: true, attribute: \"disable-play-button\" })\n    public disablePlayButton: boolean = false;\n\n    /**\n     * Hides the frame information when present. Defaults to `false` and\n     * reflects as a boolean attribute. Replaces `hasInfo` with inverted meaning.\n     */\n    @property({ type: Boolean, reflect: true, attribute: \"disable-info\" })\n    public disableInfo: boolean = false;\n\n    @state()\n    protected collapsed: boolean = false;\n\n    public static collapseWidth = 500;\n\n    @state()\n    protected ticks: Tick[] = [];\n\n    @state()\n    protected pointerMs?: number;\n\n    public onInstanceCreated(instance: ThermalFileInstance): void {\n        if (this.containerRef.value) {\n            this.ticks = calculateTicks(this.containerRef.value.clientWidth, instance.duration);\n        }\n\n    }\n    public onFailure(\n        // error: ThermalFileFailure\n    ): void {\n        this.file?.timeline.removeListener(this.UUID);\n    }\n\n    connectedCallback(): void {\n        super.connectedCallback();\n        this.requestUpdate();\n    }\n\n    disconnectedCallback(): void {\n        this.observer?.disconnect();\n        this.observer = undefined;\n        this.observedContainer = undefined;\n        super.disconnectedCallback();\n    }\n\n    update(changedProperties: PropertyValues): void {\n        super.update(changedProperties);\n\n        const container = this.containerRef.value;\n        if (container === this.observedContainer) {\n            return;\n        }\n\n        this.observer?.disconnect();\n        this.observer = undefined;\n        this.observedContainer = undefined;\n\n        if (!this.isConnected || !container) {\n            return;\n        }\n\n        this.observedContainer = container;\n        const observer = new ResizeObserver((entries) => {\n            if (!this.isConnected || this.observer !== observer) {\n                return;\n            }\n\n            const entry = entries.find(entry => entry.target === container);\n            if (!entry) {\n                return;\n            }\n\n            if (this.file) {\n                this.ticks = calculateTicks(entry.contentRect.width, this.file.duration);\n            }\n            this.collapsed = entry.contentRect.width < FileTimelineElement.collapseWidth;\n        });\n        this.observer = observer;\n        observer.observe(container);\n    }\n\n\n    /** Handlers */\n\n\n    /** Handle playback buttons */\n    protected handlePlayButtonClick() {\n\n        if (this.playing === true && this.mayStop === false) {\n            return;\n        }\n\n        if (this.playing) {\n            this.file?.timeline.stop();\n        } else {\n            this.file?.timeline.play();\n        }\n\n    }\n\n    handleBarClick(event: MouseEvent) {\n\n        event.preventDefault();\n\n        if (this.mayStop === false) {\n            return;\n        }\n\n        const eventValues = this.getValueFromEvent(event);\n\n        if (eventValues && this.file) {\n            this.file.timeline.setValueByPercent(eventValues.percent);\n        }\n    }\n\n    /** Take a MouseEvent on `this.timelineRef` and calculate the percentage out of it. */\n    protected getValueFromEvent(event: MouseEvent) {\n\n        if (this.timelineRef.value && this.file) {\n            const rect = this.timelineRef.value.getBoundingClientRect();\n            if (rect.width === 0) {\n                return;\n            }\n            const x = event.clientX - rect.left;\n            const percent = Math.max(0, Math.min(100, x / rect.width * 100));\n            const ms = this.file.duration * (percent / 100);\n            return {\n                percent,\n                ms\n            };\n        }\n\n    }\n\n    handleBarEnter(event: MouseEvent) {\n\n        const eventValues = this.getValueFromEvent(event);\n\n        if (eventValues) {\n            this.pointerMs = eventValues.ms;\n        }\n\n        if (eventValues) {\n            this.fileController.setTimeCursorPercentage(eventValues.percent);\n        }\n    }\n\n    handleBarHover(event: MouseEvent) {\n\n        event.preventDefault();\n\n        const eventValues = this.getValueFromEvent(event);\n\n        if (eventValues) {\n            this.pointerMs = eventValues.ms;\n        }\n\n        if (eventValues) {\n            this.fileController.setTimeCursorPercentage(eventValues.percent);\n        }\n    }\n\n    handleBarMouseLeave() {\n        this.fileController.setTimeCursorPercentage(undefined);\n        this.pointerMs = undefined;\n    }\n\n    static styles = css`\n    \n        .container {\n\n            padding-top: calc( var( --thermal-gap ) * .2 );\n\n            width: 100%;\n\n            display: flex;\n            justify-content: space-between;\n            align-items: center;\n            gap: calc( var( --thermal-gap ) * .5 );\n\n            color: var( --thermal-foreground );\n\n        }\n\n        .cursor {\n            width: 70px;\n        }\n\n        .small {\n            font-size: calc( var( --thermal-fs ) * .7 );\n            color: var( --thermal-foreground );\n        }\n\n        .real {\n            display: flex;\n            gap: var( --thermal-fs-small );\n            align-items: center;\n            padding-top: 5px;\n            justify-content: space-between;\n            width: 100%;\n\n            .label { opacity: .5; }\n        }\n\n        .real.collapsed {\n            flex-direction: column;\n            align-items: flex-start;\n        }\n\n        .inline {\n            white-space: nowrap;\n        }\n\n        .timeline {\n            flex-grow: 1;\n            cursor: pointer;\n        }\n\n        .timeline-bar {\n            width: 100%;\n            height: var( --thermal-fs );\n            background: var( --thermal-slate );\n            transition: background-color .2s ease-in-out;\n            position: relative;\n        }\n\n        .timeline-marks {\n            width: 100%;\n        }\n\n        .mark {\n            background: red;\n            height: 5px;\n            position: relative;\n        }\n\n        .bar {\n            height: 100%;\n            background: var( --thermal-primary-dark );\n            content: \"\";\n            border-right: 1px solid var( --thermal-foreground );\n            transition: background-color .3s ease-in-out;\n            &:hover {\n                background: var(--thermal-primary);\n            }\n        }\n\n        .mayNot {\n            opacity: .5;\n            cursor: not-allowed;\n        }\n\n        .pointer {\n            position: absolute;\n            width: 1px;\n            background: var( --thermal-background );\n            height: 100%;\n            top: 0;\n        }\n\n        ${ticksCss}\n\n\n        .controls {\n\n            display: flex;\n            align-items: stretch;\n            justify-content: center;\n            gap: 5px;\n\n            padding-top: 5px;\n\n        }\n\n        .container.collapsed .controls {\n            flex-wrap: wrap;\n        }\n\n        .chrome {\n            width: 1em;\n            color: var(--thermal-primary-dark);\n            transition: all .3s ease-in-out;\n            cursor: pointer;\n            &:hover {\n                color: var(--thermal-primary);\n            }\n        }\n    \n    `;\n\n\n\n    private renderControls(\n        file: ThermalFileInstance,\n        disabled: boolean,\n        playButtonClasses: { [key: string]: boolean }\n    ): unknown {\n\n        return html`<nav class=\"controls\">\n\n    <thermal-btn \n        ?disabled=${disabled}\n        @click=${() => {\n                file.timeline.prev();\n            }}\n    >${t(T.prev)}</thermal-btn>\n\n\n    <thermal-btn \n        class=\"${classMap(playButtonClasses)}\" \n        @click=${this.handlePlayButtonClick.bind(this)}\n        icon=\"${this.playing ? \"pause\" : \"play\"}\"\n        iconStyle=\"solid\"\n        ?disabled=${disabled}\n    ></thermal-btn>\n\n    <thermal-btn \n        @click=${() => file.timeline.next()}\n        ?disabled=${disabled}\n    >${t(T.next)}</thermal-btn>\n\n    <thermal-btn \n        @click=${() => file.timeline.setRelativeTime(0)}\n        ?disabled=${disabled}\n    >${t(T.back)}</thermal-btn>\n\n    <file-playback-speed-dropdown enabled=\"${this.mayStop ? \"on\" : \"off\"}\" class=\"item\"></file-playback-speed-dropdown>\n\n</nav>`\n\n    }\n\n\n    protected render(): unknown {\n\n        const file = this.file as ThermalFileInstance;\n\n        if (file === undefined) {\n            return nothing;\n        }\n\n        else if (file.duration === 0) {\n            return nothing;\n        }\n\n        const containerClasses = {\n            container: true,\n            collapsed: this.collapsed\n        }\n\n        const mayClasses = {\n            may: this.mayStop === true,\n            mayNot: this.mayStop === false\n        }\n\n        const playButtonClasses = {\n            item: true,\n            button: true,\n            playback: true,\n            ...mayClasses\n        }\n\n        const barClasses = {\n            item: true,\n            timeline: true,\n            ...mayClasses\n        }\n\n        const disabled = this.mayStop === false;\n\n        return html`\n<section class=\"${classMap(containerClasses)}\" ${ref(this.containerRef)}>\n\n    <aside class=\"ticks-horizontal-indent\">\n\n        <notation-timeline></notation-timeline>\n\n        <div class=\"${classMap(barClasses)}\"  ${ref(this.timelineRef)}>\n\n            <div \n                class=\"timeline-bar\" \n                @click=${this.handleBarClick}\n                @mouseenter=${this.handleBarEnter.bind(this)}\n                @mousemove=${this.handleBarHover} \n                @mouseleave=${this.handleBarMouseLeave.bind(this)}\n            >\n                <div class=\"bar\" data-video-rerender style=\"width: ${this.currentFrame ? this.currentFrame.percentage : 0}%\" ${ref(this.barRef)}></div>\n                    ${this.cursor !== undefined ? html`<div class=\"pointer\" style=\"left: ${this.cursor}%\"></div>` : \"\"}\n                </div>\n\n            </div>\n\n\n${(this.currentFrame)\n                ? renderTicks(\n                    file.duration,\n                    this.ticks,\n                    this.currentFrame.ms,\n                    this.pointerMs\n                )\n                : nothing}\n\n\n${this.disablePlayButton === false\n                ? this.renderControls(\n                    file,\n                    disabled,\n                    playButtonClasses\n                )\n                : nothing}\n\n    </aside>\n\n</section>\n\n\n\n${this.currentFrame !== undefined && this.disableInfo === false\n                ? html`<div class=\"small real ${this.collapsed ? \"collapsed\" : \"\"}\">\n        <div>\n            <span class=\"label\">${t(T.date)}:</span> \n            <span class=\"inline\" data-video-dynamic>${format(this.currentFrame.absolute, \"d. L. y\")}</span>\n        </div>\n        <div>\n            <span class=\"label\">${t(T.time)}:</span> \n            <span class=\"inline\" data-video-dynamic>${format(this.currentFrame.absolute, \"H'h' mm'm' ss:SSS\")}</span>\n        </div>\n        <div>\n            <span class=\"label\">${t(T.frame)}:</span> \n            <span class=\"inline\" data-video-dynamic>${this.currentFrame.index + 1} / ${this.file?.frameCount}</span>\n        </div>\n    </div>`\n                : nothing}\n    `;\n    }\n}\n\nexport type TimelineHighlightData = {\n    fromMs: number,\n    toMs: number,\n    text: string\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"file-timeline\": FileTimelineElement;\n    }\n}\n","import type { ThermalFileInstance } from \"@labirthermal/core\";\nimport type { Quality } from \"mediabunny\";\n\nexport enum VideoExportSkin {\n    LIGHT = \"light\",\n    DARK = \"dark\",\n    SOLARIZED = \"solarized\"\n}\n\nexport type SingleVideoRenderProps = {\n\n    hasHistogram: boolean,\n    hasThermalScale: boolean,\n    hasAnalysis: boolean,\n    hasTimeline: boolean,\n    isVertical: boolean,\n\n    previewScale: number;\n    autoScale: boolean;\n\n    exportFrameWidth: number,\n    exportFramePadding: number,\n    exportFrameGap: number,\n    exportGraphHeight: number,\n\n    fileName: string,\n    mp4Quality: Quality,\n\n    skin: VideoExportSkin\n}\n\nexport enum RecordingPhase {\n    IDLE,\n    RECORDING,\n    ENCODING,\n    CLEANUP\n}\n\nexport interface ISingleVideoExportElement {\n\n    recordingPhase: RecordingPhase;\n    recordingPhaseProgress: number;\n\n    setRecordingPhase( phase: RecordingPhase ): void;\n    setRecordingPhaseProgress( progress: number ): void;\n\n    get innerFile(): ThermalFileInstance | undefined;\n    get exportedElement(): HTMLElement | undefined;\n\n    renderProps: SingleVideoRenderProps;\n\n    setHasHistogram( value: boolean ): void;\n    setHasThermalScale( value: boolean ): void;\n    setHasTimeline( value: boolean ): void;\n    setHasAnalysis( value: boolean ): void;\n    setIsVertical( value: boolean ): void;\n\n    setExportFrameWidth( value: number ): void;\n    setExportFramePadding( value: number ): void;\n    setExportFrameGap( value: number ): void;\n    setExportGraphHeight( value: number ): void;\n    \n    setFileName( value: string ): void;\n    setMp4Quality( value: Quality ): void;\n    setSkin( value: VideoExportSkin ): void;\n\n    setPreviewScale( value: number ): void;\n    setAutoScale( value: boolean ): void;\n\n}","import type { ThermalFileInstance } from \"@labirthermal/core\";\nimport { BufferTarget, Mp4OutputFormat, Output, VideoSample, VideoSampleSource } from \"mediabunny\";\nimport type { AbstractSingleVideoExport } from \"../AbstractSingleVideoExport\";\nimport { RecordingPhase } from \"../ISingleVideoExportElement\";\n\n/**\n * Atribut pro označení dynamických elementů, které se mění mezi framy.\n * Tyto elementy budou mít svůj textContent aktualizován z originálu.\n */\nexport const DYNAMIC_CONTENT_ATTRIBUTE = \"data-video-dynamic\";\n\n/**\n * Atribut pro označení SVG elementů, které se mění mezi framy.\n * Celý innerHTML SVG bude aktualizován z originálu.\n */\nexport const DYNAMIC_SVG_ATTRIBUTE = \"data-video-svg\";\n\n/**\n * Atribut pro označení elementů, jejichž styly se mění mezi framy.\n * Inline styly budou aktualizovány z originálu.\n */\nexport const DYNAMIC_STYLE_ATTRIBUTE = \"data-video-style\";\n\n/**\n * Atribut pro označení elementů, které se mají kompletně překreslit při každém framu.\n * Element včetně jeho stylů a potomků bude znovu naklonován z originálu.\n * Použij pro elementy, které jsou vytvářeny asynchronně nebo se dynamicky mění.\n */\nexport const DYNAMIC_RERENDER_ATTRIBUTE = \"data-video-rerender\";\n\n/**\n * Atribut pro označení elementů, které nemají být zahrnuty do exportu.\n * Tyto elementy budou odstraněny z klonu před exportem.\n */\nexport const IGNORE_ATTRIBUTE = \"data-video-ignore\";\n\nexport class VideoRecorder {\n\n    private muxingCanvas?: OffscreenCanvas;\n    private muxingContext?: OffscreenCanvasRenderingContext2D;\n\n    private readonly file: ThermalFileInstance;\n    private readonly exportedElement: HTMLElement;\n\n    // === Připravené struktury pro rychlý export ===\n    \n    /** SVG wrapper obsahující foreignObject s klonovaným DOM */\n    private preparedSvgWrapper?: SVGSVGElement;\n    \n    /** Klonovaný DOM element uvnitř foreignObject */\n    private preparedClone?: HTMLElement;\n    \n    /** Šířka exportu v pixelech */\n    private exportWidth: number = 0;\n    \n    /** Výška exportu v pixelech */\n    private exportHeight: number = 0;\n\n    /** Mapování: originální canvas -> <img> element v klonu */\n    private canvasToImageMap: Map<HTMLCanvasElement, HTMLImageElement> = new Map();\n\n    /** Mapování: originální dynamický element -> klonovaný element */\n    private dynamicElementMap: Map<Element, Element> = new Map();\n\n    /** Mapování: originální SVG -> klonované SVG (pro aktualizaci innerHTML) */\n    private dynamicSvgMap: Map<SVGElement, SVGElement> = new Map();\n\n    /** Mapování: originální element -> klonovaný element (pro kompletní překreslení) */\n    private rerenderMap: Map<Element, Element> = new Map();\n\n    /** Mapování: originální element -> klonovaný element (pro aktualizaci stylů) */\n    private dynamicStyleMap: Map<HTMLElement, HTMLElement> = new Map();\n\n    constructor(\n        private readonly app: AbstractSingleVideoExport\n    ) {\n        this.file = app.innerFile!;\n        this.exportedElement = app.exportedElement!;\n    }\n\n    private getMuxingCanvas(): OffscreenCanvas {\n\n        if (this.muxingCanvas) return this.muxingCanvas;\n\n        const bounds = this.exportedElement.getBoundingClientRect();\n\n        const canvas = new OffscreenCanvas(bounds.width, bounds.height);\n\n        this.muxingCanvas = canvas;\n\n        return this.muxingCanvas;\n\n    }\n\n    private getMuxingContext(): OffscreenCanvasRenderingContext2D {\n\n        if (this.muxingContext) return this.muxingContext;\n        if (this.muxingCanvas === undefined) this.getMuxingCanvas();\n        this.muxingContext = this.muxingCanvas!.getContext(\"2d\", { alpha: false })!;\n        \n        // Vypni interpolaci - zachovej pixelovaný vzhled\n        this.muxingContext.imageSmoothingEnabled = false;\n\n        return this.muxingContext;\n    }\n\n    // =======================================================================\n    // PŘÍPRAVA EXPORTU — volá se JEDNOU před začátkem renderování framů\n    // =======================================================================\n\n    /**\n     * Jednorázová příprava exportu:\n     * 1. Klonuje DOM (pouze jednou)\n     * 2. Inlinuje computed styles do klonu\n     * 3. Embeduje obrázky jako data URI\n     * 4. Vytváří SVG wrapper s foreignObject\n     * 5. Mapuje dynamické elementy a canvasy pro rychlou aktualizaci\n     */\n    private async prepareExport(): Promise<void> {\n\n        const element = this.exportedElement;\n        this.exportWidth = element.clientWidth;\n        this.exportHeight = element.clientHeight;\n\n        console.log(\"[VideoRecorder] Preparing export...\", this.exportWidth, \"x\", this.exportHeight);\n\n        // 1. Klonuj DOM (pouze jednou!)\n        const clone = element.cloneNode(true) as HTMLElement;\n\n        // 2. Inlinuj computed styles z originálu do klonu\n        console.log(\"[VideoRecorder] Inlining styles...\");\n        this.inlineStylesRecursive(element, clone);\n\n        // 2.5 Zploštění custom elementů — nahradí je za statický HTML\n        console.log(\"[VideoRecorder] Flattening custom elements...\");\n        this.flattenCustomElements(element, clone);\n\n        // 3. Odstraň elementy s data-video-ignore (po flatteningu, aby se našly i v shadow DOM)\n        console.log(\"[VideoRecorder] Removing ignored elements...\");\n        this.removeIgnoredElements(clone);\n\n        // 3. Embeduj obrázky jako data URI\n        console.log(\"[VideoRecorder] Embedding images...\");\n        await this.embedImages(clone);\n\n        // 3.5. Odstran Lit komentare a oprav xmlns\n        console.log(\"[VideoRecorder] Cleaning up clone...\");\n        this.removeLitComments(clone);\n        this.ensureXmlnsAttributes(clone);\n\n        // 4. Vytvoř mapování canvasů (všechny canvasy automaticky)\n        console.log(\"[VideoRecorder] Mapping canvases...\");\n        this.createCanvasMap(element, clone);\n\n        // 5. Vytvoř mapování dynamických elementů\n        console.log(\"[VideoRecorder] Mapping dynamic elements...\");\n        this.createDynamicElementMap(element, clone);\n\n        // 5.1 Vytvoř mapování dynamických SVG\n        console.log(\"[VideoRecorder] Mapping dynamic SVGs...\");\n        this.createDynamicSvgMap(element, clone);\n\n        // 5.2 Vytvoř mapování elementů s dynamickými styly\n        console.log(\"[VideoRecorder] Mapping dynamic style elements...\");\n        this.createDynamicStyleMap(element, clone);\n\n        // 5.3 Vytvoř mapování elementů pro kompletní překreslení\n        console.log(\"[VideoRecorder] Mapping rerender elements...\");\n        this.createRerenderMap(element, clone);\n\n        // 6. Připrav SVG wrapper\n        console.log(\"[VideoRecorder] Creating SVG wrapper...\");\n        const svg = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n        svg.setAttribute(\"xmlns\", \"http://www.w3.org/2000/svg\");\n        svg.setAttribute(\"width\", String(this.exportWidth));\n        svg.setAttribute(\"height\", String(this.exportHeight));\n\n        const foreignObject = document.createElementNS(\"http://www.w3.org/2000/svg\", \"foreignObject\");\n        foreignObject.setAttribute(\"width\", \"100%\");\n        foreignObject.setAttribute(\"height\", \"100%\");\n        foreignObject.setAttribute(\"x\", \"0\");\n        foreignObject.setAttribute(\"y\", \"0\");\n\n        // Nastav XHTML namespace pro HTML obsah\n        clone.setAttribute(\"xmlns\", \"http://www.w3.org/1999/xhtml\");\n        \n        foreignObject.appendChild(clone);\n        svg.appendChild(foreignObject);\n\n        this.preparedSvgWrapper = svg;\n        this.preparedClone = clone;\n\n        console.log(\"[VideoRecorder] Export prepared. Canvas count:\", this.canvasToImageMap.size, \"Dynamic elements:\", this.dynamicElementMap.size, \"Rerender elements:\", this.rerenderMap.size);\n    }\n\n    /**\n     * Odstraní elementy s atributem data-video-ignore z klonu.\n     * Tyto elementy nebudou zahrnuty do exportu.\n     */\n    private removeIgnoredElements(clone: Element): void {\n        const ignored = clone.querySelectorAll(`[${IGNORE_ATTRIBUTE}]`);\n        console.log(\"[VideoRecorder] Removing ignored elements:\", ignored.length);\n        \n        for (const el of ignored) {\n            el.parentNode?.removeChild(el);\n        }\n    }\n\n    /**\n     * Rekurzivně inlinuje computed styles z originálu do klonu.\n     * Kopíruje pouze důležité CSS vlastnosti pro zrychlení.\n     */\n    private inlineStylesRecursive(original: Element, clone: Element): void {\n\n        if (!(original instanceof HTMLElement) || !(clone instanceof HTMLElement)) {\n            return;\n        }\n\n        const computed = getComputedStyle(original);\n\n        // Seznam důležitých CSS vlastností k inlinování\n        const importantProperties = [\n            // Layout\n            \"display\", \"position\", \"top\", \"left\", \"right\", \"bottom\",\n            \"width\", \"height\", \"min-width\", \"min-height\", \"max-width\", \"max-height\",\n            \"margin\", \"margin-top\", \"margin-right\", \"margin-bottom\", \"margin-left\",\n            \"padding\", \"padding-top\", \"padding-right\", \"padding-bottom\", \"padding-left\",\n            \"box-sizing\", \"overflow\", \"overflow-x\", \"overflow-y\",\n            \n            // Flexbox\n            \"flex\", \"flex-direction\", \"flex-wrap\", \"justify-content\", \"align-items\", \"align-content\",\n            \"flex-grow\", \"flex-shrink\", \"flex-basis\", \"order\", \"gap\",\n            \n            // Grid\n            \"grid\", \"grid-template-columns\", \"grid-template-rows\", \"grid-gap\", \"grid-column\", \"grid-row\",\n            \n            // Background\n            \"background\", \"background-color\", \"background-image\", \"background-size\", \"background-position\",\n            \n            // Border\n            \"border\", \"border-width\", \"border-style\", \"border-color\", \"border-radius\",\n            \"border-top\", \"border-right\", \"border-bottom\", \"border-left\",\n            \n            // Text\n            \"color\", \"font\", \"font-family\", \"font-size\", \"font-weight\", \"font-style\",\n            \"line-height\", \"text-align\", \"text-decoration\", \"text-transform\", \"white-space\",\n            \"letter-spacing\", \"word-spacing\",\n            \n            // Visual\n            \"opacity\", \"visibility\", \"z-index\", \"transform\", \"box-shadow\", \"text-shadow\",\n            \n            // Table\n            \"table-layout\", \"border-collapse\", \"border-spacing\"\n        ];\n\n        for (const prop of importantProperties) {\n            const value = computed.getPropertyValue(prop);\n            if (value && value !== \"none\" && value !== \"normal\" && value !== \"auto\") {\n                clone.style.setProperty(prop, value);\n            }\n        }\n\n        // Rekurzivně pro děti\n        const origChildren = Array.from(original.children);\n        const cloneChildren = Array.from(clone.children);\n\n        for (let i = 0; i < origChildren.length && i < cloneChildren.length; i++) {\n            this.inlineStylesRecursive(origChildren[i], cloneChildren[i]);\n        }\n    }\n\n    /**\n     * Zploštění custom elementů — nahradí custom elementy za statický HTML.\n     * Tím se zabrání spouštění jejich lifecycle (connectedCallback atd.)\n     * při vložení klonu do dokumentu.\n     * \n     * DŮLEŽITÉ: Canvasy jsou označeny data-canvas-index atributem pro pozdější mapování.\n     */\n    private flattenCustomElements(original: Element, clone: Element): void {\n\n        // Nejdřív označ všechny canvasy v originálu indexem (včetně shadow DOM!)\n        const originalCanvases = this.querySelectorAllDeep(original, \"canvas\");\n        originalCanvases.forEach((canvas, index) => {\n            canvas.setAttribute(\"data-canvas-index\", String(index));\n        });\n        \n        console.log(\"[VideoRecorder] Marked canvases with index (including shadow DOM):\", originalCanvases.length);\n\n        // Najdi všechny custom elementy v originálu (mají pomlčku v názvu)\n        const originalElements = Array.from(original.querySelectorAll(\"*\"));\n        const cloneElements = Array.from(clone.querySelectorAll(\"*\"));\n\n        // Iteruj od konce, abychom mohli bezpečně nahrazovat\n        for (let i = originalElements.length - 1; i >= 0; i--) {\n            const origEl = originalElements[i];\n            const cloneEl = cloneElements[i];\n\n            if (!cloneEl) continue;\n\n            // Detekuj custom element (má pomlčku v názvu)\n            const isCustomElement = origEl.tagName.includes(\"-\");\n\n            if (isCustomElement && origEl instanceof HTMLElement) {\n                \n                // Vytvoř náhradní <div> element\n                const replacement = document.createElement(\"div\");\n                replacement.setAttribute(\"data-flattened-from\", origEl.tagName.toLowerCase());\n                \n                // Zkopíruj computed styles\n                const computed = getComputedStyle(origEl);\n                replacement.style.display = computed.display;\n                replacement.style.width = computed.width;\n                replacement.style.height = computed.height;\n                replacement.style.position = computed.position;\n                replacement.style.margin = computed.margin;\n                replacement.style.padding = computed.padding;\n                replacement.style.boxSizing = computed.boxSizing;\n                replacement.style.background = computed.background;\n                replacement.style.backgroundColor = computed.backgroundColor;\n\n                // Pokud má shadow root, vezmi jeho obsah\n                if (origEl.shadowRoot) {\n                    // Přidej HTML obsah ze shadow DOM\n                    for (const child of origEl.shadowRoot.children) {\n                        if (child.tagName !== \"STYLE\") {\n                            const childClone = child.cloneNode(true) as Element;\n                            // Inlinuj styly i pro tento obsah\n                            this.inlineStylesRecursive(child, childClone);\n                            replacement.appendChild(childClone);\n                        }\n                    }\n                } else {\n                    // Není shadow DOM — zkopíruj light DOM obsah\n                    for (const child of origEl.children) {\n                        const childClone = child.cloneNode(true) as Element;\n                        this.inlineStylesRecursive(child, childClone);\n                        replacement.appendChild(childClone);\n                    }\n                }\n\n                // Rekurzivně zpracuj i vnořené custom elementy v replacement\n                const nestedCustom = replacement.querySelectorAll(\"*\");\n                for (const nested of nestedCustom) {\n                    if (nested.tagName.includes(\"-\")) {\n                        // Najdi odpovídající originální element\n                        const nestedOrig = origEl.shadowRoot?.querySelector(nested.tagName.toLowerCase()) \n                            || origEl.querySelector(nested.tagName.toLowerCase());\n                        if (nestedOrig) {\n                            // Rekurzivně zploštit\n                            this.flattenSingleElement(nestedOrig as HTMLElement, nested as HTMLElement);\n                        }\n                    }\n                }\n\n                // Nahraď custom element za replacement\n                cloneEl.parentNode?.replaceChild(replacement, cloneEl);\n\n                console.log(`[VideoRecorder] Flattened: <${origEl.tagName.toLowerCase()}>`);\n            }\n        }\n    }\n\n    /**\n     * Zploští jeden custom element\n     */\n    private flattenSingleElement(original: HTMLElement, clone: HTMLElement): void {\n        \n        const replacement = document.createElement(\"div\");\n        replacement.setAttribute(\"data-flattened-from\", original.tagName.toLowerCase());\n\n        const computed = getComputedStyle(original);\n        replacement.style.display = computed.display;\n        replacement.style.width = computed.width;\n        replacement.style.height = computed.height;\n\n        if (original.shadowRoot) {\n            for (const child of original.shadowRoot.children) {\n                if (child.tagName !== \"STYLE\") {\n                    const childClone = child.cloneNode(true) as Element;\n                    this.inlineStylesRecursive(child, childClone);\n                    replacement.appendChild(childClone);\n                }\n            }\n        }\n\n        clone.parentNode?.replaceChild(replacement, clone);\n    }\n\n    /**\n     * Převede všechny <img> a background-image na data URI\n     */\n    private async embedImages(element: Element): Promise<void> {\n\n        // <img> elementy\n        const images = element.querySelectorAll(\"img\");\n        const imagePromises: Promise<void>[] = [];\n\n        for (const img of images) {\n            if (img.src && !img.src.startsWith(\"data:\")) {\n                imagePromises.push(\n                    this.fetchAsDataUri(img.src)\n                        .then(dataUri => { img.src = dataUri; })\n                        .catch(e => console.warn(\"[VideoRecorder] Failed to embed image:\", img.src, e))\n                );\n            }\n        }\n\n        // background / background-image\n        const bgElements = element.querySelectorAll<HTMLElement>(\"*\");\n        for (const el of bgElements) {\n            const bg = el.style.background || \"\";\n            const bgImg = el.style.backgroundImage || \"\";\n            const combined = [bg, bgImg].filter(Boolean).join(\" \");\n            if (!combined.includes(\"url(\")) continue;\n\n            const urls = Array.from(combined.matchAll(/url\\((['\"]?)(.*?)\\1\\)/g))\n                .map(m => m[2])\n                .filter(u => u && !u.startsWith(\"data:\"));\n\n            if (urls.length === 0) continue;\n\n            imagePromises.push((async () => {\n                let newBg = bg;\n                let newBgImg = bgImg;\n\n                for (const url of urls) {\n                    const dataUri = await this.fetchAsDataUri(url);\n                    newBg = newBg.replaceAll(url, dataUri);\n                    newBgImg = newBgImg.replaceAll(url, dataUri);\n                }\n\n                if (bg) el.style.background = newBg;\n                if (bgImg) el.style.backgroundImage = newBgImg;\n            })().catch(e => console.warn(\"[VideoRecorder] Failed to embed background:\", e)));\n        }\n\n        await Promise.all(imagePromises);\n    }\n\n    /**\n     * Načte URL jako data URI\n     */\n    private async fetchAsDataUri(url: string): Promise<string> {\n        const response = await fetch(url);\n        const blob = await response.blob();\n        return new Promise((resolve, reject) => {\n            const reader = new FileReader();\n            reader.onloadend = () => resolve(reader.result as string);\n            reader.onerror = reject;\n            reader.readAsDataURL(blob);\n        });\n    }\n\n    /**\n     * Vytvoří mapování mezi originálními canvasy a <img> elementy v klonu.\n     * Nahrazuje <canvas> elementy za <img> elementy v klonu.\n     * Používá data-canvas-index atribut pro správné mapování po zploštění.\n     */\n    private createCanvasMap(original: Element, clone: Element): void {\n\n        this.canvasToImageMap.clear();\n\n        // Najdi všechny canvasy v originálu včetně shadow DOM\n        const originalCanvases = this.querySelectorAllDeep(original, \"canvas\");\n        \n        // Najdi všechny canvasy v klonu (po zploštění už jsou v normálním DOM)\n        const cloneCanvases = clone.querySelectorAll(\"canvas\");\n\n        console.log(\"[VideoRecorder] Found canvases in original:\", originalCanvases.length);\n        console.log(\"[VideoRecorder] Found canvases in clone:\", cloneCanvases.length);\n\n        // Mapuj canvasy podle data-canvas-index\n        for (const origCanvas of originalCanvases) {\n            const index = origCanvas.getAttribute(\"data-canvas-index\");\n            if (index === null) continue;\n\n            // Najdi odpovídající canvas v klonu\n            const cloneCanvas = clone.querySelector(`canvas[data-canvas-index=\"${index}\"]`) as HTMLCanvasElement | null;\n            \n            if (!cloneCanvas) {\n                console.warn(`[VideoRecorder] Canvas with index ${index} not found in clone`);\n                continue;\n            }\n\n            const origCanvasEl = origCanvas as HTMLCanvasElement;\n            \n            // Vytvoř <img> element jako náhradu za canvas\n            const img = document.createElement(\"img\");\n            img.width = origCanvasEl.width;\n            img.height = origCanvasEl.height;\n            img.style.width = cloneCanvas.style.width || `${origCanvasEl.width}px`;\n            img.style.height = cloneCanvas.style.height || `${origCanvasEl.height}px`;\n            img.style.display = \"block\";\n            \n            // Zachovej pixelovaný vzhled - žádná interpolace\n            img.style.imageRendering = \"pixelated\";\n            \n            img.setAttribute(\"data-canvas-index\", index);\n            \n            // Inicializuj s aktuálním obsahem canvasu\n            // Diagnostic: check if canvas is tainted before getting dataURL\n            try {\n                const dataUrl = this.getCanvasDataUrl(origCanvasEl);\n                if (dataUrl) {\n                    img.src = dataUrl;\n                    console.log(`[VideoRecorder] Canvas ${index} converted to data URL (${dataUrl.length} chars)`);\n                } else {\n                    console.warn(`[VideoRecorder][taint] Canvas ${index} returned null dataURL - possibly tainted!`, origCanvasEl);\n                }\n            } catch (e) {\n                console.warn(`[VideoRecorder][taint] Canvas ${index} TAINTED - cannot get dataURL:`, e, origCanvasEl);\n            }\n            \n            // Nahraď canvas za img v klonu\n            cloneCanvas.parentNode?.replaceChild(img, cloneCanvas);\n            \n            this.canvasToImageMap.set(origCanvasEl, img);\n            console.log(`[VideoRecorder] Mapped canvas ${index}: ${origCanvasEl.width}x${origCanvasEl.height}`);\n        }\n\n        console.log(\"[VideoRecorder] Total canvas mappings:\", this.canvasToImageMap.size);\n    }\n\n    /**\n     * Vytvoří mapování mezi originálními a klonovanými dynamickými elementy.\n     * Hledá elementy s atributem DYNAMIC_CONTENT_ATTRIBUTE včetně shadow DOM.\n     */\n    private createDynamicElementMap(original: Element, clone: Element): void {\n\n        this.dynamicElementMap.clear();\n\n        // Hledej v celém stromu včetně shadow DOM\n        const originalDynamic = this.querySelectorAllDeep(original, `[${DYNAMIC_CONTENT_ATTRIBUTE}]`);\n        const cloneDynamic = clone.querySelectorAll(`[${DYNAMIC_CONTENT_ATTRIBUTE}]`);\n\n        console.log(\"[VideoRecorder] Found dynamic elements (including shadow DOM):\", originalDynamic.length);\n        console.log(\"[VideoRecorder] Found dynamic elements in clone:\", cloneDynamic.length);\n\n        // Mapuj podle data-dynamic-index\n        originalDynamic.forEach((origEl, index) => {\n            origEl.setAttribute(\"data-dynamic-index\", String(index));\n        });\n\n        // Po zploštění bychom měli mít odpovídající elementy v klonu\n        for (let i = 0; i < originalDynamic.length && i < cloneDynamic.length; i++) {\n            this.dynamicElementMap.set(originalDynamic[i], cloneDynamic[i]);\n        }\n    }\n\n    /**\n     * Vytvoří mapování pro dynamické SVG elementy.\n     * Hledá SVG s atributem DYNAMIC_SVG_ATTRIBUTE včetně shadow DOM.\n     */\n    private createDynamicSvgMap(original: Element, clone: Element): void {\n\n        this.dynamicSvgMap.clear();\n\n        const originalSvgs = this.querySelectorAllDeep(original, `svg[${DYNAMIC_SVG_ATTRIBUTE}]`);\n        const cloneSvgs = clone.querySelectorAll(`svg[${DYNAMIC_SVG_ATTRIBUTE}]`);\n\n        console.log(\"[VideoRecorder] Found dynamic SVGs (including shadow DOM):\", originalSvgs.length);\n\n        for (let i = 0; i < originalSvgs.length && i < cloneSvgs.length; i++) {\n            this.dynamicSvgMap.set(originalSvgs[i] as SVGElement, cloneSvgs[i] as SVGElement);\n        }\n    }\n\n    /**\n     * Vytvoří mapování pro elementy s dynamickými styly.\n     * Hledá elementy s atributem DYNAMIC_STYLE_ATTRIBUTE včetně shadow DOM.\n     */\n    private createDynamicStyleMap(original: Element, clone: Element): void {\n\n        this.dynamicStyleMap.clear();\n\n        const originalStyled = this.querySelectorAllDeep(original, `[${DYNAMIC_STYLE_ATTRIBUTE}]`);\n        const cloneStyled = clone.querySelectorAll(`[${DYNAMIC_STYLE_ATTRIBUTE}]`);\n\n        console.log(\"[VideoRecorder] Found dynamic style elements (including shadow DOM):\", originalStyled.length);\n\n        for (let i = 0; i < originalStyled.length && i < cloneStyled.length; i++) {\n            this.dynamicStyleMap.set(originalStyled[i] as HTMLElement, cloneStyled[i] as HTMLElement);\n        }\n    }\n\n    /**\n     * Vytvoří mapování pro elementy, které se mají kompletně překreslit při každém framu.\n     * Hledá elementy s atributem DYNAMIC_RERENDER_ATTRIBUTE včetně shadow DOM.\n     */\n    private createRerenderMap(original: Element, clone: Element): void {\n\n        this.rerenderMap.clear();\n\n        const originalRerender = this.querySelectorAllDeep(original, `[${DYNAMIC_RERENDER_ATTRIBUTE}]`);\n        const cloneRerender = clone.querySelectorAll(`[${DYNAMIC_RERENDER_ATTRIBUTE}]`);\n\n        console.log(\"[VideoRecorder] Found rerender elements (including shadow DOM):\", originalRerender.length);\n\n        for (let i = 0; i < originalRerender.length && i < cloneRerender.length; i++) {\n            this.rerenderMap.set(originalRerender[i], cloneRerender[i]);\n        }\n    }\n\n    /**\n     * querySelector pro celý DOM strom včetně shadow DOM\n     */\n    private querySelectorAllDeep(root: Element, selector: string): Element[] {\n        const results: Element[] = [];\n\n        // Hledej v aktuálním elementu\n        const matches = root.querySelectorAll(selector);\n        results.push(...Array.from(matches));\n\n        // Hledej v shadow DOM všech custom elementů\n        const allElements = root.querySelectorAll(\"*\");\n        for (const el of allElements) {\n            if (el.shadowRoot) {\n                const shadowMatches = el.shadowRoot.querySelectorAll(selector);\n                results.push(...Array.from(shadowMatches));\n\n                // Rekurzivně hledej v shadow DOM\n                const nestedResults = this.querySelectorAllDeepInShadow(el.shadowRoot, selector);\n                results.push(...nestedResults);\n            }\n        }\n\n        return results;\n    }\n\n    /**\n     * Rekurzivní helper pro hledání v shadow DOM\n     */\n    private querySelectorAllDeepInShadow(shadowRoot: ShadowRoot, selector: string): Element[] {\n        const results: Element[] = [];\n\n        const allElements = shadowRoot.querySelectorAll(\"*\");\n        for (const el of allElements) {\n            if (el.shadowRoot) {\n                const shadowMatches = el.shadowRoot.querySelectorAll(selector);\n                results.push(...Array.from(shadowMatches));\n                \n                const nestedResults = this.querySelectorAllDeepInShadow(el.shadowRoot, selector);\n                results.push(...nestedResults);\n            }\n        }\n\n        return results;\n    }\n\n    // =======================================================================\n    // AKTUALIZACE DYNAMICKÉHO OBSAHU — volá se pro KAŽDÝ frame\n    // =======================================================================\n\n    /**\n     * Aktualizuje pouze dynamický obsah v klonu:\n     * 1. Aktualizuje src <img> elementů z originálních canvasů\n     * 2. Aktualizuje textContent dynamických elementů\n     * 3. Aktualizuje innerHTML dynamických SVG\n     * 4. Aktualizuje inline styly dynamických elementů\n     * 5. Kompletně překreslí rerender elementy\n     * \n     * Toto je MNOHEM rychlejší než klonování celého DOM!\n     */\n    private updateDynamicContent(): void {\n\n        // 1. Aktualizuj src <img> elementů z originálních canvasů\n        for (const [origCanvas, img] of this.canvasToImageMap) {\n            try {\n                const dataUrl = this.getCanvasDataUrl(origCanvas);\n                if (dataUrl) {\n                    img.src = dataUrl;\n                }\n            } catch (e) {\n                console.warn(\"[VideoRecorder] Failed to update canvas image:\", e);\n            }\n        }\n\n        // 2. Aktualizuj textContent dynamických elementů\n        for (const [origEl, cloneEl] of this.dynamicElementMap) {\n            if (cloneEl.textContent !== origEl.textContent) {\n                cloneEl.textContent = origEl.textContent;\n            }\n        }\n\n        // 3. Aktualizuj innerHTML dynamických SVG\n        for (const [origSvg, cloneSvg] of this.dynamicSvgMap) {\n            if (cloneSvg.innerHTML !== origSvg.innerHTML) {\n                cloneSvg.innerHTML = origSvg.innerHTML;\n            }\n        }\n\n        // 4. Aktualizuj inline styly dynamických elementů\n        for (const [origEl, cloneEl] of this.dynamicStyleMap) {\n            const origStyle = origEl.getAttribute(\"style\") || \"\";\n            const cloneStyle = cloneEl.getAttribute(\"style\") || \"\";\n            if (cloneStyle !== origStyle) {\n                cloneEl.setAttribute(\"style\", origStyle);\n            }\n        }\n\n        // 5. Kompletně překresli rerender elementy (včetně stylů a potomků)\n        for (const [origEl, cloneEl] of this.rerenderMap) {\n            this.rerenderElement(origEl, cloneEl);\n        }\n    }\n\n    /**\n     * Kompletně překreslí element - znovu naklonuje obsah z originálu\n     * včetně všech stylů a potomků.\n     */\n    private rerenderElement(original: Element, clone: Element): void {\n        \n        // Pokud je to custom element, musíme zpracovat shadow DOM\n        if (original instanceof HTMLElement && original.tagName.includes(\"-\")) {\n            // Custom element - zpracuj shadow DOM\n            if (original.shadowRoot) {\n                // Vymaž obsah klonu\n                while (clone.firstChild) {\n                    clone.removeChild(clone.firstChild);\n                }\n                \n                // Znovu naklonuj obsah shadow DOM\n                for (const child of original.shadowRoot.children) {\n                    if (child.tagName !== \"STYLE\") {\n                        const childClone = child.cloneNode(true) as Element;\n                        this.inlineStylesRecursive(child, childClone);\n                        clone.appendChild(childClone);\n                    }\n                }\n            }\n        } else {\n            // Standardní element - nahraď innerHTML a styly\n            if (clone.innerHTML !== original.innerHTML) {\n                clone.innerHTML = original.innerHTML;\n            }\n            \n            // Aktualizuj inline styly\n            if (original instanceof HTMLElement && clone instanceof HTMLElement) {\n                const origStyle = original.getAttribute(\"style\") || \"\";\n                clone.setAttribute(\"style\", origStyle);\n                \n                // Znovu inlinuj computed styles\n                this.inlineStylesRecursive(original, clone);\n            }\n        }\n    }\n\n\n\n    /**\n     * Odstraní Lit framework komentáře z klonu.\n     * Tyto komentáře mohou způsobovat problémy v SVG foreignObject.\n     */\n    private removeLitComments(element: Element): void {\n        const walker = document.createTreeWalker(\n            element,\n            NodeFilter.SHOW_COMMENT,\n            null\n        );\n        \n        const commentsToRemove: Comment[] = [];\n        let node: Comment | null;\n        \n        while ((node = walker.nextNode() as Comment | null)) {\n            // Lit používá komentáře jako ?lit$, <!---->  atd.\n            commentsToRemove.push(node);\n        }\n        \n        for (const comment of commentsToRemove) {\n            comment.parentNode?.removeChild(comment);\n        }\n    }\n\n    /**\n     * Zkontroluje a opraví xmlns atributy v klonu pro foreignObject.\n     * Všechny HTML elementy musí mít xmlns=\"http://www.w3.org/1999/xhtml\"\n     */\n    private ensureXmlnsAttributes(element: Element): void {\n        const XHTML_NS = \"http://www.w3.org/1999/xhtml\";\n        \n        const checkAndFix = (el: Element) => {\n            if (el instanceof HTMLElement) {\n                const currentXmlns = el.getAttribute(\"xmlns\");\n                \n                if (!currentXmlns || currentXmlns !== XHTML_NS) {\n                    el.setAttribute(\"xmlns\", XHTML_NS);\n                }\n            }\n            \n            for (const child of el.children) {\n                checkAndFix(child);\n            }\n        };\n        \n        checkAndFix(element);\n    }\n\n\n\n    /**\n     * Získá data URL z canvasu - podporuje i WebGL kontexty\n     */\n    private getCanvasDataUrl(canvas: HTMLCanvasElement): string | null {\n        \n        // Zkus zjistit typ kontextu\n        const webgl2 = canvas.getContext(\"webgl2\");\n        const webgl = canvas.getContext(\"webgl\");\n        const ctx2d = canvas.getContext(\"2d\");\n\n        if (webgl2 || webgl) {\n            // WebGL canvas - musíme číst pixels a překreslit na 2D canvas\n            try {\n                return this.webglCanvasToDataUrl(canvas, webgl2 || webgl!);\n            } catch (e) {\n                console.warn(\"[VideoRecorder] WebGL canvas unreadable:\", e);\n                return null;\n            }\n        } else if (ctx2d) {\n            // Standardní 2D canvas\n            try {\n                return canvas.toDataURL(\"image/png\");\n            } catch (e) {\n                console.warn(\"[VideoRecorder] 2D canvas unreadable:\", e);\n                return null;\n            }\n        } else {\n            // Zkus přímo toDataURL (může fungovat pro některé případy)\n            try {\n                return canvas.toDataURL(\"image/png\");\n            } catch (e) {\n                console.warn(\"[VideoRecorder] Canvas unreadable:\", e);\n                return null;\n            }\n        }\n    }\n\n    /**\n     * Konvertuje WebGL canvas na data URL pomocí readPixels\n     */\n    private webglCanvasToDataUrl(\n        canvas: HTMLCanvasElement, \n        gl: WebGLRenderingContext | WebGL2RenderingContext\n    ): string | null {\n\n        const width = canvas.width;\n        const height = canvas.height;\n\n        // Přečti pixels z WebGL\n        const pixels = new Uint8Array(width * height * 4);\n        gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels);\n\n        // Vytvoř pomocný canvas pro konverzi\n        const tempCanvas = document.createElement(\"canvas\");\n        tempCanvas.width = width;\n        tempCanvas.height = height;\n        const tempCtx = tempCanvas.getContext(\"2d\")!;\n\n        // Vytvoř ImageData a vlož pixels (WebGL má Y osu obráceně)\n        const imageData = tempCtx.createImageData(width, height);\n        \n        // Překopíruj pixels s obrácenou Y osou\n        for (let y = 0; y < height; y++) {\n            for (let x = 0; x < width; x++) {\n                const srcIdx = ((height - y - 1) * width + x) * 4;\n                const dstIdx = (y * width + x) * 4;\n                imageData.data[dstIdx] = pixels[srcIdx];         // R\n                imageData.data[dstIdx + 1] = pixels[srcIdx + 1]; // G\n                imageData.data[dstIdx + 2] = pixels[srcIdx + 2]; // B\n                imageData.data[dstIdx + 3] = pixels[srcIdx + 3]; // A\n            }\n        }\n\n        tempCtx.putImageData(imageData, 0, 0);\n        \n        return tempCanvas.toDataURL(\"image/png\");\n    }\n\n    // =======================================================================\n    // HLAVNÍ METODA PRO ZÁZNAM A ENKÓDOVÁNÍ FRAMŮ\n    // =======================================================================\n\n    /**\n     * Hlavní metoda pro export videa.\n     * Kombinuje rasterizaci a enkódování do jednoho průchodu.\n     * Framy se posílají přímo do encoderu bez mezitřídy do IndexedDB.\n     */\n    private async recordAndEncode(): Promise<Blob> {\n\n        this.app.setRecordingPhase( RecordingPhase.RECORDING );\n\n        // === PŘÍPRAVA EXPORTU ===\n        await this.prepareExport();\n\n        // === PŘÍPRAVA ENCODERU ===\n        const output = new Output({\n            target: new BufferTarget(),\n            format: new Mp4OutputFormat()\n        });\n\n        console.log(\"[VideoRecorder] Supported video codecs:\", output.format.getSupportedVideoCodecs());\n\n        const source = new VideoSampleSource({\n            codec: \"vp9\",\n            bitrate: this.app.renderProps.mp4Quality\n        });\n\n        output.addVideoTrack(source);\n        output.start();\n\n        const totalFrames = this.file.timeline.frames.length;\n        console.log(\"[VideoRecorder] Starting recording & encoding. Total frames:\", totalFrames);\n\n        let frameCount = 0;\n\n        // === HLAVNÍ SMYČKA - RASTERIZACE + ENKÓDOVÁNÍ ===\n        for (const frame of this.file.timeline.frames) {\n\n            // 1. Nastav čas a překresli thermal data\n            await this.file.timeline.setRelativeTime(frame.relative);\n            await this.file.draw();\n\n            // 2. Aktualizuj dynamický obsah v klonu\n            this.updateDynamicContent();\n\n            // 3. Rasterizuj do muxing canvasu (přímo, bez JPEG mezikroku)\n            const success = await this.rasterizeToCanvas();\n\n            if (!success) {\n                console.warn(\"[VideoRecorder] Failed to rasterize frame:\", frame.index);\n                continue;\n            }\n\n            // 4. Vytvoř VideoFrame přímo z canvasu a pošli do encoderu\n            const videoFrame = new VideoFrame(\n                this.getMuxingCanvas(),\n                {\n                    timestamp: frame.relative * 1000 // ms → μs\n                }\n            );\n\n            const sample = new VideoSample(videoFrame);\n\n            await source.add(sample, {\n                keyFrame: frameCount % 30 === 0 // Keyframe každých 30 framů\n            });\n\n            videoFrame.close();\n            sample.close();\n\n            frameCount++;\n            if (frameCount % 10 === 0) {\n                console.log(`[VideoRecorder] Progress: ${frameCount}/${totalFrames} frames`);\n            }\n\n            const percent = (frameCount / totalFrames) * 100;\n\n            this.app.setRecordingPhaseProgress( percent );\n\n        }\n\n        this.app.setRecordingPhase( RecordingPhase.ENCODING );\n\n        console.log(\"[VideoRecorder] Recording & encoding complete.\");\n\n        // === FINALIZACE ===\n        source.close();\n        await output.finalize();\n\n        this.app.setRecordingPhase( RecordingPhase.IDLE );\n\n        return new Blob([output.target.buffer!], { type: \"video/mp4\" });\n    }\n\n    /**\n     * Rasterizuje připravené SVG přímo do muxing canvasu.\n     * Vrací true při úspěchu, false při chybě.\n     */\n    private async rasterizeToCanvas(): Promise<boolean> {\n\n        if (!this.preparedSvgWrapper) {\n            console.error(\"[VideoRecorder] SVG wrapper not prepared!\");\n            return false;\n        }\n\n        // Serializuj SVG\n        const serialized = new XMLSerializer().serializeToString(this.preparedSvgWrapper);\n        \n        // Vytvoř data: URL místo Blob URL (může obejít některé security checky)\n        const dataUrl = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(serialized)}`;\n\n        try {\n            // Načti jako Image s data: URL\n            // let imageToDraw: HTMLImageElement;\n            \n            const imageToDraw = await new Promise<HTMLImageElement>((resolve, reject) => {\n                const img = new Image();\n                img.width = this.exportWidth;\n                img.height = this.exportHeight;\n                img.onload = () => resolve(img);\n                img.onerror = (e) => {\n                    console.error(\"[VideoRecorder] Image load error:\", e);\n                    reject(new Error(`Failed to load SVG image`));\n                };\n                img.src = dataUrl;\n            });\n\n            // Nakresli na muxing canvas\n            const canvas = this.getMuxingCanvas();\n            canvas.width = this.exportWidth;\n            canvas.height = this.exportHeight;\n\n            const ctx = this.getMuxingContext();\n            ctx.clearRect(0, 0, this.exportWidth, this.exportHeight);\n            ctx.drawImage(imageToDraw, 0, 0);\n\n            return true;\n\n        } catch (e) {\n            console.error(\"[VideoRecorder] Rasterization error:\", e);\n            return false;\n        }\n    }\n\n    /**\n     * Vyčistí připravené struktury po dokončení exportu.\n     * Důležité pro uvolnění paměti a možnost opakovaného exportu.\n     */\n    private cleanup(): void {\n        \n        // Odstraň data-canvas-index atributy z originálních canvasů\n        for (const origCanvas of this.canvasToImageMap.keys()) {\n            origCanvas.removeAttribute(\"data-canvas-index\");\n        }\n        \n        // Odstraň data-dynamic-index atributy z originálních elementů\n        for (const origEl of this.dynamicElementMap.keys()) {\n            origEl.removeAttribute(\"data-dynamic-index\");\n        }\n        \n        // Vyčisti všechny mapy (uvolní reference)\n        this.canvasToImageMap.clear();\n        this.dynamicElementMap.clear();\n        this.dynamicSvgMap.clear();\n        this.dynamicStyleMap.clear();\n        this.rerenderMap.clear();\n        \n        // Uvolni SVG wrapper a klon (GC je sebere)\n        this.preparedSvgWrapper = undefined;\n        this.preparedClone = undefined;\n        \n        // Uvolni muxing canvas\n        this.muxingCanvas = undefined;\n        this.muxingContext = undefined;\n        \n        // Reset rozměrů\n        this.exportWidth = 0;\n        this.exportHeight = 0;\n        \n        console.log(\"[VideoRecorder] Cleanup complete.\");\n    }\n\n    /**\n     * Hlavní veřejná metoda pro spuštění exportu videa.\n     */\n    public async captureVideo(): Promise<void> {\n\n        // Store the initial preview scale\n        const initialScale = this.app.renderProps.previewScale;\n\n        // Set the scale to 1 for export\n        this.app.setPreviewScale(1);\n\n        // Allow scale change to take effect\n        await Promise.resolve(); \n\n        const start = performance.now();\n\n        try {\n            const videoBlob = await this.recordAndEncode();\n\n            const end = performance.now();\n            console.log(\"[VideoRecorder] Total export time:\", end - start, \"ms\");\n\n            // Stáhni video\n            const blobUrl = URL.createObjectURL(videoBlob);\n            const a = document.createElement(\"a\");\n            a.href = blobUrl;\n            \n            // Název souboru s .mp4 příponou\n            const baseName = this.app.renderProps.fileName || \"exported-video\";\n            a.download = baseName.endsWith(\".mp4\") ? baseName : `${baseName}.mp4`;\n            \n            a.click();\n            a.remove();\n            \n            // Uvolni blob URL po kliknutí (s malým zpožděním pro jistotu)\n            setTimeout(() => {\n                URL.revokeObjectURL(blobUrl);\n                console.log(\"[VideoRecorder] Video blob URL revoked.\");\n            }, 1000);\n\n        } finally {\n            this.cleanup();\n            this.app.setPreviewScale(initialScale);\n        }\n    }\n\n    /**\n     * Hlavní metoda pro export současného snímku jako PNG\n     */\n    public async captureCurrentFrameAsPng(): Promise<void> {\n\n        const initialScale = this.app.renderProps.previewScale;\n\n        await Promise.resolve();\n\n        \n\n        try {\n\n            await this.prepareExport();\n\n            await this.file.draw();\n\n            this.updateDynamicContent();\n\n            await this.rasterizeToCanvas();\n\n            const canvas = this.getMuxingCanvas();\n\n            const blob = await canvas.convertToBlob({ type: \"image/png\" });\n        \n            if (blob) {\n                const blobUrl = URL.createObjectURL(blob);\n                const a = document.createElement(\"a\");\n                a.href = blobUrl;\n                const baseName = this.app.renderProps.fileName || \"exported-frame\";\n\n                const finalName = [baseName, \"frame\", this.file.timeline.currentFrameIndex + 1].join(\"_\");\n                a.download = finalName.endsWith(\".png\") ? baseName : `${finalName}.png`;\n                a.click();\n                a.remove();\n                setTimeout(() => {\n                    URL.revokeObjectURL(blobUrl);\n                    console.log(\"[VideoRecorder] PNG blob URL revoked.\");\n                }, 1000);\n            }\n\n        } finally {\n            this.cleanup();\n            this.app.setPreviewScale(initialScale);\n        }\n\n\n    }\n\n}","import type { ThermalFileInstance } from \"@labirthermal/core\";\nimport type { PropertyValues } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport type { Ref } from \"lit/directives/ref.js\";\nimport { createRef } from \"lit/directives/ref.js\";\nimport type { Quality} from \"mediabunny\";\nimport { QUALITY_VERY_HIGH } from \"mediabunny\";\nimport { AbstractFileConsumer } from \"../../../hierarchy/consumers/AbstractFileConsumer\";\nimport type { FileCopyElement } from \"../../../hierarchy/providers/FileCopy\";\nimport { VideoRecorder } from \"./internals/VideoRecorder\";\nimport type { ISingleVideoExportElement, SingleVideoRenderProps} from \"./ISingleVideoExportElement\";\nimport { RecordingPhase, VideoExportSkin } from \"./ISingleVideoExportElement\";\n\nexport abstract class AbstractSingleVideoExport extends AbstractFileConsumer implements ISingleVideoExportElement {\n\n    public fileCopyElementRef: Ref<FileCopyElement> = createRef();\n    public exportedDivRef: Ref<HTMLElement> = createRef();\n\n    public get slug(): string {\n        return [\n            \"single-video-export\",\n            this.file?.fileName ?? \"no-file\",\n            this.UUID\n        ].join(\"__\")\n    }\n\n    public get outerFile(): ThermalFileInstance | undefined {\n        return this.file;\n    }\n\n\n    public get innerFile(): ThermalFileInstance | undefined {\n        return this.fileCopyElementRef.value?.file;\n    }\n\n    public get exportedElement(): HTMLElement | undefined {\n        return this.exportedDivRef.value;\n    }\n\n    @property({ type: Boolean, reflect: true }) public parentHasAnalyses: boolean = false;\n\n    @state()\n    public recordingPhase: RecordingPhase = RecordingPhase.IDLE;\n\n    @state()\n    public recordingPhaseProgress: number = 0;\n\n    public setRecordingPhase(phase: RecordingPhase): void {\n        this.recordingPhase = phase;\n    }\n\n    public setRecordingPhaseProgress(progress: number): void {\n        this.recordingPhaseProgress = progress;\n    }\n\n    @state()\n    public renderProps: SingleVideoRenderProps = {\n\n        hasHistogram: true,\n        hasThermalScale: true,\n        hasAnalysis: false,\n        hasTimeline: false,\n        isVertical: false,\n\n        exportFrameWidth: 1200,\n        exportFramePadding: 15,\n        exportFrameGap: 30,\n        exportGraphHeight: 300,\n\n        fileName: \"exported-video\",\n        mp4Quality: QUALITY_VERY_HIGH,\n\n        skin: VideoExportSkin.LIGHT,\n\n        previewScale: 0.45,\n        autoScale: true,\n    }\n\n    /** Voláno při změně vlastností ovlivňujících layout exportu.\n     *  Lze přepsat v potomcích pro reakci na změny (např. přepočet autoScale).\n     */\n    protected onLayoutAffectingPropertyChanged(): void {\n        // Prázdná implementace - přepíše se v potomcích\n    }\n\n    public setHasHistogram(value: boolean): void {\n        this.renderProps.hasHistogram = value;\n        this.requestUpdate();\n        this.onLayoutAffectingPropertyChanged();\n    }\n\n    public setHasThermalScale(value: boolean): void {\n        this.renderProps.hasThermalScale = value;\n        this.requestUpdate();\n        this.onLayoutAffectingPropertyChanged();\n    }\n\n    public setPreviewScale(value: number): void {\n        this.renderProps.previewScale = value;\n        this.requestUpdate();\n    }\n\n    public setAutoScale(value: boolean): void {\n        this.renderProps.autoScale = value;\n        this.requestUpdate();\n        this.onLayoutAffectingPropertyChanged();\n    }\n\n    /** The analyses are mirrored to the copy by the `withAnalyses` property of the `file-copy` element (see the providers directive). */\n    public setHasAnalysis(value: boolean): void {\n        this.renderProps.hasAnalysis = value;\n        this.requestUpdate();\n        this.onLayoutAffectingPropertyChanged();\n    }\n\n    public setHasTimeline(value: boolean): void {\n        this.renderProps.hasTimeline = value;\n        this.requestUpdate();\n        this.onLayoutAffectingPropertyChanged();\n    }\n\n    public setIsVertical(value: boolean): void {\n        this.renderProps.isVertical = value;\n        this.requestUpdate();\n        this.onLayoutAffectingPropertyChanged();\n    }\n\n    public setExportFramePadding(value: number): void {\n        this.renderProps.exportFramePadding = value;\n        this.requestUpdate();\n        this.onLayoutAffectingPropertyChanged();\n    }\n\n    public setExportFrameGap(value: number): void {\n        this.renderProps.exportFrameGap = value;\n        this.requestUpdate();\n        this.onLayoutAffectingPropertyChanged();\n    }\n\n    public setExportFrameWidth(value: number): void {\n        this.renderProps.exportFrameWidth = value;\n        this.requestUpdate();\n        this.onLayoutAffectingPropertyChanged();\n    }\n\n    public setExportGraphHeight(value: number): void {\n        this.renderProps.exportGraphHeight = value;\n        this.requestUpdate();\n        this.onLayoutAffectingPropertyChanged();\n    }\n\n    public setFileName(value: string): void {\n        this.renderProps.fileName = value;\n        this.requestUpdate();\n    }\n\n    public setMp4Quality(value: Quality): void {\n        this.renderProps.mp4Quality = value;\n        this.requestUpdate();\n    }\n\n    public setSkin(value: VideoExportSkin): void {\n        this.renderProps.skin = value;\n        this.requestUpdate();\n    }\n\n    updated(_changedProperties: PropertyValues): void {\n        super.updated(_changedProperties);\n\n        // Nastav výchozí název souboru z .lrc souboru\n        if (_changedProperties.has(\"file\") && this.file) {\n            this.parentHasAnalyses = this.file.analysis.value.length > 0;\n\n            const lrcFileName = this.file.fileName;\n            // Odstraň příponu termogramu\n            const baseName = lrcFileName.replace(/\\.(lrc|jpe?g)$/i, \"\");\n            this.renderProps.fileName = baseName;\n            this.requestUpdate();\n        }\n    }\n\n\n    public async record(): Promise<void> {\n\n        const recorder = new VideoRecorder(this);\n\n        await recorder.captureVideo();\n\n\n    }\n\n    public async currentFrame(): Promise<void> {\n\n        const recorder = new VideoRecorder(this);\n        await recorder.captureCurrentFrameAsPng();\n    }\n\n\n\n\n\n\n}","import { nothing } from \"lit\";\n\n/** Utilities for rendering */\nexport class DirectiveHelpers {\n\n    public static unknownContainsSomething(\n        content: unknown\n    ): boolean {\n\n        if (\n            content === nothing\n            || content === null\n            || content === undefined\n        ) {\n            return false;\n        }\n\n        if (typeof content === \"string\" && content.trim().length === 0) {\n            return false;\n        }\n\n        if (Array.isArray(content)) {\n\n            if (content.length === 0) {\n                return false;\n            } else if (!content.some(item => this.unknownContainsSomething(item))) {\n                return false;\n            }\n\n        }\n\n        return true;\n\n    }\n\n}","import { t } from \"i18next\";\nimport type { Part } from \"lit\";\nimport { html } from \"lit\";\nimport { Directive } from \"lit/directive.js\";\nimport { T } from \"../translations/Languages\";\nimport { DirectiveHelpers } from \"./DirectiveHelpers\";\n\nexport abstract class AbstractThermalDirective extends Directive {\n\n    protected t(\n        key: keyof typeof T\n    ): string {\n        return t( T[ key ] );\n    }\n\n    update(_part: Part, props: Array<unknown>): unknown {\n        return this.render( ...props );\n    }\n\n    protected unknownContainsSomething( content: unknown ): boolean {\n\n        return DirectiveHelpers.unknownContainsSomething( content );\n\n    }\n\n    protected renderDef(...args: unknown[]): unknown {\n\n        const content: unknown[] = [];\n\n        const first = args.shift();\n        if ( first ) {\n            content.push( html`<dt>${first}</dt>` );\n        }\n\n        args.forEach( item => {\n            content.push( html`<dd>${item}</dd>` );\n        } );\n\n        return content;\n\n    }\n\n}","import { html, nothing } from \"lit\";\nimport { T } from \"../translations/Languages\";\nimport { AbstractThermalDirective } from \"./AbstractThermalDirective\";\nimport { t } from \"i18next\";\nimport { directive } from \"lit/directive.js\";\n\nclass SlotOrNothing extends AbstractThermalDirective {\n\n    render( \n        label: keyof typeof T,\n        content: unknown\n    ): unknown {\n\n        if ( ! this.unknownContainsSomething( content ) ) {\n            return nothing;\n        }\n\n        return html`<thermal-slot\n            label=${t(T[ label ])}\n        >${content}</thermal-slot>`;\n\n    }\n    \n}\n\nexport const slotOrNothing = directive(SlotOrNothing);","import { css, html } from \"lit\";\nimport { directive, Directive } from \"lit/directive.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { QUALITY_HIGH, QUALITY_LOW, QUALITY_MEDIUM, QUALITY_VERY_HIGH, QUALITY_VERY_LOW } from \"mediabunny\";\nimport { slotOrNothing } from \"../../../../directives/SlotOrNothing\";\nimport { T } from \"../../../../translations/Languages\";\nimport type { AbstractSingleVideoExport } from \"../AbstractSingleVideoExport\";\nimport type { VideoExportSkin } from \"../ISingleVideoExportElement\";\n\nexport class SingleVideoExportConfigDirective extends Directive {\n\n    private renderRadio(\n        label: string,\n        checked: boolean,\n        onChange: (value: boolean) => void\n    ): unknown {\n        return html`<thermal-radio\n            .checked=${checked}\n            .onChange=${onChange}\n        >${label}</thermal-radio>`;\n    }\n\n    private renderText(\n        label: string,\n        suffix: string,\n        value: string,\n        onChange: (value: string) => void\n    ): unknown {\n        return html`<div class=\"export-config-field export-config-field--text\">\n\n            <div class=\"export-config-field--label\">\n                <label>${label}</label>\n            </div>\n\n            <div class=\"export-config-field--value\">\n\n                <div class=\"\">\n                    <input\n                        type=\"text\"\n                        .value=${value}\n                        @input=${(event: InputEvent) => {\n                const target = event.target as HTMLInputElement;\n                onChange(target.value);\n            }}\n                    />\n                    <span class=\"unit\">${suffix}</span>\n                </div>\n\n            </div>\n\n        </div>`;\n    }\n\n    private renderDropdown(\n        value: string,\n        options: string[],\n        onChange: (value: string) => void\n    ): unknown {\n\n        const elements: unknown[] = options.map(option => html`<thermal-btn\n            slot=\"option\"\n            @click=${() => onChange(option)}\n        >${option}</thermal-btn>`);\n\n        return html`<thermal-dropdown>\n            <span slot=\"invoker\">${value}</span>\n            ${elements}\n        </thermal-dropdown>`;\n\n    }\n\n    private renderNumber(\n        label: string,\n        unit: string,\n        value: number,\n        onChange: (value: number) => void,\n        min?: number,\n        max?: number,\n        step?: number\n    ): unknown {\n        return html`<div class=\"export-config-field\">\n\n            <div class=\"export-config-field--label\">\n                <label>${label}</label>\n            </div>\n\n            <div class=\"export-config-field--value\">\n\n                <div class=\"\">\n                    <input\n                        type=\"number\"\n                        .value=${value === undefined || value === null ? \"\" : String(value)}\n                        min=${ifDefined(min)}\n                        max=${ifDefined(max)}\n                        step=${ifDefined(step)}\n                        @input=${(event: InputEvent) => {\n                const target = event.target as HTMLInputElement;\n                const raw = target.value.trim();\n                if (raw === \"\") {\n                    // empty - signal with NaN\n                    onChange(NaN);\n                    return;\n                }\n                let num = parseFloat(raw);\n                if (min !== undefined && !isNaN(num) && num < min) num = min;\n                if (max !== undefined && !isNaN(num) && num > max) num = max;\n                onChange(num);\n            }}\n                    />\n                    <span class=\"unit\">${unit}</span>\n                </div>\n\n            </div>\n\n        </div>`;\n    }\n\n    private renderConfigHeader(\n        element: AbstractSingleVideoExport\n    ): unknown {\n\n\n        const isSequence = element.innerFile?.timeline.isSequence;\n        const hasAnalyses = element.parentHasAnalyses;\n\n        const slots: unknown[] = [];\n\n        const thermalScale: unknown[] = [\n            html`<manager-palette-dropdown ></manager-palette-dropdown>`,\n            html`<manager-unit-switch active-variant=\"background\"></manager-unit-switch>`,\n            html`<registry-range-form></registry-range-form>`\n        ];\n\n        slots.push(slotOrNothing(\"thermalscale\", thermalScale));\n\n        const components: unknown[] = [\n            this.renderRadio(\n                element.t(T.histogram),\n                element.renderProps.hasHistogram,\n                element.setHasHistogram.bind(element)\n            ),\n            this.renderRadio(\n                element.t(T.thermalscale),\n                element.renderProps.hasThermalScale,\n                element.setHasThermalScale.bind(element)\n            ),\n\n        ];\n\n        if (hasAnalyses) {\n            components.push(\n                this.renderRadio(\n                    element.t(T.analysis),\n                    element.renderProps.hasAnalysis,\n                    element.setHasAnalysis.bind(element)\n                )\n            );\n        }\n\n        if ( isSequence ) {\n            components.push(\n                this.renderRadio(\n                    element.t(T.timeline),\n                    element.renderProps.hasTimeline,\n                    element.setHasTimeline.bind(element)\n                )\n            );\n        }\n\n        slots.push(slotOrNothing(\"exportcontent\", components));\n\n        const appearance: unknown[] = [];\n\n        if (hasAnalyses && element.renderProps.hasAnalysis) {\n            appearance.push(\n                this.renderRadio(\n                    \"Is Vertical\",\n                    element.renderProps.isVertical,\n                    element.setIsVertical.bind(element)\n                ),\n            );\n        }\n\n        appearance.push(\n            this.renderDropdown(\n                element.renderProps.skin,\n                [\"light\", \"dark\", \"solarized\"],\n                (value: string) => element.setSkin(value as VideoExportSkin)\n            )\n        );\n\n        slots.push(slotOrNothing(\"display\", appearance));\n\n        slots.push(\n            this.renderNumber(\n                element.t(T.exportwidth),\n                \"px\",\n                element.renderProps.exportFrameWidth,\n                element.setExportFrameWidth.bind(element),\n                500,\n                1920,\n                10\n            )\n        );\n\n        slots.push(\n            this.renderNumber(\n                element.t(T.exportmargin),\n                \"px\",\n                element.renderProps.exportFramePadding,\n                element.setExportFramePadding.bind(element),\n                0,\n                100,\n                1\n            )\n        );\n\n\n        if (hasAnalyses && element.renderProps.hasAnalysis) {\n\n            slots.push(\n                this.renderNumber(\n                    element.t(T.exportgap),\n                    \"px\",\n                    element.renderProps.exportFrameGap,\n                    element.setExportFrameGap.bind(element),\n                    0,\n                    100,\n                    1\n                )\n            );\n\n            slots.push(\n                this.renderNumber(\n                    element.t(T.exportgrahpheight),\n                    \"px\",\n                    element.renderProps.exportGraphHeight,\n                    element.setExportGraphHeight.bind(element),\n                    200,\n                    700,\n                    1\n                )\n            );\n\n        }\n\n\n        const ext = isSequence ? \".mp4 / .png\" : \".png\"\n\n\n        // Název souboru\n        slots.push(\n            this.renderText(\n                element.t(T.name),\n                ext,\n                element.renderProps.fileName,\n                element.setFileName.bind(element)\n            )\n        );\n\n\n        if (isSequence) {\n\n            const options = [\n                {\n                    label: \"VERY_HIGH\",\n                    value: QUALITY_VERY_HIGH\n                },\n                {\n                    label: \"HIGH\",\n                    value: QUALITY_HIGH\n                },\n                {\n                    label: \"MEDIUM\",\n                    value: QUALITY_MEDIUM\n                },\n                {\n                    label: \"LOW\",\n                    value: QUALITY_LOW\n                },\n                {\n                    label: \"VERY_LOW\",\n                    value: QUALITY_VERY_LOW\n                }\n            ];\n\n            const choices = options.map(option => option.label);\n            const setter = (label: string) => {\n                const found = options.find(o => o.label === label);\n                if (found) {\n                    element.setMp4Quality(found.value);\n                    console.log(found.value);\n                }\n            }\n\n            const value = options.find(o => o.value === element.renderProps.mp4Quality)?.label ?? \"UNKNOWN\";\n\n            const output: unknown[] = [\n\n                this.renderDropdown(\n                    value,\n                    choices,\n                    setter.bind(this)\n                )\n\n            ];\n\n            slots.push(slotOrNothing(T.videoquality, output));\n\n        }\n\n\n\n\n\n\n        return slots;\n\n    }\n\n    public static readonly styles = css`\n    \n        .export-bar {\n\n            width: 100%;\n\n            .export-bar-part {\n            }\n\n            .export-bar-part--config {\n                display: flex;\n                flex-wrap: wrap;\n                gap: 1em 2em;\n\n                background: var( --thermal-background );\n                padding: 1em;\n\n                border-radius: var( --thermal-radius );\n\n                thermal-slot {\n                    box-sizing: border-box;\n                }\n            }\n\n            .export-bar-part--actions {\n            }\n        \n\n            .export-config-field {\n\n                &:hover,\n                &:focus-within {\n                    .export-config-field--label {\n                        color: var( --thermal-foreground );\n                        &::after {\n                            background: var( --thermal-foreground );\n                        }\n                    }\n                }\n                \n                .export-config-field--label {\n\n                    margin: 0px 0px 0.5em;\n                    padding: 0px;\n                    font-weight: normal;\n                    font-size: 0.7em;\n                    text-transform: uppercase;\n                    color: var(--thermal-slate);\n                    display: flex;\n                    align-items: center;\n                    gap: 0.5em;\n\n                    &::after {\n                        content: \"\";\n                        flex-grow: 1;\n                        height: 1px;\n                        background: var( --thermal-slate-light );\n                    }\n\n                }\n\n                .export-config-field--value {\n\n                    input {\n                        border: var( --thermal-slate-light ) solid 1px;\n                        text-align: right;\n                        font-family: var( --thermal-ff );\n                        padding: .3em .1em .3em .3em;\n                        width: 5em;\n                        display: inline-block;\n                    }\n\n                    .unit {\n                        font-size: 0.7em;\n                    }\n\n                }\n\n                &.export-config-field--text {\n                    .export-config-field--value input {\n                        width: 200px;\n                        text-align: left;\n                    }\n                }\n            \n            }\n\n        \n        }\n    \n    `;\n\n\n    public render(element: AbstractSingleVideoExport): unknown {\n\n        return html`<div class=\"export-bar\">\n\n            <div class=\"export-bar-part export-bar-part--config\">\n                ${this.renderConfigHeader(element)}\n            </div>\n        \n        </div>`;\n\n    }\n\n}\n\nexport const exportConfigDirective = directive(SingleVideoExportConfigDirective);","import { css, html, nothing } from \"lit\";\nimport { directive, Directive } from \"lit/directive.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ref } from \"lit/directives/ref.js\";\nimport type { StyleInfo } from 'lit/directives/style-map.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport type { AbstractSingleVideoExport } from \"../AbstractSingleVideoExport\";\nimport type { SingleVideoRenderProps } from \"../ISingleVideoExportElement\";\nimport { RecordingPhase } from \"../ISingleVideoExportElement\";\n\nexport class SingleVideoExportLayoutDirective extends Directive {\n\n    /** Aktuální výška vnitřního obsahu */\n    private innerHeight: number = 0;\n\n    private observer?: ResizeObserver;\n\n\n    private renderHistogram(\n        props: SingleVideoRenderProps\n    ): unknown {\n        return html`<registry-histogram style=\"display: ${props.hasHistogram ? 'block' : 'none'};\"></registry-histogram>`;\n    }\n\n    private renderThermalScale(\n        props: SingleVideoRenderProps\n    ): unknown {\n\n        return html`<div style=\"display: ${props.hasThermalScale ? 'block' : 'none'};\">\n            <registry-range-slider></registry-range-slider>\n            <registry-ticks-bar></registry-ticks-bar>\n        </div>`;\n\n    }\n    \n    private renderAnalyses(\n        props: SingleVideoRenderProps\n    ): unknown {\n\n        if ( ! props.hasAnalysis ) {\n            return nothing;\n        }\n\n        const width = ( props.exportFrameWidth / 2 ) - ( props.exportFramePadding * 2 ) - props.exportFrameGap;\n        const height = props.exportGraphHeight;\n\n        return html`<div class=\"export-element-content--analyses\">\n            <!-- Analysis content here -->\n            <file-analysis-display></file-analysis-display>\n            <file-analysis-graph \n                graphWidth=${width} \n                graphHeight=${height}\n                .hasDownloads=${false}\n                style=\"height: ${height}px; width: ${width}px; display: block;\"\n            ></file-analysis-graph>\n        </div>`;\n\n    }\n\n    private renderMainContent(\n        props: SingleVideoRenderProps\n    ): unknown {\n\n\n        const content: unknown[] = [\n            html`<file-canvas\n                .prefers-gpu=${false}\n            ></file-canvas>`,\n        ];\n\n        if ( props.hasTimeline ) {\n            content.push(html`<file-timeline hasplaybutton=\"false\"></file-timeline>`);\n        }\n\n        return html`<div>\n            ${content}\n        </div>`;\n\n    }\n\n    public static readonly styles = css`\n    \n        .export-element {\n\n            position: relative;\n\n\n            --thermal-export-bg: white;\n            --thermal-export-fg: black;\n\n            --thermal-crop: 2em;\n\n            padding: var( --thermal-crop );\n\n            box-sizing: border-box;\n\n            .crop {\n                position: absolute;\n                width: var( --thermal-crop );\n                height: var( --thermal-crop );\n                box-sizing: border-box;\n\n                &.crop-t {\n                    top: 0;\n                }\n\n                &.crop-b {\n                    bottom: 0;\n                }\n\n                &.crop-l {\n                    left: 0;\n                }\n\n                &.crop-r {\n                    right: 0;\n                }\n\n                --thermal-export-crop-border-width: 3px;\n                --thermal-export-border-color: var( --thermal-background );\n\n                &.crop-t.crop-l {\n                    border-bottom: var(--thermal-export-crop-border-width) solid var(--thermal-export-border-color);\n                    border-right: var(--thermal-export-crop-border-width) solid var(--thermal-export-border-color);\n                }\n\n                &.crop-t.crop-r {\n                    border-bottom: var(--thermal-export-crop-border-width) solid var(--thermal-export-border-color);\n                    border-left: var(--thermal-export-crop-border-width) solid var(--thermal-export-border-color);\n                }\n\n                &.crop-b.crop-l {\n                    border-top: var(--thermal-export-crop-border-width) solid var(--thermal-export-border-color);\n                    border-right: var(--thermal-export-crop-border-width) solid var(--thermal-export-border-color);\n                }\n\n                &.crop-b.crop-r {\n                    border-top: var(--thermal-export-crop-border-width) solid var(--thermal-export-border-color);\n                    border-left: var(--thermal-export-crop-border-width) solid var(--thermal-export-border-color);\n                }\n            }\n\n\n            .export-overlay {\n                width: 100%;\n                height: 100%;\n                position: absolute;\n                top: 0;\n                left: 0;\n                z-index: 99;\n                cursor: help;\n\n                box-sizing: border-box;\n                padding: var( --thermal-crop );\n\n                transition: all .3s ease;\n\n                display: flex;\n                align-items: stretch;\n                justify-content: stretch;\n\n                \n\n                span {\n\n                    font-size: 3em;\n                    font-weight: normal !important;\n\n                    width: 100%;\n                    padding: 1em;\n                \n                    opacity: 0;\n                    display: flex;\n                    align-items: center;\n                    justify-content: center;\n                    \n                    box-sizing: outline-box;\n\n                    transition: opacity .3s ease;\n                    \n                    color: var( --thermal-export-bg );\n                    \n                }\n\n                &:hover {\n                    span {\n                        background: color-mix(in srgb, var( --thermal-export-fg ) 50%, transparent);\n                        opacity: 1;\n                    }\n                }\n            }\n\n            .export-element-content {\n                display: grid;\n                box-sizing: border-box;\n                background-color: var( --thermal-export-bg );\n\n                .export-element-content--analyses {\n\n                    display: grid;\n                    gap: 1em;\n                    grid-template-columns: 100%;\n                    grid-template-rows: 1fr auto;\n                \n                }\n\n            }\n\n\n\n            &.vertical {\n                &.hasAnalysis {\n\n                    .export-element-content {\n                        grid-template-columns: auto;\n                        grid-template-rows: auto auto;\n                    }\n        \n                }\n            }\n\n            &.horizontal {\n                &.hasAnalysis {\n\n                    .export-element-content {\n                        grid-template-columns: 1fr 1fr;\n                        grid-template-rows: auto;\n                    }\n                }\n            }\n\n            &.hasAnalysis {\n\n            }\n\n            &.hasTimeline {\n            \n            }\n\n            &.hasHistogram {\n            \n            }\n\n            &.hasThermalScale {\n            \n            }\n\n            \n\n            &.skin-light {\n                --thermal-export-bg: white;\n                --thermal-export-fg: black;\n                --thermal-slate: var( --thermal-slate-base );\n                --thermal-slate-dark: var( --thermal-slate-base-dark );\n                --thermal-slate-light: var( --thermal-slate-base-light );\n                --thermal-foreground: black;\n                --thermal-background: white;\n                --thermal-primary: var( --thermal-primary-base );\n            }\n\n            &.skin-dark {\n                --thermal-export-bg: black;\n                --thermal-export-fg: white;\n                --thermal-background: black;\n                --thermal-foreground: white;\n                --thermal-slate: gray;\n                --thermal-slate-dark: darkgray;\n                --thermal-slate-light: lightgray;\n            }\n\n            &.skin-solarized {\n                --thermal-export-bg: #1d5766ff;\n                --thermal-export-fg: white;\n                --thermal-background: #1d5766ff;\n                --thermal-foreground: white;\n                --thermal-slate: #27888bff;\n                --thermal-slate-dark: #39aaa1ff;\n                --thermal-slate-light: #073642;\n            }\n\n        \n        }\n    \n    `;\n\n    private initObserver( \n        svgElement: HTMLElement\n    ): void {\n\n        if ( this.observer ) {\n            return;\n        }\n\n        const contentElement = svgElement?.querySelector(\".export-element-content\");\n\n        if ( ! contentElement ) {\n            return;\n        }\n\n        this.observer = new ResizeObserver((entries) => {\n            for (const entry of entries) {\n\n                this.innerHeight = entry.borderBoxSize[0].blockSize;\n                \n                // Aktualizuj SVG výšku\n                svgElement.setAttribute(\"height\", String(this.innerHeight));\n            }\n        });\n\n        this.observer.observe(contentElement);\n\n    }\n    \n    render(\n        app: AbstractSingleVideoExport\n    ): unknown {\n\n        const reference = app.exportedDivRef;\n        const props = app.renderProps;\n\n        if ( reference.value ) {\n            this.initObserver( reference.value );\n        }\n\n        const mainClasses = {\n\n            \"export-element\": true,\n\n            vertical: props.isVertical,\n            horizontal: ! props.isVertical,\n\n            hasAnalysis: props.hasAnalysis,\n            hasHistogram: props.hasHistogram,\n            hasTimeline: props.hasTimeline,\n            hasThermalScale: props.hasThermalScale,\n            [\"skin-\" + props.skin]: true\n\n        }\n\n        // Při exportu použij vždy scale 1\n        const isExporting = app.recordingPhase !== RecordingPhase.IDLE;\n        const effectiveScale = isExporting ? 1 : props.previewScale;\n\n        const containerStyle: StyleInfo = {\n            width: `calc( ${props.exportFrameWidth}px + var( --thermal-crop ) * 2 )`,\n            scale: String( effectiveScale )\n        };\n\n        const contentStyle: StyleInfo = {\n            width: props.exportFrameWidth + \"px\",\n            gap: props.exportFrameGap + \"px\",\n            padding: props.exportFramePadding + \"px\"\n        }\n\n        const mainContent = [\n            this.renderHistogram( props ),\n            this.renderThermalScale( props ),\n            this.renderMainContent( props )\n        ];\n\n        const analyses = this.renderAnalyses( props );\n\n        return html`<!-- The main content rendered through the SingleVideoExportLayoutDirective -->\n        <main\n            class=${classMap(mainClasses)}\n            style=${styleMap(containerStyle)}\n        >\n            <b class=\"crop crop-t crop-l\"></b>\n            <b class=\"crop crop-t crop-r\"></b>\n            <b class=\"crop crop-b crop-l\"></b>\n            <b class=\"crop crop-b crop-r\"></b>\n\n            <section \n                ${ref(reference)}\n                class=\"export-element-content\" \n                style=${styleMap(contentStyle)}\n            >\n\n                <div class=\"export-element-content--main\">\n                    ${ mainContent }\n                </div>\n\n                ${analyses}\n\n            </section>\n\n            <aside class=\"export-overlay\">\n                <span>\n                    <strong>Náhled</strong>\n                </span>\n            </aside>\n\n        </main>\n        \n        `;\n\n\n    }\n\n}\n\nexport const exportLayoutDirective = directive( SingleVideoExportLayoutDirective );\n","import { html, nothing } from \"lit\";\nimport { directive, Directive } from \"lit/directive.js\";\nimport { ref } from \"lit/directives/ref.js\";\nimport type { AbstractSingleVideoExport } from \"../AbstractSingleVideoExport\";\n\nclass SingleVideoExportDirective extends Directive {\n\n    protected renderWrappedWithNestedProviders(\n        app: AbstractSingleVideoExport,\n        content: unknown\n    ): unknown {\n\n        const registry = app.registryObject;\n        const group = app.groupObject;\n\n        if (!registry || !group) {\n            return nothing;\n        }\n\n        return html`<registry-provider \n            slug=\"${app.slug}\"\n            style=\"display: contents;\"\n        >\n            <group-provider \n                slug=${app.slug}\n                style=\"display: contents;\"\n            >\n                <file-copy \n                    .originalFile=${app.outerFile} \n                    .withAnalyses=${app.renderProps.hasAnalysis}\n                    ${ref(app.fileCopyElementRef)}\n                >\n                    ${content}\n                </file-copy>\n            </group-provider>\n        </registry-provider>`;\n\n    }\n\n\n\n    public render(element: AbstractSingleVideoExport, content: unknown): unknown {\n\n        return this.renderWrappedWithNestedProviders( element, content );\n    }\n\n\n\n}\n\nexport const singleVideoProviders = directive(SingleVideoExportDirective);","import type { ThermalFileInstance } from \"@labirthermal/core\";\nimport type { CSSResultGroup, PropertyValues } from \"lit\";\nimport { css, html, nothing } from \"lit\";\nimport { state } from \"lit/decorators.js\";\nimport type { Ref } from \"lit/directives/ref.js\";\nimport { createRef, ref } from \"lit/directives/ref.js\";\nimport { T } from \"../../../translations/Languages\";\nimport { AbstractSingleVideoExport } from \"./AbstractSingleVideoExport\";\nimport { exportConfigDirective, SingleVideoExportConfigDirective } from \"./directives/SingleVideoExportConfigDirective\";\nimport { exportLayoutDirective, SingleVideoExportLayoutDirective } from \"./directives/SingleVideoExportLayoutDirective\";\nimport { singleVideoProviders } from \"./directives/SingleVideoExportProvidersDirective\";\nimport { RecordingPhase } from \"./ISingleVideoExportElement\";\n\nexport class FileVideoExportPanel extends AbstractSingleVideoExport {\n\n    /** Reference na preview sekci pro měření výšky */\n    private previewSectionRef: Ref<HTMLElement> = createRef();\n\n    /** ResizeObserver pro automatické škálování */\n    private previewResizeObserver?: ResizeObserver;\n\n    /** ResizeObserver pro sledování rozměrů exportovaného elementu */\n    private exportSizeObserver?: ResizeObserver;\n\n    /** Reálná šířka exportu v pixelech */\n    @state() private exportRealWidth: number = 0;\n\n    /** Reálná výška exportu v pixelech */\n    @state() private exportRealHeight: number = 0;\n\n    public onInstanceCreated(instance: ThermalFileInstance): void {\n        this.parentHasAnalyses = instance.analysis.value.length > 0;\n    }\n\n    public onFailure(): void {}\n\n    connectedCallback(): void {\n        super.connectedCallback();\n        this.setupResizeObserver();\n    }\n\n    disconnectedCallback(): void {\n        super.disconnectedCallback();\n        this.previewResizeObserver?.disconnect();\n        this.exportSizeObserver?.disconnect();\n    }\n\n    updated(_changedProperties: PropertyValues): void {\n        super.updated(_changedProperties);\n        // Zajisti, že observer je nastaven po renderování\n        this.setupResizeObserver();\n        this.setupExportSizeObserver();\n    }\n\n    /** Nastaví ResizeObserver pro automatické škálování */\n    private setupResizeObserver(): void {\n        if (this.previewResizeObserver || !this.previewSectionRef.value) {\n            return;\n        }\n\n        this.previewResizeObserver = new ResizeObserver((entries) => {\n            if (!this.renderProps.autoScale) {\n                return;\n            }\n\n            for (const entry of entries) {\n                this.calculateAutoScale(entry.contentRect.height);\n            }\n        });\n\n        this.previewResizeObserver.observe(this.previewSectionRef.value);\n    }\n\n    /** Nastaví ResizeObserver pro sledování rozměrů exportovaného elementu */\n    private setupExportSizeObserver(): void {\n        if (this.exportSizeObserver || !this.exportedDivRef.value) {\n            return;\n        }\n\n        // Sledujeme parent element (main.export-element), který obsahuje crop padding\n        const exportMainElement = this.exportedDivRef.value.parentElement;\n        if (!exportMainElement) {\n            return;\n        }\n\n        this.exportSizeObserver = new ResizeObserver((entries) => {\n            for (const entry of entries) {\n                // contentRect je ve vlastních souřadnicích elementu (bez CSS transform/scale)\n                this.exportRealWidth = Math.round(entry.contentRect.width);\n                this.exportRealHeight = Math.round(entry.contentRect.height);\n            }\n        });\n\n        this.exportSizeObserver.observe(exportMainElement);\n    }\n\n    /** Přepsaná metoda z AbstractSingleVideoExport - reaguje na změny layout vlastností */\n    protected override onLayoutAffectingPropertyChanged(): void {\n        if (!this.renderProps.autoScale) {\n            return;\n        }\n\n        // Počkej na dokončení renderování a pak přepočti scale\n        this.updateComplete.then(() => {\n            // Další frame pro jistotu, že DOM je plně aktualizován\n            requestAnimationFrame(() => {\n                this.triggerAutoScaleRecalculation();\n            });\n        });\n    }\n\n    /** Spustí přepočet autoScale na základě aktuální velikosti preview sekce */\n    private triggerAutoScaleRecalculation(): void {\n        if (!this.previewSectionRef.value) {\n            return;\n        }\n        const availableHeight = this.previewSectionRef.value.clientHeight;\n        this.calculateAutoScale(availableHeight);\n    }\n\n    /** Vypočítá scale na základě dostupné výšky */\n    private calculateAutoScale(availableHeight: number): void {\n        const exportedElement = this.exportedDivRef.value;\n        if (!exportedElement) {\n            return;\n        }\n\n        // Získej reálnou výšku exportovaného obsahu (bez scale)\n        // Musíme vzít v úvahu aktuální scale\n        const currentScale = this.renderProps.previewScale;\n        const currentHeight = exportedElement.getBoundingClientRect().height;\n        const realHeight = currentHeight / currentScale;\n\n        if (realHeight <= 0 || availableHeight <= 0) {\n            return;\n        }\n\n        // Vypočítej nový scale tak, aby se obsah vešel do dostupné výšky\n        // Přidáme malý padding (20px) pro okraje\n        const padding = 20;\n        const newScale = Math.min(1, (availableHeight - padding) / realHeight);\n\n        // Omez scale na rozumné rozmezí\n        const clampedScale = Math.max(0.1, Math.min(1, newScale));\n\n        // Aktualizuj pouze pokud je rozdíl větší než 1% (prevence nekonečné smyčky)\n        if (Math.abs(clampedScale - this.renderProps.previewScale) > 0.01) {\n            this.renderProps.previewScale = clampedScale;\n            this.requestUpdate();\n        }\n    }\n\n    static styles?: CSSResultGroup | undefined = [\n        SingleVideoExportLayoutDirective.styles,\n        SingleVideoExportConfigDirective.styles,\n        css`\n            :host {\n                font-size: var( --thermal-fs );\n                color: var( --thermal-foreground );\n                display: grid;\n                grid-template-rows: auto 1fr auto;\n                gap: 1em;\n                height: 100%;\n                min-height: 0;\n                max-height: 100%;\n            }\n\n\n            .preview {\n                overflow: hidden;\n                display: flex;\n                align-items: center;\n                justify-content: center;\n                min-height: 0; /* klíčové - povolí zmenšení pod velikost obsahu */\n                position: relative;\n\n                background: var( --thermal-slate );\n\n                border-radius: var( --thermal-radius );\n\n\n                .preview-size {\n                \n                    position: absolute;\n                    bottom: 1em;\n                    right: 1em;\n\n                    z-index: 10000;\n\n                    display: flex;\n                    flex-direction: column;\n                    align-items: flex-end;\n                    gap: 0.5em;\n\n                    \n\n                    & > * {\n                        background: var( --thermal-slate-light );\n                        border-radius: var( --thermal-radius );\n                        box-sizing: border-box;\n                        padding: 0.5em 0.75em;\n                        text-align: right;\n                        font-size: .8em;\n\n                        .preview-label {\n                            text-transform: uppercase;\n                            \n                            font-weight: normal;\n                            margin-bottom: .25em;\n                            text-align: right;\n                            opacity: .8;\n                        }\n\n                        .preview-value {\n                            font-weight: bold;\n                        }\n                    }\n\n                    .preview-size--export {\n                        thermal-radio {\n                            display: inline-block;\n                        }\n                    }\n\n                }\n\n            }\n\n            .progress-overlay {\n            \n                position: absolute;\n                top: 0;\n                left: 0;\n                width: 100%;\n                height: 100%;\n\n                z-index: 100000;\n\n                display: flex;\n                align-items: center;\n                justify-content: center;\n\n                text-align: center;\n\n                background: color-mix(in srgb, var( --thermal-slate-light ) 90%, transparent);\n\n                .progress-overlay-content {\n                \n                    display: flex;\n                    flex-direction: column;\n                    gap: 1em;\n\n                    div {\n                        color: var( --thermal-slate-dark );\n                    }\n                }\n            \n            }\n        `\n    ]\n\n    private renderHeader(): unknown {\n\n        return html`<header class=\"controls\">\n            ${exportConfigDirective(this)}\n        </header>`;\n\n    }\n\n    private renderPreview(): unknown {\n        const isExporting = this.recordingPhase !== RecordingPhase.IDLE;\n\n        return html`<section class=\"preview\" ${ref(this.previewSectionRef)}>\n            ${exportLayoutDirective(this)}\n\n            ${!isExporting ? html`\n                <div class=\"preview-size\">\n                    <div class=\"preview-size--export\">\n                        <div class=\"preview-label\">Export</div>\n                        <div class=\"preview-value\">${this.exportRealWidth} × ${this.exportRealHeight} px</div>\n                    </div>\n                    <div class=\"preview-size--preview\">\n                        <div class=\"preview-label\">Náhled</div>\n\n                        <div class=\"preview-value\">Zoom: ${(this.renderProps.previewScale * 100).toFixed(0)}%</div>\n\n\n                        ${!this.renderProps.autoScale ? html`\n                            <input \n                                type=\"range\" \n                                min=\"0.1\" \n                                max=\"1\" \n                                step=\"0.01\" \n                                .value=${String(this.renderProps.previewScale)} \n                                @input=${(e: Event) => {\n                                    const input = e.target as HTMLInputElement;\n                                    const value = parseFloat(input.value);\n                                    this.setPreviewScale(value);\n                                }}\n                            />\n                        ` : nothing }\n\n                        <thermal-radio\n                            .checked=${this.renderProps.autoScale} \n                            .onChange=${(checked: boolean) => {\n                                this.setAutoScale(checked);\n                            }}\n                        >Automatické přiblížení</thermal-radio>\n                        \n                    </div>\n                </div>\n            ` : html``}\n\n        </section>`;\n    }\n\n    private renderOverview(): unknown {\n\n        if ( this.recordingPhase === RecordingPhase.IDLE ) {\n            return nothing;\n        }\n\n        let message = this.t( T.exportencodingfile );\n\n        if ( this.recordingPhase === RecordingPhase.RECORDING ) {\n            message = `${this.t( T.exportrecordingframes )} ${this.recordingPhaseProgress.toFixed(2)}%`;\n        }\n\n        return html`<div\n            class=\"progress-overlay\"\n        >\n\n            <div class=\"progress-overlay-content\">\n\n                <thermal-spinner\n                    .message=${message}\n                ></thermal-spinner>\n\n                <div>${this.t(T.exportdonotclosewindowhint)}</div>\n\n            </div>\n            \n        </div>`;\n\n    }\n\n    private renderFooter(): unknown {\n        return html`<footer class=\"footer\">\n            <file-timeline></file-timeline>\n        </footer>`;\n    }\n\n    protected render(): unknown {\n        return singleVideoProviders(this, [\n            this.renderHeader(),\n            this.renderPreview(),\n            this.renderFooter(),\n            this.renderOverview()\n        ] );\n    }\n\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        \"file-video-export-panel\": FileVideoExportPanel;\n    }\n}\n","import { t } from \"i18next\";\nimport type { CSSResultGroup } from \"lit\";\nimport { css, html, nothing } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { AbstractFileConsumer } from \"../hierarchy/consumers/AbstractFileConsumer\";\nimport { T } from \"../translations/Languages\";\n\nexport class FileDetailElement extends AbstractFileConsumer {\n\n    @property({ type: Object })\n    onback?: () => void;\n\n    @property({ type: Boolean, reflect: true })\n    public norender: boolean = false;\n\n    @property({ type: String })\n    public label?: string;\n\n    public onInstanceCreated(): void {}\n\n    public onFailure(): void { }\n\n    static styles?: CSSResultGroup | undefined = css`\n    \n        :host {\n            display: block;\n            width: 100%;\n            box-sizing: border-box;\n        }\n\n        main {\n            display: grid;\n            gap: var(--thermal-gap);\n            grid-template-columns: 1fr;\n            @media ( min-width: 900px ) {\n                grid-template-columns: 2fr 1fr;\n            }\n            @media ( min-width: 1300px ) {\n                grid-template-columns: 1fr 1fr;\n            }\n        }\n\n        header {\n            width: 100%;\n            display: flex;\n            gap: 5px;\n            margin-bottom: var(--thermal-gap);\n            align-items: stretch;\n        }\n    \n    `;\n\n    protected render(): unknown {\n\n        return html`<header>\n    <thermal-btn \n        variant=\"foreground\" \n        @click=${() => {\n            if (this.onback)\n                this.onback();\n            }}\n        tooltip=${t(T.back)}\n        icon=\"close\"\n        iconStyle=\"micro\"\n    ></thermal-btn>\n\n    ${this.label !== undefined ? html`\n    <thermal-btn variant=\"background\" non-interactive>${this.label}</thermal-btn>` : nothing}\n\n    <thermal-btn variant=\"background\" non-interactive>\n        <file-label></file-label>\n    </thermal-btn>\n\n    <file-info-button></file-info-button>\n    <file-download-dropdown></file-download-dropdown>\n</header>\n\n<main>\n    <section>\n        <file-canvas norender=\"${this.norender}\"></file-canvas>\n        <file-timeline></file-timeline>\n    </section>\n    <section>\n        <file-analysis-complex></file-analysis-complex>\n    </section>\n</main>`;}\n\n}","import type { ThermalFileInstance } from \"@labirthermal/core\";\nimport { t } from \"i18next\";\nimport type { CSSResultGroup } from \"lit\";\nimport { css, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { AbstractFileConsumer } from \"../hierarchy/consumers/AbstractFileConsumer\";\nimport { T } from \"../translations/Languages\";\n\nexport class FileThumbnailElement extends AbstractFileConsumer {\n\n    @property({ type: Object })\n    ondetail?: (file: ThermalFileInstance) => void;\n\n    @property({ type: Boolean, reflect: true, attribute: \"no-render\" })\n    public norender: boolean = false;\n\n    @property({ type: String })\n    public label?: string;\n\n    public onInstanceCreated(): void {}\n\n    public onFailure(): void {}\n\n    static styles?: CSSResultGroup | undefined = css`\n    \n        :host {\n            display: block;\n            width: 100%;\n            box-sizing: border-box;\n        }\n\n        header {\n            width: 100%;\n            display: flex;\n            flex-wrap: nowrap;\n            align-items: center;\n            padding-bottom: 5px;\n            color: var(--thermal-foreground);\n            \n            h2 {\n                margin: 0;\n                padding: 0;\n                flex-grow: 1;\n                overflow: hidden;\n                text-overflow: ellipsis;\n                font-size: var( --thermal-fs-sm );\n\n                file-label {\n                    white-space: preserve nowrap;\n                }\n\n                &:hover {\n                    cursor: pointer;\n                    color: var( --thermal-primary );\n                }\n            }\n\n            & > div {\n                display: flex;\n                flex-wrap: nowrap;\n                gap: 5px;\n            }\n\n        }\n    \n    `;\n\n    protected render(): unknown {\n\n        return html`\n\n            <header>\n                <h2\n                    @click=${() => this.ondetail?.(this.file!)}\n                >\n                    <file-label label=\"${ifDefined(this.label)}\"></file-label>\n                </h2>\n                <div>\n                    <thermal-btn size=\"sm\" variant=\"background\" @click=${() => this.ondetail?.(this.file!)}>${t(T.detail).toLocaleLowerCase()}</thermal-btn>\n                    <file-range-propagator></file-range-propagator>\n                    <file-dropdown>\n                        <file-info-button>\n                            <file-button slot=\"invoker\" label=${t(T.info).toLowerCase()}></file-button>\n                        </file-info-button>\n                        <file-download-lrc></file-download-lrc>\n                        <file-download-png></file-download-png>\n                    </file-dropdown>\n                </div>\n            </header>\n\n            <main>\n                <file-canvas norender=\"${this.norender}\"></file-canvas>\n                <file-timeline></file-timeline>\n                <file-analysis-table table-mode=\"compact\"></file-analysis-table>\n            </main>\n        \n    `;\n    }\n\n}","import {name, version} from \"../package.json\";\n\nimport { AatAppElement } from \"./apps/AustralianApparentTemperature\";\nimport { ThermalDropinAppElement } from \"./apps/ThermalDropinApp\";\nimport { ThermalFileAppElement } from \"./apps/ThermalFileApp\";\nimport { ThermalGroupAppElement } from \"./apps/ThermalGroupApp\";\nimport { ThermalSlottedAppElement } from \"./apps/ThermalSlottedApp\";\nimport { ThermalChartElement } from \"./controls/file/analysis/chart/chart\";\nimport { AnalysisColorDropdown } from \"./controls/file/analysis/edit/analysisColorDropdown\";\nimport { AnalysisNameInput } from \"./controls/file/analysis/edit/analysisNameInput\";\nimport { AreaEditTable } from \"./controls/file/analysis/edit/editAreaTable\";\nimport { EditpointTable } from \"./controls/file/analysis/edit/editPointTable\";\nimport { FileAnalysisComplexElement } from \"./controls/file/analysis/FileAnalysisComplex\";\nimport { FileAnalysisDisplayElement } from \"./controls/file/analysis/FileAnalysisDisplay\";\nimport { FileAnalisisEditDialog } from \"./controls/file/analysis/FileAnalysisEdit\";\nimport { FileAnalysisGraphElement } from \"./controls/file/analysis/FileAnalysisGraph\";\nimport { FileAnalysisRowElement } from \"./controls/file/analysis/FileAnalysisRow\";\nimport { FileAnalysisTableElement } from \"./controls/file/analysis/FileAnalysisTable\";\nimport { FileButtonElement } from \"./controls/file/buttons/FileButton\";\nimport { FileDropdown } from \"./controls/file/buttons/FileDropdown\";\nimport { FileLrcButton } from \"./controls/file/buttons/FileLrcButton\";\nimport { FilePngButton } from \"./controls/file/buttons/FilePngButton\";\nimport { FileRangePropagator } from \"./controls/file/buttons/FileRangePropagator\";\nimport { FileCanvasElement } from \"./controls/file/FileCanvas\";\nimport { FileDownloadButton } from \"./controls/file/FileDownloadDropdown\";\nimport { FileInfoButton } from \"./controls/file/FileInfoButton\";\nimport { FileLabelElement } from \"./controls/file/fileLabel\";\nimport { FilePlaybackSpeedDropdown } from \"./controls/file/FilePlaybackSpeedDropdown\";\nimport { FileTimelineElement } from \"./controls/file/FileTimelineElement\";\nimport { FileVideoExportButton } from \"./controls/file/FileVideoExportButton\";\nimport { FileVideoExportPanel } from \"./controls/file/video/FileVideoExportPanel\";\nimport { GroupAnalysisSyncButton } from \"./controls/group/GroupAnalysisSyncButton\";\nimport { GroupChartElement } from \"./controls/group/GroupChartElement\";\nimport { GroupDownloadButtons } from \"./controls/group/GroupDownloadButtons\";\nimport { GroupDownloadDropdown } from \"./controls/group/GroupDownloadDropdown\";\nimport { GroupDropinElement } from \"./controls/group/GroupDropinElement\";\nimport { GroupDropinInputElement } from \"./controls/group/GroupDropinInput\";\nimport { GroupRangePropagatorElement } from \"./controls/group/GroupRangePropagator\";\nimport { GroupTimelineElement } from \"./controls/group/GroupTimeline\";\nimport { ManagerAdvancedPaletteSwitch } from \"./controls/manager/ManagerAdvancedPaletteSwitch\";\nimport { ManagerExportPanel } from \"./controls/manager/ManagerExportPanel\";\nimport { ManagerGraphSmoothSwitch } from \"./controls/manager/ManagerGraphSmoothSwitch\";\nimport { ManagerImageSmoothSwitch } from \"./controls/manager/ManagerImageSmoothSwitch\";\nimport { ManagerPaletteButtons } from \"./controls/manager/ManagerPaletteButtons\";\nimport { ManagerPaletteDropdown } from \"./controls/manager/ManagerPaletteDropdown\";\nimport { ManagerToolBar } from \"./controls/manager/ManagerToolsBar\";\nimport { ManagerUnitSwitch } from \"./controls/manager/ManagerUnitSwitch\";\nimport { RegistryHistogram } from \"./controls/registry/RegistryHistogram\";\nimport { RegistryOpacitySlider } from \"./controls/registry/RegistryOpacitySlider\";\nimport { RegistryRangeAutoButton } from \"./controls/registry/RegistryRangeAutoButton\";\nimport { RegistryRangeDisplay } from \"./controls/registry/RegistryRangeDisplay\";\nimport { RegistryRangeForm } from \"./controls/registry/RegistryRangeForm\";\nimport { RegistryRangeFullButton } from \"./controls/registry/RegistryRangeFullButton\";\nimport { RegistryRangeSlider } from \"./controls/registry/RegistryRangeSlider\";\nimport { RegistryTicksBar } from \"./controls/registry/RegistryTicksBar\";\nimport { FileCopyElement } from \"./hierarchy/providers/FileCopy\";\nimport { FileProviderElement } from \"./hierarchy/providers/FileProvider\";\nimport { GroupProviderElement } from \"./hierarchy/providers/GroupProvider\";\nimport { ManagerProviderElement } from \"./hierarchy/providers/ManagerProvider\";\nimport { RegistryProviderElement } from \"./hierarchy/providers/RegistryProvider\";\nimport { FileDetailElement } from \"./renderers/FileDetail\";\nimport { FileThumbnailElement } from \"./renderers/FileThumbnail\";\nimport { ThermalAppElement } from \"./ui/App\";\nimport { ThermalBarElement } from \"./ui/Bar\";\nimport { ThermalBtnElement } from \"./ui/Btn\";\nimport { ThermalBtnGroupElement } from \"./ui/BtnGroup\";\nimport { ThermalDialogElement } from \"./ui/Dialog\";\nimport { ThermalDropdownElement } from \"./ui/Dropdown\";\nimport { ThermalDropinElement } from \"./ui/Dropin\";\nimport { ThermalExpandableElement } from \"./ui/Expandable\";\nimport { ThermalFieldElement } from \"./ui/Field\";\nimport { ThermalIconElement } from \"./ui/Icon\";\nimport { ThermalPosterElement } from \"./ui/Loading\";\nimport { ThermalRadioElement } from \"./ui/Radio\";\nimport { ThermalSlotElement } from \"./ui/Slot\";\nimport { ThermalSpinnerElement } from \"./ui/Spinner\";\nimport { ThermalTipElement } from \"./ui/Tip\";\nimport { defineAllWebcomponents } from \"./utils/iife\";\n\n/**\n * List of the UI components\n */\nexport const elementsUi = {\n    \"thermal-app\": ThermalAppElement,\n    \"thermal-bar\": ThermalBarElement,\n    \"thermal-btn\": ThermalBtnElement,\n    \"thermal-btn-group\": ThermalBtnGroupElement,\n    \"thermal-dialog\": ThermalDialogElement,\n    \"thermal-dropdown\": ThermalDropdownElement,\n    \"thermal-dropin\": ThermalDropinElement,\n    \"thermal-expandable\": ThermalExpandableElement,\n    \"thermal-field\": ThermalFieldElement,\n    \"thermal-icon\": ThermalIconElement,\n    \"thermal-loading\": ThermalPosterElement,\n    \"thermal-radio\": ThermalRadioElement,\n    \"thermal-slot\": ThermalSlotElement,\n    \"thermal-spinner\": ThermalSpinnerElement,\n    \"thermal-tip\": ThermalTipElement\n} as const;\n\nexport const independentElements = {\n\n} as const;\n\n/**\n * List of provider components\n */\nexport const elementsProviders = {\n    // This needs to go first\n    \"manager-provider\": ManagerProviderElement,\n    // This needs to go second\n    \"registry-provider\": RegistryProviderElement,\n    // This needs to go third\n    \"group-provider\": GroupProviderElement,\n    // This needs to go last\n    \"file-provider\": FileProviderElement,\n    \"file-copy\": FileCopyElement,\n\n} as const;\n\n\nconst elementsManagerControls = {\n    \"manager-image-smooth-switch\": ManagerImageSmoothSwitch,\n    \"manager-graph-smooth-switch\": ManagerGraphSmoothSwitch,\n    \"manager-advanced-palette-switch\": ManagerAdvancedPaletteSwitch,\n    \"manager-palette-dropdown\": ManagerPaletteDropdown,\n    \"manager-palette-buttons\": ManagerPaletteButtons,\n    \"manager-tool-bar\": ManagerToolBar,\n    \"manager-unit-switch\": ManagerUnitSwitch,\n    /** @deprecated This sort of export should never be used. Please, do export thermal images only through the LIT components instead of the `@labirthermal/core` export. */\n    \"manager-export-panel\": ManagerExportPanel\n} as const;\n\nconst elementsRegistryControls = {\n    \"registry-histogram\": RegistryHistogram,\n    \"registry-opacity-slider\": RegistryOpacitySlider,\n    \"registry-range-auto-button\": RegistryRangeAutoButton,\n    \"registry-range-full-button\": RegistryRangeFullButton,\n    \"registry-range-display\": RegistryRangeDisplay,\n    \"registry-range-form\": RegistryRangeForm,\n    \"registry-range-slider\": RegistryRangeSlider,\n    \"registry-ticks-bar\": RegistryTicksBar\n} as const;\n\nconst elementsGroupControls = {\n    \"group-analysis-sync-button\": GroupAnalysisSyncButton,\n    \"group-chart\": GroupChartElement,\n    \"group-download-buttons\": GroupDownloadButtons,\n    \"group-download-dropdown\": GroupDownloadDropdown,\n    \"group-dropin-element\": GroupDropinElement,\n    \"group-dropin-input\": GroupDropinInputElement,\n    \"group-range-propagator\": GroupRangePropagatorElement,\n    \"group-timeline\": GroupTimelineElement\n} as const;\n\nconst elementsFileControls = {\n    \"file-canvas\": FileCanvasElement,\n    \"file-download-dropdown\": FileDownloadButton,\n    \"file-info-button\": FileInfoButton,\n    \"file-playback-speed-dropdown\": FilePlaybackSpeedDropdown,\n    \"file-timeline\": FileTimelineElement,\n    \"file-video-export-button\": FileVideoExportButton,\n    \"file-video-export-panel\": FileVideoExportPanel,\n    \"file-label\": FileLabelElement,\n    \"file-button\": FileButtonElement,\n    \"file-dropdown-elt\": FileDropdown,\n    \"file-download-lrc\": FileLrcButton,\n    \"file-download-png\": FilePngButton,\n    \"file-range-propagator\": FileRangePropagator,\n    \"file-analysis-complex\": FileAnalysisComplexElement,\n    \"file-analysis-display\": FileAnalysisDisplayElement,\n    \"file-analysis-edit\": FileAnalisisEditDialog,\n    \"file-analysis-graph\": FileAnalysisGraphElement,\n    \"file-analysis-table-row\": FileAnalysisRowElement,\n    \"file-analysis-table\": FileAnalysisTableElement,\n    \"analysis-color\": AnalysisColorDropdown,\n    \"analysis-name\": AnalysisNameInput,\n    \"edit-area\": AreaEditTable,\n    \"edit-point\": EditpointTable,\n    \"thermal-chart\": ThermalChartElement,\n    \"file-detail\": FileDetailElement,\n    \"file-thumbnail\": FileThumbnailElement\n    \n\n} as const;\n\n\n\nconst elementsApplications = {\n    \"apparent-temperature-aat\": AatAppElement,\n    \"thermal-dropin-app\": ThermalDropinAppElement,\n    \"thermal-file-app\": ThermalFileAppElement,\n    \"thermal-group-app\": ThermalGroupAppElement,\n    \"thermal-simple-app\": ThermalSlottedAppElement\n} as const;\n\n/** \n * All the webcomponents from the @labirthermal/webcomponents package in a list for the purpose of its registration in `defineAllWebcomponents`.\n * @see {@link defineBaseWebcomponents}\n */\nexport const elementsAll = {\n    ...elementsProviders,\n    ...elementsUi,\n    ...elementsManagerControls,\n    ...elementsRegistryControls,\n    ...elementsGroupControls,\n    ...elementsFileControls,\n    ...elementsApplications\n} as const;\n\nexport const isLabirthermalWebcomponent = (tag: string): boolean => {\n    return tag in elementsAll;\n};\n\n/** Define all webcomponents from the @labirthermal/webcomponents package */\nexport const defineBaseWebcomponents = () => {\n    defineAllWebcomponents(name, version, elementsAll)\n}","// Converters\nexport { numberRangeConverter } from \"./utils/converters/numberRangeConverter\";\nexport { booleanConverter } from \"./utils/converters/booleanConverter\";\nexport { paletteConverter } from \"./utils/converters/paletteConverter\";\nexport { stringOrUndefinedConverter } from \"./utils/converters/stringOrUndefinedConverter\";\nexport { durationConverter } from \"./utils/converters/durationConverter\";\nexport { unitConverter, parseThermalUnit } from \"./utils/converters/unitConverter\";\nexport { optionalNumberConverter } from \"./utils/converters/optionalNumberConverter\";\n\n// Utlility class and service for retrieving contrast colors\nexport { getContrastColor } from \"./utils/getContrastColor\";\n\n// Export icons\nimport icons from \"./utils/icons\";\nexport { icons }\n\nimport i18nWebcomponents from \"./translations/i18n\";\nexport { i18nWebcomponents };\n\nconst t = i18nWebcomponents.t;\nexport { t };\n\nimport { addInlineStyles } from \"./styles/defaultStyles\";\nexport { addInlineStyles };\n\n\n// The necessary abstractions utils required by the hierarchy elements\n\nexport { AbstractThermalElement } from \"./hierarchy/AbstractThermalElement\";\nexport { HierarchyUpdatesHub } from \"./controllers/HierarchyUpdatesHub\";\n\nexport { AbstractReactiveController } from \"./controllers/AbstractReactiveController\";\n\nexport { \n    AbstractHierarchyController,\n    INTERNAL_STATE_DECLARATION\n} from \"./controllers/AbstractHierarchyController\";\n\nexport type { \n    HostReactiveProperties \n} from \"./controllers/AbstractHierarchyController\";\n\n// File internal contexts & other stuff\n\n// File contexts and the controller\nexport {\n    fileContext,\n    fileControllerContext,\n    fileCurrentFrameContext,\n    fileMsContext,\n    filePlayingContext,\n    fileFailureContext,\n    fileLoadingContext,\n    fileTimeCursorContext,\n    fileDurationContext,\n    filePlaybackSpeedContext,\n    fileRecordingContext,\n    fileMayStopContext,\n    fileAnalysisListContext,\n    FileController\n} from \"./controllers/FileController\";\n\n// File context types\nexport type { \n    FileControllerCurrentFrameType, \n    FileControllerDurationContextType \n} from \"./controllers/FileController\";\n\n// Flle load controller\nexport { \n    FileLoadController \n} from \"./controllers/FileLoadController\";\n\n// Types from the FileLoadController\nexport type {\n    IElementWithFileLoadController\n} from \"./controllers/FileLoadController\";\n\n\n// Group internal contexts & other stuff\n\n// Basic group controller\nexport {\n    GroupController,\n    groupControllerContext,\n    groupObjectContext\n} from \"./controllers/GroupController\";\n\nexport type {\n    IElementWithGroupController\n} from \"./controllers/GroupController\";\n\n// Automatic group load controller\nexport {\n    GroupLoadController\n} from \"./controllers/GroupLoadController\";\n\n// Export the interfaces for the automatic group load controller\nexport type {\n    IElementWithGroupLoadController\n} from \"./controllers/GroupLoadController\";\n\n\n// Export the group listing controller\nexport {\n    GroupListingController,\n    GroupOrderby,\n    GroupOrdering\n} from \"./controllers/GroupListingController\";\n\nexport type {\n    IElementWithGroupListingController\n} from \"./controllers/GroupListingController\"\n\n\n// Group analysis sync is a @todo\nexport { \n    GroupAnalysisSyncController, \n    groupAnalysisSyncContext \n} from \"./controllers/GroupAnalysisSyncController\";\nexport type { \n    IElementWithGroupAnalysisSyncController \n} from \"./controllers/GroupAnalysisSyncController\";\n\n\n\n// Registry contexts and its providers\nexport {\n    RegistryController,\n    registryControllerContext,\n    registryObjectContext,\n    registryOpacityContext,\n    registryRangeFromContext,\n    registryRangeToContext,\n    registryLoadingContext,\n    registryMaxContext,\n    registryMinContext,\n    registryHighlightContext,\n\n} from \"./controllers/RegistryController\";\n\nexport type {\n    IElementWithRegistryController\n} from \"./controllers/RegistryController\";\n\n\n\n// Manager contexts and other related tools\n\nexport {\n    managerControllerContext,\n    managerContext,\n    managerPaletteContext,\n    managerAdvancedPalettesContext,\n    managerSmoothContext,\n    managerGraphFunctionContext,\n    managerToolContext,\n    managerInteractiveAnalysesContext,\n    ManagerController\n} from \"./controllers/ManagerController\";\n\nexport type {\n    IElementWithManagerController,\n    ManagerPaletteContextType,\n} from \"./controllers/ManagerController\";\n\n\n// Config contexts and other tools\n\nexport {\n    configContext,\n    ConfigController\n} from \"./controllers/ConfigController\";\n\nexport type { \n    ConfigSettings, \n    GroupExportSettings, \n    PngExportSettings\n} from \"./controllers/ConfigController\";\n\n\n\n\nexport { AbstractApp } from \"./apps/AbstractApp\";\n\n// The UI\n\nexport { ThermalAppElement } from \"./ui/App\";\nexport { ThermalBarElement } from \"./ui/Bar\";\nexport { ThermalBtnElement } from \"./ui/Btn\";\nexport type { BtnSizes, BtnVariants } from \"./ui/Btn\";\nexport { ThermalBtnGroupElement } from \"./ui/BtnGroup\";\nexport { ThermalDialogElement } from \"./ui/Dialog\";\nexport { ThermalDropdownElement } from \"./ui/Dropdown\";\nexport { ThermalDropinElement } from \"./ui/Dropin\";\nexport { ThermalExpandableElement } from \"./ui/Expandable\";\nexport { ThermalFieldElement } from \"./ui/Field\";\nexport { ThermalIconElement } from \"./ui/Icon\";\nexport { ThermalPosterElement } from \"./ui/Loading\";\nexport { ThermalRadioElement } from \"./ui/Radio\";\nexport { ThermalSlotElement } from \"./ui/Slot\";\nexport { ThermalSpinnerElement } from \"./ui/Spinner\";\nexport { ThermalTipElement } from \"./ui/Tip\";\n\n// The providers abstractions\n\nexport { AbstractFileProvider } from \"./hierarchy/abstraction/AbstractFileProvider\";\nexport { AbstractGroupProvider } from \"./hierarchy/abstraction/AbstractGroupProvider\";\nexport { AbstractManagerProvider } from \"./hierarchy/abstraction/AbstractManagerProvider\";\nexport { AbstractRegistryProvider } from \"./hierarchy/abstraction/AbstractRegistryProvider\";\n\n// The consumers abstraction\n\nexport { AbstractFileConsumer } from \"./hierarchy/consumers/AbstractFileConsumer\";\nexport { AbstractGroupConsumer } from \"./hierarchy/consumers/AbstractGroupConsumer\";\nexport { AbstractManagerConsumer } from \"./hierarchy/consumers/AbstractManagerConsumer\";\nexport { AbstractRegistryConsumer } from \"./hierarchy/consumers/AbstractRegistryConsumer\";\n\n\n\n\n// Independent controls\n\nexport { AppInfoButton } from \"./controls/independent/AppInfoButton\";\nexport { DisplayPanel } from \"./controls/independent/DisplayPanel\";\nexport { ConfigDialog } from \"./controls/independent/ConfigDialog\";\n\n// The providers elements\n\nexport { FileCopyElement } from \"./hierarchy/providers/FileCopy\";\nexport { FileProviderElement } from \"./hierarchy/providers/FileProvider\";\nexport { GroupProviderElement } from \"./hierarchy/providers/GroupProvider\";\nexport { ManagerProviderElement } from \"./hierarchy/providers/ManagerProvider\";\nexport { RegistryProviderElement } from \"./hierarchy/providers/RegistryProvider\";\n\n// Manager controls\n\nexport { ManagerExportPanel } from \"./controls/manager/ManagerExportPanel\";\nexport { ManagerGraphSmoothSwitch } from \"./controls/manager/ManagerGraphSmoothSwitch\";\nexport { ManagerImageSmoothSwitch } from \"./controls/manager/ManagerImageSmoothSwitch\";\nexport { ManagerPaletteButtons } from \"./controls/manager/ManagerPaletteButtons\";\nexport { ManagerPaletteDropdown } from \"./controls/manager/ManagerPaletteDropdown\";\nexport { ManagerToolBar } from \"./controls/manager/ManagerToolsBar\";\nexport { ManagerAdvancedPaletteSwitch } from \"./controls/manager/ManagerAdvancedPaletteSwitch\";\nexport { ManagerUnitSwitch } from \"./controls/manager/ManagerUnitSwitch\";\n\n// Registry controls\n\nexport { RegistryRangeForm } from \"./controls/registry/RegistryRangeForm\";\nexport { RegistryTicksBar } from \"./controls/registry/RegistryTicksBar\";\nexport { RegistryRangeSlider } from \"./controls/registry/RegistryRangeSlider\";\nexport { RegistryHistogram } from \"./controls/registry/RegistryHistogram\";\nexport { RegistryRangeFullButton } from \"./controls/registry/RegistryRangeFullButton\";\nexport { RegistryRangeAutoButton } from \"./controls/registry/RegistryRangeAutoButton\";\nexport { RegistryRangeDisplay } from \"./controls/registry/RegistryRangeDisplay\";\nexport { RegistryOpacitySlider } from \"./controls/registry/RegistryOpacitySlider\";\n\n// Group controls\n\nexport { GroupChartElement } from \"./controls/group/GroupChartElement\";\nexport { GroupAnalysisSyncButton } from \"./controls/group/GroupAnalysisSyncButton\";\nexport { GroupDownloadDropdown } from \"./controls/group/GroupDownloadDropdown\";\nexport { GroupDownloadButtons } from \"./controls/group/GroupDownloadButtons\";\nexport { GroupDropinElement } from \"./controls/group/GroupDropinElement\";\nexport { GroupDropinInputElement } from \"./controls/group/GroupDropinInput\";\nexport { GroupRangePropagatorElement } from \"./controls/group/GroupRangePropagator\";\nexport { GroupTimelineElement } from \"./controls/group/GroupTimeline\";\n\n// File controls\n\nexport { FileCanvasElement } from \"./controls/file/FileCanvas\";\nexport { FileVideoExportButton } from \"./controls/file/FileVideoExportButton\";\nexport { FilePlaybackSpeedDropdown } from \"./controls/file/FilePlaybackSpeedDropdown\";\nexport { FileDownloadButton } from \"./controls/file/FileDownloadDropdown\";\nexport { FileButtonElement } from \"./controls/file/buttons/FileButton\";\nexport { FileDropdown } from \"./controls/file/buttons/FileDropdown\";\nexport { FileLrcButton } from \"./controls/file/buttons/FileLrcButton\";\nexport { FilePngButton } from \"./controls/file/buttons/FilePngButton\";\nexport { FileRangePropagator } from \"./controls/file/buttons/FileRangePropagator\";\n\nexport { FileAnalysisComplexElement } from \"./controls/file/analysis/FileAnalysisComplex\";\nexport { FileAnalysisDisplayElement } from \"./controls/file/analysis/FileAnalysisDisplay\";\nexport { FileAnalisisEditDialog } from \"./controls/file/analysis/FileAnalysisEdit\";\nexport { FileAnalysisGraphElement } from \"./controls/file/analysis/FileAnalysisGraph\";\nexport { FileAnalysisRowElement } from \"./controls/file/analysis/FileAnalysisRow\";\nexport { FileAnalysisTableElement } from \"./controls/file/analysis/FileAnalysisTable\";\nexport { AnalysisColorDropdown } from \"./controls/file/analysis/edit/analysisColorDropdown\";\nexport { AnalysisNameInput } from \"./controls/file/analysis/edit/analysisNameInput\";\nexport { AreaEditTable } from \"./controls/file/analysis/edit/editAreaTable\";\nexport { EditpointTable } from \"./controls/file/analysis/edit/editPointTable\";\n\n// Export the internal chart element for the purpose of reuse\nexport { ThermalChartElement } from \"./controls/file/analysis/chart/chart\";\n\nexport { ThermalFileAppElement } from \"./apps/ThermalFileApp\";\nexport { ThermalDropinAppElement } from \"./apps/ThermalDropinApp\";\nexport { ThermalGroupAppElement } from \"./apps/ThermalGroupApp\";\nexport type { AatAppElement } from \"./apps/AustralianApparentTemperature\";\nexport type { ThermalSlottedAppElement } from \"./apps/ThermalSlottedApp\";\nexport type { FileInfoButton } from \"./controls/file/FileInfoButton\";\nexport type { FileTimelineElement } from \"./controls/file/FileTimelineElement\";\nexport type { FileVideoExportPanel } from \"./controls/file/video/FileVideoExportPanel\";\nexport type { FileLabelElement } from \"./controls/file/fileLabel\";\nexport type { FileDetailElement } from \"./renderers/FileDetail\";\nexport type { FileThumbnailElement } from \"./renderers/FileThumbnail\";\n\n// Finally, expor the IIFE-related functionality\n\nexport {\n    defineAllWebcomponents,\n    defineWebcomponent\n} from \"./utils/iife\";\n\nexport {\n    independentElements,\n    elementsProviders,\n    elementsAll,\n    isLabirthermalWebcomponent,\n    defineBaseWebcomponents,\n} from \"./iifeCatalog\";"],"ignoreList":[9],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAa,wBACT,YACA,KACA,QACC;CAED,MAAM,iBAAiB,UAAmB;EACtC,IACI,UAAU,KAAA,KACP,UAAU,QAET,OAAO,UAAU,YACd,OAAO,UAAU,UAGxB,OAAO;EAGX,MAAM,cAAc,OAAO,KAAK;EAEhC,IAAI,MAAM,WAAW,GACjB,OAA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