@surething/cockpit 1.1.8 → 1.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next-prod/BUILD_ID +1 -1
- package/.next-prod/app-path-routes-manifest.json +9 -5
- package/.next-prod/build-manifest.json +2 -2
- package/.next-prod/cockpit-build.json +1 -1
- package/.next-prod/prerender-manifest.json +3 -3
- package/.next-prod/routes-manifest.json +24 -0
- package/.next-prod/server/app/_global-error/page.js +2 -2
- package/.next-prod/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/_global-error.html +1 -1
- package/.next-prod/server/app/_global-error.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found/page.js +1 -1
- package/.next-prod/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/api/agent/test/route.js +1 -1
- package/.next-prod/server/app/api/bash/route.js +1 -1
- package/.next-prod/server/app/api/bots/[id]/route.js +1 -1
- package/.next-prod/server/app/api/bots/files/route.js +1 -1
- package/.next-prod/server/app/api/bots/route.js +1 -1
- package/.next-prod/server/app/api/chat/codex/route.js +1 -1
- package/.next-prod/server/app/api/chat/deepseek/route.js +1 -1
- package/.next-prod/server/app/api/chat/glm/route.js +1 -1
- package/.next-prod/server/app/api/chat/grok/route.js +1 -1
- package/.next-prod/server/app/api/chat/kimi/route.js +1 -1
- package/.next-prod/server/app/api/chat/ollama/route.js +1 -1
- package/.next-prod/server/app/api/chat/route.js +1 -1
- package/.next-prod/server/app/api/chat/stop/route.js +1 -1
- package/.next-prod/server/app/api/claude-stats/route.js +1 -1
- package/.next-prod/server/app/api/commands/route.js +1 -1
- package/.next-prod/server/app/api/comments/route.js +1 -1
- package/.next-prod/server/app/api/db/columns/route.js +1 -1
- package/.next-prod/server/app/api/db/connect/route.js +1 -1
- package/.next-prod/server/app/api/db/disconnect/route.js +1 -1
- package/.next-prod/server/app/api/db/export/route.js +1 -1
- package/.next-prod/server/app/api/db/query/route.js +1 -1
- package/.next-prod/server/app/api/db/schemas/route.js +2 -2
- package/.next-prod/server/app/api/deepseek/balance/route.js +1 -1
- package/.next-prod/server/app/api/deepseek/credentials/route.js +1 -1
- package/.next-prod/server/app/api/deepseek/models/route.js +1 -1
- package/.next-prod/server/app/api/dev/spans/route.js +1 -1
- package/.next-prod/server/app/api/extension/version/route.js +1 -1
- package/.next-prod/server/app/api/file/route.js +1 -1
- package/.next-prod/server/app/api/files/blame/route.js +1 -1
- package/.next-prod/server/app/api/files/clipboard/route.js +1 -1
- package/.next-prod/server/app/api/files/copy/route.js +1 -1
- package/.next-prod/server/app/api/files/delete/route.js +1 -1
- package/.next-prod/server/app/api/files/expanded/route.js +1 -1
- package/.next-prod/server/app/api/files/index/route.js +1 -1
- package/.next-prod/server/app/api/files/init/route.js +1 -1
- package/.next-prod/server/app/api/files/paste/route.js +1 -1
- package/.next-prod/server/app/api/files/read/route.js +1 -1
- package/.next-prod/server/app/api/files/readdir/route.js +1 -1
- package/.next-prod/server/app/api/files/recent/route.js +1 -1
- package/.next-prod/server/app/api/files/save/route.js +1 -1
- package/.next-prod/server/app/api/files/search/route.js +1 -1
- package/.next-prod/server/app/api/files/stat/route.js +1 -1
- package/.next-prod/server/app/api/files/text/route.js +1 -1
- package/.next-prod/server/app/api/fs/dirs/route.js +1 -1
- package/.next-prod/server/app/api/git/blob/route.js +1 -1
- package/.next-prod/server/app/api/git/branch-diff/route.js +1 -1
- package/.next-prod/server/app/api/git/branches/route.js +1 -1
- package/.next-prod/server/app/api/git/commit-diff/route.js +1 -1
- package/.next-prod/server/app/api/git/commits/route.js +1 -1
- package/.next-prod/server/app/api/git/current-branch/route.js +1 -1
- package/.next-prod/server/app/api/git/diff/route.js +1 -1
- package/.next-prod/server/app/api/git/discard/route.js +1 -1
- package/.next-prod/server/app/api/git/stage/route.js +1 -1
- package/.next-prod/server/app/api/git/status/route.js +1 -1
- package/.next-prod/server/app/api/git/unstage/route.js +1 -1
- package/.next-prod/server/app/api/git/worktree/route.js +1 -1
- package/.next-prod/server/app/api/glm/credentials/route.js +1 -1
- package/.next-prod/server/app/api/glm/models/route.js +1 -1
- package/.next-prod/server/app/api/glm/usage/route.js +1 -1
- package/.next-prod/server/app/api/global-state/route.js +2 -2
- package/.next-prod/server/app/api/grok/models/route.js +1 -1
- package/.next-prod/server/app/api/health/route.js +1 -1
- package/.next-prod/server/app/api/html-apps/[id]/route.js +1 -1
- package/.next-prod/server/app/api/html-apps/files/route.js +1 -1
- package/.next-prod/server/app/api/html-apps/route.js +1 -1
- package/.next-prod/server/app/api/instructions/config/route.js +1 -1
- package/.next-prod/server/app/api/kimi/credentials/route.js +1 -1
- package/.next-prod/server/app/api/kimi/models/route.js +1 -1
- package/.next-prod/server/app/api/kimi/usage/route.js +1 -1
- package/.next-prod/server/app/api/lsp/definition/route.js +1 -1
- package/.next-prod/server/app/api/lsp/hover/route.js +1 -1
- package/.next-prod/server/app/api/lsp/references/route.js +1 -1
- package/.next-prod/server/app/api/lsp/status/route.js +1 -1
- package/.next-prod/server/app/api/lsp/warmup/route.js +1 -1
- package/.next-prod/server/app/api/mobile-link/route.js +1 -1
- package/.next-prod/server/app/api/mysql/columns/route.js +2 -2
- package/.next-prod/server/app/api/mysql/connect/route.js +1 -1
- package/.next-prod/server/app/api/mysql/disconnect/route.js +1 -1
- package/.next-prod/server/app/api/mysql/export/route.js +1 -1
- package/.next-prod/server/app/api/mysql/query/route.js +1 -1
- package/.next-prod/server/app/api/mysql/schemas/route.js +2 -2
- package/.next-prod/server/app/api/neo4j/connect/route.js +1 -1
- package/.next-prod/server/app/api/neo4j/disconnect/route.js +1 -1
- package/.next-prod/server/app/api/neo4j/query/route.js +1 -1
- package/.next-prod/server/app/api/neo4j/schema/route.js +1 -1
- package/.next-prod/server/app/api/note/list/route.js +1 -1
- package/.next-prod/server/app/api/note/route.js +1 -1
- package/.next-prod/server/app/api/ollama/config/route.js +1 -1
- package/.next-prod/server/app/api/ollama/default-model/route.js +1 -1
- package/.next-prod/server/app/api/ollama/models/route.js +1 -1
- package/.next-prod/server/app/api/ollama/start/route.js +1 -1
- package/.next-prod/server/app/api/open-cursor/route.js +1 -1
- package/.next-prod/server/app/api/open-vscode/route.js +1 -1
- package/.next-prod/server/app/api/pi/thinking/route.js +1 -1
- package/.next-prod/server/app/api/pinned-sessions/route.js +1 -1
- package/.next-prod/server/app/api/project-settings/route.js +1 -1
- package/.next-prod/server/app/api/project-state/route.js +2 -2
- package/.next-prod/server/app/api/projectGraph/affected/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/callees/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/callers/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/coedit/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/edges/route.js +1 -0
- package/.next-prod/server/app/api/projectGraph/edges/route.js.nft.json +1 -0
- package/.next-prod/server/app/api/projectGraph/edges/route_client-reference-manifest.js +1 -0
- package/.next-prod/server/app/api/projectGraph/file/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/file-functions/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/impact/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/maps/route.js +1 -0
- package/.next-prod/server/app/api/projectGraph/maps/route.js.nft.json +1 -0
- package/.next-prod/server/app/api/projectGraph/maps/route_client-reference-manifest.js +1 -0
- package/.next-prod/server/app/api/projectGraph/related/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/search/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/symbols/route.js +1 -1
- package/.next-prod/server/app/api/projects/route.js +1 -1
- package/.next-prod/server/app/api/push/public-key/route.js +1 -1
- package/.next-prod/server/app/api/push/subscribe/route.js +1 -1
- package/.next-prod/server/app/api/push/unsubscribe/route.js +1 -1
- package/.next-prod/server/app/api/redis/command/route.js +1 -1
- package/.next-prod/server/app/api/redis/connect/route.js +1 -1
- package/.next-prod/server/app/api/redis/delete/route.js +1 -1
- package/.next-prod/server/app/api/redis/disconnect/route.js +1 -1
- package/.next-prod/server/app/api/redis/get/route.js +1 -1
- package/.next-prod/server/app/api/redis/keys/route.js +1 -1
- package/.next-prod/server/app/api/redis/set/route.js +1 -1
- package/.next-prod/server/app/api/restart/route.js +1 -1
- package/.next-prod/server/app/api/scheduled-tasks/route.js +2 -2
- package/.next-prod/server/app/api/services/config/route.js +1 -1
- package/.next-prod/server/app/api/services/scripts/route.js +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/fork/route.js +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/history/route.js +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/turn/route.js +2 -2
- package/.next-prod/server/app/api/session/image/route.js +1 -1
- package/.next-prod/server/app/api/session/user-messages/route.js +1 -1
- package/.next-prod/server/app/api/session-bots/route.js +1 -1
- package/.next-prod/server/app/api/session-by-path/route.js +1 -1
- package/.next-prod/server/app/api/session-context/route.js +2 -2
- package/.next-prod/server/app/api/session-title/route.js +1 -1
- package/.next-prod/server/app/api/session-title/suggest/route.js +1 -1
- package/.next-prod/server/app/api/sessions/delegate/route.js +1 -1
- package/.next-prod/server/app/api/sessions/projects/[encodedPath]/route.js +1 -1
- package/.next-prod/server/app/api/sessions/projects/route.js +1 -1
- package/.next-prod/server/app/api/sessions/search/route.js +1 -1
- package/.next-prod/server/app/api/sessions/status/route.js +1 -1
- package/.next-prod/server/app/api/settings/route.js +1 -1
- package/.next-prod/server/app/api/shutdown/route.js +1 -1
- package/.next-prod/server/app/api/skills/[id]/route.js +1 -1
- package/.next-prod/server/app/api/skills/builtin/route.js +1 -1
- package/.next-prod/server/app/api/skills/content/route.js +1 -1
- package/.next-prod/server/app/api/skills/files/route.js +1 -1
- package/.next-prod/server/app/api/skills/route.js +1 -1
- package/.next-prod/server/app/api/snapshots/blob/route.js +1 -1
- package/.next-prod/server/app/api/snapshots/diff/route.js +1 -1
- package/.next-prod/server/app/api/snapshots/mark/route.js +1 -0
- package/.next-prod/server/app/api/snapshots/mark/route.js.nft.json +1 -0
- package/.next-prod/server/app/api/snapshots/mark/route_client-reference-manifest.js +1 -0
- package/.next-prod/server/app/api/snapshots/range-diff/route.js +1 -1
- package/.next-prod/server/app/api/snapshots/restore/route.js +1 -0
- package/.next-prod/server/app/api/snapshots/restore/route.js.nft.json +1 -0
- package/.next-prod/server/app/api/snapshots/restore/route_client-reference-manifest.js +1 -0
- package/.next-prod/server/app/api/snapshots/route.js +1 -1
- package/.next-prod/server/app/api/terminal/aliases/route.js +1 -1
- package/.next-prod/server/app/api/terminal/autocomplete/route.js +1 -1
- package/.next-prod/server/app/api/terminal/bubble-order/route.js +1 -1
- package/.next-prod/server/app/api/terminal/env/route.js +1 -1
- package/.next-prod/server/app/api/terminal/history/route.js +1 -1
- package/.next-prod/server/app/api/terminal/running/route.js +1 -1
- package/.next-prod/server/app/api/update/route.js +1 -1
- package/.next-prod/server/app/api/update-state/route.js +1 -1
- package/.next-prod/server/app/api/version/route.js +1 -1
- package/.next-prod/server/app/apps/[...path]/route.js +1 -1
- package/.next-prod/server/app/favicon.ico/route.js +1 -1
- package/.next-prod/server/app/m/page.js +2 -1
- package/.next-prod/server/app/m/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/manifest.webmanifest/route.js +1 -1
- package/.next-prod/server/app/page.js +1 -1
- package/.next-prod/server/app/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/project/page.js +1 -1
- package/.next-prod/server/app/project/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app-paths-manifest.json +9 -5
- package/.next-prod/server/chunks/2493.js +13 -13
- package/.next-prod/server/chunks/4949.js +1 -1
- package/.next-prod/server/chunks/6610.js +34 -34
- package/.next-prod/server/chunks/7270.js +1 -1
- package/.next-prod/server/chunks/9830.js +2 -2
- package/.next-prod/server/chunks/9998.js +1 -1
- package/.next-prod/server/middleware-build-manifest.js +1 -1
- package/.next-prod/server/next-font-manifest.js +1 -1
- package/.next-prod/server/next-font-manifest.json +1 -1
- package/.next-prod/server/pages/500.html +1 -1
- package/.next-prod/server/server-reference-manifest.json +1 -1
- package/.next-prod/static/LwAYWBEgXwTIkuj7U9BpE/_buildManifest.js +1 -0
- package/.next-prod/static/chunks/{50189-b59a96372658a46a.js → 55541-994b26deaa23f4e6.js} +2 -2
- package/.next-prod/static/chunks/{731-fd4b8bcd1d40dfe9.js → 6837-78c0d1a8165d46f7.js} +21 -21
- package/.next-prod/static/chunks/92000-46024df89fb50e16.js +41 -0
- package/.next-prod/static/chunks/98596-4ca2d2544138aefd.js +733 -0
- package/.next-prod/static/chunks/app/_global-error/page-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/agent/test/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/bash/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/bots/[id]/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/bots/files/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/bots/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/codex/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/deepseek/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/glm/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/grok/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/kimi/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/ollama/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/stop/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/claude-stats/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/commands/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/comments/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/db/columns/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/db/connect/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/db/disconnect/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/db/export/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/db/query/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/db/schemas/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/deepseek/balance/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/deepseek/credentials/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/deepseek/models/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/dev/spans/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/extension/version/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/file/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/files/blame/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/files/clipboard/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/files/copy/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/files/delete/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/files/expanded/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/files/index/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/files/init/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/files/paste/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/files/read/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/files/readdir/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/files/recent/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/files/save/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/files/search/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/files/stat/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/files/text/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/fs/dirs/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/git/blob/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/git/branch-diff/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/git/branches/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/git/commit-diff/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/git/commits/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/git/current-branch/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/git/diff/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/git/discard/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/git/stage/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/git/status/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/git/unstage/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/git/worktree/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/glm/credentials/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/glm/models/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/glm/usage/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/global-state/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/grok/models/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/health/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/html-apps/[id]/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/html-apps/files/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/html-apps/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/instructions/config/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/kimi/credentials/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/kimi/models/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/kimi/usage/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/definition/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/hover/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/references/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/status/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/warmup/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/mobile-link/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/columns/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/connect/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/disconnect/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/export/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/query/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/schemas/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/neo4j/connect/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/neo4j/disconnect/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/neo4j/query/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/neo4j/schema/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/note/list/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/note/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/ollama/config/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/ollama/default-model/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/ollama/models/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/ollama/start/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/open-cursor/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/open-vscode/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/pi/thinking/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/pinned-sessions/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/project-settings/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/project-state/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/affected/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/callees/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/callers/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/coedit/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/edges/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/file/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/file-functions/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/impact/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/maps/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/related/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/search/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/symbols/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/projects/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/push/public-key/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/push/subscribe/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/push/unsubscribe/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/command/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/connect/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/delete/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/disconnect/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/get/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/keys/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/set/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/restart/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/scheduled-tasks/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/services/config/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/services/scripts/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/session/[sessionId]/fork/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/session/[sessionId]/history/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/session/[sessionId]/turn/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/session/image/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/session/user-messages/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/session-bots/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/session-by-path/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/session-context/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/session-title/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/session-title/suggest/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/sessions/delegate/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/sessions/projects/[encodedPath]/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/sessions/projects/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/sessions/search/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/sessions/status/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/settings/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/shutdown/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/skills/[id]/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/skills/builtin/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/skills/content/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/skills/files/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/skills/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/snapshots/blob/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/snapshots/diff/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/snapshots/mark/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/snapshots/range-diff/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/snapshots/restore/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/snapshots/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/aliases/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/autocomplete/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/bubble-order/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/env/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/history/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/running/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/update/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/update-state/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/api/version/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/apps/[...path]/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/{layout-f0ff0ab277c84dc6.js → layout-7107ed4eeac1f693.js} +1 -1
- package/.next-prod/static/chunks/app/m/page-0c8e79e2f753aecb.js +2 -0
- package/.next-prod/static/chunks/app/manifest.webmanifest/route-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/app/{page-d2ccfc2cb47ac4af.js → page-338a2c84319778b1.js} +1 -1
- package/.next-prod/static/chunks/app/project/{page-d2ccfc2cb47ac4af.js → page-338a2c84319778b1.js} +1 -1
- package/.next-prod/static/chunks/next/dist/client/components/builtin/app-error-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/next/dist/client/components/builtin/forbidden-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/next/dist/client/components/builtin/not-found-6af5bc188af96106.js +1 -0
- package/.next-prod/static/chunks/next/dist/client/components/builtin/unauthorized-6af5bc188af96106.js +1 -0
- package/.next-prod/static/css/fa34d3b1412ca27a.css +1 -0
- package/.next-prod/trace +86 -15
- package/.next-prod/trace-build +1 -1
- package/.next-prod/types/app/api/projectGraph/edges/route.ts +353 -0
- package/.next-prod/types/app/api/projectGraph/maps/route.ts +353 -0
- package/.next-prod/types/app/api/snapshots/mark/route.ts +353 -0
- package/.next-prod/types/app/api/snapshots/restore/route.ts +353 -0
- package/.next-prod/types/routes.d.ts +5 -1
- package/.next-prod/types/validator.ts +36 -0
- package/README.md +6 -0
- package/bin/rotateLog.mjs +6 -5
- package/desktop-checksums.json +4 -4
- package/dist/{anthropicCompat-PQWSZ3O7.mjs → anthropicCompat-4HZVLIFE.mjs} +3 -2
- package/dist/auth.mjs +19 -3
- package/dist/authAudit.mjs +79 -0
- package/dist/{chunk-6QDJ3QAX.mjs → chunk-6QHHEA3D.mjs} +11 -9
- package/dist/{chunk-2PDNZOMA.mjs → chunk-HJT5ZRYY.mjs} +2 -2
- package/dist/{chunk-S7FDWHAF.mjs → chunk-LSFNZJMR.mjs} +26825 -29730
- package/dist/{chunk-3S5JGONK.mjs → chunk-N3DTLFZE.mjs} +14 -12
- package/dist/{chunk-AKBWZB3V.mjs → chunk-QPFJKR3B.mjs} +2 -2
- package/dist/{chunk-LQISLDJ5.mjs → chunk-SI632CNY.mjs} +1 -1
- package/dist/{chunk-G747UZSS.mjs → chunk-T4M6CNFO.mjs} +132 -34
- package/dist/chunk-WSSVELJX.mjs +2920 -0
- package/dist/{chunk-2O6IH2TF.mjs → chunk-X4R5HO25.mjs} +2 -2
- package/dist/deepseek-YEPNQ2GX.mjs +13 -0
- package/dist/glm-SGT2LTOS.mjs +15 -0
- package/dist/httpApi.mjs +9 -8
- package/dist/kimi-FDXILCYU.mjs +15 -0
- package/dist/scheduledTasks.mjs +41 -15
- package/dist/{sessionStore-FF2VHKXM.mjs → sessionStore-WJGMZM4A.mjs} +2 -1
- package/dist/wsServer.mjs +63 -26
- package/package.json +3 -3
- package/public/html-lib/markdown.js +1 -1
- package/server.mjs +6 -1
- package/skills/cr/SKILL.md +184 -11
- package/skills/dl/SKILL.md +5 -0
- package/skills/rf/SKILL.md +124 -0
- package/skills/rf/axes.md +87 -0
- package/skills/rf/converge.md +50 -0
- package/skills/rf/fix.md +138 -0
- package/skills/rf/lenses.md +76 -0
- package/skills/rf/report.md +133 -0
- package/skills/rf/sources.md +129 -0
- package/.next-prod/static/AO-RPvB4uxOb6-XZ_0YXg/_buildManifest.js +0 -1
- package/.next-prod/static/chunks/17220-89a26ee102272095.js +0 -732
- package/.next-prod/static/chunks/45590-d1a8b4e539cc8dda.js +0 -42
- package/.next-prod/static/chunks/app/_global-error/page-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/agent/test/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/bash/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/bots/[id]/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/bots/files/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/bots/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/codex/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/deepseek/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/glm/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/grok/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/kimi/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/ollama/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/stop/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/claude-stats/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/commands/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/comments/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/db/columns/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/db/connect/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/db/disconnect/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/db/export/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/db/query/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/db/schemas/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/deepseek/balance/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/deepseek/credentials/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/deepseek/models/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/dev/spans/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/extension/version/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/file/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/files/blame/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/files/clipboard/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/files/copy/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/files/delete/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/files/expanded/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/files/index/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/files/init/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/files/paste/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/files/read/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/files/readdir/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/files/recent/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/files/save/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/files/search/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/files/stat/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/files/text/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/fs/dirs/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/git/blob/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/git/branch-diff/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/git/branches/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/git/commit-diff/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/git/commits/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/git/current-branch/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/git/diff/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/git/discard/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/git/stage/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/git/status/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/git/unstage/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/git/worktree/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/glm/credentials/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/glm/models/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/glm/usage/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/global-state/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/grok/models/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/health/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/html-apps/[id]/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/html-apps/files/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/html-apps/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/instructions/config/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/kimi/credentials/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/kimi/models/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/kimi/usage/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/definition/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/hover/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/references/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/status/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/warmup/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/mobile-link/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/columns/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/connect/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/disconnect/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/export/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/query/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/schemas/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/neo4j/connect/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/neo4j/disconnect/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/neo4j/query/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/neo4j/schema/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/note/list/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/note/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/ollama/config/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/ollama/default-model/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/ollama/models/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/ollama/start/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/open-cursor/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/open-vscode/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/pi/thinking/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/pinned-sessions/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/project-settings/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/project-state/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/affected/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/callees/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/callers/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/coedit/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/file/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/file-functions/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/impact/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/related/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/search/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/symbols/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/projects/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/push/public-key/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/push/subscribe/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/push/unsubscribe/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/command/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/connect/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/delete/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/disconnect/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/get/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/keys/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/set/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/restart/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/scheduled-tasks/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/services/config/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/services/scripts/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/session/[sessionId]/fork/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/session/[sessionId]/history/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/session/[sessionId]/turn/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/session/image/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/session/user-messages/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/session-bots/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/session-by-path/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/session-context/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/session-title/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/session-title/suggest/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/sessions/delegate/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/sessions/projects/[encodedPath]/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/sessions/projects/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/sessions/search/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/sessions/status/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/settings/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/shutdown/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/skills/[id]/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/skills/builtin/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/skills/content/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/skills/files/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/skills/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/snapshots/blob/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/snapshots/diff/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/snapshots/range-diff/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/snapshots/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/aliases/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/autocomplete/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/bubble-order/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/env/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/history/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/running/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/update/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/update-state/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/api/version/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/apps/[...path]/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/app/m/page-50e48b4ba0942454.js +0 -1
- package/.next-prod/static/chunks/app/manifest.webmanifest/route-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/next/dist/client/components/builtin/app-error-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/next/dist/client/components/builtin/forbidden-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/next/dist/client/components/builtin/not-found-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/chunks/next/dist/client/components/builtin/unauthorized-42efcb4fd08c5099.js +0 -1
- package/.next-prod/static/css/74144fec62c7ff43.css +0 -1
- package/dist/deepseek-5QJ2IWS3.mjs +0 -12
- package/dist/glm-SIOUQCWL.mjs +0 -14
- package/dist/kimi-NKL4WBNS.mjs +0 -14
- /package/.next-prod/static/{AO-RPvB4uxOb6-XZ_0YXg → LwAYWBEgXwTIkuj7U9BpE}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";exports.id=7270,exports.ids=[7270],exports.modules={4889:(a,b,c)=>{c.r(b),c.d(b,{AbortException:()=>I,AnnotationEditorLayer:()=>dP,AnnotationEditorParamsType:()=>m,AnnotationEditorType:()=>l,AnnotationEditorUIManager:()=>aM,AnnotationLayer:()=>ds,AnnotationMode:()=>i,AnnotationType:()=>p,CSSConstants:()=>as,ColorPicker:()=>cR,DOMSVGFactory:()=>cX,DrawLayer:()=>dT,FeatureTest:()=>K,GlobalWorkerOptions:()=>cw,ImageKind:()=>o,InvalidPDFException:()=>F,MathClamp:()=>U,OPS:()=>r,OutputScale:()=>ap,PDFDataRangeTransport:()=>cI,PDFDateString:()=>aj,PDFWorker:()=>cL,PasswordException:()=>D,PasswordResponses:()=>s,PermissionFlag:()=>n,PixelsPerInch:()=>$,RenderingCancelledException:()=>aa,ResponseException:()=>G,SignatureExtractor:()=>dK,SupportedImageMimeTypes:()=>aq,TextLayer:()=>cF,TextLayerImages:()=>dV,TouchManager:()=>aP,Util:()=>L,VerbosityLevel:()=>q,XfaLayer:()=>Z,applyOpacity:()=>at,build:()=>cQ,createValidAbsoluteUrl:()=>y,fetchData:()=>_,findContrastColor:()=>az,getDocument:()=>cG,getFilenameFromUrl:()=>ad,getPdfFilenameFromUrl:()=>ae,getRGB:()=>al,getRGBA:()=>ak,getUuid:()=>P,isDataScheme:()=>ab,isPdfFile:()=>ac,isValidExplicitDest:()=>bp,makeArr:()=>Q,makeMap:()=>R,makeObj:()=>S,makeSet:()=>T,noContextMenu:()=>ah,normalizeUnicode:()=>O,renderRichText:()=>aA,setLayerDimensions:()=>ao,shadow:()=>B,stopEvent:()=>ai,updateUrlHash:()=>z,version:()=>cP});let d="object"==typeof process&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&"browser"!==process.type),e=[1/0,1/0,-1/0,-1/0],f=new Float32Array(e),g=[.001,0,0,.001,0,0],h="http://www.w3.org/2000/svg",i={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},j="pdfjs_internal_id_",k="pdfjs_internal_editor_",l={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},m={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,INK_COLOR_AND_OPACITY:24,HIGHLIGHT_COLOR:31,HIGHLIGHT_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},n={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},o={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},p={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26,RICHMEDIA:27},q={ERRORS:0,WARNINGS:1,INFOS:5},r={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},s={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},t=q.WARNINGS;function u(a){t>=q.INFOS&&console.info(`Info: ${a}`)}function v(a){t>=q.WARNINGS&&console.warn(`Warning: ${a}`)}function w(a){throw Error(a)}function x(a,b){a||w(b)}function y(a,b=null,c=null){if(!a)return null;if(c&&"string"==typeof a){if(c.addDefaultProtocol&&a.startsWith("www.")){let b=a.match(/\./g);b?.length>=2&&(a=`http://${a}`)}if(c.tryConvertEncoding)try{var d;d=a,a=decodeURIComponent(escape(d))}catch{}}let e=b?URL.parse(a,b):URL.parse(a);return!function(a){switch(a?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(e)?null:e}function z(a,b,c=!1){let d=URL.parse(a);return d?(d.hash=b,d.href):c&&y(a,"http://example.com")?a.split("#",1)[0]+`${b?`#${b}`:""}`:""}function A(a){return a.substring(a.lastIndexOf("/")+1)}function B(a,b,c,d=!1){return Object.defineProperty(a,b,{value:c,enumerable:!d,configurable:!0,writable:!1}),c}let C=function(){function a(a,b){this.message=a,this.name=b}return a.prototype=Error(),a.constructor=a,a}();class D extends C{constructor(a,b){super(a,"PasswordException"),this.code=b}}class E extends C{constructor(a,b){super(a,"UnknownErrorException"),this.details=b}}class F extends C{constructor(a){super(a,"InvalidPDFException")}}class G extends C{constructor(a,b,c){super(a,"ResponseException"),this.status=b,this.missing=c}}class H extends C{constructor(a){super(a,"FormatError")}}class I extends C{constructor(a){super(a,"AbortException")}}function J(a){"string"!=typeof a&&w("Invalid argument for stringToBytes");let b=a.length,c=new Uint8Array(b);for(let d=0;d<b;++d)c[d]=255&a.charCodeAt(d);return c}class K{static get isLittleEndian(){let a=new Uint8Array(4);return a[0]=1,B(this,"isLittleEndian",1===new Uint32Array(a.buffer,0,1)[0])}static get isOffscreenCanvasSupported(){return B(this,"isOffscreenCanvasSupported","u">typeof OffscreenCanvas)}static get isImageDecoderSupported(){return B(this,"isImageDecoderSupported","u">typeof ImageDecoder)}static get isFloat16ArraySupported(){return B(this,"isFloat16ArraySupported","u">typeof Float16Array)}static get isSanitizerSupported(){return B(this,"isSanitizerSupported","u">typeof Sanitizer)}static get platform(){let{platform:a,userAgent:b}=navigator;return B(this,"platform",{isAndroid:b.includes("Android"),isLinux:a.includes("Linux"),isMac:a.includes("Mac"),isWindows:a.includes("Win"),isFirefox:b.includes("Firefox")})}static get isCanvasFilterSupported(){let a;return this.isOffscreenCanvasSupported?a=new OffscreenCanvas(1,1).getContext("2d"):"u">typeof document&&(a=document.createElement("canvas").getContext("2d")),B(this,"isCanvasFilterSupported",a?.filter!==void 0)}static get isAlphaColorInputSupported(){if("u"<typeof document)return B(this,"isAlphaColorInputSupported",!1);let a=document.createElement("input");return a.type="color",a.setAttribute("alpha",""),a.value="#ff000080",B(this,"isAlphaColorInputSupported","#ff0000"!==a.value)}static get isBackdropFilterSupported(){return B(this,"isBackdropFilterSupported","u">typeof CSS&&CSS.supports("backdrop-filter","blur(1px)"))}}class L{static get hexNums(){return B(this,"hexNums",Array.from(Array(256).keys(),a=>a.toString(16).padStart(2,"0")))}static makeHexColor(a,b,c){return`#${this.hexNums[a]}${this.hexNums[b]}${this.hexNums[c]}`}static transform(a,b){return[a[0]*b[0]+a[2]*b[1],a[1]*b[0]+a[3]*b[1],a[0]*b[2]+a[2]*b[3],a[1]*b[2]+a[3]*b[3],a[0]*b[4]+a[2]*b[5]+a[4],a[1]*b[4]+a[3]*b[5]+a[5]]}static multiplyByDOMMatrix(a,b){return[a[0]*b.a+a[2]*b.b,a[1]*b.a+a[3]*b.b,a[0]*b.c+a[2]*b.d,a[1]*b.c+a[3]*b.d,a[0]*b.e+a[2]*b.f+a[4],a[1]*b.e+a[3]*b.f+a[5]]}static applyTransform(a,b,c=0){let d=a[c],e=a[c+1];a[c]=d*b[0]+e*b[2]+b[4],a[c+1]=d*b[1]+e*b[3]+b[5]}static applyTransformToBezier(a,b,c=0){let d=b[0],e=b[1],f=b[2],g=b[3],h=b[4],i=b[5];for(let b=0;b<6;b+=2){let j=a[c+b],k=a[c+b+1];a[c+b]=j*d+k*f+h,a[c+b+1]=j*e+k*g+i}}static applyInverseTransform(a,b){let c=a[0],d=a[1],e=b[0]*b[3]-b[1]*b[2];a[0]=(c*b[3]-d*b[2]+b[2]*b[5]-b[4]*b[3])/e,a[1]=(-c*b[1]+d*b[0]+b[4]*b[1]-b[5]*b[0])/e}static axialAlignedBoundingBox(a,b,c){let d=b[0],e=b[1],f=b[2],g=b[3],h=b[4],i=b[5],j=a[0],k=a[1],l=a[2],m=a[3],n=d*j+h,o=n,p=d*l+h,q=p,r=g*k+i,s=r,t=g*m+i,u=t;if(0!==e||0!==f){let a=e*j,b=e*l,c=f*k,d=f*m;n+=c,q+=c,p+=d,o+=d,r+=a,u+=a,t+=b,s+=b}c[0]=Math.min(c[0],n,p,o,q),c[1]=Math.min(c[1],r,t,s,u),c[2]=Math.max(c[2],n,p,o,q),c[3]=Math.max(c[3],r,t,s,u)}static inverseTransform(a){let b=a[0]*a[3]-a[1]*a[2];return[a[3]/b,-a[1]/b,-a[2]/b,a[0]/b,(a[2]*a[5]-a[4]*a[3])/b,(a[4]*a[1]-a[5]*a[0])/b]}static singularValueDecompose2dScale(a,b){let c=a[0],d=a[1],e=a[2],f=a[3],g=c**2+d**2,h=e**2+f**2,i=(g+h)/2,j=Math.sqrt(i**2-(g*h-(c*e+d*f)**2));b[0]=Math.sqrt(i+j||1),b[1]=Math.sqrt(i-j||1)}static normalizeRect(a){let b=a.slice(0);return a[0]>a[2]&&(b[0]=a[2],b[2]=a[0]),a[1]>a[3]&&(b[1]=a[3],b[3]=a[1]),b}static intersect(a,b){let c=Math.max(Math.min(a[0],a[2]),Math.min(b[0],b[2])),d=Math.min(Math.max(a[0],a[2]),Math.max(b[0],b[2]));if(c>d)return null;let e=Math.max(Math.min(a[1],a[3]),Math.min(b[1],b[3])),f=Math.min(Math.max(a[1],a[3]),Math.max(b[1],b[3]));return e>f?null:[c,e,d,f]}static pointBoundingBox(a,b,c){c[0]=Math.min(c[0],a),c[1]=Math.min(c[1],b),c[2]=Math.max(c[2],a),c[3]=Math.max(c[3],b)}static rectBoundingBox(a,b,c,d,e){e[0]=Math.min(e[0],a,c),e[1]=Math.min(e[1],b,d),e[2]=Math.max(e[2],a,c),e[3]=Math.max(e[3],b,d)}static #a(a,b,c,d,e,f,g,h,i,j){if(i<=0||i>=1)return;let k=1-i,l=i*i,m=l*i,n=k*(k*(k*a+3*i*b)+3*l*c)+m*d,o=k*(k*(k*e+3*i*f)+3*l*g)+m*h;j[0]=Math.min(j[0],n),j[1]=Math.min(j[1],o),j[2]=Math.max(j[2],n),j[3]=Math.max(j[3],o)}static #b(a,b,c,d,e,f,g,h,i,j,k,l){if(1e-12>Math.abs(i)){Math.abs(j)>=1e-12&&this.#a(a,b,c,d,e,f,g,h,-k/j,l);return}let m=j**2-4*k*i;if(m<0)return;let n=Math.sqrt(m),o=2*i;this.#a(a,b,c,d,e,f,g,h,(-j+n)/o,l),this.#a(a,b,c,d,e,f,g,h,(-j-n)/o,l)}static bezierBoundingBox(a,b,c,d,e,f,g,h,i){i[0]=Math.min(i[0],a,g),i[1]=Math.min(i[1],b,h),i[2]=Math.max(i[2],a,g),i[3]=Math.max(i[3],b,h),this.#b(a,c,e,g,b,d,f,h,3*(-a+3*(c-e)+g),6*(a-2*c+e),3*(c-a),i),this.#b(a,c,e,g,b,d,f,h,3*(-b+3*(d-f)+h),6*(b-2*d+f),3*(d-b),i)}}let M=null,N=null;function O(a){return M||(M=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,N=new Map([["ſt","ſt"]])),a.replaceAll(M,(a,b,c)=>b?b.normalize("NFKC"):N.get(c))}function P(){if("function"==typeof crypto.randomUUID)return crypto.randomUUID();let a=new Uint8Array(32);return crypto.getRandomValues(a),function(a){("object"!=typeof a||a?.length===void 0)&&w("Invalid argument for bytesToString");let b=a.length;if(b<8192)return String.fromCharCode.apply(null,a);let c=[];for(let d=0;d<b;d+=8192){let e=Math.min(d+8192,b),f=a.subarray(d,e);c.push(String.fromCharCode.apply(null,f))}return c.join("")}(a)}let Q=()=>[],R=()=>new Map,S=()=>Object.create(null),T=()=>new Set;function U(a,b,c){return Math.min(Math.max(a,b),c)}"function"!=typeof Iterator.prototype.join&&(Iterator.prototype.join=function(a){return[...this].join(a)});class V{constructor({viewBox:a,userUnit:b,scale:c,rotation:d,offsetX:e=0,offsetY:f=0,dontFlip:g=!1}){let h,i,j,k,l,m,n,o;this.viewBox=a,this.userUnit=b,this.scale=c,this.rotation=d,this.offsetX=e,this.offsetY=f,c*=b;const p=(a[2]+a[0])/2,q=(a[3]+a[1])/2;switch((d%=360)<0&&(d+=360),d){case 180:h=-1,i=0,j=0,k=1;break;case 90:h=0,i=1,j=1,k=0;break;case 270:h=0,i=-1,j=-1,k=0;break;case 0:h=1,i=0,j=0,k=-1;break;default:throw Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}g&&(j=-j,k=-k),0===h?(l=Math.abs(q-a[1])*c+e,m=Math.abs(p-a[0])*c+f,n=(a[3]-a[1])*c,o=(a[2]-a[0])*c):(l=Math.abs(p-a[0])*c+e,m=Math.abs(q-a[1])*c+f,n=(a[2]-a[0])*c,o=(a[3]-a[1])*c),this.transform=[h*c,i*c,j*c,k*c,l-h*c*p-j*c*q,m-i*c*p-k*c*q],this.width=n,this.height=o}get rawDims(){let a=this.viewBox;return B(this,"rawDims",{pageWidth:a[2]-a[0],pageHeight:a[3]-a[1],pageX:a[0],pageY:a[1]})}clone({scale:a=this.scale,rotation:b=this.rotation,offsetX:c=this.offsetX,offsetY:d=this.offsetY,dontFlip:e=!1}={}){return new V({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:a,rotation:b,offsetX:c,offsetY:d,dontFlip:e})}convertToViewportPoint(a,b){let c=[a,b];return L.applyTransform(c,this.transform),c}convertToPdfPoint(a,b){let c=[a,b];return L.applyInverseTransform(c,this.transform),c}}class W{static textContent(a){let b=[],c={items:b,styles:Object.create(null)};return!function a(c){if(!c)return;let d=null,e=c.name;if("#text"===e)d=c.value;else{if(!W.shouldBuildText(e))return;c?.attributes?.textContent?d=c.attributes.textContent:c.value&&(d=c.value)}if(null!==d&&b.push({str:d}),c.children)for(let b of c.children)a(b)}(a),c}static shouldBuildText(a){return"textarea"!==a&&"input"!==a&&"option"!==a&&"select"!==a}}let X=/url\(|image-set\(/i,Y=/^on/i;class Z{static get _allowedHtmlElements(){return B(this,"_allowedHtmlElements",new Set(["a","b","br","button","div","i","img","input","label","li","ol","option","p","select","span","sub","sup","textarea","ul"]))}static get _allowedSvgElements(){return B(this,"_allowedSvgElements",new Set(["ellipse","line","path","rect","svg"]))}static get _allowedRichTextElements(){return B(this,"_allowedRichTextElements",new Set(["a","b","br","div","i","li","ol","p","span","sub","sup","ul"]))}static get _allowedRichTextAttributes(){return B(this,"_allowedRichTextAttributes",new Set(["class","dir","style"]))}static get _allowedRichTextStyles(){return B(this,"_allowedRichTextStyles",new Set(["color","font","fontFamily","fontSize","fontStretch","fontStyle","fontWeight","kerningMode","letterSpacing","lineHeight","margin","marginBottom","marginLeft","marginRight","marginTop","orphans","paddingLeft","paddingRight","breakAfter","breakBefore","breakInside","tabInterval","tabStop","textAlign","textDecoration","textIndent","transform","verticalAlign","widows"]))}static setupStorage(a,b,c,d,e){let f=d.getValue(b,{value:null});switch(c.name){case"textarea":if(null!==f.value&&(a.textContent=f.value),"print"===e)break;a.addEventListener("input",a=>{d.setValue(b,{value:a.target.value})});break;case"input":if("radio"===c.attributes.type||"checkbox"===c.attributes.type){if(f.value===c.attributes.xfaOn?a.setAttribute("checked",!0):f.value===c.attributes.xfaOff&&a.removeAttribute("checked"),"print"===e)break;a.addEventListener("change",a=>{d.setValue(b,{value:a.target.checked?a.target.getAttribute("xfaOn"):a.target.getAttribute("xfaOff")})})}else{if(null!==f.value&&a.setAttribute("value",f.value),"print"===e)break;a.addEventListener("input",a=>{d.setValue(b,{value:a.target.value})})}break;case"select":if(null!==f.value)for(let b of(a.setAttribute("value",f.value),c.children))b.attributes.value===f.value?b.attributes.selected=!0:Object.hasOwn(b.attributes,"selected")&&delete b.attributes.selected;a.addEventListener("input",a=>{let c=a.target.options,e=-1===c.selectedIndex?"":c[c.selectedIndex].value;d.setValue(b,{value:e})})}}static setAttributes({html:a,element:b,storage:c=null,intent:d,linkService:e}){let{attributes:f}=b,g=a instanceof HTMLAnchorElement;for(let[b,c]of("radio"===f.type&&(f.name=`${f.name}-${d}`),Object.entries(f)))if(!(null==c||Y.test(b))&&("richText"!==d||this._allowedRichTextAttributes.has(b)))switch(b){case"class":c.length&&a.setAttribute(b,c.join(" "));break;case"dataId":break;case"id":a.setAttribute("data-element-id",c);break;case"style":if("richText"===d){let b=this._allowedRichTextStyles;for(let[d,e]of Object.entries(c))b.has(d)&&!X.test(e)&&(a.style[d]=e)}else Object.assign(a.style,c);break;case"textContent":a.textContent=c;break;default:g&&("href"===b||"newWindow"===b)||a.setAttribute(b,c)}g&&e?.addLinkAttributes(a,f.href,f.newWindow),c&&f.dataId&&this.setupStorage(a,f.dataId,b,c)}static #c(a,b,c){return"richText"===c?!b&&this._allowedRichTextElements.has(a)?document.createElement(a):null:b?b===h&&this._allowedSvgElements.has(a)?document.createElementNS(h,a):null:this._allowedHtmlElements.has(a)?document.createElement(a):null}static render(a){let b=a.annotationStorage,c=a.linkService,d=a.xfaHtml,e=a.intent||"display",f=this.#c(d.name,d.attributes?.xmlns,e)??document.createElement("div");d.attributes&&this.setAttributes({html:f,element:d,intent:e,linkService:c});let g="richText"!==e,h=a.div;if(h.append(f),a.viewport){let b=`matrix(${a.viewport.transform.join(",")})`;h.style.transform=b}g&&h.setAttribute("class","xfaLayer xfaFont");let i=[];if(0===d.children.length){if(d.value){let a=document.createTextNode(d.value);f.append(a),g&&W.shouldBuildText(d.name)&&i.push(a)}return{textDivs:i}}let j=[[d,-1,f]];for(;j.length>0;){let[a,d,f]=j.at(-1);if(d+1===a.children.length){j.pop();continue}let h=a.children[++j.at(-1)[1]];if(null===h)continue;let{name:k}=h;if("#text"===k){let a=document.createTextNode(h.value);i.push(a),f.append(a);continue}let l=this.#c(k,h.attributes?.xmlns,e);if(l){if(f.append(l),h.attributes&&this.setAttributes({html:l,element:h,storage:b,intent:e,linkService:c}),h.children?.length>0)j.push([h,-1,l]);else if(h.value){let a=document.createTextNode(h.value);g&&W.shouldBuildText(k)&&i.push(a),l.append(a)}}}for(let a of h.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))a.setAttribute("readOnly",!0);return{textDivs:i}}static update(a){let b=`matrix(${a.viewport.transform.join(",")})`;a.div.style.transform=b,a.div.hidden=!1}static getPageViewport(a,{scale:b=1,rotation:c=0}){let{width:d,height:e}=a.attributes.style;return new V({viewBox:[0,0,parseInt(d,10),parseInt(e,10)],userUnit:1,scale:b,rotation:c})}}class ${static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}async function _(a,b="text"){if(ag(a,document.baseURI)){let c=await fetch(a);if(!c.ok)throw Error(c.statusText);switch(b){case"blob":return c.blob();case"bytes":return c.bytes();case"json":return c.json()}return c.text()}return new Promise((c,d)=>{let e=new XMLHttpRequest;e.open("GET",a,!0),e.responseType="bytes"===b?"arraybuffer":b,e.onreadystatechange=()=>{if(e.readyState===XMLHttpRequest.DONE){if(200===e.status||0===e.status){switch(b){case"bytes":c(new Uint8Array(e.response));return;case"blob":case"json":c(e.response);return}c(e.responseText);return}d(Error(e.statusText))}},e.send(null)})}class aa extends C{constructor(a,b=0){super(a,"RenderingCancelledException"),this.extraDelay=b}}function ab(a){let b=a.length,c=0;for(;c<b&&""===a[c].trim();)c++;return"data:"===a.substring(c,c+5).toLowerCase()}function ac(a){return"string"==typeof a&&/\.pdf$/i.test(a)}function ad(a){return[a]=a.split(/[#?]/,1),A(a)}function ae(a,b="document.pdf"){if("string"!=typeof a)return b;if(ab(a))return v('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),b;let c=(a=>{try{return new URL(a)}catch{}try{return new URL(decodeURIComponent(a))}catch{}try{return new URL(a,"https://foo.bar")}catch{}try{return new URL(decodeURIComponent(a),"https://foo.bar")}catch{}return null})(a);if(!c)return b;let d=a=>{try{let b=decodeURIComponent(a);if(b.includes("/")&&(b=A(b),4===b.length&&e.test(b)))return a;return b}catch{return a}},e=/\.pdf$/i,f=A(c.pathname);if(e.test(f))return d(f);if(c.searchParams.size>0){let a=a=>[...a].findLast(a=>e.test(a)),b=a(c.searchParams.values())??a(c.searchParams.keys());if(b)return d(b)}if(c.hash){let a=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(c.hash);if(a)return d(a[0])}return b}class af{#d=new Map;times=[];time(a){this.#d.has(a)&&v(`Timer is already running for ${a}`),this.#d.set(a,Date.now())}timeEnd(a){this.#d.has(a)||v(`Timer has not been started for ${a}`),this.times.push({name:a,start:this.#d.get(a),end:Date.now()}),this.#d.delete(a)}toString(){let a=Math.max(...this.times.map(a=>a.name.length));return this.times.map(b=>`${b.name.padEnd(a)} ${b.end-b.start}ms
|
|
1
|
+
"use strict";exports.id=7270,exports.ids=[7270],exports.modules={27270:(a,b,c)=>{c.r(b),c.d(b,{AbortException:()=>I,AnnotationEditorLayer:()=>dP,AnnotationEditorParamsType:()=>m,AnnotationEditorType:()=>l,AnnotationEditorUIManager:()=>aM,AnnotationLayer:()=>ds,AnnotationMode:()=>i,AnnotationType:()=>p,CSSConstants:()=>as,ColorPicker:()=>cR,DOMSVGFactory:()=>cX,DrawLayer:()=>dT,FeatureTest:()=>K,GlobalWorkerOptions:()=>cw,ImageKind:()=>o,InvalidPDFException:()=>F,MathClamp:()=>U,OPS:()=>r,OutputScale:()=>ap,PDFDataRangeTransport:()=>cI,PDFDateString:()=>aj,PDFWorker:()=>cL,PasswordException:()=>D,PasswordResponses:()=>s,PermissionFlag:()=>n,PixelsPerInch:()=>$,RenderingCancelledException:()=>aa,ResponseException:()=>G,SignatureExtractor:()=>dK,SupportedImageMimeTypes:()=>aq,TextLayer:()=>cF,TextLayerImages:()=>dV,TouchManager:()=>aP,Util:()=>L,VerbosityLevel:()=>q,XfaLayer:()=>Z,applyOpacity:()=>at,build:()=>cQ,createValidAbsoluteUrl:()=>y,fetchData:()=>_,findContrastColor:()=>az,getDocument:()=>cG,getFilenameFromUrl:()=>ad,getPdfFilenameFromUrl:()=>ae,getRGB:()=>al,getRGBA:()=>ak,getUuid:()=>P,isDataScheme:()=>ab,isPdfFile:()=>ac,isValidExplicitDest:()=>bp,makeArr:()=>Q,makeMap:()=>R,makeObj:()=>S,makeSet:()=>T,noContextMenu:()=>ah,normalizeUnicode:()=>O,renderRichText:()=>aA,setLayerDimensions:()=>ao,shadow:()=>B,stopEvent:()=>ai,updateUrlHash:()=>z,version:()=>cP});let d="object"==typeof process&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&"browser"!==process.type),e=[1/0,1/0,-1/0,-1/0],f=new Float32Array(e),g=[.001,0,0,.001,0,0],h="http://www.w3.org/2000/svg",i={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},j="pdfjs_internal_id_",k="pdfjs_internal_editor_",l={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},m={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,INK_COLOR_AND_OPACITY:24,HIGHLIGHT_COLOR:31,HIGHLIGHT_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},n={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},o={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},p={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26,RICHMEDIA:27},q={ERRORS:0,WARNINGS:1,INFOS:5},r={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},s={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},t=q.WARNINGS;function u(a){t>=q.INFOS&&console.info(`Info: ${a}`)}function v(a){t>=q.WARNINGS&&console.warn(`Warning: ${a}`)}function w(a){throw Error(a)}function x(a,b){a||w(b)}function y(a,b=null,c=null){if(!a)return null;if(c&&"string"==typeof a){if(c.addDefaultProtocol&&a.startsWith("www.")){let b=a.match(/\./g);b?.length>=2&&(a=`http://${a}`)}if(c.tryConvertEncoding)try{var d;d=a,a=decodeURIComponent(escape(d))}catch{}}let e=b?URL.parse(a,b):URL.parse(a);return!function(a){switch(a?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(e)?null:e}function z(a,b,c=!1){let d=URL.parse(a);return d?(d.hash=b,d.href):c&&y(a,"http://example.com")?a.split("#",1)[0]+`${b?`#${b}`:""}`:""}function A(a){return a.substring(a.lastIndexOf("/")+1)}function B(a,b,c,d=!1){return Object.defineProperty(a,b,{value:c,enumerable:!d,configurable:!0,writable:!1}),c}let C=function(){function a(a,b){this.message=a,this.name=b}return a.prototype=Error(),a.constructor=a,a}();class D extends C{constructor(a,b){super(a,"PasswordException"),this.code=b}}class E extends C{constructor(a,b){super(a,"UnknownErrorException"),this.details=b}}class F extends C{constructor(a){super(a,"InvalidPDFException")}}class G extends C{constructor(a,b,c){super(a,"ResponseException"),this.status=b,this.missing=c}}class H extends C{constructor(a){super(a,"FormatError")}}class I extends C{constructor(a){super(a,"AbortException")}}function J(a){"string"!=typeof a&&w("Invalid argument for stringToBytes");let b=a.length,c=new Uint8Array(b);for(let d=0;d<b;++d)c[d]=255&a.charCodeAt(d);return c}class K{static get isLittleEndian(){let a=new Uint8Array(4);return a[0]=1,B(this,"isLittleEndian",1===new Uint32Array(a.buffer,0,1)[0])}static get isOffscreenCanvasSupported(){return B(this,"isOffscreenCanvasSupported","u">typeof OffscreenCanvas)}static get isImageDecoderSupported(){return B(this,"isImageDecoderSupported","u">typeof ImageDecoder)}static get isFloat16ArraySupported(){return B(this,"isFloat16ArraySupported","u">typeof Float16Array)}static get isSanitizerSupported(){return B(this,"isSanitizerSupported","u">typeof Sanitizer)}static get platform(){let{platform:a,userAgent:b}=navigator;return B(this,"platform",{isAndroid:b.includes("Android"),isLinux:a.includes("Linux"),isMac:a.includes("Mac"),isWindows:a.includes("Win"),isFirefox:b.includes("Firefox")})}static get isCanvasFilterSupported(){let a;return this.isOffscreenCanvasSupported?a=new OffscreenCanvas(1,1).getContext("2d"):"u">typeof document&&(a=document.createElement("canvas").getContext("2d")),B(this,"isCanvasFilterSupported",a?.filter!==void 0)}static get isAlphaColorInputSupported(){if("u"<typeof document)return B(this,"isAlphaColorInputSupported",!1);let a=document.createElement("input");return a.type="color",a.setAttribute("alpha",""),a.value="#ff000080",B(this,"isAlphaColorInputSupported","#ff0000"!==a.value)}static get isBackdropFilterSupported(){return B(this,"isBackdropFilterSupported","u">typeof CSS&&CSS.supports("backdrop-filter","blur(1px)"))}}class L{static get hexNums(){return B(this,"hexNums",Array.from(Array(256).keys(),a=>a.toString(16).padStart(2,"0")))}static makeHexColor(a,b,c){return`#${this.hexNums[a]}${this.hexNums[b]}${this.hexNums[c]}`}static transform(a,b){return[a[0]*b[0]+a[2]*b[1],a[1]*b[0]+a[3]*b[1],a[0]*b[2]+a[2]*b[3],a[1]*b[2]+a[3]*b[3],a[0]*b[4]+a[2]*b[5]+a[4],a[1]*b[4]+a[3]*b[5]+a[5]]}static multiplyByDOMMatrix(a,b){return[a[0]*b.a+a[2]*b.b,a[1]*b.a+a[3]*b.b,a[0]*b.c+a[2]*b.d,a[1]*b.c+a[3]*b.d,a[0]*b.e+a[2]*b.f+a[4],a[1]*b.e+a[3]*b.f+a[5]]}static applyTransform(a,b,c=0){let d=a[c],e=a[c+1];a[c]=d*b[0]+e*b[2]+b[4],a[c+1]=d*b[1]+e*b[3]+b[5]}static applyTransformToBezier(a,b,c=0){let d=b[0],e=b[1],f=b[2],g=b[3],h=b[4],i=b[5];for(let b=0;b<6;b+=2){let j=a[c+b],k=a[c+b+1];a[c+b]=j*d+k*f+h,a[c+b+1]=j*e+k*g+i}}static applyInverseTransform(a,b){let c=a[0],d=a[1],e=b[0]*b[3]-b[1]*b[2];a[0]=(c*b[3]-d*b[2]+b[2]*b[5]-b[4]*b[3])/e,a[1]=(-c*b[1]+d*b[0]+b[4]*b[1]-b[5]*b[0])/e}static axialAlignedBoundingBox(a,b,c){let d=b[0],e=b[1],f=b[2],g=b[3],h=b[4],i=b[5],j=a[0],k=a[1],l=a[2],m=a[3],n=d*j+h,o=n,p=d*l+h,q=p,r=g*k+i,s=r,t=g*m+i,u=t;if(0!==e||0!==f){let a=e*j,b=e*l,c=f*k,d=f*m;n+=c,q+=c,p+=d,o+=d,r+=a,u+=a,t+=b,s+=b}c[0]=Math.min(c[0],n,p,o,q),c[1]=Math.min(c[1],r,t,s,u),c[2]=Math.max(c[2],n,p,o,q),c[3]=Math.max(c[3],r,t,s,u)}static inverseTransform(a){let b=a[0]*a[3]-a[1]*a[2];return[a[3]/b,-a[1]/b,-a[2]/b,a[0]/b,(a[2]*a[5]-a[4]*a[3])/b,(a[4]*a[1]-a[5]*a[0])/b]}static singularValueDecompose2dScale(a,b){let c=a[0],d=a[1],e=a[2],f=a[3],g=c**2+d**2,h=e**2+f**2,i=(g+h)/2,j=Math.sqrt(i**2-(g*h-(c*e+d*f)**2));b[0]=Math.sqrt(i+j||1),b[1]=Math.sqrt(i-j||1)}static normalizeRect(a){let b=a.slice(0);return a[0]>a[2]&&(b[0]=a[2],b[2]=a[0]),a[1]>a[3]&&(b[1]=a[3],b[3]=a[1]),b}static intersect(a,b){let c=Math.max(Math.min(a[0],a[2]),Math.min(b[0],b[2])),d=Math.min(Math.max(a[0],a[2]),Math.max(b[0],b[2]));if(c>d)return null;let e=Math.max(Math.min(a[1],a[3]),Math.min(b[1],b[3])),f=Math.min(Math.max(a[1],a[3]),Math.max(b[1],b[3]));return e>f?null:[c,e,d,f]}static pointBoundingBox(a,b,c){c[0]=Math.min(c[0],a),c[1]=Math.min(c[1],b),c[2]=Math.max(c[2],a),c[3]=Math.max(c[3],b)}static rectBoundingBox(a,b,c,d,e){e[0]=Math.min(e[0],a,c),e[1]=Math.min(e[1],b,d),e[2]=Math.max(e[2],a,c),e[3]=Math.max(e[3],b,d)}static #a(a,b,c,d,e,f,g,h,i,j){if(i<=0||i>=1)return;let k=1-i,l=i*i,m=l*i,n=k*(k*(k*a+3*i*b)+3*l*c)+m*d,o=k*(k*(k*e+3*i*f)+3*l*g)+m*h;j[0]=Math.min(j[0],n),j[1]=Math.min(j[1],o),j[2]=Math.max(j[2],n),j[3]=Math.max(j[3],o)}static #b(a,b,c,d,e,f,g,h,i,j,k,l){if(1e-12>Math.abs(i)){Math.abs(j)>=1e-12&&this.#a(a,b,c,d,e,f,g,h,-k/j,l);return}let m=j**2-4*k*i;if(m<0)return;let n=Math.sqrt(m),o=2*i;this.#a(a,b,c,d,e,f,g,h,(-j+n)/o,l),this.#a(a,b,c,d,e,f,g,h,(-j-n)/o,l)}static bezierBoundingBox(a,b,c,d,e,f,g,h,i){i[0]=Math.min(i[0],a,g),i[1]=Math.min(i[1],b,h),i[2]=Math.max(i[2],a,g),i[3]=Math.max(i[3],b,h),this.#b(a,c,e,g,b,d,f,h,3*(-a+3*(c-e)+g),6*(a-2*c+e),3*(c-a),i),this.#b(a,c,e,g,b,d,f,h,3*(-b+3*(d-f)+h),6*(b-2*d+f),3*(d-b),i)}}let M=null,N=null;function O(a){return M||(M=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,N=new Map([["ſt","ſt"]])),a.replaceAll(M,(a,b,c)=>b?b.normalize("NFKC"):N.get(c))}function P(){if("function"==typeof crypto.randomUUID)return crypto.randomUUID();let a=new Uint8Array(32);return crypto.getRandomValues(a),function(a){("object"!=typeof a||a?.length===void 0)&&w("Invalid argument for bytesToString");let b=a.length;if(b<8192)return String.fromCharCode.apply(null,a);let c=[];for(let d=0;d<b;d+=8192){let e=Math.min(d+8192,b),f=a.subarray(d,e);c.push(String.fromCharCode.apply(null,f))}return c.join("")}(a)}let Q=()=>[],R=()=>new Map,S=()=>Object.create(null),T=()=>new Set;function U(a,b,c){return Math.min(Math.max(a,b),c)}"function"!=typeof Iterator.prototype.join&&(Iterator.prototype.join=function(a){return[...this].join(a)});class V{constructor({viewBox:a,userUnit:b,scale:c,rotation:d,offsetX:e=0,offsetY:f=0,dontFlip:g=!1}){let h,i,j,k,l,m,n,o;this.viewBox=a,this.userUnit=b,this.scale=c,this.rotation=d,this.offsetX=e,this.offsetY=f,c*=b;const p=(a[2]+a[0])/2,q=(a[3]+a[1])/2;switch((d%=360)<0&&(d+=360),d){case 180:h=-1,i=0,j=0,k=1;break;case 90:h=0,i=1,j=1,k=0;break;case 270:h=0,i=-1,j=-1,k=0;break;case 0:h=1,i=0,j=0,k=-1;break;default:throw Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}g&&(j=-j,k=-k),0===h?(l=Math.abs(q-a[1])*c+e,m=Math.abs(p-a[0])*c+f,n=(a[3]-a[1])*c,o=(a[2]-a[0])*c):(l=Math.abs(p-a[0])*c+e,m=Math.abs(q-a[1])*c+f,n=(a[2]-a[0])*c,o=(a[3]-a[1])*c),this.transform=[h*c,i*c,j*c,k*c,l-h*c*p-j*c*q,m-i*c*p-k*c*q],this.width=n,this.height=o}get rawDims(){let a=this.viewBox;return B(this,"rawDims",{pageWidth:a[2]-a[0],pageHeight:a[3]-a[1],pageX:a[0],pageY:a[1]})}clone({scale:a=this.scale,rotation:b=this.rotation,offsetX:c=this.offsetX,offsetY:d=this.offsetY,dontFlip:e=!1}={}){return new V({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:a,rotation:b,offsetX:c,offsetY:d,dontFlip:e})}convertToViewportPoint(a,b){let c=[a,b];return L.applyTransform(c,this.transform),c}convertToPdfPoint(a,b){let c=[a,b];return L.applyInverseTransform(c,this.transform),c}}class W{static textContent(a){let b=[],c={items:b,styles:Object.create(null)};return!function a(c){if(!c)return;let d=null,e=c.name;if("#text"===e)d=c.value;else{if(!W.shouldBuildText(e))return;c?.attributes?.textContent?d=c.attributes.textContent:c.value&&(d=c.value)}if(null!==d&&b.push({str:d}),c.children)for(let b of c.children)a(b)}(a),c}static shouldBuildText(a){return"textarea"!==a&&"input"!==a&&"option"!==a&&"select"!==a}}let X=/url\(|image-set\(/i,Y=/^on/i;class Z{static get _allowedHtmlElements(){return B(this,"_allowedHtmlElements",new Set(["a","b","br","button","div","i","img","input","label","li","ol","option","p","select","span","sub","sup","textarea","ul"]))}static get _allowedSvgElements(){return B(this,"_allowedSvgElements",new Set(["ellipse","line","path","rect","svg"]))}static get _allowedRichTextElements(){return B(this,"_allowedRichTextElements",new Set(["a","b","br","div","i","li","ol","p","span","sub","sup","ul"]))}static get _allowedRichTextAttributes(){return B(this,"_allowedRichTextAttributes",new Set(["class","dir","style"]))}static get _allowedRichTextStyles(){return B(this,"_allowedRichTextStyles",new Set(["color","font","fontFamily","fontSize","fontStretch","fontStyle","fontWeight","kerningMode","letterSpacing","lineHeight","margin","marginBottom","marginLeft","marginRight","marginTop","orphans","paddingLeft","paddingRight","breakAfter","breakBefore","breakInside","tabInterval","tabStop","textAlign","textDecoration","textIndent","transform","verticalAlign","widows"]))}static setupStorage(a,b,c,d,e){let f=d.getValue(b,{value:null});switch(c.name){case"textarea":if(null!==f.value&&(a.textContent=f.value),"print"===e)break;a.addEventListener("input",a=>{d.setValue(b,{value:a.target.value})});break;case"input":if("radio"===c.attributes.type||"checkbox"===c.attributes.type){if(f.value===c.attributes.xfaOn?a.setAttribute("checked",!0):f.value===c.attributes.xfaOff&&a.removeAttribute("checked"),"print"===e)break;a.addEventListener("change",a=>{d.setValue(b,{value:a.target.checked?a.target.getAttribute("xfaOn"):a.target.getAttribute("xfaOff")})})}else{if(null!==f.value&&a.setAttribute("value",f.value),"print"===e)break;a.addEventListener("input",a=>{d.setValue(b,{value:a.target.value})})}break;case"select":if(null!==f.value)for(let b of(a.setAttribute("value",f.value),c.children))b.attributes.value===f.value?b.attributes.selected=!0:Object.hasOwn(b.attributes,"selected")&&delete b.attributes.selected;a.addEventListener("input",a=>{let c=a.target.options,e=-1===c.selectedIndex?"":c[c.selectedIndex].value;d.setValue(b,{value:e})})}}static setAttributes({html:a,element:b,storage:c=null,intent:d,linkService:e}){let{attributes:f}=b,g=a instanceof HTMLAnchorElement;for(let[b,c]of("radio"===f.type&&(f.name=`${f.name}-${d}`),Object.entries(f)))if(!(null==c||Y.test(b))&&("richText"!==d||this._allowedRichTextAttributes.has(b)))switch(b){case"class":c.length&&a.setAttribute(b,c.join(" "));break;case"dataId":break;case"id":a.setAttribute("data-element-id",c);break;case"style":if("richText"===d){let b=this._allowedRichTextStyles;for(let[d,e]of Object.entries(c))b.has(d)&&!X.test(e)&&(a.style[d]=e)}else Object.assign(a.style,c);break;case"textContent":a.textContent=c;break;default:g&&("href"===b||"newWindow"===b)||a.setAttribute(b,c)}g&&e?.addLinkAttributes(a,f.href,f.newWindow),c&&f.dataId&&this.setupStorage(a,f.dataId,b,c)}static #c(a,b,c){return"richText"===c?!b&&this._allowedRichTextElements.has(a)?document.createElement(a):null:b?b===h&&this._allowedSvgElements.has(a)?document.createElementNS(h,a):null:this._allowedHtmlElements.has(a)?document.createElement(a):null}static render(a){let b=a.annotationStorage,c=a.linkService,d=a.xfaHtml,e=a.intent||"display",f=this.#c(d.name,d.attributes?.xmlns,e)??document.createElement("div");d.attributes&&this.setAttributes({html:f,element:d,intent:e,linkService:c});let g="richText"!==e,h=a.div;if(h.append(f),a.viewport){let b=`matrix(${a.viewport.transform.join(",")})`;h.style.transform=b}g&&h.setAttribute("class","xfaLayer xfaFont");let i=[];if(0===d.children.length){if(d.value){let a=document.createTextNode(d.value);f.append(a),g&&W.shouldBuildText(d.name)&&i.push(a)}return{textDivs:i}}let j=[[d,-1,f]];for(;j.length>0;){let[a,d,f]=j.at(-1);if(d+1===a.children.length){j.pop();continue}let h=a.children[++j.at(-1)[1]];if(null===h)continue;let{name:k}=h;if("#text"===k){let a=document.createTextNode(h.value);i.push(a),f.append(a);continue}let l=this.#c(k,h.attributes?.xmlns,e);if(l){if(f.append(l),h.attributes&&this.setAttributes({html:l,element:h,storage:b,intent:e,linkService:c}),h.children?.length>0)j.push([h,-1,l]);else if(h.value){let a=document.createTextNode(h.value);g&&W.shouldBuildText(k)&&i.push(a),l.append(a)}}}for(let a of h.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))a.setAttribute("readOnly",!0);return{textDivs:i}}static update(a){let b=`matrix(${a.viewport.transform.join(",")})`;a.div.style.transform=b,a.div.hidden=!1}static getPageViewport(a,{scale:b=1,rotation:c=0}){let{width:d,height:e}=a.attributes.style;return new V({viewBox:[0,0,parseInt(d,10),parseInt(e,10)],userUnit:1,scale:b,rotation:c})}}class ${static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}async function _(a,b="text"){if(ag(a,document.baseURI)){let c=await fetch(a);if(!c.ok)throw Error(c.statusText);switch(b){case"blob":return c.blob();case"bytes":return c.bytes();case"json":return c.json()}return c.text()}return new Promise((c,d)=>{let e=new XMLHttpRequest;e.open("GET",a,!0),e.responseType="bytes"===b?"arraybuffer":b,e.onreadystatechange=()=>{if(e.readyState===XMLHttpRequest.DONE){if(200===e.status||0===e.status){switch(b){case"bytes":c(new Uint8Array(e.response));return;case"blob":case"json":c(e.response);return}c(e.responseText);return}d(Error(e.statusText))}},e.send(null)})}class aa extends C{constructor(a,b=0){super(a,"RenderingCancelledException"),this.extraDelay=b}}function ab(a){let b=a.length,c=0;for(;c<b&&""===a[c].trim();)c++;return"data:"===a.substring(c,c+5).toLowerCase()}function ac(a){return"string"==typeof a&&/\.pdf$/i.test(a)}function ad(a){return[a]=a.split(/[#?]/,1),A(a)}function ae(a,b="document.pdf"){if("string"!=typeof a)return b;if(ab(a))return v('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),b;let c=(a=>{try{return new URL(a)}catch{}try{return new URL(decodeURIComponent(a))}catch{}try{return new URL(a,"https://foo.bar")}catch{}try{return new URL(decodeURIComponent(a),"https://foo.bar")}catch{}return null})(a);if(!c)return b;let d=a=>{try{let b=decodeURIComponent(a);if(b.includes("/")&&(b=A(b),4===b.length&&e.test(b)))return a;return b}catch{return a}},e=/\.pdf$/i,f=A(c.pathname);if(e.test(f))return d(f);if(c.searchParams.size>0){let a=a=>[...a].findLast(a=>e.test(a)),b=a(c.searchParams.values())??a(c.searchParams.keys());if(b)return d(b)}if(c.hash){let a=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(c.hash);if(a)return d(a[0])}return b}class af{#d=new Map;times=[];time(a){this.#d.has(a)&&v(`Timer is already running for ${a}`),this.#d.set(a,Date.now())}timeEnd(a){this.#d.has(a)||v(`Timer has not been started for ${a}`),this.times.push({name:a,start:this.#d.get(a),end:Date.now()}),this.#d.delete(a)}toString(){let a=Math.max(...this.times.map(a=>a.name.length));return this.times.map(b=>`${b.name.padEnd(a)} ${b.end-b.start}ms
|
|
2
2
|
`).join("")}}function ag(a,b){let c=b?URL.parse(a,b):URL.parse(a);return/https?:/.test(c?.protocol??"")}function ah(a){a.preventDefault()}function ai(a){a.preventDefault(),a.stopPropagation()}class aj{static #e;static toDateObject(a){if(a instanceof Date)return a;if(!a||"string"!=typeof a)return null;this.#e||=RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+\\-])?(\\d{2})?'?(\\d{2})?'?");let b=this.#e.exec(a);if(!b)return null;let c=parseInt(b[1],10),d=parseInt(b[2],10);d=d>=1&&d<=12?d-1:0;let e=parseInt(b[3],10);e=e>=1&&e<=31?e:1;let f=parseInt(b[4],10);f=f>=0&&f<=23?f:0;let g=parseInt(b[5],10);g=g>=0&&g<=59?g:0;let h=parseInt(b[6],10);h=h>=0&&h<=59?h:0;let i=b[7]||"Z",j=parseInt(b[8],10);j=j>=0&&j<=23?j:0;let k=parseInt(b[9],10)||0;return k=k>=0&&k<=59?k:0,"-"===i?(f+=j,g+=k):"+"===i&&(f-=j,g-=k),new Date(Date.UTC(c,d,e,f,g,h))}}function ak(a){if(a.startsWith("#")){let b=a.slice(1);return[parseInt(b.slice(0,2),16),parseInt(b.slice(2,4),16),parseInt(b.slice(4,6),16),b.length>=8?parseInt(b.slice(6,8),16)/255:1]}if(a.startsWith("rgb(")){let[b,c,d]=a.slice(4,-1).split(",").map(a=>parseInt(a,10));return[b,c,d,1]}if(a.startsWith("rgba(")){let b=a.slice(5,-1).split(",");return[parseInt(b[0],10),parseInt(b[1],10),parseInt(b[2],10),parseFloat(b[3])]}let b=a.match(/^color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+|none))?\)$/);return b?[Math.round(255*parseFloat(b[1])),Math.round(255*parseFloat(b[2])),Math.round(255*parseFloat(b[3])),void 0!==b[4]&&"none"!==b[4]?parseFloat(b[4]):1]:null}function al(a){let b=ak(a);return b?b.slice(0,3):(v(`Not a valid color format: "${a}"`),[0,0,0])}function am(a){let{a:b,b:c,c:d,d:e,e:f,f:g}=a.getTransform();return[b,c,d,e,f,g]}function an(a){let{a:b,b:c,c:d,d:e,e:f,f:g}=a.getTransform().invertSelf();return[b,c,d,e,f,g]}function ao(a,b,c=!1,d=!0){if(b instanceof V){let{pageWidth:d,pageHeight:e}=b.rawDims,{style:f}=a,g=`round(down, var(--total-scale-factor) * ${d}px, var(--scale-round-x))`,h=`round(down, var(--total-scale-factor) * ${e}px, var(--scale-round-y))`;c&&b.rotation%180!=0?(f.width=h,f.height=g):(f.width=g,f.height=h)}d&&a.setAttribute("data-main-rotation",b.rotation)}class ap{constructor(){const{pixelRatio:a}=ap;this.sx=a,this.sy=a}get scaled(){return 1!==this.sx||1!==this.sy}get symmetric(){return this.sx===this.sy}limitCanvas(a,b,c,d,e=-1){let f=1/0,g=1/0,h=1/0;(c=ap.capPixels(c,e))>0&&(f=Math.sqrt(c/(a*b))),-1!==d&&(g=d/a,h=d/b);let i=Math.min(f,g,h);return(this.sx>i||this.sy>i)&&(this.sx=i,this.sy=i,!0)}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(a,b){if(b>=0){let c=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+b/100));return a>0?Math.min(a,c):c}return a}}let aq=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class ar{static get isDarkMode(){return B(this,"isDarkMode",!!window?.matchMedia?.("(prefers-color-scheme: dark)").matches)}}class as{static get commentForegroundColor(){let a=document.createElement("span");a.classList.add("comment","sidebar");let{style:b}=a;b.width=b.height="0",b.display="none",b.color="var(--comment-fg-color)",document.body.append(a);let{color:c}=window.getComputedStyle(a);return a.remove(),B(this,"commentForegroundColor",al(c))}}function at(a,b){let c=255*(1-(b=U(b??1,0,1)));return a.map(a=>Math.round(a*b+c))}function au(a,b){let c=a[0]/255,d=a[1]/255,e=a[2]/255,f=Math.max(c,d,e),g=Math.min(c,d,e),h=(f+g)/2;if(f===g)b[0]=b[1]=0;else{let a=f-g;switch(b[1]=h<.5?a/(f+g):a/(2-f-g),f){case c:b[0]=((d-e)/a+6*(d<e))*60;break;case d:b[0]=((e-c)/a+2)*60;break;case e:b[0]=((c-d)/a+4)*60}}b[2]=h}function av(a,b){let c=a[0],d=a[1],e=a[2],f=(1-Math.abs(2*e-1))*d,g=f*(1-Math.abs(c/60%2-1)),h=e-f/2;switch(Math.floor(c/60)){case 0:b[0]=f+h,b[1]=g+h,b[2]=h;break;case 1:b[0]=g+h,b[1]=f+h,b[2]=h;break;case 2:b[0]=h,b[1]=f+h,b[2]=g+h;break;case 3:b[0]=h,b[1]=g+h,b[2]=f+h;break;case 4:b[0]=g+h,b[1]=h,b[2]=f+h;break;case 5:case 6:b[0]=f+h,b[1]=h,b[2]=g+h}}function aw(a){return a<=.03928?a/12.92:((a+.055)/1.055)**2.4}function ax(a,b,c){av(a,c),c.map(aw);let d=.2126*c[0]+.7152*c[1]+.0722*c[2];av(b,c),c.map(aw);let e=.2126*c[0]+.7152*c[1]+.0722*c[2];return d>e?(d+.05)/(e+.05):(e+.05)/(d+.05)}let ay=new Map;function az(a,b){let c=a[0]+256*a[1]+65536*a[2]+0x1000000*b[0]+0x100000000*b[1]+0x10000000000*b[2],d=ay.get(c);if(d)return d;let e=new Float32Array(9),f=e.subarray(0,3),g=e.subarray(3,6);au(a,g);let h=e.subarray(6,9);au(b,h);let i=h[2]<.5,j=i?12:4.5;if(g[2]=i?Math.sqrt(g[2]):1-Math.sqrt(1-g[2]),ax(g,h,f)<j){let a,b;for(i?(a=g[2],b=1):(a=0,b=g[2]);b-a>.005;){let c=g[2]=(a+b)/2;i===ax(g,h,f)<j?a=c:b=c}g[2]=i?b:a}return av(g,f),d=L.makeHexColor(Math.round(255*f[0]),Math.round(255*f[1]),Math.round(255*f[2])),ay.set(c,d),d}function aA({html:a,dir:b,className:c},d){let e=document.createDocumentFragment();if("string"==typeof a){let c=document.createElement("p");c.dir=b||"auto";let d=a.split(/\r\n?|\n/);for(let a=0,b=d.length;a<b;++a){let e=d[a];c.append(document.createTextNode(e)),a<b-1&&c.append(document.createElement("br"))}e.append(c)}else Z.render({xfaHtml:a,div:e,intent:"richText"});e.firstElementChild.classList.add("richText",c),d.append(e)}function aB(a){let b=new Path2D;if(!a)return b;for(let c=0,d=a.length;c<d;)switch(a[c++]){case 0:b.moveTo(a[c++],a[c++]);break;case 1:b.lineTo(a[c++],a[c++]);break;case 2:b.bezierCurveTo(a[c++],a[c++],a[c++],a[c++],a[c++],a[c++]);break;case 3:b.quadraticCurveTo(a[c++],a[c++],a[c++],a[c++]);break;case 4:b.closePath();break;default:v(`Unrecognized drawing path operator: ${a[c-1]}`)}return b}class aC{#f=null;#g=null;#h;#i=null;#j=null;#k=null;#l=null;#m=null;static #n=null;constructor(a){this.#h=a,aC.#n||=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"})}render(){let a=this.#f=document.createElement("div");a.classList.add("editToolbar","hidden"),a.setAttribute("role","toolbar");let b=this.#h._uiManager._signal;b instanceof AbortSignal&&!b.aborted&&(a.addEventListener("contextmenu",ah,{signal:b}),a.addEventListener("pointerdown",aC.#o,{signal:b}));let c=this.#i=document.createElement("div");c.className="buttons",a.append(c);let d=this.#h.toolbarPosition;if(d){let{style:b}=a,c="ltr"===this.#h._uiManager.direction?1-d[0]:d[0];b.insetInlineEnd=`${100*c}%`,b.top=`calc(${100*d[1]}% + var(--editor-toolbar-vert-offset))`}return a}get div(){return this.#f}static #o(a){a.stopPropagation()}#p(a){this.#h._focusEventsAllowed=!1,ai(a)}#q(a){this.#h._focusEventsAllowed=!0,ai(a)}#r(a){let b=this.#h._uiManager._signal;return b instanceof AbortSignal&&!b.aborted&&(a.addEventListener("focusin",this.#p.bind(this),{capture:!0,signal:b}),a.addEventListener("focusout",this.#q.bind(this),{capture:!0,signal:b}),a.addEventListener("contextmenu",ah,{signal:b}),!0)}hide(){this.#f.classList.add("hidden"),this.#g?.hideDropdown()}show(){this.#f.classList.remove("hidden"),this.#j?.shown(),this.#k?.shown()}addDeleteButton(){let{editorType:a,_uiManager:b}=this.#h,c=document.createElement("button");c.classList.add("basic","deleteButton"),c.tabIndex=0,c.setAttribute("data-l10n-id",aC.#n[a]),this.#r(c)&&c.addEventListener("click",a=>{b.delete()},{signal:b._signal}),this.#i.append(c)}get #s(){let a=document.createElement("div");return a.className="divider",a}async addAltText(a){let b=await a.render();this.#r(b),this.#i.append(b,this.#s),this.#j=a}addComment(a,b=null){if(this.#k)return;let c=a.renderForToolbar();if(!c)return;this.#r(c);let d=this.#l=this.#s;b?(this.#i.insertBefore(c,b),this.#i.insertBefore(d,b)):this.#i.append(c,d),this.#k=a,a.toolbar=this}addColorPicker(a){if(this.#g)return;this.#g=a;let b=a.renderButton();this.#r(b),this.#i.append(b,this.#s)}async addEditSignatureButton(a){let b=this.#m=await a.renderEditButton(this.#h);this.#r(b),this.#i.append(b,this.#s)}removeButton(a){"comment"===a&&(this.#k?.removeToolbarCommentButton(),this.#k=null,this.#l?.remove(),this.#l=null)}async addButton(a,b){switch(a){case"colorPicker":b&&this.addColorPicker(b);break;case"altText":b&&await this.addAltText(b);break;case"editSignature":b&&await this.addEditSignatureButton(b);break;case"delete":this.addDeleteButton();break;case"comment":b&&this.addComment(b)}}async addButtonBefore(a,b,c){if(!b&&"comment"===a)return;let d=this.#i.querySelector(c);d&&"comment"===a&&this.addComment(b,d)}updateEditSignatureButton(a){this.#m&&(this.#m.title=a)}remove(){this.#f.remove(),this.#g?.destroy(),this.#g=null}}class aD{#i=null;#f=null;#t;constructor(a){this.#t=a}#u(){let a=this.#f=document.createElement("div");a.className="editToolbar",a.setAttribute("role","toolbar");let b=this.#t._signal;b instanceof AbortSignal&&!b.aborted&&a.addEventListener("contextmenu",ah,{signal:b});let c=this.#i=document.createElement("div");return c.className="buttons",a.append(c),this.#t.hasCommentManager()&&this.#v("commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{this.#t.commentSelection("floating_button")}),this.#v("highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{this.#t.highlightSelection("floating_button")}),a}#w(a,b){let c=0,d=0;for(let e of a){let a=e.y+e.height;if(a<c)continue;let f=e.x+(b?e.width:0);if(a>c){d=f,c=a;continue}b?f>d&&(d=f):f<d&&(d=f)}return[b?1-d:d,c]}show(a,b,c){let[d,e]=this.#w(b,c),{style:f}=this.#f||=this.#u();a.append(this.#f),f.insetInlineEnd=`${100*d}%`,f.top=`calc(${100*e}% + var(--editor-toolbar-vert-offset))`}hide(){this.#f.remove()}#v(a,b,c,d){let e=document.createElement("button");e.classList.add("basic",a),e.tabIndex=0,e.setAttribute("data-l10n-id",b);let f=document.createElement("span");e.append(f),f.className="visuallyHidden",f.setAttribute("data-l10n-id",c);let g=this.#t._signal;g instanceof AbortSignal&&!g.aborted&&(e.addEventListener("contextmenu",ah,{signal:g}),e.addEventListener("click",d,{signal:g})),this.#i.append(e)}}let aE=Object.freeze({internal:"f63eb798-ea37-4556-98de-f8303ee5a694"});function aF(a,b,c){for(let d of c)b.addEventListener(d,a[d].bind(a))}class aG{static #x=NaN;static #y=null;static #z=NaN;static #A=null;static initializeAndAddPointerId(a){(aG.#y||=new Set).add(a)}static setPointer(a,b){aG.#x||=b,aG.#A??=a}static setTimeStamp(a){aG.#z=a}static isSamePointerId(a){return aG.#x===a}static isSamePointerIdOrRemove(a){return aG.#x===a||(aG.#y?.delete(a),!1)}static isSamePointerType(a){return aG.#A===a}static isInitializedAndDifferentPointerType(a){return null!==aG.#A&&!aG.isSamePointerType(a)}static isSameTimeStamp(a){return aG.#z===a}static isUsingMultiplePointers(){return aG.#y?.size>=1}static clearPointerType(){aG.#A=null}static clearPointerIds(){aG.#x=NaN,aG.#y=null}static clearTimeStamp(){aG.#z=NaN}}class aH{#B=0;get id(){return`${k}${this.#B++}`}}class aI{#C=P();#B=0;#D=null;static get _isSVGFittingCanvas(){let a=`data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="${h}"><rect width="1" height="1" style="fill:red;"/></svg>`,b=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),c=new Image;return c.src=a,B(this,"_isSVGFittingCanvas",c.decode().then(()=>(b.drawImage(c,0,0,1,1,0,0,1,3),0===new Uint32Array(b.getImageData(0,0,1,1).data.buffer)[0])))}async #E(a,b){this.#D||=new Map;let c=this.#D.get(a);if(null===c)return null;if(c?.bitmap)return c.refCounter+=1,c;try{let a;if(c||={bitmap:null,id:`image_${this.#C}_${this.#B++}`,refCounter:0,isSvg:!1},"string"==typeof b?(c.url=b,a=await _(b,"blob")):b instanceof File?a=c.file=b:b instanceof Blob&&(a=b),"image/svg+xml"===a.type){let b=aI._isSVGFittingCanvas,d=new FileReader,e=new Image,f=new Promise((a,f)=>{e.onload=()=>{c.bitmap=e,c.isSvg=!0,a()},d.onload=async()=>{let a=c.svgUrl=d.result;e.src=await b?`${a}#svgView(preserveAspectRatio(none))`:a},e.onerror=d.onerror=f});d.readAsDataURL(a),await f}else c.bitmap=await createImageBitmap(a);c.refCounter=1}catch(a){v(a),c=null}return this.#D.set(a,c),c&&this.#D.set(c.id,c),c}async getFromFile(a){let{lastModified:b,name:c,size:d,type:e}=a;return this.#E(`${b}_${c}_${d}_${e}`,a)}async getFromUrl(a){return this.#E(a,a)}async getFromBlob(a,b){let c=await b;return this.#E(a,c)}async getFromId(a){this.#D||=new Map;let b=this.#D.get(a);if(!b)return null;if(b.bitmap)return b.refCounter+=1,b;if(b.file)return this.getFromFile(b.file);if(b.blobPromise){let{blobPromise:a}=b;return delete b.blobPromise,this.getFromBlob(b.id,a)}return this.getFromUrl(b.url)}getFromCanvas(a,b){this.#D||=new Map;let c=this.#D.get(a);if(c?.bitmap)return c.refCounter+=1,c;let d=new OffscreenCanvas(b.width,b.height);return d.getContext("2d").drawImage(b,0,0),c={bitmap:d.transferToImageBitmap(),id:`image_${this.#C}_${this.#B++}`,refCounter:1,isSvg:!1},this.#D.set(a,c),this.#D.set(c.id,c),c}getSvgUrl(a){let b=this.#D.get(a);return b?.isSvg?b.svgUrl:null}deleteId(a){this.#D||=new Map;let b=this.#D.get(a);if(!b||(b.refCounter-=1,0!==b.refCounter))return;let{bitmap:c}=b;if(!b.url&&!b.file){let a=new OffscreenCanvas(c.width,c.height);a.getContext("bitmaprenderer").transferFromImageBitmap(c),b.blobPromise=a.convertToBlob()}c.close?.(),b.bitmap=null}isValidId(a){return a.startsWith(`image_${this.#C}_`)}}class aJ{#F=[];#G=!1;#H;#I=-1;constructor(a=128){this.#H=a}add({cmd:a,undo:b,post:c,mustExec:d,type:e=NaN,overwriteIfSameType:f=!1,keepUndo:g=!1}){if(d&&a(),this.#G)return;let h={cmd:a,undo:b,post:c,type:e};if(-1===this.#I){this.#F.length>0&&(this.#F.length=0),this.#I=0,this.#F.push(h);return}if(f&&this.#F[this.#I].type===e){g&&(h.undo=this.#F[this.#I].undo),this.#F[this.#I]=h;return}let i=this.#I+1;i===this.#H?this.#F.splice(0,1):(this.#I=i,i<this.#F.length&&this.#F.splice(i)),this.#F.push(h)}undo(){if(-1===this.#I)return;this.#G=!0;let{undo:a,post:b}=this.#F[this.#I];a(),b?.(),this.#G=!1,this.#I-=1}redo(){if(this.#I<this.#F.length-1){this.#I+=1,this.#G=!0;let{cmd:a,post:b}=this.#F[this.#I];a(),b?.(),this.#G=!1}}hasSomethingToUndo(){return -1!==this.#I}hasSomethingToRedo(){return this.#I<this.#F.length-1}cleanType(a){if(-1!==this.#I){for(let b=this.#I;b>=0;b--)if(this.#F[b].type!==a){this.#F.splice(b+1,this.#I-b),this.#I=b;return}this.#F.length=0,this.#I=-1}}destroy(){this.#F=null}}class aK{static ALT=1;static CTRL=2;static META=4;static SHIFT=8;constructor(a){this.callbacks=new Map;const{isMac:b}=K.platform;for(const[c,d,e={}]of a){const a=c.some(a=>a.startsWith("mac+"));for(const f of c){let c=f;if(a){const a=f.startsWith("mac+");if(b!==a)continue;a&&(c=f.slice(4))}const[g,h]=aK.#J(c);null!==g&&this.callbacks.getOrInsertComputed(g,Q).push({callback:d,options:e,modifiers:h})}}}static #J(a){let b=null,c=0;for(let d of a.split("+")){if(!(d=d.trim()))continue;let e=d.toUpperCase(),f=aK[e];if(f){c|=f;continue}if(null!==b){v(`KeyboardManager: multiple keys in shortcut "${a}"`);break}b="SPACE"===e?" ":d}return null===b&&v(`KeyboardManager: no key found in shortcut "${a}"`),[b,c]}static #K(a){let b=/^(?:Key([A-Z])|(?:Digit|Numpad)(\d))$/.exec(a);return b?b[1]?.toLowerCase()??b[2]:null}exec(a,b){let c=this.callbacks.get(b.key);if(!c){if(/^[a-z]$/i.test(b.key))return;let a=aK.#K(b.code);if(null===a||a===b.key||!(c=this.callbacks.get(a)))return}let d=(b.altKey?aK.ALT:0)|(b.ctrlKey?aK.CTRL:0)|(b.metaKey?aK.META:0)|(b.shiftKey?aK.SHIFT:0),e=c.find(a=>a.modifiers===d);if(!e)return;let{callback:f,options:{bubbles:g=!1,args:h=[],checker:i=null}}=e;(!i||i(a,b))&&(f.bind(a,...h,b)(),g||ai(b))}}class aL{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){let a=new Map([["CanvasText",null],["Canvas",null]]),b=document.createElement("span");for(let c of(b.style.visibility="hidden",b.style.colorScheme="only light",document.body.append(b),a.keys())){b.style.color=c;let d=window.getComputedStyle(b).color;a.set(c,al(d))}return b.remove(),B(this,"_colors",a)}convert(a){let b=al(a);if(!window.matchMedia("(forced-colors: active)").matches)return b;for(let[a,c]of this._colors)if(c.every((a,c)=>a===b[c]))return aL._colorsMapping.get(a);return b}getHexCode(a){let b=this._colors.get(a);return b?L.makeHexColor(...b):a}}class aM{#L=new AbortController;#M=null;#N=null;#O=new Map;#P=new Map;#Q=null;#R=null;#S=null;#T=null;#U=new aJ;#V=null;#W=null;#X=null;#Y=0;#Z=new Set;#$=null;#_=null;#aa=new Set;_editorUndoBar=null;#ab=!1;#ac=!1;#ad=!1;#ae=null;#af=null;#ag=null;#ah=null;#ai=!1;#aj=null;#ak=new aH;#al=!1;#am=!1;#an=!1;#ao=null;#ap=null;#aq=null;#ar=null;#as=null;#at=l.NONE;#au=new Set;#av=null;#aw=null;#ax=null;#ay=null;#az=null;#aA={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#aB=[0,0];#aC=null;#aD=null;#aE=null;#aF=null;#aG=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){let a=aM.prototype,b=a=>a.#aD.contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&a.hasSomethingToControl(),c=(a,{target:b})=>{if(b instanceof HTMLInputElement){let{type:a}=b;return"text"!==a&&"number"!==a}return!0},d=this.TRANSLATE_SMALL,e=this.TRANSLATE_BIG;return B(this,"_keyboardManager",new aK([[["ctrl+a","mac+meta+a"],a.selectAll,{checker:c}],[["ctrl+z","mac+meta+z"],a.undo,{checker:c}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],a.redo,{checker:c}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],a.delete,{checker:c}],[["Enter"],a.addNewEditorFromKeyboard,{checker:(a,{target:b})=>!(b instanceof HTMLButtonElement)&&a.#aD.contains(b)&&!a.isEnterHandled}],[["Space"],a.addNewEditorFromKeyboard,{checker:(a,{target:b})=>!(b instanceof HTMLButtonElement)&&a.#aD.contains(document.activeElement)}],[["Escape"],a.unselectAll],[["ArrowLeft"],a.translateSelectedEditors,{args:[-d,0],checker:b}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],a.translateSelectedEditors,{args:[-e,0],checker:b}],[["ArrowRight"],a.translateSelectedEditors,{args:[d,0],checker:b}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],a.translateSelectedEditors,{args:[e,0],checker:b}],[["ArrowUp"],a.translateSelectedEditors,{args:[0,-d],checker:b}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],a.translateSelectedEditors,{args:[0,-e],checker:b}],[["ArrowDown"],a.translateSelectedEditors,{args:[0,d],checker:b}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],a.translateSelectedEditors,{args:[0,e],checker:b}]]))}constructor(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){const q=this._signal=this.#L.signal;this.#aD=a,this.#aE=b,this.#aF=c,this.#R=d,this.#V=e,this.#aw=f,this.#az=h,this._eventBus=g;const r={signal:q,...aE};g.on("editingaction",this.onEditingAction.bind(this),r),g.on("pagechanging",this.onPageChanging.bind(this),r),g.on("scalechanging",this.onScaleChanging.bind(this),r),g.on("rotationchanging",this.onRotationChanging.bind(this),r),g.on("setpreference",this.onSetPreference.bind(this),r),g.on("switchannotationeditorparams",a=>this.updateParams(a.type,a.value),r),window.addEventListener("pointerdown",()=>{this.#am=!0},{capture:!0,signal:q}),window.addEventListener("pointerup",()=>{this.#am=!1},{capture:!0,signal:q}),window.addEventListener("beforeunload",this.endCurrentEditing.bind(this),{capture:!0,signal:q}),this.#aH(),this.#aI(),this.#aJ(),this.#S=h.annotationStorage,this.#ae=h.filterFactory,this.#ax=i,this.#ah=j||null,this.#ab=k,this.#ac=l,this.#ad=m,this.#as=n||null,this.viewParameters={realScale:$.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=o||null,this._supportsPinchToZoom=!1!==p,e?.setSidebarUiManager(this)}destroy(){for(let a of(this.#aG?.resolve(),this.#aG=null,this.#L?.abort(),this.#L=null,this._signal=null,this.#P.values()))a.destroy();this.#P.clear(),this.#O.clear(),this.#aa.clear(),this.#ar?.clear(),this.#M=null,this.#au.clear(),this.#U.destroy(),this.#R?.destroy(),this.#V?.destroy(),this.#aw?.destroy(),this.#aj?.hide(),this.#aj=null,this.#aq?.destroy(),this.#aq=null,this.#N=null,this.#af&&(clearTimeout(this.#af),this.#af=null),this.#aC&&(clearTimeout(this.#aC),this.#aC=null),this._editorUndoBar?.destroy(),this.#az=null}combinedSignal(a){return AbortSignal.any([this._signal,a.signal])}get mlManager(){return this.#as}get useNewAltTextFlow(){return this.#ac}get useNewAltTextWhenAddingImage(){return this.#ad}get hcmFilter(){return B(this,"hcmFilter",this.#ax?this.#ae.addHCMFilter(this.#ax.foreground,this.#ax.background):"none")}get direction(){return B(this,"direction",getComputedStyle(this.#aD).direction)}get _highlightColors(){return B(this,"_highlightColors",this.#ah?new Map(this.#ah.split(",").map(a=>((a=a.split("=").map(a=>a.trim()))[1]=a[1].toUpperCase(),a))):null)}get highlightColors(){let{_highlightColors:a}=this;if(!a)return B(this,"highlightColors",null);let b=new Map,c=!!this.#ax;for(let[d,e]of a){let a=d.endsWith("_HCM");if(c&&a){b.set(d.replace("_HCM",""),e);continue}c||a||b.set(d,e)}return B(this,"highlightColors",b)}get highlightColorNames(){return B(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,a=>a.reverse())):null)}getNonHCMColor(a){if(!this._highlightColors)return a;let b=this.highlightColorNames.get(a);return this._highlightColors.get(b)||a}getNonHCMColorName(a){return this.highlightColorNames.get(a)||a}setCurrentDrawingSession(a){a?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),this.#X=a}setMainHighlightColorPicker(a){this.#aq=a}editAltText(a,b=!1){this.#R?.editAltText(this,a,b)}hasCommentManager(){return!!this.#V}editComment(a,b,c,d){this.#V?.showDialog(this,a,b,c,d)}selectComment(a,b){let c=this.#P.get(a),d=c?.getEditorByUID(b);d?.toggleComment(!0,!0)}updateComment(a){this.#V?.updateComment(a.getData())}updatePopupColor(a){this.#V?.updatePopupColor(a)}removeComment(a){this.#V?.removeComments([a.uid])}deleteComment(a,b){let c=()=>{a.comment=b},d=()=>{this._editorUndoBar?.show(c,"comment"),this.toggleComment(null),a.comment=null};this.addCommands({cmd:d,undo:c,mustExec:!0})}toggleComment(a,b,c){this.#V?.toggleCommentPopup(a,b,c)}makeCommentColor(a,b){return a&&this.#V?.makeCommentColor(a,b)||null}getCommentDialogElement(){return this.#V?.dialogElement||null}async waitForEditorsRendered(a){if(this.#P.has(a-1))return;let{resolve:b,promise:c}=Promise.withResolvers(),d=c=>{c.pageNumber===a&&(this._eventBus.off("editorsrendered",d),b())};this._eventBus.on("editorsrendered",d,aE),await c}getSignature(a){this.#aw?.getSignature({uiManager:this,editor:a})}get signatureManager(){return this.#aw}switchToMode(a,b){this._eventBus.on("annotationeditormodechanged",b,{once:!0,signal:this._signal,...aE}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:a})}setPreference(a,b){this._eventBus.dispatch("setpreference",{source:this,name:a,value:b})}onSetPreference({name:a,value:b}){"enableNewAltTextWhenAddingImage"===a&&(this.#ad=b)}onPageChanging({pageNumber:a}){this.#Y=a-1}deletePage(a){for(let b of this.getEditors(a))b.remove();this.#P.delete(a),this.#Y===a&&(this.#Y=0)}focusMainContainer(){this.#aD.focus()}findParent(a,b){for(let c of this.#P.values()){let{x:d,y:e,width:f,height:g}=c.div.getBoundingClientRect();if(a>=d&&a<=d+f&&b>=e&&b<=e+g)return c}return null}disableUserSelect(a=!1){this.#aE.classList.toggle("noUserSelect",a)}addShouldRescale(a){this.#aa.add(a)}removeShouldRescale(a){this.#aa.delete(a)}onScaleChanging({scale:a}){for(let b of(this.commitOrRemove(),this.viewParameters.realScale=a*$.PDF_TO_CSS_UNITS,this.#aa))b.onScaleChanging();this.#X?.onScaleChanging()}onRotationChanging({pagesRotation:a}){this.commitOrRemove(),this.viewParameters.rotation=a}#aK({anchorNode:a}){return a.nodeType===Node.TEXT_NODE?a.parentElement:a}#aL(a){let{currentLayer:b}=this;if(b.hasTextLayer(a))return b;for(let b of this.#P.values())if(b.hasTextLayer(a))return b;return null}highlightSelection(a="",b=!1){let c=document.getSelection();if(!c||c.isCollapsed)return;let{anchorNode:d,anchorOffset:e,focusNode:f,focusOffset:g}=c,h=c.toString(),i=this.#aK(c).closest(".textLayer"),j=this.getSelectionBoxes(i);if(!j)return;c.empty();let k=this.#aL(i),m=this.#at===l.NONE,n=()=>{let c=k?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:a,boxes:j,anchorNode:d,anchorOffset:e,focusNode:f,focusOffset:g,text:h});m&&this.showAllEditors("highlight",!0,!0),b&&c?.editComment()};m?this.switchToMode(l.HIGHLIGHT,n):n()}commentSelection(a=""){this.highlightSelection(a,!0)}endCurrentEditing(){this.commitOrRemove(),this.currentLayer?.endDrawingSession(!1)}#aM(){let a=document.getSelection();if(!a||a.isCollapsed)return;let b=this.#aK(a).closest(".textLayer"),c=this.getSelectionBoxes(b);c&&(this.#aj||=new aD(this),this.#aj.show(b,c,"ltr"===this.direction))}getAndRemoveDataFromAnnotationStorage(a){if(!this.#S)return null;let b=`${k}${a}`,c=this.#S.getRawValue(b);return c&&this.#S.remove(b),c}addToAnnotationStorage(a){a.isEmpty()||!this.#S||this.#S.has(a.id)||this.#S.setValue(a.id,a)}a11yAlert(a,b=null){let c=this.#aF;c&&(c.setAttribute("data-l10n-id",a),b?c.setAttribute("data-l10n-args",JSON.stringify(b)):c.removeAttribute("data-l10n-args"))}#aN(){let a=document.getSelection();if(!a||a.isCollapsed){this.#av&&(this.#aj?.hide(),this.#av=null,this.#aO({hasSelectedText:!1}));return}let{anchorNode:b}=a;if(b===this.#av)return;let c=this.#aK(a).closest(".textLayer");if(!c){this.#av&&(this.#aj?.hide(),this.#av=null,this.#aO({hasSelectedText:!1}));return}if(this.#aj?.hide(),this.#av=b,this.#aO({hasSelectedText:!0}),(this.#at===l.HIGHLIGHT||this.#at===l.NONE)&&(this.#at===l.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#ai=this.isShiftKeyDown,!this.isShiftKeyDown)){let a=this.#at===l.HIGHLIGHT?this.#aL(c):null;if(a?.toggleDrawing(),this.#am){let b=new AbortController,c=this.combinedSignal(b),d=c=>{("pointerup"!==c.type||0===c.button)&&(b.abort(),a?.toggleDrawing(!0),"pointerup"===c.type&&this.#aP("main_toolbar"))};window.addEventListener("pointerup",d,{signal:c}),window.addEventListener("blur",d,{signal:c})}else a?.toggleDrawing(!0),this.#aP("main_toolbar")}}#aP(a=""){this.#at===l.HIGHLIGHT?this.highlightSelection(a):this.#ab&&this.#aM()}#aH(){document.addEventListener("selectionchange",this.#aN.bind(this),{signal:this._signal})}#aQ(){if(this.#ag)return;this.#ag=new AbortController;let a=this.combinedSignal(this.#ag);window.addEventListener("focus",this.focus.bind(this),{signal:a}),window.addEventListener("blur",this.blur.bind(this),{signal:a})}#aR(){this.#ag?.abort(),this.#ag=null}blur(){if(this.isShiftKeyDown=!1,this.#ai&&(this.#ai=!1,this.#aP("main_toolbar")),!this.hasSelection)return;let{activeElement:a}=document;for(let b of this.#au)if(b.div.contains(a)){this.#ap=[b,a],b._focusEventsAllowed=!1;break}}focus(){if(!this.#ap)return;let[a,b]=this.#ap;this.#ap=null,b.addEventListener("focusin",()=>{a._focusEventsAllowed=!0},{once:!0,signal:this._signal}),b.focus()}#aJ(){if(this.#ao)return;this.#ao=new AbortController;let a=this.combinedSignal(this.#ao);window.addEventListener("keydown",this.keydown.bind(this),{signal:a}),window.addEventListener("keyup",this.keyup.bind(this),{signal:a})}#aS(){this.#ao?.abort(),this.#ao=null}#aT(){if(this.#W)return;this.#W=new AbortController;let a=this.combinedSignal(this.#W);document.addEventListener("copy",this.copy.bind(this),{signal:a}),document.addEventListener("cut",this.cut.bind(this),{signal:a}),document.addEventListener("paste",this.paste.bind(this),{signal:a})}#aU(){this.#W?.abort(),this.#W=null}#aI(){let a=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:a}),document.addEventListener("drop",this.drop.bind(this),{signal:a})}addEditListeners(){this.#aJ(),this.setEditingState(!0)}removeEditListeners(){this.#aS(),this.setEditingState(!1)}dragOver(a){for(let{type:b}of a.dataTransfer.items)for(let c of this.#_)if(c.isHandlingMimeForPasting(b)){a.dataTransfer.dropEffect="copy",a.preventDefault();return}}drop(a){for(let b of a.dataTransfer.items)for(let c of this.#_)if(c.isHandlingMimeForPasting(b.type)){c.paste(b,this.currentLayer),a.preventDefault();return}}copy(a){if(a.preventDefault(),this.#M?.commitOrRemove(),!this.hasSelection)return;let b=[];for(let a of this.#au){let c=a.serialize(!0);c&&b.push(c)}0!==b.length&&a.clipboardData.setData("application/pdfjs",JSON.stringify(b))}cut(a){this.copy(a),this.delete()}async paste(a){a.preventDefault();let{clipboardData:b}=a;for(let a of b.items)for(let b of this.#_)if(b.isHandlingMimeForPasting(a.type))return void b.paste(a,this.currentLayer);let c=b.getData("application/pdfjs");if(!c)return;try{c=JSON.parse(c)}catch(a){v(`paste: "${a.message}".`);return}if(!Array.isArray(c))return;this.unselectAll();let d=this.currentLayer;try{let a=[];for(let b of c){let c=await d.deserialize(b);if(!c)return;a.push(c)}let b=()=>{for(let b of a)this.#aV(b);this.#aW(a)};this.addCommands({cmd:b,undo:()=>{for(let b of a)b.remove()},mustExec:!0})}catch(a){v(`paste: "${a.message}".`)}}keydown(a){this.isShiftKeyDown||"Shift"!==a.key||(this.isShiftKeyDown=!0),this.#at===l.NONE||this.isEditorHandlingKeyboard||aM._keyboardManager.exec(this,a)}keyup(a){this.isShiftKeyDown&&"Shift"===a.key&&(this.isShiftKeyDown=!1,this.#ai&&(this.#ai=!1,this.#aP("main_toolbar")))}onEditingAction({name:a}){switch(a){case"undo":case"redo":case"delete":case"selectAll":this[a]();break;case"highlightSelection":this.highlightSelection("context_menu");break;case"commentSelection":this.commentSelection("context_menu")}}updatePageIndex(a,b){for(let c of this.getEditors(a))c.pageIndex=b;let c=this.#Q.get(a);c&&(c.pageIndex=b,this.#P.set(b,c),this.#al?c.enable():c.disable())}startUpdatePages(){this.#Q=new Map(this.#P),this.#P.clear()}endUpdatePages(){this.#Q=null}clonePage(a,b){for(let c of this.getEditors(a)){let a=c.serialize(c.mode!==l.HIGHLIGHT);a&&(a.pageIndex=b,a.id=this.getId(),a.isClone=!0,delete a.popupRef,this.#S.setValue(a.id,a))}}findClonesForPage(a){let b=[],{pageIndex:c}=a;for(let[d,e]of this.#S)e.pageIndex===c&&e.isClone&&(this.#S.remove(d),b.push(a.deserialize(e).then(b=>{b&&(b.isClone=!0,a.addOrRebuild(b))})));return Promise.all(b)}#aO(a){Object.entries(a).some(([a,b])=>this.#aA[a]!==b)&&(this._eventBus.dispatch("editingstateschanged",{source:this,details:Object.assign(this.#aA,a)}),this.#at===l.HIGHLIGHT&&!1===a.hasSelectedEditor&&this.#aX([[m.HIGHLIGHT_FREE,!0]]))}#aX(a){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:a})}setEditingState(a){a?(this.#aQ(),this.#aT(),this.#aO({isEditing:this.#at!==l.NONE,isEmpty:this.#aY(),hasSomethingToUndo:this.#U.hasSomethingToUndo(),hasSomethingToRedo:this.#U.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#aR(),this.#aU(),this.#aO({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(a){if(!this.#_)for(let b of(this.#_=a,this.#_))this.#aX(b.defaultPropertiesToUpdate)}getId(){return this.#ak.id}get currentLayer(){return this.#P.get(this.#Y)}getLayer(a){return this.#P.get(a)}get currentPageIndex(){return this.#Y}addLayer(a){this.#P.set(a.pageIndex,a),this.#al?a.enable():a.disable()}removeLayer(a){this.#P.delete(a.pageIndex)}async updateMode(a,b=null,c=!1,d=!1,e=!1,f=!1){if(this.#at!==a&&(!this.#aG||(await this.#aG.promise,this.#aG))){if(this.#aG=Promise.withResolvers(),this.#X?.commitOrRemove(),this.#at===l.POPUP&&this.#V?.hideSidebar(),this.#V?.destroyPopup(),this.#at=a,a===l.NONE){for(let a of(this.setEditingState(!1),this.#aZ(),this.#O.values()))a.hideStandaloneCommentButton();this._editorUndoBar?.hide(),this.toggleComment(null),this.#aG.resolve();return}for(let a of this.#O.values())a.addStandaloneCommentButton();for(let b of(a===l.SIGNATURE&&await this.#aw?.loadSignatures(),c&&aG.clearPointerType(),this.setEditingState(!0),await this.#a$(),this.unselectAll(),this.#P.values()))b.updateMode(a);if(a===l.POPUP){this.#N||=await this.#az.getAnnotationsByType(new Set(this.#_.map(a=>a._editorType)));let a=new Set,b=[];for(let c of this.#O.values()){let{annotationElementId:d,hasComment:e,deleted:f}=c;d&&a.add(d),e&&!f&&b.push(c.getData())}for(let c of this.#N){let{id:d,popupRef:e,contentsObj:f}=c;e&&f?.str&&!a.has(d)&&!this.#Z.has(d)&&b.push(c)}this.#V?.showSidebar(b)}if(!b){d&&this.addNewEditorFromKeyboard(),this.#aG.resolve();return}for(let a of this.#O.values())a.uid===b?(this.setSelected(a),f?a.editComment():e?a.enterInEditMode():a.focus()):a.unselect();this.#aG.resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(a){a.mode!==this.#at&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...a})}updateParams(a,b){if(this.#_){switch(a){case m.CREATE:this.currentLayer.addNewEditor(b);return;case m.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#ay||=new Map).set(a,b),this.showAllEditors("highlight",b)}if(this.hasSelection)for(let c of this.#au)c.updateParams(a,b);else for(let c of this.#_)c.updateDefaultParams(a,b)}}showAllEditors(a,b,c=!1){for(let c of this.#O.values())c.editorType===a&&c.show(b);(this.#ay?.get(m.HIGHLIGHT_SHOW_ALL)??!0)!==b&&this.#aX([[m.HIGHLIGHT_SHOW_ALL,b]])}enableWaiting(a=!1){if(this.#an!==a)for(let b of(this.#an=a,this.#P.values()))a?b.disableClick():b.enableClick(),b.div.classList.toggle("waiting",a)}async #a$(){if(!this.#al){this.#al=!0;let a=[];for(let b of this.#P.values())a.push(b.enable());for(let b of(await Promise.all(a),this.#O.values()))b.enable()}}#aZ(){if(this.unselectAll(),this.#al){for(let a of(this.#al=!1,this.#P.values()))a.disable();for(let a of this.#O.values())a.disable()}}*getEditors(a){for(let b of this.#O.values())b.pageIndex===a&&(yield b)}getEditor(a){return this.#O.get(a)}addEditor(a){this.#O.set(a.id,a)}removeEditor(a){a.div.contains(document.activeElement)&&(this.#af&&clearTimeout(this.#af),this.#af=setTimeout(()=>{this.focusMainContainer(),this.#af=null},0)),this.#O.delete(a.id),a.annotationElementId&&this.#ar?.delete(a.annotationElementId),this.unselect(a),a.annotationElementId&&this.#Z.has(a.annotationElementId)||this.#S?.remove(a.id)}addDeletedAnnotationElement(a){this.#Z.add(a.annotationElementId),this.addChangedExistingAnnotation(a),a.deleted=!0}isDeletedAnnotationElement(a){return this.#Z.has(a)}removeDeletedAnnotationElement(a){this.#Z.delete(a.annotationElementId),this.removeChangedExistingAnnotation(a),a.deleted=!1}#aV(a){let b=this.#P.get(a.pageIndex);b?b.addOrRebuild(a):(this.addEditor(a),this.addToAnnotationStorage(a))}setActiveEditor(a){this.#M!==a&&(this.#M=a,a&&this.#aX(a.propertiesToUpdate))}get #a_(){let a=null;for(a of this.#au);return a}updateUI(a){this.#a_===a&&this.#aX(a.propertiesToUpdate)}updateUIForDefaultProperties(a){this.#aX(a.defaultPropertiesToUpdate)}toggleSelected(a){if(this.#au.has(a)){this.#au.delete(a),a.unselect(),this.#aO({hasSelectedEditor:this.hasSelection});return}this.#au.add(a),a.select(),this.#aX(a.propertiesToUpdate),this.#aO({hasSelectedEditor:!0})}setSelected(a){for(let b of(this.updateToolbar({mode:a.mode,editId:a.uid}),this.#X?.commitOrRemove(),this.#au))b!==a&&b.unselect();this.#V?.destroyPopup(),this.#au.clear(),this.#au.add(a),a.select(),this.#aX(a.propertiesToUpdate),this.#aO({hasSelectedEditor:!0})}get firstSelectedEditor(){return this.#au.values().next().value}unselect(a){a.unselect(),this.#au.delete(a),this.#aO({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#au.size}get isEnterHandled(){return 1===this.#au.size&&this.firstSelectedEditor.isEnterHandled}undo(){this.#U.undo(),this.#aO({hasSomethingToUndo:this.#U.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#aY()}),this._editorUndoBar?.hide()}redo(){this.#U.redo(),this.#aO({hasSomethingToUndo:!0,hasSomethingToRedo:this.#U.hasSomethingToRedo(),isEmpty:this.#aY()})}addCommands(a){this.#U.add(a),this.#aO({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#aY()})}cleanUndoStack(a){this.#U.cleanType(a)}#aY(){if(0===this.#O.size)return!0;if(1===this.#O.size)for(let a of this.#O.values())return a.isEmpty();return!1}delete(){this.commitOrRemove();let a=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!a)return;let b=a?[a]:[...this.#au],c=()=>{for(let a of(this._editorUndoBar?.show(d,1===b.length?b[0].editorType:b.length),b))a.remove()},d=()=>{for(let a of b)this.#aV(a)};this.addCommands({cmd:c,undo:d,mustExec:!0})}commitOrRemove(){this.#M?.commitOrRemove()}hasSomethingToControl(){return this.#M||this.hasSelection}#aW(a){for(let a of this.#au)a.unselect();for(let b of(this.#au.clear(),a))b.isEmpty()||(this.#au.add(b),b.select());this.#aO({hasSelectedEditor:this.hasSelection})}selectAll(){for(let a of this.#au)a.commit();this.#aW(this.#O.values())}unselectAll(){if(!this.#M||(this.#M.commitOrRemove(),this.#at===l.NONE)){if(!this.#X?.commitOrRemove()&&(this.#V?.destroyPopup(),this.hasSelection)){for(let a of this.#au)a.unselect();this.#au.clear(),this.#aO({hasSelectedEditor:!1})}}}translateSelectedEditors(a,b,c=!1){if(c||this.commitOrRemove(),!this.hasSelection)return;this.#aB[0]+=a,this.#aB[1]+=b;let[d,e]=this.#aB,f=[...this.#au];for(let c of(this.#aC&&clearTimeout(this.#aC),this.#aC=setTimeout(()=>{this.#aC=null,this.#aB[0]=this.#aB[1]=0,this.addCommands({cmd:()=>{for(let a of f)this.#O.has(a.id)&&(a.translateInPage(d,e),a.translationDone())},undo:()=>{for(let a of f)this.#O.has(a.id)&&(a.translateInPage(-d,-e),a.translationDone())},mustExec:!1})},1e3),f))c.translateInPage(a,b),c.translationDone()}setUpDragSession(){if(this.hasSelection)for(let a of(this.disableUserSelect(!0),this.#$=new Map,this.#au))this.#$.set(a,{savedX:a.x,savedY:a.y,savedPageIndex:a.pageIndex,newX:0,newY:0,newPageIndex:-1})}endDragSession(){if(!this.#$)return!1;this.disableUserSelect(!1);let a=this.#$;this.#$=null;let b=!1;for(let[{x:c,y:d,pageIndex:e},f]of a)f.newX=c,f.newY=d,f.newPageIndex=e,b||=c!==f.savedX||d!==f.savedY||e!==f.savedPageIndex;if(!b)return!1;let c=(a,b,c,d)=>{if(this.#O.has(a.id)){let e=this.#P.get(d);e?a._setParentAndPosition(e,b,c):(a.pageIndex=d,a.x=b,a.y=c)}};return this.addCommands({cmd:()=>{for(let[b,{newX:d,newY:e,newPageIndex:f}]of a)c(b,d,e,f)},undo:()=>{for(let[b,{savedX:d,savedY:e,savedPageIndex:f}]of a)c(b,d,e,f)},mustExec:!0}),!0}dragSelectedEditors(a,b){if(this.#$)for(let c of this.#$.keys())c.drag(a,b)}rebuild(a){if(null===a.parent){let b=this.getLayer(a.pageIndex);b?(b.changeParent(a),b.addOrRebuild(a)):(this.addEditor(a),this.addToAnnotationStorage(a),a.rebuild())}else a.parent.addOrRebuild(a)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||1===this.#au.size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(a){return this.#M===a}getActive(){return this.#M}getMode(){return this.#at}isEditingMode(){return this.#at!==l.NONE}get imageManager(){return B(this,"imageManager",new aI)}getSelectionBoxes(a){let b;if(!a)return null;let c=document.getSelection();for(let b=0,d=c.rangeCount;b<d;b++)if(!a.contains(c.getRangeAt(b).commonAncestorContainer))return null;let{x:d,y:e,width:f,height:g}=a.getBoundingClientRect();switch(a.getAttribute("data-main-rotation")){case"90":b=(a,b,c,h)=>({x:(b-e)/g,y:1-(a+c-d)/f,width:h/g,height:c/f});break;case"180":b=(a,b,c,h)=>({x:1-(a+c-d)/f,y:1-(b+h-e)/g,width:c/f,height:h/g});break;case"270":b=(a,b,c,h)=>({x:1-(b+h-e)/g,y:(a-d)/f,width:h/g,height:c/f});break;default:b=(a,b,c,h)=>({x:(a-d)/f,y:(b-e)/g,width:c/f,height:h/g})}let h=[];for(let a=0,d=c.rangeCount;a<d;a++){let d=c.getRangeAt(a);if(!d.collapsed)for(let{x:a,y:c,width:e,height:f}of d.getClientRects())0!==e&&0!==f&&h.push(b(a,c,e,f))}return 0===h.length?null:h}addChangedExistingAnnotation({annotationElementId:a,id:b}){(this.#T||=new Map).set(a,b)}removeChangedExistingAnnotation({annotationElementId:a}){this.#T?.delete(a)}renderAnnotationElement(a){let b=this.#T?.get(a.data.id);if(!b)return;let c=this.#S.getRawValue(b);!c||(this.#at!==l.NONE||c.hasBeenModified)&&c.renderAnnotationElement(a)}setMissingCanvas(a,b,c){let d=this.#ar?.get(a);d&&(d.setCanvas(b,c),this.#ar.delete(a))}addMissingCanvas(a,b){(this.#ar||=new Map).set(a,b)}}class aN{#j=null;#a0=!1;#a1=null;#a2=null;#a3=null;#a4=null;#a5=!1;#a6=null;#h=null;#a7=null;#a8=null;#a9=!1;static #ba=null;static _l10n=null;constructor(a){this.#h=a,this.#a9=a._uiManager.useNewAltTextFlow,aN.#ba||=Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"})}static initialize(a){aN._l10n??=a}async render(){let a=this.#a1=document.createElement("button");a.className="altText",a.tabIndex="0";let b=this.#a2=document.createElement("span");a.append(b),this.#a9?(a.classList.add("new"),a.setAttribute("data-l10n-id",aN.#ba.missing),b.setAttribute("data-l10n-id",aN.#ba["missing-label"])):(a.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),b.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));let c=this.#h._uiManager._signal;a.addEventListener("contextmenu",ah,{signal:c}),a.addEventListener("pointerdown",a=>a.stopPropagation(),{signal:c});let d=a=>{a.preventDefault(),this.#h._uiManager.editAltText(this.#h),this.#a9&&this.#h._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:this.#bb}})};return a.addEventListener("click",d,{capture:!0,signal:c}),a.addEventListener("keydown",b=>{b.target===a&&"Enter"===b.key&&(this.#a5=!0,d(b))},{signal:c}),await this.#bc(),a}get #bb(){return this.#j&&"added"||null===this.#j&&this.guessedText&&"review"||"missing"}finish(){this.#a1&&(this.#a1.focus({focusVisible:this.#a5}),this.#a5=!1)}isEmpty(){return this.#a9?null===this.#j:!this.#j&&!this.#a0}hasData(){return this.#a9?null!==this.#j||!!this.#a7:this.isEmpty()}get guessedText(){return this.#a7}async setGuessedText(a){null===this.#j&&(this.#a7=a,this.#a8=await aN._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:a}),this.#bc())}toggleAltTextBadge(a=!1){if(!this.#a9||this.#j){this.#a6?.remove(),this.#a6=null;return}if(!this.#a6){let a=this.#a6=document.createElement("div");a.className="noAltTextBadge",this.#h.div.append(a)}this.#a6.classList.toggle("hidden",!a)}serialize(a){let b=this.#j;return a||this.#a7!==b||(b=this.#a8),{altText:b,decorative:this.#a0,guessedText:this.#a7,textWithDisclaimer:this.#a8}}get data(){return{altText:this.#j,decorative:this.#a0}}set data({altText:a,decorative:b,guessedText:c,textWithDisclaimer:d,cancel:e=!1}){c&&(this.#a7=c,this.#a8=d),(this.#j!==a||this.#a0!==b)&&(e||(this.#j=a,this.#a0=b),this.#bc())}toggle(a=!1){this.#a1&&(!a&&this.#a4&&(clearTimeout(this.#a4),this.#a4=null),this.#a1.disabled=!a)}shown(){this.#h._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:this.#bb}})}destroy(){this.#a1?.remove(),this.#a1=null,this.#a2=null,this.#a3=null,this.#a6?.remove(),this.#a6=null}async #bc(){let a=this.#a1;if(!a)return;if(this.#a9){if(a.classList.toggle("done",!!this.#j),a.setAttribute("data-l10n-id",aN.#ba[this.#bb]),this.#a2?.setAttribute("data-l10n-id",aN.#ba[`${this.#bb}-label`]),!this.#j)return void this.#a3?.remove()}else{if(!this.#j&&!this.#a0){a.classList.remove("done"),this.#a3?.remove();return}a.classList.add("done"),a.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let b=this.#a3;if(!b){this.#a3=b=document.createElement("span"),b.className="tooltip",b.setAttribute("role","tooltip"),b.id=`alt-text-tooltip-${this.#h.id}`;let c=this.#h._uiManager._signal;c.addEventListener("abort",()=>{clearTimeout(this.#a4),this.#a4=null},{once:!0}),a.addEventListener("mouseenter",()=>{this.#a4=setTimeout(()=>{this.#a4=null,this.#a3.classList.add("show"),this.#h._reportTelemetry({action:"alt_text_tooltip"})},100)},{signal:c}),a.addEventListener("mouseleave",()=>{this.#a4&&(clearTimeout(this.#a4),this.#a4=null),this.#a3?.classList.remove("show")},{signal:c})}this.#a0?b.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(b.removeAttribute("data-l10n-id"),b.textContent=this.#j),b.parentNode||a.append(b);let c=this.#h.getElementForAltText();c?.setAttribute("aria-describedby",b.id)}}class aO{#bd=null;#be=null;#bf=!1;#h=null;#bg=null;#bh=null;#bi=null;#bj=null;#bk=!1;#bl=null;constructor(a){this.#h=a}renderForToolbar(){let a=this.#be=document.createElement("button");return a.className="comment",this.#u(a,!1)}renderForStandalone(){let a=this.#bd=document.createElement("button");a.className="annotationCommentButton";let b=this.#h.commentButtonPosition;if(b){let{style:c}=a;c.insetInlineEnd=`calc(${100*("ltr"===this.#h._uiManager.direction?1-b[0]:b[0])}% - var(--comment-button-dim))`,c.top=`calc(${100*b[1]}% - var(--comment-button-dim))`;let d=this.#h.commentButtonColor;d&&(c.backgroundColor=d)}return this.#u(a,!0)}focusButton(){setTimeout(()=>{(this.#bd??this.#be)?.focus()},0)}onUpdatedColor(){if(!this.#bd)return;let a=this.#h.commentButtonColor;a&&(this.#bd.style.backgroundColor=a),this.#h._uiManager.updatePopupColor(this.#h)}get commentButtonWidth(){return(this.#bd?.getBoundingClientRect().width??0)/this.#h.parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(this.#bl)return this.#bl;if(!this.#bd)return null;let{x:a,y:b,height:c}=this.#bd.getBoundingClientRect(),{x:d,y:e,width:f,height:g}=this.#h.parent.boundingClientRect;return[(a-d)/f,(b+c-e)/g]}set commentPopupPositionInLayer(a){this.#bl=a}hasDefaultPopupPosition(){return null===this.#bl}removeStandaloneCommentButton(){this.#bd?.remove(),this.#bd=null}removeToolbarCommentButton(){this.#be?.remove(),this.#be=null}setCommentButtonStates({selected:a,hasPopup:b}){this.#bd&&(this.#bd.classList.toggle("selected",a),this.#bd.ariaExpanded=b)}#u(a,b){if(!this.#h._uiManager.hasCommentManager())return null;a.tabIndex="0",a.ariaHasPopup="dialog",b?(a.ariaControls="commentPopup",a.setAttribute("data-l10n-id","pdfjs-show-comment-button")):(a.ariaControlsElements=[this.#h._uiManager.getCommentDialogElement()],a.setAttribute("data-l10n-id","pdfjs-editor-add-comment-button"));let c=this.#h._uiManager._signal;if(!(c instanceof AbortSignal)||c.aborted)return a;a.addEventListener("contextmenu",ah,{signal:c}),b&&(a.addEventListener("focusin",a=>{this.#h._focusEventsAllowed=!1,ai(a)},{capture:!0,signal:c}),a.addEventListener("focusout",a=>{this.#h._focusEventsAllowed=!0,ai(a)},{capture:!0,signal:c})),a.addEventListener("pointerdown",a=>a.stopPropagation(),{signal:c});let d=b=>{b.preventDefault(),a===this.#be?this.edit():this.#h.toggleComment(!0)};return a.addEventListener("click",d,{capture:!0,signal:c}),a.addEventListener("keydown",b=>{b.target===a&&"Enter"===b.key&&(this.#bf=!0,d(b))},{signal:c}),a.addEventListener("pointerenter",()=>{this.#h.toggleComment(!1,!0)},{signal:c}),a.addEventListener("pointerleave",()=>{this.#h.toggleComment(!1,!1)},{signal:c}),a}edit(a){let b,c,d=this.commentPopupPositionInLayer;if(d)[b,c]=d;else{[b,c]=this.#h.commentButtonPosition;let{width:a,height:d,x:e,y:f}=this.#h;b=e+b*a,c=f+c*d}let e=this.#h.parent.boundingClientRect,{x:f,y:g,width:h,height:i}=e;this.#h._uiManager.editComment(this.#h,f+b*h,g+c*i,{...a,parentDimensions:e})}finish(){this.#be&&(this.#be.focus({focusVisible:this.#bf}),this.#bf=!1)}isDeleted(){return this.#bk||""===this.#bi}isEmpty(){return null===this.#bi}hasBeenEdited(){return this.isDeleted()||this.#bi!==this.#bg}serialize(){return this.data}get data(){return{text:this.#bi,richText:this.#bh,date:this.#bj,deleted:this.isDeleted()}}set data(a){if(a!==this.#bi&&(this.#bh=null),null===a){this.#bi="",this.#bk=!0;return}this.#bi=a,this.#bj=new Date,this.#bk=!1}restoreData({text:a,richText:b,date:c}){this.#bi=a,this.#bh=b,this.#bj=c,this.#bk=!1}setInitialText(a,b=null){this.#bg=a,this.data=a,this.#bj=null,this.#bh=b}shown(){}destroy(){this.#be?.remove(),this.#be=null,this.#bd?.remove(),this.#bd=null,this.#bi="",this.#bh=null,this.#bj=null,this.#h=null,this.#bf=!1,this.#bk=!1}}class aP{#aD;#bm=!1;#bn=null;#bo;#bp;#bq;#br;#bs=null;#bt;#bu=null;#bv;#bw=null;constructor({container:a,isPinchingDisabled:b=null,isPinchingStopped:c=null,onPinchStart:d=null,onPinching:e=null,onPinchEnd:f=null,signal:g}){this.#aD=a,this.#bn=c,this.#bo=b,this.#bp=d,this.#bq=e,this.#br=f,this.#bv=new AbortController,this.#bt=AbortSignal.any([g,this.#bv.signal]),a.addEventListener("touchstart",this.#bx.bind(this),{passive:!1,signal:this.#bt})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/ap.pixelRatio}#bx(a){if(this.#bo?.())return;if(1===a.touches.length){if(this.#bs)return;let a=this.#bs=new AbortController,b=AbortSignal.any([this.#bt,a.signal]),c=this.#aD,d={capture:!0,signal:b,passive:!1},e=a=>{"touch"===a.pointerType&&(this.#bs?.abort(),this.#bs=null)};c.addEventListener("pointerdown",a=>{"touch"===a.pointerType&&(ai(a),e(a))},d),c.addEventListener("pointerup",e,d),c.addEventListener("pointercancel",e,d);return}if(!this.#bw){this.#bw=new AbortController;let a=AbortSignal.any([this.#bt,this.#bw.signal]),b=this.#aD,c={signal:a,capture:!1,passive:!1};b.addEventListener("touchmove",this.#by.bind(this),c);let d=this.#bz.bind(this);b.addEventListener("touchend",d,c),b.addEventListener("touchcancel",d,c),c.capture=!0,b.addEventListener("pointerdown",ai,c),b.addEventListener("pointermove",ai,c),b.addEventListener("pointercancel",ai,c),b.addEventListener("pointerup",ai,c),this.#bp?.()}if(ai(a),2!==a.touches.length||this.#bn?.()){this.#bu=null;return}let[b,c]=a.touches;b.identifier>c.identifier&&([b,c]=[c,b]),this.#bu={touch0X:b.screenX,touch0Y:b.screenY,touch1X:c.screenX,touch1Y:c.screenY}}#by(a){if(!this.#bu||2!==a.touches.length)return;ai(a);let[b,c]=a.touches;b.identifier>c.identifier&&([b,c]=[c,b]);let{screenX:d,screenY:e}=b,{screenX:f,screenY:g}=c,h=this.#bu,{touch0X:i,touch0Y:j,touch1X:k,touch1Y:l}=h,m=Math.hypot(f-d,g-e)||1,n=Math.hypot(k-i,l-j)||1;if(!this.#bm&&Math.abs(n-m)<=aP.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(h.touch0X=d,h.touch0Y=e,h.touch1X=f,h.touch1Y=g,!this.#bm){this.#bm=!0;return}let o=[(d+f)/2,(e+g)/2];this.#bq?.(o,n,m)}#bz(a){a.touches.length>=2||(this.#bw&&(this.#bw.abort(),this.#bw=null,this.#br?.()),this.#bu&&(ai(a),this.#bu=null,this.#bm=!1))}destroy(){this.#bv?.abort(),this.#bv=null,this.#bs?.abort(),this.#bs=null}}class aQ{#bA=null;#bB=null;#j=null;#k=null;#bd=null;#bC=!1;#bD=null;#bE="";#bF=null;#bG=null;#bH=null;#bI=null;#bJ=null;#bK="";#bL=!1;#bM=null;#bN=!1;#bO=!1;#bP=!1;#bQ=null;#bR=0;#bS=0;#bT=null;#bU=null;isSelected=!1;_isCopy=!1;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nAlert=null;static _l10nResizer=null;#bV=!1;#bW=aQ._zIndex++;static _borderLineWidth=-1;static _colorManager=new aL;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){let a=aQ.prototype._resizeWithKeyboard,b=aM.TRANSLATE_SMALL,c=aM.TRANSLATE_BIG;return B(this,"_resizerKeyboardManager",new aK([[["ArrowLeft"],a,{args:[-b,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],a,{args:[-c,0]}],[["ArrowRight"],a,{args:[b,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],a,{args:[c,0]}],[["ArrowUp"],a,{args:[0,-b]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],a,{args:[0,-c]}],[["ArrowDown"],a,{args:[0,b]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],a,{args:[0,c]}],[["Escape"],aQ.prototype._stopResizingWithKeyboard]]))}constructor(a){this.parent=a.parent,this.id=a.id,this.width=this.height=null,this.pageIndex=a.parent.pageIndex,this.name=a.name,this.div=null,this._uiManager=a.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=a.isCentered,this._structTreeParentId=null,this.annotationElementId=a.annotationElementId||null,this.creationDate=a.creationDate||new Date,this.modificationDate=a.modificationDate||null,this.canAddComment=!0;const{rotation:b,rawDims:{pageWidth:c,pageHeight:d,pageX:e,pageY:f}}=this.parent.viewport;this.rotation=b,this.pageRotation=(360+b-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[c,d],this.pageTranslation=[e,f];const[g,h]=this.parentDimensions;this.x=a.x/g,this.y=a.y/h,this.isAttachedToDOM=!1,this.deleted=!1}updatePageIndex(a){this.pageIndex=a}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return B(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(a){let b=new aR({id:a._uiManager.getId(),parent:a.parent,uiManager:a._uiManager});b.annotationElementId=a.annotationElementId,b.deleted=!0,b._uiManager.addToAnnotationStorage(b)}static initialize(a,b){if(aQ._l10n??=a,aQ._l10nAlert??=Object.freeze({highlight:"pdfjs-editor-highlight-added-alert",freetext:"pdfjs-editor-freetext-added-alert",ink:"pdfjs-editor-ink-added-alert",stamp:"pdfjs-editor-stamp-added-alert",signature:"pdfjs-editor-signature-added-alert"}),aQ._l10nResizer??=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"}),-1!==aQ._borderLineWidth)return;let c=getComputedStyle(document.documentElement);aQ._borderLineWidth=parseFloat(c.getPropertyValue("--outline-width"))||0}static updateDefaultParams(a,b){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(a){return!1}static paste(a,b){w("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#bV}set _isDraggable(a){this.#bV=a,this.div?.classList.toggle("draggable",a)}get uid(){return this.annotationElementId||this.id}get isEnterHandled(){return!0}center(){let[a,b]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*b/(2*a),this.y+=this.width*a/(2*b);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*b/(2*a),this.y-=this.width*a/(2*b);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(a){this._uiManager.addCommands(a)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#bW}setParent(a){null!==a?(this.pageIndex=a.pageIndex,this.pageDimensions=a.pageDimensions):(this.#bX(),this.#bI?.remove(),this.#bI=null),this.parent=a}focusin(a){this._focusEventsAllowed&&(this.#bL?this.#bL=!1:this.parent.setSelected(this))}focusout(a){if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;let b=a.relatedTarget;!b?.closest(`#${this.id}`)&&(a.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(a,b,c,d){let[e,f]=this.parentDimensions;[c,d]=this.screenToPageTranslation(c,d),this.x=(a+c)/e,this.y=(b+d)/f,this.fixAndSetPosition()}_moveAfterPaste(a,b){if(this.isClone)return void delete this.isClone;let[c,d]=this.parentDimensions;this.setAt(a*c,b*d,this.width*c,this.height*d),this._onTranslated()}#bY([a,b],c,d){[c,d]=this.screenToPageTranslation(c,d),this.x+=c/a,this.y+=d/b,this._onTranslating(this.x,this.y),this.fixAndSetPosition()}translate(a,b){this.#bY(this.parentDimensions,a,b)}translateInPage(a,b){this.#bM||=[this.x,this.y,this.width,this.height],this.#bY(this.pageDimensions,a,b),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(a,b){this.#bM||=[this.x,this.y,this.width,this.height];let{div:c,parentDimensions:[d,e]}=this;if(this.x+=a/d,this.y+=b/e,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){let{x:a,y:b}=this.div.getBoundingClientRect();this.parent.findNewParent(this,a,b)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:f,y:g}=this,[h,i]=this.getBaseTranslation();f+=h,g+=i;let{style:j}=c;j.left=`${(100*f).toFixed(2)}%`,j.top=`${(100*g).toFixed(2)}%`,this._onTranslating(f,g),c.scrollIntoView({block:"nearest"})}_onTranslating(a,b){}_onTranslated(a,b){}get _hasBeenMoved(){return!!this.#bM&&(this.#bM[0]!==this.x||this.#bM[1]!==this.y)}get _hasBeenResized(){return!!this.#bM&&(this.#bM[2]!==this.width||this.#bM[3]!==this.height)}getBaseTranslation(){let[a,b]=this.parentDimensions,{_borderLineWidth:c}=aQ,d=c/a,e=c/b;switch(this.rotation){case 90:return[-d,e];case 180:return[d,e];case 270:return[d,-e];default:return[-d,-e]}}get _mustFixPosition(){return!0}fixAndSetPosition(a=this.rotation){let{div:{style:b},pageDimensions:[c,d]}=this,{x:e,y:f,width:g,height:h}=this;if(g*=c,h*=d,e*=c,f*=d,this._mustFixPosition)switch(a){case 0:e=U(e,0,c-g),f=U(f,0,d-h);break;case 90:e=U(e,0,c-h),f=U(f,g,d);break;case 180:e=U(e,g,c),f=U(f,h,d);break;case 270:e=U(e,h,c),f=U(f,0,d-g)}this.x=e/=c,this.y=f/=d;let[i,j]=this.getBaseTranslation();e+=i,f+=j,b.left=`${(100*e).toFixed(2)}%`,b.top=`${(100*f).toFixed(2)}%`,this.moveInDOM()}static #bZ(a,b,c){switch(c){case 90:return[b,-a];case 180:return[-a,-b];case 270:return[-b,a];default:return[a,b]}}screenToPageTranslation(a,b){return aQ.#bZ(a,b,this.parentRotation)}pageTranslationToScreen(a,b){return aQ.#bZ(a,b,360-this.parentRotation)}#b$(a){switch(a){case 90:{let[a,b]=this.pageDimensions;return[0,-a/b,b/a,0]}case 180:return[-1,0,0,-1];case 270:{let[a,b]=this.pageDimensions;return[0,a/b,-b/a,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){let{parentScale:a,pageDimensions:[b,c]}=this;return[b*a,c*a]}setDims(){let{div:{style:a},width:b,height:c}=this;a.width=`${(100*b).toFixed(2)}%`,a.height=`${(100*c).toFixed(2)}%`}getInitialTranslation(){return[0,0]}#b_(){if(this.#bF)return;this.#bF=document.createElement("div"),this.#bF.classList.add("resizers");let a=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],b=this._uiManager._signal;for(let c of a){let a=document.createElement("div");this.#bF.append(a),a.classList.add("resizer",c),a.setAttribute("data-resizer-name",c),a.addEventListener("pointerdown",this.#b0.bind(this,c),{signal:b}),a.addEventListener("contextmenu",ah,{signal:b}),a.tabIndex=-1}this.div.prepend(this.#bF)}#b0(a,b){b.preventDefault();let{isMac:c}=K.platform;if(0!==b.button||b.ctrlKey&&c)return;this.#j?.toggle(!1);let d=this._isDraggable;this._isDraggable=!1,this.#bG=[b.screenX,b.screenY];let e=new AbortController,f=this._uiManager.combinedSignal(e);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",this.#b1.bind(this,a),{passive:!0,capture:!0,signal:f}),window.addEventListener("touchmove",ai,{passive:!1,signal:f}),window.addEventListener("contextmenu",ah,{signal:f}),this.#bH={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};let g=this.parent.div.style.cursor,h=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(b.target).cursor;let i=()=>{e.abort(),this.parent.togglePointerEvents(!0),this.#j?.toggle(!0),this._isDraggable=d,this.parent.div.style.cursor=g,this.div.style.cursor=h,this.#b2()};window.addEventListener("pointerup",i,{signal:f}),window.addEventListener("blur",i,{signal:f})}#b3(a,b,c,d){this.width=c,this.height=d,this.x=a,this.y=b,this.setDims(),this.fixAndSetPosition(),this._onResized()}_onResized(){}#b2(){if(!this.#bH)return;let{savedX:a,savedY:b,savedWidth:c,savedHeight:d}=this.#bH;this.#bH=null;let e=this.x,f=this.y,g=this.width,h=this.height;(e!==a||f!==b||g!==c||h!==d)&&this.addCommands({cmd:this.#b3.bind(this,e,f,g,h),undo:this.#b3.bind(this,a,b,c,d),mustExec:!0})}static _round(a){return Math.round(1e4*a)/1e4}#b1(a,b){let c,d,e,f,g,h,[i,j]=this.parentDimensions,k=this.x,l=this.y,m=this.width,n=this.height,o=aQ.MIN_SIZE/i,p=aQ.MIN_SIZE/j,q=this.#b$(this.rotation),r=(a,b)=>[q[0]*a+q[2]*b,q[1]*a+q[3]*b],s=this.#b$(360-this.rotation),t=!1,u=!1;switch(a){case"topLeft":t=!0,c=(a,b)=>[0,0],d=(a,b)=>[a,b];break;case"topMiddle":c=(a,b)=>[a/2,0],d=(a,b)=>[a/2,b];break;case"topRight":t=!0,c=(a,b)=>[a,0],d=(a,b)=>[0,b];break;case"middleRight":u=!0,c=(a,b)=>[a,b/2],d=(a,b)=>[0,b/2];break;case"bottomRight":t=!0,c=(a,b)=>[a,b],d=(a,b)=>[0,0];break;case"bottomMiddle":c=(a,b)=>[a/2,b],d=(a,b)=>[a/2,0];break;case"bottomLeft":t=!0,c=(a,b)=>[0,b],d=(a,b)=>[a,0];break;case"middleLeft":u=!0,c=(a,b)=>[0,b/2],d=(a,b)=>[a,b/2]}let v=c(m,n),w=d(m,n),x=r(...w),y=aQ._round(k+x[0]),z=aQ._round(l+x[1]),A=1,B=1;if(b.fromKeyboard)({deltaX:e,deltaY:f}=b);else{let{screenX:a,screenY:c}=b,[d,g]=this.#bG;[e,f]=this.screenToPageTranslation(a-d,c-g),this.#bG[0]=a,this.#bG[1]=c}if([e,f]=(g=e/i,h=f/j,[s[0]*g+s[2]*h,s[1]*g+s[3]*h]),t){let a=Math.hypot(m,n);A=B=Math.max(Math.min(Math.hypot(w[0]-v[0]-e,w[1]-v[1]-f)/a,1/m,1/n),o/m,p/n)}else u?A=U(Math.abs(w[0]-v[0]-e),o,1)/m:B=U(Math.abs(w[1]-v[1]-f),p,1)/n;let C=aQ._round(m*A),D=aQ._round(n*B),E=y-(x=r(...d(C,D)))[0],F=z-x[1];this.#bM||=[this.x,this.y,this.width,this.height],this.width=C,this.height=D,this.x=E,this.y=F,this.setDims(),this.fixAndSetPosition(),this._onResizing()}_onResizing(){}altTextFinish(){this.#j?.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||this.#bO)return this._editToolbar;this._editToolbar=new aC(this),this.div.append(this._editToolbar.render());let{toolbarButtons:a}=this;if(a)for(let[b,c]of a)await this._editToolbar.addButton(b,c);return this.hasComment||this._editToolbar.addButton("comment",this.addCommentButton()),this._editToolbar.addButton("delete"),this._editToolbar}addCommentButtonInToolbar(){this._editToolbar?.addButtonBefore("comment",this.addCommentButton(),".deleteButton")}removeCommentButtonFromToolbar(){this._editToolbar?.removeButton("comment")}removeEditToolbar(){this._editToolbar?.remove(),this._editToolbar=null,this.#j?.destroy()}addContainer(a){let b=this._editToolbar?.div;b?b.before(a):this.div.append(a)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return!this.#j&&(aN.initialize(aQ._l10n),this.#j=new aN(this),this.#bA&&(this.#j.data=this.#bA,this.#bA=null)),this.#j}get altTextData(){return this.#j?.data}set altTextData(a){this.#j&&(this.#j.data=a)}get guessedAltText(){return this.#j?.guessedText}async setGuessedAltText(a){await this.#j?.setGuessedText(a)}serializeAltText(a){return this.#j?.serialize(a)}hasAltText(){return!!this.#j&&!this.#j.isEmpty()}hasAltTextData(){return this.#j?.hasData()??!1}focusCommentButton(){this.#k?.focusButton()}addCommentButton(){return this.canAddComment?this.#k||=new aO(this):null}addStandaloneCommentButton(){if(this._uiManager.hasCommentManager()){if(this.#bd){this._uiManager.isEditingMode()&&this.#bd.classList.remove("hidden");return}this.hasComment&&(this.#bd=this.#k.renderForStandalone(),this.div.append(this.#bd))}}removeStandaloneCommentButton(){this.#k.removeStandaloneCommentButton(),this.#bd=null}hideStandaloneCommentButton(){this.#bd?.classList.add("hidden")}get comment(){if(!this.#k)return null;let{data:{richText:a,text:b,date:c,deleted:d}}=this.#k;return{text:b,richText:a,date:c,deleted:d,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(a){this.#k||=new aO(this),"object"==typeof a&&null!==a?this.#k.restoreData(a):this.#k.data=a,this.hasComment?(this.removeCommentButtonFromToolbar(),this.addStandaloneCommentButton(),this._uiManager.updateComment(this)):(this.addCommentButtonInToolbar(),this.removeStandaloneCommentButton(),this._uiManager.removeComment(this))}setCommentData({comment:a,popupRef:b,richText:c}){if(!b||(this.#k||=new aO(this),this.#k.setInitialText(a,c),!this.annotationElementId))return;let d=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);d&&this.updateFromAnnotationLayer(d)}get hasEditedComment(){return this.#k?.hasBeenEdited()}get hasDeletedComment(){return this.#k?.isDeleted()}get hasComment(){return!!this.#k&&!this.#k.isEmpty()&&!this.#k.isDeleted()}async editComment(a){this.#k||=new aO(this),this.#k.edit(a)}toggleComment(a,b){this.hasComment&&this._uiManager.toggleComment(this,a,b)}setSelectedCommentButton(a){this.#k.setSelectedButton(a)}addComment(a){if(this.hasEditedComment){let[,,,b]=a.rect,[c]=this.pageDimensions,[d]=this.pageTranslation,e=d+c+1;a.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[e,b-100,e+180,b]}}}updateFromAnnotationLayer({popup:{contents:a,deleted:b}}){this.#k.data=b?null:a}get parentBoundingClientRect(){return this.parent.boundingClientRect}render(){let a=this.div=document.createElement("div");a.setAttribute("data-editor-rotation",(360-this.rotation)%360),a.className=this.name,a.setAttribute("id",this.id),a.tabIndex=this.#bC?-1:0,a.setAttribute("role","application"),this.defaultL10nId&&a.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||a.classList.add("hidden"),this.setInForeground(),this.#b4();let[b,c]=this.parentDimensions;this.parentRotation%180!=0&&(a.style.maxWidth=`${(100*c/b).toFixed(2)}%`,a.style.maxHeight=`${(100*b/c).toFixed(2)}%`);let[d,e]=this.getInitialTranslation();return this.translate(d,e),aF(this,a,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(this.#bU||=new aP({container:a,isPinchingDisabled:()=>!this.isSelected,onPinchStart:this.#b5.bind(this),onPinching:this.#b6.bind(this),onPinchEnd:this.#b7.bind(this),signal:this._uiManager._signal})),this.addStandaloneCommentButton(),this._uiManager._editorUndoBar?.hide(),a}#b5(){this.#bH={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height},this.#j?.toggle(!1),this.parent.togglePointerEvents(!1)}#b6(a,b,c){let d=c/b*.7+1-.7;if(1===d)return;let e=this.#b$(this.rotation),f=(a,b)=>[e[0]*a+e[2]*b,e[1]*a+e[3]*b],[g,h]=this.parentDimensions,i=this.x,j=this.y,k=this.width,l=this.height;d=Math.max(Math.min(d,1/k,1/l),aQ.MIN_SIZE/g/k,aQ.MIN_SIZE/h/l);let m=aQ._round(k*d),n=aQ._round(l*d);if(m===k&&n===l)return;this.#bM||=[i,j,k,l];let o=f(k/2,l/2),p=aQ._round(i+o[0]),q=aQ._round(j+o[1]),r=f(m/2,n/2);this.x=p-r[0],this.y=q-r[1],this.width=m,this.height=n,this.setDims(),this.fixAndSetPosition(),this._onResizing()}#b7(){this.#j?.toggle(!0),this.parent.togglePointerEvents(!0),this.#b2()}pointerdown(a){let{isMac:b}=K.platform;0!==a.button||a.ctrlKey&&b?a.preventDefault():(this.#bL=!0,this._isDraggable)?this.#b8(a):this.#b9(a)}#b9(a){let{isMac:b}=K.platform;a.ctrlKey&&!b||a.shiftKey||a.metaKey&&b?this.parent.toggleSelected(this):this.parent.setSelected(this)}#b8(a){let{isSelected:b}=this;this._uiManager.setUpDragSession();let c=!1,d=new AbortController,e=this._uiManager.combinedSignal(d),f={capture:!0,passive:!1,signal:e},g=a=>{d.abort(),this.#bD=null,this.#bL=!1,this._uiManager.endDragSession()||this.#b9(a),c&&this._onStopDragging()};b&&(this.#bR=a.clientX,this.#bS=a.clientY,this.#bD=a.pointerId,this.#bE=a.pointerType,window.addEventListener("pointermove",a=>{c||(c=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());let{clientX:b,clientY:d,pointerId:e}=a;if(e!==this.#bD)return void ai(a);let[f,g]=this.screenToPageTranslation(b-this.#bR,d-this.#bS);this.#bR=b,this.#bS=d,this._uiManager.dragSelectedEditors(f,g)},f),window.addEventListener("touchmove",ai,f),window.addEventListener("pointerdown",a=>{a.pointerType===this.#bE&&(this.#bU||a.isPrimary)&&g(a),ai(a)},f));let h=a=>{this.#bD&&this.#bD!==a.pointerId?ai(a):g(a)};window.addEventListener("pointerup",h,{signal:e}),window.addEventListener("blur",h,{signal:e})}_onStartDragging(){}_onStopDragging(){}moveInDOM(){this.#bQ&&clearTimeout(this.#bQ),this.#bQ=setTimeout(()=>{this.#bQ=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(a,b,c){a.changeParent(this),this.x=b,this.y=c,this.fixAndSetPosition(),this._onTranslated()}getRect(a,b,c=this.rotation){let d=this.parentScale,[e,f]=this.pageDimensions,[g,h]=this.pageTranslation,i=a/d,j=b/d,k=this.x*e,l=this.y*f,m=this.width*e,n=this.height*f;switch(c){case 0:return[k+i+g,f-l-j-n+h,k+i+m+g,f-l-j+h];case 90:return[k+j+g,f-l+i+h,k+j+n+g,f-l+i+m+h];case 180:return[k-i-m+g,f-l+j+h,k-i+g,f-l+j+n+h];case 270:return[k-j-n+g,f-l-i-m+h,k-j+g,f-l-i+h];default:throw Error("Invalid rotation")}}getRectInCurrentCoords(a,b){let[c,d,e,f]=a,g=e-c,h=f-d;switch(this.rotation){case 0:return[c,b-f,g,h];case 90:return[c,b-d,h,g];case 180:return[e,b-d,g,h];case 270:return[e,b-f,h,g];default:throw Error("Invalid rotation")}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&aQ._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){this.#k?.onUpdatedColor()}getData(){let{comment:{text:a,color:b,date:c,opacity:d,deleted:e,richText:f},uid:g,pageIndex:h,creationDate:i,modificationDate:j}=this;return{id:g,pageIndex:h,rect:this.getPDFRect(),richText:f,contentsObj:{str:a},creationDate:i,modificationDate:c||j,popupRef:!e,color:b,opacity:d}}onceAdded(a){}isEmpty(){return!1}enableEditMode(){return!this.isInEditMode()&&(this.parent.setEditingState(!1),this.#bO=!0,!0)}disableEditMode(){return!!this.isInEditMode()&&(this.parent.setEditingState(!0),this.#bO=!1,!0)}isInEditMode(){return this.#bO}shouldGetKeyboardEvents(){return this.#bP}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){let{top:a,left:b,bottom:c,right:d}=this.getClientDimensions(),{innerHeight:e,innerWidth:f}=window;return b<f&&d>0&&a<e&&c>0}#b4(){if(this.#bJ||!this.div)return;this.#bJ=new AbortController;let a=this._uiManager.combinedSignal(this.#bJ);this.div.addEventListener("focusin",this.focusin.bind(this),{signal:a}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:a})}rebuild(){this.#b4()}rotate(a){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(a=!1,b=null){return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:this._initialData?.popupRef||""}}static async deserialize(a,b,c){let d=new this.prototype.constructor({parent:b,id:c.getId(),uiManager:c,annotationElementId:a.annotationElementId,creationDate:a.creationDate,modificationDate:a.modificationDate});d.rotation=a.rotation,d.#bA=a.accessibilityData,d._isCopy=a.isCopy||!1;let[e,f]=d.pageDimensions,[g,h,i,j]=d.getRectInCurrentCoords(a.rect,f);return d.x=g/e,d.y=h/f,d.width=i/e,d.height=j/f,d}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||null!==this.serialize())}remove(){if(this.#bJ?.abort(),this.#bJ=null,this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.hideCommentPopup(),this.#bQ&&(clearTimeout(this.#bQ),this.#bQ=null),this.#bX(),this.removeEditToolbar(),this.#bT){for(let a of this.#bT.values())clearTimeout(a);this.#bT=null}this.parent=null,this.#bU?.destroy(),this.#bU=null,this.#bI?.remove(),this.#bI=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#b_(),this.#bF.classList.remove("hidden"))}get toolbarPosition(){return null}get commentButtonPosition(){return"ltr"===this._uiManager.direction?[1,0]:[0,0]}get commentButtonPositionInPage(){let{commentButtonPosition:[a,b]}=this,[c,d,e,f]=this.getPDFRect();return[aQ._round(c+(e-c)*a),aQ._round(d+(f-d)*(1-b))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return this.#k.commentPopupPositionInLayer}set commentPopupPosition(a){this.#k.commentPopupPositionInLayer=a}hasDefaultPopupPosition(){return this.#k.hasDefaultPopupPosition()}get commentButtonWidth(){return this.#k.commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(a){this.#k?.setCommentButtonStates(a)}keydown(a){if(!this.isResizable||a.target!==this.div||"Enter"!==a.key)return;this._uiManager.setSelected(this),this.#bH={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};let b=this.#bF.children;if(!this.#bB){this.#bB=Array.from(b);let a=this.#ca.bind(this),c=this.#cb.bind(this),d=this._uiManager._signal;for(let b of this.#bB){let e=b.getAttribute("data-resizer-name");b.setAttribute("role","spinbutton"),b.addEventListener("keydown",a,{signal:d}),b.addEventListener("blur",c,{signal:d}),b.addEventListener("focus",this.#cc.bind(this,e),{signal:d}),b.setAttribute("data-l10n-id",aQ._l10nResizer[e])}}let c=this.#bB[0],d=0;for(let a of b){if(a===c)break;d++}let e=(360-this.rotation+this.parentRotation)%360/90*(this.#bB.length/4);if(e!==d){if(e<d)for(let a=0;a<d-e;a++)this.#bF.append(this.#bF.firstElementChild);else if(e>d)for(let a=0;a<e-d;a++)this.#bF.firstElementChild.before(this.#bF.lastElementChild);let a=0;for(let c of b){let b=this.#bB[a++].getAttribute("data-resizer-name");c.setAttribute("data-l10n-id",aQ._l10nResizer[b])}}this.#cd(0),this.#bP=!0,this.#bF.firstElementChild.focus({focusVisible:!0}),a.preventDefault(),a.stopImmediatePropagation()}#ca(a){aQ._resizerKeyboardManager.exec(this,a)}#cb(a){this.#bP&&a.relatedTarget?.parentNode!==this.#bF&&this.#bX()}#cc(a){this.#bK=this.#bP?a:""}#cd(a){if(this.#bB)for(let b of this.#bB)b.tabIndex=a}_resizeWithKeyboard(a,b){this.#bP&&this.#b1(this.#bK,{deltaX:a,deltaY:b,fromKeyboard:!0})}#bX(){this.#bP=!1,this.#cd(-1),this.#b2()}_stopResizingWithKeyboard(){this.#bX(),this.div.focus()}select(){this.isSelected&&this._editToolbar?this._editToolbar.show():(this.isSelected=!0,this.makeResizable(),this.div?.classList.add("selectedEditor"),this._editToolbar)?(this._editToolbar?.show(),this.#j?.toggleAltTextBadge(!1)):this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this._editToolbar?.show()})}focus(){this.div&&!this.div.contains(document.activeElement)&&setTimeout(()=>this.div?.focus({preventScroll:!0}),0)}unselect(){this.isSelected&&(this.isSelected=!1,this.#bF?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#j?.toggleAltTextBadge(!0),this.hideCommentPopup())}hideCommentPopup(){this.hasComment&&this._uiManager.toggleComment(null)}updateParams(a,b){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(a){"BUTTON"!==a.target.nodeName&&(this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.uid}))}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return this.#bN}set isEditing(a){this.#bN=a,this.parent&&(a?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(a,b=!1){if(b){this.#bT||=new Map;let{action:b}=a,c=this.#bT.get(b);c&&clearTimeout(c),c=setTimeout(()=>{this._reportTelemetry(a),this.#bT.delete(b),0===this.#bT.size&&(this.#bT=null)},aQ._telemetryTimeout),this.#bT.set(b,c);return}a.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:a}})}show(a=this._isVisible){this.div.classList.toggle("hidden",!a),this._isVisible=a}enable(){this.div&&(this.div.tabIndex=0),this.#bC=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#bC=!0}updateFakeAnnotationElement(a){if(!this.#bI&&!this.deleted){this.#bI=a.addFakeAnnotation(this);return}if(this.deleted){this.#bI.remove(),this.#bI=null;return}(this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&this.#bI.updateEdited({rect:this.getPDFRect(),popup:this.comment})}renderAnnotationElement(a){if(this.deleted)return a.hide(),null;let b=a.container.querySelector(".annotationContent");if(b){if("CANVAS"===b.nodeName){let a=b;(b=document.createElement("div")).classList.add("annotationContent",this.editorType),a.before(b)}}else(b=document.createElement("div")).classList.add("annotationContent",this.editorType),a.container.prepend(b);return b}resetAnnotationElement(a){let{firstElementChild:b}=a.container;b?.nodeName==="DIV"&&b.classList.contains("annotationContent")&&b.remove()}}class aR extends aQ{constructor(a){super(a),this.annotationElementId=a.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}class aS{constructor(a){this.h1=a?0|a:0xc3d2e1f0,this.h2=a?0|a:0xc3d2e1f0}update(a){let b,c;if("string"==typeof a){b=new Uint8Array(2*a.length),c=0;for(let d=0,e=a.length;d<e;d++){let e=a.charCodeAt(d);e<=255?b[c++]=e:(b[c++]=e>>>8,b[c++]=255&e)}}else if(ArrayBuffer.isView(a))c=(b=a.slice()).byteLength;else throw Error("Invalid data format, must be a string or TypedArray.");let d=c>>2,e=c-4*d,f=new Uint32Array(b.buffer,0,d),g=0,h=0,i=this.h1,j=this.h2;for(let a=0;a<d;a++)1&a?(i^=g=0x1b873593*(g=(g=0xcc9e2d51*(g=f[a])&0xffff0000|11601*g&65535)<<15|g>>>17)&0xffff0000|13715*g&65535,i=5*(i=i<<13|i>>>19)+0xe6546b64):(j^=h=0x1b873593*(h=(h=0xcc9e2d51*(h=f[a])&0xffff0000|11601*h&65535)<<15|h>>>17)&0xffff0000|13715*h&65535,j=5*(j=j<<13|j>>>19)+0xe6546b64);switch(g=0,e){case 3:g^=b[4*d+2]<<16;case 2:g^=b[4*d+1]<<8;case 1:g^=b[4*d],g=0x1b873593*(g=(g=0xcc9e2d51*g&0xffff0000|11601*g&65535)<<15|g>>>17)&0xffff0000|13715*g&65535,1&d?i^=g:j^=g}this.h1=i,this.h2=j}hexdigest(){let a=this.h1,b=this.h2;return a^=b>>>1,b=0xff51afd7*b&0xffff0000|((b<<16|(a=0xed558ccd*a&0xffff0000|36045*a&65535)>>>16)*0xafd7ed55&0xffff0000)>>>16,a^=b>>>1,b=0xc4ceb9fe*b&0xffff0000|((b<<16|(a=0x1a85ec53*a&0xffff0000|60499*a&65535)>>>16)*0xb9fe1a85&0xffff0000)>>>16,((a^=b>>>1)>>>0).toString(16).padStart(8,"0")+(b>>>0).toString(16).padStart(8,"0")}}let aT=Object.freeze({map:null,hash:"",transfer:void 0});class aU{#ce=!1;#cf=null;#cg=null;#ch=new Map;onSetModified=null;onResetModified=null;onAnnotationEditor=null;getValue(a,b){let c=this.#ch.get(a);return void 0===c?b:Object.assign(b,c)}getRawValue(a){return this.#ch.get(a)}remove(a){let b=this.#ch.get(a);void 0===b||(b instanceof aQ&&this.#cg.delete(b.annotationElementId),this.#ch.delete(a),0===this.#ch.size&&this.resetModified(),this.#ch.values().some(a=>a instanceof aQ)||this.onAnnotationEditor?.(null))}setValue(a,b){let c=this.#ch.get(a),d=!1;if(void 0!==c)for(let[a,e]of Object.entries(b))c[a]!==e&&(d=!0,c[a]=e);else d=!0,this.#ch.set(a,b);d&&this.#ci(),b instanceof aQ&&((this.#cg||=new Map).set(b.annotationElementId,b),this.onAnnotationEditor?.(b.constructor._type))}has(a){return this.#ch.has(a)}get size(){return this.#ch.size}#ci(){this.#ce||(this.#ce=!0,this.onSetModified?.())}resetModified(){this.#ce&&(this.#ce=!1,this.onResetModified?.())}get print(){return new aV(this)}get serializable(){if(0===this.#ch.size)return aT;let a=new Map,b=new aS,c=[],d=Object.create(null),e=!1;for(let[c,f]of this.#ch){let g=f instanceof aQ?f.serialize(!1,d):f;f.page&&(f.pageIndex=f.page._pageIndex,delete f.page),g&&(a.set(c,g),b.update(`${c}:${JSON.stringify(g)}`),e||=!!g.bitmap)}if(e)for(let b of a.values())b.bitmap&&c.push(b.bitmap);return a.size>0?{map:a,hash:b.hexdigest(),transfer:c}:aT}get editorStats(){let a=null,b=new Map,c=0,d=0;for(let e of this.#ch.values()){if(!(e instanceof aQ)){e.popup&&(e.popup.deleted?d+=1:c+=1);continue}e.isCommentDeleted?d+=1:e.hasEditedComment&&(c+=1);let f=e.telemetryFinalData;if(!f)continue;let{type:g}=f;b.getOrInsertComputed(g,()=>Object.getPrototypeOf(e).constructor),a||=Object.create(null);let h=a[g]||=new Map;for(let[a,b]of Object.entries(f)){if("type"===a)continue;let c=h.getOrInsertComputed(a,R);c.set(b,(c.get(b)??0)+1)}}if((d>0||c>0)&&((a||=Object.create(null)).comments={deleted:d,edited:c}),!a)return null;for(let[c,d]of b)a[c]=d.computeTelemetryFinalData(a[c]);return a}resetModifiedIds(){this.#cf=null}updateEditor(a,b){let c=this.#cg?.get(a);return!!c&&(c.updateFromAnnotationLayer(b),!0)}getEditor(a){return this.#cg?.get(a)||null}get modifiedIds(){if(this.#cf)return this.#cf;let a=[];if(this.#cg)for(let b of this.#cg.values())b.serialize()&&a.push(b.annotationElementId);let b="";if(a.length){let c=new aS;c.update(a.join(",")),b=c.hexdigest()}return this.#cf={ids:new Set(a),hash:b}}[Symbol.iterator](){return this.#ch.entries()}}class aV extends aU{#cj=aT;constructor(a){super();const{serializable:b}=a;if(b===aT)return;const{map:c,hash:d,transfer:e}=b,f=structuredClone(c,e?{transfer:e}:null);this.#cj={map:f,hash:d,transfer:[]}}get print(){w("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#cj}get modifiedIds(){return B(this,"modifiedIds",{ids:new Set,hash:""})}}let aW="__forcedDependency",{floor:aX,ceil:aY}=Math;function aZ(a,b,c,d,e,f){a[4*b+0]=Math.min(a[4*b+0],c),a[4*b+1]=Math.min(a[4*b+1],d),a[4*b+2]=Math.max(a[4*b+2],e),a[4*b+3]=Math.max(a[4*b+3],f)}let a$=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0];class a_{#ck;#cl;constructor(a,b){this.#ck=a,this.#cl=b}get length(){return this.#ck.length}isEmpty(a){return this.#ck[a]===a$}minX(a){return this.#cl[4*a+0]/256}minY(a){return this.#cl[4*a+1]/256}maxX(a){return(this.#cl[4*a+2]+1)/256}maxY(a){return(this.#cl[4*a+3]+1)/256}}let a0=(a,b)=>a?.getOrInsertComputed(b,()=>({dependencies:new Set,isRenderingOperation:!1}));class a1{#cm=[[1,0,0,1,0,0]];#cn=[-1/0,-1/0,1/0,1/0];#co=new Float64Array(e);_pendingBBoxIdx=-1;#cp;#cq;#cr;#ck;_savesStack=[];_markedContentStack=[];constructor(a,b){this.#cp=a.width,this.#cq=a.height,this.#cs(b)}growOperationsCount(a){a>=this.#ck.length&&this.#cs(a,this.#ck)}#cs(a,b){let c=new ArrayBuffer(4*a);this.#cr=new Uint8ClampedArray(c),this.#ck=new Uint32Array(c),b&&b.length>0?(this.#ck.set(b),this.#ck.fill(a$,b.length)):this.#ck.fill(a$)}get clipBox(){return this.#cn}save(a){return this.#cn={__proto__:this.#cn},this._savesStack.push(a),this}restore(a,b){let c=Object.getPrototypeOf(this.#cn);if(null===c)return this;this.#cn=c;let d=this._savesStack.pop();return void 0!==d&&(b?.(d,a),this.#ck[a]=this.#ck[d]),this}recordOpenMarker(a){return this._savesStack.push(a),this}getOpenMarker(){return 0===this._savesStack.length?null:this._savesStack.at(-1)}recordCloseMarker(a,b){let c=this._savesStack.pop();return void 0!==c&&(b?.(c,a),this.#ck[a]=this.#ck[c]),this}beginMarkedContent(a){return this._markedContentStack.push(a),this}endMarkedContent(a,b){let c=this._markedContentStack.pop();return void 0!==c&&(b?.(c,a),this.#ck[a]=this.#ck[c]),this}pushBaseTransform(a){return this.#cm.push(L.multiplyByDOMMatrix(this.#cm.at(-1),a.getTransform())),this}popBaseTransform(){return this.#cm.length>1&&this.#cm.pop(),this}resetBBox(a){return this._pendingBBoxIdx!==a&&(this._pendingBBoxIdx=a,this.#co.set(e,0)),this}recordClipBox(a,b,c,d,f,g){let h=L.multiplyByDOMMatrix(this.#cm.at(-1),b.getTransform()),i=e.slice();L.axialAlignedBoundingBox([c,f,d,g],h,i);let j=L.intersect(this.#cn,i);return j?(this.#cn[0]=j[0],this.#cn[1]=j[1],this.#cn[2]=j[2],this.#cn[3]=j[3]):(this.#cn[0]=this.#cn[1]=1/0,this.#cn[2]=this.#cn[3]=-1/0),this}recordBBox(a,b,c,d,f,g){let h=this.#cn;if(h[0]===1/0)return this;let i=L.multiplyByDOMMatrix(this.#cm.at(-1),b.getTransform());if(h[0]===-1/0)return L.axialAlignedBoundingBox([c,f,d,g],i,this.#co),this;let j=e.slice();return L.axialAlignedBoundingBox([c,f,d,g],i,j),this.#co[0]=U(j[0],h[0],this.#co[0]),this.#co[1]=U(j[1],h[1],this.#co[1]),this.#co[2]=U(j[2],this.#co[2],h[2]),this.#co[3]=U(j[3],this.#co[3],h[3]),this}recordFullPageBBox(a){return this.#co[0]=Math.max(0,this.#cn[0]),this.#co[1]=Math.max(0,this.#cn[1]),this.#co[2]=Math.min(this.#cp,this.#cn[2]),this.#co[3]=Math.min(this.#cq,this.#cn[3]),this}recordOperation(a,b=!1,c){if(this._pendingBBoxIdx!==a)return this;let d=aX(256*this.#co[0]/this.#cp),e=aX(256*this.#co[1]/this.#cq),f=aY(256*this.#co[2]/this.#cp),g=aY(256*this.#co[3]/this.#cq);if(aZ(this.#cr,a,d,e,f,g),c)for(let b of c)for(let c of b)c!==a&&aZ(this.#cr,c,d,e,f,g);return b||(this._pendingBBoxIdx=-1),this}bboxToClipBoxDropOperation(a){return this._pendingBBoxIdx===a&&(this._pendingBBoxIdx=-1,this.#cn[0]=Math.max(this.#cn[0],this.#co[0]),this.#cn[1]=Math.max(this.#cn[1],this.#co[1]),this.#cn[2]=Math.min(this.#cn[2],this.#co[2]),this.#cn[3]=Math.min(this.#cn[3],this.#co[3])),this}take(){return new a_(this.#ck,this.#cr)}takeDebugMetadata(){throw Error("Unreachable")}recordSimpleData(a,b){return this}recordIncrementalData(a,b){return this}resetIncrementalData(a,b){return this}recordNamedData(a,b){return this}recordSimpleDataFromNamed(a,b,c){return this}recordFutureForcedDependency(a,b){return this}inheritSimpleDataAsFutureForcedDependencies(a){return this}inheritPendingDependenciesAsFutureForcedDependencies(){return this}recordCharacterBBox(a,b,c,d=1,e=0,f=0,g){return this}getSimpleIndex(a){}recordDependencies(a,b){return this}recordNamedDependency(a,b){return this}recordShowTextOperation(a,b=!1){return this}}class a2{#ct={__proto__:null};#cu={__proto__:null,transform:[],moveText:[],sameLineText:[],[aW]:[]};#cv=new Map;#cw=new Set;#cx=new Map;#cy;#cz;#cA;constructor(a,b=!1){this.#cA=a,b&&(this.#cy=new Map,this.#cz=(a,b)=>{a0(this.#cy,b).dependencies.add(a)})}get clipBox(){return this.#cA.clipBox}growOperationsCount(a){this.#cA.growOperationsCount(a)}save(a){return this.#ct={__proto__:this.#ct},this.#cu={__proto__:this.#cu,transform:{__proto__:this.#cu.transform},moveText:{__proto__:this.#cu.moveText},sameLineText:{__proto__:this.#cu.sameLineText},[aW]:{__proto__:this.#cu[aW]}},this.#cA.save(a),this}restore(a){this.#cA.restore(a,this.#cz);let b=Object.getPrototypeOf(this.#ct);return null===b||(this.#ct=b,this.#cu=Object.getPrototypeOf(this.#cu)),this}recordOpenMarker(a){return this.#cA.recordOpenMarker(a,this.#cz),this}getOpenMarker(){return this.#cA.getOpenMarker()}recordCloseMarker(a){return this.#cA.recordCloseMarker(a,this.#cz),this}beginMarkedContent(a){return this.#cA.beginMarkedContent(a),this}endMarkedContent(a){return this.#cA.endMarkedContent(a,this.#cz),this}pushBaseTransform(a){return this.#cA.pushBaseTransform(a),this}popBaseTransform(){return this.#cA.popBaseTransform(),this}recordSimpleData(a,b){return this.#ct[a]=b,this}recordIncrementalData(a,b){return this.#cu[a].push(b),this}resetIncrementalData(a,b){return this.#cu[a].length=0,this}recordNamedData(a,b){return this.#cv.set(a,b),this}recordSimpleDataFromNamed(a,b,c){this.#ct[a]=this.#cv.get(b)??c}recordFutureForcedDependency(a,b){return this.recordIncrementalData(aW,b),this}inheritSimpleDataAsFutureForcedDependencies(a){for(let b of a)b in this.#ct&&this.recordFutureForcedDependency(b,this.#ct[b]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(let a of this.#cw)this.recordFutureForcedDependency(aW,a);return this}resetBBox(a){return this.#cA.resetBBox(a),this}recordClipBox(a,b,c,d,e,f){return this.#cA.recordClipBox(a,b,c,d,e,f),this}recordBBox(a,b,c,d,e,f){return this.#cA.recordBBox(a,b,c,d,e,f),this}recordCharacterBBox(a,b,c,d=1,e=0,f=0,g){let h,i,j=c.bbox;if(j&&!1!==(h=j[2]!==j[0]&&j[3]!==j[1]&&this.#cx.get(c))){var k,l;let g;if(i=[0,0,0,0],L.axialAlignedBoundingBox(j,c.fontMatrix,i),(1!==d||0!==e||0!==f)&&(k=-d,l=i,d?(d<0&&(g=l[0],l[0]=l[2],l[2]=g),l[0]*=d,l[2]*=d,k<0&&(g=l[1],l[1]=l[3],l[3]=g),l[1]*=k,l[3]*=k):l.fill(0),l[0]+=e,l[1]+=f,l[2]+=e,l[3]+=f),h)return this.recordBBox(a,b,i[0],i[2],i[1],i[3])}if(!g)return this.recordFullPageBBox(a);let m=g();return j&&i&&void 0===h&&(h=i[0]<=e-m.actualBoundingBoxLeft&&i[2]>=e+m.actualBoundingBoxRight&&i[1]<=f-m.actualBoundingBoxAscent&&i[3]>=f+m.actualBoundingBoxDescent,this.#cx.set(c,h),h)?this.recordBBox(a,b,i[0],i[2],i[1],i[3]):this.recordBBox(a,b,e-m.actualBoundingBoxLeft,e+m.actualBoundingBoxRight,f-m.actualBoundingBoxAscent,f+m.actualBoundingBoxDescent)}recordFullPageBBox(a){return this.#cA.recordFullPageBBox(a),this}getSimpleIndex(a){return this.#ct[a]}recordDependencies(a,b){let c=this.#cw,d=this.#ct,e=this.#cu;for(let a of b)a in this.#ct?c.add(d[a]):a in e&&e[a].forEach(c.add,c);return this}recordNamedDependency(a,b){return this.#cv.has(b)&&this.#cw.add(this.#cv.get(b)),this}recordOperation(a,b=!1){if(this.recordDependencies(a,[aW]),this.#cy){let b=a0(this.#cy,a),{dependencies:c}=b;this.#cw.forEach(c.add,c),this.#cA._savesStack.forEach(c.add,c),this.#cA._markedContentStack.forEach(c.add,c),c.delete(a),b.isRenderingOperation=!0}let c=!b&&a===this.#cA._pendingBBoxIdx;return this.#cA.recordOperation(a,b,[this.#cw,this.#cA._savesStack,this.#cA._markedContentStack]),c&&this.#cw.clear(),this}recordShowTextOperation(a,b=!1){let c=Array.from(this.#cw);for(let d of(this.recordOperation(a,b),this.recordIncrementalData("sameLineText",a),c))this.recordIncrementalData("sameLineText",d);return this}bboxToClipBoxDropOperation(a,b=!1){let c=!b&&a===this.#cA._pendingBBoxIdx;return this.#cA.bboxToClipBoxDropOperation(a),c&&this.#cw.clear(),this}take(){return this.#cx.clear(),this.#cA.take()}takeDebugMetadata(){return this.#cy}}class a3{#cB;#cC;#cD;#cE=0;#cF=0;constructor(a,b,c){if(a instanceof a3&&!!c===a.#cD)return a;this.#cB=a,this.#cC=b,this.#cD=!!c}get clipBox(){return this.#cB.clipBox}growOperationsCount(){throw Error("Unreachable")}save(a){return this.#cF++,this.#cB.save(this.#cC),this}restore(a){return this.#cF>0&&(this.#cB.restore(this.#cC),this.#cF--),this}recordOpenMarker(a){return this.#cE++,this}getOpenMarker(){return this.#cE>0?this.#cC:this.#cB.getOpenMarker()}recordCloseMarker(a){return this.#cE--,this}beginMarkedContent(a){return this}endMarkedContent(a){return this}pushBaseTransform(a){return this.#cB.pushBaseTransform(a),this}popBaseTransform(){return this.#cB.popBaseTransform(),this}recordSimpleData(a,b){return this.#cB.recordSimpleData(a,this.#cC),this}recordIncrementalData(a,b){return this.#cB.recordIncrementalData(a,this.#cC),this}resetIncrementalData(a,b){return this.#cB.resetIncrementalData(a,this.#cC),this}recordNamedData(a,b){return this}recordSimpleDataFromNamed(a,b,c){return this.#cB.recordSimpleDataFromNamed(a,b,this.#cC),this}recordFutureForcedDependency(a,b){return this.#cB.recordFutureForcedDependency(a,this.#cC),this}inheritSimpleDataAsFutureForcedDependencies(a){return this.#cB.inheritSimpleDataAsFutureForcedDependencies(a),this}inheritPendingDependenciesAsFutureForcedDependencies(){return this.#cB.inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(a){return this.#cD||this.#cB.resetBBox(this.#cC),this}recordClipBox(a,b,c,d,e,f){return this.#cD||this.#cB.recordClipBox(this.#cC,b,c,d,e,f),this}recordBBox(a,b,c,d,e,f){return this.#cD||this.#cB.recordBBox(this.#cC,b,c,d,e,f),this}recordCharacterBBox(a,b,c,d,e,f,g){return this.#cD||this.#cB.recordCharacterBBox(this.#cC,b,c,d,e,f,g),this}recordFullPageBBox(a){return this.#cD||this.#cB.recordFullPageBBox(this.#cC),this}getSimpleIndex(a){return this.#cB.getSimpleIndex(a)}recordDependencies(a,b){return this.#cB.recordDependencies(this.#cC,b),this}recordNamedDependency(a,b){return this.#cB.recordNamedDependency(this.#cC,b),this}recordOperation(a){return this.#cB.recordOperation(this.#cC,!0),this}recordShowTextOperation(a){return this.#cB.recordShowTextOperation(this.#cC,!0),this}bboxToClipBoxDropOperation(a){return this.#cD||this.#cB.bboxToClipBoxDropOperation(this.#cC,!0),this}take(){throw Error("Unreachable")}takeDebugMetadata(){throw Error("Unreachable")}}let a4=["path","transform","filter","strokeColor","strokeAlpha","lineWidth","lineCap","lineJoin","miterLimit","dash"],a5=["path","transform","filter","fillColor","fillAlpha","globalCompositeOperation","SMask"],a6=["transform","SMask","filter","fillAlpha","strokeAlpha","globalCompositeOperation"],a7=["filter","fillColor","fillAlpha"],a8=["transform","leading","charSpacing","wordSpacing","hScale","textRise","moveText","textMatrix","font","fontObj","filter","fillColor","textRenderingMode","SMask","fillAlpha","strokeAlpha","globalCompositeOperation","sameLineText"],a9=["transform"],ba=["transform","fillColor"];class bb{#cp;#cq;#cG=4;#cH=0;#cl=new bb.#cI(6*this.#cG);static #cI=K.isFloat16ArraySupported?Float16Array:Float32Array;constructor(a){this.#cp=a.width,this.#cq=a.height}record(a,b,c,d){let f;if(this.#cH===this.#cG){this.#cG*=2;let a=new bb.#cI(6*this.#cG);a.set(this.#cl),this.#cl=a}let g=am(a);if(d[0]!==1/0){let a=e.slice();L.axialAlignedBoundingBox([0,-c,b,0],g,a);let h=L.intersect(d,a);if(!h)return;let[i,j,k,l]=h;if(i!==a[0]||j!==a[1]||k!==a[2]||l!==a[3]){let a=Math.atan2(g[1],g[0]),b=Math.abs(Math.sin(a)),c=Math.abs(Math.cos(a));if(b<1e-6||c<1e-6||1e-6>Math.abs(b-c))f=[i,j,i,l,k,j];else{let a=k-i,d=l-j,e=b*b,g=c*c,h=c*b,m=g-e,n=(d*g-a*h)/m;f=[i+(d*h-a*e)/m,j,i,j+n,k,l-n]}}}f||(f=[0,-c,0,0,b,-c],L.applyTransform(f,g,0),L.applyTransform(f,g,2),L.applyTransform(f,g,4)),f[0]/=this.#cp,f[1]/=this.#cq,f[2]/=this.#cp,f[3]/=this.#cq,f[4]/=this.#cp,f[5]/=this.#cq,this.#cl.set(f,6*this.#cH),this.#cH++}take(){return this.#cl.subarray(0,6*this.#cH)}}class bc{#cJ=new Set;#cK=null;constructor({ownerDocument:a=globalThis.document,styleElement:b=null}){this._document=a,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(a){this.nativeFontFaces.add(a),this._document.fonts.add(a)}removeNativeFontFace(a){this.nativeFontFaces.delete(a),this._document.fonts.delete(a)}insertRule(a){let b=this.#cL();b.insertRule(a,b.cssRules.length)}#cL(){if(this.#cK)return this.#cK;let a=this._document.defaultView?.CSSStyleSheet||globalThis.CSSStyleSheet;if(!this.styleElement&&a){let{adoptedStyleSheets:b}=this._document;if(b){let c=new a;return b.push(c),this.#cK=c}}return this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement)),this.#cK=this.styleElement.sheet}clear(){for(let a of this.nativeFontFaces)this._document.fonts.delete(a);if(this.nativeFontFaces.clear(),this.#cJ.clear(),this.#cK){let{adoptedStyleSheets:a}=this._document;a?.includes(this.#cK)&&(this._document.adoptedStyleSheets=a.filter(a=>a!==this.#cK)),this.#cK=null}this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:a,disableFontFace:b,_inspectFont:c}){if(!(!a||this.#cJ.has(a.loadedName))){if(x(!b,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){let{loadedName:b,src:d,style:e}=a,f=new FontFace(b,d,e);this.addNativeFontFace(f);try{await f.load(),this.#cJ.add(b),c?.(a)}catch{v(`Cannot load system font: ${a.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(f)}return}w("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(a){if(a.attached||a.missingFile&&!a.systemFontInfo)return;if(a.attached=!0,a.systemFontInfo)return void await this.loadSystemFont(a);if(this.isFontLoadingAPISupported){let b=a.createNativeFontFace();if(b){this.addNativeFontFace(b);try{await b.loaded}catch(c){throw v(`Failed to load font '${b.family}': '${c}'.`),a.disableFontFace=!0,c}}return}let b=a.createFontFaceRule();if(b){if(this.insertRule(b),this.isSyncFontLoadingSupported)return;await new Promise(b=>{let c=this._queueLoadingCallback(b);this._prepareFontLoadEvent(a,c)})}}get isFontLoadingAPISupported(){return B(this,"isFontLoadingAPISupported",!!this._document?.fonts)}get isSyncFontLoadingSupported(){return B(this,"isSyncFontLoadingSupported",d||K.platform.isFirefox)}_queueLoadingCallback(a){let{loadingRequests:b}=this,c={done:!1,complete:function(){for(x(!c.done,"completeRequest() cannot be called twice."),c.done=!0;b.length>0&&b[0].done;)setTimeout(b.shift().callback,0)},callback:a};return b.push(c),c}get _loadTestFont(){return B(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}_prepareFontLoadEvent(a,b){var c;let d,e;function f(a,b){return a.charCodeAt(b)<<24|a.charCodeAt(b+1)<<16|a.charCodeAt(b+2)<<8|255&a.charCodeAt(b+3)}function g(a,b,c,d){return a.substring(0,b)+d+a.substring(b+c)}let h=this._document.createElement("canvas");h.width=1,h.height=1;let i=h.getContext("2d"),j=0,k=`lt${Date.now()}${this.loadTestFontId++}`,l=this._loadTestFont,m=f(l=g(l,976,k.length,k),16);for(d=0,e=k.length-3;d<e;d+=4)m=m-0x58585858+f(k,d)|0;d<k.length&&(m=m-0x58585858+f(k+"XXX",d)|0),l=g(l,16,4,String.fromCharCode((c=m)>>24&255,c>>16&255,c>>8&255,255&c));let n=`url(data:font/opentype;base64,${btoa(l)});`,o=`@font-face {font-family:"${k}";src:${n}}`;this.insertRule(o);let p=this._document.createElement("div");for(let b of(p.style.visibility="hidden",p.style.width=p.style.height="10px",p.style.position="absolute",p.style.top=p.style.left="0px",[a.loadedName,k])){let a=this._document.createElement("span");a.textContent="Hi",a.style.fontFamily=b,p.append(a)}this._document.body.append(p),function a(b,c){if(++j>30){v("Load test font never loaded."),c();return}(i.font="30px "+b,i.fillText(".",0,20),i.getImageData(0,0,1,1).data[3]>0)?c():setTimeout(a.bind(null,b,c))}(k,()=>{p.remove(),b.complete()})}}class bd{compiledGlyphs=Object.create(null);#cM;constructor(a,b=null,c,d){this.#cM=a,this._inspectFont=b,c&&(this.charProcOperatorList=c),d&&Object.assign(this,d)}createNativeFontFace(){let a;if(!this.data||this.disableFontFace)return null;if(this.cssFontInfo){let b={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(b.style=`oblique ${this.cssFontInfo.italicAngle}deg`),a=new FontFace(this.cssFontInfo.fontFamily,this.data,b)}else a=new FontFace(this.loadedName,this.data,{});return this._inspectFont?.(this),a}createFontFaceRule(){let a;if(!this.data||this.disableFontFace)return null;let b=`url(data:${this.mimetype};base64,${this.data.toBase64()});`;if(this.cssFontInfo){let c=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(c+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),a=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${c}src:${b}}`}else a=`@font-face {font-family:"${this.loadedName}";src:${b}}`;return this._inspectFont?.(this,b),a}getPathGenerator(a,b){let c;if(void 0!==this.compiledGlyphs[b])return this.compiledGlyphs[b];let d=this.loadedName+"_path_"+b;try{c=a.get(d)}catch(a){v(`getPathGenerator - ignoring character: "${a}".`)}let e=aB(c?.path);return this.fontExtraProperties||a.delete(d),this.compiledGlyphs[b]=e}get black(){return this.#cM.black}get bold(){return this.#cM.bold}get disableFontFace(){return this.#cM.disableFontFace}set disableFontFace(a){B(this,"disableFontFace",!!a)}get fontExtraProperties(){return this.#cM.fontExtraProperties}get isInvalidPDFjsFont(){return this.#cM.isInvalidPDFjsFont}get isType3Font(){return this.#cM.isType3Font}get italic(){return this.#cM.italic}get missingFile(){return this.#cM.missingFile}get remeasure(){return this.#cM.remeasure}get vertical(){return this.#cM.vertical}get ascent(){return this.#cM.ascent}get defaultWidth(){return this.#cM.defaultWidth}get descent(){return this.#cM.descent}get bbox(){return this.#cM.bbox}get fontMatrix(){return this.#cM.fontMatrix}get fallbackName(){return this.#cM.fallbackName}get loadedName(){return this.#cM.loadedName}get mimetype(){return this.#cM.mimetype}get name(){return this.#cM.name}get data(){return this.#cM.data}clearData(){this.#cM.clearData()}get cssFontInfo(){return this.#cM.cssFontInfo}get systemFontInfo(){return this.#cM.systemFontInfo}get defaultVMetrics(){return this.#cM.defaultVMetrics}}class be{static strings=["fontFamily","fontWeight","italicAngle"]}class bf{static strings=["css","loadedName","baseFontName","src"]}class bg{static bools=["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"];static numbers=["ascent","defaultWidth","descent"];static strings=["fallbackName","loadedName","mimetype","name"];static OFFSET_NUMBERS=Math.ceil(2*this.bools.length/8);static OFFSET_BBOX=this.OFFSET_NUMBERS+8*this.numbers.length;static OFFSET_FONT_MATRIX=this.OFFSET_BBOX+1+8;static OFFSET_DEFAULT_VMETRICS=this.OFFSET_FONT_MATRIX+1+48;static OFFSET_STRINGS=this.OFFSET_DEFAULT_VMETRICS+1+6}class bh{static KIND=0;static HAS_BBOX=1;static HAS_BACKGROUND=2;static SHADING_TYPE=3;static N_COORD=4;static N_COLOR=8;static N_STOP=12;static N_FIGURES=16}class bi{#cN;#cO=new TextDecoder;#cP;constructor(a){this.#cN=a,this.#cP=new DataView(a)}#cQ(a){x(a<be.strings.length,"Invalid string index");let b=0;for(let c=0;c<a;c++)b+=this.#cP.getUint32(b)+4;let c=this.#cP.getUint32(b);return this.#cO.decode(new Uint8Array(this.#cN,b+4,c))}get fontFamily(){return this.#cQ(0)}get fontWeight(){return this.#cQ(1)}get italicAngle(){return this.#cQ(2)}}class bj{#cN;#cO=new TextDecoder;#cP;constructor(a){this.#cN=a,this.#cP=new DataView(a)}get guessFallback(){return 0!==this.#cP.getUint8(0)}#cQ(a){x(a<bf.strings.length,"Invalid string index");let b=5;for(let c=0;c<a;c++)b+=this.#cP.getUint32(b)+4;let c=this.#cP.getUint32(b);return this.#cO.decode(new Uint8Array(this.#cN,b+4,c))}get css(){return this.#cQ(0)}get loadedName(){return this.#cQ(1)}get baseFontName(){return this.#cQ(2)}get src(){return this.#cQ(3)}get style(){let a=1;a+=4+this.#cP.getUint32(a);let b=this.#cP.getUint32(a),c=this.#cO.decode(new Uint8Array(this.#cN,a+4,b));a+=4+b;let d=this.#cP.getUint32(a),e=this.#cO.decode(new Uint8Array(this.#cN,a+4,d));return{style:c,weight:e}}}class bk{#cN;#cO=new TextDecoder;#cP;constructor({buffer:a,extra:b}){this.#cN=a,this.#cP=new DataView(a),b&&Object.assign(this,b)}#cR(a){x(a<bg.bools.length,"Invalid boolean index");let b=Math.floor(a/4),c=this.#cP.getUint8(b)>>2*a%8&3;return 0===c?void 0:2===c}get black(){return this.#cR(0)}get bold(){return this.#cR(1)}get disableFontFace(){return this.#cR(2)}get fontExtraProperties(){return this.#cR(3)}get isInvalidPDFjsFont(){return this.#cR(4)}get isType3Font(){return this.#cR(5)}get italic(){return this.#cR(6)}get missingFile(){return this.#cR(7)}get remeasure(){return this.#cR(8)}get vertical(){return this.#cR(9)}#cS(a){return x(a<bg.numbers.length,"Invalid number index"),this.#cP.getFloat64(bg.OFFSET_NUMBERS+8*a)}get ascent(){return this.#cS(0)}get defaultWidth(){return this.#cS(1)}get descent(){return this.#cS(2)}#cT(a,b,c,d){let e=this.#cP.getUint8(a);if(0===e)return;x(e===b,"Invalid array length."),a+=1;let f=Array(e);for(let b=0;b<e;b++)f[b]=this.#cP[c](a,!0),a+=d;return f}get bbox(){return this.#cT(bg.OFFSET_BBOX,4,"getInt16",2)}get fontMatrix(){return this.#cT(bg.OFFSET_FONT_MATRIX,6,"getFloat64",8)}get defaultVMetrics(){return this.#cT(bg.OFFSET_DEFAULT_VMETRICS,3,"getInt16",2)}#cQ(a){x(a<bg.strings.length,"Invalid string index");let b=bg.OFFSET_STRINGS+4;for(let c=0;c<a;c++)b+=this.#cP.getUint32(b)+4;let c=this.#cP.getUint32(b);return this.#cO.decode(new Uint8Array(this.#cN,b+4,c))}get fallbackName(){return this.#cQ(0)}get loadedName(){return this.#cQ(1)}get mimetype(){return this.#cQ(2)}get name(){return this.#cQ(3)}#cU(){let a=bg.OFFSET_STRINGS,b=this.#cP.getUint32(a);a+=4+b;let c=this.#cP.getUint32(a);a+=4+c;let d=this.#cP.getUint32(a);a+=4+d;let e=this.#cP.getUint32(a);return{offset:a,length:e}}get data(){let{offset:a,length:b}=this.#cU();return 0===b?void 0:new Uint8Array(this.#cN,a+4,b)}clearData(){let{offset:a,length:b}=this.#cU();0!==b&&(this.#cP.setUint32(a,0),this.#cN=new Uint8Array(this.#cN,0,a+4).slice().buffer,this.#cP=new DataView(this.#cN))}get cssFontInfo(){let a=bg.OFFSET_STRINGS,b=this.#cP.getUint32(a);a+=4+b;let c=this.#cP.getUint32(a);a+=4+c;let d=this.#cP.getUint32(a);if(0===d)return null;let e=new Uint8Array(d);return e.set(new Uint8Array(this.#cN,a+4,d)),new bi(e.buffer)}get systemFontInfo(){let a=bg.OFFSET_STRINGS,b=this.#cP.getUint32(a);a+=4+b;let c=this.#cP.getUint32(a);if(0===c)return null;let d=new Uint8Array(c);return d.set(new Uint8Array(this.#cN,a+4,c)),new bj(d.buffer)}}class bl{constructor(a){this.buffer=a,this.view=new DataView(a),this.data=new Uint8Array(a)}getIR(){let a=this.view,b=this.data[bh.KIND],c=!!this.data[bh.HAS_BBOX],d=!!this.data[bh.HAS_BACKGROUND],f=a.getUint32(bh.N_COORD,!0),g=a.getUint32(bh.N_COLOR,!0),h=a.getUint32(bh.N_STOP,!0),i=20,j=new Float32Array(this.buffer,i,2*f);i+=8*f;let k=new Uint8Array(this.buffer,i,4*g);i+=4*g;let l=[];for(let b=0;b<h;++b){let b=a.getFloat32(i,!0);i+=4;let c=a.getUint32(i,!0);i+=4,l.push([b,`#${c.toString(16).padStart(6,"0")}`])}let m=null;if(c){m=[];for(let b=0;b<4;++b)m.push(a.getFloat32(i,!0)),i+=4}let n=null;if(d&&(n=new Uint8Array(this.buffer,i,3),i+=3),1===b)return["RadialAxial","axial",m,l,Array.from(j.slice(0,2)),Array.from(j.slice(2,4)),null,null];if(2===b)return["RadialAxial","radial",m,l,[j[0],j[1]],[j[3],j[4]],j[2],j[5]];if(3===b){let a=this.data[bh.SHADING_TYPE],b=null;if(j.length>0){b=e.slice();for(let a=0,c=j.length;a<c;a+=2)L.pointBoundingBox(j[a],j[a+1],b)}return["Mesh",a,j,k,f,b,m,n]}throw Error(`Unsupported pattern kind: ${b}`)}}class bm{#cN;constructor(a){this.#cN=a}get path(){return K.isFloat16ArraySupported?new Float16Array(this.#cN):new Float32Array(this.#cN)}}function bn(a){if("string"!=typeof a)return null;if(a.endsWith("/"))return a;throw Error(`Invalid factory url: "${a}" must include trailing slash.`)}let bo=a=>"object"==typeof a&&Number.isInteger(a?.num)&&a.num>=0&&Number.isInteger(a?.gen)&&a.gen>=0,bp=(function(a,b,c){if(!Array.isArray(c)||c.length<2)return!1;let[d,e,...f]=c;if(!a(d)&&!Number.isInteger(d)||!b(e))return!1;let g=f.length,h=!0;switch(e.name){case"XYZ":if(g<2||g>3)return!1;break;case"Fit":case"FitB":return 0===g;case"FitH":case"FitBH":case"FitV":case"FitBV":if(g>1)return!1;break;case"FitR":if(4!==g)return!1;h=!1;break;default:return!1}for(let a of f)if("number"!=typeof a&&(!h||null!==a))return!1;return!0}).bind(null,bo,a=>"object"==typeof a&&"string"==typeof a?.name);class bq{#cV=new Map;#cW=Promise.resolve();postMessage(a,b){let c={data:structuredClone(a,b?{transfer:b}:null)};this.#cW.then(()=>{for(let[a]of this.#cV)a.call(this,c)})}addEventListener(a,b,c=null){let d=null;if(c?.signal instanceof AbortSignal){let{signal:e}=c;if(e.aborted)return void v("LoopbackPort - cannot use an `aborted` signal.");let f=()=>this.removeEventListener(a,b);d=()=>e.removeEventListener("abort",f),e.addEventListener("abort",f)}this.#cV.set(b,d)}removeEventListener(a,b){let c=this.#cV.get(b);c?.(),this.#cV.delete(b)}terminate(){for(let[,a]of this.#cV)a?.();this.#cV.clear()}}function br(){}function bs(a){if(a instanceof I||a instanceof F||a instanceof D||a instanceof G||a instanceof E)return a;switch(!(a instanceof Error||"object"==typeof a&&null!==a)&&w('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),a.name){case"AbortException":return new I(a.message);case"InvalidPDFException":return new F(a.message);case"PasswordException":return new D(a.message,a.code);case"ResponseException":return new G(a.message,a.status,a.missing);case"UnknownErrorException":return new E(a.message,a.details)}return new E(a.message,a.toString())}class bt{#cX=new AbortController;constructor(a,b,c){this.sourceName=a,this.targetName=b,this.comObj=c,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),c.addEventListener("message",this.#cY.bind(this),{signal:this.#cX.signal})}#cY({data:a}){if(a.targetName!==this.sourceName)return;if(a.stream)return void this.#cZ(a);if(a.callback){let b=a.callbackId,c=this.callbackCapabilities[b];if(!c)throw Error(`Cannot resolve callback ${b}`);if(delete this.callbackCapabilities[b],1===a.callback)c.resolve(a.data);else if(2===a.callback)c.reject(bs(a.reason));else throw Error("Unexpected callback case");return}let b=this.actionHandler[a.action];if(!b)throw Error(`Unknown action from worker: ${a.action}`);if(a.callbackId){let c=this.sourceName,d=a.sourceName,e=this.comObj;Promise.try(b,a.data).then(function(b){e.postMessage({sourceName:c,targetName:d,callback:1,callbackId:a.callbackId,data:b})},function(b){e.postMessage({sourceName:c,targetName:d,callback:2,callbackId:a.callbackId,reason:bs(b)})});return}a.streamId?this.#c$(a):b(a.data)}on(a,b){let c=this.actionHandler;if(c[a])throw Error(`There is already an actionName called "${a}"`);c[a]=b}send(a,b,c){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:a,data:b},c)}sendWithPromise(a,b,c){let d=this.callbackId++,e=Promise.withResolvers();this.callbackCapabilities[d]=e;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:a,callbackId:d,data:b},c)}catch(a){e.reject(a)}return e.promise}sendWithStream(a,b,c,d){let e=this.streamId++,f=this.sourceName,g=this.targetName,h=this.comObj;return new ReadableStream({start:c=>{let i=Promise.withResolvers();return this.streamControllers[e]={controller:c,startCall:i,pullCall:null,cancelCall:null,isClosed:!1},h.postMessage({sourceName:f,targetName:g,action:a,streamId:e,data:b,desiredSize:c.desiredSize},d),i.promise},pull:a=>{let b=Promise.withResolvers();return this.streamControllers[e].pullCall=b,h.postMessage({sourceName:f,targetName:g,stream:6,streamId:e,desiredSize:a.desiredSize}),b.promise},cancel:a=>{x(a instanceof Error,"cancel must have a valid reason");let b=Promise.withResolvers();return this.streamControllers[e].cancelCall=b,this.streamControllers[e].isClosed=!0,h.postMessage({sourceName:f,targetName:g,stream:1,streamId:e,reason:bs(a)}),b.promise}},c)}#c$(a){let b=a.streamId,c=this.sourceName,d=a.sourceName,e=this.comObj,f=this,g=this.actionHandler[a.action],h={enqueue(a,f=1,g){if(this.isCancelled)return;let h=this.desiredSize;this.desiredSize-=f,h>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),e.postMessage({sourceName:c,targetName:d,stream:4,streamId:b,chunk:a},g)},close(){this.isCancelled||(this.isCancelled=!0,e.postMessage({sourceName:c,targetName:d,stream:3,streamId:b}),delete f.streamSinks[b])},error(a){x(a instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,e.postMessage({sourceName:c,targetName:d,stream:5,streamId:b,reason:bs(a)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:a.desiredSize,ready:null};h.sinkCapability.resolve(),h.ready=h.sinkCapability.promise,this.streamSinks[b]=h,Promise.try(g,a.data,h).then(function(){e.postMessage({sourceName:c,targetName:d,stream:8,streamId:b,success:!0})},function(a){e.postMessage({sourceName:c,targetName:d,stream:8,streamId:b,reason:bs(a)})})}#cZ(a){let b=a.streamId,c=this.sourceName,d=a.sourceName,e=this.comObj,f=this.streamControllers[b],g=this.streamSinks[b];switch(a.stream){case 8:a.success?f.startCall.resolve():f.startCall.reject(bs(a.reason));break;case 7:a.success?f.pullCall.resolve():f.pullCall.reject(bs(a.reason));break;case 6:if(!g){e.postMessage({sourceName:c,targetName:d,stream:7,streamId:b,success:!0});break}g.desiredSize<=0&&a.desiredSize>0&&g.sinkCapability.resolve(),g.desiredSize=a.desiredSize,Promise.try(g.onPull||br).then(function(){e.postMessage({sourceName:c,targetName:d,stream:7,streamId:b,success:!0})},function(a){e.postMessage({sourceName:c,targetName:d,stream:7,streamId:b,reason:bs(a)})});break;case 4:if(x(f,"enqueue should have stream controller"),f.isClosed)break;f.controller.enqueue(a.chunk);break;case 3:if(x(f,"close should have stream controller"),f.isClosed)break;f.isClosed=!0,f.controller.close(),this.#c_(f,b);break;case 5:x(f,"error should have stream controller"),f.controller.error(bs(a.reason)),this.#c_(f,b);break;case 2:a.success?f.cancelCall.resolve():f.cancelCall.reject(bs(a.reason)),this.#c_(f,b);break;case 1:if(!g)break;let h=bs(a.reason);Promise.try(g.onCancel||br,h).then(function(){e.postMessage({sourceName:c,targetName:d,stream:2,streamId:b,success:!0})},function(a){e.postMessage({sourceName:c,targetName:d,stream:2,streamId:b,reason:bs(a)})}),g.sinkCapability.reject(h),g.isCancelled=!0,delete this.streamSinks[b];break;default:throw Error("Unexpected stream case")}}async #c_(a,b){await Promise.allSettled([a.startCall?.promise,a.pullCall?.promise,a.cancelCall?.promise]),delete this.streamControllers[b]}destroy(){this.#cX?.abort(),this.#cX=null}}class bu{#c0=Object.freeze({cMapUrl:"CMap",standardFontDataUrl:"font",wasmUrl:"wasm"});constructor({cMapUrl:a=null,standardFontDataUrl:b=null,wasmUrl:c=null}){this.cMapUrl=a,this.standardFontDataUrl=b,this.wasmUrl=c}async fetch({kind:a,filename:b}){switch(a){case"cMapUrl":case"standardFontDataUrl":case"wasmUrl":break;default:w(`Not implemented: ${a}`)}let c=this[a];if(!c)throw Error(`Ensure that the \`${a}\` API parameter is provided.`);let d=`${c}${b}`;return this._fetch(d,a).catch(b=>{throw Error(`Unable to load ${this.#c0[a]} data at: ${d}`)})}async _fetch(a,b){w("Abstract method `_fetch` called.")}}class bv extends bu{async _fetch(a,b){let c="cMapUrl"!==b||a.endsWith(".bcmap")?"bytes":"text",d=await _(a,c);return d instanceof Uint8Array?d:J(d)}}class bw{#c1=!1;constructor({enableHWA:a=!1}){this.#c1=a}create(a,b){if(a<=0||b<=0)throw Error("Invalid canvas size");let c=this._createCanvas(a,b);return{canvas:c,context:c.getContext("2d",{willReadFrequently:!this.#c1})}}reset({canvas:a},b,c){if(!a)throw Error("Canvas is not specified");if(b<=0||c<=0)throw Error("Invalid canvas size");a.width=b,a.height=c}destroy(a){let{canvas:b}=a;if(!b)throw Error("Canvas is not specified");b.width=b.height=0,a.canvas=null,a.context=null}_createCanvas(a,b){w("Abstract method `_createCanvas` called.")}}class bx extends bw{constructor({ownerDocument:a=globalThis.document,enableHWA:b=!1}){super({enableHWA:b}),this._document=a}_createCanvas(a,b){let c=this._document.createElement("canvas");return c.width=a,c.height=b,c}}class by{addFilter(a){return"none"}addHCMFilter(a,b){return"none"}addAlphaFilter(a){return"none"}addLuminosityFilter(a){return"none"}addKnockoutFilter(a=0){return"none"}addHighlightHCMFilter(a,b,c,d,e){return"none"}addSelectionHCMFilter(a,b){return"none"}addSelectionFilter(){return"none"}createSelectionStyle(a=null){return null}destroy(a=!1){}}class bz extends by{#c2;#c3;#c4;#c5;#c6;#c7;#B=0;constructor({docId:a,ownerDocument:b=globalThis.document}){super(),this.#c5=a,this.#c6=b}get #D(){return this.#c3||=new Map}get #c8(){return this.#c7||=new Map}get #c9(){if(!this.#c4){let a=this.#c6.createElement("div"),{style:b}=a;b.colorScheme="only light",b.visibility="hidden",b.contain="strict",b.width=b.height=0,b.position="absolute",b.top=b.left=0,b.zIndex=-1;let c=this.#c6.createElementNS(h,"svg");c.setAttribute("width",0),c.setAttribute("height",0),this.#c4=this.#c6.createElementNS(h,"defs"),a.append(c),c.append(this.#c4),this.#c6.body.append(a)}return this.#c4}#da(a){if(1===a.length){let b=a[0],c=Array(256);for(let a=0;a<256;a++)c[a]=b[a]/255;let d=c.join(",");return[d,d,d]}let[b,c,d]=a,e=Array(256),f=Array(256),g=Array(256);for(let a=0;a<256;a++)e[a]=b[a]/255,f[a]=c[a]/255,g[a]=d[a]/255;return[e.join(","),f.join(","),g.join(",")]}#db(a){if(void 0===this.#c2){this.#c2="";let a=this.#c6.URL;a!==this.#c6.baseURI&&(ab(a)?v('#createUrl: ignore "data:"-URL for performance reasons.'):this.#c2=z(a,""))}return`url(${this.#c2}#${a})`}addFilter(a){if(!a)return"none";let b=this.#D.get(a);if(b)return b;let[c,d,e]=this.#da(a),f=1===a.length?c:`${c}${d}${e}`;if(b=this.#D.get(f))return this.#D.set(a,b),b;let g=`g_${this.#c5}_transfer_map_${this.#B++}`,h=this.#db(g);this.#D.set(a,h),this.#D.set(f,h);let i=this.#dc(g);return this.#dd(c,d,e,i),h}addHCMFilter(a,b){let c=`${a}-${b}`,d="base",e=this.#c8.get(d);if(e?.key===c||(e?(e.filter?.remove(),e.key=c,e.url="none",e.filter=null):(e={key:c,url:"none",filter:null},this.#c8.set(d,e)),!a||!b))return e.url;let f=this.#de(a);a=L.makeHexColor(...f);let g=this.#de(b);if(b=L.makeHexColor(...g),this.#df(),"#000000"===a&&"#ffffff"===b||a===b)return e.url;let h=Array(256);for(let a=0;a<=255;a++){let b=a/255;h[a]=b<=.03928?b/12.92:((b+.055)/1.055)**2.4}let i=h.join(","),j=`g_${this.#c5}_hcm_filter`,k=e.filter=this.#dc(j);this.#dd(i,i,i,k),this.#dg(k);let l=(a,b)=>{let c=f[a]/255,d=g[a]/255,e=Array(b+1);for(let a=0;a<=b;a++)e[a]=c+a/b*(d-c);return e.join(",")};return this.#dd(l(0,5),l(1,5),l(2,5),k),e.url=this.#db(j),e.url}addSelectionHCMFilter(a,b){return this.addHighlightHCMFilter("selection",a,b,"HighlightText","Highlight")}addSelectionFilter(){return this.addHighlightHCMFilter("selection_default","black","white","HighlightText","Highlight")}createSelectionStyle(a=null){let b=a?this.addSelectionHCMFilter(a.foreground,a.background):this.addSelectionFilter();return"none"!==b&&K.platform.isFirefox?{"backdrop-filter":b,"background-color":"transparent"}:null}addAlphaFilter(a){let b=this.#D.get(a);if(b)return b;let[c]=this.#da([a]),d=`alpha_${c}`;if(b=this.#D.get(d))return this.#D.set(a,b),b;let e=`g_${this.#c5}_alpha_map_${this.#B++}`,f=this.#db(e);this.#D.set(a,f),this.#D.set(d,f);let g=this.#dc(e);return this.#dh(c,g),f}addLuminosityFilter(a){let b,c,d=this.#D.get(a||"luminosity");if(d)return d;if(a?([b]=this.#da([a]),c=`luminosity_${b}`):c="luminosity",d=this.#D.get(c))return this.#D.set(a,d),d;let e=`g_${this.#c5}_luminosity_map_${this.#B++}`,f=this.#db(e);this.#D.set(a,f),this.#D.set(c,f);let g=this.#dc(e);return this.#di(g),a&&this.#dh(b,g),f}addKnockoutFilter(a=0){let b=a>0?Math.min(1/a,1e6):1e6,c=`knockout_${b}`,d=this.#D.get(c);if(d)return d;let e=`g_${this.#c5}_knockout_filter_${this.#B++}`,f=this.#db(e);this.#D.set(c,f);let g=this.#dc(e),i=this.#c6.createElementNS(h,"feComponentTransfer");g.append(i);let j=this.#c6.createElementNS(h,"feFuncA");return j.setAttribute("type","linear"),j.setAttribute("slope",`${b}`),j.setAttribute("intercept","0"),i.append(j),f}addHighlightHCMFilter(a,b,c,d,e){let f=`${b}-${c}-${d}-${e}`,g=this.#c8.get(a);if(g?.key===f||(g?(g.filter?.remove(),g.key=f,g.url="none",g.filter=null):(g={key:f,url:"none",filter:null},this.#c8.set(a,g)),!b||!c))return g.url;let[h,i]=[b,c].map(this.#de.bind(this)),j=Math.round(.2126*h[0]+.7152*h[1]+.0722*h[2]),k=Math.round(.2126*i[0]+.7152*i[1]+.0722*i[2]),[l,m]=[d,e].map(this.#dj.bind(this));k<j&&([j,k,l,m]=[k,j,m,l]),this.#df();let n=(a,b,c)=>{let d=Array(256),e=(k-j)/c,f=a/255,g=(b-a)/(255*c),h=0;for(let a=0;a<=c;a++){let b=Math.round(j+a*e),c=f+a*g;for(let a=h;a<=b;a++)d[a]=c;h=b+1}for(let a=h;a<256;a++)d[a]=d[h-1];return d.join(",")},o=`g_${this.#c5}_hcm_${a}_filter`,p=g.filter=this.#dc(o);return this.#dg(p),this.#dd(n(l[0],m[0],5),n(l[1],m[1],5),n(l[2],m[2],5),p),g.url=this.#db(o),g.url}destroy(a=!1){a&&this.#c7?.size||(this.#c4?.parentNode.parentNode.remove(),this.#c4=null,this.#c3?.clear(),this.#c3=null,this.#c7?.clear(),this.#c7=null,this.#B=0)}#di(a){let b=this.#c6.createElementNS(h,"feColorMatrix");b.setAttribute("type","matrix"),b.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),a.append(b)}#dg(a){let b=this.#c6.createElementNS(h,"feColorMatrix");b.setAttribute("type","matrix"),b.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),a.append(b)}#dc(a){let b=this.#c6.createElementNS(h,"filter");return b.setAttribute("color-interpolation-filters","sRGB"),b.setAttribute("id",a),this.#c9.append(b),b}#dk(a,b,c){let d=this.#c6.createElementNS(h,b);d.setAttribute("type","discrete"),d.setAttribute("tableValues",c),a.append(d)}#dd(a,b,c,d){let e=this.#c6.createElementNS(h,"feComponentTransfer");d.append(e),this.#dk(e,"feFuncR",a),this.#dk(e,"feFuncG",b),this.#dk(e,"feFuncB",c)}#dh(a,b){let c=this.#c6.createElementNS(h,"feComponentTransfer");b.append(c),this.#dk(c,"feFuncA",a)}#de(a){return this.#c9.style.color="CanvasText",this.#c9.style.backgroundColor=a,al(getComputedStyle(this.#c9).getPropertyValue("background-color"))}#dl(a){return this.#c9.style.color="CanvasText",this.#c9.style.backgroundColor=a,ak(getComputedStyle(this.#c9).getPropertyValue("background-color"))}#df(){this.#c9.style.color="",this.#c9.style.backgroundColor=""}#dj(a){let[b,c,d,e]=this.#dl(a);if(1===e)return[b,c,d];let[f,g,h]=this.#de("Canvas");return[bA(b,f,e),bA(c,g,e),bA(d,h,e)]}}function bA(a,b,c){return Math.round(c*a+(1-c)*b)}async function bB(a){let b=process.getBuiltinModule("fs/promises");return new Uint8Array(await b.readFile(a))}d&&v("Please use the `legacy` build in Node.js environments.");class bC extends by{}class bD extends bw{_createCanvas(a,b){return process.getBuiltinModule("module").createRequire("file:///home/runner/work/cockpit/cockpit/node_modules/pdfjs-dist/build/pdf.mjs")("@napi-rs/canvas").createCanvas(a,b)}}class bE extends bu{async _fetch(a,b){return bB(a)}}function bF({src:a,srcPos:b=0,dest:c,width:d,height:e,nonBlackColor:f=0xffffffff,inverseDecode:g=!1}){let h=K.isLittleEndian?0xff000000:255,[i,j]=g?[f,h]:[h,f],k=d>>3,l=7&d,m=i^j,n=a.length;c=new Uint32Array(c.buffer);let o=0;for(let d=0;d<e;++d){for(let d=b+k;b<d;++b,o+=8){let d=a[b];c[o]=i^-(d>>7&1)&m,c[o+1]=i^-(d>>6&1)&m,c[o+2]=i^-(d>>5&1)&m,c[o+3]=i^-(d>>4&1)&m,c[o+4]=i^-(d>>3&1)&m,c[o+5]=i^-(d>>2&1)&m,c[o+6]=i^-(d>>1&1)&m,c[o+7]=i^-(1&d)&m}if(0===l)continue;let d=b<n?a[b++]:255;for(let a=0;a<l;++a,++o)c[o]=i^-(d>>7-a&1)&m}return{srcPos:b,destPos:o}}let bG=`
|
|
3
3
|
struct Uniforms {
|
|
4
4
|
offsetX : f32,
|