diff --git a/doc/release-notes/6691-dataset-version-tree-listing-api.md b/doc/release-notes/6691-dataset-version-tree-listing-api.md new file mode 100644 index 00000000000..c16ffb979ab --- /dev/null +++ b/doc/release-notes/6691-dataset-version-tree-listing-api.md @@ -0,0 +1,57 @@ +A new API endpoint allows lazy, paginated browsing of the folder hierarchy inside a dataset version: + +- `GET /api/datasets/{id}/versions/{versionId}/tree` + +The endpoint is the backend half of the **tree view selection and download** work tracked in [#6691](https://github.com/IQSS/dataverse/issues/6691) and the SPA work in [IQSS/dataverse-frontend#622](https://github.com/IQSS/dataverse-frontend/issues/622) / [#117](https://github.com/IQSS/dataverse-frontend/issues/117). It returns the immediate folders and files under a given path, with folders first and a stable name ordering, plus an opaque keyset cursor for pagination. + +Query parameters: + +- `path` — folder path within the dataset version. Root is `""` or omit. Forward-slash separated. +- `limit` — page size; default `100`, clamped to `1000`. +- `cursor` — opaque server-issued token from a previous response. Invalid/stale cursors return `400`. +- `include` — `all` (default), `folders`, or `files`. +- `order` — `NameAZ` (default) or `NameZA`. Folders sort first regardless. +- `includeDeaccessioned` — same semantics as `/files`. +- `originals` — when `true`, the returned `downloadUrl` requests the original-format download. + +Response shape: + +```json +{ + "path": "data/raw", + "items": [ + { "type": "folder", "name": "2024", "path": "data/raw/2024", + "counts": { "files": 12, "folders": 1, "bytes": 4194304, + "restricted": 0, "embargoed": 0 } }, + { "type": "file", "id": 42, "name": "data.csv", "path": "data/raw/data.csv", + "size": 1024, "contentType": "text/csv", "access": "public", + "checksum": { "type": "MD5", "value": "abc" }, + "downloadUrl": "/api/access/datafile/42" } + ], + "nextCursor": "b2Zmc2V0PTEwMA", + "limit": 100, + "order": "NameAZ", + "include": "all", + "approximateCount": 137 +} +``` + +Folder rows carry recursive aggregates over their subtree: `counts.files` is the total file count, `counts.folders` is the immediate-subfolder count, `counts.bytes` is the total size of files in the subtree (using `df.filesize` — the served-form size, intended as a "downloading this folder = N GB" UX hint, not authoritative under `originals=true`). `counts.restricted` and `counts.embargoed` mirror the per-file `access` resolution: a restricted file is counted as restricted even if it also carries an embargo, and only non-restricted files with an active embargo are counted as embargoed. Public files are implied as `files - restricted - embargoed`. + +The per-file `checksum` object is present only when the digest matches the bytes the corresponding `downloadUrl` would serve. For ingested tabular files the default `downloadUrl` resolves to a converted TSV whose digest Dataverse does not store, so `checksum` is omitted on those rows; passing `originals=true` flips both the URL (`?format=original`) and the checksum back on, since the saved-original aux blob's bytes match `df.checksumvalue`. Clients can therefore treat "checksum present" as an unconditional commitment that the value matches the bytes they would receive. + +Permissions and embargoes are honoured exactly as on `GET /api/datasets/{id}/versions/{versionId}/files` — the endpoint is a thin lazy projection of the same `DatasetVersion.fileMetadatas`. + +For published, non-deaccessioned versions the response carries `ETag` and `Cache-Control: private, immutable` headers; clients can pass the ETag back in `If-None-Match` to receive `304 Not Modified` without re-fetching the body. `private` keeps responses out of shared proxies because the endpoint is auth-required; the browser's own cache still benefits from `immutable`. Drafts do not emit an ETag. + +## Performance + +The endpoint is backed by two native keyset SQL queries (folder rollup + file listing) against the `filemetadata` table, driven by a covering index added in Flyway migration `V6.10.1.2`: + +``` +ix_filemetadata_tree(datasetversion_id, directorylabel, lower(label), datafile_id) +``` + +Listing one folder is independent of the dataset's total file count — the queries scan only the rows under the requested path, with the keyset cursor (`(lower(label), datafile_id)` for files, last folder name for folders) avoiding the offset penalty. The wire format and cursor opacity are unchanged from the first cut; clients keep echoing back `nextCursor` exactly as before. + +The `dataverse-client-javascript` SDK ships matching helpers in the same release wave: `listDatasetTreeNode` and `iterateDatasetTreeNode`. diff --git a/doc/release-notes/6691-reusable-frontend-components.md b/doc/release-notes/6691-reusable-frontend-components.md new file mode 100644 index 00000000000..60abcbd7f95 --- /dev/null +++ b/doc/release-notes/6691-reusable-frontend-components.md @@ -0,0 +1,56 @@ +## Reusable Frontend Components — JSF Mount + +This release introduces the first reusable React component built in `dataverse-frontend` and embedded into the classic JSF UI: the React file uploader (DVWebloader v2). It is the foundation for further dual-mode components (e.g. the file tree view tracked in [#6691](https://github.com/IQSS/dataverse/issues/6691)). + +### What changed + +- **New feature flag** `dataverse.feature.react-uploader` (off by default). When enabled, the classic PrimeFaces upload widget on the dataset edit page is replaced with the React uploader. The file *replace* flow keeps using the JSF widget. +- **New feature flag** `dataverse.feature.react-tree-view` (off by default). When enabled, the dataset Files tab's "Tree" view (selectable via the existing Table/Tree toggle) is rendered by the same React lazy tree the SPA uses, instead of the classic PrimeFaces tree. The table view is unchanged. The tree supports lazy folder loading, tri-state selection (per-row checkboxes plus a header select-all), full keyboard navigation (WAI-ARIA tree pattern), URL-bookmarkable folder paths (`?view=tree&path=…`), and **client-side streaming-zip download** of the user's selection — the bundle pipes per-file response bodies into a single zip without any server-side ZIP endpoint. +- **New JVM setting** `dataverse.reusable-components.base-url` (default `/reusable-components`) tells the JSF page where to load the reusable component bundle from. The default value points at the bundle files baked into the WAR; operators who want to host the bundle elsewhere can copy those files out and override the setting. +- **Server-authoritative S3 tagging.** `S3AccessIO.generateTemporaryS3UploadUrls` now includes a `tagging` field in its JSON response when `dataverse.files..disable-tagging` is unset. The dataverse-client-javascript SDK reads this and decides whether to send the `x-amz-tagging` header — there is no more client-side flag to keep in sync. Non-breaking additive change. +- **Bundle cache-busting that actually changes per build.** The script tags now use a token derived from the bundle file's mtime, not the pinned `getVersion()` string — so browsers pick up new builds automatically without a hard-refresh. Falls back to `getVersion()` if the bundle file isn't reachable on the local filesystem (e.g. when the operator has rehosted the bundle off the WAR). +- **JSF partial-update survival.** PrimeFaces re-inserts the host `
` for the React mount on certain partial responses (e.g. when toggling between Table and Tree views). The standalone bundles now use a `MutationObserver` to detect when the host element is replaced and remount cleanly, so toggling no longer leaves the React tree orphaned on a removed div. +- **Hide the legacy "Done" button when the React uploader is wired.** The classic Done button below the upload component duplicated the React uploader's own finish action and confused testers; it's now suppressed when the uploader feature flag is active and direct upload is enabled. +- **Tree view toggle now appears for flat datasets when the React tree view is enabled.** Previously the JSF Tree/Table toggle (`DatasetPage.isFileTreeViewRequired`) was gated on the dataset having `directoryLabel` set on at least one file. Flat datasets (>1 file, no folders) didn't show the toggle, locking those users into the table view. With `dataverse.feature.react-tree-view=true`, the React tree's bulk-download UX (checkbox selection + client-side streaming zip with per-file resume / two-pass recovery) is a strict upgrade over the legacy server-zipped bulk download regardless of folder structure, so the gate drops to `> 1 file` on those installs. When the feature flag is off, the original "folders present" gate stays — the legacy PrimeFaces tree adds no value on a flat list, so behaviour is unchanged for installs that haven't opted in. Single-file and empty datasets still hide the toggle (no-op). +- **Create-dataset moves to a two-step file flow when the flag is on.** The React uploader is API-driven and needs the dataset to exist (PID assigned) before it can request upload URLs or register files. On the create-dataset page the dataset is still transient. When `dataverse.feature.react-uploader` is enabled, the create page therefore no longer renders the upload section; users save the metadata first, then add files on the persisted dataset's edit-files page where the React uploader runs against a real PID. This matches the SPA's flow, where the React uploader is the only uploader and "metadata first, files after" is the canonical create flow. Instances that haven't enabled the feature flag keep the existing one-step "create + upload" UX with the legacy JSF widgets unchanged. We chose this over a fall-back-to-JSF approach because mixing two uploaders (legacy on create, React on edit) creates a divergent UX (different folder-upload handling, progress UI, file-list rendering). +- **Documentation.** A new guide page covers how to host the reusable component bundle and wire it into Dataverse: see [Reusable Frontend Components](https://guides.dataverse.org/en/latest/container/running/reusable-components.html). The matching frontend-side contract lives in the [`dataverse-frontend` repo](https://github.com/IQSS/dataverse-frontend/blob/develop/docs/reusable-components.md). + +### Operator note: covering index migration + +This release ships a new Flyway migration (`V6.10.1.2.sql`) that creates `ix_filemetadata_tree` over `(datasetversion_id, directorylabel, lower(label), datafile_id)` to keep the new tree endpoint's keyset paginator fast. + +On large production deployments (multi-million-row `filemetadata`), plain `CREATE INDEX` takes an `ACCESS EXCLUSIVE` lock and stalls all writes for the duration of the build (potentially several minutes). Flyway runs migrations inside a transaction, which prevents using `CREATE INDEX CONCURRENTLY` in the migration file itself. + +Recommended for large installs: pre-create the index out-of-band before deploying the new release: + +```sql +CREATE INDEX CONCURRENTLY IF NOT EXISTS ix_filemetadata_tree + ON filemetadata (datasetversion_id, directorylabel, lower(label), datafile_id); +``` + +The migration uses `CREATE INDEX IF NOT EXISTS`, so a pre-created index is a no-op when Flyway runs. + +### LocalStack dev-stack notes + +The `dev_localstack` storage profile in `docker-compose-dev.yml` ships with `upload-redirect=true` / `download-redirect=true`, so the browser PUTs/GETs to S3 directly. Two operator-side things had to be set up explicitly to make that path work in dev: + +- Bucket-level CORS: the init script `conf/localstack/buckets.sh` now puts a permissive CORS rule on `mybucket` after creation. LocalStack (matching real AWS S3) ships with no default CORS rules; without this, the browser preflight returns 403. +- Hostname resolution: Dataverse signs the presigned URLs against `http://localstack:4566` (the docker-internal hostname). For the browser to use the same URL, add `127.0.0.1 localstack` to `/etc/hosts` on the developer's machine. The same applies to `keycloak.mydomain.com` for the OIDC redirect target. This is a fundamental property of presigned-URL networking, not a Dataverse bug. + +### Prerequisites for using the React uploader + +1. `dataverse.feature.api-session-auth=true` so the bundle can call the API with the user's session cookie. **For production, also enable `dataverse.feature.api-session-auth-hardening`** to mitigate CSRF risk via Origin/Referer + `X-Dataverse-CSRF-Token` enforcement. +2. The reusable component bundle must be reachable from the user's browser. The default setup (`dataverse.reusable-components.base-url=/reusable-components`) serves the bundle files baked into the WAR same-origin and needs no extra setup. Operators who want to host the bundle off the WAR (separate static-file server, CDN, etc.) can copy `webapp/reusable-components/` to their host of choice and point the setting at that URL. +3. `dataverse.siteUrl` must match the URL the browser actually uses, so that Origin/Referer checks pass when session-auth hardening is enabled. + +### What didn't change + +- File replace, batch operations, and any classic JSF panels render exactly as before when the flag is off. +- No new Java / Maven dependency on npm or Node tooling. The bundle ships as pre-built JS inside the WAR (`webapp/reusable-components/`). + +### Cross-repo + +This release pairs with: + +- [`@iqss/dataverse-client-javascript`](https://github.com/IQSS/dataverse-client-javascript) for the `tagging` field on the upload destination response. +- [`dataverse-frontend`](https://github.com/IQSS/dataverse-frontend) is the source repo for the React uploader and tree-view bundles. The pre-built JS files in this PR were produced from that repo's build. diff --git a/doc/sphinx-guides/source/api/native-api.rst b/doc/sphinx-guides/source/api/native-api.rst index 1a1604886c6..52299d26286 100644 --- a/doc/sphinx-guides/source/api/native-api.rst +++ b/doc/sphinx-guides/source/api/native-api.rst @@ -2342,6 +2342,61 @@ Usage example: .. note:: Keep in mind that you can combine all of the above query parameters depending on the results you are looking for. +List a Folder of a Dataset Version (Tree View) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +|CORS| Lists the immediate children (folders and files) inside a folder of a dataset version, with paging. This is intended for lazy tree-view UIs that fetch each folder's children on demand and that need stable cursor-based pagination across very large datasets: + +.. code-block:: bash + + export SERVER_URL=https://demo.dataverse.org + export ID=24 + export VERSION=1.0 + + curl "$SERVER_URL/api/datasets/$ID/versions/$VERSION/tree?limit=100" + +Folders are returned first, then files. Both are sorted by name (case-insensitive); files break ties on the data file id for stability. + +Query parameters: + +* ``path`` — folder within the dataset, forward-slash separated; root is ``""`` or omit. The server normalises repeated and trailing slashes. +* ``limit`` — page size; default ``100``, clamped to ``1000``. +* ``cursor`` — opaque server-issued token. Pass back the ``nextCursor`` from a previous response to fetch the next page. Invalid or stale cursors yield ``400``. +* ``include`` — ``all`` (default), ``folders``, or ``files``. +* ``order`` — ``NameAZ`` (default) or ``NameZA``. +* ``includeDeaccessioned`` — same semantics as the ``files`` endpoint. +* ``originals`` — when ``true``, the per-file ``downloadUrl`` requests the original-format download. + +Response shape: + +.. code-block:: json + + { + "path": "data/raw", + "items": [ + { "type": "folder", "name": "2024", "path": "data/raw/2024", + "counts": { "files": 12, "folders": 1, "bytes": 4194304, + "restricted": 0, "embargoed": 0 } }, + { "type": "file", "id": 42, "name": "data.csv", "path": "data/raw/data.csv", + "size": 1024, "contentType": "text/csv", "access": "public", + "checksum": { "type": "MD5", "value": "abc" }, + "downloadUrl": "/api/access/datafile/42" } + ], + "nextCursor": "b2Zmc2V0PTEwMA", + "limit": 100, + "order": "NameAZ", + "include": "all", + "approximateCount": 137 + } + +Permissions and embargoes are honoured exactly as on ``GET /api/datasets/{id}/versions/{versionId}/files``. + +Folder counts are recursive: ``counts.files`` is the total number of files anywhere in the folder's subtree, ``counts.folders`` is the count of immediate subfolders, and ``counts.bytes`` is the total size of all files in the subtree. ``counts.bytes`` uses ``df.filesize`` — the size of the bytes the default ``downloadUrl`` would serve, which for ingested tabular files is the converted TSV rather than the original upload — so it is intended as a "downloading this folder = N GB" UX hint, not an authoritative original-bytes total. ``counts.restricted`` and ``counts.embargoed`` mirror the per-file ``access`` resolution: a restricted file is counted as restricted even if it also carries an embargo, and only non-restricted files with an active embargo are counted as embargoed. Public files are implied as ``files - restricted - embargoed``. + +Checksum semantics: ``checksum`` is present on a file row only when it is the digest of the bytes a client would receive by following ``downloadUrl``. For ingested tabular files the default ``downloadUrl`` resolves to the converted TSV — bytes whose digest Dataverse does not store — so the ``checksum`` field is omitted; requesting the same listing with ``originals=true`` flips ``downloadUrl`` to ``?format=original`` (the saved-original auxiliary blob) and the matching digest is reported again. Clients can therefore treat "``checksum`` present" as an unconditional commitment that the value matches what ``downloadUrl`` will serve. + +Caching: for published, non-deaccessioned versions the response carries an ``ETag`` header derived from the request inputs and a ``Cache-Control: private, immutable`` header. Clients can use the ETag in a subsequent ``If-None-Match`` request header to receive a ``304 Not Modified`` response without re-fetching the body. ``private`` keeps the response out of shared caches because the route is auth-required; the browser's own cache still benefits from ``immutable``. Drafts and deaccessioned versions do not emit an ETag because their content can change in place. + Get File Counts in a Dataset ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/sphinx-guides/source/container/running/frontend-dev.rst b/doc/sphinx-guides/source/container/running/frontend-dev.rst index 88d40c12053..9675c3ecd0c 100644 --- a/doc/sphinx-guides/source/container/running/frontend-dev.rst +++ b/doc/sphinx-guides/source/container/running/frontend-dev.rst @@ -8,3 +8,5 @@ Intro ----- The frontend (web interface) of Dataverse is being decoupled from the backend. This evolving codebase has its own repo at https://github.com/IQSS/dataverse-frontend which includes docs and scripts for running the backend of Dataverse in Docker. + +Selected React components from that repo can also be embedded directly into the classic JSF UI for installations that have not migrated to the SPA. See :doc:`reusable-components` for the integration model. diff --git a/doc/sphinx-guides/source/container/running/index.rst b/doc/sphinx-guides/source/container/running/index.rst index a02266f7cba..3252896dbda 100755 --- a/doc/sphinx-guides/source/container/running/index.rst +++ b/doc/sphinx-guides/source/container/running/index.rst @@ -10,4 +10,5 @@ Contents: metadata-blocks github-action frontend-dev + reusable-components backend-dev diff --git a/doc/sphinx-guides/source/container/running/reusable-components.rst b/doc/sphinx-guides/source/container/running/reusable-components.rst new file mode 100644 index 00000000000..3c17d89e634 --- /dev/null +++ b/doc/sphinx-guides/source/container/running/reusable-components.rst @@ -0,0 +1,89 @@ +Reusable Frontend Components +============================ + +.. contents:: |toctitle| + :local: + +Intro +----- + +Some Dataverse features can be served by React components built in +https://github.com/IQSS/dataverse-frontend and embedded directly into the +classic JSF UI. This lets institutions that have not migrated to the +single-page application (SPA) still benefit from new frontend work, +component by component, without replacing the whole UI. + +The first components shipped this way are the React file uploader +(DVWebloader v2), gated by the :ref:`dataverse.feature.react-uploader` +feature flag, and the React lazy file tree on the dataset Files tab, gated +by :ref:`dataverse.feature.react-tree-view` and tracked in +`#6691 `_. Both bundles are +emitted by the same frontend build and share React, i18n, and vendor chunks. + +For the frontend-side contract — the config interface, build pipeline, CSS +isolation, and how to make a new SPA component reusable — see +``docs/reusable-components.md`` in the +`dataverse-frontend `_ repo. + +How It Works +------------ + +Each reusable component is a self-contained ESM bundle plus shared chunks +(React, i18n, vendor, design system) and locale files. A JSF page loads +the bundle with a single `` + + +Authentication is via session cookie (JSESSIONID). The +:ref:`dataverse.feature.api-session-auth` feature flag must be enabled. +For production deployments, also enable session-cookie API hardening (see +the security notice next to ``dataverse.feature.api-session-auth``). + +Hosting the Bundle +------------------ + +The pre-built bundle ships inside the Dataverse WAR at +``webapp/reusable-components/`` and is served same-origin via the default +:ref:`dataverse.reusable-components.base-url` of ``/reusable-components``. +Out of the box no extra setup is required to enable the feature flags +above. + +Operators who prefer to host the bundle off the WAR — for example behind +a separate static-file server, an existing nginx, or a CDN — can copy the +contents of ``webapp/reusable-components/`` to that location and override +:ref:`dataverse.reusable-components.base-url` to point at it. There is no +published artifact (npm package, Docker image, etc.) for the bundle +today; rehosting it is the operator's responsibility. + +Configuration +------------- + +The relevant settings are documented in the Installation Guide: + +- :ref:`dataverse.feature.react-uploader` — turn on the React uploader for + the JSF dataset edit page. +- :ref:`dataverse.feature.react-tree-view` — turn on the React tree view + on the JSF dataset Files tab. +- :ref:`dataverse.feature.api-session-auth` — required so the bundle can + call the API using the user's session cookie. +- :ref:`dataverse.reusable-components.base-url` — where the JSF page should + load the bundle from. + +Cross-references +---------------- + +- :ref:`feature-flags` +- The component contract on the frontend side: + https://github.com/IQSS/dataverse-frontend/blob/develop/docs/reusable-components.md diff --git a/doc/sphinx-guides/source/installation/config.rst b/doc/sphinx-guides/source/installation/config.rst index f2a6fdfa324..31f2fb48632 100644 --- a/doc/sphinx-guides/source/installation/config.rst +++ b/doc/sphinx-guides/source/installation/config.rst @@ -2698,6 +2698,19 @@ protocol, host, and port number and should not include a trailing slash. - We are absolutely aware that it's confusing to have both ``dataverse.fqdn`` and ``dataverse.siteUrl``. https://github.com/IQSS/dataverse/issues/6636 is about resolving this confusion. +.. _dataverse.reusable-components.base-url: + +dataverse.reusable-components.base-url +++++++++++++++++++++++++++++++++++++++ + +Base URL from which the Dataverse :doc:`reusable React component bundles ` (e.g. ``dv-uploader.js``) are loaded by JSF pages. Trailing slashes are trimmed automatically. + +The default value, ``/reusable-components``, serves the pre-built bundle that ships inside the Dataverse WAR (under ``webapp/reusable-components/``), same-origin. Out of the box no further configuration is required. + +Operators who want to host the bundle off the WAR — for example behind a separate static-file server, a CDN, or any other URL of their choosing — can copy the contents of ``webapp/reusable-components/`` to that location and set ``dataverse.reusable-components.base-url`` to the URL where the files are served. There is no published artifact (npm package, Docker image, etc.) today; rehosting is the operator's responsibility. + +Can also be set via *MicroProfile Config API* sources, e.g. the environment variable ``DATAVERSE_REUSABLE_COMPONENTS_BASE_URL``. + .. _dataverse.files.directory: dataverse.files.directory @@ -3980,6 +3993,28 @@ dataverse.feature.api-session-auth Enables API authentication via session cookie (JSESSIONID). **Caution: Enabling this feature flag exposes the installation to CSRF risks!** We expect this feature flag to be temporary (only used by frontend developers, see `#9063 `_) and for the feature to be removed in the future. +.. _dataverse.feature.react-uploader: + +dataverse.feature.react-uploader +++++++++++++++++++++++++++++++++ + +Replaces the classic PrimeFaces file upload widget on the JSF dataset edit page with the React file uploader (DVWebloader v2). Requires :ref:`dataverse.feature.api-session-auth` to be enabled and the JSF page to be able to reach the reusable component bundle (see :ref:`dataverse.reusable-components.base-url` and the :doc:`/container/running/reusable-components` guide). + +This flag has no effect on the file replace flow, which continues to use the classic JSF upload widget. + +**Create-dataset flow change.** Enabling this flag also changes the create-dataset page: the file-upload section is no longer rendered there. The React uploader is API-driven and needs the dataset to exist (PID assigned) before it can request upload URLs or register files, so it cannot run on a transient (not-yet-saved) dataset. Users save the dataset metadata first, then add files on the persisted dataset's edit-files page. This matches the SPA's flow. Installations that have not enabled this flag keep the legacy "create + upload in one step" UX unchanged. + +.. _dataverse.feature.react-tree-view: + +dataverse.feature.react-tree-view ++++++++++++++++++++++++++++++++++ + +Replaces the classic PrimeFaces tree component on the dataset Files tab (when the user selects "Tree" in the Table/Tree toggle) with the React lazy file tree. The same component the SPA uses is mounted directly into the JSF page. + +Requires :ref:`dataverse.feature.api-session-auth` and the React bundle to be reachable from the browser (see :ref:`dataverse.reusable-components.base-url` and :doc:`/container/running/reusable-components`). + +This flag has no effect on the table view of the Files tab, which continues to use the classic PrimeFaces datatable. + .. _dataverse.feature.api-bearer-auth: dataverse.feature.api-bearer-auth diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index bbaefeffd65..0b6c1c256e7 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -19,6 +19,9 @@ services: DATAVERSE_FEATURE_API_BEARER_AUTH: "1" DATAVERSE_FEATURE_INDEX_HARVESTED_METADATA_SOURCE: "1" DATAVERSE_FEATURE_API_BEARER_AUTH_PROVIDE_MISSING_CLAIMS: "1" + DATAVERSE_FEATURE_REACT_TREE_VIEW: "1" + DATAVERSE_FEATURE_REACT_UPLOADER: "1" + DATAVERSE_FEATURE_API_SESSION_AUTH: "1" DATAVERSE_MAIL_SYSTEM_EMAIL: "dataverse@localhost" DATAVERSE_MAIL_MTA_HOST: "smtp" DATAVERSE_AUTH_OIDC_ENABLED: "1" diff --git a/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java b/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java index 5738ff8cfa9..96a9e4c5e5d 100644 --- a/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java +++ b/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java @@ -2484,9 +2484,17 @@ public boolean allowUserManagementOfOrder() { private Boolean fileTreeViewRequired = null; public boolean isFileTreeViewRequired() { + // With the React tree view feature flag on, the Tree view delivers a + // strict UX upgrade over the Table view even on flat datasets + // (checkbox selection + client-side streaming-zip download — no + // :ZipDownloadLimit cap, per-file resume, graceful failure recovery), + // so we expose the toggle whenever there's more than one file. + // With the flag off, the legacy PrimeFaces tree adds no value on a + // flat list, so we keep the original "folders present" gate. if (fileTreeViewRequired == null) { fileTreeViewRequired = workingVersion.getFileMetadatas().size() > 1 - && datafileService.isFoldersMetadataPresentInVersion(workingVersion); + && (systemConfig.isReactTreeViewEnabled() + || datafileService.isFoldersMetadataPresentInVersion(workingVersion)); } return fileTreeViewRequired; } diff --git a/src/main/java/edu/harvard/iq/dataverse/api/Datasets.java b/src/main/java/edu/harvard/iq/dataverse/api/Datasets.java index 136b6dbb69b..afeefe6d887 100644 --- a/src/main/java/edu/harvard/iq/dataverse/api/Datasets.java +++ b/src/main/java/edu/harvard/iq/dataverse/api/Datasets.java @@ -28,6 +28,14 @@ import edu.harvard.iq.dataverse.datasetutility.NoFilesException; import edu.harvard.iq.dataverse.datasetutility.OptionalFileParams; import edu.harvard.iq.dataverse.datasetversionsummaries.DatasetVersionSummary; +import edu.harvard.iq.dataverse.datasetversiontree.DatasetVersionTreeService; +import edu.harvard.iq.dataverse.datasetversiontree.DatasetVersionTreeService.FileItem; +import edu.harvard.iq.dataverse.datasetversiontree.DatasetVersionTreeService.FolderItem; +import edu.harvard.iq.dataverse.datasetversiontree.DatasetVersionTreeService.Include; +import edu.harvard.iq.dataverse.datasetversiontree.DatasetVersionTreeService.InvalidQueryException; +import edu.harvard.iq.dataverse.datasetversiontree.DatasetVersionTreeService.Order; +import edu.harvard.iq.dataverse.datasetversiontree.DatasetVersionTreeService.TreeItem; +import edu.harvard.iq.dataverse.datasetversiontree.DatasetVersionTreeService.TreePage; import edu.harvard.iq.dataverse.engine.command.Command; import edu.harvard.iq.dataverse.engine.command.DataverseRequest; import edu.harvard.iq.dataverse.engine.command.exception.CommandException; @@ -63,6 +71,8 @@ import edu.harvard.iq.dataverse.workflow.WorkflowContext; import edu.harvard.iq.dataverse.workflow.WorkflowContext.TriggerType; import edu.harvard.iq.dataverse.workflow.WorkflowServiceBean; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; import jakarta.ejb.EJB; import jakarta.ejb.EJBException; import jakarta.inject.Inject; @@ -90,6 +100,7 @@ import java.io.IOException; import java.io.InputStream; import java.net.URI; +import java.nio.charset.StandardCharsets; import java.sql.Timestamp; import java.text.MessageFormat; import java.text.SimpleDateFormat; @@ -199,6 +210,9 @@ public class Datasets extends AbstractApiBean { @Inject DatasetVersionFilesServiceBean datasetVersionFilesServiceBean; + @Inject + DatasetVersionTreeService datasetVersionTreeService; + @Inject DatasetTypeServiceBean datasetTypeSvc; @@ -604,6 +618,144 @@ public Response getVersionFileCounts(@Context ContainerRequestContext crc, }, getRequestUser(crc)); } + @GET + @AuthRequired + @Path("{id}/versions/{versionId}/tree") + public Response getVersionTree(@Context ContainerRequestContext crc, + @PathParam("id") String datasetId, + @PathParam("versionId") String versionId, + @QueryParam("path") String path, + @QueryParam("limit") Integer limit, + @QueryParam("cursor") String cursor, + @QueryParam("include") String includeParam, + @QueryParam("order") String orderParam, + @QueryParam("includeDeaccessioned") boolean includeDeaccessioned, + @QueryParam("originals") boolean originals, + @HeaderParam("If-None-Match") String ifNoneMatch, + @Context UriInfo uriInfo, + @Context HttpHeaders headers) { + return response(req -> { + Include include; + Order order; + try { + include = Include.fromQuery(includeParam); + order = Order.fromQuery(orderParam); + } catch (InvalidQueryException ex) { + return badRequest(BundleUtil.getStringFromBundle("datasets.api.version.tree.invalid.query", List.of(ex.getMessage()))); + } + DatasetVersion datasetVersion = getDatasetVersionOrDie(req, versionId, findDatasetOrDie(datasetId, false), uriInfo, headers, includeDeaccessioned); + // Stable ETag for cacheable (released, non-deaccessioned) versions only. + // Drafts and deaccessioned versions can change in place, so we don't + // emit a cacheable ETag for them. + // + // Cache-Control is `private` rather than `public` because the route + // is `@AuthRequired` — even though today the response body does not + // vary by user (restricted files are returned with their `access` + // marker, the metadata itself is not filtered), `private` keeps a + // future user-dependent SQL filter from leaking through a shared + // proxy. `immutable` is still safe: released non-deaccessioned + // versions are content-immutable, so the browser's own cache can + // skip revalidation. + String etag = isCacheableVersion(datasetVersion) + ? computeTreeEtag(datasetVersion, path, limit, cursor, include, order, + originals, includeDeaccessioned) + : null; + if (etag != null && etag.equals(ifNoneMatch)) { + return Response.notModified() + .tag(etag) + .header("Cache-Control", "private, immutable") + .build(); + } + TreePage page; + try { + page = datasetVersionTreeService.listChildren(datasetVersion, path, limit, cursor, include, order, originals); + } catch (InvalidQueryException ex) { + return badRequest(BundleUtil.getStringFromBundle("datasets.api.version.tree.invalid.query", List.of(ex.getMessage()))); + } + Response.ResponseBuilder rb = Response.ok(Json.createObjectBuilder() + .add("status", ApiConstants.STATUS_OK) + .add("data", jsonTreePage(page)) + .build()) + .type(MediaType.APPLICATION_JSON); + if (etag != null) { + rb.tag(etag).header("Cache-Control", "private, immutable"); + } + return rb.build(); + }, getRequestUser(crc)); + } + + private static boolean isCacheableVersion(DatasetVersion v) { + return v.isReleased() && !v.isDeaccessioned(); + } + + private static String computeTreeEtag(DatasetVersion version, String path, Integer limit, + String cursor, Include include, Order order, + boolean originals, boolean includeDeaccessioned) { + StringBuilder sb = new StringBuilder(); + sb.append(version.getId()).append(':') + .append(version.getVersionState() != null ? version.getVersionState().name() : "").append(':') + .append(path == null ? "" : path).append(':') + .append(limit == null ? "" : limit).append(':') + .append(cursor == null ? "" : cursor).append(':') + .append(include.name()).append(':') + .append(order.wireValue()).append(':') + .append(originals).append(':') + .append(includeDeaccessioned); + try { + MessageDigest md = MessageDigest.getInstance("SHA-256"); + byte[] hash = md.digest(sb.toString().getBytes(StandardCharsets.UTF_8)); + String b64 = Base64.getUrlEncoder().withoutPadding().encodeToString(hash); + return "\"" + b64.substring(0, 16) + "\""; + } catch (NoSuchAlgorithmException ex) { + return null; + } + } + + private static JsonObjectBuilder jsonTreePage(TreePage page) { + JsonArrayBuilder items = Json.createArrayBuilder(); + for (TreeItem item : page.items) { + JsonObjectBuilder ob = Json.createObjectBuilder(); + ob.add("type", item.type); + ob.add("name", item.name); + ob.add("path", item.path); + if (item instanceof FolderItem) { + FolderItem folder = (FolderItem) item; + ob.add("counts", Json.createObjectBuilder() + .add("files", folder.fileCount) + .add("folders", folder.folderCount) + .add("bytes", folder.bytes) + .add("restricted", folder.restrictedCount) + .add("embargoed", folder.embargoedCount)); + } else if (item instanceof FileItem) { + FileItem file = (FileItem) item; + ob.add("id", file.id); + ob.add("size", file.size); + if (file.contentType != null) ob.add("contentType", file.contentType); + if (file.access != null) ob.add("access", file.access); + if (file.checksumType != null && file.checksumValue != null) { + ob.add("checksum", Json.createObjectBuilder() + .add("type", file.checksumType) + .add("value", file.checksumValue)); + } + ob.add("downloadUrl", file.downloadUrl); + } + items.add(ob); + } + JsonObjectBuilder result = Json.createObjectBuilder(); + result.add("path", page.path); + result.add("items", items); + if (page.nextCursor != null) { + result.add("nextCursor", page.nextCursor); + } else { + result.addNull("nextCursor"); + } + result.add("limit", page.limit); + result.add("order", page.order.wireValue()); + result.add("include", page.include.name().toLowerCase(Locale.ROOT)); + result.add("approximateCount", page.approximateCount); + return result; + } + @GET @AuthRequired @Path("{id}/download/count") diff --git a/src/main/java/edu/harvard/iq/dataverse/dataaccess/S3AccessIO.java b/src/main/java/edu/harvard/iq/dataverse/dataaccess/S3AccessIO.java index 6d3fe205639..660768e2b60 100644 --- a/src/main/java/edu/harvard/iq/dataverse/dataaccess/S3AccessIO.java +++ b/src/main/java/edu/harvard/iq/dataverse/dataaccess/S3AccessIO.java @@ -1138,6 +1138,12 @@ public JsonObjectBuilder generateTemporaryS3UploadUrls(String globalId, String s s3Presigner.close(); } + final boolean taggingDisabled = JvmSettings.DISABLE_S3_TAGGING.lookupOptional(Boolean.class, this.driverId) + .orElse(false); + if (!taggingDisabled) { + response.add("tagging", "dv-state=temp"); + } + response.add("partSize", minPartSize); return response; diff --git a/src/main/java/edu/harvard/iq/dataverse/datasetversiontree/DatasetVersionTreeService.java b/src/main/java/edu/harvard/iq/dataverse/datasetversiontree/DatasetVersionTreeService.java new file mode 100644 index 00000000000..2bcc987bd3f --- /dev/null +++ b/src/main/java/edu/harvard/iq/dataverse/datasetversiontree/DatasetVersionTreeService.java @@ -0,0 +1,674 @@ +package edu.harvard.iq.dataverse.datasetversiontree; + +import edu.harvard.iq.dataverse.DatasetVersion; +import jakarta.ejb.Stateless; +import jakarta.json.Json; +import jakarta.json.JsonArray; +import jakarta.json.JsonException; +import jakarta.json.JsonNumber; +import jakarta.json.JsonObject; +import jakarta.json.JsonReader; +import jakarta.json.JsonString; +import jakarta.json.JsonValue; +import jakarta.persistence.EntityManager; +import jakarta.persistence.PersistenceContext; +import jakarta.persistence.Query; + +import java.io.StringReader; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Base64; +import java.util.List; +import java.util.Locale; +import java.util.Objects; + +/** + * Computes a single page of folders+files inside a folder of a dataset version. + * + * Uses two native SQL queries against the {@code filemetadata} table — a + * {@code GROUP BY} on the prefix-stripped {@code directorylabel} for the + * folder rows and a keyset-ordered scan of the rows whose + * {@code directorylabel} matches the requested path for the file rows. + * Both queries are driven by the same covering index + * {@code ix_filemetadata_tree(datasetversion_id, directorylabel, + * lower(label), datafile_id)} added in Flyway migration {@code V6.10.1.2}. + * + * Wire format and cursor *behaviour* are stable across the in-memory and + * SQL implementations: {@code nextCursor} stays opaque to clients (clients + * echo it back), and {@code Order} / {@code Include} keep the same wire + * values. + * + * Folders come first (ascending or descending by name), then files (same + * ordering with a stable {@code datafile_id} tie-break). + */ +@Stateless +public class DatasetVersionTreeService { + + public static final int DEFAULT_LIMIT = 100; + public static final int MAX_LIMIT = 1000; + + @PersistenceContext(unitName = "VDCNet-ejbPU") + private EntityManager em; + + public enum Include { + ALL, FOLDERS, FILES; + + public static Include fromQuery(String value) { + if (value == null) { + return ALL; + } + try { + return Include.valueOf(value.toUpperCase(Locale.ROOT)); + } catch (IllegalArgumentException ex) { + throw new InvalidQueryException("invalid include: " + value); + } + } + } + + public enum Order { + NAME_AZ, NAME_ZA; + + public static Order fromQuery(String value) { + if (value == null) { + return NAME_AZ; + } + switch (value) { + case "NameAZ": + return NAME_AZ; + case "NameZA": + return NAME_ZA; + default: + throw new InvalidQueryException("invalid order: " + value); + } + } + + public String wireValue() { + return this == NAME_AZ ? "NameAZ" : "NameZA"; + } + } + + public static class InvalidQueryException extends RuntimeException { + public InvalidQueryException(String message) { + super(message); + } + } + + public static class TreePage { + public final String path; + public final List items; + public final String nextCursor; + public final int limit; + public final Order order; + public final Include include; + public final int approximateCount; + + public TreePage(String path, List items, String nextCursor, + int limit, Order order, Include include, int approximateCount) { + this.path = path; + this.items = items; + this.nextCursor = nextCursor; + this.limit = limit; + this.order = order; + this.include = include; + this.approximateCount = approximateCount; + } + } + + public abstract static class TreeItem { + public final String type; + public final String name; + public final String path; + + protected TreeItem(String type, String name, String path) { + this.type = type; + this.name = name; + this.path = path; + } + } + + public static class FolderItem extends TreeItem { + public final long fileCount; + public final long folderCount; + /** + * Total bytes of all files in this folder's subtree (recursive, + * matching {@link #fileCount}). Computed from {@code df.filesize}, + * i.e. the size of the bytes the default {@code downloadUrl} would + * serve — for ingested tabular files that's the converted TSV, not + * the original upload. Useful as a "downloading this folder = N GB" + * UX hint; not authoritative under {@code originals=true}. + */ + public final long bytes; + /** + * Files in the subtree marked {@code df.restricted = true}. + * Mutually exclusive with {@link #embargoedCount} — a row hits + * the restricted bucket first, mirroring the per-file + * {@code access} string. + */ + public final long restrictedCount; + /** + * Files in the subtree that are NOT restricted but carry an + * embargo whose {@code dateavailable} is still in the future + * (the same active-embargo predicate the per-file query uses). + * "Public" count is implied: {@code fileCount - restrictedCount + * - embargoedCount}. + */ + public final long embargoedCount; + + public FolderItem(String name, String path, + long fileCount, long folderCount, long bytes, + long restrictedCount, long embargoedCount) { + super("folder", name, path); + this.fileCount = fileCount; + this.folderCount = folderCount; + this.bytes = bytes; + this.restrictedCount = restrictedCount; + this.embargoedCount = embargoedCount; + } + } + + public static class FileItem extends TreeItem { + public final long id; + public final long size; + public final String contentType; + public final String access; + public final String checksumType; + public final String checksumValue; + public final String downloadUrl; + + public FileItem(long id, String name, String path, long size, + String contentType, String access, + String checksumType, String checksumValue, + String downloadUrl) { + super("file", name, path); + this.id = id; + this.size = size; + this.contentType = contentType; + this.access = access; + this.checksumType = checksumType; + this.checksumValue = checksumValue; + this.downloadUrl = downloadUrl; + } + } + + // ---------- Cursor --------------------------------------------------- + + /** + * Opaque keyset cursor. Encoded as Base64-URL'd JSON; clients echo + * back the raw string. The {@code phase} marker tells the server + * whether the next page continues mid-folder-list or has crossed into + * the file list; {@code keys} carries either the last folder name or + * the {@code (lower(label), datafile_id)} pair from the previous page. + */ + record TreeCursor(Phase phase, String lastFolderName, String lastFileLabelLower, Long lastFileId) { + enum Phase { FOLDERS, FILES } + + static TreeCursor folders(String lastFolderName) { + return new TreeCursor(Phase.FOLDERS, lastFolderName, null, null); + } + + static TreeCursor files(String lastFileLabelLower, long lastFileId) { + return new TreeCursor(Phase.FILES, null, lastFileLabelLower, lastFileId); + } + } + + // ---------- Public entry point -------------------------------------- + + public TreePage listChildren(DatasetVersion version, String rawPath, + Integer limitParam, String cursorParam, + Include include, Order order, boolean originals) { + Objects.requireNonNull(version); + String path = normalizePath(rawPath); + int limit = clampLimit(limitParam); + TreeCursor cursor = decodeCursor(cursorParam); + + long versionId = version.getId(); + + int remaining = limit; + boolean hasMoreFolders = false; + List folderRows = new ArrayList<>(); + List fileRows = new ArrayList<>(); + String nextCursor = null; + + // ---- folders ---------------------------------------------------- + if (include != Include.FILES && (cursor == null || cursor.phase() == TreeCursor.Phase.FOLDERS)) { + String afterFolderName = cursor == null ? null : cursor.lastFolderName(); + List rows = runFolderQuery(versionId, path, remaining + 1, afterFolderName, order); + int take = Math.min(remaining, rows.size()); + hasMoreFolders = rows.size() > remaining; + folderRows = rows.subList(0, take); + remaining -= take; + if (hasMoreFolders) { + nextCursor = encodeCursor(TreeCursor.folders(folderRows.get(take - 1).name)); + } + } + + // ---- files (same page if folders left room) --------------------- + if (remaining > 0 && include != Include.FOLDERS && !hasMoreFolders) { + String afterLabelLower = null; + Long afterId = null; + if (cursor != null && cursor.phase() == TreeCursor.Phase.FILES) { + afterLabelLower = cursor.lastFileLabelLower(); + afterId = cursor.lastFileId(); + } + List rows = runFileQuery(versionId, path, remaining + 1, afterLabelLower, afterId, order, originals); + int take = Math.min(remaining, rows.size()); + boolean hasMoreFiles = rows.size() > remaining; + fileRows = rows.subList(0, take); + if (hasMoreFiles) { + FileItem last = fileRows.get(take - 1); + nextCursor = encodeCursor(TreeCursor.files(last.name.toLowerCase(Locale.ROOT), last.id)); + } + } + + List out = new ArrayList<>(folderRows.size() + fileRows.size()); + out.addAll(folderRows); + out.addAll(fileRows); + + int approximateCount = countFolders(versionId, path) + countFiles(versionId, path); + + return new TreePage(path, out, nextCursor, limit, order, include, approximateCount); + } + + // ---------- Folder query -------------------------------------------- + + @SuppressWarnings("unchecked") + private List runFolderQuery(long versionId, String path, int limit, + String afterFolderName, Order order) { + // For the root case we strip nothing off the front of directorylabel; + // for a nested path we strip "/". The substring offset is + // 1-indexed in Postgres, so the +1 is for the index and the "/" is + // implicit in the LIKE pattern below. + // + // We use positional ?N parameters (not :name) because EclipseLink's + // native-query parameter substitution requires the JPA positional + // form; named parameters reach Postgres unsubstituted and produce + // "syntax error at or near ':'". This matches the convention used + // by every other native query in the codebase. + boolean root = path.isEmpty(); + int substringFrom = root ? 1 : path.length() + 2; // 1-indexed; +1 for index, +1 for '/' + + StringBuilder sql = new StringBuilder(); + List params = new ArrayList<>(); + sql.append("SELECT split_part(substring(fm.directorylabel FROM ").append(substringFrom).append("), '/', 1) AS folder_name, "); + sql.append(" COUNT(*) AS files_under, "); + sql.append(" COUNT(DISTINCT split_part(substring(fm.directorylabel FROM ").append(substringFrom).append("), '/', 2)) "); + sql.append(" FILTER (WHERE position('/' IN substring(fm.directorylabel FROM ").append(substringFrom).append(")) > 0) AS subfolder_count, "); + // SUM forces a heap visit on `datafile` for `filesize` (the covering + // index `ix_filemetadata_tree` carries `datafile_id` but not + // `filesize`). For typical version sizes this is sub-second; the + // planner usually picks a hash join on `datafile_id`. If a future + // perf issue surfaces on very large versions, consider an + // INCLUDE(filesize) index on `datafile(id)` so the join becomes + // index-only. + sql.append(" COALESCE(SUM(df.filesize), 0) AS bytes_under, "); + // Per-access counts mirror the per-file `access` resolution: a + // restricted file always counts as restricted (even if it also + // carries an active embargo), and only non-restricted files with + // an active embargo count as embargoed. The "public" count is + // implied: files_under - restricted_count - embargoed_count. + sql.append(" SUM(CASE WHEN df.restricted THEN 1 ELSE 0 END) AS restricted_count, "); + sql.append(" SUM(CASE WHEN NOT df.restricted "); + sql.append(" AND df.embargo_id IS NOT NULL "); + sql.append(" AND e.dateavailable > current_date THEN 1 ELSE 0 END) AS embargoed_count "); + sql.append("FROM filemetadata fm JOIN datafile df ON df.id = fm.datafile_id "); + // Small, FK-indexed; hash join in practice. + sql.append(" LEFT JOIN embargo e ON df.embargo_id = e.id "); + sql.append("WHERE fm.datasetversion_id = ?").append(params.size() + 1).append(" "); + params.add(versionId); + if (root) { + sql.append(" AND fm.directorylabel IS NOT NULL AND fm.directorylabel <> '' "); + } else { + // LIKE with the user-provided path needs to escape SQL wildcard + // characters, otherwise a folder named `a_b` would also match + // `axb/...`, and `%foo` would match arbitrary prefixes — both + // crossing into sibling subtrees. Escape `\`, `%`, `_` and add + // an explicit ESCAPE clause; PostgreSQL's default escape char is + // already `\`, but stating it makes the contract local. + sql.append(" AND fm.directorylabel LIKE ?").append(params.size() + 1).append(" ESCAPE '\\' "); + params.add(escapeLikePattern(path) + "/%"); + } + if (afterFolderName != null) { + // Two-key keyset comparison. Folder names are aggregations, so + // there's no per-row id to break ties on; siblings whose names + // differ only in case (`Data/` vs `data/`) collide on the + // primary `lower(name)` ordering. We add the case-sensitive + // name as a deterministic secondary key. The matching ORDER BY + // below carries the same `(lower, cs)` tuple so the keyset + // walk is stable. + String cmp = order == Order.NAME_ZA ? "<" : ">"; + sql.append(" AND (lower(split_part(substring(fm.directorylabel FROM ").append(substringFrom).append("), '/', 1)) ").append(cmp).append(" ?").append(params.size() + 1) + .append(" OR (lower(split_part(substring(fm.directorylabel FROM ").append(substringFrom).append("), '/', 1)) = ?").append(params.size() + 1) + .append(" AND split_part(substring(fm.directorylabel FROM ").append(substringFrom).append("), '/', 1) ").append(cmp).append(" ?").append(params.size() + 2).append(")) "); + params.add(afterFolderName.toLowerCase(Locale.ROOT)); + params.add(afterFolderName); + } + // Repeat the expression in GROUP BY / ORDER BY rather than referring + // to the `folder_name` SELECT alias. PostgreSQL allows the bare + // alias in GROUP BY (extension) but does NOT allow it inside an + // expression in ORDER BY — `ORDER BY lower(folder_name)` errors + // with `column "folder_name" does not exist`. Repeating the + // expression is also SQL-spec-clean. + sql.append("GROUP BY split_part(substring(fm.directorylabel FROM ").append(substringFrom).append("), '/', 1) "); + String dir = order == Order.NAME_ZA ? "DESC" : "ASC"; + sql.append("ORDER BY lower(split_part(substring(fm.directorylabel FROM ").append(substringFrom).append("), '/', 1)) ").append(dir).append(", "); + sql.append(" split_part(substring(fm.directorylabel FROM ").append(substringFrom).append("), '/', 1) ").append(dir).append(" "); + sql.append("LIMIT ?").append(params.size() + 1); + params.add(limit); + + Query q = em.createNativeQuery(sql.toString()); + for (int i = 0; i < params.size(); i++) { + q.setParameter(i + 1, params.get(i)); + } + + List rows = q.getResultList(); + List out = new ArrayList<>(rows.size()); + for (Object[] row : rows) { + String folderName = (String) row[0]; + long filesUnder = ((Number) row[1]).longValue(); + long subfolderCount = ((Number) row[2]).longValue(); + // COALESCE in the SUM guarantees this is non-null, but the + // null-safe read keeps us robust if a driver ever surfaces 0 + // rows in a way that bypasses the COALESCE. + long bytesUnder = row[3] == null ? 0L : ((Number) row[3]).longValue(); + long restrictedUnder = row[4] == null ? 0L : ((Number) row[4]).longValue(); + long embargoedUnder = row[5] == null ? 0L : ((Number) row[5]).longValue(); + String folderPath = root ? folderName : path + "/" + folderName; + out.add(new FolderItem(folderName, folderPath, + filesUnder, subfolderCount, bytesUnder, + restrictedUnder, embargoedUnder)); + } + return out; + } + + // ---------- File query ---------------------------------------------- + + @SuppressWarnings("unchecked") + private List runFileQuery(long versionId, String path, int limit, + String afterLabelLower, Long afterId, + Order order, boolean originals) { + boolean root = path.isEmpty(); + + // Positional ?N parameters per the EclipseLink native-query convention; + // see the comment in `runFolderQuery` for why named parameters cannot + // be used here. + StringBuilder sql = new StringBuilder(); + List params = new ArrayList<>(); + // The `originals` flag is bound first so the CASE expression in the + // SELECT clause can refer to it as ?1 without depending on the rest of + // the parameter assembly. We use it twice to gate both checksum + // columns symmetrically — see the comment on the CASE expressions. + int originalsSlot = params.size() + 1; + params.add(originals); + // The `actively_embargoed` boolean mirrors `FileUtil.isActivelyEmbargoed`: + // an embargo row whose `dateavailable` is strictly after today still + // restricts access; a row whose date has already passed does not. + // Without this comparison the tree would mark files as `embargoed` + // forever once an embargo row is attached, contradicting how the + // rest of Dataverse renders the same files. + sql.append("SELECT fm.label, df.id, df.filesize, df.contenttype, df.restricted, "); + sql.append(" (df.embargo_id IS NOT NULL AND e.dateavailable > current_date) AS actively_embargoed, "); + // For ingested tabular files (those with an associated `datatable` row), + // `df.checksumvalue` is the digest of the *original upload* — Dataverse + // never persists a digest of the converted TSV that the default + // `downloadUrl` actually serves. Returning that digest as `checksum` + // would silently lie to clients that try to verify the bytes they + // receive. To keep the contract honest, both checksum fields are + // NULLed for ingested-tabular rows whose `downloadUrl` resolves to + // the converted form. When `originals=true` the URL switches to + // `?format=original`, which serves the saved-original auxiliary blob; + // that file's bytes match `df.checksumvalue` so we keep the digest. + sql.append(" CASE WHEN dt.id IS NOT NULL AND NOT ?").append(originalsSlot).append(" THEN NULL ELSE df.checksumtype END, "); + sql.append(" CASE WHEN dt.id IS NOT NULL AND NOT ?").append(originalsSlot).append(" THEN NULL ELSE df.checksumvalue END "); + sql.append("FROM filemetadata fm JOIN datafile df ON fm.datafile_id = df.id "); + sql.append(" LEFT JOIN embargo e ON df.embargo_id = e.id "); + // Single LEFT JOIN on `datatable.datafile_id` (already FK-indexed). + // The join exists on the file's row regardless of cursor / ordering, + // so it does not break the keyset's index plan. + sql.append(" LEFT JOIN datatable dt ON dt.datafile_id = df.id "); + sql.append("WHERE fm.datasetversion_id = ?").append(params.size() + 1).append(" "); + params.add(versionId); + if (root) { + sql.append(" AND (fm.directorylabel IS NULL OR fm.directorylabel = '') "); + } else { + sql.append(" AND fm.directorylabel = ?").append(params.size() + 1).append(" "); + params.add(path); + } + if (afterLabelLower != null && afterId != null) { + String cmp = order == Order.NAME_ZA ? "<" : ">"; + // Standard tuple-keyset pattern: (lower(label), datafile_id) compared lexicographically. + // afterLabel needs two positional slots — the value is the same in both, but EclipseLink's + // native-query binding wants each occurrence as its own ?N. + int afterLabelLeft = params.size() + 1; + params.add(afterLabelLower); + int afterLabelRight = params.size() + 1; + params.add(afterLabelLower); + int afterIdSlot = params.size() + 1; + params.add(afterId); + sql.append(" AND (lower(fm.label) ").append(cmp).append(" ?").append(afterLabelLeft).append(" "); + sql.append(" OR (lower(fm.label) = ?").append(afterLabelRight).append(" AND df.id ").append(cmp).append(" ?").append(afterIdSlot).append(")) "); + } + sql.append("ORDER BY lower(fm.label) ").append(order == Order.NAME_ZA ? "DESC" : "ASC") + .append(", df.id ").append(order == Order.NAME_ZA ? "DESC" : "ASC").append(" "); + sql.append("LIMIT ?").append(params.size() + 1); + params.add(limit); + + Query q = em.createNativeQuery(sql.toString()); + for (int i = 0; i < params.size(); i++) { + q.setParameter(i + 1, params.get(i)); + } + + List rows = q.getResultList(); + List out = new ArrayList<>(rows.size()); + for (Object[] row : rows) { + String label = (String) row[0]; + long id = ((Number) row[1]).longValue(); + long size = row[2] == null ? 0L : ((Number) row[2]).longValue(); + String contentType = (String) row[3]; + Boolean restricted = (Boolean) row[4]; + Boolean activelyEmbargoed = (Boolean) row[5]; + String checksumTypeRaw = (String) row[6]; + String checksumValue = (String) row[7]; + + String access; + if (Boolean.TRUE.equals(restricted)) { + access = "restricted"; + } else if (Boolean.TRUE.equals(activelyEmbargoed)) { + access = "embargoed"; + } else { + access = "public"; + } + String checksumType = checksumTypeRaw; // stored as the enum name already + String filePath = root ? label : path + "/" + label; + String downloadUrl = "/api/access/datafile/" + id + (originals ? "?format=original" : ""); + + out.add(new FileItem(id, label, filePath, size, contentType, access, checksumType, checksumValue, downloadUrl)); + } + return out; + } + + // ---------- Counts (for approximateCount on the page envelope) ------- + + private int countFolders(long versionId, String path) { + boolean root = path.isEmpty(); + int substringFrom = root ? 1 : path.length() + 2; + + StringBuilder sql = new StringBuilder(); + sql.append("SELECT COUNT(DISTINCT split_part(substring(fm.directorylabel FROM ").append(substringFrom).append("), '/', 1)) "); + sql.append("FROM filemetadata fm "); + sql.append("WHERE fm.datasetversion_id = ?1 "); + if (root) { + sql.append(" AND fm.directorylabel IS NOT NULL AND fm.directorylabel <> '' "); + } else { + // See `runFolderQuery` — LIKE wildcards in the path must be escaped + // or `a_b` cross-matches sibling `axb/...` etc. + sql.append(" AND fm.directorylabel LIKE ?2 ESCAPE '\\' "); + } + + Query q = em.createNativeQuery(sql.toString()); + q.setParameter(1, versionId); + if (!root) { + q.setParameter(2, escapeLikePattern(path) + "/%"); + } + Number n = (Number) q.getSingleResult(); + return n == null ? 0 : n.intValue(); + } + + /** + * Escapes the three characters PostgreSQL's `LIKE` operator treats + * specially when the default escape character (`\`) is in effect: `\`, + * `%`, `_`. Folder names in `directorylabel` are user-controlled, + * and we use them as the literal prefix of a `LIKE ? + '/%'` pattern, + * so any of those characters would otherwise expand the matched + * subtree past what the cursor describes. + */ + static String escapeLikePattern(String s) { + if (s == null || s.isEmpty()) { + return s; + } + StringBuilder out = new StringBuilder(s.length() + 4); + for (int i = 0; i < s.length(); i++) { + char c = s.charAt(i); + if (c == '\\' || c == '%' || c == '_') { + out.append('\\'); + } + out.append(c); + } + return out.toString(); + } + + private int countFiles(long versionId, String path) { + boolean root = path.isEmpty(); + + StringBuilder sql = new StringBuilder(); + sql.append("SELECT COUNT(*) FROM filemetadata fm "); + sql.append("WHERE fm.datasetversion_id = ?1 "); + if (root) { + sql.append(" AND (fm.directorylabel IS NULL OR fm.directorylabel = '') "); + } else { + sql.append(" AND fm.directorylabel = ?2 "); + } + + Query q = em.createNativeQuery(sql.toString()); + q.setParameter(1, versionId); + if (!root) { + q.setParameter(2, path); + } + Number n = (Number) q.getSingleResult(); + return n == null ? 0 : n.intValue(); + } + + // ---------- Path normalisation -------------------------------------- + + public static String normalizePath(String raw) { + if (raw == null) { + return ""; + } + String collapsed = raw.replaceAll("/+", "/"); + if (collapsed.startsWith("/")) { + collapsed = collapsed.substring(1); + } + if (collapsed.endsWith("/")) { + collapsed = collapsed.substring(0, collapsed.length() - 1); + } + return collapsed; + } + + private static int clampLimit(Integer requested) { + if (requested == null || requested <= 0) { + return DEFAULT_LIMIT; + } + return Math.min(requested, MAX_LIMIT); + } + + // ---------- Cursor encoding ----------------------------------------- + // + // Wire shape: Base64-URL'd JSON. The format is opaque to clients — + // they only echo it back. Round-trip stability is asserted by the + // keyset IT. + + // Wire-format markers for the cursor's phase. Spelled out in full so a + // proxy that case-folds query strings (or someone hand-editing a cursor + // for debugging) can't silently swap one phase for the other; an + // unrecognised value falls through to the generic "invalid cursor" path. + private static final String CURSOR_PHASE_FOLDERS = "FOLDERS"; + private static final String CURSOR_PHASE_FILES = "FILES"; + + private static String encodeCursor(TreeCursor cursor) { + // Tiny hand-rolled JSON; pulling Jackson here would be overkill + // for two strings + a long. + StringBuilder json = new StringBuilder(); + json.append("{\"p\":\""); + json.append(cursor.phase() == TreeCursor.Phase.FOLDERS ? CURSOR_PHASE_FOLDERS : CURSOR_PHASE_FILES); + json.append("\",\"k\":["); + if (cursor.phase() == TreeCursor.Phase.FOLDERS) { + json.append('"').append(escapeJson(cursor.lastFolderName())).append('"'); + } else { + json.append('"').append(escapeJson(cursor.lastFileLabelLower())).append('"'); + json.append(',').append(cursor.lastFileId()); + } + json.append("]}"); + return Base64.getUrlEncoder().withoutPadding() + .encodeToString(json.toString().getBytes(StandardCharsets.UTF_8)); + } + + private static TreeCursor decodeCursor(String raw) { + if (raw == null || raw.isEmpty()) { + return null; + } + try { + String decoded = new String(Base64.getUrlDecoder().decode(raw), StandardCharsets.UTF_8); + try (JsonReader reader = Json.createReader(new StringReader(decoded))) { + JsonObject obj = reader.readObject(); + String phaseStr = obj.getString("p", null); + JsonArray keys = obj.getJsonArray("k"); + if (phaseStr == null || keys == null) { + throw new InvalidQueryException("invalid cursor"); + } + if (CURSOR_PHASE_FOLDERS.equals(phaseStr) && keys.size() == 1) { + return TreeCursor.folders(((JsonString) keys.get(0)).getString()); + } + if (CURSOR_PHASE_FILES.equals(phaseStr) && keys.size() == 2) { + String label = ((JsonString) keys.get(0)).getString(); + long id = ((JsonValue) keys.get(1)) instanceof JsonNumber n + ? n.longValueExact() + : Long.parseLong(keys.get(1).toString()); + return TreeCursor.files(label, id); + } + throw new InvalidQueryException("invalid cursor"); + } + } catch (IllegalArgumentException | JsonException ex) { + throw new InvalidQueryException("invalid cursor"); + } + } + + private static String escapeJson(String s) { + // Minimal JSON-string escape. directorylabel / label come from + // user-controlled text so we do need this to be correct. + StringBuilder out = new StringBuilder(s.length() + 4); + for (int i = 0; i < s.length(); i++) { + char c = s.charAt(i); + switch (c) { + case '"': + case '\\': + out.append('\\').append(c); + break; + case '\n': + out.append("\\n"); + break; + case '\r': + out.append("\\r"); + break; + case '\t': + out.append("\\t"); + break; + default: + if (c < 0x20) { + out.append(String.format(Locale.ROOT, "\\u%04x", (int) c)); + } else { + out.append(c); + } + } + } + return out.toString(); + } +} diff --git a/src/main/java/edu/harvard/iq/dataverse/settings/FeatureFlags.java b/src/main/java/edu/harvard/iq/dataverse/settings/FeatureFlags.java index e1c7e69f7db..7bb9962cb5a 100644 --- a/src/main/java/edu/harvard/iq/dataverse/settings/FeatureFlags.java +++ b/src/main/java/edu/harvard/iq/dataverse/settings/FeatureFlags.java @@ -30,6 +30,31 @@ public enum FeatureFlags { * @since Dataverse 5.14 */ API_SESSION_AUTH("api-session-auth"), + /** + * Enables the React-based file uploader in the JSF dataset file upload area. + * This is an experimental replacement for the classic PrimeFaces upload UI. + * Requires {@link #API_SESSION_AUTH} to be enabled. The React bundle must + * also be reachable from the browser at + * /reusable-components/dv-uploader.js (by default, the + * pre-built bundle baked into the WAR is served same-origin). + * + * @apiNote Raise flag by setting "dataverse.feature.react-uploader" + * @since Dataverse 6.11 + */ + REACT_UPLOADER("react-uploader"), + /** + * Enables the React-based file tree view in the JSF dataset Files tab. + * Renders the same lazy, paginated tree component the SPA uses, mounted + * directly into the JSF page. Requires {@link #API_SESSION_AUTH} to be + * enabled and the React bundle to be reachable from the browser at + * /reusable-components/dv-tree-view.js by default — the + * base URL is overridable via + * dataverse.reusable-components.base-url. + * + * @apiNote Raise flag by setting "dataverse.feature.react-tree-view" + * @since Dataverse 6.11 + */ + REACT_TREE_VIEW("react-tree-view"), /** * Enables API authentication via Bearer Token. * @apiNote Raise flag by setting "dataverse.feature.api-bearer-auth" diff --git a/src/main/java/edu/harvard/iq/dataverse/settings/JvmSettings.java b/src/main/java/edu/harvard/iq/dataverse/settings/JvmSettings.java index ed0d796a84a..1bc0a07dfc0 100644 --- a/src/main/java/edu/harvard/iq/dataverse/settings/JvmSettings.java +++ b/src/main/java/edu/harvard/iq/dataverse/settings/JvmSettings.java @@ -43,7 +43,8 @@ public enum JvmSettings { BUILD(PREFIX, "build"), FQDN(PREFIX, "fqdn"), SITE_URL(PREFIX, "siteUrl"), - + REUSABLE_COMPONENTS_BASE_URL(PREFIX, "reusable-components.base-url"), + // FILES SETTINGS SCOPE_FILES(PREFIX, "files"), FILES_DIRECTORY(SCOPE_FILES, "directory"), diff --git a/src/main/java/edu/harvard/iq/dataverse/util/SystemConfig.java b/src/main/java/edu/harvard/iq/dataverse/util/SystemConfig.java index a3596850b44..4e79f0865eb 100644 --- a/src/main/java/edu/harvard/iq/dataverse/util/SystemConfig.java +++ b/src/main/java/edu/harvard/iq/dataverse/util/SystemConfig.java @@ -8,6 +8,7 @@ import edu.harvard.iq.dataverse.authorization.AuthenticationServiceBean; import edu.harvard.iq.dataverse.authorization.providers.builtin.BuiltinAuthenticationProvider; import edu.harvard.iq.dataverse.authorization.providers.oauth2.AbstractOAuth2AuthenticationProvider; +import edu.harvard.iq.dataverse.settings.FeatureFlags; import edu.harvard.iq.dataverse.settings.JvmSettings; import edu.harvard.iq.dataverse.settings.SettingsServiceBean; import edu.harvard.iq.dataverse.validation.PasswordValidatorUtil; @@ -16,6 +17,7 @@ import jakarta.ejb.EJB; import jakarta.ejb.Stateless; +import jakarta.faces.context.FacesContext; import jakarta.inject.Named; import jakarta.json.Json; import jakarta.json.JsonArray; @@ -23,6 +25,7 @@ import jakarta.json.JsonReader; import jakarta.json.JsonString; import jakarta.json.JsonValue; +import java.io.File; import java.io.StringReader; import java.net.InetAddress; import java.net.UnknownHostException; @@ -245,7 +248,138 @@ public static int getMinutesUntilPasswordResetTokenExpires() { public String getDataverseSiteUrl() { return getDataverseSiteUrlStatic(); } - + + public boolean isReactUploaderEnabled() { + return FeatureFlags.REACT_UPLOADER.enabled(); + } + + public boolean isReactTreeViewEnabled() { + return FeatureFlags.REACT_TREE_VIEW.enabled(); + } + + /** + * Returns the base URL from which the Dataverse reusable React component + * bundles (e.g. {@code dv-uploader.js}) are loaded. The default value + * {@code /reusable-components} serves the pre-built bundle that ships + * inside the Dataverse WAR (under + * {@code webapp/reusable-components/}), same-origin. + * + *

Operators can override this with the JVM setting + * {@code dataverse.reusable-components.base-url} to point at any URL + * where they have re-hosted the bundle files (separate static-file + * server, CDN, etc.). + * + *

Trailing slashes are trimmed so the resulting JSF script source is + * well-formed regardless of the operator's input. + * + * @return The reusable-components base URL, without a trailing slash. + */ + public String getReusableComponentsBaseUrl() { + String configured = JvmSettings.REUSABLE_COMPONENTS_BASE_URL.lookupOptional() + .orElse("/reusable-components"); + // Defensive sanity check: an operator-supplied URL is rendered + // verbatim into a JSF ` in user input. + String json = Json.createValue(raw).toString(); + return json.replace(" - - - - - - - - - - - + + +

#{bundle['dataset.create.uploadFilesAfterSave']}

+ + + + + + + + + + + + + + diff --git a/src/main/webapp/editFilesFragment.xhtml b/src/main/webapp/editFilesFragment.xhtml index 86879c7ef91..62aa27fe963 100644 --- a/src/main/webapp/editFilesFragment.xhtml +++ b/src/main/webapp/editFilesFragment.xhtml @@ -29,6 +29,7 @@ + @@ -49,24 +50,53 @@
- - + +

- +

+ + + +
+ + +
+
- -
+ +
@@ -130,6 +160,21 @@

+ + + + + + + @@ -666,5 +700,5 @@ (#{node.dataFile.friendlySize}) - + diff --git a/src/main/webapp/reusable-components/chunks/dataverse-shared-Dck3wcoA.js b/src/main/webapp/reusable-components/chunks/dataverse-shared-Dck3wcoA.js new file mode 100644 index 00000000000..c2e0a89f015 --- /dev/null +++ b/src/main/webapp/reusable-components/chunks/dataverse-shared-Dck3wcoA.js @@ -0,0 +1,137 @@ +var dy=Object.defineProperty;var uy=(t,e,n)=>e in t?dy(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Ut=(t,e,n)=>uy(t,typeof e!="symbol"?e+"":e,n);import{r as g,j as T,R as A,a as xn}from"./react-Dtf48RLW.js";import{u as $t}from"./i18n-CMHgdAUi.js";import{m as py,S as fy,w as hy,a as my,d as De,E as gy,P as Ud,c as Hd,X as yy,y as lt,u as Hl,C as Kl,I as vy,e as by,f as xy,g as tf,F as wy,h as Ey}from"./vendor-DReq5CoA.js";const _n={"application/pdf":"Adobe PDF","image/pdf":"Adobe PDF","text/pdf":"Adobe PDF","application/x-pdf":"Adobe PDF","application/cnt":"Windows Help Contents File","application/msword":"MS Word","application/vnd.ms-excel":"MS Excel Spreadsheet","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"MS Excel Spreadsheet","application/vnd.ms-powerpoint":"MS Powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation":"MS Powerpoint","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"MS Word","application/vnd.oasis.opendocument.spreadsheet":"OpenOffice Spreadsheet","application/vnd.ms-excel.sheet.macroenabled.12":"MS Excel Spreadsheet","text/plain":"Plain Text","text/x-log":"Application Log","text/html":"HTML","application/x-tex":"LaTeX","text/x-tex":"LaTeX","text/markdown":"Markdown Text","text/x-markdown":"Markdown Text","text/x-r-markdown":"R Markdown Text","application/rtf":"Rich Text Format","text/x-rst":"reStructuredText","text/rtf":"Rich Text Format","text/richtext":"Rich Text Format","text/turtle":"Turtle RDF","application/xml":"XML","text/xml":"XML","text/x-c":"C++ Source","text/x-c++src":"C++ Source","text/css":"Cascading Style Sheet","text/x-fortran":"Fortran Source Code","application/java-vm":"Java Class","text/x-java-source":"Java Source Code","text/javascript":"Javascript Code","application/javascript":"Javascript Code","application/x-javascript":"Javascript Code","text/x-matlab":"MATLAB Source Code","text/x-mathematica":"Mathematica Input","text/x-objcsrc":"Objective-C Source Code","text/x-pascal":"Pascal Source Code","text/x-perl":"Perl Script","text/x-perl-script":"Perl Script","text/php":"PHP Source Code","application/postscript":"Postscript","text/x-python":"Python Source Code","text/x-python-script":"Python Source Code","text/x-r-source":"R Source Code","text/x-sh":"Shell Script","application/x-sh":"Shell Script","application/x-shellscript":"Shell Script","application/x-sql":"SQL Code","text/x-sql":"SQL Code","application/x-swc":"Shockwave Flash Component","application/x-msdownload":"Windows Executable","application/x-ipynb+json":"Jupyter Notebook","application/x-stata-ado":"Stata Ado Script","application/x-stata-do":"Stata Do Script","application/x-stata-dta":"Stata Data Script","application/x-stata-smcl":"Stata Markup and Control Language","text/x-stata-syntax":"Stata Syntax","application/x-stata-syntax":"Stata Syntax","text/x-spss-syntax":"SPSS Syntax","application/x-spss-syntax":"SPSS Syntax","application/x-spss-sps":"SPSS Script Syntax","text/x-sas-syntax":"SAS Syntax","application/x-sas-syntax":"SAS Syntax","type/x-r-syntax":"R Syntax","application/vnd.wolfram.mathematica.package":"Wolfram Mathematica Code","application/vnd.wolfram.mathematica":"Wolfram Mathematica Code","text/x-workflow-description-language":"Workflow Description Language","text/x-computational-workflow-language":"Computational Workflow Language","text/x-nextflow":"Nextflow Script","text/x-r-notebook":"R Notebook","text/x-ruby-script":"Ruby Source Code","text/x-dagman":"DAGMan Workflow","text/x-makefile":"Makefile Script","text/x-snakemake":"Snakemake Workflow","text/tab-separated-values":"Tab-Delimited","text/tsv":"Tab-Separated Values","text/comma-separated-values":"Comma Separated Values","text/x-comma-separated-values":"Comma Separated Values","text/csv":"Comma Separated Values","text/x-fixed-field":"Fixed Field Text Data","application/vnd.flographit":"FloGraphIt Media","application/x-r-data":"R Data","application/x-rlang-transport":"R Data","application/x-R-2":"R Binary","application/x-stata":"Stata Binary","application/x-stata-6":"Stata Binary","application/x-stata-13":"Stata 13 Binary","application/x-stata-14":"Stata 14 Binary","application/x-stata-15":"Stata 15 Binary","application/x-spss-por":"SPSS Portable","application/x-spss-portable":"SPSS Portable","application/x-spss-sav":"SPSS Binary","application/x-sas":"SAS","application/x-sas-transport":"SAS Transport","application/x-sas-system":"SAS System","application/x-sas-data":"SAS Data","application/x-sas-catalog":"SAS Catalog","application/x-sas-log":"SAS Log","application/x-sas-output":"SAS Output","application/softgrid-do":"Softgrid DTA Script","application/x-dvn-csvspss-zip":"CSV (w/SPSS card)","application/x-dvn-tabddi-zip":"TAB (w/DDI)","application/x-emf":"Extended Metafile","application/x-h5":"Hierarchical Data Format","application/x-hdf":"Hierarchical Data Format","application/x-hdf5":"Hierarchical Data Format","application/geo+json":"GeoJSON","application/json":"JSON","application/mathematica":"Mathematica","application/matlab-mat":"MATLAB Data","application/x-matlab-data":"MATLAB Data","application/x-matlab-figure":"MATLAB Figure","application/x-matlab-workspace":"MATLAB Workspace","text/x-vcard":"Virtual Contact File","application/x-xfig":"MATLAB Figure","application/x-msaccess":"MS Access","application/netcdf":"Network Common Data Form","application/x-netcdf":"Network Common Data Form","application/vnd.lotus-notes":"Notes Storage Facility","application/x-nsdstat":"NSDstat","application/vnd.realvnc.bed":"PLINK Binary","application/vnd.ms-pki.stl":"STL Format","application/vnd.isac.fcs":"FCS Data","application/java-serialized-object":"Java Serialized Object","chemical/x-xyz":"Co-Ordinate Animation","image/fits":"FITS","application/fits":"FITS","application/dbf":"dBASE Table for ESRI Shapefile","application/dbase":"dBASE Table for ESRI Shapefile","application/prj":"ESRI Shapefile","application/sbn":"ESRI Spatial Index","application/sbx":"ESRI Spatial Index","application/shp":"Shape","application/shx":"Shape","application/x-esri-shape":"ESRI Shapefile","application/vnd.google-earth.kml+xml":"Keyhole Markup Language","application/zipped-shapefile":"Zipped Shapefiles","application/zip":"ZIP Archive","application/x-zip-compressed":"ZIP Archive","application/vnd.antix.game-component":"ATX Archive","application/x-bzip":"Bzip Archive","application/x-bzip2":"Bzip Archive","application/vnd.google-earth.kmz":"Google Earth Archive","application/gzip":"Gzip Archive","application/x-gzip":"Gzip Archive","application/x-gzip-compressed":"Gzip Archive","application/rar":"RAR Archive","application/x-rar":"RAR Archive","application/x-rar-compressed":"RAR Archive","application/tar":"TAR Archive","application/x-tar":"TAR Archive","application/x-compressed":"Compressed Archive","application/x-compressed-tar":"TAR Archive","application/x-7z-compressed":"7Z Archive","application/x-xz":"XZ Archive","application/warc":"Web Archive","application/x-iso9660-image":"Optical Disc Image","application/vnd.eln+zip":"ELN Archive","image/gif":"GIF Image","image/jpeg":"JPEG Image","image/jp2":"JPEG-2000 Image","image/x-portable-bitmap":"Bitmap Image","image/x-portable-graymap":"Graymap Image","image/png":"PNG Image","image/x-portable-anymap":"Anymap Image","image/x-portable-pixmap":"Pixmap Image","application/x-msmetafile":"Enhanced Metafile","application/dicom":"DICOM Image","image/dicom-rle":"DICOM Image","image/nii":"NIfTI Image","image/cmu-raster":"Raster Image","image/x-rgb":"RGB Image","image/svg+xml":"SVG Image","image/tiff":"TIFF Image","image/bmp":"Bitmap Image","image/x-xbitmap":"Bitmap Image","image/RAW":"Bitmap Image","image/raw":"Bitmap Image","application/x-tgif":"TGIF File","image/x-xpixmap":"Pixmap Image","image/x-xwindowdump":"X Windows Dump","application/photoshop":"Photoshop Image","image/vnd.adobe.photoshop":"Photoshop Image","application/x-photoshop":"Photoshop Image","image/webp":"WebP Image","audio/x-aiff":"AIFF Audio","audio/mp3":"MP3 Audio","audio/mpeg":"MP3 Audio","audio/mp4":"MPEG-4 Audio","audio/x-m4a":"MPEG-4 Audio","audio/ogg":"OGG Audio","audio/wav":"Waveform Audio","audio/x-wav":"Waveform Audio","audio/x-wave":"Waveform Audio","video/avi":"AVI Video","video/x-msvideo":"AVI Video","video/mpeg":"MPEG Video","video/mp4":"MPEG-4 Video","video/x-m4v":"MPEG-4 Video","video/ogg":"OGG Video","video/quicktime":"Quicktime Video","video/webm":"WebM Video","text/xml-graphml":"GraphML Network Data","application/octet-stream":"Unknown","application/x-docker-file":"Docker Image File","application/x-vagrant-file":"Vagrant Image File","application/vnd.dataverse.file-package":"Dataverse Package",unknown:"Unknown"};var Wl=(t=>(t.BYTES="B",t.KILOBYTES="KB",t.MEGABYTES="MB",t.GIGABYTES="GB",t.TERABYTES="TB",t.PETABYTES="PB",t))(Wl||{});const go=class go{constructor(e,n){this.value=e,this.unit=n,[this.value,this.unit]=go.convertToLargestUnit(e,n)}toString(){return`${this.value%1===0?this.value.toFixed(0):(Math.round(this.value*10)/10).toString()} ${this.unit}`}toBytes(){return this.value*go.multiplier[this.unit]}static convertToLargestUnit(e,n){let r=e,o=n;for(;r>=1024&&o!=="PB";)r/=1024,o=this.getNextUnit(o);return[r,o]}static getNextUnit(e){switch(e){case"B":return"KB";case"KB":return"MB";case"MB":return"GB";case"GB":return"TB";case"TB":return"PB";default:return e}}};Ut(go,"multiplier",{B:1,KB:1024,MB:1024**2,GB:1024**3,TB:1024**4,PB:1024**5});let vi=go;class ky{constructor(e,n){this.value=e,this.original=n}toDisplayFormat(){return _n[this.value]||_n.unknown}get displayFormatIsUnknown(){return this.toDisplayFormat()===_n.unknown}get originalFormatIsUnknown(){return this.original===void 0||this.original===_n.unknown}}var Or=(t=>(t.NONE="NONE",t.MD5="MD5",t.SHA1="SHA-1",t.SHA256="SHA-256",t.SHA512="SHA-512",t))(Or||{});class Re{static isUniqueCombinationOfFilepathAndFilename({fileName:e,filePath:n,fileKey:r,allFiles:o}){return!o.filter(i=>i.key!==r).some(i=>`${i.fileDir}/${i.fileName}`==`${n}/${e}`)}static isValidFilePath(e){return/^[\w.\-\\/ ]*$/.test(e)}static isValidFileName(e){return/^[^:<>;#/"*|?\\]+$/.test(e)}static sanitizeFilePath(e){return e.replace(/[^\w.\-\\/ ]/g,"_")}static sanitizeFileName(e){return e.replace(/[:<>;#/"*|?\\]/g,"_")}static async getChecksum(e,n){return n===Or.NONE?"":n===Or.MD5?await this.getMD5Checksum(e):await this.getSubtleDigestChecksum(e,n)}static async getMD5Checksum(e){const r=e.size,o=py.md5.create();let i=0;for(;ii+s.length,0),r=new Uint8Array(n);let o=0;for(const i of e)r.set(i,o),o+=i.length;return r}static bufferToHex(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}}Ut(Re,"getFileKey",e=>e.webkitRelativePath||e.name),Ut(Re,"isDS_StoreFile",e=>e.name===".DS_Store");var ct=(t=>(t.UPLOADING="uploading",t.DONE="done",t.FAILED="failed",t.REMOVED="removed",t))(ct||{});const Oy=(t,e)=>{switch(e.type){case"ADD_FILE":{const{file:n}=e,r=Re.getFileKey(n);return t.files[r]?t:{...t,files:{...t.files,[r]:{key:r,progress:0,status:"uploading",fileName:Re.sanitizeFileName(n.name),fileDir:n.webkitRelativePath?Cy(Re.sanitizeFilePath(n.webkitRelativePath)):t.config.originalFile?.metadata.directory??"",fileType:n.type,fileSizeString:new vi(n.size,Wl.BYTES).toString(),fileSize:n.size,fileLastModified:n.lastModified,checksumAlgorithm:t.config.checksumAlgorithm,description:t.config.originalFile?.metadata.description??"",restricted:t.config.originalFile?.access.restricted??!1,tags:t.config.originalFile?.metadata.labels.map(o=>o.value)??[]}}}}case"UPDATE_FILE":{const{key:n,updates:r}=e;return t.files[n]?{...t,files:{...t.files,[n]:{...t.files[n],...r}}}:t}case"REMOVE_FILE":{const{key:n}=e;if(!t.files[n])return t;const r={...t.files};return delete r[n],{...t,files:r}}case"REMOVE_ALL_FILES":return{...t,files:{}};case"SET_IS_SAVING":return{...t,isSaving:e.isSaving};case"ADD_UPLOADING_TO_CANCEL":{const{key:n,cancel:r}=e;return{...t,uploadingToCancelMap:new Map(t.uploadingToCancelMap).set(n,r)}}case"REMOVE_UPLOADING_TO_CANCEL":{const{key:n}=e,r=new Map(t.uploadingToCancelMap);return r.delete(n),{...t,uploadingToCancelMap:r}}case"SET_REPLACE_OPERATION_INFO":return{...t,replaceOperationInfo:e.replaceOperationInfo};case"SET_ADD_FILES_TO_DATASET_OPERATION_INFO":return{...t,addFilesToDatasetOperationInfo:e.addFilesToDatasetOperationInfo};default:return t}},Cy=t=>{const e=t.split("/");return e.length>1?e.slice(0,e.length-1).join("/"):""},nf=g.createContext(void 0),JM=({children:t,initialConfig:e})=>{const[n,r]=g.useReducer(Oy,{config:e,files:{},uploadingToCancelMap:new Map,isSaving:!1,replaceOperationInfo:{success:!1,newFileIdentifier:null},addFilesToDatasetOperationInfo:{success:!1}}),o=g.useCallback(m=>r({type:"ADD_FILE",file:m}),[]),i=g.useCallback((m,y)=>r({type:"UPDATE_FILE",key:m,updates:y}),[]),s=g.useCallback(m=>r({type:"REMOVE_FILE",key:m}),[]),a=g.useCallback(()=>r({type:"REMOVE_ALL_FILES"}),[]),l=g.useCallback(m=>n.files[m],[n.files]),c=g.useCallback(m=>{r({type:"SET_IS_SAVING",isSaving:m})},[]),d=g.useCallback((m,y)=>{r({type:"ADD_UPLOADING_TO_CANCEL",key:m,cancel:y})},[]),u=g.useCallback(m=>{r({type:"REMOVE_UPLOADING_TO_CANCEL",key:m})},[]),p=g.useCallback(m=>{r({type:"SET_REPLACE_OPERATION_INFO",replaceOperationInfo:m})},[]),f=g.useCallback(m=>{r({type:"SET_ADD_FILES_TO_DATASET_OPERATION_INFO",addFilesToDatasetOperationInfo:m})},[]),h=g.useMemo(()=>Object.values(n.files).filter(m=>m.status===ct.DONE&&!!m.storageId&&(m.checksumAlgorithm===Or.NONE||m.checksumValue!==void 0)),[n.files]);return T.jsx(nf.Provider,{value:{fileUploaderState:n,uploadedFiles:h,addFile:o,updateFile:i,removeFile:s,removeAllFiles:a,getFileByKey:l,setIsSaving:c,addUploadingToCancel:d,removeUploadingToCancel:u,setReplaceOperationInfo:p,setAddFilesToDatasetOperationInfo:f},children:t})},Io=()=>{const t=g.useContext(nf);if(!t)throw new Error("useFileUploaderContext must be used within a FileUploaderProvider");return t};function Gl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var rf={exports:{}},Hr={};/** + * @license React + * react-jsx-runtime.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Kd;function Sy(){if(Kd)return Hr;Kd=1;var t=A,e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var d,u={},p=null,f=null;c!==void 0&&(p=""+c),l.key!==void 0&&(p=""+l.key),l.ref!==void 0&&(f=l.ref);for(d in l)r.call(l,d)&&!i.hasOwnProperty(d)&&(u[d]=l[d]);if(a&&a.defaultProps)for(d in l=a.defaultProps,l)u[d]===void 0&&(u[d]=l[d]);return{$$typeof:e,type:a,key:p,ref:f,props:u,_owner:o.current}}return Hr.Fragment=n,Hr.jsx=s,Hr.jsxs=s,Hr}rf.exports=Sy();var v=rf.exports,of={exports:{}};/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var i="",s=0;s1?d-1:0),p=1;p{i.target===t&&(o(),e(i))},n+r)}function Kr(...t){return t.filter(e=>e!=null).reduce((e,n)=>{if(typeof n!="function")throw new Error("Invalid Argument Type, must only provide functions, undefined, or null.");return e===null?n:function(...r){e.apply(this,r),n.apply(this,r)}},null)}function ff(t){t.offsetHeight}const Yd=t=>!t||typeof t=="function"?t:e=>{t.current=e};function Ky(t,e){const n=Yd(t),r=Yd(e);return o=>{n&&n(o),r&&r(o)}}function Fr(t,e){return g.useMemo(()=>Ky(t,e),[t,e])}function bi(t){return t&&"setState"in t?xn.findDOMNode(t):t??null}const Zl=A.forwardRef(({onEnter:t,onEntering:e,onEntered:n,onExit:r,onExiting:o,onExited:i,addEndListener:s,children:a,childRef:l,...c},d)=>{const u=g.useRef(null),p=Fr(u,l),f=N=>{p(bi(N))},h=N=>M=>{N&&u.current&&N(u.current,M)},m=g.useCallback(h(t),[t]),y=g.useCallback(h(e),[e]),b=g.useCallback(h(n),[n]),x=g.useCallback(h(r),[r]),k=g.useCallback(h(o),[o]),O=g.useCallback(h(i),[i]),C=g.useCallback(h(s),[s]);return v.jsx(sn,{ref:d,...c,onEnter:m,onEntered:b,onEntering:y,onExit:x,onExited:O,onExiting:k,addEndListener:C,nodeRef:u,children:typeof a=="function"?(N,M)=>a(N,{...M,ref:f}):A.cloneElement(a,{ref:f})})}),Wy={height:["marginTop","marginBottom"],width:["marginLeft","marginRight"]};function hf(t,e){const n=`offset${t[0].toUpperCase()}${t.slice(1)}`,r=e[n],o=Wy[t];return r+parseInt(Qt(e,o[0]),10)+parseInt(Qt(e,o[1]),10)}const Gy={[hn]:"collapse",[yo]:"collapsing",[wt]:"collapsing",[Xt]:"collapse show"},qy={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1,getDimensionValue:hf},Ql=A.forwardRef(({onEnter:t,onEntering:e,onEntered:n,onExit:r,onExiting:o,className:i,children:s,dimension:a="height",getDimensionValue:l=hf,...c},d)=>{const u=typeof a=="function"?a():a,p=g.useMemo(()=>Kr(b=>{b.style[u]="0"},t),[u,t]),f=g.useMemo(()=>Kr(b=>{const x=`scroll${u[0].toUpperCase()}${u.slice(1)}`;b.style[u]=`${b[x]}px`},e),[u,e]),h=g.useMemo(()=>Kr(b=>{b.style[u]=null},n),[u,n]),m=g.useMemo(()=>Kr(b=>{b.style[u]=`${l(u,b)}px`,ff(b)},r),[r,l,u]),y=g.useMemo(()=>Kr(b=>{b.style[u]=null},o),[u,o]);return v.jsx(Zl,{ref:d,addEndListener:Yl,...c,"aria-expanded":c.role?c.in:null,onEnter:p,onEntering:f,onEntered:h,onExit:m,onExiting:y,childRef:s.ref,children:(b,x)=>A.cloneElement(s,{...x,className:z(i,s.props.className,Gy[b],u==="width"&&"collapse-horizontal")})})});Ql.defaultProps=qy;function mf(t,e){return Array.isArray(t)?t.includes(e):t===e}const Lo=g.createContext({});Lo.displayName="AccordionContext";const ec=g.forwardRef(({as:t="div",bsPrefix:e,className:n,children:r,eventKey:o,...i},s)=>{const{activeEventKey:a}=g.useContext(Lo);return e=_(e,"accordion-collapse"),v.jsx(Ql,{ref:s,in:mf(a,o),...i,className:z(n,e),children:v.jsx(t,{children:g.Children.only(r)})})});ec.displayName="AccordionCollapse";const us=g.createContext({eventKey:""});us.displayName="AccordionItemContext";const gf=g.forwardRef(({as:t="div",bsPrefix:e,className:n,onEnter:r,onEntering:o,onEntered:i,onExit:s,onExiting:a,onExited:l,...c},d)=>{e=_(e,"accordion-body");const{eventKey:u}=g.useContext(us);return v.jsx(ec,{eventKey:u,onEnter:r,onEntering:o,onEntered:i,onExit:s,onExiting:a,onExited:l,children:v.jsx(t,{ref:d,...c,className:z(n,e)})})});gf.displayName="AccordionBody";function Jy(t,e){const{activeEventKey:n,onSelect:r,alwaysOpen:o}=g.useContext(Lo);return i=>{let s=t===n?null:t;o&&(Array.isArray(n)?n.includes(t)?s=n.filter(a=>a!==t):s=[...n,t]:s=[t]),r?.(s,i),e?.(i)}}const tc=g.forwardRef(({as:t="button",bsPrefix:e,className:n,onClick:r,...o},i)=>{e=_(e,"accordion-button");const{eventKey:s}=g.useContext(us),a=Jy(s,r),{activeEventKey:l}=g.useContext(Lo);return t==="button"&&(o.type="button"),v.jsx(t,{ref:i,onClick:a,...o,"aria-expanded":Array.isArray(l)?l.includes(s):s===l,className:z(n,e,!mf(l,s)&&"collapsed")})});tc.displayName="AccordionButton";const yf=g.forwardRef(({as:t="h2",bsPrefix:e,className:n,children:r,onClick:o,...i},s)=>(e=_(e,"accordion-header"),v.jsx(t,{ref:s,...i,className:z(n,e),children:v.jsx(tc,{onClick:o,children:r})})));yf.displayName="AccordionHeader";const vf=g.forwardRef(({as:t="div",bsPrefix:e,className:n,eventKey:r,...o},i)=>{e=_(e,"accordion-item");const s=g.useMemo(()=>({eventKey:r}),[r]);return v.jsx(us.Provider,{value:s,children:v.jsx(t,{ref:i,...o,className:z(n,e)})})});vf.displayName="AccordionItem";const bf=g.forwardRef((t,e)=>{const{as:n="div",activeKey:r,bsPrefix:o,className:i,onSelect:s,flush:a,alwaysOpen:l,...c}=Ir(t,{activeKey:"onSelect"}),d=_(o,"accordion"),u=g.useMemo(()=>({activeEventKey:r,onSelect:s,alwaysOpen:l}),[r,s,l]);return v.jsx(Lo.Provider,{value:u,children:v.jsx(n,{ref:e,...c,className:z(i,d,a&&`${d}-flush`)})})});bf.displayName="Accordion";const ps=Object.assign(bf,{Button:tc,Collapse:ec,Item:vf,Header:yf,Body:gf});function Xy(t){const e=g.useRef(t);return g.useEffect(()=>{e.current=t},[t]),e}function nn(t){const e=Xy(t);return g.useCallback(function(...n){return e.current&&e.current(...n)},[e])}function Ma(){return g.useState(null)}function Yy(t){const e=g.useRef(t);return g.useEffect(()=>{e.current=t},[t]),e}function Ae(t){const e=Yy(t);return g.useCallback(function(...n){return e.current&&e.current(...n)},[e])}function Zy(t,e,n,r=!1){const o=Ae(n);g.useEffect(()=>{const i=typeof t=="function"?t():t;return i.addEventListener(e,o,r),()=>i.removeEventListener(e,o,r)},[t])}function xf(){const t=g.useRef(!0),e=g.useRef(()=>t.current);return g.useEffect(()=>(t.current=!0,()=>{t.current=!1}),[]),e.current}function wf(t){const e=g.useRef(null);return g.useEffect(()=>{e.current=t}),e.current}const Qy=typeof global<"u"&&global.navigator&&global.navigator.product==="ReactNative",e0=typeof document<"u",Zd=e0||Qy?g.useLayoutEffect:g.useEffect,t0=["as","disabled"];function n0(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function r0(t){return!t||t.trim()==="#"}function nc({tagName:t,disabled:e,href:n,target:r,rel:o,role:i,onClick:s,tabIndex:a=0,type:l}){t||(n!=null||r!=null||o!=null?t="a":t="button");const c={tagName:t};if(t==="button")return[{type:l||"button",disabled:e},c];const d=p=>{if((e||t==="a"&&r0(n))&&p.preventDefault(),e){p.stopPropagation();return}s?.(p)},u=p=>{p.key===" "&&(p.preventDefault(),d(p))};return t==="a"&&(n||(n="#"),e&&(n=void 0)),[{role:i??"button",disabled:void 0,tabIndex:e?void 0:a,href:n,target:t==="a"?r:void 0,"aria-disabled":e||void 0,rel:t==="a"?o:void 0,onClick:d,onKeyDown:u},c]}const rc=g.forwardRef((t,e)=>{let{as:n,disabled:r}=t,o=n0(t,t0);const[i,{tagName:s}]=nc(Object.assign({tagName:n,disabled:r},o));return v.jsx(s,Object.assign({},o,i,{ref:e}))});rc.displayName="Button";const o0=["onKeyDown"];function i0(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function s0(t){return!t||t.trim()==="#"}const Br=g.forwardRef((t,e)=>{let{onKeyDown:n}=t,r=i0(t,o0);const[o]=nc(Object.assign({tagName:"a"},r)),i=Ae(s=>{o.onKeyDown(s),n?.(s)});return s0(r.href)||r.role==="button"?v.jsx("a",Object.assign({ref:e},r,o,{onKeyDown:i})):v.jsx("a",Object.assign({ref:e},r,{onKeyDown:n}))});Br.displayName="Anchor";const a0={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1},l0={[wt]:"show",[Xt]:"show"},Ot=g.forwardRef(({className:t,children:e,transitionClasses:n={},...r},o)=>{const i=g.useCallback((s,a)=>{ff(s),r.onEnter==null||r.onEnter(s,a)},[r]);return v.jsx(Zl,{ref:o,addEndListener:Yl,...r,onEnter:i,childRef:e.ref,children:(s,a)=>g.cloneElement(e,{...a,className:z("fade",t,e.props.className,l0[s],n[s])})})});Ot.defaultProps=a0;Ot.displayName="Fade";const c0={"aria-label":E.string,onClick:E.func,variant:E.oneOf(["white"])},d0={"aria-label":"Close"},zr=g.forwardRef(({className:t,variant:e,...n},r)=>v.jsx("button",{ref:r,type:"button",className:z("btn-close",e&&`btn-close-${e}`,t),...n}));zr.displayName="CloseButton";zr.propTypes=c0;zr.defaultProps=d0;const Fo=t=>g.forwardRef((e,n)=>v.jsx("div",{...e,ref:n,className:z(e.className,t)}));var u0=/-(.)/g;function p0(t){return t.replace(u0,function(e,n){return n.toUpperCase()})}const f0=t=>t[0].toUpperCase()+p0(t).slice(1);function le(t,{displayName:e=f0(t),Component:n,defaultProps:r}={}){const o=g.forwardRef(({className:i,bsPrefix:s,as:a=n||"div",...l},c)=>{const d=_(s,t);return v.jsx(a,{ref:c,className:z(i,d),...l})});return o.defaultProps=r,o.displayName=e,o}const Ef=Fo("h4");Ef.displayName="DivStyledAsH4";const h0=le("alert-heading",{Component:Ef}),m0=le("alert-link",{Component:Br}),g0={variant:"primary",show:!0,transition:Ot,closeLabel:"Close alert"},oc=g.forwardRef((t,e)=>{const{bsPrefix:n,show:r,closeLabel:o,closeVariant:i,className:s,children:a,variant:l,onClose:c,dismissible:d,transition:u,...p}=Ir(t,{show:"onClose"}),f=_(n,"alert"),h=nn(b=>{c&&c(!1,b)}),m=u===!0?Ot:u,y=v.jsxs("div",{role:"alert",...m?void 0:p,ref:e,className:z(s,f,l&&`${f}-${l}`,d&&`${f}-dismissible`),children:[d&&v.jsx(zr,{onClick:h,"aria-label":o,variant:i}),a]});return m?v.jsx(m,{unmountOnExit:!0,...p,ref:void 0,in:r,children:y}):r?y:null});oc.displayName="Alert";oc.defaultProps=g0;Object.assign(oc,{Link:m0,Heading:h0});const y0={bg:"primary",pill:!1},kf=g.forwardRef(({bsPrefix:t,bg:e,pill:n,text:r,className:o,as:i="span",...s},a)=>{const l=_(t,"badge");return v.jsx(i,{ref:a,...s,className:z(o,l,n&&"rounded-pill",r&&`text-${r}`,e&&`bg-${e}`)})});kf.displayName="Badge";kf.defaultProps=y0;const v0={active:!1,linkProps:{}},ic=g.forwardRef(({bsPrefix:t,active:e,children:n,className:r,as:o="li",linkAs:i=Br,linkProps:s,href:a,title:l,target:c,...d},u)=>{const p=_(t,"breadcrumb-item");return v.jsx(o,{ref:u,...d,className:z(p,r,{active:e}),"aria-current":e?"page":void 0,children:e?n:v.jsx(i,{...s,href:a,title:l,target:c,children:n})})});ic.displayName="BreadcrumbItem";ic.defaultProps=v0;const b0={label:"breadcrumb",listProps:{}},sc=g.forwardRef(({bsPrefix:t,className:e,listProps:n,children:r,label:o,as:i="nav",...s},a)=>{const l=_(t,"breadcrumb");return v.jsx(i,{"aria-label":o,className:e,ref:a,...s,children:v.jsx("ol",{...n,className:z(l,n?.className),children:r})})});sc.displayName="Breadcrumb";sc.defaultProps=b0;Object.assign(sc,{Item:ic});const x0={variant:"primary",active:!1,disabled:!1},Bo=g.forwardRef(({as:t,bsPrefix:e,variant:n,size:r,active:o,className:i,...s},a)=>{const l=_(e,"btn"),[c,{tagName:d}]=nc({tagName:t,...s}),u=d;return v.jsx(u,{...c,...s,ref:a,className:z(i,l,o&&"active",n&&`${l}-${n}`,r&&`${l}-${r}`,s.href&&s.disabled&&"disabled")})});Bo.displayName="Button";Bo.defaultProps=x0;const w0={vertical:!1,role:"group"},ac=g.forwardRef(({bsPrefix:t,size:e,vertical:n,className:r,as:o="div",...i},s)=>{const a=_(t,"btn-group");let l=a;return n&&(l=`${a}-vertical`),v.jsx(o,{...i,ref:s,className:z(r,l,e&&`${a}-${e}`)})});ac.displayName="ButtonGroup";ac.defaultProps=w0;const Of=g.forwardRef(({bsPrefix:t,className:e,variant:n,as:r="img",...o},i)=>{const s=_(t,"card-img");return v.jsx(r,{ref:i,className:z(n?`${s}-${n}`:s,e),...o})});Of.displayName="CardImg";const lc=g.createContext(null);lc.displayName="CardHeaderContext";const Cf=g.forwardRef(({bsPrefix:t,className:e,as:n="div",...r},o)=>{const i=_(t,"card-header"),s=g.useMemo(()=>({cardHeaderBsPrefix:i}),[i]);return v.jsx(lc.Provider,{value:s,children:v.jsx(n,{ref:o,...r,className:z(e,i)})})});Cf.displayName="CardHeader";const E0=Fo("h5"),k0=Fo("h6"),Sf=le("card-body"),O0=le("card-title",{Component:E0}),C0=le("card-subtitle",{Component:k0}),S0=le("card-link",{Component:"a"}),N0=le("card-text",{Component:"p"}),T0=le("card-footer"),A0=le("card-img-overlay"),M0={body:!1},cc=g.forwardRef(({bsPrefix:t,className:e,bg:n,text:r,border:o,body:i,children:s,as:a="div",...l},c)=>{const d=_(t,"card");return v.jsx(a,{ref:c,...l,className:z(e,d,n&&`bg-${n}`,r&&`text-${r}`,o&&`border-${o}`),children:i?v.jsx(Sf,{children:s}):s})});cc.displayName="Card";cc.defaultProps=M0;const fs=Object.assign(cc,{Img:Of,Title:O0,Subtitle:C0,Body:Sf,Link:S0,Text:N0,Header:Cf,Footer:T0,ImgOverlay:A0});function D0(){const t=g.useRef(!0),e=g.useRef(()=>t.current);return g.useEffect(()=>(t.current=!0,()=>{t.current=!1}),[]),e.current}function j0(t){const e=g.useRef(t);return e.current=t,e}function Nf(t){const e=j0(t);g.useEffect(()=>()=>e.current(),[])}const Da=2**31-1;function Tf(t,e,n){const r=n-Date.now();t.current=r<=Da?setTimeout(e,r):setTimeout(()=>Tf(t,e,n),Da)}function R0(){const t=D0(),e=g.useRef();return Nf(()=>clearTimeout(e.current)),g.useMemo(()=>{const n=()=>clearTimeout(e.current);function r(o,i=0){t()&&(n(),i<=Da?e.current=setTimeout(o,i):Tf(e,o,Date.now()+i))}return{set:r,clear:n,handleRef:e}},[])}function I0(t,e){return g.Children.toArray(t).some(n=>g.isValidElement(n)&&n.type===e)}function P0({as:t,bsPrefix:e,className:n,...r}){e=_(e,"col");const o=ql(),i=Jl(),s=[],a=[];return o.forEach(l=>{const c=r[l];delete r[l];let d,u,p;typeof c=="object"&&c!=null?{span:d,offset:u,order:p}=c:d=c;const f=l!==i?`-${l}`:"";d&&s.push(d===!0?`${e}${f}`:`${e}${f}-${d}`),p!=null&&a.push(`order${f}-${p}`),u!=null&&a.push(`offset${f}-${u}`)}),[{...r,className:z(n,...s,...a)},{as:t,bsPrefix:e,spans:s}]}const dc=g.forwardRef((t,e)=>{const[{className:n,...r},{as:o="div",bsPrefix:i,spans:s}]=P0(t);return v.jsx(o,{...r,ref:e,className:z(n,!s.length&&i)})});dc.displayName="Col";var L0=Function.prototype.bind.call(Function.prototype.call,[].slice);function Jt(t,e){return L0(t.querySelectorAll(e))}function Af(t,e,n){const r=g.useRef(t!==void 0),[o,i]=g.useState(e),s=t!==void 0,a=r.current;return r.current=s,!s&&a&&o!==e&&i(e),[s?t:o,g.useCallback((...l)=>{const[c,...d]=l;let u=n?.(c,...d);return i(c),u},[n])]}function Mf(){const[,t]=g.useReducer(e=>e+1,0);return t}const hs=g.createContext(null);var Qd=Object.prototype.hasOwnProperty;function eu(t,e,n){for(n of t.keys())if(no(n,e))return n}function no(t,e){var n,r,o;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((r=t.length)===e.length)for(;r--&&no(t[r],e[r]););return r===-1}if(n===Set){if(t.size!==e.size)return!1;for(r of t)if(o=r,o&&typeof o=="object"&&(o=eu(e,o),!o)||!e.has(o))return!1;return!0}if(n===Map){if(t.size!==e.size)return!1;for(r of t)if(o=r[0],o&&typeof o=="object"&&(o=eu(e,o),!o)||!no(r[1],e.get(o)))return!1;return!0}if(n===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(n===DataView){if((r=t.byteLength)===e.byteLength)for(;r--&&t.getInt8(r)===e.getInt8(r););return r===-1}if(ArrayBuffer.isView(t)){if((r=t.byteLength)===e.byteLength)for(;r--&&t[r]===e[r];);return r===-1}if(!n||typeof t=="object"){r=0;for(n in t)if(Qd.call(t,n)&&++r&&!Qd.call(e,n)||!(n in e)||!no(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!==t&&e!==e}function F0(t){const e=xf();return[t[0],g.useCallback(n=>{if(e())return t[1](n)},[e,t[1]])]}var Ge="top",ft="bottom",ht="right",qe="left",uc="auto",zo=[Ge,ft,ht,qe],Cr="start",vo="end",B0="clippingParents",Df="viewport",Wr="popper",z0="reference",tu=zo.reduce(function(t,e){return t.concat([e+"-"+Cr,e+"-"+vo])},[]),jf=[].concat(zo,[uc]).reduce(function(t,e){return t.concat([e,e+"-"+Cr,e+"-"+vo])},[]),$0="beforeRead",_0="read",V0="afterRead",U0="beforeMain",H0="main",K0="afterMain",W0="beforeWrite",G0="write",q0="afterWrite",J0=[$0,_0,V0,U0,H0,K0,W0,G0,q0];function It(t){return t.split("-")[0]}function tt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Zn(t){var e=tt(t).Element;return t instanceof e||t instanceof Element}function Pt(t){var e=tt(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function pc(t){if(typeof ShadowRoot>"u")return!1;var e=tt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}var Wn=Math.max,xi=Math.min,Sr=Math.round;function ja(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Rf(){return!/^((?!chrome|android).)*safari/i.test(ja())}function Nr(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),o=1,i=1;e&&Pt(t)&&(o=t.offsetWidth>0&&Sr(r.width)/t.offsetWidth||1,i=t.offsetHeight>0&&Sr(r.height)/t.offsetHeight||1);var s=Zn(t)?tt(t):window,a=s.visualViewport,l=!Rf()&&n,c=(r.left+(l&&a?a.offsetLeft:0))/o,d=(r.top+(l&&a?a.offsetTop:0))/i,u=r.width/o,p=r.height/i;return{width:u,height:p,top:d,right:c+u,bottom:d+p,left:c,x:c,y:d}}function fc(t){var e=Nr(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function If(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&pc(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function An(t){return t?(t.nodeName||"").toLowerCase():null}function rn(t){return tt(t).getComputedStyle(t)}function X0(t){return["table","td","th"].indexOf(An(t))>=0}function jn(t){return((Zn(t)?t.ownerDocument:t.document)||window.document).documentElement}function ms(t){return An(t)==="html"?t:t.assignedSlot||t.parentNode||(pc(t)?t.host:null)||jn(t)}function nu(t){return!Pt(t)||rn(t).position==="fixed"?null:t.offsetParent}function Y0(t){var e=/firefox/i.test(ja()),n=/Trident/i.test(ja());if(n&&Pt(t)){var r=rn(t);if(r.position==="fixed")return null}var o=ms(t);for(pc(o)&&(o=o.host);Pt(o)&&["html","body"].indexOf(An(o))<0;){var i=rn(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function $o(t){for(var e=tt(t),n=nu(t);n&&X0(n)&&rn(n).position==="static";)n=nu(n);return n&&(An(n)==="html"||An(n)==="body"&&rn(n).position==="static")?e:n||Y0(t)||e}function hc(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function ro(t,e,n){return Wn(t,xi(e,n))}function Z0(t,e,n){var r=ro(t,e,n);return r>n?n:r}function Pf(){return{top:0,right:0,bottom:0,left:0}}function Lf(t){return Object.assign({},Pf(),t)}function Ff(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var Q0=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,Lf(typeof t!="number"?t:Ff(t,zo))};function ev(t){var e,n=t.state,r=t.name,o=t.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,a=It(n.placement),l=hc(a),c=[qe,ht].indexOf(a)>=0,d=c?"height":"width";if(!(!i||!s)){var u=Q0(o.padding,n),p=fc(i),f=l==="y"?Ge:qe,h=l==="y"?ft:ht,m=n.rects.reference[d]+n.rects.reference[l]-s[l]-n.rects.popper[d],y=s[l]-n.rects.reference[l],b=$o(i),x=b?l==="y"?b.clientHeight||0:b.clientWidth||0:0,k=m/2-y/2,O=u[f],C=x-p[d]-u[h],N=x/2-p[d]/2+k,M=ro(O,N,C),S=l;n.modifiersData[r]=(e={},e[S]=M,e.centerOffset=M-N,e)}}function tv(t){var e=t.state,n=t.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=e.elements.popper.querySelector(o),!o)||If(e.elements.popper,o)&&(e.elements.arrow=o))}const nv={name:"arrow",enabled:!0,phase:"main",fn:ev,effect:tv,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Tr(t){return t.split("-")[1]}var rv={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ov(t,e){var n=t.x,r=t.y,o=e.devicePixelRatio||1;return{x:Sr(n*o)/o||0,y:Sr(r*o)/o||0}}function ru(t){var e,n=t.popper,r=t.popperRect,o=t.placement,i=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,d=t.roundOffsets,u=t.isFixed,p=s.x,f=p===void 0?0:p,h=s.y,m=h===void 0?0:h,y=typeof d=="function"?d({x:f,y:m}):{x:f,y:m};f=y.x,m=y.y;var b=s.hasOwnProperty("x"),x=s.hasOwnProperty("y"),k=qe,O=Ge,C=window;if(c){var N=$o(n),M="clientHeight",S="clientWidth";if(N===tt(n)&&(N=jn(n),rn(N).position!=="static"&&a==="absolute"&&(M="scrollHeight",S="scrollWidth")),N=N,o===Ge||(o===qe||o===ht)&&i===vo){O=ft;var R=u&&N===C&&C.visualViewport?C.visualViewport.height:N[M];m-=R-r.height,m*=l?1:-1}if(o===qe||(o===Ge||o===ft)&&i===vo){k=ht;var P=u&&N===C&&C.visualViewport?C.visualViewport.width:N[S];f-=P-r.width,f*=l?1:-1}}var D=Object.assign({position:a},c&&rv),L=d===!0?ov({x:f,y:m},tt(n)):{x:f,y:m};if(f=L.x,m=L.y,l){var V;return Object.assign({},D,(V={},V[O]=x?"0":"",V[k]=b?"0":"",V.transform=(C.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",V))}return Object.assign({},D,(e={},e[O]=x?m+"px":"",e[k]=b?f+"px":"",e.transform="",e))}function iv(t){var e=t.state,n=t.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,s=i===void 0?!0:i,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:It(e.placement),variation:Tr(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,ru(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,ru(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const sv={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:iv,data:{}};var Yo={passive:!0};function av(t){var e=t.state,n=t.instance,r=t.options,o=r.scroll,i=o===void 0?!0:o,s=r.resize,a=s===void 0?!0:s,l=tt(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&c.forEach(function(d){d.addEventListener("scroll",n.update,Yo)}),a&&l.addEventListener("resize",n.update,Yo),function(){i&&c.forEach(function(d){d.removeEventListener("scroll",n.update,Yo)}),a&&l.removeEventListener("resize",n.update,Yo)}}const lv={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:av,data:{}};var cv={left:"right",right:"left",bottom:"top",top:"bottom"};function ui(t){return t.replace(/left|right|bottom|top/g,function(e){return cv[e]})}var dv={start:"end",end:"start"};function ou(t){return t.replace(/start|end/g,function(e){return dv[e]})}function mc(t){var e=tt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function gc(t){return Nr(jn(t)).left+mc(t).scrollLeft}function uv(t,e){var n=tt(t),r=jn(t),o=n.visualViewport,i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;var c=Rf();(c||!c&&e==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a+gc(t),y:l}}function pv(t){var e,n=jn(t),r=mc(t),o=(e=t.ownerDocument)==null?void 0:e.body,i=Wn(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=Wn(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+gc(t),l=-r.scrollTop;return rn(o||n).direction==="rtl"&&(a+=Wn(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}function yc(t){var e=rn(t),n=e.overflow,r=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function Bf(t){return["html","body","#document"].indexOf(An(t))>=0?t.ownerDocument.body:Pt(t)&&yc(t)?t:Bf(ms(t))}function oo(t,e){var n;e===void 0&&(e=[]);var r=Bf(t),o=r===((n=t.ownerDocument)==null?void 0:n.body),i=tt(r),s=o?[i].concat(i.visualViewport||[],yc(r)?r:[]):r,a=e.concat(s);return o?a:a.concat(oo(ms(s)))}function Ra(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function fv(t,e){var n=Nr(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function iu(t,e,n){return e===Df?Ra(uv(t,n)):Zn(e)?fv(e,n):Ra(pv(jn(t)))}function hv(t){var e=oo(ms(t)),n=["absolute","fixed"].indexOf(rn(t).position)>=0,r=n&&Pt(t)?$o(t):t;return Zn(r)?e.filter(function(o){return Zn(o)&&If(o,r)&&An(o)!=="body"}):[]}function mv(t,e,n,r){var o=e==="clippingParents"?hv(t):[].concat(e),i=[].concat(o,[n]),s=i[0],a=i.reduce(function(l,c){var d=iu(t,c,r);return l.top=Wn(d.top,l.top),l.right=xi(d.right,l.right),l.bottom=xi(d.bottom,l.bottom),l.left=Wn(d.left,l.left),l},iu(t,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function zf(t){var e=t.reference,n=t.element,r=t.placement,o=r?It(r):null,i=r?Tr(r):null,s=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(o){case Ge:l={x:s,y:e.y-n.height};break;case ft:l={x:s,y:e.y+e.height};break;case ht:l={x:e.x+e.width,y:a};break;case qe:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var c=o?hc(o):null;if(c!=null){var d=c==="y"?"height":"width";switch(i){case Cr:l[c]=l[c]-(e[d]/2-n[d]/2);break;case vo:l[c]=l[c]+(e[d]/2-n[d]/2);break}}return l}function bo(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=r===void 0?t.placement:r,i=n.strategy,s=i===void 0?t.strategy:i,a=n.boundary,l=a===void 0?B0:a,c=n.rootBoundary,d=c===void 0?Df:c,u=n.elementContext,p=u===void 0?Wr:u,f=n.altBoundary,h=f===void 0?!1:f,m=n.padding,y=m===void 0?0:m,b=Lf(typeof y!="number"?y:Ff(y,zo)),x=p===Wr?z0:Wr,k=t.rects.popper,O=t.elements[h?x:p],C=mv(Zn(O)?O:O.contextElement||jn(t.elements.popper),l,d,s),N=Nr(t.elements.reference),M=zf({reference:N,element:k,placement:o}),S=Ra(Object.assign({},k,M)),R=p===Wr?S:N,P={top:C.top-R.top+b.top,bottom:R.bottom-C.bottom+b.bottom,left:C.left-R.left+b.left,right:R.right-C.right+b.right},D=t.modifiersData.offset;if(p===Wr&&D){var L=D[o];Object.keys(P).forEach(function(V){var K=[ht,ft].indexOf(V)>=0?1:-1,W=[Ge,ft].indexOf(V)>=0?"y":"x";P[V]+=L[W]*K})}return P}function gv(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=n.boundary,i=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?jf:l,d=Tr(r),u=d?a?tu:tu.filter(function(h){return Tr(h)===d}):zo,p=u.filter(function(h){return c.indexOf(h)>=0});p.length===0&&(p=u);var f=p.reduce(function(h,m){return h[m]=bo(t,{placement:m,boundary:o,rootBoundary:i,padding:s})[It(m)],h},{});return Object.keys(f).sort(function(h,m){return f[h]-f[m]})}function yv(t){if(It(t)===uc)return[];var e=ui(t);return[ou(t),e,ou(e)]}function vv(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,c=n.padding,d=n.boundary,u=n.rootBoundary,p=n.altBoundary,f=n.flipVariations,h=f===void 0?!0:f,m=n.allowedAutoPlacements,y=e.options.placement,b=It(y),x=b===y,k=l||(x||!h?[ui(y)]:yv(y)),O=[y].concat(k).reduce(function(xe,te){return xe.concat(It(te)===uc?gv(e,{placement:te,boundary:d,rootBoundary:u,padding:c,flipVariations:h,allowedAutoPlacements:m}):te)},[]),C=e.rects.reference,N=e.rects.popper,M=new Map,S=!0,R=O[0],P=0;P=0,W=K?"width":"height",Q=bo(e,{placement:D,boundary:d,rootBoundary:u,altBoundary:p,padding:c}),B=K?V?ht:qe:V?ft:Ge;C[W]>N[W]&&(B=ui(B));var H=ui(B),J=[];if(i&&J.push(Q[L]<=0),a&&J.push(Q[B]<=0,Q[H]<=0),J.every(function(xe){return xe})){R=D,S=!1;break}M.set(D,J)}if(S)for(var be=h?3:1,Fe=function(xe){var te=O.find(function(Me){var mt=M.get(Me);if(mt)return mt.slice(0,xe).every(function(Ye){return Ye})});if(te)return R=te,"break"},ge=be;ge>0;ge--){var ye=Fe(ge);if(ye==="break")break}e.placement!==R&&(e.modifiersData[r]._skip=!0,e.placement=R,e.reset=!0)}}const bv={name:"flip",enabled:!0,phase:"main",fn:vv,requiresIfExists:["offset"],data:{_skip:!1}};function su(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function au(t){return[Ge,ht,ft,qe].some(function(e){return t[e]>=0})}function xv(t){var e=t.state,n=t.name,r=e.rects.reference,o=e.rects.popper,i=e.modifiersData.preventOverflow,s=bo(e,{elementContext:"reference"}),a=bo(e,{altBoundary:!0}),l=su(s,r),c=su(a,o,i),d=au(l),u=au(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}const wv={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:xv};function Ev(t,e,n){var r=It(t),o=[qe,Ge].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[qe,ht].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function kv(t){var e=t.state,n=t.options,r=t.name,o=n.offset,i=o===void 0?[0,0]:o,s=jf.reduce(function(d,u){return d[u]=Ev(u,e.rects,i),d},{}),a=s[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=s}const Ov={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:kv};function Cv(t){var e=t.state,n=t.name;e.modifiersData[n]=zf({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const Sv={name:"popperOffsets",enabled:!0,phase:"read",fn:Cv,data:{}};function Nv(t){return t==="x"?"y":"x"}function Tv(t){var e=t.state,n=t.options,r=t.name,o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,c=n.rootBoundary,d=n.altBoundary,u=n.padding,p=n.tether,f=p===void 0?!0:p,h=n.tetherOffset,m=h===void 0?0:h,y=bo(e,{boundary:l,rootBoundary:c,padding:u,altBoundary:d}),b=It(e.placement),x=Tr(e.placement),k=!x,O=hc(b),C=Nv(O),N=e.modifiersData.popperOffsets,M=e.rects.reference,S=e.rects.popper,R=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,P=typeof R=="number"?{mainAxis:R,altAxis:R}:Object.assign({mainAxis:0,altAxis:0},R),D=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,L={x:0,y:0};if(N){if(i){var V,K=O==="y"?Ge:qe,W=O==="y"?ft:ht,Q=O==="y"?"height":"width",B=N[O],H=B+y[K],J=B-y[W],be=f?-S[Q]/2:0,Fe=x===Cr?M[Q]:S[Q],ge=x===Cr?-S[Q]:-M[Q],ye=e.elements.arrow,xe=f&&ye?fc(ye):{width:0,height:0},te=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Pf(),Me=te[K],mt=te[W],Ye=ro(0,M[Q],xe[Q]),Ct=k?M[Q]/2-be-Ye-Me-P.mainAxis:Fe-Ye-Me-P.mainAxis,gt=k?-M[Q]/2+be+Ye+mt+P.mainAxis:ge+Ye+mt+P.mainAxis,yt=e.elements.arrow&&$o(e.elements.arrow),Vt=yt?O==="y"?yt.clientTop||0:yt.clientLeft||0:0,St=(V=D?.[O])!=null?V:0,nt=B+Ct-St-Vt,ne=B+gt-St,Nt=ro(f?xi(H,nt):H,B,f?Wn(J,ne):J);N[O]=Nt,L[O]=Nt-B}if(a){var Tt,sr=O==="x"?Ge:qe,Ur=O==="x"?ft:ht,rt=N[C],an=C==="y"?"height":"width",ar=rt+y[sr],ln=rt-y[Ur],cn=[Ge,qe].indexOf(b)!==-1,G=(Tt=D?.[C])!=null?Tt:0,ue=cn?ar:rt-M[an]-S[an]-G+P.altAxis,Fn=cn?rt+M[an]+S[an]-G-P.altAxis:ln,Jo=f&&cn?Z0(ue,rt,Fn):ro(f?ue:ar,rt,f?Fn:ln);N[C]=Jo,L[C]=Jo-rt}e.modifiersData[r]=L}}const Av={name:"preventOverflow",enabled:!0,phase:"main",fn:Tv,requiresIfExists:["offset"]};function Mv(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Dv(t){return t===tt(t)||!Pt(t)?mc(t):Mv(t)}function jv(t){var e=t.getBoundingClientRect(),n=Sr(e.width)/t.offsetWidth||1,r=Sr(e.height)/t.offsetHeight||1;return n!==1||r!==1}function Rv(t,e,n){n===void 0&&(n=!1);var r=Pt(e),o=Pt(e)&&jv(e),i=jn(e),s=Nr(t,o,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((An(e)!=="body"||yc(i))&&(a=Dv(e)),Pt(e)?(l=Nr(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):i&&(l.x=gc(i))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function Iv(t){var e=new Map,n=new Set,r=[];t.forEach(function(i){e.set(i.name,i)});function o(i){n.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&o(l)}}),r.push(i)}return t.forEach(function(i){n.has(i.name)||o(i)}),r}function Pv(t){var e=Iv(t);return J0.reduce(function(n,r){return n.concat(e.filter(function(o){return o.phase===r}))},[])}function Lv(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function Fv(t){var e=t.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var lu={placement:"bottom",modifiers:[],strategy:"absolute"};function cu(){for(var t=arguments.length,e=new Array(t),n=0;n=0)continue;n[r]=t[r]}return n}const Vv={name:"applyStyles",enabled:!1,phase:"afterWrite",fn:()=>{}},Uv={name:"ariaDescribedBy",enabled:!0,phase:"afterWrite",effect:({state:t})=>()=>{const{reference:e,popper:n}=t.elements;if("removeAttribute"in e){const r=(e.getAttribute("aria-describedby")||"").split(",").filter(o=>o.trim()!==n.id);r.length?e.setAttribute("aria-describedby",r.join(",")):e.removeAttribute("aria-describedby")}},fn:({state:t})=>{var e;const{popper:n,reference:r}=t.elements,o=(e=n.getAttribute("role"))==null?void 0:e.toLowerCase();if(n.id&&o==="tooltip"&&"setAttribute"in r){const i=r.getAttribute("aria-describedby");if(i&&i.split(",").indexOf(n.id)!==-1)return;r.setAttribute("aria-describedby",i?`${i},${n.id}`:n.id)}}},Hv=[];function $f(t,e,n={}){let{enabled:r=!0,placement:o="bottom",strategy:i="absolute",modifiers:s=Hv}=n,a=_v(n,$v);const l=g.useRef(s),c=g.useRef(),d=g.useCallback(()=>{var y;(y=c.current)==null||y.update()},[]),u=g.useCallback(()=>{var y;(y=c.current)==null||y.forceUpdate()},[]),[p,f]=F0(g.useState({placement:o,update:d,forceUpdate:u,attributes:{},styles:{popper:{},arrow:{}}})),h=g.useMemo(()=>({name:"updateStateModifier",enabled:!0,phase:"write",requires:["computeStyles"],fn:({state:y})=>{const b={},x={};Object.keys(y.elements).forEach(k=>{b[k]=y.styles[k],x[k]=y.attributes[k]}),f({state:y,styles:b,attributes:x,update:d,forceUpdate:u,placement:y.placement})}}),[d,u,f]),m=g.useMemo(()=>(no(l.current,s)||(l.current=s),l.current),[s]);return g.useEffect(()=>{!c.current||!r||c.current.setOptions({placement:o,strategy:i,modifiers:[...m,h,Vv]})},[i,o,h,r,m]),g.useEffect(()=>{if(!(!r||t==null||e==null))return c.current=zv(t,e,Object.assign({},a,{placement:o,strategy:i,modifiers:[...m,Uv,h]})),()=>{c.current!=null&&(c.current.destroy(),c.current=void 0,f(y=>Object.assign({},y,{attributes:{},styles:{popper:{}}})))}},[r,t,e]),p}function xo(t,e){if(t.contains)return t.contains(e);if(t.compareDocumentPosition)return t===e||!!(t.compareDocumentPosition(e)&16)}var Kv=function(){},Wv=Kv;const Gv=Gl(Wv),du=()=>{};function qv(t){return t.button===0}function Jv(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}const pi=t=>t&&("current"in t?t.current:t),uu={click:"mousedown",mouseup:"mousedown",pointerup:"pointerdown"};function _f(t,e=du,{disabled:n,clickTrigger:r="click"}={}){const o=g.useRef(!1),i=g.useRef(!1),s=g.useCallback(c=>{const d=pi(t);Gv(!!d,"ClickOutside captured a close event but does not have a ref to compare it to. useClickOutside(), should be passed a ref that resolves to a DOM node"),o.current=!d||Jv(c)||!qv(c)||!!xo(d,c.target)||i.current,i.current=!1},[t]),a=Ae(c=>{const d=pi(t);d&&xo(d,c.target)?i.current=!0:i.current=!1}),l=Ae(c=>{o.current||e(c)});g.useEffect(()=>{var c,d;if(n||t==null)return;const u=Pr(pi(t)),p=u.defaultView||window;let f=(c=p.event)!=null?c:(d=p.parent)==null?void 0:d.event,h=null;uu[r]&&(h=Yt(u,uu[r],a,!0));const m=Yt(u,r,s,!0),y=Yt(u,r,x=>{if(x===f){f=void 0;return}l(x)});let b=[];return"ontouchstart"in u.documentElement&&(b=[].slice.call(u.body.children).map(x=>Yt(x,"mousemove",du))),()=>{h?.(),m(),y(),b.forEach(x=>x())}},[t,n,r,s,a,l])}function Xv(t){const e={};return Array.isArray(t)?(t?.forEach(n=>{e[n.name]=n}),e):t||e}function Yv(t={}){return Array.isArray(t)?t:Object.keys(t).map(e=>(t[e].name=e,t[e]))}function Vf({enabled:t,enableEvents:e,placement:n,flip:r,offset:o,fixed:i,containerPadding:s,arrowElement:a,popperConfig:l={}}){var c,d,u,p,f;const h=Xv(l.modifiers);return Object.assign({},l,{placement:n,enabled:t,strategy:i?"fixed":l.strategy,modifiers:Yv(Object.assign({},h,{eventListeners:{enabled:e,options:(c=h.eventListeners)==null?void 0:c.options},preventOverflow:Object.assign({},h.preventOverflow,{options:s?Object.assign({padding:s},(d=h.preventOverflow)==null?void 0:d.options):(u=h.preventOverflow)==null?void 0:u.options}),offset:{options:Object.assign({offset:o},(p=h.offset)==null?void 0:p.options)},arrow:Object.assign({},h.arrow,{enabled:!!a,options:Object.assign({},(f=h.arrow)==null?void 0:f.options,{element:a})}),flip:Object.assign({enabled:!!r},h.flip)}))})}const Zv=["children","usePopper"];function Qv(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}const eb=()=>{};function Uf(t={}){const e=g.useContext(hs),[n,r]=Ma(),o=g.useRef(!1),{flip:i,offset:s,rootCloseEvent:a,fixed:l=!1,placement:c,popperConfig:d={},enableEventListeners:u=!0,usePopper:p=!!e}=t,f=e?.show==null?!!t.show:e.show;f&&!o.current&&(o.current=!0);const h=N=>{e?.toggle(!1,N)},{placement:m,setMenu:y,menuElement:b,toggleElement:x}=e||{},k=$f(x,b,Vf({placement:c||m||"bottom-start",enabled:p,enableEvents:u??f,offset:s,flip:i,fixed:l,arrowElement:n,popperConfig:d})),O=Object.assign({ref:y||eb,"aria-labelledby":x?.id},k.attributes.popper,{style:k.styles.popper}),C={show:f,placement:m,hasShown:o.current,toggle:e?.toggle,popper:p?k:null,arrowProps:p?Object.assign({ref:r},k.attributes.arrow,{style:k.styles.arrow}):{}};return _f(b,h,{clickTrigger:a,disabled:!f}),[O,C]}function Hf(t){let{children:e,usePopper:n=!0}=t,r=Qv(t,Zv);const[o,i]=Uf(Object.assign({},r,{usePopper:n}));return v.jsx(v.Fragment,{children:e(o,i)})}Hf.displayName="DropdownMenu";const Kf={prefix:String(Math.round(Math.random()*1e10)),current:0},Wf=A.createContext(Kf),tb=A.createContext(!1);let Us=new WeakMap;function nb(t=!1){let e=g.useContext(Wf),n=g.useRef(null);if(n.current===null&&!t){var r,o;let i=(o=A.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||o===void 0||(r=o.ReactCurrentOwner)===null||r===void 0?void 0:r.current;if(i){let s=Us.get(i);s==null?Us.set(i,{id:e.current,state:i.memoizedState}):i.memoizedState!==s.state&&(e.current=s.id,Us.delete(i))}n.current=++e.current}return n.current}function rb(t){let e=g.useContext(Wf),n=nb(!!t),r=`react-aria${e.prefix}`;return t||`${r}-${n}`}function ob(t){let e=A.useId(),[n]=g.useState(lb()),r=n?"react-aria":`react-aria${Kf.prefix}`;return t||`${r}-${e}`}const Gf=typeof A.useId=="function"?ob:rb;function ib(){return!1}function sb(){return!0}function ab(t){return()=>{}}function lb(){return typeof A.useSyncExternalStore=="function"?A.useSyncExternalStore(ab,ib,sb):g.useContext(tb)}const qf=t=>{var e;return((e=t.getAttribute("role"))==null?void 0:e.toLowerCase())==="menu"},pu=()=>{};function Jf(){const t=Gf(),{show:e=!1,toggle:n=pu,setToggle:r,menuElement:o}=g.useContext(hs)||{},i=g.useCallback(a=>{n(!e,a)},[e,n]),s={id:t,ref:r||pu,onClick:i,"aria-expanded":!!e};return o&&qf(o)&&(s["aria-haspopup"]=!0),[s,{show:e,toggle:n}]}function Xf({children:t}){const[e,n]=Jf();return v.jsx(v.Fragment,{children:t(e,n)})}Xf.displayName="DropdownToggle";const Lt=g.createContext(null),Mn=(t,e=null)=>t!=null?String(t):e||null,gs=g.createContext(null);gs.displayName="NavContext";const cb="data-rr-ui-",db="rrUi";function $r(t){return`${cb}${t}`}function ub(t){return`${db}${t}`}const pb=["eventKey","disabled","onClick","active","as"];function fb(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function Yf({key:t,href:e,active:n,disabled:r,onClick:o}){const i=g.useContext(Lt),s=g.useContext(gs),{activeKey:a}=s||{},l=Mn(t,e),c=n==null&&t!=null?Mn(a)===l:n;return[{onClick:Ae(d=>{r||(o?.(d),i&&!d.isPropagationStopped()&&i(l,d))}),"aria-disabled":r||void 0,"aria-selected":c,[$r("dropdown-item")]:""},{isActive:c}]}const Zf=g.forwardRef((t,e)=>{let{eventKey:n,disabled:r,onClick:o,active:i,as:s=rc}=t,a=fb(t,pb);const[l]=Yf({key:n,href:a.href,disabled:r,onClick:o,active:i});return v.jsx(s,Object.assign({},a,{ref:e},l))});Zf.displayName="DropdownItem";const Qf=g.createContext(Lr?window:void 0);Qf.Provider;function ys(){return g.useContext(Qf)}function fu(){const t=Mf(),e=g.useRef(null),n=g.useCallback(r=>{e.current=r,t()},[t]);return[e,n]}function _o({defaultShow:t,show:e,onSelect:n,onToggle:r,itemSelector:o=`* [${$r("dropdown-item")}]`,focusFirstItemOnShow:i,placement:s="bottom-start",children:a}){const l=ys(),[c,d]=Af(e,t,r),[u,p]=fu(),f=u.current,[h,m]=fu(),y=h.current,b=wf(c),x=g.useRef(null),k=g.useRef(!1),O=g.useContext(Lt),C=g.useCallback((D,L,V=L?.type)=>{d(D,{originalEvent:L,source:V})},[d]),N=Ae((D,L)=>{n?.(D,L),C(!1,L,"select"),L.isPropagationStopped()||O==null||O(D,L)}),M=g.useMemo(()=>({toggle:C,placement:s,show:c,menuElement:f,toggleElement:y,setMenu:p,setToggle:m}),[C,s,c,f,y,p,m]);f&&b&&!c&&(k.current=f.contains(f.ownerDocument.activeElement));const S=Ae(()=>{y&&y.focus&&y.focus()}),R=Ae(()=>{const D=x.current;let L=i;if(L==null&&(L=u.current&&qf(u.current)?"keyboard":!1),L===!1||L==="keyboard"&&!/^key.+$/.test(D))return;const V=Jt(u.current,o)[0];V&&V.focus&&V.focus()});g.useEffect(()=>{c?R():k.current&&(k.current=!1,S())},[c,k,S,R]),g.useEffect(()=>{x.current=null});const P=(D,L)=>{if(!u.current)return null;const V=Jt(u.current,o);let K=V.indexOf(D)+L;return K=Math.max(0,Math.min(K,V.length)),V[K]};return Zy(g.useCallback(()=>l.document,[l]),"keydown",D=>{var L,V;const{key:K}=D,W=D.target,Q=(L=u.current)==null?void 0:L.contains(W),B=(V=h.current)==null?void 0:V.contains(W);if(/input|textarea/i.test(W.tagName)&&(K===" "||K!=="Escape"&&Q||K==="Escape"&&W.type==="search")||!Q&&!B||K==="Tab"&&(!u.current||!c))return;x.current=D.type;const H={originalEvent:D,source:D.type};switch(K){case"ArrowUp":{const J=P(W,-1);J&&J.focus&&J.focus(),D.preventDefault();return}case"ArrowDown":if(D.preventDefault(),!c)d(!0,H);else{const J=P(W,1);J&&J.focus&&J.focus()}return;case"Tab":Xl(W.ownerDocument,"keyup",J=>{var be;(J.key==="Tab"&&!J.target||!((be=u.current)!=null&&be.contains(J.target)))&&d(!1,H)},{once:!0});break;case"Escape":K==="Escape"&&(D.preventDefault(),D.stopPropagation()),d(!1,H);break}}),v.jsx(Lt.Provider,{value:N,children:v.jsx(hs.Provider,{value:M,children:a})})}_o.displayName="Dropdown";_o.Menu=Hf;_o.Toggle=Xf;_o.Item=Zf;const vc=g.createContext({});vc.displayName="DropdownContext";const eh=g.forwardRef(({bsPrefix:t,className:e,eventKey:n,disabled:r=!1,onClick:o,active:i,as:s=Br,...a},l)=>{const c=_(t,"dropdown-item"),[d,u]=Yf({key:n,href:a.href,disabled:r,onClick:o,active:i});return v.jsx(s,{...a,...d,ref:l,className:z(e,c,u.isActive&&"active",r&&"disabled")})});eh.displayName="DropdownItem";const hb=typeof global<"u"&&global.navigator&&global.navigator.product==="ReactNative",mb=typeof document<"u",bc=mb||hb?g.useLayoutEffect:g.useEffect,vs=g.createContext(null);vs.displayName="InputGroupContext";const Rn=g.createContext(null);Rn.displayName="NavbarContext";function th(t,e){return t}const cr=E.oneOf(["start","end"]),gb=E.oneOfType([cr,E.shape({sm:cr}),E.shape({md:cr}),E.shape({lg:cr}),E.shape({xl:cr}),E.shape({xxl:cr}),E.object]),yb={flip:!0};function nh(t,e,n){const r=n?"top-end":"top-start",o=n?"top-start":"top-end",i=n?"bottom-end":"bottom-start",s=n?"bottom-start":"bottom-end",a=n?"right-start":"left-start",l=n?"right-end":"left-end",c=n?"left-start":"right-start",d=n?"left-end":"right-end";let u=t?s:i;return e==="up"?u=t?o:r:e==="end"?u=t?d:c:e==="start"?u=t?l:a:e==="down-centered"?u="bottom":e==="up-centered"&&(u="top"),u}const bs=g.forwardRef(({bsPrefix:t,className:e,align:n,rootCloseEvent:r,flip:o,show:i,renderOnMount:s,as:a="div",popperConfig:l,variant:c,...d},u)=>{let p=!1;const f=g.useContext(Rn),h=_(t,"dropdown-menu"),{align:m,drop:y,isRTL:b}=g.useContext(vc);n=n||m;const x=g.useContext(vs),k=[];if(n)if(typeof n=="object"){const D=Object.keys(n);if(D.length){const L=D[0],V=n[L];p=V==="start",k.push(`${h}-${L}-${V}`)}}else n==="end"&&(p=!0);const O=nh(p,y,b),[C,{hasShown:N,popper:M,show:S,toggle:R}]=Uf({flip:o,rootCloseEvent:r,show:i,usePopper:!f&&k.length===0,offset:[0,2],popperConfig:l,placement:O});if(C.ref=Fr(th(u),C.ref),bc(()=>{S&&M?.update()},[S]),!N&&!s&&!x)return null;typeof a!="string"&&(C.show=S,C.close=()=>R?.(!1),C.align=n);let P=d.style;return M!=null&&M.placement&&(P={...d.style,...C.style},d["x-placement"]=M.placement),v.jsx(a,{...d,...C,style:P,...(k.length||f)&&{"data-bs-popper":"static"},className:z(e,h,S&&"show",p&&`${h}-end`,c&&`${h}-${c}`,...k)})});bs.displayName="DropdownMenu";bs.defaultProps=yb;const xc=g.forwardRef(({bsPrefix:t,split:e,className:n,childBsPrefix:r,as:o=Bo,...i},s)=>{const a=_(t,"dropdown-toggle"),l=g.useContext(hs);r!==void 0&&(i.bsPrefix=r);const[c]=Jf();return c.ref=Fr(c.ref,th(s)),v.jsx(o,{className:z(n,a,e&&`${a}-split`,l?.show&&"show"),...c,...i})});xc.displayName="DropdownToggle";const vb=le("dropdown-header",{defaultProps:{role:"heading"}}),bb=le("dropdown-divider",{Component:"hr",defaultProps:{role:"separator"}}),xb=le("dropdown-item-text",{Component:"span"}),wb={navbar:!1,align:"start",autoClose:!0,drop:"down"},wc=g.forwardRef((t,e)=>{const{bsPrefix:n,drop:r,show:o,className:i,align:s,onSelect:a,onToggle:l,focusFirstItemOnShow:c,as:d="div",navbar:u,autoClose:p,...f}=Ir(t,{show:"onToggle"}),h=g.useContext(vs),m=_(n,"dropdown"),y=ds(),b=N=>p===!1?N==="click":p==="inside"?N!=="rootClose":p==="outside"?N!=="select":!0,x=nn((N,M)=>{M.originalEvent.currentTarget===document&&(M.source!=="keydown"||M.originalEvent.key==="Escape")&&(M.source="rootClose"),b(M.source)&&l?.(N,M)}),k=nh(s==="end",r,y),O=g.useMemo(()=>({align:s,drop:r,isRTL:y}),[s,r,y]),C={down:m,"down-centered":`${m}-center`,up:"dropup","up-centered":"dropup-center dropup",end:"dropend",start:"dropstart"};return v.jsx(vc.Provider,{value:O,children:v.jsx(_o,{placement:k,show:o,onSelect:a,onToggle:x,focusFirstItemOnShow:c,itemSelector:`.${m}-item:not(.disabled):not(:disabled)`,children:h?f.children:v.jsx(d,{...f,ref:e,className:z(i,o&&"show",C[r])})})})});wc.displayName="Dropdown";wc.defaultProps=wb;const fe=Object.assign(wc,{Toggle:xc,Menu:bs,Item:eh,ItemText:xb,Divider:bb,Header:vb}),Eb={id:E.string,href:E.string,onClick:E.func,title:E.node.isRequired,disabled:E.bool,align:gb,menuRole:E.string,renderMenuOnMount:E.bool,rootCloseEvent:E.string,menuVariant:E.oneOf(["dark"]),flip:E.bool,bsPrefix:E.string,variant:E.string,size:E.string},Ec=g.forwardRef(({title:t,children:e,bsPrefix:n,rootCloseEvent:r,variant:o,size:i,menuRole:s,renderMenuOnMount:a,disabled:l,href:c,id:d,menuVariant:u,flip:p,...f},h)=>v.jsxs(fe,{ref:h,...f,children:[v.jsx(xc,{id:d,href:c,size:i,variant:o,disabled:l,childBsPrefix:n,children:t}),v.jsx(bs,{role:s,renderOnMount:a,rootCloseEvent:r,variant:u,flip:p,children:e})]}));Ec.displayName="DropdownButton";Ec.propTypes=Eb;const kb={type:E.string,tooltip:E.bool,as:E.elementType},xs=g.forwardRef(({as:t="div",className:e,type:n="valid",tooltip:r=!1,...o},i)=>v.jsx(t,{...o,ref:i,className:z(e,`${n}-${r?"tooltip":"feedback"}`)}));xs.displayName="Feedback";xs.propTypes=kb;const on=g.createContext({}),Vo=g.forwardRef(({id:t,bsPrefix:e,className:n,type:r="checkbox",isValid:o=!1,isInvalid:i=!1,as:s="input",...a},l)=>{const{controlId:c}=g.useContext(on);return e=_(e,"form-check-input"),v.jsx(s,{...a,ref:l,type:r,id:t||c,className:z(n,e,o&&"is-valid",i&&"is-invalid")})});Vo.displayName="FormCheckInput";const wi=g.forwardRef(({bsPrefix:t,className:e,htmlFor:n,...r},o)=>{const{controlId:i}=g.useContext(on);return t=_(t,"form-check-label"),v.jsx("label",{...r,ref:o,htmlFor:n||i,className:z(e,t)})});wi.displayName="FormCheckLabel";const rh=g.forwardRef(({id:t,bsPrefix:e,bsSwitchPrefix:n,inline:r=!1,reverse:o=!1,disabled:i=!1,isValid:s=!1,isInvalid:a=!1,feedbackTooltip:l=!1,feedback:c,feedbackType:d,className:u,style:p,title:f="",type:h="checkbox",label:m,children:y,as:b="input",...x},k)=>{e=_(e,"form-check"),n=_(n,"form-switch");const{controlId:O}=g.useContext(on),C=g.useMemo(()=>({controlId:t||O}),[O,t]),N=!y&&m!=null&&m!==!1||I0(y,wi),M=v.jsx(Vo,{...x,type:h==="switch"?"checkbox":h,ref:k,isValid:s,isInvalid:a,disabled:i,as:b});return v.jsx(on.Provider,{value:C,children:v.jsx("div",{style:p,className:z(u,N&&e,r&&`${e}-inline`,o&&`${e}-reverse`,h==="switch"&&n),children:y||v.jsxs(v.Fragment,{children:[M,N&&v.jsx(wi,{title:f,children:m}),c&&v.jsx(xs,{type:d,tooltip:l,children:c})]})})})});rh.displayName="FormCheck";const Ei=Object.assign(rh,{Input:Vo,Label:wi}),oh=g.forwardRef(({bsPrefix:t,type:e,size:n,htmlSize:r,id:o,className:i,isValid:s=!1,isInvalid:a=!1,plaintext:l,readOnly:c,as:d="input",...u},p)=>{const{controlId:f}=g.useContext(on);t=_(t,"form-control");let h;return l?h={[`${t}-plaintext`]:!0}:h={[t]:!0,[`${t}-${n}`]:n},v.jsx(d,{...u,type:e,size:r,ref:p,readOnly:c,id:o||f,className:z(i,h,s&&"is-valid",a&&"is-invalid",e==="color"&&`${t}-color`)})});oh.displayName="FormControl";const ih=Object.assign(oh,{Feedback:xs}),Ob=le("form-floating"),kc=g.forwardRef(({controlId:t,as:e="div",...n},r)=>{const o=g.useMemo(()=>({controlId:t}),[t]);return v.jsx(on.Provider,{value:o,children:v.jsx(e,{...n,ref:r})})});kc.displayName="FormGroup";const Cb={column:!1,visuallyHidden:!1},Oc=g.forwardRef(({as:t="label",bsPrefix:e,column:n,visuallyHidden:r,className:o,htmlFor:i,...s},a)=>{const{controlId:l}=g.useContext(on);e=_(e,"form-label");let c="col-form-label";typeof n=="string"&&(c=`${c} ${c}-${n}`);const d=z(o,e,r&&"visually-hidden",n&&c);return i=i||l,n?v.jsx(dc,{ref:a,as:"label",className:d,htmlFor:i,...s}):v.jsx(t,{ref:a,className:d,htmlFor:i,...s})});Oc.displayName="FormLabel";Oc.defaultProps=Cb;const sh=g.forwardRef(({bsPrefix:t,className:e,id:n,...r},o)=>{const{controlId:i}=g.useContext(on);return t=_(t,"form-range"),v.jsx("input",{...r,type:"range",ref:o,className:z(e,t),id:n||i})});sh.displayName="FormRange";const ah=g.forwardRef(({bsPrefix:t,size:e,htmlSize:n,className:r,isValid:o=!1,isInvalid:i=!1,id:s,...a},l)=>{const{controlId:c}=g.useContext(on);return t=_(t,"form-select"),v.jsx("select",{...a,size:n,ref:l,className:z(r,t,e&&`${t}-${e}`,o&&"is-valid",i&&"is-invalid"),id:s||c})});ah.displayName="FormSelect";const lh=g.forwardRef(({bsPrefix:t,className:e,as:n="small",muted:r,...o},i)=>(t=_(t,"form-text"),v.jsx(n,{...o,ref:i,className:z(e,t,r&&"text-muted")})));lh.displayName="FormText";const ch=g.forwardRef((t,e)=>v.jsx(Ei,{...t,ref:e,type:"switch"}));ch.displayName="Switch";const Sb=Object.assign(ch,{Input:Ei.Input,Label:Ei.Label}),dh=g.forwardRef(({bsPrefix:t,className:e,children:n,controlId:r,label:o,...i},s)=>(t=_(t,"form-floating"),v.jsxs(kc,{ref:s,className:z(e,t),controlId:r,...i,children:[n,v.jsx("label",{htmlFor:r,children:o})]})));dh.displayName="FloatingLabel";const Nb={_ref:E.any,validated:E.bool,as:E.elementType},Cc=g.forwardRef(({className:t,validated:e,as:n="form",...r},o)=>v.jsx(n,{...r,ref:o,className:z(t,e&&"was-validated")}));Cc.displayName="Form";Cc.propTypes=Nb;const he=Object.assign(Cc,{Group:kc,Control:ih,Floating:Ob,Check:Ei,Switch:Sb,Label:Oc,Text:lh,Range:sh,Select:ah,FloatingLabel:dh}),Tb={fluid:!1},uh=g.forwardRef(({bsPrefix:t,fluid:e,as:n="div",className:r,...o},i)=>{const s=_(t,"container"),a=typeof e=="string"?`-${e}`:"-fluid";return v.jsx(n,{ref:i,...o,className:z(r,e?`${s}${a}`:s)})});uh.displayName="Container";uh.defaultProps=Tb;const Sc=le("input-group-text",{Component:"span"}),Ab=t=>v.jsx(Sc,{children:v.jsx(Vo,{type:"checkbox",...t})}),Mb=t=>v.jsx(Sc,{children:v.jsx(Vo,{type:"radio",...t})}),ph=g.forwardRef(({bsPrefix:t,size:e,hasValidation:n,className:r,as:o="div",...i},s)=>{t=_(t,"input-group");const a=g.useMemo(()=>({}),[]);return v.jsx(vs.Provider,{value:a,children:v.jsx(o,{ref:s,...i,className:z(r,t,e&&`${t}-${e}`,n&&"has-validation")})})});ph.displayName="InputGroup";const fh=Object.assign(ph,{Text:Sc,Radio:Mb,Checkbox:Ab}),hu=t=>!t||typeof t=="function"?t:e=>{t.current=e};function Db(t,e){const n=hu(t),r=hu(e);return o=>{n&&n(o),r&&r(o)}}function Uo(t,e){return g.useMemo(()=>Db(t,e),[t,e])}const _r=g.createContext(null),jb=["as","active","eventKey"];function Rb(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function Nc({key:t,onClick:e,active:n,id:r,role:o,disabled:i}){const s=g.useContext(Lt),a=g.useContext(gs),l=g.useContext(_r);let c=n;const d={role:o};if(a){!o&&a.role==="tablist"&&(d.role="tab");const u=a.getControllerId(t??null),p=a.getControlledId(t??null);d[$r("event-key")]=t,d.id=u||r,c=n==null&&t!=null?a.activeKey===t:n,(c||!(l!=null&&l.unmountOnExit)&&!(l!=null&&l.mountOnEnter))&&(d["aria-controls"]=p)}return d.role==="tab"&&(d["aria-selected"]=c,c||(d.tabIndex=-1),i&&(d.tabIndex=-1,d["aria-disabled"]=!0)),d.onClick=Ae(u=>{i||(e?.(u),t!=null&&s&&!u.isPropagationStopped()&&s(t,u))}),[d,{isActive:c}]}const hh=g.forwardRef((t,e)=>{let{as:n=rc,active:r,eventKey:o}=t,i=Rb(t,jb);const[s,a]=Nc(Object.assign({key:Mn(o,i.href),active:r},i));return s[$r("active")]=a.isActive,v.jsx(n,Object.assign({},i,s,{ref:e}))});hh.displayName="NavItem";const Ib=["as","onSelect","activeKey","role","onKeyDown"];function Pb(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}const mu=()=>{},gu=$r("event-key"),mh=g.forwardRef((t,e)=>{let{as:n="div",onSelect:r,activeKey:o,role:i,onKeyDown:s}=t,a=Pb(t,Ib);const l=Mf(),c=g.useRef(!1),d=g.useContext(Lt),u=g.useContext(_r);let p,f;u&&(i=i||"tablist",o=u.activeKey,p=u.getControlledId,f=u.getControllerId);const h=g.useRef(null),m=k=>{const O=h.current;if(!O)return null;const C=Jt(O,`[${gu}]:not([aria-disabled=true])`),N=O.querySelector("[aria-selected=true]");if(!N||N!==document.activeElement)return null;const M=C.indexOf(N);if(M===-1)return null;let S=M+k;return S>=C.length&&(S=0),S<0&&(S=C.length-1),C[S]},y=(k,O)=>{k!=null&&(r?.(k,O),d?.(k,O))},b=k=>{if(s?.(k),!u)return;let O;switch(k.key){case"ArrowLeft":case"ArrowUp":O=m(-1);break;case"ArrowRight":case"ArrowDown":O=m(1);break;default:return}O&&(k.preventDefault(),y(O.dataset[ub("EventKey")]||null,k),c.current=!0,l())};g.useEffect(()=>{if(h.current&&c.current){const k=h.current.querySelector(`[${gu}][aria-selected=true]`);k?.focus()}c.current=!1});const x=Uo(e,h);return v.jsx(Lt.Provider,{value:y,children:v.jsx(gs.Provider,{value:{role:i,activeKey:Mn(o),getControlledId:p||mu,getControllerId:f||mu},children:v.jsx(n,Object.assign({},a,{onKeyDown:b,ref:x,role:i}))})})});mh.displayName="Nav";const gh=Object.assign(mh,{Item:hh}),yh=g.forwardRef(({bsPrefix:t,active:e,disabled:n,eventKey:r,className:o,variant:i,action:s,as:a,...l},c)=>{t=_(t,"list-group-item");const[d,u]=Nc({key:Mn(r,l.href),active:e,...l}),p=nn(h=>{if(n){h.preventDefault(),h.stopPropagation();return}d.onClick(h)});n&&l.tabIndex===void 0&&(l.tabIndex=-1,l["aria-disabled"]=!0);const f=a||(s?l.href?"a":"button":"div");return v.jsx(f,{ref:c,...l,...d,onClick:p,className:z(o,t,u.isActive&&"active",n&&"disabled",i&&`${t}-${i}`,s&&`${t}-action`)})});yh.displayName="ListGroupItem";const vh=g.forwardRef((t,e)=>{const{className:n,bsPrefix:r,variant:o,horizontal:i,numbered:s,as:a="div",...l}=Ir(t,{activeKey:"onSelect"}),c=_(r,"list-group");let d;return i&&(d=i===!0?"horizontal":`horizontal-${i}`),v.jsx(gh,{ref:e,...l,as:a,className:z(n,c,o&&`${c}-${o}`,d&&`${c}-${d}`,s&&`${c}-numbered`)})});vh.displayName="ListGroup";Object.assign(vh,{Item:yh});var Zo;function yu(t){if((!Zo&&Zo!==0||t)&&Lr){var e=document.createElement("div");e.style.position="absolute",e.style.top="-9999px",e.style.width="50px",e.style.height="50px",e.style.overflow="scroll",document.body.appendChild(e),Zo=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return Zo}function Lb(){return g.useState(null)}function Hs(t){t===void 0&&(t=Pr());try{var e=t.activeElement;return!e||!e.nodeName?null:e}catch{return t.body}}function Fb(t){const e=g.useRef(t);return e.current=t,e}function Bb(t){const e=Fb(t);g.useEffect(()=>()=>e.current(),[])}function zb(t=document){const e=t.defaultView;return Math.abs(e.innerWidth-t.documentElement.clientWidth)}const vu=$r("modal-open");class Tc{constructor({ownerDocument:e,handleContainerOverflow:n=!0,isRTL:r=!1}={}){this.handleContainerOverflow=n,this.isRTL=r,this.modals=[],this.ownerDocument=e}getScrollbarWidth(){return zb(this.ownerDocument)}getElement(){return(this.ownerDocument||document).body}setModalAttributes(e){}removeModalAttributes(e){}setContainerStyle(e){const n={overflow:"hidden"},r=this.isRTL?"paddingLeft":"paddingRight",o=this.getElement();e.style={overflow:o.style.overflow,[r]:o.style[r]},e.scrollBarWidth&&(n[r]=`${parseInt(Qt(o,r)||"0",10)+e.scrollBarWidth}px`),o.setAttribute(vu,""),Qt(o,n)}reset(){[...this.modals].forEach(e=>this.remove(e))}removeContainerStyle(e){const n=this.getElement();n.removeAttribute(vu),Object.assign(n.style,e.style)}add(e){let n=this.modals.indexOf(e);return n!==-1||(n=this.modals.length,this.modals.push(e),this.setModalAttributes(e),n!==0)||(this.state={scrollBarWidth:this.getScrollbarWidth(),style:{}},this.handleContainerOverflow&&this.setContainerStyle(this.state)),n}remove(e){const n=this.modals.indexOf(e);n!==-1&&(this.modals.splice(n,1),!this.modals.length&&this.handleContainerOverflow&&this.removeContainerStyle(this.state),this.removeModalAttributes(e))}isTopModal(e){return!!this.modals.length&&this.modals[this.modals.length-1]===e}}const Ks=(t,e)=>Lr?t==null?(e||Pr()).body:(typeof t=="function"&&(t=t()),t&&"current"in t&&(t=t.current),t&&("nodeType"in t||t.getBoundingClientRect)?t:null):null;function Ia(t,e){const n=ys(),[r,o]=g.useState(()=>Ks(t,n?.document));if(!r){const i=Ks(t);i&&o(i)}return g.useEffect(()=>{},[e,r]),g.useEffect(()=>{const i=Ks(t);i!==r&&o(i)},[t,r]),r}function bh(t){return t.code==="Escape"||t.keyCode===27}function $b(){const t=g.version.split(".");return{major:+t[0],minor:+t[1],patch:+t[2]}}function Ac(t){if(!t||typeof t=="function")return null;const{major:e}=$b();return e>=19?t.props.ref:t.ref}function Mc({children:t,in:e,onExited:n,mountOnEnter:r,unmountOnExit:o}){const i=g.useRef(null),s=g.useRef(e),a=Ae(n);g.useEffect(()=>{e?s.current=!0:a(i.current)},[e,a]);const l=Uo(i,Ac(t)),c=g.cloneElement(t,{ref:l});return e?c:o||!s.current&&r?null:c}const _b=["onEnter","onEntering","onEntered","onExit","onExiting","onExited","addEndListener","children"];function Vb(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function Ub(t){let{onEnter:e,onEntering:n,onEntered:r,onExit:o,onExiting:i,onExited:s,addEndListener:a,children:l}=t,c=Vb(t,_b);const d=g.useRef(null),u=Uo(d,Ac(l)),p=O=>C=>{O&&d.current&&O(d.current,C)},f=g.useCallback(p(e),[e]),h=g.useCallback(p(n),[n]),m=g.useCallback(p(r),[r]),y=g.useCallback(p(o),[o]),b=g.useCallback(p(i),[i]),x=g.useCallback(p(s),[s]),k=g.useCallback(p(a),[a]);return Object.assign({},c,{nodeRef:d},e&&{onEnter:f},n&&{onEntering:h},r&&{onEntered:m},o&&{onExit:y},i&&{onExiting:b},s&&{onExited:x},a&&{addEndListener:k},{children:typeof l=="function"?(O,C)=>l(O,Object.assign({},C,{ref:u})):g.cloneElement(l,{ref:u})})}const Hb=["component"];function Kb(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}const Wb=g.forwardRef((t,e)=>{let{component:n}=t,r=Kb(t,Hb);const o=Ub(r);return v.jsx(n,Object.assign({ref:e},o))});function Gb({in:t,onTransition:e}){const n=g.useRef(null),r=g.useRef(!0),o=Ae(e);return Zd(()=>{if(!n.current)return;let i=!1;return o({in:t,element:n.current,initial:r.current,isStale:()=>i}),()=>{i=!0}},[t,o]),Zd(()=>(r.current=!1,()=>{r.current=!0}),[]),n}function qb({children:t,in:e,onExited:n,onEntered:r,transition:o}){const[i,s]=g.useState(!e);e&&i&&s(!1);const a=Gb({in:!!e,onTransition:c=>{const d=()=>{c.isStale()||(c.in?r?.(c.element,c.initial):(s(!0),n?.(c.element)))};Promise.resolve(o(c)).then(d,u=>{throw c.in||s(!0),u})}}),l=Uo(a,Ac(t));return i&&!e?null:g.cloneElement(t,{ref:l})}function Pa(t,e,n){return t?v.jsx(Wb,Object.assign({},n,{component:t})):e?v.jsx(qb,Object.assign({},n,{transition:e})):v.jsx(Mc,Object.assign({},n))}const Jb=["show","role","className","style","children","backdrop","keyboard","onBackdropClick","onEscapeKeyDown","transition","runTransition","backdropTransition","runBackdropTransition","autoFocus","enforceFocus","restoreFocus","restoreFocusOptions","renderDialog","renderBackdrop","manager","container","onShow","onHide","onExit","onExited","onExiting","onEnter","onEntering","onEntered"];function Xb(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}let Ws;function Yb(t){return Ws||(Ws=new Tc({ownerDocument:t?.document})),Ws}function Zb(t){const e=ys(),n=t||Yb(e),r=g.useRef({dialog:null,backdrop:null});return Object.assign(r.current,{add:()=>n.add(r.current),remove:()=>n.remove(r.current),isTopModal:()=>n.isTopModal(r.current),setDialogRef:g.useCallback(o=>{r.current.dialog=o},[]),setBackdropRef:g.useCallback(o=>{r.current.backdrop=o},[])})}const xh=g.forwardRef((t,e)=>{let{show:n=!1,role:r="dialog",className:o,style:i,children:s,backdrop:a=!0,keyboard:l=!0,onBackdropClick:c,onEscapeKeyDown:d,transition:u,runTransition:p,backdropTransition:f,runBackdropTransition:h,autoFocus:m=!0,enforceFocus:y=!0,restoreFocus:b=!0,restoreFocusOptions:x,renderDialog:k,renderBackdrop:O=ne=>v.jsx("div",Object.assign({},ne)),manager:C,container:N,onShow:M,onHide:S=()=>{},onExit:R,onExited:P,onExiting:D,onEnter:L,onEntering:V,onEntered:K}=t,W=Xb(t,Jb);const Q=ys(),B=Ia(N),H=Zb(C),J=xf(),be=wf(n),[Fe,ge]=g.useState(!n),ye=g.useRef(null);g.useImperativeHandle(e,()=>H,[H]),Lr&&!be&&n&&(ye.current=Hs(Q?.document)),n&&Fe&&ge(!1);const xe=Ae(()=>{if(H.add(),gt.current=Yt(document,"keydown",Ye),Ct.current=Yt(document,"focus",()=>setTimeout(Me),!0),M&&M(),m){var ne,Nt;const Tt=Hs((ne=(Nt=H.dialog)==null?void 0:Nt.ownerDocument)!=null?ne:Q?.document);H.dialog&&Tt&&!xo(H.dialog,Tt)&&(ye.current=Tt,H.dialog.focus())}}),te=Ae(()=>{if(H.remove(),gt.current==null||gt.current(),Ct.current==null||Ct.current(),b){var ne;(ne=ye.current)==null||ne.focus==null||ne.focus(x),ye.current=null}});g.useEffect(()=>{!n||!B||xe()},[n,B,xe]),g.useEffect(()=>{Fe&&te()},[Fe,te]),Bb(()=>{te()});const Me=Ae(()=>{if(!y||!J()||!H.isTopModal())return;const ne=Hs(Q?.document);H.dialog&&ne&&!xo(H.dialog,ne)&&H.dialog.focus()}),mt=Ae(ne=>{ne.target===ne.currentTarget&&(c?.(ne),a===!0&&S())}),Ye=Ae(ne=>{l&&bh(ne)&&H.isTopModal()&&(d?.(ne),ne.defaultPrevented||S())}),Ct=g.useRef(),gt=g.useRef(),yt=(...ne)=>{ge(!0),P?.(...ne)};if(!B)return null;const Vt=Object.assign({role:r,ref:H.setDialogRef,"aria-modal":r==="dialog"?!0:void 0},W,{style:i,className:o,tabIndex:-1});let St=k?k(Vt):v.jsx("div",Object.assign({},Vt,{children:g.cloneElement(s,{role:"document"})}));St=Pa(u,p,{unmountOnExit:!0,mountOnEnter:!0,appear:!0,in:!!n,onExit:R,onExiting:D,onExited:yt,onEnter:L,onEntering:V,onEntered:K,children:St});let nt=null;return a&&(nt=O({ref:H.setBackdropRef,onClick:mt}),nt=Pa(f,h,{in:!!n,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:nt})),v.jsx(v.Fragment,{children:xn.createPortal(v.jsxs(v.Fragment,{children:[nt,St]}),B)})});xh.displayName="Modal";const wh=Object.assign(xh,{Manager:Tc});function Eh(t,e){return t.classList?!!e&&t.classList.contains(e):(" "+(t.className.baseVal||t.className)+" ").indexOf(" "+e+" ")!==-1}function Qb(t,e){t.classList?t.classList.add(e):Eh(t,e)||(typeof t.className=="string"?t.className=t.className+" "+e:t.setAttribute("class",(t.className&&t.className.baseVal||"")+" "+e))}function bu(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function ex(t,e){t.classList?t.classList.remove(e):typeof t.className=="string"?t.className=bu(t.className,e):t.setAttribute("class",bu(t.className&&t.className.baseVal||"",e))}const dr={FIXED_CONTENT:".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",STICKY_CONTENT:".sticky-top",NAVBAR_TOGGLER:".navbar-toggler"};class kh extends Tc{adjustAndStore(e,n,r){const o=n.style[e];n.dataset[e]=o,Qt(n,{[e]:`${parseFloat(Qt(n,e))+r}px`})}restore(e,n){const r=n.dataset[e];r!==void 0&&(delete n.dataset[e],Qt(n,{[e]:r}))}setContainerStyle(e){super.setContainerStyle(e);const n=this.getElement();if(Qb(n,"modal-open"),!e.scrollBarWidth)return;const r=this.isRTL?"paddingLeft":"paddingRight",o=this.isRTL?"marginLeft":"marginRight";Jt(n,dr.FIXED_CONTENT).forEach(i=>this.adjustAndStore(r,i,e.scrollBarWidth)),Jt(n,dr.STICKY_CONTENT).forEach(i=>this.adjustAndStore(o,i,-e.scrollBarWidth)),Jt(n,dr.NAVBAR_TOGGLER).forEach(i=>this.adjustAndStore(o,i,e.scrollBarWidth))}removeContainerStyle(e){super.removeContainerStyle(e);const n=this.getElement();ex(n,"modal-open");const r=this.isRTL?"paddingLeft":"paddingRight",o=this.isRTL?"marginLeft":"marginRight";Jt(n,dr.FIXED_CONTENT).forEach(i=>this.restore(r,i)),Jt(n,dr.STICKY_CONTENT).forEach(i=>this.restore(o,i)),Jt(n,dr.NAVBAR_TOGGLER).forEach(i=>this.restore(o,i))}}let Gs;function Oh(t){return Gs||(Gs=new kh(t)),Gs}const tx=le("modal-body"),Dc=g.createContext({onHide(){}}),jc=g.forwardRef(({bsPrefix:t,className:e,contentClassName:n,centered:r,size:o,fullscreen:i,children:s,scrollable:a,...l},c)=>{t=_(t,"modal");const d=`${t}-dialog`,u=typeof i=="string"?`${t}-fullscreen-${i}`:`${t}-fullscreen`;return v.jsx("div",{...l,ref:c,className:z(d,e,o&&`${t}-${o}`,r&&`${d}-centered`,a&&`${d}-scrollable`,i&&u),children:v.jsx("div",{className:z(`${t}-content`,n),children:s})})});jc.displayName="ModalDialog";const nx=le("modal-footer"),rx={closeLabel:"Close",closeButton:!1},Rc=g.forwardRef(({closeLabel:t,closeVariant:e,closeButton:n,onHide:r,children:o,...i},s)=>{const a=g.useContext(Dc),l=nn(()=>{a?.onHide(),r?.()});return v.jsxs("div",{ref:s,...i,children:[o,n&&v.jsx(zr,{"aria-label":t,variant:e,onClick:l})]})});Rc.defaultProps=rx;const ox={closeLabel:"Close",closeButton:!1},Ic=g.forwardRef(({bsPrefix:t,className:e,...n},r)=>(t=_(t,"modal-header"),v.jsx(Rc,{ref:r,...n,className:z(e,t)})));Ic.displayName="ModalHeader";Ic.defaultProps=ox;const ix=Fo("h4"),sx=le("modal-title",{Component:ix}),ax={show:!1,backdrop:!0,keyboard:!0,autoFocus:!0,enforceFocus:!0,restoreFocus:!0,animation:!0,dialogAs:jc};function lx(t){return v.jsx(Ot,{...t,timeout:null})}function cx(t){return v.jsx(Ot,{...t,timeout:null})}const Pc=g.forwardRef(({bsPrefix:t,className:e,style:n,dialogClassName:r,contentClassName:o,children:i,dialogAs:s,"aria-labelledby":a,"aria-describedby":l,"aria-label":c,show:d,animation:u,backdrop:p,keyboard:f,onEscapeKeyDown:h,onShow:m,onHide:y,container:b,autoFocus:x,enforceFocus:k,restoreFocus:O,restoreFocusOptions:C,onEntered:N,onExit:M,onExiting:S,onEnter:R,onEntering:P,onExited:D,backdropClassName:L,manager:V,...K},W)=>{const[Q,B]=g.useState({}),[H,J]=g.useState(!1),be=g.useRef(!1),Fe=g.useRef(!1),ge=g.useRef(null),[ye,xe]=Lb(),te=Fr(W,xe),Me=nn(y),mt=ds();t=_(t,"modal");const Ye=g.useMemo(()=>({onHide:Me}),[Me]);function Ct(){return V||Oh({isRTL:mt})}function gt(G){if(!Lr)return;const ue=Ct().getScrollbarWidth()>0,Fn=G.scrollHeight>Pr(G).documentElement.clientHeight;B({paddingRight:ue&&!Fn?yu():void 0,paddingLeft:!ue&&Fn?yu():void 0})}const yt=nn(()=>{ye&>(ye.dialog)});Nf(()=>{Aa(window,"resize",yt),ge.current==null||ge.current()});const Vt=()=>{be.current=!0},St=G=>{be.current&&ye&&G.target===ye.dialog&&(Fe.current=!0),be.current=!1},nt=()=>{J(!0),ge.current=pf(ye.dialog,()=>{J(!1)})},ne=G=>{G.target===G.currentTarget&&nt()},Nt=G=>{if(p==="static"){ne(G);return}if(Fe.current||G.target!==G.currentTarget){Fe.current=!1;return}y?.()},Tt=G=>{f?h?.(G):(G.preventDefault(),p==="static"&&nt())},sr=(G,ue)=>{G&>(G),R?.(G,ue)},Ur=G=>{ge.current==null||ge.current(),M?.(G)},rt=(G,ue)=>{P?.(G,ue),Xl(window,"resize",yt)},an=G=>{G&&(G.style.display=""),D?.(G),Aa(window,"resize",yt)},ar=g.useCallback(G=>v.jsx("div",{...G,className:z(`${t}-backdrop`,L,!u&&"show")}),[u,L,t]),ln={...n,...Q};ln.display="block";const cn=G=>v.jsx("div",{role:"dialog",...G,style:ln,className:z(e,t,H&&`${t}-static`,!u&&"show"),onClick:p?Nt:void 0,onMouseUp:St,"aria-label":c,"aria-labelledby":a,"aria-describedby":l,children:v.jsx(s,{...K,onMouseDown:Vt,className:r,contentClassName:o,children:i})});return v.jsx(Dc.Provider,{value:Ye,children:v.jsx(wh,{show:d,ref:te,backdrop:p,container:b,keyboard:!0,autoFocus:x,enforceFocus:k,restoreFocus:O,restoreFocusOptions:C,onEscapeKeyDown:Tt,onShow:m,onHide:y,onEnter:sr,onEntering:rt,onEntered:N,onExit:Ur,onExiting:S,onExited:an,manager:Ct(),transition:u?lx:void 0,backdropTransition:u?cx:void 0,renderBackdrop:ar,renderDialog:cn})})});Pc.displayName="Modal";Pc.defaultProps=ax;const Ho=Object.assign(Pc,{Body:tx,Header:Ic,Title:sx,Footer:nx,Dialog:jc,TRANSITION_DURATION:300,BACKDROP_TRANSITION_DURATION:150});var xu={exports:{}},La={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;function n(r){function o(s,a,l,c,d,u){var p=c||"<>",f=u||l;if(a[l]==null)return s?new Error("Required "+d+" `"+f+"` was not specified "+("in `"+p+"`.")):null;for(var h=arguments.length,m=Array(h>6?h-6:0),y=6;y{t=_(t,"nav-link");const[a,l]=Nc({key:Mn(o,i.href),active:r,...i});return v.jsx(n,{...i,...a,ref:s,className:z(e,t,i.disabled&&"disabled",l.isActive&&"active")})});ws.displayName="NavLink";ws.defaultProps=px;const fx={justify:!1,fill:!1},Lc=g.forwardRef((t,e)=>{const{as:n="div",bsPrefix:r,variant:o,fill:i,justify:s,navbar:a,navbarScroll:l,className:c,activeKey:d,...u}=Ir(t,{activeKey:"onSelect"}),p=_(r,"nav");let f,h,m=!1;const y=g.useContext(Rn),b=g.useContext(lc);return y?(f=y.bsPrefix,m=a??!0):b&&({cardHeaderBsPrefix:h}=b),v.jsx(gh,{as:n,ref:e,activeKey:d,className:z(c,{[p]:!m,[`${f}-nav`]:m,[`${f}-nav-scroll`]:m&&l,[`${h}-${o}`]:!!h,[`${p}-${o}`]:!!o,[`${p}-fill`]:i,[`${p}-justified`]:s}),...u})});Lc.displayName="Nav";Lc.defaultProps=fx;Object.assign(Lc,{Item:ux,Link:ws});const Ch=g.forwardRef(({bsPrefix:t,className:e,as:n,...r},o)=>{t=_(t,"navbar-brand");const i=n||(r.href?"a":"span");return v.jsx(i,{...r,ref:o,className:z(e,t)})});Ch.displayName="NavbarBrand";const Sh=g.forwardRef(({children:t,bsPrefix:e,...n},r)=>{e=_(e,"navbar-collapse");const o=g.useContext(Rn);return v.jsx(Ql,{in:!!(o&&o.expanded),...n,children:v.jsx("div",{ref:r,className:e,children:t})})});Sh.displayName="NavbarCollapse";const hx={label:"Toggle navigation"},Fc=g.forwardRef(({bsPrefix:t,className:e,children:n,label:r,as:o="button",onClick:i,...s},a)=>{t=_(t,"navbar-toggler");const{onToggle:l,expanded:c}=g.useContext(Rn)||{},d=nn(u=>{i&&i(u),l&&l()});return o==="button"&&(s.type="button"),v.jsx(o,{...s,ref:a,onClick:d,"aria-label":r,className:z(e,t,!c&&"collapsed"),children:n||v.jsx("span",{className:`${t}-icon`})})});Fc.displayName="NavbarToggle";Fc.defaultProps=hx;const Fa=new WeakMap,wu=(t,e)=>{if(!t||!e)return;const n=Fa.get(e)||new Map;Fa.set(e,n);let r=n.get(t);return r||(r=e.matchMedia(t),r.refCount=0,n.set(r.media,r)),r};function mx(t,e=typeof window>"u"?void 0:window){const n=wu(t,e),[r,o]=g.useState(()=>n?n.matches:!1);return bc(()=>{let i=wu(t,e);if(!i)return o(!1);let s=Fa.get(e);const a=()=>{o(i.matches)};return i.refCount++,i.addListener(a),a(),()=>{i.removeListener(a),i.refCount--,i.refCount<=0&&s?.delete(i.media),i=void 0}},[t]),r}function gx(t){const e=Object.keys(t);function n(a,l){return a===l?l:a?`${a} and ${l}`:l}function r(a){return e[Math.min(e.indexOf(a)+1,e.length-1)]}function o(a){const l=r(a);let c=t[l];return typeof c=="number"?c=`${c-.2}px`:c=`calc(${c} - 0.2px)`,`(max-width: ${c})`}function i(a){let l=t[a];return typeof l=="number"&&(l=`${l}px`),`(min-width: ${l})`}function s(a,l,c){let d;typeof a=="object"?(d=a,c=l,l=!0):(l=l||!0,d={[a]:l});let u=g.useMemo(()=>Object.entries(d).reduce((p,[f,h])=>((h==="up"||h===!0)&&(p=n(p,i(f))),(h==="down"||h===!0)&&(p=n(p,o(f))),p),""),[JSON.stringify(d)]);return mx(u,c)}return s}const yx=gx({xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400}),vx=le("offcanvas-body"),bx={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1},xx={[wt]:"show",[Xt]:"show"},Bc=g.forwardRef(({bsPrefix:t,className:e,children:n,...r},o)=>(t=_(t,"offcanvas"),v.jsx(Zl,{ref:o,addEndListener:Yl,...r,childRef:n.ref,children:(i,s)=>g.cloneElement(n,{...s,className:z(e,n.props.className,(i===wt||i===yo)&&`${t}-toggling`,xx[i])})})));Bc.defaultProps=bx;Bc.displayName="OffcanvasToggling";const wx={closeLabel:"Close",closeButton:!1},zc=g.forwardRef(({bsPrefix:t,className:e,...n},r)=>(t=_(t,"offcanvas-header"),v.jsx(Rc,{ref:r,...n,className:z(e,t)})));zc.displayName="OffcanvasHeader";zc.defaultProps=wx;const Ex=Fo("h5"),kx=le("offcanvas-title",{Component:Ex}),Ox={show:!1,backdrop:!0,keyboard:!0,scroll:!1,autoFocus:!0,enforceFocus:!0,restoreFocus:!0,placement:"start",renderStaticNode:!1};function Cx(t){return v.jsx(Bc,{...t})}function Sx(t){return v.jsx(Ot,{...t})}const $c=g.forwardRef(({bsPrefix:t,className:e,children:n,"aria-labelledby":r,placement:o,responsive:i,show:s,backdrop:a,keyboard:l,scroll:c,onEscapeKeyDown:d,onShow:u,onHide:p,container:f,autoFocus:h,enforceFocus:m,restoreFocus:y,restoreFocusOptions:b,onEntered:x,onExit:k,onExiting:O,onEnter:C,onEntering:N,onExited:M,backdropClassName:S,manager:R,renderStaticNode:P,...D},L)=>{const V=g.useRef();t=_(t,"offcanvas");const{onToggle:K}=g.useContext(Rn)||{},[W,Q]=g.useState(!1),B=yx(i||"xs","up");g.useEffect(()=>{Q(i?s&&!B:s)},[s,i,B]);const H=nn(()=>{K?.(),p?.()}),J=g.useMemo(()=>({onHide:H}),[H]);function be(){return R||(c?(V.current||(V.current=new kh({handleContainerOverflow:!1})),V.current):Oh())}const Fe=(te,...Me)=>{te&&(te.style.visibility="visible"),C?.(te,...Me)},ge=(te,...Me)=>{te&&(te.style.visibility=""),M?.(...Me)},ye=g.useCallback(te=>v.jsx("div",{...te,className:z(`${t}-backdrop`,S)}),[S,t]),xe=te=>v.jsx("div",{...te,...D,className:z(e,i?`${t}-${i}`:t,`${t}-${o}`),"aria-labelledby":r,children:n});return v.jsxs(v.Fragment,{children:[!W&&(i||P)&&xe({}),v.jsx(Dc.Provider,{value:J,children:v.jsx(wh,{show:W,ref:L,backdrop:a,container:f,keyboard:l,autoFocus:h,enforceFocus:m&&!c,restoreFocus:y,restoreFocusOptions:b,onEscapeKeyDown:d,onShow:u,onHide:H,onEnter:Fe,onEntering:N,onEntered:x,onExit:k,onExiting:O,onExited:ge,manager:be(),transition:Cx,backdropTransition:Sx,renderBackdrop:ye,renderDialog:xe})})]})});$c.displayName="Offcanvas";$c.defaultProps=Ox;const Nx=Object.assign($c,{Body:vx,Header:zc,Title:kx}),Nh=g.forwardRef((t,e)=>{const n=g.useContext(Rn);return v.jsx(Nx,{ref:e,show:!!(n!=null&&n.expanded),...t,renderStaticNode:!0})});Nh.displayName="NavbarOffcanvas";const Tx=le("navbar-text",{Component:"span"}),Ax={expand:!0,variant:"light",collapseOnSelect:!1},_c=g.forwardRef((t,e)=>{const{bsPrefix:n,expand:r,variant:o,bg:i,fixed:s,sticky:a,className:l,as:c="nav",expanded:d,onToggle:u,onSelect:p,collapseOnSelect:f,...h}=Ir(t,{expanded:"onToggle"}),m=_(n,"navbar"),y=g.useCallback((...k)=>{p?.(...k),f&&d&&u?.(!1)},[p,f,d,u]);h.role===void 0&&c!=="nav"&&(h.role="navigation");let b=`${m}-expand`;typeof r=="string"&&(b=`${b}-${r}`);const x=g.useMemo(()=>({onToggle:()=>u?.(!d),bsPrefix:m,expanded:!!d,expand:r}),[m,d,r,u]);return v.jsx(Rn.Provider,{value:x,children:v.jsx(Lt.Provider,{value:y,children:v.jsx(c,{ref:e,...h,className:z(l,m,r&&b,o&&`${m}-${o}`,i&&`bg-${i}`,a&&`sticky-${a}`,s&&`fixed-${s}`)})})})});_c.defaultProps=Ax;_c.displayName="Navbar";Object.assign(_c,{Brand:Ch,Collapse:Sh,Offcanvas:Nh,Text:Tx,Toggle:Fc});const Th=g.forwardRef(({id:t,title:e,children:n,bsPrefix:r,className:o,rootCloseEvent:i,menuRole:s,disabled:a,active:l,renderMenuOnMount:c,menuVariant:d,...u},p)=>{const f=_(void 0,"nav-item");return v.jsxs(fe,{ref:p,...u,className:z(o,f),children:[v.jsx(fe.Toggle,{id:t,eventKey:null,active:l,disabled:a,childBsPrefix:r,as:ws,children:e}),v.jsx(fe.Menu,{role:s,renderOnMount:c,rootCloseEvent:i,variant:d,children:n})]})});Th.displayName="NavDropdown";const Ah=Object.assign(Th,{Item:fe.Item,ItemText:fe.ItemText,Divider:fe.Divider,Header:fe.Header}),Mx=()=>{};function Dx(t,e,{disabled:n,clickTrigger:r}={}){const o=e||Mx;_f(t,o,{disabled:n,clickTrigger:r});const i=Ae(s=>{bh(s)&&o(s)});g.useEffect(()=>{if(n||t==null)return;const s=Pr(pi(t));let a=(s.defaultView||window).event;const l=Yt(s,"keyup",c=>{if(c===a){a=void 0;return}i(c)});return()=>{l()}},[t,n,i])}const Mh=g.forwardRef((t,e)=>{const{flip:n,offset:r,placement:o,containerPadding:i,popperConfig:s={},transition:a,runTransition:l}=t,[c,d]=Ma(),[u,p]=Ma(),f=Uo(d,e),h=Ia(t.container),m=Ia(t.target),[y,b]=g.useState(!t.show),x=$f(m,c,Vf({placement:o,enableEvents:!!t.show,containerPadding:i||5,flip:n,offset:r,arrowElement:u,popperConfig:s}));t.show&&y&&b(!1);const k=(...D)=>{b(!0),t.onExited&&t.onExited(...D)},O=t.show||!y;if(Dx(c,t.onHide,{disabled:!t.rootClose||t.rootCloseDisabled,clickTrigger:t.rootCloseEvent}),!O)return null;const{onExit:C,onExiting:N,onEnter:M,onEntering:S,onEntered:R}=t;let P=t.children(Object.assign({},x.attributes.popper,{style:x.styles.popper,ref:f}),{popper:x,placement:o,show:!!t.show,arrowProps:Object.assign({},x.attributes.arrow,{style:x.styles.arrow,ref:p})});return P=Pa(a,l,{in:!!t.show,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:P,onExit:C,onExiting:N,onExited:k,onEnter:M,onEntering:S,onEntered:R}),h?xn.createPortal(P,h):null});Mh.displayName="Overlay";const jx=le("popover-header"),Dh=le("popover-body");function jh(t,e){let n=t;return t==="left"?n=e?"end":"start":t==="right"&&(n=e?"start":"end"),n}function Rh(t="absolute"){return{position:t,top:"0",left:"0",opacity:"0",pointerEvents:"none"}}const Rx={placement:"right"},Ih=g.forwardRef(({bsPrefix:t,placement:e,className:n,style:r,children:o,body:i,arrowProps:s,hasDoneInitialMeasure:a,popper:l,show:c,...d},u)=>{const p=_(t,"popover"),f=ds(),[h]=e?.split("-")||[],m=jh(h,f);let y=r;return c&&!a&&(y={...r,...Rh(l?.strategy)}),v.jsxs("div",{ref:u,role:"tooltip",style:y,"x-placement":h,className:z(n,p,h&&`bs-popover-${m}`),...d,children:[v.jsx("div",{className:"popover-arrow",...s}),i?v.jsx(Dh,{children:o}):o]})});Ih.defaultProps=Rx;const Ix=Object.assign(Ih,{Header:jx,Body:Dh,POPPER_OFFSET:[0,8]});function Px(t){const e=g.useRef(null),n=_(void 0,"popover"),r=g.useMemo(()=>({name:"offset",options:{offset:()=>e.current&&Eh(e.current,n)?t||Ix.POPPER_OFFSET:t||[0,0]}}),[t,n]);return[e,[r]]}const Lx={transition:Ot,rootClose:!1,show:!1,placement:"top"};function Fx(t,e){const{ref:n}=t,{ref:r}=e;t.ref=n.__wrapped||(n.__wrapped=o=>n(bi(o))),e.ref=r.__wrapped||(r.__wrapped=o=>r(bi(o)))}const Vc=g.forwardRef(({children:t,transition:e,popperConfig:n={},...r},o)=>{const i=g.useRef({}),[s,a]=g.useState(null),[l,c]=Px(r.offset),d=Fr(o,l),u=e===!0?Ot:e||void 0,p=nn(f=>{a(f),n==null||n.onFirstUpdate==null||n.onFirstUpdate(f)});return bc(()=>{s&&(i.current.scheduleUpdate==null||i.current.scheduleUpdate())},[s]),g.useEffect(()=>{r.show||a(null)},[r.show]),v.jsx(Mh,{...r,ref:d,popperConfig:{...n,modifiers:c.concat(n.modifiers||[]),onFirstUpdate:p},transition:u,children:(f,{arrowProps:h,popper:m,show:y})=>{var b,x;Fx(f,h);const k=m?.placement,O=Object.assign(i.current,{state:m?.state,scheduleUpdate:m?.update,placement:k,outOfBoundaries:(m==null||(b=m.state)==null||(x=b.modifiersData.hide)==null?void 0:x.isReferenceHidden)||!1,strategy:n.strategy}),C=!!s;return typeof t=="function"?t({...f,placement:k,show:y,...!e&&y&&{className:"show"},popper:O,arrowProps:h,hasDoneInitialMeasure:C}):g.cloneElement(t,{...f,placement:k,arrowProps:h,popper:O,hasDoneInitialMeasure:C,className:z(t.props.className,!e&&y&&"show"),style:{...t.props.style,...f.style}})}})});Vc.displayName="Overlay";Vc.defaultProps=Lx;function Bx(t){return t&&typeof t=="object"?t:{show:t,hide:t}}function Eu(t,e,n){const[r]=e,o=r.currentTarget,i=r.relatedTarget||r.nativeEvent[n];(!i||i!==o)&&!xo(o,i)&&t(...e)}const zx={defaultShow:!1,trigger:["hover","focus"]};function Ph({trigger:t,overlay:e,children:n,popperConfig:r={},show:o,defaultShow:i=!1,onToggle:s,delay:a,placement:l,flip:c=l&&l.indexOf("auto")!==-1,...d}){const u=g.useRef(null),p=Fr(u,n.ref),f=R0(),h=g.useRef(""),[m,y]=af(o,i,s),b=Bx(a),{onFocus:x,onBlur:k,onClick:O}=typeof n!="function"?g.Children.only(n).props:{},C=W=>{p(bi(W))},N=g.useCallback(()=>{if(f.clear(),h.current="show",!b.show){y(!0);return}f.set(()=>{h.current==="show"&&y(!0)},b.show)},[b.show,y,f]),M=g.useCallback(()=>{if(f.clear(),h.current="hide",!b.hide){y(!1);return}f.set(()=>{h.current==="hide"&&y(!1)},b.hide)},[b.hide,y,f]),S=g.useCallback((...W)=>{N(),x?.(...W)},[N,x]),R=g.useCallback((...W)=>{M(),k?.(...W)},[M,k]),P=g.useCallback((...W)=>{y(!m),O?.(...W)},[O,y,m]),D=g.useCallback((...W)=>{Eu(N,W,"fromElement")},[N]),L=g.useCallback((...W)=>{Eu(M,W,"toElement")},[M]),V=t==null?[]:[].concat(t),K={ref:C};return V.indexOf("click")!==-1&&(K.onClick=P),V.indexOf("focus")!==-1&&(K.onFocus=S,K.onBlur=R),V.indexOf("hover")!==-1&&(K.onMouseOver=D,K.onMouseOut=L),v.jsxs(v.Fragment,{children:[typeof n=="function"?n(K):g.cloneElement(n,K),v.jsx(Vc,{...d,show:m,onHide:M,flip:c,placement:l,popperConfig:r,target:u.current,children:e})]})}Ph.defaultProps=zx;const $x={active:!1,disabled:!1,activeLabel:"(current)"},Es=g.forwardRef(({active:t,disabled:e,className:n,style:r,activeLabel:o,children:i,...s},a)=>{const l=t||e?"span":Br;return v.jsx("li",{ref:a,style:r,className:z(n,"page-item",{active:t,disabled:e}),children:v.jsxs(l,{className:"page-link",...s,children:[i,t&&o&&v.jsx("span",{className:"visually-hidden",children:o})]})})});Es.defaultProps=$x;Es.displayName="PageItem";function Ko(t,e,n=t){const r=g.forwardRef(({children:o,...i},s)=>v.jsxs(Es,{...i,ref:s,children:[v.jsx("span",{"aria-hidden":"true",children:o||e}),v.jsx("span",{className:"visually-hidden",children:n})]}));return r.displayName=t,r}const _x=Ko("First","«"),Vx=Ko("Prev","‹","Previous"),Ux=Ko("Ellipsis","…","More"),Hx=Ko("Next","›"),Kx=Ko("Last","»"),Lh=g.forwardRef(({bsPrefix:t,className:e,size:n,...r},o)=>{const i=_(t,"pagination");return v.jsx("ul",{ref:o,...r,className:z(e,i,n&&`${i}-${n}`)})});Lh.displayName="Pagination";Object.assign(Lh,{First:_x,Prev:Vx,Ellipsis:Ux,Item:Es,Next:Hx,Last:Kx});const Fh=g.forwardRef(({bsPrefix:t,className:e,as:n="div",...r},o)=>{const i=_(t,"row"),s=ql(),a=Jl(),l=`${i}-cols`,c=[];return s.forEach(d=>{const u=r[d];delete r[d];let p;u!=null&&typeof u=="object"?{cols:p}=u:p=u;const f=d!==a?`-${d}`:"";p!=null&&c.push(`${l}${f}-${p}`)}),v.jsx(n,{ref:o,...r,className:z(e,i,...c)})});Fh.displayName="Row";const Bh=g.forwardRef(({bsPrefix:t,variant:e,animation:n="border",size:r,as:o="div",className:i,...s},a)=>{t=_(t,"spinner");const l=`${t}-${n}`;return v.jsx(o,{ref:a,...s,className:z(i,l,r&&`${l}-${r}`,e&&`text-${e}`)})});Bh.displayName="Spinner";function Wx(t,e=lf,n=cf){const r=[];return Object.entries(t).forEach(([o,i])=>{i!=null&&(typeof i=="object"?e.forEach(s=>{const a=i[s];if(a!=null){const l=s!==n?`-${s}`:"";r.push(`${o}${l}-${a}`)}}):r.push(`${o}-${i}`))}),r}const zh=g.forwardRef(({as:t="div",bsPrefix:e,className:n,direction:r,gap:o,...i},s)=>{e=_(e,r==="horizontal"?"hstack":"vstack");const a=ql(),l=Jl();return v.jsx(t,{...i,ref:s,className:z(n,e,...Wx({gap:o},a,l))})});zh.displayName="Stack";const Gx=["active","eventKey","mountOnEnter","transition","unmountOnExit","role","onEnter","onEntering","onEntered","onExit","onExiting","onExited"],qx=["activeKey","getControlledId","getControllerId"],Jx=["as"];function Ba(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function $h(t){let{active:e,eventKey:n,mountOnEnter:r,transition:o,unmountOnExit:i,role:s="tabpanel",onEnter:a,onEntering:l,onEntered:c,onExit:d,onExiting:u,onExited:p}=t,f=Ba(t,Gx);const h=g.useContext(_r);if(!h)return[Object.assign({},f,{role:s}),{eventKey:n,isActive:e,mountOnEnter:r,transition:o,unmountOnExit:i,onEnter:a,onEntering:l,onEntered:c,onExit:d,onExiting:u,onExited:p}];const{activeKey:m,getControlledId:y,getControllerId:b}=h,x=Ba(h,qx),k=Mn(n);return[Object.assign({},f,{role:s,id:y(n),"aria-labelledby":b(n)}),{eventKey:n,isActive:e==null&&k!=null?Mn(m)===k:e,transition:o||x.transition,mountOnEnter:r??x.mountOnEnter,unmountOnExit:i??x.unmountOnExit,onEnter:a,onEntering:l,onEntered:c,onExit:d,onExiting:u,onExited:p}]}const _h=g.forwardRef((t,e)=>{let{as:n="div"}=t,r=Ba(t,Jx);const[o,{isActive:i,onEnter:s,onEntering:a,onEntered:l,onExit:c,onExiting:d,onExited:u,mountOnEnter:p,unmountOnExit:f,transition:h=Mc}]=$h(r);return v.jsx(_r.Provider,{value:null,children:v.jsx(Lt.Provider,{value:null,children:v.jsx(h,{in:i,onEnter:s,onEntering:a,onEntered:l,onExit:c,onExiting:d,onExited:u,mountOnEnter:p,unmountOnExit:f,children:v.jsx(n,Object.assign({},o,{ref:e,hidden:!i,"aria-hidden":!i}))})})})});_h.displayName="TabPanel";const Vh=t=>{const{id:e,generateChildId:n,onSelect:r,activeKey:o,defaultActiveKey:i,transition:s,mountOnEnter:a,unmountOnExit:l,children:c}=t,[d,u]=Af(o,i,r),p=Gf(e),f=g.useMemo(()=>n||((m,y)=>p?`${p}-${y}-${m}`:null),[p,n]),h=g.useMemo(()=>({onSelect:u,activeKey:d,transition:s,mountOnEnter:a||!1,unmountOnExit:l||!1,getControlledId:m=>f(m,"tabpane"),getControllerId:m=>f(m,"tab")}),[u,d,s,a,l,f]);return v.jsx(_r.Provider,{value:h,children:v.jsx(Lt.Provider,{value:u||null,children:c})})};Vh.Panel=_h;function Uh(t){return typeof t=="boolean"?t?Ot:Mc:t}const Hh=({transition:t,...e})=>v.jsx(Vh,{...e,transition:Uh(t)});Hh.displayName="TabContainer";const Xx=le("tab-content"),Kh=g.forwardRef(({bsPrefix:t,transition:e,...n},r)=>{const[{className:o,as:i="div",...s},{isActive:a,onEnter:l,onEntering:c,onEntered:d,onExit:u,onExiting:p,onExited:f,mountOnEnter:h,unmountOnExit:m,transition:y=Ot}]=$h({...n,transition:Uh(e)}),b=_(t,"tab-pane");return v.jsx(_r.Provider,{value:null,children:v.jsx(Lt.Provider,{value:null,children:v.jsx(y,{in:a,onEnter:l,onEntering:c,onEntered:d,onExit:u,onExiting:p,onExited:f,mountOnEnter:h,unmountOnExit:m,children:v.jsx(i,{...s,ref:r,className:z(o,b,a&&"active")})})})})});Kh.displayName="TabPane";const Yx={eventKey:E.oneOfType([E.string,E.number]),title:E.node.isRequired,disabled:E.bool,tabClassName:E.string,tabAttrs:E.object},Wh=()=>{throw new Error("ReactBootstrap: The `Tab` component is not meant to be rendered! It's an abstract component that is only valid as a direct Child of the `Tabs` Component. For custom tabs components use TabPane and TabsContainer directly")};Wh.propTypes=Yx;Object.assign(Wh,{Container:Hh,Content:Xx,Pane:Kh});const Zx=g.forwardRef(({bsPrefix:t,className:e,striped:n,bordered:r,borderless:o,hover:i,size:s,variant:a,responsive:l,...c},d)=>{const u=_(t,"table"),p=z(e,u,a&&`${u}-${a}`,s&&`${u}-${s}`,n&&`${u}-${typeof n=="string"?`striped-${n}`:"striped"}`,r&&`${u}-bordered`,o&&`${u}-borderless`,i&&`${u}-hover`),f=v.jsx("table",{...c,className:p,ref:d});if(l){let h=`${u}-responsive`;return typeof l=="string"&&(h=`${h}-${l}`),v.jsx("div",{className:h,children:f})}return f}),Qx={placement:"right"},Uc=g.forwardRef(({bsPrefix:t,placement:e,className:n,style:r,children:o,arrowProps:i,hasDoneInitialMeasure:s,popper:a,show:l,...c},d)=>{t=_(t,"tooltip");const u=ds(),[p]=e?.split("-")||[],f=jh(p,u);let h=r;return l&&!s&&(h={...r,...Rh(a?.strategy)}),v.jsxs("div",{ref:d,style:h,role:"tooltip","x-placement":p,className:z(n,t,`bs-tooltip-${f}`),...c,children:[v.jsx("div",{className:"tooltip-arrow",...i}),v.jsx("div",{className:`${t}-inner`,children:o})]})});Uc.defaultProps=Qx;Uc.displayName="Tooltip";const e1="_spacing_2mxlr_1",t1={spacing:e1},n1="_icon_18vzk_1",r1={icon:n1};function Hc({name:t}){return v.jsx("span",{className:`${r1.icon} ${t}`,role:"img","aria-label":t})}function se({size:t,variant:e="primary",disabled:n=!1,active:r,onClick:o,icon:i,withSpacing:s,type:a,children:l,...c}){return v.jsxs(Bo,{size:t,className:s?t1.spacing:"",variant:e,active:r,onClick:n?void 0:o,disabled:n,"aria-disabled":n,type:a,...c,children:[typeof i=="string"?v.jsx(Hc,{name:i}):i,l]})}const o1="_spacing_2mxlr_1",i1={spacing:o1},s1="_border_s2pz7_26",a1={border:s1};function fr({vertical:t,children:e,className:n,...r}){return v.jsx(ac,{vertical:t,className:`${a1.border} ${n||""}`,...r,children:e})}function l1({id:t,title:e,variant:n="primary",icon:r,withSpacing:o,asButtonGroup:i,onSelect:s,disabled:a,ariaLabel:l,customToggle:c,customToggleClassname:d,customToggleMenuClassname:u,align:p,size:f,children:h}){return c?v.jsxs(fe,{id:t,onSelect:s,className:d,align:p,children:[v.jsx(fe.Toggle,{as:c}),v.jsx(fe.Menu,{className:u,children:h})]}):v.jsx(Ec,{className:o?i1.spacing:"",size:f,id:t,title:v.jsxs(v.Fragment,{children:[typeof r=="string"?v.jsx(Hc,{name:r}):r,e&&e]}),"aria-label":l||e,variant:n,as:i?fr:void 0,disabled:a,align:p,onSelect:s,children:h})}function c1({href:t,eventKey:e,disabled:n,download:r,children:o,as:i,active:s,className:a,...l}){return v.jsx(fe.Item,{href:t,eventKey:e,disabled:n,download:r,as:i,active:s,className:a,...l,children:o})}function ze({children:t,...e}){return v.jsx(dc,{...e,children:t})}function or({children:t,...e}){return v.jsx(Fh,{...e,children:t})}function d1({href:t,onClick:e,disabled:n,children:r,as:o,...i}){const s=o;return v.jsx(Ah.Item,{href:t,onClick:e,disabled:n,as:s,...i,children:r})}function u1({title:t,id:e,children:n}){return v.jsx(Ah,{title:t,id:e,children:n})}u1.Item=d1;const p1="#c55b28",f1="#337ab7",h1="#e0e0e0",ie={brand:p1,primary:f1,secondary:h1,"text-color":"#333","sub-text-color":"#767676","primary-text-color":"#fff","secondary-text-color":"#333","headings-color":"#333","link-color":"#3174af","link-hover-color":"#23527c","success-color":"#3c763d","danger-color":"#a94442","warning-color":"#8a6d3b","info-color":"#31708f","success-box-color":"#e0e0e0","danger-box-color":"#f2dede","warning-box-color":"#fcf8e3","info-box-color":"#d9edf7","button-border-color":"#ccc","tooltip-fill-color":"#99bcdb","tooltip-border-color":"#337ab7"},dn={"font-weight":"400","font-size":"16px","font-size-sm":"12px","brand-font-size":"24px","font-family":'"Helvetica Neue", helvetica, arial, sans-serif',"font-weight-light":"300","font-weight-bold":"700","line-height":"1.5"},m1={themeKey:"base",color:{brand:ie.brand,primary:ie.primary,secondary:ie.secondary,successColor:ie["success-color"],warningColor:ie["warning-color"],infoColor:ie["info-color"],dangerColor:ie["danger-color"],textColor:ie["text-color"],subTextColor:ie["sub-text-color"],primaryTextColor:ie["primary-text-color"],secondaryTextColor:ie["secondary-text-color"],successTextColor:ie["success-text-color"],warningTextColor:ie["warning-text-color"],infoTextColor:ie["info-text-color"],dangerTextColor:ie["danger-text-color"],successBoxColor:ie["success-box-color"],warningBoxColor:ie["warning-box-color"],infoBoxColor:ie["info-box-color"],dangerBoxColor:ie["danger-box-color"],headingsColor:ie["headings-color"],linkColor:ie["link-color"],linkHoverColor:ie["link-hover-color"],buttonBorderColor:ie["button-border-color"],tooltipColor:ie["tooltip-fill-color"],tooltipHoverColor:ie["tooltip-border-color"]},typography:{fontSize:dn["font-size"],fontSizeSm:dn["font-size-sm"],brandFontSize:dn["brand-font-size"],fontFamily:dn["font-family"],fontWeight:dn["font-weight"],fontWeightBold:dn["font-weight-bold"],fontWeightLight:dn["font-weight-light"],lineHeight:dn["line-height"]}};g.createContext(m1);var g1=["color","size","title","className"];function za(){return za=Object.assign||function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function v1(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i=0)&&(n[o]=t[o]);return n}var Kc=g.forwardRef(function(t,e){var n=t.color,r=t.size,o=t.title,i=t.className,s=y1(t,g1);return A.createElement("svg",za({ref:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:r,height:r,fill:n,className:["bi","bi-arrow-left",i].filter(Boolean).join(" ")},s),o?A.createElement("title",null,o):null,A.createElement("path",{fillRule:"evenodd",d:"M15 8a.5.5 0 0 0-.5-.5H2.707l3.147-3.146a.5.5 0 1 0-.708-.708l-4 4a.5.5 0 0 0 0 .708l4 4a.5.5 0 0 0 .708-.708L2.707 8.5H14.5A.5.5 0 0 0 15 8"}))});Kc.propTypes={color:E.string,size:E.oneOfType([E.string,E.number]),title:E.string,className:E.string};Kc.defaultProps={color:"currentColor",size:"1em",title:null,className:""};var b1=["color","size","title","className"];function $a(){return $a=Object.assign||function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function w1(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i=0)&&(n[o]=t[o]);return n}var Wc=g.forwardRef(function(t,e){var n=t.color,r=t.size,o=t.title,i=t.className,s=x1(t,b1);return A.createElement("svg",$a({ref:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:r,height:r,fill:n,className:["bi","bi-arrow-right",i].filter(Boolean).join(" ")},s),o?A.createElement("title",null,o):null,A.createElement("path",{fillRule:"evenodd",d:"M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8"}))});Wc.propTypes={color:E.string,size:E.oneOfType([E.string,E.number]),title:E.string,className:E.string};Wc.defaultProps={color:"currentColor",size:"1em",title:null,className:""};var E1=["color","size","title","className"];function _a(){return _a=Object.assign||function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function O1(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i=0)&&(n[o]=t[o]);return n}var Gc=g.forwardRef(function(t,e){var n=t.color,r=t.size,o=t.title,i=t.className,s=k1(t,E1);return A.createElement("svg",_a({ref:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:r,height:r,fill:n,className:["bi","bi-blockquote-right",i].filter(Boolean).join(" ")},s),o?A.createElement("title",null,o):null,A.createElement("path",{d:"M2.5 3a.5.5 0 0 0 0 1h11a.5.5 0 0 0 0-1zm0 3a.5.5 0 0 0 0 1h6a.5.5 0 0 0 0-1zm0 3a.5.5 0 0 0 0 1h6a.5.5 0 0 0 0-1zm0 3a.5.5 0 0 0 0 1h11a.5.5 0 0 0 0-1zm10.113-5.373a7 7 0 0 0-.445-.275l.21-.352q.183.111.452.287.27.176.51.428.234.246.398.562.164.31.164.692 0 .54-.216.873-.217.328-.721.328-.322 0-.504-.211a.7.7 0 0 1-.188-.463q0-.345.211-.521.205-.182.569-.182h.281a1.7 1.7 0 0 0-.123-.498 1.4 1.4 0 0 0-.252-.37 2 2 0 0 0-.346-.298m-2.168 0A7 7 0 0 0 10 6.352L10.21 6q.183.111.452.287.27.176.51.428.234.246.398.562.164.31.164.692 0 .54-.216.873-.217.328-.721.328-.322 0-.504-.211a.7.7 0 0 1-.188-.463q0-.345.211-.521.206-.182.569-.182h.281a1.8 1.8 0 0 0-.117-.492 1.4 1.4 0 0 0-.258-.375 2 2 0 0 0-.346-.3z"}))});Gc.propTypes={color:E.string,size:E.oneOfType([E.string,E.number]),title:E.string,className:E.string};Gc.defaultProps={color:"currentColor",size:"1em",title:null,className:""};var C1=["color","size","title","className"];function Va(){return Va=Object.assign||function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function N1(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i=0)&&(n[o]=t[o]);return n}var Gh=g.forwardRef(function(t,e){var n=t.color,r=t.size,o=t.title,i=t.className,s=S1(t,C1);return A.createElement("svg",Va({ref:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:r,height:r,fill:n,className:["bi","bi-check-circle-fill",i].filter(Boolean).join(" ")},s),o?A.createElement("title",null,o):null,A.createElement("path",{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"}))});Gh.propTypes={color:E.string,size:E.oneOfType([E.string,E.number]),title:E.string,className:E.string};Gh.defaultProps={color:"currentColor",size:"1em",title:null,className:""};var T1=["color","size","title","className"];function Ua(){return Ua=Object.assign||function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function M1(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i=0)&&(n[o]=t[o]);return n}var qh=g.forwardRef(function(t,e){var n=t.color,r=t.size,o=t.title,i=t.className,s=A1(t,T1);return A.createElement("svg",Ua({ref:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:r,height:r,fill:n,className:["bi","bi-chevron-double-left",i].filter(Boolean).join(" ")},s),o?A.createElement("title",null,o):null,A.createElement("path",{fillRule:"evenodd",d:"M8.354 1.646a.5.5 0 0 1 0 .708L2.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0"}),A.createElement("path",{fillRule:"evenodd",d:"M12.354 1.646a.5.5 0 0 1 0 .708L6.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0"}))});qh.propTypes={color:E.string,size:E.oneOfType([E.string,E.number]),title:E.string,className:E.string};qh.defaultProps={color:"currentColor",size:"1em",title:null,className:""};var D1=["color","size","title","className"];function Ha(){return Ha=Object.assign||function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function R1(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i=0)&&(n[o]=t[o]);return n}var Jh=g.forwardRef(function(t,e){var n=t.color,r=t.size,o=t.title,i=t.className,s=j1(t,D1);return A.createElement("svg",Ha({ref:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:r,height:r,fill:n,className:["bi","bi-chevron-double-right",i].filter(Boolean).join(" ")},s),o?A.createElement("title",null,o):null,A.createElement("path",{fillRule:"evenodd",d:"M3.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L9.293 8 3.646 2.354a.5.5 0 0 1 0-.708"}),A.createElement("path",{fillRule:"evenodd",d:"M7.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L13.293 8 7.646 2.354a.5.5 0 0 1 0-.708"}))});Jh.propTypes={color:E.string,size:E.oneOfType([E.string,E.number]),title:E.string,className:E.string};Jh.defaultProps={color:"currentColor",size:"1em",title:null,className:""};var I1=["color","size","title","className"];function Ka(){return Ka=Object.assign||function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function L1(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i=0)&&(n[o]=t[o]);return n}var Xh=g.forwardRef(function(t,e){var n=t.color,r=t.size,o=t.title,i=t.className,s=P1(t,I1);return A.createElement("svg",Ka({ref:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:r,height:r,fill:n,className:["bi","bi-chevron-left",i].filter(Boolean).join(" ")},s),o?A.createElement("title",null,o):null,A.createElement("path",{fillRule:"evenodd",d:"M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0"}))});Xh.propTypes={color:E.string,size:E.oneOfType([E.string,E.number]),title:E.string,className:E.string};Xh.defaultProps={color:"currentColor",size:"1em",title:null,className:""};var F1=["color","size","title","className"];function Wa(){return Wa=Object.assign||function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function z1(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i=0)&&(n[o]=t[o]);return n}var Yh=g.forwardRef(function(t,e){var n=t.color,r=t.size,o=t.title,i=t.className,s=B1(t,F1);return A.createElement("svg",Wa({ref:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:r,height:r,fill:n,className:["bi","bi-chevron-right",i].filter(Boolean).join(" ")},s),o?A.createElement("title",null,o):null,A.createElement("path",{fillRule:"evenodd",d:"M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708"}))});Yh.propTypes={color:E.string,size:E.oneOfType([E.string,E.number]),title:E.string,className:E.string};Yh.defaultProps={color:"currentColor",size:"1em",title:null,className:""};var $1=["color","size","title","className"];function Ga(){return Ga=Object.assign||function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function V1(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i=0)&&(n[o]=t[o]);return n}var qc=g.forwardRef(function(t,e){var n=t.color,r=t.size,o=t.title,i=t.className,s=_1(t,$1);return A.createElement("svg",Ga({ref:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:r,height:r,fill:n,className:["bi","bi-code-square",i].filter(Boolean).join(" ")},s),o?A.createElement("title",null,o):null,A.createElement("path",{d:"M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"}),A.createElement("path",{d:"M6.854 4.646a.5.5 0 0 1 0 .708L4.207 8l2.647 2.646a.5.5 0 0 1-.708.708l-3-3a.5.5 0 0 1 0-.708l3-3a.5.5 0 0 1 .708 0m2.292 0a.5.5 0 0 0 0 .708L11.793 8l-2.647 2.646a.5.5 0 0 0 .708.708l3-3a.5.5 0 0 0 0-.708l-3-3a.5.5 0 0 0-.708 0"}))});qc.propTypes={color:E.string,size:E.oneOfType([E.string,E.number]),title:E.string,className:E.string};qc.defaultProps={color:"currentColor",size:"1em",title:null,className:""};var U1=["color","size","title","className"];function qa(){return qa=Object.assign||function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function K1(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i=0)&&(n[o]=t[o]);return n}var Jc=g.forwardRef(function(t,e){var n=t.color,r=t.size,o=t.title,i=t.className,s=H1(t,U1);return A.createElement("svg",qa({ref:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:r,height:r,fill:n,className:["bi","bi-code",i].filter(Boolean).join(" ")},s),o?A.createElement("title",null,o):null,A.createElement("path",{d:"M5.854 4.854a.5.5 0 1 0-.708-.708l-3.5 3.5a.5.5 0 0 0 0 .708l3.5 3.5a.5.5 0 0 0 .708-.708L2.707 8zm4.292 0a.5.5 0 0 1 .708-.708l3.5 3.5a.5.5 0 0 1 0 .708l-3.5 3.5a.5.5 0 0 1-.708-.708L13.293 8z"}))});Jc.propTypes={color:E.string,size:E.oneOfType([E.string,E.number]),title:E.string,className:E.string};Jc.defaultProps={color:"currentColor",size:"1em",title:null,className:""};var W1=["color","size","title","className"];function Ja(){return Ja=Object.assign||function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function q1(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i=0)&&(n[o]=t[o]);return n}var Zh=g.forwardRef(function(t,e){var n=t.color,r=t.size,o=t.title,i=t.className,s=G1(t,W1);return A.createElement("svg",Ja({ref:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:r,height:r,fill:n,className:["bi","bi-exclamation-circle-fill",i].filter(Boolean).join(" ")},s),o?A.createElement("title",null,o):null,A.createElement("path",{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M8 4a.905.905 0 0 0-.9.995l.35 3.507a.552.552 0 0 0 1.1 0l.35-3.507A.905.905 0 0 0 8 4m.002 6a1 1 0 1 0 0 2 1 1 0 0 0 0-2"}))});Zh.propTypes={color:E.string,size:E.oneOfType([E.string,E.number]),title:E.string,className:E.string};Zh.defaultProps={color:"currentColor",size:"1em",title:null,className:""};var J1=["color","size","title","className"];function Xa(){return Xa=Object.assign||function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Y1(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i=0)&&(n[o]=t[o]);return n}var Qh=g.forwardRef(function(t,e){var n=t.color,r=t.size,o=t.title,i=t.className,s=X1(t,J1);return A.createElement("svg",Xa({ref:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:r,height:r,fill:n,className:["bi","bi-exclamation-triangle-fill",i].filter(Boolean).join(" ")},s),o?A.createElement("title",null,o):null,A.createElement("path",{d:"M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5m.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2"}))});Qh.propTypes={color:E.string,size:E.oneOfType([E.string,E.number]),title:E.string,className:E.string};Qh.defaultProps={color:"currentColor",size:"1em",title:null,className:""};var Z1=["color","size","title","className"];function Ya(){return Ya=Object.assign||function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function ew(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i=0)&&(n[o]=t[o]);return n}var Xc=g.forwardRef(function(t,e){var n=t.color,r=t.size,o=t.title,i=t.className,s=Q1(t,Z1);return A.createElement("svg",Ya({ref:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:r,height:r,fill:n,className:["bi","bi-image",i].filter(Boolean).join(" ")},s),o?A.createElement("title",null,o):null,A.createElement("path",{d:"M6.002 5.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"}),A.createElement("path",{d:"M2.002 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2zm12 1a1 1 0 0 1 1 1v6.5l-3.777-1.947a.5.5 0 0 0-.577.093l-3.71 3.71-2.66-1.772a.5.5 0 0 0-.63.062L1.002 12V3a1 1 0 0 1 1-1z"}))});Xc.propTypes={color:E.string,size:E.oneOfType([E.string,E.number]),title:E.string,className:E.string};Xc.defaultProps={color:"currentColor",size:"1em",title:null,className:""};var tw=["color","size","title","className"];function Za(){return Za=Object.assign||function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function rw(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i=0)&&(n[o]=t[o]);return n}var em=g.forwardRef(function(t,e){var n=t.color,r=t.size,o=t.title,i=t.className,s=nw(t,tw);return A.createElement("svg",Za({ref:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:r,height:r,fill:n,className:["bi","bi-info-circle-fill",i].filter(Boolean).join(" ")},s),o?A.createElement("title",null,o):null,A.createElement("path",{d:"M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2"}))});em.propTypes={color:E.string,size:E.oneOfType([E.string,E.number]),title:E.string,className:E.string};em.defaultProps={color:"currentColor",size:"1em",title:null,className:""};var ow=["color","size","title","className"];function Qa(){return Qa=Object.assign||function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function sw(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i=0)&&(n[o]=t[o]);return n}var Yc=g.forwardRef(function(t,e){var n=t.color,r=t.size,o=t.title,i=t.className,s=iw(t,ow);return A.createElement("svg",Qa({ref:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:r,height:r,fill:n,className:["bi","bi-link",i].filter(Boolean).join(" ")},s),o?A.createElement("title",null,o):null,A.createElement("path",{d:"M6.354 5.5H4a3 3 0 0 0 0 6h3a3 3 0 0 0 2.83-4H9q-.13 0-.25.031A2 2 0 0 1 7 10.5H4a2 2 0 1 1 0-4h1.535c.218-.376.495-.714.82-1z"}),A.createElement("path",{d:"M9 5.5a3 3 0 0 0-2.83 4h1.098A2 2 0 0 1 9 6.5h3a2 2 0 1 1 0 4h-1.535a4 4 0 0 1-.82 1H12a3 3 0 1 0 0-6z"}))});Yc.propTypes={color:E.string,size:E.oneOfType([E.string,E.number]),title:E.string,className:E.string};Yc.defaultProps={color:"currentColor",size:"1em",title:null,className:""};var aw=["color","size","title","className"];function el(){return el=Object.assign||function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function cw(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i=0)&&(n[o]=t[o]);return n}var Zc=g.forwardRef(function(t,e){var n=t.color,r=t.size,o=t.title,i=t.className,s=lw(t,aw);return A.createElement("svg",el({ref:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:r,height:r,fill:n,className:["bi","bi-list-ol",i].filter(Boolean).join(" ")},s),o?A.createElement("title",null,o):null,A.createElement("path",{fillRule:"evenodd",d:"M5 11.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5"}),A.createElement("path",{d:"M1.713 11.865v-.474H2c.217 0 .363-.137.363-.317 0-.185-.158-.31-.361-.31-.223 0-.367.152-.373.31h-.59c.016-.467.373-.787.986-.787.588-.002.954.291.957.703a.595.595 0 0 1-.492.594v.033a.615.615 0 0 1 .569.631c.003.533-.502.8-1.051.8-.656 0-1-.37-1.008-.794h.582c.008.178.186.306.422.309.254 0 .424-.145.422-.35-.002-.195-.155-.348-.414-.348h-.3zm-.004-4.699h-.604v-.035c0-.408.295-.844.958-.844.583 0 .96.326.96.756 0 .389-.257.617-.476.848l-.537.572v.03h1.054V9H1.143v-.395l.957-.99c.138-.142.293-.304.293-.508 0-.18-.147-.32-.342-.32a.33.33 0 0 0-.342.338zM2.564 5h-.635V2.924h-.031l-.598.42v-.567l.629-.443h.635z"}))});Zc.propTypes={color:E.string,size:E.oneOfType([E.string,E.number]),title:E.string,className:E.string};Zc.defaultProps={color:"currentColor",size:"1em",title:null,className:""};var dw=["color","size","title","className"];function tl(){return tl=Object.assign||function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function pw(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i=0)&&(n[o]=t[o]);return n}var Qc=g.forwardRef(function(t,e){var n=t.color,r=t.size,o=t.title,i=t.className,s=uw(t,dw);return A.createElement("svg",tl({ref:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:r,height:r,fill:n,className:["bi","bi-list-ul",i].filter(Boolean).join(" ")},s),o?A.createElement("title",null,o):null,A.createElement("path",{fillRule:"evenodd",d:"M5 11.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5m-3 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2m0 4a1 1 0 1 0 0-2 1 1 0 0 0 0 2m0 4a1 1 0 1 0 0-2 1 1 0 0 0 0 2"}))});Qc.propTypes={color:E.string,size:E.oneOfType([E.string,E.number]),title:E.string,className:E.string};Qc.defaultProps={color:"currentColor",size:"1em",title:null,className:""};var fw=["color","size","title","className"];function nl(){return nl=Object.assign||function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function mw(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i=0)&&(n[o]=t[o]);return n}var ed=g.forwardRef(function(t,e){var n=t.color,r=t.size,o=t.title,i=t.className,s=hw(t,fw);return A.createElement("svg",nl({ref:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:r,height:r,fill:n,className:["bi","bi-question-circle-fill",i].filter(Boolean).join(" ")},s),o?A.createElement("title",null,o):null,A.createElement("path",{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M5.496 6.033h.825c.138 0 .248-.113.266-.25.09-.656.54-1.134 1.342-1.134.686 0 1.314.343 1.314 1.168 0 .635-.374.927-.965 1.371-.673.489-1.206 1.06-1.168 1.987l.003.217a.25.25 0 0 0 .25.246h.811a.25.25 0 0 0 .25-.25v-.105c0-.718.273-.927 1.01-1.486.609-.463 1.244-.977 1.244-2.056 0-1.511-1.276-2.241-2.673-2.241-1.267 0-2.655.59-2.75 2.286a.237.237 0 0 0 .241.247m2.325 6.443c.61 0 1.029-.394 1.029-.927 0-.552-.42-.94-1.029-.94-.584 0-1.009.388-1.009.94 0 .533.425.927 1.01.927z"}))});ed.propTypes={color:E.string,size:E.oneOfType([E.string,E.number]),title:E.string,className:E.string};ed.defaultProps={color:"currentColor",size:"1em",title:null,className:""};var gw=["color","size","title","className"];function rl(){return rl=Object.assign||function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function vw(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i=0)&&(n[o]=t[o]);return n}var td=g.forwardRef(function(t,e){var n=t.color,r=t.size,o=t.title,i=t.className,s=yw(t,gw);return A.createElement("svg",rl({ref:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:r,height:r,fill:n,className:["bi","bi-type-bold",i].filter(Boolean).join(" ")},s),o?A.createElement("title",null,o):null,A.createElement("path",{d:"M8.21 13c2.106 0 3.412-1.087 3.412-2.823 0-1.306-.984-2.283-2.324-2.386v-.055a2.176 2.176 0 0 0 1.852-2.14c0-1.51-1.162-2.46-3.014-2.46H3.843V13zM5.908 4.674h1.696c.963 0 1.517.451 1.517 1.244 0 .834-.629 1.32-1.73 1.32H5.908V4.673zm0 6.788V8.598h1.73c1.217 0 1.88.492 1.88 1.415 0 .943-.643 1.449-1.832 1.449H5.907z"}))});td.propTypes={color:E.string,size:E.oneOfType([E.string,E.number]),title:E.string,className:E.string};td.defaultProps={color:"currentColor",size:"1em",title:null,className:""};var bw=["color","size","title","className"];function ol(){return ol=Object.assign||function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function ww(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i=0)&&(n[o]=t[o]);return n}var nd=g.forwardRef(function(t,e){var n=t.color,r=t.size,o=t.title,i=t.className,s=xw(t,bw);return A.createElement("svg",ol({ref:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:r,height:r,fill:n,className:["bi","bi-type-h1",i].filter(Boolean).join(" ")},s),o?A.createElement("title",null,o):null,A.createElement("path",{d:"M7.648 13V3H6.3v4.234H1.348V3H0v10h1.348V8.421H6.3V13zM14 13V3h-1.333l-2.381 1.766V6.12L12.6 4.443h.066V13z"}))});nd.propTypes={color:E.string,size:E.oneOfType([E.string,E.number]),title:E.string,className:E.string};nd.defaultProps={color:"currentColor",size:"1em",title:null,className:""};var Ew=["color","size","title","className"];function il(){return il=Object.assign||function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Ow(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i=0)&&(n[o]=t[o]);return n}var rd=g.forwardRef(function(t,e){var n=t.color,r=t.size,o=t.title,i=t.className,s=kw(t,Ew);return A.createElement("svg",il({ref:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:r,height:r,fill:n,className:["bi","bi-type-h2",i].filter(Boolean).join(" ")},s),o?A.createElement("title",null,o):null,A.createElement("path",{d:"M7.495 13V3.201H6.174v4.15H1.32V3.2H0V13h1.32V8.513h4.854V13zm3.174-7.071v-.05c0-.934.66-1.752 1.801-1.752 1.005 0 1.76.639 1.76 1.651 0 .898-.582 1.58-1.12 2.19l-3.69 4.2V13h6.331v-1.149h-4.458v-.079L13.9 8.786c.919-1.048 1.666-1.874 1.666-3.101C15.565 4.149 14.35 3 12.499 3 10.46 3 9.384 4.393 9.384 5.879v.05z"}))});rd.propTypes={color:E.string,size:E.oneOfType([E.string,E.number]),title:E.string,className:E.string};rd.defaultProps={color:"currentColor",size:"1em",title:null,className:""};var Cw=["color","size","title","className"];function sl(){return sl=Object.assign||function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Nw(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i=0)&&(n[o]=t[o]);return n}var od=g.forwardRef(function(t,e){var n=t.color,r=t.size,o=t.title,i=t.className,s=Sw(t,Cw);return A.createElement("svg",sl({ref:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:r,height:r,fill:n,className:["bi","bi-type-h3",i].filter(Boolean).join(" ")},s),o?A.createElement("title",null,o):null,A.createElement("path",{d:"M11.07 8.4h1.049c1.174 0 1.99.69 2.004 1.724s-.802 1.786-2.068 1.779c-1.11-.007-1.905-.605-1.99-1.357h-1.21C8.926 11.91 10.116 13 12.028 13c1.99 0 3.439-1.188 3.404-2.87-.028-1.553-1.287-2.221-2.096-2.313v-.07c.724-.127 1.814-.935 1.772-2.293-.035-1.392-1.21-2.468-3.038-2.454-1.927.007-2.94 1.196-2.981 2.426h1.23c.064-.71.732-1.336 1.744-1.336 1.027 0 1.744.64 1.744 1.568.007.95-.738 1.639-1.744 1.639h-.991V8.4ZM7.495 13V3.201H6.174v4.15H1.32V3.2H0V13h1.32V8.513h4.854V13z"}))});od.propTypes={color:E.string,size:E.oneOfType([E.string,E.number]),title:E.string,className:E.string};od.defaultProps={color:"currentColor",size:"1em",title:null,className:""};var Tw=["color","size","title","className"];function al(){return al=Object.assign||function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Mw(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i=0)&&(n[o]=t[o]);return n}var id=g.forwardRef(function(t,e){var n=t.color,r=t.size,o=t.title,i=t.className,s=Aw(t,Tw);return A.createElement("svg",al({ref:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:r,height:r,fill:n,className:["bi","bi-type-italic",i].filter(Boolean).join(" ")},s),o?A.createElement("title",null,o):null,A.createElement("path",{d:"M7.991 11.674 9.53 4.455c.123-.595.246-.71 1.347-.807l.11-.52H7.211l-.11.52c1.06.096 1.128.212 1.005.807L6.57 11.674c-.123.595-.246.71-1.346.806l-.11.52h3.774l.11-.52c-1.06-.095-1.129-.211-1.006-.806z"}))});id.propTypes={color:E.string,size:E.oneOfType([E.string,E.number]),title:E.string,className:E.string};id.defaultProps={color:"currentColor",size:"1em",title:null,className:""};var Dw=["color","size","title","className"];function ll(){return ll=Object.assign||function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Rw(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i=0)&&(n[o]=t[o]);return n}var sd=g.forwardRef(function(t,e){var n=t.color,r=t.size,o=t.title,i=t.className,s=jw(t,Dw);return A.createElement("svg",ll({ref:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:r,height:r,fill:n,className:["bi","bi-type-strikethrough",i].filter(Boolean).join(" ")},s),o?A.createElement("title",null,o):null,A.createElement("path",{d:"M6.333 5.686c0 .31.083.581.27.814H5.166a2.8 2.8 0 0 1-.099-.76c0-1.627 1.436-2.768 3.48-2.768 1.969 0 3.39 1.175 3.445 2.85h-1.23c-.11-1.08-.964-1.743-2.25-1.743-1.23 0-2.18.602-2.18 1.607zm2.194 7.478c-2.153 0-3.589-1.107-3.705-2.81h1.23c.144 1.06 1.129 1.703 2.544 1.703 1.34 0 2.31-.705 2.31-1.675 0-.827-.547-1.374-1.914-1.675L8.046 8.5H1v-1h14v1h-3.504c.468.437.675.994.675 1.697 0 1.826-1.436 2.967-3.644 2.967"}))});sd.propTypes={color:E.string,size:E.oneOfType([E.string,E.number]),title:E.string,className:E.string};sd.defaultProps={color:"currentColor",size:"1em",title:null,className:""};var Iw=["color","size","title","className"];function cl(){return cl=Object.assign||function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Lw(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i=0)&&(n[o]=t[o]);return n}var ad=g.forwardRef(function(t,e){var n=t.color,r=t.size,o=t.title,i=t.className,s=Pw(t,Iw);return A.createElement("svg",cl({ref:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:r,height:r,fill:n,className:["bi","bi-type-underline",i].filter(Boolean).join(" ")},s),o?A.createElement("title",null,o):null,A.createElement("path",{d:"M5.313 3.136h-1.23V9.54c0 2.105 1.47 3.623 3.917 3.623s3.917-1.518 3.917-3.623V3.136h-1.23v6.323c0 1.49-.978 2.57-2.687 2.57s-2.687-1.08-2.687-2.57zM12.5 15h-9v-1h9z"}))});ad.propTypes={color:E.string,size:E.oneOfType([E.string,E.number]),title:E.string,className:E.string};ad.defaultProps={color:"currentColor",size:"1em",title:null,className:""};var Fw=["color","size","title","className"];function dl(){return dl=Object.assign||function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function zw(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i=0)&&(n[o]=t[o]);return n}var ld=g.forwardRef(function(t,e){var n=t.color,r=t.size,o=t.title,i=t.className,s=Bw(t,Fw);return A.createElement("svg",dl({ref:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:r,height:r,fill:n,className:["bi","bi-x",i].filter(Boolean).join(" ")},s),o?A.createElement("title",null,o):null,A.createElement("path",{d:"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708"}))});ld.propTypes={color:E.string,size:E.oneOfType([E.string,E.number]),title:E.string,className:E.string};ld.defaultProps={color:"currentColor",size:"1em",title:null,className:""};function $w({children:t,...e}){return v.jsx(ps.Item,{...e,children:t})}function _w({children:t,...e}){return v.jsx(ps.Body,{...e,children:t})}function Vw({children:t,...e}){return v.jsx(ps.Header,{...e,children:t})}const tm=g.forwardRef(({defaultActiveKey:t,alwaysOpen:e=!1,children:n,...r},o)=>v.jsx(ps,{defaultActiveKey:t,alwaysOpen:e,ref:o,...r,children:n}));tm.displayName="Accordion";const Qo=Object.assign(tm,{Item:$w,Body:_w,Header:Vw}),Uw=g.forwardRef(function({type:t="text",name:e,readOnly:n,isValid:r,isInvalid:o,disabled:i,value:s,required:a,autoFocus:l,autoComplete:c,size:d,...u},p){return v.jsx(he.Control,{name:e,type:t,readOnly:n,plaintext:n,isValid:r,isInvalid:o,disabled:i,value:s,required:a,autoFocus:l,autoComplete:c,size:d,ref:p,...u})}),Hw="_asterisk_13s6u_26",Kw={asterisk:Hw},ks=()=>v.jsxs("span",{role:"img","aria-label":"Required input symbol",className:Kw.asterisk,children:[" ","*"]}),Ww={"question-tooltip":"_question-tooltip_1w6dq_26"};function Gw(){return v.jsx(ed,{className:Ww["question-tooltip"]})}const qw="_tooltip_1v4bv_1",Jw={tooltip:qw};function Xw({placement:t,overlay:e,children:n,maxWidth:r=200}){return v.jsx(Ph,{placement:t,overlay:v.jsx(Uc,{style:{maxWidth:r,position:"fixed"},children:e}),children:v.jsx("div",{style:{display:"inline-block"},children:n})},t)}function Os({placement:t,message:e}){return v.jsx(Xw,{placement:t,overlay:e,children:v.jsx("span",{role:"img","aria-label":"tooltip icon",className:Jw.tooltip,children:v.jsx(Gw,{})})})}function Yw({required:t,message:e,htmlFor:n,column:r,children:o,...i}){return v.jsxs(he.Label,{htmlFor:n,column:r,...i,children:[o,t&&v.jsx(ks,{})," ",e&&v.jsx(Os,{placement:"right",message:e})]})}function Zw({children:t,className:e}){return v.jsx(he.Text,{muted:!0,className:e,children:t})}const Qw=g.forwardRef(function({value:t,isInvalid:e,isValid:n,disabled:r,autoFocus:o,children:i,...s},a){return v.jsx(he.Select,{value:t,isInvalid:e,isValid:n,disabled:r,autoFocus:o,ref:a,...s,children:i})}),eE=g.forwardRef(function({name:t,disabled:e,isValid:n,isInvalid:r,value:o,autoFocus:i,rows:s=5,...a},l){return v.jsx(he.Control,{as:"textarea",rows:s,disabled:e,name:t,isValid:n,isInvalid:r,value:o,autoFocus:i,ref:l,...a})}),tE=g.forwardRef(function({label:t,id:e,isValid:n,isInvalid:r,validFeedback:o,invalidFeedback:i,...s},a){return v.jsxs(he.Check,{type:"checkbox",id:e,children:[v.jsx(he.Check.Input,{type:"checkbox",isValid:n,isInvalid:r,ref:a,...s}),v.jsx(he.Check.Label,{children:t}),v.jsx(he.Control.Feedback,{type:"invalid",children:i}),v.jsx(he.Control.Feedback,{type:"valid",children:o})]})});function nE({type:t="valid",as:e,children:n,...r}){return v.jsx(ih.Feedback,{type:t,as:e,...r,children:n})}const rE=(t,e,n,r)=>({options:e,selected:t?r??[]:r??"",filteredOptions:[],searchValue:"",isMultiple:t,selectWord:n}),oE=(t,e)=>{switch(e.type){case"SELECT_OPTION":return t.isMultiple?{...t,selected:Array.from(new Set([...t.selected,e.payload]))}:{...t,selected:e.payload};case"REMOVE_OPTION":return{...t,selected:t.selected.filter(n=>n!==e.payload)};case"SELECT_ALL_OPTIONS":{const n=(t.filteredOptions.length>0?t.filteredOptions:t.options).map(r=>r.value);return{...t,selected:t.isMultiple?Array.from(new Set([...t.selected,...n])):t.selected}}case"DESELECT_ALL_OPTIONS":{if(t.filteredOptions.length>0){const n=new Set(t.filteredOptions.map(r=>r.value));return{...t,selected:t.selected.filter(r=>!n.has(r))}}return{...t,selected:[]}}case"SEARCH":return{...t,filteredOptions:iE(t,e.payload),searchValue:e.payload};case"UPDATE_OPTIONS":return{...t,options:e.payload};default:return t}},iE=(t,e)=>{if(e.trim()==="")return[];const n=e.toLowerCase();return t.options.filter(r=>r.label.toLowerCase().includes(n)||r.value.toLowerCase().includes(n))},qs=t=>({type:"SELECT_OPTION",payload:t}),Js=t=>({type:"REMOVE_OPTION",payload:t}),sE=()=>({type:"SELECT_ALL_OPTIONS"}),aE=()=>({type:"DESELECT_ALL_OPTIONS"}),lE=t=>({type:"SEARCH",payload:t}),cE=t=>({type:"UPDATE_OPTIONS",payload:t}),dE="_disabled_1mhzk_47",uE="_invalid_1mhzk_82",Be={"select-advanced-toggle":"_select-advanced-toggle_1mhzk_42",disabled:dE,"select-advanced-toggle__input-button":"_select-advanced-toggle__input-button_1mhzk_64",invalid:uE,"select-advanced-toggle__inner-content":"_select-advanced-toggle__inner-content_1mhzk_95","multiple-selected-options-container":"_multiple-selected-options-container_1mhzk_102","multiple-selected-options-container__item":"_multiple-selected-options-container__item_1mhzk_109","single-selected-option":"_single-selected-option_1mhzk_128","select-advanced-menu":"_select-advanced-menu_1mhzk_132","menu-header":"_menu-header_1mhzk_141","selected-count":"_selected-count_1mhzk_151","option-item":"_option-item_1mhzk_156","option-item__checkbox-input":"_option-item__checkbox-input_1mhzk_167","option-item-not-multiple":"_option-item-not-multiple_1mhzk_183"},nm=g.forwardRef(({isMultiple:t,selected:e,options:n=[],handleRemoveSelectedOption:r,isInvalid:o,isDisabled:i,inputButtonId:s,menuId:a,selectWord:l},c)=>{const d=g.useMemo(()=>new Map(n.map(p=>[p.value,p.label])),[n]),u=Array.isArray(e)?e:e?[e]:[];return v.jsxs("div",{className:`${Be["select-advanced-toggle"]} ${i?Be.disabled:""}`,children:[v.jsx(fe.Toggle,{ref:c,as:"input",type:"button",id:s,disabled:i,"aria-disabled":i,"aria-invalid":o,"aria-label":"Toggle options menu","aria-controls":a,className:`${Be["select-advanced-toggle__input-button"]} ${o?Be.invalid:""}`}),v.jsx("div",{className:Be["select-advanced-toggle__inner-content"],"data-testid":"toggle-inner-content",children:u.length>0?v.jsx("div",{className:Be["multiple-selected-options-container"],"aria-label":"List of selected options",role:"region",children:t?u.map(p=>{const f=d.get(p)??p;return v.jsxs("div",{className:Be["multiple-selected-options-container__item"],onClick:h=>h.stopPropagation(),children:[v.jsx("span",{className:"me-2",children:f}),v.jsx(Bo,{variant:"primary","aria-label":`Remove ${f} option`,onClick:()=>r(p),children:v.jsx(ld,{size:14})})]},`selected-option-${p}`)}):v.jsx("p",{className:Be["single-selected-option"],children:d.get(e)??e},`selected-option-${e}`)}):l})]})});nm.displayName="SelectAdvancedToggle";const pE=t=>{const{isMultiple:e,options:n,selected:r,filteredOptions:o,searchValue:i,handleToggleAllOptions:s,handleSearch:a,handleCheck:l,handleClickOption:c,isSearchable:d,menuId:u,selectWord:p}=t,f=g.useId(),h=g.useId(),m=g.useId(),y=o.length>0?o:n,b=i!==""&&o.length===0,x=Array.isArray(r)?r:[r],k=b?!1:y.length>0&&y.every(O=>x.includes(O.value));return v.jsxs(fe.Menu,{as:"menu",id:u,className:Be["select-advanced-menu"],popperConfig:{modifiers:[{name:"offset",options:{offset:()=>[0,0]}}]},children:[(e||d)&&v.jsxs(fe.Header,{className:Be["menu-header"],"aria-level":1,children:[e&&v.jsx(he.Check,{type:"checkbox","aria-label":"Toggle all options",id:h,onChange:s,checked:k,disabled:b}),d&&v.jsx(he.Control,{id:f,type:"text",placeholder:"Search...","aria-label":"Search for an option",size:"sm",onChange:a,"data-testid":"select-advanced-searchable-input"}),e&&!d&&v.jsxs("p",{className:Be["selected-count"],"data-testid":"select-advanced-selected-count",children:[x.filter(Boolean).length," selected"]})]}),!e&&i===""&&v.jsx(fe.Item,{as:"li",role:"option","data-value":"",id:`${m}-placeholder`,className:Be["option-item-not-multiple"],onClick:()=>c(""),active:r==="",children:p},"__placeholder__"),!b&&y.map(O=>e?v.jsx(fe.Item,{as:"li",className:Be["option-item"],role:"option","data-value":O.value,children:v.jsx(he.Check,{type:"checkbox",value:O.value,label:O.label,onChange:l,id:`${m}-${O.value}`,checked:x.includes(O.value),className:Be["option-item__checkbox-input"]})},O.value):v.jsx(fe.Item,{as:"li",role:"option","data-value":O.value,id:`${m}-${O.value}`,className:Be["option-item-not-multiple"],onClick:()=>c(O.value),active:r===O.value,children:O.label},O.value)),b&&v.jsx(fe.Item,{as:"li",disabled:!0,children:"No options found"})]})};function fE(t,e){let n;return function(...r){n!==void 0&&clearTimeout(n),n=setTimeout(()=>t(...r),e)}}function hE(t){return t?typeof t[0]=="string"||t.length===0?t.map(e=>({value:e,label:e})):t:[]}function mE(t,e){if(t.length!==e.length)return!1;const n=[...t].sort((o,i)=>o.value.localeCompare(i.value)),r=[...e].sort((o,i)=>o.value.localeCompare(i.value));for(let o=0;o{const d=g.useMemo(()=>hE(t),[t]),[{selected:u,filteredOptions:p,searchValue:f,options:h},m]=g.useReducer(oE,rE(!!r,d,l?.select??Xs.select,n)),y=gE(),b=g.useId(),x=g.useCallback(S=>{e&&e(S)},[e]);g.useEffect(()=>{if(mE(d,h))return;const S=new Set(d.map(R=>R.value));if(r){const R=u,P=R.filter(D=>!S.has(D));if(P.length>0){const D=R.filter(L=>S.has(L));x(D),P.forEach(L=>m(Js(L)))}}else{const R=u;R!==""&&!S.has(R)&&(m(qs("")),x(""))}m(cE(d))},[d,h,u,y,x,r]);const k=fE(S=>{const{value:R}=S.target;m(lE(R))},yE),O=S=>{const{value:R,checked:P}=S.target;if(P){const D=[...u,R];x(D),m(qs(R))}else{const D=u.filter(L=>L!==R);x(D),m(Js(R))}},C=S=>{u!==S&&(x(S),m(qs(S)))},N=S=>{const R=u.filter(P=>P!==S);x(R),m(Js(S))},M=S=>{if(S.target.checked){const R=p.length>0?p:h,P=Array.from(new Set([...u,...R.map(D=>D.value)]));x(P),m(sE())}else{const R=new Set((p.length>0?p:h).map(D=>D.value)),P=p.length>0?u.filter(D=>!R.has(D)):[];x(P),m(aE())}};return v.jsxs(fe,{autoClose:r?"outside":!0,className:s?"is-invalid":"",children:[v.jsx(nm,{isMultiple:!!r,selected:u,options:h,handleRemoveSelectedOption:N,isInvalid:s,isDisabled:i,inputButtonId:a,menuId:b,selectWord:l?.select??Xs.select,ref:c}),v.jsx(pE,{isMultiple:!!r,options:h,selected:u,filteredOptions:p,searchValue:f,handleToggleAllOptions:M,handleSearch:k,handleCheck:O,handleClickOption:C,isSearchable:o,menuId:b,selectWord:l?.select??Xs.select})]})});rm.displayName="SelectAdvanced";const om=g.forwardRef(({...t},e)=>v.jsx(rm,{ref:e,...t}));om.displayName="FormSelectAdvanced";const vE=g.forwardRef(function({label:t,id:e,isValid:n,isInvalid:r,validFeedback:o,invalidFeedback:i,...s},a){return v.jsxs(he.Check,{type:"radio",id:e,children:[v.jsx(he.Check.Input,{type:"radio",isValid:n,isInvalid:r,ref:a,...s}),v.jsx(he.Check.Label,{children:t}),v.jsx(he.Control.Feedback,{type:"invalid",children:i}),v.jsx(he.Control.Feedback,{type:"valid",children:o})]})});function _t({as:t=or,controlId:e,children:n,...r}){return v.jsx(he.Group,{controlId:e,className:"mb-3",as:t,...r,children:n})}_t.Label=Yw;_t.Input=Uw;_t.Select=Qw;_t.SelectAdvanced=om;_t.TextArea=eE;_t.Text=Zw;_t.Checkbox=tE;_t.Radio=vE;_t.Feedback=nE;const bE="_title_1nq4s_12",xE={title:bE},wE=({title:t,required:e,message:n,titleClassName:r})=>v.jsxs("span",{className:`${xE.title} ${r??""}`,children:[t," ",e&&v.jsx(ks,{})," ",n&&v.jsx(Os,{placement:"right",message:n})]});function EE({title:t,required:e,message:n,titleClassName:r,children:o}){return v.jsxs(or,{className:"mb-3",children:[v.jsx(ze,{sm:3,children:v.jsx(wE,{title:t,required:e,message:n,titleClassName:r})}),v.jsx(ze,{sm:9,className:"mb-3",children:o})]})}function kE({children:t}){return v.jsx(fh.Text,{children:t})}function im({children:t,hasValidation:e,className:n=""}){return v.jsx(fh,{className:`mb-3 ${n}`,hasValidation:e,children:t})}im.Text=kE;const OE="_title_so8qg_12",CE={title:OE};function SE({title:t,required:e,message:n,isValid:r,isInvalid:o,children:i}){const s=o?"is-invalid":r?"is-valid":"";return v.jsxs(or,{className:"mb-3",children:[v.jsx(ze,{sm:3,children:v.jsxs("span",{className:CE.title,children:[t," ",e&&v.jsx(ks,{})," ",n&&v.jsx(Os,{placement:"right",message:n})]})}),v.jsxs(ze,{sm:9,children:[v.jsx("div",{className:s}),i]})]})}const NE="_title_so8qg_12",TE={title:NE};function AE({title:t,required:e,message:n,isValid:r,isInvalid:o,children:i}){const s=o?"is-invalid":r?"is-valid":"";return v.jsxs(or,{className:"mb-3",children:[v.jsx(ze,{sm:3,children:v.jsxs("span",{className:TE.title,children:[t," ",e&&v.jsx(ks,{})," ",n&&v.jsx(Os,{placement:"right",message:n})]})}),v.jsxs(ze,{sm:9,children:[v.jsx("div",{className:s}),i]})]})}function oe({validated:t,onSubmit:e,children:n,className:r}){return v.jsx(he,{validated:t,onSubmit:e,className:r,noValidate:!0,children:n})}oe.InputGroup=im;oe.Group=_t;oe.GroupWithMultipleFields=EE;oe.CheckboxGroup=SE;oe.RadioGroup=AE;function ME({children:t}){return v.jsx(Ho.Header,{closeButton:!0,children:t})}function DE({children:t}){return v.jsx(Ho.Title,{children:t})}function jE({children:t}){return v.jsx(Ho.Body,{children:t})}function RE({children:t}){return v.jsx(Ho.Footer,{children:t})}function Ke({show:t,onHide:e,centered:n,size:r,children:o,ariaLabel:i}){return v.jsx(Ho,{centered:n,show:t,onHide:e,size:r,"aria-label":i,children:o})}Ke.Header=ME;Ke.Title=DE;Ke.Body=jE;Ke.Footer=RE;const IE="_table_15hw9_1",PE={table:IE};function LE({striped:t=!0,bordered:e=!0,borderless:n=!1,children:r}){return v.jsx(Zx,{striped:t,bordered:e,borderless:n,className:PE.table,children:r})}var w=(t=>(t.ASTRO="icon-astro",t.AUDIO="icon-audio",t.CODE="icon-code",t.COLLECTION="icon-collection",t.DATASET="icon-dataset",t.DOCUMENT="icon-document",t.FILE="icon-file",t.GEODATA="icon-geodata",t.IMAGE="icon-image",t.NETWORK="icon-network",t.OTHER="icon-other",t.PACKAGE="icon-package",t.TABULAR="icon-tabular",t.UNLOCK="icon-unlock",t.VIDEO="icon-video",t))(w||{});function FE({children:t,className:e}){return v.jsx(fs.Header,{className:e,children:t})}function BE({children:t,className:e}){return v.jsx(fs.Body,{className:e,children:t})}function zE({variant:t,className:e,...n}){return v.jsx(fs.Img,{variant:t,className:e,...n})}function xr({children:t,border:e,bg:n,className:r,...o}){return v.jsx(fs,{border:e,bg:n,className:r,...o,children:t})}xr.Header=FE;xr.Body=BE;xr.Image=zE;function $E({now:t,"aria-label":e="progress bar",...n}){return v.jsx("div",{className:"progress",children:v.jsx("div",{role:"progressbar",className:"progress-bar",style:{width:t?t.toString()+"%":void 0},"aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":100,"aria-label":e,...n})})}function ul({direction:t="vertical",gap:e=3,as:n,children:r,...o}){const i=n||"div";return v.jsx(zh,{direction:t,gap:e,as:i,...o,children:r})}const sm=({variant:t="primary",animation:e,size:n,role:r="status",as:o})=>v.jsx(Bh,{variant:t,animation:e,size:n,role:r,as:o,children:v.jsx("span",{className:"visually-hidden",children:"Loading..."})});var ku;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(ku||(ku={}));const _E=Object.freeze({x:0,y:0});var yr;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(yr||(yr={}));var Ou;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(Ou||(Ou={}));var Et;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter"})(Et||(Et={}));Et.Space,Et.Enter,Et.Esc,Et.Space,Et.Enter;var Cu;(function(t){t[t.RightClick=2]="RightClick"})(Cu||(Cu={}));var Su;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(Su||(Su={}));var Nu;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(Nu||(Nu={}));yr.Backward+"",yr.Forward+"",yr.Backward+"",yr.Forward+"";var pl;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(pl||(pl={}));var fl;(function(t){t.Optimized="optimized"})(fl||(fl={}));pl.WhileDragging,fl.Optimized;({..._E});var Tu;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Tu||(Tu={}));Et.Down,Et.Right,Et.Up,Et.Left;const VE=({onClick:t,ariaLabel:e="Close",...n})=>v.jsx(zr,{onClick:t,"aria-label":e,...n});function Se(t){this.content=t}Se.prototype={constructor:Se,find:function(t){for(var e=0;e>1}};Se.from=function(t){if(t instanceof Se)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Se(e)};function am(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),i=e.child(r);if(o==i){n+=o.nodeSize;continue}if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)n++;return n}if(o.content.size||i.content.size){let s=am(o.content,i.content,n+1);if(s!=null)return s}n+=o.nodeSize}}function lm(t,e,n,r){for(let o=t.childCount,i=e.childCount;;){if(o==0||i==0)return o==i?null:{a:n,b:r};let s=t.child(--o),a=e.child(--i),l=s.nodeSize;if(s==a){n-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let c=0,d=Math.min(s.text.length,a.text.length);for(;ce&&r(l,o+a,i||null,s)!==!1&&l.content.size){let d=a+1;l.nodesBetween(Math.max(0,e-d),Math.min(l.content.size,n-d),r,o+d)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let i="",s=!0;return this.nodesBetween(e,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?o?typeof o=="function"?o(a):o:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(s?s=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);ie)for(let i=0,s=0;se&&((sn)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),o+=a.nodeSize),s=l}return new j(r,o)}cutByIndex(e,n){return e==n?j.empty:e==0&&n==this.content.length?this:new j(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[e]=n,new j(o,i)}addToStart(e){return new j([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new j(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;nthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let o=this.child(n),i=r+o.nodeSize;if(i>=e)return i==e?ei(n+1,i):ei(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return j.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new j(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return j.empty;let n,r=0;for(let o=0;othis.type.rank&&(n||(n=e.slice(0,o)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;nr.type.rank-o.type.rank),n}};re.none=[];class Oi extends Error{}class F{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=dm(this.content,e+this.openStart,n);return r&&new F(r,this.openStart,this.openEnd)}removeBetween(e,n){return new F(cm(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return F.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new F(j.fromJSON(e,n.content),r,o)}static maxOpen(e,n=!0){let r=0,o=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)o++;return new F(e,r,o)}}F.empty=new F(j.empty,0,0);function cm(t,e,n){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(o==e||i.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(cm(i.content,e-o-1,n-o-1)))}function dm(t,e,n,r){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o);if(i==e||s.isText)return r&&!r.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=dm(s.content,e-i-1,n,s);return a&&t.replaceChild(o,s.copy(a))}function UE(t,e,n){if(n.openStart>t.depth)throw new Oi("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Oi("Inconsistent open depths");return um(t,e,n,0)}function um(t,e,n,r){let o=t.index(r),i=t.node(r);if(o==e.index(r)&&r=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function io(t,e,n,r){let o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(Gn(t.nodeAfter,r),i++));for(let a=i;ao&&ml(t,e,o+1),s=r.depth>o&&ml(n,r,o+1),a=[];return io(null,t,o,a),i&&s&&e.index(o)==n.index(o)?(pm(i,s),Gn(qn(i,fm(t,e,n,r,o+1)),a)):(i&&Gn(qn(i,Ci(t,e,o+1)),a),io(e,n,o,a),s&&Gn(qn(s,Ci(n,r,o+1)),a)),io(r,null,o,a),new j(a)}function Ci(t,e,n){let r=[];if(io(null,t,n,r),t.depth>n){let o=ml(t,e,n+1);Gn(qn(o,Ci(t,e,n+1)),r)}return io(e,null,n,r),new j(r)}function HE(t,e){let n=e.depth-t.openStart,r=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)r=e.node(o).copy(j.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}class wo{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(n);return r?e.child(n).cut(r):o}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let i=0;i0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Si(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,i=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(i),c=i-l;if(r.push(s,a,o+l),!c||(s=s.child(a),s.isText))break;i=c-1,o+=l+1}return new wo(n,r,i)}static resolveCached(e,n){let r=Au.get(e);if(r)for(let i=0;ie&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),hm(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=j.empty,o=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,o,i),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=o;ln.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let o=j.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,o,r);return i.type.checkAttrs(i.attrs),i}};On.prototype.text=void 0;class Ni extends On{constructor(e,n,r,o){if(super(e,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):hm(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Ni(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Ni(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function hm(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Qn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new qE(e,n);if(r.next==null)return Qn.empty;let o=mm(r);r.next&&r.err("Unexpected trailing text");let i=tk(ek(o));return nk(i,r),i}matchType(e){for(let n=0;nc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let o=0;o{let i=o+(r.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(r.next[s].next);return i}).join(` +`)}}Qn.empty=new Qn(!0);class qE{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function mm(t){let e=[];do e.push(JE(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function JE(t){let e=[];do e.push(XE(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function XE(t){let e=QE(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=YE(t,e);else break;return e}function Mu(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function YE(t,e){let n=Mu(t),r=n;return t.eat(",")&&(t.next!="}"?r=Mu(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function ZE(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let i in n){let s=n[i];s.isInGroup(e)&&o.push(s)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function QE(t){if(t.eat("(")){let e=mm(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=ZE(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function ek(t){let e=[[]];return o(i(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,l){let c={term:l,to:a};return e[s].push(c),c}function o(s,a){s.forEach(l=>l.to=a)}function i(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(i(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=i(s.exprs[l],a);if(l==s.exprs.length-1)return c;o(c,a=n())}else if(s.type=="star"){let l=n();return r(a,l),o(i(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return o(i(s.expr,a),l),o(i(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(i(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c{t[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let d=0;d{c||o.push([a,c=[]]),c.indexOf(d)==-1&&c.push(d)})})});let i=e[r.join(",")]=new Qn(r.indexOf(t.length-1)>-1);for(let s=0;s-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:vm(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new On(this,this.computeAttrs(e),j.from(n),re.setFrom(r))}createChecked(e=null,n,r){return n=j.from(n),this.checkContent(n),new On(this,this.computeAttrs(e),n,re.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=j.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let o=this.contentMatch.matchFragment(n),i=o&&o.fillBefore(j.empty,!0);return i?new On(this,e,n.append(i),re.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;nr[i]=new wm(i,n,s));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function rk(t,e,n){let r=n.split("|");return o=>{let i=o===null?"null":typeof o;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}class ok{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?rk(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Cs{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=xm(e,o.attrs),this.excluded=null;let i=ym(this.attrs);this.instance=i?new re(this,i):null}create(e=null){return!e&&this.instance?this.instance:new re(this,vm(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((i,s)=>r[i]=new Cs(i,o++,n,s)),r}removeFromSet(e){for(var n=0;n-1}}class Em{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in e)n[o]=e[o];n.nodes=Se.from(e.nodes),n.marks=Se.from(e.marks||{}),this.nodes=ju.compile(this.spec.nodes,this),this.marks=Cs.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],s=i.spec.content||"",a=i.spec.marks;if(i.contentMatch=r[s]||(r[s]=Qn.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=a=="_"?null:a?Ru(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:Ru(this,s.split(" "))}this.nodeFromJSON=o=>On.fromJSON(this,o),this.markFromJSON=o=>re.fromJSON(this,o),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof ju){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,o)}text(e,n){let r=this.nodes.text;return new Ni(r,r.defaultAttrs,e,re.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function Ru(t,e){let n=[];for(let r=0;r-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function ik(t){return t.tag!=null}function sk(t){return t.style!=null}class Cn{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(o=>{if(ik(o))this.tags.push(o);else if(sk(o)){let i=/[^=]*/.exec(o.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let i=e.nodes[o.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new Pu(this,n,!1);return r.addAll(e,re.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Pu(this,n,!0);return r.addAll(e,re.none,n.from,n.to),F.maxOpen(r.finish())}matchTag(e,n,r){for(let o=r?this.tags.indexOf(r)+1:0;oe.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(o){let i=o.priority==null?50:o.priority,s=0;for(;s{r(s=Lu(s)),s.mark||s.ignore||s.clearMark||(s.mark=o)})}for(let o in e.nodes){let i=e.nodes[o].spec.parseDOM;i&&i.forEach(s=>{r(s=Lu(s)),s.node||s.ignore||s.mark||(s.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Cn(e,Cn.schemaRules(e)))}}const km={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},ak={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Om={ol:!0,ul:!0},Eo=1,yl=2,so=4;function Iu(t,e,n){return e!=null?(e?Eo:0)|(e==="full"?yl:0):t&&t.whitespace=="pre"?Eo|yl:n&~so}class ti{constructor(e,n,r,o,i,s){this.type=e,this.attrs=n,this.marks=r,this.solid=o,this.options=s,this.content=[],this.activeMarks=re.none,this.match=i||(s&so?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(j.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(e.type))?(this.match=r,o):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Eo)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let n=j.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(j.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!km.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Pu{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let o=n.topNode,i,s=Iu(null,n.preserveWhitespace,0)|(r?so:0);o?i=new ti(o.type,o.attrs,re.none,!0,n.topMatch||o.type.contentMatch,s):r?i=new ti(null,null,re.none,!0,null,s):i=new ti(e.schema.topNodeType,null,re.none,!0,null,s),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,o=this.top,i=o.options&yl?"full":this.localPreserveWS||(o.options&Eo)>0;if(i==="full"||o.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)i!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,` +`);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=o.content[o.content.length-1],a=e.previousSibling;(!s||a&&a.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let o=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),a;Om.hasOwnProperty(s)&&this.parser.normalizeLists&&lk(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:ak.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,d=this.needsBlock;if(km.hasOwnProperty(s))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),c=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let u=l&&l.skip?n:this.readStyles(e,n);u&&this.addAll(e,u),c&&this.sync(i),this.needsBlock=d}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,l,c,l.consuming===!1?a:void 0)}this.localPreserveWS=o}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` +`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let o=0;o!l.clearMark(c)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,r,o){let i,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(i=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(o)this.addElement(e,r,o);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}i&&this.sync(a)&&this.open--}addAll(e,n,r,o){let i=r||0;for(let s=r?e.childNodes[r]:e.firstChild,a=o==null?null:e.childNodes[o];s!=a;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s,n);this.findAtPoint(e,i)}findPlace(e,n,r){let o,i;for(let s=this.open,a=0;s>=0;s--){let l=this.nodes[s],c=l.findWrapping(e);if(c&&(!o||o.length>c.length+a)&&(o=c,i=l,!c.length))break;if(l.solid){if(r)break;a+=2}}if(!o)return null;this.sync(i);for(let s=0;s(s.type?s.type.allowsMarkType(c.type):Fu(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new ti(e,n,l,o,null,a)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Eo)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=i;l--)if(s(a-1,l))return!0;return!1}else{let d=l>0||l==0&&o?this.nodes[l].type:r&&l>=i?r.node(l-i).type:null;if(!d||d.name!=c&&!d.isInGroup(c))return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function lk(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Om.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function ck(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Lu(t){let e={};for(let n in t)e[n]=t[n];return e}function Fu(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let i=[],s=a=>{i.push(a);for(let l=0;l{if(i.length||s.marks.length){let a=0,l=0;for(;a=0;o--){let i=this.serializeMark(e.marks[o],e.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,n,r={}){let o=this.marks[e.type.name];return o&&fi(Zs(r),o(e,n),null,e.attrs)}static renderSpec(e,n,r=null,o){return fi(e,n,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ir(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Bu(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Bu(e.marks)}}function Bu(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Zs(t){return t.document||window.document}const zu=new WeakMap;function dk(t){let e=zu.get(t);return e===void 0&&zu.set(t,e=uk(t)),e}function uk(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let o=0;o-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=o.indexOf(" ");s>0&&(n=o.slice(0,s),o=o.slice(s+1));let a,l=n?t.createElementNS(n,o):t.createElement(o),c=e[1],d=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){d=2;for(let u in c)if(c[u]!=null){let p=u.indexOf(" ");p>0?l.setAttributeNS(u.slice(0,p),u.slice(p+1),c[u]):u=="style"&&l.style?l.style.cssText=c[u]:l.setAttribute(u,c[u])}}for(let u=d;ud)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:f,contentDOM:h}=fi(t,p,n,r);if(l.appendChild(f),h){if(a)throw new RangeError("Multiple content holes");a=h}}}return{dom:l,contentDOM:a}}const Cm=65535,Sm=Math.pow(2,16);function pk(t,e){return t+e*Sm}function $u(t){return t&Cm}function fk(t){return(t-(t&Cm))/Sm}const Nm=1,Tm=2,hi=4,Am=8;class vl{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Am)>0}get deletedBefore(){return(this.delInfo&(Nm|hi))>0}get deletedAfter(){return(this.delInfo&(Tm|hi))>0}get deletedAcross(){return(this.delInfo&hi)>0}}class Ze{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Ze.empty)return Ze.empty}recover(e){let n=0,r=$u(e);if(!this.inverted)for(let o=0;oe)break;let c=this.ranges[a+i],d=this.ranges[a+s],u=l+c;if(e<=u){let p=c?e==l?-1:e==u?1:n:n,f=l+o+(p<0?0:d);if(r)return f;let h=e==(n<0?l:u)?null:pk(a/3,e-l),m=e==l?Tm:e==u?Nm:hi;return(n<0?e!=l:e!=u)&&(m|=Am),new vl(f,m,h)}o+=d-c}return r?e+o:new vl(e+o,0,null)}touches(e,n){let r=0,o=$u(n),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;ae)break;let c=this.ranges[a+i],d=l+c;if(e<=d&&a==o*3)return!0;r+=this.ranges[a+s]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o=0;n--){let o=e.getMirror(n);this.appendMap(e._maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let e=new ko;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;ri&&l!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),n.openStart,n.openEnd);return me.fromReplace(e,this.from,this.to,i)}invert(){return new Rt(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new wn(n.pos,r.pos,this.mark)}merge(e){return e instanceof wn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new wn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new wn(n.from,n.to,e.markFromJSON(n.mark))}}Le.jsonID("addMark",wn);class Rt extends Le{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new F(cd(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return me.fromReplace(e,this.from,this.to,r)}invert(){return new wn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Rt(n.pos,r.pos,this.mark)}merge(e){return e instanceof Rt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Rt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Rt(n.from,n.to,e.markFromJSON(n.mark))}}Le.jsonID("removeMark",Rt);class En extends Le{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return me.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return me.fromReplace(e,this.pos,this.pos+1,new F(j.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;or.pos?null:new Ee(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ee(n.from,n.to,n.gapFrom,n.gapTo,F.fromJSON(e,n.slice),n.insert,!!n.structure)}}Le.jsonID("replaceAround",Ee);function bl(t,e,n){let r=t.resolve(e),o=n-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function hk(t,e,n,r){let o=[],i=[],s,a;t.doc.nodesBetween(e,n,(l,c,d)=>{if(!l.isInline)return;let u=l.marks;if(!r.isInSet(u)&&d.type.allowsMarkType(r.type)){let p=Math.max(c,e),f=Math.min(c+l.nodeSize,n),h=r.addToSet(u);for(let m=0;mt.step(l)),i.forEach(l=>t.step(l))}function mk(t,e,n,r){let o=[],i=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;i++;let l=null;if(r instanceof Cs){let c=s.marks,d;for(;d=r.isInSet(c);)(l||(l=[])).push(d),c=d.removeFromSet(c)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,n);for(let d=0;dt.step(new Rt(s.from,s.to,s.style)))}function dd(t,e,n,r=n.contentMatch,o=!0){let i=t.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l=0;l--)t.step(s[l])}function gk(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Vr(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let r=t.$from.node(n),o=t.$from.index(n),i=t.$to.indexAfter(n);if(nn;h--)m||r.index(h)>0?(m=!0,d=j.from(r.node(h).copy(d)),u++):l--;let p=j.empty,f=0;for(let h=i,m=!1;h>n;h--)m||o.after(h+1)=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=j.from(n[s].type.create(n[s].attrs,r))}let o=e.start,i=e.end;t.step(new Ee(o,i,o,i,new F(r,0,0),n.length,!0))}function wk(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{let l=typeof o=="function"?o(s):o;if(s.isTextblock&&!s.hasMarkup(r,l)&&Ek(t.doc,t.mapping.slice(i).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let f=r.whitespace=="pre",h=!!r.contentMatch.matchType(r.schema.linebreakReplacement);f&&!h?c=!1:!f&&h&&(c=!0)}c===!1&&Dm(t,s,a,i),dd(t,t.mapping.slice(i).map(a,1),r,void 0,c===null);let d=t.mapping.slice(i),u=d.map(a,1),p=d.map(a+s.nodeSize,1);return t.step(new Ee(u,p,u+1,p-1,new F(j.from(r.create(l,null,s.marks)),0,0),1,!0)),c===!0&&Mm(t,s,a,i),!1}})}function Mm(t,e,n,r){e.forEach((o,i)=>{if(o.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(o.text);){let l=t.mapping.slice(r).map(n+1+i+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function Dm(t,e,n,r){e.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+i);t.replaceWith(s,s+1,e.type.schema.text(` +`))}})}function Ek(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function kk(t,e,n,r,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Ee(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new F(j.from(s),0,0),1,!0))}function en(t,e,n=1,r){let o=t.resolve(e),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,d=n-2;c>i;c--,d--){let u=o.node(c),p=o.index(c);if(u.type.spec.isolating)return!1;let f=u.content.cutByIndex(p,u.childCount),h=r&&r[d+1];h&&(f=f.replaceChild(0,h.type.create(h.attrs)));let m=r&&r[d]||u;if(!u.canReplace(p+1,u.childCount)||!m.type.validContent(f))return!1}let a=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function Ok(t,e,n=1,r){let o=t.doc.resolve(e),i=j.empty,s=j.empty;for(let a=o.depth,l=o.depth-n,c=n-1;a>l;a--,c--){i=j.from(o.node(a).copy(i));let d=r&&r[c];s=j.from(d?d.type.create(d.attrs,s):o.node(a).copy(s))}t.step(new we(e,e,new F(i.append(s),n,n),!0))}function In(t,e){let n=t.resolve(e),r=n.index();return jm(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Ck(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let o=0;o0?(i=r.node(o+1),a++,s=r.node(o).maybeChild(a)):(i=r.node(o).maybeChild(a-1),s=r.node(o+1)),i&&!i.isTextblock&&jm(i,s)&&r.node(o).canReplace(a,a+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function Sk(t,e,n){let r=null,{linebreakReplacement:o}=t.doc.type.schema,i=t.doc.resolve(e-n),s=i.node().type;if(o&&s.inlineContent){let d=s.whitespace=="pre",u=!!s.contentMatch.matchType(o);d&&!u?r=!1:!d&&u&&(r=!0)}let a=t.steps.length;if(r===!1){let d=t.doc.resolve(e+n);Dm(t,d.node(),d.before(),a)}s.inlineContent&&dd(t,e+n-1,s,i.node().contentMatchAt(i.index()),r==null);let l=t.mapping.slice(a),c=l.map(e-n);if(t.step(new we(c,l.map(e+n,-1),F.empty,!0)),r===!0){let d=t.doc.resolve(c);Mm(t,d.node(),d.before(),t.steps.length)}return t}function Nk(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let i=r.indexAfter(o);if(r.node(o).canReplaceWith(i,i,n))return r.after(o+1);if(i=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(a>0?1:0),c=r.node(s),d=!1;if(i==1)d=c.canReplace(l,l,o);else{let u=c.contentMatchAt(l).findWrapping(o.firstChild.type);d=u&&c.canReplaceWith(l,l,u[0])}if(d)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function Ns(t,e,n=e,r=F.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return Im(o,i,r)?new we(e,n,r):new Tk(o,i,r).fit()}function Im(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class Tk{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=j.empty;for(let o=0;o<=e.depth;o++){let i=e.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=j.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let i=this.placed,s=r.depth,a=o.depth;for(;s&&a&&i.childCount==1;)i=i.firstChild.content,s--,a--;let l=new F(i,s,a);return e>-1?new Ee(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new we(r.pos,o.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=ea(this.unplaced.content,r-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],d,u=null;if(n==1&&(s?c.matchType(s.type)||(u=c.fillBefore(j.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:u};if(n==2&&s&&(d=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:i,wrap:d};if(i&&c.matchType(i.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=ea(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new F(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=ea(e,n);if(o.childCount<=1&&n>0){let i=e.size-n<=n+o.size;this.unplaced=new F(Zr(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new F(Zr(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let m=0;m1||l==0||m.content.size)&&(u=y,d.push(Pm(m.mark(p.allowedMarks(m.marks)),c==1?l:0,c==a.childCount?f:-1)))}let h=c==a.childCount;h||(f=-1),this.placed=Qr(this.placed,n,j.from(d)),this.frontier[n].match=u,h&&f<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,y=a;m1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],i=n=0;a--){let{match:l,type:c}=this.frontier[a],d=ta(e,a,c,l,!0);if(!d||d.childCount)continue e}return{depth:n,fit:s,move:i?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Qr(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let o=e.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,i)}return e}openFrontierNode(e,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=Qr(this.placed,this.depth,j.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(j.empty,!0);e.childCount&&(this.placed=Qr(this.placed,this.frontier.length,e))}}function Zr(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Zr(t.firstChild.content,e-1,n)))}function Qr(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Qr(t.lastChild.content,e-1,n)))}function ea(t,e){for(let n=0;n1&&(r=r.replaceChild(0,Pm(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(j.empty,!0)))),t.copy(r)}function ta(t,e,n,r,o){let i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!Ak(n,i.content,s)?a:null}function Ak(t,e,n){for(let r=n;r0;p--,f--){let h=o.node(p).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;s.indexOf(p)>-1?a=p:o.before(p)==f&&s.splice(1,0,-p)}let l=s.indexOf(a),c=[],d=r.openStart;for(let p=r.content,f=0;;f++){let h=p.firstChild;if(c.push(h),f==r.openStart)break;p=h.content}for(let p=d-1;p>=0;p--){let f=c[p],h=Mk(f.type);if(h&&!f.sameMarkup(o.node(Math.abs(a)-1)))d=p;else if(h||!f.type.isTextblock)break}for(let p=r.openStart;p>=0;p--){let f=(p+d+1)%(r.openStart+1),h=c[f];if(h)for(let m=0;m=0&&(t.replace(e,n,r),!(t.steps.length>u));p--){let f=s[p];f<0||(e=o.before(f),n=i.after(f))}}function Lm(t,e,n,r,o){if(er){let i=o.contentMatchAt(0),s=i.fillBefore(t).append(t);t=s.append(i.matchFragment(s).fillBefore(j.empty,!0))}return t}function jk(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=Nk(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new F(j.from(r),0,0))}function Rk(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),i=Fm(r,o);for(let s=0;s0&&(l||r.node(a-1).canReplace(r.index(a-1),o.indexAfter(a-1))))return t.delete(r.before(a),o.after(a))}for(let s=1;s<=r.depth&&s<=o.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&o.end(s)-n!=o.depth-s&&r.start(s-1)==o.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),o.index(s-1)))return t.delete(r.before(s),n);t.delete(e,n)}function Fm(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let o=r;o>=0;o--){let i=t.start(o);if(ie.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&n.push(o)}return n}class wr extends Le{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return me.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return me.fromReplace(e,this.pos,this.pos+1,new F(j.from(o),0,n.isLeaf?0:1))}getMap(){return Ze.empty}invert(e){return new wr(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new wr(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new wr(n.pos,n.attr,n.value)}}Le.jsonID("attr",wr);class Oo extends Le{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let o in e.attrs)n[o]=e.attrs[o];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return me.ok(r)}getMap(){return Ze.empty}invert(e){return new Oo(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Oo(n.attr,n.value)}}Le.jsonID("docAttr",Oo);let Ar=class extends Error{};Ar=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Ar.prototype=Object.create(Error.prototype);Ar.prototype.constructor=Ar;Ar.prototype.name="TransformError";class Bm{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ko}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Ar(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=F.empty){let o=Ns(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new F(j.from(r),0,0))}delete(e,n){return this.replace(e,n,F.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return Dk(this,e,n,r),this}replaceRangeWith(e,n,r){return jk(this,e,n,r),this}deleteRange(e,n){return Rk(this,e,n),this}lift(e,n){return yk(this,e,n),this}join(e,n=1){return Sk(this,e,n),this}wrap(e,n){return xk(this,e,n),this}setBlockType(e,n=e,r,o=null){return wk(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return kk(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new wr(e,n,r)),this}setDocAttribute(e,n){return this.step(new Oo(e,n)),this}addNodeMark(e,n){return this.step(new En(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof re)n.isInSet(r.marks)&&this.step(new er(e,n));else{let o=r.marks,i,s=[];for(;i=n.isInSet(o);)s.push(new er(e,i)),o=i.removeFromSet(o);for(let a=s.length-1;a>=0;a--)this.step(s[a])}return this}split(e,n=1,r){return Ok(this,e,n,r),this}addMark(e,n,r){return hk(this,e,n,r),this}removeMark(e,n,r){return mk(this,e,n,r),this}clearIncompatible(e,n,r){return dd(this,e,n,r),this}}const na=Object.create(null);class X{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new Ik(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n=0;i--){let s=n<0?hr(e.node(0),e.node(i),e.before(i+1),e.index(i),n,r):hr(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new et(e.node(0))}static atStart(e){return hr(e,e,0,0,1)||new et(e)}static atEnd(e){return hr(e,e,e.content.size,e.childCount,-1)||new et(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=na[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in na)throw new RangeError("Duplicate use of selection JSON ID "+e);return na[e]=n,n.prototype.jsonID=e,n}getBookmark(){return q.between(this.$anchor,this.$head).getBookmark()}}X.prototype.visible=!0;class Ik{constructor(e,n){this.$from=e,this.$to=n}}let Vu=!1;function Uu(t){!Vu&&!t.parent.inlineContent&&(Vu=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class q extends X{constructor(e,n=e){Uu(e),Uu(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return X.near(r);let o=e.resolve(n.map(this.anchor));return new q(o.parent.inlineContent?o:r,r)}replace(e,n=F.empty){if(super.replace(e,n),n==F.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof q&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Ts(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new q(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let o=e.resolve(n);return new this(o,r==n?o:e.resolve(r))}static between(e,n,r){let o=e.pos-n.pos;if((!r||o)&&(r=o>=0?1:-1),!n.parent.inlineContent){let i=X.findFrom(n,r,!0)||X.findFrom(n,-r,!0);if(i)n=i.$head;else return X.near(n,r)}return e.parent.inlineContent||(o==0?e=n:(e=(X.findFrom(e,-r,!0)||X.findFrom(e,r,!0)).$anchor,e.pos0?0:1);o>0?s=0;s+=o){let a=e.child(s);if(a.isAtom){if(!i&&U.isSelectable(a))return U.create(t,n-(o<0?a.nodeSize:0))}else{let l=hr(t,a,n+o,o<0?a.childCount:0,o,i);if(l)return l}n+=a.nodeSize*o}return null}function Hu(t,e,n){let r=t.steps.length-1;if(r{s==null&&(s=d)}),t.setSelection(X.near(t.doc.resolve(s),n))}const Ku=1,ni=2,Wu=4;class Lk extends Bm{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=ni,this}ensureMarks(e){return re.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&ni)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~ni,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||re.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let o=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let i=this.storedMarks;if(!i){let s=this.doc.resolve(n);i=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(e,i)),this.selection.empty||this.setSelection(X.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Wu,this}get scrolledIntoView(){return(this.updated&Wu)>0}}function Gu(t,e){return!e||!t?t:t.bind(e)}class eo{constructor(e,n,r){this.name=e,this.init=Gu(n.init,r),this.apply=Gu(n.apply,r)}}const Fk=[new eo("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new eo("selection",{init(t,e){return t.selection||X.atStart(e.doc)},apply(t){return t.selection}}),new eo("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new eo("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class ra{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Fk.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new eo(r.key,r.spec.state,r))})}}class vr{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=e[r],i=o.spec.state;i&&i.toJSON&&(n[r]=i.toJSON.call(o,this[o.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new ra(e.schema,e.plugins),i=new vr(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=On.fromJSON(e.schema,n.doc);else if(s.name=="selection")i.selection=X.fromJSON(i.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){i[s.name]=c.fromJSON.call(l,e,n[a],i);return}}i[s.name]=s.init(e,i)}}),i}}function zm(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=zm(o,e,{})),n[r]=o}return n}class Ce{constructor(e){this.spec=e,this.props={},e.props&&zm(e.props,this,this.props),this.key=e.key?e.key.key:$m("plugin")}getState(e){return e[this.key]}}const oa=Object.create(null);function $m(t){return t in oa?t+"$"+ ++oa[t]:(oa[t]=0,t+"$")}class Xe{constructor(e="key"){this.key=$m(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Ne=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Mr=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let xl=null;const qt=function(t,e,n){let r=xl||(xl=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},Bk=function(){xl=null},tr=function(t,e,n,r){return n&&(qu(t,e,n,r,-1)||qu(t,e,n,r,1))},zk=/^(img|br|input|textarea|hr)$/i;function qu(t,e,n,r,o){for(var i;;){if(t==n&&e==r)return!0;if(e==(o<0?0:dt(t))){let s=t.parentNode;if(!s||s.nodeType!=1||Wo(t)||zk.test(t.nodeName)||t.contentEditable=="false")return!1;e=Ne(t)+(o<0?0:1),t=s}else if(t.nodeType==1){let s=t.childNodes[e+(o<0?-1:0)];if(s.nodeType==1&&s.contentEditable=="false")if(!((i=s.pmViewDesc)===null||i===void 0)&&i.ignoreForSelection)e+=o;else return!1;else t=s,e=o<0?dt(t):0}else return!1}}function dt(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function $k(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=dt(t)}else if(t.parentNode&&!Wo(t))e=Ne(t),t=t.parentNode;else return null}}function _k(t,e){for(;;){if(t.nodeType==3&&e2),at=Dr||(Ft?/Mac/.test(Ft.platform):!1),Kk=Ft?/Win/.test(Ft.platform):!1,Zt=/Android \d/.test(Pn),Go=!!Ju&&"webkitFontSmoothing"in Ju.documentElement.style,Wk=Go?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Gk(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Ht(t,e){return typeof t=="number"?t:t[e]}function qk(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function Xu(t,e,n){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let s=n||t.dom;s;){if(s.nodeType!=1){s=Mr(s);continue}let a=s,l=a==i.body,c=l?Gk(i):qk(a),d=0,u=0;if(e.topc.bottom-Ht(r,"bottom")&&(u=e.bottom-e.top>c.bottom-c.top?e.top+Ht(o,"top")-c.top:e.bottom-c.bottom+Ht(o,"bottom")),e.leftc.right-Ht(r,"right")&&(d=e.right-c.right+Ht(o,"right")),d||u)if(l)i.defaultView.scrollBy(d,u);else{let f=a.scrollLeft,h=a.scrollTop;u&&(a.scrollTop+=u),d&&(a.scrollLeft+=d);let m=a.scrollLeft-f,y=a.scrollTop-h;e={left:e.left-m,top:e.top-y,right:e.right-m,bottom:e.bottom-y}}let p=l?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(p))break;s=p=="absolute"?s.offsetParent:Mr(s)}}function Jk(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,o;for(let i=(e.left+e.right)/2,s=n+1;s=n-20){r=a,o=l.top;break}}return{refDOM:r,refTop:o,stack:Um(t.dom)}}function Um(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Mr(r));return e}function Xk({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Hm(n,r==0?0:r-e)}function Hm(t,e){for(let n=0;n=a){s=Math.max(h.bottom,s),a=Math.min(h.top,a);let m=h.left>e.left?h.left-e.left:h.right=(h.left+h.right)/2?1:0));continue}}else h.top>e.top&&!l&&h.left<=e.left&&h.right>=e.left&&(l=d,c={left:Math.max(h.left,Math.min(h.right,e.left)),top:h.top});!n&&(e.left>=h.right&&e.top>=h.top||e.left>=h.left&&e.top>=h.bottom)&&(i=u+1)}}return!n&&l&&(n=l,o=c,r=0),n&&n.nodeType==3?Zk(n,o):!n||r&&n.nodeType==1?{node:t,offset:i}:Km(n,o)}function Zk(t,e){let n=t.nodeValue.length,r=document.createRange();for(let o=0;o=(i.left+i.right)/2?1:0)}}return{node:t,offset:0}}function fd(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function Qk(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,o,i)}function tO(t,e,n,r){let o=-1;for(let i=e,s=!1;i!=t.dom;){let a=t.docView.nearestDesc(i,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!s&&l.left>r.left||l.top>r.top?o=a.posBefore:(!s&&l.right-1?o:t.docView.posFromDOM(e,n,-1)}function Wm(t,e,n){let r=t.childNodes.length;if(r&&n.tope.top&&o++}let c;Go&&o&&r.nodeType==1&&(c=r.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&o--,r==t.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(a=tO(t,r,o,e))}a==null&&(a=eO(t,s,e));let l=t.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Yu(t){return t.top=0&&o==r.nodeValue.length?(a--,c=1):n<0?a--:l++,Gr(pn(qt(r,a,l),c),c<0)}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&o&&(n<0||o==dt(r))){let a=r.childNodes[o-1];if(a.nodeType==1)return ia(a.getBoundingClientRect(),!1)}if(i==null&&o=0)}if(i==null&&o&&(n<0||o==dt(r))){let a=r.childNodes[o-1],l=a.nodeType==3?qt(a,dt(a)-(s?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(l)return Gr(pn(l,1),!1)}if(i==null&&o=0)}function Gr(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function ia(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function qm(t,e,n){let r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}function oO(t,e,n){let r=e.selection,o=n=="up"?r.$from:r.$to;return qm(t,e,()=>{let{node:i}=t.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let s=Gm(t,o.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=qt(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;cd.top+1&&(n=="up"?s.top-d.top>(d.bottom-s.top)*2:d.bottom-s.bottom>(s.bottom-d.top)*2))return!1}}return!0})}const iO=/[\u0590-\u08ac]/;function sO(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=t.domSelection();return a?!iO.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?i:s:qm(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:d,anchorOffset:u}=t.domSelectionRange(),p=a.caretBidiLevel;a.modify("move",n,"character");let f=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:h,focusOffset:m}=t.domSelectionRange(),y=h&&!f.contains(h.nodeType==1?h:h.parentNode)||l==h&&c==m;try{a.collapse(d,u),l&&(l!=d||c!=u)&&a.extend&&a.extend(l,c)}catch{}return p!=null&&(a.caretBidiLevel=p),y}):r.pos==r.start()||r.pos==r.end()}let Zu=null,Qu=null,ep=!1;function aO(t,e,n){return Zu==e&&Qu==n?ep:(Zu=e,Qu=n,ep=n=="up"||n=="down"?oO(t,e,n):sO(t,e,n))}const pt=0,tp=1,Vn=2,Bt=3;class qo{constructor(e,n,r,o){this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=pt,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;nNe(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&n==e.childNodes.length)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,o=e;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!n||i.node))if(r&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return i}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let o=e;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;ne||s instanceof Xm){o=e-i;break}i=a}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof Jm&&i.side>=0;r--);if(n<=0){let i,s=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,s=!1);return i&&n&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?Ne(i.dom)+1:0}}else{let i,s=!0;for(;i=r=d&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,d);e=s;for(let u=a;u>0;u--){let p=this.children[u-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){o=Ne(p.dom)+1;break}e-=p.size}o==-1&&(o=0)}if(o>-1&&(c>n||a==this.children.length-1)){n=c;for(let d=a+1;dh&&sn){let h=a;a=l,l=h}let f=document.createRange();f.setEnd(l.node,l.offset),f.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,o=0;o=r:er){let a=r+i.border,l=s-i.border;if(e>=a&&n<=l){this.dirty=e==r||n==s?Vn:tp,e==a&&n==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Bt:i.markDirty(e-a,n-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Vn:Bt}r=s}this.dirty=Vn}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Vn:tp;n.dirty{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,i=this}matchesWidget(e){return this.dirty==pt&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class lO extends qo{constructor(e,n,r,o){super(e,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class nr extends qo{constructor(e,n,r,o,i){super(e,[],r,o),this.mark=n,this.spec=i}static create(e,n,r,o){let i=o.nodeViews[n.type.name],s=i&&i(n,o,r);return(!s||!s.dom)&&(s=ir.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new nr(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&Bt||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Bt&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=pt){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(i=Cl(i,0,e,r));for(let a=0;a{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,o),d=c&&c.dom,u=c&&c.contentDOM;if(n.isText){if(!d)d=document.createTextNode(n.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:u}=ir.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!u&&!n.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),n.type.spec.draggable&&(d.draggable=!0));let p=d;return d=Qm(d,r,n),c?l=new cO(e,n,r,o,d,u||null,p,c,i,s+1):n.isText?new Ms(e,n,r,o,d,p,i):new Nn(e,n,r,o,d,u||null,p,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>j.empty)}return e}matchesNode(e,n,r){return this.dirty==pt&&e.eq(this.node)&&Ti(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,o=n,i=e.composing?this.localCompositionInfo(e,n):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new uO(this,s&&s.node,e);hO(this.node,this.innerDeco,(c,d,u)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!u&&l.syncToMarks(d==this.node.childCount?re.none:this.node.child(d).marks,r,e),l.placeWidget(c,e,o)},(c,d,u,p)=>{l.syncToMarks(c.marks,r,e);let f;l.findNodeMatch(c,d,u,p)||a&&e.state.selection.from>o&&e.state.selection.to-1&&l.updateNodeAt(c,d,u,f,e)||l.updateNextNode(c,d,u,e,p,o)||l.addNode(c,d,u,e,o),o+=c.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Vn)&&(s&&this.protectLocalComposition(e,s),Ym(this.contentDOM,this.children,e),Dr&&mO(this.dom))}localCompositionInfo(e,n){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof q)||rn+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let s=i.nodeValue,a=gO(this.node.content,s,r-n,o-n);return a<0?null:{node:i,pos:a,text:s}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let i=n;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new lO(this,i,n,o);e.input.compositionNodes.push(s),this.children=Cl(this.children,r,r+o.length,e,s)}update(e,n,r,o){return this.dirty==Bt||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,o),!0)}updateInner(e,n,r,o){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=pt}updateOuterDeco(e){if(Ti(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Zm(this.dom,this.nodeDOM,Ol(this.outerDeco,this.node,n),Ol(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function np(t,e,n,r,o){Qm(r,e,t);let i=new Nn(void 0,t,e,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class Ms extends Nn{constructor(e,n,r,o,i,s,a){super(e,n,r,o,i,null,s,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,o){return this.dirty==Bt||this.dirty!=pt&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=pt||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=e,this.dirty=pt,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let o=this.node.cut(e,n),i=document.createTextNode(o.text);return new Ms(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Bt)}get domAtom(){return!1}isText(e){return this.node.text==e}}class Xm extends qo{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==pt&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class cO extends Nn{constructor(e,n,r,o,i,s,a,l,c,d){super(e,n,r,o,i,s,a,c,d),this.spec=l}update(e,n,r,o){if(this.dirty==Bt)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,n,r);return i&&this.updateInner(e,n,r,o),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Ym(t,e,n){let r=t.firstChild,o=!1;for(let i=0;i>1,s=Math.min(i,e.length);for(;o-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=nr.create(this.top,e[i],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}}findNodeMatch(e,n,r,o){let i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))i=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof nr)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}function fO(t,e){return t.type.side-e.type.side}function hO(t,e,n,r){let o=e.locals(t),i=0;if(o.length==0){for(let c=0;ci;)a.push(o[s++]);let h=i+p.nodeSize;if(p.isText){let y=h;s!y.inline):a.slice();r(p,m,e.forChild(i,p),f),i=h}}function mO(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function gO(t,e,n,r){for(let o=0,i=0;o=n){if(i>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let c=a=0&&c+e.length+a>=n)return a+c;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function Cl(t,e,n,r,o){let i=[];for(let s=0,a=0;s=n||d<=e?i.push(l):(cn&&i.push(l.slice(n-c,l.size,r)))}return i}function hd(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),i=o&&o.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,c;if(As(n)){for(l=s;o&&!o.node;)o=o.parent;let u=o.node;if(o&&u.isAtom&&U.isSelectable(u)&&o.parent&&!(u.isInline&&Vk(n.focusNode,n.focusOffset,o.dom))){let p=o.posBefore;c=new U(s==p?a:r.resolve(p))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let u=s,p=s;for(let f=0;f{(n.anchorNode!=r||n.anchorOffset!=o)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!eg(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function vO(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,Ne(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&Je&&Sn<=11&&(n.disabled=!0,n.disabled=!1)}function tg(t,e){if(e instanceof U){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(ap(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else ap(t)}function ap(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function md(t,e,n,r){return t.someProp("createSelectionBetween",o=>o(t,e,n))||q.between(e,n,r)}function lp(t){return t.editable&&!t.hasFocus()?!1:ng(t)}function ng(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function bO(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return tr(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Sl(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return i&&X.findFrom(i,e)}function mn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function cp(t,e,n){let r=t.state.selection;if(r instanceof q)if(n.indexOf("s")>-1){let{$head:o}=r,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=t.state.doc.resolve(o.pos+i.nodeSize*(e<0?-1:1));return mn(t,new q(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let o=Sl(t.state,e);return o&&o instanceof U?mn(t,o):!1}else if(!(at&&n.indexOf("m")>-1)){let o=r.$head,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter,s;if(!i||i.isText)return!1;let a=e<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?U.isSelectable(i)?mn(t,new U(e<0?t.state.doc.resolve(o.pos-i.nodeSize):o)):Go?mn(t,new q(t.state.doc.resolve(e<0?a:a+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof U&&r.node.isInline)return mn(t,new q(e>0?r.$to:r.$from));{let o=Sl(t.state,e);return o?mn(t,o):!1}}}function Ai(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function lo(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function pr(t,e){return e<0?xO(t):wO(t)}function xO(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=!1;for(ut&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(lo(a,-1))o=n,i=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(rg(n))break;{let a=n.previousSibling;for(;a&&lo(a,-1);)o=n.parentNode,i=Ne(a),a=a.previousSibling;if(a)n=a,r=Ai(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Nl(t,n,r):o&&Nl(t,o,i)}function wO(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o=Ai(n),i,s;for(;;)if(r{t.state==o&&tn(t)},50)}function dp(t,e){let n=t.state.doc.resolve(e);if(!(Ie||Kk)&&n.parent.inlineContent){let r=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),i=(o.top+o.bottom)/2;if(i>r.top&&i1)return o.leftr.top&&i1)return o.left>r.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function up(t,e,n){let r=t.state.selection;if(r instanceof q&&!r.empty||n.indexOf("s")>-1||at&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Sl(t.state,e);if(s&&s instanceof U)return mn(t,s)}if(!o.parent.inlineContent){let s=e<0?o:i,a=r instanceof et?X.near(s,e):X.findFrom(s,e);return a?mn(t,a):!1}return!1}function pp(t,e){if(!(t.state.selection instanceof q))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let s=t.state.tr;return e<0?s.delete(n.pos-i.nodeSize,n.pos):s.delete(n.pos,n.pos+i.nodeSize),t.dispatch(s),!0}return!1}function fp(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function OO(t){if(!$e||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;fp(t,r,"true"),setTimeout(()=>fp(t,r,"false"),20)}return!1}function CO(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function SO(t,e){let n=e.keyCode,r=CO(e);if(n==8||at&&n==72&&r=="c")return pp(t,-1)||pr(t,-1);if(n==46&&!e.shiftKey||at&&n==68&&r=="c")return pp(t,1)||pr(t,1);if(n==13||n==27)return!0;if(n==37||at&&n==66&&r=="c"){let o=n==37?dp(t,t.state.selection.from)=="ltr"?-1:1:-1;return cp(t,o,r)||pr(t,o)}else if(n==39||at&&n==70&&r=="c"){let o=n==39?dp(t,t.state.selection.from)=="ltr"?1:-1:1;return cp(t,o,r)||pr(t,o)}else{if(n==38||at&&n==80&&r=="c")return up(t,-1,r)||pr(t,-1);if(n==40||at&&n==78&&r=="c")return OO(t)||up(t,1,r)||pr(t,1);if(r==(at?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function gd(t,e){t.someProp("transformCopied",f=>{e=f(e,t)});let n=[],{content:r,openStart:o,openEnd:i}=e;for(;o>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,i--;let f=r.firstChild;n.push(f.type.name,f.attrs!=f.type.defaultAttrs?f.attrs:null),r=f.content}let s=t.someProp("clipboardSerializer")||ir.fromSchema(t.state.schema),a=cg(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c=l.firstChild,d,u=0;for(;c&&c.nodeType==1&&(d=lg[c.nodeName.toLowerCase()]);){for(let f=d.length-1;f>=0;f--){let h=a.createElement(d[f]);for(;l.firstChild;)h.appendChild(l.firstChild);l.appendChild(h),u++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${i}${u?` -${u}`:""} ${JSON.stringify(n)}`);let p=t.someProp("clipboardTextSerializer",f=>f(e,t))||e.content.textBetween(0,e.content.size,` + +`);return{dom:l,text:p,slice:e}}function og(t,e,n,r,o){let i=o.parent.type.spec.code,s,a;if(!n&&!e)return null;let l=!!e&&(r||i||!n);if(l){if(t.someProp("transformPastedText",p=>{e=p(e,i||r,t)}),i)return a=new F(j.from(t.state.schema.text(e.replace(/\r\n?/g,` +`))),0,0),t.someProp("transformPasted",p=>{a=p(a,t,!0)}),a;let u=t.someProp("clipboardTextParser",p=>p(e,o,r,t));if(u)a=u;else{let p=o.marks(),{schema:f}=t.state,h=ir.fromSchema(f);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let y=s.appendChild(document.createElement("p"));m&&y.appendChild(h.serializeNode(f.text(m,p)))})}}else t.someProp("transformPastedHTML",u=>{n=u(n,t)}),s=MO(n),Go&&DO(s);let c=s&&s.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let u=+d[3];u>0;u--){let p=s.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;s=p}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Cn.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||d),context:o,ruleFromNode(u){return u.nodeName=="BR"&&!u.nextSibling&&u.parentNode&&!NO.test(u.parentNode.nodeName)?{ignore:!0}:null}})),d)a=jO(hp(a,+d[1],+d[2]),d[4]);else if(a=F.maxOpen(TO(a.content,o),!0),a.openStart||a.openEnd){let u=0,p=0;for(let f=a.content.firstChild;u{a=u(a,t,l)}),a}const NO=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function TO(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.index(n)),o,i=[];if(t.forEach(s=>{if(!i)return;let a=r.findWrapping(s.type),l;if(!a)return i=null;if(l=i.length&&o.length&&sg(a,o,s,i[i.length-1],0))i[i.length-1]=l;else{i.length&&(i[i.length-1]=ag(i[i.length-1],o.length));let c=ig(s,a);i.push(c),r=r.matchType(c.type),o=a}}),i)return j.from(i)}return t}function ig(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,j.from(t));return t}function sg(t,e,n,r,o){if(o1&&(i=0),o=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(j.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function hp(t,e,n){return en})),aa.createHTML(t)):t}function MO(t){let e=/^(\s*]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=cg().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),o;if((o=r&&lg[r[1].toLowerCase()])&&(t=o.map(i=>"<"+i+">").join("")+t+o.map(i=>"").reverse().join("")),n.innerHTML=AO(t),o)for(let i=0;i=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;o=j.from(l.create(r[a+1],o)),i++,s++}return new F(o,i,s)}const _e={},Ve={},RO={touchstart:!0,touchmove:!0};class IO{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function PO(t){for(let e in _e){let n=_e[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{FO(t,r)&&!yd(t,r)&&(t.editable||!(r.type in Ve))&&n(t,r)},RO[e]?{passive:!0}:void 0)}$e&&t.dom.addEventListener("input",()=>null),Al(t)}function kn(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function LO(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Al(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>yd(t,r))})}function yd(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function FO(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function BO(t,e){!yd(t,e)&&_e[e.type]&&(t.editable||!(e.type in Ve))&&_e[e.type](t,e)}Ve.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!ug(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Zt&&Ie&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Dr&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",o=>o(t,Bn(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||SO(t,n)?n.preventDefault():kn(t,"key")};Ve.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};Ve.keypress=(t,e)=>{let n=e;if(ug(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||at&&n.metaKey)return;if(t.someProp("handleKeyPress",o=>o(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof q)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode),i=()=>t.state.tr.insertText(o).scrollIntoView();!/[\r\n]/.test(o)&&!t.someProp("handleTextInput",s=>s(t,r.$from.pos,r.$to.pos,o,i))&&t.dispatch(i()),n.preventDefault()}};function Ds(t){return{left:t.clientX,top:t.clientY}}function zO(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function vd(t,e,n,r,o){if(r==-1)return!1;let i=t.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(t.someProp(e,a=>s>i.depth?a(t,n,i.nodeAfter,i.before(s),o,!0):a(t,n,i.node(s),i.before(s),o,!1)))return!0;return!1}function Er(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function $O(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&U.isSelectable(r)?(Er(t,new U(n)),!0):!1}function _O(t,e){if(e==-1)return!1;let n=t.state.selection,r,o;n instanceof U&&(r=n.node);let i=t.state.doc.resolve(e);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s);if(U.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?o=i.before(n.$from.depth):o=i.before(s);break}}return o!=null?(Er(t,U.create(t.state.doc,o)),!0):!1}function VO(t,e,n,r,o){return vd(t,"handleClickOn",e,n,r)||t.someProp("handleClick",i=>i(t,e,r))||(o?_O(t,n):$O(t,n))}function UO(t,e,n,r){return vd(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",o=>o(t,e,r))}function HO(t,e,n,r){return vd(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",o=>o(t,e,r))||KO(t,n,r)}function KO(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Er(t,q.create(r,0,r.content.size)),!0):!1;let o=r.resolve(e);for(let i=o.depth+1;i>0;i--){let s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)Er(t,q.create(r,a+1,a+1+s.content.size));else if(U.isSelectable(s))Er(t,U.create(r,a));else continue;return!0}}function bd(t){return Mi(t)}const dg=at?"metaKey":"ctrlKey";_e.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=bd(t),o=Date.now(),i="singleClick";o-t.input.lastClick.time<500&&zO(n,t.input.lastClick)&&!n[dg]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?i="doubleClick":t.input.lastClick.type=="doubleClick"&&(i="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i,button:n.button};let s=t.posAtCoords(Ds(n));s&&(i=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new WO(t,s,n,!!r)):(i=="doubleClick"?UO:HO)(t,s.pos,s.inside,n)?n.preventDefault():kn(t,"pointer"))};class WO{constructor(e,n,r,o){this.view=e,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[dg],this.allowDefault=r.shiftKey;let i,s;if(n.inside>-1)i=e.state.doc.nodeAt(n.inside),s=n.inside;else{let d=e.state.doc.resolve(n.pos);i=d.parent,s=d.depth?d.before():0}const a=o?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:c}=e.state;(r.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof U&&c.from<=s&&c.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&ut&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),kn(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>tn(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Ds(e))),this.updateAllowDefault(e),this.allowDefault||!n?kn(this.view,"pointer"):VO(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||$e&&this.mightDrag&&!this.mightDrag.node.isAtom||Ie&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Er(this.view,X.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):kn(this.view,"pointer")}move(e){this.updateAllowDefault(e),kn(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}_e.touchstart=t=>{t.input.lastTouch=Date.now(),bd(t),kn(t,"pointer")};_e.touchmove=t=>{t.input.lastTouch=Date.now(),kn(t,"pointer")};_e.contextmenu=t=>bd(t);function ug(t,e){return t.composing?!0:$e&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const GO=Zt?5e3:-1;Ve.compositionstart=Ve.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof q&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Mi(t,!0),t.markCursor=null;else if(Mi(t,!e.selection.empty),ut&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let o=r.focusNode,i=r.focusOffset;o&&o.nodeType==1&&i!=0;){let s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){let a=t.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else o=s,i=-1}}t.input.composing=!0}pg(t,GO)};Ve.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,pg(t,20))};function pg(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Mi(t),e))}function fg(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=JO());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function qO(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=$k(e.focusNode,e.focusOffset),r=_k(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let o=r.pmViewDesc,i=t.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!o||!o.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function JO(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Mi(t,e=!1){if(!(Zt&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),fg(t),e||t.docView&&t.docView.dirty){let n=hd(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function XO(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const Co=Je&&Sn<15||Dr&&Wk<604;_e.copy=Ve.cut=(t,e)=>{let n=e,r=t.state.selection,o=n.type=="cut";if(r.empty)return;let i=Co?null:n.clipboardData,s=r.content(),{dom:a,text:l}=gd(t,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):XO(t,a),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function YO(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function ZO(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?So(t,r.value,null,o,e):So(t,r.textContent,r.innerHTML,o,e)},50)}function So(t,e,n,r,o){let i=og(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,o,i||F.empty)))return!0;if(!i)return!1;let s=YO(i),a=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(i);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function hg(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Ve.paste=(t,e)=>{let n=e;if(t.composing&&!Zt)return;let r=Co?null:n.clipboardData,o=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&So(t,hg(r),r.getData("text/html"),o,n)?n.preventDefault():ZO(t,n)};class mg{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const QO=at?"altKey":"ctrlKey";function gg(t,e){return t.someProp("dragCopies",r=>!r(e))??!e[QO]}_e.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,i=o.empty?null:t.posAtCoords(Ds(n)),s;if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof U?o.to-1:o.to))){if(r&&r.mightDrag)s=U.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let u=t.docView.nearestDesc(n.target,!0);u&&u.node.type.spec.draggable&&u!=t.docView&&(s=U.create(t.state.doc,u.posBefore))}}let a=(s||t.state.selection).content(),{dom:l,text:c,slice:d}=gd(t,a);(!n.dataTransfer.files.length||!Ie||Vm>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Co?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Co||n.dataTransfer.setData("text/plain",c),t.dragging=new mg(d,gg(t,n),s)};_e.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};Ve.dragover=Ve.dragenter=(t,e)=>e.preventDefault();Ve.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let o=t.posAtCoords(Ds(n));if(!o)return;let i=t.state.doc.resolve(o.pos),s=r&&r.slice;s?t.someProp("transformPasted",h=>{s=h(s,t,!1)}):s=og(t,hg(n.dataTransfer),Co?null:n.dataTransfer.getData("text/html"),!1,i);let a=!!(r&&gg(t,n));if(t.someProp("handleDrop",h=>h(t,n,s||F.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?Rm(t.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let c=t.state.tr;if(a){let{node:h}=r;h?h.replace(c):c.deleteSelection()}let d=c.mapping.map(l),u=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,p=c.doc;if(u?c.replaceRangeWith(d,d,s.content.firstChild):c.replaceRange(d,d,s),c.doc.eq(p))return;let f=c.doc.resolve(d);if(u&&U.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new U(f));else{let h=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((m,y,b,x)=>h=x),c.setSelection(md(t,f,c.doc.resolve(h)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))};_e.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&tn(t)},20))};_e.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};_e.beforeinput=(t,e)=>{if(Ie&&Zt&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:n}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=n||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,Bn(8,"Backspace")))))return;let{$cursor:r}=t.state.selection;r&&r.pos>0&&t.dispatch(t.state.tr.delete(r.pos-1,r.pos).scrollIntoView())},50)}};for(let t in Ve)_e[t]=Ve[t];function No(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Di{constructor(e,n){this.toDOM=e,this.spec=n||Jn,this.side=this.spec.side||0}map(e,n,r,o){let{pos:i,deleted:s}=e.mapResult(n.from+o,this.side<0?-1:1);return s?null:new Qe(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Di&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&No(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Tn{constructor(e,n){this.attrs=e,this.spec=n||Jn}map(e,n,r,o){let i=e.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return i>=s?null:new Qe(i,s,this)}valid(e,n){return n.from=e&&(!i||i(a.spec))&&r.push(a.copy(a.from+o,a.to+o))}for(let s=0;se){let a=this.children[s]+1;this.children[s+2].findInner(e-a,n-a,r,o+a,i)}}map(e,n,r){return this==je||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Jn)}mapInner(e,n,r,o,i){let s;for(let a=0;a{let c=l+r,d;if(d=vg(n,a,c)){for(o||(o=this.children.slice());ia&&u.to=e){this.children[a]==e&&(r=this.children[a+2]);break}let i=e+1,s=i+n.content.size;for(let a=0;ai&&l.type instanceof Tn){let c=Math.max(i,l.from)-i,d=Math.min(s,l.to)-i;co.map(e,n,Jn));return vn.from(r)}forChild(e,n){if(n.isLeaf)return pe.empty;let r=[];for(let o=0;on instanceof pe)?e:e.reduce((n,r)=>n.concat(r instanceof pe?r:r.members),[]))}}forEachSet(e){for(let n=0;n{let y=m-h-(f-p);for(let b=0;bx+d-u)continue;let k=a[b]+d-u;f>=k?a[b+1]=p<=k?-2:-1:p>=d&&y&&(a[b]+=y,a[b+1]+=y)}u+=y}),d=n.maps[c].map(d,-1)}let l=!1;for(let c=0;c=r.content.size){l=!0;continue}let p=n.map(t[c+1]+i,-1),f=p-o,{index:h,offset:m}=r.content.findIndex(u),y=r.maybeChild(h);if(y&&m==u&&m+y.nodeSize==f){let b=a[c+2].mapInner(n,y,d+1,t[c]+i+1,s);b!=je?(a[c]=u,a[c+1]=f,a[c+2]=b):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=tC(a,t,e,n,o,i,s),d=ji(c,r,0,s);e=d.local;for(let u=0;un&&s.to{let c=vg(t,a,l+n);if(c){i=!0;let d=ji(c,a,n+l+1,r);d!=je&&o.push(l,l+a.nodeSize,d)}});let s=yg(i?bg(t):t,-n).sort(Xn);for(let a=0;a0;)e++;t.splice(e,0,n)}function la(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=je&&e.push(r)}),t.cursorWrapper&&e.push(pe.create(t.state.doc,[t.cursorWrapper.deco])),vn.from(e)}const nC={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},rC=Je&&Sn<=11;class oC{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class iC{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new oC,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;oo.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),rC&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,nC)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;nthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(lp(this.view)){if(this.suppressingSelectionUpdates)return tn(this.view);if(Je&&Sn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&tr(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let i=e.focusNode;i;i=Mr(i))n.add(i);for(let i=e.anchorNode;i;i=Mr(i))if(n.has(i)){r=i;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&lp(e)&&!this.ignoreSelectionChange(r),i=-1,s=-1,a=!1,l=[];if(e.editable)for(let d=0;du.nodeName=="BR");if(d.length==2){let[u,p]=d;u.parentNode&&u.parentNode.parentNode==p.parentNode?p.remove():u.remove()}else{let{focusNode:u}=this.currentSelection;for(let p of d){let f=p.parentNode;f&&f.nodeName=="LI"&&(!u||lC(e,u)!=f)&&p.remove()}}}let c=null;i<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||o)&&(i>-1&&(e.docView.markDirty(i,s),sC(e)),this.handleDOMChange(i,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||tn(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let d=0;do;y--){let b=r.childNodes[y-1],x=b.pmViewDesc;if(b.nodeName=="BR"&&!x){i=y;break}if(!x||x.size)break}let u=t.state.doc,p=t.someProp("domParser")||Cn.fromSchema(t.state.schema),f=u.resolve(s),h=null,m=p.parse(r,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:o,to:i,preserveWhitespace:f.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:dC,context:f});if(c&&c[0].pos!=null){let y=c[0].pos,b=c[1]&&c[1].pos;b==null&&(b=y),h={anchor:y+s,head:b+s}}return{doc:m,sel:h,from:s,to:a}}function dC(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if($e&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||$e&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const uC=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function pC(t,e,n,r,o){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let S=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,R=hd(t,S);if(R&&!t.state.selection.eq(R)){if(Ie&&Zt&&t.input.lastKeyCode===13&&Date.now()-100D(t,Bn(13,"Enter"))))return;let P=t.state.tr.setSelection(R);S=="pointer"?P.setMeta("pointer",!0):S=="key"&&P.scrollIntoView(),i&&P.setMeta("composition",i),t.dispatch(P)}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(n);e=s.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,c=cC(t,e,n),d=t.state.doc,u=d.slice(c.from,c.to),p,f;t.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Zt)&&o.some(S=>S.nodeType==1&&!uC.test(S.nodeName))&&(!h||h.endA>=h.endB)&&t.someProp("handleKeyDown",S=>S(t,Bn(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!h)if(r&&l instanceof q&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))h={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let S=xp(t,t.state.doc,c.sel);if(S&&!S.eq(t.state.selection)){let R=t.state.tr.setSelection(S);i&&R.setMeta("composition",i),t.dispatch(R)}}return}t.state.selection.fromt.state.selection.from&&h.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?h.start=t.state.selection.from:h.endA=t.state.selection.to-2&&t.state.selection.to<=c.to&&(h.endB+=t.state.selection.to-h.endA,h.endA=t.state.selection.to)),Je&&Sn<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>c.from&&c.doc.textBetween(h.start-c.from-1,h.start-c.from+1)=="  "&&(h.start--,h.endA--,h.endB--);let m=c.doc.resolveNoCache(h.start-c.from),y=c.doc.resolveNoCache(h.endB-c.from),b=d.resolve(h.start),x=m.sameParent(y)&&m.parent.inlineContent&&b.end()>=h.endA,k;if((Dr&&t.input.lastIOSEnter>Date.now()-225&&(!x||o.some(S=>S.nodeName=="DIV"||S.nodeName=="P"))||!x&&m.posm.pos)&&t.someProp("handleKeyDown",S=>S(t,Bn(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>h.start&&hC(d,h.start,h.endA,m,y)&&t.someProp("handleKeyDown",S=>S(t,Bn(8,"Backspace")))){Zt&&Ie&&t.domObserver.suppressSelectionUpdates();return}Ie&&h.endB==h.start&&(t.input.lastChromeDelete=Date.now()),Zt&&!x&&m.start()!=y.start()&&y.parentOffset==0&&m.depth==y.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==h.endA&&(h.endB-=2,y=c.doc.resolveNoCache(h.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(S){return S(t,Bn(13,"Enter"))})},20));let O=h.start,C=h.endA,N=S=>{let R=S||t.state.tr.replace(O,C,c.doc.slice(h.start-c.from,h.endB-c.from));if(c.sel){let P=xp(t,R.doc,c.sel);P&&!(Ie&&t.composing&&P.empty&&(h.start!=h.endB||t.input.lastChromeDeletetn(t),20));let S=N(t.state.tr.delete(O,C)),R=d.resolve(h.start).marksAcross(d.resolve(h.endA));R&&S.ensureMarks(R),t.dispatch(S)}else if(h.endA==h.endB&&(M=fC(m.parent.content.cut(m.parentOffset,y.parentOffset),b.parent.content.cut(b.parentOffset,h.endA-b.start())))){let S=N(t.state.tr);M.type=="add"?S.addMark(O,C,M.mark):S.removeMark(O,C,M.mark),t.dispatch(S)}else if(m.parent.child(m.index()).isText&&m.index()==y.index()-(y.textOffset?0:1)){let S=m.parent.textBetween(m.parentOffset,y.parentOffset),R=()=>N(t.state.tr.insertText(S,O,C));t.someProp("handleTextInput",P=>P(t,O,C,S,R))||t.dispatch(R())}}else t.dispatch(N())}function xp(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:md(t,e.resolve(n.anchor),e.resolve(n.head))}function fC(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,o=n,i=r,s,a,l;for(let d=0;dd.mark(a.addToSet(d.marks));else if(o.length==0&&i.length==1)a=i[0],s="remove",l=d=>d.mark(a.removeFromSet(d.marks));else return null;let c=[];for(let d=0;dn||ca(s,!0,!1)0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n){let i=t.node(r).maybeChild(t.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function mC(t,e,n,r,o){let i=t.findDiffStart(e,n);if(i==null)return null;let{a:s,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(o=="end"){let l=Math.max(0,i-Math.min(s,a));r-=s+l-i}if(s=s?i-r:0;i-=l,i&&i=a?i-r:0;i-=l,i&&i=56320&&e<=57343&&n>=55296&&n<=56319}class xg{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new IO,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Sp),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Op(this),kp(this),this.nodeViews=Cp(this),this.docView=np(this.state.doc,Ep(this),la(this),this.dom,this),this.domObserver=new iC(this,(r,o,i,s)=>pC(this,r,o,i,s)),this.domObserver.start(),PO(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Al(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Sp),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let o=this.state,i=!1,s=!1;e.storedMarks&&this.composing&&(fg(this),s=!0),this.state=e;let a=o.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let f=Cp(this);yC(f,this.nodeViews)&&(this.nodeViews=f,i=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&Al(this),this.editable=Op(this),kp(this);let l=la(this),c=Ep(this),d=o.plugins!=e.plugins&&!o.doc.eq(e.doc)?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",u=i||!this.docView.matchesNode(e.doc,c,l);(u||!e.selection.eq(o.selection))&&(s=!0);let p=d=="preserve"&&s&&this.dom.style.overflowAnchor==null&&Jk(this);if(s){this.domObserver.stop();let f=u&&(Je||Ie)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&gC(o.selection,e.selection);if(u){let h=Ie?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=qO(this)),(i||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=np(e.doc,c,l,this.dom,this)),h&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&bO(this))?tn(this,f):(tg(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),!((r=this.dragging)===null||r===void 0)&&r.node&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():p&&Xk(p)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))&&!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof U){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Xu(this,n.getBoundingClientRect(),e)}else Xu(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n0&&this.state.doc.nodeAt(i))==r.node&&(o=i)}this.dragging=new mg(e.slice,e.move,o<0?void 0:U.create(this.state.doc,o))}someProp(e,n){let r=this._props&&this._props[e],o;if(r!=null&&(o=n?n(r):r))return o;for(let s=0;sn.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return nO(this,e)}coordsAtPos(e,n=1){return Gm(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let o=this.docView.posFromDOM(e,n,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(e,n){return aO(this,n||this.state,e)}pasteHTML(e,n){return So(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return So(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return gd(this,e)}destroy(){this.docView&&(LO(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],la(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Bk())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return BO(this,e)}domSelectionRange(){let e=this.domSelection();return e?$e&&this.root.nodeType===11&&Uk(this.dom.ownerDocument)==this.dom&&aC(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}xg.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function Ep(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Qe.node(0,t.state.doc.content.size,e)]}function kp(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Qe.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Op(t){return!t.someProp("editable",e=>e(t.state)===!1)}function gC(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function Cp(t){let e=Object.create(null);function n(r){for(let o in r)Object.prototype.hasOwnProperty.call(e,o)||(e[o]=r[o])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function yC(t,e){let n=0,r=0;for(let o in t){if(t[o]!=e[o])return!0;n++}for(let o in e)r++;return n!=r}function Sp(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Dn={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Ri={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},vC=typeof navigator<"u"&&/Mac/.test(navigator.platform),bC=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Te=0;Te<10;Te++)Dn[48+Te]=Dn[96+Te]=String(Te);for(var Te=1;Te<=24;Te++)Dn[Te+111]="F"+Te;for(var Te=65;Te<=90;Te++)Dn[Te]=String.fromCharCode(Te+32),Ri[Te]=String.fromCharCode(Te);for(var da in Dn)Ri.hasOwnProperty(da)||(Ri[da]=Dn[da]);function xC(t){var e=vC&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||bC&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Ri:Dn)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const wC=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),EC=typeof navigator<"u"&&/Win/.test(navigator.platform);function kC(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,o,i,s;for(let a=0;at.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function Eg(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const kg=(t,e,n)=>{let r=Eg(t,n);if(!r)return!1;let o=kd(r);if(!o){let s=r.blockRange(),a=s&&Vr(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let i=o.nodeBefore;if(jg(t,o,e,-1))return!0;if(r.parent.content.size==0&&(jr(i,"end")||U.isSelectable(i)))for(let s=r.depth;;s--){let a=Ns(t.doc,r.before(s),r.after(s),F.empty);if(a&&a.slice.size1)break}return i.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0):!1},SC=(t,e,n)=>{let r=Eg(t,n);if(!r)return!1;let o=kd(r);return o?Og(t,o,e):!1},NC=(t,e,n)=>{let r=Sg(t,n);if(!r)return!1;let o=Od(r);return o?Og(t,o,e):!1};function Og(t,e,n){let r=e.nodeBefore,o=r,i=e.pos-1;for(;!o.isTextblock;i--){if(o.type.spec.isolating)return!1;let d=o.lastChild;if(!d)return!1;o=d}let s=e.nodeAfter,a=s,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let d=a.firstChild;if(!d)return!1;a=d}let c=Ns(t.doc,i,l,F.empty);if(!c||c.from!=i||c instanceof we&&c.slice.size>=l-i)return!1;if(n){let d=t.tr.step(c);d.setSelection(q.create(d.doc,i)),n(d.scrollIntoView())}return!0}function jr(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const Cg=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=kd(r)}let s=i&&i.nodeBefore;return!s||!U.isSelectable(s)?!1:(e&&e(t.tr.setSelection(U.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function kd(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function Sg(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{let r=Sg(t,n);if(!r)return!1;let o=Od(r);if(!o)return!1;let i=o.nodeAfter;if(jg(t,o,e,1))return!0;if(r.parent.content.size==0&&(jr(i,"start")||U.isSelectable(i))){let s=Ns(t.doc,r.before(),r.after(),F.empty);if(s&&s.slice.size{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset=0;e--){let n=t.node(e);if(t.index(e)+1{let n=t.selection,r=n instanceof U,o;if(r){if(n.node.isTextblock||!In(t.doc,n.from))return!1;o=n.from}else if(o=Ss(t.doc,n.from,-1),o==null)return!1;if(e){let i=t.tr.join(o);r&&i.setSelection(U.create(i.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0},AC=(t,e)=>{let n=t.selection,r;if(n instanceof U){if(n.node.isTextblock||!In(t.doc,n.to))return!1;r=n.to}else if(r=Ss(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},MC=(t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),i=o&&Vr(o);return i==null?!1:(e&&e(t.tr.lift(o,i).scrollIntoView()),!0)},Ag=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(` +`).scrollIntoView()),!0)};function Cd(t){for(let e=0;e{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=Cd(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(X.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},Mg=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof et||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=Cd(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let s=(!r.parentOffset&&o.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(en(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Vr(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)};function jC(t){return(e,n)=>{let{$from:r,$to:o}=e.selection;if(e.selection instanceof U&&e.selection.node.isBlock)return!r.parentOffset||!en(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let i=[],s,a,l=!1,c=!1;for(let f=r.depth;;f--)if(r.node(f).isBlock){l=r.end(f)==r.pos+(r.depth-f),c=r.start(f)==r.pos-(r.depth-f),a=Cd(r.node(f-1).contentMatchAt(r.indexAfter(f-1))),i.unshift(l&&a?{type:a}:null),s=f;break}else{if(f==1)return!1;i.unshift(null)}let d=e.tr;(e.selection instanceof q||e.selection instanceof et)&&d.deleteSelection();let u=d.mapping.map(r.pos),p=en(d.doc,u,i.length,i);if(p||(i[0]=a?{type:a}:null,p=en(d.doc,u,i.length,i)),!p)return!1;if(d.split(u,i.length,i),!l&&c&&r.node(s).type!=a){let f=d.mapping.map(r.before(s)),h=d.doc.resolve(f);a&&r.node(s-1).canReplaceWith(h.index(),h.index()+1,a)&&d.setNodeMarkup(d.mapping.map(r.before(s)),a)}return n&&n(d.scrollIntoView()),!0}}const RC=jC(),IC=(t,e)=>{let{$from:n,to:r}=t.selection,o,i=n.sharedDepth(r);return i==0?!1:(o=n.before(i),e&&e(t.tr.setSelection(U.create(t.doc,o))),!0)};function PC(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(o.isTextblock||In(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function jg(t,e,n,r){let o=e.nodeBefore,i=e.nodeAfter,s,a,l=o.type.spec.isolating||i.type.spec.isolating;if(!l&&PC(t,e,n))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(s=(a=o.contentMatchAt(o.childCount)).findWrapping(i.type))&&a.matchType(s[0]||i.type).validEnd){if(n){let f=e.pos+i.nodeSize,h=j.empty;for(let b=s.length-1;b>=0;b--)h=j.from(s[b].create(null,h));h=j.from(o.copy(h));let m=t.tr.step(new Ee(e.pos-1,f,e.pos,f,new F(h,1,0),s.length,!0)),y=m.doc.resolve(f+2*s.length);y.nodeAfter&&y.nodeAfter.type==o.type&&In(m.doc,y.pos)&&m.join(y.pos),n(m.scrollIntoView())}return!0}let d=i.type.spec.isolating||r>0&&l?null:X.findFrom(e,1),u=d&&d.$from.blockRange(d.$to),p=u&&Vr(u);if(p!=null&&p>=e.depth)return n&&n(t.tr.lift(u,p).scrollIntoView()),!0;if(c&&jr(i,"start",!0)&&jr(o,"end")){let f=o,h=[];for(;h.push(f),!f.isTextblock;)f=f.lastChild;let m=i,y=1;for(;!m.isTextblock;m=m.firstChild)y++;if(f.canReplace(f.childCount,f.childCount,m.content)){if(n){let b=j.empty;for(let k=h.length-1;k>=0;k--)b=j.from(h[k].copy(b));let x=t.tr.step(new Ee(e.pos-h.length,e.pos+i.nodeSize,e.pos+y,e.pos+i.nodeSize-y,new F(b,h.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}function Rg(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(n&&n(e.tr.setSelection(q.create(e.doc,t<0?o.start(i):o.end(i)))),!0):!1}}const LC=Rg(-1),FC=Rg(1);function BC(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=s&&ud(s,t,e);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function Np(t,e=null){return function(n,r){let o=!1;for(let i=0;i{if(o)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)o=!0;else{let d=n.doc.resolve(c),u=d.index();o=d.parent.canReplaceWith(u,u+1,t)}})}if(!o)return!1;if(r){let i=n.tr;for(let s=0;s=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=s.resolve(e.start-2);i=new Si(l,l,e.depth),e.endIndex=0;d--)i=j.from(n[d].type.create(n[d].attrs,i));t.step(new Ee(e.start-(r?2:0),e.end,e.start,e.end,new F(i,0,0),n.length,!0));let s=0;for(let d=0;ds.childCount>0&&s.firstChild.type==t);return i?n?r.node(i.depth-1).type==t?UC(e,n,t,i):HC(e,n,i):!0:!1}}function UC(t,e,n,r){let o=t.tr,i=r.end,s=r.$to.end(r.depth);im;h--)f-=o.child(h).nodeSize,r.delete(f-1,f+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==o.childCount,c=i.node(-1),d=i.index(-1);if(!c.canReplace(d+(a?0:1),d+1,s.content.append(l?j.empty:j.from(o))))return!1;let u=i.pos,p=u+s.nodeSize;return r.step(new Ee(u-(a?1:0),p+(l?1:0),u+1,p-1,new F((a?j.empty:j.from(o.copy(j.empty))).append(l?j.empty:j.from(o.copy(j.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function KC(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,c=>c.childCount>0&&c.firstChild.type==t);if(!i)return!1;let s=i.startIndex;if(s==0)return!1;let a=i.parent,l=a.child(s-1);if(l.type!=t)return!1;if(n){let c=l.lastChild&&l.lastChild.type==a.type,d=j.from(c?t.create():null),u=new F(j.from(t.create(null,j.from(a.type.create(null,d)))),c?3:1,0),p=i.start,f=i.end;n(e.tr.step(new Ee(p-(c?3:1),f,p,f,u,1,!0)).scrollIntoView())}return!0}}function js(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:o}=n,{storedMarks:i}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}class Rs{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:o}=n,{tr:i}=r,s=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...c)=>{const d=l(...c)(s);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(i),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,a=[],l=!!e,c=e||i.tr,d=()=>(!l&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(c),a.every(p=>p===!0)),u={...Object.fromEntries(Object.entries(r).map(([p,f])=>[p,(...h)=>{const m=this.buildProps(c,n),y=f(...h)(m);return a.push(y),u}])),run:d};return u}createCan(e){const{rawCommands:n,state:r}=this,o=!1,i=e||r.tr,s=this.buildProps(i,o);return{...Object.fromEntries(Object.entries(n).map(([a,l])=>[a,(...c)=>l(...c)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,o)}}buildProps(e,n=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,a={tr:e,editor:o,view:s,state:js({state:i,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,c])=>[l,(...d)=>c(...d)(a)]))}};return a}}class WC{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(o=>o.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(o=>o!==n):delete this.callbacks[e]),this}once(e,n){const r=(...o)=>{this.off(e,r),n.apply(this,o)};return this.on(e,r)}removeAllListeners(){this.callbacks={}}}function $(t,e,n){return t.config[e]===void 0&&t.parent?$(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?$(t.parent,e,n):null}):t.config[e]}function Is(t){const e=t.filter(o=>o.type==="extension"),n=t.filter(o=>o.type==="node"),r=t.filter(o=>o.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function Ig(t){const e=[],{nodeExtensions:n,markExtensions:r}=Is(t),o=[...n,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage,extensions:o},l=$(s,"addGlobalAttributes",a);l&&l().forEach(c=>{c.types.forEach(d=>{Object.entries(c.attributes).forEach(([u,p])=>{e.push({type:d,name:u,attribute:{...i,...p}})})})})}),o.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},l=$(s,"addAttributes",a);if(!l)return;const c=l();Object.entries(c).forEach(([d,u])=>{const p={...i,...u};typeof p?.default=="function"&&(p.default=p.default()),p!=null&&p.isRequired&&p?.default===void 0&&delete p.default,e.push({type:s.name,name:d,attribute:p})})}),e}function Oe(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function ve(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([o,i])=>{if(!r[o]){r[o]=i;return}if(o==="class"){const s=i?String(i).split(" "):[],a=r[o]?r[o].split(" "):[],l=s.filter(c=>!a.includes(c));r[o]=[...a,...l].join(" ")}else if(o==="style"){const s=i?i.split(";").map(c=>c.trim()).filter(Boolean):[],a=r[o]?r[o].split(";").map(c=>c.trim()).filter(Boolean):[],l=new Map;a.forEach(c=>{const[d,u]=c.split(":").map(p=>p.trim());l.set(d,u)}),s.forEach(c=>{const[d,u]=c.split(":").map(p=>p.trim());l.set(d,u)}),r[o]=Array.from(l.entries()).map(([c,d])=>`${c}: ${d}`).join("; ")}else r[o]=i}),r},{})}function Ml(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>ve(n,r),{})}function Pg(t){return typeof t=="function"}function Z(t,e=void 0,...n){return Pg(t)?e?t.bind(e)(...n):t(...n):t}function GC(t={}){return Object.keys(t).length===0&&t.constructor===Object}function qC(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Tp(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const o=e.reduce((i,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(n):qC(n.getAttribute(s.name));return a==null?i:{...i,[s.name]:a}},{});return{...r,...o}}}}function Ap(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&GC(n)?!1:n!=null))}function JC(t,e){var n;const r=Ig(t),{nodeExtensions:o,markExtensions:i}=Is(t),s=(n=o.find(c=>$(c,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(o.map(c=>{const d=r.filter(b=>b.type===c.name),u={name:c.name,options:c.options,storage:c.storage,editor:e},p=t.reduce((b,x)=>{const k=$(x,"extendNodeSchema",u);return{...b,...k?k(c):{}}},{}),f=Ap({...p,content:Z($(c,"content",u)),marks:Z($(c,"marks",u)),group:Z($(c,"group",u)),inline:Z($(c,"inline",u)),atom:Z($(c,"atom",u)),selectable:Z($(c,"selectable",u)),draggable:Z($(c,"draggable",u)),code:Z($(c,"code",u)),whitespace:Z($(c,"whitespace",u)),linebreakReplacement:Z($(c,"linebreakReplacement",u)),defining:Z($(c,"defining",u)),isolating:Z($(c,"isolating",u)),attrs:Object.fromEntries(d.map(b=>{var x;return[b.name,{default:(x=b?.attribute)===null||x===void 0?void 0:x.default}]}))}),h=Z($(c,"parseHTML",u));h&&(f.parseDOM=h.map(b=>Tp(b,d)));const m=$(c,"renderHTML",u);m&&(f.toDOM=b=>m({node:b,HTMLAttributes:Ml(b,d)}));const y=$(c,"renderText",u);return y&&(f.toText=y),[c.name,f]})),l=Object.fromEntries(i.map(c=>{const d=r.filter(y=>y.type===c.name),u={name:c.name,options:c.options,storage:c.storage,editor:e},p=t.reduce((y,b)=>{const x=$(b,"extendMarkSchema",u);return{...y,...x?x(c):{}}},{}),f=Ap({...p,inclusive:Z($(c,"inclusive",u)),excludes:Z($(c,"excludes",u)),group:Z($(c,"group",u)),spanning:Z($(c,"spanning",u)),code:Z($(c,"code",u)),attrs:Object.fromEntries(d.map(y=>{var b;return[y.name,{default:(b=y?.attribute)===null||b===void 0?void 0:b.default}]}))}),h=Z($(c,"parseHTML",u));h&&(f.parseDOM=h.map(y=>Tp(y,d)));const m=$(c,"renderHTML",u);return m&&(f.toDOM=y=>m({mark:y,HTMLAttributes:Ml(y,d)})),[c.name,f]}));return new Em({topNode:s,nodes:a,marks:l})}function pa(t,e){return e.nodes[t]||e.marks[t]||null}function Mp(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function Nd(t,e){const n=ir.fromSchema(e).serializeFragment(t),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}const XC=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,i,s,a)=>{var l,c;const d=((c=(l=o.type.spec).toText)===null||c===void 0?void 0:c.call(l,{node:o,pos:i,parent:s,index:a}))||o.textContent||"%leaf%";n+=o.isAtom&&!o.isText?d:d.slice(0,Math.max(0,r-i))}),n};function Td(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class Ps{constructor(e){this.find=e.find,this.handler=e.handler}}const YC=(t,e)=>{if(Td(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function ri(t){var e;const{editor:n,from:r,to:o,text:i,rules:s,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(p=>p.type.spec.code))return!1;let d=!1;const u=XC(c)+i;return s.forEach(p=>{if(d)return;const f=YC(u,p.find);if(!f)return;const h=l.state.tr,m=js({state:l.state,transaction:h}),y={from:r-(f[0].length-i.length),to:o},{commands:b,chain:x,can:k}=new Rs({editor:n,state:m});p.handler({state:m,range:y,match:f,commands:b,chain:x,can:k})===null||!h.steps.length||(h.setMeta(a,{transform:h,from:r,to:o,text:i}),l.dispatch(h),d=!0)}),d}function ZC(t){const{editor:e,rules:n}=t,r=new Ce({state:{init(){return null},apply(o,i,s){const a=o.getMeta(r);if(a)return a;const l=o.getMeta("applyInputRules");return l&&setTimeout(()=>{let{text:c}=l;typeof c=="string"?c=c:c=Nd(j.from(c),s.schema);const{from:d}=l,u=d+c.length;ri({editor:e,from:d,to:u,text:c,rules:n,plugin:r})}),o.selectionSet||o.docChanged?null:i}},props:{handleTextInput(o,i,s,a){return ri({editor:e,from:i,to:s,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:i}=o.state.selection;i&&ri({editor:e,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(o,i){if(i.key!=="Enter")return!1;const{$cursor:s}=o.state.selection;return s?ri({editor:e,from:s.pos,to:s.pos,text:` +`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function QC(t){return Object.prototype.toString.call(t).slice(8,-1)}function oi(t){return QC(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Ls(t,e){const n={...t};return oi(t)&&oi(e)&&Object.keys(e).forEach(r=>{oi(e[r])&&oi(t[r])?n[r]=Ls(t[r],e[r]):n[r]=e[r]}),n}class zt{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Z($(this,"addOptions",{name:this.name}))),this.storage=Z($(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new zt(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Ls(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new zt(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Z($(n,"addOptions",{name:n.name})),n.storage=Z($(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,o=e.state.selection.$from;if(o.pos===o.end()){const i=o.marks();if(!i.find(a=>a?.type.name===n.name))return!1;const s=i.find(a=>a?.type.name===n.name);return s&&r.removeStoredMark(s),r.insertText(" ",o.pos),e.view.dispatch(r),!0}return!1}}function eS(t){return typeof t=="number"}class tS{constructor(e){this.find=e.find,this.handler=e.handler}}const nS=(t,e,n)=>{if(Td(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(o=>{const i=[o.text];return i.index=o.index,i.input=t,i.data=o.data,o.replaceWith&&(o.text.includes(o.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(o.replaceWith)),i}):[]};function rS(t){const{editor:e,state:n,from:r,to:o,rule:i,pasteEvent:s,dropEvent:a}=t,{commands:l,chain:c,can:d}=new Rs({editor:e,state:n}),u=[];return n.doc.nodesBetween(r,o,(p,f)=>{if(!p.isTextblock||p.type.spec.code)return;const h=Math.max(r,f),m=Math.min(o,f+p.content.size),y=p.textBetween(h-f,m-f,void 0,"");nS(y,i.find,s).forEach(b=>{if(b.index===void 0)return;const x=h+b.index+1,k=x+b[0].length,O={from:n.tr.mapping.map(x),to:n.tr.mapping.map(k)},C=i.handler({state:n,range:O,match:b,commands:l,chain:c,can:d,pasteEvent:s,dropEvent:a});u.push(C)})}),u.every(p=>p!==null)}let ii=null;const oS=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function iS(t){const{editor:e,rules:n}=t;let r=null,o=!1,i=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const l=({state:c,from:d,to:u,rule:p,pasteEvt:f})=>{const h=c.tr,m=js({state:c,transaction:h});if(!(!rS({editor:e,state:m,from:Math.max(d-1,0),to:u.b-1,rule:p,pasteEvent:f,dropEvent:a})||!h.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,h}};return n.map(c=>new Ce({view(d){const u=f=>{var h;r=!((h=d.dom.parentElement)===null||h===void 0)&&h.contains(f.target)?d.dom.parentElement:null,r&&(ii=e)},p=()=>{ii&&(ii=null)};return window.addEventListener("dragstart",u),window.addEventListener("dragend",p),{destroy(){window.removeEventListener("dragstart",u),window.removeEventListener("dragend",p)}}},props:{handleDOMEvents:{drop:(d,u)=>{if(i=r===d.dom.parentElement,a=u,!i){const p=ii;p!=null&&p.isEditable&&setTimeout(()=>{const f=p.state.selection;f&&p.commands.deleteRange({from:f.from,to:f.to})},10)}return!1},paste:(d,u)=>{var p;const f=(p=u.clipboardData)===null||p===void 0?void 0:p.getData("text/html");return s=u,o=!!(f!=null&&f.includes("data-pm-slice")),!1}}},appendTransaction:(d,u,p)=>{const f=d[0],h=f.getMeta("uiEvent")==="paste"&&!o,m=f.getMeta("uiEvent")==="drop"&&!i,y=f.getMeta("applyPasteRules"),b=!!y;if(!h&&!m&&!b)return;if(b){let{text:O}=y;typeof O=="string"?O=O:O=Nd(j.from(O),p.schema);const{from:C}=y,N=C+O.length,M=oS(O);return l({rule:c,state:p,from:C,to:{b:N},pasteEvt:M})}const x=u.doc.content.findDiffStart(p.doc.content),k=u.doc.content.findDiffEnd(p.doc.content);if(!(!eS(x)||!k||x===k.b))return l({rule:c,state:p,from:x,to:k,pasteEvt:s})}}))}function sS(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}class br{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=br.resolve(e),this.schema=JC(this.extensions,n),this.setupExtensions()}static resolve(e){const n=br.sort(br.flatten(e)),r=sS(n.map(o=>o.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(o=>`'${o}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},o=$(n,"addExtensions",r);return o?[n,...this.flatten(o())]:n}).flat(10)}static sort(e){return e.sort((n,r)=>{const o=$(n,"priority")||100,i=$(r,"priority")||100;return o>i?-1:o{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:pa(n.name,this.schema)},o=$(n,"addCommands",r);return o?{...e,...o()}:e},{})}get plugins(){const{editor:e}=this,n=br.sort([...this.extensions].reverse()),r=[],o=[],i=n.map(s=>{const a={name:s.name,options:s.options,storage:s.storage,editor:e,type:pa(s.name,this.schema)},l=[],c=$(s,"addKeyboardShortcuts",a);let d={};if(s.type==="mark"&&$(s,"exitable",a)&&(d.ArrowRight=()=>zt.handleExit({editor:e,mark:s})),c){const m=Object.fromEntries(Object.entries(c()).map(([y,b])=>[y,()=>b({editor:e})]));d={...d,...m}}const u=CC(d);l.push(u);const p=$(s,"addInputRules",a);Mp(s,e.options.enableInputRules)&&p&&r.push(...p());const f=$(s,"addPasteRules",a);Mp(s,e.options.enablePasteRules)&&f&&o.push(...f());const h=$(s,"addProseMirrorPlugins",a);if(h){const m=h();l.push(...m)}return l}).flat();return[ZC({editor:e,rules:r}),...iS({editor:e,rules:o}),...i]}get attributes(){return Ig(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=Is(this.extensions);return Object.fromEntries(n.filter(r=>!!$(r,"addNodeView")).map(r=>{const o=this.attributes.filter(l=>l.type===r.name),i={name:r.name,options:r.options,storage:r.storage,editor:e,type:Oe(r.name,this.schema)},s=$(r,"addNodeView",i);if(!s)return[];const a=(l,c,d,u,p)=>{const f=Ml(l,o);return s()({node:l,view:c,getPos:d,decorations:u,innerDecorations:p,editor:e,extension:r,HTMLAttributes:f})};return[r.name,a]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:pa(e.name,this.schema)};e.type==="mark"&&(!((n=Z($(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const o=$(e,"onBeforeCreate",r),i=$(e,"onCreate",r),s=$(e,"onUpdate",r),a=$(e,"onSelectionUpdate",r),l=$(e,"onTransaction",r),c=$(e,"onFocus",r),d=$(e,"onBlur",r),u=$(e,"onDestroy",r);o&&this.editor.on("beforeCreate",o),i&&this.editor.on("create",i),s&&this.editor.on("update",s),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),c&&this.editor.on("focus",c),d&&this.editor.on("blur",d),u&&this.editor.on("destroy",u)})}}class Pe{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Z($(this,"addOptions",{name:this.name}))),this.storage=Z($(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Pe(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Ls(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Pe({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Z($(n,"addOptions",{name:n.name})),n.storage=Z($(n,"addStorage",{name:n.name,options:n.options})),n}}function Lg(t,e,n){const{from:r,to:o}=e,{blockSeparator:i=` + +`,textSerializers:s={}}=n||{};let a="";return t.nodesBetween(r,o,(l,c,d,u)=>{var p;l.isBlock&&c>r&&(a+=i);const f=s?.[l.type.name];if(f)return d&&(a+=f({node:l,pos:c,parent:d,index:u,range:e})),!1;l.isText&&(a+=(p=l?.text)===null||p===void 0?void 0:p.slice(Math.max(r,c)-c,o-c))}),a}function Fg(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const aS=Pe.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Ce({key:new Xe("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:o}=e,{ranges:i}=o,s=Math.min(...i.map(c=>c.$from.pos)),a=Math.max(...i.map(c=>c.$to.pos)),l=Fg(n);return Lg(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),lS=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window?.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),cS=(t=!1)=>({commands:e})=>e.setContent("",t),dS=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:o}=r;return n&&o.forEach(({$from:i,$to:s})=>{t.doc.nodesBetween(i.pos,s.pos,(a,l)=>{if(a.type.isText)return;const{doc:c,mapping:d}=e,u=c.resolve(d.map(l)),p=c.resolve(d.map(l+a.nodeSize)),f=u.blockRange(p);if(!f)return;const h=Vr(f);if(a.type.isTextblock){const{defaultType:m}=u.parent.contentMatchAt(u.index());e.setNodeMarkup(f.start,m)}(h||h===0)&&e.lift(f,h)})}),!0},uS=t=>e=>t(e),pS=()=>({state:t,dispatch:e})=>Mg(t,e),fS=(t,e)=>({editor:n,tr:r})=>{const{state:o}=n,i=o.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const s=r.mapping.map(e);return r.insert(s,i.content),r.setSelection(new q(r.doc.resolve(Math.max(s-1,0)))),!0},hS=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const o=t.selection.$anchor;for(let i=o.depth;i>0;i-=1)if(o.node(i).type===r.type){if(e){const s=o.before(i),a=o.after(i);t.delete(s,a).scrollIntoView()}return!0}return!1},mS=t=>({tr:e,state:n,dispatch:r})=>{const o=Oe(t,n.schema),i=e.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===o){if(r){const a=i.before(s),l=i.after(s);e.delete(a,l).scrollIntoView()}return!0}return!1},gS=t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0},yS=()=>({state:t,dispatch:e})=>Ed(t,e),vS=()=>({commands:t})=>t.keyboardShortcut("Enter"),bS=()=>({state:t,dispatch:e})=>DC(t,e);function Ii(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(o=>n.strict?e[o]===t[o]:Td(e[o])?e[o].test(t[o]):e[o]===t[o]):!0}function Bg(t,e,n={}){return t.find(r=>r.type===e&&Ii(Object.fromEntries(Object.keys(n).map(o=>[o,r.attrs[o]])),n))}function Dp(t,e,n={}){return!!Bg(t,e,n)}function Ad(t,e,n){var r;if(!t||!e)return;let o=t.parent.childAfter(t.parentOffset);if((!o.node||!o.node.marks.some(c=>c.type===e))&&(o=t.parent.childBefore(t.parentOffset)),!o.node||!o.node.marks.some(c=>c.type===e)||(n=n||((r=o.node.marks[0])===null||r===void 0?void 0:r.attrs),!Bg([...o.node.marks],e,n)))return;let i=o.index,s=t.start()+o.offset,a=i+1,l=s+o.node.nodeSize;for(;i>0&&Dp([...t.parent.child(i-1).marks],e,n);)i-=1,s-=t.parent.child(i).nodeSize;for(;a({tr:n,state:r,dispatch:o})=>{const i=Ln(t,r.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:d}=a;if(o){const u=Ad(l,i,e);if(u&&u.from<=c&&u.to>=d){const p=q.create(s,u.from,u.to);n.setSelection(p)}}return!0},wS=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r({editor:n,view:r,tr:o,dispatch:i})=>{e={scrollIntoView:!0,...e};const s=()=>{(Md()||ES())&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(i&&t===null&&!zg(n.state.selection))return s(),!0;const a=$g(o.doc,t)||n.state.selection,l=n.state.selection.eq(a);return i&&(l||o.setSelection(a),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},OS=(t,e)=>n=>t.every((r,o)=>e(r,{...n,index:o})),CS=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),_g=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&_g(r)}return t};function si(t){const e=`${t}`,n=new window.DOMParser().parseFromString(e,"text/html").body;return _g(n)}function To(t,e,n){if(t instanceof On||t instanceof j)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,o=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return j.fromArray(t.map(s=>e.nodeFromJSON(s)));const i=e.nodeFromJSON(t);return n.errorOnInvalidContent&&i.check(),i}catch(i){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),To("",e,n)}if(o){if(n.errorOnInvalidContent){let s=!1,a="";const l=new Em({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(s=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?Cn.fromSchema(l).parseSlice(si(t),n.parseOptions):Cn.fromSchema(l).parse(si(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const i=Cn.fromSchema(e);return n.slice?i.parseSlice(si(t),n.parseOptions).content:i.parse(si(t),n.parseOptions)}return To("",e,n)}function SS(t,e,n){const r=t.steps.length-1;if(r{s===0&&(s=d)}),t.setSelection(X.near(t.doc.resolve(s),n))}const NS=t=>!("type"in t),TS=(t,e,n)=>({tr:r,dispatch:o,editor:i})=>{var s;if(o){n={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;const l=m=>{i.emit("contentError",{editor:i,error:m,disableCollaboration:()=>{i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{To(e,i.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(m){l(m)}try{a=To(e,i.schema,{parseOptions:c,errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:i.options.enableContentCheck})}catch(m){return l(m),!1}let{from:d,to:u}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},p=!0,f=!0;if((NS(a)?a:[a]).forEach(m=>{m.check(),p=p?m.isText&&m.marks.length===0:!1,f=f?m.isBlock:!1}),d===u&&f){const{parent:m}=r.doc.resolve(d);m.isTextblock&&!m.type.spec.code&&!m.childCount&&(d-=1,u+=1)}let h;if(p){if(Array.isArray(e))h=e.map(m=>m.text||"").join("");else if(e instanceof j){let m="";e.forEach(y=>{y.text&&(m+=y.text)}),h=m}else typeof e=="object"&&e&&e.text?h=e.text:h=e;r.insertText(h,d,u)}else h=a,r.replaceWith(d,u,h);n.updateSelection&&SS(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:d,text:h}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:d,text:h})}return!0},AS=()=>({state:t,dispatch:e})=>TC(t,e),MS=()=>({state:t,dispatch:e})=>AC(t,e),DS=()=>({state:t,dispatch:e})=>kg(t,e),jS=()=>({state:t,dispatch:e})=>Ng(t,e),RS=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Ss(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},IS=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Ss(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},PS=()=>({state:t,dispatch:e})=>SC(t,e),LS=()=>({state:t,dispatch:e})=>NC(t,e);function Vg(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function FS(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,o,i,s;for(let a=0;a({editor:e,view:n,tr:r,dispatch:o})=>{const i=FS(t).split(/-(?!$)/),s=i.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,a))});return l?.steps.forEach(c=>{const d=c.map(r.mapping);d&&o&&r.maybeStep(d)}),!0};function Ao(t,e,n={}){const{from:r,to:o,empty:i}=t.selection,s=e?Oe(e,t.schema):null,a=[];t.doc.nodesBetween(r,o,(d,u)=>{if(d.isText)return;const p=Math.max(r,u),f=Math.min(o,u+d.nodeSize);a.push({node:d,from:p,to:f})});const l=o-r,c=a.filter(d=>s?s.name===d.node.type.name:!0).filter(d=>Ii(d.node.attrs,n,{strict:!1}));return i?!!c.length:c.reduce((d,u)=>d+u.to-u.from,0)>=l}const zS=(t,e={})=>({state:n,dispatch:r})=>{const o=Oe(t,n.schema);return Ao(n,o,e)?MC(n,r):!1},$S=()=>({state:t,dispatch:e})=>Dg(t,e),_S=t=>({state:e,dispatch:n})=>{const r=Oe(t,e.schema);return VC(r)(e,n)},VS=()=>({state:t,dispatch:e})=>Ag(t,e);function Fs(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function jp(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,o)=>(n.includes(o)||(r[o]=t[o]),r),{})}const US=(t,e)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=Fs(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(i=Oe(t,r.schema)),a==="mark"&&(s=Ln(t,r.schema)),o&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,d)=>{i&&i===c.type&&n.setNodeMarkup(d,void 0,jp(c.attrs,e)),s&&c.marks.length&&c.marks.forEach(u=>{s===u.type&&n.addMark(d,d+c.nodeSize,s.create(jp(u.attrs,e)))})})}),!0):!1},HS=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),KS=()=>({tr:t,dispatch:e})=>{if(e){const n=new et(t.doc);t.setSelection(n)}return!0},WS=()=>({state:t,dispatch:e})=>Cg(t,e),GS=()=>({state:t,dispatch:e})=>Tg(t,e),qS=()=>({state:t,dispatch:e})=>IC(t,e),JS=()=>({state:t,dispatch:e})=>FC(t,e),XS=()=>({state:t,dispatch:e})=>LC(t,e);function Dl(t,e,n={},r={}){return To(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const YS=(t,e=!1,n={},r={})=>({editor:o,tr:i,dispatch:s,commands:a})=>{var l,c;const{doc:d}=i;if(n.preserveWhitespace!=="full"){const u=Dl(t,o.schema,n,{errorOnInvalidContent:(l=r.errorOnInvalidContent)!==null&&l!==void 0?l:o.options.enableContentCheck});return s&&i.replaceWith(0,d.content.size,u).setMeta("preventUpdate",!e),!0}return s&&i.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:d.content.size},t,{parseOptions:n,errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:o.options.enableContentCheck})};function Ug(t,e){const n=Ln(e,t.schema),{from:r,to:o,empty:i}=t.selection,s=[];i?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,o,l=>{s.push(...l.marks)});const a=s.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function ZS(t,e){const n=new Bm(t);return e.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}function QS(t){for(let e=0;e{n(o)&&r.push({node:o,pos:i})}),r}function tN(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Dd(t){return e=>tN(e.$from,t)}function nN(t,e){const n={from:0,to:t.content.size};return Lg(t,n,e)}function rN(t,e){const n=Oe(e,t.schema),{from:r,to:o}=t.selection,i=[];t.doc.nodesBetween(r,o,a=>{i.push(a)});const s=i.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function Hg(t,e){const n=Fs(typeof e=="string"?e:e.name,t.schema);return n==="node"?rN(t,e):n==="mark"?Ug(t,e):{}}function oN(t,e=JSON.stringify){const n={};return t.filter(r=>{const o=e(r);return Object.prototype.hasOwnProperty.call(n,o)?!1:n[o]=!0})}function iN(t){const e=oN(t);return e.length===1?e:e.filter((n,r)=>!e.filter((o,i)=>i!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function sN(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((o,i)=>{const s=[];if(o.ranges.length)o.forEach((a,l)=>{s.push({from:a,to:l})});else{const{from:a,to:l}=n[i];if(a===void 0||l===void 0)return;s.push({from:a,to:l})}s.forEach(({from:a,to:l})=>{const c=e.slice(i).map(a,-1),d=e.slice(i).map(l),u=e.invert().map(c,-1),p=e.invert().map(d);r.push({oldRange:{from:u,to:p},newRange:{from:c,to:d}})})}),iN(r)}function jd(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(o=>{const i=n.resolve(t),s=Ad(i,o.type);s&&r.push({mark:o,...s})}):n.nodesBetween(t,e,(o,i)=>{!o||o?.nodeSize===void 0||r.push(...o.marks.map(s=>({from:i,to:i+o.nodeSize,mark:s})))}),r}function mi(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const o=t.find(i=>i.type===e&&i.name===r);return o?o.attribute.keepOnSplit:!1}))}function jl(t,e,n={}){const{empty:r,ranges:o}=t.selection,i=e?Ln(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(d=>i?i.name===d.type.name:!0).find(d=>Ii(d.attrs,n,{strict:!1}));let s=0;const a=[];if(o.forEach(({$from:d,$to:u})=>{const p=d.pos,f=u.pos;t.doc.nodesBetween(p,f,(h,m)=>{if(!h.isText&&!h.marks.length)return;const y=Math.max(p,m),b=Math.min(f,m+h.nodeSize),x=b-y;s+=x,a.push(...h.marks.map(k=>({mark:k,from:y,to:b})))})}),s===0)return!1;const l=a.filter(d=>i?i.name===d.mark.type.name:!0).filter(d=>Ii(d.mark.attrs,n,{strict:!1})).reduce((d,u)=>d+u.to-u.from,0),c=a.filter(d=>i?d.mark.type!==i&&d.mark.type.excludes(i):!0).reduce((d,u)=>d+u.to-u.from,0);return(l>0?l+c:l)>=s}function aN(t,e,n={}){if(!e)return Ao(t,null,n)||jl(t,null,n);const r=Fs(e,t.schema);return r==="node"?Ao(t,e,n):r==="mark"?jl(t,e,n):!1}function Rp(t,e){const{nodeExtensions:n}=Is(e),r=n.find(s=>s.name===t);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},i=Z($(r,"group",o));return typeof i!="string"?!1:i.split(" ").includes("list")}function Bs(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let o=!0;return t.content.forEach(i=>{o!==!1&&(Bs(i,{ignoreWhitespace:n,checkChildren:e})||(o=!1))}),o}return!1}function lN(t){return t instanceof U}function cN(t,e,n){var r;const{selection:o}=e;let i=null;if(zg(o)&&(i=o.$cursor),i){const a=(r=t.storedMarks)!==null&&r!==void 0?r:i.marks();return!!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}const{ranges:s}=o;return s.some(({$from:a,$to:l})=>{let c=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(d,u,p)=>{if(c)return!1;if(d.isInline){const f=!p||p.type.allowsMarkType(n),h=!!n.isInSet(d.marks)||!d.marks.some(m=>m.type.excludes(n));c=f&&h}return!c}),c})}const dN=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:s,ranges:a}=i,l=Ln(t,r.schema);if(o)if(s){const c=Ug(r,l);n.addStoredMark(l.create({...c,...e}))}else a.forEach(c=>{const d=c.$from.pos,u=c.$to.pos;r.doc.nodesBetween(d,u,(p,f)=>{const h=Math.max(f,d),m=Math.min(f+p.nodeSize,u);p.marks.find(y=>y.type===l)?p.marks.forEach(y=>{l===y.type&&n.addMark(h,m,l.create({...y.attrs,...e}))}):n.addMark(h,m,l.create(e))})});return cN(r,n,l)},uN=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),pN=(t,e={})=>({state:n,dispatch:r,chain:o})=>{const i=Oe(t,n.schema);let s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),i.isTextblock?o().command(({commands:a})=>Np(i,{...s,...e})(n)?!0:a.clearNodes()).command(({state:a})=>Np(i,{...s,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},fN=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,o=Hn(t,0,r.content.size),i=U.create(r,o);e.setSelection(i)}return!0},hN=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:o,to:i}=typeof t=="number"?{from:t,to:t}:t,s=q.atStart(r).from,a=q.atEnd(r).to,l=Hn(o,s,a),c=Hn(i,s,a),d=q.create(r,l,c);e.setSelection(d)}return!0},mN=t=>({state:e,dispatch:n})=>{const r=Oe(t,e.schema);return KC(r)(e,n)};function Ip(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(o=>e?.includes(o.type.name));t.tr.ensureMarks(r)}}const gN=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:i,doc:s}=e,{$from:a,$to:l}=i,c=o.extensionManager.attributes,d=mi(c,a.node().type.name,a.node().attrs);if(i instanceof U&&i.node.isBlock)return!a.parentOffset||!en(s,a.pos)?!1:(r&&(t&&Ip(n,o.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const u=l.parentOffset===l.parent.content.size,p=a.depth===0?void 0:QS(a.node(-1).contentMatchAt(a.indexAfter(-1)));let f=u&&p?[{type:p,attrs:d}]:void 0,h=en(e.doc,e.mapping.map(a.pos),1,f);if(!f&&!h&&en(e.doc,e.mapping.map(a.pos),1,p?[{type:p}]:void 0)&&(h=!0,f=p?[{type:p,attrs:d}]:void 0),r){if(h&&(i instanceof q&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,f),p&&!u&&!a.parentOffset&&a.parent.type!==p)){const m=e.mapping.map(a.before()),y=e.doc.resolve(m);a.node(-1).canReplaceWith(y.index(),y.index()+1,p)&&e.setNodeMarkup(e.mapping.map(a.before()),p)}t&&Ip(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return h},yN=(t,e={})=>({tr:n,state:r,dispatch:o,editor:i})=>{var s;const a=Oe(t,r.schema),{$from:l,$to:c}=r.selection,d=r.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(c))return!1;const u=l.node(-1);if(u.type!==a)return!1;const p=i.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(o){let b=j.empty;const x=l.index(-1)?1:l.index(-2)?2:3;for(let S=l.depth-x;S>=l.depth-3;S-=1)b=j.from(l.node(S).copy(b));const k=l.indexAfter(-1){if(M>-1)return!1;S.isTextblock&&S.content.size===0&&(M=R+1)}),M>-1&&n.setSelection(q.near(n.doc.resolve(M))),n.scrollIntoView()}return!0}const f=c.pos===l.end()?u.contentMatchAt(0).defaultType:null,h={...mi(p,u.type.name,u.attrs),...e},m={...mi(p,l.node().type.name,l.node().attrs),...e};n.delete(l.pos,c.pos);const y=f?[{type:a,attrs:h},{type:f,attrs:m}]:[{type:a,attrs:h}];if(!en(n.doc,l.pos,2))return!1;if(o){const{selection:b,storedMarks:x}=r,{splittableMarks:k}=i.extensionManager,O=x||b.$to.parentOffset&&b.$from.marks();if(n.split(l.pos,2,y).scrollIntoView(),!O||!o)return!0;const C=O.filter(N=>k.includes(N.type.name));n.ensureMarks(C)}return!0},fa=(t,e)=>{const n=Dd(i=>i.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===o?.type&&In(t.doc,n.pos)&&t.join(n.pos),!0},ha=(t,e)=>{const n=Dd(i=>i.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===o?.type&&In(t.doc,r)&&t.join(r),!0},vN=(t,e,n,r={})=>({editor:o,tr:i,state:s,dispatch:a,chain:l,commands:c,can:d})=>{const{extensions:u,splittableMarks:p}=o.extensionManager,f=Oe(t,s.schema),h=Oe(e,s.schema),{selection:m,storedMarks:y}=s,{$from:b,$to:x}=m,k=b.blockRange(x),O=y||m.$to.parentOffset&&m.$from.marks();if(!k)return!1;const C=Dd(N=>Rp(N.type.name,u))(m);if(k.depth>=1&&C&&k.depth-C.depth<=1){if(C.node.type===f)return c.liftListItem(h);if(Rp(C.node.type.name,u)&&f.validContent(C.node.content)&&a)return l().command(()=>(i.setNodeMarkup(C.pos,f),!0)).command(()=>fa(i,f)).command(()=>ha(i,f)).run()}return!n||!O||!a?l().command(()=>d().wrapInList(f,r)?!0:c.clearNodes()).wrapInList(f,r).command(()=>fa(i,f)).command(()=>ha(i,f)).run():l().command(()=>{const N=d().wrapInList(f,r),M=O.filter(S=>p.includes(S.type.name));return i.ensureMarks(M),N?!0:c.clearNodes()}).wrapInList(f,r).command(()=>fa(i,f)).command(()=>ha(i,f)).run()},bN=(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,s=Ln(t,r.schema);return jl(r,s,e)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,e)},xN=(t,e,n={})=>({state:r,commands:o})=>{const i=Oe(t,r.schema),s=Oe(e,r.schema),a=Ao(r,i,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?o.setNode(s,l):o.setNode(i,{...l,...n})},wN=(t,e={})=>({state:n,commands:r})=>{const o=Oe(t,n.schema);return Ao(n,o,e)?r.lift(o):r.wrapIn(o,e)},EN=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(i.text){const l=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,t.schema.text(i.text,l))}else s.delete(i.from,i.to)}return!0}}return!1},kN=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:o}=n;return r||e&&o.forEach(i=>{t.removeMark(i.$from.pos,i.$to.pos)}),!0},ON=(t,e={})=>({tr:n,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=Ln(t,r.schema),{$from:c,empty:d,ranges:u}=a;if(!o)return!0;if(d&&s){let{from:p,to:f}=a;const h=(i=c.marks().find(y=>y.type===l))===null||i===void 0?void 0:i.attrs,m=Ad(c,l,h);m&&(p=m.from,f=m.to),n.removeMark(p,f,l)}else u.forEach(p=>{n.removeMark(p.$from.pos,p.$to.pos,l)});return n.removeStoredMark(l),!0},CN=(t,e={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=Fs(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(i=Oe(t,r.schema)),a==="mark"&&(s=Ln(t,r.schema)),o&&n.selection.ranges.forEach(l=>{const c=l.$from.pos,d=l.$to.pos;let u,p,f,h;n.selection.empty?r.doc.nodesBetween(c,d,(m,y)=>{i&&i===m.type&&(f=Math.max(y,c),h=Math.min(y+m.nodeSize,d),u=y,p=m)}):r.doc.nodesBetween(c,d,(m,y)=>{y=c&&y<=d&&(i&&i===m.type&&n.setNodeMarkup(y,void 0,{...m.attrs,...e}),s&&m.marks.length&&m.marks.forEach(b=>{if(s===b.type){const x=Math.max(y,c),k=Math.min(y+m.nodeSize,d);n.addMark(x,k,s.create({...b.attrs,...e}))}}))}),p&&(u!==void 0&&n.setNodeMarkup(u,void 0,{...p.attrs,...e}),s&&p.marks.length&&p.marks.forEach(m=>{s===m.type&&n.addMark(f,h,s.create({...m.attrs,...e}))}))}),!0):!1},SN=(t,e={})=>({state:n,dispatch:r})=>{const o=Oe(t,n.schema);return BC(o,e)(n,r)},NN=(t,e={})=>({state:n,dispatch:r})=>{const o=Oe(t,n.schema);return zC(o,e)(n,r)};var TN=Object.freeze({__proto__:null,blur:lS,clearContent:cS,clearNodes:dS,command:uS,createParagraphNear:pS,cut:fS,deleteCurrentNode:hS,deleteNode:mS,deleteRange:gS,deleteSelection:yS,enter:vS,exitCode:bS,extendMarkRange:xS,first:wS,focus:kS,forEach:OS,insertContent:CS,insertContentAt:TS,joinBackward:DS,joinDown:MS,joinForward:jS,joinItemBackward:RS,joinItemForward:IS,joinTextblockBackward:PS,joinTextblockForward:LS,joinUp:AS,keyboardShortcut:BS,lift:zS,liftEmptyBlock:$S,liftListItem:_S,newlineInCode:VS,resetAttributes:US,scrollIntoView:HS,selectAll:KS,selectNodeBackward:WS,selectNodeForward:GS,selectParentNode:qS,selectTextblockEnd:JS,selectTextblockStart:XS,setContent:YS,setMark:dN,setMeta:uN,setNode:pN,setNodeSelection:fN,setTextSelection:hN,sinkListItem:mN,splitBlock:gN,splitListItem:yN,toggleList:vN,toggleMark:bN,toggleNode:xN,toggleWrap:wN,undoInputRule:EN,unsetAllMarks:kN,unsetMark:ON,updateAttributes:CN,wrapIn:SN,wrapInList:NN});const AN=Pe.create({name:"commands",addCommands(){return{...TN}}}),MN=Pe.create({name:"drop",addProseMirrorPlugins(){return[new Ce({key:new Xe("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),DN=Pe.create({name:"editable",addProseMirrorPlugins(){return[new Ce({key:new Xe("editable"),props:{editable:()=>this.editor.options.editable}})]}}),jN=new Xe("focusEvents"),RN=Pe.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Ce({key:jN,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),IN=Pe.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:i})=>[()=>i.undoInputRule(),()=>i.command(({tr:s})=>{const{selection:a,doc:l}=s,{empty:c,$anchor:d}=a,{pos:u,parent:p}=d,f=d.parent.isTextblock&&u>0?s.doc.resolve(u-1):d,h=f.parent.type.spec.isolating,m=d.pos-d.parentOffset,y=h&&f.parent.childCount===1?m===d.pos:X.atStart(l).from===u;return!c||!p.type.isTextblock||p.textContent.length||!y||y&&d.parent.type.name==="paragraph"?!1:i.clearNodes()}),()=>i.deleteSelection(),()=>i.joinBackward(),()=>i.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:i})=>[()=>i.deleteSelection(),()=>i.deleteCurrentNode(),()=>i.joinForward(),()=>i.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:i})=>[()=>i.newlineInCode(),()=>i.createParagraphNear(),()=>i.liftEmptyBlock(),()=>i.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},o={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Md()||Vg()?o:r},addProseMirrorPlugins(){return[new Ce({key:new Xe("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(f=>f.getMeta("composition")))return;const r=t.some(f=>f.docChanged)&&!e.doc.eq(n.doc),o=t.some(f=>f.getMeta("preventClearDocument"));if(!r||o)return;const{empty:i,from:s,to:a}=e.selection,l=X.atStart(e.doc).from,c=X.atEnd(e.doc).to;if(i||!(s===l&&a===c)||!Bs(n.doc))return;const d=n.tr,u=js({state:n,transaction:d}),{commands:p}=new Rs({editor:this.editor,state:u});if(p.clearNodes(),!!d.steps.length)return d}})]}}),PN=Pe.create({name:"paste",addProseMirrorPlugins(){return[new Ce({key:new Xe("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),LN=Pe.create({name:"tabindex",addProseMirrorPlugins(){return[new Ce({key:new Xe("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class zn{get name(){return this.node.type.name}constructor(e,n,r=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=o}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new zn(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new zn(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new zn(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const o=n.isBlock&&!n.isTextblock,i=n.isAtom&&!n.isText,s=this.pos+r+(i?0:1);if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;const a=this.resolvedPos.doc.resolve(s);if(!o&&a.depth<=this.depth)return;const l=new zn(a,this.editor,o,o?n:null);o&&(l.actualDepth=this.depth+1),e.push(new zn(a,this.editor,o,o?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,o=this.parent;for(;o&&!r;){if(o.node.type.name===e)if(Object.keys(n).length>0){const i=o.node.attrs,s=Object.keys(n);for(let a=0;a{r&&o.length>0||(s.node.type.name===e&&i.every(a=>n[a]===s.node.attrs[a])&&o.push(s),!(r&&o.length>0)&&(o=o.concat(s.querySelectorAll(e,n,r))))}),o}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}}const FN=`.ProseMirror { + position: relative; +} + +.ProseMirror { + word-wrap: break-word; + white-space: pre-wrap; + white-space: break-spaces; + -webkit-font-variant-ligatures: none; + font-variant-ligatures: none; + font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */ +} + +.ProseMirror [contenteditable="false"] { + white-space: normal; +} + +.ProseMirror [contenteditable="false"] [contenteditable="true"] { + white-space: pre-wrap; +} + +.ProseMirror pre { + white-space: pre-wrap; +} + +img.ProseMirror-separator { + display: inline !important; + border: none !important; + margin: 0 !important; + width: 0 !important; + height: 0 !important; +} + +.ProseMirror-gapcursor { + display: none; + pointer-events: none; + position: absolute; + margin: 0; +} + +.ProseMirror-gapcursor:after { + content: ""; + display: block; + position: absolute; + top: -2px; + width: 20px; + border-top: 1px solid black; + animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite; +} + +@keyframes ProseMirror-cursor-blink { + to { + visibility: hidden; + } +} + +.ProseMirror-hideselection *::selection { + background: transparent; +} + +.ProseMirror-hideselection *::-moz-selection { + background: transparent; +} + +.ProseMirror-hideselection * { + caret-color: transparent; +} + +.ProseMirror-focused .ProseMirror-gapcursor { + display: block; +} + +.tippy-box[data-animation=fade][data-state=hidden] { + opacity: 0 +}`;function BN(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const o=document.createElement("style");return e&&o.setAttribute("nonce",e),o.setAttribute("data-tiptap-style",""),o.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(o),o}class zN extends WC{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:r,moved:o})=>this.options.onDrop(n,r,o)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=BN(FN,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){const r=Pg(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],o=this.state.reconfigure({plugins:r});return this.view.updateState(o),o}unregisterPlugin(e){if(this.isDestroyed)return;const n=this.state.plugins;let r=n;if([].concat(e).forEach(i=>{const s=typeof i=="string"?`${i}$`:i.key;r=r.filter(a=>!a.key.startsWith(s))}),n.length===r.length)return;const o=this.state.reconfigure({plugins:r});return this.view.updateState(o),o}createExtensionManager(){var e,n;const r=[...this.options.enableCoreExtensions?[DN,aS.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),AN,RN,IN,LN,MN,PN].filter(o=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[o.name]!==!1:!0):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o?.type));this.extensionManager=new br(r,this)}createCommandManager(){this.commandManager=new Rs({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var e;let n;try{n=Dl(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(s){if(!(s instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(s.message))throw s;this.emit("contentError",{editor:this,error:s,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(a=>a.name!=="collaboration"),this.createExtensionManager()}}),n=Dl(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const r=$g(n,this.options.autofocus);this.view=new xg(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)===null||e===void 0?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:vr.create({doc:n,selection:r||void 0})});const o=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(o),this.createNodeViews(),this.prependClass();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(s)});return}const n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:n}),this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const o=e.getMeta("focus"),i=e.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:e}),i&&this.emit("blur",{editor:this,event:i.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return Hg(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,o=typeof e=="string"?n:e;return aN(this.state,r,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Nd(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=` + +`,textSerializers:r={}}=e||{};return nN(this.state.doc,{blockSeparator:n,textSerializers:{...Fg(this.schema),...r}})}get isEmpty(){return Bs(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new zn(n,this)}get $doc(){return this.$pos(0)}}function Rr(t){return new Ps({find:t.find,handler:({state:e,range:n,match:r})=>{const o=Z(t.getAttributes,void 0,r);if(o===!1||o===null)return null;const{tr:i}=e,s=r[r.length-1],a=r[0];if(s){const l=a.search(/\S/),c=n.from+a.indexOf(s),d=c+s.length;if(jd(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(f=>f===t.type&&f!==p.mark.type)).filter(p=>p.to>c).length)return null;dn.from&&i.delete(n.from+l,c);const u=n.from+l+s.length;i.addMark(n.from+l,u,t.type.create(o||{})),i.removeStoredMark(t.type)}}})}function Kg(t){return new Ps({find:t.find,handler:({state:e,range:n,match:r})=>{const o=Z(t.getAttributes,void 0,r)||{},{tr:i}=e,s=n.from;let a=n.to;const l=t.type.create(o);if(r[1]){const c=r[0].lastIndexOf(r[1]);let d=s+c;d>a?d=a:a=d+r[1].length;const u=r[0][r[0].length-1];i.insertText(u,s+r[0].length-1),i.replaceWith(d,a,l)}else if(r[0]){const c=t.type.isInline?s:s-1;i.insert(c,t.type.create(o)).delete(i.mapping.map(s),i.mapping.map(a))}i.scrollIntoView()}})}function Rl(t){return new Ps({find:t.find,handler:({state:e,range:n,match:r})=>{const o=e.doc.resolve(n.from),i=Z(t.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,i)}})}function Mo(t){return new Ps({find:t.find,handler:({state:e,range:n,match:r,chain:o})=>{const i=Z(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),a=s.doc.resolve(n.from).blockRange(),l=a&&ud(a,t.type,i);if(!l)return null;if(s.wrap(a,l),t.keepMarks&&t.editor){const{selection:d,storedMarks:u}=e,{splittableMarks:p}=t.editor.extensionManager,f=u||d.$to.parentOffset&&d.$from.marks();if(f){const h=f.filter(m=>p.includes(m.type.name));s.ensureMarks(h)}}if(t.keepAttributes){const d=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";o().updateAttributes(d,i).run()}const c=s.doc.resolve(n.from-1).nodeBefore;c&&c.type===t.type&&In(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,c))&&s.join(n.from-1)}})}class Ue{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Z($(this,"addOptions",{name:this.name}))),this.storage=Z($(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ue(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Ls(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Ue(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Z($(n,"addOptions",{name:n.name})),n.storage=Z($(n,"addStorage",{name:n.name,options:n.options})),n}}function rr(t){return new tS({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:o})=>{const i=Z(t.getAttributes,void 0,r,o);if(i===!1||i===null)return null;const{tr:s}=e,a=r[r.length-1],l=r[0];let c=n.to;if(a){const d=l.search(/\S/),u=n.from+l.indexOf(a),p=u+a.length;if(jd(n.from,n.to,e.doc).filter(f=>f.mark.type.excluded.find(h=>h===t.type&&h!==f.mark.type)).filter(f=>f.to>u).length)return null;pn.from&&s.delete(n.from+d,u),c=n.from+d+a.length,s.addMark(n.from+d,c,t.type.create(i||{})),s.removeStoredMark(t.type)}}})}function $N(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof U){const i=r.index();return r.parent.canReplaceWith(i,i+1,e)}let o=r.depth;for(;o>=0;){const i=r.index(o);if(r.node(o).contentMatchAt(i).matchType(e))return!0;o-=1}return!1}function _N(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Wg={exports:{}},ma={};/** + * @license React + * use-sync-external-store-shim.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Pp;function VN(){if(Pp)return ma;Pp=1;var t=A;function e(u,p){return u===p&&(u!==0||1/u===1/p)||u!==u&&p!==p}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,o=t.useEffect,i=t.useLayoutEffect,s=t.useDebugValue;function a(u,p){var f=p(),h=r({inst:{value:f,getSnapshot:p}}),m=h[0].inst,y=h[1];return i(function(){m.value=f,m.getSnapshot=p,l(m)&&y({inst:m})},[u,f,p]),o(function(){return l(m)&&y({inst:m}),u(function(){l(m)&&y({inst:m})})},[u]),s(f),f}function l(u){var p=u.getSnapshot;u=u.value;try{var f=p();return!n(u,f)}catch{return!0}}function c(u,p){return p()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return ma.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:d,ma}Wg.exports=VN();var Rd=Wg.exports;const UN=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},HN=({contentComponent:t})=>{const e=Rd.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return A.createElement(A.Fragment,null,Object.values(e))};function KN(){const t=new Set;let e={};return{subscribe(n){return t.add(n),()=>{t.delete(n)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(n,r){e={...e,[n]:xn.createPortal(r.reactElement,r.element,n)},t.forEach(o=>o())},removeRenderer(n){const r={...e};delete r[n],e=r,t.forEach(o=>o())}}}class WN extends A.Component{constructor(e){var n;super(e),this.editorContentRef=A.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(!((n=e.editor)===null||n===void 0)&&n.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.options.element.childNodes),e.setOptions({element:n}),e.contentComponent=KN(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){const e=this.props.editor;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null,!e.options.element.firstChild))return;const n=document.createElement("div");n.append(...e.options.element.childNodes),e.setOptions({element:n})}render(){const{editor:e,innerRef:n,...r}=this.props;return A.createElement(A.Fragment,null,A.createElement("div",{ref:UN(n,this.editorContentRef),...r}),e?.contentComponent&&A.createElement(HN,{contentComponent:e.contentComponent}))}}const GN=g.forwardRef((t,e)=>{const n=A.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return A.createElement(WN,{key:n,innerRef:e,...t})}),qN=A.memo(GN);var JN=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!t(e[o],n[o]))return!1;return!0}if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(o of e.entries())if(!n.has(o[0]))return!1;for(o of e.entries())if(!t(o[1],n.get(o[0])))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(o of e.entries())if(!n.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){if(r=e.length,r!=n.length)return!1;for(o=r;o--!==0;)if(e[o]!==n[o])return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;o--!==0;){var s=i[o];if(!(s==="_owner"&&e.$$typeof)&&!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n},XN=_N(JN),Gg={exports:{}},ga={};/** + * @license React + * use-sync-external-store-shim/with-selector.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Lp;function YN(){if(Lp)return ga;Lp=1;var t=A,e=Rd;function n(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var r=typeof Object.is=="function"?Object.is:n,o=e.useSyncExternalStore,i=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;return ga.useSyncExternalStoreWithSelector=function(c,d,u,p,f){var h=i(null);if(h.current===null){var m={hasValue:!1,value:null};h.current=m}else m=h.current;h=a(function(){function b(N){if(!x){if(x=!0,k=N,N=p(N),f!==void 0&&m.hasValue){var M=m.value;if(f(M,N))return O=M}return O=N}if(M=O,r(k,N))return M;var S=p(N);return f!==void 0&&f(M,S)?M:(k=N,O=S)}var x=!1,k,O,C=u===void 0?null:u;return[function(){return b(d())},C===null?void 0:function(){return b(C())}]},[d,u,p,f]);var y=o(c,h[0],h[1]);return s(function(){m.hasValue=!0,m.value=y},[y]),l(y),y},ga}Gg.exports=YN();var ZN=Gg.exports;class QN{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const n=()=>{this.transactionNumber+=1,this.subscribers.forEach(o=>o())},r=this.editor;return r.on("transaction",n),()=>{r.off("transaction",n)}}}}function eT(t){var e;const[n]=g.useState(()=>new QN(t.editor)),r=ZN.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!==null&&e!==void 0?e:XN);return g.useEffect(()=>n.watch(t.editor),[t.editor,n]),g.useDebugValue(r),r}const tT=!1,Il=typeof window>"u",nT=Il||!!(typeof window<"u"&&window.next);class rT{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){return this.options.current.immediatelyRender===void 0?Il||nT?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null)}createEditor(){const e={...this.options.current,onBeforeCreate:(...n)=>{var r,o;return(o=(r=this.options.current).onBeforeCreate)===null||o===void 0?void 0:o.call(r,...n)},onBlur:(...n)=>{var r,o;return(o=(r=this.options.current).onBlur)===null||o===void 0?void 0:o.call(r,...n)},onCreate:(...n)=>{var r,o;return(o=(r=this.options.current).onCreate)===null||o===void 0?void 0:o.call(r,...n)},onDestroy:(...n)=>{var r,o;return(o=(r=this.options.current).onDestroy)===null||o===void 0?void 0:o.call(r,...n)},onFocus:(...n)=>{var r,o;return(o=(r=this.options.current).onFocus)===null||o===void 0?void 0:o.call(r,...n)},onSelectionUpdate:(...n)=>{var r,o;return(o=(r=this.options.current).onSelectionUpdate)===null||o===void 0?void 0:o.call(r,...n)},onTransaction:(...n)=>{var r,o;return(o=(r=this.options.current).onTransaction)===null||o===void 0?void 0:o.call(r,...n)},onUpdate:(...n)=>{var r,o;return(o=(r=this.options.current).onUpdate)===null||o===void 0?void 0:o.call(r,...n)},onContentError:(...n)=>{var r,o;return(o=(r=this.options.current).onContentError)===null||o===void 0?void 0:o.call(r,...n)},onDrop:(...n)=>{var r,o;return(o=(r=this.options.current).onDrop)===null||o===void 0?void 0:o.call(r,...n)},onPaste:(...n)=>{var r,o;return(o=(r=this.options.current).onPaste)===null||o===void 0?void 0:o.call(r,...n)}};return new zN(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((n,r)=>n===e[r]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}}function oT(t={},e=[]){const n=g.useRef(t);n.current=t;const[r]=g.useState(()=>new rT(n)),o=Rd.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return g.useDebugValue(o),g.useEffect(r.onRender(e)),eT({editor:o,selector:({transactionNumber:i})=>t.shouldRerenderOnTransaction===!1?null:t.immediatelyRender&&i===0?0:i+1}),o}const iT=g.createContext({editor:null});iT.Consumer;const sT=g.createContext({onDragStart:void 0}),aT=()=>g.useContext(sT);A.forwardRef((t,e)=>{const{onDragStart:n}=aT(),r=t.as||"div";return A.createElement(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});const lT=/^\s*>\s$/,cT=Ue.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",ve(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Mo({find:lT,type:this.type})]}}),dT=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,uT=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,pT=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,fT=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,hT=zt.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",ve(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Rr({find:dT,type:this.type}),Rr({find:pT,type:this.type})]},addPasteRules(){return[rr({find:uT,type:this.type}),rr({find:fT,type:this.type})]}}),mT="listItem",Fp="textStyle",Bp=/^\s*([-+*])\s$/,gT=Ue.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",ve(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(mT,this.editor.getAttributes(Fp)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Mo({find:Bp,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Mo({find:Bp,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Fp),editor:this.editor})),[t]}}),yT=/(^|[^`])`([^`]+)`(?!`)/,vT=/(^|[^`])`([^`]+)`(?!`)/g,bT=zt.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",ve(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Rr({find:yT,type:this.type})]},addPasteRules(){return[rr({find:vT,type:this.type})]}}),xT=/^```([a-z]+)?[\s\n]$/,wT=/^~~~([a-z]+)?[\s\n]$/,ET=Ue.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options;return[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(o=>o.startsWith(n)).map(o=>o.replace(n,""))[0]||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",ve(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;const i=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(` + +`);return!i||!s?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:o,empty:i}=n;if(!i||o.parent.type!==this.type||o.parentOffset!==o.parent.nodeSize-2)return!1;const s=o.after();return s===void 0?!1:r.nodeAt(s)?t.commands.command(({tr:a})=>(a.setSelection(X.near(r.resolve(s))),!0)):t.commands.exitCode()}}},addInputRules(){return[Rl({find:xT,type:this.type,getAttributes:t=>({language:t[1]})}),Rl({find:wT,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Ce({key:new Xe("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,i=o?.mode;if(!n||!i)return!1;const{tr:s,schema:a}=t.state,l=a.text(n.replace(/\r\n?/g,` +`));return s.replaceSelectionWith(this.type.create({language:i},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(q.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),kT=Ue.create({name:"doc",topNode:!0,content:"block+"});function OT(t={}){return new Ce({view(e){return new CT(e,t)}})}class CT{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(o=>{let i=s=>{this[o](s)};return e.dom.addEventListener(o,i),{name:o,handler:i}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r,o=this.editorView.dom,i=o.getBoundingClientRect(),s=i.width/o.offsetWidth,a=i.height/o.offsetHeight;if(n){let u=e.nodeBefore,p=e.nodeAfter;if(u||p){let f=this.editorView.nodeDOM(this.cursorPos-(u?u.nodeSize:0));if(f){let h=f.getBoundingClientRect(),m=u?h.bottom:h.top;u&&p&&(m=(m+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let y=this.width/2*a;r={left:h.left,right:h.right,top:m-y,bottom:m+y}}}}if(!r){let u=this.editorView.coordsAtPos(this.cursorPos),p=this.width/2*s;r={left:u.left-p,right:u.left+p,top:u.top,bottom:u.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let c,d;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,d=-pageYOffset;else{let u=l.getBoundingClientRect(),p=u.width/l.offsetWidth,f=u.height/l.offsetHeight;c=u.left-l.scrollLeft*p,d=u.top-l.scrollTop*f}this.element.style.left=(r.left-c)/s+"px",this.element.style.top=(r.top-d)/a+"px",this.element.style.width=(r.right-r.left)/s+"px",this.element.style.height=(r.bottom-r.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),o=r&&r.type.spec.disableDropCursor,i=typeof o=="function"?o(this.editorView,n,e):o;if(n&&!i){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=Rm(this.editorView.state.doc,s,this.editorView.dragging.slice);a!=null&&(s=a)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}const ST=Pe.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[OT(this.options)]}});class de extends X{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return de.valid(r)?new de(r):X.near(r)}content(){return F.empty}eq(e){return e instanceof de&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new de(e.resolve(n.pos))}getBookmark(){return new Id(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!NT(e)||!TT(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let o=n.contentMatchAt(e.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&de.valid(e))return e;let o=e.pos,i=null;for(let s=e.depth;;s--){let a=e.node(s);if(n>0?e.indexAfter(s)0){i=a.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;o+=n;let l=e.doc.resolve(o);if(de.valid(l))return l}for(;;){let s=n>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!U.isSelectable(i)){e=e.doc.resolve(o+i.nodeSize*n),r=!1;continue e}break}i=s,o+=n;let a=e.doc.resolve(o);if(de.valid(a))return a}return null}}}de.prototype.visible=!1;de.findFrom=de.findGapCursorFrom;X.jsonID("gapcursor",de);class Id{constructor(e){this.pos=e}map(e){return new Id(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return de.valid(n)?new de(n):X.near(n)}}function NT(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function TT(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function AT(){return new Ce({props:{decorations:RT,createSelectionBetween(t,e,n){return e.pos==n.pos&&de.valid(n)?new de(n):null},handleClick:DT,handleKeyDown:MT,handleDOMEvents:{beforeinput:jT}}})}const MT=wg({ArrowLeft:ai("horiz",-1),ArrowRight:ai("horiz",1),ArrowUp:ai("vert",-1),ArrowDown:ai("vert",1)});function ai(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,o,i){let s=r.selection,a=e>0?s.$to:s.$from,l=s.empty;if(s instanceof q){if(!i.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let c=de.findGapCursorFrom(a,e,l);return c?(o&&o(r.tr.setSelection(new de(c))),!0):!1}}function DT(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!de.valid(r))return!1;let o=t.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&U.isSelectable(t.state.doc.nodeAt(o.inside))?!1:(t.dispatch(t.state.tr.setSelection(new de(r))),!0)}function jT(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof de))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let o=j.empty;for(let s=r.length-1;s>=0;s--)o=j.from(r[s].createAndFill(null,o));let i=t.state.tr.replace(n.pos,n.pos,new F(o,0,0));return i.setSelection(q.near(i.doc.resolve(n.pos+1))),t.dispatch(i),!1}function RT(t){if(!(t.selection instanceof de))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",pe.create(t.doc,[Qe.widget(t.selection.head,e,{key:"gapcursor"})])}const IT=Pe.create({name:"gapCursor",addProseMirrorPlugins(){return[AT()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=Z($(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),PT=Ue.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",ve(this.options.HTMLAttributes,t)]},renderText(){return` +`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:o,storedMarks:i}=n;if(o.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,l=i||o.$to.parentOffset&&o.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:d})=>{if(d&&l&&s){const u=l.filter(p=>a.includes(p.type.name));c.ensureMarks(u)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),LT=Ue.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,ve(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>Rl({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var Pi=200,ke=function(){};ke.prototype.append=function(t){return t.length?(t=ke.from(t),!this.length&&t||t.length=e?ke.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))};ke.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};ke.prototype.forEach=function(t,e,n){e===void 0&&(e=0),n===void 0&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)};ke.prototype.map=function(t,e,n){e===void 0&&(e=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(o,i){return r.push(t(o,i))},e,n),r};ke.from=function(t){return t instanceof ke?t:t&&t.length?new qg(t):ke.empty};var qg=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(r,o){return r==0&&o==this.length?this:new e(this.values.slice(r,o))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,o,i,s){for(var a=o;a=i;a--)if(r(this.values[a],s+a)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=Pi)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=Pi)return new e(r.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(ke);ke.empty=new qg([]);var FT=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return ns&&this.right.forEachInner(n,Math.max(r-s,0),Math.min(this.length,o)-s,i+s)===!1)return!1},e.prototype.forEachInvertedInner=function(n,r,o,i){var s=this.left.length;if(r>s&&this.right.forEachInvertedInner(n,r-s,Math.max(o,s)-s,i+s)===!1||o=o?this.right.slice(n-o,r-o):this.left.slice(n,o).append(this.right.slice(0,r-o))},e.prototype.leafAppend=function(n){var r=this.right.leafAppend(n);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(n){var r=this.left.leafPrepend(n);if(r)return new e(r,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e}(ke);const BT=500;class kt{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,i;n&&(o=this.remapping(r,this.items.length),i=o.maps.length);let s=e.tr,a,l,c=[],d=[];return this.items.forEach((u,p)=>{if(!u.step){o||(o=this.remapping(r,p+1),i=o.maps.length),i--,d.push(u);return}if(o){d.push(new At(u.map));let f=u.step.map(o.slice(i)),h;f&&s.maybeStep(f).doc&&(h=s.mapping.maps[s.mapping.maps.length-1],c.push(new At(h,void 0,void 0,c.length+d.length))),i--,h&&o.appendMap(h,i)}else s.maybeStep(u.step);if(u.selection)return a=o?u.selection.map(o.slice(i)):u.selection,l=new kt(this.items.slice(0,r).append(d.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(e,n,r,o){let i=[],s=this.eventCount,a=this.items,l=!o&&a.length?a.get(a.length-1):null;for(let d=0;d$T&&(a=zT(a,c),s-=c),new kt(a.append(i),s)}remapping(e,n){let r=new ko;return this.items.forEach((o,i)=>{let s=o.mirrorOffset!=null&&i-o.mirrorOffset>=e?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new kt(this.items.append(e.map(n=>new At(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),i=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(p=>{p.selection&&a--},o);let l=n;this.items.forEach(p=>{let f=i.getMirror(--l);if(f==null)return;s=Math.min(s,f);let h=i.maps[f];if(p.step){let m=e.steps[f].invert(e.docs[f]),y=p.selection&&p.selection.map(i.slice(l+1,f));y&&a++,r.push(new At(h,m,y))}else r.push(new At(h))},o);let c=[];for(let p=n;pBT&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,o=[],i=0;return this.items.forEach((s,a)=>{if(a>=e)o.push(s),s.selection&&i++;else if(s.step){let l=s.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let d=s.selection&&s.selection.map(n.slice(r));d&&i++;let u=new At(c.invert(),l,d),p,f=o.length-1;(p=o.length&&o[f].merge(u))?o[f]=p:o.push(u)}}else s.map&&r--},this.items.length,0),new kt(ke.from(o.reverse()),i)}}kt.empty=new kt(ke.empty,0);function zT(t,e){let n;return t.forEach((r,o)=>{if(r.selection&&e--==0)return n=o,!1}),t.slice(n)}class At{constructor(e,n,r,o){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=o}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new At(n.getMap().invert(),n,this.selection)}}}class gn{constructor(e,n,r,o,i){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=i}}const $T=20;function _T(t,e,n,r){let o=n.getMeta(Yn),i;if(o)return o.historyState;n.getMeta(HT)&&(t=new gn(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(Yn))return s.getMeta(Yn).redo?new gn(t.done.addTransform(n,void 0,r,gi(e)),t.undone,zp(n.mapping.maps),t.prevTime,t.prevComposition):new gn(t.done,t.undone.addTransform(n,void 0,r,gi(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!VT(n,t.prevRanges)),c=s?ya(t.prevRanges,n.mapping):zp(n.mapping.maps);return new gn(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,gi(e)),kt.empty,c,n.time,a??t.prevComposition)}else return(i=n.getMeta("rebased"))?new gn(t.done.rebased(n,i),t.undone.rebased(n,i),ya(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new gn(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),ya(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function VT(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,o)=>{for(let i=0;i=e[i]&&(n=!0)}),n}function zp(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,o,i,s)=>e.push(i,s));return e}function ya(t,e){if(!t)return null;let n=[];for(let r=0;r{let o=Yn.getState(n);if(!o||(t?o.undone:o.done).eventCount==0)return!1;if(r){let i=UT(o,n,t);i&&r(i.scrollIntoView())}return!0}}const Xg=Jg(!1),Yg=Jg(!0),WT=Pe.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>Xg(t,e),redo:()=>({state:t,dispatch:e})=>Yg(t,e)}},addProseMirrorPlugins(){return[KT(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),GT=Ue.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",ve(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!$N(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$from:r,$to:o}=n,i=t();return r.parentOffset===0?i.insertContentAt({from:Math.max(r.pos-1,0),to:o.pos},{type:this.name}):lN(n)?i.insertContentAt(o.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({tr:s,dispatch:a})=>{var l;if(a){const{$to:c}=s.selection,d=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?s.setSelection(q.create(s.doc,c.pos+1)):c.nodeAfter.isBlock?s.setSelection(U.create(s.doc,c.pos)):s.setSelection(q.create(s.doc,c.pos));else{const u=(l=c.parent.type.contentMatch.defaultType)===null||l===void 0?void 0:l.create();u&&(s.insert(d,u),s.setSelection(q.create(s.doc,d+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Kg({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),qT=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,JT=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,XT=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,YT=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,ZT=zt.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",ve(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Rr({find:qT,type:this.type}),Rr({find:XT,type:this.type})]},addPasteRules(){return[rr({find:JT,type:this.type}),rr({find:YT,type:this.type})]}}),QT=Ue.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",ve(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),eA="listItem",_p="textStyle",Vp=/^(\d+)\.\s$/,tA=Ue.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",ve(this.options.HTMLAttributes,n),0]:["ol",ve(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(eA,this.editor.getAttributes(_p)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Mo({find:Vp,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Mo({find:Vp,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(_p)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),nA=Ue.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",ve(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),rA=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,oA=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,iA=zt.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",ve(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Rr({find:rA,type:this.type})]},addPasteRules(){return[rr({find:oA,type:this.type})]}}),sA=Ue.create({name:"text",group:"inline"}),aA=Pe.create({name:"starterKit",addExtensions(){var t,e,n,r,o,i,s,a,l,c,d,u,p,f,h,m,y,b;const x=[];return this.options.bold!==!1&&x.push(hT.configure((t=this.options)===null||t===void 0?void 0:t.bold)),this.options.blockquote!==!1&&x.push(cT.configure((e=this.options)===null||e===void 0?void 0:e.blockquote)),this.options.bulletList!==!1&&x.push(gT.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&x.push(bT.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&x.push(ET.configure((o=this.options)===null||o===void 0?void 0:o.codeBlock)),this.options.document!==!1&&x.push(kT.configure((i=this.options)===null||i===void 0?void 0:i.document)),this.options.dropcursor!==!1&&x.push(ST.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&x.push(IT.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&x.push(PT.configure((l=this.options)===null||l===void 0?void 0:l.hardBreak)),this.options.heading!==!1&&x.push(LT.configure((c=this.options)===null||c===void 0?void 0:c.heading)),this.options.history!==!1&&x.push(WT.configure((d=this.options)===null||d===void 0?void 0:d.history)),this.options.horizontalRule!==!1&&x.push(GT.configure((u=this.options)===null||u===void 0?void 0:u.horizontalRule)),this.options.italic!==!1&&x.push(ZT.configure((p=this.options)===null||p===void 0?void 0:p.italic)),this.options.listItem!==!1&&x.push(QT.configure((f=this.options)===null||f===void 0?void 0:f.listItem)),this.options.orderedList!==!1&&x.push(tA.configure((h=this.options)===null||h===void 0?void 0:h.orderedList)),this.options.paragraph!==!1&&x.push(nA.configure((m=this.options)===null||m===void 0?void 0:m.paragraph)),this.options.strike!==!1&&x.push(iA.configure((y=this.options)===null||y===void 0?void 0:y.strike)),this.options.text!==!1&&x.push(sA.configure((b=this.options)===null||b===void 0?void 0:b.text)),x}}),lA=zt.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",ve(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),cA="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",dA="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Pl="numeric",Ll="ascii",Fl="alpha",co="asciinumeric",to="alphanumeric",Bl="domain",Zg="emoji",uA="scheme",pA="slashscheme",ba="whitespace";function fA(t,e){return t in e||(e[t]=[]),e[t]}function Kn(t,e,n){e[Pl]&&(e[co]=!0,e[to]=!0),e[Ll]&&(e[co]=!0,e[Fl]=!0),e[co]&&(e[to]=!0),e[Fl]&&(e[to]=!0),e[to]&&(e[Bl]=!0),e[Zg]&&(e[Bl]=!0);for(const r in e){const o=fA(r,n);o.indexOf(t)<0&&o.push(t)}}function hA(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function We(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}We.groups={};We.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;rt.ta(e,n,r,o),ce=(t,e,n,r,o)=>t.tr(e,n,r,o),Up=(t,e,n,r,o)=>t.ts(e,n,r,o),I=(t,e,n,r,o)=>t.tt(e,n,r,o),Gt="WORD",zl="UWORD",Qg="ASCIINUMERICAL",ey="ALPHANUMERICAL",Do="LOCALHOST",$l="TLD",_l="UTLD",yi="SCHEME",gr="SLASH_SCHEME",Pd="NUM",Vl="WS",Ld="NL",uo="OPENBRACE",po="CLOSEBRACE",Li="OPENBRACKET",Fi="CLOSEBRACKET",Bi="OPENPAREN",zi="CLOSEPAREN",$i="OPENANGLEBRACKET",_i="CLOSEANGLEBRACKET",Vi="FULLWIDTHLEFTPAREN",Ui="FULLWIDTHRIGHTPAREN",Hi="LEFTCORNERBRACKET",Ki="RIGHTCORNERBRACKET",Wi="LEFTWHITECORNERBRACKET",Gi="RIGHTWHITECORNERBRACKET",qi="FULLWIDTHLESSTHAN",Ji="FULLWIDTHGREATERTHAN",Xi="AMPERSAND",Yi="APOSTROPHE",Zi="ASTERISK",yn="AT",Qi="BACKSLASH",es="BACKTICK",ts="CARET",bn="COLON",Fd="COMMA",ns="DOLLAR",Mt="DOT",rs="EQUALS",Bd="EXCLAMATION",st="HYPHEN",fo="PERCENT",is="PIPE",ss="PLUS",as="POUND",ho="QUERY",zd="QUOTE",ty="FULLWIDTHMIDDLEDOT",$d="SEMI",Dt="SLASH",mo="TILDE",ls="UNDERSCORE",ny="EMOJI",cs="SYM";var ry=Object.freeze({__proto__:null,ALPHANUMERICAL:ey,AMPERSAND:Xi,APOSTROPHE:Yi,ASCIINUMERICAL:Qg,ASTERISK:Zi,AT:yn,BACKSLASH:Qi,BACKTICK:es,CARET:ts,CLOSEANGLEBRACKET:_i,CLOSEBRACE:po,CLOSEBRACKET:Fi,CLOSEPAREN:zi,COLON:bn,COMMA:Fd,DOLLAR:ns,DOT:Mt,EMOJI:ny,EQUALS:rs,EXCLAMATION:Bd,FULLWIDTHGREATERTHAN:Ji,FULLWIDTHLEFTPAREN:Vi,FULLWIDTHLESSTHAN:qi,FULLWIDTHMIDDLEDOT:ty,FULLWIDTHRIGHTPAREN:Ui,HYPHEN:st,LEFTCORNERBRACKET:Hi,LEFTWHITECORNERBRACKET:Wi,LOCALHOST:Do,NL:Ld,NUM:Pd,OPENANGLEBRACKET:$i,OPENBRACE:uo,OPENBRACKET:Li,OPENPAREN:Bi,PERCENT:fo,PIPE:is,PLUS:ss,POUND:as,QUERY:ho,QUOTE:zd,RIGHTCORNERBRACKET:Ki,RIGHTWHITECORNERBRACKET:Gi,SCHEME:yi,SEMI:$d,SLASH:Dt,SLASH_SCHEME:gr,SYM:cs,TILDE:mo,TLD:$l,UNDERSCORE:ls,UTLD:_l,UWORD:zl,WORD:Gt,WS:Vl});const Kt=/[a-z]/,qr=new RegExp("\\p{L}","u"),xa=new RegExp("\\p{Emoji}","u"),Wt=/\d/,wa=/\s/,Hp="\r",Ea=` +`,mA="️",gA="‍",ka="";let li=null,ci=null;function yA(t=[]){const e={};We.groups=e;const n=new We;li==null&&(li=Kp(cA)),ci==null&&(ci=Kp(dA)),I(n,"'",Yi),I(n,"{",uo),I(n,"}",po),I(n,"[",Li),I(n,"]",Fi),I(n,"(",Bi),I(n,")",zi),I(n,"<",$i),I(n,">",_i),I(n,"(",Vi),I(n,")",Ui),I(n,"「",Hi),I(n,"」",Ki),I(n,"『",Wi),I(n,"』",Gi),I(n,"<",qi),I(n,">",Ji),I(n,"&",Xi),I(n,"*",Zi),I(n,"@",yn),I(n,"`",es),I(n,"^",ts),I(n,":",bn),I(n,",",Fd),I(n,"$",ns),I(n,".",Mt),I(n,"=",rs),I(n,"!",Bd),I(n,"-",st),I(n,"%",fo),I(n,"|",is),I(n,"+",ss),I(n,"#",as),I(n,"?",ho),I(n,'"',zd),I(n,"/",Dt),I(n,";",$d),I(n,"~",mo),I(n,"_",ls),I(n,"\\",Qi),I(n,"・",ty);const r=ce(n,Wt,Pd,{[Pl]:!0});ce(r,Wt,r);const o=ce(r,Kt,Qg,{[co]:!0}),i=ce(r,qr,ey,{[to]:!0}),s=ce(n,Kt,Gt,{[Ll]:!0});ce(s,Wt,o),ce(s,Kt,s),ce(o,Wt,o),ce(o,Kt,o);const a=ce(n,qr,zl,{[Fl]:!0});ce(a,Kt),ce(a,Wt,i),ce(a,qr,a),ce(i,Wt,i),ce(i,Kt),ce(i,qr,i);const l=I(n,Ea,Ld,{[ba]:!0}),c=I(n,Hp,Vl,{[ba]:!0}),d=ce(n,wa,Vl,{[ba]:!0});I(n,ka,d),I(c,Ea,l),I(c,ka,d),ce(c,wa,d),I(d,Hp),I(d,Ea),ce(d,wa,d),I(d,ka,d);const u=ce(n,xa,ny,{[Zg]:!0});I(u,"#"),ce(u,xa,u),I(u,mA,u);const p=I(u,gA);I(p,"#"),ce(p,xa,u);const f=[[Kt,s],[Wt,o]],h=[[Kt,null],[qr,a],[Wt,i]];for(let m=0;mm[0]>y[0]?1:-1);for(let m=0;m=0?b[Bl]=!0:Kt.test(y)?Wt.test(y)?b[co]=!0:b[Ll]=!0:b[Pl]=!0,Up(n,y,y,b)}return Up(n,"localhost",Do,{ascii:!0}),n.jd=new We(cs),{start:n,tokens:Object.assign({groups:e},ry)}}function oy(t,e){const n=vA(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,o=[];let i=0,s=0;for(;s=0&&(u+=n[s].length,p++),c+=n[s].length,i+=n[s].length,s++;i-=u,s-=p,c-=u,o.push({t:d.t,v:e.slice(i-c,i),s:i-c,e:i})}return o}function vA(t){const e=[],n=t.length;let r=0;for(;r56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function un(t,e,n,r,o){let i;const s=e.length;for(let a=0;a=0;)i++;if(i>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+i),10);s>0;s--)n.pop();r+=i}else n.push(t[r]),r++}return e}const jo={defaultProtocol:"http",events:null,format:Wp,formatHref:Wp,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function _d(t,e=null){let n=Object.assign({},jo);t&&(n=Object.assign(n,t instanceof _d?t.o:t));const r=n.ignoreTags,o=[];for(let i=0;in?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=jo.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),o=t.get("tagName",n,e),i=this.toFormattedString(t),s={},a=t.get("className",n,e),l=t.get("target",n,e),c=t.get("rel",n,e),d=t.getObj("attributes",n,e),u=t.getObj("events",n,e);return s.href=r,a&&(s.class=a),l&&(s.target=l),c&&(s.rel=c),d&&Object.assign(s,d),{tagName:o,attributes:s,content:i,eventListeners:u}}};function zs(t,e){class n extends iy{constructor(o,i){super(o,i),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const Gp=zs("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),qp=zs("text"),bA=zs("nl"),di=zs("url",{isLink:!0,toHref(t=jo.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Do&&t[1].t===bn}}),ot=t=>new We(t);function xA({groups:t}){const e=t.domain.concat([Xi,Zi,yn,Qi,es,ts,ns,rs,st,Pd,fo,is,ss,as,Dt,cs,mo,ls]),n=[Yi,bn,Fd,Mt,Bd,fo,ho,zd,$d,$i,_i,uo,po,Fi,Li,Bi,zi,Vi,Ui,Hi,Ki,Wi,Gi,qi,Ji],r=[Xi,Yi,Zi,Qi,es,ts,ns,rs,st,uo,po,fo,is,ss,as,ho,Dt,cs,mo,ls],o=ot(),i=I(o,mo);Y(i,r,i),Y(i,t.domain,i);const s=ot(),a=ot(),l=ot();Y(o,t.domain,s),Y(o,t.scheme,a),Y(o,t.slashscheme,l),Y(s,r,i),Y(s,t.domain,s);const c=I(s,yn);I(i,yn,c),I(a,yn,c),I(l,yn,c);const d=I(i,Mt);Y(d,r,i),Y(d,t.domain,i);const u=ot();Y(c,t.domain,u),Y(u,t.domain,u);const p=I(u,Mt);Y(p,t.domain,u);const f=ot(Gp);Y(p,t.tld,f),Y(p,t.utld,f),I(c,Do,f);const h=I(u,st);I(h,st,h),Y(h,t.domain,u),Y(f,t.domain,u),I(f,Mt,p),I(f,st,h);const m=I(f,bn);Y(m,t.numeric,Gp);const y=I(s,st),b=I(s,Mt);I(y,st,y),Y(y,t.domain,s),Y(b,r,i),Y(b,t.domain,s);const x=ot(di);Y(b,t.tld,x),Y(b,t.utld,x),Y(x,t.domain,s),Y(x,r,i),I(x,Mt,b),I(x,st,y),I(x,yn,c);const k=I(x,bn),O=ot(di);Y(k,t.numeric,O);const C=ot(di),N=ot();Y(C,e,C),Y(C,n,N),Y(N,e,C),Y(N,n,N),I(x,Dt,C),I(O,Dt,C);const M=I(a,bn),S=I(l,bn),R=I(S,Dt),P=I(R,Dt);Y(a,t.domain,s),I(a,Mt,b),I(a,st,y),Y(l,t.domain,s),I(l,Mt,b),I(l,st,y),Y(M,t.domain,C),I(M,Dt,C),I(M,ho,C),Y(P,t.domain,C),Y(P,e,C),I(P,Dt,C);const D=[[uo,po],[Li,Fi],[Bi,zi],[$i,_i],[Vi,Ui],[Hi,Ki],[Wi,Gi],[qi,Ji]];for(let L=0;L=0&&p++,o++,d++;if(p<0)o-=d,o0&&(i.push(Oa(qp,e,s)),s=[]),o-=p,d-=p;const f=u.t,h=n.slice(o-d,o);i.push(Oa(f,e,h))}}return s.length>0&&i.push(Oa(qp,e,s)),i}function Oa(t,e,n){const r=n[0].s,o=n[n.length-1].e,i=e.slice(r,o);return new t(i,n)}const EA=typeof console<"u"&&console&&console.warn||(()=>{}),kA="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",ae={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function OA(){return We.groups={},ae.scanner=null,ae.parser=null,ae.tokenQueue=[],ae.pluginQueue=[],ae.customSchemes=[],ae.initialized=!1,ae}function Jp(t,e=!1){if(ae.initialized&&EA(`linkifyjs: already initialized - will not register custom scheme "${t}" ${kA}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format. +1. Must only contain digits, lowercase ASCII letters or "-" +2. Cannot start or end with "-" +3. "-" cannot repeat`);ae.customSchemes.push([t,e])}function CA(){ae.scanner=yA(ae.customSchemes);for(let t=0;t{const o=e.some(l=>l.docChanged)&&!n.doc.eq(r.doc),i=e.some(l=>l.getMeta("preventAutolink"));if(!o||i)return;const{tr:s}=r,a=ZS(n.doc,[...e]);if(sN(a).forEach(({newRange:l})=>{const c=eN(r.doc,l,p=>p.isTextblock);let d,u;if(c.length>1?(d=c[0],u=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ")):c.length&&r.doc.textBetween(l.from,l.to," "," ").endsWith(" ")&&(d=c[0],u=r.doc.textBetween(d.pos,l.to,void 0," ")),d&&u){const p=u.split(" ").filter(y=>y!=="");if(p.length<=0)return!1;const f=p[p.length-1],h=d.pos+u.lastIndexOf(f);if(!f)return!1;const m=Vd(f).map(y=>y.toObject(t.defaultProtocol));if(!SA(m))return!1;m.filter(y=>y.isLink).map(y=>({...y,from:h+y.start+1,to:h+y.end+1})).filter(y=>r.schema.marks.code?!r.doc.rangeHasMark(y.from,y.to,r.schema.marks.code):!0).filter(y=>t.validate(y.value)).forEach(y=>{jd(y.from,y.to,r.doc).some(b=>b.mark.type===t.type)||s.addMark(y.from,y.to,t.type.create({href:y.href}))})}}),!!s.steps.length)return s}})}function TA(t){return new Ce({key:new Xe("handleClickLink"),props:{handleClick:(e,n,r)=>{var o,i;if(r.button!==0||!e.editable)return!1;let s=r.target;const a=[];for(;s.nodeName!=="DIV";)a.push(s),s=s.parentNode;if(!a.find(p=>p.nodeName==="A"))return!1;const l=Hg(e.state,t.type.name),c=r.target,d=(o=c?.href)!==null&&o!==void 0?o:l.href,u=(i=c?.target)!==null&&i!==void 0?i:l.target;return c&&d?(window.open(d,u),!0):!1}}})}function AA(t){return new Ce({key:new Xe("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:o}=e,{selection:i}=o,{empty:s}=i;if(s)return!1;let a="";r.content.forEach(c=>{a+=c.textContent});const l=sy(a,{defaultProtocol:t.defaultProtocol}).find(c=>c.isLink&&c.value===a);return!a||!l?!1:(t.editor.commands.setMark(t.type,{href:l.href}),!0)}}})}const MA=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function Xp(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const o=typeof r=="string"?r:r.scheme;o&&n.push(o)}),!t||t.replace(MA,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))`,"i"))}const DA=zt.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.protocols.forEach(t=>{if(typeof t=="string"){Jp(t);return}Jp(t.scheme,t.optionalSlashes)})},onDestroy(){OA()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!Xp(e,this.options.protocols)?!1:null}}]},renderHTML({HTMLAttributes:t}){return Xp(t.href,this.options.protocols)?["a",ve(this.options.HTMLAttributes,t),0]:["a",ve(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>e().setMark(this.name,t).setMeta("preventAutolink",!0).run(),toggleLink:t=>({chain:e})=>e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[rr({find:t=>{const e=[];if(t){const{validate:n}=this.options,r=sy(t).filter(o=>o.isLink&&n(o.value));r.length&&r.forEach(o=>e.push({text:o.value,data:{href:o.href},index:o.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[];return this.options.autolink&&t.push(NA({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:this.options.validate})),this.options.openOnClick===!0&&t.push(TA({type:this.type})),this.options.linkOnPaste&&t.push(AA({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),jA=Pe.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Ce({key:new Xe("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,o=[];if(!n)return null;const i=this.editor.isEmpty;return t.descendants((s,a)=>{const l=r>=a&&r<=a+s.nodeSize,c=!s.isLeaf&&Bs(s);if((l||!this.options.showOnlyCurrent)&&c){const d=[this.options.emptyNodeClass];i&&d.push(this.options.emptyEditorClass);const u=Qe.node(a,a+s.nodeSize,{class:d.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:s,pos:a,hasAnchor:l}):this.options.placeholder});o.push(u)}return this.options.includeChildren}),pe.create(t,o)}}})]}}),RA=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,IA=Ue.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",ve(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[Kg({find:RA,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),PA=IA.extend({addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),class:{default:fn.IMAGE,renderHTML:e=>({class:e.class})}}},addNodeView(){return({node:t,editor:e,getPos:n})=>{const{view:r}=e,{class:o}=t.attrs,i=document.createElement("div"),s=document.createElement("div"),a=document.createElement("img"),l=()=>{if(typeof n=="function"){const b={...t.attrs,class:a.className};r.dispatch(r.state.tr.setNodeMarkup(n(),null,b))}},c=()=>{const b=document.createElement("div");b.classList.add("img-alignment-controller"),b.setAttribute("role","group");const x=document.createElement("button"),k=document.createElement("button"),O=document.createElement("button");x.setAttribute("aria-label","Align left"),x.setAttribute("title","Align left"),x.setAttribute("type","button"),k.setAttribute("aria-label","Align center"),k.setAttribute("title","Align center"),k.setAttribute("type","button"),O.setAttribute("aria-label","Align right"),O.setAttribute("title","Align right"),O.setAttribute("type","button"),x.innerHTML=` + + + + `,k.innerHTML=` + + + + `,O.innerHTML=` + + + + `;const C=N=>{d.forEach(M=>a.classList.remove(M)),a.classList.add(N),l()};x.addEventListener("click",()=>C(fn.IMAGE_ALIGN_LEFT)),k.addEventListener("click",()=>C(fn.IMAGE_ALIGN_CENTER)),O.addEventListener("click",()=>C(fn.IMAGE_ALIGN_RIGHT)),b.append(x,k,O),s.appendChild(b)};i.setAttribute("style","display: flex;"),i.appendChild(s),s.classList.add("image-resize-container");const d=[fn.IMAGE_ALIGN_LEFT,fn.IMAGE_ALIGN_CENTER,fn.IMAGE_ALIGN_RIGHT],u=d.find(b=>o.includes(b));u&&s.classList.add(u);const p=o.match(/rte-w-(\d+)/);if(p){const b=p[0];s.classList.add(b)}s.appendChild(a),Object.entries(t.attrs).forEach(([b,x])=>{x!=null&&a.setAttribute(b,x)});const f=["top: -4px; left: -4px; cursor: nwse-resize;","top: -4px; right: -4px; cursor: nesw-resize;","bottom: -4px; left: -4px; cursor: nesw-resize;","bottom: -4px; right: -4px; cursor: nwse-resize;"];let h=!1,m,y;return s.addEventListener("click",()=>{if(s.childElementCount>3)for(let b=0;b<5;b++)s.removeChild(s.lastChild);c(),Array.from({length:4},(b,x)=>{const k=document.createElement("div");k.classList.add("resize-dot"),k.setAttribute("style",`position: absolute; ${f[x]}`);const O=C=>{var N;const M=((N=s.parentElement)==null?void 0:N.offsetWidth)||1,S=Math.min(100,Math.max(5,C/M*100)),R=`rte-w-${Math.round(S/5)*5}`;a.classList.forEach(P=>{/^rte-w-\d+$/.test(P)&&a.classList.remove(P)}),s.classList.forEach(P=>{/^rte-w-\d+$/.test(P)&&s.classList.remove(P)}),s.classList.add(R),a.classList.add(R)};k.addEventListener("pointerdown",C=>{C.preventDefault(),h=!0,m=C.clientX,y=s.offsetWidth;const N=S=>{if(!h)return;const R=x%2===0?-(S.clientX-m):S.clientX-m,P=y+R;O(P)},M=()=>{h&&(h=!1),l(),document.removeEventListener("pointermove",N),document.removeEventListener("pointerup",M)};document.addEventListener("pointermove",N),document.addEventListener("pointerup",M)},{passive:!1}),s.appendChild(k)})}),document.addEventListener("click",b=>{const x=b.target;if(!s.contains(x)&&s.childElementCount>3)for(let k=0;k<5;k++)s.removeChild(s.lastChild)}),{dom:i}}}}),vt={placeholder:"Write something …",linkDialog:{title:"Add Link",label:"Link",ok:"OK",cancel:"Cancel"},imageDialog:{title:"Add Image",label:"Image URL",altTextLabel:"Alternative text",altTextPlaceholder:'Describe the image for screen readers (e.g. "Group of young college students in a classroom")',ok:"OK",cancel:"Cancel"}},LA="_selected_h2wq9_37",ee={"editor-actions-wrapper":"_editor-actions-wrapper_h2wq9_26","editor-actions-button":"_editor-actions-button_h2wq9_33",selected:LA,"editor-actions-button-image":"_editor-actions-button-image_h2wq9_41"},He={heading:"heading",bold:"bold",italic:"italic",underline:"underline",strike:"strike",code:"code",codeBlock:"codeBlock",link:"link",blockquote:"blockquote",bulletList:"bulletList",orderedList:"orderedList"},FA=({editor:t,disabled:e,locales:n})=>{var r,o,i,s,a,l,c,d,u,p,f,h,m,y,b,x,k,O,C,N;const[M,S]=g.useState({open:!1,url:""}),[R,P]=g.useState({open:!1,url:"",altText:""}),D=()=>{var G;const ue=(G=t?.getAttributes("link"))==null?void 0:G.href;S({open:!0,url:ue??""})},L=()=>S({open:!1,url:""}),V=()=>{M.url?t?.chain().focus().extendMarkRange(He.link).setLink({href:M.url}).run():t?.chain().focus().extendMarkRange(He.link).unsetLink().run(),L()},K=()=>{var G,ue;const Fn=(G=t?.getAttributes("image"))==null?void 0:G.src,Jo=(ue=t?.getAttributes("image"))==null?void 0:ue.alt;P({open:!0,url:Fn??"",altText:Jo??""})},W=()=>{P({open:!1,url:"",altText:""})},Q=()=>{R.url&&t?.chain().focus().setImage({src:R.url,alt:R.altText}).run(),W()},B=()=>t?.chain().focus().toggleHeading({level:1}).run(),H=!e&&t?.isActive(He.heading,{level:1}),J=()=>t?.chain().focus().toggleHeading({level:2}).run(),be=!e&&t?.isActive(He.heading,{level:2}),Fe=()=>t?.chain().focus().toggleHeading({level:3}).run(),ge=!e&&t?.isActive(He.heading,{level:3}),ye=()=>t?.chain().focus().toggleBold().run(),xe=!e&&t?.isActive(He.bold),te=()=>t?.chain().focus().toggleItalic().run(),Me=!e&&t?.isActive(He.italic),mt=()=>t?.chain().focus().toggleUnderline().run(),Ye=!e&&t?.isActive(He.underline),Ct=()=>t?.chain().focus().toggleStrike().run(),gt=!e&&t?.isActive(He.strike),yt=()=>t?.chain().focus().toggleCode().run(),Vt=!e&&t?.isActive(He.code),St=()=>t?.chain().focus().toggleCodeBlock().run(),nt=!e&&t?.isActive(He.codeBlock),ne=()=>t?.chain().focus().toggleBlockquote().run(),Nt=!e&&t?.isActive(He.blockquote),Tt=()=>t?.chain().focus().toggleBulletList().run(),sr=!e&&t?.isActive(He.bulletList),Ur=()=>t?.chain().focus().toggleOrderedList().run(),rt=!e&&t?.isActive(He.orderedList),an=()=>t?.chain().focus().undo().run(),ar=()=>t?.chain().focus().redo().run(),ln=((r=n?.linkDialog)==null?void 0:r.title)??((o=vt.linkDialog)==null?void 0:o.title),cn=((i=n?.imageDialog)==null?void 0:i.title)??((s=vt.imageDialog)==null?void 0:s.title);return v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:ee["editor-actions-wrapper"],children:[v.jsxs(fr,{children:[v.jsx(se,{onClick:B,className:`${ee["editor-actions-button"]} ${H?ee.selected:""}`,"aria-pressed":H,"aria-label":"Heading 1",disabled:e,title:"Heading 1",type:"button",variant:"secondary",size:"sm",icon:v.jsx(nd,{size:18})}),v.jsx(se,{onClick:J,className:`${ee["editor-actions-button"]} ${be?ee.selected:""}`,"aria-pressed":be,"aria-label":"Heading 2",disabled:e,title:"Heading 2",type:"button",variant:"secondary",size:"sm",icon:v.jsx(rd,{size:18})}),v.jsx(se,{onClick:Fe,className:`${ee["editor-actions-button"]} ${ge?ee.selected:""}`,"aria-pressed":ge,"aria-label":"Heading 3",disabled:e,title:"Heading 3",type:"button",variant:"secondary",size:"sm",icon:v.jsx(od,{size:18})})]}),v.jsxs(fr,{children:[v.jsx(se,{onClick:ye,className:`${ee["editor-actions-button"]} ${xe?ee.selected:""}`,"aria-pressed":xe,"aria-label":"Bold",disabled:e,title:"Bold",type:"button",variant:"secondary",size:"sm",icon:v.jsx(td,{size:18})}),v.jsx(se,{onClick:te,className:`${ee["editor-actions-button"]} ${Me?ee.selected:""}`,"aria-pressed":Me,"aria-label":"Italic",disabled:e,title:"Italic",type:"button",variant:"secondary",size:"sm",icon:v.jsx(id,{size:18})}),v.jsx(se,{onClick:mt,className:`${ee["editor-actions-button"]} ${Ye?ee.selected:""}`,"aria-pressed":Ye,"aria-label":"Underline",disabled:e,title:"Underline",type:"button",variant:"secondary",size:"sm",icon:v.jsx(ad,{size:18})}),v.jsx(se,{onClick:Ct,className:`${ee["editor-actions-button"]} ${gt?ee.selected:""}`,"aria-pressed":gt,"aria-label":"Strikethrough",disabled:e,title:"Strikethrough",type:"button",variant:"secondary",size:"sm",icon:v.jsx(sd,{size:18})})]}),v.jsxs(fr,{children:[v.jsx(se,{onClick:Tt,className:`${ee["editor-actions-button"]} ${sr?ee.selected:""}`,"aria-pressed":sr,"aria-label":"Unordered list",disabled:e,title:"Unordered list",type:"button",variant:"secondary",size:"sm",icon:v.jsx(Qc,{size:18})}),v.jsx(se,{onClick:Ur,className:`${ee["editor-actions-button"]} ${rt?ee.selected:""}`,"aria-pressed":rt,"aria-label":"Ordered list",disabled:e,title:"Ordered list",type:"button",variant:"secondary",size:"sm",icon:v.jsx(Zc,{size:18})})]}),v.jsxs(fr,{children:[v.jsx(se,{onClick:D,className:`${ee["editor-actions-button"]}`,"aria-label":"Add link",disabled:e,title:"Add link",type:"button",variant:"secondary",size:"sm",icon:v.jsx(Yc,{size:18})}),v.jsx(se,{onClick:yt,className:`${ee["editor-actions-button"]} ${Vt?ee.selected:""}`,"aria-pressed":Vt,"aria-label":"Code",disabled:e,title:"Code",type:"button",variant:"secondary",size:"sm",icon:v.jsx(Jc,{size:18})}),v.jsx(se,{onClick:St,className:`${ee["editor-actions-button"]} ${nt?ee.selected:""}`,"aria-pressed":nt,"aria-label":"Code block",disabled:e,title:"Code block",type:"button",variant:"secondary",size:"sm",icon:v.jsx(qc,{size:18})}),v.jsx(se,{onClick:ne,className:`${ee["editor-actions-button"]} ${Nt?ee.selected:""}`,"aria-pressed":Nt,"aria-label":"Blockquote",title:"Blockquote",type:"button",disabled:e,variant:"secondary",size:"sm",icon:v.jsx(Gc,{size:18})}),v.jsx(se,{onClick:K,className:`${ee["editor-actions-button"]} ${ee["editor-actions-button-image"]}`,"aria-label":"Add image",title:"Add image",type:"button",disabled:e,variant:"secondary",size:"sm",icon:v.jsx(Xc,{size:18})})]}),v.jsxs(fr,{children:[v.jsx(se,{onClick:an,className:`${ee["editor-actions-button"]}`,"aria-label":"Undo",disabled:e||!(t!=null&&t.can().undo()),title:"Undo",type:"button",variant:"secondary",size:"sm",icon:v.jsx(Kc,{size:18})}),v.jsx(se,{onClick:ar,className:`${ee["editor-actions-button"]}`,"aria-label":"Redo",disabled:e||!(t!=null&&t.can().redo()),title:"Redo",type:"button",variant:"secondary",size:"sm",icon:v.jsx(Wc,{size:18})})]})]}),v.jsxs(Ke,{show:M.open,onHide:L,size:"lg",ariaLabel:ln,children:[v.jsx(Ke.Header,{children:v.jsx(Ke.Title,{children:ln})}),v.jsx(Ke.Body,{children:v.jsxs(oe.Group,{controlId:"link-url",as:ze,children:[v.jsx(oe.Group.Label,{column:!0,children:((a=n?.linkDialog)==null?void 0:a.label)??((l=vt.linkDialog)==null?void 0:l.label)}),v.jsx(ze,{children:v.jsx(oe.Group.Input,{type:"text",value:M.url,autoFocus:!0,autoComplete:"off",onChange:G=>S(ue=>({...ue,url:G.target.value}))})})]})}),v.jsxs(Ke.Footer,{children:[v.jsx(se,{onClick:V,variant:"primary",type:"button",children:((c=n?.linkDialog)==null?void 0:c.ok)??((d=vt.linkDialog)==null?void 0:d.ok)}),v.jsx(se,{onClick:L,variant:"secondary",type:"button",children:((u=n?.linkDialog)==null?void 0:u.cancel)??((p=vt.linkDialog)==null?void 0:p.cancel)})]})]}),v.jsxs(Ke,{show:R.open,onHide:W,size:"lg",ariaLabel:cn,children:[v.jsx(Ke.Header,{children:v.jsx(Ke.Title,{children:cn})}),v.jsxs(Ke.Body,{children:[v.jsxs(oe.Group,{controlId:"image-url",as:ze,children:[v.jsx(oe.Group.Label,{column:!0,children:((f=n?.imageDialog)==null?void 0:f.label)??((h=vt.imageDialog)==null?void 0:h.label)}),v.jsx(ze,{children:v.jsx(oe.Group.Input,{type:"text",autoFocus:!0,autoComplete:"off",placeholder:"https://example.com/image.png",value:R.url,onChange:G=>P(ue=>({...ue,url:G.target.value}))})})]}),v.jsxs(oe.Group,{controlId:"image-alt-text",as:ze,children:[v.jsx(oe.Group.Label,{column:!0,children:((m=n?.imageDialog)==null?void 0:m.altTextLabel)??((y=vt.imageDialog)==null?void 0:y.altTextLabel)}),v.jsx(ze,{children:v.jsx(oe.Group.Input,{type:"text",value:R.altText,autoComplete:"off",placeholder:((b=n?.imageDialog)==null?void 0:b.altTextPlaceholder)??((x=vt.imageDialog)==null?void 0:x.altTextPlaceholder),onChange:G=>P(ue=>({...ue,altText:G.target.value}))})})]})]}),v.jsxs(Ke.Footer,{children:[v.jsx(se,{onClick:Q,variant:"primary",type:"button",children:((k=n?.imageDialog)==null?void 0:k.ok)??((O=vt.imageDialog)==null?void 0:O.ok)}),v.jsx(se,{onClick:W,variant:"secondary",type:"button",children:((C=n?.imageDialog)==null?void 0:C.cancel)??((N=vt.imageDialog)==null?void 0:N.cancel)})]})]})]})};var fn=(t=>(t.HEADING="rte-heading",t.PARAGRAPH="rte-paragraph",t.BOLD="rte-bold",t.ITALIC="rte-italic",t.STRIKE="rte-strike",t.BULLET_LIST="rte-bullet-list",t.ORDERED_LIST="rte-ordered-list",t.CODE="rte-code",t.CODE_BLOCK="rte-code-block",t.BLOCKQUOTE="rte-blockquote",t.UNDERLINE="rte-underline",t.LINK="rte-link",t.IMAGE="rte-img",t.IMAGE_ALIGN_LEFT="rte-img-left",t.IMAGE_ALIGN_CENTER="rte-img-center",t.IMAGE_ALIGN_RIGHT="rte-img-right",t))(fn||{});const BA=g.forwardRef(({initialValue:t,onChange:e,disabled:n,locales:r,editorContentId:o,editorContentAriaLabelledBy:i,invalid:s,ariaRequired:a},l)=>{const c=oT({extensions:[aA.configure({heading:{levels:[1,2,3],HTMLAttributes:{class:"rte-heading"}},paragraph:{HTMLAttributes:{class:"rte-paragraph"}},bold:{HTMLAttributes:{class:"rte-bold"}},italic:{HTMLAttributes:{class:"rte-italic"}},strike:{HTMLAttributes:{class:"rte-strike"}},bulletList:{HTMLAttributes:{class:"rte-bullet-list"}},orderedList:{HTMLAttributes:{class:"rte-ordered-list"}},code:{HTMLAttributes:{class:"rte-code"}},codeBlock:{HTMLAttributes:{class:"rte-code-block"}},blockquote:{HTMLAttributes:{class:"rte-blockquote"}}}),lA.configure({HTMLAttributes:{class:"rte-underline"}}),DA.configure({openOnClick:!1,autolink:!0,linkOnPaste:!0,HTMLAttributes:{class:"rte-link"}}),jA.configure({placeholder:r?.placeholder??vt.placeholder}),PA.configure({HTMLAttributes:{class:"rte-img"}})],content:t,editorProps:{attributes:{class:"rich-text-editor-content",...o&&{id:o},...i&&{"aria-labelledby":i},...n&&{disabled:"true"},...a&&{"aria-required":"true"},role:"textbox","aria-label":"rich text editor content"}},onUpdate:({editor:d})=>e&&e(d.getHTML())});return g.useEffect(()=>{c&&c.setEditable(!n,!1)},[n,c]),v.jsxs("div",{className:`rich-text-editor-wrapper ${s?"invalid":""}`,"data-testid":"rich-text-editor-wrapper",ref:l,tabIndex:0,children:[v.jsx(FA,{editor:c,disabled:n,locales:r}),v.jsx("div",{className:"editor-content-wrapper",children:v.jsx(qN,{editor:c})})]})});BA.displayName="RichTextEditor";const ZM=t=>{const[e,n]=g.useState(Or.MD5),[r,o]=g.useState(!0),[i,s]=g.useState(!1);return g.useEffect(()=>{(async()=>{o(!0);try{const l=await t.getFixityAlgorithm();n(l)}catch{s(!0)}finally{o(!1)}})()},[t]),{fixityAlgorithm:e,isLoadingFixityAlgorithm:r,errorLoadingFixityAlgorithm:i}},zA="_loading_config_grfox_1",$A="_dots_grfox_9",Yp={loading_config:zA,dots:$A},QM=()=>{const{t}=$t("shared",{keyPrefix:"fileUploader"});return T.jsxs("div",{className:Yp.loading_config,"data-testid":"loading-config-spinner",children:[T.jsx(sm,{animation:"border",variant:"primary"}),T.jsxs("span",{children:[t("loadingConfiguration")," ",T.jsxs("span",{className:Yp.dots,children:[T.jsx("span",{children:"."}),T.jsx("span",{children:"."}),T.jsx("span",{children:"."})]})]})]})};var _A=(t=>(t.HOME="/",t.SIGN_UP_JSF="/dataverseuser.xhtml?editMode=CREATE&redirectPage=%2Fdataverse.xhtml",t.LOG_IN_JSF="/loginpage.xhtml?redirectPage=%2Fdataverse.xhtml",t.LOG_OUT="/",t.DATASETS="/datasets",t.CREATE_DATASET="/datasets/:collectionId/create",t.UPLOAD_DATASET_FILES="/datasets/upload-files",t.EDIT_DATASET_METADATA="/datasets/edit-metadata",t.EDIT_DATASET_TERMS="/datasets/edit-terms",t.FILES="/files",t.EDIT_FILE_METADATA="/files/edit-metadata",t.FILES_REPLACE="/files/replace",t.COLLECTIONS_BASE="/collections",t.COLLECTIONS="/collections/:collectionId",t.CREATE_COLLECTION="/collections/:parentCollectionId/create",t.ACCOUNT="/account",t.EDIT_COLLECTION="/collections/:collectionId/edit",t.EDIT_FEATURED_ITEMS="/collections/:collectionId/edit-featured-items",t.FEATURED_ITEM="/featured-item/:parentCollectionId/:featuredItemId",t.NOT_FOUND_PAGE="/404",t.AUTH_CALLBACK="/auth-callback",t.SIGN_UP="/sign-up",t.ADVANCED_SEARCH="/collections/:collectionId/search",t))(_A||{}),VA=(t=>(t.VERSION="version",t.PERSISTENT_ID="persistentId",t.PAGE="page",t.COLLECTION_ID="collectionId",t.TAB="tab",t.FILE_ID="id",t.DATASET_VERSION="datasetVersion",t.REFERRER="referrer",t.AUTH_STATE="state",t.VALID_TOKEN_BUT_NOT_LINKED_ACCOUNT="validTokenButNotLinkedAccount",t.TOOL_TYPE="toolType",t))(VA||{});class eD{constructor(e,n){this.majorNumber=e,this.minorNumber=n}toString(){return this.majorNumber===void 0||this.minorNumber===void 0?":draft":`${this.majorNumber}.${this.minorNumber}`}toSearchParam(){return this.majorNumber===void 0||this.minorNumber===void 0?"DRAFT":this.toString()}}var bt=(t=>(t.REPLACE_FILE="replace-file",t.ADD_FILES_TO_DATASET="add-files-to-dataset",t))(bt||{});function Zp(t,e,n,r,o,i,s){const a=new AbortController;return t.uploadFile(e,{file:n},i,a,s).then(r).catch(o),()=>a.abort()}const UA=6;function HA(t){const{fileRepository:e,datasetPersistentId:n,checksumAlgorithm:r,addFile:o,updateFile:i,getFileByKey:s,addUploadingToCancel:a,removeUploadingToCancel:l,onFileSkipped:c,validateBeforeUpload:d}=t,u=g.useRef(new fy(UA)),p=g.useCallback(x=>{l(Re.getFileKey(x)),u.current.release(1)},[l]),f=g.useCallback(async x=>{const k=Re.getFileKey(x);try{if(r===Or.NONE)i(k,{checksumValue:""});else{const O=await Re.getChecksum(x,r);i(k,{checksumValue:O})}}finally{l(k),u.current.release(1)}},[r,i,l]),h=g.useCallback(async x=>{if(Re.isDS_StoreFile(x)){c?.("ds_store",x);return}const k=Re.getFileKey(x);if(s(k)){c?.("already_uploaded",x);return}if(d&&!await d(x))return;await u.current.acquire(1),o(x);const O=Zp(e,n,x,()=>{i(k,{status:ct.DONE}),f(x)},()=>{i(k,{status:ct.FAILED}),p(x)},C=>i(k,{progress:C}),C=>i(k,{storageId:C}));a(k,O)},[e,n,o,i,s,a,f,p,c,d]),m=g.useCallback(x=>{const k=x.createReader(),O=()=>{k.readEntries(C=>{C.length!==0&&(C.forEach(N=>{N.isFile?N.file(S=>{const R=new File([S],S.name,{type:S.type,lastModified:S.lastModified});Object.defineProperty(R,"webkitRelativePath",{value:N.fullPath?.startsWith("/")?N.fullPath.slice(1):N.fullPath??"",writable:!0}),h(R)}):N.isDirectory&&m(N)}),O())})};O()},[h]),y=g.useCallback((x,k)=>{let O=!1;Array.from(x).forEach(C=>{const N=C.webkitGetAsEntry();N?.isDirectory?(O=!0,m(N)):N?.isFile&&(O=!0,N.file(S=>{const R=new File([S],S.name,{type:S.type,lastModified:S.lastModified});Object.defineProperty(R,"webkitRelativePath",{value:N.fullPath?.startsWith("/")?N.fullPath.slice(1):N.fullPath??"",writable:!0}),h(R)}))}),!O&&k&&k.length>0&&Array.from(k).forEach(C=>{h(C)})},[m,h]),b=g.useCallback(async x=>{const k=Re.getFileKey(x);i(k,{status:ct.UPLOADING,progress:0}),await u.current.acquire(1);const O=Zp(e,n,x,()=>{i(k,{status:ct.DONE}),f(x)},()=>{i(k,{status:ct.FAILED}),p(x)},C=>i(k,{progress:C}),C=>i(k,{storageId:C}));a(k,O)},[e,n,i,a,f,p]);return{uploadOneFile:h,addFromDir:m,handleDroppedItems:y,retryUpload:b,semaphore:u.current}}const KA=hy(my),WA={buttonsStyling:!1,reverseButtons:!0,customClass:{popup:"swal-popup-custom",title:"swal-title-custom",htmlContainer:"swal-html-container-custom",actions:"swal-actions-custom",confirmButton:"btn btn-primary",denyButton:"btn btn-secondary",cancelButton:"btn btn-secondary"}},GA=KA.mixin(WA),qA="_helper_text_kqrvg_26",JA="_file_uploader_drop_zone_kqrvg_31",XA="_is_dragging_kqrvg_38",YA="_drag_drop_msg_kqrvg_43",ZA="_uploading_files_list_kqrvg_50",QA="_uploading_file_kqrvg_50",eM="_info_progress_wrapper_kqrvg_70",tM="_info_kqrvg_70",nM="_upload_progress_kqrvg_90",rM="_failed_message_kqrvg_93",oM="_failed_kqrvg_93",iM="_file_type_different_msg_kqrvg_131",it={helper_text:qA,file_uploader_drop_zone:JA,is_dragging:XA,drag_drop_msg:YA,uploading_files_list:ZA,uploading_file:QA,info_progress_wrapper:eM,info:tM,upload_progress:nM,failed_message:rM,failed:oM,file_type_different_msg:iM};async function sM(t,e){return e.getDatasetUploadLimits(t)}g.createContext({user:null,isLoadingUser:!0,sessionError:null,setUser:()=>{},refetchUserSession:()=>Promise.resolve()});const aM="Bearer token is validated, but there is no linked user account.";class lM{constructor(e){Ut(this,"error");this.error=e}getErrorMessage(){return this.error.message}getReason(){const e=this.error.message.match(/Reason was: (.*)/);return e?e[1]:null}getStatusCode(){const e=this.error.message.match(/\[(\d+)\]/);return e?parseInt(e[1]):null}getReasonWithoutStatusCode(){const e=this.getReason();if(!e)return null;const n=this.getStatusCode();return n===null?e:e.replace(`[${n}]`,"").trim()}isBearerTokenValidatedButNoLinkedUserAccountError(){const e=this.getReasonWithoutStatusCode()??this.getErrorMessage();return this.getStatusCode()===403&&e===aM}}function cM(t,e,n=sM){const[r,o]=g.useState({}),[i,s]=g.useState(!0),[a,l]=g.useState(null),c=g.useCallback(async()=>{if(!e){o({}),s(!1),l(null);return}s(!0),l(null);try{const d=await n(t,e);if(Object.keys(d).length===0){o({});return}o({maxFilesAvailableToUploadFormatted:d.numberOfFilesRemaining!==void 0?d.numberOfFilesRemaining.toLocaleString():void 0,storageQuotaRemainingFormatted:d.storageQuotaRemaining!==void 0?new vi(d.storageQuotaRemaining,Wl.BYTES).toString():void 0})}catch(d){if(o({}),d instanceof De.ReadError){const u=new lM(d),p=u.getReasonWithoutStatusCode()??u.getErrorMessage();l(p)}else l("Something went wrong getting the upload limits. Try again later.")}finally{s(!1)}},[t,e,n]);return g.useEffect(()=>{c()},[c]),{uploadLimit:r,isLoadingUploadLimits:i,errorUploadLimits:a,fetchUploadLimits:c}}const dM=1e3,uM=({fileRepository:t,datasetRepository:e,datasetPersistentId:n,fetchUploadLimits:r})=>{const{fileUploaderState:o,addFile:i,removeFile:s,updateFile:a,addUploadingToCancel:l,removeUploadingToCancel:c,getFileByKey:d}=Io(),{config:{operationType:u,originalFile:p,checksumAlgorithm:f},uploadingToCancelMap:h,isSaving:m}=o,{t:y}=$t("shared"),b=g.useRef(null),x=g.useRef(null),[k,O]=g.useState(!1),{uploadLimit:C}=cM(n,e,r),N=Object.keys(o.files).length,M=Object.values(o.files).filter(B=>B.status!==ct.DONE),S=u===bt.ADD_FILES_TO_DATASET?!0:N===0,R=g.useCallback(async B=>u===bt.REPLACE_FILE&&p.metadata.type.value!==B.type&&!await Q(p.metadata.type.value,B.type)?(b.current&&(b.current.value=""),!1):!0,[u,p]),{uploadOneFile:P,handleDroppedItems:D}=HA({fileRepository:t,datasetPersistentId:n,checksumAlgorithm:f,addFile:i,updateFile:a,getFileByKey:d,addUploadingToCancel:l,removeUploadingToCancel:c,validateBeforeUpload:R,onFileSkipped:(B,H)=>{if(B==="ds_store")lt.info(y("fileUploader.fileUploadSkipped.dsStore"));else if(B==="already_uploaded"){const J=d(Re.getFileKey(H));J&<.info(y("fileUploader.fileUploadSkipped.alreadyUploaded",{fileName:J.fileName}))}}}),L=B=>{const H=Array.from(B.target.files||[]);if(H&&H.length>0)for(const J of H)P(J);b.current&&(b.current.value="")},V=B=>{const H=Array.from(B.target.files||[]);if(H&&H.length>0)for(const J of H)P(J);x.current&&(x.current.value="")},K=B=>{if(B.preventDefault(),B.stopPropagation(),O(!1),m)return;if(u===bt.REPLACE_FILE&&N>0){lt.error(y("fileUploader.replaceFileAlreadyOneFileError"));return}const H=B.dataTransfer.items,J=B.dataTransfer.files;if(H.length>0){if(u===bt.REPLACE_FILE&&H.length>1){lt.error(y("fileUploader.replaceFileMultipleError"));return}D(H,J)}},W=(B,H)=>{const J=h.get(B);J&&(J(),lt.info(`Upload canceled - ${H}`)),c(B),s(B)},Q=async(B,H)=>(await GA.fire({titleText:y("fileUploader.fileTypeDifferentModal.title"),showDenyButton:!0,denyButtonText:y("cancel"),confirmButtonText:y("continue"),html:T.jsxs("div",{className:it.file_type_different_msg,children:[T.jsx(gy,{size:24}),T.jsx("span",{children:y("fileUploader.fileTypeDifferentModal.message",{originalFileType:_n[B]??y("unknown"),replacementFileType:_n[H]??y("unknown")})})]}),allowOutsideClick:!1,allowEscapeKey:!1})).isConfirmed;return T.jsx("div",{children:T.jsx(Qo,{defaultActiveKey:"0",children:T.jsxs(Qo.Item,{eventKey:"0",children:[T.jsx(Qo.Header,{children:y("fileUploader.accordionTitle")}),T.jsxs(Qo.Body,{children:[T.jsxs("p",{className:it.helper_text,children:[y("fileUploader.uploadWidgetHelp",{maxFilesPerUpload:dM.toLocaleString()}),C.maxFilesAvailableToUploadFormatted&&T.jsxs(T.Fragment,{children:[" ",y("fileUploader.uploadWidgetMaxFilesHelp",{maxFilesAvailableToUpload:C.maxFilesAvailableToUploadFormatted})]}),C.storageQuotaRemainingFormatted&&T.jsxs(T.Fragment,{children:[" ",y("fileUploader.uploadWidgetStorageQuotaHelp",{storageQuotaRemaining:C.storageQuotaRemainingFormatted})]})]}),T.jsxs(xr,{children:[T.jsxs(xr.Header,{children:[T.jsxs(se,{onClick:()=>b.current?.click(),disabled:!S||m,size:"sm",children:[T.jsx(Ud,{size:22})," ",u===bt.ADD_FILES_TO_DATASET?y("fileUploader.selectFileMultiple"):y("fileUploader.selectFileSingle")]}),u===bt.ADD_FILES_TO_DATASET&&T.jsxs(se,{onClick:()=>x.current?.click(),disabled:!S||m,size:"sm",className:"ms-2",children:[T.jsx(Ud,{size:22})," ",y("fileUploader.selectFolder")]})]}),T.jsx(xr.Body,{children:T.jsxs("div",{className:Hd(it.file_uploader_drop_zone,{[it.is_dragging]:k}),onDrop:K,onDragOver:B=>{B.preventDefault(),O(!0)},onDragEnter:()=>O(!0),onDragLeave:()=>O(!1),"data-testid":"file-uploader-drop-zone",children:[T.jsx("input",{ref:b,type:"file",onChange:L,multiple:u===bt.ADD_FILES_TO_DATASET,hidden:!0,disabled:!S||m}),T.jsx("input",{ref:x,type:"file",onChange:V,webkitdirectory:"",hidden:!0,disabled:!S||m}),M.length>0?T.jsx("ul",{className:it.uploading_files_list,children:M.map(B=>T.jsxs("li",{className:Hd(it.uploading_file,{[it.failed]:B.status===ct.FAILED}),children:[T.jsxs("div",{className:it.info_progress_wrapper,children:[T.jsxs("p",{className:it.info,children:[T.jsx("span",{children:B.fileDir?`${B.fileDir}/${B.fileName}`:B.fileName}),T.jsx("small",{children:B.fileSizeString})]}),B.status===ct.UPLOADING&&T.jsx("div",{className:it.upload_progress,children:T.jsx($E,{now:B.progress})}),B.status===ct.FAILED&&T.jsx("p",{className:it.failed_message,children:y("fileUploader.uploadFailed")})]}),T.jsx(se,{variant:"secondary",size:"sm",onClick:()=>W(B.key,B.fileName),children:T.jsx(yy,{title:y("fileUploader.cancelUpload")})})]},B.key))}):T.jsx("p",{className:it.drag_drop_msg,children:u===bt.ADD_FILES_TO_DATASET?y("fileUploader.dragDropMultiple"):y("fileUploader.dragDropSingle")})]})})]})]})]})})})},pM=g.memo(uM);function ay({indeterminate:t,...e}){const n=g.useRef(null);return g.useEffect(()=>{typeof t=="boolean"&&n.current&&(n.current.indeterminate=!e.checked&&t)},[n,t,e.checked]),T.jsx("input",{type:"checkbox","aria-label":"Select row",ref:n,...e})}function fM(t,e,n){return t.replace(e,n)}class ly{static toUploadedFileDTO(e,n,r,o,i,s,a,l,c,d){return{fileName:e,description:n,directoryLabel:r,categories:o,restrict:i,storageId:s,checksumValue:a,checksumType:l,mimeType:c===""?"application/octet-stream":c,...d&&{forceReplace:!0}}}}class cy{constructor(e){Ut(this,"error");this.error=e}getErrorMessage(){return this.error.message}getReason(){const e=this.error.message.match(/Reason was: (.*)/);return e?e[1]:null}getStatusCode(){const e=this.error.message.match(/\[(\d+)\]/);return e?parseInt(e[1]):null}getReasonWithoutStatusCode(){const e=this.getReason();if(!e)return null;const n=this.getStatusCode();return n===null?e:e.replace(`[${n}]`,"").trim()}}function hM(t){return"replace"in t&&typeof t.replace=="function"}const mM=t=>{const{setIsSaving:e,setReplaceOperationInfo:n,removeAllFiles:r}=Io(),{t:o}=$t("shared");return{submitReplaceFile:async(s,a)=>{if(!hM(t)){lt.error("File replacement is not supported in standalone mode");return}e(!0);const l=ly.toUploadedFileDTO(a.fileName,a.description,a.fileDir,a.tags,a.restricted,a.storageId,a.checksumValue,a.checksumAlgorithm,a.fileType,!0);try{const c=await fM(t,s,l);r(),n({success:!0,newFileIdentifier:c})}catch(c){if(c instanceof De.WriteError){const d=new cy(c),u=d.getReasonWithoutStatusCode()??d.getErrorMessage();lt.error(u)}else lt.error(o("fileUploader.defaultFileReplaceError"))}finally{e(!1)}}}};function gM(t,e,n){return t.addUploadedFiles(e,n)}const yM=(t,e)=>{const{setIsSaving:n,setAddFilesToDatasetOperationInfo:r,removeAllFiles:o}=Io(),{t:i}=$t("shared");return{submitUploadedFilesToDataset:async a=>{n(!0);const l=a.map(c=>ly.toUploadedFileDTO(c.fileName,c.description,c.fileDir,c.tags,c.restricted,c.storageId,c.checksumValue,c.checksumAlgorithm,c.fileType));try{await gM(t,e,l),o(),r({success:!0})}catch(c){if(c instanceof De.WriteError){const d=new cy(c),u=d.getReasonWithoutStatusCode()??d.getErrorMessage();lt.error(u)}else lt.error(i("fileUploader.defaultAddUploadedFilesToDatasetError"))}finally{n(!1)}}}},vM={"application/pdf":w.DOCUMENT,"image/pdf":w.DOCUMENT,"text/pdf":w.DOCUMENT,"application/x-pdf":w.DOCUMENT,"application/cnt":w.DOCUMENT,"application/msword":w.DOCUMENT,"application/vnd.ms-excel":w.DOCUMENT,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":w.DOCUMENT,"application/vnd.ms-powerpoint":w.DOCUMENT,"application/vnd.openxmlformats-officedocument.presentationml.presentation":w.DOCUMENT,"application/vnd.openxmlformats-officedocument.wordprocessingml.document":w.DOCUMENT,"application/vnd.oasis.opendocument.spreadsheet":w.DOCUMENT,"application/vnd.ms-excel.sheet.macroenabled.12":w.DOCUMENT,"text/plain":w.DOCUMENT,"text/x-log":w.DOCUMENT,"text/html":w.DOCUMENT,"application/x-tex":w.DOCUMENT,"text/x-tex":w.DOCUMENT,"text/markdown":w.DOCUMENT,"text/x-markdown":w.DOCUMENT,"text/x-r-markdown":w.DOCUMENT,"text/x-rst":w.DOCUMENT,"application/rtf":w.DOCUMENT,"text/rtf":w.DOCUMENT,"text/richtext":w.DOCUMENT,"text/turtle":w.DOCUMENT,"application/xml":w.DOCUMENT,"text/xml":w.DOCUMENT,"text/x-c":w.CODE,"text/x-c++src":w.CODE,"text/css":w.CODE,"text/x-objcsrc":w.CODE,"application/java-vm":w.CODE,"text/x-java-source":w.CODE,"text/javascript":w.CODE,"application/javascript":w.CODE,"application/x-javascript":w.CODE,"text/x-perl-script":w.CODE,"text/x-matlab":w.CODE,"text/x-mathematica":w.CODE,"text/php":w.CODE,"text/x-fortran":w.CODE,"text/x-pascal":w.CODE,"text/x-python":w.CODE,"text/x-python-script":w.CODE,"text/x-r-source":w.CODE,"text/x-sh":w.CODE,"application/x-sh":w.CODE,"application/x-shellscript":w.CODE,"application/x-sql":w.CODE,"text/x-sql":w.CODE,"application/x-swc":w.CODE,"application/x-msdownload":w.CODE,"application/x-ipynb+json":w.CODE,"application/x-stata-do":w.CODE,"text/x-stata-syntax":w.CODE,"application/x-stata-syntax":w.CODE,"text/x-spss-syntax":w.CODE,"application/x-spss-syntax":w.CODE,"text/x-sas-syntax":w.CODE,"application/x-sas-syntax":w.CODE,"type/x-r-syntax":w.CODE,"application/postscript":w.CODE,"application/vnd.wolfram.mathematica.package":w.CODE,"application/vnd.wolfram.mathematica":w.CODE,"text/x-workflow-description-language":w.CODE,"text/x-computational-workflow-language":w.CODE,"text/x-nextflow":w.CODE,"text/x-r-notebook":w.CODE,"text/x-ruby-script":w.CODE,"text/x-dagman":w.CODE,"text/x-makefile":w.CODE,"text/x-snakemake":w.CODE,"application/x-docker-file":w.CODE,"application/x-vagrant-file":w.CODE,"text/tab-separated-values":w.TABULAR,"text/tsv":w.TABULAR,"text/comma-separated-values":w.TABULAR,"text/x-comma-separated-values":w.TABULAR,"text/csv":w.TABULAR,"text/x-vcard":w.TABULAR,"text/x-fixed-field":w.TABULAR,"application/x-rlang-transport":w.TABULAR,"application/x-R-2":w.TABULAR,"application/x-stata":w.TABULAR,"application/x-stata-6":w.TABULAR,"application/x-stata-13":w.TABULAR,"application/x-stata-14":w.TABULAR,"application/x-stata-15":w.TABULAR,"application/x-stata-ado":w.TABULAR,"application/x-stata-dta":w.TABULAR,"application/x-stata-smcl":w.TABULAR,"application/x-spss-por":w.TABULAR,"application/x-spss-portable":w.TABULAR,"application/x-spss-sav":w.TABULAR,"application/x-spss-sps":w.TABULAR,"application/x-sas":w.TABULAR,"application/x-sas-transport":w.TABULAR,"application/x-sas-system":w.TABULAR,"application/x-sas-data":w.TABULAR,"application/x-sas-catalog":w.TABULAR,"application/x-sas-log":w.TABULAR,"application/x-sas-output":w.TABULAR,"application/x-r-data":w.TABULAR,"application/softgrid-do":w.TABULAR,"application/x-dvn-csvspss-zip":w.TABULAR,"application/x-dvn-tabddi-zip":w.TABULAR,"application/x-emf":w.TABULAR,"application/x-h5":w.TABULAR,"application/x-hdf":w.TABULAR,"application/x-hdf5":w.TABULAR,"application/geo+json":w.TABULAR,"application/json":w.TABULAR,"application/mathematica":w.TABULAR,"application/matlab-mat":w.TABULAR,"application/x-matlab-data":w.TABULAR,"application/x-matlab-figure":w.TABULAR,"application/x-matlab-workspace":w.TABULAR,"application/x-xfig":w.TABULAR,"application/x-msaccess":w.TABULAR,"application/netcdf":w.TABULAR,"application/x-netcdf":w.TABULAR,"application/vnd.lotus-notes":w.TABULAR,"application/x-nsdstat":w.TABULAR,"application/vnd.flographit":w.TABULAR,"application/vnd.realvnc.bed":w.TABULAR,"application/vnd.ms-pki.stl":w.TABULAR,"application/vnd.isac.fcs":w.TABULAR,"application/java-serialized-object":w.TABULAR,"chemical/x-xyz":w.TABULAR,"image/fits":w.FILE,"application/fits":w.FILE,"application/dbf":w.FILE,"application/dbase":w.FILE,"application/prj":w.FILE,"application/sbn":w.FILE,"application/sbx":w.FILE,"application/shp":w.FILE,"application/shx":w.FILE,"application/x-esri-shape":w.FILE,"application/vnd.google-earth.kml+xml":w.FILE,"application/zipped-shapefile":w.FILE,"application/zip":w.PACKAGE,"application/x-zip-compressed":w.PACKAGE,"application/vnd.antix.game-component":w.PACKAGE,"application/x-bzip":w.PACKAGE,"application/x-bzip2":w.PACKAGE,"application/vnd.google-earth.kmz":w.PACKAGE,"application/gzip":w.PACKAGE,"application/x-gzip":w.PACKAGE,"application/x-gzip-compressed":w.PACKAGE,"application/rar":w.PACKAGE,"application/x-rar":w.PACKAGE,"application/x-rar-compressed":w.PACKAGE,"application/tar":w.PACKAGE,"application/x-tar":w.PACKAGE,"application/x-compressed":w.PACKAGE,"application/x-compressed-tar":w.PACKAGE,"application/x-7z-compressed":w.PACKAGE,"application/x-xz":w.PACKAGE,"application/warc":w.PACKAGE,"application/x-iso9660-image":w.PACKAGE,"application/vnd.eln+zip":w.PACKAGE,"image/gif":w.IMAGE,"image/jpeg":w.IMAGE,"image/jp2":w.IMAGE,"image/x-portable-bitmap":w.IMAGE,"image/x-portable-graymap":w.IMAGE,"image/png":w.IMAGE,"image/x-portable-anymap":w.IMAGE,"image/x-portable-pixmap":w.IMAGE,"application/x-msmetafile":w.IMAGE,"application/dicom":w.IMAGE,"image/dicom-rle":w.IMAGE,"image/nii":w.IMAGE,"image/cmu-raster":w.IMAGE,"image/x-rgb":w.IMAGE,"image/svg+xml":w.IMAGE,"image/tiff":w.IMAGE,"image/bmp":w.IMAGE,"image/x-xbitmap":w.IMAGE,"image/RAW":w.IMAGE,"image/raw":w.IMAGE,"application/x-tgif":w.IMAGE,"image/x-xpixmap":w.IMAGE,"image/x-xwindowdump":w.IMAGE,"application/photoshop":w.IMAGE,"image/vnd.adobe.photoshop":w.IMAGE,"application/x-photoshop":w.IMAGE,"image/webp":w.IMAGE,"audio/x-aiff":w.AUDIO,"audio/mp3":w.AUDIO,"audio/mpeg":w.AUDIO,"audio/mp4":w.AUDIO,"audio/x-m4a":w.AUDIO,"audio/ogg":w.AUDIO,"audio/wav":w.AUDIO,"audio/x-wav":w.AUDIO,"audio/x-wave":w.AUDIO,"video/avi":w.VIDEO,"video/x-msvideo":w.VIDEO,"video/mpeg":w.VIDEO,"video/mp4":w.VIDEO,"video/x-m4v":w.VIDEO,"video/ogg":w.VIDEO,"video/quicktime":w.VIDEO,"video/webm":w.VIDEO,"text/xml-graphml":w.NETWORK,"application/octet-stream":w.FILE,"application/vnd.dataverse.file-package":w.TABULAR,default:w.FILE},bM=({itemIndex:t,defaultValue:e})=>{const{control:n}=Hl(),{t:r}=$t("shared"),o={required:r("fileMetadataForm.fields.fileName.required"),validate:(i,s)=>{const a=s.files[t];return Re.isValidFileName(i)?Re.isUniqueCombinationOfFilepathAndFilename({fileName:i,filePath:a.fileDir,fileKey:a.key,allFiles:s.files})?!0:r("fileMetadataForm.fields.fileName.invalid.duplicateCombination",{fileName:i}):r("fileMetadataForm.fields.fileName.invalid.characters")},maxLength:{value:255,message:r("fileMetadataForm.fields.fileName.invalid.maxLength",{maxLength:255})}};return T.jsxs(oe.Group,{controlId:`files.${t}.fileName`,as:or,children:[T.jsx(oe.Group.Label,{required:!0,column:!0,lg:2,children:r("fileMetadataForm.fields.fileName.label")}),T.jsx(ze,{lg:10,children:T.jsx(Kl,{name:`files.${t}.fileName`,control:n,defaultValue:e,rules:o,render:({field:{onChange:i,ref:s,value:a},fieldState:{invalid:l,error:c}})=>T.jsxs(T.Fragment,{children:[T.jsx(oe.Group.Input,{type:"text",value:a,onChange:i,isInvalid:l,"aria-required":!0,ref:s}),T.jsx(oe.Group.Feedback,{type:"invalid",children:c?.message})]})})})]})},xM=({itemIndex:t,defaultValue:e})=>{const{control:n}=Hl(),{t:r}=$t("shared"),o={validate:(i,s)=>{const a=s.files[t];return Re.isValidFilePath(i)?Re.isUniqueCombinationOfFilepathAndFilename({fileName:a.fileName,filePath:i,fileKey:a.key,allFiles:s.files})?!0:r("fileMetadataForm.fields.filePath.invalid.duplicateCombination",{fileName:i}):r("fileMetadataForm.fields.filePath.invalid.characters")},maxLength:{value:255,message:r("fileMetadataForm.fields.filePath.invalid.maxLength",{maxLength:255})}};return T.jsxs(oe.Group,{controlId:`files.${t}.fileDir`,as:or,children:[T.jsx(oe.Group.Label,{message:r("fileMetadataForm.fields.filePath.description"),column:!0,lg:2,children:r("fileMetadataForm.fields.filePath.label")}),T.jsx(ze,{lg:10,children:T.jsx(Kl,{name:`files.${t}.fileDir`,control:n,rules:o,render:({field:{onChange:i,ref:s,value:a},fieldState:{invalid:l,error:c}})=>T.jsxs(T.Fragment,{children:[T.jsx(oe.Group.Input,{type:"text",defaultValue:e,value:a,onChange:i,isInvalid:l,ref:s}),T.jsx(oe.Group.Feedback,{type:"invalid",children:c?.message})]})})})]})},wM=({itemIndex:t,defaultValue:e})=>{const{control:n}=Hl(),{t:r}=$t("shared"),o={maxLength:{value:255,message:r("fileMetadataForm.fields.description.invalid.maxLength",{maxLength:255})}};return T.jsxs(oe.Group,{controlId:`files.${t}.description`,as:or,children:[T.jsx(oe.Group.Label,{column:!0,lg:2,children:r("fileMetadataForm.fields.description.label")}),T.jsx(ze,{lg:10,children:T.jsx(Kl,{name:`files.${t}.description`,control:n,defaultValue:e,rules:o,render:({field:{onChange:i,ref:s,value:a},fieldState:{invalid:l,error:c}})=>T.jsxs(T.Fragment,{children:[T.jsx(oe.Group.TextArea,{value:a,onChange:i,isInvalid:l,rows:2,ref:s}),T.jsx(oe.Group.Feedback,{type:"invalid",children:c?.message})]})})})]})},EM="_icon_fields_wrapper_rs58e_37",kM="_icon_rs58e_37",OM="_form_fields_rs58e_58",CM="_file_extra_info_rs58e_68",SM="_remove_button_rs58e_80",Jr={icon_fields_wrapper:EM,icon:kM,form_fields:OM,file_extra_info:CM,remove_button:SM},NM=({file:t,isSelected:e,handleSelectFile:n,handleRemoveFile:r,itemIndex:o,isSaving:i})=>{const{t:s}=$t("shared"),a=vM[t.fileType]||w.OTHER;return T.jsxs("tr",{children:[T.jsx("th",{colSpan:1,children:T.jsx(ay,{checked:e,onChange:()=>n(t.key)})}),T.jsx("td",{colSpan:2,children:T.jsxs("div",{className:Jr.icon_fields_wrapper,children:[T.jsx("div",{className:Jr.icon,children:T.jsx(Hc,{name:a})}),T.jsxs("div",{className:Jr.form_fields,children:[T.jsx(bM,{itemIndex:o}),T.jsx(xM,{itemIndex:o}),T.jsx(wM,{itemIndex:o}),T.jsxs("div",{className:Jr.file_extra_info,children:[T.jsx(vy,{}),T.jsx("span",{children:t.fileSizeString}),"-",T.jsx("span",{children:_n[t.fileType]}),"-",T.jsxs("span",{children:[T.jsxs("i",{children:[t.checksumAlgorithm,":"]})," ",t.checksumValue]})]})]}),T.jsx("div",{children:T.jsx(VE,{type:"button",className:Jr.remove_button,onClick:()=>{r(o,t.key)},"aria-label":s("fileUploader.uploadedFilesList.removeFile"),disabled:i})})]})})]})},TM="_table_wrapper_e3j9i_26",AM="_edit_dropdown_e3j9i_78",MM="_edit_dropdown_icon_e3j9i_83",DM="_btns_container_e3j9i_119",Xr={table_wrapper:TM,edit_dropdown:AM,edit_dropdown_icon:MM,btns_container:DM},jM=({fileRepository:t,datasetPersistentId:e,onCancel:n})=>{const{t:r}=$t("shared"),{fileUploaderState:{files:o,isSaving:i,config:{operationType:s,originalFile:a}},uploadedFiles:l,removeFile:c}=Io(),d=g.useMemo(()=>Object.values(o).some(D=>D.status===ct.UPLOADING),[o]),{submitReplaceFile:u}=mM(t),{submitUploadedFilesToDataset:p}=yM(t,e),[f,h]=g.useState([]),m=f.length===l.length,y=f.length>0&&f.length{h(L=>L.includes(D)?L.filter(V=>V!==D):[...L,D])},x=()=>{f.length===l.length?h([]):h(l.map(D=>D.key))},k=by({mode:"onChange"}),{fields:O,remove:C}=xy({control:k.control,name:"files"});tf(()=>{const D=k.getValues("files"),L=l.filter(V=>!D.some(K=>K.key===V.key));k.setValue("files",[...D,...L],{shouldValidate:!0})},[k,l]);const N=D=>{bt.REPLACE_FILE===s&&u(a.id,D.files[0]),bt.ADD_FILES_TO_DATASET===s&&p(D.files)},M=(D,L)=>{C(D),c(L)},S=()=>{const D=O.filter(L=>!f.includes(L.key));k.setValue("files",D),h([]),f.forEach(L=>{c(L)})},R=()=>n(),P=D=>{if(D.key!=="Enter")return;const V=D.target instanceof HTMLButtonElement?D.target.type==="submit":!1,K=D.target instanceof HTMLTextAreaElement;V||K||D.preventDefault()};return T.jsx(wy,{...k,children:T.jsx("form",{onSubmit:k.handleSubmit(N),onKeyDown:P,noValidate:!0,"data-testid":"uploaded-files-list-form",children:T.jsx(ul,{children:T.jsx("div",{className:Xr.table_wrapper,children:T.jsxs(LE,{children:[T.jsx("thead",{children:T.jsxs("tr",{children:[T.jsx("th",{scope:"col",colSpan:1,children:T.jsx("div",{children:T.jsx(ay,{checked:m,indeterminate:y,onChange:x,disabled:i,"aria-label":r(m?"fileUploader.uploadedFilesList.deselectAllFiles":"fileUploader.uploadedFilesList.selectAllFiles")})})}),T.jsx("th",{scope:"col",colSpan:1,children:`${l.length} ${l.length>1?r("fileUploader.uploadedFilesList.uploadedFiles"):r("fileUploader.uploadedFilesList.uploadedFile")}`}),T.jsx("th",{scope:"col",colSpan:1,children:T.jsx("div",{className:Xr.edit_dropdown,children:T.jsx(l1,{id:"edit-selected-files-menu",icon:T.jsx(Ey,{className:Xr.edit_dropdown_icon}),title:"Edit",ariaLabel:r("fileUploader.uploadedFilesList.editSelectedFiles"),variant:"secondary",disabled:f.length===0||i,children:T.jsx(c1,{onClick:S,children:r("fileUploader.uploadedFilesList.removeSelectedFiles")})})})})]})}),T.jsx("tbody",{className:Xr.table_body,children:O.map((D,L)=>T.jsx(NM,{file:D,isSelected:f.includes(D.key),handleSelectFile:b,handleRemoveFile:M,itemIndex:L,isSaving:i},D.id))}),T.jsx("tfoot",{children:T.jsx("tr",{children:T.jsx("td",{colSpan:3,children:T.jsxs("div",{className:Xr.btns_container,children:[T.jsx(se,{type:"button",onClick:R,disabled:i,variant:"secondary",children:r("cancel")}),T.jsx(se,{type:"submit",disabled:i||d,children:T.jsxs(ul,{direction:"horizontal",gap:1,children:[r("saveChanges"),i&&T.jsx(sm,{variant:"light",animation:"border",size:"sm"})]})})]})})})})]})})})})})},tD=({fileRepository:t,datasetRepository:e,datasetPersistentId:n,fetchUploadLimits:r,onCancel:o})=>{const{t:i}=$t("shared"),{fileUploaderState:{replaceOperationInfo:s,addFilesToDatasetOperationInfo:a},uploadedFiles:l}=Io();return tf(()=>{s.success&&s.newFileIdentifier&<.success(i("fileUploader.fileReplacedSuccessfully")),a.success&<.success(i("fileUploader.filesAddedToDatasetSuccessfully"))},[s,a,i]),T.jsxs(ul,{gap:4,children:[T.jsx(pM,{fileRepository:t,datasetRepository:e,datasetPersistentId:n,fetchUploadLimits:r}),l.length>0&&T.jsx(jM,{fileRepository:t,datasetPersistentId:n,onCancel:o})]})};var xt=(t=>(t.ALL="all",t.FOLDERS="folders",t.FILES="files",t))(xt||{}),kr=(t=>(t.NAME_AZ="NameAZ",t.NAME_ZA="NameZA",t))(kr||{}),Ro=(t=>(t.FOLDER="folder",t.FILE="file",t))(Ro||{});const RM=t=>t.type==="folder",IM=t=>t.type==="file";async function nD(t,e){const{datasetPersistentId:n,datasetVersion:r,paths:o,limit:i=500,signal:s}=e,a=[],l=new Set,c=[...o];for(;c.length>0;){if(s?.aborted)throw new Error("Enumeration aborted");const d=c.shift();let u;do{const p=await t.getNode({datasetPersistentId:n,datasetVersion:r,path:d,limit:i,cursor:u});for(const f of p.items)IM(f)?l.has(f.id)||(l.add(f.id),a.push(f)):RM(f)&&c.push(f.path);u=p.nextCursor??void 0}while(u)}return a}class PM{constructor(e=1,n=10,r=0,o="Item"){this.page=e,this.pageSize=n,this.totalItems=r,this.itemName=o}get offset(){return(this.page-1)*this.pageSize}get pageStartItem(){return(this.page-1)*this.pageSize+1}get pageEndItem(){return Math.min(this.pageStartItem+this.pageSize-1,this.totalItems)}withTotal(e){return new this.constructor(this.page,this.pageSize,e)}goToPage(e){return new this.constructor(e,this.pageSize,this.totalItems)}goToPreviousPage(){if(!this.previousPage)throw new Error("No previous page");return this.goToPage(this.previousPage)}goToNextPage(){if(!this.nextPage)throw new Error("No next page");return this.goToPage(this.nextPage)}withPageSize(e){const n=(r,o)=>{const i=Math.ceil(((this.page-1)*r+1)/o);return i>0?i:1};return new this.constructor(n(this.pageSize,e),e,this.totalItems)}get totalPages(){return Math.ceil(this.totalItems/this.pageSize)}get hasPreviousPage(){return this.page>1}get hasNextPage(){return this.page1e3?1e3:Math.floor(t)}function $M(t){if(!t)return 0;if(!t.startsWith(Ul))throw new Error("Invalid cursor");const e=Number.parseInt(t.slice(Ul.length),10);if(!Number.isFinite(e)||e<0)throw new Error("Invalid cursor");return e}function _M(t){return`${Ul}${t}`}function VM(t){return t?t.replace(/\/+/g,"/").replace(/^\/+/,"").replace(/\/+$/,""):""}function UM(t,e,n,r,o){const i=new Map,s=[],a=e===""?"":`${e}/`;for(const c of t){const d=(c.metadata.directory??"").replace(/^\/+|\/+$/g,"");if(e!==""&&d!==e&&!d.startsWith(a))continue;if(d===e){s.push(HM(c,e,o));continue}const p=d.slice(a.length).split("/")[0];if(!p)continue;const f=a+p;let h=i.get(f);if(h||(h={name:p,path:f,fileCount:0,bytes:0,subfolderNames:new Set},i.set(f,h)),h.fileCount+=1,h.bytes+=c.metadata.size?.toBytes()??0,d!==f){const m=d.slice(f.length+1).split("/")[0];m&&h.subfolderNames.add(m)}}const l=Array.from(i.values()).map(c=>({type:Ro.FOLDER,name:c.name,path:c.path,counts:{files:c.fileCount,folders:c.subfolderNames.size,bytes:c.bytes}}));return ef(l,n),ef(s,n),r===xt.FOLDERS?l:r===xt.FILES?s:[...l,...s]}function HM(t,e,n){return{type:Ro.FILE,id:t.id,name:t.name,path:e===""?t.name:`${e}/${t.name}`,size:t.metadata.size.toBytes(),contentType:t.metadata.type.value,access:t.access,checksum:t.metadata.checksum?{type:t.metadata.checksum.algorithm,value:t.metadata.checksum.value}:void 0,downloadUrl:`${n}/${t.id}`}}function ef(t,e){const n=e===kr.NAME_ZA?-1:1;t.sort((r,o)=>n*r.name.localeCompare(o.name,void 0,{sensitivity:"base"}))}class jt{static toFileTreePage(e,n,r){return{path:e.path,items:e.items.map(o=>jt.toFileTreeItem(o)),nextCursor:e.nextCursor,limit:e.limit,order:jt.toFileTreeOrder(e.order,n),include:jt.toFileTreeInclude(e.include,r),approximateCount:e.approximateCount}}static toFileTreeItem(e){if(De.isFileTreeFolderNode(e))return jt.toFileTreeFolder(e);if(De.isFileTreeFileNode(e))return jt.toFileTreeFile(e);throw new Error(`Unknown file tree node type: ${e.type}`)}static toFileTreeFolder(e){return{type:Ro.FOLDER,name:e.name,path:e.path,counts:e.counts}}static toFileTreeFile(e){return{type:Ro.FILE,id:e.id,name:e.name,path:e.path,size:e.size,contentType:e.contentType,access:e.access?{restricted:e.access!=="public",latestVersionRestricted:e.access!=="public",canBeRequested:e.access==="restricted",requested:!1}:void 0,accessStatus:e.access,checksum:e.checksum,downloadUrl:e.downloadUrl}}static toSDKFileTreeOrder(e){if(e!==void 0)return e===kr.NAME_ZA?De.FileTreeOrder.NAME_ZA:De.FileTreeOrder.NAME_AZ}static toSDKFileTreeInclude(e){if(e!==void 0)switch(e){case xt.FOLDERS:return De.FileTreeInclude.FOLDERS;case xt.FILES:return De.FileTreeInclude.FILES;case xt.ALL:default:return De.FileTreeInclude.ALL}}static toFileTreeOrder(e,n){return e===De.FileTreeOrder.NAME_ZA?kr.NAME_ZA:e??n??kr.NAME_AZ}static toFileTreeInclude(e,n){switch(e){case De.FileTreeInclude.FOLDERS:return xt.FOLDERS;case De.FileTreeInclude.FILES:return xt.FILES;case De.FileTreeInclude.ALL:return xt.ALL;default:return n??xt.ALL}}static isEndpointMissing(e){if(e instanceof De.ReadError)return/\[(404|405|501)\]/.test(e.message);const n=e?.response?.status;return n===404||n===405||n===501}}class rD{constructor(e){Ut(this,"fallback");Ut(this,"endpointUnavailable",!1);this.fileRepository=e}async getNode(e){if(this.endpointUnavailable&&this.fallback)return this.fallback.getNode(e);try{const n=await De.listDatasetTreeNode.execute({datasetId:e.datasetPersistentId,datasetVersionId:e.datasetVersion.number.toString(),path:e.path,limit:e.limit,cursor:e.cursor,include:jt.toSDKFileTreeInclude(e.include),order:jt.toSDKFileTreeOrder(e.order),includeDeaccessioned:e.includeDeaccessioned,originals:e.originals});return jt.toFileTreePage(n,e.order,e.include)}catch(n){if(this.fileRepository&&jt.isEndpointMissing(n))return this.endpointUnavailable=!0,this.fallback||(this.fallback=new BM(this.fileRepository)),this.fallback.getNode(e);throw n}}}export{eD as D,tD as F,QM as L,bt as O,VA as Q,_A as R,Or as a,ZM as b,JM as c,kr as d,xt as e,RM as f,nD as g,se as h,IM as i,rD as j,Io as u}; diff --git a/src/main/webapp/reusable-components/chunks/i18n-CMHgdAUi.js b/src/main/webapp/reusable-components/chunks/i18n-CMHgdAUi.js new file mode 100644 index 00000000000..83073d780dc --- /dev/null +++ b/src/main/webapp/reusable-components/chunks/i18n-CMHgdAUi.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["reusable-components/chunks/vendor-DReq5CoA.js","reusable-components/chunks/react-Dtf48RLW.js"])))=>i.map(i=>d[i]); +import{r as P}from"./react-Dtf48RLW.js";import{i as nt,s as st}from"./vendor-DReq5CoA.js";const y=i=>typeof i=="string",J=()=>{let i,e;const t=new Promise((n,s)=>{i=n,e=s});return t.resolve=i,t.reject=e,t},we=i=>i==null?"":""+i,it=(i,e,t)=>{i.forEach(n=>{e[n]&&(t[n]=e[n])})},rt=/###/g,Le=i=>i&&i.indexOf("###")>-1?i.replace(rt,"."):i,Pe=i=>!i||y(i),W=(i,e,t)=>{const n=y(e)?e.split("."):e;let s=0;for(;s{const{obj:n,k:s}=W(i,e,Object);if(n!==void 0||e.length===1){n[s]=t;return}let r=e[e.length-1],a=e.slice(0,e.length-1),o=W(i,a,Object);for(;o.obj===void 0&&a.length;)r=`${a[a.length-1]}.${r}`,a=a.slice(0,a.length-1),o=W(i,a,Object),o?.obj&&typeof o.obj[`${o.k}.${r}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${r}`]=t},at=(i,e,t,n)=>{const{obj:s,k:r}=W(i,e,Object);s[r]=s[r]||[],s[r].push(t)},se=(i,e)=>{const{obj:t,k:n}=W(i,e);if(t&&Object.prototype.hasOwnProperty.call(t,n))return t[n]},ot=(i,e,t)=>{const n=se(i,t);return n!==void 0?n:se(e,t)},Be=(i,e,t)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(n in i?y(i[n])||i[n]instanceof String||y(e[n])||e[n]instanceof String?t&&(i[n]=e[n]):Be(i[n],e[n],t):i[n]=e[n]);return i},_=i=>i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var lt={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const ut=i=>y(i)?i.replace(/[&<>"'\/]/g,e=>lt[e]):i;class ft{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}const ct=[" ",",","?","!",";"],dt=new ft(20),ht=(i,e,t)=>{e=e||"",t=t||"";const n=ct.filter(a=>e.indexOf(a)<0&&t.indexOf(a)<0);if(n.length===0)return!0;const s=dt.getRegExp(`(${n.map(a=>a==="?"?"\\?":a).join("|")})`);let r=!s.test(i);if(!r){const a=i.indexOf(t);a>0&&!s.test(i.substring(0,a))&&(r=!0)}return r},ge=(i,e,t=".")=>{if(!i)return;if(i[e])return Object.prototype.hasOwnProperty.call(i,e)?i[e]:void 0;const n=e.split(t);let s=i;for(let r=0;r-1&&li?.replace("_","-"),pt={type:"logger",log(i){this.output("log",i)},warn(i){this.output("warn",i)},error(i){this.output("error",i)},output(i,e){console?.[i]?.apply?.(console,e)}};class ie{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||pt,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,s){return s&&!this.debug?null:(y(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new ie(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new ie(this.logger,e)}}var I=new ie;class le{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const s=this.observers[n].get(t)||0;this.observers[n].set(t,s+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([s,r])=>{for(let a=0;a{for(let a=0;a-1&&this.options.ns.splice(t,1)}getResource(e,t,n,s={}){const r=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,a=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.indexOf(".")>-1?o=e.split("."):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):y(n)&&r?o.push(...n.split(r)):o.push(n)));const l=se(this.data,o);return!l&&!t&&!n&&e.indexOf(".")>-1&&(e=o[0],t=o[1],n=o.slice(2).join(".")),l||!a||!y(n)?l:ge(this.data?.[e]?.[t],n,r)}addResource(e,t,n,s,r={silent:!1}){const a=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.indexOf(".")>-1&&(o=e.split("."),s=t,t=o[1]),this.addNamespaces(t),Ce(this.data,o,s),r.silent||this.emit("added",e,t,n,s)}addResources(e,t,n,s={silent:!1}){for(const r in n)(y(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});s.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,s,r,a={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(".")>-1&&(o=e.split("."),s=n,n=t,t=o[1]),this.addNamespaces(t);let l=se(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?Be(l,n,r):l={...l,...n},Ce(this.data,o,l),a.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(s=>t[s]&&Object.keys(t[s]).length>0)}toJSON(){return this.data}}var qe={processors:{},addPostProcessor(i){this.processors[i.name]=i},handle(i,e,t,n,s){return i.forEach(r=>{e=this.processors[r]?.process(e,t,n,s)??e}),e}};const ze=Symbol("i18next/PATH_KEY");function gt(){const i=[],e=Object.create(null);let t;return e.get=(n,s)=>(t?.revoke?.(),s===ze?i:(i.push(s),t=Proxy.revocable(n,e),t.proxy)),Proxy.revocable(Object.create(null),e).proxy}function re(i,e){const{[ze]:t}=i(gt());return t.join(e?.keySeparator??".")}const $e={},fe=i=>!y(i)&&typeof i!="boolean"&&typeof i!="number";class ae extends le{constructor(e,t={}){super(),it(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=I.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(e==null)return!1;const s=this.resolve(e,n);if(s?.res===void 0)return!1;const r=fe(s.res);return!(n.returnObjects===!1&&r)}extractFromKey(e,t){let n=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const s=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let r=t.ns||this.options.defaultNS||[];const a=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!ht(e,n,s);if(a&&!o){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:y(r)?[r]:r};const u=e.split(n);(n!==s||n===s&&this.options.ns.indexOf(u[0])>-1)&&(r=u.shift()),e=u.join(s)}return{key:e,namespaces:y(r)?[r]:r}}translate(e,t,n){let s=typeof t=="object"?{...t}:t;if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof s=="object"&&(s={...s}),s||(s={}),e==null)return"";typeof e=="function"&&(e=re(e,{...this.options,...s})),Array.isArray(e)||(e=[String(e)]);const r=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,a=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:o,namespaces:l}=this.extractFromKey(e[e.length-1],s),u=l[l.length-1];let c=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;c===void 0&&(c=":");const f=s.lng||this.language,h=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f?.toLowerCase()==="cimode")return h?r?{res:`${u}${c}${o}`,usedKey:o,exactUsedKey:o,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(s)}:`${u}${c}${o}`:r?{res:o,usedKey:o,exactUsedKey:o,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(s)}:o;const p=this.resolve(e,s);let d=p?.res;const v=p?.usedKey||o,b=p?.exactUsedKey||o,O=["[object Number]","[object Function]","[object RegExp]"],w=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,g=!this.i18nFormat||this.i18nFormat.handleAsObject,x=s.count!==void 0&&!y(s.count),L=ae.hasDefaultValue(s),S=x?this.pluralResolver.getSuffix(f,s.count,s):"",m=s.ordinal&&x?this.pluralResolver.getSuffix(f,s.count,{ordinal:!1}):"",k=x&&!s.ordinal&&s.count===0,E=k&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${S}`]||s[`defaultValue${m}`]||s.defaultValue;let C=d;g&&!d&&L&&(C=E);const $=fe(C),V=Object.prototype.toString.apply(C);if(g&&C&&$&&O.indexOf(V)<0&&!(y(w)&&Array.isArray(C))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const R=this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,C,{...s,ns:l}):`key '${o} (${this.language})' returned an object instead of string.`;return r?(p.res=R,p.usedParams=this.getUsedParamsDetails(s),p):R}if(a){const R=Array.isArray(C),j=R?[]:{},Z=R?b:v;for(const N in C)if(Object.prototype.hasOwnProperty.call(C,N)){const D=`${Z}${a}${N}`;L&&!d?j[N]=this.translate(D,{...s,defaultValue:fe(E)?E[N]:void 0,joinArrays:!1,ns:l}):j[N]=this.translate(D,{...s,joinArrays:!1,ns:l}),j[N]===D&&(j[N]=C[N])}d=j}}else if(g&&y(w)&&Array.isArray(d))d=d.join(w),d&&(d=this.extendTranslation(d,e,s,n));else{let R=!1,j=!1;!this.isValidLookup(d)&&L&&(R=!0,d=E),this.isValidLookup(d)||(j=!0,d=o);const N=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&j?void 0:d,D=L&&E!==d&&this.options.updateMissing;if(j||R||D){if(this.logger.log(D?"updateKey":"missingKey",f,u,o,D?E:d),a){const F=this.resolve(o,{...s,keySeparator:!1});F&&F.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let z=[];const ee=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ee&&ee[0])for(let F=0;F{const Se=L&&X!==d?X:N;this.options.missingKeyHandler?this.options.missingKeyHandler(F,u,K,Se,D,s):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(F,u,K,Se,D,s),this.emit("missingKey",F,u,K,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&x?z.forEach(F=>{const K=this.pluralResolver.getSuffixes(F,s);k&&s[`defaultValue${this.options.pluralSeparator}zero`]&&K.indexOf(`${this.options.pluralSeparator}zero`)<0&&K.push(`${this.options.pluralSeparator}zero`),K.forEach(X=>{Oe([F],o+X,s[`defaultValue${X}`]||E)})}):Oe(z,o,E))}d=this.extendTranslation(d,e,s,p,n),j&&d===o&&this.options.appendNamespaceToMissingKey&&(d=`${u}${c}${o}`),(j||R)&&this.options.parseMissingKeyHandler&&(d=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${c}${o}`:o,R?d:void 0,s))}return r?(p.res=d,p.usedParams=this.getUsedParamsDetails(s),p):d}extendTranslation(e,t,n,s,r){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const l=y(e)&&(n?.interpolation?.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(l){const f=e.match(this.interpolator.nestingRegexp);u=f&&f.length}let c=n.replace&&!y(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(c={...this.options.interpolation.defaultVariables,...c}),e=this.interpolator.interpolate(e,c,n.lng||this.language||s.usedLng,n),l){const f=e.match(this.interpolator.nestingRegexp),h=f&&f.length;ur?.[0]===f[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${f[0]} in key: ${t[0]}`),null):this.translate(...f,t),n)),n.interpolation&&this.interpolator.reset()}const a=n.postProcess||this.options.postProcess,o=y(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=qe.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,s,r,a,o;return y(e)&&(e=[e]),e.forEach(l=>{if(this.isValidLookup(n))return;const u=this.extractFromKey(l,t),c=u.key;s=c;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const h=t.count!==void 0&&!y(t.count),p=h&&!t.ordinal&&t.count===0,d=t.context!==void 0&&(y(t.context)||typeof t.context=="number")&&t.context!=="",v=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);f.forEach(b=>{this.isValidLookup(n)||(o=b,!$e[`${v[0]}-${b}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&($e[`${v[0]}-${b}`]=!0,this.logger.warn(`key "${s}" for languages "${v.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),v.forEach(O=>{if(this.isValidLookup(n))return;a=O;const w=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(w,c,O,b,t);else{let x;h&&(x=this.pluralResolver.getSuffix(O,t.count,t));const L=`${this.options.pluralSeparator}zero`,S=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(t.ordinal&&x.indexOf(S)===0&&w.push(c+x.replace(S,this.options.pluralSeparator)),w.push(c+x),p&&w.push(c+L)),d){const m=`${c}${this.options.contextSeparator||"_"}${t.context}`;w.push(m),h&&(t.ordinal&&x.indexOf(S)===0&&w.push(m+x.replace(S,this.options.pluralSeparator)),w.push(m+x),p&&w.push(m+L))}}let g;for(;g=w.pop();)this.isValidLookup(n)||(r=g,n=this.getResource(O,b,g,t))}))})}),{res:n,usedKey:s,exactUsedKey:r,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,n,s={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,s):this.resourceStore.getResource(e,t,n,s)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!y(e.replace);let s=n?e.replace:e;if(n&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!n){s={...s};for(const r of t)delete s[r]}return s}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&e[n]!==void 0)return!0;return!1}}class Ee{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=I.create("languageUtils")}getScriptPartFromCode(e){if(e=Y(e),!e||e.indexOf("-")<0)return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=Y(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(y(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(n=>{if(t)return;const s=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(s))&&(t=s)}),!t&&this.options.supportedLngs&&e.forEach(n=>{if(t)return;const s=this.getScriptPartFromCode(n);if(this.isSupportedCode(s))return t=s;const r=this.getLanguagePartFromCode(n);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(a=>{if(a===r)return a;if(!(a.indexOf("-")<0&&r.indexOf("-")<0)&&(a.indexOf("-")>0&&r.indexOf("-")<0&&a.substring(0,a.indexOf("-"))===r||a.indexOf(r)===0&&r.length>1))return a})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),y(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),s=[],r=a=>{a&&(this.isSupportedCode(a)?s.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return y(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&r(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&r(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&r(this.getLanguagePartFromCode(e))):y(e)&&r(this.formatLanguageCode(e)),n.forEach(a=>{s.indexOf(a)<0&&r(this.formatLanguageCode(a))}),s}}const Re={zero:0,one:1,two:2,few:3,many:4,other:5},je={select:i=>i===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class mt{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=I.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=Y(e==="dev"?"en":e),s=t.ordinal?"ordinal":"cardinal",r=JSON.stringify({cleanedCode:n,type:s});if(r in this.pluralRulesCache)return this.pluralRulesCache[r];let a;try{a=new Intl.PluralRules(n,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),je;if(!e.match(/-|_/))return je;const l=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(l,t)}return this.pluralRulesCache[r]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(s=>`${t}${s}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort((s,r)=>Re[s]-Re[r]).map(s=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(e,t,n={}){const s=this.getRule(e,n);return s?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const Te=(i,e,t,n=".",s=!0)=>{let r=ot(i,e,t);return!r&&s&&y(t)&&(r=ge(i,t,n),r===void 0&&(r=ge(e,t,n))),r},ce=i=>i.replace(/\$/g,"$$$$");class yt{constructor(e={}){this.logger=I.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(t=>t),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:s,prefix:r,prefixEscaped:a,suffix:o,suffixEscaped:l,formatSeparator:u,unescapeSuffix:c,unescapePrefix:f,nestingPrefix:h,nestingPrefixEscaped:p,nestingSuffix:d,nestingSuffixEscaped:v,nestingOptionsSeparator:b,maxReplaces:O,alwaysFormat:w}=e.interpolation;this.escape=t!==void 0?t:ut,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=r?_(r):a||"{{",this.suffix=o?_(o):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=c?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=h?_(h):p||_("$t("),this.nestingSuffix=d?_(d):v||_(")"),this.nestingOptionsSeparator=b||",",this.maxReplaces=O||1e3,this.alwaysFormat=w!==void 0?w:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,n)=>t?.source===n?(t.lastIndex=0,t):new RegExp(n,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,s){let r,a,o;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=p=>{if(p.indexOf(this.formatSeparator)<0){const O=Te(t,l,p,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(O,void 0,n,{...s,...t,interpolationkey:p}):O}const d=p.split(this.formatSeparator),v=d.shift().trim(),b=d.join(this.formatSeparator).trim();return this.format(Te(t,l,v,this.options.keySeparator,this.options.ignoreJSONStructure),b,n,{...s,...t,interpolationkey:v})};this.resetRegExp();const c=s?.missingInterpolationHandler||this.options.missingInterpolationHandler,f=s?.interpolation?.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:p=>ce(p)},{regex:this.regexp,safeValue:p=>this.escapeValue?ce(this.escape(p)):ce(p)}].forEach(p=>{for(o=0;r=p.regex.exec(e);){const d=r[1].trim();if(a=u(d),a===void 0)if(typeof c=="function"){const b=c(e,r,s);a=y(b)?b:""}else if(s&&Object.prototype.hasOwnProperty.call(s,d))a="";else if(f){a=r[0];continue}else this.logger.warn(`missed to pass in variable ${d} for interpolating ${e}`),a="";else!y(a)&&!this.useRawValueToEscape&&(a=we(a));const v=p.safeValue(a);if(e=e.replace(r[0],v),f?(p.regex.lastIndex+=a.length,p.regex.lastIndex-=r[0].length):p.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let s,r,a;const o=(l,u)=>{const c=this.nestingOptionsSeparator;if(l.indexOf(c)<0)return l;const f=l.split(new RegExp(`${c}[ ]*{`));let h=`{${f[1]}`;l=f[0],h=this.interpolate(h,a);const p=h.match(/'/g),d=h.match(/"/g);((p?.length??0)%2===0&&!d||d.length%2!==0)&&(h=h.replace(/'/g,'"'));try{a=JSON.parse(h),u&&(a={...u,...a})}catch(v){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,v),`${l}${c}${h}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,l};for(;s=this.nestingRegexp.exec(e);){let l=[];a={...n},a=a.replace&&!y(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;const u=/{.*}/.test(s[1])?s[1].lastIndexOf("}")+1:s[1].indexOf(this.formatSeparator);if(u!==-1&&(l=s[1].slice(u).split(this.formatSeparator).map(c=>c.trim()).filter(Boolean),s[1]=s[1].slice(0,u)),r=t(o.call(this,s[1].trim(),a),a),r&&s[0]===e&&!y(r))return r;y(r)||(r=we(r)),r||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),r=""),l.length&&(r=l.reduce((c,f)=>this.format(c,f,n.lng,{...n,interpolationkey:s[1].trim()}),r.trim())),e=e.replace(s[0],r),this.regexp.lastIndex=0}return e}}const bt=i=>{let e=i.toLowerCase().trim();const t={};if(i.indexOf("(")>-1){const n=i.split("(");e=n[0].toLowerCase().trim();const s=n[1].substring(0,n[1].length-1);e==="currency"&&s.indexOf(":")<0?t.currency||(t.currency=s.trim()):e==="relativetime"&&s.indexOf(":")<0?t.range||(t.range=s.trim()):s.split(";").forEach(a=>{if(a){const[o,...l]=a.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),c=o.trim();t[c]||(t[c]=u),u==="false"&&(t[c]=!1),u==="true"&&(t[c]=!0),isNaN(u)||(t[c]=parseInt(u,10))}})}return{formatName:e,formatOptions:t}},ke=i=>{const e={};return(t,n,s)=>{let r=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(r={...r,[s.interpolationkey]:void 0});const a=n+JSON.stringify(r);let o=e[a];return o||(o=i(Y(n),s),e[a]=o),o(t)}},xt=i=>(e,t,n)=>i(Y(t),n)(e);class vt{constructor(e={}){this.logger=I.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?ke:xt;this.formats={number:n((s,r)=>{const a=new Intl.NumberFormat(s,{...r});return o=>a.format(o)}),currency:n((s,r)=>{const a=new Intl.NumberFormat(s,{...r,style:"currency"});return o=>a.format(o)}),datetime:n((s,r)=>{const a=new Intl.DateTimeFormat(s,{...r});return o=>a.format(o)}),relativetime:n((s,r)=>{const a=new Intl.RelativeTimeFormat(s,{...r});return o=>a.format(o,r.range||"day")}),list:n((s,r)=>{const a=new Intl.ListFormat(s,{...r});return o=>a.format(o)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=ke(t)}format(e,t,n,s={}){const r=t.split(this.formatSeparator);if(r.length>1&&r[0].indexOf("(")>1&&r[0].indexOf(")")<0&&r.find(o=>o.indexOf(")")>-1)){const o=r.findIndex(l=>l.indexOf(")")>-1);r[0]=[r[0],...r.splice(1,o)].join(this.formatSeparator)}return r.reduce((o,l)=>{const{formatName:u,formatOptions:c}=bt(l);if(this.formats[u]){let f=o;try{const h=s?.formatParams?.[s.interpolationkey]||{},p=h.locale||h.lng||s.locale||s.lng||n;f=this.formats[u](o,p,{...c,...s,...h})}catch(h){this.logger.warn(h)}return f}else this.logger.warn(`there was no format function for ${u}`);return o},e)}}const Ot=(i,e)=>{i.pending[e]!==void 0&&(delete i.pending[e],i.pendingCount--)};class St extends le{constructor(e,t,n,s={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=s,this.logger=I.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,s.backend,s)}queueLoad(e,t,n,s){const r={},a={},o={},l={};return e.forEach(u=>{let c=!0;t.forEach(f=>{const h=`${u}|${f}`;!n.reload&&this.store.hasResourceBundle(u,f)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?a[h]===void 0&&(a[h]=!0):(this.state[h]=1,c=!1,a[h]===void 0&&(a[h]=!0),r[h]===void 0&&(r[h]=!0),l[f]===void 0&&(l[f]=!0)))}),c||(o[u]=!0)}),(Object.keys(r).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(r),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(l)}}loaded(e,t,n){const s=e.split("|"),r=s[0],a=s[1];t&&this.emit("failedLoading",r,a,t),!t&&n&&this.store.addResourceBundle(r,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const o={};this.queue.forEach(l=>{at(l.loaded,[r],a),Ot(l,e),t&&l.errors.push(t),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{o[u]||(o[u]={});const c=l.loaded[u];c.length&&c.forEach(f=>{o[u][f]===void 0&&(o[u][f]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(l=>!l.done)}read(e,t,n,s=0,r=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:s,wait:r,callback:a});return}this.readingCalls++;const o=(u,c)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&c&&s{this.read.call(this,e,t,n,s+1,r*2,a)},r);return}a(u,c)},l=this.backend[n].bind(this.backend);if(l.length===2){try{const u=l(e,t);u&&typeof u.then=="function"?u.then(c=>o(null,c)).catch(o):o(null,u)}catch(u){o(u)}return}return l(e,t,o)}prepareLoading(e,t,n={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();y(e)&&(e=this.languageUtils.toResolveHierarchy(e)),y(t)&&(t=[t]);const r=this.queueLoad(e,t,n,s);if(!r.toLoad.length)return r.pending.length||s(),null;r.toLoad.forEach(a=>{this.loadOne(a)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){const n=e.split("|"),s=n[0],r=n[1];this.read(s,r,"read",void 0,void 0,(a,o)=>{a&&this.logger.warn(`${t}loading namespace ${r} for language ${s} failed`,a),!a&&o&&this.logger.log(`${t}loaded namespace ${r} for language ${s}`,o),this.loaded(e,a,o)})}saveMissing(e,t,n,s,r,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if(this.backend?.create){const l={...a,isUpdate:r},u=this.backend.create.bind(this.backend);if(u.length<6)try{let c;u.length===5?c=u(e,t,n,s,l):c=u(e,t,n,s),c&&typeof c.then=="function"?c.then(f=>o(null,f)).catch(o):o(null,c)}catch(c){o(c)}else u(e,t,n,s,o,l)}!e||!e[0]||this.store.addResource(e[0],t,n,s)}}}const Fe=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:i=>{let e={};if(typeof i[1]=="object"&&(e=i[1]),y(i[1])&&(e.defaultValue=i[1]),y(i[2])&&(e.tDescription=i[2]),typeof i[2]=="object"||typeof i[3]=="object"){const t=i[3]||i[2];Object.keys(t).forEach(n=>{e[n]=t[n]})}return e},interpolation:{escapeValue:!0,format:i=>i,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Ae=i=>(y(i.ns)&&(i.ns=[i.ns]),y(i.fallbackLng)&&(i.fallbackLng=[i.fallbackLng]),y(i.fallbackNS)&&(i.fallbackNS=[i.fallbackNS]),i.supportedLngs?.indexOf?.("cimode")<0&&(i.supportedLngs=i.supportedLngs.concat(["cimode"])),typeof i.initImmediate=="boolean"&&(i.initAsync=i.initImmediate),i),te=()=>{},wt=i=>{Object.getOwnPropertyNames(Object.getPrototypeOf(i)).forEach(t=>{typeof i[t]=="function"&&(i[t]=i[t].bind(i))})};class Q extends le{constructor(e={},t){if(super(),this.options=Ae(e),this.services={},this.logger=I,this.modules={external:[]},wt(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e=="function"&&(t=e,e={}),e.defaultNS==null&&e.ns&&(y(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=Fe();this.options={...n,...this.options,...Ae(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator);const s=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?I.init(s(this.modules.logger),this.options):I.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=vt;const c=new Ee(this.options);this.store=new Ne(this.options.resources,this.options);const f=this.services;f.logger=I,f.resourceStore=this.store,f.languageUtils=c,f.pluralResolver=new mt(c,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),u&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(f.formatter=s(u),f.formatter.init&&f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new yt(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new St(s(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(p,...d)=>{this.emit(p,...d)}),this.modules.languageDetector&&(f.languageDetector=s(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=s(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new ae(this.services,this.options),this.translator.on("*",(p,...d)=>{this.emit(p,...d)}),this.modules.external.forEach(p=>{p.init&&p.init(this)})}if(this.format=this.options.interpolation.format,t||(t=te),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...c)=>this.store[u](...c)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...c)=>(this.store[u](...c),this)});const o=J(),l=()=>{const u=(c,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(f),t(c,f)};if(this.languages&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),o}loadResources(e,t=te){let n=t;const s=y(e)?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(s?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const r=[],a=o=>{if(!o||o==="cimode")return;this.services.languageUtils.toResolveHierarchy(o).forEach(u=>{u!=="cimode"&&r.indexOf(u)<0&&r.push(u)})};s?a(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>a(l)),this.options.preload?.forEach?.(o=>a(o)),this.services.backendConnector.load(r,this.options.ns,o=>{!o&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(o)})}else n(null)}reloadResources(e,t,n){const s=J();return typeof e=="function"&&(n=e,e=void 0),typeof t=="function"&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=te),this.services.backendConnector.reload(e,t,r=>{s.resolve(),n(r)}),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&qe.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let t=0;t-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const n=J();this.emit("languageChanging",e);const s=o=>{this.language=o,this.languages=this.services.languageUtils.toResolveHierarchy(o),this.resolvedLanguage=void 0,this.setResolvedLanguage(o)},r=(o,l)=>{l?this.isLanguageChangingTo===e&&(s(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,n.resolve((...u)=>this.t(...u)),t&&t(o,(...u)=>this.t(...u))},a=o=>{!e&&!o&&this.services.languageDetector&&(o=[]);const l=y(o)?o:o&&o[0],u=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(y(o)?[o]:o);u&&(this.language||s(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector?.cacheUserLanguage?.(u)),this.loadResources(u,c=>{r(c,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,n){const s=(r,a,...o)=>{let l;typeof a!="object"?l=this.options.overloadTranslationOptionHandler([r,a].concat(o)):l={...a},l.lng=l.lng||s.lng,l.lngs=l.lngs||s.lngs,l.ns=l.ns||s.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||n||s.keyPrefix);const u=this.options.keySeparator||".";let c;return l.keyPrefix&&Array.isArray(r)?c=r.map(f=>(typeof f=="function"&&(f=re(f,{...this.options,...a})),`${l.keyPrefix}${u}${f}`)):(typeof r=="function"&&(r=re(r,{...this.options,...a})),c=l.keyPrefix?`${l.keyPrefix}${u}${r}`:r),this.t(c,l)};return y(e)?s.lng=e:s.lngs=e,s.ns=t,s.keyPrefix=n,s}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,r=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const a=(o,l)=>{const u=this.services.backendConnector.state[`${o}|${l}`];return u===-1||u===0||u===2};if(t.precheck){const o=t.precheck(this,a);if(o!==void 0)return o}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!s||a(r,e)))}loadNamespaces(e,t){const n=J();return this.options.ns?(y(e)&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{n.resolve(),t&&t(s)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=J();y(e)&&(e=[e]);const s=this.options.preload||[],r=e.filter(a=>s.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return r.length?(this.options.preload=s.concat(r),this.loadResources(a=>{n.resolve(),t&&t(a)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{const s=new Intl.Locale(e);if(s&&s.getTextInfo){const r=s.getTextInfo();if(r&&r.direction)return r.direction}}catch{}const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=this.services?.languageUtils||new Ee(Fe());return e.toLowerCase().indexOf("-latn")>1?"ltr":t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new Q(e,t)}cloneInstance(e={},t=te){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},r=new Q(s);if((e.debug!==void 0||e.prefix!==void 0)&&(r.logger=r.logger.clone(e)),["store","services","language"].forEach(o=>{r[o]=this[o]}),r.services={...this.services},r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},n){const o=Object.keys(this.store.data).reduce((l,u)=>(l[u]={...this.store.data[u]},l[u]=Object.keys(l[u]).reduce((c,f)=>(c[f]={...l[u][f]},c),l[u]),l),{});r.store=new Ne(o,s),r.services.resourceStore=r.store}return r.translator=new ae(r.services,s),r.translator.on("*",(o,...l)=>{r.emit(o,...l)}),r.init(s,t),r.translator.options=s,r.translator.backendConnector.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const T=Q.createInstance();T.createInstance=Q.createInstance;T.createInstance;T.dir;T.init;T.loadResources;T.reloadResources;T.use;T.changeLanguage;T.getFixedT;T.t;T.exists;T.setDefaultNamespace;T.hasLoadedNamespace;T.loadNamespaces;T.loadLanguages;const ne=(i,e,t,n)=>{const s=[t,{code:e,...n||{}}];if(i?.services?.logger?.forward)return i.services.logger.forward(s,"warn","react-i18next::",!0);A(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),i?.services?.logger?.warn?i.services.logger.warn(...s):console?.warn&&console.warn(...s)},Ie={},ue=(i,e,t,n)=>{A(t)&&Ie[t]||(A(t)&&(Ie[t]=new Date),ne(i,e,t,n))},Xe=(i,e)=>()=>{if(i.isInitialized)e();else{const t=()=>{setTimeout(()=>{i.off("initialized",t)},0),e()};i.on("initialized",t)}},me=(i,e,t)=>{i.loadNamespaces(e,Xe(i,t))},De=(i,e,t,n)=>{if(A(t)&&(t=[t]),i.options.preload&&i.options.preload.indexOf(e)>-1)return me(i,t,n);t.forEach(s=>{i.options.ns.indexOf(s)<0&&i.options.ns.push(s)}),i.loadLanguages(e,Xe(i,n))},Lt=(i,e,t={})=>!e.languages||!e.languages.length?(ue(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(i,{lng:t.lng,precheck:(n,s)=>{if(t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!s(n.isLanguageChangingTo,i))return!1}}),A=i=>typeof i=="string",H=i=>typeof i=="object"&&i!==null,Pt=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Ct={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Nt=i=>Ct[i],$t=i=>i.replace(Pt,Nt);let ye={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:$t};const Et=(i={})=>{ye={...ye,...i}},Je=()=>ye;let We;const Rt=i=>{We=i},ve=()=>We,de=(i,e)=>{if(!i)return!1;const t=i.props?.children??i.children;return e?t.length>0:!!t},he=i=>{if(!i)return[];const e=i.props?.children??i.children;return i.props?.i18nIsDynamicList?B(e):e},jt=i=>Array.isArray(i)&&i.every(P.isValidElement),B=i=>Array.isArray(i)?i:[i],Tt=(i,e)=>{const t={...e};return t.props=Object.assign(i.props,e.props),t},Ye=(i,e,t,n)=>{if(!i)return"";let s="";const r=B(i),a=e?.transSupportBasicHtmlNodes?e.transKeepBasicHtmlNodesFor??[]:[];return r.forEach((o,l)=>{if(A(o)){s+=`${o}`;return}if(P.isValidElement(o)){const{props:u,type:c}=o,f=Object.keys(u).length,h=a.indexOf(c)>-1,p=u.children;if(!p&&h&&!f){s+=`<${c}/>`;return}if(!p&&(!h||f)||u.i18nIsDynamicList){s+=`<${l}>`;return}if(h&&f===1&&A(p)){s+=`<${c}>${p}`;return}const d=Ye(p,e,t,n);s+=`<${l}>${d}`;return}if(o===null){ne(t,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:n});return}if(H(o)){const{format:u,...c}=o,f=Object.keys(c);if(f.length===1){const h=u?`${f[0]}, ${u}`:f[0];s+=`{{${h}}}`;return}ne(t,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:n,child:o});return}ne(t,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:n,child:o})}),s},kt=(i,e,t,n,s,r,a)=>{if(t==="")return[];const o=s.transKeepBasicHtmlNodesFor||[],l=t&&new RegExp(o.map(O=>`<${O}`).join("|")).test(t);if(!i&&!e&&!l&&!a)return[t];const u=e??{},c=O=>{B(O).forEach(g=>{A(g)||(de(g)?c(he(g)):H(g)&&!P.isValidElement(g)&&Object.assign(u,g))})};c(i);const f=nt.parse(`<0>${t}`),h={...u,...r},p=(O,w,g)=>{const x=he(O),L=v(x,w.children,g);return jt(x)&&L.length===0||O.props?.i18nIsDynamicList?x:L},d=(O,w,g,x,L)=>{O.dummy?(O.children=w,g.push(P.cloneElement(O,{key:x},L?void 0:w))):g.push(...P.Children.map([O],S=>{const m={...S.props};return delete m.i18nIsDynamicList,P.createElement(S.type,{...m,key:x,ref:S.props.ref??S.ref},L?null:w)}))},v=(O,w,g)=>{const x=B(O);return B(w).reduce((S,m,k)=>{const E=m.children?.[0]?.content&&n.services.interpolator.interpolate(m.children[0].content,h,n.language);if(m.type==="tag"){let C=x[parseInt(m.name,10)];!C&&e&&(C=e[m.name]),g.length===1&&!C&&(C=g[0][m.name]),C||(C={});const $=Object.keys(m.attrs).length!==0?Tt({props:m.attrs},C):C,V=P.isValidElement($),R=V&&de(m,!0)&&!m.voidElement,j=l&&H($)&&$.dummy&&!V,Z=H(e)&&Object.hasOwnProperty.call(e,m.name);if(A($)){const N=n.services.interpolator.interpolate($,h,n.language);S.push(N)}else if(de($)||R){const N=p($,m,g);d($,N,S,k)}else if(j){const N=v(x,m.children,g);d($,N,S,k)}else if(Number.isNaN(parseFloat(m.name)))if(Z){const N=p($,m,g);d($,N,S,k,m.voidElement)}else if(s.transSupportBasicHtmlNodes&&o.indexOf(m.name)>-1)if(m.voidElement)S.push(P.createElement(m.name,{key:`${m.name}-${k}`}));else{const N=v(x,m.children,g);S.push(P.createElement(m.name,{key:`${m.name}-${k}`},N))}else if(m.voidElement)S.push(`<${m.name} />`);else{const N=v(x,m.children,g);S.push(`<${m.name}>${N}`)}else if(H($)&&!V){const N=m.children[0]?E:null;N&&S.push(N)}else d($,E,S,k,m.children.length!==1||!E)}else if(m.type==="text"){const C=s.transWrapTextNodes,$=a?s.unescape(n.services.interpolator.interpolate(m.content,h,n.language)):n.services.interpolator.interpolate(m.content,h,n.language);C?S.push(P.createElement(C,{key:`${m.name}-${k}`},$)):S.push($)}return S},[])},b=v([{dummy:!0,children:i||[]}],f,B(i||[]));return he(b[0])},Qe=(i,e,t)=>{const n=i.key||e,s=P.cloneElement(i,{key:n});if(!s.props||!s.props.children||t.indexOf(`${e}/>`)<0&&t.indexOf(`${e} />`)<0)return s;function r(){return P.createElement(P.Fragment,null,s)}return P.createElement(r,{key:n})},Ft=(i,e)=>i.map((t,n)=>Qe(t,n,e)),At=(i,e)=>{const t={};return Object.keys(i).forEach(n=>{Object.assign(t,{[n]:Qe(i[n],n,e)})}),t},It=(i,e,t,n)=>i?Array.isArray(i)?Ft(i,e):H(i)?At(i,e):(ue(t,"TRANS_INVALID_COMPONENTS",' "components" prop expects an object or array',{i18nKey:n}),null):null,Dt=i=>!H(i)||Array.isArray(i)?!1:Object.keys(i).reduce((e,t)=>e&&Number.isNaN(Number.parseFloat(t)),!0);function Vt({children:i,count:e,parent:t,i18nKey:n,context:s,tOptions:r={},values:a,defaults:o,components:l,ns:u,i18n:c,t:f,shouldUnescape:h,...p}){const d=c||ve();if(!d)return ue(d,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using i18nextReactModule",{i18nKey:n}),i;const v=f||d.t.bind(d)||(j=>j),b={...Je(),...d.options?.react};let O=u||v.ns||d.options?.defaultNS;O=A(O)?[O]:O||["translation"];const w=Ye(i,b,d,n),g=o||r?.defaultValue||w||b.transEmptyNodeValue||(typeof n=="function"?re(n):n),{hashTransKey:x}=b,L=n||(x?x(w||g):w||g);d.options?.interpolation?.defaultVariables&&(a=a&&Object.keys(a).length>0?{...a,...d.options.interpolation.defaultVariables}:{...d.options.interpolation.defaultVariables});const S=a||e!==void 0&&!d.options?.interpolation?.alwaysFormat||!i?r.interpolation:{interpolation:{...r.interpolation,prefix:"#$?",suffix:"?$#"}},m={...r,context:s||r.context,count:e,...a,...S,defaultValue:o||r?.defaultValue,ns:O},k=L?v(L,m):g,E=It(l,k,d,n);let C=E||i,$=null;Dt(E)&&($=E,C=i);const V=kt(C,$,k,d,b,m,h),R=t??b.defaultTransParent;return R?P.createElement(R,p,V):V}const un={type:"3rdParty",init(i){Et(i.options.react),Rt(i)}},Ge=P.createContext();class Ht{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(t=>{this.usedNamespaces[t]||(this.usedNamespaces[t]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function fn({children:i,count:e,parent:t,i18nKey:n,context:s,tOptions:r={},values:a,defaults:o,components:l,ns:u,i18n:c,t:f,shouldUnescape:h,...p}){const{i18n:d,defaultNS:v}=P.useContext(Ge)||{},b=c||d||ve(),O=f||b?.t.bind(b);return Vt({children:i,count:e,parent:t,i18nKey:n,context:s,tOptions:r,values:a,defaults:o,components:l,ns:u||O?.ns||v||b?.options?.defaultNS,i18n:b,t:f,shouldUnescape:h,...p})}const Mt=(i,e)=>A(e)?e:H(e)&&A(e.defaultValue)?e.defaultValue:Array.isArray(i)?i[i.length-1]:i,Kt={t:Mt,ready:!1},Ut=()=>()=>{},cn=(i,e={})=>{const{i18n:t}=e,{i18n:n,defaultNS:s}=P.useContext(Ge)||{},r=t||n||ve();r&&!r.reportNamespaces&&(r.reportNamespaces=new Ht),r||ue(r,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const a=P.useMemo(()=>({...Je(),...r?.options?.react,...e}),[r,e]),{useSuspense:o,keyPrefix:l}=a,u=P.useMemo(()=>{const g=i||s||r?.options?.defaultNS;return A(g)?[g]:g||["translation"]},[i,s,r]);r?.reportNamespaces?.addUsedNamespaces?.(u);const c=P.useCallback(g=>{if(!r)return Ut;const{bindI18n:x,bindI18nStore:L}=a;return x&&r.on(x,g),L&&r.store.on(L,g),()=>{x&&x.split(" ").forEach(S=>r.off(S,g)),L&&L.split(" ").forEach(S=>r.store.off(S,g))}},[r,a]),f=P.useRef(),h=P.useCallback(()=>{if(!r)return Kt;const g=!!(r.isInitialized||r.initializedStoreOnce)&&u.every(m=>Lt(m,r,a)),x=r.getFixedT(e.lng||r.language,a.nsMode==="fallback"?u:u[0],l),L=f.current;if(L&&L.ready===g&&L.lng===(e.lng||r.language)&&L.keyPrefix===l)return L;const S={t:x,ready:g,lng:e.lng||r.language,keyPrefix:l};return f.current=S,S},[r,u,l,a,e.lng]),[p,d]=P.useState(0),{t:v,ready:b}=st.useSyncExternalStore(c,h,h);P.useEffect(()=>{if(r&&!b&&!o){const g=()=>d(x=>x+1);e.lng?De(r,e.lng,u,g):me(r,u,g)}},[r,e.lng,u,b,o,p]);const O=r||{},w=P.useMemo(()=>{const g=[v,O,b];return g.t=v,g.i18n=O,g.ready=b,g},[v,O,b]);if(r&&o&&!b)throw new Promise(g=>{const x=()=>g();e.lng?De(r,e.lng,u,x):me(r,u,x)});return w};function be(i){"@babel/helpers - typeof";return be=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},be(i)}function Ze(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":be(XMLHttpRequest))==="object"}function _t(i){return!!i&&typeof i.then=="function"}function Bt(i){return _t(i)?i:Promise.resolve(i)}const qt="modulepreload",zt=function(i){return"/"+i},Ve={},Xt=function(e,t,n){let s=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),o=a?.nonce||a?.getAttribute("nonce");s=Promise.allSettled(t.map(l=>{if(l=zt(l),l in Ve)return;Ve[l]=!0;const u=l.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${c}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":qt,u||(f.as="script"),f.crossOrigin="",f.href=l,o&&f.setAttribute("nonce",o),document.head.appendChild(f),u)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function r(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return s.then(a=>{for(const o of a||[])o.status==="rejected"&&r(o.reason);return e().catch(r)})};function He(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable})),t.push.apply(t,n)}return t}function Me(i){for(var e=1;eimport("./vendor-DReq5CoA.js").then(i=>i.b),__vite__mapDeps([0,1])).then(function(i){M=i.default}).catch(function(){})}catch{}var xe=function(e,t){if(t&&U(t)==="object"){var n="";for(var s in t)n+="&"+encodeURIComponent(s)+"="+encodeURIComponent(t[s]);if(!n)return e;e=e+(e.indexOf("?")!==-1?"&":"?")+n.slice(1)}return e},Ke=function(e,t,n,s){var r=function(l){if(!l.ok)return n(l.statusText||"Error",{status:l.status});l.text().then(function(u){n(null,{status:l.status,data:u})}).catch(n)};if(s){var a=s(e,t);if(a instanceof Promise){a.then(r).catch(n);return}}typeof fetch=="function"?fetch(e,t).then(r).catch(n):M(e,t).then(r).catch(n)},Ue=!1,Qt=function(e,t,n,s){e.queryStringParams&&(t=xe(t,e.queryStringParams));var r=Me({},typeof e.customHeaders=="function"?e.customHeaders():e.customHeaders);typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(r["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),n&&(r["Content-Type"]="application/json");var a=typeof e.requestOptions=="function"?e.requestOptions(n):e.requestOptions,o=Me({method:n?"POST":"GET",body:n?e.stringify(n):void 0,headers:r},Ue?{}:a),l=typeof e.alternateFetch=="function"&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{Ke(t,o,s,l)}catch(u){if(!a||Object.keys(a).length===0||!u.message||u.message.indexOf("not implemented")<0)return s(u);try{Object.keys(a).forEach(function(c){delete o[c]}),Ke(t,o,s,l),Ue=!0}catch(c){s(c)}}},Gt=function(e,t,n,s){n&&U(n)==="object"&&(n=xe("",n).slice(1)),e.queryStringParams&&(t=xe(t,e.queryStringParams));try{var r=G?new G:new oe("MSXML2.XMLHTTP.3.0");r.open(n?"POST":"GET",t,1),e.crossDomain||r.setRequestHeader("X-Requested-With","XMLHttpRequest"),r.withCredentials=!!e.withCredentials,n&&r.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),r.overrideMimeType&&r.overrideMimeType("application/json");var a=e.customHeaders;if(a=typeof a=="function"?a():a,a)for(var o in a)r.setRequestHeader(o,a[o]);r.onreadystatechange=function(){r.readyState>3&&s(r.status>=400?r.statusText:null,{status:r.status,data:r.responseText})},r.send(n)}catch(l){console&&console.log(l)}},Zt=function(e,t,n,s){if(typeof n=="function"&&(s=n,n=void 0),s=s||function(){},M&&t.indexOf("file:")!==0)return Qt(e,t,n,s);if(Ze()||typeof ActiveXObject=="function")return Gt(e,t,n,s);s(new Error("No fetch and no xhr implementation found!"))};function q(i){"@babel/helpers - typeof";return q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},q(i)}function _e(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable})),t.push.apply(t,n)}return t}function pe(i){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};en(this,i),this.services=e,this.options=t,this.allOptions=n,this.type="backend",this.init(e,t,n)}return nn(i,[{key:"init",value:function(t){var n=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=t,this.options=pe(pe(pe({},rn()),this.options||{}),s),this.allOptions=r,this.services&&this.options.reloadInterval){var a=setInterval(function(){return n.reload()},this.options.reloadInterval);q(a)==="object"&&typeof a.unref=="function"&&a.unref()}}},{key:"readMulti",value:function(t,n,s){this._readAny(t,t,n,n,s)}},{key:"read",value:function(t,n,s){this._readAny([t],t,[n],n,s)}},{key:"_readAny",value:function(t,n,s,r,a){var o=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(t,s)),l=Bt(l),l.then(function(u){if(!u)return a(null,{});var c=o.services.interpolator.interpolate(u,{lng:t.join("+"),ns:s.join("+")});o.loadUrl(c,a,n,r)})}},{key:"loadUrl",value:function(t,n,s,r){var a=this,o=typeof s=="string"?[s]:s,l=typeof r=="string"?[r]:r,u=this.options.parseLoadPayload(o,l);this.options.request(this.options,t,u,function(c,f){if(f&&(f.status>=500&&f.status<600||!f.status))return n("failed loading "+t+"; status code: "+f.status,!0);if(f&&f.status>=400&&f.status<500)return n("failed loading "+t+"; status code: "+f.status,!1);if(!f&&c&&c.message){var h=c.message.toLowerCase(),p=["failed","fetch","network","load"].find(function(b){return h.indexOf(b)>-1});if(p)return n("failed loading "+t+": "+c.message,!0)}if(c)return n(c,!1);var d,v;try{typeof f.data=="string"?d=a.options.parse(f.data,s,r):d=f.data}catch{v="failed parsing "+t+" to json"}if(v)return n(v,!1);n(null,d)})}},{key:"create",value:function(t,n,s,r,a){var o=this;if(this.options.addPath){typeof t=="string"&&(t=[t]);var l=this.options.parsePayload(n,s,r),u=0,c=[],f=[];t.forEach(function(h){var p=o.options.addPath;typeof o.options.addPath=="function"&&(p=o.options.addPath(h,n));var d=o.services.interpolator.interpolate(p,{lng:h,ns:n});o.options.request(o.options,d,l,function(v,b){u+=1,c.push(v),f.push(b),u===t.length&&typeof a=="function"&&a(c,f)})})}}},{key:"reload",value:function(){var t=this,n=this.services,s=n.backendConnector,r=n.languageUtils,a=n.logger,o=s.language;if(!(o&&o.toLowerCase()==="cimode")){var l=[],u=function(f){var h=r.toResolveHierarchy(f);h.forEach(function(p){l.indexOf(p)<0&&l.push(p)})};u(o),this.allOptions.preload&&this.allOptions.preload.forEach(function(c){return u(c)}),l.forEach(function(c){t.allOptions.ns.forEach(function(f){s.read(c,f,"read",null,null,function(h,p){h&&a.warn("loading namespace ".concat(f," for language ").concat(c," failed"),h),!h&&p&&a.log("loaded namespace ".concat(f," for language ").concat(c),p),s.loaded("".concat(c,"|").concat(f),h,p)})})})}}}])}();an.type="backend";export{an as B,fn as T,un as a,T as i,cn as u}; diff --git a/src/main/webapp/reusable-components/chunks/react-Dtf48RLW.js b/src/main/webapp/reusable-components/chunks/react-Dtf48RLW.js new file mode 100644 index 00000000000..af4de8e41ca --- /dev/null +++ b/src/main/webapp/reusable-components/chunks/react-Dtf48RLW.js @@ -0,0 +1,40 @@ +var Td=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ai(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ld(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var l=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,l.get?l:{enumerable:!0,get:function(){return e[r]}})}),n}var Bi={exports:{}},qr={},Hi={exports:{}},T={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Kn=Symbol.for("react.element"),rf=Symbol.for("react.portal"),lf=Symbol.for("react.fragment"),uf=Symbol.for("react.strict_mode"),of=Symbol.for("react.profiler"),sf=Symbol.for("react.provider"),af=Symbol.for("react.context"),ff=Symbol.for("react.forward_ref"),cf=Symbol.for("react.suspense"),df=Symbol.for("react.memo"),pf=Symbol.for("react.lazy"),Oo=Symbol.iterator;function mf(e){return e===null||typeof e!="object"?null:(e=Oo&&e[Oo]||e["@@iterator"],typeof e=="function"?e:null)}var Wi={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Qi=Object.assign,Ki={};function nn(e,t,n){this.props=e,this.context=t,this.refs=Ki,this.updater=n||Wi}nn.prototype.isReactComponent={};nn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};nn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Yi(){}Yi.prototype=nn.prototype;function Iu(e,t,n){this.props=e,this.context=t,this.refs=Ki,this.updater=n||Wi}var Fu=Iu.prototype=new Yi;Fu.constructor=Iu;Qi(Fu,nn.prototype);Fu.isPureReactComponent=!0;var Mo=Array.isArray,Xi=Object.prototype.hasOwnProperty,ju={current:null},Gi={key:!0,ref:!0,__self:!0,__source:!0};function Zi(e,t,n){var r,l={},u=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(u=""+t.key),t)Xi.call(t,r)&&!Gi.hasOwnProperty(r)&&(l[r]=t[r]);var i=arguments.length-2;if(i===1)l.children=n;else if(1>>1,X=_[H];if(0>>1;Hl(hl,z))vtl(qn,hl)?(_[H]=qn,_[vt]=z,H=vt):(_[H]=hl,_[mt]=z,H=mt);else if(vtl(qn,z))_[H]=qn,_[vt]=z,H=vt;else break e}}return N}function l(_,N){var z=_.sortIndex-N.sortIndex;return z!==0?z:_.id-N.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var o=Date,i=o.now();e.unstable_now=function(){return o.now()-i}}var s=[],f=[],v=1,m=null,p=3,g=!1,w=!1,k=!1,F=typeof setTimeout=="function"?setTimeout:null,c=typeof clearTimeout=="function"?clearTimeout:null,a=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(_){for(var N=n(f);N!==null;){if(N.callback===null)r(f);else if(N.startTime<=_)r(f),N.sortIndex=N.expirationTime,t(s,N);else break;N=n(f)}}function h(_){if(k=!1,d(_),!w)if(n(s)!==null)w=!0,ml(E);else{var N=n(f);N!==null&&vl(h,N.startTime-_)}}function E(_,N){w=!1,k&&(k=!1,c(P),P=-1),g=!0;var z=p;try{for(d(N),m=n(s);m!==null&&(!(m.expirationTime>N)||_&&!xe());){var H=m.callback;if(typeof H=="function"){m.callback=null,p=m.priorityLevel;var X=H(m.expirationTime<=N);N=e.unstable_now(),typeof X=="function"?m.callback=X:m===n(s)&&r(s),d(N)}else r(s);m=n(s)}if(m!==null)var Jn=!0;else{var mt=n(f);mt!==null&&vl(h,mt.startTime-N),Jn=!1}return Jn}finally{m=null,p=z,g=!1}}var C=!1,x=null,P=-1,B=5,L=-1;function xe(){return!(e.unstable_now()-L_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(s)},e.unstable_next=function(_){switch(p){case 1:case 2:case 3:var N=3;break;default:N=p}var z=p;p=N;try{return _()}finally{p=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,N){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var z=p;p=_;try{return N()}finally{p=z}},e.unstable_scheduleCallback=function(_,N,z){var H=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0H?(_.sortIndex=z,t(f,_),n(s)===null&&_===n(f)&&(k?(c(P),P=-1):k=!0,vl(h,z-H))):(_.sortIndex=X,t(s,_),w||g||(w=!0,ml(E))),_},e.unstable_shouldYield=xe,e.unstable_wrapCallback=function(_){var N=p;return function(){var z=p;p=N;try{return _.apply(this,arguments)}finally{p=z}}}})(es);bi.exports=es;var xf=bi.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var ts=$u,he=xf;function y(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hl=Object.prototype.hasOwnProperty,Pf=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Io={},Fo={};function Nf(e){return Hl.call(Fo,e)?!0:Hl.call(Io,e)?!1:Pf.test(e)?Fo[e]=!0:(Io[e]=!0,!1)}function zf(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Tf(e,t,n,r){if(t===null||typeof t>"u"||zf(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ie(e,t,n,r,l,u,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=u,this.removeEmptyString=o}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){b[e]=new ie(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];b[t]=new ie(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){b[e]=new ie(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){b[e]=new ie(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){b[e]=new ie(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){b[e]=new ie(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){b[e]=new ie(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){b[e]=new ie(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){b[e]=new ie(e,5,!1,e.toLowerCase(),null,!1,!1)});var Vu=/[\-:]([a-z])/g;function Au(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Vu,Au);b[t]=new ie(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Vu,Au);b[t]=new ie(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Vu,Au);b[t]=new ie(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){b[e]=new ie(e,1,!1,e.toLowerCase(),null,!1,!1)});b.xlinkHref=new ie("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){b[e]=new ie(e,1,!1,e.toLowerCase(),null,!0,!0)});function Bu(e,t,n,r){var l=b.hasOwnProperty(t)?b[t]:null;(l!==null?l.type!==0:r||!(2i||l[o]!==u[i]){var s=` +`+l[o].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}while(1<=o&&0<=i);break}}}finally{wl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?hn(e):""}function Lf(e){switch(e.tag){case 5:return hn(e.type);case 16:return hn("Lazy");case 13:return hn("Suspense");case 19:return hn("SuspenseList");case 0:case 2:case 15:return e=kl(e.type,!1),e;case 11:return e=kl(e.type.render,!1),e;case 1:return e=kl(e.type,!0),e;default:return""}}function Yl(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ot:return"Fragment";case Rt:return"Portal";case Wl:return"Profiler";case Hu:return"StrictMode";case Ql:return"Suspense";case Kl:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ls:return(e.displayName||"Context")+".Consumer";case rs:return(e._context.displayName||"Context")+".Provider";case Wu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Qu:return t=e.displayName||null,t!==null?t:Yl(e.type)||"Memo";case Ge:t=e._payload,e=e._init;try{return Yl(e(t))}catch{}}return null}function Rf(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Yl(t);case 8:return t===Hu?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function at(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function os(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Of(e){var t=os(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,u=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(o){r=""+o,u.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function tr(e){e._valueTracker||(e._valueTracker=Of(e))}function is(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=os(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function zr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Xl(e,t){var n=t.checked;return V({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Uo(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=at(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function ss(e,t){t=t.checked,t!=null&&Bu(e,"checked",t,!1)}function Gl(e,t){ss(e,t);var n=at(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Zl(e,t.type,n):t.hasOwnProperty("defaultValue")&&Zl(e,t.type,at(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function $o(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Zl(e,t,n){(t!=="number"||zr(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var yn=Array.isArray;function Ht(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=nr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ln(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var kn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Mf=["Webkit","ms","Moz","O"];Object.keys(kn).forEach(function(e){Mf.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),kn[t]=kn[e]})});function ds(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||kn.hasOwnProperty(e)&&kn[e]?(""+t).trim():t+"px"}function ps(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=ds(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Df=V({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function bl(e,t){if(t){if(Df[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(y(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(y(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(y(61))}if(t.style!=null&&typeof t.style!="object")throw Error(y(62))}}function eu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var tu=null;function Ku(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var nu=null,Wt=null,Qt=null;function Bo(e){if(e=Gn(e)){if(typeof nu!="function")throw Error(y(280));var t=e.stateNode;t&&(t=rl(t),nu(e.stateNode,e.type,t))}}function ms(e){Wt?Qt?Qt.push(e):Qt=[e]:Wt=e}function vs(){if(Wt){var e=Wt,t=Qt;if(Qt=Wt=null,Bo(e),t)for(e=0;e>>=0,e===0?32:31-(Qf(e)/Kf|0)|0}var rr=64,lr=4194304;function gn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Or(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,u=e.pingedLanes,o=n&268435455;if(o!==0){var i=o&~l;i!==0?r=gn(i):(u&=o,u!==0&&(r=gn(u)))}else o=n&~l,o!==0?r=gn(o):u!==0&&(r=gn(u));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,u=t&-t,l>=u||l===16&&(u&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Yn(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Le(t),e[t]=n}function Zf(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=En),Jo=" ",qo=!1;function Is(e,t){switch(e){case"keyup":return Cc.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fs(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Mt=!1;function Pc(e,t){switch(e){case"compositionend":return Fs(t);case"keypress":return t.which!==32?null:(qo=!0,Jo);case"textInput":return e=t.data,e===Jo&&qo?null:e;default:return null}}function Nc(e,t){if(Mt)return e==="compositionend"||!eo&&Is(e,t)?(e=Ms(),wr=Ju=be=null,Mt=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ni(n)}}function Vs(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Vs(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function As(){for(var e=window,t=zr();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=zr(e.document)}return t}function to(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Fc(e){var t=As(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Vs(n.ownerDocument.documentElement,n)){if(r!==null&&to(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,u=Math.min(r.start,l);r=r.end===void 0?u:Math.min(r.end,l),!e.extend&&u>r&&(l=r,r=u,u=l),l=ri(n,u);var o=ri(n,r);l&&o&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),u>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Dt=null,su=null,Cn=null,au=!1;function li(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;au||Dt==null||Dt!==zr(r)||(r=Dt,"selectionStart"in r&&to(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Cn&&Fn(Cn,r)||(Cn=r,r=Ir(su,"onSelect"),0jt||(e.current=vu[jt],vu[jt]=null,jt--)}function M(e,t){jt++,vu[jt]=e.current,e.current=t}var ft={},re=dt(ft),fe=dt(!1),_t=ft;function Zt(e,t){var n=e.type.contextTypes;if(!n)return ft;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},u;for(u in n)l[u]=t[u];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function ce(e){return e=e.childContextTypes,e!=null}function jr(){I(fe),I(re)}function ci(e,t,n){if(re.current!==ft)throw Error(y(168));M(re,t),M(fe,n)}function Zs(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(y(108,Rf(e)||"Unknown",l));return V({},n,r)}function Ur(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ft,_t=re.current,M(re,e),M(fe,fe.current),!0}function di(e,t,n){var r=e.stateNode;if(!r)throw Error(y(169));n?(e=Zs(e,t,_t),r.__reactInternalMemoizedMergedChildContext=e,I(fe),I(re),M(re,e)):I(fe),M(fe,n)}var $e=null,ll=!1,Dl=!1;function Js(e){$e===null?$e=[e]:$e.push(e)}function Xc(e){ll=!0,Js(e)}function pt(){if(!Dl&&$e!==null){Dl=!0;var e=0,t=O;try{var n=$e;for(O=1;e>=o,l-=o,Ve=1<<32-Le(t)+l|n<P?(B=x,x=null):B=x.sibling;var L=p(c,x,d[P],h);if(L===null){x===null&&(x=B);break}e&&x&&L.alternate===null&&t(c,x),a=u(L,a,P),C===null?E=L:C.sibling=L,C=L,x=B}if(P===d.length)return n(c,x),j&&ht(c,P),E;if(x===null){for(;PP?(B=x,x=null):B=x.sibling;var xe=p(c,x,L.value,h);if(xe===null){x===null&&(x=B);break}e&&x&&xe.alternate===null&&t(c,x),a=u(xe,a,P),C===null?E=xe:C.sibling=xe,C=xe,x=B}if(L.done)return n(c,x),j&&ht(c,P),E;if(x===null){for(;!L.done;P++,L=d.next())L=m(c,L.value,h),L!==null&&(a=u(L,a,P),C===null?E=L:C.sibling=L,C=L);return j&&ht(c,P),E}for(x=r(c,x);!L.done;P++,L=d.next())L=g(x,c,P,L.value,h),L!==null&&(e&&L.alternate!==null&&x.delete(L.key===null?P:L.key),a=u(L,a,P),C===null?E=L:C.sibling=L,C=L);return e&&x.forEach(function(un){return t(c,un)}),j&&ht(c,P),E}function F(c,a,d,h){if(typeof d=="object"&&d!==null&&d.type===Ot&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case er:e:{for(var E=d.key,C=a;C!==null;){if(C.key===E){if(E=d.type,E===Ot){if(C.tag===7){n(c,C.sibling),a=l(C,d.props.children),a.return=c,c=a;break e}}else if(C.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Ge&&wi(E)===C.type){n(c,C.sibling),a=l(C,d.props),a.ref=pn(c,C,d),a.return=c,c=a;break e}n(c,C);break}else t(c,C);C=C.sibling}d.type===Ot?(a=Et(d.props.children,c.mode,h,d.key),a.return=c,c=a):(h=Nr(d.type,d.key,d.props,null,c.mode,h),h.ref=pn(c,a,d),h.return=c,c=h)}return o(c);case Rt:e:{for(C=d.key;a!==null;){if(a.key===C)if(a.tag===4&&a.stateNode.containerInfo===d.containerInfo&&a.stateNode.implementation===d.implementation){n(c,a.sibling),a=l(a,d.children||[]),a.return=c,c=a;break e}else{n(c,a);break}else t(c,a);a=a.sibling}a=Bl(d,c.mode,h),a.return=c,c=a}return o(c);case Ge:return C=d._init,F(c,a,C(d._payload),h)}if(yn(d))return w(c,a,d,h);if(sn(d))return k(c,a,d,h);cr(c,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,a!==null&&a.tag===6?(n(c,a.sibling),a=l(a,d),a.return=c,c=a):(n(c,a),a=Al(d,c.mode,h),a.return=c,c=a),o(c)):n(c,a)}return F}var qt=ua(!0),oa=ua(!1),Zn={},je=dt(Zn),Vn=dt(Zn),An=dt(Zn);function kt(e){if(e===Zn)throw Error(y(174));return e}function fo(e,t){switch(M(An,t),M(Vn,e),M(je,Zn),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ql(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ql(t,e)}I(je),M(je,t)}function bt(){I(je),I(Vn),I(An)}function ia(e){kt(An.current);var t=kt(je.current),n=ql(t,e.type);t!==n&&(M(Vn,e),M(je,n))}function co(e){Vn.current===e&&(I(je),I(Vn))}var U=dt(0);function Wr(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Il=[];function po(){for(var e=0;en?n:4,e(!0);var r=Fl.transition;Fl.transition={};try{e(!1),t()}finally{O=n,Fl.transition=r}}function _a(){return Ce().memoizedState}function qc(e,t,n){var r=it(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ca(e))xa(t,n);else if(n=ta(e,t,n,r),n!==null){var l=ue();Re(n,e,r,l),Pa(n,t,r)}}function bc(e,t,n){var r=it(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ca(e))xa(t,l);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var o=t.lastRenderedState,i=u(o,n);if(l.hasEagerState=!0,l.eagerState=i,Oe(i,o)){var s=t.interleaved;s===null?(l.next=l,so(t)):(l.next=s.next,s.next=l),t.interleaved=l;return}}catch{}finally{}n=ta(e,t,l,r),n!==null&&(l=ue(),Re(n,e,r,l),Pa(n,t,r))}}function Ca(e){var t=e.alternate;return e===$||t!==null&&t===$}function xa(e,t){xn=Qr=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Pa(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Xu(e,n)}}var Kr={readContext:_e,useCallback:ee,useContext:ee,useEffect:ee,useImperativeHandle:ee,useInsertionEffect:ee,useLayoutEffect:ee,useMemo:ee,useReducer:ee,useRef:ee,useState:ee,useDebugValue:ee,useDeferredValue:ee,useTransition:ee,useMutableSource:ee,useSyncExternalStore:ee,useId:ee,unstable_isNewReconciler:!1},ed={readContext:_e,useCallback:function(e,t){return De().memoizedState=[e,t===void 0?null:t],e},useContext:_e,useEffect:Si,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,_r(4194308,4,ga.bind(null,t,e),n)},useLayoutEffect:function(e,t){return _r(4194308,4,e,t)},useInsertionEffect:function(e,t){return _r(4,2,e,t)},useMemo:function(e,t){var n=De();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=De();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=qc.bind(null,$,e),[r.memoizedState,e]},useRef:function(e){var t=De();return e={current:e},t.memoizedState=e},useState:ki,useDebugValue:go,useDeferredValue:function(e){return De().memoizedState=e},useTransition:function(){var e=ki(!1),t=e[0];return e=Jc.bind(null,e[1]),De().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=$,l=De();if(j){if(n===void 0)throw Error(y(407));n=n()}else{if(n=t(),Z===null)throw Error(y(349));xt&30||fa(r,t,n)}l.memoizedState=n;var u={value:n,getSnapshot:t};return l.queue=u,Si(da.bind(null,r,u,e),[e]),r.flags|=2048,Wn(9,ca.bind(null,r,u,n,t),void 0,null),n},useId:function(){var e=De(),t=Z.identifierPrefix;if(j){var n=Ae,r=Ve;n=(r&~(1<<32-Le(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Bn++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Ie]=t,e[$n]=r,Ia(e,t,!1,!1),t.stateNode=e;e:{switch(o=eu(n,r),n){case"dialog":D("cancel",e),D("close",e),l=r;break;case"iframe":case"object":case"embed":D("load",e),l=r;break;case"video":case"audio":for(l=0;ltn&&(t.flags|=128,r=!0,mn(u,!1),t.lanes=4194304)}else{if(!r)if(e=Wr(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),mn(u,!0),u.tail===null&&u.tailMode==="hidden"&&!o.alternate&&!j)return te(t),null}else 2*W()-u.renderingStartTime>tn&&n!==1073741824&&(t.flags|=128,r=!0,mn(u,!1),t.lanes=4194304);u.isBackwards?(o.sibling=t.child,t.child=o):(n=u.last,n!==null?n.sibling=o:t.child=o,u.last=o)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=W(),t.sibling=null,n=U.current,M(U,r?n&1|2:n&1),t):(te(t),null);case 22:case 23:return Co(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?pe&1073741824&&(te(t),t.subtreeFlags&6&&(t.flags|=8192)):te(t),null;case 24:return null;case 25:return null}throw Error(y(156,t.tag))}function sd(e,t){switch(ro(t),t.tag){case 1:return ce(t.type)&&jr(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return bt(),I(fe),I(re),po(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return co(t),null;case 13:if(I(U),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(y(340));Jt()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return I(U),null;case 4:return bt(),null;case 10:return io(t.type._context),null;case 22:case 23:return Co(),null;case 24:return null;default:return null}}var pr=!1,ne=!1,ad=typeof WeakSet=="function"?WeakSet:Set,S=null;function At(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){A(e,t,r)}else n.current=null}function Nu(e,t,n){try{n()}catch(r){A(e,t,r)}}var Li=!1;function fd(e,t){if(fu=Mr,e=As(),to(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,u=r.focusNode;r=r.focusOffset;try{n.nodeType,u.nodeType}catch{n=null;break e}var o=0,i=-1,s=-1,f=0,v=0,m=e,p=null;t:for(;;){for(var g;m!==n||l!==0&&m.nodeType!==3||(i=o+l),m!==u||r!==0&&m.nodeType!==3||(s=o+r),m.nodeType===3&&(o+=m.nodeValue.length),(g=m.firstChild)!==null;)p=m,m=g;for(;;){if(m===e)break t;if(p===n&&++f===l&&(i=o),p===u&&++v===r&&(s=o),(g=m.nextSibling)!==null)break;m=p,p=m.parentNode}m=g}n=i===-1||s===-1?null:{start:i,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(cu={focusedElem:e,selectionRange:n},Mr=!1,S=t;S!==null;)if(t=S,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,S=e;else for(;S!==null;){t=S;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var k=w.memoizedProps,F=w.memoizedState,c=t.stateNode,a=c.getSnapshotBeforeUpdate(t.elementType===t.type?k:Ne(t.type,k),F);c.__reactInternalSnapshotBeforeUpdate=a}break;case 3:var d=t.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(y(163))}}catch(h){A(t,t.return,h)}if(e=t.sibling,e!==null){e.return=t.return,S=e;break}S=t.return}return w=Li,Li=!1,w}function Pn(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var u=l.destroy;l.destroy=void 0,u!==void 0&&Nu(t,n,u)}l=l.next}while(l!==r)}}function il(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function zu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Ua(e){var t=e.alternate;t!==null&&(e.alternate=null,Ua(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ie],delete t[$n],delete t[mu],delete t[Kc],delete t[Yc])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function $a(e){return e.tag===5||e.tag===3||e.tag===4}function Ri(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||$a(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Tu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Fr));else if(r!==4&&(e=e.child,e!==null))for(Tu(e,t,n),e=e.sibling;e!==null;)Tu(e,t,n),e=e.sibling}function Lu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Lu(e,t,n),e=e.sibling;e!==null;)Lu(e,t,n),e=e.sibling}var J=null,ze=!1;function Xe(e,t,n){for(n=n.child;n!==null;)Va(e,t,n),n=n.sibling}function Va(e,t,n){if(Fe&&typeof Fe.onCommitFiberUnmount=="function")try{Fe.onCommitFiberUnmount(br,n)}catch{}switch(n.tag){case 5:ne||At(n,t);case 6:var r=J,l=ze;J=null,Xe(e,t,n),J=r,ze=l,J!==null&&(ze?(e=J,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):J.removeChild(n.stateNode));break;case 18:J!==null&&(ze?(e=J,n=n.stateNode,e.nodeType===8?Ml(e.parentNode,n):e.nodeType===1&&Ml(e,n),Dn(e)):Ml(J,n.stateNode));break;case 4:r=J,l=ze,J=n.stateNode.containerInfo,ze=!0,Xe(e,t,n),J=r,ze=l;break;case 0:case 11:case 14:case 15:if(!ne&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var u=l,o=u.destroy;u=u.tag,o!==void 0&&(u&2||u&4)&&Nu(n,t,o),l=l.next}while(l!==r)}Xe(e,t,n);break;case 1:if(!ne&&(At(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(i){A(n,t,i)}Xe(e,t,n);break;case 21:Xe(e,t,n);break;case 22:n.mode&1?(ne=(r=ne)||n.memoizedState!==null,Xe(e,t,n),ne=r):Xe(e,t,n);break;default:Xe(e,t,n)}}function Oi(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new ad),t.forEach(function(r){var l=wd.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function Pe(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=o),r&=~u}if(r=l,r=W()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*dd(r/1960))-r,10e?16:e,et===null)var r=!1;else{if(e=et,et=null,Gr=0,R&6)throw Error(y(331));var l=R;for(R|=4,S=e.current;S!==null;){var u=S,o=u.child;if(S.flags&16){var i=u.deletions;if(i!==null){for(var s=0;sW()-Eo?St(e,0):So|=n),de(e,t)}function Xa(e,t){t===0&&(e.mode&1?(t=lr,lr<<=1,!(lr&130023424)&&(lr=4194304)):t=1);var n=ue();e=Qe(e,t),e!==null&&(Yn(e,t,n),de(e,n))}function gd(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Xa(e,n)}function wd(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(y(314))}r!==null&&r.delete(t),Xa(e,n)}var Ga;Ga=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||fe.current)ae=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ae=!1,od(e,t,n);ae=!!(e.flags&131072)}else ae=!1,j&&t.flags&1048576&&qs(t,Vr,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Cr(e,t),e=t.pendingProps;var l=Zt(t,re.current);Yt(t,n),l=vo(null,t,r,e,l,n);var u=ho();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ce(r)?(u=!0,Ur(t)):u=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,ao(t),l.updater=ul,t.stateNode=l,l._reactInternals=t,ku(t,r,e,n),t=_u(null,t,r,!0,u,n)):(t.tag=0,j&&u&&no(t),le(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Cr(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Sd(r),e=Ne(r,e),l){case 0:t=Eu(null,t,r,e,n);break e;case 1:t=Ni(null,t,r,e,n);break e;case 11:t=xi(null,t,r,e,n);break e;case 14:t=Pi(null,t,r,Ne(r.type,e),n);break e}throw Error(y(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ne(r,l),Eu(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ne(r,l),Ni(e,t,r,l,n);case 3:e:{if(Oa(t),e===null)throw Error(y(387));r=t.pendingProps,u=t.memoizedState,l=u.element,na(e,t),Hr(t,r,null,n);var o=t.memoizedState;if(r=o.element,u.isDehydrated)if(u={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){l=en(Error(y(423)),t),t=zi(e,t,r,n,l);break e}else if(r!==l){l=en(Error(y(424)),t),t=zi(e,t,r,n,l);break e}else for(me=lt(t.stateNode.containerInfo.firstChild),ve=t,j=!0,Te=null,n=oa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Jt(),r===l){t=Ke(e,t,n);break e}le(e,t,r,n)}t=t.child}return t;case 5:return ia(t),e===null&&yu(t),r=t.type,l=t.pendingProps,u=e!==null?e.memoizedProps:null,o=l.children,du(r,l)?o=null:u!==null&&du(r,u)&&(t.flags|=32),Ra(e,t),le(e,t,o,n),t.child;case 6:return e===null&&yu(t),null;case 13:return Ma(e,t,n);case 4:return fo(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=qt(t,null,r,n):le(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ne(r,l),xi(e,t,r,l,n);case 7:return le(e,t,t.pendingProps,n),t.child;case 8:return le(e,t,t.pendingProps.children,n),t.child;case 12:return le(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,u=t.memoizedProps,o=l.value,M(Ar,r._currentValue),r._currentValue=o,u!==null)if(Oe(u.value,o)){if(u.children===l.children&&!fe.current){t=Ke(e,t,n);break e}}else for(u=t.child,u!==null&&(u.return=t);u!==null;){var i=u.dependencies;if(i!==null){o=u.child;for(var s=i.firstContext;s!==null;){if(s.context===r){if(u.tag===1){s=Be(-1,n&-n),s.tag=2;var f=u.updateQueue;if(f!==null){f=f.shared;var v=f.pending;v===null?s.next=s:(s.next=v.next,v.next=s),f.pending=s}}u.lanes|=n,s=u.alternate,s!==null&&(s.lanes|=n),gu(u.return,n,t),i.lanes|=n;break}s=s.next}}else if(u.tag===10)o=u.type===t.type?null:u.child;else if(u.tag===18){if(o=u.return,o===null)throw Error(y(341));o.lanes|=n,i=o.alternate,i!==null&&(i.lanes|=n),gu(o,n,t),o=u.sibling}else o=u.child;if(o!==null)o.return=u;else for(o=u;o!==null;){if(o===t){o=null;break}if(u=o.sibling,u!==null){u.return=o.return,o=u;break}o=o.return}u=o}le(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Yt(t,n),l=_e(l),r=r(l),t.flags|=1,le(e,t,r,n),t.child;case 14:return r=t.type,l=Ne(r,t.pendingProps),l=Ne(r.type,l),Pi(e,t,r,l,n);case 15:return Ta(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ne(r,l),Cr(e,t),t.tag=1,ce(r)?(e=!0,Ur(t)):e=!1,Yt(t,n),la(t,r,l),ku(t,r,l,n),_u(null,t,r,!0,e,n);case 19:return Da(e,t,n);case 22:return La(e,t,n)}throw Error(y(156,t.tag))};function Za(e,t){return Es(e,t)}function kd(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Se(e,t,n,r){return new kd(e,t,n,r)}function Po(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Sd(e){if(typeof e=="function")return Po(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Wu)return 11;if(e===Qu)return 14}return 2}function st(e,t){var n=e.alternate;return n===null?(n=Se(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Nr(e,t,n,r,l,u){var o=2;if(r=e,typeof e=="function")Po(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Ot:return Et(n.children,l,u,t);case Hu:o=8,l|=8;break;case Wl:return e=Se(12,n,t,l|2),e.elementType=Wl,e.lanes=u,e;case Ql:return e=Se(13,n,t,l),e.elementType=Ql,e.lanes=u,e;case Kl:return e=Se(19,n,t,l),e.elementType=Kl,e.lanes=u,e;case us:return al(n,l,u,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case rs:o=10;break e;case ls:o=9;break e;case Wu:o=11;break e;case Qu:o=14;break e;case Ge:o=16,r=null;break e}throw Error(y(130,e==null?e:typeof e,""))}return t=Se(o,n,t,l),t.elementType=e,t.type=r,t.lanes=u,t}function Et(e,t,n,r){return e=Se(7,e,r,t),e.lanes=n,e}function al(e,t,n,r){return e=Se(22,e,r,t),e.elementType=us,e.lanes=n,e.stateNode={isHidden:!1},e}function Al(e,t,n){return e=Se(6,e,null,t),e.lanes=n,e}function Bl(e,t,n){return t=Se(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ed(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=El(0),this.expirationTimes=El(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=El(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function No(e,t,n,r,l,u,o,i,s){return e=new Ed(e,t,n,i,s),t===1?(t=1,u===!0&&(t|=8)):t=0,u=Se(3,null,null,t),e.current=u,u.stateNode=e,u.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ao(u),e}function _d(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ef)}catch(e){console.error(e)}}ef(),qi.exports=ye;var tf=qi.exports;const Md=Ai(tf);var zd,Vi=tf;zd=Vi.createRoot,Vi.hydrateRoot;export{Rd as R,Md as a,Ld as b,Td as c,zd as d,Ai as g,Od as j,$u as r}; diff --git a/src/main/webapp/reusable-components/chunks/shadow-mount-BbV5d7vm.js b/src/main/webapp/reusable-components/chunks/shadow-mount-BbV5d7vm.js new file mode 100644 index 00000000000..14e10400186 --- /dev/null +++ b/src/main/webapp/reusable-components/chunks/shadow-mount-BbV5d7vm.js @@ -0,0 +1 @@ +function a({rootElementId:t}){const e=document.getElementById(t);if(!e)throw new Error(`[shadow-mount] No element with id="${t}" found in the host page.`);let o=e.shadowRoot;if(!o)o=e.attachShadow({mode:"open"});else for(;o.firstChild;)o.removeChild(o.firstChild);const s=window.__dvPendingStyles??[];for(const i of s){const n=document.createElement("style");n.textContent=i,o.appendChild(n)}const d=document.createElement("div");return d.className="dv-reusable-root",o.appendChild(d),window.__dvShadowRoot=window.__dvShadowRoot??{},window.__dvShadowRoot[t]=o,{reactRoot:d,shadowRoot:o}}export{a as m}; diff --git a/src/main/webapp/reusable-components/chunks/vendor-DReq5CoA.js b/src/main/webapp/reusable-components/chunks/vendor-DReq5CoA.js new file mode 100644 index 00000000000..ef3cfcb617f --- /dev/null +++ b/src/main/webapp/reusable-components/chunks/vendor-DReq5CoA.js @@ -0,0 +1,186 @@ +import{g as No,r as K,c as p,b as hu,R as B,d as Ah}from"./react-Dtf48RLW.js";function Oh(e,t){for(var n=0;no[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Fh={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};const kh=No(Fh);var xh=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function sl(e){var t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(kh[n[1]]||e.charAt(e.length-2)==="/")&&(t.voidElement=!0),t.name.startsWith("!--"))){var o=e.indexOf("-->");return{type:"comment",comment:o!==-1?e.slice(4,o):""}}for(var i=new RegExp(xh),r=null;(r=i.exec(e))!==null;)if(r[0].trim())if(r[1]){var a=r[1].trim(),u=[a,""];a.indexOf("=")>-1&&(u=a.split("=")),t.attrs[u[0]]=u[1],i.lastIndex--}else r[2]&&(t.attrs[r[2]]=r[3].trim().substring(1,r[3].length-1));return t}var Sh=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,Ih=/^\s*$/,Mh=Object.create(null);function pu(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?function(n){var o=[];for(var i in n)o.push(i+'="'+n[i]+'"');return o.length?" "+o.join(" "):""}(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(pu,"")+"";case"comment":return e+""}}var F2={parse:function(e,t){t||(t={}),t.components||(t.components=Mh);var n,o=[],i=[],r=-1,a=!1;if(e.indexOf("<")!==0){var u=e.indexOf("<");o.push({type:"text",content:u===-1?e:e.substring(0,u)})}return e.replace(Sh,function(d,c){if(a){if(d!=="")return;a=!1}var s,l=d.charAt(1)!=="/",O=d.startsWith("