@agent-spaces/server 0.3.62 → 0.3.63
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/dist/adapters/agent-runtime-types.js +12 -0
- package/dist/adapters/claude-code-runtime/index.js +3 -0
- package/dist/adapters/codex-runtime.js +2 -2
- package/dist/adapters/langchain-runtime.js +2 -2
- package/dist/adapters/open-agent-sdk-runtime.js +2 -2
- package/dist/agents/commit-agent.js +1 -0
- package/dist/agents/issue-agent-progress.js +4 -2
- package/dist/agents/issue-agent-runner.js +5 -5
- package/dist/agents/issue-task-controller.js +95 -14
- package/dist/app.js +74 -5
- package/dist/package.json +1 -1
- package/dist/routes/agent-sse.js +4 -2
- package/dist/routes/hooks.js +88 -0
- package/dist/routes/issue.js +59 -1
- package/dist/routes/output-style.js +48 -0
- package/dist/routes/prompt-template.js +2 -2
- package/dist/routes/skill.js +86 -15
- package/dist/routes/task.js +13 -1
- package/dist/services/hook-engine.js +118 -0
- package/dist/services/issue.js +6 -0
- package/dist/services/notification-hub/bot-agent.js +1 -0
- package/dist/services/output-style.js +134 -0
- package/dist/services/prompt-template.js +2 -2
- package/dist/services/skill.js +148 -35
- package/dist/storage/hook-store.js +55 -0
- package/dist/web/404.html +1 -1
- package/dist/web/__next.__PAGE__.txt +4 -4
- package/dist/web/__next._full.txt +25 -24
- package/dist/web/__next._head.txt +4 -4
- package/dist/web/__next._index.txt +13 -13
- package/dist/web/__next._tree.txt +2 -2
- package/dist/web/_next/static/chunks/0-1bfvfwifh-m.js +1 -0
- package/dist/web/_next/static/chunks/0-f~0xmwl__u5.js +1 -0
- package/dist/web/_next/static/chunks/0.n~yfwf4~6w-.js +1 -0
- package/dist/web/_next/static/chunks/002_j970b9gdx.js +1 -0
- package/dist/web/_next/static/chunks/014x2qbuiszni.js +3 -0
- package/dist/web/_next/static/chunks/01iqv28_snwus.js +1 -0
- package/dist/web/_next/static/chunks/02c22g~xd-y30.js +19 -0
- package/dist/web/_next/static/chunks/02mf61htij8g0.js +31 -0
- package/dist/web/_next/static/chunks/03scq1-0ykve3.js +1 -0
- package/dist/web/_next/static/chunks/046me66nilkff.js +1 -0
- package/dist/web/_next/static/chunks/04v-pqqs-2lvp.css +1 -0
- package/dist/web/_next/static/chunks/{0zd1o3u04~qvo.js → 05psi2gtx~bev.js} +7 -7
- package/dist/web/_next/static/chunks/{12odetnu-lyrr.js → 06whz1~s_7pva.js} +12 -12
- package/dist/web/_next/static/chunks/06w~.izyfylap.js +1 -0
- package/dist/web/_next/static/chunks/09t62a89~jesc.js +3 -0
- package/dist/web/_next/static/chunks/09y_3krccdd~u.js +1 -0
- package/dist/web/_next/static/chunks/{0njy89g5coeyi.js → 0_8dm7bxp18xo.js} +6 -6
- package/dist/web/_next/static/chunks/0_e~hmntdfop9.js +1 -0
- package/dist/web/_next/static/chunks/0_udc.6.tueey.js +1 -0
- package/dist/web/_next/static/chunks/0_vi1a~g4wx46.js +3 -0
- package/dist/web/_next/static/chunks/{0rke_patcovgr.js → 0aa6bcdmtpekn.js} +1 -1
- package/dist/web/_next/static/chunks/{0tvd~rxgf0oh_.js → 0bbmx45w_h5np.js} +1 -1
- package/dist/web/_next/static/chunks/0cke33d38fnby.js +90 -0
- package/dist/web/_next/static/chunks/{07a0rktf_nr5h.js → 0ctg5qmw7uu.1.js} +2 -2
- package/dist/web/_next/static/chunks/0cyq~8xb~r5fc.js +1 -0
- package/dist/web/_next/static/chunks/0ewceguykiut5.js +1 -0
- package/dist/web/_next/static/chunks/0fxa1edqr7dve.js +1 -0
- package/dist/web/_next/static/chunks/{0202ia13sijwb.js → 0h18ej5yf974e.js} +1 -1
- package/dist/web/_next/static/chunks/0hra80eyuu37u.js +1 -0
- package/dist/web/_next/static/chunks/0i39jifmxla7q.js +1 -0
- package/dist/web/_next/static/chunks/0ie7y4k2ncvnn.js +1 -0
- package/dist/web/_next/static/chunks/0igc~uli58ncw.js +2 -0
- package/dist/web/_next/static/chunks/0kof5qdg8c2-k.js +71 -0
- package/dist/web/_next/static/chunks/{08o-zmr-40r5g.js → 0m11vvph7q94-.js} +1 -1
- package/dist/web/_next/static/chunks/0msb2mi3hiu5_.js +67 -0
- package/dist/web/_next/static/chunks/0np.d~hc1-pmh.js +4 -0
- package/dist/web/_next/static/chunks/{0qpq0~_58fe9a.js → 0oaq67r7ix.vg.js} +1 -1
- package/dist/web/_next/static/chunks/0ogpc3f3keopc.js +3 -0
- package/dist/web/_next/static/chunks/{0d_dp_4ofz0l3.css → 0ojcao3hdm36s.css} +0 -1
- package/dist/web/_next/static/chunks/0p1n8bvfnpl41.js +1 -0
- package/dist/web/_next/static/chunks/{0gig.k.rq8d0x.js → 0ppr271hz0xoq.js} +1 -1
- package/dist/web/_next/static/chunks/0s_dva~eh2yhi.js +3 -0
- package/dist/web/_next/static/chunks/0typj55ox8d5i.js +1 -0
- package/dist/web/_next/static/chunks/0w2p4ldi2aymp.js +1 -0
- package/dist/web/_next/static/chunks/{0..g0jl-8qup7.js → 0xoo17yef_b8g.js} +1 -1
- package/dist/web/_next/static/chunks/0xt-8wk21gs7g.js +1 -0
- package/dist/web/_next/static/chunks/0y09i51u6ixq5.js +1 -0
- package/dist/web/_next/static/chunks/0za1r07-6az6w.js +1 -0
- package/dist/web/_next/static/chunks/0zc0xgp5ourcn.js +1 -0
- package/dist/web/_next/static/chunks/0zmhdridea1s5.js +90 -0
- package/dist/web/_next/static/chunks/0~u.5r3-t7179.js +1 -0
- package/dist/web/_next/static/chunks/10.alq.6stmld.js +1 -0
- package/dist/web/_next/static/chunks/11-czmcci_55y.js +1 -0
- package/dist/web/_next/static/chunks/11b3zgk1etlkw.js +7 -0
- package/dist/web/_next/static/chunks/11k-.49r~1mfm.js +1 -0
- package/dist/web/_next/static/chunks/11qp8r5dotf7d.js +1 -0
- package/dist/web/_next/static/chunks/{0k.8qdk7oi_os.js → 128ugqd34tr_-.js} +1 -1
- package/dist/web/_next/static/chunks/12mxlicp247c8.js +1 -0
- package/dist/web/_next/static/chunks/135w27dd8c19s.js +5 -0
- package/dist/web/_next/static/chunks/13~y-b.b9rrw4.js +1 -0
- package/dist/web/_next/static/chunks/{0jokpgh485~28.js → 14hqmid8q4apf.js} +11 -11
- package/dist/web/_next/static/chunks/16sg-lflc8csx.js +1 -0
- package/dist/web/_next/static/chunks/176dc-dtokxxi.js +16 -0
- package/dist/web/_next/static/chunks/17g-0pqre.anw.js +1 -0
- package/dist/web/_next/static/chunks/17oc2l.ekcs8b.css +1 -0
- package/dist/web/_next/static/chunks/{turbopack-0lrdxynxb9-1t.js → turbopack-0ndm2zc_pdptk.js} +1 -1
- package/dist/web/_not-found/__next._full.txt +29 -30
- package/dist/web/_not-found/__next._head.txt +4 -4
- package/dist/web/_not-found/__next._index.txt +13 -13
- package/dist/web/_not-found/__next._not-found.__PAGE__.txt +2 -2
- package/dist/web/_not-found/__next._not-found.txt +3 -3
- package/dist/web/_not-found/__next._tree.txt +2 -2
- package/dist/web/_not-found.html +1 -1
- package/dist/web/_not-found.txt +29 -30
- package/dist/web/index.html +1 -1
- package/dist/web/index.txt +25 -24
- package/dist/web/login/__next._full.txt +29 -29
- package/dist/web/login/__next._head.txt +4 -4
- package/dist/web/login/__next._index.txt +13 -13
- package/dist/web/login/__next._tree.txt +2 -2
- package/dist/web/login/__next.login.__PAGE__.txt +4 -4
- package/dist/web/login/__next.login.txt +3 -3
- package/dist/web/login.html +1 -1
- package/dist/web/login.txt +29 -29
- package/dist/web/settings/__next._full.txt +28 -28
- package/dist/web/settings/__next._head.txt +4 -4
- package/dist/web/settings/__next._index.txt +13 -13
- package/dist/web/settings/__next._tree.txt +2 -2
- package/dist/web/settings/__next.settings.__PAGE__.txt +4 -4
- package/dist/web/settings/__next.settings.txt +5 -5
- package/dist/web/settings/agents/__next._full.txt +24 -24
- package/dist/web/settings/agents/__next._head.txt +4 -4
- package/dist/web/settings/agents/__next._index.txt +13 -13
- package/dist/web/settings/agents/__next._tree.txt +2 -2
- package/dist/web/settings/agents/__next.settings.agents.__PAGE__.txt +4 -4
- package/dist/web/settings/agents/__next.settings.agents.txt +3 -3
- package/dist/web/settings/agents/__next.settings.txt +5 -5
- package/dist/web/settings/agents.html +1 -1
- package/dist/web/settings/agents.txt +24 -24
- package/dist/web/settings/mcps/__next._full.txt +24 -24
- package/dist/web/settings/mcps/__next._head.txt +4 -4
- package/dist/web/settings/mcps/__next._index.txt +13 -13
- package/dist/web/settings/mcps/__next._tree.txt +2 -2
- package/dist/web/settings/mcps/__next.settings.mcps.__PAGE__.txt +4 -4
- package/dist/web/settings/mcps/__next.settings.mcps.txt +3 -3
- package/dist/web/settings/mcps/__next.settings.txt +5 -5
- package/dist/web/settings/mcps.html +1 -1
- package/dist/web/settings/mcps.txt +24 -24
- package/dist/web/settings/models/__next._full.txt +24 -24
- package/dist/web/settings/models/__next._head.txt +4 -4
- package/dist/web/settings/models/__next._index.txt +13 -13
- package/dist/web/settings/models/__next._tree.txt +2 -2
- package/dist/web/settings/models/__next.settings.models.__PAGE__.txt +4 -4
- package/dist/web/settings/models/__next.settings.models.txt +3 -3
- package/dist/web/settings/models/__next.settings.txt +5 -5
- package/dist/web/settings/models.html +1 -1
- package/dist/web/settings/models.txt +24 -24
- package/dist/web/settings/output-styles/__next._full.txt +43 -0
- package/dist/web/settings/output-styles/__next._head.txt +6 -0
- package/dist/web/settings/output-styles/__next._index.txt +15 -0
- package/dist/web/settings/output-styles/__next._tree.txt +8 -0
- package/dist/web/settings/output-styles/__next.settings.output-styles.__PAGE__.txt +9 -0
- package/dist/web/settings/output-styles/__next.settings.output-styles.txt +5 -0
- package/dist/web/settings/output-styles/__next.settings.txt +7 -0
- package/dist/web/settings/output-styles.html +1 -0
- package/dist/web/settings/output-styles.txt +43 -0
- package/dist/web/settings/prompts/__next._full.txt +24 -24
- package/dist/web/settings/prompts/__next._head.txt +4 -4
- package/dist/web/settings/prompts/__next._index.txt +13 -13
- package/dist/web/settings/prompts/__next._tree.txt +2 -2
- package/dist/web/settings/prompts/__next.settings.prompts.__PAGE__.txt +4 -4
- package/dist/web/settings/prompts/__next.settings.prompts.txt +3 -3
- package/dist/web/settings/prompts/__next.settings.txt +5 -5
- package/dist/web/settings/prompts.html +1 -1
- package/dist/web/settings/prompts.txt +24 -24
- package/dist/web/settings/providers/__next._full.txt +24 -24
- package/dist/web/settings/providers/__next._head.txt +4 -4
- package/dist/web/settings/providers/__next._index.txt +13 -13
- package/dist/web/settings/providers/__next._tree.txt +2 -2
- package/dist/web/settings/providers/__next.settings.providers.__PAGE__.txt +4 -4
- package/dist/web/settings/providers/__next.settings.providers.txt +3 -3
- package/dist/web/settings/providers/__next.settings.txt +5 -5
- package/dist/web/settings/providers.html +1 -1
- package/dist/web/settings/providers.txt +24 -24
- package/dist/web/settings/skills/__next._full.txt +24 -24
- package/dist/web/settings/skills/__next._head.txt +4 -4
- package/dist/web/settings/skills/__next._index.txt +13 -13
- package/dist/web/settings/skills/__next._tree.txt +2 -2
- package/dist/web/settings/skills/__next.settings.skills.__PAGE__.txt +4 -4
- package/dist/web/settings/skills/__next.settings.skills.txt +3 -3
- package/dist/web/settings/skills/__next.settings.txt +5 -5
- package/dist/web/settings/skills.html +1 -1
- package/dist/web/settings/skills.txt +24 -24
- package/dist/web/settings.html +1 -1
- package/dist/web/settings.txt +28 -28
- package/dist/web/workflows/__next._full.txt +32 -31
- package/dist/web/workflows/__next._head.txt +4 -4
- package/dist/web/workflows/__next._index.txt +13 -13
- package/dist/web/workflows/__next._tree.txt +2 -2
- package/dist/web/workflows/__next.workflows.__PAGE__.txt +4 -4
- package/dist/web/workflows/__next.workflows.txt +3 -3
- package/dist/web/workflows.html +1 -1
- package/dist/web/workflows.txt +32 -31
- package/dist/web/workspace/_/__next._full.txt +30 -71
- package/dist/web/workspace/_/__next._head.txt +4 -4
- package/dist/web/workspace/_/__next._index.txt +13 -13
- package/dist/web/workspace/_/__next._tree.txt +2 -17
- package/dist/web/workspace/_/__next.workspace.$d$id.__PAGE__.txt +3 -18
- package/dist/web/workspace/_/__next.workspace.$d$id.txt +3 -3
- package/dist/web/workspace/_/__next.workspace.txt +3 -3
- package/dist/web/workspace/_.html +1 -1
- package/dist/web/workspace/_.txt +30 -71
- package/dist/web/workspaces/__next._full.txt +31 -32
- package/dist/web/workspaces/__next._head.txt +4 -4
- package/dist/web/workspaces/__next._index.txt +13 -13
- package/dist/web/workspaces/__next._tree.txt +2 -2
- package/dist/web/workspaces/__next.workspaces.__PAGE__.txt +4 -4
- package/dist/web/workspaces/__next.workspaces.txt +3 -3
- package/dist/web/workspaces.html +1 -1
- package/dist/web/workspaces.txt +31 -32
- package/dist/ws/agent-runner.js +4 -2
- package/package.json +1 -1
- package/public/output-styles/carmack-mode.md +381 -0
- package/public/output-styles/codex-rigor-mode.md +114 -0
- package/public/output-styles/dhh-mode.md +265 -0
- package/public/output-styles/evan-you-mode.md +539 -0
- package/public/output-styles/index.json +37 -0
- package/public/output-styles/jobs-mode.md +369 -0
- package/public/output-styles/linus-mode.md +135 -0
- package/public/output-styles/uncle-bob-mode.md +221 -0
- package/public/prompt/andrej-karpathy-skills.md +65 -0
- package/public/prompt/claude-token-efficient-coding.md +35 -0
- package/public/prompt/index.json +12 -0
- package/public/skills/index.json +92 -0
- package/public/skills/planning-with-files/planning-with-files-zh/SKILL.md +243 -0
- package/public/skills/planning-with-files/planning-with-files-zh/scripts/check-complete.ps1 +44 -0
- package/public/skills/planning-with-files/planning-with-files-zh/scripts/check-complete.sh +46 -0
- package/public/skills/planning-with-files/planning-with-files-zh/scripts/init-session.ps1 +124 -0
- package/public/skills/planning-with-files/planning-with-files-zh/scripts/init-session.sh +124 -0
- package/public/skills/planning-with-files/planning-with-files-zh/scripts/session-catchup.py +438 -0
- package/public/skills/planning-with-files/planning-with-files-zh/templates/findings.md +29 -0
- package/public/skills/planning-with-files/planning-with-files-zh/templates/progress.md +40 -0
- package/public/skills/planning-with-files/planning-with-files-zh/templates/task_plan.md +58 -0
- package/public/skills/superpowers/brainstorming/SKILL.md +164 -0
- package/public/skills/superpowers/brainstorming/scripts/frame-template.html +214 -0
- package/public/skills/superpowers/brainstorming/scripts/helper.js +88 -0
- package/public/skills/superpowers/brainstorming/scripts/server.cjs +354 -0
- package/public/skills/superpowers/brainstorming/scripts/start-server.sh +148 -0
- package/public/skills/superpowers/brainstorming/scripts/stop-server.sh +56 -0
- package/public/skills/superpowers/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/public/skills/superpowers/brainstorming/visual-companion.md +287 -0
- package/public/skills/superpowers/dispatching-parallel-agents/SKILL.md +182 -0
- package/public/skills/superpowers/executing-plans/SKILL.md +70 -0
- package/public/skills/superpowers/finishing-a-development-branch/SKILL.md +251 -0
- package/public/skills/superpowers/receiving-code-review/SKILL.md +213 -0
- package/public/skills/superpowers/requesting-code-review/SKILL.md +103 -0
- package/public/skills/superpowers/requesting-code-review/code-reviewer.md +168 -0
- package/public/skills/superpowers/subagent-driven-development/SKILL.md +279 -0
- package/public/skills/superpowers/subagent-driven-development/code-quality-reviewer-prompt.md +25 -0
- package/public/skills/superpowers/subagent-driven-development/implementer-prompt.md +113 -0
- package/public/skills/superpowers/subagent-driven-development/spec-reviewer-prompt.md +61 -0
- package/public/skills/superpowers/systematic-debugging/CREATION-LOG.md +119 -0
- package/public/skills/superpowers/systematic-debugging/SKILL.md +296 -0
- package/public/skills/superpowers/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/public/skills/superpowers/systematic-debugging/condition-based-waiting.md +115 -0
- package/public/skills/superpowers/systematic-debugging/defense-in-depth.md +122 -0
- package/public/skills/superpowers/systematic-debugging/find-polluter.sh +63 -0
- package/public/skills/superpowers/systematic-debugging/root-cause-tracing.md +169 -0
- package/public/skills/superpowers/systematic-debugging/test-academic.md +14 -0
- package/public/skills/superpowers/systematic-debugging/test-pressure-1.md +58 -0
- package/public/skills/superpowers/systematic-debugging/test-pressure-2.md +68 -0
- package/public/skills/superpowers/systematic-debugging/test-pressure-3.md +69 -0
- package/public/skills/superpowers/test-driven-development/SKILL.md +371 -0
- package/public/skills/superpowers/test-driven-development/testing-anti-patterns.md +299 -0
- package/public/skills/superpowers/using-git-worktrees/SKILL.md +215 -0
- package/public/skills/superpowers/using-superpowers/SKILL.md +117 -0
- package/public/skills/superpowers/using-superpowers/references/codex-tools.md +59 -0
- package/public/skills/superpowers/using-superpowers/references/copilot-tools.md +42 -0
- package/public/skills/superpowers/using-superpowers/references/gemini-tools.md +51 -0
- package/public/skills/superpowers/verification-before-completion/SKILL.md +139 -0
- package/public/skills/superpowers/writing-plans/SKILL.md +152 -0
- package/public/skills/superpowers/writing-plans/plan-document-reviewer-prompt.md +49 -0
- package/public/skills/superpowers/writing-skills/SKILL.md +655 -0
- package/public/skills/superpowers/writing-skills/anthropic-best-practices.md +1150 -0
- package/public/skills/superpowers/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
- package/public/skills/superpowers/writing-skills/graphviz-conventions.dot +172 -0
- package/public/skills/superpowers/writing-skills/persuasion-principles.md +187 -0
- package/public/skills/superpowers/writing-skills/render-graphs.js +168 -0
- package/public/skills/superpowers/writing-skills/testing-skills-with-subagents.md +384 -0
- package/dist/web/_next/static/chunks/0-81wi7xr2nd-.js +0 -270
- package/dist/web/_next/static/chunks/00lca9lsasdm7.js +0 -1
- package/dist/web/_next/static/chunks/01gi~q0c6ez6..js +0 -1
- package/dist/web/_next/static/chunks/02shswpmybici.js +0 -1
- package/dist/web/_next/static/chunks/05tx6hzdtkgi9.js +0 -2
- package/dist/web/_next/static/chunks/07nbyndvzftr1.js +0 -3
- package/dist/web/_next/static/chunks/0bn~onkv~9xza.js +0 -1
- package/dist/web/_next/static/chunks/0g-0n6glz_z6w.js +0 -1
- package/dist/web/_next/static/chunks/0gyede80jpy3n.js +0 -4
- package/dist/web/_next/static/chunks/0hrbuvzuxrjfl.js +0 -1
- package/dist/web/_next/static/chunks/0i51q.5s_-.vh.css +0 -1
- package/dist/web/_next/static/chunks/0qf163pbrwy4z.js +0 -1
- package/dist/web/_next/static/chunks/0rnt-f3pjxb-d.js +0 -5
- package/dist/web/_next/static/chunks/0tgbcgsca9mrg.js +0 -1
- package/dist/web/_next/static/chunks/0tyhv6.y7~yxd.js +0 -1
- package/dist/web/_next/static/chunks/0u7_qd9hzqwac.js +0 -1
- package/dist/web/_next/static/chunks/0vuvql8rloda5.js +0 -1
- package/dist/web/_next/static/chunks/0wv0h27jafag4.js +0 -1
- package/dist/web/_next/static/chunks/0wwvc4zc2q6bn.js +0 -1
- package/dist/web/_next/static/chunks/0xmmk3vebw8xs.js +0 -1
- package/dist/web/_next/static/chunks/0xwqf.llmm_u2.js +0 -31
- package/dist/web/_next/static/chunks/0yo22_w53mo~5.js +0 -1
- package/dist/web/_next/static/chunks/12c0jp0qvlr1t.js +0 -1
- package/dist/web/_next/static/chunks/12pg1nn3v~~5k.js +0 -1
- package/dist/web/_next/static/chunks/16cyr8ilpx1nn.js +0 -1
- package/public/avatars/1777813826407-bea0ja-minimax.svg +0 -1
- package/public/avatars/1777813967088-3xlvd0-minimax.svg +0 -1
- package/public/avatars/1777814041714-yp0qeq-minimax.svg +0 -1
- package/public/avatars/1777904986095-rg26je-icon.png +0 -0
- package/public/avatars/1778953228323-5je54x-user.jpg +0 -0
- package/public/avatars/1778954057880-g01q6y-user.jpg +0 -0
- /package/dist/web/_next/static/{GS3b40oeaeLxm7i9-ibaj → OoXAsPtrUWjC1l898FSvI}/_buildManifest.js +0 -0
- /package/dist/web/_next/static/{GS3b40oeaeLxm7i9-ibaj → OoXAsPtrUWjC1l898FSvI}/_clientMiddlewareManifest.js +0 -0
- /package/dist/web/_next/static/{GS3b40oeaeLxm7i9-ibaj → OoXAsPtrUWjC1l898FSvI}/_ssgManifest.js +0 -0
- /package/public/avatars/{1777815865622-08wp9m-user.jpg → user.jpg} +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,161316,t=>{"use strict";var e,i,o,s,a,n=t.i(344180),r=t.i(887836),l=t.i(764556),d=l,h=t.i(106206),u=t.i(51190),c=class t{static HORZ=new t("horz");static VERT=new t("vert");static flip(e){return e===t.HORZ?t.VERT:t.HORZ}_name;constructor(t){this._name=t}getName(){return this._name}toString(){return this._name}},g=class t{static empty(){return new t(0,0,0,0)}static fromJson(e){return new t(e.x,e.y,e.width,e.height)}x;y;width;height;constructor(t,e,i,o){this.x=t,this.y=e,this.width=i,this.height=o}toJson(){return{x:this.x,y:this.y,width:this.width,height:this.height}}snap(t){this.x=Math.round(this.x/t)*t,this.y=Math.round(this.y/t)*t,this.width=Math.round(this.width/t)*t,this.height=Math.round(this.height/t)*t}static getBoundingClientRect(e){let{x:i,y:o,width:s,height:a}=e.getBoundingClientRect();return new t(i,o,s,a)}static getContentRect(e){let i=e.getBoundingClientRect(),o=window.getComputedStyle(e),s=parseFloat(o.paddingLeft),a=parseFloat(o.paddingRight),n=parseFloat(o.paddingTop),r=parseFloat(o.paddingBottom),l=parseFloat(o.borderLeftWidth),d=parseFloat(o.borderRightWidth),h=parseFloat(o.borderTopWidth),u=parseFloat(o.borderBottomWidth),c=i.width-l-s-a-d,g=i.height-h-n-r-u;return new t(i.left+l+s,i.top+h+n,c,g)}static fromDomRect(e){return new t(e.x,e.y,e.width,e.height)}relativeTo(e){return new t(this.x-e.x,this.y-e.y,this.width,this.height)}clone(){return new t(this.x,this.y,this.width,this.height)}equals(t){return this.x===t?.x&&this.y===t?.y&&this.width===t?.width&&this.height===t?.height}equalsWhenRounded(t){return!!t&&.5>Math.abs(this.x-t.x)&&.5>Math.abs(this.y-t.y)&&.5>Math.abs(this.width-t.width)&&.5>Math.abs(this.height-t.height)}equalSize(t){return this.width===t?.width&&this.height===t?.height}getBottom(){return this.y+this.height}getRight(){return this.x+this.width}get bottom(){return this.y+this.height}get right(){return this.x+this.width}getCenter(){return{x:this.x+this.width/2,y:this.y+this.height/2}}positionElement(t,e){this.styleWithPosition(t.style,e)}styleWithPosition(t,e="absolute"){return t.left=this.x+"px",t.top=this.y+"px",t.width=Math.max(0,this.width)+"px",t.height=Math.max(0,this.height)+"px",t.position=e,t}contains(t,e){return!!(this.x<=t&&t<=this.getRight()&&this.y<=e&&e<=this.getBottom())}removeInsets(e){return new t(this.x+e.left,this.y+e.top,Math.max(0,this.width-e.left-e.right),Math.max(0,this.height-e.top-e.bottom))}centerInRect(t){this.x=(t.width-this.width)/2,this.y=(t.height-this.height)/2}clamp(t){this.width>t.width&&(this.width=t.width),this.height>t.height&&(this.height=t.height),this.x<t.x&&(this.x=t.x),this.y<t.y&&(this.y=t.y),this.getRight()>t.getRight()&&(this.x=t.getRight()-this.width),this.getBottom()>t.getBottom()&&(this.y=t.getBottom()-this.height),this.x<t.x&&(this.x=t.x),this.y<t.y&&(this.y=t.y)}_getSize(t){let e=this.width;return t===c.VERT&&(e=this.height),e}toString(){return"(Rect: x="+this.x+", y="+this.y+", width="+this.width+", height="+this.height+")"}},_=class t{static values=new Map;static TOP=new t("top",c.VERT,0);static BOTTOM=new t("bottom",c.VERT,1);static LEFT=new t("left",c.HORZ,0);static RIGHT=new t("right",c.HORZ,1);static CENTER=new t("center",c.VERT,0);static getByName(e){return t.values.get(e)}static getLocation(e,i,o){if(i=(i-e.x)/e.width,o=(o-e.y)/e.height,i>=.25&&i<.75&&o>=.25&&o<.75)return t.CENTER;let s=o>=i,a=o>=1-i;return s?a?t.BOTTOM:t.LEFT:a?t.RIGHT:t.TOP}name;orientation;indexPlus;constructor(e,i,o){this.name=e,this.orientation=i,this.indexPlus=o,t.values.set(this.name,this)}getName(){return this.name}getOrientation(){return this.orientation}getDockRect(e){return this===t.TOP?new g(e.x,e.y,e.width,e.height/2):this===t.BOTTOM?new g(e.x,e.getBottom()-e.height/2,e.width,e.height/2):this===t.LEFT?new g(e.x,e.y,e.width/2,e.height):this===t.RIGHT?new g(e.getRight()-e.width/2,e.y,e.width/2,e.height):e.clone()}split(e,i){return this===t.TOP?{start:new g(e.x,e.y,e.width,i),end:new g(e.x,e.y+i,e.width,e.height-i)}:this===t.LEFT?{start:new g(e.x,e.y,i,e.height),end:new g(e.x+i,e.y,e.width-i,e.height)}:this===t.RIGHT?{start:new g(e.getRight()-i,e.y,i,e.height),end:new g(e.x,e.y,e.width-i,e.height)}:{start:new g(e.x,e.getBottom()-i,e.width,i),end:new g(e.x,e.y,e.width,e.height-i)}}reflect(){return this===t.TOP?t.BOTTOM:this===t.LEFT?t.RIGHT:this===t.RIGHT?t.LEFT:t.TOP}toString(){return"(DockLocation: name="+this.name+", orientation="+this.orientation+")"}},T=((e={}).FLEXLAYOUT__BORDER="flexlayout__border",e.FLEXLAYOUT__BORDER_="flexlayout__border_",e.FLEXLAYOUT__BORDER_TAB_CONTENTS="flexlayout__border_tab_contents",e.FLEXLAYOUT__BORDER_BUTTON="flexlayout__border_button",e.FLEXLAYOUT__BORDER_BUTTON_="flexlayout__border_button_",e.FLEXLAYOUT__BORDER_BUTTON_CONTENT="flexlayout__border_button_content",e.FLEXLAYOUT__BORDER_BUTTON_LEADING="flexlayout__border_button_leading",e.FLEXLAYOUT__BORDER_BUTTON_TRAILING="flexlayout__border_button_trailing",e.FLEXLAYOUT__BORDER_BUTTON__SELECTED="flexlayout__border_button--selected",e.FLEXLAYOUT__BORDER_BUTTON__UNSELECTED="flexlayout__border_button--unselected",e.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW="flexlayout__border_toolbar_button_overflow",e.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW_="flexlayout__border_toolbar_button_overflow_",e.FLEXLAYOUT__BORDER_INNER="flexlayout__border_inner",e.FLEXLAYOUT__BORDER_INNER_="flexlayout__border_inner_",e.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER="flexlayout__border_inner_tab_container",e.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER_="flexlayout__border_inner_tab_container_",e.FLEXLAYOUT__BORDER_TAB_DIVIDER="flexlayout__border_tab_divider",e.FLEXLAYOUT__BORDER_LEADING="flexlayout__border_leading",e.FLEXLAYOUT__BORDER_SIZER="flexlayout__border_sizer",e.FLEXLAYOUT__BORDER_TOOLBAR="flexlayout__border_toolbar",e.FLEXLAYOUT__BORDER_TOOLBAR_="flexlayout__border_toolbar_",e.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON="flexlayout__border_toolbar_button",e.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_FLOAT="flexlayout__border_toolbar_button-float",e.FLEXLAYOUT__DRAG_RECT="flexlayout__drag_rect",e.FLEXLAYOUT__EDGE_RECT="flexlayout__edge_rect",e.FLEXLAYOUT__EDGE_RECT_TOP="flexlayout__edge_rect_top",e.FLEXLAYOUT__EDGE_RECT_LEFT="flexlayout__edge_rect_left",e.FLEXLAYOUT__EDGE_RECT_BOTTOM="flexlayout__edge_rect_bottom",e.FLEXLAYOUT__EDGE_RECT_RIGHT="flexlayout__edge_rect_right",e.FLEXLAYOUT__ERROR_BOUNDARY_CONTAINER="flexlayout__error_boundary_container",e.FLEXLAYOUT__ERROR_BOUNDARY_CONTENT="flexlayout__error_boundary_content",e.FLEXLAYOUT__FLOAT_WINDOW="flexlayout__float_window",e.FLEXLAYOUT__FLOAT_WINDOW_HEADER="flexlayout__float_window_header",e.FLEXLAYOUT__FLOAT_WINDOW_CONTENT="flexlayout__float_window_content",e.FLEXLAYOUT__FLOATING_WINDOW_CONTENT="flexlayout__floating_window_content",e.FLEXLAYOUT__LAYOUT="flexlayout__layout",e.FLEXLAYOUT__LAYOUT_MOVEABLES="flexlayout__layout_moveables",e.FLEXLAYOUT__LAYOUT_OVERLAY="flexlayout__layout_overlay",e.FLEXLAYOUT__LAYOUT_TAB_STAMPS="flexlayout__layout_tab_stamps",e.FLEXLAYOUT__LAYOUT_MAIN="flexlayout__layout_main",e.FLEXLAYOUT__LAYOUT_BORDER_CONTAINER="flexlayout__layout_border_container",e.FLEXLAYOUT__LAYOUT_BORDER_CONTAINER_INNER="flexlayout__layout_border_container_inner",e.FLEXLAYOUT__OUTLINE_RECT="flexlayout__outline_rect",e.FLEXLAYOUT__OUTLINE_RECT_EDGE="flexlayout__outline_rect_edge",e.FLEXLAYOUT__SPLITTER="flexlayout__splitter",e.FLEXLAYOUT__SPLITTER_EXTRA="flexlayout__splitter_extra",e.FLEXLAYOUT__SPLITTER_="flexlayout__splitter_",e.FLEXLAYOUT__SPLITTER_BORDER="flexlayout__splitter_border",e.FLEXLAYOUT__SPLITTER_DRAG="flexlayout__splitter_drag",e.FLEXLAYOUT__SPLITTER_HANDLE="flexlayout__splitter_handle",e.FLEXLAYOUT__SPLITTER_HANDLE_HORZ="flexlayout__splitter_handle_horz",e.FLEXLAYOUT__SPLITTER_HANDLE_VERT="flexlayout__splitter_handle_vert",e.FLEXLAYOUT__ROW="flexlayout__row",e.FLEXLAYOUT__TAB="flexlayout__tab",e.FLEXLAYOUT__TAB_POSITION="flexlayout__tab_position",e.FLEXLAYOUT__TAB_MOVEABLE="flexlayout__tab_moveable",e.FLEXLAYOUT__TAB_OVERLAY="flexlayout__tab_overlay",e.FLEXLAYOUT__TAB_LAYOUT_CONTAINER="flexlayout__tab_layout_container",e.FLEXLAYOUT__TAB_LAYOUT_CONTAINER_USER="flexlayout__tab_layout_container_user",e.FLEXLAYOUT__TABSET="flexlayout__tabset",e.FLEXLAYOUT__TABSET_CONTAINER="flexlayout__tabset_container",e.FLEXLAYOUT__TABSET_MAXIMIZED="flexlayout__tabset-maximized",e.FLEXLAYOUT__TABSET_SELECTED="flexlayout__tabset-selected",e.FLEXLAYOUT__TABSET_TAB_SPACER="flexlayout__tabset_tab_spacer",e.FLEXLAYOUT__TABSET_TAB_DIVIDER="flexlayout__tabset_tab_divider",e.FLEXLAYOUT__TABSET_TAB_DIVIDER_SELECTED_BEFORE="flexlayout__tabset_tab_divider_selected_before",e.FLEXLAYOUT__TABSET_TAB_DIVIDER_SELECTED_AFTER="flexlayout__tabset_tab_divider_selected_after",e.FLEXLAYOUT__TABSET_TAB_DIVIDER_INNER="flexlayout__tabset_tab_divider_inner",e.FLEXLAYOUT__TABSET_CONTENT="flexlayout__tabset_content",e.FLEXLAYOUT__TABSET_TABBAR_INNER="flexlayout__tabset_tabbar_inner",e.FLEXLAYOUT__TABSET_TABBAR_INNER_="flexlayout__tabset_tabbar_inner_",e.FLEXLAYOUT__TABSET_LEADING="flexlayout__tabset_leading",e.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER="flexlayout__tabset_tabbar_inner_tab_container",e.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER_="flexlayout__tabset_tabbar_inner_tab_container_",e.FLEXLAYOUT__TABSET_TABBAR_OUTER="flexlayout__tabset_tabbar_outer",e.FLEXLAYOUT__TABSET_TABBAR_OUTER_="flexlayout__tabset_tabbar_outer_",e.FLEXLAYOUT__TAB_BORDER="flexlayout__tab_border",e.FLEXLAYOUT__TAB_BORDER_="flexlayout__tab_border_",e.FLEXLAYOUT__TAB_BUTTON="flexlayout__tab_button",e.FLEXLAYOUT__TAB_BUTTON_STRETCH="flexlayout__tab_button_stretch",e.FLEXLAYOUT__TAB_BUTTON_CONTENT="flexlayout__tab_button_content",e.FLEXLAYOUT__TAB_BUTTON_LEADING="flexlayout__tab_button_leading",e.FLEXLAYOUT__TAB_BUTTON_OVERFLOW="flexlayout__tab_button_overflow",e.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT="flexlayout__tab_button_overflow_count",e.FLEXLAYOUT__TAB_BUTTON_TEXTBOX="flexlayout__tab_button_textbox",e.FLEXLAYOUT__TAB_BUTTON_TRAILING="flexlayout__tab_button_trailing",e.FLEXLAYOUT__TAB_BUTTON_STAMP="flexlayout__tab_button_stamp",e.FLEXLAYOUT__TAB_TOOLBAR="flexlayout__tab_toolbar",e.FLEXLAYOUT__TAB_TOOLBAR_BUTTON="flexlayout__tab_toolbar_button",e.FLEXLAYOUT__TAB_TOOLBAR_ICON="flexlayout__tab_toolbar_icon",e.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_="flexlayout__tab_toolbar_button-",e.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_FLOAT="flexlayout__tab_toolbar_button-float",e.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER="flexlayout__tab_toolbar_sticky_buttons_container",e.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE="flexlayout__tab_toolbar_button-close",e.FLEXLAYOUT__POPUP_MENU_CONTAINER="flexlayout__popup_menu_container",e.FLEXLAYOUT__POPUP_MENU_ITEM="flexlayout__popup_menu_item",e.FLEXLAYOUT__POPUP_MENU_ITEM__SELECTED="flexlayout__popup_menu_item--selected",e.FLEXLAYOUT__POPUP_MENU="flexlayout__popup_menu",e.FLEXLAYOUT__MINI_SCROLLBAR="flexlayout__mini_scrollbar",e.FLEXLAYOUT__MINI_SCROLLBAR_CONTAINER="flexlayout__mini_scrollbar_container",e),p=class t{static ADD_TAB="FlexLayout_AddTab";static DELETE_TAB="FlexLayout_DeleteTab";static RENAME_TAB="FlexLayout_RenameTab";static SELECT_TAB="FlexLayout_SelectTab";static MOVE_NODE="FlexLayout_MoveNode";static DELETE_TABSET="FlexLayout_DeleteTabset";static SET_ACTIVE_TABSET="FlexLayout_SetActiveTabset";static ADJUST_WEIGHTS="FlexLayout_AdjustWeights";static ADJUST_BORDER_SPLIT="FlexLayout_AdjustBorderSplit";static MAXIMIZE_TOGGLE="FlexLayout_MaximizeToggle";static UPDATE_MODEL_ATTRIBUTES="FlexLayout_UpdateModelAttributes";static UPDATE_NODE_ATTRIBUTES="FlexLayout_UpdateNodeAttributes";static POPOUT_TAB="FlexLayout_PopoutTab";static POPOUT_TABSET="FlexLayout_PopoutTabset";static CLOSE_POPOUT="FlexLayout_ClosePopout";static MOVE_POPOUT_TO_FRONT="FlexLayout_MoveFloatToFront";static CREATE_SUBLAYOUT="FlexLayout_CreateSubLayout";static addTab(e,i,o,s,a){return new b(t.ADD_TAB,{json:e,toNode:i,location:o.getName(),index:s,select:a})}static addNode(t,e,i,o,s){return this.addTab(t,e,i,o,s)}static moveNode(e,i,o,s,a){return new b(t.MOVE_NODE,{fromNode:e,toNode:i,location:o.getName(),index:s,select:a})}static deleteTab(e){return new b(t.DELETE_TAB,{node:e})}static deleteTabset(e){return new b(t.DELETE_TABSET,{node:e})}static renameTab(e,i){return new b(t.RENAME_TAB,{node:e,text:i})}static selectTab(e){return new b(t.SELECT_TAB,{tabNode:e})}static setActiveTabset(e,i){return new b(t.SET_ACTIVE_TABSET,{tabsetNode:e,layoutId:i})}static adjustWeights(e,i){return new b(t.ADJUST_WEIGHTS,{nodeId:e,weights:i})}static adjustBorderSplit(e,i){return new b(t.ADJUST_BORDER_SPLIT,{node:e,size:i})}static maximizeToggle(e,i){return new b(t.MAXIMIZE_TOGGLE,{node:e,layoutId:i})}static updateModelAttributes(e){return new b(t.UPDATE_MODEL_ATTRIBUTES,{json:e})}static updateNodeAttributes(e,i){return new b(t.UPDATE_NODE_ATTRIBUTES,{node:e,json:i})}static popoutTab(e,i="window"){return new b(t.POPOUT_TAB,{node:e,type:i})}static popoutTabset(e,i="window"){return new b(t.POPOUT_TABSET,{node:e,type:i})}static closePopout(e){return new b(t.CLOSE_POPOUT,{layoutId:e})}static movePopoutToFront(e){return new b(t.MOVE_POPOUT_TO_FRONT,{layoutId:e})}static createPopout(t,e,i){return this.createSubLayout(t,e,i)}static createSubLayout(e,i,o){return new b(t.CREATE_SUBLAYOUT,{layout:e,rect:i,type:o})}},b=class{type;data;constructor(t,e){this.type=t,this.data=e}},E=class{attributes;nameToAttribute;constructor(){this.attributes=[],this.nameToAttribute=new Map}addWithAll(t,e,i,o){let s=new f(t,e,i,o);return this.attributes.push(s),this.nameToAttribute.set(t,s),s}addInherited(t,e){return this.addWithAll(t,e,void 0,!1)}add(t,e,i){return this.addWithAll(t,void 0,e,i)}getAttributes(){return this.attributes}getModelName(t){let e=this.nameToAttribute.get(t);if(void 0!==e)return e.modelName}toJson(t,e){for(let i of this.attributes){let o=e[i.name];(i.alwaysWriteJson||o!==i.defaultValue)&&(t[i.name]=o)}}fromJson(t,e){for(let i of this.attributes){let o=t[i.name];void 0===o&&i.alias&&(o=t[i.alias]),void 0===o?e[i.name]=i.defaultValue:e[i.name]=o}}update(t,e){for(let i of this.attributes)if(Object.prototype.hasOwnProperty.call(t,i.name)){let o=t[i.name];void 0===o?delete e[i.name]:e[i.name]=o}}setDefaults(t){for(let e of this.attributes)t[e.name]=e.defaultValue}pairAttributes(t,e){for(let i of e.attributes)if(i.modelName&&this.nameToAttribute.has(i.modelName)){let e=this.nameToAttribute.get(i.modelName);e.setpairedAttr(i),i.setpairedAttr(e),e.setPairedType(t)}}toTypescriptInterface(t,e){let i=[],o=this.attributes.sort((t,e)=>t.name.localeCompare(e.name));i.push("export interface I"+t+"Attributes {");for(let t=0;t<o.length;t++){let s,a,n=o[t],r=n.type,l=n;void 0!==l.defaultValue?s=l.defaultValue:void 0!==l.modelName&&void 0!==e&&void 0!==e.nameToAttribute.get(l.modelName)&&(a=l.modelName,s=(l=e.nameToAttribute.get(a)).defaultValue,r=l.type);let d=JSON.stringify(s),h=l.required?"":"?",u=" /**\n ";n.description?u+=n.description:n.pairedType&&n.pairedAttr?.description&&(u+=`Value for ${n.pairedType} attribute ${n.pairedAttr.name} if not overridden`,u+="\n\n ",u+=n.pairedAttr?.description),u+="\n\n ",n.fixed?u+=`Fixed value: ${d}`:a?u+=`Default: inherited from Global attribute ${n.modelName} (default ${d})`:u+=`Default: ${d}`,u+="\n */",i.push(u),i.push(" "+n.name+h+": "+r+";\n")}return i.push("}"),i.join("\n")}},f=class{static NUMBER="number";static STRING="string";static BOOLEAN="boolean";name;alias;modelName;pairedAttr;pairedType;defaultValue;alwaysWriteJson;type;required;fixed;description;constructor(t,e,i,o){this.name=t,this.alias=void 0,this.modelName=e,this.defaultValue=i,this.alwaysWriteJson=o,this.required=!1,this.fixed=!1,this.type="any"}setType(t){return this.type=t,this}setAlias(t){return this.alias=t,this}setDescription(t){this.description=t}setRequired(){return this.required=!0,this}setFixed(){return this.fixed=!0,this}setpairedAttr(t){this.pairedAttr=t}setPairedType(t){this.pairedType=t}},m=class{node;rect;location;index;className;constructor(t,e,i,o,s){this.node=t,this.rect=e,this.location=i,this.index=o,this.className=s}},L=class{model;attributes;parent;children;rect;path;listeners;constructor(t){this.model=t,this.attributes={},this.children=[],this.rect=g.empty(),this.listeners=new Map,this.path=""}getId(){let t=this.attributes.id;return void 0!==t||(t=this.model.nextUniqueId(),this.setId(t)),t}getModel(){return this.model}getType(){return this.attributes.type}getParent(){return this.parent}getChildren(){return this.children}getRect(){return this.rect}getPath(){return this.path}isCloseable(){for(let t=0;t<this.children.length;t++)if(!this.children[t].isCloseable())return!1;return!0}isAllowedInWindow(){for(let t=0;t<this.children.length;t++)if(!this.children[t].isAllowedInWindow())return!1;return!0}getOrientation(){return void 0===this.parent?this.model.isRootOrientationVertical()?c.VERT:c.HORZ:c.flip(this.parent.getOrientation())}getLayoutId(){return this.getLayout().getLayoutId()}getLayout(){return this.parent?this.parent.getLayout():this.model.getMainLayout()}setEventListener(t,e){this.listeners.set(t,e)}removeEventListener(t){this.listeners.delete(t)}setId(t){this.attributes.id=t}fireEvent(t,e){this.listeners.has(t)&&this.listeners.get(t)(e)}getAttr(t){let e=this.attributes[t];if(void 0===e){let i=this.getAttributeDefinitions().getModelName(t);void 0!==i&&(e=this.model.getAttribute(i))}return e}forEachNode(t,e){for(let i of(t(this,e),e++,this.children))i.forEachNode(t,e)}setPaths(t){let e=0;for(let i of this.children){let o=t;"row"===i.getType()?o+="/r"+e:"tabset"===i.getType()?o+="/ts"+e:"tab"===i.getType()&&(o+="/t"+e),i.path=o,i.setPaths(o),e++}}setParent(t){this.parent=t}setRect(t){this.rect=t}setPath(t){this.path=t}setWeight(t){this.attributes.weight=t}setSelected(t){this.attributes.selected=t}findDropTargetNode(t,e,i,o){let s;if(this.rect.contains(i,o)){if(void 0!==this.model.getMaximizedTabset(t))s=this.model.getMaximizedTabset(t).canDrop(e,i,o);else if(void 0===(s=this.canDrop(e,i,o))&&0!==this.children.length){for(let a of this.children)if(void 0!==(s=a.findDropTargetNode(t,e,i,o)))break}}return s}canDrop(t,e,i){}canDockInto(t,e){if(null!=e){if(e.location===_.CENTER&&!1===e.node.isEnableDrop()||e.location===_.CENTER&&"tabset"===t.getType()&&!1===t.isEnableClose()||e.location!==_.CENTER&&!1===e.node.isEnableDivide())return!1;if(this.model.getOnAllowDrop())return this.model.getOnAllowDrop()(t,e)}return!0}removeChild(t){let e=this.children.indexOf(t);return -1!==e&&this.children.splice(e,1),e}addChild(t,e){return null!=e?this.children.splice(e,0,t):(this.children.push(t),e=this.children.length-1),t.parent=this,e}removeAll(){this.children=[]}styleWithPosition(t){return null==t&&(t={}),this.rect.styleWithPosition(t)}isEnableDivide(){return!0}toAttributeString(){return JSON.stringify(this.attributes,void 0," ")}},y=class t extends L{static TYPE="tab";static fromJson(e,i,o=!0){return new t(i,e,o)}tabRect=g.empty();moveableElement;renderedName;extra;visible;rendered;scrollTop;scrollLeft;tabStamp;constructor(e,i,o=!0){super(e),this.extra={},this.moveableElement=null,this.tabStamp=null,this.rendered=!1,this.visible=!1,t.attributeDefinitions.fromJson(i,this.attributes),!0===o&&e.addNode(this)}getName(){return this.getAttr("name")}getIcon(){return this.getAttr("icon")}getSubLayoutId(){return this.getAttr("subLayoutId")}getHelpText(){return this.getAttr("helpText")}getComponent(){return this.getAttr("component")}getWindowId(){let t=this.getLayout();if(t)return t.getWindowId()}getConfig(){return this.attributes.config}getExtraData(){return this.extra}isPoppedOut(){return this.getLayoutId()!==W.MAIN_LAYOUT_ID}isSelected(){return this.getParent().getSelectedNode()===this}isCloseable(){let t=this.isEnableClose();return t&&this.getSubLayoutId()&&(t=this.model.getLayouts().get(this.getSubLayoutId()).getRootRow().isCloseable()),t}isAllowedInWindow(){let t=this.isEnablePopout();return t&&this.getSubLayoutId()&&(t=this.model.getLayouts().get(this.getSubLayoutId()).getRootRow().isAllowedInWindow()),t}isEnableClose(){return this.getAttr("enableClose")}getCloseType(){return this.getAttr("closeType")}isEnablePopout(){return this.getAttr("enablePopout")}isEnablePopoutIcon(){return this.getAttr("enablePopoutIcon")}isEnablePopoutFloatIcon(){return this.getAttr("enablePopoutFloatIcon")}isEnablePopoutOverlay(){return this.getAttr("enablePopoutOverlay")}isEnableDrag(){return this.getAttr("enableDrag")}isEnableRename(){return this.getAttr("enableRename")}isEnableWindowReMount(){return this.getAttr("enableWindowReMount")}getClassName(){return this.getAttr("className")}getContentClassName(){return this.getAttr("contentClassName")}getTabSetClassName(){return this.getAttr("tabsetClassName")}isEnableRenderOnDemand(){return this.getAttr("enableRenderOnDemand")}getMinWidth(){return this.getAttr("minWidth")}getMinHeight(){return this.getAttr("minHeight")}getMaxWidth(){return this.getAttr("maxWidth")}getMaxHeight(){return this.getAttr("maxHeight")}isVisible(){return this.visible}toJson(){let e={};return t.attributeDefinitions.toJson(e,this.attributes),e}saveScrollPosition(){this.moveableElement&&(this.scrollLeft=this.moveableElement.scrollLeft,this.scrollTop=this.moveableElement.scrollTop)}restoreScrollPosition(){this.scrollTop&&requestAnimationFrame(()=>{this.moveableElement&&this.scrollTop&&(this.moveableElement.scrollTop=this.scrollTop,this.moveableElement.scrollLeft=this.scrollLeft)})}setRect(t){t.equals(this.rect)||(this.fireEvent("resize",{rect:t}),this.rect=t)}setVisible(t){t!==this.visible&&(this.visible=t,this.fireEvent("visibility",{visible:t}))}getScrollTop(){return this.scrollTop}setScrollTop(t){this.scrollTop=t}getScrollLeft(){return this.scrollLeft}setScrollLeft(t){this.scrollLeft=t}isRendered(){return this.rendered}setRendered(t){this.rendered=t}getTabRect(){return this.tabRect}setTabRect(t){this.tabRect=t}getTabStamp(){return this.tabStamp}setTabStamp(t){this.tabStamp=t}getMoveableElement(){return this.moveableElement}setMoveableElement(t){this.moveableElement=t}setRenderedName(t){this.renderedName=t}getNameForOverflowMenu(){let t=this.getAttr("altName");return void 0!==t?t:this.renderedName}setName(t){this.attributes.name=t}delete(){this.parent.remove(this),this.getSubLayoutId()&&this.model.getLayouts().delete(this.getSubLayoutId()),this.fireEvent("close",{})}updateAttrs(e){t.attributeDefinitions.update(e,this.attributes)}getAttributeDefinitions(){return t.attributeDefinitions}setBorderWidth(t){this.attributes.borderWidth=t}setBorderHeight(t){this.attributes.borderHeight=t}static getAttributeDefinitions(){return t.attributeDefinitions}static attributeDefinitions=t.createAttributeDefinitions();static createAttributeDefinitions(){let e=new E;return e.add("type",t.TYPE,!0).setType(f.STRING).setFixed(),e.add("id",void 0).setType(f.STRING).setDescription("the unique id of the tab, if left undefined a uuid will be assigned"),e.add("name","[Unnamed Tab]").setType(f.STRING).setDescription("name of tab to be displayed in the tab button"),e.add("component",void 0).setType(f.STRING).setDescription("string identifying which component to render in this tab (used in the layout factory function)"),e.add("subLayoutId",void 0).setType(f.STRING).setDescription(`the Id of the sub layout to render in this tab, defined in the subLayouts section of the model json (if
|
|
2
|
+
component is also defined then use the <TabLayout> component in the factory to render the sublayout)`),e.add("altName",void 0).setType(f.STRING).setDescription("if there is no name specifed then this value will be used in the overflow menu"),e.add("helpText",void 0).setType(f.STRING).setDescription("help text for the tab to be displayed upon tab hover."),e.add("config",void 0).setType("any").setDescription("a place to hold json config for the hosted component"),e.add("tabsetClassName",void 0).setType(f.STRING).setDescription("class applied to parent tabset when this is the only tab and it is stretched to fill the tabset"),e.add("enableWindowReMount",!1).setType(f.BOOLEAN).setDescription("if enabled the tab will re-mount when popped out/in"),e.addInherited("enableClose","tabEnableClose").setType(f.BOOLEAN).setDescription("allow user to close tab via close button"),e.addInherited("closeType","tabCloseType").setType("ICloseType").setDescription("see values in ICloseType"),e.addInherited("enableDrag","tabEnableDrag").setType(f.BOOLEAN).setDescription("allow user to drag tab to new location"),e.addInherited("enableRename","tabEnableRename").setType(f.BOOLEAN).setDescription("allow user to rename tabs by double clicking"),e.addInherited("className","tabClassName").setType(f.STRING).setDescription("class applied to tab button"),e.addInherited("contentClassName","tabContentClassName").setType(f.STRING).setDescription("class applied to tab content"),e.addInherited("icon","tabIcon").setType(f.STRING).setDescription("the tab icon"),e.addInherited("enableRenderOnDemand","tabEnableRenderOnDemand").setType(f.BOOLEAN).setDescription("whether to avoid rendering component until tab is visible"),e.addInherited("enablePopout","tabEnablePopout").setType(f.BOOLEAN).setAlias("enableFloat").setDescription("enable popout (in popout capable browser)"),e.addInherited("enablePopoutIcon","tabEnablePopoutIcon").setType(f.BOOLEAN).setDescription("whether to show the popout icon in the tabset header if this tab enables popouts"),e.addInherited("enablePopoutFloatIcon","tabEnablePopoutFloatIcon").setType(f.BOOLEAN).setDescription("whether to show the popout float icon in the tabset header if this tab enables floating popouts"),e.addInherited("enablePopoutOverlay","tabEnablePopoutOverlay").setType(f.BOOLEAN).setDescription(`if this tab will not work correctly in a popout window when the main window is backgrounded (inactive)
|
|
3
|
+
then enabling this option will gray out this tab`),e.addInherited("borderWidth","tabBorderWidth").setType(f.NUMBER).setDescription("width when added to border, -1 will use border size"),e.addInherited("borderHeight","tabBorderHeight").setType(f.NUMBER).setDescription("height when added to border, -1 will use border size"),e.addInherited("minWidth","tabMinWidth").setType(f.NUMBER).setDescription("the min width of this tab"),e.addInherited("minHeight","tabMinHeight").setType(f.NUMBER).setDescription("the min height of this tab"),e.addInherited("maxWidth","tabMaxWidth").setType(f.NUMBER).setDescription("the max width of this tab"),e.addInherited("maxHeight","tabMaxHeight").setType(f.NUMBER).setDescription("the max height of this tab"),e}};function A(){return window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches}function R(t,e,i){let o,s=e.getName(),a=e.getName();void 0===i&&(i=0),void 0===o&&void 0!==e.getIcon()&&(o=0!==i?(0,n.jsx)("img",{style:{width:"1em",height:"1em",transform:"rotate("+i+"deg)"},src:e.getIcon(),alt:"leadingContent"}):(0,n.jsx)("img",{style:{width:"1em",height:"1em"},src:e.getIcon(),alt:"leadingContent"}));let r={leading:o,content:s,name:a,buttons:[]};return t.customizeTab(e,r),e.setRenderedName(r.name),r}function O(t){let e=!1;return t.nativeEvent instanceof MouseEvent&&(0!==t.nativeEvent.button||t.ctrlKey||t.altKey||t.metaKey||t.shiftKey)&&(e=!0),e}function v(t,e){for(let i of[...x("iframe",e),...x("webview",e)])i.style.pointerEvents=t?"auto":"none"}function x(t,e){return[...e.getElementsByTagName(t)]}var N=!1;function w(t,e,i,o,s){N=!0,e.preventDefault();let a=t=>{t.preventDefault(),i(t.clientX,t.clientY)},n=t=>{t.preventDefault(),N=!1,s()},r=()=>{t.removeEventListener("pointermove",a),t.removeEventListener("pointerup",r),t.removeEventListener("pointercancel",n),N=!1,o()};t.addEventListener("pointermove",a),t.addEventListener("pointerup",r),t.addEventListener("pointercancel",n)}function D(t,e){let i=e.getType();if("window"===i)return t.isAllowedInWindow();if("float"===i)return!0;if("tab"===i){let i,o=(e.getController().getModel().visitNodes(t=>{t instanceof y&&t.getSubLayoutId()===e.getLayoutId()&&(i=t.getLayout())}),i);if(o&&"window"===o.getType()&&!o.isMainLayout()&&!t.isAllowedInWindow())return!1;if(t instanceof y){if(void 0!==t.getSubLayoutId())return!1}else if(t instanceof C){for(let e of t.getChildren())if(void 0!==e.getSubLayoutId())return!1}return!0}return!1}function S(t,e){let i=t.getAttribute("style");return i!==e.getAttribute("style")&&(i?e.setAttribute("style",i):e.removeAttribute("style"),!0)}var I=class t extends L{static TYPE="row";static fromJson(e,i,o){let s=new t(i,e);if(null!=e.children){for(let a of e.children)if(a.type===C.TYPE){let t=C.fromJson(a,i,o);s.addChild(t)}else if(a.type===t.TYPE){let e=t.fromJson(a,i,o);s.addChild(e)}}return s}static attributeDefinitions=t.createAttributeDefinitions();layout;minHeight;minWidth;maxHeight;maxWidth;constructor(e,i){super(e),this.minHeight=1,this.minWidth=1,this.maxHeight=Y,this.maxWidth=Y,t.attributeDefinitions.fromJson(i,this.attributes),this.normalizeWeights(),e.addNode(this)}getWeight(){return this.attributes.weight}toJson(){let e={};for(let i of(t.attributeDefinitions.toJson(e,this.attributes),e.children=[],this.children))e.children.push(i.toJson());return e}getLayout(){return this.layout?this.layout:super.getLayout()}setLayout(t){this.layout=t}setWeight(t){this.attributes.weight=t}getSplitterBounds(t){let e=this.getOrientation()===c.HORZ,i=this.getChildren(),o=this.model.getSplitterSize(),s=i[0].getRect(),a=i[i.length-1].getRect(),n=e?[s.x,a.getRight()]:[s.y,a.getBottom()],r=e?[s.x,a.getRight()]:[s.y,a.getBottom()];for(let s=0;s<t;s++){let t=i[s];n[0]+=e?t.getMinWidth():t.getMinHeight(),r[0]+=e?t.getMaxWidth():t.getMaxHeight(),s>0&&(n[0]+=o,r[0]+=o)}for(let s=i.length-1;s>=t;s--){let t=i[s];n[1]-=(e?t.getMinWidth():t.getMinHeight())+o,r[1]-=(e?t.getMaxWidth():t.getMaxHeight())+o}return[Math.max(r[1],n[0]),Math.min(r[0],n[1])]}getSplitterInitials(t){let e=this.getOrientation()===c.HORZ,i=this.getChildren(),o=this.model.getSplitterSize(),s=[],a=0;for(let t=0;t<i.length;t++){let o=i[t].getRect(),n=e?o.width:o.height;s.push(n),a+=n}let n=i[t].getRect();return{initialSizes:s,sum:a,startPosition:(e?n.x:n.y)-o}}calculateSplit(t,e,i,o,s){let a=this.getOrientation()===c.HORZ,n=this.getChildren(),r=n[t],l=a?r.getMaxWidth():r.getMaxHeight(),d=[...i];if(e<s){let i=s-e,o=0;d[t]+i>l?(o=d[t]+i-l,d[t]=l):d[t]+=i;for(let e=t-1;e>=0;e--){let t=n[e],o=a?t.getMinWidth():t.getMinHeight();if(d[e]-i>o){d[e]-=i;break}i-=d[e]-o,d[e]=o}for(let e=t+1;e<n.length;e++){let t=n[e],i=a?t.getMaxWidth():t.getMaxHeight();if(d[e]+o<i){d[e]+=o;break}o-=i-d[e],d[e]=i}}else{let i=e-s,o=0;d[t-1]+i>l?(o=d[t-1]+i-l,d[t-1]=l):d[t-1]+=i;for(let e=t;e<n.length;e++){let t=n[e],o=a?t.getMinWidth():t.getMinHeight();if(d[e]-i>o){d[e]-=i;break}i-=d[e]-o,d[e]=o}for(let e=t-1;e>=0;e--){let t=n[e],i=a?t.getMaxWidth():t.getMaxHeight();if(d[e]+o<i){d[e]+=o;break}o-=i-d[e],d[e]=i}}return d.map(t=>100*Math.max(.1,t)/o)}getMinSize(t){return t===c.HORZ?this.getMinWidth():this.getMinHeight()}getMinWidth(){return this.minWidth}getMinHeight(){return this.minHeight}getMaxSize(t){return t===c.HORZ?this.getMaxWidth():this.getMaxHeight()}getMaxWidth(){return this.maxWidth}getMaxHeight(){return this.maxHeight}calcMinMaxSize(){this.minHeight=1,this.minWidth=1,this.maxHeight=Y,this.maxWidth=Y;let t=!0;for(let e of this.children)e.calcMinMaxSize(),this.getOrientation()===c.VERT?(this.minHeight+=e.getMinHeight(),this.maxHeight+=e.getMaxHeight(),t||(this.minHeight+=this.model.getSplitterSize(),this.maxHeight+=this.model.getSplitterSize()),this.minWidth=Math.max(this.minWidth,e.getMinWidth()),this.maxWidth=Math.min(this.maxWidth,e.getMaxWidth())):(this.minWidth+=e.getMinWidth(),this.maxWidth+=e.getMaxWidth(),t||(this.minWidth+=this.model.getSplitterSize(),this.maxWidth+=this.model.getSplitterSize()),this.minHeight=Math.max(this.minHeight,e.getMinHeight()),this.maxHeight=Math.min(this.maxHeight,e.getMaxHeight())),t=!1}tidy(){let e=0;for(;e<this.children.length;){let i=this.children[e];if(i instanceof t){i.tidy();let o=i.getChildren();if(0===o.length)this.removeChild(i);else if(1===o.length){let s=o[0];if(this.removeChild(i),s instanceof t){let t=0,o=s.getChildren();for(let e of o)t+=e.getWeight();for(let s=0;s<o.length;s++){let a=o[s];a.setWeight(i.getWeight()*a.getWeight()/t),this.addChild(a,e+s)}}else s.setWeight(i.getWeight()),this.addChild(s,e)}else e++}else i instanceof C&&0===i.getChildren().length&&i.isEnableDeleteWhenEmpty()&&i.isEnableClose()?(this.removeChild(i),i===this.model.getMaximizedTabset(this.getLayoutId())&&this.model.setMaximizedTabset(void 0,this.getLayoutId())):e++}if(this===this.model.getRootRow(this.getLayoutId())&&0===this.children.length)if(this.getLayout()?.getType()!=="tab"&&this.getLayoutId()!==W.MAIN_LAYOUT_ID)this.model.getLayouts().delete(this.getLayoutId());else{let t=this.model.getOnCreateTabSet(),e=t?t():{};e={...e,selected:-1};let i=new C(this.model,e);this.model.setActiveTabset(i,this.getLayoutId()),this.addChild(i)}}canDrop(t,e,i){let o,s=i-this.rect.y,a=e-this.rect.x,n=this.rect.width,r=this.rect.height,l=this.model.isEnableEdgeDockIndicators()?50:9999,d=this.getLayout();if(this.getLayoutId()===W.MAIN_LAYOUT_ID||D(t,d)){if(this.model.isEnableEdgeDock()&&void 0===this.parent){if(e<this.rect.x+10&&s>r/2-l&&s<r/2+l){let t=_.LEFT,e=t.getDockRect(this.rect);e.width=e.width/2,o=new m(this,e,t,-1,T.FLEXLAYOUT__OUTLINE_RECT_EDGE)}else if(e>this.rect.getRight()-10&&s>r/2-l&&s<r/2+l){let t=_.RIGHT,e=t.getDockRect(this.rect);e.width=e.width/2,e.x+=e.width,o=new m(this,e,t,-1,T.FLEXLAYOUT__OUTLINE_RECT_EDGE)}else if(i<this.rect.y+10&&a>n/2-l&&a<n/2+l){let t=_.TOP,e=t.getDockRect(this.rect);e.height=e.height/2,o=new m(this,e,t,-1,T.FLEXLAYOUT__OUTLINE_RECT_EDGE)}else if(i>this.rect.getBottom()-10&&a>n/2-l&&a<n/2+l){let t=_.BOTTOM,e=t.getDockRect(this.rect);e.height=e.height/2,e.y+=e.height,o=new m(this,e,t,-1,T.FLEXLAYOUT__OUTLINE_RECT_EDGE)}if(void 0!==o&&!t.canDockInto(t,o))return}return o}}drop(e,i,o){let s,a=e.getParent();if(a&&a.removeChild(e),void 0!==a&&a instanceof C&&a.setSelected(0),void 0!==a&&a instanceof U&&a.setSelected(-1),e instanceof C||e instanceof t)(s=e)instanceof t&&s.getOrientation()===this.getOrientation()&&(i.getOrientation()===this.getOrientation()||i===_.CENTER)&&(s=new t(this.model,{})).addChild(e);else{let t=this.model.getOnCreateTabSet(),i=t?t(e):{};(s=new C(this.model,i)).addChild(e)}let n=this.children.reduce((t,e)=>t+e.getWeight(),0);0===n&&(n=100),s.setWeight(n/3);let r=!this.model.isRootOrientationVertical();if(i===_.CENTER)-1===o?this.addChild(s,this.children.length):this.addChild(s,o);else if(r&&i===_.LEFT||!r&&i===_.TOP)this.addChild(s,0);else if(r&&i===_.RIGHT||!r&&i===_.BOTTOM)this.addChild(s);else if(r&&i===_.TOP||!r&&i===_.LEFT){let e=new t(this.model,{}),i=new t(this.model,{});for(let t of(i.setWeight(75),s.setWeight(25),this.children))i.addChild(t);this.removeAll(),e.addChild(s),e.addChild(i),this.addChild(e)}else if(r&&i===_.BOTTOM||!r&&i===_.RIGHT){let e=new t(this.model,{}),i=new t(this.model,{});for(let t of(i.setWeight(75),s.setWeight(25),this.children))i.addChild(t);this.removeAll(),e.addChild(i),e.addChild(s),this.addChild(e)}s instanceof C&&this.model.setActiveTabset(s,this.getLayoutId()),this.model.tidy()}isEnableDrop(){return!0}getAttributeDefinitions(){return t.attributeDefinitions}updateAttrs(e){t.attributeDefinitions.update(e,this.attributes)}static getAttributeDefinitions(){return t.attributeDefinitions}normalizeWeights(){let t=0;for(let e of this.children)t+=e.getWeight();for(let e of(0===t&&(t=1),this.children))e.setWeight(Math.max(.001,100*e.getWeight()/t))}static createAttributeDefinitions(){let e=new E;return e.add("type",t.TYPE,!0).setType(f.STRING).setFixed(),e.add("id",void 0).setType(f.STRING).setDescription("the unique id of the row, if left undefined a uuid will be assigned"),e.add("weight",100).setType(f.NUMBER).setDescription("relative weight for sizing of this row in parent row"),e}},C=class t extends L{static TYPE="tabset";static fromJson(e,i,o){let s=new t(i,e);if(null!=e.children)for(let t of e.children){let e=y.fromJson(t,i);s.addChild(e)}return 0===s.children.length&&s.setSelected(-1),e.maximized&&!0===e.maximized&&o.setMaximizedTabSet(s),e.active&&!0===e.active&&o.setActiveTabSet(s),s}static attributeDefinitions=t.createAttributeDefinitions();tabStripRect=g.empty();contentRect=g.empty();calculatedMinHeight;calculatedMinWidth;calculatedMaxHeight;calculatedMaxWidth;constructor(e,i){super(e),this.calculatedMinHeight=0,this.calculatedMinWidth=0,this.calculatedMaxHeight=0,this.calculatedMaxWidth=0,t.attributeDefinitions.fromJson(i,this.attributes),e.addNode(this)}getName(){return this.getAttr("name")}isEnableActiveIcon(){return this.getAttr("enableActiveIcon")}getSelected(){let t=this.attributes.selected;return void 0!==t?t:-1}getSelectedNode(){let t=this.getSelected();if(-1!==t)return this.children[t]}getWeight(){return this.getAttr("weight")}getAttrMinWidth(){return this.getAttr("minWidth")}getAttrMinHeight(){return this.getAttr("minHeight")}getMinWidth(){return this.calculatedMinWidth}getMinHeight(){return this.calculatedMinHeight}getMinSize(t){return t===c.HORZ?this.getMinWidth():this.getMinHeight()}getAttrMaxWidth(){return this.getAttr("maxWidth")}getAttrMaxHeight(){return this.getAttr("maxHeight")}getMaxWidth(){return this.calculatedMaxWidth}getMaxHeight(){return this.calculatedMaxHeight}getMaxSize(t){return t===c.HORZ?this.getMaxWidth():this.getMaxHeight()}isCloseable(){let t=this.isEnableClose();return t&&(t=super.isCloseable()),t}getConfig(){return this.attributes.config}isMaximized(){return this.model.getMaximizedTabset(this.getLayoutId())===this}isActive(){return this.model.getActiveTabset(this.getLayoutId())===this}isEnableDeleteWhenEmpty(){return this.getAttr("enableDeleteWhenEmpty")}isEnableDrop(){return this.getAttr("enableDrop")}isEnableTabStrip(){return this.getAttr("enableTabStrip")}isEnableTabWrap(){return this.getAttr("enableTabWrap")}isEnableDrag(){return this.getAttr("enableDrag")}isEnableDivide(){return this.getAttr("enableDivide")}isEnableMaximize(){return this.getAttr("enableMaximize")}isEnableClose(){return this.getAttr("enableClose")}isEnableCloseButton(){return this.getAttr("enableCloseButton")}isEnableSingleTabStretch(){return this.getAttr("enableSingleTabStretch")}isAutoSelectTab(){return this.getAttr("autoSelectTab")}isEnableTabScrollbar(){return this.getAttr("enableTabScrollbar")}getClassNameTabStrip(){return this.getAttr("classNameTabStrip")}getTabLocation(){return this.getAttr("tabLocation")}toJson(){let e={};return t.attributeDefinitions.toJson(e,this.attributes),e.children=this.children.map(t=>t.toJson()),this.isActive()&&(e.active=!0),this.isMaximized()&&(e.maximized=!0),e}calcMinMaxSize(){for(let t of(this.calculatedMinHeight=this.getAttrMinHeight(),this.calculatedMinWidth=this.getAttrMinWidth(),this.calculatedMaxHeight=this.getAttrMaxHeight(),this.calculatedMaxWidth=this.getAttrMaxWidth(),this.children))this.calculatedMinWidth=Math.max(this.calculatedMinWidth,t.getMinWidth()),this.calculatedMinHeight=Math.max(this.calculatedMinHeight,t.getMinHeight()),this.calculatedMaxWidth=Math.min(this.calculatedMaxWidth,t.getMaxWidth()),this.calculatedMaxHeight=Math.min(this.calculatedMaxHeight,t.getMaxHeight());this.calculatedMinHeight+=this.tabStripRect.height,this.calculatedMaxHeight+=this.tabStripRect.height}canMaximize(){return!!this.isEnableMaximize()&&(this.getModel().getMaximizedTabset(this.getLayoutId())===this||this.getParent()!==this.getModel().getRootRow(this.getLayoutId())||1!==this.getModel().getRootRow(this.getLayoutId()).getChildren().length)}setContentRect(t){this.contentRect=t}getContentRect(){return this.contentRect}setTabStripRect(t){this.tabStripRect=t}setWeight(t){this.attributes.weight=t}setSelected(t){this.attributes.selected=t}canDrop(t,e,i){let o,s=this.getLayout();if(t===this){let t=_.CENTER;o=new m(this,this.tabStripRect,t,-1,T.FLEXLAYOUT__OUTLINE_RECT)}else if(this.getLayoutId()!==W.MAIN_LAYOUT_ID&&!D(t,s))return;else if(this.contentRect.contains(e,i)){let t=_.CENTER;void 0===this.model.getMaximizedTabset(this.getLayoutId())&&(t=_.getLocation(this.contentRect,e,i)),o=new m(this,t.getDockRect(this.rect),t,-1,T.FLEXLAYOUT__OUTLINE_RECT)}else if(null!=this.tabStripRect&&this.tabStripRect.contains(e,i)){let t,s,a;if(0===this.children.length)s=(t=this.tabStripRect.clone()).y+3,a=t.height-4,t.width=2;else{let n=this.children[0];s=(t=n.getTabRect()).y,a=t.height;let r=this.tabStripRect.x;for(let a=0;a<this.children.length;a++){(t=(n=this.children[a]).getTabRect()).y!==s&&(s=t.y,r=this.tabStripRect.x);let l=t.x+t.width/2;if(r<=e&&e<l&&t.y<i&&i<t.getBottom()){let e=_.CENTER,i=new g(t.x-2,t.y,3,t.height);if(!(this.rect.x<t.x&&t.x<this.rect.getRight()))return;o=new m(this,i,e,a,T.FLEXLAYOUT__OUTLINE_RECT);break}r=l}}if(null==o&&t.getRight()<this.rect.getRight()){let e=_.CENTER;o=new m(this,new g(t.getRight()-2,s,3,a),e,this.children.length,T.FLEXLAYOUT__OUTLINE_RECT)}}if(t.canDockInto(t,o))return o}delete(){this.parent.removeChild(this)}remove(t){let e=this.removeChild(t);this.model.tidy(),B(this,e)}drop(e,i,o,s){if(this===e)return;let a=e.getParent(),n=0;if(void 0!==a&&(n=a.removeChild(e),a instanceof U&&a.getSelected()===n?a.setSelected(-1):B(a,n)),e instanceof y&&a===this&&n<o&&o>0&&o--,i===_.CENTER){let t=o;if(-1===t&&(t=this.children.length),e instanceof y)this.addChild(e,t),(s||!1!==s&&this.isAutoSelectTab())&&this.setSelected(t);else if(e instanceof I)e.forEachNode((e,i)=>{e instanceof y&&(this.addChild(e,t),t++)},0);else{for(let i=0;i<e.getChildren().length;i++){let o=e.getChildren()[i];this.addChild(o,t),t++}-1===this.getSelected()&&this.children.length>0&&this.setSelected(0)}this.model.setActiveTabset(this,this.parent.getLayoutId())}else{let o=e;if(e instanceof y){let i=this.model.getOnCreateTabSet();(o=new t(this.model,i?i(e):{})).addChild(e)}else if(e instanceof I){let t=this.getParent();if(e.getOrientation()===t.getOrientation()&&(i.getOrientation()===t.getOrientation()||i===_.CENTER)){let t=new I(this.model,{});t.addChild(e),o=t}}else o=e;let s=this.parent,a=s.getChildren().indexOf(this);if(s.getOrientation()===i.orientation)o.setWeight(this.getWeight()/2),this.setWeight(this.getWeight()/2),s.addChild(o,a+i.indexPlus);else{let t=new I(this.model,{});t.setWeight(this.getWeight()),t.addChild(this),this.setWeight(50),o.setWeight(50),t.addChild(o,i.indexPlus),s.removeChild(this),s.addChild(t,a)}o instanceof t&&this.model.setActiveTabset(o,this.getLayoutId())}this.model.tidy()}updateAttrs(e){t.attributeDefinitions.update(e,this.attributes)}getAttributeDefinitions(){return t.attributeDefinitions}static getAttributeDefinitions(){return t.attributeDefinitions}static createAttributeDefinitions(){let e=new E;return e.add("type",t.TYPE,!0).setType(f.STRING).setFixed(),e.add("id",void 0).setType(f.STRING).setDescription("the unique id of the tab set, if left undefined a uuid will be assigned"),e.add("weight",100).setType(f.NUMBER).setDescription("relative weight for sizing of this tabset in parent row"),e.add("selected",0).setType(f.NUMBER).setDescription("index of selected/visible tab in tabset"),e.add("name",void 0).setType(f.STRING),e.add("config",void 0).setType("any").setDescription("a place to hold json config used in your own code"),e.addInherited("enableDeleteWhenEmpty","tabSetEnableDeleteWhenEmpty").setDescription("whether to delete this tabset when is has no tabs"),e.addInherited("enableDrop","tabSetEnableDrop").setDescription("allow user to drag tabs into this tabset"),e.addInherited("enableDrag","tabSetEnableDrag").setDescription("allow user to drag tabs out this tabset"),e.addInherited("enableDivide","tabSetEnableDivide").setDescription("allow user to drag tabs to region of this tabset, splitting into new tabset"),e.addInherited("enableMaximize","tabSetEnableMaximize").setDescription("allow user to maximize tabset to fill view via maximize button"),e.addInherited("enableClose","tabSetEnableClose").setDescription("can this tabset be closed"),e.addInherited("enableCloseButton","tabSetEnableCloseButton").setDescription("if the tabset can be closed then show a close button"),e.addInherited("enableSingleTabStretch","tabSetEnableSingleTabStretch").setDescription("if the tabset has only a single tab then stretch the single tab to fill area and display in a header style"),e.addInherited("classNameTabStrip","tabSetClassNameTabStrip").setDescription("a class name to apply to the tab strip"),e.addInherited("enableTabStrip","tabSetEnableTabStrip").setDescription("enable tab strip and allow multiple tabs in this tabset"),e.addInherited("minWidth","tabSetMinWidth").setDescription("minimum width (in px) for this tabset"),e.addInherited("minHeight","tabSetMinHeight").setDescription("minimum height (in px) for this tabset"),e.addInherited("maxWidth","tabSetMaxWidth").setDescription("maximum width (in px) for this tabset"),e.addInherited("maxHeight","tabSetMaxHeight").setDescription("maximum height (in px) for this tabset"),e.addInherited("enableTabWrap","tabSetEnableTabWrap").setDescription("wrap tabs onto multiple lines"),e.addInherited("tabLocation","tabSetTabLocation").setDescription("the location of the tabs either top or bottom"),e.addInherited("autoSelectTab","tabSetAutoSelectTab").setType(f.BOOLEAN).setDescription("whether to select new/moved tabs in tabset"),e.addInherited("enableActiveIcon","tabSetEnableActiveIcon").setType(f.BOOLEAN).setDescription("whether the active icon (*) should be displayed when the tabset is active"),e.addInherited("enableTabScrollbar","tabSetEnableTabScrollbar").setType(f.BOOLEAN).setDescription("whether to show a mini scrollbar for the tabs"),e}};function B(t,e){if(void 0!==t&&(t instanceof C||t instanceof U)){let i=t.getSelected();-1!==i&&(e===i&&t.getChildren().length>0?e>=t.getChildren().length&&t.setSelected(t.getChildren().length-1):e<i?t.setSelected(i-1):e>i||t.setSelected(-1))}}function M(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16))}var U=class t extends L{static TYPE="border";static fromJson(e,i){let o=new t(_.getByName(e.location),e,i);return e.children&&(o.children=e.children.map(t=>{let e=y.fromJson(t,i);return e.setParent(o),e})),o}static attributeDefinitions=t.createAttributeDefinitions();contentRect=g.empty();tabHeaderRect=g.empty();location;constructor(e,i,o){super(o),this.location=e,this.attributes.id=`border_${e.getName()}`,t.attributeDefinitions.fromJson(i,this.attributes),o.addNode(this)}getLocation(){return this.location}getClassName(){return this.getAttr("className")}isHorizontal(){return this.location.orientation===c.HORZ}getSize(){let t=this.getAttr("size"),e=this.getSelected();if(-1===e)return t;{let i=this.children[e],o=this.isHorizontal()?i.getAttr("borderWidth"):i.getAttr("borderHeight");return -1===o?t:o}}getMinSize(){let t=this.getSelectedNode(),e=this.getAttr("minSize");return t&&(e=Math.max(e,this.isHorizontal()?t.getMinWidth():t.getMinHeight())),e}getMaxSize(){let t=this.getSelectedNode(),e=this.getAttr("maxSize");return t&&(e=Math.min(e,this.isHorizontal()?t.getMaxWidth():t.getMaxHeight())),e}getSelected(){return this.attributes.selected}isAutoHide(){return this.getAttr("enableAutoHide")}getSelectedNode(){if(-1!==this.getSelected())return this.children[this.getSelected()]}getOrientation(){return this.location.getOrientation()}getConfig(){return this.attributes.config}isMaximized(){return!1}isShowing(){return this.attributes.show}toJson(){let e={location:"bottom"};return t.attributeDefinitions.toJson(e,this.attributes),e.location=this.location.getName(),e.children=this.children.map(t=>t.toJson()),e}isAutoSelectTab(t){return(null==t&&(t=-1!==this.getSelected()),t)?this.getAttr("autoSelectTabWhenOpen"):this.getAttr("autoSelectTabWhenClosed")}isEnableTabScrollbar(){return this.getAttr("enableTabScrollbar")}setSelected(t){this.attributes.selected=t}getTabHeaderRect(){return this.tabHeaderRect}setTabHeaderRect(t){this.tabHeaderRect=t}getRect(){return this.tabHeaderRect}getContentRect(){return this.contentRect}setContentRect(t){this.contentRect=t}isEnableDrop(){return this.getAttr("enableDrop")}setSize(t){let e=this.getSelected();if(-1===e)this.attributes.size=t;else{let i=this.children[e];(this.isHorizontal()?i.getAttr("borderWidth"):i.getAttr("borderHeight"))===-1?this.attributes.size=t:this.isHorizontal()?i.setBorderWidth(t):i.setBorderHeight(t)}}updateAttrs(e){t.attributeDefinitions.update(e,this.attributes)}remove(t){let e=this.removeChild(t);-1!==this.getSelected()&&B(this,e)}canDrop(t,e,i){let o;if(!(t instanceof y))return;let s=_.CENTER;if(this.tabHeaderRect.contains(e,i)){if(this.location.orientation===c.VERT)if(this.children.length>0){let t=this.children[0],i=t.getTabRect(),a=i.y,n=i.height,r=this.tabHeaderRect.x;for(let l=0;l<this.children.length;l++){let d=(i=(t=this.children[l]).getTabRect()).x+i.width/2;if(e>=r&&e<d){o=new m(this,new g(i.x-2,a,3,n),s,l,T.FLEXLAYOUT__OUTLINE_RECT);break}r=d}null==o&&(o=new m(this,new g(i.getRight()-2,a,3,n),s,this.children.length,T.FLEXLAYOUT__OUTLINE_RECT))}else o=new m(this,new g(this.tabHeaderRect.x+1,this.tabHeaderRect.y+2,3,18),s,0,T.FLEXLAYOUT__OUTLINE_RECT);else if(this.children.length>0){let t=this.children[0],e=t.getTabRect(),a=e.x,n=e.width,r=this.tabHeaderRect.y;for(let l=0;l<this.children.length;l++){let d=(e=(t=this.children[l]).getTabRect()).y+e.height/2;if(i>=r&&i<d){o=new m(this,new g(a,e.y-2,n,3),s,l,T.FLEXLAYOUT__OUTLINE_RECT);break}r=d}null==o&&(o=new m(this,new g(a,e.getBottom()-2,n,3),s,this.children.length,T.FLEXLAYOUT__OUTLINE_RECT))}else o=new m(this,new g(this.tabHeaderRect.x+2,this.tabHeaderRect.y+1,18,3),s,0,T.FLEXLAYOUT__OUTLINE_RECT);if(!t.canDockInto(t,o))return}else if(-1!==this.getSelected()&&this.contentRect.contains(e,i)&&(o=new m(this,this.contentRect,s,-1,T.FLEXLAYOUT__OUTLINE_RECT),!t.canDockInto(t,o)))return;return o}drop(e,i,o,s){let a=0,n=e.getParent();void 0!==n&&(a=n.removeChild(e),n!==this&&n instanceof t&&n.getSelected()===a?n.setSelected(-1):B(n,a)),e instanceof y&&n===this&&a<o&&o>0&&o--;let r=o;-1===r&&(r=this.children.length),e instanceof y&&this.addChild(e,r),(s||!1!==s&&this.isAutoSelectTab())&&this.setSelected(r),this.model.tidy()}getSplitterBounds(t,e=!1){let i=[0,0],o=e?this.getMinSize():0,s=e?this.getMaxSize():99999,a=this.model.getRootRow(W.MAIN_LAYOUT_ID),n=a.getRect(),r=this.model.getSplitterSize();if(this.location===_.TOP){i[0]=this.tabHeaderRect.getBottom()+o;let t=this.tabHeaderRect.getBottom()+s;i[1]=Math.max(i[0],n.getBottom()-a.getMinHeight()-r),i[1]=Math.min(i[1],t)}else if(this.location===_.LEFT){i[0]=this.tabHeaderRect.getRight()+o;let t=this.tabHeaderRect.getRight()+s;i[1]=Math.max(i[0],n.getRight()-a.getMinWidth()-r),i[1]=Math.min(i[1],t)}else if(this.location===_.BOTTOM){i[1]=this.tabHeaderRect.y-o-r;let t=this.tabHeaderRect.y-s-r;i[0]=Math.min(i[1],n.y+a.getMinHeight()),i[0]=Math.max(i[0],t)}else if(this.location===_.RIGHT){i[1]=this.tabHeaderRect.x-o-r;let t=this.tabHeaderRect.x-s-r;i[0]=Math.min(i[1],n.x+a.getMinWidth()),i[0]=Math.max(i[0],t)}return i}calculateSplit(t,e){let i=this.getSplitterBounds(e);return this.location===_.BOTTOM||this.location===_.RIGHT?Math.max(0,i[1]-e):Math.max(0,e-i[0])}getAttributeDefinitions(){return t.attributeDefinitions}static getAttributeDefinitions(){return t.attributeDefinitions}static createAttributeDefinitions(){let e=new E;return e.add("type",t.TYPE,!0).setType(f.STRING).setFixed(),e.add("selected",-1).setType(f.NUMBER).setDescription("index of selected/visible tab in border; -1 means no tab selected"),e.add("show",!0).setType(f.BOOLEAN).setDescription("show/hide this border"),e.add("config",void 0).setType("any").setDescription("a place to hold json config used in your own code"),e.addInherited("enableDrop","borderEnableDrop").setType(f.BOOLEAN).setDescription("whether tabs can be dropped into this border"),e.addInherited("className","borderClassName").setType(f.STRING).setDescription("class applied to tab button"),e.addInherited("autoSelectTabWhenOpen","borderAutoSelectTabWhenOpen").setType(f.BOOLEAN).setDescription("whether to select new/moved tabs in border when the border is already open"),e.addInherited("autoSelectTabWhenClosed","borderAutoSelectTabWhenClosed").setType(f.BOOLEAN).setDescription("whether to select new/moved tabs in border when the border is currently closed"),e.addInherited("size","borderSize").setType(f.NUMBER).setDescription("size of the tab area when selected"),e.addInherited("minSize","borderMinSize").setType(f.NUMBER).setDescription("the minimum size of the tab area"),e.addInherited("maxSize","borderMaxSize").setType(f.NUMBER).setDescription("the maximum size of the tab area"),e.addInherited("enableAutoHide","borderEnableAutoHide").setType(f.BOOLEAN).setDescription("hide border if it has zero tabs"),e.addInherited("enableTabScrollbar","borderEnableTabScrollbar").setType(f.BOOLEAN).setDescription("whether to show a mini scrollbar for the tabs"),e}},F=class t{static fromJson(e,i){let o=new t(i);for(let t of(o.borders=e.map(t=>U.fromJson(t,i)),o.borders))o.borderMap.set(t.getLocation(),t);return o}borders;borderMap;layoutHorizontal;constructor(t){this.borders=[],this.borderMap=new Map,this.layoutHorizontal=!0}toJson(){return this.borders.map(t=>t.toJson())}getLayoutHorizontal(){return this.layoutHorizontal}getBorders(){return this.borders}getBorderMap(){return this.borderMap}forEachNode(t){for(let e of this.borders)for(let i of(t(e,0),e.getChildren()))i.forEachNode(t,1)}setPaths(){for(let t of this.borders){let e="/border/"+t.getLocation().getName();t.setPath(e);let i=0;for(let o of t.getChildren())o.setPath(e+"/t"+i),i++}}findDropTargetNode(t,e,i){for(let o of this.borders)if(o.isShowing()){let s=o.canDrop(t,e,i);if(void 0!==s)return s}}},P=class t{_layoutId;_type;_rect;_controller;_rootRow;_maximizedTabSet;_activeTabSet;_toExportRectFunction;constructor(t,e,i){this._layoutId=t,this._type=e,this._rect=i,this._toExportRectFunction=(t,e)=>t}visitNodes(t){this.getRootRow()?.forEachNode(t,0)}isMainLayout(){return this._layoutId===W.MAIN_LAYOUT_ID}getLayoutId(){return this._layoutId}getType(){return this._type}setType(t){this._type=t}getRect(){return this._rect}getController(){return this._controller}getWindow(){return this._controller?.getCurrentWindow()}getRootRow(){return this._rootRow}getMaximizedTabSet(){return this._maximizedTabSet}getActiveTabSet(){return this._activeTabSet}setRect(t){this._rect=t}setController(t){this._controller=t}getWindowId(){return this._controller?.getWindowId()}setRootRow(t){t?.setLayout(this),this._rootRow=t}setMaximizedTabSet(t){this._maximizedTabSet=t}setActiveTabSet(t){this._activeTabSet=t}getToExportRectFunction(){return this._toExportRectFunction}setToExportRectFunction(t){this._toExportRectFunction=t}toJson(){return"window"===this.getType()&&this.getWindow()&&this.getWindow().screenTop>-1e4&&this.setRect(new g(this.getWindow().screenLeft,this.getWindow().screenTop,this.getWindow().outerWidth,this.getWindow().outerHeight)),{type:this.getType(),layout:this.getRootRow().toJson(),rect:"tab"===this.getType()?void 0:this.getRect().toJson()}}static fromJson(e,i,o){let s=i.getLayouts().size,a=e.rect?g.fromJson(e.rect):new g(50+50*s,50+50*s,600,400);a.snap(10);let n=new t(o,e.type||"window",a);return n.setRootRow(I.fromJson(e.layout,i,n)),n}},Y=99999,W=class t{static MAIN_LAYOUT_ID="__main_layout_id__";static attributeDefinitions=t.createAttributeDefinitions();attributes;layouts;borders;changeListeners;idMap;mainLayout;splitterSize;onAllowDrop;onCreateTabSet;constructor(){this.attributes={},this.layouts=new Map,this.borders=new F(this),this.idMap=new Map,this.changeListeners=[],this.mainLayout=new P(t.MAIN_LAYOUT_ID,"window",g.empty()),this.layouts.set(t.MAIN_LAYOUT_ID,this.mainLayout),this.splitterSize=8}doAction(e){let i;switch(e.type){case p.ADD_TAB:{let t=new y(this,e.data.json,!0),o=this.idMap.get(e.data.toNode);(o instanceof C||o instanceof U||o instanceof I)&&(o.drop(t,_.getByName(e.data.location),e.data.index,e.data.select),i=t);break}case p.MOVE_NODE:{let t=this.idMap.get(e.data.fromNode);if(t instanceof y||t instanceof C||t instanceof I){t===this.getMaximizedTabset(t.getLayoutId())&&this.layouts.get(t.getLayoutId()).setMaximizedTabSet(void 0);let i=this.idMap.get(e.data.toNode);(i instanceof C||i instanceof U||i instanceof I)&&i.drop(t,_.getByName(e.data.location),e.data.index,e.data.select)}break}case p.DELETE_TAB:{let t=this.idMap.get(e.data.node);t instanceof y&&t.delete();break}case p.DELETE_TABSET:{let t=this.idMap.get(e.data.node);if(t instanceof C){let e=[...t.getChildren()];for(let t=0;t<e.length;t++){let i=e[t];i.isEnableClose()&&i.delete()}0===t.getChildren().length&&t.delete(),this.tidy()}break}case p.POPOUT_TABSET:{let t=this.idMap.get(e.data.node);if(t instanceof C){let i=t.isMaximized(),o=t.getLayout(),s=M(),a=e.data.type||"window",n=new P(s,a,o.getToExportRectFunction()(t.getRect(),a)),r=I.fromJson({type:"row"},this,n);n.setRootRow(r),this.layouts.set(s,n),r.drop(t,_.CENTER,0),i&&this.mainLayout.setMaximizedTabSet(void 0)}break}case p.POPOUT_TAB:{let t=this.idMap.get(e.data.node);if(t instanceof y){let i=M(),o=t.getParent().getContentRect(),s=t.getLayout(),a=e.data.type||"window",n=new P(i,a,s.getToExportRectFunction()(o,a)),r=M(),l=I.fromJson({type:"row",children:[{type:"tabset",id:r}]},this,n);n.setRootRow(l),this.layouts.set(i,n),this.idMap.get(r).drop(t,_.CENTER,0,!0)}break}case p.SELECT_TAB:{let t=this.idMap.get(e.data.tabNode);if(t instanceof y){let e=t.getParent(),i=e.getChildren().indexOf(t);e instanceof U?e.getSelected()===i?e.setSelected(-1):e.setSelected(i):e instanceof C&&(e.getSelected()!==i&&e.setSelected(i),t.getLayout().setActiveTabSet(e))}break}case p.SET_ACTIVE_TABSET:{let i=e.data.layoutId?e.data.layoutId:t.MAIN_LAYOUT_ID,o=this.layouts.get(i);if(void 0===e.data.tabsetNode)o.setActiveTabSet(void 0);else{let t=this.idMap.get(e.data.tabsetNode);t instanceof C&&o.setActiveTabSet(t)}break}case p.ADJUST_WEIGHTS:{let t=this.idMap.get(e.data.nodeId).getChildren();for(let i=0;i<t.length;i++)t[i].setWeight(e.data.weights[i]);break}case p.ADJUST_BORDER_SPLIT:{let t=this.idMap.get(e.data.node);t instanceof U&&t.setSize(e.data.size);break}case p.MAXIMIZE_TOGGLE:{let i=e.data.layoutId?e.data.layoutId:t.MAIN_LAYOUT_ID,o=this.layouts.get(i),s=this.idMap.get(e.data.node);s instanceof C&&(s===o.getMaximizedTabSet()?o.setMaximizedTabSet(void 0):(o.setMaximizedTabSet(s),o.setActiveTabSet(s)));break}case p.UPDATE_MODEL_ATTRIBUTES:this.updateAttrs(e.data.json);break;case p.UPDATE_NODE_ATTRIBUTES:this.idMap.get(e.data.node).updateAttrs(e.data.json);break;case p.RENAME_TAB:{let t=this.idMap.get(e.data.node);t instanceof y&&t.setName(e.data.text);break}case p.CREATE_SUBLAYOUT:{let t=M(),o=new P(t,e.data.type||"window",g.fromJson(e.data.rect)),s=I.fromJson(e.data.layout,this,o);o.setRootRow(s),this.layouts.set(t,o),i=t;break}case p.CLOSE_POPOUT:{let t=this.layouts.get(e.data.layoutId);if(t){t.setType("float");let e=this.mainLayout.getController().getDomRect();t.setRect(new g(e.width/4,e.height/4,e.width/2,e.height/2))}break}case p.MOVE_POPOUT_TO_FRONT:{let t=e.data.layoutId,i=this.layouts.get(t);i&&(this.layouts.delete(t),this.layouts.set(t,i))}}for(let t of(this.updateIdMap(),this.changeListeners))t(e);return i}getActiveTabset(e=t.MAIN_LAYOUT_ID){let i=this.layouts.get(e);return i&&i.getActiveTabSet()&&this.getNodeById(i.getActiveTabSet().getId())?i.getActiveTabSet():void 0}getMaximizedTabset(e=t.MAIN_LAYOUT_ID){return this.layouts.get(e).getMaximizedTabSet()}getRootRow(e=t.MAIN_LAYOUT_ID){return this.layouts.get(e).getRootRow()}isRootOrientationVertical(){return this.attributes.rootOrientationVertical}isEnableRotateBorderIcons(){return this.attributes.enableRotateBorderIcons}getBorderSet(){return this.borders}visitNodes(t){for(let[e,i]of(this.borders.forEachNode(t),this.layouts))i.getRootRow().forEachNode(t,0)}visitLayoutNodes(e,i){this.layouts.has(e)&&(e===t.MAIN_LAYOUT_ID&&this.borders.forEachNode(i),this.layouts.get(e).visitNodes(i))}getNodeById(t){return this.idMap.get(t)}getFirstTabSet(e=this.layouts.get(t.MAIN_LAYOUT_ID).getRootRow()){let i=e.getChildren()[0];return i instanceof C?i:this.getFirstTabSet(i)}static fromJson(e){let i=new t;t.attributeDefinitions.fromJson(e.global,i.attributes),e.borders&&(i.borders=F.fromJson(e.borders,i));let o=e.subLayouts||e.popouts;if(o)for(let t in o){let e=o[t],s=P.fromJson(e,i,t);i.layouts.set(t,s)}return i.mainLayout.setRootRow(I.fromJson(e.layout,i,i.mainLayout)),i.tidy(),i}toJson(){let e={};t.attributeDefinitions.toJson(e,this.attributes),this.visitNodes(t=>{t.fireEvent("save",{})});let i={};for(let[e,o]of this.layouts)e!==t.MAIN_LAYOUT_ID&&(i[e]=o.toJson());return{global:e,borders:this.borders.toJson(),layout:this.mainLayout.getRootRow().toJson(),subLayouts:i}}getSplitterSize(){return this.splitterSize}setSplitterSize(t){this.splitterSize=t}isEnableEdgeDock(){return this.attributes.enableEdgeDock}isEnableEdgeDockIndicators(){return this.attributes.enableEdgeDockIndicators}setOnAllowDrop(t){this.onAllowDrop=t}setOnCreateTabSet(t){this.onCreateTabSet=t}addChangeListener(t){this.changeListeners.push(t)}removeChangeListener(t){let e=this.changeListeners.findIndex(e=>e===t);-1!==e&&this.changeListeners.splice(e,1)}toString(){return JSON.stringify(this.toJson())}getMainLayout(){return this.mainLayout}getLayouts(){return this.layouts}sortLayouts(){let t={window:1,tab:2,float:3},e=Array.from(this.getLayouts().values()).sort((e,i)=>t[e.getType()]-t[i.getType()]);this.layouts.clear(),e.forEach(t=>this.layouts.set(t.getLayoutId(),t))}setActiveTabset(t,e){let i=this.layouts.get(e);i&&(t?i.setActiveTabSet(t):i.setActiveTabSet(void 0))}setMaximizedTabset(t,e){let i=this.layouts.get(e);i&&(t?i.setMaximizedTabSet(t):i.setMaximizedTabSet(void 0))}updateIdMap(){this.idMap.clear(),this.visitNodes(t=>{this.idMap.set(t.getId(),t)})}addNode(t){let e=t.getId();if(this.idMap.has(e))throw Error(`Error: each node must have a unique id, duplicate id:${t.getId()}`);this.idMap.set(e,t)}findDropTargetNode(e,i,o,s){let a=this.layouts.get(e).getRootRow().findDropTargetNode(e,i,o,s);return void 0===a&&e===t.MAIN_LAYOUT_ID&&(a=this.borders.findDropTargetNode(i,o,s)),a}tidy(){for(let[t,e]of this.layouts)e.getRootRow().tidy()}updateAttrs(e){t.attributeDefinitions.update(e,this.attributes)}nextUniqueId(){return"#"+M()}getAttribute(t){return this.attributes[t]}getOnAllowDrop(){return this.onAllowDrop}getOnCreateTabSet(){return this.onCreateTabSet}static toTypescriptInterfaces(){t.attributeDefinitions.pairAttributes("RowNode",I.getAttributeDefinitions()),t.attributeDefinitions.pairAttributes("TabSetNode",C.getAttributeDefinitions()),t.attributeDefinitions.pairAttributes("TabNode",y.getAttributeDefinitions()),t.attributeDefinitions.pairAttributes("BorderNode",U.getAttributeDefinitions());let e=[];e.push(t.attributeDefinitions.toTypescriptInterface("Global",void 0)),e.push(I.getAttributeDefinitions().toTypescriptInterface("Row",t.attributeDefinitions)),e.push(C.getAttributeDefinitions().toTypescriptInterface("TabSet",t.attributeDefinitions)),e.push(y.getAttributeDefinitions().toTypescriptInterface("Tab",t.attributeDefinitions)),e.push(U.getAttributeDefinitions().toTypescriptInterface("Border",t.attributeDefinitions)),console.log(e.join("\n"))}static createAttributeDefinitions(){let t=new E;return t.add("enableEdgeDock",!0).setType(f.BOOLEAN).setDescription("enable docking to the edges of the layout"),t.add("enableEdgeDockIndicators",!0).setType(f.BOOLEAN).setDescription("show the edge indicators when dragging"),t.add("rootOrientationVertical",!1).setType(f.BOOLEAN).setDescription("the top level 'row' will layout horizontally by default, set this option true to make it layout vertically"),t.add("enableRotateBorderIcons",!0).setType(f.BOOLEAN).setDescription("boolean indicating if tab icons should rotate with the text in the left and right borders"),t.add("tabEnableClose",!0).setType(f.BOOLEAN),t.add("tabCloseType",1).setType("ICloseType"),t.add("tabEnablePopout",!1).setType(f.BOOLEAN).setAlias("tabEnableFloat"),t.add("tabEnablePopoutIcon",!0).setType(f.BOOLEAN),t.add("tabEnablePopoutFloatIcon",!1).setType(f.BOOLEAN),t.add("tabEnablePopoutOverlay",!1).setType(f.BOOLEAN),t.add("tabEnableDrag",!0).setType(f.BOOLEAN),t.add("tabEnableRename",!0).setType(f.BOOLEAN),t.add("tabContentClassName",void 0).setType(f.STRING),t.add("tabClassName",void 0).setType(f.STRING),t.add("tabIcon",void 0).setType(f.STRING),t.add("tabEnableRenderOnDemand",!0).setType(f.BOOLEAN),t.add("tabBorderWidth",-1).setType(f.NUMBER),t.add("tabBorderHeight",-1).setType(f.NUMBER),t.add("tabSetEnableDeleteWhenEmpty",!0).setType(f.BOOLEAN),t.add("tabSetEnableDrop",!0).setType(f.BOOLEAN),t.add("tabSetEnableDrag",!0).setType(f.BOOLEAN),t.add("tabSetEnableDivide",!0).setType(f.BOOLEAN),t.add("tabSetEnableMaximize",!0).setType(f.BOOLEAN),t.add("tabSetEnableClose",!0).setType(f.BOOLEAN),t.add("tabSetEnableCloseButton",!1).setType(f.BOOLEAN),t.add("tabSetEnableSingleTabStretch",!1).setType(f.BOOLEAN),t.add("tabSetAutoSelectTab",!0).setType(f.BOOLEAN),t.add("tabSetEnableActiveIcon",!1).setType(f.BOOLEAN),t.add("tabSetClassNameTabStrip",void 0).setType(f.STRING),t.add("tabSetEnableTabStrip",!0).setType(f.BOOLEAN),t.add("tabSetEnableTabWrap",!1).setType(f.BOOLEAN),t.add("tabSetTabLocation","top").setType("ITabLocation"),t.add("tabMinWidth",1).setType(f.NUMBER),t.add("tabMinHeight",1).setType(f.NUMBER),t.add("tabSetMinWidth",1).setType(f.NUMBER),t.add("tabSetMinHeight",1).setType(f.NUMBER),t.add("tabMaxWidth",Y).setType(f.NUMBER),t.add("tabMaxHeight",Y).setType(f.NUMBER),t.add("tabSetMaxWidth",Y).setType(f.NUMBER),t.add("tabSetMaxHeight",Y).setType(f.NUMBER),t.add("tabSetEnableTabScrollbar",!1).setType(f.BOOLEAN),t.add("borderSize",200).setType(f.NUMBER),t.add("borderMinSize",1).setType(f.NUMBER),t.add("borderMaxSize",Y).setType(f.NUMBER),t.add("borderEnableDrop",!0).setType(f.BOOLEAN),t.add("borderAutoSelectTabWhenOpen",!0).setType(f.BOOLEAN),t.add("borderAutoSelectTabWhenClosed",!1).setType(f.BOOLEAN),t.add("borderClassName",void 0).setType(f.STRING),t.add("borderEnableAutoHide",!1).setType(f.BOOLEAN),t.add("borderEnableTabScrollbar",!1).setType(f.BOOLEAN),t}},X={width:"1em",height:"1em",display:"flex",alignItems:"center"},H=()=>(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",style:X,viewBox:"0 0 24 24",children:[(0,n.jsx)("path",{fill:"none",d:"M0 0h24v24H0z"}),(0,n.jsx)("path",{stroke:"var(--color-icon)",fill:"var(--color-icon)",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})]}),j=t=>{let{controller:e,show:i}=t;return(0,n.jsx)("div",{className:e.getClassName(T.FLEXLAYOUT__LAYOUT_OVERLAY),style:{display:i?"flex":"none"}})},z=((i={}).Close_Tab="Close",i.Close_Tabset="Close tab set",i.Active_Tabset="Active tab set",i.Move_Tabset="Move tab set",i.Move_Tabs="Move tabs(?)",i.Maximize="Maximize tab set",i.Restore="Restore tab set",i.Popout_Tab="Popout selected tab",i.Popout_Tab_Float="Float selected tab",i.Overflow_Menu_Tooltip="Hidden tabs",i.Error_rendering_component="Error rendering component",i.Error_rendering_component_retry="Retry",i),k=t=>{let{controller:e,tabNode:i}=t,o=e.getClassName,s=o(T.FLEXLAYOUT__TAB_BUTTON_STAMP),a=R(e,i),r=a.content?(0,n.jsx)("div",{className:o(T.FLEXLAYOUT__TAB_BUTTON_CONTENT),children:a.content}):i.getNameForOverflowMenu(),l=a.leading?(0,n.jsx)("div",{className:o(T.FLEXLAYOUT__TAB_BUTTON_LEADING),children:a.leading}):null;return(0,n.jsxs)("div",{className:s,title:i.getHelpText(),children:[l,r]})};function G(t,e,i,o,s){let a=s.getRootDiv(),r=s.getClassName,l=t.ownerDocument,d=t.getBoundingClientRect(),h=a?.getBoundingClientRect()??new DOMRect(0,0,100,100),u=l.createElement("div");u.className=r(T.FLEXLAYOUT__POPUP_MENU_CONTAINER),d.left<h.left+h.width/2?u.style.left=d.left-h.left+"px":u.style.right=h.right-d.right+"px",d.top<h.top+h.height/2?u.style.top=d.top-h.top+"px":u.style.bottom=h.bottom-d.bottom+"px",s.showOverlayOnAllWindows(!0),a&&a.appendChild(u);let c=()=>{s.hideControlInPortal(),s.showOverlayOnAllWindows(!1),a&&a.removeChild(u),u.removeEventListener("pointerdown",g),l.removeEventListener("pointerdown",_)},g=t=>{t.stopPropagation()},_=t=>{c()};u.addEventListener("pointerdown",g),l.addEventListener("pointerdown",_),s.showControlInPortal((0,n.jsx)(V,{currentDocument:l,parentNode:e,onSelect:o,onHide:c,items:i,classNameMapper:r,controller:s}),u)}var V=t=>{let{parentNode:e,items:i,onHide:o,onSelect:s,classNameMapper:a,controller:r}=t,l=(0,d.useRef)(null);(0,d.useEffect)(()=>{l.current&&l.current.focus()},[]);let h=t=>{r.getDragDropManager().clearDragMain()},u=i.map((t,i)=>{let l=a(T.FLEXLAYOUT__POPUP_MENU_ITEM);return e.getSelected()===t.index&&(l+=" "+a(T.FLEXLAYOUT__POPUP_MENU_ITEM__SELECTED)),(0,n.jsx)("div",{className:l,"data-layout-path":"/popup-menu/tb"+i,onClick:e=>{s(t),o(),e.stopPropagation()},draggable:!0,onDragStart:e=>{var i;return i=t.node,void(e.stopPropagation(),r.getDragDropManager().setDragNode(e.nativeEvent,i),setTimeout(()=>{o()},0))},onDragEnd:h,title:t.node.getHelpText(),children:(0,n.jsx)(k,{tabNode:t.node,controller:r})},t.index)});return(0,n.jsx)("div",{className:a(T.FLEXLAYOUT__POPUP_MENU),ref:l,tabIndex:0,onKeyDown:t=>{"Escape"===t.key&&o()},"data-layout-path":"/popup-menu",children:u})},J=((o={})[o.Visible=1]="Visible",o[o.Always=2]="Always",o[o.Selected=3]="Selected",o),Z=t=>{let{controller:e,tabNode:i,selected:o,path:s}=t,a=d.useRef(null),r=d.useRef(null),l=e.getIcons();d.useLayoutEffect(()=>{i.setTabRect(e.getBoundingClientRect(a.current)),e.getEditingTab()===i&&r.current.select()});let h=t=>{t.target!==r.current&&(e.getCurrentDocument().body.removeEventListener("pointerdown",h),e.setEditingTab(void 0))},u=e.getClassName,c=i.getParent(),g=c.isEnableSingleTabStretch()&&1===c.getChildren().length,_=g?T.FLEXLAYOUT__TAB_BUTTON_STRETCH:T.FLEXLAYOUT__TAB_BUTTON,b=u(_);b+=" "+u(_+"_"+c.getTabLocation()),g||(o?b+=" "+u(_+"--selected"):b+=" "+u(_+"--unselected")),void 0!==i.getClassName()&&(b+=" "+i.getClassName());let E=R(e,i),f=E.content?(0,n.jsx)("div",{className:u(T.FLEXLAYOUT__TAB_BUTTON_CONTENT),children:E.content}):null,m=E.leading?(0,n.jsx)("div",{className:u(T.FLEXLAYOUT__TAB_BUTTON_LEADING),children:E.leading}):null;if(e.getEditingTab()===i&&(f=(0,n.jsx)("input",{ref:r,className:u(T.FLEXLAYOUT__TAB_BUTTON_TEXTBOX),"data-layout-path":s+"/textbox",type:"text",autoFocus:!0,defaultValue:i.getName(),onKeyDown:t=>{"Escape"===t.code?e.setEditingTab(void 0):("Enter"===t.code||"NumpadEnter"===t.code)&&(e.setEditingTab(void 0),e.doAction(p.renameTab(i.getId(),t.target.value)))},onPointerDown:t=>{t.stopPropagation()}})),i.isCloseable()&&!g){let t=e.i18nName(z.Close_Tab);E.buttons.push((0,n.jsx)("div",{"data-layout-path":s+"/button/close",title:t,className:u(T.FLEXLAYOUT__TAB_BUTTON_TRAILING),onPointerDown:t=>{t.stopPropagation()},onClick:t=>{let s;s=i.getCloseType(),(o||s===J.Always||s===J.Visible&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches||0)&&(e.doAction(p.deleteTab(i.getId())),t.stopPropagation())},children:"function"==typeof l.close?l.close(i):l.close},"close"))}return(0,n.jsxs)("div",{ref:a,"data-layout-path":s,className:b,onClick:()=>{e.doAction(p.selectTab(i.getId()))},onAuxClick:t=>{O(t)&&e.auxMouseClick(i,t)},onContextMenu:t=>{e.showContextMenu(i,t)},title:i.getHelpText(),draggable:!0,onDragStart:t=>{i.isEnableDrag()?(t.stopPropagation(),e.getDragDropManager().setDragNode(t.nativeEvent,i)):t.preventDefault()},onDragEnd:t=>{e.getDragDropManager().clearDragMain()},onDoubleClick:t=>{i.isEnableRename()&&(e.setEditingTab(i),e.getCurrentDocument().body.addEventListener("pointerdown",h),t.stopPropagation())},children:[m,f,E.buttons]})},$=(t,e,i,o,s,a)=>{let[n,r]=d.useState([]),[l,h]=d.useState(!1),[u,g]=d.useState(!1),_=d.useRef(null),T=d.useRef(!1),p=d.useRef(void 0),b=d.useRef([]),E=d.useRef(0),f=d.useRef(!1);b.current=n,d.useLayoutEffect(()=>{o.current&&B(0)},[e.getId()]),d.useLayoutEffect(()=>{T.current=!1},[e.getSelectedNode(),e.getRect().width,e.getRect().height]),d.useLayoutEffect(()=>{v(),!1===T.current&&function(){let i=e.getSelectedNode();if(i&&o.current){let e=t.getBoundingClientRect(o.current),s=i.getTabRect(),a=N(e)-N(s);a>0||I(s)>I(e)?(B(M(o.current)-a),f.current=!0):(a=D(s)-D(e))>0&&(B(M(o.current)+a),f.current=!0)}}(),L(),y()}),d.useEffect(()=>(_.current?.addEventListener("wheel",m,{passive:!1}),()=>{_.current?.removeEventListener("wheel",m)}),[_.current]);let m=t=>{t.preventDefault()},L=()=>{if(o.current&&s.current){let t=o.current,e=s.current,a=S(t),n=C(t),r=M(t);if(n>a&&n>0){let t=a*a/n,o=0;t<20&&(o=20-t,t=20);let s=r*(a-o)/n;i===c.HORZ?(e.style.width=t+"px",e.style.left=s+"px"):(e.style.height=t+"px",e.style.top=s+"px"),e.style.display="block"}else e.style.display="none";i===c.HORZ?e.style.bottom="0px":e.style.right="0px"}},y=()=>{let t=x().length>0;t!==l&&h(t),void 0===p.current&&(p.current=setTimeout(()=>{var t,e;let i=x();t=i,e=b.current,t.length===e.length&&t.every((t,i)=>t===e[i])||r(i),p.current=void 0},100))},A=(t,e)=>{if(o.current&&s.current){let a,n=o.current,r=s.current,l=S(n),d=C(n),h=S(r),u=n.getBoundingClientRect();a=Math.max(0,Math.min(d-h,a=i===c.HORZ?t-u.x-E.current:e-u.y-E.current)),l>0&&B(a*d/l)}},R=()=>{},O=()=>{},v=()=>{if(o.current){let t=S(o.current.firstElementChild)+10*!!u>S(o.current);t!==u&&g(t)}},x=()=>{let t=[];if(o.current){let e=o.current,i=e.getBoundingClientRect(),s=N(i)-1,n=D(i)+1,r=e.firstElementChild,l=0;Array.from(r.children).forEach(e=>{let i=e.getBoundingClientRect();e.classList.contains(a)&&((N(i)<s||D(i)>n)&&t.push(l),l++)})}return t},N=t=>i===c.HORZ?t.x:t.y,D=t=>i===c.HORZ?t.right:t.bottom,S=t=>i===c.HORZ?t.clientWidth:t.clientHeight,I=t=>i===c.HORZ?t.width:t.height,C=t=>i===c.HORZ?t.scrollWidth:t.scrollHeight,B=t=>{i===c.HORZ?o.current.scrollLeft=t:o.current.scrollTop=t},M=t=>i===c.HORZ?t.scrollLeft:t.scrollTop;return{selfRef:_,userControlledPositionRef:T,onScroll:()=>{f.current||(T.current=!0),f.current=!1,L(),y()},onScrollPointerDown:t=>{t.stopPropagation(),s.current.setPointerCapture(t.pointerId);let e=s.current.getBoundingClientRect();i===c.HORZ?E.current=t.clientX-e.x:E.current=t.clientY-e.y,w(t.currentTarget.ownerDocument,t,A,R,O)},hiddenTabs:n,onMouseWheel:t=>{if(o.current){let i;if(0!==e.getChildren().length&&Math.abs(t.deltaY)>0){i=-t.deltaY,1===t.deltaMode&&(i*=40);let e=M(o.current)-i;B(Math.max(0,Math.min(C(o.current)-S(o.current),e))),t.stopPropagation()}}},isDockStickyButtons:u,isShowHiddenTabs:l}},q=t=>{let{tabsetNode:e,controller:i}=t,o=d.useRef(null),s=d.useRef(null),a=d.useRef(null),r=d.useRef(null),l=d.useRef(null),u=d.useRef(null),g=d.useRef(null),_=i.getIcons();d.useLayoutEffect(()=>{e.setRect(i.getBoundingClientRect(b.current)),o.current&&e.setTabStripRect(i.getBoundingClientRect(o.current));let t=i.getBoundingClientRect(r.current);e.getContentRect().equalsWhenRounded(t)||isNaN(t.x)||(e.setContentRect(t),i.setReLayout(!0))});let{selfRef:b,userControlledPositionRef:E,onScroll:f,onScrollPointerDown:m,hiddenTabs:L,onMouseWheel:y,isDockStickyButtons:A,isShowHiddenTabs:R}=$(i,e,c.HORZ,a,s,i.getClassName(T.FLEXLAYOUT__TAB_BUTTON)),v=t=>{let o=i.getShowOverflowMenu(),s=L.map(t=>({index:t,node:e.getChildren()[t]}));void 0!==o?o(e,t,s,x):G(u.current,e,s,x,i),t.stopPropagation()},x=t=>{i.doAction(p.selectTab(t.node.getId())),E.current=!1},N=t=>{i.getEditingTab()?t.preventDefault():e.isEnableDrag()?(t.stopPropagation(),i.getDragDropManager().setDragNode(t.nativeEvent,e)):t.preventDefault()},w=t=>{O(t)||i.doAction(p.setActiveTabset(e.getId(),i.getLayoutId()))},D=t=>{O(t)&&i.auxMouseClick(e,t)},S=t=>{i.showContextMenu(e,t)},I=t=>{t.stopPropagation()},C=t=>{e.canMaximize()&&i.maximize(e),t.stopPropagation()},B=t=>{i.doAction(p.deleteTabset(e.getId())),t.stopPropagation()},M=t=>{i.doAction(p.deleteTab(e.getChildren()[0].getId())),t.stopPropagation()},U=t=>{void 0!==W&&i.doAction(p.popoutTab(W.getId(),"window")),t.stopPropagation()},F=t=>{void 0!==W&&i.doAction(p.popoutTab(W.getId(),"float")),t.stopPropagation()},P=t=>{e.canMaximize()&&i.maximize(e)},Y=i.getClassName,W=e.getSelectedNode(),X=e.getPath(),H=(()=>{let t=[],o=!1;if(e.isEnableTabStrip()){let s=e.isEnableSingleTabStretch()&&1===e.getChildren().length;for(let a=0;a<e.getChildren().length;a++){let r=e.getChildren()[a],l=e.getSelected()===a,d=Y(T.FLEXLAYOUT__TABSET_TAB_SPACER);0!==a&&(d+=" "+Y(T.FLEXLAYOUT__TABSET_TAB_DIVIDER)),e.isEnableTabWrap()||s||(l?d+=" "+Y(T.FLEXLAYOUT__TABSET_TAB_DIVIDER_SELECTED_BEFORE):o&&(d+=" "+Y(T.FLEXLAYOUT__TABSET_TAB_DIVIDER_SELECTED_AFTER))),t.push((0,n.jsx)("div",{className:d,children:(0,n.jsx)("div",{className:Y(T.FLEXLAYOUT__TABSET_TAB_DIVIDER_INNER)})},"divider"+a)),t.push((0,n.jsx)(Z,{controller:i,tabNode:r,path:X+"/tb"+a,selected:l},r.getId())),a===e.getChildren().length-1&&(d=Y(T.FLEXLAYOUT__TABSET_TAB_SPACER),e.isEnableTabWrap()||s||!l||(d+=" "+Y(T.FLEXLAYOUT__TABSET_TAB_DIVIDER_SELECTED_AFTER)),t.push((0,n.jsx)("div",{className:d,children:(0,n.jsx)("div",{className:Y(T.FLEXLAYOUT__TABSET_TAB_DIVIDER_INNER)})},"divider"+(a+1)))),o=l}}return t})(),{leading:j,buttonbar:k}=(t=>{let o,s=[],a=[],r={leading:o,stickyButtons:s,buttons:a,overflowPosition:void 0};i.customizeTabSet(e,r),o=r.leading,s=r.stickyButtons,a=r.buttons;let d=e.isEnableSingleTabStretch()&&1===e.getChildren().length,h=d&&e.getChildren()[0].isCloseable()||e.isCloseable();if(h=h&&e.isEnableCloseButton(),void 0===r.overflowPosition&&(r.overflowPosition=s.length),s.length>0&&(!e.isEnableTabWrap()&&(A||d)?a=[...s,...a]:t.push((0,n.jsx)("div",{ref:g,onPointerDown:I,onDragStart:t=>{t.preventDefault()},className:Y(T.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER),children:s},"sticky_buttons_container"))),!e.isEnableTabWrap()&&R){let t,o=i.i18nName(z.Overflow_Menu_Tooltip);if("function"==typeof _.more){let i=L.map(t=>({index:t,node:e.getChildren()[t]}));t=_.more(e,i)}else t=(0,n.jsxs)(n.Fragment,{children:[_.more,(0,n.jsx)("div",{className:Y(T.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT),children:L.length>0?L.length:""})]});a.splice(Math.min(r.overflowPosition,a.length),0,(0,n.jsx)("button",{"data-layout-path":X+"/button/overflow",ref:u,className:Y(T.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+Y(T.FLEXLAYOUT__TAB_BUTTON_OVERFLOW),title:o,onClick:v,onPointerDown:I,children:t},"overflowbutton"))}if(void 0!==W){if(W.isEnablePopoutFloatIcon()){let t=i.i18nName(z.Popout_Tab_Float);a.push((0,n.jsx)("button",{"data-layout-path":X+"/button/popout-float",title:t,className:Y(T.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+Y(T.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_FLOAT),onClick:F,onPointerDown:I,children:"function"==typeof _.popoutFloat?_.popoutFloat(W):_.popoutFloat},"popout-float"))}if(i.isSupportsPopout()&&W.isAllowedInWindow()&&W.isEnablePopout()){let t=i.i18nName(z.Popout_Tab);a.push((0,n.jsx)("button",{"data-layout-path":X+"/button/popout",title:t,className:Y(T.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+Y(T.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_FLOAT),onClick:U,onPointerDown:I,children:"function"==typeof _.popout?_.popout(W):_.popout},"popout"))}}if(e.canMaximize()){let t=i.i18nName(z.Restore),o=i.i18nName(z.Maximize);a.push((0,n.jsx)("button",{"data-layout-path":X+"/button/max",title:e.isMaximized()?t:o,className:Y(T.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+Y(T.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_+(e.isMaximized()?"max":"min")),onClick:C,onPointerDown:I,children:e.isMaximized()?"function"==typeof _.restore?_.restore(e):_.restore:"function"==typeof _.maximize?_.maximize(e):_.maximize},"max"))}if(!e.isMaximized()&&h){let t=d?i.i18nName(z.Close_Tab):i.i18nName(z.Close_Tabset);a.push((0,n.jsx)("button",{"data-layout-path":X+"/button/close",title:t,className:Y(T.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+Y(T.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE),onClick:d?M:B,onPointerDown:I,children:"function"==typeof _.closeTabset?_.closeTabset(e):_.closeTabset},"close"))}if(e.isActive()&&e.isEnableActiveIcon()){let t=i.i18nName(z.Active_Tabset);a.push((0,n.jsx)("div",{"data-layout-path":X+"/button/active",title:t,className:Y(T.FLEXLAYOUT__TAB_TOOLBAR_ICON),children:"function"==typeof _.activeTabset?_.activeTabset(e):_.activeTabset},"active"))}return{leading:o,buttonbar:(0,n.jsx)("div",{ref:l,className:Y(T.FLEXLAYOUT__TAB_TOOLBAR),onPointerDown:I,onDragStart:t=>{t.preventDefault()},children:a},"buttonbar")}})(H),V=(t=>{let o;if(0===e.getChildren().length){let t=i.getTabSetPlaceHolderCallback();t&&(o=t(e))}let s=(0,n.jsx)("div",{ref:r,className:Y(T.FLEXLAYOUT__TABSET_CONTENT),children:o});return"top"===e.getTabLocation()?(0,n.jsxs)(n.Fragment,{children:[t,s]}):(0,n.jsxs)(n.Fragment,{children:[s,t]})})(((t,i,r)=>{let l,d,h=Y(T.FLEXLAYOUT__TABSET_TABBAR_OUTER);void 0!==e.getClassNameTabStrip()&&(h+=" "+e.getClassNameTabStrip()),h+=" "+T.FLEXLAYOUT__TABSET_TABBAR_OUTER_+e.getTabLocation(),e.isActive()&&(h+=" "+Y(T.FLEXLAYOUT__TABSET_SELECTED)),e.isMaximized()&&(h+=" "+Y(T.FLEXLAYOUT__TABSET_MAXIMIZED));let u=e.isEnableSingleTabStretch()&&1===e.getChildren().length;if(u){let t=e.getChildren()[0];void 0!==t.getTabSetClassName()&&(h+=" "+t.getTabSetClassName())}if(i&&(l=(0,n.jsx)("div",{className:Y(T.FLEXLAYOUT__TABSET_LEADING),children:i})),e.isEnableTabWrap())e.isEnableTabStrip()&&(d=(0,n.jsxs)("div",{className:h,style:{flexWrap:"wrap",gap:"1px",marginTop:"2px"},ref:o,"data-layout-path":X+"/tabstrip",onPointerDown:w,onDoubleClick:P,onContextMenu:S,onClick:D,onAuxClick:D,draggable:!0,onDragStart:N,children:[l,t,(0,n.jsx)("div",{style:{flexGrow:1}}),r]}));else if(e.isEnableTabStrip()){let i;e.isEnableTabScrollbar()&&(i=(0,n.jsx)("div",{ref:s,className:Y(T.FLEXLAYOUT__MINI_SCROLLBAR),onPointerDown:m})),d=(0,n.jsxs)("div",{className:h,ref:o,"data-layout-path":X+"/tabstrip",onPointerDown:w,onDoubleClick:P,onContextMenu:S,onClick:D,onAuxClick:D,draggable:!0,onWheel:y,onDragStart:N,children:[l,(0,n.jsxs)("div",{className:Y(T.FLEXLAYOUT__MINI_SCROLLBAR_CONTAINER),children:[(0,n.jsx)("div",{ref:a,className:Y(T.FLEXLAYOUT__TABSET_TABBAR_INNER)+" "+Y(T.FLEXLAYOUT__TABSET_TABBAR_INNER_+e.getTabLocation()),style:{overflowX:"auto",overflowY:"hidden"},onScroll:f,children:(0,n.jsx)("div",{style:{width:u?"100%":"none"},className:Y(T.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER)+" "+Y(T.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER_+e.getTabLocation()),children:t})}),i]}),r]})}return d})(H,j,k)),J={flexGrow:Math.max(1,1e3*e.getWeight()),minWidth:e.getMinWidth(),minHeight:e.getMinHeight(),maxWidth:e.getMaxWidth(),maxHeight:e.getMaxHeight()};void 0===e.getModel().getMaximizedTabset(i.getLayoutId())||e.isMaximized()||(J.display="none");let q=(0,n.jsx)("div",{ref:b,className:Y(T.FLEXLAYOUT__TABSET_CONTAINER),style:J,children:(0,n.jsx)("div",{className:Y(T.FLEXLAYOUT__TABSET),"data-layout-path":X,children:V})});return e.isMaximized()&&i.getMainElement()?(0,h.createPortal)((0,n.jsx)("div",{style:{position:"absolute",display:"flex",top:0,left:0,bottom:0,right:0},children:q}),i.getMainElement()):q},K=t=>{let{controller:e,node:i,index:o,horizontal:s}=t,a=d.useRef(null),r=d.useRef(null),l=d.useRef([]),h=d.useRef(void 0),u=d.useRef(void 0),_=d.useRef(0),b=d.useRef(0),E=d.useRef({initialSizes:[],sum:0,startPosition:0});d.useEffect(()=>(a.current?.addEventListener("touchstart",f,{passive:!1}),r.current?.addEventListener("touchstart",f,{passive:!1}),()=>{a.current?.removeEventListener("touchstart",f),r.current?.removeEventListener("touchstart",f)}),[]);let f=t=>{t.preventDefault(),t.stopImmediatePropagation()},m=()=>{let t=e.getRootDiv();t&&h.current&&t.removeChild(h.current),h.current=void 0},L=(t,o)=>{if(h.current){let s=e.getDomRect();s&&(i.getOrientation()===c.VERT?h.current.style.top=O(o-s.y-b.current)+"px":h.current.style.left=O(t-s.x-_.current)+"px",e.isRealtimeResize()&&R(!0))}},y=()=>{if(h.current){R(!1);let t=e.getRootDiv();t&&h.current&&t.removeChild(h.current),h.current=void 0}v(!0,e.getCurrentDocument())},R=t=>{if(h.current){let t;if(t=i.getOrientation()===c.VERT?h.current.offsetTop:h.current.offsetLeft,i instanceof U){let o=i.calculateSplit(i,t);e.doAction(p.adjustBorderSplit(i.getId(),o))}else{let s=E.current,a=i.calculateSplit(o,t,s.initialSizes,s.sum,s.startPosition);e.doAction(p.adjustWeights(i.getId(),a))}}},O=t=>{let e=l.current,i=t;return t<e[0]&&(i=e[0]),t>e[1]&&(i=e[1]),i},x=e.getClassName,N={cursor:s?"ew-resize":"ns-resize",flexDirection:s?"column":"row"},D=x(T.FLEXLAYOUT__SPLITTER)+" "+x(T.FLEXLAYOUT__SPLITTER_+i.getOrientation().getName());return i instanceof U?D+=" "+x(T.FLEXLAYOUT__SPLITTER_BORDER):void 0!==i.getModel().getMaximizedTabset(e.getLayoutId())&&(N.display="none"),A()||(N["--splitter-active-size"]="30px"),(0,n.jsx)("div",{className:D,style:N,ref:a,"data-layout-path":i.getPath()+"/s"+(o-1),onPointerDown:t=>{t.stopPropagation(),i instanceof I&&(E.current=i.getSplitterInitials(o)),v(!1,e.getCurrentDocument()),w(t.currentTarget.ownerDocument,t,L,y,m),l.current=i.getSplitterBounds(o,!0);let n=e.getRootDiv();h.current=e.getCurrentDocument().createElement("div"),h.current.style.flexDirection=s?"row":"column",h.current.className=e.getClassName(T.FLEXLAYOUT__SPLITTER_DRAG)+(i instanceof U?" "+e.getClassName(T.FLEXLAYOUT__SPLITTER_BORDER):""),h.current.style.cursor=i.getOrientation()===c.VERT?"ns-resize":"ew-resize",u.current=e.getCurrentDocument().createElement("div"),u.current.className=x(T.FLEXLAYOUT__SPLITTER_HANDLE)+" "+(s?x(T.FLEXLAYOUT__SPLITTER_HANDLE_HORZ):x(T.FLEXLAYOUT__SPLITTER_HANDLE_VERT)),h.current.appendChild(u.current);let r=a.current.getBoundingClientRect(),d=new g(r.x-e.getDomRect().x,r.y-e.getDomRect().y,r.width,r.height);_.current=t.clientX-r.x,b.current=t.clientY-r.y,d.positionElement(h.current),n&&n.appendChild(h.current)},children:(0,n.jsx)("div",{className:x(T.FLEXLAYOUT__SPLITTER_HANDLE)+" "+(s?x(T.FLEXLAYOUT__SPLITTER_HANDLE_HORZ):x(T.FLEXLAYOUT__SPLITTER_HANDLE_VERT))})})},Q=t=>{let{controller:e,rowNode:i}=t,o=d.useRef(null),s=i.getOrientation()===c.HORZ;d.useLayoutEffect(()=>{i.setRect(e.getBoundingClientRect(o.current))});let a=[],r=0;for(let t of i.getChildren())r>0&&a.push((0,n.jsx)(K,{controller:e,node:i,index:r,horizontal:s},"splitter"+r)),t instanceof I?a.push((0,n.jsx)(Q,{controller:e,rowNode:t},t.getId())):t instanceof C&&a.push((0,n.jsx)(q,{controller:e,tabsetNode:t},t.getId())),r++;let l={flexGrow:Math.max(1,1e3*i.getWeight()),minWidth:i.getMinWidth(),minHeight:i.getMinHeight(),maxWidth:i.getMaxWidth(),maxHeight:i.getMaxHeight()};return s?l.flexDirection="row":l.flexDirection="column",(0,n.jsx)("div",{ref:o,className:e.getClassName(T.FLEXLAYOUT__ROW),style:l,children:a})},tt=t=>{let{controller:e,selected:i,tabNode:o}=t,s=d.useRef(null),a=d.useRef(!0),r=o.getParent(),l=r.getContentRect();d.useLayoutEffect(()=>{let t=()=>{o.saveScrollPosition()},i=o.getMoveableElement();return i&&(s.current.appendChild(i),i.addEventListener("scroll",t)),s.current.addEventListener("pointerdown",h),()=>{s.current&&s.current.removeEventListener("pointerdown",h),i&&(o.isEnableWindowReMount()||e.getMainController()?.getMoveablesDiv()?.appendChild(i),i.removeEventListener("scroll",t)),o.setVisible(!1)}},[o.getMoveableElement()]),d.useEffect(()=>{o.isSelected()&&a.current&&(o.restoreScrollPosition(),a.current=!1)});let h=()=>{let t=o.getParent();t instanceof C&&!t.isActive()&&e.doAction(p.setActiveTabset(t.getId(),e.getLayoutId()))};o.setRect(l);let u=e.getClassName,c={};l.styleWithPosition(c);let g=null;if(i){if(o.setVisible(!0),document.hidden&&o.isEnablePopoutOverlay()){let t={};l.styleWithPosition(t),g=(0,n.jsx)("div",{style:t,className:u(T.FLEXLAYOUT__TAB_OVERLAY)})}}else c.display="none",o.setVisible(!1);r instanceof C&&void 0!==o.getModel().getMaximizedTabset(e.getLayoutId())&&!r.isMaximized()&&(c.display="none"),r instanceof U&&!r.isShowing()&&(c.display="none");let _=u(T.FLEXLAYOUT__TAB);return r instanceof U&&(_+=" "+u(T.FLEXLAYOUT__TAB_BORDER),_+=" "+u(T.FLEXLAYOUT__TAB_BORDER_+r.getLocation().getName())),void 0!==o.getContentClassName()&&(_+=" "+o.getContentClassName()),(0,n.jsxs)(n.Fragment,{children:[g,(0,n.jsx)("div",{ref:s,style:c,className:_,"data-layout-path":o.getPath()})]})},te=class extends d.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,e){console.debug(t),console.debug(e)}retry=()=>{this.setState({hasError:!1})};render(){return this.state.hasError?(0,n.jsx)("div",{className:T.FLEXLAYOUT__ERROR_BOUNDARY_CONTAINER,children:(0,n.jsx)("div",{className:T.FLEXLAYOUT__ERROR_BOUNDARY_CONTENT,children:(0,n.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[this.props.message,(0,n.jsx)("p",{children:(0,n.jsx)("button",{onClick:this.retry,children:this.props.retryText})})]})})}):this.props.children}},ti=d.memo(({controller:t,tabNode:e})=>{let i;return ti.displayName="TabContentRenderer",e.getComponent()?i=t.getFactory()(e):e.getSubLayoutId()&&(i=(0,n.jsxs)("div",{className:t.getClassName(T.FLEXLAYOUT__TAB_LAYOUT_CONTAINER),children:[(0,n.jsx)(tb,{...t.getProps(),layoutId:e.getSubLayoutId(),mainLayoutController:t.getMainController()}),";"]})),(0,n.jsx)(te,{message:t.i18nName(z.Error_rendering_component),retryText:t.i18nName(z.Error_rendering_component_retry),children:i})},function(t,e){return!(e.visible&&(t.windowId!==e.windowId||t.fullRedrawRevision!==e.fullRedrawRevision||t.parentRedrawRevision!==e.parentRedrawRevision||void 0!==e.tabNode.getSubLayoutId()))}),to=class t{static dragState=void 0;_controller;_dragEnterCount=0;_dragging=!1;_active=!1;_dropInfo;_outlineDiv;_mainController;constructor(t){this._controller=t,this._mainController=t.getMainController()}addTabWithDragAndDrop(e,i,o){let s=y.fromJson(i,this._controller.getModel(),!1);t.dragState=new ta(this._controller.getMainController(),ts.Add,s,i,o)}moveTabWithDragAndDrop(t,e){this.setDragNode(t,e)}setDragNode=(e,i)=>{if(t.dragState=new ta(this._controller.getMainController(),ts.Internal,i,void 0,void 0),e.dataTransfer.setData("text/plain","--flexlayout--"),e.dataTransfer.effectAllowed="copyMove",e.dataTransfer.dropEffect="move",this._dragEnterCount=0,i instanceof C){let t=!1,o=this._controller.i18nName(z.Move_Tabset);if(i.getChildren().length>0&&(o=this._controller.i18nName(z.Move_Tabs).replace("?",String(i.getChildren().length))),this._controller.getProps().onRenderDragRect){let s=this._controller.getProps().onRenderDragRect(o,i,void 0);s&&(this.setDragComponent(e,s,10,10),t=!0)}t||this.setDragComponent(e,o,10,10)}else{let t=e.target;if(t&&"function"==typeof t.getBoundingClientRect){let o=t.getBoundingClientRect(),s=e.clientX-o.left,a=e.clientY-o.top,r=i?.getParent(),l=r instanceof U&&r.getOrientation()===c.HORZ,d=l?10:s,h=l?10:a,u=!1;if(this._controller.getProps().onRenderDragRect){let t=(0,n.jsx)(k,{controller:this._controller,tabNode:i},i.getId()),o=this._controller.getProps().onRenderDragRect(t,i,void 0);o&&(this.setDragComponent(e,o,d,h),u=!0)}if(!u){let t;!(t=navigator.userAgent).includes("Safari")||t.includes("Chrome")||t.includes("Chromium")?e.dataTransfer.setDragImage(i.getTabStamp(),d,h):this.setDragComponent(e,(0,n.jsx)(k,{tabNode:i,controller:this._controller}),d,h)}}}};setDragComponent(t,e,i,o){let s=(0,n.jsx)("div",{style:{position:"unset"},className:this._controller.getClassName(T.FLEXLAYOUT__LAYOUT)+" "+this._controller.getClassName(T.FLEXLAYOUT__DRAG_RECT),children:e});this._controller.getModel().sortLayouts();let a=this._controller.getCurrentDocument(),r=a.createElement("div");r.setAttribute("data-layout-path","/drag-rectangle"),r.style.position="absolute",r.style.left="-10000px",r.style.top="-10000px",a.body.appendChild(r),(0,u.createRoot)(r).render(s),t.dataTransfer.setDragImage(r,i,o),setTimeout(()=>{a.body.removeChild(r)},0)}updateActive(t){let e=Array.from(this._controller.getModel().getLayouts().values()),i=!1;for(let o=e.length-1;o>=0;o--){let s=e[o].getController()?.getDragDropManager();if(s){let e=!i&&s.getDragEnterCount()>0;e&&(i=!0),s.setActive(e,t)}}}setActive(t,e){this._active!==t&&(this._active=t,this._active?this.onDragEnter(e):this.onDragLeave(e))}onDragEnterRaw=t=>{this._dragEnterCount++,this.updateActive(t)};onDragLeaveRaw=t=>{this._dragEnterCount--,this.updateActive(t)};clearDragMain(){for(let[,t]of(this._controller.showOverlayOnAllWindows(!1),this._controller.getModel().getLayouts()))t.getController()&&t.getController().getDragDropManager().clearDragLocal()}clearDragLocal(){this._dragEnterCount=0,this._active=!1,this.clearDragLocalVisuals()}clearDragLocalVisuals(){this._controller.setState({showEdges:!1}),this._dragging=!1,this._outlineDiv&&(this._controller.getRootDiv().removeChild(this._outlineDiv),this._outlineDiv=void 0)}onDragEnter=e=>{if(!t.dragState&&this._controller.getProps().onExternalDrag){let i=this._controller.getProps().onExternalDrag(e);if(i){let e=y.fromJson(i.json,this._controller.getModel(),!1);t.dragState=new ta(this._controller.getMainController(),ts.External,e,i.json,i.onDrop)}}if(this._mainController===t.dragState?.mainLayoutController&&t.dragState){e.preventDefault(),this._dropInfo=void 0;let t=this._controller.getRootDiv();this._outlineDiv=this._controller.getCurrentDocument().createElement("div"),this._outlineDiv.className=this._controller.getClassName(T.FLEXLAYOUT__OUTLINE_RECT),this._outlineDiv.style.visibility="hidden";let i=this._controller.getTabDragSpeed();this._outlineDiv.style.transition=`top ${i}s, left ${i}s, width ${i}s, height ${i}s`,t.appendChild(this._outlineDiv),this._dragging=!0,this._controller.showOverlayOnAllWindows(!0),void 0===this._controller.getModel().getMaximizedTabset(this._controller.getLayoutId())&&this._controller.setState({showEdges:this._controller.getModel().isEnableEdgeDock()});let o=this._controller.getRootDiv().getBoundingClientRect();new g(e.clientX-o.left,e.clientY-o.top,1,1).positionElement(this._outlineDiv)}};onDragOver=e=>{if(this._mainController===t.dragState?.mainLayoutController&&this._active){let i=this._controller.getRootDiv()?.getBoundingClientRect(),o={x:e.clientX-(i?.left??0),y:e.clientY-(i?.top??0)};this._controller.checkForBorderToShow(o.x,o.y);let s=this._controller.getModel().findDropTargetNode(this._controller.getLayoutId(),t.dragState.dragNode,o.x,o.y);s&&(e.preventDefault(),this._dropInfo=s,this._outlineDiv&&(this._outlineDiv.className=this._controller.getClassName(s.className),s.rect.positionElement(this._outlineDiv),this._outlineDiv.style.visibility="visible"))}};onDragLeave=e=>{if(this._mainController===t.dragState?.mainLayoutController&&(this.clearDragLocalVisuals(),this._controller.isMainLayout())){let t=!1;for(let[,e]of this._controller.getModel().getLayouts())if(e.getController()&&e.getController().getDragDropManager().isDragging()){t=!0;break}!1===t&&this.clearDragMain()}};onDrop=e=>{if(this._mainController===t.dragState?.mainLayoutController){if(this._active){e.preventDefault();let i=t.dragState;if(this._dropInfo)if(void 0!==i.dragJson){let t=this._controller.doAction(p.addNode(i.dragJson,this._dropInfo.node.getId(),this._dropInfo.location,this._dropInfo.index));void 0!==i.fnNewNodeDropped&&i.fnNewNodeDropped(t,e)}else void 0!==i.dragNode&&this._controller.doAction(p.moveNode(i.dragNode.getId(),this._dropInfo.node.getId(),this._dropInfo.location,this._dropInfo.index));this.clearDragMain(),t.dragState=void 0}this._dragEnterCount=0}};getDragEnterCount(){return this._dragEnterCount}isDragging(){return this._dragging}},ts=((s={}).Internal="internal",s.External="external",s.Add="add",s),ta=class{mainLayoutController;dragSource;dragNode;dragJson;fnNewNodeDropped;constructor(t,e,i,o,s){this.mainLayoutController=t,this.dragSource=e,this.dragNode=i,this.dragJson=o,this.fnNewNodeDropped=s}},tn=({controller:t})=>{let e=[],i=t.getIcons().edgeArrow;if(t.getState().showEdges&&t.getModel().isEnableEdgeDockIndicators()){let o=t.getModel().getRootRow(t.getLayoutId()).getRect(),s=t.getClassName(T.FLEXLAYOUT__EDGE_RECT);e.push((0,n.jsx)("div",{style:{top:0,left:o.width/2-50,width:100,height:10,borderBottomLeftRadius:50,borderBottomRightRadius:50},className:s+" "+t.getClassName(T.FLEXLAYOUT__EDGE_RECT_TOP),children:(0,n.jsx)("div",{style:{transform:"rotate(180deg)"},children:i})},"North")),e.push((0,n.jsx)("div",{style:{top:o.height/2-50,left:0,width:10,height:100,borderTopRightRadius:50,borderBottomRightRadius:50},className:s+" "+t.getClassName(T.FLEXLAYOUT__EDGE_RECT_LEFT),children:(0,n.jsx)("div",{style:{transform:"rotate(90deg)"},children:i})},"West")),e.push((0,n.jsx)("div",{style:{top:o.height-10,left:o.width/2-50,width:100,height:10,borderTopLeftRadius:50,borderTopRightRadius:50},className:s+" "+t.getClassName(T.FLEXLAYOUT__EDGE_RECT_BOTTOM),children:(0,n.jsx)("div",{children:i})},"South")),e.push((0,n.jsx)("div",{style:{top:o.height/2-50,left:o.width-10,width:10,height:100,borderTopLeftRadius:50,borderBottomLeftRadius:50},className:s+" "+t.getClassName(T.FLEXLAYOUT__EDGE_RECT_RIGHT),children:(0,n.jsx)("div",{style:{transform:"rotate(-90deg)"},children:i})},"East"))}return(0,n.jsx)(n.Fragment,{children:e})},tr=t=>{let{title:e,controller:i,layout:o,url:s,onCloseLayout:a,onSetWindow:n,children:r}=t,l=d.useRef(null),[u,c]=d.useState(void 0),[g,_]=d.useState(!0),p=new Map;return(d.useLayoutEffect(()=>{if(!l.current){let t=o.getLayoutId(),i=o.getRect();l.current=window.open(s,t,`left=${i.x},top=${i.y},width=${i.width},height=${i.height}`),l.current?(n(o,l.current),window.addEventListener("beforeunload",()=>{if(l.current){let t=l.current;l.current=null,t.close()}}),l.current.addEventListener("load",()=>{if(l.current){l.current.focus(),l.current.resizeTo(i.width,i.height),l.current.moveTo(i.x,i.y);let t=l.current.document;t.title=e;let s=t.createElement("div");s.className=T.FLEXLAYOUT__FLOATING_WINDOW_CONTENT,t.body.appendChild(s),(function(t,e){let i=[];for(let o of document.querySelectorAll('style, link[rel="stylesheet"]'))tl(t,o,e,i);return Promise.all(i)})(t,p).then(()=>{c(s)});let n=new MutationObserver(e=>(function(t,e,i){for(let o of t)if("childList"===o.type){for(let t of o.addedNodes)(t instanceof HTMLLinkElement||t instanceof HTMLStyleElement)&&tl(e,t,i);for(let t of o.removedNodes)if(t instanceof HTMLLinkElement||t instanceof HTMLStyleElement){let o=i.get(t);o&&e.head.removeChild(o)}}})(e,t,p));n.observe(document.head,{childList:!0}),l.current.addEventListener("beforeunload",()=>{l.current&&(a(o),l.current=null,n.disconnect())})}})):(console.warn(`Unable to open window ${s}`),a(o))}return()=>{i.getModel().getLayouts().has(o.getLayoutId())||(l.current?.close(),l.current=null)}},[]),d.useEffect(()=>{void 0!==u&&g&&(i.redrawLayout(),_(!1))},[u,g,i]),void 0!==u)?(0,h.createPortal)(r,u):null};function tl(t,e,i,o){if(e instanceof HTMLLinkElement){let s=e.cloneNode(!0);t.head.appendChild(s),i.set(e,s),o&&o.push(new Promise(t=>{s.onload=()=>t(!0)}))}else if(e instanceof HTMLStyleElement)try{let o=e.cloneNode(!0);t.head.appendChild(o),i.set(e,o)}catch(t){}}var td=((a=td||{}).North="n",a.South="s",a.East="e",a.West="w",a.NorthWest="nw",a.NorthEast="ne",a.SouthWest="sw",a.SouthEast="se",a),th=t=>{let{controller:e,layout:i,children:o}=t,[s,a]=d.useState(i.getRect()),r=e.getClassName,l=d.useRef(null),h=d.useRef(null),u=d.useRef(null),c=d.useRef(null),_=d.useRef(null),p=d.useRef(null),b=d.useRef(null),E=d.useRef(null),f=d.useRef(null),m=d.useRef(null),L=d.useRef(!1);d.useEffect(()=>(h.current?.addEventListener("touchstart",y,{passive:!1}),u.current?.addEventListener("touchstart",y,{passive:!1}),c.current?.addEventListener("touchstart",y,{passive:!1}),_.current?.addEventListener("touchstart",y,{passive:!1}),p.current?.addEventListener("touchstart",y,{passive:!1}),b.current?.addEventListener("touchstart",y,{passive:!1}),E.current?.addEventListener("touchstart",y,{passive:!1}),f.current?.addEventListener("touchstart",y,{passive:!1}),m.current?.addEventListener("touchstart",y,{passive:!1}),()=>{h.current?.removeEventListener("touchstart",y),u.current?.removeEventListener("touchstart",y),c.current?.removeEventListener("touchstart",y),_.current?.removeEventListener("touchstart",y),p.current?.removeEventListener("touchstart",y),b.current?.removeEventListener("touchstart",y),E.current?.removeEventListener("touchstart",y),f.current?.removeEventListener("touchstart",y),m.current?.removeEventListener("touchstart",y)}),[]);let y=t=>{t.preventDefault(),t.stopImmediatePropagation()};d.useEffect(()=>{let t=()=>{let t=[...e.getModel().getLayouts()];i!==t[t.length-1][1]&&(L.current=!0)},o=()=>{L.current&&(setTimeout(()=>{e.moveWindowToFront(i.getLayoutId())},10),L.current=!1)},s=l.current;return s&&(s.addEventListener("pointerdown",t,{capture:!0}),s.addEventListener("pointerup",o)),()=>{s&&(s.removeEventListener("pointerdown",t,{capture:!0}),s.removeEventListener("pointerup",o))}},[e,i.getLayoutId()]);let A=(t,o)=>{let n={x:t.clientX,y:t.clientY},r=e.getRootDiv(),l=r?r.getBoundingClientRect():{width:window.innerWidth,height:window.innerHeight};w(document,t,(t,r)=>{e.showOverlayOnAllWindows(!0);let d=t-n.x,h=r-n.y,u=s.x,c=s.y,_=s.width,T=s.height;o.includes("n")&&(c+=h,T-=h),o.includes("s")&&(T+=h),o.includes("w")&&(u+=d,_-=d),o.includes("e")&&(_+=d),_<150&&(o.includes("w")&&(u=s.x+s.width-150),_=150),T<25&&(o.includes("n")&&(c=s.y+s.height-25),T=25),u<0&&(_+=u,u=0),c<0&&(T+=c,c=0),u+_>l.width&&(_=l.width-u),c+T>l.height&&(T=l.height-c),_<150&&(_=150),T<25&&(T=25);let p=new g(u,c,_,T);a(p),i.setRect(p)},()=>{e.redrawLayout(),e.showOverlayOnAllWindows(!1)},()=>{}),t.stopPropagation()},R=e.getRootDiv(),O=R?R.getBoundingClientRect():{width:window.innerWidth,height:window.innerHeight};return s.clamp(new g(0,0,O.width,O.height)),(0,n.jsxs)("div",{ref:l,className:r(T.FLEXLAYOUT__FLOAT_WINDOW),style:{left:s.x,top:s.y,width:s.width,height:s.height,position:"absolute"},children:[(0,n.jsx)("div",{ref:h,className:r(T.FLEXLAYOUT__FLOAT_WINDOW_HEADER),onPointerDown:t=>{t.stopPropagation();let o={x:t.clientX-s.x,y:t.clientY-s.y},n=e.getRootDiv(),r=n?n.getBoundingClientRect():{width:window.innerWidth,height:window.innerHeight};w(document,t,(t,n)=>{e.showOverlayOnAllWindows(!0),L.current&&(e.moveWindowToFront(i.getLayoutId()),L.current=!1);let l=new g(t-o.x,n-o.y,s.width,s.height);l.clamp(new g(0,0,r.width,r.height)),a(l),i.setRect(l)},()=>{e.redrawLayout(),e.showOverlayOnAllWindows(!1)},()=>{})},children:(0,n.jsx)("div",{style:{flexGrow:1,display:"flex",justifyContent:"center"},children:(0,n.jsx)("div",{style:{width:50,height:8,display:"flex",flexDirection:"column",justifyContent:"space-around",opacity:.5},children:(0,n.jsx)("div",{style:{height:2,backgroundColor:"gray",borderRadius:1}})})})}),(0,n.jsx)("div",{className:r(T.FLEXLAYOUT__FLOAT_WINDOW_CONTENT),children:o}),(0,n.jsx)("div",{ref:u,style:{position:"absolute",zIndex:10,top:-4,left:8,right:8,height:8,cursor:"ns-resize"},onPointerDown:t=>A(t,td.North)}),(0,n.jsx)("div",{ref:b,style:{position:"absolute",zIndex:10,bottom:-4,left:8,right:8,height:8,cursor:"ns-resize"},onPointerDown:t=>A(t,td.South)}),(0,n.jsx)("div",{ref:_,style:{position:"absolute",zIndex:10,top:8,bottom:8,right:-4,width:8,cursor:"ew-resize"},onPointerDown:t=>A(t,td.East)}),(0,n.jsx)("div",{ref:f,style:{position:"absolute",zIndex:10,top:8,bottom:8,left:-4,width:8,cursor:"ew-resize"},onPointerDown:t=>A(t,td.West)}),(0,n.jsx)("div",{ref:m,style:{position:"absolute",zIndex:10,top:-4,left:-4,width:12,height:12,cursor:"nwse-resize"},onPointerDown:t=>A(t,td.NorthWest)}),(0,n.jsx)("div",{ref:c,style:{position:"absolute",zIndex:10,top:-4,right:-4,width:12,height:12,cursor:"nesw-resize"},onPointerDown:t=>A(t,td.NorthEast)}),(0,n.jsx)("div",{ref:E,style:{position:"absolute",zIndex:10,bottom:-4,left:-4,width:12,height:12,cursor:"nesw-resize"},onPointerDown:t=>A(t,td.SouthWest)}),(0,n.jsx)("div",{ref:p,style:{position:"absolute",zIndex:10,bottom:0,right:0,width:12,height:12,cursor:"nwse-resize"},onPointerDown:t=>A(t,td.SouthEast)})]})},tu=({controller:t})=>{let e=[],i=t.getModel().getLayouts(),o=0;for(let[s,a]of i)!a.isMainLayout()&&("window"===a.getType()&&t.isSupportsPopout()?(e.push((0,n.jsx)(tr,{controller:t,layout:a,title:t.getPopoutWindowName()+" "+o,url:t.getPopoutURL()+"?id="+s,onSetWindow:t.onSetWindow,onCloseLayout:t.onCloseLayout,children:(0,n.jsx)("div",{className:t.getProps().popoutClassName,children:(0,n.jsx)(tb,{...t.getProps(),layoutId:s,mainLayoutController:t})})},s)),o++):"float"===a.getType()&&e.push((0,n.jsx)(th,{controller:t,layout:a,onCloseLayout:t.onCloseLayout,children:(0,n.jsx)(tb,{...t.getProps(),layoutId:s,mainLayoutController:t})},s+"float")));return(0,n.jsx)(n.Fragment,{children:e})},tc=t=>{let{controller:e,tabNode:i,selected:o,border:s,icons:a,path:r}=t,l=d.useRef(null),h=d.useRef(null);d.useLayoutEffect(()=>{i.setTabRect(e.getBoundingClientRect(l.current)),e.getEditingTab()===i&&h.current.select()});let u=e.getClassName,c=u(T.FLEXLAYOUT__BORDER_BUTTON)+" "+u(T.FLEXLAYOUT__BORDER_BUTTON_+s);o?c+=" "+u(T.FLEXLAYOUT__BORDER_BUTTON__SELECTED):c+=" "+u(T.FLEXLAYOUT__BORDER_BUTTON__UNSELECTED),void 0!==i.getClassName()&&(c+=" "+i.getClassName());let g=0;!1===i.getModel().isEnableRotateBorderIcons()&&("left"===s?g=90:"right"===s&&(g=-90));let _=R(e,i,g),b=_.content?(0,n.jsx)("div",{className:u(T.FLEXLAYOUT__BORDER_BUTTON_CONTENT),children:_.content}):null,E=_.leading?(0,n.jsx)("div",{className:u(T.FLEXLAYOUT__BORDER_BUTTON_LEADING),children:_.leading}):null;if(e.getEditingTab()===i&&(b=(0,n.jsx)("input",{ref:h,className:u(T.FLEXLAYOUT__TAB_BUTTON_TEXTBOX),"data-layout-path":r+"/textbox",type:"text",autoFocus:!0,defaultValue:i.getName(),onKeyDown:t=>{"Escape"===t.code?e.setEditingTab(void 0):("Enter"===t.code||"NumpadEnter"===t.code)&&(e.setEditingTab(void 0),e.doAction(p.renameTab(i.getId(),t.target.value)))},onPointerDown:t=>{t.stopPropagation()}})),i.isCloseable()){let t=e.i18nName(z.Close_Tab);_.buttons.push((0,n.jsx)("div",{"data-layout-path":r+"/button/close",title:t,className:u(T.FLEXLAYOUT__BORDER_BUTTON_TRAILING),onPointerDown:t=>{t.stopPropagation()},onClick:t=>{let s;s=i.getCloseType(),(o||s===J.Always||s===J.Visible&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches||0)&&(e.doAction(p.deleteTab(i.getId())),t.stopPropagation())},children:"function"==typeof a.close?a.close(i):a.close},"close"))}return(0,n.jsxs)("div",{ref:l,"data-layout-path":r,className:c,onClick:()=>{e.doAction(p.selectTab(i.getId()))},onAuxClick:t=>{O(t)&&e.auxMouseClick(i,t)},onContextMenu:t=>{e.showContextMenu(i,t)},title:i.getHelpText(),draggable:!0,onDragStart:t=>{i.isEnableDrag()?(t.stopPropagation(),e.getDragDropManager().setDragNode(t.nativeEvent,i)):t.preventDefault()},onDragEnd:t=>{t.stopPropagation(),e.getDragDropManager().clearDragMain()},children:[E,b,_.buttons]})},tg=t=>{let e,i,o,s,{borderNode:a,controller:r,size:l}=t,h=d.useRef(null),u=d.useRef(null),g=d.useRef(null),b=d.useRef(null),E=d.useRef(null),f=r.getIcons();d.useLayoutEffect(()=>{a.setTabHeaderRect(r.getBoundingClientRect(m.current))});let{selfRef:m,userControlledPositionRef:L,onScroll:y,onScrollPointerDown:A,hiddenTabs:R,onMouseWheel:v,isDockStickyButtons:x,isShowHiddenTabs:N}=$(r,a,c.flip(a.getOrientation()),E,u,r.getClassName(T.FLEXLAYOUT__BORDER_BUTTON)),w=t=>{O(t)&&r.auxMouseClick(a,t)},D=t=>{t.stopPropagation()},S=t=>{let e=r.getShowOverflowMenu(),i=R.map(t=>({index:t,node:a.getChildren()[t]}));void 0!==e?e(a,t,i,I):G(g.current,a,i,I,r),t.stopPropagation()},I=t=>{r.doAction(p.selectTab(t.node.getId())),L.current=!1},C=t=>{let e=a.getChildren()[a.getSelected()];void 0!==e&&r.doAction(p.popoutTab(e.getId(),"window")),t.stopPropagation()},B=t=>{let e=a.getChildren()[a.getSelected()];void 0!==e&&r.doAction(p.popoutTab(e.getId(),"float")),t.stopPropagation()},M=r.getClassName,U=(()=>{let t=[];for(let e=0;e<a.getChildren().length;e++){let i=a.getSelected()===e,o=a.getChildren()[e];t.push((0,n.jsx)(tc,{controller:r,border:a.getLocation().getName(),tabNode:o,path:a.getPath()+"/tb"+e,selected:i,icons:f},o.getId())),e<a.getChildren().length-1&&t.push((0,n.jsx)("div",{className:M(T.FLEXLAYOUT__BORDER_TAB_DIVIDER)},"divider"+e))}return t})(),{leading:F,toolbar:P}=(t=>{let e,i=[],o=[],s={leading:e,buttons:i,stickyButtons:o,overflowPosition:void 0};if(r.customizeTabSet(a,s),e=s.leading,o=s.stickyButtons,i=s.buttons,void 0===s.overflowPosition&&(s.overflowPosition=o.length),o.length>0&&(x?i=[...o,...i]:t.push((0,n.jsx)("div",{ref:b,onPointerDown:D,onDragStart:t=>{t.preventDefault()},className:M(T.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER),children:o},"sticky_buttons_container"))),N){let t,e=r.i18nName(z.Overflow_Menu_Tooltip);if("function"==typeof f.more){let e=R.map(t=>({index:t,node:a.getChildren()[t]}));t=f.more(a,e)}else t=(0,n.jsxs)(n.Fragment,{children:[f.more,(0,n.jsx)("div",{className:M(T.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT),children:R.length>0?R.length:""})]});i.splice(Math.min(s.overflowPosition,i.length),0,(0,n.jsx)("button",{ref:g,className:M(T.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON)+" "+M(T.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW)+" "+M(T.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW_+a.getLocation().getName()),title:e,onClick:S,onPointerDown:D,children:t},"overflowbutton"))}let l=a.getSelected();if(-1!==l){let t=a.getChildren()[l];if(void 0!==t&&r.isMainLayout()){if(t.isEnablePopoutFloatIcon()){let e=r.i18nName(z.Popout_Tab_Float);i.push((0,n.jsx)("button",{title:e,className:M(T.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON)+" "+M(T.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_FLOAT),onClick:B,onPointerDown:D,children:"function"==typeof f.popoutFloat?f.popoutFloat(t):f.popoutFloat},"popout-float"))}if(r.isSupportsPopout()&&t.isEnablePopoutIcon()&&t.isAllowedInWindow()){let e=r.i18nName(z.Popout_Tab);i.push((0,n.jsx)("button",{title:e,className:M(T.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON)+" "+M(T.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_FLOAT),onClick:C,onPointerDown:D,children:"function"==typeof f.popout?f.popout(t):f.popout},"popout"))}}}return{leading:e,toolbar:(0,n.jsx)("div",{ref:h,className:M(T.FLEXLAYOUT__BORDER_TOOLBAR)+" "+M(T.FLEXLAYOUT__BORDER_TOOLBAR_+a.getLocation().getName()),children:i},"toolbar")}})(U),Y=M(T.FLEXLAYOUT__BORDER)+" "+M(T.FLEXLAYOUT__BORDER_+a.getLocation().getName());void 0!==a.getClassName()&&(Y+=" "+a.getClassName());let W=l-1;return a.getLocation()===_.LEFT?(e={right:"100%",top:0},i={width:W,overflowY:"auto"}):a.getLocation()===_.RIGHT?(e={left:"100%",top:0},i={width:W,overflowY:"auto"}):(e={left:0},i={height:W,overflowX:"auto"}),a.isEnableTabScrollbar()&&(o=(0,n.jsx)("div",{ref:u,className:M(T.FLEXLAYOUT__MINI_SCROLLBAR),onPointerDown:A})),F&&(s=(0,n.jsx)("div",{className:M(T.FLEXLAYOUT__BORDER_LEADING),children:F})),(0,n.jsxs)("div",{ref:m,style:{display:"flex",flexDirection:a.getOrientation()===c.VERT?"row":"column"},className:Y,"data-layout-path":a.getPath(),onClick:w,onAuxClick:w,onContextMenu:t=>{r.showContextMenu(a,t)},onWheel:v,children:[s,(0,n.jsxs)("div",{className:M(T.FLEXLAYOUT__MINI_SCROLLBAR_CONTAINER),children:[(0,n.jsx)("div",{ref:E,className:M(T.FLEXLAYOUT__BORDER_INNER)+" "+M(T.FLEXLAYOUT__BORDER_INNER_+a.getLocation().getName()),style:i,onScroll:y,children:(0,n.jsx)("div",{style:e,className:M(T.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER)+" "+M(T.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER_+a.getLocation().getName()),children:U})}),o]}),P]})};function t_(t){let{controller:e,borderNode:i,show:o}=t,s=d.useRef(null);d.useLayoutEffect(()=>{let t=e.getBoundingClientRect(s.current);isNaN(t.x)||!(t.width>0)||i.getContentRect().equalsWhenRounded(t)||(i.setContentRect(t),e.setReLayout(!0))});let a=!0,r={};i.getOrientation()===c.HORZ?(r.width=i.getSize(),r.minWidth=i.getMinSize(),r.maxWidth=i.getMaxSize()):(r.height=i.getSize(),r.minHeight=i.getMinSize(),r.maxHeight=i.getMaxSize(),a=!1),r.display=o?"flex":"none";let l=e.getClassName(T.FLEXLAYOUT__BORDER_TAB_CONTENTS);return i.getLocation()===_.LEFT||i.getLocation()===_.TOP?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{ref:s,style:r,className:l}),o&&(0,n.jsx)(K,{controller:e,node:i,index:0,horizontal:a})]}):(0,n.jsxs)(n.Fragment,{children:[o&&(0,n.jsx)(K,{controller:e,node:i,index:0,horizontal:a}),(0,n.jsx)("div",{ref:s,style:r,className:l})]})}var tT=({controller:t,inner:e})=>{let i=t.getClassName(T.FLEXLAYOUT__LAYOUT_MAIN),o=t.getModel().getBorderSet().getBorderMap();if(!t.isMainLayout()||!(o.size>0))return(0,n.jsx)("div",{className:i,ref:t.getMainRef(),style:{position:"absolute",top:0,left:0,bottom:0,right:0,display:"flex"},children:e});{let s=(0,n.jsx)("div",{className:i,ref:t.getMainRef(),children:e}),a=new Map,r=new Map;for(let[e,i]of _.values){let e=o.get(i);e&&e.isShowing()&&(!e.isAutoHide()||e.isAutoHide()&&(e.getChildren().length>0||t.getState().showHiddenBorder===i))&&(a.set(i,(0,n.jsx)(tg,{controller:t,borderNode:e,size:t.getState().calculatedBorderBarSize})),r.set(i,(0,n.jsx)(t_,{controller:t,borderNode:e,show:-1!==e.getSelected()})))}let l=t.getClassName(T.FLEXLAYOUT__LAYOUT_BORDER_CONTAINER),d=t.getClassName(T.FLEXLAYOUT__LAYOUT_BORDER_CONTAINER_INNER);if(t.getModel().getBorderSet().getLayoutHorizontal()){let t=(0,n.jsxs)("div",{className:d,style:{flexDirection:"column"},children:[r.get(_.TOP),(0,n.jsxs)("div",{className:d,style:{flexDirection:"row"},children:[r.get(_.LEFT),s,r.get(_.RIGHT)]}),r.get(_.BOTTOM)]});return(0,n.jsxs)("div",{className:l,style:{flexDirection:"column"},children:[a.get(_.TOP),(0,n.jsxs)("div",{className:d,style:{flexDirection:"row"},children:[a.get(_.LEFT),t,a.get(_.RIGHT)]}),a.get(_.BOTTOM)]})}{let t=(0,n.jsxs)("div",{className:d,style:{flexDirection:"row"},children:[r.get(_.LEFT),(0,n.jsxs)("div",{className:d,style:{flexDirection:"column"},children:[r.get(_.TOP),s,r.get(_.BOTTOM)]}),r.get(_.RIGHT)]});return(0,n.jsxs)("div",{className:l,style:{flexDirection:"row"},children:[a.get(_.LEFT),(0,n.jsxs)("div",{className:d,style:{flexDirection:"column"},children:[a.get(_.TOP),t,a.get(_.BOTTOM)]}),a.get(_.RIGHT)]})}}},tp=d.memo(t=>{tp.displayName="DragContainer";let{controller:e,tabNode:i}=t,o=d.useRef(null);d.useEffect(()=>{i.setTabStamp(o.current)},[i,o.current]);let s=e.getClassName;return(0,n.jsx)("div",{ref:o,className:s(T.FLEXLAYOUT__DRAG_RECT),children:(0,n.jsx)(k,{controller:e,tabNode:i},i.getId())})},function(t,e){return e.dragging}),tb=d.forwardRef((t,e)=>{tb.displayName="LayoutInternal";let[i,o]=d.useState({rect:g.empty(),editingTab:void 0,showEdges:!1,showOverlay:!1,calculatedBorderBarSize:29,layoutRedrawRevision:0,fullRedrawRevision:0,showHiddenBorder:_.CENTER,splitterSize:8}),s=d.useCallback(e=>{o(i=>({...i,..."function"==typeof e?e(i,t):e}))},[t]),a=d.useRef(null),r=d.useRef(null),l=d.useRef(null),h=d.useRef(null),u=d.useMemo(()=>new tE(t,i,s),[]);if(u.setProps(t),u.setStateRaw(i),u.setSetState(s),u.setLayoutRef(a),u.setMoveablesRef(r),u.setFindBorderBarSizeRef(l),u.setMainRef(h),d.useImperativeHandle(e,()=>u,[u]),d.useLayoutEffect(()=>{u.isMainLayout()&&u.updateLayoutMetrics(),u.isReLayout()&&(u.redrawLayout(),u.setReLayout(!1))}),d.useEffect(()=>{let t=a.current.ownerDocument,e=t.defaultView;u.setCurrentDocument(t),u.setCurrentWindow(e);let i=new e.ResizeObserver(()=>{e.requestAnimationFrame(()=>{u.updateRect()})});i.observe(a.current);let o=()=>{u.updateRect()};e.addEventListener("resize",o);let s=()=>{for(let[t,e]of u.getProps().model.getLayouts())e.getController()&&u.redrawLayout()};return document.addEventListener("visibilitychange",s),()=>{i.disconnect(),e.removeEventListener("resize",o),document.removeEventListener("visibilitychange",s)}},[u,a.current?.ownerDocument]),d.useEffect(()=>{let t;if(!u.isMainLayout()&&"window"===u.getLayout().getType()){let e=u.getProps().mainLayoutController?.getRootDiv();if(e){let i=a.current;S(e,i),(t=new MutationObserver(()=>{S(e,i)&&u.redrawLayout()})).observe(e,{attributeFilter:["style"]})}}return()=>{t&&t.disconnect()}},[u]),d.useEffect(()=>{let e=t.model,o=e.getLayouts().get(u.getLayoutId());if(o.setController(u),o.setToExportRectFunction((t,e)=>"window"===e?u.getScreenRect(t):u.getRelativeRect(t)),u.setLayout(o),u.isMainLayout()){e.addChangeListener(u.onModelChange);let o=()=>{let e=parseInt(getComputedStyle(a.current).getPropertyValue("--splitter-size"));Number.isFinite(e)&&(t.model.setSplitterSize(e),i.splitterSize!==e&&s({splitterSize:e}))};o();let n=setInterval(o,1e3);return()=>{e.removeChangeListener(u.onModelChange),clearInterval(n),u.tidyMoveablesMap()}}},[t.model,u]),!a.current)return(0,n.jsxs)("div",{ref:a,className:u.getClassName(T.FLEXLAYOUT__LAYOUT),children:[(0,n.jsx)("div",{ref:r,className:u.getClassName(T.FLEXLAYOUT__LAYOUT_MOVEABLES)},"__moveables__"),(0,n.jsx)("div",{ref:l,className:u.getClassName(T.FLEXLAYOUT__BORDER_SIZER),children:"FindBorderBarSize"},"findBorderBarSize")]});let c=t.model,p=u.getLayoutId();c.getRootRow(p).calcMinMaxSize(),c.getRootRow(p).setPaths(""),u.isMainLayout()&&(c.getBorderSet().setPaths(),u.createMoveableDivs());let b=(0,n.jsx)(tT,{controller:u,inner:u.renderLayout()}),E=u.renderTabContainers(),f=u.reorderComponents(E,u.getOrderedTabIds()),m=null,L=null,y=null,A=null;if(u.isMainLayout()){m=u.renderMetricsElements(),L=(0,n.jsx)(tu,{controller:u});let t=u.renderTabContents();y=u.reorderComponents(t,u.getOrderedTabMoveableIds()),A=(0,n.jsx)("div",{className:u.getClassName(T.FLEXLAYOUT__LAYOUT_TAB_STAMPS),children:u.renderTabStamps()},"__tabStamps__")}return(0,n.jsxs)("div",{ref:a,className:u.getClassName(T.FLEXLAYOUT__LAYOUT),onDragEnter:u.getDragDropManager().onDragEnterRaw,onDragLeave:u.getDragDropManager().onDragLeaveRaw,onDragOver:u.getDragDropManager().onDragOver,onDrop:u.getDragDropManager().onDrop,children:[(0,n.jsx)("div",{ref:r,className:u.getClassName(T.FLEXLAYOUT__LAYOUT_MOVEABLES)},"__moveables__"),m,(0,n.jsx)(j,{controller:u,show:i.showOverlay},"__overlay__"),b,f,y,i.portal,L,A]})}),tE=class t{static Windows=new Map;_props;_state;_setState;_layoutRef;_moveablesRef;_findBorderBarSizeRef;_mainRef;_orderedTabIds;_orderedTabMoveableIds;_moveableElementMap=new Map;_currentDocument;_currentWindow;_supportsPopout;_popoutURL;_icons;_dragDropManager;_layoutId;_layout;_mainController;_popoutWindowName;_cachedLayoutDOMRect;_reLayout;constructor(t,e,i){this._props=t,this._state=e,this._setState=i,this._orderedTabIds=[],this._orderedTabMoveableIds=[],this._supportsPopout=void 0!==t.supportsPopout?t.supportsPopout:tm,this._popoutURL=t.popoutURL?t.popoutURL:"popout.html",this._icons={...tf,...t.icons},this._layoutId=t.layoutId?t.layoutId:W.MAIN_LAYOUT_ID,this._mainController=t.mainLayoutController?t.mainLayoutController:this,this._dragDropManager=new to(this),this._layout=t.model.getLayouts().get(this._layoutId),this._layout.setController(this),this._popoutWindowName=t.popoutWindowName||"Popout Window",this._reLayout=!1}renderLayout(){return this._cachedLayoutDOMRect=void 0,(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Q,{controller:this,rowNode:this._props.model.getRootRow(this._layoutId)},"__row__"),(0,n.jsx)(tn,{controller:this})]})}renderTabContainers(){let t=new Map;return this._props.model.visitLayoutNodes(this._layoutId,e=>{if(e instanceof y){let i=e.isSelected(),o=e.isRendered(),s=e.isEnableRenderOnDemand();(o||i||!s)&&t.set(e.getId(),(0,n.jsx)(tt,{controller:this,tabNode:e,selected:i},e.getId()))}}),t}renderTabContents(){let t=new Map;for(let[e,i]of this._props.model.getLayouts())this._props.model.visitLayoutNodes(e,e=>{if(e instanceof y){let o=e.isSelected(),s=e.isRendered(),a=e.isEnableRenderOnDemand(),r=e.getParent().getContentRect(),l=o||!a;if(s||l&&r.width>0&&r.height>0){let o=e.getMoveableElement(),s=i.getWindowId()||"",a=e.getId()+(e.isEnableWindowReMount()?s:"");t.set(e.getId(),(0,h.createPortal)((0,n.jsx)(ti,{controller:this,tabNode:e,rect:r,windowId:s,visible:l,fullRedrawRevision:this._state.fullRedrawRevision,parentRedrawRevision:this._props.parentRedrawRevision},a),o,a)),e.setRendered(!0)}}});return t}renderMetricsElements(){return(0,n.jsx)("div",{ref:this._findBorderBarSizeRef,className:this.getClassName(T.FLEXLAYOUT__BORDER_SIZER),children:"FindBorderBarSize"},"findBorderBarSize")}renderTabStamps(){let t=[];return this._props.model.visitNodes(e=>{e instanceof y&&t.push((0,n.jsx)(tp,{controller:this,tabNode:e,dragging:N},e.getId()))}),t}createMoveableDivs(){this._props.model.visitNodes(t=>{if(t instanceof y){let e=this.getMoveableElement(t.getId());t.setMoveableElement(e)}})}getMoveablesDiv(){return this._moveablesRef.current}getMoveableElement(t){let e=this._moveableElementMap.get(t);return void 0===e&&(e=document.createElement("div"),this._moveablesRef.current.appendChild(e),e.className=T.FLEXLAYOUT__TAB_MOVEABLE,this._moveableElementMap.set(t,e)),e}tidyMoveablesMap(){let t=new Map;for(let[e,i]of(this._props.model.visitNodes((e,i)=>{e instanceof y&&t.set(e.getId(),e)}),this._moveableElementMap))t.has(e)||(i.remove(),this._moveableElementMap.delete(e))}redrawLayout(){this._mainController?.setState(t=>({layoutRedrawRevision:t.layoutRedrawRevision+1}))}redrawLayoutAndTabContent(t=!0){this._mainController?.setState(t=>({fullRedrawRevision:t.fullRedrawRevision+1}))}doAction(t){if(void 0===this._props.onAction)return this._props.model.doAction(t);{let e=this._props.onAction(t);return void 0!==e?this._props.model.doAction(e):void 0}}updateRect=()=>{if(this._layoutRef.current){let t=this._layoutRef.current;if(!this._layout.isMainLayout()&&"float"===this._layout.getType()){let e=t.closest("."+this.getClassName(T.FLEXLAYOUT__FLOAT_WINDOW));e instanceof HTMLDivElement&&(t=e)}let e=g.fromDomRect(t.getBoundingClientRect());if(!this._layout.isMainLayout()&&"float"===this._layout.getType()){let t=this._mainController.getDomRect();e=e.relativeTo(t)}!e.equalsWhenRounded(this._state.rect)&&0!==e.width&&0!==e.height&&(this.setState({rect:e}),this._layout.setRect(e),this._layout.isMainLayout()||this.redrawLayout())}};onModelChange=t=>{t.type==p.DELETE_TAB&&this._state.showHiddenBorder!==_.CENTER&&0===this._props.model.getBorderSet().getBorderMap().get(this._state.showHiddenBorder).getChildren().length&&this._setState({showHiddenBorder:_.CENTER}),this.redrawLayout(),this._props.onModelChange&&this._props.onModelChange(this._props.model,t)};reorderComponents(t,e){let i=e.filter(e=>t.has(e)),o=new Set(i);for(let e of t.keys())o.has(e)||i.push(e);return e.splice(0,e.length,...i),e.map(e=>t.get(e))}checkForBorderToShow(t,e){let i=this.getBoundingClientRect(this._mainRef.current),o=i.getCenter(),s=!1;this._props.model.isEnableEdgeDock()&&this._state.showHiddenBorder===_.CENTER&&(e>o.y-50&&e<o.y+50||t>o.x-50&&t<o.x+50)&&(s=!0);let a=_.CENTER;!s&&(t<=i.x+10?a=_.LEFT:t>=i.getRight()-10?a=_.RIGHT:e<=i.y+10?a=_.TOP:e>=i.getBottom()-10&&(a=_.BOTTOM)),a!==this._state.showHiddenBorder&&this.setState({showHiddenBorder:a})}updateLayoutMetrics=()=>{if(this._findBorderBarSizeRef.current){let t=this._findBorderBarSizeRef.current.getBoundingClientRect().height;t!==this._state.calculatedBorderBarSize&&this.setState({calculatedBorderBarSize:t})}};addTabWithDragAndDrop(t,e,i){this._dragDropManager.addTabWithDragAndDrop(t,e,i)}moveTabWithDragAndDrop(t,e){this._dragDropManager.moveTabWithDragAndDrop(t,e)}setDragComponent(t,e,i,o){this._dragDropManager.setDragComponent(t,e,i,o)}getProps(){return this._props}setProps(t){this._props=t}getState(){return this._state}setStateRaw(t){this._state=t}setState(t){this._setState(t)}setSetState(t){this._setState=t}getLayoutRef(){return this._layoutRef}setLayoutRef(t){this._layoutRef=t}getMoveablesRef(){return this._moveablesRef}setMoveablesRef(t){this._moveablesRef=t}getFindBorderBarSizeRef(){return this._findBorderBarSizeRef}setFindBorderBarSizeRef(t){this._findBorderBarSizeRef=t}getMainRef(){return this._mainRef}setMainRef(t){this._mainRef=t}getOrderedTabIds(){return this._orderedTabIds}getOrderedTabMoveableIds(){return this._orderedTabMoveableIds}getCurrentDocument(){return this._currentDocument}setCurrentDocument(t){this._currentDocument=t}getCurrentWindow(){return this._currentWindow}setCurrentWindow(e){this._currentWindow=e,e&&!t.Windows.has(e)&&t.Windows.set(e,M())}getWindowId(){if(this.getCurrentWindow())return t.Windows.get(this.getCurrentWindow())}isSupportsPopout(){return this._supportsPopout}getPopoutURL(){return this._popoutURL}getIcons(){return this._icons}getDragDropManager(){return this._dragDropManager}getLayoutId(){return this._layoutId}getLayout(){return this._layout}setLayout(t){this._layout=t}getMainController(){return this._mainController}isMainLayout(){return this._layout.isMainLayout()}getPopoutWindowName(){return this._popoutWindowName}isReLayout(){return this._reLayout}setReLayout(t){this._reLayout=t}getBoundingClientRect(t){let e=this.getDomRect();return e?g.getBoundingClientRect(t).relativeTo(e):g.empty()}getMoveableContainer(){return this._moveablesRef.current}getClassName=t=>void 0===this._props.classNameMapper?t:this._props.classNameMapper(t);getDomRect(){return void 0!==this._cachedLayoutDOMRect?this._cachedLayoutDOMRect:this._layoutRef.current?(this._cachedLayoutDOMRect=g.fromDomRect(this._layoutRef.current.getBoundingClientRect()),this._cachedLayoutDOMRect):g.empty()}getRootDiv(){return this._layoutRef.current}getMainElement(){return this._mainRef.current}getFactory(){return this._props.factory}isRealtimeResize(){return this._props.realtimeResize??!1}setEditingTab(t){this.setState({editingTab:t})}getEditingTab(){return this._state.editingTab}getModel(){return this._props.model}getTabDragSpeed(){return this._props.tabDragSpeed?this._props.tabDragSpeed:.3}onCloseLayout=t=>{this.doAction(p.closePopout(t.getLayoutId()))};onSetWindow=(t,e)=>{};getScreenRect(t){let e=t.clone(),i=this.getDomRect();return e.x=this._currentWindow.screenX+this._currentWindow.scrollX+1+i.x+e.x,e.y=this._currentWindow.screenY+this._currentWindow.scrollY+59+i.y+e.y,e.height+=60,e.width+=2,e}getRelativeRect(t){let e=t.clone();if(!this._layout.isMainLayout()){let t=this._layout.getRect();e.x+=t.x,e.y+=t.y}return e}moveWindowToFront(t){this.doAction(p.movePopoutToFront(t))}addTabToTabSet(t,e){if(void 0!==this._props.model.getNodeById(t))return this.doAction(p.addNode(e,t,_.CENTER,-1))}addTabToActiveTabSet(t){let e=this._props.model.getActiveTabset(this._layoutId);if(void 0!==e)return this.doAction(p.addNode(t,e.getId(),_.CENTER,-1))}showControlInPortal=(t,e)=>{let i=(0,h.createPortal)(t,e);this.setState({portal:i})};hideControlInPortal=()=>{this.setState({portal:void 0})};maximize(t){this.doAction(p.maximizeToggle(t.getId(),this.getLayoutId()))}customizeTab(t,e){this._props.onRenderTab&&this._props.onRenderTab(t,e)}customizeTabSet(t,e){this._props.onRenderTabSet&&this._props.onRenderTabSet(t,e)}i18nName(t,e){let i;return this._props.i18nMapper&&(i=this._props.i18nMapper(t,e)),void 0===i&&(i=t+(void 0===e?"":e)),i}getShowOverflowMenu(){return this._props.onShowOverflowMenu}getTabSetPlaceHolderCallback(){return this._props.onTabSetPlaceHolder}showContextMenu(t,e){this._props.onContextMenu&&this._props.onContextMenu(t,e)}auxMouseClick(t,e){this._props.onAuxMouseClick&&this._props.onAuxMouseClick(t,e)}showOverlay(t){this.setState({showOverlay:t}),v(!t,this._currentDocument)}showOverlayOnAllWindows(t){for(let[,e]of this._props.model.getLayouts())e.getController()&&e.getController().showOverlay(t)}},tf={close:(0,n.jsx)(H,{}),closeTabset:(0,n.jsx)(H,{}),closeFloatPopout:(0,n.jsx)(H,{}),popout:(0,n.jsx)(()=>(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",style:X,viewBox:"0 0 20 20",fill:"var(--color-icon)",children:[(0,n.jsx)("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),(0,n.jsx)("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"})]}),{}),popoutFloat:(0,n.jsx)(()=>(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",style:X,viewBox:"0 0 20 20",fill:"var(--color-icon)",children:[(0,n.jsx)("rect",{x:"3",y:"10",width:"7",height:"7",rx:"1",fill:"none",stroke:"var(--color-icon)",strokeWidth:"1.5"}),(0,n.jsx)("rect",{x:"10",y:"3",width:"7",height:"7",rx:"1",fill:"none",stroke:"var(--color-icon)",strokeWidth:"1.5"}),(0,n.jsx)("path",{d:"M6 14 L14 6",stroke:"var(--color-icon)",strokeWidth:"1.5",strokeLinecap:"round"}),(0,n.jsx)("path",{d:"M10 6 h4 v4",fill:"none",stroke:"var(--color-icon)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),{}),maximize:(0,n.jsx)(()=>(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",style:X,viewBox:"0 0 24 24",fill:"var(--color-icon)",children:[(0,n.jsx)("path",{d:"M0 0h24v24H0z",fill:"none"}),(0,n.jsx)("path",{stroke:"var(--color-icon)",d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})]}),{}),restore:(0,n.jsx)(()=>(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",style:X,viewBox:"0 0 24 24",fill:"var(--color-icon)",children:[(0,n.jsx)("path",{d:"M0 0h24v24H0z",fill:"none"}),(0,n.jsx)("path",{stroke:"var(--color-icon)",d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"})]}),{}),more:(0,n.jsx)(()=>(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",style:X,viewBox:"0 0 24 24",fill:"var(--color-icon)",children:[(0,n.jsx)("path",{d:"M0 0h24v24H0z",fill:"none"}),(0,n.jsx)("path",{stroke:"var(--color-icon)",d:"M7 10l5 5 5-5z"})]}),{}),edgeArrow:(0,n.jsx)(()=>(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",style:{display:"block",width:10,height:10},preserveAspectRatio:"none",viewBox:"0 0 100 100",children:(0,n.jsx)("path",{fill:"var(--color-edge-icon)",stroke:"var(--color-edge-icon)",d:"M10 30 L90 30 l-40 40 Z"})}),{}),activeTabset:(0,n.jsx)(()=>(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",style:X,height:"24px",viewBox:"0 -960 960 960",width:"24px",children:(0,n.jsx)("path",{fill:"var(--color-icon)",stroke:"var(--color-icon)",d:"M440-120v-264L254-197l-57-57 187-186H120v-80h264L197-706l57-57 186 187v-264h80v264l186-187 57 57-187 186h264v80H576l187 186-57 57-186-187v264h-80Z"})}),{})},tm=A(),tL=d.forwardRef((t,e)=>{let i=(0,d.useRef)(null),o=(0,d.useRef)(0);return tL.displayName="Layout",(0,d.useImperativeHandle)(e,()=>({redraw:()=>{i.current?.redrawLayoutAndTabContent()},addTabToTabSet:(t,e)=>i.current?.addTabToTabSet(t,e),addTabWithDragAndDrop:(t,e,o)=>{i.current?.addTabWithDragAndDrop(t,e,o)},moveTabWithDragAndDrop:(t,e)=>{i.current?.moveTabWithDragAndDrop(t,e)},addTabToActiveTabSet:t=>i.current?.addTabToActiveTabSet(t),setDragComponent:(t,e,o,s)=>{i.current?.setDragComponent(t,e,o,s)},getRootDiv:()=>i.current.getRootDiv()})),(0,n.jsx)(tb,{ref:i,...t,parentRedrawRevision:o.current++})}),ty=t.i(404175),tA=t.i(157408),tR=t.i(327964),tO=t.i(873111),tv=t.i(691223),tx=t.i(31807),tN=t.i(363156),tw=t.i(250226),tD=t.i(564822),tS=t.i(361031),tI=t.i(524360),tC=t.i(515104),tB=t.i(506037),tM=t.i(835829);let tU=()=>(0,n.jsx)(tJ,{}),tF=(0,r.default)(()=>t.A(202411).then(t=>t.EditorPanel),{loadableGenerated:{modules:[388576]},ssr:!1,loading:tU}),tP=(0,r.default)(()=>t.A(136450).then(t=>t.CodeEditor),{loadableGenerated:{modules:[538691]},ssr:!1,loading:tU}),tY=(0,r.default)(()=>t.A(58872).then(t=>t.TerminalPanel),{loadableGenerated:{modules:[608745]},ssr:!1,loading:tU}),tW=(0,r.default)(()=>t.A(329052).then(t=>t.ChannelList),{loadableGenerated:{modules:[878166]},ssr:!1,loading:tU}),tX=(0,r.default)(()=>t.A(126861).then(t=>t.ChatPanel),{loadableGenerated:{modules:[773354]},ssr:!1,loading:tU}),tH=(0,r.default)(()=>t.A(124383).then(t=>t.IssueList),{loadableGenerated:{modules:[783481]},ssr:!1,loading:tU}),tj=(0,r.default)(()=>t.A(318599).then(t=>t.IssueDetail),{loadableGenerated:{modules:[706304]},ssr:!1,loading:tU}),tz=(0,r.default)(()=>t.A(222445).then(t=>t.GitCommitsPanel),{loadableGenerated:{modules:[514669]},ssr:!1,loading:tU}),tk=(0,r.default)(()=>t.A(78906).then(t=>t.ProjectSettingsPanel),{loadableGenerated:{modules:[985646]},ssr:!1,loading:tU}),tG=(0,r.default)(()=>t.A(857328).then(t=>t.CodeFavoritesPanel),{loadableGenerated:{modules:[306649]},ssr:!1,loading:tU}),tV=(0,r.default)(()=>t.A(3725).then(t=>t.AddFavoriteDialog),{loadableGenerated:{modules:[722705]},ssr:!1,loading:()=>null});function tJ(){return(0,n.jsx)("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"Loading..."})}let tZ={global:{tabSetEnableTabStrip:!0,borderEnableDrop:!0,tabEnableClose:!1,tabEnableRename:!1,tabSetEnableMaximize:!1},borders:[{type:"border",location:"bottom",children:[{type:"tab",name:"Terminal",component:"terminal"},{type:"tab",name:"Commits",component:"git-commits"},{type:"tab",name:"Favorites",component:"code-favorites",id:"code-favorites"}]}],layout:{type:"row",children:[{type:"tabset",weight:.25,children:[{type:"tab",name:"Settings",component:"project-settings",id:"project-settings"},{type:"tab",name:"Channels",component:"channel-list",id:"channel-list"},{type:"tab",name:"Issues",component:"issue-list",id:"issue-list"},{type:"tab",name:"Workfolder",component:"workfolder",id:"workfolder"}]},{type:"tabset",weight:.75,children:[{type:"tab",name:"Code Editor",component:"code-editor",id:"code-editor"},{type:"tab",name:"Chat",component:"chat",id:"chat"},{type:"tab",name:"Issue Detail",component:"issue-detail",id:"issue-detail"}]}]}};function t$({panel:t,workspaceId:e,boundDirs:i}){switch(t){case"channel-list":default:return(0,n.jsx)(tW,{workspaceId:e});case"chat":return(0,n.jsx)(tX,{workspaceId:e});case"issue-list":return(0,n.jsx)(tH,{workspaceId:e});case"issue-detail":return(0,n.jsx)(tj,{workspaceId:e});case"workfolder":return(0,n.jsx)(tF,{workspaceId:e});case"code-editor":return(0,n.jsx)(tP,{workspaceId:e});case"terminal":return(0,n.jsx)(tY,{workspaceId:e,boundDirs:i});case"git-commits":return(0,n.jsx)(tz,{workspaceId:e});case"project-settings":return(0,n.jsx)(tk,{workspaceId:e});case"code-favorites":return(0,n.jsx)(tG,{workspaceId:e})}}function tq({name:t}){return(0,n.jsxs)("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:[t," (coming soon)"]})}t.s(["WorkspaceShell",0,function({workspaceId:t,boundDirs:e}){let i=(0,tD.useIsMobile)(),o=(0,tR.useIssueStore)(),s=(0,tO.useTaskStore)(),a=(0,tR.useIssueStore)(t=>t.activeIssueId),r=(0,tR.useIssueStore)(t=>t.issueSelectSeq),d=(0,tv.useEditorStore)(t=>t.activeFilePath),h=(0,tx.useChannelStore)(t=>t.activeChannelId),u=(0,tx.useChannelStore)(t=>t.channelSelectSeq),c=(0,tN.useGitStore)(t=>t.status),g=(0,tI.useTerminalStore)(t=>t.sessions),_=(0,tx.useChannelStore)(t=>t.messages),{activePanel:T,setActivePanel:b,handleBackAction:E}=(0,tw.useMobilePanelStore)(),f=(0,tv.useEditorStore)(t=>t.loadEditorState),m=(0,tv.useEditorStore)(t=>t.revealPath);(0,tv.useEditorStore)(t=>t.clearRevealPath);let[L,A]=(0,l.useState)(()=>{let e;try{let i=localStorage.getItem(`flexlayout-${t}`);if(i){let t=JSON.parse(i),o=t.borders,s=o?.find(t=>"bottom"===t.location);s&&!s.children.some(t=>"code-favorites"===t.id||"code-favorites"===t.component)&&s.children.push({type:"tab",name:"Favorites",component:"code-favorites",id:"code-favorites"}),e=W.fromJson(t)}else e=W.fromJson(tZ)}catch{e=W.fromJson(tZ)}return e});(0,l.useEffect)(()=>{let e=()=>{localStorage.removeItem(`flexlayout-${t}`),A(W.fromJson(tZ))};return window.addEventListener("reset-layout",e),()=>window.removeEventListener("reset-layout",e)},[t]),(0,l.useEffect)(()=>{f(t)},[t,f]),(0,l.useEffect)(()=>{if(!i)return;let e=e=>{E()&&(e.preventDefault(),window.history.pushState({workspaceId:t,mobileBackGuard:!0},""))};return window.history.replaceState({workspaceId:t,mobileBackGuard:!0},""),window.history.pushState({workspaceId:t,mobileBackGuard:!0},""),window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)},[E,i,t]),(0,l.useEffect)(()=>{if(a)if(i)b("issue-detail");else{let t=L.getNodeById("issue-detail");t&&t instanceof y&&L.doAction(p.selectTab(t.getId()))}},[r,a,L,i,b]),(0,l.useEffect)(()=>{if(h)if(i)b("chat");else{let t=L.getNodeById("chat");t&&t instanceof y&&L.doAction(p.selectTab(t.getId()))}},[u,h,L,i,b]),(0,l.useEffect)(()=>{if(d)if(i)b("code-editor");else{let t=L.getNodeById("code-editor");t&&t instanceof y&&L.doAction(p.selectTab(t.getId()))}else if(0===tv.useEditorStore.getState().openFiles.length)if(i)b("workfolder");else{let t=L.getNodeById("workfolder");t&&t instanceof y&&L.doAction(p.selectTab(t.getId()))}},[d,L,i,b]),(0,l.useEffect)(()=>{if(m)if(i)b("workfolder");else{let t=L.getNodeById("workfolder");t&&t instanceof y&&L.doAction(p.selectTab(t.getId()))}},[m,L,i,b]),(0,l.useEffect)(()=>{tN.useGitStore.getState().loadStatus(t);let e=setInterval(()=>{tN.useGitStore.getState().loadStatus(t)},3e4);return()=>clearInterval(e)},[t]),(0,l.useEffect)(()=>{if(!i)return;let e=tN.useGitStore.getState();"git-commits"===T&&e.loadLog(t)},[T,t,i]);let R=(0,l.useCallback)(()=>{let e=tS.useWorkspaceStore.getState().workspaces.find(e=>e.id===t),i=e?.notificationSettings;return i?.enabled&&"native"===i.provider&&i.native?.permissionGranted?i:null},[t]),O=(0,l.useCallback)(t=>{let e=t.status.replace(/_/g," ");return t.result?.summary?`${t.title}: ${e} - ${t.result.summary}`:`${t.title}: ${e}`},[]);(0,l.useEffect)(()=>{let e=(0,tA.getWS)(t),i=tB.useNotificationStore.getState();i.load(t);let a=[e.on("issue.created",t=>o.upsertIssue(t)),e.on("issue.updated",t=>o.upsertIssue(t)),e.on("issue.status_changed",t=>{let e=R();if(e){let{from:i,to:o}=t,s=e.events??[];if("in_progress"===o&&s.includes("issue_started")||"completed"===o&&s.includes("issue_completed")){let t=`Status changed: ${i} → ${o}`;(0,tC.sendNativeNotification)("Issue Status Updated",t)}}}),e.on("task.created",t=>{s.upsertTask(t);let e=R();e?.native?.androidOngoingTaskNotification&&(0,tC.sendAndroidOngoingTaskNotification)(O(t))}),e.on("task.updated",t=>{s.upsertTask(t);let e=R();e?.native?.androidOngoingTaskNotification&&(0,tC.sendAndroidOngoingTaskNotification)(O(t))}),e.on("task.status_changed",e=>{let i=tR.useIssueStore.getState().activeIssueId;i&&s.loadTasks(t,i);let o=R();if(o){let{from:t,to:i}=e,s=o.events??[];if("completed"===i&&s.includes("issue_task_completed")){let e=`Status changed: ${t} → ${i}`;(0,tC.sendNativeNotification)("Task Status Updated",e)}}}),e.on("notification.created",t=>{i.addNotification(t),R()&&(0,tC.sendNativeNotification)(t.title,t.description||"")}),e.on("notification.cleared",()=>{i.reset()}),e.on("inspector.jump",e=>{let i,{path:o,name:s,line:a,column:n,timestamp:r}=e,l=n??1;tM.useInspectorHistoryStore.getState().addEntry(t,{path:o,name:s,line:a,column:l,timestamp:r??Date.now()}),tv.useEditorStore.getState().jumpToPosition(t,o,a,n),i=window.__flutterBridge,i?.emit?.("inspector.jump",{path:o,line:a,column:l})})];return()=>a.forEach(t=>t())},[o,s,t,R,O]);let v=(0,l.useCallback)(i=>{switch(i.getComponent()){case"channel-list":return(0,n.jsx)(tW,{workspaceId:t});case"issue-list":return(0,n.jsx)(tH,{workspaceId:t});case"workfolder":return(0,n.jsx)(tF,{workspaceId:t});case"code-editor":return(0,n.jsx)(tP,{workspaceId:t});case"chat":return(0,n.jsx)(tX,{workspaceId:t});case"issue-detail":return(0,n.jsx)(tj,{workspaceId:t});case"terminal":return(0,n.jsx)(tY,{workspaceId:t,boundDirs:e});case"git-commits":return(0,n.jsx)(tz,{workspaceId:t});case"project-settings":return(0,n.jsx)(tk,{workspaceId:t});case"code-favorites":return(0,n.jsx)(tG,{workspaceId:t});default:return(0,n.jsx)(tq,{name:i.getName()})}},[e,t]),x=(0,tO.useTaskStore)(t=>t.tasks),N=(0,l.useCallback)((t,e)=>{let i=t.getComponent();if(!i)return;let o=(0,ty.renderTabIcon)(i,t.getName(),c,g,_,x);o&&(e.content=o)},[c,g,_,x]),w=(0,l.useCallback)((e,i)=>{if(i.type!==p.SELECT_TAB)try{localStorage.setItem(`flexlayout-${t}`,JSON.stringify(e.toJson()))}catch{}if(i.type!==p.SELECT_TAB)return;let o=e.getNodeById(i.data.tabNode);if(!o||!(o instanceof y))return;let s=o.getComponent(),a=ty.RIGHT_TO_LEFT_TAB_MAP[s??""];if(a){let t=e.getNodeById(a);t&&t instanceof y&&e.doAction(p.selectTab(t.getId()))}let n=tN.useGitStore.getState();"git-commits"===s&&(n.loadStatus(t),n.loadDiffs(t),n.loadLog(t))},[t]);return i?(0,n.jsxs)("div",{className:"relative h-full w-full",children:[(0,n.jsx)(t$,{panel:T,workspaceId:t,boundDirs:e}),(0,n.jsx)(tV,{})]}):(0,n.jsxs)("div",{className:"relative h-full w-full",children:[(0,n.jsx)(tL,{model:L,factory:v,onRenderTab:N,onModelChange:w}),(0,n.jsx)(tV,{})]})}],161316)},817465,t=>{t.n(t.i(161316))}]);
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
.monaco-editor.standalone{--monaco-monospace-font:"SF Mono", Monaco, Menlo, Consolas, "Ubuntu Mono", "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace;font-family:-apple-system,BlinkMacSystemFont,Segoe WPC,Segoe UI,HelveticaNeue-Light,system-ui,Ubuntu,Droid Sans,sans-serif}.monaco-menu .monaco-action-bar.vertical .action-item .action-menu-item:focus .action-label,.monaco-editor.standalone.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.standalone.hc-black .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.standalone.hc-light .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label{stroke-width:1.2px}.monaco-hover p{margin:0}.monaco-aria-container{clip:rect(1px, 1px, 1px, 1px);clip-path:inset(50%);width:1px;height:1px;margin:-1px;padding:0;top:0;overflow:hidden;position:absolute!important}.monaco-editor.standalone .synthetic-focus,.monaco-diff-editor.standalone .synthetic-focus,.monaco-editor.standalone [tabindex="0"]:focus,.monaco-diff-editor.standalone [tabindex="0"]:focus,.monaco-editor.standalone [tabindex="-1"]:focus,.monaco-diff-editor.standalone [tabindex="-1"]:focus,.monaco-editor.standalone button:focus,.monaco-diff-editor.standalone button:focus,.monaco-editor.standalone input[type=button]:focus,.monaco-diff-editor.standalone input[type=button]:focus,.monaco-editor.standalone input[type=checkbox]:focus,.monaco-diff-editor.standalone input[type=checkbox]:focus,.monaco-editor.standalone input[type=search]:focus,.monaco-diff-editor.standalone input[type=search]:focus,.monaco-editor.standalone input[type=text]:focus,.monaco-diff-editor.standalone input[type=text]:focus,.monaco-editor.standalone select:focus,.monaco-diff-editor.standalone select:focus,.monaco-editor.standalone textarea:focus,.monaco-diff-editor.standalone textarea:focus{outline-offset:-1px;outline-width:1px;outline-style:solid;outline-color:var(--vscode-focusBorder);opacity:1}
|
|
2
2
|
.monaco-component.multiDiffEditor{background:var(--vscode-multiDiffEditor-background);width:100%;height:100%;position:relative;overflow-y:hidden}.monaco-component.multiDiffEditor>div{width:100%;height:100%;position:absolute;top:0;left:0}.monaco-component.multiDiffEditor>div.placeholder{visibility:hidden}.monaco-component.multiDiffEditor>div.placeholder.visible{visibility:visible}.monaco-component.multiDiffEditor>div.placeholder{place-content:center;place-items:center;display:grid}.monaco-component.multiDiffEditor>.multi-diff-root-floating-menu{width:auto;height:auto;color:var(--vscode-button-foreground);background-color:var(--vscode-button-background);border:1px solid var(--vscode-contrastBorder);z-index:10;box-shadow:0 3px 12px var(--vscode-widget-shadow);border-radius:4px;align-items:center;padding:4px 6px;display:flex;position:absolute;inset:auto 32px 32px auto;overflow:hidden}.monaco-component.multiDiffEditor .multi-diff-root-floating-menu .action-item>.action-label{border-radius:2px;padding:7px 8px;font-size:15px}.monaco-component.multiDiffEditor .multi-diff-root-floating-menu .action-item>.action-label.codicon{color:var(--vscode-button-foreground)}.monaco-component.multiDiffEditor .multi-diff-root-floating-menu .action-item>.action-label.codicon:not(.separator){padding-top:6px;padding-bottom:6px}.monaco-component.multiDiffEditor .multi-diff-root-floating-menu .action-item:first-child>.action-label{padding-left:7px}.monaco-component.multiDiffEditor .multi-diff-root-floating-menu .action-item:last-child>.action-label{padding-right:7px}.monaco-component.multiDiffEditor .multi-diff-root-floating-menu .action-item .action-label.separator{background-color:var(--vscode-button-separator)}.monaco-component.multiDiffEditor .active{--vscode-multiDiffEditor-border:var(--vscode-focusBorder)}.monaco-component.multiDiffEditor .multiDiffEntry{flex-direction:column;flex:1;display:flex;overflow:hidden}.monaco-component.multiDiffEditor .multiDiffEntry .collapse-button{cursor:pointer;margin:0 5px}.monaco-component.multiDiffEditor .multiDiffEntry .collapse-button a{display:block}.monaco-component.multiDiffEditor .multiDiffEntry .header{z-index:1000;background:var(--vscode-editor-background)}.monaco-component.multiDiffEditor .multiDiffEntry .header:not(.collapsed) .header-content{border-bottom:1px solid var(--vscode-sideBarSectionHeader-border)}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content{border-top:1px solid var(--vscode-multiDiffEditor-border);color:var(--vscode-foreground);background:var(--vscode-multiDiffEditor-headerBackground);align-items:center;margin:8px 0 0;padding:4px 5px;display:flex}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content.shadow{box-shadow:var(--vscode-scrollbar-shadow) 0px 6px 6px -6px}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content .file-path{flex:1;min-width:0;display:flex}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content .file-path .title{font-size:14px;line-height:22px}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content .file-path .title.original{text-overflow:ellipsis;flex:1;min-width:0}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content .file-path .status{opacity:.75;margin:0 10px;font-weight:600;line-height:22px}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content .actions{padding:0 8px}.monaco-component.multiDiffEditor .multiDiffEntry .editorParent{border-bottom:1px solid var(--vscode-multiDiffEditor-border);flex-direction:column;flex:1;display:flex;overflow:hidden}.monaco-component.multiDiffEditor .multiDiffEntry .editorContainer{flex:1}
|
|
3
|
-
.xterm{cursor:text;-webkit-user-select:none;user-select:none;position:relative}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{z-index:5;position:absolute;top:0}.xterm .xterm-helper-textarea{opacity:0;z-index:-5;white-space:nowrap;resize:none;border:0;width:0;height:0;margin:0;padding:0;position:absolute;top:0;left:-9999em;overflow:hidden}.xterm .composition-view{color:#fff;white-space:nowrap;z-index:1;background:#000;display:none;position:absolute}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{cursor:default;background-color:#000;position:absolute;inset:0;overflow-y:scroll}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;top:0;left:0}.xterm-char-measure-element{visibility:hidden;line-height:normal;display:inline-block;position:absolute;top:0;left:-9999em}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{z-index:10;color:#0000;pointer-events:none;position:absolute;inset:0}.xterm .xterm-accessibility-tree:not(.debug) ::selection{color:#0000}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre;font-family:monospace}.xterm .xterm-accessibility-tree>div{transform-origin:0;width:fit-content}.xterm .live-region{width:1px;height:1px;position:absolute;left:-9999px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{-webkit-text-decoration:underline double;text-decoration:underline double}.xterm-underline-3{-webkit-text-decoration:underline wavy;text-decoration:underline wavy}.xterm-underline-4{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.xterm-underline-5{-webkit-text-decoration:underline dashed;text-decoration:underline dashed}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:underline overline}.xterm-overline.xterm-underline-2{-webkit-text-decoration:overline double underline;text-decoration:overline double underline}.xterm-overline.xterm-underline-3{-webkit-text-decoration:overline wavy underline;text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{-webkit-text-decoration:overline dotted underline;text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{-webkit-text-decoration:overline dashed underline;text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;pointer-events:none;position:absolute;top:0;right:0}.xterm-decoration-top{z-index:2;position:relative}.xterm .xterm-scrollable-element>.scrollbar{cursor:default}.xterm .xterm-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.xterm .xterm-scrollable-element>.visible{opacity:1;z-index:11;background:0 0;transition:opacity .1s linear}.xterm .xterm-scrollable-element>.invisible{opacity:0;pointer-events:none}.xterm .xterm-scrollable-element>.invisible.fade{transition:opacity .8s linear}.xterm .xterm-scrollable-element>.shadow{display:none;position:absolute}.xterm .xterm-scrollable-element>.shadow.top{width:100%;height:3px;box-shadow:var(--vscode-scrollbar-shadow,#000) 0 6px 6px -6px inset;display:block;top:0;left:3px}.xterm .xterm-scrollable-element>.shadow.left{width:3px;height:100%;box-shadow:var(--vscode-scrollbar-shadow,#000) 6px 0 6px -6px inset;display:block;top:3px;left:0}.xterm .xterm-scrollable-element>.shadow.top-left-corner{width:3px;height:3px;display:block;top:0;left:0}.xterm .xterm-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow,#000) 6px 0 6px -6px inset}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,940361,e=>{"use strict";var t=e.i(344180);e.s([],2365),e.i(2365);var n=e.i(764556),a=e.i(394822),s=e.i(174465),r=e.i(648224),i=e.i(35359);e.i(8890);var l=e.i(422561),o=e.i(526850),c=e.i(232449),d=e.i(410421),u=e.i(150129),m=e.i(969490),x=e.i(602453),p=e.i(817955),g=e.i(742665),h=e.i(87709);let f=n.forwardRef(function(e,t){let{render:a,className:r,style:f,...j}=e,{setAnchor:v,actionsRef:b,internalBackdropRef:y,backdropRef:C,positionerRef:N,allowMouseUpTriggerRef:w,initialCursorPointRef:k,rootId:M}=(0,s.useContextMenuRootContext)(!1),{store:D}=(0,i.useMenuRootContext)(!1),S=D.useState("open"),T=D.useState("disabled"),A=n.useRef(null),R=n.useRef(null),z=(0,c.useTimeout)(),I=(0,c.useTimeout)(),P=n.useRef(!1);function O(e,t,n){let a=n.type.startsWith("touch");k.current={x:e,y:t},v({getBoundingClientRect:()=>DOMRect.fromRect({width:10*!!a,height:10*!!a,x:e,y:t})}),P.current=!1,b.current?.setOpen(!0,(0,x.createChangeEventDetails)(g.REASONS.triggerPress,n)),I.start(500,()=>{P.current=!0})}function B(){z.clear(),R.current=null}return n.useEffect(()=>{let e=(0,o.ownerDocument)(A.current);return(0,l.addEventListener)(e,"contextmenu",function(e){if(T)return;let t=(0,d.getTarget)(e);((0,d.contains)(A.current,t)||(0,d.contains)(y.current,t)||(0,d.contains)(C.current,t))&&e.preventDefault()})},[C,T,y]),(0,m.useRenderElement)("div",e,{state:{open:S},ref:[A,t],props:[{onContextMenu:function(e){if(T)return;w.current=!0,(0,u.stopEvent)(e),O(e.clientX,e.clientY,e.nativeEvent);let t=(0,o.ownerDocument)(A.current);(0,l.addEventListener)(t,"mouseup",e=>{if(w.current=!1,!P.current)return;I.clear(),P.current=!1;let t=(0,d.getTarget)(e);(0,d.contains)(N.current,t)||M&&t&&(0,h.findRootOwnerId)(t)===M||b.current?.setOpen(!1,(0,x.createChangeEventDetails)(g.REASONS.cancelOpen,e))},{once:!0})},onTouchStart:function(e){if(!T&&(w.current=!1,1===e.touches.length)){e.stopPropagation();let t=e.touches[0];R.current={x:t.clientX,y:t.clientY},z.start(500,()=>{R.current&&O(R.current.x,R.current.y,e.nativeEvent)})}},onTouchMove:function(e){if(z.isStarted()&&R.current&&1===e.touches.length){let t=e.touches[0],n=Math.abs(t.clientX-R.current.x),a=Math.abs(t.clientY-R.current.y);(n>10||a>10)&&z.clear()}},onTouchEnd:B,onTouchCancel:B,style:{WebkitTouchCallout:"none"}},j],stateAttributesMapping:p.pressableTriggerOpenStateMapping})});var j=e.i(487455),v=e.i(293209),b=e.i(503662),y=e.i(33427),C=e.i(324573),N=e.i(582883),w=e.i(277658),k=e.i(349204),M=e.i(28051),D=e.i(597375),S=e.i(81752),T=e.i(59354),A=e.i(300637),R=e.i(281478),z=e.i(65255),I=e.i(327794),P=e.i(362962);e.s(["Arrow",()=>C.MenuArrow,"Backdrop",()=>j.MenuBackdrop,"CheckboxItem",()=>M.MenuCheckboxItem,"CheckboxItemIndicator",()=>D.MenuCheckboxItemIndicator,"Group",()=>N.MenuGroup,"GroupLabel",()=>w.MenuGroupLabel,"Item",()=>k.MenuItem,"LinkItem",()=>S.MenuLinkItem,"Popup",()=>y.MenuPopup,"Portal",()=>v.MenuPortal,"Positioner",()=>b.MenuPositioner,"RadioGroup",()=>T.MenuRadioGroup,"RadioItem",()=>A.MenuRadioItem,"RadioItemIndicator",()=>R.MenuRadioItemIndicator,"Root",0,function(e){let[l,o]=n.useState({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,x:0,y:0})}),c=n.useRef(null),d=n.useRef(null),u=n.useRef(null),m=n.useRef(null),x=n.useRef(!0),p=n.useRef(null),g=(0,a.useId)(),h=n.useMemo(()=>({anchor:l,setAnchor:o,actionsRef:u,backdropRef:c,internalBackdropRef:d,positionerRef:m,allowMouseUpTriggerRef:x,initialCursorPointRef:p,rootId:g}),[l,g]);return(0,t.jsx)(s.ContextMenuRootContext.Provider,{value:h,children:(0,t.jsx)(i.MenuRootContext.Provider,{value:void 0,children:(0,t.jsx)(r.Menu.Root,{...e})})})},"Separator",()=>P.Separator,"SubmenuRoot",()=>z.MenuSubmenuRoot,"SubmenuTrigger",()=>I.MenuSubmenuTrigger,"Trigger",0,f],912001);var O=e.i(912001),O=O,B=e.i(465458),E=e.i(932031);function _({className:e,align:n="start",alignOffset:a=4,side:s="right",sideOffset:r=0,...i}){return(0,t.jsx)(O.Portal,{children:(0,t.jsx)(O.Positioner,{className:"isolate z-50 outline-none",align:n,alignOffset:a,side:s,sideOffset:r,children:(0,t.jsx)(O.Popup,{"data-slot":"context-menu-content",className:(0,B.cn)("z-50 max-h-(--available-height) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...i})})})}e.i(299648),e.s(["ContextMenu",0,function({...e}){return(0,t.jsx)(O.Root,{"data-slot":"context-menu",...e})},"ContextMenuContent",0,_,"ContextMenuItem",0,function({className:e,inset:n,variant:a="default",...s}){return(0,t.jsx)(O.Item,{"data-slot":"context-menu-item","data-inset":n,"data-variant":a,className:(0,B.cn)("group/context-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive",e),...s})},"ContextMenuSeparator",0,function({className:e,...n}){return(0,t.jsx)(O.Separator,{"data-slot":"context-menu-separator",className:(0,B.cn)("-mx-1 my-1 h-px bg-border",e),...n})},"ContextMenuSub",0,function({...e}){return(0,t.jsx)(O.SubmenuRoot,{"data-slot":"context-menu-sub",...e})},"ContextMenuSubContent",0,function({...e}){return(0,t.jsx)(_,{"data-slot":"context-menu-sub-content",className:"shadow-lg",side:"right",...e})},"ContextMenuSubTrigger",0,function({className:e,inset:n,children:a,...s}){return(0,t.jsxs)(O.SubmenuTrigger,{"data-slot":"context-menu-sub-trigger","data-inset":n,className:(0,B.cn)("flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...s,children:[a,(0,t.jsx)(E.ChevronRightIcon,{className:"ml-auto"})]})},"ContextMenuTrigger",0,function({className:e,...n}){return(0,t.jsx)(O.Trigger,{"data-slot":"context-menu-trigger",className:(0,B.cn)("select-none",e),...n})}],940361)},595390,272736,e=>{"use strict";var t=e.i(344180),n=e.i(764556),a=e.i(681622),s=e.i(611176),r=e.i(972846);let i=e=>!["scheduler","task_creator","bot"].includes(e.description||"")&&"agent-generator"!==e.id;function l(e){return e.name?.trim()||e.role}e.s(["MemberPicker",0,function({candidates:e,selected:l,onToggle:o,searchPlaceholder:c,emptyText:d,label:u,filter:m}){let[x,p]=(0,n.useState)(""),g=e.filter(m??i).filter(e=>`${e.label} ${e.description||""}`.toLowerCase().includes(x.toLowerCase()));return(0,t.jsxs)("div",{className:"space-y-2",children:[u&&(0,t.jsx)("label",{className:"text-sm font-medium",children:u}),(0,t.jsx)(a.Input,{value:x,onChange:e=>p(e.target.value),placeholder:c}),(0,t.jsxs)("div",{className:"max-h-40 overflow-y-auto space-y-0.5",children:[0===g.length&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground py-2 text-center",children:d||"No items found"}),g.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>o(e.id),className:"flex items-center gap-2 w-full px-2 py-1.5 rounded-md hover:bg-muted text-left text-sm transition-colors",children:[(0,t.jsx)(s.AgentIcon,{agentId:"user"!==e.id?e.id:void 0,name:e.label,className:"size-5 rounded-full"}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"block truncate",children:e.label}),e.description&&(0,t.jsx)("span",{className:"block truncate text-xs text-muted-foreground",children:e.description})]}),(0,t.jsx)("div",{className:`flex items-center justify-center size-4 rounded border shrink-0 ${l.includes(e.id)?"bg-primary border-primary text-primary-foreground":"border-input"}`})]},e.id))]}),l.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:l.map(n=>{let a=e.find(e=>e.id===n),i=a?.label||n;return(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-md bg-muted px-2 py-0.5 text-xs max-w-[160px] min-w-0",children:["user"===n?(0,t.jsx)("span",{className:"truncate",children:i}):(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 min-w-0",children:[(0,t.jsx)(s.AgentIcon,{agentId:n,name:i,className:"size-3.5 rounded-full shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:i})]}),(0,t.jsx)("button",{type:"button",onClick:()=>o(n),className:"hover:text-destructive shrink-0",children:(0,t.jsx)(r.X,{className:"size-3"})})]},n)})})]})}],595390),e.s(["getAgentDisplayName",0,l,"getMemberDisplayName",0,function(e,t){if("user"===t)return"user";let n=e.find(e=>e.id===t);return n?l(n):t},"normalizeChannelMembersToAgentIds",0,function(e,t){let n=new Set(e.map(e=>e.id)),a=[],s=new Set;for(let e of t)n.has(e)&&(s.has(e)||(s.add(e),a.push(e)));return a}],272736)},478117,e=>{"use strict";var t=e.i(344180),n=e.i(764556),a=e.i(244073),s=e.i(209988),r=e.i(681622),i=e.i(260218),l=e.i(188815),o=e.i(595390),c=e.i(272736);e.s(["ChannelDialog",0,function({open:e,onOpenChange:d,channel:u,agents:m=[],onSubmit:x}){let p=(0,a.useTranslations)("chat"),g=(0,a.useTranslations)("common"),h=[{value:"general",label:p("channel.general")},{value:"issue",label:p("channel.issue")},{value:"agent",label:p("channel.agent")}],[f,j]=(0,n.useState)(""),[v,b]=(0,n.useState)("general"),[y,C]=(0,n.useState)([]),[N,w]=(0,n.useState)(0),k=m.filter(e=>!1!==e.enabled).map(e=>({id:e.id,label:(0,c.getMemberDisplayName)(m,e.id)}));return(0,n.useEffect)(()=>{e&&queueMicrotask(()=>{u?(j(u.name),b(u.type),C([...u.members])):(j(""),b("general"),C(["user"])),w(e=>e+1)})},[e,u]),(0,t.jsx)(s.Dialog,{open:e,onOpenChange:d,children:(0,t.jsxs)(s.DialogContent,{className:"sm:max-w-md max-h-[85vh] p-0 gap-0 flex flex-col overflow-hidden",children:[(0,t.jsxs)(s.DialogHeader,{className:"px-4 py-4 shrink-0",children:[(0,t.jsx)(s.DialogTitle,{children:p(u?"channel.edit":"channel.create")}),(0,t.jsx)(s.DialogDescription,{children:p(u?"channel.edit":"channel.create")})]}),(0,t.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto px-4 pb-4",children:(0,t.jsxs)("div",{className:"space-y-4 pt-2",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("name")}),(0,t.jsx)(r.Input,{value:f,onChange:e=>j(e.target.value),placeholder:p("channel.namePlaceholder"),onKeyDown:e=>"Enter"===e.key&&e.preventDefault()})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:p("channel.type")}),(0,t.jsx)(l.SearchSelect,{value:v,onChange:e=>b(e),options:h,allowCustom:!1,placeholder:p("channel.selectType")})]}),(0,t.jsx)(o.MemberPicker,{candidates:k,selected:y,onToggle:e=>{C(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},label:p("channel.members"),searchPlaceholder:p("channel.addMember"),emptyText:p("channel.noAgents")||"No agents found"},N),(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,t.jsx)(i.Button,{variant:"outline",onClick:()=>d(!1),children:g("cancel")}),(0,t.jsx)(i.Button,{onClick:()=>{x({name:f.trim(),type:v,members:y}),d(!1)},children:g(u?"save":"create")})]})]})})]})})}])},79882,414053,725161,e=>{"use strict";var t=e.i(433721);let n=(0,t.default)("archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);e.s(["Archive",0,n],79882);let a=(0,t.default)("archive-restore",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]]);e.s(["ArchiveRestore",0,a],414053);let s=(0,t.default)("arrow-up-down",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);e.s(["ArrowUpDown",0,s],725161)},734649,e=>{"use strict";var t=e.i(344180),n=e.i(764556);e.s([],764940),e.i(764940);var a=e.i(956834),s=e.i(625386),r=e.i(530089),i=e.i(975983),l=e.i(16223),o=e.i(583901),c=e.i(512519),d=e.i(152851),u=e.i(481181),m=e.i(476343),x=e.i(272248),p=e.i(625144),g=e.i(225171);e.s(["Backdrop",()=>l.DialogBackdrop,"Close",()=>o.DialogClose,"Description",()=>c.DialogDescription,"Handle",()=>g.DialogHandle,"Popup",()=>d.DialogPopup,"Portal",()=>u.DialogPortal,"Root",0,function(e){let{children:l,open:o,defaultOpen:c=!1,onOpenChange:d,onOpenChangeComplete:u,actionsRef:m,handle:x,triggerId:p,defaultTriggerId:g=null}=e,h=(0,r.useDialogRootContext)(!0),f=!!h,j=i.DialogStore.useStore(x?.store,{open:c,openProp:o,activeTriggerId:g,triggerIdProp:p,modal:!0,disablePointerDismissal:!0,nested:f,role:"alertdialog"});j.useControlledProp("openProp",o),j.useControlledProp("triggerIdProp",p),j.useSyncedValue("nested",f),j.useContextCallback("onOpenChange",d),j.useContextCallback("onOpenChangeComplete",u);let v=j.useState("payload");(0,s.useDialogRoot)({store:j,actionsRef:m,parentContext:h?.store.context,isDrawer:!1,onOpenChange:d,triggerIdProp:p});let b=n.useMemo(()=>({store:j}),[j]);return(0,t.jsx)(a.IsDrawerContext.Provider,{value:!1,children:(0,t.jsx)(r.DialogRootContext.Provider,{value:b,children:"function"==typeof l?l({payload:v}):l})})},"Title",()=>m.DialogTitle,"Trigger",()=>x.DialogTrigger,"Viewport",()=>p.DialogViewport,"createHandle",0,function(){return new g.DialogHandle(new i.DialogStore({modal:!0,disablePointerDismissal:!0,role:"alertdialog"}))}],756198);var h=e.i(756198),h=h,f=e.i(465458),j=e.i(260218),v=e.i(250226);function b({...e}){return(0,t.jsx)(h.Portal,{"data-slot":"alert-dialog-portal",...e})}function y({className:e,...n}){return(0,t.jsx)(h.Backdrop,{"data-slot":"alert-dialog-overlay",className:(0,f.cn)("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...n})}e.s(["AlertDialog",0,function({ignoreBack:e=!1,...a}){let s=n.useId(),r=(0,v.useMobilePanelStore)(e=>e.registerOverlay),i=(0,v.useMobilePanelStore)(e=>e.unregisterOverlay),l="open"in a?a.open:"defaultOpen"in a?a.defaultOpen:void 0,o=a.onOpenChange,c=n.useRef(o);return n.useEffect(()=>{c.current=o},[o]),n.useEffect(()=>l&&!e&&c.current?(r(s,()=>c.current?.(!1,{reason:void 0})),()=>i(s)):void i(s),[e,l,s,r,i]),(0,t.jsx)(h.Root,{"data-slot":"alert-dialog",...a})},"AlertDialogAction",0,function({className:e,...n}){return(0,t.jsx)(j.Button,{"data-slot":"alert-dialog-action",className:(0,f.cn)(e),...n})},"AlertDialogCancel",0,function({className:e,variant:n="outline",size:a="default",...s}){return(0,t.jsx)(h.Close,{"data-slot":"alert-dialog-cancel",className:(0,f.cn)(e),render:(0,t.jsx)(j.Button,{variant:n,size:a}),...s})},"AlertDialogContent",0,function({className:e,size:n="default",...a}){return(0,t.jsxs)(b,{children:[(0,t.jsx)(y,{}),(0,t.jsx)(h.Popup,{"data-slot":"alert-dialog-content","data-size":n,className:(0,f.cn)("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...a})]})},"AlertDialogDescription",0,function({className:e,...n}){return(0,t.jsx)(h.Description,{"data-slot":"alert-dialog-description",className:(0,f.cn)("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...n})},"AlertDialogFooter",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-footer",className:(0,f.cn)("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...n})},"AlertDialogHeader",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,f.cn)("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...n})},"AlertDialogTitle",0,function({className:e,...n}){return(0,t.jsx)(h.Title,{"data-slot":"alert-dialog-title",className:(0,f.cn)("font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...n})}],734649)},976648,e=>{"use strict";var t=e.i(344180),n=e.i(764556),a=e.i(244073),s=e.i(31807),r=e.i(355819),i=e.i(325443),l=e.i(227634),o=e.i(938306),c=e.i(511800),d=e.i(953700),u=e.i(962562),m=e.i(451534),x=e.i(79882),p=e.i(414053),g=e.i(315775),h=e.i(137340),f=e.i(344118),j=e.i(725161),v=e.i(260218),b=e.i(562918),y=e.i(465458),C=e.i(613087),N=e.i(478117),w=e.i(272736),k=e.i(157408),M=e.i(940361),D=e.i(256186),S=e.i(917955),T=e.i(734649),A=e.i(992764);let R={general:{className:"bg-muted text-muted-foreground",icon:l.Hash},issue:{className:"bg-amber-500/15 text-amber-600",icon:c.AlertCircle},agent:{className:"bg-blue-500/15 text-blue-600",icon:o.MessageCircle}};function z(e){if(!e||0===e.length)return null;let t=e[e.length-1];return t?{text:(t.content??"").replace(/<[^>]*>/g,"").slice(0,60)||"...",status:t.status}:null}let I=["today","yesterday","thisWeek","earlier"],P={today:"timeToday",yesterday:"timeYesterday",thisWeek:"timeThisWeek",earlier:"timeEarlier"};e.s(["ChannelList",0,function({workspaceId:e}){let l=(0,a.useTranslations)("chat"),c=(0,a.useTranslations)("common"),{channels:O,activeChannelId:B,messages:E,loadChannels:_,createChannel:L,updateChannel:H,deleteChannel:$,setActiveChannel:G,upsertChannel:W}=(0,s.useChannelStore)(),[F,V]=(0,n.useState)(!1),[Y,q]=(0,n.useState)(null),[U,X]=(0,n.useState)(!1),[K,J]=(0,n.useState)("none"),[Q,Z]=(0,n.useState)({}),[ee,et]=(0,n.useState)(!1),[en,ea]=(0,n.useState)("createdAt"),[es,er]=(0,n.useState)("desc"),[ei,el]=(0,n.useState)(!0),eo=(0,r.useAgentStore)(e=>e.agents),ec=(0,r.useAgentStore)(e=>e.ensure),ed=(0,n.useMemo)(()=>O.filter(e=>!e.archived),[O]),eu=(0,n.useMemo)(()=>O.filter(e=>e.archived),[O]),em=(0,n.useMemo)(()=>{let e=[...ed];return e.sort((e,t)=>{let n=0;switch(en){case"createdAt":n=new Date(e.createdAt).getTime()-new Date(t.createdAt).getTime();break;case"lastReply":{let a=E[e.id]?.at(-1)?.createdAt,s=E[t.id]?.at(-1)?.createdAt;n=(a?new Date(a).getTime():0)-(s?new Date(s).getTime():0);break}case"type":n=e.type.localeCompare(t.type)}return"desc"===es?-n:n}),e},[ed,en,es,E]),ex=(0,n.useMemo)(()=>{if("none"===K)return null;if("time"===K){let e={};for(let t of em){let n=function(e){let t=new Date(e),n=new Date,a=new Date(n.getFullYear(),n.getMonth(),n.getDate()),s=new Date(a.getTime()-864e5),r=new Date(a.getTime()-6048e5);return t>=a?"today":t>=s?"yesterday":t>=r?"thisWeek":"earlier"}(t.createdAt);e[n]||(e[n]=[]),e[n].push(t)}return I.filter(t=>e[t]?.length).map(t=>({key:t,label:c(P[t]),items:e[t]}))}return["general","issue","agent"].filter(e=>em.some(t=>t.type===e)).map(e=>({key:e,label:l(`channel.${e}`),items:em.filter(t=>t.type===e)}))},[K,em,c,l]);(0,n.useEffect)(()=>{el(!0),_(e).finally(()=>el(!1)),ec()},[e,_,ec]),(0,n.useEffect)(()=>{let t=(0,k.getWS)(e).on("channel.updated",e=>{W(e)});return()=>{t()}},[e,W]);let ep=e=>{let n,a=z(E[e.id]),s=R[e.type],r=a?.status==="streaming"||a?.status==="pending",o=e.members.filter(e=>"user"!==e);return(0,t.jsxs)(M.ContextMenu,{children:[(0,t.jsxs)(M.ContextMenuTrigger,{className:(0,y.cn)("flex items-start gap-2.5 w-full px-3 py-2 text-sm hover:bg-accent transition-colors text-left",B===e.id&&"bg-accent text-accent-foreground"),onClick:()=>G(e.id),children:[(n=s.icon,(0,t.jsx)(n,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0 mt-1"})),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"truncate font-medium text-[13px]",children:e.name}),(0,t.jsx)(b.Badge,{variant:"secondary",className:(0,y.cn)("text-[10px] px-1 py-0 h-4 rounded",s.className),children:l(`channel.${e.type}`)}),r&&(0,t.jsxs)("span",{className:"relative flex h-2 w-2",children:[(0,t.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-blue-400 opacity-75"}),(0,t.jsx)("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-blue-500"})]}),o.length>0&&(0,t.jsx)(i.Bot,{className:"h-3 w-3 text-muted-foreground shrink-0"})]}),a?(0,t.jsx)("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:a.text}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground/50 mt-0.5",children:l("emptyState")})]})]}),(0,t.jsxs)(M.ContextMenuContent,{children:[(0,t.jsxs)(M.ContextMenuItem,{onClick:()=>eh(e),children:[(0,t.jsx)(u.Pencil,{className:"size-3.5"}),c("edit")]}),(0,t.jsxs)(M.ContextMenuItem,{onClick:()=>ef(e.id),children:[(0,t.jsx)(m.FolderOpen,{className:"size-3.5"}),c("open")]}),(0,t.jsx)(M.ContextMenuSeparator,{}),(0,t.jsxs)(M.ContextMenuItem,{onClick:()=>ej(e),children:[(0,t.jsx)(x.Archive,{className:"size-3.5"}),l("channel.archive")]})]})]},e.id)},eg=async t=>{let n=(0,w.normalizeChannelMembersToAgentIds)(eo,t.members);Y?await H(e,Y.id,{name:t.name,type:t.type,members:n}):await L(e,t.name,t.type,n)},eh=e=>{q(e),V(!0)},ef=async t=>{await fetch(`/api/workspaces/${e}/files/reveal?channelId=${t}`,{method:"POST"})},ej=async t=>{await H(e,t.id,{archived:!t.archived})},ev=async()=>{await Promise.all(eu.map(t=>$(e,t.id))),et(!1)};return(0,t.jsxs)("div",{className:"flex flex-col h-full",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-2 py-1.5 border-b text-xs font-medium text-muted-foreground",children:[(0,t.jsx)("span",{children:l("channel.general")}),(0,t.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,t.jsx)("button",{onClick:()=>V(!0),className:"p-0.5 hover:bg-accent rounded",children:(0,t.jsx)(d.Plus,{className:"size-3.5"})}),(0,t.jsxs)(S.DropdownMenu,{children:[(0,t.jsx)(S.DropdownMenuTrigger,{className:"p-0.5 hover:bg-accent rounded",children:(0,t.jsx)(j.ArrowUpDown,{className:"size-3.5"})}),(0,t.jsx)(S.DropdownMenuContent,{align:"end",className:"min-w-40",children:[{field:"createdAt",label:c("sortByCreated")},{field:"lastReply",label:c("sortByLastReply")},{field:"type",label:c("sortByStatus")}].map(({field:e,label:n})=>(0,t.jsxs)(S.DropdownMenuItem,{onClick:()=>{en===e?er(e=>"asc"===e?"desc":"asc"):(ea(e),er("desc"))},children:[en===e&&(0,t.jsx)(f.Check,{className:"size-3.5"}),n,en===e&&(0,t.jsx)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:"asc"===es?"↑":"↓"})]},e))})]}),(0,t.jsxs)(S.DropdownMenu,{children:[(0,t.jsx)(S.DropdownMenuTrigger,{className:"p-0.5 hover:bg-accent rounded",children:(0,t.jsx)(g.MoreHorizontal,{className:"size-3.5"})}),(0,t.jsxs)(S.DropdownMenuContent,{align:"end",className:"min-w-48",children:[(0,t.jsxs)(S.DropdownMenuItem,{onClick:()=>J("none"),children:["none"===K&&(0,t.jsx)(f.Check,{className:"size-3.5"}),c("groupNone")]}),(0,t.jsxs)(S.DropdownMenuItem,{onClick:()=>J("time"),children:["time"===K&&(0,t.jsx)(f.Check,{className:"size-3.5"}),c("groupByTime")]}),(0,t.jsxs)(S.DropdownMenuItem,{onClick:()=>J("status"),children:["status"===K&&(0,t.jsx)(f.Check,{className:"size-3.5"}),c("groupByStatus")]}),(0,t.jsx)(S.DropdownMenuSeparator,{}),(0,t.jsxs)(S.DropdownMenuItem,{disabled:0===eu.length,onClick:()=>et(!0),children:[(0,t.jsx)(h.Trash2,{className:"size-3.5"}),l("channel.clearArchived")]})]})]})]})]}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[ei?(0,t.jsx)("div",{className:"p-2 space-y-1",children:(0,t.jsx)(C.SkeletonGroup,{count:4,children:e=>(0,t.jsxs)("div",{className:"flex items-start gap-2.5 px-3 py-2",children:[(0,t.jsx)(C.Skeleton,{className:"size-3.5 rounded shrink-0 mt-1"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 space-y-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(C.Skeleton,{className:"h-4 w-20"}),(0,t.jsx)(C.Skeleton,{className:"h-4 w-8 rounded-full"})]}),(0,t.jsx)(C.Skeleton,{className:"h-3 w-3/4"})]})]},e)})}):null,ei||0!==ed.length||0!==eu.length?null:(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center h-full gap-3 px-4 text-center",children:[(0,t.jsx)("div",{className:"rounded-full bg-muted p-3",children:(0,t.jsx)(o.MessageCircle,{className:"h-5 w-5 text-muted-foreground"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:l("channel.noMembers")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:l("channel.create")})]}),(0,t.jsxs)(v.Button,{size:"sm",variant:"outline",onClick:()=>V(!0),children:[(0,t.jsx)(d.Plus,{className:"h-3.5 w-3.5 mr-1"}),c("add")]})]}),!ei&&"none"===K&&em.map(e=>ep(e)),!ei&&"none"!==K&&ex?.map(e=>(0,t.jsxs)(D.Collapsible,{open:!1!==Q[e.key],onOpenChange:t=>Z(n=>({...n,[e.key]:t})),children:[(0,t.jsxs)(D.CollapsibleTrigger,{className:"flex items-center gap-1 w-full px-3 py-1.5 text-xs font-medium text-muted-foreground hover:bg-accent transition-colors",children:[(0,t.jsx)(A.ChevronRight,{className:(0,y.cn)("size-3 transition-transform",!1!==Q[e.key]&&"rotate-90")}),e.label," (",e.items.length,")"]}),(0,t.jsx)(D.CollapsibleContent,{children:e.items.map(e=>ep(e))})]},e.key)),!ei&&eu.length>0&&(0,t.jsxs)(D.Collapsible,{open:U,onOpenChange:X,children:[(0,t.jsxs)(D.CollapsibleTrigger,{className:"flex items-center gap-1 w-full px-3 py-1.5 text-xs font-medium text-muted-foreground hover:bg-accent transition-colors",children:[(0,t.jsx)(A.ChevronRight,{className:(0,y.cn)("size-3 transition-transform",U&&"rotate-90")}),(0,t.jsx)(x.Archive,{className:"size-3"}),l("channel.archived")," (",eu.length,")"]}),(0,t.jsx)(D.CollapsibleContent,{children:eu.map(e=>{let n,a=z(E[e.id]),s=R[e.type];return(0,t.jsxs)(M.ContextMenu,{children:[(0,t.jsxs)(M.ContextMenuTrigger,{className:(0,y.cn)("flex items-start gap-2.5 w-full px-3 py-2 text-sm hover:bg-accent transition-colors text-left opacity-60",B===e.id&&"bg-accent text-accent-foreground opacity-100"),onClick:()=>G(e.id),children:[(n=s.icon,(0,t.jsx)(n,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0 mt-1"})),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"truncate font-medium text-[13px]",children:e.name}),(0,t.jsx)(b.Badge,{variant:"secondary",className:(0,y.cn)("text-[10px] px-1 py-0 h-4 rounded",s.className),children:l(`channel.${e.type}`)})]}),a?(0,t.jsx)("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:a.text}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground/50 mt-0.5",children:l("emptyState")})]})]}),(0,t.jsxs)(M.ContextMenuContent,{children:[(0,t.jsxs)(M.ContextMenuItem,{onClick:()=>G(e.id),children:[(0,t.jsx)(m.FolderOpen,{className:"size-3.5"}),c("open")]}),(0,t.jsx)(M.ContextMenuSeparator,{}),(0,t.jsxs)(M.ContextMenuItem,{onClick:()=>ej(e),children:[(0,t.jsx)(p.ArchiveRestore,{className:"size-3.5"}),l("channel.unarchive")]})]})]},e.id)})})]})]}),(0,t.jsx)(N.ChannelDialog,{open:F,onOpenChange:e=>{V(e),e||q(null)},workspaceId:e,channel:Y,agents:eo,onSubmit:eg}),(0,t.jsx)(T.AlertDialog,{open:ee,onOpenChange:et,children:(0,t.jsxs)(T.AlertDialogContent,{children:[(0,t.jsxs)(T.AlertDialogHeader,{children:[(0,t.jsx)(T.AlertDialogTitle,{children:l("channel.clearArchived")}),(0,t.jsx)(T.AlertDialogDescription,{children:l("channel.clearArchivedConfirm",{count:eu.length})})]}),(0,t.jsxs)(T.AlertDialogFooter,{children:[(0,t.jsx)(T.AlertDialogCancel,{children:c("cancel")}),(0,t.jsx)(T.AlertDialogAction,{onClick:ev,children:c("delete")})]})]})})]})}])},878166,e=>{e.n(e.i(976648))}]);
|