From 572fd509522cd09e72d52395a27f4f820a57b6e1 Mon Sep 17 00:00:00 2001
From: nodemode-ai
Date: Fri, 20 Nov 2026 20:45:44 -0500
Subject: [PATCH 1/3] docs(desktop): the shell's sources carry no comments;
what they said is in the shell log
---
src-tauri/HASHOUT_LOG.md | 28 ++++++++++++++++++++++++++++
src-tauri/build.rs | 2 --
src-tauri/src/main.rs | 4 ----
src-tauri/src/native.rs | 28 ----------------------------
src-tauri/src/text_edit.rs | 5 -----
5 files changed, 28 insertions(+), 39 deletions(-)
diff --git a/src-tauri/HASHOUT_LOG.md b/src-tauri/HASHOUT_LOG.md
index 82b0a1f..305e034 100644
--- a/src-tauri/HASHOUT_LOG.md
+++ b/src-tauri/HASHOUT_LOG.md
@@ -4,6 +4,34 @@ Living log for the desktop shell. Source files stay comment-free where this log
---
+## v0.93.1 · the shell's sources carry no comments; what they said is here (2026-11-20)
+
+- refers-to: src/native.rs (module, `Native`, `FrameIn`, `FrameOut`, the five `native_canvas_*` commands); src/text_edit.rs (module); src/main.rs :: setup (the main window's builder); build.rs
+- kind: docs
+- logged: v0.93.1 · 2026-11-20
+
+Thirty-seven comment lines and two blank lines were taken out of four files; no code token changed (the diff is deletions only, each a `//`, `///` or `//!` line or the blank line after a module comment). What they said, by place:
+
+**`src/native.rs`, the module.** The opt-in native canvas of the desktop app: the shell hosts formdesign-gpu (wgpu: Metal, Vulkan, Direct3D 12) beside the web view, the way FormVis hosts formvis-render. Nothing is created until the page calls `native_canvas_start` (View > Renderer > Native), so the app is unchanged otherwise. The wgpu surface is the main window's own; the web view sits above it and is transparent (the window and web view are built transparent in `main.rs`, and the page makes its canvas rectangle transparent once the first frame has been shown). The surface covers the whole window and the frame is drawn at the canvas rectangle's offset, so the pasteboard, pages and tiles land exactly under the page's hole; whatever the surface shows elsewhere is hidden by the opaque interface above it. Not yet verified on macOS or Windows: on macOS the Metal layer must sit beneath the web view, and the transparent window needs the private API (`tauri.macos.conf.json`); on Windows the swap chain of a window that also hosts WebView2 may need a composition visual. Only the owner's machines can confirm them.
+
+**`src/native.rs`, the fields of `Native`.** `rect` is the canvas rectangle in CSS pixels (x, y, w, h) within the web view, and `dpr` the device pixel ratio. `size` is the window size the surface was last configured for. `evicted` holds the tiles the atlas evicted since the last frame reply, so the page forgets it uploaded them.
+
+**`src/native.rs`, `FrameIn`.** The frame as the page sends it: the view as [scale, tx, ty] (CSS pixels, relative to the canvas rectangle), the pages that may be visible, and the pasteboard colour as straight RGBA from 0 to 1.
+
+**`src/native.rs`, `FrameOut`.** `presented` is true when the frame was drawn and shown (false: skipped, send it again). `missing` lists the visible tiles that are not on the GPU (drawn as white paper), for the page to send. `evicted` lists the tiles the atlas dropped to stay inside its budget since the last reply.
+
+**`src/native.rs`, the commands.** `native_canvas_start` starts the native canvas in this window and answers false when no graphics adapter can draw into it. `native_canvas_resize` is called when the canvas rectangle or the pixel ratio changed; the surface follows the window's size at the next frame. `native_canvas_tile` takes one tile's pixels as the raw request body (straight RGBA8, w by h); the header `x-key` is "page|level|tx|ty" and `x-w` and `x-h` give the size, so tiles are not expanded into JSON. `native_canvas_frame` draws the frame and reports what is missing; it is async so the wait for the display's vertical blank is not on the thread that runs the web view. Inside it, the view adds the canvas rectangle's offset inside the window, so the canvas is drawn under its hole. `native_canvas_stop` drops the native canvas: the surface and every tile on the GPU.
+
+**`src/text_edit.rs`, the module.** macOS: the menu bar's Edit items are FormDesign commands with Cmd+Z, Cmd+X, Cmd+C, Cmd+V and Cmd+A, so the menu takes those keys before a focused text field can. While a field has focus the page calls `text_edit` instead of the command, and the standard edit action goes to the first responder, the web view, which edits the field exactly as the context menu does, with no clipboard prompt.
+
+**`src/main.rs`, the main window's builder.** `FORMDESIGN_RENDERER=native` starts the page on the native canvas (a test and support aid; the normal way is View > Renderer, which the page remembers). The window and its web view are transparent so the native canvas shows through the page's hole; the page paints every pixel itself unless that mode is on.
+
+**`build.rs`.** The page is served by the local engine (a remote origin to Tauri), so its calls to the app's own commands need permissions: the build generates `allow-native-canvas-*` (and the others named in the list) for each command, granted in `capabilities/default.json`.
+
+Checked here: the diff has no added line; `rustfmt --emit stdout` parses `build.rs` and `src/main.rs` with its modules. Not compiled (the system WebKit libraries are missing).
+
+---
+
## v0.91.0 · the engine is held in a job object on Windows, the wait for its address has a limit, and a failed start names the engine's last lines and its log (2026-11-20)
- refers-to: src/win_job.rs; src/engine_start.rs; src/main.rs :: kill_backend, start_limit, engine_failed, setup; Cargo.toml and Cargo.lock (`windows-sys`, Windows only)
diff --git a/src-tauri/build.rs b/src-tauri/build.rs
index 2098205..d59ea12 100644
--- a/src-tauri/build.rs
+++ b/src-tauri/build.rs
@@ -1,6 +1,4 @@
fn main() {
- // The page is served by the local engine (a remote origin to Tauri), so its calls to the app's own commands need
- // permissions: this generates allow-native-canvas-* for each, granted in capabilities/default.json.
tauri_build::try_build(tauri_build::Attributes::new().app_manifest(tauri_build::AppManifest::new().commands(&[
"native_canvas_start",
"native_canvas_frame",
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index 4b0f6f4..2a69b3b 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -259,14 +259,10 @@ fn main() {
((size.width as f64 / scale) * SCREEN_FRACTION, (size.height as f64 / scale) * SCREEN_FRACTION)
})
.unwrap_or(FALLBACK_LOGICAL);
- // FORMDESIGN_RENDERER=native starts the page on the native canvas (a test and support aid; the
- // normal way is View > Renderer, which the page remembers).
let preset = match std::env::var("FORMDESIGN_RENDERER").as_deref() {
Ok("native") => "window.__FORMDESIGN_RENDERER__ = 'native';",
_ => "",
};
- // The window and its web view are transparent so the native canvas shows through the page's hole;
- // the page paints every pixel itself unless that mode is on.
let builder = WebviewWindowBuilder::new(&handle, "main", WebviewUrl::External(url))
.transparent(true)
.visible(reveal::BUILD_VISIBLE)
diff --git a/src-tauri/src/native.rs b/src-tauri/src/native.rs
index 6aa9735..b6b03d3 100644
--- a/src-tauri/src/native.rs
+++ b/src-tauri/src/native.rs
@@ -1,15 +1,3 @@
-//! The opt-in native canvas of the desktop app: the shell hosts formdesign-gpu (wgpu: Metal, Vulkan, Direct3D 12) beside the
-//! web view, the way formvis hosts formvis-render. Nothing is created until the page calls native_canvas_start (View >
-//! Renderer > Native), so the app is unchanged otherwise.
-//!
-//! The wgpu surface is the main window's own; the web view sits above it and is transparent (the window and web view are
-//! built transparent in main.rs, and the page makes its canvas rectangle transparent once the first frame has been shown).
-//! The surface covers the whole window and the frame is drawn at the canvas rectangle's offset, so the pasteboard,
-//! pages and tiles land exactly under the page's hole; whatever the surface shows elsewhere is hidden by the opaque
-//! interface above it. Not yet verified on macOS or Windows: on macOS the Metal layer must sit beneath the web view, and
-//! the transparent window needs the private API (tauri.macos.conf.json); on Windows the swap chain of a window that also
-//! hosts WebView2 may need a composition visual. Only the owner's machines can confirm them.
-
use formdesign_gpu::composite::{Frame, PageRect};
use formdesign_gpu::display::{Display, Presented};
use formdesign_gpu::{Gpu, TileAtlas, TileKey, TILE};
@@ -20,12 +8,9 @@ pub struct Native {
gpu: Gpu,
display: Display,
atlas: TileAtlas,
- /// The canvas rectangle in CSS pixels (x, y, w, h) within the web view, and the device pixel ratio.
rect: [f64; 4],
dpr: f32,
- /// The window size the surface was last configured for.
size: (u32, u32),
- /// Tiles the atlas evicted since the last frame reply, so the page forgets it uploaded them.
evicted: Vec,
}
@@ -44,8 +29,6 @@ pub struct PageIn {
h: f32,
}
-/// The frame as the page sends it: the view as [scale, tx, ty] (CSS pixels, relative to the canvas rectangle), the pages
-/// that may be visible, and the pasteboard colour as straight RGBA from 0 to 1.
#[derive(Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct FrameIn {
@@ -70,11 +53,8 @@ impl From for KeyOut {
#[derive(Serialize)]
pub struct FrameOut {
- /// True when the frame was drawn and shown (false: skipped, send it again).
presented: bool,
- /// Visible tiles that are not on the GPU (drawn as white paper), for the page to send.
missing: Vec,
- /// Tiles the atlas dropped to stay inside its budget since the last reply.
evicted: Vec,
}
@@ -87,7 +67,6 @@ fn rect_of(rect: Vec) -> Result<[f64; 4], String> {
<[f64; 4]>::try_from(rect).map_err(|_| "a rectangle is x, y, width, height".to_string())
}
-/// Starts the native canvas in this window; false when no graphics adapter can draw into it.
#[tauri::command]
pub fn native_canvas_start(rect: Vec, dpr: f64, window: tauri::WebviewWindow, state: tauri::State) -> Result {
let rect = rect_of(rect)?;
@@ -107,7 +86,6 @@ pub fn native_canvas_start(rect: Vec, dpr: f64, window: tauri::WebviewWindo
Ok(true)
}
-/// The canvas rectangle or the pixel ratio changed; the surface follows the window's size at the next frame.
#[tauri::command]
pub fn native_canvas_resize(rect: Vec, dpr: f64, window: tauri::WebviewWindow, state: tauri::State) -> Result<(), String> {
let rect = rect_of(rect)?;
@@ -123,8 +101,6 @@ pub fn native_canvas_resize(rect: Vec, dpr: f64, window: tauri::WebviewWind
Ok(())
}
-/// One tile's pixels as the raw request body (straight RGBA8, w by h); the header x-key is "page|level|tx|ty" and x-w and
-/// x-h give the size, so tiles are not expanded into JSON.
#[tauri::command]
pub fn native_canvas_tile(request: tauri::ipc::Request, state: tauri::State) -> Result<(), String> {
let tauri::ipc::InvokeBody::Raw(bytes) = request.body() else { return Err("native_canvas_tile takes raw bytes".into()) };
@@ -150,8 +126,6 @@ pub fn native_canvas_tile(request: tauri::ipc::Request, state: tauri::State) -> Result {
let size = size_of(&window)?;
@@ -167,7 +141,6 @@ pub async fn native_canvas_frame(frame: FrameIn, window: tauri::WebviewWindow, s
height: size.1,
dpr: n.dpr,
pasteboard: frame.pasteboard,
- // The canvas rectangle's offset inside the window, so the canvas is drawn under its hole.
view: [scale, tx + n.rect[0] as f32, ty + n.rect[1] as f32],
pages: frame.pages.iter().map(|p| PageRect { index: p.index, x: p.x, y: p.y, w: p.w, h: p.h }).collect(),
};
@@ -179,7 +152,6 @@ pub async fn native_canvas_frame(frame: FrameIn, window: tauri::WebviewWindow, s
})
}
-/// Drops the native canvas: the surface and every tile on the GPU.
#[tauri::command]
pub fn native_canvas_stop(state: tauri::State) {
if let Ok(mut s) = state.0.lock() {
diff --git a/src-tauri/src/text_edit.rs b/src-tauri/src/text_edit.rs
index 1111cc3..dff60fc 100644
--- a/src-tauri/src/text_edit.rs
+++ b/src-tauri/src/text_edit.rs
@@ -1,8 +1,3 @@
-//! macOS: the menu bar's Edit items are FormDesign commands with Cmd+Z, Cmd+X, Cmd+C, Cmd+V and Cmd+A, so the menu takes
-//! those keys before a focused text field can. While a field has focus the page calls this instead of the command, and
-//! the standard edit action goes to the first responder, the web view, which edits the field exactly as the context
-//! menu does, with no clipboard prompt.
-
#[tauri::command]
pub fn text_edit(window: tauri::Window, action: String) -> Result<(), String> {
let selector = match action.as_str() {
From 9ca8e1d37e53be45743ff4356fd7994430dcb9f8 Mon Sep 17 00:00:00 2001
From: nodemode-ai
Date: Fri, 20 Nov 2026 20:47:08 -0500
Subject: [PATCH 2/3] fix(setup): the Windows freeze stops when a sidecar
cannot be copied into src-tauri\binaries
---
backend/HASHOUT_LOG.md | 12 ++++++++++++
setup/freeze_backend.bat | 4 ++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md
index 66d0766..043f5f6 100644
--- a/backend/HASHOUT_LOG.md
+++ b/backend/HASHOUT_LOG.md
@@ -7,6 +7,18 @@ Last updated: 2026-11-20 · no engine change in 0.93.0 (the version string only)
---
+## v0.93.1 · the Windows freeze stops when a sidecar cannot be copied into src-tauri\binaries (2026-11-20)
+
+- refers-to: setup/freeze_backend.bat (the two `copy /y` lines)
+- kind: fix
+- logged: v0.93.1 · 2026-11-20
+
+Found by reading the PyInstaller command line of `setup/freeze_backend.bat` token by token against `setup/freeze_backend`: with `!WINDOW!` and `!DATA!` expanded (and the fonts folder present), both give PyInstaller the same 42 arguments in the same order, every `--add-data` pair separate, no glued token, no double space or tab, every line CRLF. The difference was after it: the Unix script runs under `set -e`, so a failed `cp` of the engine or the core ends it, but the `.bat` copied both with `copy /y ... >nul` and went on. A copy onto a sidecar that a running FormDesign still holds fails on Windows; the script then ran `--selfcheck` on the old engine left in `src-tauri\binaries`, passed, and said the sidecars were ready. Both copies now end with `|| exit /b 1`, as the Unix twin stops. Read again token by token after the edit; not run (no Windows here).
+
+Other differences between the twins, left as they are: the `.bat` takes the target triple only from `rustc -vV` (the Unix script also takes `FORMDESIGN_TARGET`), looks for the core only at `native\target\release\formdesign-core.exe` (the Unix script also takes `FORMDESIGN_CORE` and `native/bin`), and says nothing when the font install fails (the Unix script says the bundle falls back to the core's fonts); in each case the Windows build does what the default Unix build does.
+
+---
+
## v0.91.0 · the Windows engine is frozen with no console window unless FORMDESIGN_ENGINE_WINDOWED=0 (2026-11-20)
- refers-to: setup/freeze_backend (`window`); setup/freeze_backend.bat (`WINDOW`)
diff --git a/setup/freeze_backend.bat b/setup/freeze_backend.bat
index b888639..9d6e8b3 100644
--- a/setup/freeze_backend.bat
+++ b/setup/freeze_backend.bat
@@ -18,7 +18,7 @@ if exist build\pyinstaller rmdir /s /q build\pyinstaller
if exist dist-engine rmdir /s /q dist-engine
pyinstaller --noconfirm --clean --onefile --name formdesign-engine !WINDOW! --distpath dist-engine --workpath build\pyinstaller --specpath build\pyinstaller !DATA! --collect-submodules app --collect-submodules uvicorn --collect-submodules keyring --collect-all pypdfium2 --collect-all pypdfium2_raw --collect-all ezdxf --hidden-import docx --hidden-import openpyxl --hidden-import striprtf "%ROOT%\backend\formdesign_engine.py" || exit /b 1
if not exist "%ROOT%\src-tauri\binaries" mkdir "%ROOT%\src-tauri\binaries"
-copy /y "dist-engine\formdesign-engine.exe" "%ROOT%\src-tauri\binaries\formdesign-engine-%TRIPLE%.exe" >nul
-copy /y "%ROOT%\native\target\release\formdesign-core.exe" "%ROOT%\src-tauri\binaries\formdesign-core-%TRIPLE%.exe" >nul
+copy /y "dist-engine\formdesign-engine.exe" "%ROOT%\src-tauri\binaries\formdesign-engine-%TRIPLE%.exe" >nul || exit /b 1
+copy /y "%ROOT%\native\target\release\formdesign-core.exe" "%ROOT%\src-tauri\binaries\formdesign-core-%TRIPLE%.exe" >nul || exit /b 1
"%ROOT%\src-tauri\binaries\formdesign-engine-%TRIPLE%.exe" --selfcheck || exit /b 1
echo [formdesign] sidecars ready in src-tauri\binaries
From b282e4f94d2b5dcbb389fbbcb3e113eed569cf59 Mon Sep 17 00:00:00 2001
From: nodemode-ai
Date: Fri, 20 Nov 2026 21:30:21 -0500
Subject: [PATCH 3/3] chore(release): v0.93.1
Version 0.93.1 in the fourteen places it is kept, the changelog entry, and
the browser demos rebuilt with this version.
Sites: README badge, backend/app/__init__.py, frontend/package.json and
package-lock.json (two fields), frontend/src/version.ts, native/Cargo.toml
and native/Cargo.lock (seven packages), src-tauri/Cargo.toml, Cargo.lock
(two packages) and tauri.conf.json, and the backend, frontend and native
HASHOUT headers.
Demos: npm run demo, npx tsc --noEmit -p ../demo 0, npx tsc --noEmit 0;
demo/, demos/event/ and demos/report/ opened from file:// in headless
Chromium: drawn, 0 console errors, 0.93.1 in the page.
Ran: tests/test_f9_release_profiles.py and tests/test_seal.py 14 passed,
agents sync --check in step, mcpb check valid, line_counts --check 0.
The gate on b6c34b6: suite 317 passed with the core and fonts, window
check 3 passed, two makes, type checks, audit 0, lint and scripts clean.
cargo test --locked -p formdesign-engine on 0.93.0's native sources
(dev profile): 21 passed, 0 failed.
---
CHANGELOG.md | 6 ++++++
README.md | 2 +-
backend/HASHOUT_LOG.md | 4 ++--
backend/app/__init__.py | 2 +-
demo/assets/demo.js | 2 +-
frontend/HASHOUT_LOG.md | 4 ++--
frontend/package-lock.json | 4 ++--
frontend/package.json | 2 +-
frontend/src/version.ts | 2 +-
native/Cargo.lock | 14 +++++++-------
native/Cargo.toml | 2 +-
native/HASHOUT_LOG.md | 4 ++--
src-tauri/Cargo.lock | 4 ++--
src-tauri/Cargo.toml | 2 +-
src-tauri/tauri.conf.json | 2 +-
15 files changed, 31 insertions(+), 25 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 126c128..093eb6d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,12 @@
Every release of FormDesign, newest first. Versions follow semver; tags read `v*.*.*`.
+## 0.93.1 · 2026-11-20
+
+- Building the desktop app on Windows now stops with an error when the engine or the layout core cannot be copied into place (for example while FormDesign is still open), instead of finishing with the copies left from an earlier build.
+- The desktop app's own source files carry no comments; what they explained is kept in the desktop shell's log. Nothing in the app changes.
+- The three browser demos are rebuilt with this version.
+
## 0.93.0 · 2026-11-20
- FormDesign's colour and layout settings carry every name used across the Form family's apps, so panels shared with the other apps find all of them. Nothing on screen changes.
diff --git a/README.md b/README.md
index bdcced5..4e3cfd9 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,7 @@
-
+
diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md
index 043f5f6..b8bf022 100644
--- a/backend/HASHOUT_LOG.md
+++ b/backend/HASHOUT_LOG.md
@@ -2,8 +2,8 @@
Living log for the engine service. Source files stay comment-free; what they would have said lives here, indexed. Read it before editing `backend/`.
-Current build version: v0.93.0
-Last updated: 2026-11-20 · no engine change in 0.93.0 (the version string only) · a stored path for Codex, Cursor and Antigravity under the agents seal · the Windows engine is frozen with no console window · a leftover engine that has ended but was not collected counts as gone on macOS; 2026-11-19 · the desktop engine keeps a log, holds a lock on its data folder, leaves when its app has gone and serves nothing when started alone · the family's finder 1.0.1 for the four agent programs · an Antigravity tab and agents install antigravity · the tests find only stand-in agent programs · the engine starts with no output streams · only the app window can change what agents may do, open a terminal or answer an approval; the stored agent choices are sealed; the command line is an agent like any other; agents/manifest.json says what the app offers agents; the use_tool description says 41 layout tools; the engine side of the shared dock's contract; 2026-11-13 · no engine change in 0.87.0 (version string only; the demo covers and browser demo pages are in the frontend log); a recent document's first-page thumbnail; three demos built on demand by Make; counts --check fails if a sparkle icon returns; the desktop extension, attach mode and the plugin manifest; 2026-11-11 · engine commands run in the active document; Save to a folder that cannot be made answers 422; a tools/call name that is not a string gets a JSON-RPC error; PNG and JPEG export count pages from 1; the in-app token reaches Claude Code in a private file; 2026-11-10 · Claude chat keeps only the screenshots its messages still show; Claude chat history is found under a non-ASCII agent folder; a prompt that starts with "-" reaches Claude Code as a prompt; text with a non-ASCII style name is placed; bad input to open, pack edits, make, tabs and media answers 4xx; LibreOffice gets a well-formed profile URL; links found in contact and footer text keep their query strings; fixed-layout EPUB marks every animated page as scripted; images from different sources with the same name stay distinct; book operations run one at a time; malformed agent, plug-in, package and book input gets an error message; Edit Original opens only image, vector and PDF files; counts --check reads only the MCP tool count; Windows Node check and install --lite; clean.bat --all removes each folder on its own; build_frontend.bat restores its caller's folder; agents install codex writes valid TOML on Windows; the MCP stdio bridge runs under Python 3.9; every window socket request gets an answer; a Claude Code launch is quoted for the login shell that runs it; a failed thumbnail leaves no document open; a video's poster file is used only when it is a real image; only the window installs, enables and removes plug-ins; PDF, DXF and PDF comment imports run off the event loop; one-column CSV files are read; a bad or empty zip becomes an intake warning; a wrong-shaped template spec answers problems; phone photos are measured and placed upright; a long paste reaches the terminal whole; intake and PDF reading by agents no longer freeze the engine; review comments posted at the same time all stay; a failing tool or a malformed MCP request gets a JSON-RPC answer; names without Latin letters get their own file; downloads with non-Latin names arrive; an engine on a fallback port tells everyone its real port; non-Latin names save on Windows; save_document asks before overwriting the file it will really write; an uploaded file name cannot leave the pack folder; a website export never deletes files it did not write; published sites and placed assets run sandboxed; a plug-in's fetch checks every redirect hop; document text stays inside a published page's JSON-LD block; run_commands asks for approval wherever run_command does; a template is saved only inside the template library; only the in-app token makes a client the in-app Claude Code; 2026-10-31 · .js, .mjs and .css keep their types on Windows; formdesign-core links the C runtime statically on Windows; 2026-10-30 · the Windows desktop build stops on a failed bundle step; 2026-10-26 · fixes the test suite found (FB-045 to FB-049); 2026-10-25 · LocalGuard; 2026-10-23 · full fonts for the Reserved Font Name families; the ICC profile in the frozen engine
+Current build version: v0.93.1
+Last updated: 2026-11-20 · no engine change in 0.93.1 (the version string only); the Windows freeze stops when a sidecar cannot be copied · no engine change in 0.93.0 (the version string only) · a stored path for Codex, Cursor and Antigravity under the agents seal · the Windows engine is frozen with no console window · a leftover engine that has ended but was not collected counts as gone on macOS; 2026-11-19 · the desktop engine keeps a log, holds a lock on its data folder, leaves when its app has gone and serves nothing when started alone · the family's finder 1.0.1 for the four agent programs · an Antigravity tab and agents install antigravity · the tests find only stand-in agent programs · the engine starts with no output streams · only the app window can change what agents may do, open a terminal or answer an approval; the stored agent choices are sealed; the command line is an agent like any other; agents/manifest.json says what the app offers agents; the use_tool description says 41 layout tools; the engine side of the shared dock's contract; 2026-11-13 · no engine change in 0.87.0 (version string only; the demo covers and browser demo pages are in the frontend log); a recent document's first-page thumbnail; three demos built on demand by Make; counts --check fails if a sparkle icon returns; the desktop extension, attach mode and the plugin manifest; 2026-11-11 · engine commands run in the active document; Save to a folder that cannot be made answers 422; a tools/call name that is not a string gets a JSON-RPC error; PNG and JPEG export count pages from 1; the in-app token reaches Claude Code in a private file; 2026-11-10 · Claude chat keeps only the screenshots its messages still show; Claude chat history is found under a non-ASCII agent folder; a prompt that starts with "-" reaches Claude Code as a prompt; text with a non-ASCII style name is placed; bad input to open, pack edits, make, tabs and media answers 4xx; LibreOffice gets a well-formed profile URL; links found in contact and footer text keep their query strings; fixed-layout EPUB marks every animated page as scripted; images from different sources with the same name stay distinct; book operations run one at a time; malformed agent, plug-in, package and book input gets an error message; Edit Original opens only image, vector and PDF files; counts --check reads only the MCP tool count; Windows Node check and install --lite; clean.bat --all removes each folder on its own; build_frontend.bat restores its caller's folder; agents install codex writes valid TOML on Windows; the MCP stdio bridge runs under Python 3.9; every window socket request gets an answer; a Claude Code launch is quoted for the login shell that runs it; a failed thumbnail leaves no document open; a video's poster file is used only when it is a real image; only the window installs, enables and removes plug-ins; PDF, DXF and PDF comment imports run off the event loop; one-column CSV files are read; a bad or empty zip becomes an intake warning; a wrong-shaped template spec answers problems; phone photos are measured and placed upright; a long paste reaches the terminal whole; intake and PDF reading by agents no longer freeze the engine; review comments posted at the same time all stay; a failing tool or a malformed MCP request gets a JSON-RPC answer; names without Latin letters get their own file; downloads with non-Latin names arrive; an engine on a fallback port tells everyone its real port; non-Latin names save on Windows; save_document asks before overwriting the file it will really write; an uploaded file name cannot leave the pack folder; a website export never deletes files it did not write; published sites and placed assets run sandboxed; a plug-in's fetch checks every redirect hop; document text stays inside a published page's JSON-LD block; run_commands asks for approval wherever run_command does; a template is saved only inside the template library; only the in-app token makes a client the in-app Claude Code; 2026-10-31 · .js, .mjs and .css keep their types on Windows; formdesign-core links the C runtime statically on Windows; 2026-10-30 · the Windows desktop build stops on a failed bundle step; 2026-10-26 · fixes the test suite found (FB-045 to FB-049); 2026-10-25 · LocalGuard; 2026-10-23 · full fonts for the Reserved Font Name families; the ICC profile in the frozen engine
---
diff --git a/backend/app/__init__.py b/backend/app/__init__.py
index 173e44b..c9200b5 100644
--- a/backend/app/__init__.py
+++ b/backend/app/__init__.py
@@ -1 +1 @@
-__version__ = "0.93.0"
+__version__ = "0.93.1"
diff --git a/demo/assets/demo.js b/demo/assets/demo.js
index 8d6fd03..6a0001a 100644
--- a/demo/assets/demo.js
+++ b/demo/assets/demo.js
@@ -627,7 +627,7 @@ struct Out {
Recent
Documents you opened or saved, newest first.
Documents you open appear here.
Templates
Original templates for print, screen and the web. Each opens as a new document with sample text and pictures.
${s(!0)}
- `,this.root.addEventListener(`click`,e=>{let t=e.target;if(t.closest(`[data-back]`)){this.forced=!1,this.sync(this.docs);return}let n=t.closest(`[data-v]`)?.dataset.v;if(n){this.show(n);return}let r=t.closest(`[data-run]`)?.dataset.run;if(r){this.d.run(r);return}let i=t.closest(`[data-category]`)?.dataset.category;if(i){this.d.run(`ui.templates`,{category:i});return}let a=t.closest(`[data-path]`)?.dataset.path;a&&this.d.openRecent(a)}),e.appendChild(this.root),this.sidePanel(),document.addEventListener(`keydown`,e=>{e.key===`Escape`&&this.forced&&this.docs>0&&!this.root.hidden&&(this.forced=!1,this.sync(this.docs))}),this.paint(),k$t(()=>{this.paint(),this.tplAsked=!1,this.isShown&&this.templates()})}get isShown(){return!this.root.hidden}show(e){e&&e!==this.page&&(this.page=e,this.paint()),this.forced=!0,this.sync(this.docs)}sync(e){e>this.docs&&(this.forced=!1),this.docs=e;let t=this.forced||e===0;t&&this.root.hidden&&this.paint(),t&&(this.fill(),this.templates()),m(this.root,!t);for(let t of Array.from(this.root.querySelectorAll(`[data-back]`)))m(t,e===0)}paint(){for(let e of Array.from(this.root.querySelectorAll(`.cv-home-page`)))m(e,e.dataset.page!==this.page);for(let e of Array.from(this.root.querySelectorAll(`.cv-home-nav-item[data-v]`)))c(e,`is-active`,e.dataset.v===this.page);let e=new Date().getHours();s(this.root.querySelector(`[data-page="start"] .cv-home-title`),F(e<12?`Good morning`:e<18?`Good afternoon`:`Good evening`))}fill(){let e=this.d.recent(),t=JSON.stringify(e);if(t!==this.listKey){this.listKey=t;for(let t of Array.from(this.root.querySelectorAll(`[data-count="recent"]`)))s(t,String(e.length));for(let[t,n]of[[`start`,e.slice(0,8)],[`recent`,e]])m(this.root.querySelector(`[data-empty="${t}"]`),n.length>0),a(this.root.querySelector(`[data-files="${t}"]`),n,{key:e=>e.path,create:e=>this.card(e),update:(e,t)=>{s(e.querySelector(`.cv-home-file-when`),p8t(t.modified)),this.thumb(e,t)}})}}card(e){let t=f(``);return t.dataset.path=e.path,s(t.querySelector(`.cv-home-file-name`),e.name),s(t.querySelector(`.cv-home-file-when`),p8t(e.modified)),this.thumb(t,e),t}thumb(e,t){if(!/\.fdes$/i.test(t.path))return;let n=e.querySelector(`img`),r=`/api/home/thumb?path=${encodeURIComponent(t.path)}&v=${t.modified??0}`;n.dataset.src!==r&&(n.dataset.src=r,o(n,r).then(()=>{m(n,!1),c(e,`has-thumb`,!0)},()=>void 0))}templates(){if(!this.tplAsked){this.tplAsked=!0;for(let e of Array.from(this.root.querySelectorAll(`.cv-home-demo-pic img[data-src]`)))e.getAttribute(`src`)||o(e,e.dataset.src??``).catch(()=>void 0);w(`/templates`).then(e=>{for(let t of Array.from(this.root.querySelectorAll(`[data-count="templates"]`)))s(t,String(e.total));for(let t of Array.from(this.root.querySelectorAll(`[data-cat]`)))s(t,e.categories[t.dataset.cat??``]?F(`{n} templates`).replace(`{n}`,String(e.categories[t.dataset.cat??``])):``)},()=>{this.tplAsked=!1})}}sidePanel(){let e=this.root,t=e.querySelector(`.cv-home-resizer`),n=()=>{try{localStorage.setItem(u8t,e.style.getPropertyValue(`--fd-home-nav-w`)),localStorage.setItem(d8t,e.classList.contains(`is-nav-hidden`)?`1`:`0`)}catch{return}},r=t=>{c(e,`is-nav-hidden`,t),n()};try{let t=localStorage.getItem(u8t);t&&/^\d+px$/.test(t.trim())&&e.style.setProperty(`--fd-home-nav-w`,t.trim()),localStorage.getItem(d8t)===`1`&&e.classList.add(`is-nav-hidden`)}catch{}e.querySelector(`.cv-home-nav-hide`)?.addEventListener(`click`,()=>r(!0)),e.querySelector(`.cv-home-nav-show`)?.addEventListener(`click`,()=>r(!1)),t.addEventListener(`pointerdown`,r=>{r.preventDefault();let i=r.clientX,a=e.querySelector(`.cv-home-nav`)?.getBoundingClientRect().width||232;c(t,`is-dragging`,!0);let o=t=>{let n=a+t.clientX-i,r=n<120;c(e,`is-nav-hidden`,r),r||_(e,`--fd-home-nav-w`,`${Math.round(Math.max(180,Math.min(420,n)))}px`)},s=()=>{c(t,`is-dragging`,!1),window.removeEventListener(`pointermove`,o),window.removeEventListener(`pointerup`,s),n()};window.addEventListener(`pointermove`,o),window.addEventListener(`pointerup`,s)})}};function p8t(e){return e?new Date(e).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):``}var R6=[`left`,`side`,`dock`],m8t=252,h8t={pages:`layers`,make:`makeLayout`,props:`panelProps`,swatches:`swatchGrid`,preflight:`warning`,typeextra:`charA`,review:`check`,interactive:`play`,xml:`menu`,library:`folder`,connect:`agent`},g8t=`formdesign.dock`,z6=220,B6=560,_8t=/^g[0-9a-z]{1,16}$/,v8t=e=>Array.from(e.children).map(e=>e.dataset.group??``).filter(Boolean),y8t=e=>Object.fromEntries(Object.entries(e&&typeof e==`object`?e:{}).filter(([,e])=>typeof e==`number`&&Number.isFinite(e))),V6=e=>Array.isArray(e)?e.filter(e=>typeof e==`string`):[],b8t=class{root;cols;resizer;makeGroup;minirail;defaults;state;marker=f(``);splits=new Map;wired=new WeakSet;drag=null;ghost=null;suppressClick=!1;onChange=null;constructor(e,t,n,r,i){this.root=e,this.cols=t,this.resizer=n,this.makeGroup=r,this.minirail=i,this.defaults={left:v8t(t.left),side:v8t(t.side),dock:v8t(t.dock),hidden:[],heights:{},custom:[],width:null,collapsed:[]};let a={};try{a=JSON.parse(localStorage.getItem(g8t)??`{}`)}catch{a={}}for(let e of Array.isArray(a.custom)?a.custom:[])e&&_8t.test(String(e.id))&&typeof e.label==`string`&&!R.all.has(e.id)&&r(t.dock,e.id,e.label);this.state=this.merge(a),this.wireResizer(),this.wireLeftResizer(),window.addEventListener(`pointerup`,()=>{this.drag&&this.drop()}),this.apply()}known(){return[...R.all.keys()]}merge(e){let t=this.known(),n=e=>t.includes(e),r=!Array.isArray(e.left),i=r?[]:V6(e.left).filter(n),a=V6(e.side).filter(e=>n(e)&&!i.includes(e)),o=V6(e.dock).filter(e=>n(e)&&!i.includes(e)&&!a.includes(e)),s=e=>i.includes(e)||a.includes(e)||o.includes(e);if(r)for(let e of this.defaults.left)a.includes(e)&&a.splice(a.indexOf(e),1),o.includes(e)&&o.splice(o.indexOf(e),1),i.push(e);for(let e of this.defaults.left)s(e)||i.splice(Math.min(this.defaults.left.indexOf(e),i.length),0,e);for(let e of this.defaults.side)s(e)||a.splice(Math.min(this.defaults.side.indexOf(e),a.length),0,e);for(let e of t)if(!s(e)){let t=this.defaults.dock.indexOf(e);o.splice(t<0?o.length:Math.min(t,o.length),0,e)}let c=(Array.isArray(e.custom)?e.custom:[]).filter(e=>e&&n(e.id)&&_8t.test(e.id)).map(e=>({id:e.id,label:String(e.label).slice(0,80)})),l=typeof e.width==`number`&&e.width>=z6&&e.width<=B6?Math.round(e.width):null,u=V6(e.collapsed).filter(e=>R6.includes(e)),d=typeof e.leftWidth==`number`&&e.leftWidth>=z6&&e.leftWidth<=B6?Math.round(e.leftWidth):null;return{left:i,side:a,dock:o,hidden:V6(e.hidden).filter(n),heights:y8t(e.heights),custom:c,width:l,collapsed:u,leftWidth:d}}get snapshot(){return JSON.parse(JSON.stringify(this.state))}setState(e){for(let t of e.custom??[])_8t.test(t.id)&&!R.all.has(t.id)&&this.makeGroup(this.cols.dock,t.id,t.label);this.state=this.merge(e),this.save()}isHidden(e){return this.state.hidden.includes(e)}show(e){this.isHidden(e)&&(this.state.hidden=this.state.hidden.filter(t=>t!==e),this.save())}hide(e){this.isHidden(e)||(this.state.hidden=[...this.state.hidden,e],this.save())}refresh(){this.dropEmpty(),this.apply(),this.onChange?.()}addCustom(e,t,n,r){this.state.custom=[...this.state.custom,{id:e,label:t}],this.insert(e,n,r)}dropEmpty(){let e=this.state.custom.filter(e=>{let t=R.all.get(e.id);return t&&t.size>0?!0:(t?.remove(),!1)});if(e.length===this.state.custom.length)return;let t=new Set(this.state.custom.filter(t=>!e.includes(t)).map(e=>e.id));this.state={...this.state,custom:e,left:this.state.left.filter(e=>!t.has(e)),side:this.state.side.filter(e=>!t.has(e)),dock:this.state.dock.filter(e=>!t.has(e))},this.persist()}section(e){return R.all.get(e)?.root??null}present(e){let t=this.section(e);return!!t&&!this.isHidden(e)&&!t.classList.contains(`is-empty`)}shown(e){return this.state[e].filter(e=>this.present(e)).map(e=>this.section(e))}persist(){try{localStorage.setItem(g8t,JSON.stringify(this.state))}catch{}}save(){this.persist(),this.apply(),this.onChange?.()}apply(){this.closeFly();for(let e of R6){let t=this.cols[e],n=this.state[e].map(e=>this.section(e)).filter(e=>!!e),r=Array.from(t.children).filter(e=>n.includes(e));if(n.some((e,t)=>r[t]!==e))for(let e of n)t.appendChild(e)}for(let e of R.all.values()){m(e.root,!this.present(e.id)),this.wire(e);let t=this.state.heights[e.id],n=typeof t==`number`;c(e.root,`is-sized`,n);let r=n?`${Math.round(t)}px`:``;e.root.style.height!==r&&(e.root.style.height=r)}this.splitters(),this.state.width?_(this.root,`--cv-layers-w`,`${this.state.width}px`):this.root.style.getPropertyValue(`--cv-layers-w`)&&this.root.style.removeProperty(`--cv-layers-w`);for(let e of R6)c(this.cols[e],`is-collapsed`,this.isCollapsed(e));c(this.root,`is-side-collapsed`,this.isCollapsed(`side`)),c(this.root,`is-dock-collapsed`,this.isCollapsed(`dock`)),c(this.root,`is-dock-empty`,this.shown(`dock`).length===0&&!this.drag);let e=this.shown(`left`).length>0&&!this.isCollapsed(`left`);_(this.root,`--fd-left-w`,e?`${this.state.leftWidth??m8t}px`:`0px`),m(this.cols.left,!e),this.renderStrips()}isCollapsed(e){return this.state.collapsed.includes(e)}setCollapsed(e,t){this.isCollapsed(e)!==t&&(this.state.collapsed=t?[...this.state.collapsed,e]:this.state.collapsed.filter(t=>t!==e),this.save())}strips=new Map;collapseBtns=new Map;fly=null;flyOpen=null;closeFly(){let e=this.flyOpen;e&&(e.mark.replaceWith(e.s),e.btn.classList.remove(`is-on`),this.flyOpen=null,this.fly&&m(this.fly,!0))}flyHost(){return this.fly||(this.fly=f(``),(document.getElementById(`overlay-root`)??document.body).appendChild(this.fly),document.addEventListener(`pointerdown`,e=>{let t=e.target;this.flyOpen&&!this.fly?.contains(t)&&!this.flyOpen.btn.contains(t)&&this.closeFly()},!0),document.addEventListener(`keydown`,e=>{this.flyOpen&&e.key===`Escape`&&this.closeFly()})),this.fly}stripFor(e){let t=this.strips.get(e);if(!t){t=f(e===`left`?``:``),e===`left`?this.minirail.appendChild(t):this.cols[e].prepend(t);let n=e===`left`?`Expand the left panels`:`Expand panels`,r=f(``);r.addEventListener(`click`,()=>this.setCollapsed(e,!1)),t.appendChild(r),this.strips.set(e,t)}return t}renderStrips(){for(let e of R6){let t=this.isCollapsed(e)&&this.shown(e).length>0;if(e===`left`&&m(this.minirail,!t),!t&&!this.strips.has(e)){this.placeCollapse(e);continue}let n=this.stripFor(e),r=t?this.state[e].filter(e=>this.present(e)):[],i=new Map;for(let e of Array.from(n.querySelectorAll(`[data-group]`)))i.set(e.dataset.group,e);for(let[e,t]of i)r.includes(e)||t.remove();for(let t of r){let r=i.get(t);r||=this.stripButton(e,t),n.appendChild(r)}this.placeCollapse(e)}}stripButton(e,t){let n=R.all.get(t)?.root.getAttribute(`aria-label`)??t,r=f(``);return r.dataset.group=t,r.title=n,r.setAttribute(`aria-label`,n),r.addEventListener(`click`,()=>{let n=this.section(t);if(!n)return;if(this.flyOpen?.s===n){this.closeFly();return}this.closeFly();let i=this.flyHost(),a=document.createComment(t);n.replaceWith(a),i.appendChild(n),m(i,!1),this.flyOpen={s:n,mark:a,btn:r},r.classList.add(`is-on`);let o=r.getBoundingClientRect();e===`left`?(i.style.right=``,i.style.left=`${Math.round(o.right+8)}px`):(i.style.left=``,i.style.right=`${Math.round(window.innerWidth-o.left+8)}px`),i.style.top=`${Math.round(Math.max(8,Math.min(o.top,window.innerHeight-i.offsetHeight-8)))}px`}),r}placeCollapse(e){let t=this.collapseBtns.get(e);if(!t){let n=e===`left`?`Collapse to the minirail`:`Collapse to icons`;t=f(``),t.addEventListener(`click`,t=>{t.stopPropagation(),this.setCollapsed(e,!0)}),this.collapseBtns.set(e,t)}let n=this.shown(e)[0]?.querySelector(`:scope > .cv-panel-head`);n&&t.parentElement!==n&&n.appendChild(t)}splitters(){let e=new Set;for(let t of R6){let n=this.shown(t);for(let t=0;t`);return t.addEventListener(`dblclick`,()=>{delete this.state.heights[e],this.save()}),t.addEventListener(`pointerdown`,n=>{let r=this.section(e);if(n.button!==0||!r||r.classList.contains(`is-min`))return;n.preventDefault(),t.setPointerCapture(n.pointerId);let i=n.clientY,a=r.getBoundingClientRect().height,o=r.querySelector(`.cv-panel-head`)?.getBoundingClientRect().height??40,s=r.parentElement.getBoundingClientRect().bottom-r.getBoundingClientRect().top-60,l=t=>{this.state.heights[e]=Math.max(o+60,Math.min(s,a+t.clientY-i)),c(r,`is-sized`,!0),r.style.height=`${Math.round(this.state.heights[e])}px`},u=()=>{t.removeEventListener(`pointermove`,l),t.removeEventListener(`pointerup`,u),t.removeEventListener(`pointercancel`,u),this.persist()};t.addEventListener(`pointermove`,l),t.addEventListener(`pointerup`,u),t.addEventListener(`pointercancel`,u)}),t}wireResizer(){this.resizer.addEventListener(`dblclick`,()=>{this.state.width=null,this.save()}),this.resizer.addEventListener(`pointerdown`,e=>{if(e.button!==0)return;e.preventDefault(),this.resizer.setPointerCapture(e.pointerId),c(this.resizer,`is-dragging`,!0);let t=this.cols.dock.getBoundingClientRect().right,n=e=>{this.state.width=Math.round(Math.max(z6,Math.min(B6,t-e.clientX-3))),_(this.root,`--cv-layers-w`,`${this.state.width}px`)},r=()=>{c(this.resizer,`is-dragging`,!1),this.resizer.removeEventListener(`pointermove`,n),this.resizer.removeEventListener(`pointerup`,r),this.resizer.removeEventListener(`pointercancel`,r),this.persist()};this.resizer.addEventListener(`pointermove`,n),this.resizer.addEventListener(`pointerup`,r),this.resizer.addEventListener(`pointercancel`,r)})}wireLeftResizer(){let e=f(``);this.cols.left.appendChild(e),e.addEventListener(`dblclick`,()=>{this.state.leftWidth=null,this.save()}),e.addEventListener(`pointerdown`,t=>{if(t.button!==0)return;t.preventDefault(),e.setPointerCapture(t.pointerId),c(e,`is-dragging`,!0);let n=this.cols.left.getBoundingClientRect().left,r=e=>{this.state.leftWidth=Math.round(Math.max(z6,Math.min(B6,e.clientX-n))),_(this.root,`--fd-left-w`,`${this.state.leftWidth}px`)},i=()=>{c(e,`is-dragging`,!1),e.removeEventListener(`pointermove`,r),e.removeEventListener(`pointerup`,i),e.removeEventListener(`pointercancel`,i),this.persist()};e.addEventListener(`pointermove`,r),e.addEventListener(`pointerup`,i),e.addEventListener(`pointercancel`,i)})}wire(e){let t=e.root.querySelector(`:scope > .cv-panel-head`);t&&!this.wired.has(t)&&(this.wired.add(t),t.addEventListener(`pointerdown`,t=>{let n=t.target;t.button!==0||n.closest(`button:not(.cv-group-tab), [data-cmd], input, select`)||n.closest(`.cv-group-tab`)&&e.size>1||(this.drag={id:e.id,x0:t.clientX,y0:t.clientY,moving:!1,at:null},document.addEventListener(`pointermove`,this.docMove,!0))}),t.addEventListener(`click`,e=>{this.suppressClick&&=(e.stopPropagation(),e.preventDefault(),!1)},!0))}docMove=e=>{let t=this.drag;if(!t){document.removeEventListener(`pointermove`,this.docMove,!0);return}if(!(e.buttons&1)){this.drop();return}if(!t.moving&&Math.hypot(e.clientX-t.x0,e.clientY-t.y0)<6)return;t.moving=!0,this.ghost||(this.ghost=f(``),this.ghost.textContent=R.all.get(t.id)?.root.getAttribute(`aria-label`)??t.id,document.body.appendChild(this.ghost)),this.ghost.style.left=`${e.clientX+12}px`,this.ghost.style.top=`${e.clientY+10}px`;let n=this.gapAt(e.clientX,e.clientY);t.at=n?{col:n.col,index:n.index}:null,n?this.placeMarker(n,`Move here`):m(this.marker,!0)};drop(){let e=this.drag;this.drag=null,this.ghost?.remove(),this.ghost=null,document.removeEventListener(`pointermove`,this.docMove,!0),m(this.marker,!0),e?.moving&&e.at&&(this.suppressClick=!0,window.setTimeout(()=>{this.suppressClick=!1},0),this.insert(e.id,e.at.col,e.at.index))}insert(e,t,n){let r=this.state[t].filter(e=>this.present(e))[n]??null;if(r===e)return;let i=this.state.left.filter(t=>t!==e),a=this.state.side.filter(t=>t!==e),o=this.state.dock.filter(t=>t!==e),s=t===`left`?i:t===`side`?a:o,c=r?s.indexOf(r):s.length;s.splice(c<0?s.length:c,0,e),this.state={...this.state,left:i,side:a,dock:o},this.save()}gapAt(e,t){let n=null;for(let r of R6){let i=this.cols[r].getBoundingClientRect();i.width>0&&e>=i.left&&e<=i.right&&t>=i.top&&t<=i.bottom&&(n=r)}if(!n)return null;let r=this.cols[n],i=this.shown(n),a=0,o=1/0,s=r.getBoundingClientRect().top+2;for(let e=0;e<=i.length;e++){let n=e`),this.undoBtn=p(e,`[data-cmd="undo"].cv-st-btn`),this.redoBtn=p(e,`[data-cmd="redo"].cv-st-btn`),this.zoom=p(e,`.cv-st-zoom`),this.dims=p(e,`.fd-st-dims`),this.info=p(e,`.cv-st-info`),this.hint=p(e,`.fd-st-hint`),this.busy=C8t(``+O(`loading`,12)+`Working`),this.hint.after(this.busy),this.zoom.addEventListener(`keydown`,e=>{if(e.key===`Enter`){let e=parseFloat(this.zoom.value.replace(`,`,`.`).replace(`%`,``));Number.isFinite(e)&&e>0&&D.hasDoc&&this.viewport.zoomTo(Math.min(6400,Math.max(1,e))/100),this.zoom.blur()}else e.key===`Escape`&&this.zoom.blur();e.stopPropagation()}),this.zoom.addEventListener(`focus`,()=>this.zoom.select()),this.zoom.addEventListener(`blur`,()=>this.syncView());try{let e=localStorage.getItem(x8t);e&&H6.includes(e)&&(this.infoKind=e)}catch{}this.info.addEventListener(`click`,e=>{let t=H6.length;this.infoKind=H6[(H6.indexOf(this.infoKind)+(e.shiftKey?t-1:1))%t];try{localStorage.setItem(x8t,this.infoKind)}catch{}this.syncInfo()});for(let e of[`docs`,`layout`,`selection`,`change`])D.on(e,()=>this.syncInfo());for(let e of[`docs`,`change`])D.on(e,()=>this.syncHistory());D.on(`layout`,()=>this.syncView()),D.on(`busy`,()=>{D.busy?this.dismiss||=i(this.busy):(this.dismiss?.(),this.dismiss=null)}),new ResizeObserver(()=>this.fitHint()).observe(this.hint),this.syncView(),this.syncInfo(),this.syncHistory()}syncView(){let e=D.hasDoc,t=e?`${Number((this.viewport.view.zoom*100).toFixed(1))}%`:``;document.activeElement!==this.zoom&&this.zoom.value!==t&&(this.zoom.value=t),h(this.zoom,!e);let n=D.layout,r=n?.pages.find(e=>e.abs===this.viewport.currentPage())??n?.pages[0],i=r?Math.round((r.rect[2]-r.rect[0])*100)/100:0,a=r?Math.round((r.rect[3]-r.rect[1])*100)/100:0;s(this.dims,r?`${i} × ${a} pt`:``),g(this.dims,r?`Page size`:``)}syncHistory(){let e=D.doc;h(this.undoBtn,!e?.canUndo),h(this.redoBtn,!e?.canRedo)}syncInfo(){let e=D.doc,t=D.layout,n=this.infoKind,r=``,i=``;e&&(n===`pages`?(r=`${e.pages} ${e.pages===1?`page`:`pages`}${t?` · ${new Set(t.pages.map(e=>e.spread)).size} spreads`:``}`,i=`Pages and spreads in the document`):n===`slots`?(r=t?`${t.slots.length} slots`:``,i=`Named slots in the layout`):n===`selection`?(r=`${D.selection?.items.length??0} selected`,i=`Objects selected`):(r=e.undoLabel?`Undo: ${e.undoLabel}`:`Undo: nothing`,i=`What Undo would reverse`)),s(this.info,r),g(this.info,`${i}${i?`. `:``}Click for the next readout, Shift+click for the previous.`)}setHint(e){this.hintSegs=e.split(` · `),this.fitHint()}fitHint(){let e=this.hintSegs;if(!e.length)return;let t=e.length;for(s(this.hint,e.join(` · `));t>1&&this.hint.scrollWidth>this.hint.clientWidth;)t--,s(this.hint,e.slice(0,t).join(` · `));g(this.hint,t{})),T8t=n({Channel:()=>Z6,PluginListener:()=>Q6,Resource:()=>$6,SERIALIZE_TO_IPC_FN:()=>X6,addPluginListener:()=>D8t,checkPermissions:()=>O8t,convertFileSrc:()=>A8t,invoke:()=>W,isTauri:()=>j8t,requestPermissions:()=>k8t,transformCallback:()=>E8t});function E8t(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}async function D8t(e,t,n){let r=new Z6(n);try{return await W(`plugin:${e}|register_listener`,{event:t,handler:r}),new Q6(e,t,r.id)}catch{return await W(`plugin:${e}|registerListener`,{event:t,handler:r}),new Q6(e,t,r.id)}}async function O8t(e){return W(`plugin:${e}|check_permissions`)}async function k8t(e){return W(`plugin:${e}|request_permissions`)}async function W(e,t={},n){return window.__TAURI_INTERNALS__.invoke(e,t,n)}function A8t(e,t=`asset`){return window.__TAURI_INTERNALS__.convertFileSrc(e,t)}function j8t(){return!!(globalThis||window).isTauri}var G6,K6,q6,J6,Y6,X6,Z6,Q6,$6,e8=t((()=>{w8t(),X6=`__TAURI_TO_IPC_KEY__`,Z6=class{constructor(e){G6.set(this,void 0),K6.set(this,0),q6.set(this,[]),J6.set(this,void 0),W6(this,G6,e||(()=>{}),`f`),this.id=E8t(e=>{let t=e.index;if(`end`in e){t==U6(this,K6,`f`)?this.cleanupCallback():W6(this,J6,t,`f`);return}let n=e.message;if(t==U6(this,K6,`f`)){for(U6(this,G6,`f`).call(this,n),W6(this,K6,U6(this,K6,`f`)+1,`f`);U6(this,K6,`f`)in U6(this,q6,`f`);){let e=U6(this,q6,`f`)[U6(this,K6,`f`)];U6(this,G6,`f`).call(this,e),delete U6(this,q6,`f`)[U6(this,K6,`f`)],W6(this,K6,U6(this,K6,`f`)+1,`f`)}U6(this,K6,`f`)===U6(this,J6,`f`)&&this.cleanupCallback()}else U6(this,q6,`f`)[t]=n})}cleanupCallback(){window.__TAURI_INTERNALS__.unregisterCallback(this.id)}set onmessage(e){W6(this,G6,e,`f`)}get onmessage(){return U6(this,G6,`f`)}[(G6=new WeakMap,K6=new WeakMap,q6=new WeakMap,J6=new WeakMap,X6)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[X6]()}},Q6=class{constructor(e,t,n){this.plugin=e,this.event=t,this.channelId=n}async unregister(){return W(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}},$6=class{get rid(){return U6(this,Y6,`f`)}constructor(e){Y6.set(this,void 0),W6(this,Y6,e,`f`)}async close(){return W(`plugin:resources|close`,{rid:this.rid})}async[(Y6=new WeakMap,Symbol.asyncDispose)](){await this.close()}}})),t8,n8,r8,i8,a8,o8,M8t=t((()=>{e8(),t8=class{constructor(...e){this.type=`Logical`,e.length===1?`Logical`in e[0]?(this.width=e[0].Logical.width,this.height=e[0].Logical.height):(this.width=e[0].width,this.height=e[0].height):(this.width=e[0],this.height=e[1])}toPhysical(e){return new n8(this.width*e,this.height*e)}[X6](){return{width:this.width,height:this.height}}toJSON(){return this[X6]()}},n8=class{constructor(...e){this.type=`Physical`,e.length===1?`Physical`in e[0]?(this.width=e[0].Physical.width,this.height=e[0].Physical.height):(this.width=e[0].width,this.height=e[0].height):(this.width=e[0],this.height=e[1])}toLogical(e){return new t8(this.width/e,this.height/e)}[X6](){return{width:this.width,height:this.height}}toJSON(){return this[X6]()}},r8=class{constructor(e){this.size=e}toLogical(e){return this.size instanceof t8?this.size:this.size.toLogical(e)}toPhysical(e){return this.size instanceof n8?this.size:this.size.toPhysical(e)}[X6](){return{[`${this.size.type}`]:{width:this.size.width,height:this.size.height}}}toJSON(){return this[X6]()}},i8=class{constructor(...e){this.type=`Logical`,e.length===1?`Logical`in e[0]?(this.x=e[0].Logical.x,this.y=e[0].Logical.y):(this.x=e[0].x,this.y=e[0].y):(this.x=e[0],this.y=e[1])}toPhysical(e){return new a8(this.x*e,this.y*e)}[X6](){return{x:this.x,y:this.y}}toJSON(){return this[X6]()}},a8=class{constructor(...e){this.type=`Physical`,e.length===1?`Physical`in e[0]?(this.x=e[0].Physical.x,this.y=e[0].Physical.y):(this.x=e[0].x,this.y=e[0].y):(this.x=e[0],this.y=e[1])}toLogical(e){return new i8(this.x/e,this.y/e)}[X6](){return{x:this.x,y:this.y}}toJSON(){return this[X6]()}},o8=class{constructor(e){this.position=e}toLogical(e){return this.position instanceof i8?this.position:this.position.toLogical(e)}toPhysical(e){return this.position instanceof a8?this.position:this.position.toPhysical(e)}[X6](){return{[`${this.position.type}`]:{x:this.position.x,y:this.position.y}}}toJSON(){return this[X6]()}}}));async function N8t(e,t){window.__TAURI_EVENT_PLUGIN_INTERNALS__.unregisterListener(e,t),await W(`plugin:event|unlisten`,{event:e,eventId:t})}async function P8t(e,t,n){return W(`plugin:event|listen`,{event:e,target:typeof n?.target==`string`?{kind:`AnyLabel`,label:n.target}:n?.target??{kind:`Any`},handler:E8t(t)}).then(t=>async()=>N8t(e,t))}async function F8t(e,t,n){return P8t(e,n=>{N8t(e,n.id),t(n)},n)}async function I8t(e,t){await W(`plugin:event|emit`,{event:e,payload:t})}async function L8t(e,t,n){await W(`plugin:event|emit_to`,{target:typeof e==`string`?{kind:`AnyLabel`,label:e}:e,event:t,payload:n})}var s8,R8t=t((()=>{e8(),(function(e){e.WINDOW_RESIZED=`tauri://resize`,e.WINDOW_MOVED=`tauri://move`,e.WINDOW_CLOSE_REQUESTED=`tauri://close-requested`,e.WINDOW_DESTROYED=`tauri://destroyed`,e.WINDOW_FOCUS=`tauri://focus`,e.WINDOW_BLUR=`tauri://blur`,e.WINDOW_SCALE_FACTOR_CHANGED=`tauri://scale-change`,e.WINDOW_THEME_CHANGED=`tauri://theme-changed`,e.WINDOW_CREATED=`tauri://window-created`,e.WINDOW_SUSPENDED=`tauri://suspended`,e.WINDOW_RESUMED=`tauri://resumed`,e.WEBVIEW_CREATED=`tauri://webview-created`,e.DRAG_ENTER=`tauri://drag-enter`,e.DRAG_OVER=`tauri://drag-over`,e.DRAG_DROP=`tauri://drag-drop`,e.DRAG_LEAVE=`tauri://drag-leave`})(s8||={})}));function c8(e){return e==null?null:typeof e==`string`?e:e instanceof z8t?e.rid:e}var z8t,l8=t((()=>{e8(),z8t=class e extends $6{constructor(e){super(e)}static async new(t,n,r){return W(`plugin:image|new`,{rgba:t,width:n,height:r}).then(t=>new e(t))}static async fromBytes(t){return W(`plugin:image|from_bytes`,{bytes:t}).then(t=>new e(t))}static async fromPath(t){return W(`plugin:image|from_path`,{path:t}).then(t=>new e(t))}async rgba(){return W(`plugin:image|rgba`,{rid:this.rid}).then(e=>new Uint8Array(e))}async size(){return W(`plugin:image|size`,{rid:this.rid})}}})),B8t=n({CloseRequestedEvent:()=>J8t,Effect:()=>Q8t,EffectState:()=>$8t,LogicalPosition:()=>i8,LogicalSize:()=>t8,PhysicalPosition:()=>a8,PhysicalSize:()=>n8,ProgressBarStatus:()=>Y8t,UserAttentionType:()=>q8t,Window:()=>p8,availableMonitors:()=>G8t,currentMonitor:()=>H8t,cursorPosition:()=>K8t,getAllWindows:()=>u8,getCurrentWindow:()=>V8t,monitorFromPoint:()=>W8t,primaryMonitor:()=>U8t});function V8t(){return new p8(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}async function u8(){return W(`plugin:window|get_all_windows`).then(e=>e.map(e=>new p8(e,{skip:!0})))}function d8(e){return e===null?null:{name:e.name,scaleFactor:e.scaleFactor,position:new a8(e.position),size:new n8(e.size),workArea:{position:new a8(e.workArea.position),size:new n8(e.workArea.size)}}}async function H8t(){return W(`plugin:window|current_monitor`).then(d8)}async function U8t(){return W(`plugin:window|primary_monitor`).then(d8)}async function W8t(e,t){return W(`plugin:window|monitor_from_point`,{x:e,y:t}).then(d8)}async function G8t(){return W(`plugin:window|available_monitors`).then(e=>e.map(d8))}async function K8t(){return W(`plugin:window|cursor_position`).then(e=>new a8(e))}var q8t,J8t,Y8t,f8,p8,X8t,Z8t,Q8t,$8t,e5t=t((()=>{M8t(),R8t(),e8(),l8(),(function(e){e[e.Critical=1]=`Critical`,e[e.Informational=2]=`Informational`})(q8t||={}),J8t=class{constructor(e){this._preventDefault=!1,this.event=e.event,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}},(function(e){e.None=`none`,e.Normal=`normal`,e.Indeterminate=`indeterminate`,e.Paused=`paused`,e.Error=`error`})(Y8t||={}),f8=[`tauri://created`,`tauri://error`],p8=class{constructor(e,t={}){this.label=e,this.listeners=Object.create(null),t?.skip||W(`plugin:window|create`,{options:{...t,parent:typeof t.parent==`string`?t.parent:t.parent?.label,label:e}}).then(async()=>this.emit(`tauri://created`)).catch(async e=>this.emit(`tauri://error`,e))}static async getByLabel(e){return(await u8()).find(t=>t.label===e)??null}static getCurrent(){return V8t()}static async getAll(){return u8()}static async getFocusedWindow(){for(let e of await u8())if(await e.isFocused())return e;return null}async listen(e,t){return this._handleTauriEvent(e,t)?()=>{let n=this.listeners[e];n.splice(n.indexOf(t),1)}:P8t(e,t,{target:{kind:`Window`,label:this.label}})}async once(e,t){return this._handleTauriEvent(e,t)?()=>{let n=this.listeners[e];n.splice(n.indexOf(t),1)}:F8t(e,t,{target:{kind:`Window`,label:this.label}})}async emit(e,t){if(f8.includes(e))for(let n of this.listeners[e]||[])n({event:e,id:-1,payload:t});else return I8t(e,t)}async emitTo(e,t,n){if(f8.includes(t))for(let e of this.listeners[t]||[])e({event:t,id:-1,payload:n});else return L8t(e,t,n)}_handleTauriEvent(e,t){return f8.includes(e)?(e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t],!0):!1}async scaleFactor(){return W(`plugin:window|scale_factor`,{label:this.label})}async innerPosition(){return W(`plugin:window|inner_position`,{label:this.label}).then(e=>new a8(e))}async outerPosition(){return W(`plugin:window|outer_position`,{label:this.label}).then(e=>new a8(e))}async innerSize(){return W(`plugin:window|inner_size`,{label:this.label}).then(e=>new n8(e))}async outerSize(){return W(`plugin:window|outer_size`,{label:this.label}).then(e=>new n8(e))}async isFullscreen(){return W(`plugin:window|is_fullscreen`,{label:this.label})}async isMinimized(){return W(`plugin:window|is_minimized`,{label:this.label})}async isMaximized(){return W(`plugin:window|is_maximized`,{label:this.label})}async isFocused(){return W(`plugin:window|is_focused`,{label:this.label})}async isDecorated(){return W(`plugin:window|is_decorated`,{label:this.label})}async isResizable(){return W(`plugin:window|is_resizable`,{label:this.label})}async isMaximizable(){return W(`plugin:window|is_maximizable`,{label:this.label})}async isMinimizable(){return W(`plugin:window|is_minimizable`,{label:this.label})}async isClosable(){return W(`plugin:window|is_closable`,{label:this.label})}async isVisible(){return W(`plugin:window|is_visible`,{label:this.label})}async title(){return W(`plugin:window|title`,{label:this.label})}async theme(){return W(`plugin:window|theme`,{label:this.label})}async isAlwaysOnTop(){return W(`plugin:window|is_always_on_top`,{label:this.label})}async activityName(){return W(`plugin:window|activity_name`,{label:this.label})}async sceneIdentifier(){return W(`plugin:window|scene_identifier`,{label:this.label})}async center(){return W(`plugin:window|center`,{label:this.label})}async requestUserAttention(e){let t=null;return e&&(t=e===q8t.Critical?{type:`Critical`}:{type:`Informational`}),W(`plugin:window|request_user_attention`,{label:this.label,value:t})}async setResizable(e){return W(`plugin:window|set_resizable`,{label:this.label,value:e})}async setEnabled(e){return W(`plugin:window|set_enabled`,{label:this.label,value:e})}async isEnabled(){return W(`plugin:window|is_enabled`,{label:this.label})}async setMaximizable(e){return W(`plugin:window|set_maximizable`,{label:this.label,value:e})}async setMinimizable(e){return W(`plugin:window|set_minimizable`,{label:this.label,value:e})}async setClosable(e){return W(`plugin:window|set_closable`,{label:this.label,value:e})}async setTitle(e){return W(`plugin:window|set_title`,{label:this.label,value:e})}async maximize(){return W(`plugin:window|maximize`,{label:this.label})}async unmaximize(){return W(`plugin:window|unmaximize`,{label:this.label})}async toggleMaximize(){return W(`plugin:window|toggle_maximize`,{label:this.label})}async minimize(){return W(`plugin:window|minimize`,{label:this.label})}async unminimize(){return W(`plugin:window|unminimize`,{label:this.label})}async show(){return W(`plugin:window|show`,{label:this.label})}async hide(){return W(`plugin:window|hide`,{label:this.label})}async close(){return W(`plugin:window|close`,{label:this.label})}async destroy(){return W(`plugin:window|destroy`,{label:this.label})}async setDecorations(e){return W(`plugin:window|set_decorations`,{label:this.label,value:e})}async setShadow(e){return W(`plugin:window|set_shadow`,{label:this.label,value:e})}async setEffects(e){return W(`plugin:window|set_effects`,{label:this.label,value:e})}async clearEffects(){return W(`plugin:window|set_effects`,{label:this.label,value:null})}async setAlwaysOnTop(e){return W(`plugin:window|set_always_on_top`,{label:this.label,value:e})}async setAlwaysOnBottom(e){return W(`plugin:window|set_always_on_bottom`,{label:this.label,value:e})}async setContentProtected(e){return W(`plugin:window|set_content_protected`,{label:this.label,value:e})}async setSize(e){return W(`plugin:window|set_size`,{label:this.label,value:e instanceof r8?e:new r8(e)})}async setMinSize(e){return W(`plugin:window|set_min_size`,{label:this.label,value:e instanceof r8?e:e?new r8(e):null})}async setMaxSize(e){return W(`plugin:window|set_max_size`,{label:this.label,value:e instanceof r8?e:e?new r8(e):null})}async setSizeConstraints(e){function t(e){return e?{Logical:e}:null}return W(`plugin:window|set_size_constraints`,{label:this.label,value:{minWidth:t(e?.minWidth),minHeight:t(e?.minHeight),maxWidth:t(e?.maxWidth),maxHeight:t(e?.maxHeight)}})}async setPosition(e){return W(`plugin:window|set_position`,{label:this.label,value:e instanceof o8?e:new o8(e)})}async setFullscreen(e){return W(`plugin:window|set_fullscreen`,{label:this.label,value:e})}async setFullscreenOnMonitor(e){return W(`plugin:window|set_fullscreen_on_monitor`,{label:this.label,value:e})}async setSimpleFullscreen(e){return W(`plugin:window|set_simple_fullscreen`,{label:this.label,value:e})}async setFocus(){return W(`plugin:window|set_focus`,{label:this.label})}async setFocusable(e){return W(`plugin:window|set_focusable`,{label:this.label,value:e})}async setIcon(e){return W(`plugin:window|set_icon`,{label:this.label,value:c8(e)})}async setSkipTaskbar(e){return W(`plugin:window|set_skip_taskbar`,{label:this.label,value:e})}async setCursorGrab(e){return W(`plugin:window|set_cursor_grab`,{label:this.label,value:e})}async setCursorVisible(e){return W(`plugin:window|set_cursor_visible`,{label:this.label,value:e})}async setCursorIcon(e){return W(`plugin:window|set_cursor_icon`,{label:this.label,value:e})}async setBackgroundColor(e){return W(`plugin:window|set_background_color`,{label:this.label,value:e})}async setCursorPosition(e){return W(`plugin:window|set_cursor_position`,{label:this.label,value:e instanceof o8?e:new o8(e)})}async setIgnoreCursorEvents(e){return W(`plugin:window|set_ignore_cursor_events`,{label:this.label,value:e})}async startDragging(){return W(`plugin:window|start_dragging`,{label:this.label})}async startResizeDragging(e){return W(`plugin:window|start_resize_dragging`,{label:this.label,value:e})}async setBadgeCount(e){return W(`plugin:window|set_badge_count`,{label:this.label,value:e})}async setBadgeLabel(e){return W(`plugin:window|set_badge_label`,{label:this.label,value:e})}async setOverlayIcon(e){return W(`plugin:window|set_overlay_icon`,{label:this.label,value:e?c8(e):void 0})}async setProgressBar(e){return W(`plugin:window|set_progress_bar`,{label:this.label,value:e})}async setVisibleOnAllWorkspaces(e){return W(`plugin:window|set_visible_on_all_workspaces`,{label:this.label,value:e})}async setTitleBarStyle(e){return W(`plugin:window|set_title_bar_style`,{label:this.label,value:e})}async setTheme(e){return W(`plugin:window|set_theme`,{label:this.label,value:e})}async onResized(e){return this.listen(s8.WINDOW_RESIZED,t=>{t.payload=new n8(t.payload),e(t)})}async onMoved(e){return this.listen(s8.WINDOW_MOVED,t=>{t.payload=new a8(t.payload),e(t)})}async onCloseRequested(e){return this.listen(s8.WINDOW_CLOSE_REQUESTED,async t=>{let n=new J8t(t);await e(n),n.isPreventDefault()||await this.destroy()})}async onDragDropEvent(e){let t=await this.listen(s8.DRAG_ENTER,t=>{e({...t,payload:{type:`enter`,paths:t.payload.paths,position:new a8(t.payload.position)}})}),n=await this.listen(s8.DRAG_OVER,t=>{e({...t,payload:{type:`over`,position:new a8(t.payload.position)}})}),r=await this.listen(s8.DRAG_DROP,t=>{e({...t,payload:{type:`drop`,paths:t.payload.paths,position:new a8(t.payload.position)}})}),i=await this.listen(s8.DRAG_LEAVE,t=>{e({...t,payload:{type:`leave`}})});return()=>{t(),r(),n(),i()}}async onFocusChanged(e){let t=await this.listen(s8.WINDOW_FOCUS,t=>{e({...t,payload:!0})}),n=await this.listen(s8.WINDOW_BLUR,t=>{e({...t,payload:!1})});return()=>{t(),n()}}async onScaleChanged(e){return this.listen(s8.WINDOW_SCALE_FACTOR_CHANGED,e)}async onThemeChanged(e){return this.listen(s8.WINDOW_THEME_CHANGED,e)}},(function(e){e.Disabled=`disabled`,e.Throttle=`throttle`,e.Suspend=`suspend`})(X8t||={}),(function(e){e.Default=`default`,e.FluentOverlay=`fluentOverlay`})(Z8t||={}),(function(e){e.AppearanceBased=`appearanceBased`,e.Light=`light`,e.Dark=`dark`,e.MediumLight=`mediumLight`,e.UltraDark=`ultraDark`,e.Titlebar=`titlebar`,e.Selection=`selection`,e.Menu=`menu`,e.Popover=`popover`,e.Sidebar=`sidebar`,e.HeaderView=`headerView`,e.Sheet=`sheet`,e.WindowBackground=`windowBackground`,e.HudWindow=`hudWindow`,e.FullScreenUI=`fullScreenUI`,e.Tooltip=`tooltip`,e.ContentBackground=`contentBackground`,e.UnderWindowBackground=`underWindowBackground`,e.UnderPageBackground=`underPageBackground`,e.LiquidGlassRegular=`liquidGlassRegular`,e.LiquidGlassClear=`liquidGlassClear`,e.Mica=`mica`,e.Blur=`blur`,e.Acrylic=`acrylic`,e.Tabbed=`tabbed`,e.TabbedDark=`tabbedDark`,e.TabbedLight=`tabbedLight`})(Q8t||={}),(function(e){e.FollowsWindowActiveState=`followsWindowActiveState`,e.Active=`active`,e.Inactive=`inactive`})($8t||={})})),t5t=()=>`__TAURI_INTERNALS__`in window&&!/Mac/.test(navigator.platform),n5t=class{header;wanted;box=document.createElement(`div`);win=null;on=!1;maximized=!1;constructor(e,t){if(this.header=e,this.wanted=t,this.box.className=`cv-caption`,this.box.hidden=!0,this.box.innerHTML=``,e.append(this.box),`__TAURI_INTERNALS__`in window)for(let t of e.querySelectorAll(`.cv-menubar, .cv-zoom`))t.setAttribute(`data-tauri-drag-region`,``);this.box.addEventListener(`click`,e=>{let t=e.target instanceof Element?e.target.closest(`[data-cap]`):null;t&&this.act(t.dataset.cap??``)}),window.addEventListener(`resize`,()=>{this.on&&this.look()}),this.sync()}get active(){return this.on}sync(){let e=t5t()&&this.wanted();e!==this.on&&(this.on=e,m(this.box,!e),c(document.documentElement,`has-caption-buttons`,e),this.use(t=>t.setDecorations(!e)).then(()=>this.look()))}async use(e){try{return this.win??=P(()=>Promise.resolve().then(()=>(e5t(),B8t)).then(e=>e.getCurrentWindow()),void 0,{}.url),await e(await this.win)}catch{return}}async act(e){e===`min`?await this.use(e=>e.minimize()):e===`max`?(await this.use(e=>e.toggleMaximize()),await this.look()):e===`close`&&await this.use(e=>e.close())}async look(){let e=!!await this.use(e=>e.isMaximized());if(e===this.maximized&&this.box.dataset.shown)return;this.maximized=e,this.box.dataset.shown=`1`;let t=p(this.box,`[data-cap="max"]`);t.innerHTML=O(e?`capRestore`:`capMax`,16),g(t,e?`Restore`:`Maximize`),t.setAttribute(`aria-label`,e?`Restore`:`Maximize`)}};function r5t(e){if(`items`in e)e.items=e.items?.map(e=>`rid`in e?e:r5t(e));else if(`action`in e&&e.action){let t=new Z6;return t.onmessage=e.action,delete e.action,{...e,handler:t}}return e}async function m8(e,t){let n=new Z6;if(t&&typeof t==`object`&&(`action`in t&&t.action&&(n.onmessage=t.action,delete t.action),`item`in t&&t.item&&typeof t.item==`object`&&`About`in t.item&&t.item.About&&typeof t.item.About==`object`&&`icon`in t.item.About&&t.item.About.icon&&(t.item.About.icon=c8(t.item.About.icon)),`icon`in t&&t.icon&&(t.icon=c8(t.icon)),`items`in t&&t.items)){function r(e){return`rid`in e?[e.rid,e.kind]:(`item`in e&&typeof e.item==`object`&&e.item.About?.icon&&(e.item.About.icon=c8(e.item.About.icon)),`icon`in e&&e.icon&&(e.icon=c8(e.icon)),`items`in e&&e.items&&(e.items=e.items.map(r)),r5t(e))}t.items=t.items.map(r)}return W(`plugin:menu|new`,{kind:e,options:t,handler:n})}var h8,g8,_8,v8=t((()=>{w8t(),e8(),l8(),_8=class extends $6{get id(){return U6(this,h8,`f`)}get kind(){return U6(this,g8,`f`)}constructor(e,t,n){super(e),h8.set(this,void 0),g8.set(this,void 0),W6(this,h8,t,`f`),W6(this,g8,n,`f`)}},h8=new WeakMap,g8=new WeakMap})),i5t,a5t=t((()=>{v8(),e8(),i5t=class e extends _8{constructor(e,t){super(e,t,`MenuItem`)}static async new(t){return m8(`MenuItem`,t).then(([t,n])=>new e(t,n))}async text(){return W(`plugin:menu|text`,{rid:this.rid,kind:this.kind})}async setText(e){return W(`plugin:menu|set_text`,{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return W(`plugin:menu|is_enabled`,{rid:this.rid,kind:this.kind})}async setEnabled(e){return W(`plugin:menu|set_enabled`,{rid:this.rid,kind:this.kind,enabled:e})}async setAccelerator(e){return W(`plugin:menu|set_accelerator`,{rid:this.rid,kind:this.kind,accelerator:e})}}})),o5t,s5t=t((()=>{v8(),e8(),o5t=class e extends _8{constructor(e,t){super(e,t,`Check`)}static async new(t){return m8(`Check`,t).then(([t,n])=>new e(t,n))}async text(){return W(`plugin:menu|text`,{rid:this.rid,kind:this.kind})}async setText(e){return W(`plugin:menu|set_text`,{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return W(`plugin:menu|is_enabled`,{rid:this.rid,kind:this.kind})}async setEnabled(e){return W(`plugin:menu|set_enabled`,{rid:this.rid,kind:this.kind,enabled:e})}async setAccelerator(e){return W(`plugin:menu|set_accelerator`,{rid:this.rid,kind:this.kind,accelerator:e})}async isChecked(){return W(`plugin:menu|is_checked`,{rid:this.rid})}async setChecked(e){return W(`plugin:menu|set_checked`,{rid:this.rid,checked:e})}}})),c5t,l5t,u5t=t((()=>{v8(),e8(),l8(),(function(e){e.Add=`Add`,e.Advanced=`Advanced`,e.Bluetooth=`Bluetooth`,e.Bookmarks=`Bookmarks`,e.Caution=`Caution`,e.ColorPanel=`ColorPanel`,e.ColumnView=`ColumnView`,e.Computer=`Computer`,e.EnterFullScreen=`EnterFullScreen`,e.Everyone=`Everyone`,e.ExitFullScreen=`ExitFullScreen`,e.FlowView=`FlowView`,e.Folder=`Folder`,e.FolderBurnable=`FolderBurnable`,e.FolderSmart=`FolderSmart`,e.FollowLinkFreestanding=`FollowLinkFreestanding`,e.FontPanel=`FontPanel`,e.GoLeft=`GoLeft`,e.GoRight=`GoRight`,e.Home=`Home`,e.IChatTheater=`IChatTheater`,e.IconView=`IconView`,e.Info=`Info`,e.InvalidDataFreestanding=`InvalidDataFreestanding`,e.LeftFacingTriangle=`LeftFacingTriangle`,e.ListView=`ListView`,e.LockLocked=`LockLocked`,e.LockUnlocked=`LockUnlocked`,e.MenuMixedState=`MenuMixedState`,e.MenuOnState=`MenuOnState`,e.MobileMe=`MobileMe`,e.MultipleDocuments=`MultipleDocuments`,e.Network=`Network`,e.Path=`Path`,e.PreferencesGeneral=`PreferencesGeneral`,e.QuickLook=`QuickLook`,e.RefreshFreestanding=`RefreshFreestanding`,e.Refresh=`Refresh`,e.Remove=`Remove`,e.RevealFreestanding=`RevealFreestanding`,e.RightFacingTriangle=`RightFacingTriangle`,e.Share=`Share`,e.Slideshow=`Slideshow`,e.SmartBadge=`SmartBadge`,e.StatusAvailable=`StatusAvailable`,e.StatusNone=`StatusNone`,e.StatusPartiallyAvailable=`StatusPartiallyAvailable`,e.StatusUnavailable=`StatusUnavailable`,e.StopProgressFreestanding=`StopProgressFreestanding`,e.StopProgress=`StopProgress`,e.TrashEmpty=`TrashEmpty`,e.TrashFull=`TrashFull`,e.User=`User`,e.UserAccounts=`UserAccounts`,e.UserGroup=`UserGroup`,e.UserGuest=`UserGuest`})(c5t||={}),l5t=class e extends _8{constructor(e,t){super(e,t,`Icon`)}static async new(t){return m8(`Icon`,t).then(([t,n])=>new e(t,n))}async text(){return W(`plugin:menu|text`,{rid:this.rid,kind:this.kind})}async setText(e){return W(`plugin:menu|set_text`,{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return W(`plugin:menu|is_enabled`,{rid:this.rid,kind:this.kind})}async setEnabled(e){return W(`plugin:menu|set_enabled`,{rid:this.rid,kind:this.kind,enabled:e})}async setAccelerator(e){return W(`plugin:menu|set_accelerator`,{rid:this.rid,kind:this.kind,accelerator:e})}async setIcon(e){return W(`plugin:menu|set_icon`,{rid:this.rid,kind:this.kind,icon:c8(e)})}}})),d5t,f5t=t((()=>{v8(),e8(),d5t=class e extends _8{constructor(e,t){super(e,t,`Predefined`)}static async new(t){return m8(`Predefined`,t).then(([t,n])=>new e(t,n))}async text(){return W(`plugin:menu|text`,{rid:this.rid,kind:this.kind})}async setText(e){return W(`plugin:menu|set_text`,{rid:this.rid,kind:this.kind,text:e})}}}));function y8([e,t,n]){switch(n){case`Submenu`:return new p5t(e,t);case`Predefined`:return new d5t(e,t);case`Check`:return new o5t(e,t);case`Icon`:return new l5t(e,t);default:return new i5t(e,t)}}var p5t,m5t=t((()=>{a5t(),s5t(),u5t(),f5t(),e8(),v8(),M8t(),l8(),p5t=class e extends _8{constructor(e,t){super(e,t,`Submenu`)}static async new(t){return m8(`Submenu`,t).then(([t,n])=>new e(t,n))}async text(){return W(`plugin:menu|text`,{rid:this.rid,kind:this.kind})}async setText(e){return W(`plugin:menu|set_text`,{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return W(`plugin:menu|is_enabled`,{rid:this.rid,kind:this.kind})}async setEnabled(e){return W(`plugin:menu|set_enabled`,{rid:this.rid,kind:this.kind,enabled:e})}async append(e){return W(`plugin:menu|append`,{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(e=>`rid`in e?[e.rid,e.kind]:e)})}async prepend(e){return W(`plugin:menu|prepend`,{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(e=>`rid`in e?[e.rid,e.kind]:e)})}async insert(e,t){return W(`plugin:menu|insert`,{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(e=>`rid`in e?[e.rid,e.kind]:e),position:t})}async remove(e){return W(`plugin:menu|remove`,{rid:this.rid,kind:this.kind,item:[e.rid,e.kind]})}async removeAt(e){return W(`plugin:menu|remove_at`,{rid:this.rid,kind:this.kind,position:e}).then(y8)}async items(){return W(`plugin:menu|items`,{rid:this.rid,kind:this.kind}).then(e=>e.map(y8))}async get(e){return W(`plugin:menu|get`,{rid:this.rid,kind:this.kind,id:e}).then(e=>e?y8(e):null)}async popup(e,t){return W(`plugin:menu|popup`,{rid:this.rid,kind:this.kind,window:t?.label??null,at:e instanceof o8?e:e?new o8(e):null})}async setAsWindowsMenuForNSApp(){return W(`plugin:menu|set_as_windows_menu_for_nsapp`,{rid:this.rid})}async setAsHelpMenuForNSApp(){return W(`plugin:menu|set_as_help_menu_for_nsapp`,{rid:this.rid})}async setIcon(e){return W(`plugin:menu|set_icon`,{rid:this.rid,kind:this.kind,icon:c8(e)})}}})),h5t,g5t=t((()=>{m5t(),M8t(),e8(),v8(),h5t=class e extends _8{constructor(e,t){super(e,t,`Menu`)}static async new(t){return m8(`Menu`,t).then(([t,n])=>new e(t,n))}static async default(){return W(`plugin:menu|create_default`).then(([t,n])=>new e(t,n))}async append(e){return W(`plugin:menu|append`,{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(e=>`rid`in e?[e.rid,e.kind]:e)})}async prepend(e){return W(`plugin:menu|prepend`,{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(e=>`rid`in e?[e.rid,e.kind]:e)})}async insert(e,t){return W(`plugin:menu|insert`,{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(e=>`rid`in e?[e.rid,e.kind]:e),position:t})}async remove(e){return W(`plugin:menu|remove`,{rid:this.rid,kind:this.kind,item:[e.rid,e.kind]})}async removeAt(e){return W(`plugin:menu|remove_at`,{rid:this.rid,kind:this.kind,position:e}).then(y8)}async items(){return W(`plugin:menu|items`,{rid:this.rid,kind:this.kind}).then(e=>e.map(y8))}async get(e){return W(`plugin:menu|get`,{rid:this.rid,kind:this.kind,id:e}).then(e=>e?y8(e):null)}async popup(e,t){return W(`plugin:menu|popup`,{rid:this.rid,kind:this.kind,window:t?.label??null,at:e instanceof o8?e:e?new o8(e):null})}async setAsAppMenu(){return W(`plugin:menu|set_as_app_menu`,{rid:this.rid}).then(t=>t?new e(t[0],t[1]):null)}async setAsWindowMenu(t){return W(`plugin:menu|set_as_window_menu`,{rid:this.rid,window:t?.label??null}).then(t=>t?new e(t[0],t[1]):null)}}})),_5t=n({CheckMenuItem:()=>o5t,IconMenuItem:()=>l5t,Menu:()=>h5t,MenuItem:()=>i5t,NativeIcon:()=>c5t,PredefinedMenuItem:()=>d5t,Submenu:()=>p5t,itemFromKind:()=>y8}),v5t=t((()=>{m5t(),a5t(),g5t(),s5t(),u5t(),f5t()})),y5t=()=>`__TAURI_INTERNALS__`in window&&/Mac/.test(navigator.platform)&&!x5t(),b5t=`formdesign.menusInWindow`;function x5t(){try{return localStorage.getItem(b5t)===`1`}catch{return!1}}function S5t(e){if(!e)return null;let t=e.endsWith(`++`)?[...e.slice(0,-2).split(`+`),`Plus`]:e.split(`+`),n={Mod:`CmdOrCtrl`,Alt:`Alt`,Shift:`Shift`,Ctrl:`Ctrl`,"=":`=`,"-":`-`,"[":`[`,"]":`]`,",":`,`,".":`.`,"/":`/`,Delete:`Delete`,Backspace:`Backspace`,Escape:`Escape`,Enter:`Enter`,Tab:`Tab`,Space:`Space`,Plus:`Plus`},r=[];for(let e of t)if(n[e])r.push(n[e]);else if(/^[A-Za-z0-9]$/.test(e))r.push(e.toUpperCase());else if(/^F([1-9]|1[0-2])$/.test(e))r.push(e);else return null;return r.join(`+`)}var C5t={"ui.undo":`undo`,"ui.redo":`redo`,"edit.cut":`cut`,"edit.copy":`copy`,"edit.paste":`paste`,"edit.selectAll":`select-all`},w5t=new Set([`button`,`checkbox`,`radio`,`range`,`color`,`file`,`submit`,`reset`,`image`]);function T5t(){let e=document.activeElement;return e instanceof HTMLTextAreaElement?!e.readOnly&&!e.disabled:e instanceof HTMLInputElement?!w5t.has(e.type)&&!e.readOnly&&!e.disabled:e instanceof HTMLElement&&e.isContentEditable}var E5t=class{commands;menus;before;items=[];building=!1;again=!1;stateTimer=0;needCore=!1;constructor(e,t,n=()=>Promise.resolve()){this.commands=e,this.menus=t,this.before=n;for(let e of[`pointerup`,`keyup`,`focusin`,`focusout`])window.addEventListener(e,()=>{this.items.length&&this.refresh()},{passive:!0})}async build(){if(this.building)this.again=!0;else{this.building=!0;try{let e=await P(()=>Promise.resolve().then(()=>(v5t(),_5t)),void 0,{}.url),t=[],n=async r=>{if(r===`-`)return e.PredefinedMenuItem.new({item:`Separator`});if(typeof r==`object`)return e.Submenu.new({text:F(r.label),items:(await Promise.all(r.items.map(n))).filter(Boolean)});let i=this.commands.get(r);if(!i)return null;let a=F(this.commands.label(i)),o=S5t(i.keys?.[0]),s={text:a,enabled:this.enabled(r),action:()=>{let e=C5t[r];e&&T5t()?P(()=>Promise.resolve().then(()=>(e8(),T8t)).then(t=>t.invoke(`text_edit`,{action:e})),void 0,{}.url).catch(()=>{document.execCommand(e===`select-all`?`selectAll`:e)}):this.commands.run(r),this.refresh()}},c;if(i.checked){let t={...s,checked:!!i.checked()};try{c=await e.CheckMenuItem.new(o?{...t,accelerator:o}:t)}catch{c=await e.CheckMenuItem.new(t)}}else try{c=await e.MenuItem.new(o?{...s,accelerator:o}:s)}catch{c=await e.MenuItem.new(s)}return t.push({id:r,text:a,item:c}),c},r=[];r.push(await e.Submenu.new({text:`FormDesign`,items:[await e.PredefinedMenuItem.new({item:{About:{name:`FormDesign`}},text:F(`About FormDesign`)}),await e.PredefinedMenuItem.new({item:`Separator`}),...this.commands.get(`ui.prefs`)?[await n(`ui.prefs`)]:[],await e.PredefinedMenuItem.new({item:`Separator`}),await e.PredefinedMenuItem.new({item:`Hide`}),await e.PredefinedMenuItem.new({item:`Quit`})]}));for(let t of this.menus()){let i=typeof t.items==`function`?t.items():t.items;r.push(await e.Submenu.new({text:F(t.label),items:(await Promise.all(i.map(n))).filter(Boolean)}))}await(await e.Menu.new({items:r})).setAsAppMenu(),this.items=t,document.documentElement.classList.add(`has-native-menus`)}finally{this.building=!1,this.again&&(this.again=!1,this.build())}}}enabled(e){if(C5t[e]&&T5t())return!0;let t=this.commands.get(e);return!!t&&this.commands.enabled(t)}refresh(e=!1){e&&(this.needCore=!0),!this.stateTimer&&(this.stateTimer=window.setTimeout(()=>{this.stateTimer=0;let e=this.needCore;this.needCore=!1,(e?this.before():Promise.resolve()).then(()=>{for(let e of this.items){let t=this.commands.get(e.id);if(!t)continue;e.item.setEnabled(this.enabled(e.id)).catch(()=>void 0),t.checked&&e.item.setChecked&&e.item.setChecked(!!t.checked()).catch(()=>void 0);let n=F(this.commands.label(t));n!==e.text&&e.item.setText&&(e.text=n,e.item.setText(n).catch(()=>void 0))}})},150))}},D5t=/\.(pdf|pub|qxd|qxp|pmd|p65|pm6|pm5|pm4|pm3|pt5|pt6|dxf|dwg|indd|indt|indb|inx)$/i,O5t=`.pdf,.pub,.qxd,.qxp,.pmd,.p65,.pm6,.pm5,.pm4,.pm3,.pt5,.pt6,.dxf,.dwg,.indd,.indt,.indb,.inx`,k5t={pdf:`PDF`,pub:`.pub file`,qxp:`.qxd or .qxp file`,pm:`.pmd or .p65 file`};function b8(e,t){return`
${b(e.source)} was rebuilt as an editable document with ${e.pages} page${e.pages===1?``:`s`}${e.via?` through ${b(e.via)}`:``}.
`];i.push(`
Converted
`),i.push(n.length?n.map(([e,t])=>b8(e,String(t))).join(``):b8(`Nothing editable was found`,``)),i.push(`
Kept as a backdrop
`),i.push(r.length?r.map(([e,t])=>b8(e,String(t))).join(``)+b8(`Backdrop pages`,String(e.backdropPages)):b8(`Nothing needed a backdrop`,``)),e.substituted.length&&(i.push(`
`));let r=f(``);r.addEventListener(`click`,()=>t.close()),t.foot.append(r),t.onClose=()=>t.scrim.remove(),t.open(r)}function M5t(e){let t=new k(e.kind===`pdf`?`Open PDF`:`Open ${k5t[e.kind]??`file`}`,480),n=e.kind===`pdf`?`Open ${b(e.name)} as a layout${e.pages?` (${e.pages} page${e.pages===1?``:`s`})`:``}: every page becomes a page of the same size, text becomes text frames grouped into lines and paragraphs, pictures are placed at their boxes, and simple rectangles and lines become shapes.`:`${b(e.name)} is converted through LibreOffice into an editable document: pages, text frames, pictures and shapes.`;t.body.append(f(`
${n}
`));let r=p(t.body,`.fd-open-backdrop`),i=f(``),a=f(``);return t.foot.append(a,i),new Promise(e=>{a.addEventListener(`click`,()=>{t.close(),e(null)}),i.addEventListener(`click`,()=>{let n=r.value;e({backdrop:n}),t.close()}),t.onClose=()=>{t.scrim.remove(),e(null)},t.open(i)})}async function N5t(e,t){let n=new FormData;n.append(`files`,e,e.name);try{let r=(await w(`/files`,{method:`POST`,body:n})).files[0]?.path??``,i=await w(`/documents/probe`,{json:{path:r}});if(i.kind===`indd`){j5t(i);return}if(i.kind===`dwg`){x(i.message??``,`error`);return}let a=i.kind===`dxf`?{backdrop:`never`}:await M5t(i);if(!a)return;x(`Converting ${e.name}`);let o=await w(`/documents/import`,{json:{path:r,options:{backdrop:a.backdrop}}});t(),A5t(o.report)}catch(e){x(E(e.message),`error`)}}var P5t=`0.93.0`,F5t=[`File`,`Edit`,`Layout`,`Type`,`Object`,`Table`,`Effect`,`View`,`Window`,`Help`],I5t=/\.(fdes|fdoc|idml|pub|qxd|qxp|pmd|p65|dxf|dwg|indd)$/i;function L5t(e){if(!e)return null;let t=e.split(`+`),n=t.pop()??``;if(!n)return null;let r=e=>t.some(t=>t.toLowerCase()===e),i=[];(r(`alt`)||r(`option`)||r(`opt`))&&i.push(`Alt`),r(`shift`)&&i.push(`Shift`),(r(`cmd`)||r(`mod`)||!te&&r(`ctrl`))&&i.push(`Mod`);let a=n.length===1?n.toUpperCase():n;return i.push(a===`Esc`?`Escape`:a),i.join(`+`)}var R5t=class{root;commands=new n6t;viewport;input;editor=D;panels=[];groups=new Map;panelBodies=new Map;additions=[];overrides=new Map;controls=new Map;dropHandlers=[];placeHandlers=[];menubar=null;home;flyout=null;coreLoaded=!1;fileInput=f(``);endPick=null;stage;dock=null;groupMenu=null;palette=null;menuGroup=``;status;constructor(e){this.root=e,this.stage=p(e,`.fd-stage`),this.viewport=new I6t(this.stage,p(e,`.fd-tiles`),p(e,`.fd-hilite`),p(e,`.fd-overlay`)),this.input=new i6t(this.viewport,this.stage),this.status=new S8t(p(e,`.fd-status`),this.viewport),this.input.onKeyCommand=e=>this.onKeyCommand(e),this.input.keysOff=e=>this.home.isShown&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&!/^F\d{1,2}$/.test(e.key),e.appendChild(this.fileInput),this.home=new f8t(this.stage.parentElement,{run:(e,t)=>this.commands.run(e,t),recent:()=>this.recent,openRecent:e=>void this.openPath(e)}),this.captionButtons=new n5t(p(e,`.cv-titlebar`),()=>{try{return localStorage.getItem(`formdesign.customTitleBar`)===`1`}catch{return!1}}),this.uiCommands(),this.wire()}captionButtons;recent=[];registerPanel(e){this.panels.some(t=>t.id===e.id)||(this.panels.push(e),this.groups.size&&this.mountPanel(e))}showPanel(e){let t=this.panels.find(t=>t.id===e);if(!t)return;let n=[...R.all.values()].find(t=>t.root.querySelector(`[data-panel="${e}"]`));n&&(this.dock?.show(n.id),n.show(e),n.setMinimised(!1)),t.onShow?.()}panelOpen(e){let t=[...R.all.values()].find(t=>t.has(e));return!!t&&!this.dock?.isHidden(t.id)&&!t.minimised&&t.current===e}layout(){let e={},t={};for(let[n,r]of R.all){e[n]={tab:r.current,min:r.minimised};for(let e of r.tabIds)t[e]=n}return{dock:this.dock?.snapshot??{left:[],side:[],dock:[],hidden:[],heights:{},custom:[],width:null,collapsed:[]},groups:e,homes:t}}applyLayout(e){if(!this.dock)return;let t=e.dock?.custom??[];this.dock.setState({...e.dock,custom:t});for(let t of this.panels){let n=R.all.get(e.homes?.[t.id]??``)??R.all.get(t.group),r=[...R.all.values()].find(e=>e.has(t.id));n&&r&&n!==r&&!n.full&&R.moveTab(t.id,r,n)}R.saveHomes();for(let e of[...R.all.values()])/^g[0-9a-z]+$/.test(e.id)&&e.size===0&&!t.some(t=>t.id===e.id)&&e.remove();for(let[t,n]of R.all){let r=e.groups?.[t];r?.tab&&n.has(r.tab)&&n.show(r.tab),n.setMinimised(r?.min??R.startMin.has(t))}this.dock.refresh()}menuAreas(){let e=new Map;for(let t of F5t){let n=r=>{for(let i of r)typeof i==`string`?i!==`-`&&!e.has(i)&&e.set(i,t):n(i.items)};n(this.menuItems(t))}return e}addCommands(...e){this.commands.add(...e)}addMenuItems(e){this.additions.push(e)}override(e,t){this.overrides.set(e,t)}onDropFiles(e){this.dropHandlers.push(e)}onPlaceFile(e){this.placeHandlers.push(e)}setHint(e){this.status.setHint(e)}showHome(){this.home.show()}setControl(e,t,n=0){let r=p(this.root,`.fd-control`),i=this.controls.get(e);if(!t){i&&(i.node.remove(),this.controls.delete(e));return}if(i?.node===t)return;i?.node.remove(),this.controls.set(e,{node:t,priority:n});let a=[...this.controls.entries()].sort((e,t)=>t[1].priority-e[1].priority).map(([,e])=>e.node);for(let e of a)r.appendChild(e)}async runCore(e,t={}){try{let n=await T.call(`exec`,{command:e,params:t});return D.handleRequests(n.meta?.requests),D.schedule(),D.onExec?.(e,t),n.result}catch(n){let r=E(n.message),i=D.command(e);i&&/missing|needs|expected|required|no `/i.test(r)&&i.params&&i.params!==`{}`?this.paramsDialog(i,r,t):x(r,`error`);return}}pickFiles(e,t=!1){return new Promise(n=>{let r=this.fileInput;this.endPick?.(),r.value=``,r.accept=e,r.multiple=t;let i=e=>{r.removeEventListener(`change`,a),r.removeEventListener(`cancel`,o),this.endPick===o&&(this.endPick=null),n(e)},a=()=>i(Array.from(r.files??[])),o=()=>i([]);this.endPick=o,r.addEventListener(`change`,a),r.addEventListener(`cancel`,o),r.click()})}async upload(e){if(!e.length)return[];let t=new FormData;for(let n of e)t.append(`files`,n,n.name);return(await w(`/files`,{method:`POST`,body:t})).files.map(e=>e.path)}paramsDialog(e,t,n){e8t(this,e,t,n)}uiCommands(){let e=this.viewport,t=()=>D.hasDoc,n=t=>{e.opts[t]=!e.opts[t],t===`preview`&&e.invalidateAll(),e.drawOverlays(),e.refreshOverlays()};this.commands.add({id:`ui.home`,label:`Home`,run:()=>{this.home.show(),this.loadRecent()}},{id:`ui.open`,label:`Open…`,keys:[`Mod+O`],run:()=>void this.openDialog()},{id:`ui.save`,label:`Save`,keys:[`Mod+S`],enabled:t,run:()=>void this.save(!1)},{id:`ui.saveAs`,label:`Save As…`,keys:[`Shift+Mod+S`],enabled:t,run:()=>void this.save(!0)},{id:`ui.close`,label:`Close`,keys:[`Mod+W`],enabled:t,run:()=>void this.closeDoc(D.active??0)},{id:`ui.place`,label:`Place…`,keys:[`Mod+D`],enabled:t,run:()=>void this.place()},{id:`ui.undo`,label:()=>D.doc?.undoLabel?`Undo ${D.doc.undoLabel}`:`Undo`,keys:[`Mod+Z`],enabled:()=>!!D.doc?.canUndo,run:()=>void D.exec(`edit.undo`)},{id:`ui.redo`,label:()=>D.doc?.redoLabel?`Redo ${D.doc.redoLabel}`:`Redo`,keys:[`Shift+Mod+Z`],enabled:()=>!!D.doc?.canRedo,run:()=>void D.exec(`edit.redo`)},{id:`ui.zoomIn`,label:`Zoom In`,keys:[`Mod+=`,`Mod++`],enabled:t,run:()=>e.zoomAt(1.25)},{id:`ui.zoomOut`,label:`Zoom Out`,keys:[`Mod+-`],enabled:t,run:()=>e.zoomAt(.8)},{id:`ui.fitPage`,label:`Fit Page in Window`,keys:[`Mod+0`],enabled:t,run:()=>e.fitPage()},{id:`ui.fitSpread`,label:`Fit Spread in Window`,keys:[`Alt+Mod+0`],enabled:t,run:()=>e.fitSpread()},{id:`ui.actualSize`,label:`Actual Size`,keys:[`Mod+1`],enabled:t,run:()=>e.zoomTo(1)},{id:`ui.fitAll`,label:`Entire Pasteboard`,keys:[`Alt+Shift+Mod+0`],enabled:t,run:()=>e.fitAll()},{id:`ui.guides`,label:`Guides and Margins`,keys:[`Mod+;`],checked:()=>e.opts.guides,run:()=>n(`guides`)},{id:`ui.frames`,label:`Frame Edges`,keys:[`Alt+Mod+H`],checked:()=>e.opts.frames,run:()=>n(`frames`)},{id:`ui.baseline`,label:`Baseline Grid`,keys:[`Alt+Mod+'`],checked:()=>e.opts.baseline,run:()=>n(`baseline`)},{id:`ui.threads`,label:`Text Threads`,keys:[`Alt+Mod+Y`],checked:()=>e.opts.threads,run:()=>n(`threads`)},{id:`ui.preview`,label:`Preview`,keys:[`W`],checked:()=>e.opts.preview,run:()=>n(`preview`)},{id:`ui.quality`,label:()=>e.opts.quality===`high`?`Typical Display`:`High Quality Display`,run:()=>{e.opts.quality=e.opts.quality===`high`?`typical`:`high`,e.invalidateAll()}},{id:`ui.prevPage`,label:`Previous Page`,keys:[`Shift+PageUp`],enabled:t,run:()=>this.stepPage(-1)},{id:`ui.nextPage`,label:`Next Page`,keys:[`Shift+PageDown`],enabled:t,run:()=>this.stepPage(1)},{id:`ui.panels`,label:`Hide Panels`,keys:[`Tab`],run:()=>this.root.classList.toggle(`is-panels-hidden`)},{id:`ui.customTitleBar`,label:`Custom Title Bar`,enabled:()=>t5t(),checked:()=>this.captionButtons.active,run:()=>{try{localStorage.setItem(`formdesign.customTitleBar`,this.captionButtons.active?`0`:`1`)}catch{}this.captionButtons.sync()}},{id:`ui.menusInWindow`,label:`Menus in Window`,enabled:()=>`__TAURI_INTERNALS__`in window&&/Mac/.test(navigator.platform),checked:x5t,run:()=>{let e=x5t()?`0`:`1`;try{localStorage.setItem(b5t,e)}catch{}x(e===`1`?`The menus stay in the window from the next start.`:`The menus go to the menu bar from the next start.`,`info`)}},{id:`ui.about`,label:`About FormDesign`,run:()=>x(`FormDesign ${P5t} · layout core ${D.coreVersion||`offline`} · Apache-2.0`)},{id:`ui.search`,label:`Search…`,keys:[`Mod+K`],run:()=>{this.palette??=new i8t(this.commands,()=>F5t.map(e=>({label:e,items:()=>this.menuItems(e)}))),this.palette.show()}},{id:`ui.collapseLeft`,keys:[`Alt+Shift+Mod+L`],label:()=>this.dock?.isCollapsed(`left`)?`Expand Left Panels`:`Collapse Left Panels to Minirail`,run:()=>this.dock?.setCollapsed(`left`,!this.dock.isCollapsed(`left`))},{id:`ui.collapseRight`,keys:[`Shift+Tab`],label:()=>this.dock?.isCollapsed(`dock`)?`Expand Right Panels`:`Collapse Right Panels to Icons`,run:()=>{let e=!this.dock?.isCollapsed(`dock`);this.dock?.setCollapsed(`side`,e),this.dock?.setCollapsed(`dock`,e)}},{id:`ui.group.close`,label:`Close Group`,run:()=>{this.menuGroup&&this.dock?.hide(this.menuGroup)}},{id:`ui.group.minimise`,label:()=>R.all.get(this.menuGroup)?.minimised?`Expand Group`:`Minimise Group`,run:()=>{let e=R.all.get(this.menuGroup);e?.setMinimised(!e.minimised)}})}stepPage(e){let t=D.layout?.pages.length??0;if(!t)return;let n=this.viewport.currentPage();this.viewport.showPage(Math.max(0,Math.min(t-1,n+e)))}onKeyCommand(e){if(this.menubar?.isOpen)return!1;let t=e6t(e);if(D.wantsText&&!/Mod\+|(^|\+)F\d{1,2}$/.test(t)&&t!==`Escape`||t===`Tab`&&D.wantsText||D.tool===`artboard`&&(t===`Delete`||t===`Backspace`))return!1;let n=this.commands.forCombo(t);if(!n)return this.commands.released(t);let r=D.command(n.id);return r&&!r.enabled&&!this.overrides.has(n.id)?(this.refreshEnabled().then(()=>{this.commands.run(n.id)}),!0):this.commands.run(n.id)||!0}addCoreCommands(){if(this.coreLoaded||!D.commands.length)return;this.coreLoaded=!0;let e=new Set(this.commands.all().flatMap(e=>e.keys??[]));for(let t of D.commands){if(this.commands.get(t.id))continue;let n=L5t(t.shortcut),r=n&&!e.has(n)?[n]:[];for(let t of r)e.add(t);this.commands.add({id:t.id,label:this.menuShape(t).label,keys:r,enabled:()=>D.command(t.id)?.enabled??!0,run:()=>{let e=this.overrides.get(t.id);e?e():$6t(t)?this.paramsDialog(t,``,{}):this.runCore(t.id)}})}}menuItems(e){let t=[],n=[],r=[];for(let i of this.additions.filter(t=>t.menu===e))(i.at===`top`?t:i.at===`start`?n:r).push(...i.items,`-`);let i=this.coreTree(e),a=this.uiMenu(e),o=[...t,...a.pre,...a.pre.length?[`-`]:[],...n,...i,...r.length?[`-`,...r]:[],...a.post.length?[`-`,...a.post]:[]],s=[];for(let e of o)(e!==`-`||s.length&&s[s.length-1]!==`-`)&&s.push(e);for(;s.length&&s[s.length-1]===`-`;)s.pop();return s}uiMenu(e){switch(e){case`File`:return{pre:[`ui.open`,`ui.close`,`ui.save`,`ui.saveAs`,`-`,`ui.place`],post:[]};case`Edit`:return{pre:[`ui.undo`,`ui.redo`],post:[`ui.search`,`ui.shortcuts`]};case`View`:return{pre:[`ui.zoomIn`,`ui.zoomOut`,`ui.fitPage`,`ui.fitSpread`,`ui.actualSize`,`ui.fitAll`,`-`,`ui.preview`,`ui.quality`,`-`,`ui.rulers`,`ui.guides`,`ui.frames`,`ui.baseline`,`ui.threads`,`-`,`ui.prevPage`,`ui.nextPage`],post:[`ui.customTitleBar`,`ui.menusInWindow`]};case`Window`:return{pre:this.panels.map(e=>`ui.panel.${e.id}`),post:[`ui.collapseLeft`,`ui.collapseRight`,`ui.panels`,`ui.home`]};case`Help`:return{pre:[`ui.about`],post:[]};default:return{pre:[],post:[]}}}prefixCache=null;menuShape(e){let t=(e.menu??[]).slice(1);if(!t.length)return{subs:[],label:e.label};if(!this.prefixCache){let e=new Set;for(let t of D.commands)for(let n=2;n<(t.menu?.length??0);n++)e.add(t.menu.slice(0,n).join(`>`));this.prefixCache=e}return this.prefixCache.has(e.menu.join(`>`))?{subs:t,label:e.label}:{subs:t.slice(0,-1),label:t[t.length-1].replace(/\.\.\.$/,`…`)}}coreTree(e){let t=new Set([`file.open`,`file.save`,`file.saveAs`,`file.close`,`edit.undo`,`edit.redo`,`file.place`]),n=[],r=new Map;for(let i of D.commands){if(!i.menu?.length||i.menu[0]!==e||t.has(i.id))continue;if(i.menu.length===1){n.push(i.id);continue}let a=this.menuShape(i).subs,o=n,s=e;for(let e of a){s+=`>`+e;let t=r.get(s);t||(t={label:e,items:[]},r.set(s,t),o.push(t)),o=t.items}o.push(i.id)}return n}buildMenus(){if(this.menubar)return;for(let e of this.panels)this.commands.get(`ui.panel.${e.id}`)||this.commands.add({id:`ui.panel.${e.id}`,label:e.label,checked:()=>this.panelOpen(e.id),run:()=>this.showPanel(e.id)});let e=F5t.map(e=>({label:e,items:()=>this.menuItems(e)}));if(this.menubar=new o0t(p(this.root,`.cv-menubar`),this.commands,e),this.menubar.onBeforeOpen=()=>void this.refreshEnabled().then(()=>this.menubar?.refreshOpen()),y5t()){let t=new E5t(this.commands,()=>e,()=>this.refreshEnabled());t.build().catch(()=>void 0);for(let e of[`docs`,`selection`,`tool`,`layout`])D.on(e,()=>t.refresh(!0));D.on(`commands`,()=>{t.build().catch(()=>void 0)}),k$t(()=>{t.build().catch(()=>void 0)})}}enabling=null;async refreshEnabled(){return this.enabling||=(async()=>{try{let e=await T.call(`commands`,{}),t=Array.isArray(e.result)?e.result:e.result.commands;for(let e of t){let t=D.command(e.id);t&&(t.enabled=e.enabled)}}catch{}})().finally(()=>{this.enabling=null}),this.enabling}mountPanels(){let e=p(this.root,`.fd-left-col`),t=p(this.root,`.cv-props-col`),n=p(this.root,`.cv-layers`),r=r=>r===`left`?e:r===`side`?t:n;R.startMin=new Set([`swatches`,`preflight`,`typeextra`,`review`,`interactive`,`xml`,`library`,`connect`]);let i=new Map;for(let e of[...this.panels].sort((e,t)=>(e.order??50)-(t.order??50))){let t=i.get(e.group)??[];t.push(e),i.set(e.group,t)}for(let[e,t]of i){let n=t.map(e=>{let t=e.create();return t.dataset.panel=e.id,this.panelBodies.set(e.id,t),{id:e.id,label:e.label,body:t}}),i=new R(r(t[0].column),e,n,t.map(e=>e.label).join(`, `));i.onTab=e=>this.panels.find(t=>t.id===e)?.onShow?.(),this.groupMenuFor(i),this.groups.set(e,i)}let a=(e,t,n)=>{let r=new R(e,t,[],n);return r.onTab=e=>this.panels.find(t=>t.id===e)?.onShow?.(),this.groupMenuFor(r),r},o=new b8t(this.root,{left:e,side:t,dock:n},p(this.root,`.cv-resizer`),a,p(this.root,`.fd-minirail`));this.dock=o,R.restoreHomes(),R.onMoved=()=>o.refresh(),R.onGapHint=(e,t)=>{e===null?o.hideGap():o.showGap(e,t,`New group`)},R.onDetach=(e,t,n,r)=>{let i=o.gapAt(n,r);if(!i||t.size<2)return!1;let s=`g${Date.now().toString(36)}`,c=t.labelOf(e),l=a(i.host,s,c);return o.addCustom(s,c,i.col,i.index),R.moveTab(e,t,l),!0},o.refresh()}groupMenuFor(e){p(e.root,`.cv-group-head`).addEventListener(`contextmenu`,t=>{t.preventDefault(),this.menuGroup=e.id,this.groupMenu??=new i0t(this.commands,null,!0),this.groupMenu.setItems([`ui.group.close`,`ui.group.minimise`]),this.groupMenu.openAt(t.clientX,t.clientY)})}mountPanel(e){let t=this.groups.get(e.group),n=e.create();n.dataset.panel=e.id,this.panelBodies.set(e.id,n),t?t.addTab(e.id,e.label,n):this.groups.set(e.group,new R(p(this.root,e.column===`left`?`.fd-left-col`:e.column===`side`?`.cv-props-col`:`.cv-layers`),e.group,[{id:e.id,label:e.label,body:n}],e.label))}wire(){let e=this.root;e.addEventListener(`click`,t=>{let n=t.target.closest(`[data-cmd]`);if(!n||!e.contains(n)||n.closest(`.cv-group`))return;let r=n.dataset.cmd,i={home:`ui.home`,undo:`ui.undo`,redo:`ui.redo`,"zoom-in":`ui.zoomIn`,"zoom-out":`ui.zoomOut`,"fit-spread":`ui.fitSpread`,make:`ui.make`,settings:`ui.prefs`,new:`ui.templates`,claude:`ui.terminal.claude`,terminal:`ui.terminal.toggle`};i[r]&&this.commands.run(i[r])}),D.on(`commands`,()=>{this.addCoreCommands(),this.buildMenus(),this.publishActions()}),T.on(`view`,e=>this.agentView(e)),D.on(`docs`,()=>{this.syncTabs(),this.home.sync(D.docs.length),this.syncTitle(),D.docs.length||this.loadRecent()}),D.on(`tool`,()=>this.syncTools()),D.on(`commands`,()=>this.renderTools()),D.on(`connection`,e=>this.syncStatus(e)),D.on(`layout`,()=>this.syncPageLabel()),D.on(`request`,e=>this.onRequest(e)),this.viewport.onView=()=>{this.syncZoom(),this.syncPageLabel()},T.on(`close`,()=>this.syncStatus(!1)),this.syncStatus(!1),s(p(e,`.fd-st-version`),`FormDesign ${P5t}`),window.addEventListener(`dragover`,t=>{t.dataTransfer?.types.includes(`Files`)&&(t.preventDefault(),m(p(e,`.cv-drop`),!1))}),window.addEventListener(`dragleave`,t=>{t.relatedTarget||m(p(e,`.cv-drop`),!0)}),window.addEventListener(`drop`,t=>{t.preventDefault(),m(p(e,`.cv-drop`),!0);let n=Array.from(t.dataTransfer?.files??[]);n.length&&this.dropFiles(n)}),window.addEventListener(`paste`,e=>{let t=e.target;if(t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`))return;let n=e.clipboardData?.getData(`text/plain`)??``;D.wantsText&&n&&(e.preventDefault(),this.input.paste(n))}),window.addEventListener(`beforeunload`,e=>{D.docs.some(e=>e.dirty)&&!(`__TAURI_INTERNALS__`in window)&&e.preventDefault()}),this.loadRecent()}published=!1;publishTimer=0;publishActions(){this.menubar&&(this.published||(this.published=!0,this.commands.onChange=()=>{window.clearTimeout(this.publishTimer),this.publishTimer=window.setTimeout(()=>this.sendCatalogue(),400)},T.on(`command`,e=>void this.runForAgent(e)),T.on(`open`,()=>this.sendCatalogue())),this.sendCatalogue())}sendCatalogue(){let e=this.menuAreas(),t=this.commands.all().filter(e=>!D.command(e.id)),n=t.map(t=>({id:t.id,label:this.commands.label(t),keys:t.keys??[],menu:e.get(t.id)??``})),r=t.map(e=>({...n.find(t=>t.id===e.id),group:e.group??(e.id.startsWith(`tool.`)?`tool`:e.id.split(`.`)[0]===`ui`?`window`:e.id.split(`.`)[0]),description:e.description??``,when:e.when??``,params:e.params??{},mutates:e.mutates??!1,risky:e.risky??!1}));w(`/actions/window`,{method:`POST`,json:{actions:n}}).catch(()=>void 0),w(`/commands/catalogue`,{method:`POST`,json:{commands:r}}).catch(()=>void 0)}async runForAgent(e){let t;try{let n=this.commands.get(e.id);t=n?this.commands.enabled(n)?await this.commands.call(e.id,e.params):{ran:!1,error:this.commands.why(n)||`${e.id} is not available right now`}:{ran:!1,error:`no window command ${e.id}`}}catch(e){t={ran:!1,error:e.message}}await w(`/commands/reply/${e.rid}`,{method:`POST`,json:t}).catch(()=>void 0)}agentView(e){if(e.panel&&this.showPanel(e.panel),e.tool&&D.setTool(e.tool),!D.hasDoc)return;typeof e.page==`number`&&this.viewport.showPage(e.page);let t=String(e.zoom??``).trim().toLowerCase();t===`fit-page`?this.viewport.fitPage():t===`fit-spread`?this.viewport.fitSpread():/^\d+(\.\d+)?%?$/.test(t)&&this.viewport.zoomTo(Math.max(.05,Math.min(40,parseFloat(t)/100)))}async loadRecent(){try{this.recent=await w(`/documents/recent`)}catch{this.recent=[]}this.home.sync(D.docs.length)}async dropFiles(e){let t=e.filter(e=>I5t.test(e.name));if(t.length===e.length)for(let e of t)await this.openFile(e);else{for(let t of this.dropHandlers)if(t(e))return;x(`Drop files on the Make panel to lay them out`)}}async openFile(e){if(D5t.test(e.name)){await N5t(e,()=>D.refreshMeta());return}let t=new FormData;t.append(`file`,e,e.name);try{await w(`/documents/upload`,{method:`POST`,body:t}),D.refreshMeta()}catch(e){x(E(e.message),`error`)}}async openPath(e){try{await w(`/documents/open`,{json:{path:e}}),D.refreshMeta()}catch(e){x(E(e.message),`error`)}}async openDialog(){let e=await this.pickFiles(`.fdes,.fdoc,.idml,${O5t}`,!0);for(let t of e)await this.openFile(t)}async save(e){let t=D.doc;if(!t)return!1;let n;if(e||!t.path||!/\.fdes$/i.test(t.path)){let r=new k(e?`Save As`:`Save`,460);r.body.append(f(`
A .fdes file keeps the layout, its slots and the content it was made from. End the name with .idml for an IDML package or .fdoc for the bare layout.
`));let i=p(r.body,`.fd-save-path`),a=``;try{a=(await w(`/capabilities`)).paths?.projects??``}catch{}let o=(t.title||`Untitled`).replace(/\.(fdes|fdoc|idml)$/i,``);i.value=t.path&&/\.fdes$/i.test(t.path)?t.path:`${a?a.replace(/[\\/]$/,``)+(a.includes(`\\`)?`\\`:`/`):``}${o}.fdes`;let s=f(``),c=f(``);r.foot.append(c,s);let l=await new Promise(e=>{c.addEventListener(`click`,()=>{r.close(),e(null)}),s.addEventListener(`click`,()=>{e(i.value.trim()||null),r.close()}),i.addEventListener(`keydown`,e=>{e.key===`Enter`&&s.click()}),r.onClose=()=>{r.scrim.remove(),e(null)},r.open(i)});if(!l)return!1;n=l}try{return x(`Saved ${(await w(`/documents/save`,{json:n?{path:n}:{}})).path}`),D.refreshMeta(),!0}catch(e){return x(E(e.message),`error`),!1}}async closeDoc(e){let t=D.docs[e];if(t){if(t.dirty){D.active!==e&&await D.activate(e);let n=await wee(t.title);if(n===`cancel`||n===`save`&&!await this.save(!1))return}try{await w(`/documents/close`,{json:{index:e}})}catch(e){x(E(e.message),`error`)}D.refreshMeta()}}async place(){let e=await this.pickFiles(`image/*,video/*,audio/*,.pdf,.svg,.eps,.txt,.md,.docx,.rtf,.csv,.xlsx,.idml,.html`,!0);if(e.length)try{let t=await this.upload(e),n=!1;if(t.length===1){for(let e of this.placeHandlers)if(await e(t[0])){n=!0;break}}if(n)return;t.length>1?await this.runCore(`place.load`,{paths:t}):await this.runCore(`file.place`,{path:t[0]}),this.setHint(`Click or drag to place the loaded content`)}catch(e){x(E(e.message),`error`)}}onRequest(e){let t=e?.kind??Object.keys(e??{})[0];if(t===`toast`){let t=typeof e.text==`string`?E(e.text).trim():``;t&&x(t,`error`)}else if(t===`pick`&&(e.purpose??e.pick?.purpose)===`place`)this.place();else if(t===`view`){let t=e.params??{};typeof t.page==`number`&&this.viewport.showPage(t.page)}else if(t===`dialog`){let t=String(e.id??``),n=D.commands.find(e=>e.id===t||e.id.endsWith(`.${t}`));n&&this.paramsDialog(n,`Set the options, then run.`,e.params??{})}}renderTools(){let e=p(this.root,`.cv-rail-tools`);if(e.childElementCount||!D.tools.length)return;D.tools.forEach((t,n)=>{if(!t.length){e.appendChild(f(``));return}let r=t[0],i=f(``);i.dataset.group=String(n),i.dataset.tool=r.id,g(i,r.shortcut?`${r.label} (${r.shortcut})`:r.label),i.addEventListener(`click`,()=>void D.setTool(i.dataset.tool));let a=0,o=()=>this.toolFlyout(i,t);i.addEventListener(`pointerdown`,()=>{t.length>1&&(a=window.setTimeout(o,380))}),i.addEventListener(`pointerup`,()=>window.clearTimeout(a)),i.addEventListener(`pointerleave`,()=>window.clearTimeout(a)),i.addEventListener(`contextmenu`,e=>{e.preventDefault(),t.length>1&&o()}),e.appendChild(i)});let t=p(this.root,`.fd-fillstroke`);t.childElementCount||t.append(f(`${a3(`fill-stroke`,22)}`)),this.syncTools()}toolFlyout(e,t){this.flyout?.remove();let n=f(``);for(let r of t){let t=f(``);s(t.querySelectorAll(`span`)[0],r.label),s(p(t,`.cv-flyout-key`),r.shortcut??``),t.addEventListener(`click`,()=>{e.dataset.tool=r.id,e.innerHTML=a3(r.icon,20),g(e,r.shortcut?`${r.label} (${r.shortcut})`:r.label),D.setTool(r.id),n.remove(),this.flyout=null}),n.appendChild(t)}document.getElementById(`overlay-root`)?.appendChild(n);let r=e.getBoundingClientRect();n.style.left=`${Math.round(r.right+6)}px`,n.style.top=`${Math.round(r.top)}px`,this.flyout=n;let i=e=>{n.contains(e.target)||(n.remove(),this.flyout=null,document.removeEventListener(`pointerdown`,i,!0))};window.setTimeout(()=>document.addEventListener(`pointerdown`,i,!0),0)}syncTools(){let e=p(this.root,`.cv-rail-tools`);for(let t of Array.from(e.querySelectorAll(`.cv-tool`))){let e=(D.tools[Number(t.dataset.group)]??[]).find(e=>e.id===D.tool);e&&t.dataset.tool!==e.id&&(t.dataset.tool=e.id,t.innerHTML=a3(e.icon,20),g(t,e.shortcut?`${e.label} (${e.shortcut})`:e.label)),c(t,`is-active`,!!e)}let t=D.tools.flat().find(e=>e.id===D.tool);this.setHint(t?t.label:``)}syncTabs(){a(p(this.root,`.cv-tab-strip`),D.docs,{key:e=>String(e.uid),create:e=>{let t=f(`
`);return t.addEventListener(`click`,e=>{let n=D.docs.findIndex(e=>String(e.uid)===t.dataset.key);e.target.closest(`.cv-tab-close`)?this.closeDoc(n):n>=0&&n!==D.active&&D.activate(n)}),this.updateTab(t,e),t},update:(e,t)=>this.updateTab(e,t)})}updateTab(e,t){s(p(e,`.cv-tab-name`),t.title||`Untitled`),g(e,t.path??t.title),c(e,`is-dirty`,t.dirty),c(e,`is-active`,D.docs[D.active??-1]?.uid===t.uid)}syncTitle(){let e=D.doc;document.title=e?`${e.dirty?`• `:``}${e.title} · FormDesign`:`FormDesign`}syncZoom(){s(p(this.root,`.fd-zoom-label`),D.hasDoc?`${Math.round(this.viewport.view.zoom*100)}%`:``),this.status.syncView()}syncPageLabel(){let e=D.layout,t=p(this.root,`.fd-st-page`);if(!e||!e.pages.length){s(t,``);return}let n=this.viewport.currentPage(),r=e.pages.find(e=>e.abs===n);s(t,r?r.name===String(r.abs+1)?`Page ${r.name} of ${e.pages.length}`:`Page ${r.name} (${r.abs+1} of ${e.pages.length})`:``)}syncStatus(e){let t=p(this.root,`.fd-st-engine`);e?s(t,D.coreVersion?`Layout core ${D.coreVersion}`:`Engine ready`):s(t,T.connected?`Engine running`:`Connecting to the engine (./formdesign boot)`),c(this.root,`is-offline`,!e)}},z5t=`formdesign.shortcuts.set`,x8=`formdesign.shortcuts.keys`,S8=[`File`,`Edit`,`Layout`,`Type`,`Object`,`Table`,`Effect`,`View`,`Window`,`Help`,`Tools`,`Other`],B5t=e=>{try{return localStorage.getItem(e)}catch{return null}},C8=(e,t)=>{try{localStorage.setItem(e,t)}catch{}},V5t=class{ws;sets;active;choose;changed;create;removeSet;d=new k(`Keyboard Shortcuts`,660);root=f(`
+
`,this.root.addEventListener(`click`,e=>{let t=e.target;if(t.closest(`[data-back]`)){this.forced=!1,this.sync(this.docs);return}let n=t.closest(`[data-v]`)?.dataset.v;if(n){this.show(n);return}let r=t.closest(`[data-run]`)?.dataset.run;if(r){this.d.run(r);return}let i=t.closest(`[data-category]`)?.dataset.category;if(i){this.d.run(`ui.templates`,{category:i});return}let a=t.closest(`[data-path]`)?.dataset.path;a&&this.d.openRecent(a)}),e.appendChild(this.root),this.sidePanel(),document.addEventListener(`keydown`,e=>{e.key===`Escape`&&this.forced&&this.docs>0&&!this.root.hidden&&(this.forced=!1,this.sync(this.docs))}),this.paint(),k$t(()=>{this.paint(),this.tplAsked=!1,this.isShown&&this.templates()})}get isShown(){return!this.root.hidden}show(e){e&&e!==this.page&&(this.page=e,this.paint()),this.forced=!0,this.sync(this.docs)}sync(e){e>this.docs&&(this.forced=!1),this.docs=e;let t=this.forced||e===0;t&&this.root.hidden&&this.paint(),t&&(this.fill(),this.templates()),m(this.root,!t);for(let t of Array.from(this.root.querySelectorAll(`[data-back]`)))m(t,e===0)}paint(){for(let e of Array.from(this.root.querySelectorAll(`.cv-home-page`)))m(e,e.dataset.page!==this.page);for(let e of Array.from(this.root.querySelectorAll(`.cv-home-nav-item[data-v]`)))c(e,`is-active`,e.dataset.v===this.page);let e=new Date().getHours();s(this.root.querySelector(`[data-page="start"] .cv-home-title`),F(e<12?`Good morning`:e<18?`Good afternoon`:`Good evening`))}fill(){let e=this.d.recent(),t=JSON.stringify(e);if(t!==this.listKey){this.listKey=t;for(let t of Array.from(this.root.querySelectorAll(`[data-count="recent"]`)))s(t,String(e.length));for(let[t,n]of[[`start`,e.slice(0,8)],[`recent`,e]])m(this.root.querySelector(`[data-empty="${t}"]`),n.length>0),a(this.root.querySelector(`[data-files="${t}"]`),n,{key:e=>e.path,create:e=>this.card(e),update:(e,t)=>{s(e.querySelector(`.cv-home-file-when`),p8t(t.modified)),this.thumb(e,t)}})}}card(e){let t=f(``);return t.dataset.path=e.path,s(t.querySelector(`.cv-home-file-name`),e.name),s(t.querySelector(`.cv-home-file-when`),p8t(e.modified)),this.thumb(t,e),t}thumb(e,t){if(!/\.fdes$/i.test(t.path))return;let n=e.querySelector(`img`),r=`/api/home/thumb?path=${encodeURIComponent(t.path)}&v=${t.modified??0}`;n.dataset.src!==r&&(n.dataset.src=r,o(n,r).then(()=>{m(n,!1),c(e,`has-thumb`,!0)},()=>void 0))}templates(){if(!this.tplAsked){this.tplAsked=!0;for(let e of Array.from(this.root.querySelectorAll(`.cv-home-demo-pic img[data-src]`)))e.getAttribute(`src`)||o(e,e.dataset.src??``).catch(()=>void 0);w(`/templates`).then(e=>{for(let t of Array.from(this.root.querySelectorAll(`[data-count="templates"]`)))s(t,String(e.total));for(let t of Array.from(this.root.querySelectorAll(`[data-cat]`)))s(t,e.categories[t.dataset.cat??``]?F(`{n} templates`).replace(`{n}`,String(e.categories[t.dataset.cat??``])):``)},()=>{this.tplAsked=!1})}}sidePanel(){let e=this.root,t=e.querySelector(`.cv-home-resizer`),n=()=>{try{localStorage.setItem(u8t,e.style.getPropertyValue(`--fd-home-nav-w`)),localStorage.setItem(d8t,e.classList.contains(`is-nav-hidden`)?`1`:`0`)}catch{return}},r=t=>{c(e,`is-nav-hidden`,t),n()};try{let t=localStorage.getItem(u8t);t&&/^\d+px$/.test(t.trim())&&e.style.setProperty(`--fd-home-nav-w`,t.trim()),localStorage.getItem(d8t)===`1`&&e.classList.add(`is-nav-hidden`)}catch{}e.querySelector(`.cv-home-nav-hide`)?.addEventListener(`click`,()=>r(!0)),e.querySelector(`.cv-home-nav-show`)?.addEventListener(`click`,()=>r(!1)),t.addEventListener(`pointerdown`,r=>{r.preventDefault();let i=r.clientX,a=e.querySelector(`.cv-home-nav`)?.getBoundingClientRect().width||232;c(t,`is-dragging`,!0);let o=t=>{let n=a+t.clientX-i,r=n<120;c(e,`is-nav-hidden`,r),r||_(e,`--fd-home-nav-w`,`${Math.round(Math.max(180,Math.min(420,n)))}px`)},s=()=>{c(t,`is-dragging`,!1),window.removeEventListener(`pointermove`,o),window.removeEventListener(`pointerup`,s),n()};window.addEventListener(`pointermove`,o),window.addEventListener(`pointerup`,s)})}};function p8t(e){return e?new Date(e).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):``}var R6=[`left`,`side`,`dock`],m8t=252,h8t={pages:`layers`,make:`makeLayout`,props:`panelProps`,swatches:`swatchGrid`,preflight:`warning`,typeextra:`charA`,review:`check`,interactive:`play`,xml:`menu`,library:`folder`,connect:`agent`},g8t=`formdesign.dock`,z6=220,B6=560,_8t=/^g[0-9a-z]{1,16}$/,v8t=e=>Array.from(e.children).map(e=>e.dataset.group??``).filter(Boolean),y8t=e=>Object.fromEntries(Object.entries(e&&typeof e==`object`?e:{}).filter(([,e])=>typeof e==`number`&&Number.isFinite(e))),V6=e=>Array.isArray(e)?e.filter(e=>typeof e==`string`):[],b8t=class{root;cols;resizer;makeGroup;minirail;defaults;state;marker=f(``);splits=new Map;wired=new WeakSet;drag=null;ghost=null;suppressClick=!1;onChange=null;constructor(e,t,n,r,i){this.root=e,this.cols=t,this.resizer=n,this.makeGroup=r,this.minirail=i,this.defaults={left:v8t(t.left),side:v8t(t.side),dock:v8t(t.dock),hidden:[],heights:{},custom:[],width:null,collapsed:[]};let a={};try{a=JSON.parse(localStorage.getItem(g8t)??`{}`)}catch{a={}}for(let e of Array.isArray(a.custom)?a.custom:[])e&&_8t.test(String(e.id))&&typeof e.label==`string`&&!R.all.has(e.id)&&r(t.dock,e.id,e.label);this.state=this.merge(a),this.wireResizer(),this.wireLeftResizer(),window.addEventListener(`pointerup`,()=>{this.drag&&this.drop()}),this.apply()}known(){return[...R.all.keys()]}merge(e){let t=this.known(),n=e=>t.includes(e),r=!Array.isArray(e.left),i=r?[]:V6(e.left).filter(n),a=V6(e.side).filter(e=>n(e)&&!i.includes(e)),o=V6(e.dock).filter(e=>n(e)&&!i.includes(e)&&!a.includes(e)),s=e=>i.includes(e)||a.includes(e)||o.includes(e);if(r)for(let e of this.defaults.left)a.includes(e)&&a.splice(a.indexOf(e),1),o.includes(e)&&o.splice(o.indexOf(e),1),i.push(e);for(let e of this.defaults.left)s(e)||i.splice(Math.min(this.defaults.left.indexOf(e),i.length),0,e);for(let e of this.defaults.side)s(e)||a.splice(Math.min(this.defaults.side.indexOf(e),a.length),0,e);for(let e of t)if(!s(e)){let t=this.defaults.dock.indexOf(e);o.splice(t<0?o.length:Math.min(t,o.length),0,e)}let c=(Array.isArray(e.custom)?e.custom:[]).filter(e=>e&&n(e.id)&&_8t.test(e.id)).map(e=>({id:e.id,label:String(e.label).slice(0,80)})),l=typeof e.width==`number`&&e.width>=z6&&e.width<=B6?Math.round(e.width):null,u=V6(e.collapsed).filter(e=>R6.includes(e)),d=typeof e.leftWidth==`number`&&e.leftWidth>=z6&&e.leftWidth<=B6?Math.round(e.leftWidth):null;return{left:i,side:a,dock:o,hidden:V6(e.hidden).filter(n),heights:y8t(e.heights),custom:c,width:l,collapsed:u,leftWidth:d}}get snapshot(){return JSON.parse(JSON.stringify(this.state))}setState(e){for(let t of e.custom??[])_8t.test(t.id)&&!R.all.has(t.id)&&this.makeGroup(this.cols.dock,t.id,t.label);this.state=this.merge(e),this.save()}isHidden(e){return this.state.hidden.includes(e)}show(e){this.isHidden(e)&&(this.state.hidden=this.state.hidden.filter(t=>t!==e),this.save())}hide(e){this.isHidden(e)||(this.state.hidden=[...this.state.hidden,e],this.save())}refresh(){this.dropEmpty(),this.apply(),this.onChange?.()}addCustom(e,t,n,r){this.state.custom=[...this.state.custom,{id:e,label:t}],this.insert(e,n,r)}dropEmpty(){let e=this.state.custom.filter(e=>{let t=R.all.get(e.id);return t&&t.size>0?!0:(t?.remove(),!1)});if(e.length===this.state.custom.length)return;let t=new Set(this.state.custom.filter(t=>!e.includes(t)).map(e=>e.id));this.state={...this.state,custom:e,left:this.state.left.filter(e=>!t.has(e)),side:this.state.side.filter(e=>!t.has(e)),dock:this.state.dock.filter(e=>!t.has(e))},this.persist()}section(e){return R.all.get(e)?.root??null}present(e){let t=this.section(e);return!!t&&!this.isHidden(e)&&!t.classList.contains(`is-empty`)}shown(e){return this.state[e].filter(e=>this.present(e)).map(e=>this.section(e))}persist(){try{localStorage.setItem(g8t,JSON.stringify(this.state))}catch{}}save(){this.persist(),this.apply(),this.onChange?.()}apply(){this.closeFly();for(let e of R6){let t=this.cols[e],n=this.state[e].map(e=>this.section(e)).filter(e=>!!e),r=Array.from(t.children).filter(e=>n.includes(e));if(n.some((e,t)=>r[t]!==e))for(let e of n)t.appendChild(e)}for(let e of R.all.values()){m(e.root,!this.present(e.id)),this.wire(e);let t=this.state.heights[e.id],n=typeof t==`number`;c(e.root,`is-sized`,n);let r=n?`${Math.round(t)}px`:``;e.root.style.height!==r&&(e.root.style.height=r)}this.splitters(),this.state.width?_(this.root,`--cv-layers-w`,`${this.state.width}px`):this.root.style.getPropertyValue(`--cv-layers-w`)&&this.root.style.removeProperty(`--cv-layers-w`);for(let e of R6)c(this.cols[e],`is-collapsed`,this.isCollapsed(e));c(this.root,`is-side-collapsed`,this.isCollapsed(`side`)),c(this.root,`is-dock-collapsed`,this.isCollapsed(`dock`)),c(this.root,`is-dock-empty`,this.shown(`dock`).length===0&&!this.drag);let e=this.shown(`left`).length>0&&!this.isCollapsed(`left`);_(this.root,`--fd-left-w`,e?`${this.state.leftWidth??m8t}px`:`0px`),m(this.cols.left,!e),this.renderStrips()}isCollapsed(e){return this.state.collapsed.includes(e)}setCollapsed(e,t){this.isCollapsed(e)!==t&&(this.state.collapsed=t?[...this.state.collapsed,e]:this.state.collapsed.filter(t=>t!==e),this.save())}strips=new Map;collapseBtns=new Map;fly=null;flyOpen=null;closeFly(){let e=this.flyOpen;e&&(e.mark.replaceWith(e.s),e.btn.classList.remove(`is-on`),this.flyOpen=null,this.fly&&m(this.fly,!0))}flyHost(){return this.fly||(this.fly=f(``),(document.getElementById(`overlay-root`)??document.body).appendChild(this.fly),document.addEventListener(`pointerdown`,e=>{let t=e.target;this.flyOpen&&!this.fly?.contains(t)&&!this.flyOpen.btn.contains(t)&&this.closeFly()},!0),document.addEventListener(`keydown`,e=>{this.flyOpen&&e.key===`Escape`&&this.closeFly()})),this.fly}stripFor(e){let t=this.strips.get(e);if(!t){t=f(e===`left`?``:``),e===`left`?this.minirail.appendChild(t):this.cols[e].prepend(t);let n=e===`left`?`Expand the left panels`:`Expand panels`,r=f(``);r.addEventListener(`click`,()=>this.setCollapsed(e,!1)),t.appendChild(r),this.strips.set(e,t)}return t}renderStrips(){for(let e of R6){let t=this.isCollapsed(e)&&this.shown(e).length>0;if(e===`left`&&m(this.minirail,!t),!t&&!this.strips.has(e)){this.placeCollapse(e);continue}let n=this.stripFor(e),r=t?this.state[e].filter(e=>this.present(e)):[],i=new Map;for(let e of Array.from(n.querySelectorAll(`[data-group]`)))i.set(e.dataset.group,e);for(let[e,t]of i)r.includes(e)||t.remove();for(let t of r){let r=i.get(t);r||=this.stripButton(e,t),n.appendChild(r)}this.placeCollapse(e)}}stripButton(e,t){let n=R.all.get(t)?.root.getAttribute(`aria-label`)??t,r=f(``);return r.dataset.group=t,r.title=n,r.setAttribute(`aria-label`,n),r.addEventListener(`click`,()=>{let n=this.section(t);if(!n)return;if(this.flyOpen?.s===n){this.closeFly();return}this.closeFly();let i=this.flyHost(),a=document.createComment(t);n.replaceWith(a),i.appendChild(n),m(i,!1),this.flyOpen={s:n,mark:a,btn:r},r.classList.add(`is-on`);let o=r.getBoundingClientRect();e===`left`?(i.style.right=``,i.style.left=`${Math.round(o.right+8)}px`):(i.style.left=``,i.style.right=`${Math.round(window.innerWidth-o.left+8)}px`),i.style.top=`${Math.round(Math.max(8,Math.min(o.top,window.innerHeight-i.offsetHeight-8)))}px`}),r}placeCollapse(e){let t=this.collapseBtns.get(e);if(!t){let n=e===`left`?`Collapse to the minirail`:`Collapse to icons`;t=f(``),t.addEventListener(`click`,t=>{t.stopPropagation(),this.setCollapsed(e,!0)}),this.collapseBtns.set(e,t)}let n=this.shown(e)[0]?.querySelector(`:scope > .cv-panel-head`);n&&t.parentElement!==n&&n.appendChild(t)}splitters(){let e=new Set;for(let t of R6){let n=this.shown(t);for(let t=0;t`);return t.addEventListener(`dblclick`,()=>{delete this.state.heights[e],this.save()}),t.addEventListener(`pointerdown`,n=>{let r=this.section(e);if(n.button!==0||!r||r.classList.contains(`is-min`))return;n.preventDefault(),t.setPointerCapture(n.pointerId);let i=n.clientY,a=r.getBoundingClientRect().height,o=r.querySelector(`.cv-panel-head`)?.getBoundingClientRect().height??40,s=r.parentElement.getBoundingClientRect().bottom-r.getBoundingClientRect().top-60,l=t=>{this.state.heights[e]=Math.max(o+60,Math.min(s,a+t.clientY-i)),c(r,`is-sized`,!0),r.style.height=`${Math.round(this.state.heights[e])}px`},u=()=>{t.removeEventListener(`pointermove`,l),t.removeEventListener(`pointerup`,u),t.removeEventListener(`pointercancel`,u),this.persist()};t.addEventListener(`pointermove`,l),t.addEventListener(`pointerup`,u),t.addEventListener(`pointercancel`,u)}),t}wireResizer(){this.resizer.addEventListener(`dblclick`,()=>{this.state.width=null,this.save()}),this.resizer.addEventListener(`pointerdown`,e=>{if(e.button!==0)return;e.preventDefault(),this.resizer.setPointerCapture(e.pointerId),c(this.resizer,`is-dragging`,!0);let t=this.cols.dock.getBoundingClientRect().right,n=e=>{this.state.width=Math.round(Math.max(z6,Math.min(B6,t-e.clientX-3))),_(this.root,`--cv-layers-w`,`${this.state.width}px`)},r=()=>{c(this.resizer,`is-dragging`,!1),this.resizer.removeEventListener(`pointermove`,n),this.resizer.removeEventListener(`pointerup`,r),this.resizer.removeEventListener(`pointercancel`,r),this.persist()};this.resizer.addEventListener(`pointermove`,n),this.resizer.addEventListener(`pointerup`,r),this.resizer.addEventListener(`pointercancel`,r)})}wireLeftResizer(){let e=f(``);this.cols.left.appendChild(e),e.addEventListener(`dblclick`,()=>{this.state.leftWidth=null,this.save()}),e.addEventListener(`pointerdown`,t=>{if(t.button!==0)return;t.preventDefault(),e.setPointerCapture(t.pointerId),c(e,`is-dragging`,!0);let n=this.cols.left.getBoundingClientRect().left,r=e=>{this.state.leftWidth=Math.round(Math.max(z6,Math.min(B6,e.clientX-n))),_(this.root,`--fd-left-w`,`${this.state.leftWidth}px`)},i=()=>{c(e,`is-dragging`,!1),e.removeEventListener(`pointermove`,r),e.removeEventListener(`pointerup`,i),e.removeEventListener(`pointercancel`,i),this.persist()};e.addEventListener(`pointermove`,r),e.addEventListener(`pointerup`,i),e.addEventListener(`pointercancel`,i)})}wire(e){let t=e.root.querySelector(`:scope > .cv-panel-head`);t&&!this.wired.has(t)&&(this.wired.add(t),t.addEventListener(`pointerdown`,t=>{let n=t.target;t.button!==0||n.closest(`button:not(.cv-group-tab), [data-cmd], input, select`)||n.closest(`.cv-group-tab`)&&e.size>1||(this.drag={id:e.id,x0:t.clientX,y0:t.clientY,moving:!1,at:null},document.addEventListener(`pointermove`,this.docMove,!0))}),t.addEventListener(`click`,e=>{this.suppressClick&&=(e.stopPropagation(),e.preventDefault(),!1)},!0))}docMove=e=>{let t=this.drag;if(!t){document.removeEventListener(`pointermove`,this.docMove,!0);return}if(!(e.buttons&1)){this.drop();return}if(!t.moving&&Math.hypot(e.clientX-t.x0,e.clientY-t.y0)<6)return;t.moving=!0,this.ghost||(this.ghost=f(``),this.ghost.textContent=R.all.get(t.id)?.root.getAttribute(`aria-label`)??t.id,document.body.appendChild(this.ghost)),this.ghost.style.left=`${e.clientX+12}px`,this.ghost.style.top=`${e.clientY+10}px`;let n=this.gapAt(e.clientX,e.clientY);t.at=n?{col:n.col,index:n.index}:null,n?this.placeMarker(n,`Move here`):m(this.marker,!0)};drop(){let e=this.drag;this.drag=null,this.ghost?.remove(),this.ghost=null,document.removeEventListener(`pointermove`,this.docMove,!0),m(this.marker,!0),e?.moving&&e.at&&(this.suppressClick=!0,window.setTimeout(()=>{this.suppressClick=!1},0),this.insert(e.id,e.at.col,e.at.index))}insert(e,t,n){let r=this.state[t].filter(e=>this.present(e))[n]??null;if(r===e)return;let i=this.state.left.filter(t=>t!==e),a=this.state.side.filter(t=>t!==e),o=this.state.dock.filter(t=>t!==e),s=t===`left`?i:t===`side`?a:o,c=r?s.indexOf(r):s.length;s.splice(c<0?s.length:c,0,e),this.state={...this.state,left:i,side:a,dock:o},this.save()}gapAt(e,t){let n=null;for(let r of R6){let i=this.cols[r].getBoundingClientRect();i.width>0&&e>=i.left&&e<=i.right&&t>=i.top&&t<=i.bottom&&(n=r)}if(!n)return null;let r=this.cols[n],i=this.shown(n),a=0,o=1/0,s=r.getBoundingClientRect().top+2;for(let e=0;e<=i.length;e++){let n=e`),this.undoBtn=p(e,`[data-cmd="undo"].cv-st-btn`),this.redoBtn=p(e,`[data-cmd="redo"].cv-st-btn`),this.zoom=p(e,`.cv-st-zoom`),this.dims=p(e,`.fd-st-dims`),this.info=p(e,`.cv-st-info`),this.hint=p(e,`.fd-st-hint`),this.busy=C8t(``+O(`loading`,12)+`Working`),this.hint.after(this.busy),this.zoom.addEventListener(`keydown`,e=>{if(e.key===`Enter`){let e=parseFloat(this.zoom.value.replace(`,`,`.`).replace(`%`,``));Number.isFinite(e)&&e>0&&D.hasDoc&&this.viewport.zoomTo(Math.min(6400,Math.max(1,e))/100),this.zoom.blur()}else e.key===`Escape`&&this.zoom.blur();e.stopPropagation()}),this.zoom.addEventListener(`focus`,()=>this.zoom.select()),this.zoom.addEventListener(`blur`,()=>this.syncView());try{let e=localStorage.getItem(x8t);e&&H6.includes(e)&&(this.infoKind=e)}catch{}this.info.addEventListener(`click`,e=>{let t=H6.length;this.infoKind=H6[(H6.indexOf(this.infoKind)+(e.shiftKey?t-1:1))%t];try{localStorage.setItem(x8t,this.infoKind)}catch{}this.syncInfo()});for(let e of[`docs`,`layout`,`selection`,`change`])D.on(e,()=>this.syncInfo());for(let e of[`docs`,`change`])D.on(e,()=>this.syncHistory());D.on(`layout`,()=>this.syncView()),D.on(`busy`,()=>{D.busy?this.dismiss||=i(this.busy):(this.dismiss?.(),this.dismiss=null)}),new ResizeObserver(()=>this.fitHint()).observe(this.hint),this.syncView(),this.syncInfo(),this.syncHistory()}syncView(){let e=D.hasDoc,t=e?`${Number((this.viewport.view.zoom*100).toFixed(1))}%`:``;document.activeElement!==this.zoom&&this.zoom.value!==t&&(this.zoom.value=t),h(this.zoom,!e);let n=D.layout,r=n?.pages.find(e=>e.abs===this.viewport.currentPage())??n?.pages[0],i=r?Math.round((r.rect[2]-r.rect[0])*100)/100:0,a=r?Math.round((r.rect[3]-r.rect[1])*100)/100:0;s(this.dims,r?`${i} × ${a} pt`:``),g(this.dims,r?`Page size`:``)}syncHistory(){let e=D.doc;h(this.undoBtn,!e?.canUndo),h(this.redoBtn,!e?.canRedo)}syncInfo(){let e=D.doc,t=D.layout,n=this.infoKind,r=``,i=``;e&&(n===`pages`?(r=`${e.pages} ${e.pages===1?`page`:`pages`}${t?` · ${new Set(t.pages.map(e=>e.spread)).size} spreads`:``}`,i=`Pages and spreads in the document`):n===`slots`?(r=t?`${t.slots.length} slots`:``,i=`Named slots in the layout`):n===`selection`?(r=`${D.selection?.items.length??0} selected`,i=`Objects selected`):(r=e.undoLabel?`Undo: ${e.undoLabel}`:`Undo: nothing`,i=`What Undo would reverse`)),s(this.info,r),g(this.info,`${i}${i?`. `:``}Click for the next readout, Shift+click for the previous.`)}setHint(e){this.hintSegs=e.split(` · `),this.fitHint()}fitHint(){let e=this.hintSegs;if(!e.length)return;let t=e.length;for(s(this.hint,e.join(` · `));t>1&&this.hint.scrollWidth>this.hint.clientWidth;)t--,s(this.hint,e.slice(0,t).join(` · `));g(this.hint,t{})),T8t=n({Channel:()=>Z6,PluginListener:()=>Q6,Resource:()=>$6,SERIALIZE_TO_IPC_FN:()=>X6,addPluginListener:()=>D8t,checkPermissions:()=>O8t,convertFileSrc:()=>A8t,invoke:()=>W,isTauri:()=>j8t,requestPermissions:()=>k8t,transformCallback:()=>E8t});function E8t(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}async function D8t(e,t,n){let r=new Z6(n);try{return await W(`plugin:${e}|register_listener`,{event:t,handler:r}),new Q6(e,t,r.id)}catch{return await W(`plugin:${e}|registerListener`,{event:t,handler:r}),new Q6(e,t,r.id)}}async function O8t(e){return W(`plugin:${e}|check_permissions`)}async function k8t(e){return W(`plugin:${e}|request_permissions`)}async function W(e,t={},n){return window.__TAURI_INTERNALS__.invoke(e,t,n)}function A8t(e,t=`asset`){return window.__TAURI_INTERNALS__.convertFileSrc(e,t)}function j8t(){return!!(globalThis||window).isTauri}var G6,K6,q6,J6,Y6,X6,Z6,Q6,$6,e8=t((()=>{w8t(),X6=`__TAURI_TO_IPC_KEY__`,Z6=class{constructor(e){G6.set(this,void 0),K6.set(this,0),q6.set(this,[]),J6.set(this,void 0),W6(this,G6,e||(()=>{}),`f`),this.id=E8t(e=>{let t=e.index;if(`end`in e){t==U6(this,K6,`f`)?this.cleanupCallback():W6(this,J6,t,`f`);return}let n=e.message;if(t==U6(this,K6,`f`)){for(U6(this,G6,`f`).call(this,n),W6(this,K6,U6(this,K6,`f`)+1,`f`);U6(this,K6,`f`)in U6(this,q6,`f`);){let e=U6(this,q6,`f`)[U6(this,K6,`f`)];U6(this,G6,`f`).call(this,e),delete U6(this,q6,`f`)[U6(this,K6,`f`)],W6(this,K6,U6(this,K6,`f`)+1,`f`)}U6(this,K6,`f`)===U6(this,J6,`f`)&&this.cleanupCallback()}else U6(this,q6,`f`)[t]=n})}cleanupCallback(){window.__TAURI_INTERNALS__.unregisterCallback(this.id)}set onmessage(e){W6(this,G6,e,`f`)}get onmessage(){return U6(this,G6,`f`)}[(G6=new WeakMap,K6=new WeakMap,q6=new WeakMap,J6=new WeakMap,X6)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[X6]()}},Q6=class{constructor(e,t,n){this.plugin=e,this.event=t,this.channelId=n}async unregister(){return W(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}},$6=class{get rid(){return U6(this,Y6,`f`)}constructor(e){Y6.set(this,void 0),W6(this,Y6,e,`f`)}async close(){return W(`plugin:resources|close`,{rid:this.rid})}async[(Y6=new WeakMap,Symbol.asyncDispose)](){await this.close()}}})),t8,n8,r8,i8,a8,o8,M8t=t((()=>{e8(),t8=class{constructor(...e){this.type=`Logical`,e.length===1?`Logical`in e[0]?(this.width=e[0].Logical.width,this.height=e[0].Logical.height):(this.width=e[0].width,this.height=e[0].height):(this.width=e[0],this.height=e[1])}toPhysical(e){return new n8(this.width*e,this.height*e)}[X6](){return{width:this.width,height:this.height}}toJSON(){return this[X6]()}},n8=class{constructor(...e){this.type=`Physical`,e.length===1?`Physical`in e[0]?(this.width=e[0].Physical.width,this.height=e[0].Physical.height):(this.width=e[0].width,this.height=e[0].height):(this.width=e[0],this.height=e[1])}toLogical(e){return new t8(this.width/e,this.height/e)}[X6](){return{width:this.width,height:this.height}}toJSON(){return this[X6]()}},r8=class{constructor(e){this.size=e}toLogical(e){return this.size instanceof t8?this.size:this.size.toLogical(e)}toPhysical(e){return this.size instanceof n8?this.size:this.size.toPhysical(e)}[X6](){return{[`${this.size.type}`]:{width:this.size.width,height:this.size.height}}}toJSON(){return this[X6]()}},i8=class{constructor(...e){this.type=`Logical`,e.length===1?`Logical`in e[0]?(this.x=e[0].Logical.x,this.y=e[0].Logical.y):(this.x=e[0].x,this.y=e[0].y):(this.x=e[0],this.y=e[1])}toPhysical(e){return new a8(this.x*e,this.y*e)}[X6](){return{x:this.x,y:this.y}}toJSON(){return this[X6]()}},a8=class{constructor(...e){this.type=`Physical`,e.length===1?`Physical`in e[0]?(this.x=e[0].Physical.x,this.y=e[0].Physical.y):(this.x=e[0].x,this.y=e[0].y):(this.x=e[0],this.y=e[1])}toLogical(e){return new i8(this.x/e,this.y/e)}[X6](){return{x:this.x,y:this.y}}toJSON(){return this[X6]()}},o8=class{constructor(e){this.position=e}toLogical(e){return this.position instanceof i8?this.position:this.position.toLogical(e)}toPhysical(e){return this.position instanceof a8?this.position:this.position.toPhysical(e)}[X6](){return{[`${this.position.type}`]:{x:this.position.x,y:this.position.y}}}toJSON(){return this[X6]()}}}));async function N8t(e,t){window.__TAURI_EVENT_PLUGIN_INTERNALS__.unregisterListener(e,t),await W(`plugin:event|unlisten`,{event:e,eventId:t})}async function P8t(e,t,n){return W(`plugin:event|listen`,{event:e,target:typeof n?.target==`string`?{kind:`AnyLabel`,label:n.target}:n?.target??{kind:`Any`},handler:E8t(t)}).then(t=>async()=>N8t(e,t))}async function F8t(e,t,n){return P8t(e,n=>{N8t(e,n.id),t(n)},n)}async function I8t(e,t){await W(`plugin:event|emit`,{event:e,payload:t})}async function L8t(e,t,n){await W(`plugin:event|emit_to`,{target:typeof e==`string`?{kind:`AnyLabel`,label:e}:e,event:t,payload:n})}var s8,R8t=t((()=>{e8(),(function(e){e.WINDOW_RESIZED=`tauri://resize`,e.WINDOW_MOVED=`tauri://move`,e.WINDOW_CLOSE_REQUESTED=`tauri://close-requested`,e.WINDOW_DESTROYED=`tauri://destroyed`,e.WINDOW_FOCUS=`tauri://focus`,e.WINDOW_BLUR=`tauri://blur`,e.WINDOW_SCALE_FACTOR_CHANGED=`tauri://scale-change`,e.WINDOW_THEME_CHANGED=`tauri://theme-changed`,e.WINDOW_CREATED=`tauri://window-created`,e.WINDOW_SUSPENDED=`tauri://suspended`,e.WINDOW_RESUMED=`tauri://resumed`,e.WEBVIEW_CREATED=`tauri://webview-created`,e.DRAG_ENTER=`tauri://drag-enter`,e.DRAG_OVER=`tauri://drag-over`,e.DRAG_DROP=`tauri://drag-drop`,e.DRAG_LEAVE=`tauri://drag-leave`})(s8||={})}));function c8(e){return e==null?null:typeof e==`string`?e:e instanceof z8t?e.rid:e}var z8t,l8=t((()=>{e8(),z8t=class e extends $6{constructor(e){super(e)}static async new(t,n,r){return W(`plugin:image|new`,{rgba:t,width:n,height:r}).then(t=>new e(t))}static async fromBytes(t){return W(`plugin:image|from_bytes`,{bytes:t}).then(t=>new e(t))}static async fromPath(t){return W(`plugin:image|from_path`,{path:t}).then(t=>new e(t))}async rgba(){return W(`plugin:image|rgba`,{rid:this.rid}).then(e=>new Uint8Array(e))}async size(){return W(`plugin:image|size`,{rid:this.rid})}}})),B8t=n({CloseRequestedEvent:()=>J8t,Effect:()=>Q8t,EffectState:()=>$8t,LogicalPosition:()=>i8,LogicalSize:()=>t8,PhysicalPosition:()=>a8,PhysicalSize:()=>n8,ProgressBarStatus:()=>Y8t,UserAttentionType:()=>q8t,Window:()=>p8,availableMonitors:()=>G8t,currentMonitor:()=>H8t,cursorPosition:()=>K8t,getAllWindows:()=>u8,getCurrentWindow:()=>V8t,monitorFromPoint:()=>W8t,primaryMonitor:()=>U8t});function V8t(){return new p8(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}async function u8(){return W(`plugin:window|get_all_windows`).then(e=>e.map(e=>new p8(e,{skip:!0})))}function d8(e){return e===null?null:{name:e.name,scaleFactor:e.scaleFactor,position:new a8(e.position),size:new n8(e.size),workArea:{position:new a8(e.workArea.position),size:new n8(e.workArea.size)}}}async function H8t(){return W(`plugin:window|current_monitor`).then(d8)}async function U8t(){return W(`plugin:window|primary_monitor`).then(d8)}async function W8t(e,t){return W(`plugin:window|monitor_from_point`,{x:e,y:t}).then(d8)}async function G8t(){return W(`plugin:window|available_monitors`).then(e=>e.map(d8))}async function K8t(){return W(`plugin:window|cursor_position`).then(e=>new a8(e))}var q8t,J8t,Y8t,f8,p8,X8t,Z8t,Q8t,$8t,e5t=t((()=>{M8t(),R8t(),e8(),l8(),(function(e){e[e.Critical=1]=`Critical`,e[e.Informational=2]=`Informational`})(q8t||={}),J8t=class{constructor(e){this._preventDefault=!1,this.event=e.event,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}},(function(e){e.None=`none`,e.Normal=`normal`,e.Indeterminate=`indeterminate`,e.Paused=`paused`,e.Error=`error`})(Y8t||={}),f8=[`tauri://created`,`tauri://error`],p8=class{constructor(e,t={}){this.label=e,this.listeners=Object.create(null),t?.skip||W(`plugin:window|create`,{options:{...t,parent:typeof t.parent==`string`?t.parent:t.parent?.label,label:e}}).then(async()=>this.emit(`tauri://created`)).catch(async e=>this.emit(`tauri://error`,e))}static async getByLabel(e){return(await u8()).find(t=>t.label===e)??null}static getCurrent(){return V8t()}static async getAll(){return u8()}static async getFocusedWindow(){for(let e of await u8())if(await e.isFocused())return e;return null}async listen(e,t){return this._handleTauriEvent(e,t)?()=>{let n=this.listeners[e];n.splice(n.indexOf(t),1)}:P8t(e,t,{target:{kind:`Window`,label:this.label}})}async once(e,t){return this._handleTauriEvent(e,t)?()=>{let n=this.listeners[e];n.splice(n.indexOf(t),1)}:F8t(e,t,{target:{kind:`Window`,label:this.label}})}async emit(e,t){if(f8.includes(e))for(let n of this.listeners[e]||[])n({event:e,id:-1,payload:t});else return I8t(e,t)}async emitTo(e,t,n){if(f8.includes(t))for(let e of this.listeners[t]||[])e({event:t,id:-1,payload:n});else return L8t(e,t,n)}_handleTauriEvent(e,t){return f8.includes(e)?(e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t],!0):!1}async scaleFactor(){return W(`plugin:window|scale_factor`,{label:this.label})}async innerPosition(){return W(`plugin:window|inner_position`,{label:this.label}).then(e=>new a8(e))}async outerPosition(){return W(`plugin:window|outer_position`,{label:this.label}).then(e=>new a8(e))}async innerSize(){return W(`plugin:window|inner_size`,{label:this.label}).then(e=>new n8(e))}async outerSize(){return W(`plugin:window|outer_size`,{label:this.label}).then(e=>new n8(e))}async isFullscreen(){return W(`plugin:window|is_fullscreen`,{label:this.label})}async isMinimized(){return W(`plugin:window|is_minimized`,{label:this.label})}async isMaximized(){return W(`plugin:window|is_maximized`,{label:this.label})}async isFocused(){return W(`plugin:window|is_focused`,{label:this.label})}async isDecorated(){return W(`plugin:window|is_decorated`,{label:this.label})}async isResizable(){return W(`plugin:window|is_resizable`,{label:this.label})}async isMaximizable(){return W(`plugin:window|is_maximizable`,{label:this.label})}async isMinimizable(){return W(`plugin:window|is_minimizable`,{label:this.label})}async isClosable(){return W(`plugin:window|is_closable`,{label:this.label})}async isVisible(){return W(`plugin:window|is_visible`,{label:this.label})}async title(){return W(`plugin:window|title`,{label:this.label})}async theme(){return W(`plugin:window|theme`,{label:this.label})}async isAlwaysOnTop(){return W(`plugin:window|is_always_on_top`,{label:this.label})}async activityName(){return W(`plugin:window|activity_name`,{label:this.label})}async sceneIdentifier(){return W(`plugin:window|scene_identifier`,{label:this.label})}async center(){return W(`plugin:window|center`,{label:this.label})}async requestUserAttention(e){let t=null;return e&&(t=e===q8t.Critical?{type:`Critical`}:{type:`Informational`}),W(`plugin:window|request_user_attention`,{label:this.label,value:t})}async setResizable(e){return W(`plugin:window|set_resizable`,{label:this.label,value:e})}async setEnabled(e){return W(`plugin:window|set_enabled`,{label:this.label,value:e})}async isEnabled(){return W(`plugin:window|is_enabled`,{label:this.label})}async setMaximizable(e){return W(`plugin:window|set_maximizable`,{label:this.label,value:e})}async setMinimizable(e){return W(`plugin:window|set_minimizable`,{label:this.label,value:e})}async setClosable(e){return W(`plugin:window|set_closable`,{label:this.label,value:e})}async setTitle(e){return W(`plugin:window|set_title`,{label:this.label,value:e})}async maximize(){return W(`plugin:window|maximize`,{label:this.label})}async unmaximize(){return W(`plugin:window|unmaximize`,{label:this.label})}async toggleMaximize(){return W(`plugin:window|toggle_maximize`,{label:this.label})}async minimize(){return W(`plugin:window|minimize`,{label:this.label})}async unminimize(){return W(`plugin:window|unminimize`,{label:this.label})}async show(){return W(`plugin:window|show`,{label:this.label})}async hide(){return W(`plugin:window|hide`,{label:this.label})}async close(){return W(`plugin:window|close`,{label:this.label})}async destroy(){return W(`plugin:window|destroy`,{label:this.label})}async setDecorations(e){return W(`plugin:window|set_decorations`,{label:this.label,value:e})}async setShadow(e){return W(`plugin:window|set_shadow`,{label:this.label,value:e})}async setEffects(e){return W(`plugin:window|set_effects`,{label:this.label,value:e})}async clearEffects(){return W(`plugin:window|set_effects`,{label:this.label,value:null})}async setAlwaysOnTop(e){return W(`plugin:window|set_always_on_top`,{label:this.label,value:e})}async setAlwaysOnBottom(e){return W(`plugin:window|set_always_on_bottom`,{label:this.label,value:e})}async setContentProtected(e){return W(`plugin:window|set_content_protected`,{label:this.label,value:e})}async setSize(e){return W(`plugin:window|set_size`,{label:this.label,value:e instanceof r8?e:new r8(e)})}async setMinSize(e){return W(`plugin:window|set_min_size`,{label:this.label,value:e instanceof r8?e:e?new r8(e):null})}async setMaxSize(e){return W(`plugin:window|set_max_size`,{label:this.label,value:e instanceof r8?e:e?new r8(e):null})}async setSizeConstraints(e){function t(e){return e?{Logical:e}:null}return W(`plugin:window|set_size_constraints`,{label:this.label,value:{minWidth:t(e?.minWidth),minHeight:t(e?.minHeight),maxWidth:t(e?.maxWidth),maxHeight:t(e?.maxHeight)}})}async setPosition(e){return W(`plugin:window|set_position`,{label:this.label,value:e instanceof o8?e:new o8(e)})}async setFullscreen(e){return W(`plugin:window|set_fullscreen`,{label:this.label,value:e})}async setFullscreenOnMonitor(e){return W(`plugin:window|set_fullscreen_on_monitor`,{label:this.label,value:e})}async setSimpleFullscreen(e){return W(`plugin:window|set_simple_fullscreen`,{label:this.label,value:e})}async setFocus(){return W(`plugin:window|set_focus`,{label:this.label})}async setFocusable(e){return W(`plugin:window|set_focusable`,{label:this.label,value:e})}async setIcon(e){return W(`plugin:window|set_icon`,{label:this.label,value:c8(e)})}async setSkipTaskbar(e){return W(`plugin:window|set_skip_taskbar`,{label:this.label,value:e})}async setCursorGrab(e){return W(`plugin:window|set_cursor_grab`,{label:this.label,value:e})}async setCursorVisible(e){return W(`plugin:window|set_cursor_visible`,{label:this.label,value:e})}async setCursorIcon(e){return W(`plugin:window|set_cursor_icon`,{label:this.label,value:e})}async setBackgroundColor(e){return W(`plugin:window|set_background_color`,{label:this.label,value:e})}async setCursorPosition(e){return W(`plugin:window|set_cursor_position`,{label:this.label,value:e instanceof o8?e:new o8(e)})}async setIgnoreCursorEvents(e){return W(`plugin:window|set_ignore_cursor_events`,{label:this.label,value:e})}async startDragging(){return W(`plugin:window|start_dragging`,{label:this.label})}async startResizeDragging(e){return W(`plugin:window|start_resize_dragging`,{label:this.label,value:e})}async setBadgeCount(e){return W(`plugin:window|set_badge_count`,{label:this.label,value:e})}async setBadgeLabel(e){return W(`plugin:window|set_badge_label`,{label:this.label,value:e})}async setOverlayIcon(e){return W(`plugin:window|set_overlay_icon`,{label:this.label,value:e?c8(e):void 0})}async setProgressBar(e){return W(`plugin:window|set_progress_bar`,{label:this.label,value:e})}async setVisibleOnAllWorkspaces(e){return W(`plugin:window|set_visible_on_all_workspaces`,{label:this.label,value:e})}async setTitleBarStyle(e){return W(`plugin:window|set_title_bar_style`,{label:this.label,value:e})}async setTheme(e){return W(`plugin:window|set_theme`,{label:this.label,value:e})}async onResized(e){return this.listen(s8.WINDOW_RESIZED,t=>{t.payload=new n8(t.payload),e(t)})}async onMoved(e){return this.listen(s8.WINDOW_MOVED,t=>{t.payload=new a8(t.payload),e(t)})}async onCloseRequested(e){return this.listen(s8.WINDOW_CLOSE_REQUESTED,async t=>{let n=new J8t(t);await e(n),n.isPreventDefault()||await this.destroy()})}async onDragDropEvent(e){let t=await this.listen(s8.DRAG_ENTER,t=>{e({...t,payload:{type:`enter`,paths:t.payload.paths,position:new a8(t.payload.position)}})}),n=await this.listen(s8.DRAG_OVER,t=>{e({...t,payload:{type:`over`,position:new a8(t.payload.position)}})}),r=await this.listen(s8.DRAG_DROP,t=>{e({...t,payload:{type:`drop`,paths:t.payload.paths,position:new a8(t.payload.position)}})}),i=await this.listen(s8.DRAG_LEAVE,t=>{e({...t,payload:{type:`leave`}})});return()=>{t(),r(),n(),i()}}async onFocusChanged(e){let t=await this.listen(s8.WINDOW_FOCUS,t=>{e({...t,payload:!0})}),n=await this.listen(s8.WINDOW_BLUR,t=>{e({...t,payload:!1})});return()=>{t(),n()}}async onScaleChanged(e){return this.listen(s8.WINDOW_SCALE_FACTOR_CHANGED,e)}async onThemeChanged(e){return this.listen(s8.WINDOW_THEME_CHANGED,e)}},(function(e){e.Disabled=`disabled`,e.Throttle=`throttle`,e.Suspend=`suspend`})(X8t||={}),(function(e){e.Default=`default`,e.FluentOverlay=`fluentOverlay`})(Z8t||={}),(function(e){e.AppearanceBased=`appearanceBased`,e.Light=`light`,e.Dark=`dark`,e.MediumLight=`mediumLight`,e.UltraDark=`ultraDark`,e.Titlebar=`titlebar`,e.Selection=`selection`,e.Menu=`menu`,e.Popover=`popover`,e.Sidebar=`sidebar`,e.HeaderView=`headerView`,e.Sheet=`sheet`,e.WindowBackground=`windowBackground`,e.HudWindow=`hudWindow`,e.FullScreenUI=`fullScreenUI`,e.Tooltip=`tooltip`,e.ContentBackground=`contentBackground`,e.UnderWindowBackground=`underWindowBackground`,e.UnderPageBackground=`underPageBackground`,e.LiquidGlassRegular=`liquidGlassRegular`,e.LiquidGlassClear=`liquidGlassClear`,e.Mica=`mica`,e.Blur=`blur`,e.Acrylic=`acrylic`,e.Tabbed=`tabbed`,e.TabbedDark=`tabbedDark`,e.TabbedLight=`tabbedLight`})(Q8t||={}),(function(e){e.FollowsWindowActiveState=`followsWindowActiveState`,e.Active=`active`,e.Inactive=`inactive`})($8t||={})})),t5t=()=>`__TAURI_INTERNALS__`in window&&!/Mac/.test(navigator.platform),n5t=class{header;wanted;box=document.createElement(`div`);win=null;on=!1;maximized=!1;constructor(e,t){if(this.header=e,this.wanted=t,this.box.className=`cv-caption`,this.box.hidden=!0,this.box.innerHTML=``,e.append(this.box),`__TAURI_INTERNALS__`in window)for(let t of e.querySelectorAll(`.cv-menubar, .cv-zoom`))t.setAttribute(`data-tauri-drag-region`,``);this.box.addEventListener(`click`,e=>{let t=e.target instanceof Element?e.target.closest(`[data-cap]`):null;t&&this.act(t.dataset.cap??``)}),window.addEventListener(`resize`,()=>{this.on&&this.look()}),this.sync()}get active(){return this.on}sync(){let e=t5t()&&this.wanted();e!==this.on&&(this.on=e,m(this.box,!e),c(document.documentElement,`has-caption-buttons`,e),this.use(t=>t.setDecorations(!e)).then(()=>this.look()))}async use(e){try{return this.win??=P(()=>Promise.resolve().then(()=>(e5t(),B8t)).then(e=>e.getCurrentWindow()),void 0,{}.url),await e(await this.win)}catch{return}}async act(e){e===`min`?await this.use(e=>e.minimize()):e===`max`?(await this.use(e=>e.toggleMaximize()),await this.look()):e===`close`&&await this.use(e=>e.close())}async look(){let e=!!await this.use(e=>e.isMaximized());if(e===this.maximized&&this.box.dataset.shown)return;this.maximized=e,this.box.dataset.shown=`1`;let t=p(this.box,`[data-cap="max"]`);t.innerHTML=O(e?`capRestore`:`capMax`,16),g(t,e?`Restore`:`Maximize`),t.setAttribute(`aria-label`,e?`Restore`:`Maximize`)}};function r5t(e){if(`items`in e)e.items=e.items?.map(e=>`rid`in e?e:r5t(e));else if(`action`in e&&e.action){let t=new Z6;return t.onmessage=e.action,delete e.action,{...e,handler:t}}return e}async function m8(e,t){let n=new Z6;if(t&&typeof t==`object`&&(`action`in t&&t.action&&(n.onmessage=t.action,delete t.action),`item`in t&&t.item&&typeof t.item==`object`&&`About`in t.item&&t.item.About&&typeof t.item.About==`object`&&`icon`in t.item.About&&t.item.About.icon&&(t.item.About.icon=c8(t.item.About.icon)),`icon`in t&&t.icon&&(t.icon=c8(t.icon)),`items`in t&&t.items)){function r(e){return`rid`in e?[e.rid,e.kind]:(`item`in e&&typeof e.item==`object`&&e.item.About?.icon&&(e.item.About.icon=c8(e.item.About.icon)),`icon`in e&&e.icon&&(e.icon=c8(e.icon)),`items`in e&&e.items&&(e.items=e.items.map(r)),r5t(e))}t.items=t.items.map(r)}return W(`plugin:menu|new`,{kind:e,options:t,handler:n})}var h8,g8,_8,v8=t((()=>{w8t(),e8(),l8(),_8=class extends $6{get id(){return U6(this,h8,`f`)}get kind(){return U6(this,g8,`f`)}constructor(e,t,n){super(e),h8.set(this,void 0),g8.set(this,void 0),W6(this,h8,t,`f`),W6(this,g8,n,`f`)}},h8=new WeakMap,g8=new WeakMap})),i5t,a5t=t((()=>{v8(),e8(),i5t=class e extends _8{constructor(e,t){super(e,t,`MenuItem`)}static async new(t){return m8(`MenuItem`,t).then(([t,n])=>new e(t,n))}async text(){return W(`plugin:menu|text`,{rid:this.rid,kind:this.kind})}async setText(e){return W(`plugin:menu|set_text`,{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return W(`plugin:menu|is_enabled`,{rid:this.rid,kind:this.kind})}async setEnabled(e){return W(`plugin:menu|set_enabled`,{rid:this.rid,kind:this.kind,enabled:e})}async setAccelerator(e){return W(`plugin:menu|set_accelerator`,{rid:this.rid,kind:this.kind,accelerator:e})}}})),o5t,s5t=t((()=>{v8(),e8(),o5t=class e extends _8{constructor(e,t){super(e,t,`Check`)}static async new(t){return m8(`Check`,t).then(([t,n])=>new e(t,n))}async text(){return W(`plugin:menu|text`,{rid:this.rid,kind:this.kind})}async setText(e){return W(`plugin:menu|set_text`,{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return W(`plugin:menu|is_enabled`,{rid:this.rid,kind:this.kind})}async setEnabled(e){return W(`plugin:menu|set_enabled`,{rid:this.rid,kind:this.kind,enabled:e})}async setAccelerator(e){return W(`plugin:menu|set_accelerator`,{rid:this.rid,kind:this.kind,accelerator:e})}async isChecked(){return W(`plugin:menu|is_checked`,{rid:this.rid})}async setChecked(e){return W(`plugin:menu|set_checked`,{rid:this.rid,checked:e})}}})),c5t,l5t,u5t=t((()=>{v8(),e8(),l8(),(function(e){e.Add=`Add`,e.Advanced=`Advanced`,e.Bluetooth=`Bluetooth`,e.Bookmarks=`Bookmarks`,e.Caution=`Caution`,e.ColorPanel=`ColorPanel`,e.ColumnView=`ColumnView`,e.Computer=`Computer`,e.EnterFullScreen=`EnterFullScreen`,e.Everyone=`Everyone`,e.ExitFullScreen=`ExitFullScreen`,e.FlowView=`FlowView`,e.Folder=`Folder`,e.FolderBurnable=`FolderBurnable`,e.FolderSmart=`FolderSmart`,e.FollowLinkFreestanding=`FollowLinkFreestanding`,e.FontPanel=`FontPanel`,e.GoLeft=`GoLeft`,e.GoRight=`GoRight`,e.Home=`Home`,e.IChatTheater=`IChatTheater`,e.IconView=`IconView`,e.Info=`Info`,e.InvalidDataFreestanding=`InvalidDataFreestanding`,e.LeftFacingTriangle=`LeftFacingTriangle`,e.ListView=`ListView`,e.LockLocked=`LockLocked`,e.LockUnlocked=`LockUnlocked`,e.MenuMixedState=`MenuMixedState`,e.MenuOnState=`MenuOnState`,e.MobileMe=`MobileMe`,e.MultipleDocuments=`MultipleDocuments`,e.Network=`Network`,e.Path=`Path`,e.PreferencesGeneral=`PreferencesGeneral`,e.QuickLook=`QuickLook`,e.RefreshFreestanding=`RefreshFreestanding`,e.Refresh=`Refresh`,e.Remove=`Remove`,e.RevealFreestanding=`RevealFreestanding`,e.RightFacingTriangle=`RightFacingTriangle`,e.Share=`Share`,e.Slideshow=`Slideshow`,e.SmartBadge=`SmartBadge`,e.StatusAvailable=`StatusAvailable`,e.StatusNone=`StatusNone`,e.StatusPartiallyAvailable=`StatusPartiallyAvailable`,e.StatusUnavailable=`StatusUnavailable`,e.StopProgressFreestanding=`StopProgressFreestanding`,e.StopProgress=`StopProgress`,e.TrashEmpty=`TrashEmpty`,e.TrashFull=`TrashFull`,e.User=`User`,e.UserAccounts=`UserAccounts`,e.UserGroup=`UserGroup`,e.UserGuest=`UserGuest`})(c5t||={}),l5t=class e extends _8{constructor(e,t){super(e,t,`Icon`)}static async new(t){return m8(`Icon`,t).then(([t,n])=>new e(t,n))}async text(){return W(`plugin:menu|text`,{rid:this.rid,kind:this.kind})}async setText(e){return W(`plugin:menu|set_text`,{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return W(`plugin:menu|is_enabled`,{rid:this.rid,kind:this.kind})}async setEnabled(e){return W(`plugin:menu|set_enabled`,{rid:this.rid,kind:this.kind,enabled:e})}async setAccelerator(e){return W(`plugin:menu|set_accelerator`,{rid:this.rid,kind:this.kind,accelerator:e})}async setIcon(e){return W(`plugin:menu|set_icon`,{rid:this.rid,kind:this.kind,icon:c8(e)})}}})),d5t,f5t=t((()=>{v8(),e8(),d5t=class e extends _8{constructor(e,t){super(e,t,`Predefined`)}static async new(t){return m8(`Predefined`,t).then(([t,n])=>new e(t,n))}async text(){return W(`plugin:menu|text`,{rid:this.rid,kind:this.kind})}async setText(e){return W(`plugin:menu|set_text`,{rid:this.rid,kind:this.kind,text:e})}}}));function y8([e,t,n]){switch(n){case`Submenu`:return new p5t(e,t);case`Predefined`:return new d5t(e,t);case`Check`:return new o5t(e,t);case`Icon`:return new l5t(e,t);default:return new i5t(e,t)}}var p5t,m5t=t((()=>{a5t(),s5t(),u5t(),f5t(),e8(),v8(),M8t(),l8(),p5t=class e extends _8{constructor(e,t){super(e,t,`Submenu`)}static async new(t){return m8(`Submenu`,t).then(([t,n])=>new e(t,n))}async text(){return W(`plugin:menu|text`,{rid:this.rid,kind:this.kind})}async setText(e){return W(`plugin:menu|set_text`,{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return W(`plugin:menu|is_enabled`,{rid:this.rid,kind:this.kind})}async setEnabled(e){return W(`plugin:menu|set_enabled`,{rid:this.rid,kind:this.kind,enabled:e})}async append(e){return W(`plugin:menu|append`,{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(e=>`rid`in e?[e.rid,e.kind]:e)})}async prepend(e){return W(`plugin:menu|prepend`,{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(e=>`rid`in e?[e.rid,e.kind]:e)})}async insert(e,t){return W(`plugin:menu|insert`,{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(e=>`rid`in e?[e.rid,e.kind]:e),position:t})}async remove(e){return W(`plugin:menu|remove`,{rid:this.rid,kind:this.kind,item:[e.rid,e.kind]})}async removeAt(e){return W(`plugin:menu|remove_at`,{rid:this.rid,kind:this.kind,position:e}).then(y8)}async items(){return W(`plugin:menu|items`,{rid:this.rid,kind:this.kind}).then(e=>e.map(y8))}async get(e){return W(`plugin:menu|get`,{rid:this.rid,kind:this.kind,id:e}).then(e=>e?y8(e):null)}async popup(e,t){return W(`plugin:menu|popup`,{rid:this.rid,kind:this.kind,window:t?.label??null,at:e instanceof o8?e:e?new o8(e):null})}async setAsWindowsMenuForNSApp(){return W(`plugin:menu|set_as_windows_menu_for_nsapp`,{rid:this.rid})}async setAsHelpMenuForNSApp(){return W(`plugin:menu|set_as_help_menu_for_nsapp`,{rid:this.rid})}async setIcon(e){return W(`plugin:menu|set_icon`,{rid:this.rid,kind:this.kind,icon:c8(e)})}}})),h5t,g5t=t((()=>{m5t(),M8t(),e8(),v8(),h5t=class e extends _8{constructor(e,t){super(e,t,`Menu`)}static async new(t){return m8(`Menu`,t).then(([t,n])=>new e(t,n))}static async default(){return W(`plugin:menu|create_default`).then(([t,n])=>new e(t,n))}async append(e){return W(`plugin:menu|append`,{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(e=>`rid`in e?[e.rid,e.kind]:e)})}async prepend(e){return W(`plugin:menu|prepend`,{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(e=>`rid`in e?[e.rid,e.kind]:e)})}async insert(e,t){return W(`plugin:menu|insert`,{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(e=>`rid`in e?[e.rid,e.kind]:e),position:t})}async remove(e){return W(`plugin:menu|remove`,{rid:this.rid,kind:this.kind,item:[e.rid,e.kind]})}async removeAt(e){return W(`plugin:menu|remove_at`,{rid:this.rid,kind:this.kind,position:e}).then(y8)}async items(){return W(`plugin:menu|items`,{rid:this.rid,kind:this.kind}).then(e=>e.map(y8))}async get(e){return W(`plugin:menu|get`,{rid:this.rid,kind:this.kind,id:e}).then(e=>e?y8(e):null)}async popup(e,t){return W(`plugin:menu|popup`,{rid:this.rid,kind:this.kind,window:t?.label??null,at:e instanceof o8?e:e?new o8(e):null})}async setAsAppMenu(){return W(`plugin:menu|set_as_app_menu`,{rid:this.rid}).then(t=>t?new e(t[0],t[1]):null)}async setAsWindowMenu(t){return W(`plugin:menu|set_as_window_menu`,{rid:this.rid,window:t?.label??null}).then(t=>t?new e(t[0],t[1]):null)}}})),_5t=n({CheckMenuItem:()=>o5t,IconMenuItem:()=>l5t,Menu:()=>h5t,MenuItem:()=>i5t,NativeIcon:()=>c5t,PredefinedMenuItem:()=>d5t,Submenu:()=>p5t,itemFromKind:()=>y8}),v5t=t((()=>{m5t(),a5t(),g5t(),s5t(),u5t(),f5t()})),y5t=()=>`__TAURI_INTERNALS__`in window&&/Mac/.test(navigator.platform)&&!x5t(),b5t=`formdesign.menusInWindow`;function x5t(){try{return localStorage.getItem(b5t)===`1`}catch{return!1}}function S5t(e){if(!e)return null;let t=e.endsWith(`++`)?[...e.slice(0,-2).split(`+`),`Plus`]:e.split(`+`),n={Mod:`CmdOrCtrl`,Alt:`Alt`,Shift:`Shift`,Ctrl:`Ctrl`,"=":`=`,"-":`-`,"[":`[`,"]":`]`,",":`,`,".":`.`,"/":`/`,Delete:`Delete`,Backspace:`Backspace`,Escape:`Escape`,Enter:`Enter`,Tab:`Tab`,Space:`Space`,Plus:`Plus`},r=[];for(let e of t)if(n[e])r.push(n[e]);else if(/^[A-Za-z0-9]$/.test(e))r.push(e.toUpperCase());else if(/^F([1-9]|1[0-2])$/.test(e))r.push(e);else return null;return r.join(`+`)}var C5t={"ui.undo":`undo`,"ui.redo":`redo`,"edit.cut":`cut`,"edit.copy":`copy`,"edit.paste":`paste`,"edit.selectAll":`select-all`},w5t=new Set([`button`,`checkbox`,`radio`,`range`,`color`,`file`,`submit`,`reset`,`image`]);function T5t(){let e=document.activeElement;return e instanceof HTMLTextAreaElement?!e.readOnly&&!e.disabled:e instanceof HTMLInputElement?!w5t.has(e.type)&&!e.readOnly&&!e.disabled:e instanceof HTMLElement&&e.isContentEditable}var E5t=class{commands;menus;before;items=[];building=!1;again=!1;stateTimer=0;needCore=!1;constructor(e,t,n=()=>Promise.resolve()){this.commands=e,this.menus=t,this.before=n;for(let e of[`pointerup`,`keyup`,`focusin`,`focusout`])window.addEventListener(e,()=>{this.items.length&&this.refresh()},{passive:!0})}async build(){if(this.building)this.again=!0;else{this.building=!0;try{let e=await P(()=>Promise.resolve().then(()=>(v5t(),_5t)),void 0,{}.url),t=[],n=async r=>{if(r===`-`)return e.PredefinedMenuItem.new({item:`Separator`});if(typeof r==`object`)return e.Submenu.new({text:F(r.label),items:(await Promise.all(r.items.map(n))).filter(Boolean)});let i=this.commands.get(r);if(!i)return null;let a=F(this.commands.label(i)),o=S5t(i.keys?.[0]),s={text:a,enabled:this.enabled(r),action:()=>{let e=C5t[r];e&&T5t()?P(()=>Promise.resolve().then(()=>(e8(),T8t)).then(t=>t.invoke(`text_edit`,{action:e})),void 0,{}.url).catch(()=>{document.execCommand(e===`select-all`?`selectAll`:e)}):this.commands.run(r),this.refresh()}},c;if(i.checked){let t={...s,checked:!!i.checked()};try{c=await e.CheckMenuItem.new(o?{...t,accelerator:o}:t)}catch{c=await e.CheckMenuItem.new(t)}}else try{c=await e.MenuItem.new(o?{...s,accelerator:o}:s)}catch{c=await e.MenuItem.new(s)}return t.push({id:r,text:a,item:c}),c},r=[];r.push(await e.Submenu.new({text:`FormDesign`,items:[await e.PredefinedMenuItem.new({item:{About:{name:`FormDesign`}},text:F(`About FormDesign`)}),await e.PredefinedMenuItem.new({item:`Separator`}),...this.commands.get(`ui.prefs`)?[await n(`ui.prefs`)]:[],await e.PredefinedMenuItem.new({item:`Separator`}),await e.PredefinedMenuItem.new({item:`Hide`}),await e.PredefinedMenuItem.new({item:`Quit`})]}));for(let t of this.menus()){let i=typeof t.items==`function`?t.items():t.items;r.push(await e.Submenu.new({text:F(t.label),items:(await Promise.all(i.map(n))).filter(Boolean)}))}await(await e.Menu.new({items:r})).setAsAppMenu(),this.items=t,document.documentElement.classList.add(`has-native-menus`)}finally{this.building=!1,this.again&&(this.again=!1,this.build())}}}enabled(e){if(C5t[e]&&T5t())return!0;let t=this.commands.get(e);return!!t&&this.commands.enabled(t)}refresh(e=!1){e&&(this.needCore=!0),!this.stateTimer&&(this.stateTimer=window.setTimeout(()=>{this.stateTimer=0;let e=this.needCore;this.needCore=!1,(e?this.before():Promise.resolve()).then(()=>{for(let e of this.items){let t=this.commands.get(e.id);if(!t)continue;e.item.setEnabled(this.enabled(e.id)).catch(()=>void 0),t.checked&&e.item.setChecked&&e.item.setChecked(!!t.checked()).catch(()=>void 0);let n=F(this.commands.label(t));n!==e.text&&e.item.setText&&(e.text=n,e.item.setText(n).catch(()=>void 0))}})},150))}},D5t=/\.(pdf|pub|qxd|qxp|pmd|p65|pm6|pm5|pm4|pm3|pt5|pt6|dxf|dwg|indd|indt|indb|inx)$/i,O5t=`.pdf,.pub,.qxd,.qxp,.pmd,.p65,.pm6,.pm5,.pm4,.pm3,.pt5,.pt6,.dxf,.dwg,.indd,.indt,.indb,.inx`,k5t={pdf:`PDF`,pub:`.pub file`,qxp:`.qxd or .qxp file`,pm:`.pmd or .p65 file`};function b8(e,t){return`
${b(e.source)} was rebuilt as an editable document with ${e.pages} page${e.pages===1?``:`s`}${e.via?` through ${b(e.via)}`:``}.
`];i.push(`
Converted
`),i.push(n.length?n.map(([e,t])=>b8(e,String(t))).join(``):b8(`Nothing editable was found`,``)),i.push(`
Kept as a backdrop
`),i.push(r.length?r.map(([e,t])=>b8(e,String(t))).join(``)+b8(`Backdrop pages`,String(e.backdropPages)):b8(`Nothing needed a backdrop`,``)),e.substituted.length&&(i.push(`
`));let r=f(``);r.addEventListener(`click`,()=>t.close()),t.foot.append(r),t.onClose=()=>t.scrim.remove(),t.open(r)}function M5t(e){let t=new k(e.kind===`pdf`?`Open PDF`:`Open ${k5t[e.kind]??`file`}`,480),n=e.kind===`pdf`?`Open ${b(e.name)} as a layout${e.pages?` (${e.pages} page${e.pages===1?``:`s`})`:``}: every page becomes a page of the same size, text becomes text frames grouped into lines and paragraphs, pictures are placed at their boxes, and simple rectangles and lines become shapes.`:`${b(e.name)} is converted through LibreOffice into an editable document: pages, text frames, pictures and shapes.`;t.body.append(f(`
${n}
`));let r=p(t.body,`.fd-open-backdrop`),i=f(``),a=f(``);return t.foot.append(a,i),new Promise(e=>{a.addEventListener(`click`,()=>{t.close(),e(null)}),i.addEventListener(`click`,()=>{let n=r.value;e({backdrop:n}),t.close()}),t.onClose=()=>{t.scrim.remove(),e(null)},t.open(i)})}async function N5t(e,t){let n=new FormData;n.append(`files`,e,e.name);try{let r=(await w(`/files`,{method:`POST`,body:n})).files[0]?.path??``,i=await w(`/documents/probe`,{json:{path:r}});if(i.kind===`indd`){j5t(i);return}if(i.kind===`dwg`){x(i.message??``,`error`);return}let a=i.kind===`dxf`?{backdrop:`never`}:await M5t(i);if(!a)return;x(`Converting ${e.name}`);let o=await w(`/documents/import`,{json:{path:r,options:{backdrop:a.backdrop}}});t(),A5t(o.report)}catch(e){x(E(e.message),`error`)}}var P5t=`0.93.1`,F5t=[`File`,`Edit`,`Layout`,`Type`,`Object`,`Table`,`Effect`,`View`,`Window`,`Help`],I5t=/\.(fdes|fdoc|idml|pub|qxd|qxp|pmd|p65|dxf|dwg|indd)$/i;function L5t(e){if(!e)return null;let t=e.split(`+`),n=t.pop()??``;if(!n)return null;let r=e=>t.some(t=>t.toLowerCase()===e),i=[];(r(`alt`)||r(`option`)||r(`opt`))&&i.push(`Alt`),r(`shift`)&&i.push(`Shift`),(r(`cmd`)||r(`mod`)||!te&&r(`ctrl`))&&i.push(`Mod`);let a=n.length===1?n.toUpperCase():n;return i.push(a===`Esc`?`Escape`:a),i.join(`+`)}var R5t=class{root;commands=new n6t;viewport;input;editor=D;panels=[];groups=new Map;panelBodies=new Map;additions=[];overrides=new Map;controls=new Map;dropHandlers=[];placeHandlers=[];menubar=null;home;flyout=null;coreLoaded=!1;fileInput=f(``);endPick=null;stage;dock=null;groupMenu=null;palette=null;menuGroup=``;status;constructor(e){this.root=e,this.stage=p(e,`.fd-stage`),this.viewport=new I6t(this.stage,p(e,`.fd-tiles`),p(e,`.fd-hilite`),p(e,`.fd-overlay`)),this.input=new i6t(this.viewport,this.stage),this.status=new S8t(p(e,`.fd-status`),this.viewport),this.input.onKeyCommand=e=>this.onKeyCommand(e),this.input.keysOff=e=>this.home.isShown&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&!/^F\d{1,2}$/.test(e.key),e.appendChild(this.fileInput),this.home=new f8t(this.stage.parentElement,{run:(e,t)=>this.commands.run(e,t),recent:()=>this.recent,openRecent:e=>void this.openPath(e)}),this.captionButtons=new n5t(p(e,`.cv-titlebar`),()=>{try{return localStorage.getItem(`formdesign.customTitleBar`)===`1`}catch{return!1}}),this.uiCommands(),this.wire()}captionButtons;recent=[];registerPanel(e){this.panels.some(t=>t.id===e.id)||(this.panels.push(e),this.groups.size&&this.mountPanel(e))}showPanel(e){let t=this.panels.find(t=>t.id===e);if(!t)return;let n=[...R.all.values()].find(t=>t.root.querySelector(`[data-panel="${e}"]`));n&&(this.dock?.show(n.id),n.show(e),n.setMinimised(!1)),t.onShow?.()}panelOpen(e){let t=[...R.all.values()].find(t=>t.has(e));return!!t&&!this.dock?.isHidden(t.id)&&!t.minimised&&t.current===e}layout(){let e={},t={};for(let[n,r]of R.all){e[n]={tab:r.current,min:r.minimised};for(let e of r.tabIds)t[e]=n}return{dock:this.dock?.snapshot??{left:[],side:[],dock:[],hidden:[],heights:{},custom:[],width:null,collapsed:[]},groups:e,homes:t}}applyLayout(e){if(!this.dock)return;let t=e.dock?.custom??[];this.dock.setState({...e.dock,custom:t});for(let t of this.panels){let n=R.all.get(e.homes?.[t.id]??``)??R.all.get(t.group),r=[...R.all.values()].find(e=>e.has(t.id));n&&r&&n!==r&&!n.full&&R.moveTab(t.id,r,n)}R.saveHomes();for(let e of[...R.all.values()])/^g[0-9a-z]+$/.test(e.id)&&e.size===0&&!t.some(t=>t.id===e.id)&&e.remove();for(let[t,n]of R.all){let r=e.groups?.[t];r?.tab&&n.has(r.tab)&&n.show(r.tab),n.setMinimised(r?.min??R.startMin.has(t))}this.dock.refresh()}menuAreas(){let e=new Map;for(let t of F5t){let n=r=>{for(let i of r)typeof i==`string`?i!==`-`&&!e.has(i)&&e.set(i,t):n(i.items)};n(this.menuItems(t))}return e}addCommands(...e){this.commands.add(...e)}addMenuItems(e){this.additions.push(e)}override(e,t){this.overrides.set(e,t)}onDropFiles(e){this.dropHandlers.push(e)}onPlaceFile(e){this.placeHandlers.push(e)}setHint(e){this.status.setHint(e)}showHome(){this.home.show()}setControl(e,t,n=0){let r=p(this.root,`.fd-control`),i=this.controls.get(e);if(!t){i&&(i.node.remove(),this.controls.delete(e));return}if(i?.node===t)return;i?.node.remove(),this.controls.set(e,{node:t,priority:n});let a=[...this.controls.entries()].sort((e,t)=>t[1].priority-e[1].priority).map(([,e])=>e.node);for(let e of a)r.appendChild(e)}async runCore(e,t={}){try{let n=await T.call(`exec`,{command:e,params:t});return D.handleRequests(n.meta?.requests),D.schedule(),D.onExec?.(e,t),n.result}catch(n){let r=E(n.message),i=D.command(e);i&&/missing|needs|expected|required|no `/i.test(r)&&i.params&&i.params!==`{}`?this.paramsDialog(i,r,t):x(r,`error`);return}}pickFiles(e,t=!1){return new Promise(n=>{let r=this.fileInput;this.endPick?.(),r.value=``,r.accept=e,r.multiple=t;let i=e=>{r.removeEventListener(`change`,a),r.removeEventListener(`cancel`,o),this.endPick===o&&(this.endPick=null),n(e)},a=()=>i(Array.from(r.files??[])),o=()=>i([]);this.endPick=o,r.addEventListener(`change`,a),r.addEventListener(`cancel`,o),r.click()})}async upload(e){if(!e.length)return[];let t=new FormData;for(let n of e)t.append(`files`,n,n.name);return(await w(`/files`,{method:`POST`,body:t})).files.map(e=>e.path)}paramsDialog(e,t,n){e8t(this,e,t,n)}uiCommands(){let e=this.viewport,t=()=>D.hasDoc,n=t=>{e.opts[t]=!e.opts[t],t===`preview`&&e.invalidateAll(),e.drawOverlays(),e.refreshOverlays()};this.commands.add({id:`ui.home`,label:`Home`,run:()=>{this.home.show(),this.loadRecent()}},{id:`ui.open`,label:`Open…`,keys:[`Mod+O`],run:()=>void this.openDialog()},{id:`ui.save`,label:`Save`,keys:[`Mod+S`],enabled:t,run:()=>void this.save(!1)},{id:`ui.saveAs`,label:`Save As…`,keys:[`Shift+Mod+S`],enabled:t,run:()=>void this.save(!0)},{id:`ui.close`,label:`Close`,keys:[`Mod+W`],enabled:t,run:()=>void this.closeDoc(D.active??0)},{id:`ui.place`,label:`Place…`,keys:[`Mod+D`],enabled:t,run:()=>void this.place()},{id:`ui.undo`,label:()=>D.doc?.undoLabel?`Undo ${D.doc.undoLabel}`:`Undo`,keys:[`Mod+Z`],enabled:()=>!!D.doc?.canUndo,run:()=>void D.exec(`edit.undo`)},{id:`ui.redo`,label:()=>D.doc?.redoLabel?`Redo ${D.doc.redoLabel}`:`Redo`,keys:[`Shift+Mod+Z`],enabled:()=>!!D.doc?.canRedo,run:()=>void D.exec(`edit.redo`)},{id:`ui.zoomIn`,label:`Zoom In`,keys:[`Mod+=`,`Mod++`],enabled:t,run:()=>e.zoomAt(1.25)},{id:`ui.zoomOut`,label:`Zoom Out`,keys:[`Mod+-`],enabled:t,run:()=>e.zoomAt(.8)},{id:`ui.fitPage`,label:`Fit Page in Window`,keys:[`Mod+0`],enabled:t,run:()=>e.fitPage()},{id:`ui.fitSpread`,label:`Fit Spread in Window`,keys:[`Alt+Mod+0`],enabled:t,run:()=>e.fitSpread()},{id:`ui.actualSize`,label:`Actual Size`,keys:[`Mod+1`],enabled:t,run:()=>e.zoomTo(1)},{id:`ui.fitAll`,label:`Entire Pasteboard`,keys:[`Alt+Shift+Mod+0`],enabled:t,run:()=>e.fitAll()},{id:`ui.guides`,label:`Guides and Margins`,keys:[`Mod+;`],checked:()=>e.opts.guides,run:()=>n(`guides`)},{id:`ui.frames`,label:`Frame Edges`,keys:[`Alt+Mod+H`],checked:()=>e.opts.frames,run:()=>n(`frames`)},{id:`ui.baseline`,label:`Baseline Grid`,keys:[`Alt+Mod+'`],checked:()=>e.opts.baseline,run:()=>n(`baseline`)},{id:`ui.threads`,label:`Text Threads`,keys:[`Alt+Mod+Y`],checked:()=>e.opts.threads,run:()=>n(`threads`)},{id:`ui.preview`,label:`Preview`,keys:[`W`],checked:()=>e.opts.preview,run:()=>n(`preview`)},{id:`ui.quality`,label:()=>e.opts.quality===`high`?`Typical Display`:`High Quality Display`,run:()=>{e.opts.quality=e.opts.quality===`high`?`typical`:`high`,e.invalidateAll()}},{id:`ui.prevPage`,label:`Previous Page`,keys:[`Shift+PageUp`],enabled:t,run:()=>this.stepPage(-1)},{id:`ui.nextPage`,label:`Next Page`,keys:[`Shift+PageDown`],enabled:t,run:()=>this.stepPage(1)},{id:`ui.panels`,label:`Hide Panels`,keys:[`Tab`],run:()=>this.root.classList.toggle(`is-panels-hidden`)},{id:`ui.customTitleBar`,label:`Custom Title Bar`,enabled:()=>t5t(),checked:()=>this.captionButtons.active,run:()=>{try{localStorage.setItem(`formdesign.customTitleBar`,this.captionButtons.active?`0`:`1`)}catch{}this.captionButtons.sync()}},{id:`ui.menusInWindow`,label:`Menus in Window`,enabled:()=>`__TAURI_INTERNALS__`in window&&/Mac/.test(navigator.platform),checked:x5t,run:()=>{let e=x5t()?`0`:`1`;try{localStorage.setItem(b5t,e)}catch{}x(e===`1`?`The menus stay in the window from the next start.`:`The menus go to the menu bar from the next start.`,`info`)}},{id:`ui.about`,label:`About FormDesign`,run:()=>x(`FormDesign ${P5t} · layout core ${D.coreVersion||`offline`} · Apache-2.0`)},{id:`ui.search`,label:`Search…`,keys:[`Mod+K`],run:()=>{this.palette??=new i8t(this.commands,()=>F5t.map(e=>({label:e,items:()=>this.menuItems(e)}))),this.palette.show()}},{id:`ui.collapseLeft`,keys:[`Alt+Shift+Mod+L`],label:()=>this.dock?.isCollapsed(`left`)?`Expand Left Panels`:`Collapse Left Panels to Minirail`,run:()=>this.dock?.setCollapsed(`left`,!this.dock.isCollapsed(`left`))},{id:`ui.collapseRight`,keys:[`Shift+Tab`],label:()=>this.dock?.isCollapsed(`dock`)?`Expand Right Panels`:`Collapse Right Panels to Icons`,run:()=>{let e=!this.dock?.isCollapsed(`dock`);this.dock?.setCollapsed(`side`,e),this.dock?.setCollapsed(`dock`,e)}},{id:`ui.group.close`,label:`Close Group`,run:()=>{this.menuGroup&&this.dock?.hide(this.menuGroup)}},{id:`ui.group.minimise`,label:()=>R.all.get(this.menuGroup)?.minimised?`Expand Group`:`Minimise Group`,run:()=>{let e=R.all.get(this.menuGroup);e?.setMinimised(!e.minimised)}})}stepPage(e){let t=D.layout?.pages.length??0;if(!t)return;let n=this.viewport.currentPage();this.viewport.showPage(Math.max(0,Math.min(t-1,n+e)))}onKeyCommand(e){if(this.menubar?.isOpen)return!1;let t=e6t(e);if(D.wantsText&&!/Mod\+|(^|\+)F\d{1,2}$/.test(t)&&t!==`Escape`||t===`Tab`&&D.wantsText||D.tool===`artboard`&&(t===`Delete`||t===`Backspace`))return!1;let n=this.commands.forCombo(t);if(!n)return this.commands.released(t);let r=D.command(n.id);return r&&!r.enabled&&!this.overrides.has(n.id)?(this.refreshEnabled().then(()=>{this.commands.run(n.id)}),!0):this.commands.run(n.id)||!0}addCoreCommands(){if(this.coreLoaded||!D.commands.length)return;this.coreLoaded=!0;let e=new Set(this.commands.all().flatMap(e=>e.keys??[]));for(let t of D.commands){if(this.commands.get(t.id))continue;let n=L5t(t.shortcut),r=n&&!e.has(n)?[n]:[];for(let t of r)e.add(t);this.commands.add({id:t.id,label:this.menuShape(t).label,keys:r,enabled:()=>D.command(t.id)?.enabled??!0,run:()=>{let e=this.overrides.get(t.id);e?e():$6t(t)?this.paramsDialog(t,``,{}):this.runCore(t.id)}})}}menuItems(e){let t=[],n=[],r=[];for(let i of this.additions.filter(t=>t.menu===e))(i.at===`top`?t:i.at===`start`?n:r).push(...i.items,`-`);let i=this.coreTree(e),a=this.uiMenu(e),o=[...t,...a.pre,...a.pre.length?[`-`]:[],...n,...i,...r.length?[`-`,...r]:[],...a.post.length?[`-`,...a.post]:[]],s=[];for(let e of o)(e!==`-`||s.length&&s[s.length-1]!==`-`)&&s.push(e);for(;s.length&&s[s.length-1]===`-`;)s.pop();return s}uiMenu(e){switch(e){case`File`:return{pre:[`ui.open`,`ui.close`,`ui.save`,`ui.saveAs`,`-`,`ui.place`],post:[]};case`Edit`:return{pre:[`ui.undo`,`ui.redo`],post:[`ui.search`,`ui.shortcuts`]};case`View`:return{pre:[`ui.zoomIn`,`ui.zoomOut`,`ui.fitPage`,`ui.fitSpread`,`ui.actualSize`,`ui.fitAll`,`-`,`ui.preview`,`ui.quality`,`-`,`ui.rulers`,`ui.guides`,`ui.frames`,`ui.baseline`,`ui.threads`,`-`,`ui.prevPage`,`ui.nextPage`],post:[`ui.customTitleBar`,`ui.menusInWindow`]};case`Window`:return{pre:this.panels.map(e=>`ui.panel.${e.id}`),post:[`ui.collapseLeft`,`ui.collapseRight`,`ui.panels`,`ui.home`]};case`Help`:return{pre:[`ui.about`],post:[]};default:return{pre:[],post:[]}}}prefixCache=null;menuShape(e){let t=(e.menu??[]).slice(1);if(!t.length)return{subs:[],label:e.label};if(!this.prefixCache){let e=new Set;for(let t of D.commands)for(let n=2;n<(t.menu?.length??0);n++)e.add(t.menu.slice(0,n).join(`>`));this.prefixCache=e}return this.prefixCache.has(e.menu.join(`>`))?{subs:t,label:e.label}:{subs:t.slice(0,-1),label:t[t.length-1].replace(/\.\.\.$/,`…`)}}coreTree(e){let t=new Set([`file.open`,`file.save`,`file.saveAs`,`file.close`,`edit.undo`,`edit.redo`,`file.place`]),n=[],r=new Map;for(let i of D.commands){if(!i.menu?.length||i.menu[0]!==e||t.has(i.id))continue;if(i.menu.length===1){n.push(i.id);continue}let a=this.menuShape(i).subs,o=n,s=e;for(let e of a){s+=`>`+e;let t=r.get(s);t||(t={label:e,items:[]},r.set(s,t),o.push(t)),o=t.items}o.push(i.id)}return n}buildMenus(){if(this.menubar)return;for(let e of this.panels)this.commands.get(`ui.panel.${e.id}`)||this.commands.add({id:`ui.panel.${e.id}`,label:e.label,checked:()=>this.panelOpen(e.id),run:()=>this.showPanel(e.id)});let e=F5t.map(e=>({label:e,items:()=>this.menuItems(e)}));if(this.menubar=new o0t(p(this.root,`.cv-menubar`),this.commands,e),this.menubar.onBeforeOpen=()=>void this.refreshEnabled().then(()=>this.menubar?.refreshOpen()),y5t()){let t=new E5t(this.commands,()=>e,()=>this.refreshEnabled());t.build().catch(()=>void 0);for(let e of[`docs`,`selection`,`tool`,`layout`])D.on(e,()=>t.refresh(!0));D.on(`commands`,()=>{t.build().catch(()=>void 0)}),k$t(()=>{t.build().catch(()=>void 0)})}}enabling=null;async refreshEnabled(){return this.enabling||=(async()=>{try{let e=await T.call(`commands`,{}),t=Array.isArray(e.result)?e.result:e.result.commands;for(let e of t){let t=D.command(e.id);t&&(t.enabled=e.enabled)}}catch{}})().finally(()=>{this.enabling=null}),this.enabling}mountPanels(){let e=p(this.root,`.fd-left-col`),t=p(this.root,`.cv-props-col`),n=p(this.root,`.cv-layers`),r=r=>r===`left`?e:r===`side`?t:n;R.startMin=new Set([`swatches`,`preflight`,`typeextra`,`review`,`interactive`,`xml`,`library`,`connect`]);let i=new Map;for(let e of[...this.panels].sort((e,t)=>(e.order??50)-(t.order??50))){let t=i.get(e.group)??[];t.push(e),i.set(e.group,t)}for(let[e,t]of i){let n=t.map(e=>{let t=e.create();return t.dataset.panel=e.id,this.panelBodies.set(e.id,t),{id:e.id,label:e.label,body:t}}),i=new R(r(t[0].column),e,n,t.map(e=>e.label).join(`, `));i.onTab=e=>this.panels.find(t=>t.id===e)?.onShow?.(),this.groupMenuFor(i),this.groups.set(e,i)}let a=(e,t,n)=>{let r=new R(e,t,[],n);return r.onTab=e=>this.panels.find(t=>t.id===e)?.onShow?.(),this.groupMenuFor(r),r},o=new b8t(this.root,{left:e,side:t,dock:n},p(this.root,`.cv-resizer`),a,p(this.root,`.fd-minirail`));this.dock=o,R.restoreHomes(),R.onMoved=()=>o.refresh(),R.onGapHint=(e,t)=>{e===null?o.hideGap():o.showGap(e,t,`New group`)},R.onDetach=(e,t,n,r)=>{let i=o.gapAt(n,r);if(!i||t.size<2)return!1;let s=`g${Date.now().toString(36)}`,c=t.labelOf(e),l=a(i.host,s,c);return o.addCustom(s,c,i.col,i.index),R.moveTab(e,t,l),!0},o.refresh()}groupMenuFor(e){p(e.root,`.cv-group-head`).addEventListener(`contextmenu`,t=>{t.preventDefault(),this.menuGroup=e.id,this.groupMenu??=new i0t(this.commands,null,!0),this.groupMenu.setItems([`ui.group.close`,`ui.group.minimise`]),this.groupMenu.openAt(t.clientX,t.clientY)})}mountPanel(e){let t=this.groups.get(e.group),n=e.create();n.dataset.panel=e.id,this.panelBodies.set(e.id,n),t?t.addTab(e.id,e.label,n):this.groups.set(e.group,new R(p(this.root,e.column===`left`?`.fd-left-col`:e.column===`side`?`.cv-props-col`:`.cv-layers`),e.group,[{id:e.id,label:e.label,body:n}],e.label))}wire(){let e=this.root;e.addEventListener(`click`,t=>{let n=t.target.closest(`[data-cmd]`);if(!n||!e.contains(n)||n.closest(`.cv-group`))return;let r=n.dataset.cmd,i={home:`ui.home`,undo:`ui.undo`,redo:`ui.redo`,"zoom-in":`ui.zoomIn`,"zoom-out":`ui.zoomOut`,"fit-spread":`ui.fitSpread`,make:`ui.make`,settings:`ui.prefs`,new:`ui.templates`,claude:`ui.terminal.claude`,terminal:`ui.terminal.toggle`};i[r]&&this.commands.run(i[r])}),D.on(`commands`,()=>{this.addCoreCommands(),this.buildMenus(),this.publishActions()}),T.on(`view`,e=>this.agentView(e)),D.on(`docs`,()=>{this.syncTabs(),this.home.sync(D.docs.length),this.syncTitle(),D.docs.length||this.loadRecent()}),D.on(`tool`,()=>this.syncTools()),D.on(`commands`,()=>this.renderTools()),D.on(`connection`,e=>this.syncStatus(e)),D.on(`layout`,()=>this.syncPageLabel()),D.on(`request`,e=>this.onRequest(e)),this.viewport.onView=()=>{this.syncZoom(),this.syncPageLabel()},T.on(`close`,()=>this.syncStatus(!1)),this.syncStatus(!1),s(p(e,`.fd-st-version`),`FormDesign ${P5t}`),window.addEventListener(`dragover`,t=>{t.dataTransfer?.types.includes(`Files`)&&(t.preventDefault(),m(p(e,`.cv-drop`),!1))}),window.addEventListener(`dragleave`,t=>{t.relatedTarget||m(p(e,`.cv-drop`),!0)}),window.addEventListener(`drop`,t=>{t.preventDefault(),m(p(e,`.cv-drop`),!0);let n=Array.from(t.dataTransfer?.files??[]);n.length&&this.dropFiles(n)}),window.addEventListener(`paste`,e=>{let t=e.target;if(t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`))return;let n=e.clipboardData?.getData(`text/plain`)??``;D.wantsText&&n&&(e.preventDefault(),this.input.paste(n))}),window.addEventListener(`beforeunload`,e=>{D.docs.some(e=>e.dirty)&&!(`__TAURI_INTERNALS__`in window)&&e.preventDefault()}),this.loadRecent()}published=!1;publishTimer=0;publishActions(){this.menubar&&(this.published||(this.published=!0,this.commands.onChange=()=>{window.clearTimeout(this.publishTimer),this.publishTimer=window.setTimeout(()=>this.sendCatalogue(),400)},T.on(`command`,e=>void this.runForAgent(e)),T.on(`open`,()=>this.sendCatalogue())),this.sendCatalogue())}sendCatalogue(){let e=this.menuAreas(),t=this.commands.all().filter(e=>!D.command(e.id)),n=t.map(t=>({id:t.id,label:this.commands.label(t),keys:t.keys??[],menu:e.get(t.id)??``})),r=t.map(e=>({...n.find(t=>t.id===e.id),group:e.group??(e.id.startsWith(`tool.`)?`tool`:e.id.split(`.`)[0]===`ui`?`window`:e.id.split(`.`)[0]),description:e.description??``,when:e.when??``,params:e.params??{},mutates:e.mutates??!1,risky:e.risky??!1}));w(`/actions/window`,{method:`POST`,json:{actions:n}}).catch(()=>void 0),w(`/commands/catalogue`,{method:`POST`,json:{commands:r}}).catch(()=>void 0)}async runForAgent(e){let t;try{let n=this.commands.get(e.id);t=n?this.commands.enabled(n)?await this.commands.call(e.id,e.params):{ran:!1,error:this.commands.why(n)||`${e.id} is not available right now`}:{ran:!1,error:`no window command ${e.id}`}}catch(e){t={ran:!1,error:e.message}}await w(`/commands/reply/${e.rid}`,{method:`POST`,json:t}).catch(()=>void 0)}agentView(e){if(e.panel&&this.showPanel(e.panel),e.tool&&D.setTool(e.tool),!D.hasDoc)return;typeof e.page==`number`&&this.viewport.showPage(e.page);let t=String(e.zoom??``).trim().toLowerCase();t===`fit-page`?this.viewport.fitPage():t===`fit-spread`?this.viewport.fitSpread():/^\d+(\.\d+)?%?$/.test(t)&&this.viewport.zoomTo(Math.max(.05,Math.min(40,parseFloat(t)/100)))}async loadRecent(){try{this.recent=await w(`/documents/recent`)}catch{this.recent=[]}this.home.sync(D.docs.length)}async dropFiles(e){let t=e.filter(e=>I5t.test(e.name));if(t.length===e.length)for(let e of t)await this.openFile(e);else{for(let t of this.dropHandlers)if(t(e))return;x(`Drop files on the Make panel to lay them out`)}}async openFile(e){if(D5t.test(e.name)){await N5t(e,()=>D.refreshMeta());return}let t=new FormData;t.append(`file`,e,e.name);try{await w(`/documents/upload`,{method:`POST`,body:t}),D.refreshMeta()}catch(e){x(E(e.message),`error`)}}async openPath(e){try{await w(`/documents/open`,{json:{path:e}}),D.refreshMeta()}catch(e){x(E(e.message),`error`)}}async openDialog(){let e=await this.pickFiles(`.fdes,.fdoc,.idml,${O5t}`,!0);for(let t of e)await this.openFile(t)}async save(e){let t=D.doc;if(!t)return!1;let n;if(e||!t.path||!/\.fdes$/i.test(t.path)){let r=new k(e?`Save As`:`Save`,460);r.body.append(f(`
A .fdes file keeps the layout, its slots and the content it was made from. End the name with .idml for an IDML package or .fdoc for the bare layout.
`));let i=p(r.body,`.fd-save-path`),a=``;try{a=(await w(`/capabilities`)).paths?.projects??``}catch{}let o=(t.title||`Untitled`).replace(/\.(fdes|fdoc|idml)$/i,``);i.value=t.path&&/\.fdes$/i.test(t.path)?t.path:`${a?a.replace(/[\\/]$/,``)+(a.includes(`\\`)?`\\`:`/`):``}${o}.fdes`;let s=f(``),c=f(``);r.foot.append(c,s);let l=await new Promise(e=>{c.addEventListener(`click`,()=>{r.close(),e(null)}),s.addEventListener(`click`,()=>{e(i.value.trim()||null),r.close()}),i.addEventListener(`keydown`,e=>{e.key===`Enter`&&s.click()}),r.onClose=()=>{r.scrim.remove(),e(null)},r.open(i)});if(!l)return!1;n=l}try{return x(`Saved ${(await w(`/documents/save`,{json:n?{path:n}:{}})).path}`),D.refreshMeta(),!0}catch(e){return x(E(e.message),`error`),!1}}async closeDoc(e){let t=D.docs[e];if(t){if(t.dirty){D.active!==e&&await D.activate(e);let n=await wee(t.title);if(n===`cancel`||n===`save`&&!await this.save(!1))return}try{await w(`/documents/close`,{json:{index:e}})}catch(e){x(E(e.message),`error`)}D.refreshMeta()}}async place(){let e=await this.pickFiles(`image/*,video/*,audio/*,.pdf,.svg,.eps,.txt,.md,.docx,.rtf,.csv,.xlsx,.idml,.html`,!0);if(e.length)try{let t=await this.upload(e),n=!1;if(t.length===1){for(let e of this.placeHandlers)if(await e(t[0])){n=!0;break}}if(n)return;t.length>1?await this.runCore(`place.load`,{paths:t}):await this.runCore(`file.place`,{path:t[0]}),this.setHint(`Click or drag to place the loaded content`)}catch(e){x(E(e.message),`error`)}}onRequest(e){let t=e?.kind??Object.keys(e??{})[0];if(t===`toast`){let t=typeof e.text==`string`?E(e.text).trim():``;t&&x(t,`error`)}else if(t===`pick`&&(e.purpose??e.pick?.purpose)===`place`)this.place();else if(t===`view`){let t=e.params??{};typeof t.page==`number`&&this.viewport.showPage(t.page)}else if(t===`dialog`){let t=String(e.id??``),n=D.commands.find(e=>e.id===t||e.id.endsWith(`.${t}`));n&&this.paramsDialog(n,`Set the options, then run.`,e.params??{})}}renderTools(){let e=p(this.root,`.cv-rail-tools`);if(e.childElementCount||!D.tools.length)return;D.tools.forEach((t,n)=>{if(!t.length){e.appendChild(f(``));return}let r=t[0],i=f(``);i.dataset.group=String(n),i.dataset.tool=r.id,g(i,r.shortcut?`${r.label} (${r.shortcut})`:r.label),i.addEventListener(`click`,()=>void D.setTool(i.dataset.tool));let a=0,o=()=>this.toolFlyout(i,t);i.addEventListener(`pointerdown`,()=>{t.length>1&&(a=window.setTimeout(o,380))}),i.addEventListener(`pointerup`,()=>window.clearTimeout(a)),i.addEventListener(`pointerleave`,()=>window.clearTimeout(a)),i.addEventListener(`contextmenu`,e=>{e.preventDefault(),t.length>1&&o()}),e.appendChild(i)});let t=p(this.root,`.fd-fillstroke`);t.childElementCount||t.append(f(`${a3(`fill-stroke`,22)}`)),this.syncTools()}toolFlyout(e,t){this.flyout?.remove();let n=f(``);for(let r of t){let t=f(``);s(t.querySelectorAll(`span`)[0],r.label),s(p(t,`.cv-flyout-key`),r.shortcut??``),t.addEventListener(`click`,()=>{e.dataset.tool=r.id,e.innerHTML=a3(r.icon,20),g(e,r.shortcut?`${r.label} (${r.shortcut})`:r.label),D.setTool(r.id),n.remove(),this.flyout=null}),n.appendChild(t)}document.getElementById(`overlay-root`)?.appendChild(n);let r=e.getBoundingClientRect();n.style.left=`${Math.round(r.right+6)}px`,n.style.top=`${Math.round(r.top)}px`,this.flyout=n;let i=e=>{n.contains(e.target)||(n.remove(),this.flyout=null,document.removeEventListener(`pointerdown`,i,!0))};window.setTimeout(()=>document.addEventListener(`pointerdown`,i,!0),0)}syncTools(){let e=p(this.root,`.cv-rail-tools`);for(let t of Array.from(e.querySelectorAll(`.cv-tool`))){let e=(D.tools[Number(t.dataset.group)]??[]).find(e=>e.id===D.tool);e&&t.dataset.tool!==e.id&&(t.dataset.tool=e.id,t.innerHTML=a3(e.icon,20),g(t,e.shortcut?`${e.label} (${e.shortcut})`:e.label)),c(t,`is-active`,!!e)}let t=D.tools.flat().find(e=>e.id===D.tool);this.setHint(t?t.label:``)}syncTabs(){a(p(this.root,`.cv-tab-strip`),D.docs,{key:e=>String(e.uid),create:e=>{let t=f(`
`);return t.addEventListener(`click`,e=>{let n=D.docs.findIndex(e=>String(e.uid)===t.dataset.key);e.target.closest(`.cv-tab-close`)?this.closeDoc(n):n>=0&&n!==D.active&&D.activate(n)}),this.updateTab(t,e),t},update:(e,t)=>this.updateTab(e,t)})}updateTab(e,t){s(p(e,`.cv-tab-name`),t.title||`Untitled`),g(e,t.path??t.title),c(e,`is-dirty`,t.dirty),c(e,`is-active`,D.docs[D.active??-1]?.uid===t.uid)}syncTitle(){let e=D.doc;document.title=e?`${e.dirty?`• `:``}${e.title} · FormDesign`:`FormDesign`}syncZoom(){s(p(this.root,`.fd-zoom-label`),D.hasDoc?`${Math.round(this.viewport.view.zoom*100)}%`:``),this.status.syncView()}syncPageLabel(){let e=D.layout,t=p(this.root,`.fd-st-page`);if(!e||!e.pages.length){s(t,``);return}let n=this.viewport.currentPage(),r=e.pages.find(e=>e.abs===n);s(t,r?r.name===String(r.abs+1)?`Page ${r.name} of ${e.pages.length}`:`Page ${r.name} (${r.abs+1} of ${e.pages.length})`:``)}syncStatus(e){let t=p(this.root,`.fd-st-engine`);e?s(t,D.coreVersion?`Layout core ${D.coreVersion}`:`Engine ready`):s(t,T.connected?`Engine running`:`Connecting to the engine (./formdesign boot)`),c(this.root,`is-offline`,!e)}},z5t=`formdesign.shortcuts.set`,x8=`formdesign.shortcuts.keys`,S8=[`File`,`Edit`,`Layout`,`Type`,`Object`,`Table`,`Effect`,`View`,`Window`,`Help`,`Tools`,`Other`],B5t=e=>{try{return localStorage.getItem(e)}catch{return null}},C8=(e,t)=>{try{localStorage.setItem(e,t)}catch{}},V5t=class{ws;sets;active;choose;changed;create;removeSet;d=new k(`Keyboard Shortcuts`,660);root=f(`
diff --git a/frontend/HASHOUT_LOG.md b/frontend/HASHOUT_LOG.md
index 8df8a28..4168a33 100644
--- a/frontend/HASHOUT_LOG.md
+++ b/frontend/HASHOUT_LOG.md
@@ -2,8 +2,8 @@
Living log for the window. Source files stay comment-free; what they would have said lives here, indexed. Read it before editing `frontend/`.
-Current build version: v0.93.0
-Last updated: 2026-11-20 · the token file defines the seven FormVis names it lacked · the three browser demos are rebuilt for 0.93.0 · the program fields for Codex, Cursor and Antigravity · the three browser demos are rebuilt for 0.92.0 · the shared dock is module 2.2.1 · the three browser demos are rebuilt; 2026-11-19 · no window change in 0.90.0 (the version string only) · the shared dock is module 2.2.0 with Antigravity as its fourth agent tab · the terminal panel is the family's shared dock · the window takes the engine's key once and sends it on every write · a reload in development tries the kept key before asking the engine again · Agent Connect says in its own line that the saved agent permission was reset to Ask · AMOLED Black, a true-black theme for OLED screens · 2026-11-13 · keys on Home stay on Home · the window is revealed once the first document state is known · Back in the narrow row, the drop card lights, real demo covers, translated Home · the demos as browser pages that replay the engine · the family Home with a side panel that resizes and collapses · three demos open as new documents · the title bar Claude Code and Terminal buttons light with the dock · the unused two-star make glyph is gone · 2026-11-11 · core toast requests reach the screen · PNG and JPEG export pages count from 1 · 2026-11-10 · Find/Change follows the caret into another story · Publish Online waits for the list · Generate Alt Text shows only the latest answer · the Plugins setup lines quote the folder · each glyph preview font gets its own name · the Adjustments curve keeps drawing when two points share an input · pica lengths with a minus sign or a lone point · z-index on the layer scale, colours on real tokens · ticked stories stay with their own document · Claude Code's context names the open document · the Editor role hides its menus in every language · an empty object style stroke weight keeps the default · Make never reuses a removed file's content · margins and columns come from the page in view · Ctrl+J only on Show Terminal · Play Action works before the Actions panel is shown · every pixel ratio change resizes the canvases · tiles load after a tab change mid-request · a slot preview is never saved over the full story · a closed dropdown leaves nothing behind · Document Setup keeps a per-side bleed · a new animation starts from the preset's defaults · the Story Editor sends whole characters · a dropped Library item lands under the cursor · a cancelled file picker leaves no listener · a Text Options paragraph border draws · the panels follow a new selection or caret · a plug-in's panel title is set as text · copied objects without text paste as themselves · Save As and Open as layout pass the answer on · the Missing Fonts note takes the title as text · copy, cut and paste reach the system clipboard
+Current build version: v0.93.1
+Last updated: 2026-11-20 · no window change in 0.93.1 (the version string only); the three browser demos are rebuilt for 0.93.1 · the token file defines the seven FormVis names it lacked · the three browser demos are rebuilt for 0.93.0 · the program fields for Codex, Cursor and Antigravity · the three browser demos are rebuilt for 0.92.0 · the shared dock is module 2.2.1 · the three browser demos are rebuilt; 2026-11-19 · no window change in 0.90.0 (the version string only) · the shared dock is module 2.2.0 with Antigravity as its fourth agent tab · the terminal panel is the family's shared dock · the window takes the engine's key once and sends it on every write · a reload in development tries the kept key before asking the engine again · Agent Connect says in its own line that the saved agent permission was reset to Ask · AMOLED Black, a true-black theme for OLED screens · 2026-11-13 · keys on Home stay on Home · the window is revealed once the first document state is known · Back in the narrow row, the drop card lights, real demo covers, translated Home · the demos as browser pages that replay the engine · the family Home with a side panel that resizes and collapses · three demos open as new documents · the title bar Claude Code and Terminal buttons light with the dock · the unused two-star make glyph is gone · 2026-11-11 · core toast requests reach the screen · PNG and JPEG export pages count from 1 · 2026-11-10 · Find/Change follows the caret into another story · Publish Online waits for the list · Generate Alt Text shows only the latest answer · the Plugins setup lines quote the folder · each glyph preview font gets its own name · the Adjustments curve keeps drawing when two points share an input · pica lengths with a minus sign or a lone point · z-index on the layer scale, colours on real tokens · ticked stories stay with their own document · Claude Code's context names the open document · the Editor role hides its menus in every language · an empty object style stroke weight keeps the default · Make never reuses a removed file's content · margins and columns come from the page in view · Ctrl+J only on Show Terminal · Play Action works before the Actions panel is shown · every pixel ratio change resizes the canvases · tiles load after a tab change mid-request · a slot preview is never saved over the full story · a closed dropdown leaves nothing behind · Document Setup keeps a per-side bleed · a new animation starts from the preset's defaults · the Story Editor sends whole characters · a dropped Library item lands under the cursor · a cancelled file picker leaves no listener · a Text Options paragraph border draws · the panels follow a new selection or caret · a plug-in's panel title is set as text · copied objects without text paste as themselves · Save As and Open as layout pass the answer on · the Missing Fonts note takes the title as text · copy, cut and paste reach the system clipboard
---
diff --git a/frontend/package-lock.json b/frontend/package-lock.json
index df33c9a..2a2aa56 100644
--- a/frontend/package-lock.json
+++ b/frontend/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "formdesign",
- "version": "0.93.0",
+ "version": "0.93.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "formdesign",
- "version": "0.93.0",
+ "version": "0.93.1",
"license": "Apache-2.0",
"dependencies": {
"@fontsource/inter": "5.3.0",
diff --git a/frontend/package.json b/frontend/package.json
index f9e6fe0..a8f0948 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -1,7 +1,7 @@
{
"name": "formdesign",
"private": true,
- "version": "0.93.0",
+ "version": "0.93.1",
"description": "FormDesign · page layout and publishing in the NodeMode style",
"license": "Apache-2.0",
"type": "module",
diff --git a/frontend/src/version.ts b/frontend/src/version.ts
index 82bde0f..4d95d5c 100644
--- a/frontend/src/version.ts
+++ b/frontend/src/version.ts
@@ -1 +1 @@
-export const VERSION = '0.93.0';
+export const VERSION = '0.93.1';
diff --git a/native/Cargo.lock b/native/Cargo.lock
index 8d6eebf..61ba14b 100644
--- a/native/Cargo.lock
+++ b/native/Cargo.lock
@@ -410,7 +410,7 @@ dependencies = [
[[package]]
name = "formdesign-core"
-version = "0.93.0"
+version = "0.93.1"
dependencies = [
"fancy-regex",
"formdesign-engine",
@@ -426,7 +426,7 @@ dependencies = [
[[package]]
name = "formdesign-engine"
-version = "0.93.0"
+version = "0.93.1"
dependencies = [
"fancy-regex",
"formdesign-interchange",
@@ -445,7 +445,7 @@ dependencies = [
[[package]]
name = "formdesign-gpu"
-version = "0.93.0"
+version = "0.93.1"
dependencies = [
"bytemuck",
"png",
@@ -456,7 +456,7 @@ dependencies = [
[[package]]
name = "formdesign-interchange"
-version = "0.93.0"
+version = "0.93.1"
dependencies = [
"formdesign-model",
"kurbo",
@@ -467,7 +467,7 @@ dependencies = [
[[package]]
name = "formdesign-model"
-version = "0.93.0"
+version = "0.93.1"
dependencies = [
"kurbo",
"serde",
@@ -477,7 +477,7 @@ dependencies = [
[[package]]
name = "formdesign-render"
-version = "0.93.0"
+version = "0.93.1"
dependencies = [
"formdesign-model",
"formdesign-text",
@@ -493,7 +493,7 @@ dependencies = [
[[package]]
name = "formdesign-text"
-version = "0.93.0"
+version = "0.93.1"
dependencies = [
"fancy-regex",
"fontdb",
diff --git a/native/Cargo.toml b/native/Cargo.toml
index 9949dd7..545986d 100644
--- a/native/Cargo.toml
+++ b/native/Cargo.toml
@@ -3,7 +3,7 @@ resolver = "3"
members = ["formdesign-core", "formdesign-model", "formdesign-text", "formdesign-render", "formdesign-engine", "formdesign-interchange", "formdesign-gpu"]
[workspace.package]
-version = "0.93.0"
+version = "0.93.1"
edition = "2024"
license = "Apache-2.0"
rust-version = "1.90"
diff --git a/native/HASHOUT_LOG.md b/native/HASHOUT_LOG.md
index f49274a..274f98b 100644
--- a/native/HASHOUT_LOG.md
+++ b/native/HASHOUT_LOG.md
@@ -2,8 +2,8 @@
Living log for the layout core. Source files stay comment-free; what they would have said lives here, indexed. Read it before editing `native/`.
-Current build version: v0.93.0
-Last updated: 2026-11-20 · no core change in 0.93.0 (the version string only) · no core change in 0.92.0 (the version string only) · no core change in 0.91.0 (the version string only) · no core change in 0.90.0 (the version string only) · no core change in 0.89.0 (the version string only) · no core change in 0.88.0 (the version string and the repository address in Cargo.toml only); 2026-11-13 · no core change in 0.87.0 or 0.86.0 (version string only); 2026-11-11 · PSD header and image data checked before placing; 2026-11-10 · IDML stroke tint and image resolution; 2026-11-10 · HTML entities and intraword underscores on import; 2026-11-10 · IDML link paths decoded as UTF-8; 2026-11-10 · font names filtered in export CSS; 2026-11-10 · PSD formats and sizes checked before decoding; 2026-11-10 · raster scale from the determinant; 2026-11-10 · Separations preview leaves soft masks alone; 2026-11-10 · placed PDF renders bounded per asset; 2026-11-10 · font fallback probes the character map in place; 2026-11-10 · drop cap letters out of the first line's measure; 2026-11-10 · repaint of running headers and live captions; 2026-11-10 · No Break inside the run; 2026-11-10 · newer-format check before parsing; 2026-11-10 · Place reports unplaceable files; 2026-11-10 · thread cursor on groups and refused threads; 2026-11-10 · widow cut takes back its footnotes; 2026-11-10 · Sort Rows keeps exact heights; 2026-11-10 · small caps in website export; 2026-11-10 · Find index markers; 2026-11-10 · raster text brushes in the run's space; 2026-11-10 · unknown align edges refused; 2026-11-10 · hyphenated page names in ranges; 2026-11-10 · rows inserted in a table footer; 2026-11-10 · index order for accented topics; 2026-11-10 · XML tag names checked everywhere; 2026-11-10 · style based-on cycles refused; 2026-11-10 · Trace Image on a transparent picture; 2026-11-10 · Change Case per character; 2026-11-10 · grey percent read back; 2026-11-10 · colour arrays scaled as a whole; 2026-11-10 · RTF code page and Unicode fallback; 2026-11-10 · non-ASCII hex colours refused; 2026-11-10 · GPU tile budget ceiling and error handler; 2026-11-10 · overlapping row and column deletes; 2026-11-10 · page deletion cleans anchored objects and links; 2026-11-10 · native canvas shadows under every page; 2026-11-10 · preflight bleed inside groups; 2026-11-10 · numeric references in Import XML; 2026-11-10 · layer views of duplicated frames; 2026-11-10 · section starts follow duplicated and moved pages; 2026-11-10 · tool state left behind on a document change; 2026-11-10 · IDML OverrideList read back; 2026-11-10 · swatches carried with pasted text and styles; 2026-11-10 · table and cell style rename; 2026-11-10 · frame.thread target check; 2026-11-10 · IDML language names; 2026-11-10 · forced line breaks in IDML export; 2026-11-10 · Arrange on several objects; 2026-11-10 · bounded table import; 2026-11-10 · clipboard in table cells; 2026-11-10 · anchored release in text order; 2026-11-10 · format-only Change All; 2026-11-10 · `$$N` escape in batches; 2026-11-10 · size limit on zipped XML parts; 2026-11-10 · added fonts reach open documents; 2026-11-10 · stale text caret clamped and dropped; 2026-11-10 · XML nesting depth limit; 2026-11-10 · closing a background document; 2026-11-10 · IDML links read only as image files; 2026-11-10 · Change All reaches table cells after body edits; 2026-11-10 · text frames made plain drop their story; 2026-11-10 · a panicking request restores the document; 2026-11-10 · stale recovery snapshots; 2026-11-10 · batch undo entries past the 500-entry limit; 2026-11-10 · table cell lines placed whole; 2026-11-10 · text position map after markers and variables; 2026-10-31 · no core change in 0.85.2 (version string only; the Windows build links the C runtime statically, see the backend log); 2026-10-26 · layout core tests; 2026-10-23 · hyphenation without the GPL Slovak patterns
+Current build version: v0.93.1
+Last updated: 2026-11-20 · no core change in 0.93.1 (the version string only); `cargo test --locked -p formdesign-engine` on 0.93.0's sources, dev profile: 21 passed, 0 failed (layout_core 10, native_files 5, psd_files 6), compiled in 27 m 53 s · no core change in 0.93.0 (the version string only) · no core change in 0.92.0 (the version string only) · no core change in 0.91.0 (the version string only) · no core change in 0.90.0 (the version string only) · no core change in 0.89.0 (the version string only) · no core change in 0.88.0 (the version string and the repository address in Cargo.toml only); 2026-11-13 · no core change in 0.87.0 or 0.86.0 (version string only); 2026-11-11 · PSD header and image data checked before placing; 2026-11-10 · IDML stroke tint and image resolution; 2026-11-10 · HTML entities and intraword underscores on import; 2026-11-10 · IDML link paths decoded as UTF-8; 2026-11-10 · font names filtered in export CSS; 2026-11-10 · PSD formats and sizes checked before decoding; 2026-11-10 · raster scale from the determinant; 2026-11-10 · Separations preview leaves soft masks alone; 2026-11-10 · placed PDF renders bounded per asset; 2026-11-10 · font fallback probes the character map in place; 2026-11-10 · drop cap letters out of the first line's measure; 2026-11-10 · repaint of running headers and live captions; 2026-11-10 · No Break inside the run; 2026-11-10 · newer-format check before parsing; 2026-11-10 · Place reports unplaceable files; 2026-11-10 · thread cursor on groups and refused threads; 2026-11-10 · widow cut takes back its footnotes; 2026-11-10 · Sort Rows keeps exact heights; 2026-11-10 · small caps in website export; 2026-11-10 · Find index markers; 2026-11-10 · raster text brushes in the run's space; 2026-11-10 · unknown align edges refused; 2026-11-10 · hyphenated page names in ranges; 2026-11-10 · rows inserted in a table footer; 2026-11-10 · index order for accented topics; 2026-11-10 · XML tag names checked everywhere; 2026-11-10 · style based-on cycles refused; 2026-11-10 · Trace Image on a transparent picture; 2026-11-10 · Change Case per character; 2026-11-10 · grey percent read back; 2026-11-10 · colour arrays scaled as a whole; 2026-11-10 · RTF code page and Unicode fallback; 2026-11-10 · non-ASCII hex colours refused; 2026-11-10 · GPU tile budget ceiling and error handler; 2026-11-10 · overlapping row and column deletes; 2026-11-10 · page deletion cleans anchored objects and links; 2026-11-10 · native canvas shadows under every page; 2026-11-10 · preflight bleed inside groups; 2026-11-10 · numeric references in Import XML; 2026-11-10 · layer views of duplicated frames; 2026-11-10 · section starts follow duplicated and moved pages; 2026-11-10 · tool state left behind on a document change; 2026-11-10 · IDML OverrideList read back; 2026-11-10 · swatches carried with pasted text and styles; 2026-11-10 · table and cell style rename; 2026-11-10 · frame.thread target check; 2026-11-10 · IDML language names; 2026-11-10 · forced line breaks in IDML export; 2026-11-10 · Arrange on several objects; 2026-11-10 · bounded table import; 2026-11-10 · clipboard in table cells; 2026-11-10 · anchored release in text order; 2026-11-10 · format-only Change All; 2026-11-10 · `$$N` escape in batches; 2026-11-10 · size limit on zipped XML parts; 2026-11-10 · added fonts reach open documents; 2026-11-10 · stale text caret clamped and dropped; 2026-11-10 · XML nesting depth limit; 2026-11-10 · closing a background document; 2026-11-10 · IDML links read only as image files; 2026-11-10 · Change All reaches table cells after body edits; 2026-11-10 · text frames made plain drop their story; 2026-11-10 · a panicking request restores the document; 2026-11-10 · stale recovery snapshots; 2026-11-10 · batch undo entries past the 500-entry limit; 2026-11-10 · table cell lines placed whole; 2026-11-10 · text position map after markers and variables; 2026-10-31 · no core change in 0.85.2 (version string only; the Windows build links the C runtime statically, see the backend log); 2026-10-26 · layout core tests; 2026-10-23 · hyphenation without the GPL Slovak patterns
---
diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock
index b3fa310..422c048 100644
--- a/src-tauri/Cargo.lock
+++ b/src-tauri/Cargo.lock
@@ -984,7 +984,7 @@ dependencies = [
[[package]]
name = "formdesign"
-version = "0.93.0"
+version = "0.93.1"
dependencies = [
"formdesign-gpu",
"objc2",
@@ -1003,7 +1003,7 @@ dependencies = [
[[package]]
name = "formdesign-gpu"
-version = "0.93.0"
+version = "0.93.1"
dependencies = [
"bytemuck",
"pollster",
diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml
index 8e020cd..25bc368 100644
--- a/src-tauri/Cargo.toml
+++ b/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "formdesign"
-version = "0.93.0"
+version = "0.93.1"
description = "FormDesign desktop shell"
authors = ["nodemode-ai"]
license = "Apache-2.0"
diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json
index f1fe21d..eee9229 100644
--- a/src-tauri/tauri.conf.json
+++ b/src-tauri/tauri.conf.json
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "FormDesign",
- "version": "0.93.0",
+ "version": "0.93.1",
"identifier": "ai.nodemode.formdesign",
"build": {
"frontendDist": "../frontend/dist"