diff --git a/ide-common/build.gradle.kts b/ide-common/build.gradle.kts index ee7bb13af..e7aeb8ecd 100644 --- a/ide-common/build.gradle.kts +++ b/ide-common/build.gradle.kts @@ -55,7 +55,7 @@ dependencies { tasks { - val downloadComposeFile = register("downloadComposeFile", Download::class.java) { + val downloadComposeFile by registering(Download::class) { src( listOf( "https://get.digma.ai/" @@ -64,11 +64,37 @@ tasks { val dir = File(project.sourceSets.main.get().output.resourcesDir, "docker-compose") dest(File(dir, "docker-compose.yml")) - overwrite(false) - onlyIfModified(true) + retries(3) } + + val uiVersionFile = project.rootProject.file("ui-version") + val uiVersion = uiVersionFile.readText() + //the directory inside the jar to package to + val uiBundleDir = File(project.sourceSets.main.get().output.resourcesDir, "ui-bundle") + val uiBundleFile = File(uiBundleDir, "digma-ui-$uiVersion.zip") + + val downloadUiBundle by registering(Download::class) { + + inputs.files(uiVersionFile) + outputs.files(uiBundleFile) + + src( + listOf( + "https://github.com/digma-ai/digma-ui/releases/download/v$uiVersion/dist-jetbrains-v$uiVersion.zip" + ) + ) + dest(uiBundleFile) + retries(3) + } + + val createUiBundleVersionFile by registering(Copy::class) { + from(uiVersionFile) + into(uiBundleDir) + } + + processResources { - dependsOn(downloadComposeFile) + dependsOn(downloadComposeFile, downloadUiBundle, createUiBundleVersionFile) } } \ No newline at end of file diff --git a/ide-common/src/main/java/org/digma/intellij/plugin/settings/SettingsComponent.java b/ide-common/src/main/java/org/digma/intellij/plugin/settings/SettingsComponent.java index e8da35f3a..3837f4db7 100644 --- a/ide-common/src/main/java/org/digma/intellij/plugin/settings/SettingsComponent.java +++ b/ide-common/src/main/java/org/digma/intellij/plugin/settings/SettingsComponent.java @@ -13,6 +13,7 @@ import org.digma.intellij.plugin.auth.account.*; import org.digma.intellij.plugin.common.*; import org.digma.intellij.plugin.errorreporting.ErrorReporter; +import org.digma.intellij.plugin.updates.ui.UIVersioningService; import org.jetbrains.annotations.*; import javax.swing.*; @@ -167,6 +168,8 @@ public boolean verify(JComponent input) { var backendVersionLabel = createBackendVersionLabel(); + var uiVersionLabel = createUiVersionLabel(); + var importExportPanel = createImportExportPanel(); var resetPluginButton = createResetPluginButton(); @@ -186,6 +189,7 @@ public boolean verify(JComponent input) { .addComponent(resetToDefaultsButton) .addLabeledComponent(new JBLabel("User id"), userIdLabel) .addLabeledComponent(new JBLabel("Backend version"), backendVersionLabel) + .addLabeledComponent(new JBLabel("UI version"), uiVersionLabel) .addComponent(importExportPanel) .addComponent(resetPluginButton) .addComponent(pluginResetWarning) @@ -384,6 +388,11 @@ private static JBLabel createBackendVersionLabel() { return backendVersionLabel; } + @NotNull + private static JBLabel createUiVersionLabel() { + return new JBLabel(UIVersioningService.getInstance().getCurrentUiVersion()+" ("+UIVersioningService.getInstance().getCurrentUiBundlePath()+")"); + } + private JPanel createImportExportPanel() { //noinspection ExtractMethodRecommender diff --git a/ide-common/src/main/java/org/digma/intellij/plugin/ui/MainToolWindowCardsController.java b/ide-common/src/main/java/org/digma/intellij/plugin/ui/MainToolWindowCardsController.java index 0bbc54e8f..975a40237 100644 --- a/ide-common/src/main/java/org/digma/intellij/plugin/ui/MainToolWindowCardsController.java +++ b/ide-common/src/main/java/org/digma/intellij/plugin/ui/MainToolWindowCardsController.java @@ -157,9 +157,9 @@ public void initComponents(@NotNull ToolWindow toolWindow, public void updateStateChanged(@NotNull PublicUpdateState updateState) { if (updateState.getUpdateState() == CurrentUpdateState.OK) { - closeUpdateBackendPanel(); + closeAggressiveUpdatePanel(); } else { - showUpdateBackendPanel(); + showAggressiveUpdatePanel(); } } @@ -296,25 +296,25 @@ public void showMainPanel() { } } - private void showUpdateBackendPanel() { + private void showAggressiveUpdatePanel() { - Log.log(LOGGER::debug, "showUpdateBackendPanel called"); + Log.log(LOGGER::debug, "showAggressiveUpdatePanel called"); //replace the card even if wizard is on. it will not show until wizard content is removed. //this may happen on startup,showMainPanel is called from the tool window factory, // but there may be a connection lost before the content was built and before this controller was initialized if (isConnectionLost.get()) { - Log.log(LOGGER::debug, "Not showing MainPanel because connection lost, showing NoConnection"); + Log.log(LOGGER::debug, "Not showing AggressiveUpdatePanel because connection lost, showing NoConnection"); showNoConnection(); } else { EDT.ensureEDT(() -> showCard(MainWindowCard.UPDATE_MODE)); } } - private void closeUpdateBackendPanel() { + private void closeAggressiveUpdatePanel() { - Log.log(LOGGER::debug, "closeUpdateBackendPanel called"); + Log.log(LOGGER::debug, "closeAggressiveUpdatePanel called"); //replace the card even if wizard is on. it will not show until wizard content is removed. diff --git a/ide-common/src/main/java/org/digma/intellij/plugin/ui/RecentActivityToolWindowCardsController.kt b/ide-common/src/main/java/org/digma/intellij/plugin/ui/RecentActivityToolWindowCardsController.kt index 786b1d0d7..1fcfcd6eb 100644 --- a/ide-common/src/main/java/org/digma/intellij/plugin/ui/RecentActivityToolWindowCardsController.kt +++ b/ide-common/src/main/java/org/digma/intellij/plugin/ui/RecentActivityToolWindowCardsController.kt @@ -93,9 +93,9 @@ class RecentActivityToolWindowCardsController(private val project: Project) { fun updateStateChanged(updateState: PublicUpdateState) { if (updateState.updateState == CurrentUpdateState.OK) { - closeUpdateBackendPanel() + closeAggressiveUpdatePanel() } else { - showUpdateBackendPanel() + showAggressiveUpdatePanel() } } @@ -112,19 +112,19 @@ class RecentActivityToolWindowCardsController(private val project: Project) { } } - private fun showUpdateBackendPanel() { - Log.log(logger::debug, "showUpdateBackendPanel called") + private fun showAggressiveUpdatePanel() { + Log.log(logger::debug, "showAggressiveUpdatePanel called") if (isConnectionLost.get()) { - Log.log(logger::debug, "Not showing MainPanel because connection lost, showing NoConnection") + Log.log(logger::debug, "Not showing AggressiveUpdatePanel because connection lost, showing NoConnection") showNoConnection() } else { EDT.ensureEDT { showCard(RecentActivityWindowCard.UPDATE_MODE) } } } - private fun closeUpdateBackendPanel() { - Log.log(logger::debug, "closeUpdateBackendPanel called") + private fun closeAggressiveUpdatePanel() { + Log.log(logger::debug, "closeAggressiveUpdatePanel called") //this may happen on startup,showMainPanel is called from the tool window factory, // but there may be a connection lost before the content was built and before this controller was initialized diff --git a/ide-common/src/main/kotlin/org/digma/intellij/plugin/common/VersionsUtils.kt b/ide-common/src/main/kotlin/org/digma/intellij/plugin/common/VersionsUtils.kt index 246384452..7fe4f6c0a 100644 --- a/ide-common/src/main/kotlin/org/digma/intellij/plugin/common/VersionsUtils.kt +++ b/ide-common/src/main/kotlin/org/digma/intellij/plugin/common/VersionsUtils.kt @@ -1,8 +1,10 @@ package org.digma.intellij.plugin.common import com.intellij.openapi.application.ApplicationInfo +import com.intellij.openapi.components.service import org.digma.intellij.plugin.model.rest.version.VersionRequest import org.digma.intellij.plugin.semanticversion.SemanticVersionUtil +import org.digma.intellij.plugin.updates.ui.UIVersioningService // returns one of: @@ -23,9 +25,15 @@ fun getPluginVersion(defaultIfNotFound: String = "0.0.0"): String { return SemanticVersionUtil.getPluginVersionWithoutBuildNumberAndPreRelease(defaultIfNotFound) } +fun getUiVersion(): String { + return service().getUiVersionForVersionRequest() +} + + + fun buildVersionRequest(): VersionRequest { return VersionRequest( - getPluginVersion(), getPlatformType(), getPlatformVersion() + getPluginVersion(), getPlatformType(), getPlatformVersion(), getUiVersion() ) } \ No newline at end of file diff --git a/ide-common/src/main/kotlin/org/digma/intellij/plugin/docker/Downloader.kt b/ide-common/src/main/kotlin/org/digma/intellij/plugin/docker/Downloader.kt index 6228f6bad..2e367fbad 100644 --- a/ide-common/src/main/kotlin/org/digma/intellij/plugin/docker/Downloader.kt +++ b/ide-common/src/main/kotlin/org/digma/intellij/plugin/docker/Downloader.kt @@ -69,9 +69,11 @@ class Downloader { return } - val outputStream = FileOutputStream(composeFile) - Log.log(logger::info, "unpacking {} to {}", COMPOSE_FILE_NAME, composeFile) - com.intellij.openapi.util.io.StreamUtil.copy(inputStream, outputStream) + FileOutputStream(composeFile).use { + Log.log(logger::info, "unpacking {} to {}", COMPOSE_FILE_NAME, composeFile) + com.intellij.openapi.util.io.StreamUtil.copy(inputStream, it) + } + } @@ -103,6 +105,7 @@ class Downloader { "download from $url", mapOf("responseCode" to responseCode.toString()) ) + throw RuntimeException("could not download file from $url") } else { connection.inputStream.use { Files.copy(it, tempFile, StandardCopyOption.REPLACE_EXISTING) diff --git a/ide-common/src/main/kotlin/org/digma/intellij/plugin/paths/DigmaPathManager.kt b/ide-common/src/main/kotlin/org/digma/intellij/plugin/paths/DigmaPathManager.kt new file mode 100644 index 000000000..05a021f3e --- /dev/null +++ b/ide-common/src/main/kotlin/org/digma/intellij/plugin/paths/DigmaPathManager.kt @@ -0,0 +1,70 @@ +package org.digma.intellij.plugin.paths + +import com.intellij.openapi.application.ApplicationNamesInfo +import com.intellij.openapi.application.PathManager +import com.intellij.openapi.util.SystemInfo +import org.digma.intellij.plugin.errorreporting.ErrorReporter +import java.io.File + +const val DIGMA_DIR = "digma-intellij-plugin" + +class DigmaPathManager { + + + companion object { + + fun getLocalFilesDirectoryPath(): String { + val ideFullName = ApplicationNamesInfo.getInstance().fullProductNameWithEdition + val ideHomeDir = PathManager.getHomePath().substringAfterLast("/") + val ideName = "$ideFullName-$ideHomeDir".replace(" ", "-").replace(".","-") + return try { + val baseDir = getBaseDirectory() + val ideDir = File(baseDir,ideName) + ideDir.mkdirs() + ideDir.absolutePath + }catch (e:Throwable){ + ErrorReporter.getInstance().reportError("DigmaPathManager.getLocalFilesDirectoryPath", e) + val fallback = File(System.getProperty("java.io.tmpdir"), "$DIGMA_DIR/$ideName") + fallback.mkdirs() + fallback.absolutePath + } + } + + + private fun getUserHome(): String { + //user.home should never be null, but just in case,use temp dir + return System.getProperty("user.home") ?: System.getProperty("java.io.tmpdir") + } + + + private fun getBaseDirectory(): File { + + return try { + if (SystemInfo.isMac) { + val userHome = getUserHome() + val digmaDir = File(userHome, "Library/Application Support/$DIGMA_DIR") + digmaDir.mkdirs() + digmaDir + } else if (SystemInfo.isWindows) { + val userHome = System.getenv("LOCALAPPDATA") ?: getUserHome() + val digmaDir = File(userHome, DIGMA_DIR) + digmaDir.mkdirs() + digmaDir + } else { + //for linux or any other os + val userHome = getUserHome() + val digmaDir = File(userHome, ".$DIGMA_DIR") + digmaDir.mkdirs() + digmaDir + } + + } catch (e: Throwable) { + ErrorReporter.getInstance().reportError("DigmaPathManager.getBaseDirectory", e) + val userHome = getUserHome() + val digmaDir = File(userHome, ".$DIGMA_DIR") + digmaDir.mkdirs() + digmaDir + } + } + } +} \ No newline at end of file diff --git a/ide-common/src/main/kotlin/org/digma/intellij/plugin/persistence/PersistenceData.kt b/ide-common/src/main/kotlin/org/digma/intellij/plugin/persistence/PersistenceData.kt index d8e697c26..72fe6727e 100644 --- a/ide-common/src/main/kotlin/org/digma/intellij/plugin/persistence/PersistenceData.kt +++ b/ide-common/src/main/kotlin/org/digma/intellij/plugin/persistence/PersistenceData.kt @@ -95,6 +95,9 @@ internal data class PersistenceData( var detectedFrameworks: String? = null, - var engagementScorePersistenceFileFixed: Boolean = false + var engagementScorePersistenceFileFixed: Boolean = false, + + var currentUiVersion: String? = null, + var latestDownloadedUiVersion: String? = null ) \ No newline at end of file diff --git a/ide-common/src/main/kotlin/org/digma/intellij/plugin/persistence/PersistenceService.kt b/ide-common/src/main/kotlin/org/digma/intellij/plugin/persistence/PersistenceService.kt index 030d830ee..dc5c9d362 100644 --- a/ide-common/src/main/kotlin/org/digma/intellij/plugin/persistence/PersistenceService.kt +++ b/ide-common/src/main/kotlin/org/digma/intellij/plugin/persistence/PersistenceService.kt @@ -427,4 +427,20 @@ class PersistenceService { state.engagementScorePersistenceFileFixed = true } + fun getCurrentUiVersion(): String? { + return state.currentUiVersion + } + + fun setCurrentUiVersion(uiVersion: String) { + state.currentUiVersion = uiVersion + } + + fun getLatestDownloadedUiVersion(): String? { + return state.latestDownloadedUiVersion + } + + fun setLatestDownloadedUiVersion(uiVersion: String?) { + state.latestDownloadedUiVersion = uiVersion + } + } diff --git a/ide-common/src/main/kotlin/org/digma/intellij/plugin/reload/ReloadSource.kt b/ide-common/src/main/kotlin/org/digma/intellij/plugin/reload/ReloadSource.kt index 0f1e0927f..f79c56be9 100644 --- a/ide-common/src/main/kotlin/org/digma/intellij/plugin/reload/ReloadSource.kt +++ b/ide-common/src/main/kotlin/org/digma/intellij/plugin/reload/ReloadSource.kt @@ -1,5 +1,5 @@ package org.digma.intellij.plugin.reload enum class ReloadSource { - RELOAD_ACTION,RELOAD_OBSERVER + RELOAD_ACTION,RELOAD_OBSERVER,UI_UPDATE } \ No newline at end of file diff --git a/ide-common/src/main/kotlin/org/digma/intellij/plugin/updates/UpdateState.kt b/ide-common/src/main/kotlin/org/digma/intellij/plugin/updates/UpdateState.kt index 7087c5128..47882efc6 100644 --- a/ide-common/src/main/kotlin/org/digma/intellij/plugin/updates/UpdateState.kt +++ b/ide-common/src/main/kotlin/org/digma/intellij/plugin/updates/UpdateState.kt @@ -6,10 +6,11 @@ data class UpdateState( val backendDeploymentType: BackendDeploymentType, val shouldUpdateBackend: Boolean, val shouldUpdatePlugin: Boolean, + val shouldUpdateUi: Boolean, ) { fun shouldUpdateAny(): Boolean { - return shouldUpdateBackend || shouldUpdatePlugin + return shouldUpdateBackend || shouldUpdatePlugin || shouldUpdateUi } } diff --git a/ide-common/src/main/kotlin/org/digma/intellij/plugin/updates/UpdatesService.kt b/ide-common/src/main/kotlin/org/digma/intellij/plugin/updates/UpdatesService.kt index 468a68f20..79b238fe7 100644 --- a/ide-common/src/main/kotlin/org/digma/intellij/plugin/updates/UpdatesService.kt +++ b/ide-common/src/main/kotlin/org/digma/intellij/plugin/updates/UpdatesService.kt @@ -23,6 +23,7 @@ import org.digma.intellij.plugin.scheduling.disposingPeriodicTask import org.digma.intellij.plugin.scheduling.oneShotTask import org.digma.intellij.plugin.settings.InternalFileSettings import org.digma.intellij.plugin.ui.panels.DigmaResettablePanel +import org.digma.intellij.plugin.updates.ui.UIVersioningService import java.util.concurrent.TimeUnit import kotlin.time.Duration import kotlin.time.Duration.Companion.seconds @@ -174,6 +175,7 @@ class UpdatesService(private val project: Project) : Disposable { stateBackendVersion.deploymentType, shouldUpdateBackend(), shouldUpdatePlugin(), + UIVersioningService.getInstance().isNewUIBundleAvailable() ) Log.log(logger::debug, "current state is {}", state) return state diff --git a/ide-common/src/main/kotlin/org/digma/intellij/plugin/updates/ui/UIResourcesService.kt b/ide-common/src/main/kotlin/org/digma/intellij/plugin/updates/ui/UIResourcesService.kt new file mode 100644 index 000000000..0930cfd67 --- /dev/null +++ b/ide-common/src/main/kotlin/org/digma/intellij/plugin/updates/ui/UIResourcesService.kt @@ -0,0 +1,84 @@ +package org.digma.intellij.plugin.updates.ui + +import com.intellij.openapi.components.Service +import com.intellij.openapi.components.service +import com.intellij.openapi.diagnostic.Logger +import org.digma.intellij.plugin.log.Log +import java.io.File +import java.io.InputStream +import java.util.concurrent.Semaphore +import java.util.concurrent.atomic.AtomicBoolean +import java.util.zip.ZipFile + +@Service(Service.Level.APP) +class UIResourcesService { + + + private val logger = Logger.getInstance(this::class.java) + + private val uiVersioningServiceStartupLock = Semaphore(0) + private val startupCompleted: AtomicBoolean = AtomicBoolean(false) + + companion object { + @JvmStatic + fun getInstance(): UIResourcesService { + return service() + } + } + + fun startupCompleted() { + Log.log(logger::info,"startup completed") + startupCompleted.set(true) + uiVersioningServiceStartupLock.release() + } + + private fun waitForUiStartupToComplete() { + + if (startupCompleted.get()){ + return + } + + Log.log(logger::info,"waiting for startup to complete") + uiVersioningServiceStartupLock.acquire() + Log.log(logger::info,"done waiting for startup to complete") + } + + fun isResourceExists(resourcePath: String): Boolean { + waitForUiStartupToComplete() + + val uiBundlePath = getUIBundlePath() + + return ZipFile(uiBundlePath).use { zipFile -> + val entry = zipFile.getEntry(resourcePath) + entry != null + } + } + + fun getResourceAsStream(resourcePath: String): InputStream? { + waitForUiStartupToComplete() + + val uiBundlePath = getUIBundlePath() + + return ZipFile(uiBundlePath).use { zipFile -> + val entry = zipFile.getEntry(resourcePath) + entry?.let { + val inputStream = zipFile.getInputStream(it) + val tempFile = File.createTempFile("digmatmp", null) + tempFile.deleteOnExit() + inputStream.use { input -> + tempFile.outputStream().use { output -> + input.copyTo(output) + } + } + tempFile.inputStream() + } + } + } + + + private fun getUIBundlePath():String{ + //todo: support also downloading from url + return System.getProperty("org.digma.plugin.ui.bundle.path") ?:UIVersioningService.getInstance().getCurrentUiBundlePath() + } + +} \ No newline at end of file diff --git a/ide-common/src/main/kotlin/org/digma/intellij/plugin/updates/ui/UIUpdateStarter.kt b/ide-common/src/main/kotlin/org/digma/intellij/plugin/updates/ui/UIUpdateStarter.kt new file mode 100644 index 000000000..95ccc8dd2 --- /dev/null +++ b/ide-common/src/main/kotlin/org/digma/intellij/plugin/updates/ui/UIUpdateStarter.kt @@ -0,0 +1,11 @@ +package org.digma.intellij.plugin.updates.ui + +import com.intellij.openapi.project.Project +import org.digma.intellij.plugin.startup.DigmaProjectActivity + +class UIUpdateStarter : DigmaProjectActivity() { + + override fun executeProjectStartup(project: Project) { + UIVersioningService.getInstance() + } +} \ No newline at end of file diff --git a/ide-common/src/main/kotlin/org/digma/intellij/plugin/updates/ui/UIVersioningService.kt b/ide-common/src/main/kotlin/org/digma/intellij/plugin/updates/ui/UIVersioningService.kt new file mode 100644 index 000000000..7bc8e53ca --- /dev/null +++ b/ide-common/src/main/kotlin/org/digma/intellij/plugin/updates/ui/UIVersioningService.kt @@ -0,0 +1,444 @@ +package org.digma.intellij.plugin.updates.ui + +import com.intellij.openapi.components.Service +import com.intellij.openapi.components.service +import com.intellij.openapi.diagnostic.Logger +import kotlinx.coroutines.CoroutineScope +import org.apache.maven.artifact.versioning.ComparableVersion +import org.digma.intellij.plugin.analytics.AnalyticsService +import org.digma.intellij.plugin.common.DisposableAdaptor +import org.digma.intellij.plugin.common.Retries +import org.digma.intellij.plugin.common.buildVersionRequest +import org.digma.intellij.plugin.common.findActiveProject +import org.digma.intellij.plugin.common.newerThan +import org.digma.intellij.plugin.errorreporting.ErrorReporter +import org.digma.intellij.plugin.log.Log +import org.digma.intellij.plugin.paths.DigmaPathManager +import org.digma.intellij.plugin.persistence.PersistenceService +import org.digma.intellij.plugin.posthog.ActivityMonitor +import org.digma.intellij.plugin.reload.ReloadService +import org.digma.intellij.plugin.reload.ReloadSource +import org.digma.intellij.plugin.scheduling.disposingPeriodicTask +import java.io.File +import java.net.HttpURLConnection +import java.net.URI +import java.net.URL +import java.nio.file.Files +import java.nio.file.StandardCopyOption +import kotlin.io.path.deleteIfExists +import kotlin.time.Duration.Companion.minutes + +@Service(Service.Level.APP) +class UIVersioningService(val cs: CoroutineScope) : DisposableAdaptor { + + private val logger = Logger.getInstance(this::class.java) + + private val bundledUiVersion = getBundledUiVersion() + + companion object { + + private const val UNKNOWN_UI_VERSION = "unknown" + private const val BUNDLE_UI_DIR_PATH = "ui-bundle" + private const val UI_VERSION_FILE = "/${BUNDLE_UI_DIR_PATH}/ui-version" + private const val UI_BUNDLE_FILE_NAME_PREFIX = "digma-ui" + private val UI_BUNDLES_LOCAL_DIR = File(DigmaPathManager.getLocalFilesDirectoryPath(), "ui") + + @JvmStatic + fun getInstance(): UIVersioningService { + return service() + } + + //do it once on startup instead of reading the file each time the bundled ui version is needed + private fun getBundledUiVersion(): String { + try { + val resourceAsStream = this::class.java.getResourceAsStream(UI_VERSION_FILE) + //should not happen + if (resourceAsStream == null) { + Log.log(Logger.getInstance(UIVersioningService::class.java)::warn, "can not load ui version file from $UI_VERSION_FILE") + ErrorReporter.getInstance() + .reportError("UIVersioningService.getBundledUiVersion", "can not load ui version file from $UI_VERSION_FILE", mapOf()) + return UNKNOWN_UI_VERSION + } + return resourceAsStream.bufferedReader().use { it.readText() } + } catch (e: Throwable) { + ErrorReporter.getInstance() + .reportError("UIVersioningService.getBundledUiVersion", "can not load ui version file from $UI_VERSION_FILE", mapOf()) + return UNKNOWN_UI_VERSION + } + } + + + } + + + init { + + UI_BUNDLES_LOCAL_DIR.mkdirs() + + doStartup() + //startMonitoring is called from constructor, it will be called only once per IDE session + startMonitoring() + } + + fun isNewUIBundleAvailable(): Boolean { + return getLatestDownloadedVersion() != null + } + + fun getCurrentUiBundlePath(): String { + return buildUiBundleLocalFile(getCurrentUiVersion()).absolutePath + } + + + fun getUiVersionForVersionRequest(): String { + return getLatestDownloadedVersion() ?: getCurrentUiVersion() + } + + fun getCurrentUiVersion(): String { + return PersistenceService.getInstance().getCurrentUiVersion() ?: bundledUiVersion + } + + private fun setCurrentUiVersion(uiVersion: String) { + return PersistenceService.getInstance().setCurrentUiVersion(uiVersion) + } + + fun getLatestDownloadedVersion(): String? { + return PersistenceService.getInstance().getLatestDownloadedUiVersion() + } + + private fun setLatestDownloadedVersion(uiVersion: String?) { + return PersistenceService.getInstance().setLatestDownloadedUiVersion(uiVersion) + } + + + private fun buildUiBundleLocalFile(version: String): File { + return File(UI_BUNDLES_LOCAL_DIR, "$UI_BUNDLE_FILE_NAME_PREFIX-$version.zip") + } + + private fun doStartup() { + validateUiBundleExists() + startupCompleted() + } + + //this method will make sure we have a UI bundle available for work. + //if there is a new version that was already downloaded it will update to use the new version + private fun validateUiBundleExists() { + + try { + + //update this property so it has a value on the first installation of the ui versioning feature + if (PersistenceService.getInstance().getCurrentUiVersion() == null) { + setCurrentUiVersion(bundledUiVersion) + } + + //Note:always use the methods getCurrentUiVersion() and getLatestDownloadedVersion() and don't assign to local variables + // because values may change concurrently + + Log.log( + logger::info, + "validating ui bundle current version: {}, bundled version: {}, latest downloaded version {}", + getCurrentUiVersion(), + bundledUiVersion, + getLatestDownloadedVersion() + ) + + + //if we have the latest downloaded file, switch to use it and delete the old version + val latestDownloadedUiVersion = getLatestDownloadedVersion() + if (latestDownloadedUiVersion != null) { + Log.log( + logger::info, + "updating ui to latest downloaded version {}", latestDownloadedUiVersion + ) + val latestDownloadedUi = buildUiBundleLocalFile(latestDownloadedUiVersion) + if (latestDownloadedUi.exists()) { + deleteUiBundle(getCurrentUiVersion()) + setCurrentUiVersion(latestDownloadedUiVersion) + setLatestDownloadedVersion(null) + } else { + //something is wrong, we have the property latestDownloadedVersion but there is no file, maybe it was deleted. + //reset latestDownloadedVersion + Log.log( + logger::warn, + "latest downloaded version property exists but file does not exist, not updating" + ) + + setLatestDownloadedVersion(null) + } + } + + + //maybe user updated the plugin, and the bundled ui is newer then the current ui version. + //this is a valid check even if we had a latestDownloadedVersion and we switched to it above + if (ComparableVersion(bundledUiVersion).newerThan(ComparableVersion(getCurrentUiVersion()))) { + Log.log( + logger::info, + "bundled ui version is higher then current version, using bundled ui. current version: {}, bundled version: {}", + getCurrentUiVersion(), + bundledUiVersion + ) + if (unpackUiBundle()) { + deleteUiBundle(getCurrentUiVersion()) + setCurrentUiVersion(bundledUiVersion) + } else { + Log.log(logger::warn, "could not unpack bundled ui version {}", bundledUiVersion) + } + } + + + //lastly, validate that we have a ui bundle file. + //on the first installation of the feature, this should unpack the bundled version + val uiBundleLocalFile = buildUiBundleLocalFile(getCurrentUiVersion()) + if (uiBundleLocalFile.exists()) { + Log.log(logger::info, "ui bundle file exists {}", uiBundleLocalFile.absolutePath) + } else { + Log.log( + logger::warn, + "current ui bundle {} file does not exists ,using the packaged ui bundle {}", + getCurrentUiVersion(), + bundledUiVersion + ) + unpackUiBundle() + setCurrentUiVersion(bundledUiVersion) + } + + } catch (e: Throwable) { + Log.warnWithException(logger, e, "failed validating ui bundle file") + ErrorReporter.getInstance().reportError("UIVersioningService.validateUiBundleExistsAndUpdatePath", e) + + //we don't know what went wrong, So as fallback use the packaged ui bundle + deleteUiBundle(getCurrentUiVersion()) + getLatestDownloadedVersion()?.let { + deleteUiBundle(it) + setLatestDownloadedVersion(null) + } + + unpackUiBundle() + setCurrentUiVersion(bundledUiVersion) + + } + } + + + private fun startMonitoring() { + disposingPeriodicTask("UIVersioningService.periodic", 1.minutes.inWholeMilliseconds, 5.minutes.inWholeMilliseconds, true) { + findActiveProject()?.let { project -> + try { + val versionsResponse = AnalyticsService.getInstance(project).getVersions(buildVersionRequest()) + + Log.log(logger::trace, "got version response {}", versionsResponse) + + if (versionsResponse.forceUpdate?.minUIVersionRequired != null) { + val requiredUiVersion = versionsResponse.forceUpdate?.minUIVersionRequired + val currentUiVersion = getCurrentUiVersion() + if (!requiredUiVersion.isNullOrBlank() && ComparableVersion(requiredUiVersion).newerThan(ComparableVersion(currentUiVersion))) { + Log.log(logger::info, "got ui force update to {}", requiredUiVersion) + //if there is already a latest downloaded version delete it before downloading the new one + // and reset the property + getLatestDownloadedVersion()?.let { + deleteUiBundle(it) + setLatestDownloadedVersion(null) + } + if (downloadUiBundle(requiredUiVersion)) { + updateToDownloadedVersion(requiredUiVersion, true) + } + } + } else if (versionsResponse.ui?.isNewMatchingVersionAvailable == true) { + val requiredUiVersion = versionsResponse.ui?.latestMatchingVersion + val currentUiVersion = getCurrentUiVersion() + if (!requiredUiVersion.isNullOrBlank() && ComparableVersion(requiredUiVersion).newerThan(ComparableVersion(currentUiVersion))) { + Log.log(logger::info, "got ui update to {}", requiredUiVersion) + //if there is already a latest downloaded version delete it before downloading the new one + // and reset the property + getLatestDownloadedVersion()?.let { + deleteUiBundle(it) + setLatestDownloadedVersion(null) + } + if (downloadUiBundle(requiredUiVersion)) { + setLatestDownloadedVersion(requiredUiVersion) + } + } + } + + } catch (e: Throwable) { + Log.warnWithException(logger, e, "failed on periodic update") + ErrorReporter.getInstance().reportError("UIVersioningService.periodic", e) + } + } + } + } + + + fun updateToLatestDownloaded() { + val latestDownloadedUiVersion = getLatestDownloadedVersion() + Log.log(logger::trace, "updating ui to latest downloaded version {}", latestDownloadedUiVersion) + if (latestDownloadedUiVersion != null) { + val latestDownloadedUi = buildUiBundleLocalFile(latestDownloadedUiVersion) + if (latestDownloadedUi.exists()) { + updateToDownloadedVersion(latestDownloadedUiVersion) + setLatestDownloadedVersion(null) + } else { + //something is wrong, we have the property latestDownloadedVersion but there is no file, maybe it was deleted. + //reset latestDownloadedVersion + Log.log( + logger::warn, + "latest downloaded version property exists but file does not exist, not updating" + ) + setLatestDownloadedVersion(null) + } + } + } + + private fun updateToDownloadedVersion(uiVersion: String, isForceUpdate: Boolean = false) { + + //check that uiVersion is different from the current version, it should not happen, if it does its bug. + // in that case, don't delete the current UI and report an error + if (uiVersion == getCurrentUiVersion()) { + ErrorReporter.getInstance().reportError( + "UIVersioningService.updateToDownloadedVersion", "trying to force update ui to same version as current version", + mapOf( + "current ui version" to getCurrentUiVersion(), + "latest downloaded version" to getLatestDownloadedVersion().toString(), + "bundled version" to bundledUiVersion, + "isForceUpdate" to isForceUpdate + ) + ) + return + } + + val downloadedUi = buildUiBundleLocalFile(uiVersion) + if (downloadedUi.exists()) { + + Log.log(logger::trace, "updating ui to downloaded version {}, isForceUpdate {}", uiVersion, isForceUpdate) + + findActiveProject()?.let { + ActivityMonitor.getInstance(it).registerCustomEvent( + "ui update", mapOf( + "current ui version" to getCurrentUiVersion(), + "latest downloaded version" to getLatestDownloadedVersion().toString(), + "bundled version" to bundledUiVersion, + "isForceUpdate" to isForceUpdate + ) + ) + } + + deleteUiBundle(getCurrentUiVersion()) + setCurrentUiVersion(uiVersion) + } + + service().reloadAllProjects(ReloadSource.UI_UPDATE) + } + + + private fun startupCompleted() { + UIResourcesService.getInstance().startupCompleted() + } + + + private fun deleteUiBundle(uiVersion: String) { + Log.log(logger::info, "deleting old ui bundle {}", uiVersion) + val uiBundleLocalFile = buildUiBundleLocalFile(uiVersion) + if (!uiBundleLocalFile.exists()) { + Log.log(logger::info, "old ui bundle {} does not exist", uiVersion) + return + } + try { + Retries.simpleRetry(kotlinx.coroutines.Runnable { + Files.delete(uiBundleLocalFile.toPath()) + }, Throwable::class.java, 1000, 3) + Log.log(logger::info, "ui bundle {} deleted", uiVersion) + } catch (e: Throwable) { + Log.warnWithException(logger, e, "failed to delete ui bundle file") + ErrorReporter.getInstance().reportError("UIVersioningService.deleteUiBundle", e) + } + } + + + //return true on success, false on failure + private fun downloadUiBundle(requiredUiVersion: String): Boolean { + Log.log(logger::info, "downloading ui bundle {}", requiredUiVersion) + val url = "https://github.com/digma-ai/digma-ui/releases/download/v$requiredUiVersion/dist-jetbrains-v$requiredUiVersion.zip" + val uiBundleLocalFile = buildUiBundleLocalFile(requiredUiVersion) + return downloadAndCopyUiBundleFile(URI(url).toURL(), uiBundleLocalFile) + } + + + private fun unpackUiBundle(): Boolean { + + Log.log(logger::info, "unpacking bundled ui bundle {}", bundledUiVersion) + + val inputStream = this::class.java.getResourceAsStream("/$BUNDLE_UI_DIR_PATH/$UI_BUNDLE_FILE_NAME_PREFIX-${bundledUiVersion}.zip") + if (inputStream == null) { + Log.log(logger::warn, "can not find bundled ui zip") + ErrorReporter.getInstance() + .reportError("UIVersioningService.unpackUiBundle", "can not find bundled ui zip", mapOf()) + return false + } + + val uiBundleLocalFile = buildUiBundleLocalFile(bundledUiVersion) + uiBundleLocalFile.parentFile.mkdirs() + inputStream.use { inStream -> + Files.copy(inStream, uiBundleLocalFile.toPath(), StandardCopyOption.REPLACE_EXISTING) + } + + Log.log(logger::info, "bundled ui {} unpacked to {}", bundledUiVersion, uiBundleLocalFile.absolutePath) + + return true + } + + + private fun downloadAndCopyUiBundleFile(url: URL, toFile: File): Boolean { + + val tempFile = kotlin.io.path.createTempFile("tempUiBundleFile", ".zip") + + try { + + Retries.simpleRetry({ + + Log.log(logger::info, "downloading ui bundle {}", url) + + val connection: HttpURLConnection = url.openConnection() as HttpURLConnection + connection.connectTimeout = 10000 + connection.readTimeout = 5000 + connection.requestMethod = "GET" + val responseCode: Int = connection.getResponseCode() + + if (responseCode != HttpURLConnection.HTTP_OK) { + ErrorReporter.getInstance().reportError( + null, "UIVersioningService.downloadAndCopyUiBundleFile", + "download from $url", + mapOf("responseCode" to responseCode.toString()) + ) + Log.log(logger::warn, "error downloading ui bundle {}, response code {}", url, responseCode) + throw RuntimeException("could not download file from $url, response code $responseCode") + } else { + connection.inputStream.use { + Files.copy(it, tempFile, StandardCopyOption.REPLACE_EXISTING) + } + + Log.log(logger::info, "ui bundle downloaded to {}", tempFile) + + toFile.mkdirs() + + Log.log(logger::info, "copying downloaded file {} to {}", tempFile, toFile) + try { + Files.move(tempFile, toFile.toPath(), StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.ATOMIC_MOVE) + } catch (e: Exception) { + //ATOMIC_MOVE is not always supported so try again on exception + Files.move(tempFile, toFile.toPath(), StandardCopyOption.REPLACE_EXISTING) + } + + Log.log(logger::info, "ui bundle saved to {}", toFile) + } + }, Throwable::class.java, 5000, 3) + + return true + + } catch (e: Exception) { + ErrorReporter.getInstance().reportError("UIVersioningService.downloadAndCopyUiBundleFile", e) + Log.warnWithException(logger, e, "could not download file {}", url) + return false + } finally { + tempFile.deleteIfExists() + } + } +} \ No newline at end of file diff --git a/model/src/main/kotlin/org/digma/intellij/plugin/model/rest/version/VersionRequest.kt b/model/src/main/kotlin/org/digma/intellij/plugin/model/rest/version/VersionRequest.kt index 631f275e4..ff1f7741a 100644 --- a/model/src/main/kotlin/org/digma/intellij/plugin/model/rest/version/VersionRequest.kt +++ b/model/src/main/kotlin/org/digma/intellij/plugin/model/rest/version/VersionRequest.kt @@ -10,4 +10,5 @@ constructor( val pluginVersion: String, val platformType: String, val platformVersion: String, + val uiVersion: String ) \ No newline at end of file diff --git a/model/src/main/kotlin/org/digma/intellij/plugin/model/rest/version/VersionResponse.kt b/model/src/main/kotlin/org/digma/intellij/plugin/model/rest/version/VersionResponse.kt index 4f52727ae..5d26094c1 100644 --- a/model/src/main/kotlin/org/digma/intellij/plugin/model/rest/version/VersionResponse.kt +++ b/model/src/main/kotlin/org/digma/intellij/plugin/model/rest/version/VersionResponse.kt @@ -11,12 +11,14 @@ data class VersionResponse @ConstructorProperties( "plugin", "backend", + "ui", "errors", "forceUpdate" ) constructor( val plugin: PluginVersionResponse, val backend: BackendVersionResponse, + val ui: UIVersionResponse? = null, val errors: List, val forceUpdate: ForceUpdate? = null ) @@ -49,15 +51,28 @@ constructor( val deploymentType: BackendDeploymentType = BackendDeploymentType.Unknown, ) +@JsonIgnoreProperties(ignoreUnknown = true) +data class UIVersionResponse +@JsonCreator(mode = JsonCreator.Mode.PROPERTIES) +@ConstructorProperties( + "isNewMatchingVersionAvailable", + "latestMatchingVersion" +) +constructor( + val isNewMatchingVersionAvailable: Boolean = false, + val latestMatchingVersion: String? = "" +) + + @JsonIgnoreProperties(ignoreUnknown = true) data class ForceUpdate @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) @ConstructorProperties( "minPluginVersionRequired", - "minBackendVersionRequired" + "minBackendVersionRequired", + "minUiVersionRequired" ) -constructor(val minPluginVersionRequired: String?, val minBackendVersionRequired: String?) - +constructor(val minPluginVersionRequired: String?, val minBackendVersionRequired: String?, val minUIVersionRequired: String?) enum class BackendDeploymentType { diff --git a/src/main/java/org/digma/intellij/plugin/dashboard/DashboardFileEditor.java b/src/main/java/org/digma/intellij/plugin/dashboard/DashboardFileEditor.java index cbd0588cf..0a8df7dc5 100644 --- a/src/main/java/org/digma/intellij/plugin/dashboard/DashboardFileEditor.java +++ b/src/main/java/org/digma/intellij/plugin/dashboard/DashboardFileEditor.java @@ -21,13 +21,14 @@ public class DashboardFileEditor extends UserDataHolderBase implements FileEditor { - static final String RESOURCE_FOLDER_NAME = "/webview/dashboard"; + static final String RESOURCE_FOLDER_NAME = "dashboard"; + static final String TEMPLATE_FOLDER_NAME = "/webview/dashboard"; static final String DOMAIN_NAME = "dashboard"; static final String SCHEMA_NAME = "http"; private final VirtualFile file; - private JBCefBrowser jbCefBrowser = null; - private CefMessageRouter cefMessageRouter = null; + private JBCefBrowser jbCefBrowser = null; + private CefMessageRouter cefMessageRouter = null; private boolean disposed = false; public DashboardFileEditor(Project project, VirtualFile file) { @@ -36,7 +37,7 @@ public DashboardFileEditor(Project project, VirtualFile file) { if (JBCefApp.isSupported()) { jbCefBrowser = JBCefBrowserBuilderCreator.create() - .setUrl("http://" + DOMAIN_NAME + "/index.html") + .setUrl("http://" + DOMAIN_NAME + "/" + RESOURCE_FOLDER_NAME + "/index.html") .build(); var jbCefClient = jbCefBrowser.getJBCefClient(); @@ -106,7 +107,7 @@ private JComponent getMyComponent() { public @Nullable JComponent getPreferredFocusedComponent() { if (jbCefBrowser != null) { return jbCefBrowser.getComponent(); - }else{ + } else { return null; } } diff --git a/src/main/java/org/digma/intellij/plugin/dashboard/DashboardIndexTemplateBuilder.java b/src/main/java/org/digma/intellij/plugin/dashboard/DashboardIndexTemplateBuilder.java index 70cdc6166..d5bcaac83 100644 --- a/src/main/java/org/digma/intellij/plugin/dashboard/DashboardIndexTemplateBuilder.java +++ b/src/main/java/org/digma/intellij/plugin/dashboard/DashboardIndexTemplateBuilder.java @@ -38,7 +38,7 @@ public class DashboardIndexTemplateBuilder { private final Configuration freemarketConfiguration = new Configuration(Configuration.VERSION_2_3_30); public DashboardIndexTemplateBuilder() { - freemarketConfiguration.setClassForTemplateLoading(this.getClass(), DashboardFileEditor.RESOURCE_FOLDER_NAME); + freemarketConfiguration.setClassForTemplateLoading(this.getClass(), DashboardFileEditor.TEMPLATE_FOLDER_NAME); freemarketConfiguration.setDefaultEncoding(StandardCharsets.UTF_8.name()); freemarketConfiguration.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER); freemarketConfiguration.setNumberFormat("computer"); diff --git a/src/main/java/org/digma/intellij/plugin/dashboard/DashboardResourceHandler.java b/src/main/java/org/digma/intellij/plugin/dashboard/DashboardResourceHandler.java index fea5c835a..72915ef39 100644 --- a/src/main/java/org/digma/intellij/plugin/dashboard/DashboardResourceHandler.java +++ b/src/main/java/org/digma/intellij/plugin/dashboard/DashboardResourceHandler.java @@ -10,6 +10,7 @@ import org.cef.network.CefRequest; import org.cef.network.CefResponse; import org.digma.intellij.plugin.log.Log; +import org.digma.intellij.plugin.updates.ui.UIResourcesService; import java.io.IOException; import java.io.InputStream; @@ -37,7 +38,7 @@ public boolean processRequest(CefRequest request, CefCallback callback) { if (DashboardService.getInstance(project).isIndexHtml(path)) { inputStream = DashboardService.getInstance(project).buildIndexFromTemplate(path, dashboardVirtualFile); } else { - inputStream = getClass().getResourceAsStream(path); + inputStream = UIResourcesService.getInstance().getResourceAsStream(path); } if (inputStream == null) { diff --git a/src/main/java/org/digma/intellij/plugin/dashboard/DashboardSchemeHandlerFactory.java b/src/main/java/org/digma/intellij/plugin/dashboard/DashboardSchemeHandlerFactory.java index 5f11619b3..3421294d2 100644 --- a/src/main/java/org/digma/intellij/plugin/dashboard/DashboardSchemeHandlerFactory.java +++ b/src/main/java/org/digma/intellij/plugin/dashboard/DashboardSchemeHandlerFactory.java @@ -1,15 +1,14 @@ package org.digma.intellij.plugin.dashboard; import com.intellij.openapi.project.Project; -import org.cef.browser.CefBrowser; -import org.cef.browser.CefFrame; +import org.cef.browser.*; import org.cef.callback.CefSchemeHandlerFactory; import org.cef.handler.CefResourceHandler; import org.cef.network.CefRequest; +import org.digma.intellij.plugin.updates.ui.UIResourcesService; import org.jetbrains.annotations.Nullable; -import java.net.MalformedURLException; -import java.net.URL; +import java.net.*; public class DashboardSchemeHandlerFactory implements CefSchemeHandlerFactory { @@ -29,13 +28,12 @@ public CefResourceHandler create(CefBrowser browser, CefFrame frame, String sche var file = url.getFile(); if (DashboardFileEditor.DOMAIN_NAME.equals(host) && DashboardFileEditor.SCHEMA_NAME.equals(schemeName)) { - var resourceName = DashboardFileEditor.RESOURCE_FOLDER_NAME + file; - var resource = getClass().getResource(resourceName); - if (resource != null) { + + String resourceName = file.replaceAll("^/+", ""); + boolean resourceExists = UIResourcesService.getInstance().isResourceExists(resourceName); + if (resourceExists){ return new DashboardResourceHandler(project, resourceName, dashboardVirtualFile); - } else if (getClass().getResource("/webview/common" + file) != null) { - return new DashboardResourceHandler(project, "/webview/common" + file, dashboardVirtualFile); - } else { + }else{ return new DashboardResourceHandler(project, DashboardFileEditor.RESOURCE_FOLDER_NAME + "/index.html", dashboardVirtualFile); } } diff --git a/src/main/java/org/digma/intellij/plugin/documentation/DocumentationConstants.java b/src/main/java/org/digma/intellij/plugin/documentation/DocumentationConstants.java index 4020bc3b1..2a71b175c 100644 --- a/src/main/java/org/digma/intellij/plugin/documentation/DocumentationConstants.java +++ b/src/main/java/org/digma/intellij/plugin/documentation/DocumentationConstants.java @@ -4,8 +4,9 @@ public interface DocumentationConstants { String DOCUMENTATION_DOMAIN_NAME = "documentation"; String DOCUMENTATION_SCHEMA = "http"; - String DOCUMENTATION_URL = DOCUMENTATION_SCHEMA + "://" + DOCUMENTATION_DOMAIN_NAME + "/index.html"; - String DOCUMENTATION_RESOURCE_FOLDER_NAME = "/webview/documentation"; + String DOCUMENTATION_RESOURCE_FOLDER_NAME = "documentation"; + String DOCUMENTATION_URL = DOCUMENTATION_SCHEMA + "://" + DOCUMENTATION_DOMAIN_NAME + "/" + DOCUMENTATION_RESOURCE_FOLDER_NAME + "/index.html"; + String DOCUMENTATION_TEMPLATE_FOLDER_NAME = "/webview/documentation"; String DOCUMENTATION_INDEX_TEMPLATE_NAME = "documentation.ftl"; } \ No newline at end of file diff --git a/src/main/java/org/digma/intellij/plugin/documentation/DocumentationIndexTemplateBuilder.java b/src/main/java/org/digma/intellij/plugin/documentation/DocumentationIndexTemplateBuilder.java index 5354c9bc3..733abc283 100644 --- a/src/main/java/org/digma/intellij/plugin/documentation/DocumentationIndexTemplateBuilder.java +++ b/src/main/java/org/digma/intellij/plugin/documentation/DocumentationIndexTemplateBuilder.java @@ -12,7 +12,7 @@ class DocumentationIndexTemplateBuilder extends BaseIndexTemplateBuilder { private final DocumentationVirtualFile documentationVirtualFile; public DocumentationIndexTemplateBuilder(DocumentationVirtualFile documentationVirtualFile) { - super(DocumentationConstants.DOCUMENTATION_RESOURCE_FOLDER_NAME, DocumentationConstants.DOCUMENTATION_INDEX_TEMPLATE_NAME); + super(DocumentationConstants.DOCUMENTATION_TEMPLATE_FOLDER_NAME, DocumentationConstants.DOCUMENTATION_INDEX_TEMPLATE_NAME); this.documentationVirtualFile = documentationVirtualFile; } diff --git a/src/main/java/org/digma/intellij/plugin/jaegerui/JaegerUIConstants.java b/src/main/java/org/digma/intellij/plugin/jaegerui/JaegerUIConstants.java index 743992279..f4d36381a 100644 --- a/src/main/java/org/digma/intellij/plugin/jaegerui/JaegerUIConstants.java +++ b/src/main/java/org/digma/intellij/plugin/jaegerui/JaegerUIConstants.java @@ -4,9 +4,10 @@ public interface JaegerUIConstants { String JAEGER_UI_DOMAIN_NAME = "jaegerui"; String JAEGER_UI_SCHEMA = "http"; - String JAEGER_UI_URL = JAEGER_UI_SCHEMA + "://" + JAEGER_UI_DOMAIN_NAME + "/index.html"; + String JAEGER_UI_RESOURCE_FOLDER_NAME = "jaeger-ui"; + String JAEGER_UI_URL = JAEGER_UI_SCHEMA + "://" + JAEGER_UI_DOMAIN_NAME + "/" + JAEGER_UI_RESOURCE_FOLDER_NAME + "/index.html"; String JAEGER_API_URL = JAEGER_UI_SCHEMA + "://" + JAEGER_UI_DOMAIN_NAME; - String JAEGER_UI_RESOURCE_FOLDER_NAME = "/webview/jaegerui"; + String JAEGER_UI_TEMPLATE_FOLDER_NAME = "/webview/jaegerui"; String JAEGER_UI_INDEX_TEMPLATE_NAME = "jaegeruitemplate.ftl"; } \ No newline at end of file diff --git a/src/main/java/org/digma/intellij/plugin/jaegerui/JaegerUiIndexTemplateBuilder.java b/src/main/java/org/digma/intellij/plugin/jaegerui/JaegerUiIndexTemplateBuilder.java index a2c841dfe..8e7635724 100644 --- a/src/main/java/org/digma/intellij/plugin/jaegerui/JaegerUiIndexTemplateBuilder.java +++ b/src/main/java/org/digma/intellij/plugin/jaegerui/JaegerUiIndexTemplateBuilder.java @@ -19,7 +19,7 @@ public class JaegerUiIndexTemplateBuilder extends BaseIndexTemplateBuilder { private final JaegerUIVirtualFile jaegerUIVirtualFile; public JaegerUiIndexTemplateBuilder(JaegerUIVirtualFile file) { - super(JaegerUIConstants.JAEGER_UI_RESOURCE_FOLDER_NAME, JaegerUIConstants.JAEGER_UI_INDEX_TEMPLATE_NAME); + super(JaegerUIConstants.JAEGER_UI_TEMPLATE_FOLDER_NAME, JaegerUIConstants.JAEGER_UI_INDEX_TEMPLATE_NAME); this.jaegerUIVirtualFile = file; } diff --git a/src/main/java/org/digma/intellij/plugin/jcef/common/CustomResourceHandler.kt b/src/main/java/org/digma/intellij/plugin/jcef/common/CustomResourceHandler.kt index fa26e28c2..3d79b792b 100644 --- a/src/main/java/org/digma/intellij/plugin/jcef/common/CustomResourceHandler.kt +++ b/src/main/java/org/digma/intellij/plugin/jcef/common/CustomResourceHandler.kt @@ -10,18 +10,21 @@ import org.cef.network.CefRequest import org.cef.network.CefResponse import org.digma.intellij.plugin.ui.common.isJaegerButtonEnabled import org.digma.intellij.plugin.ui.jcef.addCommonEnvVariables +import org.digma.intellij.plugin.updates.ui.UIResourcesService import java.io.ByteArrayInputStream import java.io.IOException import java.io.InputStream import java.io.StringWriter +import java.net.URI import java.net.URLConnection const val INDEX_TEMPLATE_FILE_NAME: String = "indextemplate.ftl" const val BASE_PACKAGE_PATH: String = "webview/" const val IS_JAEGER_ENABLED: String = "isJaegerEnabled" -const val COMMON_FILES_FOLDER_NAME: String = "common" class CustomResourceHandler( + private var domainNameName: String, + private var templateFolderName: String, private var resourceFolderName: String, private var indexTemplateData: Map? ) : CefResourceHandler { @@ -31,31 +34,24 @@ class CustomResourceHandler( cefRequest: CefRequest, cefCallback: CefCallback ): Boolean { - val resourceUrlPrefix = "https://$resourceFolderName" + val resourceUrlPrefix = "https://$domainNameName/$resourceFolderName" val processedUrl = cefRequest.url return if (processedUrl != null) { - when { - processedUrl.equals("$resourceUrlPrefix/index.html", true) -> { - val html = loadFreemarkerTemplate(resourceFolderName, indexTemplateData) - state = StringData(html) - } - processedUrl.contains("fonts") || processedUrl.contains("images") -> { - val pathToResource = - processedUrl.replace(resourceUrlPrefix, "${BASE_PACKAGE_PATH}${COMMON_FILES_FOLDER_NAME}") - val newUrl = javaClass.classLoader.getResource(pathToResource) - if (newUrl != null) { - state = OpenedConnection(newUrl.openConnection()) - } - } - - else -> { - val pathToResource = - processedUrl.replace(resourceUrlPrefix, "${BASE_PACKAGE_PATH}${resourceFolderName}") - val newUrl = javaClass.classLoader.getResource(pathToResource) - if (newUrl != null) { - state = OpenedConnection(newUrl.openConnection()) - } + if (processedUrl.equals("$resourceUrlPrefix/index.html", true)) { + val html = loadFreemarkerTemplate(templateFolderName, indexTemplateData) + state = StringData(html) + } else { + val url = URI(processedUrl).toURL() + val host = url.host + val file = url.path + val resourceName = file.removePrefix("/") + val inputStream = UIResourcesService.getInstance().getResourceAsStream(resourceName) + if (inputStream == null) { + val html = loadFreemarkerTemplate(templateFolderName, indexTemplateData) + state = StringData(html) + } else { + state = OpenedConnection(inputStream, resourceName) } } cefCallback.Continue() @@ -112,11 +108,10 @@ fun readResponse( return CustomResourceHandlerUtil.readResponse(inputStream, dataOut, designedBytesToRead, bytesRead, callback) } -data class OpenedConnection(val connection: URLConnection) : ResourceHandlerState { - private val inputStream: InputStream = connection.getInputStream() +data class OpenedConnection(private val inputStream: InputStream, private val resourceName: String) : ResourceHandlerState { override fun getResponseHeaders(cefResponse: CefResponse, responseLength: IntRef, redirectUrl: StringRef) { try { - cefResponse.mimeType = URLConnection.guessContentTypeFromName(connection.url.file) + cefResponse.mimeType = URLConnection.guessContentTypeFromName(resourceName) responseLength.set(inputStream.available()) cefResponse.status = 200 } catch (e: IOException) { @@ -183,12 +178,12 @@ object ClosedConnection : ResourceHandlerState { } private fun loadFreemarkerTemplate( - resourceFolderName: String, + templateFolderName: String, indexTemplateData: Map? ): String { val cfg = Configuration(Configuration.VERSION_2_3_30) cfg.numberFormat = "computer" // no comma on integer bigger than 999 - cfg.setClassForTemplateLoading(CustomResourceHandler::class.java, "/$BASE_PACKAGE_PATH$resourceFolderName") + cfg.setClassForTemplateLoading(CustomResourceHandler::class.java, "/$BASE_PACKAGE_PATH$templateFolderName") val data: MutableMap = mutableMapOf( IS_JAEGER_ENABLED to isJaegerButtonEnabled() ).also { diff --git a/src/main/java/org/digma/intellij/plugin/jcef/common/CustomSchemeHandlerFactory.kt b/src/main/java/org/digma/intellij/plugin/jcef/common/CustomSchemeHandlerFactory.kt index 44c255f40..91567f3a1 100644 --- a/src/main/java/org/digma/intellij/plugin/jcef/common/CustomSchemeHandlerFactory.kt +++ b/src/main/java/org/digma/intellij/plugin/jcef/common/CustomSchemeHandlerFactory.kt @@ -7,6 +7,8 @@ import org.cef.handler.CefResourceHandler import org.cef.network.CefRequest class CustomSchemeHandlerFactory( + private var domainNameName: String, + private var templateFolderName: String, private var resourceFolderName: String, private var indexTemplateData: Map? ) : CefSchemeHandlerFactory { @@ -17,6 +19,6 @@ class CustomSchemeHandlerFactory( schemeName: String?, request: CefRequest? ): CefResourceHandler { - return CustomResourceHandler(resourceFolderName, indexTemplateData) + return CustomResourceHandler(domainNameName,templateFolderName,resourceFolderName, indexTemplateData) } } \ No newline at end of file diff --git a/src/main/java/org/digma/intellij/plugin/troubleshooting/TroubleshootingIndexTemplateBuilder.java b/src/main/java/org/digma/intellij/plugin/troubleshooting/TroubleshootingIndexTemplateBuilder.java index a4dfe27b0..c8c86796f 100644 --- a/src/main/java/org/digma/intellij/plugin/troubleshooting/TroubleshootingIndexTemplateBuilder.java +++ b/src/main/java/org/digma/intellij/plugin/troubleshooting/TroubleshootingIndexTemplateBuilder.java @@ -35,7 +35,7 @@ class TroubleshootingIndexTemplateBuilder { private final Configuration freemarketConfiguration = new Configuration(Configuration.VERSION_2_3_30); public TroubleshootingIndexTemplateBuilder() { - freemarketConfiguration.setClassForTemplateLoading(this.getClass(), TroubleshootingService.RESOURCE_FOLDER_NAME); + freemarketConfiguration.setClassForTemplateLoading(this.getClass(), TroubleshootingService.TEMPLATE_FOLDER_NAME); freemarketConfiguration.setDefaultEncoding(StandardCharsets.UTF_8.name()); freemarketConfiguration.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER); freemarketConfiguration.setNumberFormat("computer"); diff --git a/src/main/java/org/digma/intellij/plugin/troubleshooting/TroubleshootingResourceHandler.java b/src/main/java/org/digma/intellij/plugin/troubleshooting/TroubleshootingResourceHandler.java index 559c0392d..4df3f71d3 100644 --- a/src/main/java/org/digma/intellij/plugin/troubleshooting/TroubleshootingResourceHandler.java +++ b/src/main/java/org/digma/intellij/plugin/troubleshooting/TroubleshootingResourceHandler.java @@ -10,6 +10,7 @@ import org.cef.network.CefRequest; import org.cef.network.CefResponse; import org.digma.intellij.plugin.log.Log; +import org.digma.intellij.plugin.updates.ui.UIResourcesService; import java.io.IOException; import java.io.InputStream; @@ -36,7 +37,7 @@ public boolean processRequest(CefRequest request, CefCallback callback) { if (TroubleshootingService.getInstance(project).isIndexHtml(path)) { inputStream = TroubleshootingService.getInstance(project).buildIndexFromTemplate(path); } else { - inputStream = getClass().getResourceAsStream(path); + inputStream = UIResourcesService.getInstance().getResourceAsStream(path); } if (inputStream == null) { diff --git a/src/main/java/org/digma/intellij/plugin/troubleshooting/TroubleshootingSchemeHandlerFactory.java b/src/main/java/org/digma/intellij/plugin/troubleshooting/TroubleshootingSchemeHandlerFactory.java index d4ec0b475..1e402c0a1 100644 --- a/src/main/java/org/digma/intellij/plugin/troubleshooting/TroubleshootingSchemeHandlerFactory.java +++ b/src/main/java/org/digma/intellij/plugin/troubleshooting/TroubleshootingSchemeHandlerFactory.java @@ -6,6 +6,7 @@ import org.cef.callback.CefSchemeHandlerFactory; import org.cef.handler.CefResourceHandler; import org.cef.network.CefRequest; +import org.digma.intellij.plugin.updates.ui.UIResourcesService; import org.jetbrains.annotations.Nullable; import java.net.MalformedURLException; @@ -23,16 +24,15 @@ public CefResourceHandler create(CefBrowser browser, CefFrame frame, String sche var url = getUrl(request); if (url != null) { var host = url.getHost(); - var file = url.getFile(); + var file = url.getPath(); if (TroubleshootingService.DOMAIN_NAME.equals(host) && TroubleshootingService.SCHEMA_NAME.equals(schemeName)) { - var resourceName = TroubleshootingService.RESOURCE_FOLDER_NAME + file; - var resource = getClass().getResource(resourceName); - if (resource != null) { + + String resourceName = file.replaceAll("^/+", ""); + boolean resourceExists = UIResourcesService.getInstance().isResourceExists(resourceName); + if (resourceExists){ return new TroubleshootingResourceHandler(project, resourceName); - } else if (getClass().getResource("/webview/common" + file) != null) { - return new TroubleshootingResourceHandler(project, "/webview/common" + file); - } else { + }else{ return new TroubleshootingResourceHandler(project, TroubleshootingService.RESOURCE_FOLDER_NAME + "/index.html"); } } diff --git a/src/main/java/org/digma/intellij/plugin/troubleshooting/TroubleshootingService.java b/src/main/java/org/digma/intellij/plugin/troubleshooting/TroubleshootingService.java index 3d8d05281..25867618e 100644 --- a/src/main/java/org/digma/intellij/plugin/troubleshooting/TroubleshootingService.java +++ b/src/main/java/org/digma/intellij/plugin/troubleshooting/TroubleshootingService.java @@ -20,7 +20,8 @@ public final class TroubleshootingService implements Disposable { private final Project project; - static final String RESOURCE_FOLDER_NAME = "/webview/troubleshooting"; + static final String RESOURCE_FOLDER_NAME = "troubleshooting"; + static final String TEMPLATE_FOLDER_NAME = "/webview/troubleshooting"; static final String DOMAIN_NAME = "troubleshooting"; static final String SCHEMA_NAME = "http"; @@ -40,7 +41,7 @@ JComponent getComponent() { if (JBCefApp.isSupported()) { jbCefBrowser = JBCefBrowserBuilderCreator.create() - .setUrl("http://" + DOMAIN_NAME + "/index.html") + .setUrl("http://" + DOMAIN_NAME + "/" + RESOURCE_FOLDER_NAME + "/index.html") .build(); var jbCefClient = jbCefBrowser.getJBCefClient(); diff --git a/src/main/kotlin/org/digma/intellij/plugin/ui/common/UpdateVersionPanel.kt b/src/main/kotlin/org/digma/intellij/plugin/ui/common/UpdateVersionPanel.kt index 250b4234c..acdd71150 100644 --- a/src/main/kotlin/org/digma/intellij/plugin/ui/common/UpdateVersionPanel.kt +++ b/src/main/kotlin/org/digma/intellij/plugin/ui/common/UpdateVersionPanel.kt @@ -13,6 +13,7 @@ import org.digma.intellij.plugin.ui.panels.DigmaResettablePanel import org.digma.intellij.plugin.updates.AggressiveUpdateService import org.digma.intellij.plugin.updates.UpdateState import org.digma.intellij.plugin.updates.UpdatesService +import org.digma.intellij.plugin.updates.ui.UIVersioningService import javax.swing.BorderFactory import javax.swing.Box import javax.swing.BoxLayout @@ -117,7 +118,8 @@ class UpdateVersionPanel( mapOf( "shouldUpdateBackend" to updateState.shouldUpdateBackend, "shouldUpdatePlugin" to updateState.shouldUpdatePlugin, - "backendDeploymentType" to updateState.backendDeploymentType + "backendDeploymentType" to updateState.backendDeploymentType, + "shouldUpdateUi" to updateState.shouldUpdateUi ) ) @@ -127,6 +129,8 @@ class UpdateVersionPanel( UpdateBackendAction().updateBackend(project, updateState.backendDeploymentType, updateButton) } else if (updateState.shouldUpdatePlugin) { ShowSettingsUtil.getInstance().showSettingsDialog(project, "Plugins") + }else if (updateState.shouldUpdateUi){ + UIVersioningService.getInstance().updateToLatestDownloaded() } this.isVisible = false @@ -142,8 +146,10 @@ class UpdateVersionPanel( private fun buildText(updateState: UpdateState): String { return if (updateState.shouldUpdateBackend) { asHtml("Update Recommended | Digma analysis backend") - } else { + } else if(updateState.shouldUpdatePlugin){ asHtml("Update Recommended | Digma IDE plugin") + }else{ + asHtml("Update Recommended | Digma UI ${UIVersioningService.getInstance().getCurrentUiVersion()} -> ${UIVersioningService.getInstance().getLatestDownloadedVersion()}") } } diff --git a/src/main/kotlin/org/digma/intellij/plugin/ui/jcef/BaseResourceHandler.kt b/src/main/kotlin/org/digma/intellij/plugin/ui/jcef/BaseResourceHandler.kt index 1882b494d..0c9ae69f9 100644 --- a/src/main/kotlin/org/digma/intellij/plugin/ui/jcef/BaseResourceHandler.kt +++ b/src/main/kotlin/org/digma/intellij/plugin/ui/jcef/BaseResourceHandler.kt @@ -10,6 +10,7 @@ import org.cef.misc.StringRef import org.cef.network.CefRequest import org.cef.network.CefResponse import org.digma.intellij.plugin.log.Log +import org.digma.intellij.plugin.updates.ui.UIResourcesService import java.io.IOException import java.io.InputStream import kotlin.math.min @@ -33,7 +34,7 @@ abstract class BaseResourceHandler(private val path: String, protected val brows inputStream = if (isIndexHtml(path)) { buildIndexFromTemplate(path) } else { - javaClass.getResourceAsStream(path) + UIResourcesService.getInstance().getResourceAsStream(path) } if (inputStream == null) { diff --git a/src/main/kotlin/org/digma/intellij/plugin/ui/jcef/BaseSchemeHandlerFactory.kt b/src/main/kotlin/org/digma/intellij/plugin/ui/jcef/BaseSchemeHandlerFactory.kt index 4d22cb566..a87774a9d 100644 --- a/src/main/kotlin/org/digma/intellij/plugin/ui/jcef/BaseSchemeHandlerFactory.kt +++ b/src/main/kotlin/org/digma/intellij/plugin/ui/jcef/BaseSchemeHandlerFactory.kt @@ -9,13 +9,11 @@ import org.cef.handler.CefResourceHandler import org.cef.network.CefRequest import org.digma.intellij.plugin.errorreporting.ErrorReporter import org.digma.intellij.plugin.log.Log +import org.digma.intellij.plugin.updates.ui.UIResourcesService import java.net.MalformedURLException import java.net.URL -private const val COMMON_FILES_FOLDER: String = "/webview/common" - - abstract class BaseSchemeHandlerFactory : CefSchemeHandlerFactory { private val logger: Logger = Logger.getInstance(this::class.java) @@ -41,7 +39,7 @@ abstract class BaseSchemeHandlerFactory : CefSchemeHandlerFactory { if (url != null) { val host = url.host - val file = url.file + val file = url.path val proxyHandler = createProxyHandler(project, url) if (proxyHandler != null) { @@ -49,15 +47,19 @@ abstract class BaseSchemeHandlerFactory : CefSchemeHandlerFactory { } if (getDomain() == host && getSchema() == schemeName) { - var resourceName = getResourceFolderName() + file - var resource = javaClass.getResource(resourceName) - - if (resource === null) { - resourceName = "$COMMON_FILES_FOLDER$file" - resource = javaClass.getResource(resourceName) + var resourceName = file.removePrefix("/") + var resourceExists = UIResourcesService.getInstance().isResourceExists(resourceName) + + //we need this specially for jaeger ui because paths are absolute + if (!resourceExists){ + val tryResourceNameUnderAppFolder = "${getResourceFolderName()}/$resourceName" + resourceExists = UIResourcesService.getInstance().isResourceExists(tryResourceNameUnderAppFolder ) + if (resourceExists){ + resourceName = tryResourceNameUnderAppFolder + } } - return createResourceHandler(resourceName, resource !== null, browser) + return createResourceHandler(resourceName, resourceExists, browser) } } return null @@ -72,12 +74,13 @@ abstract class BaseSchemeHandlerFactory : CefSchemeHandlerFactory { } } - protected open fun createProxyHandler(project: Project, url: URL): CefResourceHandler?{ + protected open fun createProxyHandler(project: Project, url: URL): CefResourceHandler? { return null } + abstract fun createResourceHandler(resourceName: String, resourceExists: Boolean, browser: CefBrowser): CefResourceHandler abstract fun getSchema(): String abstract fun getDomain(): String - abstract fun getResourceFolderName(): String + abstract fun getResourceFolderName(): String //todo: remove } \ No newline at end of file diff --git a/src/main/kotlin/org/digma/intellij/plugin/ui/mainapp/MainAppConstants.kt b/src/main/kotlin/org/digma/intellij/plugin/ui/mainapp/MainAppConstants.kt index 25aa726a8..51a5417c6 100644 --- a/src/main/kotlin/org/digma/intellij/plugin/ui/mainapp/MainAppConstants.kt +++ b/src/main/kotlin/org/digma/intellij/plugin/ui/mainapp/MainAppConstants.kt @@ -2,6 +2,7 @@ package org.digma.intellij.plugin.ui.mainapp const val MAIN_APP_DOMAIN_NAME = "main" const val MAIN_APP_SCHEMA = "https" -const val MAIN_APP_URL = "$MAIN_APP_SCHEMA://$MAIN_APP_DOMAIN_NAME/index.html" -const val MAIN_APP_RESOURCE_FOLDER_NAME = "/webview/main" +const val MAIN_APP_RESOURCE_FOLDER_NAME = "main" //folder in ui zip bundle +const val MAIN_APP_URL = "$MAIN_APP_SCHEMA://$MAIN_APP_DOMAIN_NAME/$MAIN_APP_RESOURCE_FOLDER_NAME/index.html" +const val MAIN_APP_TEMPLATE_FOLDER_NAME = "/webview/main" const val MAIN_APP_INDEX_TEMPLATE_NAME = "maintemplate.ftl" \ No newline at end of file diff --git a/src/main/kotlin/org/digma/intellij/plugin/ui/mainapp/MainAppIndexTemplateBuilder.kt b/src/main/kotlin/org/digma/intellij/plugin/ui/mainapp/MainAppIndexTemplateBuilder.kt index 234bc5563..8736c8f9c 100644 --- a/src/main/kotlin/org/digma/intellij/plugin/ui/mainapp/MainAppIndexTemplateBuilder.kt +++ b/src/main/kotlin/org/digma/intellij/plugin/ui/mainapp/MainAppIndexTemplateBuilder.kt @@ -3,7 +3,7 @@ package org.digma.intellij.plugin.ui.mainapp import com.intellij.openapi.project.Project import org.digma.intellij.plugin.ui.jcef.BaseIndexTemplateBuilder -class MainAppIndexTemplateBuilder : BaseIndexTemplateBuilder(MAIN_APP_RESOURCE_FOLDER_NAME, MAIN_APP_INDEX_TEMPLATE_NAME) { +class MainAppIndexTemplateBuilder : BaseIndexTemplateBuilder(MAIN_APP_TEMPLATE_FOLDER_NAME, MAIN_APP_INDEX_TEMPLATE_NAME) { override fun addAppSpecificEnvVariable(project: Project, data: MutableMap) { diff --git a/src/main/kotlin/org/digma/intellij/plugin/ui/recentactivity/RecentActivityConstants.kt b/src/main/kotlin/org/digma/intellij/plugin/ui/recentactivity/RecentActivityConstants.kt index 95c457e87..aae8f3b12 100644 --- a/src/main/kotlin/org/digma/intellij/plugin/ui/recentactivity/RecentActivityConstants.kt +++ b/src/main/kotlin/org/digma/intellij/plugin/ui/recentactivity/RecentActivityConstants.kt @@ -2,7 +2,8 @@ package org.digma.intellij.plugin.ui.recentactivity const val RECENT_ACTIVITY_DOMAIN_NAME = "recentactivity" const val RECENT_ACTIVITY_APP_SCHEMA = "https" -const val RECENT_ACTIVITY_URL = "$RECENT_ACTIVITY_APP_SCHEMA://$RECENT_ACTIVITY_DOMAIN_NAME/index.html" -const val RECENT_ACTIVITY_RESOURCE_FOLDER_NAME = "/webview/recentactivity" +const val RECENT_ACTIVITY_RESOURCE_FOLDER_NAME = "recent-activity" +const val RECENT_ACTIVITY_URL = "$RECENT_ACTIVITY_APP_SCHEMA://$RECENT_ACTIVITY_DOMAIN_NAME/$RECENT_ACTIVITY_RESOURCE_FOLDER_NAME/index.html" +const val RECENT_ACTIVITY_TEMPLATE_FOLDER_NAME = "/webview/recentactivity" const val RECENT_ACTIVITY_INDEX_TEMPLATE_NAME = "recentActivityTemplate.ftl" const val RECENT_EXPIRATION_LIMIT_MILLIS: Long = 10 * 60 * 1000 // 10min \ No newline at end of file diff --git a/src/main/kotlin/org/digma/intellij/plugin/ui/recentactivity/RecentActivityIndexTemplateBuilder.kt b/src/main/kotlin/org/digma/intellij/plugin/ui/recentactivity/RecentActivityIndexTemplateBuilder.kt index 72055065c..1f9de6026 100644 --- a/src/main/kotlin/org/digma/intellij/plugin/ui/recentactivity/RecentActivityIndexTemplateBuilder.kt +++ b/src/main/kotlin/org/digma/intellij/plugin/ui/recentactivity/RecentActivityIndexTemplateBuilder.kt @@ -7,7 +7,7 @@ private const val RECENT_EXPIRATION_LIMIT_VARIABLE = "recentActivityExpirationLi class RecentActivityIndexTemplateBuilder : - BaseIndexTemplateBuilder(RECENT_ACTIVITY_RESOURCE_FOLDER_NAME, RECENT_ACTIVITY_INDEX_TEMPLATE_NAME) { + BaseIndexTemplateBuilder(RECENT_ACTIVITY_TEMPLATE_FOLDER_NAME, RECENT_ACTIVITY_INDEX_TEMPLATE_NAME) { override fun addAppSpecificEnvVariable(project: Project, data: MutableMap) { data[RECENT_EXPIRATION_LIMIT_VARIABLE] = RECENT_EXPIRATION_LIMIT_MILLIS diff --git a/src/main/kotlin/org/digma/intellij/plugin/ui/recentactivity/RecentActivityToolWindowFactory.kt b/src/main/kotlin/org/digma/intellij/plugin/ui/recentactivity/RecentActivityToolWindowFactory.kt index 2ac45f5e4..b90d70411 100644 --- a/src/main/kotlin/org/digma/intellij/plugin/ui/recentactivity/RecentActivityToolWindowFactory.kt +++ b/src/main/kotlin/org/digma/intellij/plugin/ui/recentactivity/RecentActivityToolWindowFactory.kt @@ -1,7 +1,6 @@ package org.digma.intellij.plugin.ui.recentactivity import com.intellij.openapi.Disposable -import com.intellij.openapi.components.service import com.intellij.openapi.diagnostic.Logger import com.intellij.openapi.project.Project import com.intellij.openapi.util.Disposer @@ -31,7 +30,7 @@ class RecentActivityToolWindowFactory : ToolWindowFactory { RecentActivityService.getInstance(project) - project.service().toolWindow = toolWindow + RecentActivityToolWindowShower.getInstance(project).toolWindow = toolWindow val recentActivityPanel = RecentActivityPanel(project) @@ -58,7 +57,7 @@ class RecentActivityToolWindowFactory : ToolWindowFactory { cardsPanel.border = JBUI.Borders.empty() val noConnectionPanel = createNoConnectionPanel(project, parentDisposable) - val updateBackendPanel = createAggressiveUpdatePanel(project, parentDisposable, "recent activity") + val aggressiveUpdatePanel = createAggressiveUpdatePanel(project, parentDisposable, "recent activity") cardsPanel.add(mainPanel, RecentActivityToolWindowCardsController.RecentActivityWindowCard.MAIN.name) @@ -67,8 +66,8 @@ class RecentActivityToolWindowFactory : ToolWindowFactory { cardsPanel.add(noConnectionPanel, RecentActivityToolWindowCardsController.RecentActivityWindowCard.NO_CONNECTION.name) cardLayout.addLayoutComponent(noConnectionPanel, RecentActivityToolWindowCardsController.RecentActivityWindowCard.NO_CONNECTION.name) - cardsPanel.add(updateBackendPanel, RecentActivityToolWindowCardsController.RecentActivityWindowCard.UPDATE_MODE.name) - cardLayout.addLayoutComponent(updateBackendPanel, RecentActivityToolWindowCardsController.RecentActivityWindowCard.UPDATE_MODE.name) + cardsPanel.add(aggressiveUpdatePanel, RecentActivityToolWindowCardsController.RecentActivityWindowCard.UPDATE_MODE.name) + cardLayout.addLayoutComponent(aggressiveUpdatePanel, RecentActivityToolWindowCardsController.RecentActivityWindowCard.UPDATE_MODE.name) //start at MAIN cardLayout.show(cardsPanel, RecentActivityToolWindowCardsController.RecentActivityWindowCard.MAIN.name) diff --git a/src/main/kotlin/org/digma/intellij/plugin/ui/wizard/InstallationWizardSidePanelWindowPanel.kt b/src/main/kotlin/org/digma/intellij/plugin/ui/wizard/InstallationWizardSidePanelWindowPanel.kt index 29113cd10..fc1d44305 100644 --- a/src/main/kotlin/org/digma/intellij/plugin/ui/wizard/InstallationWizardSidePanelWindowPanel.kt +++ b/src/main/kotlin/org/digma/intellij/plugin/ui/wizard/InstallationWizardSidePanelWindowPanel.kt @@ -87,7 +87,9 @@ import java.util.concurrent.atomic.AtomicReference import javax.swing.JPanel import kotlin.time.Duration.Companion.seconds -private const val RESOURCE_FOLDER_NAME = "installationwizard" +private const val DOMAIN_NAME = "installationwizard" +private const val RESOURCE_FOLDER_NAME = "installation-wizard" +private const val TEMPLATE_FOLDER_NAME = "installationwizard" private const val ENV_VARIABLE_IDE: String = "ide" private const val USER_EMAIL_VARIABLE: String = "userEmail" private const val IS_OBSERVABILITY_ENABLED_VARIABLE: String = "isObservabilityEnabled" @@ -118,7 +120,7 @@ fun createInstallationWizardSidePanelWindowPanel(project: Project, wizardSkipIns } val jbCefBrowser = JBCefBrowserBuilderCreator.create() - .setUrl("https://$RESOURCE_FOLDER_NAME/index.html") + .setUrl("https://$DOMAIN_NAME/$RESOURCE_FOLDER_NAME/index.html") .build() val indexTemplateData = mutableMapOf( ENV_VARIABLE_IDE to ApplicationNamesInfo.getInstance().productName, //Available values: "IDEA", "Rider", "PyCharm" @@ -145,8 +147,8 @@ fun createInstallationWizardSidePanelWindowPanel(project: Project, wizardSkipIns CefApp.getInstance() .registerSchemeHandlerFactory( "https", - RESOURCE_FOLDER_NAME, - CustomSchemeHandlerFactory(RESOURCE_FOLDER_NAME, indexTemplateData) + DOMAIN_NAME, + CustomSchemeHandlerFactory(DOMAIN_NAME, TEMPLATE_FOLDER_NAME,RESOURCE_FOLDER_NAME, indexTemplateData) ) } } diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 8fc94d8c5..fe3461626 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -131,6 +131,8 @@ implementation="org.digma.intellij.plugin.dashboard.DashboardServiceStarter"/> + diff --git a/src/main/resources/webview/common/fonts/JetBrainsMono-Medium.ttf b/src/main/resources/webview/common/fonts/JetBrainsMono-Medium.ttf deleted file mode 100644 index 2793a9d35..000000000 Binary files a/src/main/resources/webview/common/fonts/JetBrainsMono-Medium.ttf and /dev/null differ diff --git a/src/main/resources/webview/common/images/DigmoWithAmazonGiftCard.svg b/src/main/resources/webview/common/images/DigmoWithAmazonGiftCard.svg deleted file mode 100644 index c584dc037..000000000 --- a/src/main/resources/webview/common/images/DigmoWithAmazonGiftCard.svg +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/webview/common/images/confettiBackground.svg b/src/main/resources/webview/common/images/confettiBackground.svg deleted file mode 100644 index 1e2e6e8f0..000000000 --- a/src/main/resources/webview/common/images/confettiBackground.svg +++ /dev/null @@ -1,362 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/webview/common/images/digmaLogo_dark.svg b/src/main/resources/webview/common/images/digmaLogo_dark.svg deleted file mode 100644 index 626ab1e8a..000000000 --- a/src/main/resources/webview/common/images/digmaLogo_dark.svg +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/webview/common/images/digmaLogo_light.svg b/src/main/resources/webview/common/images/digmaLogo_light.svg deleted file mode 100644 index 30f77cbc5..000000000 --- a/src/main/resources/webview/common/images/digmaLogo_light.svg +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/webview/common/images/environmentId_dark.svg b/src/main/resources/webview/common/images/environmentId_dark.svg deleted file mode 100644 index 22d16412f..000000000 --- a/src/main/resources/webview/common/images/environmentId_dark.svg +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/webview/common/images/environmentId_light.svg b/src/main/resources/webview/common/images/environmentId_light.svg deleted file mode 100644 index 97e74e8b5..000000000 --- a/src/main/resources/webview/common/images/environmentId_light.svg +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/webview/common/images/gettingStartedVideoThumbnail_dark.png b/src/main/resources/webview/common/images/gettingStartedVideoThumbnail_dark.png deleted file mode 100644 index f4143cf7b..000000000 Binary files a/src/main/resources/webview/common/images/gettingStartedVideoThumbnail_dark.png and /dev/null differ diff --git a/src/main/resources/webview/common/images/gettingStartedVideoThumbnail_light.png b/src/main/resources/webview/common/images/gettingStartedVideoThumbnail_light.png deleted file mode 100644 index 6b6966509..000000000 Binary files a/src/main/resources/webview/common/images/gettingStartedVideoThumbnail_light.png and /dev/null differ diff --git a/src/main/resources/webview/common/images/howToSetupEnvironmentMenuItem_dark.svg b/src/main/resources/webview/common/images/howToSetupEnvironmentMenuItem_dark.svg deleted file mode 100644 index 72d426cce..000000000 --- a/src/main/resources/webview/common/images/howToSetupEnvironmentMenuItem_dark.svg +++ /dev/null @@ -1,259 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/webview/common/images/howToSetupEnvironmentMenuItem_light.svg b/src/main/resources/webview/common/images/howToSetupEnvironmentMenuItem_light.svg deleted file mode 100644 index 0a2b7eb77..000000000 --- a/src/main/resources/webview/common/images/howToSetupEnvironmentMenuItem_light.svg +++ /dev/null @@ -1,247 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/webview/common/images/insightCards/BottleneckInsightCard.svg b/src/main/resources/webview/common/images/insightCards/BottleneckInsightCard.svg deleted file mode 100644 index e5e9b45d6..000000000 --- a/src/main/resources/webview/common/images/insightCards/BottleneckInsightCard.svg +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/webview/common/images/insightCards/EndpointHighNumberOfQueriesInsightCard.svg b/src/main/resources/webview/common/images/insightCards/EndpointHighNumberOfQueriesInsightCard.svg deleted file mode 100644 index 74469c1b8..000000000 --- a/src/main/resources/webview/common/images/insightCards/EndpointHighNumberOfQueriesInsightCard.svg +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/webview/common/images/insightCards/EndpointSessionInViewInsightCard.svg b/src/main/resources/webview/common/images/insightCards/EndpointSessionInViewInsightCard.svg deleted file mode 100644 index 9215b75f5..000000000 --- a/src/main/resources/webview/common/images/insightCards/EndpointSessionInViewInsightCard.svg +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/webview/common/images/insightCards/HotSpotInsightCard.svg b/src/main/resources/webview/common/images/insightCards/HotSpotInsightCard.svg deleted file mode 100644 index 4de06c0e0..000000000 --- a/src/main/resources/webview/common/images/insightCards/HotSpotInsightCard.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/webview/common/images/insightCards/NPlusOneInsightCard.svg b/src/main/resources/webview/common/images/insightCards/NPlusOneInsightCard.svg deleted file mode 100644 index dbbd89e86..000000000 --- a/src/main/resources/webview/common/images/insightCards/NPlusOneInsightCard.svg +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/webview/common/images/insightCards/QueryOptimizationInsightCard.svg b/src/main/resources/webview/common/images/insightCards/QueryOptimizationInsightCard.svg deleted file mode 100644 index 86ce42a9c..000000000 --- a/src/main/resources/webview/common/images/insightCards/QueryOptimizationInsightCard.svg +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/webview/common/images/insightCards/SpanNexusInsightCard.svg b/src/main/resources/webview/common/images/insightCards/SpanNexusInsightCard.svg deleted file mode 100644 index ca2dd4a81..000000000 --- a/src/main/resources/webview/common/images/insightCards/SpanNexusInsightCard.svg +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/webview/common/images/insightCards/SpanScalingInsightCard.svg b/src/main/resources/webview/common/images/insightCards/SpanScalingInsightCard.svg deleted file mode 100644 index 3f4194cc9..000000000 --- a/src/main/resources/webview/common/images/insightCards/SpanScalingInsightCard.svg +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/webview/common/images/insightCards/SpanUsagesInsightCard.svg b/src/main/resources/webview/common/images/insightCards/SpanUsagesInsightCard.svg deleted file mode 100644 index e2350c244..000000000 --- a/src/main/resources/webview/common/images/insightCards/SpanUsagesInsightCard.svg +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/webview/common/images/longArrow.svg b/src/main/resources/webview/common/images/longArrow.svg deleted file mode 100644 index c9c01de66..000000000 --- a/src/main/resources/webview/common/images/longArrow.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/main/resources/webview/common/images/nightCityView.svg b/src/main/resources/webview/common/images/nightCityView.svg deleted file mode 100644 index cd9ad8270..000000000 --- a/src/main/resources/webview/common/images/nightCityView.svg +++ /dev/null @@ -1,1595 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/webview/common/images/observabilityEnvVariable.png b/src/main/resources/webview/common/images/observabilityEnvVariable.png deleted file mode 100644 index 4fa22c171..000000000 Binary files a/src/main/resources/webview/common/images/observabilityEnvVariable.png and /dev/null differ diff --git a/src/main/resources/webview/common/images/observabilityToggleSwitch_dark.png b/src/main/resources/webview/common/images/observabilityToggleSwitch_dark.png deleted file mode 100644 index dd6364e26..000000000 Binary files a/src/main/resources/webview/common/images/observabilityToggleSwitch_dark.png and /dev/null differ diff --git a/src/main/resources/webview/common/images/observabilityToggleSwitch_light.png b/src/main/resources/webview/common/images/observabilityToggleSwitch_light.png deleted file mode 100644 index 7f027e397..000000000 Binary files a/src/main/resources/webview/common/images/observabilityToggleSwitch_light.png and /dev/null differ diff --git a/src/main/resources/webview/common/images/promotion/early-access/collapsedContainerBackground.svg b/src/main/resources/webview/common/images/promotion/early-access/collapsedContainerBackground.svg deleted file mode 100644 index e16c8423b..000000000 --- a/src/main/resources/webview/common/images/promotion/early-access/collapsedContainerBackground.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/src/main/resources/webview/common/images/promotion/early-access/promotionLogo.svg b/src/main/resources/webview/common/images/promotion/early-access/promotionLogo.svg deleted file mode 100644 index d276c21fe..000000000 --- a/src/main/resources/webview/common/images/promotion/early-access/promotionLogo.svg +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/webview/common/images/promotion/early-access/registrationPromoLogo.svg b/src/main/resources/webview/common/images/promotion/early-access/registrationPromoLogo.svg deleted file mode 100644 index dfaaf5c8c..000000000 --- a/src/main/resources/webview/common/images/promotion/early-access/registrationPromoLogo.svg +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/webview/common/images/promotion/early-access/registrationPromoSuccess_dark.svg b/src/main/resources/webview/common/images/promotion/early-access/registrationPromoSuccess_dark.svg deleted file mode 100644 index fd97848ad..000000000 --- a/src/main/resources/webview/common/images/promotion/early-access/registrationPromoSuccess_dark.svg +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/webview/common/images/promotion/early-access/registrationPromoSuccess_light.svg b/src/main/resources/webview/common/images/promotion/early-access/registrationPromoSuccess_light.svg deleted file mode 100644 index dae6e0b9d..000000000 --- a/src/main/resources/webview/common/images/promotion/early-access/registrationPromoSuccess_light.svg +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/webview/common/images/promotion/udemy/collapsedContainerBackground.svg b/src/main/resources/webview/common/images/promotion/udemy/collapsedContainerBackground.svg deleted file mode 100644 index ceb73dc88..000000000 --- a/src/main/resources/webview/common/images/promotion/udemy/collapsedContainerBackground.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/main/resources/webview/common/images/promotion/udemy/collapsedContainerEllipseShadow.svg b/src/main/resources/webview/common/images/promotion/udemy/collapsedContainerEllipseShadow.svg deleted file mode 100644 index 4eb84f0c4..000000000 --- a/src/main/resources/webview/common/images/promotion/udemy/collapsedContainerEllipseShadow.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/src/main/resources/webview/common/images/promotion/udemy/promotionLogo.svg b/src/main/resources/webview/common/images/promotion/udemy/promotionLogo.svg deleted file mode 100644 index 71a8c01a3..000000000 --- a/src/main/resources/webview/common/images/promotion/udemy/promotionLogo.svg +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/webview/common/images/promotion/udemy/promotionLogoWithShadow.svg b/src/main/resources/webview/common/images/promotion/udemy/promotionLogoWithShadow.svg deleted file mode 100644 index dfaac2e64..000000000 --- a/src/main/resources/webview/common/images/promotion/udemy/promotionLogoWithShadow.svg +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/webview/common/images/promotion/udemy/registrationPromoLogo_dark.svg b/src/main/resources/webview/common/images/promotion/udemy/registrationPromoLogo_dark.svg deleted file mode 100644 index 3a2fbc735..000000000 --- a/src/main/resources/webview/common/images/promotion/udemy/registrationPromoLogo_dark.svg +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/webview/common/images/promotion/udemy/registrationPromoLogo_light.svg b/src/main/resources/webview/common/images/promotion/udemy/registrationPromoLogo_light.svg deleted file mode 100644 index 80a3db58a..000000000 --- a/src/main/resources/webview/common/images/promotion/udemy/registrationPromoLogo_light.svg +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/webview/common/images/promotion/udemy/registrationPromoSuccess_dark.svg b/src/main/resources/webview/common/images/promotion/udemy/registrationPromoSuccess_dark.svg deleted file mode 100644 index d14cf1bea..000000000 --- a/src/main/resources/webview/common/images/promotion/udemy/registrationPromoSuccess_dark.svg +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/webview/common/images/promotion/udemy/registrationPromoSuccess_light.svg b/src/main/resources/webview/common/images/promotion/udemy/registrationPromoSuccess_light.svg deleted file mode 100644 index 4a2c792f9..000000000 --- a/src/main/resources/webview/common/images/promotion/udemy/registrationPromoSuccess_light.svg +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/webview/common/images/runOrDebug_dark.gif b/src/main/resources/webview/common/images/runOrDebug_dark.gif deleted file mode 100644 index 1a9e8f744..000000000 Binary files a/src/main/resources/webview/common/images/runOrDebug_dark.gif and /dev/null differ diff --git a/src/main/resources/webview/common/images/runOrDebug_light.gif b/src/main/resources/webview/common/images/runOrDebug_light.gif deleted file mode 100644 index bf6a6637b..000000000 Binary files a/src/main/resources/webview/common/images/runOrDebug_light.gif and /dev/null differ diff --git a/src/main/resources/webview/dashboard/dashboard.ftl b/src/main/resources/webview/dashboard/dashboard.ftl index b060d4b86..6a8385fa4 100644 --- a/src/main/resources/webview/dashboard/dashboard.ftl +++ b/src/main/resources/webview/dashboard/dashboard.ftl @@ -5,7 +5,7 @@ - - -
- - - - - diff --git a/src/main/resources/webview/dashboard/index.js b/src/main/resources/webview/dashboard/index.js deleted file mode 100644 index 15b602f82..000000000 --- a/src/main/resources/webview/dashboard/index.js +++ /dev/null @@ -1,1140 +0,0 @@ -/*! For license information please see index.js.LICENSE.txt */ -(()=>{var e,t,n={39924:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Composite:()=>Qt,CompositeItem:()=>Zt,FloatingArrow:()=>rn,FloatingDelayGroup:()=>wn,FloatingFocusManager:()=>Wn,FloatingList:()=>zt,FloatingNode:()=>dn,FloatingOverlay:()=>Kn,FloatingPortal:()=>zn,FloatingTree:()=>fn,arrow:()=>ct,autoPlacement:()=>lt,autoUpdate:()=>je,computePosition:()=>Ke,detectOverflow:()=>Fe,flip:()=>it,getOverflowAncestors:()=>Se,hide:()=>st,inline:()=>ut,inner:()=>_r,limitShift:()=>ot,offset:()=>nt,platform:()=>Le,safePolygon:()=>Cr,shift:()=>rt,size:()=>at,useClick:()=>Zn,useClientPoint:()=>tr,useDelayGroup:()=>Sn,useDelayGroupContext:()=>bn,useDismiss:()=>ir,useFloating:()=>ar,useFloatingNodeId:()=>cn,useFloatingParentNodeId:()=>sn,useFloatingPortalNode:()=>Hn,useFloatingTree:()=>un,useFocus:()=>lr,useHover:()=>vn,useId:()=>nn,useInnerOffset:()=>Tr,useInteractions:()=>ur,useListItem:()=>Gt,useListNavigation:()=>hr,useMergeRefs:()=>xt,useRole:()=>mr,useTransitionStatus:()=>br,useTransitionStyles:()=>wr,useTypeahead:()=>Sr});var r=n(96540),o=n.t(r,2);Math.min,Math.max,Math.round;const i=Math.floor;function a(e){return s(e)?(e.nodeName||"").toLowerCase():"#document"}function l(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function s(e){return e instanceof Node||e instanceof l(e).Node}function u(e){return e instanceof Element||e instanceof l(e).Element}function c(e){return e instanceof HTMLElement||e instanceof l(e).HTMLElement}function d(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof l(e).ShadowRoot)}function f(e){if("html"===a(e))return e;const t=e.assignedSlot||e.parentNode||d(e)&&e.host||function(e){var t;return null==(t=(s(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}(e);return d(t)?t.host:t}function p(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(r=n.shadowRoot)?void 0:r.activeElement);){var n,r;t=t.shadowRoot.activeElement}return t}function g(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&d(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function h(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function m(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function v(e){if(0===e.mozInputSource&&e.isTrusted)return!0;const t=/Android/i;return(t.test(h())||t.test(m()))&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType}function y(e){return 0===e.width&&0===e.height||1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"!==e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail}function b(){return/apple/i.test(navigator.vendor)}function w(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function S(e){return(null==e?void 0:e.ownerDocument)||document}function E(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function _(e){return"composedPath"in e?e.composedPath()[0]:e.target}const T="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function A(e){return c(e)&&e.matches(T)}function C(e){e.preventDefault(),e.stopPropagation()}const x=["top","right","bottom","left"],I=["start","end"],R=x.reduce(((e,t)=>e.concat(t,t+"-"+I[0],t+"-"+I[1])),[]),O=Math.min,M=Math.max,k=(Math.round,Math.floor,{left:"right",right:"left",bottom:"top",top:"bottom"}),D={start:"end",end:"start"};function N(e,t,n){return M(e,O(t,n))}function P(e,t){return"function"==typeof e?e(t):e}function L(e){return e.split("-")[0]}function j(e){return e.split("-")[1]}function F(e){return"x"===e?"y":"x"}function B(e){return"y"===e?"height":"width"}function U(e){return["top","bottom"].includes(L(e))?"y":"x"}function $(e){return F(U(e))}function H(e,t,n){void 0===n&&(n=!1);const r=j(e),o=$(e),i=B(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=G(a)),[a,G(a)]}function z(e){return e.replace(/start|end/g,(e=>D[e]))}function G(e){return e.replace(/left|right|bottom|top/g,(e=>k[e]))}function V(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function W(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Y(e,t,n){let{reference:r,floating:o}=e;const i=U(t),a=$(t),l=B(a),s=L(t),u="y"===i,c=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[l]/2-o[l]/2;let p;switch(s){case"top":p={x:c,y:r.y-o.height};break;case"bottom":p={x:c,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(j(t)){case"start":p[a]-=f*(n&&u?-1:1);break;case"end":p[a]+=f*(n&&u?-1:1)}return p}async function K(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:l,strategy:s}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=P(t,e),g=V(p),h=l[f?"floating"===d?"reference":"floating":d],m=W(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(h)))||n?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:c,strategy:s})),v="floating"===d?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},w=W(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:y,strategy:s}):v);return{top:(m.top-w.top+g.top)/b.y,bottom:(w.bottom-m.bottom+g.bottom)/b.y,left:(m.left-w.left+g.left)/b.x,right:(w.right-m.right+g.right)/b.x}}function q(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Q(e){return x.some((t=>e[t]>=0))}function Z(e){const t=O(...e.map((e=>e.left))),n=O(...e.map((e=>e.top)));return{x:t,y:n,width:M(...e.map((e=>e.right)))-t,height:M(...e.map((e=>e.bottom)))-n}}const X=Math.min,J=Math.max,ee=Math.round,te=Math.floor,ne=e=>({x:e,y:e});function re(){return"undefined"!=typeof window}function oe(e){return le(e)?(e.nodeName||"").toLowerCase():"#document"}function ie(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function ae(e){var t;return null==(t=(le(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function le(e){return!!re()&&(e instanceof Node||e instanceof ie(e).Node)}function se(e){return!!re()&&(e instanceof Element||e instanceof ie(e).Element)}function ue(e){return!!re()&&(e instanceof HTMLElement||e instanceof ie(e).HTMLElement)}function ce(e){return!(!re()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof ie(e).ShadowRoot)}function de(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ve(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function fe(e){return["table","td","th"].includes(oe(e))}function pe(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function ge(e){const t=he(),n=se(e)?ve(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function he(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function me(e){return["html","body","#document"].includes(oe(e))}function ve(e){return ie(e).getComputedStyle(e)}function ye(e){return se(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function be(e){if("html"===oe(e))return e;const t=e.assignedSlot||e.parentNode||ce(e)&&e.host||ae(e);return ce(t)?t.host:t}function we(e){const t=be(e);return me(t)?e.ownerDocument?e.ownerDocument.body:e.body:ue(t)&&de(t)?t:we(t)}function Se(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=we(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=ie(o);if(i){const e=Ee(a);return t.concat(a,a.visualViewport||[],de(o)?o:[],e&&n?Se(e):[])}return t.concat(o,Se(o,[],n))}function Ee(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function _e(e){const t=ve(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ue(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,l=ee(n)!==i||ee(r)!==a;return l&&(n=i,r=a),{width:n,height:r,$:l}}function Te(e){return se(e)?e:e.contextElement}function Ae(e){const t=Te(e);if(!ue(t))return ne(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=_e(t);let a=(i?ee(n.width):n.width)/r,l=(i?ee(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),l&&Number.isFinite(l)||(l=1),{x:a,y:l}}const Ce=ne(0);function xe(e){const t=ie(e);return he()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Ce}function Ie(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Te(e);let a=ne(1);t&&(r?se(r)&&(a=Ae(r)):a=Ae(e));const l=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==ie(e))&&t}(i,n,r)?xe(i):ne(0);let s=(o.left+l.x)/a.x,u=(o.top+l.y)/a.y,c=o.width/a.x,d=o.height/a.y;if(i){const e=ie(i),t=r&&se(r)?ie(r):r;let n=e,o=Ee(n);for(;o&&r&&t!==n;){const e=Ae(o),t=o.getBoundingClientRect(),r=ve(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;s*=e.x,u*=e.y,c*=e.x,d*=e.y,s+=i,u+=a,n=ie(o),o=Ee(n)}}return W({width:c,height:d,x:s,y:u})}function Re(e,t){const n=ye(e).scrollLeft;return t?t.left+n:Ie(ae(e)).left+n}function Oe(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=ie(e),r=ae(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,l=0,s=0;if(o){i=o.width,a=o.height;const e=he();(!e||e&&"fixed"===t)&&(l=o.offsetLeft,s=o.offsetTop)}return{width:i,height:a,x:l,y:s}}(e,n);else if("document"===t)r=function(e){const t=ae(e),n=ye(e),r=e.ownerDocument.body,o=J(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=J(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Re(e);const l=-n.scrollTop;return"rtl"===ve(r).direction&&(a+=J(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:l}}(ae(e));else if(se(t))r=function(e,t){const n=Ie(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=ue(e)?Ae(e):ne(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=xe(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return W(r)}function Me(e,t){const n=be(e);return!(n===t||!se(n)||me(n))&&("fixed"===ve(n).position||Me(n,t))}function ke(e,t,n){const r=ue(t),o=ae(t),i="fixed"===n,a=Ie(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const s=ne(0);if(r||!r&&!i)if(("body"!==oe(t)||de(o))&&(l=ye(t)),r){const e=Ie(t,!0,i,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&(s.x=Re(o));let u=0,c=0;if(o&&!r&&!i){const e=o.getBoundingClientRect();c=e.top+l.scrollTop,u=e.left+l.scrollLeft-Re(o,e)}return{x:a.left+l.scrollLeft-s.x-u,y:a.top+l.scrollTop-s.y-c,width:a.width,height:a.height}}function De(e){return"static"===ve(e).position}function Ne(e,t){if(!ue(e)||"fixed"===ve(e).position)return null;if(t)return t(e);let n=e.offsetParent;return ae(e)===n&&(n=n.ownerDocument.body),n}function Pe(e,t){const n=ie(e);if(pe(e))return n;if(!ue(e)){let t=be(e);for(;t&&!me(t);){if(se(t)&&!De(t))return t;t=be(t)}return n}let r=Ne(e,t);for(;r&&fe(r)&&De(r);)r=Ne(r,t);return r&&me(r)&&De(r)&&!ge(r)?n:r||function(e){let t=be(e);for(;ue(t)&&!me(t);){if(ge(t))return t;if(pe(t))return null;t=be(t)}return null}(e)||n}const Le={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=ae(r),l=!!t&&pe(t.floating);if(r===a||l&&i)return n;let s={scrollLeft:0,scrollTop:0},u=ne(1);const c=ne(0),d=ue(r);if((d||!d&&!i)&&(("body"!==oe(r)||de(a))&&(s=ye(r)),ue(r))){const e=Ie(r);u=Ae(r),c.x=e.x+r.clientLeft,c.y=e.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-s.scrollLeft*u.x+c.x,y:n.y*u.y-s.scrollTop*u.y+c.y}},getDocumentElement:ae,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?pe(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Se(e,[],!1).filter((e=>se(e)&&"body"!==oe(e))),o=null;const i="fixed"===ve(e).position;let a=i?be(e):e;for(;se(a)&&!me(a);){const t=ve(a),n=ge(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||de(a)&&!n&&Me(e,a))?r=r.filter((e=>e!==a)):o=t,a=be(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=i[0],l=i.reduce(((e,n)=>{const r=Oe(t,n,o);return e.top=J(r.top,e.top),e.right=X(r.right,e.right),e.bottom=X(r.bottom,e.bottom),e.left=J(r.left,e.left),e}),Oe(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:Pe,getElementRects:async function(e){const t=this.getOffsetParent||Pe,n=this.getDimensions,r=await n(e.floating);return{reference:ke(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=_e(e);return{width:t,height:n}},getScale:Ae,isElement:se,isRTL:function(e){return"rtl"===ve(e).direction}};function je(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:s=!1}=r,u=Te(e),c=o||i?[...u?Se(u):[],...Se(t)]:[];c.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=u&&l?function(e,t){let n,r=null;const o=ae(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(l,s){void 0===l&&(l=!1),void 0===s&&(s=1),i();const{left:u,top:c,width:d,height:f}=e.getBoundingClientRect();if(l||t(),!d||!f)return;const p={rootMargin:-te(c)+"px "+-te(o.clientWidth-(u+d))+"px "+-te(o.clientHeight-(c+f))+"px "+-te(u)+"px",threshold:J(0,X(1,s))||1};let g=!0;function h(e){const t=e[0].intersectionRatio;if(t!==s){if(!g)return a();t?a(!1,t):n=setTimeout((()=>{a(!1,1e-7)}),1e3)}g=!1}try{r=new IntersectionObserver(h,{...p,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(h,p)}r.observe(e)}(!0),i}(u,n):null;let f,p=-1,g=null;a&&(g=new ResizeObserver((e=>{let[r]=e;r&&r.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=g)||e.observe(t)}))),n()})),u&&!s&&g.observe(u),g.observe(t));let h=s?Ie(e):null;return s&&function t(){const r=Ie(e);!h||r.x===h.x&&r.y===h.y&&r.width===h.width&&r.height===h.height||n(),h=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=g)||e.disconnect(),g=null,s&&cancelAnimationFrame(f)}}const Fe=K,Be=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:l}=t,s=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=L(n),l=j(n),s="y"===U(n),u=["left","top"].includes(a)?-1:1,c=i&&s?-1:1,d=P(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:g}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&"number"==typeof g&&(p="end"===l?-1*g:g),s?{x:p*c,y:f*u}:{x:f*u,y:p*c}}(t,e);return a===(null==(n=l.offset)?void 0:n.placement)&&null!=(r=l.arrow)&&r.alignmentOffset?{}:{x:o+s.x,y:i+s.y,data:{...s,placement:a}}}}},Ue=function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,r,o;const{rects:i,middlewareData:a,placement:l,platform:s,elements:u}=t,{crossAxis:c=!1,alignment:d,allowedPlacements:f=R,autoAlignment:p=!0,...g}=P(e,t),h=void 0!==d||f===R?function(e,t,n){return(e?[...n.filter((t=>j(t)===e)),...n.filter((t=>j(t)!==e))]:n.filter((e=>L(e)===e))).filter((n=>!e||j(n)===e||!!t&&z(n)!==n))}(d||null,p,f):f,m=await K(t,g),v=(null==(n=a.autoPlacement)?void 0:n.index)||0,y=h[v];if(null==y)return{};const b=H(y,i,await(null==s.isRTL?void 0:s.isRTL(u.floating)));if(l!==y)return{reset:{placement:h[0]}};const w=[m[L(y)],m[b[0]],m[b[1]]],S=[...(null==(r=a.autoPlacement)?void 0:r.overflows)||[],{placement:y,overflows:w}],E=h[v+1];if(E)return{data:{index:v+1,overflows:S},reset:{placement:E}};const _=S.map((e=>{const t=j(e.placement);return[e.placement,t&&c?e.overflows.slice(0,2).reduce(((e,t)=>e+t),0):e.overflows[0],e.overflows]})).sort(((e,t)=>e[1]-t[1])),T=(null==(o=_.filter((e=>e[2].slice(0,j(e[0])?2:3).every((e=>e<=0))))[0])?void 0:o[0])||_[0][0];return T!==l?{data:{index:v+1,overflows:S},reset:{placement:T}}:{}}}},$e=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=P(e,t),u={x:n,y:r},c=await K(t,s),d=U(L(o)),f=F(d);let p=u[f],g=u[d];if(i){const e="y"===f?"bottom":"right";p=N(p+c["y"===f?"top":"left"],p,p-c[e])}if(a){const e="y"===d?"bottom":"right";g=N(g+c["y"===d?"top":"left"],g,g-c[e])}const h=l.fn({...t,[f]:p,[d]:g});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:i,[d]:a}}}}}},He=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:l,platform:s,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:h=!0,...m}=P(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=L(o),y=U(l),b=L(l)===l,w=await(null==s.isRTL?void 0:s.isRTL(u.floating)),S=f||(b||!h?[G(l)]:function(e){const t=G(e);return[z(e),t,z(t)]}(l)),E="none"!==g;!f&&E&&S.push(...function(e,t,n,r){const o=j(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:a;default:return[]}}(L(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(z)))),i}(l,h,g,w));const _=[l,...S],T=await K(t,m),A=[];let C=(null==(r=i.flip)?void 0:r.overflows)||[];if(c&&A.push(T[v]),d){const e=H(o,a,w);A.push(T[e[0]],T[e[1]])}if(C=[...C,{placement:o,overflows:A}],!A.every((e=>e<=0))){var x,I;const e=((null==(x=i.flip)?void 0:x.index)||0)+1,t=_[e];if(t)return{data:{index:e,overflows:C},reset:{placement:t}};let n=null==(I=C.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:I.placement;if(!n)switch(p){case"bestFit":{var R;const e=null==(R=C.filter((e=>{if(E){const t=U(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:R[0];e&&(n=e);break}case"initialPlacement":n=l}if(o!==n)return{reset:{placement:n}}}return{}}}},ze=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:l}=t,{apply:s=()=>{},...u}=P(e,t),c=await K(t,u),d=L(o),f=j(o),p="y"===U(o),{width:g,height:h}=i.floating;let m,v;"top"===d||"bottom"===d?(m=d,v=f===(await(null==a.isRTL?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(v=d,m="end"===f?"top":"bottom");const y=h-c.top-c.bottom,b=g-c.left-c.right,w=O(h-c[m],y),S=O(g-c[v],b),E=!t.middlewareData.shift;let _=w,T=S;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(T=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(_=y),E&&!f){const e=M(c.left,0),t=M(c.right,0),n=M(c.top,0),r=M(c.bottom,0);p?T=g-2*(0!==e||0!==t?e+t:M(c.left,c.right)):_=h-2*(0!==n||0!==r?n+r:M(c.top,c.bottom))}await s({...t,availableWidth:T,availableHeight:_});const A=await a.getDimensions(l.floating);return g!==A.width||h!==A.height?{reset:{rects:!0}}:{}}}},Ge=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=P(e,t);switch(r){case"referenceHidden":{const e=q(await K(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Q(e)}}}case"escaped":{const e=q(await K(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Q(e)}}}default:return{}}}}},Ve=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:l,middlewareData:s}=t,{element:u,padding:c=0}=P(e,t)||{};if(null==u)return{};const d=V(c),f={x:n,y:r},p=$(o),g=B(p),h=await a.getDimensions(u),m="y"===p,v=m?"top":"left",y=m?"bottom":"right",b=m?"clientHeight":"clientWidth",w=i.reference[g]+i.reference[p]-f[p]-i.floating[g],S=f[p]-i.reference[p],E=await(null==a.getOffsetParent?void 0:a.getOffsetParent(u));let _=E?E[b]:0;_&&await(null==a.isElement?void 0:a.isElement(E))||(_=l.floating[b]||i.floating[g]);const T=w/2-S/2,A=_/2-h[g]/2-1,C=O(d[v],A),x=O(d[y],A),I=C,R=_-h[g]-x,M=_/2-h[g]/2+T,k=N(I,M,R),D=!s.arrow&&null!=j(o)&&M!==k&&i.reference[g]/2-(Me.y-t.y)),n=[];let r=null;for(let e=0;er.height/2?n.push([o]):n[n.length-1].push(o),r=o}return n.map((e=>W(Z(e))))}(c),f=W(Z(c)),p=V(l),g=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===d.length&&d[0].left>d[1].right&&null!=s&&null!=u)return d.find((e=>s>e.left-p.left&&se.top-p.top&&u=2){if("y"===U(n)){const e=d[0],t=d[d.length-1],r="top"===L(n),o=e.top,i=t.bottom,a=r?e.left:t.left,l=r?e.right:t.right;return{top:o,bottom:i,left:a,right:l,width:l-a,height:i-o,x:a,y:o}}const e="left"===L(n),t=M(...d.map((e=>e.right))),r=O(...d.map((e=>e.left))),o=d.filter((n=>e?n.left===r:n.right===t)),i=o[0].top,a=o[o.length-1].bottom;return{top:i,bottom:a,left:r,right:t,width:t-r,height:a-i,x:r,y:i}}return f}},floating:r.floating,strategy:a});return o.reference.x!==g.reference.x||o.reference.y!==g.reference.y||o.reference.width!==g.reference.width||o.reference.height!==g.reference.height?{reset:{rects:g}}:{}}}},Ye=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:l=0,mainAxis:s=!0,crossAxis:u=!0}=P(e,t),c={x:n,y:r},d=U(o),f=F(d);let p=c[f],g=c[d];const h=P(l,t),m="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(s){const e="y"===f?"height":"width",t=i.reference[f]-i.floating[e]+m.mainAxis,n=i.reference[f]+i.reference[e]-m.mainAxis;pn&&(p=n)}if(u){var v,y;const e="y"===f?"width":"height",t=["top","left"].includes(L(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(v=a.offset)?void 0:v[d])||0)+(t?0:m.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(y=a.offset)?void 0:y[d])||0)-(t?m.crossAxis:0);gr&&(g=r)}return{[f]:p,[d]:g}}}},Ke=(e,t,n)=>{const r=new Map,o={platform:Le,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,l=i.filter(Boolean),s=await(null==a.isRTL?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=Y(u,r,s),f=r,p={},g=0;for(let n=0;n{t.current=e})),t}const tt=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?Ve({element:n.current,padding:r}).fn(t):{}:n?Ve({element:n,padding:r}).fn(t):{};var o}}),nt=(e,t)=>({...Be(e),options:[e,t]}),rt=(e,t)=>({...$e(e),options:[e,t]}),ot=(e,t)=>({...Ye(e),options:[e,t]}),it=(e,t)=>({...He(e),options:[e,t]}),at=(e,t)=>({...ze(e),options:[e,t]}),lt=(e,t)=>({...Ue(e),options:[e,t]}),st=(e,t)=>({...Ge(e),options:[e,t]}),ut=(e,t)=>({...We(e),options:[e,t]}),ct=(e,t)=>({...tt(e),options:[e,t]});var dt=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),ft="undefined"==typeof Element,pt=ft?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,gt=!ft&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},ht=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},mt=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var a=i.shift();if(!ht(a,!1))if("SLOT"===a.tagName){var l=a.assignedElements(),s=e(l.length?l:a.children,!0,r);r.flatten?o.push.apply(o,s):o.push({scopeParent:a,candidates:s})}else{pt.call(a,dt)&&r.filter(a)&&(n||!t.includes(a))&&o.push(a);var u=a.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(a),c=!ht(u,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(u&&c){var d=e(!0===u?a.children:u.children,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:a,candidates:d})}else i.unshift.apply(i,a.children)}}return o},vt=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},yt=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!vt(e)?0:e.tabIndex},bt=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},wt=function(e){return"INPUT"===e.tagName},St=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Et=function(e,t){return!(t.disabled||ht(t)||function(e){return wt(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=pt.call(e,"details>summary:first-of-type")?e.parentElement:e;if(pt.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return St(e)}else{if("function"==typeof r){for(var i=e;e;){var a=e.parentElement,l=gt(e);if(a&&!a.shadowRoot&&!0===r(a))return St(e);e=e.assignedSlot?e.assignedSlot:a||l===e.ownerDocument?a:l.host}e=i}if(function(e){var t,n,r,o,i=e&>(e),a=null===(t=i)||void 0===t?void 0:t.host,l=!1;if(i&&i!==e)for(l=!!(null!==(n=a)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(a)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!l&&a;){var s,u,c;l=!(null===(u=a=null===(s=i=gt(a))||void 0===s?void 0:s.host)||void 0===u||null===(c=u.ownerDocument)||void 0===c||!c.contains(a))}return l}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n=0)},At=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,a=i?t.scopeParent:t,l=function(e,t){var n=yt(e);return n<0&&t&&!vt(e)?0:n}(a,i),s=i?e(t.candidates):a;0===l?i?n.push.apply(n,s):n.push(a):r.push({documentOrder:o,tabIndex:l,item:t,isScope:i,content:s})})),r.sort(bt).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Ct=function(e,t){var n;return n=(t=t||{}).getShadowRoot?mt([e],t.includeContainer,{filter:_t.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Tt}):function(e,t,n){if(ht(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(dt));return t&&pt.call(e,dt)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,_t.bind(null,t)),At(n)};function xt(e){return r.useMemo((()=>e.every((e=>null==e))?null:t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}),e)}const It="ArrowUp",Rt="ArrowDown",Ot="ArrowLeft",Mt="ArrowRight";function kt(e,t,n){return Math.floor(e/t)!==n}function Dt(e,t){return t<0||t>=e.current.length}function Nt(e,t){return Lt(e,{disabledIndices:t})}function Pt(e,t){return Lt(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Lt(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:i=1}=void 0===t?{}:t;const a=e.current;let l=n;do{var s,u;l+=r?-i:i}while(l>=0&&l<=a.length-1&&(o?o.includes(l):null==a[l]||(null==(s=a[l])?void 0:s.hasAttribute("disabled"))||"true"===(null==(u=a[l])?void 0:u.getAttribute("aria-disabled"))));return l}function jt(e,t){let{event:n,orientation:r,loop:o,cols:a,disabledIndices:l,minIndex:s,maxIndex:u,prevIndex:c,stopEvent:d=!1}=t,f=c;if(n.key===It){if(d&&C(n),-1===c)f=u;else if(f=Lt(e,{startingIndex:f,amount:a,decrement:!0,disabledIndices:l}),o&&(c-ae?n:n-a}Dt(e,f)&&(f=c)}if(n.key===Rt&&(d&&C(n),-1===c?f=s:(f=Lt(e,{startingIndex:c,amount:a,disabledIndices:l}),o&&c+a>u&&(f=Lt(e,{startingIndex:c%a-a,amount:a,disabledIndices:l}))),Dt(e,f)&&(f=c)),"both"===r){const t=i(c/a);n.key===Mt&&(d&&C(n),c%a!=a-1?(f=Lt(e,{startingIndex:c,disabledIndices:l}),o&&kt(f,a,t)&&(f=Lt(e,{startingIndex:c-c%a-1,disabledIndices:l}))):o&&(f=Lt(e,{startingIndex:c-c%a-1,disabledIndices:l})),kt(f,a,t)&&(f=c)),n.key===Ot&&(d&&C(n),c%a!=0?(f=Lt(e,{startingIndex:c,disabledIndices:l,decrement:!0}),o&&kt(f,a,t)&&(f=Lt(e,{startingIndex:c+(a-c%a),decrement:!0,disabledIndices:l}))):o&&(f=Lt(e,{startingIndex:c+(a-c%a),decrement:!0,disabledIndices:l})),kt(f,a,t)&&(f=c));const r=i(u/a)===t;Dt(e,f)&&(f=o&&r?n.key===Ot?u:Lt(e,{startingIndex:c-c%a-1,disabledIndices:l}):c)}return f}let Ft=0;function Bt(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Ft);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():Ft=requestAnimationFrame(i)}var Ut="undefined"!=typeof document?r.useLayoutEffect:r.useEffect;function $t(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const Ht=r.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function zt(e){let{children:t,elementsRef:n,labelsRef:o}=e;const[i,a]=r.useState((()=>new Map)),l=r.useCallback((e=>{a((t=>new Map(t).set(e,null)))}),[]),s=r.useCallback((e=>{a((t=>{const n=new Map(t);return n.delete(e),n}))}),[]);return Ut((()=>{const e=new Map(i);Array.from(e.keys()).sort($t).forEach(((t,n)=>{e.set(t,n)})),function(e,t){if(e.size!==t.size)return!1;for(const[n,r]of e.entries())if(r!==t.get(n))return!1;return!0}(i,e)||a(e)}),[i]),r.createElement(Ht.Provider,{value:r.useMemo((()=>({register:l,unregister:s,map:i,elementsRef:n,labelsRef:o})),[l,s,i,n,o])},t)}function Gt(e){let{label:t}=void 0===e?{}:e;const[n,o]=r.useState(null),i=r.useRef(null),{register:a,unregister:l,map:s,elementsRef:u,labelsRef:c}=r.useContext(Ht),d=r.useCallback((e=>{if(i.current=e,null!==n&&(u.current[n]=e,c)){var r;const o=void 0!==t;c.current[n]=o?t:null!=(r=null==e?void 0:e.textContent)?r:null}}),[n,u,c,t]);return Ut((()=>{const e=i.current;if(e)return a(e),()=>{l(e)}}),[a,l]),Ut((()=>{const e=i.current?s.get(i.current):null;null!=e&&o(e)}),[s]),r.useMemo((()=>({ref:d,index:null==n?-1:n})),[n,d])}function Vt(e,t){return"function"==typeof e?e(t):e?r.cloneElement(e,t):r.createElement("div",t)}const Wt=r.createContext({activeIndex:0,setActiveIndex:()=>{}}),Yt=[Ot,Mt],Kt=[It,Rt],qt=[...Yt,...Kt],Qt=r.forwardRef((function(e,t){let{render:n,orientation:o="both",loop:i=!0,cols:a=1,disabledIndices:l,...s}=e;const[u,c]=r.useState(0),d=r.useRef([]),f=n&&"function"!=typeof n?n.props:{},p=r.useMemo((()=>({activeIndex:u,setActiveIndex:c})),[u]),g=a>1,h={...s,...f,ref:t,"aria-orientation":"both"===o?void 0:o,onKeyDown(e){null==s.onKeyDown||s.onKeyDown(e),null==f.onKeyDown||f.onKeyDown(e),function(e){if(!qt.includes(e.key))return;const t=Nt(d,l),n=Pt(d,l);let r=u;g&&(r=jt(d,{event:e,orientation:o,loop:i,cols:a,disabledIndices:l,minIndex:t,maxIndex:n,prevIndex:u}));const s={horizontal:[Mt],vertical:[Rt],both:[Mt,Rt]}[o],f={horizontal:[Ot],vertical:[It],both:[Ot,It]}[o],p=g?qt:{horizontal:Yt,vertical:Kt,both:qt}[o];r===u&&[...s,...f].includes(e.key)&&(r=i&&r===n&&s.includes(e.key)?t:i&&r===t&&f.includes(e.key)?n:Lt(d,{startingIndex:r,decrement:f.includes(e.key),disabledIndices:l})),r===u||Dt(d,r)||(e.stopPropagation(),p.includes(e.key)&&e.preventDefault(),c(r),queueMicrotask((()=>{Bt(d.current[r])})))}(e)}};return r.createElement(Wt.Provider,{value:p},r.createElement(zt,{elementsRef:d},Vt(n,h)))})),Zt=r.forwardRef((function(e,t){let{render:n,...o}=e;const i=n&&"function"!=typeof n?n.props:{},{activeIndex:a,setActiveIndex:l}=r.useContext(Wt),{ref:s,index:u}=Gt(),c=xt([s,t,i.ref]),d=a===u;return Vt(n,{...o,...i,ref:c,tabIndex:d?0:-1,"data-active":d?"":void 0,onFocus(e){null==o.onFocus||o.onFocus(e),null==i.onFocus||i.onFocus(e),l(u)}})}));function Xt(){return Xt=Object.assign?Object.assign.bind():function(e){for(var t=1;t"floating-ui-"+en++,nn=o["useId".toString()]||function(){const[e,t]=r.useState((()=>Jt?tn():void 0));return Ut((()=>{null==e&&t(tn())}),[]),r.useEffect((()=>{Jt||(Jt=!0)}),[]),e},rn=r.forwardRef((function(e,t){let{context:{placement:n,elements:{floating:o},middlewareData:{arrow:i}},width:a=14,height:l=7,tipRadius:s=0,strokeWidth:u=0,staticOffset:c,stroke:d,d:f,style:{transform:p,...g}={},...h}=e;const m=nn();if(!o)return null;u*=2;const v=u/2,y=a/2*(s/-8+1),b=l/2*s/4,[w,S]=n.split("-"),E=Le.isRTL(o),_=!!f,T="top"===w||"bottom"===w,A=c&&"end"===S?"bottom":"top";let C=c&&"end"===S?"right":"left";c&&E&&(C="end"===S?"left":"right");const x=null!=(null==i?void 0:i.x)?c||i.x:"",I=null!=(null==i?void 0:i.y)?c||i.y:"",R=f||"M0,0 H"+a+" L"+(a-y)+","+(l-b)+" Q"+a/2+","+l+" "+y+","+(l-b)+" Z",O={top:_?"rotate(180deg)":"",left:_?"rotate(90deg)":"rotate(-90deg)",bottom:_?"":"rotate(180deg)",right:_?"rotate(-90deg)":"rotate(90deg)"}[w];return r.createElement("svg",Xt({},h,{"aria-hidden":!0,ref:t,width:_?a:a+u,height:a,viewBox:"0 0 "+a+" "+(l>a?l:a),style:{position:"absolute",pointerEvents:"none",[C]:x,[A]:I,[w]:T||_?"100%":"calc(100% - "+u/2+"px)",transform:""+O+(null!=p?p:""),...g}}),u>0&&r.createElement("path",{clipPath:"url(#"+m+")",fill:"none",stroke:d,strokeWidth:u+(f?0:1),d:R}),r.createElement("path",{stroke:u&&!f?h.fill:"none",d:R}),r.createElement("clipPath",{id:m},r.createElement("rect",{x:-v,y:v*(_?-1:1),width:a+u,height:a})))}));function on(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}const an=r.createContext(null),ln=r.createContext(null),sn=()=>{var e;return(null==(e=r.useContext(an))?void 0:e.id)||null},un=()=>r.useContext(ln);function cn(e){const t=nn(),n=un(),r=sn(),o=e||r;return Ut((()=>{const e={id:t,parentId:o};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}}),[n,t,o]),t}function dn(e){let{children:t,id:n}=e;const o=sn();return r.createElement(an.Provider,{value:r.useMemo((()=>({id:n,parentId:o})),[n,o])},t)}function fn(e){let{children:t}=e;const n=r.useRef([]),o=r.useCallback((e=>{n.current=[...n.current,e]}),[]),i=r.useCallback((e=>{n.current=n.current.filter((t=>t!==e))}),[]),a=r.useState((()=>on()))[0];return r.createElement(ln.Provider,{value:r.useMemo((()=>({nodesRef:n,addNode:o,removeNode:i,events:a})),[n,o,i,a])},t)}function pn(e){return"data-floating-ui-"+e}function gn(e){const t=(0,r.useRef)(e);return Ut((()=>{t.current=e})),t}const hn=pn("safe-polygon");function mn(e,t,n){return n&&!w(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function vn(e,t){void 0===t&&(t={});const{open:n,onOpenChange:o,dataRef:i,events:a,elements:{domReference:l,floating:s},refs:c}=e,{enabled:d=!0,delay:f=0,handleClose:p=null,mouseOnly:h=!1,restMs:m=0,move:v=!0}=t,y=un(),b=sn(),E=gn(p),_=gn(f),T=r.useRef(),A=r.useRef(),C=r.useRef(),x=r.useRef(),I=r.useRef(!0),R=r.useRef(!1),O=r.useRef((()=>{})),M=r.useCallback((()=>{var e;const t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[i]);r.useEffect((()=>{if(d)return a.on("dismiss",e),()=>{a.off("dismiss",e)};function e(){clearTimeout(A.current),clearTimeout(x.current),I.current=!0}}),[d,a]),r.useEffect((()=>{if(!d||!E.current||!n)return;function e(e){M()&&o(!1,e)}const t=S(s).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[s,n,o,d,E,i,M]);const k=r.useCallback((function(e,t){void 0===t&&(t=!0);const n=mn(_.current,"close",T.current);n&&!C.current?(clearTimeout(A.current),A.current=setTimeout((()=>o(!1,e)),n)):t&&(clearTimeout(A.current),o(!1,e))}),[_,o]),D=r.useCallback((()=>{O.current(),C.current=void 0}),[]),N=r.useCallback((()=>{if(R.current){const e=S(c.floating.current).body;e.style.pointerEvents="",e.removeAttribute(hn),R.current=!1}}),[c]);return r.useEffect((()=>{if(d&&u(l)){const e=l;return n&&e.addEventListener("mouseleave",c),null==s||s.addEventListener("mouseleave",c),v&&e.addEventListener("mousemove",r,{once:!0}),e.addEventListener("mouseenter",r),e.addEventListener("mouseleave",a),()=>{n&&e.removeEventListener("mouseleave",c),null==s||s.removeEventListener("mouseleave",c),v&&e.removeEventListener("mousemove",r),e.removeEventListener("mouseenter",r),e.removeEventListener("mouseleave",a)}}function t(){return!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)}function r(e){if(clearTimeout(A.current),I.current=!1,h&&!w(T.current)||m>0&&0===mn(_.current,"open"))return;const t=mn(_.current,"open",T.current);t?A.current=setTimeout((()=>{o(!0,e)}),t):o(!0,e)}function a(r){if(t())return;O.current();const o=S(s);if(clearTimeout(x.current),E.current){n||clearTimeout(A.current),C.current=E.current({...e,tree:y,x:r.clientX,y:r.clientY,onClose(){N(),D(),k(r)}});const t=C.current;return o.addEventListener("mousemove",t),void(O.current=()=>{o.removeEventListener("mousemove",t)})}("touch"!==T.current||!g(s,r.relatedTarget))&&k(r)}function c(n){t()||null==E.current||E.current({...e,tree:y,x:n.clientX,y:n.clientY,onClose(){N(),D(),k(n)}})(n)}}),[l,s,d,e,h,m,v,k,D,N,o,n,y,_,E,i]),Ut((()=>{var e;if(d&&n&&null!=(e=E.current)&&e.__options.blockPointerEvents&&M()){const e=S(s).body;if(e.setAttribute(hn,""),e.style.pointerEvents="none",R.current=!0,u(l)&&s){var t,r;const e=l,n=null==y||null==(t=y.nodesRef.current.find((e=>e.id===b)))||null==(r=t.context)?void 0:r.elements.floating;return n&&(n.style.pointerEvents=""),e.style.pointerEvents="auto",s.style.pointerEvents="auto",()=>{e.style.pointerEvents="",s.style.pointerEvents=""}}}}),[d,n,b,s,l,y,E,i,M]),Ut((()=>{n||(T.current=void 0,D(),N())}),[n,D,N]),r.useEffect((()=>()=>{D(),clearTimeout(A.current),clearTimeout(x.current),N()}),[d,l,D,N]),r.useMemo((()=>{if(!d)return{};function e(e){T.current=e.pointerType}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove(e){n||0===m||(clearTimeout(x.current),x.current=setTimeout((()=>{I.current||o(!0,e.nativeEvent)}),m))}},floating:{onMouseEnter(){clearTimeout(A.current)},onMouseLeave(e){a.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),k(e.nativeEvent,!1)}}}}),[a,d,m,n,o,k])}const yn=r.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:()=>{},setState:()=>{},isInstantPhase:!1}),bn=()=>r.useContext(yn),wn=e=>{let{children:t,delay:n,timeoutMs:o=0}=e;const[i,a]=r.useReducer(((e,t)=>({...e,...t})),{delay:n,timeoutMs:o,initialDelay:n,currentId:null,isInstantPhase:!1}),l=r.useRef(null),s=r.useCallback((e=>{a({currentId:e})}),[]);return Ut((()=>{i.currentId?null===l.current?l.current=i.currentId:a({isInstantPhase:!0}):(a({isInstantPhase:!1}),l.current=null)}),[i.currentId]),r.createElement(yn.Provider,{value:r.useMemo((()=>({...i,setState:a,setCurrentId:s})),[i,a,s])},t)},Sn=(e,t)=>{let{open:n,onOpenChange:r}=e,{id:o}=t;const{currentId:i,setCurrentId:a,initialDelay:l,setState:s,timeoutMs:u}=bn();Ut((()=>{i&&(s({delay:{open:1,close:mn(l,"close")}}),i!==o&&r(!1))}),[o,r,s,i,l]),Ut((()=>{function e(){r(!1),s({delay:l,currentId:null})}if(!n&&i===o){if(u){const t=window.setTimeout(e,u);return()=>{clearTimeout(t)}}e()}}),[n,s,i,o,r,l,u]),Ut((()=>{n&&a(o)}),[n,a,o])};function En(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}let _n=new WeakMap,Tn=new WeakSet,An={},Cn=0;const xn=()=>"undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,In=e=>e&&(e.host||In(e.parentNode)),Rn=(e,t)=>t.map((t=>{if(e.contains(t))return t;const n=In(t);return e.contains(n)?n:null})).filter((e=>null!=e));function On(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=S(e[0]).body;return function(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,a=Rn(t,e),l=new Set,s=new Set(a),u=[];An[o]||(An[o]=new WeakMap);const c=An[o];return a.forEach((function e(t){t&&!l.has(t)&&(l.add(t),t.parentNode&&e(t.parentNode))})),function e(t){t&&!s.has(t)&&Array.prototype.forEach.call(t.children,(t=>{if(l.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=(_n.get(t)||0)+1,a=(c.get(t)||0)+1;_n.set(t,r),c.set(t,a),u.push(t),1===r&&n&&Tn.add(t),1===a&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"true")}}))}(t),l.clear(),Cn++,()=>{u.forEach((e=>{const t=(_n.get(e)||0)-1,n=(c.get(e)||0)-1;_n.set(e,t),c.set(e,n),t||(!Tn.has(e)&&i&&e.removeAttribute(i),Tn.delete(e)),n||e.removeAttribute(o)})),Cn--,Cn||(_n=new WeakMap,_n=new WeakMap,Tn=new WeakSet,An={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Mn=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function kn(e,t){const n=Ct(e,Mn());"prev"===t&&n.reverse();const r=n.indexOf(p(S(e)));return n.slice(r+1)[0]}function Dn(){return kn(document.body,"next")}function Nn(){return kn(document.body,"prev")}function Pn(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!g(n,r)}function Ln(e){Ct(e,Mn()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function jn(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const Fn={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Bn(e){"Tab"===e.key&&(e.target,clearTimeout(void 0))}const Un=r.forwardRef((function(e,t){const[n,o]=r.useState();Ut((()=>(b()&&o("button"),document.addEventListener("keydown",Bn),()=>{document.removeEventListener("keydown",Bn)})),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[pn("focus-guard")]:"",style:Fn};return r.createElement("span",Xt({},e,i))})),$n=r.createContext(null);function Hn(e){let{id:t,root:n}=void 0===e?{}:e;const[o,i]=r.useState(null),a=nn(),l=Gn(),s=r.useMemo((()=>({id:t,root:n,portalContext:l,uniqueId:a})),[t,n,l,a]),c=r.useRef();return Ut((()=>()=>{null==o||o.remove()}),[o,s]),Ut((()=>{if(c.current===s)return;c.current=s;const{id:e,root:t,portalContext:n,uniqueId:r}=s,o=e?document.getElementById(e):null,a=pn("portal");if(o){const e=document.createElement("div");e.id=r,e.setAttribute(a,""),o.appendChild(e),i(e)}else{let o=t||(null==n?void 0:n.portalNode);o&&!u(o)&&(o=o.current),o=o||document.body;let l=null;e&&(l=document.createElement("div"),l.id=e,o.appendChild(l));const s=document.createElement("div");s.id=r,s.setAttribute(a,""),o=l||o,o.appendChild(s),i(s)}}),[s]),o}function zn(e){let{children:t,id:n,root:o=null,preserveTabOrder:i=!0}=e;const a=Hn({id:n,root:o}),[l,s]=r.useState(null),u=r.useRef(null),c=r.useRef(null),d=r.useRef(null),f=r.useRef(null),p=!!l&&!l.modal&&l.open&&i&&!(!o&&!a);return r.useEffect((()=>{if(a&&i&&(null==l||!l.modal))return a.addEventListener("focusin",e,!0),a.addEventListener("focusout",e,!0),()=>{a.removeEventListener("focusin",e,!0),a.removeEventListener("focusout",e,!0)};function e(e){a&&Pn(e)&&("focusin"===e.type?jn:Ln)(a)}}),[a,i,null==l?void 0:l.modal]),r.createElement($n.Provider,{value:r.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:u,afterOutsideRef:c,beforeInsideRef:d,afterInsideRef:f,portalNode:a,setFocusManagerState:s})),[i,a])},p&&a&&r.createElement(Un,{"data-type":"outside",ref:u,onFocus:e=>{if(Pn(e,a)){var t;null==(t=d.current)||t.focus()}else{const e=Nn()||(null==l?void 0:l.refs.domReference.current);null==e||e.focus()}}}),p&&a&&r.createElement("span",{"aria-owns":a.id,style:Fn}),a&&(0,qe.createPortal)(t,a),p&&a&&r.createElement(Un,{"data-type":"outside",ref:c,onFocus:e=>{if(Pn(e,a)){var t;null==(t=f.current)||t.focus()}else{const t=Dn()||(null==l?void 0:l.refs.domReference.current);null==t||t.focus(),(null==l?void 0:l.closeOnFocusOut)&&(null==l||l.onOpenChange(!1,e.nativeEvent))}}}))}const Gn=()=>r.useContext($n),Vn=r.forwardRef((function(e,t){return r.createElement("button",Xt({},e,{type:"button",ref:t,tabIndex:-1,style:Fn}))}));function Wn(e){const{context:t,children:n,disabled:o=!1,order:i=["content"],guards:a=!0,initialFocus:l=0,returnFocus:s=!0,modal:u=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:f=!0}=e,{open:h,refs:m,nodeId:v,onOpenChange:y,events:b,dataRef:w,elements:{domReference:E,floating:T}}=t,x=!xn()||a,I=gn(i),R=gn(l),O=gn(s),M=un(),k=Gn(),D="number"==typeof l&&l<0,N=r.useRef(null),P=r.useRef(null),L=r.useRef(!1),j=r.useRef(null),F=r.useRef(!1),B=null!=k,U=E&&"combobox"===E.getAttribute("role")&&A(E)&&D,$=r.useCallback((function(e){return void 0===e&&(e=T),e?Ct(e,Mn()):[]}),[T]),H=r.useCallback((e=>{const t=$(e);return I.current.map((e=>E&&"reference"===e?E:T&&"floating"===e?T:t)).filter(Boolean).flat()}),[E,T,I,$]);function z(e){return!o&&d&&u?r.createElement(Vn,{ref:"start"===e?N:P,onClick:e=>y(!1,e.nativeEvent)},"string"==typeof d?d:"Dismiss"):null}r.useEffect((()=>{if(o||!u)return;function e(e){if("Tab"===e.key){g(T,p(S(T)))&&0===$().length&&!U&&C(e);const t=H(),n=_(e);"reference"===I.current[0]&&n===E&&(C(e),e.shiftKey?Bt(t[t.length-1]):Bt(t[1])),"floating"===I.current[1]&&n===T&&e.shiftKey&&(C(e),Bt(t[0]))}}const t=S(T);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[o,E,T,u,I,m,U,$,H]),r.useEffect((()=>{if(!o&&f)return T&&c(E)?(E.addEventListener("focusout",t),E.addEventListener("pointerdown",e),!u&&T.addEventListener("focusout",t),()=>{E.removeEventListener("focusout",t),E.removeEventListener("pointerdown",e),!u&&T.removeEventListener("focusout",t)}):void 0;function e(){F.current=!0,setTimeout((()=>{F.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(g(E,t)||g(T,t)||g(t,T)||g(null==k?void 0:k.portalNode,t)||null!=t&&t.hasAttribute(pn("focus-guard"))||M&&(En(M.nodesRef.current,v).find((e=>{var n,r;return g(null==(n=e.context)?void 0:n.elements.floating,t)||g(null==(r=e.context)?void 0:r.elements.domReference,t)}))||function(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(M.nodesRef.current,v).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));t&&n&&!F.current&&t!==j.current&&(L.current=!0,y(!1,e))}))}}),[o,E,T,u,v,M,k,y,f]),r.useEffect((()=>{var e;if(o)return;const t=Array.from((null==k||null==(e=k.portalNode)?void 0:e.querySelectorAll("["+pn("portal")+"]"))||[]);if(T){const e=[T,...t,N.current,P.current,I.current.includes("reference")||U?E:null].filter((e=>null!=e)),n=u?On(e,x,!x):On(e);return()=>{n()}}}),[o,E,T,u,I,k,U,x]),Ut((()=>{if(o||!T)return;const e=p(S(T));queueMicrotask((()=>{const t=H(T),n=R.current,r=("number"==typeof n?t[n]:n.current)||T,o=g(T,e);D||o||!h||Bt(r,{preventScroll:r===T})}))}),[o,h,T,D,H,R]),Ut((()=>{if(o||!T)return;let e=!1;const t=S(T),n=p(t),r=w.current;function i(t){if("escapeKey"===t.type&&m.domReference.current&&(j.current=m.domReference.current),["referencePress","escapeKey"].includes(t.type))return;const n=t.data.returnFocus;"object"==typeof n?(L.current=!1,e=n.preventScroll):L.current=!n}return j.current=n,b.on("dismiss",i),()=>{b.off("dismiss",i);const n=p(t);(g(T,n)||M&&En(M.nodesRef.current,v).some((e=>{var t;return g(null==(t=e.context)?void 0:t.elements.floating,n)}))||r.openEvent&&["click","mousedown"].includes(r.openEvent.type))&&m.domReference.current&&(j.current=m.domReference.current),O.current&&c(j.current)&&!L.current&&Bt(j.current,{cancelPrevious:!1,preventScroll:e})}}),[o,T,O,w,m,b,M,v]),Ut((()=>{if(!o&&k)return k.setFocusManagerState({modal:u,closeOnFocusOut:f,open:h,onOpenChange:y,refs:m}),()=>{k.setFocusManagerState(null)}}),[o,k,u,h,y,m,f]),Ut((()=>{if(!o&&T&&"function"==typeof MutationObserver&&!D){const e=()=>{const e=T.getAttribute("tabindex");I.current.includes("floating")||p(S(T))!==m.domReference.current&&0===$().length?"0"!==e&&T.setAttribute("tabindex","0"):"-1"!==e&&T.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(T,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}}),[o,T,m,I,$,D]);const G=!o&&x&&!U&&(B||u);return r.createElement(r.Fragment,null,G&&r.createElement(Un,{"data-type":"inside",ref:null==k?void 0:k.beforeInsideRef,onFocus:e=>{if(u){const e=H();Bt("reference"===i[0]?e[0]:e[e.length-1])}else if(null!=k&&k.preserveTabOrder&&k.portalNode)if(L.current=!1,Pn(e,k.portalNode)){const e=Dn()||E;null==e||e.focus()}else{var t;null==(t=k.beforeOutsideRef.current)||t.focus()}}}),!U&&z("start"),n,z("end"),G&&r.createElement(Un,{"data-type":"inside",ref:null==k?void 0:k.afterInsideRef,onFocus:e=>{if(u)Bt(H()[0]);else if(null!=k&&k.preserveTabOrder&&k.portalNode)if(f&&(L.current=!0),Pn(e,k.portalNode)){const e=Nn()||E;null==e||e.focus()}else{var t;null==(t=k.afterOutsideRef.current)||t.focus()}}}))}const Yn=new Set,Kn=r.forwardRef((function(e,t){let{lockScroll:n=!1,...o}=e;const i=nn();return Ut((()=>{if(!n)return;Yn.add(i);const e=/iP(hone|ad|od)|iOS/.test(h()),t=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth,a=t.left?parseFloat(t.left):window.pageXOffset,l=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",o&&(t[r]=o+"px"),e){var s,u;const e=(null==(s=window.visualViewport)?void 0:s.offsetLeft)||0,n=(null==(u=window.visualViewport)?void 0:u.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(l-Math.floor(n))+"px",left:-(a-Math.floor(e))+"px",right:"0"})}return()=>{Yn.delete(i),0===Yn.size&&(Object.assign(t,{overflow:"",[r]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(a,l)))}}),[i,n]),r.createElement("div",Xt({ref:t},o,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}}))}));function qn(e){return c(e.target)&&"BUTTON"===e.target.tagName}function Qn(e){return A(e)}function Zn(e,t){void 0===t&&(t={});const{open:n,onOpenChange:o,dataRef:i,elements:{domReference:a}}=e,{enabled:l=!0,event:s="click",toggle:u=!0,ignoreMouse:c=!1,keyboardHandlers:d=!0}=t,f=r.useRef(),p=r.useRef(!1);return r.useMemo((()=>l?{reference:{onPointerDown(e){f.current=e.pointerType},onMouseDown(e){0===e.button&&(w(f.current,!0)&&c||"click"!==s&&(!n||!u||i.current.openEvent&&"mousedown"!==i.current.openEvent.type?(e.preventDefault(),o(!0,e.nativeEvent)):o(!1,e.nativeEvent)))},onClick(e){"mousedown"===s&&f.current?f.current=void 0:w(f.current,!0)&&c||(!n||!u||i.current.openEvent&&"click"!==i.current.openEvent.type?o(!0,e.nativeEvent):o(!1,e.nativeEvent))},onKeyDown(e){f.current=void 0,e.defaultPrevented||!d||qn(e)||(" "!==e.key||Qn(a)||(e.preventDefault(),p.current=!0),"Enter"===e.key&&o(!n||!u,e.nativeEvent))},onKeyUp(e){e.defaultPrevented||!d||qn(e)||Qn(a)||" "===e.key&&p.current&&(p.current=!1,o(!n||!u,e.nativeEvent))}}}:{}),[l,i,s,c,d,a,u,n,o])}const Xn=o["useInsertionEffect".toString()]||(e=>e());function Jn(e){const t=r.useRef((()=>{}));return Xn((()=>{t.current=e})),r.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r{f.current||i.current.openEvent&&!er(i.current.openEvent)||o.setPositionReference(function(e,t){let n=null,r=null,o=!1;return{contextElement:e.current||void 0,getBoundingClientRect(){var i,a;const l=(null==(i=e.current)?void 0:i.getBoundingClientRect())||{width:0,height:0,x:0,y:0},s="x"===t.axis||"both"===t.axis,u="y"===t.axis||"both"===t.axis,c=["mouseenter","mousemove"].includes((null==(a=t.dataRef.current.openEvent)?void 0:a.type)||"")&&"touch"!==t.pointerType;let d=l.width,f=l.height,p=l.x,g=l.y;return null==n&&t.x&&s&&(n=l.x-t.x),null==r&&t.y&&u&&(r=l.y-t.y),p-=n||0,g-=r||0,d=0,f=0,!o||c?(d="y"===t.axis?l.width:0,f="x"===t.axis?l.height:0,p=s&&null!=t.x?t.x:p,g=u&&null!=t.y?t.y:g):o&&!c&&(f="x"===t.axis?l.height:f,d="y"===t.axis?l.width:d),o=!0,{width:d,height:f,x:p,y:g,top:g,right:p+d,bottom:g+f,left:p}}}}(o.domReference,{x:e,y:t,axis:u,dataRef:i,pointerType:h}))})),S=Jn((e=>{null==c&&null==d&&(n?p.current||y([]):b(e.clientX,e.clientY))})),E=w(h)?a:n,T=r.useCallback((()=>{if(!E||!s||null!=c||null!=d)return;const e=l(o.floating.current);function t(n){const r=_(n);g(o.floating.current,r)?(e.removeEventListener("mousemove",t),p.current=null):b(n.clientX,n.clientY)}if(!i.current.openEvent||er(i.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),p.current=null};return p.current=n,n}o.setPositionReference(o.domReference.current)}),[i,s,E,o,b,c,d]);return r.useEffect((()=>T()),[T,v]),r.useEffect((()=>{s&&!a&&(f.current=!1)}),[s,a]),r.useEffect((()=>{!s&&n&&(f.current=!0)}),[s,n]),Ut((()=>{!s||null==c&&null==d||(f.current=!1,b(c,d))}),[s,c,d,b]),r.useMemo((()=>{if(!s)return{};function e(e){let{pointerType:t}=e;m(t)}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove:S,onMouseEnter:S}}}),[s,S])}const nr={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},rr={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},or=e=>{var t,n;return{escapeKeyBubbles:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePressBubbles:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function ir(e,t){void 0===t&&(t={});const{open:n,onOpenChange:o,events:i,nodeId:s,elements:{reference:d,domReference:p,floating:h},dataRef:m}=e,{enabled:b=!0,escapeKey:w=!0,outsidePress:T=!0,outsidePressEvent:A="pointerdown",referencePress:C=!1,referencePressEvent:x="pointerdown",ancestorScroll:I=!1,bubbles:R}=t,O=un(),M=null!=sn(),k=Jn("function"==typeof T?T:()=>!1),D="function"==typeof T?k:T,N=r.useRef(!1),{escapeKeyBubbles:P,outsidePressBubbles:L}=or(R),j=Jn((e=>{if(!n||!b||!w||"Escape"!==e.key)return;const t=O?En(O.nodesRef.current,s):[];if(!P&&(e.stopPropagation(),t.length>0)){let e=!0;if(t.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e)})),F=Jn((e=>{const t=N.current;if(N.current=!1,t)return;if("function"==typeof D&&!D(e))return;const n=_(e),r="["+pn("inert")+"]",d=S(h).querySelectorAll(r);let m=u(n)?n:null;for(;m&&!["html","body","#document"].includes(a(m));){const e=f(m);if(e===S(h).body||!u(e))break;m=e}var b;if(d.length&&u(n)&&!n.matches("html,body")&&!g(n,h)&&Array.from(d).every((e=>!g(m,e))))return;if(c(n)&&h){const t=n.clientWidth>0&&n.scrollWidth>n.clientWidth,r=n.clientHeight>0&&n.scrollHeight>n.clientHeight;let o=r&&e.offsetX>n.clientWidth;if(r&&"rtl"===(b=n,l(b).getComputedStyle(b)).direction&&(o=e.offsetX<=n.offsetWidth-n.clientWidth),o||t&&e.offsetY>n.clientHeight)return}const w=O&&En(O.nodesRef.current,s).some((t=>{var n;return E(e,null==(n=t.context)?void 0:n.elements.floating)}));if(E(e,h)||E(e,p)||w)return;const T=O?En(O.nodesRef.current,s):[];if(T.length>0){let e=!0;if(T.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:M?{preventScroll:!0}:v(e)||y(e)}}),o(!1,e)}));return r.useEffect((()=>{if(!n||!b)return;function e(e){o(!1,e)}m.current.__escapeKeyBubbles=P,m.current.__outsidePressBubbles=L;const t=S(h);w&&t.addEventListener("keydown",j),D&&t.addEventListener(A,F);let r=[];return I&&(u(p)&&(r=Se(p)),u(h)&&(r=r.concat(Se(h))),!u(d)&&d&&d.contextElement&&(r=r.concat(Se(d.contextElement)))),r=r.filter((e=>{var n;return e!==(null==(n=t.defaultView)?void 0:n.visualViewport)})),r.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{w&&t.removeEventListener("keydown",j),D&&t.removeEventListener(A,F),r.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[m,h,p,d,w,D,A,n,o,I,b,P,L,j,F]),r.useEffect((()=>{N.current=!1}),[D,A]),r.useMemo((()=>b?{reference:{onKeyDown:j,[nr[x]]:e=>{C&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),o(!1,e.nativeEvent))}},floating:{onKeyDown:j,[rr[A]]:()=>{N.current=!0}}}:{}),[b,i,C,A,x,o,j])}function ar(e){var t;void 0===e&&(e={});const{open:n=!1,onOpenChange:o,nodeId:i}=e,[a,l]=r.useState(null),s=(null==(t=e.elements)?void 0:t.reference)||a,c=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:a,floating:l}={},transform:s=!0,whileElementsMounted:u,open:c}=e,[d,f]=r.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,g]=r.useState(o);Ze(p,o)||g(o);const[h,m]=r.useState(null),[v,y]=r.useState(null),b=r.useCallback((e=>{e!==_.current&&(_.current=e,m(e))}),[]),w=r.useCallback((e=>{e!==T.current&&(T.current=e,y(e))}),[]),S=a||h,E=l||v,_=r.useRef(null),T=r.useRef(null),A=r.useRef(d),C=null!=u,x=et(u),I=et(i),R=et(c),O=r.useCallback((()=>{if(!_.current||!T.current)return;const e={placement:t,strategy:n,middleware:p};I.current&&(e.platform=I.current),Ke(_.current,T.current,e).then((e=>{const t={...e,isPositioned:!1!==R.current};M.current&&!Ze(A.current,t)&&(A.current=t,qe.flushSync((()=>{f(t)})))}))}),[p,t,n,I,R]);Qe((()=>{!1===c&&A.current.isPositioned&&(A.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[c]);const M=r.useRef(!1);Qe((()=>(M.current=!0,()=>{M.current=!1})),[]),Qe((()=>{if(S&&(_.current=S),E&&(T.current=E),S&&E){if(x.current)return x.current(S,E,O);O()}}),[S,E,O,x,C]);const k=r.useMemo((()=>({reference:_,floating:T,setReference:b,setFloating:w})),[b,w]),D=r.useMemo((()=>({reference:S,floating:E})),[S,E]),N=r.useMemo((()=>{const e={position:n,left:0,top:0};if(!D.floating)return e;const t=Je(D.floating,d.x),r=Je(D.floating,d.y);return s?{...e,transform:"translate("+t+"px, "+r+"px)",...Xe(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,s,D.floating,d.x,d.y]);return r.useMemo((()=>({...d,update:O,refs:k,elements:D,floatingStyles:N})),[d,O,k,D,N])}(e),d=un(),f=Jn(((e,t)=>{e&&(g.current.openEvent=t),null==o||o(e,t)})),p=r.useRef(null),g=r.useRef({}),h=r.useState((()=>on()))[0],m=nn(),v=r.useCallback((e=>{const t=u(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;c.refs.setReference(t)}),[c.refs]),y=r.useCallback((e=>{(u(e)||null===e)&&(p.current=e,l(e)),(u(c.refs.reference.current)||null===c.refs.reference.current||null!==e&&!u(e))&&c.refs.setReference(e)}),[c.refs]),b=r.useMemo((()=>({...c.refs,setReference:y,setPositionReference:v,domReference:p})),[c.refs,y,v]),w=r.useMemo((()=>({...c.elements,domReference:s})),[c.elements,s]),S=r.useMemo((()=>({...c,refs:b,elements:w,dataRef:g,nodeId:i,floatingId:m,events:h,open:n,onOpenChange:f})),[c,i,m,h,n,f,b,w]);return Ut((()=>{const e=null==d?void 0:d.nodesRef.current.find((e=>e.id===i));e&&(e.context=S)})),r.useMemo((()=>({...c,context:S,refs:b,elements:w})),[c,b,w,S])}function lr(e,t){void 0===t&&(t={});const{open:n,onOpenChange:o,dataRef:i,events:a,refs:l,elements:{floating:s,domReference:d}}=e,{enabled:f=!0,keyboardOnly:h=!0}=t,m=r.useRef(""),v=r.useRef(!1),y=r.useRef();return r.useEffect((()=>{if(!f)return;const e=S(s).defaultView||window;function t(){!n&&c(d)&&d===p(S(d))&&(v.current=!0)}return e.addEventListener("blur",t),()=>{e.removeEventListener("blur",t)}}),[s,d,n,f]),r.useEffect((()=>{if(f)return a.on("dismiss",e),()=>{a.off("dismiss",e)};function e(e){"referencePress"!==e.type&&"escapeKey"!==e.type||(v.current=!0)}}),[a,f]),r.useEffect((()=>()=>{clearTimeout(y.current)}),[]),r.useMemo((()=>f?{reference:{onPointerDown(e){let{pointerType:t}=e;m.current=t,v.current=!(!t||!h)},onMouseLeave(){v.current=!1},onFocus(e){var t;v.current||"focus"===e.type&&"mousedown"===(null==(t=i.current.openEvent)?void 0:t.type)&&E(i.current.openEvent,d)||o(!0,e.nativeEvent)},onBlur(e){v.current=!1;const t=e.relatedTarget,n=u(t)&&t.hasAttribute(pn("focus-guard"))&&"outside"===t.getAttribute("data-type");y.current=setTimeout((()=>{g(l.floating.current,t)||g(d,t)||n||o(!1,e.nativeEvent)}))}}}:{}),[f,h,d,l,i,o])}function sr(e,t,n){const r=new Map;return{..."floating"===n&&{tabIndex:-1},...e,...t.map((e=>e?e[n]:null)).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,o]=t;var i;0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof o&&(null==(i=r.get(n))||i.push(o),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;ie(...o))).find((e=>void 0!==e))})):e[n]=o})),e):e),{})}}function ur(e){void 0===e&&(e=[]);const t=e,n=r.useCallback((t=>sr(t,e,"reference")),t),o=r.useCallback((t=>sr(t,e,"floating")),t),i=r.useCallback((t=>sr(t,e,"item")),e.map((e=>null==e?void 0:e.item)));return r.useMemo((()=>({getReferenceProps:n,getFloatingProps:o,getItemProps:i})),[n,o,i])}let cr=!1;function dr(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function fr(e,t){return dr(t,e===It||e===Rt,e===Ot||e===Mt)}function pr(e,t,n){return dr(t,e===Rt,n?e===Ot:e===Mt)||"Enter"===e||" "==e||""===e}function gr(e,t,n){return dr(t,n?e===Mt:e===Ot,e===It)}function hr(e,t){const{open:n,onOpenChange:o,refs:i,elements:{domReference:a,floating:l}}=e,{listRef:s,activeIndex:u,onNavigate:d=()=>{},enabled:f=!0,selectedIndex:m=null,allowEscape:w=!1,loop:E=!1,nested:_=!1,rtl:T=!1,virtual:A=!1,focusItemOnOpen:x="auto",focusItemOnHover:I=!0,openOnArrowKeyDown:R=!0,disabledIndices:O,orientation:M="vertical",cols:k=1,scrollItemIntoView:D=!0,virtualItemRef:N}=t,P=sn(),L=un(),j=Jn(d),F=r.useRef(x),B=r.useRef(null!=m?m:-1),U=r.useRef(null),$=r.useRef(!0),H=r.useRef(j),z=r.useRef(!!l),G=r.useRef(!1),V=r.useRef(!1),W=gn(O),Y=gn(n),K=gn(D),[q,Q]=r.useState(),[Z,X]=r.useState(),J=Jn((function(e,t,n){void 0===n&&(n=!1);const r=e.current[t.current];r&&(A?(Q(r.id),null==L||L.events.emit("virtualfocus",r),N&&(N.current=r)):Bt(r,{preventScroll:!0,sync:!(!h().toLowerCase().startsWith("mac")||navigator.maxTouchPoints||!b())&&(cr||G.current)}),requestAnimationFrame((()=>{const e=K.current;e&&r&&(n||!$.current)&&(null==r.scrollIntoView||r.scrollIntoView("boolean"==typeof e?{block:"nearest",inline:"nearest"}:e))})))}));Ut((()=>{document.createElement("div").focus({get preventScroll(){return cr=!0,!1}})}),[]),Ut((()=>{f&&(n&&l?F.current&&null!=m&&(V.current=!0,j(m)):z.current&&(B.current=-1,H.current(null)))}),[f,n,l,m,j]),Ut((()=>{if(f&&n&&l)if(null==u){if(G.current=!1,null!=m)return;if(z.current&&(B.current=-1,J(s,B)),!z.current&&F.current&&(null!=U.current||!0===F.current&&null==U.current)){let e=0;const t=()=>{null==s.current[0]?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e++):(B.current=null==U.current||pr(U.current,M,T)||_?Nt(s,W.current):Pt(s,W.current),U.current=null,j(B.current))};t()}}else Dt(s,u)||(B.current=u,J(s,B,V.current),V.current=!1)}),[f,n,l,u,m,_,s,M,T,j,J,W]),Ut((()=>{var e,t;if(!f||l||!L||A||!z.current)return;const n=L.nodesRef.current,r=null==(e=n.find((e=>e.id===P)))||null==(t=e.context)?void 0:t.elements.floating,o=p(S(l)),i=n.some((e=>e.context&&g(e.context.elements.floating,o)));r&&!i&&$.current&&r.focus({preventScroll:!0})}),[f,l,L,P,A]),Ut((()=>{if(f&&L&&A&&!P)return L.events.on("virtualfocus",e),()=>{L.events.off("virtualfocus",e)};function e(e){X(e.id),N&&(N.current=e)}}),[f,L,A,P,N]),Ut((()=>{H.current=j,z.current=!!l})),Ut((()=>{n||(U.current=null)}),[n]);const ee=null!=u,te=r.useMemo((()=>{function e(e){if(!n)return;const t=s.current.indexOf(e);-1!==t&&j(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...I&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;$.current&&"touch"!==t&&(B.current=-1,J(s,B),j(null),A||Bt(i.floating.current,{preventScroll:!0}))}}}}),[n,i,J,I,s,j,A]);return r.useMemo((()=>{if(!f)return{};const e=W.current;function t(t){if($.current=!1,G.current=!0,!Y.current&&t.currentTarget===i.floating.current)return;if(_&&gr(t.key,M,T))return C(t),o(!1,t.nativeEvent),void(c(a)&&!A&&a.focus());const r=B.current,l=Nt(s,e),u=Pt(s,e);if("Home"===t.key&&(C(t),B.current=l,j(B.current)),"End"===t.key&&(C(t),B.current=u,j(B.current)),!(k>1&&(B.current=jt(s,{event:t,orientation:M,loop:E,cols:k,disabledIndices:e,minIndex:l,maxIndex:u,prevIndex:B.current,stopEvent:!0}),j(B.current),"both"===M))&&fr(t.key,M)){if(C(t),n&&!A&&p(t.currentTarget.ownerDocument)===t.currentTarget)return B.current=pr(t.key,M,T)?l:u,void j(B.current);pr(t.key,M,T)?B.current=E?r>=u?w&&r!==s.current.length?-1:l:Lt(s,{startingIndex:r,disabledIndices:e}):Math.min(u,Lt(s,{startingIndex:r,disabledIndices:e})):B.current=E?r<=l?w&&-1!==r?s.current.length:u:Lt(s,{startingIndex:r,decrement:!0,disabledIndices:e}):Math.max(l,Lt(s,{startingIndex:r,decrement:!0,disabledIndices:e})),Dt(s,B.current)?j(null):j(B.current)}}function r(e){"auto"===x&&v(e.nativeEvent)&&(F.current=!0)}const l=A&&n&&ee&&{"aria-activedescendant":Z||q},u=s.current.find((e=>(null==e?void 0:e.id)===q));return{reference:{...l,onKeyDown(r){$.current=!1;const i=0===r.key.indexOf("Arrow"),a=function(e,t,n){return dr(t,n?e===Ot:e===Mt,e===Rt)}(r.key,M,T),l=gr(r.key,M,T),c=fr(r.key,M),d=(_?a:c)||"Enter"===r.key||""===r.key.trim();if(A&&n){const e=null==L?void 0:L.nodesRef.current.find((e=>null==e.parentId)),n=L&&e?function(e,t){let n,r=-1;return function t(o,i){i>r&&(n=o,r=i),En(e,o).forEach((e=>{t(e.id,i+1)}))}(t,0),e.find((e=>e.id===n))}(L.nodesRef.current,e.id):null;if(i&&n&&N){const e=new KeyboardEvent("keydown",{key:r.key,bubbles:!0});if(a||l){var f,p;const t=(null==(f=n.context)?void 0:f.elements.domReference)===r.currentTarget,o=l&&!t?null==(p=n.context)?void 0:p.elements.domReference:a?u:null;o&&(C(r),o.dispatchEvent(e),X(void 0))}var g;if(c&&n.context&&n.context.open&&n.parentId&&r.currentTarget!==n.context.elements.domReference)return C(r),void(null==(g=n.context.elements.domReference)||g.dispatchEvent(e))}return t(r)}(n||R||!i)&&(d&&(U.current=_&&c?null:r.key),_?a&&(C(r),n?(B.current=Nt(s,e),j(B.current)):o(!0,r.nativeEvent)):c&&(null!=m&&(B.current=m),C(r),!n&&R?o(!0,r.nativeEvent):t(r),n&&j(B.current)))},onFocus(){n&&j(null)},onPointerDown:function(e){F.current=x,"auto"===x&&y(e.nativeEvent)&&(F.current=!0)},onMouseDown:r,onClick:r},floating:{"aria-orientation":"both"===M?void 0:M,...l,onKeyDown:t,onPointerMove(){$.current=!0}},item:te}}),[a,i,q,Z,W,Y,s,f,M,T,A,n,ee,_,m,R,w,k,E,x,j,o,te,L,N])}function mr(e,t){void 0===t&&(t={});const{open:n,floatingId:o}=e,{enabled:i=!0,role:a="dialog"}=t,l=nn();return r.useMemo((()=>{const e={id:o,role:a};return i?"tooltip"===a?{reference:{"aria-describedby":n?o:void 0},floating:e}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":"alertdialog"===a?"dialog":a,"aria-controls":n?o:void 0,..."listbox"===a&&{role:"combobox"},..."menu"===a&&{id:l}},floating:{...e,..."menu"===a&&{"aria-labelledby":l}}}:{}}),[i,a,n,o,l])}const vr=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function yr(e,t){return"function"==typeof e?e(t):e}function br(e,t){void 0===t&&(t={});const{open:n,elements:{floating:o}}=e,{duration:i=250}=t,a=("number"==typeof i?i:i.close)||0,[l,s]=r.useState(!1),[u,c]=r.useState("unmounted"),d=function(e,t){const[n,o]=r.useState(e);return e&&!n&&o(!0),r.useEffect((()=>{if(!e){const e=setTimeout((()=>o(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,a);return Ut((()=>{l&&!d&&c("unmounted")}),[l,d]),Ut((()=>{if(o){if(n){c("initial");const e=requestAnimationFrame((()=>{c("open")}));return()=>{cancelAnimationFrame(e)}}s(!0),c("close")}}),[n,o]),{isMounted:d,status:u}}function wr(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:o,close:i,common:a,duration:l=250}=t,s=e.placement,u=s.split("-")[0],c=r.useMemo((()=>({side:u,placement:s})),[u,s]),d="number"==typeof l,f=(d?l:l.open)||0,p=(d?l:l.close)||0,[g,h]=r.useState((()=>({...yr(a,c),...yr(n,c)}))),{isMounted:m,status:v}=br(e,{duration:l}),y=gn(n),b=gn(o),w=gn(i),S=gn(a);return Ut((()=>{const e=yr(y.current,c),t=yr(w.current,c),n=yr(S.current,c),r=yr(b.current,c)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===v&&h((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===v&&h({transitionProperty:Object.keys(r).map(vr).join(","),transitionDuration:f+"ms",...n,...r}),"close"===v){const r=t||e;h({transitionProperty:Object.keys(r).map(vr).join(","),transitionDuration:p+"ms",...n,...r})}}),[p,w,y,b,S,f,v,c]),{isMounted:m,styles:g}}function Sr(e,t){var n;const{open:o,dataRef:i}=e,{listRef:a,activeIndex:l,onMatch:s,onTypingChange:u,enabled:c=!0,findMatch:d=null,resetMs:f=750,ignoreKeys:p=[],selectedIndex:g=null}=t,h=r.useRef(),m=r.useRef(""),v=r.useRef(null!=(n=null!=g?g:l)?n:-1),y=r.useRef(null),b=Jn(s),w=Jn(u),S=gn(d),E=gn(p);return Ut((()=>{o&&(clearTimeout(h.current),y.current=null,m.current="")}),[o]),Ut((()=>{var e;o&&""===m.current&&(v.current=null!=(e=null!=g?g:l)?e:-1)}),[o,g,l]),r.useMemo((()=>{if(!c)return{};function e(e){e?i.current.typing||(i.current.typing=e,w(e)):i.current.typing&&(i.current.typing=e,w(e))}function t(e,t,n){const r=S.current?S.current(t,n):t.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase()))));return r?e.indexOf(r):-1}function n(n){const r=a.current;if(m.current.length>0&&" "!==m.current[0]&&(-1===t(r,r,m.current)?e(!1):" "===n.key&&C(n)),null==r||E.current.includes(n.key)||1!==n.key.length||n.ctrlKey||n.metaKey||n.altKey)return;o&&" "!==n.key&&(C(n),e(!0)),r.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&m.current===n.key&&(m.current="",v.current=y.current),m.current+=n.key,clearTimeout(h.current),h.current=setTimeout((()=>{m.current="",v.current=y.current,e(!1)}),f);const i=v.current,l=t(r,[...r.slice((i||0)+1),...r.slice(0,(i||0)+1)],m.current);-1!==l?(b(l),y.current=l):" "!==n.key&&(m.current="",e(!1))}return{reference:{onKeyDown:n},floating:{onKeyDown:n,onKeyUp(t){" "===t.key&&e(!1)}}}}),[c,o,i,a,f,E,S,b,w])}function Er(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const _r=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:i=0,index:a=0,minItemsVisible:l=4,referenceOverflowThreshold:s=0,scrollRef:u,...c}=e,{rects:d,elements:{floating:f}}=t,p=n.current[a];if(!p)return{};const g={...t,...await nt(-p.offsetTop-f.clientTop-d.reference.height/2-p.offsetHeight/2-i).fn(t)},h=(null==u?void 0:u.current)||f,m=await Fe(Er(g,h.scrollHeight),c),v=await Fe(g,{...c,elementContext:"reference"}),y=Math.max(0,m.top),b=g.y+y,w=Math.max(0,h.scrollHeight-y-Math.max(0,m.bottom));return h.style.maxHeight=w+"px",h.scrollTop=y,o&&(h.offsetHeight=-s||v.bottom>=-s?(0,qe.flushSync)((()=>o(!0))):(0,qe.flushSync)((()=>o(!1)))),r&&(r.current=await Fe(Er({...g,y:b},h.offsetHeight),c)),{y:b}}});function Tr(e,t){const{open:n,elements:o}=e,{enabled:i=!0,overflowRef:a,scrollRef:l,onChange:s}=t,u=Jn(s),c=r.useRef(!1),d=r.useRef(null),f=r.useRef(null);return r.useEffect((()=>{if(!i)return;function e(e){if(e.ctrlKey||!t||null==a.current)return;const n=e.deltaY,r=a.current.top>=-.5,o=a.current.bottom>=-.5,i=t.scrollHeight-t.clientHeight,l=n<0?-1:1,s=n<0?"max":"min";t.scrollHeight<=t.clientHeight||(!r&&n>0||!o&&n<0?(e.preventDefault(),(0,qe.flushSync)((()=>{u((e=>e+Math[s](n,i*l)))}))):/firefox/i.test(m())&&(t.scrollTop+=n))}const t=(null==l?void 0:l.current)||o.floating;return n&&t?(t.addEventListener("wheel",e),requestAnimationFrame((()=>{d.current=t.scrollTop,null!=a.current&&(f.current={...a.current})})),()=>{d.current=null,f.current=null,t.removeEventListener("wheel",e)}):void 0}),[i,n,o.floating,a,l,u]),r.useMemo((()=>i?{floating:{onKeyDown(){c.current=!0},onWheel(){c.current=!1},onPointerMove(){c.current=!1},onScroll(){const e=(null==l?void 0:l.current)||o.floating;if(a.current&&e&&c.current){if(null!==d.current){const t=e.scrollTop-d.current;(a.current.bottom<-.5&&t<-1||a.current.top<-.5&&t>1)&&(0,qe.flushSync)((()=>u((e=>e+t))))}requestAnimationFrame((()=>{d.current=e.scrollTop}))}}}}:{}),[i,a,o.floating,l,u])}function Ar(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let e=0,a=i-1;e=r!=u>=r&&n<=(s-i)*(r-l)/(u-l)+i&&(o=!o)}return o}function Cr(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,i=!1,a=null,l=null,s=performance.now();const c=e=>{let{x:n,y:c,placement:d,elements:f,onClose:p,nodeId:h,tree:m}=e;return function(e){function v(){clearTimeout(o),p()}if(clearTimeout(o),!f.domReference||!f.floating||null==d||null==n||null==c)return;const{clientX:y,clientY:b}=e,w=[y,b],S=_(e),E="mouseleave"===e.type,T=g(f.floating,S),A=g(f.domReference,S),C=f.domReference.getBoundingClientRect(),x=f.floating.getBoundingClientRect(),I=d.split("-")[0],R=n>x.right-x.width/2,O=c>x.bottom-x.height/2,M=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(w,C),k=x.width>C.width,D=x.height>C.height,N=(k?C:x).left,P=(k?C:x).right,L=(D?C:x).top,j=(D?C:x).bottom;if(T&&(i=!0,!E))return;if(A&&(i=!1),A&&!E)return void(i=!0);if(E&&u(e.relatedTarget)&&g(f.floating,e.relatedTarget))return;if(m&&En(m.nodesRef.current,h).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===I&&c>=C.bottom-1||"bottom"===I&&c<=C.top+1||"left"===I&&n>=C.right-1||"right"===I&&n<=C.left+1)return v();let F=[];switch(I){case"top":F=[[N,C.top+1],[N,x.bottom-1],[P,x.bottom-1],[P,C.top+1]];break;case"bottom":F=[[N,x.top+1],[N,C.bottom-1],[P,C.bottom-1],[P,x.top+1]];break;case"left":F=[[x.right-1,j],[x.right-1,L],[C.left+1,L],[C.left+1,j]];break;case"right":F=[[C.right-1,j],[C.right-1,L],[x.left+1,L],[x.left+1,j]]}if(!Ar([y,b],F)){if(i&&!M)return v();if(!E&&r){const t=function(e,t){const n=performance.now(),r=n-s;if(null===a||null===l||0===r)return a=e,l=t,s=n,null;const o=e-a,i=t-l,u=Math.sqrt(o*o+i*i);return a=e,l=t,s=n,u/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return v()}Ar([y,b],function(e){let[n,r]=e;switch(I){case"top":return[[k?n+t/2:R?n+4*t:n-4*t,r+t+1],[k?n-t/2:R?n+4*t:n-4*t,r+t+1],[x.left,R||k?x.bottom-t:x.top],[x.right,R?k?x.bottom-t:x.top:x.bottom-t]];case"bottom":return[[k?n+t/2:R?n+4*t:n-4*t,r-t],[k?n-t/2:R?n+4*t:n-4*t,r-t],[x.left,R||k?x.top+t:x.bottom],[x.right,R?k?x.top+t:x.bottom:x.top+t]];case"left":{const e=[n+t+1,D?r+t/2:O?r+4*t:r-4*t],o=[n+t+1,D?r-t/2:O?r+4*t:r-4*t];return[[O||D?x.right-t:x.left,x.top],[O?D?x.right-t:x.left:x.right-t,x.bottom],e,o]}case"right":return[[n-t,D?r+t/2:O?r+4*t:r-4*t],[n-t,D?r-t/2:O?r+4*t:r-4*t],[O||D?x.left+t:x.right,x.top],[O?D?x.left+t:x.right:x.left+t,x.bottom]]}}([n,c]))?!i&&r&&(o=window.setTimeout(v,40)):v()}}};return c.__options={blockPointerEvents:n},c}},17965:(e,t,n)=>{"use strict";var r=n(16426),o={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var n,i,a,l,s,u,c=!1;t||(t={}),n=t.debug||!1;try{if(a=r(),l=document.createRange(),s=document.getSelection(),(u=document.createElement("span")).textContent=e,u.ariaHidden="true",u.style.all="unset",u.style.position="fixed",u.style.top=0,u.style.clip="rect(0, 0, 0, 0)",u.style.whiteSpace="pre",u.style.webkitUserSelect="text",u.style.MozUserSelect="text",u.style.msUserSelect="text",u.style.userSelect="text",u.addEventListener("copy",(function(r){if(r.stopPropagation(),t.format)if(r.preventDefault(),void 0===r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var i=o[t.format]||o.default;window.clipboardData.setData(i,e)}else r.clipboardData.clearData(),r.clipboardData.setData(t.format,e);t.onCopy&&(r.preventDefault(),t.onCopy(r.clipboardData))})),document.body.appendChild(u),l.selectNodeContents(u),s.addRange(l),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");c=!0}catch(r){n&&console.error("unable to copy using execCommand: ",r),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),c=!0}catch(r){n&&console.error("unable to copy using clipboardData: ",r),n&&console.error("falling back to prompt"),i=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(i,e)}}finally{s&&("function"==typeof s.removeRange?s.removeRange(l):s.removeAllRanges()),u&&document.body.removeChild(u),a()}return c}},67044:(e,t,n)=>{"use strict";function r(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}n.d(t,{A:()=>r})},70551:(e,t,n)=>{"use strict";function r(e,t){if(t.length1?"s":"")+" required, but only "+t.length+" present")}n.d(t,{A:()=>r})},51831:(e,t,n)=>{"use strict";n.d(t,{u:()=>i});var r={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},o="trunc";function i(e){return e?r[e]:r[o]}},94188:(e,t,n)=>{"use strict";function r(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}n.d(t,{A:()=>r})},93165:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var r=n(82284),o=n(92998),i=n(2118),a=n(10123),l=n(70551),s=n(94188);function u(e,t){if((0,l.A)(2,arguments),!t||"object"!==(0,r.A)(t))return new Date(NaN);var n=t.years?(0,s.A)(t.years):0,u=t.months?(0,s.A)(t.months):0,c=t.weeks?(0,s.A)(t.weeks):0,d=t.days?(0,s.A)(t.days):0,f=t.hours?(0,s.A)(t.hours):0,p=t.minutes?(0,s.A)(t.minutes):0,g=t.seconds?(0,s.A)(t.seconds):0,h=(0,a.A)(e),m=u||n?(0,i.A)(h,u+12*n):h,v=d||c?(0,o.A)(m,d+7*c):m,y=1e3*(g+60*(p+60*f));return new Date(v.getTime()+y)}},92998:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(94188),o=n(10123),i=n(70551);function a(e,t){(0,i.A)(2,arguments);var n=(0,o.A)(e),a=(0,r.A)(t);return isNaN(a)?new Date(NaN):a?(n.setDate(n.getDate()+a),n):n}},2118:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(94188),o=n(10123),i=n(70551);function a(e,t){(0,i.A)(2,arguments);var n=(0,o.A)(e),a=(0,r.A)(t);if(isNaN(a))return new Date(NaN);if(!a)return n;var l=n.getDate(),s=new Date(n.getTime());return s.setMonth(n.getMonth()+a+1,0),l>=s.getDate()?s:(n.setFullYear(s.getFullYear(),s.getMonth(),l),n)}},6982:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(10123),o=n(70551);function i(e,t){(0,o.A)(2,arguments);var n=(0,r.A)(e),i=(0,r.A)(t),a=n.getTime()-i.getTime();return a<0?-1:a>0?1:a}},57499:(e,t,n)=>{"use strict";n.d(t,{BM:()=>b,Cg:()=>a,GW:()=>i,Ki:()=>o,Mf:()=>y,Z7:()=>w,_m:()=>s,bF:()=>h,e8:()=>f,gs:()=>p,h:()=>r,hq:()=>v,l5:()=>c,pe:()=>m,rI:()=>d,s0:()=>l,tF:()=>g,uL:()=>u});var r=7,o=365.2425,i=24*Math.pow(10,8)*60*60*1e3,a=6e4,l=36e5,s=1e3,u=-i,c=60,d=3,f=12,p=4,g=3600,h=60,m=24*g,v=7*m,y=m*o,b=y/12,w=3*b},40063:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(67044),o=n(31127),i=n(70551),a=864e5;function l(e,t){(0,i.A)(2,arguments);var n=(0,o.A)(e),l=(0,o.A)(t),s=n.getTime()-(0,r.A)(n),u=l.getTime()-(0,r.A)(l);return Math.round((s-u)/a)}},60667:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(10123),o=n(70551);function i(e,t){(0,o.A)(2,arguments);var n=(0,r.A)(e),i=(0,r.A)(t);return 12*(n.getFullYear()-i.getFullYear())+(n.getMonth()-i.getMonth())}},82002:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(10123),o=n(70551);function i(e,t){(0,o.A)(2,arguments);var n=(0,r.A)(e),i=(0,r.A)(t);return n.getFullYear()-i.getFullYear()}},89045:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(10123),o=n(40063),i=n(70551);function a(e,t){var n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function l(e,t){(0,i.A)(2,arguments);var n=(0,r.A)(e),l=(0,r.A)(t),s=a(n,l),u=Math.abs((0,o.A)(n,l));n.setDate(n.getDate()-s*u);var c=s*(u-Number(a(n,l)===-s));return 0===c?0:c}},43253:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(57499),o=n(81384),i=n(70551),a=n(51831);function l(e,t,n){(0,i.A)(2,arguments);var l=(0,o.A)(e,t)/r.s0;return(0,a.u)(null==n?void 0:n.roundingMethod)(l)}},81384:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(10123),o=n(70551);function i(e,t){return(0,o.A)(2,arguments),(0,r.A)(e).getTime()-(0,r.A)(t).getTime()}},53303:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(57499),o=n(81384),i=n(70551),a=n(51831);function l(e,t,n){(0,i.A)(2,arguments);var l=(0,o.A)(e,t)/r.Cg;return(0,a.u)(null==n?void 0:n.roundingMethod)(l)}},21897:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(10123),o=n(60667),i=n(6982),a=n(70551),l=n(22613);function s(e,t){(0,a.A)(2,arguments);var n,s=(0,r.A)(e),u=(0,r.A)(t),c=(0,i.A)(s,u),d=Math.abs((0,o.A)(s,u));if(d<1)n=0;else{1===s.getMonth()&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-c*d);var f=(0,i.A)(s,u)===-c;(0,l.A)((0,r.A)(e))&&1===d&&1===(0,i.A)(e,u)&&(f=!1),n=c*(d-Number(f))}return 0===n?0:n}},90063:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(81384),o=n(70551),i=n(51831);function a(e,t,n){(0,o.A)(2,arguments);var a=(0,r.A)(e,t)/1e3;return(0,i.u)(null==n?void 0:n.roundingMethod)(a)}},74952:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(10123),o=n(82002),i=n(6982),a=n(70551);function l(e,t){(0,a.A)(2,arguments);var n=(0,r.A)(e),l=(0,r.A)(t),s=(0,i.A)(n,l),u=Math.abs((0,o.A)(n,l));n.setFullYear(1584),l.setFullYear(1584);var c=(0,i.A)(n,l)===-s,d=s*(u-Number(c));return 0===d?0:d}},66212:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(10123),o=n(70551);function i(e){(0,o.A)(1,arguments);var t=(0,r.A)(e);return t.setHours(23,59,59,999),t}},19312:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(10123),o=n(70551);function i(e){(0,o.A)(1,arguments);var t=(0,r.A)(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}},49747:(e,t,n)=>{"use strict";n.r(t),n.d(t,{add:()=>r.A,addBusinessDays:()=>c,addDays:()=>d.A,addHours:()=>g,addISOWeekYears:()=>T,addMilliseconds:()=>f,addMinutes:()=>C,addMonths:()=>x.A,addQuarters:()=>I,addSeconds:()=>R,addWeeks:()=>O,addYears:()=>M,areIntervalsOverlapping:()=>k,clamp:()=>L,closestIndexTo:()=>j,closestTo:()=>F,compareAsc:()=>B.A,compareDesc:()=>U,daysInWeek:()=>$.h,daysInYear:()=>$.Ki,daysToWeeks:()=>H,differenceInBusinessDays:()=>Y,differenceInCalendarDays:()=>E.A,differenceInCalendarISOWeekYears:()=>K,differenceInCalendarISOWeeks:()=>Z,differenceInCalendarMonths:()=>X.A,differenceInCalendarQuarters:()=>ee,differenceInCalendarWeeks:()=>ne,differenceInCalendarYears:()=>re.A,differenceInDays:()=>oe.A,differenceInHours:()=>ie.A,differenceInISOWeekYears:()=>le,differenceInMilliseconds:()=>se.A,differenceInMinutes:()=>ue.A,differenceInMonths:()=>ce.A,differenceInQuarters:()=>fe,differenceInSeconds:()=>pe.A,differenceInWeeks:()=>ge,differenceInYears:()=>he.A,eachDayOfInterval:()=>me,eachHourOfInterval:()=>ve,eachMinuteOfInterval:()=>be,eachMonthOfInterval:()=>we,eachQuarterOfInterval:()=>Ee,eachWeekOfInterval:()=>_e,eachWeekendOfInterval:()=>Te,eachWeekendOfMonth:()=>xe,eachWeekendOfYear:()=>Oe,eachYearOfInterval:()=>Me,endOfDay:()=>ke.A,endOfDecade:()=>De,endOfHour:()=>Ne,endOfISOWeek:()=>Le,endOfISOWeekYear:()=>je,endOfMinute:()=>Fe,endOfMonth:()=>Ce.A,endOfQuarter:()=>Be,endOfSecond:()=>Ue,endOfToday:()=>$e,endOfTomorrow:()=>He,endOfWeek:()=>Pe,endOfYear:()=>Ie,endOfYesterday:()=>ze,format:()=>Ct,formatDistance:()=>Dt,formatDistanceStrict:()=>Ft,formatDistanceToNow:()=>Bt,formatDistanceToNowStrict:()=>Ut,formatDuration:()=>Ht,formatISO:()=>zt,formatISO9075:()=>Gt,formatISODuration:()=>Vt,formatRFC3339:()=>Wt,formatRFC7231:()=>qt,formatRelative:()=>Qt,fromUnixTime:()=>Zt,getDate:()=>Xt,getDay:()=>Jt,getDayOfYear:()=>en,getDaysInMonth:()=>tn,getDaysInYear:()=>rn,getDecade:()=>on,getDefaultOptions:()=>an,getHours:()=>ln,getISODay:()=>sn,getISOWeek:()=>cn,getISOWeekYear:()=>w,getISOWeeksInYear:()=>fn,getMilliseconds:()=>pn,getMinutes:()=>gn,getMonth:()=>hn,getOverlappingDaysInIntervals:()=>vn,getQuarter:()=>J,getSeconds:()=>yn,getTime:()=>bn,getUnixTime:()=>wn,getWeek:()=>Tn,getWeekOfMonth:()=>An,getWeekYear:()=>Sn,getWeeksInMonth:()=>xn,getYear:()=>In,hoursToMilliseconds:()=>Rn,hoursToMinutes:()=>On,hoursToSeconds:()=>Mn,intervalToDuration:()=>kn.default,intlFormat:()=>Dn,intlFormatDistance:()=>Nn,isAfter:()=>Pn,isBefore:()=>Ln,isDate:()=>V,isEqual:()=>jn,isExists:()=>Fn,isFirstDayOfMonth:()=>Bn,isFriday:()=>Un,isFuture:()=>$n,isLastDayOfMonth:()=>Hn.A,isLeapYear:()=>nn,isMatch:()=>Co,isMonday:()=>xo,isPast:()=>Io,isSameDay:()=>G,isSameHour:()=>Oo,isSameISOWeek:()=>ko,isSameISOWeekYear:()=>Do,isSameMinute:()=>No,isSameMonth:()=>Po,isSameQuarter:()=>Lo,isSameSecond:()=>Fo,isSameWeek:()=>Mo,isSameYear:()=>Bo,isSaturday:()=>u,isSunday:()=>s,isThisHour:()=>Uo,isThisISOWeek:()=>$o,isThisMinute:()=>Ho,isThisMonth:()=>zo,isThisQuarter:()=>Go,isThisSecond:()=>Vo,isThisWeek:()=>Wo,isThisYear:()=>Yo,isThursday:()=>Ko,isToday:()=>qo,isTomorrow:()=>Qo,isTuesday:()=>Zo,isValid:()=>W,isWednesday:()=>Xo,isWeekend:()=>a,isWithinInterval:()=>Jo,isYesterday:()=>ti,lastDayOfDecade:()=>ni,lastDayOfISOWeek:()=>oi,lastDayOfISOWeekYear:()=>ii,lastDayOfMonth:()=>Cn,lastDayOfQuarter:()=>ai,lastDayOfWeek:()=>ri,lastDayOfYear:()=>li,lightFormat:()=>fi,max:()=>N,maxTime:()=>$.GW,milliseconds:()=>gi,millisecondsInHour:()=>$.s0,millisecondsInMinute:()=>$.Cg,millisecondsInSecond:()=>$._m,millisecondsToHours:()=>hi,millisecondsToMinutes:()=>mi,millisecondsToSeconds:()=>vi,min:()=>P,minTime:()=>$.uL,minutesInHour:()=>$.l5,minutesToHours:()=>yi,minutesToMilliseconds:()=>bi,minutesToSeconds:()=>wi,monthsInQuarter:()=>$.rI,monthsInYear:()=>$.e8,monthsToQuarters:()=>Si,monthsToYears:()=>Ei,nextDay:()=>_i,nextFriday:()=>Ti,nextMonday:()=>Ai,nextSaturday:()=>Ci,nextSunday:()=>xi,nextThursday:()=>Ii,nextTuesday:()=>Ri,nextWednesday:()=>Oi,parse:()=>Ao,parseISO:()=>Mi,parseJSON:()=>Ui,previousDay:()=>$i,previousFriday:()=>Hi,previousMonday:()=>zi,previousSaturday:()=>Gi,previousSunday:()=>Vi,previousThursday:()=>Wi,previousTuesday:()=>Yi,previousWednesday:()=>Ki,quartersInYear:()=>$.gs,quartersToMonths:()=>qi,quartersToYears:()=>Qi,roundToNearestMinutes:()=>Zi,secondsInDay:()=>$.pe,secondsInHour:()=>$.tF,secondsInMinute:()=>$.bF,secondsInMonth:()=>$.BM,secondsInQuarter:()=>$.Z7,secondsInWeek:()=>$.hq,secondsInYear:()=>$.Mf,secondsToHours:()=>Xi,secondsToMilliseconds:()=>Ji,secondsToMinutes:()=>ea,set:()=>na,setDate:()=>ra,setDay:()=>oa,setDayOfYear:()=>ia,setDefaultOptions:()=>aa,setHours:()=>la,setISODay:()=>sa,setISOWeek:()=>ua,setISOWeekYear:()=>_,setMilliseconds:()=>ca,setMinutes:()=>da,setMonth:()=>ta,setQuarter:()=>fa,setSeconds:()=>pa,setWeek:()=>ga,setWeekYear:()=>ha,setYear:()=>ma,startOfDay:()=>z.A,startOfDecade:()=>va,startOfHour:()=>Ro,startOfISOWeek:()=>b,startOfISOWeekYear:()=>S,startOfMinute:()=>ye,startOfMonth:()=>Ae,startOfQuarter:()=>Se,startOfSecond:()=>jo,startOfToday:()=>ya,startOfTomorrow:()=>ba,startOfWeek:()=>y,startOfWeekYear:()=>En,startOfYear:()=>Re,startOfYesterday:()=>wa,sub:()=>Ea,subBusinessDays:()=>_a,subDays:()=>ei,subHours:()=>Ta,subISOWeekYears:()=>ae,subMilliseconds:()=>Ge,subMinutes:()=>Aa,subMonths:()=>Sa,subQuarters:()=>Ca,subSeconds:()=>xa,subWeeks:()=>Ia,subYears:()=>Ra,toDate:()=>o.A,weeksToDays:()=>Oa,yearsToMonths:()=>Ma,yearsToQuarters:()=>ka});var r=n(93165),o=n(10123),i=n(70551);function a(e){(0,i.A)(1,arguments);var t=(0,o.A)(e).getDay();return 0===t||6===t}var l=n(94188);function s(e){return(0,i.A)(1,arguments),0===(0,o.A)(e).getDay()}function u(e){return(0,i.A)(1,arguments),6===(0,o.A)(e).getDay()}function c(e,t){(0,i.A)(2,arguments);var n=(0,o.A)(e),r=a(n),c=(0,l.A)(t);if(isNaN(c))return new Date(NaN);var d=n.getHours(),f=c<0?-1:1,p=(0,l.A)(c/5);n.setDate(n.getDate()+7*p);for(var g=Math.abs(c%5);g>0;)n.setDate(n.getDate()+f),a(n)||(g-=1);return r&&a(n)&&0!==c&&(u(n)&&n.setDate(n.getDate()+(f<0?2:-1)),s(n)&&n.setDate(n.getDate()+(f<0?1:-2))),n.setHours(d),n}var d=n(92998);function f(e,t){(0,i.A)(2,arguments);var n=(0,o.A)(e).getTime(),r=(0,l.A)(t);return new Date(n+r)}var p=36e5;function g(e,t){return(0,i.A)(2,arguments),f(e,(0,l.A)(t)*p)}var h={};function m(){return h}function v(e){h=e}function y(e,t){var n,r,a,s,u,c,d,f;(0,i.A)(1,arguments);var p=m(),g=(0,l.A)(null!==(n=null!==(r=null!==(a=null!==(s=null==t?void 0:t.weekStartsOn)&&void 0!==s?s:null==t||null===(u=t.locale)||void 0===u||null===(c=u.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==a?a:p.weekStartsOn)&&void 0!==r?r:null===(d=p.locale)||void 0===d||null===(f=d.options)||void 0===f?void 0:f.weekStartsOn)&&void 0!==n?n:0);if(!(g>=0&&g<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=(0,o.A)(e),v=h.getDay(),y=(v=a.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function S(e){(0,i.A)(1,arguments);var t=w(e),n=new Date(0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),b(n)}var E=n(40063);function _(e,t){(0,i.A)(2,arguments);var n=(0,o.A)(e),r=(0,l.A)(t),a=(0,E.A)(n,S(n)),s=new Date(0);return s.setFullYear(r,0,4),s.setHours(0,0,0,0),(n=S(s)).setDate(n.getDate()+a),n}function T(e,t){(0,i.A)(2,arguments);var n=(0,l.A)(t);return _(e,w(e)+n)}var A=6e4;function C(e,t){return(0,i.A)(2,arguments),f(e,(0,l.A)(t)*A)}var x=n(2118);function I(e,t){(0,i.A)(2,arguments);var n=3*(0,l.A)(t);return(0,x.A)(e,n)}function R(e,t){return(0,i.A)(2,arguments),f(e,1e3*(0,l.A)(t))}function O(e,t){(0,i.A)(2,arguments);var n=7*(0,l.A)(t);return(0,d.A)(e,n)}function M(e,t){(0,i.A)(2,arguments);var n=(0,l.A)(t);return(0,x.A)(e,12*n)}function k(e,t,n){(0,i.A)(2,arguments);var r=(0,o.A)(null==e?void 0:e.start).getTime(),a=(0,o.A)(null==e?void 0:e.end).getTime(),l=(0,o.A)(null==t?void 0:t.start).getTime(),s=(0,o.A)(null==t?void 0:t.end).getTime();if(!(r<=a&&l<=s))throw new RangeError("Invalid interval");return null!=n&&n.inclusive?r<=s&&l<=a:rt||isNaN(t.getDate()))&&(n=t)})),n||new Date(NaN)}function L(e,t){var n=t.start,r=t.end;return(0,i.A)(2,arguments),P([N([e,n]),r])}function j(e,t){(0,i.A)(2,arguments);var n=(0,o.A)(e);if(isNaN(Number(n)))return NaN;var r,a,l=n.getTime();return(null==t?[]:"function"==typeof t.forEach?t:Array.prototype.slice.call(t)).forEach((function(e,t){var n=(0,o.A)(e);if(isNaN(Number(n)))return r=NaN,void(a=NaN);var i=Math.abs(l-n.getTime());(null==r||i0?-1:a<0?1:a}var $=n(57499);function H(e){(0,i.A)(1,arguments);var t=e/$.h;return Math.floor(t)}var z=n(31127);function G(e,t){(0,i.A)(2,arguments);var n=(0,z.A)(e),r=(0,z.A)(t);return n.getTime()===r.getTime()}function V(e){return(0,i.A)(1,arguments),e instanceof Date||"object"===(0,D.A)(e)&&"[object Date]"===Object.prototype.toString.call(e)}function W(e){if((0,i.A)(1,arguments),!V(e)&&"number"!=typeof e)return!1;var t=(0,o.A)(e);return!isNaN(Number(t))}function Y(e,t){(0,i.A)(2,arguments);var n=(0,o.A)(e),r=(0,o.A)(t);if(!W(n)||!W(r))return NaN;var s=(0,E.A)(n,r),u=s<0?-1:1,c=(0,l.A)(s/7),f=5*c;for(r=(0,d.A)(r,7*c);!G(n,r);)f+=a(r)?0:u,r=(0,d.A)(r,u);return 0===f?0:f}function K(e,t){return(0,i.A)(2,arguments),w(e)-w(t)}var q=n(67044),Q=6048e5;function Z(e,t){(0,i.A)(2,arguments);var n=b(e),r=b(t),o=n.getTime()-(0,q.A)(n),a=r.getTime()-(0,q.A)(r);return Math.round((o-a)/Q)}var X=n(60667);function J(e){(0,i.A)(1,arguments);var t=(0,o.A)(e);return Math.floor(t.getMonth()/3)+1}function ee(e,t){(0,i.A)(2,arguments);var n=(0,o.A)(e),r=(0,o.A)(t);return 4*(n.getFullYear()-r.getFullYear())+(J(n)-J(r))}var te=6048e5;function ne(e,t,n){(0,i.A)(2,arguments);var r=y(e,n),o=y(t,n),a=r.getTime()-(0,q.A)(r),l=o.getTime()-(0,q.A)(o);return Math.round((a-l)/te)}var re=n(82002),oe=n(89045),ie=n(43253);function ae(e,t){return(0,i.A)(2,arguments),T(e,-(0,l.A)(t))}function le(e,t){(0,i.A)(2,arguments);var n=(0,o.A)(e),r=(0,o.A)(t),a=(0,B.A)(n,r),l=Math.abs(K(n,r));n=ae(n,a*l);var s=a*(l-Number((0,B.A)(n,r)===-a));return 0===s?0:s}var se=n(81384),ue=n(53303),ce=n(21897),de=n(51831);function fe(e,t,n){(0,i.A)(2,arguments);var r=(0,ce.A)(e,t)/3;return(0,de.u)(null==n?void 0:n.roundingMethod)(r)}var pe=n(90063);function ge(e,t,n){(0,i.A)(2,arguments);var r=(0,oe.A)(e,t)/7;return(0,de.u)(null==n?void 0:n.roundingMethod)(r)}var he=n(74952);function me(e,t){var n;(0,i.A)(1,arguments);var r=e||{},a=(0,o.A)(r.start),l=(0,o.A)(r.end).getTime();if(!(a.getTime()<=l))throw new RangeError("Invalid interval");var s=[],u=a;u.setHours(0,0,0,0);var c=Number(null!==(n=null==t?void 0:t.step)&&void 0!==n?n:1);if(c<1||isNaN(c))throw new RangeError("`options.step` must be a number greater than 1");for(;u.getTime()<=l;)s.push((0,o.A)(u)),u.setDate(u.getDate()+c),u.setHours(0,0,0,0);return s}function ve(e,t){var n;(0,i.A)(1,arguments);var r=e||{},a=(0,o.A)(r.start),l=(0,o.A)(r.end),s=a.getTime(),u=l.getTime();if(!(s<=u))throw new RangeError("Invalid interval");var c=[],d=a;d.setMinutes(0,0,0);var f=Number(null!==(n=null==t?void 0:t.step)&&void 0!==n?n:1);if(f<1||isNaN(f))throw new RangeError("`options.step` must be a number greater than 1");for(;d.getTime()<=u;)c.push((0,o.A)(d)),d=g(d,f);return c}function ye(e){(0,i.A)(1,arguments);var t=(0,o.A)(e);return t.setSeconds(0,0),t}function be(e,t){var n;(0,i.A)(1,arguments);var r=ye((0,o.A)(e.start)),a=(0,o.A)(e.end),l=r.getTime(),s=a.getTime();if(l>=s)throw new RangeError("Invalid interval");var u=[],c=r,d=Number(null!==(n=null==t?void 0:t.step)&&void 0!==n?n:1);if(d<1||isNaN(d))throw new RangeError("`options.step` must be a number equal to or greater than 1");for(;c.getTime()<=s;)u.push((0,o.A)(c)),c=C(c,d);return u}function we(e){(0,i.A)(1,arguments);var t=e||{},n=(0,o.A)(t.start),r=(0,o.A)(t.end).getTime(),a=[];if(!(n.getTime()<=r))throw new RangeError("Invalid interval");var l=n;for(l.setHours(0,0,0,0),l.setDate(1);l.getTime()<=r;)a.push((0,o.A)(l)),l.setMonth(l.getMonth()+1);return a}function Se(e){(0,i.A)(1,arguments);var t=(0,o.A)(e),n=t.getMonth(),r=n-n%3;return t.setMonth(r,1),t.setHours(0,0,0,0),t}function Ee(e){(0,i.A)(1,arguments);var t=e||{},n=(0,o.A)(t.start),r=(0,o.A)(t.end),a=r.getTime();if(!(n.getTime()<=a))throw new RangeError("Invalid interval");var l=Se(n);a=Se(r).getTime();for(var s=[],u=l;u.getTime()<=a;)s.push((0,o.A)(u)),u=I(u,1);return s}function _e(e,t){(0,i.A)(1,arguments);var n=e||{},r=(0,o.A)(n.start),a=(0,o.A)(n.end),l=a.getTime();if(!(r.getTime()<=l))throw new RangeError("Invalid interval");var s=y(r,t),u=y(a,t);s.setHours(15),u.setHours(15),l=u.getTime();for(var c=[],d=s;d.getTime()<=l;)d.setHours(0),c.push((0,o.A)(d)),(d=O(d,1)).setHours(15);return c}function Te(e){(0,i.A)(1,arguments);for(var t=me(e),n=[],r=0;r=0&&g<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=(0,o.A)(e),v=h.getDay(),y=6+(v=a.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function Ye(e){(0,i.A)(1,arguments);var t=(0,o.A)(e),n=Ve(t).getTime()-function(e){(0,i.A)(1,arguments);var t=We(e),n=new Date(0);return n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0),Ve(n)}(t).getTime();return Math.round(n/6048e5)+1}function Ke(e,t){var n,r,a,s,u,c,d,f;(0,i.A)(1,arguments);var p=m(),g=(0,l.A)(null!==(n=null!==(r=null!==(a=null!==(s=null==t?void 0:t.weekStartsOn)&&void 0!==s?s:null==t||null===(u=t.locale)||void 0===u||null===(c=u.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==a?a:p.weekStartsOn)&&void 0!==r?r:null===(d=p.locale)||void 0===d||null===(f=d.options)||void 0===f?void 0:f.weekStartsOn)&&void 0!==n?n:0);if(!(g>=0&&g<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=(0,o.A)(e),v=h.getUTCDay(),y=(v=1&&v<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var y=new Date(0);y.setUTCFullYear(g+1,0,v),y.setUTCHours(0,0,0,0);var b=Ke(y,t),w=new Date(0);w.setUTCFullYear(g,0,v),w.setUTCHours(0,0,0,0);var S=Ke(w,t);return p.getTime()>=b.getTime()?g+1:p.getTime()>=S.getTime()?g:g-1}function Qe(e,t){(0,i.A)(1,arguments);var n=(0,o.A)(e),r=Ke(n,t).getTime()-function(e,t){var n,r,o,a,s,u,c,d;(0,i.A)(1,arguments);var f=m(),p=(0,l.A)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.firstWeekContainsDate)&&void 0!==a?a:null==t||null===(s=t.locale)||void 0===s||null===(u=s.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==o?o:f.firstWeekContainsDate)&&void 0!==r?r:null===(c=f.locale)||void 0===c||null===(d=c.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==n?n:1),g=qe(e,t),h=new Date(0);return h.setUTCFullYear(g,0,p),h.setUTCHours(0,0,0,0),Ke(h,t)}(n,t).getTime();return Math.round(r/6048e5)+1}function Ze(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length0?n:1-n;return Ze("yy"===t?r%100:r,t.length)},M:function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):Ze(n+1,2)},d:function(e,t){return Ze(e.getUTCDate(),t.length)},a:function(e,t){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:function(e,t){return Ze(e.getUTCHours()%12||12,t.length)},H:function(e,t){return Ze(e.getUTCHours(),t.length)},m:function(e,t){return Ze(e.getUTCMinutes(),t.length)},s:function(e,t){return Ze(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length,r=e.getUTCMilliseconds();return Ze(Math.floor(r*Math.pow(10,n-3)),t.length)}};const Je=Xe;function et(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),i=r%60;if(0===i)return n+String(o);var a=t||"";return n+String(o)+a+Ze(i,2)}function tt(e,t){return e%60==0?(e>0?"-":"+")+Ze(Math.abs(e)/60,2):nt(e,t)}function nt(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e);return r+Ze(Math.floor(o/60),2)+n+Ze(o%60,2)}const rt={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return Je.y(e,t)},Y:function(e,t,n,r){var o=qe(e,r),i=o>0?o:1-o;return"YY"===t?Ze(i%100,2):"Yo"===t?n.ordinalNumber(i,{unit:"year"}):Ze(i,t.length)},R:function(e,t){return Ze(We(e),t.length)},u:function(e,t){return Ze(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Ze(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Ze(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return Je.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return Ze(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var o=Qe(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):Ze(o,t.length)},I:function(e,t,n){var r=Ye(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):Ze(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):Je.d(e,t)},D:function(e,t,n){var r=function(e){(0,i.A)(1,arguments);var t=(0,o.A)(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=n-t.getTime();return Math.floor(r/864e5)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):Ze(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return Ze(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return Ze(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return Ze(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,o=e.getUTCHours();switch(r=12===o?"noon":0===o?"midnight":o/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,o=e.getUTCHours();switch(r=o>=17?"evening":o>=12?"afternoon":o>=4?"morning":"night",t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Je.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):Je.H(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):Ze(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):Ze(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):Je.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):Je.s(e,t)},S:function(e,t){return Je.S(e,t)},X:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return tt(o);case"XXXX":case"XX":return nt(o);default:return nt(o,":")}},x:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return tt(o);case"xxxx":case"xx":return nt(o);default:return nt(o,":")}},O:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+et(o,":");default:return"GMT"+nt(o,":")}},z:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+et(o,":");default:return"GMT"+nt(o,":")}},t:function(e,t,n,r){var o=r._originalDate||e;return Ze(Math.floor(o.getTime()/1e3),t.length)},T:function(e,t,n,r){return Ze((r._originalDate||e).getTime(),t.length)}};var ot=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},it=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},at={p:it,P:function(e,t){var n,r=e.match(/(P+)(p+)?/)||[],o=r[1],i=r[2];if(!i)return ot(e,t);switch(o){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",ot(o,t)).replace("{{time}}",it(i,t))}};const lt=at;var st=["D","DD"],ut=["YY","YYYY"];function ct(e){return-1!==st.indexOf(e)}function dt(e){return-1!==ut.indexOf(e)}function ft(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var pt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function gt(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var ht,mt={date:gt({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:gt({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:gt({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},vt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function yt(e){return function(t,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,i=null!=n&&n.width?String(n.width):o;r=e.formattingValues[i]||e.formattingValues[o]}else{var a=e.defaultWidth,l=null!=n&&n.width?String(n.width):e.defaultWidth;r=e.values[l]||e.values[a]}return r[e.argumentCallback?e.argumentCallback(t):t]}}function bt(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;var a,l=i[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(s)?function(e){for(var t=0;t0?"in "+r:r+" ago":r},formatLong:mt,formatRelative:function(e,t,n,r){return vt[e]},localize:{ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:yt({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:yt({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:yt({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:yt({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:yt({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(ht={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.match(ht.matchPattern);if(!n)return null;var r=n[0],o=e.match(ht.parsePattern);if(!o)return null;var i=ht.valueCallback?ht.valueCallback(o[0]):o[0];return{value:i=t.valueCallback?t.valueCallback(i):i,rest:e.slice(r.length)}}),era:bt({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:bt({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:bt({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:bt({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:bt({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};var St=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Et=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,_t=/^'([^]*?)'?$/,Tt=/''/g,At=/[a-zA-Z]/;function Ct(e,t,n){var r,a,s,u,c,d,f,p,g,h,v,y,b,w,S,E,_,T;(0,i.A)(2,arguments);var A=String(t),C=m(),x=null!==(r=null!==(a=null==n?void 0:n.locale)&&void 0!==a?a:C.locale)&&void 0!==r?r:wt,I=(0,l.A)(null!==(s=null!==(u=null!==(c=null!==(d=null==n?void 0:n.firstWeekContainsDate)&&void 0!==d?d:null==n||null===(f=n.locale)||void 0===f||null===(p=f.options)||void 0===p?void 0:p.firstWeekContainsDate)&&void 0!==c?c:C.firstWeekContainsDate)&&void 0!==u?u:null===(g=C.locale)||void 0===g||null===(h=g.options)||void 0===h?void 0:h.firstWeekContainsDate)&&void 0!==s?s:1);if(!(I>=1&&I<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var R=(0,l.A)(null!==(v=null!==(y=null!==(b=null!==(w=null==n?void 0:n.weekStartsOn)&&void 0!==w?w:null==n||null===(S=n.locale)||void 0===S||null===(E=S.options)||void 0===E?void 0:E.weekStartsOn)&&void 0!==b?b:C.weekStartsOn)&&void 0!==y?y:null===(_=C.locale)||void 0===_||null===(T=_.options)||void 0===T?void 0:T.weekStartsOn)&&void 0!==v?v:0);if(!(R>=0&&R<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!x.localize)throw new RangeError("locale must contain localize property");if(!x.formatLong)throw new RangeError("locale must contain formatLong property");var O=(0,o.A)(e);if(!W(O))throw new RangeError("Invalid time value");var M=Ge(O,(0,q.A)(O)),k={firstWeekContainsDate:I,weekStartsOn:R,locale:x,_originalDate:O};return A.match(Et).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,lt[t])(e,x.formatLong):e})).join("").match(St).map((function(r){if("''"===r)return"'";var o,i,a=r[0];if("'"===a)return(i=(o=r).match(_t))?i[1].replace(Tt,"'"):o;var l=rt[a];if(l)return null!=n&&n.useAdditionalWeekYearTokens||!dt(r)||ft(r,t,String(e)),null!=n&&n.useAdditionalDayOfYearTokens||!ct(r)||ft(r,t,String(e)),l(M,r,x.localize,k);if(a.match(At))throw new RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");return r})).join("")}function xt(e,t){if(null==e)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function It(e){return xt({},e)}var Rt=1440,Ot=2520,Mt=43200,kt=86400;function Dt(e,t,n){var r,a;(0,i.A)(2,arguments);var l=m(),s=null!==(r=null!==(a=null==n?void 0:n.locale)&&void 0!==a?a:l.locale)&&void 0!==r?r:wt;if(!s.formatDistance)throw new RangeError("locale must contain formatDistance property");var u=(0,B.A)(e,t);if(isNaN(u))throw new RangeError("Invalid time value");var c,d,f=xt(It(n),{addSuffix:Boolean(null==n?void 0:n.addSuffix),comparison:u});u>0?(c=(0,o.A)(t),d=(0,o.A)(e)):(c=(0,o.A)(e),d=(0,o.A)(t));var p,g=(0,pe.A)(d,c),h=((0,q.A)(d)-(0,q.A)(c))/1e3,v=Math.round((g-h)/60);if(v<2)return null!=n&&n.includeSeconds?g<5?s.formatDistance("lessThanXSeconds",5,f):g<10?s.formatDistance("lessThanXSeconds",10,f):g<20?s.formatDistance("lessThanXSeconds",20,f):g<40?s.formatDistance("halfAMinute",0,f):g<60?s.formatDistance("lessThanXMinutes",1,f):s.formatDistance("xMinutes",1,f):0===v?s.formatDistance("lessThanXMinutes",1,f):s.formatDistance("xMinutes",v,f);if(v<45)return s.formatDistance("xMinutes",v,f);if(v<90)return s.formatDistance("aboutXHours",1,f);if(v0?(d=(0,o.A)(t),f=(0,o.A)(e)):(d=(0,o.A)(e),f=(0,o.A)(t));var g,h=String(null!==(l=null==n?void 0:n.roundingMethod)&&void 0!==l?l:"round");if("floor"===h)g=Math.floor;else if("ceil"===h)g=Math.ceil;else{if("round"!==h)throw new RangeError("roundingMethod must be 'floor', 'ceil' or 'round'");g=Math.round}var v,y=f.getTime()-d.getTime(),b=y/Nt,w=(y-((0,q.A)(f)-(0,q.A)(d)))/Nt,S=null==n?void 0:n.unit;if("second"===(v=S?String(S):b<1?"second":b<60?"minute":b=0&&i<=3))throw new RangeError("fractionDigits must be between 0 and 3 inclusively");var a=Ze(r.getDate(),2),s=Ze(r.getMonth()+1,2),u=r.getFullYear(),c=Ze(r.getHours(),2),d=Ze(r.getMinutes(),2),f=Ze(r.getSeconds(),2),p="";if(i>0){var g=r.getMilliseconds();p="."+Ze(Math.floor(g*Math.pow(10,i-3)),i)}var h="",m=r.getTimezoneOffset();if(0!==m){var v=Math.abs(m),y=Ze((0,l.A)(v/60),2),b=Ze(v%60,2);h="".concat(m<0?"+":"-").concat(y,":").concat(b)}else h="Z";return"".concat(u,"-").concat(s,"-").concat(a,"T").concat(c,":").concat(d,":").concat(f).concat(p).concat(h)}var Yt=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Kt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function qt(e){if(arguments.length<1)throw new TypeError("1 arguments required, but only ".concat(arguments.length," present"));var t=(0,o.A)(e);if(!W(t))throw new RangeError("Invalid time value");var n=Yt[t.getUTCDay()],r=Ze(t.getUTCDate(),2),i=Kt[t.getUTCMonth()],a=t.getUTCFullYear(),l=Ze(t.getUTCHours(),2),s=Ze(t.getUTCMinutes(),2),u=Ze(t.getUTCSeconds(),2);return"".concat(n,", ").concat(r," ").concat(i," ").concat(a," ").concat(l,":").concat(s,":").concat(u," GMT")}function Qt(e,t,n){var r,a,s,u,c,d,f,p,g,h;(0,i.A)(2,arguments);var v=(0,o.A)(e),y=(0,o.A)(t),b=m(),w=null!==(r=null!==(a=null==n?void 0:n.locale)&&void 0!==a?a:b.locale)&&void 0!==r?r:wt,S=(0,l.A)(null!==(s=null!==(u=null!==(c=null!==(d=null==n?void 0:n.weekStartsOn)&&void 0!==d?d:null==n||null===(f=n.locale)||void 0===f||null===(p=f.options)||void 0===p?void 0:p.weekStartsOn)&&void 0!==c?c:b.weekStartsOn)&&void 0!==u?u:null===(g=b.locale)||void 0===g||null===(h=g.options)||void 0===h?void 0:h.weekStartsOn)&&void 0!==s?s:0);if(!w.localize)throw new RangeError("locale must contain localize property");if(!w.formatLong)throw new RangeError("locale must contain formatLong property");if(!w.formatRelative)throw new RangeError("locale must contain formatRelative property");var _,T=(0,E.A)(v,y);if(isNaN(T))throw new RangeError("Invalid time value");_=T<-6?"other":T<-1?"lastWeek":T<0?"yesterday":T<1?"today":T<2?"tomorrow":T<7?"nextWeek":"other";var A=Ge(v,(0,q.A)(v)),C=Ge(y,(0,q.A)(y));return Ct(v,w.formatRelative(_,A,C,{locale:w,weekStartsOn:S}),{locale:w,weekStartsOn:S})}function Zt(e){(0,i.A)(1,arguments);var t=(0,l.A)(e);return(0,o.A)(1e3*t)}function Xt(e){return(0,i.A)(1,arguments),(0,o.A)(e).getDate()}function Jt(e){return(0,i.A)(1,arguments),(0,o.A)(e).getDay()}function en(e){(0,i.A)(1,arguments);var t=(0,o.A)(e);return(0,E.A)(t,Re(t))+1}function tn(e){(0,i.A)(1,arguments);var t=(0,o.A)(e),n=t.getFullYear(),r=t.getMonth(),a=new Date(0);return a.setFullYear(n,r+1,0),a.setHours(0,0,0,0),a.getDate()}function nn(e){(0,i.A)(1,arguments);var t=(0,o.A)(e).getFullYear();return t%400==0||t%4==0&&t%100!=0}function rn(e){(0,i.A)(1,arguments);var t=(0,o.A)(e);return"Invalid Date"===String(new Date(t))?NaN:nn(t)?366:365}function on(e){(0,i.A)(1,arguments);var t=(0,o.A)(e).getFullYear();return 10*Math.floor(t/10)}function an(){return xt({},m())}function ln(e){return(0,i.A)(1,arguments),(0,o.A)(e).getHours()}function sn(e){(0,i.A)(1,arguments);var t=(0,o.A)(e).getDay();return 0===t&&(t=7),t}var un=6048e5;function cn(e){(0,i.A)(1,arguments);var t=(0,o.A)(e),n=b(t).getTime()-S(t).getTime();return Math.round(n/un)+1}var dn=6048e5;function fn(e){(0,i.A)(1,arguments);var t=S(e),n=S(O(t,60)).valueOf()-t.valueOf();return Math.round(n/dn)}function pn(e){return(0,i.A)(1,arguments),(0,o.A)(e).getMilliseconds()}function gn(e){return(0,i.A)(1,arguments),(0,o.A)(e).getMinutes()}function hn(e){return(0,i.A)(1,arguments),(0,o.A)(e).getMonth()}var mn=864e5;function vn(e,t){(0,i.A)(2,arguments);var n=e||{},r=t||{},a=(0,o.A)(n.start).getTime(),l=(0,o.A)(n.end).getTime(),s=(0,o.A)(r.start).getTime(),u=(0,o.A)(r.end).getTime();if(!(a<=l&&s<=u))throw new RangeError("Invalid interval");if(!(al?l:u)-(s=1&&v<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var b=new Date(0);b.setFullYear(g+1,0,v),b.setHours(0,0,0,0);var w=y(b,t),S=new Date(0);S.setFullYear(g,0,v),S.setHours(0,0,0,0);var E=y(S,t);return p.getTime()>=w.getTime()?g+1:p.getTime()>=E.getTime()?g:g-1}function En(e,t){var n,r,o,a,s,u,c,d;(0,i.A)(1,arguments);var f=m(),p=(0,l.A)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.firstWeekContainsDate)&&void 0!==a?a:null==t||null===(s=t.locale)||void 0===s||null===(u=s.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==o?o:f.firstWeekContainsDate)&&void 0!==r?r:null===(c=f.locale)||void 0===c||null===(d=c.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==n?n:1),g=Sn(e,t),h=new Date(0);return h.setFullYear(g,0,p),h.setHours(0,0,0,0),y(h,t)}var _n=6048e5;function Tn(e,t){(0,i.A)(1,arguments);var n=(0,o.A)(e),r=y(n,t).getTime()-En(n,t).getTime();return Math.round(r/_n)+1}function An(e,t){var n,r,o,a,s,u,c,d;(0,i.A)(1,arguments);var f=m(),p=(0,l.A)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.weekStartsOn)&&void 0!==a?a:null==t||null===(s=t.locale)||void 0===s||null===(u=s.options)||void 0===u?void 0:u.weekStartsOn)&&void 0!==o?o:f.weekStartsOn)&&void 0!==r?r:null===(c=f.locale)||void 0===c||null===(d=c.options)||void 0===d?void 0:d.weekStartsOn)&&void 0!==n?n:0);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var g=Xt(e);if(isNaN(g))return NaN;var h=p-Jt(Ae(e));h<=0&&(h+=7);var v=g-h;return Math.ceil(v/7)+1}function Cn(e){(0,i.A)(1,arguments);var t=(0,o.A)(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function xn(e,t){return(0,i.A)(1,arguments),ne(Cn(e),Ae(e),t)+1}function In(e){return(0,i.A)(1,arguments),(0,o.A)(e).getFullYear()}function Rn(e){return(0,i.A)(1,arguments),Math.floor(e*$.s0)}function On(e){return(0,i.A)(1,arguments),Math.floor(e*$.l5)}function Mn(e){return(0,i.A)(1,arguments),Math.floor(e*$.tF)}var kn=n(41454);function Dn(e,t,n){var r,o,a;return(0,i.A)(1,arguments),void 0===(a=t)||"locale"in a?n=t:o=t,new Intl.DateTimeFormat(null===(r=n)||void 0===r?void 0:r.locale,o).format(e)}function Nn(e,t,n){(0,i.A)(2,arguments);var r,a=0,l=(0,o.A)(e),s=(0,o.A)(t);if(null!=n&&n.unit)"second"===(r=null==n?void 0:n.unit)?a=(0,pe.A)(l,s):"minute"===r?a=(0,ue.A)(l,s):"hour"===r?a=(0,ie.A)(l,s):"day"===r?a=(0,E.A)(l,s):"week"===r?a=ne(l,s):"month"===r?a=(0,X.A)(l,s):"quarter"===r?a=ee(l,s):"year"===r&&(a=(0,re.A)(l,s));else{var u=(0,pe.A)(l,s);Math.abs(u)<$.bF?(a=(0,pe.A)(l,s),r="second"):Math.abs(u)<$.tF?(a=(0,ue.A)(l,s),r="minute"):Math.abs(u)<$.pe&&Math.abs((0,E.A)(l,s))<1?(a=(0,ie.A)(l,s),r="hour"):Math.abs(u)<$.hq&&(a=(0,E.A)(l,s))&&Math.abs(a)<7?r="day":Math.abs(u)<$.BM?(a=ne(l,s),r="week"):Math.abs(u)<$.Z7?(a=(0,X.A)(l,s),r="month"):Math.abs(u)<$.Mf&&ee(l,s)<4?(a=ee(l,s),r="quarter"):(a=(0,re.A)(l,s),r="year")}return new Intl.RelativeTimeFormat(null==n?void 0:n.locale,{localeMatcher:null==n?void 0:n.localeMatcher,numeric:(null==n?void 0:n.numeric)||"auto",style:null==n?void 0:n.style}).format(a,r)}function Pn(e,t){(0,i.A)(2,arguments);var n=(0,o.A)(e),r=(0,o.A)(t);return n.getTime()>r.getTime()}function Ln(e,t){(0,i.A)(2,arguments);var n=(0,o.A)(e),r=(0,o.A)(t);return n.getTime()Date.now()}var Hn=n(22613),zn=n(27800);function Gn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=(0,zn.A)(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}var Vn=n(9417),Wn=n(85501),Yn=n(53954);function Kn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Kn=function(){return!!e})()}var qn=n(56822);function Qn(e){var t=Kn();return function(){var n,r=(0,Yn.A)(e);if(t){var o=(0,Yn.A)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,qn.A)(this,n)}}var Zn=n(23029),Xn=n(92901),Jn=n(64467),er=function(){function e(){(0,Zn.A)(this,e),(0,Jn.A)(this,"priority",void 0),(0,Jn.A)(this,"subPriority",0)}return(0,Xn.A)(e,[{key:"validate",value:function(e,t){return!0}}]),e}(),tr=function(e){(0,Wn.A)(n,e);var t=Qn(n);function n(e,r,o,i,a){var l;return(0,Zn.A)(this,n),(l=t.call(this)).value=e,l.validateValue=r,l.setValue=o,l.priority=i,a&&(l.subPriority=a),l}return(0,Xn.A)(n,[{key:"validate",value:function(e,t){return this.validateValue(e,this.value,t)}},{key:"set",value:function(e,t,n){return this.setValue(e,t,this.value,n)}}]),n}(er),nr=function(e){(0,Wn.A)(n,e);var t=Qn(n);function n(){var e;(0,Zn.A)(this,n);for(var r=arguments.length,o=new Array(r),i=0;i0,o=r?t:1-t;if(o<=50)n=e||100;else{var i=o+50;n=e+100*Math.floor(i/100)-(e>=i%100?100:0)}return r?n:1-n}function jr(e){return e%400==0||e%4==0&&e%100!=0}var Fr=function(e){(0,Wn.A)(n,e);var t=Qn(n);function n(){var e;(0,Zn.A)(this,n);for(var r=arguments.length,o=new Array(r),i=0;i0}},{key:"set",value:function(e,t,n){var r=e.getUTCFullYear();if(n.isTwoDigitYear){var o=Lr(n.year,r);return e.setUTCFullYear(o,0,1),e.setUTCHours(0,0,0,0),e}var i="era"in t&&1!==t.era?1-n.year:n.year;return e.setUTCFullYear(i,0,1),e.setUTCHours(0,0,0,0),e}}]),n}(rr),Br=function(e){(0,Wn.A)(n,e);var t=Qn(n);function n(){var e;(0,Zn.A)(this,n);for(var r=arguments.length,o=new Array(r),i=0;i0}},{key:"set",value:function(e,t,n,r){var o=qe(e,r);if(n.isTwoDigitYear){var i=Lr(n.year,o);return e.setUTCFullYear(i,0,r.firstWeekContainsDate),e.setUTCHours(0,0,0,0),Ke(e,r)}var a="era"in t&&1!==t.era?1-n.year:n.year;return e.setUTCFullYear(a,0,r.firstWeekContainsDate),e.setUTCHours(0,0,0,0),Ke(e,r)}}]),n}(rr),Ur=function(e){(0,Wn.A)(n,e);var t=Qn(n);function n(){var e;(0,Zn.A)(this,n);for(var r=arguments.length,o=new Array(r),i=0;i=1&&t<=4}},{key:"set",value:function(e,t,n){return e.setUTCMonth(3*(n-1),1),e.setUTCHours(0,0,0,0),e}}]),n}(rr),zr=function(e){(0,Wn.A)(n,e);var t=Qn(n);function n(){var e;(0,Zn.A)(this,n);for(var r=arguments.length,o=new Array(r),i=0;i=1&&t<=4}},{key:"set",value:function(e,t,n){return e.setUTCMonth(3*(n-1),1),e.setUTCHours(0,0,0,0),e}}]),n}(rr),Gr=function(e){(0,Wn.A)(n,e);var t=Qn(n);function n(){var e;(0,Zn.A)(this,n);for(var r=arguments.length,o=new Array(r),i=0;i=0&&t<=11}},{key:"set",value:function(e,t,n){return e.setUTCMonth(n,1),e.setUTCHours(0,0,0,0),e}}]),n}(rr),Vr=function(e){(0,Wn.A)(n,e);var t=Qn(n);function n(){var e;(0,Zn.A)(this,n);for(var r=arguments.length,o=new Array(r),i=0;i=0&&t<=11}},{key:"set",value:function(e,t,n){return e.setUTCMonth(n,1),e.setUTCHours(0,0,0,0),e}}]),n}(rr),Wr=function(e){(0,Wn.A)(n,e);var t=Qn(n);function n(){var e;(0,Zn.A)(this,n);for(var r=arguments.length,o=new Array(r),i=0;i=1&&t<=53}},{key:"set",value:function(e,t,n,r){return Ke(function(e,t,n){(0,i.A)(2,arguments);var r=(0,o.A)(e),a=(0,l.A)(t),s=Qe(r,n)-a;return r.setUTCDate(r.getUTCDate()-7*s),r}(e,n,r),r)}}]),n}(rr),Yr=function(e){(0,Wn.A)(n,e);var t=Qn(n);function n(){var e;(0,Zn.A)(this,n);for(var r=arguments.length,o=new Array(r),i=0;i=1&&t<=53}},{key:"set",value:function(e,t,n){return Ve(function(e,t){(0,i.A)(2,arguments);var n=(0,o.A)(e),r=(0,l.A)(t),a=Ye(n)-r;return n.setUTCDate(n.getUTCDate()-7*a),n}(e,n))}}]),n}(rr),Kr=[31,28,31,30,31,30,31,31,30,31,30,31],qr=[31,29,31,30,31,30,31,31,30,31,30,31],Qr=function(e){(0,Wn.A)(n,e);var t=Qn(n);function n(){var e;(0,Zn.A)(this,n);for(var r=arguments.length,o=new Array(r),i=0;i=1&&t<=qr[r]:t>=1&&t<=Kr[r]}},{key:"set",value:function(e,t,n){return e.setUTCDate(n),e.setUTCHours(0,0,0,0),e}}]),n}(rr),Zr=function(e){(0,Wn.A)(n,e);var t=Qn(n);function n(){var e;(0,Zn.A)(this,n);for(var r=arguments.length,o=new Array(r),i=0;i=1&&t<=366:t>=1&&t<=365}},{key:"set",value:function(e,t,n){return e.setUTCMonth(0,n),e.setUTCHours(0,0,0,0),e}}]),n}(rr);function Xr(e,t,n){var r,a,s,u,c,d,f,p;(0,i.A)(2,arguments);var g=m(),h=(0,l.A)(null!==(r=null!==(a=null!==(s=null!==(u=null==n?void 0:n.weekStartsOn)&&void 0!==u?u:null==n||null===(c=n.locale)||void 0===c||null===(d=c.options)||void 0===d?void 0:d.weekStartsOn)&&void 0!==s?s:g.weekStartsOn)&&void 0!==a?a:null===(f=g.locale)||void 0===f||null===(p=f.options)||void 0===p?void 0:p.weekStartsOn)&&void 0!==r?r:0);if(!(h>=0&&h<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var v=(0,o.A)(e),y=(0,l.A)(t),b=((y%7+7)%7=0&&t<=6}},{key:"set",value:function(e,t,n,r){return(e=Xr(e,n,r)).setUTCHours(0,0,0,0),e}}]),n}(rr),eo=function(e){(0,Wn.A)(n,e);var t=Qn(n);function n(){var e;(0,Zn.A)(this,n);for(var r=arguments.length,o=new Array(r),i=0;i=0&&t<=6}},{key:"set",value:function(e,t,n,r){return(e=Xr(e,n,r)).setUTCHours(0,0,0,0),e}}]),n}(rr),to=function(e){(0,Wn.A)(n,e);var t=Qn(n);function n(){var e;(0,Zn.A)(this,n);for(var r=arguments.length,o=new Array(r),i=0;i=0&&t<=6}},{key:"set",value:function(e,t,n,r){return(e=Xr(e,n,r)).setUTCHours(0,0,0,0),e}}]),n}(rr),no=function(e){(0,Wn.A)(n,e);var t=Qn(n);function n(){var e;(0,Zn.A)(this,n);for(var r=arguments.length,o=new Array(r),i=0;i=1&&t<=7}},{key:"set",value:function(e,t,n){return e=function(e,t){(0,i.A)(2,arguments);var n=(0,l.A)(t);n%7==0&&(n-=7);var r=(0,o.A)(e),a=((n%7+7)%7<1?7:0)+n-r.getUTCDay();return r.setUTCDate(r.getUTCDate()+a),r}(e,n),e.setUTCHours(0,0,0,0),e}}]),n}(rr),ro=function(e){(0,Wn.A)(n,e);var t=Qn(n);function n(){var e;(0,Zn.A)(this,n);for(var r=arguments.length,o=new Array(r),i=0;i=1&&t<=12}},{key:"set",value:function(e,t,n){var r=e.getUTCHours()>=12;return r&&n<12?e.setUTCHours(n+12,0,0,0):r||12!==n?e.setUTCHours(n,0,0,0):e.setUTCHours(0,0,0,0),e}}]),n}(rr),lo=function(e){(0,Wn.A)(n,e);var t=Qn(n);function n(){var e;(0,Zn.A)(this,n);for(var r=arguments.length,o=new Array(r),i=0;i=0&&t<=23}},{key:"set",value:function(e,t,n){return e.setUTCHours(n,0,0,0),e}}]),n}(rr),so=function(e){(0,Wn.A)(n,e);var t=Qn(n);function n(){var e;(0,Zn.A)(this,n);for(var r=arguments.length,o=new Array(r),i=0;i=0&&t<=11}},{key:"set",value:function(e,t,n){return e.getUTCHours()>=12&&n<12?e.setUTCHours(n+12,0,0,0):e.setUTCHours(n,0,0,0),e}}]),n}(rr),uo=function(e){(0,Wn.A)(n,e);var t=Qn(n);function n(){var e;(0,Zn.A)(this,n);for(var r=arguments.length,o=new Array(r),i=0;i=1&&t<=24}},{key:"set",value:function(e,t,n){var r=n<=24?n%24:n;return e.setUTCHours(r,0,0,0),e}}]),n}(rr),co=function(e){(0,Wn.A)(n,e);var t=Qn(n);function n(){var e;(0,Zn.A)(this,n);for(var r=arguments.length,o=new Array(r),i=0;i=0&&t<=59}},{key:"set",value:function(e,t,n){return e.setUTCMinutes(n,0,0),e}}]),n}(rr),fo=function(e){(0,Wn.A)(n,e);var t=Qn(n);function n(){var e;(0,Zn.A)(this,n);for(var r=arguments.length,o=new Array(r),i=0;i=0&&t<=59}},{key:"set",value:function(e,t,n){return e.setUTCSeconds(n,0),e}}]),n}(rr),po=function(e){(0,Wn.A)(n,e);var t=Qn(n);function n(){var e;(0,Zn.A)(this,n);for(var r=arguments.length,o=new Array(r),i=0;i=1&&O<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var M=(0,l.A)(null!==(y=null!==(b=null!==(w=null!==(S=null==r?void 0:r.weekStartsOn)&&void 0!==S?S:null==r||null===(E=r.locale)||void 0===E||null===(_=E.options)||void 0===_?void 0:_.weekStartsOn)&&void 0!==w?w:I.weekStartsOn)&&void 0!==b?b:null===(T=I.locale)||void 0===T||null===(A=T.options)||void 0===A?void 0:A.weekStartsOn)&&void 0!==y?y:0);if(!(M>=0&&M<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(""===x)return""===C?(0,o.A)(n):new Date(NaN);var k,N={firstWeekContainsDate:O,weekStartsOn:M,locale:R},P=[new nr],L=x.match(wo).map((function(e){var t=e[0];return t in lt?(0,lt[t])(e,R.formatLong):e})).join("").match(bo),j=[],F=Gn(L);try{var B=function(){var t=k.value;null!=r&&r.useAdditionalWeekYearTokens||!dt(t)||ft(t,x,e),null!=r&&r.useAdditionalDayOfYearTokens||!ct(t)||ft(t,x,e);var n=t[0],o=yo[n];if(o){var i=o.incompatibleTokens;if(Array.isArray(i)){var a=j.find((function(e){return i.includes(e.token)||e.token===n}));if(a)throw new RangeError("The format string mustn't contain `".concat(a.fullToken,"` and `").concat(t,"` at the same time"))}else if("*"===o.incompatibleTokens&&j.length>0)throw new RangeError("The format string mustn't contain `".concat(t,"` and any other token at the same time"));j.push({token:n,fullToken:t});var l=o.run(C,t,R.match,N);if(!l)return{v:new Date(NaN)};P.push(l.setter),C=l.rest}else{if(n.match(To))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");if("''"===t?t="'":"'"===n&&(t=t.match(So)[1].replace(Eo,"'")),0!==C.indexOf(t))return{v:new Date(NaN)};C=C.slice(t.length)}};for(F.s();!(k=F.n()).done;){var U=B();if("object"===(0,D.A)(U))return U.v}}catch(e){F.e(e)}finally{F.f()}if(C.length>0&&_o.test(C))return new Date(NaN);var $=P.map((function(e){return e.priority})).sort((function(e,t){return t-e})).filter((function(e,t,n){return n.indexOf(e)===t})).map((function(e){return P.filter((function(t){return t.priority===e})).sort((function(e,t){return t.subPriority-e.subPriority}))})).map((function(e){return e[0]})),H=(0,o.A)(n);if(isNaN(H.getTime()))return new Date(NaN);var z,G=Ge(H,(0,q.A)(H)),V={},W=Gn($);try{for(W.s();!(z=W.n()).done;){var Y=z.value;if(!Y.validate(G,N))return new Date(NaN);var K=Y.set(G,V,N);Array.isArray(K)?(G=K[0],xt(V,K[1])):G=K}}catch(e){W.e(e)}finally{W.f()}return G}function Co(e,t,n){return(0,i.A)(2,arguments),W(Ao(e,t,new Date,n))}function xo(e){return(0,i.A)(1,arguments),1===(0,o.A)(e).getDay()}function Io(e){return(0,i.A)(1,arguments),(0,o.A)(e).getTime()=r&&n<=a}function ei(e,t){(0,i.A)(2,arguments);var n=(0,l.A)(t);return(0,d.A)(e,-n)}function ti(e){return(0,i.A)(1,arguments),G(e,ei(Date.now(),1))}function ni(e){(0,i.A)(1,arguments);var t=(0,o.A)(e),n=t.getFullYear(),r=9+10*Math.floor(n/10);return t.setFullYear(r+1,0,0),t.setHours(0,0,0,0),t}function ri(e,t){var n,r,a,s,u,c,d,f;(0,i.A)(1,arguments);var p=m(),g=(0,l.A)(null!==(n=null!==(r=null!==(a=null!==(s=null==t?void 0:t.weekStartsOn)&&void 0!==s?s:null==t||null===(u=t.locale)||void 0===u||null===(c=u.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==a?a:p.weekStartsOn)&&void 0!==r?r:null===(d=p.locale)||void 0===d||null===(f=d.options)||void 0===f?void 0:f.weekStartsOn)&&void 0!==n?n:0);if(!(g>=0&&g<=6))throw new RangeError("weekStartsOn must be between 0 and 6");var h=(0,o.A)(e),v=h.getDay(),y=6+(v2)return n;if(/:/.test(r[0])?t=r[0]:(n.date=r[0],t=r[1],ki.timeZoneDelimiter.test(n.date)&&(n.date=e.split(ki.timeZoneDelimiter)[0],t=e.substr(n.date.length,e.length))),t){var o=ki.timezone.exec(t);o?(n.time=t.replace(o[1],""),n.timezone=o[1]):n.time=t}return n}(e);if(a.date){var s=function(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};var o=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:null===i?o:100*i,restDateString:e.slice((r[1]||r[2]).length)}}(a.date,r);o=function(e,t){if(null===t)return new Date(NaN);var n=e.match(Di);if(!n)return new Date(NaN);var r=!!n[4],o=Li(n[1]),i=Li(n[2])-1,a=Li(n[3]),l=Li(n[4]),s=Li(n[5])-1;if(r)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,l,s)?function(e,t,n){var r=new Date(0);r.setUTCFullYear(e,0,4);var o=7*(t-1)+n+1-(r.getUTCDay()||7);return r.setUTCDate(r.getUTCDate()+o),r}(t,l,s):new Date(NaN);var u=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(Fi[t]||(Bi(e)?29:28))}(t,i,a)&&function(e,t){return t>=1&&t<=(Bi(e)?366:365)}(t,o)?(u.setUTCFullYear(t,i,Math.max(o,a)),u):new Date(NaN)}(s.restDateString,s.year)}if(!o||isNaN(o.getTime()))return new Date(NaN);var u,c=o.getTime(),d=0;if(a.time&&(d=function(e){var t=e.match(Ni);if(!t)return NaN;var n=ji(t[1]),r=ji(t[2]),o=ji(t[3]);return function(e,t,n){return 24===e?0===t&&0===n:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,r,o)?n*$.s0+r*$.Cg+1e3*o:NaN}(a.time),isNaN(d)))return new Date(NaN);if(!a.timezone){var f=new Date(c+d),p=new Date(0);return p.setFullYear(f.getUTCFullYear(),f.getUTCMonth(),f.getUTCDate()),p.setHours(f.getUTCHours(),f.getUTCMinutes(),f.getUTCSeconds(),f.getUTCMilliseconds()),p}return u=function(e){if("Z"===e)return 0;var t=e.match(Pi);if(!t)return 0;var n="+"===t[1]?-1:1,r=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;return function(e,t){return t>=0&&t<=59}(0,o)?n*(r*$.s0+o*$.Cg):NaN}(a.timezone),isNaN(u)?new Date(NaN):new Date(c+d+u)}var ki={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Di=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Ni=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Pi=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Li(e){return e?parseInt(e):1}function ji(e){return e&&parseFloat(e.replace(",","."))||0}var Fi=[31,null,31,30,31,30,31,31,30,31,30,31];function Bi(e){return e%400==0||e%4==0&&e%100!=0}function Ui(e){if((0,i.A)(1,arguments),"string"==typeof e){var t=e.match(/(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(?:\.(\d{0,7}))?(?:Z|(.)(\d{2}):?(\d{2})?)?/);return t?new Date(Date.UTC(+t[1],+t[2]-1,+t[3],+t[4]-(+t[9]||0)*("-"==t[8]?-1:1),+t[5]-(+t[10]||0)*("-"==t[8]?-1:1),+t[6],+((t[7]||"0")+"00").substring(0,3))):new Date(NaN)}return(0,o.A)(e)}function $i(e,t){(0,i.A)(2,arguments);var n=Jt(e)-t;return n<=0&&(n+=7),ei(e,n)}function Hi(e){return(0,i.A)(1,arguments),$i(e,5)}function zi(e){return(0,i.A)(1,arguments),$i(e,1)}function Gi(e){return(0,i.A)(1,arguments),$i(e,6)}function Vi(e){return(0,i.A)(1,arguments),$i(e,0)}function Wi(e){return(0,i.A)(1,arguments),$i(e,4)}function Yi(e){return(0,i.A)(1,arguments),$i(e,2)}function Ki(e){return(0,i.A)(1,arguments),$i(e,3)}function qi(e){return(0,i.A)(1,arguments),Math.floor(e*$.rI)}function Qi(e){(0,i.A)(1,arguments);var t=e/$.gs;return Math.floor(t)}function Zi(e,t){var n;if(arguments.length<1)throw new TypeError("1 argument required, but only none provided present");var r=(0,l.A)(null!==(n=null==t?void 0:t.nearestTo)&&void 0!==n?n:1);if(r<1||r>30)throw new RangeError("`options.nearestTo` must be between 1 and 30");var i=(0,o.A)(e),a=i.getSeconds(),s=i.getMinutes()+a/60,u=(0,de.u)(null==t?void 0:t.roundingMethod)(s/r)*r,c=s%r,d=Math.round(c/r)*r;return new Date(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),u+d)}function Xi(e){(0,i.A)(1,arguments);var t=e/$.tF;return Math.floor(t)}function Ji(e){return(0,i.A)(1,arguments),e*$._m}function ea(e){(0,i.A)(1,arguments);var t=e/$.bF;return Math.floor(t)}function ta(e,t){(0,i.A)(2,arguments);var n=(0,o.A)(e),r=(0,l.A)(t),a=n.getFullYear(),s=n.getDate(),u=new Date(0);u.setFullYear(a,r,15),u.setHours(0,0,0,0);var c=tn(u);return n.setMonth(r,Math.min(s,c)),n}function na(e,t){if((0,i.A)(2,arguments),"object"!==(0,D.A)(t)||null===t)throw new RangeError("values parameter must be an object");var n=(0,o.A)(e);return isNaN(n.getTime())?new Date(NaN):(null!=t.year&&n.setFullYear(t.year),null!=t.month&&(n=ta(n,t.month)),null!=t.date&&n.setDate((0,l.A)(t.date)),null!=t.hours&&n.setHours((0,l.A)(t.hours)),null!=t.minutes&&n.setMinutes((0,l.A)(t.minutes)),null!=t.seconds&&n.setSeconds((0,l.A)(t.seconds)),null!=t.milliseconds&&n.setMilliseconds((0,l.A)(t.milliseconds)),n)}function ra(e,t){(0,i.A)(2,arguments);var n=(0,o.A)(e),r=(0,l.A)(t);return n.setDate(r),n}function oa(e,t,n){var r,a,s,u,c,f,p,g;(0,i.A)(2,arguments);var h=m(),v=(0,l.A)(null!==(r=null!==(a=null!==(s=null!==(u=null==n?void 0:n.weekStartsOn)&&void 0!==u?u:null==n||null===(c=n.locale)||void 0===c||null===(f=c.options)||void 0===f?void 0:f.weekStartsOn)&&void 0!==s?s:h.weekStartsOn)&&void 0!==a?a:null===(p=h.locale)||void 0===p||null===(g=p.options)||void 0===g?void 0:g.weekStartsOn)&&void 0!==r?r:0);if(!(v>=0&&v<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var y=(0,o.A)(e),b=(0,l.A)(t),w=y.getDay(),S=7-v,E=b<0||b>6?b-(w+S)%7:((b%7+7)%7+S)%7-(w+S)%7;return(0,d.A)(y,E)}function ia(e,t){(0,i.A)(2,arguments);var n=(0,o.A)(e),r=(0,l.A)(t);return n.setMonth(0),n.setDate(r),n}function aa(e){(0,i.A)(1,arguments);var t={},n=m();for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(void 0===e[o]?delete t[o]:t[o]=e[o]);v(t)}function la(e,t){(0,i.A)(2,arguments);var n=(0,o.A)(e),r=(0,l.A)(t);return n.setHours(r),n}function sa(e,t){(0,i.A)(2,arguments);var n=(0,o.A)(e),r=(0,l.A)(t)-sn(n);return(0,d.A)(n,r)}function ua(e,t){(0,i.A)(2,arguments);var n=(0,o.A)(e),r=(0,l.A)(t),a=cn(n)-r;return n.setDate(n.getDate()-7*a),n}function ca(e,t){(0,i.A)(2,arguments);var n=(0,o.A)(e),r=(0,l.A)(t);return n.setMilliseconds(r),n}function da(e,t){(0,i.A)(2,arguments);var n=(0,o.A)(e),r=(0,l.A)(t);return n.setMinutes(r),n}function fa(e,t){(0,i.A)(2,arguments);var n=(0,o.A)(e),r=(0,l.A)(t)-(Math.floor(n.getMonth()/3)+1);return ta(n,n.getMonth()+3*r)}function pa(e,t){(0,i.A)(2,arguments);var n=(0,o.A)(e),r=(0,l.A)(t);return n.setSeconds(r),n}function ga(e,t,n){(0,i.A)(2,arguments);var r=(0,o.A)(e),a=(0,l.A)(t),s=Tn(r,n)-a;return r.setDate(r.getDate()-7*s),r}function ha(e,t,n){var r,a,s,u,c,d,f,p;(0,i.A)(2,arguments);var g=m(),h=(0,l.A)(null!==(r=null!==(a=null!==(s=null!==(u=null==n?void 0:n.firstWeekContainsDate)&&void 0!==u?u:null==n||null===(c=n.locale)||void 0===c||null===(d=c.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==s?s:g.firstWeekContainsDate)&&void 0!==a?a:null===(f=g.locale)||void 0===f||null===(p=f.options)||void 0===p?void 0:p.firstWeekContainsDate)&&void 0!==r?r:1),v=(0,o.A)(e),y=(0,l.A)(t),b=(0,E.A)(v,En(v,n)),w=new Date(0);return w.setFullYear(y,0,h),w.setHours(0,0,0,0),(v=En(w,n)).setDate(v.getDate()+b),v}function ma(e,t){(0,i.A)(2,arguments);var n=(0,o.A)(e),r=(0,l.A)(t);return isNaN(n.getTime())?new Date(NaN):(n.setFullYear(r),n)}function va(e){(0,i.A)(1,arguments);var t=(0,o.A)(e),n=t.getFullYear(),r=10*Math.floor(n/10);return t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}function ya(){return(0,z.A)(Date.now())}function ba(){var e=new Date,t=e.getFullYear(),n=e.getMonth(),r=e.getDate(),o=new Date(0);return o.setFullYear(t,n,r+1),o.setHours(0,0,0,0),o}function wa(){var e=new Date,t=e.getFullYear(),n=e.getMonth(),r=e.getDate(),o=new Date(0);return o.setFullYear(t,n,r-1),o.setHours(0,0,0,0),o}function Sa(e,t){(0,i.A)(2,arguments);var n=(0,l.A)(t);return(0,x.A)(e,-n)}function Ea(e,t){if((0,i.A)(2,arguments),!t||"object"!==(0,D.A)(t))return new Date(NaN);var n=t.years?(0,l.A)(t.years):0,r=t.months?(0,l.A)(t.months):0,o=t.weeks?(0,l.A)(t.weeks):0,a=t.days?(0,l.A)(t.days):0,s=t.hours?(0,l.A)(t.hours):0,u=t.minutes?(0,l.A)(t.minutes):0,c=t.seconds?(0,l.A)(t.seconds):0,d=ei(Sa(e,r+12*n),a+7*o),f=1e3*(c+60*(u+60*s));return new Date(d.getTime()-f)}function _a(e,t){return(0,i.A)(2,arguments),c(e,-(0,l.A)(t))}function Ta(e,t){return(0,i.A)(2,arguments),g(e,-(0,l.A)(t))}function Aa(e,t){return(0,i.A)(2,arguments),C(e,-(0,l.A)(t))}function Ca(e,t){return(0,i.A)(2,arguments),I(e,-(0,l.A)(t))}function xa(e,t){return(0,i.A)(2,arguments),R(e,-(0,l.A)(t))}function Ia(e,t){return(0,i.A)(2,arguments),O(e,-(0,l.A)(t))}function Ra(e,t){return(0,i.A)(2,arguments),M(e,-(0,l.A)(t))}function Oa(e){return(0,i.A)(1,arguments),Math.floor(e*$.h)}function Ma(e){return(0,i.A)(1,arguments),Math.floor(e*$.e8)}function ka(e){return(0,i.A)(1,arguments),Math.floor(e*$.gs)}},41454:(e,t,n)=>{"use strict";n.d(t,{default:()=>p});var r=n(6982),o=n(93165),i=n(89045),a=n(43253),l=n(53303),s=n(21897),u=n(90063),c=n(74952),d=n(10123),f=n(70551);function p(e){(0,f.A)(1,arguments);var t=(0,d.A)(e.start),n=(0,d.A)(e.end);if(isNaN(t.getTime()))throw new RangeError("Start Date is invalid");if(isNaN(n.getTime()))throw new RangeError("End Date is invalid");var p={};p.years=Math.abs((0,c.A)(n,t));var g=(0,r.A)(n,t),h=(0,o.A)(t,{years:g*p.years});p.months=Math.abs((0,s.A)(n,h));var m=(0,o.A)(h,{months:g*p.months});p.days=Math.abs((0,i.A)(n,m));var v=(0,o.A)(m,{days:g*p.days});p.hours=Math.abs((0,a.A)(n,v));var y=(0,o.A)(v,{hours:g*p.hours});p.minutes=Math.abs((0,l.A)(n,y));var b=(0,o.A)(y,{minutes:g*p.minutes});return p.seconds=Math.abs((0,u.A)(n,b)),p}},22613:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(10123),o=n(66212),i=n(19312),a=n(70551);function l(e){(0,a.A)(1,arguments);var t=(0,r.A)(e);return(0,o.A)(t).getTime()===(0,i.A)(t).getTime()}},31127:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(10123),o=n(70551);function i(e){(0,o.A)(1,arguments);var t=(0,r.A)(e);return t.setHours(0,0,0,0),t}},10123:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(82284),o=n(70551);function i(e){(0,o.A)(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===(0,r.A)(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}},45228:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,o){for(var i,a,l=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),s=1;s{"use strict";var r=n(6925);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},5556:(e,t,n)=>{e.exports=n(2694)()},6925:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},14116:(e,t,n)=>{"use strict";n.r(t),n.d(t,{borderBoxWarn:()=>l,default:()=>s,observerErr:()=>a});var r=n(96540);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t=t&&t>g&&(p=e,g=t)})),p),y.currentBreakpoint!==v.current&&(S.current&&S.current(y),v.current=y.currentBreakpoint)):S.current&&S.current(y);var w={currentBreakpoint:y.currentBreakpoint,width:a,height:c,entry:r};E.current&&!E.current(w)||(!E.current&&s&&u?h((function(e){return e.currentBreakpoint!==w.currentBreakpoint?w:e})):h(w))}}))})),T(),function(){_(),e&&cancelAnimationFrame(e)}}),[JSON.stringify(s),n,T,_,u]),o({},g,{observe:T,unobserve:_})}},22551:(e,t,n)=>{"use strict";var r=n(96540),o=n(69982);function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n