# 23 — Android, desktop, iOS and browser hosts

Prerequisites: common contracts; implement platform actuals throughout earlier chapters. [Host file workbook](../reference/23-files.md) · [all expect/actual declarations](../reference/platform-boundaries.md). Feature-specific actual files are indexed in their feature chapters, not duplicated here.

[chapter-content-start]: #
## How to write this chapter

Connect the shared application to Android, desktop, iOS and browser entry points. This chapter contains host-owned files; feature-specific actuals remain in their teaching chapters and are required alongside these hosts.

The 36 assigned entries are integrated below at their implementation steps. Every text listing is complete, including imports, helpers and tests. Create the displayed paths in your new project; dependencies imported from other chapters are linked beside the file. Binary assets have direct downloads.

Read each step’s explanation, write its contracts and implementation, then trace the test assertions. The final application graph has dependencies across chapters: the ordering is a construction plan, and a step is not a promise that the whole app compiles before its referenced contracts exist.

Implementation sequence:

- Step 1: Build Android application/activity context, manifest and entry actions.
- Step 2: Create desktop main/window lifecycle and native host integration.
- Step 3: Provide Kotlin/Native controller and framework interop declarations.
- Step 4: Build SwiftUI/Xcode host, native bridges and runtime preparation.
- Step 5: Create browser viewport, resources and storage/startup integration.
- Step 6: Audit every host/feature capability and source-set actual.
- Verification: recreate the full test/fixture listings and run the relevant target tasks.
[chapter-content-end]: #


## Step 1: Android host

Create the application module and merged manifests. `YokanApplication` supplies process context and background/download host entry points. `MainActivity` provides foreground activity/window state, edge-to-edge Compose content, intents/deep links and platform playback integration. Recreate launcher aliases/icons, TV banner, static shortcuts, file-provider paths and requested permissions from the manifests.

Implement Room paths, SAF/file pickers, WorkManager jobs, download foreground service, notifications, secure screen/app lock, brightness/system bars, PiP/external player, TTS, native image transforms, WebViews/cookies, package installer and extension adapter. Keep activity-dependent operations separate from background context. Preserve task ownership IDs across process death and clear stale foreground activity references.

Validate media/file/deep-link behavior with actual Android API levels; compilation alone cannot prove notification permissions, background restart, Surface lifecycle or SAF grants.

[chapter-content-start]: #
### Follow the code

The application establishes process context before workers or activities need it. The activity owns foreground/window/intent/Compose integration and clears stale activity references on destruction. Manifests bind real classes, authorities, permissions and entry actions; resource names must match chapter 26. Background/download entry points use recorded profile ownership rather than a foreground singleton.

Write these files in this order:

- `composeApp/src/androidMain/kotlin/eu/friedcutlet/yokan/AndroidAppContext.kt`
- `composeApp/src/androidMain/kotlin/eu/friedcutlet/yokan/MainActivity.kt`
- `androidApp/src/main/AndroidManifest.xml`
- `composeApp/src/androidMain/AndroidManifest.xml`

[chapter-file-start]: #composeApp/src/androidMain/kotlin/eu/friedcutlet/yokan/AndroidAppContext.kt
### Write `composeApp/src/androidMain/kotlin/eu/friedcutlet/yokan/AndroidAppContext.kt`

Create this path in your reconstruction project. Source set: **androidMain**. [Exact file download](../reference/source/composeApp/src/androidMain/kotlin/eu/friedcutlet/yokan/AndroidAppContext.kt).

The application context is process-wide and initialized before background entry points. Foreground activity references have a shorter lifetime and must not be used as a universal worker context.

The implementation below defines `AndroidAppContext`, `AndroidForegroundActivity`, `YokanApplication`, `onCreate`, `runBackgroundTask`, `runBackgroundDownloads`.

The source describes its contract as:

> Process-wide application \[Context\], set by \[YokanApplication\] before any component (activity, WorkManager worker, receiver) runs.

Cross-chapter imports used by this file: [`YokanRuntime`](../chapters/04-profiles-and-lifetimes.md), [`ProfileWorkResult`](../chapters/24-settings-and-integrations.md), [`DownloadService`](../chapters/13-downloads-and-processing.md), [`DownloadTaskHost`](../chapters/13-downloads-and-processing.md), [`BackgroundTaskHost`](../chapters/24-settings-and-integrations.md), [`PeriodicTaskRunner`](../chapters/24-settings-and-integrations.md). Keep those contracts available as you connect this step.

```kotlin
package eu.friedcutlet.yokan

import android.app.Activity
import android.app.Application
import android.content.Context
import eu.friedcutlet.yokan.app.YokanRuntime
import eu.friedcutlet.yokan.services.scheduling.ProfileWorkResult
import eu.friedcutlet.yokan.services.download.DownloadService
import eu.friedcutlet.yokan.services.download.DownloadTaskHost
import eu.friedcutlet.yokan.services.scheduling.BackgroundTaskHost
import eu.friedcutlet.yokan.services.scheduling.PeriodicTaskRunner
import eu.friedcutlet.yokan.services.scheduling.PeriodicTaskOutcome

/**
 * Process-wide application [Context], set by [YokanApplication] before any
 * component (activity, WorkManager worker, receiver) runs.
 */
object AndroidAppContext {
    @Volatile var appContext: Context? = null
}

/**
 * The currently resumed-or-created [MainActivity], for APIs that need an
 * activity window (system bars, permission prompts). Cleared in `onDestroy`.
 */
object AndroidForegroundActivity {
    @Volatile var activity: Activity? = null
}

class YokanApplication : Application(), BackgroundTaskHost, DownloadTaskHost {
    override fun onCreate() {
        super.onCreate()
        AndroidAppContext.appContext = applicationContext
    }

    override suspend fun runBackgroundTask(
        owner: String?,
        task: suspend PeriodicTaskRunner.() -> PeriodicTaskOutcome,
    ): ProfileWorkResult<PeriodicTaskOutcome> = YokanRuntime.runBackgroundTask(owner, allowLegacyDefault = true, task = task)

    override suspend fun runBackgroundDownloads(
        owner: String?,
        task: suspend DownloadService.() -> Unit,
    ): ProfileWorkResult<Unit> = YokanRuntime.runBackgroundDownloads(owner, allowLegacyDefault = true, task = task)
}
```
[chapter-file-end]: #

[chapter-file-start]: #composeApp/src/androidMain/kotlin/eu/friedcutlet/yokan/MainActivity.kt
### Write `composeApp/src/androidMain/kotlin/eu/friedcutlet/yokan/MainActivity.kt`

Create this path in your reconstruction project. Source set: **androidMain**. [Exact file download](../reference/source/composeApp/src/androidMain/kotlin/eu/friedcutlet/yokan/MainActivity.kt).

The implementation below defines `MainActivity`, `onCreate`, `onDestroy`, `onUserLeaveHint`, `onPictureInPictureModeChanged`, `onNewIntent`, `Intent.deepLink`, `systemIntentLink`.

The source describes its contract as:

> Shared text, system/assistant search and text selection open global search; everything else is a VIEW link.

Cross-chapter imports used by this file: [`AndroidBootstrapState`](../chapters/04-profiles-and-lifetimes.md), [`AppDeepLinks`](../chapters/24-settings-and-integrations.md), [`registerFolderPickerLauncher`](../chapters/12-local-library.md), [`AndroidPictureInPictureController`](../chapters/16-anime-player.md), [`AndroidAppLockBridge`](../chapters/24-settings-and-integrations.md), [`applySystemBarTheme`](../chapters/10-navigation-and-design-system.md). Keep those contracts available as you connect this step.

```kotlin
package eu.friedcutlet.yokan

import android.app.Activity
import android.content.Intent
import android.app.SearchManager
import android.content.res.Configuration
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.activity.result.contract.ActivityResultContracts
import eu.friedcutlet.yokan.app.AndroidBootstrapState
import eu.friedcutlet.yokan.services.system.AppDeepLinks
import eu.friedcutlet.yokan.services.files.registerFolderPickerLauncher
import eu.friedcutlet.yokan.services.media.player.AndroidPictureInPictureController
import eu.friedcutlet.yokan.services.applock.AndroidAppLockBridge
import eu.friedcutlet.yokan.ui.theme.applySystemBarTheme
import eu.friedcutlet.yokan.ui.YokanApp
import eu.friedcutlet.yokan.ui.navigation.searchDeepLink

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        AndroidPictureInPictureController.attach(this)
        // Edge-to-edge from the very first frame; the common Compose layer
        // (Scaffold contentWindowInsets) consumes the insets.
        // Icon contrast is re-synced with the in-app theme by
        // applySystemBarTheme() once Compose resolves dark mode.
        enableEdgeToEdge()
        AndroidForegroundActivity.activity = this
        registerFolderPickerLauncher(this)
        val credentialLauncher = registerForActivityResult(
            ActivityResultContracts.StartActivityForResult(),
        ) { result ->
            AndroidAppLockBridge.deliverResult(result.resultCode == Activity.RESULT_OK)
        }
        AndroidAppLockBridge.launch = { intent ->
            runCatching { credentialLauncher.launch(intent) }.isSuccess
        }
        AndroidBootstrapState.initialDeepLink = intent?.deepLink()
        setContent {
            YokanApp()
        }
    }

    override fun onDestroy() {
        AndroidPictureInPictureController.detach(this)
        if (AndroidForegroundActivity.activity === this) {
            AndroidForegroundActivity.activity = null
            AndroidAppLockBridge.launch = null
        }
        super.onDestroy()
    }

    override fun onUserLeaveHint() {
        AndroidPictureInPictureController.onUserLeaveHint(this)
        super.onUserLeaveHint()
    }

    override fun onPictureInPictureModeChanged(
        isInPictureInPictureMode: Boolean,
        newConfig: Configuration,
    ) {
        super.onPictureInPictureModeChanged(isInPictureInPictureMode, newConfig)
        AndroidPictureInPictureController.onPictureInPictureModeChanged(this, isInPictureInPictureMode)
    }

    override fun onNewIntent(intent: Intent) {
        super.onNewIntent(intent)
        setIntent(intent)
        val link = intent.deepLink()
        AndroidBootstrapState.initialDeepLink = link
        AppDeepLinks.dispatch(link)
    }
}

private fun Intent.deepLink(): String? = systemIntentLink(action, dataString) { getCharSequenceExtra(it)?.toString() }

/** Shared text, system/assistant search and text selection open global search; everything else is a VIEW link. */
internal fun systemIntentLink(action: String?, dataString: String?, extra: (String) -> String?): String? = when (action) {
    Intent.ACTION_SEND -> extra(Intent.EXTRA_TEXT)
    Intent.ACTION_SEARCH, Intent.ACTION_WEB_SEARCH, GMS_SEARCH_ACTION -> extra(SearchManager.QUERY)
    Intent.ACTION_PROCESS_TEXT -> extra(Intent.EXTRA_PROCESS_TEXT)
    else -> return dataString
}?.trim()?.takeIf(String::isNotEmpty)?.let { searchDeepLink(it) }

private const val GMS_SEARCH_ACTION = "com.google.android.gms.actions.SEARCH_ACTION"
```
[chapter-file-end]: #

[chapter-file-start]: #androidApp/src/main/AndroidManifest.xml
### Write `androidApp/src/main/AndroidManifest.xml`

Create this path in your reconstruction project. Source set: **main**. [Exact file download](../reference/source/androidApp/src/main/AndroidManifest.xml).

```xml
<?xml version="1.0" encoding="utf-8"?>
<!-- The application, activities and permissions come from composeApp/src/androidMain/AndroidManifest.xml. -->
<manifest />
```
[chapter-file-end]: #

[chapter-file-start]: #composeApp/src/androidMain/AndroidManifest.xml
### Write `composeApp/src/androidMain/AndroidManifest.xml`

Create this path in your reconstruction project. Source set: **androidMain**. [Exact file download](../reference/source/composeApp/src/androidMain/AndroidManifest.xml).

```xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <uses-feature android:name="android.software.leanback" android:required="false" />
    <uses-feature android:name="android.hardware.touchscreen" android:required="false" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />

    <queries>
        <intent>
            <action android:name="android.intent.action.VIEW" />
            <data android:mimeType="video/*" />
        </intent>
    </queries>

    <application
        android:name=".YokanApplication"
        android:allowBackup="true"
        android:banner="@drawable/tv_banner"
        android:icon="@mipmap/ic_launcher"
        android:roundIcon="@mipmap/ic_launcher"
        android:label="Yokan"
        android:largeHeap="true"
        android:theme="@style/AppTheme"
        android:resizeableActivity="true"
        android:usesCleartextTraffic="true">
        <activity
            android:name=".MainActivity"
            android:configChanges="orientation|screenSize|screenLayout|keyboardHidden|keyboard|smallestScreenSize|density|uiMode"
            android:exported="true"
            android:supportsPictureInPicture="true"
            android:launchMode="singleTop">

            <intent-filter android:label="Add source repository">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="yokan" android:host="add-repo" />
            </intent-filter>
            <intent-filter android:label="Add custom button">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="yokan" android:host="add-button" />
            </intent-filter>
            <!-- Mihon/Tachiyomi (manga) and Aniyomi/Animetail (anime) repository links, as Animetail registers them. -->
            <intent-filter android:label="Add extension repository">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="tachiyomi" />
                <data android:scheme="mihon" />
                <data android:scheme="aniyomi" />
                <data android:scheme="animetail" />
                <data android:host="add-repo" />
                <data android:host="extension-store" />
            </intent-filter>
            <intent-filter android:label="Search in Yokan">
                <action android:name="android.intent.action.SEND" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="text/plain" />
            </intent-filter>
            <intent-filter android:label="Search in Yokan">
                <action android:name="android.intent.action.PROCESS_TEXT" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="text/plain" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.SEARCH" />
                <action android:name="android.intent.action.WEB_SEARCH" />
                <action android:name="com.google.android.gms.actions.SEARCH_ACTION" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <!-- Backup files. PatternMatcher cannot skip earlier dots, so each depth is listed (https://stackoverflow.com/a/31028507). -->
            <intent-filter android:label="Restore backup">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="file" />
                <data android:scheme="content" />
                <data android:host="*" />
                <data android:mimeType="*/*" />
                <data android:pathPattern=".*\\.tachibk" />
                <data android:pathPattern=".*\\..*\\.tachibk" />
                <data android:pathPattern=".*\\..*\\..*\\.tachibk" />
                <data android:pathPattern=".*\\..*\\..*\\..*\\.tachibk" />
                <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.tachibk" />
                <data android:pathPattern=".*\\.proto\\.gz" />
                <data android:pathPattern=".*\\..*\\.proto\\.gz" />
                <data android:pathPattern=".*\\..*\\..*\\.proto\\.gz" />
                <data android:pathPattern=".*\\..*\\..*\\..*\\.proto\\.gz" />
                <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.proto\\.gz" />
                <data android:pathPattern=".*\\.backup" />
                <data android:pathPattern=".*\\..*\\.backup" />
                <data android:pathPattern=".*\\..*\\..*\\.backup" />
                <data android:pathPattern=".*\\..*\\..*\\..*\\.backup" />
                <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.backup" />
                <data android:pathPattern=".*\\.yokanbak" />
                <data android:pathPattern=".*\\..*\\.yokanbak" />
                <data android:pathPattern=".*\\..*\\..*\\.yokanbak" />
                <data android:pathPattern=".*\\..*\\..*\\..*\\.yokanbak" />
                <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.yokanbak" />
            </intent-filter>
            <intent-filter android:label="Tracker callback">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="yokan" />
            </intent-filter>
        </activity>
        <activity-alias
            android:name=".LauncherDefault"
            android:targetActivity=".MainActivity"
            android:enabled="true"
            android:exported="true"
            android:icon="@mipmap/ic_launcher"
            android:label="Yokan">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
                <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
            </intent-filter>
            <meta-data android:name="android.app.shortcuts" android:resource="@xml/shortcuts" />
        </activity-alias>
        <activity-alias
            android:name=".LauncherToriiLight"
            android:targetActivity=".MainActivity"
            android:enabled="false"
            android:exported="true"
            android:icon="@mipmap/ic_launcher_torii_light"
            android:label="Yokan">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
                <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
            </intent-filter>
            <meta-data android:name="android.app.shortcuts" android:resource="@xml/shortcuts" />
        </activity-alias>
        <activity-alias
            android:name=".LauncherToriiDark"
            android:targetActivity=".MainActivity"
            android:enabled="false"
            android:exported="true"
            android:icon="@mipmap/ic_launcher_torii_dark"
            android:label="Yokan">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
                <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
            </intent-filter>
            <meta-data android:name="android.app.shortcuts" android:resource="@xml/shortcuts" />
        </activity-alias>
        <provider
            android:name="androidx.core.content.FileProvider"
            android:authorities="${applicationId}.fileprovider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/file_paths" />
        </provider>
        <service
            android:name=".services.download.DownloadForegroundService"
            android:exported="false"
            android:foregroundServiceType="dataSync" />
    </application>
</manifest>
```
[chapter-file-end]: #

### Check your understanding

Launch via icon, deep link, backup file and background worker without an existing activity. Identify which operations require application context and which require a live window.
[chapter-content-end]: #


## Step 2: desktop host

Create the desktop `main` and window/tray integration, bootstrap path, launch-argument/open-file/open-URI handlers and app data roots. Supply JVM-common services plus desktop-specific JavaFX browser, media native loading, file dialogs, notifications, Discord IPC, network/device conditions, TorrServer host and package installer.

Keep UI dispatchers distinct from blocking I/O and native initialization. Bundle host-specific JavaFX and ONNX native artifacts; the Intel macOS ONNX pin differs because newer packages dropped that JNI binary. Reproduce app runtime JVM selection and packaging icons. Linux mpv depends on system installation and may select compatibility fallback. Desktop file association and protocol behavior differ by OS; do not claim jpackage installs every custom URL protocol on Linux/Windows.

[chapter-content-start]: #
### Follow the code

Desktop startup resolves app data, arguments/open-file/open-URI events and a shared runtime. Window/tray lifetime is distinct from blocking native/network initialization. Configure bundled JavaFX/ONNX/native resources for the actual OS/architecture. Incoming OS events enter the common deep-link/backup preview paths, while shutdown awaits the same profile/resource retirement as other hosts.

Write these files in this order:

- `composeApp/src/desktopMain/kotlin/eu/friedcutlet/yokan/Main.kt`

[chapter-file-start]: #composeApp/src/desktopMain/kotlin/eu/friedcutlet/yokan/Main.kt
### Write `composeApp/src/desktopMain/kotlin/eu/friedcutlet/yokan/Main.kt`

Create this path in your reconstruction project. Source set: **desktopMain**. [Exact file download](../reference/source/composeApp/src/desktopMain/kotlin/eu/friedcutlet/yokan/Main.kt).

The implementation below defines `configureMacOsWindowAppearance`, `installOpenHandlers`, `main`.

The source describes its contract as:

> macOS delivers registered URL schemes and associated files as app events, not arguments.

Cross-chapter imports used by this file: [`DesktopBootstrapState`](../chapters/04-profiles-and-lifetimes.md), [`YokanRuntime`](../chapters/04-profiles-and-lifetimes.md), [`DesktopAutostart`](../chapters/24-settings-and-integrations.md), [`DesktopSession`](../chapters/24-settings-and-integrations.md), [`AppDeepLinks`](../chapters/24-settings-and-integrations.md), [`YokanApp`](../chapters/10-navigation-and-design-system.md). Keep those contracts available as you connect this step.

```kotlin
package eu.friedcutlet.yokan

import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Tray
import androidx.compose.ui.window.Window
import androidx.compose.ui.window.rememberWindowState
import androidx.compose.ui.window.application
import androidx.compose.ui.window.isTraySupported
import eu.friedcutlet.yokan.app.DesktopBootstrapState
import eu.friedcutlet.yokan.app.YokanRuntime
import eu.friedcutlet.yokan.services.scheduling.DesktopAutostart
import eu.friedcutlet.yokan.services.scheduling.DesktopSession
import eu.friedcutlet.yokan.services.system.AppDeepLinks
import java.awt.Desktop
import javax.swing.SwingUtilities
import eu.friedcutlet.yokan.ui.YokanApp
import kotlinx.coroutines.launch
import org.jetbrains.compose.resources.painterResource
import yokan.composeapp.generated.resources.Res
import yokan.composeapp.generated.resources.icon_red

private fun configureMacOsWindowAppearance() {
    if (!System.getProperty("os.name").startsWith("Mac", ignoreCase = true)) return
    val settings = YokanRuntime.database.settings()
    val appearance = when {
        settings.followSystemTheme -> "system"
        settings.themeIsDark -> "NSAppearanceNameDarkAqua"
        else -> "NSAppearanceNameAqua"
    }
    System.setProperty("apple.awt.application.appearance", appearance)
}

/** macOS delivers registered URL schemes and associated files as app events, not arguments. */
private fun installOpenHandlers() {
    if (!Desktop.isDesktopSupported()) return
    val desktop = Desktop.getDesktop()
    if (desktop.isSupported(Desktop.Action.APP_OPEN_URI)) {
        desktop.setOpenURIHandler { event -> SwingUtilities.invokeLater { AppDeepLinks.dispatch(event.uri.toString()) } }
    }
    if (desktop.isSupported(Desktop.Action.APP_OPEN_FILE)) {
        desktop.setOpenFileHandler { event ->
            val file = event.files.firstOrNull() ?: return@setOpenFileHandler
            SwingUtilities.invokeLater { AppDeepLinks.dispatch(file.toURI().toString()) }
        }
    }
}

fun main(args: Array<String>) {
    DesktopBootstrapState.args = args
    installOpenHandlers()
    configureMacOsWindowAppearance()
    YokanRuntime.bootstrap()
    application {
        // The application scope sits above any window's LifecycleOwner, and it must keep
        // observing while the window is hidden in the tray, so plain collectAsState is correct.
        val closeToTray by DesktopSession.closeToTray.collectAsState()
        val trayEnabled = closeToTray && isTraySupported
        // A login item passes --tray so the scheduler runs without a window until the user asks for one.
        var windowVisible by remember { mutableStateOf(!(DesktopAutostart.TRAY_FLAG in args && trayEnabled)) }
        if (!trayEnabled) windowVisible = true
        val scope = rememberCoroutineScope()
        val icon = painterResource(Res.drawable.icon_red)
        val windowState = rememberWindowState(size = DpSize(1280.dp, 860.dp))
        if (trayEnabled) {
            Tray(
                icon = icon,
                tooltip = "Yokan",
                onAction = { windowVisible = true },
                menu = {
                    Item("Open Yokan") { windowVisible = true }
                    Item("Update library now") { scope.launch { YokanRuntime.periodicTasks.updateLibrary() } }
                    Separator()
                    Item("Quit") { exitApplication() }
                },
            )
        }
        Window(
            onCloseRequest = { if (trayEnabled) windowVisible = false else exitApplication() },
            visible = windowVisible,
            title = "Yokan",
            icon = icon,
            state = windowState,
        ) {
            DesktopSession.frame = window
            YokanApp()
        }
    }
}
```
[chapter-file-end]: #

### Check your understanding

Open a document/URI during cold startup and while an existing window is active. Verify one intended app action and joined shutdown without leftover native/background work.
[chapter-content-end]: #


## Step 3: iOS Kotlin framework

Implement MainViewController and the Kotlin/Native actuals for persistence/files, network/cookies, scheduling/notifications, media, speech, app icons/lock/security, pickers and image transforms. Recreate cinterop definitions for MihonEmbeddedBridge and PanelColorizer. Use the shared framework name `YokanShared` and correct device/simulator linking behavior.

[chapter-content-start]: #
### Follow the code

MainViewController hosts shared Compose with platform reader/system UI integration. Cinterop declarations describe host-provided native bridges; the compiled Objective-C++ implementations belong in the Xcode app, not inside common Kotlin. Preserve framework name, header signatures and device/simulator link behavior. Feature actuals for files/network/media/speech are integrated from their chapters.

Write these files in this order:

- `composeApp/src/iosMain/kotlin/eu/friedcutlet/yokan/MainViewController.kt`
- `composeApp/src/nativeInterop/cinterop/MihonEmbeddedBridge.def`
- `composeApp/src/nativeInterop/cinterop/PanelColorizer.def`

[chapter-file-start]: #composeApp/src/iosMain/kotlin/eu/friedcutlet/yokan/MainViewController.kt
### Write `composeApp/src/iosMain/kotlin/eu/friedcutlet/yokan/MainViewController.kt`

Create this path in your reconstruction project. Source set: **iosMain**. [Exact file download](../reference/source/composeApp/src/iosMain/kotlin/eu/friedcutlet/yokan/MainViewController.kt).

The implementation below defines `MainViewController`.

Cross-chapter imports used by this file: [`YokanApp`](../chapters/10-navigation-and-design-system.md). Keep those contracts available as you connect this step.

```kotlin
package eu.friedcutlet.yokan

import androidx.compose.ui.window.ComposeUIViewController
import eu.friedcutlet.yokan.ui.YokanApp

fun MainViewController() = ComposeUIViewController {
    YokanApp()
}
```
[chapter-file-end]: #

[chapter-file-start]: #composeApp/src/nativeInterop/cinterop/MihonEmbeddedBridge.def
### Write `composeApp/src/nativeInterop/cinterop/MihonEmbeddedBridge.def`

Create this path in your reconstruction project. Source set: **nativeInterop**. [Exact file download](../reference/source/composeApp/src/nativeInterop/cinterop/MihonEmbeddedBridge.def).

```text
language = Objective-C
headers = MihonEmbeddedBridge.h
package = eu.friedcutlet.yokan.embeddedmihon
compilerOpts = -fblocks
```
[chapter-file-end]: #

[chapter-file-start]: #composeApp/src/nativeInterop/cinterop/PanelColorizer.def
### Write `composeApp/src/nativeInterop/cinterop/PanelColorizer.def`

Create this path in your reconstruction project. Source set: **nativeInterop**. [Exact file download](../reference/source/composeApp/src/nativeInterop/cinterop/PanelColorizer.def).

```text
language = Objective-C
headers = PanelColorizerBridge.h
package = eu.friedcutlet.yokan.colorizerbridge
```
[chapter-file-end]: #

### Check your understanding

Compare each cinterop function with the Objective-C++ header/implementation and verify the simulator framework builds without substituting false successful native execution.
[chapter-content-end]: #


## Step 4: iOS native host

Create the SwiftUI app, AppDelegate/scene quick-action handlers and ComposeRootView wrapper. Route open URLs and startup quick actions to AppDeepLinks; wire background task completion and foreground/resume to the corresponding Kotlin/native APIs. Keep reader system UI integration in the controller wrapper.

Recreate Info.plist schemes, document types, background identifiers, orientation/capability entries and icon catalogs. The Xcode shared framework build phase calls `:composeApp:embedAndSignAppleFrameworkForXcode`. Native Objective-C++ bridges compile in the host, not the Kotlin framework. Implement embedded JVM startup/pause/resume and exported runtime symbols, Java logging shims and native colorizer bridge. Keep JNI/header ABI exact.

PrepareExtensionRuntime and the media preparation scripts obtain external device frameworks/Zero runtime/server payloads; copy/embed/link dependencies, including Lua where required. Simulator compile support does not imply the device-only native runtime can execute there. Preserve notices and architecture selection. Never replace unavailable simulator functions with a false successful result.

[chapter-content-start]: #
### Follow the code

The Swift host forwards app/scene lifecycle, URLs, quick actions and background task completion to shared APIs. Xcode build phases embed the shared framework and required device runtimes. Objective-C++ bridges own embedded JVM/media/colorization resources, and JNI/exported symbols must remain ABI-compatible. Preparation scripts select/download/verify external artifacts; copying source files alone does not supply their binaries.

Write these files in this order:

- `iosApp/YokanApp.swift`
- `iosApp/Info.plist`
- `iosApp/MihonEmbeddedBridge.h`
- `iosApp/MihonEmbeddedBridge.mm`
- `iosApp/PanelColorizerBridge.h`
- `iosApp/PanelColorizerBridge.mm`
- `iosApp/BuildSharedFramework.sh`
- `iosApp/EmbeddedMihon/OpenJDKRuntime-Info.plist`
- `iosApp/EmbeddedMihon/ios_jul_shim/java/util/logging/Level.java`
- `iosApp/EmbeddedMihon/ios_jul_shim/java/util/logging/Logger.java`
- `iosApp/EmbeddedMihon/openjdk_runtime_exports.cpp`
- `iosApp/PrepareExtensionRuntime.sh`
- `iosApp/Runner-Bridging-Header.h`
- `iosApp/iosApp.xcodeproj/project.pbxproj`
- `iosApp/iosApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved`
- `iosApp/iosApp.xcodeproj/project.xcworkspace/xcuserdata/duongph.xcuserdatad/UserInterfaceState.xcuserstate`
- `iosApp/iosApp.xcodeproj/xcshareddata/xcschemes/iosApp.xcscheme`
- `iosApp/iosApp.xcodeproj/xcuserdata/duongph.xcuserdatad/xcschemes/xcschememanagement.plist`

[chapter-file-start]: #iosApp/YokanApp.swift
### Write `iosApp/YokanApp.swift`

Create this path in your reconstruction project. Source set: **build / host / supporting material**. [Exact file download](../reference/source/iosApp/YokanApp.swift).

The native host connects OS lifecycle and entry actions to shared Kotlin APIs. Keep URL/quick-action handling and task completion in the actual host lifecycle, not a synthetic Compose callback.

The implementation below defines `ReaderSystemUiViewController`, `AppDelegate`, `QuickActionSceneDelegate`.

```swift
import SwiftUI
import UIKit
import YokanShared

final class ReaderSystemUiViewController: UIViewController {
    private let contentController: UIViewController
    private var readerFullscreen = false
    private var appIsDark = false

    init(contentController: UIViewController) {
        self.contentController = contentController
        super.init(nibName: nil, bundle: nil)
        IosReaderSystemUiBridge.shared.register { [weak self] enabled in
            self?.setReaderFullscreen(enabled.boolValue)
        }
        IosSystemBarThemeBridge.shared.register { [weak self] isDark in
            self?.setAppTheme(isDark.boolValue)
        }
    }

    @available(*, unavailable)
    required init?(coder: NSCoder) {
        fatalError("ReaderSystemUiViewController must be created programmatically")
    }

    override var prefersStatusBarHidden: Bool {
        readerFullscreen
    }

    override var preferredStatusBarStyle: UIStatusBarStyle {
        appIsDark ? .lightContent : .darkContent
    }

    override var prefersHomeIndicatorAutoHidden: Bool {
        readerFullscreen
    }

    override func viewDidLoad() {
        super.viewDidLoad()
        addChild(contentController)
        view.addSubview(contentController.view)
        contentController.didMove(toParent: self)
    }

    override func viewDidLayoutSubviews() {
        super.viewDidLayoutSubviews()
        contentController.view.frame = view.bounds
    }

    deinit {
        IosReaderSystemUiBridge.shared.unregister()
        IosSystemBarThemeBridge.shared.unregister()
    }

    private func setReaderFullscreen(_ enabled: Bool) {
        guard readerFullscreen != enabled else { return }
        readerFullscreen = enabled
        setNeedsStatusBarAppearanceUpdate()
        setNeedsUpdateOfHomeIndicatorAutoHidden()
    }

    private func setAppTheme(_ isDark: Bool) {
        let update = { [weak self] in
            guard let self, self.appIsDark != isDark else { return }
            self.appIsDark = isDark
            self.setNeedsStatusBarAppearanceUpdate()
        }
        if Thread.isMainThread { update() } else { DispatchQueue.main.async(execute: update) }
    }
}

final class AppDelegate: NSObject, UIApplicationDelegate {
    func application(
        _ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
    ) -> Bool {
        IosBackgroundTaskRegistration.shared.register()
        return true
    }

    func applicationDidEnterBackground(_ application: UIApplication) {
        YokanEmbeddedMihonPause { _ in }
        YokanRuntime.shared.reschedulePeriodicTasks()
    }

    func applicationDidBecomeActive(_ application: UIApplication) {
        YokanEmbeddedMihonResume { _ in }
    }

    // Home-screen quick actions (Info.plist UIApplicationShortcutItems) carry a yokan:// route as their type.
    func application(
        _ application: UIApplication,
        configurationForConnecting connectingSceneSession: UISceneSession,
        options: UIScene.ConnectionOptions
    ) -> UISceneConfiguration {
        if let item = options.shortcutItem {
            AppDeepLinks.shared.dispatch(link: item.type)
        }
        let configuration = UISceneConfiguration(name: nil, sessionRole: connectingSceneSession.role)
        configuration.delegateClass = QuickActionSceneDelegate.self
        return configuration
    }
}

final class QuickActionSceneDelegate: NSObject, UIWindowSceneDelegate {
    func windowScene(
        _ windowScene: UIWindowScene,
        performActionFor shortcutItem: UIApplicationShortcutItem,
        completionHandler: @escaping (Bool) -> Void
    ) {
        AppDeepLinks.shared.dispatch(link: shortcutItem.type)
        completionHandler(true)
    }
}

struct ComposeRootView: UIViewControllerRepresentable {
    func makeUIViewController(context: Context) -> UIViewController {
        return ReaderSystemUiViewController(contentController: MainViewControllerKt.MainViewController())
    }

    func updateUIViewController(_ uiViewController: UIViewController, context: Context) {
    }
}

@main
struct YokanIOSApp: App {
    @UIApplicationDelegateAdaptor(AppDelegate.self) private var appDelegate

    var body: some Scene {
        WindowGroup {
            ComposeRootView()
                .ignoresSafeArea()
                .onOpenURL { url in
                    AppDeepLinks.shared.dispatch(link: url.absoluteString)
                }
        }
    }
}
```
[chapter-file-end]: #

[chapter-file-start]: #iosApp/Info.plist
### Write `iosApp/Info.plist`

Create this path in your reconstruction project. Source set: **build / host / supporting material**. [Exact file download](../reference/source/iosApp/Info.plist).

```text
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>CFBundleDevelopmentRegion</key>
	<string>$(DEVELOPMENT_LANGUAGE)</string>
	<key>CFBundleExecutable</key>
	<string>$(EXECUTABLE_NAME)</string>
	<key>CFBundleIdentifier</key>
	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
	<key>CFBundleInfoDictionaryVersion</key>
	<string>6.0</string>
	<key>CFBundleName</key>
	<string>$(PRODUCT_NAME)</string>
	<key>CFBundlePackageType</key>
	<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
	<key>CFBundleShortVersionString</key>
	<string>$(MARKETING_VERSION)</string>
	<key>CFBundleVersion</key>
	<string>$(CURRENT_PROJECT_VERSION)</string>
	<key>BGTaskSchedulerPermittedIdentifiers</key>
	<array>
		<string>eu.friedcutlet.yokan.metadata-refresh</string>
		<string>eu.friedcutlet.yokan.library-update</string>
		<string>eu.friedcutlet.yokan.auto-sync</string>
	</array>
	<key>UIBackgroundModes</key>
	<array>
		<string>fetch</string>
		<string>processing</string>
	</array>
	<key>CFBundleURLTypes</key>
	<array>
		<dict>
			<key>CFBundleTypeRole</key>
			<string>Editor</string>
			<key>CFBundleURLName</key>
			<string>eu.friedcutlet.yokan</string>
			<key>CFBundleURLSchemes</key>
			<array>
				<string>yokan</string>
				<string>tachiyomi</string>
				<string>mihon</string>
				<string>aniyomi</string>
				<string>animetail</string>
			</array>
		</dict>
	</array>
	<key>UTExportedTypeDeclarations</key>
	<array>
		<dict>
			<key>UTTypeIdentifier</key>
			<string>eu.friedcutlet.yokan.encrypted-backup</string>
			<key>UTTypeDescription</key>
			<string>Yokan encrypted backup</string>
			<key>UTTypeConformsTo</key>
			<array>
				<string>public.data</string>
			</array>
			<key>UTTypeTagSpecification</key>
			<dict>
				<key>public.filename-extension</key>
				<array>
					<string>yokanbak</string>
				</array>
			</dict>
		</dict>
	</array>
	<key>UTImportedTypeDeclarations</key>
	<array>
		<dict>
			<key>UTTypeIdentifier</key>
			<string>eu.kanade.tachiyomi.backup</string>
			<key>UTTypeDescription</key>
			<string>Tachiyomi backup</string>
			<key>UTTypeConformsTo</key>
			<array>
				<string>public.data</string>
			</array>
			<key>UTTypeTagSpecification</key>
			<dict>
				<key>public.filename-extension</key>
				<array>
					<string>tachibk</string>
				</array>
			</dict>
		</dict>
		<dict>
			<key>UTTypeIdentifier</key>
			<string>io.github.kodjodevf.mangayomi.backup</string>
			<key>UTTypeDescription</key>
			<string>Mangayomi backup</string>
			<key>UTTypeConformsTo</key>
			<array>
				<string>public.zip-archive</string>
			</array>
			<key>UTTypeTagSpecification</key>
			<dict>
				<key>public.filename-extension</key>
				<array>
					<string>backup</string>
				</array>
			</dict>
		</dict>
	</array>
	<key>CFBundleDocumentTypes</key>
	<array>
		<dict>
			<key>CFBundleTypeName</key>
			<string>Backup</string>
			<key>CFBundleTypeRole</key>
			<string>Viewer</string>
			<key>LSHandlerRank</key>
			<string>Owner</string>
			<key>LSItemContentTypes</key>
			<array>
				<string>eu.friedcutlet.yokan.encrypted-backup</string>
				<string>eu.kanade.tachiyomi.backup</string>
				<string>io.github.kodjodevf.mangayomi.backup</string>
			</array>
		</dict>
		<dict>
			<key>CFBundleTypeName</key>
			<string>Compressed backup</string>
			<key>CFBundleTypeRole</key>
			<string>Viewer</string>
			<key>LSHandlerRank</key>
			<string>Alternate</string>
			<key>LSItemContentTypes</key>
			<array>
				<string>org.gnu.gnu-zip-archive</string>
			</array>
		</dict>
	</array>
	<key>LSSupportsOpeningDocumentsInPlace</key>
	<false/>
	<key>UIApplicationShortcutItems</key>
	<array>
		<dict>
			<key>UIApplicationShortcutItemType</key>
			<string>yokan://manga</string>
			<key>UIApplicationShortcutItemTitle</key>
			<string>Manga library</string>
			<key>UIApplicationShortcutItemIconType</key>
			<string>UIApplicationShortcutIconTypeBookmark</string>
		</dict>
		<dict>
			<key>UIApplicationShortcutItemType</key>
			<string>yokan://updates</string>
			<key>UIApplicationShortcutItemTitle</key>
			<string>Updates</string>
			<key>UIApplicationShortcutItemIconType</key>
			<string>UIApplicationShortcutIconTypeUpdate</string>
		</dict>
		<dict>
			<key>UIApplicationShortcutItemType</key>
			<string>yokan://history</string>
			<key>UIApplicationShortcutItemTitle</key>
			<string>History</string>
			<key>UIApplicationShortcutItemIconType</key>
			<string>UIApplicationShortcutIconTypeTime</string>
		</dict>
		<dict>
			<key>UIApplicationShortcutItemType</key>
			<string>yokan://browse</string>
			<key>UIApplicationShortcutItemTitle</key>
			<string>Browse</string>
			<key>UIApplicationShortcutItemIconType</key>
			<string>UIApplicationShortcutIconTypeSearch</string>
		</dict>
	</array>
	<key>NSPhotoLibraryAddUsageDescription</key>
	<string>Save manga pages to your photo library.</string>
	<key>NSPhotoLibraryUsageDescription</key>
	<string>Save manga pages into an album named after each title.</string>
	<key>CADisableMinimumFrameDurationOnPhone</key>
	<true/>
	<key>LSRequiresIPhoneOS</key>
	<true/>
	<key>UILaunchScreen</key>
	<dict/>
	<key>UISupportedInterfaceOrientations</key>
	<array>
		<string>UIInterfaceOrientationPortrait</string>
		<string>UIInterfaceOrientationLandscapeLeft</string>
		<string>UIInterfaceOrientationLandscapeRight</string>
	</array>
	<key>UISupportedInterfaceOrientations~ipad</key>
	<array>
		<string>UIInterfaceOrientationPortrait</string>
		<string>UIInterfaceOrientationPortraitUpsideDown</string>
		<string>UIInterfaceOrientationLandscapeLeft</string>
		<string>UIInterfaceOrientationLandscapeRight</string>
	</array>
	<key>NSLocalNetworkUsageDescription</key>
	<string>Yokan looks for Chromecast devices and connects to your TorrServer on your local network.</string>
	<key>NSAppTransportSecurity</key>
	<dict>
		<key>NSAllowsLocalNetworking</key>
		<true/>
	</dict>
	<key>NSBonjourServices</key>
	<array>
		<string>_googlecast._tcp</string>
	</array>
	<key>LSApplicationQueriesSchemes</key>
	<array>
		<string>vlc-x-callback</string>
		<string>infuse</string>
		<string>outplayer</string>
	</array>
</dict>
</plist>
```
[chapter-file-end]: #

[chapter-file-start]: #iosApp/MihonEmbeddedBridge.h
### Write `iosApp/MihonEmbeddedBridge.h`

Create this path in your reconstruction project. Source set: **build / host / supporting material**. [Exact file download](../reference/source/iosApp/MihonEmbeddedBridge.h).

```cpp
#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

typedef void (^YokanEmbeddedMihonStartCompletion)(
    int32_t port,
    NSError *_Nullable error);
typedef void (^YokanEmbeddedMihonCompletion)(NSError *_Nullable error);
typedef void (^YokanEmbeddedMihonStatusCompletion)(
    BOOL isRunning,
    NSError *_Nullable error);

FOUNDATION_EXPORT void YokanEmbeddedMihonStart(
    int32_t port,
    YokanEmbeddedMihonStartCompletion completion);
FOUNDATION_EXPORT void YokanEmbeddedMihonPause(
    YokanEmbeddedMihonCompletion completion);
FOUNDATION_EXPORT void YokanEmbeddedMihonResume(
    YokanEmbeddedMihonCompletion completion);
FOUNDATION_EXPORT void YokanEmbeddedMihonStop(
    YokanEmbeddedMihonCompletion completion);
FOUNDATION_EXPORT void YokanEmbeddedMihonIsRunning(
    YokanEmbeddedMihonStatusCompletion completion);

NS_ASSUME_NONNULL_END
```
[chapter-file-end]: #

[chapter-file-start]: #iosApp/MihonEmbeddedBridge.mm
### Write `iosApp/MihonEmbeddedBridge.mm`

Create this path in your reconstruction project. Source set: **build / host / supporting material**. [Exact file download](../reference/source/iosApp/MihonEmbeddedBridge.mm).

This is the host-owned embedded runtime boundary. Native startup, exported symbols and pause/resume/resource lifetime must match the Kotlin cinterop declarations and prepared device artifacts.

The implementation below defines `JavaVMLockGuard`.

```objectivec
#import "MihonEmbeddedBridge.h"
#import <TargetConditionals.h>

#if YOKAN_SIDELOAD_RUNTIME_ENABLED && !TARGET_OS_SIMULATOR
#include <jni.h>

#include <cstdio>
#include <cstdint>
#include <dlfcn.h>
#include <os/lock.h>
#include <string>
#include <vector>

@interface YokanEmbeddedMihonThread : NSThread {
  NSCondition *_condition;
  NSMutableArray *_pendingBlocks;
}

- (void)enqueueBlock:(dispatch_block_t)block;

@end

@implementation YokanEmbeddedMihonThread

- (instancetype)init {
  self = [super init];
  if (self != nil) {
    _condition = [[NSCondition alloc] init];
    _pendingBlocks = [[NSMutableArray alloc] init];
    self.name = @"eu.friedcutlet.yokan.embedded-mihon";
    // The Zero interpreter divides the current native stack between its
    // Java operand stack and C/C++ calls. iOS dispatch workers only provide
    // a small implementation-defined stack, which can exhaust during
    // java.lang bootstrap. Give the embedded VM a stable, JVM-sized stack.
    self.stackSize = 8 * 1024 * 1024;
  }
  return self;
}

- (void)enqueueBlock:(dispatch_block_t)block {
  [_condition lock];
  [_pendingBlocks addObject:[block copy]];
  [_condition signal];
  [_condition unlock];
}

- (void)main {
  while (!self.cancelled) {
    dispatch_block_t block = nil;
    [_condition lock];
    while (_pendingBlocks.count == 0 && !self.cancelled) {
      [_condition wait];
    }
    if (_pendingBlocks.count > 0) {
      block = _pendingBlocks.firstObject;
      [_pendingBlocks removeObjectAtIndex:0];
    }
    [_condition unlock];

    if (block != nil) {
      @autoreleasepool {
        block();
      }
    }
  }
}

@end

namespace {

NSString *const kEmbeddedMihonErrorDomain =
    @"eu.friedcutlet.yokan.embedded_mihon";
const char *const kEmbeddedBridgeClassName =
    "mextensionserver/EmbeddedBridge";
const char *const kOpenJDKFrameworkRelativePath =
    "Frameworks/OpenJDKRuntime.framework/OpenJDKRuntime";

using LoadFunctions = void (*)(void);
using CreateJavaVM = jint (*)(JavaVM **, void **, void *);

JavaVM *gJavaVM = nullptr;
jclass gEmbeddedBridgeClass = nullptr;
jmethodID gStartMethod = nullptr;
jmethodID gPauseMethod = nullptr;
jmethodID gStopMethod = nullptr;
jmethodID gIsRunningMethod = nullptr;
void *gOpenJDKHandle = nullptr;
LoadFunctions gLoadFunctions = nullptr;
CreateJavaVM gCreateJavaVM = nullptr;
int32_t gLastStartedPort = 0;
os_unfair_lock gJavaVMLock = OS_UNFAIR_LOCK_INIT;

class JavaVMLockGuard {
 public:
  JavaVMLockGuard() {
    os_unfair_lock_lock(&gJavaVMLock);
  }

  ~JavaVMLockGuard() {
    os_unfair_lock_unlock(&gJavaVMLock);
  }

  JavaVMLockGuard(const JavaVMLockGuard &) = delete;
  JavaVMLockGuard &operator=(const JavaVMLockGuard &) = delete;
};

void TraceEmbeddedMihon(NSString *message) {
  const char *utf8 = message.UTF8String;
  fprintf(
      stderr,
      "Yokan EmbeddedMihon: %s\n",
      utf8 == nullptr ? "(null)" : utf8);
  fflush(stderr);
}

YokanEmbeddedMihonThread *EmbeddedMihonThread() {
  static YokanEmbeddedMihonThread *thread;
  static dispatch_once_t onceToken;
  dispatch_once(&onceToken, ^{
    thread = [[YokanEmbeddedMihonThread alloc] init];
    [thread start];
  });
  return thread;
}

NSError *EmbeddedMihonError(NSInteger code, NSString *message) {
  return [NSError errorWithDomain:kEmbeddedMihonErrorDomain
                             code:code
                         userInfo:@{NSLocalizedDescriptionKey : message}];
}

NSString *OpenJDKRuntimePath() {
  NSString *relativePath =
      [NSString stringWithUTF8String:kOpenJDKFrameworkRelativePath];
  return [NSBundle.mainBundle.bundlePath
      stringByAppendingPathComponent:relativePath];
}

NSString *OpenJDKRuntimeHome() {
  return [[OpenJDKRuntimePath() stringByDeletingLastPathComponent]
      stringByAppendingPathComponent:@"lib"];
}

bool LoadOpenJDKRuntime(NSError **error) {
  if (gOpenJDKHandle != nullptr &&
      gLoadFunctions != nullptr &&
      gCreateJavaVM != nullptr) {
    return true;
  }

  NSString *runtimePath = OpenJDKRuntimePath();
  dlerror();
  // The static OpenJDK build resolves its bundled JIMAGE and JDK native
  // functions through dlsym(RTLD_DEFAULT, ...). RTLD_GLOBAL is therefore
  // required even though the framework itself is loaded lazily.
  void *handle = dlopen(runtimePath.UTF8String, RTLD_NOW | RTLD_GLOBAL);
  if (handle == nullptr) {
    const char *details = dlerror();
    if (error != nullptr) {
      *error = EmbeddedMihonError(
          12,
          [NSString stringWithFormat:
              @"The on-device Mihon runtime could not be loaded: %s",
              details == nullptr ? "unknown dynamic loader error" : details]);
    }
    return false;
  }

  const char *const requiredGlobalSymbols[] = {
      "JDK_Canonicalize",
      "JIMAGE_Open",
      "JIMAGE_Close",
      "JIMAGE_FindResource",
      "JIMAGE_GetResource",
      "VerifyClassForMajorVersion",
  };
  for (const char *symbol : requiredGlobalSymbols) {
    dlerror();
    if (dlsym(RTLD_DEFAULT, symbol) == nullptr) {
      if (error != nullptr) {
        *error = EmbeddedMihonError(
            14,
            [NSString stringWithFormat:
                @"The on-device Mihon runtime cannot expose %s.", symbol]);
      }
      dlclose(handle);
      return false;
    }
  }

  dlerror();
  auto loadFunctions =
      reinterpret_cast<LoadFunctions>(
          dlsym(handle, "YokanOpenJDKLoadFunctions"));
  const char *loadFunctionsError = dlerror();
  dlerror();
  auto createJavaVM =
      reinterpret_cast<CreateJavaVM>(dlsym(handle, "JNI_CreateJavaVM"));
  const char *createJavaVMError = dlerror();
  if (loadFunctions == nullptr ||
      createJavaVM == nullptr ||
      loadFunctionsError != nullptr ||
      createJavaVMError != nullptr) {
    if (error != nullptr) {
      *error = EmbeddedMihonError(
          13,
          @"The on-device Mihon runtime is missing its JNI entry points.");
    }
    dlclose(handle);
    return false;
  }

  gOpenJDKHandle = handle;
  gLoadFunctions = loadFunctions;
  gCreateJavaVM = createJavaVM;
  return true;
}

NSString *JavaExceptionMessage(JNIEnv *env, NSString *fallback) {
  jthrowable exception = env->ExceptionOccurred();
  if (exception == nullptr) {
    return fallback;
  }
  env->ExceptionClear();

  NSString *message = fallback;
  jclass throwableClass = env->FindClass("java/lang/Throwable");
  if (throwableClass != nullptr) {
    jmethodID toStringMethod =
        env->GetMethodID(throwableClass, "toString", "()Ljava/lang/String;");
    if (toStringMethod != nullptr) {
      auto text =
          static_cast<jstring>(env->CallObjectMethod(exception, toStringMethod));
      if (!env->ExceptionCheck() && text != nullptr) {
        const char *utf8 = env->GetStringUTFChars(text, nullptr);
        if (utf8 != nullptr) {
          message = [NSString stringWithUTF8String:utf8];
          env->ReleaseStringUTFChars(text, utf8);
        }
        env->DeleteLocalRef(text);
      } else {
        env->ExceptionClear();
      }
    }
    env->DeleteLocalRef(throwableClass);
  } else {
    env->ExceptionClear();
  }
  env->DeleteLocalRef(exception);
  return message;
}

bool VerifyRuntimeFiles(
    NSString *resourcePath,
    NSString *runtimeHome,
    NSError **error) {
  NSArray<NSString *> *requiredFiles = @[
    @"lib/security/cacerts",
    @"MExtensionServer.jar",
    @"java-logging-shim.jar",
  ];
  NSFileManager *fileManager = NSFileManager.defaultManager;
  for (NSString *relativePath in requiredFiles) {
    NSString *path = [resourcePath stringByAppendingPathComponent:relativePath];
    if (![fileManager fileExistsAtPath:path]) {
      if (error != nullptr) {
        *error = EmbeddedMihonError(
            1,
            [NSString stringWithFormat:
                @"The embedded Mihon runtime is incomplete: %@ is missing.",
                relativePath]);
      }
      return false;
    }
  }
  NSString *bootModules =
      [runtimeHome stringByAppendingPathComponent:@"lib/modules"];
  if (![fileManager fileExistsAtPath:bootModules]) {
    if (error != nullptr) {
      *error = EmbeddedMihonError(
          1,
          @"The embedded Mihon runtime is incomplete: the framework-local "
          @"OpenJDK module image is missing.");
    }
    return false;
  }
  NSString *securityConfiguration =
      [runtimeHome stringByAppendingPathComponent:@"conf/security/java.security"];
  if (![fileManager fileExistsAtPath:securityConfiguration]) {
    if (error != nullptr) {
      *error = EmbeddedMihonError(
          1,
          @"The embedded Mihon runtime is incomplete: the framework-local "
          @"OpenJDK security configuration is missing.");
    }
    return false;
  }
  NSString *timezoneDatabase =
      [runtimeHome stringByAppendingPathComponent:@"lib/tzdb.dat"];
  if (![fileManager fileExistsAtPath:timezoneDatabase]) {
    if (error != nullptr) {
      *error = EmbeddedMihonError(
          1,
          @"The embedded Mihon runtime is incomplete: the framework-local "
          @"OpenJDK timezone database is missing.");
    }
    return false;
  }
  return true;
}

NSString *CreateApplicationDirectory(NSError **error) {
  NSFileManager *fileManager = NSFileManager.defaultManager;
  NSURL *supportURL = [fileManager URLForDirectory:NSApplicationSupportDirectory
                                          inDomain:NSUserDomainMask
                                 appropriateForURL:nil
                                            create:YES
                                             error:error];
  if (supportURL == nil) {
    return nil;
  }
  NSURL *appURL = [supportURL URLByAppendingPathComponent:@"MihonExtensions"
                                             isDirectory:YES];
  if (![fileManager createDirectoryAtURL:appURL
             withIntermediateDirectories:YES
                              attributes:nil
                                   error:error]) {
    return nil;
  }
  return appURL.path;
}

bool CacheBridgeEntryPoints(JNIEnv *env, NSError **error) {
  TraceEmbeddedMihon(@"looking up mextensionserver/EmbeddedBridge");
  jclass localClass = env->FindClass(kEmbeddedBridgeClassName);
  if (localClass == nullptr) {
    TraceEmbeddedMihon(
        [NSString stringWithFormat:
            @"EmbeddedBridge lookup failed (exception=%@)",
            env->ExceptionCheck() ? @"yes" : @"no"]);
    if (error != nullptr) {
      *error = EmbeddedMihonError(
          3,
          JavaExceptionMessage(
              env, @"The embedded Mihon bridge class could not be loaded."));
    }
    return false;
  }
  TraceEmbeddedMihon(@"EmbeddedBridge class lookup succeeded");

  gEmbeddedBridgeClass =
      static_cast<jclass>(env->NewGlobalRef(localClass));
  env->DeleteLocalRef(localClass);
  if (gEmbeddedBridgeClass == nullptr) {
    if (error != nullptr) {
      *error = EmbeddedMihonError(
          4, @"The embedded Mihon bridge class could not be retained.");
    }
    return false;
  }
  TraceEmbeddedMihon(@"EmbeddedBridge global reference retained");

  gStartMethod = env->GetStaticMethodID(
      gEmbeddedBridgeClass, "start", "(ILjava/lang/String;)I");
  gPauseMethod =
      env->GetStaticMethodID(gEmbeddedBridgeClass, "pause", "()V");
  gStopMethod =
      env->GetStaticMethodID(gEmbeddedBridgeClass, "stop", "()V");
  gIsRunningMethod =
      env->GetStaticMethodID(gEmbeddedBridgeClass, "isRunning", "()Z");
  if (gStartMethod == nullptr ||
      gPauseMethod == nullptr ||
      gStopMethod == nullptr ||
      gIsRunningMethod == nullptr ||
      env->ExceptionCheck()) {
    if (error != nullptr) {
      *error = EmbeddedMihonError(
          5,
          JavaExceptionMessage(
              env, @"The embedded Mihon bridge entry points are invalid."));
    }
    return false;
  }
  TraceEmbeddedMihon(@"EmbeddedBridge JNI entry points cached");
  return true;
}

bool CreateJavaVMIfNeeded(JNIEnv **environment, NSError **error) {
  JavaVMLockGuard guard;
  if (gJavaVM != nullptr) {
    if (gEmbeddedBridgeClass == nullptr ||
        gStartMethod == nullptr ||
        gPauseMethod == nullptr ||
        gStopMethod == nullptr ||
        gIsRunningMethod == nullptr) {
      if (error != nullptr) {
        *error = EmbeddedMihonError(
            2, @"The embedded Java runtime did not initialize completely.");
      }
      return false;
    }
    jint result = gJavaVM->AttachCurrentThread(
        reinterpret_cast<void **>(environment), nullptr);
    if (result != JNI_OK) {
      if (error != nullptr) {
        *error = EmbeddedMihonError(
            6, @"The embedded Java runtime could not attach its worker.");
      }
      return false;
    }
    return true;
  }

  NSString *resourcePath = NSBundle.mainBundle.resourcePath;
  NSString *runtimeHome = OpenJDKRuntimeHome();
  if (!VerifyRuntimeFiles(resourcePath, runtimeHome, error)) {
    return false;
  }
  if (!LoadOpenJDKRuntime(error)) {
    return false;
  }

  NSString *applicationDirectory = CreateApplicationDirectory(error);
  if (applicationDirectory == nil) {
    return false;
  }
  NSString *temporaryDirectory =
      [NSTemporaryDirectory() stringByAppendingPathComponent:@"MihonExtensions"];
  if (![NSFileManager.defaultManager
          createDirectoryAtPath:temporaryDirectory
    withIntermediateDirectories:YES
                     attributes:nil
                          error:error]) {
    return false;
  }

  NSString *serverJar =
      [resourcePath stringByAppendingPathComponent:@"MExtensionServer.jar"];
  NSString *loggingShim =
      [resourcePath stringByAppendingPathComponent:@"java-logging-shim.jar"];
  NSString *trustStore =
      [resourcePath stringByAppendingPathComponent:@"lib/security/cacerts"];

  std::vector<std::string> optionStrings = {
      std::string("-Djava.class.path=") + serverJar.UTF8String,
      std::string("-Xbootclasspath/a:") + loggingShim.UTF8String,
      std::string("-Djava.home=") + runtimeHome.UTF8String,
      std::string("-Djava.io.tmpdir=") + temporaryDirectory.UTF8String,
      std::string("-Duser.home=") + applicationDirectory.UTF8String,
      std::string("-Djavax.net.ssl.trustStore=") + trustStore.UTF8String,
      "-Djavax.net.ssl.trustStorePassword=changeit",
      "-Djava.awt.headless=true",
      "-Dfile.encoding=UTF-8",
      "-Djava.net.preferIPv4Stack=true",
      "-Dorg.slf4j.simpleLogger.defaultLogLevel=warn",
      // OpenJDK Zero uses Serial GC on iOS. Runtime v7 links java.lang.Class
      // before the first Java bytecode, so ordinary balanced generation
      // ceilings are sufficient without reserving an oversized heap.
      "-XX:+UseSerialGC",
        "-Xms128m",
        "-Xmx512m",
        "-XX:NewSize=64m",
        "-XX:MaxNewSize=256m",
      // The dedicated JNI bootstrap thread above has an 8 MiB stack, but
      // NanoHTTPD and the Android compatibility layer create ordinary Java
      // threads. BSD Zero otherwise gives those threads only 1536 KiB and its
      // stack-overflow signal path is not implemented, turning a deep request
      // into a process-fatal ShouldNotCall instead of StackOverflowError.
      "-Xss8m",
  };
  std::vector<JavaVMOption> options(optionStrings.size());
  for (size_t index = 0; index < optionStrings.size(); index++) {
    options[index].optionString =
        const_cast<char *>(optionStrings[index].c_str());
    options[index].extraInfo = nullptr;
  }

  JavaVMInitArgs arguments = {};
  arguments.version = JNI_VERSION_1_8;
  arguments.nOptions = static_cast<jint>(options.size());
  arguments.options = options.data();
  arguments.ignoreUnrecognized = JNI_FALSE;

  TraceEmbeddedMihon(@"calling JNI_CreateJavaVM");
  gLoadFunctions();
  // HotSpot must own SIGSEGV/SIGBUS while the VM is running. OpenJDK Zero
  // uses those signals internally on iOS, so an app-level handler here would
  // turn a recoverable VM signal into an app termination.
  jint result = gCreateJavaVM(
      &gJavaVM, reinterpret_cast<void **>(environment), &arguments);
  TraceEmbeddedMihon(
      [NSString stringWithFormat:
          @"JNI_CreateJavaVM returned %d (vm=%@, env=%@)",
          result,
          gJavaVM == nullptr ? @"null" : @"set",
          *environment == nullptr ? @"null" : @"set"]);
  if (result != JNI_OK || gJavaVM == nullptr || *environment == nullptr) {
    gJavaVM = nullptr;
    if (error != nullptr) {
      *error = EmbeddedMihonError(
          7,
          [NSString stringWithFormat:
              @"The embedded Java runtime could not start (JNI %d).",
              result]);
    }
    return false;
  }
  TraceEmbeddedMihon(@"JNI_CreateJavaVM succeeded");
  if (!CacheBridgeEntryPoints(*environment, error)) {
    TraceEmbeddedMihon(@"EmbeddedBridge JNI cache failed");
    return false;
  }
  TraceEmbeddedMihon(@"embedded Java runtime initialization completed");
  return true;
}

void DetachCurrentWorker() {
  if (gJavaVM != nullptr) {
    gJavaVM->DetachCurrentThread();
  }
}

}  // namespace

void YokanEmbeddedMihonStart(
    int32_t port,
    YokanEmbeddedMihonStartCompletion completion) {
  // Loading the framework and starting the VM are intentionally kept off the
  // app launch path and the UI thread. The framework remains loaded for the
  // lifetime of the process after the first Mihon request.
  [EmbeddedMihonThread() enqueueBlock:^{
    @autoreleasepool {
      NSError *error = nil;
      JNIEnv *environment = nullptr;
      int32_t startedPort = 0;
      TraceEmbeddedMihon(
          [NSString stringWithFormat:@"start requested on port %d", port]);
      if (CreateJavaVMIfNeeded(&environment, &error)) {
        NSString *applicationDirectory = CreateApplicationDirectory(&error);
        if (applicationDirectory != nil) {
          jstring appDirectory =
              environment->NewStringUTF(applicationDirectory.UTF8String);
          TraceEmbeddedMihon(@"calling EmbeddedBridge.start");
          jint result = environment->CallStaticIntMethod(
              gEmbeddedBridgeClass, gStartMethod, port, appDirectory);
          TraceEmbeddedMihon(
              [NSString stringWithFormat:
                  @"EmbeddedBridge.start returned %d (exception=%@)",
                  result,
                  environment->ExceptionCheck() ? @"yes" : @"no"]);
          if (environment->ExceptionCheck()) {
            error = EmbeddedMihonError(
                8,
                JavaExceptionMessage(
                    environment, @"The embedded Mihon bridge failed to start."));
          } else if (result <= 0 || result > UINT16_MAX) {
            error = EmbeddedMihonError(
                9, @"The embedded Mihon bridge returned an invalid port.");
          } else {
            startedPort = result;
            gLastStartedPort = result;
          }
          if (appDirectory != nullptr) {
            environment->DeleteLocalRef(appDirectory);
          }
        }
        DetachCurrentWorker();
      }
      if (error != nil) {
        TraceEmbeddedMihon(
            [NSString stringWithFormat:@"start failed: %@",
                                       error.localizedDescription]);
      } else {
        TraceEmbeddedMihon(
            [NSString stringWithFormat:@"start completed on port %d",
                                       startedPort]);
      }
      dispatch_async(dispatch_get_main_queue(), ^{
        completion(startedPort, error);
      });
    }
  }];
}

void YokanEmbeddedMihonStop(
    YokanEmbeddedMihonCompletion completion) {
  [EmbeddedMihonThread() enqueueBlock:^{
    @autoreleasepool {
      NSError *error = nil;
      JNIEnv *environment = nullptr;
      if (gJavaVM != nullptr &&
          CreateJavaVMIfNeeded(&environment, &error)) {
        environment->CallStaticVoidMethod(
            gEmbeddedBridgeClass, gStopMethod);
        if (environment->ExceptionCheck()) {
          error = EmbeddedMihonError(
              10,
              JavaExceptionMessage(
                  environment, @"The embedded Mihon bridge failed to stop."));
        } else {
          gLastStartedPort = 0;
        }
        DetachCurrentWorker();
      }
      dispatch_async(dispatch_get_main_queue(), ^{
        completion(error);
      });
    }
  }];
}

void YokanEmbeddedMihonResume(
    YokanEmbeddedMihonCompletion completion) {
  const int32_t port = gLastStartedPort;
  if (port == 0) {
    completion(nil);
    return;
  }
  YokanEmbeddedMihonStart(port, ^(int32_t startedPort, NSError *error) {
    completion(error);
  });
}

void YokanEmbeddedMihonPause(
    YokanEmbeddedMihonCompletion completion) {
  [EmbeddedMihonThread() enqueueBlock:^{
    @autoreleasepool {
      NSError *error = nil;
      JNIEnv *environment = nullptr;
      if (gJavaVM != nullptr &&
          CreateJavaVMIfNeeded(&environment, &error)) {
        environment->CallStaticVoidMethod(
            gEmbeddedBridgeClass, gPauseMethod);
        if (environment->ExceptionCheck()) {
          error = EmbeddedMihonError(
              12,
              JavaExceptionMessage(
                  environment, @"The embedded Mihon bridge failed to pause."));
        }
        DetachCurrentWorker();
      }
      dispatch_async(dispatch_get_main_queue(), ^{
        completion(error);
      });
    }
  }];
}

void YokanEmbeddedMihonIsRunning(
    YokanEmbeddedMihonStatusCompletion completion) {
  [EmbeddedMihonThread() enqueueBlock:^{
    @autoreleasepool {
      NSError *error = nil;
      JNIEnv *environment = nullptr;
      BOOL isRunning = NO;
      if (gJavaVM != nullptr &&
          CreateJavaVMIfNeeded(&environment, &error)) {
        jboolean result = environment->CallStaticBooleanMethod(
            gEmbeddedBridgeClass, gIsRunningMethod);
        if (environment->ExceptionCheck()) {
          error = EmbeddedMihonError(
              11,
              JavaExceptionMessage(
                  environment,
                  @"The embedded Mihon bridge status could not be read."));
        } else {
          isRunning = result == JNI_TRUE;
        }
        DetachCurrentWorker();
      }
      dispatch_async(dispatch_get_main_queue(), ^{
        completion(isRunning, error);
      });
    }
  }];
}

#else

namespace {
NSError *UnavailableRuntimeError() {
  return [NSError errorWithDomain:@"eu.friedcutlet.yokan.embedded_mihon"
                             code:1
                         userInfo:@{
                           NSLocalizedDescriptionKey:
                               @"This build does not include the sideloaded iOS Java runtime."
                         }];
}
}  // namespace

void YokanEmbeddedMihonStart(
    int32_t port,
    YokanEmbeddedMihonStartCompletion completion) {
  completion(0, UnavailableRuntimeError());
}

void YokanEmbeddedMihonPause(YokanEmbeddedMihonCompletion completion) {
  completion(nil);
}

void YokanEmbeddedMihonResume(YokanEmbeddedMihonCompletion completion) {
  completion(nil);
}

void YokanEmbeddedMihonStop(YokanEmbeddedMihonCompletion completion) {
  completion(nil);
}

void YokanEmbeddedMihonIsRunning(
    YokanEmbeddedMihonStatusCompletion completion) {
  completion(NO, nil);
}

#endif
```
[chapter-file-end]: #

[chapter-file-start]: #iosApp/PanelColorizerBridge.h
### Write `iosApp/PanelColorizerBridge.h`

Create this path in your reconstruction project. Source set: **build / host / supporting material**. [Exact file download](../reference/source/iosApp/PanelColorizerBridge.h).

```cpp
#import <Foundation/Foundation.h>
#include <stdint.h>

NS_ASSUME_NONNULL_BEGIN
// Packed RGBA pixels, limited to maxSide before rasterization. Width/height are out parameters.
FOUNDATION_EXPORT NSData * _Nullable YokanDecodePanel(NSData *data, int maxSide, int *width, int *height);
// Reads and bounds the source dimensions (including orientation) before full-resolution decode.
// failureCode: 1 for corrupt/unsupported input, 2 for page bounds exceeded.
FOUNDATION_EXPORT NSData * _Nullable YokanDecodePanelFullPage(NSData *data, int *width, int *height, int *failureCode);
FOUNDATION_EXPORT NSData * _Nullable YokanEncodePanel(const uint32_t *argb, int width, int height);
FOUNDATION_EXPORT BOOL YokanInferPanel(NSString *modelPath, const float *input, float *output, int width, int height);
NS_ASSUME_NONNULL_END
```
[chapter-file-end]: #

[chapter-file-start]: #iosApp/PanelColorizerBridge.mm
### Write `iosApp/PanelColorizerBridge.mm`

Create this path in your reconstruction project. Source set: **build / host / supporting material**. [Exact file download](../reference/source/iosApp/PanelColorizerBridge.mm).

```objectivec
#import "PanelColorizerBridge.h"
#import <ImageIO/ImageIO.h>
#import <UIKit/UIKit.h>
#import <onnxruntime.h>

NSData *YokanDecodePanel(NSData *data, int maxSide, int *width, int *height) {
    @autoreleasepool {
        CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)data, nullptr);
        if (!source) return nil;
        NSDictionary *options = @{
            (NSString *)kCGImageSourceCreateThumbnailFromImageAlways: @YES,
            (NSString *)kCGImageSourceThumbnailMaxPixelSize: @(maxSide),
            (NSString *)kCGImageSourceCreateThumbnailWithTransform: @YES,
            (NSString *)kCGImageSourceShouldCacheImmediately: @YES,
        };
        CGImageRef image = CGImageSourceCreateThumbnailAtIndex(source, 0, (__bridge CFDictionaryRef)options);
        CFRelease(source);
        if (!image) return nil;
        *width = (int)CGImageGetWidth(image); *height = (int)CGImageGetHeight(image);
        if (*width <= 0 || *height <= 0 || *width > maxSide || *height > maxSide) { CGImageRelease(image); return nil; }
        NSMutableData *pixels = [NSMutableData dataWithLength:(NSUInteger)(*width) * (*height) * 4];
        CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
        CGContextRef context = CGBitmapContextCreate(pixels.mutableBytes, *width, *height, 8, *width * 4, colorSpace,
                                                    kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big);
        CGColorSpaceRelease(colorSpace);
        if (!context) { CGImageRelease(image); return nil; }
        CGContextSetRGBFillColor(context, 1, 1, 1, 1);
        CGContextFillRect(context, CGRectMake(0, 0, *width, *height));
        CGContextDrawImage(context, CGRectMake(0, 0, *width, *height), image);
        CGContextRelease(context); CGImageRelease(image);
        return pixels;
    }
}

NSData *YokanDecodePanelFullPage(NSData *data, int *width, int *height, int *failureCode) {
    @autoreleasepool {
        *failureCode = 1;
        CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)data, nullptr);
        if (!source) return nil;
        if (CGImageSourceGetStatus(source) != kCGImageStatusComplete ||
            CGImageSourceGetStatusAtIndex(source, 0) != kCGImageStatusComplete) {
            CFRelease(source);
            return nil;
        }
        NSDictionary *properties = CFBridgingRelease(CGImageSourceCopyPropertiesAtIndex(source, 0, nullptr));
        NSNumber *sourceWidth = properties[(NSString *)kCGImagePropertyPixelWidth];
        NSNumber *sourceHeight = properties[(NSString *)kCGImagePropertyPixelHeight];
        NSDictionary *tiffProperties = properties[(NSString *)kCGImagePropertyTIFFDictionary];
        NSNumber *orientationValue = properties[(NSString *)kCGImagePropertyOrientation] ?:
            tiffProperties[(NSString *)kCGImagePropertyTIFFOrientation];
        uint64_t rawWidth = sourceWidth.unsignedLongLongValue;
        uint64_t rawHeight = sourceHeight.unsignedLongLongValue;
        if (!sourceWidth || !sourceHeight || rawWidth == 0 || rawHeight == 0 || rawWidth > 4096 || rawHeight > 4096 ||
            rawWidth * rawHeight > 8000000ULL) {
            if (sourceWidth && sourceHeight && rawWidth > 0 && rawHeight > 0) *failureCode = 2;
            CFRelease(source);
            return nil;
        }
        NSUInteger orientation = orientationValue ? orientationValue.unsignedIntegerValue : 1;
        if (orientation < 1 || orientation > 8) {
            CFRelease(source);
            return nil;
        }
        // ImageIO's transformed thumbnail preserves full resolution here: the validated source is
        // already within maxPixelSize. Its transform applies EXIF orientation before rasterization.
        NSDictionary *options = @{
            (NSString *)kCGImageSourceCreateThumbnailFromImageAlways: @YES,
            (NSString *)kCGImageSourceThumbnailMaxPixelSize: @4096,
            (NSString *)kCGImageSourceCreateThumbnailWithTransform: @YES,
            (NSString *)kCGImageSourceShouldCacheImmediately: @YES,
        };
        CGImageRef image = CGImageSourceCreateThumbnailAtIndex(source, 0, (__bridge CFDictionaryRef)options);
        CFRelease(source);
        if (!image) return nil;
        size_t decodedWidth = CGImageGetWidth(image);
        size_t decodedHeight = CGImageGetHeight(image);
        if (decodedWidth == 0 || decodedHeight == 0 || decodedWidth > 4096 || decodedHeight > 4096 ||
            (uint64_t)decodedWidth * (uint64_t)decodedHeight > 8000000ULL) {
            *failureCode = 2;
            CGImageRelease(image);
            return nil;
        }
        *width = (int)decodedWidth;
        *height = (int)decodedHeight;
        NSMutableData *pixels = [NSMutableData dataWithLength:(NSUInteger)decodedWidth * decodedHeight * 4];
        CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
        CGContextRef context = CGBitmapContextCreate(pixels.mutableBytes, *width, *height, 8, *width * 4, colorSpace,
                                                    kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big);
        CGColorSpaceRelease(colorSpace);
        if (!context) { CGImageRelease(image); return nil; }
        CGContextDrawImage(context, CGRectMake(0, 0, *width, *height), image);
        // CGBitmapContext stores premultiplied RGBA; expose straight RGBA to Kotlin/ARGB.
        uint8_t *rgba = (uint8_t *)pixels.mutableBytes;
        NSUInteger pixelCount = (NSUInteger)decodedWidth * decodedHeight;
        for (NSUInteger i = 0; i < pixelCount; i++) {
            uint8_t alpha = rgba[i * 4 + 3];
            if (alpha == 0) {
                rgba[i * 4] = rgba[i * 4 + 1] = rgba[i * 4 + 2] = 0;
            } else if (alpha < 255) {
                for (NSUInteger channel = 0; channel < 3; channel++) {
                    rgba[i * 4 + channel] = (uint8_t)MIN(255, (rgba[i * 4 + channel] * 255 + alpha / 2) / alpha);
                }
            }
        }
        CGContextRelease(context);
        CGImageRelease(image);
        *failureCode = 0;
        return pixels;
    }
}

NSData *YokanEncodePanel(const uint32_t *argb, int width, int height) {
    @autoreleasepool {
        if (width <= 0 || height <= 0 || width > 4096 || height > 4096 ||
            (uint64_t)width * (uint64_t)height > 8000000ULL) return nil;
        NSMutableData *data = [NSMutableData dataWithLength:(NSUInteger)width * height * 4];
        uint8_t *pixels = (uint8_t *)data.mutableBytes;
        for (int i = 0; i < width * height; i++) {
            uint8_t alpha = (argb[i] >> 24) & 255;
            pixels[i * 4 + 2] = ((argb[i] & 255) * alpha + 127) / 255;
            pixels[i * 4 + 3] = alpha;
            pixels[i * 4] = (((argb[i] >> 16) & 255) * alpha + 127) / 255;
            pixels[i * 4 + 1] = (((argb[i] >> 8) & 255) * alpha + 127) / 255;
        }
        CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
        CGContextRef context = CGBitmapContextCreate(pixels, width, height, 8, width * 4, colorSpace,
                                                    kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big);
        CGColorSpaceRelease(colorSpace);
        if (!context) return nil;
        CGImageRef image = CGBitmapContextCreateImage(context);
        NSData *png = image ? UIImagePNGRepresentation([UIImage imageWithCGImage:image]) : nil;
        if (image) CGImageRelease(image);
        CGContextRelease(context);
        return png;
    }
}

BOOL YokanInferPanel(NSString *modelPath, const float *input, float *output, int width, int height) {
    @autoreleasepool {
        if (width <= 0 || height <= 0 || width % 32 != 0 || height % 32 != 0) return NO;
        NSError *error = nil;
        ORTEnv *env = [[ORTEnv alloc] initWithLoggingLevel:ORTLoggingLevelWarning error:&error];
        ORTSessionOptions *options = [[ORTSessionOptions alloc] initWithError:&error];
        if (!env || !options || ![options setIntraOpNumThreads:1 error:&error] ||
            ![options setGraphOptimizationLevel:ORTGraphOptimizationLevelNone error:&error] ||
            ![options addConfigEntryWithKey:@"session.disable_prepacking" value:@"1" error:&error]) return NO;
        ORTSession *session = [[ORTSession alloc] initWithEnv:env modelPath:modelPath sessionOptions:options error:&error];
        if (!session) return NO;
        NSMutableData *inputData = [NSMutableData dataWithBytes:input length:5 * width * height * sizeof(float)];
        NSMutableData *outputData = [NSMutableData dataWithLength:3 * width * height * sizeof(float)];
        ORTValue *inputTensor = [[ORTValue alloc] initWithTensorData:inputData elementType:ORTTensorElementDataTypeFloat
                                                          shape:@[@1, @5, @(height), @(width)] error:&error];
        ORTValue *outputTensor = [[ORTValue alloc] initWithTensorData:outputData elementType:ORTTensorElementDataTypeFloat
                                                           shape:@[@1, @3, @(height), @(width)] error:&error];
        if (!inputTensor || !outputTensor) return NO;
        BOOL success = [session runWithInputs:@{@"input":inputTensor} outputs:@{@"rgb":outputTensor} runOptions:nil error:&error];
        if (success) memcpy(output, outputData.bytes, outputData.length);
        return success;
        // ARC + the autorelease pool release tensors, session, weights, and temporary buffers each job.
    }
}
```
[chapter-file-end]: #

[chapter-file-start]: #iosApp/BuildSharedFramework.sh
### Write `iosApp/BuildSharedFramework.sh`

Create this path in your reconstruction project. Source set: **build / host / supporting material**. [Exact file download](../reference/source/iosApp/BuildSharedFramework.sh).

```bash
#!/bin/sh
set -e

if [ -z "${JAVA_HOME:-}" ]; then
    JDK_HOME="$(/usr/libexec/java_home -v 21 2>/dev/null || true)"

    if [ -z "$JDK_HOME" ]; then
        for candidate in \
            "$HOME/Applications/Android Studio.app/Contents/jbr/Contents/Home" \
            "/Applications/Android Studio.app/Contents/jbr/Contents/Home"
        do
            if [ -x "$candidate/bin/java" ]; then
                JDK_HOME="$candidate"
                break
            fi
        done
    fi

    if [ -n "$JDK_HOME" ]; then
        export JAVA_HOME="$JDK_HOME"
        export PATH="$JAVA_HOME/bin:$PATH"
    fi
fi

if [ -n "${SRCROOT:-}" ]; then
    REPO_ROOT="$SRCROOT/.."
else
    SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
    REPO_ROOT="$SCRIPT_DIR/.."
fi

cd "$REPO_ROOT"
. "$REPO_ROOT/scripts/yokan-version.sh"
./gradlew :composeApp:embedAndSignAppleFrameworkForXcode --stacktrace --console=plain

# Bundle libmpv beside the app so kmp-mpv's dynamic bridge can resolve it.
# The published archive currently labels its arm64 binaries as device-only,
# but the binaries are also usable by the arm64 simulator after rewriting the
# Mach-O platform load command, matching the embedded JVM runtime strategy.
case "${PLATFORM_NAME:-}" in
    iphoneos|iphonesimulator)
        MPV_ROOT="${YOKAN_KMP_MPV_ROOT:-$REPO_ROOT/vendor/kmp-mpv}"
        "$MPV_ROOT/scripts/prepare-media-kit-ios.sh"
        MPV_FRAMEWORKS="$MPV_ROOT/build/media-kit-mpv/ios"
        APP_FRAMEWORKS="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
        mkdir -p "$APP_FRAMEWORKS"

        for xcframework in "$MPV_FRAMEWORKS"/*.xcframework; do
            framework_name="$(basename "$xcframework" .xcframework)"
            source_framework="$xcframework/ios-arm64/$framework_name.framework"
            if [ -d "$source_framework" ]; then
                destination_framework="$APP_FRAMEWORKS/$framework_name.framework"
                rm -rf "$destination_framework"
                ditto "$source_framework" "$destination_framework"

                if [ "${PLATFORM_NAME:-}" = "iphonesimulator" ]; then
                    binary="$destination_framework/$framework_name"
                    patched="${binary}.iossim"
                    /usr/bin/xcrun vtool \
                        -set-build-version iossim "${IPHONEOS_DEPLOYMENT_TARGET:-15.0}" "${SDK_VERSION:-26.0}" \
                        -replace -output "$patched" "$binary"
                    /bin/mv "$patched" "$binary"
                fi

                signing_identity="${EXPANDED_CODE_SIGN_IDENTITY:--}"
                codesign --force --sign "$signing_identity" \
                    --preserve-metadata=identifier,entitlements \
                    "$destination_framework"
            fi
        done
        ;;
esac
```
[chapter-file-end]: #

[chapter-file-start]: #iosApp/EmbeddedMihon/OpenJDKRuntime-Info.plist
### Write `iosApp/EmbeddedMihon/OpenJDKRuntime-Info.plist`

Create this path in your reconstruction project. Source set: **build / host / supporting material**. [Exact file download](../reference/source/iosApp/EmbeddedMihon/OpenJDKRuntime-Info.plist).

```text
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>CFBundleDevelopmentRegion</key>
	<string>en</string>
	<key>CFBundleExecutable</key>
	<string>OpenJDKRuntime</string>
	<key>CFBundleIdentifier</key>
	<string>eu.friedcutlet.yokan.openjdk-runtime</string>
	<key>CFBundleInfoDictionaryVersion</key>
	<string>6.0</string>
	<key>CFBundleName</key>
	<string>OpenJDKRuntime</string>
	<key>CFBundlePackageType</key>
	<string>FMWK</string>
	<key>CFBundleShortVersionString</key>
	<string>1.0</string>
	<key>CFBundleSupportedPlatforms</key>
	<array>
		<string>iPhoneOS</string>
	</array>
	<key>CFBundleVersion</key>
	<string>1</string>
	<key>MinimumOSVersion</key>
	<string>13.0</string>
</dict>
</plist>
```
[chapter-file-end]: #

[chapter-file-start]: #iosApp/EmbeddedMihon/ios_jul_shim/java/util/logging/Level.java
### Write `iosApp/EmbeddedMihon/ios_jul_shim/java/util/logging/Level.java`

Create this path in your reconstruction project. Source set: **build / host / supporting material**. [Exact file download](../reference/source/iosApp/EmbeddedMihon/ios_jul_shim/java/util/logging/Level.java).

The implementation below defines `Level`.

```java
package java.util.logging;

public final class Level {
    public static final Level OFF = new Level("OFF");
    public static final Level SEVERE = new Level("SEVERE");
    public static final Level WARNING = new Level("WARNING");
    public static final Level INFO = new Level("INFO");
    public static final Level CONFIG = new Level("CONFIG");
    public static final Level FINE = new Level("FINE");
    public static final Level FINER = new Level("FINER");
    public static final Level FINEST = new Level("FINEST");
    public static final Level ALL = new Level("ALL");

    private final String name;

    private Level(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    @Override
    public String toString() {
        return name;
    }
}
```
[chapter-file-end]: #

[chapter-file-start]: #iosApp/EmbeddedMihon/ios_jul_shim/java/util/logging/Logger.java
### Write `iosApp/EmbeddedMihon/ios_jul_shim/java/util/logging/Logger.java`

Create this path in your reconstruction project. Source set: **build / host / supporting material**. [Exact file download](../reference/source/iosApp/EmbeddedMihon/ios_jul_shim/java/util/logging/Logger.java).

The implementation below defines `Logger`.

```java
package java.util.logging;

public final class Logger {
    private Logger() {}

    public static Logger getLogger(String name) {
        return new Logger();
    }

    public boolean isLoggable(Level level) {
        return false;
    }

    public void log(Level level, String message) {}

    public void log(Level level, String message, Throwable error) {}
}
```
[chapter-file-end]: #

[chapter-file-start]: #iosApp/EmbeddedMihon/openjdk_runtime_exports.cpp
### Write `iosApp/EmbeddedMihon/openjdk_runtime_exports.cpp`

Create this path in your reconstruction project. Source set: **build / host / supporting material**. [Exact file download](../reference/source/iosApp/EmbeddedMihon/openjdk_runtime_exports.cpp).

```cpp
extern "C" void loadfunctions(void);

extern "C" __attribute__((visibility("default")))
void YokanOpenJDKLoadFunctions(void) {
  loadfunctions();
}
```
[chapter-file-end]: #

[chapter-file-start]: #iosApp/PrepareExtensionRuntime.sh
### Write `iosApp/PrepareExtensionRuntime.sh`

Create this path in your reconstruction project. Source set: **build / host / supporting material**. [Exact file download](../reference/source/iosApp/PrepareExtensionRuntime.sh).

```bash
#!/bin/sh
set -eu

RESOURCE_ROOT="${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
FRAMEWORKS_ROOT="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
GENERATED_FRAMEWORK="${TARGET_TEMP_DIR}/OpenJDKRuntime.framework"

clean_runtime() {
  rm -rf "${FRAMEWORKS_ROOT}/OpenJDKRuntime.framework" "${GENERATED_FRAMEWORK}"
  rm -f \
    "${RESOURCE_ROOT}/MExtensionServer.jar" \
    "${RESOURCE_ROOT}/java-logging-shim.jar" \
    "${RESOURCE_ROOT}/EMBEDDED_MIHON_NOTICES.md" \
    "${RESOURCE_ROOT}/release" \
    "${RESOURCE_ROOT}/lib/security/cacerts"
}

write_mode_stamp() {
  mkdir -p "${RESOURCE_ROOT}"
  printf '%s\n' "$1" > "${RESOURCE_ROOT}/.yokan-extension-runtime-mode"
}

if [ "${PLATFORM_NAME:-}" != "iphoneos" ] || [ "${YOKAN_SIDELOAD_RUNTIME:-NO}" != "YES" ]; then
  clean_runtime
  write_mode_stamp "disabled"
  echo "Skipping embedded Mihon runtime for this build"
  exit 0
fi

RUNTIME_RELEASE="embedded-openjdk-ios13-v15"
CACHE_ROOT="${HOME}/Library/Caches/Yokan/embedded-mihon/${RUNTIME_RELEASE}"
CACHE_BUILD="${CACHE_ROOT}/runtime"
WORK_ROOT="${TARGET_TEMP_DIR}/yokan-embedded-mihon"
SERVER_JAR="${CACHE_ROOT}/MExtensionServer-ios.jar"
OPENJDK_ZIP="${CACHE_ROOT}/OpenJDK.xcframework.zip"
JAVA_BUNDLE_ZIP="${CACHE_ROOT}/java_bundle-device.zip"

SERVER_URL="https://github.com/1Selxo/M-Extension-Server/releases/download/ios-runtime-v7/MExtensionServer-ios.jar"
SERVER_SHA256="40f29f44014fbe1d68b9c368a7c88ab559f8de40e7554c4873389a475aee2fe0"
OPENJDK_URL="https://github.com/1Selxo/Mangatan/releases/download/${RUNTIME_RELEASE}/OpenJDK.xcframework.zip"
OPENJDK_SHA256="40030bd6a582d301798fc3775104a985fabf07ee2a4d4ffbc42e1bb27fb0a53d"
JAVA_BUNDLE_URL="https://github.com/1Selxo/Mangatan/releases/download/${RUNTIME_RELEASE}/java_bundle-device.zip"
JAVA_BUNDLE_SHA256="7a22aabad510c3060ccd792ac30a3f11172a106eeb7773e89b8b1c53241b7e84"

mkdir -p "${CACHE_ROOT}"

download_verified() {
  url="$1"
  destination="$2"
  expected="$3"
  if [ -f "${destination}" ]; then
    actual="$(/usr/bin/shasum -a 256 "${destination}" | /usr/bin/cut -d ' ' -f 1)"
    [ "${actual}" = "${expected}" ] && return
    rm -f "${destination}"
  fi
  temporary="${destination}.download"
  rm -f "${temporary}"
  /usr/bin/curl --fail --location --retry 3 --output "${temporary}" "${url}"
  actual="$(/usr/bin/shasum -a 256 "${temporary}" | /usr/bin/cut -d ' ' -f 1)"
  if [ "${actual}" != "${expected}" ]; then
    rm -f "${temporary}"
    echo "SHA-256 mismatch for ${url}" >&2
    exit 1
  fi
  mv "${temporary}" "${destination}"
}

download_verified "${SERVER_URL}" "${SERVER_JAR}" "${SERVER_SHA256}"
download_verified "${OPENJDK_URL}" "${OPENJDK_ZIP}" "${OPENJDK_SHA256}"
download_verified "${JAVA_BUNDLE_URL}" "${JAVA_BUNDLE_ZIP}" "${JAVA_BUNDLE_SHA256}"

# Report the server that actually ships: the pinned JAR's own manifest version and its SHA-256.
SERVER_VERSION="$(/usr/bin/unzip -p "${SERVER_JAR}" META-INF/MANIFEST.MF \
  | /usr/bin/sed -n 's/^Specification-Version: *v\{0,1\}\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/p')"
if [ -z "${SERVER_VERSION}" ]; then
  echo "${SERVER_URL} has no Specification-Version in its manifest" >&2
  exit 1
fi

# CACHE_ROOT is keyed on RUNTIME_RELEASE only, so rebuild the cached runtime whenever anything
# else baked into it changes: the pinned archives, the deployment target, or the local sources.
RUNTIME_INPUTS_SHA256="$(
  {
    printf '%s\n' "${OPENJDK_SHA256}" "${JAVA_BUNDLE_SHA256}" "${IPHONEOS_DEPLOYMENT_TARGET:-15.0}"
    /bin/cat \
      "${SRCROOT}/EmbeddedMihon/OpenJDKRuntime-Info.plist" \
      "${SRCROOT}/EmbeddedMihon/openjdk_runtime_exports.cpp" \
      "${SRCROOT}/EmbeddedMihon/ios_jul_shim/java/util/logging/Level.java" \
      "${SRCROOT}/EmbeddedMihon/ios_jul_shim/java/util/logging/Logger.java"
  } | /usr/bin/shasum -a 256 | /usr/bin/cut -d ' ' -f 1
)"
RUNTIME_STAMP="${CACHE_BUILD}/.inputs-sha256"

if [ ! -x "${CACHE_BUILD}/OpenJDKRuntime.framework/OpenJDKRuntime" ] || \
  [ "$(/bin/cat "${RUNTIME_STAMP}" 2>/dev/null || true)" != "${RUNTIME_INPUTS_SHA256}" ]; then
  JAVA_HOME_EFFECTIVE="${JAVA_HOME:-}"
  if [ ! -x "${JAVA_HOME_EFFECTIVE}/bin/javac" ]; then
    JAVA_HOME_EFFECTIVE="$(/usr/libexec/java_home -v 21)"
  fi

  rm -rf "${WORK_ROOT}" "${CACHE_BUILD}"
  mkdir -p "${WORK_ROOT}/framework" "${WORK_ROOT}/java-bundle" "${CACHE_BUILD}"
  /usr/bin/unzip -q "${OPENJDK_ZIP}" -d "${WORK_ROOT}/framework"
  /usr/bin/unzip -q "${JAVA_BUNDLE_ZIP}" -d "${WORK_ROOT}/java-bundle"

  STATIC_LIBRARY="$(/usr/bin/find "${WORK_ROOT}/framework" -type f -name libdevice.a -print -quit)"
  HEADERS_DIR="$(/usr/bin/find "${WORK_ROOT}/framework" -type d -name Headers -print -quit)"
  MODULES="$(/usr/bin/find "${WORK_ROOT}/java-bundle" -type f -path '*/lib/modules' -print -quit)"
  JAVA_ROOT="$(/usr/bin/dirname "$(/usr/bin/dirname "${MODULES}")")"
  if [ -z "${STATIC_LIBRARY}" ] || [ -z "${HEADERS_DIR}" ] || [ ! -f "${JAVA_ROOT}/conf/security/java.security" ]; then
    echo "The pinned OpenJDK runtime archive is incomplete" >&2
    exit 1
  fi

  SHIM_CLASSES="${WORK_ROOT}/logging-shim-classes"
  mkdir -p "${SHIM_CLASSES}"
  "${JAVA_HOME_EFFECTIVE}/bin/javac" \
    --patch-module "java.logging=${SRCROOT}/EmbeddedMihon/ios_jul_shim" \
    -d "${SHIM_CLASSES}" \
    "${SRCROOT}/EmbeddedMihon/ios_jul_shim/java/util/logging/Level.java" \
    "${SRCROOT}/EmbeddedMihon/ios_jul_shim/java/util/logging/Logger.java"
  "${JAVA_HOME_EFFECTIVE}/bin/jar" --create \
    --file "${CACHE_BUILD}/java-logging-shim.jar" \
    -C "${SHIM_CLASSES}" .

  FRAMEWORK="${CACHE_BUILD}/OpenJDKRuntime.framework"
  mkdir -p "${FRAMEWORK}/Headers" "${FRAMEWORK}/lib/lib" "${CACHE_BUILD}/lib/security"
  /usr/bin/ditto "${HEADERS_DIR}" "${FRAMEWORK}/Headers"
  /bin/cp "${SRCROOT}/EmbeddedMihon/OpenJDKRuntime-Info.plist" "${FRAMEWORK}/Info.plist"
  /bin/cp "${JAVA_ROOT}/lib/modules" "${FRAMEWORK}/lib/lib/modules"
  /bin/cp "${JAVA_ROOT}/lib/tzdb.dat" "${FRAMEWORK}/lib/lib/tzdb.dat"
  /usr/bin/ditto "${JAVA_ROOT}/lib/security" "${FRAMEWORK}/lib/lib/security"
  /usr/bin/ditto "${JAVA_ROOT}/conf" "${FRAMEWORK}/lib/conf"

  SDK_ROOT="$(/usr/bin/xcrun --sdk iphoneos --show-sdk-path)"
  /usr/bin/xcrun --sdk iphoneos clang++ \
    -target "arm64-apple-ios${IPHONEOS_DEPLOYMENT_TARGET:-15.0}" \
    -isysroot "${SDK_ROOT}" \
    -dynamiclib \
    -Wl,-all_load \
    "${STATIC_LIBRARY}" \
    "${SRCROOT}/EmbeddedMihon/openjdk_runtime_exports.cpp" \
    -Wl,-install_name,@rpath/OpenJDKRuntime.framework/OpenJDKRuntime \
    -Wl,-compatibility_version,1.0.0 \
    -Wl,-current_version,1.0.0 \
    -lz \
    -framework Foundation \
    -framework CoreFoundation \
    -o "${FRAMEWORK}/OpenJDKRuntime"

  /bin/cp "${JAVA_ROOT}/lib/security/cacerts" "${CACHE_BUILD}/lib/security/cacerts"
  /bin/cp "${JAVA_ROOT}/release" "${CACHE_BUILD}/release"
  printf '%s\n' "${RUNTIME_INPUTS_SHA256}" > "${RUNTIME_STAMP}"
fi

clean_runtime
mkdir -p "${FRAMEWORKS_ROOT}" "${RESOURCE_ROOT}/lib/security"
/usr/bin/ditto "${CACHE_BUILD}/OpenJDKRuntime.framework" "${GENERATED_FRAMEWORK}"
/usr/bin/ditto "${GENERATED_FRAMEWORK}" "${FRAMEWORKS_ROOT}/OpenJDKRuntime.framework"
/bin/cp "${SERVER_JAR}" "${RESOURCE_ROOT}/MExtensionServer.jar"
/bin/cp "${CACHE_BUILD}/java-logging-shim.jar" "${RESOURCE_ROOT}/java-logging-shim.jar"
/bin/cp "${CACHE_BUILD}/lib/security/cacerts" "${RESOURCE_ROOT}/lib/security/cacerts"
/bin/cp "${CACHE_BUILD}/release" "${RESOURCE_ROOT}/release"
/bin/cp "${SRCROOT}/EmbeddedMihon/THIRD_PARTY_NOTICES.md" "${RESOURCE_ROOT}/EMBEDDED_MIHON_NOTICES.md"

SIGNING_IDENTITY="${EXPANDED_CODE_SIGN_IDENTITY:--}"
[ -n "${SIGNING_IDENTITY}" ] || SIGNING_IDENTITY="-"
/usr/bin/codesign --force --sign "${SIGNING_IDENTITY}" --timestamp=none \
  "${FRAMEWORKS_ROOT}/OpenJDKRuntime.framework"

write_mode_stamp "platform=iphoneos;server=YES;version=${SERVER_VERSION};sha256=${SERVER_SHA256};runtime=${RUNTIME_RELEASE}"
echo "Provisioned lazy OpenJDK Zero runtime and embedded M-Extension-Server"
```
[chapter-file-end]: #

[chapter-file-start]: #iosApp/Runner-Bridging-Header.h
### Write `iosApp/Runner-Bridging-Header.h`

Create this path in your reconstruction project. Source set: **build / host / supporting material**. [Exact file download](../reference/source/iosApp/Runner-Bridging-Header.h).

```cpp
#import "MihonEmbeddedBridge.h"
```
[chapter-file-end]: #

[chapter-file-start]: #iosApp/iosApp.xcodeproj/project.pbxproj
### Write `iosApp/iosApp.xcodeproj/project.pbxproj`

Create this path in your reconstruction project. Source set: **build / host / supporting material**. [Exact file download](../reference/source/iosApp/iosApp.xcodeproj/project.pbxproj).

```text
// !$*UTF8*$!
{
	archiveVersion = 1;
	classes = {
	};
	objectVersion = 56;
	objects = {

/* Begin PBXBuildFile section */
        AC1000000000000000000001 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AC1000000000000000000002 /* Assets.xcassets */; };
		9A1A4E982D2C000100001001 /* YokanApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A1A4E972D2C000100001001 /* YokanApp.swift */; };
		9A1A4EB32D2C000100001001 /* MihonEmbeddedBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9A1A4EB22D2C000100001001 /* MihonEmbeddedBridge.mm */; };
		CA1000000000000000000001 /* PanelColorizerBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = CA1000000000000000000002; };
		CA1000000000000000000003 /* onnxruntime in Frameworks */ = {isa = PBXBuildFile; productRef = CA1000000000000000000004; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
        AC1000000000000000000002 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
		9A1A4E932D2C000100001001 /* Yokan.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Yokan.app; sourceTree = BUILT_PRODUCTS_DIR; };
		9A1A4E972D2C000100001001 /* YokanApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YokanApp.swift; sourceTree = "<group>"; };
		9A1A4E992D2C000100001001 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
		9A1A4E9A2D2C000100001001 /* BuildSharedFramework.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = BuildSharedFramework.sh; sourceTree = "<group>"; };
		9A1A4EB02D2C000100001001 /* PrepareExtensionRuntime.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = PrepareExtensionRuntime.sh; sourceTree = "<group>"; };
		9A1A4EB22D2C000100001001 /* MihonEmbeddedBridge.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MihonEmbeddedBridge.mm; sourceTree = "<group>"; };
		9A1A4EB42D2C000100001001 /* MihonEmbeddedBridge.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MihonEmbeddedBridge.h; sourceTree = "<group>"; };
		9A1A4EB52D2C000100001001 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
		9A1A4E9B2D2C000100001001 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
		AC2000000000000000000001 /* version.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ../version.xcconfig; sourceTree = "<group>"; };
		CA1000000000000000000002 /* PanelColorizerBridge.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = PanelColorizerBridge.mm; sourceTree = "<group>"; };
		CA1000000000000000000005 /* PanelColorizerBridge.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PanelColorizerBridge.h; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
		9A1A4E902D2C000100001001 /* Frameworks */ = {
			isa = PBXFrameworksBuildPhase;
			buildActionMask = 2147483647;
			files = (
				CA1000000000000000000003 /* onnxruntime in Frameworks */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
		9A1A4E8A2D2C000100001001 = {
			isa = PBXGroup;
			children = (
				CA1000000000000000000002 /* PanelColorizerBridge.mm */,
				CA1000000000000000000005 /* PanelColorizerBridge.h */,
				9A1A4E972D2C000100001001 /* YokanApp.swift */,
				9A1A4EB22D2C000100001001 /* MihonEmbeddedBridge.mm */,
				9A1A4EB42D2C000100001001 /* MihonEmbeddedBridge.h */,
				9A1A4EB52D2C000100001001 /* Runner-Bridging-Header.h */,
				9A1A4E992D2C000100001001 /* Info.plist */,
                AC1000000000000000000002 /* Assets.xcassets */,
				9A1A4E9A2D2C000100001001 /* BuildSharedFramework.sh */,
				9A1A4EB02D2C000100001001 /* PrepareExtensionRuntime.sh */,
				9A1A4E9B2D2C000100001001 /* README.md */,
				AC2000000000000000000001 /* version.xcconfig */,
				9A1A4E942D2C000100001001 /* Products */,
			);
			sourceTree = "<group>";
		};
		9A1A4E942D2C000100001001 /* Products */ = {
			isa = PBXGroup;
			children = (
				9A1A4E932D2C000100001001 /* Yokan.app */,
			);
			name = Products;
			sourceTree = "<group>";
		};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
		9A1A4E922D2C000100001001 /* iosApp */ = {
			isa = PBXNativeTarget;
			buildConfigurationList = 9A1A4EA12D2C000100001001 /* Build configuration list for PBXNativeTarget "iosApp" */;
			buildPhases = (
				9A1A4E962D2C000100001001 /* Build shared framework */,
				9A1A4EB12D2C000100001001 /* Prepare sideloaded extension runtime */,
				9A1A4E8F2D2C000100001001 /* Sources */,
				9A1A4E902D2C000100001001 /* Frameworks */,
				9A1A4E912D2C000100001001 /* Resources */,
			);
			buildRules = (
			);
			dependencies = (
			);
			name = iosApp;
			packageProductDependencies = (CA1000000000000000000004 /* onnxruntime */,);
			productName = Yokan;
			productReference = 9A1A4E932D2C000100001001 /* Yokan.app */;
			productType = "com.apple.product-type.application";
		};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
		9A1A4E8B2D2C000100001001 /* Project object */ = {
			isa = PBXProject;
			attributes = {
				BuildIndependentTargetsInParallel = 1;
				LastSwiftUpdateCheck = 1600;
				LastUpgradeCheck = 1600;
				TargetAttributes = {
					9A1A4E922D2C000100001001 = {
						CreatedOnToolsVersion = 16.0;
					};
				};
			};
			buildConfigurationList = 9A1A4E8E2D2C000100001001 /* Build configuration list for PBXProject "iosApp" */;
			compatibilityVersion = "Xcode 14.0";
			developmentRegion = en;
			hasScannedForEncodings = 0;
			knownRegions = (
				en,
				Base,
			);
			mainGroup = 9A1A4E8A2D2C000100001001;
			productRefGroup = 9A1A4E942D2C000100001001 /* Products */;
			packageReferences = (CA1000000000000000000006 /* onnxruntime */,);
			projectDirPath = "";
			projectRoot = "";
			targets = (
				9A1A4E922D2C000100001001 /* iosApp */,
			);
		};
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
		9A1A4E912D2C000100001001 /* Resources */ = {
			isa = PBXResourcesBuildPhase;
			buildActionMask = 2147483647;
			files = (
                AC1000000000000000000001 /* Assets.xcassets in Resources */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
		9A1A4E962D2C000100001001 /* Build shared framework */ = {
			isa = PBXShellScriptBuildPhase;
			alwaysOutOfDate = 1;
			buildActionMask = 2147483647;
			files = (
			);
			inputFileListPaths = (
			);
			inputPaths = (
			);
			name = "Build shared framework";
			outputFileListPaths = (
			);
			outputPaths = (
				"$(TARGET_BUILD_DIR)/$(FRAMEWORKS_FOLDER_PATH)/YokanShared.framework",
			);
			runOnlyForDeploymentPostprocessing = 0;
			shellPath = /bin/sh;
			shellScript = "/bin/sh \"$SRCROOT/BuildSharedFramework.sh\"\n";
		};
		9A1A4EB12D2C000100001001 /* Prepare sideloaded extension runtime */ = {
			isa = PBXShellScriptBuildPhase;
			alwaysOutOfDate = 1;
			buildActionMask = 2147483647;
			files = (
			);
			inputFileListPaths = (
			);
			inputPaths = (
				"$(SRCROOT)/PrepareExtensionRuntime.sh",
			);
			name = "Prepare sideloaded extension runtime";
			outputFileListPaths = (
			);
			outputPaths = (
				"$(TARGET_BUILD_DIR)/$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/.yokan-extension-runtime-mode",
			);
			runOnlyForDeploymentPostprocessing = 0;
			shellPath = /bin/sh;
			shellScript = "/bin/sh \"$SRCROOT/PrepareExtensionRuntime.sh\"\n";
		};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
		9A1A4E8F2D2C000100001001 /* Sources */ = {
			isa = PBXSourcesBuildPhase;
			buildActionMask = 2147483647;
			files = (
				CA1000000000000000000001 /* PanelColorizerBridge.mm in Sources */,
				9A1A4E982D2C000100001001 /* YokanApp.swift in Sources */,
				9A1A4EB32D2C000100001001 /* MihonEmbeddedBridge.mm in Sources */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXSourcesBuildPhase section */

/* Begin XCRemoteSwiftPackageReference section */
		CA1000000000000000000006 = {isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/microsoft/onnxruntime-swift-package-manager"; requirement = {kind = exactVersion; version = 1.24.2; }; };
/* End XCRemoteSwiftPackageReference section */
/* Begin XCSwiftPackageProductDependency section */
		CA1000000000000000000004 = {isa = XCSwiftPackageProductDependency; package = CA1000000000000000000006; productName = onnxruntime; };
/* End XCSwiftPackageProductDependency section */

/* Begin XCBuildConfiguration section */
		9A1A4E9C2D2C000100001001 /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;
				CLANG_ANALYZER_NONNULL = YES;
				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
				CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
				CLANG_ENABLE_MODULES = YES;
				CLANG_ENABLE_OBJC_ARC = YES;
				CLANG_ENABLE_OBJC_WEAK = YES;
				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
				CLANG_WARN_BOOL_CONVERSION = YES;
				CLANG_WARN_COMMA = YES;
				CLANG_WARN_CONSTANT_CONVERSION = YES;
				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
				CLANG_WARN_EMPTY_BODY = YES;
				CLANG_WARN_ENUM_CONVERSION = YES;
				CLANG_WARN_INFINITE_RECURSION = YES;
				CLANG_WARN_INT_CONVERSION = YES;
				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
				CLANG_WARN_STRICT_PROTOTYPES = YES;
				CLANG_WARN_SUSPICIOUS_MOVE = YES;
				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
				CLANG_WARN_UNREACHABLE_CODE = YES;
				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
				COPY_PHASE_STRIP = NO;
				DEBUG_INFORMATION_FORMAT = dwarf;
				ENABLE_STRICT_OBJC_MSGSEND = YES;
				ENABLE_TESTABILITY = YES;
				GCC_C_LANGUAGE_STANDARD = gnu17;
				GCC_DYNAMIC_NO_PIC = NO;
				GCC_NO_COMMON_BLOCKS = YES;
				GCC_OPTIMIZATION_LEVEL = 0;
				GCC_PREPROCESSOR_DEFINITIONS = (
					"DEBUG=1",
					"$(inherited)",
				);
				IPHONEOS_DEPLOYMENT_TARGET = 15.0;
				MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
				MTL_FAST_MATH = YES;
				ONLY_ACTIVE_ARCH = YES;
				SDKROOT = iphoneos;
				SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
			};
			name = Debug;
		};
		9A1A4E9D2D2C000100001001 /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;
				CLANG_ANALYZER_NONNULL = YES;
				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
				CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
				CLANG_ENABLE_MODULES = YES;
				CLANG_ENABLE_OBJC_ARC = YES;
				CLANG_ENABLE_OBJC_WEAK = YES;
				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
				CLANG_WARN_BOOL_CONVERSION = YES;
				CLANG_WARN_COMMA = YES;
				CLANG_WARN_CONSTANT_CONVERSION = YES;
				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
				CLANG_WARN_EMPTY_BODY = YES;
				CLANG_WARN_ENUM_CONVERSION = YES;
				CLANG_WARN_INFINITE_RECURSION = YES;
				CLANG_WARN_INT_CONVERSION = YES;
				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
				CLANG_WARN_STRICT_PROTOTYPES = YES;
				CLANG_WARN_SUSPICIOUS_MOVE = YES;
				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
				CLANG_WARN_UNREACHABLE_CODE = YES;
				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
				COPY_PHASE_STRIP = NO;
				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
				ENABLE_NS_ASSERTIONS = NO;
				ENABLE_STRICT_OBJC_MSGSEND = YES;
				GCC_C_LANGUAGE_STANDARD = gnu17;
				GCC_NO_COMMON_BLOCKS = YES;
				IPHONEOS_DEPLOYMENT_TARGET = 15.0;
				MTL_ENABLE_DEBUG_INFO = NO;
				MTL_FAST_MATH = YES;
				SDKROOT = iphoneos;
				SWIFT_COMPILATION_MODE = wholemodule;
				SWIFT_OPTIMIZATION_LEVEL = "-O";
				VALIDATE_PRODUCT = YES;
			};
			name = Release;
		};
		9A1A4E9E2D2C000100001001 /* Debug */ = {
			isa = XCBuildConfiguration;
			baseConfigurationReference = AC2000000000000000000001 /* version.xcconfig */;
			buildSettings = {
				CODE_SIGN_STYLE = Automatic;
				DEVELOPMENT_TEAM = 43AJFR8GS7;
				ENABLE_USER_SCRIPT_SANDBOXING = NO;
				FRAMEWORK_SEARCH_PATHS = (
					"$(inherited)",
					"$(SRCROOT)/../composeApp/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)",
				);
				"HEADER_SEARCH_PATHS[sdk=iphoneos*]" = "$(TARGET_TEMP_DIR)/OpenJDKRuntime.framework/Headers";
				GCC_PREPROCESSOR_DEFINITIONS = (
					"$(inherited)",
					"YOKAN_SIDELOAD_RUNTIME_ENABLED=$(YOKAN_SIDELOAD_RUNTIME_ENABLED)",
				);
				"FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]" = (
					"$(inherited)",
					"$(TARGET_BUILD_DIR)/$(FRAMEWORKS_FOLDER_PATH)",
				);
				"FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]" = (
					"$(inherited)",
					"$(TARGET_BUILD_DIR)/$(FRAMEWORKS_FOLDER_PATH)",
				);
                ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
                ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES = "ToriiLight ToriiDark ToriiSystem";
                ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
				GENERATE_INFOPLIST_FILE = NO;
				INFOPLIST_FILE = Info.plist;
				IPHONEOS_DEPLOYMENT_TARGET = 15.0;
				LD_RUNPATH_SEARCH_PATHS = (
					"$(inherited)",
					"@executable_path/Frameworks",
				);
				OTHER_LDFLAGS = (
					"$(inherited)",
					"-framework",
					YokanShared,
				);
				"OTHER_LDFLAGS[sdk=iphoneos*]" = (
					"$(inherited)",
					"-Wl,-needed_framework,Mpv",
					"-Wl,-needed_framework,Lua",
				);
				PRODUCT_BUNDLE_IDENTIFIER = eu.friedcutlet.yokan;
				PRODUCT_BUNDLE_PACKAGE_TYPE = APPL;
				PRODUCT_NAME = Yokan;
				SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
				SWIFT_EMIT_LOC_STRINGS = YES;
				SWIFT_OBJC_BRIDGING_HEADER = "Runner-Bridging-Header.h";
				SWIFT_VERSION = 5.0;
				YOKAN_SIDELOAD_RUNTIME = YES;
				YOKAN_SIDELOAD_RUNTIME_ENABLED = 1;
				TARGETED_DEVICE_FAMILY = "1,2";
			};
			name = Debug;
		};
		9A1A4E9F2D2C000100001001 /* Release */ = {
			isa = XCBuildConfiguration;
			baseConfigurationReference = AC2000000000000000000001 /* version.xcconfig */;
			buildSettings = {
				CODE_SIGN_STYLE = Automatic;
				DEVELOPMENT_TEAM = 43AJFR8GS7;
				ENABLE_USER_SCRIPT_SANDBOXING = NO;
				FRAMEWORK_SEARCH_PATHS = (
					"$(inherited)",
					"$(SRCROOT)/../composeApp/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)",
				);
				"HEADER_SEARCH_PATHS[sdk=iphoneos*]" = "$(TARGET_TEMP_DIR)/OpenJDKRuntime.framework/Headers";
				GCC_PREPROCESSOR_DEFINITIONS = (
					"$(inherited)",
					"YOKAN_SIDELOAD_RUNTIME_ENABLED=$(YOKAN_SIDELOAD_RUNTIME_ENABLED)",
				);
				"FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]" = (
					"$(inherited)",
					"$(TARGET_BUILD_DIR)/$(FRAMEWORKS_FOLDER_PATH)",
				);
				"FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]" = (
					"$(inherited)",
					"$(TARGET_BUILD_DIR)/$(FRAMEWORKS_FOLDER_PATH)",
				);
                ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
                ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES = "ToriiLight ToriiDark ToriiSystem";
                ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
				GENERATE_INFOPLIST_FILE = NO;
				INFOPLIST_FILE = Info.plist;
				IPHONEOS_DEPLOYMENT_TARGET = 15.0;
				LD_RUNPATH_SEARCH_PATHS = (
					"$(inherited)",
					"@executable_path/Frameworks",
				);
				OTHER_LDFLAGS = (
					"$(inherited)",
					"-framework",
					YokanShared,
				);
				"OTHER_LDFLAGS[sdk=iphoneos*]" = (
					"$(inherited)",
					"-Wl,-needed_framework,Mpv",
					"-Wl,-needed_framework,Lua",
				);
				PRODUCT_BUNDLE_IDENTIFIER = eu.friedcutlet.yokan;
				PRODUCT_BUNDLE_PACKAGE_TYPE = APPL;
				PRODUCT_NAME = Yokan;
				SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
				SWIFT_EMIT_LOC_STRINGS = YES;
				SWIFT_OBJC_BRIDGING_HEADER = "Runner-Bridging-Header.h";
				SWIFT_VERSION = 5.0;
				YOKAN_SIDELOAD_RUNTIME = NO;
				YOKAN_SIDELOAD_RUNTIME_ENABLED = 0;
				TARGETED_DEVICE_FAMILY = "1,2";
			};
			name = Release;
		};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
		9A1A4E8E2D2C000100001001 /* Build configuration list for PBXProject "iosApp" */ = {
			isa = XCConfigurationList;
			buildConfigurations = (
				9A1A4E9C2D2C000100001001 /* Debug */,
				9A1A4E9D2D2C000100001001 /* Release */,
			);
			defaultConfigurationIsVisible = 0;
			defaultConfigurationName = Release;
		};
		9A1A4EA12D2C000100001001 /* Build configuration list for PBXNativeTarget "iosApp" */ = {
			isa = XCConfigurationList;
			buildConfigurations = (
				9A1A4E9E2D2C000100001001 /* Debug */,
				9A1A4E9F2D2C000100001001 /* Release */,
			);
			defaultConfigurationIsVisible = 0;
			defaultConfigurationName = Release;
		};
/* End XCConfigurationList section */
	};
	rootObject = 9A1A4E8B2D2C000100001001 /* Project object */;
}
```
[chapter-file-end]: #

[chapter-file-start]: #iosApp/iosApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
### Write `iosApp/iosApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved`

Create this path in your reconstruction project. Source set: **build / host / supporting material**. [Exact file download](../reference/source/iosApp/iosApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved).

```text
{
  "originHash" : "54a530a8a66c1ee0cc1c6dd34159a96243f09d436e10ae5178973082bff1ef28",
  "pins" : [
    {
      "identity" : "onnxruntime-swift-package-manager",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/microsoft/onnxruntime-swift-package-manager",
      "state" : {
        "revision" : "b7fb7f7dea8a2469e6335d95a61b8f36d0dc83b2",
        "version" : "1.24.2"
      }
    }
  ],
  "version" : 3
}
```
[chapter-file-end]: #

[chapter-file-start]: #iosApp/iosApp.xcodeproj/project.xcworkspace/xcuserdata/duongph.xcuserdatad/UserInterfaceState.xcuserstate
### Write `iosApp/iosApp.xcodeproj/project.xcworkspace/xcuserdata/duongph.xcuserdatad/UserInterfaceState.xcuserstate`

Create this path in your reconstruction project. Source set: **build / host / supporting material**. [Exact file download](../reference/source/iosApp/iosApp.xcodeproj/project.xcworkspace/xcuserdata/duongph.xcuserdatad/UserInterfaceState.xcuserstate).

This file is binary. Retain the downloaded asset at this exact path, with its applicable license. It is an input to the code/configuration in this step; it cannot be recreated by typing a Kotlin snippet.
[chapter-file-end]: #

[chapter-file-start]: #iosApp/iosApp.xcodeproj/xcshareddata/xcschemes/iosApp.xcscheme
### Write `iosApp/iosApp.xcodeproj/xcshareddata/xcschemes/iosApp.xcscheme`

Create this path in your reconstruction project. Source set: **build / host / supporting material**. [Exact file download](../reference/source/iosApp/iosApp.xcodeproj/xcshareddata/xcschemes/iosApp.xcscheme).

```text
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
   LastUpgradeVersion = "1600"
   version = "1.7">
   <BuildAction
      parallelizeBuildables = "YES"
      buildImplicitDependencies = "YES"
      buildArchitectures = "Automatic">
      <BuildActionEntries>
         <BuildActionEntry
            buildForTesting = "YES"
            buildForRunning = "YES"
            buildForProfiling = "YES"
            buildForArchiving = "YES"
            buildForAnalyzing = "YES">
            <BuildableReference
               BuildableIdentifier = "primary"
               BlueprintIdentifier = "9A1A4E922D2C000100001001"
               BuildableName = "Yokan.app"
               BlueprintName = "iosApp"
               ReferencedContainer = "container:iosApp.xcodeproj">
            </BuildableReference>
         </BuildActionEntry>
      </BuildActionEntries>
   </BuildAction>
   <TestAction
      buildConfiguration = "Debug"
      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
      shouldUseLaunchSchemeArgsEnv = "YES">
   </TestAction>
   <LaunchAction
      buildConfiguration = "Debug"
      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
      launchStyle = "0"
      useCustomWorkingDirectory = "NO"
      ignoresPersistentStateOnLaunch = "NO"
      debugDocumentVersioning = "YES"
      debugServiceExtension = "internal"
      allowLocationSimulation = "YES">
      <BuildableProductRunnable
         runnableDebuggingMode = "0">
         <BuildableReference
            BuildableIdentifier = "primary"
            BlueprintIdentifier = "9A1A4E922D2C000100001001"
            BuildableName = "Yokan.app"
            BlueprintName = "iosApp"
            ReferencedContainer = "container:iosApp.xcodeproj">
         </BuildableReference>
      </BuildableProductRunnable>
   </LaunchAction>
   <ProfileAction
      buildConfiguration = "Release"
      shouldUseLaunchSchemeArgsEnv = "YES"
      savedToolIdentifier = ""
      useCustomWorkingDirectory = "NO"
      debugDocumentVersioning = "YES">
      <BuildableProductRunnable
         runnableDebuggingMode = "0">
         <BuildableReference
            BuildableIdentifier = "primary"
            BlueprintIdentifier = "9A1A4E922D2C000100001001"
            BuildableName = "Yokan.app"
            BlueprintName = "iosApp"
            ReferencedContainer = "container:iosApp.xcodeproj">
         </BuildableReference>
      </BuildableProductRunnable>
   </ProfileAction>
   <AnalyzeAction
      buildConfiguration = "Debug">
   </AnalyzeAction>
   <ArchiveAction
      buildConfiguration = "Release"
      revealArchiveInOrganizer = "YES">
   </ArchiveAction>
</Scheme>
```
[chapter-file-end]: #

[chapter-file-start]: #iosApp/iosApp.xcodeproj/xcuserdata/duongph.xcuserdatad/xcschemes/xcschememanagement.plist
### Write `iosApp/iosApp.xcodeproj/xcuserdata/duongph.xcuserdatad/xcschemes/xcschememanagement.plist`

Create this path in your reconstruction project. Source set: **build / host / supporting material**. [Exact file download](../reference/source/iosApp/iosApp.xcodeproj/xcuserdata/duongph.xcuserdatad/xcschemes/xcschememanagement.plist).

```text
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict />
</plist>
```
[chapter-file-end]: #

### Check your understanding

Inspect an archive for required frameworks, server/runtime payloads and notices. Separately launch on simulator and device and record which native capabilities are available.
[chapter-content-end]: #


## Step 5: browser host

Create the Compose viewport entry point, HTML/webpack resources and incoming page-parameter links. Use snapshot persistence and browser file inventory/OPFS, plus service-worker media serving where implemented. Rebuild browser storage interop and cleanup; test reload, missing/quota-denied storage and tab lifecycle.

Use Ktor JS, HTML video compatibility playback and browser capability actuals. QuickJS, Room/SQLite, local JVM server and libmpv are not available. Remote services depend on CORS; extra-profile cookie/WebSocket restrictions remain explicit. Custom OS file associations/native privacy APIs are unavailable. Register only the resources/features present in source; there is no existing PWA manifest to assume.

[chapter-content-start]: #
### Follow the code

The browser entry point mounts the shared app and normalizes incoming page parameters. Snapshot storage and file inventory/OPFS supply persistence/media; HTML video supplies compatibility playback. Native Room/JVM/mpv/QuickJS capabilities remain unavailable. Handle storage denial, reload and tab cleanup without pretending an empty snapshot is successful recovery. Remote services additionally depend on server CORS behavior.

Write these files in this order:

- `composeApp/src/wasmJsMain/kotlin/eu/friedcutlet/yokan/BrowserPersistenceWarning.kt`
- `composeApp/src/wasmJsMain/kotlin/eu/friedcutlet/yokan/Main.kt`
- `composeApp/src/wasmJsMain/kotlin/eu/friedcutlet/yokan/services/Concurrency.wasm.kt`
- `composeApp/src/wasmJsMain/resources/browser-archives.js`
- `composeApp/src/wasmJsMain/resources/browser-files-sw.js`
- `composeApp/src/wasmJsMain/resources/browser-storage.js`
- `composeApp/src/wasmJsMain/resources/favicon.png`
- `composeApp/src/wasmJsMain/resources/index.html`
- `composeApp/src/wasmJsMain/resources/vendor/zipjs-2.23.0/LICENSE`
- `composeApp/src/wasmJsMain/resources/vendor/zipjs-2.23.0/zip-native.min.js`

[chapter-file-start]: #composeApp/src/wasmJsMain/kotlin/eu/friedcutlet/yokan/BrowserPersistenceWarning.kt
### Write `composeApp/src/wasmJsMain/kotlin/eu/friedcutlet/yokan/BrowserPersistenceWarning.kt`

Create this path in your reconstruction project. Source set: **wasmJsMain**. [Exact file download](../reference/source/composeApp/src/wasmJsMain/kotlin/eu/friedcutlet/yokan/BrowserPersistenceWarning.kt).

The implementation below defines `BrowserPersistenceWarning`.

Cross-chapter imports used by this file: [`SnapshotYokanDatabase`](../chapters/03-persistence-and-migrations.md), [`YokanRuntime`](../chapters/04-profiles-and-lifetimes.md), [`BackupOptions`](../chapters/20-backup-and-restore.md), [`triggerBrowserDownload`](../chapters/24-settings-and-integrations.md). Keep those contracts available as you connect this step.

```kotlin
package eu.friedcutlet.yokan

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import eu.friedcutlet.yokan.database.SnapshotYokanDatabase
import eu.friedcutlet.yokan.app.YokanRuntime
import eu.friedcutlet.yokan.services.backup.BackupOptions
import eu.friedcutlet.yokan.services.system.triggerBrowserDownload
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.launch
import org.jetbrains.compose.resources.stringResource
import yokan.composeapp.generated.resources.*


private val browserDatabase: SnapshotYokanDatabase get() = YokanRuntime.database as SnapshotYokanDatabase

@Composable
internal fun BrowserPersistenceWarning() {
    val failed by browserDatabase.saveFailed.collectAsStateWithLifecycle()
    if (!failed) return
    val scope = rememberCoroutineScope()
    var exporting by remember { mutableStateOf(false) }
    var exportFailed by remember { mutableStateOf(false) }
    Surface(color = MaterialTheme.colorScheme.errorContainer, modifier = Modifier.fillMaxWidth()) {
        Column(Modifier.padding(12.dp)) {
            Text(stringResource(Res.string.browser_save_failed))
            if (exportFailed) Text(stringResource(Res.string.browser_export_failed))
            if (exporting) Text(stringResource(Res.string.browser_exporting_backup))
            Column {
                TextButton(onClick = { browserDatabase.persist() }) {
                    Text(stringResource(Res.string.browser_retry_save))
                }
                TextButton(enabled = !exporting, onClick = {
                    exporting = true
                    exportFailed = false
                    scope.launch {
                        try {
                            val backup = YokanRuntime.services.backup
                            val settings = browserDatabase.settings()
                            val export = if (settings.backupEncryptionEnabled) {
                                backup.exportEncryptedBackup(BackupOptions(), requireNotNull(settings.backupEncryptionPassword))
                            } else backup.exportBackup(BackupOptions())
                            exportFailed = !triggerBrowserDownload(export.bytes, export.fileName, export.contentType)
                        } catch (error: Throwable) {
                            if (error is CancellationException) throw error
                            exportFailed = true
                        } finally {
                            exporting = false
                        }
                    }
                }) { Text(stringResource(Res.string.browser_export_backup)) }
            }
        }
    }
}
```
[chapter-file-end]: #

[chapter-file-start]: #composeApp/src/wasmJsMain/kotlin/eu/friedcutlet/yokan/Main.kt
### Write `composeApp/src/wasmJsMain/kotlin/eu/friedcutlet/yokan/Main.kt`

Create this path in your reconstruction project. Source set: **wasmJsMain**. [Exact file download](../reference/source/composeApp/src/wasmJsMain/kotlin/eu/friedcutlet/yokan/Main.kt).

The implementation below defines `main`.

Cross-chapter imports used by this file: [`YokanRuntime`](../chapters/04-profiles-and-lifetimes.md), [`YokanApp`](../chapters/10-navigation-and-design-system.md). Keep those contracts available as you connect this step.

```kotlin
package eu.friedcutlet.yokan

import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.ui.Modifier
import androidx.compose.ui.window.ComposeViewport
import eu.friedcutlet.yokan.app.YokanRuntime
import eu.friedcutlet.yokan.ui.YokanApp
import kotlinx.browser.document
import kotlinx.coroutines.MainScope
import kotlinx.coroutines.launch
import eu.friedcutlet.yokan.services.catchingNonCancellation

@OptIn(ExperimentalComposeUiApi::class)
fun main() {
    MainScope().launch {
    catchingNonCancellation { YokanRuntime.localFiles.prepare() }
    YokanRuntime.bootstrap()
    ComposeViewport(document.body!!) {
        Column(Modifier.fillMaxSize()) {
            BrowserPersistenceWarning()
            Box(Modifier.weight(1f)) { YokanApp() }
        }
    }
    }
}
```
[chapter-file-end]: #

[chapter-file-start]: #composeApp/src/wasmJsMain/kotlin/eu/friedcutlet/yokan/services/Concurrency.wasm.kt
### Write `composeApp/src/wasmJsMain/kotlin/eu/friedcutlet/yokan/services/Concurrency.wasm.kt`

Create this path in your reconstruction project. Source set: **wasmJsMain**. [Exact file download](../reference/source/composeApp/src/wasmJsMain/kotlin/eu/friedcutlet/yokan/services/Concurrency.wasm.kt).

The implementation below defines `runBlockingCompat`.

```kotlin
package eu.friedcutlet.yokan.services

import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlin.coroutines.CoroutineContext

actual fun <T> runBlockingCompat(context: CoroutineContext, block: suspend CoroutineScope.() -> T): T =
    throw UnsupportedOperationException("The browser cannot block on suspending work.")

actual val blockingDispatcher: CoroutineDispatcher = Dispatchers.Default
```
[chapter-file-end]: #

[chapter-file-start]: #composeApp/src/wasmJsMain/resources/browser-archives.js
### Write `composeApp/src/wasmJsMain/resources/browser-archives.js`

Create this path in your reconstruction project. Source set: **wasmJsMain**. [Exact file download](../reference/source/composeApp/src/wasmJsMain/resources/browser-archives.js).

```javascript
/* Bounded, streaming ZIP/CBZ access. zip.js is vendored and loaded only when archives are used. */
(() => {
    'use strict';
    const base = typeof document === 'undefined' ? new URL('.', self.location.href) : new URL('.', document.currentScript?.src || document.baseURI);
    const maximumEntries = 10000, maximumEntryBytes = 64 * 1024 * 1024, maximumDirectoryBytes = 4 * 1024 * 1024;
    let library;
    async function zipLibrary() {
        if (globalThis.zip) return globalThis.zip;
        if (!library) library = (async () => {
            const url = new URL('vendor/zipjs-2.23.0/zip-native.min.js', base).href;
            if (typeof importScripts === 'function') importScripts(url);
            else await new Promise((resolve, reject) => {
                const script = document.createElement('script');
                script.src = url; script.onload = resolve; script.onerror = () => reject(new Error('Archive support could not load.'));
                document.head.append(script);
            });
            return globalThis.zip;
        })().catch(error => { library = null; throw error; });
        return library;
    }
    function safeName(name) {
        return typeof name === 'string' && name.length > 0 && name.length <= 1024 &&
            !/[\\\0:]/.test(name) && !name.startsWith('/') && name.split('/').every(part => part && part !== '.' && part !== '..');
    }
    // Bound the central directory before the library allocates its index. ZIP64/split archives are explicit limits.
    async function preflight(file) {
        if (file.size < 22 || file.size >= 0xffffffff) throw new Error('Unsupported archive size.');
        const tail = new DataView(await file.slice(Math.max(0, file.size - 65557)).arrayBuffer());
        for (let i = tail.byteLength - 22; i >= 0; i--) {
            if (tail.getUint32(i, true) !== 0x06054b50 || i + 22 + tail.getUint16(i + 20, true) !== tail.byteLength) continue;
            const count = tail.getUint16(i + 10, true), size = tail.getUint32(i + 12, true), offset = tail.getUint32(i + 16, true);
            if (tail.getUint16(i + 4, true) || tail.getUint16(i + 6, true) || tail.getUint16(i + 8, true) !== count ||
                count > maximumEntries || size > maximumDirectoryBytes || offset + size > file.size - tail.byteLength + i) throw new Error('Unsupported archive index.');
            return;
        }
        throw new Error('Invalid archive directory.');
    }
    async function open(file) {
        await preflight(file);
        const zip = await zipLibrary();
        const reader = new zip.ZipReader(new zip.BlobReader(file), { useWebWorkers: false, checkCrc32: true, checkOverlappingEntry: true });
        try {
            const entries = new Map();
            for await (const entry of reader.getEntriesGenerator()) {
                if (entry.directory) continue;
                if (entries.size >= maximumEntries || !safeName(entry.filename) || entries.has(entry.filename) || entry.encrypted ||
                    !Number.isSafeInteger(entry.uncompressedSize) || entry.uncompressedSize < 0 || entry.uncompressedSize > maximumEntryBytes) throw new Error('Unsupported archive entry.');
                entries.set(entry.filename, entry);
            }
            return { reader, entries };
        } catch (error) { await reader.close(); throw error; }
    }
    async function index(file) {
        const archive = await open(file);
        try { return [...archive.entries.values()].map(entry => ({ name: entry.filename, size: entry.uncompressedSize })); }
        finally { await archive.reader.close(); }
    }
    // One bounded index and File snapshot for a manifest/chapter read. No whole-book extraction.
    async function openRead(file) {
        const archive = await open(file);
        let closed = false;
        return {
            async read(name, maximum) {
                if (closed || !safeName(name) || !Number.isSafeInteger(maximum) || maximum < 0 || maximum > 16 * 1024 * 1024) throw new Error('Invalid archive read.');
                const selected = archive.entries.get(name);
                if (!selected) return null;
                if (selected.uncompressedSize > maximum) throw new Error('EPUB resource exceeds the read limit.');
                const chunks = [];
                let size = 0;
                await selected.getData(new WritableStream({ write(bytes) {
                    size += bytes.byteLength;
                    if (size > maximum || size > selected.uncompressedSize) throw new Error('EPUB resource exceeds its size limit.');
                    chunks.push(bytes.slice());
                } }), { useWebWorkers: false, checkCrc32: true });
                if (size !== selected.uncompressedSize) throw new Error('Incomplete EPUB resource.');
                const output = new Uint8Array(size);
                let offset = 0;
                for (const chunk of chunks) { output.set(chunk, offset); offset += chunk.byteLength; }
                return output;
            },
            async close() { if (!closed) { closed = true; await archive.reader.close(); } },
        };
    }
    async function entry(file, name, metadataOnly = false) {
        if (!safeName(name)) throw new Error('Invalid archive entry path.');
        const archive = await open(file);
        const selected = archive.entries.get(name);
        if (!selected) { await archive.reader.close(); const error = new Error('Archive entry no longer exists.'); error.name = 'NotFoundError'; throw error; }
        if (metadataOnly) { await archive.reader.close(); return { size: selected.uncompressedSize }; }
        let received = 0;
        const stream = new TransformStream({ transform(bytes, controller) {
            received += bytes.byteLength;
            if (received > maximumEntryBytes || received > selected.uncompressedSize) throw new Error('Archive entry exceeds its size limit.');
            controller.enqueue(bytes);
        } });
        const writer = stream.writable.getWriter();
        const output = new WritableStream({ write: bytes => writer.write(bytes) });
        // Close only after CRC and size validation, so corrupt archives fail the consuming fetch.
        const done = selected.getData(output, { useWebWorkers: false, checkCrc32: true, preventClose: true })
            .then(async () => { if (received !== selected.uncompressedSize) throw new Error('Incomplete archive entry.'); await writer.close(); })
            .catch(async error => { await writer.abort(error).catch(() => {}); })
            .finally(() => archive.reader.close());
        return { stream: stream.readable, size: selected.uncompressedSize, done };
    }
    async function write(files, output) {
        if (!files.length || files.length > maximumEntries || files.some(file => !safeName(file.name) || file.bytes.size > maximumEntryBytes)) throw new Error('Unsupported archive contents.');
        const zip = await zipLibrary();
        const writer = new zip.ZipWriter(output, { useWebWorkers: false, level: 0, zip64: false, preventClose: true });
        for (const file of files) await writer.add(file.name, new zip.BlobReader(file.bytes), { level: 0, zip64: false });
        await writer.close();
    }
    globalThis.yokanBrowserArchives = { index, entry, write, safeName, openRead };
})();
```
[chapter-file-end]: #

[chapter-file-start]: #composeApp/src/wasmJsMain/resources/browser-files-sw.js
### Write `composeApp/src/wasmJsMain/resources/browser-files-sw.js`

Create this path in your reconstruction project. Source set: **wasmJsMain**. [Exact file download](../reference/source/composeApp/src/wasmJsMain/resources/browser-files-sw.js).

```javascript
/* Serves only same-origin, origin-private media. No remote responses or application data are cached. */
// Service workers must import their dependencies while the script initially evaluates.
importScripts('browser-archives.js', 'vendor/zipjs-2.23.0/zip-native.min.js');
self.addEventListener('install', event => event.waitUntil(self.skipWaiting()));
self.addEventListener('activate', event => event.waitUntil(self.clients.claim()));
const prefix = new URL('__yokan_files__/', self.registration.scope).pathname;
const contentTypes = {
    jpg: 'image/jpeg', jpeg: 'image/jpeg', png: 'image/png', webp: 'image/webp', avif: 'image/avif', gif: 'image/gif',
    html: 'text/html; charset=utf-8', txt: 'text/plain; charset=utf-8', mp4: 'video/mp4', webm: 'video/webm',
    m3u8: 'application/vnd.apple.mpegurl', ts: 'video/mp2t', m4s: 'video/iso.segment', vtt: 'text/vtt', srt: 'application/x-subrip',
};
async function serve(request, url, event) {
    if (!['GET', 'HEAD'].includes(request.method)) return new Response(null, { status: 405 });
    try {
        const parts = url.pathname.slice(prefix.length).split('/').map(decodeURIComponent);
        if (parts[0] !== 'yokan' || parts.some(p => !p || p === '.' || p === '..' || /[\\/\0]/.test(p))) return new Response(null, { status: 400 });
        let directory = await navigator.storage.getDirectory();
        for (const part of parts.slice(0, -1)) directory = await directory.getDirectoryHandle(part);
        const file = await (await directory.getFileHandle(parts.at(-1))).getFile();
        const entryName = url.searchParams.get('entry');
        if (entryName !== null) {
            if (!globalThis.yokanBrowserArchives) importScripts('browser-archives.js');
            const metadataOnly = request.method === 'HEAD' || request.headers.has('Range');
            const entry = await yokanBrowserArchives.entry(file, entryName, metadataOnly);
            const headers = { 'Content-Type': contentTypes[entryName.split('.').at(-1).toLowerCase()] || 'application/octet-stream',
                'Content-Length': String(entry.size), 'Cache-Control': 'no-store', 'X-Content-Type-Options': 'nosniff',
                'Content-Security-Policy': "default-src 'none'; sandbox" };
            if (request.headers.has('Range')) return new Response(null, { status: 416, headers: { 'Content-Range': `bytes */${entry.size}` } });
            if (request.method === 'HEAD') return new Response(null, { headers });
            event.waitUntil(entry.done);
            return new Response(entry.stream, { headers });
        }
        const headers = new Headers({ 'Content-Type': contentTypes[parts.at(-1).split('.').at(-1).toLowerCase()] || 'application/octet-stream',
            'Accept-Ranges': 'bytes', 'Cache-Control': 'no-store', 'X-Content-Type-Options': 'nosniff',
            // Downloaded HTML must never run scripts under the application's origin.
            'Content-Security-Policy': "default-src 'none'; img-src data:; style-src 'unsafe-inline'; sandbox" });
        let start = 0, end = file.size - 1, status = 200;
        const range = request.headers.get('Range');
        if (range) {
            const match = /^bytes=(\d*)-(\d*)$/.exec(range);
            if (!match || (!match[1] && !match[2])) return new Response(null, { status: 416, headers: { 'Content-Range': `bytes */${file.size}` } });
            if (match[1]) { start = Number(match[1]); end = match[2] ? Math.min(Number(match[2]), end) : end; }
            else start = Math.max(0, file.size - Number(match[2]));
            if (!Number.isSafeInteger(start) || !Number.isSafeInteger(end) || start > end || start >= file.size)
                return new Response(null, { status: 416, headers: { 'Content-Range': `bytes */${file.size}` } });
            status = 206;
            headers.set('Content-Range', `bytes ${start}-${end}/${file.size}`);
        }
        headers.set('Content-Length', String(Math.max(0, end - start + 1)));
        return new Response(request.method === 'HEAD' ? null : file.slice(start, end + 1).stream(), { status, headers });
    } catch (error) { return new Response(null, { status: error.name === 'NotFoundError' ? 404 : 500 }); }
}
self.addEventListener('fetch', event => {
    const url = new URL(event.request.url);
    if (url.origin === self.location.origin && url.pathname.startsWith(prefix)) event.respondWith(serve(event.request, url, event));
});
```
[chapter-file-end]: #

[chapter-file-start]: #composeApp/src/wasmJsMain/resources/browser-storage.js
### Write `composeApp/src/wasmJsMain/resources/browser-storage.js`

Create this path in your reconstruction project. Source set: **wasmJsMain**. [Exact file download](../reference/source/composeApp/src/wasmJsMain/resources/browser-storage.js).

```javascript
/* Origin-private file storage. Binary content is streamed to disk, never put in localStorage. */
(() => {
    'use strict';
    const decode = value => Uint8Array.from(atob(value), c => c.charCodeAt(0));
    const encode = bytes => {
        let binary = '';
        for (let i = 0; i < bytes.length; i += 32768) binary += String.fromCharCode(...bytes.subarray(i, i + 32768));
        return btoa(binary);
    };
    const stores = new Map();
    const mediaPrefix = '__yokan_files__/';
    const base = typeof document === 'undefined' ? 'http://localhost/' : new URL('.', document.currentScript?.src || document.baseURI).href;
    // The worker must control the app page, even when scripts are served from a separate assets path.
    const mediaBase = typeof document === 'undefined' ? base : new URL('.', document.baseURI).href;
    let workerReady;
    let archiveReady;
    async function prepareArchives() {
        if (globalThis.yokanBrowserArchives) return globalThis.yokanBrowserArchives;
        if (!archiveReady) archiveReady = new Promise((resolve, reject) => {
            const script = document.createElement('script');
            script.src = new URL('browser-archives.js', base).href;
            script.onload = () => resolve(globalThis.yokanBrowserArchives);
            script.onerror = () => reject(new Error('Archive support could not load.'));
            document.head.append(script);
        }).catch(error => { archiveReady = null; throw error; });
        return archiveReady;
    }

    async function prepareMediaWorker() {
        if (!workerReady) workerReady = (async () => {
            if (!navigator.serviceWorker) throw new Error('Offline media requires service-worker support.');
            const registration = await navigator.serviceWorker.register(new URL('browser-files-sw.js', mediaBase), { scope: new URL('.', mediaBase).pathname });
            const candidate = registration.installing || registration.waiting;
            if (candidate && candidate.state !== 'activated') await new Promise((resolve, reject) => {
                const timer = setTimeout(() => { cleanup(); reject(new Error('Offline media update timed out. Reload to retry.')); }, 15000);
                const changed = () => {
                    if (candidate.state === 'activated') { cleanup(); resolve(); }
                    else if (candidate.state === 'redundant') { cleanup(); reject(new Error('Offline media could not update. Reload to retry.')); }
                };
                const cleanup = () => { clearTimeout(timer); candidate.removeEventListener('statechange', changed); };
                candidate.addEventListener('statechange', changed); changed();
            });
            // navigator.serviceWorker.ready can wait forever when the registration does not cover this page.
            if (!registration.active && candidate?.state !== 'activated') throw new Error('Offline media worker did not activate.');
            if (!navigator.serviceWorker.controller) await new Promise((resolve, reject) => {
                const timer = setTimeout(() => { cleanup(); reject(new Error('Offline media could not start. Reload to retry.')); }, 15000);
                const changed = () => { if (navigator.serviceWorker.controller) { cleanup(); resolve(); } };
                const cleanup = () => { clearTimeout(timer); navigator.serviceWorker.removeEventListener('controllerchange', changed); };
                navigator.serviceWorker.addEventListener('controllerchange', changed);
                changed();
            });
        })().catch(error => { workerReady = null; throw error; });
        return workerReady;
    }

    function openStore(rootPath) {
        if (stores.has(rootPath)) return stores.get(rootPath);
        if (rootPath !== '/yokan' && !/^\/yokan\/profiles\/p_[0-9a-f]{32}$/.test(rootPath)) throw new Error('Invalid profile storage root.');
        const inventory = new Map();
        const children = new Map();
        const directories = new Map();
        const knownDirectories = new Set([rootPath]);
        const directoryChildren = new Map();
        const textCache = new Map();
        const writers = new Map();
        let tail = Promise.resolve(), firstFailure = null, prepared = false, retired = false;
        function knowDirectory(path) {
            if (!(path === rootPath || path.startsWith(rootPath + '/'))) return;
            knownDirectories.add(path);
            if (path === rootPath) return;
            const parent = path.slice(0, path.lastIndexOf('/'));
            if (!directoryChildren.has(parent)) directoryChildren.set(parent, new Set());
            directoryChildren.get(parent).add(path);
        }
        function forgetDirectories(path) {
            for (const directory of knownDirectories) if (directory === path || directory.startsWith(path + '/')) {
                knownDirectories.delete(directory); directoryChildren.delete(directory);
                const parent = directory.slice(0, directory.lastIndexOf('/'));
                directoryChildren.get(parent)?.delete(directory);
                if (!directoryChildren.get(parent)?.size) directoryChildren.delete(parent);
            }
        }
        function adjustParents(path, count, bytes) {
            let parent = path.slice(0, path.lastIndexOf('/'));
            while (parent.length >= rootPath.length) {
                knowDirectory(parent);
                const before = directories.get(parent) || { count: 0, bytes: 0 };
                const after = { count: before.count + count, bytes: before.bytes + bytes };
                if (after.count > 0) directories.set(parent, after); else directories.delete(parent);
                parent = parent.slice(0, parent.lastIndexOf('/'));
            }
        }
        function register(entry) {
            const before = inventory.get(entry.path);
            inventory.set(entry.path, entry);
            const parent = entry.path.slice(0, entry.path.lastIndexOf('/'));
            if (!children.has(parent)) children.set(parent, new Map());
            children.get(parent).set(entry.path, entry);
            adjustParents(entry.path, before ? 0 : 1, entry.sizeBytes - (before?.sizeBytes || 0));
        }
        function forget(path) {
            const before = inventory.get(path);
            if (!before) return;
            inventory.delete(path); textCache.delete(path);
            const parent = path.slice(0, path.lastIndexOf('/'));
            children.get(parent)?.delete(path);
            if (!children.get(parent)?.size) children.delete(parent);
            adjustParents(path, -1, -before.sizeBytes);
        }
        const segments = path => {
            if (typeof path !== 'string' || !(path === rootPath || path.startsWith(rootPath + '/'))) throw new Error('File is outside this profile.');
            if (rootPath === '/yokan' && (path === '/yokan/profiles' || path.startsWith('/yokan/profiles/'))) throw new Error('File belongs to another profile.');
            const parts = path.split('/').slice(1);
            if (parts.some(p => !p || p === '.' || p === '..' || p.includes('\\') || p.includes('\0'))) throw new Error('Invalid file path.');
            return parts;
        };
        async function parentFor(path, create = false) {
            const parts = segments(path);
            let directory = await navigator.storage.getDirectory();
            for (const part of parts.slice(0, -1)) directory = await directory.getDirectoryHandle(part, { create });
            return [directory, parts.at(-1)];
        }
        async function fileFor(path, create = false) {
            const [parent, name] = await parentFor(path, create);
            return parent.getFileHandle(name, { create });
        }
        const ready = (async () => {
            if (!navigator.storage?.getDirectory) throw new Error('Downloads require a browser with origin-private file storage.');
            const [parent, name] = await parentFor(rootPath, true);
            const root = await parent.getDirectoryHandle(name, { create: true });
            async function visit(directory, path) {
                knowDirectory(path);
                for await (const [name, handle] of directory.entries()) {
                    if (path === '/yokan' && name === 'profiles') continue;
                    const child = path + '/' + name;
                    if (handle.kind === 'directory') await visit(handle, child);
                    else {
                        const file = await handle.getFile();
                        register({ path: child, name, sizeBytes: file.size, lastModified: file.lastModified });
                        if (name === 'metadata.json' && file.size <= 65536) textCache.set(child, encode(new Uint8Array(await file.arrayBuffer())));
                    }
                }
            }
            await visit(root, rootPath);
            prepared = true;
        })();
        ready.catch(() => {}); // The owning coroutine observes and reports preparation failures.
        const assertOpen = () => { if (retired) throw new Error('Profile file storage is closed.'); };
        const assertPrepared = () => { assertOpen(); if (!prepared) throw new Error('Profile file storage has not been prepared.'); };
        const enqueue = action => {
            assertOpen();
            const work = tail.then(async () => { await ready; assertOpen(); return action(); });
            tail = work.catch(error => { if (!firstFailure) firstFailure = error; });
            return work;
        };
        async function update(path) {
            const file = await (await fileFor(path)).getFile();
            register({ path, name: path.split('/').at(-1), sizeBytes: file.size, lastModified: file.lastModified });
        }
        async function write(path, bytes) {
            segments(path);
            if (writers.has(path)) throw new Error('File is already being written.');
            const handle = await fileFor(path, true);
            const stream = await handle.createWritable();
            try { await stream.write(bytes); await stream.close(); }
            catch (error) { await stream.abort().catch(() => {}); throw error; }
            await update(path);
            if (path.endsWith('/metadata.json') && bytes.length <= 65536) textCache.set(path, encode(bytes));
        }
        async function flush() {
            await tail;
            if (firstFailure) { const error = firstFailure; firstFailure = null; throw error; }
        }
        function localEntries(path, extensions) {
            segments(path); assertPrepared();
            if (!knownDirectories.has(path)) return null;
            const readable = new Set(extensions.split(','));
            const supported = entry => readable.has(entry.name.split('.').at(-1).toLowerCase());
            const result = [];
            const pending = [path];
            while (pending.length) {
                const current = pending.pop();
                for (const file of children.get(current)?.values() || []) if (supported(file)) {
                    result.push({ path: file.path, name: file.name.replace(/\.[^.]+$/, ''), isArchive: true });
                }
                for (const directory of directoryChildren.get(current) || []) {
                    if ([...(children.get(directory)?.values() || [])].some(supported)) {
                        result.push({ path: directory, name: directory.slice(directory.lastIndexOf('/') + 1), isArchive: false });
                    } else pending.push(directory);
                }
            }
            const compare = (left, right) => left < right ? -1 : left > right ? 1 : 0;
            return result.sort((left, right) => compare(left.name.toLowerCase(), right.name.toLowerCase()) || compare(left.path, right.path));
        }
        const store = {
            prepare: () => ready,
            flush,
            entries: () => { assertPrepared(); return JSON.stringify([...inventory.values()]); },
            list: path => { segments(path); assertPrepared(); return JSON.stringify([...(children.get(path)?.values() || [])]); },
            localEntries: (path, extensions) => JSON.stringify(localEntries(path, extensions)),
            directoryEntries: path => {
                segments(path); assertPrepared();
                if (!knownDirectories.has(path)) return 'null';
                return JSON.stringify([
                    ...[...(children.get(path)?.values() || [])].map(file => ({ path: file.path, name: file.name, isDirectory: false })),
                    ...[...(directoryChildren.get(path) || [])].map(directory => ({ path: directory, name: directory.slice(directory.lastIndexOf('/') + 1), isDirectory: true })),
                ].sort((a, b) => a.name.toLowerCase() < b.name.toLowerCase() ? -1 : a.name.toLowerCase() > b.name.toLowerCase() ? 1 : 0));
            },
            exists: path => { segments(path); assertPrepared(); return inventory.has(path) || knownDirectories.has(path); },
            size: path => { segments(path); assertPrepared(); return inventory.get(path)?.sizeBytes || directories.get(path)?.bytes || 0; },
            cached: path => { segments(path); return textCache.get(path) ?? null; },
            archiveEntries: path => enqueue(async () => {
                segments(path);
                const archives = await prepareArchives();
                return JSON.stringify(await archives.index(await (await fileFor(path)).getFile()));
            }),
            openArchive: path => enqueue(async () => {
                segments(path);
                const archives = await prepareArchives();
                const session = await archives.openRead(await (await fileFor(path)).getFile());
                return {
                    read: async (name, maximum) => {
                        assertOpen();
                        const bytes = await session.read(name, maximum);
                        assertOpen();
                        return bytes === null ? null : encode(bytes);
                    },
                    close: () => session.close(),
                };
            }),
            zip: (directory, deleteSource) => enqueue(async () => {
                segments(directory);
                if (directory === rootPath) throw new Error('Cannot archive the profile root.');
                if ([...writers.keys()].some(path => path === directory || path.startsWith(directory + '/'))) throw new Error('Chapter is being written.');
                const entries = [...(children.get(directory)?.values() || [])];
                const supported = entry => /\.(jpe?g|png|gif|webp|bmp|avif)$/i.test(entry.name) || entry.name === 'metadata.json';
                const selected = entries.filter(supported);
                if (!selected.some(entry => entry.name !== 'metadata.json')) return null;
                if (deleteSource && entries.some(entry => !supported(entry) && !/\.(complete|part|resume)$|\.split\.json$/.test(entry.name))) throw new Error('Chapter has files that cannot be archived.');
                if (deleteSource && [...inventory.keys()].some(path => path.startsWith(directory + '/') && path.slice(directory.length + 1).includes('/'))) throw new Error('Chapter has nested files that cannot be archived.');
                const archives = await prepareArchives();
                const target = directory + '.cbz', temporary = target + '.part';
                if (writers.has(target) || writers.has(temporary)) throw new Error('Archive is being written.');
                const blobs = [];
                for (const entry of selected) blobs.push({ name: entry.name, bytes: await (await fileFor(entry.path)).getFile() });
                const output = await (await fileFor(temporary, true)).createWritable();
                const archiveWriter = output.getWriter();
                const archiveOutput = new WritableStream({ write: bytes => archiveWriter.write(bytes) });
                writers.set(temporary, output);
                try {
                    await archives.write(blobs, archiveOutput);
                    await archiveWriter.close();
                    const staged = await (await fileFor(temporary)).getFile();
                    const index = await archives.index(staged);
                    if (index.length !== blobs.length || blobs.some(blob => !index.some(entry => entry.name === blob.name && entry.size === blob.bytes.size))) throw new Error('Incomplete chapter archive.');
                    const destination = await (await fileFor(target, true)).createWritable();
                    await staged.stream().pipeTo(destination);
                    await update(target);
                    const [tempParent, tempName] = await parentFor(temporary);
                    await tempParent.removeEntry(tempName); forget(temporary);
                    if (deleteSource) {
                        const [parent, name] = await parentFor(directory);
                        await parent.removeEntry(name, { recursive: true });
                        for (const key of inventory.keys()) if (key.startsWith(directory + '/')) forget(key);
                        forgetDirectories(directory);
                    }
                    return target;
                } catch (error) {
                    await archiveWriter.abort().catch(() => {});
                    throw error;
                } finally { archiveWriter.releaseLock(); writers.delete(temporary); }
            }),
            write: (path, base64) => enqueue(() => write(path, decode(base64))),
            read: async (path, maximum) => {
                segments(path); await ready; await flush(); assertOpen();
                const file = await (await fileFor(path)).getFile();
                if (file.size > maximum) throw new Error('File exceeds the read limit.');
                return encode(new Uint8Array(await file.arrayBuffer()));
            },
            begin: async (path, append) => {
                segments(path); await ready; await flush(); assertOpen();
                if (writers.has(path)) throw new Error('File is already being written.');
                // Reserve before awaiting the browser lock so concurrent admissions cannot race.
                writers.set(path, null);
                try {
                    const handle = await fileFor(path, true);
                    const size = append ? (await handle.getFile()).size : 0;
                    const stream = await handle.createWritable({ keepExistingData: append });
                    if (size) await stream.seek(size);
                    writers.set(path, stream);
                } catch (error) { writers.delete(path); throw error; }
            },
            chunk: async (path, base64) => {
                assertOpen();
                const stream = writers.get(path);
                if (!stream) throw new Error('No file writer.');
                await stream.write(decode(base64));
            },
            end: async (path, commit) => {
                const stream = writers.get(path);
                if (!stream) throw new Error('No file writer.');
                try {
                    if (commit) {
                        try { await stream.close(); await update(path); }
                        catch (error) { await stream.abort().catch(() => {}); throw error; }
                    }
                    else await stream.abort();
                } finally { writers.delete(path); }
            },
            promote: (source, target) => enqueue(async () => {
                segments(source); segments(target);
                if (writers.has(source) || writers.has(target)) throw new Error('File is being written.');
                const sourceFile = await (await fileFor(source)).getFile();
                const output = await (await fileFor(target, true)).createWritable();
                try { await sourceFile.stream().pipeTo(output); }
                catch (error) { await output.abort().catch(() => {}); throw error; }
                await update(target);
                const [parent, name] = await parentFor(source);
                await parent.removeEntry(name);
                forget(source);
                return true;
            }),
            remove: path => enqueue(async () => {
                segments(path);
                if (path === rootPath) throw new Error('Cannot remove the profile root.');
                if ([...writers.keys()].some(p => p === path || p.startsWith(path + '/'))) throw new Error('File is being written.');
                try { const [parent, name] = await parentFor(path); await parent.removeEntry(name, { recursive: true }); }
                catch (error) { if (error.name !== 'NotFoundError') throw error; }
                for (const key of inventory.keys()) if (key === path || key.startsWith(path + '/')) forget(key);
                forgetDirectories(path);
                return true;
            }),
            url: async path => {
                segments(path); await ready; await flush(); assertOpen();
                if (!inventory.has(path)) throw new Error('Offline file no longer exists.');
                await prepareMediaWorker();
                return new URL(mediaPrefix + segments(path).map(encodeURIComponent).join('/'), mediaBase).href;
            },
            close: async () => {
                if (retired) return;
                await ready.catch(() => {});
                if (writers.size) throw new Error('File writers are still active.');
                await flush(); retired = true; inventory.clear(); children.clear(); directories.clear(); knownDirectories.clear(); directoryChildren.clear(); textCache.clear(); stores.delete(rootPath);
            },
        };
        stores.set(rootPath, store);
        return store;
    }
    async function deleteProfile(rootPath) {
        if (!/^\/yokan\/profiles\/p_[0-9a-f]{32}$/.test(rootPath)) throw new Error('Cannot delete this profile root.');
        if (stores.has(rootPath)) throw new Error('Close the profile before deleting its storage.');
        if (!navigator.storage?.getDirectory) return;
        try {
            let directory = await navigator.storage.getDirectory();
            for (const segment of rootPath.split('/').slice(1, -1)) directory = await directory.getDirectoryHandle(segment);
            await directory.removeEntry(rootPath.split('/').at(-1), { recursive: true });
        } catch (error) { if (error.name !== 'NotFoundError') throw error; }
    }
    function selectedMedia(selected) {
        if (selected.length > 10000) throw new Error('Select at most 10000 files.');
        let files = Array.from(selected), closed = false;
        return {
            metadata: () => {
                if (closed) throw new Error('File selection is closed.');
                return JSON.stringify(files.map(file => ({ path: file.webkitRelativePath || file.name, size: file.size })));
            },
            chunk: async (index, offset) => {
                if (closed) throw new Error('File selection is closed.');
                const file = files[index];
                if (!file || !Number.isSafeInteger(offset) || offset < 0 || offset >= file.size) throw new Error('Invalid selected-file read.');
                // Bounded slice reads avoid whole-file FileReader/arrayBuffer allocations, including videos.
                const bytes = new Uint8Array(await file.slice(offset, Math.min(file.size, offset + 65536)).arrayBuffer());
                if (closed) throw new Error('File selection is closed.');
                return encode(bytes);
            },
            close: () => { closed = true; files = []; },
        };
    }
    function pickMedia(directory) {
        const input = document.createElement('input');
        input.type = 'file'; input.hidden = true; input.multiple = true;
        if (directory) input.setAttribute('webkitdirectory', '');
        document.body.append(input);
        let finished = false, selection = null, resolveResult, rejectResult;
        const result = new Promise((resolve, reject) => { resolveResult = resolve; rejectResult = reject; });
        const cleanup = () => { input.onchange = null; input.oncancel = null; input.remove(); };
        const cancel = () => {
            selection?.close();
            if (!finished) { finished = true; cleanup(); resolveResult(null); }
        };
        input.oncancel = cancel;
        input.onchange = () => {
            if (finished) return;
            finished = true;
            try { selection = input.files?.length ? selectedMedia(input.files) : null; resolveResult(selection); }
            catch (error) { rejectResult(error); }
            finally { cleanup(); }
        };
        try { input.click(); } catch (error) { finished = true; cleanup(); rejectResult(error); }
        return { result, cancel };
    }
    globalThis.yokanBrowserFiles = { open: openStore, deleteProfile, pickMedia, selectedMedia };
})();
```
[chapter-file-end]: #

[chapter-file-start]: #composeApp/src/wasmJsMain/resources/favicon.png
### Write `composeApp/src/wasmJsMain/resources/favicon.png`

Create this path in your reconstruction project. Source set: **wasmJsMain**. [Exact file download](../reference/source/composeApp/src/wasmJsMain/resources/favicon.png).

This file is binary. Retain the downloaded asset at this exact path, with its applicable license. It is an input to the code/configuration in this step; it cannot be recreated by typing a Kotlin snippet.
[chapter-file-end]: #

[chapter-file-start]: #composeApp/src/wasmJsMain/resources/index.html
### Write `composeApp/src/wasmJsMain/resources/index.html`

Create this path in your reconstruction project. Source set: **wasmJsMain**. [Exact file download](../reference/source/composeApp/src/wasmJsMain/resources/index.html).

```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Yokan</title>
    <link rel="icon" type="image/png" href="favicon.png">
    <style>
        html, body {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
            overflow: hidden;
            background: #101010;
        }
    </style>
</head>
<body>
<script type="application/javascript" src="browser-storage.js"></script>
<script type="application/javascript" src="composeApp.js"></script>
</body>
</html>
```
[chapter-file-end]: #

[chapter-file-start]: #composeApp/src/wasmJsMain/resources/vendor/zipjs-2.23.0/LICENSE
### Write `composeApp/src/wasmJsMain/resources/vendor/zipjs-2.23.0/LICENSE`

Create this path in your reconstruction project. Source set: **wasmJsMain**. [Exact file download](../reference/source/composeApp/src/wasmJsMain/resources/vendor/zipjs-2.23.0/LICENSE).

```text
BSD 3-Clause License

Copyright (c) 2023, Gildas Lormeau

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
   contributors may be used to endorse or promote products derived from
   this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
```
[chapter-file-end]: #

[chapter-file-start]: #composeApp/src/wasmJsMain/resources/vendor/zipjs-2.23.0/zip-native.min.js
### Write `composeApp/src/wasmJsMain/resources/vendor/zipjs-2.23.0/zip-native.min.js`

Create this path in your reconstruction project. Source set: **wasmJsMain**. [Exact file download](../reference/source/composeApp/src/wasmJsMain/resources/vendor/zipjs-2.23.0/zip-native.min.js).

```javascript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).zip={})}(this,function(e){"use strict";const{Array:t,Object:n,String:r,Number:i,BigInt:o,Math:a,Date:s,Map:c,Set:f,Response:l,URL:u,Error:d,Uint8Array:w,Uint16Array:p,Uint32Array:h,DataView:m,Blob:y,Promise:g,TextEncoder:b,TextDecoder:E,document:F,crypto:R,btoa:S,TransformStream:z,ReadableStream:D,WritableStream:x,CompressionStream:v,DecompressionStream:k,navigator:T,Worker:A,Symbol:N,setTimeout:C,clearTimeout:U,structuredClone:I}="undefined"!=typeof globalThis?globalThis:self;var W=void 0!==F?F.currentScript:null;const L=4294967295,M=65535,O=255,B=67324752,V=134695760,P=V,H=84233040,Y=33639248,q=101010256,J=101075792,j=117853008,Z=46,G=22,K=20,X=56,Q=39169,_=21589,$=6534,ee=30837,te=30805,ne=2048,re=8192,ie=61440,oe=16384,ae=2048,se=1024,ce="/",fe=30,le=new s(2107,11,31,23,59,58),ue=new s(1980,0,1),de=void 0,we=1/0,pe="Local file header not found",he="Overlapping entry found",me="Zip64 extra field not found",ye="undefined",ge="function",be="object",Ee="string",Fe="boolean",Re=new w,Se=N.asyncDispose||N(),ze="password",De="rawPassword",xe="passThrough",ve="signal",ke="checkAmbiguity",Te="useWebWorkers",Ae="useCompressionStream",Ne="preventClose",Ce="level",Ue="useUnicodeFileNames",Ie="dataDescriptor",We="offset",Le="usdz",Me="strictness",Oe="maxAppendedDataSize",Be="entry",Ve="filename",Pe="comment",He="strict",Ye="balanced",qe="tolerant",Je="compressed",je="Invalid option (must be a function)",Ze="Invalid signal (must be an AbortSignal instance)",Ge="Invalid password (password must be a string, rawPassword must be a Uint8Array)",Ke="Invalid passThrough option (must be a boolean or 'compressed')",Xe="Invalid readerOptions (must be an object)",Qe="The operation was aborted";function _e(e){if(e&&typeof e!=ge)throw new d(je);return e}function $e(e){if(e&&(typeof e.addEventListener!=ge||typeof e.aborted!=Fe))throw new d(Ze);return e||de}function et(e){if(e&&e.aborted)throw e.reason===de?new DOMException(Qe,"AbortError"):e.reason}function tt(e,t){if(e&&typeof e!=Ee||t&&!(t instanceof w))throw new d(Ge)}function nt(e){if(e!==de&&typeof e!=Fe&&e!==Je)throw new d(Ke);return e}function rt(e,t,n){if(!i.isInteger(e)||e<0||e>t)throw new d(n)}function it(e,t,n){e!==de&&rt(e,t,n)}function ot(e){return typeof e==Ee&&e.trim()?i(e):e}const at=262144,st="Invalid maxWorkers (must be an integer greater than 0)",ct="Invalid baseURI (must be a string)",ft="Invalid URI (must be a string or a function returning a string)";let lt=2;try{typeof T!=ye&&T.hardwareConcurrency&&(lt=T.hardwareConcurrency)}catch{}const ut={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:at,maxWorkers:lt,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,CompressionStream:typeof v!=ye&&v,DecompressionStream:typeof k!=ye&&k},dt="maxWorkers",wt="baseURI",pt=["wasmURI","workerURI"],ht=["chunkSize",dt,"terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout"],mt=["createWorker","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],yt=[wt,...pt,"useCompressionStream","useWebWorkers",...ht,...mt],gt={...ut};function bt(){return gt}function Et(e){return Ft(e.chunkSize)}function Ft(e){return e=ot(e),i.isInteger(e)&&e>=1?a.max(e,64):at}function Rt(e){const t={};for(const n of yt){const r=e[n];r!==de&&(t[n]=St(n,r))}return t}function St(e,t){if(ht.includes(e)){if(t=ot(t),e==dt&&(!i.isInteger(t)||t<1))throw new d(st)}else if(mt.includes(e))_e(t);else if(e==wt){if(t&&typeof t!=Ee)throw new d(ct)}else if(pt.includes(e)&&t&&typeof t!=Ee&&typeof t!=ge)throw new d(ft);return t}function zt(e){e=e||{};const{CompressionStreamZlib:t,DecompressionStreamZlib:r}=e;if(t===de&&r===de)return e;const i=n.assign({},e);return i.CompressionStreamFallback===de&&(i.CompressionStreamFallback=t),i.DecompressionStreamFallback===de&&(i.DecompressionStreamFallback=r),i}function Dt(e){const t=Rt(zt(e));n.assign(ut,t),n.assign(gt,t)}const xt=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],vt=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],kt=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],Tt=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],At=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Nt=new w(288);Nt.fill(8,0,144),Nt.fill(9,144,256),Nt.fill(7,256,280),Nt.fill(8,280,288);const Ct=new w(30).fill(5);function Ut(e){const t=new p(16);for(const n of e)t[n]++;t[0]=0;const n=new p(17);for(let e=1;e<=15;e++)n[e+1]=n[e]+t[e];const r=new p(e.length);for(let t=0;t<e.length;t++)e[t]&&(r[n[e[t]]++]=t);return{o:t,symbols:r}}const It="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Wt=(Lt=()=>function(e){let t=0,n=0,r=0,i=new w(1024),o=0,a=0;for(;!a;){a=c(1);const e=c(2);if(0==e)f();else if(1==e)l(Ut(Nt),Ut(Ct));else{if(2!=e)throw new d("invalid deflate block type");l(...u())}}return i.subarray(0,o);function s(){if(t>=e.length)throw new d("unexpected end of deflate data");return e[t++]}function c(e){for(;r<e;)n|=s()<<r,r+=8;const t=n&(1<<e)-1;return n>>>=e,r-=e,t}function f(){n=0,r=0;const e=s()|s()<<8;t+=2,h(o+e);for(let t=0;t<e;t++)i[o++]=s()}function l(e,t){let n=p(e);for(;256!=n;){if(n<256)h(o+1),i[o++]=n;else{const e=n-257,r=xt[e]+c(vt[e]),a=p(t),s=kt[a]+c(Tt[a]);h(o+r);const f=o-s;for(let e=0;e<r;e++)i[o++]=i[f+e]}n=p(e)}}function u(){const e=c(5)+257,t=c(5)+1,n=c(4)+4,r=new w(19);for(let e=0;e<n;e++)r[At[e]]=c(3);const i=Ut(r),o=new w(e+t);let a=0;for(;a<o.length;){const e=p(i);if(e<16)o[a++]=e;else if(16==e){const e=o[a-1];let t=c(2)+3;for(;t--;)o[a++]=e}else a+=17==e?c(3)+3:c(7)+11}return[Ut(o.subarray(0,e)),Ut(o.subarray(e))]}function p(e){const{o:t,symbols:n}=e;let r=0,i=0,o=0;for(let e=1;e<=15;e++){r|=c(1);const a=t[e];if(r-i<a)return n[o+(r-i)];o+=a,i=i+a<<1,r<<=1}throw new d("invalid huffman code")}function h(e){if(i.length<e){let t=2*i.length;for(;t<e;)t*=2;const n=new w(t);n.set(i.subarray(0,o)),i=n}}}(function(e){const t=(e=r(e).replace(/[^A-Za-z0-9+/=]/g,"")).length,n=[];for(let r=0;r<t;r+=4){const t=It.indexO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uqQj3C2lqpztFLvTrKHlzsV34XqFl8JXVLqGT/f7ol0NVitqbaGiV2diaaEAWgzWc2JqCLDUtAO6k1rWFHKXuX2BuaWRmawg86BCkB1aAldvmQQhgxbgraB1Wklw05pbIIfCIi5NBF8MBjNuhoPVxlOnyARANWeIeAy+4sMAkaISVaK6xSKNGLL0HUDCWI2y4M1WBFfwBomTvYh4jQLwGv3DLUKdELhdIV4JnHEtAqY7Bq8NAN9H73lNSc1JJU0PGPoPqlAOxafzAJXlOfBRqFLYGzPOAs5xJIRwkyqwkpTeAE6LToPCidnmcVDs58hZDMh571SnBlvRK8Wa9Ws1bTmgsA")),e=>e({workerURI:e=>{const t="text/javascript";let n=Lt();if("string"==typeof n&&(n=(new b).encode(n)),e){const e=new y([n],{type:t});return u.createObjectURL(e)}return"data:"+t+";base64,"+function(e){let t="";const n=e.length;let r=0;for(;r+2<n;r+=3){const n=e[r]<<16|e[r+1]<<8|e[r+2];t+=It[n>>18&63]+It[n>>12&63]+It[n>>6&63]+It[63&n]}const i=n-r;if(1===i){const n=e[r]<<16;t+=It[n>>18&63]+It[n>>12&63]+"=="}else if(2===i){const n=e[r]<<16|e[r+1]<<8;t+=It[n>>18&63]+It[n>>12&63]+It[n>>6&63]+"="}return t}(n)}}));var Lt;function Mt(e,t){const n=new w(e.length+t.length);return n.set(e),n.set(t,e.length),n}function Ot(e){return e.byteOffset||e.byteLength!=e.buffer.byteLength?new w(e):e}function Bt(e){return new m(e.buffer,e.byteOffset,e.byteLength)}function Vt(e){return Boolean(e)&&"object"==typeof e}const Pt=[[],[],[],[],[],[],[],[]];for(let e=0;e<256;e++){let t=e;for(let e=0;e<8;e++)t=1&t?t>>>1^3988292384:t>>>1;Pt[0][e]=t}for(let e=0;e<256;e++)for(let t=1;t<8;t++){const n=Pt[t-1][e];Pt[t][e]=n>>>8^Pt[0][255&n]}const[Ht,Yt,qt,Jt,jt,Zt,Gt,Kt]=Pt;class Xt{constructor(e){this.l=e||-1}append(e){let t=0|this.l;const n=0|e.length;let r=0;if(n>=8&&e.buffer){const i=new m(e.buffer,e.byteOffset,n),o=n-8;for(;r<=o;r+=8){const e=t^i.getInt32(r,!0),n=i.getInt32(r+4,!0);t=Kt[255&e]^Gt[e>>>8&255]^Zt[e>>>16&255]^jt[e>>>24&255]^Jt[255&n]^qt[n>>>8&255]^Yt[n>>>16&255]^Ht[n>>>24&255]}}for(;r<n;r++)t=t>>>8^Ht[255&(t^e[r])];this.l=t}get(){return~this.l}}class Qt extends z{constructor(){let e;const t=new Xt;super({transform(e,n){t.append(e),n.enqueue(e)},flush(){const n=new w(4);new m(n.buffer).setUint32(0,t.get()),e.value=n}}),e=this}}function _t(e){if(typeof b==ye){e=unescape(encodeURIComponent(e));const t=new w(e.length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}return(new b).encode(e)}const $t=64,en=20,tn=new w([128]),nn=new w(1),rn=new Int32Array([1732584193,4023233417,2562383102,271733878,3285377520]),on=new w(256),an=new Int32Array(256),sn=new Int32Array(256),cn=new Int32Array(256),fn=new Int32Array(256);let ln=!1;function un(e){const t=function(){const e=new Int32Array(rn),t=new Int32Array(16),n=new w($t),r=new m(n.buffer),i=new w(8);let o=0,s=0;return{update:c,digest:function(){const t=8*s,n=a.floor(t/4294967296),r=t>>>0;for(c(tn,0,1);56!=o;)c(nn,0,1);i[0]=n>>>24,i[1]=n>>>16,i[2]=n>>>8,i[3]=n,i[4]=r>>>24,i[5]=r>>>16,i[6]=r>>>8,i[7]=r,c(i,0,8);const f=new w(en),l=new m(f.buffer);for(let t=0;t<e.length;t++)l.setInt32(4*t,e[t]);return e.set(rn),o=0,s=0,f}};function c(e,t,i){const a=t+i;if(s+=i,o){for(;t<a&&o<$t;)n[o++]=e[t++];o==$t&&(f(r,0),o=0)}if(t+$t<=a){const n=new m(e.buffer,e.byteOffset,e.byteLength);for(;t+$t<=a;t+=$t)f(n,t)}for(;t<a;)n[o++]=e[t++]}function f(n,r){for(let e=0;e<16;e++)t[e]=n.getInt32(r+4*e);let i,o=e[0],a=e[1],s=e[2],c=e[3],f=e[4];for(let e=0;e<15;e+=5)f=(o<<5|o>>>27)+((s^c)&a^c)+f+1518500249+t[e]|0,a=a<<30|a>>>2,c=(f<<5|f>>>27)+((a^s)&o^s)+c+1518500249+t[e+1]|0,o=o<<30|o>>>2,s=(c<<5|c>>>27)+((o^a)&f^a)+s+1518500249+t[e+2]|0,f=f<<30|f>>>2,a=(s<<5|s>>>27)+((f^o)&c^o)+a+1518500249+t[e+3]|0,c=c<<30|c>>>2,o=(a<<5|a>>>27)+((c^f)&s^f)+o+1518500249+t[e+4]|0,s=s<<30|s>>>2;f=(o<<5|o>>>27)+((s^c)&a^c)+f+1518500249+t[15]|0,a=a<<30|a>>>2,i=t[13]^t[8]^t[2]^t[0],i=i<<1|i>>>31,t[0]=i,c=(f<<5|f>>>27)+((a^s)&o^s)+c+1518500249+i|0,o=o<<30|o>>>2,i=t[14]^t[9]^t[3]^t[1],i=i<<1|i>>>31,t[1]=i,s=(c<<5|c>>>27)+((o^a)&f^a)+s+1518500249+i|0,f=f<<30|f>>>2,i=t[15]^t[10]^t[4]^t[2],i=i<<1|i>>>31,t[2]=i,a=(s<<5|s>>>27)+((f^o)&c^o)+a+1518500249+i|0,c=c<<30|c>>>2,i=t[0]^t[11]^t[5]^t[3],i=i<<1|i>>>31,t[3]=i,o=(a<<5|a>>>27)+((c^f)&s^f)+o+1518500249+i|0,s=s<<30|s>>>2;for(let e=20;e<40;e+=5)i=t[e-3&15]^t[e-8&15]^t[e-14&15]^t[15&e],i=i<<1|i>>>31,t[15&e]=i,f=(o<<5|o>>>27)+(a^s^c)+f+1859775393+i|0,a=a<<30|a>>>2,i=t[e-2&15]^t[e-7&15]^t[e-13&15]^t[e+1&15],i=i<<1|i>>>31,t[e+1&15]=i,c=(f<<5|f>>>27)+(o^a^s)+c+1859775393+i|0,o=o<<30|o>>>2,i=t[e-1&15]^t[e-6&15]^t[e-12&15]^t[e+2&15],i=i<<1|i>>>31,t[e+2&15]=i,s=(c<<5|c>>>27)+(f^o^a)+s+1859775393+i|0,f=f<<30|f>>>2,i=t[15&e]^t[e-5&15]^t[e-11&15]^t[e+3&15],i=i<<1|i>>>31,t[e+3&15]=i,a=(s<<5|s>>>27)+(c^f^o)+a+1859775393+i|0,c=c<<30|c>>>2,i=t[e+1&15]^t[e-4&15]^t[e-10&15]^t[e+4&15],i=i<<1|i>>>31,t[e+4&15]=i,o=(a<<5|a>>>27)+(s^c^f)+o+1859775393+i|0,s=s<<30|s>>>2;for(let e=40;e<60;e+=5)i=t[e-3&15]^t[e-8&15]^t[e-14&15]^t[15&e],i=i<<1|i>>>31,t[15&e]=i,f=(o<<5|o>>>27)+(a&s|(a|s)&c)+f+2400959708+i|0,a=a<<30|a>>>2,i=t[e-2&15]^t[e-7&15]^t[e-13&15]^t[e+1&15],i=i<<1|i>>>31,t[e+1&15]=i,c=(f<<5|f>>>27)+(o&a|(o|a)&s)+c+2400959708+i|0,o=o<<30|o>>>2,i=t[e-1&15]^t[e-6&15]^t[e-12&15]^t[e+2&15],i=i<<1|i>>>31,t[e+2&15]=i,s=(c<<5|c>>>27)+(f&o|(f|o)&a)+s+2400959708+i|0,f=f<<30|f>>>2,i=t[15&e]^t[e-5&15]^t[e-11&15]^t[e+3&15],i=i<<1|i>>>31,t[e+3&15]=i,a=(s<<5|s>>>27)+(c&f|(c|f)&o)+a+2400959708+i|0,c=c<<30|c>>>2,i=t[e+1&15]^t[e-4&15]^t[e-10&15]^t[e+4&15],i=i<<1|i>>>31,t[e+4&15]=i,o=(a<<5|a>>>27)+(s&c|(s|c)&f)+o+2400959708+i|0,s=s<<30|s>>>2;for(let e=60;e<80;e+=5)i=t[e-3&15]^t[e-8&15]^t[e-14&15]^t[15&e],i=i<<1|i>>>31,t[15&e]=i,f=(o<<5|o>>>27)+(a^s^c)+f+3395469782+i|0,a=a<<30|a>>>2,i=t[e-2&15]^t[e-7&15]^t[e-13&15]^t[e+1&15],i=i<<1|i>>>31,t[e+1&15]=i,c=(f<<5|f>>>27)+(o^a^s)+c+3395469782+i|0,o=o<<30|o>>>2,i=t[e-1&15]^t[e-6&15]^t[e-12&15]^t[e+2&15],i=i<<1|i>>>31,t[e+2&15]=i,s=(c<<5|c>>>27)+(f^o^a)+s+3395469782+i|0,f=f<<30|f>>>2,i=t[15&e]^t[e-5&15]^t[e-11&15]^t[e+3&15],i=i<<1|i>>>31,t[e+3&15]=i,a=(s<<5|s>>>27)+(c^f^o)+a+3395469782+i|0,c=c<<30|c>>>2,i=t[e+1&15]^t[e-4&15]^t[e-10&15]^t[e+4&15],i=i<<1|i>>>31,t[e+4&15]=i,o=(a<<5|a>>>27)+(s^c^f)+o+3395469782+i|0,s=s<<30|s>>>2;e[0]=e[0]+o|0,e[1]=e[1]+a|0,e[2]=e[2]+s|0,e[3]=e[3]+c|0,e[4]=e[4]+f|0}}(),n=new w($t),r=new w($t);e.length>$t&&(t.update(e,0,e.length),e=t.digest());for(let t=0;t<$t;t++){const i=t<e.length?e[t]:0;n[t]=54^i,r[t]=92^i}return t.update(n,0,$t),{update(e,n,r){t.update(e,n,r)},digest(){const e=t.digest();t.update(r,0,$t),t.update(e,0,en);const i=t.digest();return t.update(n,0,$t),i}}}function dn(e){return on[e>>>24]<<24|on[e>>>16&255]<<16|on[e>>>8&255]<<8|on[255&e]}function wn(e){return e<<24|(65280&e)<<8|e>>>8&65280|e>>>24}function pn(e){return 255&(e<<1^27*(e>>7))}const hn=typeof R!=ye&&typeof R.getRandomValues==ge,mn="Invalid password",yn="Invalid authentication code",gn="zipjs-abort-check-password",bn="Crypto API not supported";function En(e){if(hn)return R.getRandomValues(e);throw new d(bn)}const Fn={name:"PBKDF2"},Rn=n.assign({hash:{name:"HMAC"}},Fn),Sn=n.assign({iterations:1e3,hash:{name:"SHA-1"}},Fn),zn=["deriveBits"],Dn=[8,12,16],xn=[16,24,32],vn=10,kn=typeof R!=ye,Tn=kn&&R.subtle;let An=kn&&typeof Tn!=ye&&typeof Tn.importKey==ge&&typeof Tn.deriveBits==ge;class Nn extends z{constructor({password:e,rawPassword:t,encryptionStrength:n,checkPasswordOnly:r,checkAuthenticationCode:i=!0}){const o={};super({start(){Un(o,e,t,n)},async transform(e,t){const{password:n,strength:i,h:a,ready:s}=o;if(n?(await async function(e,t,n,r){const i=await Mn(e,t,n,Bn(r,0,Dn[t])),o=Bn(r,Dn[t]);if(i[0]!=o[0]||i[1]!=o[1])throw Ln(e),new d(mn)}(o,i,n,Bn(e,0,Dn[i]+2)),e=Bn(e,Dn[i]+2),r?(Ln(o),t.error(new d(gn))):a()):await s,o.m)return;const c=new w(e.length-vn-(e.length-vn)%16);t.enqueue(Wn(o,e,c,0,vn,!0))},async flush(e){const{F:t,R:n,ready:r}=o;if(t){if(await r,o.m)return;const a=Bn(n,n.length-vn),s=new w(Bn(n,0,n.length-vn));t.process(s,!0);const c=t.digest();let f=n.length<vn?1:0;for(let e=0;e<vn;e++)f|=c[e]^a[e];if(f&&i)return void e.error(new d(yn));e.enqueue(s)}}}),In(this,o)}}class Cn extends z{constructor({password:e,rawPassword:t,encryptionStrength:n}){const r={};super({start(){Un(r,e,t,n)},async transform(e,t){const{password:n,strength:i,h:o,ready:a}=r;let s=Re;if(n?(s=await async function(e,t,n){const r=En(new w(Dn[t]));return Mt(r,await Mn(e,t,n,r))}(r,i,n),o()):await a,r.m)return;const c=new w(s.length+e.length-e.length%16);c.set(s,0),t.enqueue(Wn(r,e,c,s.length,0,!1))},async flush(e){const{F:t,R:n,ready:i}=r;if(t){if(await i,r.m)return;const o=new w(n);t.process(o,!1);const a=Bn(t.digest(),0,vn);e.enqueue(Mt(o,a))}}}),In(this,r)}}function Un(e,t,r,i){n.assign(e,{ready:new g(t=>e.h=t),password:On(t,r),strength:i-1,R:Re,m:!1})}function In(e,t){const r=e.readable.getReader(),i=new D({async pull(e){try{const{value:t,done:n}=await r.read();n?e.close():e.enqueue(t)}catch(e){throw Ln(t),r.cancel(e).catch(()=>{}),e}},cancel:e=>(Ln(t),r.cancel(e))});n.defineProperty(e,"readable",{get:()=>i})}function Wn(e,t,n,r,i,o){const{F:a,R:s}=e;s.length&&(t=Mt(s,t));const c=t.length-i,f=c-c%16;if(n=function(e,t){if(t&&t>e.length){const n=e;(e=new w(t)).set(n,0)}return e}(n,r+f),f){const e=Bn(n,r,r+f);e.set(Bn(t,0,f)),a.process(e,o)}return e.R=Bn(t,f),n}function Ln(e){const{F:t}=e;e.m=!0,t&&t.dispose&&t.dispose()}async function Mn(e,t,r,i){e.password=null;const o=xn[t],s=await async function(e,t,r){if(An)try{const i=await Tn.importKey("raw",e,Rn,!1,zn);return new w(await Tn.deriveBits(n.assign({salt:t},Sn),i,8*r))}catch{An=!1}return function(e,t,n,r){const i=un(e),o=new w(r),s=new w(t.length+4),c=new m(s.buffer);s.set(t);for(let e=1,n=0;n<r;e++,n+=en){c.setUint32(t.length,e),i.update(s,0,s.length);let f=i.digest();const l=f.slice();for(let e=1;e<1e3;e++){i.update(f,0,en),f=i.digest();for(let e=0;e<en;e++)l[e]^=f[e]}o.set(l.subarray(0,a.min(en,r-n)),n)}return o}(e,t,0,r)}(r,i,2*o+2);return e.F=function(e,t){!function(){if(!ln){let e=1,t=1;do{e=255&(e^e<<1^(128&e?27:0)),t=255&(t^t<<1),t=255&(t^t<<2),t=255&(t^t<<4),128&t&&(t^=9),on[e]=255&(t^(t<<1|t>>7)^(t<<2|t>>6)^(t<<3|t>>5)^(t<<4|t>>4)^99)}while(1!=e);on[0]=99;for(let e=0;e<256;e++){const t=on[e],n=pn(t),r=n<<24|t<<16|t<<8|n^t;an[e]=r,sn[e]=r>>>8|r<<24,cn[e]=r>>>16|r<<16,fn[e]=r>>>24|r<<8}ln=!0}}();const n=new Int32Array(60),r=function(e,t){const n=e.length>>2,r=n+6,i=4*(r+1);let o=1;for(let r=0;r<n;r++)t[r]=e[4*r]<<24|e[4*r+1]<<16|e[4*r+2]<<8|e[4*r+3];for(let e=n;e<i;e++){let r=t[e-1];e%n==0?(r=dn(r<<8|r>>>24)^o<<24,o=pn(o)):n>6&&e%n==4&&(r=dn(r)),t[e]=t[e-n]^r}return r}(e,n),i=new Int32Array(4),o=un(t);let a=0,s=0,c=0,f=0;return{process(e,t){t&&o.update(e,0,e.length),function(e){const t=new m(e.buffer,e.byteOffset,e.byteLength),n=e.length;let r=0;for(;r+16<=n;r+=16)l(),t.setInt32(r,t.getInt32(r)^i[0]),t.setInt32(r+4,t.getInt32(r+4)^i[1]),t.setInt32(r+8,t.getInt32(r+8)^i[2]),t.setInt32(r+12,t.getInt32(r+12)^i[3]);if(r<n){l();for(let t=0;r<n;r++,t++)e[r]^=i[t>>2]>>>24-8*(3&t)}}(e),t||o.update(e,0,e.length)},digest:()=>o.digest()};function l(){a=a+1|0,a||(s=s+1|0,s||(c=c+1|0,c||(f=f+1|0)));let e=wn(a)^n[0],t=wn(s)^n[1],o=wn(c)^n[2],l=wn(f)^n[3],u=an[e>>>24]^sn[t>>>16&255]^cn[o>>>8&255]^fn[255&l]^n[4],d=an[t>>>24]^sn[o>>>16&255]^cn[l>>>8&255]^fn[255&e]^n[5],w=an[o>>>24]^sn[l>>>16&255]^cn[e>>>8&255]^fn[255&t]^n[6],p=an[l>>>24]^sn[e>>>16&255]^cn[t>>>8&255]^fn[255&o]^n[7];e=an[u>>>24]^sn[d>>>16&255]^cn[w>>>8&255]^fn[255&p]^n[8],t=an[d>>>24]^sn[w>>>16&255]^cn[p>>>8&255]^fn[255&u]^n[9],o=an[w>>>24]^sn[p>>>16&255]^cn[u>>>8&255]^fn[255&d]^n[10],l=an[p>>>24]^sn[u>>>16&255]^cn[d>>>8&255]^fn[255&w]^n[11],u=an[e>>>24]^sn[t>>>16&255]^cn[o>>>8&255]^fn[255&l]^n[12],d=an[t>>>24]^sn[o>>>16&255]^cn[l>>>8&255]^fn[255&e]^n[13],w=an[o>>>24]^sn[l>>>16&255]^cn[e>>>8&255]^fn[255&t]^n[14],p=an[l>>>24]^sn[e>>>16&255]^cn[t>>>8&255]^fn[255&o]^n[15],e=an[u>>>24]^sn[d>>>16&255]^cn[w>>>8&255]^fn[255&p]^n[16],t=an[d>>>24]^sn[w>>>16&255]^cn[p>>>8&255]^fn[255&u]^n[17],o=an[w>>>24]^sn[p>>>16&255]^cn[u>>>8&255]^fn[255&d]^n[18],l=an[p>>>24]^sn[u>>>16&255]^cn[d>>>8&255]^fn[255&w]^n[19],u=an[e>>>24]^sn[t>>>16&255]^cn[o>>>8&255]^fn[255&l]^n[20],d=an[t>>>24]^sn[o>>>16&255]^cn[l>>>8&255]^fn[255&e]^n[21],w=an[o>>>24]^sn[l>>>16&255]^cn[e>>>8&255]^fn[255&t]^n[22],p=an[l>>>24]^sn[e>>>16&255]^cn[t>>>8&255]^fn[255&o]^n[23],e=an[u>>>24]^sn[d>>>16&255]^cn[w>>>8&255]^fn[255&p]^n[24],t=an[d>>>24]^sn[w>>>16&255]^cn[p>>>8&255]^fn[255&u]^n[25],o=an[w>>>24]^sn[p>>>16&255]^cn[u>>>8&255]^fn[255&d]^n[26],l=an[p>>>24]^sn[u>>>16&255]^cn[d>>>8&255]^fn[255&w]^n[27],u=an[e>>>24]^sn[t>>>16&255]^cn[o>>>8&255]^fn[255&l]^n[28],d=an[t>>>24]^sn[o>>>16&255]^cn[l>>>8&255]^fn[255&e]^n[29],w=an[o>>>24]^sn[l>>>16&255]^cn[e>>>8&255]^fn[255&t]^n[30],p=an[l>>>24]^sn[e>>>16&255]^cn[t>>>8&255]^fn[255&o]^n[31],e=an[u>>>24]^sn[d>>>16&255]^cn[w>>>8&255]^fn[255&p]^n[32],t=an[d>>>24]^sn[w>>>16&255]^cn[p>>>8&255]^fn[255&u]^n[33],o=an[w>>>24]^sn[p>>>16&255]^cn[u>>>8&255]^fn[255&d]^n[34],l=an[p>>>24]^sn[u>>>16&255]^cn[d>>>8&255]^fn[255&w]^n[35],u=an[e>>>24]^sn[t>>>16&255]^cn[o>>>8&255]^fn[255&l]^n[36],d=an[t>>>24]^sn[o>>>16&255]^cn[l>>>8&255]^fn[255&e]^n[37],w=an[o>>>24]^sn[l>>>16&255]^cn[e>>>8&255]^fn[255&t]^n[38],p=an[l>>>24]^sn[e>>>16&255]^cn[t>>>8&255]^fn[255&o]^n[39];let h=40;r>10&&(e=an[u>>>24]^sn[d>>>16&255]^cn[w>>>8&255]^fn[255&p]^n[40],t=an[d>>>24]^sn[w>>>16&255]^cn[p>>>8&255]^fn[255&u]^n[41],o=an[w>>>24]^sn[p>>>16&255]^cn[u>>>8&255]^fn[255&d]^n[42],l=an[p>>>24]^sn[u>>>16&255]^cn[d>>>8&255]^fn[255&w]^n[43],u=an[e>>>24]^sn[t>>>16&255]^cn[o>>>8&255]^fn[255&l]^n[44],d=an[t>>>24]^sn[o>>>16&255]^cn[l>>>8&255]^fn[255&e]^n[45],w=an[o>>>24]^sn[l>>>16&255]^cn[e>>>8&255]^fn[255&t]^n[46],p=an[l>>>24]^sn[e>>>16&255]^cn[t>>>8&255]^fn[255&o]^n[47],h=48),r>12&&(e=an[u>>>24]^sn[d>>>16&255]^cn[w>>>8&255]^fn[255&p]^n[48],t=an[d>>>24]^sn[w>>>16&255]^cn[p>>>8&255]^fn[255&u]^n[49],o=an[w>>>24]^sn[p>>>16&255]^cn[u>>>8&255]^fn[255&d]^n[50],l=an[p>>>24]^sn[u>>>16&255]^cn[d>>>8&255]^fn[255&w]^n[51],u=an[e>>>24]^sn[t>>>16&255]^cn[o>>>8&255]^fn[255&l]^n[52],d=an[t>>>24]^sn[o>>>16&255]^cn[l>>>8&255]^fn[255&e]^n[53],w=an[o>>>24]^sn[l>>>16&255]^cn[e>>>8&255]^fn[255&t]^n[54],p=an[l>>>24]^sn[e>>>16&255]^cn[t>>>8&255]^fn[255&o]^n[55],h=56),i[0]=(on[u>>>24]<<24|on[d>>>16&255]<<16|on[w>>>8&255]<<8|on[255&p])^n[h],i[1]=(on[d>>>24]<<24|on[w>>>16&255]<<16|on[p>>>8&255]<<8|on[255&u])^n[h+1],i[2]=(on[w>>>24]<<24|on[p>>>16&255]<<16|on[u>>>8&255]<<8|on[255&d])^n[h+2],i[3]=(on[p>>>24]<<24|on[u>>>16&255]<<16|on[d>>>8&255]<<8|on[255&w])^n[h+3]}}(Bn(s,0,o),Bn(s,o,2*o)),e.m&&Ln(e),Bn(s,2*o)}function On(e,t){return t===de?_t(e):t}function Bn(e,t,n){return e.subarray(t,n)}class Vn extends z{constructor({password:e,rawPassword:t,passwordVerification:n,checkPasswordOnly:r}){super({start(){Hn(this,e,t,n)},transform(e,t){const n=this;if(n.password||n.rawPassword){const t=Yn(n,e.subarray(0,12));if(n.password=n.rawPassword=null,0!=(t[11]^n.passwordVerification))throw new d(mn);e=e.subarray(12)}r?t.error(new d(gn)):t.enqueue(Yn(n,e))}})}}class Pn extends z{constructor({password:e,rawPassword:t,passwordVerification:n}){super({start(){Hn(this,e,t,n)},transform(e,t){const n=this;let r,i;if(n.password||n.rawPassword){n.password=n.rawPassword=null;const t=En(new w(12));t[11]=n.passwordVerification,r=new w(e.length+t.length),r.set(qn(n,t),0),i=12}else r=new w(e.length),i=0;r.set(qn(n,e),i),t.enqueue(r)}})}}function Hn(e,t,r,i){n.assign(e,{password:t,rawPassword:r,passwordVerification:i}),function(e,t,r){const i=[305419896,591751049,878082192];if(n.assign(e,{S:i,D:new Xt(i[0]),v:new Xt(i[2])}),r)for(let t=0;t<r.length;t++)Jn(e,r[t]);else for(let n=0;n<t.length;n++)Jn(e,t.charCodeAt(n))}(e,t,r)}function Yn(e,t){const n=new w(t.length);for(let r=0;r<t.length;r++)n[r]=jn(e)^t[r],Jn(e,n[r]);return n}function qn(e,t){const n=new w(t.length);for(let r=0;r<t.length;r++)n[r]=jn(e)^t[r],Jn(e,t[r]);return n}function Jn(e,t){let[,n]=e.S;e.D.append([t]);const r=~e.D.get();n=Gn(a.imul(Gn(n+Zn(r)),134775813)+1),e.v.append([n>>>24]);const i=~e.v.get();e.S=[r,n,i]}function jn(e){const t=2|e.S[2];return Zn(a.imul(t,1^t)>>>8)}function Zn(e){return 255&e}function Gn(e){return 4294967295&e}function Kn(e){if(e instanceof D)return e;const t=e.getReader();return new D({async pull(e){try{const{value:n,done:r}=await t.read();r?e.close():e.enqueue(n)}catch(e){throw t.cancel(e).catch(()=>{}),e}},cancel:e=>t.cancel(e)})}function Xn(e,t){e=Kn(e);const n=t?{type:t}:{};if(typeof y.prototype.stream!=ge||new y([]).stream()instanceof D)return new l(e).blob().then(e=>t?new y([e],n):e);const r=[];return e.pipeTo(new x({write(e){r.push(e)}})).then(()=>new y(r,n))}function Qn(e){if(e instanceof x)return e;const t=e.getWriter();return new x({write:e=>t.write(e),close:()=>t.close(),abort:e=>t.abort(e)})}const _n="Invalid codec definition",$n="Reserved compression method",er="Invalid codec module",tr="Compression method not supported",nr=[0,8,9,99],rr=new c,ir=new c;function or(e){return rr.get(e)}function ar(){return t.from(rr.values(),e=>n.assign({},e,ir.get(e.format)))}function sr(e){return ir.get(e)}function cr(e,t){const{CompressionStream:n,DecompressionStream:r}=t;if(typeof n!=ge&&typeof r!=ge)throw new d(er);ir.set(e,{CompressionStream:n,DecompressionStream:r})}const fr="Invalid uncompressed size",lr="Invalid compressed data",ur="Codec out of memory",dr="Invalid CRC32",wr="deflate-raw",pr="deflate64-raw",hr="gzip",mr=[31,139,8];class yr extends z{constructor(e,{chunkSize:t,CompressionStreamFallback:n,CompressionStream:r}){super({});const{compressed:i,encrypted:o,useCompressionStream:a,zipCrypto:s,computeCrc32:c,level:f,deflate64:l,format:u,compressionMethod:d,inputSize:w}=e,p=this;let h,y,g,b=super.readable;const E=u&&sr(u),F=Dr(a,r,n),R=c&&i&&!l&&!E&&(!o||s)&&Boolean(F);if(o&&!s||!c||R||(h=new Qt,b=vr(b,h)),i)if(E)b=kr(b,zr(E.CompressionStream,u,{level:f,chunkSize:t,compressionMethod:d,uncompressedSize:w}));else if(R)g=new gr,b=kr(b,new F(hr,{level:f,chunkSize:t})),b=vr(b,g);else try{b=xr(b,a,{level:f,chunkSize:t},r,n)}catch(e){if(!a&&n)throw Ur(e);let t;try{t=new r(hr)}catch{throw Ur(e)}b=kr(b,t),b=vr(b,new gr)}o&&(s?b=vr(b,new Pn(e)):(y=new Cn(e),b=vr(b,y))),Sr(p,b,()=>{o&&!s||!c||(p.crc32=R?g.crc32:new m(h.value.buffer).getUint32(0))})}}class gr extends z{constructor(){let e,t=10,n=new w(0);super({transform(e,r){if(t){const n=a.min(t,e.length);if(t-=n,!(e=e.subarray(n)).length)return}const i=n.length+e.length;if(i<=8)return void(n=Mt(n,e));const o=i-8,s=a.min(o,n.length);r.enqueue(Mt(n.subarray(0,s),e.subarray(0,o-s))),n=Mt(n.subarray(s),e.subarray(o-s))},flush(){const t=Bt(n);e.crc32=t.getUint32(0,!0),e.uncompressedSize=t.getUint32(4,!0)}}),e=this}}class br extends z{constructor(e,{chunkSize:t,DecompressionStreamFallback:n,DecompressionStream:r}){super({});const{zipCrypto:i,encrypted:o,checkCrc32:a,crc32:s,compressed:c,useCompressionStream:l,deflate64:u,format:p,compressionMethod:h,rawBitFlag:y,outputSize:b}=e;let E,F,R,S=super.readable;if(o&&(i?S=vr(S,new Vn(e)):(F=new Nn(e),S=vr(S,F))),c){const e=new f,i=p&&sr(p);let o;if(i)S=kr(S,zr(i.DecompressionStream,p,{chunkSize:t,compressionMethod:h,rawBitFlag:y,uncompressedSize:b}),e);else{const i=Dr(l,r,n);if(a&&!u&&s!==de&&b!==de&&i)try{o=new i(hr,{chunkSize:t})}catch{o=de}if(!o)try{S=xr(S,l,{chunkSize:t,deflate64:u},r,n,e)}catch(e){if(u||b===de||!l&&n)throw Ur(e);try{o=new r(hr)}catch{throw Ur(e)}}}o?(R=!0,S=function(e,t,n,r,i){const o=t.writable.getWriter(),a=t.readable.getReader(),s=r===de?new Xt:de;let c,f,l=0,u=!1,p=!1;const h=new D({start(e){f=e},pull(){b()},cancel:e=>(p=!0,b(),a.cancel(e))});return async function(){const t=e.getReader();try{const e=new w(10);for(e.set(mr),await o.write(e);;){await y(),await o.ready;const{value:e,done:n}=await Nr(t,i);if(n)break;await o.write(e)}s&&await o.write(new w(0));const a=new w(8),c=Bt(a);c.setUint32(0,s?s.get():r,!0),c.setUint32(4,n,!0),u=!0,await o.write(a),await o.close()}catch(e){await Tr(o,e),await Ar(t,e)}}(),async function(){try{for(;;){const{value:e,done:t}=await m();if(t)break;if(l+=e.length,l>n)throw new d(fr);s&&s.append(e),f.enqueue(e)}p||(p=!0,f.close())}catch(e){!function(e){p||(p=!0,f.error(e),b())}(e),await Ar(a,e)}}(),h;function m(){return a.read().catch(e=>{if(u){if(!s)throw Wr(e,dr);if(l!=n)throw Wr(e,fr);return{done:!0}}throw Cr(e,i)})}function y(){if(!p&&f.desiredSize<=0)return new g(e=>c=e)}function b(){if(c){const e=c;c=de,e()}}}(S,o,b,s,e)):S=function(e,t){const n=e.getReader();return new D({async pull(e){try{const{value:t,done:r}=await n.read();r?e.close():e.enqueue(t)}catch(e){throw await Ar(n,e),Cr(e,t)}},cancel:e=>n.cancel(e)})}(S,e)}a&&!R&&(E=new Qt,S=vr(S,E)),Sr(this,S,()=>{if(E){const e=new m(E.value.buffer).getUint32(0,!1);if(s!=e)throw new d(dr)}})}}const Er=new c;function Fr(e,t){if(!e)return!1;let n=Er.get(e);n||(n=new c,Er.set(e,n));let r=n.get(t);if(r===de){try{new e(t),r=!0}catch{r=!1}n.set(t,r)}return r}function Rr(e){return Fr(e,wr)}function Sr(e,t,r){t=vr(t,new z({flush:r})),n.defineProperty(e,"readable",{get:()=>t})}function zr(e,t,n){if(!e)throw new d(tr);return new e(t,n)}function Dr(e,t,n){return e&&t?t:n&&n.requiresModule?n:void 0}function xr(e,t,n,r,i,o){const a=t&&r?r:i||r,s=n.deflate64?pr:wr;let c;try{c=new a(s,n)}catch(e){if(!t||!i||a==i)throw e;c=new i(s,n)}return kr(e,c,o)}function vr(e,t){return Kn(e).pipeThrough(t)}function kr(e,t,n){const r=t.writable.getWriter(),i=e.getReader();return async function(){try{for(;;){await r.ready;const e=await Nr(i,n);if(e.done){await r.close();break}await r.write(e.value)}}catch(e){await Tr(r,e),await Ar(i,e)}}(),t.readable}async function Tr(e,t){try{await e.abort(t)}catch{}}async function Ar(e,t){try{await e.cancel(t)}catch{}}function Nr(e,t){const n=e.read();return t?n.catch(e=>{throw t.add(e),e}):n}function Cr(e,t){return t.has(e)?e:Wr(e,Ir(e)?ur:lr)}function Ur(e){return Ir(e)?Wr(e,ur):e}function Ir(e){return Vt(e)&&"Z_MEM_ERROR"==e.code}function Wr(e,t){const n=new d(t);return n.cause=e,n}const Lr="data",Mr="deflate",Or="inflate";class Br extends z{constructor(e,t){super({});const r=this,{codecType:i}=e;let o;i.startsWith(Mr)?o=yr:i.startsWith(Or)&&(o=br),r.outputSize=0;let a=0;const s=new o(e,t),c=super.readable,f=new z({transform(e,t){e&&e.length&&(a+=e.length,t.enqueue(e))},flush(){n.assign(r,{inputSize:a})}}),l=new z({transform(t,n){if(t&&t.length&&(n.enqueue(t),r.outputSize+=t.length,e.outputSize!==de&&r.outputSize>e.outputSize))throw new d(fr)},flush(){const{crc32:e}=s;n.assign(r,{crc32:e,inputSize:a})}});n.defineProperty(r,"readable",{get:()=>c.pipeThrough(f).pipeThrough(s).pipeThrough(l)})}}class Vr extends z{constructor(e){const t=[];let r=0,o=0;function a(){const n=new w(e);let i=0;for(;i<e;){const r=t[0],o=e-i;r.length<=o?(n.set(r,i),i+=r.length,t.shift()):(n.set(r.subarray(0,o),i),t[0]=r.subarray(o),i+=o)}return r-=e,n}(!i.isFinite(e)||e<1)&&(e=262144),super({transform(n,i){for(t.push(n),r+=n.length;r>e;)o+=e,i.enqueue(a())},flush(e){r&&(o+=r,e.enqueue(function(e,t){const n=new w(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return n}(t,r)))}}),n.defineProperty(this,"outputSize",{get:()=>o})}}const Pr="Worker startup timeout";let Hr,Yr,qr,Jr=()=>{};async function jr(){if(Jr)try{return await void 0,!0}catch{}return!1}function Zr(e){e.createWorker?Yr=!0:Hr=!1}class Gr{constructor(e,{readable:t,writable:r},i,o){const{options:a,config:s,T:c,useWebWorkers:f,workerURI:l}=i;let{createWorker:u}=i;const{signal:d}=c;return Yr&&(u=de),n.assign(e,{A:!0,N:(e.N||0)+1,readable:t.pipeThrough(new Vr(Et(s))).pipeThrough(new Kr(c),{signal:d}),writable:r,options:n.assign({},a),C:i,workerURI:l,createWorker:u,terminate:()=>new g(t=>{const{U:n,A:r}=e;r?(e.I=e.I||[],e.I.push(t)):(n&&(n.terminate(),e.U=null),t()),e.W=null}),L(){if(e.A){const{I:t,U:n}=e;t&&(e.I=null,n&&(e.M=!0,n.terminate())),e.A=!1;const r=o(e);t&&t.forEach(e=>e(r))}}}),Hr===de&&(Hr=typeof A!=ye),(f&&qr&&(Hr&&l||u)?qr:Qr)(e,s)}}class Kr extends z{constructor({onstart:e,onprogress:t,size:n,onend:r}){let i=0;super({async start(){e&&await Xr(e,n)},async transform(e,r){i+=e.length,t&&await Xr(t,i,n),r.enqueue(e)},async flush(){r&&await Xr(r,i)}})}}async function Xr(e,...t){try{await e(...t)}catch{}}function Qr(e,t){return{run:()=>_r(e,t)}}async function _r({options:e,readable:t,writable:n,L:r,C:i},o){let a,s,c;try{if(e.compressed&&!e.format){const t=e.codecType.startsWith(Mr),n=t?o.CompressionStreamFallback:o.DecompressionStreamFallback,r=t?o.CompressionStream:o.DecompressionStream;e.useCompressionStream?n&&n.requiresModule&&!Rr(r)&&await f():await f()||n&&!n.requiresModule||(e.useCompressionStream=!0)}e.encrypted&&!e.zipCrypto&&await f(),a=new Br(e,o),s=new Vr(Et(o));const{signal:r}=i.T;await t.pipeThrough(a).pipeThrough(s).pipeTo(n,{preventClose:!0,preventAbort:!0,signal:r});const{crc32:c,inputSize:l,outputSize:u}=a;return{crc32:c,inputSize:l,outputSize:u}}catch(e){if(a){const t=s?s.outputSize:0;if(i.outputSize=t,Vt(e))try{e.outputSize=t}catch{}}throw e}finally{r()}function f(){return c||(c=jr()),c}}const $r={type:"module"},ei="error",ti="abort";let ni,ri,ii;var oi;function ai(e){const{reader:t}=e;t&&t.releaseLock(),e.reader=null,e.writer=null}function si(e){const{U:t}=e;if(t)try{t.terminate()}catch{}e.W=null}function ci(e,t,r,i,o=!0){const{createWorker:a}=r;let s,c,f;if(a)s=a();else if(ri===de||ni!==e){const n=typeof e==ge;c=n?e(o):e;const a=c.startsWith("data:"),l=c.startsWith("blob:");if(a||l){i===de&&(i=!1),i&&(f=$r);try{s=new A(c,f)}catch(o){if(l)try{u.revokeObjectURL(c)}catch{}if(n&&l)return ci(e,t,r,i,!1);if(i)throw o;return ci(e,t,r,!0,!1)}}else{i===de&&(i=!0),i&&(f=$r);try{c=new u(c,t)}catch{}try{s=new A(c,f)}catch(n){if(i)return ci(e,t,r,!1,o);throw n}}ni=e,ri=c,ii=f}else s=new A(ri,ii);return s.addEventListener("message",e=>{r.O=!0,fi(r),async function({data:e},t){const{type:r,value:i,messageId:o,result:a,error:s,errorValue:c}=e,{reader:f,writer:l,B:u,V:p,L:h,N:m}=t,y=()=>t.N!=m;try{if(s)g(function(e,t){const{message:r,stack:i,code:o,name:a,outputSize:s,cause:c,codecImportFailed:f}=e;let l;if(l=t?t.value:n.assign(new d(r),{stack:i,code:o,name:a}),Vt(l))try{s!==de&&(l.outputSize=s),f&&(l.codecImportFailed=!0),c&&(Vt(l.cause)||(l.cause=n.assign(new d(c.message),{name:c.name})),c.code!==de&&l.cause.code!==c.code&&(l.cause.code=c.code)),t&&(l.name!==a&&(l.name=a),l.code!==o&&(l.code=o))}catch{}return l}(s,c));else{if("pull"==r){const{value:e,done:n}=await f.read();y()||ui({type:Lr,value:e,done:n,messageId:o},t)}if(r==Lr){const e=new w(i);await l.ready,await l.write(e),y()||ui({type:"ack",messageId:o},t)}"close"==r&&function(e){y()||(u(e),b(),h())}(a)}}catch(s){y()||(si(t),g(s))}function g(e){y()||(p(e),b(),Vt(e)&&e.codecImportFailed||h())}function b(){l&&l.releaseLock()}}(e,r)}),s.addEventListener(ei,e=>li(e,r)),s.addEventListener("messageerror",e=>li(e,r)),s}function fi(e){const{P:t}=e;t&&(U(t),e.P=null)}function li(e,t){e.preventDefault&&e.preventDefault(),fi(t);const{O:r,V:i,writer:o,L:a}=t;si(t),r||(t.U=null);let s=e.error||new d(e.message||ei);r||(s=n.assign(new d(s.message||ei),{H:!0}),t.Y=s),i&&(i(s),o&&o.releaseLock(),r&&a())}function ui(e,{U:t,writer:n}){try{const{value:n}=e;if(n){e.value=Ot(n);try{t.postMessage(e,[e.value.buffer])}catch{t.postMessage(e)}}else t.postMessage(e)}catch(e){throw n&&n.releaseLock(),e}}oi=function(e,t){const{baseURI:r,chunkSize:o,workerStartupTimeout:a}=t;let{wasmURI:s}=t;if(!e.W){let c;typeof s==ge&&(s=s());try{c=ci(e.workerURI,r,e)}catch{return Zr(e),Qr(e,t)}n.assign(e,{U:c,O:!1,M:!1,Y:null,W:{run:async()=>{try{return await async function(e,t){if(!e.U){const{Y:t}=e;e.Y=null;const n=t||new d(Pr);throw n.H=!0,n}let r,o;const a=new g((t,n)=>{r=t,o=t=>{const{outputSize:r,C:i}=e;if(i.outputSize=r,Vt(t))try{t.outputSize=r}catch{}n(t)}});n.assign(e,{reader:null,writer:null,outputSize:0,J:!1,j:null,B:r,V:o,result:a});const{readable:s,options:c}=e,{writable:f,closed:l,Z:u}=function(e,t){const r=new AbortController;let i;const{writable:o,readable:a}=new z({transform(e,n){t.outputSize+=e.length,n.enqueue(e)}}),s=a.pipeTo(e,{preventClose:!0,preventAbort:!0,signal:r.signal});s.catch(e=>{i||n.assign(t,{J:!0,j:e})});const{signal:c}=t.C.T;if(c){const e=()=>r.abort(c.reason),t=()=>c.removeEventListener(ti,e);c.addEventListener(ti,e),s.then(t,t)}return{writable:o,closed:s,Z:()=>{i=!0,r.abort()}}}(e.writable,e);try{ui({type:"start",options:c,config:t},e)}catch(t){u();try{await l}catch{}throw e.L(),t}n.assign(e,{reader:s.getReader(),writer:f.getWriter()});const{workerStartupTimeout:w}=t;!e.O&&i.isFinite(w)&&w>=0&&(e.P=C(()=>function(e){if(e.P=null,e.O)return;const{V:t,writer:n}=e;if(si(e),e.U=null,t){const e=new d(Pr);e.H=!0,t(e),n&&n.releaseLock()}}(e),w));try{const e=await a;return await p(),await l,e}catch(t){await p(),u();try{await l}catch{}const{outputSize:n,C:r,J:i,j:o}=e;r.outputSize=n;const a=Vt(t)&&(t.codecImportFailed||t.H),s=i&&!a?o:t;if(Vt(s))try{s.outputSize=n}catch{}throw s}async function p(){if(!f.locked)try{await f.getWriter().close()}catch{}}}(e,{chunkSize:o,wasmURI:s,baseURI:r,workerStartupTimeout:a})}catch(n){if(n&&n.H)return Zr(e),ai(e),_r(e,t);if(n&&n.codecImportFailed){if(e.reader)return ai(e),_r(e,t);e.L()}throw n}}}})}return e.W},qr=oi;let di=[];const wi=[];let pi,hi,mi=0;async function yi(e,t){const{options:n,config:r}=t,{useWebWorkers:o,useCompressionStream:a,compressed:s,checkCrc32:c,computeCrc32:f,encrypted:l,format:d,codecURI:w}=n,{workerURI:p,createWorker:h,maxWorkers:m}=r;d&&(w&&(n.codecURI=function(e,t){try{return new u(e,t).toString()}catch{return e}}(w,r.baseURI)),await async function(e,t){!ir.has(e)&&t&&cr(e,await(import(/* webpackIgnore: true */ /* @vite-ignore */t)))}(d,n.codecURI));const y=!(s||c||f||l),b=d===de||Boolean(n.codecURI);return t.useWebWorkers=!y&&b&&(o||o===de&&r.useWebWorkers),t.workerURI=t.useWebWorkers&&p?p:de,t.createWorker=t.useWebWorkers&&h?h:de,n.useCompressionStream=a||a===de&&r.useCompressionStream,(await async function(){const n=di.find(e=>!e.A);if(n)return zi(n),new Gr(n,e,t,E);if(di.length<m){const n={G:mi};return mi++,di.push(n),new Gr(n,e,t,E)}return new g(n=>{wi.push({resolve:n,stream:e,C:t}),hi=r.workerStarvationTimeout,gi()})}()).run();function E(e){if(bi(),e.M)return e.M=!1,Fi();if(wi.length){const[{resolve:t,stream:n,C:r}]=wi.splice(0,1);t(new Gr(e,n,r,E)),gi()}else e.U?(zi(e),function(e,t){const{config:n}=t,{terminateWorkerTimeout:r}=n;i.isFinite(r)&&r>=0&&(e.K=C(async()=>{di=di.filter(t=>t!=e);try{await e.terminate()}catch{}},r))}(e,t)):di=di.filter(t=>t!=e)}}function gi(){!pi&&wi.length&&i.isFinite(hi)&&hi>=0&&(pi=C(Ei,hi))}function bi(){pi&&(U(pi),pi=null)}function Ei(){if(pi=null,wi.length){const[{resolve:e,stream:t,C:n}]=wi.splice(0,1);e(new Gr({},t,Ri(n),Si)),gi()}}function Fi(){const e=wi.splice(0).map(({resolve:e,stream:t,C:n})=>new g(r=>{e(new Gr({},t,Ri(n),()=>{Si(),r()}))}));return bi(),g.all(e)}function Ri(e){return n.assign({},e,{useWebWorkers:!1,workerURI:de,createWorker:de})}function Si(){bi(),gi()}function zi(e){const{K:t}=e;t&&(U(t),e.K=null)}const Di="\0\u263a\u263b\u2665\u2666\u2663\u2660\u2022\u25d8\u25cb\u25d9\u2642\u2640\u266a\u266b\u263c\u25ba\u25c4\u2195\u203c\xb6\xa7\u25ac\u21a8\u2191\u2193\u2192\u2190\u221f\u2194\u25b2\u25bc !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xc7\xfc\xe9\xe2\xe4\xe0\xe5\xe7\xea\xeb\xe8\xef\xee\xec\xc4\xc5\xc9\xe6\xc6\xf4\xf6\xf2\xfb\xf9\xff\xd6\xdc\xa2\xa3\xa5\u20a7\u0192\xe1\xed\xf3\xfa\xf1\xd1\xaa\xba\xbf\u2310\xac\xbd\xbc\xa1\xab\xbb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\xdf\u0393\u03c0\u03a3\u03c3\xb5\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u03c6\u03b5\u2229\u2261\xb1\u2265\u2264\u2320\u2321\xf7\u2248\xb0\u2219\xb7\u221a\u207f\xb2\u25a0\xa0".split("");function xi(e,t){return ki(e,t,!0)}function vi(e){if(!e.some(e=>e>127))return!1;try{return new E("utf-8",{fatal:!0}).decode(e),!0}catch{return!1}}function ki(e,t,n){return t&&"cp437"==t.trim().toLowerCase()?function(e){let t="";for(let n=0;n<e.length;n++)t+=Di[e[n]];return t}(e):new E(t,{ignoreBOM:n}).decode(e)}const Ti="HTTP error ",Ai="HTTP Range not supported",Ni="HTTP resource changed",Ci="Writer iterator completed too soon",Ui="Writer not initialized",Ii="Invalid writer (size must be writable)",Wi="Content-Range",Li="Range",Mi="GET",Oi="bytes",Bi=16777216,Vi="writable",Pi=N();class Hi{constructor(){this.size=0}init(){this.initialized=!0}}class Yi extends Hi{get readable(){return this.createReadable()}createReadable({offset:e=0,size:t,chunkSize:n=Et(bt())}={}){const r=this;let i=0;return n=Ft(n),new D({async pull(o){const s=t===de?n:a.min(n,t-i),c=await Ro(r,e+i,s);c.length&&(o.enqueue(c),i+=c.length),(t!==de&&i>=t||!c.length&&s)&&o.close()}})}}class qi extends Hi{constructor(){super();const e=this,t=new x({write(t){if(!e.initialized)throw new d(Ui);return e.writeUint8Array(Ot(t))}});n.defineProperty(e,Vi,{get:()=>t})}writeUint8Array(){}}let Ji,ji;class Zi extends Yi{constructor(e){super(),n.assign(this,{X:e,size:e.size}),ji||(ji=(async()=>{try{const e=new y([new w(3)]).slice(1,2).stream().getReader();let t=0,n=await e.read();for(;!n.done;)t+=n.value.length,n=await e.read();Ji=1==t}catch{Ji=!1}})())}createReadable(e){const{X:t,size:n}=this,{offset:r=0,size:i=n-r}=e||{};if(typeof t.stream==ge){if(!r&&i>=n)return Kn(t.stream());if(Ji)return Kn(t.slice(r,r+i).stream())}return super.createReadable(e)}async readUint8Array(e,t){const n=this,r=e+t,i=!e&&r>=n.size?n.X:n.X.slice(e,r);let o=await i.arrayBuffer();return o.byteLength>t&&(o=o.slice(e,r)),new w(o)}}class Gi extends Hi{constructor(e){super();const t=this,r=new z;n.defineProperty(t,Vi,{get:()=>r.writable}),t.contentType=e,t._=Xn(r.readable,e),t._.catch(()=>{})}getData(){return this._}}class Ki extends Yi{constructor(e,t){super(),Qi(this,e,t)}async init(){await _i(this,uo,so),super.init()}createReadable(e){const t=this,{useRangeHeader:n,forceRangeRequests:r,size:i,$:o}=t;if((n||r)&&i!==de){const{offset:n=0,size:r=i-n}=e||{},s=o&&n>=i-o.length;if(r>0&&n<i&&!s)return function(e,t,n){let r,i=t,o=0,s=n;return new D({start:()=>c(),async pull(e){r||await c();const{value:t,done:n}=await r.read();if(n)throw new d(Ai);const i=t.length>o?t.subarray(0,o):t;o-=i.length,s-=i.length,i.length&&e.enqueue(i),o||(await async function(){const e=r;r=de,await e.cancel()}(),s||e.close())},cancel:e=>r&&r.cancel(e)});async function c(){const t=a.min(e.maximumRangeSize,s),n=await uo(Mi,e,oo(e,i,t));if(206!=n.status)throw new d(Ai);const c=eo(n);if(c!==de&&c!=i)throw new d(Ai);io(e,n),ro(e,n),i+=t,o=t,r=n.body.getReader()}}(t,n,a.min(r,i-n))}return super.createReadable(e)}readUint8Array(e,t){return $i(this,e,t,uo,so)}}class Xi extends Yi{constructor(e,t){super(),Qi(this,e,t)}async init(){await _i(this,wo,co),super.init()}readUint8Array(e,t){return $i(this,e,t,wo,co)}}function Qi(e,t,r){const{preventHeadRequest:i,useRangeHeader:o,forceRangeRequests:a,combineSizeEocd:s,checkResourceChanges:c=!0,maximumRangeSize:f=Bi,fetch:l}=r;delete(r=n.assign({},r)).preventHeadRequest,delete r.useRangeHeader,delete r.forceRangeRequests,delete r.combineSizeEocd,delete r.checkResourceChanges,delete r.maximumRangeSize,delete r.useXHR,delete r.fetch,n.assign(e,{url:t,options:r,preventHeadRequest:i,useRangeHeader:o,forceRangeRequests:a,combineSizeEocd:s,checkResourceChanges:c,maximumRangeSize:f,fetch:l})}async function _i(e,t,n){const{url:r,preventHeadRequest:i,useRangeHeader:o,forceRangeRequests:a,combineSizeEocd:s}=e;if(function(e){const{baseURI:t}=bt(),{protocol:n}=new u(e,t);return"http:"==n||"https:"==n}(r)&&(o||a)&&(typeof i==ye||i)){const r=await t(Mi,e,oo(e,s?-65557:void 0)),i=r.headers.get("Accept-Ranges");if(!(a||i&&i.toLowerCase()==Oi))throw new d(Ai);{let i;s&&206==r.status&&(i=new w(await r.arrayBuffer())),ro(e,r);const o=to(r);o===de?await lo(e,t,n):e.size=o,i&&i.length&&eo(r)===e.size-i.length&&(e.$=i)}}else await lo(e,t,n)}async function $i(e,t,n,r,i){const{useRangeHeader:o,forceRangeRequests:a,$:s,size:c,options:f}=e;if(o||a){if(t>=c||0===n)return Re;{if(t+n>c&&(n=c-t),s&&t>=c-s.length){const e=t-(c-s.length);return s.slice(e,e+n)}const i=await r(Mi,e,oo(e,t,n));if(206!=i.status)throw new d(Ai);const o=eo(i);if(o!==de&&o!=t)throw new d(Ai);io(e,i),ro(e,i);const a=new w(await i.arrayBuffer());if(a.length!=n)throw new d(Ai);return a}}{const{data:r}=e;return r||await i(e,f),e.data.subarray(t,t+n)}}function eo(e){const t=e.headers.get(Wi);if(t){const e=i(t.trim().split(/[\s-]+/)[1]);if(!i.isNaN(e))return e}}function to(e){const t=e.headers.get(Wi);if(t){const e=t.trim().split(/\s*\/\s*/)[1];if(e&&"*"!=e){const t=i(e);if(!i.isNaN(t))return t}}}function no({headers:e}){return{ee:e.get("Etag")||de,lastModified:e.get("Last-Modified")||de}}function ro(e,t){const{checkResourceChanges:n,te:r}=e;n&&!r&&206==t.status&&(e.te=no(t))}function io(e,t){const{checkResourceChanges:r,te:i,size:o}=e;if(r){const e=to(t);if(e!==de&&o!==de&&e!=o)throw new d(Ni);if(i){const e=no(t);if(n.entries(i).some(([t,n])=>n!==de&&e[t]!==de&&n!=e[t]))throw new d(Ni)}}}function oo(e,t=0,r=1){return n.assign({},ao(e),{[Li]:Oi+"="+(t<0?t:t+"-"+(t+r-1))})}function ao({options:e}){const{headers:t}=e;if(t)return N.iterator in t?n.fromEntries(t):t}async function so(e){await fo(e,uo)}async function co(e){await fo(e,wo)}async function fo(e,t){const n=await t(Mi,e,ao(e));e.data=new w(await n.arrayBuffer()),e.size=e.data.length}async function lo(e,t,n){if(e.preventHeadRequest)await n(e,e.options);else{const r=await t("HEAD",e,ao(e)),o=r.headers.get("Content-Length");o&&!r.headers.get("Content-Encoding")?e.size=i(o):await n(e,e.options)}}async function uo(e,{fetch:t=fetch,options:r,url:i},o){const a=await t(i,n.assign({},r,{method:e,headers:o}));if(a.status>=200&&a.status<=299)return a;throw 416==a.status?new d(Ai):new d(Ti+(a.statusText||a.status))}function wo(e,{url:t},r){return new g((i,o)=>{const a=new XMLHttpRequest;if(a.addEventListener("load",()=>{if(a.status>=200&&a.status<=299){const e=[];a.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(t=>{const n=t.trim().split(/\s*:\s*/);n[0]=n[0].trim().replace(/^[a-z]|-[a-z]/g,e=>e.toUpperCase()),e.push(n)}),i({status:a.status,arrayBuffer:()=>a.response,headers:new c(e)})}else o(416==a.status?new d(Ai):new d(Ti+(a.statusText||a.status)))},!1),a.addEventListener("error",e=>o(e.detail?e.detail.error:new d("Network error")),!1),a.open(e,t),r)for(const e of n.entries(r))a.setRequestHeader(e[0],e[1]);a.responseType="arraybuffer",a.send()})}class po extends Yi{constructor(e,t={}){super(),n.assign(this,{url:e,reader:t.useXHR&&!t.fetch?new Xi(e,t):new Ki(e,t)})}set size(e){}get size(){return this.reader.size}async init(){await this.reader.init(),super.init()}createReadable(e){return this.reader.createReadable(e)}readUint8Array(e,t){return this.reader.readUint8Array(e,t)}}class ho extends Yi{constructor(e){super(),this.ne=e}async init(){const e=this;e.re=0;const t=e.ne=await g.all(e.ne.map(Fo));e.ie=t.map(t=>{const n=e.size;return e.size+=t.size,n}),super.init()}oe(e){const{ie:t,size:n}=this,r=t[e];return r===de?n:r}async readUint8Array(e,t){const n=this,{ne:r}=this;let i,o=0,s=e;for(;r[o]&&s>=r[o].size;)s-=r[o].size,o++;const c=r[o];if(c){const r=c.size;if(s+t<=r)i=await Ro(c,s,t);else{const o=r-s;i=Mt(await Ro(c,s,o),await n.readUint8Array(e+o,t-o))}}else i=Re;return n.re=a.max(o,n.re),i}}class mo extends Hi{constructor(e,t=4294967295){super();const r=this;let i,o,a;n.assign(r,{diskNumber:0,diskOffset:0,size:0,maxSize:t,availableSize:t});const s=new x({async write(t){if(t===Pi)return void(a&&await f());const{availableSize:n}=r;if(a)t.length>=n?(await c(t.subarray(0,n)),await f(),t.length>n&&await this.write(t.subarray(n))):await c(t);else{const{value:n,done:s}=await e.next();if(s&&!n)throw new d(Ci);i=n,i.size=0,i.maxSize&&(r.maxSize=i.maxSize),r.availableSize=r.maxSize,await Eo(i),o=n.writable,a=o.getWriter(),await this.write(t)}},async close(){a&&(await a.ready,await l())},async abort(e){a&&await a.abort(e)}});async function c(e){const t=e.length;t&&(await a.ready,await a.write(e),i.size+=t,r.availableSize-=t)}async function f(){await l(),r.diskOffset+=i.size,r.diskNumber++,a=null,r.availableSize=r.maxSize}async function l(){await a.close()}n.defineProperty(r,Vi,{get:()=>s})}async closeDisk(){const e=this.writable.getWriter();try{await e.ready,await e.write(Pi)}finally{e.releaseLock()}}}class yo{constructor(e){return t.isArray(e)&&(e=new ho(e)),(e instanceof D||typeof e.getReader==ge)&&(e={readable:Kn(e)}),e}}class go{constructor(e){e.writable===de&&typeof e.next==ge&&(e=new mo(e)),(e instanceof x||typeof e.getWriter==ge)&&(e={writable:Qn(e)});try{e.size=e.size===de?0:e.size}catch{throw new d(Ii)}return e}}function bo(e){return Boolean(e&&e.getData)}async function Eo(e,t){if(!e.init||e.initialized)return g.resolve();await e.init(t)}async function Fo(e){return e=new yo(e),await Eo(e),e.size!==de&&e.readUint8Array||(e=new Zi(await Xn(e.readable)),await Eo(e)),e}function Ro(e,t,n){return e.readUint8Array(t,n)}function So(e,t){return e.createReadable?e.createReadable(t):e.readUint8Array?Yi.prototype.createReadable.call(e,t):e.readable}function zo(e,t,n){if(!e.some(e=>e.reason==t)){const r={reason:t};n!==de&&(r.filename=n),e.push(r)}}const Do="filename",xo="rawFilename",vo="comment",ko="rawComment",To="uncompressedSize",Ao="compressedSize",No="offset",Co="diskNumberStart",Uo="lastModDate",Io="rawLastModDate",Wo="lastAccessDate",Lo="rawLastAccessDate",Mo="creationDate",Oo="rawCreationDate",Bo="internalFileAttributes",Vo="externalFileAttributes",Po="msdosAttributesRaw",Ho="msdosAttributes",Yo="msDosCompatible",qo="zip64",Jo="encrypted",jo="version",Zo="versionMadeBy",Go="zipCrypto",Ko="directory",Xo="executable",Qo="compressionMethod",_o="signature",$o="extraField",ea="unixMode",ta="setuid",na="setgid",ra="sticky",ia=[Do,xo,To,Ao,Uo,Io,vo,ko,Wo,Lo,Mo,Oo,No,Co,Bo,Vo,Po,Ho,Yo,qo,Jo,jo,Zo,Go,Ko,Xo,"symlink",Qo,_o,"crc32",$o,"extraFieldUnix","extraFieldInfoZip","extraFieldUnixType1","extraFieldPkwareUnix","uid","gid",ea,"unixExternalUpper",ta,na,ra,"bitFlag","rawBitFlag","filenameLength","extraFieldLength","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp","extraFieldUSDZ"];class oa{constructor(e){ia.forEach(t=>this[t]=e[t])}}const aa=new f([1,Q,10,_,28789,25461,$,ee,te,22613,13]);function sa(e,t,n){return e?t?12:16+4*n:0}const ca="File format is not recognized",fa="End of central directory not found",la="End of Zip64 central directory locator not found",ua="Central directory header not found",da="File contains encrypted entry",wa="Encryption method not supported",pa="Split zip file",ha="Entry data out of bounds",ma="Ambiguous archive",ya="Encrypted central directory is not supported",ga="Unsafe filename",ba="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",Ea="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",Fa="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",Ra="64-bit value exceeds Number.MAX_SAFE_INTEGER",Sa="unsorted central directory",za="unknown version needed to extract",Da="compressed patched data",xa="malformed extra field",va="unknown zip64 extensible data",ka="wrapped entries count",Ta="appended data",Aa="prepended data",Na="prepended central directory",Ca="trailing central directory data",Ua="mismatched central directory offset",Ia="missing zip64 extra field",Wa="duplicate filename",La="mismatched zip64 end of central directory record",Ma="multiple end of central directory records",Oa="mismatched local file header (filename)",Ba="mismatched local file header (general purpose bit flag)",Va="mismatched local file header (compression method)",Pa="mismatched local file header (crc32 or sizes)",Ha=/^[a-zA-Z]:/,Ya=/(^|[\\/])\.\.([\\/]|$)/,qa="utf-8",Ja="cp437",ja=[[To,L],[Ao,L],[No,L],[Co,M]],Za={[M]:{ae:Ws,bytes:4},[L]:{ae:Ls,bytes:8}},Ga=o(i.MAX_SAFE_INTEGER);class Ka{constructor(e,t={}){n.assign(this,{reader:new yo(e),options:t||{},se:{ce:new f,fe:[],le:[]},ue:new WeakSet})}async*getEntriesGenerator(e={}){const t=this;let{reader:r}=t;if(await Eo(r),r.size!==de&&r.readUint8Array||(r=new Zi(await Xn(r.readable)),await Eo(r)),r.size<G)throw new d(ca);const o=t.warnings=[],s=gs(e,t.options),c=s==He,l=s!=qe,u=Fs(Ts(t,e,Oe),s),p=function(e,t){if(e===de)return t;if(!ys(e))throw new d(Ea);return e}(Ts(t,e,"filenameValidation"),s),h=Ts(t,e,"normalizeFilename"),{de:m,we:y}=await Rs(r,l,u);if(!m)throw await async function(e){return await ms(e)==V}(r)?new d(pa):new d(fa);l&&y>1&&ks(Ma);const g=Bt(m);let b=Ws(g,12),E=Ws(g,16);const F=m.offset,R=Is(g,20),S=F+G+R,D=r.size-S;D>u&&ks(Ta),D>0&&zo(o,Ta);let x=Is(g,4);const v=r.re||0;let k,T,A,N,C,U=Is(g,6),I=Is(g,10),W=0,P=X;const q=E==L||b==L||I==M||U==M;if(E!=L&&U!=M&&(E+=hs(r,U)),q){const e=m.offset>=K?await Ro(r,m.offset-K,K):Re,t=Bt(e);if(e.length==K&&Ws(t,0)==j){E=hs(r,Ws(t,4))+Ls(t,8);let e=await Ro(r,E,X),s=Bt(e);if(e.length<X||Ws(s,0)!=J){const t=m.offset-K;let n=t-X;if(await ns(r,n,J)||(n=await async function(e,t){const n=a.max(0,t-65591),r=await Ro(e,n,t-n),o=Bt(r);for(let e=r.length-X;e>=0;e--)if(Ws(o,e)==J&&e+12+i(o.getBigUint64(e+4,!0))==r.length)return n+e}(r,t)),n!==de&&n>=0&&E!=n){const t=E;E=n,E>t&&(W=E-t),e=await Ro(r,E,X),s=Bt(e)}}if(e.length<X||Ws(s,0)!=J)throw new d(la);if(A=!0,N=Ls(s,4)>44,N){const e=a.min(Ls(s,4)-44,r.size-E-X);e>0&&(P+=e,C=function(e){const t={rawExtensibleData:e};if(e.length>=28){const r=Bt(e),i=Is(r,26);n.assign(t,{compressionMethod:Is(r,0),compressedSize:Ls(r,2),uncompressedSize:Ls(r,10),encryptionAlgorithm:Is(r,18),bitLength:Is(r,20),flags:Is(r,22),hashAlgorithm:Is(r,24),hashData:e.subarray(28,28+i)})}return t}(await Ro(r,E+X,e)))}x==M?x=Ws(s,16):x!=Ws(s,16)&&vs(c,o,La),U==M?U=Ws(s,20):U!=Ws(s,20)&&vs(c,o,La),I==M?I=Ls(s,32):I!=Ls(s,32)&&vs(c,o,La),b==L?b=Ls(s,40):b!=Ls(s,40)&&vs(c,o,La),E=hs(r,U)+Ls(s,48)+W}else if(E==L||b==L||U==M)throw new d(la)}let Q=b;const _=m.offset-(A?P+K:0);if(v!=x)throw new d(pa);if(E<0)throw new d(ca);let $=0,ee=E<r.size?await Ro(r,E,b):Re,te=Bt(ee);if(b){let e=_-b;if(E!=e&&U==x){const t=ee.length>=4&&(Ws(te,$)==Y||Boolean(C&&C.compressedSize)||$a(te));if(!t&&e<0)throw new d(ca);let n=!t;if(e>=0&&e+4<=r.size){let i=await ts(r,e);if(!i){const t=await async function(e,t){const n=a.max(0,t-65541),r=await Ro(e,n,t-n),i=Bt(r);for(let e=r.length-6;e>=0;e--)if(Ws(i,e)==H&&e+6+Is(i,e+4)==r.length)return n+e}(r,_),n=t-b;t!==de&&n>=0&&await ts(r,n)&&(e=n,i=!0)}t&&(n=i)}if(n&&e!=E){const n=E;E=e,ee=await Ro(r,E,b),te=Bt(ee);const i=E-n,{pe:a,he:s}=await async function(e,t,n,r){let i={pe:!1,he:!1},o=0;for(;o+Z<=t.length&&Ws(n,o)==Y;){const a=rs(t,n,o);if(a!==de){const t=await ns(e,a,B),n=await ns(e,a+r,B);if(o||(i={pe:t,he:n}),t!=n)return{pe:t,he:n}}o+=Z+Is(n,o+28)+Is(n,o+30)+Is(n,o+32)}return i}(r,ee,te,i);i>0&&(!a||s)?(W+=i,k=t):(vs(c,o,Ua),i<0&&!a&&s&&(W+=i))}}if(ee.length<4)throw new d(ca)}else!I&&E<_&&U==x&&(W+=_-E,E=_);const ne=_-E;if(b!=ne&&ne>=0&&U==x&&(b=ne,ee=await Ro(r,E,b),te=Bt(ee)),E<0||E>=r.size)throw new d(ca);t.directoryOffset=E,t.directoryLength=Q;const re=As(t,e,"decryptCentralDirectory");let fe,le;if(re&&I&&ee.length>=4&&Ws(te,0)!=Y&&(N||$a(te))){const e=function(e,t,n){const r=e&&e.compressedSize?e.compressedSize:t;return r>0&&r<=n?r:n}(C,Q,ee.length);le=ee.subarray(e),ee=await re(ee.subarray(0,e),C),te=Bt(ee),Q=ee.length,fe=!0}C&&!fe&&(ee.length<4||Ws(te,0)==Y)&&zo(o,va),T=E;const ue=Ts(t,e,"filenameEncoding"),we=Ts(t,e,"commentEncoding"),pe=new f;let he,ye=-1/0;const ge=!c&&!A;!I&&ge&&(I=es(te,ee,$),I&&zo(o,ka));const be=n.assign({},t.options,e,{[Me]:s});delete be[ke];for(let i=0;i<I;i++){const s=new _a(r,be);if($+Z>ee.length||Ws(te,$)!=Y){if(0==i&&!fe&&(N||$a(te)))throw new d(ya);throw new d(ua)}os(s,te,$+6);const f=Boolean(s.bitFlag.languageEncodingFlag),l=$+Z,u=l+s.filenameLength+s.extraFieldLength,m=Is(te,$+4),y=!(m>>8),g=m>>8==3,b=Is(te,$+32),E=u+b,F=new w(ee.subarray(l,E)),R=F.subarray(0,s.filenameLength),S=F.subarray(s.filenameLength+s.extraFieldLength),D=f||!ue&&vi(R),x=f||!we&&vi(S),v=Ws(te,$+38),k=v&O,A={readOnly:Boolean(1&k),hidden:Boolean(2&k),system:Boolean(4&k),directory:Boolean(16&k),archive:Boolean(32&k)},C=Ws(te,$+42),U=As(t,e,"decodeText")||xi,B=D?qa:ue||Ja,V=x?qa:we||Ja;let P=U(R,B,Ve);P===de&&(P=xi(R,B));let H,q=U(S,V,Pe);q===de&&(q=xi(S,V)),n.assign(s,{index:i,me:fe,versionMadeBy:m,msDosCompatible:y,zip64:!1,compressedSize:0,uncompressedSize:0,ye:b,offset:C,diskNumberStart:Is(te,$+34),internalFileAttributes:Is(te,$+36),externalFileAttributes:v,msdosAttributesRaw:k,msdosAttributes:A,rawFilename:R,filenameUTF8:D,commentUTF8:x,rawExtraField:F.subarray(s.filenameLength,s.filenameLength+s.extraFieldLength),rawComment:S,filename:P,comment:q});try{H=as(s,s,te,$+6)}catch(e){if(c||e.message!=me)throw e;s.ge=!0,zo(o,Ia,s.filename)}if(P=s.filename,h){const e=h(P);e!==de&&(P=s.filename=e)}if(Es(P,p)){const e=new d(ga);throw e.filename=P,e}if(H&&zo(o,xa,P),s.ge&&s.offset==L)T=0;else{s.offset+=W;const e=hs(r,s.diskNumberStart)+s.offset;T=a.min(e,T),e<ye&&zo(o,Sa,P),ye=e}(s.version&O)>63&&zo(o,za,P),32&~s.rawBitFlag||zo(o,Da,P),pe.has(s.filename)&&(he=!0),pe.add(s.filename);const J=s.externalFileAttributes>>16&M;s.unixMode===de&&16877&J&&(s.unixMode=J);const j=Boolean(s.unixMode&ae),G=Boolean(s.unixMode&se),K=Boolean(512&s.unixMode),X=40960==((s.unixMode===de?J:s.unixMode)&ie),Q=s.unixMode!==de&&(s.unixMode&ie)==oe||(J&ie)==oe||y&&A.directory||s.filename.endsWith(ce),_=!X&&!Q&&(s.unixMode!==de?!!(73&s.unixMode):g&&!!(73&J));n.assign(s,{setuid:j,setgid:G,sticky:K,symlink:X,unixExternalUpper:J,executable:_,directory:Q,zipCrypto:s.encrypted&&!s.extraFieldAES});const ne=new oa(s);if(s.ge&&t.ue.add(ne),ne.getData=(e,n)=>s.getData(e,ne,t,n),ne.arrayBuffer=async e=>{const r=new z,i=Xn(r.readable).then(e=>e.arrayBuffer());return i.catch(()=>{}),await s.getData(r,ne,t,n.assign({},e,{preventClose:!1})),i},$=E,i==I-1&&ge){const e=es(te,ee,$);e&&(I+=e,zo(o,ka))}const{onprogress:re}=e;if(re)try{await re(i+1,I,new oa(s))}catch{}yield ne}let Ee=$,Fe=is(ee.subarray($))||(fe?is(le):de);if(!Fe&&!fe){const e=E+$,t=a.min(_-e,65541);t>=6&&(Fe=is(await Ro(r,e,t)))}Fe&&(t.digitalSignature=Fe,Ee=$+6+Fe.length),($!=Q&&Ee!=Q||!fe&&$!=b&&Ee!=b)&&vs(c,o,Ca),he&&vs(c,o,Wa);const Se=Ts(t,e,"extractPrependedData"),ze=Ts(t,e,"extractAppendedData"),De=(c||Se)&&I&&4==T&&await async function(e){const t=await ms(e);return t==V||808471376==t}(r)?4:0;return c&&(W>0||I&&T>De)&&ks(Aa),(W>0||I&&T>4)&&zo(o,Aa),k&&zo(o,Na),Se&&(t.prependedData=T>De?await Ro(r,De,T-De):Re),t.comment=R?await Ro(r,F+G,R):Re,ze&&(t.appendedData=S<r.size?await Ro(r,S,r.size-S):Re),!0}async getEntries(e={}){const t=[];for await(const n of this.getEntriesGenerator(e))t.push(n);return t}async close(){const{reader:e}=this;e.readUint8Array||!e.readable||e.readable.locked||await e.readable.cancel()}[Se](){return this.close()}}class Xa{constructor(e={}){let r;const{readable:i,writable:o}=new z({start(e){r=e}}),a=new Ka(i,e),s=a.getEntriesGenerator(),c=new f;this.readable=new D({async pull(e){const{done:t,value:r}=await s.next();if(t)return e.close();const i=function(e,t){const{readable:n,writable:r}=new z;let i;const o={cancel:async e=>{t.delete(o),await(i?i.cancel(e):n.cancel(e))}};return o.readable=new D({async pull(a){i||(i=n.getReader(),t.add(o),async function(){try{await e.getData(r,{preventClose:!1})}catch(e){try{await r.abort(e)}catch{}}finally{t.delete(o)}}());const{done:s,value:c}=await i.read();s?a.close():a.enqueue(c)},cancel:e=>o.cancel(e)},{highWaterMark:0}),o}(r,c),o={...r,readable:i.readable};delete o.getData,n.defineProperties(o,{localDirectory:{get:()=>r.localDirectory,enumerable:!0},warnings:{get:()=>r.warnings,enumerable:!0}}),e.enqueue(o)},async cancel(e){const n=t.from(c);c.clear(),r.error(e),await g.allSettled(n.map(t=>t.cancel(e))),await g.allSettled([s.return(),a.close()])}}),this.writable=o}}async function Qa(e,t={}){if(e=new yo(e),await Eo(e),e.size!==de&&e.readUint8Array||(e=new Zi(await Xn(e.readable)),await Eo(e)),e.size<G)return!1;const n=gs(t,{}),r=n!=qe,i=Fs(t[Oe],n),{de:o,we:a}=await Rs(e,r,i);if(!o||n==He&&a>1)return!1;const s=Is(Bt(o),20),c=o.offset+G+s;return e.size-c<=i}class _a{constructor(e,t){n.assign(this,{reader:e,options:t})}async getData(e,t,r,i={}){const o=this,{se:s,directoryOffset:c}=r;if(o.ge)throw new d(me);const f=bt(),{reader:l,index:u,offset:w,diskNumberStart:p,extraFieldAES:h,extraFieldZip64:m,compressionMethod:y,bitFlag:g,rawBitFlag:b,crc32:E,rawLastModDate:F,uncompressedSize:R,compressedSize:S}=o,{dataDescriptor:z}=g,D=t.localDirectory={},v=t.warnings=[],k=hs(l,p)+w,T=await Ro(l,k,fe),A=Bt(T);let N=Ts(o,i,ze),C=Ts(o,i,De);const U=nt(Ts(o,i,xe)),I=Boolean(U),W=!0===U;if(tt(N,C),N=N&&N.length?N:de,C=C&&C.length?C:de,h&&99!=h.originalCompressionMethod)throw new d(tr);if(T.length<fe||Ws(A,0)!=B)throw new d(pe);os(D,A,4);const{extraFieldLength:L,filenameLength:M}=D,V=D.dataOffset=k+fe+M+L,P=Ts(o,i,"checkLocalDirectory"),H=gs(i,o.options),Y=function(e,t){return e===de?t!=qe:Boolean(e)}(P,H),q=Ts(o,i,"checkLocalFilename"),J=function(e,t){return e===de?t==He:Boolean(e)}(q===de?P:q,H);let j=Re;if(J&&(M||L)){const e=await Ro(l,k+fe,M+L);j=e.subarray(0,M),D.rawExtraField=e.subarray(M)}else D.rawExtraField=L?await Ro(l,k+fe+M,L):Re;J&&(D.rawFilename=j),as(o,D,A,4,!0)&&zo(v,xa),function(e,t,n,r,i){const{rawFilename:o}=e,a=!i,s=e.me&&(t.rawBitFlag&re)==re;!r||s||n.length==o.length&&!n.some((e,t)=>e!=o[t])||vs(a,i,Oa),(2121&t.rawBitFlag)!=(2121&e.rawBitFlag)&&vs(a,i,Ba),t.compressionMethod!=e.compressionMethod&&vs(a,i,Va),t.bitFlag.dataDescriptor||s||!(t.crc32||t.compressedSize||t.uncompressedSize)||t.crc32==e.crc32&&t.compressedSize==e.compressedSize&&t.uncompressedSize==e.uncompressedSize||vs(a,i,Pa)}(o,D,j,J,Y?de:v);const{lastAccessDate:Z,creationDate:G,uid:K,gid:X}=D;Z&&t.lastAccessDate===de&&(t.lastAccessDate=Z),G&&t.creationDate===de&&(t.creationDate=G),K!==de&&t.uid===de&&(t.uid=K),X!==de&&t.gid===de&&(t.gid=X);const Q=Ts(o,i,"checkPasswordOnly"),_=o.encrypted&&(!W||Q),$=_&&!h;if(W||(t.zipCrypto=$),_&&!(64&~o.rawBitFlag))throw new d(wa);const ee=I?de:or(y);if(0!=y&&8!=y&&9!=y&&!ee&&!I)throw new d(tr);if(_){if(!$&&(h.strength<1||h.strength>3))throw new d(wa);if(!N&&!C)throw new d(da)}if(V+S>a.min(l.size,c))throw new d(ha);const te=S,ne=$e(Ts(o,i,ve));et(ne);let ie=Ts(o,i,"checkOverlappingEntry");const oe=Ts(o,i,"checkOverlappingEntryOnly");oe&&(ie=!0);const{onstart:ae,onprogress:se,onend:ce}=i,le=0!=y&&!I,ue=I?S-sa(_,$,h&&h.strength):R,we=9==y;let ye=Ts(o,i,Ae);we&&(ye=!1);const ge=Ts(o,i,"checkCrc32"),be=(ge===de?Ts(o,i,"checkSignature"):ge)&&!I&&(!_||$||h&&1==h.vendorVersion),Ee={options:{codecType:Or,password:N,rawPassword:C,zipCrypto:$,encryptionStrength:h&&h.strength,checkCrc32:be,checkAuthenticationCode:Ts(o,i,"checkAuthenticationCode"),passwordVerification:$&&(z?F>>>8&O:E>>>24&O),outputSize:ue,crc32:E,compressed:le,encrypted:_,useWebWorkers:Ts(o,i,Te),useCompressionStream:ye,deflate64:we,format:ee?ee.format:de,codecURI:ee?ee.codecURI:de,compressionMethod:y,rawBitFlag:b,checkPasswordOnly:Q},config:f,T:{signal:ne,size:te,onstart:ae,onprogress:se,onend:ce}};let Fe,Se,ke;ie&&(await async function({reader:e,be:t,index:n,offset:r,crc32:i,compressedSize:o,uncompressedSize:a,dataOffset:s,dataDescriptor:c,extraFieldZip64:f,se:l}){let u=0;if(c){const n=Boolean(f),r=await ds(e,s+o,{crc32:i,compressedSize:o,uncompressedSize:a,zip64:n});r?(t.localDirectory.dataDescriptor=r,u=ps(r.zip64,r.signature)):u=ps(n,!1)}const w={start:r,end:s+o+u,be:t},{ce:p,fe:h,le:m}=l;if(!p.has(n)){const e=function(e,t){let n=0,r=e.length;for(;n<r;){const i=n+r>>>1;e[i].start<t.start?n=i+1:r=i}const i=e[n-1],o=e[n];return i&&us(t,i)?i:o&&us(t,o)?o:void 0}(h,w)||m.find(e=>us(w,e));if(e){const t=new d(he);throw t.overlappingEntry=e.be,t}p.add(n),m.push(w),m.length*m.length>h.length&&(m.sort((e,t)=>e.start-t.start),l.fe=function(e,t){const n=[];let r=0,i=0;for(;r<e.length||i<t.length;)i==t.length||r<e.length&&e[r].start<t[i].start?n.push(e[r++]):n.push(t[i++]);return n}(h,m),m.length=0)}}({reader:l,be:t,index:u,offset:k,crc32:E,compressedSize:S,uncompressedSize:R,dataOffset:V,dataDescriptor:z||D.bitFlag.dataDescriptor,extraFieldZip64:m||D.extraFieldZip64,se:s}),function(e,t,n){const{dataDescriptor:r}=t,i=e.me&&(t.rawBitFlag&re)==re;r&&!i&&(e.crc32!==de&&r.crc32!=e.crc32||r.compressedSize!=e.compressedSize||r.uncompressedSize!=e.uncompressedSize)&&vs(!n,n,Pa)}(o,D,Y?de:v));try{if(!oe){Q&&(e=new x),e=new go(e),await Eo(e,function(e,t,n){return a.min(e,n?1032*t:t)}(ue,S,le)),({writable:Fe}=e);const t=Kn(l.createReadable({offset:V,size:te})),{outputSize:r}=await yi({readable:t,writable:Fe},Ee);if(et(ne),r!=ue)throw n.assign(new d(fr),{outputSize:r});e.size+=r}}catch(t){if(Vt(t)&&t.outputSize!==de&&(e.size+=t.outputSize),!Q||!Vt(t)||t.message!=gn)throw Se=t,ke=!0,t}finally{if((bo(e)||!Ts(o,i,Ne))&&Fe&&!Fe.locked){const e=Fe.getWriter();if(ke)try{await e.abort(Se)}catch{}else await e.close()}}return Q||oe?de:e.getData?e.getData():Fe}}function $a(e){return e.byteLength>=4&&134630224==Ws(e,0)}function es(e,t,n){let r=0;for(;n+Z<=t.length&&Ws(e,n)==Y;)n+=Z+Is(e,n+28)+Is(e,n+30)+Is(e,n+32),r++;return r%65536?0:r}function ts(e,t){return ns(e,t,Y)}async function ns(e,t,n){return!(t<0||t+4>e.size)&&Ws(Bt(await Ro(e,t,4)),0)==n}function rs(e,t,n){const r=Ws(t,n+42);if(r!=L)return r;let i=n+Z+Is(t,n+28);const o=a.min(i+Is(t,n+30),e.length);for(;i+4<=o;){const e=Is(t,i),r=Is(t,i+2);if(1==e){let e=i+4;return Ws(t,n+24)==L&&(e+=8),Ws(t,n+20)==L&&(e+=8),e+8<=o?Ls(t,e):de}i+=4+r}return de}function is(e){if(e.length>=6){const t=Bt(e);if(Ws(t,0)==H){const n=Is(t,4);if(6+n<=e.length)return new w(e.subarray(6,6+n))}}}function os(e,t,r){const i=e.rawBitFlag=Is(t,r+2),o=!(1&~i),a=Ws(t,r+6);n.assign(e,{encrypted:o,version:Is(t,r),bitFlag:{level:(6&i)>>1,dataDescriptor:!(8&~i),languageEncodingFlag:(i&ne)==ne},rawLastModDate:a,lastModDate:Ns(a),filenameLength:Is(t,r+22),extraFieldLength:Is(t,r+24)})}function as(e,t,r,i,o){const{rawExtraField:a}=t,f=t.extraField=new c,l=Bt(a);let u=0,w=!1;try{for(;u<a.length;){const e=Is(l,u),t=Is(l,u+2);f.set(e,{type:e,data:a.slice(u+4,u+4+t)}),u+=4+t}}catch{w=!0}u>a.length&&(w=!0);const p=Is(r,i+4);n.assign(t,{signature:Ws(r,i+10),crc32:Ws(r,i+10),compressedSize:Ws(r,i+14),uncompressedSize:Ws(r,i+18)});const h=f.get(1);let m;h?(function(e,t,n){t.zip64=!0;const r=Bt(e.data),i=ja.filter(([e,n])=>t[e]==n),o=i.reduce((e,[,t])=>e+Za[t].bytes,0);if(e.data.length<o){if(n)return!1;throw new d(me)}const a=[];try{for(let e=0,t=0;e<i.length;e++){const[,n]=i[e],o=Za[n];a.push(o.ae(r,t)),t+=o.bytes}}catch(e){if(n)return!1;throw e}return i.forEach(([n],r)=>{t[n]=e[n]=a[r]}),!0}(h,t,o)||(w=!0),t.extraFieldZip64=h):ja.some(([e,n])=>t[e]==n)&&(o?w=!0:m=!0);const y=f.get(28789);y&&(ss(y,Do,xo,t,e),t.extraFieldUnicodePath=y);const g=f.get(25461);g&&(ss(g,vo,ko,t,e),t.extraFieldUnicodeComment=g);const b=f.get(Q);b&&(99==p||t.encrypted)&&b.data.length>=7?(function(e,t,r){const i=Bt(e.data),o=Us(i,4);n.assign(e,{vendorVersion:Us(i,0),vendorId:Us(i,2),strength:o,originalCompressionMethod:r,compressionMethod:Is(i,5)}),t.compressionMethod=e.compressionMethod,1!=e.vendorVersion&&(t.crc32=de)}(b,t,p),t.extraFieldAES=b):(b&&(w=!0),t.compressionMethod=p);const E=f.get(13);E&&(cs(E,t),t.extraFieldPkwareUnix=E);const F=f.get(22613);F&&(cs(F,t),t.extraFieldUnixType1=F);const R=f.get(_);R&&(function(e,t,n){if(!e.data.length)return;const r=Bt(e.data),i=Us(r,0),o=[],a=[];n?(1&~i||(o.push(Uo),a.push(Io)),2&~i||(o.push(Wo),a.push(Lo)),4&~i||(o.push(Mo),a.push(Oo))):e.data.length>=5&&(o.push(Uo),a.push(Io));let c=1;o.forEach((n,i)=>{if(e.data.length>=c+4){const o=Ws(r,c);t[n]=e[n]=new s(1e3*(0|o));const f=a[i];e[f]=o}c+=4})}(R,t,o),t.extraFieldExtendedTimestamp=R);const S=f.get(10);S&&(function(e,t){const r=Bt(e.data);let i,o=4;try{for(;o<e.data.length&&!i;){const t=Is(r,o),n=Is(r,o+2);1==t&&(i=e.data.slice(o+4,o+4+n)),o+=4+n}}catch{}if(i&&24==i.length){const r=Bt(i),o=r.getBigUint64(0,!0),a=r.getBigUint64(8,!0),s=r.getBigUint64(16,!0);n.assign(e,{rawLastModDate:o,rawLastAccessDate:a,rawCreationDate:s});const c={lastModDate:Cs(o),lastAccessDate:Cs(a),creationDate:Cs(s)};n.assign(e,c),n.assign(t,c,{rawLastAccessDate:a,rawCreationDate:s})}}(S,t),t.extraFieldNTFS=S);const z=f.get(ee);let D;z&&(D=fs(z,t,!0),t.extraFieldInfoZip=z);const x=f.get(te);x&&(fs(x,D?{}:t,!1),t.extraFieldUnix=x);const v=f.get($);if(v&&(t.extraFieldUSDZ=v),m)throw new d(me);return w}function ss(e,t,r,i,o){if(e.data.length<5)return void(e.valid=!1);const a=Bt(e.data),s=new Xt;s.append(o[r]);const c=Bt(new w(4));c.setUint32(0,s.get(),!0);const f=Ws(a,1),l=Us(a,0);n.assign(e,{version:l,[t]:xi(e.data.subarray(5)),valid:1==l&&!o.bitFlag.languageEncodingFlag&&f==Ws(c,0)}),e.valid&&(i[t]=e[t],i[t+"UTF8"]=!0)}function cs(e,t){if(e.data.length<8)return;const r=Bt(e.data),i={lastAccessDate:new s(1e3*(0|Ws(r,0))),lastModDate:new s(1e3*(0|Ws(r,4)))};e.data.length>=12&&(i.uid=Is(r,8),i.gid=Is(r,10)),n.assign(e,i),n.assign(t,i)}function fs(e,t,r){try{const i=Bt(e.data);let o,a;if(r){let t=0;const r=Us(i,t++),s=Us(i,t++);o=ls(e.data.subarray(t,t+s)),t+=s;const c=Us(i,t++);a=ls(e.data.subarray(t,t+c)),n.assign(e,{version:r,uid:o,gid:a})}else e.data.length>=4&&(o=Is(i,0),a=Is(i,2),n.assign(e,{uid:o,gid:a}));return o!==de&&(t.uid=o),a!==de&&(t.gid=a),o!==de||a!==de}catch{}}function ls(e){const t=new w(4);return t.set(e,0),new m(t.buffer,t.byteOffset,4).getUint32(0,!0)}function us(e,t){return e.start<t.end&&t.start<e.end}async function ds(e,t,{crc32:n,compressedSize:r,uncompressedSize:i,zip64:o}){const s=a.min(24,a.max(0,e.size-t)),c=Bt(s?await Ro(e,t,s):Re),f=[[o,!0],[o,!1],[!o,!0],[!o,!1]].map(([e,t])=>ws(c,e,t)).filter(e=>e&&e.compressedSize==r&&e.uncompressedSize==i);return f.find(e=>e.crc32==n)||f[0]||ws(c,o,!0)||ws(c,o,!1)}function ws(e,t,n){const r=n?4:0;if(e.byteLength<ps(t,n)||n&&Ws(e,0)!=P)return de;const i=Ws(e,r);let o,a;try{t?(o=Ls(e,r+4),a=Ls(e,r+12)):(o=Ws(e,r+4),a=Ws(e,r+8))}catch{return de}return{signature:n,zip64:t,crc32:i,compressedSize:o,uncompressedSize:a}}function ps(e,t){return(e?20:12)+(t?4:0)}function hs(e,t){return e.oe?e.oe(t):0}async function ms(e){return Ws(Bt(await Ro(e,0,4)))}function ys(e){return e===He||e===Ye||e===qe}function gs(e,t){return bs(e,bs(t,Ye))}function bs(e,t){const n=e[Me];if(n!==de){if(!ys(n))throw new d(ba);return n}const r=e[ke];return r===de?t:r?He:t==qe?qe:Ye}function Es(e,t){if(t==qe)return!1;const n=e.split("/");return n.length>1&&""===n[n.length-1]&&n.pop(),!!(Ya.test(e)||e.startsWith("/")||e.startsWith("\\")||Ha.test(e))||t==He&&(n.includes(".")||n.includes("")||e.includes("\0"))}function Fs(e,t){if(e!==de){const t=ot(e);if("number"!=typeof t||i.isNaN(t)||t<0)throw new d(Fa);return t}return t==He?0:t==qe?1/0:M}async function Rs(e,t,n){const{size:r}=e,i=a.min(r,65557),o={Ee:64};let s,c,f=0;for await(const[n,a,l,u,d]of Ss(e,i)){const i=Is(n,u+20);if(d+G+i==r){const i=await Ds(e,n,a,u,d,r,o);if(2==i){if(s||(s=zs(l,u,d)),f++,!t||f>1)break}else 1!=i||c||(c=zs(l,u,d))}}return s||(s=c),s||(s=await async function(e,t,n){const{size:r}=e,i=a.min(r,t==1/0?r:65557+t);let o,s;for await(const[t,a,c,f,l]of Ss(e,i)){const i=zs(c,f,l);o||(o=i);const u=await Ds(e,t,a,f,l,r,n);if(2==u)return i;1!=u||s||(s=i)}return s||o}(e,n,o)),{de:s,we:f}}async function*Ss(e,t){const n=e.size-t,r=await Ro(e,n,t),i=Bt(r);for(let e=r.length-G;e>=0;e--)Ws(i,e)==q&&(yield[i,n,r,e,n+e])}function zs(e,t,n){return{offset:n,buffer:new w(e.subarray(t,t+G)).buffer}}async function Ds(e,t,n,r,i,o,a){const s=Is(t,r+10),c=Ws(t,r+12),f=Ws(t,r+16);if(s==M||c==L||f==L)return await xs(e,t,n,i-K,o,a)==j?2:0;if(!s&&!c)return 1;const l=Is(t,r+6);for(const r of[i-c,hs(e,l)+f])if(await xs(e,t,n,r,o,a)==Y)return 2;return 0}async function xs(e,t,n,r,i,o){return r<0||r+4>i?de:r>=n?Ws(t,r-n):o.Ee>0?(o.Ee--,Ws(Bt(await Ro(e,r,4)),0)):de}function vs(e,t,n){e?ks(n):zo(t,n)}function ks(e){const t=new d(ma);throw t.reason=e,t}function Ts(e,t,n){return t[n]===de?e.options[n]:t[n]}function As(e,t,n){return _e(Ts(e,t,n))}function Ns(e){const t=(4294901760&e)>>16,n=e&M,r=new s(1980+((65024&t)>>9),((480&t)>>5)-1,31&t,(63488&n)>>11,(2016&n)>>5,2*(31&n),0);return r<ue?ue:r}function Cs(e){return new s(i(e/o(1e4)-o(116444736e5)))}function Us(e,t){return e.getUint8(t)}function Is(e,t){return e.getUint16(t,!0)}function Ws(e,t){return e.getUint32(t,!0)}function Ls(e,t){const n=e.getBigUint64(t,!0);if(n>Ga)throw new d(Ra);return i(n)}var Ms=n.freeze({__proto__:null,ERR_AMBIGUOUS_ARCHIVE:ma,ERR_BAD_FORMAT:ca,ERR_CENTRAL_DIRECTORY_NOT_FOUND:ua,ERR_CODEC_OUT_OF_MEMORY:ur,ERR_ENCRYPTED:da,ERR_ENCRYPTED_CENTRAL_DIRECTORY:ya,ERR_ENTRY_DATA_OUT_OF_BOUNDS:ha,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:la,ERR_EOCDR_NOT_FOUND:fa,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:me,ERR_INVALID_AUTHENTICATION_CODE:yn,ERR_INVALID_COMPRESSED_DATA:lr,ERR_INVALID_CRC32:dr,ERR_INVALID_FILENAME_VALIDATION:Ea,ERR_INVALID_MAX_APPENDED_DATA_SIZE:Fa,ERR_INVALID_PASSWORD:mn,ERR_INVALID_STRICTNESS:ba,ERR_INVALID_UNCOMPRESSED_SIZE:fr,ERR_LOCAL_FILE_HEADER_NOT_FOUND:pe,ERR_OVERLAPPING_ENTRY:he,ERR_SPLIT_ZIP_FILE:pa,ERR_UNSAFE_FILENAME:ga,ERR_UNSUPPORTED_COMPRESSION:tr,ERR_UNSUPPORTED_ENCRYPTION:wa,ERR_UNSUPPORTED_UINT64:Ra,ERR_WORKER_STARTUP_TIMEOUT:Pr,WARNING_APPENDED_DATA:Ta,WARNING_COMPRESSED_PATCHED_DATA:Da,WARNING_DUPLICATE_FILENAME:Wa,WARNING_MALFORMED_EXTRA_FIELD:xa,WARNING_MISMATCHED_CENTRAL_DIRECTORY_OFFSET:Ua,WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG:Ba,WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD:Va,WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES:Pa,WARNING_MISMATCHED_LOCAL_FILE_HEADER_FILENAME:Oa,WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY:La,WARNING_MISSING_ZIP64_EXTRA_FIELD:Ia,WARNING_MULTIPLE_END_OF_CENTRAL_DIRECTORY:Ma,WARNING_PREPENDED_CENTRAL_DIRECTORY:Na,WARNING_PREPENDED_DATA:Aa,WARNING_TRAILING_CENTRAL_DIRECTORY_DATA:Ca,WARNING_UNKNOWN_VERSION:za,WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA:va,WARNING_UNSORTED_CENTRAL_DIRECTORY:Sa,WARNING_WRAPPED_ENTRIES_COUNT:ka,ZipReader:Ka,ZipReaderStream:Xa,Fe:async function(e,t,{crc32:n,compressedSize:r,uncompressedSize:i,extraFieldZip64:o}){const a=await ds(e,t,{crc32:n,compressedSize:r,uncompressedSize:i,zip64:Boolean(o)});if(a&&a.compressedSize==r&&a.uncompressedSize==i)return ps(a.zip64,a.signature)},isZipFile:Qa});const Os="File already exists",Bs="Zip file comment exceeds 64KB",Vs="Invalid zip file comment (must be a Uint8Array)",Ps="File entry comment exceeds 64KB",Hs="Invalid file entry comment (must be a string)",Ys="Invalid date (must be a valid Date instance)",qs="File entry name exceeds 64KB",Js="Version exceeds 65535",js="The strength must equal 1, 2, or 3",Zs="Encryption is not supported in USDZ files",Gs="Split zip files are not supported in USDZ files",Ks="Encryption is not supported when the 'passThrough' option is set to true (use 'compressed' instead)",Xs="Invalid extra field (must be a Map)",Qs="Invalid extra field type (must be integer 0..65535)",_s="Invalid extra field data (must be a Uint8Array)",$s="Extra field data exceeds 64KB",ec=-2147483648,tc=2147483647,nc=o(0),rc=o("0x7fffffffffffffff"),ic="Zip64 is not supported (set the 'zip64' option to 'true')",oc="Undefined uncompressed size",ac="Undefined compression method",sc="Undefined CRC32",cc="Undefined reader",fc="Invalid reader (must be a Reader instance, a ReadableStream instance, or an object with a 'readable' property)",lc="Zip file not empty",uc="Invalid uid (must be integer 0..2^32-1)",dc="Invalid gid (must be integer 0..2^32-1)",wc="Invalid UNIX mode (must be integer 0..65535)",pc="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",hc="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",mc="Invalid msdosAttributesRaw (must be integer 0..255)",yc="Invalid msdosAttributes (must be an object with boolean flags)",gc="Invalid level (must be integer 0..9)",bc="Signature data exceeds 64KB",Ec="Invalid entry option (must be an entry returned by ZipReader#getEntries())",Fc="The last modification date of an entry encrypted with ZipCrypto cannot be changed when passThrough is set",Rc="compression unavailable",Sc="clamped last modification date",zc=new w([7,0,2,0,65,69,3,0,0]),Dc="infozip",xc="unix",vc=[8,9,5,3];let kc=0;const Tc=[];class Ac{constructor(e,t={}){e=new go(e);const{availableSize:r=we,maxSize:i=we}=e,o=r>0&&r!==we&&i>0&&i!==we;if(o&&t[Le])throw new d(Gs);n.assign(this,{writer:e,Re:o,options:t,Se:new c,ze:new f,offset:t[We]===de?e.size||e.writable.size||0:t[We],De:t[We]===de?0:t[We]-(e.size||e.writable.size||0),xe:new f,ve:[],warnings:[],ke:0,Te:0,Ae:de,Ne:!1})}prependZip(e){return Uc(this,async function(e,t){if(e.ze.size)throw new d(lc);await Ic(e,t)}(this,e))}appendZip(e,t={}){return Uc(this,Ic(this,e,t))}add(e="",r,f={}){const l=this,{xe:u}=l,p=async function(e,r,f,l){const u=(l=n.assign({},l))[Be];if(u!==de){const{Ce:r,Ue:i}=function(e,r,i){if(null===e||typeof e!=be||t.isArray(e))throw new d(Ec);const{externalFileAttributes:o,versionMadeBy:f,comment:l,lastModDate:u,rawLastModDate:w,creationDate:p,lastAccessDate:h,uncompressedSize:m,encrypted:y,zipCrypto:g,crc32:b,compressionMethod:E,extraFieldAES:F,extraFieldUnix:R,internalFileAttributes:S,extraField:z,bitFlag:D,directory:x,uid:v,gid:k}=e,T={externalFileAttributes:o,versionMadeBy:f,comment:l,lastModDate:u,creationDate:p,lastAccessDate:h,internalFileAttributes:S,directory:x};D&&D.languageEncodingFlag&&(T[Ue]=!0);const A=function(e){if(e){const t=new c;if(e.forEach((e,n)=>{aa.has(n)||t.set(n,e.data)}),t.size)return t}}(z);A&&(T[$o]=A),v===de&&k===de||n.assign(T,{uid:v,gid:k,unixExtraFieldType:R?xc:Dc});const N={};if(r&&!x)if(n.assign(N,{uncompressedSize:m,crc32:b,compressionMethod:E}),r!==Je&&n.assign(N,{encrypted:y,zipCrypto:g,encryptionStrength:F?F.strength:de}),D&&(N.dataDescriptor=D.dataDescriptor,N[Ce]=vc[D.level]),i===de)N.rawLastModDate=w;else if(r!==Je&&g&&(!D||D.dataDescriptor)&&i instanceof s&&function(e){let t=new s(2e3*a.ceil(a.floor(e.getTime()/1e3)/2));return t<ue?t=ue:t>le&&(t=le),(t.getHours()<<3|t.getMinutes()>>3)&O}(i)!=(w>>>8&O))throw new d(Fc);return{Ce:T,Ue:N}}(u,nt(rf(e,l,xe)),rf(e,l,Uo));delete l[Be],l=n.assign(r,i,l)}if(rf(e,l,Ko)&&!r.endsWith(ce)&&(r+=ce),e.ze.has(r))throw new d(Os);e.ze.add(r),kc<bt().maxWorkers?kc++:await new g(e=>Tc.push(e));try{return await async function(e,r,c,f){const l=function(e,n,r){let i=rf(e,r,Yo),o=rf(e,r,Zo,i?20:768);const a=rf(e,r,Xo),s=sf(e,r,"uid"),c=sf(e,r,"gid");let f=sf(e,r,ea),l=rf(e,r,"unixExtraFieldType"),u=rf(e,r,ta),w=rf(e,r,na),p=rf(e,r,ra);if(it(s,L,uc),it(c,L,dc),it(f,M,wc),l!==de&&l!==Dc&&l!==xc)throw new d(pc);if(l===xc&&(s!==de&&s>M||c!==de&&c>M))throw new d(hc);l!==de||s===de&&c===de||(l=Dc);let h=sf(e,r,Po),m=rf(e,r,Ho);const y=h!==de||m!==de;if(s!==de||c!==de||f!==de||l||a?(i=!1,o=o&O|768):y&&(i=!0,o&=O),it(h,O,mc),m&&(typeof m!==be||t.isArray(m)))throw new d(yc);if(o>M)throw new d(Js);let g=rf(e,r,Vo);const b=g!==de;b||(g=0),!r[Ko]&&n.endsWith(ce)&&(r[Ko]=!0);const E=rf(e,r,Ko);if(E?(n.endsWith(ce)||(n+=ce),b||(g=16,i||(g|=16877<<16))):i||b||(g=a?493<<16:27525120),!i){const e=f!==de||Boolean(u||w||p);f=f===de?g>>16&M:f&M,u?f|=ae:u=Boolean(f&ae),w?f|=se:w=Boolean(f&se),p?f|=512:p=Boolean(512&f),b&&!e||(E?f=-61441&f|oe:f&ie||(f|=32768),g=(f&M)<<16|g&M)}({msdosAttributesRaw:h,msdosAttributes:m}=function(e,t){if(e!==de)e&=O;else if(t!==de){const{readOnly:n,hidden:r,system:i,directory:o,archive:a}=t;let s=0;n&&(s|=1),r&&(s|=2),i&&(s|=4),o&&(s|=16),a&&(s|=32),e=s&O}return t===de&&(t={readOnly:Boolean(1&e),hidden:Boolean(2&e),system:Boolean(4&e),directory:Boolean(16&e),archive:Boolean(32&e)}),{msdosAttributesRaw:e,msdosAttributes:t}}(h,m)),y&&(g=g&L|h&O);const F=g>>16&M,R=f!==de&&40960==(f&ie);return{name:n,Ie:{versionMadeBy:o,msDosCompatible:Boolean(i),externalFileAttributes:g,unixExternalUpper:F,uid:s,gid:c,unixMode:f,unixExtraFieldType:l,symlink:R,setuid:u,setgid:w,sticky:p,msdosAttributesRaw:h,msdosAttributes:m}}}(e,r,f);({name:r}=l);const u=function(e,t,n){const r=af(e,n,"encodeText")||_t;let o=r(t,Ve);if(o===de&&(o=_t(t)),mf(o)>M)throw new d(qs);const a=n[vo]||"";if(typeof a!=Ee)throw new d(Hs);let c=r(a,Pe);if(c===de&&(c=_t(a)),mf(c)>M)throw new d(Ps);const f=rf(e,n,jo);if(f!==de&&f>M)throw new d(Js);const l=of(e,n,Uo,new s),u=rf(e,n,Io),w=of(e,n,Wo),p=of(e,n,Mo),h=rf(e,n,Bo,0),m=nt(rf(e,n,xe)),y=Boolean(m),g=!0===m;let b=rf(e,n,ze),E=rf(e,n,De);tt(b,E),b=b&&b.length?b:de,E=E&&E.length?E:de;const F=sf(e,n,"encryptionStrength",3),R=rf(e,n,Go),S=rf(e,n,"extendedTimestamp",!0),z=rf(e,n,"ntfsTimestamp"),D=rf(e,n,"keepOrder",!0),x=rf(e,n,Te),v=rf(e,n,"bufferedWrite"),k=af(e,n,"createTempStream"),T=rf(e,n,"dataDescriptorSignature",!0),A=$e(rf(e,n,ve));et(A);const N=rf(e,n,Ue,!gf(o)||!gf(c)),C=rf(e,n,Qo),U=y||C===de?de:or(C);if(!y&&C!==de&&0!==C&&8!==C&&!U)throw new d(tr);let I=sf(e,n,Ce);if(it(I,9,gc),e.options[Le]){if(b!==de||E!==de)throw new d(Zs);I===de&&C===de&&(I=0)}y&&(I=ot(n[Ce]));let W=rf(e,n,Ae),L=rf(e,n,Ie);v&&L===de&&(L=!1),(L===de||R&&!g)&&(L=!0),I!==de&&6!=I&&(W=!1);const O=rf(e,n,qo);if(!(R||b===de&&E===de||i.isInteger(F)&&F>=1&&F<=3))throw new d(js);const B=Oc(n[$o]),V=Oc(n.localExtraField),P=Oc(n.centralExtraField);return{comment:a,Ie:{rawFilename:o,rawComment:c,version:f,lastModDate:l,rawLastModDate:u,lastAccessDate:w,creationDate:p,internalFileAttributes:h,We:y,Le:g,password:b,rawPassword:E,encryptionStrength:F,zipCrypto:R,extendedTimestamp:S,ntfsTimestamp:z,keepOrder:D,useWebWorkers:x,bufferedWrite:v,createTempStream:k,dataDescriptorSignature:T,signal:A,useUnicodeFileNames:N,compressionMethod:C,format:U?U.format:de,codecURI:U?U.codecURI:de,Me:U?U.versionNeeded:de,level:I,useCompressionStream:W,dataDescriptor:L,zip64:O,rawExtraField:B,Oe:V,Be:P}}}(e,r,f),{comment:p}=u,h=f[$o];e.Se.set(r,de);const m=e.Ae,y={};let b,E;u.Ie.keepOrder&&(y.Ve=new g(e=>b=e)),e.Ae=y;try{const{Ie:t}=u;0==t.level||t.compressionMethod!==de||t.We||await async function(e){const{CompressionStream:t,CompressionStreamFallback:n}=e;return!(!n||n.requiresModule)||!(!Rr(t)&&(r=t,!Fr(r,hr)))||!!n&&await jr();var r}(bt())||(t.level=0,zo(e.warnings,Rc,r));const i=await async function(e,t,{Ie:r},i){if(r.We&&!t&&!rf(e,i,Ko))throw new d(cc);let o;if(t){if(t=new yo(t),await Eo(t),!t.readUint8Array&&!t.readable)throw new d(fc);({size:o}=t)}return n.assign({reader:t},function(e,t,n,r,i){const{We:o,Le:a,zipCrypto:s,password:c,rawPassword:f,encryptionStrength:l}=r;let{dataDescriptor:u,zip64:w,level:p,compressionMethod:h}=r,m=0,y=0,g=!1;if(o&&t){if(y=i[To],y===de)throw new d(oc);if(h===de)throw new d(ac)}const b=!0===w,E=rf(e,i,Jo);if(t&&a&&!E&&mf(c,f))throw new d(Ks);const F=t&&(Boolean(c&&mf(c)||f&&mf(f))||a&&E);t||(p=0,h=0);const R=sa(F,s,l);t&&(o?(i.uncompressedSize=y,m=n===de?cf(y)+R:n+(a?0:R)):n===de?(u=!0,(w||w===de)&&(w=g=!0,m=4294967296)):(i.uncompressedSize=y=n,m=(ff(h,p)?cf(y):y)+R));const S=!(F||t&&(0!==n||o)||ff(h,p));S&&rf(e,i,Ie)===de&&(u=!1);const z=b||g||y>=L,D=b||m>=L;if(z||D){if(!1===w)throw new d(ic);w=!0}return w=w||!1,{Pe:m,Ie:{dataDescriptor:u,He:S,zip64:w,Ye:b,qe:g,Je:z,je:D,uncompressedSize:y,level:p,compressionMethod:h,encrypted:F}}}(e,Boolean(t),o,r,i))}(e,c,u,f);({reader:c}=i);const p=Yc(e.writer),h=Hc(e.writer);let F=f.crc32===de?f[_o]:f.crc32;const R=i.Ie.encrypted&&!t.zipCrypto;if(t.We&&!t.Le&&R&&(F=de),t.We&&c&&!R&&F===de)throw new d(sc);const S=function(e){const{rawFilename:t,lastModDate:n,rawLastModDate:r,lastAccessDate:i,creationDate:o,level:c,zip64:f,zipCrypto:l,useUnicodeFileNames:u,dataDescriptor:w,directory:p,rawExtraField:h,Oe:m,encryptionStrength:y,extendedTimestamp:g,ntfsTimestamp:b,We:E,encrypted:F,Je:R,je:S,uncompressedSize:z,qe:D,crc32:x}=e;let{version:v,compressionMethod:k}=e;const T=!p&&ff(k,c);let A;const N=E||!T,C=f&&(e.bufferedWrite||!w||!R&&!S||N&&!D),U=C||f&&w&&(R||S);if(f&&(R||S)){const e=20,t=Pc(e);if(t.Ze(1),t.Ze(e-4),A=t.Ge,C&&(t.Ke(z),N)){const e=sa(F,l,y);t.Ke(E?0:z+e)}}else A=Re;let I,W,L,O,V,P,H;if(F&&!l){const e=Pc(mf(zc)+2);e.Ze(Q),e.Xe(zc),I=e.Ge,I[8]=y}else I=Re;if(g){const e=tf(n),t=(Y=e)>=ec&&Y<=tc;if(t){const t=9+(i?4:0)+(o?4:0),n=Pc(t);O=1+(i?2:0)+(o?4:0),V=e,n.Ze(_),n.Ze(t-4),n.Qe(O),n._e(e),i&&n._e(nf(tf(i))),o&&n._e(nf(tf(o))),L=n.Ge}else L=Re;if(b===de?!t||Boolean(i||o):b)try{const e=ef(n),t=Pc(36);t.Ze(10),t.Ze(32),t.$e(4),t.Ze(1),t.Ze(24),t.Ke(e),t.Ke(i?ef(i):e),t.Ke(o?ef(o):e),W=t.Ge}catch{W=Re}else W=Re}else W=L=Re;var Y;try{const{uid:t,gid:n,unixExtraFieldType:r}=e;if(r!=Dc||t===de&&n===de)if(r!=xc||t===de&&n===de)P=H=Re;else{const e=Pc(8);e.Ze(te),e.Ze(4),e.Ze((t===de?0:t)&M),e.Ze((n===de?0:n)&M),P=e.Ge;const r=Pc(4);r.Ze(te),r.Ze(0),H=r.Ge}else{const e=Vc(t===de?0:t),r=Vc(n===de?0:n),i=3+e.length+r.length,o=Pc(4+i);o.Ze(ee),o.Ze(i),o.Qe(1),o.Qe(e.length),o.Xe(e),o.Qe(r.length),o.Xe(r),P=H=o.Ge}}catch{P=H=Re}k===de&&(k=T?8:0),v===de&&(v=0!=k||p||F?20:10);const{Me:q}=e;T&&q!==de&&(v=v>q?v:q),f&&(v=v>45?v:45),F&&!l&&(v=v>51?v:51,E&&x!==de&&(I[4]=1),df(Bt(I),9,k),k=99);const J=U?mf(A):0,j=J+mf(I,L,W,P,h,m);if(j+(e[Le]?67:0)>M)throw new d($s);const Z=new s(2e3*a.ceil(a.floor(n.getTime()/1e3)/2)),G=Z<ue?ue:Z>le?le:Z,K=mf(L)?new s(1e3*tf(n)):mf(W)?n:G,{et:X,nt:$,rawLastModDate:ne}=yf({version:v,bitFlag:bf(c,u,w,F,k),compressionMethod:k,uncompressedSize:z,lastModDate:G,rawLastModDate:r,rawFilename:t,je:S,Je:R,extraFieldLength:j}),re=Pc(fe+mf(t)+j),ie=re.Ge,oe=Bt(ie);return re._e(B),re.Xe(X),re.Xe(t),U&&re.Xe(A),re.Xe(I),re.Xe(L),re.Xe(W),re.Xe(P),re.Xe(h),re.Xe(m),w&&(S||wf(oe,18,0),R||wf(oe,22,0)),{it:ie,ot:oe,et:X,nt:$,lastModDate:K,st:K===G&&Z.getTime()!=G.getTime(),rawLastModDate:ne,encrypted:F,compressed:T,version:v,compressionMethod:k,ct:O,ft:V,lt:Re,ut:J,wt:L,ht:W,yt:P,gt:H,bt:I,extraFieldLength:j}}(f=n.assign({},f,l.Ie,u.Ie,i.Ie,{signature:f[_o],crc32:F,offset:e.offset-p,diskNumberStart:h,[Le]:e.options[Le]}));S.st&&zo(e.warnings,Sc,r);const D=function({zip64:e,dataDescriptor:t,dataDescriptorSignature:n}){let r,i=Re,o=0,a=e?20:12;return n&&(a+=4),t&&(i=new w(a),r=Bt(i),n&&(o=4,wf(r,0,P))),{Et:i,Ft:r,Rt:o}}(f),x=mf(S.it,D.Et);E=await async function(e,t,r,i,a){const{Se:s,writer:c}=e,{keepOrder:f,dataDescriptor:l,He:u,signal:w}=a,{St:p,be:h,zt:m,Dt:y}=i,b=e.options[Le];let E,F,R,S,D,x,v,k=h,T=0;const A=f&&m?m.Ve:de;s.set(t,k);try{a.bufferedWrite||!f||e.xt||e.ke||e.Te||!l&&!u?(E=!0,e.ke++,v=a.createTempStream?await a.createTempStream():new z(de,de,{highWaterMark:we}),v.size=0,await Eo(c)):(F=!0,e.Te++,v=c,await A,await N()),await Eo(v);const h=Yc(c);e.Re&&!E&&await Qc(e,c),b&&!E&&Bc(i,e.offset-h);const{it:m}=p;E||await C();const y=Hc(c),R=Jc(e,c);if(k.diskNumberStart=y,E||(D=!0,x=c.size,await _c(v,m)),k=await async function(e,t,{diskNumberStart:r,Ve:i},a,s,c){const{St:f,vt:l,kt:u}=a,{et:w,nt:p,lastModDate:h,rawLastModDate:m,encrypted:y,compressed:g,version:b,compressionMethod:E,lt:F,ut:R,wt:S,ct:z,ft:D,ht:x,yt:v,gt:k,bt:T}=f,{Et:A}=l,{rawFilename:N,lastAccessDate:C,creationDate:U,password:I,rawPassword:W,level:M,useUnicodeFileNames:B,zip64:V,Ye:P,Je:H,je:Y,zipCrypto:q,dataDescriptor:J,directory:j,executable:Z,versionMadeBy:G,rawComment:K,rawExtraField:X,Be:Q,useWebWorkers:_,onstart:$,onprogress:ee,onend:te,signal:ne,encryptionStrength:re,extendedTimestamp:ie,msDosCompatible:oe,internalFileAttributes:ae,externalFileAttributes:se,uid:ce,gid:fe,unixMode:le,symlink:ue,setuid:we,setgid:pe,sticky:he,unixExternalUpper:me,msdosAttributesRaw:ye,msdosAttributes:ge,useCompressionStream:be,We:Ee,Le:Fe,format:Re,codecURI:Se}=c,ze={Ve:i,versionMadeBy:G,zip64:V,Ye:P,directory:Boolean(j),executable:Boolean(Z),filenameUTF8:Boolean(B),rawFilename:N,commentUTF8:Boolean(B),rawComment:K,lt:F,ut:R,wt:S,ht:x,yt:v,gt:k,bt:T,rawExtraField:X,Be:Q,extendedTimestamp:ie,msDosCompatible:oe,internalFileAttributes:ae,externalFileAttributes:se,diskNumberStart:r,uid:ce,gid:fe,unixMode:le,symlink:Boolean(ue),setuid:we,setgid:pe,sticky:he,unixExternalUpper:me,msdosAttributesRaw:ye,msdosAttributes:ge};let{crc32:De,uncompressedSize:xe}=c,ve=0;Ee||(xe=0);const{writable:ke}=t;if(e){const n=e.size,r=Kn(So(e,{size:n})),i={options:{codecType:Mr,inputSize:n,level:M,rawPassword:W,password:I,encryptionStrength:re,zipCrypto:y&&q,passwordVerification:y&&q&&m>>8&O,computeCrc32:!Ee,compressed:g&&!Ee,encrypted:y&&!Fe,useWebWorkers:_,useCompressionStream:be,format:Re,codecURI:Se,compressionMethod:E},config:s,T:{signal:ne,size:n,onstart:$,onprogress:ee,onend:te}};try{const e=await yi({readable:r,writable:ke},i);if(ve=e.outputSize,t.size+=ve,et(ne),Ee||(xe=e.inputSize,y&&!q||(De=e.crc32)),!Y&&ve>=L||!H&&xe>=L)throw new d(ic)}catch(e){const{outputSize:n}=i;throw n!==de?t.size+=n:Vt(e)&&e.outputSize!==de&&(t.size+=e.outputSize),e}}return function({crc32:e,compressedSize:t,uncompressedSize:n,St:r,vt:i},{zip64:a,zipCrypto:s,We:c,dataDescriptor:f}){const{nt:l,encrypted:u}=r,{Ft:d,Rt:w}=i;u&&!s&&!c||e===de||(wf(l,10,e),f&&wf(d,w,e)),a?f&&(pf(d,w+4,o(t)),pf(d,w+12,o(n))):(wf(l,14,t),wf(l,18,n),f&&(wf(d,w+4,t),wf(d,w+8,n)))}({crc32:De,compressedSize:ve,uncompressedSize:xe,St:f,vt:l},c),J&&await _c(t,A),n.assign(ze,{uncompressedSize:xe,compressedSize:ve,lastModDate:h,rawLastModDate:m,creationDate:U,lastAccessDate:C,encrypted:Boolean(y),zipCrypto:Boolean(q),size:u+ve,compressionMethod:E,version:b,et:w,nt:p,signature:De,crc32:!y||q||Ee?De:de,ct:z,ft:D,Je:H,je:Y}),ze}(r,v,k,i,bt(),a),E||(D=!1),s.set(t,k),k.filename=t,E){if(await g.all([v.writable.getWriter().close(),A]),await N(),e.Re&&await Qc(e,c),S=!0,x=c.size,await C(),k.diskNumberStart=Hc(c),k.offset=Jc(e,c),b){const t=i.kt;Bc(i,e.offset-Yc(c)),k.size+=i.kt-t}!function({rawFilename:e,encrypted:t,zip64:n,ut:r,crc32:i,compressedSize:a,uncompressedSize:s,Je:c,je:f},l,{dataDescriptor:u,We:d}){if(u||((!t||d&&i!==de)&&wf(l,14,i),f||wf(l,18,a),c||wf(l,22,s)),n&&r){const t=fe+mf(e)+4;pf(l,t,o(s)),pf(l,t+8,o(a))}}(k,p.ot,a),await _c(c,p.it),await $c(v.readable,c,w,e=>T+=e),c.size+=v.size,S=!1}else k.diskNumberStart=y,k.offset=R;return e.offset+=k.size,k}catch(n){if(S||D){if(e.hasCorruptedEntries=!0,n)try{n.corruptedEntry=!0}catch{}e.offset+=c.size-x,E&&(e.offset+=T)}throw s.delete(t),n}finally{if(E&&e.ke--,F&&e.Te--,y&&y(A),R&&R(),E&&v&&v.dispose)try{await v.dispose()}catch{}}async function N(){e.xt=!0;const{Tt:t}=e;e.Tt=new g(t=>R=()=>{e.xt=!1,t()}),await t}async function C(){qc(c,mf(p.it))&&await c.closeDisk()}}(e,r,c,{St:S,vt:D,kt:x,be:y,zt:m,Dt:b},f)}catch(t){throw e.Se.delete(r),t}finally{b&&b(m&&m.Ve)}return n.assign(E,{name:r,comment:p,extraField:h}),new oa(E)}(e,r,f,l)}catch(t){throw e.ze.delete(r),t}finally{const e=Tc.shift();e?e():kc--}}(l,e,r,f);u.add(p);const h=()=>u.delete(p);return g.prototype.then.call(p,h,h),Uc(l,p)}remove(e){const{ze:t,Se:n}=this;if(typeof e==Ee&&(e=n.get(e)),e&&e.filename!==de){const{filename:r}=e;if(t.has(r)&&n.has(r))return t.delete(r),n.delete(r),!0}return!1}async close(e=Re,n={}){const r=this,{xe:i,writer:a}=this,{writable:s}=a;if(r.Ne)return Cc(a);if(!(e instanceof w))throw new d(Vs);if(mf(e)>M)throw new d(Bs);for(;i.size;)await g.allSettled(t.from(i));await g.allSettled(r.ve.map(e=>e.At));const c=r.ve.filter(e=>e.Nt&&!e.Ct);if(c.length){const e=c.map(e=>e.error);c.forEach(e=>e.Ct=!0);const[t]=e;try{t.entryErrors=e}catch{}throw t}return await async function(e,n,r){const{Ut:i,It:a}=function(e){let t=0,n=!1;for(const[,r]of e){const{rawFilename:e,bt:i,rawComment:o,ht:a,gt:s,rawExtraField:c,Be:f,ct:l,ft:u,Ye:w,uncompressedSize:p,compressedSize:h}=r;let{Je:m,je:y}=r;w||(m&&p<L&&(m=r.Je=!1),y&&h<L&&(y=r.je=!1)),n=n||m||y;const g=r.offset>=L,b=r.diskNumberStart>=M;let E,F;if(g||b||m||y){const e=4+(m?8:0)+(y?8:0)+(g?8:0)+(b?4:0),t=Pc(e);t.Ze(1),t.Ze(e-4),m&&t.Ke(p),y&&t.Ke(h),g&&t.Ke(r.offset),b&&t._e(r.diskNumberStart),E=t.Ge}else E=Re;if(r.lt=E,r.Wt=g,r.Lt=b,u===de)F=Re;else{const e=Pc(9);e.Ze(_),e.Ze(5),e.Qe(l),e._e(u),F=e.Ge}r.wt=F;const R=mf(E,i,a,s,F,c,f);if(R>M)throw new d($s);t+=Z+mf(e,o)+R}return{Ut:t,It:n}}(e.Se),{Mt:s,Ot:c,Bt:f}=await async function(e,n,r){const{Se:i,writer:o}=e,a=new w(n);await Eo(o);let s=0,c=0,f=Hc(o),l=Yc(o),u=0;for(const[e,n]of t.from(i.values()).entries()){const{offset:t,rawFilename:d,lt:w,bt:p,wt:h,ht:m,gt:y,rawExtraField:g,Be:b,rawComment:E,versionMadeBy:F,et:R,nt:S,Je:z,je:D,Lt:x,Wt:v,internalFileAttributes:k,externalFileAttributes:T,diskNumberStart:A,uncompressedSize:N,compressedSize:C}=n,U=mf(w,p,h,m,y,g,b),I=Z+mf(d,E)+U;qc(o,s+I-c)&&(await _c(o,a.slice(c,s)),c=s,u=0,await o.closeDisk()),0==e&&(f=Hc(o),l=Yc(o)),z||wf(S,18,N),D||wf(S,14,C),(v||x)&&n.version<45&&df(S,0,45);const W=Pc(I);if(W._e(Y),W.Ze(F),W.Xe(R.subarray(0,24)),W.Ze(U),W.Ze(mf(E)),W.Ze(x?M:A),W.Ze(k),W._e(T),W._e(v?L:t),W.Xe(d),W.Xe(w),W.Xe(p),W.Xe(h),W.Xe(m),W.Xe(y),W.Xe(g),W.Xe(b),W.Xe(E),hf(a,W.Ge,s),s+=I,u++,r.onprogress)try{await r.onprogress(e+1,i.size,new oa(n))}catch{}}return await _c(o,c?a.slice(c):a),{Mt:{diskNumber:f,diskOffset:l},Ot:{diskNumber:Hc(o),Vt:u},Bt:a}}(e,i,r),l=await async function(e,t,n){const r=af(e,n,"signCentralDirectory");if(r){const n=await r(t),i=mf(n);if(i>M)throw new d(bc);const o=Pc(6+i);o._e(H),o.Ze(i),o.Xe(n);const{writer:a}=e;return qc(a,mf(o.Ge))&&await a.closeDisk(),await _c(a,o.Ge),6+i}return 0}(e,f,r);await async function(e,t,n,r){const{writer:i}=e,{Mt:a,Ot:s,Pt:c,It:f}=r;let{Ut:l}=r,u=e.Se.size,w=a.diskNumber,p=Jc(e,a);const h=mf(t);if(h>M)throw new d(Bs);let m=rf(e,n,qo),y=Hc(i);if(qc(i,(m?98:G)+h)&&y++,p>=L||l>=L||u>=M||y>=M){if(!1===m)throw new d(ic);m=!0}else m===de&&f&&(m=!0);const g=Pc(m?98:G);qc(i,mf(g.Ge)+h)&&await i.closeDisk(),y=Hc(i);let b=y==s.diskNumber?s.Vt:0;m&&(g._e(J),g.Ke(44),g.Ze(45),g.Ze(45),g._e(y),g._e(w),g.Ke(b),g.Ke(u),g.Ke(l),g.Ke(p),g._e(j),g._e(y),g.Ke(o(Jc(e,i))+o(l)+o(c)),g._e(y+1),rf(e,n,"supportZip64SplitFile",!0)&&(y=M,w=M),b=M,u=M,p=L,l=L),g._e(q),g.Ze(y),g.Ze(w),g.Ze(b),g.Ze(u),g._e(l),g._e(p),g.Ze(h),await _c(i,g.Ge),h&&await _c(i,t)}(e,n,r,{Mt:s,Ot:c,Ut:i,Pt:l,It:a})}(r,e,n),r.Ne=!0,!bo(a)&&rf(r,n,Ne)||await s.getWriter().close(),Cc(a)}[Se](){return this.close()}}class Nc extends g{then(e,t){const{Ht:n}=this;return n&&(n.Ct=!0),super.then(e,t)}}function Cc(e){return e.getData?e.getData():e.writable}function Uc(e,t){const r=new Nc((e,n)=>g.prototype.then.call(t,e,n)),i={};return r.Ht=i,i.At=g.prototype.then.call(r,de,e=>n.assign(i,{Nt:!0,error:e})),e.ve.push(i),r}async function Ic(e,r,i={}){const{xe:o,ze:s,Se:l}=e,u=_e(i.filter),w=function(e){if(e&&(typeof e!=be||t.isArray(e)))throw new d(Xe);return e}(i.readerOptions);for(;o.size;)await g.allSettled(t.from(o));let p;const h=new g(e=>p=e);o.add(h);const m=[];let y;try{r=new yo(r),await Eo(r),r.size!==de&&r.readUint8Array||(r=new Zi(await Xn(r.readable)),await Eo(r));const{ZipReader:i,Fe:o}=await g.resolve().then(function(){return Ms}),p=new i(r,w),h=[];let b;try{b=await p.getEntries();for(const e of b)u&&!await u(e,Wc(l,e.filename))||h.push(e)}finally{await p.close()}await Eo(e.writer);const{directoryOffset:E,ue:F}=p;h.forEach(e=>{const{filename:t}=e;if(F.has(e))throw new d(me);if(s.has(t))throw new d(Os);s.add(t),m.push(t)}),e.xt=!0;const{Tt:R}=e;e.Tt=new g(t=>y=()=>{e.xt=!1,t()}),await R,e.Re&&(delete e.Re,!u&&await async function(e){return uf(Bt(await Ro(e,0,4)),0)==V}(r)||(await _c(e.writer,Xc()),e.offset+=4));const S=await async function(e,n,r,i,o,s,l){const{writer:u}=e,w=new c;if(u.closeDisk||s){const p=t.from(r).sort((e,t)=>Kc(n,e)-Kc(n,t)),h=function(e,n,r){const i=new t(n.length);let o=r;for(let t=n.length-1;t>=0;t--){const s=Kc(e,n[t]),c=n[t+1];c&&Kc(e,c)>s&&(o=a.min(Kc(e,c),r)),i[t]=o}return i}(n,p,o),m=new f(i),y=new c;for(let e=0;e<p.length;e++){const t=p[e];if(m.has(t)){const r=Kc(n,t),i=await Gc(n,r);if(i===de)throw new d(pe);let o=r+i+t.compressedSize;if(t.bitFlag.dataDescriptor){const r=await l(n,o,t);o=r===de?a.max(o,h[e]):o+r}if(o>h[e])throw new d(he);h[e]=o,y.set(t,i)}}let g,b=0;for(let t=0;t<p.length;t++){const r=p[t];if(m.has(r)){const i=Kc(n,r);i<b?w.set(r,g):(s||await Zc(e,n,b,i-b),u.closeDisk&&qc(u,y.get(r))&&await u.closeDisk(),g={offset:Jc(e,u),diskNumberStart:Hc(u)},w.set(r,g),await Zc(e,n,i,h[t]-i),b=h[t])}}s||await Zc(e,n,b,o-b)}else{const t=e.offset;await Zc(e,n,0,o),r.forEach(e=>w.set(e,{offset:t+Kc(n,e),diskNumberStart:0}))}return w}(e,r,b,h,E,Boolean(u),o);h.forEach(e=>{const{version:t,rawLastModDate:r,rawFilename:i,rawBitFlag:o,uncompressedSize:a,compressedSize:s,extraFieldZip64:c}=e;let{compressionMethod:f,rawExtraField:u}=e;u=jc(u||Re),e.extraFieldAES&&(f=99);const d=mf(u),w=Boolean(c)&&c.uncompressedSize!==de,p=Boolean(c)&&c.compressedSize!==de,{et:h,nt:m}=yf({version:t,bitFlag:o,compressionMethod:f,uncompressedSize:a,compressedSize:s,rawLastModDate:r,rawFilename:i,je:p,Je:w,extraFieldLength:d}),{crc32:y}=e;y!==de&&wf(m,10,y);const{offset:g,diskNumberStart:b}=S.get(e);l.set(e.filename,n.assign({},e,{Ye:!0,Je:w,je:p,offset:g,diskNumberStart:b,Lt:!1,lt:Re,bt:Re,wt:Re,ht:Re,yt:Re,gt:Re,rawExtraField:u,Be:Re,et:h,nt:m}))})}catch(e){throw m.forEach(e=>s.delete(e)),e}finally{p(),o.delete(h),y&&y()}}function Wc(e,t){const n=e.get(t);return n?new oa(n):de}async function Lc(e,t){try{await e.writer.writable.abort(t)}catch{}}function Mc(e,t,n){e.xe.add(t),t.catch(e=>{try{n(e)}catch{}})}function Oc(e){if(!e)return Re;if(!(e instanceof c))throw new d(Xs);let t=0,n=0;e.forEach((e,n)=>{if(rt(n,M,Qs),!(e instanceof w))throw new d(_s);if(mf(e)>M)throw new d($s);t+=4+mf(e)});const r=new w(t),i=Bt(r);return e.forEach((e,t)=>{df(i,n,t),df(i,n+2,mf(e)),hf(r,e,n+4),n+=4+mf(e)}),r}function Bc(e,t){const{St:n}=e;let{it:r,extraFieldLength:i}=n,o=64-(t+mf(r))%64;o<4&&(o+=64);const a=new w(o),s=Bt(a);df(s,0,$),df(s,2,o-4);const c=r;n.it=r=new w(mf(c)+o),hf(r,c),hf(r,a,mf(c));const f=Bt(r);df(f,28,i+o),n.ot=f,e.kt+=o}function Vc(e){const t=new w(4);Bt(t).setUint32(0,e,!0);let n=4;for(;n>1&&0===t[n-1];)n--;return t.subarray(0,n)}function Pc(e){const t=new w(e),n=Bt(t);let r=0;return{Ge:t,Qe:e=>{!function(e,t,n){e.setUint8(t,n)}(n,r,e),r+=1},Ze:e=>{df(n,r,e),r+=2},_e:e=>{wf(n,r,e),r+=4},Ke:e=>{pf(n,r,o(e)),r+=8},Xe:e=>{hf(t,e,r),r+=mf(e)},$e:e=>r+=e}}function Hc(e){const{diskNumber:t=0}=e;return t}function Yc(e){const{diskOffset:t=0}=e;return t}function qc(e,t){const{availableSize:n=we}=e;return t>n}function Jc(e,{diskNumber:t=0,diskOffset:n=0}){return e.offset-n-(t?e.De:0)}function jc(e){const t=Bt(e);let n=0;for(;n+4<=mf(e);){const r=4+lf(t,n+2);if(1==lf(t,n))return jc(Mt(e.subarray(0,n),e.subarray(a.min(n+r,mf(e)))));n+=r}return e}async function Zc(e,t,n,r){if(r>0){const{writer:i}=e;let o=0;try{await $c(So(t,{offset:n,size:r}),i,de,e=>o+=e)}catch(t){if(o){e.hasCorruptedEntries=!0;try{t.corruptedEntry=!0}catch{}}throw t}finally{i.size+=o,e.offset+=o}}}async function Gc(e,t){const n=t>=0&&t+fe<=e.size?await Ro(e,t,fe):Re;if(mf(n)<fe)return de;const r=Bt(n);return uf(r,0)!=B?de:fe+lf(r,26)+lf(r,28)}function Kc(e,{offset:t,diskNumberStart:n}){return t+(e.oe?e.oe(n):0)}function Xc(){const e=new w(4);return wf(Bt(e),0,V),e}async function Qc(e,t){delete e.Re,await _c(t,Xc()),e.offset+=4}async function _c(e,t){const{writable:n}=e,r=n.getWriter();try{await r.ready,e.size+=mf(t),await r.write(t)}finally{r.releaseLock()}}async function $c(e,t,n,r){const i=t.writable.getWriter();try{await e.pipeTo(new x({async write(e){await i.ready,await i.write(e),r(mf(e))}}),{preventClose:!0,preventAbort:!0,signal:n})}finally{i.releaseLock()}}function ef(e){if(e){const t=(o(e.getTime())+o(116444736e5))*o(1e4);return t<nc?nc:t>rc?rc:t}}function tf(e){return a.floor(e.getTime()/1e3)}function nf(e){return a.min(tc,a.max(ec,e))}function rf(e,t,n,r){const i=t[n]===de?e.options[n]:t[n];return i===de?r:i}function of(e,t,n,r){const o=rf(e,t,n,r);if(null===o)return r;if(o!==de&&(typeof o.getTime!=ge||i.isNaN(o.getTime())))throw new d(Ys);return o}function af(e,t,n){return _e(rf(e,t,n))}function sf(e,t,n,r){return ot(rf(e,t,n,r))}function cf(e){return e+5*(a.floor(e/16383)+1)}function ff(e,t){return e===de?t===de||t>0:0!==e}function lf(e,t){return e.getUint16(t,!0)}function uf(e,t){return e.getUint32(t,!0)}function df(e,t,n){e.setUint16(t,n,!0)}function wf(e,t,n){e.setUint32(t,n,!0)}function pf(e,t,n){e.setBigUint64(t,n,!0)}function hf(e,t,n){e.set(t,n)}function mf(...e){let t=0;return e.forEach(e=>e&&(t+=e.length)),t}function yf({version:e,bitFlag:t,compressionMethod:n,uncompressedSize:r,compressedSize:i,lastModDate:o,rawLastModDate:a,rawFilename:s,je:c,Je:f,extraFieldLength:l}){const u=Pc(26),d=u.Ge,w=Bt(d);if(u.Ze(e),u.Ze(t),u.Ze(n),a===de){const e=new h(1),t=Bt(e);df(t,0,(o.getHours()<<6|o.getMinutes())<<5|o.getSeconds()/2),df(t,2,(o.getFullYear()-1980<<4|o.getMonth()+1)<<5|o.getDate()),a=e[0]}return u._e(a),u.$e(4),c||i!==de?u._e(c?L:i):u.$e(4),f||r!==de?u._e(f?L:r):u.$e(4),u.Ze(mf(s)),u.Ze(l),{et:d,nt:w,rawLastModDate:a}}function gf(e){return e.every(e=>e>=32&&e<=126)}function bf(e,t,n,r,i){let o=0;return t&&(o|=ne),n&&(o|=8),8!=i&&9!=i||(e>=0&&e<=3&&(o|=6),e>3&&e<=5&&(o|=4),9==e&&(o|=2)),r&&(o|=1),o}function Ef(e,t){if(!e)return!1;const{supportedFormats:n}=e;return n?n.includes(t):Fr(e,t)}const Ff=1048576,Rf=".zip.js-temp",Sf=1048576,zf=1048576,Df=".zip.js-temp",xf="createSyncAccessHandle is only available in dedicated workers";try{Dt({baseURI:void 0===F&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:void 0===F?location.href:W&&"SCRIPT"===W.tagName.toUpperCase()&&W.src||new u("zip-native.min.js",F.baseURI).href})}catch{}var{Uint8Array:vf,Uint16Array:kf,Int32Array:Tf,TransformStream:Af,Math:Nf,Error:Cf,Array:Uf}=globalThis,If=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Wf=new vf(0),Lf=new kf(0),Mf=[];for(let e=0;e<6;e++)Mf.push(e,0==e?8:4);Mf.push(0,1);var Of=[];for(let e=0;e<14;e++)Of.push(e,0==e?4:2);var Bf=new kf([0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576]),Vf=new kf([0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0]);function Pf(e,t,n,r,i){if(0==i)return;let o=e instanceof vf?e:new vf(e.buffer,e.byteOffset,e.byteLength),a=n instanceof vf?n.subarray(r,r+i):new vf(n.buffer,n.byteOffset+r,i);o.set(a,t)}function Hf(e,t,n){0!=n&&(e instanceof vf?e:new vf(e.buffer,e.byteOffset,e.byteLength)).fill(0,t,t+n)}function Yf(){return{Yt:Wf,qt:0,Jt:0,jt:0,Zt:Wf,Gt:0,Kt:0,Xt:0,Qt:"",t:0,i:0,_t:0,$t:void 0}}function qf(e,t){let n=1<<t;return{en:e,u:new vf(n),tn:n,k:t,nn:0,rn:0,p:0,an:0}}function Jf(e){let t=[];for(let n=0;n<e.length;n+=2){let r=e[n],i=e[n+1];for(let e=0;e<i;e++)t.push(r)}return new kf(t)}var jf=class{constructor(e,t){this.sn=e,this.cn=t,this.fn=0}},Zf=class{constructor(e,t,n,r,i){this.ln=e,this.un=t,this.q=n,this.dn=r,this.wn=i}};function Gf(e){return Fl[e<-6||e>2?9:2-e]||""}function Kf(e,t){try{e.Qt=Gf(t)}catch(n){e.Qt="zlib error "+r(t)+" ("+n+")"}return t}function Xf(e,t){let n=e>>>0,r=0;for(let e=0;e<t;e++)r=r<<1|1&n,n>>>=1;return r}function Qf(e,t){e.pn[e.hn++]=t}function _f(e,t){Qf(e,255&t),Qf(e,t>>>8&255)}function $f(e,t,n){let r=255&n,i=65535&t,o=e.yn+e.gn;return e.pn[o]=255&i,e.pn[o+1]=i>>>8&255,e.pn[o+2]=r,e.gn+=3,i=i-1&65535,e.En[Tl[r]+wl+1].bn++,e.Fn[nl(i)].bn++,e.gn==e.Rn}function el(e,t){let n=255&t,r=e.yn+e.gn;return e.pn[r]=0,e.pn[r+1]=0,e.pn[r+2]=n,e.gn+=3,e.En[n].bn++,e.gn==e.Rn}function tl(e){return e.tn-ul}function nl(e){return e<256?Al[e]:Al[256+(e>>7)]}function rl(e){let t=cl+7,n=1<<t,r=(1<<t)-1,i=Nf.floor((t+fl-1)/fl),o=1<<8+cl;return{...qf(e,15),en:e,Sn:42,zn:0,Dn:void 0,xn:32767,vn:t,kn:n,Tn:r,An:i,Nn:new kf(32768),Cn:new kf(n),Un:o,pn:new vf(32768),In:0,Wn:32768,hn:0,Ln:0,Mn:0,On:0,Bn:0,Vn:0,Pn:-2,Hn:0,Yn:0,qn:0,Jn:0,jn:0,Zn:0,Gn:0,Kn:0,Xn:0,Qn:0,_n:0,$n:0,er:0,nr:0,rr:new Tf(2*pl+1),ir:new vf(2*pl+1),ar:new kf(gl+1),gn:0,Rn:0,sr:Wf,yn:0,cr:0,lr:0,ur:8,dr:32768,wr:0,pr:0,mr:0,En:new Uf(yl).fill(0).map(()=>({bn:0,yr:0,gr:0,Er:0})),Fn:new Uf(2*hl+1).fill(0).map(()=>({bn:0,yr:0,gr:0,Er:0})),Fr:new Uf(2*ml+1).fill(0).map(()=>({bn:0,yr:0,gr:0,Er:0})),Rr:al(),Sr:al(),zr:al()}}function il(e){let t=[];for(let n=0;n<e.length;n+=2){let r=e[n],i=e[n+1],o=ol();o.yr=r,o.Er=i,t.push(o)}return t}function ol(){return{bn:0,yr:0,gr:0,Er:0}}function al(){return new jf([],function(e,t){return new Zf(null,t,0,0,0)}(0,Wf))}function sl(e){let{code:t,length:n}=function(e){let t=Nf.max(...e),n=new Uf(t+1).fill(0);for(let t of e)t>0&&n[t]++;let r=new Uf(e.length).fill(0),i=new Uf(t+1).fill(0),o=0;for(let e=1;e<=t;e++)o=o+n[e-1]<<1,i[e]=o;for(let t=0;t<e.length;t++){let n=e[t];0!=n&&(r[t]=i[n]++)}return{code:r,length:e}}(e),r=new kf(2*e.length),i=0;for(let o=0;o<e.length;o++){let e=n[o]||0,a=t[o]||0;r[i++]=e?Xf(a,e):0,r[i++]=e}return new kf(r)}var cl=8,fl=3,ll=258,ul=ll+fl+1,dl=ll,wl=256,pl=wl+1+29,hl=30,ml=19,yl=2*pl+1,gl=15,bl=256,El=-1,Fl=["need dictionary","stream end","","file error","stream error","data error","insufficient memory","buffer error",""],Rl=Jf(Mf),Sl=Jf(Of),zl=new kf(19);zl[16]=2,zl[17]=3,zl[18]=7;var Dl=sl(function(){let e=new Uf(288).fill(0);for(let t=0;t<=143;t++)e[t]=8;for(let t=144;t<=255;t++)e[t]=9;for(let t=256;t<=279;t++)e[t]=7;for(let t=280;t<=287;t++)e[t]=8;return e}()),xl=sl(new Uf(30).fill(5)),vl=il(Dl),kl=il(xl),Tl=function(e,t){let n=0;for(let r=0;r<e.length;r++){let i=t[r]?1<<t[r]:1,o=e[r]+i-1;o>n&&(n=o)}n<258&&(n=258);let r=new vf(n+1);for(let i=0;i<=n;i++)for(let n=0;n<e.length;n++){let o=t[n]?1<<t[n]:1,a=e[n];if(i>=a&&i<=a+o-1){r[i]=n;break}}let i=0;for(let n=0;n<e.length-1;n++){let r=t[n]?1<<t[n]:1,o=e[n]+r-1;o>i&&(i=o)}return r[i]=e.length-1,r}(Vf,Rl),Al=function(e){let t=new vf(512),n=e.length-1;for(let r=0;r<256;r++)t[r]=r<=n?e[r]:e[n];for(let r=256;r<=n;r++){let n=r>>7;t[256+(n>255?255:n)]=e[r]}for(let e=257;e<512;e++)0==t[e]&&(t[e]=t[e-1]);return t}(function(e,t){let n=0;for(let r=0;r<e.length;r++){let i=t[r]?1<<t[r]:1,o=e[r]+i-1;o>n&&(n=o)}let r=new vf(n+1);for(let i=0;i<=n;i++)for(let n=0;n<e.length;n++){let o=t[n]?1<<t[n]:1,a=e[n];if(i>=a&&i<=a+o-1){r[i]=n;break}}return r}(Bf,Sl));function Nl(e,t,n){if(void 0===t||void 0===n)return 1;let r=65535&e,i=e>>>16&65535,o=0;for(;n>0;){let e=n>2e3?2e3:n;n-=e;do{r=r+t[o++]|0,i=i+r|0}while(--e);r%=65521,i%=65521}return(i<<16|r)>>>0}var Cl=[[],[],[],[],[],[],[],[]];for(let e=0;e<256;e++){let t=e;for(let e=0;e<8;e++)t=1&t?3988292384^t>>>1:t>>>1;Cl[0][e]=t}for(let e=0;e<256;e++)for(let t=1;t<8;t++){let n=Cl[t-1][e];Cl[t][e]=n>>>8^Cl[0][255&n]}var[Ul,Il,Wl,Ll,Ml,Ol,Bl,Vl]=Cl;function Pl(e=0,t,n){if(!t)return 0;void 0===n&&(n=t.length);let r=0|~e,i=0;if((n=Nf.min(n,t.length))>=8){let e=new m(t.buffer,t.byteOffset,n),o=n-8;for(;i<=o;i+=8){let t=r^e.getInt32(i,!0),n=e.getInt32(i+4,!0);r=Vl[255&t]^Bl[t>>>8&255]^Ol[t>>>16&255]^Ml[t>>>24&255]^Ll[255&n]^Wl[n>>>8&255]^Il[n>>>16&255]^Ul[n>>>24&255]}}for(;i<n;i++)r=r>>>8^Ul[255&(r^t[i])];return(4294967295^r)>>>0}function Hl(e){16==e.an?(_f(e,e.p),e.p=0,e.an=0):e.an>=8&&(Qf(e,e.p),e.p>>=8,e.an-=8)}function Yl(e){e.an>8?_f(e,e.p):e.an>0&&Qf(e,e.p),e.cr=1+(e.an-1&7),e.p=0,e.an=0}function ql(e,t,n){e.an>16-n?(e.p=65535&(e.p|t<<e.an),_f(e,e.p),e.p=t>>16-e.an&65535,e.an+=n-16):(e.p=65535&(e.p|t<<e.an),e.an+=n)}function Jl(e){for(let t=0;t<e.En.length;t++)e.En[t].bn=0;for(let t=0;t<e.Fn.length;t++)e.Fn[t].bn=0;for(let t=0;t<e.Fr.length;t++)e.Fr[t].bn=0;e.En[bl].bn=1,e.Mn=e.On=0,e.gn=e.Bn=0}function jl(e,t,n){return n=e.rr[1],e.rr[1]=e.rr[e.pr--],Gl(e,t,1),n}function Zl(e,t,n,r){return e[t].bn<e[n].bn||e[t].bn==e[n].bn&&r[t]<=r[n]}function Gl(e,t,n){let r=e.rr[n],i=n<<1;for(;i<=e.pr&&(i<e.pr&&Zl(t,e.rr[i+1],e.rr[i],e.ir)&&i++,!Zl(t,r,e.rr[i],e.ir));)e.rr[n]=e.rr[i],n=i,i<<=1;e.rr[n]=r}function Kl(e,t){let n,r,i,o=t.sn,a=t.cn.ln,s=t.cn.dn,c=-1;for(e.pr=0,e.mr=yl,n=0;n<s;n++)0!=o[n].bn?(e.rr[++e.pr]=c=n,e.ir[n]=0):o[n].Er=0;for(;e.pr<2;)i=e.rr[++e.pr]=c<2?++c:0,o[i].bn=1,e.ir[i]=0,e.Mn--,a&&(e.On-=a[i].Er);for(t.fn=c,n=Nf.floor(e.pr/2);n>=1;n--)Gl(e,o,n);i=s;do{n=jl(e,o,n),r=e.rr[1],e.rr[--e.mr]=n,e.rr[--e.mr]=r,o[i].bn=o[n].bn+o[r].bn,e.ir[i]=(e.ir[n]>=e.ir[r]?e.ir[n]:e.ir[r])+1,o[n].gr=o[r].gr=i,e.rr[1]=i++,Gl(e,o,1)}while(e.pr>=2);e.rr[--e.mr]=e.rr[1],function(e,t){let n,r,i,o,a,s,c=t.sn,f=t.fn,l=t.cn.ln,u=t.cn.un,d=t.cn.q,w=t.cn.wn,p=0;for(o=0;o<=gl;o++)e.ar[o]=0;for(c[e.rr[e.mr]].Er=0,n=e.mr+1;n<yl;n++)r=e.rr[n],o=c[c[r].gr].Er+1,o>w&&(o=w,p++),c[r].Er=o,!(r>f)&&(e.ar[o]++,a=0,r>=d&&(a=u[r-d]),s=c[r].bn,e.Mn+=s*(o+a),l&&(e.On+=s*(l[r].Er+a)));if(0!=p){do{for(o=w-1;0==e.ar[o];)o--;e.ar[o]--,e.ar[o+1]+=2,e.ar[w]--,p-=2}while(p>0);for(o=w;0!=o;o--)for(r=e.ar[o];0!=r;)i=e.rr[--n],!(i>f)&&(c[i].Er!=o&&(e.Mn+=(o-c[i].Er)*c[i].bn,c[i].Er=o),r--)}}(e,t),function(e,t,n){let r,i,o=[],a=0;for(r=1;r<=gl;r++)a=a+n[r-1]<<1,o[r]=a;for(i=0;i<=t;i++){let t=e[i].Er;0!=t&&(e[i].yr=Xf(o[t]++,t))}}(o,t.fn,e.ar)}function Xl(e,t,n){let r,i,o=-1,a=t[0].Er,s=0,c=7,f=4;for(0==a&&(c=138,f=3),t[n+1].Er=65535,r=0;r<=n;r++)i=a,a=t[r+1].Er,!(++s<c&&i==a)&&(s<f?e.Fr[i].bn+=s:0!=i?(i!=o&&e.Fr[i].bn++,e.Fr[16].bn++):s<=10?e.Fr[17].bn++:e.Fr[18].bn++,s=0,o=i,0==a?(c=138,f=3):i==a?(c=6,f=3):(c=7,f=4))}function Ql(e,t,n){let r,i=-1,o=t[0].Er,a=0,s=7,c=4;0==o&&(s=138,c=3);for(let f=0;f<=n;f++)if(r=o,o=t[f+1].Er,!(++a<s&&r==o)){if(a<c)do{ql(e,e.Fr[r].yr,e.Fr[r].Er)}while(0!=--a);else 0!=r?(r!=i&&(ql(e,e.Fr[r].yr,e.Fr[r].Er),a--),ql(e,e.Fr[16].yr,e.Fr[16].Er),ql(e,a-3,2)):a<=10?(ql(e,e.Fr[17].yr,e.Fr[17].Er),ql(e,a-3,3)):(ql(e,e.Fr[18].yr,e.Fr[18].Er),ql(e,a-11,7));a=0,i=r,0==o?(s=138,c=3):r==o?(s=6,c=3):(s=7,c=4)}}function _l(e,t,n,r,i=0){ql(e,0+r,3),Yl(e),_f(e,n),_f(e,~n),n&&t&&Pf(e.pn,e.hn,t,i,n),e.hn+=n}function $l(e,t,n){let r,i,o,a,s=0;if(0!=e.gn)do{r=255&e.sr[s],r+=(255&e.sr[s+1])<<8,i=e.sr[s+2],s+=3,0==r?ql(e,t[i].yr,t[i].Er):(o=Tl[i],ql(e,t[o+wl+1].yr,t[o+wl+1].Er),a=Rl[o],0!=a&&(i-=Vf[o],ql(e,i,a)),r--,o=nl(r),ql(e,n[o].yr,n[o].Er),a=Sl[o],0!=a&&(r-=Bf[o],ql(e,r,a)))}while(s<e.gn);ql(e,t[bl].yr,t[bl].Er)}var eu=[{Dr:bu,vr:0,kr:0,Tr:0,Ar:0},{Dr:Eu,vr:4,kr:4,Tr:8,Ar:4},{Dr:Eu,vr:4,kr:5,Tr:16,Ar:8},{Dr:Eu,vr:4,kr:6,Tr:32,Ar:32},{Dr:Fu,vr:4,kr:4,Tr:16,Ar:16},{Dr:Fu,vr:8,kr:16,Tr:32,Ar:32},{Dr:Fu,vr:8,kr:16,Tr:128,Ar:128},{Dr:Fu,vr:8,kr:32,Tr:128,Ar:256},{Dr:Fu,vr:32,kr:128,Tr:258,Ar:1024},{Dr:Fu,vr:32,kr:258,Tr:258,Ar:4096}];function tu(e){return 2*e-(e>4?9:0)}function nu(e,t,n){return((t<<e.An^n)&e.Tn)>>>0}function ru(e,t){e.Kn=nu(e,e.Kn,e.u[t+(fl-1)]);let n=e.Nn[t&e.xn]=e.Cn[e.Kn];return e.Cn[e.Kn]=t,n}function iu(e){e.Cn[e.kn-1]=0,Hf(e.Cn,0,(e.kn-1)*e.Cn.BYTES_PER_ELEMENT)}function ou(e){let t,n,r=e.tn;for(t=e.kn;t>0;)t--,n=e.Cn[t],e.Cn[t]=n>=r?n-r:0;for(t=r;t>0;)t--,n=e.Nn[t],e.Nn[t]=n>=r?n-r:0}function au(e,t,n,r){let i=e.Jt;return i>r&&(i=r),0==i?0:(e.Jt-=i,Pf(t,n,e.Yt,e.qt,i),1==e.$t.zn?e.i=Nl(e.i,new vf(t.buffer,t.byteOffset+n,i),i):2==e.$t.zn&&(e.i=Pl(e.i,new vf(t.buffer,t.byteOffset+n,i),i)),e.qt+=i,e.jt+=i,i)}function su(e){let t,n,r=e.tn;do{if(n=e.dr-e.qn-e.Yn,0==n&&0==e.Yn&&0==e.qn?n=r:-1==n&&n--,e.Yn>=r+tl(e)&&(Pf(e.u,0,e.u,r,r-n),e.wr-=r,e.Yn-=r,e.Hn-=r,e.Vn>e.Yn&&(e.Vn=e.Yn),ou(e),n+=r),0==e.en.Jt)break;if(t=au(e.en,e.u,e.Yn+e.qn,n),e.qn+=t,e.qn+e.Vn>=fl){let t=e.Yn-e.Vn;for(e.Kn=e.u[t],e.Kn=nu(e,e.Kn,e.u[t+1]);e.Vn&&(e.Kn=nu(e,e.Kn,e.u[t+fl-1]),e.Nn[t&e.xn]=e.Cn[e.Kn],e.Cn[e.Kn]=t,t++,e.Vn--,!(e.qn+e.Vn<fl)););}}while(e.qn<ul&&0!=e.en.Jt);if(e.nn<e.dr){let t,n=e.Yn+e.qn;e.nn<n?(t=e.dr-n,t>dl&&(t=dl),Hf(e.u,n,t),e.nn=n+t):e.nn<n+dl&&(t=n+dl-e.nn,t>e.dr-e.nn&&(t=e.dr-e.nn),Hf(e.u,e.nn,t),e.nn+=t)}}function cu(e){if(null==e)return!0;let t=e.$t;return!t||t.en!=e||42!=t.Sn&&57!=t.Sn&&69!=t.Sn&&73!=t.Sn&&91!=t.Sn&&103!=t.Sn&&113!=t.Sn&&666!=t.Sn}function fu(e,t){Qf(e,t>>8),Qf(e,255&t)}function lu(e){let t,n=e.$t;(function(e){Hl(e)})(n),t=n.hn,t>e.Kt&&(t=e.Kt),0!=t&&(Pf(e.Zt,e.Gt,n.pn,n.Ln,t),e.Gt+=t,n.Ln+=t,e.Xt+=t,e.Kt-=t,n.hn-=t,0==n.hn&&(n.Ln=n.In))}function uu(e,t){let n=e.$t;n.Dn&&n.Dn.Nr&&(e.i=Pl(e.i,new vf(n.pn.buffer,n.In+t,n.hn-t),n.hn-t))}function du(e,t){let n,r=e.$t;if(cu(e)||t>5||t<0)return Kf(e,-2);if(!e.Zt||0!=e.Jt&&!e.Yt||666==r.Sn&&4!=t)return Kf(e,-2);if(0==e.Kt)return Kf(e,-5);if(n=r.Pn,r.Pn=t,0!=r.hn){if(lu(e),0==e.Kt)return r.Pn=El,0}else if(0==e.Jt&&tu(t)<=tu(n)&&4!=t)return Kf(e,-5);if(666==r.Sn&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Ir.length){let t,n=r.hn;do{if(r.hn==r.Wn){if(uu(e,n),lu(e),0!=r.hn)return r.Pn=El,0;n=0}t=r.Dn.Ir[r.lr++],Qf(r,t)}while(0!=t);uu(e,n),r.lr=0}r.Sn=91}if(91==r.Sn){if(r.Dn&&r.Dn.Wr&&r.Dn.Wr.length){let t,n=r.hn;do{if(r.hn==r.Wn){if(uu(e,n),lu(e),0!=r.hn)return r.Pn=El,0;n=0}t=r.Dn.Wr[r.lr++],Qf(r,t)}while(0!=t);uu(e,n)}r.Sn=103}if(103==r.Sn){if(r.Dn&&r.Dn.Nr){if(r.hn+2>r.Wn&&(lu(e),0!=r.hn))return r.Pn=El,0;Qf(r,255&e.i),Qf(r,e.i>>>8&255),e.i=Pl(0)}if(r.Sn=113,lu(e),0!=r.hn)return r.Pn=El,0}if(0!=e.Jt||0!=r.qn||0!=t&&666!=r.Sn){let n=0==r.Xn?bu(r,t):2==r.Qn?function(e,t){let n=!1;for(;;){if(0==e.qn&&(su(e),0==e.qn)){if(0==t)return 0;break}if(e.Jn=0,n=el(e,e.u[e.Yn]),e.qn--,e.Yn++,n){let t=mu(e,!1);if(null!=t)return t}}if(e.Vn=0,4==t){let t=mu(e,!0);return null!=t?t:3}if(e.gn){let t=mu(e,!1);if(null!=t)return t}return 1}(r,t):3==r.Qn?function(e,t){let n,r,i,o;for(;;){if(e.qn<=ll){if(su(e),e.qn<=ll&&0==t)return 0;if(0==e.qn)break}if(e.Jn=0,e.qn>=fl&&e.Yn>0&&(i=e.Yn-1,r=e.u[i],r==++i&&r==++i&&r==++i)){o=e.Yn+ll;do{}while(r==++i&&r==++i&&r==++i&&r==++i&&r==++i&&r==++i&&r==++i&&r==++i&&i<o);e.Jn=ll-(o-i),e.Jn>e.qn&&(e.Jn=e.qn)}if(e.Jn>=fl?(e.Yn,e.Yn,e.Jn,n=$f(e,1,e.Jn-fl),e.qn-=e.Jn,e.Yn+=e.Jn,e.Jn=0):(n=el(e,e.u[e.Yn]),e.qn--,e.Yn++),n){let t=mu(e,!1);if(null!=t)return t}}if(e.Vn=0,4==t){let t=mu(e,!0);return null!=t?t:3}if(e.gn){let t=mu(e,!1);if(null!=t)return t}return 1}(r,t):eu[r.Xn].Dr(r,t);if((2==n||3==n)&&(r.Sn=666),0==n||2==n)return 0==e.Kt&&(r.Pn=El),0;if(1==n&&(1==t?function(e){ql(e,2,3),ql(e,vl[bl].yr,vl[bl].Er),Hl(e)}(r):5!=t&&(_l(r,null,0,0),3==t&&(iu(r),0==r.qn&&(r.Yn=0,r.Hn=0,r.Vn=0))),lu(e),0==e.Kt))return r.Pn=El,0}return 4!=t?0:r.zn<=0?1:(2==r.zn?(Qf(r,255&e.i),Qf(r,e.i>>>8&255),Qf(r,e.i>>>16&255),Qf(r,e.i>>>24&255),Qf(r,255&e.jt),Qf(r,e.jt>>>8&255),Qf(r,e.jt>>>16&255),Qf(r,e.jt>>>24&255)):(fu(r,e.i>>>16&65535),fu(r,65535&e.i)),lu(e),r.zn>0&&(r.zn=-r.zn),0!=r.hn?0:1)}function wu(e){if(cu(e))return-2;let t=e.$t,n=t.Sn;return t.u=Wf,t.Nn=Lf,t.Cn=Lf,t.pn=Wf,t.sr=Wf,t.rr=new Tf(0),t.ir=Wf,t.ar=Lf,t.En.length=0,t.Fn.length=0,t.Fr.length=0,t.Dn=void 0,t.In=0,t.Ln=0,t.yn=0,113==n?-3:0}function pu(e,t){let n,r,i=e.er,o=e.Yn,a=e.jn,s=e.$n,c=e.Yn>tl(e)?e.Yn-tl(e):0,f=e.Nn,l=e.xn,u=e.u,d=e.qn,w=ll<d?ll:d,p=u[o],h=u[o+1],m=u[o+a-1],y=u[o+a];a>=e._n&&(i>>=2),s>d&&(s=d);do{if(n=t,u[n+a]!=y||u[n+a-1]!=m||u[n]!=p||u[n+1]!=h)continue;let i=2;for(;i<w&&u[o+i]==u[n+i];)i++;if(r=i,r>a){if(e.wr=t,a=r,r>=s)break;m=u[o+a-1],y=u[o+a]}}while((t=f[t&l])>c&&0!=--i);return a<=d?a:d}function hu(e,t){(function(e,t,n,r,i=0){let o,a,s=0;e.Xn>0?(2==e.en.t&&(e.en.t=function(e){let t,n=4093624447;for(t=0;t<=31;t++,n>>=1)if(1&n&&0!=e.En[t].bn)return 0;if(0!=e.En[9].bn||0!=e.En[10].bn||0!=e.En[13].bn)return 1;for(t=32;t<wl;t++)if(0!=e.En[t].bn)return 1;return 0}(e)),Kl(e,e.Rr),Kl(e,e.Sr),s=function(e){let t;for(Xl(e,e.En,e.Rr.fn),Xl(e,e.Fn,e.Sr.fn),Kl(e,e.zr),t=ml-1;t>=3&&0==e.Fr[If[t]].Er;t--);return e.Mn+=3*(t+1)+5+5+4,t}(e),o=e.Mn+3+7>>3,a=e.On+3+7>>3,(a<=o||4==e.Qn)&&(o=a)):o=a=n+5,n+4<=o&&t?_l(e,t,n,r,i):a==o?(ql(e,2+r,3),$l(e,vl,kl)):(ql(e,4+r,3),function(e,t,n,r){let i;for(ql(e,t-257,5),ql(e,n-1,5),ql(e,r-4,4),i=0;i<r;i++)ql(e,e.Fr[If[i]].Er,3);Ql(e,e.En,t-1),Ql(e,e.Fn,n-1)}(e,e.Rr.fn+1,e.Sr.fn+1,s+1),$l(e,e.En,e.Fn)),Jl(e),r&&Yl(e)})(e,e.u,e.Yn-e.Hn,t,e.Hn),e.Hn=e.Yn,lu(e.en)}function mu(e,t){return hu(e,t?1:0),0==e.en.Kt?t?2:0:null}var yu=65535;function gu(e,t){return e<t?e:t}function bu(e,t){let n,r,i,o=gu(e.Wn-5,e.tn),a=0,s=e.en.Jt;do{if(n=yu,i=e.an+42>>3,e.en.Kt<i||(i=e.en.Kt-i,r=e.Yn-e.Hn,n>r+e.en.Jt&&(n=r+e.en.Jt),n>i&&(n=i),n<o&&(0==n&&4!=t||0==t||n!=r+e.en.Jt)))break;a=4==t&&n==r+e.en.Jt?1:0,_l(e,null,0,a),e.pn[e.hn-4]=n,e.pn[e.hn-3]=n>>8,e.pn[e.hn-2]=~n,e.pn[e.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fl&&(n=ru(e,e.Yn)),0!=n&&e.Yn-n<=tl(e)&&(e.Jn=pu(e,n)),e.Jn>=fl)if(e.Yn,e.wr,e.Jn,r=$f(e,e.Yn-e.wr,e.Jn-fl),e.qn-=e.Jn,e.Jn<=e.nr&&e.qn>=fl){e.Jn--;do{e.Yn++,n=ru(e,e.Yn)}while(0!=--e.Jn);e.Yn++}else e.Yn+=e.Jn,e.Jn=0,e.Kn=e.u[e.Yn],e.Kn=nu(e,e.Kn,e.u[e.Yn+1]);else r=el(e,e.u[e.Yn]),e.qn--,e.Yn++;if(r){let t=mu(e,!1);if(null!=t)return t}}if(e.Vn=e.Yn<fl-1?e.Yn:fl-1,4==t){let t=mu(e,!0);return null!=t?t:3}if(e.gn){let t=mu(e,!1);if(null!=t)return t}return 1}function Fu(e,t){let n,r=!1;for(;;){if(e.qn<ul){if(su(e),e.qn<ul&&0==t)return 0;if(0==e.qn)break}if(n=0,e.qn>=fl&&(n=ru(e,e.Yn)),e.jn=e.Jn,e.Zn=e.wr,e.Jn=fl-1,0!=n&&e.jn<e.nr&&e.Yn-n<=tl(e)&&(e.Jn=pu(e,n),e.Jn<=5&&(1==e.Qn||e.Jn==fl&&e.Yn-e.wr>4096)&&(e.Jn=fl-1)),e.jn>=fl&&e.Jn<=e.jn){let t=e.Yn+e.qn-fl;e.Yn,e.Zn,e.jn,r=$f(e,e.Yn-1-e.Zn,e.jn-fl),e.qn-=e.jn-1,e.jn-=2;do{++e.Yn<=t&&(n=ru(e,e.Yn))}while(0!=--e.jn);if(e.Gn=0,e.Jn=fl-1,e.Yn++,r){let t=mu(e,!1);if(null!=t)return t}}else if(e.Gn){if(r=el(e,e.u[e.Yn-1]),r&&hu(e,0),e.Yn++,e.qn--,0==e.en.Kt)return 0}else e.Gn=1,e.Yn++,e.qn--}if(e.Gn&&(r=el(e,e.u[e.Yn-1]),e.Gn=0),e.Vn=e.Yn<fl-1?e.Yn:fl-1,4==t){let t=mu(e,!0);return null!=t?t:3}if(e.gn){let t=mu(e,!1);if(null!=t)return t}return 1}var Ru=852,Su=Bf.map(e=>e+1),zu=Vf.subarray(0,-1).map(e=>e+3),Du=Of.map(Mu),xu=Of.map(Ou);Du.push(64,2),xu.push(142,2);var vu=Mf.slice(0,-2).map(Mu),ku=Mf.slice(0,-2).map(Ou);vu.push(16,1,73,1,200,1),ku.push(144,1,72,1,78,1);var Tu=new kf([...zu,258,0,0]),Au=new kf([...zu,3,0,0]),Nu=Jf(vu),Cu=Jf(ku),Uu=new kf([...Su,0,0]),Iu=new kf([...Su,32769,49153]),Wu=Jf(Du),Lu=Jf(xu);function Mu(e,t){return t%2?e:e+16}function Ou(e,t){return t%2?e:e+128}function Bu(e,t){let n,r=e.$t,i=e.qt,o=e.Gt,a=e.Yt,s=e.Zt,c=r.u,f=r.p>>>0,l=r.an>>>0,u=r.Br,d=r.tt,w=(1<<r.Vr)-1,p=(1<<r.rt)-1,h=r.tn>>>0,m=r.nn>>>0,y=r.rn>>>0,g=r.Pr,b=o-(t-e.Kt),E=o+(e.Kt-257),F=i+(e.Jt-5),R=0,S=0,z=0,D=0;e:do{for(;l<15;){if(!(i<a.length))break e;f+=a[i++]<<l,l+=8}for(n=u[f&w];;){if(z=n>>>16&255,f>>>=z,l-=z,z=n>>>24,0==z){s[o++]=65535&n;break}if(16&z){if(R=65535&n,z&=15,z){for(;l<z;){if(!(i<a.length)){r.Hr=16200;break e}f+=a[i++]<<l,l+=8}R+=f&(1<<z)-1,f>>>=z,l-=z}for(;l<15;){if(!(i<a.length)){r.Hr=16200;break e}f+=a[i++]<<l,l+=8}for(n=d[f&p];;){if(z=n>>>16&255,f>>>=z,l-=z,z=n>>>24,16&z){if(S=65535&n,z&=15,z){for(;l<z;){if(!(i<a.length)){r.Hr=16200;break e}f+=a[i++]<<l,l+=8}S+=f&(1<<z)-1,f>>>=z,l-=z}let t=R,u=o-b;if(S>u){let n=S-u;if(n>m&&g){e.Qt="invalid distance too far back",r.Hr=16209;break e}if(0==y){if(D=h-n,!(n<t)){for(let e=0;e<t;++e)s[o++]=c[D++];continue e}for(let e=0;e<n;++e)s[o++]=c[D++];t-=n,D=o-S}else if(y<n){D=h+y-n;let e=n-y;if(!(e<t)){for(let e=0;e<t;++e)s[o++]=c[D++];continue e}for(let t=0;t<e;++t)s[o++]=c[D++];if(t-=e,D=0,!(y<t)){for(let e=0;e<t;++e)s[o++]=c[D++];continue e}for(let e=0;e<y;++e)s[o++]=c[D++];t-=y,D=o-S}else{if(D=y-n,!(n<t)){for(let e=0;e<t;++e)s[o++]=c[D++];continue e}for(let e=0;e<n;++e)s[o++]=c[D++];t-=n,D=o-S}for(;t>2;)s[o++]=s[D++],s[o++]=s[D++],s[o++]=s[D++],t-=3;t&&(s[o++]=s[D++],t>1&&(s[o++]=s[D++]))}else{for(D=o-S;t>2;)s[o++]=s[D++],s[o++]=s[D++],s[o++]=s[D++],t-=3;t&&(s[o++]=s[D++],t>1&&(s[o++]=s[D++]))}break}if(64&z){e.Qt="invalid distance code",r.Hr=16209;break e}n=d[(65535&n)+(f&(1<<z)-1)]}break}if(64&z){if(32&z){r.Hr=16191;break e}e.Qt="invalid literal/length code",r.Hr=16209;break e}n=u[(65535&n)+(f&(1<<z)-1)]}}while(i<F&&o<E);let x=l>>3;i-=x,l-=x<<3,f&=(1<<l)-1,e.qt=i,e.Gt=o,e.Jt=i<F?F-i+5:5-(i-F),e.Kt=o<E?E-o+257:257-(o-E),r.p=f>>>0,r.an=l>>>0}var Vu=new Tf(0);function Pu(e,t){let n=Vu,r=t?1446:1444;return{...qf(e,0),en:e,Hr:16180,Yr:!1,zn:0,qr:!1,Jr:0,jr:0,Zr:0,Gr:0,u:Wf,Kr:0,dt:0,Ur:0,Br:n,tt:n,Vr:0,rt:0,Xr:0,Qr:0,_r:0,$r:0,ei:n,ti:new kf(320),ni:new kf(288),ri:new Tf(r),ii:0,Pr:!0,oi:0,ai:0,si:t}}function Hu(e,t,n){return e<<24|t<<16|n}function Yu(e=0,t=0,n=0){return Hu(e,t,n)}function qu(e=1){return Hu(64,e,0)}function Ju(e){return((255&e)<<24|(e>>8&255)<<16|(e>>16&255)<<8|e>>24&255)>>>0}var ju={si:!1,ci:Tu,fi:Nu,ui:Uu,di:Wu,wi:20,pi:257,hi:0,yi:592,gi:!1,bi:!0},Zu={si:!0,ci:Au,fi:Cu,ui:Iu,di:Lu,wi:19,pi:256,hi:-1,yi:594,gi:!0,bi:!1};function Gu(e,t,n,r,i,o,a,s){let c,f,l,u,d,w,p,h,m,y,g,b,E,F,R,S,z,D,x,v=new kf(16),k=new kf(16),T=s?Zu:ju;for(c=0;c<=15;c++)v[c]=0;for(f=0;f<n;f++)v[t[f]]++;for(d=i.Ei,u=15;u>=1&&0==v[u];u--);if(d>u&&(d=u),0==u)return T.bi?(R=qu(1),r.Ei[0]=R,r.Ei[1]=R,i.Ei=1,0):-1;for(l=1;l<u&&0==v[l];l++);for(d<l&&(d=l),h=1,c=1;c<=15;c++)if(h<<=1,h-=v[c],h<0)return-1;if(h>0&&(0==e||1!=u))return-1;for(k[1]=0,c=1;c<15;c++)k[c+1]=k[c]+v[c];for(f=0;f<n;f++)0!=t[f]&&(o[k[t[f]]++]=f);switch(e){case 0:z=D=o,x=T.wi;break;case 1:z=T.ci,D=T.fi,x=T.pi;break;default:z=T.ui,D=T.di,x=T.hi}if(y=0,f=0,c=l,S=a.Ei,w=d,p=0,E=-1,m=1<<d,F=m-1,1==e&&(T.gi?m>=Ru:m>Ru)||2==e&&(T.gi?m>=T.yi:m>T.yi))return 1;for(;;){R=Ku(o,f,c,p,e,z,D,x,T.si),g=1<<c-p,b=1<<w,l=b;do{b-=g;let e=(y>>p)+b;r.Ei[S+e]=R}while(0!=b);for(g=1<<c-1;y&g;)g>>=1;if(0!=g?(y&=g-1,y+=g):y=0,f++,0==--v[c]){if(c==u)break;c=t[o[f]]}if(c>d&&(y&F)!=E){for(0==p&&(p=d),S+=1<<w,w=c-p,h=1<<w;w+p<u&&(h-=v[w+p],!(h<=0));)w++,h<<=1;if(m+=1<<w,1==e&&(T.gi?m>=Ru:m>Ru)||2==e&&(T.gi?m>=T.yi:m>T.yi))return 1;E=y&F,r.Ei[a.Ei+E]=Hu(w,d,S-a.Ei)}}if(0!=y)for(R=qu(c-p);0!=y;){for(0!=p&&(y&F)!=E&&(p=0,c=d,S=a.Ei,w=d,R=qu(c)),r.Ei[S+(y>>p)]=R,g=1<<c-1;y&g;)g>>=1;0!=g?(y&=g-1,y+=g):y=0}return a.Ei+=m,i.Ei=d,0}function Ku(e,t,n,r,i,o,a,s,c){let f;if(c?e[t]<s:e[t]+1<s)f=Yu(0,n-r,e[t]);else if(c?e[t]>s:e[t]>=s)if(c&&1==i){let i=e[t]-257;f=Yu(a[i],n-r,o[i])}else{let i=c?e[t]:e[t]-s;f=Yu(a[i],n-r,o[i])}else f=function(e=0){return Hu(96,e,0)}(n-r);return f}var Xu=new Tf(0),Qu={Fi:!0,Ri:new Tf(544),Si:Xu,zi:Xu},_u={Fi:!0,Ri:new Tf(544),Si:Xu,zi:Xu};function $u(e){let t;return!(e&&(t=e.$t,!(!t||t.en!=e||t.si&&(t.Hr<16191||t.Hr>16209)||!t.si&&(t.Hr<16180||t.Hr>16211))))}function ed(e){let t=e.si?_u:Qu,n={Ei:0};if(t.Fi){let r,i,o;for(r=0;r<144;)e.ti[r++]=8;for(;r<256;)e.ti[r++]=9;for(;r<280;)e.ti[r++]=7;for(;r<288;)e.ti[r++]=8;t.Ri.fill(0),o=t.Ri,t.Si=o,i=9;let a={Ei:o},s={Ei:i},c={Ei:0};for(Gu(1,e.ti,288,a,s,e.ni,c,e.si),o=a.Ei,i=s.Ei,e.ii=c.Ei,r=0;r<32;)e.ti[r++]=5;i=5;let f=c.Ei,l={Ei:o},u={Ei:i};n.Ei=f,Gu(2,e.ti,32,l,u,e.ni,n,e.si),t.zi=o.slice(f),t.Fi=!1}e.Br=t.Si,e.Vr=9,e.tt=t.zi,e.rt=5,e.ii=n.Ei}var td=class extends Cf{constructor(){super("Need more input")}};function nd(e,t){let n,r,i,o,a,s,c,f,l,u,d,w,p,h,m,y,g,b=new vf(4);if($u(e)||!e.Zt||!e.Yt&&0!=e.Jt)return-2;s=0,f=0,c=0,l=0,r=Wf,i=0,o=Wf,a=0,n=e.$t,16191==n.Hr&&(n.Hr=16192),z(),u=s,d=c,g=0;try{for(;;)switch(n.Hr){case 16180:if(0==n.zn){n.Hr=16192;break}if(k(16),2&n.zn&&35615==f){0==n.k&&(n.k=15),n.Zr=Pl(0),n.Zr=R(n.Zr,f),x(),n.Hr=16181;break}if(n.Dn&&(n.Dn.Di=-1),!(1&n.zn)||((T(8)<<8)+(f>>8))%31){e.Qt="incorrect header check",n.Hr=16209;break}if(8!=T(4)){e.Qt="unknown compression method",n.Hr=16209;break}if(A(4),y=T(4)+8,0==n.k&&(n.k=y),y>15||y>n.k){e.Qt="invalid window size",n.Hr=16209;break}n.jr=1<<y,n.Jr=0,e.i=n.Zr=Nl(0),n.Hr=512&f?16189:16191,x();break;case 16181:if(k(16),n.Jr=f,8!=(255&n.Jr)){e.Qt="unknown compression method",n.Hr=16209;break}if(57344&n.Jr){e.Qt="unknown header flags set",n.Hr=16209;break}n.Dn&&(n.Dn.Cr=f>>8&1),512&n.Jr&&4&n.zn&&(n.Zr=R(n.Zr,f)),x(),n.Hr=16182;case 16182:k(32),n.Dn&&(n.Dn.Lr=f),512&n.Jr&&4&n.zn&&(n.Zr=S(n.Zr,f)),x(),n.Hr=16183;case 16183:k(16),n.Dn&&(n.Dn.xi=255&f,n.Dn.Mr=f>>8),512&n.Jr&&4&n.zn&&(n.Zr=R(n.Zr,f)),x(),n.Hr=16184;case 16184:1024&n.Jr?(k(16),n.Kr=f,n.Dn&&(n.Dn.Or=f),512&n.Jr&&4&n.zn&&(n.Zr=R(n.Zr,f)),x()):n.Dn&&(n.Dn.Ur=Wf),n.Hr=16185;case 16185:if(1024&n.Jr&&(w=n.Kr,w>s&&(w=s),w&&(n.Dn&&n.Dn.Ur&&n.Dn.ki&&(y=n.Dn.Or-n.Kr)<n.Dn.ki&&Pf(n.Dn.Ur,y,r,i,w),512&n.Jr&&4&n.zn&&(n.Zr=Pl(n.Zr,r.subarray(i,i+w),w)),s-=w,i+=w,n.Kr-=w),n.Kr))return E();n.Kr=0,n.Hr=16186;case 16186:if(2048&n.Jr){if(0==s)return E();w=0;do{y=r[i+w++],n.Dn&&n.Dn.Ti&&n.Kr<n.Dn.Ti&&(n.Dn.Ir[n.Kr++]=y)}while(y&&w<s);if(512&n.Jr&&4&n.zn&&(n.Zr=Pl(n.Zr,r.subarray(i,i+w),w)),s-=w,i+=w,y)return E()}else n.Dn&&(n.Dn.Ir=Wf);n.Kr=0,n.Hr=16187;case 16187:if(4096&n.Jr){if(0==s)return E();w=0;do{y=r[i+w++],n.Dn&&n.Dn.Ai&&n.Kr<n.Dn.Ai&&(n.Dn.Wr[n.Kr++]=y)}while(y&&w<s);if(512&n.Jr&&4&n.zn&&(n.Zr=Pl(n.Zr,r.subarray(i,i+w),w)),s-=w,i+=w,y)return E()}else n.Dn&&(n.Dn.Wr=Wf);n.Hr=16188;case 16188:if(512&n.Jr){if(k(16),4&n.zn&&f!=(65535&n.Zr)){e.Qt="header crc mismatch",n.Hr=16209;break}x()}n.Dn&&(n.Dn.Nr=n.Jr>>9&1,n.Dn.Di=1),e.i=n.Zr=Pl(0),n.Hr=16191;break;case 16189:k(32),e.i=n.Zr=Ju(f),x(),n.Hr=16190;case 16190:if(!n.qr)return D(),2;e.i=n.Zr=Nl(0),n.Hr=16191;case 16191:if(5==t||6==t)return E();case 16192:if(n.Yr){N(),n.Hr=16206;break}switch(k(3),n.Yr=!!T(1),A(1),T(2)){case 0:n.Hr=16193;break;case 1:if(ed(n),n.Hr=16199,6==t)return A(2),E();break;case 2:n.Hr=16196;break;case 3:e.Qt="invalid block type",n.Hr=16209}A(2);break;case 16193:if(N(),k(32),(65535&f)!=(f>>>16^65535)){e.Qt="invalid stored block lengths",n.Hr=16209;break}if(n.Kr=65535&f,x(),n.Hr=16194,6==t)return E();case 16194:n.Hr=16195;case 16195:if(w=n.Kr,w){if(w>s&&(w=s),w>c&&(w=c),0==w)return E();Pf(o,a,r,i,w),s-=w,i+=w,c-=w,a+=w,n.Kr-=w;break}n.Hr=16191;break;case 16196:if(k(14),n.Qr=T(5)+257,A(5),n._r=T(5)+1,A(5),n.Xr=T(4)+4,A(4),n.Qr>286||!n.si&&n._r>30){e.Qt=n.si?"too many length":"too many length or distance symbols",n.Hr=16209;break}n.$r=0,n.Hr=16197;case 16197:for(;n.$r<n.Xr;)k(3),n.ti[If[n.$r++]]=T(3),A(3);for(;n.$r<19;)n.ti[If[n.$r++]]=0;n.ei=n.ri,n.Br=n.tt=n.ei,n.Vr=7;let u={Ei:n.ei},b={Ei:n.Vr},C={Ei:0};if(g=Gu(0,n.ti,19,u,b,n.ni,C,n.si),n.ei=u.Ei,n.Vr=b.Ei,g){e.Qt="invalid code lengths set",n.Hr=16209;break}n.$r=0,n.Hr=16198;case 16198:for(;n.$r<n.Qr+n._r;){for(;h=n.Br[T(n.Vr)],!((h>>>16&255)<=l);)v();if((65535&h)<16)A(h>>>16&255),n.ti[n.$r++]=65535&h;else{if(16==(65535&h)){if(k(2+(h>>>16&255)),A(h>>>16&255),0==n.$r){e.Qt="invalid bit length repeat",n.Hr=16209;break}y=n.ti[n.$r-1],w=3+T(2),A(2)}else 17==(65535&h)?(k(3+(h>>>16&255)),A(h>>>16&255),y=0,w=3+T(3),A(3)):(k(7+(h>>>16&255)),A(h>>>16&255),y=0,w=11+T(7),A(7));if(n.$r+w>n.Qr+n._r){e.Qt="invalid bit length repeat",n.Hr=16209;break}for(;w--;)n.ti[n.$r++]=y}}if(16209==n.Hr)break;if(0==n.ti[256]){e.Qt="invalid code -- missing end-of-block",n.Hr=16209;break}n.ei=n.ri,n.Vr=9;let U={Ei:n.ei},I={Ei:n.Vr},W={Ei:0};g=Gu(1,n.ti,n.Qr,U,I,n.ni,W,n.si),n.ei=U.Ei,n.Vr=I.Ei;let L=W.Ei;if(n.Br=n.ei.slice(0,L),g){e.Qt="invalid literal/lengths set",n.Hr=16209;break}n.rt=6;let M=n.ti.subarray(n.Qr,n.Qr+n._r),O={Ei:n.ei},B={Ei:n.rt},V={Ei:L};if(g=Gu(2,M,n._r,O,B,n.ni,V,n.si),n.ei=O.Ei,n.rt=B.Ei,n.tt=n.ei.slice(L),g){e.Qt="invalid distances set",n.Hr=16209;break}if(n.Hr=16199,6==t)return E();case 16199:n.Hr=16200;case 16200:if(!n.si&&s>=6&&c>=258){D(),Bu(e,d),z(),16191==n.Hr&&(n.oi=-1);break}for(n.oi=0;h=n.Br[T(n.Vr)],!((h>>>16&255)<=l);)v();if(h>>>24&&!(h>>>24&240)){for(m=h;h=n.Br[(65535&m)+(T((m>>>16&255)+(m>>>24))>>(m>>>16&255))],!((m>>>16&255)+(h>>>16&255)<=l);)v();A(m>>>16&255),n.oi+=m>>>16&255}if(A(h>>>16&255),n.oi+=h>>>16&255,n.Kr=65535&h,!(h>>>24)){n.Hr=16205;break}if(h>>>24&32){n.oi=-1,n.Hr=16191;break}if(h>>>24&64){e.Qt="invalid literal/length code",n.Hr=16209;break}n.Ur=h>>>24&(n.si?31:15),n.Hr=16201;case 16201:n.Ur&&(k(n.Ur),n.Kr+=T(n.Ur),A(n.Ur),n.oi+=n.Ur),n.ai=n.Kr,n.Hr=16202;case 16202:for(;h=n.tt[T(n.rt)],!((h>>>16&255)<=l);)v();if(!(h>>>24&240)){for(m=h;h=n.tt[(65535&m)+(T((m>>>16&255)+(m>>>24))>>(m>>>16&255))],!((m>>>16&255)+(h>>>16&255)<=l);)v();A(m>>>16&255),n.oi+=m>>>16&255}if(A(h>>>16&255),n.oi+=h>>>16&255,h>>>24&64){e.Qt="invalid distance code",n.Hr=16209;break}n.dt=65535&h,n.Ur=h>>>24&15,n.Hr=16203;case 16203:n.Ur&&(k(n.Ur),n.dt+=T(n.Ur),A(n.Ur),n.oi+=n.Ur),n.Hr=16204;case 16204:if(0==c)return E();if(w=d-c,n.dt>w){if(w=n.dt-w,w>n.nn&&n.Pr){e.Qt="invalid distance too far back",n.Hr=16209;break}w>n.rn?(w-=n.rn,p=n.tn-w):p=n.rn-w,w>n.Kr&&(w=n.Kr),w>c&&(w=c);for(let e=0;e<w;++e)o[a]=255&n.u[p],++a,++p}else{p=a-n.dt,w=n.Kr,w>c&&(w=c);for(let e=0;e<w;++e)o[a]=o[p],++a,++p}w>c&&(w=c),c-=w,n.Kr-=w,0==n.Kr&&(n.Hr=16200);break;case 16205:if(0==c)return E();o[a++]=n.Kr,c--,n.Hr=16200;break;case 16206:if(n.zn){if(k(32),d-=c,e.Xt+=d,n.Gr+=d,4&n.zn&&d){let t=o.subarray(a-d,a);e.i=n.Zr=F(n.Zr,t,d)}if(d=c,4&n.zn&&(n.Jr?f:Ju(f)>>>0)!=n.Zr){e.Qt="incorrect data check",n.Hr=16209;break}x()}n.Hr=16207;case 16207:if(n.zn&&n.Jr){if(k(32),4&n.zn&&f!=(4294967295&n.Gr)){e.Qt="incorrect length check",n.Hr=16209;break}x()}n.Hr=16208;case 16208:return g=1,E();case 16209:return g=-3,E();case 16210:return-4;default:return-2}}catch(e){if(e instanceof td)return E();throw e}function E(){if(D(),n.tn||d!=e.Kt&&n.Hr<16209&&((n.si?n.Hr<16208:n.Hr<16206)||4!=t)){let t=d-e.Kt;if(function(e,t,n){let r=e.$t;if(!(r.u&&0!=r.u.length||(r.u=new vf(1<<r.k),r.u)))return 1;if(0==r.tn&&(r.tn=1<<r.k,r.rn=0,r.nn=0),n>=r.tn)Pf(r.u,0,t,t.length-r.tn,r.tn),r.rn=0,r.nn=r.tn;else{let e=r.tn-r.rn;e>n&&(e=n),Pf(r.u,r.rn,t,t.length-n,e),(n-=e)?(Pf(r.u,0,t,t.length-n,n),r.rn=n,r.nn=r.tn):(r.rn+=e,r.rn==r.tn&&(r.rn=0),r.nn<r.tn&&(r.nn+=e))}return 0}(e,e.Zt.subarray(e.Gt-t,e.Gt),t))return n.Hr=16210,-4}return u-=e.Jt,d-=e.Kt,e.jt+=u,e.Xt+=d,n.Gr+=d,4&n.zn&&d&&(e.i=n.Zr=F(n.Zr,e.Zt.subarray(e.Gt-d,e.Gt),d)),e.t=n.an+(n.Yr?64:0)+(16191==n.Hr?128:0)+(16199==n.Hr||16194==n.Hr?256:0),(0==u&&0==d&&0==g||4==t&&0==g)&&(g=-5),g}function F(e,t,r){return n.Jr?Pl(e,t,r):Nl(e,t,r)}function R(e,t){return b[0]=255&t,b[1]=t>>>8&255,Pl(e,b,2)>>>0}function S(e,t){return b[0]=255&t,b[1]=t>>>8&255,b[2]=t>>>16&255,b[3]=t>>>24&255,Pl(e,b,4)>>>0}function z(){o=e.Zt,a=e.Gt,c=e.Kt,r=e.Yt,i=e.qt,s=e.Jt,f=n.p,l=n.an}function D(){e.Zt=o,e.Gt=a,e.Kt=c,e.Yt=r,e.qt=i,e.Jt=s,n.p=f,n.an=l}function x(){f=0,l=0}function v(){if(0==s)throw new td;s--,f+=(255&r[i])<<l,i++,f>>>=0,l+=8}function k(e){for(;l<e;)v()}function T(e){return f&(1<<e)-1}function A(e){f>>>=e,l-=e}function N(){f>>>=7&l,l-=7&l}}function rd(e){return $u(e)?-2:0}var id=65536,od="trailing data after the end of the stream",ad=class{constructor(e=16,t=id){this.Ni=[],this.Ci=e;for(let n=0;n<Nf.min(e,4);n++)this.Ni.push(new vf(t))}Ui(e=id){for(let t=this.Ni.length-1;t>=0;t--){let n=this.Ni[t];if(n.length>=e)return this.Ni.splice(t,1),n}return new vf(e)}release(e){this.Ni.length<this.Ci&&this.Ni.push(e)}};function sd(e){let t=new ad(32,id),n=null;function r(){let t=e.Ii(),n=e.Wi(t);if(0!=n&&0!=n)throw new Cf("init failed: "+n);return{en:t}}function i(e){try{t.release(e)}catch{}}return new Af({start(){},transform(o,a){n||(n=r());let s=n.en;if(n.Li){if(o.length)throw new Cf(od);return}let c=0;for(;c<o.length;){let r=Nf.min(o.length-c,32768),f=o.subarray(c,c+r);for(s.Yt=f,s.qt=0,s.Jt=f.length;s.Jt>0;){let r=t.Ui(),o=!1;try{s.Zt=r,s.Gt=0,s.Kt=r.length;let i=e.Mi(s,0),c=r.length-s.Kt;if(c>0){let e=!1,n={Oi:r.subarray(0,c),release:()=>{e||(e=!0,t.release(r))}};o=!0,a.enqueue(n)}if(1==i){n.Li=!0;break}if(0!=i)throw new Cf("process error: "+i)}finally{o||i(r)}}if(n.Li){if(s.Jt>0||c+r<o.length)throw new Cf(od);break}c+=r}},flush(o){if(n&&n.Li)return;n||(n=r());let a=n.en;for(;;){let n=t.Ui(),r=!1;try{a.Zt=n,a.Gt=0,a.Kt=n.length;let i=e.Mi(a,4),s=n.length-a.Kt;if(s>0){let e=!1,i={Oi:n.subarray(0,s),release:()=>{e||(e=!0,t.release(n))}};r=!0,o.enqueue(i)}if(1==i)break;if(0!=i)throw new Cf("finalization error: "+i)}finally{r||i(n)}}let s=e.Bi(a);if(0!=s&&0!=s)throw new Cf("end failed: "+s)}})}function cd(){return new Af({start(){},transform(e,t){try{t.enqueue(e.Oi.slice(0))}finally{e.release()}},flush(){}})}var fd=new c([["deflate",15],["gzip",31],["deflate-raw",-15]]),ld=new c([["deflate",15],["gzip",31],["deflate-raw",-15],["deflate64-raw",-16]]);function ud(e,t){let n=e.get(t);if(void 0===n)throw new TypeError(`Unsupported format: ${t}`);return n}Dt({workerURI:"./core/web-worker-native.js",wasmURI:null,CompressionStreamFallback:class{constructor(e="deflate",t){let n=function(e="deflate",t){let n=ud(fd,e),r=t&&"number"==typeof t.level?t.level:-1;return sd({Ii:()=>function(){let e=Yf();return e.$t=rl(e),e}(),Wi:e=>function(e,t,n=8,r=15,i=cl,o=0){let a=1;if(!e)return-2;if(e.Qt="",-1==t&&(t=6),r<0){if(a=0,r<-15)return-2;r=-r}else r>15&&(a=2,r-=16);if(i<1||i>9||8!=n||r<8||r>15||t<0||t>9||o<0||o>4||8==r&&1!=a)return-2;8==r&&(r=9);let s=rl(e);return s?(e.$t=s,s.en=e,s.Sn=42,s.zn=a,s.Dn=void 0,s.k=r,s.tn=1<<s.k,s.xn=s.tn-1,s.vn=i+7,s.kn=1<<s.vn,s.Tn=s.kn-1,s.An=(s.vn+fl-1)/fl,s.u=new vf(2*s.tn),s.Nn=new kf(s.tn),s.Cn=new kf(s.kn),s.nn=0,s.Un=1<<i+6,s.pn=new vf(4*s.Un),s.Wn=4*s.Un,s.u&&s.Nn&&s.Cn&&s.pn?(s.sr=s.pn.subarray(s.Un),s.yn=s.In+s.Un,s.Rn=3*(s.Un-1),s.Xn=t,s.Qn=o,s.ur=n,function(e){let t=function(e){let t;return cu(e)?-2:(e.jt=e.Xt=0,e.Qt="",e.t=2,t=e.$t,t.hn=0,t.Ln=t.In,t.zn<0&&(t.zn=-t.zn),t.Sn=2==t.zn?57:42,e.i=2==t.zn?Pl(0):Nl(0),t.Pn=-2,function(e){if(e.En&&e.En.length>=yl)for(let t=0;t<yl;t++)e.En[t]=ol();else{e.En=[];for(let t=0;t<yl;t++)e.En.push(ol())}if(e.Fn&&e.Fn.length>=2*hl+1)for(let t=0;t<2*hl+1;t++)e.Fn[t]=ol();else{e.Fn=[];for(let t=0;t<2*hl+1;t++)e.Fn.push(ol())}if(e.Fr&&e.Fr.length>=2*ml+1)for(let t=0;t<2*ml+1;t++)e.Fr[t]=ol();else{e.Fr=[];for(let t=0;t<2*ml+1;t++)e.Fr.push(ol())}e.Rr=new jf(e.En,new Zf(vl,Rl,wl+1,pl,gl)),e.Sr=new jf(e.Fn,new Zf(kl,Sl,0,hl,gl)),e.zr=new jf(e.Fr,new Zf(null,zl,0,ml,7)),e.p=0,e.an=0,e.cr=0,Jl(e)}(t),0)}(e);return 0==t&&function(e){e.dr=2*e.tn,iu(e),e.nr=eu[e.Xn].kr,e._n=eu[e.Xn].vr,e.$n=eu[e.Xn].Tr,e.er=eu[e.Xn].Ar,e.Yn=0,e.Hn=0,e.qn=0,e.Vn=0,e.Jn=e.jn=fl-1,e.Gn=0,e.Kn=0}(e.$t),t}(e)):(s.Sn=666,e.Qt=Gf(-4),wu(e),-4)):-4}(e,r,8,n,8,0),Mi:du,Bi:wu})}(e,t);this.writable=n.writable,this.readable=n.readable.pipeThrough(cd())}},DecompressionStreamFallback:class{constructor(e="deflate"){let t=function(e="deflate"){let t=ud(ld,e);return sd({Ii:()=>function(){let e=Yf();return e.$t=Pu(e,!1),e}(),Wi:e=>function(e,t){let n,r;if(!e)return-2;e.Qt="";let i=-16==t;return r=Pu(e,i),e.$t=r,r.en=e,r.Hr=i?16191:16180,n=function(e,t){let n,r;if($u(e))return-2;if(r=e.$t,t<0){if(t<-16)return-2;n=0,r.si=-16==t,t=-t}else n=5+(t>>4),r.si=!1,t<48&&(t&=15);let i=r.si?16:15;return t&&(t<8||t>i)?-2:(r.u.length>0&&r.k!=t&&(r.u=Wf),r.zn=n,r.k=t,function(e){let t;return $u(e)?-2:(t=e.$t,t.tn=0,t.nn=0,t.rn=0,function(e){let t;return $u(e)?-2:(t=e.$t,e.jt=e.Xt=t.Gr=0,e.Qt="",t.zn&&(e.i=1&t.zn),t.Hr=t.si?16191:16180,t.Yr=!1,t.qr=!1,t.Jr=-1,t.jr=t.si?65536:32768,delete t.Dn,t.p=0,t.an=0,t.Br=t.ri,t.tt=t.ri,t.ei=t.ri,t.Pr=!0,t.oi=-1,0)}(e))}(e))}(e,t),n}(e,t),Mi:nd,Bi:rd})}(e);this.writable=t.writable,this.readable=t.readable.pipeThrough(cd())}}}),Wt(Dt),e.BlobReader=Zi,e.BlobWriter=Gi,e.Data64URIReader=class extends Yi{constructor(e){super();let t=e.length;for(;"="==e.charAt(t-1);)t--;const r=e.indexOf(",")+1;n.assign(this,{Vi:e,Pi:r,size:a.floor(.75*(t-r))})}readUint8Array(e,t){const{Pi:n,Vi:r}=this,i=new w(t),o=4*a.floor(e/3),s=atob(r.substring(o+n,4*a.ceil((e+t)/3)+n)),c=e-3*a.floor(o/4);let f=0;for(let e=c;e<c+t&&e<s.length;e++)i[e-c]=s.charCodeAt(e),f++;return f<i.length?i.subarray(0,f):i}},e.Data64URIWriter=class extends qi{constructor(e){super(),n.assign(this,{contentType:e,data:"data:"+(e||"")+";base64,",Hi:""})}writeUint8Array(e){const t=this;let n,i=t.Hi;const o=t.Hi.length;for(t.Hi="",n=0;n<3*a.floor((o+e.length)/3)-o;n++)i+=r.fromCharCode(e[n]);for(;n<e.length;n++)t.Hi+=r.fromCharCode(e[n]);i.length>2?t.data+=S(i):t.Hi=i+t.Hi}getData(){return this.data+S(this.Hi)}},e.ERR_ABORTED=Qe,e.ERR_AMBIGUOUS_ARCHIVE=ma,e.ERR_BAD_FORMAT=ca,e.ERR_CENTRAL_DIRECTORY_NOT_FOUND=ua,e.ERR_CODEC_OUT_OF_MEMORY=ur,e.ERR_DUPLICATED_NAME=Os,e.ERR_ENCRYPTED=da,e.ERR_ENCRYPTED_CENTRAL_DIRECTORY=ya,e.ERR_ENTRY_DATA_OUT_OF_BOUNDS=ha,e.ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND=la,e.ERR_EOCDR_NOT_FOUND=fa,e.ERR_EXTRAFIELD_ZIP64_NOT_FOUND=me,e.ERR_HTTP_RANGE=Ai,e.ERR_HTTP_RESOURCE_CHANGED=Ni,e.ERR_HTTP_STATUS=Ti,e.ERR_INVALID_AUTHENTICATION_CODE=yn,e.ERR_INVALID_BASE_URI=ct,e.ERR_INVALID_CODEC_DEFINITION=_n,e.ERR_INVALID_CODEC_MODULE=er,e.ERR_INVALID_COMMENT=Bs,e.ERR_INVALID_COMMENT_TYPE=Vs,e.ERR_INVALID_COMPRESSED_DATA=lr,e.ERR_INVALID_CRC32=dr,e.ERR_INVALID_DATE=Ys,e.ERR_INVALID_ENCRYPTION_STRENGTH=js,e.ERR_INVALID_ENTRY=Ec,e.ERR_INVALID_ENTRY_COMMENT=Ps,e.ERR_INVALID_ENTRY_COMMENT_TYPE=Hs,e.ERR_INVALID_ENTRY_NAME=qs,e.ERR_INVALID_EXTRAFIELD=Xs,e.ERR_INVALID_EXTRAFIELD_DATA=$s,e.ERR_INVALID_EXTRAFIELD_DATA_TYPE=_s,e.ERR_INVALID_EXTRAFIELD_TYPE=Qs,e.ERR_INVALID_FILENAME_VALIDATION=Ea,e.ERR_INVALID_FUNCTION_OPTION=je,e.ERR_INVALID_GID=dc,e.ERR_INVALID_LEVEL=gc,e.ERR_INVALID_MAX_APPENDED_DATA_SIZE=Fa,e.ERR_INVALID_MAX_WORKERS=st,e.ERR_INVALID_MSDOS_ATTRIBUTES=mc,e.ERR_INVALID_MSDOS_DATA=yc,e.ERR_INVALID_PASSWORD=mn,e.ERR_INVALID_PASSWORD_TYPE=Ge,e.ERR_INVALID_PASS_THROUGH_VALUE=Ke,e.ERR_INVALID_READER=fc,e.ERR_INVALID_READER_OPTIONS=Xe,e.ERR_INVALID_SIGNAL=Ze,e.ERR_INVALID_SIGNATURE_DATA=bc,e.ERR_INVALID_STRICTNESS=ba,e.ERR_INVALID_UID=uc,e.ERR_INVALID_UNCOMPRESSED_SIZE=fr,e.ERR_INVALID_UNIX_EXTRA_FIELD_TYPE=pc,e.ERR_INVALID_UNIX_ID_SIZE=hc,e.ERR_INVALID_UNIX_MODE=wc,e.ERR_INVALID_URI=ft,e.ERR_INVALID_VERSION=Js,e.ERR_ITERATOR_COMPLETED_TOO_SOON=Ci,e.ERR_LOCAL_FILE_HEADER_NOT_FOUND=pe,e.ERR_OVERLAPPING_ENTRY=he,e.ERR_RESERVED_COMPRESSION_METHOD=$n,e.ERR_SPLIT_ZIP_FILE=pa,e.ERR_UNDEFINED_COMPRESSION_METHOD=ac,e.ERR_UNDEFINED_CRC32=sc,e.ERR_UNDEFINED_READER=cc,e.ERR_UNDEFINED_UNCOMPRESSED_SIZE=oc,e.ERR_UNDETERMINED_SIZE="Undetermined size",e.ERR_UNSAFE_FILENAME=ga,e.ERR_UNSUPPORTED_COMPRESSION=tr,e.ERR_UNSUPPORTED_CONTEXT=xf,e.ERR_UNSUPPORTED_CRYPTO_API=bn,e.ERR_UNSUPPORTED_ENCRYPTION=wa,e.ERR_UNSUPPORTED_ENCRYPTION_PASS_THROUGH=Ks,e.ERR_UNSUPPORTED_ENCRYPTION_USDZ=Zs,e.ERR_UNSUPPORTED_FORMAT=ic,e.ERR_UNSUPPORTED_SPLIT_USDZ=Gs,e.ERR_UNSUPPORTED_UINT64=Ra,e.ERR_WORKER_STARTUP_TIMEOUT=Pr,e.ERR_WRITER_NOT_INITIALIZED=Ui,e.ERR_WRITER_SIZE_NOT_WRITABLE=Ii,e.ERR_ZIP_CRYPTO_LAST_MOD_DATE=Fc,e.ERR_ZIP_NOT_EMPTY=lc,e.HttpRangeReader=class extends po{constructor(e,t={}){super(e,n.assign({},t,{useRangeHeader:!0}))}},e.HttpReader=po,e.Reader=Yi,e.SplitDataReader=ho,e.SplitDataWriter=mo,e.TextReader=class extends Zi{constructor(e){super(new y([e],{type:"text/plain"}))}},e.TextWriter=class extends Gi{constructor(e){super(),n.assign(this,{encoding:e,Yi:!e||"utf-8"==e.toLowerCase()})}async getData(){const{encoding:e,Yi:t}=this,n=await super.getData();return n.text&&t?n.text():function(e,t){return ki(e,t,!1)}(new w(await n.arrayBuffer()),e)}},e.Uint8ArrayReader=class extends Yi{constructor(e){super(),e=new w(e.buffer,e.byteOffset,e.byteLength),n.assign(this,{Ge:e,size:e.length})}readUint8Array(e,t){return this.Ge.slice(e,e+t)}},e.Uint8ArrayWriter=class extends qi{constructor(e){super(),this.Ji=e||262144}init(e=0){n.assign(this,{offset:0,Ge:new w(e>0?e:this.Ji)}),super.init()}writeUint8Array(e){const t=this,n=t.offset+e.length;if(n>t.Ge.length){let e=t.Ge.length?2*t.Ge.length:t.Ji;for(;e<n;)e*=2;const r=t.Ge;t.Ge=new w(e),t.Ge.set(r)}t.Ge.set(e,t.offset),t.offset+=e.length}getData(){return this.offset===this.Ge.length?this.Ge:this.Ge.slice(0,this.offset)}},e.VERSION="2.23.0",e.WARNING_APPENDED_DATA=Ta,e.WARNING_CLAMPED_LAST_MODIFICATION_DATE=Sc,e.WARNING_COMPRESSED_PATCHED_DATA=Da,e.WARNING_COMPRESSION_UNAVAILABLE=Rc,e.WARNING_DUPLICATE_FILENAME=Wa,e.WARNING_MALFORMED_EXTRA_FIELD=xa,e.WARNING_MISMATCHED_CENTRAL_DIRECTORY_OFFSET=Ua,e.WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG=Ba,e.WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD=Va,e.WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES=Pa,e.WARNING_MISMATCHED_LOCAL_FILE_HEADER_FILENAME=Oa,e.WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY=La,e.WARNING_MISSING_ZIP64_EXTRA_FIELD=Ia,e.WARNING_MULTIPLE_END_OF_CENTRAL_DIRECTORY=Ma,e.WARNING_PREPENDED_CENTRAL_DIRECTORY=Na,e.WARNING_PREPENDED_DATA=Aa,e.WARNING_TRAILING_CENTRAL_DIRECTORY_DATA=Ca,e.WARNING_UNKNOWN_VERSION=za,e.WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA=va,e.WARNING_UNSORTED_CENTRAL_DIRECTORY=Sa,e.WARNING_WRAPPED_ENTRIES_COUNT=ka,e.Writer=qi,e.ZipReader=Ka,e.ZipReaderStream=Xa,e.ZipWriter=Ac,e.ZipWriterStream=class{constructor(e={}){const{readable:t,writable:n}=new z;this.readable=t,this.zipWriter=new Ac(n,e),this.xe=new f}transform(e){const t=this.zipWriter;let n;const{readable:r,writable:i}=new z({start(e){n=e},flush:()=>{!async function(){try{await t.close()}catch(e){await Lc(t,e)}}()}});return Mc(this,this.zipWriter.add(e,r),e=>n.error(e)),{readable:this.readable,writable:i}}writable(e){let t;const{readable:n,writable:r}=new z({start(e){t=e}});return Mc(this,this.zipWriter.add(e,n),e=>t.error(e)),r}async close(e,n={}){const{zipWriter:r}=this,i=(await g.allSettled(t.from(this.xe))).filter(e=>"rejected"==e.status).map(e=>e.reason);if(i.length){const[e]=i;try{e.entryErrors=i}catch{}throw await Lc(r,e),e}try{return await r.close(e,n)}catch(e){throw await Lc(r,e),e}}},e.configure=function(e){n.assign(gt,Rt(zt(e)))},e.createBlobTempStream=function(e={}){const{thresholdBytes:t=Sf}=e;return function(){const e=[];let n,r,i,o=0,a=!1;const s=new x({async write(i){a?await n.write(i):(e.push(i),o+=i.length,o>t&&await async function(){const t=new z;r=Xn(t.readable),n=t.writable.getWriter(),a=!0;for(const t of e)await n.write(t);e.length=0}())},async close(){n&&(await n.close(),n=null)}});let c=0;return{writable:s,readable:new D({async pull(t){if(a){if(!i){const e=await r;i=e.stream().getReader()}const{value:e,done:n}=await i.read();n?t.close():t.enqueue(e)}else c<e.length?t.enqueue(e[c++]):t.close()},async cancel(e){i&&await i.cancel(e)}},{highWaterMark:0}),dispose:async function(){if(n){try{await n.abort()}catch{}n=null}r&&(r.catch(()=>{}),r=null),e.length=0}}}},e.createOPFSTempStream=function(e={}){const{thresholdBytes:n=Ff,directoryName:r=Rf,getDirectory:i=()=>T.storage.getDirectory()}=e;let o;function a(){return o||(o=g.resolve(i()).then(e=>e.getDirectoryHandle(r,{create:!0}))),o}return function(){const e=[];let r,i,o,s,c=0,f=!1;const l=new x({async write(s){f?await o.write(s):(e.push(s),c+=s.length,c>n&&await async function(){const n=await a();r=R.randomUUID?R.randomUUID():t.from(R.getRandomValues(new w(16)),e=>e.toString(16).padStart(2,"0")).join(""),i=await n.getFileHandle(r,{create:!0}),o=(await i.createWritable()).getWriter(),f=!0;for(const t of e)await o.write(t);e.length=0}())},async close(){o&&(await o.close(),o=null)}});let u=0;return{writable:l,readable:new D({async pull(t){if(f){if(!s){const e=await i.getFile();s=e.stream().getReader()}const{value:e,done:n}=await s.read();n?t.close():t.enqueue(e)}else u<e.length?t.enqueue(e[u++]):t.close()},async cancel(e){s&&await s.cancel(e)}},{highWaterMark:0}),dispose:async function(){if(o){try{await o.close()}catch{}o=null}if(r){try{const e=await a();await e.removeEntry(r)}catch{}i=r=null}e.length=0}}}},e.createSyncAccessHandleTempStream=function(e={}){const{thresholdBytes:n=zf,directoryName:r=Df,getDirectory:i}=e;if(!(i||"undefined"!=typeof FileSystemFileHandle&&FileSystemFileHandle.prototype.createSyncAccessHandle))throw new d(xf);const o=i||(()=>T.storage.getDirectory());let s;function c(){return s||(s=g.resolve(o()).then(e=>e.getDirectoryHandle(r,{create:!0}))),s}return function(){const e=[];let r,i,o=0,s=!1,f=0,l=0;const u=new x({async write(a){s?(i.write(a,{at:f}),f+=a.length):(e.push(a),o+=a.length,o>n&&await async function(){const n=await c();r=R.randomUUID?R.randomUUID():t.from(R.getRandomValues(new w(16)),e=>e.toString(16).padStart(2,"0")).join("");const o=await n.getFileHandle(r,{create:!0});i=await o.createSyncAccessHandle(),s=!0;for(const t of e)i.write(t,{at:f}),f+=t.length;e.length=0}())},close(){i&&i.flush()}});let d=0;return{writable:u,readable:new D({pull(t){if(s){const e=f-l;if(e<=0)return void t.close();const n=new w(a.min(524288,e)),r=i.read(n,{at:l});r?(l+=r,t.enqueue(n.subarray(0,r))):t.close()}else d<e.length?t.enqueue(e[d++]):t.close()}},{highWaterMark:0}),dispose:async function(){if(i){try{i.close()}catch{}i=null}if(r){try{const e=await c();await e.removeEntry(r)}catch{}r=null}e.length=0}}}},e.getMimeType=function(){return"application/octet-stream"},e.getRegisteredCodecs=ar,e.getSupportedCompressionMethods=function(){const{CompressionStream:e,DecompressionStream:t,CompressionStreamFallback:n,DecompressionStreamFallback:r}=bt(),i=[{compressionMethod:0,compression:!0,decompression:!0,registered:!1},{compressionMethod:8,compression:Ef(n,wr)||Ef(e,wr)||Ef(e,hr),decompression:Ef(r,wr)||Ef(t,wr)||Ef(t,hr),registered:!1},{compressionMethod:9,compression:!1,decompression:Ef(r,pr)||Ef(t,pr),registered:!1}];for(const e of ar()){const t=sr(e.format);i.push({compressionMethod:e.compressionMethod,compression:t?typeof t.CompressionStream==ge:de,decompression:t?typeof t.DecompressionStream==ge:de,registered:!0})}return i},e.isZipFile=Qa,e.registerCodec=function(e={}){const{compressionMethod:t,format:n,codecURI:r,CompressionStream:o,DecompressionStream:a,versionNeeded:s}=e;if(!i.isInteger(t)||t<0||t>M||typeof n!=Ee||!n.length)throw new d(_n);if(nr.includes(t))throw new d($n);const c=typeof o==ge||typeof a==ge;if(!(c||typeof r==Ee&&r.length))throw new d(_n);rr.set(t,{compressionMethod:t,format:n,codecURI:r,versionNeeded:s}),c&&cr(n,{CompressionStream:o,DecompressionStream:a})},e.resetConfiguration=function(){for(const e of yt)delete gt[e];n.assign(gt,ut)},e.terminateWorkers=async function(){await g.allSettled([Fi(),...di.map(e=>(zi(e),e.terminate()))]),Hr=de,Yr=!1},e.unregisterCodec=function(e){const t=rr.get(e);if(t){let n;rr.delete(e),rr.forEach(e=>n=n||e.format==t.format),n||ir.delete(t.format)}}});
```
[chapter-file-end]: #

### Check your understanding

Reload with saved data, deny storage, and open supported local media through the browser store. Verify unavailable native operations remain explicit and owned browser promises/listeners close.
[chapter-content-end]: #


## Step 6: capability audit

For every boundary in the index, identify Android/desktop/iOS/Wasm actual or its inherited intermediate source set. For unsupported functions, ensure UI observes capability and gives the intended result. Include platform crash logging, locks/digests/time and startup checks, not only visible features.

[chapter-content-start]: #
### Follow the code

Use the platform-boundary index to map each expect declaration to an actual or inherited intermediate source set. A host that compiles may still lack runtime permission, a native binary or a supported OS integration. Follow each UI capability check to the actual result and record device evidence. Include crash handlers, clock/locks and startup checks rather than auditing only visible media features.

This step connects or verifies implementations already listed in this chapter or its prerequisites. Follow the named call paths above while reading the complete tests at the end.

### Check your understanding

Choose one unsupported capability per platform and trace its UI gate and actual return/error. Then record launch/persistence/retirement evidence for all four targets.
[chapter-content-end]: #


[chapter-content-start]: #
## Recreate the tests and verify the chapter

Run the host and incoming-action fixtures below, then the compile/assemble/framework/distribution tasks in chapter 25. Perform cold/warm deep-link and backup-open tests, Android background/permission/SAF/PiP tests, desktop package/native loading, iOS device/simulator checks and browser storage/tab lifecycle tests.

These are source tests to reproduce and run in your reconstruction. Their inclusion here is not a claim that application/native/device tests were executed while writing the guide.

### Completion record

- [ ] Every implementation/configuration and required asset shown above is present at its displayed path.
- [ ] Cross-chapter imports resolve against the intended contracts and platform source sets.
- [ ] The tests for this chapter pass in the rebuilt app; record the command, platform and result.
- [ ] Native, device, browser and live-service checks have evidence or an explicit “not run” entry.
[chapter-content-end]: #


Gate: all four targets compile; each can launch, persist a library, open supported local content and retire a profile. Separately test native integrations on devices/OSes. Record simulator/browser limitations explicitly rather than treating unrun tests as passes.
