dirigent-server 0.14.0__tar.gz → 0.15.0__tar.gz
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.
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/PKG-INFO +2 -1
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/pyproject.toml +5 -1
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/pyproject.toml.orig +3 -1
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/routes/__init__.py +3 -0
- dirigent_server-0.15.0/src/dirigent_server/routes/examples.py +90 -0
- dirigent_server-0.14.0/src/dirigent_server/static/assets/AdminOnly-ChPFWSCk.js → dirigent_server-0.15.0/src/dirigent_server/static/assets/AdminOnly-ji4IpQ_T.js +1 -1
- dirigent_server-0.15.0/src/dirigent_server/static/assets/Alerting-CypGXVms.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/Blocks-DqIuk4gC.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/Connections-Bs3_sKps.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/Dashboard-CKQIJG-e.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/ExamplePanel-DOH0Epmn.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/Examples-CxIWUWj-.js +2 -0
- dirigent_server-0.14.0/src/dirigent_server/static/assets/Instant-C9TZFyg5.js → dirigent_server-0.15.0/src/dirigent_server/static/assets/Instant-BWqGNC0V.js +1 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/JsonBlock-DRCXIp-W.js → dirigent_server-0.15.0/src/dirigent_server/static/assets/JsonBlock-Cr-ftwn4.js +1 -1
- dirigent_server-0.15.0/src/dirigent_server/static/assets/ListTable-B9skT-_Y.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/Overview-BgtK0rX_.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/PageState-BxxntCdE.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/Panel-ClHPU8x_.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/Picker-R-mumgI7.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/PipelineEditor-CLRl4-nW.js +2 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/PipelineGraph-PZ3341dH.js +1 -0
- dirigent_server-0.14.0/src/dirigent_server/static/assets/PipelinePreview-BBCW_rdW.js → dirigent_server-0.15.0/src/dirigent_server/static/assets/PipelinePreview-DZxQbFFU.js +1 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/PipelineTab-ePfoBa3H.js → dirigent_server-0.15.0/src/dirigent_server/static/assets/PipelineTab-D3EBI8Jb.js +2 -2
- dirigent_server-0.15.0/src/dirigent_server/static/assets/ProgramReference-5SoAtU41.js +1 -0
- dirigent_server-0.14.0/src/dirigent_server/static/assets/Refusal-TkoEvvgs.js → dirigent_server-0.15.0/src/dirigent_server/static/assets/Refusal-DgcJTR4J.js +1 -1
- dirigent_server-0.15.0/src/dirigent_server/static/assets/RunDetail-jzvEjMoL.js +3 -0
- dirigent_server-0.14.0/src/dirigent_server/static/assets/RunGraph-DTsPfgHF.js → dirigent_server-0.15.0/src/dirigent_server/static/assets/RunGraph-CbO6g6oF.js +1 -1
- dirigent_server-0.15.0/src/dirigent_server/static/assets/SchemaForm-C0jzhj3Z.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/Schemas-CO82M3iN.js +10 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/SettingsDialog-B_-yFoYA.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/StarterPicker-BSs18xoM.js +1 -0
- dirigent_server-0.14.0/src/dirigent_server/static/assets/StepPorts-CtcvnIvJ.js → dirigent_server-0.15.0/src/dirigent_server/static/assets/StepPorts-Cpg_hQaj.js +1 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/TileCard-BJHpBqDz.js → dirigent_server-0.15.0/src/dirigent_server/static/assets/TileCard-DuzDmLB3.js +1 -1
- dirigent_server-0.15.0/src/dirigent_server/static/assets/Triggers-PRvIYDRh.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/Users-Cj1QqzJI.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/WindowedPane-bblrzCyF.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/Workers-DbAZZj4o.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/WorkersTable-kH_DDvFt.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/api-DxX94A25.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/auth-Chi4DcFq.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/badge-DABGWbc8.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/blocks-DgBe9px-.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/chevron-down-Cs1_pMxC.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/connections-1Ltd2U4L.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/copy-C7fd9gfy.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/docs-CCoB3shg.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/dropdown-menu-BmoO2uui.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/examples-6Nbc5Lgs.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/file-braces-NOlOm1fG.js +1 -0
- dirigent_server-0.14.0/src/dirigent_server/static/assets/format-CR2ze2LO.js → dirigent_server-0.15.0/src/dirigent_server/static/assets/format-B5YbYOY-.js +1 -1
- dirigent_server-0.15.0/src/dirigent_server/static/assets/index-Cmuh18en.css +2 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/index-DziHXrVI.js +53 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/input-C5XexCJf.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/maximize-2-8DfD9AFn.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/nav-CE-Cbv84.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/paging-DL6m7m7g.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/pipelines-CU_Q479F.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/play-Cpq8RIJ2.js +1 -0
- dirigent_server-0.14.0/src/dirigent_server/static/assets/preferences-Cl9nlEI4.js → dirigent_server-0.15.0/src/dirigent_server/static/assets/preferences-DsqSnjg9.js +1 -1
- dirigent_server-0.15.0/src/dirigent_server/static/assets/resolveAriaLabelledBy-Bm8j8jxz.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/schemas-CQifVwSc.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/select-fBLlNmQ_.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/starters-CvbebKUN.js +5 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/store-C2zgoyrT.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/tooltip-Dh4uy__Z.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/triggers-U4QjnQ1U.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/users-DhXGlOS0.js +1 -0
- dirigent_server-0.14.0/src/dirigent_server/static/assets/store-CVrCnru0.js → dirigent_server-0.15.0/src/dirigent_server/static/assets/with-selector-BQ0vq4Ay.js +1 -1
- dirigent_server-0.15.0/src/dirigent_server/static/assets/workers-Cn6T4C66.js +1 -0
- dirigent_server-0.15.0/src/dirigent_server/static/assets/x-CaKz-2po.js +1 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/index.html +20 -11
- dirigent_server-0.14.0/src/dirigent_server/static/assets/Alerting-CWXFU2pv.js +0 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/Blocks-BNvPhhHF.js +0 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/Connections-DgDXeKE2.js +0 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/Dashboard-BCOstDxl.js +0 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/Overview-BJz6p7fG.js +0 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/PageState-CTB50fRO.js +0 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/Panel-Bk3CoJZ6.js +0 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/Picker-CNyDCsNP.js +0 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/PipelineEditor-DDZwROr9.js +0 -2
- dirigent_server-0.14.0/src/dirigent_server/static/assets/PipelineGraph-BPtZkp6B.js +0 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/ProgramReference-qv2Y4zei.js +0 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/RunDetail-BxGHbTZ4.js +0 -3
- dirigent_server-0.14.0/src/dirigent_server/static/assets/SchemaForm-CBmpygQH.js +0 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/Schemas--W-pOmoC.js +0 -10
- dirigent_server-0.14.0/src/dirigent_server/static/assets/SettingsDialog-BihiK4NB.js +0 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/Triggers-hojIPjw5.js +0 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/Users-D7Mxrc9z.js +0 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/WindowedPane-Bl60nHe4.js +0 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/Workers-Y3RH3ljv.js +0 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/WorkersTable-DZiYF2b7.js +0 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/auth-DZcJKVvz.js +0 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/badge-LkJ4rIEc.js +0 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/blocks-CPJMNxIu.js +0 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/chevron-down-CrkpqUMs.js +0 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/connections-CdL8xQGj.js +0 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/copy-r6NpGwbU.js +0 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/dropdown-menu-B9iU0HGD.js +0 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/index-DPOCILN_.css +0 -2
- dirigent_server-0.14.0/src/dirigent_server/static/assets/index-DaM0mXP1.js +0 -53
- dirigent_server-0.14.0/src/dirigent_server/static/assets/input-7d4ZlAGD.js +0 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/maximize-2-B2tdtoC6.js +0 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/paging-CZR9Tg8m.js +0 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/pipelines-D_CSKLu-.js +0 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/select-BAmX8M_l.js +0 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/triggers-DwUJXGxD.js +0 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/users-wbUmMgn8.js +0 -1
- dirigent_server-0.14.0/src/dirigent_server/static/assets/workers-Bforr_yR.js +0 -1
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/LICENSE +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/README.md +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/THIRD_PARTY_NOTICES.md +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/__init__.py +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/app.py +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/dependencies.py +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/errors.py +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/health.py +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/logging.py +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/pagination.py +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/py.typed +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/routes/alerts.py +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/routes/auth.py +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/routes/blocks.py +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/routes/connections.py +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/routes/hooks.py +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/routes/pipelines.py +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/routes/runs.py +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/routes/schema.py +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/routes/schemas.py +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/routes/system.py +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/routes/trigger_documents.py +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/routes/triggers.py +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/routes/users.py +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/routes/workers.py +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/security.py +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/.gitkeep +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/Breadcrumb-KS3i4O6Q.js +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/CodeEditor-B55U_qvj.css +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/CodeEditor-cfjDMRpA.js +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/Description-DVFPKyRO.js +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/KindChip-CuBFi3X9.js +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/Markdown-B6er3LhH.js +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/Segmented-DvCzioEn.js +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/chunk-BV7QT456-Bfa1dvOx.js +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/dist-BWSEJlfk.js +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/editor.worker-BaAK1IVA.js +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2 +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-mono-cyrillic-500-normal-Ael50iVv.woff +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-mono-cyrillic-500-normal-Bq9vWWag.woff2 +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-mono-cyrillic-600-normal-CTOM6hUh.woff2 +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-mono-cyrillic-600-normal-fLZuRloM.woff +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2 +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT.woff +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T.woff2 +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-mono-cyrillic-ext-600-normal-9HEixskS.woff +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-mono-cyrillic-ext-600-normal-V-xxqcpd.woff2 +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-mono-latin-600-normal-BgSNZQsw.woff2 +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-mono-latin-600-normal-DWFSQ4vo.woff +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2 +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-mono-latin-ext-500-normal-CAhNIIs5.woff2 +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-mono-latin-ext-500-normal-CZ70TYgx.woff +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-mono-latin-ext-600-normal-D38SheWl.woff2 +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-mono-latin-ext-600-normal-DmB0ttJJ.woff +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2 +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-mono-vietnamese-500-normal-C8zxqsMH.woff +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu.woff2 +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-mono-vietnamese-600-normal-D2EvbN8M.woff2 +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-mono-vietnamese-600-normal-iLQfcSjf.woff +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-sans-cyrillic-ext-wght-normal-d45eAU9y.woff2 +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-sans-cyrillic-wght-normal-BAAhND-U.woff2 +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-sans-greek-wght-normal-CmyJS8uq.woff2 +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-sans-latin-ext-wght-normal-CIII54If.woff2 +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-sans-latin-wght-normal-IvpUvPa2.woff2 +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/ibm-plex-sans-vietnamese-wght-normal-Dg1JeJN0.woff2 +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/identity-BNZxCf_y.js +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/json.worker-C-kBQgxp.js +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/jsonMode-DC1hnmsD.js +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/preload-helper-Czpn1I53.js +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/react-BatatxyT.js +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/rolldown-runtime-Dd_uD5pT.js +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/schema-form-dcZ8A0M1.js +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/shell-CC2rA5mh.js +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/sql-NEE52Syq.js +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/status-Ctx8x8Mf.js +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/textarea-XMYmRm72.js +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/twig-De2hgUGE.js +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/use-heartbeat-ByRKom_T.js +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/use-store-CgWwefFs.js +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/utils-CRMSf51M.js +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/yaml-Vu_1GF43.js +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/assets/yaml.worker-D2mqiKN-.js +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/favicon-32.png +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/static/logo.png +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/transactions.py +0 -0
- {dirigent_server-0.14.0 → dirigent_server-0.15.0}/src/dirigent_server/ui.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dirigent-server
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.15.0
|
|
4
4
|
Summary: Dirigent FastAPI server: the REST API, its authentication, and the health probes.
|
|
5
5
|
License-Expression: LicenseRef-Proprietary
|
|
6
6
|
License-File: LICENSE
|
|
@@ -8,6 +8,7 @@ License-File: THIRD_PARTY_NOTICES.md
|
|
|
8
8
|
Requires-Dist: dirigent-client
|
|
9
9
|
Requires-Dist: dirigent-common
|
|
10
10
|
Requires-Dist: dirigent-core
|
|
11
|
+
Requires-Dist: dirigent-examples
|
|
11
12
|
Requires-Dist: fastapi>=0.141.1
|
|
12
13
|
Requires-Python: >=3.13
|
|
13
14
|
Description-Content-Type: text/markdown
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "dirigent-server"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.15.0"
|
|
4
4
|
description = "Dirigent FastAPI server: the REST API, its authentication, and the health probes."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.13"
|
|
@@ -13,6 +13,7 @@ dependencies = [
|
|
|
13
13
|
"dirigent-client",
|
|
14
14
|
"dirigent-common",
|
|
15
15
|
"dirigent-core",
|
|
16
|
+
"dirigent-examples",
|
|
16
17
|
"fastapi>=0.141.1",
|
|
17
18
|
]
|
|
18
19
|
|
|
@@ -25,3 +26,6 @@ workspace = true
|
|
|
25
26
|
|
|
26
27
|
[tool.uv.sources.dirigent-core]
|
|
27
28
|
workspace = true
|
|
29
|
+
|
|
30
|
+
[tool.uv.sources.dirigent-examples]
|
|
31
|
+
workspace = true
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "dirigent-server"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.15.0"
|
|
4
4
|
description = "Dirigent FastAPI server: the REST API, its authentication, and the health probes."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.13"
|
|
@@ -10,6 +10,7 @@ dependencies = [
|
|
|
10
10
|
"dirigent-client",
|
|
11
11
|
"dirigent-common",
|
|
12
12
|
"dirigent-core",
|
|
13
|
+
"dirigent-examples",
|
|
13
14
|
"fastapi>=0.141.1",
|
|
14
15
|
]
|
|
15
16
|
|
|
@@ -20,3 +21,4 @@ build-backend = "uv_build"
|
|
|
20
21
|
[tool.uv.sources]
|
|
21
22
|
dirigent-client = { workspace = true }
|
|
22
23
|
dirigent-core = { workspace = true }
|
|
24
|
+
dirigent-examples = { workspace = true }
|
|
@@ -12,6 +12,7 @@ from dirigent_server.routes import (
|
|
|
12
12
|
auth,
|
|
13
13
|
blocks,
|
|
14
14
|
connections,
|
|
15
|
+
examples,
|
|
15
16
|
hooks,
|
|
16
17
|
pipelines,
|
|
17
18
|
runs,
|
|
@@ -35,6 +36,7 @@ TAGS: list[dict[str, str]] = [
|
|
|
35
36
|
{"name": "hooks", "description": "Webhook intake, authenticated by its own token."},
|
|
36
37
|
{"name": "connections", "description": "Named credential records of contributed kinds."},
|
|
37
38
|
{"name": "blocks", "description": "The catalog every plugin contributes to."},
|
|
39
|
+
{"name": "examples", "description": "The documents every installed plugin ships."},
|
|
38
40
|
{"name": "schema", "description": "The shape a document is written against."},
|
|
39
41
|
{"name": "schemas", "description": "Named JSON Schemas the instance holds."},
|
|
40
42
|
{"name": "workers", "description": "The worker registry."},
|
|
@@ -58,6 +60,7 @@ def build_router() -> APIRouter:
|
|
|
58
60
|
alerts,
|
|
59
61
|
connections,
|
|
60
62
|
blocks,
|
|
63
|
+
examples,
|
|
61
64
|
schema,
|
|
62
65
|
schemas,
|
|
63
66
|
workers,
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"""The example corpus every installed plugin contributes, and the source of one document.
|
|
2
|
+
|
|
3
|
+
The catalogue is read off the plugin host rather than the database: it is what this build of
|
|
4
|
+
the instance ships, not what anyone applied. The host walks the shelves once, on the first
|
|
5
|
+
request that asks for them.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from typing import Annotated
|
|
9
|
+
|
|
10
|
+
from fastapi import APIRouter, HTTPException, Query, status
|
|
11
|
+
|
|
12
|
+
from dirigent_client.schemas import ExampleDetail, ExampleOut, Page
|
|
13
|
+
from dirigent_core.examples import ExampleEntry
|
|
14
|
+
from dirigent_core.plugins import UnknownExample
|
|
15
|
+
from dirigent_server.dependencies import ServicesDep
|
|
16
|
+
from dirigent_server.pagination import DEFAULT_PAGE, AfterParam, LimitParam, clip
|
|
17
|
+
from dirigent_server.security import PrincipalDep
|
|
18
|
+
from dirigent_server.transactions import Transactional
|
|
19
|
+
|
|
20
|
+
router = APIRouter(route_class=Transactional, tags=["examples"])
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def render(entry: ExampleEntry) -> ExampleOut:
|
|
24
|
+
"""Render one catalogue entry for a listing."""
|
|
25
|
+
return ExampleOut(
|
|
26
|
+
code=entry.code,
|
|
27
|
+
name=entry.name,
|
|
28
|
+
description=entry.description,
|
|
29
|
+
tags=entry.tags,
|
|
30
|
+
requires=entry.requires,
|
|
31
|
+
plugin=entry.plugin,
|
|
32
|
+
shelf=entry.shelf,
|
|
33
|
+
starter=entry.starter,
|
|
34
|
+
carries=entry.carries,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
@router.get("/examples", operation_id="listExamples", summary="List examples", response_model=Page[ExampleOut])
|
|
39
|
+
async def list_examples(
|
|
40
|
+
services: ServicesDep,
|
|
41
|
+
principal: PrincipalDep,
|
|
42
|
+
tag: Annotated[
|
|
43
|
+
list[str] | None,
|
|
44
|
+
Query(description="Only documents wearing this tag; repeat it to name more, and all must match."),
|
|
45
|
+
] = None,
|
|
46
|
+
shelf: Annotated[str | None, Query(description="Only documents on this shelf.")] = None,
|
|
47
|
+
plugin: Annotated[str | None, Query(description="Only documents this distribution ships.")] = None,
|
|
48
|
+
starter: Annotated[
|
|
49
|
+
bool | None, Query(description="Only the documents that may be copied, or only the ones that may not.")
|
|
50
|
+
] = None,
|
|
51
|
+
after: AfterParam = None,
|
|
52
|
+
limit: LimitParam = DEFAULT_PAGE,
|
|
53
|
+
) -> Page[ExampleOut]:
|
|
54
|
+
"""List the documents every installed plugin ships, in plugin, shelf, code order."""
|
|
55
|
+
wanted = set(tag or [])
|
|
56
|
+
found = [
|
|
57
|
+
render(entry)
|
|
58
|
+
for entry in services.host.examples()
|
|
59
|
+
if wanted <= set(entry.tags)
|
|
60
|
+
and (shelf is None or entry.shelf == shelf)
|
|
61
|
+
and (plugin is None or entry.plugin == plugin)
|
|
62
|
+
and (starter is None or entry.starter is starter)
|
|
63
|
+
]
|
|
64
|
+
if after is not None:
|
|
65
|
+
found = [entry for entry in found if _cursor(entry) > after]
|
|
66
|
+
items, following = clip(found[: limit + 1], limit, _cursor)
|
|
67
|
+
return Page(items=items, next=following)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def _cursor(entry: ExampleOut) -> str:
|
|
71
|
+
"""Name a row the way the listing orders it, so a cursor continues that order."""
|
|
72
|
+
return f"{entry.plugin}/{entry.shelf}/{entry.code}"
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
@router.get(
|
|
76
|
+
"/examples/{code}",
|
|
77
|
+
operation_id="readExample",
|
|
78
|
+
summary="Read an example",
|
|
79
|
+
response_model=ExampleDetail,
|
|
80
|
+
)
|
|
81
|
+
async def read_example(code: str, services: ServicesDep, principal: PrincipalDep) -> ExampleDetail:
|
|
82
|
+
"""Read one example by its code, with the text a copy of it copies."""
|
|
83
|
+
try:
|
|
84
|
+
entry = services.host.example(code)
|
|
85
|
+
except UnknownExample as error:
|
|
86
|
+
raise HTTPException(
|
|
87
|
+
status_code=status.HTTP_409_CONFLICT if error.plugins else status.HTTP_404_NOT_FOUND,
|
|
88
|
+
detail=str(error),
|
|
89
|
+
) from error
|
|
90
|
+
return ExampleDetail(**render(entry).model_dump(), source=entry.source, path=entry.path)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./PageState-
|
|
1
|
+
import{n as e}from"./PageState-BxxntCdE.js";import{r as t}from"./utils-CRMSf51M.js";import{t as n}from"./use-store-CgWwefFs.js";import{n as r,t as i}from"./auth-Chi4DcFq.js";var a=t(),o={status:403,title:`Forbidden`,detail:`This screen is an admin's. Operators may define, run and observe pipelines; managing accounts, tokens and connections is an admin's.`,problems:[],instance:null};function s({children:t}){let s=n(i);return r(s)?(0,a.jsx)(a.Fragment,{children:t}):(0,a.jsx)(e,{loading:!1,problem:o,empty:!1,children:null})}export{s as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-BatatxyT.js";import{r as n}from"./with-selector-BQ0vq4Ay.js";import{n as r}from"./chunk-BV7QT456-Bfa1dvOx.js";import{i,r as a}from"./api-DxX94A25.js";import{n as o,o as s,t as c}from"./PageState-BxxntCdE.js";import{r as l,t as u}from"./ListTable-B9skT-_Y.js";import{r as d}from"./utils-CRMSf51M.js";import{d as f,f as p}from"./paging-DL6m7m7g.js";import{t as m}from"./input-C5XexCJf.js";import{t as h}from"./identity-BNZxCf_y.js";import{n as g,s as _}from"./pipelines-CU_Q479F.js";import{$ as v,At as y,Dt as b,E as x,Ft as S,Mt as C,Nt as w,Ot as T,S as E,b as D,et as O,g as k,it as A,jt as j,kt as M,ot as N,pt as P,st as F,ut as I,v as L,y as R}from"./index-DziHXrVI.js";import{t as z}from"./Description-DVFPKyRO.js";import{t as B}from"./WindowedPane-bblrzCyF.js";import{l as V}from"./connections-1Ltd2U4L.js";import{n as H,t as ee}from"./Refusal-DgcJTR4J.js";import{t as U}from"./Instant-BWqGNC0V.js";import{t as te}from"./Segmented-DvCzioEn.js";import{t as ne}from"./ProgramReference-5SoAtU41.js";import{t as re}from"./Picker-R-mumgI7.js";import{t as ie}from"./AdminOnly-ji4IpQ_T.js";var W=n(`bell-plus`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M15 8h6`,key:`8ybuxh`}],[`path`,{d:`M18 5v6`,key:`g5ayrv`}],[`path`,{d:`M20.002 14.464a9 9 0 0 0 .738.863A1 1 0 0 1 20 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 8.75-5.332`,key:`1abcvy`}]]),G=n(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),K=e(t(),1),ae=[`run_failed`,`run_completed_with_errors`,`run_succeeded`,`run_stuck`],oe=[`pending`,`sending`,`sent`,`failed`],se=`0s`;function ce(e){return e===se?`none`:e}function le(e){return e.replaceAll(`_`,` `)}function ue(e){return e.scope===`pipeline`&&e.pipeline!==null?e.pipeline:`every pipeline`}function de(e){return e.active&&!e.paused}function fe(e){return e===`sent`||e===`failed`}function pe(e,t=50){let n=new URLSearchParams({limit:String(t)});return e!==null&&n.set(`after`,e),`/alert-rules?${n.toString()}`}function me(e){return a(pe(e))}function he(e){return i(`/alert-rules`,`POST`,e)}function ge(e,t){return i(`/alert-rules/${encodeURIComponent(e)}`,`PATCH`,t)}function _e(e,t){return ge(e,{paused:t})}function ve(e){return a(`/alert-rules/${encodeURIComponent(e)}`,{method:`DELETE`})}var ye={status:``,notifier:``};function be(e,t,n=50){let r=new URLSearchParams({limit:String(n)});return e.status!==``&&r.set(`status`,e.status),e.notifier!==``&&r.set(`notifier`,e.notifier),t!==null&&r.set(`after`,t),`/notifications?${r.toString()}`}function xe(e,t){return a(be(e,t))}function Se(e){return a(`/notifications/${encodeURIComponent(e)}`)}function Ce(e){return i(`/notifications/${encodeURIComponent(e)}/$retry`,`POST`,{})}function we(e){return i(`/alert-rules/$test`,`POST`,e)}async function Te(){return(await a(`/blocks`)).notifiers.map(e=>e.id)}function Ee(e,t){let n=[];for(let r of e){if(r===`log`){n.push({id:r,notifier:r,connection:null,reachable:!0,last_check_at:null,last_check_healthy:null,last_check_detail:null});continue}let e=t.filter(e=>e.kind===r);if(e.length===0){n.push({id:r,notifier:r,connection:null,reachable:!1,last_check_at:null,last_check_healthy:null,last_check_detail:null});continue}for(let t of e)n.push({id:`${r}:${t.code}`,notifier:r,connection:t.code,reachable:!0,last_check_at:t.last_check_at,last_check_healthy:t.last_check_healthy,last_check_detail:t.last_check_detail})}return n}function De(e){return e.notifier===`log`?{tone:`good`,label:`built in`,detail:null}:e.reachable?e.last_check_at===null?{tone:`quiet`,label:`never checked`,detail:null}:{tone:e.last_check_healthy===!0?`good`:`critical`,label:e.last_check_healthy===!0?`checked`:`failing`,detail:e.last_check_detail}:{tone:`quiet`,label:`no connection`,detail:`Nothing delivers through this channel yet.`}}var Oe=/^[a-z0-9]+(?:[-_][a-z0-9]+)*$/u,ke=/^(?:\d+(?:ms|s|m|h|d|w))+$/u,Ae=`A Jinja template: {{ run.* }} reads the run's pipeline, status, id, error, trigger, duration_ms and url.`,je=`A Jinja template over the run's facts; report is the run's report document when it has one.`,q=`text/x-jinja`;function J(e){let t=e.trim();return t===``?null:t}var Me=[{value:`global`,label:`Every pipeline`},{value:`pipeline`,label:`One pipeline`}],Ne={run_failed:`Failed`,run_completed_with_errors:`Completed with errors`,run_succeeded:`Succeeded`,run_stuck:`Stuck`};function Y(e){return e!==``&&e!==`log`}function Pe(e){if(e.code.trim()===``)return`A rule is addressed by its code, and this one has none.`;if(!Oe.test(e.code.trim()))return`A code is lowercase words joined by - or _.`;if(e.scope===`pipeline`&&e.pipeline===``)return`A rule watching one pipeline names that pipeline, and this one names none.`;if(e.notifier===``)return`A rule delivers through a channel, and this one names none.`;if(Y(e.notifier)&&e.connection===``)return`The ${e.notifier} channel delivers through a connection, and this one names none.`;if(!ke.test(e.throttle.trim()))return`A throttle is a duration, such as 15m.`}function Fe(e,t){if(e===``)return`A test goes through a channel, and this one names none.`;if(Y(e)&&t===``)return`The ${e} channel delivers through a connection, and this one names none.`}var X=d();function Ie({rule:e,onChanged:t,onDeleted:n,onTest:r}){let[i,a]=(0,K.useState)(!1),[o,c]=(0,K.useState)(null),l=o===e.code,u=R(),d=(0,K.useCallback)(e=>xe(ye,e),[]),{state:f}=L(d,ze),m=f.rows.filter(t=>t.rule===e.code);return(0,X.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,X.jsxs)(He,{thing:e,children:[e.paused&&(0,X.jsx)(Ve,{children:`paused`}),!e.active&&(0,X.jsx)(Ve,{children:`off`})]}),(0,X.jsx)(z,{text:e.description}),(0,X.jsxs)(`dl`,{className:`space-y-1.5`,children:[(0,X.jsx)(Q,{label:`Event`,children:le(e.event)}),(0,X.jsx)(Q,{label:`Scope`,children:ue(e)}),(0,X.jsx)(Q,{label:`Delivers through`,children:(0,X.jsx)(Z,{notifier:e.notifier,connection:e.connection})}),(0,X.jsx)(Q,{label:`Throttle`,children:ce(e.throttle)}),l?(0,X.jsx)(Le,{rule:e,onDone:()=>{c(null)},onSaved:e=>{t(e),c(null)}},e.code):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Q,{label:`Subject`,children:(0,X.jsxs)(`span`,{className:`flex flex-wrap items-baseline gap-2`,children:[e.template===null?(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`none`}):(0,X.jsx)(`span`,{className:`font-mono text-xs break-all`,children:e.template}),(0,X.jsx)(s,{why:u.why,children:(0,X.jsx)(p,{variant:`ghost`,size:`xs`,disabled:!u.may,title:u.why,onClick:()=>{c(e.code)},children:`Edit`})})]})}),e.body!==null&&(0,X.jsx)(Q,{label:`Body`,children:(0,X.jsx)(`span`,{className:`line-clamp-3 font-mono text-xs break-words whitespace-pre-wrap`,children:e.body})})]}),(0,X.jsx)(Q,{label:`Last sent`,children:e.last_sent_at===null?(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`never`}):(0,X.jsx)(U,{at:e.last_sent_at})})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,X.jsx)(s,{why:u.why,children:(0,X.jsx)(p,{variant:`outline`,size:`sm`,disabled:i||!u.may,title:u.why,onClick:()=>{a(!0),_e(e.code,!e.paused).then(t,H).finally(()=>{a(!1)})},children:e.paused?`Resume`:`Pause`})}),(0,X.jsx)(s,{why:u.why,children:(0,X.jsx)(p,{variant:`outline`,size:`sm`,disabled:!u.may,title:u.why,onClick:r,children:`Send a test`})}),(0,X.jsx)(s,{why:u.why,children:(0,X.jsx)(p,{variant:`outline`,size:`sm`,className:`destructive-action ml-auto`,disabled:i||!u.may,title:u.why,onClick:()=>{a(!0),ve(e.code).then(n,H).finally(()=>{a(!1)})},children:`Delete`})})]}),(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Recent deliveries`}),!f.read&&(0,X.jsx)(`p`,{className:`text-xs text-faint`,children:`Reading from the server`}),f.read&&m.length===0&&(0,X.jsx)(`p`,{className:`text-xs text-faint`,children:`Nothing sent.`}),(0,X.jsx)(`ul`,{className:`divide-y divide-border`,children:m.map(e=>(0,X.jsxs)(`li`,{className:`row-hover -mx-4 flex items-center gap-2 px-4 py-2`,children:[(0,X.jsx)(E,{status:e.status}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs`,children:e.subject}),(0,X.jsx)(U,{className:`shrink-0 text-xs text-faint`,at:e.created_at})]},e.id))})]})]})}function Le({rule:e,onDone:t,onSaved:n}){let[r,i]=(0,K.useState)(e.template??``),[a,o]=(0,K.useState)(e.body??``),[s,c]=(0,K.useState)(null),[l,u]=(0,K.useState)(!1),d=`alert-rule/${e.code}/body`,h=`rule-${e.code}-subject`;return(0,X.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-border bg-secondary/30 p-3`,children:[(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(x,{htmlFor:h,children:`Subject`}),(0,X.jsx)(m,{id:h,className:`font-mono`,spellCheck:!1,autoComplete:`off`,value:r,placeholder:`{{ run.pipeline }} run {{ run.status }}`,onChange:e=>{i(e.target.value)}}),(0,X.jsx)(`p`,{className:`text-xs text-faint`,children:Ae})]}),(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(x,{children:`Body`}),(0,X.jsx)(`p`,{className:`text-xs text-faint`,children:je}),(0,X.jsx)(B,{name:`body`,className:`overflow-hidden rounded-md border border-border bg-background`,aside:(0,X.jsx)(ne,{mediaType:q}),windowed:(0,X.jsx)(A,{value:a,mediaType:q,path:d,label:`body, in a window`,className:`min-h-0 flex-1`,onChange:o}),children:(0,X.jsx)(A,{value:a,mediaType:q,path:d,label:`body`,placeholder:`{{ run.pipeline }} ended {{ run.status }}: {{ run.url }}`,className:`h-40 min-h-32`,onChange:o})})]}),s!==null&&(0,X.jsx)(ee,{problem:s}),(0,X.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,X.jsx)(p,{variant:`ghost`,size:`sm`,onClick:t,children:`Cancel`}),(0,X.jsx)(p,{size:`sm`,disabled:l,onClick:()=>{let i={};if(J(r)!==e.template&&(i.template=J(r)),J(a)!==e.body&&(i.body=J(a)),Object.keys(i).length===0){t();return}u(!0),c(null),ge(e.code,i).then(n,e=>{c(f(e))}).finally(()=>{u(!1)})},children:l?`Saving`:`Save`})]})]})}function Re({notification:e,onChanged:t}){let[n,i]=(0,K.useState)(!1),a=R();return(0,X.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,X.jsx)(`div`,{className:`space-y-1`,children:(0,X.jsxs)(`p`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(E,{status:e.status}),(0,X.jsx)(`span`,{className:`text-sm font-semibold`,children:e.subject})]})}),(0,X.jsxs)(`dl`,{className:`space-y-1.5`,children:[e.rule===null?(0,X.jsx)(Q,{label:`Raised by`,children:(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`a test, not a rule`})}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Q,{label:`Event`,children:le(e.event)}),(0,X.jsx)(Q,{label:`Rule`,children:(0,X.jsx)(`span`,{className:`font-mono text-xs`,children:e.rule})})]}),(0,X.jsx)(Q,{label:`Delivers through`,children:(0,X.jsx)(Z,{notifier:e.notifier,connection:e.connection})}),(0,X.jsx)(Q,{label:`Run`,children:(0,X.jsx)(Be,{notification:e})}),(0,X.jsx)(Q,{label:`Queued`,children:(0,X.jsx)(U,{at:e.created_at})}),e.status===`sent`?(0,X.jsx)(Q,{label:`Sent`,children:(0,X.jsx)(U,{at:e.sent_at})}):(0,X.jsx)(Q,{label:`Next try`,children:(0,X.jsx)(U,{at:e.available_at})}),(0,X.jsxs)(Q,{label:`Attempts`,children:[e.attempt,` of `,e.max_attempts]})]}),e.error!==null&&(0,X.jsxs)(`div`,{className:`space-y-1`,children:[(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`What the channel said`}),(0,X.jsx)(`p`,{className:`text-xs break-words text-critical`,children:e.error}),(0,X.jsx)(`p`,{className:`text-xs text-faint`,children:`Only the latest refusal is kept. Earlier attempts are counted, not stored.`})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,X.jsx)(s,{why:a.why,children:(0,X.jsx)(p,{variant:`outline`,size:`sm`,disabled:n||!a.may,title:a.why,onClick:()=>{i(!0),Ce(e.id).then(t,H).finally(()=>{i(!1)})},children:`Retry now`})}),e.run_id!==null&&(0,X.jsx)(p,{variant:`outline`,size:`sm`,render:(0,X.jsx)(r,{to:`/runs/${e.run_id}`}),children:`Open the run`})]})]})}var ze=e=>e.id;function Z({notifier:e,connection:t}){return(0,X.jsxs)(`span`,{className:`flex flex-wrap items-baseline gap-1.5`,children:[(0,X.jsx)(`span`,{className:`text-sm`,children:e}),t!==null&&(0,X.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:t})]})}function Be({notification:e}){if(e.run_id===null)return(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`no run`});let t=e.run_pipeline??`a run`;return(0,X.jsxs)(r,{className:`text-primary hover:underline`,to:`/runs/${e.run_id}`,children:[(0,X.jsx)(`span`,{className:`text-sm`,children:t}),e.run_started_at!==null&&(0,X.jsx)(U,{className:`ml-1.5 text-xs text-muted-foreground`,at:e.run_started_at})]})}function Ve({children:e}){return(0,X.jsx)(`span`,{className:`rounded-sm border border-border px-1.5 text-xs text-muted-foreground`,children:e})}function He({thing:e,children:t}){let n=h(e);return(0,X.jsxs)(`p`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(`span`,{className:n.named?`text-sm font-semibold`:`font-mono text-sm font-semibold`,children:n.title}),t,n.code!==null&&(0,X.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:n.code})]})}function Q({label:e,children:t}){return(0,X.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,X.jsx)(`dt`,{className:`w-32 shrink-0 text-xs text-muted-foreground`,children:e}),(0,X.jsx)(`dd`,{className:`min-w-0 text-sm`,children:t})]})}var Ue={good:`var(--good)`,critical:`var(--critical)`,quiet:`var(--faint)`};function We({channels:e}){return(0,X.jsx)(`ul`,{className:`grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-4`,children:e.map(e=>(0,X.jsx)(Ge,{channel:e},e.id))})}function Ge({channel:e}){let t=De(e);return(0,X.jsxs)(`li`,{className:`flex items-start justify-between gap-3 rounded-lg border border-border bg-card p-3`,children:[(0,X.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,title:e.connection===null?e.notifier:`${e.notifier} ${e.connection}`,children:[(0,X.jsx)(`span`,{className:`status-dot shrink-0`,style:{"--chip":Ue[t.tone]}}),(0,X.jsx)(`span`,{className:`shrink-0 text-sm font-medium`,children:e.notifier}),e.connection!==null&&(0,X.jsx)(`span`,{className:`truncate font-mono text-xs text-muted-foreground`,children:e.connection})]}),(0,X.jsxs)(`span`,{className:`flex shrink-0 flex-col items-end`,children:[(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t.label}),e.last_check_at!==null&&(0,X.jsx)(U,{className:`text-xs text-faint`,at:e.last_check_at}),t.detail!==null&&(0,X.jsx)(`span`,{className:`max-w-48 truncate text-xs text-faint`,title:t.detail,children:t.detail})]})]})}function $({id:e,label:t,value:n,onChange:r,placeholder:i,mono:a,hint:o}){return(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(x,{htmlFor:e,children:t}),(0,X.jsx)(m,{id:e,className:a===!0?`font-mono`:void 0,spellCheck:!1,autoComplete:`off`,value:n,placeholder:i,onChange:e=>{r(e.target.value)}}),o!==void 0&&(0,X.jsx)(`p`,{className:`text-xs text-faint`,children:o})]})}function Ke({id:e,notifiers:t,value:n,onChange:r}){return(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(x,{htmlFor:e,children:`Notifier`}),(0,X.jsx)(re,{id:e,label:`Notifier`,value:n,options:t.map(e=>({value:e,label:e,aside:``})),placeholder:`Search the installed channels`,onChange:r})]})}function qe({id:e,kind:t,value:n,onChange:r}){let i=Je(t);return(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(x,{htmlFor:e,children:`Connection`}),(0,X.jsx)(re,{id:e,label:`Connection`,value:n,options:i,placeholder:i.length===0?`No ${t} connection yet`:`Search by name or code`,onChange:r})]})}function Je(e){let[t,n]=(0,K.useState)([]);return(0,K.useEffect)(()=>{if(e===``||e===`log`)return;let t=!0;return V().then(e=>{t&&n(e.items)},()=>{t&&n([])}),()=>{t=!1}},[e]),t.filter(t=>t.kind===e).map(e=>{let t=h(e);return{value:e.code,label:t.title,aside:t.code??``}})}var Ye=`0s`,Xe=`alert-rule/new/body`,Ze=`body`;function Qe({open:e,onOpenChange:t,notifiers:n,onCreated:r}){let[i,a]=(0,K.useState)(``),[o,c]=(0,K.useState)(``),[l,u]=(0,K.useState)(``),[d,m]=(0,K.useState)(`run_failed`),[h,g]=(0,K.useState)(`global`),[_,v]=(0,K.useState)(``),[y,S]=(0,K.useState)(``),[E,O]=(0,K.useState)(``),[k,N]=(0,K.useState)(``),[P,F]=(0,K.useState)(``),[I,L]=(0,K.useState)(Ye),[z,V]=(0,K.useState)(null),[H,U]=(0,K.useState)(!1),ie=$e(e),W=R(),G=D(W.why,Pe({code:i,scope:h,pipeline:_,notifier:y,connection:E,throttle:I}));return(0,X.jsx)(b,{open:e,onOpenChange:t,children:(0,X.jsxs)(M,{className:`flex max-h-[calc(100vh-4rem)] flex-col sm:max-w-3xl`,showCloseButton:!1,children:[(0,X.jsx)(C,{children:(0,X.jsx)(w,{children:`New rule`})}),(0,X.jsxs)(`div`,{className:`-mx-1 min-h-0 flex-1 space-y-4 overflow-y-auto px-1`,children:[(0,X.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:[(0,X.jsx)($,{id:`rule-code`,label:`Code`,value:i,onChange:a,placeholder:`ops-slack-failed`,mono:!0}),(0,X.jsx)($,{id:`rule-name`,label:`Name`,value:o,onChange:c,placeholder:`Tell the ops channel`})]}),(0,X.jsx)($,{id:`rule-description`,label:`Description`,value:l,onChange:u,placeholder:`What this rule is for`}),(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(x,{children:`Event`}),(0,X.jsx)(te,{label:`Event`,size:`md`,value:d,options:ae.map(e=>({value:e,label:Ne[e]})),onChoose:m})]}),(0,X.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:[(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(x,{children:`Scope`}),(0,X.jsx)(te,{label:`Scope`,size:`md`,value:h,options:Me,onChoose:g})]}),h===`pipeline`&&(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(x,{htmlFor:`rule-pipeline`,children:`Pipeline`}),(0,X.jsx)(re,{id:`rule-pipeline`,label:`Pipeline`,value:_,options:ie,placeholder:`Search by name or code`,onChange:v})]})]}),(0,X.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:[(0,X.jsx)(Ke,{id:`rule-notifier`,notifiers:n,value:y,onChange:e=>{S(e),O(``)}}),Y(y)&&(0,X.jsx)(qe,{id:`rule-connection`,kind:y,value:E,onChange:O})]}),(0,X.jsx)($,{id:`rule-subject`,label:`Subject`,value:k,onChange:N,placeholder:`{{ run.pipeline }} run {{ run.status }}`,mono:!0,hint:Ae}),(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(x,{children:`Body`}),(0,X.jsx)(`p`,{className:`text-xs text-faint`,children:je}),(0,X.jsx)(B,{name:Ze,className:`overflow-hidden rounded-md border border-border`,aside:(0,X.jsx)(ne,{mediaType:q}),windowed:(0,X.jsx)(A,{value:P,mediaType:q,path:Xe,label:`${Ze}, in a window`,className:`min-h-0 flex-1`,onChange:F}),children:(0,X.jsx)(A,{value:P,mediaType:q,path:Xe,label:Ze,placeholder:`{{ run.pipeline }} ended {{ run.status }}: {{ run.url }}`,className:`h-40 min-h-32`,onChange:F})})]}),(0,X.jsx)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:(0,X.jsx)($,{id:`rule-throttle`,label:`Throttle`,value:I,onChange:L,placeholder:`15m`,mono:!0})})]}),z!==null&&(0,X.jsx)(ee,{problem:z}),(0,X.jsxs)(j,{children:[(0,X.jsx)(`p`,{className:`mr-auto self-center text-xs text-muted-foreground`,children:`A rule fires when a run settles. Nothing is sent now.`}),(0,X.jsx)(T,{render:(0,X.jsx)(p,{variant:`ghost`}),children:`Close`}),(0,X.jsx)(s,{why:G,children:(0,X.jsx)(p,{disabled:H||G!==void 0,title:G,onClick:()=>{U(!0),V(null),he({code:i.trim(),name:J(o),description:J(l),event:d,notifier:y,scope:h,pipeline:h===`pipeline`?_:null,connection:Y(y)?E:null,template:J(k),body:J(P),throttle:I.trim()}).then(()=>{r(),a(``),c(``),u(``),N(``),F(``),t(!1)},e=>{V(f(e))}).finally(()=>{U(!1)})},children:H?`Creating`:`Create`})})]})]})})}function $e(e){let[t,n]=(0,K.useState)([]);return(0,K.useEffect)(()=>{if(!e)return;let t=!0;return _().then(e=>{t&&n(e.toSorted(g).map(e=>{let t=h(e);return{value:e.code,label:t.title,aside:t.code??``}}))},()=>{t&&n([])}),()=>{t=!1}},[e]),t}var et=1e3,tt=6e4,nt=`dirigent test alert`,rt={notifier:``,connection:``,subject:``};function it({open:e,draft:t,onOpenChange:n,notifiers:r,onQueued:i,onOpenQueue:a}){let[o,c]=(0,K.useState)(t.notifier),[l,u]=(0,K.useState)(t.connection),[d,m]=(0,K.useState)(t.subject),[h,g]=(0,K.useState)(null),[_,v]=(0,K.useState)(null),[x,S]=(0,K.useState)(!1),E=ot(h),O=R(),k=E!==null&&fe(E.status)?E.id:null;(0,K.useEffect)(()=>{k!==null&&i()},[k]);let A=D(O.why,Fe(o,l));return(0,X.jsx)(b,{open:e,onOpenChange:n,children:(0,X.jsxs)(M,{className:`sm:max-w-lg`,showCloseButton:!1,children:[(0,X.jsxs)(C,{children:[(0,X.jsx)(w,{children:`Send a test`}),(0,X.jsx)(y,{children:`The message goes through the same queue a real alert does, and a worker delivers it.`})]}),(0,X.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:[(0,X.jsx)(Ke,{id:`test-notifier`,notifiers:r,value:o,onChange:e=>{c(e),u(``)}}),Y(o)&&(0,X.jsx)(qe,{id:`test-connection`,kind:o,value:l,onChange:u})]}),(0,X.jsx)($,{id:`test-subject`,label:`Subject`,value:d,onChange:m,placeholder:nt}),_!==null&&(0,X.jsx)(ee,{problem:_}),E!==null&&(0,X.jsx)(at,{row:E}),(0,X.jsxs)(j,{children:[(0,X.jsx)(T,{render:(0,X.jsx)(p,{variant:`ghost`}),children:`Close`}),h!==null&&(0,X.jsx)(p,{variant:`outline`,onClick:()=>{a(h)},children:`Open in the queue`}),(0,X.jsx)(s,{why:A,children:(0,X.jsx)(p,{disabled:x||A!==void 0,title:A,onClick:()=>{S(!0),v(null),g(null),we({notifier:o,connection:Y(o)?l:null,...d.trim()===``?{}:{subject:d.trim()}}).then(e=>{g(e.notification_id),i()},e=>{v(f(e))}).finally(()=>{S(!1)})},children:h===null?`Send`:`Send again`})})]})]})})}function at({row:e}){return(0,X.jsxs)(`div`,{className:`space-y-2 rounded-lg border border-border bg-secondary/40 p-3`,"data-testid":`test-delivery`,"aria-live":`polite`,children:[(0,X.jsxs)(`p`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(E,{status:e.status}),(0,X.jsx)(`span`,{className:`text-sm`,children:e.subject})]}),(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.status===`sent`?(0,X.jsxs)(X.Fragment,{children:[`Delivered `,(0,X.jsx)(U,{at:e.sent_at}),`.`]}):e.status===`failed`?(0,X.jsxs)(X.Fragment,{children:[`Given up after `,e.attempt,` of `,e.max_attempts,` attempts.`]}):e.attempt===0?`Queued for the next worker pass.`:(0,X.jsxs)(X.Fragment,{children:[`Attempt `,e.attempt,` of `,e.max_attempts,`, next try`,` `,(0,X.jsx)(U,{at:e.available_at}),`.`]})}),e.error!==null&&(0,X.jsx)(`p`,{className:`text-xs break-words text-critical`,children:e.error})]})}function ot(e){let[t,n]=(0,K.useState)(null);return(0,K.useEffect)(()=>{if(e===null)return;let t=!0,r,i=Date.now()+tt,a=()=>{Se(e).then(o=>{t&&(n({id:e,row:o}),!(fe(o.status)||Date.now()>i)&&(r=setTimeout(a,et)))},()=>{})};return a(),()=>{t=!1,r!==void 0&&clearTimeout(r)}},[e]),t!==null&&t.id===e?t.row:null}var st=e=>e.id,ct=e=>e.id;function lt(){return(0,X.jsx)(ie,{children:(0,X.jsx)(ut,{})})}function ut(){let[e,t]=(0,K.useState)(!1),[n,r]=(0,K.useState)(null),[i,a]=(0,K.useState)(null),[s,d]=(0,K.useState)(null),[f,p]=(0,K.useState)({status:``,notifier:``}),[m,h]=(0,K.useState)({}),[g,_]=(0,K.useState)({}),y=L((0,K.useCallback)(e=>me(e),[]),st),b=L((0,K.useCallback)(e=>xe(f,e),[f]),ct),x=pt(),{reload:C}=y,{reload:w}=b,T=(0,K.useMemo)(()=>y.state.rows.map(e=>m[e.id]??e),[m,y.state.rows]),D=(0,K.useMemo)(()=>b.state.rows.map(e=>g[e.id]??e),[g,b.state.rows]),A=T.find(e=>e.id===i)??null,j=D.find(e=>e.id===s)??null,M=(0,K.useCallback)(e=>{r(t=>({draft:e,opened:(t?.opened??0)+1}))},[]);(0,K.useEffect)(()=>(O({note:null,tone:`quiet`,identifier:null}),v),[]),(0,K.useEffect)(()=>{if(A!==null){let e=A;return N([{id:`rule`,label:`Rule`,render:()=>(0,X.jsx)(Ie,{rule:e,onChanged:e=>{h(t=>({...t,[e.id]:e}))},onDeleted:()=>{a(null),C()},onTest:()=>{M({notifier:e.notifier,connection:e.connection??``,subject:``})}})}],{screen:`alerting`})}if(j!==null){let e=j;return N([{id:`notification`,label:`Notification`,render:()=>(0,X.jsx)(Re,{notification:e,onChanged:e=>{_(t=>({...t,[e.id]:e}))}})}],{screen:`alerting`})}},[j,A,M,C]);let z=R(`admin`),B=z.may;return(0,K.useEffect)(()=>P([...B?[{id:`alerting:rule`,title:`New alert rule`,group:I,screen:!0,icon:W,keywords:[`alert`,`event`,`create`],run:()=>{t(!0)}},{id:`alerting:test`,title:`Send a test through a channel`,group:I,screen:!0,icon:G,keywords:[`alert`,`notification`,`try`],run:()=>{M(rt)}}]:[],{id:`alerting:reload`,title:`Read the alert rules again`,group:I,screen:!0,icon:S,keywords:[`refresh`,`reload`],run:()=>{C(),w()}}]),[B,M,w,C]),(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(c,{title:`Alerting`,aside:(0,X.jsx)(l,{tag:`alerts`}),actions:[{id:`test`,label:`Send a test`,icon:G,variant:`outline`,disabled:!z.may,why:z.why,onClick:()=>{M(rt)}},{id:`rule`,label:`New rule`,icon:W,disabled:!z.may,why:z.why,onClick:()=>{t(!0)}}]}),(0,X.jsxs)(`section`,{className:`mb-6 space-y-2`,children:[(0,X.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Channels`}),x.read?x.rows.length===0?(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No channel is installed.`}):(0,X.jsx)(We,{channels:x.rows}):(0,X.jsx)(`p`,{className:`text-sm text-faint`,children:`Reading from the server`})]}),(0,X.jsxs)(`section`,{className:`space-y-2`,children:[(0,X.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Rules`}),(0,X.jsx)(o,{loading:!y.state.read,problem:y.state.problem,empty:T.length===0,emptyMessage:`No rules.`,children:(0,X.jsx)(u,{columns:mt,rows:T,rowKey:st,rowClassName:e=>de(e)?void 0:`opacity-60`,reading:y.state.reading,next:y.state.next,onMore:y.more,noun:`rules`,onSelect:e=>{d(null),a(e.id),F()},selected:e=>e.id===i})})]}),(0,X.jsxs)(`section`,{className:`mt-8 space-y-2`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,X.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Notifications`}),(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,X.jsx)(k,{label:`Status`,value:f.status,anything:`Any status`,options:oe.map(e=>({value:e,label:e,mark:(0,X.jsx)(E,{status:e})})),onChange:e=>{p(t=>({...t,status:e}))}}),(0,X.jsx)(k,{label:`Notifier`,value:f.notifier,anything:`Any notifier`,options:ft(x.rows),onChange:e=>{p(t=>({...t,notifier:e}))}})]})]}),(0,X.jsx)(o,{loading:!b.state.read,problem:b.state.problem,empty:D.length===0,emptyMessage:`Nothing queued.`,children:(0,X.jsx)(u,{columns:ht,rows:D,rowKey:ct,reading:b.state.reading,next:b.state.next,onMore:b.more,noun:`notifications`,onSelect:e=>{a(null),d(e.id),F()},selected:e=>e.id===s})})]}),(0,X.jsx)(Qe,{open:e,onOpenChange:t,notifiers:dt(x.rows),onCreated:C}),(0,X.jsx)(it,{open:n!==null,draft:n?.draft??rt,onOpenChange:e=>{e||r(null)},notifiers:dt(x.rows),onQueued:w,onOpenQueue:e=>{r(null),a(null),d(e),w(),F()}},n?.opened??0)]})}function dt(e){return[...new Set(e.map(e=>e.notifier))]}function ft(e){return dt(e).map(e=>({value:e,label:e}))}function pt(){let[e,t]=(0,K.useState)(null),[n,r]=(0,K.useState)(null);return(0,K.useEffect)(()=>{let e=!0;return Te().then(n=>{e&&t(n)},()=>{e&&t([])}),V().then(t=>{e&&r(t.items)},()=>{e&&r([])}),()=>{e=!1}},[]),{rows:(0,K.useMemo)(()=>Ee(e??[],n??[]),[n,e]),read:e!==null&&n!==null}}var mt=[{id:`rule`,header:`Rule`,cell:e=>{let t=h(e);return(0,X.jsxs)(`span`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,X.jsx)(`span`,{className:t.named?`text-sm font-medium`:`font-mono text-sm font-medium`,children:t.title}),t.code!==null&&(0,X.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:t.code})]})}},{id:`event`,header:`Event`,cell:e=>(0,X.jsx)(`span`,{className:`text-sm`,children:Ne[e.event]})},{id:`scope`,header:`Scope`,cell:e=>(0,X.jsx)(`span`,{className:e.scope===`pipeline`?`font-mono text-xs`:`text-sm`,children:ue(e)})},{id:`delivers`,header:`Delivers through`,cell:e=>(0,X.jsx)(Z,{notifier:e.notifier,connection:e.connection})},{id:`throttle`,header:`Throttle`,className:`font-mono text-xs`,cell:e=>(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:ce(e.throttle)})},{id:`sent`,header:`Last sent`,className:`text-xs`,cell:e=>e.last_sent_at===null?(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`never`}):(0,X.jsx)(U,{className:`text-muted-foreground`,at:e.last_sent_at})},{id:`live`,header:`State`,cell:e=>e.paused?(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`paused`}):e.active?(0,X.jsx)(`span`,{className:`text-xs text-good`,children:`active`}):(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`off`})}],ht=[{id:`status`,header:`Status`,cell:e=>(0,X.jsx)(E,{status:e.status})},{id:`subject`,header:`Subject`,cell:e=>(0,X.jsxs)(`span`,{className:`flex flex-col`,children:[(0,X.jsx)(`span`,{className:`text-sm`,children:e.subject}),e.error!==null&&(0,X.jsx)(`span`,{className:`max-w-96 truncate text-xs text-critical`,title:e.error,children:e.error})]})},{id:`delivers`,header:`Delivers through`,cell:e=>(0,X.jsx)(Z,{notifier:e.notifier,connection:e.connection})},{id:`run`,header:`Run`,cell:e=>(0,X.jsx)(Be,{notification:e})},{id:`queued`,header:`Queued`,className:`text-xs`,cell:e=>(0,X.jsx)(U,{className:`text-muted-foreground`,at:e.created_at})},{id:`sent`,header:`Sent`,className:`text-xs`,cell:e=>e.status===`sent`?(0,X.jsx)(U,{className:`text-muted-foreground`,at:e.sent_at}):e.attempt>0?(0,X.jsxs)(`span`,{className:`text-faint`,children:[e.attempt,` of `,e.max_attempts,` attempts`]}):null}];export{lt as AdminAlerting};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-BatatxyT.js";import{n}from"./chunk-BV7QT456-Bfa1dvOx.js";import{n as r,t as i}from"./PageState-BxxntCdE.js";import{r as a,t as o}from"./ListTable-B9skT-_Y.js";import{r as s}from"./utils-CRMSf51M.js";import{t as c}from"./input-C5XexCJf.js";import{$ as l,_ as u,et as d,ot as f,st as p}from"./index-DziHXrVI.js";import{t as m}from"./Markdown-B6er3LhH.js";import{n as h,r as g}from"./Panel-ClHPU8x_.js";import{a as _,c as v,l as y,n as b,o as x,r as S,t as C}from"./blocks-DgBe9px-.js";import{r as w}from"./schema-form-dcZ8A0M1.js";import{l as T,r as E}from"./examples-6Nbc5Lgs.js";import{t as D}from"./KindChip-CuBFi3X9.js";var O=e(t(),1),k=s(),A=e=>e.id,j=[{key:`scheme`,title:`Storage schemes`,noun:`schemes`},{key:`notifier`,title:`Notifiers`,noun:`notifiers`},{key:`connection`,title:`Connection kinds`,noun:`connection kinds`}],M=e=>t=>`${e}:${t.id}`,N=()=>{};function P(){let[e,t]=(0,O.useState)(``),[n,s]=(0,O.useState)(null),{value:m,problem:h,read:g}=u(v),y=u(T),b=(0,O.useMemo)(()=>E(y.value??[]),[y.value]),S=(0,O.useMemo)(()=>m?.blocks??[],[m]),w=(0,O.useMemo)(()=>_(S,e),[S,e]),D=(0,O.useMemo)(()=>C(w),[w]),P=(0,O.useMemo)(()=>x(m?.storage_schemes??[],e),[m,e]),I=(0,O.useMemo)(()=>x(m?.notifiers??[],e),[m,e]),B=(0,O.useMemo)(()=>x(m?.connection_kinds??[],e),[m,e]),V=(0,O.useMemo)(()=>F(b),[b]),H=S.find(e=>`block:${e.id}`===n)??null,U={scheme:P,notifier:I,connection:B},W=j.flatMap(e=>U[e.key].map(t=>({registry:e,entry:t}))).find(({registry:e,entry:t})=>M(e.key)(t)===n)??null;(0,O.useEffect)(()=>{if(g)return d({note:null,tone:`quiet`,identifier:null}),l},[S,g,m]),(0,O.useEffect)(()=>{if(H!==null)return f([{id:`block`,label:`Block`,render:()=>(0,k.jsx)(z,{entry:H})}],{screen:`blocks`});if(W!==null){let{registry:e,entry:t}=W;return f([{id:`entry`,label:e.title,render:()=>(0,k.jsx)(R,{entry:t})}],{screen:`blocks`})}},[H,W]);let G=(0,O.useCallback)(e=>{s(`block:${e.id}`),p()},[]);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(i,{title:`Blocks`,aside:(0,k.jsx)(a,{tag:`blocks`})}),(0,k.jsx)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:(0,k.jsx)(c,{className:`w-56`,value:e,onChange:e=>{t(e.target.value)},placeholder:`Search blocks`,"aria-label":`Search blocks by id or summary`})}),(0,k.jsx)(r,{loading:!g,problem:h,empty:w.length===0&&P.length===0&&I.length===0&&B.length===0,emptyMessage:S.length===0?`No blocks installed — plugins contribute them.`:`Nothing in the catalog matches that.`,children:(0,k.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[D.map(([e,t])=>(0,k.jsxs)(`section`,{children:[(0,k.jsx)(`h2`,{className:`mb-1.5 font-mono text-xs font-semibold tracking-wide text-faint uppercase`,children:e}),(0,k.jsx)(o,{chrome:{footer:!1},fixed:!0,columns:V,rows:t,rowKey:A,reading:!1,next:null,onMore:N,noun:`blocks`,onSelect:G,selected:e=>`block:${e.id}`===n})]},e)),j.map(e=>{let t=U[e.key];return t.length===0?null:(0,k.jsxs)(`section`,{children:[(0,k.jsx)(`h2`,{className:`mb-1.5 font-mono text-xs font-semibold tracking-wide text-faint uppercase`,children:e.title}),(0,k.jsx)(o,{chrome:{footer:!1},fixed:!0,columns:L(e.key),rows:t,rowKey:M(e.key),reading:!1,next:null,onMore:N,noun:e.noun,onSelect:t=>{s(M(e.key)(t)),p()},selected:t=>M(e.key)(t)===n})]},e.key)})]})})]})}function F(e){return[{id:`block`,header:`Block`,className:`w-full max-w-0`,cell:e=>(0,k.jsxs)(`div`,{className:`min-w-0`,children:[(0,k.jsx)(`span`,{className:`font-mono text-sm font-semibold`,children:e.id}),(0,k.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,title:e.summary,children:e.summary})]})},{id:`kind`,header:`Kind`,className:`w-32 whitespace-nowrap`,cell:e=>(0,k.jsx)(D,{kind:e.kind})},{id:`examples`,header:`Examples`,className:`w-28 whitespace-nowrap`,cell:t=>(0,k.jsx)(I,{id:t.id,many:e.get(t.id)??0})},{id:`plugin`,header:`Plugin`,className:`w-36 font-mono text-xs whitespace-nowrap`,cell:e=>(0,k.jsx)(`span`,{className:`text-muted-foreground`,children:e.plugin})}]}function I({id:e,many:t}){if(t===0)return(0,k.jsx)(`span`,{className:`text-xs text-faint`,children:`none`});let r=`${String(t)} ${t===1?`example`:`examples`}`;return(0,k.jsx)(n,{className:`text-xs text-primary-ink hover:underline`,to:`/examples?block=${encodeURIComponent(e)}`,title:`The shipped documents that require ${e}`,onClick:e=>{e.stopPropagation()},children:r})}function L(e){let t=e===`scheme`?`storage`:e;return[{id:`entry`,header:`Entry`,className:`w-full max-w-0`,cell:e=>{let t=typeof e.config_schema.description==`string`?e.config_schema.description:``;return(0,k.jsxs)(`div`,{className:`min-w-0`,children:[(0,k.jsx)(`span`,{className:`font-mono text-sm font-semibold`,children:e.id}),(0,k.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,title:t,children:t})]})}},{id:`kind`,header:`Kind`,className:`w-32 whitespace-nowrap`,cell:()=>(0,k.jsx)(D,{kind:t})},{id:`plugin`,header:`Plugin`,className:`w-36 font-mono text-xs whitespace-nowrap`,cell:e=>(0,k.jsx)(`span`,{className:`text-muted-foreground`,children:e.plugin})}]}function R({entry:e}){let t=(0,O.useMemo)(()=>w(e.config_schema),[e]),n=typeof e.config_schema.description==`string`?e.config_schema.description:null;return(0,k.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[(0,k.jsxs)(`div`,{className:`space-y-1`,children:[(0,k.jsx)(`h2`,{className:`font-mono text-sm font-semibold`,children:e.id}),n!==null&&(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n}),(0,k.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs`,children:(0,k.jsx)(h,{term:`plugin`,detail:e.plugin})})]}),(0,k.jsx)(g,{title:`Config`,children:t.length===0?(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This takes no configuration.`}):(0,k.jsx)(`div`,{className:`flex flex-col gap-4`,children:t.map(e=>(0,k.jsx)(B,{field:e},e.name))})})]})}function z({entry:e}){let t=(0,O.useMemo)(()=>w(e.config_schema),[e]),n=S(e);return(0,k.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[(0,k.jsxs)(`div`,{className:`space-y-1`,children:[(0,k.jsx)(`h2`,{className:`font-mono text-sm font-semibold`,children:e.id}),(0,k.jsx)(`p`,{children:(0,k.jsx)(D,{kind:e.kind})}),(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.summary})]}),(0,k.jsx)(g,{title:`Facts`,children:(0,k.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs`,children:n.map(e=>(0,k.jsx)(h,{term:e.term,detail:e.detail},e.term))})}),(0,k.jsx)(g,{title:`Config`,children:t.length===0?(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This block takes no configuration.`}):(0,k.jsx)(`div`,{className:`flex flex-col gap-4`,children:t.map(e=>(0,k.jsx)(B,{field:e},e.name))})})]})}function B({field:e}){let t=b(e);return(0,k.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2`,children:[(0,k.jsx)(`span`,{className:`font-mono text-sm font-medium`,children:e.name}),(0,k.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:y(e)}),e.required&&(0,k.jsx)(`span`,{className:`text-xs text-primary`,children:`required`}),e.hint!==null&&(0,k.jsx)(`span`,{className:`text-xs text-faint`,children:e.hint}),t!==null&&(0,k.jsxs)(`span`,{className:`text-xs text-faint`,children:[`default `,t]})]}),e.options.length>0&&(0,k.jsx)(`p`,{className:`font-mono text-xs text-muted-foreground`,children:e.options.map(e=>e.label).join(` · `)}),e.help!==null&&(0,k.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,k.jsx)(m,{text:e.help})})]})}export{P as Blocks};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-BatatxyT.js";import{r as n}from"./with-selector-BQ0vq4Ay.js";import{a as r,i,n as a,r as o,t as s}from"./select-fBLlNmQ_.js";import{n as c,o as l,t as u}from"./PageState-BxxntCdE.js";import{r as d,t as f}from"./ListTable-B9skT-_Y.js";import{r as p}from"./utils-CRMSf51M.js";import{d as m,f as h}from"./paging-DL6m7m7g.js";import{t as g}from"./input-C5XexCJf.js";import{t as _}from"./SchemaForm-C0jzhj3Z.js";import{t as v}from"./textarea-XMYmRm72.js";import{d as y,l as b,s as x}from"./format-B5YbYOY-.js";import{n as S,t as C}from"./identity-BNZxCf_y.js";import{$ as w,At as T,Dt as E,E as D,Ft as O,Mt as k,Nt as A,Ot as ee,b as te,et as j,ft as M,jt as ne,kt as re,ot as N,pt as ie,st as P,v as ae,y as F}from"./index-DziHXrVI.js";import{t as I}from"./Description-DVFPKyRO.js";import{d as L,f as R,o as z}from"./schema-form-dcZ8A0M1.js";import{a as B,c as V,d as H,f as U,i as oe,l as W,o as se,p as G,r as K,s as q,t as J,u as Y}from"./connections-1Ltd2U4L.js";import{n as ce,t as le}from"./Refusal-DgcJTR4J.js";import{t as ue}from"./KindChip-CuBFi3X9.js";import{t as de}from"./Instant-BWqGNC0V.js";var fe=n(`plug-zap`,[[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m18 3-4 4h6l-4 4`,key:`16psg9`}]]),X=e(t(),1),Z=p();function pe({id:e,name:t,stored:n,value:r,onChange:i}){return(0,Z.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Z.jsx)(D,{htmlFor:e,className:`font-mono text-sm font-medium`,children:t}),(0,Z.jsx)(g,{id:e,type:`password`,autoComplete:`new-password`,value:r,onChange:e=>{i(e.target.value)},placeholder:n?`stored — typing replaces it, blank keeps it`:`not set — type to set one`})]})}function me({connection:e,schema:t,onSaved:n}){let[r,i]=(0,X.useState)(e.name??``),[a,o]=(0,X.useState)(e.description??``),[s,c]=(0,X.useState)(()=>ge(e)),[u,d]=(0,X.useState)({}),[f,p]=(0,X.useState)(()=>new Set),[b,x]=(0,X.useState)(null),[S,w]=(0,X.useState)(!1),[T,E]=(0,X.useState)(!1),O=C(e),k=(0,X.useMemo)(()=>he(e,t),[e,t]),A=(0,X.useMemo)(()=>L(k,s),[k,s]),ee=F(`admin`),j=te(ee.why,z(A,f)?void 0:`A setting above is not what this kind accepts.`);return(0,Z.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsxs)(`p`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:O.named?`text-sm font-semibold`:`font-mono text-sm font-semibold`,children:O.title}),(0,Z.jsx)(ue,{kind:e.kind}),O.code!==null&&(0,Z.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:O.code})]}),(0,Z.jsxs)(`p`,{className:`text-xs text-faint`,children:[`Created `,(0,Z.jsx)(de,{at:e.created_at}),y(e.created_at,e.updated_at)&&(0,Z.jsxs)(Z.Fragment,{children:[` · updated `,(0,Z.jsx)(de,{at:e.updated_at})]})]}),(0,Z.jsx)(I,{text:e.description})]}),(0,Z.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Z.jsx)(D,{htmlFor:`connection-name`,children:`Name`}),(0,Z.jsx)(g,{id:`connection-name`,value:r,onChange:e=>{i(e.target.value),E(!1)},placeholder:`What to call this on screen`}),(0,Z.jsxs)(`p`,{className:`text-xs text-faint`,children:[`Display only. Every reference to this credential is by its code, `,e.code,`.`]})]}),(0,Z.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Z.jsx)(D,{htmlFor:`connection-description`,children:`Description`}),(0,Z.jsx)(v,{id:`connection-description`,className:`h-24`,value:a,onChange:e=>{o(e.target.value),E(!1)},placeholder:`What this credential is for. Markdown is rendered.`})]}),(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsx)(`p`,{className:`text-xs font-semibold tracking-wide text-faint uppercase`,children:`Settings`}),(0,Z.jsx)(_,{fields:k,values:s,problems:A,onChange:(e,t)=>{c(n=>({...n,[e]:t})),E(!1)},onUnreadable:(e,t)=>{p(n=>R(n,e,t))}}),e.secret_fields.map(t=>(0,Z.jsx)(pe,{id:`secret-${t}`,name:t,stored:_e(e.config[t]),value:u[t]??``,onChange:e=>{d(n=>({...n,[t]:e})),E(!1)}},t))]}),b!==null&&(0,Z.jsx)(le,{problem:b}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(l,{why:j,children:(0,Z.jsx)(h,{size:`sm`,onClick:()=>{let t=q(e,ve(e,s,u),Q(r),Q(a));if(t===null){E(!0);return}w(!0),x(null),U(e.code,t).then(e=>{d({}),E(!0),n(e)},e=>{x(m(e))}).finally(()=>{w(!1)})},disabled:S||j!==void 0,title:j,children:S?`Saving`:`Save`})}),T&&(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Saved.`})]})]})}function he(e,t){let n=new Set(e.secret_fields);return t===null?Object.keys(e.config).filter(e=>!n.has(e)).map(t=>({name:t,kind:typeof e.config[t]==`string`?`text`:`json`,help:null,required:!1,nullable:!0,fallback:void 0,options:[],mediaType:null,hint:null,placeholder:``,bounds:{},accepts:[]})):Y(t,e.secret_fields)}function ge(e){let t=new Set(e.secret_fields),n={};for(let[r,i]of Object.entries(e.config))t.has(r)||(n[r]=i);return n}function _e(e){return e!=null}function Q(e){let t=e.trim();return t===``?null:t}function ve(e,t,n){let r={};for(let[n,i]of Object.entries(t))Object.is(i,e.config[n])||(r[n]=i);for(let[e,t]of Object.entries(n))t!==``&&(r[e]=t);return r}function ye({open:e,kinds:t,onOpenChange:n,onCreated:c}){let[u,d]=(0,X.useState)(``),[f,p]=(0,X.useState)(``),[y,b]=(0,X.useState)(``),[x,S]=(0,X.useState)(``),[C,w]=(0,X.useState)({}),[O,j]=(0,X.useState)({}),[M,N]=(0,X.useState)(()=>new Set),[ie,P]=(0,X.useState)(()=>new Set),[ae,I]=(0,X.useState)(!1),[z,B]=(0,X.useState)(null),[V,H]=(0,X.useState)(!1),U=t.find(e=>e.id===y)??null,W=Y(U?.config_schema??null,U?.secret_fields??[]),G=L(W,C),K=ae?void 0:M,q=F(`admin`),J=te(q.why,be(u,y,G,ie));return(0,Z.jsx)(E,{open:e,onOpenChange:n,children:(0,Z.jsxs)(re,{className:`sm:max-w-xl`,showCloseButton:!1,children:[(0,Z.jsxs)(k,{children:[(0,Z.jsx)(A,{children:`New connection`}),(0,Z.jsx)(T,{children:`Secret fields are sealed on the way in and never read back out.`})]}),(0,Z.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(D,{htmlFor:`connection-code`,children:`Code`}),(0,Z.jsx)(g,{id:`connection-code`,className:`font-mono`,value:u,onChange:e=>{d(e.target.value)},placeholder:`postman-echo`})]}),(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(D,{htmlFor:`connection-kind`,children:`Kind`}),(0,Z.jsxs)(s,{value:y,onValueChange:e=>{b(String(e)),w({}),j({}),N(new Set),P(new Set),I(!1)},children:[(0,Z.jsx)(i,{id:`connection-kind`,className:`w-full font-mono`,children:(0,Z.jsx)(r,{placeholder:`Choose a kind`})}),(0,Z.jsx)(a,{children:t.map(e=>(0,Z.jsx)(o,{value:e.id,className:`font-mono`,children:e.id},e.id))})]})]})]}),(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(D,{htmlFor:`connection-name-new`,children:`Name`}),(0,Z.jsx)(g,{id:`connection-name-new`,value:f,onChange:e=>{p(e.target.value)},placeholder:`What to call it on screen. Optional; nothing references it.`})]}),(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(D,{htmlFor:`connection-description-new`,children:`Description`}),(0,Z.jsx)(v,{id:`connection-description-new`,className:`h-24`,value:x,onChange:e=>{S(e.target.value)},placeholder:`What this credential is for. Markdown is rendered.`})]}),U!==null&&(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsx)(`p`,{className:`text-xs font-semibold tracking-wide text-faint uppercase`,children:`Settings`}),(0,Z.jsxs)(`div`,{className:`max-h-[40vh] space-y-3 overflow-y-auto pr-1`,children:[(0,Z.jsx)(_,{fields:W,values:C,problems:G,stated:K,onChange:(e,t)=>{w(n=>{let r={...n};return t===void 0?delete r[e]:r[e]=t,r})},onTouch:e=>{N(t=>t.has(e)?t:new Set(t).add(e))},onUnreadable:(e,t)=>{P(n=>R(n,e,t))}}),U.secret_fields.map(e=>(0,Z.jsx)(pe,{id:`new-secret-${e}`,name:e,stored:!1,value:O[e]??``,onChange:t=>{j(n=>({...n,[e]:t}))}},e))]})]}),z!==null&&(0,Z.jsx)(le,{problem:z}),(0,Z.jsxs)(ne,{children:[(0,Z.jsx)(ee,{render:(0,Z.jsx)(h,{variant:`ghost`}),children:`Close`}),(0,Z.jsx)(l,{why:J,children:(0,Z.jsx)(h,{disabled:V||J!==void 0,title:J,onClick:()=>{I(!0),H(!0),B(null),oe({code:u.trim(),name:xe(f),kind:y,description:xe(x),config:se(C,O)}).then(e=>{c(e),d(``),p(``),S(``),b(``),w({}),j({}),N(new Set),P(new Set),I(!1),n(!1)},e=>{B(m(e))}).finally(()=>{H(!1)})},children:V?`Creating`:`Create`})})]})]})})}function be(e,t,n,r){if(e.trim()===``)return`A connection is addressed by its code, and this one has none.`;if(t===``)return`No kind is chosen, and a connection is a credential of one kind.`;if(r.size>0)return`A setting below holds text that is not a value.`;if(!z(n,r))return`A setting below is not what its kind accepts.`}function xe(e){let t=e.trim();return t===``?null:t}var $=e=>e.code,Se={good:`var(--good)`,critical:`var(--critical)`};function Ce(){let[e,t]=(0,X.useState)(null),[n,r]=(0,X.useState)(!1),[i,a]=(0,X.useState)({}),[o,s]=(0,X.useState)(null),[p,m]=(0,X.useState)(null),{state:g,more:_,reload:v}=ae(W,$),y=(0,X.useMemo)(()=>g.rows.map(e=>i[e.code]??e),[i,g.rows]),b=y.find(t=>t.code===e)??null,x=(0,X.useCallback)(e=>{a(t=>({...t,[e.code]:e}))},[]),S=(0,X.useCallback)(e=>{s(e.code),J(e.code).then(t=>{x(G(e,t,new Date().toISOString()))},ce).finally(()=>{s(null)})},[x]),C=e!==null||n;(0,X.useEffect)(()=>{if(!C||p!==null)return;let e=!0;return V().then(t=>{e&&m(t)},()=>{}),()=>{e=!1}},[p,C]),(0,X.useEffect)(()=>{let e=K(y);if(e===null){w();return}return j({note:e,tone:`quiet`,identifier:null}),w},[y]),(0,X.useEffect)(()=>{if(b===null)return;let e=p?.find(e=>e.id===b.kind)?.config_schema??null;return N([{id:`connection`,label:`Connection`,render:()=>(0,Z.jsx)(me,{connection:b,schema:e,onSaved:x},b.code)}],{screen:`connections`})},[x,p,b]);let T=F(`admin`),E=T.may;(0,X.useEffect)(()=>ie([...E?[{id:`connections:new`,title:`New connection`,group:M,screen:!0,icon:fe,keywords:[`credential`,`create`,`add`],run:()=>{r(!0)}}]:[],{id:`connections:reload`,title:`Read the connections listing again`,group:M,screen:!0,icon:O,keywords:[`refresh`,`reload`],run:v}]),[E,v]);let D=(0,X.useMemo)(()=>we(S,o,T.why),[S,o,T.why]);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(u,{title:`Connections`,aside:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(d,{tag:`connections`}),(0,Z.jsx)(l,{why:T.why,children:(0,Z.jsxs)(h,{size:`sm`,"aria-label":`New connection`,disabled:!T.may,title:T.why,onClick:()=>{r(!0)},children:[(0,Z.jsx)(fe,{"aria-hidden":!0}),`New`]})})]})}),(0,Z.jsx)(c,{loading:!g.read,problem:g.problem,empty:y.length===0,emptyMessage:`No connections.`,children:(0,Z.jsx)(f,{columns:D,rows:y,rowKey:$,reading:g.reading,next:g.next,onMore:_,noun:`connections`,onSelect:e=>{t(e.code),P()},selected:t=>t.code===e})}),(0,Z.jsx)(ye,{open:n,kinds:p??[],onOpenChange:r,onCreated:()=>{v()}})]})}function we(e,t,n){return[{id:`connection`,header:`Connection`,cell:e=>(0,Z.jsx)(Te,{row:e})},{id:`description`,header:`Description`,cell:e=>(0,Z.jsx)(Ee,{description:e.description})},{id:`health`,header:`Health`,cell:e=>(0,Z.jsx)(De,{row:e})},{id:`checked`,header:`Checked`,className:`text-xs`,cell:e=>(0,Z.jsx)(Oe,{row:e})},{id:`check`,header:``,className:`text-right`,cell:r=>(0,Z.jsx)(l,{why:n,children:(0,Z.jsx)(h,{variant:`outline`,size:`sm`,disabled:t===r.code||n!==void 0,title:n,onClick:t=>{t.stopPropagation(),e(r)},children:t===r.code?`Checking`:`Check`})})}]}function Te({row:e}){let t=C(e);return(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:t.named?`font-semibold`:`font-mono font-semibold`,children:t.title}),(0,Z.jsx)(ue,{kind:e.kind}),t.code!==null&&(0,Z.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:t.code})]}),(0,Z.jsx)(`p`,{className:`max-w-md truncate text-xs text-muted-foreground`,title:H(e),children:H(e)})]})}function Ee({description:e}){let t=e===null?``:S(e);return t===``?null:(0,Z.jsx)(`p`,{className:`max-w-64 truncate text-xs text-muted-foreground`,title:t,children:t})}function De({row:e}){let t=B(e);return t.tone===null?(0,Z.jsx)(`span`,{className:`text-xs text-faint`,children:`never checked`}):(0,Z.jsxs)(`span`,{className:`flex items-center gap-2 text-xs`,children:[(0,Z.jsx)(`span`,{className:`status-dot`,style:{"--chip":Se[t.tone]},"aria-hidden":!0}),(0,Z.jsx)(`span`,{children:t.label}),t.detail!==null&&(0,Z.jsx)(`span`,{className:`max-w-64 truncate text-muted-foreground`,title:t.detail,children:t.detail})]})}function Oe({row:e}){return e.last_check_at===null?null:(0,Z.jsx)(`span`,{className:`text-muted-foreground`,title:x(e.last_check_at),children:b(e.last_check_at)})}export{Ce as Connections};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-BatatxyT.js";import{c as n,n as r}from"./chunk-BV7QT456-Bfa1dvOx.js";import{i,n as a,r as o,t as ee}from"./PageState-BxxntCdE.js";import{r as te,t as s}from"./ListTable-B9skT-_Y.js";import{r as c,t as l}from"./utils-CRMSf51M.js";import{t as u}from"./use-store-CgWwefFs.js";import{t as d}from"./auth-Chi4DcFq.js";import{v as ne}from"./format-B5YbYOY-.js";import{t as re}from"./use-heartbeat-ByRKom_T.js";import{t as f}from"./identity-BNZxCf_y.js";import{d as p}from"./pipelines-CU_Q479F.js";import{Ft as m,S as h,_ as g,dt as _,l as v,m as y,pt as b,t as x,u as S}from"./index-DziHXrVI.js";import{l as C,n as w,r as T}from"./connections-1Ltd2U4L.js";import{t as E}from"./Instant-BWqGNC0V.js";import{f as D,i as O,p as k,r as A,s as j,t as M,u as ie}from"./TileCard-DuzDmLB3.js";import{a as ae,i as N,r as P}from"./workers-Cn6T4C66.js";import{f as F,s as I}from"./triggers-U4QjnQ1U.js";var L=e(t(),1),R=c(),z={neutral:`bg-muted-foreground`,good:`bg-good`,info:`bg-info`,warning:`bg-warning`,critical:`bg-critical`};function B({rows:e,note:t,reading:n}){let a=u(d).identity?.role??null;return(0,R.jsx)(o,{className:`gap-0 p-0`,children:(0,R.jsxs)(i,{className:`flex h-full flex-col p-0`,children:[(0,R.jsxs)(`div`,{className:`space-y-1 px-3 py-3`,children:[(0,R.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Health`}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n?`Reading from the server`:`The workers claiming work, and every connection.`})]}),(0,R.jsx)(`ul`,{className:`max-h-64 grow overflow-y-auto`,children:e.map(e=>{let t=e.kind===`connection`?`/connections`:a===`admin`?`/admin/workers`:null,n=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{className:l(`size-2 shrink-0 rounded-full`,z[e.tone]),"aria-hidden":!0}),(0,R.jsx)(`span`,{className:`max-w-[55%] shrink-0 truncate font-mono text-xs`,title:e.label,children:e.label}),(0,R.jsxs)(`span`,{className:`ml-auto flex min-w-0 items-baseline gap-2`,children:[(0,R.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,title:e.detail,children:e.detail}),e.at!==null&&(0,R.jsx)(E,{className:`shrink-0 text-xs text-faint`,at:e.at})]})]});return(0,R.jsx)(`li`,{className:`border-t border-border`,children:t===null?(0,R.jsx)(`span`,{className:`flex items-center gap-3 px-3 py-1.5`,children:n}):(0,R.jsx)(r,{to:t,className:`flex items-center gap-3 px-3 py-1.5 hover:bg-accent/60`,children:n})},`${e.kind}:${e.id}`)})}),(0,R.jsx)(`p`,{className:`border-t border-border px-3 py-2 text-xs text-muted-foreground`,children:t})]})})}function V(e,t){return`${String(e)}${t.next===null?``:`+`}`}function H(e,t){return e===0?`neutral`:t}function U(e,t){return e.items.filter(e=>e.status===t).length}function W(e,t,n){let r=(t,n,r)=>{if(e===null)return null;let i=U(e,t);return{id:t,label:n,value:V(i,e),note:``,tone:H(i,r),to:S({...x,status:t,since:`24h`})}},i=(e,t,n,r,i)=>{if(i===null)return null;let a=i.items.length;return{id:e,label:t,value:V(a,i),note:a===0?``:r,tone:H(a,n),to:S({...x,status:e})}};return[{id:`runs`,tile:e===null?null:{id:`runs`,label:`Runs`,value:V(e.items.length,e),note:`Last 24 hours.`,tone:`neutral`,to:S({...x,since:`24h`})}},{id:`succeeded`,tile:r(`succeeded`,`Succeeded`,`good`)},{id:`failed`,tile:r(`failed`,`Failed`,`critical`)},{id:`completed_with_errors`,tile:r(`completed_with_errors`,`With errors`,`warning`)},{id:`running`,tile:i(`running`,`Running`,`info`,`Being worked on now.`,t)},{id:`queued`,tile:i(`queued`,`Queued`,`neutral`,`Waiting for a worker.`,n)}]}var G=36e5,K=864e5;function q(e,t){let n=e+t*6e4;return Math.floor(n/G)*G-t*6e4}function J(e,t){let n=e+t*6e4;return Math.floor((n%K+K)%K/G)}function oe(e,t,n,r=24){let i=q(t.getTime(),n)-(r-1)*G,a=Array.from({length:r},(e,t)=>{let r=i+t*G;return{start:r,hour:J(r,n),succeeded:0,withErrors:0,failed:0,total:0}});for(let t of e){let e=Date.parse(t.created_at);if(Number.isNaN(e))continue;let n=Math.floor((e-i)/G);if(n<0||n>=r)continue;let o=a[n];o.total+=1,t.status===`succeeded`?o.succeeded+=1:t.status===`completed_with_errors`?o.withErrors+=1:t.status===`failed`&&(o.failed+=1)}return a}function Y(e){return e.succeeded+e.withErrors+e.failed}function se(e){return e.reduce((e,t)=>Math.max(e,Y(t)),0)}function ce(e){let t=t=>e.reduce((e,n)=>e+t(n),0),n=t(e=>e.total);if(n===0)return`No run was started in the last 24 hours.`;let r=[`${String(t(e=>e.succeeded))} succeeded`,`${String(t(e=>e.withErrors))} finished with errors`,`${String(t(e=>e.failed))} failed`];return`${String(n)} runs started in the last 24 hours, by the hour: ${r.join(`, `)}.`}function le(e,t){let n=e.map(e=>{let t=P(e);return{id:e.id,kind:`worker`,label:e.name,tone:t===null?`good`:O(t),detail:t===null?`worker · ${String(e.concurrency)} ${e.concurrency===1?`slot`:`slots`}`:N(t),at:t===null?null:e.last_seen_at}}),r=t.map(e=>{let t=e.last_check_healthy;return{id:e.id,kind:`connection`,label:e.code,tone:t===null?`neutral`:t?`good`:`critical`,detail:t===null?`never checked`:e.last_check_detail??(t?`healthy`:`did not answer`),at:e.last_check_at}});return[...n,...r]}function ue(e,t){let n=e.filter(e=>P(e)===null).length,{healthy:r,total:i}=w(t),a=[];if(e.length===0?a.push(`no worker has registered`):n<e.length&&a.push(`${String(n)} of ${String(e.length)} workers healthy`),r<i){let e=T(t,`connections`);e!==null&&a.push(e)}if(a.length>0){let e=a.join(` · `);return`${e.charAt(0).toUpperCase()}${e.slice(1)}.`}return t.length===0?`Every worker is healthy, and this instance holds no connections.`:`Every worker and every connection is healthy.`}function de(e,t,n=6){return[...e,...t].toSorted((e,t)=>Date.parse(t.created_at)-Date.parse(e.created_at)).slice(0,n)}function fe(e,t=6){return e.flatMap(e=>{let t=I(e.schedule);return t.kind===`due`?[{...e,at:t.at}]:[]}).toSorted((e,t)=>Date.parse(e.at)-Date.parse(t.at)).slice(0,t)}async function X(e){let t=e.filter(e=>e.schedules>0);return(await Promise.all(t.map(async e=>(await F(e.code,null)).items.map(t=>({pipeline:e.code,schedule:t}))))).flat()}async function pe(){let e=await p(null);return{pipelines:e.items,schedules:await X(e.items)}}var me=6,Z=[{id:`failed`,label:`Failed`,fill:`bg-status-failed/80`},{id:`withErrors`,label:`With errors`,fill:`bg-status-completed-with-errors/80`},{id:`succeeded`,label:`Succeeded`,fill:`bg-status-succeeded/75`}];function he(e){let t=`${String(e.hour).padStart(2,`0`)}:00`;if(e.total===0)return`${t} — nothing ran`;let n=Z.filter(t=>e[t.id]>0).map(t=>`${String(e[t.id])} ${t.label.toLowerCase()}`),r=n.length===0?`none finished`:n.join(`, `);return`${t} — ${String(e.total)} started, ${r}`}function ge({buckets:e,reading:t,className:n}){let r=se(e);return(0,R.jsx)(o,{className:l(`gap-0 p-0`,n),children:(0,R.jsxs)(i,{className:`space-y-3 p-3`,children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1`,children:[(0,R.jsxs)(`div`,{className:`space-y-1`,children:[(0,R.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Runs over time`}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t?`Reading from the server`:`Every run started in the last 24 hours, by the hour it started in.`})]}),(0,R.jsx)(`ul`,{className:`flex items-center gap-3`,children:Z.map(e=>(0,R.jsxs)(`li`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,R.jsx)(`span`,{className:l(`size-2 shrink-0 rounded-sm`,e.fill),"aria-hidden":!0}),e.label]},e.id))})]}),(0,R.jsx)(`div`,{className:`flex h-32 items-end gap-px`,role:`img`,"aria-label":ce(e),children:e.map(e=>(0,R.jsxs)(`div`,{className:`flex h-full flex-1 flex-col justify-end rounded-sm hover:bg-accent/40`,title:he(e),children:[Z.map(t=>e[t.id]===0?null:(0,R.jsx)(`div`,{className:l(`min-h-0.5 w-full`,t.fill),style:{height:`${String(e[t.id]/Math.max(r,1)*100)}%`}},t.id)),Y(e)===0&&(0,R.jsx)(`div`,{className:`h-px w-full bg-border`})]},e.start))}),(0,R.jsx)(`div`,{className:`flex gap-px font-mono text-xs text-faint`,"aria-hidden":!0,children:e.map((e,t)=>(0,R.jsx)(`span`,{className:`flex-1 text-center`,children:t%me===0?`${String(e.hour).padStart(2,`0`)}`:``},e.start))})]})})}function _e(){let e=g((0,L.useCallback)(()=>v({...x,since:`24h`},null,500),[])),t=g((0,L.useCallback)(()=>v({...x,status:`running`},null),[])),r=g((0,L.useCallback)(()=>v({...x,status:`queued`},null),[])),i=g((0,L.useCallback)(()=>v({...x,status:`failed`},null),[])),o=g((0,L.useCallback)(()=>v({...x,status:`completed_with_errors`},null),[])),c=g(pe),d=g((0,L.useCallback)(()=>ae(null),[])),f=g((0,L.useCallback)(()=>C(null),[])),{again:p}=e,{again:h}=t,{again:S}=r,{again:w}=i,{again:T}=o,{again:E}=c,{again:O}=d,{again:N}=f,P=(0,L.useCallback)(()=>{p(),h(),S(),w(),T(),E(),O(),N()},[E,N,p,w,T,S,h,O]);(0,L.useEffect)(()=>b([{id:`dashboard:refresh`,title:`Refresh the dashboard`,group:_,screen:!0,icon:m,keywords:[`refresh`,`reload`,`home`],run:P}]),[P]);let F=n();re(P,u(y));let I=de(t.value?.items??[],r.value?.items??[]),z=ie(j(i.value?.items??[],o.value?.items??[]),c.value?.pipelines??[]),V=fe(c.value?.schedules??[]),H=W(e.value,t.value,r.value),U=new Date,G=oe(e.value?.items??[],U,ne(U)),K=d.problem===null&&f.problem===null;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(ee,{title:`Dashboard`,aside:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(te,{tag:`runs`}),(0,R.jsx)(k,{onRefresh:P})]})}),(0,R.jsx)(`div`,{className:`mb-3 grid grid-cols-2 gap-3 sm:grid-cols-3 xl:grid-cols-6`,children:H.map(e=>e.tile===null?(0,R.jsx)(A,{},e.id):(0,R.jsx)(M,{tile:e.tile},e.id))}),(0,R.jsxs)(`div`,{className:`mb-6 grid gap-3 lg:grid-cols-3`,children:[(0,R.jsx)(`div`,{className:l(K?`lg:col-span-2`:`lg:col-span-3`),children:e.problem===null?(0,R.jsx)(ge,{buckets:G,reading:!e.read}):(0,R.jsx)(a,{loading:!1,problem:e.problem,empty:!1,children:null})}),K&&(0,R.jsx)(B,{rows:le(d.value?.items??[],f.value?.items??[]),note:ue(d.value?.items??[],f.value?.items??[]),reading:!d.read||!f.read})]}),(0,R.jsx)(Q,{title:`Right now`,to:`/runs`,children:(0,R.jsx)(a,{loading:!t.read||!r.read,problem:t.problem??r.problem,empty:I.length===0,emptyMessage:`Nothing is running and nothing is waiting.`,children:(0,R.jsx)(s,{chrome:{footer:!1},columns:ve,rows:I,rowKey:e=>e.id,reading:!1,next:null,onMore:$,noun:`runs`,onSelect:e=>void F(`/runs/${e.id}`)})})}),(0,R.jsx)(Q,{title:`Needs a look`,to:`/runs`,children:(0,R.jsx)(a,{loading:!i.read||!o.read,problem:i.problem??o.problem,empty:z.length===0,emptyMessage:`Nothing has failed or finished with errors.`,children:(0,R.jsx)(s,{chrome:{footer:!1},columns:D,rows:z,rowKey:e=>e.run.id,reading:!1,next:null,onMore:$,noun:`runs`,onSelect:e=>void F(`/runs/${e.run.id}`)})})}),(0,R.jsx)(Q,{title:`Next fires`,to:`/triggers`,children:(0,R.jsx)(a,{loading:!c.read,problem:c.problem,empty:V.length===0,emptyMessage:`No schedule is due to fire.`,children:(0,R.jsx)(s,{chrome:{footer:!1},columns:ye,rows:V,rowKey:e=>`${e.pipeline}:${e.schedule.code}`,reading:!1,next:null,onMore:$,noun:`firings`,onSelect:e=>void F(`/pipelines/${encodeURIComponent(e.pipeline)}`)})})})]})}function Q({title:e,to:t,children:n}){return(0,R.jsxs)(`section`,{className:`mb-6 space-y-2 last:mb-0`,children:[(0,R.jsx)(`div`,{className:`space-y-1`,children:(0,R.jsx)(`h2`,{className:`text-sm font-semibold`,children:(0,R.jsx)(r,{to:t,className:`hover:text-primary`,children:e})})}),n]})}var $=()=>{},ve=[{id:`status`,header:`Status`,cell:e=>(0,R.jsx)(h,{status:e.status})},{id:`pipeline`,header:`Pipeline`,cell:e=>(0,R.jsx)(`span`,{className:`font-mono text-sm`,children:f({code:e.pipeline}).title})},{id:`since`,header:`Since`,className:`text-right`,cell:e=>(0,R.jsx)(E,{className:`text-xs text-faint`,at:e.started_at??e.created_at})}],ye=[{id:`pipeline`,header:`Pipeline`,cell:e=>(0,R.jsx)(`span`,{className:`font-mono text-sm`,children:f({code:e.pipeline}).title})},{id:`schedule`,header:`Schedule`,cell:e=>{let t=f(e.schedule);return(0,R.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,R.jsx)(`span`,{className:l(`truncate text-xs`,t.named?`text-foreground`:`font-mono`),children:t.title}),t.code!==null&&(0,R.jsx)(`span`,{className:`shrink-0 font-mono text-xs text-muted-foreground`,children:t.code})]})}},{id:`fires`,header:`Fires`,className:`text-right`,cell:e=>(0,R.jsx)(E,{className:`text-xs text-faint`,at:e.at})}];export{_e as Dashboard};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-BatatxyT.js";import{n}from"./PageState-BxxntCdE.js";import{r,t as i}from"./utils-CRMSf51M.js";import{f as a}from"./paging-DL6m7m7g.js";import{t as o}from"./identity-BNZxCf_y.js";import{T as s,_ as c,it as l}from"./index-DziHXrVI.js";import{t as u}from"./Description-DVFPKyRO.js";import{n as d,r as f}from"./Panel-ClHPU8x_.js";import{t as p}from"./badge-DABGWbc8.js";import{t as m}from"./WindowedPane-bblrzCyF.js";import{f as h,n as g,u as _}from"./examples-6Nbc5Lgs.js";import{t as v}from"./starters-CvbebKUN.js";var y=e(t(),1),b=r(),x=`The document`,S={connection:`connection`,schema:`schema`,block:`block`,pipeline:`pipeline`,storage:`storage`,worker:`worker tag`};function C({example:e,holdings:t,onUse:r}){let C=e.code,E=c((0,y.useCallback)(()=>_(C),[C])),D=o(e),O=(0,y.useMemo)(()=>h(e.requires,t),[e.requires,t]),k=g(e),A=e.tags.filter(e=>e!==v),j=E.value?.source??``;return(0,b.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[(0,b.jsxs)(`div`,{className:`space-y-1`,children:[(0,b.jsx)(`h2`,{className:i(`text-sm font-semibold`,!D.named&&`font-mono`),children:D.title}),D.code!==null&&(0,b.jsx)(`p`,{className:`font-mono text-xs text-muted-foreground`,children:D.code}),(e.starter||k!==null)&&(0,b.jsxs)(`p`,{className:`flex flex-wrap items-center gap-2 pt-0.5`,children:[e.starter&&(0,b.jsx)(p,{variant:`outline`,children:`Starter`}),k!==null&&(0,b.jsx)(`span`,{className:`text-xs text-warning`,children:k})]}),(0,b.jsx)(u,{text:e.description})]}),A.length>0&&(0,b.jsx)(`p`,{className:`flex flex-wrap items-center gap-1`,children:A.map(e=>(0,b.jsx)(s,{tag:e},e))}),(0,b.jsx)(f,{title:`Facts`,children:(0,b.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs`,children:[(0,b.jsx)(d,{term:`plugin`,detail:e.plugin}),(0,b.jsx)(d,{term:`shelf`,detail:e.shelf===``?`the root`:e.shelf}),E.value!==null&&(0,b.jsx)(d,{term:`path`,detail:(0,b.jsx)(`span`,{className:`font-mono break-all`,children:E.value.path})})]})}),(0,b.jsx)(f,{title:`Requires`,children:O.length===0?(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`This document requires nothing in particular of an instance.`}):(0,b.jsx)(`ul`,{className:`space-y-1 text-xs`,children:O.map(e=>(0,b.jsxs)(`li`,{className:`flex items-baseline gap-2`,children:[(0,b.jsx)(`span`,{className:`text-faint`,children:S[e.kind]}),(0,b.jsx)(`span`,{className:`font-mono break-all`,children:e.name}),(0,b.jsx)(`span`,{className:i(`ml-auto shrink-0`,T(e)),children:w(e)})]},`${e.kind}:${e.name}`))})}),(0,b.jsx)(f,{title:`Source`,children:!E.read||E.problem!==null?(0,b.jsx)(n,{loading:!E.read,problem:E.problem,empty:!1,children:null}):(0,b.jsx)(m,{name:x,className:`overflow-hidden rounded-md border border-border`,windowed:(0,b.jsx)(l,{value:j,path:`example-${C}-window`,label:`${x}, in a window`,className:`min-h-0 flex-1`,readOnly:!0}),children:(0,b.jsx)(l,{value:j,path:`example-${C}`,label:x,className:`h-72 min-h-40`,readOnly:!0})})}),e.starter&&(0,b.jsx)(a,{size:`sm`,className:`self-start`,disabled:E.value===null,onClick:()=>{r(j,C)},children:`Use as starter`})]})}function w(e){return e.met===null?`not checked`:e.met?`here`:`missing`}function T(e){return e.met===null?`text-faint`:e.met?`text-good`:`text-critical`}export{C as ExamplePanel};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ExamplePanel-DOH0Epmn.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/react-BatatxyT.js","assets/PageState-BxxntCdE.js","assets/with-selector-BQ0vq4Ay.js","assets/dropdown-menu-BmoO2uui.js","assets/api-DxX94A25.js","assets/utils-CRMSf51M.js","assets/paging-DL6m7m7g.js","assets/identity-BNZxCf_y.js","assets/index-DziHXrVI.js","assets/dist-BWSEJlfk.js","assets/preload-helper-Czpn1I53.js","assets/chunk-BV7QT456-Bfa1dvOx.js","assets/nav-CE-Cbv84.js","assets/play-Cpq8RIJ2.js","assets/file-braces-NOlOm1fG.js","assets/chevron-down-Cs1_pMxC.js","assets/ListTable-B9skT-_Y.js","assets/docs-CCoB3shg.js","assets/x-CaKz-2po.js","assets/tooltip-Dh4uy__Z.js","assets/input-C5XexCJf.js","assets/textarea-XMYmRm72.js","assets/use-store-CgWwefFs.js","assets/store-C2zgoyrT.js","assets/auth-Chi4DcFq.js","assets/format-B5YbYOY-.js","assets/status-Ctx8x8Mf.js","assets/use-heartbeat-ByRKom_T.js","assets/pipelines-CU_Q479F.js","assets/index-Cmuh18en.css","assets/Description-DVFPKyRO.js","assets/Panel-ClHPU8x_.js","assets/copy-C7fd9gfy.js","assets/badge-DABGWbc8.js","assets/WindowedPane-bblrzCyF.js","assets/maximize-2-8DfD9AFn.js","assets/examples-6Nbc5Lgs.js","assets/blocks-DgBe9px-.js","assets/connections-1Ltd2U4L.js","assets/schema-form-dcZ8A0M1.js","assets/schemas-CQifVwSc.js","assets/starters-CvbebKUN.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-BatatxyT.js";import{t as n}from"./preload-helper-Czpn1I53.js";import{c as r,u as i}from"./chunk-BV7QT456-Bfa1dvOx.js";import{n as a}from"./nav-CE-Cbv84.js";import{n as o,t as s}from"./PageState-BxxntCdE.js";import{r as c,t as l}from"./ListTable-B9skT-_Y.js";import{r as u,t as d}from"./utils-CRMSf51M.js";import{t as f}from"./input-C5XexCJf.js";import{n as p,t as m}from"./identity-BNZxCf_y.js";import{$ as h,Ft as ee,Lt as g,T as _,_ as v,ct as y,et as b,ft as x,g as S,ot as C,pt as w,w as te,x as T}from"./index-DziHXrVI.js";import{t as E}from"./badge-DABGWbc8.js";import{_ as D,a as O,c as k,d as A,f as j,h as M,i as N,l as P,n as F,o as I,p as L,s as R,t as z}from"./examples-6Nbc5Lgs.js";import{n as B,t as V}from"./starters-CvbebKUN.js";import{t as H}from"./Segmented-DvCzioEn.js";var U=e(t(),1),W=u(),G=(0,U.lazy)(()=>n(()=>import(`./ExamplePanel-DOH0Epmn.js`).then(e=>({default:e.ExamplePanel})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43]))),K=`example`,q=()=>{},J=e=>e.code,Y=[{value:`all`,label:`All`},{value:`starters`,label:`Starters`}];function X(){let e=r(),[t,n]=i(),[u,d]=(0,U.useState)(null),p=(0,U.useMemo)(()=>N(t),[t]),m=(0,U.useCallback)(e=>{n(k(e),{replace:!0})},[n]),T=v(P),E=v(A),O=(0,U.useMemo)(()=>E.value??{blocks:null,connections:null,schemas:null},[E.value]),j=(0,U.useMemo)(()=>T.value??[],[T.value]),F=(0,U.useMemo)(()=>I(j,p),[p,j]),L=(0,U.useMemo)(()=>M(j),[j]),V=(0,U.useMemo)(()=>R(j),[j]),X=(0,U.useMemo)(()=>D(j),[j]),Q=(0,U.useCallback)(e=>{p.tags.includes(e)||m({...p,tags:[...p.tags,e]})},[m,p]),re=(0,U.useMemo)(()=>ne(O,V,Q),[Q,O,V]),$=(0,U.useCallback)((t,n)=>{e(a,{state:{document:B(t,n)}})},[e]);return(0,U.useEffect)(()=>(b({note:null,tone:`quiet`,identifier:null}),h),[j.length]),(0,U.useEffect)(()=>w([{id:`examples:starters`,title:`Show only the starters`,group:x,screen:!0,icon:g,keywords:[`starter`,`copy`,`new`],run:()=>{m({...p,starters:!0})}},{id:`examples:clear`,title:`Clear the filters on the examples listing`,group:x,screen:!0,icon:ee,keywords:[`reset`,`all`],run:()=>{m({needle:``,tags:[],shelf:``,plugin:``,starters:!1,block:``})}}]),[m,p]),(0,U.useEffect)(()=>{if(u!==null)return C([{id:K,label:`Example`,render:()=>(0,W.jsx)(U.Suspense,{fallback:(0,W.jsx)(Z,{}),children:(0,W.jsx)(G,{example:u,holdings:O,onUse:$},u.code)})}],{screen:`examples`})},[u,O,$]),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(s,{title:`Examples`,aside:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(c,{tag:`examples`}),F.length!==j.length&&(0,W.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[String(F.length),` of `,String(j.length)]})]})}),(0,W.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(f,{className:`w-56`,value:p.needle,onChange:e=>{m({...p,needle:e.target.value})},placeholder:`Search examples`,"aria-label":`Search examples by code, name, description or tag`}),(0,W.jsx)(H,{label:`Which documents`,value:p.starters?`starters`:`all`,options:Y,onChoose:e=>{m({...p,starters:e===`starters`})}}),(0,W.jsx)(te,{chosen:p.tags,offered:X,onChange:e=>{m({...p,tags:e})}}),(0,W.jsx)(S,{label:`Shelf`,value:p.shelf,anything:`Any shelf`,options:L.map(e=>({value:e,label:e})),onChange:e=>{m({...p,shelf:e===``?``:e})}}),V.length>1&&(0,W.jsx)(S,{label:`Plugin`,value:p.plugin,anything:`Any plugin`,options:V.map(e=>({value:e,label:e})),onChange:e=>{m({...p,plugin:e===``?``:e})}}),p.block!==``&&(0,W.jsx)(_,{tag:p.block,label:`Stop narrowing to ${p.block}`,onSelect:()=>{m({...p,block:``})}})]}),(0,W.jsx)(o,{loading:!T.read,problem:T.problem,empty:F.length===0,emptyMessage:j.length===0?`No examples installed — plugins contribute them.`:z(p)?`Nothing in the corpus matches that.`:`No examples.`,children:(0,W.jsx)(l,{columns:re,rows:F,rowKey:J,reading:!1,next:null,onMore:q,noun:`examples`,onSelect:e=>{d(e),y(K)},selected:e=>e.code===u?.code})})]})}function Z(){return(0,W.jsx)(`div`,{className:`p-4`,children:(0,W.jsx)(o,{loading:!0,problem:null,empty:!1,children:null})})}function ne(e,t,n){return[{id:`example`,header:`Example`,className:`w-full max-w-0`,cell:e=>{let t=m(e),n=F(e);return(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:d(`truncate font-semibold`,`max-lg:overflow-visible max-lg:whitespace-normal`,!t.named&&`font-mono`),title:t.title,children:t.title}),e.starter&&(0,W.jsx)(E,{variant:`outline`,className:`shrink-0`,children:`Starter`}),n!==null&&(0,W.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,title:`An instance refuses a document that carries these, so a copy has to create them instead.`,children:n})]}),(0,W.jsxs)(`p`,{className:`flex items-center gap-2 text-xs`,children:[t.code!==null&&(0,W.jsx)(`span`,{className:`font-mono text-muted-foreground`,children:t.code}),e.description!==null&&(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted-foreground`,title:p(e.description),children:p(e.description)})]})]})}},{id:`tags`,header:`Tags`,cell:e=>(0,W.jsx)(T,{tags:e.tags.filter(e=>e!==V),onSelect:n})},{id:`requires`,header:`Requires`,className:`whitespace-nowrap`,cell:t=>(0,W.jsx)(Q,{example:t,holdings:e})},...t.length>1?[{id:`plugin`,header:`Plugin`,className:`w-32 font-mono text-xs whitespace-nowrap`,cell:e=>(0,W.jsx)(`span`,{className:`text-muted-foreground`,children:e.plugin})}]:[]]}function Q({example:e,holdings:t}){let n=j(e.requires,t),r=L(n);if(r===null)return null;let i=O(n);return(0,W.jsx)(`span`,{className:d(`text-xs`,i===0?`text-muted-foreground`:`text-critical`),children:r})}export{X as Examples};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./utils-CRMSf51M.js";import{l as t,s as n}from"./format-
|
|
1
|
+
import{r as e}from"./utils-CRMSf51M.js";import{l as t,s as n}from"./format-B5YbYOY-.js";var r=e();function i({at:e,className:i}){return(0,r.jsx)(`span`,{className:i,title:e?n(e):void 0,children:t(e)})}export{i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-BatatxyT.js";import{t as n}from"./maximize-2-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-BatatxyT.js";import{t as n}from"./maximize-2-8DfD9AFn.js";import{r,t as i}from"./utils-CRMSf51M.js";import{f as a}from"./paging-DL6m7m7g.js";import{Dt as o,Nt as s,it as c,kt as l}from"./index-DziHXrVI.js";var u=e(t(),1),d=r();function f({title:e,text:t,mediaType:r,path:i}){let[f,p]=(0,u.useState)(!1);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(a,{variant:`ghost`,size:`icon`,"aria-label":`Open ${e} in a window`,className:`absolute top-1.5 right-3.5 size-6 rounded-md border border-border bg-background/90 text-faint`,onClick:()=>{p(!0)},children:(0,d.jsx)(n,{className:`size-3.5`,"aria-hidden":!0})}),(0,d.jsx)(o,{open:f,onOpenChange:p,children:(0,d.jsxs)(l,{finalFocus:!1,className:`flex h-[85vh] w-[min(64rem,90vw)] max-w-[min(64rem,90vw)] flex-col gap-3 sm:max-w-[min(64rem,90vw)]`,children:[(0,d.jsx)(s,{className:`font-mono text-sm`,children:e}),(0,d.jsx)(c,{value:t,mediaType:r,path:i,label:e,readOnly:!0,className:`min-h-0 flex-1`})]})})]})}var p=/("(?:[^"\\]|\\.)*")(\s*:)?|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)|(true|false|null)/g;function m(e){let t=[],n=0;for(let r of e.matchAll(p)){r.index>n&&t.push({kind:`punctuation`,text:e.slice(n,r.index)});let[,i,a,o,s]=r;i===void 0?o===void 0?s!==void 0&&t.push({kind:`literal`,text:s}):t.push({kind:`number`,text:o}):(t.push({kind:a===void 0?`string`:`key`,text:i}),a!==void 0&&t.push({kind:`punctuation`,text:a})),n=r.index+r[0].length}return n<e.length&&t.push({kind:`punctuation`,text:e.slice(n)}),t}var h={key:`text-info-ink`,string:`text-good-ink`,number:`text-warning-ink`,literal:`text-warning-ink`,punctuation:`text-muted-foreground`};function g({title:e,text:t,className:n}){let r=(0,u.useMemo)(()=>m(t),[t]);return(0,d.jsxs)(`div`,{className:`relative`,children:[(0,d.jsx)(`pre`,{className:i(`overflow-auto rounded-lg border border-border bg-background p-2 font-mono text-xs`,n),children:r.map((e,t)=>(0,d.jsx)(`span`,{className:h[e.kind],children:e.text},t))}),(0,d.jsx)(f,{title:e,text:t,mediaType:`application/json`,path:`window/${e}`})]})}export{g as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-BatatxyT.js";import{r as n}from"./with-selector-BQ0vq4Ay.js";import{s as r}from"./PageState-BxxntCdE.js";import{r as i,t as a}from"./utils-CRMSf51M.js";import{f as o,o as s}from"./paging-DL6m7m7g.js";import{i as c}from"./docs-CCoB3shg.js";var l=n(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),u=i();function d({tag:e}){return(0,u.jsxs)(`a`,{className:`inline-flex items-center gap-1 rounded-sm border border-border px-1.5 py-0.5 text-xs text-muted-foreground hover:bg-secondary hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,href:c(e),target:`_blank`,rel:`noreferrer`,title:`The ${e} section of this instance's API documentation`,children:[`API`,(0,u.jsx)(l,{className:`size-3`,"aria-hidden":!0})]})}var f=e(t(),1),p=(0,f.createContext)(0);function m({width:e,children:t}){return(0,u.jsx)(p,{value:e,children:t})}function h(){return(0,f.use)(p)}function g({className:e,containerClassName:t,...n}){return(0,u.jsx)(`div`,{"data-slot":`table-container`,className:a(`relative w-full overflow-x-auto`,t),children:(0,u.jsx)(`table`,{"data-slot":`table`,className:a(`w-full caption-bottom text-sm`,e),...n})})}function _({className:e,...t}){return(0,u.jsx)(`thead`,{"data-slot":`table-header`,className:a(`[&_tr]:border-b`,e),...t})}function v({className:e,...t}){return(0,u.jsx)(`tbody`,{"data-slot":`table-body`,className:a(`[&_tr:last-child]:border-0`,e),...t})}function y({className:e,...t}){return(0,u.jsx)(`tr`,{"data-slot":`table-row`,className:a(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function b({className:e,...t}){return(0,u.jsx)(`th`,{"data-slot":`table-head`,className:a(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0`,e),...t})}function x({className:e,...t}){return(0,u.jsx)(`td`,{"data-slot":`table-cell`,className:a(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0`,e),...t})}function S(e){let[t,n]=(0,f.useState)(0);return(0,f.useEffect)(()=>{if(e===null||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(e=>{let t=e[0]?.contentRect;t!==void 0&&n(t.width)});return t.observe(e),()=>{t.disconnect()}},[e]),t}var C=`300px`;function w(e){return e.cardLabel===void 0?typeof e.header==`string`&&e.header!==``?e.header:null:e.cardLabel}function T(e){return e!=null&&e!==!1&&e!==``}function E({chrome:e,fixed:t,columns:n,rows:i,rowKey:c,rowClassName:l,reading:d,next:p,onMore:h,noun:E,onSelect:D,selected:O}){let[k,A]=(0,f.useState)(null);(0,f.useEffect)(()=>{if(k===null)return;let e=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&h()},{rootMargin:C});return e.observe(k),()=>{e.disconnect()}},[h,k]);let j=e=>D===void 0?{}:{tabIndex:0,"aria-selected":O?.(e),onClick:()=>{D(e)},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&t.target===t.currentTarget&&(t.preventDefault(),D(e))}},M=n[0],N=n.slice(1),P=r(),[F,I]=(0,f.useState)(null),L=S(F);return(0,u.jsx)(m,{width:L,children:(0,u.jsxs)(`div`,{className:`flex min-h-0 flex-col overflow-hidden rounded-md border border-border-strong bg-card`,children:[(0,u.jsxs)(`div`,{ref:I,className:`list-scroll @container min-h-0 flex-1 overflow-auto`,children:[P&&M!==void 0?(0,u.jsx)(`ul`,{className:`divide-y divide-border`,children:i.map(e=>(0,u.jsxs)(`li`,{...j(e),className:a(`row-hover flex min-h-10 flex-col justify-center gap-2 px-3 py-3`,O?.(e)===!0&&`bg-accent/70`,D!==void 0&&`cursor-pointer`,l?.(e)),children:[(0,u.jsx)(`div`,{className:`min-w-0`,children:M.cell(e)}),N.some(t=>T(t.cell(e)))&&(0,u.jsx)(`dl`,{className:`grid grid-cols-[7rem_minmax(0,1fr)] gap-x-3 gap-y-1 text-xs`,children:N.map(t=>{let n=t.cell(e);if(!T(n))return null;let r=w(t);return(0,u.jsxs)(f.Fragment,{children:[(0,u.jsx)(`dt`,{className:`text-faint`,children:r}),(0,u.jsx)(`dd`,{className:`min-w-0`,children:n})]},t.id)})})]},c(e)))}):(0,u.jsxs)(g,{containerClassName:`overflow-x-visible`,className:a(t&&`table-fixed`),children:[e?.header!==!1&&(0,u.jsx)(_,{className:`sticky top-0 z-10 bg-card`,children:(0,u.jsx)(y,{className:`border-border-strong hover:bg-transparent`,children:n.map(e=>(0,u.jsx)(b,{className:a(`px-3 text-xs font-medium text-muted-foreground`,e.className),children:e.header},e.id))})}),(0,u.jsx)(v,{children:i.map(e=>(0,u.jsx)(y,{className:a(`row-hover border-border`,O?.(e)===!0?`bg-accent/70 even:bg-accent/70 hover:bg-accent/70`:a(`even:bg-secondary/30`,D!==void 0&&`hover:bg-accent/60`),D!==void 0&&`cursor-pointer`,l?.(e)),...j(e),children:n.map(t=>(0,u.jsx)(x,{className:a(`px-3 py-2`,t.className),children:t.cell(e)},t.id))},c(e)))})]}),p!==null&&(0,u.jsx)(`div`,{ref:A,className:`border-t border-border p-1.5`,children:(0,u.jsx)(o,{variant:`ghost`,size:`sm`,className:`w-full text-muted-foreground`,onClick:h,disabled:d,children:d?`Reading`:`Load 50 more`})})]}),e?.footer!==!1&&(0,u.jsx)(`div`,{className:`shrink-0 border-t border-border px-3 py-2 text-xs text-faint`,children:s(i.length,E,p!==null)})]})})}export{h as n,d as r,E as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-BatatxyT.js";import{c as n}from"./chunk-BV7QT456-Bfa1dvOx.js";import{n as r,t as i}from"./PageState-BxxntCdE.js";import{r as a,t as o}from"./ListTable-B9skT-_Y.js";import{r as s}from"./utils-CRMSf51M.js";import{t as c}from"./use-store-CgWwefFs.js";import{t as l}from"./use-heartbeat-ByRKom_T.js";import{d as u}from"./pipelines-CU_Q479F.js";import{$ as d,Ft as f,_ as p,et as m,l as h,m as g,pt as _,t as v,ut as y,v as b}from"./index-DziHXrVI.js";import{l as x}from"./connections-1Ltd2U4L.js";import{a as S,c as ee,d as C,f as w,l as T,n as E,o as D,p as O,r as k,s as A,u as j}from"./TileCard-DuzDmLB3.js";import{a as M}from"./workers-Cn6T4C66.js";import{t as N}from"./AdminOnly-ji4IpQ_T.js";import{t as P}from"./WorkersTable-kH_DDvFt.js";var F=e(t(),1),I=s(),L=e=>e.id,R=()=>{};function z(){return(0,I.jsx)(N,{children:(0,I.jsx)(B,{})})}function B(){let e=p((0,F.useCallback)(()=>h({...v,since:`24h`},null,500),[])),t=p((0,F.useCallback)(()=>h({...v,status:`failed`},null),[])),s=p((0,F.useCallback)(()=>h({...v,status:`completed_with_errors`},null),[])),N=p((0,F.useCallback)(()=>x(null),[])),z=p((0,F.useCallback)(()=>u(null,[],500),[])),B=b((0,F.useCallback)(e=>M(e),[]),L),{again:V,value:H,problem:U,read:W}=e,{again:G}=t,{again:K}=s,{again:q}=N,{again:J}=z,{reload:Y}=B,X=(0,F.useCallback)(()=>{V(),G(),K(),q(),J(),Y()},[q,V,G,K,J,Y]),Z=n();l(X,c(g)),(0,F.useEffect)(()=>(m({note:null,tone:`quiet`,identifier:null}),d),[]),(0,F.useEffect)(()=>_([{id:`admin:reload`,title:`Refresh the overview`,group:y,screen:!0,icon:f,keywords:[`refresh`,`reload`,`dashboard`],run:X}]),[X]);let Q=[{id:`day`,tile:H===null?null:D(H)},{id:`now`,tile:H===null?null:ee(H)},{id:`workers`,tile:B.state.read?C({items:B.state.rows,next:B.state.next}):null},{id:`connections`,tile:N.value===null?null:S(N.value)},{id:`schedules`,tile:z.value===null?null:T(z.value)}],$=j(A(t.value?.items??[],s.value?.items??[]),z.value?.items??[]);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(i,{title:`Overview`,aside:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(a,{tag:`system`}),(0,I.jsx)(O,{onRefresh:X})]})}),(0,I.jsx)(`div`,{className:`mb-6 grid gap-3 sm:grid-cols-2 xl:grid-cols-5`,children:Q.map(e=>e.tile===null?(0,I.jsx)(k,{},e.id):(0,I.jsx)(E,{tile:e.tile},e.id))}),W&&U!==null&&(0,I.jsx)(r,{loading:!1,problem:U,empty:!1,children:null}),(0,I.jsxs)(`section`,{className:`mb-6 space-y-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Needs a look`}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Every run that failed or finished with errors, newest first.`})]}),(0,I.jsx)(r,{loading:!t.read||!s.read,problem:t.problem??s.problem,empty:$.length===0,emptyMessage:`Nothing has failed or finished with errors.`,children:(0,I.jsx)(o,{chrome:{footer:!1},columns:w,rows:$,rowKey:e=>e.run.id,reading:!1,next:null,onMore:R,noun:`runs`,onSelect:e=>void Z(`/runs/${e.run.id}`)})})]}),(0,I.jsxs)(`section`,{className:`space-y-2`,children:[(0,I.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Workers`}),(0,I.jsx)(P,{state:B.state,more:B.more,empty:`No workers. Start one with dg worker; nothing is claimed until one registers.`})]})]})}export{z as AdminOverview};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-BatatxyT.js";import{r as n}from"./with-selector-BQ0vq4Ay.js";import{i as r,r as i,t as a,u as o}from"./dropdown-menu-BmoO2uui.js";import{r as s,t as c}from"./utils-CRMSf51M.js";import{f as l,u}from"./paging-DL6m7m7g.js";var d=n(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),f=n(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),p=n(`server-crash`,[[`path`,{d:`M6 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-2`,key:`4b9dqc`}],[`path`,{d:`M6 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-2`,key:`22nnkd`}],[`path`,{d:`M6 6h.01`,key:`1utrut`}],[`path`,{d:`M6 18h.01`,key:`uhywen`}],[`path`,{d:`m13 6-4 6h6l-4 6`,key:`14hqih`}]]),m=s(),h=e(t(),1),g=`(max-width: 767px)`,_=`(max-width: 1023px)`;function v(e){let t=typeof window>`u`?null:window.matchMedia(e);return{subscribe:e=>(t?.addEventListener(`change`,e),()=>{t?.removeEventListener(`change`,e)}),read:()=>t?.matches??!1}}var y=v(g),b=v(_),x=()=>!1;function S(){return(0,h.useSyncExternalStore)(y.subscribe,y.read,x)}function C(){return(0,h.useSyncExternalStore)(b.subscribe,b.read,x)}function w({why:e,children:t}){return e===void 0?t:(0,m.jsx)(`span`,{title:e,children:t})}function T({actions:e}){let t=S();if(e.length===0)return null;let n=e[e.length-1],s=e.slice(0,-1);return t?(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s.length>0&&(0,m.jsxs)(a,{children:[(0,m.jsx)(o,{render:(0,m.jsx)(l,{variant:`ghost`,size:`icon-sm`,"aria-label":`More actions`}),children:(0,m.jsx)(d,{className:`size-4`,"aria-hidden":!0})}),(0,m.jsx)(i,{align:`end`,children:s.map(e=>(0,m.jsxs)(r,{disabled:e.disabled,onClick:e.onClick,variant:e.destructive===!0?`destructive`:`default`,children:[e.icon!==void 0&&(0,m.jsx)(e.icon,{className:`size-4`,"aria-hidden":!0}),e.label]},e.id))})]}),n!==void 0&&(0,m.jsx)(E,{action:n})]})}):(0,m.jsx)(`div`,{className:`flex items-center gap-2`,children:e.map(e=>(0,m.jsx)(E,{action:e},e.id))})}function E({action:e}){let t=e.icon;return(0,m.jsx)(w,{why:e.why,children:(0,m.jsxs)(l,{variant:e.variant??`outline`,size:`sm`,"aria-label":e.ariaLabel,disabled:e.disabled,title:e.why,className:e.destructive===!0?`destructive-action`:void 0,onClick:e.onClick,children:[t!==void 0&&(0,m.jsx)(t,{"aria-hidden":!0}),e.label]})})}function D({className:e,size:t=`default`,...n}){return(0,m.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:c(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...n})}function O({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`card-content`,className:c(`px-(--card-spacing)`,e),...t})}function k({loading:e,problem:t,empty:n,emptyMessage:r,children:i}){if(e)return(0,m.jsx)(D,{children:(0,m.jsxs)(O,{className:`flex items-center gap-2 py-2 text-sm text-muted-foreground`,children:[(0,m.jsx)(f,{className:`size-4 animate-spin`,"aria-hidden":!0}),`Reading from the server`]})});if(t!==null){let e=u(t);return(0,m.jsx)(D,{children:(0,m.jsxs)(O,{className:`flex items-start gap-3 py-8`,children:[(0,m.jsx)(p,{className:`mt-0.5 size-4 shrink-0 text-destructive`,"aria-hidden":!0}),(0,m.jsxs)(`div`,{className:`space-y-1`,children:[(0,m.jsx)(`p`,{className:`text-sm font-medium`,children:t.title}),e.detail!==null&&(0,m.jsx)(`p`,{className:`text-xs break-words text-muted-foreground`,children:e.detail}),e.problems.length>0&&(0,m.jsx)(`ul`,{className:`list-disc space-y-0.5 pl-4 text-xs text-muted-foreground`,children:e.problems.map(e=>(0,m.jsx)(`li`,{className:`font-mono break-all`,children:e},e))})]})]})})}return n?(0,m.jsx)(D,{children:(0,m.jsx)(O,{className:`py-2 text-sm text-muted-foreground`,children:r})}):(0,m.jsx)(m.Fragment,{children:i})}function A({title:e,description:t,aside:n,actions:r}){return(0,m.jsxs)(`div`,{className:`mb-6 flex flex-nowrap items-start justify-between gap-4`,children:[(0,m.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,m.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight`,children:e}),t!==void 0&&(0,m.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t})]}),(n!==void 0||r!==void 0)&&(0,m.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 pt-1`,children:[n,r!==void 0&&(0,m.jsx)(T,{actions:r})]})]})}export{T as a,S as c,O as i,f as l,k as n,w as o,D as r,C as s,A as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-BatatxyT.js";import{Nr as n}from"./api-DxX94A25.js";import{t as r}from"./copy-C7fd9gfy.js";import{r as i}from"./utils-CRMSf51M.js";import{f as a}from"./paging-DL6m7m7g.js";var o=e(t(),1),s=i();function c({term:e,detail:t}){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`dt`,{className:`text-faint`,children:e}),(0,s.jsx)(`dd`,{className:`break-words text-foreground`,children:t})]})}function l({title:e,children:t}){return(0,s.jsxs)(`section`,{className:`space-y-2`,children:[(0,s.jsx)(`h2`,{className:`text-xs font-semibold tracking-wide text-muted-foreground uppercase`,children:e}),t]})}var u=1200;function d({value:e,label:t}){let[i,c]=(0,o.useState)(!1);return(0,s.jsxs)(`span`,{className:`flex items-start gap-1`,children:[(0,s.jsx)(`span`,{className:`identifier`,children:e}),(0,s.jsx)(a,{variant:`ghost`,size:`icon-xs`,"aria-label":t,onClick:()=>{navigator.clipboard?.writeText(e).then(()=>{c(!0),setTimeout(()=>{c(!1)},u)},()=>{})},children:i?(0,s.jsx)(n,{className:`size-3`,"aria-hidden":!0}):(0,s.jsx)(r,{className:`size-3`,"aria-hidden":!0})})]})}export{c as n,l as r,d as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-BatatxyT.js";import{i as n}from"./with-selector-BQ0vq4Ay.js";import{$ as r,C as i,Cn as a,Cr as o,D as s,Dn as c,Dr as l,Er as u,Hn as d,Jn as f,M as p,Mr as m,N as h,Nr as g,Nt as _,O as ee,Or as v,R as y,Sn as b,Tn as te,Tr as x,Un as S,Z as C,_r as w,an as T,ar as ne,at as E,bn as D,br as re,d as O,dn as ie,er as k,fn as ae,gn as A,gt as j,it as M,j as oe,k as se,kn as ce,kr as N,kt as le,mn as ue,mr as de,nn as P,on as fe,ot as pe,p as me,pn as F,pt as I,rn as he,rt as ge,sn as _e,tn as ve,un as L,vt as ye,wn as be,xn as xe,yr as Se,yt as Ce}from"./api-DxX94A25.js";import{t as we}from"./chevron-down-Cs1_pMxC.js";import{M as Te,S as Ee,T as De,_ as Oe,b as ke,d as Ae,f as je,g as Me,h as Ne,v as Pe,w as Fe,x as Ie,y as Le}from"./dropdown-menu-BmoO2uui.js";import{t as Re}from"./x-CaKz-2po.js";import{r as ze,t as Be}from"./utils-CRMSf51M.js";import{c as Ve,d as He,f as Ue,g as We,h as Ge,i as Ke,l as qe,m as Je,n as Ye,p as Xe,r as Ze,s as Qe,t as $e,u as et}from"./resolveAriaLabelledBy-Bm8j8jxz.js";import"./paging-DL6m7m7g.js";import{a as tt,c as nt,i as rt,l as it,n as at,o as ot,r as st,s as ct,u as lt}from"./input-C5XexCJf.js";import{Ct as ut,Et as dt,Tt as ft,wt as pt}from"./index-DziHXrVI.js";var R=e(t(),1),mt=e(n(),1),z=ze();function ht(e,t,n,r,i,a,o,s,c,l=2){let u=le(n.current,{event:e,orientation:r,loopFocus:i,rtl:a,cols:l,disabledIndices:o,minIndex:s,maxIndex:c,prevIndex:t>c?s:t,stopEvent:!0});return _(n.current,u)?void 0:u}var gt=R.createContext(void 0),_t=R.createContext(void 0),vt=R.createContext(void 0),yt=R.createContext(!1),bt=R.createContext(``);function B(){let e=R.useContext(gt);if(!e)throw Error(x(22));return e}function xt(){let e=R.useContext(_t);if(!e)throw Error(x(23));return e}function V(){let e=R.useContext(vt);if(!e)throw Error(x(24));return e}function St(){return R.useContext(bt)}function Ct(){return R.useContext(yt)}var H={id:e=>e.id,labelId:e=>e.labelId,items:e=>e.items,selectedValue:e=>e.selectedValue,hasSelectionChips:e=>{let t=e.selectedValue;return Array.isArray(t)&&t.length>0},hasSelectedValue:e=>{let{selectedValue:t,selectionMode:n}=e;return t==null?!1:n===`multiple`&&Array.isArray(t)?t.length>0:!0},hasNullItemLabel:(e,t)=>t?Ze(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMounted:e=>e.forceMounted,inline:e=>e.inline,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(e=>qe(t,e,n)):qe(t,r,n)},transitionStatus:e=>e.transitionStatus,popupProps:e=>e.popupProps,listProps:e=>e.listProps,inputProps:e=>e.inputProps,triggerProps:e=>e.triggerProps,itemProps:e=>e.itemProps,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupId:e=>e.popupId,triggerElement:e=>e.triggerElement,inputElement:e=>e.inputElement,inputGroupElement:e=>e.inputGroupElement,popupSide:e=>e.popupSide,openMethod:e=>e.openMethod,inputInsidePopup:e=>e.inputInsidePopup,inputOwnsFormValue:e=>e.inputOwnsFormValue,selectionMode:e=>e.selectionMode,name:e=>e.name,form:e=>e.form,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,grid:e=>e.grid,virtualized:e=>e.virtualized,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,modal:e=>e.modal,autoHighlight:e=>e.autoHighlight};function wt(e){return e==null?void 0:`${e}-popup`}function Tt(e,t){return(n,r)=>n!=null&&e.contains(n,r,t)}function Et(e){return Array.isArray(e)?e.map(e=>Et(e)).join(`,`):e==null?``:String(e)}var Dt=new Map;function Ot(e={}){let t={usage:`search`,sensitivity:`base`,ignorePunctuation:!0,...e},n=`${Et(e.locale)}|${JSON.stringify(t)}`,r=Dt.get(n);if(r)return r;let i=new Intl.Collator(e.locale,t),a={contains(e,t,n){if(!t)return!0;let r=Qe(e,n);for(let e=0;e<=r.length-t.length;e+=1)if(i.compare(r.slice(e,e+t.length),t)===0)return!0;return!1},startsWith(e,t,n){if(!t)return!0;let r=Qe(e,n);return i.compare(r.slice(0,t.length),t)===0},endsWith(e,t,n){if(!t)return!0;let r=Qe(e,n),a=t.length;return r.length>=a&&i.compare(r.slice(r.length-a),t)===0}};return Dt.set(n,a),a}var kt=Ot;function At(e,t=!1){let{overflowY:n}=f(e);return n!==`auto`&&n!==`scroll`?!1:t?e.clientHeight>0:e.scrollHeight>e.clientHeight}var jt=Symbol(`none`),Mt={value:jt,index:-1};function Nt(e){let{id:t,onOpenChangeComplete:n,defaultSelectedValue:i=null,selectedValue:o,onSelectedValueChange:s,defaultInputValue:f,inputValue:p,open:h,defaultOpen:g=!1,selectionMode:_,onItemHighlighted:ee,name:te,form:x,disabled:w=!1,readOnly:D=!1,required:re=!1,inputRef:ae,grid:A=!1,items:j,filteredItems:oe,filter:se,openOnInputClick:le=!0,autoHighlight:ue=!1,keepHighlight:de=!1,highlightItemOnHover:pe=!0,loopFocus:me=!0,itemToStringLabel:F,itemToStringValue:I,isItemEqualToValue:he=et,virtualized:ye=!1,inline:Se=!1,fillInputOnItemPress:we=!0,modal:ke=!1,limit:Ae=-1,autoComplete:je=`list`,formAutoComplete:Me,locale:Ne,submitOnItemClick:Fe=!1}=e,{clearErrors:Ie}=tt(),{setDirty:Le,validityData:Re,setFilled:ze,name:Be,disabled:He,setTouched:Ze,setFocused:$e,validationMode:rt,validation:it}=nt(),ot=Ee(),ct=st({id:t}),lt=kt({locale:Ne}),[ut,dt]=R.useState(!1),[ft,pt]=R.useState(null),mt=R.useRef([]),B=R.useRef([]),xt=R.useRef(null),V=R.useRef(null),St=R.useRef(null),Ct=R.useRef(null),wt=R.useRef(null),Et=R.useRef(!0),Dt=R.useRef(!1),Ot=R.useRef(null),Nt=R.useRef(null),Pt=R.useRef(null),Ft=R.useRef(Mt),It=R.useRef(null),Lt=R.useRef([]),Rt=R.useRef(null),U=He||w,zt=Be??te,W=_===`multiple`,Bt=_===`single`,Vt=p!==void 0||f!==void 0,G=j!==void 0,Ht=oe!==void 0,K;K=ue===`always`?`always`:ue?`input-change`:!1;let[q,Ut]=O({controlled:o,default:W?i??l:i,name:`Combobox`,state:`selectedValue`}),Wt=R.useMemo(()=>se===null?()=>!0:se===void 0?Tt(lt,F):se,[se,lt,F]),Gt=m(()=>Vt?f??``:Bt?Qe(q,F):``).current,[J,Kt]=O({controlled:p,default:Gt,name:`Combobox`,state:`inputValue`}),[Y,qt]=O({controlled:h,default:g,name:`Combobox`,state:`open`}),Jt=Ke(j),X=ft??String(J).trim(),Yt=Bt?Qe(q,F):``,Xt=Bt&&!ut&&X!==``&&Yt.length===X.length&<.contains(Yt,X),Zt=Xt?``:X,Qt=G&&Ht&&Xt,$t=R.useMemo(()=>j?Jt?j.flatMap(e=>e.items):j:l,[j,Jt]),en=R.useMemo(()=>{if(oe&&!Qt)return oe;if(!j)return l;if(Jt){let e=j,t=[],n=0;for(let r of e){if(Ae>-1&&n>=Ae)break;let e=Ae>-1?Ae-n:1/0,i=Zt===``?r.items.slice(0,e):[];if(Zt!==``)for(let t of r.items){if(i.length>=e)break;Wt(t,Zt,F)&&i.push(t)}if(i.length>0){let e={...r,items:i};t.push(e),n+=i.length}}return t}if(Zt===``)return Ae>-1?$t.slice(0,Ae):$t;let e=[];for(let t of $t){if(Ae>-1&&e.length>=Ae)break;Wt(t,Zt,F)&&e.push(t)}return e},[oe,Qt,j,Jt,Zt,Ae,Wt,F,$t]),Z=R.useMemo(()=>Jt?en.flatMap(e=>e.items):en,[en,Jt]),Q=m(()=>{let e=null;return Se&&Y&&G&&_!==`none`&&(e=Ue(Z,q,he,W)),new ge({id:ct,labelId:void 0,selectedValue:q,open:Y,items:j,selectionMode:_,listRef:mt,labelsRef:B,popupRef:xt,emptyRef:wt,inputRef:V,startDismissRef:St,endDismissRef:Ct,keyboardActiveRef:Et,chipsContainerRef:Ot,clearRef:Nt,valuesRef:Lt,pointerDownItemRef:Rt,selectionEventRef:Pt,name:zt,form:x,disabled:U,readOnly:D,required:re,grid:A,virtualized:ye,openOnInputClick:le,itemToStringLabel:F,isItemEqualToValue:he,modal:ke,autoHighlight:K,submitOnItemClick:Fe,hasInputValue:Vt,mounted:!1,forceMounted:!1,transitionStatus:`idle`,inline:Se,activeIndex:null,selectedIndex:e,popupProps:{},listProps:{},inputProps:{},triggerProps:{},itemProps:v,positionerElement:null,listElement:null,popupId:void 0,triggerElement:null,inputElement:null,inputGroupElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,inputOwnsFormValue:_===`none`,onOpenChangeComplete:N,setOpen:N,setInputValue:N,setSelectedValue:N,setIndices:N,handleSelection:N,forceMount:N,requestSubmit:N})}).current,tn=_===`none`?J:q,nn=R.useMemo(()=>_===`none`?tn:Array.isArray(q)?q.map(e=>Ve(e,I)):Ve(q,I),[tn,I,_,q]),rn=T(ee),an=T(n),on=M(Q,H.activeIndex),sn=M(Q,H.selectedIndex),cn=M(Q,H.positionerElement),ln=M(Q,H.listElement),un=M(Q,H.triggerElement),dn=M(Q,H.inputElement),fn=M(Q,H.inputGroupElement),$=M(Q,H.inline),pn=M(Q,H.inputInsidePopup),mn=M(Q,H.inputOwnsFormValue),hn=fe(un),{mounted:gn,setMounted:_n,transitionStatus:vn}=r(Y),{openMethod:yn,triggerProps:bn}=Oe(Y),xn=T(()=>nn);at(pn?hn:V,ct,tn,xn,!U,te);let Sn=T(()=>{j?B.current=Z.map(e=>Qe(e,F)):Q.set(`forceMounted`,!0)}),Cn=T((e,t,n)=>{if(t===-1){if(Ft.current===Mt)return;Ft.current=Mt}else Ft.current={value:e,index:t};rn(e,ie(n,void 0,{index:t}))}),wn=T(e=>{Q.update(e);let t=e.activeIndex;if(t===void 0)return;let n=e.type||`none`;t===null?Cn(void 0,-1,n):Cn(Lt.current[t],t,n)}),Tn=T((t,n)=>{if(Dt.current=n.reason===xe,e.onInputValueChange?.(t,n),!n.isCanceled){if(n.reason===`input-change`){Y&&ft!==null&&pt(null);let e=n.event,r=e.inputType;if(e.type===`compositionend`||r!=null&&r!==``&&r!==`insertReplacementText`){let e=t.trim()!==``;e&&dt(!0),It.current={hasQuery:e};let n=Q.state.listElement;if(!Q.state.virtualized&&n){let e=xt.current;for(let t of k(n.firstElementChild??n)){if(!ne(t)||(e?!d(e,t):t.getAttribute(`role`)===`dialog`))break;if(At(t)){t.scrollTop=0;break}}}e&&K&&Q.state.activeIndex==null&&(Y||$)&&Q.set(`activeIndex`,0)}}else n.reason===`input-clear`&&t===``&&Q.state.inputInsidePopup&&(It.current={hasQuery:!1,selection:!0});Kt(t)}}),En=T((t,n)=>{if(Y!==t&&(n.reason===`escape-key`&&G&&Z.length===0&&!wt.current&&n.allowPropagation(),e.onOpenChange?.(t,n),!n.isCanceled&&(t&&pn&&!$&&ft!==null&&(dt(!1),pt(null),J!==``&&n.reason!==`input-change`&&Tn(``,L(xe,n.event))),!t&&ut&&(Bt?($||pt(X),X===``&&dt(!1)):W&&($||pt(X),pn&&wn({activeIndex:null}),(!pn||$)&&Tn(``,L(xe,n.event)))),qt(t),!t&&pn&&(n.reason===`focus-out`||n.reason===`outside-press`)&&(Ze(!0),$e(!1),rt===`onBlur`)))){let e=_===`none`?J:q;it.commit(e)}}),Dn=T((e,t)=>{s?.(e,t),!t.isCanceled&&(Ut(e),(_===`none`&&xt.current&&we||Bt&&!Q.state.inputInsidePopup)&&Tn(Qe(e,F),L(t.reason,t.event)))}),On=T((e,t)=>{let n=S(e),r=Pt.current??e;Pt.current=null;let i=L(a,r),o=n?.closest(`a`)?.getAttribute(`href`);if(o){o.startsWith(`#`)&&En(!1,i);return}if(W){let e=Array.isArray(q)?q:[],n=Je(e,t,he)?Xe(e,t,he):[...e,t];if(Dn(n,i),i.isCanceled||!(V.current&&V.current.value.trim()!==``))return;Q.state.inputInsidePopup?Tn(``,L(xe,i.event)):En(!1,i)}else{if(Dn(t,i),i.isCanceled)return;En(!1,i)}}),kn=T(()=>{let e=it.inputRef.current?.form??Q.state.inputElement?.form;e&&typeof e.requestSubmit==`function`&&e.requestSubmit()}),An=T(()=>{if(_n(!1),an?.(!1),dt(!1),pt(null),wn(_===`none`?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),W&&V.current&&V.current.value!==``&&!Dt.current&&Tn(``,L(xe)),Bt){if(Q.state.inputInsidePopup)V.current&&V.current.value!==``&&Tn(``,L(xe));else{let e=Qe(q,F);V.current&&V.current.value!==e&&Tn(e,L(e===``?xe:c))}}}),jn=R.useMemo(()=>$&&cn?{current:cn.closest(`[role="dialog"]`)}:xt,[$,cn]);C({enabled:!e.actionsRef,open:Y,ref:jn,onComplete(){Y||An()}}),R.useImperativeHandle(e.actionsRef,()=>({unmount:An}),[An]),u(function(){if(Y||(Rt.current=null,_===`none`))return;let e=G?$t:Lt.current;wn({selectedIndex:Ue(e,q,he,W)})},[Y,q,_,W,G,$t,he,wn]),u(()=>{j&&(Lt.current=Z,mt.current.length=Z.length)},[j,Z]),u(()=>{let e=It.current;if(e){let t=Y||$||Q.state.positionerElement?.hidden===!1;if(e.hasQuery)K&&t&&Q.set(`activeIndex`,0),It.current=null;else if(String(J).trim()===``&&(It.current=null,t)){let t=e.selection;K===`always`&&!t&&Q.state.selectionMode===`none`&&Q.set(`activeIndex`,0),queueMicrotask(()=>{if(!Q.state.open&&!Q.state.inline||V.current&&V.current.value.trim()!==``)return;let e=Q.state.selectedValue,n=Q.state.selectionMode===`multiple`,r=n&&Array.isArray(e)?e[e.length-1]:e,i=Q.state.selectionMode!==`none`&&r!=null;if(i||t){let t=G||Ht?Z:Lt.current;Q.set(`activeIndex`,i?Ue(t,e,Q.state.isItemEqualToValue,n):null)}else K===`always`&&Q.set(`activeIndex`,0)})}}if(!Y&&!$)return;let t=G||Ht?Z:Lt.current,n=Q.state.activeIndex;if(n==null){if(K===`always`&&t.length>0){Q.set(`activeIndex`,0);return}Cn(void 0,-1,c);return}if(n>=t.length){Cn(void 0,-1,c),Q.set(`activeIndex`,null);return}let r=t[n],i=Ft.current.value,a=i!==jt&&qe(r,i,Q.state.isItemEqualToValue);(Ft.current.index!==n||!a)&&Cn(r,n,c)},[on,K,Cn,Ht,G,Z,$,Y,Q,J]),u(()=>{if(_===`none`){ze(String(J)!==``);return}ze(W?Array.isArray(q)&&q.length>0:q!=null)},[ze,_,J,q,W]),R.useEffect(()=>{G&&K&&Z.length===0&&wn({activeIndex:null})},[G,K,Z.length,wn]);function Mn(e){let t=Re.initialValue;return Array.isArray(e)&&Array.isArray(t)?!Ye(e,t,(e,t)=>qe(e,t,he)):e!==t}Pe(X,()=>{!Y||X===``||X===String(Gt)||dt(!0)});function Nn(){let e=Qe(q,F);J!==e&&Tn(e,L(c))}Pe(q,()=>{_!==`none`&&(Ie(zt),Le(Mn(q)),it.change(q),Bt&&!Vt&&!pn&&Nn())}),Pe(J,()=>{_===`none`&&(Ie(zt),Le(J!==Re.initialValue),it.change(J))}),Pe(j,()=>{!Bt||Vt||pn||ut||Nn()});let Pn=We({open:$?!0:Y,onOpenChange:En,elements:{reference:pn?un:dn,floating:cn}}),Fn=A?`grid`:`listbox`,In=Y||$,Ln=In?`true`:`false`,Rn=R.useMemo(()=>{let e=dn?.tagName===`INPUT`,t=dn==null||e,n=t||In,r=t?{autoComplete:`off`,spellCheck:`false`,autoCorrect:`off`,autoCapitalize:`none`}:{};return n&&(r.role=`combobox`,r[`aria-expanded`]=Ln,r[`aria-haspopup`]=Fn,r[`aria-controls`]=In?ln?.id:void 0,r[`aria-autocomplete`]=je),{reference:r,floating:{role:`presentation`}}},[dn,In,Ln,Fn,ln?.id,je]),zn=Te(Pn,{enabled:!D&&!U&&le,event:`mousedown-only`,toggle:!1,touchOpenDelay:pn?0:100,reason:b}),Bn=E(Pn,{enabled:!D&&!U&&!$,outsidePressEvent:{mouse:`sloppy`,touch:`intentional`},bubbles:$?!0:void 0,outsidePress(e){let t=S(e);return!d(un,t)&&!d(Nt.current,t)&&!d(Ot.current,t)&&!d(fn,t)}}),Vn=De(Pn,{enabled:!D&&!U,id:ct,listRef:mt,activeIndex:on,selectedIndex:sn,virtual:!0,loopFocus:me,allowEscape:me&&!K,focusItemOnOpen:ut||_===`none`&&!K?!1:`auto`,focusItemOnHover:pe,resetOnPointerLeave:!de,orientation:A?`horizontal`:void 0,rtl:ot===`rtl`,disabledIndices:l,grid:A?ht:void 0,onNavigate(e,t){!t&&!Y||vn===`ending`||wn(t?{activeIndex:e,type:Et.current?be:ce}:{activeIndex:e})}}),Hn=R.useMemo(()=>Ce(Vn.reference,{onKeyDown(e){A&&Q.state.activeIndex==null&&(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&e.preventBaseUIHandler()}},Bn.reference,zn.reference,Rn.reference),[Vn.reference,Bn.reference,zn.reference,Rn.reference,A,Q]),Un=R.useMemo(()=>Ce(y,Bn.floating),[Bn.floating]),Wn=R.useMemo(()=>Ce(Vn.floating,Rn.floating),[Vn.floating,Rn.floating]),Gn=R.useMemo(()=>{let e=Vn.item;return e?{...e,onFocus:void 0}:v},[Vn.item]);Ge(()=>{Q.update({inline:Se,popupProps:Un,listProps:Wn,inputProps:Hn,triggerProps:bn,itemProps:Gn,setOpen:En,setInputValue:Tn,setSelectedValue:Dn,setIndices:wn,handleSelection:On,forceMount:Sn,requestSubmit:kn,onOpenChangeComplete:an})}),u(()=>{Q.update({id:ct,selectedValue:q,open:Y,mounted:gn,transitionStatus:vn,items:j,inline:Se,popupProps:Un,listProps:Wn,inputProps:Hn,triggerProps:bn,openMethod:yn,itemProps:Gn,selectionMode:_,name:zt,form:x,disabled:U,readOnly:D,required:re,grid:A,virtualized:ye,openOnInputClick:le,itemToStringLabel:F,modal:ke,autoHighlight:K,isItemEqualToValue:he,submitOnItemClick:Fe,hasInputValue:Vt,inputOwnsFormValue:_===`none`&&(Se||!Q.state.inputInsidePopup)})},[Q,ct,q,Y,gn,vn,j,Un,Wn,Hn,Gn,yn,bn,_,zt,U,D,re,A,ye,le,F,ke,he,Fe,Vt,Se,K,x]);let Kn=_e(ae,it.inputRef),qn=R.useMemo(()=>({query:X,hasItems:G,filteredItems:en,flatFilteredItems:Z}),[X,G,en,Z]),Jn=R.useMemo(()=>Array.isArray(tn)?``:Ve(tn,I),[tn,I]),Yn=W&&Array.isArray(q)&&q.length>0,Xn=W||_===`none`&&mn?void 0:zt,Zn=R.useMemo(()=>!W||!Array.isArray(q)||!zt?null:q.map(e=>{let t=Ve(e,I);return(0,z.jsx)(`input`,{type:`hidden`,form:x,name:zt,value:t,disabled:U},t)}),[W,q,x,zt,I,U]),Qn=(0,z.jsxs)(R.Fragment,{children:[e.children,(0,z.jsx)(`input`,{...it.getValidationProps(U,{onFocus(){if(pn){un?.focus();return}(V.current||un)?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented||U||D)return;let t=e.currentTarget.value,n=t.toLowerCase(),r=L(c,e.nativeEvent),i=()=>Lt.current.findIndex(e=>Ve(e,I).toLowerCase()===n||Qe(e,F).toLowerCase()===n);function a(){if(W)return;if(_===`none`){Tn(t,r);return}let e=i();e===-1&&(e=Lt.current.findIndex((e,t)=>{let r=B.current[t];return r!=null&&r.toLowerCase()===n}));let a=e===-1?void 0:Lt.current[e];a!=null&&Dn?.(a,r)}Bt&&(Sn(),j&&i()===-1&&Q.set(`forceMounted`,!0)),queueMicrotask(a)}}),id:ct&&Xn==null?`${ct}-hidden-input`:void 0,form:x,name:Xn,autoComplete:Me,disabled:U,required:re&&!Yn,readOnly:D,value:Jn,ref:Kn,style:Xn?P:ve,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Zn]});return(0,z.jsx)(gt.Provider,{value:Q,children:(0,z.jsx)(_t.Provider,{value:Pn,children:(0,z.jsx)(yt.Provider,{value:G,children:(0,z.jsx)(vt.Provider,{value:qn,children:(0,z.jsx)(bt.Provider,{value:J,children:Qn})})})})})}var Pt={...oe,...lt,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":``}:null};function Ft(e){let t=M(e,H.mounted),n=M(e,H.popupSide),r=M(e,H.positionerElement);return t&&r?n:null}function It(){return V().filteredItems.length===0}function Lt(e){return e===`rtl`?[`ArrowRight`,`ArrowLeft`]:[`ArrowLeft`,`ArrowRight`]}function Rt(e,t){let n=e>=t-1?t-2:e;return n>=0?n:void 0}function U(e,t,n){let r=e.state.listRef.current[t];r&&(e.state.selectionEventRef.current=n,r.click(),e.state.selectionEventRef.current=null)}var zt=R.forwardRef(function(e,t){let{render:n,className:r,nativeButton:a=!0,disabled:s=!1,id:l,style:u,...f}=e,{state:p,disabled:m,setTouched:h,setFocused:g,validationMode:_,validation:ee}=nt(),{labelId:v}=rt(),y=B(),b=M(y,H.selectionMode),x=M(y,H.disabled),C=M(y,H.readOnly),w=M(y,H.required),ne=M(y,H.positionerElement),E=M(y,H.listElement),D=M(y,H.popupId),re=M(y,H.triggerProps),O=M(y,H.inputInsidePopup),ie=M(y,H.id),k=M(y,H.labelId),A=M(y,H.open),j=M(y,H.selectedValue),oe=M(y,H.activeIndex),se=M(y,H.selectedIndex),ce=M(y,H.hasSelectedValue),N=xt(),le=St(),ue=o(),P=m||x||s,fe=It(),pe=Ft(y);st({id:O?l:void 0});let me=O?l??ie:l,F=$e(v,k),I;A&&O?I=D??wt(ie):A&&(I=E?.id);let ge=R.useRef(``);function _e(e){ge.current=e.pointerType}let{reference:ve}=Fe(N,{enabled:!A&&!C&&!x&&b===`single`,listRef:y.state.labelsRef,activeIndex:oe,selectedIndex:se,onMatch(e){let t=y.state.valuesRef.current[e];t!==void 0&&y.state.setSelectedValue(t,L(c))}}),{reference:be}=Te(N,{enabled:!C&&!x,event:`mousedown`}),{buttonRef:xe,getButtonProps:Se}=i({native:a,disabled:P}),Ce={...p,open:A,disabled:P,popupSide:pe,listEmpty:fe,placeholder:b!==`none`&&!ce},we=T(e=>{y.set(`triggerElement`,e)});return ye(`button`,e,{ref:[t,xe,we],state:Ce,props:[re,be,ve,{id:me,tabIndex:O?0:-1,role:O?`combobox`:void 0,"aria-expanded":A,"aria-haspopup":O?`dialog`:`listbox`,"aria-controls":I,"aria-required":O&&w||void 0,"aria-labelledby":F,onPointerDown:_e,onPointerEnter:_e,onFocus(){g(!0),!(P||C)&&ue.start(0,y.state.forceMount)},onBlur(e){if(!d(ne,e.relatedTarget)&&(h(!0),g(!1),_===`onBlur`)){let e=b===`none`?le:j;ee.commit(e)}},onMouseDown(e){if(P||C||(O||N.set(`domReferenceElement`,e.currentTarget),y.state.forceMount(),ge.current!==`touch`&&(y.state.inputRef.current?.focus(),O||e.preventDefault()),A))return;let t=he(e.currentTarget);function n(e){let t=y.state.triggerElement;if(!t)return;let n=S(e),r=y.state.positionerElement,i=y.state.listElement;d(t,n)||d(r,n)||d(i,n)||Ae(e,t)||y.state.setOpen(!1,L(ae,e))}O&&t.addEventListener(`mouseup`,n,{once:!0})},onKeyDown(e){C||(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(de(e),y.state.setOpen(!0,L(te,e.nativeEvent)),y.state.inputRef.current?.focus())}},ee.getValidationProps(P,f),Se],stateAttributesMapping:Pt})}),W=R.createContext(void 0);function Bt(){return R.useContext(W)}var Vt=R.createContext(void 0);function G(e){let t=R.useContext(Vt);if(t===void 0&&!e)throw Error(x(21));return t}var Ht=R.forwardRef(function(e,t){let n=B(),{buttonRef:r,getButtonProps:a}=i({native:!1}),o=_e(t,r);function s(e){n.state.setOpen(!1,L(ue,e.nativeEvent,e.currentTarget))}let c=a({onClick:s});return(0,z.jsx)(`span`,{ref:o,...c,"aria-label":`Dismiss`,tabIndex:void 0,style:P})}),K=R.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,id:a,style:o,...s}=e,{state:l,disabled:u,setTouched:d,setFocused:f,validationMode:p,validation:m}=nt(),{labelId:h}=rt(),g=Bt(),_=!!G(!0),v=B(),y=St(),b=Ee(),te=M(v,H.required),x=M(v,H.disabled),S=M(v,H.readOnly),C=M(v,H.name),ne=M(v,H.form),E=M(v,H.selectionMode),re=M(v,H.autoHighlight),O=M(v,H.inputProps),ie=M(v,H.triggerProps),k=M(v,H.open),ae=M(v,H.mounted),j=M(v,H.selectedValue),oe=M(v,H.id),se=M(v,H.inline),N=M(v,H.modal),le=!!re,ue=Ft(v),P=u||x||i,fe=It(),pe=_||se,me=!pe||N,F=ee(a??(pe?void 0:oe)),I=_?it:l,[he,ge]=R.useState(null),_e=R.useRef(!1),ve=R.useRef(null),Ce=R.useRef(!1),we=E===`none`&&!_,Te=T(e=>{let t=_||v.state.inline;t&&!v.state.hasInputValue&&v.state.setInputValue(``,L(c)),v.update({inputElement:e,inputInsidePopup:t,inputOwnsFormValue:we})}),De=_?s:m.getValidationProps(P,s);function Oe(){v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?be:ce})}function ke(){v.state.keyboardActiveRef.current=!1}let Ae={...I,open:k,disabled:P,readOnly:S,popupSide:ue,listEmpty:fe};function je(e){if(!g)return;let t,{highlightedChipIndex:n}=g,r=g.chipsRef.current.length,[i,a]=Lt(b);return n===void 0?(e.key===i&&(e.currentTarget.selectionStart??0)===0&&j.length>0&&(e.preventDefault(),t=r>0?r-1:void 0),t):(e.key===i?(e.preventDefault(),t=n>0?n-1:void 0):e.key===a?(e.preventDefault(),t=n<r-1?n+1:void 0):(e.key===`Backspace`||e.key===`Delete`)&&(e.preventDefault(),t=Rt(n,j.length),Oe()),t)}let Me=ye(`input`,e,{state:Ae,ref:[t,v.state.inputRef,Te],props:[O,ie,{value:he??y,"aria-readonly":S||void 0,"aria-required":te||void 0,"aria-labelledby":h,disabled:P,readOnly:S,required:E===`none`?te:void 0,form:ne,...we&&C&&{name:C},id:F,onFocus(){if(f(!0),!se||!Ce.current)return;Ce.current=!1;let e=ve.current;e==null||!Object.hasOwn(v.state.valuesRef.current,e)||v.state.setIndices({activeIndex:e})},onBlur(){d(!0),f(!1);let e=v.state.activeIndex;if(se&&e!==null&&re!==`always`&&(ve.current=e,Ce.current=!0,v.state.setIndices({activeIndex:null})),p===`onBlur`){let e=E===`none`?y:j;m.commit(e)}},onCompositionStart(e){Se||(_e.current=!0,ge(e.currentTarget.value))},onCompositionEnd(e){_e.current=!1;let t=e.currentTarget.value;ge(null),v.state.setInputValue(t,L(D,e.nativeEvent))},onChange(e){let t=e.nativeEvent,n=t.inputType,r=!n||n===`insertReplacementText`,i=_e.current||!r;function a(e){S||P||!e||!i||(v.state.setOpen(!0,L(D,t)),le||Oe())}if(_e.current){let n=e.currentTarget.value;ge(n),n===``&&!v.state.openOnInputClick&&!v.state.inputInsidePopup&&v.state.setOpen(!1,L(xe,t));let r=n.trim(),i=le&&r!==``;a(r),k&&v.state.activeIndex!==null&&!i&&Oe();return}let o=L(D,t);if(v.state.setInputValue(e.currentTarget.value,o),o.isCanceled)return;let s=e.currentTarget.value===``,c=L(xe,t);s&&!v.state.inputInsidePopup&&(E===`single`&&v.state.setSelectedValue(null,c),v.state.openOnInputClick||v.state.setOpen(!1,c)),a(e.currentTarget.value.trim()),k&&v.state.activeIndex!==null&&!le&&Oe()},onKeyDown(e){if(P||S||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;v.state.keyboardActiveRef.current=!0;let t=e.currentTarget,n=t.scrollWidth-t.clientWidth,r=b===`rtl`;if(e.key===`Home`){de(e);let n=w&&r?t.value.length:0;t.setSelectionRange(n,n),t.scrollLeft=0;return}if(e.key===`End`){de(e);let i=w&&r?0:t.value.length;t.setSelectionRange(i,i),t.scrollLeft=r?-n:n;return}if(!ae&&e.key===`Escape`){let t=E===`multiple`&&Array.isArray(j)?j.length===0:j===null,n=L(A,e.nativeEvent),r=E===`multiple`?[]:null;v.state.setInputValue(``,n),v.state.setSelectedValue(r,n),!t&&!v.state.inline&&!n.isPropagationAllowed&&e.stopPropagation();return}if(g&&e.key===`Backspace`&&t.value===``&&g.highlightedChipIndex===void 0&&Array.isArray(j)&&j.length>0){let t=g.chipsRef.current.length,n=t>0?t-1:j.length-1,r=j.filter((e,t)=>t!==n);Oe(),v.state.setSelectedValue(r,L(c,e.nativeEvent));return}let i=g?.highlightedChipIndex!==void 0,a=je(e);if(g?.setHighlightedChipIndex(a),a===void 0?i&&v.state.inputRef.current?.focus():g?.chipsRef.current[a]?.focus(),e.which!==229&&e.key===`Enter`&&k){let t=v.state.activeIndex,n=e.nativeEvent;if(t===null){if(se)return;v.state.setOpen(!1,L(c,n));return}de(e),U(v,t,n)}},onPointerMove:ke,onPointerDown:ke},De],stateAttributesMapping:Pt}),Ne=_?(0,z.jsx)(ct.Provider,{value:ot,children:Me}):Me;return(0,z.jsxs)(R.Fragment,{children:[k&&me&&(0,z.jsx)(Ht,{ref:v.state.startDismissRef}),Ne]})}),q={...h,...p},Ut=R.forwardRef(function(e,t){let{render:n,className:a,disabled:o=!1,nativeButton:s=!0,keepMounted:c=!1,style:l,...u}=e,{disabled:d}=nt(),f=B(),p=M(f,H.selectionMode),m=M(f,H.disabled),h=M(f,H.readOnly),g=M(f,H.open),_=M(f,H.selectedValue),ee=M(f,H.hasSelectionChips),v=St(),y=!1;y=p===`none`?v!==``:p===`single`?_!=null:ee;let b=d||m||o,{buttonRef:te,getButtonProps:x}=i({native:s,disabled:b}),{mounted:S,transitionStatus:w,setMounted:T}=r(y),ne={disabled:b,visible:y,open:g,transitionStatus:w};C({open:y,ref:f.state.clearRef,onComplete(){y||T(!1)}});let E=ye(`button`,e,{state:ne,ref:[t,te,f.state.clearRef],props:[{tabIndex:-1,children:`x`,onMouseDown(e){e.preventDefault()},onClick(e){if(b||h)return;let t=f.state.keyboardActiveRef.current?be:ce;f.state.setInputValue(``,L(F,e.nativeEvent)),p===`none`?f.state.setIndices({activeIndex:null,type:t}):(f.state.setSelectedValue(Array.isArray(_)?[]:null,L(F,e.nativeEvent)),f.state.setIndices({activeIndex:null,selectedIndex:null,type:t})),f.state.inputRef.current?.focus()}},u,x],stateAttributesMapping:q});return c||S?E:null}),Wt=R.createContext(null);function Gt(){return R.useContext(Wt)}function J(e){let{children:t}=e,{filteredItems:n}=V(),r=Gt(),i=r?r.items:n;return(0,z.jsx)(R.Fragment,{children:i.map(t)})}var Kt=R.forwardRef(function(e,t){var n;let{render:r,className:i,style:a,children:o,...s}=e,c=B(),l=xt(),u=!!G(!0),{filteredItems:d,hasItems:f}=V(),p=M(c,H.selectionMode),m=M(c,H.grid),h=M(c,H.listProps),g=M(c,H.virtualized),_=M(c,H.forceMounted),ee=p===`multiple`,v=d.length===0,y=T(e=>{c.set(`positionerElement`,e)}),b=T(e=>{c.set(`listElement`,e)}),te=R.useMemo(()=>typeof o==`function`?n||=(0,z.jsx)(J,{children:o}):o,[o]),x={empty:v},S=l.useState(`floatingId`),C=ye(`div`,e,{state:x,ref:[t,b,u?null:y],props:[h,{children:te,tabIndex:-1,id:S,role:m?`grid`:`listbox`,"aria-multiselectable":ee?`true`:void 0,onKeyDown(e){if(!(c.state.disabled||c.state.readOnly)&&e.key===`Enter`){let t=c.state.activeIndex;if(t==null)return;de(e),U(c,t,e.nativeEvent)}},onKeyDownCapture(){c.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){c.state.keyboardActiveRef.current=!1}},s]});if(g)return C;let w=f&&!_?void 0:c.state.labelsRef;return(0,z.jsx)(Me,{elementsRef:c.state.listRef,labelsRef:w,children:C})}),Y=``;function qt(e){let t=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=null;for(;t.nextNode();){let e=t.currentNode;e.nodeValue!==``&&(n=e)}return n}function Jt(){let e=o(),t=R.useRef(null);return R.useEffect(()=>{if(re)return;let n=t.current;if(n==null)return;let r=qt(n);if(r==null)return;let i=r.data,a=`${i}${Y}`;return r.nodeValue=a,e.start(200,()=>{r.nodeValue===a&&(r.nodeValue=i)}),()=>{e.clear(),r.nodeValue===a&&(r.nodeValue=i)}},[t,e]),t}var X=R.createContext(void 0);function Yt(){let e=R.useContext(X);if(e===void 0)throw Error(x(20));return e}var Xt=R.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=B(),a=M(i,H.mounted),o=M(i,H.forceMounted);return a||n||o?(0,z.jsx)(X.Provider,{value:n,children:(0,z.jsx)(I,{ref:t,...r})}):null}),Zt=R.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a,side:o,align:c,sideOffset:l,alignOffset:d,collisionBoundary:f=`clipping-ancestors`,collisionPadding:p,arrowPadding:m,sticky:h,disableAnchorTracking:g=!1,collisionAvoidance:_=j,style:ee,...v}=e,y=B(),b=xt(),te=Yt(),x=M(y,H.modal),S=M(y,H.open),C=M(y,H.mounted),w=M(y,H.openMethod),ne=M(y,H.positionerElement),E=M(y,H.triggerElement),D=M(y,H.inputElement),re=M(y,H.inputGroupElement),O=M(y,H.inputInsidePopup),ie=M(y,H.transitionStatus),k=It(),ae=Ie({anchor:i??(O?E:re??D),floatingRootContext:b,positionMethod:a,mounted:C,side:o,sideOffset:l,align:c,alignOffset:d,arrowPadding:m,collisionBoundary:f,collisionPadding:p,sticky:h,disableAnchorTracking:g,keepMounted:te,collisionAvoidance:_,lazyFlip:!0});je(S&&x,w===`touch`,ne,E);let A={open:S,side:ae.side,align:ae.align,anchorHidden:ae.anchorHidden,empty:k};u(()=>{y.set(`popupSide`,ae.side)},[y,ae.side]);let oe=T(e=>{y.set(`positionerElement`,e)}),se=Le(e,A,{styles:ae.positionerStyles,transitionStatus:ie,props:v,refs:[t,oe],hidden:!C,inert:!S});return(0,z.jsxs)(Vt.Provider,{value:ae,children:[C&&x&&(0,z.jsx)(me,{inert:s(!S),cutout:re??D??E}),se]})}),Qt={...se,...h},$t=R.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=B(),l=G(),f=xt(),p=M(c,H.mounted),m=M(c,H.open),h=M(c,H.openMethod),g=M(c,H.popupProps),_=M(c,H.transitionStatus),ee=M(c,H.inputInsidePopup),v=M(c,H.inputElement),y=M(c,H.modal),b=M(c,H.id),te=It(),x=s.id??(ee?wt(b):void 0);u(()=>(c.set(`popupId`,c.state.popupRef.current?.id||x),()=>{c.set(`popupId`,void 0)}),[c,x]),C({open:m,ref:c.state.popupRef,onComplete(){m&&c.state.onOpenChangeComplete(!0)}});let w={open:m,side:l.side,align:l.align,anchorHidden:l.anchorHidden,transitionStatus:_,empty:te},T=ye(`div`,e,{state:w,ref:[t,c.state.popupRef],props:[g,{id:x,role:ee?`dialog`:`presentation`,onFocus(e){let t=S(e.nativeEvent);h!==`touch`&&(d(c.state.listElement,t)||t===e.currentTarget)&&c.state.inputRef.current?.focus()}},ke(_),s],stateAttributesMapping:Qt}),ne=a===void 0?ee?e=>e===`touch`?c.state.popupRef.current:v:!1:a,E;E=o??(ee?void 0:!1);let D=!ee||y;return(0,z.jsx)(pe,{context:f,disabled:!p,modal:D,openInteractionType:h,initialFocus:ne,returnFocus:E,getInsideElements:()=>[c.state.startDismissRef.current,c.state.endDismissRef.current],children:(0,z.jsxs)(R.Fragment,{children:[T,D&&(0,z.jsx)(Ht,{ref:c.state.endDismissRef})]})})}),en=R.createContext(void 0);function Z(){let e=R.useContext(en);if(!e)throw Error(x(19));return e}var Q=R.createContext(!1);function tn(){return R.useContext(Q)}function nn(e){let{componentProps:t,forwardedRef:n,virtualized:r,indexFromFilter:a}=e,{render:o,className:s,style:c,value:l=null,index:d,disabled:f=!1,nativeButton:p=!1,...m}=t,h=R.useRef(null),g=Ne({guess:!0,index:d,textRef:h}),_=B(),ee=tn(),v=Ct(),y=M(_,H.selectionMode),b=M(_,H.disabled),te=M(_,H.readOnly),x=M(_,H.isItemEqualToValue),S=b||f,C=y!==`none`,w=d??a??g.index,T=w!==-1,ne=M(_,H.id),E=M(_,H.isActive,w),D=M(_,H.isSelected,l),re=M(_,H.itemProps),O=R.useRef(null),ie=ne!=null&&T?`${ne}-${w}`:void 0,k=D&&C;u(()=>{if(!(T&&(r||d!=null)))return;let e=_.state.listRef.current;return e[w]=O.current,()=>{delete e[w]}},[T,r,w,d,_]),u(()=>{if(!T||v)return;let e=_.state.valuesRef.current;return e[w]=l,()=>{delete e[w]}},[T,v,w,l,_]),u(()=>{if(!T||v)return;let e=_.state.selectedValue,t=Array.isArray(e)?e[e.length-1]:e;qe(l,t,x)&&_.set(`selectedIndex`,w)},[T,v,_,w,l,x]);let{getButtonProps:ae,buttonRef:A}=i({disabled:S,focusableWhenDisabled:!0,native:p,composite:!0}),j={disabled:S,selected:k,highlighted:E};function oe(e){function t(){_.state.handleSelection(e,l)}_.state.submitOnItemClick?(mt.flushSync(t),_.state.requestSubmit()):t()}let se={id:ie,role:ee?`gridcell`:`option`,"aria-selected":C?k:void 0,tabIndex:void 0,onPointerDownCapture(e){e.isPrimary&&(_.state.pointerDownItemRef.current=e.currentTarget),e.preventDefault()},onMouseDown(e){e.preventDefault()},onClick(e){S||te||oe(e.nativeEvent)},onMouseUp(e){let t=_.state.pointerDownItemRef.current===e.currentTarget;_.state.pointerDownItemRef.current=null,!(S||te||e.button!==0||t||!E)&&oe(e.nativeEvent)}},ce=ye(`div`,t,{ref:[A,n,g.ref,O],state:j,props:[re,se,m,ae]}),N=R.useMemo(()=>({selected:k,textRef:h}),[k,h]);return(0,z.jsx)(en.Provider,{value:N,children:ce})}function rn(e){let{componentProps:t,forwardedRef:n}=e,r=B(),i=M(r,H.isItemEqualToValue),{flatFilteredItems:a}=V(),o=He(a,t.value??null,i);return(0,z.jsx)(nn,{componentProps:t,forwardedRef:n,virtualized:!0,indexFromFilter:o})}var an=R.memo(R.forwardRef(function(e,t){let n=B(),r=M(n,H.virtualized);return r&&e.index==null?(0,z.jsx)(rn,{componentProps:e,forwardedRef:t}):(0,z.jsx)(nn,{componentProps:e,forwardedRef:t,virtualized:r,indexFromFilter:void 0})})),on=R.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,{filteredItems:s}=V(),c=B(),l=Jt(),u=s.length===0?a:null;return ye(`div`,e,{ref:[t,c.state.emptyRef,l],props:[{children:u,role:`status`,"aria-live":`polite`,"aria-atomic":!0},o]})});function sn(e){let{multiple:t=!1,defaultValue:n,value:r,onValueChange:i,autoComplete:a,...o}=e;return(0,z.jsx)(Nt,{...o,selectionMode:t?`multiple`:`single`,selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:i,formAutoComplete:a})}var cn=R.forwardRef(function(e,t){let{selected:n}=Z();return e.keepMounted||n?(0,z.jsx)(ln,{...e,ref:t}):null}),ln=R.memo(R.forwardRef((e,t)=>{let{render:n,className:i,style:a,keepMounted:o,...s}=e,{selected:c}=Z(),l=R.useRef(null),{transitionStatus:u,setMounted:d}=r(c),f=ye(`span`,e,{ref:[t,l],state:{selected:c,transitionStatus:u},props:[{"aria-hidden":!0,children:`✔️`},s],stateAttributesMapping:h});return C({open:c,ref:l,onComplete(){c||d(!1)}}),f})),un=sn;function dn({className:e,children:t,...n}){return(0,z.jsxs)(zt,{"data-slot":`combobox-trigger`,className:Be(`[&_svg:not([class*='size-'])]:size-4`,e),...n,children:[t,(0,z.jsx)(we,{className:`pointer-events-none size-4 text-muted-foreground`})]})}function fn({className:e,...t}){return(0,z.jsx)(Ut,{"data-slot":`combobox-clear`,render:(0,z.jsx)(ft,{variant:`ghost`,size:`icon-xs`}),className:Be(e),...t,children:(0,z.jsx)(Re,{className:`pointer-events-none`})})}function $({className:e,children:t,disabled:n=!1,showTrigger:r=!0,showClear:i=!1,...a}){return(0,z.jsxs)(ut,{className:Be(`w-auto`,e),children:[(0,z.jsx)(K,{render:(0,z.jsx)(dt,{disabled:n}),...a}),(0,z.jsxs)(pt,{align:`inline-end`,children:[r&&(0,z.jsx)(ft,{size:`icon-xs`,variant:`ghost`,render:(0,z.jsx)(dn,{}),"data-slot":`input-group-button`,className:`group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent`,disabled:n}),i&&(0,z.jsx)(fn,{disabled:n})]}),t]})}function pn({className:e,side:t=`bottom`,sideOffset:n=6,align:r=`start`,alignOffset:i=0,anchor:a,...o}){return(0,z.jsx)(Xt,{children:(0,z.jsx)(Zt,{side:t,sideOffset:n,align:r,alignOffset:i,anchor:a,className:`isolate z-50`,children:(0,z.jsx)($t,{"data-slot":`combobox-content`,"data-chips":!!a,className:Be(`group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o})})})}function mn({className:e,...t}){return(0,z.jsx)(Kt,{"data-slot":`combobox-list`,className:Be(`no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0`,e),...t})}function hn({className:e,children:t,...n}){return(0,z.jsxs)(an,{"data-slot":`combobox-item`,className:Be(`relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...n,children:[t,(0,z.jsx)(cn,{render:(0,z.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:(0,z.jsx)(g,{className:`pointer-events-none`})})]})}function gn({className:e,...t}){return(0,z.jsx)(on,{"data-slot":`combobox-empty`,className:Be(`hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex`,e),...t})}function _n(e,t){let n=t.toLowerCase().split(/\s+/u).filter(Boolean),r=`${e.label} ${e.aside}`.toLowerCase();return n.every(e=>r.includes(e))}function vn({id:e,value:t,options:n,placeholder:r,label:i,onChange:a}){let o=n.find(e=>e.value===t)??null;return(0,z.jsxs)(un,{items:n,value:o,itemToStringLabel:e=>e.label,filter:(e,t)=>_n(e,t),onValueChange:e=>{a(e===null?``:e.value)},children:[(0,z.jsx)($,{id:e,"aria-label":i,placeholder:r,className:`bg-field dark:bg-field`,showTrigger:!1,children:(0,z.jsxs)(pt,{align:`inline-end`,children:[o!==null&&o.aside!==``&&(0,z.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:o.aside}),(0,z.jsx)(ft,{size:`icon-xs`,variant:`ghost`,render:(0,z.jsx)(dn,{})})]})}),(0,z.jsxs)(pn,{children:[(0,z.jsx)(gn,{children:`No match.`}),(0,z.jsx)(mn,{children:e=>(0,z.jsxs)(hn,{value:e,children:[(0,z.jsx)(`span`,{className:`truncate`,children:e.label}),e.aside!==``&&(0,z.jsx)(`span`,{className:`ml-auto font-mono text-xs whitespace-nowrap text-muted-foreground`,children:e.aside})]},e.value)})]})]})}export{vn as t};
|