ompchamber 0.3.0 → 0.5.0
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/README.md +17 -10
- package/dist/client/index.html +1 -1
- package/dist/client/static/css/index.5291f58223.css +2 -0
- package/dist/client/static/js/async/{1k.544adbf77d.js → 1k.5974df3b87.js} +2 -2
- package/dist/client/static/js/async/3j.357c80ff38.js +2 -0
- package/dist/client/static/js/async/{3y.22075aa079.js → 3y.ededeebde8.js} +5 -5
- package/dist/client/static/js/async/51.95bcae98af.js +2 -0
- package/dist/client/static/js/async/6.f034c9b528.js +1 -0
- package/dist/client/static/js/async/a.e05da304c8.js +10 -0
- package/dist/client/static/js/async/ar.1e14da5588.js +1 -0
- package/dist/client/static/js/async/ct.b74928f7a3.js +1 -0
- package/dist/client/static/js/async/dc.6dc4b0a04b.js +2 -0
- package/dist/client/static/js/async/fw.6a51998a8e.js +6 -0
- package/dist/client/static/js/async/g.7a4bbd4798.js +2 -0
- package/dist/client/static/js/async/g.7a4bbd4798.js.LICENSE.txt +11 -0
- package/dist/client/static/js/async/{k.e878dd350f.js → k.7466330d1a.js} +2 -2
- package/dist/client/static/js/async/katex-vendor.de6a87c308.js +1 -0
- package/dist/client/static/js/async/kc.bbdb35b771.js +1 -0
- package/dist/client/static/js/async/l6.c56640c205.js +1 -0
- package/dist/client/static/js/async/{m.3fc017a055.js → m.4b29d34f93.js} +3 -3
- package/dist/client/static/js/async/{og.ae7acf03ac.js → og.634fba99ac.js} +2 -2
- package/dist/client/static/js/async/q.7fb4d2f374.js +21 -0
- package/dist/client/static/js/async/rd.cb6bf495bb.js +2 -0
- package/dist/client/static/js/async/rf.d626afc367.js +2 -0
- package/dist/client/static/js/async/s.413c2a4683.js +2 -0
- package/dist/client/static/js/async/s.413c2a4683.js.LICENSE.txt +6 -0
- package/dist/client/static/js/async/sy.d16be843a7.js +94 -0
- package/dist/client/static/js/async/t.cb3fcf8615.js +1 -0
- package/dist/client/static/js/async/ud.3065bfee31.js +2 -0
- package/dist/client/static/js/async/uf.46ad6209fa.js +2 -0
- package/dist/client/static/js/async/uf.46ad6209fa.js.LICENSE.txt +6 -0
- package/dist/client/static/js/async/v.7d28d3c241.js +34 -0
- package/dist/client/static/js/async/v0.394ed37c6b.js +2 -0
- package/dist/client/static/js/async/v0.394ed37c6b.js.LICENSE.txt +6 -0
- package/dist/client/static/js/async/vt.42416b707d.js +1 -0
- package/dist/client/static/js/async/vy.bbe114c4e0.js +2 -0
- package/dist/client/static/js/async/vy.bbe114c4e0.js.LICENSE.txt +6 -0
- package/dist/client/static/js/async/xw.ae67ba06fd.js +31 -0
- package/dist/client/static/js/async/xw.ae67ba06fd.js.LICENSE.txt +4 -0
- package/dist/client/static/js/async/yg.35bebd6d0c.js +149 -0
- package/dist/client/static/js/async/yv.2fa22f009a.js +1 -0
- package/dist/client/static/js/index.0ac93ee878.js +33 -0
- package/dist/client/static/js/index.0ac93ee878.js.LICENSE.txt +4 -0
- package/dist/client/static/js/{markdown-vendor.9da142c67b.js → markdown-vendor.71e43278b3.js} +1 -1
- package/dist/client/static/js/uy.5f791144ce.js +139 -0
- package/package.json +2 -2
- package/src/cli/lib/args.js +1 -0
- package/src/cli/lib/commands/serve.js +7 -0
- package/src/client/App.tsx +22 -5
- package/src/client/components/common/MarkdownRenderer.tsx +36 -0
- package/src/client/components/layout/desktop-layout/index.tsx +1 -1
- package/src/client/components/layout/session-sidebar/Modals.tsx +1 -1
- package/src/client/components/mobile/LayoutWrapper.tsx +1 -1
- package/src/client/components/settings/LazyModal.tsx +46 -0
- package/src/client/components/settings/Modal.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/EmptyWorkspacePrompt.tsx +43 -29
- package/src/client/components/workspace/chat-timeline/MessageItem.tsx +15 -69
- package/src/client/components/workspace/chat-timeline/MessageList.tsx +47 -66
- package/src/client/components/workspace/chat-timeline/RunFooter.tsx +60 -0
- package/src/client/components/workspace/chat-timeline/SubagentView.tsx +37 -21
- package/src/client/components/workspace/chat-timeline/ToolCallCard.tsx +22 -4
- package/src/client/components/workspace/chat-timeline/index.tsx +3 -6
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Edit.tsx +15 -19
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/EnvelopeHeader.tsx +46 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/FallbackOutput.tsx +18 -68
- package/src/client/components/workspace/file-explorer/TreeItem.tsx +16 -4
- package/src/client/components/workspace/file-explorer/index.tsx +6 -0
- package/src/client/data/models/catalog.ts +8 -0
- package/src/client/data/samples/dialogue-session.ts +1 -1
- package/src/client/data/samples/sample-tools/other.ts +1 -1
- package/src/client/hooks/chat/omp/index.ts +9 -10
- package/src/client/hooks/chat/omp/revalidation-throttle.ts +6 -5
- package/src/client/hooks/chat/timeline/actions.ts +1 -2
- package/src/client/hooks/chat/timeline/index.ts +5 -0
- package/src/client/hooks/chat/timeline/send.ts +2 -3
- package/src/client/hooks/chat/timeline/session-load.ts +3 -4
- package/src/client/hooks/ui/syntax-ready.ts +16 -3
- package/src/client/main.tsx +2 -5
- package/src/client/stubs/elkjs.ts +37 -0
- package/src/client/tailwind.css +10 -0
- package/src/server/index.ts +53 -0
- package/src/server/lib/fs/git-ignore.ts +49 -0
- package/src/server/lib/models/provider-registry.server.ts +44 -20
- package/src/server/lib/omp/core/cli.ts +3 -2
- package/src/server/lib/omp/core/startup.ts +64 -0
- package/src/server/lib/omp/rpc/constants.ts +10 -0
- package/src/server/lib/omp/rpc/lifecycle.test.ts +138 -0
- package/src/server/lib/omp/rpc/manager.ts +32 -4
- package/src/server/lib/omp/rpc/process.ts +1 -1
- package/src/server/lib/omp/rpc/session-commands.ts +32 -9
- package/src/server/lib/omp/rpc/session-registry.ts +3 -2
- package/src/server/lib/omp/rpc/subagent-liveness.test.ts +62 -0
- package/src/server/lib/omp/rpc/subagent-liveness.ts +100 -0
- package/src/server/lib/omp/session/messages.test.ts +112 -0
- package/src/server/lib/omp/session/messages.ts +6 -5
- package/src/server/mock.server.ts +6 -12
- package/src/server/routes/agent/command.ts +34 -16
- package/src/server/routes/chat/stream.ts +13 -30
- package/src/server/routes/fs/read.ts +15 -7
- package/src/server/routes/models/root.ts +5 -1
- package/src/shared/lib/chat/notice-row.test.ts +89 -0
- package/src/shared/lib/chat/notice-row.ts +78 -0
- package/src/shared/lib/chat/omp/abort.ts +41 -0
- package/src/shared/lib/chat/stream-service.ts +0 -76
- package/src/shared/lib/chat/timeline/omp-callbacks.test.ts +154 -0
- package/src/shared/lib/chat/timeline/omp-callbacks.ts +36 -7
- package/src/shared/lib/chat/timeline/run-footer.test.ts +84 -0
- package/src/shared/lib/chat/timeline/run-footer.ts +96 -0
- package/src/shared/lib/chat/tool-output.test.ts +91 -0
- package/src/shared/lib/chat/tool-output.ts +54 -0
- package/src/shared/lib/chat/xml-envelope.ts +158 -0
- package/src/shared/lib/code/highlighter-lazy.ts +106 -0
- package/src/shared/lib/code/highlighter.ts +31 -52
- package/src/shared/lib/code/syntax-highlight.test.ts +36 -1
- package/src/shared/lib/code/syntax-highlight.ts +17 -3
- package/src/shared/lib/format/time.ts +19 -0
- package/src/shared/lib/fs/paths.ts +19 -0
- package/src/shared/lib/markdown/fira-code-fonts.css +51 -0
- package/src/shared/lib/markdown/katex-fonts.css +20 -0
- package/src/shared/lib/markdown/katex.ts +101 -0
- package/src/shared/lib/markdown/marked.ts +23 -14
- package/src/shared/lib/markdown/math.test.ts +109 -0
- package/src/shared/lib/markdown/mermaid.ts +6 -0
- package/src/shared/lib/markdown/sanitize.ts +48 -2
- package/src/shared/lib/omp/session/mapper.ts +11 -3
- package/src/shared/lib/omp/session/messages-map.ts +12 -12
- package/src/shared/types/chat.ts +3 -1
- package/src/shared/types/fs.ts +3 -0
- package/dist/client/static/css/g.f36aa429fa.css +0 -1
- package/dist/client/static/css/index.a0f07455bd.css +0 -2
- package/dist/client/static/css/katex-vendor.ca3a0600e8.css +0 -1
- package/dist/client/static/font/KaTeX_AMS-Regular.1608a09b4a.woff +0 -0
- package/dist/client/static/font/KaTeX_AMS-Regular.4aafdb685c.ttf +0 -0
- package/dist/client/static/font/KaTeX_Caligraphic-Bold.b67709187b.woff +0 -0
- package/dist/client/static/font/KaTeX_Caligraphic-Bold.cce5b8ecea.ttf +0 -0
- package/dist/client/static/font/KaTeX_Caligraphic-Regular.07ef19e7b0.ttf +0 -0
- package/dist/client/static/font/KaTeX_Caligraphic-Regular.dad44a7fc6.woff +0 -0
- package/dist/client/static/font/KaTeX_Fraktur-Bold.9f256b8593.woff +0 -0
- package/dist/client/static/font/KaTeX_Fraktur-Bold.b18f59e1d1.ttf +0 -0
- package/dist/client/static/font/KaTeX_Fraktur-Regular.7c1871215e.woff +0 -0
- package/dist/client/static/font/KaTeX_Fraktur-Regular.ed38e79f57.ttf +0 -0
- package/dist/client/static/font/KaTeX_Main-Bold.b74a1a8b2c.ttf +0 -0
- package/dist/client/static/font/KaTeX_Main-Bold.d181c4650d.woff +0 -0
- package/dist/client/static/font/KaTeX_Main-BoldItalic.70d8b0a530.ttf +0 -0
- package/dist/client/static/font/KaTeX_Main-BoldItalic.e3f82f9d27.woff +0 -0
- package/dist/client/static/font/KaTeX_Main-Italic.47373d1e51.ttf +0 -0
- package/dist/client/static/font/KaTeX_Main-Italic.9024d815ba.woff +0 -0
- package/dist/client/static/font/KaTeX_Main-Regular.7f51fe0340.woff +0 -0
- package/dist/client/static/font/KaTeX_Main-Regular.b7f8fe9b5f.ttf +0 -0
- package/dist/client/static/font/KaTeX_Math-BoldItalic.a879cf8383.ttf +0 -0
- package/dist/client/static/font/KaTeX_Math-BoldItalic.f1035d8d5d.woff +0 -0
- package/dist/client/static/font/KaTeX_Math-Italic.5295ba483a.woff +0 -0
- package/dist/client/static/font/KaTeX_Math-Italic.939bc64440.ttf +0 -0
- package/dist/client/static/font/KaTeX_SansSerif-Bold.94e1e8dc5f.ttf +0 -0
- package/dist/client/static/font/KaTeX_SansSerif-Bold.bf59d231c3.woff +0 -0
- package/dist/client/static/font/KaTeX_SansSerif-Italic.7c9bc82b17.woff +0 -0
- package/dist/client/static/font/KaTeX_SansSerif-Italic.b4c20c84d8.ttf +0 -0
- package/dist/client/static/font/KaTeX_SansSerif-Regular.740484788f.woff +0 -0
- package/dist/client/static/font/KaTeX_SansSerif-Regular.d4d7ba4804.ttf +0 -0
- package/dist/client/static/font/KaTeX_Script-Regular.0750571032.woff +0 -0
- package/dist/client/static/font/KaTeX_Script-Regular.fe9cbbe1a0.ttf +0 -0
- package/dist/client/static/font/KaTeX_Size1-Regular.e1e279cbdd.woff +0 -0
- package/dist/client/static/font/KaTeX_Size1-Regular.fabc004aab.ttf +0 -0
- package/dist/client/static/font/KaTeX_Size2-Regular.577270225e.woff +0 -0
- package/dist/client/static/font/KaTeX_Size2-Regular.d6b476ecd3.ttf +0 -0
- package/dist/client/static/font/KaTeX_Size3-Regular.9acaf01c64.woff +0 -0
- package/dist/client/static/font/KaTeX_Size3-Regular.a144ef5840.ttf +0 -0
- package/dist/client/static/font/KaTeX_Size4-Regular.7a996c9da2.woff +0 -0
- package/dist/client/static/font/KaTeX_Size4-Regular.fbccdabe0a.ttf +0 -0
- package/dist/client/static/font/KaTeX_Typewriter-Regular.6258592bdc.woff +0 -0
- package/dist/client/static/font/KaTeX_Typewriter-Regular.d97aaf4a1e.ttf +0 -0
- package/dist/client/static/font/fira-code-cyrillic-400-normal.5971438a4a.woff2 +0 -0
- package/dist/client/static/font/fira-code-cyrillic-400-normal.9bb7bfea9c.woff +0 -0
- package/dist/client/static/font/fira-code-cyrillic-500-normal.5486265b18.woff2 +0 -0
- package/dist/client/static/font/fira-code-cyrillic-500-normal.89f92bfb31.woff +0 -0
- package/dist/client/static/font/fira-code-cyrillic-600-normal.2805b497e5.woff +0 -0
- package/dist/client/static/font/fira-code-cyrillic-600-normal.86e0df22a3.woff2 +0 -0
- package/dist/client/static/font/fira-code-cyrillic-700-normal.505a88f22a.woff +0 -0
- package/dist/client/static/font/fira-code-cyrillic-700-normal.76f5e8d2e2.woff2 +0 -0
- package/dist/client/static/font/fira-code-cyrillic-ext-400-normal.3c4b15e57d.woff2 +0 -0
- package/dist/client/static/font/fira-code-cyrillic-ext-400-normal.61323debaa.woff +0 -0
- package/dist/client/static/font/fira-code-cyrillic-ext-500-normal.0f34210f2a.woff2 +0 -0
- package/dist/client/static/font/fira-code-cyrillic-ext-500-normal.2497cfa1aa.woff +0 -0
- package/dist/client/static/font/fira-code-cyrillic-ext-600-normal.40fce94af9.woff2 +0 -0
- package/dist/client/static/font/fira-code-cyrillic-ext-600-normal.6c8774b829.woff +0 -0
- package/dist/client/static/font/fira-code-cyrillic-ext-700-normal.4b742eb865.woff +0 -0
- package/dist/client/static/font/fira-code-cyrillic-ext-700-normal.e75eb4fccc.woff2 +0 -0
- package/dist/client/static/font/fira-code-greek-400-normal.bb900468b6.woff2 +0 -0
- package/dist/client/static/font/fira-code-greek-400-normal.be76e699ba.woff +0 -0
- package/dist/client/static/font/fira-code-greek-500-normal.176c9fb001.woff2 +0 -0
- package/dist/client/static/font/fira-code-greek-500-normal.d2c596136b.woff +0 -0
- package/dist/client/static/font/fira-code-greek-600-normal.490c3deed7.woff +0 -0
- package/dist/client/static/font/fira-code-greek-600-normal.7df14376d9.woff2 +0 -0
- package/dist/client/static/font/fira-code-greek-700-normal.c82b6072fc.woff2 +0 -0
- package/dist/client/static/font/fira-code-greek-700-normal.d5f2b2917b.woff +0 -0
- package/dist/client/static/font/fira-code-greek-ext-400-normal.4849a79781.woff +0 -0
- package/dist/client/static/font/fira-code-greek-ext-400-normal.7f5bfc4538.woff2 +0 -0
- package/dist/client/static/font/fira-code-greek-ext-500-normal.aaccca4075.woff2 +0 -0
- package/dist/client/static/font/fira-code-greek-ext-500-normal.e383181256.woff +0 -0
- package/dist/client/static/font/fira-code-greek-ext-600-normal.78cb4bff8e.woff +0 -0
- package/dist/client/static/font/fira-code-greek-ext-600-normal.d6c93d54f9.woff2 +0 -0
- package/dist/client/static/font/fira-code-greek-ext-700-normal.57ec7c92d9.woff +0 -0
- package/dist/client/static/font/fira-code-greek-ext-700-normal.8fafdae5e8.woff2 +0 -0
- package/dist/client/static/font/fira-code-latin-400-normal.973295532b.woff +0 -0
- package/dist/client/static/font/fira-code-latin-500-normal.7ae2be8fb8.woff +0 -0
- package/dist/client/static/font/fira-code-latin-600-normal.1dbbe5bc27.woff +0 -0
- package/dist/client/static/font/fira-code-latin-700-normal.497a70148b.woff +0 -0
- package/dist/client/static/font/fira-code-latin-ext-400-normal.9dfae29aaf.woff +0 -0
- package/dist/client/static/font/fira-code-latin-ext-400-normal.e534ae46e2.woff2 +0 -0
- package/dist/client/static/font/fira-code-latin-ext-500-normal.24c7b781b0.woff +0 -0
- package/dist/client/static/font/fira-code-latin-ext-500-normal.aad44ab072.woff2 +0 -0
- package/dist/client/static/font/fira-code-latin-ext-600-normal.7bed0f2f7e.woff +0 -0
- package/dist/client/static/font/fira-code-latin-ext-600-normal.c509a7c9f1.woff2 +0 -0
- package/dist/client/static/font/fira-code-latin-ext-700-normal.6c66c8b0a9.woff2 +0 -0
- package/dist/client/static/font/fira-code-latin-ext-700-normal.88f64e2822.woff +0 -0
- package/dist/client/static/font/fira-code-symbols2-400-normal.97d3f4b17c.woff +0 -0
- package/dist/client/static/font/fira-code-symbols2-500-normal.b06f1a06e4.woff +0 -0
- package/dist/client/static/font/fira-code-symbols2-600-normal.304b653b93.woff +0 -0
- package/dist/client/static/font/fira-code-symbols2-700-normal.d8ce0ad586.woff +0 -0
- package/dist/client/static/js/async/3j.a2fcea99be.js +0 -2
- package/dist/client/static/js/async/51.1938cec320.js +0 -2
- package/dist/client/static/js/async/6.7929428505.js +0 -1
- package/dist/client/static/js/async/69.a18a10882f.js +0 -1
- package/dist/client/static/js/async/a.bce4542392.js +0 -1
- package/dist/client/static/js/async/ar.9dc8b1992a.js +0 -2
- package/dist/client/static/js/async/bi.cbfe8eaa8e.js +0 -1
- package/dist/client/static/js/async/ct.38d9da8a5a.js +0 -1
- package/dist/client/static/js/async/fw.fb1a08b92d.js +0 -6
- package/dist/client/static/js/async/l6.45f3b62e15.js +0 -1
- package/dist/client/static/js/async/q.0b6fb9bf8d.js +0 -21
- package/dist/client/static/js/async/rd.b77011ab7f.js +0 -2
- package/dist/client/static/js/async/rf.cfbde7f744.js +0 -2
- package/dist/client/static/js/async/s.c7d521a8ae.js +0 -2
- package/dist/client/static/js/async/sy.7345abcd67.js +0 -94
- package/dist/client/static/js/async/t.0dcb01dfde.js +0 -1
- package/dist/client/static/js/async/v.5c7a4b087b.js +0 -1
- package/dist/client/static/js/async/vu.311f1d202c.js +0 -34
- package/dist/client/static/js/async/yg.9bd4e09ecb.js +0 -149
- package/dist/client/static/js/async/yv.593a3f7d54.js +0 -1
- package/dist/client/static/js/g.124fba0826.js +0 -139
- package/dist/client/static/js/index.907fd4670e.js +0 -68
- package/dist/client/static/js/katex-vendor.95e48cf65a.js +0 -1
- package/src/shared/lib/chat/order.ts +0 -40
- /package/dist/client/static/js/async/{1k.544adbf77d.js.LICENSE.txt → 1k.5974df3b87.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{3j.a2fcea99be.js.LICENSE.txt → 3j.357c80ff38.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{3y.22075aa079.js.LICENSE.txt → 3y.ededeebde8.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{51.1938cec320.js.LICENSE.txt → 51.95bcae98af.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{ar.9dc8b1992a.js.LICENSE.txt → a.e05da304c8.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{fw.fb1a08b92d.js.LICENSE.txt → dc.6dc4b0a04b.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{m.3fc017a055.js.LICENSE.txt → fw.6a51998a8e.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{q.0b6fb9bf8d.js.LICENSE.txt → m.4b29d34f93.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{rf.cfbde7f744.js.LICENSE.txt → q.7fb4d2f374.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{rd.b77011ab7f.js.LICENSE.txt → rd.cb6bf495bb.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{s.c7d521a8ae.js.LICENSE.txt → rf.d626afc367.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/{index.907fd4670e.js.LICENSE.txt → async/ud.3065bfee31.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/{g.124fba0826.js.LICENSE.txt → uy.5f791144ce.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.rspackChunkompchamber=self.rspackChunkompchamber||[]).push([["kc"],{nj(e,t,n){var a=n("j");function r(e){let{value:t,label:n,hint:r,tone:i="default",variant:l="metric",className:s=""}=e;return"compact"===l?(0,a.FD)("div",{className:"bg-canvas border border-ink/10 rounded-lg px-2.5 py-1.5 flex flex-col gap-0.5 flex-1 min-w-0",children:[(0,a.Y)("span",{className:"text-[10px] font-medium text-ink/50",children:n}),(0,a.Y)("span",{className:"text-xs font-semibold font-mono text-ink truncate",children:t})]}):(0,a.FD)("div",{className:`${"muted"===i?"bg-ink/5 border-ink/10":"bg-paper border-ink/15"} border rounded-lg p-3 shadow-xs flex flex-col justify-between h-full min-w-0 ${s}`,children:[(0,a.FD)("div",{className:"min-w-0",children:[(0,a.Y)("div",{className:"text-base font-bold tracking-tight text-ink leading-tight tabular-nums break-normal",children:t}),(0,a.Y)("div",{className:"text-[11px] font-semibold text-ink/75 mt-1.5 leading-snug min-h-[30px] flex items-start",children:(0,a.Y)("span",{className:"min-w-0 break-normal",children:n})})]}),r&&(0,a.Y)("div",{className:"text-[10px] text-ink/50 mt-1.5 leading-tight break-words",children:r})]})}n.d(t,{h:()=>r})},Mg(e,t,n){n.d(t,{H:()=>b});var a=n("j"),r=n("SU"),i=n("p");function l(e){let{providerName:t,configured:n,error:l,note:s,children:d}=e;return(0,a.FD)("section",{className:"bg-paper border border-ink/15 rounded-lg shadow-xs",children:[(0,a.FD)("header",{className:"flex items-center justify-between gap-2 px-3.5 py-2.5 border-b border-ink/10",children:[(0,a.Y)("span",{className:"text-xs font-semibold text-ink",children:t}),(0,a.Y)("span",{className:"text-[10px] font-mono uppercase tracking-wider text-ink/50",children:n?"Connected":"Not configured"})]}),(0,a.FD)("div",{className:"p-3.5 space-y-4",children:[n?(0,a.FD)(a.FK,{children:[l&&(0,a.FD)("p",{className:"flex items-start gap-2 text-error text-xs leading-relaxed",children:[(0,a.Y)(i.A,{size:14,className:"shrink-0 mt-0.5"}),(0,a.Y)("span",{className:"break-words",children:l})]}),d]}):(0,a.FD)("div",{className:"flex items-start gap-2 text-ink/60 text-xs leading-relaxed",children:[(0,a.Y)(r.A,{size:14,className:"shrink-0 mt-0.5 text-ink/40"}),(0,a.FD)("p",{children:["Add the ",(0,a.Y)("span",{className:"font-semibold text-ink",children:t})," API key in Settings → Providers to see its balance, quota, and usage here."]})]}),s&&(0,a.Y)("p",{className:"text-[10px] text-ink/50 leading-relaxed border-t border-ink/10 pt-2.5",children:s})]})]})}var s=n("nj"),d=n("Rm"),c=n("TW");function o(e){let{window:t}=e,n=t.usedRp+t.remainingRp,r=(0,c.Nk)(t.usedRp,n);return(0,a.FD)("div",{className:"bg-paper border border-ink/15 rounded-lg p-3 shadow-xs space-y-2",children:[(0,a.FD)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.Y)("span",{className:"text-[11px] font-semibold text-ink",children:t.label}),(0,a.FD)("span",{className:"text-[10px] text-ink/50",children:["Resets ",(0,c.r6)(t.resetsAt)]})]}),(0,a.Y)("div",{className:"h-1.5 w-full bg-ink/10 rounded-full overflow-hidden",children:(0,a.Y)("div",{className:"h-full bg-ink/80 rounded-full",style:{width:`${r}%`}})}),(0,a.FD)("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-0.5 text-[10px] text-ink/60",children:[(0,a.FD)("span",{children:["Used ",(0,a.Y)("span",{className:"font-semibold text-ink",children:(0,c.QH)(t.usedRp)})," ·"," ",(0,c.l9)(t.usedRp,n)]}),(0,a.FD)("span",{children:["Remaining ",(0,a.Y)("span",{className:"font-semibold text-ink",children:(0,c.QH)(t.remainingRp)})]})]})]})}function p(e){let{coupon:t}=e;return(0,a.FD)("div",{className:"bg-ink/5 border border-ink/10 rounded-lg p-3 shadow-xs",children:[(0,a.FD)("div",{className:"flex items-center gap-1.5 mb-1.5",children:[(0,a.Y)(d.A,{size:12,className:"text-ink/60"}),(0,a.FD)("span",{className:"text-[11px] font-semibold text-ink",children:["Active coupon · ",t.name]})]}),(0,a.FD)("div",{className:"text-[10px] text-ink/60 space-y-0.5",children:[(0,a.FD)("div",{children:["Remaining"," ",(0,a.Y)("span",{className:"font-semibold text-ink",children:null===t.remainingRp?"Unlimited":(0,c.QH)(t.remainingRp)})," ","· Used ",(0,a.Y)("span",{className:"font-semibold text-ink",children:(0,c.QH)(t.usedRp)})]}),(0,a.FD)("div",{children:["Expires ",(0,c.r6)(t.expiresAt)]}),t.scopeModels.length>0&&(0,a.FD)("div",{children:["Models: ",t.scopeModels.join(", ")]})]})]})}function m(e){let{quota:t}=e;return t?(0,a.FD)("div",{className:"space-y-2",children:[(0,a.FD)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.Y)("h4",{className:"text-[10px] font-mono font-semibold uppercase tracking-wider text-ink/40",children:"Quota windows"}),t.planName&&(0,a.FD)("span",{className:"text-[10px] text-ink/60",children:["Plan ",(0,a.Y)("span",{className:"font-semibold text-ink",children:t.planName})]})]}),0===t.windows.length?(0,a.Y)("p",{className:"text-[11px] text-ink/50",children:"No quota windows reported."}):(0,a.Y)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2.5",children:t.windows.map(e=>(0,a.Y)(o,{window:e},e.key))}),t.coupon&&(0,a.Y)(p,{coupon:t.coupon})]}):(0,a.Y)("p",{className:"text-[11px] text-ink/50",children:"Quota data is not available for this account."})}function u(e){let{usage:t}=e;if(!t)return(0,a.Y)("p",{className:"text-[11px] text-ink/50",children:"The 30-day usage report is not available."});let n=t.rows.reduce((e,t)=>e+t.inputTokens,0),r=t.rows.reduce((e,t)=>e+t.outputTokens,0);return(0,a.FD)("div",{className:"space-y-2",children:[(0,a.Y)("h4",{className:"text-[10px] font-mono font-semibold uppercase tracking-wider text-ink/40",children:"30-day usage by model"}),(0,a.Y)("div",{className:"overflow-x-auto border border-ink/15 rounded-lg shadow-xs",children:(0,a.FD)("table",{className:"w-full text-[11px]",children:[(0,a.Y)("thead",{className:"bg-ink/5 text-ink/60",children:(0,a.FD)("tr",{children:[(0,a.Y)("th",{className:"text-left font-semibold px-3 py-2 whitespace-nowrap",children:"Model"}),(0,a.Y)("th",{className:"text-right font-semibold px-3 py-2 whitespace-nowrap",children:"Requests"}),(0,a.Y)("th",{className:"text-right font-semibold px-3 py-2 whitespace-nowrap",children:"Input tokens"}),(0,a.Y)("th",{className:"text-right font-semibold px-3 py-2 whitespace-nowrap",children:"Output tokens"}),(0,a.Y)("th",{className:"text-right font-semibold px-3 py-2 whitespace-nowrap",children:"Cost"})]})}),(0,a.Y)("tbody",{className:"divide-y divide-ink/10",children:0===t.rows.length?(0,a.Y)("tr",{children:(0,a.Y)("td",{colSpan:5,className:"px-3 py-3 text-center text-ink/50",children:"No usage recorded in the last 30 days."})}):t.rows.map(e=>(0,a.FD)("tr",{children:[(0,a.Y)("td",{className:"px-3 py-1.5 font-mono text-ink whitespace-nowrap",children:e.model}),(0,a.Y)("td",{className:"px-3 py-1.5 text-right tabular-nums text-ink/80",children:(0,c.ZV)(e.requests)}),(0,a.Y)("td",{className:"px-3 py-1.5 text-right tabular-nums text-ink/80",children:(0,c.Rk)(e.inputTokens)}),(0,a.Y)("td",{className:"px-3 py-1.5 text-right tabular-nums text-ink/80",children:(0,c.Rk)(e.outputTokens)}),(0,a.Y)("td",{className:"px-3 py-1.5 text-right tabular-nums text-ink/80",children:(0,c.QH)(e.costRp)})]},e.model))}),(0,a.Y)("tfoot",{className:"bg-ink/5 border-t border-ink/15 font-semibold text-ink",children:(0,a.FD)("tr",{children:[(0,a.Y)("td",{className:"px-3 py-2",children:"Total"}),(0,a.Y)("td",{className:"px-3 py-2 text-right tabular-nums",children:(0,c.ZV)(t.totalRequests)}),(0,a.Y)("td",{className:"px-3 py-2 text-right tabular-nums",children:(0,c.Rk)(n)}),(0,a.Y)("td",{className:"px-3 py-2 text-right tabular-nums",children:(0,c.Rk)(r)}),(0,a.Y)("td",{className:"px-3 py-2 text-right tabular-nums",children:(0,c.QH)(t.totalCostRp)})]})})]})})]})}function h(e){let{report:t}=e,{balance:n,usage:r,quota:i}=t;if(!n&&!r&&!i)return(0,a.Y)("p",{className:"text-[11px] text-ink/50",children:"No kenari data was returned for this account."});let l=n?null!==n.amountRp?(0,c.QH)(n.amountRp):n.raw:"—",d=n?null!==n.amountRp?n.raw:"Amount could not be parsed":"Balance unavailable",o=r?r.rows.reduce((e,t)=>e+t.inputTokens+t.outputTokens,0):0;return(0,a.FD)(a.FK,{children:[(0,a.Y)("div",{className:"@container",children:(0,a.FD)("div",{className:"grid grid-cols-3 @[540px]:grid-cols-5 gap-2.5 items-stretch",children:[(0,a.Y)(s.h,{value:l,label:"Wallet balance",hint:d}),(0,a.Y)(s.h,{value:i?.planName??"—",label:"Active plan",hint:i?"kenari quota plan":"Quota unavailable"}),(0,a.Y)(s.h,{value:r?(0,c.ZV)(r.totalRequests):"—",label:"Requests (30 days)",hint:r?"Across all models":"Usage report unavailable"}),(0,a.Y)(s.h,{value:r?(0,c.QH)(r.totalCostRp):"—",label:"Cost (30 days)",hint:r?"Billed in Rupiah":"Usage report unavailable"}),(0,a.Y)(s.h,{value:r?(0,c.Rk)(o):"—",label:"Tokens processed (30 days)",hint:r?"Input + output":"Usage report unavailable",tone:"muted",className:"col-span-2 @[540px]:col-span-1"})]})}),(0,a.Y)(m,{quota:i}),(0,a.Y)(u,{usage:r})]})}function x(e){let{report:t}=e,n=t.balance;return n?(0,a.FD)(a.FK,{children:[(0,a.Y)("div",{className:"@container",children:(0,a.FD)("div",{className:"grid grid-cols-3 @[540px]:grid-cols-5 gap-2.5 items-stretch",children:[(0,a.Y)(s.h,{value:n.isAvailable?"Available":"Unavailable",label:"Prepaid balance",hint:n.isAvailable?"Account can spend":"Top up required",tone:n.isAvailable?"default":"muted"}),(0,a.Y)(s.h,{value:(0,c.ZV)(n.entries.length),label:"Currency buckets",hint:n.entries.length>0?"From the balance endpoint":"No entries returned",tone:"muted"})]})}),0===n.entries.length?(0,a.Y)("p",{className:"text-[11px] text-ink/50",children:"The balance endpoint returned no currency entries."}):(0,a.Y)("div",{className:"grid grid-cols-1 gap-2.5",children:n.entries.map(e=>(0,a.FD)("div",{className:"bg-paper border border-ink/15 rounded-lg p-3 shadow-xs",children:[(0,a.FD)("div",{className:"flex items-center justify-between gap-2 mb-2",children:[(0,a.Y)("span",{className:"text-[11px] font-semibold text-ink",children:e.currency}),(0,a.Y)("span",{className:"text-[10px] font-mono uppercase tracking-wider text-ink/40",children:"Balance"})]}),(0,a.FD)("dl",{className:"grid grid-cols-3 gap-2 text-[10px]",children:[(0,a.FD)("div",{children:[(0,a.Y)("dt",{className:"text-ink/50",children:"Total"}),(0,a.Y)("dd",{className:"font-semibold text-ink tabular-nums break-words",children:(0,c.ej)(e.totalBalance)})]}),(0,a.FD)("div",{children:[(0,a.Y)("dt",{className:"text-ink/50",children:"Granted"}),(0,a.Y)("dd",{className:"font-semibold text-ink tabular-nums break-words",children:(0,c.ej)(e.grantedBalance)})]}),(0,a.FD)("div",{children:[(0,a.Y)("dt",{className:"text-ink/50",children:"Topped up"}),(0,a.Y)("dd",{className:"font-semibold text-ink tabular-nums break-words",children:(0,c.ej)(e.toppedUpBalance)})]})]})]},e.currency))})]}):(0,a.Y)("p",{className:"text-[11px] text-ink/50",children:"DeepSeek balance data is not available."})}function b(e){let{providerId:t,report:n}=e;return"kenari"===t?(0,a.Y)(l,{providerName:"Kenari.id",configured:n.kenari.configured,error:n.kenari.error,children:(0,a.Y)(h,{report:n.kenari})}):(0,a.Y)(l,{providerName:"DeepSeek",configured:n.deepseek.configured,error:n.deepseek.error,note:"DeepSeek exposes no usage or quota API — only the prepaid balance (and the web console at platform.deepseek.com) is available.",children:(0,a.Y)(x,{report:n.deepseek})})}},TW(e,t,n){let a=new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR",maximumFractionDigits:0}),r=new Intl.NumberFormat("id-ID"),i=new Intl.NumberFormat("id-ID",{minimumFractionDigits:2,maximumFractionDigits:2,useGrouping:!1}),l=new Intl.DateTimeFormat("id-ID",{dateStyle:"medium",timeStyle:"short"});function s(e){return a.format(e)}function d(e){return r.format(e)}function c(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:l.format(t)}function o(e,t){return t<=0?0:Math.min(100,Math.max(0,e/t*100))}function p(e,t){return t<=0?"0%":`${new Intl.NumberFormat("id-ID",{maximumFractionDigits:1}).format(e/t*100)}%`}function m(e){if(!Number.isFinite(e))return"0";let t=Math.abs(e);return t>=1e9?`${i.format(e/1e9)}B`:t>=1e6?`${i.format(e/1e6)}M`:t>=1e3?`${i.format(e/1e3)}K`:d(e)}function u(e){let t=Number(e);return""!==e.trim()&&Number.isFinite(t)?d(t):e}n.d(t,{Nk:()=>o,QH:()=>s,Rk:()=>m,ZV:()=>d,ej:()=>u,l9:()=>p,r6:()=>c})},hm(e,t,n){var a=n("TW");function r(e){let t=e.kenari.quota?.planName,n=e.deepseek.balance?.entries[0];return[{id:"kenari",name:"Kenari.id",configured:e.kenari.configured,error:e.kenari.error,hint:t??"Wallet & quota"},{id:"deepseek",name:"DeepSeek",configured:e.deepseek.configured,error:e.deepseek.error,hint:n?`${n.currency} ${(0,a.ej)(n.totalBalance)}`:"Prepaid balance"}]}function i(e){return e.configured?e.error?"Error":"Connected":"Not configured"}n.d(t,{R:()=>i,T:()=>r})},uY(e,t,n){var a=n("H");function r(){let[e,t]=(0,a.J0)(null),[n,r]=(0,a.J0)(!0),[i,l]=(0,a.J0)(null),s=(0,a.hb)(async e=>{e?.silent||r(!0),l(null);try{let e=await fetch("/api/settings/usage");if(!e.ok)throw Error(`Usage request failed (${e.status})`);let n=await e.json();t(n)}catch(e){l(e instanceof Error?e.message:"Failed to load provider usage")}finally{e?.silent||r(!1)}},[]);return(0,a.vJ)(()=>{s()},[s]),{report:e,isLoading:n,error:i,reload:s}}n.d(t,{N:()=>r})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.rspackChunkompchamber=self.rspackChunkompchamber||[]).push([["l6"],{l5(t,e,r){r.d(e,{A:()=>s});var n=r("TK"),o=function(t,e){for(var r=t.length;r--;)if((0,n.A)(t[r][0],e))return r;return -1},i=Array.prototype.splice;function u(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}u.prototype.clear=function(){this.__data__=[],this.size=0},u.prototype.delete=function(t){var e=this.__data__,r=o(e,t);return!(r<0)&&(r==e.length-1?e.pop():i.call(e,r,1),--this.size,!0)},u.prototype.get=function(t){var e=this.__data__,r=o(e,t);return r<0?void 0:e[r][1]},u.prototype.has=function(t){return o(this.__data__,t)>-1},u.prototype.set=function(t,e){var r=this.__data__,n=o(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};var s=u},Cz(t,e,r){var n=r("uf"),o=r("CvH");e.A=(0,n.A)(o.A,"Map")},mb(t,e,r){r.d(e,{A:()=>l});var n=(0,r("uf").A)(Object,"create"),o=Object.prototype.hasOwnProperty,i=Object.prototype.hasOwnProperty;function u(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}u.prototype.clear=function(){this.__data__=n?n(null):{},this.size=0},u.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=!!e,e},u.prototype.get=function(t){var e=this.__data__;if(n){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return o.call(e,t)?e[t]:void 0},u.prototype.has=function(t){var e=this.__data__;return n?void 0!==e[t]:i.call(e,t)},u.prototype.set=function(t,e){var r=this.__data__;return this.size+=+!this.has(t),r[t]=n&&void 0===e?"__lodash_hash_undefined__":e,this};var s=r("l5"),a=r("Cz"),c=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t},f=function(t,e){var r=t.__data__;return c(e)?r["string"==typeof e?"string":"hash"]:r.map};function h(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}h.prototype.clear=function(){this.size=0,this.__data__={hash:new u,map:new(a.A||s.A),string:new u}},h.prototype.delete=function(t){var e=f(this,t).delete(t);return this.size-=!!e,e},h.prototype.get=function(t){return f(this,t).get(t)},h.prototype.has=function(t){return f(this,t).has(t)},h.prototype.set=function(t,e){var r=f(this,t),n=r.size;return r.set(t,e),this.size+=+(r.size!=n),this};var l=h},ka5(t,e,r){var n=r("uf"),o=r("CvH");e.A=(0,n.A)(o.A,"Set")},a4(t,e,r){r.d(e,{A:()=>i});var n=r("mb");function o(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new n.A;++e<r;)this.add(t[e])}o.prototype.add=o.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},o.prototype.has=function(t){return this.__data__.has(t)};var i=o},Zw(t,e,r){r.d(e,{A:()=>s});var n=r("l5"),o=r("Cz"),i=r("mb");function u(t){var e=this.__data__=new n.A(t);this.size=e.size}u.prototype.clear=function(){this.__data__=new n.A,this.size=0},u.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},u.prototype.get=function(t){return this.__data__.get(t)},u.prototype.has=function(t){return this.__data__.has(t)},u.prototype.set=function(t,e){var r=this.__data__;if(r instanceof n.A){var u=r.__data__;if(!o.A||u.length<199)return u.push([t,e]),this.size=++r.size,this;r=this.__data__=new i.A(u)}return r.set(t,e),this.size=r.size,this};var s=u},Iu(t,e,r){e.A=r("CvH").A.Symbol},XI(t,e,r){e.A=r("CvH").A.Uint8Array},C0(t,e){e.A=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););return t}},Iy(t,e){e.A=function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var u=t[r];e(u,r,t)&&(i[o++]=u)}return i}},cu(t,e,r){r.d(e,{A:()=>f});var n=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n},o=r("rFc"),i=r("D2"),u=r("Fr"),s=r("s6"),a=r("Hm"),c=Object.prototype.hasOwnProperty,f=function(t,e){var r=(0,i.A)(t),f=!r&&(0,o.A)(t),h=!r&&!f&&(0,u.A)(t),l=!r&&!f&&!h&&(0,a.A)(t),A=r||f||h||l,d=A?n(t.length,String):[],p=d.length;for(var v in t)(e||c.call(t,v))&&!(A&&("length"==v||h&&("offset"==v||"parent"==v)||l&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||(0,s.A)(v,p)))&&d.push(v);return d}},Yk(t,e){e.A=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}},sA(t,e){e.A=function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}},hp(t,e,r){r.d(e,{A:()=>u});var n,o=r("c4"),i=r("xnM"),u=(n=o.A,function(t,e){if(null==t)return t;if(!(0,i.A)(t))return n(t,e);for(var r=t.length,o=-1,u=Object(t);++o<r&&!1!==e(u[o],o,u););return t})},YT(t,e){e.A=function(t,e,r,n){for(var o=t.length,i=r+(n?1:-1);n?i--:++i<o;)if(e(t[i],i,t))return i;return -1}},Ll(t,e,r){r.d(e,{A:()=>c});var n=r("sA"),o=r("Iu"),i=r("rFc"),u=r("D2"),s=o.A?o.A.isConcatSpreadable:void 0,a=function(t){return(0,u.A)(t)||(0,i.A)(t)||!!(s&&t&&t[s])},c=function t(e,r,o,i,u){var s=-1,c=e.length;for(o||(o=a),u||(u=[]);++s<c;){var f=e[s];r>0&&o(f)?r>1?t(f,r-1,o,i,u):(0,n.A)(u,f):i||(u[u.length]=f)}return u}},mm(t,e,r){r.d(e,{A:()=>n});var n=function(t,e,r){for(var n=-1,o=Object(t),i=r(t),u=i.length;u--;){var s=i[++n];if(!1===e(o[s],s,o))break}return t}},c4(t,e,r){var n=r("mm"),o=r("Fv");e.A=function(t,e){return t&&(0,n.A)(t,e,o.A)}},sE(t,e,r){var n=r("JA"),o=r("tU");e.A=function(t,e){e=(0,n.A)(e,t);for(var r=0,i=e.length;null!=t&&r<i;)t=t[(0,o.A)(e[r++])];return r&&r==i?t:void 0}},Qz(t,e,r){var n=r("sA"),o=r("D2");e.A=function(t,e,r){var i=e(t);return(0,o.A)(t)?i:(0,n.A)(i,r(t))}},qdn(t,e,r){r.d(e,{A:()=>h});var n=r("Iu"),o=Object.prototype,i=o.hasOwnProperty,u=o.toString,s=n.A?n.A.toStringTag:void 0,a=function(t){var e=i.call(t,s),r=t[s];try{t[s]=void 0;var n=!0}catch(t){}var o=u.call(t);return n&&(e?t[s]=r:delete t[s]),o},c=Object.prototype.toString,f=n.A?n.A.toStringTag:void 0,h=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":f&&f in Object(t)?a(t):c.call(t)}},bQs(t,e,r){r.d(e,{A:()=>q});var n=r("Zw"),o=r("a4"),i=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1},u=r("f3"),s=function(t,e,r,n,s,a){var c=1&r,f=t.length,h=e.length;if(f!=h&&!(c&&h>f))return!1;var l=a.get(t),A=a.get(e);if(l&&A)return l==e&&A==t;var d=-1,p=!0,v=2&r?new o.A:void 0;for(a.set(t,e),a.set(e,t);++d<f;){var _=t[d],b=e[d];if(n)var y=c?n(b,_,d,e,t,a):n(_,b,d,t,e,a);if(void 0!==y){if(y)continue;p=!1;break}if(v){if(!i(e,function(t,e){if(!(0,u.A)(v,e)&&(_===t||s(_,t,r,n,a)))return v.push(e)})){p=!1;break}}else if(!(_===b||s(_,b,r,n,a))){p=!1;break}}return a.delete(t),a.delete(e),p},a=r("Iu"),c=r("XI"),f=r("TK"),h=function(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t]}),r},l=r("Ft"),A=a.A?a.A.prototype:void 0,d=A?A.valueOf:void 0,p=function(t,e,r,n,o,i,u){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)break;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":if(t.byteLength!=e.byteLength||!i(new c.A(t),new c.A(e)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return(0,f.A)(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=h;case"[object Set]":var A=1&n;if(a||(a=l.A),t.size!=e.size&&!A)break;var p=u.get(t);if(p)return p==e;n|=2,u.set(t,e);var v=s(a(t),a(e),n,o,i,u);return u.delete(t),v;case"[object Symbol]":if(d)return d.call(t)==d.call(e)}return!1},v=r("uN"),_=Object.prototype.hasOwnProperty,b=function(t,e,r,n,o,i){var u=1&r,s=(0,v.A)(t),a=s.length;if(a!=(0,v.A)(e).length&&!u)return!1;for(var c=a;c--;){var f=s[c];if(!(u?f in e:_.call(e,f)))return!1}var h=i.get(t),l=i.get(e);if(h&&l)return h==e&&l==t;var A=!0;i.set(t,e),i.set(e,t);for(var d=u;++c<a;){var p=t[f=s[c]],b=e[f];if(n)var y=u?n(b,p,f,e,t,i):n(p,b,f,t,e,i);if(!(void 0===y?p===b||o(p,b,r,n,i):y)){A=!1;break}d||(d="constructor"==f)}if(A&&!d){var g=t.constructor,j=e.constructor;g!=j&&"constructor"in t&&"constructor"in e&&!("function"==typeof g&&g instanceof g&&"function"==typeof j&&j instanceof j)&&(A=!1)}return i.delete(t),i.delete(e),A},y=r("VB"),g=r("D2"),j=r("Fr"),m=r("Hm"),O="[object Arguments]",w="[object Array]",C="[object Object]",F=Object.prototype.hasOwnProperty,E=function(t,e,r,o,i,u){var a=(0,g.A)(t),c=(0,g.A)(e),f=a?w:(0,y.A)(t),h=c?w:(0,y.A)(e);f=f==O?C:f,h=h==O?C:h;var l=f==C,A=h==C,d=f==h;if(d&&(0,j.A)(t)){if(!(0,j.A)(e))return!1;a=!0,l=!1}if(d&&!l)return u||(u=new n.A),a||(0,m.A)(t)?s(t,e,r,o,i,u):p(t,e,f,r,o,i,u);if(!(1&r)){var v=l&&F.call(t,"__wrapped__"),_=A&&F.call(e,"__wrapped__");if(v||_){var E=v?t.value():t,L=_?e.value():e;return u||(u=new n.A),i(E,L,r,o,u)}}return!!d&&(u||(u=new n.A),b(t,e,r,o,i,u))},L=r("iK"),z=function t(e,r,n,o,i){return e===r||(null!=e&&null!=r&&((0,L.A)(e)||(0,L.A)(r))?E(e,r,n,o,t,i):e!=e&&r!=r)},P=function(t,e,r,o){var i=r.length,u=i,s=!o;if(null==t)return!u;for(t=Object(t);i--;){var a=r[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<u;){var c=(a=r[i])[0],f=t[c],h=a[1];if(s&&a[2]){if(void 0===f&&!(c in t))return!1}else{var l=new n.A;if(o)var A=o(f,h,c,t,e,l);if(!(void 0===A?z(h,f,3,o,l):A))return!1}}return!0},D=r("cN"),k=function(t){return t==t&&!(0,D.A)(t)},N=r("Fv"),x=function(t){for(var e=(0,N.A)(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,k(o)]}return e},S=function(t,e){return function(r){return null!=r&&r[t]===e&&(void 0!==e||t in Object(r))}},T=function(t){var e=x(t);return 1==e.length&&e[0][2]?S(e[0][0],e[0][1]):function(r){return r===t||P(r,t,e)}},I=r("sE"),M=function(t,e,r){var n=null==t?void 0:(0,I.A)(t,e);return void 0===n?r:n},B=r("ABL"),K=r("PfX"),H=r("tU"),U=r("Bo"),X=r("bl"),$=function(t){return(0,K.A)(t)?(0,X.A)((0,H.A)(t)):function(e){return(0,I.A)(e,t)}},q=function(t){if("function"==typeof t)return t;if(null==t)return U.A;if("object"==typeof t){var e,r;return(0,g.A)(t)?(e=t[0],r=t[1],(0,K.A)(e)&&k(r)?S((0,H.A)(e),r):function(t){var n=M(t,e);return void 0===n&&n===r?(0,B.A)(t,e):z(r,n,3)}):T(t)}return $(t)}},yg(t,e,r){r.d(e,{A:()=>u});var n=r("a0"),o=(0,r("Tn").A)(Object.keys,Object),i=Object.prototype.hasOwnProperty,u=function(t){if(!(0,n.A)(t))return o(t);var e=[];for(var r in Object(t))i.call(t,r)&&"constructor"!=r&&e.push(r);return e}},bl(t,e){e.A=function(t){return function(e){return null==e?void 0:e[t]}}},En(t,e,r){var n=r("Bo"),o=r("rT"),i=r("Tl");e.A=function(t,e){return(0,i.A)((0,o.A)(t,e,n.A),t+"")}},kj(t,e){e.A=function(t){return function(e){return t(e)}}},f3(t,e){e.A=function(t,e){return t.has(e)}},jC(t,e,r){var n=r("Bo");e.A=function(t){return"function"==typeof t?t:n.A}},JA(t,e,r){r.d(e,{A:()=>A});var n,o,i=r("D2"),u=r("PfX"),s=r("mb");function a(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var u=t.apply(this,n);return r.cache=i.set(o,u)||i,u};return r.cache=new(a.Cache||s.A),r}a.Cache=s.A;var c=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,f=/\\(\\)?/g,h=(o=(n=a(function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(c,function(t,r,n,o){e.push(n?o.replace(f,"$1"):r||t)}),e},function(t){return 500===o.size&&o.clear(),t})).cache,n),l=r("zL"),A=function(t,e){return(0,i.A)(t)?t:(0,u.A)(t,e)?[t]:h((0,l.A)(t))}},po(t,e,r){var n=r("uf");e.A=function(){try{var t=(0,n.A)(Object,"defineProperty");return t({},"",{}),t}catch(t){}}()},kA(t,e){e.A="object"==typeof global&&global&&global.Object===Object&&global},uN(t,e,r){var n=r("Qz"),o=r("FI"),i=r("Fv");e.A=function(t){return(0,n.A)(t,i.A,o.A)}},uf(t,e,r){r.d(e,{A:()=>p});var n,o=r("Kg"),i=r("CvH").A["__core-js_shared__"],u=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",s=r("cN"),a=r("EX"),c=/^\[object .+?Constructor\]$/,f=Object.prototype,h=Function.prototype.toString,l=f.hasOwnProperty,A=RegExp("^"+h.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),d=function(t){return!!(0,s.A)(t)&&(!u||!(u in t))&&((0,o.A)(t)?A:c).test((0,a.A)(t))},p=function(t,e){var r=null==t?void 0:t[e];return d(r)?r:void 0}},FI(t,e,r){var n=r("Iy"),o=r("MX"),i=Object.prototype.propertyIsEnumerable,u=Object.getOwnPropertySymbols;e.A=u?function(t){return null==t?[]:(t=Object(t),(0,n.A)(u(t),function(e){return i.call(t,e)}))}:o.A},VB(t,e,r){r.d(e,{A:()=>O});var n=r("uf"),o=r("CvH"),i=(0,n.A)(o.A,"DataView"),u=r("Cz"),s=(0,n.A)(o.A,"Promise"),a=r("ka5"),c=(0,n.A)(o.A,"WeakMap"),f=r("qdn"),h=r("EX"),l="[object Map]",A="[object Promise]",d="[object Set]",p="[object WeakMap]",v="[object DataView]",_=(0,h.A)(i),b=(0,h.A)(u.A),y=(0,h.A)(s),g=(0,h.A)(a.A),j=(0,h.A)(c),m=f.A;(i&&m(new i(new ArrayBuffer(1)))!=v||u.A&&m(new u.A)!=l||s&&m(s.resolve())!=A||a.A&&m(new a.A)!=d||c&&m(new c)!=p)&&(m=function(t){var e=(0,f.A)(t),r="[object Object]"==e?t.constructor:void 0,n=r?(0,h.A)(r):"";if(n)switch(n){case _:return v;case b:return l;case y:return A;case g:return d;case j:return p}return e});var O=m},n8(t,e,r){var n=r("JA"),o=r("rFc"),i=r("D2"),u=r("s6"),s=r("AL"),a=r("tU");e.A=function(t,e,r){e=(0,n.A)(e,t);for(var c=-1,f=e.length,h=!1;++c<f;){var l=(0,a.A)(e[c]);if(!(h=null!=t&&r(t,l)))break;t=t[l]}return h||++c!=f?h:!!(f=null==t?0:t.length)&&(0,s.A)(f)&&(0,u.A)(l,f)&&((0,i.A)(t)||(0,o.A)(t))}},s6(t,e){var r=/^(?:0|[1-9]\d*)$/;e.A=function(t,e){var n=typeof t;return!!(e=null==e?0x1fffffffffffff:e)&&("number"==n||"symbol"!=n&&r.test(t))&&t>-1&&t%1==0&&t<e}},PfX(t,e,r){var n=r("D2"),o=r("I6"),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/;e.A=function(t,e){if((0,n.A)(t))return!1;var r=typeof t;return!!("number"==r||"symbol"==r||"boolean"==r||null==t||(0,o.A)(t))||u.test(t)||!i.test(t)||null!=e&&t in Object(e)}},a0(t,e){var r=Object.prototype;e.A=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||r)}},LP(t,e,r){var n=r("kA"),o="object"==typeof exports&&exports&&!exports.nodeType&&exports,i=o&&"object"==typeof module&&module&&!module.nodeType&&module,u=i&&i.exports===o&&n.A.process;e.A=function(){try{var t=i&&i.require&&i.require("util").types;if(t)return t;return u&&u.binding&&u.binding("util")}catch(t){}}()},Tn(t,e){e.A=function(t,e){return function(r){return t(e(r))}}},rT(t,e,r){r.d(e,{A:()=>i});var n=function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)},o=Math.max,i=function(t,e,r){return e=o(void 0===e?t.length-1:e,0),function(){for(var i=arguments,u=-1,s=o(i.length-e,0),a=Array(s);++u<s;)a[u]=i[e+u];u=-1;for(var c=Array(e+1);++u<e;)c[u]=i[u];return c[e]=r(a),n(t,this,c)}}},CvH(t,e,r){var n=r("kA"),o="object"==typeof self&&self&&self.Object===Object&&self;e.A=n.A||o||Function("return this")()},Ft(t,e){e.A=function(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=t}),r}},Tl(t,e,r){r.d(e,{A:()=>f});var n,o,i=r("F7"),u=r("po"),s=r("Bo"),a=u.A?function(t,e){return(0,u.A)(t,"toString",{configurable:!0,enumerable:!1,value:(0,i.A)(e),writable:!0})}:s.A,c=Date.now,f=(n=0,o=0,function(){var t=c(),e=16-(t-o);if(o=t,e>0){if(++n>=800)return arguments[0]}else n=0;return a.apply(void 0,arguments)})},tU(t,e,r){var n=r("I6");e.A=function(t){if("string"==typeof t||(0,n.A)(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},EX(t,e){var r=Function.prototype.toString;e.A=function(t){if(null!=t){try{return r.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},F7(t,e){e.A=function(t){return function(){return t}}},TK(t,e){e.A=function(t,e){return t===e||t!=t&&e!=e}},Os6(t,e,r){r.d(e,{A:()=>a});var n=r("Iy"),o=r("hp"),i=function(t,e){var r=[];return(0,o.A)(t,function(t,n,o){e(t,n,o)&&r.push(t)}),r},u=r("bQs"),s=r("D2"),a=function(t,e){return((0,s.A)(t)?n.A:i)(t,(0,u.A)(e,3))}},yz(t,e,r){var n=r("C0"),o=r("hp"),i=r("jC"),u=r("D2");e.A=function(t,e){return((0,u.A)(t)?n.A:o.A)(t,(0,i.A)(e))}},ABL(t,e,r){r.d(e,{A:()=>i});var n=function(t,e){return null!=t&&e in Object(t)},o=r("n8"),i=function(t,e){return null!=t&&(0,o.A)(t,e,n)}},Bo(t,e){e.A=function(t){return t}},rFc(t,e,r){r.d(e,{A:()=>c});var n=r("qdn"),o=r("iK"),i=function(t){return(0,o.A)(t)&&"[object Arguments]"==(0,n.A)(t)},u=Object.prototype,s=u.hasOwnProperty,a=u.propertyIsEnumerable,c=i(function(){return arguments}())?i:function(t){return(0,o.A)(t)&&s.call(t,"callee")&&!a.call(t,"callee")}},D2(t,e){e.A=Array.isArray},xnM(t,e,r){var n=r("Kg"),o=r("AL");e.A=function(t){return null!=t&&(0,o.A)(t.length)&&!(0,n.A)(t)}},Lc(t,e,r){var n=r("xnM"),o=r("iK");e.A=function(t){return(0,o.A)(t)&&(0,n.A)(t)}},Fr(t,e,r){r.d(e,{A:()=>s});var n=r("CvH"),o="object"==typeof exports&&exports&&!exports.nodeType&&exports,i=o&&"object"==typeof module&&module&&!module.nodeType&&module,u=i&&i.exports===o?n.A.Buffer:void 0,s=(u?u.isBuffer:void 0)||function(){return!1}},Kg(t,e,r){var n=r("qdn"),o=r("cN");e.A=function(t){if(!(0,o.A)(t))return!1;var e=(0,n.A)(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},AL(t,e){e.A=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=0x1fffffffffffff}},cN(t,e){e.A=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},iK(t,e){e.A=function(t){return null!=t&&"object"==typeof t}},I6(t,e,r){var n=r("qdn"),o=r("iK");e.A=function(t){return"symbol"==typeof t||(0,o.A)(t)&&"[object Symbol]"==(0,n.A)(t)}},Hm(t,e,r){r.d(e,{A:()=>f});var n=r("qdn"),o=r("AL"),i=r("iK"),u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u["[object Arguments]"]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u["[object Function]"]=u["[object Map]"]=u["[object Number]"]=u["[object Object]"]=u["[object RegExp]"]=u["[object Set]"]=u["[object String]"]=u["[object WeakMap]"]=!1;var s=r("kj"),a=r("LP"),c=a.A&&a.A.isTypedArray,f=c?(0,s.A)(c):function(t){return(0,i.A)(t)&&(0,o.A)(t.length)&&!!u[(0,n.A)(t)]}},iO(t,e){e.A=function(t){return void 0===t}},Fv(t,e,r){var n=r("cu"),o=r("yg"),i=r("xnM");e.A=function(t){return(0,i.A)(t)?(0,n.A)(t):(0,o.A)(t)}},Ep(t,e,r){r.d(e,{A:()=>a});var n=function(t,e,r,n){var o=-1,i=null==t?0:t.length;for(n&&i&&(r=t[++o]);++o<i;)r=e(r,t[o],o,t);return r},o=r("hp"),i=r("bQs"),u=function(t,e,r,n,o){return o(t,function(t,o,i){r=n?(n=!1,t):e(r,t,o,i)}),r},s=r("D2"),a=function(t,e,r){var a=(0,s.A)(t)?n:u,c=arguments.length<3;return a(t,(0,i.A)(e,4),r,c,o.A)}},MX(t,e){e.A=function(){return[]}},zL(t,e,r){r.d(e,{A:()=>f});var n=r("Iu"),o=r("Yk"),i=r("D2"),u=r("I6"),s=n.A?n.A.prototype:void 0,a=s?s.toString:void 0,c=function t(e){if("string"==typeof e)return e;if((0,i.A)(e))return(0,o.A)(e,t)+"";if((0,u.A)(e))return a?a.call(e):"";var r=e+"";return"0"==r&&1/e==-1/0?"-0":r},f=function(t){return null==t?"":c(t)}},wF(t,e,r){r.d(e,{A:()=>i});var n=r("Yk"),o=r("Fv"),i=function(t){var e;return null==t?[]:(e=(0,o.A)(t),(0,n.A)(e,function(e){return t[e]}))}},nB(t,e,r){r.d(e,{T:()=>T});var n=r("F7"),o=r("Kg"),i=r("Fv"),u=r("Os6"),s=r("yg"),a=r("VB"),c=r("rFc"),f=r("D2"),h=r("xnM"),l=r("Fr"),A=r("a0"),d=r("Hm"),p=Object.prototype.hasOwnProperty,v=function(t){if(null==t)return!0;if((0,h.A)(t)&&((0,f.A)(t)||"string"==typeof t||"function"==typeof t.splice||(0,l.A)(t)||(0,d.A)(t)||(0,c.A)(t)))return!t.length;var e=(0,a.A)(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if((0,A.A)(t))return!(0,s.A)(t).length;for(var r in t)if(p.call(t,r))return!1;return!0},_=r("yz"),b=r("iO"),y=r("Ll"),g=r("En"),j=r("a4"),m=r("YT"),O=function(t){return t!=t},w=function(t,e,r){for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return -1},C=function(t,e){return!!(null==t?0:t.length)&&(e==e?w(t,e,0):(0,m.A)(t,O,0))>-1},F=function(t,e,r){for(var n=-1,o=null==t?0:t.length;++n<o;)if(r(e,t[n]))return!0;return!1},E=r("f3"),L=r("ka5"),z=r("Ft"),P=L.A&&1/(0,z.A)(new L.A([,-0]))[1]==1/0?function(t){return new L.A(t)}:function(){},D=function(t,e,r){var n=-1,o=C,i=t.length,u=!0,s=[],a=s;if(r)u=!1,o=F;else if(i>=200){var c=e?null:P(t);if(c)return(0,z.A)(c);u=!1,o=E.A,a=new j.A}else a=e?[]:s;t:for(;++n<i;){var f=t[n],h=e?e(f):f;if(f=r||0!==f?f:0,u&&h==h){for(var l=a.length;l--;)if(a[l]===h)continue t;e&&a.push(h),s.push(f)}else o(a,h,r)||(a!==s&&a.push(h),s.push(f))}return s},k=r("Lc"),N=(0,g.A)(function(t){return D((0,y.A)(t,1,k.A,!0))}),x=r("wF"),S=r("Ep");class T{constructor(t={}){this._isDirected=!Object.prototype.hasOwnProperty.call(t,"directed")||t.directed,this._isMultigraph=!!Object.prototype.hasOwnProperty.call(t,"multigraph")&&t.multigraph,this._isCompound=!!Object.prototype.hasOwnProperty.call(t,"compound")&&t.compound,this._label=void 0,this._defaultNodeLabelFn=n.A(void 0),this._defaultEdgeLabelFn=n.A(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return o.A(t)||(t=n.A(t)),this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return i.A(this._nodes)}sources(){var t=this;return u.A(this.nodes(),function(e){return v(t._in[e])})}sinks(){var t=this;return u.A(this.nodes(),function(e){return v(t._out[e])})}setNodes(t,e){var r=arguments,n=this;return _.A(t,function(t){r.length>1?n.setNode(t,e):n.setNode(t)}),this}setNode(t,e){return Object.prototype.hasOwnProperty.call(this._nodes,t)?arguments.length>1&&(this._nodes[t]=e):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount),this}node(t){return this._nodes[t]}hasNode(t){return Object.prototype.hasOwnProperty.call(this._nodes,t)}removeNode(t){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){var e=t=>this.removeEdge(this._edgeObjs[t]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],_.A(this.children(t),t=>{this.setParent(t)}),delete this._children[t]),_.A(i.A(this._in[t]),e),delete this._in[t],delete this._preds[t],_.A(i.A(this._out[t]),e),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,e){if(!this._isCompound)throw Error("Cannot set parent in a non-compound graph");if(b.A(e))e="\0";else{e+="";for(var r=e;!b.A(r);r=this.parent(r))if(r===t)throw Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var e=this._parent[t];if("\0"!==e)return e}}children(t){if(b.A(t)&&(t="\0"),this._isCompound){var e=this._children[t];if(e)return i.A(e)}else if("\0"===t)return this.nodes();else if(this.hasNode(t))return[]}predecessors(t){var e=this._preds[t];if(e)return i.A(e)}successors(t){var e=this._sucs[t];if(e)return i.A(e)}neighbors(t){var e=this.predecessors(t);if(e)return N(e,this.successors(t))}isLeaf(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length}filterNodes(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var r=this;_.A(this._nodes,function(r,n){t(n)&&e.setNode(n,r)}),_.A(this._edgeObjs,function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,r.edge(t))});var n={};return this._isCompound&&_.A(e.nodes(),function(t){e.setParent(t,function t(o){var i=r.parent(o);return void 0===i||e.hasNode(i)?(n[o]=i,i):i in n?n[i]:t(i)}(t))}),e}setDefaultEdgeLabel(t){return o.A(t)||(t=n.A(t)),this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return x.A(this._edgeObjs)}setPath(t,e){var r=this,n=arguments;return S.A(t,function(t,o){return n.length>1?r.setEdge(t,o,e):r.setEdge(t,o),o}),this}setEdge(){var t,e,r,n,o=!1,i=arguments[0];"object"==typeof i&&null!==i&&"v"in i?(t=i.v,e=i.w,r=i.name,2==arguments.length&&(n=arguments[1],o=!0)):(t=i,e=arguments[1],r=arguments[3],arguments.length>2&&(n=arguments[2],o=!0)),t=""+t,e=""+e,b.A(r)||(r=""+r);var u=B(this._isDirected,t,e,r);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,u))return o&&(this._edgeLabels[u]=n),this;if(!b.A(r)&&!this._isMultigraph)throw Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[u]=o?n:this._defaultEdgeLabelFn(t,e,r);var s=function(t,e,r,n){var o=""+e,i=""+r;if(!t&&o>i){var u=o;o=i,i=u}var s={v:o,w:i};return n&&(s.name=n),s}(this._isDirected,t,e,r);return t=s.v,e=s.w,Object.freeze(s),this._edgeObjs[u]=s,I(this._preds[e],t),I(this._sucs[t],e),this._in[e][u]=s,this._out[t][u]=s,this._edgeCount++,this}edge(t,e,r){var n=1==arguments.length?K(this._isDirected,arguments[0]):B(this._isDirected,t,e,r);return this._edgeLabels[n]}hasEdge(t,e,r){var n=1==arguments.length?K(this._isDirected,arguments[0]):B(this._isDirected,t,e,r);return Object.prototype.hasOwnProperty.call(this._edgeLabels,n)}removeEdge(t,e,r){var n=1==arguments.length?K(this._isDirected,arguments[0]):B(this._isDirected,t,e,r),o=this._edgeObjs[n];return o&&(t=o.v,e=o.w,delete this._edgeLabels[n],delete this._edgeObjs[n],M(this._preds[e],t),M(this._sucs[t],e),delete this._in[e][n],delete this._out[t][n],this._edgeCount--),this}inEdges(t,e){var r=this._in[t];if(r){var n=x.A(r);return e?u.A(n,function(t){return t.v===e}):n}}outEdges(t,e){var r=this._out[t];if(r){var n=x.A(r);return e?u.A(n,function(t){return t.w===e}):n}}nodeEdges(t,e){var r=this.inEdges(t,e);if(r)return r.concat(this.outEdges(t,e))}}function I(t,e){t[e]?t[e]++:t[e]=1}function M(t,e){--t[e]||delete t[e]}function B(t,e,r,n){var o=""+e,i=""+r;if(!t&&o>i){var u=o;o=i,i=u}return o+"\x01"+i+"\x01"+(b.A(n)?"\0":n)}function K(t,e){return B(t,e.v,e.w,e.name)}T.prototype._nodeCount=0,T.prototype._edgeCount=0},v2(t,e,r){var n=r("nB");r.d(e,{T:()=>n.T})}}]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! LICENSE: m.
|
|
2
|
-
"use strict";(self.rspackChunkompchamber=self.rspackChunkompchamber||[]).push([["m"],{AB(e,t,n){n.d(t,{GitPanel:()=>ea});var s=n("j"),a=n("H"),r=n("Xk"),i=n("E6"),o=n("DB"),l=n("tR"),c=n("hw"),d=n("Wb0"),h=n("S"),p=n("t");function m(e){let{isGraphMode:t,onToggleMode:n,searchQuery:a,onSearchChange:r,onRefresh:i,onClose:l,isRefreshing:m,totalCommits:f,totalCount:u}=e;return(0,s.FD)("div",{className:"flex flex-col gap-2 px-3 lg:px-5 py-3 border-b border-ink/10 bg-paper select-none\n pl-[max(0.75rem,env(safe-area-inset-left,0px))] pr-[max(0.75rem,env(safe-area-inset-right,0px))]",children:[(0,s.FD)("div",{className:"flex items-center justify-between gap-2 lg:gap-4",children:[(0,s.FD)("div",{className:"flex flex-col min-w-0",children:[(0,s.FD)("div",{className:"flex items-center gap-2.5 min-w-0",children:[(0,s.Y)("h2",{className:"text-base font-semibold text-ink tracking-tight",children:t?"Graph":"History"}),(0,s.Y)("span",{className:"text-[11px] font-mono px-2 py-0.5 rounded-full bg-ink/5 text-ink/50 border border-ink/10 whitespace-nowrap",children:u&&u>f?`${f} of ${u}`:`${f} commits`})]}),(0,s.Y)("p",{className:"text-xs text-ink/50 mt-0.5 hidden lg:block",children:"Browse recent commits and inspect changed files."})]}),(0,s.FD)("div",{className:"flex items-center gap-1.5 lg:gap-2 flex-shrink-0",children:[(0,s.FD)("div",{className:"flex items-center bg-ink/5 p-0.5 rounded-lg border border-ink/10 text-xs",children:[(0,s.FD)("button",{type:"button",onClick:()=>n(!1),title:"History view",className:`flex items-center gap-1.5 px-2.5 py-1 rounded-md font-medium transition-colors cursor-pointer ${!t?"bg-paper text-ink shadow-xs":"text-ink/60 hover:text-ink hover:bg-ink/5"}`,children:[(0,s.Y)(c.A,{size:13}),(0,s.Y)("span",{className:"hidden lg:inline",children:"History"})]}),(0,s.FD)("button",{type:"button",onClick:()=>n(!0),title:"Graph view",className:`flex items-center gap-1.5 px-2.5 py-1 rounded-md font-medium transition-colors cursor-pointer ${t?"bg-paper text-ink shadow-xs":"text-ink/60 hover:text-ink hover:bg-ink/5"}`,children:[(0,s.Y)(o.A,{size:13}),(0,s.Y)("span",{className:"hidden lg:inline",children:"Graph"})]})]}),(0,s.FD)("button",{type:"button",onClick:i,disabled:m,className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-md border border-ink/15 hover:bg-ink/5 text-ink/70 hover:text-ink transition-colors cursor-pointer text-xs disabled:opacity-40",title:"Refresh commit history",children:[(0,s.Y)(d.A,{size:13,className:m?"animate-spin text-ink":""}),(0,s.Y)("span",{className:"hidden lg:inline",children:"refresh"})]}),(0,s.Y)("button",{type:"button",onClick:l,className:"p-2 -mr-1 rounded-md hover:bg-ink/5 text-ink/60 hover:text-ink transition-colors cursor-pointer",title:"Close modal",children:(0,s.Y)(h.A,{size:16})})]})]}),(0,s.FD)("div",{className:"relative mt-1",children:[(0,s.Y)(p.A,{size:13,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-ink/40"}),(0,s.Y)("input",{type:"text",value:a,onChange:e=>r(e.currentTarget.value),placeholder:"Filter commits by message, author, or hash...",className:"w-full bg-ink/[0.03] border border-ink/15 rounded-md pl-8 pr-3 py-1.5 text-xs text-ink placeholder-ink/40 focus:outline-none focus:border-ink/40 transition-colors font-mono"}),a&&(0,s.Y)("button",{type:"button",onClick:()=>r(""),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-ink/40 hover:text-ink cursor-pointer",children:(0,s.Y)(h.A,{size:12})})]})]})}let f=["#38bdf8","#f97316","#a855f7","#10b981","#ec4899","#eab308","#06b6d4","#6366f1"];function u(e,t){if(!e||!t)return!1;if(e===t)return!0;let n=Math.min(e.length,t.length);return n>=4&&e.substring(0,n)===t.substring(0,n)}function x(e){let t=new Map,n=[];for(let s of e){if("number"==typeof s.lane){t.set(s.hash,s.lane);continue}let e=n.findIndex(e=>u(e,s.hash)||u(e,s.shortHash));-1===e&&(-1===(e=n.indexOf(null))?(e=n.length,n.push(s.hash)):n[e]=s.hash),t.set(s.hash,e);let a=s.parents&&s.parents[0];if(a?n[e]=a:n[e]=null,s.parents&&s.parents.length>1)for(let e=1;e<s.parents.length;e++){let t=s.parents[e];if(!n.some(e=>u(e,t))){let e=n.indexOf(null);-1===e?n.push(t):n[e]=t}}}return t}function b(e){let{commits:t,nodePositions:n,selectedHash:r,hoveredHash:i,isGraphMode:o,laneWidth:l=18,paddingLeft:c=16,totalHeight:d}=e,h=(0,a.Kr)(()=>{if(!o){let e=new Map;return t.forEach(t=>e.set(t.hash,0)),e}return x(t)},[t,o]),p=(0,a.Kr)(()=>{let e=0;return h.forEach(t=>{t>e&&(e=t)}),e},[h]),m=o?(p+1)*l+2*c:36,u=(0,a.Kr)(()=>{if(!o){let e=[];for(let s=0;s<t.length-1;s++){let a=n[t[s].hash]??60*s+20,r=n[t[s+1].hash]??(s+1)*60+20;e.push({fromHash:t[s].hash,toHash:t[s+1].hash,fromLane:0,toLane:0,fromY:a,toY:r,color:"var(--theme-ink)"})}return e}return function(e,t,n,s){let a=[],r=new Map;for(let i of(e.forEach((e,t)=>{r.set(e.hash,t),e.shortHash&&r.set(e.shortHash,t),e.hash.length>=7&&r.set(e.hash.substring(0,7),t)}),e)){let o=t.get(i.hash)??0,l=n[i.hash]??0,c=f[o%f.length];if(i.parents&&0!==i.parents.length)for(let d of i.parents){let h=r.get(d);if("number"!=typeof h&&d.length>=7&&(h=r.get(d.substring(0,7))),"number"==typeof h){let s=e[h],r=t.get(s.hash)??o,c=n[s.hash]??l+60;a.push({fromHash:i.hash,toHash:s.hash,fromLane:o,toLane:r,fromY:l,toY:c,color:f[o%f.length]})}else a.push({fromHash:i.hash,toHash:"tail-"+i.hash,fromLane:o,toLane:o,fromY:l,toY:Math.max(l+80,s),color:c})}}return a}(t,h,n,d)},[t,h,n,d,o]);return(0,s.Y)("div",{className:"absolute top-0 left-0 pointer-events-none z-10",style:{width:m,height:d},children:(0,s.FD)("svg",{className:"w-full h-full overflow-visible",style:{width:m,height:d},children:[(0,s.Y)("defs",{children:(0,s.Y)("filter",{id:"node-glow",x:"-20%",y:"-20%",width:"140%",height:"140%",children:(0,s.Y)("feDropShadow",{dx:"0",dy:"0",stdDeviation:"2",floodOpacity:"0.35"})})}),u.map(e=>{let t=o?c+e.fromLane*l:16,n=o?c+e.toLane*l:16,a=o?e.color:"currentColor",r=o?.95:.25,i=function(e,t,n,s){if(1>Math.abs(e-n))return`M ${e} ${t} L ${n} ${s}`;let a=s-t;return`M ${e} ${t} C ${e} ${t+.45*a}, ${n} ${s-.45*a}, ${n} ${s}`}(t,e.fromY,n,e.toY);return(0,s.Y)("path",{d:i,fill:"none",stroke:a,strokeWidth:o?2.25:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:r},`${e.fromHash}->${e.toHash}`)}),t.map(e=>{let t=h.get(e.hash)??0,a=o?c+t*l:16,d=n[e.hash]??20,p=r===e.hash||r===e.shortHash,m=i===e.hash||i===e.shortHash,u=o?f[t%f.length]:"var(--theme-success)";return(0,s.FD)("g",{children:[(p||m)&&(0,s.Y)("circle",{cx:a,cy:d,r:8,fill:u,fillOpacity:p?.35:.2,stroke:u,strokeWidth:1}),(0,s.Y)("circle",{cx:a,cy:d,r:o?4:4.5,fill:o?"var(--theme-paper)":u,stroke:u,strokeWidth:o?2.5:1.5,filter:"url(#node-glow)"}),o&&(0,s.Y)("circle",{cx:a,cy:d,r:1.8,fill:u})]},`node-${e.hash}`)})]})})}var g=n("z"),k=n("b0"),v=n("Go"),y=n("Nf");function w(e){let{commit:t,onAction:n,isBusy:a}=e;return(0,s.FD)("div",{className:"flex flex-wrap items-center gap-1.5 pt-1.5 pb-2",children:[(0,s.Y)("button",{type:"button",disabled:a,onClick:e=>{e.stopPropagation(),n("checkout",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"checkout"}),(0,s.Y)("button",{type:"button",disabled:a,onClick:e=>{e.stopPropagation(),n("create_branch_here",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"create branch here"}),(0,s.Y)("button",{type:"button",disabled:a,onClick:e=>{e.stopPropagation(),n("cherry_pick",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"cherry-pick"}),(0,s.Y)("button",{type:"button",disabled:a,onClick:e=>{e.stopPropagation(),n("revert",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"revert"}),(0,s.Y)("button",{type:"button",disabled:a,onClick:e=>{e.stopPropagation(),n("reset",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"reset..."}),(0,s.Y)("button",{type:"button",disabled:a,onClick:e=>{e.stopPropagation(),n("merge",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"merge into current"}),(0,s.Y)("button",{type:"button",disabled:a,onClick:e=>{e.stopPropagation(),n("rebase",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"rebase onto this"})]})}var N=n("Wb"),Y=n("qg"),C=n("Po");function A(e){let{diffText:t,isLoading:n,filePath:r}=e,[i,o]=(0,a.J0)(!1),l=(0,C.w)(),c=(0,a.Kr)(()=>{if(!t)return[];let e=[],n=1,s=1,a=t.split(/\r?\n/);for(let t of a.some(e=>e.startsWith("@@"))?a:[`@@ -0,0 +1,${a.length} @@`,...a.map(e=>e.startsWith("+")||e.startsWith("-")?e:`+${e}`)])if(!(t.startsWith("diff --git")||t.startsWith("index ")||t.startsWith("---")||t.startsWith("+++")||t.startsWith("new file mode")||t.startsWith("deleted file mode")||t.startsWith("similarity index")||t.startsWith("old mode")||t.startsWith("new mode")||t.startsWith("\\ No newline")))if(t.startsWith("@@")){let a=t.match(/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);a&&(n=parseInt(a[1],10),s=parseInt(a[2],10)),e.push({type:"meta",text:t})}else if(t.startsWith("+"))e.push({type:"add",text:t.slice(1),newNum:s++});else if(t.startsWith("-"))e.push({type:"del",text:t.slice(1),oldNum:n++});else{let a=t.startsWith(" ")?t.slice(1):t;e.push({type:"context",text:a,oldNum:n++,newNum:s++})}return e},[t]),d=(0,Y.sQ)(r),h=(0,a.Kr)(()=>{let e=Array(c.length).fill(""),t=-1,n=n=>{if(t<0)return;let s=(0,Y.O9)(c.slice(t,n).map(e=>e.text).join("\n"),d);for(let a=t;a<n;a++)e[a]=s[a-t]??"";t=-1};return c.forEach((e,s)=>{"meta"===e.type?n(s):t<0&&(t=s)}),n(c.length),e},[c,d,l]);return n?(0,s.Y)("div",{className:"my-2 p-4 rounded bg-canvas border border-ink/10 text-ink/40 font-mono text-xs flex items-center justify-center",children:"Loading commit diff..."}):t&&0!==c.length?(0,s.FD)("div",{className:"my-2 rounded border border-ink/15 bg-paper overflow-hidden text-[11px] font-mono leading-relaxed shadow-xs text-ink",children:[(0,s.FD)("div",{className:"flex items-center justify-between px-3 py-1.5 bg-canvas border-b border-ink/10 text-ink/70 text-[10.5px]",children:[(0,s.Y)("span",{className:"font-semibold text-meta",children:"Diff preview"}),(0,s.Y)("button",{type:"button",onClick:()=>o(!i),className:"hover:text-ink flex items-center gap-1 cursor-pointer transition-colors",children:i?(0,s.FD)(s.FK,{children:[(0,s.Y)(N.A,{size:12})," Collapse context"]}):(0,s.FD)(s.FK,{children:[(0,s.Y)(v.A,{size:12})," Expand all context"]})})]}),(0,s.Y)("div",{className:"overflow-x-auto max-h-72 select-text",children:(0,s.Y)("div",{className:"w-max min-w-full divide-y divide-ink/[0.04]",children:c.map((e,t)=>{if("meta"===e.type)return(0,s.FD)("div",{className:"flex items-center gap-2 px-3 py-1 bg-canvas border-y border-ink/10 text-meta text-[10px] font-semibold",children:[(0,s.Y)("span",{children:"↕"}),(0,s.Y)("span",{children:e.text})]},t);let n="add"===e.type,a="del"===e.type;return(0,s.FD)("div",{className:`flex items-start font-mono ${n?"bg-success/10 hover:bg-success/15":a?"bg-error/10 hover:bg-error/15":"text-ink hover:bg-ink/[0.02]"}`,children:[(0,s.Y)("div",{className:`w-10 flex-shrink-0 text-right pr-2 py-0.5 select-none border-r border-ink/10 text-[10px] tabular-nums font-mono ${a?"bg-error/15 text-error font-semibold":n?"bg-success/15 text-success/70":"bg-canvas/50 text-ink/40"}`,children:e.oldNum??(n?"+":"")}),(0,s.Y)("div",{className:`w-10 flex-shrink-0 text-right pr-2 py-0.5 select-none border-r border-ink/10 text-[10px] tabular-nums font-mono ${n?"bg-success/15 text-success font-semibold":a?"bg-error/15 text-error/70":"bg-canvas/50 text-ink/40"}`,children:e.newNum??(a?"-":"")}),(0,s.Y)("div",{className:`w-4 flex-shrink-0 text-center py-0.5 select-none font-bold ${n?"text-success":a?"text-error":"opacity-0"}`,children:n?"+":a?"-":" "}),(0,s.Y)("div",{className:"flex-1 py-0.5 pr-3 whitespace-pre text-ink",children:e.text?(0,s.Y)("span",{className:"shiki",dangerouslySetInnerHTML:{__html:h[t]}}):" "})]},t)})})})]}):(0,s.Y)("div",{className:"my-2 p-3 rounded bg-canvas border border-ink/10 text-ink/40 font-mono text-xs text-center",children:"No diff content available for this file."})}function F(e){let{commit:t,isSelected:n,isGraphMode:r,onSelect:i,onAction:o,onToggleFile:l,isExpandedFile:c,isLoadingFile:d,fileDiffs:h,headerRef:p}=e,[m,f]=(0,a.J0)(!1);return(0,s.Y)("div",{onClick:()=>i(t),className:`border-b border-ink/5 transition-colors cursor-pointer ${n?"bg-ink/[0.03]":"hover:bg-ink/[0.015]"}`,children:(0,s.FD)("div",{className:"py-2.5 pr-4 pl-1 flex flex-col",children:[(0,s.FD)("div",{className:"flex flex-col gap-1",children:[t.refs&&t.refs.length>0&&(0,s.Y)("div",{className:"flex flex-wrap items-center gap-1.5 pb-0.5",children:t.refs.map((e,t)=>{let n=e.includes("stash"),a=e.includes("HEAD")||e.includes("main")||e.includes("master");return(0,s.Y)("span",{className:`px-2 py-0.5 rounded text-[10px] font-mono border ${n?"bg-warning/10 text-warning border-warning/25 font-semibold":a?"bg-ink/10 text-ink font-semibold border-ink/20":"bg-canvas text-meta border-ink/10 font-medium"}`,children:e},t)})}),(0,s.Y)("div",{ref:p,className:"text-[13px] font-semibold text-ink leading-snug break-words",children:t.message}),(0,s.FD)("div",{className:"flex items-center gap-2 text-[11px] text-ink/50 font-mono flex-wrap",children:[(0,s.Y)("span",{children:t.author}),(0,s.Y)("span",{children:"•"}),(0,s.Y)("span",{children:t.date}),(0,s.Y)("span",{children:"•"}),(0,s.FD)("button",{type:"button",onClick:e=>{e.stopPropagation(),navigator.clipboard.writeText(t.hash),f(!0),setTimeout(()=>f(!1),2e3)},title:"Copy commit hash",className:"inline-flex items-center gap-1 hover:text-ink transition-colors cursor-pointer text-ink/70",children:[(0,s.Y)("span",{children:t.shortHash}),m?(0,s.Y)(g.A,{size:11,className:"text-success"}):(0,s.Y)(k.A,{size:11})]})]})]}),(n||r)&&(0,s.Y)("div",{className:"mt-2",children:(0,s.Y)(w,{commit:t,onAction:o})}),t.files&&t.files.length>0&&(0,s.Y)("div",{className:"mt-2 flex flex-col gap-1",children:t.files.map((e,n)=>{let a=c(t.hash,e.file),r=`${t.hash}:${e.file}`,i=void 0!==h[r]?h[r]:e.diff,o=d(t.hash,e.file),p="A"===e.status?"text-success font-bold":"D"===e.status?"text-error font-bold":"R"===e.status?"text-meta font-bold":"text-info font-bold";return(0,s.FD)("div",{className:"flex flex-col",children:[(0,s.FD)("div",{onClick:n=>{n.stopPropagation(),l(t.hash,e)},className:"flex items-center gap-2 py-1 px-2 rounded hover:bg-ink/5 text-[11.5px] font-mono text-ink/80 transition-colors group cursor-pointer border border-transparent hover:border-ink/10",children:[(0,s.Y)("span",{className:`w-3.5 text-center flex-shrink-0 text-[11px] ${p}`,children:e.status||"M"}),(0,s.Y)("span",{className:"truncate flex-1 min-w-0 text-ink/90 group-hover:text-ink font-medium",children:e.file}),(0,s.FD)("span",{className:"flex items-center gap-1 text-[10.5px] tabular-nums flex-shrink-0 font-medium",children:[(0,s.FD)("span",{className:"text-success",children:["+",e.additions]}),(0,s.Y)("span",{className:"text-ink/30",children:"/"}),(0,s.FD)("span",{className:"text-error",children:["-",e.deletions]})]}),(0,s.Y)("span",{className:"text-ink/40 group-hover:text-ink flex-shrink-0",children:a?(0,s.Y)(v.A,{size:13}):(0,s.Y)(y.A,{size:13})})]}),a&&(0,s.Y)("div",{className:"pl-4 pr-1",children:(0,s.Y)(A,{diffText:i,isLoading:o,filePath:e.file})})]},n)})})]})})}let D=[{hash:"8f8ca583e7162b190f898394e1e3ad81472a1290",shortHash:"8f8ca583",author:"Wijarnako Putra Rajeb",date:"Sep 10, 2026, 12:40 PM",message:"feat(chat): persist composer draft and attachments per session",parents:["6d3bac50"],refs:["HEAD -> main","origin/main"],lane:0,files:[{file:"app/hooks/chat/timeline/index.ts",status:"M",additions:3,deletions:2,diff:`@@ -7,6 +7,7 @@
|
|
1
|
+
/*! LICENSE: m.4b29d34f93.js.LICENSE.txt */
|
|
2
|
+
"use strict";(self.rspackChunkompchamber=self.rspackChunkompchamber||[]).push([["m"],{ABt(e,t,n){n.d(t,{GitPanel:()=>ea});var s=n("j"),a=n("H"),r=n("X"),i=n("E6"),o=n("DB"),l=n("t"),c=n("hw"),d=n("Wb0"),h=n("S"),p=n("t3");function m(e){let{isGraphMode:t,onToggleMode:n,searchQuery:a,onSearchChange:r,onRefresh:i,onClose:l,isRefreshing:m,totalCommits:f,totalCount:u}=e;return(0,s.FD)("div",{className:"flex flex-col gap-2 px-3 lg:px-5 py-3 border-b border-ink/10 bg-paper select-none\n pl-[max(0.75rem,env(safe-area-inset-left,0px))] pr-[max(0.75rem,env(safe-area-inset-right,0px))]",children:[(0,s.FD)("div",{className:"flex items-center justify-between gap-2 lg:gap-4",children:[(0,s.FD)("div",{className:"flex flex-col min-w-0",children:[(0,s.FD)("div",{className:"flex items-center gap-2.5 min-w-0",children:[(0,s.Y)("h2",{className:"text-base font-semibold text-ink tracking-tight",children:t?"Graph":"History"}),(0,s.Y)("span",{className:"text-[11px] font-mono px-2 py-0.5 rounded-full bg-ink/5 text-ink/50 border border-ink/10 whitespace-nowrap",children:u&&u>f?`${f} of ${u}`:`${f} commits`})]}),(0,s.Y)("p",{className:"text-xs text-ink/50 mt-0.5 hidden lg:block",children:"Browse recent commits and inspect changed files."})]}),(0,s.FD)("div",{className:"flex items-center gap-1.5 lg:gap-2 flex-shrink-0",children:[(0,s.FD)("div",{className:"flex items-center bg-ink/5 p-0.5 rounded-lg border border-ink/10 text-xs",children:[(0,s.FD)("button",{type:"button",onClick:()=>n(!1),title:"History view",className:`flex items-center gap-1.5 px-2.5 py-1 rounded-md font-medium transition-colors cursor-pointer ${!t?"bg-paper text-ink shadow-xs":"text-ink/60 hover:text-ink hover:bg-ink/5"}`,children:[(0,s.Y)(c.A,{size:13}),(0,s.Y)("span",{className:"hidden lg:inline",children:"History"})]}),(0,s.FD)("button",{type:"button",onClick:()=>n(!0),title:"Graph view",className:`flex items-center gap-1.5 px-2.5 py-1 rounded-md font-medium transition-colors cursor-pointer ${t?"bg-paper text-ink shadow-xs":"text-ink/60 hover:text-ink hover:bg-ink/5"}`,children:[(0,s.Y)(o.A,{size:13}),(0,s.Y)("span",{className:"hidden lg:inline",children:"Graph"})]})]}),(0,s.FD)("button",{type:"button",onClick:i,disabled:m,className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-md border border-ink/15 hover:bg-ink/5 text-ink/70 hover:text-ink transition-colors cursor-pointer text-xs disabled:opacity-40",title:"Refresh commit history",children:[(0,s.Y)(d.A,{size:13,className:m?"animate-spin text-ink":""}),(0,s.Y)("span",{className:"hidden lg:inline",children:"refresh"})]}),(0,s.Y)("button",{type:"button",onClick:l,className:"p-2 -mr-1 rounded-md hover:bg-ink/5 text-ink/60 hover:text-ink transition-colors cursor-pointer",title:"Close modal",children:(0,s.Y)(h.A,{size:16})})]})]}),(0,s.FD)("div",{className:"relative mt-1",children:[(0,s.Y)(p.A,{size:13,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-ink/40"}),(0,s.Y)("input",{type:"text",value:a,onChange:e=>r(e.currentTarget.value),placeholder:"Filter commits by message, author, or hash...",className:"w-full bg-ink/[0.03] border border-ink/15 rounded-md pl-8 pr-3 py-1.5 text-xs text-ink placeholder-ink/40 focus:outline-none focus:border-ink/40 transition-colors font-mono"}),a&&(0,s.Y)("button",{type:"button",onClick:()=>r(""),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-ink/40 hover:text-ink cursor-pointer",children:(0,s.Y)(h.A,{size:12})})]})]})}let f=["#38bdf8","#f97316","#a855f7","#10b981","#ec4899","#eab308","#06b6d4","#6366f1"];function u(e,t){if(!e||!t)return!1;if(e===t)return!0;let n=Math.min(e.length,t.length);return n>=4&&e.substring(0,n)===t.substring(0,n)}function x(e){let t=new Map,n=[];for(let s of e){if("number"==typeof s.lane){t.set(s.hash,s.lane);continue}let e=n.findIndex(e=>u(e,s.hash)||u(e,s.shortHash));-1===e&&(-1===(e=n.indexOf(null))?(e=n.length,n.push(s.hash)):n[e]=s.hash),t.set(s.hash,e);let a=s.parents&&s.parents[0];if(a?n[e]=a:n[e]=null,s.parents&&s.parents.length>1)for(let e=1;e<s.parents.length;e++){let t=s.parents[e];if(!n.some(e=>u(e,t))){let e=n.indexOf(null);-1===e?n.push(t):n[e]=t}}}return t}function b(e){let{commits:t,nodePositions:n,selectedHash:r,hoveredHash:i,isGraphMode:o,laneWidth:l=18,paddingLeft:c=16,totalHeight:d}=e,h=(0,a.Kr)(()=>{if(!o){let e=new Map;return t.forEach(t=>e.set(t.hash,0)),e}return x(t)},[t,o]),p=(0,a.Kr)(()=>{let e=0;return h.forEach(t=>{t>e&&(e=t)}),e},[h]),m=o?(p+1)*l+2*c:36,u=(0,a.Kr)(()=>{if(!o){let e=[];for(let s=0;s<t.length-1;s++){let a=n[t[s].hash]??60*s+20,r=n[t[s+1].hash]??(s+1)*60+20;e.push({fromHash:t[s].hash,toHash:t[s+1].hash,fromLane:0,toLane:0,fromY:a,toY:r,color:"var(--theme-ink)"})}return e}return function(e,t,n,s){let a=[],r=new Map;for(let i of(e.forEach((e,t)=>{r.set(e.hash,t),e.shortHash&&r.set(e.shortHash,t),e.hash.length>=7&&r.set(e.hash.substring(0,7),t)}),e)){let o=t.get(i.hash)??0,l=n[i.hash]??0,c=f[o%f.length];if(i.parents&&0!==i.parents.length)for(let d of i.parents){let h=r.get(d);if("number"!=typeof h&&d.length>=7&&(h=r.get(d.substring(0,7))),"number"==typeof h){let s=e[h],r=t.get(s.hash)??o,c=n[s.hash]??l+60;a.push({fromHash:i.hash,toHash:s.hash,fromLane:o,toLane:r,fromY:l,toY:c,color:f[o%f.length]})}else a.push({fromHash:i.hash,toHash:"tail-"+i.hash,fromLane:o,toLane:o,fromY:l,toY:Math.max(l+80,s),color:c})}}return a}(t,h,n,d)},[t,h,n,d,o]);return(0,s.Y)("div",{className:"absolute top-0 left-0 pointer-events-none z-10",style:{width:m,height:d},children:(0,s.FD)("svg",{className:"w-full h-full overflow-visible",style:{width:m,height:d},children:[(0,s.Y)("defs",{children:(0,s.Y)("filter",{id:"node-glow",x:"-20%",y:"-20%",width:"140%",height:"140%",children:(0,s.Y)("feDropShadow",{dx:"0",dy:"0",stdDeviation:"2",floodOpacity:"0.35"})})}),u.map(e=>{let t=o?c+e.fromLane*l:16,n=o?c+e.toLane*l:16,a=o?e.color:"currentColor",r=o?.95:.25,i=function(e,t,n,s){if(1>Math.abs(e-n))return`M ${e} ${t} L ${n} ${s}`;let a=s-t;return`M ${e} ${t} C ${e} ${t+.45*a}, ${n} ${s-.45*a}, ${n} ${s}`}(t,e.fromY,n,e.toY);return(0,s.Y)("path",{d:i,fill:"none",stroke:a,strokeWidth:o?2.25:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:r},`${e.fromHash}->${e.toHash}`)}),t.map(e=>{let t=h.get(e.hash)??0,a=o?c+t*l:16,d=n[e.hash]??20,p=r===e.hash||r===e.shortHash,m=i===e.hash||i===e.shortHash,u=o?f[t%f.length]:"var(--theme-success)";return(0,s.FD)("g",{children:[(p||m)&&(0,s.Y)("circle",{cx:a,cy:d,r:8,fill:u,fillOpacity:p?.35:.2,stroke:u,strokeWidth:1}),(0,s.Y)("circle",{cx:a,cy:d,r:o?4:4.5,fill:o?"var(--theme-paper)":u,stroke:u,strokeWidth:o?2.5:1.5,filter:"url(#node-glow)"}),o&&(0,s.Y)("circle",{cx:a,cy:d,r:1.8,fill:u})]},`node-${e.hash}`)})]})})}var g=n("z"),k=n("b0"),v=n("Go"),y=n("Nf");function w(e){let{commit:t,onAction:n,isBusy:a}=e;return(0,s.FD)("div",{className:"flex flex-wrap items-center gap-1.5 pt-1.5 pb-2",children:[(0,s.Y)("button",{type:"button",disabled:a,onClick:e=>{e.stopPropagation(),n("checkout",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"checkout"}),(0,s.Y)("button",{type:"button",disabled:a,onClick:e=>{e.stopPropagation(),n("create_branch_here",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"create branch here"}),(0,s.Y)("button",{type:"button",disabled:a,onClick:e=>{e.stopPropagation(),n("cherry_pick",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"cherry-pick"}),(0,s.Y)("button",{type:"button",disabled:a,onClick:e=>{e.stopPropagation(),n("revert",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"revert"}),(0,s.Y)("button",{type:"button",disabled:a,onClick:e=>{e.stopPropagation(),n("reset",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"reset..."}),(0,s.Y)("button",{type:"button",disabled:a,onClick:e=>{e.stopPropagation(),n("merge",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"merge into current"}),(0,s.Y)("button",{type:"button",disabled:a,onClick:e=>{e.stopPropagation(),n("rebase",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"rebase onto this"})]})}var N=n("Wb"),Y=n("DU"),C=n("Po");function A(e){let{diffText:t,isLoading:n,filePath:r}=e,[i,o]=(0,a.J0)(!1),l=(0,C.w)(),c=(0,a.Kr)(()=>{if(!t)return[];let e=[],n=1,s=1,a=t.split(/\r?\n/);for(let t of a.some(e=>e.startsWith("@@"))?a:[`@@ -0,0 +1,${a.length} @@`,...a.map(e=>e.startsWith("+")||e.startsWith("-")?e:`+${e}`)])if(!(t.startsWith("diff --git")||t.startsWith("index ")||t.startsWith("---")||t.startsWith("+++")||t.startsWith("new file mode")||t.startsWith("deleted file mode")||t.startsWith("similarity index")||t.startsWith("old mode")||t.startsWith("new mode")||t.startsWith("\\ No newline")))if(t.startsWith("@@")){let a=t.match(/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);a&&(n=parseInt(a[1],10),s=parseInt(a[2],10)),e.push({type:"meta",text:t})}else if(t.startsWith("+"))e.push({type:"add",text:t.slice(1),newNum:s++});else if(t.startsWith("-"))e.push({type:"del",text:t.slice(1),oldNum:n++});else{let a=t.startsWith(" ")?t.slice(1):t;e.push({type:"context",text:a,oldNum:n++,newNum:s++})}return e},[t]),d=(0,Y.sQ)(r),h=(0,a.Kr)(()=>{let e=Array(c.length).fill(""),t=-1,n=n=>{if(t<0)return;let s=(0,Y.O9)(c.slice(t,n).map(e=>e.text).join("\n"),d);for(let a=t;a<n;a++)e[a]=s[a-t]??"";t=-1};return c.forEach((e,s)=>{"meta"===e.type?n(s):t<0&&(t=s)}),n(c.length),e},[c,d,l]);return n?(0,s.Y)("div",{className:"my-2 p-4 rounded bg-canvas border border-ink/10 text-ink/40 font-mono text-xs flex items-center justify-center",children:"Loading commit diff..."}):t&&0!==c.length?(0,s.FD)("div",{className:"my-2 rounded border border-ink/15 bg-paper overflow-hidden text-[11px] font-mono leading-relaxed shadow-xs text-ink",children:[(0,s.FD)("div",{className:"flex items-center justify-between px-3 py-1.5 bg-canvas border-b border-ink/10 text-ink/70 text-[10.5px]",children:[(0,s.Y)("span",{className:"font-semibold text-meta",children:"Diff preview"}),(0,s.Y)("button",{type:"button",onClick:()=>o(!i),className:"hover:text-ink flex items-center gap-1 cursor-pointer transition-colors",children:i?(0,s.FD)(s.FK,{children:[(0,s.Y)(N.A,{size:12})," Collapse context"]}):(0,s.FD)(s.FK,{children:[(0,s.Y)(v.A,{size:12})," Expand all context"]})})]}),(0,s.Y)("div",{className:"overflow-x-auto max-h-72 select-text",children:(0,s.Y)("div",{className:"w-max min-w-full divide-y divide-ink/[0.04]",children:c.map((e,t)=>{if("meta"===e.type)return(0,s.FD)("div",{className:"flex items-center gap-2 px-3 py-1 bg-canvas border-y border-ink/10 text-meta text-[10px] font-semibold",children:[(0,s.Y)("span",{children:"↕"}),(0,s.Y)("span",{children:e.text})]},t);let n="add"===e.type,a="del"===e.type;return(0,s.FD)("div",{className:`flex items-start font-mono ${n?"bg-success/10 hover:bg-success/15":a?"bg-error/10 hover:bg-error/15":"text-ink hover:bg-ink/[0.02]"}`,children:[(0,s.Y)("div",{className:`w-10 flex-shrink-0 text-right pr-2 py-0.5 select-none border-r border-ink/10 text-[10px] tabular-nums font-mono ${a?"bg-error/15 text-error font-semibold":n?"bg-success/15 text-success/70":"bg-canvas/50 text-ink/40"}`,children:e.oldNum??(n?"+":"")}),(0,s.Y)("div",{className:`w-10 flex-shrink-0 text-right pr-2 py-0.5 select-none border-r border-ink/10 text-[10px] tabular-nums font-mono ${n?"bg-success/15 text-success font-semibold":a?"bg-error/15 text-error/70":"bg-canvas/50 text-ink/40"}`,children:e.newNum??(a?"-":"")}),(0,s.Y)("div",{className:`w-4 flex-shrink-0 text-center py-0.5 select-none font-bold ${n?"text-success":a?"text-error":"opacity-0"}`,children:n?"+":a?"-":" "}),(0,s.Y)("div",{className:"flex-1 py-0.5 pr-3 whitespace-pre text-ink",children:e.text?(0,s.Y)("span",{className:"shiki",dangerouslySetInnerHTML:{__html:h[t]}}):" "})]},t)})})})]}):(0,s.Y)("div",{className:"my-2 p-3 rounded bg-canvas border border-ink/10 text-ink/40 font-mono text-xs text-center",children:"No diff content available for this file."})}function F(e){let{commit:t,isSelected:n,isGraphMode:r,onSelect:i,onAction:o,onToggleFile:l,isExpandedFile:c,isLoadingFile:d,fileDiffs:h,headerRef:p}=e,[m,f]=(0,a.J0)(!1);return(0,s.Y)("div",{onClick:()=>i(t),className:`border-b border-ink/5 transition-colors cursor-pointer ${n?"bg-ink/[0.03]":"hover:bg-ink/[0.015]"}`,children:(0,s.FD)("div",{className:"py-2.5 pr-4 pl-1 flex flex-col",children:[(0,s.FD)("div",{className:"flex flex-col gap-1",children:[t.refs&&t.refs.length>0&&(0,s.Y)("div",{className:"flex flex-wrap items-center gap-1.5 pb-0.5",children:t.refs.map((e,t)=>{let n=e.includes("stash"),a=e.includes("HEAD")||e.includes("main")||e.includes("master");return(0,s.Y)("span",{className:`px-2 py-0.5 rounded text-[10px] font-mono border ${n?"bg-warning/10 text-warning border-warning/25 font-semibold":a?"bg-ink/10 text-ink font-semibold border-ink/20":"bg-canvas text-meta border-ink/10 font-medium"}`,children:e},t)})}),(0,s.Y)("div",{ref:p,className:"text-[13px] font-semibold text-ink leading-snug break-words",children:t.message}),(0,s.FD)("div",{className:"flex items-center gap-2 text-[11px] text-ink/50 font-mono flex-wrap",children:[(0,s.Y)("span",{children:t.author}),(0,s.Y)("span",{children:"•"}),(0,s.Y)("span",{children:t.date}),(0,s.Y)("span",{children:"•"}),(0,s.FD)("button",{type:"button",onClick:e=>{e.stopPropagation(),navigator.clipboard.writeText(t.hash),f(!0),setTimeout(()=>f(!1),2e3)},title:"Copy commit hash",className:"inline-flex items-center gap-1 hover:text-ink transition-colors cursor-pointer text-ink/70",children:[(0,s.Y)("span",{children:t.shortHash}),m?(0,s.Y)(g.A,{size:11,className:"text-success"}):(0,s.Y)(k.A,{size:11})]})]})]}),(n||r)&&(0,s.Y)("div",{className:"mt-2",children:(0,s.Y)(w,{commit:t,onAction:o})}),t.files&&t.files.length>0&&(0,s.Y)("div",{className:"mt-2 flex flex-col gap-1",children:t.files.map((e,n)=>{let a=c(t.hash,e.file),r=`${t.hash}:${e.file}`,i=void 0!==h[r]?h[r]:e.diff,o=d(t.hash,e.file),p="A"===e.status?"text-success font-bold":"D"===e.status?"text-error font-bold":"R"===e.status?"text-meta font-bold":"text-info font-bold";return(0,s.FD)("div",{className:"flex flex-col",children:[(0,s.FD)("div",{onClick:n=>{n.stopPropagation(),l(t.hash,e)},className:"flex items-center gap-2 py-1 px-2 rounded hover:bg-ink/5 text-[11.5px] font-mono text-ink/80 transition-colors group cursor-pointer border border-transparent hover:border-ink/10",children:[(0,s.Y)("span",{className:`w-3.5 text-center flex-shrink-0 text-[11px] ${p}`,children:e.status||"M"}),(0,s.Y)("span",{className:"truncate flex-1 min-w-0 text-ink/90 group-hover:text-ink font-medium",children:e.file}),(0,s.FD)("span",{className:"flex items-center gap-1 text-[10.5px] tabular-nums flex-shrink-0 font-medium",children:[(0,s.FD)("span",{className:"text-success",children:["+",e.additions]}),(0,s.Y)("span",{className:"text-ink/30",children:"/"}),(0,s.FD)("span",{className:"text-error",children:["-",e.deletions]})]}),(0,s.Y)("span",{className:"text-ink/40 group-hover:text-ink flex-shrink-0",children:a?(0,s.Y)(v.A,{size:13}):(0,s.Y)(y.A,{size:13})})]}),a&&(0,s.Y)("div",{className:"pl-4 pr-1",children:(0,s.Y)(A,{diffText:i,isLoading:o,filePath:e.file})})]},n)})})]})})}let D=[{hash:"8f8ca583e7162b190f898394e1e3ad81472a1290",shortHash:"8f8ca583",author:"Wijarnako Putra Rajeb",date:"Sep 10, 2026, 12:40 PM",message:"feat(chat): persist composer draft and attachments per session",parents:["6d3bac50"],refs:["HEAD -> main","origin/main"],lane:0,files:[{file:"app/hooks/chat/timeline/index.ts",status:"M",additions:3,deletions:2,diff:`@@ -7,6 +7,7 @@
|
|
3
3
|
import { useChatTimelineActions } from '@/client/hooks/chat/timeline/actions';
|
|
4
4
|
import { useChatTimelineSend } from '@/client/hooks/chat/timeline/send';
|
|
5
5
|
import { normalizeNoticePositions } from '@/shared/lib/chat/order';
|
|
@@ -25,4 +25,4 @@
|
|
|
25
25
|
.env.*
|
|
26
26
|
!.env.example
|
|
27
27
|
.git
|
|
28
|
-
2 unmodified lines`},{file:"docker-compose.yml",status:"M",additions:5,deletions:0}]},{hash:"008cbe0711112222333344445555666677778888",shortHash:"008cbe07",author:"Wijarnako Putra Rajeb",date:"Sep 1, 2026, 01:25 PM",message:"feat(logging): structured timestamped logging across all web flows, bridged to docker logs",parents:["81ad44d5","b3b71ed5"],refs:["origin/feat/whatsapp-notification","feat/whatsapp-notification"],lane:0,files:[{file:"server.ts",status:"M",additions:19,deletions:3}]},{hash:"81ad44d522223333444455556666777788889999",shortHash:"81ad44d5",author:"Wijarnako Putra Rajeb",date:"Sep 1, 2026, 01:07 PM",message:"WIP on main: b3b71ed fix(pbpmd): history modal reads live BOFIS API instead of sqlite cache",parents:["9616fad9"],refs:["refs/stash"],lane:1,files:[{file:"app/routes/api/pb-pmd/$id.history.ts",status:"M",additions:22,deletions:6}]},{hash:"9616fad933334444555566667777888899990000",shortHash:"9616fad9",author:"Wijarnako Putra Rajeb",date:"Sep 1, 2026, 01:07 PM",message:"index on main: b3b71ed fix(pbpmd): history modal reads live BOFIS API instead of sqlite cache",parents:["b3b71ed5"],lane:1,files:[{file:"app/routes/api/pb-pmd/$id.history.ts",status:"M",additions:15,deletions:4}]},{hash:"b3b71ed544445555666677778888999900001111",shortHash:"b3b71ed5",author:"Wijarnako Putra Rajeb",date:"Sep 1, 2026, 12:55 PM",message:"fix(pbpmd): history modal reads live BOFIS API instead of sqlite cache",parents:["4dc73776"],lane:0,files:[{file:"app/routes/api/pb-pmd/$id.history.ts",status:"M",additions:8,deletions:12}]},{hash:"4dc7377655556666777788889999000011112222",shortHash:"4dc73776",author:"Wijarnako Putra Rajeb",date:"Sep 1, 2026, 12:50 PM",message:"feat(ui): 13th KPI card TOTAL MANDAYS + gapless 6-col dashboard grid",parents:["acab6465"],lane:0,files:[{file:"app/components/dashboard/KPIGrid.tsx",status:"M",additions:35,deletions:7}]},{hash:"acab646566667777888899990000111122223333",shortHash:"acab6465",author:"Wijarnako Putra Rajeb",date:"Sep 1, 2026, 12:45 PM",message:"feat(pbpmd): history modal table layout, wider modal, drop edit scenario action",parents:["86a6d6c5"],lane:0,files:[{file:"app/components/pbpmd/HistoryModal.tsx",status:"M",additions:24,deletions:18}]},{hash:"86a6d6c577778888999900001111222233334444",shortHash:"86a6d6c5",author:"Wijarnako Putra Rajeb",date:"Sep 1, 2026, 12:45 PM",message:"feat(pbpmd): pb history modal reads sqlite cache via /api/pb-pmd/:id/history",parents:["9ffea446"],lane:0,files:[{file:"app/routes/api/pb-pmd/$id.history.ts",status:"M",additions:42,deletions:5}]},{hash:"9ffea44688889999000011112222333344445555",shortHash:"9ffea446",author:"Wijarnako Putra Rajeb",date:"Sep 1, 2026, 12:45 PM",message:"feat(dashboard): crdApproved threshold shifted 5 minutes from history date_end",parents:[],lane:0,files:[{file:"app/lib/dashboard/calculator.ts",status:"M",additions:12,deletions:2}]}];function M(e){let{output:t,onClose:n,onRefresh:r,onExecuteAction:i,rootPath:o,activeRepo:c}=e;if(!t)return null;let d=t.title.toLowerCase().includes("graph"),[h,p]=(0,a.J0)(d),[f,u]=(0,a.J0)(""),[g,k]=(0,a.J0)(""),[v,y]=(0,a.J0)(!1),{commits:w,hasMore:N,totalCount:Y,isLoadingMore:C,handleLoadMore:A}=function(e){let{output:t,isGraphMode:n,rootPath:s,activeRepo:r}=e,[i,o]=(0,a.J0)(!1),[l,c]=(0,a.J0)(t?.hasMore??t?.data?.length===50),[d,h]=(0,a.J0)(t?.total),p=(0,a.Kr)(()=>{let e=t?.data||[];return 0===e.length?D:e[0]&&"object"==typeof e[0]&&("hash"in e[0]||"shortHash"in e[0])?e.map(e=>({hash:e.hash||e.shortHash||"unknown",shortHash:e.shortHash||(e.hash?e.hash.slice(0,8):"unknown"),author:e.author||"Unknown",date:e.date||e.time||"",message:e.message||"",parents:Array.isArray(e.parents)?e.parents:[],refs:Array.isArray(e.refs)?e.refs:[],files:Array.isArray(e.files)?e.files:[],lane:"number"==typeof e.lane?e.lane:void 0})):D},[t?.data]),[m,f]=(0,a.J0)(p);(0,a.vJ)(()=>{f(p),c(t?.hasMore??t?.data?.length===50),"number"==typeof t?.total&&h(t.total)},[p,t?.hasMore,t?.data?.length,t?.total]);let u=(0,a.hb)(async()=>{if(!i&&l){o(!0);try{let e=new FormData;e.set("actionType",n?"graph":"history"),e.set("limit","50"),e.set("skip",String(m.length)),s&&e.set("root",s),r&&e.set("repo",r);let t=await fetch("/api/fs/git",{method:"POST",body:e}),a=await t.json();if(a.success&&Array.isArray(a.data)){let e=a.data.map(e=>({hash:e.hash||e.shortHash||"unknown",shortHash:e.shortHash||(e.hash?e.hash.slice(0,8):"unknown"),author:e.author||"Unknown",date:e.date||e.time||"",message:e.message||"",parents:Array.isArray(e.parents)?e.parents:[],refs:Array.isArray(e.refs)?e.refs:[],files:Array.isArray(e.files)?e.files:[],lane:"number"==typeof e.lane?e.lane:void 0}));f(t=>{let n=new Set(t.map(e=>e.hash));return[...t,...e.filter(e=>!n.has(e.hash))]}),c(!!(a.hasMore??50===e.length)),"number"==typeof a.total&&h(a.total)}else c(!1)}catch(e){console.error("Failed to load more commits:",e)}finally{o(!1)}}},[i,l,n,m.length,s,r]);return{commits:m,setCommits:f,hasMore:l,totalCount:d,isLoadingMore:i,handleLoadMore:u}}({output:t,isGraphMode:h,rootPath:o,activeRepo:c}),{fileDiffs:M,expandedFiles:S,loadingFiles:j,handleToggleFile:P,handleCommitAction:$}=function(e){let{onExecuteAction:t,rootPath:n,activeRepo:s}=e,[r,i]=(0,a.J0)({}),[o,l]=(0,a.J0)(new Set),[c,d]=(0,a.J0)(new Set),h=(0,a.hb)(async(e,t)=>{let a=`${e}:${t.file}`,c=o.has(a);if(l(e=>{let t=new Set(e);return t.has(a)?t.delete(a):t.add(a),t}),!c&&void 0===r[a]&&!t.diff){d(e=>new Set(e).add(a));try{let r=new FormData;r.set("actionType","commit_diff"),r.set("hash",e),r.set("file",t.file),n&&r.set("root",n),s&&"."!==s&&r.set("repo",s);let o=await fetch("/api/fs/git",{method:"POST",body:r}),l=await o.json();l&&"string"==typeof l.diff?i(e=>({...e,[a]:l.diff})):l&&l.error&&i(e=>({...e,[a]:`// Error: ${l.error}`}))}catch(e){console.error("Failed to load file diff:",e),i(t=>({...t,[a]:`// Error loading diff: ${e?.message||"Network error"}`}))}finally{d(e=>{let t=new Set(e);return t.delete(a),t})}}},[o,r,n,s]);return{fileDiffs:r,expandedFiles:o,loadingFiles:c,handleToggleFile:h,handleCommitAction:(0,a.hb)((e,n)=>{if(t)if("checkout"===e)t("checkout",void 0,{branch:n.hash});else if("create_branch_here"===e){let e=window.prompt(`Create new branch at commit ${n.shortHash}:`,`branch-${n.shortHash}`);e?.trim()&&t("create_branch",void 0,{branch:e.trim()})}else if("cherry_pick"===e)window.confirm(`Cherry-pick commit ${n.shortHash} onto current branch?`)&&t("cherry_pick",void 0,{hash:n.hash});else if("revert"===e)window.confirm(`Revert commit ${n.shortHash}?`)&&t("revert_commit",void 0,{hash:n.hash});else if("reset"===e){let e=window.prompt(`Reset current branch to ${n.shortHash} (soft, mixed, hard):`,"soft");e&&["soft","mixed","hard"].includes(e.toLowerCase())&&t("reset_commit",void 0,{hash:n.hash,mode:e.toLowerCase()})}else"merge"===e?window.confirm(`Merge commit ${n.shortHash} into current branch?`)&&t("merge_commit",void 0,{hash:n.hash}):"rebase"===e&&window.confirm(`Rebase current branch onto commit ${n.shortHash}?`)&&t("rebase_commit",void 0,{hash:n.hash})},[t])}}({onExecuteAction:i,rootPath:o,activeRepo:c});(0,a.vJ)(()=>{w.length>0&&!g&&k(w[0].hash)},[w,g]);let z=(0,a.Kr)(()=>{if(!f.trim())return w;let e=f.toLowerCase().trim();return w.filter(t=>t.message.toLowerCase().includes(e)||t.author.toLowerCase().includes(e)||t.shortHash.toLowerCase().includes(e)||t.hash.toLowerCase().includes(e)||t.refs?.some(t=>t.toLowerCase().includes(e)))},[w,f]),H=(0,a.li)(null),R=(0,a.li)(null),L=(0,a.li)(null),W=(0,a.li)({}),[J,T]=(0,a.J0)({}),[O,E]=(0,a.J0)(800);(0,a.vJ)(()=>{let e=L.current;if(!e||!N||C||f.trim())return;let t=new IntersectionObserver(e=>{e[0].isIntersecting&&A()},{root:H.current,threshold:.1});return t.observe(e),()=>t.disconnect()},[N,C,f,A]);let K=(0,a.hb)(()=>{if(!H.current||!R.current)return;let e=H.current.getBoundingClientRect(),t=H.current.scrollTop,n={};z.forEach((s,a)=>{let r=W.current[s.hash];if(r){let a=r.getBoundingClientRect();n[s.hash]=a.top+a.height/2-e.top+t}else n[s.hash]=60*a+20}),T(n),E(Math.max(R.current.offsetHeight,H.current.clientHeight,600))},[z]);(0,a.Nf)(()=>{K();let e=requestAnimationFrame(()=>{K()});return()=>cancelAnimationFrame(e)},[K,z,M,S,h]),(0,a.vJ)(()=>{let e=R.current;if(!e)return;let t=new ResizeObserver(()=>{K()});return t.observe(e),()=>t.disconnect()},[K]);let I=(0,a.Kr)(()=>x(z),[z]),_=(0,a.Kr)(()=>{let e=0;return I.forEach(t=>{t>e&&(e=t)}),e},[I]),B=h?(_+1)*18+32:36,G=async()=>{y(!0),r&&await r(),setTimeout(()=>y(!1),600)};return(0,s.Y)("div",{className:"fixed inset-0 z-50 bg-canvas/80 backdrop-blur-xs flex items-center justify-center p-0 lg:p-5",onClick:n,role:"dialog","aria-modal":"true",children:(0,s.FD)("div",{className:"bg-paper border-ink/20 shadow-2xl flex flex-col overflow-hidden\n w-full h-full rounded-none border-0\n lg:w-[min(96vw,980px)] lg:h-[88vh] lg:rounded-xl lg:border\n pt-[env(safe-area-inset-top,0px)] lg:pt-0",onClick:e=>e.stopPropagation(),children:[(0,s.Y)(m,{isGraphMode:h,onToggleMode:p,searchQuery:f,onSearchChange:u,onRefresh:G,onClose:n,isRefreshing:v,totalCommits:z.length,totalCount:Y}),(0,s.Y)("div",{ref:H,className:"flex-1 overflow-y-auto scrollbar-overlay-container relative select-text",children:0===z.length?(0,s.Y)("div",{className:"flex flex-col items-center justify-center py-20 text-ink/40 font-mono text-xs",children:"No matching commits found."}):(0,s.FD)("div",{className:"relative min-h-full pb-8",children:[(0,s.Y)(b,{commits:z,nodePositions:J,selectedHash:g,isGraphMode:h,laneWidth:18,paddingLeft:16,totalHeight:O}),(0,s.FD)("div",{ref:R,className:"flex flex-col relative z-20",style:{paddingLeft:`${B}px`},children:[z.map(e=>(0,s.Y)(F,{commit:e,isSelected:g===e.hash,isGraphMode:h,onSelect:e=>k(e.hash),onAction:$,onToggleFile:P,isExpandedFile:(e,t)=>S.has(`${e}:${t}`),isLoadingFile:(e,t)=>j.has(`${e}:${t}`),fileDiffs:M,headerRef:t=>{W.current[e.hash]=t}},e.hash)),(0,s.Y)("div",{ref:L,className:"pt-3 pb-4 px-4 flex items-center justify-center",children:C?(0,s.FD)("div",{className:"flex items-center gap-2 text-xs text-ink/60 font-mono py-2",children:[(0,s.Y)(l.A,{size:14,className:"animate-spin text-info"}),(0,s.Y)("span",{children:"Loading more commits..."})]}):N&&!f.trim()?(0,s.Y)("button",{type:"button",onClick:A,className:"px-3 py-1.5 text-xs font-mono text-ink/70 hover:text-ink bg-ink/5 hover:bg-ink/10 rounded-md border border-ink/10 transition-colors cursor-pointer",children:"Load more commits..."}):z.length>10?(0,s.FD)("div",{className:"text-[11px] font-mono text-ink/40 py-2",children:["End of commit history (",z.length," commits)"]}):null})]})]})})]})})}function S(e){let{children:t,onClose:n,wide:a}=e;return(0,s.Y)("div",{className:"fixed inset-0 z-50 bg-canvas/80 flex items-center justify-center p-4",onClick:n,role:"dialog","aria-modal":"true",children:(0,s.Y)("div",{className:`bg-paper border border-ink/20 rounded-lg shadow-xl flex flex-col overflow-hidden ${a?"w-[min(94vw,680px)] max-h-[82vh]":"w-[min(94vw,420px)] max-h-[80vh]"}`,onClick:e=>e.stopPropagation(),children:t})})}function j(e){let{modal:t,onClose:n,onConfirm:a}=e;return t?(0,s.FD)(S,{onClose:n,children:[(0,s.FD)("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-ink/10",children:[(0,s.Y)(i.A,{size:16,className:"text-error flex-shrink-0"}),(0,s.Y)("h3",{className:"text-sm font-semibold text-ink",children:"Confirm Action"})]}),(0,s.Y)("div",{className:"px-4 py-4 text-xs text-ink/80 leading-relaxed",children:t.message}),(0,s.FD)("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-ink/10",children:[(0,s.Y)("button",{type:"button",onClick:n,className:"px-3 py-1.5 rounded border border-ink/20 text-ink/70 hover:bg-ink/5 hover:text-ink transition-colors cursor-pointer text-xs",children:"Cancel"}),(0,s.Y)("button",{type:"button",onClick:a,className:"px-3 py-1.5 rounded bg-error text-canvas hover:bg-error/90 transition-colors cursor-pointer text-xs font-medium",children:"Confirm"})]})]}):null}function P(e){let{isOpen:t,branchName:n,inputRef:r,onChange:i,onClose:l,onCreate:c}=e;if(!t)return null;let d=(0,a.hb)(()=>{n.trim()&&c()},[n,c]);return(0,s.FD)(S,{onClose:l,children:[(0,s.FD)("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-ink/10",children:[(0,s.Y)(o.A,{size:16,className:"text-ink/60 flex-shrink-0"}),(0,s.Y)("h3",{className:"text-sm font-semibold text-ink",children:"Create New Branch"})]}),(0,s.Y)("div",{className:"px-4 py-4",children:(0,s.Y)("input",{ref:r,type:"text",value:n,onChange:e=>i(e.currentTarget.value),onKeyDown:e=>{"Enter"===e.key&&d(),"Escape"===e.key&&l()},placeholder:"branch-name",className:"w-full bg-canvas border border-ink/20 rounded px-3 py-2 text-xs focus:outline-none focus:border-ink/40 text-ink placeholder-ink/40 transition-colors"})}),(0,s.FD)("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-ink/10",children:[(0,s.Y)("button",{type:"button",onClick:l,className:"px-3 py-1.5 rounded border border-ink/20 text-ink/70 hover:bg-ink/5 hover:text-ink transition-colors cursor-pointer text-xs",children:"Cancel"}),(0,s.Y)("button",{type:"button",onClick:d,disabled:!n.trim(),className:"px-3 py-1.5 rounded bg-ink text-canvas hover:bg-ink/90 transition-colors cursor-pointer text-xs font-medium disabled:opacity-40 disabled:cursor-not-allowed",children:"Create"})]})]})}function $(e){let{message:t,hasStagedChanges:n,isBusy:a=!1,onChangeMessage:r,onCommit:i}=e,o=n&&t.trim().length>0&&!a;return(0,s.FD)("div",{className:"border-t border-ink/10 bg-canvas/50 p-3 flex flex-col gap-2",children:[(0,s.Y)("textarea",{value:t,onChange:e=>r(e.currentTarget.value),onKeyDown:e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&o&&(e.preventDefault(),i())},placeholder:"Commit message (⌘/Ctrl+Enter to commit)",rows:5,className:"w-full resize-y min-h-[100px] max-h-[200px] bg-paper border border-ink/20 rounded px-2.5 py-1.5 text-xs text-ink placeholder-ink/40 focus:outline-none focus:border-ink/40 transition-colors font-mono"}),(0,s.FD)("button",{type:"button",onClick:i,disabled:!o,title:n?"Commit staged changes":"Stage changes first",className:"flex items-center justify-center gap-1.5 px-3 py-1.5 rounded bg-ink text-canvas hover:bg-ink/90 transition-colors cursor-pointer text-xs font-medium disabled:opacity-40 disabled:cursor-not-allowed",children:[(0,s.Y)(g.A,{size:12}),"Commit"]})]})}var z=n("vZ"),H=n("r"),R=n("nV"),L=n("Sj"),W=n("y");let J=(0,W.A)({name:"list",size:24,node:[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]}),T=(0,W.A)({name:"folder-tree",size:24,node:[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]});function O(e){let{branchRef:t,showBranchMenu:n,setShowBranchMenu:a,branch:r,branches:i,remoteBranches:l,onCheckout:d,onOpenBranchPrompt:h,optionsRef:p,showOptions:m,setShowOptions:f,onHistory:u,onGraph:x,viewMode:b,setViewMode:k,isBusy:y=!1,syncCount:w={ahead:0,behind:0},onSync:N}=e;return(0,s.FD)("div",{className:"p-3 border-b border-ink/10 bg-canvas/50 flex items-center justify-between",children:[(0,s.FD)("div",{className:"relative",ref:t,children:[(0,s.FD)("button",{onClick:()=>a(!n),className:"flex items-center space-x-1.5 hover:bg-ink/5 px-2 py-1 -ml-2 rounded transition-colors text-[11px] text-ink/80 font-medium",children:[(0,s.Y)(z.A,{size:12,className:"text-ink/60"}),(0,s.Y)("span",{className:"truncate max-w-[140px]",children:r}),(0,s.Y)(v.A,{size:12,className:"text-ink/40"})]}),n&&(0,s.Y)("div",{className:"absolute top-full left-0 mt-1 w-48 bg-paper border border-ink/20 rounded-md shadow-lg z-50 flex flex-col overflow-hidden text-xs",children:(0,s.FD)("div",{className:"max-h-48 scrollbar-overlay-container scrollbar-overlay-static py-1",children:[i.length>0&&(0,s.FD)(s.FK,{children:[(0,s.Y)("div",{className:"px-3 py-1 text-[9px] uppercase tracking-wider text-ink/40 font-semibold",children:"Local"}),i.map(e=>(0,s.FD)("button",{onClick:()=>{d(e),a(!1)},className:"w-full text-left px-3 py-2 hover:bg-ink/5 flex items-center justify-between transition-colors",children:[(0,s.Y)("span",{className:"truncate",children:e}),r===e&&(0,s.Y)(g.A,{size:12,className:"text-ink"})]},e))]}),l.length>0&&(0,s.FD)(s.FK,{children:[(0,s.Y)("div",{className:"px-3 py-1 text-[9px] uppercase tracking-wider text-ink/40 font-semibold",children:"Remote"}),l.map(e=>(0,s.FD)("button",{onClick:()=>{d(e),a(!1)},className:"w-full text-left px-3 py-2 hover:bg-ink/5 flex items-center justify-between transition-colors",children:[(0,s.Y)("span",{className:"truncate",children:e}),r===e&&(0,s.Y)(g.A,{size:12,className:"text-ink"})]},e))]}),(0,s.Y)("div",{className:"w-full h-px bg-ink/10 my-1"}),(0,s.FD)("button",{onClick:()=>{h(),a(!1)},className:"w-full text-left px-3 py-2 hover:bg-ink/5 flex items-center space-x-2 transition-colors text-ink/80 italic",children:[(0,s.Y)(H.A,{size:12}),(0,s.Y)("span",{children:"Create new branch..."})]})]})})]}),(0,s.FD)("div",{className:"flex items-center space-x-2 text-ink/40 relative",ref:p,children:[(0,s.FD)("button",{type:"button",onClick:N,disabled:y||0===w.ahead&&0===w.behind,title:w.ahead>0&&w.behind>0?`Pull ${w.behind} then push ${w.ahead} commit(s)`:w.ahead>0?`Push ${w.ahead} commit(s)`:w.behind>0?`Pull ${w.behind} commit(s)`:"Up to date",className:"flex items-center gap-1 p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:[(0,s.Y)(R.A,{size:13}),(0,s.FD)("span",{className:"font-mono tabular-nums text-[10px]",children:["↑",w.ahead," ↓",w.behind]})]}),(0,s.Y)("button",{type:"button",onClick:u,title:"Commit History",className:"p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors",children:(0,s.Y)(c.A,{size:13})}),(0,s.Y)("button",{type:"button",onClick:x,title:"Git Graph",className:"p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors",children:(0,s.Y)(o.A,{size:13})}),(0,s.Y)("button",{type:"button",onClick:()=>f(!m),title:"View Options",className:"p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors",children:(0,s.Y)(L.A,{size:13})}),m&&(0,s.FD)("div",{className:"absolute right-0 top-full mt-1 w-36 bg-paper border border-ink/15 rounded-md shadow-lg z-50 py-1 font-mono text-xs",children:[(0,s.FD)("button",{type:"button",onClick:()=>{k("flat"),f(!1)},className:"w-full px-3 py-1.5 text-left text-ink hover:bg-ink/5 flex items-center justify-between transition-colors",children:[(0,s.FD)("div",{className:"flex items-center space-x-1.5",children:[(0,s.Y)(J,{size:12,className:"text-ink/60"}),(0,s.Y)("span",{children:"View as List"})]}),"flat"===b&&(0,s.Y)(g.A,{size:12,className:"text-ink"})]}),(0,s.FD)("button",{type:"button",onClick:()=>{k("tree"),f(!1)},className:"w-full px-3 py-1.5 text-left text-ink hover:bg-ink/5 flex items-center justify-between transition-colors",children:[(0,s.FD)("div",{className:"flex items-center space-x-1.5",children:[(0,s.Y)(T,{size:12,className:"text-ink/60"}),(0,s.Y)("span",{children:"View as Tree"})]}),"tree"===b&&(0,s.Y)(g.A,{size:12,className:"text-ink"})]})]})]})]})}var E=n("rm"),K=n("I"),I=n("FL");function _(e){let{repoRef:t,showRepoMenu:n,setShowRepoMenu:a,activeRepo:r,repos:i,isLoading:o,rootPath:l,reposScanning:c,onSelectRepo:d,onRefresh:h,onRefreshRepos:m}=e,[f,u]=(0,I.bL)("git.repoQuery",""),x=function(e){if(!e)return"workspace root";let t=e.replace(/\\/g,"/").split("/").filter(Boolean);return t.length>0?t[t.length-1]:"workspace root"}(l),b=e=>"."===e?x:e,k=i.filter(e=>!f.trim()||b(e).toLowerCase().includes(f.toLowerCase()));return(0,s.FD)("div",{className:"p-3 border-b border-ink/10 flex items-center justify-between",children:[(0,s.FD)("div",{className:"relative",ref:t,children:[(0,s.FD)("button",{onClick:()=>a(!n),className:"flex items-center space-x-1.5 hover:bg-ink/5 px-2 py-1 -ml-2 rounded transition-colors text-xs text-ink/80 font-medium",children:[(0,s.Y)(E.A,{size:12,className:"text-ink/60"}),(0,s.FD)("span",{className:"flex items-center space-x-1 truncate max-w-[150px]",children:[(0,s.Y)("span",{className:"text-ink/50 font-normal uppercase tracking-wider text-[10px]",children:"GIT"}),(0,s.Y)("span",{className:"text-ink/30",children:"•"}),(0,s.Y)("span",{children:"."===r?x:r.split("/").pop()})]}),(0,s.Y)(v.A,{size:12,className:"text-ink/40"})]}),n&&(0,s.FD)("div",{className:"absolute top-full left-0 mt-1 w-52 bg-paper border border-ink/20 rounded-md shadow-lg z-50 flex flex-col overflow-hidden text-xs",children:[(0,s.FD)("div",{className:"px-2 py-1.5 border-b border-ink/10 flex items-center space-x-1.5",children:[(0,s.Y)(p.A,{size:11,className:"text-ink/40 flex-shrink-0"}),(0,s.Y)("input",{type:"text",value:f,onChange:e=>u(e.currentTarget.value),placeholder:"Search repos...",title:"Search repositories",className:"w-full bg-transparent outline-none text-xs text-ink placeholder-ink/40",autoFocus:!0}),f&&(0,s.Y)("button",{type:"button",onClick:()=>u(""),title:"Clear search",className:"text-ink/40 hover:text-ink flex-shrink-0",children:"×"}),(0,s.Y)("button",{type:"button",onClick:m,title:"Refresh nested repos",disabled:c,className:"text-ink/40 hover:text-ink flex-shrink-0 transition-colors disabled:opacity-40 disabled:hover:text-ink/40",children:(0,s.Y)(K.A,{size:11,className:c?"animate-spin":""})})]}),(0,s.Y)("div",{className:"max-h-48 scrollbar-overlay-container scrollbar-overlay-static py-1",children:0===k.length?(0,s.Y)("div",{className:"px-3 py-2 text-ink/40 italic",children:"No repos found"}):k.map(e=>(0,s.FD)("button",{onClick:()=>{d(e),a(!1),u("")},title:b(e),className:"w-full text-left px-3 py-2 hover:bg-ink/5 flex items-center justify-between transition-colors",children:[(0,s.Y)("span",{className:"truncate",children:b(e)}),r===e&&(0,s.Y)(g.A,{size:12,className:"text-ink"})]},e))})]})]}),(0,s.Y)("div",{className:"flex space-x-2 text-ink/40",children:(0,s.Y)("button",{type:"button",onClick:h,title:"Refresh",className:"hover:text-ink cursor-pointer inline-flex",children:(0,s.Y)(K.A,{size:14,className:o?"animate-spin":""})})})]})}var B=n("DV"),G=n("Ih"),V=n("cx"),U=n("LQ");function q(e){let{change:t,isStaged:n,repo:a,rootPath:r,onAction:i}=e,o=(0,U.R)(t.status,n),l=o.charStatus,c=o.colorClass,d=t.file.split("/"),h=d.pop()||t.file,p=d.length>0?d.join("/"):"";return(0,s.FD)("div",{className:"flex items-center justify-between px-3 py-1 hover:bg-ink/5 cursor-pointer group text-[11px] transition-colors",onClick:()=>{window.dispatchEvent(new CustomEvent("omp:open-diff",{detail:{file:t.file,staged:n,status:l,repo:a||".",root:r}}))},children:[(0,s.FD)("div",{className:"flex items-center space-x-1.5 flex-1 min-w-0 pr-2",children:[(0,s.Y)("span",{className:`font-bold font-mono text-[9px] w-3 flex-shrink-0 text-center ${c}`,title:`Status: ${o.label}`,children:l}),(0,s.Y)(V.o,{name:h,size:12,className:"flex-shrink-0"}),(0,s.Y)("span",{className:`truncate ${c}`,title:t.file,children:h}),p&&(0,s.Y)("span",{className:"text-[9px] text-ink/40 truncate ml-1",children:p})]}),(0,s.Y)("div",{className:"flex items-center space-x-1 text-ink/40 flex-shrink-0",children:(0,s.FD)("div",{className:"flex items-center opacity-0 group-hover:opacity-100 space-x-1",children:[!n&&(0,s.FD)(s.FK,{children:[(0,s.Y)("button",{type:"button",onClick:()=>i("revert",t.file),title:"Discard Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:(0,s.Y)(G.A,{size:11})}),(0,s.Y)("button",{type:"button",onClick:()=>i("stage",t.file),title:"Stage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:(0,s.Y)(H.A,{size:11})})]}),n&&(0,s.Y)("button",{type:"button",onClick:()=>i("unstage",t.file),title:"Unstage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:(0,s.Y)(B.A,{size:11})})]})})]})}function Q(e){let{node:t,isStaged:n,isFolderOpen:a,toggleFolder:r,onAction:i,depth:o=0,repo:l,rootPath:c}=e,d="folder"===t.type,h=!!d&&a(t.id);if(d)return(0,s.FD)("div",{className:"select-none",children:[(0,s.FD)("div",{className:"flex items-center justify-between px-2 py-1 hover:bg-ink/5 cursor-pointer rounded group transition-colors text-[11px]",onClick:()=>r(t.id),children:[(0,s.FD)("div",{className:"flex items-center space-x-1.5 flex-1 min-w-0 pr-1",children:[(0,s.Y)("span",{className:"w-3.5 h-3.5 flex items-center justify-center text-ink/40 flex-shrink-0",children:h?(0,s.Y)(v.A,{size:12}):(0,s.Y)(y.A,{size:12})}),(0,s.Y)(V.o,{name:t.name,isFolder:!0,isOpen:h,size:13,className:"flex-shrink-0"}),(0,s.Y)("span",{className:"font-medium text-ink truncate",children:t.name}),(0,s.Y)("span",{className:"text-[9px] text-ink/40 font-normal px-1 py-0.2 bg-ink/5 rounded-full ml-1",children:t.changeCount})]}),(0,s.Y)("div",{className:"flex items-center space-x-1 text-ink/40 flex-shrink-0",children:(0,s.Y)("div",{className:"flex items-center opacity-0 group-hover:opacity-100 space-x-1",children:n?(0,s.Y)("button",{type:"button",onClick:e=>{e.stopPropagation(),i("unstage",t.path)},title:`Unstage ${t.name}`,className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:(0,s.Y)(B.A,{size:11})}):(0,s.FD)(s.FK,{children:[(0,s.Y)("button",{type:"button",onClick:e=>{e.stopPropagation(),i("revert",t.path)},title:`Discard changes in ${t.name}`,className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:(0,s.Y)(G.A,{size:11})}),(0,s.Y)("button",{type:"button",onClick:e=>{e.stopPropagation(),i("stage",t.path)},title:`Stage ${t.name}`,className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:(0,s.Y)(H.A,{size:11})})]})})})]}),h&&t.children&&t.children.length>0&&(0,s.Y)("div",{className:"ml-3 border-l border-ink/10 pl-1",children:t.children.map(e=>(0,s.Y)(Q,{node:e,isStaged:n,isFolderOpen:a,toggleFolder:r,onAction:i,depth:o+1,repo:l,rootPath:c},e.id))})]});let p=t.change,m=(0,U.R)(p?.status||"M",n),f=m.charStatus,u=m.colorClass,x=p?p.file:t.path;return(0,s.FD)("div",{className:"flex items-center justify-between px-2 py-0.5 hover:bg-ink/5 cursor-pointer rounded group transition-colors text-[11px]",onClick:()=>{window.dispatchEvent(new CustomEvent("omp:open-diff",{detail:{file:x,staged:n,status:f,repo:l||".",root:c}}))},children:[(0,s.FD)("div",{className:"flex items-center space-x-1.5 flex-1 min-w-0 pr-1",children:[(0,s.Y)("span",{className:"w-3.5 h-3.5 flex items-center justify-center flex-shrink-0",children:(0,s.Y)("span",{className:`font-bold font-mono text-[9px] ${u}`,title:`Status: ${m.label}`,children:f})}),(0,s.Y)(V.o,{name:t.name,size:12,className:"flex-shrink-0"}),(0,s.Y)("span",{className:`truncate ${u}`,title:x,children:t.name})]}),(0,s.Y)("div",{className:"flex items-center space-x-1 text-ink/40 flex-shrink-0",children:(0,s.Y)("div",{className:"flex items-center opacity-0 group-hover:opacity-100 space-x-1",children:n?(0,s.Y)("button",{type:"button",onClick:()=>i("unstage",x),title:"Unstage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:(0,s.Y)(B.A,{size:11})}):(0,s.FD)(s.FK,{children:[(0,s.Y)("button",{type:"button",onClick:()=>i("revert",x),title:"Discard Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:(0,s.Y)(G.A,{size:11})}),(0,s.Y)("button",{type:"button",onClick:()=>i("stage",x),title:"Stage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:(0,s.Y)(H.A,{size:11})})]})})})]})}function Z(e){let{changes:t,isStaged:n,repo:r,rootPath:i,onAction:o}=e,{tree:l,isFolderOpen:c,toggleFolder:d}=function(e){let{sessionId:t,ready:n,read:s}=(0,I.p0)(),r=(0,a.Kr)(()=>(function(e){let t={id:"",name:"",path:"",type:"folder",children:[],changeCount:0};for(let n of e){let e=n.file.replace(/^[./]+/,""),s=e.endsWith("/"),a=e.replace(/\/$/,"").split("/").filter(Boolean),r=t,i="";for(let e=0;e<a.length;e++){let t=a[e];i=i?`${i}/${t}`:t;let o=e===a.length-1;if(o&&!s)r.children.push({id:i,name:t,path:i,type:"file",change:n,children:[],changeCount:1});else{let e=r.children.find(e=>"folder"===e.type&&e.name===t);e||(e={id:i,name:t,path:i,type:"folder",children:[],changeCount:0,change:o&&s?n:void 0},r.children.push(e)),r=e}}}return!function e(t){if("file"===t.type)return 1;let n=+!!t.change;for(let s of t.children)n+=e(s);return t.changeCount=n,t.children.sort((e,t)=>"folder"===e.type&&"file"===t.type?-1:"file"===e.type&&"folder"===t.type?1:e.name.localeCompare(t.name)),n}(t),t.children})(e),[e]),i=(0,a.Kr)(()=>{let e=new Set;return!function t(n){for(let s of n)"folder"===s.type&&(e.add(s.id),s.children&&s.children.length>0&&t(s.children))}(r),e},[r]),[o,l]=(0,I.bL)("git.expandedFolders",[]),c=(0,a.Kr)(()=>new Set(o),[o]),d=(0,a.li)(null);(0,a.vJ)(()=>{!n||d.current===t||0===i.size||(d.current=t,s("git.expandedFolders",[]).length>0||l(Array.from(i)))},[n,t,i,s,l]);let h=(0,a.hb)(e=>{l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),Array.from(n)})},[l]),p=(0,a.hb)(e=>c.has(e),[c]);return{tree:r,expandedFolders:c,toggleFolder:h,isFolderOpen:p,expandAll:()=>l(Array.from(i)),collapseAll:()=>l([])}}(t);return 0===l.length?null:(0,s.Y)("div",{className:"py-0.5",children:l.map(e=>(0,s.Y)(Q,{node:e,isStaged:n,isFolderOpen:c,toggleFolder:d,onAction:o,repo:r,rootPath:i},e.id))})}function X(e){let{changes:t,isLoading:n,viewMode:a,repo:r,rootPath:i,onAction:o}=e,[l,c]=(0,I.bL)("git.stagedExpanded",!0),[d,h]=(0,I.bL)("git.unstagedExpanded",!0),p=t.filter(e=>{let t=e.status;return t&&" "!==t[0]&&"?"!==t[0]}),m=t.filter(e=>{let t=e.status;return t&&" "!==t[1]&&"?"!==t[1]||"??"===t});return n&&0===t.length?(0,s.Y)("div",{className:"flex-1 scrollbar-overlay-container scrollbar-overlay-static font-mono text-[11px] text-ink/80",children:(0,s.Y)("div",{className:"p-4 text-center text-ink/40 italic",children:"Loading..."})}):0===t.length?(0,s.Y)("div",{className:"flex-1 scrollbar-overlay-container scrollbar-overlay-static font-mono text-[11px] text-ink/80",children:(0,s.Y)("div",{className:"p-4 text-center text-ink/40 italic",children:"No changes found."})}):(0,s.Y)("div",{className:"flex-1 scrollbar-overlay-container scrollbar-overlay-static font-mono text-[11px] text-ink/80",children:(0,s.FD)("div",{className:"py-1",children:[p.length>0&&(0,s.FD)("div",{className:"mb-2",children:[(0,s.FD)("div",{className:"flex items-center justify-between px-3 py-1 group hover:bg-ink/5 cursor-pointer transition-colors",onClick:()=>c(!l),children:[(0,s.FD)("div",{className:"flex items-center space-x-1 font-semibold text-ink text-xs",children:[(0,s.Y)("span",{className:"w-3 text-center",children:l?"▾":"▸"}),(0,s.Y)("span",{children:"Staged Changes"}),(0,s.Y)("span",{className:"text-ink/40 font-normal ml-1 border border-ink/20 rounded-full px-1.5 text-[9px] bg-paper",children:p.length})]}),(0,s.Y)("div",{className:"opacity-0 group-hover:opacity-100 flex items-center space-x-1 text-ink/40 flex-shrink-0",children:(0,s.Y)("button",{type:"button",onClick:e=>{e.stopPropagation(),o("unstage_all")},title:"Unstage All Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:(0,s.Y)(B.A,{size:12})})})]}),l&&("tree"===a?(0,s.Y)(Z,{changes:p,isStaged:!0,repo:r,rootPath:i,onAction:o}):p.map(e=>(0,s.Y)(q,{change:e,isStaged:!0,repo:r,rootPath:i,onAction:o},e.file+"staged")))]}),m.length>0&&(0,s.FD)("div",{children:[(0,s.FD)("div",{className:"flex items-center justify-between px-3 py-1 group hover:bg-ink/5 cursor-pointer transition-colors",onClick:()=>h(!d),children:[(0,s.FD)("div",{className:"flex items-center space-x-1 font-semibold text-ink text-xs",children:[(0,s.Y)("span",{className:"w-3 text-center",children:d?"▾":"▸"}),(0,s.Y)("span",{children:"Changes"}),(0,s.Y)("span",{className:"text-ink/40 font-normal ml-1 border border-ink/20 rounded-full px-1.5 text-[9px] bg-paper",children:m.length})]}),(0,s.FD)("div",{className:"opacity-0 group-hover:opacity-100 flex items-center space-x-1 text-ink/40 flex-shrink-0",children:[(0,s.Y)("button",{type:"button",onClick:e=>{e.stopPropagation(),o("revert_all")},title:"Discard All Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:(0,s.Y)(G.A,{size:12})}),(0,s.Y)("button",{type:"button",onClick:e=>{e.stopPropagation(),o("stage_all")},title:"Stage All Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:(0,s.Y)(H.A,{size:12})})]})]}),d&&("tree"===a?(0,s.Y)(Z,{changes:m,isStaged:!1,repo:r,rootPath:i,onAction:o}):m.map(e=>(0,s.Y)(q,{change:e,isStaged:!1,repo:r,rootPath:i,onAction:o},e.file+"unstaged")))]})]})})}var ee=n("wu"),et=n("oZ"),en=n("Af"),es=n("oj");function ea(e){let{className:t="",enabled:n=!0,rootPath:i,refreshKey:o=0}=e,l=(0,r.L)(),c=(0,r.L)(),[d,h,p]=(0,I.bL)("git.activeRepo","."),m=l.data?.activeRepo||d||".",f=e=>{if(!n)return;let t=void 0!==e?e:d,s=new URLSearchParams;i&&s.set("root",i),t&&"."!==t&&s.set("repo",t),s.set("t",String(Date.now())),l.load(`/api/fs/git?${s.toString()}`)},[u,x]=(0,I.bL)("git.commitDraft",""),[b,g]=(0,I.bL)("git.viewMode","flat"),[k,v]=(0,a.J0)(!1),y=(0,a.li)(null),[w,N]=(0,a.J0)(!1),Y=(0,a.li)(null),[C,A]=(0,a.J0)(!1),F=(0,a.li)(null),[D,S]=(0,a.J0)(null),[z,H]=(0,a.J0)(!1),[R,L]=(0,a.J0)(""),W=(0,a.li)(null),[J,T]=(0,a.J0)(null),[E,K]=(0,a.J0)(!1),{toasts:B,pushToast:G,dismissToast:V}=(0,et.Y)(),[U,q]=(0,a.J0)(null),[Q,Z]=(0,a.J0)(!1),[ea,er]=(0,a.J0)(!1);(0,a.vJ)(()=>{K(!0)},[]),(0,a.vJ)(()=>{p&&f(d)},[o,i,n,p]),(0,en.n)(()=>f(d),n&&p),(0,en.w)(()=>f(d),n&&p),(0,a.vJ)(()=>{l.data?.activeRepo&&l.data.activeRepo!==d&&h(l.data.activeRepo)},[l.data?.activeRepo,d,h]),(0,a.vJ)(()=>{l.data?.reposPending&&Z(!0)},[l.data]),(0,a.vJ)(()=>{ea&&l.data&&!l.data.reposPending&&Array.isArray(l.data.repos)&&(q(l.data.repos),er(!1))},[l.data,ea]),(0,a.vJ)(()=>{if(!Q)return;let e=new URLSearchParams({reposOnly:"1"});i&&e.set("root",i);let t=setInterval(async()=>{let t=await fetch(`/api/fs/git?${e.toString()}`).then(e=>e.json()).catch(()=>null);t&&!t.reposPending&&Array.isArray(t.repos)&&(q(t.repos),Z(!1),er(!1),f(d))},1500);return()=>clearInterval(t)},[Q,i,d]),(0,a.vJ)(()=>{z&&W.current&&W.current.focus()},[z]),(0,a.vJ)(()=>{"idle"===c.state&&c.data&&("history"===c.data.type?T({title:"Commit History",data:c.data.data||[]}):"graph"===c.data.type?T({title:"Git Graph",data:c.data.data||[]}):c.data.success?f(m):G(c.data.error||"Git operation failed"))},[c.state,c.data]),(0,es.W)(y,()=>v(!1)),(0,es.W)(Y,()=>N(!1)),(0,es.W)(F,()=>A(!1));let ei=(e,t,n)=>{let s=new FormData;s.append("actionType",e),s.append("repo",m),i&&s.append("root",i),t&&s.append("file",t),n&&Object.entries(n).forEach(e=>{let[t,n]=e;return s.append(t,n)}),c.submit(s,{method:"POST",action:"/api/fs/git"}),"commit"===e&&x("")},eo=l.data?.branch||"main",el=l.data?.branches||["main"],ec=l.data?.remoteBranches||[],ed=U??(l.data?.repos||["."]),eh=l.data?.changes||[],ep="loading"===l.state||"idle"!==c.state,em=eh.filter(e=>{let t=e.status;return t&&" "!==t[0]&&"?"!==t[0]});return n?(0,s.FD)("div",{className:`flex flex-col h-full bg-paper relative ${t}`,children:[E&&(0,s.FD)(s.FK,{children:[(0,s.Y)(j,{modal:D,onClose:()=>S(null),onConfirm:()=>{D&&(ei(D.type,D.file),S(null))}}),(0,s.Y)(P,{isOpen:z,branchName:R,inputRef:W,onChange:L,onClose:()=>{H(!1),L("")},onCreate:()=>{R.trim()&&(ei("create_branch",void 0,{branch:R.trim()}),H(!1),L(""))}}),(0,s.Y)(M,{output:J,onClose:()=>T(null),onRefresh:()=>{J&&ei(J.title.toLowerCase().includes("graph")?"graph":"history")},onExecuteAction:(e,t,n)=>ei(e,t,n),rootPath:i,activeRepo:m})]}),(0,s.Y)(ee.y,{toasts:B,onDismiss:V}),(0,s.Y)(_,{repoRef:Y,showRepoMenu:w,setShowRepoMenu:N,activeRepo:m,repos:ed,isLoading:ep,rootPath:i,reposScanning:Q||ea,onSelectRepo:e=>{h(e),f(e)},onRefresh:()=>f(m),onRefreshRepos:()=>{if(!n||Q||ea)return;q(ed),er(!0);let e=new URLSearchParams({rescan:"1"});i&&e.set("root",i),"."!==m&&e.set("repo",m),e.set("t",String(Date.now())),l.load(`/api/fs/git?${e.toString()}`)}}),(0,s.Y)(O,{branchRef:F,showBranchMenu:C,setShowBranchMenu:A,branch:eo,branches:el,remoteBranches:ec,onCheckout:e=>ei("checkout",void 0,{branch:e}),onOpenBranchPrompt:()=>H(!0),optionsRef:y,showOptions:k,setShowOptions:v,onHistory:()=>ei("history"),onGraph:()=>ei("graph"),viewMode:b,setViewMode:g,isBusy:ep,syncCount:l.data?.syncCount,onSync:()=>ei("sync")}),(0,s.Y)($,{message:u,hasStagedChanges:em.length>0,isBusy:ep,onChangeMessage:x,onCommit:()=>ei("commit",void 0,{message:u})}),(0,s.Y)(X,{changes:eh,isLoading:ep,viewMode:b,repo:m,rootPath:i,onAction:(e,t,n)=>{"revert"===e?S({type:e,file:t,message:`Are you sure you want to discard changes in ${t}?`}):"revert_all"===e?S({type:e,message:"Are you sure you want to discard ALL unstaged changes? This cannot be undone."}):ei(e,t,n)}})]}):(0,s.Y)("div",{className:`flex flex-col h-full bg-paper items-center justify-center text-ink/40 ${t}`,children:(0,s.Y)("span",{className:"text-xs font-mono",children:"No session selected"})})}},rm(e,t,n){let s=(0,n("y").A)({name:"folder-git-2",size:24,node:[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]});n.d(t,{},{A:s})},Wb0(e,t,n){let s=(0,n("y").A)({name:"rotate-cw",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]});n.d(t,{},{A:s})}}]);
|
|
28
|
+
2 unmodified lines`},{file:"docker-compose.yml",status:"M",additions:5,deletions:0}]},{hash:"008cbe0711112222333344445555666677778888",shortHash:"008cbe07",author:"Wijarnako Putra Rajeb",date:"Sep 1, 2026, 01:25 PM",message:"feat(logging): structured timestamped logging across all web flows, bridged to docker logs",parents:["81ad44d5","b3b71ed5"],refs:["origin/feat/whatsapp-notification","feat/whatsapp-notification"],lane:0,files:[{file:"server.ts",status:"M",additions:19,deletions:3}]},{hash:"81ad44d522223333444455556666777788889999",shortHash:"81ad44d5",author:"Wijarnako Putra Rajeb",date:"Sep 1, 2026, 01:07 PM",message:"WIP on main: b3b71ed fix(pbpmd): history modal reads live BOFIS API instead of sqlite cache",parents:["9616fad9"],refs:["refs/stash"],lane:1,files:[{file:"app/routes/api/pb-pmd/$id.history.ts",status:"M",additions:22,deletions:6}]},{hash:"9616fad933334444555566667777888899990000",shortHash:"9616fad9",author:"Wijarnako Putra Rajeb",date:"Sep 1, 2026, 01:07 PM",message:"index on main: b3b71ed fix(pbpmd): history modal reads live BOFIS API instead of sqlite cache",parents:["b3b71ed5"],lane:1,files:[{file:"app/routes/api/pb-pmd/$id.history.ts",status:"M",additions:15,deletions:4}]},{hash:"b3b71ed544445555666677778888999900001111",shortHash:"b3b71ed5",author:"Wijarnako Putra Rajeb",date:"Sep 1, 2026, 12:55 PM",message:"fix(pbpmd): history modal reads live BOFIS API instead of sqlite cache",parents:["4dc73776"],lane:0,files:[{file:"app/routes/api/pb-pmd/$id.history.ts",status:"M",additions:8,deletions:12}]},{hash:"4dc7377655556666777788889999000011112222",shortHash:"4dc73776",author:"Wijarnako Putra Rajeb",date:"Sep 1, 2026, 12:50 PM",message:"feat(ui): 13th KPI card TOTAL MANDAYS + gapless 6-col dashboard grid",parents:["acab6465"],lane:0,files:[{file:"app/components/dashboard/KPIGrid.tsx",status:"M",additions:35,deletions:7}]},{hash:"acab646566667777888899990000111122223333",shortHash:"acab6465",author:"Wijarnako Putra Rajeb",date:"Sep 1, 2026, 12:45 PM",message:"feat(pbpmd): history modal table layout, wider modal, drop edit scenario action",parents:["86a6d6c5"],lane:0,files:[{file:"app/components/pbpmd/HistoryModal.tsx",status:"M",additions:24,deletions:18}]},{hash:"86a6d6c577778888999900001111222233334444",shortHash:"86a6d6c5",author:"Wijarnako Putra Rajeb",date:"Sep 1, 2026, 12:45 PM",message:"feat(pbpmd): pb history modal reads sqlite cache via /api/pb-pmd/:id/history",parents:["9ffea446"],lane:0,files:[{file:"app/routes/api/pb-pmd/$id.history.ts",status:"M",additions:42,deletions:5}]},{hash:"9ffea44688889999000011112222333344445555",shortHash:"9ffea446",author:"Wijarnako Putra Rajeb",date:"Sep 1, 2026, 12:45 PM",message:"feat(dashboard): crdApproved threshold shifted 5 minutes from history date_end",parents:[],lane:0,files:[{file:"app/lib/dashboard/calculator.ts",status:"M",additions:12,deletions:2}]}];function M(e){let{output:t,onClose:n,onRefresh:r,onExecuteAction:i,rootPath:o,activeRepo:c}=e;if(!t)return null;let d=t.title.toLowerCase().includes("graph"),[h,p]=(0,a.J0)(d),[f,u]=(0,a.J0)(""),[g,k]=(0,a.J0)(""),[v,y]=(0,a.J0)(!1),{commits:w,hasMore:N,totalCount:Y,isLoadingMore:C,handleLoadMore:A}=function(e){let{output:t,isGraphMode:n,rootPath:s,activeRepo:r}=e,[i,o]=(0,a.J0)(!1),[l,c]=(0,a.J0)(t?.hasMore??t?.data?.length===50),[d,h]=(0,a.J0)(t?.total),p=(0,a.Kr)(()=>{let e=t?.data||[];return 0===e.length?D:e[0]&&"object"==typeof e[0]&&("hash"in e[0]||"shortHash"in e[0])?e.map(e=>({hash:e.hash||e.shortHash||"unknown",shortHash:e.shortHash||(e.hash?e.hash.slice(0,8):"unknown"),author:e.author||"Unknown",date:e.date||e.time||"",message:e.message||"",parents:Array.isArray(e.parents)?e.parents:[],refs:Array.isArray(e.refs)?e.refs:[],files:Array.isArray(e.files)?e.files:[],lane:"number"==typeof e.lane?e.lane:void 0})):D},[t?.data]),[m,f]=(0,a.J0)(p);(0,a.vJ)(()=>{f(p),c(t?.hasMore??t?.data?.length===50),"number"==typeof t?.total&&h(t.total)},[p,t?.hasMore,t?.data?.length,t?.total]);let u=(0,a.hb)(async()=>{if(!i&&l){o(!0);try{let e=new FormData;e.set("actionType",n?"graph":"history"),e.set("limit","50"),e.set("skip",String(m.length)),s&&e.set("root",s),r&&e.set("repo",r);let t=await fetch("/api/fs/git",{method:"POST",body:e}),a=await t.json();if(a.success&&Array.isArray(a.data)){let e=a.data.map(e=>({hash:e.hash||e.shortHash||"unknown",shortHash:e.shortHash||(e.hash?e.hash.slice(0,8):"unknown"),author:e.author||"Unknown",date:e.date||e.time||"",message:e.message||"",parents:Array.isArray(e.parents)?e.parents:[],refs:Array.isArray(e.refs)?e.refs:[],files:Array.isArray(e.files)?e.files:[],lane:"number"==typeof e.lane?e.lane:void 0}));f(t=>{let n=new Set(t.map(e=>e.hash));return[...t,...e.filter(e=>!n.has(e.hash))]}),c(!!(a.hasMore??50===e.length)),"number"==typeof a.total&&h(a.total)}else c(!1)}catch(e){console.error("Failed to load more commits:",e)}finally{o(!1)}}},[i,l,n,m.length,s,r]);return{commits:m,setCommits:f,hasMore:l,totalCount:d,isLoadingMore:i,handleLoadMore:u}}({output:t,isGraphMode:h,rootPath:o,activeRepo:c}),{fileDiffs:M,expandedFiles:S,loadingFiles:j,handleToggleFile:P,handleCommitAction:$}=function(e){let{onExecuteAction:t,rootPath:n,activeRepo:s}=e,[r,i]=(0,a.J0)({}),[o,l]=(0,a.J0)(new Set),[c,d]=(0,a.J0)(new Set),h=(0,a.hb)(async(e,t)=>{let a=`${e}:${t.file}`,c=o.has(a);if(l(e=>{let t=new Set(e);return t.has(a)?t.delete(a):t.add(a),t}),!c&&void 0===r[a]&&!t.diff){d(e=>new Set(e).add(a));try{let r=new FormData;r.set("actionType","commit_diff"),r.set("hash",e),r.set("file",t.file),n&&r.set("root",n),s&&"."!==s&&r.set("repo",s);let o=await fetch("/api/fs/git",{method:"POST",body:r}),l=await o.json();l&&"string"==typeof l.diff?i(e=>({...e,[a]:l.diff})):l&&l.error&&i(e=>({...e,[a]:`// Error: ${l.error}`}))}catch(e){console.error("Failed to load file diff:",e),i(t=>({...t,[a]:`// Error loading diff: ${e?.message||"Network error"}`}))}finally{d(e=>{let t=new Set(e);return t.delete(a),t})}}},[o,r,n,s]);return{fileDiffs:r,expandedFiles:o,loadingFiles:c,handleToggleFile:h,handleCommitAction:(0,a.hb)((e,n)=>{if(t)if("checkout"===e)t("checkout",void 0,{branch:n.hash});else if("create_branch_here"===e){let e=window.prompt(`Create new branch at commit ${n.shortHash}:`,`branch-${n.shortHash}`);e?.trim()&&t("create_branch",void 0,{branch:e.trim()})}else if("cherry_pick"===e)window.confirm(`Cherry-pick commit ${n.shortHash} onto current branch?`)&&t("cherry_pick",void 0,{hash:n.hash});else if("revert"===e)window.confirm(`Revert commit ${n.shortHash}?`)&&t("revert_commit",void 0,{hash:n.hash});else if("reset"===e){let e=window.prompt(`Reset current branch to ${n.shortHash} (soft, mixed, hard):`,"soft");e&&["soft","mixed","hard"].includes(e.toLowerCase())&&t("reset_commit",void 0,{hash:n.hash,mode:e.toLowerCase()})}else"merge"===e?window.confirm(`Merge commit ${n.shortHash} into current branch?`)&&t("merge_commit",void 0,{hash:n.hash}):"rebase"===e&&window.confirm(`Rebase current branch onto commit ${n.shortHash}?`)&&t("rebase_commit",void 0,{hash:n.hash})},[t])}}({onExecuteAction:i,rootPath:o,activeRepo:c});(0,a.vJ)(()=>{w.length>0&&!g&&k(w[0].hash)},[w,g]);let z=(0,a.Kr)(()=>{if(!f.trim())return w;let e=f.toLowerCase().trim();return w.filter(t=>t.message.toLowerCase().includes(e)||t.author.toLowerCase().includes(e)||t.shortHash.toLowerCase().includes(e)||t.hash.toLowerCase().includes(e)||t.refs?.some(t=>t.toLowerCase().includes(e)))},[w,f]),H=(0,a.li)(null),R=(0,a.li)(null),L=(0,a.li)(null),W=(0,a.li)({}),[J,T]=(0,a.J0)({}),[O,E]=(0,a.J0)(800);(0,a.vJ)(()=>{let e=L.current;if(!e||!N||C||f.trim())return;let t=new IntersectionObserver(e=>{e[0].isIntersecting&&A()},{root:H.current,threshold:.1});return t.observe(e),()=>t.disconnect()},[N,C,f,A]);let K=(0,a.hb)(()=>{if(!H.current||!R.current)return;let e=H.current.getBoundingClientRect(),t=H.current.scrollTop,n={};z.forEach((s,a)=>{let r=W.current[s.hash];if(r){let a=r.getBoundingClientRect();n[s.hash]=a.top+a.height/2-e.top+t}else n[s.hash]=60*a+20}),T(n),E(Math.max(R.current.offsetHeight,H.current.clientHeight,600))},[z]);(0,a.Nf)(()=>{K();let e=requestAnimationFrame(()=>{K()});return()=>cancelAnimationFrame(e)},[K,z,M,S,h]),(0,a.vJ)(()=>{let e=R.current;if(!e)return;let t=new ResizeObserver(()=>{K()});return t.observe(e),()=>t.disconnect()},[K]);let I=(0,a.Kr)(()=>x(z),[z]),_=(0,a.Kr)(()=>{let e=0;return I.forEach(t=>{t>e&&(e=t)}),e},[I]),B=h?(_+1)*18+32:36,G=async()=>{y(!0),r&&await r(),setTimeout(()=>y(!1),600)};return(0,s.Y)("div",{className:"fixed inset-0 z-50 bg-canvas/80 backdrop-blur-xs flex items-center justify-center p-0 lg:p-5",onClick:n,role:"dialog","aria-modal":"true",children:(0,s.FD)("div",{className:"bg-paper border-ink/20 shadow-2xl flex flex-col overflow-hidden\n w-full h-full rounded-none border-0\n lg:w-[min(96vw,980px)] lg:h-[88vh] lg:rounded-xl lg:border\n pt-[env(safe-area-inset-top,0px)] lg:pt-0",onClick:e=>e.stopPropagation(),children:[(0,s.Y)(m,{isGraphMode:h,onToggleMode:p,searchQuery:f,onSearchChange:u,onRefresh:G,onClose:n,isRefreshing:v,totalCommits:z.length,totalCount:Y}),(0,s.Y)("div",{ref:H,className:"flex-1 overflow-y-auto scrollbar-overlay-container relative select-text",children:0===z.length?(0,s.Y)("div",{className:"flex flex-col items-center justify-center py-20 text-ink/40 font-mono text-xs",children:"No matching commits found."}):(0,s.FD)("div",{className:"relative min-h-full pb-8",children:[(0,s.Y)(b,{commits:z,nodePositions:J,selectedHash:g,isGraphMode:h,laneWidth:18,paddingLeft:16,totalHeight:O}),(0,s.FD)("div",{ref:R,className:"flex flex-col relative z-20",style:{paddingLeft:`${B}px`},children:[z.map(e=>(0,s.Y)(F,{commit:e,isSelected:g===e.hash,isGraphMode:h,onSelect:e=>k(e.hash),onAction:$,onToggleFile:P,isExpandedFile:(e,t)=>S.has(`${e}:${t}`),isLoadingFile:(e,t)=>j.has(`${e}:${t}`),fileDiffs:M,headerRef:t=>{W.current[e.hash]=t}},e.hash)),(0,s.Y)("div",{ref:L,className:"pt-3 pb-4 px-4 flex items-center justify-center",children:C?(0,s.FD)("div",{className:"flex items-center gap-2 text-xs text-ink/60 font-mono py-2",children:[(0,s.Y)(l.A,{size:14,className:"animate-spin text-info"}),(0,s.Y)("span",{children:"Loading more commits..."})]}):N&&!f.trim()?(0,s.Y)("button",{type:"button",onClick:A,className:"px-3 py-1.5 text-xs font-mono text-ink/70 hover:text-ink bg-ink/5 hover:bg-ink/10 rounded-md border border-ink/10 transition-colors cursor-pointer",children:"Load more commits..."}):z.length>10?(0,s.FD)("div",{className:"text-[11px] font-mono text-ink/40 py-2",children:["End of commit history (",z.length," commits)"]}):null})]})]})})]})})}function S(e){let{children:t,onClose:n,wide:a}=e;return(0,s.Y)("div",{className:"fixed inset-0 z-50 bg-canvas/80 flex items-center justify-center p-4",onClick:n,role:"dialog","aria-modal":"true",children:(0,s.Y)("div",{className:`bg-paper border border-ink/20 rounded-lg shadow-xl flex flex-col overflow-hidden ${a?"w-[min(94vw,680px)] max-h-[82vh]":"w-[min(94vw,420px)] max-h-[80vh]"}`,onClick:e=>e.stopPropagation(),children:t})})}function j(e){let{modal:t,onClose:n,onConfirm:a}=e;return t?(0,s.FD)(S,{onClose:n,children:[(0,s.FD)("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-ink/10",children:[(0,s.Y)(i.A,{size:16,className:"text-error flex-shrink-0"}),(0,s.Y)("h3",{className:"text-sm font-semibold text-ink",children:"Confirm Action"})]}),(0,s.Y)("div",{className:"px-4 py-4 text-xs text-ink/80 leading-relaxed",children:t.message}),(0,s.FD)("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-ink/10",children:[(0,s.Y)("button",{type:"button",onClick:n,className:"px-3 py-1.5 rounded border border-ink/20 text-ink/70 hover:bg-ink/5 hover:text-ink transition-colors cursor-pointer text-xs",children:"Cancel"}),(0,s.Y)("button",{type:"button",onClick:a,className:"px-3 py-1.5 rounded bg-error text-canvas hover:bg-error/90 transition-colors cursor-pointer text-xs font-medium",children:"Confirm"})]})]}):null}function P(e){let{isOpen:t,branchName:n,inputRef:r,onChange:i,onClose:l,onCreate:c}=e;if(!t)return null;let d=(0,a.hb)(()=>{n.trim()&&c()},[n,c]);return(0,s.FD)(S,{onClose:l,children:[(0,s.FD)("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-ink/10",children:[(0,s.Y)(o.A,{size:16,className:"text-ink/60 flex-shrink-0"}),(0,s.Y)("h3",{className:"text-sm font-semibold text-ink",children:"Create New Branch"})]}),(0,s.Y)("div",{className:"px-4 py-4",children:(0,s.Y)("input",{ref:r,type:"text",value:n,onChange:e=>i(e.currentTarget.value),onKeyDown:e=>{"Enter"===e.key&&d(),"Escape"===e.key&&l()},placeholder:"branch-name",className:"w-full bg-canvas border border-ink/20 rounded px-3 py-2 text-xs focus:outline-none focus:border-ink/40 text-ink placeholder-ink/40 transition-colors"})}),(0,s.FD)("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-ink/10",children:[(0,s.Y)("button",{type:"button",onClick:l,className:"px-3 py-1.5 rounded border border-ink/20 text-ink/70 hover:bg-ink/5 hover:text-ink transition-colors cursor-pointer text-xs",children:"Cancel"}),(0,s.Y)("button",{type:"button",onClick:d,disabled:!n.trim(),className:"px-3 py-1.5 rounded bg-ink text-canvas hover:bg-ink/90 transition-colors cursor-pointer text-xs font-medium disabled:opacity-40 disabled:cursor-not-allowed",children:"Create"})]})]})}function $(e){let{message:t,hasStagedChanges:n,isBusy:a=!1,onChangeMessage:r,onCommit:i}=e,o=n&&t.trim().length>0&&!a;return(0,s.FD)("div",{className:"border-t border-ink/10 bg-canvas/50 p-3 flex flex-col gap-2",children:[(0,s.Y)("textarea",{value:t,onChange:e=>r(e.currentTarget.value),onKeyDown:e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&o&&(e.preventDefault(),i())},placeholder:"Commit message (⌘/Ctrl+Enter to commit)",rows:5,className:"w-full resize-y min-h-[100px] max-h-[200px] bg-paper border border-ink/20 rounded px-2.5 py-1.5 text-xs text-ink placeholder-ink/40 focus:outline-none focus:border-ink/40 transition-colors font-mono"}),(0,s.FD)("button",{type:"button",onClick:i,disabled:!o,title:n?"Commit staged changes":"Stage changes first",className:"flex items-center justify-center gap-1.5 px-3 py-1.5 rounded bg-ink text-canvas hover:bg-ink/90 transition-colors cursor-pointer text-xs font-medium disabled:opacity-40 disabled:cursor-not-allowed",children:[(0,s.Y)(g.A,{size:12}),"Commit"]})]})}var z=n("vZ"),H=n("r"),R=n("n"),L=n("Sj"),W=n("y");let J=(0,W.A)({name:"list",size:24,node:[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]}),T=(0,W.A)({name:"folder-tree",size:24,node:[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]});function O(e){let{branchRef:t,showBranchMenu:n,setShowBranchMenu:a,branch:r,branches:i,remoteBranches:l,onCheckout:d,onOpenBranchPrompt:h,optionsRef:p,showOptions:m,setShowOptions:f,onHistory:u,onGraph:x,viewMode:b,setViewMode:k,isBusy:y=!1,syncCount:w={ahead:0,behind:0},onSync:N}=e;return(0,s.FD)("div",{className:"p-3 border-b border-ink/10 bg-canvas/50 flex items-center justify-between",children:[(0,s.FD)("div",{className:"relative",ref:t,children:[(0,s.FD)("button",{onClick:()=>a(!n),className:"flex items-center space-x-1.5 hover:bg-ink/5 px-2 py-1 -ml-2 rounded transition-colors text-[11px] text-ink/80 font-medium",children:[(0,s.Y)(z.A,{size:12,className:"text-ink/60"}),(0,s.Y)("span",{className:"truncate max-w-[140px]",children:r}),(0,s.Y)(v.A,{size:12,className:"text-ink/40"})]}),n&&(0,s.Y)("div",{className:"absolute top-full left-0 mt-1 w-48 bg-paper border border-ink/20 rounded-md shadow-lg z-50 flex flex-col overflow-hidden text-xs",children:(0,s.FD)("div",{className:"max-h-48 scrollbar-overlay-container scrollbar-overlay-static py-1",children:[i.length>0&&(0,s.FD)(s.FK,{children:[(0,s.Y)("div",{className:"px-3 py-1 text-[9px] uppercase tracking-wider text-ink/40 font-semibold",children:"Local"}),i.map(e=>(0,s.FD)("button",{onClick:()=>{d(e),a(!1)},className:"w-full text-left px-3 py-2 hover:bg-ink/5 flex items-center justify-between transition-colors",children:[(0,s.Y)("span",{className:"truncate",children:e}),r===e&&(0,s.Y)(g.A,{size:12,className:"text-ink"})]},e))]}),l.length>0&&(0,s.FD)(s.FK,{children:[(0,s.Y)("div",{className:"px-3 py-1 text-[9px] uppercase tracking-wider text-ink/40 font-semibold",children:"Remote"}),l.map(e=>(0,s.FD)("button",{onClick:()=>{d(e),a(!1)},className:"w-full text-left px-3 py-2 hover:bg-ink/5 flex items-center justify-between transition-colors",children:[(0,s.Y)("span",{className:"truncate",children:e}),r===e&&(0,s.Y)(g.A,{size:12,className:"text-ink"})]},e))]}),(0,s.Y)("div",{className:"w-full h-px bg-ink/10 my-1"}),(0,s.FD)("button",{onClick:()=>{h(),a(!1)},className:"w-full text-left px-3 py-2 hover:bg-ink/5 flex items-center space-x-2 transition-colors text-ink/80 italic",children:[(0,s.Y)(H.A,{size:12}),(0,s.Y)("span",{children:"Create new branch..."})]})]})})]}),(0,s.FD)("div",{className:"flex items-center space-x-2 text-ink/40 relative",ref:p,children:[(0,s.FD)("button",{type:"button",onClick:N,disabled:y||0===w.ahead&&0===w.behind,title:w.ahead>0&&w.behind>0?`Pull ${w.behind} then push ${w.ahead} commit(s)`:w.ahead>0?`Push ${w.ahead} commit(s)`:w.behind>0?`Pull ${w.behind} commit(s)`:"Up to date",className:"flex items-center gap-1 p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:[(0,s.Y)(R.A,{size:13}),(0,s.FD)("span",{className:"font-mono tabular-nums text-[10px]",children:["↑",w.ahead," ↓",w.behind]})]}),(0,s.Y)("button",{type:"button",onClick:u,title:"Commit History",className:"p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors",children:(0,s.Y)(c.A,{size:13})}),(0,s.Y)("button",{type:"button",onClick:x,title:"Git Graph",className:"p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors",children:(0,s.Y)(o.A,{size:13})}),(0,s.Y)("button",{type:"button",onClick:()=>f(!m),title:"View Options",className:"p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors",children:(0,s.Y)(L.A,{size:13})}),m&&(0,s.FD)("div",{className:"absolute right-0 top-full mt-1 w-36 bg-paper border border-ink/15 rounded-md shadow-lg z-50 py-1 font-mono text-xs",children:[(0,s.FD)("button",{type:"button",onClick:()=>{k("flat"),f(!1)},className:"w-full px-3 py-1.5 text-left text-ink hover:bg-ink/5 flex items-center justify-between transition-colors",children:[(0,s.FD)("div",{className:"flex items-center space-x-1.5",children:[(0,s.Y)(J,{size:12,className:"text-ink/60"}),(0,s.Y)("span",{children:"View as List"})]}),"flat"===b&&(0,s.Y)(g.A,{size:12,className:"text-ink"})]}),(0,s.FD)("button",{type:"button",onClick:()=>{k("tree"),f(!1)},className:"w-full px-3 py-1.5 text-left text-ink hover:bg-ink/5 flex items-center justify-between transition-colors",children:[(0,s.FD)("div",{className:"flex items-center space-x-1.5",children:[(0,s.Y)(T,{size:12,className:"text-ink/60"}),(0,s.Y)("span",{children:"View as Tree"})]}),"tree"===b&&(0,s.Y)(g.A,{size:12,className:"text-ink"})]})]})]})]})}var E=n("rm"),K=n("Ir"),I=n("FL");function _(e){let{repoRef:t,showRepoMenu:n,setShowRepoMenu:a,activeRepo:r,repos:i,isLoading:o,rootPath:l,reposScanning:c,onSelectRepo:d,onRefresh:h,onRefreshRepos:m}=e,[f,u]=(0,I.bL)("git.repoQuery",""),x=function(e){if(!e)return"workspace root";let t=e.replace(/\\/g,"/").split("/").filter(Boolean);return t.length>0?t[t.length-1]:"workspace root"}(l),b=e=>"."===e?x:e,k=i.filter(e=>!f.trim()||b(e).toLowerCase().includes(f.toLowerCase()));return(0,s.FD)("div",{className:"p-3 border-b border-ink/10 flex items-center justify-between",children:[(0,s.FD)("div",{className:"relative",ref:t,children:[(0,s.FD)("button",{onClick:()=>a(!n),className:"flex items-center space-x-1.5 hover:bg-ink/5 px-2 py-1 -ml-2 rounded transition-colors text-xs text-ink/80 font-medium",children:[(0,s.Y)(E.A,{size:12,className:"text-ink/60"}),(0,s.FD)("span",{className:"flex items-center space-x-1 truncate max-w-[150px]",children:[(0,s.Y)("span",{className:"text-ink/50 font-normal uppercase tracking-wider text-[10px]",children:"GIT"}),(0,s.Y)("span",{className:"text-ink/30",children:"•"}),(0,s.Y)("span",{children:"."===r?x:r.split("/").pop()})]}),(0,s.Y)(v.A,{size:12,className:"text-ink/40"})]}),n&&(0,s.FD)("div",{className:"absolute top-full left-0 mt-1 w-52 bg-paper border border-ink/20 rounded-md shadow-lg z-50 flex flex-col overflow-hidden text-xs",children:[(0,s.FD)("div",{className:"px-2 py-1.5 border-b border-ink/10 flex items-center space-x-1.5",children:[(0,s.Y)(p.A,{size:11,className:"text-ink/40 flex-shrink-0"}),(0,s.Y)("input",{type:"text",value:f,onChange:e=>u(e.currentTarget.value),placeholder:"Search repos...",title:"Search repositories",className:"w-full bg-transparent outline-none text-xs text-ink placeholder-ink/40",autoFocus:!0}),f&&(0,s.Y)("button",{type:"button",onClick:()=>u(""),title:"Clear search",className:"text-ink/40 hover:text-ink flex-shrink-0",children:"×"}),(0,s.Y)("button",{type:"button",onClick:m,title:"Refresh nested repos",disabled:c,className:"text-ink/40 hover:text-ink flex-shrink-0 transition-colors disabled:opacity-40 disabled:hover:text-ink/40",children:(0,s.Y)(K.A,{size:11,className:c?"animate-spin":""})})]}),(0,s.Y)("div",{className:"max-h-48 scrollbar-overlay-container scrollbar-overlay-static py-1",children:0===k.length?(0,s.Y)("div",{className:"px-3 py-2 text-ink/40 italic",children:"No repos found"}):k.map(e=>(0,s.FD)("button",{onClick:()=>{d(e),a(!1),u("")},title:b(e),className:"w-full text-left px-3 py-2 hover:bg-ink/5 flex items-center justify-between transition-colors",children:[(0,s.Y)("span",{className:"truncate",children:b(e)}),r===e&&(0,s.Y)(g.A,{size:12,className:"text-ink"})]},e))})]})]}),(0,s.Y)("div",{className:"flex space-x-2 text-ink/40",children:(0,s.Y)("button",{type:"button",onClick:h,title:"Refresh",className:"hover:text-ink cursor-pointer inline-flex",children:(0,s.Y)(K.A,{size:14,className:o?"animate-spin":""})})})]})}var B=n("DV"),G=n("I"),V=n("ob"),U=n("LQ");function q(e){let{change:t,isStaged:n,repo:a,rootPath:r,onAction:i}=e,o=(0,U.R)(t.status,n),l=o.charStatus,c=o.colorClass,d=t.file.split("/"),h=d.pop()||t.file,p=d.length>0?d.join("/"):"";return(0,s.FD)("div",{className:"flex items-center justify-between px-3 py-1 hover:bg-ink/5 cursor-pointer group text-[11px] transition-colors",onClick:()=>{window.dispatchEvent(new CustomEvent("omp:open-diff",{detail:{file:t.file,staged:n,status:l,repo:a||".",root:r}}))},children:[(0,s.FD)("div",{className:"flex items-center space-x-1.5 flex-1 min-w-0 pr-2",children:[(0,s.Y)("span",{className:`font-bold font-mono text-[9px] w-3 flex-shrink-0 text-center ${c}`,title:`Status: ${o.label}`,children:l}),(0,s.Y)(V.o,{name:h,size:12,className:"flex-shrink-0"}),(0,s.Y)("span",{className:`truncate ${c}`,title:t.file,children:h}),p&&(0,s.Y)("span",{className:"text-[9px] text-ink/40 truncate ml-1",children:p})]}),(0,s.Y)("div",{className:"flex items-center space-x-1 text-ink/40 flex-shrink-0",children:(0,s.FD)("div",{className:"flex items-center opacity-0 group-hover:opacity-100 space-x-1",children:[!n&&(0,s.FD)(s.FK,{children:[(0,s.Y)("button",{type:"button",onClick:()=>i("revert",t.file),title:"Discard Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:(0,s.Y)(G.A,{size:11})}),(0,s.Y)("button",{type:"button",onClick:()=>i("stage",t.file),title:"Stage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:(0,s.Y)(H.A,{size:11})})]}),n&&(0,s.Y)("button",{type:"button",onClick:()=>i("unstage",t.file),title:"Unstage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:(0,s.Y)(B.A,{size:11})})]})})]})}function Q(e){let{node:t,isStaged:n,isFolderOpen:a,toggleFolder:r,onAction:i,depth:o=0,repo:l,rootPath:c}=e,d="folder"===t.type,h=!!d&&a(t.id);if(d)return(0,s.FD)("div",{className:"select-none",children:[(0,s.FD)("div",{className:"flex items-center justify-between px-2 py-1 hover:bg-ink/5 cursor-pointer rounded group transition-colors text-[11px]",onClick:()=>r(t.id),children:[(0,s.FD)("div",{className:"flex items-center space-x-1.5 flex-1 min-w-0 pr-1",children:[(0,s.Y)("span",{className:"w-3.5 h-3.5 flex items-center justify-center text-ink/40 flex-shrink-0",children:h?(0,s.Y)(v.A,{size:12}):(0,s.Y)(y.A,{size:12})}),(0,s.Y)(V.o,{name:t.name,isFolder:!0,isOpen:h,size:13,className:"flex-shrink-0"}),(0,s.Y)("span",{className:"font-medium text-ink truncate",children:t.name}),(0,s.Y)("span",{className:"text-[9px] text-ink/40 font-normal px-1 py-0.2 bg-ink/5 rounded-full ml-1",children:t.changeCount})]}),(0,s.Y)("div",{className:"flex items-center space-x-1 text-ink/40 flex-shrink-0",children:(0,s.Y)("div",{className:"flex items-center opacity-0 group-hover:opacity-100 space-x-1",children:n?(0,s.Y)("button",{type:"button",onClick:e=>{e.stopPropagation(),i("unstage",t.path)},title:`Unstage ${t.name}`,className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:(0,s.Y)(B.A,{size:11})}):(0,s.FD)(s.FK,{children:[(0,s.Y)("button",{type:"button",onClick:e=>{e.stopPropagation(),i("revert",t.path)},title:`Discard changes in ${t.name}`,className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:(0,s.Y)(G.A,{size:11})}),(0,s.Y)("button",{type:"button",onClick:e=>{e.stopPropagation(),i("stage",t.path)},title:`Stage ${t.name}`,className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:(0,s.Y)(H.A,{size:11})})]})})})]}),h&&t.children&&t.children.length>0&&(0,s.Y)("div",{className:"ml-3 border-l border-ink/10 pl-1",children:t.children.map(e=>(0,s.Y)(Q,{node:e,isStaged:n,isFolderOpen:a,toggleFolder:r,onAction:i,depth:o+1,repo:l,rootPath:c},e.id))})]});let p=t.change,m=(0,U.R)(p?.status||"M",n),f=m.charStatus,u=m.colorClass,x=p?p.file:t.path;return(0,s.FD)("div",{className:"flex items-center justify-between px-2 py-0.5 hover:bg-ink/5 cursor-pointer rounded group transition-colors text-[11px]",onClick:()=>{window.dispatchEvent(new CustomEvent("omp:open-diff",{detail:{file:x,staged:n,status:f,repo:l||".",root:c}}))},children:[(0,s.FD)("div",{className:"flex items-center space-x-1.5 flex-1 min-w-0 pr-1",children:[(0,s.Y)("span",{className:"w-3.5 h-3.5 flex items-center justify-center flex-shrink-0",children:(0,s.Y)("span",{className:`font-bold font-mono text-[9px] ${u}`,title:`Status: ${m.label}`,children:f})}),(0,s.Y)(V.o,{name:t.name,size:12,className:"flex-shrink-0"}),(0,s.Y)("span",{className:`truncate ${u}`,title:x,children:t.name})]}),(0,s.Y)("div",{className:"flex items-center space-x-1 text-ink/40 flex-shrink-0",children:(0,s.Y)("div",{className:"flex items-center opacity-0 group-hover:opacity-100 space-x-1",children:n?(0,s.Y)("button",{type:"button",onClick:()=>i("unstage",x),title:"Unstage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:(0,s.Y)(B.A,{size:11})}):(0,s.FD)(s.FK,{children:[(0,s.Y)("button",{type:"button",onClick:()=>i("revert",x),title:"Discard Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:(0,s.Y)(G.A,{size:11})}),(0,s.Y)("button",{type:"button",onClick:()=>i("stage",x),title:"Stage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:(0,s.Y)(H.A,{size:11})})]})})})]})}function Z(e){let{changes:t,isStaged:n,repo:r,rootPath:i,onAction:o}=e,{tree:l,isFolderOpen:c,toggleFolder:d}=function(e){let{sessionId:t,ready:n,read:s}=(0,I.p0)(),r=(0,a.Kr)(()=>(function(e){let t={id:"",name:"",path:"",type:"folder",children:[],changeCount:0};for(let n of e){let e=n.file.replace(/^[./]+/,""),s=e.endsWith("/"),a=e.replace(/\/$/,"").split("/").filter(Boolean),r=t,i="";for(let e=0;e<a.length;e++){let t=a[e];i=i?`${i}/${t}`:t;let o=e===a.length-1;if(o&&!s)r.children.push({id:i,name:t,path:i,type:"file",change:n,children:[],changeCount:1});else{let e=r.children.find(e=>"folder"===e.type&&e.name===t);e||(e={id:i,name:t,path:i,type:"folder",children:[],changeCount:0,change:o&&s?n:void 0},r.children.push(e)),r=e}}}return!function e(t){if("file"===t.type)return 1;let n=+!!t.change;for(let s of t.children)n+=e(s);return t.changeCount=n,t.children.sort((e,t)=>"folder"===e.type&&"file"===t.type?-1:"file"===e.type&&"folder"===t.type?1:e.name.localeCompare(t.name)),n}(t),t.children})(e),[e]),i=(0,a.Kr)(()=>{let e=new Set;return!function t(n){for(let s of n)"folder"===s.type&&(e.add(s.id),s.children&&s.children.length>0&&t(s.children))}(r),e},[r]),[o,l]=(0,I.bL)("git.expandedFolders",[]),c=(0,a.Kr)(()=>new Set(o),[o]),d=(0,a.li)(null);(0,a.vJ)(()=>{!n||d.current===t||0===i.size||(d.current=t,s("git.expandedFolders",[]).length>0||l(Array.from(i)))},[n,t,i,s,l]);let h=(0,a.hb)(e=>{l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),Array.from(n)})},[l]),p=(0,a.hb)(e=>c.has(e),[c]);return{tree:r,expandedFolders:c,toggleFolder:h,isFolderOpen:p,expandAll:()=>l(Array.from(i)),collapseAll:()=>l([])}}(t);return 0===l.length?null:(0,s.Y)("div",{className:"py-0.5",children:l.map(e=>(0,s.Y)(Q,{node:e,isStaged:n,isFolderOpen:c,toggleFolder:d,onAction:o,repo:r,rootPath:i},e.id))})}function X(e){let{changes:t,isLoading:n,viewMode:a,repo:r,rootPath:i,onAction:o}=e,[l,c]=(0,I.bL)("git.stagedExpanded",!0),[d,h]=(0,I.bL)("git.unstagedExpanded",!0),p=t.filter(e=>{let t=e.status;return t&&" "!==t[0]&&"?"!==t[0]}),m=t.filter(e=>{let t=e.status;return t&&" "!==t[1]&&"?"!==t[1]||"??"===t});return n&&0===t.length?(0,s.Y)("div",{className:"flex-1 scrollbar-overlay-container scrollbar-overlay-static font-mono text-[11px] text-ink/80",children:(0,s.Y)("div",{className:"p-4 text-center text-ink/40 italic",children:"Loading..."})}):0===t.length?(0,s.Y)("div",{className:"flex-1 scrollbar-overlay-container scrollbar-overlay-static font-mono text-[11px] text-ink/80",children:(0,s.Y)("div",{className:"p-4 text-center text-ink/40 italic",children:"No changes found."})}):(0,s.Y)("div",{className:"flex-1 scrollbar-overlay-container scrollbar-overlay-static font-mono text-[11px] text-ink/80",children:(0,s.FD)("div",{className:"py-1",children:[p.length>0&&(0,s.FD)("div",{className:"mb-2",children:[(0,s.FD)("div",{className:"flex items-center justify-between px-3 py-1 group hover:bg-ink/5 cursor-pointer transition-colors",onClick:()=>c(!l),children:[(0,s.FD)("div",{className:"flex items-center space-x-1 font-semibold text-ink text-xs",children:[(0,s.Y)("span",{className:"w-3 text-center",children:l?"▾":"▸"}),(0,s.Y)("span",{children:"Staged Changes"}),(0,s.Y)("span",{className:"text-ink/40 font-normal ml-1 border border-ink/20 rounded-full px-1.5 text-[9px] bg-paper",children:p.length})]}),(0,s.Y)("div",{className:"opacity-0 group-hover:opacity-100 flex items-center space-x-1 text-ink/40 flex-shrink-0",children:(0,s.Y)("button",{type:"button",onClick:e=>{e.stopPropagation(),o("unstage_all")},title:"Unstage All Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:(0,s.Y)(B.A,{size:12})})})]}),l&&("tree"===a?(0,s.Y)(Z,{changes:p,isStaged:!0,repo:r,rootPath:i,onAction:o}):p.map(e=>(0,s.Y)(q,{change:e,isStaged:!0,repo:r,rootPath:i,onAction:o},e.file+"staged")))]}),m.length>0&&(0,s.FD)("div",{children:[(0,s.FD)("div",{className:"flex items-center justify-between px-3 py-1 group hover:bg-ink/5 cursor-pointer transition-colors",onClick:()=>h(!d),children:[(0,s.FD)("div",{className:"flex items-center space-x-1 font-semibold text-ink text-xs",children:[(0,s.Y)("span",{className:"w-3 text-center",children:d?"▾":"▸"}),(0,s.Y)("span",{children:"Changes"}),(0,s.Y)("span",{className:"text-ink/40 font-normal ml-1 border border-ink/20 rounded-full px-1.5 text-[9px] bg-paper",children:m.length})]}),(0,s.FD)("div",{className:"opacity-0 group-hover:opacity-100 flex items-center space-x-1 text-ink/40 flex-shrink-0",children:[(0,s.Y)("button",{type:"button",onClick:e=>{e.stopPropagation(),o("revert_all")},title:"Discard All Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:(0,s.Y)(G.A,{size:12})}),(0,s.Y)("button",{type:"button",onClick:e=>{e.stopPropagation(),o("stage_all")},title:"Stage All Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:(0,s.Y)(H.A,{size:12})})]})]}),d&&("tree"===a?(0,s.Y)(Z,{changes:m,isStaged:!1,repo:r,rootPath:i,onAction:o}):m.map(e=>(0,s.Y)(q,{change:e,isStaged:!1,repo:r,rootPath:i,onAction:o},e.file+"unstaged")))]})]})})}var ee=n("wu"),et=n("oZ"),en=n("Af"),es=n("oj");function ea(e){let{className:t="",enabled:n=!0,rootPath:i,refreshKey:o=0}=e,l=(0,r.L)(),c=(0,r.L)(),[d,h,p]=(0,I.bL)("git.activeRepo","."),m=l.data?.activeRepo||d||".",f=e=>{if(!n)return;let t=void 0!==e?e:d,s=new URLSearchParams;i&&s.set("root",i),t&&"."!==t&&s.set("repo",t),s.set("t",String(Date.now())),l.load(`/api/fs/git?${s.toString()}`)},[u,x]=(0,I.bL)("git.commitDraft",""),[b,g]=(0,I.bL)("git.viewMode","flat"),[k,v]=(0,a.J0)(!1),y=(0,a.li)(null),[w,N]=(0,a.J0)(!1),Y=(0,a.li)(null),[C,A]=(0,a.J0)(!1),F=(0,a.li)(null),[D,S]=(0,a.J0)(null),[z,H]=(0,a.J0)(!1),[R,L]=(0,a.J0)(""),W=(0,a.li)(null),[J,T]=(0,a.J0)(null),[E,K]=(0,a.J0)(!1),{toasts:B,pushToast:G,dismissToast:V}=(0,et.Y)(),[U,q]=(0,a.J0)(null),[Q,Z]=(0,a.J0)(!1),[ea,er]=(0,a.J0)(!1);(0,a.vJ)(()=>{K(!0)},[]),(0,a.vJ)(()=>{p&&f(d)},[o,i,n,p]),(0,en.n)(()=>f(d),n&&p),(0,en.w)(()=>f(d),n&&p),(0,a.vJ)(()=>{l.data?.activeRepo&&l.data.activeRepo!==d&&h(l.data.activeRepo)},[l.data?.activeRepo,d,h]),(0,a.vJ)(()=>{l.data?.reposPending&&Z(!0)},[l.data]),(0,a.vJ)(()=>{ea&&l.data&&!l.data.reposPending&&Array.isArray(l.data.repos)&&(q(l.data.repos),er(!1))},[l.data,ea]),(0,a.vJ)(()=>{if(!Q)return;let e=new URLSearchParams({reposOnly:"1"});i&&e.set("root",i);let t=setInterval(async()=>{let t=await fetch(`/api/fs/git?${e.toString()}`).then(e=>e.json()).catch(()=>null);t&&!t.reposPending&&Array.isArray(t.repos)&&(q(t.repos),Z(!1),er(!1),f(d))},1500);return()=>clearInterval(t)},[Q,i,d]),(0,a.vJ)(()=>{z&&W.current&&W.current.focus()},[z]),(0,a.vJ)(()=>{"idle"===c.state&&c.data&&("history"===c.data.type?T({title:"Commit History",data:c.data.data||[]}):"graph"===c.data.type?T({title:"Git Graph",data:c.data.data||[]}):c.data.success?f(m):G(c.data.error||"Git operation failed"))},[c.state,c.data]),(0,es.W)(y,()=>v(!1)),(0,es.W)(Y,()=>N(!1)),(0,es.W)(F,()=>A(!1));let ei=(e,t,n)=>{let s=new FormData;s.append("actionType",e),s.append("repo",m),i&&s.append("root",i),t&&s.append("file",t),n&&Object.entries(n).forEach(e=>{let[t,n]=e;return s.append(t,n)}),c.submit(s,{method:"POST",action:"/api/fs/git"}),"commit"===e&&x("")},eo=l.data?.branch||"main",el=l.data?.branches||["main"],ec=l.data?.remoteBranches||[],ed=U??(l.data?.repos||["."]),eh=l.data?.changes||[],ep="loading"===l.state||"idle"!==c.state,em=eh.filter(e=>{let t=e.status;return t&&" "!==t[0]&&"?"!==t[0]});return n?(0,s.FD)("div",{className:`flex flex-col h-full bg-paper relative ${t}`,children:[E&&(0,s.FD)(s.FK,{children:[(0,s.Y)(j,{modal:D,onClose:()=>S(null),onConfirm:()=>{D&&(ei(D.type,D.file),S(null))}}),(0,s.Y)(P,{isOpen:z,branchName:R,inputRef:W,onChange:L,onClose:()=>{H(!1),L("")},onCreate:()=>{R.trim()&&(ei("create_branch",void 0,{branch:R.trim()}),H(!1),L(""))}}),(0,s.Y)(M,{output:J,onClose:()=>T(null),onRefresh:()=>{J&&ei(J.title.toLowerCase().includes("graph")?"graph":"history")},onExecuteAction:(e,t,n)=>ei(e,t,n),rootPath:i,activeRepo:m})]}),(0,s.Y)(ee.y,{toasts:B,onDismiss:V}),(0,s.Y)(_,{repoRef:Y,showRepoMenu:w,setShowRepoMenu:N,activeRepo:m,repos:ed,isLoading:ep,rootPath:i,reposScanning:Q||ea,onSelectRepo:e=>{h(e),f(e)},onRefresh:()=>f(m),onRefreshRepos:()=>{if(!n||Q||ea)return;q(ed),er(!0);let e=new URLSearchParams({rescan:"1"});i&&e.set("root",i),"."!==m&&e.set("repo",m),e.set("t",String(Date.now())),l.load(`/api/fs/git?${e.toString()}`)}}),(0,s.Y)(O,{branchRef:F,showBranchMenu:C,setShowBranchMenu:A,branch:eo,branches:el,remoteBranches:ec,onCheckout:e=>ei("checkout",void 0,{branch:e}),onOpenBranchPrompt:()=>H(!0),optionsRef:y,showOptions:k,setShowOptions:v,onHistory:()=>ei("history"),onGraph:()=>ei("graph"),viewMode:b,setViewMode:g,isBusy:ep,syncCount:l.data?.syncCount,onSync:()=>ei("sync")}),(0,s.Y)($,{message:u,hasStagedChanges:em.length>0,isBusy:ep,onChangeMessage:x,onCommit:()=>ei("commit",void 0,{message:u})}),(0,s.Y)(X,{changes:eh,isLoading:ep,viewMode:b,repo:m,rootPath:i,onAction:(e,t,n)=>{"revert"===e?S({type:e,file:t,message:`Are you sure you want to discard changes in ${t}?`}):"revert_all"===e?S({type:e,message:"Are you sure you want to discard ALL unstaged changes? This cannot be undone."}):ei(e,t,n)}})]}):(0,s.Y)("div",{className:`flex flex-col h-full bg-paper items-center justify-center text-ink/40 ${t}`,children:(0,s.Y)("span",{className:"text-xs font-mono",children:"No session selected"})})}},rm(e,t,n){let s=(0,n("y").A)({name:"folder-git-2",size:24,node:[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]});n.d(t,{},{A:s})},DV(e,t,n){let s=(0,n("y").A)({name:"minus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}]]});n.d(t,{},{A:s})},Wb0(e,t,n){let s=(0,n("y").A)({name:"rotate-cw",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]});n.d(t,{},{A:s})}}]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(self.rspackChunkompchamber=self.rspackChunkompchamber||[]).push([["og"],{
|
|
1
|
+
"use strict";(self.rspackChunkompchamber=self.rspackChunkompchamber||[]).push([["og"],{gj(e,t,s){var i=s("Wq"),r=s("ja");t.A=(e,t)=>i.A.lang.round(r.A.parse(e)[t])},VV8(e,t,s){var i=(0,s("Gt").K)(()=>`
|
|
2
2
|
/* Font Awesome icon styling - consolidated */
|
|
3
3
|
.label-icon {
|
|
4
4
|
display: inline-block;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
stroke: revert;
|
|
13
13
|
stroke-width: revert;
|
|
14
14
|
}
|
|
15
|
-
`,"getIconStyles");s.d(t,{o:()=>i})},v0(e,t,s){var i=s("Yr"),r=s("Gt"),a=s("tP"),n=s("El"),o=(0,r.K)((e,t)=>{let s=e.append("rect");if(s.attr("x",t.x),s.attr("y",t.y),s.attr("fill",t.fill),s.attr("stroke",t.stroke),s.attr("width",t.width),s.attr("height",t.height),t.name&&s.attr("name",t.name),t.rx&&s.attr("rx",t.rx),t.ry&&s.attr("ry",t.ry),void 0!==t.attrs)for(let e in t.attrs)s.attr(e,t.attrs[e]);return t.class&&s.attr("class",t.class),s},"drawRect"),l=(0,r.K)((e,t)=>{o(e,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"}).lower()},"drawBackgroundRect"),u=(0,r.K)((e,t)=>{let s=t.text.replace(i.H1," "),r=e.append("text");r.attr("x",t.x),r.attr("y",t.y),r.attr("class","legend"),r.style("text-anchor",t.anchor),t.class&&r.attr("class",t.class);let a=r.append("tspan");return a.attr("x",t.x+2*t.textMargin),a.text(s),r},"drawText"),d=(0,r.K)((e,t,s,i)=>{let r=e.append("image");r.attr("x",t),r.attr("y",s);let n=(0,a.J)(i);r.attr("xlink:href",n)},"drawImage"),h=(0,r.K)((e,t,s,i)=>{let r=e.append("use");r.attr("x",t),r.attr("y",s);let n=(0,a.J)(i);r.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),c=(0,r.K)(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),p=(0,r.K)(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),g=(0,r.K)(()=>{let e=(0,n.Ltv)(".mermaidTooltip");return e.empty()&&(e=(0,n.Ltv)("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),e},"createTooltip");s.d(t,{CP:()=>h,Ck:()=>g,HT:()=>p,PB:()=>c,aC:()=>d,lC:()=>l,m:()=>u,tk:()=>o})},WJ(e,t,s){var i=s("Yr"),r=s("M4"),a=s("Gt"),n=(0,a.K)((e,t,s,a)=>{e.attr("class",s);let{width:n,height:u,x:d,y:h}=o(e,t);(0,i.a$)(e,u,n,a);let c=l(d,h,n,u,t);e.attr("viewBox",c),r.R.debug(`viewBox configured: ${c} with padding: ${t}`)},"setupViewPortForSVG"),o=(0,a.K)((e,t)=>{let s=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:s.width+2*t,height:s.height+2*t,x:s.x,y:s.y}},"calculateDimensionsWithPadding"),l=(0,a.K)((e,t,s,i,r)=>`${e-r} ${t-r} ${s} ${i}`,"createViewBox");s.d(t,{P:()=>n})},OT(e,t,s){var i=s("Gt"),r=s("El"),a=(0,i.K)((e,t)=>{let s;return"sandbox"===t&&(s=(0,r.Ltv)("#i"+e)),("sandbox"===t?(0,r.Ltv)(s.nodes()[0].contentDocument.body):(0,r.Ltv)("body")).select(`[id="${e}"]`)},"getDiagramElement");s.d(t,{A:()=>a})},WU(e,t,s){var i=s("VV8"),r=s("OT"),a=s("WJ"),n=s("Wf"),o=s("mW");s("Q");var l=s("v0");s("ix"),s("LC"),s("bQ");var u=s("Ut");s("PF"),s("iV"),s("h5");var d=s("pK"),h=s("NH"),c=s("Yr"),p=s("M4"),g=s("Gt"),f=s("El"),m=s("L"),y=s("gjz"),b=s("Cv"),A={SHAPE_UNSUPPORTED:"SHAPE_UNSUPPORTED",SHAPE_REMOVED:"SHAPE_REMOVED",EDGE_OPERATOR_UNSUPPORTED:"EDGE_OPERATOR_UNSUPPORTED",REFERENCE_EDGE_LABEL_REJECTED:"REFERENCE_EDGE_LABEL_REJECTED",CONNECTOR_REF_UNRESOLVED:"CONNECTOR_REF_UNRESOLVED",CONNECTOR_REF_NOT_A_CONNECTOR:"CONNECTOR_REF_NOT_A_CONNECTOR",METADATA_KEY_MISAPPLIED:"METADATA_KEY_MISAPPLIED",DUPLICATE_ID_NODE:"DUPLICATE_ID_NODE",RESERVED_SYNTHETIC_ID:"RESERVED_SYNTHETIC_ID",CONTAINMENT_VIOLATION:"CONTAINMENT_VIOLATION",EDGE_SEMANTIC_CONTRADICTION:"EDGE_SEMANTIC_CONTRADICTION",FLOW_NO_INPUT:"FLOW_NO_INPUT"},k=new Set([A.SHAPE_UNSUPPORTED,A.SHAPE_REMOVED,A.CONTAINMENT_VIOLATION]);new Set(Object.values(A).filter(e=>!k.has(e)));var E=new Map([["task","roundedRect"],["tool","subroutine"],["input","lean-right"],["decision","diamond"],["refdoc","lin-doc"],["action","hexagon"],["round","rect"]]),x=new Set(["doc","stadium","terminal","circle","trapezoid","inv_trapezoid","inv-trapezoid","doublecircle","double-circle","typeDeclaration","procs","lean_left","lean-left","in-out","cylinder","ellipse","odd","tag-rect","tagged-rectangle","delay","half-rounded-rectangle","lin-rect","lined-rectangle","win-pane","window-pane","curv-trap","curved-trapezoid"]),C=new Set(["roundedRect","subroutine","subprocess","subproc","framed-rectangle","lean-right","diamond","lin-doc","lined-document","hexagon","hex","connector","collapsedGroup"]),S="roundedRect";function T(e){return e?E.get(e)??e:e}function D(e,t){for(let s of e)if(!s.isGroup){if(s.shape&&"squareRect"!==s.shape&&"rect"!==s.shape||(s.shape=S),x.has(s.shape)){let e=`shape "${s.shape}" was removed in v0.8.1, using "${S}"`;t?.emitError?t.emitError("SHAPE_REMOVED",e,{nodeId:s.id}):p.R.warn(`agentflow: ${e}`),s.shape=S;continue}if(!C.has(s.shape)){let e=`shape "${s.shape}" is not supported, using "${S}"`;t?.emitWarning?t.emitWarning("SHAPE_UNSUPPORTED",e,{nodeId:s.id}):p.R.warn(`agentflow: ${e}`),s.shape=S}}}(0,g.K)(T,"resolveShapeAlias"),(0,g.K)(D,"normaliseNodeShapes");var _=new Map([["tool",0],["task",1],["decision",2],["input",3],["refdoc",4],["connector",5],["action",6]]),v=_.size,F=(0,g.K)(e=>`af-kind-${e}`,"kindClass"),$=[..._.keys()],L=(0,g.K)(e=>Math.max(1,e-v),"containerSlotCount"),B=(0,g.K)((e,t)=>{let s=v+e%L(t);return t>0?s%t:s},"containerSlot");function w(e,t,s){let i=(0,c.D7)().themeVariables?.borderColorArray,r=Array.isArray(i)?i.length:0,a=s.size;for(let i of e??[]){if(i.isGroup||"collapsedGroup"===i.shape){let e=s.get(String(i.id))??a++;i.colorIndex=B(e,r);continue}let e=t(String(i.id));e&&_.has(e)&&(i.cssClasses=`${i.cssClasses??""} ${F(e)}`.replace(/\s+/g," ").trim())}}(0,g.K)(w,"assignColorSlots");var I="agentflow-",M=new Set(["shape","view","icon","img","form","pos","w","h","class","style","labelType"]),N=new Set(["subroutine","subprocess","subproc","framed-rectangle","tool"]),R={flow:"flowGroup"};function O(e){if(Array.isArray(e))return e.map(e=>O(e));if(null===e||"object"!=typeof e)return e;let t={};for(let s of Object.keys(e))"__proto__"!==s&&"constructor"!==s&&"prototype"!==s&&(t[s]=O(e[s]));return t}function V(e){let t,s=!1,i=!1,r=0,a=[];for(let n of e.split("\n")){if(void 0!==t){let e=n.length-n.trimStart().length;if(""===n.trim()||e>t){a.push(n);continue}t=void 0}let e=-1;for(let t=0;t<n.length;t++){let a=n[t];if(i)"\\"===a?t++:'"'===a&&(i=!1);else if(s)"'"===a&&(s=!1);else if('"'===a)i=!0;else if("'"===a)s=!0;else if("#"===a&&(0===t||" "===n[t-1]||" "===n[t-1])){e=t;break}else"["===a||"{"===a?r++:("]"===a||"}"===a)&&(r=Math.max(0,r-1))}if(s||i||r>0){a.push(n);continue}let o=e>=0?n.slice(0,e):n,l=e>=0?n.slice(e):"";if(/:\s*[>|][\d+-]*\s*$/.test(o)){t=n.length-n.trimStart().length,a.push(n);continue}a.push(o.replace(/,([\t ]*)$/,"$1")+l)}return a.join("\n")}(0,g.K)(O,"stripPrototypeKeys"),(0,g.K)(V,"stripLineTrailingCommas");var P=class{constructor(){this.vertexCounter=0,this.config=(0,c.D7)(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.diagramId="",this.preserveCommentsWhenParsing=!0,this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,this.funs=[],this.setAccTitle=c.SV,this.setAccDescription=c.EI,this.setDiagramTitle=c.ke,this.getAccTitle=c.iN,this.getAccDescription=c.m7,this.getDiagramTitle=c.ab,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addGlobal=this.addGlobal.bind(this),this.addConnector=this.addConnector.bind(this),this.addConnectorMapping=this.addConnectorMapping.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.setFrontmatterLineOffset=this.setFrontmatterLineOffset.bind(this),this.addVertexMapping=this.addVertexMapping.bind(this),this.extendVertexMapping=this.extendVertexMapping.bind(this),this.addEdgeMapping=this.addEdgeMapping.bind(this),this.addSubgraphMapping=this.addSubgraphMapping.bind(this),this.emitWarning=this.emitWarning.bind(this),this.emitError=this.emitError.bind(this),this.getDiagnostics=this.getDiagnostics.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{(0,g.K)(this,"AgentFlowDB")}sanitizeText(e){return c.Y2.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(let t of this.vertices.values())if(t.id===e)return this.diagramId?`${this.diagramId}-${t.domId}`:t.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,t,s,i,r,a,o={},l,d){let h,p,g;if(!e||0===e.trim().length)return;if(void 0!==l){let e;e=l.includes("\n")?l+"\n":"{\n"+l+"\n}";try{h=(0,n.H)(e,{schema:n.r})??{}}catch(t){let e=l.includes("\n")?V(l):l;if(e!==l)try{h=(0,n.H)(e+"\n",{schema:n.r})??{}}catch{this.rethrowMetadataYamlError(t,l,d)}else this.rethrowMetadataYamlError(t,l,d)}h=O(h)}if(h&&"string"==typeof h.shape){let e=h,t=T(p=e.shape);t&&t!==p&&(e.shape=t)}let f=this.subGraphLookup.get(e);if(f&&h){f.metadata={...f.metadata,...h};return}let m=this.connectors.get(e);if(m&&h){m.metadata={...m.metadata,...h};return}if("connectors"===e)return;let y=this.edges.find(t=>t.id===e);if(y){let e=h;e?.animate!==void 0&&(y.animate=e.animate),e?.animation!==void 0&&(y.animation=e.animation),e?.curve!==void 0&&(y.interpolate=e.curve),h&&(y.metadata={...y.metadata,...h});return}let b=this.vertices.get(e);if(void 0===b&&(b={id:e,labelType:"text",domId:I+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,b)),this.vertexCounter++,void 0!==t?(this.config=(0,c.D7)(),g=this.sanitizeText(t.text.trim()),b.labelType=t.type,g.startsWith('"')&&g.endsWith('"')&&(g=g.substring(1,g.length-1)),b.text=g):void 0===b.text&&(b.text=e),void 0!==s&&(b.type=s),null!=i&&i.forEach(e=>{b.styles.push(e)}),null!=r&&r.forEach(e=>{b.classes.push(e)}),void 0!==a&&(b.dir=a),void 0===b.props?b.props=o:void 0!==o&&Object.assign(b.props,o),h){if(b.metadata={...b.metadata,...h},h.shape){let e=p??h.shape;if("string"!=typeof e)throw this.positionedShapeError(`No such shape: ${JSON.stringify(e)}.`,d);if(e!==e.toLowerCase()||e.includes("_"))throw this.positionedShapeError(`No such shape: ${e}. Shape names should be lowercase.`,d);if(!(0,u.aP)(h.shape))throw this.positionedShapeError(`No such shape: ${h.shape}.`,d);b.type=h?.shape}h?.label&&(b.text=this.sanitizeText(h.label),b.labelType=this.sanitizeNodeLabelType(h?.labelType))}}positionedShapeError(e,t){let s=Error(e);if(!t)return s;let i=t.first_line+this.frontmatterLineOffset;return Object.assign(s,{hash:{text:"",token:null,line:i-1,loc:{first_line:i,last_line:t.last_line+this.frontmatterLineOffset,first_column:t.first_column,last_column:t.last_column},expected:[]}}),s}rethrowMetadataYamlError(e,t,s){let i;if(!e||"YAMLException"!==e.name||!e.mark||!s)throw e;try{let r=!t.includes("\n"),a=r?"{\n"+t+"\n}":t+"\n",n=s.first_line+this.frontmatterLineOffset,o=s.first_column+2,l=(0,g.K)((e,t)=>r?{line:n,column:o+(1===e?t:0)}:{line:n+e,column:0===e?o+t:t},"toSource"),u=l(e.mark.line,e.mark.column),d=e.reason??(e.message??"").split("\n")[0].replace(/\s*\(\d+:\d+\)\s*$/,""),h=a.split("\n"),c=[];if(r)c.push(1);else for(let t=e.mark.line-1;t<=e.mark.line+1;t++)t<0||t>=h.length||(t!==h.length-1||""!==h[t]||t===e.mark.line)&&c.push(t);let p=Math.max(...c.map(e=>String(l(e,0).line).length)),f=[];for(let t of c){let s=l(t,0).line,i=` ${String(s).padStart(p)} | `;f.push(i+h[t].replace(/\t/g,"→")),t===e.mark.line&&f.push("-".repeat(i.length+e.mark.column)+"^")}i={message:`${d} (${u.line}:${u.column+1})
|
|
15
|
+
`,"getIconStyles");s.d(t,{o:()=>i})},v0(e,t,s){var i=s("Yr"),r=s("Gt"),a=s("tP"),n=s("El"),o=(0,r.K)((e,t)=>{let s=e.append("rect");if(s.attr("x",t.x),s.attr("y",t.y),s.attr("fill",t.fill),s.attr("stroke",t.stroke),s.attr("width",t.width),s.attr("height",t.height),t.name&&s.attr("name",t.name),t.rx&&s.attr("rx",t.rx),t.ry&&s.attr("ry",t.ry),void 0!==t.attrs)for(let e in t.attrs)s.attr(e,t.attrs[e]);return t.class&&s.attr("class",t.class),s},"drawRect"),l=(0,r.K)((e,t)=>{o(e,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"}).lower()},"drawBackgroundRect"),u=(0,r.K)((e,t)=>{let s=t.text.replace(i.H1," "),r=e.append("text");r.attr("x",t.x),r.attr("y",t.y),r.attr("class","legend"),r.style("text-anchor",t.anchor),t.class&&r.attr("class",t.class);let a=r.append("tspan");return a.attr("x",t.x+2*t.textMargin),a.text(s),r},"drawText"),d=(0,r.K)((e,t,s,i)=>{let r=e.append("image");r.attr("x",t),r.attr("y",s);let n=(0,a.J)(i);r.attr("xlink:href",n)},"drawImage"),h=(0,r.K)((e,t,s,i)=>{let r=e.append("use");r.attr("x",t),r.attr("y",s);let n=(0,a.J)(i);r.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),c=(0,r.K)(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),p=(0,r.K)(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),g=(0,r.K)(()=>{let e=(0,n.Ltv)(".mermaidTooltip");return e.empty()&&(e=(0,n.Ltv)("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),e},"createTooltip");s.d(t,{CP:()=>h,Ck:()=>g,HT:()=>p,PB:()=>c,aC:()=>d,lC:()=>l,m:()=>u,tk:()=>o})},WJ(e,t,s){var i=s("Yr"),r=s("M4"),a=s("Gt"),n=(0,a.K)((e,t,s,a)=>{e.attr("class",s);let{width:n,height:u,x:d,y:h}=o(e,t);(0,i.a$)(e,u,n,a);let c=l(d,h,n,u,t);e.attr("viewBox",c),r.R.debug(`viewBox configured: ${c} with padding: ${t}`)},"setupViewPortForSVG"),o=(0,a.K)((e,t)=>{let s=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:s.width+2*t,height:s.height+2*t,x:s.x,y:s.y}},"calculateDimensionsWithPadding"),l=(0,a.K)((e,t,s,i,r)=>`${e-r} ${t-r} ${s} ${i}`,"createViewBox");s.d(t,{P:()=>n})},OT(e,t,s){var i=s("Gt"),r=s("El"),a=(0,i.K)((e,t)=>{let s;return"sandbox"===t&&(s=(0,r.Ltv)("#i"+e)),("sandbox"===t?(0,r.Ltv)(s.nodes()[0].contentDocument.body):(0,r.Ltv)("body")).select(`[id="${e}"]`)},"getDiagramElement");s.d(t,{A:()=>a})},WU(e,t,s){var i=s("VV8"),r=s("OT"),a=s("WJ"),n=s("Wf"),o=s("mW");s("Q");var l=s("v0");s("ix"),s("LC"),s("bQ");var u=s("Ut");s("PF"),s("iV"),s("h5");var d=s("pK"),h=s("NH"),c=s("Yr"),p=s("M4"),g=s("Gt"),f=s("El"),m=s("L"),y=s("gj"),b=s("Cv"),A={SHAPE_UNSUPPORTED:"SHAPE_UNSUPPORTED",SHAPE_REMOVED:"SHAPE_REMOVED",EDGE_OPERATOR_UNSUPPORTED:"EDGE_OPERATOR_UNSUPPORTED",REFERENCE_EDGE_LABEL_REJECTED:"REFERENCE_EDGE_LABEL_REJECTED",CONNECTOR_REF_UNRESOLVED:"CONNECTOR_REF_UNRESOLVED",CONNECTOR_REF_NOT_A_CONNECTOR:"CONNECTOR_REF_NOT_A_CONNECTOR",METADATA_KEY_MISAPPLIED:"METADATA_KEY_MISAPPLIED",DUPLICATE_ID_NODE:"DUPLICATE_ID_NODE",RESERVED_SYNTHETIC_ID:"RESERVED_SYNTHETIC_ID",CONTAINMENT_VIOLATION:"CONTAINMENT_VIOLATION",EDGE_SEMANTIC_CONTRADICTION:"EDGE_SEMANTIC_CONTRADICTION",FLOW_NO_INPUT:"FLOW_NO_INPUT"},k=new Set([A.SHAPE_UNSUPPORTED,A.SHAPE_REMOVED,A.CONTAINMENT_VIOLATION]);new Set(Object.values(A).filter(e=>!k.has(e)));var E=new Map([["task","roundedRect"],["tool","subroutine"],["input","lean-right"],["decision","diamond"],["refdoc","lin-doc"],["action","hexagon"],["round","rect"]]),x=new Set(["doc","stadium","terminal","circle","trapezoid","inv_trapezoid","inv-trapezoid","doublecircle","double-circle","typeDeclaration","procs","lean_left","lean-left","in-out","cylinder","ellipse","odd","tag-rect","tagged-rectangle","delay","half-rounded-rectangle","lin-rect","lined-rectangle","win-pane","window-pane","curv-trap","curved-trapezoid"]),C=new Set(["roundedRect","subroutine","subprocess","subproc","framed-rectangle","lean-right","diamond","lin-doc","lined-document","hexagon","hex","connector","collapsedGroup"]),S="roundedRect";function T(e){return e?E.get(e)??e:e}function D(e,t){for(let s of e)if(!s.isGroup){if(s.shape&&"squareRect"!==s.shape&&"rect"!==s.shape||(s.shape=S),x.has(s.shape)){let e=`shape "${s.shape}" was removed in v0.8.1, using "${S}"`;t?.emitError?t.emitError("SHAPE_REMOVED",e,{nodeId:s.id}):p.R.warn(`agentflow: ${e}`),s.shape=S;continue}if(!C.has(s.shape)){let e=`shape "${s.shape}" is not supported, using "${S}"`;t?.emitWarning?t.emitWarning("SHAPE_UNSUPPORTED",e,{nodeId:s.id}):p.R.warn(`agentflow: ${e}`),s.shape=S}}}(0,g.K)(T,"resolveShapeAlias"),(0,g.K)(D,"normaliseNodeShapes");var _=new Map([["tool",0],["task",1],["decision",2],["input",3],["refdoc",4],["connector",5],["action",6]]),v=_.size,F=(0,g.K)(e=>`af-kind-${e}`,"kindClass"),$=[..._.keys()],L=(0,g.K)(e=>Math.max(1,e-v),"containerSlotCount"),B=(0,g.K)((e,t)=>{let s=v+e%L(t);return t>0?s%t:s},"containerSlot");function w(e,t,s){let i=(0,c.D7)().themeVariables?.borderColorArray,r=Array.isArray(i)?i.length:0,a=s.size;for(let i of e??[]){if(i.isGroup||"collapsedGroup"===i.shape){let e=s.get(String(i.id))??a++;i.colorIndex=B(e,r);continue}let e=t(String(i.id));e&&_.has(e)&&(i.cssClasses=`${i.cssClasses??""} ${F(e)}`.replace(/\s+/g," ").trim())}}(0,g.K)(w,"assignColorSlots");var I="agentflow-",M=new Set(["shape","view","icon","img","form","pos","w","h","class","style","labelType"]),N=new Set(["subroutine","subprocess","subproc","framed-rectangle","tool"]),R={flow:"flowGroup"};function O(e){if(Array.isArray(e))return e.map(e=>O(e));if(null===e||"object"!=typeof e)return e;let t={};for(let s of Object.keys(e))"__proto__"!==s&&"constructor"!==s&&"prototype"!==s&&(t[s]=O(e[s]));return t}function V(e){let t,s=!1,i=!1,r=0,a=[];for(let n of e.split("\n")){if(void 0!==t){let e=n.length-n.trimStart().length;if(""===n.trim()||e>t){a.push(n);continue}t=void 0}let e=-1;for(let t=0;t<n.length;t++){let a=n[t];if(i)"\\"===a?t++:'"'===a&&(i=!1);else if(s)"'"===a&&(s=!1);else if('"'===a)i=!0;else if("'"===a)s=!0;else if("#"===a&&(0===t||" "===n[t-1]||" "===n[t-1])){e=t;break}else"["===a||"{"===a?r++:("]"===a||"}"===a)&&(r=Math.max(0,r-1))}if(s||i||r>0){a.push(n);continue}let o=e>=0?n.slice(0,e):n,l=e>=0?n.slice(e):"";if(/:\s*[>|][\d+-]*\s*$/.test(o)){t=n.length-n.trimStart().length,a.push(n);continue}a.push(o.replace(/,([\t ]*)$/,"$1")+l)}return a.join("\n")}(0,g.K)(O,"stripPrototypeKeys"),(0,g.K)(V,"stripLineTrailingCommas");var P=class{constructor(){this.vertexCounter=0,this.config=(0,c.D7)(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.diagramId="",this.preserveCommentsWhenParsing=!0,this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,this.funs=[],this.setAccTitle=c.SV,this.setAccDescription=c.EI,this.setDiagramTitle=c.ke,this.getAccTitle=c.iN,this.getAccDescription=c.m7,this.getDiagramTitle=c.ab,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addGlobal=this.addGlobal.bind(this),this.addConnector=this.addConnector.bind(this),this.addConnectorMapping=this.addConnectorMapping.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.setFrontmatterLineOffset=this.setFrontmatterLineOffset.bind(this),this.addVertexMapping=this.addVertexMapping.bind(this),this.extendVertexMapping=this.extendVertexMapping.bind(this),this.addEdgeMapping=this.addEdgeMapping.bind(this),this.addSubgraphMapping=this.addSubgraphMapping.bind(this),this.emitWarning=this.emitWarning.bind(this),this.emitError=this.emitError.bind(this),this.getDiagnostics=this.getDiagnostics.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{(0,g.K)(this,"AgentFlowDB")}sanitizeText(e){return c.Y2.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(let t of this.vertices.values())if(t.id===e)return this.diagramId?`${this.diagramId}-${t.domId}`:t.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,t,s,i,r,a,o={},l,d){let h,p,g;if(!e||0===e.trim().length)return;if(void 0!==l){let e;e=l.includes("\n")?l+"\n":"{\n"+l+"\n}";try{h=(0,n.H)(e,{schema:n.r})??{}}catch(t){let e=l.includes("\n")?V(l):l;if(e!==l)try{h=(0,n.H)(e+"\n",{schema:n.r})??{}}catch{this.rethrowMetadataYamlError(t,l,d)}else this.rethrowMetadataYamlError(t,l,d)}h=O(h)}if(h&&"string"==typeof h.shape){let e=h,t=T(p=e.shape);t&&t!==p&&(e.shape=t)}let f=this.subGraphLookup.get(e);if(f&&h){f.metadata={...f.metadata,...h};return}let m=this.connectors.get(e);if(m&&h){m.metadata={...m.metadata,...h};return}if("connectors"===e)return;let y=this.edges.find(t=>t.id===e);if(y){let e=h;e?.animate!==void 0&&(y.animate=e.animate),e?.animation!==void 0&&(y.animation=e.animation),e?.curve!==void 0&&(y.interpolate=e.curve),h&&(y.metadata={...y.metadata,...h});return}let b=this.vertices.get(e);if(void 0===b&&(b={id:e,labelType:"text",domId:I+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,b)),this.vertexCounter++,void 0!==t?(this.config=(0,c.D7)(),g=this.sanitizeText(t.text.trim()),b.labelType=t.type,g.startsWith('"')&&g.endsWith('"')&&(g=g.substring(1,g.length-1)),b.text=g):void 0===b.text&&(b.text=e),void 0!==s&&(b.type=s),null!=i&&i.forEach(e=>{b.styles.push(e)}),null!=r&&r.forEach(e=>{b.classes.push(e)}),void 0!==a&&(b.dir=a),void 0===b.props?b.props=o:void 0!==o&&Object.assign(b.props,o),h){if(b.metadata={...b.metadata,...h},h.shape){let e=p??h.shape;if("string"!=typeof e)throw this.positionedShapeError(`No such shape: ${JSON.stringify(e)}.`,d);if(e!==e.toLowerCase()||e.includes("_"))throw this.positionedShapeError(`No such shape: ${e}. Shape names should be lowercase.`,d);if(!(0,u.aP)(h.shape))throw this.positionedShapeError(`No such shape: ${h.shape}.`,d);b.type=h?.shape}h?.label&&(b.text=this.sanitizeText(h.label),b.labelType=this.sanitizeNodeLabelType(h?.labelType))}}positionedShapeError(e,t){let s=Error(e);if(!t)return s;let i=t.first_line+this.frontmatterLineOffset;return Object.assign(s,{hash:{text:"",token:null,line:i-1,loc:{first_line:i,last_line:t.last_line+this.frontmatterLineOffset,first_column:t.first_column,last_column:t.last_column},expected:[]}}),s}rethrowMetadataYamlError(e,t,s){let i;if(!e||"YAMLException"!==e.name||!e.mark||!s)throw e;try{let r=!t.includes("\n"),a=r?"{\n"+t+"\n}":t+"\n",n=s.first_line+this.frontmatterLineOffset,o=s.first_column+2,l=(0,g.K)((e,t)=>r?{line:n,column:o+(1===e?t:0)}:{line:n+e,column:0===e?o+t:t},"toSource"),u=l(e.mark.line,e.mark.column),d=e.reason??(e.message??"").split("\n")[0].replace(/\s*\(\d+:\d+\)\s*$/,""),h=a.split("\n"),c=[];if(r)c.push(1);else for(let t=e.mark.line-1;t<=e.mark.line+1;t++)t<0||t>=h.length||(t!==h.length-1||""!==h[t]||t===e.mark.line)&&c.push(t);let p=Math.max(...c.map(e=>String(l(e,0).line).length)),f=[];for(let t of c){let s=l(t,0).line,i=` ${String(s).padStart(p)} | `;f.push(i+h[t].replace(/\t/g,"→")),t===e.mark.line&&f.push("-".repeat(i.length+e.mark.column)+"^")}i={message:`${d} (${u.line}:${u.column+1})
|
|
16
16
|
|
|
17
17
|
${f.join("\n")}`,markLine:u.line-1,markColumn:u.column,hash:{text:"",token:null,line:u.line-1,loc:{first_line:u.line,last_line:u.line,first_column:u.column,last_column:u.column+1},expected:[]}}}catch{}throw i&&(e.message=i.message,e.mark.line=i.markLine,e.mark.column=i.markColumn,e.hash=i.hash),e}addSingleLink(e,t,s,i){let r={start:e,end:t,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};p.R.info("abc78 Got edge...",r);let a=s.text;if(void 0!==a&&(r.text=this.sanitizeText(a.text.trim()),r.text.startsWith('"')&&r.text.endsWith('"')&&(r.text=r.text.substring(1,r.text.length-1)),r.labelType=this.sanitizeNodeLabelType(a.type)),void 0!==s&&(r.type=s.type,r.stroke=s.stroke,r.length=s.length>10?10:s.length,s.edgeSemantic&&(r.edgeSemantic=s.edgeSemantic)),i&&!this.edges.some(e=>e.id===i))r.id=i,r.isUserDefinedId=!0;else{let e=this.edges.filter(e=>e.start===r.start&&e.end===r.end);0===e.length?r.id=(0,h.rY)(r.start,r.end,{counter:0,prefix:"L"}):r.id=(0,h.rY)(r.start,r.end,{counter:e.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))p.R.info("Pushing edge..."),this.edges.push(r);else throw Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.
|
|
18
18
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*! LICENSE: q.7fb4d2f374.js.LICENSE.txt */
|
|
2
|
+
"use strict";(self.rspackChunkompchamber=self.rspackChunkompchamber||[]).push([["q"],{o3(e,t,i){i.d(t,{Editor:()=>W});var n=i("j"),r=i("H"),o=i("ob"),a=i("HO"),s=i("rK"),l=i("jo"),c=i("YOg"),d=i("S"),m=i("Go"),p=i("oj"),f=i("LQ");function h(e){let{openedFiles:t,activeFileId:i,onSelectFile:a,onCloseFile:s}=e,l=(0,r.li)(null),h=(0,r.li)(null),[x,u]=(0,r.J0)(5),[v,k]=(0,r.J0)(!1);(0,p.W)(h,()=>k(!1)),(0,r.vJ)(()=>{let e=new ResizeObserver(e=>{for(let t of e)u(Math.max(1,Math.floor((t.contentRect.width-60)/150)))});return l.current&&e.observe(l.current),()=>e.disconnect()},[]);let b=[],g=[];if(t.length<=x)b=t;else{let e=t.findIndex(e=>e.id===i),n=new Set;-1!==e&&null!==i&&n.add(i);for(let e=t.length-1;e>=0&&!(n.size>=x);e--)n.add(t[e].id);b=t.filter(e=>n.has(e.id)),g=t.filter(e=>!n.has(e.id))}return(0,n.FD)("div",{className:"flex bg-ink/10 w-full relative border-b border-ink/10",ref:l,children:[(0,n.Y)("div",{className:"flex overflow-hidden",children:b.map(e=>{let t=e.id===i,r=!!e.isDiff,l=r?(0,f.R)(e.diffStatus||"M",e.diffStaged):null;return(0,n.FD)("div",{onClick:()=>a(e.id),className:`flex items-center space-x-1.5 px-3 py-1.5 cursor-pointer border-r border-ink/10 min-w-[120px] max-w-[210px] group ${t?"bg-paper border-t-2 border-t-ink text-ink":"bg-transparent border-t-2 border-t-transparent text-ink/60 hover:bg-paper/50"}`,title:e.path,children:[r?(0,n.Y)(c.A,{size:14,className:t?"text-blue-600 dark:text-blue-400 flex-shrink-0":"opacity-60 flex-shrink-0"}):(0,n.Y)(o.o,{name:e.name,size:14,className:t?"flex-shrink-0":"opacity-60 flex-shrink-0"}),(0,n.Y)("span",{className:"text-xs font-mono truncate flex-1",children:e.name}),l&&(0,n.Y)("span",{className:`px-1 text-[9px] font-mono font-bold rounded ${l.badgeBgClass}`,children:l.charStatus}),(0,n.Y)("div",{className:`p-0.5 rounded hover:bg-ink/10 ${t?"opacity-100":"opacity-0 group-hover:opacity-100"}`,onClick:t=>{t.stopPropagation(),s(e.id)},children:(0,n.Y)(d.A,{size:12})})]},e.id)})}),g.length>0&&(0,n.FD)("div",{className:"relative flex items-center ml-auto bg-ink/10",ref:h,children:[(0,n.Y)("button",{className:`p-1.5 mx-1 rounded hover:bg-ink/10 text-ink/60 ${v?"bg-ink/10 text-ink":""}`,onClick:()=>k(!v),title:"More open files",children:(0,n.Y)(m.A,{size:14})}),v&&(0,n.FD)("div",{className:"absolute right-0 top-full mt-1 w-52 bg-paper border border-ink/10 rounded shadow-lg z-50 py-1",children:[(0,n.Y)("div",{className:"px-3 py-1 text-[10px] uppercase font-mono text-ink/40 border-b border-ink/10 mb-1",children:"Older Tabs"}),g.map(e=>(0,n.FD)("div",{onClick:()=>{a(e.id),k(!1)},className:"flex items-center space-x-2 px-3 py-1.5 hover:bg-ink/5 cursor-pointer group",children:[e.isDiff?(0,n.Y)(c.A,{size:14,className:"text-blue-600 opacity-70"}):(0,n.Y)(o.o,{name:e.name,size:14,className:"opacity-60"}),(0,n.Y)("span",{className:"text-xs font-mono truncate flex-1 text-ink/80",children:e.name}),(0,n.Y)("div",{className:"p-0.5 rounded hover:bg-ink/10 opacity-0 group-hover:opacity-100",onClick:t=>{t.stopPropagation(),s(e.id),1===g.length&&k(!1)},children:(0,n.Y)(d.A,{size:12,className:"text-ink/60"})})]},e.id))]})]})]})}var x=i("ES0"),u=i("z"),v=i("Soe"),k=i("bH"),b=i("yh"),g=i("hj"),N=i("na"),y=i("b0"),Y=i("tC");let w=(0,i("y").A)({name:"maximize",size:24,node:[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]});function z(e){let{path:t,saveStatus:i,wordWrap:r,isMd:o,isPreview:a,onSave:s,onTogglePreview:l,onToggleWordWrap:c,onZoomIn:d,onZoomOut:m,onCopy:p,onDownload:f,onToggleMaximize:h}=e;return(0,n.FD)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-ink/10 bg-paper",children:[(0,n.Y)("div",{className:"flex items-center space-x-2 text-xs font-mono text-ink/40",children:(0,n.Y)("span",{className:"truncate max-w-[300px]",title:t,children:t})}),(0,n.FD)("div",{className:"flex items-center space-x-3 text-ink/40",children:[(0,n.Y)("div",{className:"flex items-center pr-3 border-r border-ink/10",children:(0,n.Y)("button",{type:"button",onClick:s,className:"flex items-center justify-center rounded hover:bg-ink/5 transition-colors",title:"Save file (Ctrl+S)",children:"saving"===i?(0,n.Y)(x.A,{size:14,className:"text-amber-500 animate-pulse"}):"saved"===i?(0,n.Y)(u.A,{size:14,className:"text-success"}):(0,n.Y)(x.A,{size:14,className:"hover:text-ink cursor-pointer"})})}),o&&(0,n.Y)("div",{onClick:l,className:"flex items-center pr-3 border-r border-ink/10",children:a?(0,n.Y)(v.A,{size:14,className:"hover:text-ink cursor-pointer"}):(0,n.Y)(k.A,{size:14,className:"hover:text-ink cursor-pointer"})}),(0,n.Y)("div",{className:"flex items-center space-x-2 pr-3 border-r border-ink/10",children:(0,n.Y)(b.A,{size:14,className:`cursor-pointer ${r?"text-ink":"hover:text-ink"}`,onClick:c})}),(0,n.FD)("div",{className:"flex items-center space-x-2 pr-3 border-r border-ink/10",children:[(0,n.Y)(g.A,{size:14,className:"hover:text-ink cursor-pointer",onClick:m}),(0,n.Y)(N.A,{size:14,className:"hover:text-ink cursor-pointer",onClick:d})]}),(0,n.FD)("div",{className:"flex items-center space-x-2 pr-3 border-r border-ink/10",children:[(0,n.Y)(y.A,{size:14,className:"hover:text-ink cursor-pointer",onClick:p}),(0,n.Y)(Y.A,{size:14,className:"hover:text-ink cursor-pointer",onClick:f})]}),(0,n.Y)("div",{className:"flex items-center pl-1",children:(0,n.Y)(w,{size:14,className:"hover:text-ink cursor-pointer",onClick:h})})]})]})}function C(e){if(e.endsWith(".md"))return`# ${e.replace(".md","")}
|
|
3
|
+
|
|
4
|
+
This is a mock markdown file.
|
|
5
|
+
|
|
6
|
+
- You can edit this text
|
|
7
|
+
- Click the eye icon above to toggle preview`;if(e.endsWith(".tsx")||e.endsWith(".ts")){let t=e.split(".")[0].replace(/[^a-zA-Z0-9]/g,"");return`import React from 'react';
|
|
8
|
+
|
|
9
|
+
export default function ${t||"Component"}() {
|
|
10
|
+
return (
|
|
11
|
+
<div>
|
|
12
|
+
Hello World
|
|
13
|
+
</div>
|
|
14
|
+
);
|
|
15
|
+
}`}return e.endsWith(".json")?`{
|
|
16
|
+
"name": "omp-project",
|
|
17
|
+
"version": "1.0.0"
|
|
18
|
+
}`:e.endsWith(".css")?`.container {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
}`:`Content for ${e}`}var S=i("Xg"),F=i("FL"),M=i("As"),A=i("SS"),D=i("XY");function W(e){let{className:t="",openedFiles:i,activeFileId:c,onSelectFile:d,onCloseFile:m,refreshKey:p=0,onFileSaved:f}=e,x=i.find(e=>e.id===c),[u,v,k]=(0,F.bL)("editor.previewMode",{}),[b,g]=(0,F.bL)("editor.zoomLevel",12),[N,y]=(0,r.J0)(!1),[Y,w]=(0,F.bL)("editor.wordWrap",!0),{sessionId:W}=(0,M.O)(),{isScrolling:$,handleScroll:H}=(0,l.K)(),j=(0,D.n)(x??null,{fallback:C,onFileSaved:f});if((0,r.vJ)(()=>{p>0&&j.reset()},[p]),(0,r.vJ)(()=>{j.retain(i.map(e=>e.id))},[i]),(0,r.vJ)(()=>{if(!k)return;let e=x?.id;if(null==e||!x.name.endsWith(".md"))return;let t=(0,A.WV)(W,"editor.previewMode");t&&void 0!==t[e]||v(t=>void 0===t[e]?{...t,[e]:!0}:t)},[k,x]),(0,r.vJ)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&"s"===e.key&&(e.preventDefault(),j.saveNow())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[j.saveNow]),0===i.length)return(0,n.FD)("div",{className:`flex flex-col h-full bg-canvas items-center justify-center text-ink/40 ${t}`,children:[(0,n.Y)(o.o,{name:"placeholder.txt",size:48,className:"mb-4 opacity-20"}),(0,n.Y)("p",{className:"font-mono text-sm",children:"Select a file to open"})]});let J=j.content,L=x?.name.endsWith(".md"),O=!!x&&u[x.id],P="error"===j.saveStatus?"idle":j.saveStatus,T=N?"fixed inset-0 z-50 flex flex-col bg-canvas":`flex flex-col h-full bg-canvas ${t}`;return(0,n.FD)("div",{className:T,children:[(0,n.Y)(h,{openedFiles:i,activeFileId:c,onSelectFile:d,onCloseFile:m}),x?x.isDiff?(0,n.Y)(S.M,{filePath:x.path,status:x.diffStatus||"M",isStaged:!!x.diffStaged,root:x.root,repo:x.repo||".",onOpenInEditor:()=>{x.isDiff=!1,d(x.id)},onFileSaved:f,className:"flex-1"}):(0,n.FD)(n.FK,{children:[(0,n.Y)(z,{path:x.path,saveStatus:P,wordWrap:Y,isMd:L,isPreview:O,onSave:j.saveNow,onTogglePreview:()=>{x&&v(e=>({...e,[x.id]:!e[x.id]}))},onToggleWordWrap:()=>w(!Y),onZoomIn:()=>g(e=>Math.min(24,e+1)),onZoomOut:()=>g(e=>Math.max(8,e-1)),onCopy:j.copy,onDownload:j.download,onToggleMaximize:()=>y(!N)}),(0,n.Y)("div",{onScroll:H,className:`flex-1 overflow-auto bg-paper flex ${(0,l.p)($)}`,children:L&&O?(0,n.Y)("div",{className:"p-6 prose prose-sm max-w-4xl mx-auto font-sans flex-1",style:{fontSize:`${b}px`},children:(0,n.Y)(s.T,{content:J})}):(0,n.Y)(a.P,{value:J,onValueChange:j.onChange,language:j.language,wordWrap:Y,rootClassName:"flex",gutterClassName:"flex flex-col text-right pl-4 pr-3 select-none text-ink/30 font-mono border-r border-ink/10 bg-canvas sticky left-0 z-10",gutterStyle:{fontSize:b,paddingTop:16,paddingBottom:16,lineHeight:1.5,fontFamily:'"Fira Code", "JetBrains Mono", "SF Mono", Consolas, monospace'},gutterLineClassName:"min-w-[1.5rem]",editorWrapperClassName:"flex-1 min-w-max code-surface",editorPadding:16,editorClassName:"font-mono focus:outline-none",editorStyle:{fontFamily:'"Fira Code", "JetBrains Mono", "SF Mono", Consolas, monospace',fontSize:b,lineHeight:1.5,minHeight:"100%"}})})]}):(0,n.Y)("div",{className:"flex-1 flex items-center justify-center text-ink/40",children:(0,n.Y)("p",{className:"font-mono text-sm",children:"Select a tab to view content"})})]})}},YOg(e,t,i){let n=(0,i("y").A)({name:"git-compare",size:24,node:[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]});i.d(t,{},{A:n})},ES0(e,t,i){let n=(0,i("y").A)({name:"save",size:24,node:[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]});i.d(t,{},{A:n})}}]);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! LICENSE: rd.cb6bf495bb.js.LICENSE.txt */
|
|
2
|
+
"use strict";(self.rspackChunkompchamber=self.rspackChunkompchamber||[]).push([["rd"],{NU(e,t,n){n.d(t,{UserBrowserPanel:()=>k});var a=n("j"),r=n("H"),l=n("Kv"),o=n("qw"),i=n("n"),s=n("Oj"),d=n("bu");let c={idle:"Kosong",loading:"Memuat",ready:"Siap"},u="p-1 rounded hover:bg-ink/5 disabled:opacity-25 disabled:hover:bg-transparent text-ink/70 hover:text-ink cursor-pointer disabled:cursor-not-allowed transition-colors";function m(e){let{url:t,input:n,loading:m,error:b,canGoBack:p,canGoForward:h,viewportMode:f,zoomLevel:x,onInputChange:k,onSubmit:v,onBack:g,onForward:w,onReload:N,onOpenExternal:y,onIncludeInChat:Y,onChangeViewport:z,onZoomIn:L,onZoomOut:B,onResetZoom:C,onSetZoom:F}=e,M=(0,r.li)(void 0);(0,r.vJ)(()=>{M.current!==t&&(M.current=t,t&&k(t))},[t,k]);let A=t?m?"loading":"ready":"idle",D=(0,a.FD)("div",{className:"flex items-center bg-canvas border border-ink/10 rounded-md p-0.5 space-x-0.5 flex-shrink-0",children:[(0,a.Y)("button",{type:"button",onClick:g,disabled:!p,"aria-label":"Kembali",title:"Kembali",className:u,children:(0,a.Y)(l.A,{size:12})}),(0,a.Y)("button",{type:"button",onClick:w,disabled:!h,"aria-label":"Maju",title:"Maju",className:u,children:(0,a.Y)(o.A,{size:12})}),(0,a.Y)("button",{type:"button",onClick:N,disabled:!t,"aria-label":"Muat ulang",title:"Muat ulang",className:u,children:(0,a.Y)(i.A,{size:12,className:m?"animate-spin":void 0})})]});return(0,a.Y)(d.K,{url:t,statusDotClass:"ready"===A?"bg-success animate-pulse":"loading"===A?"bg-ink/40 animate-pulse":"bg-ink/25",statusLabel:c[A],viewportMode:f,zoomLevel:x,onChangeViewport:z,onZoomIn:L,onZoomOut:B,onResetZoom:C,onSetZoom:F,onIncludeInChat:Y,onOpenExternal:y,openExternalLabel:"Buka di tab baru",openExternalTitle:"Buka di tab baru (untuk situs yang menolak iframe)",children:(0,a.FD)("div",{className:"flex items-center flex-1 min-w-0 space-x-1.5",children:[D,(0,a.FD)("form",{className:`flex-1 min-w-0 flex items-center bg-canvas border rounded-md px-2 py-0.5 space-x-1 focus-within:border-ink/40 ${b?"border-error":"border-ink/15"}`,onSubmit:e=>{e.preventDefault(),v(n)},children:[(0,a.Y)(s.A,{size:12,className:"text-ink/40 flex-shrink-0"}),(0,a.Y)("input",{type:"text",value:n,onChange:e=>k(e.currentTarget.value),placeholder:"Ketik alamat (mis. localhost:5173) lalu Enter…","aria-label":"Alamat browser pengguna","aria-invalid":null!=b,title:b??void 0,spellcheck:!1,autoComplete:"off",className:`w-full min-w-0 bg-transparent outline-none font-mono text-[11px] placeholder:text-ink/30 ${b?"text-error":"text-ink/90"}`})]})]})})}var b=n("t"),p=n("nTz");function h(e){let{url:t,frameKey:n,loading:r,viewportMode:l,zoomLevel:o,onLoad:i,active:d=!0}=e;return d?t?(0,a.FD)("div",{className:"flex-1 min-h-0 relative flex items-center justify-center p-2 overflow-auto bg-canvas/60",children:[r?(0,a.Y)("div",{className:"absolute inset-0 z-10 flex items-center justify-center pointer-events-none",children:(0,a.FD)("div",{className:"flex items-center space-x-2 px-3 py-1.5 rounded-md bg-paper border border-ink/15",children:[(0,a.Y)(b.A,{size:13,className:"animate-spin text-ink/50"}),(0,a.Y)("span",{className:"text-[11px] font-mono text-ink/60",children:"Memuat…"})]})}):null,(0,a.Y)("div",{className:`relative flex flex-col bg-white ${p.I[l]} transition-all duration-200`,style:{zoom:100!==o?`${o}%`:void 0,transformOrigin:"top center"},children:(0,a.Y)("iframe",{src:t,title:"Browser pengguna",onLoad:i,referrerPolicy:"no-referrer",allow:"clipboard-read; clipboard-write; fullscreen",className:"w-full h-full bg-white border-0"},n)})]}):(0,a.FD)("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center select-none",children:[(0,a.Y)("div",{className:"w-12 h-12 rounded-xl bg-ink/5 border border-ink/10 flex items-center justify-center text-ink/40 mb-3",children:(0,a.Y)(s.A,{size:22})}),(0,a.Y)("h3",{className:"text-sm font-semibold text-ink mb-1",children:"Browser Anda"}),(0,a.Y)("p",{className:"text-xs text-ink/60 max-w-sm",children:"Ketik alamat di atas lalu Enter. Halaman dimuat langsung di panel ini."}),(0,a.Y)("p",{className:"text-[11px] text-ink/45 max-w-sm mt-2",children:"Sebagian situs (Google, GitHub) menolak ditampilkan dalam iframe — pakai tombol buka di tab baru."})]}):null}var f=n("FL"),x=n("Fb");function k(e){let{className:t="",active:n=!0}=e,[l,o]=(0,f.bL)("userBrowser.viewportMode","responsive"),[i,s]=(0,f.bL)("userBrowser.zoomLevel",100),{url:d,input:c,setInput:u,frameKey:b,loading:p,error:k,canGoBack:v,canGoForward:g,submit:w,goBack:N,goForward:y,reload:Y,markLoaded:z}=function(){let[e,t]=(0,f.bL)("userBrowser.history",[]),[n,a]=(0,f.bL)("userBrowser.historyIndex",-1),[l,o]=(0,f.bL)("userBrowser.inputUrl",""),[i,s]=(0,r.J0)(0),[d,c]=(0,r.J0)(!1),[u,m]=(0,r.J0)(void 0),b=n>=0&&n<e.length?e[n]??"":"",p=(0,r.hb)(r=>{let l,i=r.trim();if(!i)return;try{l=function(e){let t=e.trim();if(!t)return t;let n=new URL(/^[a-z][a-z0-9+.-]*:/i.test(t)?t:`https://${t}`);if("http:"!==n.protocol&&"https:"!==n.protocol)throw Error("Only http and https URLs are allowed");return n.toString()}(i)}catch(e){m(e instanceof Error?e.message:"Alamat tidak valid");return}m(void 0),c(!0);let d=[...e.slice(0,n+1),l];t(d),a(d.length-1),o(l),s(e=>e+1)},[e,n,t,a,o]),h=(0,r.hb)(()=>{n<=0||(c(!0),a(n-1))},[n,a]),x=(0,r.hb)(()=>{n>=e.length-1||(c(!0),a(n+1))},[e.length,n,a]),k=(0,r.hb)(()=>{b&&(c(!0),s(e=>e+1))},[b]),v=(0,r.hb)(()=>{c(!1)},[]);return{url:b,input:l,setInput:o,frameKey:i,loading:d,error:u,canGoBack:n>0,canGoForward:n>=0&&n<e.length-1,submit:p,goBack:h,goForward:x,reload:k,markLoaded:v}}(),L=(0,r.hb)(()=>{d&&window.open(d,"_blank","noopener,noreferrer")},[d]),B=(0,r.hb)(()=>{d&&(0,x.q)({url:d})},[d]);return(0,a.FD)("div",{className:`flex flex-col h-full w-full bg-paper text-ink overflow-hidden ${t}`,children:[(0,a.Y)(m,{url:d,input:c,loading:p,error:k,canGoBack:v,canGoForward:g,viewportMode:l,zoomLevel:i,onInputChange:u,onSubmit:w,onBack:N,onForward:y,onReload:Y,onOpenExternal:L,onIncludeInChat:B,onChangeViewport:o,onZoomIn:()=>s(e=>Math.min(200,e+10)),onZoomOut:()=>s(e=>Math.max(50,e-10)),onResetZoom:()=>s(100),onSetZoom:s}),(0,a.Y)(h,{url:d,frameKey:b,loading:p,viewportMode:l,zoomLevel:i,onLoad:z,active:n})]})}}}]);
|